@wix/himalaya-cli 0.1642.0 → 0.1644.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 (118) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +6 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +3 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +3 -1
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{3361f61ce6b490c8b7b252658ea67f733d88c6e9f95906d0e31eea4827141df3.bin → 155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1.bin} +1 -1
  7. package/dist/browser-plane/sw.js +6 -6
  8. package/dist/cli.mjs +358 -144
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/guides/component-reference.json +1 -1
  11. package/guides/component-reference.md +6 -0
  12. package/guides/designing-himi-screens.md +18 -0
  13. package/guides/offline-reading.md +1 -1
  14. package/guides/recipe-four-state.md +17 -0
  15. package/guides/release-notes.md +21 -0
  16. package/guides/sdk-reference.json +1 -1
  17. package/package.json +2 -2
  18. package/template-icons/conference.png +0 -0
  19. package/templates/beauty-salon/tier5-src/_shared/iap-presentation.ts +5 -2
  20. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +6 -3
  21. package/templates/branded-lite/dev/index.ts +152 -88
  22. package/templates/branded-lite/l10n/en.json +1 -1
  23. package/templates/branded-lite/tier5-src/_shared/featured-event.ts +63 -0
  24. package/templates/branded-lite/tier5-src/_shared/iap-presentation.ts +5 -2
  25. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +93 -11
  26. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +7 -3
  27. package/templates/community-club/dev/index.ts +152 -88
  28. package/templates/community-club/tier5-src/_shared/featured-event.ts +63 -0
  29. package/templates/community-club/tier5-src/_shared/iap-presentation.ts +5 -2
  30. package/templates/community-club/tier5-src/himi-events-detail/index.ts +93 -11
  31. package/templates/conference/README.md +53 -0
  32. package/templates/conference/config.ts +321 -0
  33. package/templates/conference/dev/index.ts +17252 -0
  34. package/templates/conference/himalaya.content.json +46 -0
  35. package/templates/conference/himalaya.template.json +15 -0
  36. package/templates/conference/icon.png +0 -0
  37. package/templates/conference/platforms.json +1 -0
  38. package/templates/conference/tier5-src/_shared/agenda-stars.ts +64 -0
  39. package/templates/conference/tier5-src/_shared/app-locale.ts +61 -0
  40. package/templates/conference/tier5-src/_shared/branded-lite-hosted.ts +279 -0
  41. package/templates/conference/tier5-src/_shared/branded-load-state.ts +109 -0
  42. package/templates/conference/tier5-src/_shared/business-chat-copy.ts +40 -0
  43. package/templates/conference/tier5-src/_shared/business-chat-history.ts +51 -0
  44. package/templates/conference/tier5-src/_shared/business-chat-message-model.ts +177 -0
  45. package/templates/conference/tier5-src/_shared/business-chat-model.ts +56 -0
  46. package/templates/conference/tier5-src/_shared/business-chat-presenter.ts +576 -0
  47. package/templates/conference/tier5-src/_shared/business-chat-transport.ts +148 -0
  48. package/templates/conference/tier5-src/_shared/collection-contract.ts +229 -0
  49. package/templates/conference/tier5-src/_shared/collection-query.ts +193 -0
  50. package/templates/conference/tier5-src/_shared/collection-service.ts +400 -0
  51. package/templates/conference/tier5-src/_shared/engine-intl.ts +508 -0
  52. package/templates/conference/tier5-src/_shared/event-agenda.ts +122 -0
  53. package/templates/conference/tier5-src/_shared/event-registration.ts +86 -0
  54. package/templates/conference/tier5-src/_shared/featured-event.ts +63 -0
  55. package/templates/conference/tier5-src/_shared/himi-account.ts +164 -0
  56. package/templates/conference/tier5-src/_shared/himi-copy.ts +89 -0
  57. package/templates/conference/tier5-src/_shared/himi-events.ts +65 -0
  58. package/templates/conference/tier5-src/_shared/himi-store.ts +7 -0
  59. package/templates/conference/tier5-src/_shared/hosted-checkout.ts +70 -0
  60. package/templates/conference/tier5-src/_shared/iap-attendance-form.ts +106 -0
  61. package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +211 -0
  62. package/templates/conference/tier5-src/_shared/iap-attendance.ts +38 -0
  63. package/templates/conference/tier5-src/_shared/iap-worker.ts +125 -0
  64. package/templates/conference/tier5-src/_shared/inbox-rooms.ts +68 -0
  65. package/templates/conference/tier5-src/_shared/local-preferences.ts +38 -0
  66. package/templates/conference/tier5-src/_shared/member-access.ts +52 -0
  67. package/templates/conference/tier5-src/_shared/member-account-routes.ts +52 -0
  68. package/templates/conference/tier5-src/_shared/member-read.ts +52 -0
  69. package/templates/conference/tier5-src/_shared/member-screen.ts +99 -0
  70. package/templates/conference/tier5-src/_shared/offset-page.ts +10 -0
  71. package/templates/conference/tier5-src/_shared/online-actions.ts +76 -0
  72. package/templates/conference/tier5-src/_shared/owner-load-error.ts +348 -0
  73. package/templates/conference/tier5-src/_shared/payment-setup.ts +6 -0
  74. package/templates/conference/tier5-src/_shared/rich-body.ts +78 -0
  75. package/templates/conference/tier5-src/_shared/rich-content-link.ts +34 -0
  76. package/templates/conference/tier5-src/_shared/sign-in-sheet.ts +18 -0
  77. package/templates/conference/tier5-src/business-chat/index.ts +724 -0
  78. package/templates/conference/tier5-src/himi-conference-agenda/index.ts +183 -0
  79. package/templates/conference/tier5-src/himi-conference-home/index.ts +389 -0
  80. package/templates/conference/tier5-src/himi-events-account/index.ts +219 -0
  81. package/templates/conference/tier5-src/himi-events-detail/index.ts +1304 -0
  82. package/templates/conference/tier5-src/himi-events-list/index.ts +124 -0
  83. package/templates/conference/tier5-src/himi-events-my-events/index.ts +225 -0
  84. package/templates/conference/tier5-src/himi-events-rsvp/index.ts +230 -0
  85. package/templates/conference/tier5-src/himi-store-account/index.ts +998 -0
  86. package/templates/conference/tokens.json +365 -0
  87. package/templates/events-meetups/dev/index.ts +152 -88
  88. package/templates/events-meetups/tier5-src/_shared/featured-event.ts +63 -0
  89. package/templates/events-meetups/tier5-src/_shared/iap-presentation.ts +5 -2
  90. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +93 -11
  91. package/templates/gym-fitness/dev/index.ts +152 -88
  92. package/templates/gym-fitness/tier5-src/_shared/featured-event.ts +63 -0
  93. package/templates/gym-fitness/tier5-src/_shared/iap-presentation.ts +5 -2
  94. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +93 -11
  95. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +6 -3
  96. package/templates/nonprofit-cause/dev/index.ts +152 -88
  97. package/templates/nonprofit-cause/tier5-src/_shared/featured-event.ts +63 -0
  98. package/templates/nonprofit-cause/tier5-src/_shared/iap-presentation.ts +5 -2
  99. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +93 -11
  100. package/templates/podcast-creator/dev/index.ts +152 -88
  101. package/templates/podcast-creator/tier5-src/_shared/featured-event.ts +63 -0
  102. package/templates/podcast-creator/tier5-src/_shared/iap-presentation.ts +5 -2
  103. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +93 -11
  104. package/templates/portfolio-creative/dev/index.ts +152 -88
  105. package/templates/portfolio-creative/tier5-src/_shared/featured-event.ts +63 -0
  106. package/templates/portfolio-creative/tier5-src/_shared/iap-presentation.ts +5 -2
  107. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +93 -11
  108. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +6 -3
  109. package/templates/restaurant/dev/index.ts +152 -88
  110. package/templates/restaurant/tier5-src/_shared/featured-event.ts +63 -0
  111. package/templates/restaurant/tier5-src/_shared/iap-presentation.ts +5 -2
  112. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +93 -11
  113. package/templates/retail-store/tier5-src/_shared/iap-presentation.ts +5 -2
  114. package/templates/retail-store/tier5-src/himi-store-product/index.ts +7 -3
  115. package/templates/yoga-studio/dev/index.ts +152 -88
  116. package/templates/yoga-studio/tier5-src/_shared/featured-event.ts +63 -0
  117. package/templates/yoga-studio/tier5-src/_shared/iap-presentation.ts +5 -2
  118. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +93 -11
package/dist/cli.mjs CHANGED
@@ -5168,16 +5168,16 @@ import { AsyncLocalStorage } from "node:async_hooks";
5168
5168
  function referenceCache() {
5169
5169
  return referenceScope.getStore() ?? new CatalogCache({ cliVersion: bundledVersion });
5170
5170
  }
5171
- function withReferenceCache(cache2, fn2) {
5172
- return referenceScope.run(cache2, fn2);
5171
+ function withReferenceCache(cache3, fn2) {
5172
+ return referenceScope.run(cache3, fn2);
5173
5173
  }
5174
5174
  function referenceIdentity() {
5175
5175
  const s2 = referenceCache().status();
5176
5176
  return { source: s2.source, ...s2.source === "cache" && s2.installed ? { contentVersion: s2.installed.contentVersion, releaseDigest: s2.installed.releaseDigest } : {} };
5177
5177
  }
5178
5178
  function readReference(path2) {
5179
- const cache2 = referenceCache();
5180
- if (cache2.status().source === "cache") return cache2.read(`guides/${path2}`);
5179
+ const cache3 = referenceCache();
5180
+ if (cache3.status().source === "cache") return cache3.read(`guides/${path2}`);
5181
5181
  ensureCheckoutAuthoring();
5182
5182
  try {
5183
5183
  return readFileSync7(join8(GUIDES_DIR, path2), "utf8");
@@ -13697,7 +13697,9 @@ var init_validator = __esm({
13697
13697
  intervalMs: { type: "integer", minimum: 1 },
13698
13698
  action: { type: "string" }
13699
13699
  }
13700
- }
13700
+ },
13701
+ // The worker's boot state (`{ serviceName: initialState }`), for the first frame.
13702
+ bootState: { type: "object" }
13701
13703
  }
13702
13704
  }
