@voltro/cli 0.53.0 → 0.54.0

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 (181) hide show
  1. package/CHANGELOG.md +195 -0
  2. package/dist/{agentsMd-0l980yhL.js → agentsMd-BaLC10Na.js} +110 -82
  3. package/dist/agentsMd-DCY1RSs8.js +2 -0
  4. package/dist/apiBuild-CeUN55uk.js +2 -0
  5. package/dist/{apiBuild-CaPfoWku.js → apiBuild-DTWp0S_q.js} +2 -2
  6. package/dist/bin.js +1 -1
  7. package/dist/{build-D-OnvNMf.js → build-D4ygSbnV.js} +114 -114
  8. package/dist/{checkCommand-C5elt0tW.js → checkCommand-Dg1G7Gwd.js} +6 -6
  9. package/dist/{checkCommand-D2ZduVlh.js → checkCommand-L7DTlpIF.js} +1 -1
  10. package/dist/{cloudCmd-QUXh-b5w.js → cloudCmd-DzKcSYuy.js} +1 -1
  11. package/dist/{codegen-FEk8AZHb.js → codegen-DSLM8Su9.js} +2 -2
  12. package/dist/codegen-DjgxEOnD.js +2 -0
  13. package/dist/codegenCommand-CG_Vx4lc.js +41 -0
  14. package/dist/{codemodRunner-BjtB2lq6.js → codemodRunner-Cd4xkC6u.js} +9 -9
  15. package/dist/{commands-DyxAmhP0.js → commands-6Kzi92Np.js} +96 -73
  16. package/dist/{dashboardCommand-BdKTyT13.js → dashboardCommand-Cq1PWvI1.js} +3 -3
  17. package/dist/{dataCommand-Bab9X7s8.js → dataCommand-DYzW8vkv.js} +3 -3
  18. package/dist/{dbCommand-06O2finM.js → dbCommand-B4NWZtGL.js} +3 -3
  19. package/dist/dbCommand-CSFWs9ev.js +2 -0
  20. package/dist/{dev-C6LGF4iY.js → dev-CmuvUKRq.js} +2236 -2219
  21. package/dist/{dev-GjJWAYo2.js → dev-cKUiZZsB.js} +1 -1
  22. package/dist/{doctorCommand-etMkflRc.js → doctorCommand-DCiFVMtZ.js} +21 -21
  23. package/dist/doctorCommand-J3qu4E0Y.js +2 -0
  24. package/dist/{dormancyCommand-UwZ1AZzB.js → dormancyCommand-w1TrmgYP.js} +1 -1
  25. package/dist/{embeddingsCommand-C70zWHwo.js → embeddingsCommand-CMgPyRTr.js} +1 -1
  26. package/dist/{envCommand-dSyKvRkM.js → envCommand-Cyynmcfa.js} +15 -15
  27. package/dist/{evolveCommand-CG0_ebO5.js → evolveCommand-BwvQ8dVH.js} +2 -2
  28. package/dist/fileConventions-l-RIXbx8.js +36 -0
  29. package/dist/{fileTaxonomy-B7uxipWS.js → fileTaxonomy-CbyMQYx_.js} +37 -37
  30. package/dist/{frameworkTableAssembly-DKx3ba3S.js → frameworkTableAssembly-D7LJuALW.js} +5 -5
  31. package/dist/frameworkTableAssembly-IPD1pUnZ.js +2 -0
  32. package/dist/index.js +2 -2
  33. package/dist/{infoCommand-_53iOc_j.js → infoCommand-DlYlUPqs.js} +1 -1
  34. package/dist/{metaCommands-Cn2oboG4.js → metaCommands-x7RCi2AF.js} +2 -2
  35. package/dist/{migrate-Cko9rswM.js → migrate-BK_Bbx-_.js} +2 -2
  36. package/dist/mobileCommand-D9O6iq3D.js +428 -0
  37. package/dist/mobileCommand-DAum7tsG.js +2 -0
  38. package/dist/{pageConvention-C938S8oC.js → pageConvention-CMpfDN6r.js} +1 -1
  39. package/dist/{privacyCommand-DWTQMC6R.js → privacyCommand-BCa2OoZG.js} +2 -2
  40. package/dist/{probeCommand-DkGGLknv.js → probeCommand-_C0YU207.js} +1 -1
  41. package/dist/{projectScaffold-EzlErR4E.js → projectScaffold-CJfP-xbT.js} +1 -1
  42. package/dist/{projectScaffold-B4dmTlwT.js → projectScaffold-CSN0OzBV.js} +2 -2
  43. package/dist/renderModeScan-43yQ2opo.js +147 -0
  44. package/dist/{renderProfile-CskIgAfn.js → renderProfile-DvrhVJHa.js} +2 -2
  45. package/dist/{runtimeTrace-c0APJz7E.js → runtimeTrace-CGWx1Q6l.js} +1 -1
  46. package/dist/{sdkgen-BiQCgIEr.js → sdkgen-CDGHQUFj.js} +1 -1
  47. package/dist/serveCommand-BiPe8BJm.js +2 -0
  48. package/dist/{serveCommand-CueKQgzl.js → serveCommand-Bje09q1v.js} +708 -708
  49. package/dist/serveEntry.js +1 -1
  50. package/dist/start-B0bnJgxI.js +3 -0
  51. package/dist/{start-ekPan8BT.js → start-Clz-1BHB.js} +511 -504
  52. package/dist/startEntry.js +1 -1
  53. package/dist/{staticCommand-xlSL-IWk.js → staticCommand-ey0kYmOT.js} +1 -1
  54. package/dist/{subcommandNames-DpYs3DXr.js → subcommandNames-CDzfEtKV.js} +3 -3
  55. package/dist/{templates-BR-fb4SP.js → templates-BTWZkJJT.js} +41 -9
  56. package/dist/{test-BWPQcRoB.js → test-D_kW4KMj.js} +1 -1
  57. package/dist/updateCommand-CIoVDKnj.js +2 -0
  58. package/dist/{updateCommand-C_8I8Rzo.js → updateCommand-CRJlAOaM.js} +1 -1
  59. package/dist/{webDev-oczpugbx.js → webDev-DSI9SOhs.js} +1127 -1090
  60. package/dist/{webDev-C7jWJ5dX.js → webDev-DlvZO30c.js} +1 -1
  61. package/dist/{webhooksCommand-4SVPDjKg.js → webhooksCommand-BvzXNHji.js} +1 -1
  62. package/dist/workspaceDeps-RKEkX92S.js +45 -0
  63. package/package.json +19 -19
  64. package/templates/AGENTS.core.md +2 -0
  65. package/templates/AGENTS.md +4 -2
  66. package/templates/agent-docs/_index.md +2 -2
  67. package/templates/agent-docs/_manifest.json +1 -1
  68. package/templates/agent-docs/ai.md +4 -4
  69. package/templates/agent-docs/authentication.md +72 -0
  70. package/templates/agent-docs/cli.md +4 -1
  71. package/templates/agent-docs/data.md +61 -12
  72. package/templates/agent-docs/database/advancedqueries.md +1 -1
  73. package/templates/agent-docs/database/migrations.md +1 -1
  74. package/templates/agent-docs/database/seedsdialects.md +64 -2
  75. package/templates/agent-docs/internationalization.md +2 -0
  76. package/templates/agent-docs/introduction.md +25 -0
  77. package/templates/agent-docs/local-first-mobile.md +139 -41
  78. package/templates/agent-docs/observability.md +4 -2
  79. package/templates/agent-docs/plugins/atlassian.md +2 -2
  80. package/templates/agent-docs/plugins/audit.md +2 -2
  81. package/templates/agent-docs/plugins/billing.md +1 -1
  82. package/templates/agent-docs/plugins/cdc-out.md +8 -3
  83. package/templates/agent-docs/plugins/comments.md +22 -0
  84. package/templates/agent-docs/plugins/presence.md +32 -3
  85. package/templates/agent-docs/plugins/prometheus.md +2 -0
  86. package/templates/agent-docs/plugins/queue.md +47 -4
  87. package/templates/agent-docs/plugins.md +6 -6
  88. package/templates/agent-docs/reference.md +20 -1
  89. package/templates/agent-docs/routing.md +63 -9
  90. package/templates/agent-docs/scheduling.md +1 -1
  91. package/templates/agent-docs/schema-driven-ui.md +12 -1
  92. package/templates/agent-docs/templates/appshells.md +36 -4
  93. package/templates/agent-docs/whats-new.md +109 -135
  94. package/templates/apps/api-ai/package.json +6 -6
  95. package/templates/apps/api-auth/package.json +8 -8
  96. package/templates/apps/api-backend/package.json +7 -7
  97. package/templates/apps/api-backend-deactivation/package.json +7 -7
  98. package/templates/apps/api-backend-mail/package.json +8 -8
  99. package/templates/apps/api-backend-mariadb/package.json +9 -9
  100. package/templates/apps/api-backend-sqlite/package.json +8 -8
  101. package/templates/apps/api-backend-storage/package.json +8 -8
  102. package/templates/apps/api-cms/package.json +9 -9
  103. package/templates/apps/api-collab/README.md +3 -3
  104. package/templates/apps/api-collab/app.config.ts +1 -1
  105. package/templates/apps/api-collab/database/schema.ts +12 -8
  106. package/templates/apps/api-collab/mutations/documents.create.mutation.server.ts +1 -1
  107. package/templates/apps/api-collab/mutations/documents.setBody.mutation.server.ts +1 -1
  108. package/templates/apps/api-collab/mutations/documents.setBody.mutation.ts +1 -1
  109. package/templates/apps/api-collab/package.json +8 -8
  110. package/templates/apps/api-collab/template.json +1 -1
  111. package/templates/apps/api-collab/tests/documents.setBody.test.ts +10 -2
  112. package/templates/apps/api-data-advanced/package.json +8 -8
  113. package/templates/apps/api-durable/package.json +8 -8
  114. package/templates/apps/api-feature-flags/package.json +9 -9
  115. package/templates/apps/api-governance/package.json +8 -8
  116. package/templates/apps/api-kv/package.json +8 -8
  117. package/templates/apps/api-moderation/package.json +8 -8
  118. package/templates/apps/api-observability/package.json +8 -8
  119. package/templates/apps/api-ratelimit/package.json +8 -8
  120. package/templates/apps/api-rbac/package.json +8 -8
  121. package/templates/apps/api-rest/package.json +7 -7
  122. package/templates/apps/api-row-history/package.json +8 -8
  123. package/templates/apps/api-saas/package.json +11 -10
  124. package/templates/apps/api-saas-starter/package.json +10 -10
  125. package/templates/apps/api-search/package.json +8 -8
  126. package/templates/apps/api-status/package.json +8 -8
  127. package/templates/apps/api-webhooks/package.json +9 -9
  128. package/templates/apps/changelog/package.json +7 -6
  129. package/templates/apps/edge-functions/package.json +2 -2
  130. package/templates/apps/frontend-admin/package.json +8 -8
  131. package/templates/apps/frontend-app/package.json +9 -9
  132. package/templates/apps/frontend-auth/package.json +8 -8
  133. package/templates/apps/frontend-blank/package.json +7 -7
  134. package/templates/apps/frontend-cms/package.json +9 -9
  135. package/templates/apps/frontend-collab/README.md +43 -24
  136. package/templates/apps/frontend-collab/app.config.ts +3 -3
  137. package/templates/apps/frontend-collab/package.json +14 -10
  138. package/templates/apps/frontend-collab/src/locales/de.ts +1 -2
  139. package/templates/apps/frontend-collab/src/locales/en.ts +1 -2
  140. package/templates/apps/frontend-collab/src/pages/page.test.tsx +72 -76
  141. package/templates/apps/frontend-collab/src/pages/page.tsx +45 -22
  142. package/templates/apps/frontend-collab/template.json +2 -2
  143. package/templates/apps/frontend-contact/package.json +7 -7
  144. package/templates/apps/frontend-dashboard/package.json +7 -7
  145. package/templates/apps/frontend-docs/package.json +8 -7
  146. package/templates/apps/frontend-i18n/package.json +6 -6
  147. package/templates/apps/frontend-landing/README.md +48 -0
  148. package/templates/apps/frontend-landing/app.config.ts +28 -0
  149. package/templates/apps/frontend-landing/package.json +7 -6
  150. package/templates/apps/frontend-landing/src/assets/hero.jpg +0 -0
  151. package/templates/apps/frontend-landing/src/fonts/Geist-Variable.woff2 +0 -0
  152. package/templates/apps/frontend-landing/src/fonts/LICENSE-Geist.txt +92 -0
  153. package/templates/apps/frontend-landing/src/globals.css +15 -0
  154. package/templates/apps/frontend-landing/src/globals.d.ts +17 -0
  155. package/templates/apps/frontend-landing/src/locales/de.ts +3 -2
  156. package/templates/apps/frontend-landing/src/locales/en.ts +5 -2
  157. package/templates/apps/frontend-landing/src/pages/page.test.tsx +79 -0
  158. package/templates/apps/frontend-landing/src/pages/page.tsx +26 -3
  159. package/templates/apps/frontend-landing/template.json +2 -2
  160. package/templates/apps/frontend-portal/package.json +8 -8
  161. package/templates/apps/frontend-saas/package.json +8 -8
  162. package/templates/apps/frontend-spa/package.json +7 -7
  163. package/templates/apps/frontend-ssr/package.json +7 -7
  164. package/templates/apps/frontend-ssr-api/package.json +8 -8
  165. package/templates/apps/frontend-static-blog/package.json +8 -7
  166. package/templates/apps/frontend-status/package.json +8 -8
  167. package/templates/apps/mobile-app/package.json +12 -11
  168. package/templates/apps/mobile-app/src/lib/deeplinks.ts +29 -17
  169. package/templates/apps/mobile-app/tests/deeplinks.test.ts +16 -0
  170. package/dist/agentsMd-SDDSkyl4.js +0 -2
  171. package/dist/apiBuild-DHtLXYx9.js +0 -2
  172. package/dist/codegen-BWpt3VgF.js +0 -2
  173. package/dist/codegenCommand-BOiWQ5hz.js +0 -137
  174. package/dist/dbCommand-B1EXBC6f.js +0 -2
  175. package/dist/doctorCommand-B0hX0tdz.js +0 -2
  176. package/dist/fileConventions-DASGEmj-.js +0 -35
  177. package/dist/frameworkTableAssembly-C_7Z-rMs.js +0 -2
  178. package/dist/renderModeScan-CUbOeOAg.js +0 -122
  179. package/dist/serveCommand-DsnrVN3U.js +0 -2
  180. package/dist/start-BJzZLbt8.js +0 -3
  181. package/dist/updateCommand-Bqql_rsQ.js +0 -2
@@ -2,43 +2,45 @@ import { t as e } from "./nodeEnvironment-cGFAj1J8.js";
2
2
  import { n as t } from "./loadEnv-D9nEOClM.js";
3
3
  import { t as n } from "./bootRefusal-pgvDxlrU.js";
4
4
  import { r } from "./appPort-B_HpJ_ck.js";
5
- import { _ as i, g as a, h as o, j as s, s as c, v as l } from "./fileConventions-DASGEmj-.js";
5
+ import { M as i, _ as a, c as o, g as s, v as c, y as l } from "./fileConventions-l-RIXbx8.js";
6
6
  import { A as u, D as d, a as f, h as p, j as m, k as h } from "./inspect-Bd8-9wsi.js";
7
- import { n as g } from "./agentsMd-0l980yhL.js";
8
- import { c as _, f as v, p as y, t as b } from "./renderModeScan-CUbOeOAg.js";
9
- import { a as x, c as S, d as C, f as w, i as T, l as E, o as D, p as O, r as k, s as A, t as j } from "./imagePipeline-CBZmjT4i.js";
10
- import { d as M, n as N } from "./fontPipeline-Tsh8kZfA.js";
11
- import { t as P } from "./pageConvention-C938S8oC.js";
12
- import { i as ee, n as te, r as ne, t as re } from "./runtimeRegistry-DMeKfTHP.js";
13
- import { n as ie } from "./logFileSink-B4uP8pvf.js";
14
- import { basename as ae, dirname as F, join as I, relative as L, resolve as R, sep as z } from "node:path";
15
- import { existsSync as B, promises as V, readFileSync as oe, readdirSync as H, statSync as U, unwatchFile as se, watchFile as ce } from "node:fs";
16
- import { fileURLToPath as W, pathToFileURL as G } from "node:url";
17
- import { addSink as le, createLogger as K, printReadyBlock as ue } from "@voltro/logger";
18
- import { createRequire as q } from "node:module";
19
- import { classifyRequestOrigin as de, currentTraceContext as fe, resolveOriginGuardConfig as pe, resolveSecret as me } from "@voltro/runtime";
20
- import { homedir as he } from "node:os";
21
- import { FRAMEWORK_ENV_CATALOG as ge, appEnvEntries as _e, checkEnvNaming as ve, formatEnvErrors as ye, installEnvSnapshot as be, isEnvContract as xe, pluginEnvEntries as Se, renderDotEnvExample as Ce, resolveEnv as we } from "@voltro/env";
22
- import { __installPublicEnv as Te } from "@voltro/env/public";
23
- import { mkdir as Ee, readFile as De, writeFile as J } from "node:fs/promises";
24
- import { createHash as Oe, createHmac as ke, randomBytes as Ae, timingSafeEqual as je } from "node:crypto";
25
- import { spawn as Me } from "node:child_process";
26
- import { createConnection as Ne } from "node:net";
27
- import { FORM_FLASH_SCRIPT_ID as Pe, FORM_KEY_FIELD as Fe, FORM_PATH_PREFIX as Ie, FORM_PATH_PREFIX as Le, FORM_REDIRECT_FIELD as Re, formDataToInput as ze, validateFields as Y } from "@voltro/client/form";
28
- import { buildFeed as Be, contentArtifactPath as Ve, getCollection as He, getEntry as Ue, invalidateContentCache as We, registeredCollections as Ge, setContentRoot as Ke, validateReferences as qe } from "@voltro/content";
29
- import { PassThrough as Je } from "node:stream";
7
+ import { n as g, t as _ } from "./workspaceDeps-RKEkX92S.js";
8
+ import { n as v } from "./agentsMd-BaLC10Na.js";
9
+ import { c as y, f as b, p as x, t as S } from "./renderModeScan-43yQ2opo.js";
10
+ import { a as C, c as w, d as T, f as E, i as D, l as O, o as ee, p as k, r as te, s as A, t as j } from "./imagePipeline-CBZmjT4i.js";
11
+ import { d as ne, n as M } from "./fontPipeline-Tsh8kZfA.js";
12
+ import { t as re } from "./pageConvention-CMpfDN6r.js";
13
+ import { i as ie, n as ae, r as oe, t as se } from "./runtimeRegistry-DMeKfTHP.js";
14
+ import { n as ce } from "./logFileSink-B4uP8pvf.js";
15
+ import { basename as N, dirname as P, extname as le, join as F, relative as I, resolve as L, sep as R } from "node:path";
16
+ import { existsSync as z, mkdirSync as ue, promises as B, readFileSync as V, readdirSync as H, statSync as de, unwatchFile as U, watchFile as fe, writeFileSync as pe } from "node:fs";
17
+ import { fileURLToPath as W, pathToFileURL as me } from "node:url";
18
+ import { addSink as he, createLogger as G, printReadyBlock as ge } from "@voltro/logger";
19
+ import { Metric as _e, MetricBoundaries as ve } from "effect";
20
+ import { createRequire as ye } from "node:module";
21
+ import { classifyRequestOrigin as be, currentTraceContext as xe, resolveOriginGuardConfig as Se, resolveSecret as Ce } from "@voltro/runtime";
22
+ import { homedir as we } from "node:os";
23
+ import { FRAMEWORK_ENV_CATALOG as Te, appEnvEntries as Ee, checkEnvNaming as De, formatEnvErrors as Oe, installEnvSnapshot as ke, isEnvContract as Ae, pluginEnvEntries as je, renderDotEnvExample as Me, resolveEnv as Ne } from "@voltro/env";
24
+ import { __installPublicEnv as Pe } from "@voltro/env/public";
25
+ import { mkdir as K, readFile as Fe, writeFile as q } from "node:fs/promises";
26
+ import { createHash as J, createHmac as Ie, randomBytes as Le, timingSafeEqual as Re } from "node:crypto";
27
+ import { spawn as ze } from "node:child_process";
28
+ import { createConnection as Y } from "node:net";
29
+ import { FORM_FLASH_SCRIPT_ID as Be, FORM_KEY_FIELD as Ve, FORM_PATH_PREFIX as He, FORM_PATH_PREFIX as Ue, FORM_REDIRECT_FIELD as We, formDataToInput as Ge, validateFields as Ke } from "@voltro/client/form";
30
+ import { buildFeed as qe, contentArtifactPath as Je, getCollection as Ye, getEntry as Xe, invalidateContentCache as Ze, registeredCollections as Qe, setContentAssetResolver as $e, setContentRoot as et, validateReferences as tt } from "@voltro/content";
31
+ import { PassThrough as nt } from "node:stream";
30
32
  //#region src/buildToolImport.ts
31
- var Ye = (e) => {
33
+ var rt = (e) => {
32
34
  let t = e;
33
35
  return t?.code === "ERR_MODULE_NOT_FOUND" || /Cannot find (package|module)/.test(String(t?.message ?? ""));
34
- }, Xe = async (e, t) => {
36
+ }, it = async (e, t) => {
35
37
  try {
36
38
  return await t();
37
39
  } catch (t) {
38
- throw Ye(t) ? Error(`voltro: the build tool '${e}' is not installed.\n\nIt's an OPTIONAL dependency of @voltro/cli — needed by 'voltro dev' and 'voltro build', but excluded from a serve-only production install (that's how prod images stay lean). If you are building, reinstall WITHOUT '--no-optional' (e.g. 'pnpm install'). A production SERVE container does not need '${e}' — it boots from the precompiled bundle.`) : t;
40
+ throw rt(t) ? Error(`voltro: the build tool '${e}' is not installed.\n\nIt's an OPTIONAL dependency of @voltro/cli — needed by 'voltro dev' and 'voltro build', but excluded from a serve-only production install (that's how prod images stay lean). If you are building, reinstall WITHOUT '--no-optional' (e.g. 'pnpm install'). A production SERVE container does not need '${e}' — it boots from the precompiled bundle.`) : t;
39
41
  }
40
- }, Ze = "// AUTO-GENERATED by Voltro — DO NOT EDIT.\n// Source: app.config.ts `env` (defineEnv). Regenerated on every `voltro dev` boot.\n", Qe = (e, t) => t ? `${e} | undefined` : e, $e = (e, t) => Object.entries(e.vars).filter(([, e]) => t(e.access)).map(([e, t]) => `${t.description ? ` /** ${t.description} */\n` : ""} readonly ${e}: ${Qe(t.tsType, t.optional)}`).join("\n"), et = async (e, t) => {
41
- let n = $e(t, () => !0), r = `${Ze}
42
+ }, at = "// AUTO-GENERATED by Voltro — DO NOT EDIT.\n// Source: app.config.ts `env` (defineEnv). Regenerated on every `voltro dev` boot.\n", ot = (e, t) => t ? `${e} | undefined` : e, st = (e, t) => Object.entries(e.vars).filter(([, e]) => t(e.access)).map(([e, t]) => `${t.description ? ` /** ${t.description} */\n` : ""} readonly ${e}: ${ot(t.tsType, t.optional)}`).join("\n"), ct = async (e, t) => {
43
+ let n = st(t, () => !0), r = `${at}
42
44
  import '@voltro/env/server'
43
45
 
44
46
  declare module '@voltro/env/server' {
@@ -47,9 +49,9 @@ ${n.length > 0 ? n : " // (no variables declared)"}
47
49
  }
48
50
  }
49
51
  `;
50
- await J(I(e, "env.generated.d.ts"), r, "utf8");
51
- }, tt = async (e, t) => {
52
- let n = $e(t, (e) => e === "public"), r = `${Ze}
52
+ await q(F(e, "env.generated.d.ts"), r, "utf8");
53
+ }, lt = async (e, t) => {
54
+ let n = st(t, (e) => e === "public"), r = `${at}
53
55
  import '@voltro/env/public'
54
56
 
55
57
  declare module '@voltro/env/public' {
@@ -57,10 +59,10 @@ declare module '@voltro/env/public' {
57
59
  ${n.length > 0 ? n : " // (no public variables declared)"}
58
60
  }
59
61
  }
60
- `, i = I(e, "src");
61
- await Ee(i, { recursive: !0 }), await J(I(i, "voltro-env.d.ts"), r, "utf8");
62
- }, nt = async (e, t) => {
63
- let n = `${Ze}
62
+ `, i = F(e, "src");
63
+ await K(i, { recursive: !0 }), await q(F(i, "voltro-env.d.ts"), r, "utf8");
64
+ }, ut = async (e, t) => {
65
+ let n = `${at}
64
66
  import { __installPublicEnv } from '@voltro/env/public'
65
67
 
66
68
  export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
@@ -68,14 +70,14 @@ export const publicEnvValues = ${JSON.stringify(t, null, 2)} as const
68
70
  // Set the browser/SSR-shared global the \`publicEnv\` accessor reads.
69
71
  __installPublicEnv(publicEnvValues)
70
72
  `;
71
- await Ee(e, { recursive: !0 }), await J(I(e, "env.public.ts"), n, "utf8");
72
- }, rt = async (e) => {
73
- let t = xe(e.rawEnv) ? e.rawEnv : void 0, n = await we({
73
+ await K(e, { recursive: !0 }), await q(F(e, "env.public.ts"), n, "utf8");
74
+ }, dt = async (e) => {
75
+ let t = Ae(e.rawEnv) ? e.rawEnv : void 0, n = await Ne({
74
76
  contract: t,
75
- resolveSecret: me
76
- }), r = [...n.errors, ...ve(t, e.appType)];
77
- if (r.length > 0) throw Error(ye(r));
78
- be(n.values), e.appType === "web" && Te(n.publicValues);
77
+ resolveSecret: Ce
78
+ }), r = [...n.errors, ...De(t, e.appType)];
79
+ if (r.length > 0) throw Error(Oe(r));
80
+ ke(n.values), e.appType === "web" && Pe(n.publicValues);
79
81
  let i = t ? Object.keys(t.vars).length : 0;
80
82
  if (i > 0) {
81
83
  let r = Object.keys(n.publicValues).length;
@@ -87,20 +89,20 @@ __installPublicEnv(publicEnvValues)
87
89
  n.length > 0 && e.log.warn(`env: ${n.length} secret var(s) declared on a web app — secrets are reachable only from server-side render code and are NEVER bundled. Prefer declaring secrets on the api.`, { keys: n });
88
90
  }
89
91
  }
