@wix/himalaya-cli 0.1160.0 → 0.1162.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
@@ -505,8 +505,8 @@ async function readWip(store, app) {
505
505
  if (!wipSupported(store)) return "unsupported";
506
506
  const { wip, promoted } = normalizeWipRecord(await store.getWipRecord(app));
507
507
  if (!wip || promoted.some((p) => p.id === wip.releaseId)) return null;
508
- const live2 = await store.getManifest(app);
509
- return live2?.releaseId === wip.releaseId ? null : wip;
508
+ const live3 = await store.getManifest(app);
509
+ return live3?.releaseId === wip.releaseId ? null : wip;
510
510
  }
511
511
  var storedTime;
512
512
  var init_wip_pointer = __esm({
@@ -8255,7 +8255,10 @@ var init_a11y_contract = __esm({
8255
8255
  ListItem: { role: "listitem", name: "required", state: ["selected", "disabled", "position"], decorative: false },
8256
8256
  // ---- Navigation and progress structures ---------------------------------------------
8257
8257
  DisclosureGroup: { role: "button", name: "required", state: ["expanded/collapsed"], decorative: false },
8258
- CollapsingHeader: { role: "heading", name: "required", state: ["expanded/collapsed"], decorative: false },
8258
+ // NO state (#3433): the header collapses as the content under it scrolls, not because the user
8259
+ // toggled it — it is not a disclosure, and "collapsed" would describe a scroll offset as if it
8260
+ // were a control's setting. Every arm exposes the title as a heading and nothing more.
8261
+ CollapsingHeader: { role: "heading", name: "required", state: [], decorative: false },
8259
8262
  Carousel: { role: "list", name: "required", state: ["item N of M"], decorative: false },
8260
8263
  Pager: { role: "list", name: "required", state: ["item N of M"], decorative: false },
8261
8264
  PageControl: { role: "adjustable", name: "required", state: ["page N of M"], decorative: false },
@@ -11897,7 +11900,7 @@ function inputJson(input) {
11897
11900
  const json6 = JSON.stringify(input ?? {});
11898
11901
  return json6 === void 0 ? "{}" : json6;
11899
11902
  }
11900
- function timerGlobals(hide, live2) {
11903
+ function timerGlobals(hide, live3) {
11901
11904
  const hidden = new Set(hide ?? []);
11902
11905
  const stubs = {
11903
11906
  setTimeout: " globalThis.setTimeout = function () { return 0; };",
@@ -11923,7 +11926,7 @@ function timerGlobals(hide, live2) {
11923
11926
  setInterval: " globalThis.setInterval = function () { return 0; };",
11924
11927
  clearInterval: " globalThis.clearInterval = function () {};"
11925
11928
  };
11926
- const decls = live2 ? real : stubs;
11929
+ const decls = live3 ? real : stubs;
11927
11930
  return Object.entries(decls).filter(([name]) => !hidden.has(name)).map(([, src]) => src).join("\n");
11928
11931
  }
11929
11932
  function preludeFor(opts) {
@@ -18223,12 +18226,12 @@ function genNativeConfig(app, opts = {}) {
18223
18226
  const embedManaged = hasMarkers(project, "yaml", LABEL_LIVE_EMBED);
18224
18227
  if (targetManaged !== embedManaged) throw new Error(`${app}: Live Activity target and embedding markers must be installed together`);
18225
18228
  const drainsWidgetActions = hostAppliesDeferredWidgetActions(app);
18226
- const live2 = targetManaged ? liveActivityPlan(project, ids.includes("live_activity"), drainsWidgetActions) : void 0;
18227
- if (live2?.appGroupId) {
18229
+ const live3 = targetManaged ? liveActivityPlan(project, ids.includes("live_activity"), drainsWidgetActions) : void 0;
18230
+ if (live3?.appGroupId) {
18228
18231
  const key2 = "com.apple.security.application-groups";
18229
18232
  const existing = ios.entitlements[key2];
18230
18233
  const groups = Array.isArray(existing) ? [...existing] : existing === void 0 ? [] : [existing];
18231
- if (!groups.includes(live2.appGroupId)) groups.push(live2.appGroupId);
18234
+ if (!groups.includes(live3.appGroupId)) groups.push(live3.appGroupId);
18232
18235
  ios.entitlements[key2] = groups;
18233
18236
  }
18234
18237
  const files = [
@@ -18276,7 +18279,7 @@ function genNativeConfig(app, opts = {}) {
18276
18279
  files.push(r);
18277
18280
  }
18278
18281
  if (targetManaged) {
18279
- const plan = live2;
18282
+ const plan = live3;
18280
18283
  files.push(applyToFile(iosYml, "yaml", LABEL_LIVE_TARGET, (i) => plan.target.map((line) => i + line), check));
18281
18284
  files.push(applyToFile(iosYml, "yaml", LABEL_LIVE_EMBED, (i) => plan.embed.map((line) => i + line), check));
18282
18285
  const source = join29(dirname16(iosYml), LIVE_SOURCE_PATH);
@@ -24513,7 +24516,6 @@ function shouldRevealError(args) {
24513
24516
  var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
24514
24517
  var init_validation = __esm({
24515
24518
  "../../core/ts/src/validation.ts"() {
24516
- "use strict";
24517
24519
  EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
24518
24520
  URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
24519
24521
  INTEGER_RE = /^[+-]?[0-9]+$/;
@@ -25173,7 +25175,6 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
25173
25175
  var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
25174
25176
  var init_worker_subtree = __esm({
25175
25177
  "../../core/ts/src/worker-subtree.ts"() {
25176
- "use strict";
25177
25178
  init_worker_subtree_safe_types_generated();
25178
25179
  WORKER_SUBTREE_CEILINGS = Object.freeze({
25179
25180
  maxEncodedBytes: 65536,
@@ -31594,7 +31595,7 @@ function RichContentEditorView({ props, ctx, wrap, nodeId, renderChild, ...dom }
31594
31595
  const C = ctx.color;
31595
31596
  const name = typeof props.name === "string" && props.name ? props.name : void 0;
31596
31597
  const bag = React3.useContext(FormValuesContext);
31597
- const live2 = !!ctx.onAction;
31598
+ const live3 = !!ctx.onAction;
31598
31599
  const toolsKey = JSON.stringify(props.tools ?? null);
31599
31600
  const tools = React3.useMemo(() => effectiveTools(props.tools, props.uploadService), [toolsKey, props.uploadService]);
31600
31601
  const seedMode = typeof props.documentJson === "string" ? "literal" : typeof props.documentPath === "string" && props.documentPath ? "binding" : "none";
@@ -31633,11 +31634,11 @@ function RichContentEditorView({ props, ctx, wrap, nodeId, renderChild, ...dom }
31633
31634
  const fireOnChangeRef = React3.useRef(fireOnChange);
31634
31635
  fireOnChangeRef.current = fireOnChange;
31635
31636
  React3.useEffect(() => {
31636
- if (live2) setSrc(new URL(ENGINE_PAGE_PATH, document.baseURI).toString());
31637
- }, [live2]);
31637
+ if (live3) setSrc(new URL(ENGINE_PAGE_PATH, document.baseURI).toString());
31638
+ }, [live3]);
31638
31639
  React3.useEffect(() => {
31639
31640
  const frame = iframeRef.current;
31640
- if (!live2 || !src || !frame) return;
31641
+ if (!live3 || !src || !frame) return;
31641
31642
  const t = ricosEditorWebTimings;
31642
31643
  const session = createRicosHostSession({
31643
31644
  send: (msg) => frame.contentWindow?.postMessage({ ricos: 1, msg }, "*"),
@@ -31682,7 +31683,7 @@ function RichContentEditorView({ props, ctx, wrap, nodeId, renderChild, ...dom }
31682
31683
  session.dispose();
31683
31684
  sessionRef.current = null;
31684
31685
  };
31685
- }, [live2, src]);
31686
+ }, [live3, src]);
31686
31687
  React3.useEffect(() => {
31687
31688
  sessionRef.current?.setSeed(seedMode === "literal" ? props.documentJson : seedMode === "binding" ? boundSeed : "");
31688
31689
  }, [seedMode, props.documentJson, boundSeed, src]);
@@ -31738,7 +31739,7 @@ function RichContentEditorView({ props, ctx, wrap, nodeId, renderChild, ...dom }
31738
31739
  setLink(null);
31739
31740
  };
31740
31741
  const root = { position: "relative", display: "flex", flexDirection: "column", width: "100%", ...fill ? { flex: "1 1 auto", minHeight: 0 } : { minHeight }, ...wrap };
31741
- if (!live2) {
31742
+ if (!live3) {
31742
31743
  const { paddingTop: _t, paddingBottom: _b, paddingLeft: _l, paddingRight: _r, ...rootNoSides } = root;
31743
31744
  const own3 = { ...rootNoSides, border: `1px solid ${C("border", "#e3e3e3")}`, borderRadius: 8, padding: 12, boxSizing: "border-box" };
31744
31745
  return /* @__PURE__ */ jsx4("div", { ...dom, style: addIntrinsicPadding(own3, wrap) ?? own3, children: /* @__PURE__ */ jsx4("span", { style: { color: C("textSecondary", "#636B78") }, children: placeholder2 || "Rich text editor" }) });
@@ -31908,7 +31909,17 @@ function labelText(label2, ctx) {
31908
31909
  }
31909
31910
  return asText2(label2);
31910
31911
  }
31911
- var useResolvedId, FONT, rowShareFloor, A11ySwitch, A11ySlider, A11ySelectionControl, actOf, withSelection, resolveItemDeep, A11yTabs, A11ySegmented, disclosureSeq, A11yDisclosure;
31912
+ function resolveRowAction(action, ctx) {
31913
+ const resolved2 = resolveItemDeep(action, ctx);
31914
+ if (!resolved2 || typeof resolved2 !== "object" || Array.isArray(resolved2)) return resolved2;
31915
+ const params = resolved2.params;
31916
+ if (!params || typeof params !== "object" || Array.isArray(params)) return resolved2;
31917
+ return {
31918
+ ...resolved2,
31919
+ params: Object.fromEntries(Object.entries(params).map(([k, v]) => [k, typeof v === "number" || typeof v === "boolean" ? String(v) : v]))
31920
+ };
31921
+ }
31922
+ var useResolvedId, FONT, rowShareFloor, A11ySwitch, A11Y_PART, A11ySlider, A11ySelectionControl, actOf, withSelection, resolveItemDeep, A11yTabs, A11ySegmented, disclosureSeq, A11yDisclosure;
31912
31923
  var init_controls = __esm({
31913
31924
  "../../core/web-renderer/src/a11y/controls.tsx"() {
31914
31925
  "use strict";
@@ -31975,7 +31986,7 @@ var init_controls = __esm({
31975
31986
  }
31976
31987
  const toggleAct = act;
31977
31988
  if (ctx.onAction && toggleAct) {
31978
- const resolved3 = resolveItemDeep(toggleAct, ctx);
31989
+ const resolved3 = resolveRowAction(toggleAct, ctx);
31979
31990
  ctx.onAction({ ...resolved3, args: { ...resolved3.args ?? {}, value: next } });
31980
31991
  }
31981
31992
  } : void 0;
@@ -31997,6 +32008,7 @@ var init_controls = __esm({
31997
32008
  )
31998
32009
  ] });
31999
32010
  };
32011
+ A11Y_PART = "data-hm-a11y-part";
32000
32012
  A11ySlider = ({ props, ctx, wrap }) => {
32001
32013
  const C = ctx.color;
32002
32014
  const min = props.min ?? 0, max = props.max ?? 1;
@@ -32010,13 +32022,72 @@ var init_controls = __esm({
32010
32022
  React4.useEffect(() => {
32011
32023
  setVal(bound);
32012
32024
  }, [bound]);
32013
- const fire = ctx.onAction && props.onChange && !props.disabled ? () => ctx.onAction(props.onChange) : void 0;
32025
+ const dragging = React4.useRef(false);
32026
+ const canFire = !!(ctx.onAction && props.onChange && !props.disabled);
32027
+ const commit = (nv) => {
32028
+ setVal(nv);
32029
+ if (!canFire) return;
32030
+ const act = resolveRowAction(props.onChange, ctx);
32031
+ ctx.onAction({ ...act, args: { ...act.args ?? {}, value: nv } });
32032
+ };
32014
32033
  const clampPct = (n) => max > min ? Math.max(0, Math.min(1, (n - min) / (max - min))) : 0;
32034
+ const [pair, setPair] = React4.useState(() => [Math.min(bound, props.upperValue ?? bound), Math.max(bound, props.upperValue ?? bound)]);
32035
+ React4.useEffect(() => {
32036
+ if (range) setPair([Math.min(bound, props.upperValue), Math.max(bound, props.upperValue)]);
32037
+ }, [range, bound, props.upperValue]);
32015
32038
  if (range) {
32016
- const lo = Math.min(bound, props.upperValue), hi = Math.max(bound, props.upperValue);
32017
- return /* @__PURE__ */ jsx5("div", { style: { width: "100%", padding: "12px 9px", boxSizing: "border-box", opacity: props.disabled ? 0.5 : 1, ...wrap }, children: /* @__PURE__ */ jsxs2("div", { style: { position: "relative", height: 4, borderRadius: 999, background: C("surfaceTertiary", "#e3e6ea") }, children: [
32039
+ const [lo, hi] = pair;
32040
+ const thumbKey = (which) => (e) => {
32041
+ if (props.disabled) return;
32042
+ const at2 = pair[which];
32043
+ const floor = which === 0 ? min : lo, ceil = which === 0 ? hi : max;
32044
+ let nv = at2;
32045
+ switch (e.key) {
32046
+ case "ArrowRight":
32047
+ case "ArrowUp":
32048
+ nv = Math.min(ceil, at2 + step);
32049
+ break;
32050
+ case "ArrowLeft":
32051
+ case "ArrowDown":
32052
+ nv = Math.max(floor, at2 - step);
32053
+ break;
32054
+ case "Home":
32055
+ nv = floor;
32056
+ break;
32057
+ case "End":
32058
+ nv = ceil;
32059
+ break;
32060
+ default:
32061
+ return;
32062
+ }
32063
+ e.preventDefault();
32064
+ const next = which === 0 ? [nv, hi] : [lo, nv];
32065
+ setPair(next);
32066
+ if (canFire) {
32067
+ const act = resolveRowAction(props.onChange, ctx);
32068
+ ctx.onAction({ ...act, args: { ...act.args ?? {}, value: next[0], upperValue: next[1] } });
32069
+ }
32070
+ };
32071
+ const groupName = labelText(props.label, ctx) || void 0;
32072
+ return /* @__PURE__ */ jsx5("div", { ...{ [A11Y_PART]: "root" }, role: "group", "aria-label": groupName, style: { width: "100%", padding: "12px 9px", boxSizing: "border-box", opacity: props.disabled ? 0.5 : 1, ...wrap }, children: /* @__PURE__ */ jsxs2("div", { style: { position: "relative", height: 4, borderRadius: 999, background: C("surfaceTertiary", "#e3e6ea") }, children: [
32018
32073
  /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: `${clampPct(lo) * 100}%`, right: `${(1 - clampPct(hi)) * 100}%`, top: 0, bottom: 0, borderRadius: 999, background: tint } }),
32019
- [lo, hi].map((p, i) => /* @__PURE__ */ jsx5("span", { role: "slider", "aria-valuenow": p, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": "horizontal", style: { position: "absolute", left: `${clampPct(p) * 100}%`, top: "50%", width: 18, height: 18, borderRadius: "50%", background: "#fff", border: `2px solid ${tint}`, transform: "translate(-50%, -50%)", boxShadow: "0 1px 3px rgba(0,0,0,.25)" } }, i))
32074
+ [lo, hi].map((p, i) => /* @__PURE__ */ jsx5(
32075
+ "span",
32076
+ {
32077
+ ...i === 0 ? { [A11Y_PART]: "focus" } : {},
32078
+ role: "slider",
32079
+ tabIndex: props.disabled ? -1 : 0,
32080
+ "aria-label": i === 0 ? "Minimum" : "Maximum",
32081
+ "aria-valuenow": p,
32082
+ "aria-valuemin": i === 0 ? min : lo,
32083
+ "aria-valuemax": i === 0 ? hi : max,
32084
+ "aria-orientation": "horizontal",
32085
+ "aria-disabled": props.disabled ? true : void 0,
32086
+ onKeyDown: thumbKey(i),
32087
+ style: { position: "absolute", left: `${clampPct(p) * 100}%`, top: "50%", width: 18, height: 18, borderRadius: "50%", background: "#fff", border: `2px solid ${tint}`, transform: "translate(-50%, -50%)", boxShadow: "0 1px 3px rgba(0,0,0,.25)", outlineOffset: 3, cursor: props.disabled ? "default" : "pointer" }
32088
+ },
32089
+ i
32090
+ ))
32020
32091
  ] }) });
32021
32092
  }
32022
32093
  const pct = clampPct(val);
@@ -32042,12 +32113,38 @@ var init_controls = __esm({
32042
32113
  return;
32043
32114
  }
32044
32115
  e.preventDefault();
32116
+ commit(nv);
32117
+ };
32118
+ const valueAt = (e) => {
32119
+ const r = e.currentTarget.getBoundingClientRect();
32120
+ if (!(r.width > 0)) return void 0;
32121
+ const f = Math.max(0, Math.min(1, (e.clientX - r.left) / r.width));
32122
+ const raw2 = min + f * (max - min);
32123
+ const grid = Math.max(min, Math.min(max, Number((min + Math.round((raw2 - min) / step) * step).toFixed(10))));
32124
+ return Math.abs(max - raw2) < Math.abs(grid - raw2) ? max : grid;
32125
+ };
32126
+ const onPointerDown = (e) => {
32127
+ if (props.disabled) return;
32128
+ const nv = valueAt(e);
32129
+ if (nv === void 0) return;
32130
+ dragging.current = true;
32131
+ e.currentTarget.setPointerCapture?.(e.pointerId);
32045
32132
  setVal(nv);
32046
- if (fire) fire();
32047
32133
  };
32048
- return /* @__PURE__ */ jsx5("div", { style: { width: "100%", padding: "12px 9px", boxSizing: "border-box", opacity: props.disabled ? 0.5 : 1, ...wrap }, children: /* @__PURE__ */ jsx5(
32134
+ const onPointerMove = (e) => {
32135
+ if (!dragging.current) return;
32136
+ const nv = valueAt(e);
32137
+ if (nv !== void 0) setVal(nv);
32138
+ };
32139
+ const onPointerUp = (e) => {
32140
+ if (!dragging.current) return;
32141
+ dragging.current = false;
32142
+ commit(valueAt(e) ?? val);
32143
+ };
32144
+ return /* @__PURE__ */ jsx5("div", { ...{ [A11Y_PART]: "root" }, style: { width: "100%", padding: "12px 9px", boxSizing: "border-box", opacity: props.disabled ? 0.5 : 1, ...wrap }, children: /* @__PURE__ */ jsx5(
32049
32145
  "div",
32050
32146
  {
32147
+ ...{ [A11Y_PART]: "node" },
32051
32148
  role: "slider",
32052
32149
  tabIndex: props.disabled ? -1 : 0,
32053
32150
  "aria-valuenow": val,
@@ -32057,7 +32154,10 @@ var init_controls = __esm({
32057
32154
  "aria-label": labelText(props.label, ctx) || void 0,
32058
32155
  "aria-disabled": props.disabled ? true : void 0,
32059
32156
  onKeyDown,
32060
- style: { position: "relative", height: 18, display: "flex", alignItems: "center", outlineOffset: 4, cursor: props.disabled ? "default" : "pointer" },
32157
+ onPointerDown,
32158
+ onPointerMove,
32159
+ onPointerUp,
32160
+ style: { position: "relative", height: 18, display: "flex", alignItems: "center", outlineOffset: 4, cursor: props.disabled ? "default" : "pointer", touchAction: "pan-y" },
32061
32161
  children: /* @__PURE__ */ jsxs2("div", { style: { position: "relative", height: 4, width: "100%", borderRadius: 999, background: C("surfaceTertiary", "#e3e6ea") }, children: [
32062
32162
  /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: 0, width: `${pct * 100}%`, top: 0, bottom: 0, borderRadius: 999, background: tint } }),
32063
32163
  /* @__PURE__ */ jsx5("span", { "aria-hidden": true, style: { position: "absolute", left: `${pct * 100}%`, top: "50%", width: 18, height: 18, borderRadius: "50%", background: "#fff", border: `2px solid ${tint}`, transform: "translate(-50%, -50%)", boxShadow: "0 1px 3px rgba(0,0,0,.25)" } })
@@ -32074,7 +32174,7 @@ var init_controls = __esm({
32074
32174
  const accent = C("accentPrimary", "#116DFF");
32075
32175
  const fire = ctx.onAction && props.onChange && !props.disabled ? (e) => {
32076
32176
  e?.stopPropagation?.();
32077
- const act = resolveItemDeep(props.onChange, ctx);
32177
+ const act = resolveRowAction(props.onChange, ctx);
32078
32178
  const next = isRadio ? true : !on3;
32079
32179
  ctx.onAction({ ...act, args: { ...act.args ?? {}, value: next } });
32080
32180
  } : void 0;
@@ -32214,7 +32314,7 @@ var init_controls = __esm({
32214
32314
  const subtitle = useResolvedScalar(props.subtitle, ctx);
32215
32315
  const expanded = useResolvedScalar(props.expandedPath ?? props.expanded, ctx);
32216
32316
  const open = expanded === true;
32217
- const fire = ctx.onAction && props.onToggle ? () => ctx.onAction(resolveItemDeep(props.onToggle, ctx)) : void 0;
32317
+ const fire = ctx.onAction && props.onToggle ? () => ctx.onAction(resolveRowAction(props.onToggle, ctx)) : void 0;
32218
32318
  const regionId = React4.useMemo(() => `himi-disclosure-${++disclosureSeq}`, []);
32219
32319
  return /* @__PURE__ */ jsxs2("div", { style: { width: "100%", ...wrap }, children: [
32220
32320
  /* @__PURE__ */ jsxs2(
@@ -32241,12 +32341,15 @@ var init_controls = __esm({
32241
32341
  });
32242
32342
 
32243
32343
  // ../../core/web-renderer/src/a11y/modalStack.ts
32244
- function pushModalLayer(el) {
32245
- const layer = { el: typeof el === "function" ? el : () => el };
32344
+ function pushModalLayer(el, opts = {}) {
32345
+ const layer = { el: typeof el === "function" ? el : () => el, host: opts.host === true, seq: pushes++ };
32246
32346
  layers.push(layer);
32247
32347
  sync();
32248
32348
  return {
32249
- isTop: () => layers[layers.length - 1] === layer,
32349
+ isTop: () => {
32350
+ const own3 = layer.el();
32351
+ return own3 != null && own3.isConnected && topLayerOver(own3) === layer;
32352
+ },
32250
32353
  release: () => {
32251
32354
  const i = layers.indexOf(layer);
32252
32355
  if (i < 0) return;
@@ -32256,43 +32359,75 @@ function pushModalLayer(el) {
32256
32359
  };
32257
32360
  }
32258
32361
  function isWithinTopModal(el) {
32259
- const top = topElement();
32260
- return top == null || top.contains(el);
32362
+ const top = topOver(el);
32363
+ return top == null || top.el.contains(el);
32261
32364
  }
32262
- function topElement() {
32263
- for (let i = layers.length - 1; i >= 0; i--) {
32264
- const el = layers[i].el();
32265
- if (el?.isConnected) return el;
32365
+ function live() {
32366
+ const out2 = [];
32367
+ for (const layer of layers) {
32368
+ const el = layer.el();
32369
+ if (el?.isConnected) out2.push({ layer, el, scope: el.parentElement?.closest(`[${MODAL_SCOPE_ATTR}]`) ?? el.ownerDocument.body });
32266
32370
  }
32267
- return null;
32371
+ return out2;
32372
+ }
32373
+ function rootOf(l, all) {
32374
+ for (let root = l; ; ) {
32375
+ const outer = all.find((o) => o.el !== root.el && o.el.contains(root.el));
32376
+ if (!outer) return root;
32377
+ root = outer;
32378
+ }
32379
+ }
32380
+ function above(a, b, all) {
32381
+ if (a.el !== b.el) {
32382
+ if (b.el.contains(a.el)) return true;
32383
+ if (a.el.contains(b.el)) return false;
32384
+ }
32385
+ const ra = rootOf(a, all);
32386
+ const rb = rootOf(b, all);
32387
+ if (ra !== rb) return ra.layer.host !== rb.layer.host ? ra.layer.host : ra.layer.seq > rb.layer.seq;
32388
+ return a.layer.seq > b.layer.seq;
32389
+ }
32390
+ function topOf(candidates, all) {
32391
+ let top = null;
32392
+ for (const c of candidates) if (!top || above(c, top, all)) top = c;
32393
+ return top;
32394
+ }
32395
+ function topOver(target) {
32396
+ const all = live();
32397
+ return topOf(all.filter((l) => l.scope.contains(target) || target.contains(l.el)), all);
32398
+ }
32399
+ function topLayerOver(target) {
32400
+ return topOver(target)?.layer ?? null;
32268
32401
  }
32269
32402
  function sync() {
32270
32403
  watcher?.disconnect();
32271
32404
  watcher = null;
32272
32405
  for (const el of madeInert) el.removeAttribute("inert");
32273
32406
  madeInert.clear();
32274
- const top = topElement();
32275
- if (!top) return;
32276
- const scope = top.parentElement?.closest(`[${MODAL_SCOPE_ATTR}]`) ?? top.ownerDocument.body;
32277
- const levels = [];
32278
- let node = top;
32279
- while (node !== scope && node.parentElement) {
32280
- const parent = node.parentElement;
32281
- levels.push(parent);
32282
- for (const sibling of Array.from(parent.children)) {
32283
- if (sibling === node || SKIP.has(sibling.tagName) || sibling.hasAttribute("inert")) continue;
32284
- sibling.setAttribute("inert", "");
32285
- madeInert.add(sibling);
32286
- }
32287
- node = parent;
32288
- }
32289
- const Observer = top.ownerDocument.defaultView?.MutationObserver;
32290
- if (Observer && levels.length) {
32407
+ const all = live();
32408
+ if (!all.length) return;
32409
+ const levels = /* @__PURE__ */ new Set();
32410
+ for (const scope of new Set(all.map((l) => l.scope))) {
32411
+ const top = topOf(all.filter((l) => l.scope === scope), all);
32412
+ let node = top.el;
32413
+ while (node !== scope && node.parentElement) {
32414
+ const parent = node.parentElement;
32415
+ levels.add(parent);
32416
+ for (const sibling of Array.from(parent.children)) {
32417
+ if (sibling === node || SKIP.has(sibling.tagName) || sibling.hasAttribute("inert")) continue;
32418
+ sibling.setAttribute("inert", "");
32419
+ madeInert.add(sibling);
32420
+ }
32421
+ node = parent;
32422
+ }
32423
+ }
32424
+ const Observer = all[0].el.ownerDocument.defaultView?.MutationObserver;
32425
+ if (Observer && levels.size) {
32291
32426
  watcher = new Observer(() => sync());
32292
32427
  for (const level of levels) watcher.observe(level, { childList: true });
32293
32428
  }
32294
32429
  }
32295
- var MODAL_SCOPE_ATTR, SKIP, layers, madeInert, watcher;
32430
+ var MODAL_SCOPE_ATTR, SKIP, layers, madeInert, watcher, pushes;
32296
32431
  var init_modalStack = __esm({
32297
32432
  "../../core/web-renderer/src/a11y/modalStack.ts"() {
32298
32433
  MODAL_SCOPE_ATTR = "data-himi-modal-scope";
@@ -32300,6 +32435,7 @@ var init_modalStack = __esm({
32300
32435
  layers = [];
32301
32436
  madeInert = /* @__PURE__ */ new Set();
32302
32437
  watcher = null;
32438
+ pushes = 0;
32303
32439
  }
32304
32440
  });
32305
32441
 
@@ -33469,12 +33605,22 @@ function editA11yParts(node, edit) {
33469
33605
  if (typeof part !== "string" && nextKids === kids3) return node;
33470
33606
  return cloneWithKids(node, typeof part === "string" ? { ...edit(part, own3), [A11Y_PART]: void 0 } : {}, nextKids);
33471
33607
  }
33472
- function a11yPartEdit(routed, authoredName, onNode) {
33608
+ function a11yPartEdit(routed, authoredName, onNode, focus) {
33473
33609
  return (part, own3) => {
33474
33610
  if (part === "derived-name") return authoredName ? {} : { "aria-hidden": "true" };
33611
+ const focusable = typeof own3.tabIndex === "number" && own3.tabIndex >= 0;
33612
+ if (part === "focus") {
33613
+ if (!focus || !focusable) return {};
33614
+ focus.onRouted();
33615
+ return { ...focus.carried };
33616
+ }
33475
33617
  if (part !== "node") return {};
33476
33618
  onNode();
33477
33619
  const patch = { ...routed };
33620
+ if (focus && focusable) {
33621
+ Object.assign(patch, focus.carried);
33622
+ focus.onRouted();
33623
+ }
33478
33624
  if (typeof routed["aria-describedby"] === "string" && typeof own3["aria-describedby"] === "string") {
33479
33625
  patch["aria-describedby"] = `${own3["aria-describedby"]} ${routed["aria-describedby"]}`;
33480
33626
  }
@@ -33621,11 +33767,28 @@ function withExtras(name, render) {
33621
33767
  for (const k of NODE_A11Y_ATTRS) if (next[k] !== void 0) routed[k] = next[k];
33622
33768
  if (pass[AUTHORED_ROLE] === true || pass["aria-level"] != null) routed.role = next.role;
33623
33769
  }
33770
+ const focus = {};
33771
+ if (!rootIsControl) {
33772
+ if (next.tabIndex !== void 0 && !tabIndexIsSynthetic) focus.tabIndex = next.tabIndex;
33773
+ if (next["data-himalaya-initial-focus"] !== void 0) focus["data-himalaya-initial-focus"] = next["data-himalaya-initial-focus"];
33774
+ }
33624
33775
  let nodeFound = false;
33625
- const kids3 = editA11yParts(prev.children, a11yPartEdit(routed, pass["aria-label"] != null, () => {
33626
- nodeFound = true;
33627
- }));
33776
+ let focusRouted = false;
33777
+ const kids3 = editA11yParts(prev.children, a11yPartEdit(
33778
+ routed,
33779
+ pass["aria-label"] != null,
33780
+ () => {
33781
+ nodeFound = true;
33782
+ },
33783
+ Object.keys(focus).length ? { carried: focus, onRouted: () => {
33784
+ focusRouted = true;
33785
+ } } : void 0
33786
+ ));
33628
33787
  if (nodeFound) for (const k of Object.keys(routed)) delete next[k];
33788
+ if (focusRouted) {
33789
+ delete next.tabIndex;
33790
+ delete next["data-himalaya-initial-focus"];
33791
+ }
33629
33792
  return cloneWithKids(el, next, kids3);
33630
33793
  }
33631
33794
  return React7.cloneElement(el, next);
@@ -35136,13 +35299,15 @@ function renderInner(node, ctx) {
35136
35299
  ] });
35137
35300
  }
35138
35301
  // RFC 0058 §4 — an INLINE card, drawn where the descriptor puts it, as iOS (`AlertDialogPreview`)
35139
- // and Android (`SDUIAlertDialogPreview`) draw it: only its semantics are modal (`aria-modal`,
35140
- // from the one table). It is not presented over the screen, so a screen that shows one inline (a
35141
- // cart's high-value confirm, a component gallery) keeps the rest of itself usable, tab bar
35142
- // included. A presented alert is `presentation: "alert"` on a navigating Action, which the web
35143
- // host draws as its own modal dialog.
35302
+ // and Android (`SDUIAlertDialogPreview`) draw it. It is not presented over the screen, so a
35303
+ // screen that shows one inline (a cart's high-value confirm, a component gallery) keeps the rest
35304
+ // of itself usable, tab bar included — and it is NOT modal, whatever `modal` says (#3428):
35305
+ // `modal` applies only while an alert is presented, and `aria-modal` on a card in the screen's
35306
+ // own flow told assistive technology that every sibling was unavailable, with no way to dismiss
35307
+ // it. A presented alert is `presentation: "alert"` on a navigating Action, which the web host
35308
+ // draws as its own modal dialog.
35144
35309
  case "AlertDialog":
35145
- return /* @__PURE__ */ jsxs5("div", { role: "alertdialog", "aria-modal": isOverlayModal("AlertDialog", props.modal) ? "true" : void 0, "aria-label": props.title != null ? asBoundText(props.title, ctx) : "Alert", style: { background: C("surfacePrimary", "#fff"), borderRadius: ctx.radius("lg", 14), padding: 18, width: "100%", boxSizing: "border-box", border: `1px solid ${C("border", "#e3e3e3")}`, boxShadow: "0 12px 30px -12px rgba(0,0,0,.4)", ...wrap }, children: [
35310
+ return /* @__PURE__ */ jsxs5("div", { role: "alertdialog", "aria-label": props.title != null ? asBoundText(props.title, ctx) : "Alert", style: { background: C("surfacePrimary", "#fff"), borderRadius: ctx.radius("lg", 14), padding: 18, width: "100%", boxSizing: "border-box", border: `1px solid ${C("border", "#e3e3e3")}`, boxShadow: "0 12px 30px -12px rgba(0,0,0,.4)", ...wrap }, children: [
35146
35311
  /* @__PURE__ */ jsx8("div", { style: { fontFamily: bodyFont(ctx), fontWeight: 700, fontSize: 17, color: C("textPrimary", "#111") }, children: txt(props.title, ctx) }),
35147
35312
  /* @__PURE__ */ jsx8("div", { style: { fontFamily: bodyFont(ctx), fontSize: 14, lineHeight: 1.45, color: C("textSecondary", "#666"), margin: "6px 0 16px" }, children: txt(props.message, ctx) }),
35148
35313
  /* @__PURE__ */ jsxs5("div", { style: { display: "flex", gap: 10 }, children: [
@@ -35165,7 +35330,7 @@ function renderInner(node, ctx) {
35165
35330
  }
35166
35331
  }
35167
35332
  }
35168
- var useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, pressStylesInjected, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, ReactiveDirectScalars, HiddenGate, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, A11Y_PART, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, ButtonNode, OtpInputNode, ProgressBarNode, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, PRESENTED_OVERLAY_ATTR, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, 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, 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, WebRenderer;
35333
+ var useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, pressStylesInjected, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, ReactiveDirectScalars, HiddenGate, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MenuNode, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, 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, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, ButtonNode, OtpInputNode, ProgressBarNode, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, PRESENTED_OVERLAY_ATTR, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, 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, 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, WebRenderer;
35169
35334
  var init_renderNode = __esm({
35170
35335
  "../../core/web-renderer/src/renderNode.tsx"() {
35171
35336
  "use strict";
@@ -35328,7 +35493,7 @@ var init_renderNode = __esm({
35328
35493
  const bound = Object.entries(params).filter(
35329
35494
  ([, v]) => typeof v === "string" && v.startsWith("$service:")
35330
35495
  );
35331
- const [live2, setLive] = React7.useState(() => {
35496
+ const [live3, setLive] = React7.useState(() => {
35332
35497
  const seed2 = {};
35333
35498
  if (ctx.provider) for (const [k, p] of bound) seed2[k] = ctx.provider.value(servicePath(p));
35334
35499
  return seed2;
@@ -35342,7 +35507,7 @@ var init_renderNode = __esm({
35342
35507
  );
35343
35508
  return () => unsubs.forEach((u) => u());
35344
35509
  }, [ctx.provider, subKey]);
35345
- const resolved2 = { ...live2 };
35510
+ const resolved2 = { ...live3 };
35346
35511
  for (const [k, v] of Object.entries(params)) {
35347
35512
  if (typeof v === "string" && v.startsWith("$item")) resolved2[k] = resolveScalarStatic(v, ctx);
35348
35513
  }
@@ -35735,18 +35900,21 @@ var init_renderNode = __esm({
35735
35900
  const C = ctx.color;
35736
35901
  React7.useEffect(() => {
35737
35902
  if (!open) return;
35903
+ const onTop = () => menuRef.current != null && isWithinTopModal(menuRef.current);
35738
35904
  const onDown = (e) => {
35739
- if (hostRef.current && !hostRef.current.contains(e.target)) setOpen(false);
35905
+ if (hostRef.current && !hostRef.current.contains(e.target) && onTop()) setOpen(false);
35740
35906
  };
35741
35907
  const onKey = (e) => {
35742
- if (e.key === "Escape") setOpen(false);
35908
+ if (e.key !== "Escape" || !onTop()) return;
35909
+ e.stopPropagation();
35910
+ setOpen(false);
35743
35911
  };
35744
35912
  const kinds = ["pointerdown", "touchstart", "mousedown"];
35745
- for (const k of kinds) document.addEventListener(k, onDown);
35746
- document.addEventListener("keydown", onKey);
35913
+ for (const k of kinds) document.addEventListener(k, onDown, true);
35914
+ document.addEventListener("keydown", onKey, true);
35747
35915
  return () => {
35748
- for (const k of kinds) document.removeEventListener(k, onDown);
35749
- document.removeEventListener("keydown", onKey);
35916
+ for (const k of kinds) document.removeEventListener(k, onDown, true);
35917
+ document.removeEventListener("keydown", onKey, true);
35750
35918
  };
35751
35919
  }, [open]);
35752
35920
  const modal = isOverlayModal("Menu", props.modal);
@@ -36404,11 +36572,11 @@ var init_renderNode = __esm({
36404
36572
  const [retyped, setRetyped] = React7.useState(null);
36405
36573
  React7.useEffect(() => {
36406
36574
  if (!retypeSrc) return;
36407
- let live2 = true;
36575
+ let live3 = true;
36408
36576
  let made = null;
36409
36577
  const settle = (u) => {
36410
36578
  made = u;
36411
- if (!live2) {
36579
+ if (!live3) {
36412
36580
  if (u) URL.revokeObjectURL(u);
36413
36581
  return;
36414
36582
  }
@@ -36416,7 +36584,7 @@ var init_renderNode = __esm({
36416
36584
  };
36417
36585
  retypeAsPdf(retypeSrc).then(settle, () => settle(null));
36418
36586
  return () => {
36419
- live2 = false;
36587
+ live3 = false;
36420
36588
  if (made) URL.revokeObjectURL(made);
36421
36589
  setRetyped((cur) => cur?.from === retypeSrc ? null : cur);
36422
36590
  };
@@ -36716,12 +36884,18 @@ var init_renderNode = __esm({
36716
36884
  };
36717
36885
  const commit = (target) => {
36718
36886
  const next = Math.min(max, Math.max(min, target));
36719
- if (next === value) return;
36887
+ if (next === value) return void 0;
36720
36888
  setValue(next);
36721
36889
  setBagValue(encodeStepperFieldValue(next, { min, max }));
36722
36890
  dispatch(next);
36891
+ return next;
36723
36892
  };
36893
+ const [pressed, setPressed] = React7.useState({ text: "", count: 0 });
36724
36894
  const bump = (delta) => commit(value + delta);
36895
+ const press = (delta) => {
36896
+ const next = bump(delta);
36897
+ if (next !== void 0) setPressed((p) => ({ text: String(next), count: p.count + 1 }));
36898
+ };
36725
36899
  const onValueKeyDown = (e) => {
36726
36900
  const target = e.key === "ArrowUp" ? value + step : e.key === "ArrowDown" ? value - step : e.key === "Home" && typeof props.min === "number" ? min : e.key === "End" && typeof props.max === "number" ? max : void 0;
36727
36901
  if (target === void 0) return;
@@ -36767,9 +36941,10 @@ var init_renderNode = __esm({
36767
36941
  ] });
36768
36942
  }
36769
36943
  return /* @__PURE__ */ jsxs5("div", { ...root, style: box, children: [
36770
- /* @__PURE__ */ jsx8("button", { type: "button", tabIndex: -1, "aria-label": "Decrease", disabled: disabled("min"), onClick: () => bump(-step), style: { ...btn("min"), font: "inherit" }, children: "\u2212" }),
36944
+ /* @__PURE__ */ jsx8("button", { type: "button", tabIndex: -1, "aria-label": "Decrease", disabled: disabled("min"), onClick: () => press(-step), style: { ...btn("min"), font: "inherit" }, children: "\u2212" }),
36771
36945
  /* @__PURE__ */ jsx8("b", { ...valueA11y, "aria-valuenow": value, tabIndex: 0, onKeyDown: onValueKeyDown, style: { fontSize: 16, minWidth: 24, textAlign: "center", color: C("textPrimary", "#111"), fontVariantNumeric: "tabular-nums" }, children: value }),
36772
- /* @__PURE__ */ jsx8("button", { type: "button", tabIndex: -1, "aria-label": "Increase", disabled: disabled("max"), onClick: () => bump(step), style: { ...btn("max"), font: "inherit" }, children: "+" })
36946
+ /* @__PURE__ */ jsx8("button", { type: "button", tabIndex: -1, "aria-label": "Increase", disabled: disabled("max"), onClick: () => press(step), style: { ...btn("max"), font: "inherit" }, children: "+" }),
36947
+ /* @__PURE__ */ jsx8("span", { "aria-live": "polite", style: { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", border: 0 }, children: pressed.text + (pressed.count % 2 ? "\xA0" : "") })
36773
36948
  ] });
36774
36949
  });
36775
36950
  SYNTHETIC_TAP_ROLE = "data-hm-synthetic-role";
@@ -36780,7 +36955,6 @@ var init_renderNode = __esm({
36780
36955
  AUTHORED_ROLE = "data-hm-authored-role";
36781
36956
  PENDING_RANGE = "data-hm-pending-range";
36782
36957
  RANGE_ROLES = /* @__PURE__ */ new Set(["progressbar", "slider", "scrollbar", "spinbutton", "meter"]);
36783
- A11Y_PART = "data-hm-a11y-part";
36784
36958
  NODE_A11Y_ATTRS = ["aria-label", "aria-valuetext", "aria-level", "aria-describedby", "aria-disabled", "aria-selected"];
36785
36959
  INTERACTIVE_ROLES = /* @__PURE__ */ new Set([
36786
36960
  "button",
@@ -37321,7 +37495,8 @@ var init_renderNode = __esm({
37321
37495
  const C = ctx.color;
37322
37496
  const min = props.min ?? 0, max = props.max ?? 1;
37323
37497
  const bound = useResolvedScalar(props.valuePath, ctx);
37324
- const gRaw = props.valuePath != null ? bound : props.value;
37498
+ const gSource = props.valuePath != null ? bound : props.value;
37499
+ const gRaw = typeof gSource === "string" && gSource.trim() !== "" && Number.isFinite(Number(gSource)) ? Number(gSource) : gSource;
37325
37500
  const v = typeof gRaw === "number" ? gRaw : (min + max) / 2;
37326
37501
  const pct = max > min ? Math.max(0, Math.min(1, (v - min) / (max - min))) : 0;
37327
37502
  const tint = C(props.tint ?? "accentPrimary", "#116DFF");
@@ -37330,8 +37505,7 @@ var init_renderNode = __esm({
37330
37505
  const labelName = useBoundString(props.label, ctx).trim();
37331
37506
  const hasValue = typeof gRaw === "number" && Number.isFinite(gRaw);
37332
37507
  const named = labelName ? { "aria-label": labelName } : hasValue && max > min ? { "aria-label": `${Math.round(pct * 100)}%` } : {};
37333
- const fractionScale = min === 0 && max === 1;
37334
- const range = max > min ? { "aria-valuemin": min, "aria-valuemax": max, ...hasValue ? { "aria-valuenow": Math.max(min, Math.min(max, v)), ...fractionScale ? { "aria-valuetext": `${Math.round(pct * 100)}%` } : {} } : {} } : {};
37508
+ const range = max > min ? { "aria-valuemin": min, "aria-valuemax": max, ...hasValue ? { "aria-valuenow": Math.max(min, Math.min(max, v)), "aria-valuetext": `${Math.round(pct * 100)}%` } : {} } : {};
37335
37509
  const a11y = labelName || hasValue && max > min ? { role: "progressbar", ...named, ...range, [SELF_RENDERED_LEAF]: true } : { "aria-hidden": "true", [INFERRED_DECORATIVE]: true, [ROLE_WHEN_NAMED]: "progressbar", [PENDING_RANGE]: range, [SELF_RENDERED_LEAF]: true };
37336
37510
  if (Array.isArray(props.rings) && props.rings.length) {
37337
37511
  const size = 96, thick = 9, step = 22;
@@ -37382,7 +37556,7 @@ var init_renderNode = __esm({
37382
37556
  const size = props.size ?? 36;
37383
37557
  const maxVisible = props.maxVisible ?? 4;
37384
37558
  const shown2 = avatars.slice(0, maxVisible);
37385
- const overflow = props.overflowCount || Math.max(0, avatars.length - maxVisible);
37559
+ const overflow = (props.showOverflow ?? props.show_overflow) === false ? 0 : props.overflowCount || Math.max(0, avatars.length - maxVisible);
37386
37560
  const shift = Math.round(size * (1 - (props.overlapRatio ?? 0.67)));
37387
37561
  const caption = useBoundString(props.caption, ctx).trim();
37388
37562
  const count2 = shown2.length + overflow;
@@ -37394,7 +37568,16 @@ var init_renderNode = __esm({
37394
37568
  const ring = props.ringGradient ? ctx.gradient(props.ringGradient) : void 0;
37395
37569
  const wrapStyle = ring ? { marginLeft: i === 0 ? 0 : -(size - shift), background: ring, padding: 2.5, borderRadius: "50%" } : { marginLeft: i === 0 ? 0 : -(size - shift), border: `2px solid ${C("surfacePrimary", "#fff")}`, borderRadius: "50%" };
37396
37570
  const who = asText2(a.initials).trim();
37397
- const circle = avatarCircle(who || "?", size, C, true, bodyFont(ctx));
37571
+ const initials = avatarCircle(who || "?", size, C, true, bodyFont(ctx));
37572
+ const photo = typeof a.imageUrl === "string" && a.imageUrl && !isBinding(a.imageUrl) ? a.imageUrl : "";
37573
+ const circle = photo ? React7.cloneElement(
37574
+ initials,
37575
+ { style: { ...initials.props.style, position: "relative", overflow: "hidden" } },
37576
+ initials.props.children,
37577
+ /* @__PURE__ */ jsx8("img", { src: photo, alt: "", onError: (e) => {
37578
+ e.currentTarget.style.display = "none";
37579
+ }, style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } })
37580
+ ) : initials;
37398
37581
  return who ? /* @__PURE__ */ jsx8("div", { role: "listitem", style: wrapStyle, children: React7.cloneElement(circle, { role: "img", "aria-label": who }) }, i) : /* @__PURE__ */ jsx8("div", { "aria-hidden": "true", style: wrapStyle, children: circle }, i);
37399
37582
  }),
37400
37583
  overflow > 0 && /* @__PURE__ */ jsx8("div", { role: "listitem", style: { marginLeft: -(size - shift), width: size, height: size, borderRadius: "50%", border: `2px solid ${C("surfacePrimary", "#fff")}`, background: C("surfaceTertiary", "#e6e6e6"), color: C("textPrimary", "#111"), display: "grid", placeItems: "center", fontSize: size * 0.32, fontWeight: 700, fontFamily: bodyFont(ctx) }, children: /* @__PURE__ */ jsxs5("span", { role: "img", "aria-label": `${overflow} more`, children: [
@@ -39004,6 +39187,62 @@ __export(render_descriptor_exports, {
39004
39187
  stabilizePngPage: () => stabilizePngPage,
39005
39188
  withRetry: () => withRetry2
39006
39189
  });
39190
+ function a11ySemantics(type, props, modifiers, ancestorHidden, resolve57) {
39191
+ if (!A11Y_MODIFIER_KEYS.some((k) => modifiers[k] !== void 0)) return void 0;
39192
+ const literal = (v) => typeof v === "string" && v.trim() !== "" && !isDynamicValue(v) ? v : void 0;
39193
+ const spoken = (v) => {
39194
+ const lit = literal(v);
39195
+ if (lit !== void 0 || !resolve57 || typeof v !== "string" || !isDynamicValue(v)) return lit;
39196
+ const r = resolve57(v);
39197
+ if (r === v) return void 0;
39198
+ return typeof r === "string" && r.trim() !== "" ? r : typeof r === "number" ? String(r) : void 0;
39199
+ };
39200
+ const exposure = ancestorHidden ? "hidden" : atExposureOf({ ...props, modifiers });
39201
+ const declared = literal(modifiers.accessibilityRole);
39202
+ const inferred = (typeof modifiers.headingLevel === "number" ? "heading" : void 0) ?? (type === "SelectionControl" && props.kind === "radio" ? "radio" : void 0) ?? A11Y_CONTRACT[type]?.role ?? "unspecified";
39203
+ const role = declared === "decorative" && isInteractive({ ...props, modifiers }) ? "button" : declared ?? inferred;
39204
+ if (exposure === "hidden") return { role, exposure };
39205
+ const out2 = { role };
39206
+ const name = spoken(modifiers.accessibilityLabel) ?? ACCESSIBLE_NAME_KEYS.map((k) => spoken(props[k])).find((v) => v !== void 0);
39207
+ if (name !== void 0 && exposure === "exposed") out2.name = name;
39208
+ const hint = spoken(modifiers.accessibilityHint);
39209
+ if (hint !== void 0) out2.hint = hint;
39210
+ const value = spoken(modifiers.accessibilityValue) ?? controlState(role, props, resolve57);
39211
+ if (value !== void 0) out2.value = value;
39212
+ if (typeof modifiers.headingLevel === "number") out2.headingLevel = modifiers.headingLevel;
39213
+ if (exposure !== "exposed") out2.exposure = exposure;
39214
+ if (Array.isArray(modifiers.accessibilityTraits) && modifiers.accessibilityTraits.length) {
39215
+ out2.traits = modifiers.accessibilityTraits.map(String);
39216
+ }
39217
+ if (modifiers.initialFocus === true) out2.initialFocus = true;
39218
+ if (typeof modifiers.focusOrder === "number") out2.focusOrder = modifiers.focusOrder;
39219
+ if (modifiers.focusGroup === true) out2.focusGroup = true;
39220
+ const announce = modifiers.announce;
39221
+ if (announce && typeof announce === "object" && !Array.isArray(announce)) {
39222
+ const a = announce;
39223
+ out2.live = {
39224
+ politeness: literal(a.politeness) ?? "polite",
39225
+ trigger: literal(a.trigger) ?? "on_change",
39226
+ ...literal(a.text) !== void 0 ? { text: literal(a.text) } : {}
39227
+ };
39228
+ }
39229
+ return out2;
39230
+ }
39231
+ function controlState(role, props, resolve57) {
39232
+ if (role !== "toggle" && role !== "checkbox" && role !== "radio") return void 0;
39233
+ if (role === "checkbox" && props.indeterminate === true) return "mixed";
39234
+ const binding2 = typeof props.valuePath === "string" ? props.valuePath : typeof props.value === "string" && isDynamicValue(props.value) ? props.value : void 0;
39235
+ let on3;
39236
+ if (binding2 !== void 0) {
39237
+ const v = resolve57 ? resolve57(binding2) : void 0;
39238
+ if (v === true || v === 1 || v === "true" || v === "1") on3 = true;
39239
+ else if (v === false || v === 0 || v === "false" || v === "0") on3 = false;
39240
+ else return void 0;
39241
+ } else {
39242
+ on3 = props.value === true || props.value === "true" || props.value === void 0 && props.on === true;
39243
+ }
39244
+ return role === "toggle" ? on3 ? "on" : "off" : on3 ? "checked" : "unchecked";
39245
+ }
39007
39246
  function hiddenBool2(v) {
39008
39247
  if (typeof v === "boolean") return v;
39009
39248
  if (typeof v === "number") return v !== 0;
@@ -39084,7 +39323,7 @@ function collectNativeOnly(node) {
39084
39323
  walk2(node);
39085
39324
  return [...found].sort();
39086
39325
  }
39087
- function buildRenderTree(node, path2 = "$", provider = null, itemScope = void 0, includeRawProps = false, env = null) {
39326
+ function buildRenderTree(node, path2 = "$", provider = null, itemScope = void 0, includeRawProps = false, env = null, a11yHiddenAbove = false) {
39088
39327
  if (!node || typeof node !== "object") return null;
39089
39328
  const obj3 = node;
39090
39329
  const body = obj3.body ?? {};
@@ -39108,6 +39347,15 @@ function buildRenderTree(node, path2 = "$", provider = null, itemScope = void 0,
39108
39347
  }
39109
39348
  if (Object.keys(raw).length) out2.props = raw;
39110
39349
  }
39350
+ const a11y = a11ySemantics(
39351
+ type,
39352
+ props,
39353
+ modifiers,
39354
+ a11yHiddenAbove,
39355
+ provider ? (v) => resolveTreeScalar(v, provider, itemScope) : null
39356
+ );
39357
+ const a11yHidden = a11yHiddenAbove || modifiers.accessibilityHidden === true;
39358
+ if (a11y) out2.a11y = a11y;
39111
39359
  if (provider) {
39112
39360
  const values = {};
39113
39361
  for (const [key2, value] of Object.entries(props)) {
@@ -39146,7 +39394,7 @@ function buildRenderTree(node, path2 = "$", provider = null, itemScope = void 0,
39146
39394
  (el, i) => buildRenderTree(template, `${id}/${type}[${i}]`, provider, {
39147
39395
  ...el && typeof el === "object" ? el : { value: el },
39148
39396
  __index: i
39149
- }, includeRawProps, env)
39397
+ }, includeRawProps, env, a11yHidden)
39150
39398
  ).filter((c) => c != null);
39151
39399
  if (kids3.length) out2.children = kids3;
39152
39400
  return out2;
@@ -39162,7 +39410,7 @@ function buildRenderTree(node, path2 = "$", provider = null, itemScope = void 0,
39162
39410
  if (v && typeof v === "object") {
39163
39411
  const o = v;
39164
39412
  if (o.body && typeof o.body === "object") {
39165
- const c = buildRenderTree(o, `${id}/${type}`, provider, itemScope, includeRawProps, env);
39413
+ const c = buildRenderTree(o, `${id}/${type}`, provider, itemScope, includeRawProps, env, a11yHidden);
39166
39414
  if (c) children.push(c);
39167
39415
  } else {
39168
39416
  for (const [k, val] of Object.entries(o)) visit(val, `${p}.${k}`);
@@ -39345,12 +39593,26 @@ async function renderPngBatch(items) {
39345
39593
  });
39346
39594
  }
39347
39595
  }
39348
- var TREE_TEXT_VALUE_PROPS, asStringOrNumber, asStringOnly, asOtpCode, VALUE_PATH_TEXT, MEDIA_PLAYER_QUEUE_PROPERTIES, NATIVE_ONLY_TYPES, HOST_PAGE_FONT, pngFontCss;
39596
+ var A11Y_MODIFIER_KEYS, TREE_TEXT_VALUE_PROPS, asStringOrNumber, asStringOnly, asOtpCode, VALUE_PATH_TEXT, MEDIA_PLAYER_QUEUE_PROPERTIES, NATIVE_ONLY_TYPES, HOST_PAGE_FONT, pngFontCss;
39349
39597
  var init_render_descriptor = __esm({
39350
39598
  "../../core/dev-server/src/render-descriptor.ts"() {
39351
39599
  init_FakeServiceProvider();
39352
39600
  init_env();
39353
39601
  init_media_value();
39602
+ init_a11y_contract();
39603
+ A11Y_MODIFIER_KEYS = [
39604
+ "accessibilityLabel",
39605
+ "accessibilityRole",
39606
+ "accessibilityHint",
39607
+ "accessibilityHidden",
39608
+ "headingLevel",
39609
+ "accessibilityValue",
39610
+ "accessibilityTraits",
39611
+ "focusOrder",
39612
+ "focusGroup",
39613
+ "initialFocus",
39614
+ "announce"
39615
+ ];
39354
39616
  TREE_TEXT_VALUE_PROPS = /* @__PURE__ */ new Set(["text", "title", "label", "value", "placeholder", "message"]);
39355
39617
  asStringOrNumber = (v) => typeof v === "string" ? v : typeof v === "number" ? String(v) : void 0;
39356
39618
  asStringOnly = (v) => typeof v === "string" ? v : void 0;
@@ -40980,9 +41242,9 @@ async function handleOwnerSitesRequest(req, res) {
40980
41242
  try {
40981
41243
  const { fetchLiveOwnerSites } = await import("./apps/wix-owner-clone-live.js");
40982
41244
  const { buildWixOwnerCloneSites } = await import("./apps/wix-owner-clone-app.js");
40983
- const live2 = await fetchLiveOwnerSites();
40984
- if (live2) {
40985
- payload = { sites: live2 };
41245
+ const live3 = await fetchLiveOwnerSites();
41246
+ if (live3) {
41247
+ payload = { sites: live3 };
40986
41248
  } else {
40987
41249
  source = "fallback";
40988
41250
  payload = buildWixOwnerCloneSites();
@@ -47213,17 +47475,17 @@ async function buildFromLoaded(preloaded, dest, opts = {}) {
47213
47475
  base2 = null;
47214
47476
  } else {
47215
47477
  const counting = countingWixCall(await ensureLiveWixCall());
47216
- const live2 = await liveRenderServices(bundleJs, {
47478
+ const live3 = await liveRenderServices(bundleJs, {
47217
47479
  wixCall: counting.call,
47218
47480
  input,
47219
47481
  budgetMs: collect2.render.loadBudgetMs ?? LIVE_LOAD_BUDGET_MS,
47220
47482
  localDbSchema: appLocalDbSchema,
47221
47483
  descriptor
47222
47484
  });
47223
- base2 = live2.services;
47224
- liveCalls = [...live2.calls];
47485
+ base2 = live3.services;
47486
+ liveCalls = [...live3.calls];
47225
47487
  liveReturned = counting.returned();
47226
- liveErrors = live2.errors;
47488
+ liveErrors = live3.errors;
47227
47489
  }
47228
47490
  } else if (collect2?.render?.mocks && collect2.render.hydrate !== false && bundleName && readBuiltBundle(tier5Dir, bundleName)) {
47229
47491
  const calls = [];
@@ -49476,12 +49738,12 @@ function planFromPayload(payload, base, selectors) {
49476
49738
  }
49477
49739
  return { ok: true, plan: { patch, touched, included, rebound } };
49478
49740
  }
49479
- function regressionDiff(base, live2, touched) {
49741
+ function regressionDiff(base, live3, touched) {
49480
49742
  const moves = new Set(touched);
49481
49743
  const rows = [];
49482
- for (const id of /* @__PURE__ */ new Set([...Object.keys(live2.screens ?? {}), ...Object.keys(base.screens ?? {})])) {
49744
+ for (const id of /* @__PURE__ */ new Set([...Object.keys(live3.screens ?? {}), ...Object.keys(base.screens ?? {})])) {
49483
49745
  if (moves.has(`screen:${id}`)) continue;
49484
- const l = live2.screens?.[id];
49746
+ const l = live3.screens?.[id];
49485
49747
  const b = base.screens?.[id];
49486
49748
  if (!b) {
49487
49749
  rows.push({ item: `screen:${id}`, live: l?.descriptorHash ?? null, base: null, effect: `${id} DISAPPEARS \u2014 it was added after ${base.releaseId}` });
@@ -49495,13 +49757,13 @@ function regressionDiff(base, live2, touched) {
49495
49757
  rows.push({ item: `screen:${id}`, live: l.descriptorHash, base: b.descriptorHash, effect: `${id} reverts to its ${base.releaseId} descriptor` });
49496
49758
  continue;
49497
49759
  }
49498
- if (resolveBundleSha(live2, l.bundle) !== resolveBundleSha(base, b.bundle)) {
49499
- rows.push({ item: `screen:${id}`, live: resolveBundleSha(live2, l.bundle), base: resolveBundleSha(base, b.bundle), effect: `${id} rebinds to its ${base.releaseId} worker bundle` });
49760
+ if (resolveBundleSha(live3, l.bundle) !== resolveBundleSha(base, b.bundle)) {
49761
+ rows.push({ item: `screen:${id}`, live: resolveBundleSha(live3, l.bundle), base: resolveBundleSha(base, b.bundle), effect: `${id} rebinds to its ${base.releaseId} worker bundle` });
49500
49762
  }
49501
49763
  }
49502
49764
  const scalar4 = (key2, item, what) => {
49503
49765
  if (moves.has(item)) return;
49504
- const l = live2[key2] ?? null;
49766
+ const l = live3[key2] ?? null;
49505
49767
  const b = base[key2] ?? null;
49506
49768
  if (l !== b) rows.push({ item, live: l, base: b, effect: `${what} reverts to ${base.releaseId}` });
49507
49769
  };
@@ -49509,8 +49771,8 @@ function regressionDiff(base, live2, touched) {
49509
49771
  scalar4("appConfigHash", "app-config", "app-config");
49510
49772
  scalar4("iconHash", "icon", "the launcher icon");
49511
49773
  scalar4("minBinaryVersion", "minBinaryVersion", "the minimum binary version");
49512
- for (const name of /* @__PURE__ */ new Set([...Object.keys(live2.assets ?? {}), ...Object.keys(base.assets ?? {})])) {
49513
- const l = live2.assets?.[name]?.sha256 ?? null;
49774
+ for (const name of /* @__PURE__ */ new Set([...Object.keys(live3.assets ?? {}), ...Object.keys(base.assets ?? {})])) {
49775
+ const l = live3.assets?.[name]?.sha256 ?? null;
49514
49776
  const b = base.assets?.[name]?.sha256 ?? null;
49515
49777
  if (l === b) continue;
49516
49778
  rows.push({
@@ -49520,16 +49782,16 @@ function regressionDiff(base, live2, touched) {
49520
49782
  effect: b === null ? `asset:${name} record DISAPPEARS \u2014 references fall back to the baked copy or render empty` : `asset:${name} reverts to ${base.releaseId}`
49521
49783
  });
49522
49784
  }
49523
- for (const name of /* @__PURE__ */ new Set([...Object.keys(live2.authoringDocs ?? {}), ...Object.keys(base.authoringDocs ?? {})])) {
49524
- const l = live2.authoringDocs?.[name]?.sha256 ?? null;
49785
+ for (const name of /* @__PURE__ */ new Set([...Object.keys(live3.authoringDocs ?? {}), ...Object.keys(base.authoringDocs ?? {})])) {
49786
+ const l = live3.authoringDocs?.[name]?.sha256 ?? null;
49525
49787
  const b = base.authoringDocs?.[name]?.sha256 ?? null;
49526
49788
  if (l !== b) rows.push({ item: `doc:${name}`, live: l, base: b, effect: `${name} reverts to ${base.releaseId}` });
49527
49789
  }
49528
49790
  const PROVENANCE = /* @__PURE__ */ new Set(["releaseId", "gitSha", "shellSha", "label", "notes", "publishedAt", "publishedBy", "attestation", "forcedPastErrors"]);
49529
49791
  const REPORTED_IN_DETAIL = /* @__PURE__ */ new Set(["app", "screens", "bundles", "tokensHash", "appConfigHash", "iconHash", "minBinaryVersion", "assets", "authoringDocs"]);
49530
- for (const key2 of /* @__PURE__ */ new Set([...Object.keys(live2), ...Object.keys(base)])) {
49792
+ for (const key2 of /* @__PURE__ */ new Set([...Object.keys(live3), ...Object.keys(base)])) {
49531
49793
  if (PROVENANCE.has(key2) || REPORTED_IN_DETAIL.has(key2) || moves.has(key2)) continue;
49532
- const l = live2[key2] ?? null;
49794
+ const l = live3[key2] ?? null;
49533
49795
  const b = base[key2] ?? null;
49534
49796
  const ls = JSON.stringify(l) ?? "null";
49535
49797
  const bs = JSON.stringify(b) ?? "null";
@@ -50579,7 +50841,7 @@ async function runNotifySetup(pos, flags, io, deps = {}) {
50579
50841
  if (ownership.state !== "owned") return refuse3(io, "app_ownership_unverified", void 0, 1);
50580
50842
  input.app = ownership.slug;
50581
50843
  const common = { target, wixToken, previewTag, fetchImpl: deps.fetchImpl };
50582
- const readStatus = (live2 = false) => pushSetupRequest({ ...common, operation: "status", query: { app: input.app, site: input.site, ...live2 ? { verify: "live" } : {} } });
50844
+ const readStatus = (live3 = false) => pushSetupRequest({ ...common, operation: "status", query: { app: input.app, site: input.site, ...live3 ? { verify: "live" } : {} } });
50583
50845
  if (operation === "status") return report(await readStatus(flags.refresh === true), flags, io, dir);
50584
50846
  const previous = await readStatus();
50585
50847
  if (!previous.ok || !STATES.has(String(previous.body?.state))) return report(previous, flags, io, dir);
@@ -52575,7 +52837,7 @@ function watchReminder(dir, opts = {}) {
52575
52837
  try {
52576
52838
  if (!existsSync50(join51(dir, "himalaya.content.json"))) return void 0;
52577
52839
  const nowDate = opts.now ?? /* @__PURE__ */ new Date();
52578
- const live2 = liveWatch(dir, opts.isAlive, nowDate);
52840
+ const live3 = liveWatch(dir, opts.isAlive, nowDate);
52579
52841
  const now = nowDate.getTime();
52580
52842
  const file = join51(dir, REMINDERS_FILE);
52581
52843
  let last = Number.NaN;
@@ -52587,8 +52849,8 @@ function watchReminder(dir, opts = {}) {
52587
52849
  if (!realDirIn(dir, ".himi")) return void 0;
52588
52850
  writeFileAtomic(file, `${JSON.stringify({ watch: new Date(now).toISOString() })}
52589
52851
  `);
52590
- if (live2) {
52591
- return `the live preview is running at ${live2.url} (pid ${live2.pid}${live2.by === "init" ? ", started by himi init" : ""}) \u2014 it repaints on every save, and the build board is ${live2.board}; give the owner that link to click around while you work, and do not start another`;
52852
+ if (live3) {
52853
+ 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`;
52592
52854
  }
52593
52855
  const content = opts.content ?? displayPath(dir);
52594
52856
  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, " : "";
@@ -52635,9 +52897,9 @@ async function startWatchAtInit(dir, opts) {
52635
52897
  const note = given.length ? { note: watchOptOutIgnoredNote(given) } : {};
52636
52898
  const deps = { ...defaultStartWatchDeps, ...opts.deps };
52637
52899
  const now = opts.now ?? /* @__PURE__ */ new Date();
52638
- const live2 = liveWatch(dir, deps.isAlive, now);
52639
- if (live2 && (live2.by === "init" || await deps.previewRunning(dir))) {
52640
- return { skipped: `a live preview of this app is already running (pid ${live2.pid})`, url: live2.url, board: live2.board, pid: live2.pid, ...note };
52900
+ const live3 = liveWatch(dir, deps.isAlive, now);
52901
+ if (live3 && (live3.by === "init" || await deps.previewRunning(dir))) {
52902
+ return { skipped: `a live preview of this app is already running (pid ${live3.pid})`, url: live3.url, board: live3.board, pid: live3.pid, ...note };
52641
52903
  }
52642
52904
  try {
52643
52905
  const port = await deps.freePort(previewPortForDir(dir));
@@ -55976,9 +56238,9 @@ function makeFunctionsHandler(options) {
55976
56238
  const target = resolveTarget3(new URL(request.url).pathname);
55977
56239
  if (!target) return errorResponse(404, "not_found", "function route not found", id);
55978
56240
  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 } });
55979
- const live2 = await options.store.getManifest(target.app);
56241
+ const live3 = await options.store.getManifest(target.app);
55980
56242
  const pin = new URL(request.url).searchParams.get("release") || request.headers.get("x-himalaya-release");
55981
- let selected = live2;
56243
+ let selected = live3;
55982
56244
  if (pin && !options.previewTokenSecret) return errorResponse(501, "preview_token_unavailable", "pinned release access requires preview token validation", id);
55983
56245
  let previewClaims;
55984
56246
  if (pin && options.previewTokenSecret) {
@@ -58358,19 +58620,19 @@ function publicRecord(value) {
58358
58620
  const { archiveBase64: _archiveBase64, ...record2 } = value;
58359
58621
  return record2;
58360
58622
  }
58361
- function live(value, now) {
58623
+ function live2(value, now) {
58362
58624
  if (!value || value.revokedAt) return null;
58363
58625
  if (value.expiresAt && Date.parse(value.expiresAt) <= now.getTime()) return null;
58364
58626
  return value;
58365
58627
  }
58366
58628
  async function resolvePackageShareMetadata(store, id, now = /* @__PURE__ */ new Date()) {
58367
58629
  if (!PACKAGE_SHARE_ID_PATTERN2.test(id) || !store.getDoc) return null;
58368
- const value = live(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
58630
+ const value = live2(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
58369
58631
  return value ? publicRecord(value) : null;
58370
58632
  }
58371
58633
  async function resolvePackageShare(store, id, now = /* @__PURE__ */ new Date()) {
58372
58634
  if (!PACKAGE_SHARE_ID_PATTERN2.test(id) || !store.getDoc) return null;
58373
- const value = live(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
58635
+ const value = live2(parseStored(await store.getDoc(PACKAGE_SHARE_NAMESPACE, id), id), now);
58374
58636
  if (!value) return null;
58375
58637
  const archive = await decodeArchive(value, id);
58376
58638
  return archive ? { share: publicRecord(value), archive } : null;
@@ -58728,8 +58990,8 @@ ${releaseId}`;
58728
58990
  if (/^\/v1\/app-config\/[^/]+$/.test(url.pathname)) return drop();
58729
58991
  let servable;
58730
58992
  try {
58731
- const live2 = await manifest(app);
58732
- const eligible = live2?.releaseId === pin || await isRingRelease(app, pin);
58993
+ const live3 = await manifest(app);
58994
+ const eligible = live3?.releaseId === pin || await isRingRelease(app, pin);
58733
58995
  const pinned = eligible ? await pinnedManifest(app, pin) : null;
58734
58996
  servable = pinned !== null;
58735
58997
  const screenId = /^\/v1\/screen\/([^/]+)$/.exec(url.pathname)?.[1];
@@ -59252,7 +59514,7 @@ ${releaseId}`;
59252
59514
  if (!m) return json4(404, { error: "app_not_found", app });
59253
59515
  }
59254
59516
  const mm = m;
59255
- const readDoc = (hash, live2) => pin ? hash ? pinnedBody(app, hash, live2) : Promise.resolve(null) : live2();
59517
+ const readDoc = (hash, live3) => pin ? hash ? pinnedBody(app, hash, live3) : Promise.resolve(null) : live3();
59256
59518
  const ringPinned = pin !== null && request.headers.get(RELEASE_SOURCE_HEADER) === "ring";
59257
59519
  const cfgBytes = ringPinned ? await store.getAppConfig(app) : await readDoc(mm.appConfigHash, () => store.getAppConfig(app));
59258
59520
  if (!cfgBytes) return json4(404, { error: "app_config_not_found", app });
@@ -59282,9 +59544,9 @@ ${releaseId}`;
59282
59544
  let homeFrom = mm;
59283
59545
  let readHome = readDoc;
59284
59546
  if (ringPinned && homeScreenId && !mm.screens[homeScreenId]) {
59285
- const live2 = await manifest(app);
59286
- if (live2?.screens[homeScreenId]) {
59287
- homeFrom = live2;
59547
+ const live3 = await manifest(app);
59548
+ if (live3?.screens[homeScreenId]) {
59549
+ homeFrom = live3;
59288
59550
  readHome = (_hash, liveSlot) => liveSlot();
59289
59551
  }
59290
59552
  }
@@ -59954,21 +60216,21 @@ var init_preview_assets_generated = __esm({
59954
60216
  "../../packages/serve/src/preview-assets.generated.ts"() {
59955
60217
  init_preview_assets_format();
59956
60218
  PREVIEW_ASSET_MANIFEST = [
59957
- { key: "assets/index-CKwdlTbT.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1127499, sha256: "24d1f9f9ee47c8d4ea8f88ebfca0b78f46d3e64d26b2dd202ae97cbdcf3ede2b" },
59958
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1127507, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
59959
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1132117, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
59960
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1620701, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
59961
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1711625, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
59962
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1802609, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
59963
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1893589, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
59964
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1984461, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
59965
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2075441, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
59966
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2184077, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
59967
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2293161, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
59968
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2402209, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
59969
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2509909, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
59970
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 2598017, length: 4947, sha256: "1d32807684d4cf8de017b14f9b1c6faf05c08f04a8d5d19372d4122c0c66b0bf" },
59971
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2602964, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
60219
+ { key: "assets/index-C5pLAEVw.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1131202, sha256: "227bc4e092810f75d1b156bbef6e9409b36bd0f92370b33864ff3f309f6fe771" },
60220
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1131210, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
60221
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1135820, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
60222
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1624404, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
60223
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1715328, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
60224
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1806312, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
60225
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1897292, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
60226
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1988164, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
60227
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2079144, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
60228
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2187780, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
60229
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2296864, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
60230
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2405912, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
60231
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2513612, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
60232
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 2601720, length: 4947, sha256: "946631b440fc9601c829ef9cc7aa28a02a1ef6f0de48ac76f88cafdfcb04563c" },
60233
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2606667, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
59972
60234
  ];
59973
60235
  }
59974
60236
  });
@@ -61680,14 +61942,14 @@ function assertSameAccount(planned, current) {
61680
61942
  `the plan was made with profile "${planned.profile}" (team ${planned.team}, key ${planned.fingerprint}) but this run resolved profile "${current.profile}" (team ${current.team}, key ${current.fingerprint}). Make a new plan with the account you mean.`
61681
61943
  );
61682
61944
  }
61683
- function driftOf(planned, live2) {
61945
+ function driftOf(planned, live3) {
61684
61946
  if (planned.decision === "conflict") return void 0;
61685
- if (live2.decision === "conflict") return `${live2.productId} now conflicts: ${live2.conflicts.join("; ")}`;
61686
- const unplanned = live2.ops.filter((op) => !planned.ops.some((p) => sameOp(p, op)));
61687
- return unplanned.length ? `${live2.productId} now needs ${unplanned.map(describeOp).join(", ")}, which the plan did not list` : void 0;
61947
+ if (live3.decision === "conflict") return `${live3.productId} now conflicts: ${live3.conflicts.join("; ")}`;
61948
+ const unplanned = live3.ops.filter((op) => !planned.ops.some((p) => sameOp(p, op)));
61949
+ return unplanned.length ? `${live3.productId} now needs ${unplanned.map(describeOp).join(", ")}, which the plan did not list` : void 0;
61688
61950
  }
61689
- function assertNoDrift(plan, live2) {
61690
- const drift = [...live2].map(([i, current]) => driftOf(plan.items[i], current)).filter((d) => d !== void 0);
61951
+ function assertNoDrift(plan, live3) {
61952
+ const drift = [...live3].map(([i, current]) => driftOf(plan.items[i], current)).filter((d) => d !== void 0);
61691
61953
  if (!drift.length) return;
61692
61954
  throw new IapProvisionError("drift", `App Store Connect changed since the plan was made \u2014 nothing was written:
61693
61955
  - ${drift.join("\n - ")}
@@ -61857,27 +62119,27 @@ async function knownUnmetFor(item, planned, context) {
61857
62119
  if (!planned.observed) return [];
61858
62120
  return metadataDiffs(item, planned.observed, planned.targetPrice ?? await context.pricing.targetAmount(item.price));
61859
62121
  }
61860
- async function applyItem(item, live2, context, manifest) {
62122
+ async function applyItem(item, live3, context, manifest) {
61861
62123
  const base = { target: manifest.target, item, readAt: context.now() };
61862
- if (live2.decision === "conflict") {
61863
- const unmet2 = await knownUnmetFor(item, live2, context);
61864
- return itemResult({ ...base, observed: live2.observed, outcome: "conflict", conflicts: live2.conflicts, unmet: unmet2 });
62124
+ if (live3.decision === "conflict") {
62125
+ const unmet2 = await knownUnmetFor(item, live3, context);
62126
+ return itemResult({ ...base, observed: live3.observed, outcome: "conflict", conflicts: live3.conflicts, unmet: unmet2 });
61865
62127
  }
61866
62128
  const run2 = {
61867
62129
  item,
61868
- resourceId: live2.observed?.resourceId,
61869
- versionId: live2.observed?.draftVersionId,
61870
- localizations: live2.observed?.draftVersionId ? live2.observed.localizations : []
62130
+ resourceId: live3.observed?.resourceId,
62131
+ versionId: live3.observed?.draftVersionId,
62132
+ localizations: live3.observed?.draftVersionId ? live3.observed.localizations : []
61871
62133
  };
61872
- const steps = await runOps(run2, live2.ops, context, manifest);
62134
+ const steps = await runOps(run2, live3.ops, context, manifest);
61873
62135
  const { observed, failure } = await readBack(run2, context, manifest);
61874
62136
  const unmet = failure ? [`could not read the product back: ${failure}`] : await unmetFor(item, observed, context);
61875
- const outcome = outcomeOf(live2.ops, steps, unmet);
62137
+ const outcome = outcomeOf(live3.ops, steps, unmet);
61876
62138
  return itemResult({ ...base, readAt: context.now(), observed, outcome, steps, unmet, appleResourceId: run2.resourceId });
61877
62139
  }
61878
- function deferredResult(item, live2, context, manifest) {
61879
- const steps = live2.ops.map((op) => stepFor(op, "notRun"));
61880
- return itemResult({ target: manifest.target, item, observed: live2.observed, outcome: "deferred", steps, requirements: [DEFERRED_REQUIREMENT], readAt: context.now() });
62140
+ function deferredResult(item, live3, context, manifest) {
62141
+ const steps = live3.ops.map((op) => stepFor(op, "notRun"));
62142
+ return itemResult({ target: manifest.target, item, observed: live3.observed, outcome: "deferred", steps, requirements: [DEFERRED_REQUIREMENT], readAt: context.now() });
61881
62143
  }
61882
62144
  function needsRefresh(planned) {
61883
62145
  return planned.decision !== "conflict" && planned.ops.length > 0;
@@ -61892,12 +62154,12 @@ async function applyIap(planDoc, applyContext) {
61892
62154
  const context = { ...applyContext, pricing: applyContext.pricing ?? new PriceGrid(applyContext.api) };
61893
62155
  const manifest = plan.manifest;
61894
62156
  const refresh = plan.items.flatMap((planned, i) => needsRefresh(planned) ? [i] : []);
61895
- const live2 = await planItemsAt(context, manifest, refresh);
61896
- assertNoDrift(plan, live2);
62157
+ const live3 = await planItemsAt(context, manifest, refresh);
62158
+ assertNoDrift(plan, live3);
61897
62159
  const items = [];
61898
62160
  let created = 0;
61899
62161
  for (const [i, item] of manifest.items.entries()) {
61900
- const itemPlan2 = live2.get(i);
62162
+ const itemPlan2 = live3.get(i);
61901
62163
  if (!itemPlan2) {
61902
62164
  items.push(await plannedResult(item, plan.items[i], plan, context, manifest));
61903
62165
  continue;
@@ -74038,13 +74300,13 @@ async function snapshotAndPublish(fetchImpl, token, msid, opts = {}) {
74038
74300
  timeoutMs: 45e3,
74039
74301
  body: { label: "WIX_CLI", useUniqueLabel: true }
74040
74302
  });
74041
- const live2 = production ? await veloCall(fetchImpl, "POST", SITE_PUBLISH_URL, { token, msid, timeoutMs: 45e3, body: {} }) : void 0;
74303
+ const live3 = production ? await veloCall(fetchImpl, "POST", SITE_PUBLISH_URL, { token, msid, timeoutMs: 45e3, body: {} }) : void 0;
74042
74304
  return {
74043
74305
  revision: revisionFrom(rev.json),
74044
74306
  codeAppId: codeAppIdFromRevision(rev.json),
74045
74307
  rev,
74046
74308
  rc,
74047
- live: live2
74309
+ live: live3
74048
74310
  };
74049
74311
  }
74050
74312
  function httpOk(r) {
@@ -80273,9 +80535,9 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
80273
80535
  io.error(JSON.stringify(liveFound));
80274
80536
  return 1;
80275
80537
  }
80276
- const live2 = liveFound.manifest;
80277
- if (live2 && live2.releaseId !== base.releaseId) {
80278
- regressions = regressionDiff2(base, live2, plan.touched);
80538
+ const live3 = liveFound.manifest;
80539
+ if (live3 && live3.releaseId !== base.releaseId) {
80540
+ regressions = regressionDiff2(base, live3, plan.touched);
80279
80541
  if (regressions.length > 0 && !opts.acceptRegressions) {
80280
80542
  io.error(JSON.stringify({
80281
80543
  ok: false,
@@ -80283,7 +80545,7 @@ himi v${cliVersion()} \u2014 run \`himi --version\`. If authoring commands fail
80283
80545
  error: "would_regress",
80284
80546
  app,
80285
80547
  base: { releaseId: base.releaseId, publishedAt: base.publishedAt ?? null },
80286
- live: { releaseId: live2.releaseId, publishedAt: live2.publishedAt ?? null },
80548
+ live: { releaseId: live3.releaseId, publishedAt: live3.publishedAt ?? null },
80287
80549
  message: `a branch does not merge. Activating a release derived from ${base.releaseId} reverts every item this patch does not move.`,
80288
80550
  wouldRegress: regressions,
80289
80551
  moves: plan.touched,
@@ -81964,9 +82226,9 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
81964
82226
  const scheme = str9(flags.scheme) === "dark" ? "dark" : "light";
81965
82227
  const wantPng = flags.png === true || typeof flags.png === "string";
81966
82228
  const hydrate = flags.static !== true;
81967
- const live2 = flags.live === true;
82229
+ const live3 = flags.live === true;
81968
82230
  const strict = flags.strict === true;
81969
- if (live2 && flags.static === true) {
82231
+ if (live3 && flags.static === true) {
81970
82232
  io.error(JSON.stringify({ error: "--static and --live are mutually exclusive: --static renders raw bindings, --live renders real Wix data" }));
81971
82233
  return 2;
81972
82234
  }
@@ -81974,8 +82236,8 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
81974
82236
  io.error(JSON.stringify({ error: `--mocks takes no value (got "${String(flags.mocks)}") \u2014 pass it bare` }));
81975
82237
  return 2;
81976
82238
  }
81977
- if (flags.mocks === true && (live2 || flags.static === true)) {
81978
- io.error(JSON.stringify({ error: `--mocks and ${live2 ? "--live" : "--static"} are mutually exclusive: --mocks loads the app's recorded data, ${live2 ? "--live real Wix data" : "--static no data at all"}` }));
82239
+ if (flags.mocks === true && (live3 || flags.static === true)) {
82240
+ io.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"}` }));
81979
82241
  return 2;
81980
82242
  }
81981
82243
  if (flags.mocks === true && flags["no-mocks"] === true) {
@@ -82054,7 +82316,7 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
82054
82316
  }
82055
82317
  let mocks;
82056
82318
  let mocksNote;
82057
- const mocksByDefault = flags.mocks !== true && flags["no-mocks"] !== true && !live2 && flags.static !== true && injectedState === void 0;
82319
+ const mocksByDefault = flags.mocks !== true && flags["no-mocks"] !== true && !live3 && flags.static !== true && injectedState === void 0;
82058
82320
  if (flags.mocks === true || mocksByDefault) {
82059
82321
  let rules = null;
82060
82322
  let bad2;
@@ -82077,7 +82339,7 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
82077
82339
  ...hasWorkers ? { tier5Dir: bundleOutDir2(dir) } : {},
82078
82340
  // The settled state is always kept (printed only under --dump-state): it is what says whether
82079
82341
  // the picture landed on the screen's content or on its error, loading or empty state.
82080
- collect: { lint: true, strict, render: { screenId, scheme, png: wantPng, hydrate, dumpState: true, ...live2 ? { live: true } : {}, ...injectedState ? { state: injectedState } : {}, ...injectedInput ? { input: injectedInput } : {}, ...renderWidth ? { width: renderWidth } : {}, ...flags.rtl === true ? { rtl: true } : {}, ...loadBudgetMs ? { loadBudgetMs } : {}, ...mocks ? { mocks: { rules: mocks.rules, cmsSeed: mocks.cmsSeed } } : {} } }
82342
+ collect: { lint: true, strict, render: { screenId, scheme, png: wantPng, hydrate, dumpState: true, ...live3 ? { live: true } : {}, ...injectedState ? { state: injectedState } : {}, ...injectedInput ? { input: injectedInput } : {}, ...renderWidth ? { width: renderWidth } : {}, ...flags.rtl === true ? { rtl: true } : {}, ...loadBudgetMs ? { loadBudgetMs } : {}, ...mocks ? { mocks: { rules: mocks.rules, cmsSeed: mocks.cmsSeed } } : {} } }
82081
82343
  });
82082
82344
  const r = (outcome.renders ?? [])[0];
82083
82345
  if (!r) {
@@ -82106,11 +82368,11 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
82106
82368
  screenId,
82107
82369
  scheme,
82108
82370
  renderable: r.renderable,
82109
- hydrated: live2 ? "live" : hydrate,
82110
- dataSource: renderDataSource({ live: live2, hydrate, liveCalls: r.liveCalls, liveReturned: r.liveReturned, mocked: !!r.mockCalls }),
82371
+ hydrated: live3 ? "live" : hydrate,
82372
+ dataSource: renderDataSource({ live: live3, hydrate, liveCalls: r.liveCalls, liveReturned: r.liveReturned, mocked: !!r.mockCalls }),
82111
82373
  // What --mocks loaded from, how many requests the load made, and the ones no layer held.
82112
82374
  ...r.mockCalls && mocks ? { mocks: { used: true, from: mocks.from, calls: r.mockCalls.length, ...r.mockUnserved?.length ? { unserved: r.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: r.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 } : {} } } : {},
82113
- ...live2 ? {
82375
+ ...live3 ? {
82114
82376
  liveCalls: r.liveCalls?.length ?? 0,
82115
82377
  // Beside the attempt count, because the two coming apart IS the signal (#1883).
82116
82378
  liveReturned: r.liveReturned ?? 0,
@@ -82162,7 +82424,7 @@ ${[...afterRun.next, ...testReminder ? [testReminder] : []].join("\n")}`);
82162
82424
  if (pngFile && r.renderable) {
82163
82425
  const { recordShotState: recordShotState2, screenStateOf: screenStateOf2 } = await Promise.resolve().then(() => (init_screen_state(), screen_state_exports));
82164
82426
  const mocked = !!r.mockCalls;
82165
- landed = screenStateOf2(r.serviceState, r.html, { initial: !live2 && !mocked, offline: mocked && (r.mockUnserved?.length ?? 0) > 0 });
82427
+ landed = screenStateOf2(r.serviceState, r.html, { initial: !live3 && !mocked, offline: mocked && (r.mockUnserved?.length ?? 0) > 0 });
82166
82428
  recordShotState2(dir, screenId, pngFile, landed);
82167
82429
  }
82168
82430
  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;
@@ -83557,9 +83819,9 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
83557
83819
  await announce(running);
83558
83820
  if (watchKit && bus) {
83559
83821
  const { buildContentBundles: buildContentBundles2, buildReleaseFromContent: buildReleaseFromContent2, bundleOutDir: bundleOutDir2 } = await loadAuthoring();
83560
- const live2 = join74(running.releaseRoot, running.app);
83822
+ const live3 = join74(running.releaseRoot, running.app);
83561
83823
  const manifestOf = (tree) => JSON.parse(readFileSync90(join74(tree, "release-manifest.json"), "utf8"));
83562
- let current = manifestOf(live2);
83824
+ let current = manifestOf(live3);
83563
83825
  const failed2 = async (message) => {
83564
83826
  if (stopping) return;
83565
83827
  bus.publish("build.failed", { message });
@@ -83589,13 +83851,13 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
83589
83851
  const fresh = manifestOf(join74(next, running.app));
83590
83852
  const diff = watchKit.diffReleases(current, fresh);
83591
83853
  const { describeChanges: describeChanges2, headline: headline2 } = await Promise.resolve().then(() => (init_build_changes(), build_changes_exports));
83592
- const changes = describeChanges2(live2, join74(next, running.app), diff);
83593
- const retired = `${live2}.retired-${Date.now()}`;
83594
- renameSync9(live2, retired);
83854
+ const changes = describeChanges2(live3, join74(next, running.app), diff);
83855
+ const retired = `${live3}.retired-${Date.now()}`;
83856
+ renameSync9(live3, retired);
83595
83857
  try {
83596
- renameSync9(join74(next, running.app), live2);
83858
+ renameSync9(join74(next, running.app), live3);
83597
83859
  } catch {
83598
- cpSync3(join74(next, running.app), live2, { recursive: true });
83860
+ cpSync3(join74(next, running.app), live3, { recursive: true });
83599
83861
  }
83600
83862
  rmSync20(retired, { recursive: true, force: true });
83601
83863
  current = fresh;