@stacksjs/stx 0.2.838 → 0.2.840

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 (241) hide show
  1. package/dist/builtins/image-delivery.js +7 -3
  2. package/dist/chunk-02cntwd8.js +2 -0
  3. package/dist/chunk-03v59965.js +2 -0
  4. package/dist/chunk-07hvjvj1.js +2 -0
  5. package/dist/{chunk-gh62p9mx.js → chunk-11y84h2d.js} +2 -2
  6. package/dist/{chunk-3bjnrmha.js → chunk-1b1ntgt7.js} +2 -2
  7. package/dist/{chunk-z25w7kmr.js → chunk-1m16mvt4.js} +4 -4
  8. package/dist/{chunk-4ntm3dtk.js → chunk-23r3rby6.js} +2 -2
  9. package/dist/{chunk-ya6bp08c.js → chunk-2fj5zev7.js} +1 -1
  10. package/dist/{chunk-29f6vmyz.js → chunk-2j5yane9.js} +4 -4
  11. package/dist/chunk-2knr61g3.js +2 -0
  12. package/dist/chunk-2pgc087j.js +2 -0
  13. package/dist/chunk-2vprq4x0.js +54 -0
  14. package/dist/{chunk-ac9ncbfw.js → chunk-321e41ck.js} +3 -3
  15. package/dist/chunk-3gzhh69y.js +2 -0
  16. package/dist/chunk-40bkdswh.js +2 -0
  17. package/dist/chunk-41sh9y5w.js +2 -0
  18. package/dist/chunk-4654xm1h.js +2 -0
  19. package/dist/{chunk-amg6kr1p.js → chunk-4657mnht.js} +4 -4
  20. package/dist/{chunk-s33andzg.js → chunk-4dxq7ft1.js} +2 -2
  21. package/dist/chunk-4eagsz5d.js +2 -0
  22. package/dist/{chunk-f7jgda7x.js → chunk-4j08cbjd.js} +5 -5
  23. package/dist/chunk-4rswqcfc.js +2 -0
  24. package/dist/{chunk-tx8wk6h7.js → chunk-4y6hes3h.js} +2 -2
  25. package/dist/{chunk-6s3hgq9z.js → chunk-57x8wxdf.js} +32 -32
  26. package/dist/chunk-5khpy4na.js +2 -0
  27. package/dist/{chunk-5w0cf32p.js → chunk-5pbxjx8s.js} +1 -1
  28. package/dist/chunk-5t93dqft.js +2 -0
  29. package/dist/chunk-66eba1h4.js +2 -0
  30. package/dist/chunk-6efz68j8.js +2 -0
  31. package/dist/chunk-6n5kew7a.js +3 -0
  32. package/dist/chunk-6nb07mdj.js +2 -0
  33. package/dist/{chunk-2x9zhezb.js → chunk-6wrf6302.js} +2 -2
  34. package/dist/{chunk-1zxahmnh.js → chunk-7cg2f588.js} +1 -1
  35. package/dist/{chunk-nm26vnzd.js → chunk-7dnp8evg.js} +6 -6
  36. package/dist/chunk-7m0r7mq9.js +2 -0
  37. package/dist/{chunk-jstrmqna.js → chunk-7m53tpxn.js} +2 -2
  38. package/dist/{chunk-ckg6q98b.js → chunk-7t57cnz9.js} +5 -5
  39. package/dist/{chunk-jr0r5pzw.js → chunk-7vhm0jj5.js} +2 -2
  40. package/dist/{chunk-mvehmtap.js → chunk-7y5gz0cs.js} +14 -14
  41. package/dist/{chunk-vfj9wp11.js → chunk-8370x30n.js} +2 -2
  42. package/dist/{chunk-65tptp4x.js → chunk-88rwr1w2.js} +2 -2
  43. package/dist/{chunk-txd2js5v.js → chunk-89d3h8mp.js} +14 -14
  44. package/dist/chunk-8c363c2r.js +2 -0
  45. package/dist/{chunk-wfsa28e7.js → chunk-8d4br2j5.js} +9 -9
  46. package/dist/chunk-8gdtys3s.js +2 -0
  47. package/dist/{chunk-em8tv6nz.js → chunk-8pj4v1eh.js} +2 -2
  48. package/dist/{chunk-z0ynyz62.js → chunk-8qbp5skx.js} +7 -7
  49. package/dist/chunk-8w0n2rae.js +2 -0
  50. package/dist/{chunk-c3dg8qdn.js → chunk-97k72dfh.js} +2 -2
  51. package/dist/{chunk-d689fbv1.js → chunk-9razzga7.js} +6 -6
  52. package/dist/{chunk-s53wjw7y.js → chunk-9xps62ek.js} +2 -2
  53. package/dist/{chunk-52g026sc.js → chunk-a1s5wqw4.js} +2 -2
  54. package/dist/chunk-a2p42cxf.js +2 -0
  55. package/dist/{chunk-myje6fhm.js → chunk-a9tzjqny.js} +5 -5
  56. package/dist/{chunk-ax624h16.js → chunk-azderqyk.js} +7 -7
  57. package/dist/chunk-b0fkvrat.js +2 -0
  58. package/dist/chunk-b3fx75th.js +2 -0
  59. package/dist/{chunk-20mmryy5.js → chunk-b685aqy4.js} +3 -3
  60. package/dist/chunk-b6w3457c.js +2 -0
  61. package/dist/{chunk-j59js1nh.js → chunk-b90xw7v4.js} +3 -3
  62. package/dist/{chunk-fvgk1w9s.js → chunk-bp918end.js} +2 -2
  63. package/dist/chunk-bq7qcndg.js +3 -0
  64. package/dist/chunk-c18pafmf.js +3 -0
  65. package/dist/chunk-c87zgwzn.js +2 -0
  66. package/dist/{chunk-c9vxm8yq.js → chunk-ca3c5qx2.js} +31 -31
  67. package/dist/{chunk-3yggtch5.js → chunk-chjdnmqv.js} +10 -10
  68. package/dist/{chunk-bky02g7k.js → chunk-d0dzzpfx.js} +2 -2
  69. package/dist/chunk-d44g9sek.js +2 -0
  70. package/dist/chunk-d5vr9g4b.js +2 -0
  71. package/dist/{chunk-yw1s8kyj.js → chunk-dgn87554.js} +4 -4
  72. package/dist/{chunk-fzdgevxr.js → chunk-ebxz30e5.js} +56 -56
  73. package/dist/{chunk-11fn3hgv.js → chunk-ecjx9z8a.js} +2 -2
  74. package/dist/{chunk-33czswpt.js → chunk-f1hkagxk.js} +3 -3
  75. package/dist/chunk-fpn5txnm.js +2 -0
  76. package/dist/chunk-g6r2313a.js +2 -0
  77. package/dist/{chunk-55e46spy.js → chunk-g7rsd8st.js} +5 -5
  78. package/dist/chunk-g957a2m3.js +2 -0
  79. package/dist/chunk-ga8waz0a.js +2 -0
  80. package/dist/chunk-gaxx0z19.js +2 -0
  81. package/dist/chunk-gbcwna5q.js +2 -0
  82. package/dist/chunk-gft9pg9n.js +2 -0
  83. package/dist/chunk-h8h79939.js +2 -0
  84. package/dist/{chunk-q5pwvr98.js → chunk-jc5y35b7.js} +1 -1
  85. package/dist/chunk-jgx0ex9p.js +3 -0
  86. package/dist/{chunk-vfxkn1pe.js → chunk-kd6r7z27.js} +3 -3
  87. package/dist/chunk-ksc83y9t.js +2 -0
  88. package/dist/{chunk-gw83680k.js → chunk-kvpzxnww.js} +5 -5
  89. package/dist/{chunk-rnm8ejpz.js → chunk-m5bj2jnb.js} +2 -2
  90. package/dist/{chunk-ckasfph2.js → chunk-m7acbayx.js} +5 -5
  91. package/dist/chunk-mh4kpnjr.js +2 -0
  92. package/dist/{chunk-b7tb00nz.js → chunk-mhyd24bg.js} +2 -2
  93. package/dist/chunk-n7pvz99f.js +2 -0
  94. package/dist/chunk-ndah5rvs.js +2 -0
  95. package/dist/{chunk-n4qznmkm.js → chunk-ngnr831a.js} +5 -5
  96. package/dist/chunk-nhk0aat9.js +2 -0
  97. package/dist/{chunk-t2vmk8tf.js → chunk-ns0171xk.js} +3 -3
  98. package/dist/chunk-p2e02hh7.js +2 -0
  99. package/dist/{chunk-cwfavkk0.js → chunk-p65ax8s0.js} +2 -2
  100. package/dist/{chunk-dv11h4f0.js → chunk-p9d2txcg.js} +1 -1
  101. package/dist/chunk-pjkdn8zf.js +2 -0
  102. package/dist/{chunk-pft65534.js → chunk-pqn7r8fw.js} +1 -1
  103. package/dist/{chunk-29bt1fbn.js → chunk-px5kda00.js} +5 -5
  104. package/dist/{chunk-xtqapjz3.js → chunk-q0s0kc66.js} +2 -2
  105. package/dist/{chunk-b1m41fwr.js → chunk-q1nj47gn.js} +3 -3
  106. package/dist/chunk-q88w2rv9.js +2 -0
  107. package/dist/chunk-qb3c05qq.js +2 -0
  108. package/dist/chunk-qcars8ar.js +2 -0
  109. package/dist/{chunk-v3xyb3ws.js → chunk-qfvddpcg.js} +2 -2
  110. package/dist/{chunk-e75dntfb.js → chunk-qk079ca7.js} +2 -2
  111. package/dist/{chunk-zj4s3rnw.js → chunk-qzms4d8s.js} +5 -5
  112. package/dist/chunk-r5bhgyes.js +2 -0
  113. package/dist/{chunk-64eeb5p5.js → chunk-rb17ssxh.js} +2 -2
  114. package/dist/{chunk-7bvvv74e.js → chunk-rk2ex6qx.js} +3 -3
  115. package/dist/chunk-rmc6dfj4.js +2 -0
  116. package/dist/chunk-rzfbffnv.js +2 -0
  117. package/dist/{chunk-r32q8mjw.js → chunk-s2k1x2rn.js} +3 -3
  118. package/dist/chunk-spdh99jy.js +2 -0
  119. package/dist/chunk-st75663x.js +2 -0
  120. package/dist/chunk-sv2d6nfe.js +2 -0
  121. package/dist/{chunk-7k9yahng.js → chunk-t0jed809.js} +6 -6
  122. package/dist/{chunk-s5dhvnnd.js → chunk-t3p0jy0s.js} +6 -6
  123. package/dist/{chunk-f49x34sr.js → chunk-v3q126ys.js} +2 -2
  124. package/dist/{chunk-kw5gra2z.js → chunk-v4ybemgb.js} +2 -2
  125. package/dist/{chunk-trwe0mfa.js → chunk-vbw9jhz2.js} +103 -103
  126. package/dist/chunk-vcx6dy59.js +2 -0
  127. package/dist/chunk-vv7b8p5z.js +2 -0
  128. package/dist/{chunk-wzjdq7d6.js → chunk-vwddsdk5.js} +9 -9
  129. package/dist/{chunk-vyv76w55.js → chunk-wbgc2n04.js} +2 -2
  130. package/dist/chunk-x0ygwk9x.js +2 -0
  131. package/dist/{chunk-nyg0nbjj.js → chunk-x110ssw2.js} +3 -3
  132. package/dist/chunk-x42tsdbx.js +2 -0
  133. package/dist/{chunk-sfsek961.js → chunk-x4f7efgp.js} +3 -3
  134. package/dist/chunk-x5wkbcsf.js +2 -0
  135. package/dist/{chunk-w0a6yz73.js → chunk-xbcnnk8x.js} +5 -5
  136. package/dist/{chunk-38ncpvww.js → chunk-xdzy4pm0.js} +2 -2
  137. package/dist/{chunk-84nw3921.js → chunk-xmsf1bnx.js} +3 -3
  138. package/dist/{chunk-4sv740a5.js → chunk-xqtt5t6d.js} +6 -6
  139. package/dist/{chunk-nmvhktsg.js → chunk-xz2569ra.js} +6 -6
  140. package/dist/chunk-y64qhgv1.js +2 -0
  141. package/dist/{chunk-52t0qpx6.js → chunk-y68xstqy.js} +1 -1
  142. package/dist/{chunk-evgghnjc.js → chunk-y8zzvzww.js} +4 -4
  143. package/dist/chunk-yg5a54pj.js +2 -0
  144. package/dist/chunk-yjskeqaj.js +2 -0
  145. package/dist/chunk-ywpan1k5.js +2 -0
  146. package/dist/chunk-yxqzarzh.js +2 -0
  147. package/dist/chunk-z4g64re8.js +3 -0
  148. package/dist/chunk-z9xjhc5m.js +42 -0
  149. package/dist/{chunk-ms3v5nat.js → chunk-zg44cf8a.js} +7 -7
  150. package/dist/{chunk-s6r54dyf.js → chunk-zjqvbcwa.js} +2 -2
  151. package/dist/chunk-znwc8gta.js +2 -0
  152. package/dist/{chunk-917v0bar.js → chunk-zrp4159x.js} +12 -12
  153. package/dist/{chunk-0rvntfhj.js → chunk-zvy88beh.js} +3 -3
  154. package/dist/cli.js +20 -20
  155. package/dist/compression.js +3 -3
  156. package/dist/craft-entry.js +2 -2
  157. package/dist/craft.js +2 -2
  158. package/dist/dev-server/port-utils.js +2 -1
  159. package/dist/expressions.js +1 -1
  160. package/dist/html-masking.d.ts +2 -0
  161. package/dist/html-masking.js +23 -0
  162. package/dist/image-optimization/processor.js +2 -2
  163. package/dist/includes.js +5 -4
  164. package/dist/misc-directives.js +2 -2
  165. package/dist/native/runtime/craft-bridge.js +2 -10
  166. package/dist/native/runtime/craft.d.ts +11 -0
  167. package/dist/native/runtime/navigation-chrome.d.ts +2 -0
  168. package/dist/native/runtime/navigation-chrome.js +25 -3
  169. package/dist/pwa.js +3 -3
  170. package/dist/ssg.js +8 -11
  171. package/dist/utils.js +16 -13
  172. package/package.json +5 -5
  173. package/dist/chunk-0a36jnq4.js +0 -2
  174. package/dist/chunk-0c02182b.js +0 -42
  175. package/dist/chunk-0rnfywsx.js +0 -2
  176. package/dist/chunk-1bpx9b0m.js +0 -2
  177. package/dist/chunk-1g6xxftp.js +0 -2
  178. package/dist/chunk-2fcg7aws.js +0 -2
  179. package/dist/chunk-2nxxhcyy.js +0 -2
  180. package/dist/chunk-4wgfqa56.js +0 -2
  181. package/dist/chunk-5p6x0ztt.js +0 -2
  182. package/dist/chunk-6aak0b7c.js +0 -2
  183. package/dist/chunk-6c6m6p9t.js +0 -3
  184. package/dist/chunk-6g8byhwn.js +0 -2
  185. package/dist/chunk-70akxpk5.js +0 -2
  186. package/dist/chunk-72gq0ywg.js +0 -2
  187. package/dist/chunk-72n804gy.js +0 -2
  188. package/dist/chunk-7efkc3gk.js +0 -2
  189. package/dist/chunk-88zc5chj.js +0 -2
  190. package/dist/chunk-8gg8gn87.js +0 -2
  191. package/dist/chunk-8wv2p899.js +0 -2
  192. package/dist/chunk-9w3r1ch2.js +0 -3
  193. package/dist/chunk-a1hxz8q4.js +0 -2
  194. package/dist/chunk-a579jdwb.js +0 -2
  195. package/dist/chunk-ahd8jdzx.js +0 -2
  196. package/dist/chunk-aqrx322x.js +0 -2
  197. package/dist/chunk-ay7ggc4k.js +0 -2
  198. package/dist/chunk-bc4x45vx.js +0 -2
  199. package/dist/chunk-c77vxvp3.js +0 -2
  200. package/dist/chunk-c7hw37ww.js +0 -2
  201. package/dist/chunk-cfrgrnej.js +0 -2
  202. package/dist/chunk-cw8vpk41.js +0 -2
  203. package/dist/chunk-d96b9qgj.js +0 -2
  204. package/dist/chunk-db1c0c3c.js +0 -2
  205. package/dist/chunk-f6vzn90z.js +0 -2
  206. package/dist/chunk-fd3815fe.js +0 -2
  207. package/dist/chunk-gtj8wy95.js +0 -2
  208. package/dist/chunk-h4tbpr7p.js +0 -2
  209. package/dist/chunk-h5aaq0j8.js +0 -2
  210. package/dist/chunk-j0j4p9t1.js +0 -2
  211. package/dist/chunk-j0w048sj.js +0 -2
  212. package/dist/chunk-jvg9e6t6.js +0 -2
  213. package/dist/chunk-k761q7s7.js +0 -2
  214. package/dist/chunk-m3tnxk01.js +0 -2
  215. package/dist/chunk-mdtysd2d.js +0 -2
  216. package/dist/chunk-nmtya57z.js +0 -3
  217. package/dist/chunk-nxfyjw59.js +0 -2
  218. package/dist/chunk-pe5qqem0.js +0 -2
  219. package/dist/chunk-pwv77cyb.js +0 -2
  220. package/dist/chunk-qs0vtav5.js +0 -2
  221. package/dist/chunk-qv21bsa1.js +0 -2
  222. package/dist/chunk-rrba4t7k.js +0 -2
  223. package/dist/chunk-s3j5vxy9.js +0 -3
  224. package/dist/chunk-ssrxqj55.js +0 -2
  225. package/dist/chunk-t612xpa4.js +0 -2
  226. package/dist/chunk-tesbhpbp.js +0 -2
  227. package/dist/chunk-tkgkdf93.js +0 -2
  228. package/dist/chunk-tvw571ab.js +0 -2
  229. package/dist/chunk-txzap6yn.js +0 -2
  230. package/dist/chunk-vhrq4xjf.js +0 -2
  231. package/dist/chunk-vqpypnys.js +0 -2
  232. package/dist/chunk-vv3w8z4v.js +0 -2
  233. package/dist/chunk-vypnjn9g.js +0 -3
  234. package/dist/chunk-w39cfxa6.js +0 -2
  235. package/dist/chunk-wj937ceq.js +0 -2
  236. package/dist/chunk-xbavxkm5.js +0 -2
  237. package/dist/chunk-xrspzeqx.js +0 -2
  238. package/dist/chunk-y41hhypj.js +0 -2
  239. package/dist/chunk-yv9589qr.js +0 -54
  240. package/dist/chunk-z0yq548d.js +0 -2
  241. package/dist/chunk-zfjbwp54.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,l}from"./chunk-txd2js5v.js";import{r,vn,h}from"./chunk-trwe0mfa.js";import{nt}from"./chunk-29f6vmyz.js";import{Cs,Es}from"./chunk-ms3v5nat.js";import{kc,Qo,ks,_s}from"./chunk-amg6kr1p.js";import{vc,xc}from"./chunk-t2vmk8tf.js";import{St}from"./chunk-b1q40vq4.js";import{dn,Rc,hr,yr}from"./chunk-9w3r1ch2.js";import{g}from"./chunk-0dve54ne.js";import{no}from"./chunk-52g026sc.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Bt}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,n={}){let{duration:i,delay:o,ease:s,direction:c,custom:d}={...B,...n};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
