@stacksjs/stx 0.2.303 → 0.2.304

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 (271) hide show
  1. package/dist/api-client.d.ts +26 -0
  2. package/dist/api-client.js +22 -0
  3. package/dist/api-handler.d.ts +6 -0
  4. package/dist/api-handler.js +3 -0
  5. package/dist/app-shell.js +11 -2
  6. package/dist/application-layers.d.ts +30 -0
  7. package/dist/application-layers.js +202 -0
  8. package/dist/build.js +9 -1
  9. package/dist/chunk-02hm88m5.js +2 -0
  10. package/dist/{chunk-7eea1cse.js → chunk-09zjty4k.js} +1 -1
  11. package/dist/{chunk-7nfn7nj9.js → chunk-0gz0rhvs.js} +1 -1
  12. package/dist/{chunk-jsfch50r.js → chunk-1c2j4eby.js} +1 -1
  13. package/dist/{chunk-m6wz1hf5.js → chunk-2h94c5hm.js} +2 -2
  14. package/dist/{chunk-mjpqz66q.js → chunk-2ver2s2y.js} +1 -1
  15. package/dist/{chunk-hp3rjwnb.js → chunk-30nbe9hr.js} +2 -2
  16. package/dist/chunk-39qzhpn6.js +18 -0
  17. package/dist/chunk-3z6bqqr7.js +2 -0
  18. package/dist/chunk-43p1qq7g.js +2 -0
  19. package/dist/{chunk-c6b5nqct.js → chunk-45y8bjrv.js} +287 -352
  20. package/dist/{chunk-2rp09y5j.js → chunk-4evbx7sz.js} +1 -1
  21. package/dist/chunk-4jgr954p.js +2 -0
  22. package/dist/chunk-51j2aqvb.js +2 -0
  23. package/dist/{chunk-whm6bybj.js → chunk-54f8bpp6.js} +3 -3
  24. package/dist/{chunk-yfwyvh02.js → chunk-5k1hznvq.js} +2 -2
  25. package/dist/chunk-5qfpcgcs.js +2 -0
  26. package/dist/{chunk-7eg7ep8f.js → chunk-5tefa8qb.js} +2 -2
  27. package/dist/chunk-5x2fc4vk.js +30 -0
  28. package/dist/{chunk-683tfkz4.js → chunk-64djh88a.js} +1 -1
  29. package/dist/{chunk-btrmvj2y.js → chunk-695fkras.js} +1 -1
  30. package/dist/chunk-6hcc4973.js +2 -0
  31. package/dist/{chunk-y7dcdjav.js → chunk-6vswphz4.js} +2 -2
  32. package/dist/chunk-7gqbr8nr.js +2 -0
  33. package/dist/{chunk-x4prtyjs.js → chunk-7kw3grq5.js} +1 -1
  34. package/dist/{chunk-7jebw3ea.js → chunk-7skk34dh.js} +2 -2
  35. package/dist/chunk-8215nhej.js +12 -0
  36. package/dist/chunk-8ee62a9q.js +2 -0
  37. package/dist/{chunk-jj6yp7gm.js → chunk-8jam44my.js} +1 -1
  38. package/dist/chunk-8z0n5mtg.js +2 -0
  39. package/dist/{chunk-3bc8bqw2.js → chunk-9368t9jm.js} +1 -1
  40. package/dist/chunk-9499k64n.js +6 -0
  41. package/dist/chunk-976g5qe5.js +2 -0
  42. package/dist/{chunk-3jwmcf4k.js → chunk-9c835qjn.js} +1 -1
  43. package/dist/chunk-9px4y692.js +2 -0
  44. package/dist/{chunk-zn6xcc0a.js → chunk-9vqnrcrw.js} +2 -2
  45. package/dist/chunk-9wrrr7g3.js +4 -0
  46. package/dist/{chunk-95t0k8cz.js → chunk-9xzszvn5.js} +1 -1
  47. package/dist/chunk-a07chbgj.js +2 -0
  48. package/dist/{chunk-rdg1n42s.js → chunk-ankp4reb.js} +2 -2
  49. package/dist/{chunk-5d9cy7a0.js → chunk-awj7yy37.js} +1 -1
  50. package/dist/chunk-b1hd8kvy.js +2 -0
  51. package/dist/chunk-b4xwbh8a.js +2 -0
  52. package/dist/{chunk-1evf3bdg.js → chunk-bd9wrcq1.js} +205 -19
  53. package/dist/{chunk-q25mr70f.js → chunk-c131k3mt.js} +1 -1
  54. package/dist/chunk-c3tmzx7q.js +2 -0
  55. package/dist/{chunk-6btbgxh1.js → chunk-c79nfdyj.js} +1 -1
  56. package/dist/{chunk-cfgpk6bh.js → chunk-cbgh359m.js} +1 -1
  57. package/dist/chunk-ckzhp09g.js +2 -0
  58. package/dist/{chunk-weqpt9nt.js → chunk-cr8v8k53.js} +1 -1
  59. package/dist/{chunk-p3wwm6k4.js → chunk-d19tvdvv.js} +1 -1
  60. package/dist/{chunk-nb1zdh1y.js → chunk-d3srvh3q.js} +1 -1
  61. package/dist/{chunk-rqrfq305.js → chunk-d57gb0v2.js} +1 -1
  62. package/dist/{chunk-1xyhk1wr.js → chunk-d5cqnwdd.js} +1 -1
  63. package/dist/chunk-dgpjxmhs.js +2 -0
  64. package/dist/chunk-dvvx1wny.js +3 -0
  65. package/dist/{chunk-ctz53mbz.js → chunk-ej8mv2k6.js} +1 -1
  66. package/dist/{chunk-dv3z80gt.js → chunk-env6knrs.js} +1 -1
  67. package/dist/{chunk-rf10fkrf.js → chunk-ess2pgt5.js} +1 -1
  68. package/dist/chunk-ez28vck6.js +2 -0
  69. package/dist/{chunk-0tbgvp70.js → chunk-fczfdsab.js} +21 -5
  70. package/dist/{chunk-xdq52pwj.js → chunk-fp7ms6e7.js} +1 -1
  71. package/dist/{chunk-qg6pg6ze.js → chunk-fqq5k9ve.js} +1 -1
  72. package/dist/chunk-fvtv1s5j.js +3 -0
  73. package/dist/{chunk-5t0w4h6z.js → chunk-g912mb7x.js} +1 -1
  74. package/dist/chunk-g97atepq.js +2 -0
  75. package/dist/{chunk-wj25qt72.js → chunk-gbwhbasw.js} +1 -1
  76. package/dist/{chunk-f62fh1fw.js → chunk-gfc3qye3.js} +2 -2
  77. package/dist/{chunk-cratkhhb.js → chunk-ghw5p1yk.js} +1 -1
  78. package/dist/{chunk-f0g2q51j.js → chunk-gssbag3e.js} +1 -1
  79. package/dist/{chunk-c9vhtjtr.js → chunk-gt8ja700.js} +2 -2
  80. package/dist/chunk-hay1rzb0.js +3754 -0
  81. package/dist/{chunk-ftvmk1nj.js → chunk-hg2afckn.js} +1 -1
  82. package/dist/chunk-hgjjnjas.js +7 -0
  83. package/dist/{chunk-hhnzd03k.js → chunk-hrcxfvh1.js} +1 -1
  84. package/dist/chunk-hzav4hyd.js +2 -0
  85. package/dist/{chunk-29gjwajm.js → chunk-jfzfrmzy.js} +1 -1
  86. package/dist/chunk-jjq9q9jr.js +2 -0
  87. package/dist/{chunk-ddqkj56r.js → chunk-jp2f8yzw.js} +1 -1
  88. package/dist/{chunk-ry3a2674.js → chunk-jsg1rthc.js} +1 -1
  89. package/dist/chunk-jxxv18a0.js +5 -0
  90. package/dist/chunk-kbw2qzqx.js +2 -0
  91. package/dist/chunk-kdxvraec.js +2 -0
  92. package/dist/chunk-krfjb7b8.js +2 -0
  93. package/dist/{chunk-6b4k8fay.js → chunk-kxavsh3m.js} +1 -1
  94. package/dist/{chunk-4tffxxpd.js → chunk-m31n9pkr.js} +1 -1
  95. package/dist/{chunk-fj6fbqgb.js → chunk-m3a20mmb.js} +1 -1
  96. package/dist/{chunk-j21csh4j.js → chunk-mbmqpaq1.js} +1 -1
  97. package/dist/{chunk-y9nyqcha.js → chunk-mwh3ymwc.js} +1 -1
  98. package/dist/{chunk-51g95yts.js → chunk-mygq61f5.js} +2 -2
  99. package/dist/chunk-nqq7y7m9.js +3 -0
  100. package/dist/chunk-nws8fbde.js +2 -0
  101. package/dist/{chunk-q6xfyasj.js → chunk-pcvayb2f.js} +1 -1
  102. package/dist/{chunk-nvxv2wxv.js → chunk-ppyz9623.js} +1 -1
  103. package/dist/chunk-pr14wjkn.js +2 -0
  104. package/dist/{chunk-jb2r696a.js → chunk-qev11kg8.js} +1 -1
  105. package/dist/{chunk-6njgsr6w.js → chunk-qeyw5za9.js} +1 -1
  106. package/dist/chunk-rpfcnq8n.js +2 -0
  107. package/dist/chunk-rrankpmj.js +3 -0
  108. package/dist/chunk-rst1rw09.js +2 -0
  109. package/dist/{chunk-3p0zgfgz.js → chunk-rzevgemj.js} +2 -2
  110. package/dist/{chunk-aa6kt84c.js → chunk-sart9ehj.js} +1 -1
  111. package/dist/chunk-sb7ana2z.js +19 -0
  112. package/dist/chunk-snt2773t.js +2 -0
  113. package/dist/{chunk-jptkc64r.js → chunk-t3qb9s6s.js} +2 -2
  114. package/dist/{chunk-w8yac9xp.js → chunk-t41aaehf.js} +1 -1
  115. package/dist/{chunk-qjkzpd68.js → chunk-t51mwjyq.js} +1 -1
  116. package/dist/chunk-tt4r8q4v.js +2 -0
  117. package/dist/chunk-vd3h9z7e.js +2 -0
  118. package/dist/{chunk-6rzwef28.js → chunk-vd5xvsnv.js} +1 -1
  119. package/dist/chunk-wbecqx03.js +2 -0
  120. package/dist/{chunk-dcxtrqfy.js → chunk-wfffa8zm.js} +1 -1
  121. package/dist/{chunk-22p0ezj6.js → chunk-wx13qmaw.js} +1 -1
  122. package/dist/chunk-xd5ahrtn.js +2 -0
  123. package/dist/{chunk-2m6x8tcx.js → chunk-xganfzgn.js} +2 -2
  124. package/dist/chunk-xq1swv2e.js +2 -0
  125. package/dist/chunk-xsfwcj6x.js +2 -0
  126. package/dist/{chunk-91007tan.js → chunk-xwxdwqn9.js} +1 -1
  127. package/dist/{chunk-634gaa9d.js → chunk-xz3evxqp.js} +1 -1
  128. package/dist/chunk-xzgvcrnz.js +2 -0
  129. package/dist/chunk-y2kmm6bt.js +43 -0
  130. package/dist/{chunk-v8474ah4.js → chunk-y4nzmkea.js} +1 -1
  131. package/dist/chunk-y7wsk78j.js +3 -0
  132. package/dist/{chunk-6w8fa3b8.js → chunk-ya5m5vbn.js} +1 -1
  133. package/dist/{chunk-ps20v1ah.js → chunk-ym3r8ktq.js} +1 -1
  134. package/dist/chunk-yyebm8q4.js +2 -0
  135. package/dist/chunk-yyyxt326.js +2 -0
  136. package/dist/chunk-yz16bgs3.js +28 -0
  137. package/dist/{chunk-ew6tr7b1.js → chunk-z9ezmjwd.js} +2 -2
  138. package/dist/chunk-zbtfhxhn.js +2 -0
  139. package/dist/chunk-zggm7kjd.js +17 -0
  140. package/dist/{chunk-mdf3jbe6.js → chunk-zhcs8m2a.js} +2 -2
  141. package/dist/{chunk-f9d27v49.js → chunk-zs5y7xnt.js} +1 -1
  142. package/dist/cli.js +14 -14
  143. package/dist/client-script-bundler.js +22 -11
  144. package/dist/component-contract-checks.d.ts +19 -0
  145. package/dist/component-contract-checks.js +147 -0
  146. package/dist/component-contract.d.ts +20 -0
  147. package/dist/component-contract.js +108 -0
  148. package/dist/component-model.d.ts +29 -0
  149. package/dist/component-model.js +59 -0
  150. package/dist/component-registry.js +7 -64
  151. package/dist/component-renderer.d.ts +1 -26
  152. package/dist/component-renderer.js +4 -239
  153. package/dist/component-resolution.d.ts +21 -0
  154. package/dist/component-resolution.js +118 -0
  155. package/dist/component-tags.d.ts +9 -0
  156. package/dist/component-tags.js +174 -0
  157. package/dist/composable-loader.d.ts +2 -13
  158. package/dist/composable-loader.js +15 -26
  159. package/dist/composables/index.d.ts +1 -0
  160. package/dist/composables/index.js +1 -0
  161. package/dist/composables/use-fetch.d.ts +117 -42
  162. package/dist/composables/use-fetch.js +47 -4
  163. package/dist/composition-api.d.ts +43 -19
  164. package/dist/config.d.ts +1 -1
  165. package/dist/config.js +46 -4
  166. package/dist/craft-entry.js +1 -1
  167. package/dist/craft.js +1 -1
  168. package/dist/database.js +1 -1
  169. package/dist/dev-server/serve-app.js +57 -17
  170. package/dist/dev-server/serve-file.js +8 -1
  171. package/dist/expressions.js +1 -1
  172. package/dist/imported-signals.js +1 -1
  173. package/dist/includes.js +8 -2
  174. package/dist/index.d.ts +11 -0
  175. package/dist/index.js +7 -0
  176. package/dist/manifest.d.ts +6 -0
  177. package/dist/misc-directives.d.ts +2 -0
  178. package/dist/misc-directives.js +39 -1
  179. package/dist/process.js +18 -1
  180. package/dist/production-builder.d.ts +4 -0
  181. package/dist/production-builder.js +47 -8
  182. package/dist/production-server.d.ts +4 -1
  183. package/dist/production-server.js +119 -71
  184. package/dist/pwa.js +2 -2
  185. package/dist/render.js +9 -2
  186. package/dist/route-response-cache.d.ts +7 -0
  187. package/dist/route-response-cache.js +72 -0
  188. package/dist/route-rules.d.ts +17 -0
  189. package/dist/route-rules.js +40 -0
  190. package/dist/router.d.ts +1 -0
  191. package/dist/runtime-config-loader.d.ts +5 -0
  192. package/dist/runtime-config-loader.js +42 -0
  193. package/dist/runtime-config-server.d.ts +26 -0
  194. package/dist/runtime-config-server.js +77 -0
  195. package/dist/runtime-config-types.d.ts +2 -0
  196. package/dist/runtime-config-types.js +0 -0
  197. package/dist/runtime-config.d.ts +5 -0
  198. package/dist/runtime-config.js +9 -0
  199. package/dist/runtime-globals.js +3 -0
  200. package/dist/serve.js +32 -10
  201. package/dist/server-api.d.ts +27 -0
  202. package/dist/server-api.js +181 -0
  203. package/dist/server-data.d.ts +17 -0
  204. package/dist/server-data.js +40 -0
  205. package/dist/signal-processing.js +2 -2
  206. package/dist/signals.js +138 -15
  207. package/dist/ssg.js +2 -2
  208. package/dist/stx-virtual-ts.d.ts +6 -0
  209. package/dist/stx-virtual-ts.js +31 -7
  210. package/dist/stx.d.ts +28 -0
  211. package/dist/template-compiler.d.ts +1 -0
  212. package/dist/template-compiler.js +1 -1
  213. package/dist/template-hydrator.js +15 -4
  214. package/dist/typecheck.d.ts +1 -0
  215. package/dist/typecheck.js +4 -3
  216. package/dist/types/config-types.d.ts +17 -0
  217. package/dist/utils.js +15 -5
  218. package/dist/variable-extractor.d.ts +1 -1
  219. package/dist/variable-extractor.js +12 -1
  220. package/dist/visual-testing.js +1 -1
  221. package/dist/vue-template.js +19 -41
  222. package/package.json +5 -5
  223. package/stx.d.ts +28 -0
  224. package/dist/chunk-0p44z42s.js +0 -2
  225. package/dist/chunk-2jd9bxmf.js +0 -2
  226. package/dist/chunk-2yp8ang5.js +0 -2
  227. package/dist/chunk-35x7s4cr.js +0 -2
  228. package/dist/chunk-3bqz5zre.js +0 -2
  229. package/dist/chunk-48p0k8y7.js +0 -2
  230. package/dist/chunk-4b625drg.js +0 -2
  231. package/dist/chunk-593kby1d.js +0 -2
  232. package/dist/chunk-5nac67r4.js +0 -18
  233. package/dist/chunk-70cf5h11.js +0 -2
  234. package/dist/chunk-78akhaws.js +0 -2
  235. package/dist/chunk-9a4q74r6.js +0 -2
  236. package/dist/chunk-9f5329rv.js +0 -2
  237. package/dist/chunk-9rv7akqq.js +0 -30
  238. package/dist/chunk-apjy1a72.js +0 -12
  239. package/dist/chunk-b3p3bzax.js +0 -3
  240. package/dist/chunk-c5hk1fxt.js +0 -2
  241. package/dist/chunk-c9rs5g1s.js +0 -2
  242. package/dist/chunk-dkd0bg8g.js +0 -2
  243. package/dist/chunk-dxhtry04.js +0 -2
  244. package/dist/chunk-ehp6fez3.js +0 -2
  245. package/dist/chunk-em3jb1dn.js +0 -4
  246. package/dist/chunk-ev4djb0p.js +0 -2
  247. package/dist/chunk-frejnjh9.js +0 -2
  248. package/dist/chunk-fvcr26a0.js +0 -22
  249. package/dist/chunk-g6ttsdz1.js +0 -2
  250. package/dist/chunk-gd73rpks.js +0 -2
  251. package/dist/chunk-ggwnrdqz.js +0 -17
  252. package/dist/chunk-h3t6fjba.js +0 -2
  253. package/dist/chunk-jc57j887.js +0 -2
  254. package/dist/chunk-jw248h1d.js +0 -2
  255. package/dist/chunk-k5xtf38q.js +0 -3
  256. package/dist/chunk-m78y5qys.js +0 -19
  257. package/dist/chunk-mc4rtf5d.js +0 -2
  258. package/dist/chunk-mx2wcb15.js +0 -2
  259. package/dist/chunk-p4w3wjbv.js +0 -2
  260. package/dist/chunk-pm3k8dyk.js +0 -2
  261. package/dist/chunk-qr59yfq9.js +0 -2
  262. package/dist/chunk-qsmdvy1z.js +0 -2
  263. package/dist/chunk-rsxmjfxq.js +0 -3754
  264. package/dist/chunk-s4sp78fn.js +0 -2
  265. package/dist/chunk-v2fp9vkh.js +0 -2
  266. package/dist/chunk-vwnnbzsp.js +0 -2
  267. package/dist/chunk-w0g99tx9.js +0 -2
  268. package/dist/chunk-x2pk87q2.js +0 -3
  269. package/dist/chunk-xn0asg46.js +0 -2
  270. package/dist/chunk-xwmw1wtk.js +0 -2
  271. package/dist/chunk-zdx9s3z0.js +0 -28
