@stacksjs/stx 0.2.583 → 0.2.585

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 (243) hide show
  1. package/dist/{chunk-ck1yca7g.js → chunk-03qf2z4d.js} +1 -1
  2. package/dist/{chunk-6m3me7yj.js → chunk-03xsf9jm.js} +9 -9
  3. package/dist/{chunk-sv5nvfmb.js → chunk-048eyjyj.js} +2 -2
  4. package/dist/{chunk-je1as16r.js → chunk-076h7nb9.js} +5 -5
  5. package/dist/{chunk-hp9nxva6.js → chunk-07869zev.js} +4 -4
  6. package/dist/chunk-0hpw65yr.js +2 -0
  7. package/dist/chunk-11jmasqb.js +2 -0
  8. package/dist/chunk-2c7ysn9s.js +2 -0
  9. package/dist/chunk-2wb1w0p6.js +2 -0
  10. package/dist/chunk-2wx2aczp.js +2 -0
  11. package/dist/{chunk-pbwk8tzz.js → chunk-33q5zka4.js} +1 -1
  12. package/dist/chunk-3qmx12d3.js +2845 -0
  13. package/dist/{chunk-ktyctev3.js → chunk-3y5tzxm6.js} +2 -2
  14. package/dist/chunk-3ybbat49.js +2 -0
  15. package/dist/{chunk-2943qhdt.js → chunk-45x4myqe.js} +2 -2
  16. package/dist/chunk-4dpab4j6.js +2 -0
  17. package/dist/{chunk-5kh5ehfh.js → chunk-4h58as2c.js} +2 -2
  18. package/dist/chunk-4vnwge6p.js +2 -0
  19. package/dist/chunk-4w37cqg9.js +2 -0
  20. package/dist/chunk-51pz8cwa.js +2 -0
  21. package/dist/chunk-65agttgm.js +2 -0
  22. package/dist/{chunk-ye66wc53.js → chunk-67m2prah.js} +2 -2
  23. package/dist/{chunk-521pe0hb.js → chunk-6cg03r93.js} +4 -4
  24. package/dist/chunk-6djvj6hg.js +2 -0
  25. package/dist/{chunk-4pmgr32a.js → chunk-6hgngmn0.js} +3 -3
  26. package/dist/{chunk-09zwhsf9.js → chunk-751b5zv9.js} +3 -3
  27. package/dist/{chunk-mjj24qpb.js → chunk-794v5crp.js} +2 -2
  28. package/dist/chunk-7ae40484.js +2 -0
  29. package/dist/chunk-7dkwf9h5.js +2 -0
  30. package/dist/chunk-7dtyf7hq.js +2 -0
  31. package/dist/chunk-7ebt9n43.js +4 -0
  32. package/dist/{chunk-cnknvvwm.js → chunk-7fghm9zy.js} +1 -1
  33. package/dist/{chunk-117xss52.js → chunk-7xw1e8t6.js} +2 -2
  34. package/dist/{chunk-w6wtxj54.js → chunk-7ydavm3h.js} +2 -2
  35. package/dist/chunk-80g8kaes.js +2 -0
  36. package/dist/{chunk-qdyp2zqf.js → chunk-82bttwqm.js} +2 -2
  37. package/dist/chunk-8992smwz.js +2 -0
  38. package/dist/{chunk-qn8gdw21.js → chunk-8s7zbhdd.js} +4 -4
  39. package/dist/{chunk-02qaqamv.js → chunk-91pdg853.js} +7 -7
  40. package/dist/chunk-9j6hk72q.js +2 -0
  41. package/dist/{chunk-96mb3brj.js → chunk-9nt3q23a.js} +3 -3
  42. package/dist/chunk-9pk5jhqa.js +3 -0
  43. package/dist/{chunk-g9zeybqh.js → chunk-9qsnq026.js} +2 -2
  44. package/dist/{chunk-m417sp42.js → chunk-a30mtx17.js} +4 -4
  45. package/dist/chunk-a3k4nfq2.js +2 -0
  46. package/dist/{chunk-c0h2eqe0.js → chunk-a8n6mt7s.js} +2 -2
  47. package/dist/{chunk-xp7fxc6p.js → chunk-awgvt956.js} +5 -5
  48. package/dist/{chunk-mt9x626h.js → chunk-axz1x4r9.js} +5 -5
  49. package/dist/{chunk-8tq83fq7.js → chunk-b217d16p.js} +57 -57
  50. package/dist/{chunk-w3rmepwy.js → chunk-bfbmdjh4.js} +2 -2
  51. package/dist/chunk-bhg4pvtn.js +2 -0
  52. package/dist/{chunk-0k5faspy.js → chunk-bsy10tz6.js} +6 -6
  53. package/dist/{chunk-dvc15djp.js → chunk-c6egfhy6.js} +2 -2
  54. package/dist/chunk-c8fdccgp.js +2 -0
  55. package/dist/chunk-ce2d0hz9.js +2 -0
  56. package/dist/{chunk-4pkpr5cg.js → chunk-cqr5cv7h.js} +4 -4
  57. package/dist/chunk-cw76edds.js +2 -0
  58. package/dist/{chunk-ky1426s1.js → chunk-cy07dhqh.js} +10 -10
  59. package/dist/chunk-czrs87r9.js +2 -0
  60. package/dist/{chunk-ycj0342k.js → chunk-d0tmc6v5.js} +2 -2
  61. package/dist/chunk-d9vjsqs4.js +2 -0
  62. package/dist/chunk-ddgyj88h.js +2 -0
  63. package/dist/chunk-dj90w48e.js +2 -0
  64. package/dist/chunk-dngzks8e.js +2 -0
  65. package/dist/chunk-e01j75cr.js +122 -0
  66. package/dist/{chunk-kfwmqacd.js → chunk-e556dvy4.js} +3 -3
  67. package/dist/chunk-ede39b7h.js +3 -0
  68. package/dist/chunk-emxa2djv.js +2 -0
  69. package/dist/chunk-esj49jvz.js +2 -0
  70. package/dist/chunk-eztvhppz.js +2 -0
  71. package/dist/{chunk-4srg0qbv.js → chunk-f29fk7dw.js} +2 -2
  72. package/dist/{chunk-vke73gts.js → chunk-fkq55rh7.js} +1 -1
  73. package/dist/chunk-h2534p6q.js +2 -0
  74. package/dist/{chunk-2nehykbm.js → chunk-h7atbtds.js} +5 -5
  75. package/dist/chunk-h9gtc6bk.js +2 -0
  76. package/dist/{chunk-h0a2s340.js → chunk-haag5n42.js} +2 -2
  77. package/dist/{chunk-cby4mkjf.js → chunk-hj8tr9g0.js} +1 -1
  78. package/dist/{chunk-en7xxgtb.js → chunk-hsy9rhct.js} +2 -2
  79. package/dist/{chunk-qccgncp2.js → chunk-htcptqtn.js} +6 -6
  80. package/dist/chunk-hwnvfke9.js +2 -0
  81. package/dist/chunk-hygxh993.js +2 -0
  82. package/dist/{chunk-s12bnv32.js → chunk-hz11wmx9.js} +2 -2
  83. package/dist/{chunk-wyn5rfzk.js → chunk-j7kcjgxy.js} +115 -26
  84. package/dist/chunk-j8v5164e.js +2 -0
  85. package/dist/chunk-jqy5q8m0.js +2 -0
  86. package/dist/{chunk-0dfgefjv.js → chunk-jtx74677.js} +2 -2
  87. package/dist/chunk-jy7yzat1.js +2 -0
  88. package/dist/{chunk-vkc51n9m.js → chunk-k1szsenr.js} +2 -2
  89. package/dist/{chunk-sv08pd66.js → chunk-k71e38fk.js} +4 -4
  90. package/dist/{chunk-ac6v3s3k.js → chunk-kfhghjh6.js} +2 -2
  91. package/dist/{chunk-ym1sb5bg.js → chunk-m7ddgrsm.js} +5 -5
  92. package/dist/{chunk-vpdx7qr3.js → chunk-mmbspaqh.js} +2 -2
  93. package/dist/{chunk-6fc8vw2v.js → chunk-mnnxa3r7.js} +7 -7
  94. package/dist/chunk-n7yk4nc1.js +2 -0
  95. package/dist/chunk-ns1jqzqk.js +2 -0
  96. package/dist/chunk-p973efbe.js +2 -0
  97. package/dist/{chunk-m8tm44rq.js → chunk-pg164sdw.js} +2 -2
  98. package/dist/{chunk-x552npae.js → chunk-pxw4edw8.js} +4 -4
  99. package/dist/chunk-q03kn4d1.js +2 -0
  100. package/dist/{chunk-1r1maqep.js → chunk-q1cvef6b.js} +3 -3
  101. package/dist/{chunk-jpqkm8tm.js → chunk-qf3axv86.js} +3 -3
  102. package/dist/{chunk-dhq80e4r.js → chunk-qhr1tkhj.js} +7 -7
  103. package/dist/chunk-qq59xzwc.js +2 -0
  104. package/dist/{chunk-h3z9b6bw.js → chunk-qx0tcsdm.js} +11 -11
  105. package/dist/chunk-r0e743c3.js +2 -0
  106. package/dist/chunk-r90v2jz6.js +2 -0
  107. package/dist/chunk-rtgf9fgc.js +2 -0
  108. package/dist/chunk-s043hpvd.js +2 -0
  109. package/dist/{chunk-hzqyfdpy.js → chunk-s2h601k7.js} +7 -7
  110. package/dist/chunk-shzesarq.js +2 -0
  111. package/dist/chunk-sjkdpsca.js +3 -0
  112. package/dist/chunk-sqpme1hg.js +2 -0
  113. package/dist/{chunk-e809x7m0.js → chunk-t212h9zm.js} +1 -1
  114. package/dist/{chunk-r47cs92n.js → chunk-tc15vkfh.js} +2 -2
  115. package/dist/chunk-thydj877.js +2 -0
  116. package/dist/{chunk-6z3e1tyz.js → chunk-tnafnb23.js} +1 -1
  117. package/dist/{chunk-ah9xyss2.js → chunk-v8ze2q95.js} +2 -2
  118. package/dist/{chunk-xytkfa48.js → chunk-vf15db1j.js} +6 -6
  119. package/dist/chunk-vv1kr9dn.js +2 -0
  120. package/dist/{chunk-dm1qh2vq.js → chunk-w24qmxc3.js} +3 -3
  121. package/dist/{chunk-nhd9m8h5.js → chunk-wkrf41se.js} +6 -6
  122. package/dist/chunk-wm9nzg76.js +2 -0
  123. package/dist/chunk-wn2gzwmv.js +2 -0
  124. package/dist/{chunk-07anexcg.js → chunk-ww28zfwt.js} +2 -2
  125. package/dist/chunk-x5qymgxa.js +2 -0
  126. package/dist/chunk-xfe2nzxd.js +2 -0
  127. package/dist/chunk-xjwgzp6s.js +2 -0
  128. package/dist/chunk-xnbkyj4g.js +2 -0
  129. package/dist/chunk-xyepqdjy.js +2 -0
  130. package/dist/{chunk-wwj8zbzc.js → chunk-y09g63k0.js} +5 -5
  131. package/dist/{chunk-3e3dpp7w.js → chunk-y5x8xnnf.js} +3 -3
  132. package/dist/chunk-y93y2qat.js +2 -0
  133. package/dist/{chunk-nh3svtvj.js → chunk-yhhfxx17.js} +5 -5
  134. package/dist/{chunk-bj29pwm0.js → chunk-zrw1zf54.js} +3 -3
  135. package/dist/cli.js +20 -20
  136. package/dist/client/signals-host-runtime.js +52 -1
  137. package/dist/client/signals-manifest-hydration-runtime.js +13 -0
  138. package/dist/client/signals-overlay-runtime.js +29 -6
  139. package/dist/client/signals-public-api-runtime.js +2 -0
  140. package/dist/client/signals-style-runtime.js +1 -1
  141. package/dist/component-renderer.js +26 -6
  142. package/dist/craft-entry.js +2 -2
  143. package/dist/craft.js +2 -2
  144. package/dist/native/accessibility.d.ts +18 -0
  145. package/dist/native/accessibility.js +89 -0
  146. package/dist/native/compiler/design-tokens.d.ts +4 -0
  147. package/dist/native/compiler/design-tokens.js +28 -0
  148. package/dist/native/compiler/headwind-to-style.d.ts +5 -4
  149. package/dist/native/compiler/headwind-to-style.js +105 -65
  150. package/dist/native/compiler/html-to-ir.d.ts +3 -1
  151. package/dist/native/compiler/html-to-ir.js +49 -243
  152. package/dist/native/compiler/inline-style.d.ts +13 -0
  153. package/dist/native/compiler/inline-style.js +285 -0
  154. package/dist/native/compiler/ir.d.ts +5 -1
  155. package/dist/native/compiler/render-screen.js +3 -1
  156. package/dist/native/compiler/style-variables.d.ts +8 -0
  157. package/dist/native/compiler/style-variables.js +142 -0
  158. package/dist/native/compiler/stylesheet-theme.d.ts +6 -0
  159. package/dist/native/compiler/stylesheet-theme.js +110 -0
  160. package/dist/native/runtime/craft-bridge.js +3 -1
  161. package/dist/native/runtime/native-host.d.ts +13 -2
  162. package/dist/native/runtime/native-host.js +242 -36
  163. package/dist/native/runtime/overlay-presenter.d.ts +29 -0
  164. package/dist/native/runtime/overlay-presenter.js +69 -0
  165. package/dist/native/runtime/shared-screen.js +12 -1
  166. package/dist/native/runtime/view-operations.d.ts +20 -0
  167. package/dist/native/runtime/view-operations.js +35 -0
  168. package/dist/native/testing-mutations.d.ts +4 -0
  169. package/dist/native/testing-mutations.js +64 -0
  170. package/dist/native/testing.d.ts +2 -0
  171. package/dist/native/testing.js +18 -1
  172. package/dist/pwa.js +3 -3
  173. package/dist/ssg.js +9 -9
  174. package/dist/testing.js +2 -0
  175. package/dist/types/config-types.d.ts +2 -0
  176. package/dist/utils.d.ts +1 -1
  177. package/dist/utils.js +25 -5
  178. package/package.json +5 -5
  179. package/dist/chunk-00p22wzr.js +0 -3
  180. package/dist/chunk-0fx3ppnt.js +0 -2
  181. package/dist/chunk-0sfexf9t.js +0 -2
  182. package/dist/chunk-2927nax9.js +0 -2
  183. package/dist/chunk-2rj0ttas.js +0 -2
  184. package/dist/chunk-2rx9d75e.js +0 -4
  185. package/dist/chunk-3ae39ttg.js +0 -2
  186. package/dist/chunk-3x6p9me0.js +0 -2
  187. package/dist/chunk-440yjsk5.js +0 -2
  188. package/dist/chunk-58z26y07.js +0 -2
  189. package/dist/chunk-5db5sxy3.js +0 -3
  190. package/dist/chunk-5r9k9s3m.js +0 -2
  191. package/dist/chunk-76vza4ve.js +0 -2
  192. package/dist/chunk-84f9dnq5.js +0 -2
  193. package/dist/chunk-8tq5x4z8.js +0 -2
  194. package/dist/chunk-8y8bbsh5.js +0 -2
  195. package/dist/chunk-9kzycb15.js +0 -2
  196. package/dist/chunk-agfhb2qd.js +0 -2
  197. package/dist/chunk-ay6dzpt4.js +0 -2
  198. package/dist/chunk-b9njk81d.js +0 -2
  199. package/dist/chunk-bfbcmfww.js +0 -2
  200. package/dist/chunk-br01jvra.js +0 -2
  201. package/dist/chunk-c12y2bet.js +0 -2
  202. package/dist/chunk-c2nwchk0.js +0 -2
  203. package/dist/chunk-cxqrwvc5.js +0 -2
  204. package/dist/chunk-czea8zr1.js +0 -2
  205. package/dist/chunk-d99kfx3k.js +0 -2
  206. package/dist/chunk-dpn1pmxj.js +0 -2
  207. package/dist/chunk-dskrwa8f.js +0 -2
  208. package/dist/chunk-e6ycqvdm.js +0 -2
  209. package/dist/chunk-efgk2xv1.js +0 -2
  210. package/dist/chunk-fj70wq7k.js +0 -2
  211. package/dist/chunk-fvx6pd66.js +0 -2
  212. package/dist/chunk-hrbjapvr.js +0 -2
  213. package/dist/chunk-jc4mxq56.js +0 -2
  214. package/dist/chunk-jdpyxt8j.js +0 -2
  215. package/dist/chunk-k0zev8wc.js +0 -2
  216. package/dist/chunk-mhjwtkx9.js +0 -2
  217. package/dist/chunk-n4e02qdz.js +0 -2838
  218. package/dist/chunk-nx8rf4qd.js +0 -2
  219. package/dist/chunk-pe5bk9ns.js +0 -2
  220. package/dist/chunk-qb2j34sp.js +0 -2
  221. package/dist/chunk-qknfceta.js +0 -2
  222. package/dist/chunk-s932zfjz.js +0 -2
  223. package/dist/chunk-sf98zgw2.js +0 -2
  224. package/dist/chunk-sgsp4dph.js +0 -2
  225. package/dist/chunk-t48ws5j0.js +0 -2
  226. package/dist/chunk-tfxmzat6.js +0 -122
  227. package/dist/chunk-thbc9gtj.js +0 -2
  228. package/dist/chunk-tms7amrb.js +0 -2
  229. package/dist/chunk-tn9v10q2.js +0 -2
  230. package/dist/chunk-v0zgarvv.js +0 -2
  231. package/dist/chunk-v9jd283e.js +0 -2
  232. package/dist/chunk-vczw73ga.js +0 -2
  233. package/dist/chunk-webrqm20.js +0 -2
  234. package/dist/chunk-wg2w7zmt.js +0 -3
  235. package/dist/chunk-wgkxgsqx.js +0 -2
  236. package/dist/chunk-wngqr949.js +0 -2
  237. package/dist/chunk-xyzy84x0.js +0 -2
  238. package/dist/chunk-y1jffvkj.js +0 -2
  239. package/dist/chunk-yas134jv.js +0 -2
  240. package/dist/chunk-yd55vynh.js +0 -2
  241. package/dist/chunk-yygze2s0.js +0 -2
  242. package/dist/chunk-z732tf98.js +0 -2
  243. package/dist/chunk-ze86h6vp.js +0 -2