2
+ import{t,l}from"./chunk-89d3h8mp.js";import{r,xn,h}from"./chunk-vbw9jhz2.js";import{nt}from"./chunk-2j5yane9.js";import{Es,Ts}from"./chunk-zg44cf8a.js";import{_c,ei,_s,Cs}from"./chunk-4657mnht.js";import{xc,Sc}from"./chunk-ns0171xk.js";import{St}from"./chunk-b1q40vq4.js";import{pn,Ac,yr,br}from"./chunk-z4g64re8.js";import{g}from"./chunk-0dve54ne.js";import{ro}from"./chunk-a1s5wqw4.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Bt}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,n={}){let{duration:i,delay:o,ease:s,direction:c,custom:d}={...B,...n};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
3
3
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
4
4
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
5
5
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -234,7 +234,7 @@ else {
234
234
  </script>
235
235
  `}var Pe={name:"transition",handler:(e,n,i,o)=>{if(n.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let s=n[0],c=n.length>1?Number.parseInt(n[1],10)||B.duration:B.duration,d=n.length>2?n[2]||B.ease:B.ease,p=n.length>3?Number.parseInt(n[3],10)||B.delay:B.delay,u=n.length>4?n[4]||B.direction:B.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(s,{duration:c,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(s==="fade")v="stx-fade";else if(s==="slide")v="stx-slide";else if(s==="scale")v="stx-scale";else if(s==="flip")v="stx-flip";else if(s==="rotate")v="stx-rotate";return`<div id="${m}" class="${f} ${v} ${u==="out"?"stx-out":""}"
236
236
  style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},ke={name:"scrollAnimate",handler:(e,n,i,o)=>{if(n.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let s=n[0],c=n.length>1?Number.parseInt(n[1],10)||300:300,d=n.length>2?n[2]||"ease":"ease",p=n.length>3?Number.parseFloat(n[3])||0.2:0.2,u=n.length>4?Number.parseInt(n[4],10)||0:0,m=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,f="stx-transition stx-observe stx-out";if(s==="fade")f+=" stx-fade";else if(s==="slide-up"||s==="slide")f+=" stx-from-bottom";else if(s==="slide-down")f+=" stx-from-top";else if(s==="slide-left")f+=" stx-from-right";else if(s==="slide-right")f+=" stx-from-left";else if(s==="scale")f+=" stx-scale";else if(s.includes("-"))f+=` stx-${s}`;else f+=` stx-${s}`;return`<div id="${m}" class="${f}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Ae={name:"animationGroup",handler:(e,n,i,o)=>{if(n.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let s=n[0],c=n.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(s,c,{staggerDelay:d,sequence:p});return`${e}
237
- ${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,n,i,o)=>{let s=n.length>0?n[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function gc(e,n,i,o){let s=e;if(o.animation?.enabled===!1)return s;let c=i.includes("test")&&i.includes("animation");if(!ot(s)&&!c)return s;if(!s.includes('<style id="stx-animation-base">')){let p=ct();s=s.replace("</head>",`${p}
237
+ ${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,n,i,o)=>{let s=n.length>0?n[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function mc(e,n,i,o){let s=e;if(o.animation?.enabled===!1)return s;let c=i.includes("test")&&i.includes("animation");if(!ot(s)&&!c)return s;if(!s.includes('<style id="stx-animation-base">')){let p=ct();s=s.replace("</head>",`${p}
238
238
  </head>`)}if(s.includes("stx-observe")){if(!s.includes("Intersection Observer for scroll animations")){let u=lt(),m=s.lastIndexOf("</body>");if(m!==-1)s=s.slice(0,m)+u+`
239
239
  `+s.slice(m)}}return s}async function ut(e,n,i,o){let s=n[0]?.replace(/['"]/g,"")||"main",c=nt();if(s!=="main")c=c.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Oe(e){let n=e.heatmap;if(!n?.enabled)return"";let i={...pt,...n};return`
240
240
  <!-- stx Heatmap - Privacy-Compliant Tracking -->
@@ -619,7 +619,7 @@ else {
619
619
  };
620
620
  })();
621
621
  </script>
622
- `}function mc(e,n){let i=Oe(n);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,n,i,o)=>{let s=i.__stx_config||{};if(n.length>0){let c=mt(n.join(" "));s.heatmap={...s.heatmap,...c,enabled:!0}}return Oe(s)}};function mt(e){let n={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[s,c]=o.split("="),d=c?.replace(/["']/g,"");switch(s){case"endpoint":n.endpoint=d;break;case"samplingRate":n.samplingRate=Number.parseInt(d,10);break;case"batchSize":n.batchSize=Number.parseInt(d,10);break;case"trackMouse":n.trackMouse=d==="true";break;case"trackClicks":n.trackClicks=d==="true";break;case"trackScroll":n.trackScroll=d==="true";break;case"honorDnt":n.honorDnt=d==="true";break;case"debugOverlay":n.debugOverlay=d==="true";break}}return n}function J(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ie(e){let n=e.trim().toLowerCase();return!n.startsWith("javascript:")&&!n.startsWith("vbscript:")&&!n.startsWith("data:text/html")}function pr(e){let n=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(n);if(!i)return{data:{},content:e.trim()};let o=i[1],s=e.slice(i[0].length),c={};for(let d of o.split(`
622
+ `}function hc(e,n){let i=Oe(n);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,n,i,o)=>{let s=i.__stx_config||{};if(n.length>0){let c=mt(n.join(" "));s.heatmap={...s.heatmap,...c,enabled:!0}}return Oe(s)}};function mt(e){let n={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[s,c]=o.split("="),d=c?.replace(/["']/g,"");switch(s){case"endpoint":n.endpoint=d;break;case"samplingRate":n.samplingRate=Number.parseInt(d,10);break;case"batchSize":n.batchSize=Number.parseInt(d,10);break;case"trackMouse":n.trackMouse=d==="true";break;case"trackClicks":n.trackClicks=d==="true";break;case"trackScroll":n.trackScroll=d==="true";break;case"honorDnt":n.honorDnt=d==="true";break;case"debugOverlay":n.debugOverlay=d==="true";break}}return n}function J(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ie(e){let n=e.trim().toLowerCase();return!n.startsWith("javascript:")&&!n.startsWith("vbscript:")&&!n.startsWith("data:text/html")}function fr(e){let n=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(n);if(!i)return{data:{},content:e.trim()};let o=i[1],s=e.slice(i[0].length),c={};for(let d of o.split(`
623
623
  `)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[m]=y}return{data:c,content:s.trim()}}function et(e,n={}){let{gfm:i=!0,breaks:o=!1}=n,s=e,c=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=c.length,x=f?` class="language-${J(f)}"`:"";return c.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),s=s.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),s=s.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),s=s.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),s=s.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),s=s.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),s=s.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),s=s.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),s=s.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),s=s.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/__(.+?)__/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)s=s.replace(/~~(.+?)~~/g,"<del>$1</del>");if(s=s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ie(v)?J(v):""}" alt="${J(f)}" />`),s=s.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(v)?J(v):""}">${f}</a>`),s=s.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),s=s.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),s=s.replace(/<\/blockquote>\n<blockquote>/g,`
624
624
  `),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),i)s=s.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,f,v)=>{let x=`<tr>${f.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,P=v.trim().split(`
625
625
  `).map((S)=>`<tr>${S.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<td>${J(k)}</td>`).join("")}</tr>`).join(`
@@ -637,7 +637,7 @@ ${P}
637
637
  `:`
638
638
  `)}</p>`);if(s=p.join(`
639
639
  `),o)s=s.replace(/\n/g,`<br />
640
- `);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function hc(e,n,i=""){let o=e,s=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let S=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==p){let k=e[S+9];if(k==="("||k===`
640
+ `);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function yc(e,n,i=""){let o=e,s=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let S=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==p){let k=e[S+9];if(k==="("||k===`
641
641
  `||k==="\r"||k===" "||k===void 0)f++;v=S+9}else{if(f--,f===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(p,b+12);s.push({fullMatch:P,options:m,content:x,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:m,index:y}of s)try{let f={};if(u)u.split(",").forEach((x)=>{let P=x.trim();if(P)f[P]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=et(m.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=h("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Te(e,n,i,o){let s={gfm:!0,breaks:!1};return n.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),et(e.trim(),s)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,n=Z,i={},o){return n.sort((s,c)=>s-c).map((s)=>`${re(e,{...i,w:s,fm:o})} ${s}w`).join(", ")}function Me(e,n,i=gt,o={},s){return i.sort((c,d)=>c-d).map((c)=>{let d=Math.round(n*c);return`${re(e,{...o,w:d,dpr:c,fm:s})} ${c}x`}).join(", ")}function ge(e,n="100vw"){if(!e||Object.keys(e).length===0)return n;let o=Object.entries(e).map(([s,c])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((s,c)=>s.numericBp-c.numericBp).map(({bp:s,size:c})=>`(max-width: ${s}) ${c}`);return o.push(n),o.join(", ")}function re(e,n={}){let i=Object.entries(n).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(i.length===0)return e;let o=i.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),s=e.includes("?")?"&":"?";return`${e}${s}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
642
642
  .stx-img-placeholder {
643
643
  position: relative;
@@ -684,7 +684,7 @@ ${P}
684
684
  #${e}.stx-img-loaded img {
685
685
  opacity: 1;
686
686
  }
687
- `.trim()}var he=new Map;async function Ne(e,n={}){let i=`${e}:${JSON.stringify(n)}`;if(he.has(i))return he.get(i);let o=await vt(e,n);return he.set(i,o),o}async function wt(){try{return await import("./chunk-0a36jnq4.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,n={}){let i=n,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,n);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,n);let{src:s,alt:c,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:z}=e,{class:L,style:T,id:N}=e,_=e.data||{},{isDev:V=!1,baseUrl:G=""}=n;if(V&&!n.optimize)return Dt(e);let W,R,H=N||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{W=await Ne(s,{strategy:x,...P}),R=je(H,W,P)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,W,n);else X=await $t(e,H,W,n);let ee;if(A){let De=f.includes("webp")?"webp":f[0],rt=me(s,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let tt=S?We(H):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
687
+ `.trim()}var he=new Map;async function Ne(e,n={}){let i=`${e}:${JSON.stringify(n)}`;if(he.has(i))return he.get(i);let o=await vt(e,n);return he.set(i,o),o}async function wt(){try{return await import("./chunk-2pgc087j.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,n={}){let i=n,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,n);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,n);let{src:s,alt:c,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:z}=e,{class:L,style:T,id:N}=e,_=e.data||{},{isDev:V=!1,baseUrl:G=""}=n;if(V&&!n.optimize)return Dt(e);let W,R,H=N||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{W=await Ne(s,{strategy:x,...P}),R=je(H,W,P)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,W,n);else X=await $t(e,H,W,n);let ee;if(A){let De=f.includes("webp")?"webp":f[0],rt=me(s,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let tt=S?We(H):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
688
688
  `):void 0,script:tt}}async function $t(e,n,i,o){let{src:s,alt:c,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:x=!1,loading:P=x?"eager":ce,decoding:S=le,fetchpriority:A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,z=e.data||{},L=typeof u==="object"?ge(u):u||"100vw",T=[];for(let V of y){let G=me(s,m,{...v,q:f},V),W=fe(V);if(b&&!x)T.push(` <source type="${W}" data-srcset="${G}" data-sizes="${L}" />`);else T.push(` <source type="${W}" srcset="${G}" sizes="${L}" />`)}let N=be({src:re(s,{...v,q:f}),alt:c,width:d,height:p,loading:x?void 0:P,decoding:S,fetchpriority:x?"high":A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w,className:Le(C,i),style:xe(D,k,E,i),lazy:b&&!x,data:z}),_;if(i){let V=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${n}" class="stx-img-placeholder" style="${V}">
689
689
  <picture>
690
690
  ${T.join(`
@@ -748,7 +748,7 @@ ${w.join(`
748
748
  `):void 0,script:G}}async function Fe(e,n,i){let o={src:n.src,processed:!0,variants:[],placeholder:n.placeholder?.dataURL,originalWidth:n.placeholder?.width,originalHeight:n.placeholder?.height};for(let[s,c]of Object.entries(n.byFormat))if(c)o.variants.push(...c);return we(e,o,i)}function kt(){return St({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,n,i,o)=>{let{src:s,alt:c,options:d}=At(e,n,i);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:s,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=i.__isDev||!1,m=await oe(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
749
749
  `+y;if(m.css)y+=`
750
750
  <style>${m.css}</style>`;if(m.script)y+=`
751
- <script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,n,i){if(n.src)return{src:String(n.src),alt:String(n.alt||""),options:n.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=_t(o),c=$e(s[0],i)||"",d=$e(s[1],i)||"",p={};if(s[2]){let u=$e(s[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof s[2]==="string")try{p=JSON.parse(s[2])}catch{}}return{src:c,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function $e(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function xs(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let n of e)if(Rt(ne.join(n,"View.stx")))return n;return e[0]}async function Ue(){try{return await import("./chunk-a579jdwb.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,n={}){let i=n,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,n);let s;if(o.generatePoster&&o.src&&!e.poster)s=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||p,{class:z,style:L}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,n);if(A&&A!=="video")return Et(c||"",A,e);let N=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${T}"`];if(m)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(E)_.push(`height="${E}"`);if(z)_.push(`class="${M(z)}"`);if(L)_.push(`style="${M(L)}"`);let V=N.map((R)=>` <source ${P?`data-src="${M(R.src)}"`:`src="${M(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
751
+ <script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,n,i){if(n.src)return{src:String(n.src),alt:String(n.alt||""),options:n.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=_t(o),c=$e(s[0],i)||"",d=$e(s[1],i)||"",p={};if(s[2]){let u=$e(s[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof s[2]==="string")try{p=JSON.parse(s[2])}catch{}}return{src:c,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function $e(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function Ss(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let n of e)if(Rt(ne.join(n,"View.stx")))return n;return e[0]}async function Ue(){try{return await import("./chunk-4654xm1h.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,n={}){let i=n,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,n);let s;if(o.generatePoster&&o.src&&!e.poster)s=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||p,{class:z,style:L}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,n);if(A&&A!=="video")return Et(c||"",A,e);let N=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${T}"`];if(m)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(E)_.push(`height="${E}"`);if(z)_.push(`class="${M(z)}"`);if(L)_.push(`style="${M(L)}"`);let V=N.map((R)=>` <source ${P?`data-src="${M(R.src)}"`:`src="${M(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
752
752
  `),G=`<video ${_.join(" ")}>
753
753
  ${V}
754
754
  Your browser does not support the video tag.
@@ -1007,7 +1007,7 @@ ${N}
1007
1007
  }
1008
1008
  `.trim();return{html:N,script:_,css:V}}function Ye(){return St({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,n,i,o)=>{let{src:s,options:c}=Vt(e,n,i);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,poster:c.poster,controls:c.controls!==!1,autoplay:c.autoplay||!1,muted:c.muted||!1,loop:c.loop||!1,preload:c.preload||"metadata",playsinline:c.playsinline!==!1,lazy:c.lazy!==!1,player:c.player||"native",type:c.type,width:c.width,height:c.height,class:c.class,style:c.style,id:c.id,crossorigin:c.crossorigin,disablePictureInPicture:c.disablePictureInPicture,disableRemotePlayback:c.disableRemotePlayback,title:c.title,quality:c.quality,platform:c.platform,process:c.process,generatePoster:c.generatePoster,streaming:c.streaming,transcode:c.transcode,spriteSheet:c.spriteSheet,waveform:c.waveform},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await de(d,u),y=m.html;if(m.css)y+=`
1009
1009
  <style>${m.css}</style>`;if(m.script)y+=`
1010
- <script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,n,i){if(n.src)return{src:String(n.src),options:n.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=zt(o),c=Xe(s[0],i)||"",d={};if(s[1]){let p=Xe(s[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:c,options:d}}function zt(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function Xe(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import q from"path";async function Ss(e,n){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let s of i)try{let c=await Wt(s,e,n);if(c)o.push(c)}catch(c){if(console.error(`Error building web component ${s.name}:`,c),e.debug)throw c}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:c,extends:d}=e;if(!o||!s||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(s)&&await r(s))p=s;else if(n.componentsDir){let P=q.join(n.componentsDir,s);if(await r(P))p=P}if(!p)p=await vn(s,process.cwd(),n,i);if(!p)return console.error(`Web component source file not found: ${s}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?qt({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Ft({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=n.webComponents?.outputDir||"dist/web-components";await Lt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${c}.${b}`);if(await Bun.write(x,f),n.debug)console.log(`Built web component ${o} -> ${x}`);return x}function Ft(e){let{name:n,tag:i,baseElement:o="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:p,attributes:u=[]}=e,m=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
1010
+ <script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,n,i){if(n.src)return{src:String(n.src),options:n.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=zt(o),c=Xe(s[0],i)||"",d={};if(s[1]){let p=Xe(s[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:c,options:d}}function zt(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function Xe(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import q from"path";async function ks(e,n){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let s of i)try{let c=await Wt(s,e,n);if(c)o.push(c)}catch(c){if(console.error(`Error building web component ${s.name}:`,c),e.debug)throw c}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:c,extends:d}=e;if(!o||!s||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(s)&&await r(s))p=s;else if(n.componentsDir){let P=q.join(n.componentsDir,s);if(await r(P))p=P}if(!p)p=await xn(s,process.cwd(),n,i);if(!p)return console.error(`Web component source file not found: ${s}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?qt({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Ft({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=n.webComponents?.outputDir||"dist/web-components";await Lt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${c}.${b}`);if(await Bun.write(x,f),n.debug)console.log(`Built web component ${o} -> ${x}`);return x}function Ft(e){let{name:n,tag:i,baseElement:o="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:p,attributes:u=[]}=e,m=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
1011
1011
  * ${n} Web Component
1012
1012
  * Auto-generated from stx component
1013
1013
  */
@@ -1307,6 +1307,6 @@ ${y}
1307
1307
  customElements.define('${n}', ${d});
1308
1308
  `}async function Ze(e,n,i,o){if(n.length<1)return l("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=n[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(o),`${s}.stx`)]:[q.join(q.dirname(o),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(o),`${s}.stx`)],u=null;for(let f of p)if(await r(f)){u=await Bun.file(f).text();break}if(!u)return l("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,s);return`<script type="module">
1309
1309
  ${Ut(m)}
1310
- </script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:dn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},vc,xc,Cs,Es,Pe,Ae,_e,ke,Re,Ee,qe,Se,...no],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,n,i){let o=n||"pages";if(e)return{root:e,pagesDir:o};let s=i||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,n){let i=n.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return o===s||o.startsWith(`${s}/`)}function Vf(e,n){let i=!e.root,o=Jt(e.root,e.pagesDir,n);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let s=`${n}::${o.root}`;if(!Qe.has(s))Qe.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let s={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Kt(d,s))continue;e[c]=j.join(s,d)}}for(let s of pe){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(n,c)}return e}function Gt(e,n){let i=Ce.get(e);for(let o of pe){let s=e[o];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(n,s);if(Q.existsSync(c))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Rc(e.stateDir),e.stateDir=hr(),e.cachePath=yr(e.cachePath),e.build)e.build.cacheDir=yr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=yr(e.media.cache.directory);if(e.story)e.story.outDir=yr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Yo(e,n=Bt){try{return await n(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let n=e?j.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==ks(i.graph)){let c=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-70akxpk5.js"),{partialsCache:p}=await import("./chunk-h5aaq0j8.js");if(d(),p.clear(),c&&i.configSignature===_s(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await Qo(y,n),ue.set(n,{graph:y,signature:ks(y),configSignature:_s(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(n,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(n);if(o)return o;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(n,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await Yo({name:"ui",cwd:j.join(n,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await Yo({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Yo({name:"stx",alias:"ui",cwd:n,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await kc(n,F);u=v.config,ue.set(n,{graph:v.graph,signature:ks(v.graph),configSignature:_s(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-7efkc3gk.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-qv21bsa1.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Vf(u,n),Gt(u,n);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[n]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-cfrgrnej.js"),b=[],x=[];for(let P of f){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=g.resolve(S,{paths:[n]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(n,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
- `)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:xs(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(n,s),s.catch(()=>{if(Y.get(n)===s)Y.delete(n)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var O=new Proxy(F,{get(e,n){if(K&&n in K)return K[n];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[n]}});function Uh(e){return e}function Wh(e){let n=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")n.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")n.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")n.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")n.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)n.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)n.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))n.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))n.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)n.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)n.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))n.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))n.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))n.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))n.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))n.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))n.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)n.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))n.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))n.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")n.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(s.strategy))n.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))n.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))n.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!o.includes(c)).length>0)n.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:n.length===0,errors:n,warnings:i}}
1312
- export{gc,mc,pr,et,hc,xs,Ss,F,Vf,Yo,a,O,Uh,Wh};
1310
+ </script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:pn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},xc,Sc,Es,Ts,Pe,Ae,_e,ke,Re,Ee,qe,Se,...ro],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,n,i){let o=n||"pages";if(e)return{root:e,pagesDir:o};let s=i||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,n){let i=n.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return o===s||o.startsWith(`${s}/`)}function Uf(e,n){let i=!e.root,o=Jt(e.root,e.pagesDir,n);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let s=`${n}::${o.root}`;if(!Qe.has(s))Qe.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let s={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Kt(d,s))continue;e[c]=j.join(s,d)}}for(let s of pe){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(n,c)}return e}function Gt(e,n){let i=Ce.get(e);for(let o of pe){let s=e[o];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(n,s);if(Q.existsSync(c))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Ac(e.stateDir),e.stateDir=yr(),e.cachePath=br(e.cachePath),e.build)e.build.cacheDir=br(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=br(e.media.cache.directory);if(e.story)e.story.outDir=br(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Zo(e,n=Bt){try{return await n(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let n=e?j.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==_s(i.graph)){let c=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-c87zgwzn.js"),{partialsCache:p}=await import("./chunk-40bkdswh.js");if(d(),p.clear(),c&&i.configSignature===Cs(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await ei(y,n),ue.set(n,{graph:y,signature:_s(y),configSignature:Cs(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(n,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(n);if(o)return o;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(n,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await Zo({name:"ui",cwd:j.join(n,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await Zo({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Zo({name:"stx",alias:"ui",cwd:n,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await _c(n,F);u=v.config,ue.set(n,{graph:v.graph,signature:_s(v.graph),configSignature:Cs(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-rmc6dfj4.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-2knr61g3.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Uf(u,n),Gt(u,n);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[n]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-5t93dqft.js"),b=[],x=[];for(let P of f){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=g.resolve(S,{paths:[n]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(n,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
+ `)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:Ss(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(n,s),s.catch(()=>{if(Y.get(n)===s)Y.delete(n)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var O=new Proxy(F,{get(e,n){if(K&&n in K)return K[n];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[n]}});function Wh(e){return e}function qh(e){let n=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")n.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")n.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")n.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")n.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)n.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)n.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))n.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))n.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)n.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)n.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))n.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))n.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))n.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))n.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))n.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))n.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)n.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))n.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))n.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")n.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(s.strategy))n.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))n.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))n.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!o.includes(c)).length>0)n.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:n.length===0,errors:n,warnings:i}}
1312
+ export{mc,hc,fr,et,yc,Ss,ks,F,Uf,Zo,a,O,Wh,qh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function H(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function L(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as z,rm as k,stat as B}from"fs/promises";import{join as w,dirname as D}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function E(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function Mr(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await L(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function Dr(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await H(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await E(D(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function Lr(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await k(n,{recursive:!0,force:!0})}catch{}}}
3
- export{H,L,Mr,Dr,Lr};
2
+ import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function H(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function L(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as z,rm as k,stat as B}from"fs/promises";import{join as w,dirname as D}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function E(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function Dr(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await L(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function Lr(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await H(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await E(D(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function jr(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await k(n,{recursive:!0,force:!0})}catch{}}}
3
+ export{H,L,Dr,Lr,jr};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{rh,sh,oh,ih,ah}from"./chunk-4j08cbjd.js";export{sh as createSSRSuspense,ih as generateSuspenseCSS,ah as generateSuspenseRuntime,rh as processSuspenseDirectives,oh as renderSSRSuspense};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Xm}from"./chunk-mhyd24bg.js";export{Xm as processDeferDirectives};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{We,Rn,Ni}from"./chunk-7bvvv74e.js";function to(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?We(a,e):null,h=u?Rn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
2
+ import{We,An,Mi}from"./chunk-rk2ex6qx.js";function no(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?We(a,e):null,h=u?An(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
3
3
  * Service Worker - Auto-generated by stx
4
4
  * Cache Version: ${i}
5
5
  *
@@ -13,7 +13,7 @@ import{We,Rn,Ni}from"./chunk-7bvvv74e.js";function to(e,a){let t=e.pwa;if(!t?.en
13
13
  * Additional features:
14
14
  * - Push notifications: ${r?.enabled?"enabled":"disabled"}
15
15
  * - Background sync: ${s?.enabled?"enabled":"disabled"}
16
- * - Cache limits: ${n?.maxSize?`${Ni(n.maxSize*1024*1024)}`:"unlimited"}
16
+ * - Cache limits: ${n?.maxSize?`${Mi(n.maxSize*1024*1024)}`:"unlimited"}
17
17
  */
18
18
 
19
19
  const CACHE_VERSION = '${i}';
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
825
825
  event.waitUntil(registerFormSync(event.data.payload));
826
826
  }
827
827
  });
828
- `}function Vt(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function _l(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function Rg(e,a){if(!e.pwa?.enabled)return"";if(_l(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-kw5gra2z.js");return t(e,a)}return to(e,a)}
829
- export{to,Vt,_l,Rg};
828
+ `}function Ut(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Cl(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function Ag(e,a){if(!e.pwa?.enabled)return"";if(Cl(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-v4ybemgb.js");return t(e,a)}return no(e,a)}
829
+ export{no,Ut,Cl,Ag};