@wix/himalaya-cli 0.1674.0 → 0.1676.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.
package/dist/cli.mjs CHANGED
@@ -51,6 +51,7 @@ __export(client_exports, {
51
51
  MAX_PUBLISH_BODY_BYTES: () => MAX_PUBLISH_BODY_BYTES,
52
52
  ServeCliClient: () => ServeCliClient,
53
53
  encodePublishBody: () => encodePublishBody,
54
+ measurePublishBody: () => measurePublishBody,
54
55
  publishReleaseBody: () => publishReleaseBody,
55
56
  publishReleaseBodyBytes: () => publishReleaseBodyBytes,
56
57
  publishReleaseWireBytes: () => publishReleaseWireBytes
@@ -66,12 +67,19 @@ function publishReleaseWireBytes(payload, meta, draft = false) {
66
67
  return encodePublishBody(publishReleaseBody(payload, meta, draft)).bytes.byteLength;
67
68
  }
68
69
  function encodePublishBody(body) {
69
- const plain2 = Buffer.from(JSON.stringify(body), "utf8");
70
+ return encodePlainPublishBody(Buffer.from(JSON.stringify(body), "utf8"));
71
+ }
72
+ function encodePlainPublishBody(plain2) {
70
73
  if (plain2.byteLength <= MAX_PUBLISH_BODY_BYTES || plain2.byteLength > MAX_DECODED_PUBLISH_BODY_BYTES) {
71
74
  return { bytes: plain2, gzip: false };
72
75
  }
73
76
  return { bytes: gzipSync(plain2), gzip: true };
74
77
  }
78
+ function measurePublishBody(payload, meta, draft = false) {
79
+ const plain2 = Buffer.from(JSON.stringify(publishReleaseBody(payload, meta, draft)), "utf8");
80
+ const { bytes: bytes2, gzip } = encodePlainPublishBody(plain2);
81
+ return { bodyBytes: plain2.byteLength, wireBytes: bytes2.byteLength, gzip };
82
+ }
75
83
  var MAX_PUBLISH_BODY_BYTES, MAX_DECODED_PUBLISH_BODY_BYTES, CREDENTIAL_HEADERS, ServeCliClient;
76
84
  var init_client = __esm({
77
85
  "../serve-cli/src/client.ts"() {
@@ -2772,8 +2780,8 @@ async function readWip(store, app2) {
2772
2780
  if (!wipSupported(store)) return "unsupported";
2773
2781
  const { wip, promoted } = normalizeWipRecord(await store.getWipRecord(app2));
2774
2782
  if (!wip || promoted.some((p2) => p2.id === wip.releaseId)) return null;
2775
- const live3 = await store.getManifest(app2);
2776
- return live3?.releaseId === wip.releaseId ? null : wip;
2783
+ const live4 = await store.getManifest(app2);
2784
+ return live4?.releaseId === wip.releaseId ? null : wip;
2777
2785
  }
2778
2786
  var storedTime;
2779
2787
  var init_wip_pointer = __esm({
@@ -2794,15 +2802,15 @@ function validateFunctionManifest(manifest2) {
2794
2802
  throw new Error(`ReleaseManifest.functions[${fn2.name}] references missing bundle "${fn2.bundleHash}".`);
2795
2803
  }
2796
2804
  }
2797
- for (const schedule of manifest2.functionSchedules ?? []) {
2798
- if (!bundleHashes.has(schedule.bundleHash)) {
2799
- throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] references missing bundle "${schedule.bundleHash}".`);
2805
+ for (const schedule2 of manifest2.functionSchedules ?? []) {
2806
+ if (!bundleHashes.has(schedule2.bundleHash)) {
2807
+ throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] references missing bundle "${schedule2.bundleHash}".`);
2800
2808
  }
2801
- const target = functionsByName.get(schedule.functionName);
2802
- if (!target) throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] references missing function "${schedule.functionName}".`);
2803
- if (target.bundleHash !== schedule.bundleHash) throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] bundle does not match function "${schedule.functionName}".`);
2809
+ const target = functionsByName.get(schedule2.functionName);
2810
+ if (!target) throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] references missing function "${schedule2.functionName}".`);
2811
+ if (target.bundleHash !== schedule2.bundleHash) throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] bundle does not match function "${schedule2.functionName}".`);
2804
2812
  if (target.wixIdentity !== "installation" || target.wixPermissions.length === 0) {
2805
- throw new Error(`ReleaseManifest.functionSchedules[${schedule.name}] requires an installation-identity function.`);
2813
+ throw new Error(`ReleaseManifest.functionSchedules[${schedule2.name}] requires an installation-identity function.`);
2806
2814
  }
2807
2815
  }
2808
2816
  }
