@stacksjs/stx 0.2.771 → 0.2.774

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 (250) hide show
  1. package/dist/app-shell.d.ts +10 -0
  2. package/dist/app-shell.js +3 -0
  3. package/dist/{chunk-nk4jhdnk.js → chunk-06wqf3t8.js} +3 -3
  4. package/dist/chunk-08c2c9ee.js +2 -0
  5. package/dist/chunk-0jvrzpfs.js +2 -0
  6. package/dist/chunk-0perf9at.js +2 -0
  7. package/dist/{chunk-e6az23ep.js → chunk-1frxaa7e.js} +59 -59
  8. package/dist/{chunk-bwv5j7z3.js → chunk-1hdhfc4w.js} +6 -6
  9. package/dist/chunk-1msebzht.js +2 -0
  10. package/dist/chunk-1tvb2stj.js +2 -0
  11. package/dist/{chunk-v3kynq6v.js → chunk-200z6ew1.js} +5 -5
  12. package/dist/{chunk-krdc3c87.js → chunk-20afyff6.js} +3 -3
  13. package/dist/{chunk-p1mbbdwj.js → chunk-27rzdq3n.js} +2 -2
  14. package/dist/{chunk-xaqtk05e.js → chunk-2gqhfge6.js} +2 -2
  15. package/dist/chunk-2vnhyter.js +2 -0
  16. package/dist/{chunk-4833k99b.js → chunk-2yxva96k.js} +2 -2
  17. package/dist/{chunk-477gjb2b.js → chunk-416jy1m5.js} +2 -2
  18. package/dist/chunk-47qestfz.js +2 -0
  19. package/dist/chunk-4kx7pw6x.js +2 -0
  20. package/dist/{chunk-x148cxrj.js → chunk-4wc5pc19.js} +4 -4
  21. package/dist/{chunk-3csfmhg0.js → chunk-5emrarpf.js} +2 -2
  22. package/dist/{chunk-erjp2w63.js → chunk-5mng4x26.js} +5 -5
  23. package/dist/{chunk-bwzjjxnj.js → chunk-605b93pe.js} +4 -4
  24. package/dist/{chunk-g53y0v3f.js → chunk-6smzs5vp.js} +10 -10
  25. package/dist/chunk-6xapz9dx.js +2 -0
  26. package/dist/chunk-713az4kg.js +2 -0
  27. package/dist/{chunk-2g7yg3na.js → chunk-79b3sbft.js} +6 -6
  28. package/dist/chunk-7fhw11qd.js +2 -0
  29. package/dist/{chunk-6sa5adg6.js → chunk-7gdwvnwc.js} +2 -2
  30. package/dist/{chunk-g4k0svq6.js → chunk-7qk4exw1.js} +2 -2
  31. package/dist/{chunk-wmnzapn8.js → chunk-7sh9fa3q.js} +2 -2
  32. package/dist/chunk-7y2h7nfd.js +2 -0
  33. package/dist/chunk-7y6ad89y.js +2 -0
  34. package/dist/chunk-8dby49s0.js +2 -0
  35. package/dist/chunk-8ds59ttd.js +2 -0
  36. package/dist/{chunk-c9ygnsx5.js → chunk-8k4j2xv8.js} +68 -68
  37. package/dist/{chunk-4qng287p.js → chunk-8nb8b0nf.js} +2 -2
  38. package/dist/chunk-8pyyqev1.js +2 -0
  39. package/dist/chunk-8qhznykd.js +177 -0
  40. package/dist/{chunk-83fh7j8g.js → chunk-985afhhy.js} +2 -2
  41. package/dist/chunk-9896204h.js +2 -0
  42. package/dist/{chunk-2vbgm9t4.js → chunk-9ct3gbyv.js} +6 -6
  43. package/dist/{chunk-yzbdm457.js → chunk-9f6qx8b9.js} +2 -2
  44. package/dist/{chunk-qmwaqdc1.js → chunk-9jfva11p.js} +17 -17
  45. package/dist/chunk-9qwkyt81.js +2 -0
  46. package/dist/{chunk-tahdfsp4.js → chunk-9tec9eap.js} +2 -2
  47. package/dist/{chunk-f7h5ty84.js → chunk-9z6331xs.js} +2 -2
  48. package/dist/{chunk-cn7d3389.js → chunk-a10y92qp.js} +30 -30
  49. package/dist/{chunk-81x4xnv9.js → chunk-a7f2xqsh.js} +9 -9
  50. package/dist/{chunk-6d1jmx97.js → chunk-abfphkss.js} +9 -9
  51. package/dist/{chunk-vht2rhrj.js → chunk-ady8cnpb.js} +5 -5
  52. package/dist/chunk-aj5b9dm3.js +2 -0
  53. package/dist/chunk-ajj56vrw.js +2 -0
  54. package/dist/{chunk-spr5bxm8.js → chunk-ajmexj79.js} +1 -1
  55. package/dist/chunk-b3b9tfpx.js +2 -0
  56. package/dist/{chunk-3jv81hw3.js → chunk-bengxr5p.js} +3 -3
  57. package/dist/{chunk-efr9dgt6.js → chunk-bgc2fm73.js} +2 -2
  58. package/dist/{chunk-wabahwkj.js → chunk-bmfk3b29.js} +2 -2
  59. package/dist/{chunk-5s2dwh5z.js → chunk-bq9xf8nq.js} +16 -16
  60. package/dist/{chunk-zkwtrmwg.js → chunk-br91e06f.js} +2 -2
  61. package/dist/{chunk-hgm6f2t2.js → chunk-c0ejyxfj.js} +3 -3
  62. package/dist/{chunk-pqyhxpa6.js → chunk-c85dv6tv.js} +5 -5
  63. package/dist/chunk-c91y14ae.js +2 -0
  64. package/dist/{chunk-dmj9gk6d.js → chunk-cfpw4c6b.js} +2 -2
  65. package/dist/chunk-cgamtmxv.js +2 -0
  66. package/dist/chunk-cpq9b0fx.js +2 -0
  67. package/dist/{chunk-m207mdpy.js → chunk-cz8mka1b.js} +2 -2
  68. package/dist/{chunk-rkz3k2td.js → chunk-d18xd9x5.js} +3 -3
  69. package/dist/chunk-defwzg9q.js +2 -0
  70. package/dist/chunk-drwa5hjd.js +2 -0
  71. package/dist/{chunk-nbwmcm2p.js → chunk-dvcfhx4y.js} +6 -6
  72. package/dist/chunk-dxp022r0.js +2 -0
  73. package/dist/{chunk-xr28hjkp.js → chunk-e1gxykm8.js} +7 -7
  74. package/dist/{chunk-38c5cw2c.js → chunk-e7477r0v.js} +1 -1
  75. package/dist/{chunk-7h0mjwkq.js → chunk-eapt899m.js} +5 -5
  76. package/dist/{chunk-qtja7fpr.js → chunk-et1vz3wd.js} +2 -2
  77. package/dist/{chunk-m0deyakx.js → chunk-evb5y7sm.js} +6 -6
  78. package/dist/chunk-fbv7byxx.js +2 -0
  79. package/dist/chunk-fgstg93m.js +2 -0
  80. package/dist/chunk-fmzfmh9n.js +2 -0
  81. package/dist/{chunk-ssd9g1wz.js → chunk-fpn4dren.js} +1 -1
  82. package/dist/chunk-ft994mav.js +2 -0
  83. package/dist/chunk-gbgbhpms.js +2 -0
  84. package/dist/{chunk-cn7zpm1x.js → chunk-gbx5vw81.js} +5 -5
  85. package/dist/chunk-gdkcskm7.js +2 -0
  86. package/dist/chunk-gxp9ms4w.js +2 -0
  87. package/dist/chunk-hc0c0p0r.js +2 -0
  88. package/dist/{chunk-w07n2ddj.js → chunk-he85ksa7.js} +2 -2
  89. package/dist/chunk-hr8rzzcn.js +2 -0
  90. package/dist/{chunk-yjdnfxm7.js → chunk-j576e8tm.js} +3 -3
  91. package/dist/chunk-jdj1358b.js +3 -0
  92. package/dist/chunk-jpnptbtm.js +2 -0
  93. package/dist/{chunk-jasfbhp3.js → chunk-k003phkg.js} +7 -7
  94. package/dist/{chunk-z5vkzbct.js → chunk-k0aejzg9.js} +4 -4
  95. package/dist/{chunk-0wj31pqy.js → chunk-k3rcpnzm.js} +2 -2
  96. package/dist/{chunk-nnzmbfjq.js → chunk-k4bdf0dw.js} +3 -3
  97. package/dist/chunk-k9dg3nyy.js +2 -0
  98. package/dist/{chunk-ddhazq2g.js → chunk-kf8hzvb7.js} +3 -3
  99. package/dist/{chunk-rc4zsymn.js → chunk-kr8qdg0r.js} +2 -2
  100. package/dist/chunk-m1rdq29w.js +2 -0
  101. package/dist/chunk-m3qmj9ec.js +2 -0
  102. package/dist/{chunk-2bm97z09.js → chunk-m4mpyq3d.js} +3 -3
  103. package/dist/{chunk-g9kgxx0t.js → chunk-m6nkaxcc.js} +3 -3
  104. package/dist/chunk-m90wyzhd.js +2 -0
  105. package/dist/chunk-mcevnfnx.js +2 -0
  106. package/dist/{chunk-am4wadh7.js → chunk-mv3yhspn.js} +2 -2
  107. package/dist/chunk-ndjmt3vg.js +3 -0
  108. package/dist/chunk-nmtwqvq2.js +3 -0
  109. package/dist/chunk-nthzdhsf.js +2 -0
  110. package/dist/chunk-nx20kccb.js +2 -0
  111. package/dist/chunk-p43hw6ef.js +2 -0
  112. package/dist/{chunk-4fkxm22d.js → chunk-p45mzeek.js} +2 -2
  113. package/dist/{chunk-55rg4qyr.js → chunk-p7p3b4s1.js} +2 -2
  114. package/dist/{chunk-snbnhqn3.js → chunk-pebsj489.js} +10 -10
  115. package/dist/chunk-q71qqjy7.js +2 -0
  116. package/dist/{chunk-zs35vgyy.js → chunk-qa6r6mj6.js} +4 -4
  117. package/dist/{chunk-6b32wt31.js → chunk-qby3e5nm.js} +30 -30
  118. package/dist/chunk-qezg1070.js +2 -0
  119. package/dist/{chunk-ngzdcvry.js → chunk-qfcn4btf.js} +1 -1
  120. package/dist/{chunk-4q292036.js → chunk-qmj7g7s8.js} +6 -6
  121. package/dist/chunk-qtcxy3y3.js +2 -0
  122. package/dist/{chunk-618d3ng3.js → chunk-r1jzbqr3.js} +6 -6
  123. package/dist/chunk-r5qfxd9s.js +2 -0
  124. package/dist/{chunk-qk61pv1v.js → chunk-ra8f8sm2.js} +15 -10
  125. package/dist/chunk-rgsb3f0j.js +2 -0
  126. package/dist/{chunk-s369wfsp.js → chunk-rr58ynsn.js} +6 -6
  127. package/dist/chunk-s53psb1j.js +2 -0
  128. package/dist/{chunk-ddjkt87h.js → chunk-sxwgq49z.js} +1 -1
  129. package/dist/chunk-t482tgm6.js +2 -0
  130. package/dist/{chunk-91q55gjp.js → chunk-td3qp5my.js} +3 -3
  131. package/dist/chunk-tsvnhc0c.js +4 -0
  132. package/dist/{chunk-qr5ddqbf.js → chunk-tyjzye2d.js} +2 -2
  133. package/dist/{chunk-2s0157xg.js → chunk-vadbp45n.js} +3 -3
  134. package/dist/{chunk-nj2q40p8.js → chunk-vct6dec8.js} +2 -2
  135. package/dist/{chunk-e6ynacgc.js → chunk-vgd3r8g7.js} +2 -2
  136. package/dist/{chunk-1925kbjc.js → chunk-w9d18r1t.js} +1 -1
  137. package/dist/{chunk-5t33zwwg.js → chunk-wj78td69.js} +1 -1
  138. package/dist/{chunk-afxt272e.js → chunk-wm65y47g.js} +14 -14
  139. package/dist/chunk-wm8wz183.js +2 -0
  140. package/dist/chunk-wn7wmjcr.js +2 -0
  141. package/dist/chunk-x0e0pcn0.js +2 -0
  142. package/dist/chunk-x756yzrc.js +2 -0
  143. package/dist/{chunk-07thf07b.js → chunk-x8anspa5.js} +2 -2
  144. package/dist/{chunk-cak9fp9b.js → chunk-x8js27hd.js} +7 -7
  145. package/dist/chunk-xad5fg2a.js +2 -0
  146. package/dist/chunk-xj5v9rnx.js +2 -0
  147. package/dist/chunk-xq2tfg4v.js +2 -0
  148. package/dist/{chunk-vke28xq8.js → chunk-y38swh5t.js} +2 -2
  149. package/dist/{chunk-pgkcbm6g.js → chunk-y5f04xtb.js} +2 -2
  150. package/dist/{chunk-z1br7qeb.js → chunk-yewd8836.js} +4 -4
  151. package/dist/chunk-ypmx0jhd.js +2 -0
  152. package/dist/chunk-yrdxvphr.js +2 -0
  153. package/dist/chunk-yx563gzr.js +2 -0
  154. package/dist/{chunk-x0qtgyqr.js → chunk-yzs2afn7.js} +9 -9
  155. package/dist/{chunk-nwhv1889.js → chunk-z2m9p8xe.js} +3 -3
  156. package/dist/{chunk-xw8ygkyb.js → chunk-zbgh573z.js} +2 -2
  157. package/dist/chunk-zccysq9p.js +3 -0
  158. package/dist/chunk-zh8w0nb6.js +2 -0
  159. package/dist/{chunk-79x0812m.js → chunk-zxfptbac.js} +2 -2
  160. package/dist/cli.js +20 -20
  161. package/dist/client/signals-dom-ready-runtime.js +6 -1
  162. package/dist/craft-entry.js +2 -2
  163. package/dist/craft.js +2 -2
  164. package/dist/dev-server/serve-app.js +2 -2
  165. package/dist/native/bridge/protocol.d.ts +1 -1
  166. package/dist/native/compiler/headwind-to-style.d.ts +2 -10
  167. package/dist/native/compiler/headwind-to-style.js +31 -2
  168. package/dist/native/compiler/html-to-ir.js +14 -4
  169. package/dist/native/compiler/ir.d.ts +3 -0
  170. package/dist/native/event-names.js +14 -1
  171. package/dist/native/prop-names.js +8 -1
  172. package/dist/native/runtime/craft-bridge.js +7 -1
  173. package/dist/native/runtime/craft.d.ts +1 -1
  174. package/dist/native/runtime/native-host.d.ts +1 -0
  175. package/dist/native/runtime/native-host.js +8 -2
  176. package/dist/native/runtime/shared-screen.js +1 -0
  177. package/dist/native/testing.d.ts +1 -1
  178. package/dist/production-server.js +5 -5
  179. package/dist/pwa.js +3 -3
  180. package/dist/ssg.js +10 -10
  181. package/package.json +5 -5
  182. package/dist/chunk-0qgdex7z.js +0 -2
  183. package/dist/chunk-1gpvkgb0.js +0 -2
  184. package/dist/chunk-1se5y83a.js +0 -2
  185. package/dist/chunk-1y4agex5.js +0 -2
  186. package/dist/chunk-2p301rsb.js +0 -2
  187. package/dist/chunk-2zg3jmy7.js +0 -2
  188. package/dist/chunk-33gccrx0.js +0 -2
  189. package/dist/chunk-3jkbs3fc.js +0 -2
  190. package/dist/chunk-3pxche1k.js +0 -2
  191. package/dist/chunk-3vankrf5.js +0 -2
  192. package/dist/chunk-4tvty67c.js +0 -2
  193. package/dist/chunk-4xdapekt.js +0 -2
  194. package/dist/chunk-4xzk9529.js +0 -3
  195. package/dist/chunk-53md2scd.js +0 -2
  196. package/dist/chunk-5c4g0v5g.js +0 -2
  197. package/dist/chunk-5g5v7yns.js +0 -2
  198. package/dist/chunk-6weh2dhz.js +0 -177
  199. package/dist/chunk-75st1ttq.js +0 -2
  200. package/dist/chunk-7k95121a.js +0 -2
  201. package/dist/chunk-7p4tvw5x.js +0 -2
  202. package/dist/chunk-825zg5ar.js +0 -2
  203. package/dist/chunk-83aq0n9s.js +0 -2
  204. package/dist/chunk-83c3vrbg.js +0 -3
  205. package/dist/chunk-9pgnhayn.js +0 -2
  206. package/dist/chunk-9vgkp3nj.js +0 -2
  207. package/dist/chunk-9za2wr5r.js +0 -2
  208. package/dist/chunk-ba43drcj.js +0 -2
  209. package/dist/chunk-bpbhjn4w.js +0 -2
  210. package/dist/chunk-cgv3r6q9.js +0 -2
  211. package/dist/chunk-cnt08b67.js +0 -2
  212. package/dist/chunk-e645nk33.js +0 -4
  213. package/dist/chunk-g3sgf16e.js +0 -2
  214. package/dist/chunk-g5ebz7hm.js +0 -2
  215. package/dist/chunk-g6m3q9n4.js +0 -2
  216. package/dist/chunk-h2ymq7fa.js +0 -2
  217. package/dist/chunk-hnen9b45.js +0 -2
  218. package/dist/chunk-hy91tn1w.js +0 -2
  219. package/dist/chunk-j46nvncc.js +0 -2
  220. package/dist/chunk-jjvrm2j8.js +0 -2
  221. package/dist/chunk-k4pwpr5q.js +0 -2
  222. package/dist/chunk-kh0szwf3.js +0 -2
  223. package/dist/chunk-kzx3t7q6.js +0 -2
  224. package/dist/chunk-mvfj17fr.js +0 -2
  225. package/dist/chunk-nmjgcw4g.js +0 -2
  226. package/dist/chunk-p454tj1h.js +0 -2
  227. package/dist/chunk-p7ksex4f.js +0 -2
  228. package/dist/chunk-q245q8z1.js +0 -2
  229. package/dist/chunk-q4m5p4wx.js +0 -2
  230. package/dist/chunk-q85s8ne0.js +0 -2
  231. package/dist/chunk-qy01jdzk.js +0 -2
  232. package/dist/chunk-rfp5f55f.js +0 -2
  233. package/dist/chunk-tk17tjzw.js +0 -2
  234. package/dist/chunk-tw2c09tw.js +0 -2
  235. package/dist/chunk-tynz075x.js +0 -2
  236. package/dist/chunk-v0tewfbx.js +0 -2
  237. package/dist/chunk-vdxjyrjf.js +0 -3
  238. package/dist/chunk-vk494kgn.js +0 -2
  239. package/dist/chunk-vyr8zzyr.js +0 -2
  240. package/dist/chunk-w1sjp421.js +0 -2
  241. package/dist/chunk-wq0wbvgd.js +0 -2
  242. package/dist/chunk-wr6b3a1w.js +0 -2
  243. package/dist/chunk-wwnqbv9j.js +0 -3
  244. package/dist/chunk-x3xtyr95.js +0 -2
  245. package/dist/chunk-xb16yy2x.js +0 -2
  246. package/dist/chunk-y7df8y9a.js +0 -2
  247. package/dist/chunk-ybd2tfqm.js +0 -2
  248. package/dist/chunk-yrh9yfnv.js +0 -2
  249. package/dist/chunk-ysm6gaq9.js +0 -2
  250. package/dist/chunk-z6xfmrtc.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Ir(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Ir(i,n,r+1,o))return!0}return!1}var k=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],il=["onMount","onDestroy"];function it(e="const",t=[],r){let o=t.length?k.filter((s)=>!t.includes(s)):k;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=k.filter((e)=>!y.includes(e));function Ti(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function al(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Ti(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Ir(r[1],t))return!0;return!1}function cl(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function ll(e){return R.includes(e.toLowerCase())}var Gs=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],_=["x-init","x-transition","x-effect","x-on"],ul=[...Gs,..._];function dl(){return`{${Gs.map((e)=>`'${e}':1`).join(",")}}`}var $i=["class","style","text","html","show","model","if","ref"];function pl(){return`{${$i.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function fl(){return`/^(${p.join("|")})(?:\\.|$)/`}function gl(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var w=65536,A=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=w;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=A){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
- export{Ir,k,il,it,Ti,al,cl,ll,Gs,ul,dl,$i,pl,fl,gl};
2
+ import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Or(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Or(i,n,r+1,o))return!0}return!1}var k=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],al=["onMount","onDestroy"];function at(e="const",t=[],r){let o=t.length?k.filter((s)=>!t.includes(s)):k;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=k.filter((e)=>!y.includes(e));function $i(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function cl(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if($i(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Or(r[1],t))return!0;return!1}function ll(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function ul(e){return R.includes(e.toLowerCase())}var Js=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],_=["x-init","x-transition","x-effect","x-on"],dl=[...Js,..._];function pl(){return`{${Js.map((e)=>`'${e}':1`).join(",")}}`}var Ri=["class","style","text","html","show","model","if","ref"];function fl(){return`{${Ri.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function gl(){return`/^(${p.join("|")})(?:\\.|$)/`}function ml(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var w=65536,A=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=w;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=A){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
+ export{Or,k,al,at,$i,cl,ll,ul,Js,dl,pl,Ri,fl,gl,ml};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,c}from"./chunk-5s2dwh5z.js";import{r,yn,h}from"./chunk-e6az23ep.js";import{et}from"./chunk-z1br7qeb.js";import{Ss,ks}from"./chunk-cak9fp9b.js";import{bc,Xo,vs,xs}from"./chunk-bwzjjxnj.js";import{mc,hc}from"./chunk-3jv81hw3.js";import{vt}from"./chunk-am4wadh7.js";import{ln,_c,gr,mr}from"./chunk-4xzk9529.js";import{g}from"./chunk-0dve54ne.js";import{Zs}from"./chunk-qtja7fpr.js";import Q from"fs";import N 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:l,custom:d}={...B,...n};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="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,c}from"./chunk-bq9xf8nq.js";import{r,bn,h}from"./chunk-1frxaa7e.js";import{tt}from"./chunk-yewd8836.js";import{ks,_s}from"./chunk-x8js27hd.js";import{wc,Go,xs,Ss}from"./chunk-605b93pe.js";import{hc,yc}from"./chunk-bengxr5p.js";import{xt}from"./chunk-mv3yhspn.js";import{un,Cc,mr,hr}from"./chunk-jdj1358b.js";import{g}from"./chunk-0dve54ne.js";import{Qs}from"./chunk-et1vz3wd.js";import Q from"fs";import N 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:l,custom:d}={...B,...n};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="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`${l==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="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,9 +234,9 @@ 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],l=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:l,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: ${l}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],l=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: ${l}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],l=n.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(s,l,{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,l=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function lc(e,n,i,o){let s=e;if(o.animation?.enabled===!1)return s;let l=i.includes("test")&&i.includes("animation");if(!ot(s)&&!l)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,l=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${l}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function uc(e,n,i,o){let s=e;if(o.animation?.enabled===!1)return s;let l=i.includes("test")&&i.includes("animation");if(!ot(s)&&!l)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
- `+s.slice(m)}}return s}async function ut(e,n,i,o){let s=n[0]?.replace(/['"]/g,"")||"main",l=et();if(s!=="main")l=l.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${l}</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`
239
+ `+s.slice(m)}}return s}async function ut(e,n,i,o){let s=n[0]?.replace(/['"]/g,"")||"main",l=tt();if(s!=="main")l=l.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${l}</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 -->
241
241
  <script>
242
242
  (function() {
@@ -619,8 +619,8 @@ else {
619
619
  };
620
620
  })();
621
621
  </script>
622
- `}function uc(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 l=mt(n.join(" "));s.heatmap={...s.heatmap,...l,enabled:!0}}return Oe(s)}};function mt(e){let n={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[s,l]=o.split("="),d=l?.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 ur(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),l={};for(let d of o.split(`
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)}l[m]=y}return{data:l,content:s.trim()}}function Ze(e,n={}){let{gfm:i=!0,breaks:o=!1}=n,s=e,l=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=l.length,x=f?` class="language-${J(f)}"`:"";return l.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,`
622
+ `}function dc(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 l=mt(n.join(" "));s.heatmap={...s.heatmap,...l,enabled:!0}}return Oe(s)}};function mt(e){let n={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[s,l]=o.split("="),d=l?.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 dr(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),l={};for(let d of o.split(`
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)}l[m]=y}return{data:l,content:s.trim()}}function Qe(e,n={}){let{gfm:i=!0,breaks:o=!1}=n,s=e,l=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=l.length,x=f?` class="language-${J(f)}"`:"";return l.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>`,k=v.trim().split(`
625
625
  `).map((S)=>`<tr>${S.split("|").map((A)=>A.trim()).filter(Boolean).map((A)=>`<td>${J(A)}</td>`).join("")}</tr>`).join(`
626
626
  `);return`<table>
@@ -637,8 +637,8 @@ ${k}
637
637
  `:`
638
638
  `)}</p>`);if(s=p.join(`
639
639
  `),o)s=s.replace(/\n/g,`<br />
640
- `);for(let y=0;y<l.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,l[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function dc(e,n,i=""){let o=e,s=[],l=/@markdown(?:\([^)]*\))?/g,d;while((d=l.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),_=e.indexOf("@endmarkdown",v);if(_===-1)break;if(S!==-1&&S<_&&S!==p){let A=e[S+9];if(A==="("||A===`
641
- `||A==="\r"||A===" "||A===void 0)f++;v=S+9}else{if(f--,f===0){b=_;break}v=_+12}}if(b===-1)continue;let x=e.slice(y,b),k=e.slice(p,b+12);s.push({fullMatch:k,options:m,content:x,index:p}),l.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 k=x.trim();if(k)f[k]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=Ze(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((l)=>{let d=l.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),Ze(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,l)=>s-l).map((s)=>`${re(e,{...i,w:s,fm:o})} ${s}w`).join(", ")}function Me(e,n,i=gt,o={},s){return i.sort((l,d)=>l-d).map((l)=>{let d=Math.round(n*l);return`${re(e,{...o,w:d,dpr:l,fm:s})} ${l}x`}).join(", ")}function ge(e,n="100vw"){if(!e||Object.keys(e).length===0)return n;let o=Object.entries(e).map(([s,l])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:l,numericBp:Number.parseInt(d)||0}}).sort((s,l)=>s.numericBp-l.numericBp).map(({bp:s,size:l})=>`(max-width: ${s}) ${l}`);return o.push(n),o.join(", ")}function re(e,n={}){let i=Object.entries(n).filter(([,l])=>l!==void 0&&l!==null).map(([l,d])=>{if(Array.isArray(d))return[l,d.join(",")];return[l,String(d)]});if(i.length===0)return e;let o=i.map(([l,d])=>`${l}=${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=`
640
+ `);for(let y=0;y<l.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,l[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function pc(e,n,i=""){let o=e,s=[],l=/@markdown(?:\([^)]*\))?/g,d;while((d=l.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),_=e.indexOf("@endmarkdown",v);if(_===-1)break;if(S!==-1&&S<_&&S!==p){let A=e[S+9];if(A==="("||A===`
641
+ `||A==="\r"||A===" "||A===void 0)f++;v=S+9}else{if(f--,f===0){b=_;break}v=_+12}}if(b===-1)continue;let x=e.slice(y,b),k=e.slice(p,b+12);s.push({fullMatch:k,options:m,content:x,index:p}),l.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 k=x.trim();if(k)f[k]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=Qe(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((l)=>{let d=l.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),Qe(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,l)=>s-l).map((s)=>`${re(e,{...i,w:s,fm:o})} ${s}w`).join(", ")}function Me(e,n,i=gt,o={},s){return i.sort((l,d)=>l-d).map((l)=>{let d=Math.round(n*l);return`${re(e,{...o,w:d,dpr:l,fm:s})} ${l}x`}).join(", ")}function ge(e,n="100vw"){if(!e||Object.keys(e).length===0)return n;let o=Object.entries(e).map(([s,l])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:l,numericBp:Number.parseInt(d)||0}}).sort((s,l)=>s.numericBp-l.numericBp).map(({bp:s,size:l})=>`(max-width: ${s}) ${l}`);return o.push(n),o.join(", ")}function re(e,n={}){let i=Object.entries(n).filter(([,l])=>l!==void 0&&l!==null).map(([l,d])=>{if(Array.isArray(d))return[l,d.join(",")];return[l,String(d)]});if(i.length===0)return e;let o=i.map(([l,d])=>`${l}=${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;
644
644
  overflow: hidden;
@@ -667,7 +667,7 @@ ${k}
667
667
  filter: blur(0);
668
668
  transform: scale(1);
669
669
  }
670
- `.trim();async function yt(){try{return await import("ts-images")}catch{return null}}async function bt(e,n={}){let i={...ht,...n},o=await yt();if(o)try{return await xt(e,i,o)}catch(s){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${s}`)}return wt(e,i)}async function xt(e,n,i){let{generatePlaceholder:o,generateThumbHash:s}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[n.strategy]||"blur";if(n.strategy==="thumbhash")return{dataURL:(await s(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await o(e,{width:n.width,height:n.height,quality:n.quality,blurLevel:n.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:n.strategy,dominantColor:p.dominantColor,css:p.css}}function wt(e,n){let i=n.width||20,o=n.height||i,s="#e5e7eb",l=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}" viewBox="0 0 ${i} ${o}"><rect fill="#e5e7eb" width="${i}" height="${o}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,width:i,height:o,aspectRatio:i/o,originalWidth:0,originalHeight:0,strategy:n.strategy,dominantColor:"#e5e7eb"}}function je(e,n,i={}){let o=i.transitionDuration||300,s=i.easing||"ease-out";return`
670
+ `.trim();async function yt(){try{return await import("ts-images")}catch{return null}}async function vt(e,n={}){let i={...ht,...n},o=await yt();if(o)try{return await bt(e,i,o)}catch(s){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${s}`)}return wt(e,i)}async function bt(e,n,i){let{generatePlaceholder:o,generateThumbHash:s}=i,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[n.strategy]||"blur";if(n.strategy==="thumbhash")return{dataURL:(await s(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let p=await o(e,{width:n.width,height:n.height,quality:n.quality,blurLevel:n.blurLevel,strategy:d,base64Encode:!0});return{dataURL:p.dataURL,width:p.width,height:p.height,aspectRatio:p.aspectRatio,originalWidth:p.originalWidth,originalHeight:p.originalHeight,strategy:n.strategy,dominantColor:p.dominantColor,css:p.css}}function wt(e,n){let i=n.width||20,o=n.height||i,s="#e5e7eb",l=`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${o}" viewBox="0 0 ${i} ${o}"><rect fill="#e5e7eb" width="${i}" height="${o}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,width:i,height:o,aspectRatio:i/o,originalWidth:0,originalHeight:0,strategy:n.strategy,dominantColor:"#e5e7eb"}}function je(e,n,i={}){let o=i.transitionDuration||300,s=i.easing||"ease-out";return`
671
671
  #${e} {
672
672
  --stx-img-transition-duration: ${o}ms;
673
673
  --stx-img-transition-easing: ${s};
@@ -684,7 +684,7 @@ ${k}
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 bt(e,n);return he.set(i,o),o}async function $t(){try{return await import("./chunk-2p301rsb.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:l,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:k={},lazy:S=!0,priority:_=!1,loading:A=_?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:L}=e,{class:W,style:T,id:V}=e,R=e.data||{},{isDev:z=!1,baseUrl:G=""}=n;if(z&&!n.optimize)return Dt(e);let F,O,H=V||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!_)try{F=await Ne(s,{strategy:x,...k}),O=je(H,F,k)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,F,n);else X=await St(e,H,F,n);let ee;if(_){let De=f.includes("webp")?"webp":f[0],nt=me(s,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(O)ae.push(O);let rt=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 $t(){try{return await import("./chunk-k9dg3nyy.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:l,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:x="none",placeholderOptions:k={},lazy:S=!0,priority:_=!1,loading:A=_?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:L}=e,{class:W,style:T,id:V}=e,R=e.data||{},{isDev:z=!1,baseUrl:G=""}=n;if(z&&!n.optimize)return Dt(e);let F,O,H=V||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!_)try{F=await Ne(s,{strategy:x,...k}),O=je(H,F,k)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,F,n);else X=await St(e,H,F,n);let ee;if(_){let De=f.includes("webp")?"webp":f[0],nt=me(s,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${nt}" imagesizes="${st}" />`}let ae=[];if(!ze&&x!=="none")ae.push(ye),ze=!0;if(O)ae.push(O);let rt=S?We(H):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
688
688
  `):void 0,script:rt}}async function St(e,n,i,o){let{src:s,alt:l,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:x=!1,loading:k=x?"eager":ce,decoding:S=le,fetchpriority:_,objectFit:A,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,L=e.data||{},W=typeof u==="object"?ge(u):u||"100vw",T=[];for(let z of y){let G=me(s,m,{...v,q:f},z),F=fe(z);if(b&&!x)T.push(` <source type="${F}" data-srcset="${G}" data-sizes="${W}" />`);else T.push(` <source type="${F}" srcset="${G}" sizes="${W}" />`)}let V=be({src:re(s,{...v,q:f}),alt:l,width:d,height:p,loading:x?void 0:k,decoding:S,fetchpriority:x?"high":_,objectFit:A,objectPosition:E,crossorigin:I,referrerpolicy:w,className:Le(C,i),style:xe(D,A,E,i),lazy:b&&!x,data:L}),R;if(i){let z=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;R=`<div id="${n}" class="stx-img-placeholder" style="${z}">
689
689
  <picture>
690
690
  ${T.join(`
@@ -745,10 +745,10 @@ ${w.join(`
745
745
  `)}
746
746
  <img ${D.join(" ")} />
747
747
  </picture>`;let z=[];if(n.placeholder)z.push(ye);let G=d?We(x):void 0,F;if(p&&E)F=`<link rel="preload" as="image" imagesrcset="${E}" />`;return{html:R,preloadLink:F,css:z.length>0?z.join(`
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,l]of Object.entries(n.byFormat))if(l)o.variants.push(...l);return we(e,o,i)}function kt(){return vt({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:l,options:d}=At(e,n,i);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:s,alt:l||"",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+`
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,l]of Object.entries(n.byFormat))if(l)o.variants.push(...l);return we(e,o,i)}function kt(){return xt({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:l,options:d}=At(e,n,i);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:s,alt:l||"",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),l=$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:l,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",l=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==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===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 bs(){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-cgv3r6q9.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:l,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:k=!0,player:S="native",type:_,width:A,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||p,{class:L,style:W}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,n);if(_&&_!=="video")return Et(l||"",_,e);let V=d.length>0?d:l?[{src:l,type:Ke(l)}]:[],R=[`id="${T}"`];if(m)R.push("controls");if(y)R.push("autoplay");if(f)R.push("muted");if(v)R.push("loop");if(x)R.push("playsinline");if(w)R.push("disablepictureinpicture");if(C)R.push("disableremoteplayback");if(I)R.push(`crossorigin="${I}"`);if(k){if(R.push(`data-preload="${b}"`),R.push('preload="none"'),D)R.push(`data-poster="${M(D)}"`);R.push("data-stx-lazy")}else if(R.push(`preload="${b}"`),D)R.push(`poster="${M(D)}"`);if(A)R.push(`width="${A}"`);if(E)R.push(`height="${E}"`);if(L)R.push(`class="${M(L)}"`);if(W)R.push(`style="${M(W)}"`);let z=V.map((O)=>` <source ${k?`data-src="${M(O.src)}"`:`src="${M(O.src)}"`} type="${O.type}"${O.media?` media="${O.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),l=$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:l,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",l=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==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===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 ws(){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-4kx7pw6x.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:l,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:k=!0,player:S="native",type:_,width:A,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||p,{class:L,style:W}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return It(e,n);if(_&&_!=="video")return Et(l||"",_,e);let V=d.length>0?d:l?[{src:l,type:Ke(l)}]:[],R=[`id="${T}"`];if(m)R.push("controls");if(y)R.push("autoplay");if(f)R.push("muted");if(v)R.push("loop");if(x)R.push("playsinline");if(w)R.push("disablepictureinpicture");if(C)R.push("disableremoteplayback");if(I)R.push(`crossorigin="${I}"`);if(k){if(R.push(`data-preload="${b}"`),R.push('preload="none"'),D)R.push(`data-poster="${M(D)}"`);R.push("data-stx-lazy")}else if(R.push(`preload="${b}"`),D)R.push(`poster="${M(D)}"`);if(A)R.push(`width="${A}"`);if(E)R.push(`height="${E}"`);if(L)R.push(`class="${M(L)}"`);if(W)R.push(`style="${M(W)}"`);let z=V.map((O)=>` <source ${k?`data-src="${M(O.src)}"`:`src="${M(O.src)}"`} type="${O.type}"${O.media?` media="${O.media}"`:""} />`).join(`
752
752
  `),G=`<video ${R.join(" ")}>
753
753
  ${z}
754
754
  Your browser does not support the video tag.
@@ -1005,9 +1005,9 @@ ${V}
1005
1005
  width: 100%;
1006
1006
  height: auto;
1007
1007
  }
1008
- `.trim();return{html:V,script:R,css:z}}function Ye(){return vt({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:l}=Vt(e,n,i);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,poster:l.poster,controls:l.controls!==!1,autoplay:l.autoplay||!1,muted:l.muted||!1,loop:l.loop||!1,preload:l.preload||"metadata",playsinline:l.playsinline!==!1,lazy:l.lazy!==!1,player:l.player||"native",type:l.type,width:l.width,height:l.height,class:l.class,style:l.style,id:l.id,crossorigin:l.crossorigin,disablePictureInPicture:l.disablePictureInPicture,disableRemotePlayback:l.disableRemotePlayback,title:l.title,quality:l.quality,platform:l.platform,process:l.process,generatePoster:l.generatePoster,streaming:l.streaming,transcode:l.transcode,spriteSheet:l.spriteSheet,waveform:l.waveform},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await de(d,u),y=m.html;if(m.css)y+=`
1008
+ `.trim();return{html:V,script:R,css:z}}function Ye(){return xt({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:l}=Vt(e,n,i);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,poster:l.poster,controls:l.controls!==!1,autoplay:l.autoplay||!1,muted:l.muted||!1,loop:l.loop||!1,preload:l.preload||"metadata",playsinline:l.playsinline!==!1,lazy:l.lazy!==!1,player:l.player||"native",type:l.type,width:l.width,height:l.height,class:l.class,style:l.style,id:l.id,crossorigin:l.crossorigin,disablePictureInPicture:l.disablePictureInPicture,disableRemotePlayback:l.disableRemotePlayback,title:l.title,quality:l.quality,platform:l.platform,process:l.process,generatePoster:l.generatePoster,streaming:l.streaming,transcode:l.transcode,spriteSheet:l.spriteSheet,waveform:l.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),l=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:l,options:d}}function zt(e){let n=[],i="",o=!1,s="",l=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==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===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 ws(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 l=await Wt(s,e,n);if(l)o.push(l)}catch(l){if(console.error(`Error building web component ${s.name}:`,l),e.debug)throw l}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:l,extends:d}=e;if(!o||!s||!l)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 k=q.join(n.componentsDir,s);if(await r(k))p=k}if(!p)p=await yn(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:l,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:l,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,`${l}.${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:l,template:d,styleSource:p,attributes:u=[]}=e,m=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)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),l=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:l,options:d}}function zt(e){let n=[],i="",o=!1,s="",l=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==="{")l++;if(u==="}")l--;if(u==="[")d++;if(u==="]")d--;if(u===","&&l===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 vs(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 l=await Wt(s,e,n);if(l)o.push(l)}catch(l){if(console.error(`Error building web component ${s.name}:`,l),e.debug)throw l}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:l,extends:d}=e;if(!o||!s||!l)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 k=q.join(n.componentsDir,s);if(await r(k))p=k}if(!p)p=await bn(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:l,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:l,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,`${l}.${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:l,template:d,styleSource:p,attributes:u=[]}=e,m=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!l)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
  */
@@ -1305,8 +1305,8 @@ ${y}
1305
1305
  }
1306
1306
 
1307
1307
  customElements.define('${n}', ${d});
1308
- `}async function Qe(e,n,i,o){if(n.length<1)return c("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 c("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,s);return`<script type="module">
1308
+ `}async function Ze(e,n,i,o){if(n.length<1)return c("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 c("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 j={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:ln,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:Qe,hasEndTag:!1,description:"Include a web component in the template"},mc,hc,Ss,ks,Pe,Ae,_e,ke,Re,Ee,qe,Se,...Zs],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(),l=N.join(s,"resources","views"),d=N.join(s,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var tt=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 Mf(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(!tt.has(s))tt.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 l of pe){let d=e[l];if(typeof d==="string"&&d)s[l]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let l of pe){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,s))continue;e[l]=N.join(s,d)}}for(let s of pe){let l=e[s];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[s]=N.resolve(n,l)}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 l=N.isAbsolute(s)?s:N.join(n,s);if(Q.existsSync(l))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", 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(_c(e.stateDir),e.stateDir=gr(),e.cachePath=mr(e.cachePath),e.build)e.build.cacheDir=mr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=mr(e.media.cache.directory);if(e.story)e.story.outDir=mr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function qo(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?N.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==vs(i.graph)){let l=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-7p4tvw5x.js"),{partialsCache:p}=await import("./chunk-1y4agex5.js");if(d(),p.clear(),l&&i.configSignature===xs(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await Xo(y,n),ue.set(n,{graph:y,signature:vs(y),configSignature:xs(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 l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(n,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await qo({name:"ui",cwd:N.join(n,"config"),defaultConfig:j,errorPolicy:"throw",verbose:!1});u=(await qo({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await qo({name:"stx",alias:"ui",cwd:n,defaultConfig:j,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await bc(n,j);u=v.config,ue.set(n,{graph:v.graph,signature:vs(v.graph),configSignature:xs(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-1se5y83a.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-kzx3t7q6.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Mf(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-q85s8ne0.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[n]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(n,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;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(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.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(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
- `)}catch(A){console.warn(`[stx] Failed to load plugin ${S}:`,A.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:bs(),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((l)=>{K=l}).catch(()=>{});return s}var P=new Proxy(j,{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 Mh(e){return e}function Lh(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,l)=>{if(!s.pattern||typeof s.pattern!=="string")n.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(s.strategy))n.push({path:`pwa.routes[${l}].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[${l}].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[${l}].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((l)=>!o.includes(l)).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{lc,uc,ur,Ze,dc,bs,ws,j,Mf,qo,a,P,Mh,Lh};
1310
+ </script>`}var j={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:un,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"},hc,yc,ks,_s,Pe,Ae,_e,ke,Re,Ee,qe,Se,...Qs],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(),l=N.join(s,"resources","views"),d=N.join(s,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=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 Lf(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(!et.has(s))et.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 l of pe){let d=e[l];if(typeof d==="string"&&d)s[l]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let l of pe){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,s))continue;e[l]=N.join(s,d)}}for(let s of pe){let l=e[s];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[s]=N.resolve(n,l)}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 l=N.isAbsolute(s)?s:N.join(n,s);if(Q.existsSync(l))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", 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(Cc(e.stateDir),e.stateDir=mr(),e.cachePath=hr(e.cachePath),e.build)e.build.cacheDir=hr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=hr(e.media.cache.directory);if(e.story)e.story.outDir=hr(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Ko(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?N.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==xs(i.graph)){let l=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-ft994mav.js"),{partialsCache:p}=await import("./chunk-hc0c0p0r.js");if(d(),p.clear(),l&&i.configSignature===Ss(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await Go(y,n),ue.set(n,{graph:y,signature:xs(y),configSignature:Ss(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 l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(n,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await Ko({name:"ui",cwd:N.join(n,"config"),defaultConfig:j,errorPolicy:"throw",verbose:!1});u=(await Ko({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Ko({name:"stx",alias:"ui",cwd:n,defaultConfig:j,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await wc(n,j);u=v.config,ue.set(n,{graph:v.graph,signature:xs(v.graph),configSignature:Ss(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-1tvb2stj.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-m1rdq29w.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Lf(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-dxp022r0.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[n]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(n,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;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(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.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(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
+ `)}catch(A){console.warn(`[stx] Failed to load plugin ${S}:`,A.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:ws(),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((l)=>{K=l}).catch(()=>{});return s}var P=new Proxy(j,{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 Lh(e){return e}function jh(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,l)=>{if(!s.pattern||typeof s.pattern!=="string")n.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(s.strategy))n.push({path:`pwa.routes[${l}].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[${l}].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[${l}].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((l)=>!o.includes(l)).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{uc,dc,dr,Qe,pc,ws,vs,j,Lf,Ko,a,P,Lh,jh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ys,Ai,wg,vg,xg}from"./chunk-e1gxykm8.js";import"./chunk-4wc5pc19.js";export{vg as generateManifestLink,Ys as generatePwaTags,wg as generateSwRegistrationScript,xg as generateThemeColorMeta,Ai as injectPwaTags};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function _l(e,n,t={}){let o=Math.min(t.width??1440,h),s=Math.min(t.height??2200,h),i=t.waitMs??800,r=t.timeoutMs??15000,m=t.format??"png",c=M(e),u=(f)=>new p({width:o,height:f,headless:!0,...t.backend?{backend:t.backend}:{}}),a=u(s);try{if(await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r);if(t.fullPage){let d=await T(a);if(d>s){if(a.close(),a=u(d),await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r)}}let f=await a.screenshot({encoding:"buffer",format:m});b(l.dirname(l.resolve(n)),{recursive:!0}),await Bun.write(n,f)}finally{a.close()}if(!y(n))throw Error(`Screenshot was not produced for ${e}`);return{input:e,output:n,bytes:S(n).size}}async function Fg(e,n,t={}){b(n,{recursive:!0});let o;if(!/^https?:\/\//.test(e)&&y(e)&&S(e).isDirectory())o=v(e).filter((r)=>r.endsWith(".html")).map((r)=>l.join(e,r));else o=[e];let s=t.format??"png",i=[];for(let r of o){let m=/^https?:\/\//.test(r)?new URL(r).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":l.basename(r).replace(/\.html?$/,"");i.push(await _l(r,l.join(n,`${m}.${s}`),t))}return i}
3
- export{_l,Fg};
2
+ var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function Cl(e,n,t={}){let o=Math.min(t.width??1440,h),s=Math.min(t.height??2200,h),i=t.waitMs??800,r=t.timeoutMs??15000,m=t.format??"png",c=M(e),u=(f)=>new p({width:o,height:f,headless:!0,...t.backend?{backend:t.backend}:{}}),a=u(s);try{if(await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r);if(t.fullPage){let d=await T(a);if(d>s){if(a.close(),a=u(d),await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r)}}let f=await a.screenshot({encoding:"buffer",format:m});b(l.dirname(l.resolve(n)),{recursive:!0}),await Bun.write(n,f)}finally{a.close()}if(!y(n))throw Error(`Screenshot was not produced for ${e}`);return{input:e,output:n,bytes:S(n).size}}async function zg(e,n,t={}){b(n,{recursive:!0});let o;if(!/^https?:\/\//.test(e)&&y(e)&&S(e).isDirectory())o=v(e).filter((r)=>r.endsWith(".html")).map((r)=>l.join(e,r));else o=[e];let s=t.format??"png",i=[];for(let r of o){let m=/^https?:\/\//.test(r)?new URL(r).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":l.basename(r).replace(/\.html?$/,"");i.push(await Cl(r,l.join(n,`${m}.${s}`),t))}return i}
3
+ export{Cl,zg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{f,d}from"./chunk-5s2dwh5z.js";import{J,I,p}from"./chunk-e6az23ep.js";function z(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 N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(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 B(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=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(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=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(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=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",g=u[2].toLowerCase();if(c){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 h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.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 jl(t){let o={default:"",named:new Map},i=t,r=L(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=Z(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 lm(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 Bl(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},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(I(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!I(s,r))return e;let a=_(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function _(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(!f(t))return;return d(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Fl(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,g)=>{let m=o.named.get(u),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=J(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await Bl(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function um(t){let o=jl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function dm(t,o,i,r,e){return await Fl(t,{default:o,named:i},r,e)}
3
- export{jl,lm,Bl,Fl,um,dm};
2
+ import{f,d}from"./chunk-bq9xf8nq.js";import{J,I,p}from"./chunk-1frxaa7e.js";function z(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 N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(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 B(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=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(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=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(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=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",g=u[2].toLowerCase();if(c){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 h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.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 Bl(t){let o={default:"",named:new Map},i=t,r=L(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=Z(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 um(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 Fl(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},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(I(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!I(s,r))return e;let a=_(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function _(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(!f(t))return;return d(t,Object.keys(o))(...Object.values(o))}catch{return}}async function zl(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,g)=>{let m=o.named.get(u),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=J(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await Fl(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function dm(t){let o=Bl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function pm(t,o,i,r,e){return await zl(t,{default:o,named:i},r,e)}
3
+ export{Bl,um,Fl,zl,dm,pm};