@stacksjs/stx 0.2.532 → 0.2.534

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 (298) hide show
  1. package/dist/{chunk-y4qks0bd.js → chunk-01343ehq.js} +2 -2
  2. package/dist/chunk-0e5nasyf.js +2 -0
  3. package/dist/chunk-13zbt9py.js +2 -0
  4. package/dist/{chunk-9w2vmfha.js → chunk-1c4t7ncb.js} +2 -2
  5. package/dist/{chunk-gxfnmjzp.js → chunk-1xgs9gd5.js} +2 -2
  6. package/dist/{chunk-4gt0r98p.js → chunk-2bvk0qyd.js} +2 -2
  7. package/dist/{chunk-y7ds4qyb.js → chunk-2h4f37kx.js} +2 -2
  8. package/dist/{chunk-q6e45gnw.js → chunk-2kvbg3t5.js} +3 -3
  9. package/dist/{chunk-xdtz2v5r.js → chunk-2n4je46m.js} +2 -2
  10. package/dist/{chunk-xcfhy5bj.js → chunk-33bzhsyw.js} +2 -2
  11. package/dist/{chunk-7ybgfk0m.js → chunk-3nk8cnrm.js} +2 -2
  12. package/dist/{chunk-gsxb0ry9.js → chunk-3r1m3tyr.js} +1 -1
  13. package/dist/chunk-3zs8yxy0.js +2 -0
  14. package/dist/{chunk-khwj964t.js → chunk-40hbpz2b.js} +3 -3
  15. package/dist/chunk-4a7v51vh.js +2 -0
  16. package/dist/{chunk-xtknewf7.js → chunk-4hyhr5r7.js} +1 -1
  17. package/dist/{chunk-hp1tnxzb.js → chunk-4pxc3r1p.js} +4 -4
  18. package/dist/chunk-4qts8zk7.js +2 -0
  19. package/dist/{chunk-587ehsxn.js → chunk-4r7s3862.js} +2 -2
  20. package/dist/chunk-4y2av4ev.js +2 -0
  21. package/dist/chunk-5g498pdp.js +2 -0
  22. package/dist/chunk-5gq8m2m7.js +2 -0
  23. package/dist/chunk-5wx323bm.js +2 -0
  24. package/dist/{chunk-d2r8t40y.js → chunk-66s4nhp7.js} +2 -2
  25. package/dist/{chunk-d7x6n702.js → chunk-6dtmants.js} +3 -3
  26. package/dist/chunk-6rcxtdh3.js +2 -0
  27. package/dist/{chunk-st79dqpz.js → chunk-6sd4zdtg.js} +1 -1
  28. package/dist/{chunk-zpdq0kx1.js → chunk-6tnh3cyq.js} +1 -1
  29. package/dist/chunk-6va8wt88.js +2 -0
  30. package/dist/chunk-7v2j9bmc.js +2 -0
  31. package/dist/chunk-7zgtdap7.js +2 -0
  32. package/dist/{chunk-0pebjkzx.js → chunk-843y0pfg.js} +4 -4
  33. package/dist/{chunk-4xxhprts.js → chunk-8chxczpj.js} +3 -3
  34. package/dist/{chunk-b7xdk1g4.js → chunk-8m1y1kyr.js} +5 -5
  35. package/dist/chunk-90kzf313.js +2 -0
  36. package/dist/{chunk-t6769zcy.js → chunk-93n6yv5x.js} +12 -12
  37. package/dist/chunk-94rg5s6c.js +2 -0
  38. package/dist/chunk-9674w2gm.js +2 -0
  39. package/dist/{chunk-gvw8wh29.js → chunk-9p6bt089.js} +3 -3
  40. package/dist/{chunk-kg77xs08.js → chunk-bczcm7jk.js} +2 -2
  41. package/dist/{chunk-rs46hksk.js → chunk-bxsehntq.js} +1 -1
  42. package/dist/{chunk-vg8thz41.js → chunk-c56qtne1.js} +1 -1
  43. package/dist/chunk-d1jxmhph.js +2 -0
  44. package/dist/{chunk-5tj6expd.js → chunk-d7zterbp.js} +2 -2
  45. package/dist/{chunk-664503e6.js → chunk-d871008z.js} +4 -4
  46. package/dist/chunk-dekpf1ry.js +2 -0
  47. package/dist/chunk-epa1c4q4.js +2 -0
  48. package/dist/{chunk-xb0785wp.js → chunk-f3q84h7b.js} +2 -2
  49. package/dist/{chunk-g060jncp.js → chunk-fqfqyn48.js} +4 -4
  50. package/dist/{chunk-g5t10z04.js → chunk-gnx0fzne.js} +60 -60
  51. package/dist/chunk-gsc5t942.js +2 -0
  52. package/dist/chunk-gsm1y1kb.js +2 -0
  53. package/dist/chunk-gxedmh17.js +2 -0
  54. package/dist/{chunk-9xq5yer8.js → chunk-h4crv0by.js} +1 -1
  55. package/dist/{chunk-pr5q4wev.js → chunk-hp8g2q2n.js} +1 -1
  56. package/dist/{chunk-38w14qs7.js → chunk-hvpzy98g.js} +1 -1
  57. package/dist/chunk-j9c0yam7.js +2 -0
  58. package/dist/{chunk-12e4a0ab.js → chunk-jbfad9cc.js} +2 -2
  59. package/dist/chunk-jv3jj612.js +2 -0
  60. package/dist/chunk-jvqas8y2.js +2 -0
  61. package/dist/{chunk-rwn3b21z.js → chunk-k3v13vfr.js} +2 -2
  62. package/dist/chunk-kcs7hyep.js +2 -0
  63. package/dist/chunk-kvp0at16.js +2 -0
  64. package/dist/{chunk-31c1g3rt.js → chunk-m011s2ha.js} +3 -3
  65. package/dist/{chunk-2jk0vceh.js → chunk-m56m95gk.js} +2 -2
  66. package/dist/{chunk-7s14bthq.js → chunk-m5fw8jq1.js} +2 -2
  67. package/dist/chunk-m7jmpech.js +2 -0
  68. package/dist/chunk-m8n9wxba.js +2 -0
  69. package/dist/{chunk-fyxydww2.js → chunk-mjdyyekx.js} +2 -2
  70. package/dist/{chunk-ennxrn5g.js → chunk-nd8v4xgb.js} +5 -5
  71. package/dist/chunk-ngma9vzc.js +2 -0
  72. package/dist/{chunk-rtk6n3vh.js → chunk-ngxqydsg.js} +3 -3
  73. package/dist/{chunk-ee4wwr89.js → chunk-nmy4x6dx.js} +4 -4
  74. package/dist/chunk-pz1mjgsp.js +2 -0
  75. package/dist/{chunk-er031j13.js → chunk-qfc912e5.js} +2 -2
  76. package/dist/chunk-qk3ptn6h.js +2 -0
  77. package/dist/{chunk-03wggzg8.js → chunk-qmza4327.js} +2 -2
  78. package/dist/{chunk-j8pacd7m.js → chunk-qqr4rn9p.js} +4 -4
  79. package/dist/chunk-rx4hz615.js +2 -0
  80. package/dist/chunk-shf0hd05.js +2 -0
  81. package/dist/{chunk-3vvppnws.js → chunk-sqb6gkzf.js} +8374 -8374
  82. package/dist/chunk-t1g1sp2z.js +2 -0
  83. package/dist/{chunk-m2v04c6v.js → chunk-tgc645pa.js} +45 -45
  84. package/dist/{chunk-2dzd2h15.js → chunk-tkvp3rz0.js} +1 -1
  85. package/dist/{chunk-458etq5a.js → chunk-tqnh98j7.js} +3 -3
  86. package/dist/chunk-tr9bjtqx.js +2 -0
  87. package/dist/{chunk-2y6tzn6d.js → chunk-ty1v368m.js} +2 -2
  88. package/dist/{chunk-grb3kfya.js → chunk-v4r8nzf3.js} +1 -1
  89. package/dist/{chunk-p8yh7mgr.js → chunk-v9vvzdag.js} +2 -2
  90. package/dist/{chunk-0wvsfs4s.js → chunk-vb4xxpa6.js} +2 -2
  91. package/dist/chunk-vfnerp7h.js +2 -0
  92. package/dist/{chunk-tkeabv04.js → chunk-vhfwnvmc.js} +5 -5
  93. package/dist/{chunk-15r72kw7.js → chunk-vjdj0ex3.js} +1 -1
  94. package/dist/{chunk-9pztpvvk.js → chunk-wh7xn313.js} +1 -1
  95. package/dist/chunk-wjt46tdp.js +2 -0
  96. package/dist/chunk-wxy9re1a.js +2 -0
  97. package/dist/{chunk-kwvexxey.js → chunk-x607yxrc.js} +3 -3
  98. package/dist/{chunk-3zyvhf4p.js → chunk-xey01yna.js} +1 -1
  99. package/dist/{chunk-stbsqy7e.js → chunk-xwrbrg1q.js} +1 -1
  100. package/dist/{chunk-9sqjmd9a.js → chunk-y18yvcjb.js} +5 -5
  101. package/dist/chunk-ydtnskdv.js +2 -0
  102. package/dist/{chunk-ky25egh1.js → chunk-yw3cqy43.js} +1 -1
  103. package/dist/{chunk-1945hk44.js → chunk-z9r3tqyr.js} +1 -1
  104. package/dist/chunk-zeve89kw.js +2 -0
  105. package/dist/cli.js +12 -12
  106. package/dist/client/signals-appearance-runtime.d.ts +2 -0
  107. package/dist/client/signals-appearance-runtime.js +283 -0
  108. package/dist/client/signals-authoring-runtime.d.ts +2 -0
  109. package/dist/client/signals-authoring-runtime.js +187 -0
  110. package/dist/client/signals-binding-utils-runtime.d.ts +2 -0
  111. package/dist/client/signals-binding-utils-runtime.js +130 -0
  112. package/dist/client/signals-bootstrap-runtime.d.ts +4 -0
  113. package/dist/client/signals-bootstrap-runtime.js +24 -0
  114. package/dist/client/signals-class-runtime.d.ts +2 -0
  115. package/dist/client/signals-class-runtime.js +69 -0
  116. package/dist/client/signals-component-api-runtime.d.ts +1 -0
  117. package/dist/client/signals-component-api-runtime.js +57 -0
  118. package/dist/client/signals-component-hydration-runtime.d.ts +2 -0
  119. package/dist/client/signals-component-hydration-runtime.js +147 -0
  120. package/dist/client/signals-component-props-runtime.d.ts +2 -0
  121. package/dist/client/signals-component-props-runtime.js +90 -0
  122. package/dist/client/signals-conditional-chain-runtime.d.ts +2 -0
  123. package/dist/client/signals-conditional-chain-runtime.js +39 -0
  124. package/dist/client/signals-conditional-component-runtime.d.ts +2 -0
  125. package/dist/client/signals-conditional-component-runtime.js +82 -0
  126. package/dist/client/signals-container-cleanup-runtime.d.ts +2 -0
  127. package/dist/client/signals-container-cleanup-runtime.js +42 -0
  128. package/dist/client/signals-context-runtime.d.ts +2 -0
  129. package/dist/client/signals-context-runtime.js +48 -0
  130. package/dist/client/signals-cookie-runtime.d.ts +2 -0
  131. package/dist/client/signals-cookie-runtime.js +56 -0
  132. package/dist/client/signals-devtools-runtime.d.ts +2 -0
  133. package/dist/client/signals-devtools-runtime.js +136 -0
  134. package/dist/client/signals-dialog-runtime.d.ts +2 -0
  135. package/dist/client/signals-dialog-runtime.js +195 -0
  136. package/dist/client/signals-dom-ready-runtime.d.ts +2 -0
  137. package/dist/client/signals-dom-ready-runtime.js +306 -0
  138. package/dist/client/signals-drawer-runtime.d.ts +2 -0
  139. package/dist/client/signals-drawer-runtime.js +39 -0
  140. package/dist/client/signals-effect-runtime.d.ts +2 -0
  141. package/dist/client/signals-effect-runtime.js +157 -0
  142. package/dist/client/signals-event-shorthand-runtime.d.ts +2 -0
  143. package/dist/client/signals-event-shorthand-runtime.js +88 -0
  144. package/dist/client/signals-expression-compiler-runtime.d.ts +2 -0
  145. package/dist/client/signals-expression-compiler-runtime.js +59 -0
  146. package/dist/client/signals-expression-runtime.d.ts +2 -0
  147. package/dist/client/signals-expression-runtime.js +67 -0
  148. package/dist/client/signals-fetch-runtime.d.ts +2 -0
  149. package/dist/client/signals-fetch-runtime.js +144 -0
  150. package/dist/client/signals-fetch-transport-runtime.d.ts +2 -0
  151. package/dist/client/signals-fetch-transport-runtime.js +216 -0
  152. package/dist/client/signals-for-runtime.d.ts +2 -0
  153. package/dist/client/signals-for-runtime.js +647 -0
  154. package/dist/client/signals-globals-runtime.d.ts +2 -0
  155. package/dist/client/signals-globals-runtime.js +66 -0
  156. package/dist/client/signals-handler-runtime.d.ts +2 -0
  157. package/dist/client/signals-handler-runtime.js +80 -0
  158. package/dist/client/signals-head-runtime.d.ts +2 -0
  159. package/dist/client/signals-head-runtime.js +92 -0
  160. package/dist/client/signals-helpers-runtime.d.ts +2 -0
  161. package/dist/client/signals-helpers-runtime.js +137 -0
  162. package/dist/client/signals-host-runtime.d.ts +9 -0
  163. package/dist/client/signals-host-runtime.js +132 -0
  164. package/dist/client/signals-hydration-audit-runtime.d.ts +2 -0
  165. package/dist/client/signals-hydration-audit-runtime.js +209 -0
  166. package/dist/client/signals-hydration-runtime.d.ts +2 -0
  167. package/dist/client/signals-hydration-runtime.js +52 -0
  168. package/dist/client/signals-if-chain-runtime.d.ts +2 -0
  169. package/dist/client/signals-if-chain-runtime.js +283 -0
  170. package/dist/client/signals-if-runtime.d.ts +2 -0
  171. package/dist/client/signals-if-runtime.js +346 -0
  172. package/dist/client/signals-kept-runtime.d.ts +2 -0
  173. package/dist/client/signals-kept-runtime.js +62 -0
  174. package/dist/client/signals-lazy-hydration-runtime.d.ts +2 -0
  175. package/dist/client/signals-lazy-hydration-runtime.js +133 -0
  176. package/dist/client/signals-lifecycle-runtime.d.ts +2 -0
  177. package/dist/client/signals-lifecycle-runtime.js +114 -0
  178. package/dist/client/signals-loop-component-remap-runtime.d.ts +2 -0
  179. package/dist/client/signals-loop-component-remap-runtime.js +66 -0
  180. package/dist/client/signals-loop-conditional-runtime.d.ts +2 -0
  181. package/dist/client/signals-loop-conditional-runtime.js +48 -0
  182. package/dist/client/signals-loop-row-runtime.d.ts +2 -0
  183. package/dist/client/signals-loop-row-runtime.js +41 -0
  184. package/dist/client/signals-manifest-hydration-runtime.d.ts +2 -0
  185. package/dist/client/signals-manifest-hydration-runtime.js +82 -0
  186. package/dist/client/signals-model-runtime.d.ts +2 -0
  187. package/dist/client/signals-model-runtime.js +156 -0
  188. package/dist/client/signals-mount-runtime.d.ts +1 -0
  189. package/dist/client/signals-mount-runtime.js +231 -0
  190. package/dist/client/signals-navigation-runtime.d.ts +2 -0
  191. package/dist/client/signals-navigation-runtime.js +198 -0
  192. package/dist/client/signals-optimistic-runtime.d.ts +2 -0
  193. package/dist/client/signals-optimistic-runtime.js +34 -0
  194. package/dist/client/signals-overlay-runtime.d.ts +2 -0
  195. package/dist/client/signals-overlay-runtime.js +352 -0
  196. package/dist/client/signals-pipe-runtime.d.ts +2 -0
  197. package/dist/client/signals-pipe-runtime.js +177 -0
  198. package/dist/client/signals-process-element-runtime.d.ts +1 -0
  199. package/dist/client/signals-process-element-runtime.js +696 -0
  200. package/dist/client/signals-proxy-runtime.d.ts +2 -0
  201. package/dist/client/signals-proxy-runtime.js +78 -0
  202. package/dist/client/signals-public-api-runtime.d.ts +1 -0
  203. package/dist/client/signals-public-api-runtime.js +120 -0
  204. package/dist/client/signals-query-runtime.d.ts +2 -0
  205. package/dist/client/signals-query-runtime.js +351 -0
  206. package/dist/client/signals-reactive-core-bootstrap-runtime.d.ts +1 -0
  207. package/dist/client/signals-reactive-core-bootstrap-runtime.js +30 -0
  208. package/dist/client/signals-reactive-runtime.d.ts +2 -0
  209. package/dist/client/signals-reactive-runtime.js +67 -0
  210. package/dist/client/signals-ref-runtime.d.ts +2 -0
  211. package/dist/client/signals-ref-runtime.js +33 -0
  212. package/dist/client/signals-scope-disposal-runtime.d.ts +2 -0
  213. package/dist/client/signals-scope-disposal-runtime.js +195 -0
  214. package/dist/client/signals-scope-traversal-runtime.d.ts +2 -0
  215. package/dist/client/signals-scope-traversal-runtime.js +42 -0
  216. package/dist/client/signals-show-runtime.d.ts +2 -0
  217. package/dist/client/signals-show-runtime.js +54 -0
  218. package/dist/client/signals-spa-load-control-runtime.d.ts +2 -0
  219. package/dist/client/signals-spa-load-control-runtime.js +42 -0
  220. package/dist/client/signals-spa-load-runtime.d.ts +2 -0
  221. package/dist/client/signals-spa-load-runtime.js +187 -0
  222. package/dist/client/signals-state-runtime.d.ts +2 -0
  223. package/dist/client/signals-state-runtime.js +125 -0
  224. package/dist/client/signals-storage-runtime.d.ts +2 -0
  225. package/dist/client/signals-storage-runtime.js +79 -0
  226. package/dist/client/signals-store-registry-runtime.d.ts +1 -0
  227. package/dist/client/signals-store-registry-runtime.js +461 -0
  228. package/dist/client/signals-style-runtime.d.ts +2 -0
  229. package/dist/client/signals-style-runtime.js +35 -0
  230. package/dist/client/signals-suspense-runtime.d.ts +2 -0
  231. package/dist/client/signals-suspense-runtime.js +59 -0
  232. package/dist/client/signals-timer-runtime.d.ts +2 -0
  233. package/dist/client/signals-timer-runtime.js +378 -0
  234. package/dist/client/signals-toast-runtime.d.ts +2 -0
  235. package/dist/client/signals-toast-runtime.js +206 -0
  236. package/dist/client/signals-tooltip-runtime.d.ts +2 -0
  237. package/dist/client/signals-tooltip-runtime.js +40 -0
  238. package/dist/client/signals-transition-group-runtime.d.ts +2 -0
  239. package/dist/client/signals-transition-group-runtime.js +92 -0
  240. package/dist/client/signals-websocket-runtime.d.ts +2 -0
  241. package/dist/client/signals-websocket-runtime.js +138 -0
  242. package/dist/craft-entry.js +2 -2
  243. package/dist/craft.js +2 -2
  244. package/dist/pwa.js +3 -3
  245. package/dist/signals-context-runtime.d.ts +2 -0
  246. package/dist/signals-drawer-runtime.d.ts +2 -0
  247. package/dist/signals-host-runtime.d.ts +9 -0
  248. package/dist/signals-loop-conditional-runtime.d.ts +2 -0
  249. package/dist/signals-manifest-hydration-runtime.d.ts +2 -0
  250. package/dist/signals-optimistic-runtime.d.ts +2 -0
  251. package/dist/signals-overlay-runtime.d.ts +2 -0
  252. package/dist/signals-scope-disposal-runtime.d.ts +2 -0
  253. package/dist/signals-spa-load-control-runtime.d.ts +2 -0
  254. package/dist/signals-storage-runtime.d.ts +2 -0
  255. package/dist/signals.js +141 -9900
  256. package/dist/ssg.js +3 -3
  257. package/package.json +5 -5
  258. package/dist/chunk-0p9pwd61.js +0 -2
  259. package/dist/chunk-0zmv31nc.js +0 -2
  260. package/dist/chunk-28xtazwz.js +0 -2
  261. package/dist/chunk-2936t942.js +0 -2
  262. package/dist/chunk-29qwmthc.js +0 -2
  263. package/dist/chunk-323cxa69.js +0 -2
  264. package/dist/chunk-375zp0vr.js +0 -2
  265. package/dist/chunk-3w49r16x.js +0 -2
  266. package/dist/chunk-8bcvb86w.js +0 -2
  267. package/dist/chunk-8gmb3k1p.js +0 -2
  268. package/dist/chunk-a15yzfc6.js +0 -2
  269. package/dist/chunk-d4155ec5.js +0 -2
  270. package/dist/chunk-dd31q423.js +0 -2
  271. package/dist/chunk-f2q5bckn.js +0 -2
  272. package/dist/chunk-fhx35529.js +0 -2
  273. package/dist/chunk-h1y5q942.js +0 -2
  274. package/dist/chunk-h791c7sb.js +0 -2
  275. package/dist/chunk-h88jcr3k.js +0 -2
  276. package/dist/chunk-heq5c0gd.js +0 -2
  277. package/dist/chunk-j3b24e77.js +0 -2
  278. package/dist/chunk-jpck8nm5.js +0 -2
  279. package/dist/chunk-m4d99a9r.js +0 -2
  280. package/dist/chunk-ng2sdph7.js +0 -2
  281. package/dist/chunk-qs3p7sc6.js +0 -2
  282. package/dist/chunk-rchwwcxy.js +0 -2
  283. package/dist/chunk-rk4mttds.js +0 -2
  284. package/dist/chunk-rma3bv36.js +0 -2
  285. package/dist/chunk-rp5a91ak.js +0 -2
  286. package/dist/chunk-sp5x96rn.js +0 -2
  287. package/dist/chunk-t2mjeezd.js +0 -2
  288. package/dist/chunk-t61j834x.js +0 -2
  289. package/dist/chunk-v2vg5jqq.js +0 -2
  290. package/dist/chunk-vmfw4svt.js +0 -2
  291. package/dist/chunk-w6ecbk3y.js +0 -2
  292. package/dist/chunk-wbv6vjhm.js +0 -2
  293. package/dist/chunk-wfbr3txe.js +0 -2
  294. package/dist/chunk-wpnv0naj.js +0 -2
  295. package/dist/chunk-wwny5dk9.js +0 -2
  296. package/dist/chunk-x55avrcf.js +0 -2
  297. package/dist/chunk-yts2745t.js +0 -2
  298. package/dist/chunk-zah67v44.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fn,Le,Be,ye,ei,Wn,Q,X,ln,d,n,R}from"./chunk-g5t10z04.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:m}=Fn(o),c=await(e.renderer??((s)=>Le(s)))(m);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Q(o);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function M(o,e){return`<!DOCTYPE html>