@@ -3,6 +3,7 @@ import { evaluateExpression, escapeHtmlValue } from "./expressions.js";
3
3
  import { replacePlaceholders, hasPlaceholders } from "./placeholder.js";
4
4
  import { runPageAction } from "./page-action.js";
5
5
  import { readResponseHeaders, readResponseStatus } from "./page-response.js";
6
+ import { serverDataTag } from "./server-data.js";
6
7
  export async function hydrateTemplate(compiled, requestContext = {}) {
7
8
  return (await runHydration(compiled, requestContext)).html;
8
9
  }
@@ -37,6 +38,8 @@ async function runHydration(compiled, requestContext) {
37
38
  try {
38
39
  await extractVariables(scriptContent, context, compiled.sourceFile);
39
40
  } catch (error) {
41
+ if (requestContext.__stx_strict_hydration)
42
+ throw error;
40
43
  console.warn(`[stx] Server script error in ${compiled.sourceFile}:`, error);
41
44
  }
42
45
  const action = await runPageAction(context, {
@@ -44,11 +47,17 @@ async function runHydration(compiled, requestContext) {
44
47
  method: requestContext.method,
45
48
  params: requestContext.params ?? {},
46
49
  cookies: requestContext.cookies ?? {}
47
- });
50
+ }), withServerData = (html) => {
51
+ const clean = html.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi, ""), tag = serverDataTag(context);
52
+ if (!tag)
53
+ return clean;
54
+ const head = clean.indexOf("</head>");
55
+ return head < 0 ? tag + clean : clean.slice(0, head) + tag + clean.slice(head);
56
+ };
48
57
  if (action.redirect)
49
58
  return { html: compiled.html, context, redirect: action.redirect, cookies: action.cookies };
50
59
  if (!hasPlaceholders(compiled.html))
51
- return { html: compiled.html, context, cookies: action.cookies };
60
+ return { html: withServerData(compiled.html), context, cookies: action.cookies };
52
61
  const values = new Map;
53
62
  for (const [token, info] of Object.entries(compiled.placeholders))
54
63
  if (info.expression)
@@ -58,10 +67,12 @@ async function runHydration(compiled, requestContext) {
58
67
  values.set(token, value !== void 0 && value !== null ? String(value) : "");
59
68
  else
60
69
  values.set(token, value !== void 0 && value !== null ? escapeHtmlValue(String(value)) : "");
61
- } catch {
70
+ } catch (error) {
71
+ if (requestContext.__stx_strict_hydration)
72
+ throw error;
62
73
  values.set(token, "");
63
74
  }
64
- return { html: replacePlaceholders(compiled.html, values), context, cookies: action.cookies };
75
+ return { html: withServerData(replacePlaceholders(compiled.html, values)), context, cookies: action.cookies };
65
76
  }
