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