2
+ import{Fn,Le,Be,ye,ei,Wn,Q,K,ln,d,n,R}from"./chunk-gnx0fzne.js";import{dirname as k,resolve as _}from"path";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(s,p){let u;while((u=s.exec(o))!==null){let t=u.index,i=t+u[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:m}=Fn(o),c=await(e.renderer??((s)=>Le(s)))(m);return{html:C(c),frontmatter:r??{}}}function v(o){let e=o,r=Q(o);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),u;while((u=m.exec(o))!==null){let i=u[1],l=u[2],f=u[0],g=i.includes("server");if(p(l))s.push(f);else if(g)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let g=l.index+l[0].length,x=t.indexOf("</script>",g);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let g=f.length-1;g>=0;g--)t=t.substring(0,f[g].start)+t.substring(f[g].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function M(o,e){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -9,10 +9,10 @@ import{Fn,Le,Be,ye,ei,Wn,Q,X,ln,d,n,R}from"./chunk-g5t10z04.js";import{dirname a
9
9
  <body>
10
10
  ${o}
11
11
  </body>
12
- </html>`}async function Oo(o,e={}){let r=_(o),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let a=await m.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=_(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};ln(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:m,serverScripts:a,clientScripts:c}=v(o),s={...R,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Wn(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await n(t,p,e,s,u),ei(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
12
+ </html>`}async function Do(o,e={}){let r=_(o),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let a=await m.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=_(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:u,injectCSS:t,...i}=e,l={...e.context||{}};ln(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),g=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(g,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:m,serverScripts:a,clientScripts:c}=v(o),s={...R,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Wn(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await d(i,p,e);let u=new Set,t=m;if(t=await n(t,p,e,s,u),ei(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
13
13
  ${c.join(`
14
14
  `)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Be(p),g=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await ye(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
15
15
  `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${g}
16
16
  $1`);else t+=`
17
- ${g}`}t=await X(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-yts2745t.js");t=await i(t)}catch{}return t}
18
- export{Oo};
17
+ ${g}`}t=await K(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-90kzf313.js");t=await i(t)}catch{}return t}
18
+ export{Do};
@@ -1,14 +1,14 @@
1
1
  // @bun
2
- import{y}from"./chunk-5tj6expd.js";import{q,Ue,is,as,ti,ni,ri,si,Kn,cs,oi,ii,ai,_t,o}from"./chunk-g5t10z04.js";import{Br}from"./chunk-y7ds4qyb.js";import{a}from"./chunk-4cmqjmqr.js";import{existsSync as M,readFileSync as K}from"fs";import h from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=_t.filter((e)=>!me.has(e)).sort(),ne=[...y].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(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 ie(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let m of l[1].matchAll(/[^,]+/g)){let S=m[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let r=x[1];if(!xe.has(r)||i.has(r))continue;let f=u.offset+g+m.index+x[0].length-r.length,p=e.slice(0,f),w=p.split(`
2
+ import{y}from"./chunk-d7zterbp.js";import{q,Ve,is,as,ti,ni,ri,si,Gn,cs,oi,ii,ai,Tt,o}from"./chunk-gnx0fzne.js";import{Br}from"./chunk-2h4f37kx.js";import{a}from"./chunk-4cmqjmqr.js";import{existsSync as M,readFileSync as K}from"fs";import h from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=Tt.filter((e)=>!me.has(e)).sort(),ne=[...y].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(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 ie(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let m of l[1].matchAll(/[^,]+/g)){let S=m[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let r=x[1];if(!xe.has(r)||i.has(r))continue;let f=u.offset+g+m.index+x[0].length-r.length,p=e.slice(0,f),w=p.split(`
3
3
  `).length;s.push({line:w,column:f-(p.lastIndexOf(`
4
4
  `)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:Se(r,u.kind)})}}}return s}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let s=T.resolve(e);for(;;){let u=T.join(s,"tsconfig.json");if(t(u))return u;let i=T.dirname(s);if(i===s)return;s=i}}function se(e,t,s){let u=we(e,s);if(!u)return;let i=new Set,l=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let S=m.compilerOptions?.plugins;if(Array.isArray(S)){let r=S.find((p)=>p?.name===ke),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...x].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=T.resolve(T.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function sa(e,t="",s=""){let u=e.startLine>1?`
5
- `.repeat(e.startLine-1):"",i=cs(e)+as(is(e.code)),l=e.kind==="client"||e.kind==="plain"?ri(t,e.code):"";return Kn(`${u+i}
5
+ `.repeat(e.startLine-1):"",i=cs(e)+as(is(e.code)),l=e.kind==="client"||e.kind==="plain"?ri(t,e.code):"";return Gn(`${u+i}
6
6
  ${l}
7
7
  export {}
8
8
  `,s)}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 ve(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],s=new Set(y),u=[];for(let{file:i,names:l}of e){let g=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));u.push(` export * from ${g}`);for(let m of l){if(s.has(m)||$e.has(m))continue;s.add(m),t.push(`declare const ${m}: typeof import(${g})[${JSON.stringify(m)}]`)}}return t.push("declare module '@composables' {",...u,"}"),t.join(`
9
9
  `)}function ao(e,t,s){return`${e}.__stx_${t}${s}.ts`}function al(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function oa(){return re("stx.d.ts")}function ia(){return re("stx-module.d.ts")}function re(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(M(t))return t;return null}var Te=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function De(e){return e>=1000&&e<2000}function oe(e){let t="",s=!1,u=!1;for(let i=0;i<e.length;i++){let l=e[i];if(s){if(t+=l,u)u=!1;else if(l==="\\")u=!0;else if(l==='"')s=!1;continue}if(l==='"'){s=!0,t+=l;continue}if(l==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
10
10
  `)i++;t+=`
11
- `;continue}if(l==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(K(e,"utf8")))}catch{return}}function Oe(e){let t=h.resolve(e),s;for(;;){let r=h.join(t,"tsconfig.json");if(M(r)){s=r;break}let f=h.dirname(t);if(f===t)break;t=f}if(!s)return{};let u=new Set,i=s,l,g,m=s;while(i&&!u.has(i)){u.add(i);let r;try{r=JSON.parse(oe(K(i,"utf8")))}catch{break}let f=r?.compilerOptions??{};if(!l&&f.paths&&typeof f.paths==="object")l=f.paths,m=i;if(!g&&typeof f.baseUrl==="string")g=h.resolve(h.dirname(i),f.baseUrl);if(l&&g)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!l)return{};let S=g??h.dirname(m),x={};for(let[r,f]of Object.entries(l)){if(!Array.isArray(f))continue;x[r]=f.map((p)=>typeof p==="string"&&!h.isAbsolute(p)?h.resolve(S,p):p)}return{paths:x}}async function cl(e,t={}){let s=t.client!==!1,u=t.server!==!1,i=t.templates!==!1,l=t.componentsDir??(i?(await o()).componentsDir:void 0),g=new Map,m=new Map,S=[],x=[],r=0,f=0,p=oa();for(let n of e){let c=await Bun.file(n).text(),b=Ue(c).filter((d)=>{if(d.kind==="server")return u;return s}),k=Ue(c).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
11
+ `;continue}if(l==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(K(e,"utf8")))}catch{return}}function Oe(e){let t=h.resolve(e),s;for(;;){let r=h.join(t,"tsconfig.json");if(M(r)){s=r;break}let f=h.dirname(t);if(f===t)break;t=f}if(!s)return{};let u=new Set,i=s,l,g,m=s;while(i&&!u.has(i)){u.add(i);let r;try{r=JSON.parse(oe(K(i,"utf8")))}catch{break}let f=r?.compilerOptions??{};if(!l&&f.paths&&typeof f.paths==="object")l=f.paths,m=i;if(!g&&typeof f.baseUrl==="string")g=h.resolve(h.dirname(i),f.baseUrl);if(l&&g)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!l)return{};let S=g??h.dirname(m),x={};for(let[r,f]of Object.entries(l)){if(!Array.isArray(f))continue;x[r]=f.map((p)=>typeof p==="string"&&!h.isAbsolute(p)?h.resolve(S,p):p)}return{paths:x}}async function cl(e,t={}){let s=t.client!==!1,u=t.server!==!1,i=t.templates!==!1,l=t.componentsDir??(i?(await o()).componentsDir:void 0),g=new Map,m=new Map,S=[],x=[],r=0,f=0,p=oa();for(let n of e){let c=await Bun.file(n).text(),b=Ve(c).filter((d)=>{if(d.kind==="server")return u;return s}),k=Ve(c).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
12
12
  `);for(let d of ie(c,b))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(s&&k){let d=b.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>si(k,O.code)))];if(E.length>0)m.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=h.dirname(h.resolve(n)),v=i?oi(c,{runtimeGlobals:!p,originDir:D,filePath:h.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(b.length===0&&R===0)continue;if(x.push(n),r+=b.length,f+=R,b.forEach((d,E)=>{g.set(ao(n,d.kind,E),{source:sa(d,k,D),origin:n,kind:d.kind})}),v&&R>0)g.set(ao(n,"template",0),{source:v.text,origin:n,kind:"template",virtual:v})}if(g.size===0)return{diagnostics:S,checkedFiles:x,blockCount:0,expressionCount:0};let w=(t.extraLibs??[]).map((n)=>h.resolve(n)),ce=se(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),Ee,M);for(let n of ce?.libs??[])if(!w.includes(n)&&M(n))w.push(n);if(p)w.push(p);let G=p?ia():null;if(G)w.push(G);let X=`${a()}/typecheck/__stx_globals.d.ts`,ae=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",ti(p?ni(K(p,"utf8")):void 0),...p?[]:["declare const window: any",...y.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...q.map((n)=>`declare const ${n}: any`)].join(`
13
13
  `),ve(await Br())].filter(Boolean).join(`
14
14
  `),_=`${a()}/typecheck`;await Bun.$`rm -rf ${_}`.quiet().nothrow(),await Bun.$`mkdir -p ${_}`.quiet().nothrow(),await Bun.write(X,ae);let N=new Map,le=0;for(let[n,c]of g){let b=`${le++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${_}/${b}`,c.source),N.set(b,c)}let ue={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Oe(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},F=async(n,c)=>{let b=`${_}/tsconfig${c===1?"":`.${c}`}.json`;await Bun.write(b,JSON.stringify({compilerOptions:ue,files:n.map((D)=>`${_}/${D}`).concat(X,...w)},null,2));let k=Bun.spawnSync(["bun","x","tsc","-p",b,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(k.stdout)+new TextDecoder().decode(k.stderr),exitCode:k.exitCode??0}},V=await F([...N.keys()],1),J=V.output,I=[],U=V.exitCode,W=0,pe=new Set(w.map((n)=>n.split("/").pop())),z=0,B=new Set,H=(n)=>{for(let c of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
@@ -159,7 +159,7 @@ else {
159
159
  stxIslands.initIslands();
160
160
  }
161
161
  })();
162
- </script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function Ta(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
162
+ </script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function _a(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
163
163
  <script data-hydrate="${e}">
164
164
  (function() {
165
165
  const island = document.querySelector('[data-island="${e}"]');
@@ -311,7 +311,7 @@ else {
311
311
  });
312
312
  })();
313
313
  </script>
314
- `}function _a(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
314
+ `}function Ta(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
315
315
  `+v();return r}function u(e,t,n){let r=new RegExp(`@client:${t}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return e.replace(r,(i,d,o)=>{let a={strategy:t};if(d)try{let E=d.split(",").map((h)=>h.trim());for(let h of E){let[m,g]=h.split(":").map((p)=>p.trim());if(m&&g){let p=g.replace(/^['"]|['"]$/g,"");a[m]=p}}}catch{}let s=`island-${Math.random().toString(36).substring(2,9)}`,y=b(o.trim()),f=w(o.trim(),n),c=[];if(a.rootMargin)c.push(`data-root-margin="${a.rootMargin}"`);if(a.threshold!==void 0)c.push(`data-threshold="${a.threshold}"`);if(a.media)c.push(`data-media="${a.media}"`);if(a.event)c.push(`data-event="${a.event}"`);if(y)c.push(`data-component="${y}"`);let x=Object.keys(f).length>0?`
316
316
  <script type="application/json" data-island-props="${s}">${JSON.stringify(f)}</script>`:"",l="";switch(t){case"load":l=I(s);break;case"idle":l=L(s,a);break;case"visible":l=C(s,a);break;case"media":l=S(s,a);break;case"hover":l=k(s);break;case"event":l=H(s,a);break}return`
317
317
  <div data-island="${s}"
@@ -383,9 +383,9 @@ else {
383
383
  .stx-island.hydrated {
384
384
  opacity: 1;
385
385
  }
386
- `}function Ra(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function Aa(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function Pa(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function Ia(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function Da(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function Oa(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function Ma(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
386
+ `}function Ra(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function Aa(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function Pa(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function Ia(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function Oa(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function Da(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function Ma(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
387
387
  <script type="application/json" id="stx-island-manifest">
388
388
  ${JSON.stringify(t)}
389
389
  </script>
390
- `}var Nl={processPartialHydrationDirectives:_a,processStaticDirectives:Oa,generatePartialHydrationCSS:$a,generateIslandManifest:Ma,createIslandRegistry:Ta,hydrateIsland:Ra,hydrateByStrategy:Aa,hydrateAll:Pa,isHydrated:Ia,onHydrated:Da};
391
- export{Ta,_a,$a,Ra,Aa,Pa,Ia,Da,Oa,Ma,Nl};
390
+ `}var Nl={processPartialHydrationDirectives:Ta,processStaticDirectives:Da,generatePartialHydrationCSS:$a,generateIslandManifest:Ma,createIslandRegistry:_a,hydrateIsland:Ra,hydrateByStrategy:Aa,hydrateAll:Pa,isHydrated:Ia,onHydrated:Oa};
391
+ export{_a,Ta,$a,Ra,Aa,Pa,Ia,Oa,Da,Ma,Nl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{qd,Zo,Gd,Qo,pc,fc,Et,an,Kd,gc,mc,hc,f}from"./chunk-gnx0fzne.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-01343ehq.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{Et as buildCss,gc as extractClassNames,fc as fingerprintConfig,mc as generateCss,Kd as getCachedCSS,qd as getCssServeAsset,f as injectCss,Zo as loadCssEngine,Qo as loadCssEngineConfig,an as rebuildCss,Gd as resetCssCache,pc as resolveUserCssConfig,hc as withLinkedModuleBundles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Me,U}from"./chunk-458etq5a.js";import{Oo}from"./chunk-0pebjkzx.js";import{p}from"./chunk-2a4szpje.js";var kd=`
2
+ import{Me,V}from"./chunk-tqnh98j7.js";import{Do}from"./chunk-843y0pfg.js";import{p}from"./chunk-2a4szpje.js";var kd=`
3
3
  <script>
4
4
  (function() {
5
5
  'use strict';
@@ -931,9 +931,9 @@ else if (data.type === 'event' && data.method) {
931
931
  }
932
932
  })();
933
933
  </script>
934
- `.replace("debug: false,",`debug: ${a},`).replace("timeout: 30000",`timeout: ${r}`)}function Cd(){return!1}function Ed(e,a={}){let r=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(r,(i,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return Eo(t)})}function To(e,a={}){if(e.includes("__craftBridgeInitialized"))return e;let r=Eo(a);if(e.includes("</head>"))return e.replace("</head>",`${r}
934
+ `.replace("debug: false,",`debug: ${a},`).replace("timeout: 30000",`timeout: ${r}`)}function Cd(){return!1}function Ed(e,a={}){let r=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(r,(i,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return Eo(t)})}function _o(e,a={}){if(e.includes("__craftBridgeInitialized"))return e;let r=Eo(a);if(e.includes("</head>"))return e.replace("</head>",`${r}
935
935
  </head>`);if(e.includes("<body"))return e.replace(/(<body[^>]*>)/,`$1
936
- ${r}`);return r+e}var Vr={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,a)=>{let r=e.checked?"checked":"",i=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
936
+ ${r}`);return r+e}var Ur={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,a)=>{let r=e.checked?"checked":"",i=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
937
937
  <input type="checkbox" class="craft-checkbox" ${r} ${i}>
938
938
  <span class="craft-checkbox-label">${a||e.label||""}</span>
939
939
  </label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(e,a)=>{let r=e.min??0,i=e.max??100,s=e.step??1,t=e.value??50,n=e.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${r}" max="${i}" step="${s}" value="${t}" ${n}>`}},label:{nativeType:"craft-label",fallbackTag:"span",fallbackClasses:"craft-label",nativeProps:["text","for"]},badge:{nativeType:"craft-badge",fallbackTag:"span",fallbackClasses:"craft-badge",nativeProps:["variant","size"]},avatar:{nativeType:"craft-avatar",fallbackTag:"div",fallbackClasses:"craft-avatar",nativeProps:["src","alt","size","fallback"],render:(e,a)=>{let r=e.size||40,i=e.src,s=String(e.alt||""),t=e.fallback||(s?s.charAt(0).toUpperCase():"?");if(i)return`<img class="craft-avatar" src="${i}" alt="${s}" style="width:${r}px;height:${r}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${r}px;height:${r}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${t}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(e,a)=>{let r=Number(e.value)||0,i=Number(e.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,r/i*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(e,a)=>{let r=e.size||24;return`<div class="craft-spinner" style="width:${r}px;height:${r}px"></div>`}},card:{nativeType:"craft-card",fallbackTag:"div",fallbackClasses:"craft-card",nativeProps:["title","subtitle","variant"]},modal:{nativeType:"craft-modal",fallbackTag:"dialog",fallbackClasses:"craft-modal",nativeProps:["open","title","closable","size"],render:(e,a)=>{let r=e.open?"open":"",i=e.title||"";return`<dialog class="craft-modal" ${r}>
@@ -947,7 +947,7 @@ ${r}`);return r+e}var Vr={button:{nativeType:"craft-button",fallbackTag:"button"
947
947
  </details>`}},divider:{nativeType:"craft-divider",fallbackTag:"hr",fallbackClasses:"craft-divider",nativeProps:["orientation","variant"]},table:{nativeType:"craft-table",fallbackTag:"table",fallbackClasses:"craft-table",nativeProps:["columns","rows","sortable","selectable"]},list:{nativeType:"craft-list",fallbackTag:"ul",fallbackClasses:"craft-list",nativeProps:["items","selectable"]},tree:{nativeType:"craft-tree",fallbackTag:"div",fallbackClasses:"craft-tree",nativeProps:["nodes","expandable","selectable"]},alert:{nativeType:"craft-alert",fallbackTag:"div",fallbackClasses:"craft-alert",nativeProps:["variant","title","dismissible"],render:(e,a)=>{let r=e.variant||"info",i=e.title||"";return`<div class="craft-alert craft-alert-${r}" role="alert">
948
948
  ${i?`<div class="craft-alert-title">${i}</div>`:""}
949
949
  <div class="craft-alert-content">${a}</div>
950
- </div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,a)=>{let r=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${r}" data-position="${i}">${a}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:j},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:H},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:V},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:W},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,a)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,a)=>{let r=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${r}" min="${i}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,a)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},_o=`
950
+ </div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(e,a)=>{let r=e.content||"",i=e.position||"top";return`<span class="craft-tooltip" data-tooltip="${r}" data-position="${i}">${a}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:U},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:j},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:H},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:W},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(e,a)=>`<input type="color" class="craft-color-picker" value="${e.value||"#000000"}">`},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(e,a)=>{let r=e.value||"",i=e.min||"",s=e.max||"";return`<input type="date" class="craft-date-picker" value="${r}" min="${i}" max="${s}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(e,a)=>`<input type="time" class="craft-time-picker" value="${e.value||""}">`}},To=`
951
951
  <style id="craft-component-styles">
952
952
  /* Craft Component Base Styles */
953
953
  .craft-button {
@@ -1365,7 +1365,7 @@ ${r}`);return r+e}var Vr={button:{nativeType:"craft-button",fallbackTag:"button"
1365
1365
  }
1366
1366
  }
1367
1367
  </style>
1368
- `,Td=`
1368
+ `,_d=`
1369
1369
  <script id="craft-component-runtime">
1370
1370
  (function() {
1371
1371
  if (window.__stxCraftComponentRuntime) return;
@@ -2934,14 +2934,14 @@ ${r}`);return r+e}var Vr={button:{nativeType:"craft-button",fallbackTag:"button"
2934
2934
  document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
2935
2935
  })();
2936
2936
  </script>
2937
- `;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),a,r)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),a,r)),e}function R(e,a,r,i,s){let t=i.components?.[e]||Vr[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${r}</div>`;let n=A(a),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,r);let d=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${d}>`;return`<${t.fallbackTag} ${d}>${r}</${t.fallbackTag}>`}function A(e){let a={},r=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,i;while((i=r.exec(e))!==null){let[s,t,n,c]=i,d=n??c;if(s.startsWith(":"))a[t]=d;else if(s.startsWith("@"))a[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=d;else if(d===void 0)a[t]=!0;else a[t]=d}return a}function j(e,a){let r=I(String(e.id||`craft-sidebar-${K(a||JSON.stringify(e))}`)),i=Q(e.spaces)||Y(a),s=i.length?[]:X(e.sections)||F(a),t=String(e.selectedSpace||i[0]?.id||""),n=i.find((m)=>m.id===t)||i[0],c=String(e.selectedItem||e.selected||(i.length?n?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),d={id:r,variant:String(e.variant||"desktop"),material:String(e.material||"sidebar"),backgroundEffect:String(e.backgroundEffect||"shimmer"),allowsVibrancy:e.allowsVibrancy!==!1&&e.allowsVibrancy!=="false",materialOpacity:Number(e.materialOpacity??0.68),materialDarkOpacity:e.materialDarkOpacity===void 0?void 0:Number(e.materialDarkOpacity),minWidth:e.minWidth===void 0?240:Number(e.minWidth),maxWidth:e.maxWidth===void 0?340:Number(e.maxWidth),canCollapse:e.canCollapse!==!1&&e.canCollapse!=="false",searchPlaceholder:e.searchPlaceholder?String(e.searchPlaceholder):void 0,selectedItem:c,sections:s,spaces:i,selectedSpace:t||void 0},l=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),b=Number(e.width||e.sidebarWidth||286),f=e.native===!1||e.native==="false"?"false":"true",x=d.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(d.searchPlaceholder)}"></div>`:"",u;if(i.length)u=G(i,t,c);else if(s.length)u=s.map((m)=>D(m,c)).join("");else u=a;return`<aside class="${h(l)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(r)}" data-native="${f}" style="--craft-sidebar-width:${b}px">
2937
+ `;return e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(i,s,t)=>R("sidebar",s,t.trim(),a,r)),e=e.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(i,s)=>R("sidebar",s,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(i,s,t)=>R(s,t,"",a,r)),e=e.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(i,s,t,n)=>R(s,t,n.trim(),a,r)),e}function R(e,a,r,i,s){let t=i.components?.[e]||Ur[e];if(!t)return console.warn(`[stx] Unknown Craft component: @craft-${e}`),`<div class="${s}-unknown" data-component="${e}">${r}</div>`;let n=A(a),c=[t.fallbackClasses||`${s}-${e}`];if(n.class)c.push(n.class),delete n.class;if(t.render)return n.__fallbackClasses=c.join(" "),t.render(n,r);let d=ee(n,t,c);if(["input","hr","br","img"].includes(t.fallbackTag))return`<${t.fallbackTag} ${d}>`;return`<${t.fallbackTag} ${d}>${r}</${t.fallbackTag}>`}function A(e){let a={},r=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,i;while((i=r.exec(e))!==null){let[s,t,n,c]=i,d=n??c;if(s.startsWith(":"))a[t]=d;else if(s.startsWith("@"))a[`on${t.charAt(0).toUpperCase()}${t.slice(1)}`]=d;else if(d===void 0)a[t]=!0;else a[t]=d}return a}function U(e,a){let r=I(String(e.id||`craft-sidebar-${K(a||JSON.stringify(e))}`)),i=Q(e.spaces)||Y(a),s=i.length?[]:X(e.sections)||F(a),t=String(e.selectedSpace||i[0]?.id||""),n=i.find((m)=>m.id===t)||i[0],c=String(e.selectedItem||e.selected||(i.length?n?.sections[0]?.items[0]?.id:s[0]?.items[0]?.id)||""),d={id:r,variant:String(e.variant||"desktop"),material:String(e.material||"sidebar"),backgroundEffect:String(e.backgroundEffect||"shimmer"),allowsVibrancy:e.allowsVibrancy!==!1&&e.allowsVibrancy!=="false",materialOpacity:Number(e.materialOpacity??0.68),materialDarkOpacity:e.materialDarkOpacity===void 0?void 0:Number(e.materialDarkOpacity),minWidth:e.minWidth===void 0?240:Number(e.minWidth),maxWidth:e.maxWidth===void 0?340:Number(e.maxWidth),canCollapse:e.canCollapse!==!1&&e.canCollapse!=="false",searchPlaceholder:e.searchPlaceholder?String(e.searchPlaceholder):void 0,selectedItem:c,sections:s,spaces:i,selectedSpace:t||void 0},l=String(e.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),b=Number(e.width||e.sidebarWidth||286),f=e.native===!1||e.native==="false"?"false":"true",x=d.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${C(d.searchPlaceholder)}"></div>`:"",u;if(i.length)u=G(i,t,c);else if(s.length)u=s.map((m)=>D(m,c)).join("");else u=a;return`<aside class="${h(l)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${h(r)}" data-native="${f}" style="--craft-sidebar-width:${b}px">
2938
2938
  ${x}
2939
2939
  ${u}
2940
2940
  </aside>
2941
- <script type="application/json" data-craft-sidebar-config="${h(r)}">${Z(d)}</script>`}function H(e,a){let r=I(String(e.id||e.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${h(r)}">
2941
+ <script type="application/json" data-craft-sidebar-config="${h(r)}">${Z(d)}</script>`}function j(e,a){let r=I(String(e.id||e.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${h(r)}">
2942
2942
  ${e.label?`<div class="craft-sidebar-space-title">${C(String(e.label))}</div>`:""}
2943
2943
  ${a}
2944
- </section>`}function V(e,a){let r=String(e.header||e.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${h(String(e.id||"section"))}">
2944
+ </section>`}function H(e,a){let r=String(e.header||e.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${h(String(e.id||"section"))}">
2945
2945
  ${r?`<div class="craft-sidebar-section-title">${C(r)}</div>`:""}
2946
2946
  ${a}
2947
2947
  </section>`}function W(e,a){let r={id:String(e.id||I(String(e.label||a||"item"))),label:String(e.label||a||""),icon:e.icon?String(e.icon):void 0,badge:e.badge?String(e.badge):void 0,tintColor:e.tintColor?String(e.tintColor):void 0};return O(r,String(e.selected||"")==="true")}function F(e){let a=[],r=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.id||I(String(s.header||s.title||`section-${a.length+1}`))),c=String(s.header||s.title||n),d=J(t);a.push({id:n,header:c,title:c,items:d})}return a}function J(e){let a=[],r=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=String(s.label||(i[2]||"").replace(/<[^>]*>/g,"").trim()),n=String(s.id||I(t||`item-${a.length+1}`));a.push({id:n,label:t,icon:s.icon?String(s.icon):void 0,badge:s.badge?String(s.badge):void 0,tintColor:s.tintColor?String(s.tintColor):void 0})}return a}function Y(e){let a=[],r=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,i;while((i=r.exec(e))!==null){let s=A(i[1]||""),t=i[2]||"",n=String(s.label||s.title||`Space ${a.length+1}`);a.push({id:String(s.id||I(n)),label:n,icon:s.icon?String(s.icon):void 0,tint:s.tint?String(s.tint):void 0,sections:F(t)})}return a}function Q(e){if(!e)return;if(Array.isArray(e))return e;if(typeof e!=="string")return;try{let a=JSON.parse(e);return Array.isArray(a)?a:void 0}catch{return}}function G(e,a,r){let i=e.map((t)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${h(t.id)}" data-selected="${t.id===a?"true":"false"}" title="${h(t.label||t.id)}">${t.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(t.icon)}"></span>`:C((t.label||t.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${e.map((t)=>`<section class="craft-sidebar-space" data-space-id="${h(t.id)}" data-selected="${t.id===a?"true":"false"}">
@@ -2955,7 +2955,7 @@ ${r}`);return r+e}var Vr={button:{nativeType:"craft-button",fallbackTag:"button"
2955
2955
  ${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${h(e.icon)}"${r}></span>`:""}
2956
2956
  <span class="craft-sidebar-item-label">${C(e.label)}</span>
2957
2957
  ${e.badge?`<span class="craft-sidebar-item-badge">${C(e.badge)}</span>`:""}
2958
- </button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let a=5381;for(let r=0;r<e.length;r++)a=a*33^e.charCodeAt(r);return(a>>>0).toString(36)}function C(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function h(e){return C(e).replace(/`/g,"&#96;")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,a,r){let i=[];i.push(`class="${r.join(" ")}"`),i.push(`data-craft="${a.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,"&quot;");i.push(`${s}="${n}"`)}return i.join(" ")}function _d(e,a){Vr[e]=a}function $d(){return{...Vr}}import{existsSync as z,mkdirSync as v,copyFileSync as k,chmodSync as T}from"fs";import{join as o,basename as te}from"path";import{spawn as E,execSync as ae}from"child_process";import{homedir as B,platform as re}from"os";async function Ro(e){let a=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||P(),format:e.format||"app",error:`Input file not found: ${e.input}`};let r=e.target||P(),i=e.format||pe(r),s=e.output||o(process.cwd(),"dist","native");if(!z(s))v(s,{recursive:!0});let t=await Oo(e.input,{context:e.context,options:{isDev:!1}});if(t=To(t,{debug:e.verbose}),t=$o(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${_o}
2958
+ </button>`}function I(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function K(e){let a=5381;for(let r=0;r<e.length;r++)a=a*33^e.charCodeAt(r);return(a>>>0).toString(36)}function C(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function h(e){return C(e).replace(/`/g,"&#96;")}function Z(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ee(e,a,r){let i=[];i.push(`class="${r.join(" ")}"`),i.push(`data-craft="${a.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)i.push(s);else if(t!==!1&&t!==void 0&&t!==null){let n=String(t).replace(/"/g,"&quot;");i.push(`${s}="${n}"`)}return i.join(" ")}function Td(e,a){Ur[e]=a}function $d(){return{...Ur}}import{existsSync as z,mkdirSync as v,copyFileSync as k,chmodSync as T}from"fs";import{join as o,basename as te}from"path";import{spawn as E,execSync as ae}from"child_process";import{homedir as B,platform as re}from"os";async function Ro(e){let a=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||P(),format:e.format||"app",error:`Input file not found: ${e.input}`};let r=e.target||P(),i=e.format||pe(r),s=e.output||o(process.cwd(),"dist","native");if(!z(s))v(s,{recursive:!0});let t=await Do(e.input,{context:e.context,options:{isDev:!1}});if(t=_o(t,{debug:e.verbose}),t=$o(t),!t.includes("craft-component-styles")){if(t.includes("</head>"))t=t.replace("</head>",`${To}
2959
2959
  </head>`)}let n=e.name||te(e.input,".stx"),c=e.version||"1.0.0",d=e.craftPath||await fe();if(!d)return{success:!1,target:r,format:i,error:"Craft binary not found. Please install Craft or specify craftPath."};if(e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${r}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${d}`);let l;switch(r){case"macos":l=await ie(t,n,c,s,i,e,d);break;case"windows":l=await oe(t,n,c,s,i,e,d);break;case"linux":l=await ce(t,n,c,s,i,e,d);break;case"ios":l=await de(t,n,c,s,e,d);break;case"android":l=await le(t,n,c,s,e,d);break;default:l={success:!1,target:r,format:i,error:`Unsupported target: ${r}`}}return l.duration=Date.now()-a,l}catch(r){return{success:!1,target:e.target||P(),format:e.format||"app",error:r.message,duration:Date.now()-a}}}async function ie(e,a,r,i,s,t,n){let c=t.bundleId||`com.stx.${a.toLowerCase().replace(/[^a-z0-9]/g,"")}`,d=o(i,`${a}.app`),l=o(d,"Contents"),b=o(l,"MacOS"),f=o(l,"Resources");v(b,{recursive:!0}),v(f,{recursive:!0});let x=o(f,"index.html");await Bun.write(x,e);let u="";if(t.sidebar?.enabled&&t.sidebar?.config)u=o(f,"sidebar-config.json"),await Bun.write(u,JSON.stringify(t.sidebar.config));let m=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",y=t.menubarOnly??t.systemTray;if((t.bundleStyle||(await se(n)?"executable":"launcher"))==="executable"){let S=o(b,a);k(n,S),T(S,493);let w={html:"index.html",title:t.window?.title||a,width:t.window?.width||1200,height:t.window?.height||800,devTools:Boolean(t.devTools)};if(y)w.menubarOnly=!0;else if(t.systemTray)w.systemTray=!0;if(t.window?.frameless)w.frameless=!0;if(t.window?.transparent)w.transparent=!0;if(t.window?.alwaysOnTop)w.alwaysOnTop=!0;if(t.window?.resizable===!1)w.resizable=!1;await Bun.write(o(f,"craft.json"),`${JSON.stringify(w,null,2)}
2960
2960
  `)}else{let S=o(b,"craft");k(n,S),T(S,493);let w=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",L=`#!/bin/bash
2961
2961
  set -euo pipefail
@@ -3006,7 +3006,7 @@ Architecture: amd64
3006
3006
  Depends: libgtk-3-0, libwebkit2gtk-4.0-37
3007
3007
  Maintainer: ${s.author||"Unknown"}
3008
3008
  Description: ${s.description||r}
3009
- `;p("fs").writeFileSync(o(d,"control"),m);let y=E("dpkg-deb",["--build",c,a]);y.on("close",(g)=>{if(U(n),g===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${g}`})}),y.on("error",(g)=>{U(n),t({success:!1,error:g.message})})}catch(c){U(n),t({success:!1,error:c.message})}})}async function me(e,a,r,i){return new Promise((s)=>{let t=Me("appimage");try{let n=o(t,`${r}.AppDir`),c=o(n,"usr"),d=o(c,"bin"),l=o(c,"share");v(d,{recursive:!0}),v(l,{recursive:!0});let b=o(l,r.toLowerCase());v(b,{recursive:!0});let f=p("fs").readdirSync(e);for(let g of f)k(o(e,g),o(b,g));let x=`#!/bin/bash
3009
+ `;p("fs").writeFileSync(o(d,"control"),m);let y=E("dpkg-deb",["--build",c,a]);y.on("close",(g)=>{if(V(n),g===0)t({success:!0});else t({success:!1,error:`dpkg-deb exited with code ${g}`})}),y.on("error",(g)=>{V(n),t({success:!1,error:g.message})})}catch(c){V(n),t({success:!1,error:c.message})}})}async function me(e,a,r,i){return new Promise((s)=>{let t=Me("appimage");try{let n=o(t,`${r}.AppDir`),c=o(n,"usr"),d=o(c,"bin"),l=o(c,"share");v(d,{recursive:!0}),v(l,{recursive:!0});let b=o(l,r.toLowerCase());v(b,{recursive:!0});let f=p("fs").readdirSync(e);for(let g of f)k(o(e,g),o(b,g));let x=`#!/bin/bash
3010
3010
  SELF=$(readlink -f "$0")
3011
3011
  HERE=\${SELF%/*}
3012
3012
  export PATH="\${HERE}/usr/bin:\${PATH}"
@@ -3018,5 +3018,5 @@ Exec=${r.toLowerCase()}
3018
3018
  Terminal=false
3019
3019
  Categories=Utility;
3020
3020
  Icon=${r.toLowerCase()}
3021
- `;p("fs").writeFileSync(o(n,`${r.toLowerCase()}.desktop`),u);let m=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(p("fs").writeFileSync(o(n,`${r.toLowerCase()}.png`),m),i.icon&&z(i.icon))k(i.icon,o(n,`${r.toLowerCase()}.png`));let y=E("appimagetool",[n,a],{env:{...process.env,ARCH:"x86_64"}});y.on("close",(g)=>{if(U(t),g===0)T(a,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${g}. Install from https://appimage.github.io/appimagetool/`})}),y.on("error",(g)=>{U(t),s({success:!1,error:`appimagetool not found: ${g.message}`})})}catch(n){U(t),s({success:!1,error:n.message})}})}function Ao(){return[P()]}function Po(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var he={buildNative:Ro,getAvailableTargets:Ao,getAvailableFormats:Po,detectPlatform:P},Rd=he;
3022
- export{kd,Eo,Cd,Ed,To,Vr,_o,Td,$o,_d,$d,Ro,Ao,Po,Rd};
3021
+ `;p("fs").writeFileSync(o(n,`${r.toLowerCase()}.desktop`),u);let m=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(p("fs").writeFileSync(o(n,`${r.toLowerCase()}.png`),m),i.icon&&z(i.icon))k(i.icon,o(n,`${r.toLowerCase()}.png`));let y=E("appimagetool",[n,a],{env:{...process.env,ARCH:"x86_64"}});y.on("close",(g)=>{if(V(t),g===0)T(a,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${g}. Install from https://appimage.github.io/appimagetool/`})}),y.on("error",(g)=>{V(t),s({success:!1,error:`appimagetool not found: ${g.message}`})})}catch(n){V(t),s({success:!1,error:n.message})}})}function Ao(){return[P()]}function Po(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var he={buildNative:Ro,getAvailableTargets:Ao,getAvailableFormats:Po,detectPlatform:P},Rd=he;
3022
+ export{kd,Eo,Cd,Ed,_o,Ur,To,_d,$o,Td,$d,Ro,Ao,Po,Rd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zn,rc,Dd,sc,Md,oc,Hn,b,Ct,be,ic,ns,ac,Nd,G,cc,Ld,x,jd}from"./chunk-gnx0fzne.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-01343ehq.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{cc as applyFilters,Md as clearCustomFilters,ic as clientLoopScopes,zn as defaultFilters,b as escapeHtml,Ct as escapeHtmlValue,x as evaluateExpression,oc as findMustacheEnd,sc as getAllFilters,ac as interpolateScriptAttributes,ns as interpolateScriptExpressions,Nd as interpolateScriptsInTemplate,G as processExpressions,rc as registerFilter,Dd as registerFilters,Hn as replaceInterpolations,Ld as resetRejectedExpressionWarnings,jd as unescapeHtml,be as usesSignalsInScript};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{K,xs,Ss,ks,n}from"./chunk-gnx0fzne.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-01343ehq.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{K as injectRouterScript,n as processDirectives,xs as processJsonDirective,Ss as processOnceDirective,ks as validateClientScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{K,n}from"./chunk-g5t10z04.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
2
+ import{G,n}from"./chunk-gnx0fzne.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -8,7 +8,7 @@ ${e.dim}Type 'help <command>' for more details${e.reset}
8
8
  `)}}},render:{description:"Render a template file",usage:"render <file> [--raw]",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file to render${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);if(!await Bun.file(r).exists()){console.log(`${e.red}Error: File not found: ${r}${e.reset}`);return}try{let s=await Bun.file(r).text(),l=t.includes("--raw");console.log(`
9
9
  ${e.dim}Rendering ${r}...${e.reset}
10
10
  `);let c=await n(s,o.context,r,{},new Set);if(o.lastResult=c,l)console.log(c);else c.split(`
11
- `).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,o)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let r=t.join(" ");try{let s=`{{ ${r} }}`,c=(await K(s,o.context,"eval")).trim();o.lastResult=c,console.log(`${e.green}\u2192${e.reset} ${c}`)}catch(s){console.log(`${e.red}Error:${e.reset}`,s)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,o)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let r=t[0],s=t.slice(1).join(" "),l;try{l=JSON.parse(s)}catch{l=s}o.context[r]=l,console.log(`${e.green}\u2713${e.reset} ${r} = ${JSON.stringify(l)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in o.context)delete o.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,o)=>{let r=Object.keys(o.context);if(r.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
11
+ `).forEach((d,i)=>{let f=String(i+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(s){console.log(`${e.red}Error rendering template:${e.reset}`,s)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,o)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let r=t.join(" ");try{let s=`{{ ${r} }}`,c=(await G(s,o.context,"eval")).trim();o.lastResult=c,console.log(`${e.green}\u2192${e.reset} ${c}`)}catch(s){console.log(`${e.red}Error:${e.reset}`,s)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,o)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let r=t[0],s=t.slice(1).join(" "),l;try{l=JSON.parse(s)}catch{l=s}o.context[r]=l,console.log(`${e.green}\u2713${e.reset} ${r} = ${JSON.stringify(l)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in o.context)delete o.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,o)=>{let r=Object.keys(o.context);if(r.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
12
12
  ${e.bold}Context Variables:${e.reset}
13
13
  `);for(let s of r){let l=o.context[s],c=Array.isArray(l)?"array":typeof l,a=JSON.stringify(l).slice(0,50);console.log(` ${e.cyan}${s}${e.reset} ${e.dim}(${c})${e.reset}: ${a}${a.length>=50?"...":""}`)}console.log()}},clear:{description:"Clear context or screen",usage:"clear [context|screen]",handler:async(t,o)=>{if(t[0]==="context"||!t[0])o.context={},console.log(`${e.green}\u2713${e.reset} Context cleared`);if(t[0]==="screen"||!t[0])console.clear()}},cd:{description:"Change working directory",usage:"cd <directory>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.cyan}${o.cwd}${e.reset}`);return}let r=g.resolve(o.cwd,t[0]);if(!p.existsSync(r)){console.log(`${e.red}Error: Directory not found: ${r}${e.reset}`);return}if(!p.statSync(r).isDirectory()){console.log(`${e.red}Error: Not a directory: ${r}${e.reset}`);return}o.cwd=r,console.log(`${e.green}\u2713${e.reset} ${r}`)}},ls:{description:"List files in current directory",usage:"ls [pattern]",handler:async(t,o)=>{let r=t[0]||"*",s=new Bun.Glob(r),l=[];for await(let i of s.scan({cwd:o.cwd,onlyFiles:!1}))l.push(i);if(l.length===0){console.log(`${e.dim}No files found${e.reset}`);return}l.sort();let c=l.filter((i)=>i.endsWith(".stx")),a=l.filter((i)=>i.endsWith(".md")),d=l.filter((i)=>!i.endsWith(".stx")&&!i.endsWith(".md"));if(c.length>0)console.log(`
14
14
  ${e.bold}Templates:${e.reset}`),c.forEach((i)=>console.log(` ${e.green}${i}${e.reset}`));if(a.length>0)console.log(`
@@ -19,6 +19,6 @@ ${e.dim}Goodbye!${e.reset}
19
19
  `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let r=t.split(" "),s=r[0];if(r.length===1)return Object.keys(u).filter((l)=>l.startsWith(s));if(["render","cat","load","cd"].includes(s)){let l=r.slice(1).join(" "),c=g.dirname(l)||".",a=g.basename(l),d=g.resolve(o.cwd,c);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${s} ${c==="."?"":`${c}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(s)){let l=r[1]||"";return Object.keys(o.context).filter((c)=>c.startsWith(l)).map((c)=>`${s} ${c}`)}return[]}async function nl(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},r=y.createInterface({input:process.stdin,output:process.stdout,completer:(l)=>[h(l,o),l],historySize:t.maxHistory||100});console.log(`
20
20
  ${e.bold}${e.blue}stx Interactive Mode${e.reset}
21
21
  ${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
22
- `);let s=()=>{let l=o.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(o.running)s();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await K(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)s();else r.close()})};r.on("SIGINT",()=>{console.log(`
22
+ `);let s=()=>{let l=o.cwd.replace(process.env.HOME||"","~");r.question(`${e.cyan}stx${e.reset} ${e.dim}${l}${e.reset} ${e.green}>${e.reset} `,async(c)=>{let a=c.trim();if(!a){if(o.running)s();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],i=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(i&&u[i])try{await u[i].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(i)if(a.includes("{{")||a.includes("}}"))try{let m=await G(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${i}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)s();else r.close()})};r.on("SIGINT",()=>{console.log(`
23
23
  ${e.dim}(Use 'exit' to quit)${e.reset}`),s()}),s()}
24
24
  export{nl};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{t,i,D}from"./chunk-tkeabv04.js";import{Cs}from"./chunk-bpr4bkde.js";import E from"path";var S;async function W(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var T={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function J(e,a=0){if(a<=0)return!1;return Date.now()-e.loadedAt>a}async function G(e,a){if({...T,...a.i18n}.cache&&v[e]){let r=v[e],l=a.i18n?.cacheMaxAge??0;if(!J(r,l))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=C(e,a).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function C(e,a){let s={...T,...a.i18n},n=E.isAbsolute(s.translationsDir)?s.translationsDir:E.resolve(a.root||process.cwd(),s.translationsDir);try{let r=await W(),l=r?await r(e,{translationsDir:n,defaultLocale:s.defaultLocale,sources:ee(s.format)}):await Y(e,s,n);if(l===void 0){let u=e!==s.defaultLocale?await C(s.defaultLocale,a):{};if(s.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=l;if(s.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(a.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==s.defaultLocale)return C(s.defaultLocale,a);return{}}}async function Y(e,a,s){let n=E.join(s,`${e}${Z(a.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let l=await Bun.file(n).text();if(a.format==="yaml"||a.format==="yml")return Q(l);if(a.format==="json")return JSON.parse(l);throw r}catch{return}}}function Z(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function Q(e){let a={},s=e.split(`
3
- `),n=[{obj:a,indent:-1}];for(let r of s){let l=r.replace(/#.*$/,"").trimEnd();if(!l.trim())continue;let c=l.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,o=l.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(o){let[,,g,f]=o,p=g.trim(),m=f.trim();if(m==="")u[p]={},n.push({obj:u[p],indent:c});else u[p]=X(m)}}return a}function X(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let a=e.toLowerCase();if(a==="true"||a==="yes")return!0;if(a==="false"||a==="no")return!1;if(a==="null"||a==="~")return null;let s=Number(e);if(!Number.isNaN(s)&&e!=="")return s;return e}function ee(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function te(e,a){return G(e,a)}function re(e,a){for(let s of e){let n=s.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(a===c)return r[2];continue}let l=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(l){let c=Number.parseInt(l[1],10),u=l[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(l[2],10);if(a>=c&&a<=u)return l[3];continue}}if(e.length===2)return a===1?e[0].trim():e[1].trim();if(a<e.length)return e[a].trim();return e[e.length-1].trim()}function ne(e,a={}){return j(e,a)}function j(e,a){let s="",n=0;while(n<e.length)if(e[n]==="{"){let r=ie(e,n);if(r===-1){s+=e[n],n++;continue}let l=e.slice(n+1,r);s+=se(l,a),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")s+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")s+=e[n+1],n+=2;else s+=e[n],n++;else s+=e[n],n++;return s}function ie(e,a){let s=0;for(let n=a;n<e.length;n++)if(e[n]==="{")s++;else if(e[n]==="}"){if(s--,s===0)return n}return-1}function se(e,a){let s=ae(e);if(s.length===0)return`{${e}}`;let n=s[0].trim(),r=a[n];if(s.length===1)return r!==void 0?String(r):`{${n}}`;switch(s[1].trim().toLowerCase()){case"plural":return oe(r,s.slice(2).join(","),a);case"select":return ce(r,s.slice(2).join(","));case"selectordinal":return ue(r,s.slice(2).join(","));case"number":return ge(r,s[2]?.trim());case"date":return pe(r,s[2]?.trim());case"time":return fe(r,s[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function ae(e){let a=[],s="",n=0;for(let r=0;r<e.length;r++){let l=e[r];if(l==="{")n++,s+=l;else if(l==="}")n--,s+=l;else if(l===","&&n===0)a.push(s),s="";else s+=l}if(s)a.push(s);return a}function oe(e,a,s){let n=Number(e)||0,r=P(a),l=`=${n}`;if(r[l])return R(r[l],n,s);let c=le(n);if(r[c])return R(r[c],n,s);if(r.other)return R(r.other,n,s);return String(n)}function R(e,a,s){let n=e.replace(/#/g,String(a));return j(n,s)}function le(e){let a=Math.abs(e),s=Math.floor(a),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(s===1&&n===0)return"one";return"other"}function ce(e,a){let s=String(e||""),n=P(a);if(n[s])return n[s];return n.other||String(e)}function ue(e,a){let s=Number(e)||0,n=P(a),r=de(s);if(n[r])return n[r].replace(/#/g,String(s));if(n.other)return n.other.replace(/#/g,String(s));return String(s)}function de(e){let a=Math.abs(e),s=a%10,n=a%100;if(s===1&&n!==11)return"one";if(s===2&&n!==12)return"two";if(s===3&&n!==13)return"few";return"other"}function P(e){let a={},s=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=s.exec(e);while(n!==null)a[n[1]]=n[2],n=s.exec(e);return a}function ge(e,a){let s=Number(e);if(Number.isNaN(s))return String(e);switch(a){case"integer":return Math.floor(s).toLocaleString();case"percent":return`${(s*100).toFixed(0)}%`;case"currency":return s.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return s.toLocaleString()}}function pe(e,a){let s=e instanceof Date?e:new Date(String(e));if(Number.isNaN(s.getTime()))return String(e);let n={};switch(a){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return s.toLocaleDateString(void 0,n)}function fe(e,a){let s=e instanceof Date?e:new Date(String(e));if(Number.isNaN(s.getTime()))return String(e);let n={};switch(a){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return s.toLocaleTimeString(void 0,n)}function me(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function N(e,a,s=!0,n={}){let r=e.split("."),l=a;for(let u of r){if(l===void 0||l===null)break;l=l[u]}if(l===void 0||l===null)return s?e:"";let c=String(l);if(me(c))return ne(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),o=c.split("|");c=re(o,u)}for(let[u,o]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),String(o))}return c}var O=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),be=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function _(e){if(!e)return"ltr";let a=e.trim().toLowerCase().replace(/_/g,"-").split("-"),s=a[0];if(!s)return"ltr";let n=a[1]?.length===4?a[1]:void 0;if(n)return be.has(n)?"rtl":"ltr";if(a.length>1&&O.has(`${s}-${a[1]}`))return"rtl";return O.has(s)?"rtl":"ltr"}async function wi(e,a,s,n){let r=e,l=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...T,...n.i18n},u=await te(c.locale,n);a.__translations=u,a.__locale=c.locale,a.__i18nConfig=c,r=await F(r,l,async(f,p,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,A=JSON.parse(x);return typeof A.data==="object"?A.data:{}},()=>D(m,a)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}return N(p,u,c.fallbackToKey,b)||w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return i("Translate",`Error in @translate('${p}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let f=[...r.matchAll(o)];console.warn(`Found ${f.length} @translate matches`),f.forEach((p,m)=>console.warn(`Match ${m}: ${p[0]}, Key: ${p[1]}, Params: ${p[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(f,p,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>D(m,a)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return N(p,u,c.fallbackToKey,h)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return i("Translate",`Error in @translate('${p}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,a,s){let n=[];return e.replace(a,(l,...c)=>{let u=s(l,...c).then((o)=>({match:l,replacement:o}));return n.push(u),l}),(await Promise.all(n)).reduce((l,{match:c,replacement:u})=>l.replace(c,u),e)}function q(e,a){if(!e||_(e)!=="rtl")return!1;return!a||a.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function I(e,a){let s=new RegExp(`\\b${a}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!s)return null;return s[2]??s[3]??s[4]??null}function vi(e,a,s,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,o)=>{let f={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${o||f} -->`});let l=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(l,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,o)=>`<span id="${`desc-${u}`}" class="sr-only">${o}</span>`),r}function he(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function ye(e){let a=new Map,s=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,l,c)=>{let u=a.get(c);if(!u)u=`stx-a11y-component-${a.size}`,a.set(c,u);return`<${l}${u}`}),n=new Map([...a.entries()].map(([r,l])=>[l,r]));return{protectedSource:s,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(l,c,u)=>{let o=n.get(u);return o?`<${c}${o}`:l})}}function xe(e,a){let s=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))s.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let l=/<button([^>]*)>\s*<\/button>/gi;r=l.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))s.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=l.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))s.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),A=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=A&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${A[1]}["']`,"i").test(e),U=r.index,M=e.substring(0,U),Ae=e.substring(U),H=(M.match(/<label\b/gi)||[]).length,z=(M.match(/<\/label>/gi)||[]).length,K=H>z;if(!B&&!K)s.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let o=/<h([1-6])[^>]*>/gi,g=[];r=o.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=o.exec(e);let f=0;for(let d of g){if(f>0&&d>f+1)s.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${f} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});f=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))s.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let p=e.match(/<html\b([^>]*)>/i);if(p&&q(I(p[1],"lang"),I(p[1],"dir")))s.push({type:"missing-dir",element:p[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(I(r[1],"role"))&&!/<th\b/i.test(d))s.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))s.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)s.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))s.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))s.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return s}async function we(e,a){let{protectedSource:s}=ye(e);if(!he())return xe(s,a);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=s,r.querySelectorAll("img").forEach((o)=>{if(!o.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${o.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((o)=>{if(!(o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby")||o.textContent&&o.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${o.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((o)=>{let g=o.getAttribute("id"),f=g&&r.querySelector(`label[for="${g}"]`),p=o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby"),m=o.closest("label")!==null;if(!f&&!p&&!m)n.push({type:"input-missing-label",element:`<${o.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let l=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let o of l){let g=Number.parseInt(o.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${o.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(s.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&q(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((o)=>{let g=o.textContent&&o.textContent.trim().length>0,f=o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby"),p=o.hasAttribute("title"),m=o.querySelector("img[alt]");if(!g&&!f&&!p&&!m)n.push({type:"link-missing-text",element:`<${o.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),s.includes("<nav")||s.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((o)=>{if(V(o.getAttribute("role")))return;let g=o.querySelector("caption");if(!o.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!o.hasAttribute("aria-label")&&!o.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((o)=>{let g=o.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${o.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((o)=>{if(!o.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${o.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((o)=>{if(Number.parseInt(o.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${o.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((o)=>{if(!o.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${o.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),s.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((o)=>{if(!o.hasAttribute("title")&&!o.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${a}:`,r)}return n}async function xi(e,a={}){let s={},{recursive:n=!0,ignorePaths:r=[]}=a,l=Array.isArray(e)?e:[e],c=await Cs(l,{recursive:n,ignorePaths:r}),u=[];for(let o of c)try{let g=await Bun.file(o).text();if(o.endsWith("good-a11y.stx"))continue;let f=await we(g,o);if(u.push(o),f.length>0)s[o]=f}catch(g){console.error(`Error scanning ${o}:`,g)}return{results:s,scannedFiles:u}}var Si={name:"a11y",handler:(e,a,s,n)=>{if(!a.length)return e;let r=a[0].replace(/['"]/g,""),l=a.length>1?a[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${l||u} -->${e}`},hasEndTag:!1},ki={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
2
+ import{t,i,O}from"./chunk-vhfwnvmc.js";import{Cs}from"./chunk-bpr4bkde.js";import E from"path";var S;async function W(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var T={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function J(e,a=0){if(a<=0)return!1;return Date.now()-e.loadedAt>a}async function G(e,a){if({...T,...a.i18n}.cache&&v[e]){let r=v[e],l=a.i18n?.cacheMaxAge??0;if(!J(r,l))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=C(e,a).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function C(e,a){let s={...T,...a.i18n},n=E.isAbsolute(s.translationsDir)?s.translationsDir:E.resolve(a.root||process.cwd(),s.translationsDir);try{let r=await W(),l=r?await r(e,{translationsDir:n,defaultLocale:s.defaultLocale,sources:ee(s.format)}):await Y(e,s,n);if(l===void 0){let u=e!==s.defaultLocale?await C(s.defaultLocale,a):{};if(s.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=l;if(s.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(a.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==s.defaultLocale)return C(s.defaultLocale,a);return{}}}async function Y(e,a,s){let n=E.join(s,`${e}${Z(a.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let l=await Bun.file(n).text();if(a.format==="yaml"||a.format==="yml")return Q(l);if(a.format==="json")return JSON.parse(l);throw r}catch{return}}}function Z(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function Q(e){let a={},s=e.split(`
3
+ `),n=[{obj:a,indent:-1}];for(let r of s){let l=r.replace(/#.*$/,"").trimEnd();if(!l.trim())continue;let c=l.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,o=l.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(o){let[,,g,f]=o,p=g.trim(),m=f.trim();if(m==="")u[p]={},n.push({obj:u[p],indent:c});else u[p]=X(m)}}return a}function X(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let a=e.toLowerCase();if(a==="true"||a==="yes")return!0;if(a==="false"||a==="no")return!1;if(a==="null"||a==="~")return null;let s=Number(e);if(!Number.isNaN(s)&&e!=="")return s;return e}function ee(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function te(e,a){return G(e,a)}function re(e,a){for(let s of e){let n=s.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(a===c)return r[2];continue}let l=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(l){let c=Number.parseInt(l[1],10),u=l[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(l[2],10);if(a>=c&&a<=u)return l[3];continue}}if(e.length===2)return a===1?e[0].trim():e[1].trim();if(a<e.length)return e[a].trim();return e[e.length-1].trim()}function ne(e,a={}){return j(e,a)}function j(e,a){let s="",n=0;while(n<e.length)if(e[n]==="{"){let r=ie(e,n);if(r===-1){s+=e[n],n++;continue}let l=e.slice(n+1,r);s+=se(l,a),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")s+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")s+=e[n+1],n+=2;else s+=e[n],n++;else s+=e[n],n++;return s}function ie(e,a){let s=0;for(let n=a;n<e.length;n++)if(e[n]==="{")s++;else if(e[n]==="}"){if(s--,s===0)return n}return-1}function se(e,a){let s=ae(e);if(s.length===0)return`{${e}}`;let n=s[0].trim(),r=a[n];if(s.length===1)return r!==void 0?String(r):`{${n}}`;switch(s[1].trim().toLowerCase()){case"plural":return oe(r,s.slice(2).join(","),a);case"select":return ce(r,s.slice(2).join(","));case"selectordinal":return ue(r,s.slice(2).join(","));case"number":return ge(r,s[2]?.trim());case"date":return pe(r,s[2]?.trim());case"time":return fe(r,s[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function ae(e){let a=[],s="",n=0;for(let r=0;r<e.length;r++){let l=e[r];if(l==="{")n++,s+=l;else if(l==="}")n--,s+=l;else if(l===","&&n===0)a.push(s),s="";else s+=l}if(s)a.push(s);return a}function oe(e,a,s){let n=Number(e)||0,r=P(a),l=`=${n}`;if(r[l])return R(r[l],n,s);let c=le(n);if(r[c])return R(r[c],n,s);if(r.other)return R(r.other,n,s);return String(n)}function R(e,a,s){let n=e.replace(/#/g,String(a));return j(n,s)}function le(e){let a=Math.abs(e),s=Math.floor(a),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(s===1&&n===0)return"one";return"other"}function ce(e,a){let s=String(e||""),n=P(a);if(n[s])return n[s];return n.other||String(e)}function ue(e,a){let s=Number(e)||0,n=P(a),r=de(s);if(n[r])return n[r].replace(/#/g,String(s));if(n.other)return n.other.replace(/#/g,String(s));return String(s)}function de(e){let a=Math.abs(e),s=a%10,n=a%100;if(s===1&&n!==11)return"one";if(s===2&&n!==12)return"two";if(s===3&&n!==13)return"few";return"other"}function P(e){let a={},s=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=s.exec(e);while(n!==null)a[n[1]]=n[2],n=s.exec(e);return a}function ge(e,a){let s=Number(e);if(Number.isNaN(s))return String(e);switch(a){case"integer":return Math.floor(s).toLocaleString();case"percent":return`${(s*100).toFixed(0)}%`;case"currency":return s.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return s.toLocaleString()}}function pe(e,a){let s=e instanceof Date?e:new Date(String(e));if(Number.isNaN(s.getTime()))return String(e);let n={};switch(a){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return s.toLocaleDateString(void 0,n)}function fe(e,a){let s=e instanceof Date?e:new Date(String(e));if(Number.isNaN(s.getTime()))return String(e);let n={};switch(a){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return s.toLocaleTimeString(void 0,n)}function me(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function N(e,a,s=!0,n={}){let r=e.split("."),l=a;for(let u of r){if(l===void 0||l===null)break;l=l[u]}if(l===void 0||l===null)return s?e:"";let c=String(l);if(me(c))return ne(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),o=c.split("|");c=re(o,u)}for(let[u,o]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),String(o))}return c}var D=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),be=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function _(e){if(!e)return"ltr";let a=e.trim().toLowerCase().replace(/_/g,"-").split("-"),s=a[0];if(!s)return"ltr";let n=a[1]?.length===4?a[1]:void 0;if(n)return be.has(n)?"rtl":"ltr";if(a.length>1&&D.has(`${s}-${a[1]}`))return"rtl";return D.has(s)?"rtl":"ltr"}async function wi(e,a,s,n){let r=e,l=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...T,...n.i18n},u=await te(c.locale,n);a.__translations=u,a.__locale=c.locale,a.__i18nConfig=c,r=await F(r,l,async(f,p,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,A=JSON.parse(x);return typeof A.data==="object"?A.data:{}},()=>O(m,a)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}return N(p,u,c.fallbackToKey,b)||w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return i("Translate",`Error in @translate('${p}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let f=[...r.matchAll(o)];console.warn(`Found ${f.length} @translate matches`),f.forEach((p,m)=>console.warn(`Match ${m}: ${p[0]}, Key: ${p[1]}, Params: ${p[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(f,p,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>O(m,a)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return N(p,u,c.fallbackToKey,h)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return i("Translate",`Error in @translate('${p}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,a,s){let n=[];return e.replace(a,(l,...c)=>{let u=s(l,...c).then((o)=>({match:l,replacement:o}));return n.push(u),l}),(await Promise.all(n)).reduce((l,{match:c,replacement:u})=>l.replace(c,u),e)}function q(e,a){if(!e||_(e)!=="rtl")return!1;return!a||a.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function I(e,a){let s=new RegExp(`\\b${a}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!s)return null;return s[2]??s[3]??s[4]??null}function vi(e,a,s,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,o)=>{let f={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${o||f} -->`});let l=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(l,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,o)=>`<span id="${`desc-${u}`}" class="sr-only">${o}</span>`),r}function he(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function ye(e){let a=new Map,s=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,l,c)=>{let u=a.get(c);if(!u)u=`stx-a11y-component-${a.size}`,a.set(c,u);return`<${l}${u}`}),n=new Map([...a.entries()].map(([r,l])=>[l,r]));return{protectedSource:s,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(l,c,u)=>{let o=n.get(u);return o?`<${c}${o}`:l})}}function xe(e,a){let s=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))s.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let l=/<button([^>]*)>\s*<\/button>/gi;r=l.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))s.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=l.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))s.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),A=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=A&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${A[1]}["']`,"i").test(e),U=r.index,M=e.substring(0,U),Ae=e.substring(U),H=(M.match(/<label\b/gi)||[]).length,z=(M.match(/<\/label>/gi)||[]).length,K=H>z;if(!B&&!K)s.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let o=/<h([1-6])[^>]*>/gi,g=[];r=o.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=o.exec(e);let f=0;for(let d of g){if(f>0&&d>f+1)s.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${f} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});f=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))s.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let p=e.match(/<html\b([^>]*)>/i);if(p&&q(I(p[1],"lang"),I(p[1],"dir")))s.push({type:"missing-dir",element:p[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(I(r[1],"role"))&&!/<th\b/i.test(d))s.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))s.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)s.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))s.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))s.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return s}async function we(e,a){let{protectedSource:s}=ye(e);if(!he())return xe(s,a);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=s,r.querySelectorAll("img").forEach((o)=>{if(!o.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${o.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((o)=>{if(!(o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby")||o.textContent&&o.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${o.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((o)=>{let g=o.getAttribute("id"),f=g&&r.querySelector(`label[for="${g}"]`),p=o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby"),m=o.closest("label")!==null;if(!f&&!p&&!m)n.push({type:"input-missing-label",element:`<${o.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let l=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let o of l){let g=Number.parseInt(o.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${o.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(s.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&q(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((o)=>{let g=o.textContent&&o.textContent.trim().length>0,f=o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby"),p=o.hasAttribute("title"),m=o.querySelector("img[alt]");if(!g&&!f&&!p&&!m)n.push({type:"link-missing-text",element:`<${o.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),s.includes("<nav")||s.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((o)=>{if(V(o.getAttribute("role")))return;let g=o.querySelector("caption");if(!o.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!o.hasAttribute("aria-label")&&!o.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((o)=>{let g=o.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${o.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((o)=>{if(!o.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${o.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((o)=>{if(Number.parseInt(o.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${o.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((o)=>{if(!o.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${o.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),s.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((o)=>{if(!o.hasAttribute("title")&&!o.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${a}:`,r)}return n}async function xi(e,a={}){let s={},{recursive:n=!0,ignorePaths:r=[]}=a,l=Array.isArray(e)?e:[e],c=await Cs(l,{recursive:n,ignorePaths:r}),u=[];for(let o of c)try{let g=await Bun.file(o).text();if(o.endsWith("good-a11y.stx"))continue;let f=await we(g,o);if(u.push(o),f.length>0)s[o]=f}catch(g){console.error(`Error scanning ${o}:`,g)}return{results:s,scannedFiles:u}}var Si={name:"a11y",handler:(e,a,s,n)=>{if(!a.length)return e;let r=a[0].replace(/['"]/g,""),l=a.length>1?a[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${l||u} -->${e}`},hasEndTag:!1},ki={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
4
4
  export{wi,vi,xi,Si,ki};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{o}from"./chunk-g5t10z04.js";import{$r}from"./chunk-7tabykst.js";import p from"path";async function kl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if($r(u),!e.ssr&&Object.keys(u).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 n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=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-fhx35529.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
2
+ import{o}from"./chunk-gnx0fzne.js";import{$r}from"./chunk-7tabykst.js";import p from"path";async function kl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if($r(u),!e.ssr&&Object.keys(u).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 n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=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-qk3ptn6h.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
3
3
  export{kl};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ie,ht}from"./chunk-6abvk7vj.js";import{me}from"./chunk-7ybgfk0m.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
2
+ import{ie,ht}from"./chunk-6abvk7vj.js";import{me}from"./chunk-3nk8cnrm.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
3
3
  maxEntries: ${o},
4
4
  ${u?`maxAgeSeconds: ${u},`:""}
5
5
  purgeOnQuotaError: true,
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{De,Xt,cd}from"./chunk-sqb6gkzf.js";import{U,Mn,Jt,Fr,zr,Nn,ld,dd,ud,Yt,Zt,Hr,Ln,pd}from"./chunk-vb4xxpa6.js";import"./chunk-d7zterbp.js";export{Fr as batch,cd as default,Mn as derived,Jt as effect,De as generateSignalsRuntime,Xt as generateSignalsRuntimeDev,Zt as isDerived,Yt as isSignal,Nn as onDestroy,zr as onMount,Ln as peek,ud as pendingLifecycleCounts,dd as runDestroyCallbacks,ld as runMountCallbacks,U as state,Hr as untrack,pd as useOptimistic};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import u from"fs";import l 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=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function Sn(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=u.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Sn(i,n,r+1,o))return!0}return!1}var y=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","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"],Mi=["onMount","onDestroy"];function Dt(e="const",t=[],r){let o=t.length?y.filter((s)=>!t.includes(s)):y;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 E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=y.filter((e)=>!E.includes(e));function Bs(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/],T=/\s@[a-z][\w.:-]*\s*=/i;function Ni(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(Bs(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Sn(r[1],t))return!0;return!1}function Li(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function ji(e){return _.includes(e.toLowerCase())}var dr=["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"],w=["x-init","x-transition","x-effect","x-on"],Bi=[...dr,...w];function Fi(){return`{${dr.map((e)=>`'${e}':1`).join(",")}}`}var Fs=["class","style","text","html","show","model","if","ref"];function zi(){return`{${Fs.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 Hi(){return`/^(${p.join("|")})(?:\\.|$)/`}function Vi(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=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>=A;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>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
- export{Sn,y,Mi,Dt,Bs,Ni,Li,ji,dr,Bi,Fi,Fs,zi,Hi,Vi};
2
+ import u from"fs";import l 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=l.resolve(l.dirname(t),e);for(let o of b){let s=r+o;try{if(u.statSync(s).isFile())return s}catch{}}return null}function Sn(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=u.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Sn(i,n,r+1,o))return!0}return!1}var y=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","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"],Mi=["onMount","onDestroy"];function Ot(e="const",t=[],r){let o=t.length?y.filter((s)=>!t.includes(s)):y;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 E=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=y.filter((e)=>!E.includes(e));function Bs(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/],T=/\s@[a-z][\w.:-]*\s*=/i;function Ni(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(Bs(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Sn(r[1],t))return!0;return!1}function Li(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function ji(e){return _.includes(e.toLowerCase())}var dr=["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"],w=["x-init","x-transition","x-effect","x-on"],Bi=[...dr,...w];function Fi(){return`{${dr.map((e)=>`'${e}':1`).join(",")}}`}var Fs=["class","style","text","html","show","model","if","ref"];function zi(){return`{${Fs.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 Hi(){return`/^(${p.join("|")})(?:\\.|$)/`}function Ui(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=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>=A;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>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
+ export{Sn,y,Mi,Ot,Bs,Ni,Li,ji,dr,Bi,Fi,Fs,zi,Hi,Ui};