@stacksjs/stx 0.2.762 → 0.2.765

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 (246) hide show
  1. package/dist/chunk-01484snf.js +2 -0
  2. package/dist/{chunk-b51p56k5.js → chunk-07c8rk93.js} +2 -2
  3. package/dist/chunk-09cera09.js +2 -0
  4. package/dist/{chunk-zhrz4zvw.js → chunk-0d29b573.js} +4 -4
  5. package/dist/chunk-0f5276fm.js +2 -0
  6. package/dist/{chunk-8yyq3nfg.js → chunk-0nzeqc13.js} +2 -2
  7. package/dist/chunk-16n128gh.js +2 -0
  8. package/dist/chunk-171bbyqv.js +2 -0
  9. package/dist/{chunk-dnsf934e.js → chunk-1day2nbr.js} +5 -5
  10. package/dist/chunk-1g0g498y.js +2 -0
  11. package/dist/{chunk-x5seqmrv.js → chunk-1g5fg1ys.js} +2 -2
  12. package/dist/chunk-1qppvj48.js +2 -0
  13. package/dist/{chunk-tpfxvw4q.js → chunk-1w4a0xya.js} +14 -14
  14. package/dist/chunk-1z77g0j6.js +2 -0
  15. package/dist/chunk-2hbwpm36.js +177 -0
  16. package/dist/{chunk-rh2qth8r.js → chunk-2mckhfet.js} +5 -5
  17. package/dist/chunk-31e7xkrt.js +2 -0
  18. package/dist/chunk-3ffz7pd4.js +2 -0
  19. package/dist/{chunk-37y8sg48.js → chunk-3mf27gj6.js} +2 -2
  20. package/dist/{chunk-gwjh981q.js → chunk-49w4cbqb.js} +7 -7
  21. package/dist/chunk-4bhbtvtm.js +2 -0
  22. package/dist/{chunk-18chz0q4.js → chunk-4m3666pm.js} +1 -1
  23. package/dist/{chunk-xtwc2dbk.js → chunk-4tppbw4r.js} +2 -2
  24. package/dist/{chunk-rmk8efc3.js → chunk-4yk7zngj.js} +109 -109
  25. package/dist/{chunk-rj3p5fdy.js → chunk-51dxp9w9.js} +3 -3
  26. package/dist/chunk-59r38w60.js +2 -0
  27. package/dist/chunk-5ttj2c0h.js +2 -0
  28. package/dist/chunk-5x312c05.js +2 -0
  29. package/dist/chunk-65h2h51z.js +2 -0
  30. package/dist/chunk-6ch8t3d9.js +3 -0
  31. package/dist/{chunk-tshpcvcy.js → chunk-6h6teyxp.js} +2 -2
  32. package/dist/{chunk-319aez2f.js → chunk-6jnrpnxb.js} +3 -3
  33. package/dist/chunk-6rd0zz6k.js +2 -0
  34. package/dist/{chunk-8y54tpbr.js → chunk-74y29xxs.js} +5 -5
  35. package/dist/{chunk-t1shvfhm.js → chunk-7aw9qm74.js} +47 -47
  36. package/dist/chunk-7bvhpdqv.js +2 -0
  37. package/dist/{chunk-0fs9kx0h.js → chunk-7yx2ztt5.js} +2 -2
  38. package/dist/{chunk-f8p8ggvw.js → chunk-8hanmv49.js} +4 -4
  39. package/dist/{chunk-j1tsda22.js → chunk-8prk7e1z.js} +10 -10
  40. package/dist/{chunk-nm9tnxnw.js → chunk-8zgvr0fw.js} +5 -5
  41. package/dist/{chunk-pqbxa0r7.js → chunk-a2yptg7r.js} +2 -2
  42. package/dist/{chunk-qystt1qc.js → chunk-a627f39k.js} +1 -1
  43. package/dist/{chunk-ds6mbfdq.js → chunk-as4s0nf5.js} +3 -3
  44. package/dist/chunk-axxd53tn.js +2 -0
  45. package/dist/{chunk-evxp3wmv.js → chunk-ay02q27h.js} +7 -7
  46. package/dist/{chunk-2eamszdq.js → chunk-ay5g5cbk.js} +2 -2
  47. package/dist/chunk-b8ar6431.js +2 -0
  48. package/dist/{chunk-yb71b2d6.js → chunk-b8hsvzqb.js} +2 -2
  49. package/dist/chunk-bnm7ym0g.js +2 -0
  50. package/dist/{chunk-0sd4td6z.js → chunk-bnwkytme.js} +3 -3
  51. package/dist/chunk-brg2ydrk.js +2 -0
  52. package/dist/chunk-bwkw2dw3.js +2 -0
  53. package/dist/chunk-c0fwppzc.js +2 -0
  54. package/dist/{chunk-8rk79ha1.js → chunk-c1b481my.js} +2 -2
  55. package/dist/chunk-c5kpc7rn.js +2 -0
  56. package/dist/{chunk-59k4xb92.js → chunk-c5mbhfff.js} +5 -5
  57. package/dist/chunk-c8256r1a.js +2 -0
  58. package/dist/chunk-cap6exxx.js +2 -0
  59. package/dist/{chunk-mbe4gqd3.js → chunk-ccedry39.js} +2 -2
  60. package/dist/chunk-cft1sprt.js +2 -0
  61. package/dist/{chunk-qjbcp3tc.js → chunk-cswar3zs.js} +3 -3
  62. package/dist/{chunk-t2cq4bpe.js → chunk-dphhs29v.js} +6 -6
  63. package/dist/chunk-dt0deg4z.js +2 -0
  64. package/dist/{chunk-jgk5j35w.js → chunk-dvh63p75.js} +4 -4
  65. package/dist/{chunk-932zx5q4.js → chunk-dxk5r71v.js} +6 -6
  66. package/dist/{chunk-d96xddt9.js → chunk-e1e5xf8z.js} +13 -13
  67. package/dist/{chunk-w2pch5xn.js → chunk-e645nk33.js} +2 -2
  68. package/dist/{chunk-qpb80r4b.js → chunk-efr9dgt6.js} +2 -2
  69. package/dist/chunk-ejqr5cva.js +2 -0
  70. package/dist/{chunk-fxmc5006.js → chunk-et831a4y.js} +2 -2
  71. package/dist/{chunk-5yhv5eqq.js → chunk-ev4zxhpd.js} +2 -2
  72. package/dist/chunk-evbxyw80.js +2 -0
  73. package/dist/chunk-f66n66c8.js +2 -0
  74. package/dist/chunk-f6h8yagj.js +2 -0
  75. package/dist/{chunk-y8pftjg8.js → chunk-fjbhtakz.js} +1 -1
  76. package/dist/chunk-fpsm2qed.js +2 -0
  77. package/dist/{chunk-v1ff2dfp.js → chunk-fta169tc.js} +3 -3
  78. package/dist/{chunk-a222bwpc.js → chunk-ftt3r7wh.js} +5 -5
  79. package/dist/{chunk-48g9wez2.js → chunk-fz717vpc.js} +29 -29
  80. package/dist/chunk-fzf7yfpn.js +2 -0
  81. package/dist/chunk-gaatje2g.js +2 -0
  82. package/dist/{chunk-b0z2n941.js → chunk-h8yk9qm7.js} +2 -2
  83. package/dist/chunk-hfcmbbkq.js +2 -0
  84. package/dist/{chunk-3mz088mb.js → chunk-jb1c4e49.js} +2 -2
  85. package/dist/chunk-jhz0dvqz.js +2 -0
  86. package/dist/chunk-k54pgbzm.js +2 -0
  87. package/dist/{chunk-r8zhed35.js → chunk-kc3kt59e.js} +2 -2
  88. package/dist/chunk-kkx2gqk8.js +2 -0
  89. package/dist/{chunk-rqd6b2nc.js → chunk-knzp4c6m.js} +3 -3
  90. package/dist/{chunk-m3z13f59.js → chunk-kwy0spcd.js} +3 -3
  91. package/dist/{chunk-b7x8b83z.js → chunk-m15nbvck.js} +1 -1
  92. package/dist/{chunk-wby7qzha.js → chunk-m3dr63n0.js} +3 -3
  93. package/dist/{chunk-eb6p3p62.js → chunk-mdtjjzqc.js} +2 -2
  94. package/dist/{chunk-epa73jvs.js → chunk-mmcqgwk7.js} +2 -2
  95. package/dist/{chunk-02c46de1.js → chunk-mpaepc7n.js} +165 -42
  96. package/dist/{chunk-0kq0k4pg.js → chunk-n5dd6rpt.js} +2 -2
  97. package/dist/{chunk-jyp2mmts.js → chunk-n8gfetjx.js} +2 -2
  98. package/dist/chunk-n9zka6dg.js +2 -0
  99. package/dist/{chunk-bvctccab.js → chunk-nj5azxxj.js} +3 -3
  100. package/dist/{chunk-42zqmcnc.js → chunk-nr3pepv1.js} +3 -3
  101. package/dist/{chunk-r1tp2gnr.js → chunk-p42kp93g.js} +1 -1
  102. package/dist/{chunk-2zd51tj4.js → chunk-pqgk9mxp.js} +2 -2
  103. package/dist/chunk-pvx57vpw.js +2 -0
  104. package/dist/{chunk-fhpsf4z7.js → chunk-q22hwm64.js} +5 -5
  105. package/dist/chunk-qcz104h3.js +2 -0
  106. package/dist/chunk-qgvez75f.js +2 -0
  107. package/dist/{chunk-y4mp1rra.js → chunk-qv2k0qb1.js} +94 -94
  108. package/dist/{chunk-k2ex94n8.js → chunk-qv99gqee.js} +1 -1
  109. package/dist/chunk-r0j6jkxc.js +2 -0
  110. package/dist/{chunk-ben8bjnk.js → chunk-rv0yth27.js} +4 -4
  111. package/dist/chunk-rzh4xgb4.js +2 -0
  112. package/dist/chunk-rzv9xcyp.js +2 -0
  113. package/dist/{chunk-4tgn1frg.js → chunk-s2py8kg7.js} +2 -2
  114. package/dist/chunk-s922mx0k.js +2 -0
  115. package/dist/{chunk-rd33qkfs.js → chunk-s9m2gfns.js} +7 -7
  116. package/dist/{chunk-xt034729.js → chunk-scq0h2cs.js} +6 -6
  117. package/dist/{chunk-ak93e1zz.js → chunk-stww901w.js} +5 -5
  118. package/dist/chunk-sy4wqxta.js +2 -0
  119. package/dist/chunk-szdm8wfn.js +2 -0
  120. package/dist/chunk-t424gvwc.js +2 -0
  121. package/dist/{chunk-yk456jp4.js → chunk-t6d7m4tf.js} +7 -7
  122. package/dist/{chunk-mdvtermb.js → chunk-t70s45hc.js} +2 -2
  123. package/dist/{chunk-dvpk4c1y.js → chunk-t8cgxk8w.js} +2 -2
  124. package/dist/{chunk-edhxg3rz.js → chunk-tqf8a258.js} +56 -56
  125. package/dist/{chunk-9k8ztdcc.js → chunk-vkpmemb1.js} +2 -2
  126. package/dist/chunk-vtvaa8y9.js +2 -0
  127. package/dist/chunk-vvj09a7b.js +2 -0
  128. package/dist/{chunk-rxm1mjkb.js → chunk-vvm38ysm.js} +1 -1
  129. package/dist/chunk-vwjy6491.js +2 -0
  130. package/dist/{chunk-736ex6r5.js → chunk-vy1weqvj.js} +4 -4
  131. package/dist/chunk-w2nzevn0.js +2 -0
  132. package/dist/chunk-wadp2rmj.js +2 -0
  133. package/dist/{chunk-k9247v28.js → chunk-wb2ej5by.js} +1 -1
  134. package/dist/chunk-wbkcwj27.js +2 -0
  135. package/dist/{chunk-2typf9dh.js → chunk-wp4nqnn7.js} +1 -1
  136. package/dist/chunk-wzp8y0a4.js +2 -0
  137. package/dist/chunk-xc1he6hs.js +2 -0
  138. package/dist/{chunk-m6rzsbas.js → chunk-xcstrdhp.js} +4 -4
  139. package/dist/{chunk-cdcrd33m.js → chunk-ysfeg3cn.js} +2 -2
  140. package/dist/chunk-ytzzth34.js +2 -0
  141. package/dist/{chunk-xgnmgjpv.js → chunk-z6sg0dq3.js} +4 -4
  142. package/dist/{chunk-k9wr8xf5.js → chunk-zfaa5xn5.js} +6 -6
  143. package/dist/chunk-zhxg6b64.js +2 -0
  144. package/dist/{chunk-rha8sv1h.js → chunk-zjar9jdd.js} +2 -2
  145. package/dist/{chunk-89801pjp.js → chunk-zs8yjtaz.js} +5 -5
  146. package/dist/{chunk-q3azy64b.js → chunk-ztbk9yqv.js} +4 -4
  147. package/dist/cli.js +19 -19
  148. package/dist/client/signals-bootstrap-runtime.js +1 -1
  149. package/dist/client/signals-class-runtime.js +5 -5
  150. package/dist/client/signals-dom-ready-runtime.js +1 -0
  151. package/dist/client/signals-expression-runtime.js +118 -0
  152. package/dist/client/signals-for-runtime.js +7 -7
  153. package/dist/client/signals-if-chain-runtime.js +3 -3
  154. package/dist/client/signals-if-runtime.js +7 -7
  155. package/dist/client/signals-model-runtime.js +1 -1
  156. package/dist/client/signals-process-element-runtime.js +12 -8
  157. package/dist/client/signals-show-runtime.js +1 -1
  158. package/dist/client/signals-style-runtime.js +1 -1
  159. package/dist/composables/index.d.ts +2 -0
  160. package/dist/composables/index.js +1 -0
  161. package/dist/composables/use-virtual-list.d.ts +24 -0
  162. package/dist/composables/use-virtual-list.js +76 -0
  163. package/dist/config.js +3 -0
  164. package/dist/craft-entry.js +2 -2
  165. package/dist/craft.js +2 -2
  166. package/dist/document-shell.d.ts +10 -1
  167. package/dist/document-shell.js +1 -1
  168. package/dist/expressions.js +19 -0
  169. package/dist/index.d.ts +1 -1
  170. package/dist/native/compiler/render-screen.d.ts +2 -8
  171. package/dist/native/compiler/render-screen.js +3 -10
  172. package/dist/native/event-names.js +2 -0
  173. package/dist/native/primitives-dir.d.ts +13 -0
  174. package/dist/native/primitives-dir.js +14 -0
  175. package/dist/native/prop-names.js +1 -0
  176. package/dist/process.js +1 -1
  177. package/dist/pwa.js +3 -3
  178. package/dist/ssg.js +8 -8
  179. package/dist/state-management.d.ts +22 -0
  180. package/dist/types/config-types.d.ts +2 -0
  181. package/dist/unresolved-identifiers.js +1 -0
  182. package/dist/utils.js +20 -2
  183. package/package.json +5 -5
  184. package/stx.d.ts +4 -0
  185. package/dist/chunk-00nz3pas.js +0 -2
  186. package/dist/chunk-05jdq9tw.js +0 -177
  187. package/dist/chunk-0cajfv7y.js +0 -2
  188. package/dist/chunk-13v3vgb6.js +0 -2
  189. package/dist/chunk-1p8t2ekg.js +0 -2
  190. package/dist/chunk-1rcntvgx.js +0 -2
  191. package/dist/chunk-1w5gtkd6.js +0 -2
  192. package/dist/chunk-28vtqwxh.js +0 -2
  193. package/dist/chunk-298gj90a.js +0 -2
  194. package/dist/chunk-2gn6smrq.js +0 -2
  195. package/dist/chunk-2wq0h5ye.js +0 -2
  196. package/dist/chunk-3wxb7mfb.js +0 -2
  197. package/dist/chunk-528cn6qm.js +0 -2
  198. package/dist/chunk-5x0g7e9y.js +0 -2
  199. package/dist/chunk-633a53wg.js +0 -2
  200. package/dist/chunk-6b737vch.js +0 -2
  201. package/dist/chunk-72ns4q88.js +0 -2
  202. package/dist/chunk-86cg9qqm.js +0 -2
  203. package/dist/chunk-8czxtjwm.js +0 -2
  204. package/dist/chunk-8h5mqs28.js +0 -2
  205. package/dist/chunk-940wny2b.js +0 -2
  206. package/dist/chunk-9fh4ah7t.js +0 -2
  207. package/dist/chunk-a81rt2t4.js +0 -3
  208. package/dist/chunk-ad9dt9rk.js +0 -2
  209. package/dist/chunk-ak4w2emd.js +0 -2
  210. package/dist/chunk-b8dtz3v8.js +0 -2
  211. package/dist/chunk-cenvzm5q.js +0 -2
  212. package/dist/chunk-d49pst1m.js +0 -2
  213. package/dist/chunk-dj0qy19b.js +0 -2
  214. package/dist/chunk-e2q79dfs.js +0 -2
  215. package/dist/chunk-ebxncrd8.js +0 -2
  216. package/dist/chunk-fht1zs1r.js +0 -2
  217. package/dist/chunk-fjfrgef4.js +0 -2
  218. package/dist/chunk-fmk9hjht.js +0 -2
  219. package/dist/chunk-fxnk5ee8.js +0 -2
  220. package/dist/chunk-j1z7tgdp.js +0 -2
  221. package/dist/chunk-jq1698j4.js +0 -2
  222. package/dist/chunk-k0jkpw0q.js +0 -2
  223. package/dist/chunk-k469ym7a.js +0 -2
  224. package/dist/chunk-m5740sd3.js +0 -2
  225. package/dist/chunk-mdw96yhg.js +0 -2
  226. package/dist/chunk-mebf9vwb.js +0 -2
  227. package/dist/chunk-p2se8s6r.js +0 -2
  228. package/dist/chunk-p7zrz0wb.js +0 -2
  229. package/dist/chunk-pdnyfk2v.js +0 -2
  230. package/dist/chunk-qfhjtz2q.js +0 -2
  231. package/dist/chunk-r5tsewzd.js +0 -2
  232. package/dist/chunk-rnvrtcz6.js +0 -2
  233. package/dist/chunk-s36cpnxa.js +0 -2
  234. package/dist/chunk-tfy1m821.js +0 -2
  235. package/dist/chunk-vc3ppphz.js +0 -2
  236. package/dist/chunk-vttx66q0.js +0 -2
  237. package/dist/chunk-vxs07119.js +0 -2
  238. package/dist/chunk-x1x69g3s.js +0 -2
  239. package/dist/chunk-x8hz5gzb.js +0 -2
  240. package/dist/chunk-xfdtym3s.js +0 -2
  241. package/dist/chunk-y6mqq78g.js +0 -2
  242. package/dist/chunk-ycttwgpg.js +0 -2
  243. package/dist/chunk-yd6x9226.js +0 -2
  244. package/dist/chunk-yn3kff5k.js +0 -2
  245. package/dist/chunk-ynjm2tm0.js +0 -2
  246. package/dist/chunk-zpjdp0he.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ll,ul,dl}from"./chunk-b51p56k5.js";import{le,Hn,Vn,mo,qr,Kr,Un,Wn,ho,Gr}from"./chunk-jyp2mmts.js";function z(e,s,i,a,d,y){let r=!0,u=new Set,f=(p)=>a.get?a.get(p):p,o=()=>f(e());return Object.defineProperty(o,"_isSignal",{value:!0}),Object.defineProperty(o,"modifiers",{get:s}),o.set=(p)=>{if(!r)return;let h=s(),t=a.set?a.set(p,h):p;if(h.trim&&typeof t==="string")t=t.trim();if(h.number&&typeof t==="string"&&t!==""){let l=Number(t);if(!Number.isNaN(l))t=l}if(Object.is(e(),t))return;e.set(t),i(t)},o.update=(p)=>o.set(p(o())),o.input=(p)=>{if(!s().lazy)o.set(p)},o.change=(p)=>{if(s().lazy)o.set(p)},o.subscribe=(p)=>{if(!r)return()=>{};let h=e.subscribe((t,l)=>p(f(t),f(l)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(o,"value",{get:o,set:o.set}),d(()=>{r=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{r=!0}),o}function X(e,s=!0,i){if(!s||!e||typeof window>"u")return;let a=window;if(!a.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let r=JSON.parse(y?.textContent||"{}");a.__STX_DATA__=r&&typeof r==="object"&&!Array.isArray(r)?r:{}}catch{a.__STX_DATA__={}}}let d=a.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:i?i(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let s=window;if(e===void 0)s.__STX_DATA__={};else{if(!s.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");s.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{s.__STX_DATA__={}}if(s.__STX_DATA__)delete s.__STX_DATA__[e]}}function Y(e){let s=null;try{s=typeof indexedDB<"u"?indexedDB:null}catch{s=null}if(!s)return null;let i=s,a=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let o=i.open(a,1);o.onupgradeneeded=()=>{o.result.createObjectStore("kv")},o.onsuccess=()=>u(o.result),o.onerror=()=>f(o.error),o.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},r=(u,f)=>y().then((o)=>new Promise((p,h)=>{let t=o.transaction("kv",u),l=f(t.objectStore("kv"));t.oncomplete=()=>p(l?l.result:void 0),t.onerror=()=>h(t.error),t.onabort=()=>h(t.error)}));return{get:(u)=>r("readonly",(f)=>f.get(u)),set:(u,f)=>r("readwrite",(o)=>{o.put(f,u)}),remove:(u)=>r("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>r("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,s){let i=e||{},a=null;if(i.storage!==void 0)a=i.storage;else try{a=typeof localStorage<"u"?localStorage:null}catch{a=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let r=()=>{if(y)return d;y=!0;try{d=s?s():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),o=new Map,p=new Set,h=new Map,t=!1,l=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!a)return!1;try{return a.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(a)a.removeItem(n)}catch{}},k=()=>{if(t=!1,!h.size)return l;let n=Array.from(h.entries());return h.clear(),l=l.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),l},N=(n,c)=>{if(h.set(n,c),p.add(n),t)return;t=!0,f(()=>{k()})},D=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(o.has(n))return{value:o.get(n)};let c=null;try{c=a?a.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return o.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:r();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(o.has(n))return{value:o.get(n)};let S=D(x);if(S)o.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(o.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!r()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(o.keys()))if(v.indexOf(n)===0)o.delete(v);for(let v of Array.from(h.keys()))if(v.indexOf(n)===0)h.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(a)for(let v=a.length-1;v>=0;v--){let x=a.key(v);if(x&&x.indexOf(n)===0)a.removeItem(x)}}catch{}let c=r();if(!c)return l;return l=l.then(()=>c.removePrefix(n)).catch(()=>{}),l},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,s){if(!e)return!1;if(e===s.key)return!0;if(!s.url)return!1;if(e===s.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",a=new URL(e,i),d=new URL(s.url,i);if(a.origin!==d.origin||a.pathname!==d.pathname)return!1;return!a.search||a.search===d.search}catch{return!1}}function ee(e){let s=e.prefix||"stx:kept:",i=e.matches||((t,l)=>t===l.key||t===l.url),a=new Set,d=new Map,y,r=(t)=>t===void 0?y:t,u=(t,l)=>{let g=r(l);if(g===!1||g===null||g==="")return null;return`${s}${g===void 0?"":`${g}:`}query:${t}`},f=(t)=>{let l=t&&t.value;if(!l||typeof l!=="object"||!("d"in l))return;return{data:l.d,at:Number(l.at)||0}},o=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,l){let g=u(t,l);return g?f(e.kept.peek(g)):void 0},restore(t,l){let g=u(t,l);return g?e.kept.load(g).then(f):Promise.resolve(void 0)},persist(t,l,g){let m=u(t,g);if(m)e.kept.set(m,{d:l,at:Date.now()})},overlay(t,l,g){let m=o();if(!m||!m.size)return l;let _=l;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return a.add(t),()=>{a.delete(t)}},cachedQuery(t,l){let g=d.get(t);if(g){if(l&&g.__options)g.__options(l);return g}let m=l||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let I=e.state(p.overlay(D(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),P=e.state(S?S.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},W=(b)=>{let w=R;p.restore(t,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!S)W(E);let _t=()=>{let b=k();if(b===E)return;E=b,R++,x=0,q.set(!1),U.set(!1),c=0;let w=p.seed(t,E);if(n=w?w.data:_,P.set(w?w.at:0),F(),!w)W(E)},xt=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,V=new Promise((M,j)=>{O=setTimeout(()=>{if(C)C.abort();j(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),j={method:"GET",headers:{Accept:"application/json"}};if(b)j.cache="no-cache";if(C)j.signal=C.signal;A=M(w,j).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,V]).then((M)=>{if(O)clearTimeout(O);return m.transform?m.transform(M):M},(M)=>{if(O)clearTimeout(O);throw M})},G=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(x++,q.set(!0),c===0&&!P())U.set(!0);let V=()=>{if(w!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return xt(b,T).then((A)=>{if(w!==R||T!==N())return V(),I();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(t,A,E),F(),V(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return V(),I()})},O=`${w} ${T||""}`;return b?v.fresh(O,C):v.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return t},load(b){if(_t(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(t,n,E),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(a.add({target:D,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(D(),n,b.id),c=0,G(!0);F()}}),d.set(t,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(t)=>{let l=t.detail||{};if(l.kind!=="api"||typeof l.url!=="string")return;a.forEach((g)=>{if(i(l.url,g.target()))g.updated()})}),h.addEventListener("stx:outbox",(t)=>{let l=t.detail||{},g=l.sent&&typeof l.sent.id==="string"?l.sent:null;a.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>i(N,k)))return}m.outbox(g)})});return p}function te(e){let s=e&&e.covers||((r,u)=>Object.is(r,u)),i=[],a=[],d=0,y=(r,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let o={key:r,promise:f};i.push(o);let p=()=>{let h=i.indexOf(o);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(r,u){for(let f of i)if(s(f.key,r))return f.promise;for(let f of a)if(s(f.key,r))return f.promise;return y(r,u)},fresh(r,u){for(let h of a)if(s(h.key,r))return h.promise;let f=i.filter((h)=>s(h.key,r)).map((h)=>h.promise);if(!f.length)return y(r,u);let o={key:r,promise:null},p=()=>{};return o.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=a.indexOf(o);if(h!==-1)a.splice(h,1);return y(r,u)}),a.push(o),o.promise},latest(){let r=++d;return()=>r===d},get busy(){return i.length>0||a.length>0}}}function ne(e){let s=!1,i=null,a=null,d=0;async function y(){if(s)return;i=new AbortController;try{let r=await e.request(e.endpoint,{signal:i.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!r.ok||!r.body||!r.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(s){await r.body.cancel();return}let u=r.body.getReader(),f=new TextDecoder,o="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!s){let{done:p,value:h}=await u.read();if(p)break;if(o+=f.decode(h,{stream:!0}).replace(/\r\n/g,`
2
+ import{ul,dl,pl}from"./chunk-07c8rk93.js";import{le,Hn,Vn,ho,Kr,Xr,Un,Wn,yo,Gr}from"./chunk-n8gfetjx.js";function z(e,s,i,a,d,y){let r=!0,u=new Set,f=(p)=>a.get?a.get(p):p,o=()=>f(e());return Object.defineProperty(o,"_isSignal",{value:!0}),Object.defineProperty(o,"modifiers",{get:s}),o.set=(p)=>{if(!r)return;let h=s(),t=a.set?a.set(p,h):p;if(h.trim&&typeof t==="string")t=t.trim();if(h.number&&typeof t==="string"&&t!==""){let l=Number(t);if(!Number.isNaN(l))t=l}if(Object.is(e(),t))return;e.set(t),i(t)},o.update=(p)=>o.set(p(o())),o.input=(p)=>{if(!s().lazy)o.set(p)},o.change=(p)=>{if(s().lazy)o.set(p)},o.subscribe=(p)=>{if(!r)return()=>{};let h=e.subscribe((t,l)=>p(f(t),f(l)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(o,"value",{get:o,set:o.set}),d(()=>{r=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{r=!0}),o}function X(e,s=!0,i){if(!s||!e||typeof window>"u")return;let a=window;if(!a.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let r=JSON.parse(y?.textContent||"{}");a.__STX_DATA__=r&&typeof r==="object"&&!Array.isArray(r)?r:{}}catch{a.__STX_DATA__={}}}let d=a.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:i?i(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let s=window;if(e===void 0)s.__STX_DATA__={};else{if(!s.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");s.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{s.__STX_DATA__={}}if(s.__STX_DATA__)delete s.__STX_DATA__[e]}}function Y(e){let s=null;try{s=typeof indexedDB<"u"?indexedDB:null}catch{s=null}if(!s)return null;let i=s,a=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let o=i.open(a,1);o.onupgradeneeded=()=>{o.result.createObjectStore("kv")},o.onsuccess=()=>u(o.result),o.onerror=()=>f(o.error),o.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},r=(u,f)=>y().then((o)=>new Promise((p,h)=>{let t=o.transaction("kv",u),l=f(t.objectStore("kv"));t.oncomplete=()=>p(l?l.result:void 0),t.onerror=()=>h(t.error),t.onabort=()=>h(t.error)}));return{get:(u)=>r("readonly",(f)=>f.get(u)),set:(u,f)=>r("readwrite",(o)=>{o.put(f,u)}),remove:(u)=>r("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>r("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,s){let i=e||{},a=null;if(i.storage!==void 0)a=i.storage;else try{a=typeof localStorage<"u"?localStorage:null}catch{a=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let r=()=>{if(y)return d;y=!0;try{d=s?s():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=i.limit||32768,f=i.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),o=new Map,p=new Set,h=new Map,t=!1,l=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!a)return!1;try{return a.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(a)a.removeItem(n)}catch{}},k=()=>{if(t=!1,!h.size)return l;let n=Array.from(h.entries());return h.clear(),l=l.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),l},N=(n,c)=>{if(h.set(n,c),p.add(n),t)return;t=!0,f(()=>{k()})},M=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(o.has(n))return{value:o.get(n)};let c=null;try{c=a?a.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return o.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:r();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(o.has(n))return{value:o.get(n)};let S=M(x);if(S)o.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(o.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!r()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(o.keys()))if(v.indexOf(n)===0)o.delete(v);for(let v of Array.from(h.keys()))if(v.indexOf(n)===0)h.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(a)for(let v=a.length-1;v>=0;v--){let x=a.key(v);if(x&&x.indexOf(n)===0)a.removeItem(x)}}catch{}let c=r();if(!c)return l;return l=l.then(()=>c.removePrefix(n)).catch(()=>{}),l},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,s){if(!e)return!1;if(e===s.key)return!0;if(!s.url)return!1;if(e===s.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",a=new URL(e,i),d=new URL(s.url,i);if(a.origin!==d.origin||a.pathname!==d.pathname)return!1;return!a.search||a.search===d.search}catch{return!1}}function ee(e){let s=e.prefix||"stx:kept:",i=e.matches||((t,l)=>t===l.key||t===l.url),a=new Set,d=new Map,y,r=(t)=>t===void 0?y:t,u=(t,l)=>{let g=r(l);if(g===!1||g===null||g==="")return null;return`${s}${g===void 0?"":`${g}:`}query:${t}`},f=(t)=>{let l=t&&t.value;if(!l||typeof l!=="object"||!("d"in l))return;return{data:l.d,at:Number(l.at)||0}},o=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,l){let g=u(t,l);return g?f(e.kept.peek(g)):void 0},restore(t,l){let g=u(t,l);return g?e.kept.load(g).then(f):Promise.resolve(void 0)},persist(t,l,g){let m=u(t,g);if(m)e.kept.set(m,{d:l,at:Date.now()})},overlay(t,l,g){let m=o();if(!m||!m.size)return l;let _=l;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return a.add(t),()=>{a.delete(t)}},cachedQuery(t,l){let g=d.get(t);if(g){if(l&&g.__options)g.__options(l);return g}let m=l||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,M=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let I=e.state(p.overlay(M(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),P=e.state(S?S.at:0),R=0,F=()=>{I.set(p.overlay(M(),n))},W=(b)=>{let w=R;p.restore(t,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!S)W(E);let _t=()=>{let b=k();if(b===E)return;E=b,R++,x=0,q.set(!1),U.set(!1),c=0;let w=p.seed(t,E);if(n=w?w.data:_,P.set(w?w.at:0),F(),!w)W(E)},xt=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,V=new Promise((D,j)=>{O=setTimeout(()=>{if(C)C.abort();j(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let D=m.fetch||((L,H)=>fetch(L,H)),j={method:"GET",headers:{Accept:"application/json"}};if(b)j.cache="no-cache";if(C)j.signal=C.signal;A=D(w,j).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(I());return Promise.race([A,V]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(b)=>{let w=R,T=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(x++,q.set(!0),c===0&&!P())U.set(!0);let V=()=>{if(w!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return xt(b,T).then((A)=>{if(w!==R||T!==N())return V(),I();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(t,A,E),F(),V(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return V(),I()})},O=`${w} ${T||""}`;return b?v.fresh(O,C):v.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return t},load(b){if(_t(),!b&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(I());return G(!!b)},refresh(){return B.load(!0)},set(b){n=typeof b==="function"?b(n):b,p.persist(t,n,E),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(a.add({target:M,updated:()=>{if(c||P())G(!1)},outbox:(b)=>{if(b)n=p.overlay(M(),n,b.id),c=0,G(!0);F()}}),d.set(t,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(t)=>{let l=t.detail||{};if(l.kind!=="api"||typeof l.url!=="string")return;a.forEach((g)=>{if(i(l.url,g.target()))g.updated()})}),h.addEventListener("stx:outbox",(t)=>{let l=t.detail||{},g=l.sent&&typeof l.sent.id==="string"?l.sent:null;a.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>i(N,k)))return}m.outbox(g)})});return p}function te(e){let s=e&&e.covers||((r,u)=>Object.is(r,u)),i=[],a=[],d=0,y=(r,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let o={key:r,promise:f};i.push(o);let p=()=>{let h=i.indexOf(o);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(r,u){for(let f of i)if(s(f.key,r))return f.promise;for(let f of a)if(s(f.key,r))return f.promise;return y(r,u)},fresh(r,u){for(let h of a)if(s(h.key,r))return h.promise;let f=i.filter((h)=>s(h.key,r)).map((h)=>h.promise);if(!f.length)return y(r,u);let o={key:r,promise:null},p=()=>{};return o.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=a.indexOf(o);if(h!==-1)a.splice(h,1);return y(r,u)}),a.push(o),o.promise},latest(){let r=++d;return()=>r===d},get busy(){return i.length>0||a.length>0}}}function ne(e){let s=!1,i=null,a=null,d=0;async function y(){if(s)return;i=new AbortController;try{let r=await e.request(e.endpoint,{signal:i.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!r.ok||!r.body||!r.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(s){await r.body.cancel();return}let u=r.body.getReader(),f=new TextDecoder,o="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!s){let{done:p,value:h}=await u.read();if(p)break;if(o+=f.decode(h,{stream:!0}).replace(/\r\n/g,`
3
3
  `),o.length>1048576)throw Error("Broadcast frame too large");let t;while((t=o.indexOf(`
4
4
 
5
5
  `))!==-1){let l=o.slice(0,t);o=o.slice(t+2);let g=l.split(`
@@ -665,20 +665,20 @@ console.log('[stx] entering IIFE');
665
665
  if (!cloakStyle) {
666
666
  cloakStyle = document.createElement('style');
667
667
  cloakStyle.id = 'stx-cloak-style';
668
- cloakStyle.textContent = '[x-cloak] { display: none !important; }';
668
+ cloakStyle.textContent = '[x-cloak] { display: none !important; } [data-stx-component-wrapper]:not([stx-hydrate]) { display: contents; }';
669
669
  document.head.appendChild(cloakStyle);
670
670
  }
671
671
 
672
672
  `;var ce=` function bindClass(el, expr, passedScope = componentScope, isVisible) {
673
673
  const originalClasses = el.className;
674
- const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
675
- const keys = Object.keys(capturedScope);
674
+ const capturedScope = layerTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
676
675
 
677
676
  // Pre-compile \u2014 only the names the expression mentions (see
678
677
  // __stxCompileScoped: reading every signal subscribed the class binding to
679
- // every signal on the page), and only valid JS identifiers.
680
- const mentioned = new Set(__stxNamesIn(expr));
681
- const safeKeys = keys.filter(k => mentioned.has(k) && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k));
678
+ // every signal on the page), and only valid JS identifiers. The names come
679
+ // from the expression, never from enumerating the scope: a page scope holds
680
+ // hundreds, and listing them cost more than the rest of the row.
681
+ const safeKeys = __stxNamesIn(expr).filter(k => Object.prototype.propertyIsEnumerable.call(capturedScope, k) && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k));
682
682
  let fn;
683
683
  try {
684
684
  fn = __stxCompile(safeKeys, 'return ' + expr);
@@ -1970,6 +1970,7 @@ else {
1970
1970
  // map during setup; bind its DOM back into that same map before onMount.
1971
1971
  // Keep the layout's other exposed names available for legacy bindings.
1972
1972
  componentScope.$refs = pageScopeSnapshot.$refs;
1973
+ __stxScopeGen++;
1973
1974
 
1974
1975
  // Bind page roots after child components have registered their local scope.
1975
1976
  document.querySelectorAll('[data-stx]').forEach(el => {
@@ -2543,6 +2544,7 @@ finally {
2543
2544
  // copies preserve those accessors so rows and event closures do not freeze
2544
2545
  // their setup-time values. Data properties retain ordinary spread semantics.
2545
2546
  function assignTemplateScope(target, ...sources) {
2547
+ if (target === componentScope) __stxScopeGen++;
2546
2548
  for (var source of sources) {
2547
2549
  if (!source) continue;
2548
2550
  for (var key of Object.keys(source)) {
@@ -2554,9 +2556,126 @@ finally {
2554
2556
  }
2555
2557
  return target;
2556
2558
  }
2559
+ // The page-wide compatibility scope is rewritten as each component mounts:
2560
+ // every name a component declares is assigned into it, so by the end it holds
2561
+ // the LAST instance's. A scope merged earlier kept the names of its own
2562
+ // moment (a copy froze them), and a handler or binding that runs later relies
2563
+ // on that: three instances of one component each press their own button. A
2564
+ // view reads its sources live, so it is handed a snapshot of this one, taken
2565
+ // once per rewrite rather than once per merge.
2566
+ let __stxScopeGen = 0;
2567
+ let __stxSnapshot = { source: null, generation: -1, copy: null };
2568
+ function snapshotOfPageScope() {
2569
+ if (__stxSnapshot.source !== componentScope || __stxSnapshot.generation !== __stxScopeGen) {
2570
+ __stxSnapshot = { source: componentScope, generation: __stxScopeGen, copy: assignTemplateScope({}, componentScope) };
2571
+ }
2572
+ return __stxSnapshot.copy;
2573
+ }
2574
+ // A merged scope is a LAYERED VIEW over its sources, never a copy of them.
2575
+ //
2576
+ // Every binding, listener and conditional of every row took its own copy of
2577
+ // the whole page scope - globals, every component's names, the row's - and a
2578
+ // page with a few hundred names paid about 75 microseconds for each: 2,300
2579
+ // copies to draw 60 rows of a to-do list, 90% of the time it took. The view
2580
+ // costs one small object and a proxy, so the price of a merge no longer grows
2581
+ // with the size of the page. Later sources shadow earlier ones, as they did;
2582
+ // a write, a defineProperty or a delete lands on the view's own layer and
2583
+ // never reaches a source. Sources stay live, so a name registered after the
2584
+ // view was made is visible through it (a copy froze the names of its moment).
2585
+ const __STX_LAYERS = Symbol('stx.layers');
2586
+ const __STX_HIDDEN = Symbol('stx.hidden');
2587
+ const __stxIsEnumerable = Object.prototype.propertyIsEnumerable;
2588
+ // The layer that holds name, or null: the view's own properties first, then
2589
+ // the sources from last to first. A deleted name is found nowhere.
2590
+ function __stxLayerOf(own, name) {
2591
+ const hidden = own[__STX_HIDDEN];
2592
+ if (hidden !== undefined && hidden.has(name)) return null;
2593
+ if (__stxIsEnumerable.call(own, name)) return own;
2594
+ const layers = own[__STX_LAYERS];
2595
+ for (let i = layers.length - 1; i >= 0; i--) {
2596
+ if (__stxIsEnumerable.call(layers[i], name)) return layers[i];
2597
+ }
2598
+ return null;
2599
+ }
2600
+ const __stxScopeHandler = {
2601
+ get(own, name) {
2602
+ if (typeof name === 'symbol') return own[name];
2603
+ const layer = __stxLayerOf(own, name);
2604
+ return layer === null ? own[name] : layer[name];
2605
+ },
2606
+ has(own, name) {
2607
+ if (typeof name === 'symbol') return name in own;
2608
+ return __stxLayerOf(own, name) !== null || name in own;
2609
+ },
2610
+ set(own, name, value) {
2611
+ if (typeof name !== 'symbol' && own[__STX_HIDDEN] !== undefined) own[__STX_HIDDEN].delete(name);
2612
+ own[name] = value;
2613
+ return true;
2614
+ },
2615
+ defineProperty(own, name, descriptor) {
2616
+ if (typeof name !== 'symbol' && own[__STX_HIDDEN] !== undefined) own[__STX_HIDDEN].delete(name);
2617
+ return Reflect.defineProperty(own, name, descriptor);
2618
+ },
2619
+ deleteProperty(own, name) {
2620
+ delete own[name];
2621
+ if (typeof name !== 'symbol' && __stxLayerOf(own, name) !== null) {
2622
+ if (own[__STX_HIDDEN] === undefined) Object.defineProperty(own, __STX_HIDDEN, { value: new Set(), configurable: true });
2623
+ own[__STX_HIDDEN].add(name);
2624
+ }
2625
+ return true;
2626
+ },
2627
+ ownKeys(own) {
2628
+ const keys = new Set();
2629
+ const layers = own[__STX_LAYERS];
2630
+ for (let i = 0; i < layers.length; i++) {
2631
+ const names = Object.keys(layers[i]);
2632
+ for (let k = 0; k < names.length; k++) keys.add(names[k]);
2633
+ }
2634
+ const mine = Object.keys(own);
2635
+ for (let k = 0; k < mine.length; k++) keys.add(mine[k]);
2636
+ const hidden = own[__STX_HIDDEN];
2637
+ if (hidden !== undefined) hidden.forEach(function(name) { keys.delete(name); });
2638
+ return Array.from(keys);
2639
+ },
2640
+ getOwnPropertyDescriptor(own, name) {
2641
+ if (typeof name === 'symbol') return Reflect.getOwnPropertyDescriptor(own, name);
2642
+ const layer = __stxLayerOf(own, name);
2643
+ if (layer === null) return undefined;
2644
+ const descriptor = Object.getOwnPropertyDescriptor(layer, name);
2645
+ descriptor.configurable = true;
2646
+ if ('value' in descriptor) descriptor.writable = true;
2647
+ return descriptor;
2648
+ },
2649
+ };
2557
2650
  function mergeTemplateScopes(...sources) {
2558
2651
  return assignTemplateScope({}, ...sources);
2559
2652
  }
2653
+ // The view, for the hot paths that only READ the result (see above).
2654
+ function layerTemplateScopes(...sources) {
2655
+ const layers = [];
2656
+ for (let i = 0; i < sources.length; i++) {
2657
+ let source = sources[i];
2658
+ if (!source) continue;
2659
+ if (source === componentScope) source = snapshotOfPageScope();
2660
+ const inner = source[__STX_LAYERS];
2661
+ // A view made of views stays one level deep: take its layers and its own
2662
+ // properties as layers of the new one. A view with deleted names cannot
2663
+ // be taken apart (the layers beneath still hold them), so it is a layer.
2664
+ if (inner !== undefined && source[__STX_HIDDEN] === undefined) {
2665
+ const ownLayer = __stxOwnOf.get(source);
2666
+ for (let k = 0; k < inner.length; k++) layers.push(inner[k]);
2667
+ layers.push(ownLayer);
2668
+ }
2669
+ else layers.push(source);
2670
+ }
2671
+ const own = {};
2672
+ Object.defineProperty(own, __STX_LAYERS, { value: layers, configurable: true });
2673
+ const view = new Proxy(own, __stxScopeHandler);
2674
+ __stxOwnOf.set(view, own);
2675
+ return view;
2676
+ }
2677
+ // The own layer of a view, to read through it when a view is a source.
2678
+ const __stxOwnOf = new WeakMap();
2560
2679
 
2561
2680
  let componentScope = { $refs: {} };
2562
2681
 
@@ -3046,7 +3165,7 @@ else if (immediate) {
3046
3165
  }
3047
3166
  slotCallerScope = receiver && receiver.__stx_parent_scope
3048
3167
  || findElementScope(el) || passedScope;
3049
- const bindingScope = mergeTemplateScopes(slotCallerScope);
3168
+ const bindingScope = layerTemplateScopes(slotCallerScope);
3050
3169
  slotScopeInfo.names.concat(['__stx_slot_value']).forEach(function(name) { delete bindingScope[name]; });
3051
3170
  readSlotBindings = __stxCompileScoped(bindingScope, ['__stx_slot_value'],
3052
3171
  'const ' + slotScopeInfo.binding + ' = __stx_slot_value; return {' + slotScopeInfo.names.join(',') + '};');
@@ -3228,7 +3347,7 @@ else {
3228
3347
  return expression;
3229
3348
  }
3230
3349
  // Use passedScope instead of componentScope to preserve context through nested processing
3231
- var scope = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), extraScope);
3350
+ var scope = layerTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), extraScope);
3232
3351
  const unwrapScope = createAutoUnwrapProxy(scope, function(prop) {
3233
3352
  if (typeof prop !== 'string') return false;
3234
3353
  return expressionCallsSignal(expression, prop)
@@ -3250,7 +3369,7 @@ catch (e) {
3250
3369
  const evalLazy = (expression, extraScope = {}) => {
3251
3370
  try {
3252
3371
  if (/^__[A-Z_]+__$/.test(expression.trim())) return expression;
3253
- var scope = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), extraScope);
3372
+ var scope = layerTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), extraScope);
3254
3373
  const unwrapScope = createAutoUnwrapProxy(scope, function(prop) {
3255
3374
  if (typeof prop !== 'string') return false;
3256
3375
  return expressionCallsSignal(expression, prop)
@@ -3321,8 +3440,8 @@ catch (e) {
3321
3440
  const indexSignal = state(index);
3322
3441
 
3323
3442
  const itemScope = slotScopeInfo
3324
- ? mergeTemplateScopes(globalHelpers, slotCallerScope)
3325
- : mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}));
3443
+ ? layerTemplateScopes(globalHelpers, slotCallerScope)
3444
+ : layerTemplateScopes(globalHelpers, passedScope, (capturedScope || {}));
3326
3445
  Object.defineProperty(itemScope, itemName, { value: itemSignal, writable: true, enumerable: true, configurable: true });
3327
3446
  if (slotScopeInfo) {
3328
3447
  slotScopeInfo.names.forEach(function(name) {
@@ -3377,7 +3496,7 @@ catch (e) {
3377
3496
  try {
3378
3497
  const rowScope = { [itemName]: item };
3379
3498
  rowScope[indexName || '_idx'] = index;
3380
- const scope = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), rowScope);
3499
+ const scope = layerTemplateScopes(globalHelpers, passedScope, (capturedScope || {}), rowScope);
3381
3500
  const unwrapScope = createExpressionAutoUnwrapProxy(scope, keyExpr);
3382
3501
  const fn = __stxCompileScoped(unwrapScope, [], 'return ' + keyExpr);
3383
3502
  const key = fn(...__stxArgs(fn, unwrapScope));
@@ -3471,7 +3590,7 @@ catch (e) {
3471
3590
  var rootInScope = true;
3472
3591
  var rootVal;
3473
3592
  try {
3474
- var diagMerged = mergeTemplateScopes(globalHelpers, passedScope, (capturedScope || {}));
3593
+ var diagMerged = layerTemplateScopes(globalHelpers, passedScope, (capturedScope || {}));
3475
3594
  var firstIdent = listExpr.match(/^[A-Za-z_$][\\w$]*/);
3476
3595
  rootName = firstIdent ? firstIdent[0] : '?';
3477
3596
  rootInScope = Object.prototype.hasOwnProperty.call(diagMerged, rootName);
@@ -4093,7 +4212,7 @@ catch (e) {
4093
4212
  const deps = depsMap.get(key);
4094
4213
  if (deps) notifySubscribers(deps);
4095
4214
  }
4096
- `;var Me=` // \u2500\u2500 Host \u2500\u2500
4215
+ `;var De=` // \u2500\u2500 Host \u2500\u2500
4097
4216
  //
4098
4217
  // The tree this runtime mutates. Every write the binding layer makes to a
4099
4218
  // node goes through here, so the same runtime can drive something that is not
@@ -4344,7 +4463,7 @@ catch (e) {
4344
4463
  return ids;
4345
4464
  }
4346
4465
  };
4347
- `;var De=` // Hydrate a subtree inserted AFTER initial load \u2014 e.g. a streamed suspense
4466
+ `;var Me=` // Hydrate a subtree inserted AFTER initial load \u2014 e.g. a streamed suspense
4348
4467
  // boundary (#1746 Phase 3). Mirrors the SPA re-init pass, scoped to the
4349
4468
  // container: (1) executes the subtree's scoped setup scripts (inert when
4350
4469
  // inserted via innerHTML, so they're cloned into fresh script elements to
@@ -4619,7 +4738,7 @@ catch (e) {
4619
4738
  var parent = head.parentNode;
4620
4739
  if (!parent) { console.warn('[STX] bindIfChain: head element has no parent, skipping'); return; }
4621
4740
 
4622
- var capturedComponentScope = mergeTemplateScopes(passedScope);
4741
+ var capturedComponentScope = layerTemplateScopes(passedScope);
4623
4742
 
4624
4743
  // Detach every branch up-front, leaving a positional placeholder comment
4625
4744
  // so reinsertion preserves source order. Mark each as a chain member so
@@ -4686,7 +4805,7 @@ catch (e) {
4686
4805
  function evalBranch(b) {
4687
4806
  var expression = b.expr;
4688
4807
  if (/^__[A-Z_]+__$/.test(expression.trim())) return expression;
4689
- var scope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (b.capturedElementScope || {}));
4808
+ var scope = layerTemplateScopes(globalHelpers, capturedComponentScope, (b.capturedElementScope || {}));
4690
4809
  try {
4691
4810
  var unwrapScope = createExpressionAutoUnwrapProxy(scope, expression);
4692
4811
  // Compiled over the names the expression mentions (see __stxCompileScoped).
@@ -4854,7 +4973,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
4854
4973
  // branch picked after render survive their row's removal (#1954).
4855
4974
  pick.el.__stx_chain_disposers = trackEffects(function () {
4856
4975
  peek(function () {
4857
- var childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (pick.capturedElementScope || {}));
4976
+ var childScope = layerTemplateScopes(globalHelpers, capturedComponentScope, (pick.capturedElementScope || {}));
4858
4977
  // Components compiled inside any branch of an if/else-if/else
4859
4978
  // chain carry scoped setup scripts with them. Branch nodes are
4860
4979
  // detached before those scripts can execute, so simply
@@ -4935,7 +5054,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
4935
5054
  // Capture BOTH element scope AND passedScope NOW before anything changes
4936
5055
  // passedScope may contain @for iteration variables or parent component signals
4937
5056
  const capturedElementScope = findElementScope(el);
4938
- const capturedComponentScope = mergeTemplateScopes(passedScope);
5057
+ const capturedComponentScope = layerTemplateScopes(passedScope);
4939
5058
 
4940
5059
  preserveConditionalComponentScopes(el, capturedComponentScope);
4941
5060
  stxHost.insert(parent, placeholder, el);
@@ -4965,7 +5084,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
4965
5084
  return expression;
4966
5085
  }
4967
5086
  try {
4968
- var scope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5087
+ var scope = layerTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
4969
5088
  const unwrapScope = createExpressionAutoUnwrapProxy(scope, expression);
4970
5089
  const fn = __stxCompileScoped(unwrapScope, [], 'return ' + expression + '');
4971
5090
  return fn(...__stxArgs(fn, unwrapScope));
@@ -4973,7 +5092,7 @@ catch (e) { /* a disposer of its own is not this branch's problem */ }
4973
5092
  catch (e1) {
4974
5093
  try {
4975
5094
  // Retry without the unwrap proxy so call-syntax (signal()) works.
4976
- const scope2 = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5095
+ const scope2 = layerTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
4977
5096
  const fn2 = __stxCompileScoped(scope2, [], 'return ' + expression + '');
4978
5097
  return fn2(...__stxArgs(fn2, scope2));
4979
5098
  }
@@ -4992,7 +5111,7 @@ catch (e2) {
4992
5111
  const processChildrenWithScope = () => {
4993
5112
  // Build the combined scope for children - no need to modify global componentScope
4994
5113
  // Just pass the scope explicitly to processElement
4995
- const childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5114
+ const childScope = layerTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
4996
5115
 
4997
5116
 
4998
5117
  Array.from(el.childNodes).forEach(child => processElement(child, childScope));
@@ -5006,7 +5125,7 @@ catch (e2) {
5006
5125
  // inserted and left inert, so bindings such as :text and {{ expression }}
5007
5126
  // leaked into the rendered UI until the condition toggled.
5008
5127
  const processTemplateNodes = (nodes) => {
5009
- const childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5128
+ const childScope = layerTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5010
5129
  // Components compiled inside a <template :if> carry setup scripts in the
5011
5130
  // template content. Browser-cloned scripts are inert, so register their
5012
5131
  // scopes and forwarded props before walking the inserted branch. This is
@@ -5025,7 +5144,7 @@ catch (e2) {
5025
5144
 
5026
5145
  // Evaluate the :if expression \u2014 use direct signal read for simple refs,
5027
5146
  // falling back to evalExpr for complex expressions
5028
- const fullScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5147
+ const fullScope = layerTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5029
5148
  const directSignal = fullScope[expr];
5030
5149
 
5031
5150
  effect(() => {
@@ -5197,7 +5316,7 @@ else if (!value && isInserted) {
5197
5316
  detachedBranches.add(resume);
5198
5317
  return;
5199
5318
  }
5200
- var childScope = mergeTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5319
+ var childScope = layerTemplateScopes(globalHelpers, capturedComponentScope, (capturedElementScope || {}));
5201
5320
  // A false single-element conditional is detached before the
5202
5321
  // DOMContentLoaded component-scope pass. When it becomes visible,
5203
5322
  // hydrate any component roots in the restored subtree first so
@@ -5834,7 +5953,7 @@ else if (!value && isInserted) {
5834
5953
  const tag = el.tagName.toLowerCase();
5835
5954
  const type = el.type;
5836
5955
  const modifiers = attrName.split('.').slice(1);
5837
- const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
5956
+ const capturedScope = layerTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
5838
5957
  const coerceValue = (value) => {
5839
5958
  var next = value;
5840
5959
  if (modifiers.includes('trim') && typeof next === 'string') next = next.trim();
@@ -7526,14 +7645,14 @@ else {
7526
7645
  if (el.hasAttribute('x-data') || el.hasAttribute('data-stx-xdata') || el.__stx_scope) {
7527
7646
  var xdScope = el.__stx_scope || (findElementScope(el) || {});
7528
7647
  if (xdScope && Object.keys(xdScope).length > 0) {
7529
- scope = mergeTemplateScopes(scope, xdScope);
7648
+ scope = layerTemplateScopes(scope, xdScope);
7530
7649
  }
7531
7650
  }
7532
7651
  // v-memo / @memo \u2014 skip re-processing if dependency values haven't changed
7533
7652
  if (el.hasAttribute('data-stx-memo')) {
7534
7653
  var memoExpr = el.getAttribute('data-stx-memo');
7535
7654
  try {
7536
- var memoScope = mergeTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
7655
+ var memoScope = layerTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
7537
7656
  var memoFn = __stxCompileScoped(memoScope, [], 'return ' + memoExpr);
7538
7657
  var memoVals = JSON.stringify(memoFn(...__stxArgs(memoFn, memoScope)));
7539
7658
  if (el.__stx_memo_prev === memoVals) {
@@ -7567,7 +7686,7 @@ else {
7567
7686
  // Capture scope NOW before effects run asynchronously
7568
7687
  // Use the passed scope parameter (not global componentScope) to preserve context
7569
7688
  // through nested @if/@for processing where componentScope may be restored
7570
- const capturedScope = el.__stx_slot_scope || mergeTemplateScopes(globalHelpers, scope, (findElementScope(parentEl) || {}));
7689
+ const capturedScope = el.__stx_slot_scope || layerTemplateScopes(globalHelpers, scope, (findElementScope(parentEl) || {}));
7571
7690
  parts.forEach(part => {
7572
7691
  const match = part.match(/^\\{\\{\\s*([\\s\\S]+?)\\s*\\}\\}$/);
7573
7692
  if (match) {
@@ -7699,7 +7818,7 @@ else if (part) {
7699
7818
 
7700
7819
  // Capture scope once for all attribute bindings on this element
7701
7820
  // Use the passed scope parameter to preserve context through nested processing
7702
- const attrCapturedScope = mergeTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
7821
+ const attrCapturedScope = layerTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
7703
7822
 
7704
7823
  // Keep the conditional owners captured while the element is in the tree.
7705
7824
  // Walking parents on each update loses an outer owner when an inner :if
@@ -7921,7 +8040,11 @@ catch (e2) {
7921
8040
  }
7922
8041
  return;
7923
8042
  }
7924
- if (attrName.startsWith('aria-') && typeof v === 'boolean') {
8043
+ // aria-* and data-* carry a STRING: the platform's boolean attribute
8044
+ // is presence, which cannot say "false" and wrote data-open="" for
8045
+ // true, so a [data-open='true'] selector never matched. React renders
8046
+ // both as "true" / "false", and so does this.
8047
+ if ((attrName.startsWith('aria-') || attrName.startsWith('data-')) && typeof v === 'boolean') {
7925
8048
  stxHost.setAttribute(el, attrName, String(v));
7926
8049
  }
7927
8050
  else if (typeof v === 'boolean') {
@@ -8061,8 +8184,8 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
8061
8184
  // Capture scope at setup time so @for loop variables are available when event fires
8062
8185
  const isForwardedComponentEvent = !!(el.__stx_parent_scope && parentEventNames.includes(eventName));
8063
8186
  let eventCapturedScope = isForwardedComponentEvent
8064
- ? mergeTemplateScopes(globalHelpers, el.__stx_parent_scope)
8065
- : mergeTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
8187
+ ? layerTemplateScopes(globalHelpers, el.__stx_parent_scope)
8188
+ : layerTemplateScopes(globalHelpers, scope, (findElementScope(el) || {}));
8066
8189
 
8067
8190
  stxHost.listen(el, eventName, (event) => {
8068
8191
  // A forwarded handler belongs to the caller, whose scope can be
@@ -8071,7 +8194,7 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
8071
8194
  // page's scope and only later handed its real caller, so
8072
8195
  // @pick="pickFromBank" found nothing and did nothing. Read it now.
8073
8196
  if (isForwardedComponentEvent && el.__stx_parent_scope)
8074
- eventCapturedScope = mergeTemplateScopes(globalHelpers, el.__stx_parent_scope);
8197
+ eventCapturedScope = layerTemplateScopes(globalHelpers, el.__stx_parent_scope);
8075
8198
  // Vue-style component listeners fall through to the rendered native
8076
8199
  // root unless the child emits the same event. Signal components use
8077
8200
  // a scope wrapper, so native events arrive here from a descendant.
@@ -8698,7 +8821,7 @@ ${e}
8698
8821
  if (el.__stx_show_bound) return;
8699
8822
  el.__stx_show_bound = true;
8700
8823
 
8701
- const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
8824
+ const capturedScope = layerTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
8702
8825
 
8703
8826
  // Check if the expression is a simple signal reference (most common case for :show)
8704
8827
  const directSignal = capturedScope[expr];
@@ -9666,7 +9789,7 @@ finally {
9666
9789
  return s;
9667
9790
  }`;var ht=` function bindStyle(el, expr, passedScope = componentScope, isVisible) {
9668
9791
  // Capture scope at setup time - use passed scope to preserve context
9669
- const capturedScope = mergeTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
9792
+ const capturedScope = layerTemplateScopes(globalHelpers, passedScope, (findElementScope(el) || {}));
9670
9793
 
9671
9794
  const evalExpr = () => {
9672
9795
  // Mirror bindClass: first try the auto-unwrap proxy (so an expression
@@ -10630,7 +10753,7 @@ else if (timer === null) {
10630
10753
  subscribe: subscribe
10631
10754
  };
10632
10755
  }
10633
- `;function mt(){let e=St(zn());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(e);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return e}}function St(e){let s=[],i=0,a="console.log(";while(i<e.length){let d=e.indexOf(a,i);if(d===-1){s.push(e.slice(i));break}s.push(e.slice(i,d));let y=1,r=d+a.length;while(r<e.length&&y>0){let u=e[r];if(u==='"'||u==="'"||u==="`"){let f=u;r++;while(r<e.length&&e[r]!==f){if(e[r]==="\\")r++;r++}r++;continue}if(u==="(")y++;else if(u===")")y--;r++}s.push("0"),i=r}return s.join("")}function zn(){return`${ae}${Me}
10756
+ `;function mt(){let e=St(zn());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(e);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return e}}function St(e){let s=[],i=0,a="console.log(";while(i<e.length){let d=e.indexOf(a,i);if(d===-1){s.push(e.slice(i));break}s.push(e.slice(i,d));let y=1,r=d+a.length;while(r<e.length&&y>0){let u=e[r];if(u==='"'||u==="'"||u==="`"){let f=u;r++;while(r<e.length&&e[r]!==f){if(e[r]==="\\")r++;r++}r++;continue}if(u==="(")y++;else if(u===")")y--;r++}s.push("0"),i=r}return s.join("")}function zn(){return`${ae}${De}
10634
10757
  ${Je(ie,ke,Te)}
10635
10758
 
10636
10759
  ${Oe}
@@ -10657,7 +10780,7 @@ ${se}
10657
10780
  ${ue}
10658
10781
  ${me}
10659
10782
  ${Ke}
10660
- ${tt(ul(),dl(),ll())}
10783
+ ${tt(dl(),pl(),ul())}
10661
10784
 
10662
10785
  ${ft}
10663
10786
  ${it}
@@ -10692,7 +10815,7 @@ ${Xe}
10692
10815
  ${ye}
10693
10816
  ${_e}
10694
10817
  ${vt}
10695
- ${De}
10818
+ ${Me}
10696
10819
  ${rt(he)}
10697
10820
 
10698
10821
  ${ut}
@@ -10710,5 +10833,5 @@ ${lt}
10710
10833
  ${ct}
10711
10834
  ${at}
10712
10835
  })();
10713
- `}var nh={state:le,derived:Hn,effect:Vn,batch:mo,onMount:qr,onDestroy:Kr,isSignal:Un,isDerived:Wn,untrack:ho,peek:Gr,generateSignalsRuntime:mt,generateSignalsRuntimeDev:zn};
10714
- export{mt,zn,nh};
10836
+ `}var rh={state:le,derived:Hn,effect:Vn,batch:ho,onMount:Kr,onDestroy:Xr,isSignal:Un,isDerived:Wn,untrack:yo,peek:Gr,generateSignalsRuntime:mt,generateSignalsRuntimeDev:zn};
10837
+ export{mt,zn,rh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function Ht(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function Ys(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Vt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Bi(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function at(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Fi(e){console.log(` ${O("\u2139")} ${e}`)}function zi(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function Zs(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Ut(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Hi(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Wt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
- export{Ht,Ys,Vt,Bi,at,Fi,zi,Zs,Ut,Hi,Wt};
2
+ var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function Ht(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function Zs(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Vt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Fi(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function at(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function zi(e){console.log(` ${O("\u2139")} ${e}`)}function Hi(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function Qs(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Ut(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Vi(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Wt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
+ export{Ht,Zs,Vt,Fi,at,zi,Hi,Qs,Ut,Vi,Wt};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function le(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Hn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function rh(e,n=Object.is){return Hn(e,{equals:n})}function Vn(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function mo(e){C(e)}function qr(e){k.push(e)}function Kr(e){T.push(e)}function sh(){O(k,"onMount",T)}function oh(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function ih(){return{mount:k.length,destroy:T.length}}function Un(e){return typeof e==="function"&&e._isSignal===!0}function Wn(e){return typeof e==="function"&&e._isDerived===!0}function ho(e){if(Un(e)||Wn(e))return m(()=>e());return e}function Gr(e){return m(e)}function ah(e,n){let r=typeof e==="function"?e:()=>e,i=le([]),o=Hn(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return Vn(()=>{if(r(),!t){t=!0;return}if(Gr(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
3
- export{le,Hn,rh,Vn,mo,qr,Kr,sh,oh,ih,Un,Wn,ho,Gr,ah};
2
+ var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function le(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function Hn(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function sh(e,n=Object.is){return Hn(e,{equals:n})}function Vn(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function ho(e){C(e)}function Kr(e){k.push(e)}function Xr(e){T.push(e)}function oh(){O(k,"onMount",T)}function ih(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function ah(){return{mount:k.length,destroy:T.length}}function Un(e){return typeof e==="function"&&e._isSignal===!0}function Wn(e){return typeof e==="function"&&e._isDerived===!0}function yo(e){if(Un(e)||Wn(e))return m(()=>e());return e}function Gr(e){return m(e)}function ch(e,n){let r=typeof e==="function"?e:()=>e,i=le([]),o=Hn(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return Vn(()=>{if(r(),!t){t=!0;return}if(Gr(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
3
+ export{le,Hn,sh,Vn,ho,Kr,Xr,oh,ih,ah,Un,Wn,yo,Gr,ch};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Gs,$i,hg,yg,bg}from"./chunk-74y29xxs.js";import"./chunk-dvh63p75.js";export{yg as generateManifestLink,Gs as generatePwaTags,hg as generateSwRegistrationScript,bg as generateThemeColorMeta,$i as injectPwaTags};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Um(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Wm(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function Wm(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function qm(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Km(){return`
229
+ `}function qm(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Km(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Xm(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{Um,Wm,qm,Km,Gm};
358
+ export{Wm,qm,Km,Xm,Gm};
@@ -1,12 +1,12 @@
1
1
  // @bun
2
- function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=Xc(t,n+2),n<t.length)n++;continue}n++}return t.length}function Xc(t,i){let n=1,e=i,r="{",f="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=o(t,e),r=h,f="";continue}if(l==="`"){e=b(t,e),r=h,f="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
2
+ function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=Jc(t,n+2),n<t.length)n++;continue}n++}return t.length}function Jc(t,i){let n=1,e=i,r="{",f="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=o(t,e),r=h,f="";continue}if(l==="`"){e=b(t,e),r=h,f="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
3
3
  `)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&a(r,f)){let u=w(t,e);if(u!==-1){e=u,r=h,f="";continue}}if(l==="{")n++;else if(l==="}"){if(n--,n===0)return e}if(/[\w$]/.test(l))f=/[\w$]/.test(r)?f+l:l,r=l;else if(!/\s/.test(l))r=l,f="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(t,i){if(i)return m.has(i);return!(t===")"||t==="]"||t===h)}var h="\x00";function w(t,i){let n=i+1,e=!1;while(n<t.length){let r=t[n];if(r===`
4
4
  `)return-1;if(r==="\\"){n+=2;continue}if(r==="[")e=!0;else if(r==="]")e=!1;else if(r==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function s(t){let i="",n=0,e="",r="";while(n<t.length){let f=t.slice(n,n+2);if(f==="//"){while(n<t.length&&t[n]!==`
5
5
  `)i+=" ",n++;continue}if(f==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")i+=t[n]===`
6
6
  `?`
7
7
  `:" ",n++;i+=" ",n+=2;continue}let l=t[n];if(l==='"'||l==="'"){let u=l;i+=" ",n++;while(n<t.length&&t[n]!==u){if(t[n]==="\\"){i+=" ",n+=2;continue}i+=t[n]===`
8
8
  `?`
9
- `:" ",n++}i+=" ",n++,e=h,r="";continue}if(l==="/"&&a(e,r)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=Xc(t,u);if(i+=" ",i+=s(t.slice(u,g)),g<t.length)i+=" ";n=g+1;continue}i+=t[n]===`
9
+ `:" ",n++}i+=" ",n++,e=h,r="";continue}if(l==="/"&&a(e,r)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=Jc(t,u);if(i+=" ",i+=s(t.slice(u,g)),g<t.length)i+=" ";n=g+1;continue}i+=t[n]===`
10
10
  `?`
11
11
  `:" ",n++}i+=" ",n++,e=h,r="";continue}if(i+=l,n++,/[\w$]/.test(l))r=/[\w$]/.test(e)?r+l:l,e=l;else if(!/\s/.test(l))e=l,r=""}return i}function ge(t){let i=new Uint16Array(t.length),n=0,e=!0;for(let r=0;r<t.length;r++){let f=t[r];if(f===")"||f==="]"||f==="}")if(n===0)e=!1;else n--;if(i[r]=n,f==="("||f==="["||f==="{")n++}return{depths:i,balanced:e&&n===0}}
12
- export{Xc,s,ge};
12
+ export{Jc,s,ge};