90
- return e.generateTypes && t && (e.appType === "api" ? await et(e.root, t) : await tt(e.root, t)), {
92
+ return e.generateTypes && t && (e.appType === "api" ? await ct(e.root, t) : await lt(e.root, t)), {
91
93
  resolved: n,
92
94
  contract: t
93
95
  };
94
- }, it = (e) => {
95
- let t = _e(e.contract), n = (e.plugins ?? []).flatMap((e) => Se(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : ge, i = /* @__PURE__ */ new Set(), a = [];
96
+ }, ft = (e) => {
97
+ let t = Ee(e.contract), n = (e.plugins ?? []).flatMap((e) => je(e.name, e.declaredEnv)), r = e.includeFramework === !1 ? [] : Te, i = /* @__PURE__ */ new Set(), a = [];
96
98
  for (let e of [
97
99
  ...t,
98
100
  ...n,
99
101
  ...r
100
102
  ]) i.has(e.key) || (i.add(e.key), a.push(e));
101
103
  return a;
102
- }, at = (e, t, n = (e) => process.env[e]) => {
103
- let r = it(t).map((e) => {
104
+ }, pt = (e, t, n = (e) => process.env[e]) => {
105
+ let r = ft(t).map((e) => {
104
106
  let t = n(e.key) !== void 0;
105
107
  return {
106
108
  ...e,
@@ -117,59 +119,20 @@ __installPublicEnv(publicEnvValues)
117
119
  missingRequired: r.filter((e) => e.required && !e.isSet && e.default === void 0).length
118
120
  }
119
121
  };
120
- }, ot = (e, t) => {
121
- let n = it({
122
+ }, mt = (e, t) => {
123
+ let n = ft({
122
124
  ...e,
123
125
  includeFramework: !1
124
126
  });
125
- return Ce(n, {
127
+ return Me(n, {
126
128
  includeFramework: e.includeFramework !== !1,
127
129
  ...t ? { header: t } : {}
128
130
  });
129
- }, st = async (e, t) => {
130
- let n = e;
131
- for (;;) {
132
- let e = I(n, "node_modules", t);
133
- try {
134
- if ((await V.stat(e)).isDirectory()) {
135
- let t = await V.realpath(e);
136
- return t.includes("/node_modules/") ? null : t;
137
- }
138
- } catch {}
139
- let r = F(n);
140
- if (r === n) return null;
141
- n = r;
142
- }
143
- }, ct = async (e) => {
144
- let t;
145
- try {
146
- let n = await V.readFile(I(e, "package.json"), "utf8"), r = JSON.parse(n);
147
- t = Object.keys({
148
- ...r.dependencies,
149
- ...r.devDependencies
150
- });
151
- } catch {
152
- return [];
153
- }
154
- return (await Promise.all(t.map(async (t) => {
155
- let n = await st(e, t);
156
- if (n === null) return null;
157
- let r = I(n, "src");
158
- try {
159
- if (!(await V.stat(r)).isDirectory()) return null;
160
- } catch {
161
- return null;
162
- }
163
- return {
164
- pkg: t,
165
- dir: r
166
- };
167
- }))).filter((e) => e !== null);
168
- }, lt = 500, ut = (e, t, n = {}) => {
131
+ }, ht = 500, gt = (e, t, n = {}) => {
169
132
  if (e.length === 0) return () => {};
170
- let r = (e) => n.root ? L(n.root, e) : e, i = !1, a = (e) => {
133
+ let r = (e) => n.root ? I(n.root, e) : e, i = !1, a = (e) => {
171
134
  i || (i = !0, t.warn(`.env changed (${r(e)}) — hard-restarting: process.env is read once at boot, a reload would keep stale values`, { file: r(e) }), Promise.resolve().then(() => n.onBeforeRestart?.()).catch((e) => t.warn(".env restart: onBeforeRestart failed (continuing)", {}, e)).finally(() => {
172
- let e = Me(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
135
+ let e = ze(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
173
136
  stdio: "inherit",
174
137
  env: process.env,
175
138
  cwd: n.cwd ?? process.cwd()
@@ -183,22 +146,22 @@ __installPublicEnv(publicEnvValues)
183
146
  });
184
147
  }));
185
148
  };
186
- for (let t of e) ce(t, { interval: lt }, (e, n) => {
149
+ for (let t of e) fe(t, { interval: ht }, (e, n) => {
187
150
  e.mtimeMs !== n.mtimeMs && a(t);
188
151
  });
189
152
  return t.info("watching .env files for changes", {
190
153
  files: e.map(r),
191
- intervalMs: lt
154
+ intervalMs: ht
192
155
  }), () => {
193
- for (let t of e) se(t);
156
+ for (let t of e) U(t);
194
157
  };
195
- }, dt = [{
158
+ }, _t = [{
196
159
  host: "127.0.0.1",
197
160
  family: "IPv4"
198
161
  }, {
199
162
  host: "::1",
200
163
  family: "IPv6"
201
- }], ft = (e, t, n) => new Promise((r) => {
164
+ }], vt = (e, t, n) => new Promise((r) => {
202
165
  let i = !1, a = (e) => {
203
166
  if (!i) {
204
167
  i = !0;
@@ -207,15 +170,15 @@ __installPublicEnv(publicEnvValues)
207
170
  } catch {}
208
171
  r(e);
209
172
  }
210
- }, o = Ne({
173
+ }, o = Y({
211
174
  host: e,
212
175
  port: t
213
176
  });
214
177
  o.once("connect", () => a(!0)), o.once("error", () => a(!1)), o.setTimeout(n, () => a(!1));
215
- }), pt = async (e, t = 400) => ({ families: (await Promise.all(dt.map(async (n) => ({
178
+ }), yt = async (e, t = 400) => ({ families: (await Promise.all(_t.map(async (n) => ({
216
179
  family: n.family,
217
- taken: await ft(n.host, e, t)
218
- })))).filter((e) => e.taken).map((e) => e.family) }), mt = (e, t, n) => [
180
+ taken: await vt(n.host, e, t)
181
+ })))).filter((e) => e.taken).map((e) => e.family) }), bt = (e, t, n) => [
219
182
  `${t}: port ${e} is already being served (${n.join(" + ")}).`,
220
183
  "",
221
184
  " Refusing to start. This is NOT a spurious check — a second listener can",
@@ -230,26 +193,26 @@ __installPublicEnv(publicEnvValues)
230
193
  "",
231
194
  " Then re-run. To use a different port instead, change `port` in",
232
195
  " app.config.ts."
233
- ].join("\n"), ht = async (e, t) => {
234
- let { families: r } = await pt(e);
235
- if (r.length !== 0) throw n(mt(e, t, r));
236
- }, gt = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", _t = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, vt = (e) => {
196
+ ].join("\n"), xt = async (e, t) => {
197
+ let { families: r } = await yt(e);
198
+ if (r.length !== 0) throw n(bt(e, t, r));
199
+ }, St = (e) => e === "effect" || e.startsWith("@effect/") || e.startsWith("@voltro/") || e === "react" || e === "react-dom", Ct = /(^|\/)(\.bin|\.cache|\.pnpm-store|dist|build)(\/|$)/, wt = (e) => {
237
200
  let t = [], n = e;
238
201
  for (let e = 0; e < 12; e++) {
239
- let e = I(n, "node_modules");
240
- B(e) && t.push(e);
241
- let r = F(n);
202
+ let e = F(n, "node_modules");
203
+ z(e) && t.push(e);
204
+ let r = P(n);
242
205
  if (r === n) break;
243
206
  n = r;
244
207
  }
245
208
  return t;
246
- }, yt = (e) => {
209
+ }, Tt = (e) => {
247
210
  let t = /* @__PURE__ */ new Set([e]), n = e;
248
211
  for (let e = 0; e < 12; e++) {
249
212
  for (let e of ["pnpm-workspace.yaml", "pnpm-workspace.yml"]) {
250
213
  let r;
251
214
  try {
252
- r = oe(I(n, e), "utf8");
215
+ r = V(F(n, e), "utf8");
253
216
  } catch {
254
217
  continue;
255
218
  }
@@ -260,38 +223,38 @@ __installPublicEnv(publicEnvValues)
260
223
  if (i === "" || i.includes("*")) continue;
261
224
  let a;
262
225
  try {
263
- a = H(I(n, i), { withFileTypes: !0 });
226
+ a = H(F(n, i), { withFileTypes: !0 });
264
227
  } catch {
265
228
  continue;
266
229
  }
267
- for (let e of a) e.isDirectory() && t.add(I(n, i, e.name));
230
+ for (let e of a) e.isDirectory() && t.add(F(n, i, e.name));
268
231
  }
269
232
  }
270
233
  for (let e of ["packages", "apps"]) {
271
234
  let r;
272
235
  try {
273
- r = H(I(n, e), { withFileTypes: !0 });
236
+ r = H(F(n, e), { withFileTypes: !0 });
274
237
  } catch {
275
238
  continue;
276
239
  }
277
- for (let i of r) i.isDirectory() && t.add(I(n, e, i.name));
240
+ for (let i of r) i.isDirectory() && t.add(F(n, e, i.name));
278
241
  }
279
- let e = F(n);
242
+ let e = P(n);
280
243
  if (e === n) break;
281
244
  n = e;
282
245
  }
283
246
  return [...t];
284
- }, bt = (e) => {
247
+ }, Et = (e) => {
285
248
  let t = [];
286
- for (let n of yt(e)) {
287
- let e = I(n, "node_modules", "@voltro"), r;
249
+ for (let n of Tt(e)) {
250
+ let e = F(n, "node_modules", "@voltro"), r;
288
251
  try {
289
252
  r = H(e);
290
253
  } catch {
291
254
  continue;
292
255
  }
293
256
  for (let n of r) {
294
- let r = I(e, n), i = xt(r);
257
+ let r = F(e, n), i = Dt(r);
295
258
  i !== void 0 && t.push({
296
259
  pkg: `@voltro/${n}`,
297
260
  version: i,
@@ -300,14 +263,14 @@ __installPublicEnv(publicEnvValues)
300
263
  }
301
264
  }
302
265
  return t;
303
- }, xt = (e) => {
266
+ }, Dt = (e) => {
304
267
  try {
305
- let t = JSON.parse(oe(I(e, "package.json"), "utf8"));
268
+ let t = JSON.parse(V(F(e, "package.json"), "utf8"));
306
269
  return typeof t.version == "string" ? t.version : void 0;
307
270
  } catch {
308
271
  return;
309
272
  }
310
- }, St = (e) => {
273
+ }, Ot = (e) => {
311
274
  let t = [], n;
312
275
  try {
313
276
  n = H(e);
@@ -315,8 +278,8 @@ __installPublicEnv(publicEnvValues)
315
278
  return t;
316
279
  }
317
280
  for (let r of n) {
318
- if (r.startsWith(".") || _t.test(r)) continue;
319
- let n = I(e, r);
281
+ if (r.startsWith(".") || Ct.test(r)) continue;
282
+ let n = F(e, r);
320
283
  if (r.startsWith("@")) {
321
284
  let e;
322
285
  try {
@@ -326,12 +289,12 @@ __installPublicEnv(publicEnvValues)
326
289
  }
327
290
  for (let i of e) t.push({
328
291
  pkg: `${r}/${i}`,
329
- dir: I(n, i)
292
+ dir: F(n, i)
330
293
  });
331
294
  continue;
332
295
  }
333
296
  try {
334
- if (!U(n).isDirectory()) continue;
297
+ if (!de(n).isDirectory()) continue;
335
298
  } catch {
336
299
  continue;
337
300
  }
@@ -341,25 +304,25 @@ __installPublicEnv(publicEnvValues)
341
304
  });
342
305
  }
343
306
  return t;
344
- }, Ct = (e) => {
307
+ }, kt = (e) => {
345
308
  let t = /* @__PURE__ */ new Map(), n = (e, n, r) => {
346
- if (!gt(e)) return;
309
+ if (!St(e)) return;
347
310
  let i = t.get(e) ?? /* @__PURE__ */ new Map();
348
311
  i.has(n) || i.set(n, r), t.set(e, i);
349
312
  };
350
- for (let t of vt(e)) for (let { pkg: e, dir: r } of St(t)) {
351
- let t = xt(r);
313
+ for (let t of wt(e)) for (let { pkg: e, dir: r } of Ot(t)) {
314
+ let t = Dt(r);
352
315
  t !== void 0 && n(e, t, r);
353
316
  }
354
- for (let { pkg: t, version: r, dir: i } of bt(e)) n(t, r, i);
317
+ for (let { pkg: t, version: r, dir: i } of Et(e)) n(t, r, i);
355
318
  let r = [];
356
319
  for (let [n, i] of t) i.size < 2 || r.push({
357
320
  pkg: n,
358
321
  versions: [...i.keys()].sort(),
359
- paths: [...i.values()].map((t) => L(e, t)).sort()
322
+ paths: [...i.values()].map((t) => I(e, t)).sort()
360
323
  });
361
324
  return r.sort((e, t) => e.pkg.localeCompare(t.pkg));
362
- }, wt = (e) => {
325
+ }, At = (e) => {
363
326
  if (e.length !== 0) return [
364
327
  `• ${e.length} package(s) resolved at more than one version:`,
365
328
  ...e.flatMap((e) => [` ${e.pkg} — ${e.versions.join(", ")}`, ...e.paths.map((e) => ` ${e}`)]),
@@ -377,11 +340,11 @@ __installPublicEnv(publicEnvValues)
377
340
  " instrument), then reinstall. Do not silence the generated file — it is where",
378
341
  " a genuine mistake in your own descriptors surfaces."
379
342
  ].join("\n");
380
- }, Tt = (e) => {
343
+ }, jt = (e) => {
381
344
  let t = /* @__PURE__ */ new Map();
382
- for (let n of vt(e)) for (let { pkg: e, dir: r } of St(n)) {
345
+ for (let n of wt(e)) for (let { pkg: e, dir: r } of Ot(n)) {
383
346
  if (!e.startsWith("@voltro/")) continue;
384
- let n = xt(r);
347
+ let n = Dt(r);
385
348
  n !== void 0 && !t.has(e) && t.set(e, n);
386
349
  }
387
350
  if (t.size < 2) return;
@@ -396,7 +359,7 @@ __installPublicEnv(publicEnvValues)
396
359
  version: t
397
360
  })).sort((e, t) => e.pkg.localeCompare(t.pkg))
398
361
  };
399
- }, Et = (e) => {
362
+ }, Mt = (e) => {
400
363
  if (e !== void 0) return [
401
364
  `• ${e.behind.length} @voltro/* package(s) are not on ${e.majority}:`,
402
365
  ...e.behind.map((e) => ` ${e.pkg} ${e.version}`),
@@ -414,59 +377,59 @@ __installPublicEnv(publicEnvValues)
414
377
  " its pattern: the one that produced this report was `@voltro/[a-z-]+`,",
415
378
  " which silently skips `@voltro/i18n` because the name contains digits."
416
379
  ].join("\n");
417
- }, Dt = (e, t) => {
418
- let n = Tt(e);
380
+ }, Nt = (e, t) => {
381
+ let n = jt(e);
419
382
  n !== void 0 && t.warn?.(`@voltro/* version skew: ${n.behind.length} package(s) are not on ${n.majority}`, {
420
383
  majority: n.majority,
421
384
  behind: n.behind.map((e) => `${e.pkg}@${e.version}`),
422
385
  fix: "the framework ships in lockstep; bump the listed packages and reinstall"
423
386
  });
424
- }, Ot = K({ scope: "vite" }), kt = /\x1b\[[0-9;]*m/g, At = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, jt = (e) => e.replace(kt, "").replace(At, "").trim(), Mt = /proxy error/i, Nt = [
387
+ }, Pt = G({ scope: "vite" }), Ft = /\x1b\[[0-9;]*m/g, It = /^\s*\[?vite\]?\s*(\([a-z-]+\)\s*)?/, Lt = (e) => e.replace(Ft, "").replace(It, "").trim(), Rt = /proxy error/i, zt = [
425
388
  "ECONNREFUSED",
426
389
  "ECONNRESET",
427
390
  "ECONNABORTED",
428
391
  "EPIPE",
429
392
  "ETIMEDOUT"
430
- ], Pt = (e, t = 0) => {
393
+ ], Bt = (e, t = 0) => {
431
394
  if (e == null || t > 5) return !1;
432
395
  let n = e;
433
- return typeof n.code == "string" && Nt.includes(n.code) || typeof n.message == "string" && Nt.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Pt(e, t + 1)) ? !0 : Pt(n.cause, t + 1);
434
- }, Ft = 4e3, It = () => {
396
+ return typeof n.code == "string" && zt.includes(n.code) || typeof n.message == "string" && zt.some((e) => n.message.includes(e)) || Array.isArray(n.errors) && n.errors.some((e) => Bt(e, t + 1)) ? !0 : Bt(n.cause, t + 1);
397
+ }, Vt = 4e3, Ht = () => {
435
398
  let e = /* @__PURE__ */ new Set(), t = 0, n = {
436
399
  hasWarned: !1,
437
400
  info: (e) => {
438
- let t = jt(e);
439
- t.length !== 0 && Ot.info(t);
401
+ let t = Lt(e);
402
+ t.length !== 0 && Pt.info(t);
440
403
  },
441
404
  warn: (e) => {
442
405
  n.hasWarned = !0;
443
- let t = jt(e);
444
- t.length !== 0 && Ot.warn(t);
406
+ let t = Lt(e);
407
+ t.length !== 0 && Pt.warn(t);
445
408
  },
446
409
  warnOnce: (t) => {
447
- let r = jt(t);
448
- e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && Ot.warn(r));
410
+ let r = Lt(t);
411
+ e.has(r) || (e.add(r), n.hasWarned = !0, r.length !== 0 && Pt.warn(r));
449
412
  },
450
413
  error: (e, n) => {
451
- let r = jt(e), i = n?.error;
414
+ let r = Lt(e), i = n?.error;
452
415
  if (r.length !== 0) {
453
- if (Mt.test(r) && Pt(i)) {
416
+ if (Rt.test(r) && Bt(i)) {
454
417
  let e = Date.now();
455
- e - t > Ft && (t = e, Ot.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
418
+ e - t > Vt && (t = e, Pt.info("waiting for api — proxy upstream not accepting connections yet (still starting?)"));
456
419
  return;
457
420
  }
458
- Ot.error(r, {}, i);
421
+ Pt.error(r, {}, i);
459
422
  }
460
423
  },
461
424
  clearScreen: () => {},
462
425
  hasErrorLogged: (e) => !1
463
426
  };
464
427
  return n;
465
- }, Lt = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Rt = (e) => {
428
+ }, Ut = (e) => e.replace(/\\"|"(?:[^"\\]|\\.)*"|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)/g, (e, t) => t ? "" : e), Wt = (e) => {
466
429
  try {
467
- let t = I(e, "tsconfig.json");
468
- if (!B(t)) return [];
469
- let n = JSON.parse(Lt(oe(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = n.baseUrl ?? ".", a = R(e, i), o = [];
430
+ let t = F(e, "tsconfig.json");
431
+ if (!z(t)) return [];
432
+ let n = JSON.parse(Ut(V(t, "utf8"))).compilerOptions ?? {}, r = n.paths ?? {}, i = n.baseUrl ?? ".", a = L(e, i), o = [];
470
433
  for (let [e, t] of Object.entries(r)) {
471
434
  let n = t[0];
472
435
  if (!n) continue;
@@ -476,11 +439,11 @@ __installPublicEnv(publicEnvValues)
476
439
  let t = e.slice(0, -2).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
477
440
  o.push({
478
441
  find: RegExp(`^${t}/(.*)$`),
479
- replacement: `${I(a, n.slice(0, -2))}/$1`
442
+ replacement: `${F(a, n.slice(0, -2))}/$1`
480
443
  });
481
444
  } else o.push({
482
445
  find: e,
483
- replacement: I(a, n)
446
+ replacement: F(a, n)
484
447
  });
485
448
  }
486
449
  }
@@ -488,12 +451,12 @@ __installPublicEnv(publicEnvValues)
488
451
  } catch {
489
452
  return [];
490
453
  }
491
- }, zt = (e = process.env) => {
454
+ }, Gt = (e = process.env) => {
492
455
  let t = e.VOLTRO_DEV_SSR_COMPILE_CONCURRENCY;
493
456
  if (t === void 0 || t.trim() === "") return 4;
494
457
  let n = Number(t);
495
458
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 4;
496
- }, Bt = (e) => {
459
+ }, Kt = (e) => {
497
460
  let t = Math.max(1, Math.floor(e)), n = 0, r = [], i = () => n < t ? (n++, Promise.resolve()) : new Promise((e) => r.push(e)), a = () => {
498
461
  let e = r.shift();
499
462
  e ? e() : n--;
@@ -511,8 +474,8 @@ __installPublicEnv(publicEnvValues)
511
474
  return n;
512
475
  }
513
476
  };
514
- }, Vt = (e) => {
515
- let t = Bt(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
477
+ }, qt = (e) => {
478
+ let t = Kt(e.limit), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
516
479
  return {
517
480
  load: (i, a) => {
518
481
  if (r.has(i)) return a();
@@ -542,19 +505,23 @@ __installPublicEnv(publicEnvValues)
542
505
  return r.size;
543
506
  }
544
507
  };
545
- }, Ht = 1048576, Ut = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), Wt = (e) => JSON.stringify(e).replace(/</g, "\\u003c"), Gt = (e, t) => {
546
- let n = `<script type="application/json" id="${Pe}">${Wt(t)}<\/script>`;
508
+ }, Jt = 1048576, Yt = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), Xt = (e) => JSON.stringify(e).replace(/</g, "\\u003c"), Zt = (e, t) => {
509
+ let n = `<script type="application/json" id="${Be}">${Xt(t)}<\/script>`;
547
510
  return e.includes("</body>") ? e.replace("</body>", `${n}</body>`) : e + n;
548
- }, Kt = (e) => {
549
- let t = Object.entries(e.errors).map(([e, t]) => `<li><strong>${Ut(e)}</strong>: ${Ut(t)}</li>`).join("");
550
- return `<!doctype html><html><head><meta charset="utf-8"><title>Form submission failed</title></head><body><h1>Submission failed</h1>${e.formError === void 0 ? "" : `<p>${Ut(e.formError)}</p>`}<ul>${t}</ul><p><a href="javascript:history.back()">Go back</a> to correct the form.</p></body></html>`;
511
+ }, Qt = (e) => {
512
+ let t = Object.entries(e.errors).map(([e, t]) => `<li><strong>${Yt(e)}</strong>: ${Yt(t)}</li>`).join("");
513
+ return `<!doctype html><html><head><meta charset="utf-8"><title>Form submission failed</title></head><body><h1>Submission failed</h1>${e.formError === void 0 ? "" : `<p>${Yt(e.formError)}</p>`}<ul>${t}</ul><p><a href="javascript:history.back()">Go back</a> to correct the form.</p></body></html>`;
551
514
  }, X = (e, t, n, r = "text/plain; charset=utf-8") => {
552
515
  e.statusCode = t, e.setHeader("content-type", r), e.end(n);
553
- }, qt = (e, t, n) => {
516
+ }, $t = (e, t, n) => {
554
517
  e.setHeader("cache-control", "no-store"), X(e, t, n, "text/html; charset=utf-8");
555
- }, Jt = (e) => {
518
+ }, en = (e) => {
556
519
  if (e !== void 0 && e !== "" && !(!e.startsWith("/") || e.startsWith("//") || e.includes("\\"))) return e;
557
- }, Yt = (e) => {
520
+ }, tn = (e, t) => {
521
+ if (e === void 0 || t === void 0 || t.length === 0) return;
522
+ let n = e.replace(/^\/+/, "").split(/[/?#]/)[0];
523
+ if (n !== void 0 && n !== "") return t.includes(n) ? n : void 0;
524
+ }, nn = (e) => {
558
525
  let t = e.referer;
559
526
  if (t !== void 0) try {
560
527
  let e = new URL(t);
@@ -562,10 +529,10 @@ __installPublicEnv(publicEnvValues)
562
529
  } catch {
563
530
  return;
564
531
  }
565
- }, Xt = (e) => new Promise((t) => {
532
+ }, rn = (e) => new Promise((t) => {
566
533
  let n = [], r = 0;
567
534
  e.on("data", (i) => {
568
- if (r += i.length, r > Ht) {
535
+ if (r += i.length, r > Jt) {
569
536
  e.removeAllListeners("data"), e.removeAllListeners("end"), t({ ok: !1 });
570
537
  return;
571
538
  }
@@ -574,32 +541,32 @@ __installPublicEnv(publicEnvValues)
574
541
  ok: !0,
575
542
  body: Buffer.concat(n).toString("utf8")
576
543
  })), e.on("error", () => t({ ok: !1 }));
577
- }), Zt = (e) => {
544
+ }), an = (e) => {
578
545
  let t = {};
579
546
  for (let [n, r] of Object.entries(e.headers)) typeof r == "string" ? t[n.toLowerCase()] = r : Array.isArray(r) && (t[n.toLowerCase()] = r.join(", "));
580
547
  return t;
581
- }, Qt = (e) => {
582
- let t = e.originGuard ?? pe(void 0, process.env);
548
+ }, on = (e) => {
549
+ let t = e.originGuard ?? Se(void 0, process.env);
583
550
  return async (n, r, i) => {
584
551
  let a = (n.url ?? "/").split("?")[0];
585
- if (!a.startsWith(Ie)) return !1;
552
+ if (!a.startsWith(He)) return !1;
586
553
  if (n.method !== "POST") return r.setHeader("allow", "POST"), X(r, 405, "method not allowed — a /form/* endpoint accepts native form POSTs only"), !0;
587
- let o = Zt(n);
588
- if (!de({
554
+ let o = an(n);
555
+ if (!be({
589
556
  headers: o,
590
557
  config: t
591
558
  }).allowed) return X(r, 403, "origin not allowed"), !0;
592
559
  if ((o["content-type"] ?? "").includes("multipart/form-data")) return X(r, 415, "file uploads need JavaScript — the no-JS form path accepts application/x-www-form-urlencoded only"), !0;
593
- let s = await Xt(n);
594
- if (!s.ok) return X(r, 413, `form body exceeds ${Ht} bytes`), !0;
595
- let c = new URLSearchParams(s.body), l = decodeURIComponent(a.slice(Ie.length)), u = (await e.loadDescriptors())?.[l];
560
+ let s = await rn(n);
561
+ if (!s.ok) return X(r, 413, `form body exceeds ${Jt} bytes`), !0;
562
+ let c = new URLSearchParams(s.body), l = decodeURIComponent(a.slice(He.length)), u = (await e.loadDescriptors())?.[l];
596
563
  if (u === void 0 || u.kind !== "mutation") return X(r, 404, `no mutation '${l}' — /form/* serves declared mutations only`), !0;
597
- let d = c.get(Fe) ?? l, f = Jt(c.get(Re) ?? void 0), p = [];
598
- for (let [e, t] of c) e !== Fe && e !== Re && p.push([e, t]);
564
+ let d = c.get(Ve) ?? l, f = en(c.get(We) ?? void 0), p = [];
565
+ for (let [e, t] of c) e !== Ve && e !== We && p.push([e, t]);
599
566
  let m = u.input;
600
567
  if (m === void 0) return X(r, 404, `mutation '${l}' carries no input schema — the no-JS path cannot map its POST`), !0;
601
- let h = ze(m, p), g = Y(m, h), _ = async (t) => {
602
- let n = Yt(o);
568
+ let h = Ge(m, p), g = Ke(m, h, { locale: await e.resolveLocale(o, nn(o)) }), _ = async (t) => {
569
+ let n = nn(o);
603
570
  if (n !== void 0) {
604
571
  if (i !== void 0) {
605
572
  i(n, t);
@@ -611,11 +578,11 @@ __installPublicEnv(publicEnvValues)
611
578
  flash: t
612
579
  });
613
580
  if (a !== void 0) {
614
- qt(r, 422, Gt(a, t));
581
+ $t(r, 422, Zt(a, t));
615
582
  return;
616
583
  }
617
584
  }
618
- qt(r, 422, Kt(t));
585
+ $t(r, 422, Qt(t));
619
586
  };
620
587
  if (!g.valid) return await _({
621
588
  formKey: d,
@@ -635,10 +602,10 @@ __installPublicEnv(publicEnvValues)
635
602
  formError: t?.message ?? t?._tag ?? "The server rejected this submission. Please try again."
636
603
  }), !0;
637
604
  }
638
- let y = f ?? Yt(o) ?? "/";
605
+ let y = f ?? nn(o) ?? "/";
639
606
  return r.statusCode = 303, r.setHeader("location", y), r.end(), !0;
640
607
  };
641
- }, $t = /^\s*(?:import|export)\s[^;'"]*?['"]([^'"]+)['"]/gm, en = [
608
+ }, sn = /^\s*(?:import|export)\s[^;'"]*?['"]([^'"]+)['"]/gm, cn = [
642
609
  "",
643
610
  ".tsx",
644
611
  ".ts",
@@ -646,87 +613,87 @@ __installPublicEnv(publicEnvValues)
646
613
  ".js",
647
614
  "/index.tsx",
648
615
  "/index.ts"
649
- ], tn = (e) => /\.island\.(tsx|ts|jsx|js)$/.test(e), nn = ["@voltro/web", "@voltro/i18n"], rn = ["@voltro/client", "@voltro/ui"], an = (e, t) => e === t || e.startsWith(`${t}/`), on = (e) => e !== "@voltro/web/islands" && nn.some((t) => an(e, t)), sn = (e) => {
616
+ ], ln = (e) => /\.island\.(tsx|ts|jsx|js)$/.test(e), un = ["@voltro/web", "@voltro/i18n"], dn = ["@voltro/client", "@voltro/ui"], fn = (e, t) => e === t || e.startsWith(`${t}/`), pn = (e) => e !== "@voltro/web/islands" && un.some((t) => fn(e, t)), mn = (e) => {
650
617
  let t = [];
651
- for (let n of e.matchAll($t)) t.push(n[1]);
618
+ for (let n of e.matchAll(sn)) t.push(n[1]);
652
619
  return t;
653
- }, cn = async (e, t) => {
654
- let n = R(F(e), t);
655
- for (let e of en) {
620
+ }, hn = async (e, t) => {
621
+ let n = L(P(e), t);
622
+ for (let e of cn) {
656
623
  let t = n + e;
657
624
  try {
658
- if ((await V.stat(t)).isFile()) return t;
625
+ if ((await B.stat(t)).isFile()) return t;
659
626
  } catch {}
660
627
  }
661
- }, ln = async (e, t) => {
662
- let n = I(e, "src", "pages", t), r = /* @__PURE__ */ new Set(), i = [], a = !1, o = [], s = async (t, n) => {
628
+ }, gn = async (e, t) => {
629
+ let n = F(e, "src", "pages", t), r = /* @__PURE__ */ new Set(), i = [], a = !1, o = [], s = async (t, n) => {
663
630
  let c = `${t}\u0000${n ? "i" : "p"}`;
664
631
  if (r.has(c)) return;
665
632
  r.add(c);
666
633
  let l;
667
634
  try {
668
- l = await V.readFile(t, "utf8");
635
+ l = await B.readFile(t, "utf8");
669
636
  } catch {
670
637
  return;
671
638
  }
672
- for (let r of sn(l)) {
639
+ for (let r of mn(l)) {
673
640
  if (n) {
674
- if (on(r)) {
675
- o.push([L(e, t).split(z).join("/"), r]);
641
+ if (pn(r)) {
642
+ o.push([I(e, t).split(R).join("/"), r]);
676
643
  continue;
677
644
  }
678
- if (rn.some((e) => an(r, e))) {
645
+ if (dn.some((e) => fn(r, e))) {
679
646
  a = !0;
680
647
  continue;
681
648
  }
682
649
  }
683
650
  if (!r.startsWith(".")) continue;
684
- let c = await cn(t, r);
651
+ let c = await hn(t, r);
685
652
  if (c === void 0) continue;
686
- let l = n || tn(c);
687
- if (!n && tn(c)) {
688
- let t = L(e, c).split(z).join("/");
653
+ let l = n || ln(c);
654
+ if (!n && ln(c)) {
655
+ let t = I(e, c).split(R).join("/");
689
656
  i.includes(t) || i.push(t);
690
657
  }
691
658
  await s(c, l);
692
659
  }
693
660
  };
694
- return await s(n, tn(n)), tn(n) && i.unshift(L(e, n).split(z).join("/")), {
661
+ return await s(n, ln(n)), ln(n) && i.unshift(I(e, n).split(R).join("/")), {
695
662
  islandFiles: i,
696
663
  usesClient: a,
697
664
  violations: o
698
665
  };
699
- }, un = (e) => {
666
+ }, _n = (e) => {
700
667
  let t = /^export const interactive\s*=\s*['"](full|islands|none)['"]/m.exec(e);
701
668
  return t === null ? void 0 : t[1];
702
- }, dn = (e) => {
669
+ }, vn = (e) => {
703
670
  let t = e.indexOf("</head>"), n = t === -1 ? e : e.slice(0, t), r = [];
704
671
  for (let e of n.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)) {
705
672
  let t = e[1] ?? "";
706
673
  /\bsrc\s*=/.test(t) || /type\s*=\s*["']module["']/.test(t) || r.push(e[0]);
707
674
  }
708
675
  return r.map((e) => ` ${e}`).join("\n");
709
- }, fn = (e) => [...e.matchAll(/<link\b[^>]*\brel\s*=\s*["']stylesheet["'][^>]*>/gi)].map((e) => e[0]), pn = (e, t) => {
710
- let n = fn(t).filter((t) => !e.includes(t));
676
+ }, yn = (e) => [...e.matchAll(/<link\b[^>]*\brel\s*=\s*["']stylesheet["'][^>]*>/gi)].map((e) => e[0]), bn = (e, t) => {
677
+ let n = yn(t).filter((t) => !e.includes(t));
711
678
  if (n.length === 0) return e;
712
679
  let r = n.map((e) => ` ${e}`).join("\n");
713
680
  return e.includes("</head>") ? e.replace("</head>", `${r}\n </head>`) : e + r;
714
- }, mn = (e) => {
681
+ }, xn = (e) => {
715
682
  let t = e.replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "");
716
683
  return t === "" ? "root" : t;
717
- }, hn = class extends Error {
684
+ }, Sn = class extends Error {
718
685
  constructor(e, t) {
719
686
  let n = t.map(([e, t]) => ` ${e} imports '${t}'`).join("\n");
720
687
  super(`interactive: 'islands' page '${e}' has island code importing the framework barrel:\n${n}\n\nAn island hydrates in its own provider-less root — router hooks, <Link> and useT() throw there, and the '@voltro/web' barrel additionally pulls the Effect runtime into the slim islands entry (the bytes this mode exists to shed).\n\nFix: import island()/hydration APIs from '@voltro/web/islands' (the react-only subpath), move router/i18n-dependent UI out of the island, and keep island files to react + relative browser-safe imports. '@voltro/client' IS allowed — a useSubscription island gets the client boot automatically.`), this.name = "IslandsEntryViolation";
721
688
  }
722
- }, gn = async (e) => {
723
- let t = I(e.webRoot, ".framework", "island-shells"), n = [];
689
+ }, Cn = async (e) => {
690
+ let t = F(e.webRoot, ".framework", "island-shells"), n = [];
724
691
  if (e.pages.length === 0) return n;
725
- await V.mkdir(t, { recursive: !0 });
692
+ await B.mkdir(t, { recursive: !0 });
726
693
  for (let r of e.pages) {
727
- let i = await ln(e.webRoot, r.file);
728
- if (i.violations.length > 0) throw new hn(r.pattern, i.violations);
729
- let a = mn(r.pattern), o = `island-shells/${a}.tsx`, s = `island-shells/${a}.html`, c = i.islandFiles.map((e) => `import '../../${e}'`).join("\n"), l = i.usesClient ? [
694
+ let i = await gn(e.webRoot, r.file);
695
+ if (i.violations.length > 0) throw new Sn(r.pattern, i.violations);
696
+ let a = xn(r.pattern), o = `island-shells/${a}.tsx`, s = `island-shells/${a}.html`, c = i.islandFiles.map((e) => `import '../../${e}'`).join("\n"), l = i.usesClient ? [
730
697
  `// GENERATED by voltro — the islands entry for '${r.pattern}' (client boot:`,
731
698
  "// an island here imports @voltro/client, so the roots get a live runtime).",
732
699
  ...e.apiImports ?? [],
@@ -762,7 +729,7 @@ __installPublicEnv(publicEnvValues)
762
729
  "</html>",
763
730
  ""
764
731
  ].join("\n");
765
- await V.writeFile(I(t, `${a}.tsx`), l), await V.writeFile(I(t, `${a}.html`), u), n.push({
732
+ await B.writeFile(F(t, `${a}.tsx`), l), await B.writeFile(F(t, `${a}.html`), u), n.push({
766
733
  pattern: r.pattern,
767
734
  name: a,
768
735
  htmlFile: s,
@@ -771,13 +738,13 @@ __installPublicEnv(publicEnvValues)
771
738
  });
772
739
  }
773
740
  return n;
774
- }, _n = K({ scope: "voltro:images" }), vn = /[?&]image(?:&|$)/, yn = /\.(png|jpe?g|webp|avif)(\?|$)/i, bn = {
741
+ }, wn = G({ scope: "voltro:images" }), Tn = /[?&]image(?:&|$)/, En = /\.(png|jpe?g|webp|avif)(\?|$)/i, Dn = {
775
742
  avif: "image/avif",
776
743
  webp: "image/webp",
777
744
  jpeg: "image/jpeg",
778
745
  png: "image/png"
779
- }, xn = (e) => Oe("sha256").update(e).digest("hex").slice(0, 12), Sn = (e) => `export default ${JSON.stringify(e)}\n`, Cn = (e) => {
780
- let t = e.config ?? j, n = x(e.root), r = /* @__PURE__ */ new Map(), i = "/", a = !1;
746
+ }, On = (e) => J("sha256").update(e).digest("hex").slice(0, 12), kn = (e) => `export default ${JSON.stringify(e)}\n`, An = (e) => {
747
+ let t = e.config ?? j, n = C(e.root), r = /* @__PURE__ */ new Map(), i = "/", a = !1;
781
748
  return {
782
749
  name: "voltro:image-assets",
783
750
  enforce: "pre",
@@ -785,20 +752,20 @@ __installPublicEnv(publicEnvValues)
785
752
  i = e.base, a = e.command === "build";
786
753
  },
787
754
  async load(o) {
788
- if (!vn.test(o) || !yn.test(o)) return null;
789
- let s = o.split("?")[0], c = s, l = await E(c);
790
- if (l === null && s.startsWith("/") && (c = I(e.root, s.slice(1)), l = await E(c)), l === null && this.error(`?image import points at a file that does not exist or is unreadable: ${s}`), await S() === null) {
791
- w(_n);
755
+ if (!Tn.test(o) || !En.test(o)) return null;
756
+ let s = o.split("?")[0], c = s, l = await O(c);
757
+ if (l === null && s.startsWith("/") && (c = F(e.root, s.slice(1)), l = await O(c)), l === null && this.error(`?image import points at a file that does not exist or is unreadable: ${s}`), await w() === null) {
758
+ E(wn);
792
759
  let t;
793
760
  if (a || e.urlMode === "build-urls") {
794
- let e = `assets/${xn(c)}${c.slice(c.lastIndexOf("."))}`;
761
+ let e = `assets/${On(c)}${c.slice(c.lastIndexOf("."))}`;
795
762
  a && this.emitFile({
796
763
  type: "asset",
797
764
  fileName: e,
798
765
  source: Buffer.from(l)
799
766
  }), t = `${i}${e}`;
800
767
  } else t = `/@fs${c}`;
801
- return Sn({
768
+ return kn({
802
769
  src: t,
803
770
  width: 0,
804
771
  height: 0,
@@ -808,7 +775,7 @@ __installPublicEnv(publicEnvValues)
808
775
  });
809
776
  }
810
777
  if (a || e.urlMode === "build-urls") {
811
- let e = await T({
778
+ let e = await D({
812
779
  sourceBytes: l,
813
780
  cacheDir: n,
814
781
  config: t
@@ -824,31 +791,31 @@ __installPublicEnv(publicEnvValues)
824
791
  }), r.set(`${t.format}:${t.width}`, `${i}${n}`);
825
792
  }
826
793
  let o = (t) => e.widths.map((e) => `${r.get(`${t}:${e}`)} ${e}w`).join(", ");
827
- return Sn({
794
+ return kn({
828
795
  src: r.get(`${e.fallbackFormat}:${e.widths[e.widths.length - 1]}`),
829
796
  width: e.width,
830
797
  height: e.height,
831
798
  blurDataURL: e.blurDataURL,
832
799
  srcSet: o(e.fallbackFormat),
833
800
  sources: t.formats.map((e) => ({
834
- type: bn[e],
801
+ type: Dn[e],
835
802
  srcSet: o(e)
836
803
  }))
837
804
  });
838
805
  }
839
806
  let u = await A(l);
840
807
  u === null && this.error(`?image import is not a raster image sharp can read: ${c}`);
841
- let d = Oe("sha256").update(l).digest("hex").slice(0, 16), f = await k(l, d, n), p = xn(c);
808
+ let d = J("sha256").update(l).digest("hex").slice(0, 16), f = await te(l, d, n), p = On(c);
842
809
  r.set(p, c);
843
- let m = O(u.width), h = u.format === "png" ? "png" : "jpeg", g = (e, t) => `/_voltro/image/${p}?w=${e}&f=${t}`, _ = (e) => m.map((t) => `${g(t, e)} ${t}w`).join(", ");
844
- return Sn({
810
+ let m = k(u.width), h = u.format === "png" ? "png" : "jpeg", g = (e, t) => `/_voltro/image/${p}?w=${e}&f=${t}`, _ = (e) => m.map((t) => `${g(t, e)} ${t}w`).join(", ");
811
+ return kn({
845
812
  src: g(m[m.length - 1], h),
846
813
  width: u.width,
847
814
  height: u.height,
848
815
  blurDataURL: f ?? "",
849
816
  srcSet: _(h),
850
817
  sources: t.formats.map((e) => ({
851
- type: bn[e],
818
+ type: Dn[e],
852
819
  srcSet: _(e)
853
820
  }))
854
821
  });
@@ -862,16 +829,16 @@ __installPublicEnv(publicEnvValues)
862
829
  return;
863
830
  }
864
831
  let c = Number(a.searchParams.get("w")), l = a.searchParams.get("f") ?? "";
865
- if (!Number.isInteger(c) || c <= 0 || c > 8192 || bn[l] === void 0) {
832
+ if (!Number.isInteger(c) || c <= 0 || c > 8192 || Dn[l] === void 0) {
866
833
  i.statusCode = 400, i.end("bad transform params");
867
834
  return;
868
835
  }
869
- let u = await E(s);
836
+ let u = await O(s);
870
837
  if (u === null) {
871
838
  i.statusCode = 404, i.end("source asset gone");
872
839
  return;
873
840
  }
874
- let d = Oe("sha256").update(u).digest("hex").slice(0, 16), f = await C({
841
+ let d = J("sha256").update(u).digest("hex").slice(0, 16), f = await T({
875
842
  sourceBytes: u,
876
843
  sourceHash: d,
877
844
  width: c,
@@ -880,99 +847,139 @@ __installPublicEnv(publicEnvValues)
880
847
  cacheDir: n
881
848
  });
882
849
  if (f === null) {
883
- w(_n), i.statusCode = 200, i.setHeader("content-type", bn[l] ?? "application/octet-stream"), i.end(Buffer.from(u));
850
+ E(wn), i.statusCode = 200, i.setHeader("content-type", Dn[l] ?? "application/octet-stream"), i.end(Buffer.from(u));
884
851
  return;
885
852
  }
886
- i.statusCode = 200, i.setHeader("content-type", bn[l]), i.setHeader("cache-control", "max-age=31536000, immutable"), i.end(Buffer.from(f));
853
+ i.statusCode = 200, i.setHeader("content-type", Dn[l]), i.setHeader("cache-control", "max-age=31536000, immutable"), i.end(Buffer.from(f));
887
854
  })().catch((e) => {
888
- _n.warn("image transform failed", {}, e), a();
855
+ wn.warn("image transform failed", {}, e), a();
889
856
  });
890
857
  });
891
858
  }
892
859
  };
893
- }, wn = K({ scope: "voltro:fonts" }), Tn = /* @__PURE__ */ new Map(), En = async (e, t) => {
860
+ }, jn = G({ scope: "voltro:fonts" }), Mn = /* @__PURE__ */ new Map(), Nn = async (e, t) => {
894
861
  if (t === void 0 || t.length === 0) return null;
895
- let n = Tn.get(e);
896
- return n === void 0 && (n = N(t, async (t) => new Uint8Array(await De(I(e, t)))).then((e) => {
897
- for (let t of e.warnings) M(t, wn);
862
+ let n = Mn.get(e);
863
+ return n === void 0 && (n = M(t, async (t) => new Uint8Array(await Fe(F(e, t)))).then((e) => {
864
+ for (let t of e.warnings) ne(t, jn);
898
865
  return e;
899
- }), Tn.set(e, n)), n;
900
- }, Dn = {
866
+ }), Mn.set(e, n)), n;
867
+ }, Pn = {
901
868
  woff2: "font/woff2",
902
869
  woff: "font/woff",
903
870
  otf: "font/otf",
904
871
  ttf: "font/ttf"
905
- }, On = (e, t) => ({
872
+ }, Fn = (e, t) => ({
906
873
  name: "voltro:font-assets",
907
874
  configureServer(n) {
908
875
  n.middlewares.use("/assets/fonts", (n, r, i) => {
909
876
  (async () => {
910
- let a = await En(e, t), o = (n.url ?? "/").replace(/^\//, "").split("?")[0], s = a?.files.find((e) => e.fileName === `assets/fonts/${o}`);
877
+ let a = await Nn(e, t), o = (n.url ?? "/").replace(/^\//, "").split("?")[0], s = a?.files.find((e) => e.fileName === `assets/fonts/${o}`);
911
878
  if (s === void 0) {
912
879
  i();
913
880
  return;
914
881
  }
915
882
  let c = o.slice(o.lastIndexOf(".") + 1);
916
- r.statusCode = 200, r.setHeader("content-type", Dn[c] ?? "application/octet-stream"), r.setHeader("cache-control", "max-age=31536000, immutable"), r.end(Buffer.from(s.bytes));
883
+ r.statusCode = 200, r.setHeader("content-type", Pn[c] ?? "application/octet-stream"), r.setHeader("cache-control", "max-age=31536000, immutable"), r.end(Buffer.from(s.bytes));
917
884
  })().catch(() => i());
918
885
  });
919
886
  }
920
- }), kn = K({ scope: "voltro:content" }), An = (e) => {
921
- Ke(e);
922
- }, jn = async (e, t) => {
923
- let n = await He(e.collection, e.locale === void 0 ? {} : { locale: e.locale });
924
- return Be(n, {
887
+ }), In = G({ scope: "voltro:content" }), Ln = (e) => {
888
+ et(e);
889
+ }, Rn = (e, t) => `/assets/content-media/${e}${t}`, zn = "assets/content-media", Bn = (e) => {
890
+ let t = /* @__PURE__ */ new Map(), n = [];
891
+ return $e(({ src: r, entryFile: i }) => {
892
+ let [a = "", o = ""] = Wn(r), s = L(P(i), decodeURIComponent(a)), c = t.get(s);
893
+ if (c !== void 0) return c + o;
894
+ if (!z(s)) {
895
+ let e = I(process.cwd(), s);
896
+ return n.includes(e) || n.push(e), r;
897
+ }
898
+ let l = V(s), u = J("sha256").update(l).digest("hex").slice(0, 16), d = le(s).toLowerCase(), f = Rn(u, d), p = F(e, zn, `${u}${d}`);
899
+ return ue(P(p), { recursive: !0 }), pe(p, l), t.set(s, f), f + o;
900
+ }), { missing: n };
901
+ }, Vn = () => {
902
+ $e(({ src: e, entryFile: t }) => {
903
+ let [n = "", r = ""] = Wn(e), i = L(P(t), decodeURIComponent(n));
904
+ if (!z(i)) return e;
905
+ let a = V(i), o = J("sha256").update(a).digest("hex").slice(0, 16);
906
+ return Hn.set(o, i), Rn(o, le(i).toLowerCase()) + r;
907
+ });
908
+ }, Hn = /* @__PURE__ */ new Map(), Un = (e) => {
909
+ let t = /^\/assets\/content-media\/([0-9a-f]{16})(\.[a-z0-9]+)$/i.exec(e);
910
+ if (t === null) return null;
911
+ let n = Hn.get(t[1].toLowerCase());
912
+ return n === void 0 || !z(n) ? null : {
913
+ bytes: V(n),
914
+ contentType: Kn(t[2])
915
+ };
916
+ }, Wn = (e) => {
917
+ let t = e.search(/[?#]/);
918
+ return t === -1 ? [e, ""] : [e.slice(0, t), e.slice(t)];
919
+ }, Gn = {
920
+ ".png": "image/png",
921
+ ".jpg": "image/jpeg",
922
+ ".jpeg": "image/jpeg",
923
+ ".gif": "image/gif",
924
+ ".svg": "image/svg+xml",
925
+ ".webp": "image/webp",
926
+ ".avif": "image/avif",
927
+ ".ico": "image/x-icon"
928
+ }, Kn = (e) => Gn[e.toLowerCase()] ?? "application/octet-stream", qn = async (e, t) => {
929
+ let n = await Ye(e.collection, e.locale === void 0 ? {} : { locale: e.locale });
930
+ return qe(n, {
925
931
  title: e.title,
926
932
  siteUrl: t,
927
933
  ...e.description === void 0 ? {} : { description: e.description },
928
934
  feedPath: e.path,
929
935
  item: e.item
930
936
  });
931
- }, Mn = async (e, t, n) => {
937
+ }, Jn = async (e, t, n) => {
932
938
  if (t.length !== 0) {
933
939
  if (n === void 0 || n === "") throw Error("config.feeds needs seo.siteUrl — RSS links must be absolute. Set seo: { siteUrl } in app.config.ts.");
934
940
  for (let r of t) {
935
- let t = await jn(r, n), i = I(e, r.path.replace(/^\/+/, ""));
936
- await Ee(F(i), { recursive: !0 }), await J(i, t), kn.info(`feed: ${r.path} (${r.collection})`);
941
+ let t = await qn(r, n), i = F(e, r.path.replace(/^\/+/, ""));
942
+ await K(P(i), { recursive: !0 }), await q(i, t), In.info(`feed: ${r.path} (${r.collection})`);
937
943
  }
938
944
  }
939
- }, Nn = async (e, t) => {
940
- let n = await He(e, t === void 0 ? {} : { locale: t });
945
+ }, Yn = async (e, t) => {
946
+ let n = await Ye(e, t === void 0 ? {} : { locale: t });
941
947
  return JSON.stringify(n.map(({ html: e, body: t, headings: n, ...r }) => r));
942
- }, Pn = async (e, t, n) => {
943
- let r = await Ue(e, t, n === void 0 ? {} : { locale: n });
948
+ }, Xn = async (e, t, n) => {
949
+ let r = await Xe(e, t, n === void 0 ? {} : { locale: n });
944
950
  if (r === null) return null;
945
951
  let { body: i, ...a } = r;
946
952
  return JSON.stringify(a);
947
- }, Fn = async (e) => {
948
- await qe();
949
- let t = 0;
950
- for (let n of Ge()) {
951
- let r = n.i18n?.locales ?? [void 0];
953
+ }, Zn = async (e) => {
954
+ await tt();
955
+ let t = Bn(e), n = 0;
956
+ for (let t of Qe()) {
957
+ let r = t.i18n?.locales ?? [void 0];
952
958
  for (let i of r) {
953
- let r = await Nn(n.name, i), a = I(e, Ve(n.name, i));
954
- await Ee(F(a), { recursive: !0 }), await J(a, r), t += 1;
959
+ let r = await Yn(t.name, i), a = F(e, Je(t.name, i));
960
+ await K(P(a), { recursive: !0 }), await q(a, r), n += 1;
955
961
  let o = JSON.parse(r);
956
962
  for (let { slug: r } of o) {
957
- let a = await Pn(n.name, r, i);
963
+ let a = await Xn(t.name, r, i);
958
964
  if (a === null) continue;
959
- let o = I(e, Ve(n.name, i, r));
960
- await Ee(F(o), { recursive: !0 }), await J(o, a), t += 1;
965
+ let o = F(e, Je(t.name, i, r));
966
+ await K(P(o), { recursive: !0 }), await q(o, a), n += 1;
961
967
  }
962
968
  }
963
969
  }
964
- return t > 0 && kn.info(`content: ${t} artifact(s) into dist/assets/content`), t;
965
- }, In = async (e) => {
970
+ if (t.missing.length > 0) throw Error(`content: ${t.missing.length} image reference(s) in markdown point at files that do not exist:\n` + t.missing.map((e) => ` - ${e}`).join("\n") + "\n\nA relative image is resolved against the markdown file that references it. Fix the path, or use an absolute `/…` src for an asset you serve yourself.");
971
+ return n > 0 && In.info(`content: ${n} artifact(s) into dist/assets/content`), n;
972
+ }, Qn = async (e) => {
966
973
  let t = /^\/assets\/content\/([A-Za-z0-9_-]+)(?:\.([A-Za-z0-9-]+))?\/(.+)$/.exec(e);
967
974
  if (t === null) return null;
968
975
  let [, n, r, i] = t;
969
- if (Ge().every((e) => e.name !== n)) return null;
976
+ if (Qe().every((e) => e.name !== n)) return null;
970
977
  try {
971
978
  if (i === "index.json") return {
972
979
  status: 200,
973
- body: await Nn(n, r)
980
+ body: await Yn(n, r)
974
981
  };
975
- let e = await Pn(n, i.replace(/\.json$/, ""), r);
982
+ let e = await Xn(n, i.replace(/\.json$/, ""), r);
976
983
  return e === null ? {
977
984
  status: 404,
978
985
  body: "\"not found\""
@@ -981,12 +988,12 @@ __installPublicEnv(publicEnvValues)
981
988
  body: e
982
989
  };
983
990
  } catch (t) {
984
- return kn.warn("content request failed", { pathname: e }, t), {
991
+ return In.warn("content request failed", { pathname: e }, t), {
985
992
  status: 500,
986
993
  body: "\"content error\""
987
994
  };
988
995
  }
989
- }, Ln = async (e) => {
996
+ }, $n = async (e) => {
990
997
  let { readdir: t } = await import("node:fs/promises"), n = [], r;
991
998
  try {
992
999
  r = await t(e, { withFileTypes: !0 });
@@ -995,36 +1002,44 @@ __installPublicEnv(publicEnvValues)
995
1002
  }
996
1003
  for (let t of r) {
997
1004
  if (t.name.startsWith(".") || t.name === "node_modules") continue;
998
- let r = I(e, t.name);
999
- t.isDirectory() ? n.push(...await Ln(r)) : /\.collection\.tsx?$/.test(t.name) && n.push(r);
1005
+ let r = F(e, t.name);
1006
+ t.isDirectory() ? n.push(...await $n(r)) : /\.collection\.tsx?$/.test(t.name) && n.push(r);
1000
1007
  }
1001
1008
  return n;
1002
- }, Rn = (e, t = [], n) => ({
1009
+ }, er = (e, t = [], n) => ({
1003
1010
  name: "voltro:content",
1004
1011
  configureServer(r) {
1012
+ Vn(), r.middlewares.use("/assets/content-media", (e, t, n) => {
1013
+ let r = Un(`/assets/content-media${(e.url ?? "/").split("?")[0]}`);
1014
+ if (r === null) {
1015
+ n();
1016
+ return;
1017
+ }
1018
+ t.setHeader("content-type", r.contentType), t.end(r.bytes);
1019
+ });
1005
1020
  let i = null, a = () => (i ??= (async () => {
1006
- for (let t of await Ln(I(e, "src"))) try {
1021
+ for (let t of await $n(F(e, "src"))) try {
1007
1022
  await r.ssrLoadModule(t);
1008
1023
  } catch (e) {
1009
- kn.warn("failed to load collection module", { file: t }, e);
1024
+ In.warn("failed to load collection module", { file: t }, e);
1010
1025
  }
1011
1026
  })(), i);
1012
- r.watcher.add(I(e, "content")), r.watcher.on("all", (t, n) => {
1013
- typeof n == "string" && n.startsWith(I(e, "content")) && (We(), r.ws.send({ type: "full-reload" }));
1027
+ r.watcher.add(F(e, "content")), r.watcher.on("all", (t, n) => {
1028
+ typeof n == "string" && n.startsWith(F(e, "content")) && (Ze(), r.ws.send({ type: "full-reload" }));
1014
1029
  });
1015
1030
  for (let e of t) r.middlewares.use(e.path, (t, r) => {
1016
1031
  (async () => {
1017
1032
  await a();
1018
- let t = await jn(e, n ?? "http://localhost");
1033
+ let t = await qn(e, n ?? "http://localhost");
1019
1034
  r.setHeader("content-type", "application/rss+xml"), r.end(t);
1020
1035
  })().catch((t) => {
1021
- kn.warn("feed render failed", { path: e.path }, t), r.statusCode = 500, r.end("feed error");
1036
+ In.warn("feed render failed", { path: e.path }, t), r.statusCode = 500, r.end("feed error");
1022
1037
  });
1023
1038
  });
1024
1039
  r.middlewares.use("/assets/content", (e, t, n) => {
1025
1040
  (async () => {
1026
1041
  await a();
1027
- let r = await In(`/assets/content${(e.url ?? "/").split("?")[0]}`);
1042
+ let r = await Qn(`/assets/content${(e.url ?? "/").split("?")[0]}`);
1028
1043
  if (r === null) {
1029
1044
  n();
1030
1045
  return;
@@ -1033,28 +1048,28 @@ __installPublicEnv(publicEnvValues)
1033
1048
  })().catch(() => n());
1034
1049
  });
1035
1050
  }
1036
- }), zn, Bn = async () => {
1037
- if (zn !== void 0) return zn;
1051
+ }), tr, nr = async () => {
1052
+ if (tr !== void 0) return tr;
1038
1053
  try {
1039
1054
  let e = await import("satori");
1040
- zn = e.default ?? e;
1055
+ tr = e.default ?? e;
1041
1056
  } catch {
1042
- zn = null;
1057
+ tr = null;
1043
1058
  }
1044
- return zn;
1045
- }, Vn, Hn = async () => {
1046
- if (Vn !== void 0) return Vn;
1059
+ return tr;
1060
+ }, rr, ir = async () => {
1061
+ if (rr !== void 0) return rr;
1047
1062
  try {
1048
- Vn = await import("@resvg/resvg-js");
1063
+ rr = await import("@resvg/resvg-js");
1049
1064
  } catch {
1050
- Vn = null;
1065
+ rr = null;
1051
1066
  }
1052
- return Vn;
1053
- }, Un = async (e, t) => {
1067
+ return rr;
1068
+ }, ar = async (e, t) => {
1054
1069
  if (t === void 0 || t.length === 0) throw Error("ogImage needs a declared font: satori cannot render text without a font buffer, and there is no bundled default (that would ship a license artifact most projects replace). Declare one in app.config.ts — fonts: [{ family: 'Inter', src: [{ path: 'src/fonts/Inter.woff2' }] }] — see the Fonts docs.");
1055
1070
  let n = [];
1056
1071
  for (let r of t) for (let t of r.src) {
1057
- let i = await De(I(e, t.path)), a = typeof t.weight == "number" ? t.weight : void 0;
1072
+ let i = await Fe(F(e, t.path)), a = typeof t.weight == "number" ? t.weight : void 0;
1058
1073
  n.push({
1059
1074
  name: r.family,
1060
1075
  data: i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength),
@@ -1063,8 +1078,8 @@ __installPublicEnv(publicEnvValues)
1063
1078
  });
1064
1079
  }
1065
1080
  return n;
1066
- }, Wn = async (e) => {
1067
- let t = await Bn(), n = await Hn();
1081
+ }, or = async (e) => {
1082
+ let t = await nr(), n = await ir();
1068
1083
  if (t === null || n === null) {
1069
1084
  let e = [t === null ? "satori" : null, n === null ? "@resvg/resvg-js" : null].filter((e) => e !== null).join(" + ");
1070
1085
  throw Error(`ogImage cannot render: ${e} is not loadable. Both ship as optional dependencies of @voltro/cli — if your installer omitted optional dependencies, run \`pnpm add -D satori @resvg/resvg-js\` in this app.`);
@@ -1081,21 +1096,21 @@ __installPublicEnv(publicEnvValues)
1081
1096
  svg: r,
1082
1097
  png: new Uint8Array(new n.Resvg(r).render().asPng())
1083
1098
  };
1084
- }, Gn = (e, t, n, r) => `${e}\u0000${t}\u0000${n}\u0000${r}`, Kn = (e, t) => ke("sha256", e).update(t).digest("hex"), qn = () => {
1099
+ }, sr = (e, t, n, r) => `${e}\u0000${t}\u0000${n}\u0000${r}`, cr = (e, t) => Ie("sha256", e).update(t).digest("hex"), lr = () => {
1085
1100
  let e = process.env.VOLTRO_OG_SECRET;
1086
1101
  return e !== void 0 && e !== "" ? {
1087
1102
  secret: e,
1088
1103
  fromEnv: !0
1089
1104
  } : {
1090
- secret: Ae(32).toString("hex"),
1105
+ secret: Le(32).toString("hex"),
1091
1106
  fromEnv: !1
1092
1107
  };
1093
- }, Jn = "/_voltro/og", Yn = (e) => {
1094
- let t = e.ttlMs ?? 36e5, n, r = () => (n ??= Un(e.root, e.fonts), n);
1108
+ }, ur = "/_voltro/og", dr = (e) => {
1109
+ let t = e.ttlMs ?? 36e5, n, r = () => (n ??= ar(e.root, e.fonts), n);
1095
1110
  return {
1096
1111
  signOgUrl: ({ pattern: t, params: n, tenant: r, locale: i }) => {
1097
- let a = JSON.stringify(n), o = r ?? "", s = i ?? "", c = Kn(e.secret, Gn(t, a, o, s));
1098
- return `${Jn}?${new URLSearchParams({
1112
+ let a = JSON.stringify(n), o = r ?? "", s = i ?? "", c = cr(e.secret, sr(t, a, o, s));
1113
+ return `${ur}?${new URLSearchParams({
1099
1114
  route: t,
1100
1115
  p: a,
1101
1116
  ...o === "" ? {} : { t: o },
@@ -1105,8 +1120,8 @@ __installPublicEnv(publicEnvValues)
1105
1120
  },
1106
1121
  handle: async (n) => {
1107
1122
  if (n.pathname !== "/_voltro/og") return null;
1108
- let i = n.searchParams.get("route") ?? "", a = n.searchParams.get("p") ?? "{}", o = n.searchParams.get("t") ?? "", s = n.searchParams.get("l") ?? "", c = n.searchParams.get("sig") ?? "", l = Kn(e.secret, Gn(i, a, o, s)), u = Buffer.from(c, "utf8"), d = Buffer.from(l, "utf8");
1109
- if (u.length !== d.length || !je(u, d)) return {
1123
+ let i = n.searchParams.get("route") ?? "", a = n.searchParams.get("p") ?? "{}", o = n.searchParams.get("t") ?? "", s = n.searchParams.get("l") ?? "", c = n.searchParams.get("sig") ?? "", l = cr(e.secret, sr(i, a, o, s)), u = Buffer.from(c, "utf8"), d = Buffer.from(l, "utf8");
1124
+ if (u.length !== d.length || !Re(u, d)) return {
1110
1125
  status: 403,
1111
1126
  headers: { "content-type": "text/plain" },
1112
1127
  body: new TextEncoder().encode("bad signature")
@@ -1131,7 +1146,7 @@ __installPublicEnv(publicEnvValues)
1131
1146
  headers: { "content-type": "text/plain" },
1132
1147
  body: new TextEncoder().encode("page has no ogImage")
1133
1148
  };
1134
- let { png: g } = await Wn({
1149
+ let { png: g } = await or({
1135
1150
  element: await h({
1136
1151
  params: JSON.parse(a),
1137
1152
  loaderData: void 0,
@@ -1157,112 +1172,7 @@ __installPublicEnv(publicEnvValues)
1157
1172
  };
1158
1173
  }
1159
1174
  };
1160
- }, Xn = class extends Error {
1161
- _voltroDeferral = !0;
1162
- constructor(e) {
1163
- super(e), this.name = "DeferralNotSupportedError";
1164
- }
1165
- }, Zn = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Qn = (e) => {
1166
- if (!(e instanceof Error)) return;
1167
- let t = e._voltroControl;
1168
- if (t === "redirect") {
1169
- let { location: t, status: n } = e;
1170
- return typeof t == "string" ? {
1171
- status: n === 307 || n === 308 ? n : 303,
1172
- headers: {
1173
- location: t,
1174
- "x-voltro-rendered-by": "loader-redirect"
1175
- },
1176
- body: ""
1177
- } : void 0;
1178
- }
1179
- if (t === "not-found") return {
1180
- status: 404,
1181
- headers: {
1182
- "content-type": "text/plain; charset=utf-8",
1183
- "x-voltro-rendered-by": "loader-not-found"
1184
- },
1185
- body: "not found"
1186
- };
1187
- }, $n = (e) => {
1188
- let { helpers: t } = e, n = t.prepareDeferredLoaderData(e.loaderData, "page"), r = {}, i = {}, a = {};
1189
- for (let [n, o] of Object.entries(e.segmentLoaderData)) {
1190
- let e = Number(n), s = t.prepareDeferredLoaderData(o, e);
1191
- r[e] = s.renderData, i[e] = s.stateData, s.deferredIds && (a[e] = s.deferredIds);
1192
- }
1193
- let o = n.deferredIds !== void 0 || Object.keys(a).length > 0;
1194
- if (o) try {
1195
- t.assertDeferralSupported({
1196
- page: e.page,
1197
- renderMode: e.renderMode,
1198
- interactive: e.interactive,
1199
- ...e.layoutShell ? { layoutShell: e.layoutShell } : {},
1200
- ...e.ppr === !0 ? { ppr: !0 } : {}
1201
- });
1202
- } catch (e) {
1203
- throw new Xn(e instanceof Error ? e.message : String(e));
1204
- }
1205
- return {
1206
- loaderData: n.renderData,
1207
- segmentLoaderData: r,
1208
- hasDeferred: o,
1209
- stateInput: {
1210
- path: e.pathname,
1211
- loaderData: n.stateData,
1212
- segmentLoaderData: i,
1213
- pageLoaderRan: e.pageLoaderRan,
1214
- ...e.layoutShell ? { pageClientOnly: !0 } : {},
1215
- ...n.deferredIds ? { deferredPageIds: n.deferredIds } : {},
1216
- ...Object.keys(a).length > 0 ? { deferredSegmentIds: a } : {}
1217
- }
1218
- };
1219
- }, er = (e) => {
1220
- let { helpers: t, renderInput: n } = e, r = $n({
1221
- helpers: t,
1222
- page: e.page,
1223
- pathname: n.pathname,
1224
- renderMode: "spa",
1225
- interactive: e.interactive,
1226
- loaderData: null,
1227
- segmentLoaderData: n.segmentLoaderData ?? {},
1228
- pageLoaderRan: !1,
1229
- layoutShell: e.delivery
1230
- });
1231
- return {
1232
- renderInput: {
1233
- ...n,
1234
- pageSlot: !0,
1235
- loaderData: null,
1236
- segmentLoaderData: r.segmentLoaderData
1237
- },
1238
- stateScript: t.renderRouterStateScript(r.stateInput),
1239
- hasDeferred: r.hasDeferred
1240
- };
1241
- }, tr = (e) => {
1242
- let { html: t, meta: n } = e.helpers.renderPageToHtml(e.prepared.renderInput);
1243
- return {
1244
- body: t,
1245
- meta: n
1246
- };
1247
- }, nr = (e) => [
1248
- ...e.extra ?? [],
1249
- e.helpers.renderMetaToHtml(e.meta),
1250
- `<meta name="voltro-interactive" content="${e.interactive}" />`,
1251
- ...e.prepared.hasDeferred ? [e.helpers.renderDeferredRegistryScript()] : [],
1252
- e.prepared.stateScript
1253
- ].filter((e) => e.length > 0).join("\n "), rr = (e, t) => {
1254
- let n = t.replace(/[^A-Za-z0-9+/=_-]/g, "");
1255
- return e.replace(/<script(?![^>]*\bnonce=)/gi, `<script nonce="${n}"`);
1256
- }, ir = (e) => {
1257
- let t = e.indexOf("?");
1258
- return t === -1 ? {
1259
- pathname: e || "/",
1260
- search: ""
1261
- } : {
1262
- pathname: e.slice(0, t) || "/",
1263
- search: e.slice(t)
1264
- };
1265
- }, ar = (e) => {
1175
+ }, fr = (e) => {
1266
1176
  let t = [];
1267
1177
  for (let n of e.split("/").filter(Boolean)) n.startsWith("[[...") && n.endsWith("]]") ? t.push({
1268
1178
  name: n.slice(5, -2),
@@ -1278,12 +1188,12 @@ __installPublicEnv(publicEnvValues)
1278
1188
  optional: !1
1279
1189
  });
1280
1190
  return t;
1281
- }, or = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), sr = async (e) => {
1282
- let t = R(e);
1191
+ }, pr = (e) => e.replace(/-([a-z0-9])/g, (e, t) => t.toUpperCase()), mr = async (e) => {
1192
+ let t = L(e);
1283
1193
  for (let e = 0; e < 4; e++) {
1284
- let e = I(t, "project.json");
1285
- if (B(e)) try {
1286
- let n = await V.readFile(e, "utf8");
1194
+ let e = F(t, "project.json");
1195
+ if (z(e)) try {
1196
+ let n = await B.readFile(e, "utf8");
1287
1197
  return {
1288
1198
  projectDir: t,
1289
1199
  manifest: JSON.parse(n)
@@ -1291,38 +1201,38 @@ __installPublicEnv(publicEnvValues)
1291
1201
  } catch {
1292
1202
  return null;
1293
1203
  }
1294
- let n = F(t);
1204
+ let n = P(t);
1295
1205
  if (n === t) break;
1296
1206
  t = n;
1297
1207
  }
1298
1208
  return null;
1299
- }, cr = async (e) => {
1300
- let t = await sr(e);
1209
+ }, hr = async (e) => {
1210
+ let t = await mr(e);
1301
1211
  if (!t) return [];
1302
- let { projectDir: n, manifest: r } = t, i = ae(e), a = r.apps ?? {}, o = [];
1212
+ let { projectDir: n, manifest: r } = t, i = N(e), a = r.apps ?? {}, o = [];
1303
1213
  for (let [e, t] of Object.entries(a)) {
1304
1214
  if (e === i || t.kind !== "web" || typeof t.port != "number") continue;
1305
- let r = I(n, t.path ?? e), a = I(r, "src", "pages");
1306
- if (!B(a)) continue;
1215
+ let r = F(n, t.path ?? e), a = F(r, "src", "pages");
1216
+ if (!z(a)) continue;
1307
1217
  let s;
1308
1218
  try {
1309
- let { pages: e } = await ro(a);
1219
+ let { pages: e } = await Mo(a);
1310
1220
  s = e.map((e) => ({
1311
1221
  pattern: e.pattern,
1312
- params: ar(e.pattern)
1222
+ params: fr(e.pattern)
1313
1223
  }));
1314
1224
  } catch {
1315
1225
  continue;
1316
1226
  }
1317
1227
  o.push({
1318
- key: or(e),
1228
+ key: pr(e),
1319
1229
  origin: `http://localhost:${t.port}`,
1320
1230
  ...typeof t.origin == "string" && t.origin.length > 0 ? { prodOrigin: t.origin } : {},
1321
1231
  routes: s
1322
1232
  });
1323
1233
  }
1324
1234
  return o;
1325
- }, lr = (e) => {
1235
+ }, gr = (e) => {
1326
1236
  if (e.params.length === 0) return `'${e.pattern}'`;
1327
1237
  let t = e.pattern;
1328
1238
  for (let n of e.params) {
@@ -1330,21 +1240,21 @@ __installPublicEnv(publicEnvValues)
1330
1240
  t = t.replace(e, r);
1331
1241
  }
1332
1242
  return "`" + t + "`";
1333
- }, ur = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
1243
+ }, _r = (e) => e.params.length === 0 ? "EmptyParams" : `{ ${e.params.map((e) => {
1334
1244
  let t = "string";
1335
1245
  return e.optional ? `readonly ${e.name}?: ${t}` : `readonly ${e.name}: ${t}`;
1336
- }).join("; ")} }`, dr = (e, t, n) => {
1337
- let r = ur(e), i = lr(e), a = t ? "VoltroExternalUrl" : e.search === void 0 ? "VoltroRouteUrl" : `VoltroRouteUrl<Schema.Schema.Type<typeof ${e.search.alias}>>`, o = t && n ? `${n} + ` : "";
1246
+ }).join("; ")} }`, vr = (e, t, n) => {
1247
+ let r = _r(e), i = gr(e), a = t ? "VoltroExternalUrl" : e.search === void 0 ? "VoltroRouteUrl" : `VoltroRouteUrl<Schema.Schema.Type<typeof ${e.search.alias}>>`, o = t && n ? `${n} + ` : "";
1338
1248
  return e.params.length === 0 ? `() => (${o}${i}) as ${a}` : `({ ${e.params.map((e) => e.name).join(", ")} }: ${r}) => (${o}${i}) as ${a}`;
1339
- }, fr = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${dr(e, !1)},`).join("\n")}\n}`, pr = (e, t) => {
1249
+ }, yr = (e) => `{\n${[...e].sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => ` ${JSON.stringify(e.pattern)}: ${vr(e, !1)},`).join("\n")}\n}`, br = (e, t) => {
1340
1250
  if (e.routes.length === 0) return ` ${e.key}: {} as Record<string, never>,`;
1341
- let n = [...e.routes].sort((e, t) => e.pattern.localeCompare(t.pattern)), r = t === "prod" && e.prodOrigin ? e.prodOrigin : e.origin, i = JSON.stringify(r), a = n.map((e) => ` ${JSON.stringify(e.pattern)}: ${dr(e, !0, i)},`);
1251
+ let n = [...e.routes].sort((e, t) => e.pattern.localeCompare(t.pattern)), r = t === "prod" && e.prodOrigin ? e.prodOrigin : e.origin, i = JSON.stringify(r), a = n.map((e) => ` ${JSON.stringify(e.pattern)}: ${vr(e, !0, i)},`);
1342
1252
  return ` ${e.key}: {\n${a.join("\n")}\n },`;
1343
- }, mr = async (e) => {
1253
+ }, xr = async (e) => {
1344
1254
  let t = await Promise.all(e.pages.map(async (t) => {
1345
1255
  let n;
1346
1256
  try {
1347
- let r = await V.readFile(I(e.appRoot, "src", "pages", t.file), "utf8");
1257
+ let r = await B.readFile(F(e.appRoot, "src", "pages", t.file), "utf8");
1348
1258
  /^export const searchParams\b/m.test(r) && (n = {
1349
1259
  alias: `SP_${t.ident}`,
1350
1260
  specifier: `../src/pages/${t.file.replace(/\.tsx?$/, "")}`
@@ -1352,10 +1262,10 @@ __installPublicEnv(publicEnvValues)
1352
1262
  } catch {}
1353
1263
  return {
1354
1264
  pattern: t.pattern,
1355
- params: ar(t.pattern),
1265
+ params: fr(t.pattern),
1356
1266
  ...n === void 0 ? {} : { search: n }
1357
1267
  };
1358
- })), n = await cr(e.appRoot), r = t.filter((e) => e.search !== void 0).sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => `import type { searchParams as ${e.search.alias} } from '${e.search.specifier}'`), i = [
1268
+ })), n = await hr(e.appRoot), r = t.filter((e) => e.search !== void 0).sort((e, t) => e.pattern.localeCompare(t.pattern)).map((e) => `import type { searchParams as ${e.search.alias} } from '${e.search.specifier}'`), i = [
1359
1269
  "// THIS FILE IS GENERATED — DO NOT EDIT BY HAND.",
1360
1270
  "// Re-emitted by `voltro dev` whenever `src/pages/**` changes.",
1361
1271
  "// Type-safe route builders consumed by <Link to={...}>.",
@@ -1371,50 +1281,50 @@ __installPublicEnv(publicEnvValues)
1371
1281
  "",
1372
1282
  "type EmptyParams = Record<string, never>",
1373
1283
  ""
1374
- ].join("\n"), a = e.mode ?? "dev", o = `${i}\n${`export const routes = ${fr(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => pr(e, a)).join("\n")}\n} as const\n`}`, s = I(e.appRoot, ".framework", "routes.generated.ts");
1375
- await V.mkdir(F(s), { recursive: !0 });
1284
+ ].join("\n"), a = e.mode ?? "dev", o = `${i}\n${`export const routes = ${yr(t)} as const\n`}\n${n.length === 0 ? "export const siblingApps = {} as Record<string, never>\n" : `export const siblingApps = {\n${n.map((e) => br(e, a)).join("\n")}\n} as const\n`}`, s = F(e.appRoot, ".framework", "routes.generated.ts");
1285
+ await B.mkdir(P(s), { recursive: !0 });
1376
1286
  let c = null;
1377
1287
  try {
1378
- c = await V.readFile(s, "utf8");
1288
+ c = await B.readFile(s, "utf8");
1379
1289
  } catch {}
1380
1290
  return c === o ? {
1381
1291
  path: s,
1382
1292
  wrote: !1
1383
- } : (await V.writeFile(s, o, "utf8"), {
1293
+ } : (await B.writeFile(s, o, "utf8"), {
1384
1294
  path: s,
1385
1295
  wrote: !0
1386
1296
  });
1387
- }, hr = (e) => {
1297
+ }, Sr = (e) => {
1388
1298
  if (e === "" || e === "/") return "/";
1389
1299
  let t = e.startsWith("/") ? e : `/${e}`;
1390
1300
  return t.endsWith("/") ? t.slice(0, -1) : t;
1391
- }, gr = (e, t) => {
1392
- let n = e.endsWith("/") ? e.slice(0, -1) : e, r = hr(t);
1301
+ }, Cr = (e, t) => {
1302
+ let n = e.endsWith("/") ? e.slice(0, -1) : e, r = Sr(t);
1393
1303
  return r === "/" ? `${n}/` : `${n}${r}`;
1394
- }, _r = (e, t, n) => {
1395
- let r = hr(e);
1304
+ }, wr = (e, t, n) => {
1305
+ let r = Sr(e);
1396
1306
  return t === n ? r : r === "/" ? `/${t}` : `/${t}${r}`;
1397
- }, vr = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), yr = (e) => {
1307
+ }, Tr = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;"), Er = (e) => {
1398
1308
  let { siteUrl: t, entries: n } = e, r = e.locales && e.locales.length > 1 ? e.locales : void 0, i = e.defaultLocale ?? r?.[0] ?? "en", a = r !== void 0, o = /* @__PURE__ */ new Map(), s = (e) => {
1399
1309
  if (!r) return "";
1400
- let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${vr(n)}" href="${vr(gr(t, _r(e, n, i)))}" />`);
1401
- return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${vr(gr(t, _r(e, i, i)))}" />`), `\n${n.join("\n")}`;
1310
+ let n = r.map((n) => ` <xhtml:link rel="alternate" hreflang="${Tr(n)}" href="${Tr(Cr(t, wr(e, n, i)))}" />`);
1311
+ return n.push(` <xhtml:link rel="alternate" hreflang="x-default" href="${Tr(Cr(t, wr(e, i, i)))}" />`), `\n${n.join("\n")}`;
1402
1312
  };
1403
1313
  for (let e of n) {
1404
1314
  let n = r ?? [i];
1405
1315
  for (let r of n) {
1406
- let n = gr(t, _r(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${vr(e.lastmod)}</lastmod>` : "";
1407
- o.set(n, ` <url>\n <loc>${vr(n)}</loc>${a}${s(e.path)}\n </url>`);
1316
+ let n = Cr(t, wr(e.path, r, i)), a = e.lastmod ? `\n <lastmod>${Tr(e.lastmod)}</lastmod>` : "";
1317
+ o.set(n, ` <url>\n <loc>${Tr(n)}</loc>${a}${s(e.path)}\n </url>`);
1408
1318
  }
1409
1319
  }
1410
1320
  let c = [...o.keys()].sort().map((e) => o.get(e)).join("\n");
1411
1321
  return `<?xml version="1.0" encoding="UTF-8"?>\n<urlset${a ? " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"" : " xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\""}>\n${c}\n</urlset>\n`;
1412
- }, br = (e) => {
1322
+ }, Dr = (e) => {
1413
1323
  if (!e.indexable) return "User-agent: *\nDisallow: /\n";
1414
1324
  let t = ["User-agent: *", "Allow: /"];
1415
- for (let n of e.disallow ?? []) t.push(`Disallow: ${hr(n)}`);
1325
+ for (let n of e.disallow ?? []) t.push(`Disallow: ${Sr(n)}`);
1416
1326
  return e.sitemapUrl && t.push("", `Sitemap: ${e.sitemapUrl}`), `${t.join("\n")}\n`;
1417
- }, xr = 256, Sr = (e = xr) => {
1327
+ }, Or = 256, kr = (e = Or) => {
1418
1328
  let t = [], n = /* @__PURE__ */ new Set();
1419
1329
  return {
1420
1330
  emit(r, i) {
@@ -1437,18 +1347,18 @@ __installPublicEnv(publicEnvValues)
1437
1347
  return t.slice();
1438
1348
  }
1439
1349
  };
1440
- }, Cr = (e) => `event: ${e.channel}\ndata: ${JSON.stringify(e)}\n\n`, wr = () => `: keep-alive ${Date.now()}\n\n`, Tr = 8e3, Er = (e, t = Tr) => {
1441
- let n = Or(e);
1350
+ }, Ar = (e) => `event: ${e.channel}\ndata: ${JSON.stringify(e)}\n\n`, jr = () => `: keep-alive ${Date.now()}\n\n`, Mr = 8e3, Nr = (e, t = Mr) => {
1351
+ let n = Fr(e);
1442
1352
  return n.length <= t ? n : `${n.slice(0, t)}\n… [voltro] truncated at ${t} chars (${n.length} total)`;
1443
- }, Dr = 4, Or = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
1353
+ }, Pr = 4, Fr = (e, t = 0, n = /* @__PURE__ */ new Set()) => {
1444
1354
  if (e instanceof Error) {
1445
1355
  let r = e.stack ?? `${e.name}: ${e.message}`;
1446
1356
  if (n.has(e)) return `${r}\n [cycle]`;
1447
1357
  n.add(e);
1448
1358
  let i = [];
1449
- if (t < Dr) {
1450
- if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${kr(Or(a, t + 1, n))}`);
1451
- else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${kr(Or(e.cause, t + 1, n))}`);
1359
+ if (t < Pr) {
1360
+ if (e instanceof AggregateError && Array.isArray(e.errors)) for (let [r, a] of e.errors.entries()) i.push(`\n [aggregate ${r}] ${Ir(Fr(a, t + 1, n))}`);
1361
+ else e.cause !== void 0 && e.cause !== null && i.push(`\n [cause] ${Ir(Fr(e.cause, t + 1, n))}`);
1452
1362
  }
1453
1363
  return r + i.join("");
1454
1364
  }
@@ -1457,30 +1367,30 @@ __installPublicEnv(publicEnvValues)
1457
1367
  } catch {
1458
1368
  return "[unstringifiable thrown value]";
1459
1369
  }
1460
- }, kr = (e) => {
1370
+ }, Ir = (e) => {
1461
1371
  let t = e.split("\n");
1462
1372
  return t.length <= 3 ? e : `${t.slice(0, 3).join("\n")}\n …`;
1463
- }, Ar = {
1373
+ }, Lr = {
1464
1374
  trace: 0,
1465
1375
  debug: 1,
1466
1376
  info: 2,
1467
1377
  warn: 3,
1468
1378
  error: 4,
1469
1379
  fatal: 5
1470
- }, jr = 2e3, Mr = 200, Nr = class {
1380
+ }, Rr = 2e3, zr = 200, Br = class {
1471
1381
  capacity;
1472
1382
  buffer = [];
1473
- constructor(e = jr) {
1383
+ constructor(e = Rr) {
1474
1384
  this.capacity = e;
1475
1385
  }
1476
1386
  append(e) {
1477
1387
  this.buffer.push(e), this.buffer.length > this.capacity && this.buffer.shift();
1478
1388
  }
1479
1389
  query(e = {}) {
1480
- let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? Mr, this.capacity), i = e.minLevel === void 0 ? Ar.trace : Ar[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
1390
+ let t = e.since ?? 0, n = e.until ?? Date.now(), r = Math.min(e.max ?? zr, this.capacity), i = e.minLevel === void 0 ? Lr.trace : Lr[e.minLevel], a = e.scope?.toLowerCase(), o = e.source, s = e.filter?.toLowerCase(), c = e.traceId, l = [];
1481
1391
  for (let e = this.buffer.length - 1; e >= 0 && l.length < r; e--) {
1482
1392
  let r = this.buffer[e];
1483
- r.ts < t || r.ts > n || Ar[r.level] < i || (o === void 0 || r.source === o) && (a !== void 0 && (r.scope === void 0 || !r.scope.toLowerCase().includes(a)) || s !== void 0 && !r.message.toLowerCase().includes(s) || (c === void 0 || r.fields.traceId === c) && l.push(r));
1393
+ r.ts < t || r.ts > n || Lr[r.level] < i || (o === void 0 || r.source === o) && (a !== void 0 && (r.scope === void 0 || !r.scope.toLowerCase().includes(a)) || s !== void 0 && !r.message.toLowerCase().includes(s) || (c === void 0 || r.fields.traceId === c) && l.push(r));
1484
1394
  }
1485
1395
  return l.reverse();
1486
1396
  }
@@ -1493,7 +1403,7 @@ __installPublicEnv(publicEnvValues)
1493
1403
  clear() {
1494
1404
  this.buffer = [];
1495
1405
  }
1496
- }, Pr = null, Fr = () => (Pr === null && (Pr = new Nr()), Pr), Ir = (e) => {
1406
+ }, Vr = null, Hr = () => (Vr === null && (Vr = new Br()), Vr), Ur = (e) => {
1497
1407
  if (typeof e == "string") return e;
1498
1408
  if (e instanceof Error) return e.message;
1499
1409
  try {
@@ -1501,28 +1411,28 @@ __installPublicEnv(publicEnvValues)
1501
1411
  } catch {
1502
1412
  return String(e);
1503
1413
  }
1504
- }, Lr = 8e3, Rr = (e) => typeof e == "string" ? e.length <= Lr ? e : `${e.slice(0, Lr)}… [voltro: truncated]` : typeof e != "object" || !e ? e : Er(e, Lr), zr = (e, t) => {
1414
+ }, Wr = 8e3, Gr = (e) => typeof e == "string" ? e.length <= Wr ? e : `${e.slice(0, Wr)}… [voltro: truncated]` : typeof e != "object" || !e ? e : Nr(e, Wr), Kr = (e, t) => {
1505
1415
  try {
1506
1416
  e(...t);
1507
1417
  } catch (n) {
1508
1418
  try {
1509
- e(...t.map(Rr)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${Lr} chars per argument.`);
1419
+ e(...t.map(Gr)), e(` ↑ [voltro] an argument above was too large for console formatting (${n?.message ?? "inspect failed"}) — printed bounded to ${Wr} chars per argument.`);
1510
1420
  } catch {
1511
1421
  e(`[voltro] a console.error argument could not be formatted at all (${t.length} arg(s)).`);
1512
1422
  }
1513
1423
  }
1514
- }, Br = (e) => {
1424
+ }, qr = (e) => {
1515
1425
  let t = {
1516
1426
  log: console.log.bind(console),
1517
1427
  info: console.info.bind(console),
1518
1428
  warn: console.warn.bind(console),
1519
1429
  error: console.error.bind(console),
1520
1430
  debug: console.debug.bind(console)
1521
- }, n = Fr(), r = !1, i = (i) => (...a) => {
1522
- if (zr(t[i], a), !r) {
1431
+ }, n = Hr(), r = !1, i = (i) => (...a) => {
1432
+ if (Kr(t[i], a), !r) {
1523
1433
  r = !0;
1524
1434
  try {
1525
- let t = a.length > 0 ? Ir(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = fe();
1435
+ let t = a.length > 0 ? Ur(a[0]) : "", r = t.length > 500 ? t.slice(0, 500) + "…" : t, o = xe();
1526
1436
  e.emit("log", {
1527
1437
  level: i,
1528
1438
  message: r,
@@ -1549,7 +1459,7 @@ __installPublicEnv(publicEnvValues)
1549
1459
  }
1550
1460
  };
1551
1461
  console.log = i("log"), console.info = i("info"), console.warn = i("warn"), console.error = i("error"), console.debug = i("debug");
1552
- let a = le((t) => {
1462
+ let a = he((t) => {
1553
1463
  if (!r) {
1554
1464
  r = !0;
1555
1465
  try {
@@ -1560,7 +1470,7 @@ __installPublicEnv(publicEnvValues)
1560
1470
  argsCount: 1,
1561
1471
  ...t.scope === void 0 ? {} : { scope: t.scope }
1562
1472
  });
1563
- let a = fe(), o = a !== void 0 && t.fields.traceId === void 0 ? {
1473
+ let a = xe(), o = a !== void 0 && t.fields.traceId === void 0 ? {
1564
1474
  ...t.fields,
1565
1475
  traceId: a.traceId
1566
1476
  } : t.fields;
@@ -1580,24 +1490,24 @@ __installPublicEnv(publicEnvValues)
1580
1490
  return () => {
1581
1491
  console.log = t.log, console.info = t.info, console.warn = t.warn, console.error = t.error, console.debug = t.debug, a();
1582
1492
  };
1583
- }, Vr = 2e3, Hr = 8, Ur = 1e3, Wr = 200, Gr = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, Kr = (e) => {
1493
+ }, Jr = 2e3, Yr = 8, Xr = 1e3, Zr = 200, Qr = (e, t) => e.length > t ? `${e.slice(0, t)}…` : e, $r = (e) => {
1584
1494
  switch (e) {
1585
1495
  case "error": return "error";
1586
1496
  case "warn": return "warn";
1587
1497
  case "debug": return "debug";
1588
1498
  default: return "info";
1589
1499
  }
1590
- }, qr = K({ scope: "client" }), Jr = (e, t) => {
1500
+ }, ei = G({ scope: "client" }), ti = (e, t) => {
1591
1501
  let n;
1592
1502
  try {
1593
1503
  n = JSON.parse(e);
1594
1504
  } catch {
1595
- return Yr(400, { error: "invalid JSON body" });
1505
+ return ni(400, { error: "invalid JSON body" });
1596
1506
  }
1597
- if (typeof n != "object" || !n) return Yr(400, { error: "body must be a JSON object" });
1507
+ if (typeof n != "object" || !n) return ni(400, { error: "body must be a JSON object" });
1598
1508
  let r = n;
1599
- if (!Array.isArray(r.entries)) return Yr(400, { error: "entries must be an array" });
1600
- let i = typeof r.app == "string" ? Gr(r.app, 120) : void 0, a = typeof r.page == "string" ? Gr(r.page, 200) : void 0, o = typeof r.ua == "string" ? Gr(r.ua, 200) : void 0, s = r.entries.slice(0, Wr), c = 0;
1509
+ if (!Array.isArray(r.entries)) return ni(400, { error: "entries must be an array" });
1510
+ let i = typeof r.app == "string" ? Qr(r.app, 120) : void 0, a = typeof r.page == "string" ? Qr(r.page, 200) : void 0, o = typeof r.ua == "string" ? Qr(r.ua, 200) : void 0, s = r.entries.slice(0, Zr), c = 0;
1601
1511
  for (let e of s) {
1602
1512
  if (typeof e != "object" || !e) continue;
1603
1513
  let n = e;
@@ -1608,7 +1518,7 @@ __installPublicEnv(publicEnvValues)
1608
1518
  "warn",
1609
1519
  "error",
1610
1520
  "debug"
1611
- ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = Gr(n.message, Vr), u = Array.isArray(n.args) ? n.args.slice(0, Hr).filter((e) => typeof e == "string").map((e) => Gr(e, Ur)) : void 0, d = typeof n.stack == "string" ? Gr(n.stack, Vr) : void 0;
1521
+ ].includes(n.level) ? n.level : "log", s = typeof n.ts == "number" && Number.isFinite(n.ts) ? n.ts : Date.now(), l = Qr(n.message, Jr), u = Array.isArray(n.args) ? n.args.slice(0, Yr).filter((e) => typeof e == "string").map((e) => Qr(e, Xr)) : void 0, d = typeof n.stack == "string" ? Qr(n.stack, Jr) : void 0;
1612
1522
  t.emit("clientLog", {
1613
1523
  ts: s,
1614
1524
  level: r,
@@ -1623,35 +1533,35 @@ __installPublicEnv(publicEnvValues)
1623
1533
  ...i === void 0 ? {} : { app: i },
1624
1534
  ...a === void 0 ? {} : { page: a },
1625
1535
  ...u !== void 0 && u.length > 0 ? { args: u } : {}
1626
- }, p = Kr(r);
1627
- (p === "error" || p === "warn") && d !== void 0 ? qr[p](l, f, { stack: d }) : qr[p](l, {
1536
+ }, p = $r(r);
1537
+ (p === "error" || p === "warn") && d !== void 0 ? ei[p](l, f, { stack: d }) : ei[p](l, {
1628
1538
  ...f,
1629
1539
  ...d === void 0 ? {} : { stack: d }
1630
1540
  }), c++;
1631
1541
  }
1632
- return Yr(202, {
1542
+ return ni(202, {
1633
1543
  accepted: c,
1634
1544
  dropped: r.entries.length - c
1635
1545
  });
1636
- }, Yr = (e, t) => ({
1546
+ }, ni = (e, t) => ({
1637
1547
  status: e,
1638
1548
  contentType: "application/json; charset=utf-8",
1639
1549
  body: JSON.stringify(t)
1640
- }), Xr = "/_voltro/inspect/clientLog", Zr = [
1550
+ }), ri = "/_voltro/inspect/clientLog", ii = [
1641
1551
  "trace",
1642
1552
  "debug",
1643
1553
  "info",
1644
1554
  "warn",
1645
1555
  "error",
1646
1556
  "fatal"
1647
- ], Qr = {
1557
+ ], ai = {
1648
1558
  trace: "TRACE",
1649
1559
  debug: "DEBUG",
1650
1560
  info: "INFO ",
1651
1561
  warn: "WARN ",
1652
1562
  error: "ERROR",
1653
1563
  fatal: "FATAL"
1654
- }, $r = (e) => Zr.includes(e), ei = (e, t, n = {}) => {
1564
+ }, oi = (e) => ii.includes(e), si = (e, t, n = {}) => {
1655
1565
  if (u()) return {
1656
1566
  status: 503,
1657
1567
  contentType: "application/json",
@@ -1682,7 +1592,7 @@ __installPublicEnv(publicEnvValues)
1682
1592
  Number.isFinite(e) && e > 0 && (o.max = Math.floor(e));
1683
1593
  }
1684
1594
  let d = a.get("level");
1685
- d !== null && $r(d) && (o.minLevel = d);
1595
+ d !== null && oi(d) && (o.minLevel = d);
1686
1596
  let p = a.get("source");
1687
1597
  (p === "server" || p === "client") && (o.source = p);
1688
1598
  let m = a.get("scope");
@@ -1695,7 +1605,7 @@ __installPublicEnv(publicEnvValues)
1695
1605
  if ((a.get("format") ?? "json") === "text") return {
1696
1606
  status: 200,
1697
1607
  contentType: "text/plain; charset=utf-8",
1698
- body: _.map(ti).join("\n") + (_.length > 0 ? "\n" : "")
1608
+ body: _.map(ci).join("\n") + (_.length > 0 ? "\n" : "")
1699
1609
  };
1700
1610
  let v = {
1701
1611
  capturedAt: Date.now(),
@@ -1709,40 +1619,40 @@ __installPublicEnv(publicEnvValues)
1709
1619
  contentType: "application/json; charset=utf-8",
1710
1620
  body: JSON.stringify(v)
1711
1621
  };
1712
- }, ti = (e) => {
1713
- let t = new Date(e.ts), n = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), i = String(t.getSeconds()).padStart(2, "0"), a = String(t.getMilliseconds()).padStart(3, "0"), o = `[${e.scope ?? "?"}/${e.source}]`, s = ri(e.fields);
1714
- return `${n}:${r}:${i}.${a} ${Qr[e.level]} ${o} ${e.message}${s}`;
1715
- }, ni = 80, ri = (e) => {
1622
+ }, ci = (e) => {
1623
+ let t = new Date(e.ts), n = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), i = String(t.getSeconds()).padStart(2, "0"), a = String(t.getMilliseconds()).padStart(3, "0"), o = `[${e.scope ?? "?"}/${e.source}]`, s = ui(e.fields);
1624
+ return `${n}:${r}:${i}.${a} ${ai[e.level]} ${o} ${e.message}${s}`;
1625
+ }, li = 80, ui = (e) => {
1716
1626
  let t = Object.entries(e);
1717
1627
  if (t.length === 0) return "";
1718
1628
  let n = [];
1719
1629
  for (let [e, r] of t) {
1720
1630
  if (r === void 0) continue;
1721
- let t = ii(r);
1631
+ let t = di(r);
1722
1632
  n.push(`${e}=${t}`);
1723
1633
  }
1724
1634
  return n.length > 0 ? " " + n.join(" ") : "";
1725
- }, ii = (e) => {
1635
+ }, di = (e) => {
1726
1636
  if (typeof e == "string") {
1727
- let t = e.length > ni ? e.slice(0, ni) + "…" : e;
1637
+ let t = e.length > li ? e.slice(0, li) + "…" : e;
1728
1638
  return /[\s=]/.test(t) ? `"${t.replace(/"/g, "\\\"")}"` : t;
1729
1639
  }
1730
1640
  if (e === null) return "null";
1731
1641
  if (typeof e == "number" || typeof e == "boolean") return String(e);
1732
1642
  try {
1733
1643
  let t = JSON.stringify(e);
1734
- return t.length > ni ? t.slice(0, ni) + "…" : t;
1644
+ return t.length > li ? t.slice(0, li) + "…" : t;
1735
1645
  } catch {
1736
1646
  return "[unserialisable]";
1737
1647
  }
1738
- }, ai = "/_voltro/inspect/logs", oi = (e, t, n) => {
1648
+ }, fi = "/_voltro/inspect/logs", pi = (e, t, n) => {
1739
1649
  if (t.headers.authorization !== void 0) return !1;
1740
1650
  let { token: r } = n;
1741
1651
  if (r === void 0 || r === "" || !n.isLoopback(n.target)) return !1;
1742
1652
  e.setHeader("authorization", `Bearer ${r}`);
1743
1653
  let i = n.writeToken;
1744
1654
  return i !== void 0 && i !== "" && t.headers["x-voltro-inspect-write"] === void 0 && e.setHeader("x-voltro-inspect-write", i), !0;
1745
- }, si = [{
1655
+ }, mi = [{
1746
1656
  match: (e) => typeof e == "string" && e.startsWith("[BABEL] Note: The code generator has deoptimised"),
1747
1657
  handle: (e, t) => {
1748
1658
  let n = e[0], r = n.match(/deoptimised the styling of (.+?) as it exceeds the max of (\d+\w*B)\.?/);
@@ -1754,13 +1664,13 @@ __installPublicEnv(publicEnvValues)
1754
1664
  });
1755
1665
  } else t.info(n);
1756
1666
  }
1757
- }], ci = () => {
1667
+ }], hi = () => {
1758
1668
  let e = {
1759
1669
  warn: console.warn.bind(console),
1760
1670
  error: console.error.bind(console)
1761
- }, t = K({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1671
+ }, t = G({ scope: "babel" }), n = !1, r = (r) => (...i) => {
1762
1672
  if (!n) {
1763
- for (let e of si) if (e.match(i[0])) {
1673
+ for (let e of mi) if (e.match(i[0])) {
1764
1674
  n = !0;
1765
1675
  try {
1766
1676
  e.handle(i, t);
@@ -1775,7 +1685,7 @@ __installPublicEnv(publicEnvValues)
1775
1685
  return console.warn = r("warn"), console.error = r("error"), () => {
1776
1686
  console.warn = e.warn, console.error = e.error;
1777
1687
  };
1778
- }, li = {
1688
+ }, gi = {
1779
1689
  loader: "it runs on the server, and the router caches its result per route + params",
1780
1690
  renderMode: "it picks the server render strategy",
1781
1691
  dynamic: "it picks the server render strategy",
@@ -1788,7 +1698,7 @@ __installPublicEnv(publicEnvValues)
1788
1698
  tenantAware: "it is part of the server-side cache key",
1789
1699
  ogImage: "the server renders it into the og:image PNG",
1790
1700
  ppr: "it switches the isr path to partial prerendering (cached shell + per-request holes)"
1791
- }, ui = Object.keys(li), di = "virtual:voltro-route-refresh", fi = `\0${di}`, pi = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, mi = () => `
1701
+ }, _i = Object.keys(gi), vi = "virtual:voltro-route-refresh", yi = `\0${vi}`, bi = /(?:^|&)(raw|url|inline|worker|sharedworker|direct)(?:&|=|$)/, xi = () => `
1792
1702
  // GENERATED by @voltro/cli — the \`voltro dev\` route Fast Refresh runtime.
1793
1703
 
1794
1704
  /** Mirrors react-refresh's own \`isLikelyComponentType\` closely enough for the
@@ -1817,11 +1727,11 @@ const stableForm = (value) => {
1817
1727
  * readers (\`build.ts\` prerender, \`webDev.ts\` dev SSR, \`start.ts\`). A change to
1818
1728
  * one of THESE cannot be hot-applied: the server already ran with the old
1819
1729
  * value. Everything else a page exports is plain client-side data. */
1820
- const serverRelevantExports = ${JSON.stringify(ui)}
1730
+ const serverRelevantExports = ${JSON.stringify(_i)}
1821
1731
 
1822
1732
  /** Name → the server step that already consumed it, so the reload message can
1823
1733
  * say WHY rather than just WHAT. Injected from the same single source. */
1824
- const serverExportEffect = ${JSON.stringify(li)}
1734
+ const serverExportEffect = ${JSON.stringify(gi)}
1825
1735
 
1826
1736
  /** The reason \`name\` forces a reload, for the console line. */
1827
1737
  export const serverEffectOf = (name) =>
@@ -1864,7 +1774,7 @@ export const routeUpdateNeedsReload = (prevExports, nextExports) => {
1864
1774
  const previousHook = globalThis.__getReactRefreshIgnoredExports
1865
1775
  globalThis.__getReactRefreshIgnoredExports = (args) =>
1866
1776
  ignoredExports.get(args.id) ?? previousHook?.(args) ?? []
1867
- `, hi = (e) => `
1777
+ `, Si = (e) => `
1868
1778
  if (import.meta.hot) {
1869
1779
  // Self-import to read our OWN exports, the same technique the react plugin
1870
1780
  // uses; the namespace is only complete after evaluation, hence the promise.
@@ -1891,97 +1801,97 @@ import {
1891
1801
  registerRouteModule as __voltro_registerRouteModule,
1892
1802
  routeUpdateNeedsReload as __voltro_routeUpdateNeedsReload,
1893
1803
  serverEffectOf as __voltro_serverEffect,
1894
- } from '${di}'
1895
- `, gi = (e) => e.replace(/\\/g, "/"), _i = (e, t) => {
1896
- let [n = "", r] = gi(e).split("?");
1897
- if (!n.endsWith(".tsx") || r !== void 0 && pi.test(r)) return !1;
1898
- let i = gi(t).replace(/\/$/, "");
1899
- return n.startsWith(`${i}/`) ? o.test(n) || a.has(n.slice(n.lastIndexOf("/") + 1)) : !1;
1900
- }, vi = (e, t, n) => _i(t, n) ? `${e}${hi(gi(t).split("?")[0] ?? t)}` : null, yi = (e) => ({
1804
+ } from '${vi}'
1805
+ `, Ci = (e) => e.replace(/\\/g, "/"), wi = (e, t) => {
1806
+ let [n = "", r] = Ci(e).split("?");
1807
+ if (!n.endsWith(".tsx") || r !== void 0 && bi.test(r)) return !1;
1808
+ let i = Ci(t).replace(/\/$/, "");
1809
+ return n.startsWith(`${i}/`) ? s.test(n) || a.has(n.slice(n.lastIndexOf("/") + 1)) : !1;
1810
+ }, Ti = (e, t, n) => wi(t, n) ? `${e}${Si(Ci(t).split("?")[0] ?? t)}` : null, Ei = (e) => ({
1901
1811
  name: "voltro:route-fast-refresh",
1902
1812
  enforce: "pre",
1903
- resolveId: (e) => e === "virtual:voltro-route-refresh" ? fi : void 0,
1904
- load: (e) => e === fi ? mi() : void 0,
1813
+ resolveId: (e) => e === "virtual:voltro-route-refresh" ? yi : void 0,
1814
+ load: (e) => e === yi ? xi() : void 0,
1905
1815
  transform: (t, n, r) => {
1906
1816
  if (r?.ssr === !0) return null;
1907
- let i = vi(t, n, e);
1817
+ let i = Ti(t, n, e);
1908
1818
  return i === null ? null : {
1909
1819
  code: i,
1910
1820
  map: null
1911
1821
  };
1912
1822
  }
1913
- }), bi = K({ scope: "voltro:dashboard" }), xi = q(import.meta.url), Si = 5179, Ci = (e) => {
1823
+ }), Di = G({ scope: "voltro:dashboard" }), Oi = ye(import.meta.url), ki = 5179, Ai = (e) => {
1914
1824
  let t = process.env.VOLTRO_DASHBOARD_PATH;
1915
- if (t && B(I(R(t), "app.config.ts"))) return R(t);
1825
+ if (t && z(F(L(t), "app.config.ts"))) return L(t);
1916
1826
  try {
1917
- let e = F(xi.resolve("@voltro/dashboard/package.json"));
1918
- if (B(I(e, "app.config.ts"))) return e;
1827
+ let e = P(Oi.resolve("@voltro/dashboard/package.json"));
1828
+ if (z(F(e, "app.config.ts"))) return e;
1919
1829
  } catch {}
1920
- let n = I("voltro-devtools", "apps", "dashboard"), r = R(e);
1830
+ let n = F("voltro-devtools", "apps", "dashboard"), r = L(e);
1921
1831
  for (let e = 0; e < 10; e++) {
1922
- let e = I(r, n);
1923
- if (B(I(e, "app.config.ts"))) return e;
1924
- let t = F(r);
1832
+ let e = F(r, n);
1833
+ if (z(F(e, "app.config.ts"))) return e;
1834
+ let t = P(r);
1925
1835
  if (t === r) break;
1926
1836
  r = t;
1927
1837
  }
1928
1838
  return null;
1929
- }, wi = "VOLTRO_IS_DASHBOARD", Ti = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1930
- let i = Ne({
1839
+ }, ji = "VOLTRO_IS_DASHBOARD", Mi = (e, t = "127.0.0.1", n = 250) => new Promise((r) => {
1840
+ let i = Y({
1931
1841
  port: e,
1932
1842
  host: t
1933
1843
  }), a = !1, o = (e) => {
1934
1844
  a || (a = !0, i.destroy(), r(e));
1935
1845
  };
1936
1846
  i.once("connect", () => o(!0)), i.once("error", () => o(!1)), setTimeout(() => o(!1), n);
1937
- }), Ei = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), Di = () => process.env[wi] === "1", Oi = () => process.stdout.isTTY === !0, ki = I(he(), ".voltro", "dashboard-launch.lock"), Ai = 1e4, ji = async () => {
1847
+ }), Ni = () => !!(process.env.VOLTRO_DASHBOARD === "off" || process.argv.includes("--disable-dashboard")), Pi = () => process.env[ji] === "1", Fi = () => process.stdout.isTTY === !0, Ii = F(we(), ".voltro", "dashboard-launch.lock"), Li = 1e4, Ri = async () => {
1938
1848
  try {
1939
- await V.mkdir(F(ki), { recursive: !0 });
1940
- let e = await V.open(ki, "wx");
1849
+ await B.mkdir(P(Ii), { recursive: !0 });
1850
+ let e = await B.open(Ii, "wx");
1941
1851
  return await e.write(`${process.pid}\n${Date.now()}\n`), await e.close(), !0;
1942
1852
  } catch {
1943
1853
  try {
1944
- let e = await V.stat(ki);
1945
- if (Date.now() - e.mtimeMs > Ai) return await V.unlink(ki).catch(() => void 0), ji();
1854
+ let e = await B.stat(Ii);
1855
+ if (Date.now() - e.mtimeMs > Li) return await B.unlink(Ii).catch(() => void 0), Ri();
1946
1856
  } catch {}
1947
1857
  return !1;
1948
1858
  }
1949
- }, Mi = async () => {
1859
+ }, zi = async () => {
1950
1860
  try {
1951
- await V.unlink(ki);
1861
+ await B.unlink(Ii);
1952
1862
  } catch {}
1953
- }, Ni = async (e) => {
1863
+ }, Bi = async (e) => {
1954
1864
  let t = e.port ?? 5179;
1955
- if (Ei()) return {
1865
+ if (Ni()) return {
1956
1866
  status: "skipped",
1957
1867
  reason: "disabled by flag/env",
1958
1868
  port: t
1959
1869
  };
1960
- if (Di()) return {
1870
+ if (Pi()) return {
1961
1871
  status: "skipped",
1962
1872
  reason: "this process IS the dashboard",
1963
1873
  port: t
1964
1874
  };
1965
- if (!Oi()) return {
1875
+ if (!Fi()) return {
1966
1876
  status: "skipped",
1967
1877
  reason: "stdout is not a TTY (CI/smoke)",
1968
1878
  port: t
1969
1879
  };
1970
- if (!await ji()) return {
1880
+ if (!await Ri()) return {
1971
1881
  status: "skipped",
1972
1882
  reason: "another voltro process is currently launching the dashboard",
1973
1883
  port: t
1974
1884
  };
1975
- if (await Ti(t)) return await Mi(), {
1885
+ if (await Mi(t)) return await zi(), {
1976
1886
  status: "already-running",
1977
1887
  port: t
1978
1888
  };
1979
1889
  let n = e.voltroBin;
1980
1890
  if (!n) {
1981
1891
  let e = process.argv[1];
1982
- n = e && e.endsWith("/src/bin.ts") ? I(F(e), "..", "bin", "voltro.mjs") : e ?? "voltro";
1892
+ n = e && e.endsWith("/src/bin.ts") ? F(P(e), "..", "bin", "voltro.mjs") : e ?? "voltro";
1983
1893
  }
1984
- let r = I(e.dashboardAppPath, ".framework", "dist", "index.html"), i = B(r), a = i ? "start" : "dev", o = Me(process.execPath, [
1894
+ let r = F(e.dashboardAppPath, ".framework", "dist", "index.html"), i = z(r), a = i ? "start" : "dev", o = ze(process.execPath, [
1985
1895
  n,
1986
1896
  a,
1987
1897
  e.dashboardAppPath
@@ -1989,7 +1899,7 @@ import {
1989
1899
  stdio: "ignore",
1990
1900
  env: {
1991
1901
  ...process.env,
1992
- [wi]: "1",
1902
+ [ji]: "1",
1993
1903
  VOLTRO_DASHBOARD_PORT: String(t)
1994
1904
  }
1995
1905
  });
@@ -1997,19 +1907,121 @@ import {
1997
1907
  if (o.exitCode === null && o.signalCode === null) try {
1998
1908
  o.kill("SIGTERM");
1999
1909
  } catch {}
2000
- }), bi.info(`auto-launching dashboard at http://localhost:${t}`, {
1910
+ }), Di.info(`auto-launching dashboard at http://localhost:${t}`, {
2001
1911
  port: t,
2002
1912
  mode: a,
2003
1913
  prebuilt: i
2004
- }), i || bi.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), bi.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
2005
- Mi();
1914
+ }), i || Di.debug("no pre-built dashboard — running `voltro dev`. Build with `cd voltro-devtools && pnpm build` for a fast prod boot."), Di.debug("disable via --disable-dashboard or VOLTRO_DASHBOARD=off"), setTimeout(() => {
1915
+ zi();
2006
1916
  }, 4e3).unref(), {
2007
1917
  status: "launched",
2008
1918
  port: t
2009
1919
  };
2010
- }, Pi = /Could not find required `intl` object/, Fi = "__voltro_i18n_instances__", Ii = (e = globalThis) => {
1920
+ }, Vi = class extends Error {
1921
+ _voltroDeferral = !0;
1922
+ constructor(e) {
1923
+ super(e), this.name = "DeferralNotSupportedError";
1924
+ }
1925
+ }, Hi = (e) => typeof e == "object" && !!e && e._voltroDeferral === !0, Ui = (e) => {
1926
+ if (!(e instanceof Error)) return;
1927
+ let t = e._voltroControl;
1928
+ if (t === "redirect") {
1929
+ let { location: t, status: n } = e;
1930
+ return typeof t == "string" ? {
1931
+ status: n === 307 || n === 308 ? n : 303,
1932
+ headers: {
1933
+ location: t,
1934
+ "x-voltro-rendered-by": "loader-redirect"
1935
+ },
1936
+ body: ""
1937
+ } : void 0;
1938
+ }
1939
+ if (t === "not-found") return {
1940
+ status: 404,
1941
+ headers: {
1942
+ "content-type": "text/plain; charset=utf-8",
1943
+ "x-voltro-rendered-by": "loader-not-found"
1944
+ },
1945
+ body: "not found"
1946
+ };
1947
+ }, Wi = (e) => {
1948
+ let { helpers: t } = e, n = t.prepareDeferredLoaderData(e.loaderData, "page"), r = {}, i = {}, a = {};
1949
+ for (let [n, o] of Object.entries(e.segmentLoaderData)) {
1950
+ let e = Number(n), s = t.prepareDeferredLoaderData(o, e);
1951
+ r[e] = s.renderData, i[e] = s.stateData, s.deferredIds && (a[e] = s.deferredIds);
1952
+ }
1953
+ let o = n.deferredIds !== void 0 || Object.keys(a).length > 0;
1954
+ if (o) try {
1955
+ t.assertDeferralSupported({
1956
+ page: e.page,
1957
+ renderMode: e.renderMode,
1958
+ interactive: e.interactive,
1959
+ ...e.layoutShell ? { layoutShell: e.layoutShell } : {},
1960
+ ...e.ppr === !0 ? { ppr: !0 } : {}
1961
+ });
1962
+ } catch (e) {
1963
+ throw new Vi(e instanceof Error ? e.message : String(e));
1964
+ }
1965
+ return {
1966
+ loaderData: n.renderData,
1967
+ segmentLoaderData: r,
1968
+ hasDeferred: o,
1969
+ stateInput: {
1970
+ path: e.pathname,
1971
+ loaderData: n.stateData,
1972
+ segmentLoaderData: i,
1973
+ pageLoaderRan: e.pageLoaderRan,
1974
+ ...e.layoutShell ? { pageClientOnly: !0 } : {},
1975
+ ...n.deferredIds ? { deferredPageIds: n.deferredIds } : {},
1976
+ ...Object.keys(a).length > 0 ? { deferredSegmentIds: a } : {}
1977
+ }
1978
+ };
1979
+ }, Gi = (e) => {
1980
+ let { helpers: t, renderInput: n } = e, r = Wi({
1981
+ helpers: t,
1982
+ page: e.page,
1983
+ pathname: n.pathname,
1984
+ renderMode: "spa",
1985
+ interactive: e.interactive,
1986
+ loaderData: null,
1987
+ segmentLoaderData: n.segmentLoaderData ?? {},
1988
+ pageLoaderRan: !1,
1989
+ layoutShell: e.delivery
1990
+ });
1991
+ return {
1992
+ renderInput: {
1993
+ ...n,
1994
+ pageSlot: !0,
1995
+ loaderData: null,
1996
+ segmentLoaderData: r.segmentLoaderData
1997
+ },
1998
+ stateScript: t.renderRouterStateScript(r.stateInput),
1999
+ hasDeferred: r.hasDeferred
2000
+ };
2001
+ }, Ki = (e) => {
2002
+ let { html: t, meta: n } = e.helpers.renderPageToHtml(e.prepared.renderInput);
2003
+ return {
2004
+ body: t,
2005
+ meta: n
2006
+ };
2007
+ }, qi = (e) => [
2008
+ ...e.extra ?? [],
2009
+ e.helpers.renderMetaToHtml(e.meta),
2010
+ `<meta name="voltro-interactive" content="${e.interactive}" />`,
2011
+ ...e.prepared.hasDeferred ? [e.helpers.renderDeferredRegistryScript()] : [],
2012
+ e.prepared.stateScript
2013
+ ].filter((e) => e.length > 0).join("\n "), Ji = (e) => {
2014
+ let t = e.indexOf("?");
2015
+ return t === -1 ? {
2016
+ pathname: e || "/",
2017
+ search: ""
2018
+ } : {
2019
+ pathname: e.slice(0, t) || "/",
2020
+ search: e.slice(t)
2021
+ };
2022
+ }, Yi = /Could not find required `intl` object/, Xi = "__voltro_i18n_instances__", Zi = (e = globalThis) => {
2011
2023
  try {
2012
- let t = e[Fi]?.records;
2024
+ let t = e[Xi]?.records;
2013
2025
  return t === void 0 || t.length === 0 ? void 0 : {
2014
2026
  instances: t.length,
2015
2027
  reactIntlCopies: new Set(t.map((e) => e.intlProvider)).size,
@@ -2018,7 +2030,7 @@ import {
2018
2030
  } catch {
2019
2031
  return;
2020
2032
  }
2021
- }, Li = (e, t) => [
2033
+ }, Qi = (e, t) => [
2022
2034
  "",
2023
2035
  "── voltro diagnosis ───────────────────────────────────────────────────",
2024
2036
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -2036,7 +2048,7 @@ import {
2036
2048
  " versions on disk; this counts instances in the running process, and one",
2037
2049
  " file loaded down two paths is two instances.",
2038
2050
  "───────────────────────────────────────────────────────────────────────"
2039
- ].join("\n"), Ri = (e, t) => [
2051
+ ].join("\n"), $i = (e, t) => [
2040
2052
  "",
2041
2053
  "── voltro diagnosis ───────────────────────────────────────────────────",
2042
2054
  `${e} DID wrap this render in <I18nProvider>, and this process`,
@@ -2052,7 +2064,7 @@ import {
2052
2064
  " direct import can land on a second copy that this count does not see —",
2053
2065
  " it counts what @voltro/i18n is bound to.",
2054
2066
  "───────────────────────────────────────────────────────────────────────"
2055
- ].join("\n"), zi = (e) => [
2067
+ ].join("\n"), ea = (e) => [
2056
2068
  "",
2057
2069
  "── voltro diagnosis ───────────────────────────────────────────────────",
2058
2070
  `${e} DID wrap this render in <I18nProvider> — the framework`,
@@ -2068,40 +2080,45 @@ import {
2068
2080
  " Do NOT use `pnpm ls` to rule that out: it lists versions on disk, and",
2069
2081
  " the duplication here is of module instances in one process.",
2070
2082
  "───────────────────────────────────────────────────────────────────────"
2071
- ].join("\n"), Bi = (e, t, n, r = Ii()) => {
2083
+ ].join("\n"), ta = (e, t, n, r = Zi()) => {
2072
2084
  if (!t) return;
2073
2085
  let i = String(e?.message ?? e);
2074
- if (Pi.test(i)) return r === void 0 ? zi(n) : r.reactIntlCopies > 1 || r.instances > 1 ? Li(n, r) : Ri(n, r);
2075
- }, Vi = "<div id=\"root\"></div>", Hi = "<div id=\"root\">", Ui = "</div>", Wi = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, Gi = /\bsrc=["']([^"']+)["']/i, Ki = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, qi = (e) => {
2076
- let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(Wi, (e) => {
2077
- let r = Gi.exec(e)?.[1];
2086
+ if (Yi.test(i)) return r === void 0 ? ea(n) : r.reactIntlCopies > 1 || r.instances > 1 ? Qi(n, r) : $i(n, r);
2087
+ }, na = "<div id=\"root\"></div>", ra = "<div id=\"root\">", ia = "</div>", aa = /<script\b[^>]*\btype=["']module["'][^>]*><\/script>[ \t]*\n?/gi, oa = /\bsrc=["']([^"']+)["']/i, sa = /<script(?![^>]*\basync\b)([^>]*\btype=["']module["'][^>]*)>/gi, ca = (e) => {
2088
+ let t = e.keepScriptInHead ?? ((e) => e.startsWith("/@")), n = [], r = e.shell.replace(aa, (e) => {
2089
+ let r = oa.exec(e)?.[1];
2078
2090
  return r === void 0 || t(r) ? e : (n.push(r), "");
2079
2091
  });
2080
- e.inlineModuleScriptsAsync && (r = r.replace(Ki, "<script async$1>"));
2081
- let i = r.indexOf(Vi);
2082
- if (i === -1) throw Error(`[voltro] the generated shell has no \`${Vi}\` element, so a streamed response cannot be split around the page body. This is a framework bug unless the app overrode \`.framework/index.html\` by hand.`);
2092
+ e.inlineModuleScriptsAsync && (r = r.replace(sa, "<script async$1>"));
2093
+ let i = r.indexOf(na);
2094
+ if (i === -1) throw Error(`[voltro] the generated shell has no \`${na}\` element, so a streamed response cannot be split around the page body. This is a framework bug unless the app overrode \`.framework/index.html\` by hand.`);
2083
2095
  return {
2084
- head: `${r.slice(0, i)}${Hi}`,
2085
- tail: `${Ui}${r.slice(i + 21)}`,
2096
+ head: `${r.slice(0, i)}${ra}`,
2097
+ tail: `${ia}${r.slice(i + 21)}`,
2086
2098
  bootstrapModules: n
2087
2099
  };
2088
- }, Ji = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), Yi = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Xi = (e, t) => {
2089
- let n = [t.timeZone === void 0 ? "" : ` data-voltro-tz="${Yi(t.timeZone)}"`, t.renderedAt === void 0 ? "" : ` data-voltro-now="${t.renderedAt}"`].join("");
2090
- return e.replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${Yi(t.lang)}"${n}`);
2091
- }, Zi = (e) => Xi(Ji(e.head, e.headInjection), e.documentAttrs), Qi = (e) => {
2100
+ }, la = (e, t) => (/<title>/i.test(t) ? e.replace(/[^\S\n]*<title>[\s\S]*?<\/title>\n?/i, "") : e).replace("</head>", ` ${t}\n </head>`), ua = (e, t) => {
2101
+ let n = t.replace(/[^A-Za-z0-9+/=_-]/g, "");
2102
+ return e.replace(/<script(?![^>]*\snonce\s*=)/gi, `<script nonce="${n}"`);
2103
+ }, da = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), fa = (e, t) => {
2104
+ let n = [t.timeZone === void 0 ? "" : ` data-voltro-tz="${da(t.timeZone)}"`, t.renderedAt === void 0 ? "" : ` data-voltro-now="${t.renderedAt}"`].join("");
2105
+ return e.replace(/<html(\s+lang="[^"]*")?/i, `<html lang="${da(t.lang)}"${n}`);
2106
+ }, pa = (e) => fa(la(e.head, e.headInjection), e.documentAttrs), ma = (e) => {
2092
2107
  let { res: t, shell: n, documentAttrs: r, headInjection: i } = e, a = null, o = !1, s = !1, c = () => {
2093
2108
  if (s || !o || a === null) return;
2094
2109
  s = !0, t.statusCode = e.statusCode ?? 200;
2095
2110
  for (let [n, r] of Object.entries(e.headers ?? {})) t.setHeader(n, r);
2096
- t.flushHeaders?.(), t.write(Zi({
2111
+ t.flushHeaders?.();
2112
+ let c = pa({
2097
2113
  head: n.head,
2098
2114
  headInjection: i(a.meta),
2099
2115
  documentAttrs: r
2100
- }));
2101
- let c = new Je();
2102
- c.pipe(t, { end: !1 }), c.on("end", () => {
2116
+ });
2117
+ t.write(e.nonce === void 0 ? c : ua(c, e.nonce));
2118
+ let l = new nt();
2119
+ l.pipe(t, { end: !1 }), l.on("end", () => {
2103
2120
  t.end(n.tail);
2104
- }), a.stream.pipe(c);
2121
+ }), a.stream.pipe(l);
2105
2122
  }, l = () => {
2106
2123
  a?.stream.abort();
2107
2124
  };
@@ -2123,16 +2140,16 @@ import {
2123
2140
  return;
2124
2141
  }
2125
2142
  c();
2126
- }, $i = (e) => Array.isArray(e.preload) && e.preload.length > 0, ea = (e, t) => typeof e == "string" ? {
2143
+ }, ha = (e) => Array.isArray(e.preload) && e.preload.length > 0, ga = (e, t) => typeof e == "string" ? {
2127
2144
  tag: e,
2128
2145
  input: {}
2129
2146
  } : {
2130
2147
  tag: e.tag,
2131
2148
  input: e.input?.(t) ?? {}
2132
- }, ta = async (e) => {
2149
+ }, _a = async (e) => {
2133
2150
  let { pageMod: t, params: n, query: r, apiName: i, seed: a, seedFailure: o, onError: s } = e;
2134
- if ($i(t) && r !== void 0 && i !== void 0) for (let e of t.preload) {
2135
- let { tag: t, input: c } = ea(e, n);
2151
+ if (ha(t) && r !== void 0 && i !== void 0) for (let e of t.preload) {
2152
+ let { tag: t, input: c } = ga(e, n);
2136
2153
  try {
2137
2154
  a(i, t, c, await r(t, c));
2138
2155
  } catch (e) {
@@ -2142,62 +2159,62 @@ import {
2142
2159
  }, e);
2143
2160
  }
2144
2161
  }
2145
- }, na = (e) => l.test(e) || e.endsWith(".workflow.server.tsx") ? !1 : i.test(e) || c.test(e) || s.test(e), ra = /* @__PURE__ */ new Set([
2162
+ }, va = (e) => l.test(e) || e.endsWith(".workflow.server.tsx") ? !1 : c.test(e) || o.test(e) || i.test(e), ya = /* @__PURE__ */ new Set([
2146
2163
  "node_modules",
2147
2164
  "dist",
2148
2165
  ".framework",
2149
2166
  ".git"
2150
- ]), ia = async (e) => {
2167
+ ]), ba = async (e) => {
2151
2168
  let t = [], n = async (e) => {
2152
2169
  let r;
2153
2170
  try {
2154
- r = await V.readdir(e, { withFileTypes: !0 });
2171
+ r = await B.readdir(e, { withFileTypes: !0 });
2155
2172
  } catch {
2156
2173
  return;
2157
2174
  }
2158
2175
  for (let i of r) if (!(i.name.startsWith(".") && i.isDirectory())) {
2159
2176
  if (i.isDirectory()) {
2160
- if (ra.has(i.name)) continue;
2161
- await n(I(e, i.name));
2162
- } else na(i.name) && t.push(I(e, i.name));
2177
+ if (ya.has(i.name)) continue;
2178
+ await n(F(e, i.name));
2179
+ } else va(i.name) && t.push(F(e, i.name));
2163
2180
  }
2164
2181
  };
2165
2182
  return await n(e), t.sort();
2166
- }, aa = async (e) => {
2167
- let t = Oe("sha1");
2168
- for (let n of await ia(e)) {
2183
+ }, xa = async (e) => {
2184
+ let t = J("sha1");
2185
+ for (let n of await ba(e)) {
2169
2186
  t.update(n.slice(e.length)), t.update("\0");
2170
2187
  try {
2171
- t.update(await V.readFile(n));
2188
+ t.update(await B.readFile(n));
2172
2189
  } catch {}
2173
2190
  t.update("\0");
2174
2191
  }
2175
2192
  try {
2176
- t.update(await V.readFile(I(e, "rpcGroup.generated.ts")));
2193
+ t.update(await B.readFile(F(e, "rpcGroup.generated.ts")));
2177
2194
  } catch {}
2178
2195
  return t.digest("hex");
2179
- }, oa = async (e) => {
2196
+ }, Sa = async (e) => {
2180
2197
  if (e.length === 0) return;
2181
2198
  let t = [];
2182
- for (let n of [...e].sort()) t.push(await aa(n));
2183
- return Oe("sha1").update(t.join("\0")).digest("hex");
2184
- }, sa = (e) => typeof e == "object" && !!e && e._tag === "VoltroMiddleware" && typeof e.run == "function", ca = ["middleware.ts", "middleware.tsx"], la = (e) => {
2199
+ for (let n of [...e].sort()) t.push(await xa(n));
2200
+ return J("sha1").update(t.join("\0")).digest("hex");
2201
+ }, Ca = (e) => typeof e == "object" && !!e && e._tag === "VoltroMiddleware" && typeof e.run == "function", wa = ["middleware.ts", "middleware.tsx"], Ta = (e) => {
2185
2202
  let t = e.replace(/\/+$/, "");
2186
2203
  return t === "" ? "/" : t;
2187
2204
  }, Z = (e, t) => {
2188
- let n = la(e);
2205
+ let n = Ta(e);
2189
2206
  if (n === "/") return !0;
2190
- let r = la(t);
2207
+ let r = Ta(t);
2191
2208
  return r === n || r.startsWith(`${n}/`);
2192
- }, ua = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, da = (e, t) => {
2209
+ }, Ea = (e) => e === void 0 ? [] : typeof e == "string" ? [e] : e, Da = (e, t) => {
2193
2210
  if (e === void 0) return !0;
2194
- let n = ua(e.under), r = e.routes ?? [];
2211
+ let n = Ea(e.under), r = e.routes ?? [];
2195
2212
  return n.length === 0 && r.length === 0 || r.includes(t) || n.some((e) => Z(e, t)) ? !(e.except ?? []).some((e) => e === t || Z(e, t)) : !1;
2196
- }, fa = (e) => {
2213
+ }, Oa = (e) => {
2197
2214
  if (e?.assets !== !0) return [];
2198
- let t = ua(e.under);
2215
+ let t = Ea(e.under);
2199
2216
  return t.length > 0 ? t : (e.routes ?? []).length > 0 ? [] : ["/"];
2200
- }, pa = (e, t) => fa(e).some((e) => Z(e, t)) ? !(e?.except ?? []).some((e) => Z(e, t)) : !1, ma = (e, t) => e.find(({ middleware: e }) => t.route === void 0 ? pa(e.match, t.pathname) : da(e.match, t.route))?.middleware, ha = (e, t) => {
2217
+ }, ka = (e, t) => Oa(e).some((e) => Z(e, t)) ? !(e?.except ?? []).some((e) => Z(e, t)) : !1, Aa = (e, t) => e.find(({ middleware: e }) => t.route === void 0 ? ka(e.match, t.pathname) : Da(e.match, t.route))?.middleware, ja = (e, t) => {
2201
2218
  let n = [];
2202
2219
  for (let { exportName: r, middleware: i } of e) {
2203
2220
  let e = i.match;
@@ -2205,13 +2222,13 @@ import {
2205
2222
  kind: "dead-matcher",
2206
2223
  message: `\`${r}\` matches routes: ['${i}'], which is not a route in this app. Route patterns are spelled as the router spells them, e.g. \`/notes/[id]\`.`
2207
2224
  });
2208
- if (e?.assets !== !0) for (let [i, a] of [["under", ua(e?.under)], ["except", e?.except ?? []]]) for (let e of a) t.some((t) => Z(e, t)) || n.push({
2225
+ if (e?.assets !== !0) for (let [i, a] of [["under", Ea(e?.under)], ["except", e?.except ?? []]]) for (let e of a) t.some((t) => Z(e, t)) || n.push({
2209
2226
  kind: "dead-matcher",
2210
2227
  message: `\`${r}\` matches ${i}: ['${e}'], which covers no route in this app. ` + (i === "except" ? "An `except` that excludes nothing is a rule that reads as active and is not." : "Add `assets: true` if you meant a path the router does not serve.")
2211
2228
  });
2212
2229
  }
2213
2230
  for (let r = 0; r < e.length; r += 1) for (let i = r + 1; i < e.length; i += 1) {
2214
- let a = e[r], o = e[i], s = t.find((e) => da(a.middleware.match, e) && da(o.middleware.match, e));
2231
+ let a = e[r], o = e[i], s = t.find((e) => Da(a.middleware.match, e) && Da(o.middleware.match, e));
2215
2232
  if (s !== void 0) {
2216
2233
  n.push({
2217
2234
  kind: "overlap",
@@ -2220,7 +2237,7 @@ import {
2220
2237
  continue;
2221
2238
  }
2222
2239
  {
2223
- let e = fa(a.middleware.match), t = fa(o.middleware.match), r = e.some((e) => t.some((t) => Z(e, t) || Z(t, e))), i = (a.middleware.match?.except ?? []).some((e) => t.length > 0 && t.every((t) => Z(e, t))) || (o.middleware.match?.except ?? []).some((t) => e.length > 0 && e.every((e) => Z(t, e)));
2240
+ let e = Oa(a.middleware.match), t = Oa(o.middleware.match), r = e.some((e) => t.some((t) => Z(e, t) || Z(t, e))), i = (a.middleware.match?.except ?? []).some((e) => t.length > 0 && t.every((t) => Z(e, t))) || (o.middleware.match?.except ?? []).some((t) => e.length > 0 && e.every((e) => Z(t, e)));
2224
2241
  r && !i && n.push({
2225
2242
  kind: "overlap",
2226
2243
  message: `\`${a.exportName}\` and \`${o.exportName}\` both declare \`assets: true\` over overlapping paths. A non-page request would match both, and there is no route to tell them apart.`
@@ -2228,10 +2245,10 @@ import {
2228
2245
  }
2229
2246
  }
2230
2247
  return n;
2231
- }, ga = (e, t) => {
2232
- let r = ha(e, t);
2248
+ }, Ma = (e, t) => {
2249
+ let r = ja(e, t);
2233
2250
  if (r.length !== 0) throw n(`middleware.ts: ${r.length} problem(s)\n\n` + r.map((e) => ` • ${e.message}`).join("\n\n"));
2234
- }, _a = (e) => {
2251
+ }, Na = (e) => {
2235
2252
  let t = {};
2236
2253
  if (!e) return t;
2237
2254
  for (let n of e.split(";")) {
@@ -2245,20 +2262,20 @@ import {
2245
2262
  }
2246
2263
  }
2247
2264
  return t;
2248
- }, va = (e) => Object.entries(e).map(([e, t]) => `${e}=${encodeURIComponent(t)}`).join("; "), ya = /(^|[-_.])(auth[-_.]?token|session|access[-_.]?token)([-_.]|$)|^sb-.*-auth-token$/i, ba = (e) => e.httpOnly === void 0 && ya.test(e.name), xa = (e) => {
2265
+ }, Pa = (e) => Object.entries(e).map(([e, t]) => `${e}=${encodeURIComponent(t)}`).join("; "), Fa = /(^|[-_.])(auth[-_.]?token|session|access[-_.]?token)([-_.]|$)|^sb-.*-auth-token$/i, Ia = (e) => e.httpOnly === void 0 && Fa.test(e.name), La = (e) => {
2249
2266
  let t = [`${e.name}=${encodeURIComponent(e.value)}`];
2250
2267
  return t.push(`Path=${e.path ?? "/"}`), e.maxAge !== void 0 && t.push(`Max-Age=${Math.trunc(e.maxAge)}`), e.httpOnly !== !1 && t.push("HttpOnly"), e.secure === !0 && t.push("Secure"), t.push(`SameSite=${e.sameSite ?? "lax"}`), t.join("; ");
2251
- }, Sa = (e) => e.length === 0 ? {} : { "set-cookie": e.map(xa) }, Ca = async (e, t = (e) => import(G(e).href)) => {
2252
- for (let r of ca) {
2268
+ }, Ra = (e) => e.length === 0 ? {} : { "set-cookie": e.map(La) }, za = async (e, t = (e) => import(me(e).href)) => {
2269
+ for (let r of wa) {
2253
2270
  let i;
2254
2271
  try {
2255
- i = await t(I(e, r));
2272
+ i = await t(F(e, r));
2256
2273
  } catch (e) {
2257
2274
  let t = e?.code;
2258
2275
  if (t === "ERR_MODULE_NOT_FOUND" || t === "MODULE_NOT_FOUND") continue;
2259
2276
  throw e;
2260
2277
  }
2261
- let a = Object.entries(i ?? {}), o = a.filter((e) => sa(e[1])).map(([e, t]) => ({
2278
+ let a = Object.entries(i ?? {}), o = a.filter((e) => Ca(e[1])).map(([e, t]) => ({
2262
2279
  exportName: e,
2263
2280
  middleware: t
2264
2281
  }));
@@ -2276,7 +2293,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2276
2293
  return o;
2277
2294
  }
2278
2295
  return [];
2279
- }, wa = async (e, t, n) => {
2296
+ }, Ba = async (e, t, n) => {
2280
2297
  let r = {
2281
2298
  headers: t.headers,
2282
2299
  cookies: t.cookies,
@@ -2287,7 +2304,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2287
2304
  let i = await e.run(t);
2288
2305
  if (!i) return r;
2289
2306
  let a = i.setCookies ?? [];
2290
- if (n !== void 0) for (let e of a) ba(e) && n(e);
2307
+ if (n !== void 0) for (let e of a) Ia(e) && n(e);
2291
2308
  let o = i.headers ? {
2292
2309
  ...t.headers,
2293
2310
  ...i.headers
@@ -2301,25 +2318,25 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2301
2318
  };
2302
2319
  let l = { ...t.cookies };
2303
2320
  for (let e of a) e.maxAge !== void 0 && e.maxAge <= 0 ? delete l[e.name] : l[e.name] = e.value;
2304
- return i.headers?.cookie === void 0 && (o.cookie = va(l)), {
2321
+ return i.headers?.cookie === void 0 && (o.cookie = Pa(l)), {
2305
2322
  headers: o,
2306
2323
  cookies: l,
2307
2324
  setCookies: a,
2308
2325
  responseHeaders: s,
2309
2326
  ...c
2310
2327
  };
2311
- }, Ta = /* @__PURE__ */ new Set(["voltro:locale"]), Ea = /* @__PURE__ */ new Set(["authorization", "cookie"]), Da = (e) => {
2328
+ }, Va = /* @__PURE__ */ new Set(["voltro:locale"]), Ha = /* @__PURE__ */ new Set(["authorization", "cookie"]), Ua = (e) => {
2312
2329
  let t = e.split(";").map((e) => e.trim()).filter((e) => {
2313
2330
  let t = e.indexOf("="), n = (t === -1 ? e : e.slice(0, t)).trim();
2314
- return Ta.has(n);
2331
+ return Va.has(n);
2315
2332
  });
2316
2333
  return t.length > 0 ? t.join("; ") : void 0;
2317
- }, Oa = (e) => {
2334
+ }, Wa = (e) => {
2318
2335
  let t = {};
2319
2336
  for (let [n, r] of Object.entries(e)) if (!n.startsWith("x-voltro-")) {
2320
- if (Ea.has(n)) {
2337
+ if (Ha.has(n)) {
2321
2338
  if (n === "cookie") {
2322
- let e = Da(r);
2339
+ let e = Ua(r);
2323
2340
  e !== void 0 && (t.cookie = e);
2324
2341
  }
2325
2342
  continue;
@@ -2327,61 +2344,74 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2327
2344
  t[n] = r;
2328
2345
  }
2329
2346
  return t;
2330
- }, ka = (e) => {
2347
+ }, Ga = (e) => {
2331
2348
  let t = {};
2332
- for (let [n, r] of Object.entries(e)) Ta.has(n) && (t[n] = r);
2349
+ for (let [n, r] of Object.entries(e)) Va.has(n) && (t[n] = r);
2333
2350
  return t;
2334
- }, Aa = ["cookie", "authorization"], ja = (e) => Aa.includes(e) || e.startsWith("x-voltro-"), Ma = ["voltro:locale"], Na = class extends Error {
2351
+ }, Ka = ve.exponential({
2352
+ start: .001,
2353
+ factor: 2,
2354
+ count: 16
2355
+ }), qa = _e.counter("voltro_ppr_shell_serves_total", { description: "ppr responses whose cached shell was written, by page." }), Ja = _e.counter("voltro_ppr_hole_passes_total", { description: "ppr per-request hole passes started, by page." }), Ya = _e.counter("voltro_ppr_hole_settles_total", { description: "Deferred ppr holes settled and appended to a response, by page." }), Xa = _e.counter("voltro_ppr_hole_errors_total", { description: "ppr hole passes that failed as a whole (every hole stays on its fallback), by page." }), Za = _e.histogram("voltro_ppr_hole_pass_seconds", Ka, "ppr hole-pass duration in seconds (loader re-run to last hole settled), by page."), Qa = [], $a = /* @__PURE__ */ new Map(), eo = (e) => {
2356
+ let t = $a.get(e);
2357
+ if (t !== void 0) return t;
2358
+ let n = (t) => _e.tagged(t, "page", e), r = {
2359
+ shellServes: n(qa),
2360
+ holePasses: n(Ja),
2361
+ holeSettles: n(Ya),
2362
+ holeErrors: n(Xa),
2363
+ holePassSeconds: n(Za)
2364
+ };
2365
+ return $a.set(e, r), r;
2366
+ }, to = (e) => {
2367
+ eo(e).shellServes.unsafeUpdate(1, Qa);
2368
+ }, no = (e) => {
2369
+ eo(e).holePasses.unsafeUpdate(1, Qa);
2370
+ }, ro = (e) => {
2371
+ eo(e).holeSettles.unsafeUpdate(1, Qa);
2372
+ }, io = (e) => {
2373
+ eo(e).holeErrors.unsafeUpdate(1, Qa);
2374
+ }, ao = (e, t) => {
2375
+ eo(e).holePassSeconds.unsafeUpdate(t / 1e3, Qa);
2376
+ }, oo = ["cookie", "authorization"], so = (e) => oo.includes(e) || e.startsWith("x-voltro-"), co = ["voltro:locale"], lo = class extends Error {
2335
2377
  constructor(e, t, n) {
2336
2378
  super(`[voltro] ppr page '${n}': the SHELL render read the ${e} '${t}'. A ppr shell is CACHED and served to every visitor, so it must be computed without credentials — there is no way to prove request-independence by inspection, so the read itself is the error. Move this read into a deferred hole (the second argument of defer(), which runs per request with the full context), or drop ppr and use renderMode 'ssr'.`), this.name = "PprShellCredentialAccessError";
2337
2379
  }
2338
- }, Pa = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2339
- if (typeof n == "string" && ja(n)) throw new Na("header", n, t);
2380
+ }, uo = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2381
+ if (typeof n == "string" && so(n)) throw new lo("header", n, t);
2340
2382
  return Reflect.get(e, n, r);
2341
- } }), Fa = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2342
- if (typeof n == "string" && !Ma.includes(n) && !(n in Object.prototype)) throw new Na("cookie", n, t);
2383
+ } }), fo = (e, t) => new Proxy({ ...e }, { get(e, n, r) {
2384
+ if (typeof n == "string" && !co.includes(n) && !(n in Object.prototype)) throw new lo("cookie", n, t);
2343
2385
  return Reflect.get(e, n, r);
2344
- } }), Ia = Symbol.for("@voltro/cli/ppr:metrics"), La = () => {
2345
- let e = globalThis;
2346
- return e[Ia] ??= {
2347
- shellServes: 0,
2348
- holePasses: 0,
2349
- holeSettles: 0,
2350
- holeErrors: 0,
2351
- holeLatencyMsLast: 0,
2352
- holeLatencyMsMax: 0
2353
- };
2354
- }, Ra = async (e) => {
2355
- let t = La();
2356
- t.holePasses += 1;
2357
- let n = Date.now(), r = () => e.res.destroyed === !0 || e.res.writableEnded === !0;
2386
+ } }), po = async (e) => {
2387
+ no(e.page);
2388
+ let t = Date.now(), n = () => e.res.destroyed === !0 || e.res.writableEnded === !0;
2358
2389
  try {
2359
- let n = await e.loader(e.ctx), i = e.helpers.prepareDeferredLoaderData(n, "page"), a = i.deferredIds;
2360
- if (a === void 0) {
2361
- r() || e.res.end();
2390
+ let t = await e.loader(e.ctx), r = e.helpers.prepareDeferredLoaderData(t, "page"), i = r.deferredIds;
2391
+ if (i === void 0) {
2392
+ n() || e.res.end();
2362
2393
  return;
2363
2394
  }
2364
- let o = i.renderData;
2365
- await Promise.all(Object.entries(a).map(async ([n, i]) => {
2366
- let a = await o[n];
2367
- t.holeSettles += 1, !r() && e.res.write(`<script>${e.helpers.deferredSettleScript(i, a)}<\/script>`);
2395
+ let a = r.renderData;
2396
+ await Promise.all(Object.entries(i).map(async ([t, r]) => {
2397
+ let i = await a[t];
2398
+ ro(e.page), !n() && e.res.write(`<script>${e.helpers.deferredSettleScript(r, i)}<\/script>`);
2368
2399
  }));
2369
- } catch (n) {
2370
- t.holeErrors += 1, e.log.warn("ppr hole pass failed — holes stay on their fallbacks", { page: e.page }, n);
2400
+ } catch (t) {
2401
+ io(e.page), e.log.warn("ppr hole pass failed — holes stay on their fallbacks", { page: e.page }, t);
2371
2402
  } finally {
2372
- let i = Date.now() - n;
2373
- t.holeLatencyMsLast = i, i > t.holeLatencyMsMax && (t.holeLatencyMsMax = i), r() || e.res.end();
2403
+ ao(e.page, Date.now() - t), n() || e.res.end();
2374
2404
  }
2375
- }, za = (e, t) => {
2405
+ }, mo = (e, t) => {
2376
2406
  if (e.deferredSegmentIds !== void 0) throw Error(`[voltro] ppr page '${t}': a LAYOUT loader in its chain uses defer(). ppr appends holes for the PAGE loader only — move the deferred field into the page loader, or return the value directly from the layout.`);
2377
- }, Q = K({ scope: "voltro:dev:web" }), Ba = K({ scope: "vite" }), Va = await (async () => {
2407
+ }, Q = G({ scope: "voltro:dev:web" }), ho = G({ scope: "vite" }), go = await (async () => {
2378
2408
  try {
2379
- let e = I(F(W(import.meta.url)), "..", "package.json"), t = await V.readFile(e, "utf8");
2409
+ let e = F(P(W(import.meta.url)), "..", "package.json"), t = await B.readFile(e, "utf8");
2380
2410
  return JSON.parse(t).version ?? "0.0.0";
2381
2411
  } catch {
2382
2412
  return "0.0.0";
2383
2413
  }
2384
- })(), Ha = (e, t) => {
2414
+ })(), _o = (e, t) => {
2385
2415
  let n;
2386
2416
  for (let r of e) {
2387
2417
  if (!r.hasNotFound) continue;
@@ -2389,16 +2419,16 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2389
2419
  i !== "/" && !(t === i || t.startsWith(i + "/")) || (n === void 0 || r.dir.length > n.dir.length) && (n = r);
2390
2420
  }
2391
2421
  return n;
2392
- }, Ua = async () => {
2422
+ }, vo = async () => {
2393
2423
  try {
2394
- let e = F(W(import.meta.url)), t = R(e, "..", "..", "devtools");
2395
- if (B(I(t, "package.json"))) return t;
2396
- let n = R(e, "..", "..", "..", "devtools");
2397
- return B(I(n, "package.json")) ? n : null;
2424
+ let e = P(W(import.meta.url)), t = L(e, "..", "..", "devtools");
2425
+ if (z(F(t, "package.json"))) return t;
2426
+ let n = L(e, "..", "..", "..", "devtools");
2427
+ return z(F(n, "package.json")) ? n : null;
2398
2428
  } catch {
2399
2429
  return null;
2400
2430
  }
2401
- }, Wa = (e, t) => e.disableDevtools || !t ? [] : [
2431
+ }, yo = (e, t) => e.disableDevtools || !t ? [] : [
2402
2432
  "",
2403
2433
  "// Dev-only in-page devtools overlay. The `import.meta.env.DEV` guard is a",
2404
2434
  "// compile-time constant, so prod builds strip this whole `if` block — the",
@@ -2408,44 +2438,44 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2408
2438
  " await import('@voltro/devtools/styles.css')",
2409
2439
  " Devtools = (await import('@voltro/devtools')).VoltroDevtools",
2410
2440
  "}"
2411
- ], Ga = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], Ka = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], qa = (e) => e.sentry ? [
2441
+ ], bo = (e, t) => e.disableDevtools || !t ? [] : [" ...(Devtools ? { Devtools } : {}),"], xo = (e) => e.sentry ? ["import { initSentryBrowser } from '@voltro/plugin-sentry/web'"] : [], So = (e) => e.sentry ? [
2412
2442
  "",
2413
2443
  "// Browser-side Sentry (frontend half of the deep integration). Errors +",
2414
2444
  "// browser rpc spans flow to Sentry, sharing the server transactions' trace.",
2415
2445
  `await initSentryBrowser(${JSON.stringify(e.sentry)})`
2416
- ] : [], Ja = (e) => e.env ? ["import './env.public'"] : [], Ya = (e) => {
2417
- let t = [], n = R(e);
2446
+ ] : [], Co = (e) => e.env ? ["import './env.public'"] : [], wo = (e) => {
2447
+ let t = [], n = L(e);
2418
2448
  for (;;) {
2419
- B(I(n, "pnpm-workspace.yaml")) && t.push(n);
2420
- let e = F(n);
2449
+ z(F(n, "pnpm-workspace.yaml")) && t.push(n);
2450
+ let e = P(n);
2421
2451
  if (e === n) break;
2422
2452
  n = e;
2423
2453
  }
2424
2454
  return t;
2425
- }, Xa = P, Za = (e) => {
2455
+ }, To = re, Eo = (e) => {
2426
2456
  if (/\/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(?:react|react-dom|scheduler)\//.test(e)) return "react";
2427
- }, Qa = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, $a = (e) => e.startsWith("(") && e.endsWith(")"), eo = (e) => e.filter((e) => !$a(e)), to = (e) => {
2428
- let t = e.replace(o, "").split("/").filter(Boolean).filter((e) => !$a(e));
2457
+ }, Do = /export\s+(?:async\s+)?(?:const|function|let|var)\s+loader\b/, Oo = (e) => e.startsWith("(") && e.endsWith(")"), ko = (e) => e.filter((e) => !Oo(e)), Ao = (e) => {
2458
+ let t = e.replace(s, "").split("/").filter(Boolean).filter((e) => !Oo(e));
2429
2459
  return t.length === 0 ? "/" : "/" + t.join("/");
2430
- }, no = (e) => `${e.replace(o, "").split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Index"}Page`, $ = (e, t) => e === "" ? `Root${t}` : `${e.split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Root"}${t}`, ro = async (e) => {
2460
+ }, jo = (e) => `${e.replace(s, "").split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Index"}Page`, $ = (e, t) => e === "" ? `Root${t}` : `${e.split("/").filter(Boolean).map((e) => e.replace(/[()]/g, "").replace(/\[\.\.\./g, "_rest_").replace(/[[\]]/g, "_")).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("").replace(/[^A-Za-z0-9_]/g, "_") || "Root"}${t}`, Mo = async (e) => {
2431
2461
  let t = [], n = [], r = async (e, i) => {
2432
- let s = [];
2462
+ let o = [];
2433
2463
  try {
2434
- s = await V.readdir(e, { withFileTypes: !0 });
2464
+ o = await B.readdir(e, { withFileTypes: !0 });
2435
2465
  } catch {
2436
2466
  return;
2437
2467
  }
2438
- let c = s.filter((e) => e.isDirectory()).map((e) => e.name).sort(), l = s.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !Xa(e.name)).map((e) => e.name).sort(), u = new Set(l), d = i.join("/");
2468
+ let c = o.filter((e) => e.isDirectory()).map((e) => e.name).sort(), l = o.filter((e) => e.isFile() && e.name.endsWith(".tsx") && !To(e.name)).map((e) => e.name).sort(), u = new Set(l), d = i.join("/");
2439
2469
  if (l.some((e) => a.has(e))) {
2440
2470
  let t = u.has("layout.tsx"), r = !1;
2441
2471
  if (t) try {
2442
- let t = await V.readFile(I(e, "layout.tsx"), "utf8");
2443
- r = Qa.test(t);
2472
+ let t = await B.readFile(F(e, "layout.tsx"), "utf8");
2473
+ r = Do.test(t);
2444
2474
  } catch {}
2445
2475
  n.push({
2446
2476
  dir: d,
2447
2477
  chain: i,
2448
- contributesToUrl: i.length === 0 || !$a(i[i.length - 1]),
2478
+ contributesToUrl: i.length === 0 || !Oo(i[i.length - 1]),
2449
2479
  hasLayout: t,
2450
2480
  hasLayoutLoader: r,
2451
2481
  hasError: u.has("error.tsx"),
@@ -2455,38 +2485,38 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2455
2485
  });
2456
2486
  }
2457
2487
  for (let e of l) {
2458
- if (!o.test(e)) continue;
2488
+ if (!s.test(e)) continue;
2459
2489
  let n = d ? `${d}/${e}` : e;
2460
2490
  t.push({
2461
2491
  file: n,
2462
- pattern: to(n),
2463
- ident: no(n),
2492
+ pattern: Ao(n),
2493
+ ident: jo(n),
2464
2494
  dirChain: i
2465
2495
  });
2466
2496
  }
2467
- for (let t of c) await r(I(e, t), [...i, t]);
2497
+ for (let t of c) await r(F(e, t), [...i, t]);
2468
2498
  };
2469
2499
  await r(e, []), t.sort((e, t) => e.file < t.file ? -1 : 1);
2470
2500
  let i = /* @__PURE__ */ new Set();
2471
2501
  for (let e of t) for (let t = e.dirChain.length; t >= 0; t--) i.add(e.dirChain.slice(0, t).join("/"));
2472
- let s = [], c = [];
2473
- for (let { specialFiles: e, ...t } of n) i.has(t.dir) ? s.push(t) : c.push({
2502
+ let o = [], c = [];
2503
+ for (let { specialFiles: e, ...t } of n) i.has(t.dir) ? o.push(t) : c.push({
2474
2504
  dir: t.dir,
2475
2505
  files: e
2476
2506
  });
2477
2507
  return {
2478
2508
  pages: t,
2479
- dirs: s,
2509
+ dirs: o,
2480
2510
  orphanedSpecials: c
2481
2511
  };
2482
- }, io = (e, t) => {
2512
+ }, No = (e, t) => {
2483
2513
  let n = [];
2484
2514
  for (let r = 0; r <= t.length; r++) {
2485
2515
  let i = t.slice(0, r).join("/"), a = e.find((e) => e.dir === i);
2486
2516
  a && n.push(a);
2487
2517
  }
2488
2518
  return n;
2489
- }, ao = async (e) => {
2519
+ }, Po = async (e) => {
2490
2520
  let { entries: t, loadLayout: n, loadError: r, loadPending: i, ctx: a } = e, o = {};
2491
2521
  return {
2492
2522
  chain: await Promise.all(t.map(async (e, t) => {
@@ -2510,10 +2540,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2510
2540
  })),
2511
2541
  segmentLoaderData: o
2512
2542
  };
2513
- }, oo = (e) => {
2514
- let t = eo(e);
2543
+ }, Fo = (e) => {
2544
+ let t = ko(e);
2515
2545
  return t.length === 0 ? "" : "/" + t.join("/");
2516
- }, so = [
2546
+ }, Io = [
2517
2547
  "// Hot-reload bridge: keep SSR-injected <link rel=\"stylesheet\"> tags",
2518
2548
  "// in sync with Vite's CSS HMR. Without this, edits to .css files",
2519
2549
  "// only update the JS-injected <style> overlay; the underlying <link>",
@@ -2606,7 +2636,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2606
2636
  " _vdtErrorStart('Build error')",
2607
2637
  " })",
2608
2638
  "}"
2609
- ].join("\n"), co = (e) => {
2639
+ ].join("\n"), Lo = (e) => {
2610
2640
  let t = [], n = 0, r = e.split("/").filter(Boolean), i = [];
2611
2641
  for (let e of r) e.startsWith("[[...") && e.endsWith("]]") ? (i.push("(.*)"), t.push(e.slice(5, -2)), n += 2) : e.startsWith("[...") && e.endsWith("]") ? (i.push("(.+)"), t.push(e.slice(4, -1)), n += 3) : e.startsWith("[") && e.endsWith("]") ? (i.push("([^/]+)"), t.push(e.slice(1, -1)), n += 1) : i.push(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
2612
2642
  let a = i.join("/");
@@ -2615,8 +2645,8 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2615
2645
  paramNames: t,
2616
2646
  priority: n
2617
2647
  };
2618
- }, lo = (e) => e.map((e) => {
2619
- let { regex: t, paramNames: n, priority: r } = co(e.pattern);
2648
+ }, Ro = (e) => e.map((e) => {
2649
+ let { regex: t, paramNames: n, priority: r } = Lo(e.pattern);
2620
2650
  return {
2621
2651
  pattern: e.pattern,
2622
2652
  file: e.file,
@@ -2625,7 +2655,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2625
2655
  paramNames: n,
2626
2656
  priority: r
2627
2657
  };
2628
- }).slice().sort((e, t) => e.priority - t.priority), uo = (e, t) => {
2658
+ }).slice().sort((e, t) => e.priority - t.priority), zo = (e, t) => {
2629
2659
  for (let n of t) {
2630
2660
  let t = n.regex.exec(e);
2631
2661
  if (!t) continue;
@@ -2637,9 +2667,9 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2637
2667
  };
2638
2668
  }
2639
2669
  return null;
2640
- }, fo = st, po = async (e) => {
2670
+ }, Bo = _, Vo = async (e) => {
2641
2671
  try {
2642
- let t = await import(G(I(e, "app.config.ts")).href), n = t.default?.port, i = r({
2672
+ let t = await import(me(F(e, "app.config.ts")).href), n = t.default?.port, i = r({
2643
2673
  kind: "api",
2644
2674
  configPort: typeof n == "number" ? n : void 0,
2645
2675
  env: {}
@@ -2653,7 +2683,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2653
2683
  kind: "api",
2654
2684
  env: {}
2655
2685
  }).port };
2656
- }, mo = (e, t) => ({
2686
+ }, Ho = (e, t) => ({
2657
2687
  name: e,
2658
2688
  pkg: t.package,
2659
2689
  browserWsUrl: t.url,
@@ -2661,7 +2691,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2661
2691
  ...t.serverUrl ? { serverOrigin: t.serverUrl } : {},
2662
2692
  ...t.headers ? { headers: t.headers } : {},
2663
2693
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
2664
- }), ho = (e, t, n) => {
2694
+ }), Uo = (e, t, n) => {
2665
2695
  let r = t.transport?.wsPath ?? n.wsPath;
2666
2696
  return {
2667
2697
  name: e,
@@ -2673,7 +2703,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2673
2703
  ...t.headers ? { headers: t.headers } : {},
2674
2704
  ...t.authHeaders ? { hasAuthHeaders: !0 } : {}
2675
2705
  };
2676
- }, go = (e) => {
2706
+ }, Wo = (e) => {
2677
2707
  let t = /* @__PURE__ */ new Map();
2678
2708
  for (let n of e) {
2679
2709
  if (n.proxyTarget === void 0) continue;
@@ -2681,43 +2711,43 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2681
2711
  if (e) throw Error(`[voltro] api ${JSON.stringify(n.name)} and ${JSON.stringify(e)} both resolve the same-origin WS path ${JSON.stringify(n.browserWsUrl)}. A custom transport.wsPath must be unique per origin (one api per origin may use a fixed path). Give each a distinct wsPath, or drop the override to use the default /ws/<name>.`);
2682
2712
  t.set(n.browserWsUrl, n.name);
2683
2713
  }
2684
- }, _o = async (e, t) => {
2714
+ }, Go = async (e, t) => {
2685
2715
  let n = Object.entries(t.apis ?? {}), r = [];
2686
2716
  for (let [t, i] of n) {
2687
2717
  if (i.url) {
2688
- r.push(mo(t, i));
2718
+ r.push(Ho(t, i));
2689
2719
  continue;
2690
2720
  }
2691
- let n = await fo(e, i.package);
2721
+ let n = await Bo(e, i.package);
2692
2722
  if (!n) throw Error(`[voltro dev] api ${JSON.stringify(t)} (package ${JSON.stringify(i.package)}) is not a workspace dep and has no \`url\` set in app.config.ts. External apis need an explicit \`url\` because the framework can't discover their dev port.`);
2693
- r.push(ho(t, i, await po(n)));
2723
+ r.push(Uo(t, i, await Vo(n)));
2694
2724
  }
2695
- return go(r), r;
2696
- }, vo = (e) => {
2725
+ return Wo(r), r;
2726
+ }, Ko = (e) => {
2697
2727
  if (!(!/^wss?:\/\//.test(e) && !/^https?:\/\//.test(e))) try {
2698
2728
  let t = new URL(e);
2699
2729
  return t.protocol = t.protocol === "wss:" || t.protocol === "https:" ? "https:" : "http:", `${t.protocol}//${t.host}`;
2700
2730
  } catch {
2701
2731
  return;
2702
2732
  }
2703
- }, yo = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, bo = (e) => process.env[yo(e)] ?? process.env.VOLTRO_API_ORIGIN, xo = (e, t) => {
2733
+ }, qo = (e) => `VOLTRO_API_ORIGIN_${e.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`, Jo = (e) => process.env[qo(e)] ?? process.env.VOLTRO_API_ORIGIN, Yo = (e, t) => {
2704
2734
  if (!e) return;
2705
- let n = bo(e.name) ?? e.serverOrigin;
2735
+ let n = Jo(e.name) ?? e.serverOrigin;
2706
2736
  if (n) {
2707
- let e = vo(n);
2737
+ let e = Ko(n);
2708
2738
  if (e) return e;
2709
2739
  }
2710
2740
  if (t?.allowDevProxy && e.proxyTarget) {
2711
- let t = vo(e.proxyTarget);
2741
+ let t = Ko(e.proxyTarget);
2712
2742
  if (t) return t;
2713
2743
  }
2714
- if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return vo(e.browserWsUrl);
2715
- }, So = (e, t, n) => {
2744
+ if (!e.proxyTarget && /^wss?:\/\//.test(e.browserWsUrl)) return Ko(e.browserWsUrl);
2745
+ }, Xo = (e, t, n) => {
2716
2746
  if (!e) {
2717
2747
  if (n?.apiName === void 0) return;
2718
2748
  let e = n.apiName;
2719
2749
  return async () => {
2720
- throw Error(`[loader.query] api '${e}' has no server-side origin for SSR. In a split web/api deployment the web pod reaches the api by internal DNS, not the browser's relative wsPath — set ${yo(e)} (or VOLTRO_API_ORIGIN, or apis.${e}.serverUrl in app.config.ts) to the api's internal origin, e.g. http://api.<namespace>.svc.cluster.local. The browser transport is unaffected.`);
2750
+ throw Error(`[loader.query] api '${e}' has no server-side origin for SSR. In a split web/api deployment the web pod reaches the api by internal DNS, not the browser's relative wsPath — set ${qo(e)} (or VOLTRO_API_ORIGIN, or apis.${e}.serverUrl in app.config.ts) to the api's internal origin, e.g. http://api.<namespace>.svc.cluster.local. The browser transport is unaffected.`);
2721
2751
  };
2722
2752
  }
2723
2753
  return async (r, i) => {
@@ -2740,7 +2770,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2740
2770
  });
2741
2771
  } catch (t) {
2742
2772
  let i = t?.cause?.code ?? String(t?.message ?? t);
2743
- throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${yo(n.apiName)} / VOLTRO_API_ORIGIN` : "Set the api server origin"} to the api's SSR-reachable origin (internal cluster DNS in a split deployment).`, { cause: t });
2773
+ throw Error(`[loader.query] ${r}: could not reach the api at ${e}/rpc (${i}). ${n?.apiName ? `Set ${qo(n.apiName)} / VOLTRO_API_ORIGIN` : "Set the api server origin"} to the api's SSR-reachable origin (internal cluster DNS in a split deployment).`, { cause: t });
2744
2774
  }
2745
2775
  if (!o.ok) throw Error(`[loader.query] ${r}: HTTP ${o.status} ${await o.text()}`);
2746
2776
  let s = await o.json();
@@ -2770,7 +2800,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2770
2800
  }
2771
2801
  if (u) return l;
2772
2802
  };
2773
- }, Co = (e, t) => {
2803
+ }, Zo = (e, t) => {
2774
2804
  let n = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppGroup`, r = (e) => `${e.replace(/[^a-zA-Z0-9]/g, "_")}AppDescriptors`, i = e.map((e) => `import { appGroup as ${n(e.name)}, appDescriptors as ${r(e.name)} } from '${e.pkg}/rpcGroup'`);
2775
2805
  e.some((e) => e.hasAuthHeaders) && (i.push(`import __voltroAppConfig from '${t}'`), i.push("const __voltroAuthHeaders = (__voltroAppConfig as { readonly apis?: Record<string, { readonly authHeaders?: () => Record<string, string> | Promise<Record<string, string>> }> }).apis"));
2776
2806
  let a = (e) => {
@@ -2782,10 +2812,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2782
2812
  entryLines: e.map((e) => ` ${JSON.stringify(e.name)}: { ${a(e).join(", ")} },`),
2783
2813
  providerEntryLines: e.map((e) => ` { name: ${JSON.stringify(e.name)}, ${a(e).join(", ")} },`)
2784
2814
  };
2785
- }, wo = async (e, t, n, r = {}) => {
2815
+ }, Qo = async (e, t, n, r = {}) => {
2786
2816
  let i = t.title ?? t.name ?? "app";
2787
- An(e);
2788
- let a = await En(e, t.fonts), o = a === null ? [] : [...a.preloads.map((e) => ` <link rel="preload" as="font" type="font/${e.endsWith(".woff2") ? "woff2" : e.endsWith(".woff") ? "woff" : e.endsWith(".otf") ? "otf" : "ttf"}" href="${e}" crossorigin />`), ` <style data-voltro-fonts>${a.css}</style>`], s = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", c = B(I(e, "node_modules", "@voltro", "devtools", "package.json")) || await Ua() !== null, l = t.theme === "system" ? [
2817
+ Ln(e);
2818
+ let a = await Nn(e, t.fonts), o = a === null ? [] : [...a.preloads.map((e) => ` <link rel="preload" as="font" type="font/${e.endsWith(".woff2") ? "woff2" : e.endsWith(".woff") ? "woff" : e.endsWith(".otf") ? "otf" : "ttf"}" href="${e}" crossorigin />`), ` <style data-voltro-fonts>${a.css}</style>`], s = t.theme === "dark" ? " class=\"dark\"" : t.theme === "light" ? " class=\"light\"" : "", c = z(F(e, "node_modules", "@voltro", "devtools", "package.json")) || await vo() !== null, l = t.theme === "system" ? [
2789
2819
  " <script>",
2790
2820
  " (function () {",
2791
2821
  " var root = document.documentElement",
@@ -2837,10 +2867,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2837
2867
  " </body>",
2838
2868
  "</html>",
2839
2869
  ""
2840
- ].join("\n"), f = I(e, "src", "pages"), { pages: p, dirs: m, orphanedSpecials: h } = await ro(f);
2841
- await b(f, p);
2870
+ ].join("\n"), f = F(e, "src", "pages"), { pages: p, dirs: m, orphanedSpecials: h } = await Mo(f);
2871
+ await S(f, p);
2842
2872
  for (let e of h) Q.warn(`src/pages/${e.dir || "."}/ contains ${e.files.join(", ")} but no page.tsx at or below it — ${e.files.length > 1 ? "those files are" : "that file is"} inert. A layout/error/loading/not-found file only applies to routes in its own directory tree; if this is an ordinary component, rename it so it does not read as a route boundary.`);
2843
- let { imports: g, entryLines: _ } = Co(n, "../app.config"), v, y, x;
2873
+ let { imports: g, entryLines: _ } = Zo(n, "../app.config"), v, y, b;
2844
2874
  if (p.length > 0) {
2845
2875
  let n = p.map((e) => ` ${JSON.stringify(e.pattern)}: () => import('../src/pages/${e.file}'),`), r = [];
2846
2876
  for (let e of m) {
@@ -2848,13 +2878,13 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2848
2878
  e.hasLayout && e.hasLayoutLoader ? r.push(`import * as ${$(e.dir, "Layout")}Mod from '${t}/layout.tsx'`) : e.hasLayout && r.push(`import ${$(e.dir, "Layout")} from '${t}/layout.tsx'`), e.hasError && r.push(`import ${$(e.dir, "Error")} from '${t}/error.tsx'`), e.hasPending && r.push(`import ${$(e.dir, "Pending")} from '${t}/loading.tsx'`), e.hasNotFound && r.push(`import ${$(e.dir, "NotFound")} from '${t}/not-found.tsx'`);
2849
2879
  }
2850
2880
  let i = p.map((e) => {
2851
- let t = io(m, e.dirChain).map((e) => {
2881
+ let t = No(m, e.dirChain).map((e) => {
2852
2882
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
2853
2883
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasLayoutLoader && t.push(`loader: refs.layoutLoaders[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), e.hasPending && t.push(`Pending: refs.pendings[${n}]`), ` { ${t.join(", ")} }`;
2854
2884
  }).join(",\n");
2855
2885
  return ` makePageRoute(${JSON.stringify(e.pattern)}, ${t.length > 0 ? `[\n${t},\n ]` : "undefined"}),`;
2856
2886
  }), a = m.filter((e) => e.hasNotFound).map((e) => {
2857
- let t = oo(e.chain), n = io(m, e.chain).map((e) => {
2887
+ let t = Fo(e.chain), n = No(m, e.chain).map((e) => {
2858
2888
  let t = [`id: ${JSON.stringify(e.dir || "/")}`], n = JSON.stringify(e.dir);
2859
2889
  return e.hasLayout && t.push(`Layout: refs.layouts[${n}]`), e.hasError && t.push(`Error: refs.errors[${n}]`), ` { ${t.join(", ")} }`;
2860
2890
  }).join(",\n"), r = n.length > 0 ? `\n chain: [\n${n},\n ],` : "";
@@ -2889,10 +2919,10 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
2889
2919
  kind: "page",
2890
2920
  slotKey: e.pattern
2891
2921
  });
2892
- let h = o.map((e) => ` ${JSON.stringify(e.relPath)},`), b = o.map((e, t) => {
2922
+ let h = o.map((e) => ` ${JSON.stringify(e.relPath)},`), x = o.map((e, t) => {
2893
2923
  let n = JSON.stringify(e.slotKey);
2894
2924
  return e.kind === "page" ? ` if (newMods[${t}] && refs.pages[${n}] !== undefined) { refs.pages[${n}] = newMods[${t}]; changed = true }` : ` if (newMods[${t}]?.default) { refs.${e.kind === "layout" ? "layouts" : e.kind === "error" ? "errors" : e.kind === "pending" ? "pendings" : "notFounds"}[${n}] = newMods[${t}].default;${e.kind === "layout" ? ` refs.layoutLoaders[${n}] = newMods[${t}].loader;` : ""} changed = true }`;
2895
- }), S = t.locales ?? [], C = S.length > 0 && S.every((t) => B(I(e, "src", "locales", `${t}.ts`)) || B(I(e, "src", "locales", `${t}.tsx`))), w = C, T = t.defaultLocale ?? S[0] ?? "en", E = t.router?.viewTransitions === !0 ? " viewTransitions" : "";
2925
+ }), S = t.locales ?? [], C = S.length > 0 && S.every((t) => z(F(e, "src", "locales", `${t}.ts`)) || z(F(e, "src", "locales", `${t}.tsx`))), w = C, T = t.defaultLocale ?? S[0] ?? "en", E = t.router?.viewTransitions === !0 ? " viewTransitions" : "";
2896
2926
  if (S.length > 0 && !C && Q.info(`i18n: locales [${S.join(", ")}] declared with no src/locales/<code>.ts — using them for <html lang> and the resolved locale only. Add the catalogs to get <I18nProvider> wired, or keep your own i18n stack.`), S.length > 0 && !S.includes(T)) throw Error(`[voltro dev] app.config.ts: defaultLocale '${T}' must be one of locales [${S.join(", ")}]`);
2897
2927
  let D = w ? [
2898
2928
  "import { I18nProvider } from '@voltro/i18n'",
@@ -3015,7 +3045,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3015
3045
  " ],",
3016
3046
  " (newMods: Array<Record<string, unknown> | undefined>) => {",
3017
3047
  " let changed = false",
3018
- ...b,
3048
+ ...x,
3019
3049
  " if (changed) bump()",
3020
3050
  " },",
3021
3051
  " )",
@@ -3136,20 +3166,20 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3136
3166
  ] : [` return <Router routes={routes} notFounds={notFounds}${E} />`],
3137
3167
  "}",
3138
3168
  ""
3139
- ].join("\n"), x = [
3169
+ ].join("\n"), b = [
3140
3170
  "// GENERATED BY `voltro dev` — do not edit; will be overwritten on next boot.",
3141
3171
  "// Entry: imports the generated App component and calls mount() with the",
3142
3172
  "// resolved apis map. Side-effect only — no local component definitions —",
3143
3173
  "// so downstream invalidations (user page edits) terminate at app.tsx.",
3144
3174
  "",
3145
- ...Ja(t),
3175
+ ...Co(t),
3146
3176
  "import { mount } from '@voltro/web'",
3147
3177
  ...g,
3148
3178
  "import { App } from './app'",
3149
3179
  "import { preloadCurrentRoute } from './routeTable'",
3150
- ...Ka(t),
3151
- ...Wa(t, c),
3152
- ...qa(t),
3180
+ ...xo(t),
3181
+ ...yo(t, c),
3182
+ ...So(t),
3153
3183
  "",
3154
3184
  "// Preload the current route's page chunk BEFORE hydration so the first",
3155
3185
  "// client render matches the SSG/SSR-prerendered HTML. Without it, a lazy",
@@ -3166,54 +3196,54 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3166
3196
  " apis: {",
3167
3197
  ..._,
3168
3198
  " },",
3169
- ...Ga(t, c),
3199
+ ...bo(t, c),
3170
3200
  "})",
3171
3201
  "",
3172
- so
3202
+ Io
3173
3203
  ].join("\n");
3174
- } else v = "", y = "", x = [
3204
+ } else v = "", y = "", b = [
3175
3205
  "// GENERATED BY `voltro dev` — do not edit; will be overwritten on next boot.",
3176
3206
  "// The user's root component lives at ../src/App.tsx; this file imports it",
3177
3207
  "// and calls mount(). Side-effect only, no component definitions, so the",
3178
3208
  "// user's component file remains the Fast Refresh boundary.",
3179
3209
  "",
3180
- ...Ja(t),
3210
+ ...Co(t),
3181
3211
  "import { mount } from '@voltro/web'",
3182
3212
  ...g,
3183
3213
  "import App from '../src/App'",
3184
- ...Ka(t),
3185
- ...Wa(t, c),
3186
- ...qa(t),
3214
+ ...xo(t),
3215
+ ...yo(t, c),
3216
+ ...So(t),
3187
3217
  "",
3188
3218
  "mount(App, {",
3189
3219
  " apis: {",
3190
3220
  ..._,
3191
3221
  " },",
3192
- ...Ga(t, c),
3222
+ ...bo(t, c),
3193
3223
  "})",
3194
3224
  "",
3195
- so
3225
+ Io
3196
3226
  ].join("\n");
3197
- let S = I(e, ".framework");
3198
- await V.mkdir(S, { recursive: !0 }), t.env ? await nt(S, r) : await V.rm(I(S, "env.public.ts"), { force: !0 }), await V.writeFile(I(S, "index.html"), d, "utf8"), await V.writeFile(I(S, "main.tsx"), x, "utf8"), v ? (await V.writeFile(I(S, "app.tsx"), v, "utf8"), await V.writeFile(I(S, "routeTable.ts"), y, "utf8")) : (await V.rm(I(S, "app.tsx"), { force: !0 }), await V.rm(I(S, "routeTable.ts"), { force: !0 }));
3199
- let C = I(e, ".gitignore"), w = "";
3227
+ let x = F(e, ".framework");
3228
+ await B.mkdir(x, { recursive: !0 }), t.env ? await ut(x, r) : await B.rm(F(x, "env.public.ts"), { force: !0 }), await B.writeFile(F(x, "index.html"), d, "utf8"), await B.writeFile(F(x, "main.tsx"), b, "utf8"), v ? (await B.writeFile(F(x, "app.tsx"), v, "utf8"), await B.writeFile(F(x, "routeTable.ts"), y, "utf8")) : (await B.rm(F(x, "app.tsx"), { force: !0 }), await B.rm(F(x, "routeTable.ts"), { force: !0 }));
3229
+ let C = F(e, ".gitignore"), w = "";
3200
3230
  try {
3201
- w = await V.readFile(C, "utf8");
3231
+ w = await B.readFile(C, "utf8");
3202
3232
  } catch {}
3203
3233
  let T = ["/.framework/"], E = new Set(w.split("\n").map((e) => e.trim())), D = T.filter((e) => !E.has(e));
3204
3234
  if (D.length > 0) {
3205
3235
  let e = w === "" || w.endsWith("\n") ? "" : "\n";
3206
3236
  try {
3207
- await V.appendFile(C, `${e}${D.join("\n")}\n`, "utf8");
3237
+ await B.appendFile(C, `${e}${D.join("\n")}\n`, "utf8");
3208
3238
  } catch (e) {
3209
3239
  Q.warn(`could not add ${D.join(", ")} to ${C} — add it by hand so the generated directory stays out of git. The build is unaffected.`, { reason: e?.message ?? String(e) });
3210
3240
  }
3211
3241
  }
3212
- }, To = async (e, t) => {
3242
+ }, $o = async (e, t) => {
3213
3243
  try {
3214
- let n = F(e), r = I(n, "project.json");
3215
- if (!B(r)) return;
3216
- let i = await V.readFile(r, "utf8"), a = JSON.parse(i).apps ?? {}, o = e.split("/").filter(Boolean).pop() ?? "", s = [];
3244
+ let n = P(e), r = F(n, "project.json");
3245
+ if (!z(r)) return;
3246
+ let i = await B.readFile(r, "utf8"), a = JSON.parse(i).apps ?? {}, o = e.split("/").filter(Boolean).pop() ?? "", s = [];
3217
3247
  for (let [e, n] of Object.entries(a)) e !== o && n.port === t && s.push(e);
3218
3248
  if (s.length === 0) return;
3219
3249
  Q.warn("sibling app(s) claim the same port — only one boots", {
@@ -3222,53 +3252,53 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3222
3252
  projectJson: r
3223
3253
  });
3224
3254
  } catch {}
3225
- }, Eo = (e) => I(e, ".framework", "dist", "server", "appConfig.js"), Do = async (e, t = {}) => {
3226
- let n = Eo(e), r = t.preferSource !== !0 && B(n) ? n : I(e, "app.config.ts");
3255
+ }, es = (e) => F(e, ".framework", "dist", "server", "appConfig.js"), ts = async (e, t = {}) => {
3256
+ let n = es(e), r = t.preferSource !== !0 && z(n) ? n : F(e, "app.config.ts");
3227
3257
  try {
3228
- let e = (await import(G(r).href)).default;
3258
+ let e = (await import(me(r).href)).default;
3229
3259
  return typeof e == "object" && e && "type" in e && e.type === "web" ? e : null;
3230
3260
  } catch {
3231
3261
  return null;
3232
3262
  }
3233
- }, Oo = (e) => {
3263
+ }, ns = (e) => {
3234
3264
  let t = e.restRoutes;
3235
3265
  if (t !== void 0 && t.length !== 0) return `app.config.ts declares ${t.length} restRoute(s) on a type:'web' app — REST routes mount on the API process and were silently ignored here, so a health probe hitting one gets the SPA shell (200) and a POST gets 404.\n Move them to the API app's app.config.ts (they mount under the api origin), and call them there;\n for same-origin paths in front of the web app, terminate them at your ingress/proxy instead.`;
3236
- }, ko = async (e) => {
3237
- let n = await Do(e, { preferSource: !0 });
3266
+ }, rs = async (e) => {
3267
+ let n = await ts(e, { preferSource: !0 });
3238
3268
  if (!n) return {
3239
3269
  ran: !1,
3240
3270
  exitCode: 0
3241
3271
  };
3242
3272
  {
3243
- let e = Oo(n);
3273
+ let e = ns(n);
3244
3274
  if (e !== void 0) return Q.error(`voltro dev (web): refusing to boot — ${e}`), {
3245
3275
  ran: !0,
3246
3276
  exitCode: 1
3247
3277
  };
3248
3278
  }
3249
- ci();
3250
- let i = Sr();
3251
- Br(i), Q.info("booting voltro dev (web)", { app: n.name ?? "(unnamed)" }), Dt(e, Q);
3252
- let a = await _o(e, n);
3279
+ hi();
3280
+ let i = kr();
3281
+ qr(i), Q.info("booting voltro dev (web)", { app: n.name ?? "(unnamed)" }), Nt(e, Q);
3282
+ let a = await Go(e, n);
3253
3283
  for (let e of a) Q.info("api wired", {
3254
3284
  name: e.name,
3255
3285
  pkg: e.pkg,
3256
3286
  ...e.proxyTarget ? { proxyTo: e.proxyTarget } : { directWs: e.browserWsUrl }
3257
3287
  });
3258
- g(e).then((e) => {
3288
+ v(e).then((e) => {
3259
3289
  for (let t of e.files) if (t.action === "created") {
3260
3290
  let e = t.path.split("/").pop() ?? t.path;
3261
3291
  Q.info(`${e} seeded`, { path: t.path });
3262
3292
  }
3263
3293
  }).catch(() => {});
3264
- let { resolved: o } = await rt({
3294
+ let { resolved: o } = await dt({
3265
3295
  rawEnv: n.env,
3266
3296
  appType: "web",
3267
3297
  root: e,
3268
3298
  log: Q,
3269
3299
  generateTypes: !0
3270
3300
  }), s = o.publicValues;
3271
- await wo(e, n, a, s), Q.debug("generated framework entry files", { files: [
3301
+ await Qo(e, n, a, s), Q.debug("generated framework entry files", { files: [
3272
3302
  "index.html",
3273
3303
  ".framework/main.tsx",
3274
3304
  ...n.env ? [".framework/env.public.ts"] : []
@@ -3277,46 +3307,46 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3277
3307
  kind: "web",
3278
3308
  configPort: n.port,
3279
3309
  env: process.env,
3280
- dashboardPin: process.env[wi] === "1"
3310
+ dashboardPin: process.env[ji] === "1"
3281
3311
  });
3282
3312
  for (let e of c.warnings) Q.warn(e);
3283
- let l = c.port, b = n.name ?? "unnamed", x = re("web", b, l), S = ie(b);
3284
- await ee({
3285
- id: x,
3286
- name: b,
3313
+ let l = c.port, _ = n.name ?? "unnamed", S = se("web", _, l), C = ce(_);
3314
+ await ie({
3315
+ id: S,
3316
+ name: _,
3287
3317
  kind: "web",
3288
3318
  url: `http://localhost:${l}`,
3289
3319
  pid: process.pid,
3290
3320
  status: "booting",
3291
- logFile: S.path
3292
- }).catch(() => {}), await To(e, l);
3293
- let { pages: C, dirs: w } = await ro(I(e, "src", "pages")), T = null, E = n.fonts !== void 0 && n.fonts.length > 0 ? Yn({
3321
+ logFile: C.path
3322
+ }).catch(() => {}), await $o(e, l);
3323
+ let { pages: w, dirs: T } = await Mo(F(e, "src", "pages")), E = null, D = n.fonts !== void 0 && n.fonts.length > 0 ? dr({
3294
3324
  root: e,
3295
3325
  fonts: n.fonts,
3296
- cache: v(),
3297
- secret: qn().secret,
3326
+ cache: b(),
3327
+ secret: lr().secret,
3298
3328
  isOgSsrRoute: (e) => O.ssrRoutes.some((t) => t.pattern === e),
3299
3329
  getPageModule: async (e) => {
3300
3330
  let t = O.ssrRoutes.find((t) => t.pattern === e);
3301
- if (t === void 0 || T === null) return null;
3302
- let n = await T(t.file), r = _(n, t.file);
3331
+ if (t === void 0 || E === null) return null;
3332
+ let n = await E(t.file), r = y(n, t.file);
3303
3333
  return r === "ssr" || r === "isr" ? n : null;
3304
3334
  }
3305
3335
  }) : null, O = {
3306
- dirs: w,
3307
- ssrRoutes: lo(C)
3308
- }, k = w.map((e) => ({
3336
+ dirs: T,
3337
+ ssrRoutes: Ro(w)
3338
+ }, k = T.map((e) => ({
3309
3339
  dir: e.dir,
3310
3340
  hasLayout: e.hasLayout,
3311
3341
  hasError: e.hasError,
3312
3342
  hasPending: e.hasPending,
3313
3343
  hasNotFound: e.hasNotFound
3314
- })), A = await mr({
3344
+ })), te = await xr({
3315
3345
  appRoot: e,
3316
- pages: C
3346
+ pages: w
3317
3347
  });
3318
- A.wrote && Q.debug("routes codegen wrote", { path: L(e, A.path) });
3319
- let j = await Xe("vite", () => import("vite")), M = (await import("@vitejs/plugin-react")).default, N = (await import("@tailwindcss/vite")).default, P = I(e, ".framework"), F = I(e, "src"), z = /* @__PURE__ */ new Set([
3348
+ te.wrote && Q.debug("routes codegen wrote", { path: I(e, te.path) });
3349
+ let A = await it("vite", () => import("vite")), j = (await import("@vitejs/plugin-react")).default, ne = (await import("@tailwindcss/vite")).default, M = F(e, ".framework"), re = F(e, "src"), P = /* @__PURE__ */ new Set([
3320
3350
  ".framework",
3321
3351
  "node_modules",
3322
3352
  "dist",
@@ -3324,64 +3354,64 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3324
3354
  ".vite",
3325
3355
  ".turbo",
3326
3356
  ".cache"
3327
- ]), oe = {
3357
+ ]), le = {
3328
3358
  name: "framework:watch-app-sources",
3329
3359
  async configureServer(t) {
3330
3360
  try {
3331
- let n = (await V.readdir(e, { withFileTypes: !0 })).filter((e) => e.isDirectory() && !z.has(e.name));
3332
- for (let r of n) t.watcher.add(I(e, r.name));
3333
- n.length === 0 && t.watcher.add(F);
3361
+ let n = (await B.readdir(e, { withFileTypes: !0 })).filter((e) => e.isDirectory() && !P.has(e.name));
3362
+ for (let r of n) t.watcher.add(F(e, r.name));
3363
+ n.length === 0 && t.watcher.add(re);
3334
3364
  } catch {
3335
- t.watcher.add(F);
3365
+ t.watcher.add(re);
3336
3366
  }
3337
- for (let n of await ct(e)) t.watcher.add(n.dir);
3367
+ for (let n of await g(e)) t.watcher.add(n.dir);
3338
3368
  }
3339
- }, H = I(e, "src", "pages"), U = (e) => e.endsWith(".tsx") && (e === H || e.startsWith(H + "/")), se = (e) => e === H || e.startsWith(H + "/"), ce = async (t) => {
3369
+ }, R = F(e, "src", "pages"), ue = (e) => e.endsWith(".tsx") && (e === R || e.startsWith(R + "/")), V = (e) => e === R || e.startsWith(R + "/"), H = async (t) => {
3340
3370
  try {
3341
3371
  let r = Date.now();
3342
- await wo(e, n, a, s);
3343
- let { pages: i, dirs: o } = await ro(H);
3344
- await mr({
3372
+ await Qo(e, n, a, s);
3373
+ let { pages: i, dirs: o } = await Mo(R);
3374
+ await xr({
3345
3375
  appRoot: e,
3346
3376
  pages: i
3347
- }), O.dirs = o, O.ssrRoutes = lo(i), Q.info("page tree regenerated", {
3377
+ }), O.dirs = o, O.ssrRoutes = Ro(i), Q.info("page tree regenerated", {
3348
3378
  reason: t,
3349
3379
  ms: Date.now() - r,
3350
3380
  routes: O.ssrRoutes.length
3351
3381
  });
3352
- for (let e of ha(Y, O.ssrRoutes.map((e) => e.pattern))) Q.error(`middleware.ts: ${e.message}`);
3382
+ for (let e of ja(Y, O.ssrRoutes.map((e) => e.pattern))) Q.error(`middleware.ts: ${e.message}`);
3353
3383
  } catch (e) {
3354
3384
  Q.error("page tree regen failed", { reason: t }, e);
3355
3385
  }
3356
- }, W = {
3386
+ }, de = {
3357
3387
  name: "framework:regenerate-on-page-tree-change",
3358
3388
  configureServer(t) {
3359
3389
  let n = null, r = [], i = (e) => {
3360
3390
  r.push(e), n && clearTimeout(n), n = setTimeout(() => {
3361
3391
  n = null;
3362
3392
  let e = r.length === 1 ? r[0] : `${r.length} events (${r[0]}, …)`;
3363
- r.length = 0, ce(e);
3393
+ r.length = 0, H(e);
3364
3394
  }, 50);
3365
3395
  };
3366
3396
  t.watcher.on("add", (t) => {
3367
- U(t) && i(`add ${L(e, t)}`);
3397
+ ue(t) && i(`add ${I(e, t)}`);
3368
3398
  }), t.watcher.on("unlink", (t) => {
3369
- U(t) && i(`unlink ${L(e, t)}`);
3399
+ ue(t) && i(`unlink ${I(e, t)}`);
3370
3400
  }), t.watcher.on("addDir", (t) => {
3371
- se(t) && i(`addDir ${L(e, t)}`);
3401
+ V(t) && i(`addDir ${I(e, t)}`);
3372
3402
  }), t.watcher.on("unlinkDir", (t) => {
3373
- se(t) && i(`unlinkDir ${L(e, t)}`);
3403
+ V(t) && i(`unlinkDir ${I(e, t)}`);
3374
3404
  });
3375
3405
  }
3376
- }, G = I(e, "app.config.ts"), le = (e) => {
3377
- if (!xe(e.env)) return "";
3406
+ }, U = F(e, "app.config.ts"), fe = (e) => {
3407
+ if (!Ae(e.env)) return "";
3378
3408
  let t = Object.entries(e.env.vars).map(([e, t]) => `${e}:${t.access}`).sort();
3379
3409
  return `${String(e.env.publicPrefix)}|${t.join(",")}`;
3380
- }, K = (e, t) => {
3410
+ }, pe = (e, t) => {
3381
3411
  let n = [];
3382
- return e.port !== t.port && n.push(`port ${e.port ?? "(default)"} → ${t.port ?? "(default)"}`), JSON.stringify(e.proxies) !== JSON.stringify(t.proxies) && n.push("proxies"), JSON.stringify(e.allowedHosts) !== JSON.stringify(t.allowedHosts) && n.push("allowedHosts"), JSON.stringify(e.apis) !== JSON.stringify(t.apis) && n.push("apis"), le(e) !== le(t) && n.push("env"), n;
3383
- }, q = n, de = R(G), fe = () => {
3384
- let e = Me(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
3412
+ return e.port !== t.port && n.push(`port ${e.port ?? "(default)"} → ${t.port ?? "(default)"}`), JSON.stringify(e.proxies) !== JSON.stringify(t.proxies) && n.push("proxies"), JSON.stringify(e.allowedHosts) !== JSON.stringify(t.allowedHosts) && n.push("allowedHosts"), JSON.stringify(e.apis) !== JSON.stringify(t.apis) && n.push("apis"), fe(e) !== fe(t) && n.push("env"), n;
3413
+ }, W = n, me = L(U), he = () => {
3414
+ let e = ze(process.execPath, [...process.execArgv, ...process.argv.slice(1)], {
3385
3415
  stdio: "inherit",
3386
3416
  env: process.env,
3387
3417
  cwd: process.cwd()
@@ -3393,24 +3423,24 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3393
3423
  }), e.on("error", (e) => {
3394
3424
  Q.error("restart spawn failed", {}, e), process.exit(1);
3395
3425
  });
3396
- }, pe = {
3426
+ }, G = {
3397
3427
  name: "framework:watch-app-config",
3398
3428
  async configureServer(n) {
3399
- n.watcher.add(G), Q.info("watching app.config.ts for changes", { path: L(e, G) });
3400
- let r = ca.map((t) => I(e, t)), i = new Set(r.map((e) => R(e)));
3429
+ n.watcher.add(U), Q.info("watching app.config.ts for changes", { path: I(e, U) });
3430
+ let r = wa.map((t) => F(e, t)), i = new Set(r.map((e) => L(e)));
3401
3431
  for (let e of r) n.watcher.add(e);
3402
3432
  n.watcher.on("all", (t, r) => {
3403
- i.has(R(r)) && (Q.warn("middleware.ts changed — restarting (it is loaded once per boot)", { path: L(e, r) }), n.close().catch(() => void 0).then(() => {
3404
- fe();
3433
+ i.has(L(r)) && (Q.warn("middleware.ts changed — restarting (it is loaded once per boot)", { path: I(e, r) }), n.close().catch(() => void 0).then(() => {
3434
+ he();
3405
3435
  }));
3406
3436
  });
3407
3437
  let a = async () => {
3408
3438
  try {
3409
3439
  try {
3410
- let e = n.moduleGraph.getModuleById(G);
3440
+ let e = n.moduleGraph.getModuleById(U);
3411
3441
  e && n.moduleGraph.invalidateModule(e);
3412
3442
  } catch {}
3413
- let e = (await n.ssrLoadModule(G, { fixStacktrace: !0 })).default;
3443
+ let e = (await n.ssrLoadModule(U, { fixStacktrace: !0 })).default;
3414
3444
  return typeof e == "object" && e && "type" in e && e.type === "web" ? e : (Q.warn("app.config.ts re-load returned wrong shape", { hasDefault: e !== void 0 }), null);
3415
3445
  } catch (e) {
3416
3446
  return Q.warn("app.config.ts re-load failed — ignoring this change", {}, e), null;
@@ -3429,22 +3459,22 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3429
3459
  theme: t.theme,
3430
3460
  port: t.port,
3431
3461
  name: t.name
3432
- }), JSON.stringify(t) === JSON.stringify(q)) {
3462
+ }), JSON.stringify(t) === JSON.stringify(W)) {
3433
3463
  Q.info("app.config.ts onConfigChange: parsed config unchanged — skipping (no-op edit?)");
3434
3464
  return;
3435
3465
  }
3436
- let r = K(q, t);
3466
+ let r = pe(W, t);
3437
3467
  if (r.length > 0) {
3438
3468
  Q.warn("app.config.ts changed — hard restart required", { fields: r });
3439
3469
  try {
3440
3470
  await n.close();
3441
3471
  } catch {}
3442
- fe();
3472
+ he();
3443
3473
  return;
3444
3474
  }
3445
3475
  try {
3446
3476
  let r = Date.now();
3447
- await wo(e, t, await _o(e, t)), q = t, n.ws && n.ws.send({
3477
+ await Qo(e, t, await Go(e, t)), W = t, n.ws && n.ws.send({
3448
3478
  type: "full-reload",
3449
3479
  path: "*"
3450
3480
  }), Q.info("app.config.ts soft-regen", {
@@ -3454,7 +3484,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3454
3484
  } catch (e) {
3455
3485
  Q.error("app.config.ts soft-regen failed", {}, e);
3456
3486
  }
3457
- }, l = (e) => ae(e) === "app.config.ts" ? e === G || R(e) === de : !1;
3487
+ }, l = (e) => N(e) === "app.config.ts" ? e === U || L(e) === me : !1;
3458
3488
  n.watcher.on("change", (e) => {
3459
3489
  l(e) && (Q.info("app.config.ts change event (chokidar)", { file: e }), s());
3460
3490
  }), n.watcher.on("add", (e) => {
@@ -3462,46 +3492,46 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3462
3492
  });
3463
3493
  try {
3464
3494
  let { watchFile: e } = await import("node:fs");
3465
- e(G, { interval: 500 }, (e, t) => {
3495
+ e(U, { interval: 500 }, (e, t) => {
3466
3496
  e.mtimeMs !== t.mtimeMs && (Q.info("app.config.ts change event (poll)", { mtime: e.mtimeMs }), s());
3467
3497
  }), Q.info("app.config.ts polling watcher attached", { intervalMs: 500 });
3468
3498
  } catch (e) {
3469
3499
  Q.warn("app.config.ts polling watcher could not attach", {}, e);
3470
3500
  }
3471
- ut(t, Q, {
3501
+ gt(t, Q, {
3472
3502
  root: e,
3473
3503
  onBeforeRestart: () => n.close()
3474
3504
  });
3475
3505
  }
3476
- }, me = /\/apps\/[^/]+\/.*\.(route|mutation|workflow|schema)\.tsx?$/, he = 0, ge = {
3506
+ }, _e = /\/apps\/[^/]+\/.*\.(route|mutation|workflow|schema)\.tsx?$/, ve = 0, ye = {
3477
3507
  name: "framework:suppress-api-hmr",
3478
3508
  handleHotUpdate(e) {
3479
- if (he += 1, me.test(e.file)) return [];
3509
+ if (ve += 1, _e.test(e.file)) return [];
3480
3510
  }
3481
- }, _e = {
3511
+ }, be = {
3482
3512
  name: "framework:reoptimize-on-rpcgroup-change",
3483
3513
  async configureServer(t) {
3484
3514
  let n = [];
3485
3515
  for (let r of a) {
3486
- let i = await fo(e, r.pkg);
3516
+ let i = await Bo(e, r.pkg);
3487
3517
  if (i) {
3488
3518
  n.push(i);
3489
3519
  try {
3490
- t.watcher.add(I(i, "rpcGroup.generated.ts"));
3520
+ t.watcher.add(F(i, "rpcGroup.generated.ts"));
3491
3521
  } catch {}
3492
- for (let e of await ia(i)) try {
3522
+ for (let e of await ba(i)) try {
3493
3523
  t.watcher.add(e);
3494
3524
  } catch {}
3495
3525
  }
3496
3526
  }
3497
3527
  if (n.length === 0) return;
3498
- let r = await oa(n), i = null, o = !1, s = async () => {
3528
+ let r = await Sa(n), i = null, o = !1, s = async () => {
3499
3529
  if (o) return;
3500
- let e = await oa(n);
3530
+ let e = await Sa(n);
3501
3531
  if (e !== void 0 && e !== r) {
3502
3532
  r = e, o = !0, Q.info("the api surface changed — re-bundling the api client + reloading (descriptor edits propagate automatically; no manual restart needed)");
3503
3533
  try {
3504
- await V.rm(I(P, ".vite", "deps"), {
3534
+ await B.rm(F(M, ".vite", "deps"), {
3505
3535
  recursive: !0,
3506
3536
  force: !0
3507
3537
  }), await t.restart(!0);
@@ -3510,16 +3540,16 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3510
3540
  }
3511
3541
  }
3512
3542
  }, c = (e) => {
3513
- let t = R(e);
3514
- !na(t) && !t.endsWith("rpcGroup.generated.ts") || (i && clearTimeout(i), i = setTimeout(() => {
3543
+ let t = L(e);
3544
+ !va(t) && !t.endsWith("rpcGroup.generated.ts") || (i && clearTimeout(i), i = setTimeout(() => {
3515
3545
  s();
3516
3546
  }, 120));
3517
3547
  };
3518
3548
  t.watcher.on("change", c), t.watcher.on("add", c);
3519
3549
  }
3520
- }, ve = {}, ye = (e) => (t) => {
3550
+ }, xe = {}, Se = (e) => (t) => {
3521
3551
  t.on("proxyReq", (t, n) => {
3522
- oi(t, n, {
3552
+ pi(t, n, {
3523
3553
  target: e,
3524
3554
  token: process.env.VOLTRO_INSPECT_TOKEN,
3525
3555
  writeToken: process.env.VOLTRO_INSPECT_WRITE_TOKEN,
@@ -3529,26 +3559,26 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3529
3559
  };
3530
3560
  for (let e of a) {
3531
3561
  if (!e.proxyTarget) continue;
3532
- ve[e.browserWsUrl] = {
3562
+ xe[e.browserWsUrl] = {
3533
3563
  target: e.proxyTarget,
3534
3564
  ws: !0,
3535
3565
  changeOrigin: !0,
3536
3566
  ...e.wsPath ? {} : { rewrite: () => "/ws" }
3537
3567
  };
3538
3568
  let t = e.proxyTarget.replace(/^ws/, "http");
3539
- ve[`/_voltro/api/${e.name}`] = {
3569
+ xe[`/_voltro/api/${e.name}`] = {
3540
3570
  target: t,
3541
3571
  changeOrigin: !0,
3542
3572
  rewrite: (t) => t.replace(RegExp(`^/_voltro/api/${e.name}`), ""),
3543
- configure: ye(t)
3573
+ configure: Se(t)
3544
3574
  };
3545
3575
  }
3546
3576
  for (let [e, t] of Object.entries(n.proxies ?? {})) {
3547
- if (ve[e]) {
3577
+ if (xe[e]) {
3548
3578
  Q.warn("user proxy ignored — prefix already claimed by an api ws proxy", { prefix: e });
3549
3579
  continue;
3550
3580
  }
3551
- ve[e] = {
3581
+ xe[e] = {
3552
3582
  target: t.target,
3553
3583
  changeOrigin: t.changeOrigin ?? !0,
3554
3584
  ...t.rewrite === void 0 ? {} : { rewrite: (n) => n.replace(RegExp(`^${e}`), t.rewrite) }
@@ -3558,23 +3588,23 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3558
3588
  ...t.rewrite === void 0 ? {} : { rewrite: t.rewrite }
3559
3589
  });
3560
3590
  }
3561
- let be = {
3591
+ let Ce = {
3562
3592
  name: "framework:inspect",
3563
3593
  configureServer(t) {
3564
3594
  let r = null, a = async () => {
3565
3595
  if (r !== null) return r;
3566
3596
  let n = [];
3567
- for (let r of C) try {
3568
- let i = await t.ssrLoadModule(I(e, "src", "pages", r.file));
3597
+ for (let r of w) try {
3598
+ let i = await t.ssrLoadModule(F(e, "src", "pages", r.file));
3569
3599
  n.push({
3570
3600
  pattern: r.pattern,
3571
3601
  file: r.file,
3572
3602
  dirChain: r.dirChain,
3573
- renderMode: _(i, I("src", "pages", r.file)),
3603
+ renderMode: y(i, F("src", "pages", r.file)),
3574
3604
  interactive: i.interactive ?? "full",
3575
3605
  tenantAware: i.tenantAware === !0,
3576
- revalidateMs: y(i.revalidate),
3577
- staleWhileRevalidateMs: y(i.staleWhileRevalidate) ?? 0,
3606
+ revalidateMs: x(i.revalidate),
3607
+ staleWhileRevalidateMs: x(i.staleWhileRevalidate) ?? 0,
3578
3608
  cacheInvalidatesOn: Array.isArray(i.cacheInvalidatesOn) ? i.cacheInvalidatesOn : [],
3579
3609
  hasLoader: typeof i.loader == "function",
3580
3610
  hasMeta: i.meta != null,
@@ -3601,9 +3631,9 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3601
3631
  }), n();
3602
3632
  }), t.middlewares.use((t, n, r) => {
3603
3633
  if (t.method !== "GET" && t.method !== "HEAD") return r();
3604
- let { pathname: i } = ir(t.url ?? "/");
3605
- if (i !== "/robots.txt" || B(I(e, "public", "robots.txt"))) return r();
3606
- n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(br({ indexable: !1 }));
3634
+ let { pathname: i } = Ji(t.url ?? "/");
3635
+ if (i !== "/robots.txt" || z(F(e, "public", "robots.txt"))) return r();
3636
+ n.statusCode = 200, n.setHeader("Content-Type", "text/plain; charset=utf-8"), n.end(Dr({ indexable: !1 }));
3607
3637
  }), n.name === "voltroDashboard" && t.middlewares.use(async (e, t, n) => {
3608
3638
  let r = e.url ?? "", i = r.split("?")[0];
3609
3639
  if (i === "/api/dashboard/proxy") {
@@ -3694,7 +3724,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3694
3724
  for (let [t, n] of Object.entries(e.headers ?? {})) n !== void 0 && (s[String(t).toLowerCase()] = Array.isArray(n) ? n.join(", ") : String(n));
3695
3725
  let c = o.split("?")[0];
3696
3726
  if (e.method === "GET" && (c === "/_voltro/inspect/logs" || o.startsWith("/_voltro/inspect/logs?"))) {
3697
- let e = d(s.origin), n = ei(o, Fr(), s);
3727
+ let e = d(s.origin), n = si(o, Hr(), s);
3698
3728
  t.statusCode = n.status, t.setHeader("content-type", n.contentType);
3699
3729
  for (let [n, r] of Object.entries(e)) t.setHeader(n, r);
3700
3730
  t.end(n.body);
@@ -3712,7 +3742,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3712
3742
  e.setEncoding("utf-8"), e.on("data", (e) => {
3713
3743
  r += e;
3714
3744
  }), e.on("end", () => {
3715
- let e = Jr(r, i);
3745
+ let e = ti(r, i);
3716
3746
  t.statusCode = e.status, t.setHeader("content-type", e.contentType);
3717
3747
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
3718
3748
  t.end(e.body);
@@ -3743,14 +3773,14 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3743
3773
  for (let [e, r] of Object.entries(n)) t.setHeader(e, r);
3744
3774
  t.flushHeaders?.(), t.write("retry: 5000\n\n");
3745
3775
  let a = o.indexOf("?");
3746
- if (a === -1 || new URLSearchParams(o.slice(a + 1)).get("live") !== "1") for (let e of i.buffered()) t.write(Cr(e));
3776
+ if (a === -1 || new URLSearchParams(o.slice(a + 1)).get("live") !== "1") for (let e of i.buffered()) t.write(Ar(e));
3747
3777
  let c = i.subscribe((e) => {
3748
3778
  try {
3749
- t.write(Cr(e));
3779
+ t.write(Ar(e));
3750
3780
  } catch {}
3751
3781
  }), l = setInterval(() => {
3752
3782
  try {
3753
- t.write(wr());
3783
+ t.write(jr());
3754
3784
  } catch {}
3755
3785
  }, 15e3), p = () => {
3756
3786
  clearInterval(l), c();
@@ -3763,7 +3793,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3763
3793
  kind: "web",
3764
3794
  meta: {
3765
3795
  name: n.name ?? "(unnamed)",
3766
- voltroVersion: Va,
3796
+ voltroVersion: go,
3767
3797
  port: l,
3768
3798
  mode: "dev",
3769
3799
  apis: Object.entries(n.apis ?? {}).map(([e, t]) => {
@@ -3781,7 +3811,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3781
3811
  size: 0,
3782
3812
  entries: []
3783
3813
  }),
3784
- env: () => at(n.name ?? "app", { contract: xe(n.env) ? n.env : void 0 })
3814
+ env: () => pt(n.name ?? "app", { contract: Ae(n.env) ? n.env : void 0 })
3785
3815
  }, c = p(o, i, s, { method: e.method ?? "GET" });
3786
3816
  if (c === null) return r();
3787
3817
  t.statusCode = c.status, t.setHeader("content-type", c.contentType);
@@ -3792,25 +3822,25 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3792
3822
  }
3793
3823
  });
3794
3824
  }
3795
- }, Se = n.name === "voltroDashboard" ? {
3825
+ }, we = n.name === "voltroDashboard" ? {
3796
3826
  name: "framework:dashboard-registry",
3797
3827
  configureServer(e) {
3798
3828
  e.middlewares.use(async (e, t, n) => {
3799
3829
  if (!(e.url ?? "").startsWith("/api/dashboard/registry")) return n();
3800
3830
  try {
3801
- let e = await te();
3831
+ let e = await ae();
3802
3832
  t.statusCode = 200, t.setHeader("content-type", "application/json; charset=utf-8"), t.end(JSON.stringify(e));
3803
3833
  } catch (e) {
3804
3834
  t.statusCode = 500, t.setHeader("content-type", "text/plain"), t.end(`registry read error: ${e.message}`);
3805
3835
  }
3806
3836
  });
3807
3837
  }
3808
- } : null, Ce = /* @__PURE__ */ new Set(), we = (e, t, n, r, i, a = !1) => {
3809
- let o = Bi(i, a, t) ?? "";
3838
+ } : null, Te = /* @__PURE__ */ new Set(), Ee = (e, t, n, r, i, a = !1) => {
3839
+ let o = ta(i, a, t) ?? "";
3810
3840
  if (Q.error(`${t} render failed`, {
3811
3841
  pathname: n,
3812
3842
  pattern: r,
3813
- cause: Er(i) + o
3843
+ cause: Nr(i) + o
3814
3844
  }), e.headersSent) {
3815
3845
  e.end();
3816
3846
  return;
@@ -3818,12 +3848,12 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3818
3848
  e.writeHead(500, {
3819
3849
  "content-type": "text/plain; charset=utf-8",
3820
3850
  "x-voltro-rendered-by": `${t}-failed`,
3821
- "x-voltro-ssr-generation": String(he)
3851
+ "x-voltro-ssr-generation": String(ve)
3822
3852
  });
3823
- let s = he === 0 ? "" : `\n[voltro] this process has absorbed ${he} hot update(s) since boot, so its SSR\nmodule graph may not match the files on disk. Before reporting this — to us or to\nyourself — restart \`voltro dev\` and measure once from a fresh boot.\n`;
3824
- e.end(`${t} render failed for ${n}\n\n${Er(i)}\n${o}\n${s}`);
3825
- }, Te = zt(), Ee = Vt({
3826
- limit: Te,
3853
+ let s = ve === 0 ? "" : `\n[voltro] this process has absorbed ${ve} hot update(s) since boot, so its SSR\nmodule graph may not match the files on disk. Before reporting this — to us or to\nyourself — restart \`voltro dev\` and measure once from a fresh boot.\n`;
3854
+ e.end(`${t} render failed for ${n}\n\n${Nr(i)}\n${o}\n${s}`);
3855
+ }, De = Gt(), Oe = qt({
3856
+ limit: De,
3827
3857
  onColdStart: (e) => Q.debug("ssr cold-compile start", { id: e }),
3828
3858
  onColdEnd: (e, { durationMs: t, failed: n }) => Q.debug(`ssr cold-compile ${n ? "FAILED" : "end"} ${t}ms`, {
3829
3859
  id: e,
@@ -3831,17 +3861,17 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3831
3861
  ...n ? { failed: !0 } : {}
3832
3862
  })
3833
3863
  });
3834
- Q.debug(`ssr cold-compile concurrency ${Te}`, { concurrency: Te });
3835
- let De = null, J = async () => (De === null && (De = await V.readFile(I(e, ".framework", "index.html"), "utf8")), De), Oe = {
3864
+ Q.debug(`ssr cold-compile concurrency ${De}`, { concurrency: De });
3865
+ let ke = null, je = async () => (ke === null && (ke = await B.readFile(F(e, ".framework", "index.html"), "utf8")), ke), Me = {
3836
3866
  name: "framework:ssr",
3837
3867
  configureServer(t) {
3838
- let r = (e) => Ee.load(e, async () => await t.ssrLoadModule(e)), i, o = !1, s = () => {
3868
+ let r = (e) => Oe.load(e, async () => await t.ssrLoadModule(e)), i, o = !1, s = () => {
3839
3869
  if (i !== void 0) return i;
3840
3870
  let t = n.locales ?? [], a = n.defaultLocale ?? t[0] ?? "en";
3841
3871
  return t.length === 0 ? (i = Promise.resolve(() => void 0), i) : (i = (async () => {
3842
3872
  let [{ makeSsgWrap: i }, { makeSsrI18nResolver: s }] = await Promise.all([r("@voltro/i18n"), r("@voltro/i18n/server")]), c = {};
3843
- for (let n of t) if (B(I(e, "src", "locales", `${n}.ts`))) try {
3844
- let t = (await r(I(e, "src", "locales", `${n}.ts`))).default;
3873
+ for (let n of t) if (z(F(e, "src", "locales", `${n}.ts`))) try {
3874
+ let t = (await r(F(e, "src", "locales", `${n}.ts`))).default;
3845
3875
  t !== void 0 && (c[n] = i(n, t, a));
3846
3876
  } catch (e) {
3847
3877
  Q.warn("locale catalog failed to load for SSR", { locale: n }, e);
@@ -3871,31 +3901,35 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3871
3901
  defaultTimeZone: n.defaultTimeZone ?? null
3872
3902
  });
3873
3903
  })(), i);
3874
- }, c = Qt({
3904
+ }, c = on({
3875
3905
  apiName: a[0]?.name,
3876
- apiOrigin: xo(a[0], { allowDevProxy: !0 }),
3906
+ apiOrigin: Yo(a[0], { allowDevProxy: !0 }),
3877
3907
  loadDescriptors: async () => {
3878
3908
  let e = a[0];
3879
3909
  if (e !== void 0) return (await r(`${e.pkg}/rpcGroup`)).appDescriptors;
3880
3910
  },
3881
- rpcQuery: (e, t) => So(xo(a[0], { allowDevProxy: !0 }), e, {
3911
+ rpcQuery: (e, t) => Xo(Yo(a[0], { allowDevProxy: !0 }), e, {
3882
3912
  apiName: a[0]?.name,
3883
3913
  headers: t
3884
3914
  }),
3915
+ resolveLocale: async (e, t) => {
3916
+ let r = tn(t, n.locales);
3917
+ return r === void 0 ? (await s())(e.cookie, e["accept-language"])?.locale ?? "en" : r;
3918
+ },
3885
3919
  renderErrorPage: async () => void 0
3886
3920
  });
3887
3921
  t.middlewares.use((e, t, n) => {
3888
- if (!(e.url ?? "/").split("?")[0].startsWith(Le)) return n();
3922
+ if (!(e.url ?? "/").split("?")[0].startsWith(Ue)) return n();
3889
3923
  c(e, t, (t, r) => {
3890
3924
  e.url = t, e.method = "GET", e.__voltroFormFlash = r, n();
3891
3925
  }).then((e) => {
3892
3926
  e || n();
3893
3927
  });
3894
- }), T = async (n) => await t.ssrLoadModule(I(e, "src", "pages", n)), t.middlewares.use(async (e, t, n) => {
3928
+ }), E = async (n) => await t.ssrLoadModule(F(e, "src", "pages", n)), t.middlewares.use(async (e, t, n) => {
3895
3929
  let r = e.url ?? "/";
3896
- if (!r.startsWith("/_voltro/og") || E === null) return n();
3930
+ if (!r.startsWith("/_voltro/og") || D === null) return n();
3897
3931
  try {
3898
- let e = await E.handle(new URL(r, "http://localhost"));
3932
+ let e = await D.handle(new URL(r, "http://localhost"));
3899
3933
  if (e === null) return n();
3900
3934
  t.statusCode = e.status;
3901
3935
  for (let [n, r] of Object.entries(e.headers)) t.setHeader(n, r);
@@ -3907,30 +3941,30 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3907
3941
  if (i.method !== "GET" && i.method !== "HEAD") return l();
3908
3942
  let u = i.url ?? "/";
3909
3943
  u.indexOf("?");
3910
- let { pathname: d, search: f } = ir(u), p = i.__voltroFormFlash;
3944
+ let { pathname: d, search: f } = Ji(u), p = i.__voltroFormFlash;
3911
3945
  if (d.startsWith("/@") || d.startsWith("/node_modules/") || d.startsWith("/.framework/") || d.startsWith("/_voltro/") || d === "/main.tsx" || d === "/index.html" || d === "/sw.js" || d === "/favicon.ico" || d === "/robots.txt") return l();
3912
3946
  let m = async () => {
3913
3947
  if (Y.length === 0) return;
3914
- let e = ma(Y, {
3948
+ let e = Aa(Y, {
3915
3949
  route: void 0,
3916
3950
  pathname: d
3917
3951
  });
3918
3952
  if (e === void 0) return;
3919
3953
  let t = {};
3920
3954
  for (let [e, n] of Object.entries(i.headers ?? {})) typeof n == "string" ? t[e] = n : Array.isArray(n) && (t[e] = n.join(", "));
3921
- let n = await wa(e, {
3955
+ let n = await Ba(e, {
3922
3956
  pathname: d,
3923
3957
  search: f,
3924
3958
  headers: t,
3925
- cookies: _a(t.cookie),
3959
+ cookies: Na(t.cookie),
3926
3960
  route: void 0
3927
3961
  });
3928
- for (let e of n.setCookies) c.appendHeader("set-cookie", xa(e));
3962
+ for (let e of n.setCookies) c.appendHeader("set-cookie", La(e));
3929
3963
  };
3930
3964
  if (/\.[a-z0-9]+$/i.test(d)) return await m(), l();
3931
- let h = uo(d, O.ssrRoutes), g = !1;
3965
+ let h = zo(d, O.ssrRoutes), g = !1;
3932
3966
  if (!h) {
3933
- let e = Ha(O.dirs, d);
3967
+ let e = _o(O.dirs, d);
3934
3968
  if (e === void 0) return await m(), l();
3935
3969
  g = !0, h = {
3936
3970
  route: {
@@ -3944,8 +3978,8 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3944
3978
  params: {}
3945
3979
  };
3946
3980
  }
3947
- let v = !Ce.has(h.route.pattern), y = Date.now();
3948
- v && Q.info(`ssr compiling ${h.route.pattern}`, {
3981
+ let _ = !Te.has(h.route.pattern), v = Date.now();
3982
+ _ && Q.info(`ssr compiling ${h.route.pattern}`, {
3949
3983
  pattern: h.route.pattern,
3950
3984
  pathname: d
3951
3985
  });
@@ -3964,73 +3998,73 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
3964
3998
  }
3965
3999
  }, C = !1;
3966
4000
  try {
3967
- let w = await x("loadPage", async () => await r(I(e, "src", "pages", h.route.file))), T = g ? "ssr" : _(w, I("src", "pages", h.route.file)), D = io(O.dirs, h.route.dirChain), k = T === "spa" && D.some((e) => e.hasLayout), A = w.interactive ?? "full";
3968
- if (T !== "ssr" && T !== "isr" && !k && A !== "islands") return await m(), l();
3969
- let j = {};
3970
- for (let [e, t] of Object.entries(i.headers ?? {})) typeof t == "string" ? j[e] = t : Array.isArray(t) && (j[e] = t.join(", "));
3971
- let M = await wa(ma(Y, {
4001
+ let w = await x("loadPage", async () => await r(F(e, "src", "pages", h.route.file))), T = g ? "ssr" : y(w, F("src", "pages", h.route.file)), E = No(O.dirs, h.route.dirChain), ee = T === "spa" && E.some((e) => e.hasLayout), k = w.interactive ?? "full";
4002
+ if (T !== "ssr" && T !== "isr" && !ee && k !== "islands") return await m(), l();
4003
+ let te = {};
4004
+ for (let [e, t] of Object.entries(i.headers ?? {})) typeof t == "string" ? te[e] = t : Array.isArray(t) && (te[e] = t.join(", "));
4005
+ let A = await Ba(Aa(Y, {
3972
4006
  route: h.route.pattern,
3973
4007
  pathname: d
3974
4008
  }), {
3975
4009
  pathname: d,
3976
4010
  search: f,
3977
- headers: j,
3978
- cookies: _a(j.cookie),
4011
+ headers: te,
4012
+ cookies: Na(te.cookie),
3979
4013
  route: h.route.pattern
3980
- }, ze);
3981
- for (let e of M.setCookies) c.appendHeader("set-cookie", xa(e));
3982
- for (let [e, t] of Object.entries(M.responseHeaders)) c.setHeader(e, t);
3983
- if (T === "isr" && M.cspNonce !== void 0) throw Error(`page '${h.route.pattern}' is renderMode 'isr' while middleware.ts mints a cspNonce — an isr render is CACHED and a cached nonce is a lie the browser enforces. Use renderMode 'ssr' for nonce'd pages, or a hash-based CSP for isr.`);
3984
- let N = T === "isr" ? Oa(M.headers) : M.headers, P = T === "isr" && w.ppr === !0, ee = P ? Pa(N, h.route.pattern) : N, te = So(xo(a[0], { allowDevProxy: !0 }), N.cookie, {
4014
+ }, Re);
4015
+ for (let e of A.setCookies) c.appendHeader("set-cookie", La(e));
4016
+ for (let [e, t] of Object.entries(A.responseHeaders)) c.setHeader(e, t);
4017
+ if (T === "isr" && A.cspNonce !== void 0) throw Error(`page '${h.route.pattern}' is renderMode 'isr' while middleware.ts mints a cspNonce — an isr render is CACHED and a cached nonce is a lie the browser enforces. Use renderMode 'ssr' for nonce'd pages, or a hash-based CSP for isr.`);
4018
+ let j = T === "isr" ? Wa(A.headers) : A.headers, ne = T === "isr" && w.ppr === !0, M = ne ? uo(j, h.route.pattern) : j, re = Xo(Yo(a[0], { allowDevProxy: !0 }), j.cookie, {
3985
4019
  apiName: a[0]?.name,
3986
- headers: N
3987
- }), ne = new AbortController(), re = () => ne.abort();
3988
- c.once("close", re);
3989
- let ie = null, ae = [], F = {};
4020
+ headers: j
4021
+ }), ie = new AbortController(), ae = () => ie.abort();
4022
+ c.once("close", ae);
4023
+ let oe = null, se = [], ce = {};
3990
4024
  try {
3991
- (await r("@voltro/web/ssr")).beginStoreSeeds(), {chain: ae, segmentLoaderData: F} = await x("loadChain", () => ao({
3992
- entries: D,
3993
- loadLayout: (t) => r(I(e, "src", "pages", t.dir, "layout.tsx")),
3994
- loadError: (t) => r(I(e, "src", "pages", t.dir, "error.tsx")),
3995
- loadPending: (t) => r(I(e, "src", "pages", t.dir, "loading.tsx")),
4025
+ (await r("@voltro/web/ssr")).beginStoreSeeds(), {chain: se, segmentLoaderData: ce} = await x("loadChain", () => Po({
4026
+ entries: E,
4027
+ loadLayout: (t) => r(F(e, "src", "pages", t.dir, "layout.tsx")),
4028
+ loadError: (t) => r(F(e, "src", "pages", t.dir, "error.tsx")),
4029
+ loadPending: (t) => r(F(e, "src", "pages", t.dir, "loading.tsx")),
3996
4030
  ctx: {
3997
4031
  params: h.params,
3998
4032
  pathname: d,
3999
4033
  search: f,
4000
- signal: ne.signal,
4001
- headers: ee,
4002
- query: te,
4034
+ signal: ie.signal,
4035
+ headers: M,
4036
+ query: re,
4003
4037
  isServer: !0
4004
4038
  }
4005
4039
  }));
4006
4040
  let t = w.loader;
4007
- typeof t == "function" && !k && (ie = await x("loader", () => t({
4041
+ typeof t == "function" && !ee && (oe = await x("loader", () => t({
4008
4042
  params: h.params,
4009
4043
  pathname: d,
4010
4044
  search: f,
4011
- signal: ne.signal,
4012
- headers: ee,
4013
- query: te,
4045
+ signal: ie.signal,
4046
+ headers: M,
4047
+ query: re,
4014
4048
  isServer: !0
4015
4049
  })));
4016
4050
  } finally {
4017
- c.off("close", re);
4051
+ c.off("close", ae);
4018
4052
  }
4019
- let L = await x("loadSsrHelpers", async () => await r("@voltro/web/ssr"));
4020
- k || await ta({
4053
+ let N = await x("loadSsrHelpers", async () => await r("@voltro/web/ssr"));
4054
+ ee || await _a({
4021
4055
  pageMod: w,
4022
4056
  params: h.params,
4023
- query: te,
4057
+ query: re,
4024
4058
  apiName: a[0]?.name,
4025
- seed: L.seedPreloadedSubscription,
4026
- seedFailure: L.seedPreloadedSubscriptionFailure,
4059
+ seed: N.seedPreloadedSubscription,
4060
+ seedFailure: N.seedPreloadedSubscriptionFailure,
4027
4061
  onError: ({ tag: e, apiName: t }, n) => Q.warn("preload seed failed", {
4028
4062
  tag: e,
4029
4063
  apiName: t,
4030
4064
  pathname: d
4031
4065
  }, n)
4032
4066
  });
4033
- let R = {
4067
+ let P = {
4034
4068
  pattern: h.route.pattern,
4035
4069
  Component: w.default,
4036
4070
  meta: w.meta,
@@ -4038,248 +4072,251 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4038
4072
  ErrorBoundary: w.ErrorBoundary,
4039
4073
  Pending: w.Pending,
4040
4074
  renderMode: T,
4041
- chain: ae
4042
- }, z = {
4043
- cookies: P ? Fa(ka(M.cookies), h.route.pattern) : T === "isr" ? ka(M.cookies) : M.cookies,
4044
- headers: ee,
4075
+ chain: se
4076
+ }, le = {
4077
+ cookies: ne ? fo(Ga(A.cookies), h.route.pattern) : T === "isr" ? Ga(A.cookies) : A.cookies,
4078
+ headers: M,
4045
4079
  url: u,
4046
4080
  ...p === void 0 ? {} : { formFlash: p }
4047
- }, B = (await s())(N.cookie, N["accept-language"]);
4048
- C = B !== void 0 && o;
4049
- let oe = B ? {
4050
- outerWrap: B.outerWrap,
4051
- locale: B.locale
4052
- } : {}, H = k ? er({
4053
- helpers: L,
4081
+ }, I = (await s())(j.cookie, j["accept-language"]);
4082
+ C = I !== void 0 && o;
4083
+ let L = I ? {
4084
+ outerWrap: I.outerWrap,
4085
+ locale: I.locale
4086
+ } : {}, R = ee ? Gi({
4087
+ helpers: N,
4054
4088
  page: `src/pages/${h.route.file}`,
4055
- interactive: A,
4089
+ interactive: k,
4056
4090
  delivery: "stream",
4057
4091
  renderInput: {
4058
- descriptor: R,
4092
+ descriptor: P,
4059
4093
  params: h.params,
4060
4094
  pathname: d,
4061
4095
  search: f,
4062
- segmentLoaderData: F,
4063
- requestContext: z,
4064
- ...oe
4096
+ segmentLoaderData: ce,
4097
+ requestContext: le,
4098
+ ...L
4065
4099
  }
4066
- }) : null, U = k ? null : $n({
4067
- helpers: L,
4100
+ }) : null, z = ee ? null : Wi({
4101
+ helpers: N,
4068
4102
  page: `src/pages/${h.route.file}`,
4069
4103
  pathname: d,
4070
4104
  renderMode: T,
4071
- interactive: A,
4072
- loaderData: ie,
4073
- segmentLoaderData: F,
4105
+ interactive: k,
4106
+ loaderData: oe,
4107
+ segmentLoaderData: ce,
4074
4108
  pageLoaderRan: typeof w.loader == "function",
4075
- ...P ? { ppr: !0 } : {}
4109
+ ...ne ? { ppr: !0 } : {}
4076
4110
  });
4077
- P && U !== null && za(U.stateInput, h.route.pattern);
4078
- let se = [];
4111
+ ne && z !== null && mo(z.stateInput, h.route.pattern);
4112
+ let ue = [];
4079
4113
  await x("collectCss", async () => {
4080
4114
  let t = /* @__PURE__ */ new Set(), n = [
4081
- I(e, "src", "pages", h.route.file),
4082
- ...D.flatMap((t) => [
4083
- ...t.hasLayout ? [I(e, "src", "pages", t.dir, "layout.tsx")] : [],
4084
- ...t.hasError ? [I(e, "src", "pages", t.dir, "error.tsx")] : [],
4085
- ...t.hasPending ? [I(e, "src", "pages", t.dir, "loading.tsx")] : []
4115
+ F(e, "src", "pages", h.route.file),
4116
+ ...E.flatMap((t) => [
4117
+ ...t.hasLayout ? [F(e, "src", "pages", t.dir, "layout.tsx")] : [],
4118
+ ...t.hasError ? [F(e, "src", "pages", t.dir, "error.tsx")] : [],
4119
+ ...t.hasPending ? [F(e, "src", "pages", t.dir, "loading.tsx")] : []
4086
4120
  ]),
4087
- I(e, ".framework", "main.tsx")
4121
+ F(e, ".framework", "main.tsx")
4088
4122
  ];
4089
- for (let e of n) await S(e, t, se);
4123
+ for (let e of n) await S(e, t, ue);
4090
4124
  });
4091
- let ce = (A === "islands" ? await x("islandsEntry", async () => {
4092
- let t = Co(a, "../../app.config"), n = (await gn({
4125
+ let V = (k === "islands" ? await x("islandsEntry", async () => {
4126
+ let t = Zo(a, "../../app.config"), n = (await Cn({
4093
4127
  webRoot: e,
4094
4128
  pages: [{
4095
4129
  pattern: h.route.pattern,
4096
4130
  file: h.route.file
4097
4131
  }],
4098
- headSnippets: dn(await J()),
4132
+ headSnippets: vn(await je()),
4099
4133
  apiImports: t.imports,
4100
4134
  apiEntriesLiteral: `[\n${t.providerEntryLines.join("\n")}\n ]`
4101
4135
  }))[0];
4102
- return n === void 0 ? void 0 : await V.readFile(I(e, ".framework", n.htmlFile), "utf8");
4103
- }) : void 0) ?? await x("readShell", J), W = await x("transformShell", () => t.transformIndexHtml(u, ce)), G = se.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), le = B?.locale ?? z.cookies["voltro:locale"] ?? n.defaultLocale ?? (n.locales ?? [])[0] ?? "en", K = Date.now(), ue = {
4104
- lang: le,
4105
- ...B?.timeZone === void 0 ? {} : { timeZone: B.timeZone },
4106
- renderedAt: K
4136
+ return n === void 0 ? void 0 : await B.readFile(F(e, ".framework", n.htmlFile), "utf8");
4137
+ }) : void 0) ?? await x("readShell", je), H = await x("transformShell", () => t.transformIndexHtml(u, V)), de = ue.map((e) => `<link rel="stylesheet" href="${e}?direct" />`).join("\n "), U = I?.locale ?? le.cookies["voltro:locale"] ?? n.defaultLocale ?? (n.locales ?? [])[0] ?? "en", fe = Date.now(), pe = {
4138
+ lang: U,
4139
+ ...I?.timeZone === void 0 ? {} : { timeZone: I.timeZone },
4140
+ renderedAt: fe
4107
4141
  };
4108
- if (H) {
4109
- let e = (e) => nr({
4110
- helpers: L,
4111
- prepared: H,
4142
+ if (R) {
4143
+ let e = (e) => qi({
4144
+ helpers: N,
4145
+ prepared: R,
4112
4146
  meta: e,
4113
- interactive: A,
4114
- extra: [G]
4147
+ interactive: k,
4148
+ extra: [de]
4115
4149
  });
4116
- if (H.hasDeferred) Qi({
4150
+ if (R.hasDeferred) ma({
4117
4151
  res: c,
4118
- shell: qi({
4119
- shell: W,
4152
+ shell: ca({
4153
+ shell: H,
4120
4154
  inlineModuleScriptsAsync: !0
4121
4155
  }),
4122
- documentAttrs: ue,
4156
+ documentAttrs: pe,
4123
4157
  headers: {
4124
4158
  "content-type": "text/html; charset=utf-8",
4125
4159
  "x-voltro-rendered-by": "spa-shell-dev"
4126
4160
  },
4127
4161
  headInjection: e,
4128
- render: (e) => L.renderPageToStream({
4129
- ...H.renderInput,
4130
- ...e
4162
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce },
4163
+ render: (e) => N.renderPageToStream({
4164
+ ...R.renderInput,
4165
+ ...e,
4166
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce }
4131
4167
  }),
4132
4168
  onShellError: (e) => {
4133
- we(c, "spa-shell-dev", d, h.route.pattern, e, C);
4169
+ Ee(c, "spa-shell-dev", d, h.route.pattern, e, C);
4134
4170
  }
4135
4171
  });
4136
4172
  else {
4137
- let t = tr({
4138
- helpers: L,
4139
- prepared: H
4140
- }), n = Xi(W.replace("<div id=\"root\"></div>", `<div id="root">${t.body}</div>`).replace("</head>", ` ${e(t.meta)}\n </head>`), ue);
4141
- c.statusCode = 200, c.setHeader("content-type", "text/html; charset=utf-8"), c.setHeader("x-voltro-rendered-by", "spa-shell-dev"), c.end(n);
4173
+ let t = Ki({
4174
+ helpers: N,
4175
+ prepared: R
4176
+ }), n = fa(H.replace("<div id=\"root\"></div>", `<div id="root">${t.body}</div>`).replace("</head>", ` ${e(t.meta)}\n </head>`), pe);
4177
+ c.statusCode = 200, c.setHeader("content-type", "text/html; charset=utf-8"), c.setHeader("x-voltro-rendered-by", "spa-shell-dev"), c.end(A.cspNonce === void 0 ? n : ua(n, A.cspNonce));
4142
4178
  }
4143
- } else if (U) {
4179
+ } else if (z) {
4144
4180
  let e = (e) => {
4145
- if (E === null || T !== "ssr" && T !== "isr" || typeof w.ogImage != "function" || e.includes("og:image")) return "";
4146
- let t = i.headers["x-tenant"], n = E.signOgUrl({
4181
+ if (D === null || T !== "ssr" && T !== "isr" || typeof w.ogImage != "function" || e.includes("og:image")) return "";
4182
+ let t = i.headers["x-tenant"], n = D.signOgUrl({
4147
4183
  pattern: h.route.pattern,
4148
4184
  params: h.params,
4149
4185
  ...typeof t == "string" ? { tenant: t } : {}
4150
4186
  });
4151
4187
  return `<meta property="og:image" content="${n}" /><meta name="twitter:image" content="${n}" /><meta name="twitter:card" content="summary_large_image" />`;
4152
4188
  }, t = (t) => [
4153
- G,
4154
- L.renderMetaToHtml(t) + e(L.renderMetaToHtml(t)),
4155
- `<meta name="voltro-interactive" content="${A}" />`,
4156
- ...U.hasDeferred ? [L.renderDeferredRegistryScript()] : [],
4157
- L.renderRouterStateScript(U.stateInput)
4189
+ de,
4190
+ N.renderMetaToHtml(t) + e(N.renderMetaToHtml(t)),
4191
+ `<meta name="voltro-interactive" content="${k}" />`,
4192
+ ...z.hasDeferred ? [N.renderDeferredRegistryScript()] : [],
4193
+ N.renderRouterStateScript(z.stateInput)
4158
4194
  ].filter((e) => e.length > 0).join("\n "), n = {
4159
- descriptor: R,
4195
+ descriptor: P,
4160
4196
  params: h.params,
4161
4197
  pathname: d,
4162
4198
  search: f,
4163
- loaderData: U.loaderData,
4164
- segmentLoaderData: U.segmentLoaderData,
4165
- requestContext: z,
4166
- ...oe
4199
+ loaderData: z.loaderData,
4200
+ segmentLoaderData: z.segmentLoaderData,
4201
+ requestContext: le,
4202
+ ...L
4167
4203
  };
4168
- if (T === "ssr" && A === "full" && p === void 0) Qi({
4204
+ if (T === "ssr" && k === "full" && p === void 0) ma({
4169
4205
  res: c,
4170
- shell: qi({
4171
- shell: W,
4206
+ shell: ca({
4207
+ shell: H,
4172
4208
  inlineModuleScriptsAsync: !0
4173
4209
  }),
4174
- documentAttrs: ue,
4210
+ documentAttrs: pe,
4175
4211
  headers: {
4176
4212
  "content-type": "text/html; charset=utf-8",
4177
4213
  "x-voltro-rendered-by": "ssr-dev"
4178
4214
  },
4179
4215
  headInjection: t,
4180
- render: (e) => L.renderPageToStream({
4216
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce },
4217
+ render: (e) => N.renderPageToStream({
4181
4218
  ...n,
4182
4219
  ...e,
4183
- ...M.cspNonce === void 0 ? {} : { nonce: M.cspNonce }
4220
+ ...A.cspNonce === void 0 ? {} : { nonce: A.cspNonce }
4184
4221
  }),
4185
4222
  onShellError: (e) => {
4186
- we(c, "ssr-dev", d, h.route.pattern, e, C);
4223
+ Ee(c, "ssr-dev", d, h.route.pattern, e, C);
4187
4224
  }
4188
4225
  });
4189
4226
  else {
4190
- let { html: e, meta: r } = L.renderPageToHtml(n), i = Xi(W.replace("<div id=\"root\"></div>", `<div id="root">${e}</div>`).replace("</head>", ` ${t(r)}\n </head>`), ue);
4227
+ let { html: e, meta: r } = N.renderPageToHtml(n), i = fa(H.replace("<div id=\"root\"></div>", `<div id="root">${e}</div>`).replace("</head>", ` ${t(r)}\n </head>`), pe);
4191
4228
  c.statusCode = p === void 0 ? g ? 404 : 200 : 422, c.setHeader("content-type", "text/html; charset=utf-8"), c.setHeader("x-voltro-rendered-by", g ? "ssr-not-found" : "ssr-dev"), p !== void 0 && c.setHeader("cache-control", "no-store");
4192
- let o = p === void 0 ? i : Gt(i, p);
4193
- if (P && p === void 0 && typeof w.loader == "function") {
4194
- c.setHeader("x-voltro-ppr", "shell+holes"), c.write(o);
4195
- let e = So(xo(a[0], { allowDevProxy: !0 }), M.headers.cookie, {
4229
+ let o = p === void 0 ? i : Zt(i, p);
4230
+ if (ne && p === void 0 && typeof w.loader == "function") {
4231
+ c.setHeader("x-voltro-ppr", "shell+holes"), to(h.route.pattern), c.write(o);
4232
+ let e = Xo(Yo(a[0], { allowDevProxy: !0 }), A.headers.cookie, {
4196
4233
  apiName: a[0]?.name,
4197
- headers: M.headers
4234
+ headers: A.headers
4198
4235
  }), t = new AbortController();
4199
- await Ra({
4236
+ await po({
4200
4237
  loader: w.loader,
4201
4238
  ctx: {
4202
4239
  params: h.params,
4203
4240
  pathname: d,
4204
4241
  search: f,
4205
4242
  signal: t.signal,
4206
- headers: M.headers,
4243
+ headers: A.headers,
4207
4244
  query: e,
4208
4245
  isServer: !0
4209
4246
  },
4210
4247
  res: c,
4211
- helpers: L,
4248
+ helpers: N,
4212
4249
  page: h.route.pattern,
4213
4250
  log: Q
4214
4251
  });
4215
- } else c.end(M.cspNonce === void 0 ? o : rr(o, M.cspNonce));
4252
+ } else c.end(A.cspNonce === void 0 ? o : ua(o, A.cspNonce));
4216
4253
  }
4217
4254
  }
4218
- b.render = Date.now() - K;
4219
- let q = Date.now() - y;
4220
- v ? (Ce.add(h.route.pattern), Q.info(`ssr compiled ${h.route.pattern} in ${q}ms`, {
4255
+ b.render = Date.now() - fe;
4256
+ let W = Date.now() - v;
4257
+ _ ? (Te.add(h.route.pattern), Q.info(`ssr compiled ${h.route.pattern} in ${W}ms`, {
4221
4258
  pattern: h.route.pattern,
4222
4259
  pathname: d,
4223
- elapsedMs: q,
4260
+ elapsedMs: W,
4224
4261
  cold: !0,
4225
4262
  phases: b
4226
- })) : q > 200 && Q.info(`ssr rendered ${d} in ${q}ms`, {
4263
+ })) : W > 200 && Q.info(`ssr rendered ${d} in ${W}ms`, {
4227
4264
  pattern: h.route.pattern,
4228
4265
  pathname: d,
4229
- elapsedMs: q,
4266
+ elapsedMs: W,
4230
4267
  cold: !1,
4231
4268
  phases: b
4232
4269
  });
4233
4270
  } catch (e) {
4234
- if (Zn(e)) {
4271
+ if (Hi(e)) {
4235
4272
  Q.error("ssr-dev render refused", {
4236
4273
  pathname: d,
4237
4274
  pattern: h.route.pattern
4238
4275
  }, e), c.statusCode = 500, c.setHeader("content-type", "text/plain; charset=utf-8"), c.end(e.message);
4239
4276
  return;
4240
4277
  }
4241
- let t = Qn(e);
4278
+ let t = Ui(e);
4242
4279
  if (t) {
4243
4280
  c.statusCode = t.status;
4244
4281
  for (let [e, n] of Object.entries(t.headers)) c.setHeader(e, String(n));
4245
4282
  c.end(t.body);
4246
4283
  return;
4247
4284
  }
4248
- we(c, "ssr-dev", d, h.route.pattern, e, C);
4285
+ Ee(c, "ssr-dev", d, h.route.pattern, e, C);
4249
4286
  }
4250
4287
  });
4251
4288
  }
4252
- }, ke = Date.now(), Ae = j.version ?? "?", je = await Ua(), Ne = I(e, "node_modules", "@voltro", "ui-shadcn"), Pe = B(I(Ne, "package.json")) ? Ne : null, Fe = [], Ie = await (async () => {
4289
+ }, Ne = Date.now(), Pe = A.version ?? "?", K = await vo(), Fe = F(e, "node_modules", "@voltro", "ui-shadcn"), q = z(F(Fe, "package.json")) ? Fe : null, J = [], Ie = await (async () => {
4253
4290
  let t = [];
4254
4291
  for (let n of a) {
4255
- let r = await fo(e, n.pkg);
4292
+ let r = await Bo(e, n.pkg);
4256
4293
  r && t.push(r);
4257
4294
  }
4258
- let n = await oa(t);
4295
+ let n = await Sa(t);
4259
4296
  if (n === void 0) return !1;
4260
- let r = I(P, ".voltro-rpcgroup-optimize"), i = "";
4297
+ let r = F(M, ".voltro-rpcgroup-optimize"), i = "";
4261
4298
  try {
4262
- i = (await V.readFile(r, "utf8")).trim();
4299
+ i = (await B.readFile(r, "utf8")).trim();
4263
4300
  } catch {}
4264
4301
  if (i === n) return !1;
4265
4302
  try {
4266
- await V.writeFile(r, n);
4303
+ await B.writeFile(r, n);
4267
4304
  } catch {}
4268
4305
  return !0;
4269
- })(), Re = /* @__PURE__ */ new Set(), ze = (e) => {
4270
- Re.has(e.name) || (Re.add(e.name), Q.warn(`middleware.ts wrote the cookie "${e.name}" with the HttpOnly default — a browser SDK cannot read it`, {
4306
+ })(), Le = /* @__PURE__ */ new Set(), Re = (e) => {
4307
+ Le.has(e.name) || (Le.add(e.name), Q.warn(`middleware.ts wrote the cookie "${e.name}" with the HttpOnly default — a browser SDK cannot read it`, {
4271
4308
  cookie: e.name,
4272
4309
  hint: "If your IdP client reads this from `document.cookie` (Supabase's `createBrowserClient` does), pass `httpOnly: false`. Otherwise the SSR render succeeds and the user is signed out at the first client-side call. Set `httpOnly: true` explicitly to silence this."
4273
4310
  }));
4274
- }, Y = await Ca(e);
4275
- Y.length > 0 && Q.info(`middleware.ts loaded — ${Y.length} middleware(s): ` + Y.map((e) => e.exportName).join(", ")), ga(Y, O.ssrRoutes.map((e) => e.pattern)), Ie && Q.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
4311
+ }, Y = await za(e);
4312
+ Y.length > 0 && Q.info(`middleware.ts loaded — ${Y.length} middleware(s): ` + Y.map((e) => e.exportName).join(", ")), Ma(Y, O.ssrRoutes.map((e) => e.pattern)), Ie && Q.info("rpcGroup changed since last boot — forcing a dep re-optimize so the browser loads the current api client");
4276
4313
  try {
4277
- await ht(l, "voltro dev (web)");
4314
+ await xt(l, "voltro dev (web)");
4278
4315
  } catch (e) {
4279
4316
  Q.error(String(e.message ?? e)), process.exit(1);
4280
4317
  }
4281
- await (await j.createServer({
4282
- root: P,
4318
+ await (await A.createServer({
4319
+ root: M,
4283
4320
  envPrefix: "__VOLTRO_VITE_ENV_DISABLED__",
4284
4321
  ssr: { noExternal: ["react-intl", "@voltro/i18n"] },
4285
4322
  resolve: {
@@ -4290,72 +4327,72 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4290
4327
  "@voltro/i18n"
4291
4328
  ],
4292
4329
  alias: [
4293
- ...je ? [{
4330
+ ...K ? [{
4294
4331
  find: "@voltro/devtools/styles.css",
4295
- replacement: I(je, "src/styles.css")
4332
+ replacement: F(K, "src/styles.css")
4296
4333
  }, {
4297
4334
  find: "@voltro/devtools",
4298
- replacement: I(je, "src/index.ts")
4335
+ replacement: F(K, "src/index.ts")
4299
4336
  }] : [],
4300
- ...Pe ? [
4337
+ ...q ? [
4301
4338
  {
4302
4339
  find: "@voltro/ui-shadcn/tokens.css",
4303
- replacement: I(Pe, "src/tokens.css")
4340
+ replacement: F(q, "src/tokens.css")
4304
4341
  },
4305
4342
  {
4306
4343
  find: "@voltro/ui-shadcn/cn",
4307
- replacement: I(Pe, "src/cn.ts")
4344
+ replacement: F(q, "src/cn.ts")
4308
4345
  },
4309
4346
  {
4310
4347
  find: "@voltro/ui-shadcn/brand",
4311
- replacement: I(Pe, "src/brand/voltroLogo.tsx")
4348
+ replacement: F(q, "src/brand/voltroLogo.tsx")
4312
4349
  },
4313
4350
  {
4314
4351
  find: "@voltro/ui-shadcn",
4315
- replacement: I(Pe, "src/index.ts")
4352
+ replacement: F(q, "src/index.ts")
4316
4353
  }
4317
4354
  ] : [],
4318
- ...Rt(e)
4355
+ ...Wt(e)
4319
4356
  ]
4320
4357
  },
4321
4358
  optimizeDeps: {
4322
- include: [...a.map((e) => `${e.pkg}/rpcGroup`), ...Fe],
4359
+ include: [...a.map((e) => `${e.pkg}/rpcGroup`), ...J],
4323
4360
  force: Ie
4324
4361
  },
4325
- customLogger: It(),
4362
+ customLogger: Ht(),
4326
4363
  plugins: [
4327
- yi(I(e, "src", "pages")),
4328
- Cn({
4364
+ Ei(F(e, "src", "pages")),
4365
+ An({
4329
4366
  root: e,
4330
- config: D(n.images)
4367
+ config: ee(n.images)
4331
4368
  }),
4332
- On(e, n.fonts),
4333
- Rn(e, n.feeds ?? [], n.seo?.siteUrl),
4334
- M(),
4335
- N(),
4336
- oe,
4337
- W,
4338
- pe,
4339
- ge,
4340
- _e,
4369
+ Fn(e, n.fonts),
4370
+ er(e, n.feeds ?? [], n.seo?.siteUrl),
4371
+ j(),
4372
+ ne(),
4373
+ le,
4374
+ de,
4375
+ G,
4376
+ ye,
4341
4377
  be,
4342
- Oe,
4343
- ...Se ? [Se] : []
4378
+ Ce,
4379
+ Me,
4380
+ ...we ? [we] : []
4344
4381
  ],
4345
4382
  server: {
4346
4383
  port: l,
4347
4384
  strictPort: !0,
4348
4385
  host: !0,
4349
4386
  allowedHosts: n.allowedHosts === !0 || [...n.allowedHosts ?? []],
4350
- proxy: ve,
4351
- fs: { allow: [e, ...Ya(e)] }
4387
+ proxy: xe,
4388
+ fs: { allow: [e, ...wo(e)] }
4352
4389
  },
4353
4390
  appType: "spa",
4354
- cacheDir: I(P, ".vite"),
4355
- publicDir: I(e, "public")
4356
- })).listen(), Ba.info(`v${Ae} ready in ${Date.now() - ke}ms`, {
4357
- version: Ae,
4358
- bootMs: Date.now() - ke
4391
+ cacheDir: F(M, ".vite"),
4392
+ publicDir: F(e, "public")
4393
+ })).listen(), ho.info(`v${Pe} ready in ${Date.now() - Ne}ms`, {
4394
+ version: Pe,
4395
+ bootMs: Date.now() - Ne
4359
4396
  }), Q.info(`listening on http://localhost:${l}`, {
4360
4397
  port: l,
4361
4398
  app: n.name ?? "(unnamed)"
@@ -4365,62 +4402,62 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4365
4402
  target: e.proxyTarget
4366
4403
  }), Q.info(`proxy /_voltro/api/${e.name} → ${e.proxyTarget.replace(/^ws/, "http")}/_voltro/inspect`, { api: e.name }));
4367
4404
  try {
4368
- await ee({
4369
- id: x,
4370
- name: b,
4405
+ await ie({
4406
+ id: S,
4407
+ name: _,
4371
4408
  kind: "web",
4372
4409
  url: `http://localhost:${l}`,
4373
4410
  pid: process.pid,
4374
4411
  status: "live",
4375
- logFile: S.path
4412
+ logFile: C.path
4376
4413
  });
4377
- let t = Ci(e);
4414
+ let t = Ai(e);
4378
4415
  if (t) {
4379
- let e = await Ni({ dashboardAppPath: t });
4416
+ let e = await Bi({ dashboardAppPath: t });
4380
4417
  e.status === "launched" ? Q.info(`dashboard launched at http://localhost:${e.port}`, { port: e.port }) : e.status === "already-running" && Q.debug(`dashboard already running on :${e.port}`, { port: e.port });
4381
4418
  }
4382
4419
  setInterval(() => {
4383
- ee({
4384
- id: x,
4385
- name: b,
4420
+ ie({
4421
+ id: S,
4422
+ name: _,
4386
4423
  kind: "web",
4387
4424
  url: `http://localhost:${l}`,
4388
4425
  pid: process.pid,
4389
4426
  status: "live",
4390
- logFile: S.path
4427
+ logFile: C.path
4391
4428
  }).catch(() => {});
4392
4429
  }, 1e4).unref();
4393
4430
  let n = () => {
4394
- ne(x), S.dispose();
4431
+ oe(S), C.dispose();
4395
4432
  };
4396
4433
  process.on("SIGINT", n), process.on("SIGTERM", n);
4397
4434
  } catch (e) {
4398
4435
  Q.warn("runtime-registry write failed", {}, e);
4399
4436
  }
4400
- return ue({
4437
+ return ge({
4401
4438
  app: n.name ?? "unnamed",
4402
4439
  kind: "web",
4403
4440
  url: `http://localhost:${l}`,
4404
- bootMs: Date.now() - ke
4441
+ bootMs: Date.now() - Ne
4405
4442
  }), new Promise(() => {});
4406
- }, Ao = async (t) => {
4443
+ }, is = async (t) => {
4407
4444
  e("serve");
4408
- let n = await Do(t);
4445
+ let n = await ts(t);
4409
4446
  if (!n) return {
4410
4447
  ran: !1,
4411
4448
  exitCode: 0
4412
4449
  };
4413
4450
  let i = Date.now(), a = Q.child("serve");
4414
4451
  a.info("booting voltro serve (preview)", { app: n.name ?? "(unnamed)" });
4415
- let o = await _o(t, n);
4452
+ let o = await Go(t, n);
4416
4453
  for (let e of o) a.info("api wired", {
4417
4454
  name: e.name,
4418
4455
  pkg: e.pkg
4419
4456
  });
4420
- await wo(t, n, o);
4457
+ await Qo(t, n, o);
4421
4458
  {
4422
- let { pages: e } = await ro(I(t, "src", "pages"));
4423
- await mr({
4459
+ let { pages: e } = await Mo(F(t, "src", "pages"));
4460
+ await xr({
4424
4461
  appRoot: t,
4425
4462
  pages: e
4426
4463
  });
@@ -4429,12 +4466,12 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4429
4466
  kind: "web",
4430
4467
  configPort: n.port,
4431
4468
  env: process.env
4432
- }).port, c = await Xe("vite", () => import("vite")), l = (await import("@vitejs/plugin-react")).default, u = I(t, ".framework");
4469
+ }).port, c = await it("vite", () => import("vite")), l = (await import("@vitejs/plugin-react")).default, u = F(t, ".framework");
4433
4470
  Q.info("running production build"), await c.build({
4434
4471
  root: u,
4435
4472
  envPrefix: "__VOLTRO_VITE_ENV_DISABLED__",
4436
4473
  plugins: [l()],
4437
- customLogger: It(),
4474
+ customLogger: Ht(),
4438
4475
  resolve: { dedupe: [
4439
4476
  "react",
4440
4477
  "react-dom",
@@ -4443,9 +4480,9 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4443
4480
  ] },
4444
4481
  build: {
4445
4482
  outDir: "dist",
4446
- rollupOptions: { output: { manualChunks: Za } }
4483
+ rollupOptions: { output: { manualChunks: Eo } }
4447
4484
  },
4448
- publicDir: I(t, "public")
4485
+ publicDir: F(t, "public")
4449
4486
  });
4450
4487
  let d = (await c.preview({
4451
4488
  root: u,
@@ -4456,7 +4493,7 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4456
4493
  label: "Local",
4457
4494
  url: e
4458
4495
  })) ?? [];
4459
- return ue({
4496
+ return ge({
4460
4497
  app: n.name ?? "unnamed",
4461
4498
  kind: "preview",
4462
4499
  url: f,
@@ -4465,4 +4502,4 @@ The wrapper is what carries \`match\`, and what lets \`voltro doctor\` report wh
4465
4502
  }), new Promise(() => {});
4466
4503
  };
4467
4504
  //#endregion
4468
- export { Fr as $, Oa as A, Vt as At, Xi as B, st as Bt, wo as C, gn as Ct, Fa as D, pn as Dt, La as E, un as Et, _a as F, wt as Ft, Si as G, tt as Gt, qi as H, at as Ht, wa as I, Et as It, ai as J, Ni as K, et as Kt, ma as L, Dt as Lt, Sa as M, Rt as Mt, Ca as N, Ct as Nt, Pa as O, Le as Ot, ha as P, Tt as Pt, Br as Q, xa as R, ht as Rt, Oo as S, Cn as St, za as T, mn as Tt, Qi as U, ot as Ut, Ji as V, ct as Vt, wi as W, rt as Wt, Xr as X, ei as Y, Jr as Z, yo as _, Wn as _t, Co as a, mr as at, Za as b, An as bt, Eo as c, er as ct, $ as d, ir as dt, Cr as et, no as f, rr as ft, ho as g, Un as gt, mo as h, qn as ht, Ha as i, yr as it, ga as j, zt as jt, ka as k, Qt as kt, io as l, tr as lt, _o as m, Yn as mt, xo as n, wr as nt, So as o, Zn as ot, Do as p, Jn as pt, Ci as q, Xe as qt, go as r, br as rt, ao as s, $n as st, Qa as t, Sr as tt, to as u, nr as ut, ko as v, Fn as vt, Ra as w, dn as wt, ro as x, En as xt, Ao as y, Mn as yt, ta as z, ut as zt };
4505
+ export { Bi as $, Wa as A, on as At, fa as B, gt as Bt, Qo as C, Cn as Ct, uo as D, bn as Dt, fo as E, _n as Et, Na as F, jt as Ft, Hi as G, ct as Gt, ca as H, mt as Ht, Ba as I, At as It, Ki as J, Wi as K, it as Kt, Aa as L, Mt as Lt, Ra as M, Gt as Mt, za as N, Wt as Nt, to as O, Ue as Ot, ja as P, kt as Pt, ki as Q, La as R, Nt as Rt, ns as S, An as St, mo as T, xn as Tt, ua as U, dt as Ut, la as V, pt as Vt, ma as W, lt as Wt, Ji as X, qi as Y, ji as Z, qo as _, or as _t, Zo as a, qr as at, Eo as b, Ln as bt, es as c, kr as ct, $ as d, Er as dt, Ai as et, jo as f, xr as ft, Uo as g, ar as gt, Ho as h, lr as ht, _o as i, ti as it, Ma as j, qt as jt, Ga as k, tn as kt, No as l, jr as lt, Go as m, dr as mt, Yo as n, si as nt, Xo as o, Hr as ot, ts as p, ur as pt, Gi as q, Wo as r, ri as rt, Po as s, Ar as st, Do as t, fi as tt, Ao as u, Dr as ut, rs as v, Zn as vt, po as w, vn as wt, Mo as x, Nn as xt, is as y, Jn as yt, _a as z, xt as zt };