@@ -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 Oa(){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 Fa(){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 Da(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 za(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}"
@@ -342,7 +342,7 @@ else {
342
342
  }
343
343
  })();
344
344
  </script>
345
- `})}function Ma(){return`
345
+ `})}function Ha(){return`
346
346
  /* Island base styles */
347
347
  .stx-island {
348
348
  display: contents;
@@ -383,9 +383,9 @@ else {
383
383
  .stx-island.hydrated {
384
384
  opacity: 1;
385
385
  }
386
- `}function Na(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 La(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 ja(){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 Ba(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function Fa(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 za(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function Ha(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
386
+ `}function Va(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 Ua(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 Wa(){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 qa(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function Ga(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 Ka(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function Xa(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 Hl={processPartialHydrationDirectives:Da,processStaticDirectives:za,generatePartialHydrationCSS:Ma,generateIslandManifest:Ha,createIslandRegistry:Oa,hydrateIsland:Na,hydrateByStrategy:La,hydrateAll:ja,isHydrated:Ba,onHydrated:Fa};
391
- export{Oa,Da,Ma,Na,La,ja,Ba,Fa,za,Ha,Hl};
390
+ `}var Xl={processPartialHydrationDirectives:za,processStaticDirectives:Ka,generatePartialHydrationCSS:Ha,generateIslandManifest:Xa,createIslandRegistry:Fa,hydrateIsland:Va,hydrateByStrategy:Ua,hydrateAll:Wa,isHydrated:qa,onHydrated:Ga};
391
+ export{Fa,za,Ha,Va,Ua,Wa,qa,Ga,Ka,Xa,Xl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ce,uc,ri,vt,wt,Wu,si,xt,ln,dc,pc,fc,is,St,gc,kt,mc}from"./chunk-cqr5cv7h.js";import"./chunk-yhhfxx17.js";import"./chunk-3y5tzxm6.js";import"./chunk-3qmx12d3.js";import"./chunk-w24qmxc3.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-45x4myqe.js";import"./chunk-k1szsenr.js";import"./chunk-91pdg853.js";import"./chunk-03xsf9jm.js";import"./chunk-qhr1tkhj.js";import"./chunk-mmbspaqh.js";import"./chunk-c6egfhy6.js";import"./chunk-pxw4edw8.js";import"./chunk-82bttwqm.js";export{ln as MODULE_SPECIFIER_PREFIX,kt as bundleClientScript,wt as clearBundleFailures,ce as clientBundleDependencies,vt as getBundleFailures,xt as hasUserImports,St as moduleSubstitutionKey,pc as normalizeRegistrySpecifiers,gc as queueClientBundleBuild,ri as recordBundleFailure,dc as registryIdForPath,si as resolveBundlerFallback,fc as rewriteRegistryImports,Wu as setBundlerFallbackMode,uc as shouldLogBundlerDiagnostics,mc as tempBuildName,is as withModuleSubstitutes};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{to,no,rt,Z,Nn,_r,Mn,Er,Tr,nl,rl,sl,Ln,ol,il,al,cl,sa,oa,ia,ro,aa,ll,st,ot,it,at,ct,lt,Te,ul}from"./chunk-pxw4edw8.js";export{Mn as Router,al as abortNavigation,_r as bracketPathToRegex,st as clearMiddleware,oa as createClientCookieManager,ct as createMiddlewareContext,at as createRouteLocation,sa as createServerCookieManager,ia as createStorageManager,cl as defineMiddleware,rl as defineRoute,sl as defineRoutes,Er as findErrorPage,Tr as formatRoutes,no as generateRouteManifest,to as generateRouteTypes,aa as getMiddleware,ot as getMiddlewareNames,Te as getRouterScript,ul as getRouterScriptDev,ll as hasMiddleware,rt as isFileRequestPath,it as loadMiddlewareFromDirectory,Nn as matchRoute,il as navigateTo,Z as patternToRegex,ro as registerMiddleware,ol as resetRoutes,Ln as route,lt as runMiddleware,nl as setAppUrl};
@@ -72,7 +72,7 @@ else {
72
72
  ${t}
73
73
  })();
74
74
  </script>
75
- `}function Gl(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
75
+ `}function eu(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
76
76
  <div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
77
77
  ${d}
78
78
  ${c}
@@ -81,4 +81,4 @@ else {
81
81
  </div>
82
82
  ${h}
83
83
  `})}
84
- export{Gl};
84
+ export{eu};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Gi,Ki,Xi}from"./chunk-dvc15djp.js";import{W,Qt,en,Gr,zn,Hn,tn,nn,Kr,Un}from"./chunk-w6wtxj54.js";function X(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function Q(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function J(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function Z(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():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)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},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:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function ee(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function te(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),K=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},z=(b)=>{let w=R;p.restore(e,b).then((T)=>{if(!T||w!==R||c)return;n=T.data,P.set(T.at),F()})};if(!x)z(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)z(k)},_t=(b,w)=>{let T=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(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)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;A=M(w,V).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,j]).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(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,T).then((A)=>{if(w!==R||T!==N())return j(),I();return n=A,c=Date.now(),P.set(c),K.set(null),p.persist(e,A,k),F(),j(),I()},(A)=>{if(w===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return j(),I()})},O=`${w} ${T||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!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(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.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(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function ne(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var re=` function useColorMode(options) {
2
+ import{ea,ta,na}from"./chunk-c6egfhy6.js";import{W,nn,rn,es,Gn,Kn,sn,on,ts,Xn}from"./chunk-7ydavm3h.js";function X(t,a,i,r,d,y){let o=!0,u=new Set,f=(p)=>r.get?r.get(p):p,l=()=>f(t());return Object.defineProperty(l,"_isSignal",{value:!0}),Object.defineProperty(l,"modifiers",{get:a}),l.set=(p)=>{if(!o)return;let h=a(),e=r.set?r.set(p,h):p;if(h.trim&&typeof e==="string")e=e.trim();if(h.number&&typeof e==="string"&&e!==""){let s=Number(e);if(!Number.isNaN(s))e=s}if(Object.is(t(),e))return;t.set(e),i(e)},l.update=(p)=>l.set(p(l())),l.input=(p)=>{if(!a().lazy)l.set(p)},l.change=(p)=>{if(a().lazy)l.set(p)},l.subscribe=(p)=>{if(!o)return()=>{};let h=t.subscribe((e,s)=>p(f(e),f(s)));return u.add(h),()=>{h(),u.delete(h)}},Object.defineProperty(l,"value",{get:l,set:l.set}),d(()=>{o=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{o=!0}),l}function Q(t,a=!0,i){if(!a||!t||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let o=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=o&&typeof o==="object"&&!Array.isArray(o)?o:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,t))try{return{data:i?i(d[t]):d[t]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Y(t){if(typeof window>"u")return;let a=window;if(t===void 0)a.__STX_DATA__={};else{if(!a.__STX_DATA__)try{let i=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");a.__STX_DATA__=i&&typeof i==="object"&&!Array.isArray(i)?i:{}}catch{a.__STX_DATA__={}}if(a.__STX_DATA__)delete a.__STX_DATA__[t]}}function J(t){let a=null;try{a=typeof indexedDB<"u"?indexedDB:null}catch{a=null}if(!a)return null;let i=a,r=t||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,f)=>{let l=i.open(r,1);l.onupgradeneeded=()=>{l.result.createObjectStore("kv")},l.onsuccess=()=>u(l.result),l.onerror=()=>f(l.error),l.onblocked=()=>f(Error("blocked"))}),d.catch(()=>{d=null});return d},o=(u,f)=>y().then((l)=>new Promise((p,h)=>{let e=l.transaction("kv",u),s=f(e.objectStore("kv"));e.oncomplete=()=>p(s?s.result:void 0),e.onerror=()=>h(e.error),e.onabort=()=>h(e.error)}));return{get:(u)=>o("readonly",(f)=>f.get(u)),set:(u,f)=>o("readwrite",(l)=>{l.put(f,u)}),remove:(u)=>o("readwrite",(f)=>{f.delete(u)}),removePrefix:(u)=>o("readwrite",(f)=>{f.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function Z(t,a){let i=t||{},r=null;if(i.storage!==void 0)r=i.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=i.backend!==void 0;if(y)d=i.backend||null;let o=()=>{if(y)return d;y=!0;try{d=a?a():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)}),l=new Map,p=new Set,h=new Map,e=!1,s=Promise.resolve(),v=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},E=(n)=>{try{if(r)r.removeItem(n)}catch{}},S=()=>{if(e=!1,!h.size)return s;let n=Array.from(h.entries());return h.clear(),s=s.then(()=>Promise.all(n.map(([c,g])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(g===void 0?null:g))}catch{}return}let _;try{return _={v:g},d.set(c,_).catch(()=>{let x;try{x=JSON.stringify(g)}catch{return}return d?d.set(c,{j:x}).catch(()=>{m(c,x)}):void 0})}catch{return}}))).then(()=>{}),s},N=(n,c)=>{if(h.set(n,c),p.add(n),e)return;e=!0,f(()=>{S()})},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:v(c.j)};return},k={peek(n){if(l.has(n))return{value:l.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let g=v(c);return l.set(n,g),{value:g}},load(n){let c=k.peek(n),g=c?null:o();if(c||!g)return Promise.resolve(c);return g.get(n).then((_)=>{if(l.has(n))return{value:l.get(n)};let x=D(_);if(x)l.set(n,x.value),p.add(n);return x},()=>{return})},set(n,c){if(l.set(n,c),d&&p.has(n)){N(n,c);return}let g;try{g=JSON.stringify(c===void 0?null:c)}catch{return}if(g.length<=u&&m(n,g))return;if(!o()){if(g.length>u)m(n,g);return}E(n),N(n,c)},forget(n){for(let g of Array.from(l.keys()))if(g.indexOf(n)===0)l.delete(g);for(let g of Array.from(h.keys()))if(g.indexOf(n)===0)h.delete(g);for(let g of Array.from(p))if(g.indexOf(n)===0)p.delete(g);try{if(r)for(let g=r.length-1;g>=0;g--){let _=r.key(g);if(_&&_.indexOf(n)===0)r.removeItem(_)}}catch{}let c=o();if(!c)return s;return s=s.then(()=>c.removePrefix(n)).catch(()=>{}),s},flush(){return S()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")S()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{S()})}catch{}return k}function ee(t,a){if(!t)return!1;if(t===a.key)return!0;if(!a.url)return!1;if(t===a.url)return!0;try{let i=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(t,i),d=new URL(a.url,i);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function te(t){let a=t.prefix||"stx:kept:",i=t.matches||((e,s)=>e===s.key||e===s.url),r=new Set,d=new Map,y,o=(e)=>e===void 0?y:e,u=(e,s)=>{let v=o(s);if(v===!1||v===null||v==="")return null;return`${a}${v===void 0?"":`${v}:`}query:${e}`},f=(e)=>{let s=e&&e.value;if(!s||typeof s!=="object"||!("d"in s))return;return{data:s.d,at:Number(s.at)||0}},l=()=>{let e=globalThis;return e.__stx_outboxes instanceof Map?e.__stx_outboxes:null},p={setScope(e){y=e},scope:()=>y,keyFor:u,seed(e,s){let v=u(e,s);return v?f(t.kept.peek(v)):void 0},restore(e,s){let v=u(e,s);return v?t.kept.load(v).then(f):Promise.resolve(void 0)},persist(e,s,v){let m=u(e,v);if(m)t.kept.set(m,{d:s,at:Date.now()})},overlay(e,s,v){let m=l();if(!m||!m.size)return s;let E=s;return m.forEach((S)=>{try{E=S.overlay(e,E,v)}catch{}}),E},watch(e){return r.add(e),()=>{r.delete(e)}},cachedQuery(e,s){let v=d.get(e);if(v){if(s&&v.__options)v.__options(s);return v}let m=s||{},E=m.initial===void 0?null:m.initial,S=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,D=()=>({key:e,url:N()}),k=S(),n=E,c=0,g=t.sharedRequest(),_=0,x=p.seed(e,k);if(x)n=x.data;let I=t.state(p.overlay(D(),n)),U=t.state(!1),q=t.state(!1),K=t.state(null),P=t.state(x?x.at:0),R=0,F=()=>{I.set(p.overlay(D(),n))},z=(b)=>{let w=R;p.restore(e,b).then((A)=>{if(!A||w!==R||c)return;n=A.data,P.set(A.at),F()})};if(!x)z(k);let wt=()=>{let b=S();if(b===k)return;k=b,R++,_=0,q.set(!1),U.set(!1),c=0;let w=p.seed(e,k);if(n=w?w.data:E,P.set(w?w.at:0),F(),!w)z(k)},_t=(b,w)=>{let A=m.timeoutMs||15000,C=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((M,V)=>{O=setTimeout(()=>{if(C)C.abort();V(Error("The request took too long."))},A)}),T;if(m.load)T=m.load({force:b,url:w,signal:C?C.signal:void 0});else if(w){let M=m.fetch||((L,H)=>fetch(L,H)),V={method:"GET",headers:{Accept:"application/json"}};if(b)V.cache="no-cache";if(C)V.signal=C.signal;T=M(w,V).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([T,j]).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,A=N(),C=()=>{if(w!==R)return Promise.resolve(I());if(_++,q.set(!0),c===0&&!P())U.set(!0);let j=()=>{if(w!==R)return;if(_=Math.max(0,_-1),!_)q.set(!1),U.set(!1)};return _t(b,A).then((T)=>{if(w!==R||A!==N())return j(),I();return n=T,c=Date.now(),P.set(c),K.set(null),p.persist(e,T,k),F(),j(),I()},(T)=>{if(w===R&&A===N())K.set(T&&T.message?T.message:"Could not load.");return j(),I()})},O=`${w} ${A||""}`;return b?g.fresh(O,C):g.run(O,C)},B={data:I,loading:U,isFetching:q,error:K,updatedAt:P,get key(){return e},load(b){if(wt(),!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(e,n,k),F()},invalidate(){c=0},__options(b){m={...m,...b}}};if(r.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(e,B),m.immediate)B.load();return B}},h=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(t.listen!==!1&&h&&typeof h.addEventListener==="function")h.addEventListener("stx:updated",(e)=>{let s=e.detail||{};if(s.kind!=="api"||typeof s.url!=="string")return;r.forEach((v)=>{if(i(s.url,v.target()))v.updated()})}),h.addEventListener("stx:outbox",(e)=>{let s=e.detail||{},v=s.sent&&typeof s.sent.id==="string"?s.sent:null;r.forEach((m)=>{if(v){let E=Array.isArray(v.affects)?v.affects:[],S=m.target();if(!E.some((N)=>i(N,S)))return}m.outbox(v)})});return p}function ne(t){let a=t&&t.covers||((o,u)=>Object.is(o,u)),i=[],r=[],d=0,y=(o,u)=>{let f;try{f=Promise.resolve(u())}catch(h){f=Promise.reject(h)}let l={key:o,promise:f};i.push(l);let p=()=>{let h=i.indexOf(l);if(h!==-1)i.splice(h,1)};return f.then(p,p),f};return{run(o,u){for(let f of i)if(a(f.key,o))return f.promise;for(let f of r)if(a(f.key,o))return f.promise;return y(o,u)},fresh(o,u){for(let h of r)if(a(h.key,o))return h.promise;let f=i.filter((h)=>a(h.key,o)).map((h)=>h.promise);if(!f.length)return y(o,u);let l={key:o,promise:null},p=()=>{};return l.promise=Promise.all(f.map((h)=>h.then(p,p))).then(()=>{let h=r.indexOf(l);if(h!==-1)r.splice(h,1);return y(o,u)}),r.push(l),l.promise},latest(){let o=++d;return()=>o===d},get busy(){return i.length>0||r.length>0}}}var re=` function useColorMode(options) {
3
3
  options = options || {};
4
4
  // The pre-paint boot script (stacksjs/stx#1794) publishes the app's
5
5
  // configured options here. Reading them makes a bare useColorMode() agree
@@ -2731,7 +2731,7 @@ catch (e) {
2731
2731
  }
2732
2732
  throw e;
2733
2733
  }
2734
- }`;function Te(t,a){return` // ==========================================================================
2734
+ }`;function Ae(t,a){return` // ==========================================================================
2735
2735
  // Declarative Data Fetching (Feature #6 - useFetch)
2736
2736
  // ==========================================================================
2737
2737
 
@@ -2872,7 +2872,7 @@ else if (immediate) {
2872
2872
  get isEmpty() { return !loading() && !data(); }
2873
2873
  };
2874
2874
  }
2875
- `}var Ae=` function bindFor(el, passedScope = componentScope, attrName = '@for') {
2875
+ `}var Te=` function bindFor(el, passedScope = componentScope, attrName = '@for') {
2876
2876
  if (el.__stx_for_bound) return;
2877
2877
  el.__stx_for_bound = true;
2878
2878
  const expr = el.getAttribute(attrName);
@@ -3518,7 +3518,7 @@ catch (e) {
3518
3518
  if (tgIsGroup) parent.__stx_tg_init = true;
3519
3519
  });
3520
3520
  }
3521
- `;var Ce=` // Also expose globally for convenience
3521
+ `;var Ne=` // Also expose globally for convenience
3522
3522
  window.state = state;
3523
3523
  window.derived = derived;
3524
3524
  window.memo = memo;
@@ -3585,7 +3585,7 @@ catch (e) {
3585
3585
  // Note: SPA Router and View Transitions CSS are provided by the canonical
3586
3586
  // router script (packages/router/src/client.ts) which is injected alongside
3587
3587
  // the signals runtime or via the @stxRouter directive.
3588
- `;var Ie=` function expressionUsesSignalApi(expression, name) {
3588
+ `;var Ce=` function expressionUsesSignalApi(expression, name) {
3589
3589
  var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
3590
3590
  return expressionUsesSignalMethod(expression, name)
3591
3591
  || expressionUsesSignalValue(expression, name);
@@ -3664,7 +3664,7 @@ catch (e) {
3664
3664
  console.warn('[STX] Handler error:', expr, e);
3665
3665
  }
3666
3666
  }
3667
- `;var Re=` // ==========================================================================
3667
+ `;var Ie=` // ==========================================================================
3668
3668
  // Client-side useHead / useSeoMeta
3669
3669
  // ==========================================================================
3670
3670
 
@@ -3755,7 +3755,7 @@ catch (e) {
3755
3755
  if (config.canonical) meta.push({ property: 'og:url', content: config.canonical });
3756
3756
  useHead({ title: config.title || config.ogTitle, meta: meta });
3757
3757
  }
3758
- `;var Oe=` // ==========================================================================
3758
+ `;var Re=` // ==========================================================================
3759
3759
  // Global Helpers (Feature #5)
3760
3760
  // ==========================================================================
3761
3761
 
@@ -3884,7 +3884,7 @@ catch (e) {
3884
3884
  const deps = depsMap.get(key);
3885
3885
  if (deps) notifySubscribers(deps);
3886
3886
  }
3887
- `;var Me=` // \u2500\u2500 Host \u2500\u2500
3887
+ `;var Oe=` // \u2500\u2500 Host \u2500\u2500
3888
3888
  //
3889
3889
  // The tree this runtime mutates. Every write the binding layer makes to a
3890
3890
  // node goes through here, so the same runtime can drive something that is not
@@ -3898,6 +3898,14 @@ catch (e) {
3898
3898
  // branch swap, and nowhere near the line that caused it, which keeps the web path
3899
3899
  // exactly as it was: same calls, one property lookup earlier.
3900
3900
  var stxHost = window.__stx_host || {
3901
+ parent: function(node) { return node ? node.parentElement : null; },
3902
+ getAttribute: function(node, name) { return node && node.getAttribute ? node.getAttribute(name) : null; },
3903
+ observeChildren: function(node, callback) {
3904
+ var active = true;
3905
+ var observer = new MutationObserver(function() { if (active) callback(); });
3906
+ observer.observe(node, { childList: true, subtree: true });
3907
+ return function() { active = false; observer.disconnect(); };
3908
+ },
3901
3909
  setText: function(node, value) { node.textContent = value; },
3902
3910
  setMarkup: function(node, value) { node.innerHTML = value == null ? '' : value; },
3903
3911
  setAttribute: function(node, name, value) {
@@ -3916,7 +3924,50 @@ catch (e) {
3916
3924
  observer.observe(node, { attributes: true, attributeFilter: names });
3917
3925
  return function() { observer.disconnect(); };
3918
3926
  },
3919
- setStyle: function(node, value) {
3927
+ setStyle: function(node, value, replaceBinding) {
3928
+ // A binding owns its current keys, not the element's entire inline style.
3929
+ // Keep the original value and priority so removing a key restores them.
3930
+ if (replaceBinding) {
3931
+ var next = Object.create(null);
3932
+ var priorities = Object.create(null);
3933
+ if (typeof value === 'string') {
3934
+ var parsed = document.createElement('div').style;
3935
+ parsed.cssText = value;
3936
+ for (var i = 0; i < parsed.length; i++) {
3937
+ var property = parsed.item(i);
3938
+ next[property] = parsed.getPropertyValue(property);
3939
+ priorities[property] = parsed.getPropertyPriority(property);
3940
+ }
3941
+ }
3942
+ else if (value && typeof value === 'object' && !Array.isArray(value)) {
3943
+ Object.keys(value).forEach(function(key) {
3944
+ if (value[key] == null || value[key] === '') return;
3945
+ var name = key.indexOf('--') === 0 ? key : key.replace(/[A-Z]/g, function(c) { return '-' + c.toLowerCase(); });
3946
+ next[name] = value[key];
3947
+ });
3948
+ }
3949
+ var baseline = node.__stx_bound_style_baseline || (node.__stx_bound_style_baseline = Object.create(null));
3950
+ Object.keys(baseline).forEach(function(name) {
3951
+ if (Object.prototype.hasOwnProperty.call(next, name)) return;
3952
+ var prior = baseline[name];
3953
+ if (prior.value) node.style.setProperty(name, prior.value, prior.priority);
3954
+ else node.style.removeProperty(name);
3955
+ if (name === 'display') node.__stx_display = prior.value;
3956
+ delete baseline[name];
3957
+ });
3958
+ Object.keys(next).forEach(function(name) {
3959
+ if (!Object.prototype.hasOwnProperty.call(baseline, name)) {
3960
+ baseline[name] = {
3961
+ value: name === 'display' && node.__stx_visible === false ? node.__stx_display || '' : node.style.getPropertyValue(name),
3962
+ priority: node.style.getPropertyPriority(name)
3963
+ };
3964
+ }
3965
+ node.style.setProperty(name, next[name], priorities[name] || '');
3966
+ if (name === 'display') node.__stx_display = next[name];
3967
+ });
3968
+ if (node.__stx_visible === false) node.style.display = 'none';
3969
+ return;
3970
+ }
3920
3971
  if (typeof value === 'object' && value !== null) {
3921
3972
  Object.assign(node.style, value);
3922
3973
  if (Object.prototype.hasOwnProperty.call(value, 'display')) node.__stx_display = value.display || '';
@@ -5455,6 +5506,19 @@ else if (!value && isInserted) {
5455
5506
  var disposeEffects = trackEffects(function() {
5456
5507
  processFromManifest(root, scope, manifest, resolvedNodes);
5457
5508
  });
5509
+ // The manifest visits bindings, not every component. Static component
5510
+ // roots still own lifecycle hooks, and those hooks must see fully bound
5511
+ // props/refs. Detached conditional and loop sources must not mount.
5512
+ [root].concat(stxHost.descendants(root)).forEach(function(node) {
5513
+ if (!node || node.isConnected === false || !node.getAttribute || hasPendingLoopBoundary(node)) return;
5514
+ var scopeId = node.getAttribute('data-stx-scope');
5515
+ var local = scopeId && window.stx._scopes && window.stx._scopes[scopeId];
5516
+ if (!local || local.__mounted || local.__suspended) return;
5517
+ if (node.hasAttribute('stx-hydrate') && !node.__stx_hydrated) return;
5518
+ local.__el = node;
5519
+ local.__mounted = true;
5520
+ runMountCallbacks(local.__mountCallbacks || [], scopeDestroySink(local));
5521
+ });
5458
5522
  runMountCallbacks(localMountHooks, localDestroyHooks);
5459
5523
  var mounted = true;
5460
5524
  return function disposeHost() {
@@ -6204,6 +6268,19 @@ else {
6204
6268
 
6205
6269
  // Lock, listen and inert to match the stack after any change.
6206
6270
  function _overlaySync() {
6271
+ if (stxHost.isNative) {
6272
+ stxHost.syncOverlays(_overlays.map(function(entry) {
6273
+ return Object.assign({}, entry, { onRequestClose: function(event) {
6274
+ if (entry.onRequestClose) { entry.onRequestClose(event); return; }
6275
+ var reason = event && (event.reason || (event.nativeEvent && event.nativeEvent.reason));
6276
+ if (reason === 'backdrop') { if (entry.onBackdrop) entry.onBackdrop(); }
6277
+ else if (reason === 'back' || reason === 'escape') { if (entry.onEscape) entry.onEscape(); }
6278
+ else if (!!entry.onBackdrop === !!entry.onEscape) { if (entry.onEscape) entry.onEscape(); }
6279
+ else console.warn('[stx:overlays] Native dismissal was denied: this host must report reason=backdrop or reason=back to honor different closeOnBackdrop/closeOnEscape policies.');
6280
+ } });
6281
+ }));
6282
+ return;
6283
+ }
6207
6284
  for (var i = 0; i < _overlayInerted.length; i++) {
6208
6285
  try { _overlayInerted[i].inert = false; }
6209
6286
  catch (_e) { /* element may be gone */ }
@@ -6352,10 +6429,15 @@ else {
6352
6429
  var at = _overlayIndex(id);
6353
6430
  if (at !== -1) {
6354
6431
  var existing = _overlays[at];
6432
+ var updated = Object.assign({}, existing);
6355
6433
  for (var key in opts) {
6356
- if (Object.prototype.hasOwnProperty.call(opts, key)) existing[key] = opts[key];
6434
+ if (Object.prototype.hasOwnProperty.call(opts, key)) updated[key] = opts[key];
6357
6435
  }
6358
- _overlaySync();
6436
+ // A native presenter holds callbacks for the last accepted entry.
6437
+ // Do not mutate it until the replacement has passed host validation.
6438
+ _overlays[at] = updated;
6439
+ try { _overlaySync(); }
6440
+ catch (e) { _overlays[at] = existing; throw e; }
6359
6441
  return;
6360
6442
  }
6361
6443
  var isModal = opts.modal !== false;
@@ -6366,18 +6448,23 @@ else {
6366
6448
  root: opts.root || null,
6367
6449
  zIndex: typeof opts.zIndex === 'number' ? opts.zIndex : null,
6368
6450
  onEscape: opts.onEscape || null,
6451
+ onBackdrop: opts.onBackdrop || null,
6369
6452
  initialFocus: opts.initialFocus || null,
6370
6453
  // A popup hands focus back itself, to its own trigger, and only when
6371
6454
  // focus was inside it; a modal layer always does.
6372
6455
  restoreFocus: opts.restoreFocus !== undefined ? opts.restoreFocus !== false : isModal,
6373
- opener: opts.opener !== undefined ? opts.opener : document.activeElement
6456
+ opener: opts.opener !== undefined ? opts.opener : (stxHost.isNative ? null : document.activeElement),
6457
+ // Native Modal reports backdrop/back dismissal through the same host
6458
+ // event. Shared components supply the applicable dismissal policy.
6459
+ onRequestClose: opts.onRequestClose || null
6374
6460
  };
6375
6461
  _overlays.push(entry);
6376
- _overlaySync();
6462
+ try { _overlaySync(); }
6463
+ catch (e) { _overlays.splice(_overlays.indexOf(entry), 1); throw e; }
6377
6464
  // Synchronously first, so a caller that asserts focus straight after
6378
6465
  // opening sees it; then retried for a panel that is not displayed yet.
6379
6466
  // A popup keeps focus where its own keyboard handling puts it.
6380
- if (isModal || opts.initialFocus) _overlayFocusIn(entry, 10);
6467
+ if (!stxHost.isNative && (isModal || opts.initialFocus)) _overlayFocusIn(entry, 10);
6381
6468
  },
6382
6469
  /** Take an overlay off the stack, wherever it is in it. */
6383
6470
  close: function(id) {
@@ -6389,7 +6476,7 @@ else {
6389
6476
  // Only the overlay that had the keyboard gives it back. Closing one
6390
6477
  // underneath (its owner went away) must not pull focus out of the top.
6391
6478
  var opener = entry.opener;
6392
- if (wasTop && entry.restoreFocus && opener && opener.isConnected !== false && typeof opener.focus === 'function') {
6479
+ if (!stxHost.isNative && wasTop && entry.restoreFocus && opener && opener.isConnected !== false && typeof opener.focus === 'function') {
6393
6480
  try { opener.focus(); }
6394
6481
  catch (_e) { /* gone; nothing to give focus back to */ }
6395
6482
  }
@@ -7985,6 +8072,8 @@ catch (e) {
7985
8072
  ${t}
7986
8073
 
7987
8074
  _mountCallbacks: mountCallbacks,
8075
+ // Internal adapter for the shared component library, not a DOM facade.
8076
+ _host: stxHost,
7988
8077
  _destroyCallbacks: destroyCallbacks,
7989
8078
  _cleanupContainer: cleanupContainer,
7990
8079
  _flushLoad: flushStxLoad,
@@ -9261,7 +9350,7 @@ catch (e2) {
9261
9350
  effect(() => {
9262
9351
  if (isVisible && !isVisible()) return;
9263
9352
  const value = evalExpr();
9264
- stxHost.setStyle(el, value);
9353
+ stxHost.setStyle(el, value, true);
9265
9354
  });
9266
9355
  }
9267
9356
  `;var ft=` // <Suspense> boundary (#1742). Aggregates the loading/error state of every
@@ -10171,17 +10260,17 @@ else if (timer === null) {
10171
10260
  subscribe: subscribe
10172
10261
  };
10173
10262
  }
10174
- `;function Ne(){let t=xt(Zt());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function Zt(){return`${ae}${Me}
10263
+ `;function Me(){let t=xt(tn());try{let i=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t);return i=i.replace(/\}(var |let |const |function )/g,"};$1"),i}catch{return t}}function xt(t){let a=[],i=0,r="console.log(";while(i<t.length){let d=t.indexOf(r,i);if(d===-1){a.push(t.slice(i));break}a.push(t.slice(i,d));let y=1,o=d+r.length;while(o<t.length&&y>0){let u=t[o];if(u==='"'||u==="'"||u==="`"){let f=u;o++;while(o<t.length&&t[o]!==f){if(t[o]==="\\")o++;o++}o++;continue}if(u==="(")y++;else if(u===")")y--;o++}a.push("0"),i=o}return a.join("")}function tn(){return`${ae}${Oe}
10175
10264
  ${Je(ie,Se,Ee)}
10176
10265
 
10177
- ${Oe}
10266
+ ${Re}
10178
10267
  ${nt}
10179
10268
  ${et}
10180
10269
  ${dt}
10181
10270
  ${_e}
10182
10271
  ${He}
10183
10272
  ${bt}
10184
- ${Te(Q.toString(),Y.toString())}
10273
+ ${Ae(Q.toString(),Y.toString())}
10185
10274
  ${ot}
10186
10275
  ${We}
10187
10276
  ${Qe}
@@ -10192,13 +10281,13 @@ ${ze}
10192
10281
 
10193
10282
  ${ke}
10194
10283
  ${xe}
10195
- ${Ie}
10284
+ ${Ce}
10196
10285
  ${Ve}
10197
10286
  ${se}
10198
10287
  ${de}
10199
10288
  ${fe}
10200
10289
  ${Ke}
10201
- ${tt(Ki(),Xi(),Gi())}
10290
+ ${tt(ta(),na(),ea())}
10202
10291
 
10203
10292
  ${ft}
10204
10293
  ${it}
@@ -10209,7 +10298,7 @@ ${yt}
10209
10298
  ${Ue}
10210
10299
  ${ue}
10211
10300
  ${Be}
10212
- ${Ae}
10301
+ ${Te}
10213
10302
  ${qe}
10214
10303
  ${he}
10215
10304
  ${Le}
@@ -10224,7 +10313,7 @@ ${pt}
10224
10313
  ${je(Z.toString(),J.toString(),te.toString(),ee.toString(),ne.toString())}
10225
10314
  ${ge}
10226
10315
  ${oe(X.toString())}
10227
- ${Re}
10316
+ ${Ie}
10228
10317
  ${vt}
10229
10318
 
10230
10319
  ${Xe}
@@ -10239,7 +10328,7 @@ ${ut}
10239
10328
  ${$e}
10240
10329
  });
10241
10330
 
10242
- ${Ce}
10331
+ ${Ne}
10243
10332
  ${ye}
10244
10333
  ${be}
10245
10334
  ${st}
@@ -10249,5 +10338,5 @@ ${lt}
10249
10338
  ${ct}
10250
10339
  ${at}
10251
10340
  })();
10252
- `}var gu={state:W,derived:Qt,effect:en,batch:Gr,onMount:zn,onDestroy:Hn,isSignal:tn,isDerived:nn,untrack:Kr,peek:Un,generateSignalsRuntime:Ne,generateSignalsRuntimeDev:Zt};
10253
- export{Ne,Zt,gu};
10341
+ `}var xu={state:W,derived:nn,effect:rn,batch:es,onMount:Gn,onDestroy:Kn,isSignal:sn,isDerived:on,untrack:ts,peek:Xn,generateSignalsRuntime:Me,generateSignalsRuntimeDev:tn};
10342
+ export{Me,tn,xu};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hs,Vs,Us,Ws,mr,hr,bd,vd,wd,xd,yr,Sd}from"./chunk-91pdg853.js";import"./chunk-03xsf9jm.js";import"./chunk-qhr1tkhj.js";export{Sd as generateDefaultRobotsTxt,yr as generateRobotsTxt,vd as generateSitemap,wd as generateSitemapIndex,Ws as injectSeoTags,mr as metaDirective,Hs as processMetaDirectives,Us as processSeoDirective,Vs as processStructuredData,bd as registerSeoDirectives,xd as scanForSitemapEntries,hr as structuredDataDirective};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{u,$s,_i,Ei,Uc,Wc,qc,Gc,Kc,Xc,Ke,j,Xe,Jc,lr,Yc,Ai,Zc,Je,r,ur,Pi,g,ne,md}from"./chunk-3qmx12d3.js";import"./chunk-w24qmxc3.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-45x4myqe.js";import"./chunk-k1szsenr.js";import"./chunk-91pdg853.js";import"./chunk-03xsf9jm.js";import"./chunk-qhr1tkhj.js";import"./chunk-mmbspaqh.js";import"./chunk-c6egfhy6.js";import"./chunk-pxw4edw8.js";import"./chunk-82bttwqm.js";export{ne as clearComponentCache,Zc as componentClientSignalNames,$s as convertToCommonJS,g as createDetailedErrorMessage,Kc as extractDirectiveNames,_i as extractScriptFromTemplate,u as extractVariables,r as fileExists,md as getComponentCacheStats,Wc as getPositionInfo,j as getSharedTranspiler,Pi as getSourceLineInfo,Gc as hasDirectives,Ei as hasVariables,Yc as isHydrateTrigger,Xc as isJavaScriptScript,Je as renderComponentWithSlot,ur as resolveTemplatePath,Jc as scopeOnRootElement,Ke as shouldTranspileTypeScript,Ai as slotContentHasExpressions,Xe as transpileTypeScript,lr as userComponentFileExists,qc as validateDirective,Uc as validateTemplate};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{p,c}from"./chunk-dhq80e4r.js";import{b}from"./chunk-n4e02qdz.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(u);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:l,element:m}),e=s;else o.push({start:n,end:h,slotName:l,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let l=t.toLowerCase().indexOf(`</${u}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let m=y(t,s);if(m!==-1){let h=l[1]||l[2]||l[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:l[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function ba(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Pl(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function va(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((l)=>l.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return c(t,Object.keys(o))(...Object.values(o))}catch{return}}async function wa(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",l=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(l))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await va(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function Il(t){let o=ba(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Ol(t,o,i,r){return await wa(t,{default:o,named:i},r)}
3
- export{ba,Pl,va,wa,Il,Ol};
2
+ import{p,c}from"./chunk-qhr1tkhj.js";import{b}from"./chunk-3qmx12d3.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(u);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:l,element:m}),e=s;else o.push({start:n,end:h,slotName:l,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let l=t.toLowerCase().indexOf(`</${u}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let m=y(t,s);if(m!==-1){let h=l[1]||l[2]||l[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:l[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function _a(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function jl(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Ea(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((l)=>l.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return c(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Ta(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",l=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(l))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await Ea(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function Bl(t){let o=_a(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Fl(t,o,i,r){return await Ta(t,{default:o,named:i},r)}
3
+ export{_a,jl,Ea,Ta,Bl,Fl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B,F,z,Ut,Q,ie,Wn,Ca,De,mt,Wt,qt,Gt,H,Kt,Xt,qn}from"./chunk-048eyjyj.js";import"./chunk-7xw1e8t6.js";export{F as DEFAULT_FORMATS,z as DEFAULT_QUALITY,B as DEFAULT_WIDTHS,qn as ImageProcessingError,Xt as formatSize,mt as generateSizes,De as generateSrcSet,Wt as getFallbackVariant,Wn as getImageMetadata,H as getMimeType,Kt as getTotalSize,qt as groupVariantsByFormat,Q as isImageBackendAvailable,Gt as isImageFile,Ut as isSharpAvailable,ie as processImage,Ca as resizeAndConvert};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function fe(n,f){return m.run(n,f)}function It(){return m.getStore()}function ar(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function Ds(){return ar().public}function C(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function d(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ye(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+d(f)+s.slice(g)}
3
- export{fe,It,ar,Ds,C,Ye};
2
+ import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function fe(n,f){return m.run(n,f)}function Nt(){return m.getStore()}function gr(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function zs(){return gr().public}function C(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function d(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Ze(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+d(f)+s.slice(g)}
3
+ export{fe,Nt,gr,zs,C,Ze};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function Pi(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
3
- `)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function Ii(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await Is(m,e),{config:f,graph:m}}async function Is(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function or(e){return O(A(e))}function ir(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
4
- `)}function Oi(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
5
- export{Pi,Ii,Is,or,ir,Oi};
2
+ import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function ji(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
3
+ `)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function Bi(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await Bs(m,e),{config:f,graph:m}}async function Bs(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function pr(e){return O(A(e))}function fr(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
4
+ `)}function Fi(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
5
+ export{ji,Bi,Bs,pr,fr,Fi};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{N,de}from"./chunk-n4e02qdz.js";import{fe,C,Ye}from"./chunk-vkc51n9m.js";import{nt,Z,Ee}from"./chunk-x552npae.js";import{Oe,se,T,oe,So,Dr,ko,Bt}from"./chunk-je1as16r.js";import{ns}from"./chunk-nh3svtvj.js";import{Ft}from"./chunk-g9zeybqh.js";import K from"fs";import A from"path";var{serve:le}=globalThis.Bun;import F from"zlib";import{promisify as Q}from"util";var ee=Q(F.brotliCompress),te=Q(F.gzip),ne=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],re=["text/event-stream","multipart/x-mixed-replace"],ae=1024;function ie(t){if(!t)return!1;let e=t.toLowerCase();if(re.some((o)=>e.startsWith(o)))return!1;return ne.some((o)=>e.startsWith(o))}function ce(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function pe(t){if(!t)return null;let e=ce(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,H=new Map,U=0;function ue(t,e){if(e.length>Y/8)return;H.set(t,e),U+=e.length;for(let[o,r]of H){if(U<=Y)break;H.delete(o),U-=r.length}}async function Lt(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ie(e.headers.get("content-type")))return e;let r=pe(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(a.length<(o.threshold??ae))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=H.get(g);if(!l)l=r==="br"?await ee(a,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await te(a),ue(g,l);if(l.length>=a.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}class G{now;entries=new N(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",T(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${se(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await o();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let B=await s.clone().arrayBuffer();if(B.byteLength>1048576)return null;s.headers.set("Vary",T(s.headers.get("Vary")).Vary);let n={body:B,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return a();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let E=await v;return E?l(E):a()}}var me={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function ll(t={}){let e=A.resolve(t.outputDir||".output"),o=t.port??3000,r=So(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=Ft(r.routeRules),f=new G,h=ns(e,r.apiRoutes??[]),g=Bun.file(A.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?C(l):void 0,b=new Map,k=new Map,v=new Map,E=new Map;for(let n of r.routes)try{let y=A.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Ye(i.html,m);b.set(n.pattern,i),v.set(n.pattern,Ee(i.html)),E.set(n.pattern,de(i.html));let X=A.join(e,n.fragmentPath);if(await Bun.file(X).exists()){let M=await Bun.file(X).text();k.set(n.pattern,m?Ye(M,m):M)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=Z(n.pattern,{page:!0});S.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let B=le({port:o,async fetch(n){return Lt(n,await fe(m??C(),async()=>{let i=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[i])return t.apiRoutes[i](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=A.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=A.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${A.sep}`))try{if(K.existsSync(u)&&K.statSync(u).isFile()){let R=A.extname(u).toLowerCase(),L=me[R]||"application/octet-stream",_=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":L,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let M=se(n),w=null,q={};if(w=s.get(i)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let c=i.match(p);if(c){w=d,u.forEach((R,L)=>{q[R]=c[L+1]});break}}if(!w){let p=nt(i)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=a(i),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(M&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=k.get(w.pattern);if(c){let R=v.get(w.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...E.has(w.pattern)?{"X-STX-Runtime":E.get(w.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...T(),...O.cache?{}:{"Cache-Control":Oe}}})}}let d=Dr(n.method),u=b.get(w.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=b.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...T(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:L,cookies:_,status:I,headers:D}=await Bt(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(L)return ko(L,_,D);if(R&&R.length>0){let{renderStreamingPage:P,streamToResponse:z}=await import("./chunk-webrqm20.js"),j=new Headers({...T(),...D,"Cache-Control":"private, no-store"});for(let V of _??[])j.append("Set-Cookie",V);if(M&&!d){let V=Ee(c);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",de(c)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(P(M&&!d?oe(c,r.routerContainer||"main"):c,R,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let x=new Headers({"Content-Type":"text/html",...T(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of _??[])x.append("Set-Cookie",P);for(let[P,z]of Object.entries(D??{}))x.set(P,z);if(x.set("Vary",T(x.get("Vary")).Vary),M&&!d){let P=Ee(c);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",de(c)?"true":"false"),x.set("X-STX-Layout",P.layout),x.set("X-STX-Layout-Group",P.group),new Response(oe(c,r.routerContainer||"main"),{status:I??u.status??200,headers:x})}return new Response(c,{status:I??u.status??200,headers:x})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${B.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:B.port,stop:()=>{f.invalidate(),B.stop()},invalidate:(n)=>f.invalidate(n)}}
3
- export{Lt,ll};
2
+ import{M,de}from"./chunk-3qmx12d3.js";import{fe,C,Ze}from"./chunk-k1szsenr.js";import{rt,Z,Ee}from"./chunk-pxw4edw8.js";import{Oe,se,T,oe,Ro,zr,Ao,Ht}from"./chunk-076h7nb9.js";import{ls}from"./chunk-yhhfxx17.js";import{Vt}from"./chunk-9qsnq026.js";import K from"fs";import A from"path";var{serve:le}=globalThis.Bun;import F from"zlib";import{promisify as Q}from"util";var ee=Q(F.brotliCompress),te=Q(F.gzip),ne=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],re=["text/event-stream","multipart/x-mixed-replace"],ae=1024;function ie(t){if(!t)return!1;let e=t.toLowerCase();if(re.some((o)=>e.startsWith(o)))return!1;return ne.some((o)=>e.startsWith(o))}function ce(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function pe(t){if(!t)return null;let e=ce(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,H=new Map,U=0;function ue(t,e){if(e.length>Y/8)return;H.set(t,e),U+=e.length;for(let[o,r]of H){if(U<=Y)break;H.delete(o),U-=r.length}}async function Ft(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ie(e.headers.get("content-type")))return e;let r=pe(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(a.length<(o.threshold??ae))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=H.get(g);if(!l)l=r==="br"?await ee(a,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await te(a),ue(g,l);if(l.length>=a.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}class G{now;entries=new M(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",T(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${se(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await o();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let L=await s.clone().arrayBuffer();if(L.byteLength>1048576)return null;s.headers.set("Vary",T(s.headers.get("Vary")).Vary);let n={body:L,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return a();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let B=await v;return B?l(B):a()}}var me={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function hl(t={}){let e=A.resolve(t.outputDir||".output"),o=t.port??3000,r=Ro(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=Vt(r.routeRules),f=new G,h=ls(e,r.apiRoutes??[]),g=Bun.file(A.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?C(l):void 0,b=new Map,k=new Map,v=new Map,B=new Map;for(let n of r.routes)try{let y=A.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Ze(i.html,m);b.set(n.pattern,i),v.set(n.pattern,Ee(i.html)),B.set(n.pattern,de(i.html));let _=A.join(e,n.fragmentPath);if(await Bun.file(_).exists()){let E=await Bun.file(_).text();k.set(n.pattern,m?Ze(E,m):E)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=Z(n.pattern,{page:!0});S.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let L=le({port:o,async fetch(n){return Ft(n,await fe(m??C(),async()=>{let i=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[i])return t.apiRoutes[i](n);let _=await h(n);if(_)return _;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=A.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=A.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${A.sep}`))try{if(K.existsSync(u)&&K.statSync(u).isFile()){let R=A.extname(u).toLowerCase(),j=me[R]||"application/octet-stream",N=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":j,"Cache-Control":N?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let E=se(n),w=null,q={};if(w=s.get(i)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let c=i.match(p);if(c){w=d,u.forEach((R,j)=>{q[R]=c[j+1]});break}}if(!w){let p=rt(i)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=a(i),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(E&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=k.get(w.pattern);if(c){let R=v.get(w.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...B.has(w.pattern)?{"X-STX-Runtime":B.get(w.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...T(),...O.cache?{}:{"Cache-Control":Oe}}})}}let d=zr(n.method),u=b.get(w.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=b.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...T(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:j,cookies:N,status:I,headers:D}=await Ht(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(j)return Ao(j,N,D);if(R&&R.length>0){let{renderStreamingPage:P,streamToResponse:z}=await import("./chunk-bhg4pvtn.js"),X=new Headers({...T(),...D,"Cache-Control":"private, no-store"});for(let V of N??[])X.append("Set-Cookie",V);if(E&&!d){let V=Ee(c);X.set("X-STX-Fragment","true"),X.set("X-STX-Runtime",de(c)?"true":"false"),X.set("X-STX-Layout",V.layout),X.set("X-STX-Layout-Group",V.group)}return z(P(E&&!d?oe(c,r.routerContainer||"main"):c,R,{timeoutMs:30000}),{status:I??u.status??200,headers:X})}let x=new Headers({"Content-Type":"text/html",...T(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let P of N??[])x.append("Set-Cookie",P);for(let[P,z]of Object.entries(D??{}))x.set(P,z);if(x.set("Vary",T(x.get("Vary")).Vary),E&&!d){let P=Ee(c);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",de(c)?"true":"false"),x.set("X-STX-Layout",P.layout),x.set("X-STX-Layout-Group",P.group),new Response(oe(c,r.routerContainer||"main"),{status:I??u.status??200,headers:x})}return new Response(c,{status:I??u.status??200,headers:x})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${L.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:L.port,stop:()=>{f.invalidate(),L.stop()},invalidate:(n)=>f.invalidate(n)}}
3
+ export{Ft,hl};