13703
13705
  },
@@ -15415,6 +15417,7 @@ function collectDescriptorStrings(descriptor, options = {}) {
15415
15417
  }
15416
15418
  for (const [k2, v2] of Object.entries(obj12)) {
15417
15419
  if (path2 === "" && k2 === "input" && v2 !== null && typeof v2 === "object") continue;
15420
+ if (path2 === "logicBundle" && k2 === "bootState") continue;
15418
15421
  if (v2 && typeof v2 === "object") visit(v2, path2 ? `${path2}.${k2}` : k2);
15419
15422
  }
15420
15423
  };
@@ -16967,6 +16970,7 @@ __export(validate_descriptor_core_exports, {
16967
16970
  appServicesVerdictOf: () => appServicesVerdictOf,
16968
16971
  bareNestedClass: () => bareNestedClass,
16969
16972
  bootBundleWorker: () => bootBundleWorker,
16973
+ bundleNameFromUrl: () => bundleNameFromUrl,
16970
16974
  collectServiceBindings: () => collectServiceBindings,
16971
16975
  componentPropFindings: () => componentPropFindings,
16972
16976
  depthBudgetFindings: () => depthBudgetFindings,
@@ -16987,6 +16991,7 @@ __export(validate_descriptor_core_exports, {
16987
16991
  loadBundleServicesLive: () => loadBundleServicesLive,
16988
16992
  nativeRequiredFindings: () => nativeRequiredFindings,
16989
16993
  nondeterministicServices: () => nondeterministicServices,
16994
+ nondeterministicServicesOrNull: () => nondeterministicServicesOrNull,
16990
16995
  pathCrossesOpaqueAuthorJson: () => pathCrossesOpaqueAuthorJson,
16991
16996
  pathValue: () => pathValue,
16992
16997
  pinnedIntrinsicsSource: () => pinnedIntrinsicsSource,
@@ -17006,6 +17011,7 @@ __export(validate_descriptor_core_exports, {
17006
17011
  validateScreenDescriptor: () => validateScreenDescriptor,
17007
17012
  validateTabBarVisibility: () => validateTabBarVisibility,
17008
17013
  webViewEmbeddedIssues: () => webViewEmbeddedIssues,
17014
+ withoutBootState: () => withoutBootState,
17009
17015
  workerSubtreeAllowed: () => workerSubtreeAllowed
17010
17016
  });
17011
17017
  function makeInert() {
@@ -17061,6 +17067,9 @@ function withWorkerConsole(base, capture, now) {
17061
17067
  function pinnedNow(clock) {
17062
17068
  return clock === void 0 ? void 0 : () => Number(clock);
17063
17069
  }
17070
+ function hostStorage(store) {
17071
+ return { get: (k2) => store.getItem(k2) ?? "", set: (k2, v2) => store.setItem(k2, v2), getItem: (k2) => store.getItem(k2), setItem: (k2, v2) => store.setItem(k2, v2) };
17072
+ }
17064
17073
  function runBundleSandbox(bundleJs, opts) {
17065
17074
  const services = {};
17066
17075
  const actions = {};
@@ -17070,6 +17079,7 @@ function runBundleSandbox(bundleJs, opts) {
17070
17079
  const himalayaTarget = {
17071
17080
  readLifecycleVersion: 1,
17072
17081
  connectivity: { current: () => ({ online: true }) },
17082
+ ...opts.storage ? { storage: hostStorage(opts.storage) } : {},
17073
17083
  // #537 — `input` is REAL DATA, not a capability. The host injects the descriptor's
17074
17084
  // `input` (merged with nav params) as a plain object before the worker evaluates,
17075
17085
  // and workers read it synchronously in load() (`himalaya.input.id` on a detail
@@ -17154,6 +17164,7 @@ function runBundleSandbox(bundleJs, opts) {
17154
17164
  timeoutMs: opts.timeoutMs ?? BOOT_EVAL_TIMEOUT_MS,
17155
17165
  filename: "himi-bundle.js",
17156
17166
  captureConsole: Boolean(opts.captureConsole),
17167
+ ...opts.storage ? { storage: opts.storage } : {},
17157
17168
  ...opts.clock === void 0 ? {} : { clock: opts.clock },
17158
17169
  ...opts.seed === void 0 ? {} : { seed: opts.seed },
17159
17170
  ...opts.mirrorRandom ? { mirrorRandom: true } : {}
@@ -17171,6 +17182,11 @@ function safeStringify(v2) {
17171
17182
  return String(v2);
17172
17183
  }
17173
17184
  }
17185
+ function bundleNameFromUrl(url) {
17186
+ if (typeof url !== "string") return null;
17187
+ const m2 = /\/v1\/bundles\/([a-z0-9_-]+)/i.exec(url);
17188
+ return m2 ? m2[1] : null;
17189
+ }
17174
17190
  function extractBundleServices(bundleJs, opts = {}) {
17175
17191
  return runBundleSandbox(bundleJs, { rethrow: true, ...opts }).services;
17176
17192
  }
@@ -17235,6 +17251,13 @@ function nondeterministicServices(bundleJs, opts = {}) {
17235
17251
  if (threw > 0) return names2.sort();
17236
17252
  return names2.filter((name) => safeStringify(a2[name]) !== safeStringify(b2[name])).sort();
17237
17253
  }
17254
+ function nondeterministicServicesOrNull(bundleJs, opts = {}) {
17255
+ const boots = DRIFT_PROBES.map((probe2) => runBundleSandbox(bundleJs, { rethrow: false, ...opts, ...probe2 }));
17256
+ if (boots.some((boot) => boot.threw !== null)) return null;
17257
+ const [a2, b2] = boots.map((boot) => boot.services);
17258
+ const names2 = [.../* @__PURE__ */ new Set([...Object.keys(a2), ...Object.keys(b2)])];
17259
+ return names2.filter((name) => safeStringify(a2[name]) !== safeStringify(b2[name])).sort();
17260
+ }
17238
17261
  function deviceParityWithheldFrom(root) {
17239
17262
  const names2 = new Set(DEVICE_PARITY_CANDIDATES);
17240
17263
  for (let o2 = root; o2 && o2 !== Object.prototype; o2 = Object.getPrototypeOf(o2)) {
@@ -17359,7 +17382,7 @@ async function bootBundleWorker(bundleJs, opts) {
17359
17382
  ...opts.capabilities ? { capabilities: [...opts.capabilities] } : {},
17360
17383
  wixApi,
17361
17384
  // v1 best-effort stubs — a visitor-scoped load() reads Wix, not device-local state.
17362
- storage: opts.storage ? { get: (k2) => opts.storage.getItem(k2) ?? "", set: (k2, v2) => opts.storage.setItem(k2, v2), getItem: (k2) => opts.storage.getItem(k2), setItem: (k2, v2) => opts.storage.setItem(k2, v2) } : { get: () => "", set: () => {
17385
+ storage: opts.storage ? hostStorage(opts.storage) : { get: () => "", set: () => {
17363
17386
  }, getItem: () => null, setItem: () => {
17364
17387
  } },
17365
17388
  dispatch: dispatchHost,
@@ -19018,6 +19041,12 @@ function renderedWixMediaReferences(descriptor) {
19018
19041
  regions.forEach((region) => collectWixMediaReferences(region.value, region.path, found, false, false, "", region.atRoot));
19019
19042
  return found;
19020
19043
  }
19044
+ function withoutBootState(descriptor) {
19045
+ const lb = descriptor?.logicBundle;
19046
+ if (!lb || typeof lb !== "object" || !("bootState" in lb)) return descriptor;
19047
+ const { bootState: _bootState, ...logicBundle } = lb;
19048
+ return { ...descriptor, logicBundle };
19049
+ }
19021
19050
  function unknownTokenMessage(kind, name, registry2) {
19022
19051
  const base = `unknown ${kind} token "${name}" (not in tokens.json)`;
19023
19052
  const group = registry2 ? { color: registry2.colors, typography: registry2.typography, spacing: registry2.spacing, radius: registry2.radius }[kind] : void 0;
@@ -19027,8 +19056,19 @@ function unknownTokenMessage(kind, name, registry2) {
19027
19056
  const list2 = all.length > 14 ? `${all.slice(0, 14).join(", ")}, \u2026 (${all.length})` : all.join(", ");
19028
19057
  return `${base}${near.length ? ` \u2014 did you mean ${near.map((n2) => `"${n2}"`).join(" or ")}?` : ""} Defined ${kind} tokens: ${list2}`;
19029
19058
  }
19030
- function validateScreenDescriptor(screenId, descriptor, opts = {}) {
19059
+ function validateScreenDescriptor(screenId, served, opts = {}) {
19060
+ const descriptor = withoutBootState(served);
19031
19061
  const issues = [];
19062
+ const bootState = served?.logicBundle?.bootState;
19063
+ if (bootState !== void 0 && bootState !== null && (typeof bootState !== "object" || Array.isArray(bootState))) {
19064
+ issues.push({
19065
+ severity: "error",
19066
+ pass: "schema",
19067
+ path: "/logicBundle/bootState",
19068
+ nativeDecode: true,
19069
+ message: "logicBundle.bootState must be an object of service states \u2014 native decode rejects anything else and drops the whole screen"
19070
+ });
19071
+ }
19032
19072
  const strict = opts.strict ?? false;
19033
19073
  const hygiene = strict ? "error" : "warning";
19034
19074
  const depthFindings = screenDepthFindings(descriptor);
@@ -24181,6 +24221,7 @@ __export(validate_descriptor_exports, {
24181
24221
  navLogicBundleUrl: () => navLogicBundleUrl,
24182
24222
  nodeVmEvaluator: () => nodeVmEvaluator,
24183
24223
  nondeterministicServices: () => nondeterministicServices,
24224
+ nondeterministicServicesOrNull: () => nondeterministicServicesOrNull,
24184
24225
  pathCrossesOpaqueAuthorJson: () => pathCrossesOpaqueAuthorJson,
24185
24226
  pathValue: () => pathValue,
24186
24227
  pinnedIntrinsicsSource: () => pinnedIntrinsicsSource,
@@ -24203,6 +24244,7 @@ __export(validate_descriptor_exports, {
24203
24244
  validateScreenDescriptor: () => validateScreenDescriptor,
24204
24245
  validateTabBarVisibility: () => validateTabBarVisibility,
24205
24246
  webViewEmbeddedIssues: () => webViewEmbeddedIssues,
24247
+ withoutBootState: () => withoutBootState,
24206
24248
  workerSubtreeAllowed: () => workerSubtreeAllowed
24207
24249
  });
24208
24250
  import { readFileSync as readFileSync21, existsSync as existsSync19, readdirSync as readdirSync14 } from "node:fs";
@@ -24226,11 +24268,6 @@ function readBuiltBundle(tier5Root, bundleName) {
24226
24268
  const p2 = resolve20(tier5Root, `${bundleName}.bundle.js`);
24227
24269
  return existsSync19(p2) ? readFileSync21(p2, "utf8") : void 0;
24228
24270
  }
24229
- function bundleNameFromUrl(url) {
24230
- if (typeof url !== "string") return null;
24231
- const m2 = /\/v1\/bundles\/([a-z0-9_-]+)/i.exec(url);
24232
- return m2 ? m2[1] : null;
24233
- }
24234
24271
  function navLogicBundleUrl(config) {
24235
24272
  const cfg = config;
24236
24273
  const url = cfg?.app?.logicBundle?.url ?? cfg?.navigation?.navLogicBundle?.url ?? cfg?.navLogicBundle?.url;
@@ -27790,7 +27827,7 @@ function pickLocale(acceptLanguage) {
27790
27827
  function translate(node3, tag) {
27791
27828
  const map2 = loadCatalog(tag);
27792
27829
  if (map2.size === 0) return node3;
27793
- function visit(n2, atRoot = false) {
27830
+ function visit(n2, atRoot = false, inLogicBundle = false) {
27794
27831
  if (Array.isArray(n2)) {
27795
27832
  for (const c2 of n2) visit(c2);
27796
27833
  return;
@@ -27823,11 +27860,12 @@ function translate(node3, tag) {
27823
27860
  }
27824
27861
  for (const [k2, v2] of Object.entries(obj12)) {
27825
27862
  if (atRoot && k2 === "input" && v2 !== null && typeof v2 === "object") continue;
27863
+ if (inLogicBundle && k2 === "bootState") continue;
27826
27864
  if (typeof v2 === "string" && SECONDARY_FIELDS.has(k2)) {
27827
27865
  const t2 = map2.get(v2);
27828
27866
  if (t2) obj12[k2] = t2;
27829
27867
  } else {
27830
- visit(v2);
27868
+ visit(v2, false, atRoot && k2 === "logicBundle");
27831
27869
  }
27832
27870
  }
27833
27871
  }
@@ -29891,15 +29929,15 @@ function authored(overlays, name) {
29891
29929
  function selectIdiomOverlay(doc, ctx = {}) {
29892
29930
  const policy = doc.idiomPolicy;
29893
29931
  const overlays = doc.idiom;
29894
- const isRecord4 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
29895
- if (!isRecord4(policy) || !isRecord4(overlays)) return void 0;
29932
+ const isRecord5 = (v2) => !!v2 && typeof v2 === "object" && !Array.isArray(v2);
29933
+ if (!isRecord5(policy) || !isRecord5(overlays)) return void 0;
29896
29934
  const kind = policy.policy ?? "follow-surface";
29897
29935
  if (kind === "none") return void 0;
29898
29936
  if (kind === "pinned") return authored(overlays, policy.pin) ? policy.pin : void 0;
29899
29937
  if (kind !== "follow-surface") return void 0;
29900
29938
  const surfaces = policy.surfaces;
29901
29939
  const candidates = [
29902
- ctx.surface !== void 0 && isRecord4(surfaces) && Object.hasOwn(surfaces, ctx.surface) ? surfaces[ctx.surface] : void 0,
29940
+ ctx.surface !== void 0 && isRecord5(surfaces) && Object.hasOwn(surfaces, ctx.surface) ? surfaces[ctx.surface] : void 0,
29903
29941
  ...ctx.native ?? [],
29904
29942
  policy.fallback
29905
29943
  ];
@@ -42372,7 +42410,7 @@ var init_controls = __esm({
42372
42410
  e2.preventDefault();
42373
42411
  commit(nv);
42374
42412
  };
42375
- const valueAt2 = (e2) => {
42413
+ const valueAt3 = (e2) => {
42376
42414
  const r3 = e2.currentTarget.getBoundingClientRect();
42377
42415
  if (!(r3.width > 0)) return void 0;
42378
42416
  const f2 = Math.max(0, Math.min(1, (e2.clientX - r3.left) / r3.width));
@@ -42382,7 +42420,7 @@ var init_controls = __esm({
42382
42420
  };
42383
42421
  const onPointerDown = (e2) => {
42384
42422
  if (props2.disabled) return;
42385
- const nv = valueAt2(e2);
42423
+ const nv = valueAt3(e2);
42386
42424
  if (nv === void 0) return;
42387
42425
  dragging.current = true;
42388
42426
  e2.currentTarget.setPointerCapture?.(e2.pointerId);
@@ -42391,7 +42429,7 @@ var init_controls = __esm({
42391
42429
  };
42392
42430
  const onPointerMove = (e2) => {
42393
42431
  if (!dragging.current) return;
42394
- const nv = valueAt2(e2);
42432
+ const nv = valueAt3(e2);
42395
42433
  if (nv === void 0) return;
42396
42434
  latestValue.current = nv;
42397
42435
  setVal(nv);
@@ -42406,7 +42444,7 @@ var init_controls = __esm({
42406
42444
  if (!dragging.current) return;
42407
42445
  dragging.current = false;
42408
42446
  lastEmit.current = void 0;
42409
- commit(valueAt2(e2) ?? latestValue.current);
42447
+ commit(valueAt3(e2) ?? latestValue.current);
42410
42448
  };
42411
42449
  const endDragWithoutRelease = () => {
42412
42450
  if (!dragging.current) return;
@@ -60422,13 +60460,13 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60422
60460
  this.#knockoutElementDepth = 0;
60423
60461
  this.#knockoutGroupLevel = 0;
60424
60462
  this.cachedPatterns.clear();
60425
- for (const cache2 of this._cachedBitmapsMap.values()) {
60426
- for (const canvas of cache2.values()) {
60463
+ for (const cache3 of this._cachedBitmapsMap.values()) {
60464
+ for (const canvas of cache3.values()) {
60427
60465
  if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) {
60428
60466
  canvas.width = canvas.height = 0;
60429
60467
  }
60430
60468
  }
60431
- cache2.clear();
60469
+ cache3.clear();
60432
60470
  }
60433
60471
  this._cachedBitmapsMap.clear();
60434
60472
  this.#drawFilter();
@@ -60522,12 +60560,12 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60522
60560
  const fillColor = this.current.fillColor;
60523
60561
  const isPatternFill = this.current.patternFill;
60524
60562
  const currentTransform = getCurrentTransform(ctx);
60525
- let cache2, cacheKey, scaled, maskCanvas;
60563
+ let cache3, cacheKey, scaled, maskCanvas;
60526
60564
  if ((img.bitmap || img.data) && img.count > 1) {
60527
60565
  const mainKey = img.bitmap || img.data.buffer;
60528
60566
  cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]);
60529
- cache2 = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap);
60530
- const cachedImage = cache2.get(cacheKey);
60567
+ cache3 = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap);
60568
+ const cachedImage = cache3.get(cacheKey);
60531
60569
  if (cachedImage && !isPatternFill) {
60532
60570
  const offsetX2 = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]);
60533
60571
  const offsetY2 = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]);
@@ -60566,8 +60604,8 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60566
60604
  this.canvasFactory.destroy(maskCanvas);
60567
60605
  maskCanvas = null;
60568
60606
  }
60569
- if (cache2 && isPatternFill) {
60570
- cache2.set(cacheKey, scaled);
60607
+ if (cache3 && isPatternFill) {
60608
+ cache3.set(cacheKey, scaled);
60571
60609
  scaledEntry = null;
60572
60610
  maskCanvas = null;
60573
60611
  }
@@ -60584,13 +60622,13 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
60584
60622
  const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]);
60585
60623
  fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL, opIdx) : fillColor;
60586
60624
  fillCtx.fillRect(0, 0, width, height);
60587
- if (cache2 && !isPatternFill) {
60588
- cache2.set(cacheKey, fillCanvas.canvas);
60625
+ if (cache3 && !isPatternFill) {
60626
+ cache3.set(cacheKey, fillCanvas.canvas);
60589
60627
  }
60590
60628
  this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill);
60591
60629
  return {
60592
60630
  canvas: fillCanvas.canvas,
60593
- canvasEntry: cache2 && !isPatternFill ? null : fillCanvas,
60631
+ canvasEntry: cache3 && !isPatternFill ? null : fillCanvas,
60594
60632
  offsetX: Math.round(offsetX),
60595
60633
  offsetY: Math.round(offsetY)
60596
60634
  };
@@ -126257,6 +126295,9 @@ function hiddenBool(v2) {
126257
126295
  }
126258
126296
  return false;
126259
126297
  }
126298
+ function gateHidden(v2, unresolvedHidden) {
126299
+ return v2 === void 0 || v2 === null ? unresolvedHidden : hiddenBool(v2);
126300
+ }
126260
126301
  function exitSpecFor(modifiers, ctx) {
126261
126302
  const tr2 = modifiers?.transition;
126262
126303
  if (!tr2 || typeof tr2 !== "object") return null;
@@ -127751,10 +127792,11 @@ function renderNodeInner(node3, ctx) {
127751
127792
  }
127752
127793
  }
127753
127794
  const hp = node3?.modifiers?.hiddenPath ?? node3?.modifiers?.hidden_path;
127795
+ const liveGate = typeof hp === "string" && !isEnvExpr(hp) && isBinding(hp) && isStateBinding(hp) && !!ctx.provider;
127754
127796
  {
127755
127797
  const lit = typeof hp === "string" ? hp.trim().toLowerCase() : void 0;
127756
127798
  const litPath = lit === "true" || lit === "1" || lit === "false" || lit === "0";
127757
- const hasLiteral = typeof node3?.modifiers?.hidden === "boolean" || litPath;
127799
+ const hasLiteral = typeof node3?.modifiers?.hidden === "boolean" && !liveGate || litPath;
127758
127800
  const exit = hasLiteral ? exitSpecFor(node3.modifiers, ctx) : null;
127759
127801
  if (exit) {
127760
127802
  const hiddenNow = node3.modifiers.hidden === true || lit === "true" || lit === "1";
@@ -127762,7 +127804,7 @@ function renderNodeInner(node3, ctx) {
127762
127804
  return /* @__PURE__ */ jsx12(ExitPresence, { hidden: hiddenNow, exit, children: renderNode(bare, ctx) });
127763
127805
  }
127764
127806
  }
127765
- if (node3?.modifiers?.hidden === true) return null;
127807
+ if (node3?.modifiers?.hidden === true && !liveGate) return null;
127766
127808
  if (typeof hp === "string" && hp) {
127767
127809
  const low = hp.trim().toLowerCase();
127768
127810
  if (low === "true" || low === "1") return null;
@@ -127779,8 +127821,8 @@ function renderNodeInner(node3, ctx) {
127779
127821
  if (hiddenBool(resolveScalarStatic(hp, ctx))) return null;
127780
127822
  } else if (isStateBinding(hp)) {
127781
127823
  if (ctx.provider) {
127782
- const bare = { ...node3, modifiers: { ...node3.modifiers, hiddenPath: void 0, hidden_path: void 0 } };
127783
- return /* @__PURE__ */ jsx12(HiddenGate, { ctx, binding: hp, exit: exitSpecFor(node3.modifiers, ctx), children: renderNode(bare, ctx) });
127824
+ const bare = { ...node3, modifiers: { ...node3.modifiers, hidden: void 0, hiddenPath: void 0, hidden_path: void 0 } };
127825
+ return /* @__PURE__ */ jsx12(HiddenGate, { ctx, binding: hp, unresolvedHidden: node3.modifiers?.hidden === true, exit: exitSpecFor(node3.modifiers, ctx), children: renderNode(bare, ctx) });
127784
127826
  }
127785
127827
  if (ctx.runtimeDegraded) return null;
127786
127828
  }
@@ -129447,9 +129489,9 @@ var init_renderNode = __esm({
129447
129489
  const rendered = renderNodeInner(node3, ctx);
129448
129490
  return /* @__PURE__ */ jsx12(Fragment4, { children: style ? withRootStyle(rendered, style) : rendered });
129449
129491
  };
129450
- HiddenGate = ({ ctx, binding: binding2, exit, children }) => {
129492
+ HiddenGate = ({ ctx, binding: binding2, unresolvedHidden = false, exit, children }) => {
129451
129493
  const v2 = useBoundValue(ctx, binding2);
129452
- return /* @__PURE__ */ jsx12(ExitPresence, { hidden: hiddenBool(v2), exit: exit ?? null, children });
129494
+ return /* @__PURE__ */ jsx12(ExitPresence, { hidden: gateHidden(v2, unresolvedHidden), exit: exit ?? null, children });
129453
129495
  };
129454
129496
  ExitPresence = ({ hidden, exit, children }) => {
129455
129497
  const [prevHidden, setPrevHidden] = React17.useState(hidden);
@@ -131818,9 +131860,10 @@ var init_renderNode = __esm({
131818
131860
  const contentDescription = useResolvedScalar(props2.contentDescription, ctx);
131819
131861
  const described = contentDescription != null && String(contentDescription).trim() !== "";
131820
131862
  const a11y = described ? { role: "img", "aria-label": String(contentDescription), [SELF_RENDERED_LEAF]: true } : { "aria-hidden": "true", [INFERRED_DECORATIVE]: true, [SELF_RENDERED_LEAF]: true, [ROLE_WHEN_NAMED]: "img" };
131821
- const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props2.tint, ctx) ?? "textPrimary", "#636b78") });
131822
131863
  const swap = useIconSwap(iconName, ctx);
131823
- const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ? React17.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
131864
+ const unpublished = isBinding(props2.name) && iconName === "";
131865
+ const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props2.tint, ctx) ?? "textPrimary", "#636b78") });
131866
+ const animatedGlyph = unpublished ? null : Object.keys(effectStyle).length || swap.key > 0 ? React17.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
131824
131867
  return /* @__PURE__ */ jsx12("span", { ...a11y, style: { display: "inline-grid", placeItems: "center", width: size + 6, height: size + 6, lineHeight: 1, flex: "none", ...wrap }, children: animatedGlyph });
131825
131868
  });
131826
131869
  EMPTY_STATE_SPACING = {
@@ -135812,15 +135855,18 @@ function clientEnvFor(scheme, width, isRTL2) {
135812
135855
  };
135813
135856
  }
135814
135857
  function nodeHidden(modifiers, provider, itemScope, env) {
135815
- if (modifiers.hidden === true) return true;
135816
135858
  const hp = modifiers.hiddenPath ?? modifiers.hidden_path;
135859
+ const literal = modifiers.hidden === true;
135860
+ const stateGate = typeof hp === "string" && (hp.startsWith("$service:") || hp.startsWith("$app:"));
135861
+ if (literal && !stateGate) return true;
135817
135862
  if (typeof hp !== "string" || !hp) return false;
135818
135863
  const low = hp.trim().toLowerCase();
135819
135864
  if (low === "true" || low === "1") return true;
135820
135865
  if (low === "false" || low === "0") return false;
135821
135866
  if (isEnvExpr(hp)) return env ? envHidden(hp, env) === true : false;
135822
- if (hp.startsWith("$item") || hp.startsWith("$service:")) {
135823
- return hiddenBool2(resolveTreeScalar(hp, provider, itemScope));
135867
+ if (hp.startsWith("$item") || stateGate) {
135868
+ const v2 = hp.startsWith("$app:") ? provider.value(hp) ?? void 0 : resolveTreeScalar(hp, provider, itemScope);
135869
+ return literal && (v2 === void 0 || v2 === null) ? true : hiddenBool2(v2);
135824
135870
  }
135825
135871
  return false;
135826
135872
  }
@@ -136535,7 +136581,7 @@ async function faceBytes(face, catalog4, opts) {
136535
136581
  }
136536
136582
  }
136537
136583
  async function pngFontFaceCss(tokens2, opts = {}) {
136538
- const cache2 = opts.source || opts.fetchFace ? void 0 : encoded;
136584
+ const cache3 = opts.source || opts.fetchFace ? void 0 : encoded;
136539
136585
  let catalog4;
136540
136586
  try {
136541
136587
  catalog4 = opts.catalog ?? loadCatalog2();
@@ -136565,12 +136611,12 @@ async function pngFontFaceCss(tokens2, opts = {}) {
136565
136611
  }
136566
136612
  const data = await Promise.all(
136567
136613
  wanted.map(async ({ face }) => {
136568
- const hit = cache2?.get(face.sha256);
136614
+ const hit = cache3?.get(face.sha256);
136569
136615
  if (hit !== void 0) return hit;
136570
136616
  const bytes2 = await faceBytes(face, catalog4, opts);
136571
136617
  if (!bytes2) return null;
136572
136618
  const b64 = bytes2.toString("base64");
136573
- cache2?.set(face.sha256, b64);
136619
+ cache3?.set(face.sha256, b64);
136574
136620
  return b64;
136575
136621
  })
136576
136622
  );
@@ -136887,46 +136933,46 @@ function realmProduceCache(evaluator) {
136887
136933
  }
136888
136934
  return existing;
136889
136935
  }
136890
- function dropEntry(cache2, key3) {
136891
- const entry = cache2.entries.get(key3);
136936
+ function dropEntry(cache3, key3) {
136937
+ const entry = cache3.entries.get(key3);
136892
136938
  if (!entry) return;
136893
- cache2.entries.delete(key3);
136894
- cache2.bytes -= entry.bytes;
136939
+ cache3.entries.delete(key3);
136940
+ cache3.bytes -= entry.bytes;
136895
136941
  }
136896
136942
  function produceCacheKey(bundleJs, timeoutMs, clock) {
136897
136943
  const digest2 = createHash15("sha256").update(bundleJs).digest("base64");
136898
136944
  return `${timeoutMs}|${clock === void 0 ? "live" : Math.trunc(clock)}|${digest2}`;
136899
136945
  }
136900
136946
  function cachedProduce(evaluator, key3) {
136901
- const cache2 = realmProduceCache(evaluator);
136902
- const hit = cache2.entries.get(key3);
136947
+ const cache3 = realmProduceCache(evaluator);
136948
+ const hit = cache3.entries.get(key3);
136903
136949
  if (!hit) return void 0;
136904
136950
  if (Date.now() >= hit.expiresAt) {
136905
- dropEntry(cache2, key3);
136951
+ dropEntry(cache3, key3);
136906
136952
  return void 0;
136907
136953
  }
136908
- cache2.entries.delete(key3);
136909
- cache2.entries.set(key3, hit);
136954
+ cache3.entries.delete(key3);
136955
+ cache3.entries.set(key3, hit);
136910
136956
  return { services: JSON.parse(hit.servicesJson), envelope: hit.envelope };
136911
136957
  }
136912
136958
  function rememberProduce(evaluator, key3, servicesJson, envelope, expiresAt) {
136913
136959
  const bytes2 = envelope.length + servicesJson.length;
136914
136960
  if (bytes2 > MAX_PRODUCE_ENTRY_BYTES) return;
136915
- const cache2 = realmProduceCache(evaluator);
136916
- dropEntry(cache2, key3);
136917
- cache2.entries.set(key3, { servicesJson, envelope, expiresAt, bytes: bytes2 });
136918
- cache2.bytes += bytes2;
136919
- const over = () => cache2.entries.size > MAX_PRODUCE_CACHE_ENTRIES || cache2.bytes > MAX_PRODUCE_CACHE_BYTES;
136961
+ const cache3 = realmProduceCache(evaluator);
136962
+ dropEntry(cache3, key3);
136963
+ cache3.entries.set(key3, { servicesJson, envelope, expiresAt, bytes: bytes2 });
136964
+ cache3.bytes += bytes2;
136965
+ const over = () => cache3.entries.size > MAX_PRODUCE_CACHE_ENTRIES || cache3.bytes > MAX_PRODUCE_CACHE_BYTES;
136920
136966
  if (!over()) return;
136921
136967
  const now = Date.now();
136922
- for (const [k2, entry] of [...cache2.entries]) {
136968
+ for (const [k2, entry] of [...cache3.entries]) {
136923
136969
  if (!over()) break;
136924
- if (k2 !== key3 && now >= entry.expiresAt) dropEntry(cache2, k2);
136970
+ if (k2 !== key3 && now >= entry.expiresAt) dropEntry(cache3, k2);
136925
136971
  }
136926
136972
  while (over()) {
136927
- const oldest = cache2.entries.keys().next();
136973
+ const oldest = cache3.entries.keys().next();
136928
136974
  if (oldest.done || oldest.value === key3) break;
136929
- dropEntry(cache2, oldest.value);
136975
+ dropEntry(cache3, oldest.value);
136930
136976
  }
136931
136977
  }
136932
136978
  function reuseWindowMs(parsed) {
@@ -137583,6 +137629,162 @@ var init_widgets = __esm({
137583
137629
  }
137584
137630
  });
137585
137631
 
137632
+ // ../../core/dev-server/src/boot-state.ts
137633
+ var boot_state_exports = {};
137634
+ __export(boot_state_exports, {
137635
+ BOOT_STATE_CACHE_MAX: () => BOOT_STATE_CACHE_MAX,
137636
+ BOOT_STATE_MAX_BYTES: () => BOOT_STATE_MAX_BYTES,
137637
+ BOOT_STATE_STORAGE_KEYS: () => BOOT_STATE_STORAGE_KEYS,
137638
+ attachBootState: () => attachBootState,
137639
+ bakeBootState: () => bakeBootState,
137640
+ bindsOmittedPath: () => bindsOmittedPath,
137641
+ bootStateCacheSize: () => bootStateCacheSize,
137642
+ computeBootState: () => computeBootState,
137643
+ gatesUnbakedPath: () => gatesUnbakedPath
137644
+ });
137645
+ function bootStateCacheSize() {
137646
+ return cache2.size;
137647
+ }
137648
+ function bakeBootState(bundleJs, input) {
137649
+ let services;
137650
+ let probed;
137651
+ let drifting;
137652
+ const read = /* @__PURE__ */ new Set();
137653
+ const storage = { getItem: (key3) => (read.add(String(key3)), null), setItem: () => {
137654
+ } };
137655
+ try {
137656
+ services = extractBundleServices(bundleJs, { input: { ...input, ...UNHOSTED_INPUT }, storage });
137657
+ probed = extractBundleServices(bundleJs, { input: { ...input, ...UNHOSTED_INPUT, ...NAV_INPUT_PROBE }, storage });
137658
+ drifting = nondeterministicServicesOrNull(bundleJs, { input: { ...input, ...UNHOSTED_INPUT }, storage });
137659
+ } catch {
137660
+ return null;
137661
+ }
137662
+ if (drifting === null) return null;
137663
+ const kept = {};
137664
+ const omitted = [];
137665
+ for (const [name, state] of Object.entries(services)) {
137666
+ const probe2 = probed[name];
137667
+ if (name === BOOT_STATE_STORAGE_KEYS || drifting.includes(name) || !isRecord4(state) || !isRecord4(probe2)) {
137668
+ omitted.push(name);
137669
+ continue;
137670
+ }
137671
+ const steady = steadyPart(state, probe2, name, omitted);
137672
+ if (Object.keys(steady).length > 0) kept[name] = steady;
137673
+ }
137674
+ const defined = Object.keys(services);
137675
+ if (Object.keys(kept).length === 0) return { state: null, omitted, services: defined };
137676
+ if (read.size > 0) kept[BOOT_STATE_STORAGE_KEYS] = [...new Set([...read].map((key3) => key3.includes(PROBE) ? `${key3.slice(0, key3.indexOf(PROBE))}*` : key3))].sort();
137677
+ let json9;
137678
+ try {
137679
+ json9 = JSON.stringify(kept);
137680
+ } catch {
137681
+ return { state: null, omitted, services: defined };
137682
+ }
137683
+ if (new TextEncoder().encode(json9).length > BOOT_STATE_MAX_BYTES) return { state: null, omitted, services: defined };
137684
+ return { state: JSON.parse(json9), omitted, services: defined };
137685
+ }
137686
+ function computeBootState(bundleJs, input) {
137687
+ return bakeBootState(bundleJs, input)?.state ?? null;
137688
+ }
137689
+ function steadyPart(state, probe2, at2, omitted) {
137690
+ const steady = {};
137691
+ for (const [key3, value2] of Object.entries(state)) {
137692
+ const other = probe2[key3];
137693
+ if (sameJson2(value2, other)) steady[key3] = value2;
137694
+ else if (isRecord4(value2) && isRecord4(other)) {
137695
+ const part4 = steadyPart(value2, other, `${at2}.${key3}`, omitted);
137696
+ if (Object.keys(part4).length > 0) steady[key3] = part4;
137697
+ } else omitted.push(`${at2}.${key3}`);
137698
+ }
137699
+ for (const key3 of Object.keys(probe2)) if (!(key3 in state)) omitted.push(`${at2}.${key3}`);
137700
+ return steady;
137701
+ }
137702
+ function bindsOmittedPath(descriptor, omitted, state = {}) {
137703
+ if (omitted.length === 0) return false;
137704
+ return collectServiceBindings(withoutClosedSheets(descriptor, state)).some(({ svc, path: path2 }) => {
137705
+ const bound2 = `${svc}.${path2}`;
137706
+ return omitted.some((o2) => bound2 === o2 || bound2.startsWith(`${o2}.`) || bound2.startsWith(`${o2}[`) || o2.startsWith(`${bound2}.`));
137707
+ });
137708
+ }
137709
+ function gatesUnbakedPath(descriptor, state, services) {
137710
+ return collectServiceBindings(withoutClosedSheets(descriptor, state)).some(({ svc, path: path2, at: at2 }) => /\.(hiddenPath|hidden_path)$/.test(at2) && services.includes(svc) && valueAt2(state[svc], path2) == null);
137711
+ }
137712
+ function withoutClosedSheets(node3, state) {
137713
+ if (Array.isArray(node3)) return node3.map((v2) => withoutClosedSheets(v2, state));
137714
+ if (!isRecord4(node3)) return node3;
137715
+ const body = node3.body;
137716
+ if (isRecord4(body) && body.type === "BottomSheet" && isRecord4(body.props) && typeof body.props.presentedPath === "string") {
137717
+ const m2 = /^\$service:([A-Za-z0-9_-]+)\.(.+)$/.exec(body.props.presentedPath);
137718
+ if (m2 && valueAt2(state[m2[1]], m2[2]) === false) {
137719
+ const { content: _closed, ...props2 } = body.props;
137720
+ return { ...node3, body: { ...body, props: props2 } };
137721
+ }
137722
+ }
137723
+ return Object.fromEntries(Object.entries(node3).map(([k2, v2]) => [k2, withoutClosedSheets(v2, state)]));
137724
+ }
137725
+ function valueAt2(root, path2) {
137726
+ let v2 = root;
137727
+ for (const part4 of path2.split(/\.|\[(\d+)\]/).filter((p2) => p2 !== void 0 && p2 !== "")) {
137728
+ if (v2 === null || typeof v2 !== "object") return void 0;
137729
+ v2 = v2[part4];
137730
+ }
137731
+ return v2;
137732
+ }
137733
+ function isRecord4(v2) {
137734
+ return v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
137735
+ }
137736
+ function sameJson2(a2, b2) {
137737
+ try {
137738
+ return JSON.stringify(a2) === JSON.stringify(b2);
137739
+ } catch {
137740
+ return false;
137741
+ }
137742
+ }
137743
+ async function attachBootState(descriptor, readBundle) {
137744
+ const lb = descriptor?.logicBundle;
137745
+ if (!lb || typeof lb !== "object" || lb.bootState !== void 0) return;
137746
+ const name = bundleNameFromUrl(lb.url);
137747
+ if (!name) return;
137748
+ const loaded2 = await readBundle(name);
137749
+ if (!loaded2) return;
137750
+ const input = descriptor.input && typeof descriptor.input === "object" ? descriptor.input : void 0;
137751
+ const key3 = `${loaded2.integrity}
137752
+ ${input ? JSON.stringify(input) : ""}`;
137753
+ let bake = cache2.get(key3);
137754
+ if (bake === void 0) {
137755
+ const js2 = new TextDecoder().decode(loaded2.bytes);
137756
+ const fresh = bakeBootState(js2, input) ?? bakeBootState(js2, input);
137757
+ if (!fresh) {
137758
+ console.warn(`[boot-state] ${name}: the bundle did not boot here; this descriptor is served without a boot state`);
137759
+ return;
137760
+ }
137761
+ if (cache2.size >= BOOT_STATE_CACHE_MAX) cache2.delete(cache2.keys().next().value);
137762
+ cache2.set(key3, fresh);
137763
+ bake = fresh;
137764
+ }
137765
+ if (!bake.state || bindsOmittedPath(descriptor, bake.omitted, bake.state) || gatesUnbakedPath(descriptor, bake.state, bake.services)) return;
137766
+ descriptor.logicBundle = { ...lb, bootState: bake.state };
137767
+ }
137768
+ var BOOT_STATE_MAX_BYTES, cache2, BOOT_STATE_CACHE_MAX, PROBE, NAV_INPUT_PROBE, UNHOSTED_INPUT, BOOT_STATE_STORAGE_KEYS;
137769
+ var init_boot_state = __esm({
137770
+ "../../core/dev-server/src/boot-state.ts"() {
137771
+ init_define_HHP_CATALOG();
137772
+ init_validate_descriptor_core();
137773
+ BOOT_STATE_MAX_BYTES = 16 * 1024;
137774
+ cache2 = /* @__PURE__ */ new Map();
137775
+ BOOT_STATE_CACHE_MAX = 256;
137776
+ PROBE = "__himi_boot_state_probe__";
137777
+ NAV_INPUT_PROBE = {
137778
+ id: PROBE,
137779
+ screenId: PROBE,
137780
+ __himiPreferenceAccount: PROBE,
137781
+ __himiPreferenceBusiness: PROBE
137782
+ };
137783
+ UNHOSTED_INPUT = { __himiHostSite: "" };
137784
+ BOOT_STATE_STORAGE_KEYS = "__himiStorageKeys";
137785
+ }
137786
+ });
137787
+
137586
137788
  // ../../core/dev-server/src/index.ts
137587
137789
  import { createServer as createServer2 } from "node:http";
137588
137790
  import { readFile, stat } from "node:fs/promises";
@@ -137590,6 +137792,10 @@ import { readFileSync as readFileSync38, existsSync as existsSync34, watch, mkdi
137590
137792
  import { basename as basename11, dirname as dirname25, extname as extname2, join as join28, relative as relative8, resolve as resolve33, normalize as normalize4, sep as sep11 } from "node:path";
137591
137793
  import { createHash as createHash16, randomUUID as randomUUID6 } from "node:crypto";
137592
137794
  import { fileURLToPath as fileURLToPath25, pathToFileURL as pathToFileURL5 } from "node:url";
137795
+ async function loadBootStateBaker() {
137796
+ await Promise.resolve().then(() => (init_validate_descriptor(), validate_descriptor_exports));
137797
+ return (await Promise.resolve().then(() => (init_boot_state(), boot_state_exports))).attachBootState;
137798
+ }
137593
137799
  function readLogicBundle(read, tier5Dir, name) {
137594
137800
  return read(tier5Dir ?? TIER5_ROOT2, name) ?? (tier5Dir && tier5Dir !== TIER5_ROOT2 ? read(TIER5_ROOT2, name) : void 0);
137595
137801
  }
@@ -137895,6 +138101,10 @@ async function handleBootRequest(req, res, state) {
137895
138101
  homeScreenRefusal = { error: "depth_budget_exceeded", screenId: err.screenId, finding: err.finding };
137896
138102
  }
137897
138103
  if (descriptor && typeof descriptor === "object") {
138104
+ if (descriptor.logicBundle) {
138105
+ const attachBootState2 = await loadBootStateBaker();
138106
+ await attachBootState2(descriptor, (name) => readBundleFile(name, reqState.tier5Dir));
138107
+ }
137898
138108
  assignStableIds(descriptor);
137899
138109
  const acceptLanguage = req.headers["accept-language"];
137900
138110
  const locale = pickLocale(typeof acceptLanguage === "string" ? acceptLanguage : null);
@@ -138222,6 +138432,10 @@ async function handleScreenRequest(req, res, state) {
138222
138432
  ]
138223
138433
  });
138224
138434
  }
138435
+ if (descriptor.logicBundle) {
138436
+ const attachBootState2 = await loadBootStateBaker();
138437
+ await attachBootState2(descriptor, (name) => readBundleFile(name, reqState.tier5Dir));
138438
+ }
138225
138439
  assignStableIds(descriptor);
138226
138440
  const localized = locale ? translate(JSON.parse(JSON.stringify(descriptor)), locale) : descriptor;
138227
138441
  const body = JSON.stringify({ ...localized, etag: void 0 });
@@ -149081,10 +149295,10 @@ function readUpdateCache(path2) {
149081
149295
  return {};
149082
149296
  }
149083
149297
  }
149084
- function writeUpdateCache(path2, cache2) {
149298
+ function writeUpdateCache(path2, cache3) {
149085
149299
  try {
149086
149300
  mkdirSync22(dirname28(path2), { recursive: true, mode: 448 });
149087
- writeFileSync16(path2, JSON.stringify(cache2, null, 2) + "\n", { mode: 384 });
149301
+ writeFileSync16(path2, JSON.stringify(cache3, null, 2) + "\n", { mode: 384 });
149088
149302
  } catch {
149089
149303
  }
149090
149304
  }
@@ -149316,18 +149530,18 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149316
149530
  if (updateCheckSuppression(running, command, env, opts.cwd ?? process.cwd())) return void 0;
149317
149531
  const now = opts.now ?? Date.now();
149318
149532
  const cachePath = opts.cachePath ?? updateCachePath(env);
149319
- const cache2 = readUpdateCache(cachePath);
149320
- if (cache2.snoozedUntil && Date.parse(cache2.snoozedUntil) > now) return void 0;
149321
- let latest = cache2.latest;
149322
- let runningPublishedAt = cache2.runningPublishedAt;
149323
- const checkedAt = cache2.checkedAt ? Date.parse(cache2.checkedAt) : Number.NaN;
149324
- const describesThisBuild = cache2.running === running;
149533
+ const cache3 = readUpdateCache(cachePath);
149534
+ if (cache3.snoozedUntil && Date.parse(cache3.snoozedUntil) > now) return void 0;
149535
+ let latest = cache3.latest;
149536
+ let runningPublishedAt = cache3.runningPublishedAt;
149537
+ const checkedAt = cache3.checkedAt ? Date.parse(cache3.checkedAt) : Number.NaN;
149538
+ const describesThisBuild = cache3.running === running;
149325
149539
  const fresh = Number.isFinite(checkedAt) && now - checkedAt < UPDATE_CHECK_INTERVAL_MS && describesThisBuild;
149326
149540
  if (!describesThisBuild) runningPublishedAt = void 0;
149327
149541
  let answeredBy;
149328
149542
  let answeredLatest;
149329
- const attemptedAt = cache2.attemptedAt ? Date.parse(cache2.attemptedAt) : Number.NaN;
149330
- const recentlyTried = cache2.attemptedFor === running && Number.isFinite(attemptedAt) && now - attemptedAt < UPDATE_RETRY_AFTER_FAILURE_MS;
149543
+ const attemptedAt = cache3.attemptedAt ? Date.parse(cache3.attemptedAt) : Number.NaN;
149544
+ const recentlyTried = cache3.attemptedFor === running && Number.isFinite(attemptedAt) && now - attemptedAt < UPDATE_RETRY_AFTER_FAILURE_MS;
149331
149545
  if (!fresh && !recentlyTried) {
149332
149546
  const packument = await fetchCliPackument(opts.fetchImpl ?? fetch, UPDATE_FOREGROUND_BUDGET_MS, env, opts.scopedRegistry);
149333
149547
  if (packument) {
@@ -149335,9 +149549,9 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149335
149549
  runningPublishedAt = packument.time[running];
149336
149550
  answeredBy = packument.registry;
149337
149551
  answeredLatest = packument.latest;
149338
- writeUpdateCache(cachePath, { ...cache2, running, checkedAt: new Date(now).toISOString(), latest, runningPublishedAt });
149552
+ writeUpdateCache(cachePath, { ...cache3, running, checkedAt: new Date(now).toISOString(), latest, runningPublishedAt });
149339
149553
  } else {
149340
- writeUpdateCache(cachePath, { ...cache2, attemptedAt: new Date(now).toISOString(), attemptedFor: running });
149554
+ writeUpdateCache(cachePath, { ...cache3, attemptedAt: new Date(now).toISOString(), attemptedFor: running });
149341
149555
  opts.spawnRefresh?.();
149342
149556
  }
149343
149557
  }
@@ -149388,7 +149602,7 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149388
149602
  }
149389
149603
  if (!answeredBy || !answeredLatest || compareVersions2(answeredLatest, running) <= 0) {
149390
149604
  if (answeredBy && answeredLatest) {
149391
- writeUpdateCache(cachePath, { ...cache2, running, latest: answeredLatest, runningPublishedAt, checkedAt: new Date(now).toISOString() });
149605
+ writeUpdateCache(cachePath, { ...cache3, running, latest: answeredLatest, runningPublishedAt, checkedAt: new Date(now).toISOString() });
149392
149606
  }
149393
149607
  return void 0;
149394
149608
  }
@@ -149409,7 +149623,7 @@ async function maybeSelfUpdate(argv, io2, opts = {}) {
149409
149623
  running: after,
149410
149624
  latest: target,
149411
149625
  checkedAt: new Date(now).toISOString(),
149412
- ...cache2.snoozedUntil ? { snoozedUntil: cache2.snoozedUntil } : {}
149626
+ ...cache3.snoozedUntil ? { snoozedUntil: cache3.snoozedUntil } : {}
149413
149627
  });
149414
149628
  io2.error(` installed ${after} \u2014 re-running: himi ${argv.join(" ")}`);
149415
149629
  const exitCode = runner2.reexec(argv);
@@ -163918,18 +164132,18 @@ function configuredTokensPath(dir) {
163918
164132
  }
163919
164133
  function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
163920
164134
  const issues = [];
163921
- const isRecord4 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
163922
- if (!isRecord4(tokens2)) return issues;
164135
+ const isRecord5 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
164136
+ if (!isRecord5(tokens2)) return issues;
163923
164137
  const shown2 = (v2) => typeof v2 === "string" ? JSON.stringify(v2) : JSON.stringify(v2) ?? String(v2);
163924
164138
  const bad2 = (v2) => !(typeof v2 === "number" && Number.isInteger(v2));
163925
164139
  const check = (layer, where) => {
163926
- if (!isRecord4(layer)) return;
164140
+ if (!isRecord5(layer)) return;
163927
164141
  const loses = where ? `the ${where.slice(0, -1)} overlay is dropped on device and the base look is used instead` : 'iOS and Android reject the WHOLE tokens.json otherwise ("Theme unavailable" on iOS, the default palette and fonts on Android)';
163928
164142
  for (const { group, field, unit } of INTEGER_TOKEN_FIELDS) {
163929
164143
  const entries = layer[group];
163930
- if (!isRecord4(entries)) continue;
164144
+ if (!isRecord5(entries)) continue;
163931
164145
  for (const [name, token] of Object.entries(entries)) {
163932
- if (!isRecord4(token) || !(field in token)) continue;
164146
+ if (!isRecord5(token) || !(field in token)) continue;
163933
164147
  const value2 = token[field];
163934
164148
  if (!bad2(value2)) continue;
163935
164149
  const path2 = `${where}${group}.${name}.${field}`;
@@ -163945,7 +164159,7 @@ function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
163945
164159
  }
163946
164160
  for (const group of INTEGER_TOKEN_MAPS) {
163947
164161
  const entries = layer[group];
163948
- if (!isRecord4(entries)) continue;
164162
+ if (!isRecord5(entries)) continue;
163949
164163
  for (const [name, value2] of Object.entries(entries)) {
163950
164164
  if (!bad2(value2)) continue;
163951
164165
  const fix = typeof value2 === "number" && Number.isFinite(value2) ? ` Write ${Math.round(value2)}.` : "";
@@ -163961,7 +164175,7 @@ function tokenNumericIssues(tokens2, tokensPath = "tokens.json") {
163961
164175
  };
163962
164176
  check(tokens2, "");
163963
164177
  const idiom = tokens2.idiom;
163964
- if (isRecord4(idiom)) {
164178
+ if (isRecord5(idiom)) {
163965
164179
  for (const [overlay, layer] of Object.entries(idiom)) check(layer, `idiom.${overlay}.`);
163966
164180
  }
163967
164181
  return issues;
@@ -186440,12 +186654,12 @@ ${releaseId}`;
186440
186654
  }
186441
186655
  function sendDoc(request, body, pinned = false) {
186442
186656
  const etag = strongEtag(body);
186443
- const cache2 = pinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
186657
+ const cache3 = pinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
186444
186658
  const vary = pinned ? { vary: "x-himalaya-release" } : {};
186445
186659
  if (request.headers.get("if-none-match") === etag) {
186446
- return new Response(null, { status: 304, headers: { etag, "cache-control": cache2, ...vary } });
186660
+ return new Response(null, { status: 304, headers: { etag, "cache-control": cache3, ...vary } });
186447
186661
  }
186448
- return new Response(body, { status: 200, headers: { "content-type": JSON_CT3, etag, "cache-control": cache2, ...vary } });
186662
+ return new Response(body, { status: 200, headers: { "content-type": JSON_CT3, etag, "cache-control": cache3, ...vary } });
186449
186663
  }
186450
186664
  async function draftPreviewOnly(request, url, noStore) {
186451
186665
  const refuse7 = (status, error) => ({ ok: false, response: json6(status, { error }, noStore) });
@@ -187135,13 +187349,13 @@ ${releaseId}`;
187135
187349
  const bytes2 = await store.getSource(app, m2.sourceHash);
187136
187350
  if (!bytes2) return json6(404, { error: "template_source_not_found", app });
187137
187351
  const etag = `"${m2.sourceHash}"`;
187138
- const cache2 = { "cache-control": pin ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL, ...pin ? { vary: "x-himalaya-release" } : {} };
187352
+ const cache3 = { "cache-control": pin ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL, ...pin ? { vary: "x-himalaya-release" } : {} };
187139
187353
  if (request.headers.get("if-none-match") === etag) {
187140
- return new Response(null, { status: 304, headers: { etag, ...cache2 } });
187354
+ return new Response(null, { status: 304, headers: { etag, ...cache3 } });
187141
187355
  }
187142
187356
  return new Response(bytes2, {
187143
187357
  status: 200,
187144
- headers: { "content-type": JSON_CT3, etag, ...cache2, "x-himalaya-app": app }
187358
+ headers: { "content-type": JSON_CT3, etag, ...cache3, "x-himalaya-app": app }
187145
187359
  });
187146
187360
  }
187147
187361
  if (path2 === "/v1/authoring-docs" || /^\/v1\/authoring-docs\/(spec|mobile-ux)$/.test(path2)) {
@@ -187277,12 +187491,12 @@ ${releaseId}`;
187277
187491
  }
187278
187492
  const cfgTag = ringPinned ? sha256hex2(JSON.stringify(appConfig)) : mm.appConfigHash ?? "";
187279
187493
  const etag = strongEtag(`${mm.releaseId}:${cfgTag}:${mm.tokensHash ?? ""}:${screenHash}:${homeBundle?.sha256 ?? ""}`);
187280
- const cache2 = pin && !ringPinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
187494
+ const cache3 = pin && !ringPinned ? PINNED_CACHE_CONTROL : DOC_CACHE_CONTROL;
187281
187495
  const vary = pin ? { vary: ringPinned ? `x-himalaya-release, ${RELEASE_SOURCE_HEADER}` : "x-himalaya-release" } : {};
187282
187496
  if (request.headers.get("if-none-match") === etag) {
187283
- return new Response(null, { status: 304, headers: { etag, "cache-control": cache2, ...vary } });
187497
+ return new Response(null, { status: 304, headers: { etag, "cache-control": cache3, ...vary } });
187284
187498
  }
187285
- return json6(200, { releaseId: mm.releaseId, app, appConfig, tokens: tokens2, homeScreenId, screen, homeBundle }, { etag, "cache-control": cache2, ...vary });
187499
+ return json6(200, { releaseId: mm.releaseId, app, appConfig, tokens: tokens2, homeScreenId, screen, homeBundle }, { etag, "cache-control": cache3, ...vary });
187286
187500
  }
187287
187501
  if (path2 === "/v1/tokens") {
187288
187502
  if (!app) return json6(400, { error: "missing_app" });
@@ -187441,16 +187655,16 @@ ${releaseId}`;
187441
187655
  const meta = m2?.widgets?.[widgetId];
187442
187656
  if (!m2 || !meta) return json6(404, { error: "widget_not_found", widgetId });
187443
187657
  const etag = `"${meta.contentEtag}"`;
187444
- const cache2 = pin ? PINNED_CACHE_CONTROL : `max-age=${meta.ttlSeconds}`;
187658
+ const cache3 = pin ? PINNED_CACHE_CONTROL : `max-age=${meta.ttlSeconds}`;
187445
187659
  const vary = pin ? { vary: "x-himalaya-release" } : {};
187446
187660
  if (request.headers.get("if-none-match") === etag) {
187447
- return new Response(null, { status: 304, headers: { etag, "cache-control": cache2, ...vary, ...widgetScope } });
187661
+ return new Response(null, { status: 304, headers: { etag, "cache-control": cache3, ...vary, ...widgetScope } });
187448
187662
  }
187449
187663
  const body = await store.getWidget(app, widgetId);
187450
187664
  if (!body) return json6(404, { error: "widget_not_found", widgetId });
187451
187665
  return new Response(body, {
187452
187666
  status: 200,
187453
- headers: { "content-type": JSON_CT3, etag, "cache-control": cache2, ...vary, "x-himalaya-app": app, ...widgetScope }
187667
+ headers: { "content-type": JSON_CT3, etag, "cache-control": cache3, ...vary, "x-himalaya-app": app, ...widgetScope }
187454
187668
  });
187455
187669
  }
187456
187670
  return json6(404, { error: "not_found" });
@@ -187972,48 +188186,48 @@ var init_preview_assets_generated = __esm({
187972
188186
  init_define_HHP_CATALOG();
187973
188187
  init_preview_assets_format();
187974
188188
  PREVIEW_ASSET_MANIFEST = [
187975
- { key: "assets/DashboardHost-C7NgWR_I.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2971, sha256: "0f671123b1263a1e092b422bf41cf7c1c989125a92157f22f118d438e35c0f07" },
187976
- { key: "assets/DevDrawer-DXJObZXe.js", contentType: "application/javascript; charset=utf-8", offset: 2979, length: 16783, sha256: "b630575a1a020fe22d5c77f90a023d23212566ec6d1ba9c7e8563df91968622c" },
187977
- { key: "assets/IdiomCompare-BhFyn8Hc.js", contentType: "application/javascript; charset=utf-8", offset: 19762, length: 1926, sha256: "3aa6bfad15b5d10cf8a6a5364415e7a38730834d8acc1c5a63171d07068799e5" },
187978
- { key: "assets/LightboxViewer-D3Pk5IY4.js", contentType: "application/javascript; charset=utf-8", offset: 21688, length: 8171, sha256: "455821ac6479ff0669a874daadc8a9df2a8c1284dca80d2c231bb7c45f44a75c" },
187979
- { key: "assets/OfflineReadingBar-BJl_ZZ9T.js", contentType: "application/javascript; charset=utf-8", offset: 29859, length: 1707, sha256: "9d8bd62505b74252dd89c837d76582bafc79f3b54a508319b2a43b26838b8dda" },
187980
- { key: "assets/PhonePreviewControl-jCjzwLLv.js", contentType: "application/javascript; charset=utf-8", offset: 31566, length: 37851, sha256: "844843a49db745b762e8ac3377dae5476e3e120dcc1a5a6132d26fbbb0dccdc6" },
187981
- { key: "assets/SchemeCompare-B6_C9AHk.js", contentType: "application/javascript; charset=utf-8", offset: 69417, length: 1858, sha256: "e57904ddbcbafb32bfe203489368911c42796b47d29fa75a834a53ffbe0c22d9" },
187982
- { key: "assets/WixFrogTelemetrySink-SVoH8taa.js", contentType: "application/javascript; charset=utf-8", offset: 71275, length: 4492, sha256: "380a3e1b7aab467edb8d7a1c86d179eab0e5a931c5adae2d525cedaba726cd2a" },
187983
- { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 75767, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
187984
- { key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 77959, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
187985
- { key: "assets/catalogFontFaces-BvWS8pXE.js", contentType: "application/javascript; charset=utf-8", offset: 104005, length: 1111, sha256: "bb7d7ac7c488caa37ab96a3d286cbfb9751b8d8c4422006aee8727fbc2cb5dfb" },
187986
- { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 105116, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
187987
- { key: "assets/files-transfer-d7_Fb4VG.js", contentType: "application/javascript; charset=utf-8", offset: 107683, length: 6446, sha256: "bde8a606ae1e76d1594a9113440b4672dd5e9c4af61b38ec729a8470f3026be2" },
187988
- { key: "assets/frogApiRules-CLamKfpd.js", contentType: "application/javascript; charset=utf-8", offset: 114129, length: 2207, sha256: "20b38da11e78993663e203625862b2bc5b5f6295f4528d76845de36c89439694" },
187989
- { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 116336, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
187990
- { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 122914, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
187991
- { key: "assets/index-BxJfz-MQ.js", contentType: "application/javascript; charset=utf-8", offset: 125618, length: 1532402, sha256: "b6009cd79cf82014e86b747dbe63240ce582150336062a9891961852b744b011" },
187992
- { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1658020, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
187993
- { key: "assets/pdf-Bh7e0AqI.js", contentType: "application/javascript; charset=utf-8", offset: 1665771, length: 488215, sha256: "3361f61ce6b490c8b7b252658ea67f733d88c6e9f95906d0e31eea4827141df3" },
187994
- { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2153986, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
187995
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2154076, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
187996
- { key: "assets/pdfDocument-C1YEIvpY.js", contentType: "application/javascript; charset=utf-8", offset: 3471110, length: 3470, sha256: "f152f4715d749a4a3812c1c59963611a12cb88655ccd879b10125051304bbdc0" },
187997
- { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3474580, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
187998
- { key: "assets/webviewBridgeHost-DG1j3hvC.js", contentType: "application/javascript; charset=utf-8", offset: 3476846, length: 9888, sha256: "1e62764832280cbe7ef20510607a7154d9de9775b6825c015cc799676cbe3650" },
187999
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3486734, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
188000
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3491344, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
188001
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3979928, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
188002
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4070852, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
188003
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4161836, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
188004
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4252816, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
188005
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4343688, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
188006
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4434668, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
188007
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4543304, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
188008
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4652388, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
188009
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4761436, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
188010
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4869136, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
188011
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4957244, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
188012
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4964062, length: 4924, sha256: "3bd9d83d34671c88e8b6c3f1ce4488d023e70c04fc31657566e8971cfd46486c" },
188013
- { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 4968986, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
188014
- { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 4980443, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
188015
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4981614, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
188016
- { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5004661, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
188189
+ { key: "assets/DashboardHost-Bhk9ZjFZ.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2971, sha256: "e5424ef8c8db026653e276cd4ae414c081961f4de5f8a077c05d2e8b5d54d8bc" },
188190
+ { key: "assets/DevDrawer-ty518RlN.js", contentType: "application/javascript; charset=utf-8", offset: 2979, length: 16783, sha256: "8479451d8a87528be9953cac2570e0f3cec9c278f1fe68a8ff8d2e398bc4db7e" },
188191
+ { key: "assets/IdiomCompare-cUFh10rt.js", contentType: "application/javascript; charset=utf-8", offset: 19762, length: 1926, sha256: "fe557bf07dbbac7bce16d21d3133f8f77e8c8528b3b04a8e1f88c882fc62450c" },
188192
+ { key: "assets/LightboxViewer-Bhvr0K8H.js", contentType: "application/javascript; charset=utf-8", offset: 21688, length: 8171, sha256: "b5288295e778f17f66eeffe1d30d891863a0544f93d851df947c06fcd01fccc7" },
188193
+ { key: "assets/OfflineReadingBar-C8TKAoTW.js", contentType: "application/javascript; charset=utf-8", offset: 29859, length: 1646, sha256: "34fd31200a6ecfdba82fde419a999b338da5c096708eb46e5807937ed57c5d13" },
188194
+ { key: "assets/PhonePreviewControl-ilutBHJo.js", contentType: "application/javascript; charset=utf-8", offset: 31505, length: 37851, sha256: "0f569c93e259369ac7d82f29aa5189547e4e06959031fac866022dfada5eb419" },
188195
+ { key: "assets/SchemeCompare-DYYmzgE4.js", contentType: "application/javascript; charset=utf-8", offset: 69356, length: 1858, sha256: "e697216e4c384e10a4358a0d3ed3887b1e26d858405a9be5ee124823bb559995" },
188196
+ { key: "assets/WixFrogTelemetrySink-BxTLkSSo.js", contentType: "application/javascript; charset=utf-8", offset: 71214, length: 4492, sha256: "cc4a3355e2f1d7e22a5f17d7519b914d6269b496e6c8a4c917fe47decab5c979" },
188197
+ { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 75706, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
188198
+ { key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 77898, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
188199
+ { key: "assets/catalogFontFaces-CJWkrWxH.js", contentType: "application/javascript; charset=utf-8", offset: 103944, length: 1111, sha256: "40946c4b64571afe3dc1de58a2c120f5ae2e1b00eec6a6aed7b206de9692ba5a" },
188200
+ { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 105055, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
188201
+ { key: "assets/files-transfer-ksDbde2e.js", contentType: "application/javascript; charset=utf-8", offset: 107622, length: 6446, sha256: "87624bbbaf23a78f1ae6db386423701af567f76c35b87534ab684e54c59a1a37" },
188202
+ { key: "assets/frogApiRules-DSo2k8IL.js", contentType: "application/javascript; charset=utf-8", offset: 114068, length: 2207, sha256: "7f5c90bc62022f588edfab201b5ddb1522e2edbb6f97784a2b9ea92027185e81" },
188203
+ { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 116275, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
188204
+ { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 122853, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
188205
+ { key: "assets/index-CttPssW7.js", contentType: "application/javascript; charset=utf-8", offset: 125557, length: 1533841, sha256: "f233027cc5b3cc55db5f2b3f5e4fb83b87e342b111220eff276ca3cb69529f18" },
188206
+ { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1659398, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
188207
+ { key: "assets/pdf-DTUlmBj2.js", contentType: "application/javascript; charset=utf-8", offset: 1667149, length: 488215, sha256: "155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1" },
188208
+ { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2155364, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
188209
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2155454, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
188210
+ { key: "assets/pdfDocument-BsLA7FNe.js", contentType: "application/javascript; charset=utf-8", offset: 3472488, length: 3470, sha256: "be3fa08dd50bc021ad840abe7e927ddf10a8a57f9601e03998be2f5b017f3959" },
188211
+ { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3475958, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
188212
+ { key: "assets/webviewBridgeHost-DF4YWFN8.js", contentType: "application/javascript; charset=utf-8", offset: 3478224, length: 9888, sha256: "462e7211739223b1c1e8792f2d539d1b19bf94e041417c89ba206e93ceb8b8a8" },
188213
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3488112, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
188214
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3492722, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
188215
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3981306, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
188216
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4072230, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
188217
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4163214, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
188218
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4254194, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
188219
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4345066, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
188220
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4436046, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
188221
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4544682, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
188222
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4653766, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
188223
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4762814, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
188224
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4870514, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
188225
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4958622, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
188226
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4965440, length: 4924, sha256: "385b05cb85e5a7f954e50c398b02f7ba49054ae4409bb0dfe2f4f64ed6ffcd0e" },
188227
+ { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 4970364, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
188228
+ { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 4981821, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
188229
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4982992, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
188230
+ { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5006039, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
188017
188231
  ];
188018
188232
  }
188019
188233
  });
@@ -221215,24 +221429,24 @@ import { existsSync as existsSync106 } from "node:fs";
221215
221429
  import { join as join112, resolve as resolve78 } from "node:path";
221216
221430
  async function runGuideCommand(command, pos, flags, io2, print) {
221217
221431
  const { referenceCache: referenceCache2, referenceIdentity: referenceIdentity2 } = await Promise.resolve().then(() => (init_guides(), guides_exports));
221218
- const cache2 = referenceCache2();
221432
+ const cache3 = referenceCache2();
221219
221433
  if (command === "docs" && ["status", "refresh"].includes(pos[1])) {
221220
221434
  try {
221221
- const kit = pos[1] === "refresh" ? await cache2.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: flags["no-network"] === true }) : cache2.status();
221435
+ const kit = pos[1] === "refresh" ? await cache3.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: flags["no-network"] === true }) : cache3.status();
221222
221436
  if (flags.json === true) print({ ok: true, kit });
221223
221437
  else io2.log(JSON.stringify(kit, null, 2));
221224
221438
  return 0;
221225
221439
  } catch (e2) {
221226
221440
  const { CatalogError: CatalogError2 } = await Promise.resolve().then(() => (init_catalog_cache(), catalog_cache_exports));
221227
- io2.error(JSON.stringify({ ok: false, code: e2 instanceof CatalogError2 ? e2.code : "catalog_refresh_failed", error: e2.message, kit: cache2.status() }));
221441
+ io2.error(JSON.stringify({ ok: false, code: e2 instanceof CatalogError2 ? e2.code : "catalog_refresh_failed", error: e2.message, kit: cache3.status() }));
221228
221442
  return 2;
221229
221443
  }
221230
221444
  }
221231
221445
  if (command === "docs" && pos[1] === "catalog") {
221232
- print({ ok: true, kit: cache2.status(), resources: cache2.list(pos[2]), hint: "himi docs refresh installs compatible references; template source is inspected/downloaded through the public catalog and never silently replaces an app" });
221446
+ print({ ok: true, kit: cache3.status(), resources: cache3.list(pos[2]), hint: "himi docs refresh installs compatible references; template source is inspected/downloaded through the public catalog and never silently replaces an app" });
221233
221447
  return 0;
221234
221448
  }
221235
- if (flags.pin !== void 0 || flags.unpin === true) await cache2.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: true });
221449
+ if (flags.pin !== void 0 || flags.unpin === true) await cache3.refresh({ pin: str3(flags.pin), unpin: flags.unpin === true, noNetwork: true });
221236
221450
  const activeKit = referenceIdentity2();
221237
221451
  if (flags.json !== true && activeKit.contentVersion) io2.error(`Authoring references: kit ${activeKit.contentVersion} (${activeKit.releaseDigest}); verified cache, no network.`);
221238
221452
  const legacyPrint = print;