66
77
  export async function hydrateFragment(compiled, requestContext = {}) {
67
78
  if (!compiled.hasServerScripts && !hasPlaceholders(compiled.fragment))
@@ -48,6 +48,7 @@ export declare interface TypecheckDiagnostic {
48
48
  expression?: string
49
49
  }
50
50
  export declare interface TypecheckOptions {
51
+ componentsDir?: string
51
52
  extraLibs?: string[]
52
53
  client?: boolean
53
54
  server?: boolean
package/dist/typecheck.js CHANGED
@@ -4,6 +4,7 @@ import path from "node:path";
4
4
  import { listComposableModules } from "./composable-loader.js";
5
5
  import { STX_RUNTIME_GLOBALS } from "./runtime-globals.js";
6
6
  import { stateDir } from "./state-dir.js";
7
+ import { loadStxConfig } from "./config.js";
7
8
  import {
8
9
  absolutizeRelativeSpecifiers,
9
10
  buildVirtualTypeScript,
@@ -189,7 +190,7 @@ function readProjectPathAliases(startDir) {
189
190
  return { paths: absolute };
190
191
  }
191
192
  export async function typecheckStxFiles(files, options = {}) {
192
- const checkClient = options.client !== !1, checkServer = options.server !== !1, checkTemplates = options.templates !== !1, virtualFiles = new Map, scrapedByFile = new Map, checkedFiles = [];
193
+ const checkClient = options.client !== !1, checkServer = options.server !== !1, checkTemplates = options.templates !== !1, componentsDir = options.componentsDir ?? (checkTemplates ? (await loadStxConfig()).componentsDir : void 0), virtualFiles = new Map, scrapedByFile = new Map, checkedFiles = [];
193
194
  let blockCount = 0, expressionCount = 0;
194
195
  const runtimeTypes = findRuntimeTypeDeclarations();
195
196
  for (const file of files) {
@@ -204,7 +205,7 @@ export async function typecheckStxFiles(files, options = {}) {
204
205
  if (names.length > 0)
205
206
  scrapedByFile.set(file, { names, line: clientBlocks[0].startLine, kind: clientBlocks[0].kind });
206
207
  }
207
- const originDir = path.dirname(path.resolve(file)), templateBuffer = checkTemplates ? buildVirtualTypeScript(source, { runtimeGlobals: !runtimeTypes, originDir }) : null, expressions = templateBuffer ? [...templateBuffer.lineMap.values()].filter((m) => m.expression).length : 0;
208
+ const originDir = path.dirname(path.resolve(file)), templateBuffer = checkTemplates ? buildVirtualTypeScript(source, { runtimeGlobals: !runtimeTypes, originDir, filePath: path.resolve(file), componentsDir }) : null, expressions = templateBuffer ? [...templateBuffer.lineMap.values()].filter((m) => m.expression).length : 0;
208
209
  if (blocks.length === 0 && expressions === 0)
209
210
  continue;
210
211
  checkedFiles.push(file);
@@ -286,7 +287,7 @@ export async function typecheckStxFiles(files, options = {}) {
286
287
  const ambientBasenames = new Set(ambient.map((lib) => lib.split("/").pop()));
287
288
  let ambientDiagnostics = 0;
288
289
  const unparseable = new Set, parseTscOutput = (text) => {
289
- for (const rawLine of text.split(`
290
+ for (const rawLine of text.replace(/\n[\t ]+([^\n]*)/g, " $1").split(`
290
291
  `)) {
291
292
  const m = rawLine.match(TSC_LINE_RE);
292
293
  if (!m)
@@ -8,6 +8,8 @@ import type { PwaConfig } from './pwa-types';
8
8
  import type { CspConfig } from './csp-types';
9
9
  import type { HeatmapConfig } from '../heatmap';
10
10
  import type { MediaConfig } from '../media/types';
11
+ import type { RouteRules } from '../route-rules';
12
+ import type { ServerApiOptions } from '../server-api';
11
13
  /**
12
14
  * Internationalization (i18n) configuration
13
15
  */
@@ -842,6 +844,21 @@ export interface StxConfig {
842
844
  * Handlers receive the standard Request and return a Response.
843
845
  */
844
846
  apiRoutes?: Record<string, (request: Request) => Response | Promise<Response>>;
847
+ /** Per-route production rendering and anonymous origin-cache policies. */
848
+ routeRules?: RouteRules;
849
+ /** Opt-in file-based API endpoints, relative to the config/project directory. */
850
+ serverApi?: boolean | ServerApiOptions;
851
+ /** Deployment-time values. Only public is serialized for browsers. */
852
+ runtimeConfig?: import('../runtime-config-server').RuntimeConfigDefaults;
853
+ /** Local paths or installed application-layer packages, highest priority first. */
854
+ extends?: string[];
855
+ /** @internal Resolved application-layer provenance and resource search roots. */
856
+ _layerGraph?: import('../application-layers').ApplicationLayerGraph;
857
+ _layerPageDirs?: string[];
858
+ _layerComponentDirs?: string[];
859
+ _layerLayoutDirs?: string[];
860
+ _layerPartialDirs?: string[];
861
+ _layerComposableDirs?: string[];
845
862
  /**
846
863
  * Client-side router configuration
847
864
  */
package/dist/utils.js CHANGED
@@ -20,6 +20,7 @@ import { processScopedStyles } from "./style-scoping.js";
20
20
  import { findSfcTemplateBlock } from "./sfc-template.js";
21
21
  import { importOnce } from "./lazy-module.js";
22
22
  import { stashScriptElements } from "./html-masking.js";
23
+ import { markProjectedRefs } from "./misc-directives.js";
23
24
  export {
24
25
  extractDirectiveNames,
25
26
  getPositionInfo,
@@ -421,6 +422,8 @@ export async function userComponentFileExists(componentPath, componentsDir, pare
421
422
  push(path.resolve(configuredRoot, "src/components"));
422
423
  push(path.resolve(configuredRoot, "components"));
423
424
  }
425
+ for (const dir of options._layerComponentDirs ?? [])
426
+ push(dir);
424
427
  const pluginDirs = options._pluginComponentDirs;
425
428
  if (Array.isArray(pluginDirs))
426
429
  for (const dir of pluginDirs)
@@ -456,7 +459,7 @@ export function slotContentHasExpressions(slotContent) {
456
459
  return /\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(withoutScripts);
457
460
  }
458
461
  export function componentClientSignalNames(scripts) {
459
- const names = new Set, declaration = /\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;
462
+ const names = new Set, declaration = /\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;
460
463
  for (const script of scripts) {
461
464
  let match;
462
465
  while ((match = declaration.exec(script)) !== null)
@@ -499,6 +502,7 @@ export async function renderComponentWithSlot(componentPath, props, slotContent,
499
502
  `${kebabToPascal(baseName)}.stx`,
500
503
  `${pascalToKebab(baseName)}.stx`
501
504
  ], uniqueVariants = [...new Set(fileVariants)], originalFilePath = parentContext.__originalFilePath, searchDirs = [];
505
+ searchDirs.push(...options._layerComponentDirs ?? []);
502
506
  if (originalFilePath) {
503
507
  const originalDir = path.join(path.dirname(originalFilePath), "components");
504
508
  searchDirs.push(originalDir);
@@ -627,6 +631,7 @@ ${triedPaths.map((p) => ` - ${p}`).join(`
627
631
  "__importedComponents",
628
632
  COMPONENT_CLIENT_FACTORIES_CONTEXT_KEY,
629
633
  "__stx_client_signal_names",
634
+ "__stx_runtime_config",
630
635
  "__stxServeContext",
631
636
  "__stx_scope_seq"
632
637
  ]), filteredParentContext = {};
@@ -678,6 +683,7 @@ ${triedPaths.map((p) => ` - ${p}`).join(`
678
683
  slot: slotContent,
679
684
  buildMode: options.buildMode ?? "",
680
685
  skipEventDirectives: options.skipEventDirectives === !0,
686
+ layers: options._layerGraph?.layers.map((layer) => layer.configFile),
681
687
  uid: componentUid
682
688
  });
683
689
  if (serializedInput !== null) {
@@ -745,9 +751,12 @@ ${triedPaths.map((p) => ` - ${p}`).join(`
745
751
  }
746
752
  if (slotContent && templateContent.includes("{{ text || slot }}"))
747
753
  templateContent = templateContent.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g, () => slotContent);
748
- const { applySlots } = await importOnce("stx/slots", () => import("./slots.js")), { defaultSlot, namedSlots } = parsedSlotContent;
749
- templateContent = await applySlots(templateContent, defaultSlot, namedSlots, componentContext);
750
- const hasSignalScripts = clientScripts.some((s) => /\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(s)), clientSignalNames = componentClientSignalNames(clientScripts), inheritedClientSignalNames = Array.isArray(componentContext.__stx_client_signal_names) ? componentContext.__stx_client_signal_names : [];
754
+ const { applySlots } = await importOnce("stx/slots", () => import("./slots.js")), { defaultSlot, namedSlots } = parsedSlotContent, hasSignalScripts = clientScripts.some((s) => /\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(s)), projectRefs = (content) => hasSignalScripts ? markProjectedRefs(content, componentUid) : content, projectedSlots = new Map([...namedSlots].map(([name, slot]) => [name, {
755
+ ...slot,
756
+ content: projectRefs(slot.content)
757
+ }]));
758
+ templateContent = await applySlots(templateContent, projectRefs(defaultSlot), projectedSlots, componentContext);
759
+ const clientSignalNames = componentClientSignalNames(clientScripts), inheritedClientSignalNames = Array.isArray(componentContext.__stx_client_signal_names) ? componentContext.__stx_client_signal_names : [];
751
760
  if (clientSignalNames.length > 0 || inheritedClientSignalNames.length > 0)
752
761
  componentContext.__stx_client_signal_names = [...new Set([...inheritedClientSignalNames, ...clientSignalNames])];
753
762
  const componentOptions = {
@@ -857,7 +866,7 @@ export async function resolveTemplatePath(templatePath, currentFilePath, options
857
866
  const safeUnderCwd = assertInsideRoot(result, process.cwd());
858
867
  if (safeUnderCwd)
859
868
  return safeUnderCwd;
860
- const trustedDirs = [options.root, options.layoutsDir, options.fallbackLayoutsDir, options.componentsDir, options.partialsDir, options.pagesDir].filter((d) => typeof d === "string" && d.length > 0);
869
+ const trustedDirs = [options.root, options.layoutsDir, options.fallbackLayoutsDir, options.componentsDir, options.partialsDir, options.pagesDir, ...options._layerLayoutDirs ?? []].filter((d) => typeof d === "string" && d.length > 0);
861
870
  for (const dir of trustedDirs) {
862
871
  const resolvedDir = path.isAbsolute(dir) ? dir : path.resolve(process.cwd(), dir);
863
872
  if (assertInsideRoot(result, resolvedDir))
@@ -902,6 +911,7 @@ async function resolveTemplatePathInner(templatePath, currentFilePath, options,
902
911
  }
903
912
  }
904
913
  const layoutSearchDirs = [];
914
+ layoutSearchDirs.push(...options._layerLayoutDirs ?? []);
905
915
  if (options.layoutsDir)
906
916
  layoutSearchDirs.push(path.isAbsolute(options.layoutsDir) ? options.layoutsDir : path.resolve(process.cwd(), options.layoutsDir));
907
917
  let searchDir = path.resolve(dirPath);
@@ -19,7 +19,7 @@
19
19
  * generated `await import('stx')` rejected and the shadowing binding was never
20
20
  * created. The failure needed a real install to appear.
21
21
  */
22
- export declare const STX_ENGINE_BINDING_NAMES: readonly ['module', 'exports', 'require', 'props', '$props', 'defineProps', 'withDefaults', 'defineClientPayload', 'state', 'derived', 'effect', 'batch', 'onMount', 'onDestroy', 'definePageMeta', 'useRoute', 'useRouter', 'useHead', 'useSeoMeta', 'setResponseStatus', 'setResponseHeader', 'notFound', 'ref', 'reactive', 'computed', 'watch', 'onMounted', 'onUnmounted', 'nextTick', 'defineEmits', 'defineExpose', 'defineSlots', 'provide', 'inject', 'useColorMode', 'useDark', 'useMediaQuery', 'useScrollLock', 'usePreferredDark', 'usePreferredLight', 'usePreferredReducedMotion', 'usePreferredContrast', 'window', 'document', 'console', 'confirm', 'alert', 'fetch', 'params'];
22
+ export declare const STX_ENGINE_BINDING_NAMES: readonly ['module', 'exports', 'require', 'props', '$props', 'defineProps', 'withDefaults', 'defineClientPayload', 'useServerData', 'useRuntimeConfig', 'useServerRuntimeConfig', 'state', 'derived', 'effect', 'batch', 'onMount', 'onDestroy', 'definePageMeta', 'useRoute', 'useRouter', 'useHead', 'useSeoMeta', 'setResponseStatus', 'setResponseHeader', 'notFound', 'ref', 'reactive', 'computed', 'watch', 'onMounted', 'onUnmounted', 'nextTick', 'defineEmits', 'defineExpose', 'defineSlots', 'provide', 'inject', 'useColorMode', 'useDark', 'useMediaQuery', 'useScrollLock', 'usePreferredDark', 'usePreferredLight', 'usePreferredReducedMotion', 'usePreferredContrast', 'window', 'document', 'console', 'confirm', 'alert', 'fetch', 'params'];
23
23
  /**
24
24
  * Strip TypeScript-specific syntax to make it executable as JavaScript
25
25
  *
@@ -1,5 +1,8 @@
1
1
  var {require}=import.meta;import path from "node:path";
2
2
  import process from "node:process";
3
+ import { useServerData, withServerData } from "./server-data.js";
4
+ import { prepareRuntimeConfig } from "./runtime-config-loader.js";
5
+ import { currentRuntimeConfig, resolveRuntimeConfig, useRuntimeConfig, useServerRuntimeConfig, withRuntimeConfig } from "./runtime-config-server.js";
3
6
  import { getSharedTranspiler } from "./utils.js";
4
7
  export const STX_ENGINE_BINDING_NAMES = [
5
8
  "module",
@@ -10,6 +13,9 @@ export const STX_ENGINE_BINDING_NAMES = [
10
13
  "defineProps",
11
14
  "withDefaults",
12
15
  "defineClientPayload",
16
+ "useServerData",
17
+ "useRuntimeConfig",
18
+ "useServerRuntimeConfig",
13
19
  "state",
14
20
  "derived",
15
21
  "effect",
@@ -525,7 +531,10 @@ export async function extractVariables(scriptContent, context, filePath, options
525
531
  scriptFn = Function(...scriptParams, scriptBody);
526
532
  compiledServerScripts.set(compileKey, scriptFn);
527
533
  }
528
- const result = await scriptFn(module, exports, requireFn, propsObj, $props, defineProps, withDefaults, defineClientPayload, state, derived, effect, batch, onMount, onDestroy, definePageMeta, useRoute, useRouter, useHead, useSeoMeta, responseApi.setResponseStatus, responseApi.setResponseHeader, responseApi.notFound, ref, reactive, computed, watch, onMounted, onUnmounted, nextTick, defineEmits, defineExpose, defineSlots, provide, inject, useColorMode, useDark, useMediaQuery, useScrollLock, usePreferredDark, usePreferredLight, usePreferredReducedMotion, usePreferredContrast, windowProxy, mockDocument, mockConsole, mockWindow.confirm, mockWindow.alert, mockWindow.fetch, paramsObj, ...propArgValues, ...scriptContextValues);
534
+ const hostRuntimeConfig = context.__stx_options?.runtimeConfig;
535
+ if (hostRuntimeConfig || /\buse(?:Server)?RuntimeConfig\b/.test(jsContent))
536
+ await prepareRuntimeConfig(context, filePath, hostRuntimeConfig);
537
+ const result = await withRuntimeConfig(context.__stx_runtime_config ?? currentRuntimeConfig() ?? resolveRuntimeConfig(), () => withServerData(context, () => scriptFn(module, exports, requireFn, propsObj, $props, defineProps, withDefaults, defineClientPayload, useServerData, useRuntimeConfig, useServerRuntimeConfig, state, derived, effect, batch, onMount, onDestroy, definePageMeta, useRoute, useRouter, useHead, useSeoMeta, responseApi.setResponseStatus, responseApi.setResponseHeader, responseApi.notFound, ref, reactive, computed, watch, onMounted, onUnmounted, nextTick, defineEmits, defineExpose, defineSlots, provide, inject, useColorMode, useDark, useMediaQuery, useScrollLock, usePreferredDark, usePreferredLight, usePreferredReducedMotion, usePreferredContrast, windowProxy, mockDocument, mockConsole, mockWindow.confirm, mockWindow.alert, mockWindow.fetch, paramsObj, ...propArgValues, ...scriptContextValues)));
529
538
  if (options.preserveExisting) {
530
539
  for (const [key, value] of Object.entries(result))
531
540
  if (!(key in context) || context[key] === void 0)
@@ -536,6 +545,8 @@ export async function extractVariables(scriptContent, context, filePath, options
536
545
  if (!(key in context))
537
546
  context[key] = value;
538
547
  } catch (primaryError) {
548
+ if (context.__stx_strict_hydration)
549
+ throw primaryError;
539
550
  const msg = primaryError instanceof Error ? primaryError.message : String(primaryError);
540
551
  if (isModuleResolutionFailure(msg))
541
552
  console.warn(`[stx] server <script> in ${filePath ?? "<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${msg}`);
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ddqkj56r.js";import B from"fs";import $ from"path";import k from"crypto";var V=[{name:"mobile",width:375,height:667,isMobile:!0,hasTouch:!0},{name:"tablet",width:768,height:1024,isMobile:!0,hasTouch:!0},{name:"desktop",width:1280,height:800,isMobile:!1,hasTouch:!1},{name:"wide",width:1920,height:1080,isMobile:!1,hasTouch:!1}];function J(N={}){let Y={snapshotDir:N.snapshotDir||"__snapshots__",screenshotDir:N.screenshotDir||"__screenshots__",updateSnapshots:N.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true",threshold:N.threshold??0.01,viewports:N.viewports||V,generateDiff:N.generateDiff??!0,diffDir:N.diffDir||"__diffs__",compare:N.compare||b,ci:N.ci??process.env.CI==="true",retries:N.retries??(N.ci?3:1)};return{async snapshot(M,X){let q=$.join(Y.snapshotDir,`${X}.html`),G=C(M),Q=K(G);if(await Bun.file(q).exists()){let W=await Bun.file(q).text(),Z=K(C(W));if(Q===Z)return{passed:!0,snapshotPath:q,message:"Snapshot matches"};if(Y.updateSnapshots)return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};let F=$.join(Y.diffDir,`${X}.actual.html`),U=$.join(Y.diffDir,`${X}.diff.html`);return await B.promises.mkdir(Y.diffDir,{recursive:!0}),await Bun.write(F,G),await Bun.write(U,I(W,G)),{passed:!1,snapshotPath:q,actualPath:F,diffPath:U,message:"Snapshot does not match"}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},async snapshotJson(M,X){let q=$.join(Y.snapshotDir,`${X}.json`),G=JSON.stringify(M,null,2);if(await Bun.file(q).exists()){let Q=await Bun.file(q).text();if(G===Q)return{passed:!0,snapshotPath:q};if(Y.updateSnapshots)return await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};return{passed:!1,snapshotPath:q,message:`JSON snapshot mismatch:
2
+ import"./chunk-jp2f8yzw.js";import B from"fs";import $ from"path";import k from"crypto";var V=[{name:"mobile",width:375,height:667,isMobile:!0,hasTouch:!0},{name:"tablet",width:768,height:1024,isMobile:!0,hasTouch:!0},{name:"desktop",width:1280,height:800,isMobile:!1,hasTouch:!1},{name:"wide",width:1920,height:1080,isMobile:!1,hasTouch:!1}];function J(N={}){let Y={snapshotDir:N.snapshotDir||"__snapshots__",screenshotDir:N.screenshotDir||"__screenshots__",updateSnapshots:N.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true",threshold:N.threshold??0.01,viewports:N.viewports||V,generateDiff:N.generateDiff??!0,diffDir:N.diffDir||"__diffs__",compare:N.compare||b,ci:N.ci??process.env.CI==="true",retries:N.retries??(N.ci?3:1)};return{async snapshot(M,X){let q=$.join(Y.snapshotDir,`${X}.html`),G=C(M),Q=K(G);if(await Bun.file(q).exists()){let W=await Bun.file(q).text(),Z=K(C(W));if(Q===Z)return{passed:!0,snapshotPath:q,message:"Snapshot matches"};if(Y.updateSnapshots)return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};let F=$.join(Y.diffDir,`${X}.actual.html`),U=$.join(Y.diffDir,`${X}.diff.html`);return await B.promises.mkdir(Y.diffDir,{recursive:!0}),await Bun.write(F,G),await Bun.write(U,I(W,G)),{passed:!1,snapshotPath:q,actualPath:F,diffPath:U,message:"Snapshot does not match"}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},async snapshotJson(M,X){let q=$.join(Y.snapshotDir,`${X}.json`),G=JSON.stringify(M,null,2);if(await Bun.file(q).exists()){let Q=await Bun.file(q).text();if(G===Q)return{passed:!0,snapshotPath:q};if(Y.updateSnapshots)return await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};return{passed:!1,snapshotPath:q,message:`JSON snapshot mismatch:
3
3
  ${z(Q,G)}`}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},matchInlineSnapshot(M,X){let q=C(M);if(X===void 0)return{passed:!0,expected:q};let G=C(X);return{passed:q===G,expected:q}},getConfig(){return Y}}}function D(N={}){let Y=J(N),M=Y.getConfig();return{async compareScreenshots(X,q,G="desktop"){let Q=$.join(M.screenshotDir,G,`${X}.png`),W=$.join(M.diffDir,G,`${X}.actual.png`),Z=$.join(M.diffDir,G,`${X}.diff.png`);if(await Bun.file(Q).exists()){let F=await Bun.file(Q).arrayBuffer(),U=Buffer.from(F),_=await M.compare(q,U);if(_.match||_.diffPercentage<=M.threshold)return{viewport:G,passed:!0,baselinePath:Q};if(M.updateSnapshots)return await B.promises.mkdir($.dirname(Q),{recursive:!0}),await Bun.write(Q,q),{viewport:G,passed:!0,baselinePath:Q};if(await B.promises.mkdir($.dirname(W),{recursive:!0}),await Bun.write(W,q),_.diffImage&&M.generateDiff)await Bun.write(Z,_.diffImage);return{viewport:G,passed:!1,baselinePath:Q,actualPath:W,diffPath:M.generateDiff?Z:void 0,diffPercentage:_.diffPercentage}}return await B.promises.mkdir($.dirname(Q),{recursive:!0}),await Bun.write(Q,q),{viewport:G,passed:!0,baselinePath:Q}},async testViewports(X,q,G=M.viewports){let Q=[];for(let W of G){let Z=null;for(let F=0;F<M.retries;F++)try{let U=await q(W),_=await this.compareScreenshots(X,U,W.name);Q.push(_),Z=null;break}catch(U){if(Z=U,F<M.retries-1)await new Promise((_)=>setTimeout(_,100*(F+1)))}if(Z)Q.push({viewport:W.name,passed:!1,baselinePath:"",diffPercentage:100})}return Q},getSnapshotTester(){return Y}}}function L(N={}){let M=D(N).getSnapshotTester(),X=new Map;return{addStory(q){X.set(`${q.component}/${q.name}`,q)},addStories(q){for(let G of q)this.addStory(G)},getStories(){return Array.from(X.values())},getStoriesForComponent(q){return Array.from(X.values()).filter((G)=>G.component===q)},async testStory(q){let G=X.get(q);if(!G)return{name:q,passed:!1,duration:0,snapshots:[],screenshots:[],errors:[Error(`Story not found: ${q}`)]};let Q=Date.now(),W={name:q,passed:!0,duration:0,snapshots:[],screenshots:[],errors:[]};try{let Z=await G.render(),F=await M.snapshot(Z,q.replace(/\//g,"-"));if(W.snapshots.push(F),!F.passed)W.passed=!1}catch(Z){W.passed=!1,W.errors.push(Z)}return W.duration=Date.now()-Q,W},async testAllStories(){let q=[];for(let G of X.keys()){let Q=await this.testStory(G);q.push(Q)}return q},async generateStoryIndex(){let q={};for(let G of X.values()){if(!q[G.component])q[G.component]=[];q[G.component].push({name:G.name,args:G.args})}return JSON.stringify(q,null,2)}}}async function S(N,Y={}){let M={outputDir:Y.outputDir||"visual-test-report",format:Y.format||"html",title:Y.title||"Visual Test Report",includeScreenshots:Y.includeScreenshots??!0};await B.promises.mkdir(M.outputDir,{recursive:!0});let X=N.length,q=N.filter((F)=>F.passed).length,G=X-q,Q=N.reduce((F,U)=>F+U.duration,0);if(M.format==="json"){let F={title:M.title,summary:{total:X,passed:q,failed:G,duration:Q},results:N,generatedAt:new Date().toISOString()},U=$.join(M.outputDir,"report.json");return await Bun.write(U,JSON.stringify(F,null,2)),U}if(M.format==="markdown"){let F=`# ${M.title}
4
4
 
5
5
  `;F+=`## Summary
@@ -330,50 +330,28 @@ function transformVModel(html) {
330
330
  const tag = findNextOpenTag(result, searchFrom);
331
331
  if (!tag)
332
332
  break;
333
- let currentAttrs = tag.attrs, hadNamedVModel = !1;
334
- const namedVModelRegex = /v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/;
335
- let namedMatch = currentAttrs.match(namedVModelRegex);
336
- while (namedMatch) {
337
- hadNamedVModel = !0;
338
- const propName = namedMatch[1], _modifiers = namedMatch[2], expr = namedMatch[3];
339
- currentAttrs = currentAttrs.replace(namedMatch[0], "");
340
- currentAttrs += ` :${propName}="${expr}" @update:${propName}="${expr} = $event"`;
341
- namedMatch = currentAttrs.match(namedVModelRegex);
342
- }
343
- if (hadNamedVModel) {
344
- const range = getElementRange(result, tag), element = result.slice(range.outerStart, range.outerEnd), newElement = replaceTagAttrs(element, {
345
- ...tag,
346
- start: 0,
347
- end: tag.end - tag.start
348
- }, currentAttrs);
349
- result = result.slice(0, range.outerStart) + newElement + result.slice(range.outerEnd);
350
- searchFrom = range.outerStart + newElement.length;
351
- continue;
352
- }
353
- const modelValue = extractDirectiveValue(tag.attrs, "v-model");
354
- if (modelValue === null) {
333
+ const isNative = NATIVE_ELEMENTS.has(tag.tag), newAttrs = tag.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g, (attribute, name, value) => {
334
+ const model = /^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(name);
335
+ if (!model || !value || !/^["']/.test(value))
336
+ return attribute;
337
+ const prop = model[1] || "modelValue", suffix = model[2];
338
+ if (isNative && !model[1])
339
+ return `@model${suffix}=${value}`;
340
+ const quote = value[0], expression = value.slice(1, -1);
341
+ let binding = `:${prop}=${value} @update:${prop}=${quote}${expression} = $event${quote}`;
342
+ if (suffix) {
343
+ const modifierProp = model[1] ? `${prop}Modifiers` : "modelModifiers", modifiers = suffix.slice(1).split(".").map((modifier) => `${modifier}: true`).join(", ");
344
+ binding += ` :${modifierProp}="{ ${modifiers} }"`;
345
+ }
346
+ return binding;
347
+ });
348
+ if (newAttrs === tag.attrs) {
355
349
  searchFrom = tag.end;
356
350
  continue;
357
351
  }
358
- if (NATIVE_ELEMENTS.has(tag.tag)) {
359
- const newAttrs = tag.attrs.replace(/\s*v-model="[^"]*"/g, "") + ` @model="${modelValue}"`, range = getElementRange(result, tag), element = result.slice(range.outerStart, range.outerEnd), newElement = replaceTagAttrs(element, {
360
- ...tag,
361
- start: 0,
362
- end: tag.end - tag.start
363
- }, newAttrs);
364
- result = result.slice(0, range.outerStart) + newElement + result.slice(range.outerEnd);
365
- searchFrom = range.outerStart + newElement.length;
366
- } else {
367
- let newAttrs = tag.attrs.replace(/\s*v-model="[^"]*"/g, "");
368
- newAttrs += ` :modelValue="${modelValue}" @update:modelValue="${modelValue} = $event"`;
369
- const range = getElementRange(result, tag), element = result.slice(range.outerStart, range.outerEnd), newElement = replaceTagAttrs(element, {
370
- ...tag,
371
- start: 0,
372
- end: tag.end - tag.start
373
- }, newAttrs);
374
- result = result.slice(0, range.outerStart) + newElement + result.slice(range.outerEnd);
375
- searchFrom = range.outerStart + newElement.length;
376
- }
352
+ const opening = replaceTagAttrs(tag.full, { ...tag, start: 0, end: tag.full.length }, newAttrs);
353
+ result = result.slice(0, tag.start) + opening + result.slice(tag.end);
354
+ searchFrom = tag.start + opening.length;
377
355
  }
378
356
  return result;
379
357
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.303",
4
+ "version": "0.2.304",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -117,12 +117,12 @@
117
117
  "dependencies": {
118
118
  "@stacksjs/ts-css": "^0.3.2",
119
119
  "@stacksjs/clapp": "^0.2.14",
120
- "@stacksjs/desktop": "0.2.303",
121
- "@stacksjs/sanitizer": "0.2.303",
120
+ "@stacksjs/desktop": "0.2.304",
121
+ "@stacksjs/sanitizer": "0.2.304",
122
122
  "@stacksjs/ts-i18n": "^0.1.11",
123
- "bun-plugin-stx": "0.2.303",
123
+ "bun-plugin-stx": "0.2.304",
124
124
  "bunfig": "^0.15.17",
125
- "stx-router": "0.2.303",
125
+ "stx-router": "0.2.304",
126
126
  "ts-broadcasting": "^0.0.9",
127
127
  "ts-images": "^0.2.18",
128
128
  "ts-syntax-highlighter": "^0.2.1"
package/stx.d.ts CHANGED
@@ -116,6 +116,21 @@ declare function useReactiveProp<T = unknown>(
116
116
  _defaultValue?: T,
117
117
  _options?: { parse?: (_value: string) => T },
118
118
  ): StxSignal<T>
119
+ interface StxModelOptions<T> {
120
+ default?: T
121
+ parse?: (value: string) => T
122
+ get?: (value: T) => T
123
+ set?: (value: T, modifiers: Readonly<Record<string, boolean>>) => T
124
+ }
125
+ interface StxModelSignal<T> extends StxSignal<T> {
126
+ readonly modifiers: Readonly<Record<string, boolean>>
127
+ input(value: T): void
128
+ change(value: T): void
129
+ }
130
+ declare function useModel<T>(options: StxModelOptions<T> & { default: T }): StxModelSignal<T>
131
+ declare function useModel<T>(name: string, options: StxModelOptions<T> & { default: T }): StxModelSignal<T>
132
+ declare function useModel<T = unknown>(name?: string, options?: StxModelOptions<T>): StxModelSignal<T | undefined>
133
+ declare function useModel<T = unknown>(options?: StxModelOptions<T>): StxModelSignal<T | undefined>
119
134
  /**
120
135
  * A template ref. Read it however the surrounding code reads things: `ref()`
121
136
  * like every other stx accessor, or `ref.current` / `ref.value` for the
@@ -268,6 +283,10 @@ interface StxMutationResult<T> {
268
283
  }
269
284
 
270
285
  declare function useFetch<T = any>(_url: string, _options?: any): StxFetchResult<T>
286
+ /** Server-only, keyed JSON data exposed to this render's client hydration. */
287
+ declare function useServerData<T>(_key: string, _loader: () => T | Promise<T>): Promise<T>
288
+ /** Clear a hydration snapshot without changing existing signals. */
289
+ declare function clearServerData(_key?: string): void
271
290
  declare function useQuery<T = any>(_url: string, _options?: any): StxQueryResult<T>
272
291
  declare function useMutation<T = any>(_url: string, _options?: any): StxMutationResult<T>
273
292
 
@@ -314,6 +333,13 @@ declare function configureFetch(_config: {
314
333
  onRequest?: (_ctx: StxFetchRequestContext) => void | Promise<void>
315
334
  onResponse?: (_ctx: StxFetchResponseContext) => void | Promise<void>
316
335
  onResponseError?: (_ctx: StxFetchErrorContext) => void | Response | Promise<void | Response>
336
+ /**
337
+ * Double-submit CSRF. By default every same-origin POST/PUT/PATCH/DELETE
338
+ * repeats the `X-CSRF-Token` cookie in an `X-CSRF-Token` header, which is
339
+ * what a Stacks server checks. Rename either side, or pass `false` to stop.
340
+ * Unlike the hooks, this persists across calls that do not mention it.
341
+ */
342
+ csrf?: false | { cookie?: string, header?: string }
317
343
  }): void
318
344
 
319
345
  declare function useOptimistic<T = any, A = any>(
@@ -826,6 +852,7 @@ interface StxRuntimeRegistry {
826
852
 
827
853
  // Composables
828
854
  useFetch: typeof useFetch
855
+ clearServerData: typeof clearServerData
829
856
  useRef: typeof useRef
830
857
  useQuery: typeof useQuery
831
858
  useMutation: typeof useMutation
@@ -872,6 +899,7 @@ interface StxRuntimeRegistry {
872
899
  useClickOutside: typeof useClickOutside
873
900
  useFocus: typeof useFocus
874
901
  useAsync: typeof useAsync
902
+ useModel: typeof useModel
875
903
  useLocalStorage: typeof useLocalStorage
876
904
  useSessionStorage: typeof useSessionStorage
877
905
  useEventListener: typeof useEventListener
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ws as a,Xs as b}from"./chunk-jj6yp7gm.js";import"./chunk-ddqkj56r.js";export{b as resolveStxTargets,a as looksLikeGlob};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ep as b,Fp as c,Gp as d,Hp as e,eo as a}from"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{d as validateClientScript,c as processOnceDirective,b as processJsonDirective,e as processDirectives,a as injectRouterScript};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ri as a}from"./chunk-y9nyqcha.js";import"./chunk-ddqkj56r.js";export{a as rewriteImagesWithSiblings};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$k as e,Xk as a,Yk as b,Zk as c,_k as d}from"./chunk-7jebw3ea.js";import"./chunk-ddqkj56r.js";export{b as injectPwaTags,e as generateThemeColorMeta,c as generateSwRegistrationScript,a as generatePwaTags,d as generateManifestLink};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$ as xl,$a as sn,$b as Ko,$c as Kp,$d as Kq,A as hk,Aa as Cm,Ab as co,Ac as jp,Ad as jq,Ae as pr,B as ik,Ba as Dm,Bb as eo,Bc as kp,Bd as kq,Be as qr,C as jk,Ca as Qm,Cb as fo,Cc as lp,Cd as lq,Ce as rr,D as kk,Da as Rm,Db as go,Dc as mp,Dd as mq,De as sr,E as al,Ea as Sm,Eb as ho,Ec as np,Ed as nq,Ee as tr,F as bl,Fa as Tm,Fb as io,Fc as op,Fd as oq,Fe as ur,G as cl,Ga as Um,Gb as jo,Gc as pp,Gd as pq,Ge as vr,H as dl,Ha as Vm,Hb as ko,Hc as qp,Hd as qq,He as wr,I as el,Ia as Zm,Ib as lo,Ic as rp,Id as rq,Ie as xr,J as fl,Ja as _m,Jb as mo,Jc as sp,Jd as sq,Je as yr,K as gl,Ka as $m,Kb as no,Kc as tp,Kd as tq,Ke as zr,L as hl,La as an,Lb as oo,Lc as up,Ld as uq,Le as Ar,M as il,Ma as bn,Mb as vo,Mc as vp,Md as vq,Me as Br,N as jl,Na as cn,Nb as wo,Nc as wp,Nd as wq,Ne as Cr,O as kl,Oa as dn,Ob as xo,Oc as xp,Od as xq,Oe as Dr,P as ll,Pa as en,Pb as yo,Pc as yp,Pd as yq,Pe as Er,Q as ml,Qa as fn,Qb as zo,Qc as zp,Qd as zq,Qe as Fr,R as nl,Ra as gn,Rb as Ao,Rc as Ap,Rd as Aq,Re as Gr,S as ol,Sa as hn,Sb as Bo,Sc as Bp,Sd as Bq,Se as Hr,T as pl,Ta as jn,Tb as Co,Tc as Cp,Td as Cq,Te as Ir,U as ql,Ua as kn,Ub as Do,Uc as Dp,Ud as Dq,Ue as Jr,V as rl,Va as ln,Vb as Eo,Vc as Ep,Vd as Eq,Ve as Kr,W as sl,Wa as nn,Wb as Fo,Wc as Fp,Wd as Fq,We as Lr,X as tl,Xa as on,Xb as Go,Xc as Gp,Xd as Gq,Y as ul,Ya as pn,Yb as Ho,Yc as Hp,Yd as Hq,Z as vl,Za as qn,Zb as Io,Zc as Ip,Zd as Iq,_ as wl,_a as rn,_b as Jo,_c as Jp,_d as Jq,aa as yl,ab as tn,ac as Lo,ad as Lp,ae as Lq,ba as zl,bb as un,bc as Mo,bd as Mp,be as Mq,ca as Al,cb as vn,cc as No,cd as Np,ce as Nq,da as Bl,db as wn,dc as Oo,dd as Op,de as Oq,ea as Cl,eb as xn,ec as Po,ed as Pp,ee as Pq,fa as Dl,fb as yn,fc as Qo,fd as Qp,fe as Qq,ga as El,gb as zn,gc as Ro,gd as Rp,ge as Rq,ha as Fl,hb as An,hc as So,hd as Sp,he as Sq,ia as Gl,ib as Bn,ic as To,id as Tp,ie as Tq,ja as Hl,jb as Cn,jc as Uo,jd as Up,je as Uq,ka as Il,kb as Dn,kc as Vo,kd as Vp,ke as Vq,la as Jl,lb as En,lc as Wo,ld as Wp,le as Wq,ma as Kl,mb as Fn,mc as Xo,md as Xp,me as Xq,na as Ll,nb as In,nc as Yo,nd as Yp,ne as cr,o as a,oa as Ml,ob as Jn,oc as Zo,od as Zp,oe as dr,p as Uj,pa as rm,pb as Kn,pc as _o,pd as _p,pe as er,q as Vj,qa as sm,qb as Ln,qc as $o,qd as $p,qe as fr,r as Wj,ra as tm,rb as Rn,rc as ap,rd as aq,re as gr,s as Xj,sa as um,sb as Sn,sc as bp,sd as bq,se as hr,t as Yj,ta as vm,tb as Tn,tc as cp,td as cq,te as ir,u as Zj,ua as wm,ub as Un,uc as dp,ud as dq,ue as jr,v as _j,va as xm,vb as Zn,vc as ep,vd as eq,ve as kr,w as $j,wa as ym,wb as _n,wc as fp,wd as fq,we as lr,x as ak,xa as zm,xb as $n,xc as gp,xd as gq,xe as mr,y as fk,ya as Am,yb as ao,yc as hp,yd as hq,ye as nr,z as gk,za as Bm,zb as bo,zc as ip,zd as iq,ze as or}from"./chunk-c6b5nqct.js";import{Xe as Mn}from"./chunk-zn6xcc0a.js";import{$e as mn,Ye as Wm,Ze as Xm,_e as Ym,af as Nn,bf as On,cf as Pn,df as Qn,ef as Vn,ff as Wn,gf as Xn,hf as Yn}from"./chunk-x2pk87q2.js";import{if as lk,jf as mk,kf as nk,lf as ok,mf as pk,nf as qk,of as rk,pf as sk,qf as tk,rf as uk,sf as vk,tf as wk,uf as xk,vf as yk,wf as zk}from"./chunk-ps20v1ah.js";import{Af as Tk,Bf as Uk,Cf as Vk,Df as Wk,Ef as Xk,Ff as Yk,Gf as Zk,Hf as _k,If as $k,xf as Qk,yf as Rk,zf as Sk}from"./chunk-3p0zgfgz.js";import{Jf as po,Kf as qo,Lf as ro,Mf as so,Nf as to,Of as uo}from"./chunk-m78y5qys.js";import{Pf as Gn,Qf as Hn}from"./chunk-mjpqz66q.js";import{Rf as fm,Sf as gm,Tf as hm,Uf as im,Vf as lm,Wf as pm}from"./chunk-em3jb1dn.js";import{$f as Rl,Xf as Nl,Yf as Ol,Zf as Pl,_f as Ql,ag as Sl,bg as Tl,cg as Ul,dg as Vl,eg as Wl,fg as Xl,gg as Yl,hg as Zl,ig as _l,jg as $l,kg as am,lg as mm,mg as nm,ng as om}from"./chunk-9rv7akqq.js";import{og as jm,rg as km}from"./chunk-fvcr26a0.js";import{Ag as Fm,Bg as Gm,Cg as Hm,Dg as Im,Eg as Jm,Fg as Km,Gg as Lm,Hg as Mm,Ig as Nm,Jg as Om,Kg as Pm,zg as Em}from"./chunk-634gaa9d.js";import{Lg as Ok,Mg as Pk}from"./chunk-51g95yts.js";import{Ng as qm}from"./chunk-b3p3bzax.js";import{Og as Eh,Pg as Fh,Qg as Gh,Rg as Hh,Sg as Ih,Tg as Jh}from"./chunk-y7dcdjav.js";import{$g as aj,Ug as Yi,Vg as Zi,Wg as _i,_g as $i,ah as bj}from"./chunk-7nfn7nj9.js";import{bh as hj,ch as ij,dh as jj,eh as kj,fh as lj,gh as mj,hh as nj,ih as oj,jh as pj,kh as qj,lh as rj}from"./chunk-c9vhtjtr.js";import{mh as Oi,nh as Pi,oh as Qi,ph as Ri,qh as Si,sh as Ti,th as Ui,uh as Vi,vh as Wi,wh as Xi}from"./chunk-6rzwef28.js";import{xh as Jj,zh as Kj}from"./chunk-683tfkz4.js";import{Fh as Ak,Gh as Bk,Hh as Ck,Ih as Dk,Jh as Ek,Kh as Fk,Lh as Gk,Nh as Hk,Oh as Ik,Ph as Jk,Qh as Kk,Rh as Lk,Sh as Mk,Vh as Nk}from"./chunk-jptkc64r.js";import{$h as kh,Wh as fh,Xh as gh,Yh as hh,Zh as ih,_h as jh,ai as lh,bi as mh,ci as nh,di as oh,ei as ph,fi as qh,gi as rh,hi as sh}from"./chunk-3bc8bqw2.js";import{ji as th,ki as uh,li as vh,mi as wh}from"./chunk-7eg7ep8f.js";import{ri as xh}from"./chunk-y9nyqcha.js";import{si as Bg}from"./chunk-qg6pg6ze.js";import{ti as Cg,ui as Dg}from"./chunk-6w8fa3b8.js";import{Ai as Jg,vi as Eg,wi as Fg,xi as Gg,yi as Hg,zi as Ig}from"./chunk-v8474ah4.js";import{Bi as Kg,Ci as Lg,Di as Mg,Ei as Ng,Fi as Og}from"./chunk-x4prtyjs.js";import{Gi as Pg,Hi as Qg,Ii as Rg,Ji as Sg,Ki as Tg}from"./chunk-6btbgxh1.js";import{Li as Ug,Mi as Vg,Ni as Wg,Oi as Xg,Pi as Yg,Qi as Zg,Ri as _g}from"./chunk-ctz53mbz.js";import{Si as $g,Ti as ah,Ui as bh,Vi as ch,Wi as dh,Xi as eh}from"./chunk-weqpt9nt.js";import{Zi as yg,_i as zg}from"./chunk-2m6x8tcx.js";import{bj as Ag}from"./chunk-zdx9s3z0.js";import"./chunk-91007tan.js";import{fj as xe,gj as ye,hj as ze,ij as Ae,jj as Be,kj as Ce,lj as De,mj as Ee,nj as Fe,oj as Ge,pj as He,qj as Ie,rj as Je,sj as Ke}from"./chunk-ew6tr7b1.js";import{tj as $e,uj as af}from"./chunk-1evf3bdg.js";import{Bj as Ne,Cj as Oe,Dj as Pe,Ej as Qe,Fj as Re,Gj as Se,Hj as Te,Ij as Ue,Jj as Ve,Kj as We,Lj as Xe,Mj as Ye,Nj as Ze,Oj as _e}from"./chunk-w8yac9xp.js";import{Pj as bf,Qj as cf,Rj as df,Sj as ef,Tj as ff,Uj as gf,Vj as hf,Wj as jf,Xj as kf,Yj as lf,Zj as mf,_j as nf}from"./chunk-rdg1n42s.js";import{sk as Yq,tk as Zq,uk as _q,vk as $q,wk as ar,xk as br}from"./chunk-5nac67r4.js";import{Ak as dk,Bk as ek,Ck as bm,Dk as cm,Ek as dm,Fk as em,yk as bk,zk as ck}from"./chunk-mdf3jbe6.js";import"./chunk-7eea1cse.js";import"./chunk-ggwnrdqz.js";import{$l as _b,$m as gd,$o as Sf,$p as Yh,$q as Gj,Al as Ia,Am as Ic,An as Hd,Ao as rf,Ap as rg,Aq as Gi,Bl as Ja,Bm as Jc,Bn as Id,Bo as sf,Bp as sg,Bq as Hi,Cl as Ka,Cm as Kc,Cn as Jd,Co as tf,Cp as tg,Cq as Ii,Dl as La,Dm as Lc,Dn as Kd,Do as uf,Dp as ug,Dq as Ji,El as Ma,Em as Mc,En as $d,Eo as vf,Ep as vg,Eq as Ki,Fl as Na,Fm as Nc,Fn as ae,Fo as wf,Fp as wg,Fq as Li,Gl as Oa,Gm as Oc,Gn as be,Go as xf,Gp as xg,Gq as Mi,Hl as ib,Hn as ce,Ho as yf,Hp as yh,Hq as Ni,Il as jb,Im as Pc,In as de,Io as zf,Ip as zh,Iq as cj,Jl as kb,Jm as Qc,Jn as ee,Jo as Af,Jp as Ah,Jq as dj,Kl as lb,Km as Rc,Kn as fe,Ko as Bf,Kp as Bh,Kq as ej,Ll as mb,Lm as Sc,Ln as ge,Lo as Cf,Lp as Ch,Lq as fj,Ml as nb,Mm as Tc,Mn as he,Mo as Df,Mp as Dh,Mq as gj,Nm as Uc,Nn as ie,No as Ef,Np as Kh,Nq as sj,Om as Vc,On as je,Oo as Ff,Op as Lh,Oq as tj,Pl as Fb,Pm as Wc,Pn as ke,Po as Gf,Pp as Mh,Pq as uj,Ql as Gb,Qm as Xc,Qn as le,Qo as Hf,Qp as Nh,Qq as vj,Rl as Hb,Rm as Yc,Rn as me,Ro as If,Rp as Oh,Rq as wj,Sl as Ib,Sm as Zc,So as Jf,Sp as Ph,Sq as xj,Tl as Jb,Tm as _c,Tn as qe,To as Kf,Tp as Qh,Tq as yj,Ul as Nb,Um as $c,Un as re,Uo as Lf,Up as Rh,Uq as zj,Vl as Ob,Vm as ad,Vn as se,Vo as Mf,Vp as Sh,Vq as Aj,Wl as Pb,Wm as bd,Wn as te,Wo as Nf,Wp as Th,Wq as Bj,Xl as Wb,Xm as cd,Xn as ue,Xo as Of,Xp as Uh,Xq as Cj,Yl as Xb,Ym as dd,Yn as ve,Yo as Pf,Yp as Vh,Yq as Dj,Zl as Yb,Zm as ed,Zn as we,Zo as Qf,Zp as Wh,Zq as Ej,_l as Zb,_m as fd,_o as Rf,_p as Xh,_q as Fj,am as $b,an as hd,ap as Tf,aq as Zh,ar as Hj,bm as ac,bn as id,bo as Le,bp as Uf,bq as _h,br as Ij,cm as bc,cn as jd,co as Me,cp as Vf,cq as ii,cr as Lj,dm as cc,dn as kd,dp as Wf,dq as ji,dr as Mj,em as dc,en as ld,eo as of,ep as Xf,eq as ki,er as Nj,fm as ec,fn as md,fp as Yf,fq as li,fr as Oj,gm as fc,gn as nd,gp as Zf,gq as mi,gr as Pj,hm as gc,hn as od,hp as _f,hq as ni,hr as Qj,im as hc,in as pd,ip as $f,iq as oi,ir as Rj,jm as ic,jn as qd,jp as ag,jq as pi,jr as Sj,km as jc,kn as rd,kp as bg,kq as qi,kr as Tj,lm as kc,ln as sd,lp as cg,lq as ri,mm as lc,mn as td,mp as dg,mq as si,nm as mc,nn as ud,np as eg,nq as ti,om as nc,on as vd,op as fg,oq as ui,pl as xa,pm as oc,pn as wd,pp as gg,pq as vi,ql as ya,qm as pc,qn as xd,qp as hg,qq as wi,rl as za,rm as qc,rn as yd,rp as ig,rq as xi,sl as Aa,sm as rc,sn as zd,sp as jg,sq as yi,tl as Ba,tm as sc,tn as Ad,tp as kg,tq as zi,ul as Ca,um as tc,un as Bd,up as lg,uq as Ai,vl as Da,vm as uc,vn as Cd,vp as mg,vq as Bi,wl as Ea,wm as vc,wn as Dd,wo as pf,wp as ng,wq as Ci,xl as Fa,xm as wc,xn as Ed,xp as og,xq as Di,yl as Ga,ym as xc,yn as Fd,yo as qf,yp as pg,yq as Ei,zl as Ha,zm as yc,zn as Gd,zp as qg,zq as Fi}from"./chunk-rsxmjfxq.js";import{Ar as q,As as ka,Br as r,Bs as la,Cr as s,Cs as ma,Dr as t,Ds as na,Er as u,Es as oa,Fr as v,Fs as pa,Gr as w,Gs as qa,Hr as x,Hs as ra,Ir as y,Is as sa,Jr as z,Js as ta,Kr as A,Ks as ua,Lr as B,Ls as va,Mr as C,Ms as wa,Nr as D,Or as E,Pr as F,Qr as G,Rr as H,Sr as I,Tr as J,Ur as K,Vr as L,cs as M,ds as N,es as O,fs as P,gs as Q,hs as R,is as S,js as T,ks as U,lr as b,ls as V,mr as c,ms as W,nr as d,ns as X,or as e,os as Y,pr as f,ps as Z,qr as g,qs as _,rr as h,rs as $,sr as i,ss as aa,tr as j,ts as ba,ur as k,us as ca,vr as l,vs as da,wr as m,ws as ea,xr as n,xs as fa,yr as o,ys as ia,zr as p,zs as ja}from"./chunk-m6wz1hf5.js";import{Ns as $h,Os as ai,Ps as bi,Qs as ci,Rs as di,Ss as ei,Ts as fi,Us as gi,Vs as hi}from"./chunk-dcxtrqfy.js";import{Ws as ga,Xs as ha}from"./chunk-jj6yp7gm.js";import{Ys as Kb,Zs as Lb,_s as Mb}from"./chunk-qjkzpd68.js";import{$s as ne,at as oe,bt as pe}from"./chunk-2rp09y5j.js";import{It as Fc,Jt as Gc,Kt as Hc,tt as zc,ut as Ac,vt as Bc,wt as Cc,xt as Dc,zt as Ec}from"./chunk-whm6bybj.js";import{Lt as Qb,Mt as Rb,Nt as Sb,Ot as Tb,Pt as Ub,Qt as Vb}from"./chunk-q25mr70f.js";import{$t as Vd,Rt as Ld,St as Md,Tt as Nd,Ut as Od,Vt as Pd,Wt as Qd,Xt as Rd,Yt as Sd,Zt as Td,_t as Ud,au as Wd,bu as Xd,cu as Yd,du as Zd,eu as _d}from"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import{Au as Eb,ku as ob,lu as pb,mu as qb,nu as rb,ou as sb,pu as tb,qu as ub,ru as vb,su as wb,tu as xb,uu as yb,vu as zb,wu as Ab,xu as Bb,yu as Cb,zu as Db}from"./chunk-k5xtf38q.js";import{$u as $a,Eu as Pa,Fu as Qa,Iu as Ra,Nu as Sa,Ou as Ta,Uu as Ua,Vu as Va,Wu as Wa,Xu as Xa,Yu as Ya,Zu as Za,_u as _a,av as ab,bv as bb,cv as cb,dv as db,ev as eb,fv as fb,gv as gb,iv as hb}from"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{vk as writeNetlifyConfig,nm as writeManifest,_k as writeImageManifest,Eo as wrapComponentForHMR,yr as withDefaults,Ij as webComponentDirectiveHandler,tp as watermark,vq as watchViews,il as watchMultiple,jl as watchEffect,hl as watch,ue as warmImagePlaceholders,wl as waitForStore,X as waitForLocale,qo as virtualPathFor,vj as videoDirective,G as validators,Cr as validated,ke as validateValueEnhanced,zh as validateTemplate,yp as validateParams,le as validateFormEnhanced,kq as validateFile,ge as validateFields,fe as validateField,Bh as validateDirective,Fd as validateCspDirectives,Qj as validateConfig,sm as validateComponentScripts,Qm as validateComponentProps,xg as validateClientScript,wh as v,rc as usesSignalsInScript,ub as usesReactiveRuntime,Oh as userComponentFileExists,ch as useVirtualList,Td as useTitle,vl as useStoreOrThrow,Wo as useStore,fk as useStorage,Gq as useSlots,hk as useSessionStorage,Qd as useSeoMeta,xl as useRouteParams,zl as useRouteParamOrThrow,yl as useRouteParam,Td as usePageTitle,_e as useOptimistic,Bl as useMiddlewareValue,Al as useMiddlewareState,gk as useLocalStorage,xo as useLoadingIndicator,Od as useHead,th as useForm,Iq as useAttrs,mq as uploadFiles,lq as uploadFile,sl as updateInstance,Ye as untrack,ci as unregisterDirective,tl as unmountInstance,yc as unescapeHtml,to as typecheckStxFiles,Nh as transpileTypeScript,lr as translate,Ba as transitionDirective,_b as transformAutoImports,Km as toUsers,Jm as toUser,cp as thumbnail,dq as thumbHashToRGBA,eq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,bf as templateCache,Xc as syncRecordedResponse,Bo as stxClientHelpers,Jf as structuredDataDirective,or as stripLocalePrefix,_l as stripDocumentWrapper,Lb as stripCommentsAndLiterals,wn as stringToStream,td as strictCspPreset,Fe as streamingSuspenseDirective,Je as streamToResponse,De as streamTemplateSimple,xe as streamTemplate,ak as stopHmrServer,Gm as stopBroadcasting,Tb as stateDirName,Ub as stateDir,Ne as state,rg as startsDocument,Yn as startProductionServer,Mn as startInteractive,Fm as startBroadcasting,qr as stampLocaleLayoutGroup,Ia as staggerDirective,wp as srcsetUrls,Ja as springDirective,cd as splitByPipe,Wl as spaNavVaryHeaders,ro as sourcePathFor,Dp as smartBatchSign,Qh as slotContentHasExpressions,Bp as signUrl,Lh as shouldTranspileTypeScript,Zj as shouldReloadOnChange,Gp as shouldRefreshSignature,_j as shouldIgnoreFile,Wg as shouldCacheComponent,gp as sharpen,Fr as shape,Sb as setStateDir,Fl as setRouteParams,Gl as setMiddlewareState,te as setImagePlaceholder,Aq as setGlobalProvide,b as setErrorLocale,al as setCurrentInstance,jj as setCachedVideoResult,_i as setCachedImageResult,Ui as setCached,Ir as serveStxFile,Kr as serveMultipleStxFiles,Uj as serveMarkdownFile,ho as serveFile,Lr as serveApp,go as serve,Ho as serializeState,mn as serializeSetCookie,ip as sepia,Rd as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,zj as scopeHTML,yj as scopeCSS,Mf as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,mp as saturation,zp as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,Cf as runPreProcessingMiddleware,Df as runPostProcessingMiddleware,Pn as runPageAction,Te as runMountCallbacks,gb as runMiddleware,ql as runHooks,er as runDoctor,Ue as runDestroyCallbacks,Rf as runComposers,np as rotate,xh as rewriteImagesWithSiblings,Yc as responseBindings,Uh as resolveTemplatePath,ha as resolveStxTargets,Mj as resolveStxDirectories,kr as resolveI18n,ap as resize,ec as resetPlaceholders,Nd as resetHead,Go as resetHMRHandler,o as resetErrorConfig,Ar as required,ic as replacePlaceholders,tq as renderView,sj as renderVideoComponent,Xb as renderVendorStyleTags,Pq as renderToString,Qq as renderToStream,Rq as renderToDOM,cq as renderThumbhashToCanvas,br as renderTemplateString,$q as renderTemplate,ar as renderString,Ae as renderStreamingPage,Gh as renderSlot,Mg as renderSSRSuspense,Op as renderProtectedVideo,Np as renderProtectedImg,Ap as renderMediaUpload,_q as renderMarkdownView,dm as renderLayoutTypes,cj as renderImgComponent,Qk as renderImageComponent,Vd as renderHtmlAttrs,Ud as renderHead,wq as renderEmail,Sh as renderComponentWithSlot,Wd as renderBodyAttrs,Ro as render,vd as relaxedCspPreset,ee as registerValidationRule,He as registerStreamingDirectives,Yo as registerStoresClient,Dl as registerStore,Kf as registerSeoDirectives,_a as registerMiddleware,mc as registerFilters,lc as registerFilter,d as registerErrorMessages,je as registerEnhancedValidationRule,$h as registerDirective,Ed as registerCspDirectives,Tm as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,el as ref,En as redirect,Tc as recordResponseStatus,Uc as recordResponseHeader,Vb as rebaseOntoStateDir,Vc as readResponseStatus,Wc as readResponseHeaders,Sj as readMarkdownFile,cf as readFileCached,fl as reactive,rp as quality,Lp as pruneSignatureCache,Xi as pruneCache,yq as provide,Zq as protectCodeBlocks,zr as prop,Uf as processVueTemplate,ah as processVirtualListDirectives,eh as processVirtualGridDirectives,rj as processVideo,he as processValidateDirective,ea as processTranslateDirective,Gg as processTransitionDirectives,Jg as processTransitionAttributes,Zd as processTitleDirective,Lc as processTemplateBindings,Cg as processTeleportDirectives,Kg as processSuspenseDirectives,Ff as processStructuredData,Be as processStreamDirectives,Zc as processStatusDirective,rh as processStaticDirectives,Af as processStackReplacements,zf as processStackPushDirectives,Hh as processSlots,Yl as processShell,we as processServerBindings,Gf as processSeoDirective,Ie as processSectionDirectives,Dc as processScopedStyles,Jc as processReactiveBindings,Pp as processProtectedMedia,kh as processPartialHydrationDirectives,wg as processOnceDirective,Bf as processMiddleware,Ef as processMetaDirectives,_d as processMetaDirective,Tj as processMarkdownFileDirectives,Zh as processMarkdownDirectives,uf as processLoops,Ug as processKeepAliveDirectives,vg as processJsonDirective,dh as processInfiniteListDirectives,yf as processIncludes,ej as processImgComponents,Sk as processImageComponents,Fk as processImage,Yd as processHeadDirective,ae as processForms,ce as processFormInputDirectives,vc as processExpressions,Ib as processEventDirectives,de as processErrorDirective,Vf as processDynamicComponents,yh as processDirectives,hi as processDirectiveAttributes,Bg as processDeferDirectives,Jd as processCustomDirectives,Bd as processCspDirectives,Gr as processComponentProps,dc as processClientScript,be as processBasicFormDirectives,Pg as processAsyncDirectives,Kd as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,pe as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,wo as preloadIslandHandlers,ve as preloadIconCollection,Bm as poolStrings,Kj as pluginManager,re as placeholdersWarmed,Fg as performLeave,Eg as performEnter,Ve as pendingLifecycleCounts,Ze as peek,vf as partialsCache,tj as parseVideoDirectiveOptions,_o as parseUrl,fq as parseThumbhashString,id as parseSwitchBlock,Eh as parseSlots,Fh as parseSlotElement,nd as parseScriptDeclarations,Gj as parseSFCComponent,Qp as parseProtectedArgs,tf as parseLoopBinding,dj as parseImgComponent,vi as parseImageUrl,Rk as parseImageComponent,Nn as parseFormBody,kd as parseExpressionWithFilters,Um as parseDefaults,Bn as parseCookies,Pl as parseContainerSelector,fd as parseConditionalBlock,ld as parseArguments,Ma as parseAnimationShorthand,Br as optional,Cm as optimizeTemplate,Xk as optimizeImage,Yk as optimizeDirectory,Dr as oneOf,wf as onceStore,nl as onUpdated,Ic as onUpdate,pl as onUnmounted,Kl as onServer,ll as onMounted,Re as onMount,qh as onHydrated,Eq as onErrorCaptured,Se as onDestroy,_g as onDeactivated,Jl as onClient,ml as onBeforeUpdate,ol as onBeforeUnmount,kl as onBeforeMount,Zg as onActivated,_p as observeElement,Fn as notFound,_f as normalizeCriticalHeadOrder,Dq as nextTick,Xm as negotiateEncoding,Ua as navigateTo,rl as mountInstance,Ea as motionDirective,ud as moderateCspPreset,Am as minifyHtml,If as metaDirective,jg as metaDedupKey,$o as mergeParams,lg as mergeHtmlAttrs,Pd as mergeHeadConfigs,Ac as mergeCssConfig,yd as mergeCspDirectives,Ra as matchRoute,_h as markdownDirectiveHandler,Rj as markdownCache,ga as looksLikeGlob,nr as localizePath,U as loadTranslationLazy,_ as loadTranslation,Nj as loadStxConfig,db as loadMiddlewareFromDirectory,om as loadManifest,Wp as loadElement,Hm as loadChannels,ur as lintStxStrict,Yp as lazyLoadAll,Xp as lazyLoad,Ha as keyframeDirective,Nq as jsxs,Oq as jsxDEV,Mq as jsx,Dn as jsonResponse,Ge as islandDirective,l as isTest,$l as isSpaNavigation,Ul as isSpaNavRequest,Ep as isSignatureValid,We as isSignal,Dk as isSharpAvailable,pn as isServerEnvironment,Hl as isServer,yb as isRuntimeOwnedColonAttr,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Tp as isNativeLazySupported,Yq as isMarkdownPath,Q as isLoading,R as isLoaded,Kh as isJavaScriptScript,Up as isIntersectionObserverSupported,Lk as isImageFile,Ek as isImageBackendAvailable,aa as isICUFormat,ph as isHydrated,Ph as isHydrateTrigger,Rc as isHttpStatus,on as isEdgeEnvironment,vr as isDirectiveKind,k as isDevelopment,Xe as isDerived,Yj as isCssOnlyChange,Wm as isCompressible,Il as isClient,Rg as isAsyncComponent,On as isActionableMethod,jp as invert,ef as invalidateFileCacheByDir,df as invalidateFileCache,uc as interpolateScriptsInTemplate,sc as interpolateScriptExpressions,tc as interpolateScriptAttributes,x as inlineError,jr as injectThemeBootstrap,Hf as injectSeoTags,gr as injectSeo,of as injectRouterScript,Xj as injectHotReload,kb as injectHeatmap,Hc as injectCss,zd as injectCspMetaTag,tg as injectConfigHeadTags,Zf as injectColorModeBootScript,ng as injectCloakStyle,eg as injectBuildId,Zb as injectBrowserCoreAutoImports,Nc as injectAnalytics,zq as inject,Cl as initStoreRegistry,yk as initNetlify,yo as initLoadingIndicator,Vp as initLazyLoading,Ln as initFile,bq as initBlurUp,hq as initAllBlurUp,gj as imgDirective,Vk as imageDirective,Wn as hydrateTemplateStream,Vn as hydrateTemplate,vo as hydrateIslands,mh as hydrateIsland,Xn as hydrateFragment,nh as hydrateByStrategy,oh as hydrateAll,Oo as hydrate,fo as htmlResponse,pg as hoistLeadingHeadTags,$f as hoistColorModeBootScript,lb as heatmapDirective,Qi as hashString,nf as hashFilePath,Oi as hashFile,Pi as hashBuffer,Tf as hasVueTemplateSyntax,sf as hasVariables,To as hasStore,jc as hasPlaceholders,wk as hasNetlifyConfig,ab as hasMiddleware,Jb as hasEventDirectives,sg as hasDocumentShell,Ch as hasDirectives,ma as hasDOMSupport,Ok as handleImageRequest,Fq as handleError,Vq as h,Kk as groupVariantsByFormat,hp as grayscale,Zn as gitHash,um as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,rk as getTotalSize,Fp as getTimeUntilExpiry,yg as getStoreScript,Uo as getStoreNames,So as getStore,kk as getStorageSize,jk as getStorageKeys,Vh as getSourceLineInfo,Mh as getSharedTranspiler,jf as getServeClientAsset,la as getScreenReaderOnlyStyle,Aj as getScopeAttribute,Me as getRouteParams,Ob as getPublicEnvDefine,Pb as getPublicEnv,Ah as getPositionInfo,gc as getPlaceholderRegistry,Ni as getPlaceholderCacheStats,Md as getPageMeta,pd as getNonce,Mk as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,qe as getImagePlaceholder,Gk as getImageMetadata,ne as getImageDelivery,No as getHydrationRuntime,El as getHydratedStoreState,$j as getHmrServer,Ld as getHead,Fo as getHMRHandler,zi as getFormatExtension,Si as getFileMtime,Jk as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,bi as getDirectives,ai as getDirective,bl as getCurrentInstance,Ec as getCssServeAsset,xd as getCspPreset,Gd as getCspHeaderName,Yh as getComponentCacheStats,ij as getCachedVideoResult,Jp as getCachedSignature,gf as getCachedSignalsRuntime,hf as getCachedRouterScript,Li as getCachedPlaceholder,Zi as getCachedImageResult,Ti as getCached,Wi as getCacheStats,cg as getBuildId,Em as getBroadcastServer,yi as getBestVariant,nc as getAllFilters,mi as generateWidthSrcset,bh as generateVirtualListCSS,oq as generateVideoPreview,me as generateValidationScript,pq as generateUploadRuntime,vm as generateTreeShakenBundle,Ig as generateTransitionRuntime,Hg as generateTransitionCSS,mj as generateThumbnails,Ei as generateThumbhashPlaceholder,en as generateTemplatesDocs,Og as generateSuspenseRuntime,Ng as generateSuspenseCSS,Io as generateStateScript,wi as generateSrcsetData,bj as generateSrcset,Hk as generateSrcSet,nj as generateSpriteSheet,xq as generateSpaShell,xi as generateSourceTags,si as generateSizesFromBreakpoints,ri as generateSizesAttribute,Ik as generateSizes,Lf as generateSitemapIndex,hr as generateSitemap,Sp as generateSimpleMediaPicker,Mp as generateSignatureRuntime,af as generateSignalsRuntimeDev,$e as generateSignalsRuntime,cc as generateServerDataBridge,xj as generateScopeId,Hj as generateSFCWebComponent,Gb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,Nf as generateRobotsTxt,ir as generateRobots,aj as generateResponsiveVariants,Dj as generateReactiveWebComponentTS,Cj as generateReactiveWebComponent,Fj as generateReactiveRuntime,Ej as generateReactiveMixin,lj as generatePoster,Ki as generatePlaceholderStyle,Ji as generatePlaceholderCSS,Di as generatePlaceholder,lh as generatePartialHydrationCSS,od as generateNonce,sk as generateNetlifyToml,rq as generateMinifiedMediaRuntime,qq as generateMediaRuntime,Rp as generateMediaManagerEmbed,mm as generateManifest,Ao as generateLoadingIndicatorHtml,aq as generateLazyLoadRuntime,em as generateLayoutTypes,Gi as generateLQIP,Yg as generateKeepAliveRuntime,Xg as generateKeepAliveCSS,sh as generateIslandManifest,nq as generateImagePreview,Zk as generateImageManifest,Mo as generateHydrationScript,Ke as generateHydrationRuntime,Po as generateHydrationCSS,fh as generateHydrationBootstrap,Wj as generateHotReloadScript,jb as generateHeatmapScript,Do as generateHMRClientScript,oj as generateHLSManifest,Jo as generateEventBindings,qi as generateDprSrcsetWithVariableQuality,pi as generateDprSrcset,qg as generateDocumentShell,kn as generateDocs,fn as generateDirectivesDocs,gi as generateDirectiveRuntime,Of as generateDefaultRobotsTxt,pj as generateDASHManifest,Gc as generateCss,sd as generateCspMetaTag,rd as generateCspHeader,Kq as generateCompositionRuntime,dn as generateComponentsDocs,gh as generateComponentManifest,bn as generateComponentDoc,Ii as generateColorPlaceholder,Yf as generateColorModeBootScript,ul as generateClientRuntime,Ri as generateCacheKey,ac as generateBrowserAutoImportDestructuring,iq as generateBlurUpRuntime,jq as generateBlurUpCSS,Kc as generateBindingsRuntime,ni as generateAutoWidthSrcset,$b as generateAutoImportDestructuring,Tg as generateAsyncComponentRuntime,Sg as generateAsyncComponentCSS,Na as generateAnimationRuntime,La as generateAnimationCSS,Mc as generateAnalyticsScript,uo as formatTypecheckDiagnostics,oo as formatTypeErrors,In as formatStxContent,qk as formatSize,Ta as formatRoutes,Jn as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,fr as formatDoctorReport,gn as formatDocsAsMarkdown,jn as formatDocsAsJson,hn as formatDocsAsHtml,qp as format,zm as foldConstants,pp as flipVertical,op as flipHorizontal,fm as fingerprint,so as findRuntimeTypeDeclarations,dr as findPantryPackage,ed as findMatchingEndTag,ad as findMatchingDelimiter,Kb as findInterpolationEnd,gd as findIfBlocks,jd as findExpressions,Sa as findErrorPage,Bc as findDuplicateScopedStyleRanges,hd as findDirectiveBlocks,wm as findDeadCode,wm as findDeadBranches,Ql as findContainerRegion,cn as findComponentFiles,Jr as findCommonDir,pk as filterRequiredFiles,Th as fileExists,pf as extractVariables,km as extractTemplateExpressions,Ce as extractStreamBoundaries,Ko as extractState,Ih as extractSlotContent,rf as extractScriptFromTemplate,jm as extractScriptBlocks,hc as extractPlaceholders,dd as extractParenthesizedExpression,Sc as extractPageResponseStatus,hb as extractLayoutMetadata,Hi as extractDominantColor,md as extractDirectiveParams,Dh as extractDirectiveNames,am as extractContainerContent,$m as extractComponentProps,hh as extractComponentName,an as extractComponentDescription,Fc as extractClassNames,bc as extractBridgeData,ih as extractBoundProps,bd as extractBalancedExpression,Wb as extractAndStripCssImports,Bj as extractAndScopeStyles,Hb as extractAndProcessEvents,dk as externalizeSharedAssets,ek as externalizeRepeatedAssets,ck as externalizeHtml,xc as evaluateExpression,ym as evaluateConstant,_c as evaluateAuthExpression,qc as escapeHtmlValue,pc as escapeHtml,C as errorRecovery,E as errorLogger,Dg as ensureTeleportTargets,ug as ensureDocumentShell,ie as enhancedValidationRules,Zm as enableDevTools,xm as eliminateDeadCode,Pe as effect,xp as dprUrls,ln as docsCommand,cm as discoverLayoutNames,$p as disconnectObserver,_m as disableDevTools,F as devHelpers,Xl as detectShell,nn as detectRuntime,tk as detectProjectConfig,Ai as detectFormat,rm as detectBuildMode,Oe as derived,xk as deploy,Pj as defineStxConfig,Xo as defineStore,Hq as defineSlots,tr as defineSiteConfig,xr as definePropsWithValidation,wr as defineProps,Jj as definePlugin,Sd as definePageMeta,Wa as defineMiddleware,uh as defineForm,Cq as defineExpose,Bq as defineEmits,di as defineDirective,Xq as defineCustomElement,Un as defineConfig,ei as defineClientDirective,Qg as defineAsyncComponent,sq as defaultMediaConfig,$k as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,$d as defaultFormClasses,kc as defaultFilters,Id as defaultCspConfig,Lj as defaultConfig,Hr as default,zc as deepMergeThemes,Cc as dedupeScopedStyles,Tl as decodeTitleEntities,Fi as decodeThumbhash,Dd as cspNonceDirective,Cd as cspDirective,gq as crossfadeTransition,bp as crop,$g as createVirtualList,uj as createVideoDirective,zn as createVercelHandler,lo as createTypeChecker,fa as createTranslateFilter,vn as createTextEncoderStream,Wq as createStxApp,un as createStreamingResponse,Ee as createStreamRenderer,Vo as createStore,Za as createStorageManager,Xa as createServerCookieManager,dl as createScope,Lg as createSSRSuspense,Le as createRouter,eb as createRouteLocation,jo as createRoute,el as createRef,fl as createReactive,Jq as createProvideContext,$n as createProject,Tn as createProductionBuild,fc as createPlaceholder,Dm as createOptimizedBuild,An as createNetlifyHandler,lk as createNetlifyClient,fb as createMiddlewareContext,io as createMiddleware,Zp as createLazyObserver,Vg as createKeepAliveCache,rn as createKVNamespace,jh as createIslandRegistry,fj as createImgDirective,Wk as createImagePlugin,Pk as createImageHandler,Uk as createImageDirective,nb as createHeatmapAggregator,ok as createFileManifest,qn as createEnvAccessor,z as createEnhancedError,tn as createEdgeHandler,sn as createEdgeCache,Wh as createDetailedErrorMessage,yn as createDenoHandler,uk as createDefaultNetlifyConfig,Hd as createCspHeaders,Cn as createCookie,gl as createComputed,cl as createComponentInstance,xn as createCloudflareHandler,Ya as createClientCookieManager,fi as createBuiltinDirectives,Wq as createApp,Ka as createAnimationTimeline,ep as cover,qf as convertToCommonJS,lp as contrast,dp as contain,y as consoleError,m as configureErrorHandling,Oj as config,gl as computed,Ym as compressResponse,Qf as composerPattern,Pf as composer,Zl as composeShellWithPage,Sm as componentDirective,Rh as componentClientSignalNames,lm as compileTemplate,a as collectRepeatedFlag,nk as collectDeployFiles,og as cloakStyleFragment,kj as clearVideoCache,N as clearTranslationCache,zg as clearStoreCache,ik as clearStorage,Kp as clearSignatureCache,Mi as clearPlaceholderCache,xf as clearOnceStore,qd as clearNonce,bb as clearMiddleware,se as clearImagePlaceholders,oe as clearImageDeliveryCatalog,Tk as clearImageCache,e as clearErrorMessages,kf as clearDevCaches,oc as clearCustomFilters,Sf as clearComposers,Ag as clearComposableCache,Xh as clearComponentCache,Vi as clearCache,Db as clearBlankCache,zo as cleanupLoadingIndicator,Nl as classifyScript,Ol as classifyAllScripts,mo as checkTemplateFile,no as checkTemplate,lf as checkCache,Hp as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Nm as channel,Hn as captureScreenshots,Gn as captureScreenshot,Z as cancelPendingLoads,mk as calculateSha1,oi as calculateOptimalWidths,mf as cacheTemplate,wj as buildWebComponents,po as buildVirtualSource,uq as buildViews,Zo as buildUrl,ye as buildSuspenseResolveScript,sr as buildStaticSite,qb as buildRuntimeGlobalsDestructure,gm as buildRuntimeAsset,hm as buildRouterAsset,rr as buildLangPickerScript,ui as buildImageUrl,fg as buildIdFragment,kg as buildHtmlAttrs,pm as buildForProduction,Vm as buildComponentLibrary,Ip as buildAuthParams,qm as buildApp,pr as buildAlternateLinks,Sn as build,Lm as broadcastPrivate,Mm as broadcastPresence,Im as broadcast,kp as brightness,Mb as bracketDepths,fp as blur,Eb as blankInertHtmlRegions,Cp as batchSignUrls,Qe as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,sp as auto,ja as attributeValue,im as assetTags,Fb as asInvocableStatement,Er as arrayOf,mr as applyTranslations,$i as applyTransformations,Jh as applySlots,Rm as applyPropDefaults,vp as applyPreset,mg as applyHtmlAttrs,Xd as applyHead,wc as applyFilters,Vl as appendVary,wd as apiCspPreset,Da as animationGroupDirective,qj as analyzeVideo,tm as analyzeUsage,Ll as analyzeTemplate,Ml as analyzeProject,tm as analyzeDirectiveUsage,Oc as analyticsDirective,co as addStore,bo as addPage,Ad as addNonceToInlineContent,eo as addLayout,ao as addComponent,Qn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,ff as __setSignalsGeneratorsForTest,dg as __setBuildIdForTest,hj as VideoProcessorCache,vh as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,$c as Tokenizer,ko as TemplateTypeChecker,Kn as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,Sq as Show,ze as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,Yb as STX_AUTO_IMPORTS,Rb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Rl as SPA_NAV_HEADER,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Pc as RESPONSE_STATUS_KEY,Qc as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Rn as ProductionBuild,Uq as Portal,_n as PROJECT_TEMPLATES,up as PRESETS,sb as NON_CLIENT_PRIMITIVES,Qo as MemorySessionStore,li as MIME_TYPES,ii as MEDIA_DEFAULT_WIDTHS,ki as MEDIA_DEFAULT_FORMATS,bm as LAYOUT_TYPES_FILE,Yi as ImageProcessorCache,Nk as ImageProcessingError,Lo as HydrationRuntime,Vj as HotReloadServer,mb as HeatmapAggregator,ig as HTML_CLASS_MARKER,hg as HTML_ATTRS_MARKER,Lq as Fragment,Tq as For,Sl as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,bk as EXTERNALIZED_ASSET_DIR,zk as DeployError,Ak as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Qb as DEFAULT_STATE_DIR,Ck as DEFAULT_QUALITY,Bi as DEFAULT_PLACEHOLDER_OPTIONS,Bk as DEFAULT_FORMATS,ji as DEFAULT_DPR_VALUES,Co as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,ti as COMMON_SIZES,Wf as COLOR_MODE_BOOT_MARKER,Xf as COLOR_MODE_BOOT_GLOBAL,gg as CLOAK_STYLE,Pm as BroadcastServer,Om as Broadcast,ag as BUILD_ID_META,bg as BUILD_ID_HEADER,Nb as BROWSER_CORE_IMPORTS,Ci as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,cr as $path};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{hf as a}from"./chunk-x2pk87q2.js";import"./chunk-9rv7akqq.js";import"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{a as startProductionServer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pj as a,Qj as b,Rj as c,Sj as d,Tj as e,Uj as f,Vj as g,Wj as h,Xj as i,Yj as j,Zj as k,_j as l}from"./chunk-rdg1n42s.js";import"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,l as hashFilePath,h as getServeClientAsset,f as getCachedSignalsRuntime,g as getCachedRouterScript,i as clearDevCaches,j as checkCache,k as cacheTemplate,e as __setSignalsGeneratorsForTest};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{fj as a,gj as b,hj as c,ij as d,jj as e,kj as f,lj as g,mj as h,nj as i,oj as j,pj as k,qj as l,rj as m,sj as n}from"./chunk-ew6tr7b1.js";import"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
@@ -1,18 +0,0 @@
1
- // @bun
2
- import{Hp as k,Nl as A,Ol as D,Qm as T,Rm as y,Sn as x,cm as B,cr as w,em as F,eo as M,wo as R}from"./chunk-rsxmjfxq.js";import{wv as P}from"./chunk-ddqkj56r.js";function b(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,X){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(X?.some((Y)=>q>=Y.start&&N<=Y.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,X)=>J.start-X.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function j(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>D(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as v,resolve as H}from"path";function f(K){let z=K,G=x(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],X=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],Y=$[2],E=$[0],Z=N.includes("server");if(X(Y))J.push(E);else if(Z)Q.push(Y);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,Y,E=[];while((Y=N.exec(q))!==null){let Z=Y.index+Y[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:Y.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function S(K,z){return`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>${(z||"stx").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</title>
8
- </head>
9
- <body>
10
- ${K}
11
- </body>
12
- </html>`}async function s(K,z={}){let G=H(K),_=Bun.file(G);if(!await _.exists())throw Error(`Template file not found: ${G}`);let U=await _.text(),Q=null;if(b(G)){let J=await j(U,{renderer:z.markdownRenderer});U=J.html,Q=J.frontmatter}if(Q)z={...z,context:{...Q,...z.context||{}}};if(z.layout){let J=H(z.layout),X=Bun.file(J);if(!await X.exists())throw Error(`Layout template not found: ${J}`);let{layout:$,injectCSS:q,...N}=z,Y=await I(U,G,{...N,injectCSS:!1}),E=await X.text(),Z={...z.context||{},content:Y},L={...N,context:Z,injectCSS:q};return I(E,J,L)}return I(U,G,z)}async function i(K,z={},G={}){return I(K,process.cwd(),{context:z,...G})}async function I(K,z,G={}){let{templateContent:_,serverScripts:U,clientScripts:Q}=f(K),J={...w,...G.options},X={__filename:z,__dirname:v(z),__stx:{},__stx_options:J,__stx_sfc_mode:!0,__stx_inject_css:G.injectCSS===!0,__stxServeContext:void 0,...y(G.context??{}),definePageMeta:()=>{},...G.context||{}};for(let N of U)await R(N,X,z);let $=new Set,q=_;if(q=await k(q,X,z,J,$),T(X,G.context),G.templateOnly){if(q=q.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),q=q.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),Q.length>0)q+=`
13
- ${Q.join(`
14
- `)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=X.__stx_event_bindings||[],Y=B(X),Z=(await Promise.all(Q.map(async(V)=>{let W=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return V;return await F(W[1],{eventBindings:N,templateContent:q,serverData:Y,filePath:z})}))).join(`
15
- `);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
16
- $1`);else q+=`
17
- ${Z}`}q=await M(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=S(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-95t0k8cz.js");q=await N(q)}catch{}return q}
18
- export{b as sk,C as tk,j as uk,s as vk,i as wk,I as xk};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ji as a,ki as b,li as c,mi as d,ni as e,oi as f,pi as g,qi as h}from"./chunk-7eg7ep8f.js";import"./chunk-w8yac9xp.js";import"./chunk-ddqkj56r.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Og as a,Pg as b,Qg as c,Rg as d,Sg as e,Tg as f}from"./chunk-y7dcdjav.js";import"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Co as a,Do as b}from"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{b as processLoops,a as parseLoopBinding};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ao as i,Bo as j,so as a,to as b,uo as c,vo as d,wo as e,xo as f,yo as g,zo as h}from"./chunk-rsxmjfxq.js";import"./chunk-m6wz1hf5.js";import"./chunk-dcxtrqfy.js";import"./chunk-jj6yp7gm.js";import"./chunk-qjkzpd68.js";import"./chunk-2rp09y5j.js";import"./chunk-whm6bybj.js";import"./chunk-q25mr70f.js";import"./chunk-jsfch50r.js";import"./chunk-6b4k8fay.js";import"./chunk-jb2r696a.js";import"./chunk-k5xtf38q.js";import"./chunk-0tbgvp70.js";import"./chunk-xdq52pwj.js";import"./chunk-ddqkj56r.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};