@@ -3143,6 +3151,7 @@ __export(dist_jobs_exports, {
3143
3151
  distJobSpec: () => distJobSpec,
3144
3152
  encodeDistParams: () => encodeDistParams,
3145
3153
  failureCodesOf: () => failureCodesOf,
3154
+ hasJobServiceEnded: () => hasJobServiceEnded,
3146
3155
  isBorrowableIosId: () => isBorrowableIosId,
3147
3156
  isSuccess: () => isSuccess,
3148
3157
  isTerminal: () => isTerminal,
@@ -3160,6 +3169,9 @@ __export(dist_jobs_exports, {
3160
3169
  function isTerminal(status) {
3161
3170
  return !!status && !IN_FLIGHT.has(status);
3162
3171
  }
3172
+ function hasJobServiceEnded(status) {
3173
+ return !!status && JOB_SERVICE_ENDED.has(status);
3174
+ }
3163
3175
  function isSuccess(status) {
3164
3176
  return status === "SUCCESS";
3165
3177
  }
@@ -3480,7 +3492,7 @@ function distJobSpec(req) {
3480
3492
  ...req.xcodeVersion ? { xcodeVersion: req.xcodeVersion } : {}
3481
3493
  };
3482
3494
  }
3483
- var DIST_ERROR_CODES, APPLE_ERROR_CODES_MAX, IN_FLIGHT, SCOPE_CREATE, SCOPE_READ, SCOPE_CANCEL, DEFAULT_BASE_URL, DEFAULT_OAUTH_URL, TOKEN_TTL_MS, JobServiceError, JobServiceBroker, CUSTOMER_UPLOAD_LEASE_MS, CUSTOMER_UPLOAD_RETRY_DELAYS_MS, CUSTOMER_UPLOAD_MAX_ATTEMPTS, CUSTOMER_UPLOAD_ABANDONED, MAX_MEASURABLE_IDENTITY_WINDOW, DIST_SHELLS, DEFAULT_DIST_SHELL, DEFAULT_BORROWABLE_IOS_IDS, BUNDLE_ID_RE, DEFAULT_DIST_SIGNING, WIX_MANAGED_SIGNING_ALIASES, DEFAULT_ANDROID_SIGNING, ANDROID_SIGNING_POLICIES, ANDROID_SIGNING_ALIASES, DEFAULT_ANDROID_FORMAT, ANDROID_FORMATS, ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, DEFAULT_ANDROID_BUILD_TYPE, ANDROID_BUILD_TYPES, ANDROID_BUILD_TYPE_NOT_BUILT, DEFAULT_GIT_URL, DIST_PACKAGE_NAME, DIST_PARAMS_FLAG, MAX_COMMAND_CHARS;
3495
+ var DIST_ERROR_CODES, APPLE_ERROR_CODES_MAX, IN_FLIGHT, JOB_SERVICE_ENDED, SCOPE_CREATE, SCOPE_READ, SCOPE_CANCEL, DEFAULT_BASE_URL, DEFAULT_OAUTH_URL, TOKEN_TTL_MS, JobServiceError, JobServiceBroker, CUSTOMER_UPLOAD_LEASE_MS, CUSTOMER_UPLOAD_RETRY_DELAYS_MS, CUSTOMER_UPLOAD_MAX_ATTEMPTS, CUSTOMER_UPLOAD_ABANDONED, MAX_MEASURABLE_IDENTITY_WINDOW, DIST_SHELLS, DEFAULT_DIST_SHELL, DEFAULT_BORROWABLE_IOS_IDS, BUNDLE_ID_RE, DEFAULT_DIST_SIGNING, WIX_MANAGED_SIGNING_ALIASES, DEFAULT_ANDROID_SIGNING, ANDROID_SIGNING_POLICIES, ANDROID_SIGNING_ALIASES, DEFAULT_ANDROID_FORMAT, ANDROID_FORMATS, ANDROID_FORMAT_NOT_BUILT, ANDROID_FORMAT_WRONG_SIGNER, ANDROID_FORMAT_NOT_REQUESTED, DEFAULT_ANDROID_BUILD_TYPE, ANDROID_BUILD_TYPES, ANDROID_BUILD_TYPE_NOT_BUILT, DEFAULT_GIT_URL, DIST_PACKAGE_NAME, DIST_PARAMS_FLAG, MAX_COMMAND_CHARS;
3484
3496
  var init_dist_jobs = __esm({
3485
3497
  "../../core/serve-control/src/dist-jobs.ts"() {
3486
3498
  init_define_HHP_CATALOG();
@@ -3517,6 +3529,7 @@ var init_dist_jobs = __esm({
3517
3529
  ];
3518
3530
  APPLE_ERROR_CODES_MAX = 5;
3519
3531
  IN_FLIGHT = /* @__PURE__ */ new Set(["CREATED", "QUEUED", "WORKING"]);
3532
+ JOB_SERVICE_ENDED = /* @__PURE__ */ new Set(["SUCCESS", "FAILURE", "CANCELED", "TIMEOUT", "INTERNAL_ERROR"]);
3520
3533
  SCOPE_CREATE = "MRE.JOB_CREATE";
3521
3534
  SCOPE_READ = "MRE.JOB_READ";
3522
3535
  SCOPE_CANCEL = "MRE.CANCEL_JOB";
@@ -15984,7 +15997,6 @@ function webViewOriginAllowed(url, origins) {
15984
15997
  }
15985
15998
  var init_webview_origin = __esm({
15986
15999
  "../../core/ts/src/webview-origin.ts"() {
15987
- "use strict";
15988
16000
  init_define_HHP_CATALOG();
15989
16001
  }
15990
16002
  });
@@ -21155,7 +21167,7 @@ function inputJson(input) {
21155
21167
  const json9 = JSON.stringify(input ?? {});
21156
21168
  return json9 === void 0 ? "{}" : json9;
21157
21169
  }
21158
- function timerGlobals(hide, live3) {
21170
+ function timerGlobals(hide, live4) {
21159
21171
  const hidden = new Set(hide ?? []);
21160
21172
  const stubs = {
21161
21173
  setTimeout: " globalThis.setTimeout = function () { return 0; };",
@@ -21181,7 +21193,7 @@ function timerGlobals(hide, live3) {
21181
21193
  setInterval: " globalThis.setInterval = function () { return 0; };",
21182
21194
  clearInterval: " globalThis.clearInterval = function () {};"
21183
21195
  };
21184
- const decls = live3 ? real : stubs;
21196
+ const decls = live4 ? real : stubs;
21185
21197
  return Object.entries(decls).filter(([name]) => !hidden.has(name)).map(([, src]) => src).join("\n");
21186
21198
  }
21187
21199
  function connectivityOnline(host) {
@@ -22239,7 +22251,7 @@ function createQuickJsWorkerRealm(options2 = {}) {
22239
22251
  );
22240
22252
  return thread;
22241
22253
  }
22242
- function answer(envelope, seq2) {
22254
+ function answer(envelope, seq3) {
22243
22255
  const bytes2 = encoder.encode(envelope);
22244
22256
  if (bytes2.length > data.length) {
22245
22257
  const err = encoder.encode(
@@ -22251,7 +22263,7 @@ function createQuickJsWorkerRealm(options2 = {}) {
22251
22263
  data.set(bytes2);
22252
22264
  Atomics.store(ctl, CTL_LEN, bytes2.length);
22253
22265
  }
22254
- Atomics.store(ctl, CTL_SEQ, seq2);
22266
+ Atomics.store(ctl, CTL_SEQ, seq3);
22255
22267
  Atomics.store(ctl, CTL_READY, 1);
22256
22268
  Atomics.notify(ctl, CTL_READY);
22257
22269
  }
@@ -38030,7 +38042,7 @@ import { createHash as createHash11 } from "node:crypto";
38030
38042
  function captureAccountSession(req, opts = {}) {
38031
38043
  const env = opts.env ?? process.env;
38032
38044
  const now = opts.now ?? Date.now();
38033
- const live3 = (cookie) => {
38045
+ const live4 = (cookie) => {
38034
38046
  const ws2 = /(?:^|;\s*)wixSession2=([^;]+)/.exec(cookie)?.[1];
38035
38047
  if (!ws2) return false;
38036
38048
  let value2 = ws2;
@@ -38041,10 +38053,10 @@ function captureAccountSession(req, opts = {}) {
38041
38053
  return !isWixSessionExpired(value2, now);
38042
38054
  };
38043
38055
  const fromRequest = forwardableWixSessionCookies(req.headers.cookie);
38044
- if (fromRequest && live3(fromRequest)) return { cookie: fromRequest, source: "cookie" };
38056
+ if (fromRequest && live4(fromRequest)) return { cookie: fromRequest, source: "cookie" };
38045
38057
  if (!opts.machineSession) return null;
38046
38058
  const fromEnv = forwardableWixSessionCookies(env.HIMI_WEB_ACCOUNT_COOKIE);
38047
- if (fromEnv && live3(fromEnv)) return { cookie: fromEnv, source: "env" };
38059
+ if (fromEnv && live4(fromEnv)) return { cookie: fromEnv, source: "env" };
38048
38060
  let fromFile = "";
38049
38061
  try {
38050
38062
  fromFile = readFileSync31(opts.dpxSessionPath ?? pathJoin2(homedir5(), ".dpx", "session", "wix-session"), "utf8").trim();
@@ -38052,7 +38064,7 @@ function captureAccountSession(req, opts = {}) {
38052
38064
  }
38053
38065
  if (fromFile && /^[^;\s=]+$/.test(fromFile)) {
38054
38066
  const cookie = `wixSession2=${fromFile}`;
38055
- if (live3(cookie)) return { cookie, source: "file" };
38067
+ if (live4(cookie)) return { cookie, source: "file" };
38056
38068
  }
38057
38069
  return null;
38058
38070
  }
@@ -40770,8 +40782,8 @@ function ImagePreviewScope({ node: node3, ctx, render: render3 }) {
40770
40782
  const id = React2.useId();
40771
40783
  const ref = React2.useRef(null);
40772
40784
  const prepared = React2.useRef();
40773
- const live3 = React2.useRef({ node: node3, ctx });
40774
- live3.current = { node: node3, ctx };
40785
+ const live4 = React2.useRef({ node: node3, ctx });
40786
+ live4.current = { node: node3, ctx };
40775
40787
  const mode = String(node3.modifiers?.imagePreview);
40776
40788
  const painted2 = React2.useRef({});
40777
40789
  const collections2 = React2.useRef(/* @__PURE__ */ new Map());
@@ -40795,13 +40807,13 @@ function ImagePreviewScope({ node: node3, ctx, render: render3 }) {
40795
40807
  const video = target.dataset.previewKind === "video" ? target.querySelector("video") ?? void 0 : void 0;
40796
40808
  if (video && !event.target.closest("[data-preview-open-video]")) return;
40797
40809
  event.stopPropagation();
40798
- const { node: node4, ctx: ctx2 } = live3.current;
40810
+ const { node: node4, ctx: ctx2 } = live4.current;
40799
40811
  if (!ctx2.onAction) return;
40800
40812
  if (prepared.current?.node !== node4) {
40801
- prepared.current = { node: node4, gallery: new ImagePreviewGallery(() => node4, (path2) => live3.current.ctx.provider?.value(path2), false) };
40813
+ prepared.current = { node: node4, gallery: new ImagePreviewGallery(() => node4, (path2) => live4.current.ctx.provider?.value(path2), false) };
40802
40814
  }
40803
- prepared.current.gallery.env = (raw) => evalEnvExpr(raw, ctxEnv(live3.current.ctx));
40804
- prepared.current.gallery.translate = (text22) => resolveTranslation(text22, live3.current.ctx.catalog);
40815
+ prepared.current.gallery.env = (raw) => evalEnvExpr(raw, ctxEnv(live4.current.ctx));
40816
+ prepared.current.gallery.translate = (text22) => resolveTranslation(text22, live4.current.ctx.catalog);
40805
40817
  const items = prepared.current.gallery.items(ctx2.itemScope ?? {}, painted2.current).filter((i2) => video ? i2.kind === "video" && JSON.stringify([i2.nodeId, ...i2.rowKeys ?? []]) === target.dataset.previewIdentity : i2.kind !== "video");
40806
40818
  const identity = target.dataset.previewIdentity;
40807
40819
  const identityFor = (item2) => JSON.stringify([item2.nodeId, ...item2.rowKeys ?? []]);
@@ -42100,13 +42112,13 @@ function easeScroll(all, instant2) {
42100
42112
  return ANCHOR_JUMP_MS;
42101
42113
  }
42102
42114
  function useTopAnchorReport(root, anchors, report9, content) {
42103
- const live3 = React8.useRef({ anchors, report: report9 });
42104
- live3.current = { anchors, report: report9 };
42115
+ const live4 = React8.useRef({ anchors, report: report9 });
42116
+ live4.current = { anchors, report: report9 };
42105
42117
  const tracker = React8.useRef(null);
42106
42118
  if (!tracker.current) {
42107
42119
  tracker.current = new TopAnchorTracker(
42108
- () => readTopAnchor(live3.current.anchors?.() ?? []),
42109
- (id) => live3.current.report(id)
42120
+ () => readTopAnchor(live4.current.anchors?.() ?? []),
42121
+ (id) => live4.current.report(id)
42110
42122
  );
42111
42123
  }
42112
42124
  const t2 = tracker.current;
@@ -42128,7 +42140,7 @@ function useTopAnchorReport(root, anchors, report9, content) {
42128
42140
  };
42129
42141
  }, [on4, t2, root]);
42130
42142
  return React8.useCallback((ms2) => {
42131
- if (live3.current.anchors) t2.jump(ms2);
42143
+ if (live4.current.anchors) t2.jump(ms2);
42132
42144
  }, [t2]);
42133
42145
  }
42134
42146
  var TOP_ANCHOR_TOLERANCE_PX, TOP_ANCHOR_SETTLE_MS, TOP_ANCHOR_JUMP_GRACE_MS, ANCHOR_JUMP_MS, SCROLL_SLACK_PX, tweens, INTERRUPTS, TopAnchorTracker;
@@ -43235,6 +43247,114 @@ var init_motionDefaults = __esm({
43235
43247
  }
43236
43248
  });
43237
43249
 
43250
+ // ../../core/web-renderer/src/inScreenMatch.ts
43251
+ function matchInScreen(before, after, opts = {}) {
43252
+ if (opts.reduceMotion) return [];
43253
+ const claimed = new Set(opts.claimed ?? []);
43254
+ const group = (entries) => {
43255
+ const m2 = /* @__PURE__ */ new Map();
43256
+ for (const e2 of entries) {
43257
+ if (!e2.id) continue;
43258
+ const list4 = m2.get(e2.id);
43259
+ if (list4) list4.push(e2);
43260
+ else m2.set(e2.id, [e2]);
43261
+ }
43262
+ return m2;
43263
+ };
43264
+ const b2 = group(before);
43265
+ const a2 = group(after);
43266
+ const out2 = [];
43267
+ for (const [id, was] of b2) {
43268
+ const now = a2.get(id);
43269
+ if (claimed.has(id) || was.length !== 1 || !now || now.length !== 1) continue;
43270
+ if (was[0].key === now[0].key || scopeOf(was[0]) !== scopeOf(now[0])) continue;
43271
+ out2.push(id);
43272
+ }
43273
+ return out2.sort();
43274
+ }
43275
+ function morphTiming(transition) {
43276
+ const m2 = /(\d+(?:\.\d+)?)(ms|s)\b\s*(.*)$/.exec(transition ?? "");
43277
+ if (!m2) return { duration: 200, easing: "ease-in-out" };
43278
+ return { duration: m2[2] === "s" ? Number(m2[1]) * 1e3 : Number(m2[1]), easing: m2[3].trim() || "ease-in-out" };
43279
+ }
43280
+ function rectOf(el2) {
43281
+ if (!el2) return null;
43282
+ const r3 = el2.getBoundingClientRect();
43283
+ return { left: r3.left, top: r3.top, width: r3.width, height: r3.height };
43284
+ }
43285
+ function noteEnter(e2) {
43286
+ live.set(e2.key, e2);
43287
+ entered.add(e2.key);
43288
+ schedule();
43289
+ }
43290
+ function noteLeave(key3, measure2) {
43291
+ const was = live.get(key3);
43292
+ live.delete(key3);
43293
+ entered.delete(key3);
43294
+ if (was) departed.push({ id: was.id, key: key3, scope: was.scope, rect: rectOf(measure2), radius: measure2 ? getComputedStyle(measure2).borderRadius : "" });
43295
+ schedule();
43296
+ }
43297
+ function schedule() {
43298
+ if (scheduled) return;
43299
+ scheduled = true;
43300
+ queueMicrotask(flush);
43301
+ }
43302
+ function navigating() {
43303
+ return typeof document !== "undefined" && !!document.activeViewTransition;
43304
+ }
43305
+ function flush() {
43306
+ scheduled = false;
43307
+ const left = departed;
43308
+ const arrived = entered;
43309
+ departed = [];
43310
+ entered = /* @__PURE__ */ new Set();
43311
+ if (!left.length || !arrived.size) return;
43312
+ const reduce = typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
43313
+ const nav = navigating();
43314
+ for (const scope3 of new Set(left.map(scopeOf))) playScope(scope3, left.filter((d2) => scopeOf(d2) === scope3), arrived, reduce, nav);
43315
+ }
43316
+ function playScope(scope3, left, arrived, reduce, nav) {
43317
+ const touched = new Set(left.map((d2) => d2.id));
43318
+ const after = [...live.values()].filter((l2) => touched.has(l2.id) && scopeOf(l2) === scope3);
43319
+ const before = [...after.filter((l2) => !arrived.has(l2.key)), ...left];
43320
+ const matched = matchInScreen(before, after, { reduceMotion: reduce, claimed: nav ? touched : [] });
43321
+ for (const id of matched) {
43322
+ const from = left.find((d2) => d2.id === id);
43323
+ const to2 = after.find((l2) => l2.id === id);
43324
+ const el2 = to2?.el();
43325
+ if (!from?.rect || !to2 || !el2 || typeof el2.animate !== "function") continue;
43326
+ const last = rectOf(el2);
43327
+ if (!last || last.width === 0 || last.height === 0) continue;
43328
+ const dx = from.rect.left + from.rect.width / 2 - (last.left + last.width / 2);
43329
+ const dy = from.rect.top + from.rect.height / 2 - (last.top + last.height / 2);
43330
+ const sx = from.rect.width / last.width;
43331
+ const sy = from.rect.height / last.height;
43332
+ const style = getComputedStyle(el2);
43333
+ const own6 = style.transform && style.transform !== "none" ? style.transform : "";
43334
+ const toRadius = style.borderRadius;
43335
+ el2.animate(
43336
+ [
43337
+ { transform: `translate(${dx}px, ${dy}px) scale(${sx}, ${sy})${own6 ? ` ${own6}` : ""}`, borderRadius: from.radius || toRadius },
43338
+ { transform: own6 || "none", borderRadius: toRadius }
43339
+ ],
43340
+ { duration: to2.duration, easing: to2.easing }
43341
+ );
43342
+ }
43343
+ }
43344
+ var scopeOf, live, departed, entered, scheduled, seq, nextMorphKey;
43345
+ var init_inScreenMatch = __esm({
43346
+ "../../core/web-renderer/src/inScreenMatch.ts"() {
43347
+ init_define_HHP_CATALOG();
43348
+ scopeOf = (e2) => e2.scope ?? "s";
43349
+ live = /* @__PURE__ */ new Map();
43350
+ departed = [];
43351
+ entered = /* @__PURE__ */ new Set();
43352
+ scheduled = false;
43353
+ seq = 0;
43354
+ nextMorphKey = () => `m${++seq}`;
43355
+ }
43356
+ });
43357
+
43238
43358
  // ../../core/web-renderer/src/boundTransforms.ts
43239
43359
  function boundNumber(value2) {
43240
43360
  if (typeof value2 === "number") return Number.isFinite(value2) ? value2 : void 0;
@@ -43554,8 +43674,8 @@ function createRicosHostSession(o2) {
43554
43674
  const t2 = o2.timers ?? realTimers;
43555
43675
  const flushMs = o2.flushTimeoutMs ?? RICOS_HOST_DEFAULTS.flushTimeoutMs;
43556
43676
  const debounceMs = o2.onChangeDebounceMs ?? RICOS_HOST_DEFAULTS.onChangeDebounceMs;
43557
- let seq2 = 0;
43558
- const newId = o2.newId ?? (() => `rq${Date.now().toString(36)}${++seq2}`);
43677
+ let seq3 = 0;
43678
+ const newId = o2.newId ?? (() => `rq${Date.now().toString(36)}${++seq3}`);
43559
43679
  const state = { ready: false, unavailable: null, dirty: false, toolbar: EMPTY_TOOLBAR, focused: false };
43560
43680
  let locale = o2.locale;
43561
43681
  let rtl = o2.rtl;
@@ -43977,7 +44097,7 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
43977
44097
  const C2 = ctx.color;
43978
44098
  const name = typeof props2.name === "string" && props2.name ? props2.name : void 0;
43979
44099
  const bag = React13.useContext(FormValuesContext);
43980
- const live3 = !!ctx.onAction;
44100
+ const live4 = !!ctx.onAction;
43981
44101
  const toolsKey = JSON.stringify(props2.tools ?? null);
43982
44102
  const tools = React13.useMemo(() => effectiveTools(props2.tools, props2.uploadService), [toolsKey, props2.uploadService]);
43983
44103
  const seedMode = typeof props2.documentJson === "string" ? "literal" : typeof props2.documentPath === "string" && props2.documentPath ? "binding" : "none";
@@ -44020,11 +44140,11 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
44020
44140
  const fireOnChangeRef = React13.useRef(fireOnChange);
44021
44141
  fireOnChangeRef.current = fireOnChange;
44022
44142
  React13.useEffect(() => {
44023
- if (live3) setSrc(new URL(ENGINE_PAGE_PATH, document.baseURI).toString());
44024
- }, [live3]);
44143
+ if (live4) setSrc(new URL(ENGINE_PAGE_PATH, document.baseURI).toString());
44144
+ }, [live4]);
44025
44145
  React13.useEffect(() => {
44026
44146
  const frame = iframeRef.current;
44027
- if (!live3 || !src || !frame) return;
44147
+ if (!live4 || !src || !frame) return;
44028
44148
  const t2 = ricosEditorWebTimings;
44029
44149
  const session = createRicosHostSession({
44030
44150
  send: (msg) => frame.contentWindow?.postMessage({ ricos: 1, msg }, "*"),
@@ -44069,7 +44189,7 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
44069
44189
  session.dispose();
44070
44190
  sessionRef.current = null;
44071
44191
  };
44072
- }, [live3, src]);
44192
+ }, [live4, src]);
44073
44193
  React13.useEffect(() => {
44074
44194
  sessionRef.current?.updateLocale(ctx.localeTag ?? "en", ctx.isRTL ?? document.documentElement.dir === "rtl");
44075
44195
  }, [ctx.localeTag, ctx.isRTL]);
@@ -44128,7 +44248,7 @@ function RichContentEditorView({ props: props2, ctx, wrap, nodeId, renderChild,
44128
44248
  setLink(null);
44129
44249
  };
44130
44250
  const root = { position: "relative", display: "flex", flexDirection: "column", width: "100%", ...fill ? { flex: "1 1 auto" } : {}, minHeight, ...wrap };
44131
- if (!live3) {
44251
+ if (!live4) {
44132
44252
  const { paddingTop: _t2, paddingBottom: _b, paddingLeft: _l2, paddingRight: _r2, ...rootNoSides } = root;
44133
44253
  const own6 = { ...rootNoSides, border: `1px solid ${C2("border", "#e3e3e3")}`, borderRadius: 8, padding: 12, boxSizing: "border-box" };
44134
44254
  return /* @__PURE__ */ jsx8("div", { ...dom, style: addIntrinsicPadding(own6, wrap) ?? own6, children: /* @__PURE__ */ jsx8("span", { style: { color: C2("textSecondary", "#636B78") }, children: placeholder3 || "Rich text editor" }) });
@@ -44513,7 +44633,7 @@ function createRadioGroups() {
44513
44633
  const owners = /* @__PURE__ */ new Map();
44514
44634
  const members2 = /* @__PURE__ */ new Map();
44515
44635
  const listeners2 = /* @__PURE__ */ new Set();
44516
- let seq2 = 0;
44636
+ let seq3 = 0;
44517
44637
  const emit = () => {
44518
44638
  for (const l2 of [...listeners2]) l2();
44519
44639
  };
@@ -44521,8 +44641,8 @@ function createRadioGroups() {
44521
44641
  /** A fresh member identity — per mounted radio, not per component id (rows of one bound
44522
44642
  * template share an id and must each be their own member). */
44523
44643
  newMember() {
44524
- seq2 += 1;
44525
- return `radio-${seq2}`;
44644
+ seq3 += 1;
44645
+ return `radio-${seq3}`;
44526
44646
  },
44527
44647
  owner(group) {
44528
44648
  return owners.get(group);
@@ -44668,8 +44788,8 @@ var init_controls = __esm({
44668
44788
  React15.useEffect(() => {
44669
44789
  setTapped(null);
44670
44790
  }, [bound2, props2.valuePath, ctx.provider]);
44671
- const live3 = standaloneService && tapped && tapped.path === props2.valuePath && Object.is(tapped.over, bound2) && tapped.provider === ctx.provider ? tapped.on : null;
44672
- const on4 = inForm && touchedField.current === fieldId && formOn !== null ? formOn : live3 ?? resolved2;
44791
+ const live4 = standaloneService && tapped && tapped.path === props2.valuePath && Object.is(tapped.over, bound2) && tapped.provider === ctx.provider ? tapped.on : null;
44792
+ const on4 = inForm && touchedField.current === fieldId && formOn !== null ? formOn : live4 ?? resolved2;
44673
44793
  const ruleKey = props2.validation ? JSON.stringify(props2.validation) : "";
44674
44794
  React15.useEffect(() => {
44675
44795
  if (!bag || !fieldId) return;
@@ -45198,7 +45318,7 @@ function isWithinTopModal(el2) {
45198
45318
  const top = topOver(el2);
45199
45319
  return top == null || top.el.contains(el2);
45200
45320
  }
45201
- function live() {
45321
+ function live2() {
45202
45322
  const out2 = [];
45203
45323
  for (const layer of layers) {
45204
45324
  const el2 = layer.el();
@@ -45233,7 +45353,7 @@ function topOf(candidates, all) {
45233
45353
  return top;
45234
45354
  }
45235
45355
  function topOver(target) {
45236
- const all = live();
45356
+ const all = live2();
45237
45357
  return topOf(all.filter((l2) => l2.scope.contains(target) || target.contains(l2.el)), all);
45238
45358
  }
45239
45359
  function topLayerOver(target) {
@@ -45244,7 +45364,7 @@ function sync() {
45244
45364
  watcher = null;
45245
45365
  for (const el2 of madeInert) el2.removeAttribute("inert");
45246
45366
  madeInert.clear();
45247
- const all = live();
45367
+ const all = live2();
45248
45368
  if (!all.length) return;
45249
45369
  const levels = /* @__PURE__ */ new Set();
45250
45370
  for (const scope3 of new Set(all.map((l2) => l2.scope))) {
@@ -47077,8 +47197,8 @@ function WebViewBridgeHost(p2) {
47077
47197
  const source2 = p2.htmlStr != null ? "\0html" : p2.urlStr ?? "";
47078
47198
  const origins = p2.allowedOrigins.join("\n");
47079
47199
  const sessionRef = React18.useRef(null);
47080
- const live3 = React18.useRef({ active: active2, muted });
47081
- live3.current = { active: active2, muted };
47200
+ const live4 = React18.useRef({ active: active2, muted });
47201
+ live4.current = { active: active2, muted };
47082
47202
  React18.useEffect(() => {
47083
47203
  if (typeof window === "undefined") return;
47084
47204
  if (p2.urlStr == null && p2.htmlStr == null) return;
@@ -47096,8 +47216,8 @@ function WebViewBridgeHost(p2) {
47096
47216
  consoleForwarding,
47097
47217
  win: window,
47098
47218
  frameWindow: () => p2.frameRef.current?.contentWindow ?? null,
47099
- active: live3.current.active,
47100
- muted: live3.current.muted
47219
+ active: live4.current.active,
47220
+ muted: live4.current.muted
47101
47221
  });
47102
47222
  session.start();
47103
47223
  sessionRef.current = session;
@@ -117464,7 +117584,7 @@ var init_pdf_worker_min = __esm({
117464
117584
  c2 = false;
117465
117585
  this[So].firstUnsplittable = null;
117466
117586
  this[So].noLayoutFailure = false;
117467
- const flush = (t4) => {
117587
+ const flush2 = (t4) => {
117468
117588
  const n3 = e2[xo]();
117469
117589
  if (n3) {
117470
117590
  c2 ||= n3.children?.length > 0;
@@ -117492,7 +117612,7 @@ var init_pdf_worker_min = __esm({
117492
117612
  }
117493
117613
  if (h3.isBreak()) {
117494
117614
  const e3 = h3.breakNode;
117495
- flush(t4);
117615
+ flush2(t4);
117496
117616
  if ("auto" === e3.targetType) continue;
117497
117617
  if (e3.leader) {
117498
117618
  l2 = this[gl](e3.leader, e3[zo]());
@@ -117518,7 +117638,7 @@ var init_pdf_worker_min = __esm({
117518
117638
  const n3 = e3[Ho](), a5 = n3.target;
117519
117639
  n3.addLeader = null !== n3.leader;
117520
117640
  n3.addTrailer = null !== n3.trailer;
117521
- flush(t4);
117641
+ flush2(t4);
117522
117642
  const s4 = t4;
117523
117643
  t4 = 1 / 0;
117524
117644
  if (a5 instanceof PageArea) o2 = a5;
@@ -117532,7 +117652,7 @@ var init_pdf_worker_min = __esm({
117532
117652
  }
117533
117653
  continue;
117534
117654
  }
117535
- flush(t4);
117655
+ flush2(t4);
117536
117656
  }
117537
117657
  this[So].pageNumber += 1;
117538
117658
  o2 && (o2[nl]() ? o2[So].numberOfUse += 1 : o2 = null);
@@ -127800,7 +127920,7 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
127800
127920
  frame2.scrollTop += (canvas.getBoundingClientRect().top - box.top) / scale;
127801
127921
  }, [startPage, pages2]);
127802
127922
  React19.useEffect(() => {
127803
- let live3 = true;
127923
+ let live4 = true;
127804
127924
  let loading;
127805
127925
  const container = containerRef.current;
127806
127926
  setFailedRequest(null);
@@ -127808,11 +127928,11 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
127808
127928
  void (async () => {
127809
127929
  if (!container) return;
127810
127930
  if (!container.ownerDocument.createElement("canvas").getContext("2d")) {
127811
- if (live3) setFailedRequest(request);
127931
+ if (live4) setFailedRequest(request);
127812
127932
  return;
127813
127933
  }
127814
127934
  const task = await loadDocument(src, container.ownerDocument);
127815
- if (!live3) {
127935
+ if (!live4) {
127816
127936
  void task.promise.catch(() => {
127817
127937
  });
127818
127938
  void destroyPdfDocumentLoad(task);
@@ -127820,13 +127940,13 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
127820
127940
  }
127821
127941
  loading = task;
127822
127942
  const document2 = await task.promise;
127823
- const count2 = await paintPdfDocument(document2, container, container.clientWidth || 600, startPageRef.current, zoomPercent, () => live3, onPageCount);
127824
- if (live3) setPages(count2);
127943
+ const count2 = await paintPdfDocument(document2, container, container.clientWidth || 600, startPageRef.current, zoomPercent, () => live4, onPageCount);
127944
+ if (live4) setPages(count2);
127825
127945
  })().catch(() => {
127826
- if (live3) setFailedRequest(request);
127946
+ if (live4) setFailedRequest(request);
127827
127947
  });
127828
127948
  return () => {
127829
- live3 = false;
127949
+ live4 = false;
127830
127950
  if (loading) void destroyPdfDocumentLoad(loading);
127831
127951
  container?.replaceChildren();
127832
127952
  };
@@ -128774,6 +128894,15 @@ function richContentDocumentHash(s2) {
128774
128894
  }
128775
128895
  return h2 >>> 0;
128776
128896
  }
128897
+ function visibilityDelegates(node3, ctx) {
128898
+ const mods = node3?.modifiers;
128899
+ const hp = mods?.hiddenPath ?? mods?.hidden_path;
128900
+ if (typeof hp === "string" && !isEnvExpr(hp) && isBinding(hp) && isStateBinding(hp) && !!ctx.provider) return true;
128901
+ const lit = typeof hp === "string" ? hp.trim().toLowerCase() : void 0;
128902
+ const litPath = lit === "true" || lit === "1" || lit === "false" || lit === "0";
128903
+ if ((typeof mods?.hidden === "boolean" || litPath) && exitSpecFor(mods, ctx)) return true;
128904
+ return typeof hp === "string" && isEnvExpr(hp) && !!exitSpecFor(mods, ctx);
128905
+ }
128777
128906
  function useBoundTransformMotion(node3, ctx) {
128778
128907
  const last = React20.useRef(void 0);
128779
128908
  const modifiers = node3?.modifiers;
@@ -130004,7 +130133,7 @@ function packOverlaps(items) {
130004
130133
  const result = [];
130005
130134
  let cluster = [];
130006
130135
  let clusterEnd = -Infinity;
130007
- const flush = () => {
130136
+ const flush2 = () => {
130008
130137
  if (!cluster.length) return;
130009
130138
  const columnsEnd = [];
130010
130139
  const placed = [];
@@ -130022,11 +130151,11 @@ function packOverlaps(items) {
130022
130151
  clusterEnd = -Infinity;
130023
130152
  };
130024
130153
  for (const item2 of sorted2) {
130025
- if (cluster.length && item2.startMin >= clusterEnd) flush();
130154
+ if (cluster.length && item2.startMin >= clusterEnd) flush2();
130026
130155
  cluster.push(item2);
130027
130156
  clusterEnd = Math.max(clusterEnd, item2.endMin);
130028
130157
  }
130029
- flush();
130158
+ flush2();
130030
130159
  return result;
130031
130160
  }
130032
130161
  function actionClick(ctx, action) {
@@ -130590,7 +130719,13 @@ function renderNode(node3, ctx) {
130590
130719
  }
130591
130720
  ensureFocusStyles();
130592
130721
  const bindings = directServiceBindings(node3);
130593
- return bindings.length > 0 && ctx.provider || boundTransformPaths(node3?.modifiers) ? /* @__PURE__ */ jsx13(ReactiveDirectScalars, { node: node3, ctx, bindings }) : renderNodeInner(node3, ctx);
130722
+ const rendered = bindings.length > 0 && ctx.provider || boundTransformPaths(node3?.modifiers) ? /* @__PURE__ */ jsx13(ReactiveDirectScalars, { node: node3, ctx, bindings }) : renderNodeInner(node3, ctx);
130723
+ const mods = node3?.modifiers;
130724
+ const tid2 = typeof mods?.transitionId === "string" ? resolvedComponentId(mods.transitionId, ctx) : void 0;
130725
+ if (tid2 && rendered != null && !visibilityDelegates(node3, ctx) && !ctx.reduceMotion() && !motionDeterministic()) {
130726
+ return /* @__PURE__ */ jsx13(InScreenMorphHost, { id: tid2, scope: ctx.screenId ?? "", transition: ctx.motionTransition(mods?.motion ?? ctx.kit?.motion), children: rendered });
130727
+ }
130728
+ return rendered;
130594
130729
  }
130595
130730
  function applyBoundTransforms(wrap, modifiers, bt2, motion, ctx) {
130596
130731
  if (bindsTransform(bt2.bound)) {
@@ -131401,7 +131536,7 @@ function reportUnknownComponent(ctx, pkg, type2) {
131401
131536
  function unknownComponentShowsDeveloperLabel(ctx) {
131402
131537
  return ctx.debugUnknownComponents ?? ctx.previewSurface != null;
131403
131538
  }
131404
- var AppearanceActionContext, rowValue, loadPdfFetch, WebViewBridgeHost2, useIsomorphicLayoutEffect2, GridColumnsContext, GridBoundList, GRID_SPAN_ALL, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, LOTTIE_RUNTIME_ATTRIBUTES, lottieAnims, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, asBoundCopy, useBoundCopy, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, substituteItemDeep, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, resolveNodeBoundTransforms, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_ANCHOR_CONTROL, MenuNode, MENU_LONG_PRESS_MS, menuOpensOnLongPress, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ERROR_STATE_VARIANTS, ERROR_STATE_SPACING, ErrorStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, QrCodeNode, ShapeNode, LegendMarker, LegendNode, cellAlign, dataTableProbe, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, LiveWaveformNode, TimelineNode, ECHO_WINDOW_MS, heldPageIndex, LiveWindowMeasured, LiveWindowPage, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, railScrollLeft, carouselScrollLeft, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, rowRenderers, railRowFrame, renderRailRow, RowAnchors, reportedUnknownComponents, UnknownComponentNode, WebRenderer, ScrollIntoViewNode;
131539
+ var AppearanceActionContext, rowValue, loadPdfFetch, WebViewBridgeHost2, useIsomorphicLayoutEffect2, GridColumnsContext, GridBoundList, GRID_SPAN_ALL, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, LOTTIE_RUNTIME_ATTRIBUTES, lottieAnims, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, asBoundCopy, useBoundCopy, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, substituteItemDeep, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, InScreenMorphHost, ReactiveDirectScalars, resolveNodeBoundTransforms, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_ANCHOR_CONTROL, MenuNode, MENU_LONG_PRESS_MS, menuOpensOnLongPress, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ERROR_STATE_VARIANTS, ERROR_STATE_SPACING, ErrorStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, QrCodeNode, ShapeNode, LegendMarker, LegendNode, cellAlign, dataTableProbe, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, LiveWaveformNode, TimelineNode, ECHO_WINDOW_MS, heldPageIndex, LiveWindowMeasured, LiveWindowPage, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, railScrollLeft, carouselScrollLeft, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, rowRenderers, railRowFrame, renderRailRow, RowAnchors, reportedUnknownComponents, UnknownComponentNode, WebRenderer, ScrollIntoViewNode;
131405
131540
  var init_renderNode = __esm({
131406
131541
  "../../core/web-renderer/src/renderNode.tsx"() {
131407
131542
  "use strict";
@@ -131446,6 +131581,7 @@ var init_renderNode = __esm({
131446
131581
  init_pickerField();
131447
131582
  init_symbolEffects();
131448
131583
  init_motionDefaults();
131584
+ init_inScreenMatch();
131449
131585
  init_boundTransforms();
131450
131586
  init_mediaProps();
131451
131587
  init_webviewFrame();
@@ -131580,12 +131716,12 @@ var init_renderNode = __esm({
131580
131716
  const react = () => {
131581
131717
  if (!alive) return;
131582
131718
  running = el2.animate(frames, { duration: total, easing: "ease-in-out", composite: "add" });
131583
- running.onfinish = () => schedule();
131719
+ running.onfinish = () => schedule2();
131584
131720
  };
131585
- const schedule = () => {
131721
+ const schedule2 = () => {
131586
131722
  if (alive) timer = setTimeout(react, ambientGapMs(kind, opts, Math.random()));
131587
131723
  };
131588
- schedule();
131724
+ schedule2();
131589
131725
  }
131590
131726
  return () => {
131591
131727
  alive = false;
@@ -131664,7 +131800,7 @@ var init_renderNode = __esm({
131664
131800
  const bound2 = Object.entries(params).filter(
131665
131801
  ([, v2]) => typeof v2 === "string" && isStateBinding(v2)
131666
131802
  );
131667
- const [live3, setLive] = React20.useState(() => {
131803
+ const [live4, setLive] = React20.useState(() => {
131668
131804
  const seed2 = {};
131669
131805
  if (ctx.provider) for (const [k3, p2] of bound2) seed2[k3] = ctx.provider.value(servicePath(p2));
131670
131806
  return seed2;
@@ -131678,7 +131814,7 @@ var init_renderNode = __esm({
131678
131814
  );
131679
131815
  return () => unsubs.forEach((u2) => u2());
131680
131816
  }, [ctx.provider, subKey]);
131681
- const resolved2 = { ...live3 };
131817
+ const resolved2 = { ...live4 };
131682
131818
  for (const [k3, v2] of Object.entries(params)) {
131683
131819
  if (typeof v2 === "string" && v2.startsWith("$item")) resolved2[k3] = resolveScalarStatic(v2, ctx);
131684
131820
  }
@@ -132037,6 +132173,18 @@ var init_renderNode = __esm({
132037
132173
  const element = content;
132038
132174
  return React20.cloneElement(element, { style: { ...element.props.style, ...style } });
132039
132175
  };
132176
+ InScreenMorphHost = ({ id, scope: scope3, transition, style, children: children2 }) => {
132177
+ const ref = React20.useRef(null);
132178
+ const key3 = React20.useRef("");
132179
+ if (!key3.current) key3.current = nextMorphKey();
132180
+ const timing = morphTiming(transition);
132181
+ React20.useLayoutEffect(() => {
132182
+ const k3 = key3.current;
132183
+ noteEnter({ id, key: k3, scope: scope3, el: () => ref.current?.firstElementChild, duration: timing.duration, easing: timing.easing });
132184
+ return () => noteLeave(k3, ref.current?.firstElementChild);
132185
+ }, [id, scope3]);
132186
+ return /* @__PURE__ */ jsx13("div", { ref, "data-himalaya-transition-id": id, style: { display: "contents" }, children: style ? withRootStyle(children2, style) : children2 });
132187
+ };
132040
132188
  ReactiveDirectScalars = ({ node: node3, ctx, bindings, style }) => {
132041
132189
  const [, rerender] = React20.useState(0);
132042
132190
  const bindingKey = bindings.join("|");
@@ -132778,18 +132926,18 @@ var init_renderNode = __esm({
132778
132926
  React20.useEffect(() => {
132779
132927
  const el2 = ref.current;
132780
132928
  if (!cursor || !ctx.onAction || !el2 || typeof IntersectionObserver === "undefined") return;
132781
- let live3 = true;
132929
+ let live4 = true;
132782
132930
  let root = el2.parentElement;
132783
132931
  while (root && !["auto", "scroll", "overlay"].includes(el2.ownerDocument.defaultView?.getComputedStyle(root).overflowY ?? "")) root = root.parentElement;
132784
132932
  const io2 = new IntersectionObserver((entries) => {
132785
- if (!live3 || !entries[entries.length - 1]?.isIntersecting) return;
132933
+ if (!live4 || !entries[entries.length - 1]?.isIntersecting) return;
132786
132934
  if (pages2.claim(cycle)) {
132787
132935
  ctx.onAction?.(workerTap.tapped(firedWithoutTap(action)));
132788
132936
  }
132789
132937
  }, { root, rootMargin: "0px 0px 320px 0px" });
132790
132938
  io2.observe(el2);
132791
132939
  return () => {
132792
- live3 = false;
132940
+ live4 = false;
132793
132941
  io2.disconnect();
132794
132942
  };
132795
132943
  }, [pages2, cycle, cursor, ctx.onAction, action]);
@@ -133342,12 +133490,12 @@ var init_renderNode = __esm({
133342
133490
  const [retyped, setRetyped] = React20.useState(null);
133343
133491
  React20.useEffect(() => {
133344
133492
  if (!retypeSrc) return;
133345
- let live3 = true;
133493
+ let live4 = true;
133346
133494
  let made = null;
133347
133495
  const settle2 = (r3) => {
133348
133496
  const u2 = r3?.url ?? null;
133349
133497
  made = u2;
133350
- if (!live3) {
133498
+ if (!live4) {
133351
133499
  if (u2) URL.revokeObjectURL(u2);
133352
133500
  return;
133353
133501
  }
@@ -133355,7 +133503,7 @@ var init_renderNode = __esm({
133355
133503
  };
133356
133504
  loadPdfFetch().then((m2) => m2.retypeAsPdfCounted(retypeSrc)).then(settle2, () => settle2(null));
133357
133505
  return () => {
133358
- live3 = false;
133506
+ live4 = false;
133359
133507
  if (made) URL.revokeObjectURL(made);
133360
133508
  setRetyped((cur) => cur?.from === retypeSrc ? null : cur);
133361
133509
  };
@@ -133368,15 +133516,15 @@ var init_renderNode = __esm({
133368
133516
  const [direct, setDirect] = React20.useState(null);
133369
133517
  React20.useEffect(() => {
133370
133518
  if (!directSrc) return;
133371
- let live3 = true;
133519
+ let live4 = true;
133372
133520
  let made = null;
133373
133521
  loadPdfFetch().then((m2) => m2.fetchPdfDocument(splitFragment(directSrc).base), () => null).then((doc) => {
133374
- if (!live3) return;
133522
+ if (!live4) return;
133375
133523
  made = wantsShare && doc ? URL.createObjectURL(doc.blob) : null;
133376
133524
  setDirect({ from: directSrc, count: doc?.pageCount ?? null, blobUrl: made });
133377
133525
  });
133378
133526
  return () => {
133379
- live3 = false;
133527
+ live4 = false;
133380
133528
  if (made) URL.revokeObjectURL(made);
133381
133529
  setDirect((cur) => cur?.from === directSrc ? null : cur);
133382
133530
  };
@@ -134909,7 +135057,7 @@ var init_renderNode = __esm({
134909
135057
  const drag = React20.useRef(null);
134910
135058
  const reduceMotion = ctx.reduceMotion();
134911
135059
  const [mounted, setMounted] = React20.useState(shown2);
134912
- const [entered, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
135060
+ const [entered2, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
134913
135061
  React20.useEffect(() => {
134914
135062
  if (shown2) {
134915
135063
  setMounted(true);
@@ -134942,7 +135090,7 @@ var init_renderNode = __esm({
134942
135090
  }, [mounted]);
134943
135091
  if (!shown2 && !mounted) return null;
134944
135092
  const leaving = !shown2;
134945
- const atRest = entered && !leaving;
135093
+ const atRest = entered2 && !leaving;
134946
135094
  const grabber = props2.showGrabber !== false && edge === "bottom";
134947
135095
  const sheet = idiomControls(ctx.idiom).sheet;
134948
135096
  const r3 = `${sheet.cornerRadius}px`;
@@ -135063,7 +135211,7 @@ var init_renderNode = __esm({
135063
135211
  }, [shown2]);
135064
135212
  const reduceMotion = ctx.reduceMotion();
135065
135213
  const [mounted, setMounted] = React20.useState(shown2);
135066
- const [entered, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
135214
+ const [entered2, setEntered] = React20.useState(shown2 && ctx.staticRender === true);
135067
135215
  React20.useEffect(() => {
135068
135216
  if (shown2) {
135069
135217
  setMounted(true);
@@ -135216,7 +135364,7 @@ var init_renderNode = __esm({
135216
135364
  const index = Math.min(detentIndex, Math.max(detents.length - 1, 0));
135217
135365
  dragState.current = { index, count: detents.length, dismissible };
135218
135366
  const leaving = !shown2;
135219
- const atRest = entered && !leaving;
135367
+ const atRest = entered2 && !leaving;
135220
135368
  const grabber = props2.showGrabber !== false;
135221
135369
  const dragFrame = drawerDragFrame(index, detents, regionPx, dragDy, dismissible);
135222
135370
  const sized = detents.length && regionPx > 0 ? { height: `${Math.round(dragFrame.heightPx ?? detents[index] * regionPx)}px`, display: "flex", flexDirection: "column" } : {};
@@ -136365,7 +136513,7 @@ var init_renderNode = __esm({
136365
136513
  const granted = providerAllowsLiveAudio(ctx.provider);
136366
136514
  const canRun = gateOpen && sourceKnown && granted && !ctx.empty && typeof requestAnimationFrame === "function";
136367
136515
  const [levels, setLevels] = React20.useState(() => new Array(bars).fill(0));
136368
- const [live3, setLive] = React20.useState(false);
136516
+ const [live4, setLive] = React20.useState(false);
136369
136517
  React20.useEffect(() => {
136370
136518
  const flat2 = () => {
136371
136519
  setLive(false);
@@ -136410,13 +136558,13 @@ var init_renderNode = __esm({
136410
136558
  };
136411
136559
  }, [canRun, bars, ctx.liveAudioLevel]);
136412
136560
  const color = ctx.color(resolveScalarStatic(props2.color, ctx) ?? "accentPrimary", "#116DFF");
136413
- const glide = live3 && !ctx.reduceMotion() ? `height ${Math.round(LIVE_WAVEFORM_MIN_FRAME_MS * 4)}ms linear` : void 0;
136561
+ const glide = live4 && !ctx.reduceMotion() ? `height ${Math.round(LIVE_WAVEFORM_MIN_FRAME_MS * 4)}ms linear` : void 0;
136414
136562
  const minBar = 2;
136415
136563
  return /* @__PURE__ */ jsx13(
136416
136564
  "div",
136417
136565
  {
136418
- "data-live-waveform-state": live3 ? "live" : "idle",
136419
- "data-a11y-value": live3 ? "live" : "idle",
136566
+ "data-live-waveform-state": live4 ? "live" : "idle",
136567
+ "data-a11y-value": live4 ? "live" : "idle",
136420
136568
  "aria-hidden": "true",
136421
136569
  ...{ [INFERRED_DECORATIVE]: true, [ROLE_WHEN_NAMED]: "img" },
136422
136570
  style: { display: "flex", alignItems: "center", gap: 2, height, width: "100%", boxSizing: "border-box", ...wrap },
@@ -136429,9 +136577,9 @@ var init_renderNode = __esm({
136429
136577
  maxWidth: 6,
136430
136578
  minWidth: 1,
136431
136579
  borderRadius: 999,
136432
- height: live3 ? Math.max(minBar, Math.round(v2 * height)) : minBar,
136580
+ height: live4 ? Math.max(minBar, Math.round(v2 * height)) : minBar,
136433
136581
  background: color,
136434
- opacity: live3 ? 1 : 0.3,
136582
+ opacity: live4 ? 1 : 0.3,
136435
136583
  transition: glide
136436
136584
  }
136437
136585
  },
@@ -141040,9 +141188,9 @@ async function handleOwnerSitesRequest(req, res) {
141040
141188
  try {
141041
141189
  const { fetchLiveOwnerSites } = await import("./apps/wix-owner-clone-live.js");
141042
141190
  const { buildWixOwnerCloneSites } = await import("./apps/wix-owner-clone-app.js");
141043
- const live3 = await fetchLiveOwnerSites();
141044
- if (live3) {
141045
- payload = { sites: live3 };
141191
+ const live4 = await fetchLiveOwnerSites();
141192
+ if (live4) {
141193
+ payload = { sites: live4 };
141046
141194
  } else {
141047
141195
  source2 = "fallback";
141048
141196
  payload = buildWixOwnerCloneSites();
@@ -141494,7 +141642,7 @@ async function handleHotReloadCommand(req, res, state) {
141494
141642
  function startBundleArtifactWatcher(state) {
141495
141643
  const pending2 = /* @__PURE__ */ new Set();
141496
141644
  let timer;
141497
- const flush = () => {
141645
+ const flush2 = () => {
141498
141646
  timer = void 0;
141499
141647
  const bundles = [...pending2].sort();
141500
141648
  pending2.clear();
@@ -141513,7 +141661,7 @@ function startBundleArtifactWatcher(state) {
141513
141661
  if (!bundle) return;
141514
141662
  pending2.add(bundle);
141515
141663
  if (timer) clearTimeout(timer);
141516
- timer = setTimeout(flush, 120);
141664
+ timer = setTimeout(flush2, 120);
141517
141665
  });
141518
141666
  watcher2.on("error", (err) => {
141519
141667
  console.warn(`[himalaya-dev] bundle watcher stopped: ${err.message}`);
@@ -141533,10 +141681,10 @@ function startBundleSourceWatcher(state) {
141533
141681
  const pending2 = /* @__PURE__ */ new Set();
141534
141682
  let timer;
141535
141683
  let building = false;
141536
- const flush = async () => {
141684
+ const flush2 = async () => {
141537
141685
  timer = void 0;
141538
141686
  if (building) {
141539
- timer = setTimeout(flush, 120);
141687
+ timer = setTimeout(flush2, 120);
141540
141688
  return;
141541
141689
  }
141542
141690
  const names2 = [...pending2].sort();
@@ -141560,7 +141708,7 @@ function startBundleSourceWatcher(state) {
141560
141708
  if (!name || name.startsWith(".")) return;
141561
141709
  pending2.add(name);
141562
141710
  if (timer) clearTimeout(timer);
141563
- timer = setTimeout(flush, 200);
141711
+ timer = setTimeout(flush2, 200);
141564
141712
  });
141565
141713
  watcher2.on("error", (err) => {
141566
141714
  console.warn(`[himalaya-dev] bundle source watcher stopped: ${err.message}`);
@@ -141790,10 +141938,10 @@ function startAppSourceWatcher(state) {
141790
141938
  const pending2 = /* @__PURE__ */ new Set();
141791
141939
  let timer;
141792
141940
  let reloading = false;
141793
- const flush = async () => {
141941
+ const flush2 = async () => {
141794
141942
  timer = void 0;
141795
141943
  if (reloading) {
141796
- timer = setTimeout(flush, 120);
141944
+ timer = setTimeout(flush2, 120);
141797
141945
  return;
141798
141946
  }
141799
141947
  const paths2 = [...pending2];
@@ -141832,7 +141980,7 @@ function startAppSourceWatcher(state) {
141832
141980
  if (!classifyAppPath(rel2)) return;
141833
141981
  pending2.add(rel2);
141834
141982
  if (timer) clearTimeout(timer);
141835
- timer = setTimeout(flush, 200);
141983
+ timer = setTimeout(flush2, 200);
141836
141984
  });
141837
141985
  watcher2.on("error", (err) => {
141838
141986
  console.warn(`[himalaya-dev] app source watcher stopped: ${err.message}`);
@@ -142104,15 +142252,15 @@ async function handleWebWix(req, res, state) {
142104
142252
  await pipeWebWixStream(upstream2, res, abort.signal, recordStream);
142105
142253
  return;
142106
142254
  }
142107
- const live3 = currentBindingSession(session, state);
142108
- if (!live3.visitorToken && !live3.memberToken) {
142255
+ const live4 = currentBindingSession(session, state);
142256
+ if (!live4.visitorToken && !live4.memberToken) {
142109
142257
  try {
142110
- live3.visitorToken = await mintAppVisitor(state.app, live3);
142258
+ live4.visitorToken = await mintAppVisitor(state.app, live4);
142111
142259
  } catch {
142112
142260
  }
142113
142261
  }
142114
- const isMember = !!live3.memberToken;
142115
- let token = live3.memberToken ?? live3.visitorToken ?? "";
142262
+ const isMember = !!live4.memberToken;
142263
+ let token = live4.memberToken ?? live4.visitorToken ?? "";
142116
142264
  let upstream = await webWixStream(method, target.toString(), body, token, void 0, forwardedHeaders, abort.signal);
142117
142265
  if ((upstream.status === 401 || upstream.status === 403) && !isMember && !abort.signal.aborted) {
142118
142266
  try {
@@ -142120,7 +142268,7 @@ async function handleWebWix(req, res, state) {
142120
142268
  } catch {
142121
142269
  }
142122
142270
  try {
142123
- const again = currentBindingSession(live3, state);
142271
+ const again = currentBindingSession(live4, state);
142124
142272
  token = again.visitorToken = await mintAppVisitor(state.app, again);
142125
142273
  upstream = await webWixStream(method, target.toString(), body, token, void 0, forwardedHeaders, abort.signal);
142126
142274
  } catch {
@@ -142412,19 +142560,19 @@ async function handleWebWix(req, res, state) {
142412
142560
  return reply(status, { error: auth2 ? "webwix_owner_mint_failed" : "webwix_bridge_upstream_failed" });
142413
142561
  }
142414
142562
  }
142415
- const live3 = currentBindingSession(session, state);
142416
- if (!live3.visitorToken && !live3.memberToken) {
142563
+ const live4 = currentBindingSession(session, state);
142564
+ if (!live4.visitorToken && !live4.memberToken) {
142417
142565
  try {
142418
- live3.visitorToken = await mintAppVisitor(state.app, live3);
142566
+ live4.visitorToken = await mintAppVisitor(state.app, live4);
142419
142567
  } catch {
142420
142568
  }
142421
142569
  }
142422
- const token = live3.memberToken ?? live3.visitorToken ?? "";
142570
+ const token = live4.memberToken ?? live4.visitorToken ?? "";
142423
142571
  try {
142424
142572
  let r3 = await webWixCall(method, requestedPath, body, token, void 0, forwardedHeaders);
142425
- if ((r3.status === 401 || r3.status === 403) && !live3.memberToken) {
142573
+ if ((r3.status === 401 || r3.status === 403) && !live4.memberToken) {
142426
142574
  try {
142427
- const again = currentBindingSession(live3, state);
142575
+ const again = currentBindingSession(live4, state);
142428
142576
  again.visitorToken = await mintAppVisitor(state.app, again);
142429
142577
  r3 = await webWixCall(method, requestedPath, body, again.visitorToken, void 0, forwardedHeaders);
142430
142578
  } catch {
@@ -142521,10 +142669,10 @@ async function handleDev(req, res, state) {
142521
142669
  }
142522
142670
  let descriptor = body.descriptor;
142523
142671
  if (!descriptor && body.screenId) {
142524
- const live3 = await liveDescriptorFor(state, body.screenId);
142525
- if ("refusal" in live3) {
142526
- const diagnostics2 = depthRefusalDiagnostics(state, live3.refusal);
142527
- const legacy2 = { screenId: body.screenId, scheme, renderable: false, reason: `depth_budget_exceeded: ${live3.refusal.finding.message}`, diagnostics: diagnostics2 };
142672
+ const live4 = await liveDescriptorFor(state, body.screenId);
142673
+ if ("refusal" in live4) {
142674
+ const diagnostics2 = depthRefusalDiagnostics(state, live4.refusal);
142675
+ const legacy2 = { screenId: body.screenId, scheme, renderable: false, reason: `depth_budget_exceeded: ${live4.refusal.finding.message}`, diagnostics: diagnostics2 };
142528
142676
  const report10 = foldLegacyReport(legacy2, {
142529
142677
  source: "render",
142530
142678
  screenId: body.screenId,
@@ -142535,7 +142683,7 @@ async function handleDev(req, res, state) {
142535
142683
  });
142536
142684
  return sendJson(res, body.envelope === 1 ? 422 : 200, report10);
142537
142685
  }
142538
- descriptor = live3.descriptor;
142686
+ descriptor = live4.descriptor;
142539
142687
  }
142540
142688
  if (!descriptor || typeof descriptor !== "object") {
142541
142689
  return sendJson(res, 404, { error: "screen_not_found", screenId: body.screenId ?? null });
@@ -142585,9 +142733,9 @@ async function handleDev(req, res, state) {
142585
142733
  const diagMatch = /^\/__dev\/screen\/(.+?)\/diagnostics(?:\?|$)/.exec(url);
142586
142734
  if (diagMatch && req.method === "GET") {
142587
142735
  const screenId = decodeURIComponent(diagMatch[1]);
142588
- const live3 = await liveDescriptorFor(state, screenId);
142589
- if ("refusal" in live3) return sendJson(res, 422, depthRefusalDiagnostics(state, live3.refusal));
142590
- const descriptor = live3.descriptor;
142736
+ const live4 = await liveDescriptorFor(state, screenId);
142737
+ if ("refusal" in live4) return sendJson(res, 422, depthRefusalDiagnostics(state, live4.refusal));
142738
+ const descriptor = live4.descriptor;
142591
142739
  if (!descriptor) return sendJson(res, 404, { error: "screen_not_found", screenId });
142592
142740
  const diag = await runScreenDiagnostics(state, screenId, descriptor);
142593
142741
  return sendJson(res, diag.ok ? 200 : 422, diag);
@@ -143029,9 +143177,9 @@ async function handleAdminPlayground(req, res, state) {
143029
143177
  if (validateMatch && req.method === "GET") {
143030
143178
  const screenId = decodeURIComponent(validateMatch[1]);
143031
143179
  const strict = /[?&]strict=1(?:&|$)/.test(url);
143032
- const live3 = await liveDescriptorFor(state, screenId);
143033
- if ("refusal" in live3) return sendJson(res, 422, depthRefusalReport(live3.refusal, strict));
143034
- const descriptor = live3.descriptor;
143180
+ const live4 = await liveDescriptorFor(state, screenId);
143181
+ if ("refusal" in live4) return sendJson(res, 422, depthRefusalReport(live4.refusal, strict));
143182
+ const descriptor = live4.descriptor;
143035
143183
  if (!descriptor) return sendJson(res, 404, { error: "screen_not_found", screenId });
143036
143184
  const { validateScreenDescriptor: validateScreenDescriptor2, loadAllowedComponents: loadAllowedComponents2, readBuiltBundle: readBuiltBundle2, readBuiltBundleMap: readBuiltBundleMap2, appWorkerActionsFor: appWorkerActionsFor2, appWorkerServicesFor: appWorkerServicesFor2, appServicesContextFor: appServicesContextFor2 } = await Promise.resolve().then(() => (init_validate_descriptor(), validate_descriptor_exports));
143037
143185
  const tokens2 = readAppTokens(state) ?? void 0;
@@ -149065,7 +149213,7 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
149065
149213
  } else {
149066
149214
  const counting = countingWixCall(await ensureLiveWixCall());
149067
149215
  const host = collect2.render.host ? countingHostAnswers(collect2.render.host) : void 0;
149068
- const live3 = await liveRenderServices(bundleJs, {
149216
+ const live4 = await liveRenderServices(bundleJs, {
149069
149217
  wixCall: counting.call,
149070
149218
  input,
149071
149219
  budgetMs: collect2.render.loadBudgetMs ?? LIVE_LOAD_BUDGET_MS,
@@ -149073,14 +149221,14 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
149073
149221
  descriptor,
149074
149222
  ...host ? { host: host.host } : {}
149075
149223
  });
149076
- base2 = live3.services;
149077
- liveCalls = [...live3.calls];
149224
+ base2 = live4.services;
149225
+ liveCalls = [...live4.calls];
149078
149226
  liveReturned = counting.returned();
149079
149227
  if (host) liveReturned += host.answered();
149080
149228
  liveFailed = counting.failed();
149081
149229
  liveEmpty = counting.empty();
149082
149230
  liveRefused = counting.refused();
149083
- liveErrors = live3.errors;
149231
+ liveErrors = live4.errors;
149084
149232
  }
149085
149233
  } else if (collect2?.render?.mocks && collect2.render.hydrate !== false && bundleName && readBundle(bundleName)) {
149086
149234
  const calls = [];
@@ -149922,10 +150070,10 @@ async function buildFunctionsOnlyRelease(preloaded, dest) {
149922
150070
  functions: built.map((item2) => item2.record),
149923
150071
  ...config.functions.siteBinding ? { functionSiteBinding: { ...config.functions.siteBinding } } : {},
149924
150072
  ...functionDataResources ? { functionDataResources } : {},
149925
- ...config.functions.schedules?.length ? { functionSchedules: config.functions.schedules.map((schedule) => {
149926
- const target = built.find((item2) => item2.name === schedule.functionName);
149927
- if (!target) throw new Error(`function schedule "${schedule.name}" references unknown function "${schedule.functionName}"`);
149928
- return { ...schedule, bundleHash: target.bundleHash };
150073
+ ...config.functions.schedules?.length ? { functionSchedules: config.functions.schedules.map((schedule2) => {
150074
+ const target = built.find((item2) => item2.name === schedule2.functionName);
150075
+ if (!target) throw new Error(`function schedule "${schedule2.name}" references unknown function "${schedule2.functionName}"`);
150076
+ return { ...schedule2, bundleHash: target.bundleHash };
149929
150077
  }) } : {}
149930
150078
  };
149931
150079
  const sha4 = gitSha();
@@ -156249,9 +156397,9 @@ var init_src8 = __esm({
156249
156397
  });
156250
156398
 
156251
156399
  // ../../node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
156252
- function hasSeq(data, seq2, i2) {
156253
- for (let j2 = 0; j2 < seq2.length; j2++) {
156254
- if (seq2[j2] !== data[i2 + j2 + 1]) return false;
156400
+ function hasSeq(data, seq3, i2) {
156401
+ for (let j2 = 0; j2 < seq3.length; j2++) {
156402
+ if (seq3[j2] !== data[i2 + j2 + 1]) return false;
156255
156403
  }
156256
156404
  return true;
156257
156405
  }
@@ -160156,9 +160304,9 @@ function decodeContentInfo(bytes2) {
160156
160304
  function contentInfos(info4, password) {
160157
160305
  if (!info4) return [];
160158
160306
  if (info4.oid === OID.data) {
160159
- const seq2 = readSequence(info4.payload, 0);
160160
- if (!seq2) return walkSafeBags(info4.payload, password);
160161
- return walkContentInfoList(seq2.contents, password);
160307
+ const seq3 = readSequence(info4.payload, 0);
160308
+ if (!seq3) return walkSafeBags(info4.payload, password);
160309
+ return walkContentInfoList(seq3.contents, password);
160162
160310
  }
160163
160311
  if (info4.oid === OID.encryptedData) {
160164
160312
  const decrypted = decryptEncryptedData(info4.payload, password);
@@ -160170,22 +160318,22 @@ function walkContentInfoList(bytes2, password) {
160170
160318
  const out2 = [];
160171
160319
  let i2 = 0;
160172
160320
  while (i2 < bytes2.length) {
160173
- const seq2 = readSequence(bytes2, i2);
160174
- if (!seq2) break;
160175
- const inner = decodeContentInfo(seq2.contents);
160321
+ const seq3 = readSequence(bytes2, i2);
160322
+ if (!seq3) break;
160323
+ const inner = decodeContentInfo(seq3.contents);
160176
160324
  if (inner?.oid === OID.data) {
160177
160325
  out2.push(...walkSafeBags(inner.payload, password));
160178
160326
  } else if (inner?.oid === OID.encryptedData) {
160179
160327
  const decrypted = decryptEncryptedData(inner.payload, password);
160180
160328
  if (decrypted) out2.push(...walkSafeBags(decrypted, password));
160181
160329
  }
160182
- i2 = seq2.end;
160330
+ i2 = seq3.end;
160183
160331
  }
160184
160332
  return out2;
160185
160333
  }
160186
160334
  function walkSafeBags(bytes2, password) {
160187
- const seq2 = bytes2[0] === 48 ? readSequence(bytes2, 0) : void 0;
160188
- const body = seq2 ? seq2.contents : bytes2;
160335
+ const seq3 = bytes2[0] === 48 ? readSequence(bytes2, 0) : void 0;
160336
+ const body = seq3 ? seq3.contents : bytes2;
160189
160337
  const out2 = [];
160190
160338
  let i2 = 0;
160191
160339
  while (i2 < body.length) {
@@ -160213,8 +160361,8 @@ function decodeSafeBag(bytes2, password) {
160213
160361
  return [];
160214
160362
  }
160215
160363
  function decodeCertBag(bytes2) {
160216
- const seq2 = readSequence(bytes2, 0);
160217
- const body = seq2 ? seq2.contents : bytes2;
160364
+ const seq3 = readSequence(bytes2, 0);
160365
+ const body = seq3 ? seq3.contents : bytes2;
160218
160366
  const oid = readOid(body, 0);
160219
160367
  if (!oid || oid.oid !== OID.x509Certificate) return [];
160220
160368
  const wrapped = readContext(body, oid.end, 0);
@@ -160228,11 +160376,11 @@ function decodeCertBag(bytes2) {
160228
160376
  }
160229
160377
  }
160230
160378
  function decryptEncryptedData(bytes2, password) {
160231
- const seq2 = readSequence(bytes2, 0);
160232
- if (!seq2) return void 0;
160233
- const ver = readInteger(seq2.contents, 0);
160379
+ const seq3 = readSequence(bytes2, 0);
160380
+ if (!seq3) return void 0;
160381
+ const ver = readInteger(seq3.contents, 0);
160234
160382
  if (!ver) return void 0;
160235
- const info4 = readSequence(seq2.contents, ver.end);
160383
+ const info4 = readSequence(seq3.contents, ver.end);
160236
160384
  if (!info4) return void 0;
160237
160385
  const contentType = readOid(info4.contents, 0);
160238
160386
  if (!contentType) return void 0;
@@ -160246,8 +160394,8 @@ function decryptEncryptedData(bytes2, password) {
160246
160394
  return decryptPbe(alg.contents, ciphertext, password);
160247
160395
  }
160248
160396
  function decryptShroudedKey(bytes2, password) {
160249
- const seq2 = readSequence(bytes2, 0);
160250
- const body = seq2 ? seq2.contents : bytes2;
160397
+ const seq3 = readSequence(bytes2, 0);
160398
+ const body = seq3 ? seq3.contents : bytes2;
160251
160399
  const alg = readSequence(body, 0);
160252
160400
  if (!alg) return void 0;
160253
160401
  const oct = readOctetString(body, alg.end);
@@ -164328,7 +164476,7 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
164328
164476
  if (ownership.state !== "owned") return refuse4(io2, "app_ownership_unverified", void 0, 1);
164329
164477
  input.app = ownership.slug;
164330
164478
  const common2 = { target, wixToken, previewTag, fetchImpl: deps.fetchImpl };
164331
- const readStatus = (live3 = false) => pushSetupRequest({ ...common2, operation: "status", query: { app: input.app, site: input.site, ...live3 ? { verify: "live" } : {} } });
164479
+ const readStatus = (live4 = false) => pushSetupRequest({ ...common2, operation: "status", query: { app: input.app, site: input.site, ...live4 ? { verify: "live" } : {} } });
164332
164480
  if (operation === "status") return report(await readStatus(flags.refresh === true), flags, io2, dir);
164333
164481
  const previous = await readStatus();
164334
164482
  if (!previous.ok || !STATES.has(String(previous.body?.state))) return report(previous, flags, io2, dir);
@@ -166546,7 +166694,7 @@ function watchReminder(dir, opts = {}) {
166546
166694
  try {
166547
166695
  if (!existsSync55(join51(dir, "himalaya.content.json"))) return void 0;
166548
166696
  const nowDate = opts.now ?? /* @__PURE__ */ new Date();
166549
- const live3 = liveWatch(dir, opts.isAlive, nowDate);
166697
+ const live4 = liveWatch(dir, opts.isAlive, nowDate);
166550
166698
  const now = nowDate.getTime();
166551
166699
  const file2 = join51(dir, REMINDERS_FILE);
166552
166700
  let last = Number.NaN;
@@ -166558,8 +166706,8 @@ function watchReminder(dir, opts = {}) {
166558
166706
  if (!realDirIn(dir, ".himi")) return void 0;
166559
166707
  writeFileAtomic(file2, `${JSON.stringify({ watch: new Date(now).toISOString() })}
166560
166708
  `);
166561
- if (live3) {
166562
- return `the live preview is running at ${live3.url} (pid ${live3.pid}${live3.by === "init" ? ", started by himi init" : ""}) \u2014 it repaints on every save, and the build board is ${live3.board}; give the owner that link to click around while you work, and do not start another`;
166709
+ if (live4) {
166710
+ return `the live preview is running at ${live4.url} (pid ${live4.pid}${live4.by === "init" ? ", started by himi init" : ""}) \u2014 it repaints on every save, and the build board is ${live4.board}; give the owner that link to click around while you work, and do not start another`;
166563
166711
  }
166564
166712
  const content = opts.content ?? displayPath(dir);
166565
166713
  const remote = readInitSource(dir)?.source === "remote" ? "init did not start it because this template came off the serve plane \u2014 once you have read its code, " : "";
@@ -166606,9 +166754,9 @@ async function startWatchAtInit(dir, opts) {
166606
166754
  const note = given.length ? { note: watchOptOutIgnoredNote(given) } : {};
166607
166755
  const deps = { ...defaultStartWatchDeps, ...opts.deps };
166608
166756
  const now = opts.now ?? /* @__PURE__ */ new Date();
166609
- const live3 = liveWatch(dir, deps.isAlive, now);
166610
- if (live3 && (live3.by === "init" || await deps.previewRunning(dir))) {
166611
- return { skipped: `a live preview of this app is already running (pid ${live3.pid})`, url: live3.url, board: live3.board, pid: live3.pid, ...note };
166757
+ const live4 = liveWatch(dir, deps.isAlive, now);
166758
+ if (live4 && (live4.by === "init" || await deps.previewRunning(dir))) {
166759
+ return { skipped: `a live preview of this app is already running (pid ${live4.pid})`, url: live4.url, board: live4.board, pid: live4.pid, ...note };
166612
166760
  }
166613
166761
  try {
166614
166762
  const port = await deps.freePort(previewPortForDir(dir));
@@ -168634,6 +168782,9 @@ function verticalsFromBook(path2) {
168634
168782
  function recommendTemplates(input) {
168635
168783
  const text22 = input.text ?? "";
168636
168784
  const owner = OWNER_WORDS.test(text22);
168785
+ const role = owner ? "owner" : "customer";
168786
+ const roleOf2 = (name) => /owner/.test(name) ? "owner" : "customer";
168787
+ const context = input.context?.trim() ? input.context : void 0;
168637
168788
  const rows = new Map(input.catalog.map((row2) => [row2.name, rowTokens([row2.name, row2.title ?? "", row2.description ?? "", ...row2.tags ?? [], row2.category ?? ""].join(" "))]));
168638
168789
  const hays = new Map([...rows].map(([name, r3]) => [name, r3.tokens]));
168639
168790
  const known = new Set([...hays.values()].flatMap((h2) => [...h2]));
@@ -168644,6 +168795,7 @@ function recommendTemplates(input) {
168644
168795
  const byName3 = /* @__PURE__ */ new Map();
168645
168796
  const fits = /* @__PURE__ */ new Set();
168646
168797
  const siteFits = /* @__PURE__ */ new Set();
168798
+ const requestFits = /* @__PURE__ */ new Set();
168647
168799
  for (const row2 of input.catalog) {
168648
168800
  const reasons = [];
168649
168801
  let score = 0;
@@ -168654,7 +168806,10 @@ function recommendTemplates(input) {
168654
168806
  if (hit.length) {
168655
168807
  const depth = rows.get(row2.name).depth;
168656
168808
  score += hit.reduce((n2, t2) => n2 + weight(t2) * (t2.startsWith("@") ? depthCredit(depth.get(t2) ?? 0) : 1), 0) / wantWeight;
168657
- if ((hit.some((t2) => t2.startsWith("@")) || hit.length >= 2) && owner === isOwner) fits.add(row2.name);
168809
+ if ((hit.some((t2) => t2.startsWith("@")) || hit.length >= 2) && owner === isOwner) {
168810
+ fits.add(row2.name);
168811
+ requestFits.add(row2.name);
168812
+ }
168658
168813
  reasons.push(`matches ${hit.map((h2) => h2.startsWith("@") ? `${h2.slice(1)} words` : `"${h2}"`).join(", ")}`);
168659
168814
  const more = extras.get(row2.name);
168660
168815
  if (more.length) reasons.push(`also covers ${more.map((t2) => t2.slice(1)).join(", ")}, which the brief did not ask for`);
@@ -168668,7 +168823,21 @@ function recommendTemplates(input) {
168668
168823
  score -= 0.3;
168669
168824
  }
168670
168825
  }
168671
- byName3.set(row2.name, { name: row2.name, score, reasons, ...row2.source ? { source: row2.source } : {} });
168826
+ byName3.set(row2.name, { name: row2.name, score, reasons, ...row2.source ? { source: row2.source } : {}, role: roleOf2(row2.name), fit: "none" });
168827
+ }
168828
+ const contextMatch = /* @__PURE__ */ new Map();
168829
+ if (context !== void 0 && want.size) {
168830
+ const named3 = new Set(tokens(context).filter((t2) => t2.startsWith("@") && known.has(t2)));
168831
+ const added = [...named3].filter((t2) => !asked.has(t2));
168832
+ for (const name of added.length ? requestFits : []) {
168833
+ const hay = hays.get(name);
168834
+ if ([...hay].some((t2) => t2.startsWith("@") && !asked.has(t2) && !named3.has(t2))) continue;
168835
+ const depth = rows.get(name).depth;
168836
+ const hit = added.filter((t2) => hay.has(t2));
168837
+ if (!hit.length) continue;
168838
+ contextMatch.set(name, hit.reduce((n2, t2) => n2 + depthCredit(depth.get(t2) ?? 0), 0));
168839
+ byName3.get(name).reasons.push(`the context also names ${hit.map((t2) => t2.slice(1)).join(", ")} (used only to order equal scores)`);
168840
+ }
168672
168841
  }
168673
168842
  if (input.verticals?.length) {
168674
168843
  for (const c2 of scoreOverlays(input.verticals, "")) {
@@ -168688,8 +168857,12 @@ function recommendTemplates(input) {
168688
168857
  fb.score = Math.max(fb.score + 0.25, best + 0.01);
168689
168858
  fb.reasons.push(owner ? "the default start for owner/operations apps" : "the default start for a customer app on a Wix site");
168690
168859
  }
168691
- const ranked = [...byName3.values()].map((r3) => ({ ...r3, score: Math.round(r3.score * 1e3) / 1e3 })).filter((r3) => r3.score > 0).sort((a2, b2) => b2.score - a2.score || Number(siteFits.has(b2.name)) - Number(siteFits.has(a2.name)) || (extras.get(a2.name)?.length ?? 0) - (extras.get(b2.name)?.length ?? 0) || Number(b2.name === fallback) - Number(a2.name === fallback) || a2.name.localeCompare(b2.name));
168692
- return { owner, ranked };
168860
+ const ranked = [...byName3.values()].map((r3) => ({
168861
+ ...r3,
168862
+ score: Math.round(r3.score * 1e3) / 1e3,
168863
+ fit: requestFits.has(r3.name) ? "request" : siteFits.has(r3.name) && r3.role === role ? "site" : r3.name === fallback ? "default" : "none"
168864
+ })).filter((r3) => r3.score > 0).sort((a2, b2) => b2.score - a2.score || (contextMatch.get(b2.name) ?? 0) - (contextMatch.get(a2.name) ?? 0) || Number(siteFits.has(b2.name)) - Number(siteFits.has(a2.name)) || (extras.get(a2.name)?.length ?? 0) - (extras.get(b2.name)?.length ?? 0) || Number(b2.name === fallback) - Number(a2.name === fallback) || a2.name.localeCompare(b2.name));
168865
+ return { owner, role, defaultTemplate: fb ? fallback : null, ...context !== void 0 ? { contextApplied: true } : {}, ranked };
168693
168866
  }
168694
168867
  var OWNER_WORDS, STOP, CONCEPTS, CONCEPT_OF, tokens, depthCredit, weight, BookRefusal, readJson7, uniq;
168695
168868
  var init_template_recommend = __esm({
@@ -170316,16 +170489,16 @@ function requireStr() {
170316
170489
  return str6;
170317
170490
  }
170318
170491
  function requireSeq() {
170319
- if (hasRequiredSeq) return seq;
170492
+ if (hasRequiredSeq) return seq2;
170320
170493
  hasRequiredSeq = 1;
170321
170494
  const Type22 = requireType();
170322
- seq = new Type22("tag:yaml.org,2002:seq", {
170495
+ seq2 = new Type22("tag:yaml.org,2002:seq", {
170323
170496
  kind: "sequence",
170324
170497
  construct: function(data) {
170325
170498
  return data !== null ? data : [];
170326
170499
  }
170327
170500
  });
170328
- return seq;
170501
+ return seq2;
170329
170502
  }
170330
170503
  function requireMap() {
170331
170504
  if (hasRequiredMap) return map;
@@ -172983,7 +173156,7 @@ function requireJsYaml() {
172983
173156
  jsYaml.safeDump = renamed("safeDump", "dump");
172984
173157
  return jsYaml;
172985
173158
  }
172986
- var jsYaml, loader, common, hasRequiredCommon, exception, hasRequiredException, snippet, hasRequiredSnippet, type, hasRequiredType, schema, hasRequiredSchema, str6, hasRequiredStr, seq, hasRequiredSeq, map, hasRequiredMap, failsafe, hasRequiredFailsafe, _null, hasRequired_null, bool2, hasRequiredBool, int2, hasRequiredInt, float, hasRequiredFloat, json2, hasRequiredJson, core, hasRequiredCore, timestamp, hasRequiredTimestamp, merge, hasRequiredMerge, binary, hasRequiredBinary, omap, hasRequiredOmap, pairs, hasRequiredPairs, set, hasRequiredSet, _default, hasRequired_default, hasRequiredLoader, dumper, hasRequiredDumper, hasRequiredJsYaml, jsYamlExports, yaml, Type2, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load3, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump;
173159
+ var jsYaml, loader, common, hasRequiredCommon, exception, hasRequiredException, snippet, hasRequiredSnippet, type, hasRequiredType, schema, hasRequiredSchema, str6, hasRequiredStr, seq2, hasRequiredSeq, map, hasRequiredMap, failsafe, hasRequiredFailsafe, _null, hasRequired_null, bool2, hasRequiredBool, int2, hasRequiredInt, float, hasRequiredFloat, json2, hasRequiredJson, core, hasRequiredCore, timestamp, hasRequiredTimestamp, merge, hasRequiredMerge, binary, hasRequiredBinary, omap, hasRequiredOmap, pairs, hasRequiredPairs, set, hasRequiredSet, _default, hasRequired_default, hasRequiredLoader, dumper, hasRequiredDumper, hasRequiredJsYaml, jsYamlExports, yaml, Type2, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load3, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump;
172987
173160
  var init_js_yaml = __esm({
172988
173161
  "../../node_modules/js-yaml/dist/js-yaml.mjs"() {
172989
173162
  init_define_HHP_CATALOG();
@@ -174655,12 +174828,12 @@ function genNativeConfig(app2, opts = {}) {
174655
174828
  const embedManaged = hasMarkers(project, "yaml", LABEL_LIVE_EMBED);
174656
174829
  if (targetManaged !== embedManaged) throw new Error(`${app2}: Live Activity target and embedding markers must be installed together`);
174657
174830
  const drainsWidgetActions = hostAppliesDeferredWidgetActions(app2);
174658
- const live3 = targetManaged ? liveActivityPlan(project, ids.includes("live_activity"), drainsWidgetActions) : void 0;
174659
- if (live3?.appGroupId) {
174831
+ const live4 = targetManaged ? liveActivityPlan(project, ids.includes("live_activity"), drainsWidgetActions) : void 0;
174832
+ if (live4?.appGroupId) {
174660
174833
  const key3 = "com.apple.security.application-groups";
174661
174834
  const existing = ios.entitlements[key3];
174662
174835
  const groups = Array.isArray(existing) ? [...existing] : existing === void 0 ? [] : [existing];
174663
- if (!groups.includes(live3.appGroupId)) groups.push(live3.appGroupId);
174836
+ if (!groups.includes(live4.appGroupId)) groups.push(live4.appGroupId);
174664
174837
  ios.entitlements[key3] = groups;
174665
174838
  }
174666
174839
  const files = [
@@ -174776,7 +174949,7 @@ function genNativeConfig(app2, opts = {}) {
174776
174949
  files.push(r3);
174777
174950
  }
174778
174951
  if (targetManaged) {
174779
- const plan = live3;
174952
+ const plan = live4;
174780
174953
  files.push(applyToFile(iosYml, "yaml", LABEL_LIVE_TARGET, (i2) => plan.target.map((line) => i2 + line), check));
174781
174954
  files.push(applyToFile(iosYml, "yaml", LABEL_LIVE_EMBED, (i2) => plan.embed.map((line) => i2 + line), check));
174782
174955
  const source2 = join63(dirname37(iosYml), LIVE_SOURCE_PATH);
@@ -174799,7 +174972,7 @@ function genNativeConfig(app2, opts = {}) {
174799
174972
  }
174800
174973
  if (targetManaged) {
174801
174974
  const manifest3 = join63(dirname37(iosYml), LIVE_PRIVACY_MANIFEST_PATH);
174802
- files.push(live3.source ? applyWholeFile(manifest3, renderPrivacyManifest(privacyPlanFor([])), check) : removeWholeFile(manifest3, check));
174975
+ files.push(live4.source ? applyWholeFile(manifest3, renderPrivacyManifest(privacyPlanFor([])), check) : removeWholeFile(manifest3, check));
174803
174976
  }
174804
174977
  const liveRoot = join63(dirname37(iosYml), dirname37(LIVE_PRIVACY_MANIFEST_PATH));
174805
174978
  for (const yml of [iosYml, macosProjectYml(app2)]) {
@@ -180508,9 +180681,9 @@ function makeFunctionsHandler(options2) {
180508
180681
  const target = resolveTarget3(new URL(request.url).pathname);
180509
180682
  if (!target) return errorResponse(404, "not_found", "function route not found", id);
180510
180683
  if (request.method === "OPTIONS") return new Response(null, { status: 204, headers: { "access-control-allow-origin": "*", "access-control-allow-methods": "GET,POST,PUT,PATCH,DELETE,OPTIONS", "access-control-allow-headers": "authorization,content-type,x-request-id,x-himalaya-release,x-himalaya-preview-token", "x-request-id": id } });
180511
- const live3 = await options2.store.getManifest(target.app);
180684
+ const live4 = await options2.store.getManifest(target.app);
180512
180685
  const pin = new URL(request.url).searchParams.get("release") || request.headers.get("x-himalaya-release");
180513
- let selected = live3;
180686
+ let selected = live4;
180514
180687
  if (pin && !options2.previewTokenSecret) return errorResponse(501, "preview_token_unavailable", "pinned release access requires preview token validation", id);
180515
180688
  let previewClaims;
180516
180689
  if (pin && options2.previewTokenSecret) {
@@ -180854,10 +181027,10 @@ function memoryStore(manifest2, built) {
180854
181027
  async function buildLocalFunctions(app2) {
180855
181028
  const built = await buildFunctions(app2.definitions, app2.sources);
180856
181029
  const bundles = Object.fromEntries(built.map((item2) => [item2.name, { sha256: item2.bundleHash, sri: item2.sri, bytes: item2.bytes.length }]));
180857
- const manifest2 = { releaseId: "local", gitSha: "local", app: app2.app, minBinaryVersion: null, screens: {}, bundles, functions: built.map((item2) => item2.record), ...app2.siteBinding ? { functionSiteBinding: { ...app2.siteBinding } } : {}, ...app2.data ? { functionDataResources: app2.data } : {}, ...app2.schedules?.length ? { functionSchedules: app2.schedules.map((schedule) => {
180858
- const target = built.find((item2) => item2.name === schedule.functionName);
180859
- if (!target) throw new Error(`function schedule "${schedule.name}" references unknown function "${schedule.functionName}"`);
180860
- return { ...schedule, bundleHash: target.bundleHash };
181030
+ const manifest2 = { releaseId: "local", gitSha: "local", app: app2.app, minBinaryVersion: null, screens: {}, bundles, functions: built.map((item2) => item2.record), ...app2.siteBinding ? { functionSiteBinding: { ...app2.siteBinding } } : {}, ...app2.data ? { functionDataResources: app2.data } : {}, ...app2.schedules?.length ? { functionSchedules: app2.schedules.map((schedule2) => {
181031
+ const target = built.find((item2) => item2.name === schedule2.functionName);
181032
+ if (!target) throw new Error(`function schedule "${schedule2.name}" references unknown function "${schedule2.functionName}"`);
181033
+ return { ...schedule2, bundleHash: target.bundleHash };
180861
181034
  }) } : {} };
180862
181035
  const store = memoryStore(manifest2, built);
180863
181036
  return { manifest: manifest2, built, handler: makeFunctionsHandler({ store, sandbox: createLocalTestSandbox(), definitions: app2.definitions, siteBinding: app2.siteBinding }) };
@@ -192642,10 +192815,10 @@ var init_commerce = __esm({
192642
192815
  }
192643
192816
  /** Manual prices, or undefined when the product was never priced (its synthetic schedule's prices 404). */
192644
192817
  async prices(id) {
192645
- const schedule = await optional3(() => this.t.get(`/v2/inAppPurchases/${encodeURIComponent(id)}/iapPriceSchedule`));
192646
- if (!schedule?.data)
192818
+ const schedule2 = await optional3(() => this.t.get(`/v2/inAppPurchases/${encodeURIComponent(id)}/iapPriceSchedule`));
192819
+ if (!schedule2?.data)
192647
192820
  return void 0;
192648
- const doc = await optional3(() => this.t.list(`/v1/inAppPurchasePriceSchedules/${encodeURIComponent(one(schedule, "price schedule").id)}/manualPrices`, { query: { include: "inAppPurchasePricePoint,territory" } }));
192821
+ const doc = await optional3(() => this.t.list(`/v1/inAppPurchasePriceSchedules/${encodeURIComponent(one(schedule2, "price schedule").id)}/manualPrices`, { query: { include: "inAppPurchasePricePoint,territory" } }));
192649
192822
  return doc && manualPrices(doc.data, doc.included ?? [], "inAppPurchasePricePoint");
192650
192823
  }
192651
192824
  /** Sets one base-territory price from `startDate` (default: today, US Pacific) — replaces the schedule. */
@@ -195350,13 +195523,13 @@ var init_actions_release = __esm({
195350
195523
  const item2 = items.find((i2) => i2.id === p2.itemId);
195351
195524
  if (!item2 || item2.state === "REMOVED")
195352
195525
  return noop("reviewSubmissionItems", `item ${p2.itemId} is not in submission ${p2.submissionId}`);
195353
- const live3 = items.filter((i2) => i2.state !== "REMOVED");
195526
+ const live4 = items.filter((i2) => i2.state !== "REMOVED");
195354
195527
  return {
195355
195528
  changes: [{ op: "delete", resource: "reviewSubmissionItems", id: p2.itemId, summary: `remove ${item2.type ?? "item"} ${item2.itemId ?? p2.itemId} (${item2.state}) from ${p2.submissionId} (${submission.state})` }],
195356
195529
  sideEffects: [
195357
195530
  "the item is no longer reviewed with this submission",
195358
195531
  ...item2.type === "appStoreVersions" ? ["it is the submission's app version: what is left is reviewed without it"] : [],
195359
- ...live3.length === 1 ? ["it is the submission's last item"] : []
195532
+ ...live4.length === 1 ? ["it is the submission's last item"] : []
195360
195533
  ],
195361
195534
  facts: { state: submission.state ?? null }
195362
195535
  };
@@ -195390,11 +195563,11 @@ var init_actions_release = __esm({
195390
195563
  const nothing = (p2.resolved === void 0 || p2.resolved === true && item2.state !== "REJECTED") && (p2.removed === void 0 || p2.removed === true && item2.state === "REMOVED" || p2.removed === false && item2.state !== "REMOVED");
195391
195564
  if (nothing)
195392
195565
  return noop("reviewSubmissionItems", `item ${p2.itemId} is ${item2.state}; nothing to change`);
195393
- const live3 = items.filter((i2) => i2.state !== "REMOVED");
195566
+ const live4 = items.filter((i2) => i2.state !== "REMOVED");
195394
195567
  const asked = [...p2.resolved !== void 0 ? [`resolved ${p2.resolved === null ? "cleared" : p2.resolved}`] : [], ...p2.removed !== void 0 ? [`removed ${p2.removed === null ? "cleared" : p2.removed}`] : []];
195395
195568
  return {
195396
195569
  changes: [{ op: "update", resource: "reviewSubmissionItems", id: p2.itemId, summary: `${item2.type ?? "item"} ${item2.itemId ?? p2.itemId} (${item2.state}): ${asked.join(", ")}`, after: { ...p2.resolved !== void 0 ? { resolved: p2.resolved } : {}, ...p2.removed !== void 0 ? { removed: p2.removed } : {} } }],
195397
- sideEffects: p2.removed === true ? ["the item is no longer reviewed with this submission", ...item2.type === "appStoreVersions" ? ["it is the submission's app version: what is left is reviewed without it"] : [], ...live3.length === 1 ? ["it is the submission's last item"] : []] : [],
195570
+ sideEffects: p2.removed === true ? ["the item is no longer reviewed with this submission", ...item2.type === "appStoreVersions" ? ["it is the submission's app version: what is left is reviewed without it"] : [], ...live4.length === 1 ? ["it is the submission's last item"] : []] : [],
195398
195571
  facts: { state: submission.state ?? null, itemState: item2.state }
195399
195572
  };
195400
195573
  },
@@ -196536,9 +196709,9 @@ var init_batch = __esm({
196536
196709
  if (batch.status !== "planned")
196537
196710
  throw new AscError("refused", `batch ${id} is ${batch.status}`);
196538
196711
  const offered = [...batch.approvals, { approver: ctx.actor, planHash: batch.planHash, at: this.now().toISOString() }];
196539
- const live3 = batch.items.filter((i2) => i2.status === "planned");
196540
- const accounts = [...new Set(live3.map((i2) => i2.issuerId))];
196541
- const decisions = await Promise.all([...new Set(live3.map((i2) => i2.action))].map((action) => this.options.gate.evaluate({ jobId: batch.id, action, requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live3.length, offered, summary: `batch ${batch.id}: ${live3.length} line(s) across ${accounts.length} account(s)` })));
196712
+ const live4 = batch.items.filter((i2) => i2.status === "planned");
196713
+ const accounts = [...new Set(live4.map((i2) => i2.issuerId))];
196714
+ const decisions = await Promise.all([...new Set(live4.map((i2) => i2.action))].map((action) => this.options.gate.evaluate({ jobId: batch.id, action, requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live4.length, offered, summary: `batch ${batch.id}: ${live4.length} line(s) across ${accounts.length} account(s)` })));
196542
196715
  batch.approvals = decisions[0]?.approvals ?? offered;
196543
196716
  const denied2 = decisions.find((d2) => d2.status === "denied");
196544
196717
  const pending2 = decisions.find((d2) => d2.status === "pending");
@@ -197791,8 +197964,8 @@ var init_actions_products = __esm({
197791
197964
  const base = await api4.subscriptions.pricePoint(p2.subscriptionId, p2.baseTerritory, p2.basePrice);
197792
197965
  const others = await api4.subscriptions.equalizations(base.id, p2.baseTerritory);
197793
197966
  const hasPrices = await api4.subscriptions.hasPrices(p2.subscriptionId);
197794
- const scheduled = !p2.startDate && hasPrices && LIVE_SUBSCRIPTION_STATES.has(String(subscription.state ?? "").trim().toUpperCase()) ? tomorrow(today(api4)) : void 0;
197795
- const start = p2.startDate ?? scheduled;
197967
+ const scheduled2 = !p2.startDate && hasPrices && LIVE_SUBSCRIPTION_STATES.has(String(subscription.state ?? "").trim().toUpperCase()) ? tomorrow(today(api4)) : void 0;
197968
+ const start = p2.startDate ?? scheduled2;
197796
197969
  const on4 = start ?? today(api4);
197797
197970
  const current = await api4.subscriptions.resolvedPrices(p2.subscriptionId, on4);
197798
197971
  const all = [{ territory: p2.baseTerritory, price: base.customerPrice, pricePointId: base.id }, ...others.map((o2) => ({ territory: o2.territory, price: o2.customerPrice, pricePointId: o2.id }))];
@@ -197801,7 +197974,7 @@ var init_actions_products = __esm({
197801
197974
  return noop6("subscriptionPrices", `all ${all.length} territories are already at the ${p2.basePrice} ${p2.baseTerritory} point on ${on4}`);
197802
197975
  return {
197803
197976
  changes: targets.map((t2) => ({ op: current.has(t2.territory) ? "update" : "create", resource: "subscriptionPrices", summary: `${t2.territory}: ${current.get(t2.territory)?.customerPrice ?? "no price"} \u2192 ${t2.price}${start ? ` from ${start}` : ""}` })),
197804
- sideEffects: [...unsold.length ? [`${unsold.length} of the priced territories are not in the subscription's availability: they get a price, and it stays off sale there (availability is not changed)`] : [], ...scheduled ? [`the subscription is ${subscription.state}: prices change on ${scheduled} (tomorrow, US Pacific)`] : [], ...hasPrices ? [] : [`the subscription has no price yet: ${p2.baseTerritory} is set first, the rest follow`], ...p2.preserveCurrentPrice ? ["current subscribers keep their price"] : []],
197977
+ sideEffects: [...unsold.length ? [`${unsold.length} of the priced territories are not in the subscription's availability: they get a price, and it stays off sale there (availability is not changed)`] : [], ...scheduled2 ? [`the subscription is ${subscription.state}: prices change on ${scheduled2} (tomorrow, US Pacific)`] : [], ...hasPrices ? [] : [`the subscription has no price yet: ${p2.baseTerritory} is set first, the rest follow`], ...p2.preserveCurrentPrice ? ["current subscribers keep their price"] : []],
197805
197978
  facts: { targets, hasPrices, start: start ?? null, on: on4, state: subscription.state ?? null, unsold: unsold.length }
197806
197979
  };
197807
197980
  },
@@ -202259,11 +202432,11 @@ async function runConnectFlow(opts) {
202259
202432
  let refusal2;
202260
202433
  let over = false;
202261
202434
  let path2 = "";
202262
- const live3 = /* @__PURE__ */ new Set();
202435
+ const live4 = /* @__PURE__ */ new Set();
202263
202436
  const begin = (input) => {
202264
202437
  const attempt2 = startAttempt(input);
202265
- live3.add(attempt2);
202266
- void attempt2.settled.then(() => live3.delete(attempt2));
202438
+ live4.add(attempt2);
202439
+ void attempt2.settled.then(() => live4.delete(attempt2));
202267
202440
  if (over)
202268
202441
  attempt2.cancel();
202269
202442
  return attempt2;
@@ -202382,13 +202555,13 @@ async function runConnectFlow(opts) {
202382
202555
  } catch (e2) {
202383
202556
  return fail10(`signed in, but App Store Connect did not list the teams: ${messageOf2(e2)}`);
202384
202557
  }
202385
- const live4 = { ...session, cookies: client4.cookies };
202558
+ const live5 = { ...session, cookies: client4.cookies };
202386
202559
  if (listed.available.length > 1) {
202387
- state = { name: "team", saved: session, live: live4, providers: listed.available, current: listed.current?.providerId };
202560
+ state = { name: "team", saved: session, live: live5, providers: listed.available, current: listed.current?.providerId };
202388
202561
  return show();
202389
202562
  }
202390
202563
  const provider = listed.current ?? listed.available[0] ?? { providerId: session.providerId ?? 0, name: session.providerName ?? "", publicProviderId: session.publicProviderId };
202391
- return connected(session, live4, provider);
202564
+ return connected(session, live5, provider);
202392
202565
  }
202393
202566
  async function onTeamPost(st2, form) {
202394
202567
  const chosen = st2.providers.find((p2) => String(p2.providerId) === form.get("providerId"));
@@ -202396,22 +202569,22 @@ async function runConnectFlow(opts) {
202396
202569
  state = { ...st2, error: { kind: "team", text: "Choose one of the teams." } };
202397
202570
  return show();
202398
202571
  }
202399
- let live4 = st2.live;
202572
+ let live5 = st2.live;
202400
202573
  if (chosen.providerId !== st2.current) {
202401
202574
  try {
202402
- live4 = (await new WebClient2(st2.live, clientOptions).selectProvider({ providerId: chosen.providerId })).session;
202575
+ live5 = (await new WebClient2(st2.live, clientOptions).selectProvider({ providerId: chosen.providerId })).session;
202403
202576
  } catch (e2) {
202404
202577
  state = { ...st2, error: { kind: "team", text: `App Store Connect did not move to that team: ${messageOf2(e2)}` } };
202405
202578
  return show();
202406
202579
  }
202407
202580
  }
202408
- return connected(st2.saved, live4, chosen);
202581
+ return connected(st2.saved, live5, chosen);
202409
202582
  }
202410
- async function connected(saved, live4, provider) {
202411
- let cookies = live4.cookies;
202583
+ async function connected(saved, live5, provider) {
202584
+ let cookies = live5.cookies;
202412
202585
  let teamId;
202413
202586
  try {
202414
- const portal = new AgreementsClient(onTeam(live4, provider), { ...clientOptions, developerBase: base.ascBase, onSessionChange: (s2) => void (cookies = s2.cookies) });
202587
+ const portal = new AgreementsClient(onTeam(live5, provider), { ...clientOptions, developerBase: base.ascBase, onSessionChange: (s2) => void (cookies = s2.cookies) });
202415
202588
  const match = matchDeveloperTeam(provider, await portal.developerTeams(), false);
202416
202589
  if (match.teamId !== null)
202417
202590
  teamId = match.teamId;
@@ -202469,7 +202642,7 @@ async function runConnectFlow(opts) {
202469
202642
  // already running (a key being created) is not stopped, and the page expires once it returns.
202470
202643
  onTtl: () => {
202471
202644
  over = true;
202472
- for (const attempt2 of live3)
202645
+ for (const attempt2 of live4)
202473
202646
  attempt2.cancel();
202474
202647
  },
202475
202648
  handler: async ({ method, path: at2, form }) => {
@@ -202490,9 +202663,9 @@ async function runConnectFlow(opts) {
202490
202663
  path2 = new URL(server.url).pathname;
202491
202664
  const letGo = async () => {
202492
202665
  over = true;
202493
- for (const attempt2 of live3)
202666
+ for (const attempt2 of live4)
202494
202667
  attempt2.cancel();
202495
- await Promise.all([...live3].map((a2) => a2.settled));
202668
+ await Promise.all([...live4].map((a2) => a2.settled));
202496
202669
  };
202497
202670
  let cancelled = false;
202498
202671
  const stopped = new Promise((resolve112) => {
@@ -203291,12 +203464,12 @@ var init_commands = __esm({
203291
203464
  summary: "The version on sale",
203292
203465
  options: { app: { type: "string" }, platform: { type: "string" } },
203293
203466
  async run(inv) {
203294
- const live3 = await (await inv.ctx.api()).versions.live(await appId2(inv), inv.opts.platform ?? "IOS");
203295
- if (!live3) {
203467
+ const live4 = await (await inv.ctx.api()).versions.live(await appId2(inv), inv.opts.platform ?? "IOS");
203468
+ if (!live4) {
203296
203469
  inv.ctx.io.stderr("no version on sale\n");
203297
203470
  return ExitCode.NotFound;
203298
203471
  }
203299
- inv.print(live3);
203472
+ inv.print(live4);
203300
203473
  }
203301
203474
  },
203302
203475
  "testflight groups": {
@@ -205756,9 +205929,9 @@ async function versionsFor(inv) {
205756
205929
  throw new AscError("notFound", `version ${versionId} is not a version of app ${id}`);
205757
205930
  return [v2];
205758
205931
  }
205759
- const live3 = await api4.versions.live(id, platform ?? "IOS");
205932
+ const live4 = await api4.versions.live(id, platform ?? "IOS");
205760
205933
  const inFlight = await api4.versions.inFlight(id, platform ?? "IOS");
205761
- return [inFlight, live3].filter((v2) => !!v2 && (v2 !== live3 || v2.id !== inFlight?.id));
205934
+ return [inFlight, live4].filter((v2) => !!v2 && (v2 !== live4 || v2.id !== inFlight?.id));
205762
205935
  }
205763
205936
  var versionOptions, phasedMove, RELEASE_CONTROL_COMMANDS;
205764
205937
  var init_commands_release_controls = __esm({
@@ -211136,12 +211309,12 @@ async function applyBatchAsking(ctx, a2, call, o2 = {}) {
211136
211309
  ctx.webAppleId = await identityForApply(ctx, batch.id);
211137
211310
  }
211138
211311
  if (batch.status === "planned" && ctx.approver && !ctx.worker) {
211139
- const live3 = batch.items.filter((i2) => i2.status === "planned");
211140
- const accounts = [...new Set(live3.map((i2) => i2.issuerId))];
211141
- const request = { jobId: batch.id, action: [...new Set(live3.map((i2) => i2.action))].join(", "), requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live3.length, offered: batch.approvals, summary: `batch ${batch.id}${batch.ordered ? " (in this order)" : ""}: ${live3.length} line(s) across ${accounts.length} account(s)
211142
- ${batchSummaryLines(live3).join("\n")}${o2.detail ? `
211312
+ const live4 = batch.items.filter((i2) => i2.status === "planned");
211313
+ const accounts = [...new Set(live4.map((i2) => i2.issuerId))];
211314
+ const request = { jobId: batch.id, action: [...new Set(live4.map((i2) => i2.action))].join(", "), requestedBy: batch.actor, planHash: batch.planHash, accounts, appCount: live4.length, offered: batch.approvals, summary: `batch ${batch.id}${batch.ordered ? " (in this order)" : ""}: ${live4.length} line(s) across ${accounts.length} account(s)
211315
+ ${batchSummaryLines(live4).join("\n")}${o2.detail ? `
211143
211316
  ${o2.detail}` : ""}` };
211144
- const levels = [...new Set(live3.map((i2) => i2.action))].map((action) => requiredLevel(ctx.policy(), { ...request, action }));
211317
+ const levels = [...new Set(live4.map((i2) => i2.action))].map((action) => requiredLevel(ctx.policy(), { ...request, action }));
211145
211318
  const level = ["never", "two", "one", "auto"].find((l2) => levels.includes(l2)) ?? "one";
211146
211319
  let decided = batch;
211147
211320
  refuseIfGone(call, `batch ${batch.id}`);
@@ -211720,7 +211893,7 @@ function connectView(r3) {
211720
211893
  function startConnect(host, ctx, createKey) {
211721
211894
  const pageEnd = new AbortController();
211722
211895
  const waiting = /* @__PURE__ */ new Set();
211723
- let live3;
211896
+ let live4;
211724
211897
  let gotPage;
211725
211898
  const page = new Promise((r3) => gotPage = r3);
211726
211899
  const view = (async () => {
@@ -211747,12 +211920,12 @@ function startConnect(host, ctx, createKey) {
211747
211920
  return v2;
211748
211921
  } finally {
211749
211922
  gotPage(void 0);
211750
- if (liveConnects.get(host) === live3)
211923
+ if (liveConnects.get(host) === live4)
211751
211924
  liveConnects.delete(host);
211752
211925
  }
211753
211926
  })();
211754
211927
  const settled = view.then(() => void 0, () => void 0);
211755
- live3 = {
211928
+ live4 = {
211756
211929
  page,
211757
211930
  settled,
211758
211931
  async join(call) {
@@ -211779,13 +211952,13 @@ function startConnect(host, ctx, createKey) {
211779
211952
  }
211780
211953
  }
211781
211954
  };
211782
- liveConnects.set(host, live3);
211783
- return live3;
211955
+ liveConnects.set(host, live4);
211956
+ return live4;
211784
211957
  }
211785
- async function joinConnect(live3, call) {
211958
+ async function joinConnect(live4, call) {
211786
211959
  call.progress("A connect page from an earlier store_connect call is still open; waiting on it instead of starting a second sign-in");
211787
211960
  let reopened = false;
211788
- const reopening = Promise.race([live3.page, live3.settled.then(() => void 0)]).then(async (page) => {
211961
+ const reopening = Promise.race([live4.page, live4.settled.then(() => void 0)]).then(async (page) => {
211789
211962
  if (!page || !page.live || call.signal.aborted)
211790
211963
  return;
211791
211964
  try {
@@ -211796,7 +211969,7 @@ async function joinConnect(live3, call) {
211796
211969
  call.progress("Could not open the connect page again; it is still open in the person's browser");
211797
211970
  }
211798
211971
  });
211799
- const view = await live3.join(call);
211972
+ const view = await live4.join(call);
211800
211973
  await reopening;
211801
211974
  return { ...view, reopened };
211802
211975
  }
@@ -211923,9 +212096,9 @@ A submission can take more than one batch: after store_apply, call store_plan ag
211923
212096
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
211924
212097
  inputSchema: z6.object({ createKey: z6.boolean().optional().describe("Offer to create and save an API key on the page (default true).") }),
211925
212098
  handler: async (a2, ctx, host, call) => {
211926
- const live3 = liveConnects.get(host);
211927
- if (live3)
211928
- return ok2(await joinConnect(live3, call));
212099
+ const live4 = liveConnects.get(host);
212100
+ if (live4)
212101
+ return ok2(await joinConnect(live4, call));
211929
212102
  return ok2(await startConnect(host, ctx, a2.createKey ?? true).join(call));
211930
212103
  }
211931
212104
  },
@@ -216439,9 +216612,9 @@ async function renderCommand(ctx) {
216439
216612
  const scheme = str3(flags.scheme) === "dark" ? "dark" : "light";
216440
216613
  const wantPng = flags.png === true || typeof flags.png === "string";
216441
216614
  const hydrate = flags.static !== true;
216442
- const live3 = flags.live === true;
216615
+ const live4 = flags.live === true;
216443
216616
  const strict = flags.strict === true;
216444
- if (live3 && flags.static === true) {
216617
+ if (live4 && flags.static === true) {
216445
216618
  io2.error(JSON.stringify({ error: "--static and --live are mutually exclusive: --static renders raw bindings, --live renders real Wix data" }));
216446
216619
  return 2;
216447
216620
  }
@@ -216449,8 +216622,8 @@ async function renderCommand(ctx) {
216449
216622
  io2.error(JSON.stringify({ error: `--mocks takes no value (got "${String(flags.mocks)}") \u2014 pass it bare` }));
216450
216623
  return 2;
216451
216624
  }
216452
- if (flags.mocks === true && (live3 || flags.static === true)) {
216453
- io2.error(JSON.stringify({ error: `--mocks and ${live3 ? "--live" : "--static"} are mutually exclusive: --mocks loads the app's recorded data, ${live3 ? "--live real Wix data" : "--static no data at all"}` }));
216625
+ if (flags.mocks === true && (live4 || flags.static === true)) {
216626
+ io2.error(JSON.stringify({ error: `--mocks and ${live4 ? "--live" : "--static"} are mutually exclusive: --mocks loads the app's recorded data, ${live4 ? "--live real Wix data" : "--static no data at all"}` }));
216454
216627
  return 2;
216455
216628
  }
216456
216629
  if (flags.mocks === true && flags["no-mocks"] === true) {
@@ -216537,7 +216710,7 @@ async function renderCommand(ctx) {
216537
216710
  }
216538
216711
  let mocks;
216539
216712
  let mocksNote;
216540
- const mocksByDefault = flags.mocks !== true && flags["no-mocks"] !== true && !live3 && flags.static !== true && injectedState === void 0;
216713
+ const mocksByDefault = flags.mocks !== true && flags["no-mocks"] !== true && !live4 && flags.static !== true && injectedState === void 0;
216541
216714
  if (flags.mocks === true || mocksByDefault) {
216542
216715
  let rules = null;
216543
216716
  let bad3;
@@ -216561,7 +216734,7 @@ async function renderCommand(ctx) {
216561
216734
  ...hasWorkers ? { tier5Dir: bundleOutDir2(dir) } : {},
216562
216735
  // The settled state is always kept (printed only under --dump-state): it is what says whether
216563
216736
  // the picture landed on the screen's content or on its error, loading or empty state.
216564
- collect: { lint: true, strict, render: { screenId, scheme, png: wantPng, hydrate, dumpState: true, ...live3 ? { live: true } : {}, ...injectedState ? { state: injectedState } : {}, ...injectedInput ? { input: injectedInput } : {}, ...renderWidth ? { width: renderWidth } : {}, ...platform ? { platform } : {}, ...frame ? { frame: true } : {}, ...renderSurface ? { surface: renderSurface } : {}, ...flags.rtl === true ? { rtl: true } : {}, ...loadBudgetMs ? { loadBudgetMs } : {}, ...mocks ? { mocks: { rules: mocks.rules, cmsSeed: mocks.cmsSeed, ...mocks.base44Data ? { base44Data: mocks.base44Data } : {} } } : {} } }
216737
+ collect: { lint: true, strict, render: { screenId, scheme, png: wantPng, hydrate, dumpState: true, ...live4 ? { live: true } : {}, ...injectedState ? { state: injectedState } : {}, ...injectedInput ? { input: injectedInput } : {}, ...renderWidth ? { width: renderWidth } : {}, ...platform ? { platform } : {}, ...frame ? { frame: true } : {}, ...renderSurface ? { surface: renderSurface } : {}, ...flags.rtl === true ? { rtl: true } : {}, ...loadBudgetMs ? { loadBudgetMs } : {}, ...mocks ? { mocks: { rules: mocks.rules, cmsSeed: mocks.cmsSeed, ...mocks.base44Data ? { base44Data: mocks.base44Data } : {} } } : {} } }
216565
216738
  });
216566
216739
  const r3 = (outcome.renders ?? [])[0];
216567
216740
  if (!r3) {
@@ -216593,12 +216766,12 @@ async function renderCommand(ctx) {
216593
216766
  screenId,
216594
216767
  scheme,
216595
216768
  renderable: r3.renderable,
216596
- hydrated: live3 ? "live" : hydrate,
216597
- dataSource: renderDataSource({ live: live3, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused, mocked: !!r3.mockCalls }),
216598
- ...live3 && dataSourceHint(renderDataSource({ live: live3, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) ? { dataSourceHint: dataSourceHint(renderDataSource({ live: live3, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) } : {},
216769
+ hydrated: live4 ? "live" : hydrate,
216770
+ dataSource: renderDataSource({ live: live4, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused, mocked: !!r3.mockCalls }),
216771
+ ...live4 && dataSourceHint(renderDataSource({ live: live4, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) ? { dataSourceHint: dataSourceHint(renderDataSource({ live: live4, hydrate, liveCalls: r3.liveCalls, liveReturned: r3.liveReturned, liveEmpty: r3.liveEmpty, liveRefused: r3.liveRefused })) } : {},
216599
216772
  // What --mocks loaded from, how many requests the load made, and the ones no layer held.
216600
216773
  ...r3.mockCalls && mocks ? { mocks: { used: true, from: mocks.from, calls: r3.mockCalls.length, ...r3.mockUnserved?.length ? { unserved: r3.mockUnserved } : {}, ...mocks.ignored ? { ignored: mocks.ignored } : {}, ...mocksByDefault ? { default: true, hint: "the app's recorded data loaded by default; --no-mocks renders the offline initial state, --live the real site" } : {} } } : mocksNote ? { mocks: mocksNote } : mocks ? { mocks: { used: false, reason: r3.mockBootFailed ? "the screen's worker failed to boot against the recorded data, so its initial state was rendered" : "the screen has no worker bundle to load data into", ...mocks.ignored ? { ignored: mocks.ignored } : {} } } : {},
216601
- ...live3 ? renderLiveFields(r3) : {},
216774
+ ...live4 ? renderLiveFields(r3) : {},
216602
216775
  ...injectedState ? { stateInjected: Object.keys(injectedState) } : {},
216603
216776
  ...injectedInput ? { inputInjected: Object.keys(injectedInput) } : {},
216604
216777
  ...flags["dump-state"] === true && r3.serviceState ? { serviceState: r3.serviceState } : {},
@@ -216643,7 +216816,7 @@ async function renderCommand(ctx) {
216643
216816
  if (pngFile && r3.renderable) {
216644
216817
  const { recordShotState: recordShotState2, screenStateOf: screenStateOf2 } = await Promise.resolve().then(() => (init_screen_state(), screen_state_exports));
216645
216818
  const mocked = !!r3.mockCalls;
216646
- landed = screenStateOf2(r3.serviceState, r3.html, { initial: !live3 && !mocked, offline: mocked && (r3.mockUnserved?.length ?? 0) > 0 });
216819
+ landed = screenStateOf2(r3.serviceState, r3.html, { initial: !live4 && !mocked, offline: mocked && (r3.mockUnserved?.length ?? 0) > 0 });
216647
216820
  recordShotState2(dir, screenId, pngFile, landed);
216648
216821
  }
216649
216822
  const autoSkip = process.env.HIMI_AUTO_RENDER === "validate" && landed !== null && (landed.state === "loading" || landed.state === "empty" || landed.state === "error" && landed.offline === true) ? `the picture shows the home screen's ${landed.state} state${landed.initial || landed.offline ? " (an offline preview: the site's data is not loaded offline)" : ""}, so no postcard was journaled from it` : void 0;
@@ -220274,12 +220447,12 @@ function planFromPayload(payload, base, selectors) {
220274
220447
  }
220275
220448
  return { ok: true, plan: { patch, touched, included, rebound } };
220276
220449
  }
220277
- function regressionDiff(base, live3, touched) {
220450
+ function regressionDiff(base, live4, touched) {
220278
220451
  const moves = new Set(touched);
220279
220452
  const rows = [];
220280
- for (const id of /* @__PURE__ */ new Set([...Object.keys(live3.screens ?? {}), ...Object.keys(base.screens ?? {})])) {
220453
+ for (const id of /* @__PURE__ */ new Set([...Object.keys(live4.screens ?? {}), ...Object.keys(base.screens ?? {})])) {
220281
220454
  if (moves.has(`screen:${id}`)) continue;
220282
- const l2 = live3.screens?.[id];
220455
+ const l2 = live4.screens?.[id];
220283
220456
  const b2 = base.screens?.[id];
220284
220457
  if (!b2) {
220285
220458
  rows.push({ item: `screen:${id}`, live: l2?.descriptorHash ?? null, base: null, effect: `${id} DISAPPEARS \u2014 it was added after ${base.releaseId}` });
@@ -220293,13 +220466,13 @@ function regressionDiff(base, live3, touched) {
220293
220466
  rows.push({ item: `screen:${id}`, live: l2.descriptorHash, base: b2.descriptorHash, effect: `${id} reverts to its ${base.releaseId} descriptor` });
220294
220467
  continue;
220295
220468
  }
220296
- if (resolveBundleSha(live3, l2.bundle) !== resolveBundleSha(base, b2.bundle)) {
220297
- rows.push({ item: `screen:${id}`, live: resolveBundleSha(live3, l2.bundle), base: resolveBundleSha(base, b2.bundle), effect: `${id} rebinds to its ${base.releaseId} worker bundle` });
220469
+ if (resolveBundleSha(live4, l2.bundle) !== resolveBundleSha(base, b2.bundle)) {
220470
+ rows.push({ item: `screen:${id}`, live: resolveBundleSha(live4, l2.bundle), base: resolveBundleSha(base, b2.bundle), effect: `${id} rebinds to its ${base.releaseId} worker bundle` });
220298
220471
  }
220299
220472
  }
220300
220473
  const scalar4 = (key3, item2, what) => {
220301
220474
  if (moves.has(item2)) return;
220302
- const l2 = live3[key3] ?? null;
220475
+ const l2 = live4[key3] ?? null;
220303
220476
  const b2 = base[key3] ?? null;
220304
220477
  if (l2 !== b2) rows.push({ item: item2, live: l2, base: b2, effect: `${what} reverts to ${base.releaseId}` });
220305
220478
  };
@@ -220307,8 +220480,8 @@ function regressionDiff(base, live3, touched) {
220307
220480
  scalar4("appConfigHash", "app-config", "app-config");
220308
220481
  scalar4("iconHash", "icon", "the launcher icon");
220309
220482
  scalar4("minBinaryVersion", "minBinaryVersion", "the minimum binary version");
220310
- for (const name of /* @__PURE__ */ new Set([...Object.keys(live3.assets ?? {}), ...Object.keys(base.assets ?? {})])) {
220311
- const l2 = live3.assets?.[name]?.sha256 ?? null;
220483
+ for (const name of /* @__PURE__ */ new Set([...Object.keys(live4.assets ?? {}), ...Object.keys(base.assets ?? {})])) {
220484
+ const l2 = live4.assets?.[name]?.sha256 ?? null;
220312
220485
  const b2 = base.assets?.[name]?.sha256 ?? null;
220313
220486
  if (l2 === b2) continue;
220314
220487
  rows.push({
@@ -220318,16 +220491,16 @@ function regressionDiff(base, live3, touched) {
220318
220491
  effect: b2 === null ? `asset:${name} record DISAPPEARS \u2014 references fall back to the baked copy or render empty` : `asset:${name} reverts to ${base.releaseId}`
220319
220492
  });
220320
220493
  }
220321
- for (const name of /* @__PURE__ */ new Set([...Object.keys(live3.authoringDocs ?? {}), ...Object.keys(base.authoringDocs ?? {})])) {
220322
- const l2 = live3.authoringDocs?.[name]?.sha256 ?? null;
220494
+ for (const name of /* @__PURE__ */ new Set([...Object.keys(live4.authoringDocs ?? {}), ...Object.keys(base.authoringDocs ?? {})])) {
220495
+ const l2 = live4.authoringDocs?.[name]?.sha256 ?? null;
220323
220496
  const b2 = base.authoringDocs?.[name]?.sha256 ?? null;
220324
220497
  if (l2 !== b2) rows.push({ item: `doc:${name}`, live: l2, base: b2, effect: `${name} reverts to ${base.releaseId}` });
220325
220498
  }
220326
220499
  const PROVENANCE = /* @__PURE__ */ new Set(["releaseId", "gitSha", "shellSha", "label", "notes", "publishedAt", "publishedBy", "attestation", "forcedPastErrors", "allowedBinaryGap", "oneAppMigration"]);
220327
220500
  const REPORTED_IN_DETAIL = /* @__PURE__ */ new Set(["app", "screens", "bundles", "tokensHash", "appConfigHash", "iconHash", "minBinaryVersion", "assets", "authoringDocs"]);
220328
- for (const key3 of /* @__PURE__ */ new Set([...Object.keys(live3), ...Object.keys(base)])) {
220501
+ for (const key3 of /* @__PURE__ */ new Set([...Object.keys(live4), ...Object.keys(base)])) {
220329
220502
  if (PROVENANCE.has(key3) || REPORTED_IN_DETAIL.has(key3) || moves.has(key3)) continue;
220330
- const l2 = live3[key3] ?? null;
220503
+ const l2 = live4[key3] ?? null;
220331
220504
  const b2 = base[key3] ?? null;
220332
220505
  const ls2 = JSON.stringify(l2) ?? "null";
220333
220506
  const bs2 = JSON.stringify(b2) ?? "null";
@@ -220433,6 +220606,73 @@ var init_release_patch2 = __esm({
220433
220606
  }
220434
220607
  });
220435
220608
 
220609
+ // src/publish-admission.ts
220610
+ var publish_admission_exports = {};
220611
+ __export(publish_admission_exports, {
220612
+ admitPublishBody: () => admitPublishBody,
220613
+ compressedPublishEligibility: () => compressedPublishEligibility,
220614
+ compressionNote: () => compressionNote,
220615
+ planCompressedUpload: () => planCompressedUpload,
220616
+ publishSizeFields: () => publishSizeFields
220617
+ });
220618
+ function compressedPublishEligibility(token) {
220619
+ if (!token) return "unknown";
220620
+ const parts = token.split(".");
220621
+ if (parts.length !== 2 || !parts[0] || !parts[1]) return "unknown";
220622
+ const claims = decodeControlTokenClaims(token);
220623
+ if (!claims) return "unknown";
220624
+ if (claims.selfServe === true || claims.siteLease !== void 0) return "self_serve";
220625
+ if (claims.selfServe !== void 0) return "unknown";
220626
+ return typeof claims.sub === "string" && typeof claims.role === "string" && typeof claims.exp === "number" ? "eligible" : "unknown";
220627
+ }
220628
+ function admitPublishBody(size, ctx) {
220629
+ if (size.bodyBytes <= MAX_PUBLISH_BODY_BYTES) return { ok: true };
220630
+ if (size.bodyBytes > MAX_DECODED_PUBLISH_BODY_BYTES) return { ok: false, compressedUpload: "decoded_limit_exceeded" };
220631
+ if (ctx.eligibility === "self_serve") return { ok: false, compressedUpload: "self_serve_credential" };
220632
+ if (ctx.eligibility !== "eligible") return { ok: false, compressedUpload: "credential_unverified" };
220633
+ if (!size.gzip || size.wireBytes > MAX_PUBLISH_BODY_BYTES) return { ok: false, compressedUpload: "wire_limit_exceeded" };
220634
+ return { ok: true };
220635
+ }
220636
+ function planCompressedUpload(size, reserveBytes, gzipBytes) {
220637
+ const planningBytes = size.bodyBytes + reserveBytes;
220638
+ const planningWireBytes = planningBytes <= MAX_PUBLISH_BODY_BYTES || planningBytes > MAX_DECODED_PUBLISH_BODY_BYTES ? planningBytes : (size.gzip ? size.wireBytes : gzipBytes()) + reserveBytes;
220639
+ return {
220640
+ planningWireBytes,
220641
+ fitsIfEligible: planningBytes <= MAX_DECODED_PUBLISH_BODY_BYTES && planningWireBytes <= MAX_PUBLISH_BODY_BYTES
220642
+ };
220643
+ }
220644
+ function publishSizeFields(size, compressedUpload) {
220645
+ return {
220646
+ overageBytes: Math.max(0, size.bodyBytes - MAX_PUBLISH_BODY_BYTES),
220647
+ decodedLimit: MAX_DECODED_PUBLISH_BODY_BYTES,
220648
+ decodedOverageBytes: Math.max(0, size.bodyBytes - MAX_DECODED_PUBLISH_BODY_BYTES),
220649
+ // Only when the client would actually compress this body; over the decoded cap it is sent plain.
220650
+ ...size.gzip ? {
220651
+ wireBytes: size.wireBytes,
220652
+ wireLimit: MAX_PUBLISH_BODY_BYTES,
220653
+ wireOverageBytes: Math.max(0, size.wireBytes - MAX_PUBLISH_BODY_BYTES)
220654
+ } : {},
220655
+ compressedUpload
220656
+ };
220657
+ }
220658
+ function compressionNote(size, refusal2) {
220659
+ return COMPRESSION_NOTES[refusal2](size);
220660
+ }
220661
+ var COMPRESSION_NOTES;
220662
+ var init_publish_admission = __esm({
220663
+ "src/publish-admission.ts"() {
220664
+ init_define_HHP_CATALOG();
220665
+ init_owner_claim();
220666
+ init_client();
220667
+ COMPRESSION_NOTES = {
220668
+ decoded_limit_exceeded: () => `The body is over the ${MAX_DECODED_PUBLISH_BODY_BYTES}-byte decoded limit, so no transport can carry it.`,
220669
+ self_serve_credential: (s2) => `A gzip upload (${s2.wireBytes} bytes) is not accepted for a self-serve credential, which keeps the ${MAX_PUBLISH_BODY_BYTES}-byte plain limit.`,
220670
+ credential_unverified: (s2) => `A gzip upload (${s2.wireBytes} bytes) is accepted only for a provisioned, non-self-serve control token, and this credential cannot be read as one, so the ${MAX_PUBLISH_BODY_BYTES}-byte plain limit applies.`,
220671
+ wire_limit_exceeded: (s2) => `Even gzipped, the upload is ${s2.wireBytes} bytes, over the ${MAX_PUBLISH_BODY_BYTES}-byte wire limit.`
220672
+ };
220673
+ }
220674
+ });
220675
+
220436
220676
  // src/publish-size.ts
220437
220677
  var publish_size_exports = {};
220438
220678
  __export(publish_size_exports, {
@@ -220479,10 +220719,10 @@ __export(ring_pins_exports, {
220479
220719
  readRingPins: () => readRingPins,
220480
220720
  ringsPinnedElsewhere: () => ringsPinnedElsewhere
220481
220721
  });
220482
- function ringsPinnedElsewhere(live3, releaseId) {
220483
- if (!live3 || typeof live3 !== "object") return [];
220722
+ function ringsPinnedElsewhere(live4, releaseId) {
220723
+ if (!live4 || typeof live4 !== "object") return [];
220484
220724
  const pins = [];
220485
- for (const [pinned, rings] of Object.entries(live3)) {
220725
+ for (const [pinned, rings] of Object.entries(live4)) {
220486
220726
  if (pinned === releaseId || !Array.isArray(rings)) continue;
220487
220727
  for (const ring of rings) if (typeof ring === "string") pins.push({ ring, releaseId: pinned });
220488
220728
  }
@@ -220496,19 +220736,19 @@ function promoteCommand(o2, ring, force) {
220496
220736
  return `himi promote --app ${shellQuote(o2.app)} --release ${shellQuote(o2.releaseId)} --ring ${shellQuote(ring)}${force ? " --force" : ""} --target ${shellQuote(o2.target)}${control}`;
220497
220737
  }
220498
220738
  async function readRingPins(client4, o2) {
220499
- let live3;
220739
+ let live4;
220500
220740
  let markedForced = false;
220501
220741
  try {
220502
220742
  const r3 = await client4.releases(o2.app);
220503
220743
  if (!r3.ok) return null;
220504
220744
  const ledger = r3.json;
220505
- live3 = ledger?.live;
220745
+ live4 = ledger?.live;
220506
220746
  markedForced = Array.isArray(ledger?.releases) && ledger.releases.some((row2) => row2?.releaseId === o2.releaseId && row2.forcedPastErrors === true);
220507
220747
  } catch {
220508
220748
  return null;
220509
220749
  }
220510
220750
  const force = o2.force === true || markedForced;
220511
- const pins = ringsPinnedElsewhere(live3, o2.releaseId);
220751
+ const pins = ringsPinnedElsewhere(live4, o2.releaseId);
220512
220752
  if (!pins.length) return null;
220513
220753
  const ringPins = pins.map((pin) => ({ ...pin, promote: promoteCommand(o2, pin.ring, force) }));
220514
220754
  const named3 = pins.map((pin) => `ring "${forTerminal(pin.ring)}" is pinned to ${forTerminal(pin.releaseId)}`).join(", ");
@@ -220834,19 +221074,19 @@ function publicRecord(value2) {
220834
221074
  const { archiveBase64: _archiveBase64, ...record3 } = value2;
220835
221075
  return record3;
220836
221076
  }
220837
- function live2(value2, now) {
221077
+ function live3(value2, now) {
220838
221078
  if (!value2 || value2.revokedAt) return null;
220839
221079
  if (value2.expiresAt && Date.parse(value2.expiresAt) <= now.getTime()) return null;
220840
221080
  return value2;
220841
221081
  }
220842
221082
  async function resolvePackageShareMetadata(store, id, now = /* @__PURE__ */ new Date()) {
220843
221083
  if (!PACKAGE_SHARE_ID_PATTERN2.test(id) || !store.getDoc) return null;
220844
- const value2 = live2(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
221084
+ const value2 = live3(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
220845
221085
  return value2 ? publicRecord(value2) : null;
220846
221086
  }
220847
221087
  async function resolvePackageShare(store, id, now = /* @__PURE__ */ new Date()) {
220848
221088
  if (!PACKAGE_SHARE_ID_PATTERN2.test(id) || !store.getDoc) return null;
220849
- const value2 = live2(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
221089
+ const value2 = live3(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
220850
221090
  if (!value2) return null;
220851
221091
  const archive = await decodeArchive(value2, id);
220852
221092
  return archive ? { share: publicRecord(value2), archive } : null;
@@ -221503,8 +221743,8 @@ ${releaseId}`;
221503
221743
  if (/^\/v1\/app-config\/[^/]+$/.test(url.pathname)) return drop2();
221504
221744
  let servable;
221505
221745
  try {
221506
- const live3 = await manifest2(app2);
221507
- const eligible = live3?.releaseId === pin || await isRingRelease(app2, pin);
221746
+ const live4 = await manifest2(app2);
221747
+ const eligible = live4?.releaseId === pin || await isRingRelease(app2, pin);
221508
221748
  const pinned = eligible ? await pinnedManifest(app2, pin) : null;
221509
221749
  servable = pinned !== null;
221510
221750
  const screenId = /^\/v1\/screen\/([^/]+)$/.exec(url.pathname)?.[1];
@@ -222217,7 +222457,7 @@ ${releaseId}`;
222217
222457
  if (!m2) return json6(404, { error: "app_not_found", app: app2 });
222218
222458
  }
222219
222459
  const mm = m2;
222220
- const readDoc = (hash3, live3) => pin ? hash3 ? pinnedBody(app2, hash3, live3) : Promise.resolve(null) : live3();
222460
+ const readDoc = (hash3, live4) => pin ? hash3 ? pinnedBody(app2, hash3, live4) : Promise.resolve(null) : live4();
222221
222461
  const ringPinned = pin !== null && request.headers.get(RELEASE_SOURCE_HEADER) === "ring";
222222
222462
  const cfgBytes = ringPinned ? await store.getAppConfig(app2) : await readDoc(mm.appConfigHash, () => store.getAppConfig(app2));
222223
222463
  if (!cfgBytes) return json6(404, { error: "app_config_not_found", app: app2 });
@@ -222247,9 +222487,9 @@ ${releaseId}`;
222247
222487
  let homeFrom = mm;
222248
222488
  let readHome = readDoc;
222249
222489
  if (ringPinned && homeScreenId && !mm.screens[homeScreenId]) {
222250
- const live3 = await manifest2(app2);
222251
- if (live3?.screens[homeScreenId]) {
222252
- homeFrom = live3;
222490
+ const live4 = await manifest2(app2);
222491
+ if (live4?.screens[homeScreenId]) {
222492
+ homeFrom = live4;
222253
222493
  readHome = (_hash, liveSlot) => liveSlot();
222254
222494
  }
222255
222495
  }
@@ -222972,50 +223212,50 @@ var init_preview_assets_generated = __esm({
222972
223212
  init_define_HHP_CATALOG();
222973
223213
  init_preview_assets_format();
222974
223214
  PREVIEW_ASSET_MANIFEST = [
222975
- { key: "assets/DashboardHost-Dkt8yykH.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2984, sha256: "e826ef5f55e3e6fe6e8b31e1911c6996e1e620c2e0799c317a7f89e918787958" },
222976
- { key: "assets/DevDrawer-Xew7BiFr.js", contentType: "application/javascript; charset=utf-8", offset: 2992, length: 16783, sha256: "692ccd0572a4862f04962ab4b446c4fa1985d8cfd4416cbdb6b0e077ea82f531" },
222977
- { key: "assets/IdiomCompare-D3DTQsPc.js", contentType: "application/javascript; charset=utf-8", offset: 19775, length: 1926, sha256: "5dfd234097857e00b518490a26f22cd763db72cd70703680d0d6cfc8e9d79a99" },
222978
- { key: "assets/LightboxViewer-CJBVb0qZ.js", contentType: "application/javascript; charset=utf-8", offset: 21701, length: 17379, sha256: "9a8dc89a99043771247f7d7ee2bbbf41a8df69c9f2c1408945a08e30944a1f3a" },
222979
- { key: "assets/OfflineReadingBar-8oyoGONb.js", contentType: "application/javascript; charset=utf-8", offset: 39080, length: 1646, sha256: "5f84a3bd39044fed0e8e96d0de5cab85eed3512ef195951bc25f12ee524412bd" },
222980
- { key: "assets/PhonePreviewControl-9KM0QxYm.js", contentType: "application/javascript; charset=utf-8", offset: 40726, length: 37851, sha256: "7d2f3b57ebec72ce4c925fcb3a68adec95c1af02c1e4b3cb4a8c2d8f1b25eb86" },
222981
- { key: "assets/SchemeCompare-Dxkab461.js", contentType: "application/javascript; charset=utf-8", offset: 78577, length: 1858, sha256: "a23c74bd63cc0502387dfaa4ab611e54c997a55cd814a0901b367b74cda7de67" },
222982
- { key: "assets/WixFrogTelemetrySink-DGrETY8d.js", contentType: "application/javascript; charset=utf-8", offset: 80435, length: 3497, sha256: "43409962b43b1aacb4ffb821e1f9f2775e901049b260e414e8c76ea7c8d7d024" },
223215
+ { key: "assets/DashboardHost-BooGgQCo.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2984, sha256: "ba7ea038bd976272ce6ff4364921dba5e36b6ced7b55b55ebcfc935ee39bd773" },
223216
+ { key: "assets/DevDrawer-6UAU_WzF.js", contentType: "application/javascript; charset=utf-8", offset: 2992, length: 16783, sha256: "cb36f567192d42811affdbdded95f82262da92173a991efc9c0517e9b2ef7b61" },
223217
+ { key: "assets/IdiomCompare-d-zPX1kt.js", contentType: "application/javascript; charset=utf-8", offset: 19775, length: 1926, sha256: "2728f375a35ee69a0f5f5c92edb63e6039574062f4acf1a7c547ff3e97e7267f" },
223218
+ { key: "assets/LightboxViewer-_G76cl1r.js", contentType: "application/javascript; charset=utf-8", offset: 21701, length: 17379, sha256: "e297bda0131ae043bcb87b4b84bcbc3cd60a803d804aca4be28feee440ed48c8" },
223219
+ { key: "assets/OfflineReadingBar-ChX8WEgd.js", contentType: "application/javascript; charset=utf-8", offset: 39080, length: 1646, sha256: "602a6b47b27f32851fdfbee528a68ccc432df0bf26931306108297cc2da6f5e9" },
223220
+ { key: "assets/PhonePreviewControl-B8m-5Dsv.js", contentType: "application/javascript; charset=utf-8", offset: 40726, length: 37851, sha256: "e27ee9f2ae02b4e2b1570afd74374f937009c95094bb34a66834d45167e7d77a" },
223221
+ { key: "assets/SchemeCompare-BKO0lmYj.js", contentType: "application/javascript; charset=utf-8", offset: 78577, length: 1858, sha256: "ac196d83b5ba27b261511e0f000909dbe3adb06fa203cbe8129e796bc0328d51" },
223222
+ { key: "assets/WixFrogTelemetrySink-cNk7EaLI.js", contentType: "application/javascript; charset=utf-8", offset: 80435, length: 3497, sha256: "404fa9bcf5b8edd4dda961016cf736d6ed8906f3c0e07a1782f9f5ea1011b844" },
222983
223223
  { key: "assets/calendar-ics-BvfIYWjG.js", contentType: "application/javascript; charset=utf-8", offset: 83932, length: 2192, sha256: "1636167041e9829ceccd3544297b86b8475c38bd2f759c4dbc17c813dc6e9254" },
222984
223224
  { key: "assets/catalog-CAoUWITw.js", contentType: "application/javascript; charset=utf-8", offset: 86124, length: 26046, sha256: "4c270ca3051f77d761aef1297125e02339d48493dd2b84a0cacf0faf41aa8cb3" },
222985
- { key: "assets/catalogFontFaces-DarpOX-8.js", contentType: "application/javascript; charset=utf-8", offset: 112170, length: 1111, sha256: "e2dd72a0beb134687199d4b5728fdbb980a8af81071b31d3cee74c9a653d0603" },
223225
+ { key: "assets/catalogFontFaces-3bif4sZo.js", contentType: "application/javascript; charset=utf-8", offset: 112170, length: 1111, sha256: "265dca01900fa1d47ed52d8226c62cf2468371a013aa19be44b62e83f880a569" },
222986
223226
  { key: "assets/contacts-vcard-BcohPQ0m.js", contentType: "application/javascript; charset=utf-8", offset: 113281, length: 2567, sha256: "c4ff75e96cd909bbb9182c5dc78794fcebc65139fbddef2537711d774fb33ad0" },
222987
- { key: "assets/files-transfer-DSAckwLq.js", contentType: "application/javascript; charset=utf-8", offset: 115848, length: 6446, sha256: "9934ee9b52dda45ddb2f182c76d3cdb75b10f1fff150d94556d12c21bbdfcc6f" },
223227
+ { key: "assets/files-transfer-D1JGe1xf.js", contentType: "application/javascript; charset=utf-8", offset: 115848, length: 6446, sha256: "56a3b912ecd1d9f934cf3ddb3eea51056363569b595493e8a4411f57d1d101e1" },
222988
223228
  { key: "assets/frogActionMap-CTMe3Bz1.js", contentType: "application/javascript; charset=utf-8", offset: 122294, length: 1172, sha256: "9f1ce4c70a680dfb902949e1f482c7e47500b69c3350cd091b1b51d674032d53" },
222989
- { key: "assets/frogApiRules-CG0L8zVF.js", contentType: "application/javascript; charset=utf-8", offset: 123466, length: 2207, sha256: "5138a3316bd0e68303f18a1cc080171359db321492fec3cf23919ac50ca4b26e" },
223229
+ { key: "assets/frogApiRules-BrNkZjBp.js", contentType: "application/javascript; charset=utf-8", offset: 123466, length: 2207, sha256: "2e15a5edda8f13c30108be3e1e8c22e851eab659e899c61c9bd6978288a814f1" },
222990
223230
  { key: "assets/frogScreenMap-S_IRnz20.js", contentType: "application/javascript; charset=utf-8", offset: 125673, length: 1067, sha256: "22b2f71e1b06df8f1e79b890d47fe42e983d37865c2cc9be753e4121764c91e1" },
222991
223231
  { key: "assets/glassPreviewBrowser-DONaOehd.js", contentType: "application/javascript; charset=utf-8", offset: 126740, length: 6578, sha256: "4402c4cddd2a564e7466cdf1e12a0e0277c0400b288e1e5eda1d23e797599d31" },
222992
223232
  { key: "assets/image-preparation-Cj4gldm6.js", contentType: "application/javascript; charset=utf-8", offset: 133318, length: 2704, sha256: "32944ea587c2f3b84389b66b50a850437560238f1c8d33b6275973ee04eee865" },
222993
- { key: "assets/index-DmB0MJKJ.js", contentType: "application/javascript; charset=utf-8", offset: 136022, length: 1565290, sha256: "a7553f2bd9aba01389289b01059bacd1daa8f8c3503f320ccf95a7ce4487ff1f" },
222994
- { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1701312, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
222995
- { key: "assets/pdf-11HKDITS.js", contentType: "application/javascript; charset=utf-8", offset: 1709063, length: 488215, sha256: "0f5533bf4197dc43489701db18378cecdb02db230a0fc2603e764999544513da" },
222996
- { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2197278, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
222997
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2197368, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
222998
- { key: "assets/pdfDocument-iMU9yIaT.js", contentType: "application/javascript; charset=utf-8", offset: 3514402, length: 3470, sha256: "3ff2e5acf741af0d65b9ea75b88477bd74cac31cfeb806c93a4991794afb08c8" },
222999
- { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3517872, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
223000
- { key: "assets/webviewBridgeHost-vl_MZxfG.js", contentType: "application/javascript; charset=utf-8", offset: 3520138, length: 9888, sha256: "2b14eb62daabb9b8fc1b12010b5c7d182f997aebb04bae249c1276464a7fc15e" },
223001
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3530026, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
223002
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3534636, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
223003
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4023220, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
223004
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4114144, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
223005
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4205128, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
223006
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4296108, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
223007
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4386980, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
223008
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4477960, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
223009
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4586596, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
223010
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4695680, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
223011
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4804728, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
223012
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4912428, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
223013
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5000536, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
223014
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 5007354, length: 4924, sha256: "d4354e106e5e5e7184e55323a6fff572f68747b9b25048bfbe4a22bc7af35ac6" },
223015
- { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5012278, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
223016
- { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5023735, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
223017
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5024906, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
223018
- { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5047953, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
223233
+ { key: "assets/index-9o0qdrDh.js", contentType: "application/javascript; charset=utf-8", offset: 136022, length: 1568398, sha256: "a0449f87848b927a52b7207f4e7a62ed7a39392caf4c1c1a5d651b061bd839b1" },
223234
+ { key: "assets/jsx-runtime-CdvZGgm7.js", contentType: "application/javascript; charset=utf-8", offset: 1704420, length: 7751, sha256: "42a78b508d0f309f6a4a6efbb8669015211b3c26574c5b0929884c4d9d20b806" },
223235
+ { key: "assets/pdf-BjM9gBHL.js", contentType: "application/javascript; charset=utf-8", offset: 1712171, length: 488215, sha256: "4a260ef73a6f9f421a9119eac3d67bb9978e67b44c66a870038d189e6c77a0bd" },
223236
+ { key: "assets/pdf.worker.min-BGnVRhRG.js", contentType: "application/javascript; charset=utf-8", offset: 2200386, length: 90, sha256: "521a0e528916d678d7588b2cddf3dadd3bb959a6d62426382f61c77a82017e35" },
223237
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 2200476, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
223238
+ { key: "assets/pdfDocument-D_URrSsW.js", contentType: "application/javascript; charset=utf-8", offset: 3517510, length: 3470, sha256: "1dbbf7bdcad4a0bec0fe28a739aa7adeb5eb2471153c6bbdae5d9ea73c1b0c8c" },
223239
+ { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3520980, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
223240
+ { key: "assets/webviewBridgeHost-C9A4jWR7.js", contentType: "application/javascript; charset=utf-8", offset: 3523246, length: 9888, sha256: "a8707f0e7f8fdc92baa40f496aaf9e882780fb493714b13c5d76399db46548e9" },
223241
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3533134, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
223242
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3537744, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
223243
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 4026328, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
223244
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 4117252, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
223245
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 4208236, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
223246
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 4299216, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
223247
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4390088, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
223248
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4481068, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
223249
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4589704, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
223250
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4698788, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
223251
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4807836, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
223252
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4915536, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
223253
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 5003644, length: 6818, sha256: "835250c3d8004f27c2b67f9b471984351ba6df07b916d97e33b43c691200a18c" },
223254
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 5010462, length: 4924, sha256: "ed8dc94c2f11cdb92b539cb9a780955114073aca7a53c9fbe2b8734e602928f6" },
223255
+ { key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 5015386, length: 11457, sha256: "6cb2b75264fa5fa2b4d28851878a5eab0712900e8b3a6c2370cc661d6d820805" },
223256
+ { key: "kit-tab-bar.css", contentType: "text/css; charset=utf-8", offset: 5026843, length: 1171, sha256: "9e2c3a0faaf05d5471badf167a4d3bdf1c4e6dd65c432eea6d254158bfd99585" },
223257
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 5028014, length: 23047, sha256: "20d1459e3f896f344e478e613d0c979a0de02e81a929a45d3a0ef6a53af36441" },
223258
+ { key: "t5-worker-frame.html", contentType: "text/html; charset=utf-8", offset: 5051061, length: 23064, sha256: "8655cfe9c74212ec5dafecb49d2fdeb48b19f1bd8a710091e3e55631f9b4ab06" }
223019
223259
  ];
223020
223260
  }
223021
223261
  });
@@ -225101,14 +225341,14 @@ var init_iap_api = __esm({
225101
225341
  return points.map((p2) => ({ id: p2.id, customerPrice: attr(p2, "customerPrice") }));
225102
225342
  }
225103
225343
  async readPriceSchedule(resourceId) {
225104
- const schedule = await readOptional(() => this.client.get(`/v2/inAppPurchases/${enc(resourceId)}/iapPriceSchedule?include=baseTerritory`));
225105
- if (!schedule) return void 0;
225106
- const doc = await this.client.get(`/v1/inAppPurchasePriceSchedules/${enc(schedule.id)}/manualPrices?include=inAppPurchasePricePoint,territory&${PAGE3}`);
225107
- if (doc.links?.next) throw new AscError2("truncated", `price schedule ${schedule.id} has more manual prices than one page`);
225344
+ const schedule2 = await readOptional(() => this.client.get(`/v2/inAppPurchases/${enc(resourceId)}/iapPriceSchedule?include=baseTerritory`));
225345
+ if (!schedule2) return void 0;
225346
+ const doc = await this.client.get(`/v1/inAppPurchasePriceSchedules/${enc(schedule2.id)}/manualPrices?include=inAppPurchasePricePoint,territory&${PAGE3}`);
225347
+ if (doc.links?.next) throw new AscError2("truncated", `price schedule ${schedule2.id} has more manual prices than one page`);
225108
225348
  const prices = Array.isArray(doc.data) ? doc.data : [];
225109
225349
  return {
225110
- id: schedule.id,
225111
- baseTerritory: relatedId(schedule, "baseTerritory"),
225350
+ id: schedule2.id,
225351
+ baseTerritory: relatedId(schedule2, "baseTerritory"),
225112
225352
  manualPrices: prices.map((p2) => toManualPrice(p2, doc.included ?? []))
225113
225353
  };
225114
225354
  }
@@ -225493,10 +225733,10 @@ function createCatalogIapApi(client4, appId3) {
225493
225733
  },
225494
225734
  listPricePoints: points,
225495
225735
  readPriceSchedule: async (id) => {
225496
- const schedule = (await client4.getPriceSchedule(appId3, id)).priceSchedule;
225497
- if (!schedule) return void 0;
225498
- const territories = new Map(await Promise.all([...new Set((schedule.manualPrices ?? []).map((p2) => p2.territory))].map(async (territory2) => [territory2, await points(id, territory2)])));
225499
- return { id: schedule.id, baseTerritory: schedule.baseTerritory ?? "", manualPrices: (schedule.manualPrices ?? []).map((p2) => {
225736
+ const schedule2 = (await client4.getPriceSchedule(appId3, id)).priceSchedule;
225737
+ if (!schedule2) return void 0;
225738
+ const territories = new Map(await Promise.all([...new Set((schedule2.manualPrices ?? []).map((p2) => p2.territory))].map(async (territory2) => [territory2, await points(id, territory2)])));
225739
+ return { id: schedule2.id, baseTerritory: schedule2.baseTerritory ?? "", manualPrices: (schedule2.manualPrices ?? []).map((p2) => {
225500
225740
  const point = territories.get(p2.territory)?.find((point2) => point2.id === p2.pricePointId);
225501
225741
  if (!point) throw new Error(`Catalog price point ${p2.pricePointId} could not be read`);
225502
225742
  return { territory: p2.territory, customerPrice: point.customerPrice, startDate: p2.startDate ?? null, endDate: p2.endDate ?? null };
@@ -225982,11 +226222,11 @@ var init_iap_result = __esm({
225982
226222
  });
225983
226223
 
225984
226224
  // ../store-release/iap-price-status.ts
225985
- function livePriceIssue(live3, item2) {
225986
- if (!live3) return "item missing from the Wix catalog";
225987
- if (live3.hidden || live3.kind !== "digital") return "Wix item is hidden or no longer a supported digital item";
225988
- if (!live3.price || !/^\d+(\.\d+)?$/.test(live3.price.amount) || compareAmounts(live3.price.amount, "0") <= 0) return "Wix item is free or has no valid paid price";
225989
- if (live3.price.currency !== item2.price.currency) return `Wix currency ${live3.price.currency} differs from ${item2.price.currency}`;
226225
+ function livePriceIssue(live4, item2) {
226226
+ if (!live4) return "item missing from the Wix catalog";
226227
+ if (live4.hidden || live4.kind !== "digital") return "Wix item is hidden or no longer a supported digital item";
226228
+ if (!live4.price || !/^\d+(\.\d+)?$/.test(live4.price.amount) || compareAmounts(live4.price.amount, "0") <= 0) return "Wix item is free or has no valid paid price";
226229
+ if (live4.price.currency !== item2.price.currency) return `Wix currency ${live4.price.currency} differs from ${item2.price.currency}`;
225990
226230
  return void 0;
225991
226231
  }
225992
226232
  async function checkStatusPrice(item2, observed, pricing, catalog4) {
@@ -225994,10 +226234,10 @@ async function checkStatusPrice(item2, observed, pricing, catalog4) {
225994
226234
  let price = item2.price;
225995
226235
  if (catalog4 !== void 0) {
225996
226236
  if (!item2.wix) return { priceSource, priceCheckIssue: "live Wix price checks do not reprice shared consumable tiers" };
225997
- const live3 = catalog4.find((c2) => c2.source === item2.wix.entityType && c2.id === item2.wix.entityId);
225998
- const issue3 = livePriceIssue(live3, item2);
226237
+ const live4 = catalog4.find((c2) => c2.source === item2.wix.entityType && c2.id === item2.wix.entityId);
226238
+ const issue3 = livePriceIssue(live4, item2);
225999
226239
  if (issue3) return { priceSource, priceCheckIssue: issue3 };
226000
- price = { ...price, amount: live3.price.amount };
226240
+ price = { ...price, amount: live4.price.amount };
226001
226241
  }
226002
226242
  if (!observed?.price || observed.price.customerPrices.length !== 1) return { priceSource, priceCheckIssue: "Apple has no unambiguous current base-territory price" };
226003
226243
  if (observed.price.baseTerritory !== price.baseTerritory) return { priceSource, priceCheckIssue: "Apple and the manifest use different base territories" };
@@ -226197,13 +226437,13 @@ function inEffect(price, today2) {
226197
226437
  return (!price.startDate || price.startDate <= today2) && (!price.endDate || price.endDate > today2);
226198
226438
  }
226199
226439
  async function readObservedPrice(api4, resourceId, today2 = isoDay(/* @__PURE__ */ new Date())) {
226200
- const schedule = await api4.readPriceSchedule(resourceId);
226201
- return priceInEffect(schedule, today2);
226440
+ const schedule2 = await api4.readPriceSchedule(resourceId);
226441
+ return priceInEffect(schedule2, today2);
226202
226442
  }
226203
- function priceInEffect(schedule, today2) {
226204
- const basePrices = schedule?.manualPrices.filter((p2) => p2.territory === schedule.baseTerritory && inEffect(p2, today2)) ?? [];
226205
- if (!schedule || !basePrices.length) return void 0;
226206
- return { baseTerritory: schedule.baseTerritory, customerPrices: basePrices.map((p2) => p2.customerPrice) };
226443
+ function priceInEffect(schedule2, today2) {
226444
+ const basePrices = schedule2?.manualPrices.filter((p2) => p2.territory === schedule2.baseTerritory && inEffect(p2, today2)) ?? [];
226445
+ if (!schedule2 || !basePrices.length) return void 0;
226446
+ return { baseTerritory: schedule2.baseTerritory, customerPrices: basePrices.map((p2) => p2.customerPrice) };
226207
226447
  }
226208
226448
  async function readObservedAvailability(api4, resourceId) {
226209
226449
  const availability = await api4.readAvailability(resourceId);
@@ -226345,16 +226585,16 @@ function localizationOps(item2, observed) {
226345
226585
  return found.name === wanted.name && found.description === wanted.description ? [] : [{ kind: "updateLocalization", locale: wanted.locale }];
226346
226586
  });
226347
226587
  }
226348
- function priceScheduleConflict(schedule, today2) {
226349
- if (!schedule) return "the price schedule could not be read";
226350
- const pending2 = schedule.manualPrices.filter((p2) => !p2.endDate || p2.endDate > today2);
226588
+ function priceScheduleConflict(schedule2, today2) {
226589
+ if (!schedule2) return "the price schedule could not be read";
226590
+ const pending2 = schedule2.manualPrices.filter((p2) => !p2.endDate || p2.endDate > today2);
226351
226591
  if (pending2.some((p2) => p2.startDate && p2.startDate > today2 || p2.endDate)) return "future or temporary price changes must be resolved in App Store Connect";
226352
- if (pending2.some((p2) => p2.territory !== schedule.baseTerritory)) return "custom territory prices must be resolved in App Store Connect";
226592
+ if (pending2.some((p2) => p2.territory !== schedule2.baseTerritory)) return "custom territory prices must be resolved in App Store Connect";
226353
226593
  if (pending2.length !== 1) return "the current base-territory price is ambiguous";
226354
226594
  return void 0;
226355
226595
  }
226356
- function priceScheduleDigest(schedule) {
226357
- return sha256Digest(schedule ? { ...schedule, manualPrices: [...schedule.manualPrices].sort((a2, b2) => JSON.stringify(a2).localeCompare(JSON.stringify(b2))) } : null);
226596
+ function priceScheduleDigest(schedule2) {
226597
+ return sha256Digest(schedule2 ? { ...schedule2, manualPrices: [...schedule2.manualPrices].sort((a2, b2) => JSON.stringify(a2).localeCompare(JSON.stringify(b2))) } : null);
226358
226598
  }
226359
226599
  async function priceOps(pricing, item2, observed, target, today2) {
226360
226600
  if (observed.price) {
@@ -226555,32 +226795,32 @@ function assertSameAccount(planned2, current) {
226555
226795
  `the plan was made with profile "${planned2.profile}" (team ${planned2.team}, key ${planned2.fingerprint}) but this run resolved profile "${current.profile}" (team ${current.team}, key ${current.fingerprint}). Make a new plan with the account you mean.`
226556
226796
  );
226557
226797
  }
226558
- function driftOf(planned2, live3, today2) {
226798
+ function driftOf(planned2, live4, today2) {
226559
226799
  if (planned2.decision === "conflict") return void 0;
226560
- if (live3.decision === "conflict") return `${live3.productId} now conflicts: ${live3.conflicts.join("; ")}`;
226800
+ if (live4.decision === "conflict") return `${live4.productId} now conflicts: ${live4.conflicts.join("; ")}`;
226561
226801
  const priceChange = planned2.ops.find((op) => op.kind === "changePrice");
226562
226802
  if (priceChange) {
226563
- if (planned2.targetPrice !== live3.targetPrice) return `${live3.productId} now resolves to another Apple price point`;
226564
- if (planned2.observed?.state !== live3.observed?.state || JSON.stringify(planned2.observed?.versions) !== JSON.stringify(live3.observed?.versions)) return `${live3.productId} changed review state`;
226565
- if (live3.ops.some((op) => op.kind === "changePrice") && priceScheduleDigest(planned2.observed?.priceSchedule) !== priceScheduleDigest(live3.observed?.priceSchedule)) return `${live3.productId} changed its price schedule`;
226566
- const scheduleProblem = priceScheduleConflict(live3.observed?.priceSchedule, today2);
226567
- if (scheduleProblem) return `${live3.productId}: ${scheduleProblem}`;
226568
- }
226569
- const [plannedShot, liveShot] = [planned2.reviewScreenshot, live3.reviewScreenshot];
226570
- if (plannedShot && liveShot && plannedShot.checksum !== liveShot.checksum) return `${live3.productId}: ${liveShot.fileName} changed since the plan was made`;
226571
- if (replacesUnplannedScreenshot(planned2, live3)) return `${live3.productId}: a review screenshot was added in App Store Connect after the plan \u2014 make a new plan before replacing it`;
226572
- const unplanned = live3.ops.filter((op) => !planned2.ops.some((p2) => sameOp(p2, op)));
226573
- return unplanned.length ? `${live3.productId} now needs ${unplanned.map(describeOp).join(", ")}, which the plan did not list` : void 0;
226574
- }
226575
- function replacesUnplannedScreenshot(planned2, live3) {
226576
- if (!live3.ops.some((op) => op.kind === "replaceReviewScreenshot")) return false;
226577
- const held = live3.observed?.reviewScreenshot;
226803
+ if (planned2.targetPrice !== live4.targetPrice) return `${live4.productId} now resolves to another Apple price point`;
226804
+ if (planned2.observed?.state !== live4.observed?.state || JSON.stringify(planned2.observed?.versions) !== JSON.stringify(live4.observed?.versions)) return `${live4.productId} changed review state`;
226805
+ if (live4.ops.some((op) => op.kind === "changePrice") && priceScheduleDigest(planned2.observed?.priceSchedule) !== priceScheduleDigest(live4.observed?.priceSchedule)) return `${live4.productId} changed its price schedule`;
226806
+ const scheduleProblem = priceScheduleConflict(live4.observed?.priceSchedule, today2);
226807
+ if (scheduleProblem) return `${live4.productId}: ${scheduleProblem}`;
226808
+ }
226809
+ const [plannedShot, liveShot] = [planned2.reviewScreenshot, live4.reviewScreenshot];
226810
+ if (plannedShot && liveShot && plannedShot.checksum !== liveShot.checksum) return `${live4.productId}: ${liveShot.fileName} changed since the plan was made`;
226811
+ if (replacesUnplannedScreenshot(planned2, live4)) return `${live4.productId}: a review screenshot was added in App Store Connect after the plan \u2014 make a new plan before replacing it`;
226812
+ const unplanned = live4.ops.filter((op) => !planned2.ops.some((p2) => sameOp(p2, op)));
226813
+ return unplanned.length ? `${live4.productId} now needs ${unplanned.map(describeOp).join(", ")}, which the plan did not list` : void 0;
226814
+ }
226815
+ function replacesUnplannedScreenshot(planned2, live4) {
226816
+ if (!live4.ops.some((op) => op.kind === "replaceReviewScreenshot")) return false;
226817
+ const held = live4.observed?.reviewScreenshot;
226578
226818
  if (!held || isScreenshotLeftover(held)) return false;
226579
226819
  const seen = planned2.observed?.reviewScreenshot;
226580
226820
  return !seen || seen.id !== held.id || isScreenshotLeftover(seen);
226581
226821
  }
226582
- function assertNoDrift(plan, live3, today2) {
226583
- const drift = [...live3].map(([i2, current]) => driftOf(plan.items[i2], current, today2)).filter((d2) => d2 !== void 0);
226822
+ function assertNoDrift(plan, live4, today2) {
226823
+ const drift = [...live4].map(([i2, current]) => driftOf(plan.items[i2], current, today2)).filter((d2) => d2 !== void 0);
226584
226824
  if (!drift.length) return;
226585
226825
  throw new IapProvisionError("drift", `App Store Connect changed since the plan was made \u2014 nothing was written:
226586
226826
  - ${drift.join("\n - ")}
@@ -226743,12 +226983,12 @@ function operationRunners(context, manifest2) {
226743
226983
  const { point, failure: failure3 } = await pricing.resolve(resourceId, price);
226744
226984
  if (!point || point.customerPrice !== op.to) throw new UnresolvedWriteError(failure3 ?? "Apple's target price changed after preflight \u2014 make a new plan");
226745
226985
  const matches2 = async () => {
226746
- const schedule = await api4.readPriceSchedule(resourceId);
226986
+ const schedule2 = await api4.readPriceSchedule(resourceId);
226747
226987
  const today2 = context.now().toISOString().slice(0, 10);
226748
- const problem = priceScheduleConflict(schedule, today2);
226988
+ const problem = priceScheduleConflict(schedule2, today2);
226749
226989
  if (problem) throw new UnresolvedWriteError(problem);
226750
- if (priceMatches(priceInEffect(schedule, today2), price, op.to)) return true;
226751
- if (priceScheduleDigest(schedule) !== priceScheduleDigest(run3.priceSchedule)) throw new UnresolvedWriteError("Apple's price schedule changed after preflight \u2014 make a new plan");
226990
+ if (priceMatches(priceInEffect(schedule2, today2), price, op.to)) return true;
226991
+ if (priceScheduleDigest(schedule2) !== priceScheduleDigest(run3.priceSchedule)) throw new UnresolvedWriteError("Apple's price schedule changed after preflight \u2014 make a new plan");
226752
226992
  return void 0;
226753
226993
  };
226754
226994
  if (await matches2()) return { state: "reconciled" };
@@ -226847,11 +227087,11 @@ async function knownUnmetFor(item2, planned2, context) {
226847
227087
  const metadata2 = metadataDiffs(item2, planned2.observed, planned2.targetPrice ?? await context.pricing.targetAmount(item2.price));
226848
227088
  return [...metadata2, ...context.api.managed ? [] : screenshotUnmet(planned2.reviewScreenshot, planned2.observed)];
226849
227089
  }
226850
- async function applyItem(item2, live3, context, manifest2) {
227090
+ async function applyItem(item2, live4, context, manifest2) {
226851
227091
  const base = { target: manifest2.target, item: item2, readAt: context.now() };
226852
- if (live3.decision === "conflict") {
226853
- const unmet2 = await knownUnmetFor(item2, live3, context);
226854
- return itemResult({ ...base, observed: live3.observed, outcome: "conflict", conflicts: live3.conflicts, unmet: unmet2 });
227092
+ if (live4.decision === "conflict") {
227093
+ const unmet2 = await knownUnmetFor(item2, live4, context);
227094
+ return itemResult({ ...base, observed: live4.observed, outcome: "conflict", conflicts: live4.conflicts, unmet: unmet2 });
226855
227095
  }
226856
227096
  if (context.api.managed) {
226857
227097
  try {
@@ -226860,30 +227100,30 @@ async function applyItem(item2, live3, context, manifest2) {
226860
227100
  const code3 = error instanceof IapCatalogError ? error.code : "catalog_request_failed";
226861
227101
  const conflict = ["sku_in_use", "mapping_conflict", "mapping_inactive", "mapping_type_mismatch", "mapping_unsupported"].includes(code3);
226862
227102
  const detail = error instanceof Error ? error.message : String(error);
226863
- const result2 = itemResult({ ...base, observed: live3.observed, outcome: conflict ? "conflict" : "failed", ...conflict ? { conflicts: [detail] } : { unmet: [detail] } });
227103
+ const result2 = itemResult({ ...base, observed: live4.observed, outcome: conflict ? "conflict" : "failed", ...conflict ? { conflicts: [detail] } : { unmet: [detail] } });
226864
227104
  result2.provisioning.code = code3;
226865
227105
  return result2;
226866
227106
  }
226867
227107
  }
226868
227108
  const run3 = {
226869
227109
  item: item2,
226870
- resourceId: live3.observed?.resourceId,
226871
- versionId: live3.observed?.draftVersionId,
226872
- localizations: live3.observed?.draftVersionId ? live3.observed.localizations : [],
226873
- priceSchedule: live3.observed?.priceSchedule
227110
+ resourceId: live4.observed?.resourceId,
227111
+ versionId: live4.observed?.draftVersionId,
227112
+ localizations: live4.observed?.draftVersionId ? live4.observed.localizations : [],
227113
+ priceSchedule: live4.observed?.priceSchedule
226874
227114
  };
226875
- const steps = await runOps(run3, live3.ops, context, manifest2);
227115
+ const steps = await runOps(run3, live4.ops, context, manifest2);
226876
227116
  const { observed, failure: failure3 } = await readBack2(run3, context, manifest2);
226877
- const unmet = failure3 ? [`could not read the product back: ${failure3}`] : [...await unmetFor(item2, observed, context), ...context.api.managed ? [] : screenshotUnmet(live3.reviewScreenshot, observed)];
226878
- const outcome = outcomeOf(live3.ops, steps, unmet);
227117
+ const unmet = failure3 ? [`could not read the product back: ${failure3}`] : [...await unmetFor(item2, observed, context), ...context.api.managed ? [] : screenshotUnmet(live4.reviewScreenshot, observed)];
227118
+ const outcome = outcomeOf(live4.ops, steps, unmet);
226879
227119
  const result = itemResult({ ...base, readAt: context.now(), observed, outcome, steps, unmet, appleResourceId: run3.resourceId });
226880
227120
  const code2 = steps.find((step) => step.code)?.code;
226881
227121
  if (code2) result.provisioning.code = code2;
226882
227122
  return result;
226883
227123
  }
226884
- function deferredResult(item2, live3, context, manifest2) {
226885
- const steps = live3.ops.map((op) => stepFor(op, "notRun"));
226886
- return itemResult({ target: manifest2.target, item: item2, observed: live3.observed, outcome: "deferred", steps, requirements: [DEFERRED_REQUIREMENT], readAt: context.now() });
227124
+ function deferredResult(item2, live4, context, manifest2) {
227125
+ const steps = live4.ops.map((op) => stepFor(op, "notRun"));
227126
+ return itemResult({ target: manifest2.target, item: item2, observed: live4.observed, outcome: "deferred", steps, requirements: [DEFERRED_REQUIREMENT], readAt: context.now() });
226887
227127
  }
226888
227128
  function needsRefresh(planned2) {
226889
227129
  return planned2.decision !== "conflict" && planned2.ops.length > 0;
@@ -226902,12 +227142,12 @@ async function applyIap(planDoc, applyContext) {
226902
227142
  const context = { ...applyContext, ...manifestDir ? { manifestDir } : {}, pricing: applyContext.pricing ?? new PriceGrid(applyContext.api) };
226903
227143
  const manifest2 = plan.manifest;
226904
227144
  const refresh = plan.items.flatMap((planned2, i2) => (context.api.managed ? planned2.decision !== "conflict" : needsRefresh(planned2)) ? [i2] : []);
226905
- const live3 = await planItemsAt(context, manifest2, refresh);
226906
- assertNoDrift(plan, live3, context.now().toISOString().slice(0, 10));
227145
+ const live4 = await planItemsAt(context, manifest2, refresh);
227146
+ assertNoDrift(plan, live4, context.now().toISOString().slice(0, 10));
226907
227147
  const items = [];
226908
227148
  let created = 0;
226909
227149
  for (const [i2, item2] of manifest2.items.entries()) {
226910
- const itemPlan2 = live3.get(i2);
227150
+ const itemPlan2 = live4.get(i2);
226911
227151
  if (!itemPlan2) {
226912
227152
  items.push(await plannedResult(item2, plan.items[i2], plan, context, manifest2));
226913
227153
  continue;
@@ -227275,10 +227515,10 @@ function refreshMergedPrices(items, catalog4, options2) {
227275
227515
  return items.flatMap((existing) => {
227276
227516
  if (!existing.wix || existing.price.rule !== "atLeast") return [];
227277
227517
  const { entityType, entityId } = existing.wix;
227278
- const live3 = byEntity.get(entityKey(entityType, entityId));
227279
- const reason = live3 ? skipReason(live3, { ...options2, baseTerritory: existing.price.baseTerritory, currency: existing.price.currency, applePrices: existing.price.baseTerritory === options2.baseTerritory ? options2.applePrices : void 0 }) : "missing from the Wix catalog";
227280
- if (reason) return [{ source: entityType, id: entityId, name: live3?.name ?? existing.referenceName, reason: `${reason} \u2014 existing mapping and price retained` }];
227281
- existing.price.amount = normalizeAmount(live3.price.amount);
227518
+ const live4 = byEntity.get(entityKey(entityType, entityId));
227519
+ const reason = live4 ? skipReason(live4, { ...options2, baseTerritory: existing.price.baseTerritory, currency: existing.price.currency, applePrices: existing.price.baseTerritory === options2.baseTerritory ? options2.applePrices : void 0 }) : "missing from the Wix catalog";
227520
+ if (reason) return [{ source: entityType, id: entityId, name: live4?.name ?? existing.referenceName, reason: `${reason} \u2014 existing mapping and price retained` }];
227521
+ existing.price.amount = normalizeAmount(live4.price.amount);
227282
227522
  return [];
227283
227523
  });
227284
227524
  }
@@ -229912,9 +230152,9 @@ function analyzeStoreIdentity(projectYml, storeConfig, xcconfig, adopted) {
229912
230152
  f2.push({ level: "error", message: `Store build would ship the developer identity: bundle id "${shipped}" ends in .dev. ${remedy}` });
229913
230153
  }
229914
230154
  }
229915
- const live3 = projectYml.split("\n").filter((l2) => !/^\s*#/.test(l2)).join("\n");
230155
+ const live4 = projectYml.split("\n").filter((l2) => !/^\s*#/.test(l2)).join("\n");
229916
230156
  const replaced = /* @__PURE__ */ new Set();
229917
- for (const m2 of live3.matchAll(/\b(applinks|webcredentials):([^\s"'#]+)/g)) {
230157
+ for (const m2 of live4.matchAll(/\b(applinks|webcredentials):([^\s"'#]+)/g)) {
229918
230158
  const [, service, written] = m2;
229919
230159
  if (service === "applinks" && adopted?.associatedDomainHosts.length) continue;
229920
230160
  const swapped = service === "applinks" && !!configured.associatedDomain && /^(?:localhost\b|\$\([A-Z0-9_]+\))/.test(written);
@@ -229934,7 +230174,7 @@ function analyzeStoreIdentity(projectYml, storeConfig, xcconfig, adopted) {
229934
230174
  }
229935
230175
  for (const name of replaced) {
229936
230176
  const ref = `$(${name})`;
229937
- const elsewhere = live3.split("\n").some((l2) => l2.includes(ref) && !/\b(?:applinks|webcredentials):/.test(l2));
230177
+ const elsewhere = live4.split("\n").some((l2) => l2.includes(ref) && !/\b(?:applinks|webcredentials):/.test(l2));
229938
230178
  const value2 = expandVars(ref, xcconfig);
229939
230179
  if (elsewhere && isLoopback2(value2)) {
229940
230180
  f2.push({
@@ -234005,12 +234245,12 @@ function keepRemotePermissions(desired, remote, spec) {
234005
234245
  const remoteProps = propsOf2(remote);
234006
234246
  const desiredProps = propsOf2(desired);
234007
234247
  for (const f2 of spec.fields ?? []) {
234008
- const live3 = remoteProps[f2.key];
234009
- if (!live3 || f2.rls === void 0) continue;
234010
- if (canonical7(f2.rls) === canonical7(live3.rls ?? {})) continue;
234011
- drift.push({ kind: "permissions", detail: `field "${f2.key}": declared rls ${canonical7(f2.rls)} differs from the live ${canonical7(live3.rls ?? {})} \u2014 the live rules are kept` });
234012
- if (live3.rls === void 0) delete desiredProps[f2.key].rls;
234013
- else desiredProps[f2.key].rls = live3.rls;
234248
+ const live4 = remoteProps[f2.key];
234249
+ if (!live4 || f2.rls === void 0) continue;
234250
+ if (canonical7(f2.rls) === canonical7(live4.rls ?? {})) continue;
234251
+ drift.push({ kind: "permissions", detail: `field "${f2.key}": declared rls ${canonical7(f2.rls)} differs from the live ${canonical7(live4.rls ?? {})} \u2014 the live rules are kept` });
234252
+ if (live4.rls === void 0) delete desiredProps[f2.key].rls;
234253
+ else desiredProps[f2.key].rls = live4.rls;
234014
234254
  }
234015
234255
  return drift;
234016
234256
  }
@@ -234031,9 +234271,9 @@ function planEntitySync(declared, snapshot4, opts) {
234031
234271
  const specs = declared.filter((s2) => !!s2 && typeof s2 === "object");
234032
234272
  const owned = new Map(specs.filter(isOwnedEntity).map((s2) => [physicalEntityName(s2, app2), s2]));
234033
234273
  const adopted = new Set(specs.filter(isAdoptedEntity).map((s2) => physicalEntityName(s2, app2)));
234034
- const live3 = new Map(snapshot4.map((e2) => [e2.name, e2]));
234274
+ const live4 = new Map(snapshot4.map((e2) => [e2.name, e2]));
234035
234275
  const provisioned = new Set((opts.provisioned ?? []).filter((n2) => isOwnedPhysical(n2, app2)));
234036
- const ownedHere = /* @__PURE__ */ new Set([...snapshot4.map((e2) => e2.name).filter((n2) => provisioned.has(n2)), ...[...owned.keys()].filter((n2) => !live3.has(n2))]);
234276
+ const ownedHere = /* @__PURE__ */ new Set([...snapshot4.map((e2) => e2.name).filter((n2) => provisioned.has(n2)), ...[...owned.keys()].filter((n2) => !live4.has(n2))]);
234037
234277
  plan.owned = [...ownedHere].sort();
234038
234278
  for (const e2 of snapshot4) {
234039
234279
  if (!ownedHere.has(e2.name)) {
@@ -234092,12 +234332,12 @@ function planEntitySync(declared, snapshot4, opts) {
234092
234332
  plan.actions.push({ name: e2.name, ownership: "owned", action: changed ? "update" : "unchanged", ...drift.length ? { drift } : {} });
234093
234333
  }
234094
234334
  for (const [name, spec] of owned) {
234095
- if (live3.has(name)) continue;
234335
+ if (live4.has(name)) continue;
234096
234336
  plan.next[name] = toBase44Schema(spec, app2);
234097
234337
  plan.actions.push({ name, ownership: "owned", action: "create" });
234098
234338
  }
234099
234339
  for (const name of adopted) {
234100
- if (!live3.has(name)) plan.warnings.push(`adopted entity "${name}" is not on the live app \u2014 himi never creates an entity it does not own`);
234340
+ if (!live4.has(name)) plan.warnings.push(`adopted entity "${name}" is not on the live app \u2014 himi never creates an entity it does not own`);
234101
234341
  }
234102
234342
  plan.refusals.push(...foreignGuard(snapshot4, plan.next, ownedHere));
234103
234343
  return plan;
@@ -234235,12 +234475,12 @@ async function createBase44Entities(opts) {
234235
234475
  const owned = new Set(second.owned);
234236
234476
  const ledgerNames = Object.keys(second.next).filter((n2) => owned.has(n2));
234237
234477
  const maybeApplied = async () => {
234238
- let live3 = /* @__PURE__ */ new Set();
234478
+ let live4 = /* @__PURE__ */ new Set();
234239
234479
  try {
234240
- live3 = new Set((await readEntitySnapshot(appId3, { download: opts.download })).entities.map((e2) => e2.name));
234480
+ live4 = new Set((await readEntitySnapshot(appId3, { download: opts.download })).entities.map((e2) => e2.name));
234241
234481
  } catch {
234242
234482
  }
234243
- return [.../* @__PURE__ */ new Set([...provisioned, ...ledgerNames.filter((n2) => provisioned.includes(n2) || live3.has(n2))])];
234483
+ return [.../* @__PURE__ */ new Set([...provisioned, ...ledgerNames.filter((n2) => provisioned.includes(n2) || live4.has(n2))])];
234244
234484
  };
234245
234485
  let res;
234246
234486
  try {
@@ -238580,16 +238820,16 @@ function canonical8(v2) {
238580
238820
  }
238581
238821
  return JSON.stringify(v2) ?? "undefined";
238582
238822
  }
238583
- function liveItemType(live3, key3) {
238584
- const props2 = live3.schema?.properties;
238823
+ function liveItemType(live4, key3) {
238824
+ const props2 = live4.schema?.properties;
238585
238825
  const items = props2?.[key3]?.items;
238586
238826
  const t2 = items && typeof items === "object" ? items.type : void 0;
238587
238827
  return typeof t2 === "string" ? t2 : void 0;
238588
238828
  }
238589
- function diffEntityFields(spec, live3) {
238590
- const entity = live3.name;
238829
+ function diffEntityFields(spec, live4) {
238830
+ const entity = live4.name;
238591
238831
  const out2 = [];
238592
- const liveFields = new Map(live3.fields.filter((f2) => !BUILTINS3.has(f2.name)).map((f2) => [f2.name, f2]));
238832
+ const liveFields = new Map(live4.fields.filter((f2) => !BUILTINS3.has(f2.name)).map((f2) => [f2.name, f2]));
238593
238833
  for (const f2 of spec.fields ?? []) {
238594
238834
  const remote = liveFields.get(f2.key);
238595
238835
  const declared = typeLabel(f2.type, f2.format);
@@ -238600,7 +238840,7 @@ function diffEntityFields(spec, live3) {
238600
238840
  if (actual !== declared) out2.push({ entity, kind: "type-mismatch", detail: `field "${f2.key}" is declared ${declared} but the live entity has ${actual}` });
238601
238841
  else if (f2.type === "array") {
238602
238842
  const declaredItems = f2.items?.type;
238603
- const liveItems = liveItemType(live3, f2.key);
238843
+ const liveItems = liveItemType(live4, f2.key);
238604
238844
  if (declaredItems !== liveItems) {
238605
238845
  out2.push({ entity, kind: "type-mismatch", detail: `field "${f2.key}" is declared array of ${declaredItems ?? "unspecified"} but the live entity has array of ${liveItems ?? "unspecified"}` });
238606
238846
  }
@@ -238612,8 +238852,8 @@ function diffEntityFields(spec, live3) {
238612
238852
  if (!DECLARABLE_TYPES.has(f2.type)) continue;
238613
238853
  out2.push({ entity, kind: "extra-field", detail: `field "${key3}" (${typeLabel(f2.type, f2.format)}) exists on the live entity but is not declared` });
238614
238854
  }
238615
- if (spec.rls !== void 0 && canonical8(spec.rls) !== canonical8(live3.rls ?? {})) {
238616
- out2.push({ entity, kind: "rls-mismatch", detail: `declared rls ${canonical8(spec.rls)} differs from the live rls ${canonical8(live3.rls ?? {})} \u2014 informational; nothing is changed` });
238855
+ if (spec.rls !== void 0 && canonical8(spec.rls) !== canonical8(live4.rls ?? {})) {
238856
+ out2.push({ entity, kind: "rls-mismatch", detail: `declared rls ${canonical8(spec.rls)} differs from the live rls ${canonical8(live4.rls ?? {})} \u2014 informational; nothing is changed` });
238617
238857
  }
238618
238858
  return out2;
238619
238859
  }
@@ -238646,15 +238886,15 @@ async function countRows(ports, appId3, entity, cap = ROW_COUNT_CAP) {
238646
238886
  async function queryBase44Entities(opts) {
238647
238887
  const { app: app2, appId: appId3, ports } = opts;
238648
238888
  const cap = opts.cap ?? ROW_COUNT_CAP;
238649
- let live3;
238889
+ let live4;
238650
238890
  let sourceError;
238651
238891
  try {
238652
- live3 = await readLiveSchemas(ports, appId3);
238892
+ live4 = await readLiveSchemas(ports, appId3);
238653
238893
  } catch (e2) {
238654
238894
  sourceError = e2.message;
238655
238895
  }
238656
- if (live3 && live3.size === 0) {
238657
- live3 = void 0;
238896
+ if (live4 && live4.size === 0) {
238897
+ live4 = void 0;
238658
238898
  sourceError = "the downloaded project files contain no entity schemas \u2014 drift not checked";
238659
238899
  }
238660
238900
  const specs = (opts.base44.entities ?? []).filter((s2) => !!s2 && typeof s2 === "object" && !!physicalEntityName(s2, app2));
@@ -238668,8 +238908,8 @@ async function queryBase44Entities(opts) {
238668
238908
  rows: null,
238669
238909
  drift: []
238670
238910
  };
238671
- const remote = live3?.get(physical);
238672
- if (live3 && !remote) {
238911
+ const remote = live4?.get(physical);
238912
+ if (live4 && !remote) {
238673
238913
  row2.drift.push({ entity: physical, kind: "missing", detail: `entity "${physical}" is declared but the live app does not have it` });
238674
238914
  } else {
238675
238915
  if (remote) row2.drift = diffEntityFields(spec, remote);
@@ -238684,7 +238924,7 @@ async function queryBase44Entities(opts) {
238684
238924
  declared.push(row2);
238685
238925
  }
238686
238926
  const known = new Set(declared.map((d2) => d2.physical));
238687
- const foreignNames = live3 ? [...live3.keys()].filter((n2) => !known.has(n2)).sort() : [];
238927
+ const foreignNames = live4 ? [...live4.keys()].filter((n2) => !known.has(n2)).sort() : [];
238688
238928
  return {
238689
238929
  ok: true,
238690
238930
  app: app2,
@@ -238692,7 +238932,7 @@ async function queryBase44Entities(opts) {
238692
238932
  prefix: base44Prefix(app2),
238693
238933
  declared,
238694
238934
  foreign: opts.all ? foreignNames : { count: foreignNames.length },
238695
- sourceRead: live3 ? "ok" : "unavailable",
238935
+ sourceRead: live4 ? "ok" : "unavailable",
238696
238936
  ...sourceError ? { sourceError } : {}
238697
238937
  };
238698
238938
  }
@@ -246777,13 +247017,13 @@ async function snapshotAndPublish(fetchImpl, token, msid, opts = {}) {
246777
247017
  timeoutMs: 45e3,
246778
247018
  body: { label: "WIX_CLI", useUniqueLabel: true }
246779
247019
  });
246780
- const live3 = production ? await veloCall(fetchImpl, "POST", SITE_PUBLISH_URL, { token, msid, timeoutMs: 45e3, body: {} }) : void 0;
247020
+ const live4 = production ? await veloCall(fetchImpl, "POST", SITE_PUBLISH_URL, { token, msid, timeoutMs: 45e3, body: {} }) : void 0;
246781
247021
  return {
246782
247022
  revision: revisionFrom(rev.json),
246783
247023
  codeAppId: codeAppIdFromRevision(rev.json),
246784
247024
  rev,
246785
247025
  rc,
246786
- live: live3
247026
+ live: live4
246787
247027
  };
246788
247028
  }
246789
247029
  function httpOk(r3) {
@@ -248281,6 +248521,7 @@ var init_push_errors = __esm({
248281
248521
  "push_failed",
248282
248522
  "binary_capability_gap",
248283
248523
  "depth_budget_exceeded",
248524
+ "compressed_publish_unsupported",
248284
248525
  "one_app_readiness_failed",
248285
248526
  "placeholder_site_binding",
248286
248527
  "auth_provider_invalid"
@@ -249468,7 +249709,7 @@ async function publishSizeCommand(ctx) {
249468
249709
  const { appId: appId3, contentDir: contentDir2, loadAuthoring: loadAuthoring2, resolutionFlag: resolutionFlag2, commandScratchDir: commandScratchDir2 } = await Promise.resolve().then(() => (init_cli_shared(), cli_shared_exports));
249469
249710
  const { collectAppSource: collectAppSource2, secretFindings: secretFindings2, zipAppSource: zipAppSource2, MAX_APP_SOURCE_BYTES: MAX_APP_SOURCE_BYTES2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
249470
249711
  const { composeReleasePayload: composeReleasePayload2, loadReleaseFromDir: loadReleaseFromDir2 } = await Promise.resolve().then(() => (init_release(), release_exports));
249471
- const { publishReleaseBodyBytes: publishReleaseBodyBytes2, MAX_PUBLISH_BODY_BYTES: MAX_PUBLISH_BODY_BYTES2 } = await Promise.resolve().then(() => (init_client(), client_exports));
249712
+ const { measurePublishBody: measurePublishBody2, publishReleaseBody: publishReleaseBody2, publishReleaseBodyBytes: publishReleaseBodyBytes2, MAX_PUBLISH_BODY_BYTES: MAX_PUBLISH_BODY_BYTES2, MAX_DECODED_PUBLISH_BODY_BYTES: MAX_DECODED_PUBLISH_BODY_BYTES2 } = await Promise.resolve().then(() => (init_client(), client_exports));
249472
249713
  if (reserveBytes > MAX_PUBLISH_BODY_BYTES2) return fail10("invalid_usage", "--reserve-bytes exceeds the entire publish budget", {}, 2);
249473
249714
  const { installContainedDevModuleRealm: installContainedDevModuleRealm2 } = await Promise.resolve().then(() => (init_contained_dev_module(), contained_dev_module_exports));
249474
249715
  const { installContainedAppConfigRealm: installContainedAppConfigRealm2 } = await Promise.resolve().then(() => (init_app_config_loader(), app_config_loader_exports));
@@ -249516,9 +249757,15 @@ async function publishSizeCommand(ctx) {
249516
249757
  const archive = zipAppSource2(collected.entries);
249517
249758
  const encoded3 = archive.toString("base64");
249518
249759
  const payload = await loadReleaseFromDir2(declared, out2);
249519
- const bodyBytes = publishReleaseBodyBytes2(composeReleasePayload2(payload, app2, encoded3), void 0, true);
249760
+ const releaseBody = composeReleasePayload2(payload, app2, encoded3);
249761
+ const { bodyBytes, wireBytes, gzip } = measurePublishBody2(releaseBody, void 0, true);
249520
249762
  const minimumBodyBytes = publishReleaseBodyBytes2(composeReleasePayload2(payload, "", encoded3), void 0, true);
249521
249763
  const planningBytes = bodyBytes + reserveBytes;
249764
+ const { planCompressedUpload: planCompressedUpload2 } = await Promise.resolve().then(() => (init_publish_admission(), publish_admission_exports));
249765
+ const { gzipSync: gzipSync3 } = await import("node:zlib");
249766
+ const plan = planCompressedUpload2({ bodyBytes, wireBytes, gzip }, reserveBytes, () => {
249767
+ return gzipSync3(Buffer.from(JSON.stringify(publishReleaseBody2(releaseBody, void 0, true)), "utf8")).byteLength;
249768
+ });
249522
249769
  const report9 = {
249523
249770
  app: app2,
249524
249771
  declared,
@@ -249534,6 +249781,21 @@ async function publishSizeCommand(ctx) {
249534
249781
  planningBytes,
249535
249782
  planningOverageBytes: Math.max(0, planningBytes - MAX_PUBLISH_BODY_BYTES2),
249536
249783
  withinMeasuredBudget: planningBytes <= MAX_PUBLISH_BODY_BYTES2 && encoded3.length <= MAX_APP_SOURCE_BYTES2,
249784
+ // What a compressed upload would cost, for planning ONLY. Whether push may send one depends
249785
+ // on the publisher credential, which this command never reads: it does not establish
249786
+ // eligibility, and the verdict above (`withinMeasuredBudget`, the exit code) stays on the
249787
+ // plain limit. A body under the plain limit goes out plain, so `wireBytes` equals `bodyBytes`
249788
+ // there; `planningWireBytes` is explained at `planCompressedUpload`.
249789
+ compressedUpload: {
249790
+ transport: gzip ? "gzip" : "plain",
249791
+ wireBytes,
249792
+ wireLimit: MAX_PUBLISH_BODY_BYTES2,
249793
+ decodedLimit: MAX_DECODED_PUBLISH_BODY_BYTES2,
249794
+ planningWireBytes: plan.planningWireBytes,
249795
+ fitsIfEligible: plan.fitsIfEligible && encoded3.length <= MAX_APP_SOURCE_BYTES2,
249796
+ eligibility: "not_evaluated",
249797
+ note: "Provisional and credential-free. A gzip upload is admitted only for a provisioned, non-self-serve control token that himi push can read; self-serve tokens and opaque proxy credentials (including the One App migration worker's draft broker) keep the plain limit. Final push remeasures the complete envelope."
249798
+ },
249537
249799
  source: { archivedBytes: archive.length, encodedBytes: encoded3.length, limit: MAX_APP_SOURCE_BYTES2, files: collected.entries.length, skipped: collected.skipped },
249538
249800
  screens: Object.keys(payload.screens).length,
249539
249801
  bundles: Object.keys(payload.bundles).length,
@@ -249810,9 +250072,12 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
249810
250072
  identifiers) across dev/index.ts, config.ts, tokens.json and tier5-src; syntax-checks
249811
250073
  every changed file (and re-parses a generated SCREENS map) before writing, and
249812
250074
  reports placeholdersLeft
249813
- himi template recommend [--text <description>] [--verticals a,b] [--book <site analyze dir>] [--remote]
250075
+ himi template recommend [--text <requested app> [--context <business context>]] [--verticals a,b] [--book <site analyze dir>] [--remote]
249814
250076
  rank the catalog for one business: description words + owner-vs-customer, and the
249815
- site's installed verticals (the same scoring site analyze uses)
250077
+ site's installed verticals (the same scoring site analyze uses). --context is the
250078
+ site's business analysis: supporting evidence that only reorders rows --text already
250079
+ fits, never the role. Each ranked row says its role and fit: request | site |
250080
+ default | none; the envelope says role, defaultTemplate and contextApplied
249816
250081
  himi build [--content <dir>] [--binary] compile Tier-5 workers with esbuild
249817
250082
  himi publish-size [--content <dir>] [--app <slug>] [--reserve-bytes <n>] [--binary|--source]
249818
250083
  build locally and measure draft publish JSON with source;
@@ -250063,6 +250328,12 @@ var USAGE = `himi \u2014 the Himalaya authoring CLI (remote dev loop)
250063
250328
  the LARGEST entries by name \u2014 move those out, or push with
250064
250329
  --no-source (which costs you himi pull for that release).
250065
250330
  Not the same limit as the whole publish body.
250331
+ The WHOLE body is capped at 8388608 bytes of JSON. Over
250332
+ that, a provisioned (not self-serve) control token sends
250333
+ it gzipped: up to 33554432 bytes decoded and 8388608 on
250334
+ the wire. A self-serve login or an opaque credential
250335
+ keeps the plain cap. A refusal names bodyBytes, wireBytes, both limits
250336
+ and compressedUpload (why gzip did not apply).
250066
250337
  himi push --only <selector>[,<selector>\u2026] (--draft|--live) [--from-release <id>]
250067
250338
  [--accept-regressions] [--accept-partial] [--app <slug>]
250068
250339
  publish ONLY the named items, derived from the app's live
@@ -250639,7 +250910,7 @@ var COMMANDS = [
250639
250910
  { name: "init", summary: "scaffold a starter content package (OTA-only; no native shells). --template <t> starts from a full reference app (branded-lite = consumer storefront over a Wix site; owner-lite = owner CRUD/management) instead of the minimal counter; --templates lists bundled ones; --remote fetches the template off the serve plane (falls back to the bundled copy offline). The new app also gets its agent files (the same set `himi agent-init` writes: AGENTS.md, CLAUDE.md, the himalaya skill, HIMALAYA.md, a SessionStart hook) so the next session started inside it picks the work up; --no-agent skips them. It also makes the build board (.himi/studio/, exactly as `himi studio --no-open` does \u2014 it never opens a browser), so every later render, test, validate, push and progress entry refreshes it; and, for a template bundled with this CLI, it makes the FIRST PICTURE itself (never for a --remote one: that is its publisher's code, and a render runs it on this machine, so next[] leaves the render to the agent after it has read the code): exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline \u2014 no request; never --live; --mocks loads the app's recorded data when it has any), run as a child it kills after a time budget, writing .himi/shots/<home>.png and journaling it (by: himi) as the STARTING POINT (\"Starting point: the <template> template, before any of your changes\") so the board and the journal hold a picture when init returns. init also records the source it wrote (.himi/init-source.json: a content fingerprint, Markdown left out), and the first home PNG render after the source diverges from it is journaled once as \"First look at your app\" \u2014 reported as `firstLook: {image}` or `{skipped: <reason>}`, never a failed init; `--no-first-look` skips it (for scripts and CI that render themselves). For a bundled template (never a --remote one \u2014 the preview would build and serve its publisher's code) init also STARTS the live preview itself: `himi run --watch --content <dir> --port <p> --no-open --idle-exit 30`, detached in its own process group with its output in .himi/watch.log, never waited for (the url is chosen before it builds), recorded in .himi/watch.json, and reported as `watch: {started, pid, url, board, log}` \u2014 or `{skipped: <reason>}` for a `CI` environment, a test runner, a watch already running, or a start that failed (never a failed init). Nothing else skips it: outside CI it is started, and `watch.note` says an opt-out was ignored. The envelope LEADS with `doNow`: three lines to run now (the consent preflight, the live preview \u2014 its url and board when init started it, else `himi run --watch --content <dir> &` with the board's path \u2014 and the postcard line), and ENDS with the same lines as `doNowAgain`, so an agent that reads only the head or only the tail (`| tail`) gets them; at a terminal they are also printed as plain text on stderr, before the JSON and again after it. Its `next[]` LEADS with the steps for THIS session, in this order for every app \u2014 the offline first render and that picture's `himi progress` postcard (only when init could not make the picture), the skill's consent preflight (authorize or mock any Wix or external startup request; with none, go straight on), and only then the live preview (the running one's url, or `himi run --watch &` when init did not start it) \u2014 ahead of the next-session guidance", required: "<name> [--dir] [--template <t>] [--remote] [--base44-app-id <id>] [--base44-app-url <https://tenant>] [--no-agent] [--no-first-look] | --templates" },
250640
250911
  { name: "template", summary: "starter-template catalog + publishing. Every template is a SHOWCASE APP \u2014 a real published release you can open running before you start from it. `list` prints available templates with metadata (title/description/tags) plus each one's start prompt \u2014 pass --remote to include the serve-plane catalog so an agent can pick one; `prompt <name>` prints just that sentence for one template (the skill URL is the public door, or the plane named by --target/--serve-url); `publish` publishes an app AS a `himi init --template` (needs a himalaya.template.json; builds a previewable release + attaches the scaffold source; --source-dir overrides which tree becomes the source, --name sets the template name; bakes a launcher icon \u2014 --icon <png>, or the committed template-icons/<name>.png \u2014 and extracts accent/palette gallery meta from the scaffold's tokens.json; --visibility unlisted keeps it out of the /v1/templates catalog \u2014 templates default to public; --source-hash prints the sourceHash and iconHash a publish would be stored under, with no build or network, and exits); `trim --keep <ids>` cuts an app scaffolded from a template down to those screens (the home, and any screen the navigation pins such as a drawer body, always stays) \u2014 it deletes the other SCREENS/TEMPLATED entries whole, prunes navigation (linkableScreens, tabBar, drawer, deep links, surfaces) and drops tier5-src workers no kept screen uses, then runs validate --strict and rolls everything back if it fails (--force keeps it, --dry-run writes nothing). A kept screen that links to a removed one is refused unless --links follow (keep those too) or --links drop (remove the taps). Adopting one: `inspect` writes the adoption inventory (.himi/adopt.json: screens, workers, which screens can call Wix/network on appear \u2014 bootsOffline \u2014 placeholder and sample copy, proposed Data access rows, typed-journey stubs); `screens` lists, shows, rewrites or adds ONE dev/index.ts entry (`--upsert --from <screens.json>` writes many generated ones as plain JSON entries, replacing existing ids); `sweep` replaces sample identity/copy inside string literals; `recommend` ranks the catalog for a business description or a site's verticals; `trim --from-spec` takes the kept screens from SPEC.md's Screen catalogue", required: "list [--remote] | prompt <name> | publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--visibility public|unlisted] [--target <t>] [--source-hash] | trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | inspect [--content <dir>] [--dry-run] | screens [--show <id>] [--write <id> --from <file>] [--add <id> --from <file>] [--upsert --from <screens.json>] | sweep --set 'Old=>New' | --map <file> [--dry-run] | recommend [--text <t>] [--verticals a,b] [--book <dir>] [--remote]" },
250641
250912
  { name: "build", summary: "compile tier5-src/<name>/index.ts -> dist/bundles/<name>.bundle.js with esbuild (--binary = resolve published @himalaya/*); semantic TypeScript checking belongs to himi validate. Warns (never fails) when a copied tier5-src/_shared file differs from every copy this CLI's templates ship, naming the file and the `cp` that refreshes it; a `// himi:forked` line in a file skips it", required: "[--content <dir>] [--binary]" },
250642
- { name: "publish-size", summary: "local build and early draft-publish budget measurement with the source archive included. Uses the same release payload and JSON serializer as push; skips network, owner lookup, claim, publish and final evidence gates. Reports exact provisional bodyBytes, the 8388608-byte limit, remaining/overage bytes and a planning reserve (default 65536) for future metadata. A changed slug or additional metadata requires remeasurement; final push remains authoritative. Does not certify publication readiness.", required: "[--content <dir>] [--app <slug>] [--reserve-bytes <n>] [--binary|--source]" },
250913
+ { name: "publish-size", summary: "local build and early draft-publish budget measurement with the source archive included. Uses the same release payload and JSON serializer as push; skips network, owner lookup, claim, publish and final evidence gates. Reports exact provisional bodyBytes, the 8388608-byte limit, remaining/overage bytes and a planning reserve (default 65536) for future metadata, plus compressedUpload: the gzip size push would send and whether it would fit the wire and decoded limits IF the publisher credential is eligible. It reads no credential, so it never establishes that; its verdict stays on the plain limit. A changed slug or additional metadata requires remeasurement; final push remains authoritative. Does not certify publication readiness.", required: "[--content <dir>] [--app <slug>] [--reserve-bytes <n>] [--binary|--source]" },
250643
250914
  { name: "functions", summary: "inspect/invoke server functions and operate durable jobs or schedules", required: "list|describe|openapi|invoke | jobs list|get|cancel|retry|dlq | schedule describe|invoke [--app <a>] [--environment preview|production] [--release <id>]" },
250644
250915
  { name: "eject", summary: "take ownership of a shared flow module (auth|checkout|screens): copies its source into tier5-src/_ejected/ and repoints this package's imports at the copy. The ladder's escape hatch \u2014 for when the factory options cannot express what you need. AFTER EJECTING, CENTRAL FIXES NO LONGER REACH THIS APP, including future corrections to the fail-closed entitlement and confirm-the-session rules. The floor is unaffected: credentials still go only through the native auth actions and money only through the cashier rail.", required: "<auth|checkout|screens> [--content <dir>]" },
250645
250916
  { name: "validate", summary: 'lint the content package (no push): fixed-contract TypeScript checking for tier5-src workers + schema/proto + token refs + component allowlist + $service bindings + strict-enum foot-guns + capability decls + worker boot dry-run + build/compile failures + copied tier5-src/_shared files that differ from this CLI\'s (a `stale-shared` warning, never promoted by --strict; `// himi:forked` in a file skips it). Type issues are advisory warnings normally; --strict promotes them and hygiene warnings to errors. Exit 1 on any error. Off-repo, the CLI supplies its compiler and SDK declarations. A PASSING validate after a source change also refreshes the home picture: exactly `himi render <homeScreenId> --png --mocks --device iphone` (offline, never --live; with recorded data \u2014 dev/net-mocks.json or cms seed rows \u2014 the picture shows it, and without, its postcard calls it an offline preview), run as a child it kills after 30 seconds, writing .himi/shots/<home>.png \u2014 whose own postcard logic then journals "First look at your app" or, after ten minutes of postcard silence, "Still building" \u2014 reported as `homePicture: {image}` (with `postcard` when one was journaled) or `{skipped: <reason>}`, never a failed validate. Skipped for a validate with errors, a home shot already current, CI or a test runner, and code nobody asked to run: a --remote template still unchanged since init.', required: "[--content <dir>] [--strict]" },
@@ -251259,6 +251530,16 @@ async function templateCommand(ctx) {
251259
251530
  let verticals = str3(flags.verticals)?.split(",").map((v2) => v2.trim()).filter(Boolean);
251260
251531
  const book = flags.book === true ? "." : str3(flags.book);
251261
251532
  let text22 = str3(flags.text) ?? (pos.slice(2).join(" ") || void 0);
251533
+ if (flags.context !== void 0 && (typeof flags.context !== "string" || !text22)) {
251534
+ io2.error(JSON.stringify({
251535
+ ok: false,
251536
+ code: "invalid_usage",
251537
+ error: typeof flags.context !== "string" ? '--context needs a value: --context "<supporting business context>"' : "--context needs --text: pass the requested app as --text and the site's business analysis as --context",
251538
+ usage: "himi template recommend --text <requested app> [--context <business context>] [--verticals a,b] [--book <dir>] [--remote]"
251539
+ }));
251540
+ return 2;
251541
+ }
251542
+ const context = str3(flags.context)?.trim() ? str3(flags.context) : void 0;
251262
251543
  let bookInfo;
251263
251544
  if (!verticals?.length && book) {
251264
251545
  let signal;
@@ -251291,7 +251572,7 @@ async function templateCommand(ctx) {
251291
251572
  ok: false,
251292
251573
  code: "invalid_usage",
251293
251574
  error: 'nothing to match \u2014 pass a business description (--text "\u2026"), --verticals stores,bookings, or --book <site analyze dir>',
251294
- usage: "himi template recommend [--text <description>] [--verticals a,b] [--book <dir>] [--remote]"
251575
+ usage: "himi template recommend [--text <requested app> [--context <business context>]] [--verticals a,b] [--book <dir>] [--remote]"
251295
251576
  }));
251296
251577
  return 2;
251297
251578
  }
@@ -251308,12 +251589,15 @@ async function templateCommand(ctx) {
251308
251589
  note = `remote catalog unreachable (${e2.message}); ranked the embedded templates only`;
251309
251590
  }
251310
251591
  }
251311
- const res = recommendTemplates2({ catalog: catalog4, verticals, text: text22 });
251592
+ const res = recommendTemplates2({ catalog: catalog4, verticals, text: text22, context });
251312
251593
  print({
251313
251594
  ok: true,
251314
251595
  ...verticals?.length ? { verticals } : {},
251315
251596
  ...bookInfo ? { book: bookInfo } : {},
251316
251597
  owner: res.owner,
251598
+ role: res.role,
251599
+ defaultTemplate: res.defaultTemplate,
251600
+ ...res.contextApplied ? { contextApplied: true } : {},
251317
251601
  recommended: res.ranked[0]?.name ?? null,
251318
251602
  ranked: res.ranked.slice(0, 8),
251319
251603
  ...note ? { note } : {},
@@ -251698,7 +251982,7 @@ async function templateCommand(ctx) {
251698
251982
  }
251699
251983
  }
251700
251984
  }
251701
- io2.error(JSON.stringify({ error: "template needs a subcommand", usage: "himi template list [--remote] | himi template prompt <name> | himi template publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--target <t>] [--source-hash] | himi template trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | himi template inspect | himi template screens [--show <id>] [--write <id> --from <file>] | himi template sweep --set 'Old=>New' | himi template recommend --text <description>" }));
251985
+ io2.error(JSON.stringify({ error: "template needs a subcommand", usage: "himi template list [--remote] | himi template prompt <name> | himi template publish [--dir <app>] [--source-dir <dir>] [--name <n>] [--icon <png>] [--target <t>] [--source-hash] | himi template trim --keep <id,id,\u2026>|--from-spec [SPEC.md] [--content <dir>] [--links follow|drop] [--dry-run] [--force] | himi template inspect | himi template screens [--show <id>] [--write <id> --from <file>] | himi template sweep --set 'Old=>New' | himi template recommend --text <requested app> [--context <business context>]" }));
251702
251986
  return 2;
251703
251987
  }
251704
251988
 
@@ -253845,9 +254129,12 @@ async function pushCommand(ctx) {
253845
254129
  } } : {}
253846
254130
  };
253847
254131
  const publishBodyFor = (slug) => composeReleasePayload(payload, slug, appSourceB64);
253848
- const publishBodyBytesFor = (slug) => publishReleaseBodyBytes(publishBodyFor(slug), meta, draft);
253849
- const refuseOversizedBody = async (slug, bodyBytes) => {
254132
+ const publishBodySizeFor = (slug) => measurePublishBody(publishBodyFor(slug), meta, draft);
254133
+ const { admitPublishBody: admitPublishBody2, compressedPublishEligibility: compressedPublishEligibility2, compressionNote: compressionNote2, publishSizeFields: publishSizeFields2 } = await Promise.resolve().then(() => (init_publish_admission(), publish_admission_exports));
254134
+ const eligibility = compressedPublishEligibility2(pushToken);
254135
+ const refuseOversizedBody = async (slug, size, compressedUpload) => {
253850
254136
  const { publishBodyBreakdown: publishBodyBreakdown2 } = await Promise.resolve().then(() => (init_publish_size(), publish_size_exports));
254137
+ const bodyBytes = size.bodyBytes;
253851
254138
  const withoutSource = appSourceB64 ? bodyBytes - appSourceB64.length : bodyBytes;
253852
254139
  io2.error(JSON.stringify(pushFailure2("publish_body_too_large", {
253853
254140
  ok: false,
@@ -253856,15 +254143,20 @@ async function pushCommand(ctx) {
253856
254143
  error: "publish_body_too_large",
253857
254144
  bodyBytes,
253858
254145
  limit: MAX_PUBLISH_BODY_BYTES,
254146
+ // Added beside `bodyBytes`/`limit`, which keep their meaning (plain JSON against the plain
254147
+ // cap): the decoded and wire caps, the gzip size when the client would compress this body,
254148
+ // and why that compressed upload was not admitted.
254149
+ ...publishSizeFields2(size, compressedUpload),
253859
254150
  ...appSourceB64 ? { appSourceBytes: appSourceB64.length } : {},
253860
254151
  // What to cut: each part's share of the body, with its largest entries by name.
253861
254152
  breakdown: publishBodyBreakdown2(publishBodyFor(slug), bodyBytes),
253862
- hint: appSourceB64 && withoutSource <= MAX_PUBLISH_BODY_BYTES ? "push with --no-source to publish without the source archive (this release then cannot be restored with `himi pull`), or trim the app's assets and bundles" : "trim the app's assets and bundles \u2014 this release is over the limit even without the source archive, so --no-source would not help"
254153
+ hint: (appSourceB64 && withoutSource <= MAX_PUBLISH_BODY_BYTES ? "push with --no-source to publish without the source archive (this release then cannot be restored with `himi pull`), or trim the app's assets and bundles" : "trim the app's assets and bundles \u2014 this release is over the limit even without the source archive, so --no-source would not help") + `. ${compressionNote2(size, compressedUpload)}`
253863
254154
  })));
253864
254155
  return 1;
253865
254156
  };
253866
- const composedBodyBytes = publishBodyBytesFor(app2);
253867
- if (composedBodyBytes > MAX_PUBLISH_BODY_BYTES) return refuseOversizedBody(app2, composedBodyBytes);
254157
+ const composedSize = publishBodySizeFor(app2);
254158
+ const composedAdmission = admitPublishBody2(composedSize, { eligibility });
254159
+ if (!composedAdmission.ok) return refuseOversizedBody(app2, composedSize, composedAdmission.compressedUpload);
253868
254160
  let autoClaimed = false;
253869
254161
  let adoptedSlug;
253870
254162
  if (flags["no-claim"] !== true) {
@@ -253890,8 +254182,9 @@ async function pushCommand(ctx) {
253890
254182
  }
253891
254183
  }
253892
254184
  if (adoptedSlug) {
253893
- const adoptedBodyBytes = publishBodyBytesFor(app2);
253894
- if (adoptedBodyBytes > MAX_PUBLISH_BODY_BYTES) return refuseOversizedBody(app2, adoptedBodyBytes);
254185
+ const adoptedSize = publishBodySizeFor(app2);
254186
+ const adoptedAdmission = admitPublishBody2(adoptedSize, { eligibility });
254187
+ if (!adoptedAdmission.ok) return refuseOversizedBody(app2, adoptedSize, adoptedAdmission.compressedUpload);
253895
254188
  }
253896
254189
  const publishPayload = publishBodyFor(app2);
253897
254190
  let r3;
@@ -253919,6 +254212,20 @@ async function pushCommand(ctx) {
253919
254212
  }));
253920
254213
  return 1;
253921
254214
  }
254215
+ if (!r3.ok && r3.json?.code === "compressed_publish_unsupported") {
254216
+ const j2 = r3.json;
254217
+ print(pushFailure2("compressed_publish_unsupported", {
254218
+ ok: false,
254219
+ app: app2,
254220
+ pushed: false,
254221
+ error: "compressed_publish_unsupported",
254222
+ status: r3.status,
254223
+ ...typeof j2.sentBytes === "number" ? { sentBytes: j2.sentBytes } : {},
254224
+ ...typeof j2.planeCountedBytes === "number" ? { planeCountedBytes: j2.planeCountedBytes } : {},
254225
+ hint: j2.hint
254226
+ }));
254227
+ return 1;
254228
+ }
253922
254229
  if (!r3.ok) {
253923
254230
  const authHint = pushAuthHint(r3.status, pushToken, pushTarget, !!ownerIssue);
253924
254231
  const hint = authHint ?? releaseIdExistsHint(r3.status, r3.json);
@@ -254666,9 +254973,9 @@ async function runPackageCommand(ctx) {
254666
254973
  await announce(running);
254667
254974
  if (watchKit && bus) {
254668
254975
  const { buildContentBundles: buildContentBundles2, buildReleaseFromContent: buildReleaseFromContent2, bundleOutDir: bundleOutDir2 } = await loadAuthoring();
254669
- const live3 = join124(running.releaseRoot, running.app);
254976
+ const live4 = join124(running.releaseRoot, running.app);
254670
254977
  const manifestOf = (tree) => JSON.parse(readFileSync129(join124(tree, "release-manifest.json"), "utf8"));
254671
- let current = manifestOf(live3);
254978
+ let current = manifestOf(live4);
254672
254979
  const failed3 = async (message2) => {
254673
254980
  if (stopping) return;
254674
254981
  bus.publish("build.failed", { message: message2 });
@@ -254698,13 +255005,13 @@ async function runPackageCommand(ctx) {
254698
255005
  const fresh = manifestOf(join124(next, running.app));
254699
255006
  const diff = watchKit.diffReleases(current, fresh);
254700
255007
  const { describeChanges: describeChanges2, headline: headline2 } = await Promise.resolve().then(() => (init_build_changes(), build_changes_exports));
254701
- const changes = describeChanges2(live3, join124(next, running.app), diff);
254702
- const retired = `${live3}.retired-${Date.now()}`;
254703
- renameSync17(live3, retired);
255008
+ const changes = describeChanges2(live4, join124(next, running.app), diff);
255009
+ const retired = `${live4}.retired-${Date.now()}`;
255010
+ renameSync17(live4, retired);
254704
255011
  try {
254705
- renameSync17(join124(next, running.app), live3);
255012
+ renameSync17(join124(next, running.app), live4);
254706
255013
  } catch {
254707
- cpSync3(join124(next, running.app), live3, { recursive: true });
255014
+ cpSync3(join124(next, running.app), live4, { recursive: true });
254708
255015
  }
254709
255016
  rmSync30(retired, { recursive: true, force: true });
254710
255017
  current = fresh;
@@ -260331,9 +260638,9 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
260331
260638
  io2.error(JSON.stringify(pushFailure2("release_read_failed", liveFound)));
260332
260639
  return 1;
260333
260640
  }
260334
- const live3 = liveFound.manifest;
260335
- if (live3 && live3.releaseId !== base.releaseId) {
260336
- regressions = regressionDiff2(base, live3, plan.touched);
260641
+ const live4 = liveFound.manifest;
260642
+ if (live4 && live4.releaseId !== base.releaseId) {
260643
+ regressions = regressionDiff2(base, live4, plan.touched);
260337
260644
  if (regressions.length > 0 && !opts.acceptRegressions) {
260338
260645
  io2.error(JSON.stringify(pushFailure2("would_regress", {
260339
260646
  ok: false,
@@ -260341,7 +260648,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
260341
260648
  error: "would_regress",
260342
260649
  app: app2,
260343
260650
  base: { releaseId: base.releaseId, publishedAt: base.publishedAt ?? null },
260344
- live: { releaseId: live3.releaseId, publishedAt: live3.publishedAt ?? null },
260651
+ live: { releaseId: live4.releaseId, publishedAt: live4.publishedAt ?? null },
260345
260652
  message: `a branch does not merge. Activating a release derived from ${base.releaseId} reverts every item this patch does not move.`,
260346
260653
  wouldRegress: regressions,
260347
260654
  moves: plan.touched,