@wix/himalaya-cli 0.1477.0 → 0.1479.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
@@ -653,12 +653,12 @@ function validateDataResources(data, app) {
653
653
  }
654
654
  return issues;
655
655
  }
656
- function scopePrefix(scope) {
657
- return `himi/data/${encodeURIComponent(scope.app)}/${encodeURIComponent(scope.siteId)}/${scope.environment}/`;
656
+ function scopePrefix(scope2) {
657
+ return `himi/data/${encodeURIComponent(scope2.app)}/${encodeURIComponent(scope2.siteId)}/${scope2.environment}/`;
658
658
  }
659
- function kvResourceKey(scope, store) {
659
+ function kvResourceKey(scope2, store) {
660
660
  if (!KV_NAME.test(store)) throw new Error(`KV store name must be lowercase kebab-case: ${JSON.stringify(store)}`);
661
- return `${scopePrefix(scope)}kv/${encodeURIComponent(store)}`;
661
+ return `${scopePrefix(scope2)}kv/${encodeURIComponent(store)}`;
662
662
  }
663
663
  var WIX_COLLECTION_ID_MAX_LENGTH, SAFE_APP_ID, KV_NAME;
664
664
  var init_ownership2 = __esm({
@@ -2956,8 +2956,8 @@ function currentGitUntrackedHash(contentDir2) {
2956
2956
  const absolute = realpathSync.native(unresolved);
2957
2957
  const root = repoRoot(absolute);
2958
2958
  if (!root) return sourceTreeHash(absolute);
2959
- const scope = relative(root, absolute) || ".";
2960
- const listed = execFileSync2("git", ["-C", root, "ls-files", "--others", "--exclude-standard", "-z", "--", scope], {
2959
+ const scope2 = relative(root, absolute) || ".";
2960
+ const listed = execFileSync2("git", ["-C", root, "ls-files", "--others", "--exclude-standard", "-z", "--", scope2], {
2961
2961
  encoding: "utf8",
2962
2962
  maxBuffer: GIT_HASH_MAX_BUFFER
2963
2963
  });
@@ -5064,8 +5064,8 @@ function tsExtResolvePlugin() {
5064
5064
  }
5065
5065
  };
5066
5066
  }
5067
- function importMetaUrlPlugin({ scope } = {}) {
5068
- const scopes = scope ? [.../* @__PURE__ */ new Set([realpathOrSelf(scope), resolve8(scope)])] : [];
5067
+ function importMetaUrlPlugin({ scope: scope2 } = {}) {
5068
+ const scopes = scope2 ? [.../* @__PURE__ */ new Set([realpathOrSelf(scope2), resolve8(scope2)])] : [];
5069
5069
  const inScope = (p2) => scopes.some((r3) => p2 === r3 || p2.startsWith(r3 + sep3));
5070
5070
  return {
5071
5071
  name: "himalaya-import-meta-url",
@@ -8127,7 +8127,6 @@ function resolveTranslation(value, catalog3, sourceCatalog) {
8127
8127
  var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
8128
8128
  var init_bindings = __esm({
8129
8129
  "../../core/ts/src/bindings.ts"() {
8130
- "use strict";
8131
8130
  BINDING_SIGILS = ["service", "flag", "item", "t"];
8132
8131
  BINDING_SIGIL_RE = new RegExp(
8133
8132
  `^\\$(?:${BINDING_SIGILS.filter((s2) => s2 !== "t").join("|")})\\b|^\\$t:`
@@ -10054,7 +10053,6 @@ function webViewOriginAllowed(url, origins) {
10054
10053
  }
10055
10054
  var init_webview_origin = __esm({
10056
10055
  "../../core/ts/src/webview-origin.ts"() {
10057
- "use strict";
10058
10056
  }
10059
10057
  });
10060
10058
 
@@ -11296,10 +11294,10 @@ function makeInert() {
11296
11294
  function withWorkerConsole(base, capture, now) {
11297
11295
  if (!capture) return freshNoopWorkerConsole();
11298
11296
  const sinkBase = { ...base, __himalayaSink: true };
11299
- const scope = { console: sinkBase };
11297
+ const scope2 = { console: sinkBase };
11300
11298
  try {
11301
11299
  new Function("globalThis", "console", "__himalaya_console_frames", "__himalaya_console_now", WORKER_CONSOLE_SOURCE)(
11302
- scope,
11300
+ scope2,
11303
11301
  sinkBase,
11304
11302
  BUNDLE_FILENAME,
11305
11303
  now
@@ -11325,7 +11323,7 @@ function withWorkerConsole(base, capture, now) {
11325
11323
  ])
11326
11324
  );
11327
11325
  }
11328
- return scope.console;
11326
+ return scope2.console;
11329
11327
  }
11330
11328
  function pinnedNow(clock) {
11331
11329
  return clock === void 0 ? void 0 : () => Number(clock);
@@ -16167,9 +16165,9 @@ function ensureUmbrella(contentDir2, globalPath = globalUmbrella()) {
16167
16165
  if (umbrellaInstalled(contentDir2)) return true;
16168
16166
  if (!globalPath) return false;
16169
16167
  try {
16170
- const scope = join16(contentDir2, "node_modules", "@wix");
16171
- mkdirSync8(scope, { recursive: true });
16172
- const link = join16(scope, "himalaya");
16168
+ const scope2 = join16(contentDir2, "node_modules", "@wix");
16169
+ mkdirSync8(scope2, { recursive: true });
16170
+ const link = join16(scope2, "himalaya");
16173
16171
  if (!existsSync16(link)) symlinkSync(globalPath, link, "dir");
16174
16172
  return existsSync16(join16(link, "package.json"));
16175
16173
  } catch {
@@ -20694,6 +20692,20 @@ function hexToRgb2(hex2) {
20694
20692
  const int2 = parseInt(h2, 16);
20695
20693
  return [int2 >> 16 & 255, int2 >> 8 & 255, int2 & 255];
20696
20694
  }
20695
+ function activityRingTrack(color, tint, opts = {}) {
20696
+ return color("surfaceTertiary", translucent(tint, ACTIVITY_RING_TRACK_ALPHA, opts.cssMix === true));
20697
+ }
20698
+ function translucent(color, alpha2, cssMix) {
20699
+ const c2 = color.trim();
20700
+ if (c2.startsWith("#")) return rgba(c2, alpha2);
20701
+ const m2 = /^rgba?\(\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*[,\s]\s*([\d.]+)\s*(?:[,/]\s*([\d.]+)(%?)\s*)?\)$/i.exec(c2);
20702
+ if (m2) {
20703
+ const own5 = m2[4] === void 0 ? 1 : Number(m2[4]) / (m2[5] === "%" ? 100 : 1);
20704
+ const a2 = Math.round(Math.max(0, Math.min(1, own5)) * alpha2 * 1e3) / 1e3;
20705
+ return `rgba(${Number(m2[1])}, ${Number(m2[2])}, ${Number(m2[3])}, ${a2})`;
20706
+ }
20707
+ return cssMix ? `color-mix(in srgb, ${c2} ${Math.round(alpha2 * 100)}%, transparent)` : `rgba(128, 128, 128, ${alpha2})`;
20708
+ }
20697
20709
  function rgba(color, alpha2) {
20698
20710
  let h2 = color.trim().replace(/^#/, "");
20699
20711
  let own5 = 1;
@@ -21050,7 +21062,7 @@ function makeTokenResolvers(source, scheme, idiom = WEB_IDIOM_CONTEXT) {
21050
21062
  scheme
21051
21063
  };
21052
21064
  }
21053
- var REM_ROOT_PX, pxToRem, DEFAULT_FONT_STACK, SYSTEM_FONT_STACK, SERIF_FAMILY_RE, SPRING_MIN_RESPONSE, SPRING_MAX_RESPONSE, SPRING_MIN_DAMPING, SPRING_MAX_DAMPING, clampTo, finite, SPRING_SETTLE_TOLERANCE, SPRING_MAX_SECS, springCurves, WEB_IDIOM_CONTEXT;
21065
+ var REM_ROOT_PX, pxToRem, DEFAULT_FONT_STACK, SYSTEM_FONT_STACK, SERIF_FAMILY_RE, ACTIVITY_RING_TRACK_ALPHA, SPRING_MIN_RESPONSE, SPRING_MAX_RESPONSE, SPRING_MIN_DAMPING, SPRING_MAX_DAMPING, clampTo, finite, SPRING_SETTLE_TOLERANCE, SPRING_MAX_SECS, springCurves, WEB_IDIOM_CONTEXT;
21054
21066
  var init_tokens2 = __esm({
21055
21067
  "../../core/web-renderer/src/tokens.ts"() {
21056
21068
  init_idiom();
@@ -21061,6 +21073,7 @@ var init_tokens2 = __esm({
21061
21073
  DEFAULT_FONT_STACK = '"Wix Madefor Text", system-ui';
21062
21074
  SYSTEM_FONT_STACK = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
21063
21075
  SERIF_FAMILY_RE = /\b(georgia|times|garamond|palatino|baskerville|didot|charter|bodoni|caslon|cambria|constantia|rockwell|playfair|merriweather|lora|literata|spectral|serif)\b/i;
21076
+ ACTIVITY_RING_TRACK_ALPHA = 0.2;
21064
21077
  SPRING_MIN_RESPONSE = 0.05;
21065
21078
  SPRING_MAX_RESPONSE = 10;
21066
21079
  SPRING_MIN_DAMPING = 0.1;
@@ -36473,9 +36486,9 @@ function parseTarget(target) {
36473
36486
  async function handleWixGateway(gw, app, adminUrl, req, res, wixClientId) {
36474
36487
  const url = req.url ?? "";
36475
36488
  const path2 = url.split("?")[0];
36476
- const scope = path2.startsWith("/__dev/wix/") ? "wix" : path2.startsWith("/__dev/net/") ? "net" : null;
36477
- if (!scope) return false;
36478
- const suffix = path2.slice(scope === "wix" ? "/__dev/wix/".length : "/__dev/net/".length);
36489
+ const scope2 = path2.startsWith("/__dev/wix/") ? "wix" : path2.startsWith("/__dev/net/") ? "net" : null;
36490
+ if (!scope2) return false;
36491
+ const suffix = path2.slice(scope2 === "wix" ? "/__dev/wix/".length : "/__dev/net/".length);
36479
36492
  const method = (req.method ?? "GET").toUpperCase();
36480
36493
  if (suffix === "events" && method === "GET") {
36481
36494
  res.writeHead(200, {
@@ -36529,7 +36542,7 @@ data: ${JSON.stringify({ mode: gw.mode })}
36529
36542
  return json(res, 400, { error: "invalid_json" }), true;
36530
36543
  }
36531
36544
  }
36532
- if (scope === "wix" && suffix === "frog" && method === "POST") {
36545
+ if (scope2 === "wix" && suffix === "frog" && method === "POST") {
36533
36546
  const body = await readBody(req).catch(() => "");
36534
36547
  recordWixTraffic(gw, app, adminUrl, {
36535
36548
  ts: Date.now(),
@@ -36579,7 +36592,7 @@ data: ${JSON.stringify({ mode: gw.mode })}
36579
36592
  return json(res, 200, { mode: gw.mode, rows: gw.traffic.slice(-limit) }), true;
36580
36593
  }
36581
36594
  if (suffix === "proxy") {
36582
- const hdr = (n2) => req.headers[`x-himalaya-${scope}-${n2}`] ?? "";
36595
+ const hdr = (n2) => req.headers[`x-himalaya-${scope2}-${n2}`] ?? "";
36583
36596
  const target = hdr("target");
36584
36597
  const upstreamMethod = (hdr("method") || method).toUpperCase();
36585
36598
  const capability = hdr("capability") || void 0;
@@ -36672,7 +36685,7 @@ data: ${JSON.stringify({ mode: gw.mode })}
36672
36685
  status = 0;
36673
36686
  respText = JSON.stringify({ gatewayError: String(e2?.message ?? e2) });
36674
36687
  }
36675
- if (scope === "wix" && (status === 401 || status === 403)) {
36688
+ if (scope2 === "wix" && (status === 401 || status === 403)) {
36676
36689
  try {
36677
36690
  const vt2 = await mintVisitor(wixClientId ?? WIX_DEV_CLIENT_ID);
36678
36691
  const retryHeaders = {};
@@ -38745,10 +38758,10 @@ function buildOpenApi(descriptors) {
38745
38758
  } : { "200": { description: "ok" } };
38746
38759
  paths[p2] = { [method]: { summary: summary2, responses } };
38747
38760
  }
38748
- for (const scope of ["net", "wix"]) {
38749
- paths[`/__dev/${scope}/rules`] = {
38750
- get: { summary: `Get ${scope} gateway rules.`, responses: { "200": { description: "rules" } } },
38751
- put: { summary: `Replace ${scope} gateway rules.`, responses: { "200": { description: "ok" }, "400": { description: "invalid_json" } } }
38761
+ for (const scope2 of ["net", "wix"]) {
38762
+ paths[`/__dev/${scope2}/rules`] = {
38763
+ get: { summary: `Get ${scope2} gateway rules.`, responses: { "200": { description: "rules" } } },
38764
+ put: { summary: `Replace ${scope2} gateway rules.`, responses: { "200": { description: "ok" }, "400": { description: "invalid_json" } } }
38752
38765
  };
38753
38766
  }
38754
38767
  return {
@@ -39761,8 +39774,8 @@ var init_bindings2 = __esm({
39761
39774
  const arr2 = local ? ctx.itemScope?.[itemsPath.slice("$item.".length)] : bound;
39762
39775
  const items = Array.isArray(arr2) ? arr2 : [];
39763
39776
  return /* @__PURE__ */ jsx3(Fragment, { children: items.map((item, i2) => {
39764
- const scope = item && typeof item === "object" ? { ...item, __index: i2 } : { value: item, __index: i2 };
39765
- const itemCtx = { ...ctx, itemScope: scope };
39777
+ const scope2 = item && typeof item === "object" ? { ...item, __index: i2 } : { value: item, __index: i2 };
39778
+ const itemCtx = { ...ctx, itemScope: scope2 };
39766
39779
  const key3 = item?.id ?? i2;
39767
39780
  return /* @__PURE__ */ jsx3(React2.Fragment, { children: renderRow(template, itemCtx) }, String(key3));
39768
39781
  }) });
@@ -39770,6 +39783,25 @@ var init_bindings2 = __esm({
39770
39783
  }
39771
39784
  });
39772
39785
 
39786
+ // ../../core/web-renderer/src/snackbarTiming.ts
39787
+ function snackbarAutoHideMs(durationMs) {
39788
+ const ms2 = typeof durationMs === "number" && Number.isFinite(durationMs) ? durationMs : SNACKBAR_DEFAULT_DURATION_MS;
39789
+ return ms2 > 0 ? ms2 : void 0;
39790
+ }
39791
+ function snackbarIdentity(props) {
39792
+ return JSON.stringify(
39793
+ [props.message ?? null, props.severity ?? null, props.action ?? null, props.actionLabel ?? null, props.durationMs ?? null],
39794
+ (_key, value) => value && typeof value === "object" && !Array.isArray(value) ? Object.fromEntries(Object.keys(value).sort().map((key3) => [key3, value[key3]])) : value
39795
+ );
39796
+ }
39797
+ var SNACKBAR_DEFAULT_DURATION_MS, SNACKBAR_FADE_MS;
39798
+ var init_snackbarTiming = __esm({
39799
+ "../../core/web-renderer/src/snackbarTiming.ts"() {
39800
+ SNACKBAR_DEFAULT_DURATION_MS = 4e3;
39801
+ SNACKBAR_FADE_MS = 200;
39802
+ }
39803
+ });
39804
+
39773
39805
  // ../../core/web-renderer/src/formBag.ts
39774
39806
  import React3 from "react";
39775
39807
  function hasContributed(bag, fieldId) {
@@ -41443,8 +41475,97 @@ var init_mediaFieldUpload = __esm({
41443
41475
  }
41444
41476
  });
41445
41477
 
41446
- // ../../core/web-renderer/src/a11y/controls.tsx
41478
+ // ../../core/web-renderer/src/a11y/radioGroups.ts
41479
+ function createRadioGroups() {
41480
+ const owners = /* @__PURE__ */ new Map();
41481
+ const members = /* @__PURE__ */ new Map();
41482
+ const listeners = /* @__PURE__ */ new Set();
41483
+ let seq = 0;
41484
+ const emit = () => {
41485
+ for (const l2 of [...listeners]) l2();
41486
+ };
41487
+ return {
41488
+ /** A fresh member identity — per mounted radio, not per component id (rows of one bound
41489
+ * template share an id and must each be their own member). */
41490
+ newMember() {
41491
+ seq += 1;
41492
+ return `radio-${seq}`;
41493
+ },
41494
+ owner(group) {
41495
+ return owners.get(group);
41496
+ },
41497
+ select(group, member) {
41498
+ if (owners.get(group) === member) return;
41499
+ owners.set(group, member);
41500
+ emit();
41501
+ },
41502
+ /** A mount may seed an empty group, but never replaces a live choice. */
41503
+ claimInitial(group, member, value) {
41504
+ if (value && owners.get(group) === void 0) this.select(group, member);
41505
+ },
41506
+ join(group) {
41507
+ members.set(group, (members.get(group) ?? 0) + 1);
41508
+ },
41509
+ /** `member` leaves `group`. The group's choice is forgotten when the departing member IS the
41510
+ * chosen radio (an owner that no longer exists would leave the group stuck — no live member
41511
+ * could ever be chosen again without a tap), or when no member is left. */
41512
+ leave(group, member) {
41513
+ const left = (members.get(group) ?? 1) - 1;
41514
+ if (left > 0) members.set(group, left);
41515
+ else members.delete(group);
41516
+ if ((left <= 0 || owners.get(group) === member) && owners.delete(group)) emit();
41517
+ },
41518
+ /** The DESCRIPTOR (or worker) moved `member`'s value — not a press. Turning true takes the
41519
+ * group's choice; turning false while it holds the choice releases it. Without this a choice
41520
+ * the worker moved elsewhere stayed with the old radio, and a group-mate that remounted
41521
+ * selected was turned off by it. Called on CHANGES only: a radio mounting is not a change,
41522
+ * so a lazy row scrolling back in cannot steal a choice made by a tap since. */
41523
+ adopt(group, member, value) {
41524
+ if (value) {
41525
+ this.select(group, member);
41526
+ return;
41527
+ }
41528
+ if (owners.get(group) === member && owners.delete(group)) emit();
41529
+ },
41530
+ subscribe(l2) {
41531
+ listeners.add(l2);
41532
+ return () => {
41533
+ listeners.delete(l2);
41534
+ };
41535
+ },
41536
+ /** True when `member` must turn off: its group has a chosen radio and it is another one. */
41537
+ deselects(owner, member) {
41538
+ return owner != null && owner !== member;
41539
+ },
41540
+ /** Tests only — forget every group. */
41541
+ reset() {
41542
+ owners.clear();
41543
+ members.clear();
41544
+ }
41545
+ };
41546
+ }
41547
+ var radioGroups;
41548
+ var init_radioGroups = __esm({
41549
+ "../../core/web-renderer/src/a11y/radioGroups.ts"() {
41550
+ radioGroups = createRadioGroups();
41551
+ }
41552
+ });
41553
+
41554
+ // ../../core/web-renderer/src/a11y/radioGroupScope.tsx
41447
41555
  import React6 from "react";
41556
+ var scope, RadioGroupScope, useRadioGroups;
41557
+ var init_radioGroupScope = __esm({
41558
+ "../../core/web-renderer/src/a11y/radioGroupScope.tsx"() {
41559
+ "use strict";
41560
+ init_radioGroups();
41561
+ scope = React6.createContext(radioGroups);
41562
+ RadioGroupScope = scope.Provider;
41563
+ useRadioGroups = () => React6.useContext(scope);
41564
+ }
41565
+ });
41566
+
41567
+ // ../../core/web-renderer/src/a11y/controls.tsx
41568
+ import React7 from "react";
41448
41569
  import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
41449
41570
  function labelText(label3, ctx) {
41450
41571
  if (typeof label3 === "string" && isBinding(label3)) {
@@ -41453,6 +41574,10 @@ function labelText(label3, ctx) {
41453
41574
  }
41454
41575
  return asText2(label3);
41455
41576
  }
41577
+ function sliderShouldEmit(lastEmit, now, debounceMs) {
41578
+ if (typeof debounceMs !== "number" || !(debounceMs > 0)) return false;
41579
+ return lastEmit === void 0 || now - lastEmit >= debounceMs;
41580
+ }
41456
41581
  function resolveRowAction(action, ctx) {
41457
41582
  const resolved2 = resolveItemDeep(action, ctx);
41458
41583
  if (!resolved2 || typeof resolved2 !== "object" || Array.isArray(resolved2)) return resolved2;
@@ -41473,6 +41598,7 @@ var init_controls = __esm({
41473
41598
  init_bindings2();
41474
41599
  init_icons();
41475
41600
  init_formBag();
41601
+ init_radioGroupScope();
41476
41602
  init_form_bag();
41477
41603
  useResolvedId = (v2, ctx) => {
41478
41604
  const r3 = useResolvedScalar(typeof v2 === "string" ? v2 : void 0, ctx);
@@ -41484,25 +41610,25 @@ var init_controls = __esm({
41484
41610
  const C2 = ctx.color;
41485
41611
  const bound = useResolvedScalar(props.valuePath, ctx);
41486
41612
  const resolved2 = ctx.empty ? false : props.valuePath != null ? encodeToggleFieldValue(bound) === "true" : encodeToggleFieldValue(props.value, props.on === true) === "true";
41487
- const bag = React6.useContext(FormValuesContext);
41613
+ const bag = React7.useContext(FormValuesContext);
41488
41614
  const fieldId = props.__formFieldId;
41489
41615
  const inForm = Boolean(bag && fieldId);
41490
- const [formOn, setFormOn] = React6.useState(null);
41491
- const touchedField = React6.useRef(void 0);
41492
- React6.useEffect(() => {
41616
+ const [formOn, setFormOn] = React7.useState(null);
41617
+ const touchedField = React7.useRef(void 0);
41618
+ React7.useEffect(() => {
41493
41619
  if (bag && fieldId && touchedField.current === fieldId) bag.set(fieldId, encodeToggleFieldValue(resolved2));
41494
41620
  setFormOn(null);
41495
41621
  }, [resolved2]);
41496
41622
  const toggleServiceBound = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:");
41497
41623
  const toggleReady = !toggleServiceBound || bound !== void 0;
41498
- React6.useEffect(() => {
41624
+ React7.useEffect(() => {
41499
41625
  if (!bag || !fieldId) return;
41500
41626
  if (!toggleReady && !hasContributed(bag, fieldId)) return;
41501
41627
  bag.set(fieldId, encodeToggleFieldValue(resolved2));
41502
41628
  }, [toggleReady, resolved2, fieldId, bag]);
41503
41629
  const on4 = inForm && touchedField.current === fieldId && formOn !== null ? formOn : resolved2;
41504
41630
  const ruleKey = props.validation ? JSON.stringify(props.validation) : "";
41505
- React6.useEffect(() => {
41631
+ React7.useEffect(() => {
41506
41632
  if (!bag || !fieldId) return;
41507
41633
  bag.register(fieldId, props.validation);
41508
41634
  return () => bag.unregister(fieldId);
@@ -41562,21 +41688,26 @@ var init_controls = __esm({
41562
41688
  const tint = C2(props.tint ?? "accentPrimary", "#116DFF");
41563
41689
  const step = typeof props.step === "number" && props.step > 0 ? props.step : (max - min) / 100 || 0.01;
41564
41690
  const range = props.range === true && typeof props.upperValue === "number";
41565
- const [val, setVal] = React6.useState(bound);
41566
- React6.useEffect(() => {
41691
+ const [val, setVal] = React7.useState(bound);
41692
+ const latestValue = React7.useRef(bound);
41693
+ const dragging = React7.useRef(false);
41694
+ React7.useEffect(() => {
41695
+ if (dragging.current) return;
41696
+ latestValue.current = bound;
41567
41697
  setVal(bound);
41568
41698
  }, [bound]);
41569
- const dragging = React6.useRef(false);
41699
+ const lastEmit = React7.useRef(void 0);
41570
41700
  const canFire = !!(ctx.onAction && props.onChange && !props.disabled);
41571
41701
  const commit = (nv) => {
41702
+ latestValue.current = nv;
41572
41703
  setVal(nv);
41573
41704
  if (!canFire) return;
41574
41705
  const act = resolveRowAction(props.onChange, ctx);
41575
41706
  ctx.onAction({ ...act, args: { ...act.args ?? {}, value: nv } });
41576
41707
  };
41577
41708
  const clampPct = (n2) => max > min ? Math.max(0, Math.min(1, (n2 - min) / (max - min))) : 0;
41578
- const [pair, setPair] = React6.useState(() => [Math.min(bound, props.upperValue ?? bound), Math.max(bound, props.upperValue ?? bound)]);
41579
- React6.useEffect(() => {
41709
+ const [pair, setPair] = React7.useState(() => [Math.min(bound, props.upperValue ?? bound), Math.max(bound, props.upperValue ?? bound)]);
41710
+ React7.useEffect(() => {
41580
41711
  if (range) setPair([Math.min(bound, props.upperValue), Math.max(bound, props.upperValue)]);
41581
41712
  }, [range, bound, props.upperValue]);
41582
41713
  if (range) {
@@ -41673,17 +41804,33 @@ var init_controls = __esm({
41673
41804
  if (nv === void 0) return;
41674
41805
  dragging.current = true;
41675
41806
  e2.currentTarget.setPointerCapture?.(e2.pointerId);
41807
+ latestValue.current = nv;
41676
41808
  setVal(nv);
41677
41809
  };
41678
41810
  const onPointerMove = (e2) => {
41679
41811
  if (!dragging.current) return;
41680
41812
  const nv = valueAt(e2);
41681
- if (nv !== void 0) setVal(nv);
41813
+ if (nv === void 0) return;
41814
+ latestValue.current = nv;
41815
+ setVal(nv);
41816
+ const now = Date.now();
41817
+ if (canFire && sliderShouldEmit(lastEmit.current, now, props.debounceMs)) {
41818
+ lastEmit.current = now;
41819
+ const act = resolveRowAction(props.onChange, ctx);
41820
+ ctx.onAction({ ...act, args: { ...act.args ?? {}, value: nv } });
41821
+ }
41682
41822
  };
41683
41823
  const onPointerUp = (e2) => {
41684
41824
  if (!dragging.current) return;
41685
41825
  dragging.current = false;
41686
- commit(valueAt(e2) ?? val);
41826
+ lastEmit.current = void 0;
41827
+ commit(valueAt(e2) ?? latestValue.current);
41828
+ };
41829
+ const endDragWithoutRelease = () => {
41830
+ if (!dragging.current) return;
41831
+ dragging.current = false;
41832
+ lastEmit.current = void 0;
41833
+ commit(latestValue.current);
41687
41834
  };
41688
41835
  return /* @__PURE__ */ jsx7("div", { ...{ [A11Y_PART]: "root" }, style: { width: "100%", padding: "12px 9px", boxSizing: "border-box", opacity: props.disabled ? 0.5 : 1, ...wrap }, children: /* @__PURE__ */ jsx7(
41689
41836
  "div",
@@ -41701,6 +41848,8 @@ var init_controls = __esm({
41701
41848
  onPointerDown,
41702
41849
  onPointerMove,
41703
41850
  onPointerUp,
41851
+ onPointerCancel: endDragWithoutRelease,
41852
+ onLostPointerCapture: endDragWithoutRelease,
41704
41853
  style: { position: "relative", height: 18, display: "flex", alignItems: "center", outlineOffset: 4, cursor: props.disabled ? "default" : "pointer", touchAction: "pan-y" },
41705
41854
  children: /* @__PURE__ */ jsxs4("div", { style: { position: "relative", height: 4, width: "100%", borderRadius: 999, background: C2("surfaceTertiary", "#e3e6ea") }, children: [
41706
41855
  /* @__PURE__ */ jsx7("div", { style: { position: "absolute", left: 0, width: `${pct * 100}%`, top: 0, bottom: 0, borderRadius: 999, background: tint } }),
@@ -41710,17 +41859,53 @@ var init_controls = __esm({
41710
41859
  ) });
41711
41860
  };
41712
41861
  A11ySelectionControl = ({ props, ctx, wrap }) => {
41862
+ const radioGroups2 = useRadioGroups();
41713
41863
  const C2 = ctx.color;
41714
41864
  const isRadio = props.kind === "radio";
41715
41865
  const boundValue = useResolvedScalar(props.valuePath, ctx);
41716
41866
  const raw = props.valuePath != null ? boundValue : props.value;
41717
- const on4 = ctx.empty ? false : raw === true;
41867
+ const groupId = isRadio && typeof props.groupId === "string" && props.groupId !== "" ? props.groupId : void 0;
41868
+ const [local, setLocal] = React7.useState(void 0);
41869
+ React7.useEffect(() => {
41870
+ setLocal(void 0);
41871
+ }, [raw, radioGroups2, groupId]);
41872
+ const localValue2 = local?.registry === radioGroups2 && local.groupId === groupId ? local.value : void 0;
41873
+ const on4 = ctx.empty ? false : localValue2 ?? raw === true;
41874
+ const member = React7.useMemo(() => radioGroups2.newMember(), [radioGroups2]);
41875
+ const owner = React7.useSyncExternalStore(
41876
+ radioGroups2.subscribe,
41877
+ () => groupId ? radioGroups2.owner(groupId) : void 0,
41878
+ () => void 0
41879
+ );
41880
+ React7.useEffect(() => {
41881
+ if (!groupId) return;
41882
+ radioGroups2.join(groupId);
41883
+ return () => radioGroups2.leave(groupId, member);
41884
+ }, [radioGroups2, groupId, member]);
41885
+ const seenRaw = React7.useRef(null);
41886
+ React7.useEffect(() => {
41887
+ const prev = seenRaw.current;
41888
+ seenRaw.current = { raw, groupId, registry: radioGroups2 };
41889
+ if (!groupId) return;
41890
+ if (prev === null || prev.groupId !== groupId || prev.registry !== radioGroups2) {
41891
+ radioGroups2.claimInitial(groupId, member, raw === true);
41892
+ } else if (prev.raw !== raw) {
41893
+ radioGroups2.adopt(groupId, member, raw === true);
41894
+ }
41895
+ }, [radioGroups2, raw, groupId, member]);
41896
+ React7.useEffect(() => {
41897
+ if (groupId && radioGroups2.deselects(radioGroups2.owner(groupId), member)) setLocal({ value: false, registry: radioGroups2, groupId });
41898
+ }, [radioGroups2, owner, member, groupId]);
41718
41899
  const accent = C2("accentPrimary", "#116DFF");
41719
41900
  const fire = ctx.onAction && props.onChange && !props.disabled ? (e2) => {
41720
41901
  e2?.stopPropagation?.();
41721
41902
  const act = resolveRowAction(props.onChange, ctx);
41722
41903
  const next = isRadio ? true : !on4;
41723
- ctx.onAction({ ...act, args: { ...act.args ?? {}, value: next } });
41904
+ if (isRadio) {
41905
+ setLocal({ value: true, registry: radioGroups2, groupId });
41906
+ if (groupId) radioGroups2.select(groupId, member);
41907
+ }
41908
+ ctx.onAction({ ...act, args: { ...act.args ?? {}, value: next, ...groupId ? { groupId } : {} } });
41724
41909
  } : void 0;
41725
41910
  const indeterminate = !isRadio && props.indeterminate === true && !on4;
41726
41911
  const marked = on4 || indeterminate;
@@ -41780,8 +41965,8 @@ var init_controls = __esm({
41780
41965
  const selectedId = useResolvedId(props.selectedId, ctx);
41781
41966
  const tabs = Array.isArray(boundTabs) && boundTabs.length ? boundTabs : Array.isArray(props.tabs) ? props.tabs : [];
41782
41967
  const pages2 = props.style === "swipe" ? props.swipePages : void 0;
41783
- const [local, setLocal] = React6.useState(void 0);
41784
- React6.useEffect(() => {
41968
+ const [local, setLocal] = React7.useState(void 0);
41969
+ React7.useEffect(() => {
41785
41970
  setLocal(void 0);
41786
41971
  }, [selectedId]);
41787
41972
  const current = local != null && tabs.some((t2) => t2.id === local) ? local : selectedId;
@@ -41801,15 +41986,15 @@ var init_controls = __esm({
41801
41986
  e2.preventDefault();
41802
41987
  if (ni2 !== selIdx) select2(ni2);
41803
41988
  };
41804
- const pagerRef = React6.useRef(null);
41805
- const settle = React6.useRef(void 0);
41806
- React6.useEffect(() => {
41989
+ const pagerRef = React7.useRef(null);
41990
+ const settle = React7.useRef(void 0);
41991
+ React7.useEffect(() => {
41807
41992
  const el2 = pagerRef.current;
41808
41993
  if (!el2 || !el2.clientWidth) return;
41809
41994
  const x2 = selIdx * el2.clientWidth;
41810
41995
  if (Math.abs(el2.scrollLeft - x2) > 1) el2.scrollTo?.({ left: x2, behavior: "smooth" });
41811
41996
  }, [selIdx, pages2]);
41812
- React6.useEffect(() => () => clearTimeout(settle.current), []);
41997
+ React7.useEffect(() => () => clearTimeout(settle.current), []);
41813
41998
  const onPagerScroll = () => {
41814
41999
  clearTimeout(settle.current);
41815
42000
  settle.current = setTimeout(() => {
@@ -41920,7 +42105,7 @@ var init_controls = __esm({
41920
42105
  const expanded = useResolvedScalar(props.expandedPath ?? props.expanded, ctx);
41921
42106
  const open = expanded === true;
41922
42107
  const fire = ctx.onAction && props.onToggle ? () => ctx.onAction(resolveRowAction(props.onToggle, ctx)) : void 0;
41923
- const regionId = React6.useMemo(() => `himi-disclosure-${++disclosureSeq}`, []);
42108
+ const regionId = React7.useMemo(() => `himi-disclosure-${++disclosureSeq}`, []);
41924
42109
  return /* @__PURE__ */ jsxs4("div", { style: { width: "100%", ...wrap }, children: [
41925
42110
  /* @__PURE__ */ jsxs4(
41926
42111
  "button",
@@ -41939,7 +42124,7 @@ var init_controls = __esm({
41939
42124
  ]
41940
42125
  }
41941
42126
  ),
41942
- /* @__PURE__ */ jsx7("div", { id: regionId, role: "region", hidden: !open, style: open ? { padding: "2px 2px 8px 24px" } : void 0, children: open && (Array.isArray(props.content) ? props.content.map((c2, i2) => /* @__PURE__ */ jsx7(React6.Fragment, { children: renderChild(c2) }, c2?.id ?? i2)) : renderChild(props.content)) })
42127
+ /* @__PURE__ */ jsx7("div", { id: regionId, role: "region", hidden: !open, style: open ? { padding: "2px 2px 8px 24px" } : void 0, children: open && (Array.isArray(props.content) ? props.content.map((c2, i2) => /* @__PURE__ */ jsx7(React7.Fragment, { children: renderChild(c2) }, c2?.id ?? i2)) : renderChild(props.content)) })
41943
42128
  ] });
41944
42129
  };
41945
42130
  }
@@ -42016,10 +42201,10 @@ function sync() {
42016
42201
  const all = live();
42017
42202
  if (!all.length) return;
42018
42203
  const levels = /* @__PURE__ */ new Set();
42019
- for (const scope of new Set(all.map((l2) => l2.scope))) {
42020
- const top = topOf(all.filter((l2) => l2.scope === scope), all);
42204
+ for (const scope2 of new Set(all.map((l2) => l2.scope))) {
42205
+ const top = topOf(all.filter((l2) => l2.scope === scope2), all);
42021
42206
  let node = top.el;
42022
- while (node !== scope && node.parentElement) {
42207
+ while (node !== scope2 && node.parentElement) {
42023
42208
  const parent = node.parentElement;
42024
42209
  levels.add(parent);
42025
42210
  for (const sibling of Array.from(parent.children)) {
@@ -43053,7 +43238,7 @@ var init_rich_text_field = __esm({
43053
43238
  });
43054
43239
 
43055
43240
  // ../../core/web-renderer/src/richContent.tsx
43056
- import React8 from "react";
43241
+ import React9 from "react";
43057
43242
  import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
43058
43243
  function richContentFollow(ctx, onLink) {
43059
43244
  return (url) => {
@@ -43158,7 +43343,7 @@ function Block({ b: b2, env, depth }) {
43158
43343
  minHeight: b2.spans.length ? void 0 : "1.5em"
43159
43344
  }, children: /* @__PURE__ */ jsx9(Spans, { spans: b2.spans, env }) });
43160
43345
  case "heading":
43161
- return React8.createElement(
43346
+ return React9.createElement(
43162
43347
  `h${b2.level}`,
43163
43348
  { ...tid(env, b2.id, b2.kind), style: textStyle(ctx, RICH_CONTENT_HEADING_TOKENS[b2.level - 1], text9) },
43164
43349
  /* @__PURE__ */ jsx9(Spans, { spans: b2.spans, env })
@@ -123974,7 +124159,7 @@ __export(pdfDocument_exports, {
123974
124159
  PdfDocument: () => PdfDocument,
123975
124160
  destroyPdfDocumentLoad: () => destroyPdfDocumentLoad
123976
124161
  });
123977
- import React9 from "react";
124162
+ import React10 from "react";
123978
124163
  import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
123979
124164
  async function loadPdfDocument(src, ownerDocument) {
123980
124165
  const [pdfjs, pdfWorkerAsset] = await Promise.all([
@@ -123993,18 +124178,18 @@ async function destroyPdfDocumentLoad(loading) {
123993
124178
  }
123994
124179
  }
123995
124180
  function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, style, onPageCount, onFallback, loadDocument = loadPdfDocument }) {
123996
- const [pages2, setPages] = React9.useState(0);
123997
- const [failedRequest, setFailedRequest] = React9.useState(null);
124181
+ const [pages2, setPages] = React10.useState(0);
124182
+ const [failedRequest, setFailedRequest] = React10.useState(null);
123998
124183
  const request = JSON.stringify([src, zoomPercent]);
123999
124184
  const failed3 = failedRequest === request;
124000
- const containerRef = React9.useRef(null);
124001
- const frameRef = React9.useRef(null);
124002
- const startPageRef = React9.useRef(startPage);
124185
+ const containerRef = React10.useRef(null);
124186
+ const frameRef = React10.useRef(null);
124187
+ const startPageRef = React10.useRef(startPage);
124003
124188
  startPageRef.current = startPage;
124004
- React9.useEffect(() => {
124189
+ React10.useEffect(() => {
124005
124190
  if (failed3) onFallback?.();
124006
124191
  }, [failed3, onFallback]);
124007
- React9.useEffect(() => {
124192
+ React10.useEffect(() => {
124008
124193
  const frame2 = frameRef.current;
124009
124194
  const page = Math.min(pages2, Math.max(1, Math.floor(startPage ?? 1) || 1));
124010
124195
  const canvas = pages2 ? containerRef.current?.querySelector(`[data-pdf-page="${page}"]`) : null;
@@ -124013,7 +124198,7 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
124013
124198
  const scale = frame2.offsetHeight > 0 && box.height > 0 ? box.height / frame2.offsetHeight : 1;
124014
124199
  frame2.scrollTop += (canvas.getBoundingClientRect().top - box.top) / scale;
124015
124200
  }, [startPage, pages2]);
124016
- React9.useEffect(() => {
124201
+ React10.useEffect(() => {
124017
124202
  let live3 = true;
124018
124203
  let loading;
124019
124204
  const container = containerRef.current;
@@ -124075,7 +124260,7 @@ var init_pdfDocument = __esm({
124075
124260
  });
124076
124261
 
124077
124262
  // ../../core/web-renderer/src/renderNode.tsx
124078
- import React10 from "react";
124263
+ import React11 from "react";
124079
124264
  import { createPortal } from "react-dom";
124080
124265
  import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
124081
124266
  function boundTokenName(path2, fallback, ctx) {
@@ -124167,8 +124352,8 @@ function isNumericLike(s2) {
124167
124352
  return NUMERIC_TEXT.test(s2.trim());
124168
124353
  }
124169
124354
  function useValueSwap(value, enabled) {
124170
- const prev = React10.useRef(value);
124171
- const gen = React10.useRef(0);
124355
+ const prev = React11.useRef(value);
124356
+ const gen = React11.useRef(0);
124172
124357
  if (prev.current !== value) {
124173
124358
  if (enabled && prev.current !== void 0 && value !== void 0) gen.current += 1;
124174
124359
  prev.current = value;
@@ -124236,9 +124421,9 @@ function revealOnFocusStyle(C2) {
124236
124421
  };
124237
124422
  }
124238
124423
  function FormFieldLabelIdScope({ render, fieldKey, ...extras }) {
124239
- const id = React10.useId().replace(/[^A-Za-z0-9_-]/g, "");
124424
+ const id = React11.useId().replace(/[^A-Za-z0-9_-]/g, "");
124240
124425
  const el2 = render(`${fieldKey ? `${fieldKey}-` : ""}auto-${id}`);
124241
- return Object.keys(extras).length ? React10.cloneElement(el2, extras) : el2;
124426
+ return Object.keys(extras).length ? React11.cloneElement(el2, extras) : el2;
124242
124427
  }
124243
124428
  function formFieldA11y(props) {
124244
124429
  const labelledBy = props.__labelledBy;
@@ -124862,9 +125047,9 @@ function sectionSlot(raw) {
124862
125047
  }
124863
125048
  }
124864
125049
  function useLoadingTiming(target, graceMs, floorMs) {
124865
- const [shown2, setShown] = React10.useState(() => target === "loading" && graceMs > 0 ? "pending" : target);
124866
- const loadingSince = React10.useRef(shown2 === "loading" ? Date.now() : null);
124867
- React10.useEffect(() => {
125050
+ const [shown2, setShown] = React11.useState(() => target === "loading" && graceMs > 0 ? "pending" : target);
125051
+ const loadingSince = React11.useRef(shown2 === "loading" ? Date.now() : null);
125052
+ React11.useEffect(() => {
124868
125053
  if (target === shown2) return void 0;
124869
125054
  if (target === "loading") {
124870
125055
  if (graceMs <= 0) {
@@ -124903,8 +125088,8 @@ function autoGrowBox(contentHeight, lineHeight, verticalPadding, maxLines) {
124903
125088
  function PreviewMenuOverlay({ label: label3, dialogRef, preview, ctx, onClose, anchorHost, children }) {
124904
125089
  const host = anchorHost?.closest(`[${MODAL_SCOPE_ATTR}]`) ?? (typeof document !== "undefined" ? document.body : null);
124905
125090
  const reduce = ctx.reduceMotion();
124906
- const [shown2, setShown] = React10.useState(reduce);
124907
- React10.useEffect(() => {
125091
+ const [shown2, setShown] = React11.useState(reduce);
125092
+ React11.useEffect(() => {
124908
125093
  if (reduce || typeof requestAnimationFrame !== "function") {
124909
125094
  setShown(true);
124910
125095
  return;
@@ -124913,7 +125098,7 @@ function PreviewMenuOverlay({ label: label3, dialogRef, preview, ctx, onClose, a
124913
125098
  return () => cancelAnimationFrame(raf);
124914
125099
  }, [reduce]);
124915
125100
  const inScope = host != null && host !== host.ownerDocument.body;
124916
- const previewCtx = React10.useMemo(() => ctx.onAction ? { ...ctx, onAction: (a2) => {
125101
+ const previewCtx = React11.useMemo(() => ctx.onAction ? { ...ctx, onAction: (a2) => {
124917
125102
  onClose();
124918
125103
  ctx.onAction(a2);
124919
125104
  } } : ctx, [ctx, onClose]);
@@ -124980,7 +125165,7 @@ function youtubeId(item) {
124980
125165
  }
124981
125166
  }
124982
125167
  function useResolvedMediaItems(items, ctx) {
124983
- const paths = React10.useMemo(() => {
125168
+ const paths = React11.useMemo(() => {
124984
125169
  const set = /* @__PURE__ */ new Set();
124985
125170
  for (const it2 of items) {
124986
125171
  if (!it2 || typeof it2 !== "object") continue;
@@ -124992,17 +125177,17 @@ function useResolvedMediaItems(items, ctx) {
124992
125177
  return [...set];
124993
125178
  }, [items]);
124994
125179
  const key3 = paths.join("\0");
124995
- const [values, setValues] = React10.useState(() => {
125180
+ const [values, setValues] = React11.useState(() => {
124996
125181
  const seed2 = {};
124997
125182
  if (ctx.provider) for (const p2 of paths) seed2[p2] = ctx.provider.value(p2);
124998
125183
  return seed2;
124999
125184
  });
125000
- React10.useEffect(() => {
125185
+ React11.useEffect(() => {
125001
125186
  if (!ctx.provider || paths.length === 0) return;
125002
125187
  const unsubs = paths.map((p2) => ctx.provider.subscribe(p2, (v2) => setValues((prev) => prev[p2] === v2 ? prev : { ...prev, [p2]: v2 })));
125003
125188
  return () => unsubs.forEach((u2) => u2());
125004
125189
  }, [ctx.provider, key3]);
125005
- return React10.useMemo(() => items.map((it2) => {
125190
+ return React11.useMemo(() => items.map((it2) => {
125006
125191
  if (!it2 || typeof it2 !== "object") return it2;
125007
125192
  let out2 = null;
125008
125193
  for (const f2 of MEDIA_ITEM_BINDABLE) {
@@ -125030,8 +125215,8 @@ function sourceZoomPercent(fragment) {
125030
125215
  return Number.isFinite(zoom) && zoom > 0 ? zoom : void 0;
125031
125216
  }
125032
125217
  function cloneWithKids(el2, props, kids3) {
125033
- if (kids3 === el2.props.children) return React10.cloneElement(el2, props);
125034
- return React10.cloneElement(el2, props, ...Array.isArray(kids3) ? kids3 : [kids3]);
125218
+ if (kids3 === el2.props.children) return React11.cloneElement(el2, props);
125219
+ return React11.cloneElement(el2, props, ...Array.isArray(kids3) ? kids3 : [kids3]);
125035
125220
  }
125036
125221
  function editA11yParts(node, edit) {
125037
125222
  if (Array.isArray(node)) {
@@ -125043,7 +125228,7 @@ function editA11yParts(node, edit) {
125043
125228
  });
125044
125229
  return changed ? out2 : node;
125045
125230
  }
125046
- if (!React10.isValidElement(node) || typeof node.type !== "string") return node;
125231
+ if (!React11.isValidElement(node) || typeof node.type !== "string") return node;
125047
125232
  const own5 = node.props;
125048
125233
  if (own5["data-component-id"] != null) return node;
125049
125234
  const part3 = own5[A11Y_PART];
@@ -125087,8 +125272,8 @@ function isNativeInteractiveElement(el2) {
125087
125272
  return typeof el2.type === "string" && (["button", "input", "select", "textarea"].includes(el2.type) || el2.type === "a" && typeof props.href === "string");
125088
125273
  }
125089
125274
  function hasInteractiveReactDescendant(el2) {
125090
- return React10.Children.toArray(el2.props.children).some((child) => {
125091
- if (!React10.isValidElement(child)) return false;
125275
+ return React11.Children.toArray(el2.props.children).some((child) => {
125276
+ if (!React11.isValidElement(child)) return false;
125092
125277
  if (isNativeInteractiveElement(child)) return true;
125093
125278
  const props = child.props;
125094
125279
  if (typeof child.type === "string" && typeof props.role === "string" && INTERACTIVE_ROLES.has(props.role)) return true;
@@ -125164,8 +125349,8 @@ function trackActivatorName(activator) {
125164
125349
  activatorNameObservers.set(activator, observer);
125165
125350
  }
125166
125351
  function TapActivator({ label: label3, state, tabIndex = 0, role = "button", hint, initialFocus }) {
125167
- const ref = React10.useRef(null);
125168
- const hintId = `hm-tap-hint${React10.useId()}`;
125352
+ const ref = React11.useRef(null);
125353
+ const hintId = `hm-tap-hint${React11.useId()}`;
125169
125354
  useIsomorphicLayoutEffect(() => {
125170
125355
  const el2 = ref.current;
125171
125356
  if (!el2 || label3) return;
@@ -125204,9 +125389,9 @@ function TapActivator({ label: label3, state, tabIndex = 0, role = "button", hin
125204
125389
  function withExtras(name, render) {
125205
125390
  const Wrapped = ({ props, ctx, wrap, nodeId, gap, ...pass }) => {
125206
125391
  const el2 = render({ props, ctx, wrap, nodeId, gap, nodeExtras: pass });
125207
- if (!React10.isValidElement(el2)) return /* @__PURE__ */ jsx11(Fragment4, { children: el2 });
125392
+ if (!React11.isValidElement(el2)) return /* @__PURE__ */ jsx11(Fragment4, { children: el2 });
125208
125393
  if (el2.props[NODE_EXTRAS_TARGET] === "bottom-drawer-panel") {
125209
- return React10.cloneElement(el2, { [NODE_EXTRAS_TARGET]: void 0 });
125394
+ return React11.cloneElement(el2, { [NODE_EXTRAS_TARGET]: void 0 });
125210
125395
  }
125211
125396
  const additive = addIntrinsicPadding(el2.props.style, wrap ?? {});
125212
125397
  const inferredDecorative = el2.props[INFERRED_DECORATIVE] === true;
@@ -125226,7 +125411,7 @@ function withExtras(name, render) {
125226
125411
  }, hasA11yParts ? editA11yParts(kids3, a11yPartEdit({}, false, () => {
125227
125412
  })) : kids3));
125228
125413
  }
125229
- return withCircleClipBorder(additive ? React10.cloneElement(el2, { style: additive }) : el2);
125414
+ return withCircleClipBorder(additive ? React11.cloneElement(el2, { style: additive }) : el2);
125230
125415
  }
125231
125416
  const prev = el2.props;
125232
125417
  const next = { ...pass };
@@ -125327,7 +125512,7 @@ function withExtras(name, render) {
125327
125512
  }
125328
125513
  return withCircleClipBorder(cloneWithKids(el2, next, kids3));
125329
125514
  }
125330
- return withCircleClipBorder(React10.cloneElement(el2, next));
125515
+ return withCircleClipBorder(React11.cloneElement(el2, next));
125331
125516
  };
125332
125517
  Wrapped.displayName = name;
125333
125518
  return Wrapped;
@@ -125435,7 +125620,7 @@ function overlayEdgeStyle(edge, gap) {
125435
125620
  }
125436
125621
  function useFlippedEdge(edge, open, bubbleRef, anchorRef, gap = TOOLTIP_GAP) {
125437
125622
  const initial = { edge, x: 0, y: 0, maxWidth: Infinity };
125438
- const [placed, setPlaced] = React10.useState(initial);
125623
+ const [placed, setPlaced] = React11.useState(initial);
125439
125624
  useIsomorphicLayoutEffect(() => {
125440
125625
  if (!open) {
125441
125626
  setPlaced((previous) => previous.edge === edge && previous.x === 0 && previous.y === 0 && previous.maxWidth === Infinity ? previous : initial);
@@ -125984,10 +126169,10 @@ function calKeyActivate(enabled, activate) {
125984
126169
  function focusRootOf(el2) {
125985
126170
  return el2.closest(`[${MODAL_SCOPE_ATTR}]`) ?? el2.ownerDocument.body;
125986
126171
  }
125987
- function focusBelongsTo(active, scope) {
126172
+ function focusBelongsTo(active, scope2) {
125988
126173
  if (active == null || active === active.ownerDocument.body) return true;
125989
126174
  const from = focusRootOf(active);
125990
- return from === focusRootOf(scope) || from === active.ownerDocument.body;
126175
+ return from === focusRootOf(scope2) || from === active.ownerDocument.body;
125991
126176
  }
125992
126177
  function focusRootState(root) {
125993
126178
  let state = focusRoots.get(root);
@@ -125997,13 +126182,13 @@ function focusRootState(root) {
125997
126182
  }
125998
126183
  return state;
125999
126184
  }
126000
- function restoreFocusOnDismiss(scope, opener) {
126001
- const doc = scope.ownerDocument;
126185
+ function restoreFocusOnDismiss(scope2, opener) {
126186
+ const doc = scope2.ownerDocument;
126002
126187
  const Observer = doc.defaultView?.MutationObserver;
126003
126188
  if (!Observer) return;
126004
- const root = focusRootOf(scope);
126189
+ const root = focusRootOf(scope2);
126005
126190
  const state = focusRootState(root);
126006
- state.openers.set(scope, opener);
126191
+ state.openers.set(scope2, opener);
126007
126192
  if (state.observer) return;
126008
126193
  const observer = new Observer(() => {
126009
126194
  for (const [s2, o2] of state.openers) {
@@ -126032,11 +126217,11 @@ function ensureInitialFocusRuntime() {
126032
126217
  let presented;
126033
126218
  let presentedScope = null;
126034
126219
  for (const t2 of fresh) {
126035
- const scope = t2.closest(PRESENTED_SCOPE);
126036
- if (!scope || active && scope.contains(active)) continue;
126037
- if (!unplaced && !focusBelongsTo(active, scope)) continue;
126220
+ const scope2 = t2.closest(PRESENTED_SCOPE);
126221
+ if (!scope2 || active && scope2.contains(active)) continue;
126222
+ if (!unplaced && !focusBelongsTo(active, scope2)) continue;
126038
126223
  presented = t2;
126039
- presentedScope = scope;
126224
+ presentedScope = scope2;
126040
126225
  }
126041
126226
  for (const t2 of fresh) focusRootState(focusRootOf(t2)).seen.add(t2);
126042
126227
  const el2 = presented ?? (unplaced ? fresh[0] : void 0);
@@ -126051,13 +126236,13 @@ function ensureInitialFocusRuntime() {
126051
126236
  }
126052
126237
  function enterAuthoredOrderOnTab(target) {
126053
126238
  const doc = target.ownerDocument;
126054
- const scope = target.closest(PRESENTED_SCOPE);
126239
+ const scope2 = target.closest(PRESENTED_SCOPE);
126055
126240
  const renderRoot = focusRootOf(target);
126056
- const root = scope ?? renderRoot;
126241
+ const root = scope2 ?? renderRoot;
126057
126242
  const onKeyDown = (e2) => {
126058
126243
  if (e2.key !== "Tab" || e2.shiftKey || e2.altKey || e2.ctrlKey || e2.metaKey || e2.defaultPrevented || e2.target !== target) return;
126059
126244
  if (target.tabIndex > 0) return;
126060
- const ordered = Array.from(root.querySelectorAll("[tabindex]")).filter((c2) => c2.tabIndex > 0 && c2.closest(PRESENTED_SCOPE) === scope && focusRootOf(c2) === renderRoot).sort((a2, b2) => a2.tabIndex - b2.tabIndex);
126245
+ const ordered = Array.from(root.querySelectorAll("[tabindex]")).filter((c2) => c2.tabIndex > 0 && c2.closest(PRESENTED_SCOPE) === scope2 && focusRootOf(c2) === renderRoot).sort((a2, b2) => a2.tabIndex - b2.tabIndex);
126061
126246
  for (const c2 of ordered) {
126062
126247
  c2.focus();
126063
126248
  if (doc.activeElement === c2) {
@@ -126207,7 +126392,7 @@ function renderNodeInner(node, ctx) {
126207
126392
  }
126208
126393
  }
126209
126394
  const el2 = renderInner(node, ctx);
126210
- if (!React10.isValidElement(el2)) return el2;
126395
+ if (!React11.isValidElement(el2)) return el2;
126211
126396
  const extra = {};
126212
126397
  const componentId = resolvedComponentId(node?.id, ctx);
126213
126398
  if (componentId) {
@@ -126381,8 +126566,8 @@ function renderNodeInner(node, ctx) {
126381
126566
  const finalStyle = extra.style ?? el2.props.style;
126382
126567
  if (!finalStyle?.position) extra.style = { ...finalStyle ?? {}, position: "relative" };
126383
126568
  }
126384
- let out2 = tapActivator ? React10.cloneElement(el2, extra, tapActivator, el2.props.children) : Object.keys(extra).length ? React10.cloneElement(el2, extra) : el2;
126385
- if (React10.isValidElement(out2)) out2 = withCircleClipBorder(out2);
126569
+ let out2 = tapActivator ? React11.cloneElement(el2, extra, tapActivator, el2.props.children) : Object.keys(extra).length ? React11.cloneElement(el2, extra) : el2;
126570
+ if (React11.isValidElement(out2)) out2 = withCircleClipBorder(out2);
126386
126571
  if (a11yHint && !tapActivator) {
126387
126572
  out2 = /* @__PURE__ */ jsx11(A11yHintDescription, { hint: a11yHint, idBase: componentId, children: out2 });
126388
126573
  }
@@ -126599,10 +126784,10 @@ function renderInner(node, ctx) {
126599
126784
  template: items[0],
126600
126785
  renderRow: (t2, ic) => {
126601
126786
  let row = renderNode(t2, asItem(ic));
126602
- if (boundStagger > 0 && React10.isValidElement(row)) {
126787
+ if (boundStagger > 0 && React11.isValidElement(row)) {
126603
126788
  const i2 = Number(ic.itemScope?.__index ?? 0);
126604
126789
  const prev = row.props.style ?? {};
126605
- row = React10.cloneElement(row, { style: { ...prev, animationDelay: `${i2 * boundStagger}ms` } });
126790
+ row = React11.cloneElement(row, { style: { ...prev, animationDelay: `${i2 * boundStagger}ms` } });
126606
126791
  }
126607
126792
  if (boundSwipe && ctx.onAction && !props.horizontal) {
126608
126793
  const leading = resolveSwipeActions(boundSwipe.leading, ic);
@@ -126662,7 +126847,7 @@ function renderInner(node, ctx) {
126662
126847
  if (swipe && ctx.onAction && !props.horizontal) {
126663
126848
  const leading = swipe.leading ?? [];
126664
126849
  const trailing = swipe.trailing ?? [];
126665
- const arr2 = React10.Children.toArray(rendered);
126850
+ const arr2 = React11.Children.toArray(rendered);
126666
126851
  body = arr2.map((child, i2) => /* @__PURE__ */ jsx11(
126667
126852
  SwipeRow,
126668
126853
  {
@@ -127122,14 +127307,8 @@ function renderInner(node, ctx) {
127122
127307
  // ───────────── feedback ─────────────
127123
127308
  case "Banner":
127124
127309
  return /* @__PURE__ */ jsx11(BannerNode, { props, ctx, wrap });
127125
- case "Snackbar": {
127126
- const dot = sevColor(ctx, props.severity ?? "info");
127127
- return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 10, background: "#1c1f26", color: "#fff", borderRadius: ctx.radius("md", 10), padding: "12px 14px", width: "100%", boxSizing: "border-box", fontFamily: bodyFont(ctx), fontWeight: 500, fontSize: pxToRem(14), ...wrap }, children: [
127128
- /* @__PURE__ */ jsx11("span", { style: { width: 18, height: 18, borderRadius: "50%", background: dot, display: "grid", placeItems: "center", fontSize: 11, flex: "none" }, children: "\u2713" }),
127129
- /* @__PURE__ */ jsx11("span", { style: { flex: 1, minWidth: 0 }, children: txt(props.message, ctx) }),
127130
- actionTextButton(ctx, props.action, asBoundText(props.actionLabel, ctx) || "Take action", "#fff", { flex: "none", textDecoration: "underline" })
127131
- ] });
127132
- }
127310
+ case "Snackbar":
127311
+ return /* @__PURE__ */ jsx11(SnackbarNode, { props, ctx, wrap });
127133
127312
  // RFC 0058 §4 — an INLINE card, drawn where the descriptor puts it, as iOS (`AlertDialogPreview`)
127134
127313
  // and Android (`SDUIAlertDialogPreview`) draw it. It is not presented over the screen, so a
127135
127314
  // screen that shows one inline (a cart's high-value confirm, a component gallery) keeps the rest
@@ -127171,7 +127350,7 @@ function reportUnknownComponent(ctx, pkg, type) {
127171
127350
  function unknownComponentShowsDeveloperLabel(ctx) {
127172
127351
  return ctx.debugUnknownComponents ?? ctx.previewSurface != null;
127173
127352
  }
127174
- var loadPdfFetch, useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, 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, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_LONG_PRESS_MS, MenuNode, 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, ButtonNode, OtpInputNode, ProgressBarNode, ACTIVITY_DEFAULT_NAME, 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, ShapeNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, 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, 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, reportedUnknownComponents, UnknownComponentNode, WebRenderer;
127353
+ var loadPdfFetch, useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, 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, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_LONG_PRESS_MS, MenuNode, 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, 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, ShapeNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, 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, 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, reportedUnknownComponents, UnknownComponentNode, WebRenderer;
127175
127354
  var init_renderNode = __esm({
127176
127355
  "../../core/web-renderer/src/renderNode.tsx"() {
127177
127356
  "use strict";
@@ -127183,6 +127362,7 @@ var init_renderNode = __esm({
127183
127362
  init_shape();
127184
127363
  init_helpers();
127185
127364
  init_bindings2();
127365
+ init_snackbarTiming();
127186
127366
  init_bindings();
127187
127367
  init_tokens();
127188
127368
  init_message_format();
@@ -127215,11 +127395,11 @@ var init_renderNode = __esm({
127215
127395
  init_rich_text_field();
127216
127396
  init_richContent();
127217
127397
  loadPdfFetch = () => Promise.resolve().then(() => (init_pdfFetch(), pdfFetch_exports));
127218
- useIsomorphicLayoutEffect = typeof globalThis.document === "undefined" ? React10.useEffect : React10.useLayoutEffect;
127398
+ useIsomorphicLayoutEffect = typeof globalThis.document === "undefined" ? React11.useEffect : React11.useLayoutEffect;
127219
127399
  ResponsiveGrid = ({ base, medium, expanded, initialCols, seedWidth, spacing, extra, children }) => {
127220
- const ref = React10.useRef(null);
127221
- const [cols, setCols] = React10.useState(initialCols);
127222
- React10.useEffect(() => {
127400
+ const ref = React11.useRef(null);
127401
+ const [cols, setCols] = React11.useState(initialCols);
127402
+ React11.useEffect(() => {
127223
127403
  const el2 = ref.current;
127224
127404
  if (!el2) return;
127225
127405
  const measure2 = () => {
@@ -127246,9 +127426,9 @@ var init_renderNode = __esm({
127246
127426
  SPLIT_EXPANDED_MIN_WIDTH = 840;
127247
127427
  SPLIT_COLUMN_GAP = 16;
127248
127428
  ResponsiveSplitView = ({ primary, detail, primaryMaxWidth, initialWide, seedWidth, extra }) => {
127249
- const ref = React10.useRef(null);
127250
- const [wide, setWide] = React10.useState(initialWide);
127251
- React10.useEffect(() => {
127429
+ const ref = React11.useRef(null);
127430
+ const [wide, setWide] = React11.useState(initialWide);
127431
+ React11.useEffect(() => {
127252
127432
  const el2 = ref.current;
127253
127433
  if (!el2) return;
127254
127434
  const measure2 = () => {
@@ -127294,9 +127474,9 @@ var init_renderNode = __esm({
127294
127474
  revealRuntimeInjected = false;
127295
127475
  AMBIENT_HOST_STYLE = { display: "contents" };
127296
127476
  AmbientMotionBox = ({ spec, kind, children }) => {
127297
- const ref = React10.useRef(null);
127477
+ const ref = React11.useRef(null);
127298
127478
  const { minGapMs, maxGapMs } = spec;
127299
- React10.useEffect(() => {
127479
+ React11.useEffect(() => {
127300
127480
  const el2 = ref.current?.firstElementChild;
127301
127481
  if (!el2 || typeof el2.animate !== "function") return;
127302
127482
  let timer;
@@ -127378,14 +127558,14 @@ var init_renderNode = __esm({
127378
127558
  }
127379
127559
  };
127380
127560
  bodyFont = (ctx) => fontStack(ctx.font("body").family, ctx.idiom);
127381
- kids2 = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React10.Fragment, { children: renderNode(n2, ctx) }, n2?.id ?? i2)) : null;
127561
+ kids2 = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React11.Fragment, { children: renderNode(n2, ctx) }, n2?.id ?? i2)) : null;
127382
127562
  rowKidCtx = (n2, ctx) => wantsRowStretch(n2) ? { ...ctx, rowStretch: true } : normalize(n2).type === "Divider" ? { ...ctx, rowDivider: true } : ctx;
127383
- rowKids = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React10.Fragment, { children: renderNode(n2, rowKidCtx(n2, ctx)) }, n2?.id ?? i2)) : null;
127563
+ rowKids = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React11.Fragment, { children: renderNode(n2, rowKidCtx(n2, ctx)) }, n2?.id ?? i2)) : null;
127384
127564
  staggeredKids = (arr2, ctx, staggerMs) => Array.isArray(arr2) ? arr2.map((n2, i2) => {
127385
127565
  const el2 = renderNode(n2, ctx);
127386
- if (!React10.isValidElement(el2)) return /* @__PURE__ */ jsx11(React10.Fragment, { children: el2 }, n2?.id ?? i2);
127566
+ if (!React11.isValidElement(el2)) return /* @__PURE__ */ jsx11(React11.Fragment, { children: el2 }, n2?.id ?? i2);
127387
127567
  const prev = el2.props.style ?? {};
127388
- return React10.cloneElement(el2, { key: n2?.id ?? i2, style: { ...prev, animationDelay: `${i2 * staggerMs}ms` } });
127568
+ return React11.cloneElement(el2, { key: n2?.id ?? i2, style: { ...prev, animationDelay: `${i2 * staggerMs}ms` } });
127389
127569
  }) : null;
127390
127570
  asTextL10n = (v2, ctx) => typeof v2 === "string" && v2.startsWith(TRANSLATION_PREFIX) ? asText2(resolveTranslation(v2, ctx.catalog)) : asText2(v2);
127391
127571
  asFinalTextL10n = (v2, ctx) => typeof v2 === "string" ? v2.startsWith(TRANSLATION_PREFIX) ? asText2(resolveTranslation(v2, ctx.catalog)) : v2 : asText2(v2);
@@ -127398,13 +127578,13 @@ var init_renderNode = __esm({
127398
127578
  const bound = Object.entries(params).filter(
127399
127579
  ([, v2]) => typeof v2 === "string" && v2.startsWith("$service:")
127400
127580
  );
127401
- const [live3, setLive] = React10.useState(() => {
127581
+ const [live3, setLive] = React11.useState(() => {
127402
127582
  const seed2 = {};
127403
127583
  if (ctx.provider) for (const [k2, p2] of bound) seed2[k2] = ctx.provider.value(servicePath(p2));
127404
127584
  return seed2;
127405
127585
  });
127406
127586
  const subKey = bound.map(([k2, p2]) => `${k2}=${p2}`).join("|");
127407
- React10.useEffect(() => {
127587
+ React11.useEffect(() => {
127408
127588
  const provider = ctx.provider;
127409
127589
  if (!provider) return;
127410
127590
  const unsubs = bound.map(
@@ -127446,11 +127626,11 @@ var init_renderNode = __esm({
127446
127626
  fragmentSlotContent = ({ props, ctx, discriminator, slotId, extra }) => {
127447
127627
  const selected = selectFragmentCase(props, discriminator);
127448
127628
  const selectedId = typeof selected?.id === "string" ? selected.id : "";
127449
- const previousId = React10.useRef(selectedId);
127450
- const reportedUnknown = React10.useRef(/* @__PURE__ */ new Set());
127451
- const reportedInvalid = React10.useRef(/* @__PURE__ */ new Set());
127452
- const [announcement, setAnnouncement] = React10.useState("");
127453
- React10.useEffect(() => {
127629
+ const previousId = React11.useRef(selectedId);
127630
+ const reportedUnknown = React11.useRef(/* @__PURE__ */ new Set());
127631
+ const reportedInvalid = React11.useRef(/* @__PURE__ */ new Set());
127632
+ const [announcement, setAnnouncement] = React11.useState("");
127633
+ React11.useEffect(() => {
127454
127634
  if (typeof discriminator === "string") {
127455
127635
  if (discriminator && !props.cases?.some((candidate) => candidate.id === discriminator) && !reportedUnknown.current.has(discriminator)) {
127456
127636
  reportedUnknown.current.add(discriminator);
@@ -127464,7 +127644,7 @@ var init_renderNode = __esm({
127464
127644
  }
127465
127645
  }
127466
127646
  }, [ctx, discriminator, props.cases, slotId]);
127467
- React10.useEffect(() => {
127647
+ React11.useEffect(() => {
127468
127648
  if (previousId.current !== selectedId) {
127469
127649
  const next = selected?.accessibilityAnnouncement ?? selected?.accessibility_announcement;
127470
127650
  setAnnouncement(typeof next === "string" ? next : "");
@@ -127478,7 +127658,7 @@ var init_renderNode = __esm({
127478
127658
  // and the right edge clips (branded-lite's home is a FragmentSlot → 32px cut in
127479
127659
  // the phone preview). Included before ...extra so a modifier can still override.
127480
127660
  /* @__PURE__ */ jsxs8("div", { "data-fragment-slot": slotId ?? "", "data-fragment-case": selectedId, style: { width: "100%", boxSizing: "border-box", ...extra }, children: [
127481
- selected?.content ? /* @__PURE__ */ jsx11(React10.Fragment, { children: renderNode(selected.content, ctx) }, selectedId) : null,
127661
+ selected?.content ? /* @__PURE__ */ jsx11(React11.Fragment, { children: renderNode(selected.content, ctx) }, selectedId) : null,
127482
127662
  /* @__PURE__ */ jsx11("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: announcement })
127483
127663
  ] })
127484
127664
  );
@@ -127499,11 +127679,11 @@ var init_renderNode = __esm({
127499
127679
  const fallbackPathStr = mediaFieldServicePath(props.fallbackTextPath);
127500
127680
  const fallbackBound = useBoundValue(ctx, fallbackPathStr ? String(props.fallbackTextPath) : "");
127501
127681
  const fallbackText = typeof fallbackBound === "string" ? fallbackBound : "";
127502
- const [uploading, setUploading] = React10.useState(false);
127503
- const [failed3, setFailed] = React10.useState(false);
127504
- const fileRef = React10.useRef(null);
127505
- const previewRef = React10.useRef(null);
127506
- const [localPreview, setLocalPreview] = React10.useState("");
127682
+ const [uploading, setUploading] = React11.useState(false);
127683
+ const [failed3, setFailed] = React11.useState(false);
127684
+ const fileRef = React11.useRef(null);
127685
+ const previewRef = React11.useRef(null);
127686
+ const [localPreview, setLocalPreview] = React11.useState("");
127507
127687
  const uploadService = typeof props.uploadService === "string" ? props.uploadService : "";
127508
127688
  const resolvedLabel = asText2(resolveScalarStatic(props.label, ctx));
127509
127689
  const name = mediaFieldName(resolvedLabel);
@@ -127548,7 +127728,7 @@ var init_renderNode = __esm({
127548
127728
  setUploading(false);
127549
127729
  }
127550
127730
  };
127551
- React10.useEffect(() => () => {
127731
+ React11.useEffect(() => () => {
127552
127732
  const previewUrl = previewRef.current;
127553
127733
  if (previewUrl && typeof URL.revokeObjectURL === "function") URL.revokeObjectURL(previewUrl);
127554
127734
  previewRef.current = null;
@@ -127620,7 +127800,7 @@ var init_renderNode = __esm({
127620
127800
  const value = useBoundValue(ctx, typeof path2 === "string" ? path2 : "");
127621
127801
  const policy = props.policy;
127622
127802
  const catalog3 = ctx.provider && typeof ctx.provider.listActions === "function" ? ctx.provider : null;
127623
- const validation = React10.useMemo(() => {
127803
+ const validation = React11.useMemo(() => {
127624
127804
  if (value === void 0 || value === null) return { ok: false, reason: "unresolved" };
127625
127805
  if (typeof value !== "string") return { ok: false, reason: "value_type" };
127626
127806
  if (!policy || typeof policy !== "object") return { ok: false, reason: "typed_decode" };
@@ -127630,8 +127810,8 @@ var init_renderNode = __esm({
127630
127810
  return { ok: false, reason: "typed_decode" };
127631
127811
  }
127632
127812
  }, [catalog3, policy, slotId, value]);
127633
- const reported = React10.useRef(/* @__PURE__ */ new Set());
127634
- React10.useEffect(() => {
127813
+ const reported = React11.useRef(/* @__PURE__ */ new Set());
127814
+ React11.useEffect(() => {
127635
127815
  const key3 = validation.ok ? `ok:${validation.treeHash}` : `bad:${validation.treeHash ?? validation.reason}`;
127636
127816
  if (reported.current.has(key3)) return;
127637
127817
  reported.current.add(key3);
@@ -127660,10 +127840,10 @@ var init_renderNode = __esm({
127660
127840
  const hasPath = typeof path2 === "string" && path2 !== "";
127661
127841
  const bound = useResolvedScalar(hasPath ? path2 : void 0, ctx);
127662
127842
  const raw = hasPath ? bound : props.documentJson ?? props.document_json;
127663
- const result = React10.useMemo(() => layoutRichContentValue(raw), [raw]);
127843
+ const result = React11.useMemo(() => layoutRichContentValue(raw), [raw]);
127664
127844
  const reason = result && "rejected" in result ? result.rejected : void 0;
127665
- const reported = React10.useRef(/* @__PURE__ */ new Set());
127666
- React10.useEffect(() => {
127845
+ const reported = React11.useRef(/* @__PURE__ */ new Set());
127846
+ React11.useEffect(() => {
127667
127847
  if (!reason) return;
127668
127848
  const key3 = typeof raw === "string" ? `${reason}:${raw.length}:${richContentDocumentHash(raw)}` : `${reason}:non-string`;
127669
127849
  if (reported.current.has(key3)) return;
@@ -127757,17 +127937,17 @@ var init_renderNode = __esm({
127757
127937
  };
127758
127938
  withRootStyle = (content, style) => {
127759
127939
  if (Array.isArray(content)) return content.map((child) => withRootStyle(child, style));
127760
- if (!React10.isValidElement(content)) return content;
127761
- if (content.type === React10.Fragment) {
127762
- return React10.cloneElement(content, {}, React10.Children.map(content.props.children, (child) => withRootStyle(child, style)));
127940
+ if (!React11.isValidElement(content)) return content;
127941
+ if (content.type === React11.Fragment) {
127942
+ return React11.cloneElement(content, {}, React11.Children.map(content.props.children, (child) => withRootStyle(child, style)));
127763
127943
  }
127764
127944
  const element = content;
127765
- return React10.cloneElement(element, { style: { ...element.props.style, ...style } });
127945
+ return React11.cloneElement(element, { style: { ...element.props.style, ...style } });
127766
127946
  };
127767
127947
  ReactiveDirectScalars = ({ node, ctx, bindings, style }) => {
127768
- const [, rerender] = React10.useState(0);
127948
+ const [, rerender] = React11.useState(0);
127769
127949
  const bindingKey = bindings.join("|");
127770
- React10.useEffect(() => {
127950
+ React11.useEffect(() => {
127771
127951
  if (!ctx.provider) return;
127772
127952
  const unsubs = bindings.map((binding2) => ctx.provider.subscribe(servicePath(binding2), () => rerender((n2) => n2 + 1)));
127773
127953
  return () => unsubs.forEach((unsubscribe) => unsubscribe());
@@ -127780,14 +127960,14 @@ var init_renderNode = __esm({
127780
127960
  return /* @__PURE__ */ jsx11(ExitPresence, { hidden: hiddenBool(v2), exit: exit ?? null, children });
127781
127961
  };
127782
127962
  ExitPresence = ({ hidden, exit, children }) => {
127783
- const [prevHidden, setPrevHidden] = React10.useState(hidden);
127784
- const [exiting, setExiting] = React10.useState(false);
127963
+ const [prevHidden, setPrevHidden] = React11.useState(hidden);
127964
+ const [exiting, setExiting] = React11.useState(false);
127785
127965
  if (hidden !== prevHidden) {
127786
127966
  setPrevHidden(hidden);
127787
127967
  setExiting(hidden && exit != null);
127788
127968
  }
127789
- const ref = React10.useRef(null);
127790
- const exitRef = React10.useRef(exit);
127969
+ const ref = React11.useRef(null);
127970
+ const exitRef = React11.useRef(exit);
127791
127971
  exitRef.current = exit;
127792
127972
  useIsomorphicLayoutEffect(() => {
127793
127973
  if (!exiting) return void 0;
@@ -127820,8 +128000,8 @@ var init_renderNode = __esm({
127820
128000
  const target = raw == null || raw === "" || isBound && !ctx.provider ? legacy : sectionSlot(isBound ? bound : raw);
127821
128001
  const { graceMs, floorMs } = loadingTiming(ctx.kit, props.loadingGraceMs ?? props.loading_grace_ms, props.loadingFloorMs ?? props.loading_floor_ms);
127822
128002
  const shown2 = useLoadingTiming(target, graceMs, floorMs);
127823
- const changed = React10.useRef(false);
127824
- const first = React10.useRef(shown2);
128003
+ const changed = React11.useRef(false);
128004
+ const first = React11.useRef(shown2);
127825
128005
  if (shown2 !== first.current) changed.current = true;
127826
128006
  const renderCfg = (cfg) => cfg && typeof cfg === "object" ? /* @__PURE__ */ jsxs8("div", { style: { textAlign: "center", padding: "24px 12px", color: C2("textSecondary", "#9aa2ad") }, children: [
127827
128007
  cfg.title && /* @__PURE__ */ jsx11("div", { style: { fontSize: pxToRem(15), fontWeight: 600, color: C2("textPrimary", "#111") }, children: asText2(cfg.title) }),
@@ -127853,8 +128033,8 @@ var init_renderNode = __esm({
127853
128033
  }
127854
128034
  const animate = motionDefaultsAnimate(ctx);
127855
128035
  const fadeMs = motionDefaultsDuration(ctx.kit, 220);
127856
- const lastShown = React10.useRef(null);
127857
- const [outgoing, setOutgoing] = React10.useState(null);
128036
+ const lastShown = React11.useRef(null);
128037
+ const [outgoing, setOutgoing] = React11.useState(null);
127858
128038
  useIsomorphicLayoutEffect(() => {
127859
128039
  const was = lastShown.current;
127860
128040
  if (!animate || !was || was.slot === shown2 || was.node == null) return void 0;
@@ -127862,7 +128042,7 @@ var init_renderNode = __esm({
127862
128042
  const t2 = setTimeout(() => setOutgoing(null), fadeMs);
127863
128043
  return () => clearTimeout(t2);
127864
128044
  }, [shown2]);
127865
- React10.useEffect(() => {
128045
+ React11.useEffect(() => {
127866
128046
  lastShown.current = { slot: shown2, node: content };
127867
128047
  });
127868
128048
  if (changed.current && animate) {
@@ -127898,7 +128078,7 @@ var init_renderNode = __esm({
127898
128078
  const onChangeAction = resolveRowAction2(props.onChange ?? cfg.onChange, ctx);
127899
128079
  const borderless = props.borderless === true || cfg.borderless === true;
127900
128080
  const secure = props.secure === true || cfg.secure === true;
127901
- const [valueVisible, setValueVisible] = React10.useState(false);
128081
+ const [valueVisible, setValueVisible] = React11.useState(false);
127902
128082
  const visibilityToggle = secure && (props.visibilityToggle === true || cfg.visibilityToggle === true);
127903
128083
  const visibilityLabel = ctx.catalog?.get(valueVisible ? "auth.gate.password.hide" : "auth.gate.password.show") ?? (valueVisible ? "Hide password" : "Show password");
127904
128084
  const erroredProp = props.error === true || cfg.error === true;
@@ -127912,20 +128092,20 @@ var init_renderNode = __esm({
127912
128092
  const boundRawText = typeof boundVal === "string" ? boundVal : typeof boundVal === "number" ? String(boundVal) : void 0;
127913
128093
  const boundText = serializeRichText && boundRawText !== void 0 ? richTextHtmlToPlainText(boundRawText) : boundRawText;
127914
128094
  const literalText = typeof valueBinding === "string" ? serializeRichText ? richTextHtmlToPlainText(valueBinding) : valueBinding : "";
127915
- const [local, setLocal] = React10.useState(
128095
+ const [local, setLocal] = React11.useState(
127916
128096
  isBound ? boundText ?? "" : literalText
127917
128097
  );
127918
- const [edited, setEdited] = React10.useState(false);
127919
- const [pristineRichValue, setPristineRichValue] = React10.useState(
128098
+ const [edited, setEdited] = React11.useState(false);
128099
+ const [pristineRichValue, setPristineRichValue] = React11.useState(
127920
128100
  serializeRichText ? isBound ? boundRawText : typeof valueBinding === "string" ? valueBinding : void 0 : void 0
127921
128101
  );
127922
- const focused = React10.useRef(false);
127923
- const [touched, setTouched] = React10.useState(false);
127924
- const [isFocused, setIsFocused] = React10.useState(false);
127925
- const pendingEdits = React10.useRef([]);
127926
- const previousBoundText = React10.useRef(boundText);
127927
- const previousBoundRawText = React10.useRef(boundRawText);
127928
- React10.useEffect(() => {
128102
+ const focused = React11.useRef(false);
128103
+ const [touched, setTouched] = React11.useState(false);
128104
+ const [isFocused, setIsFocused] = React11.useState(false);
128105
+ const pendingEdits = React11.useRef([]);
128106
+ const previousBoundText = React11.useRef(boundText);
128107
+ const previousBoundRawText = React11.useRef(boundRawText);
128108
+ React11.useEffect(() => {
127929
128109
  if (!isBound || boundText === void 0) return;
127930
128110
  const boundTextChanged = previousBoundText.current !== boundText;
127931
128111
  const boundRawTextChanged = previousBoundRawText.current !== boundRawText;
@@ -127956,23 +128136,23 @@ var init_renderNode = __esm({
127956
128136
  }
127957
128137
  if (!focused.current && boundText !== local) setLocal(boundText);
127958
128138
  }, [boundText, serializeRichText ? boundRawText : void 0, isFocused, serializeRichText ? edited : false]);
127959
- const formBag = React10.useContext(FormValuesContext);
128139
+ const formBag = React11.useContext(FormValuesContext);
127960
128140
  const fieldId = props.__formFieldId;
127961
- const previousBinding = React10.useRef(binding2);
128141
+ const previousBinding = React11.useRef(binding2);
127962
128142
  const rule = props.validation ?? cfg.validation;
127963
128143
  const { "aria-labelledby": labelledBy } = formFieldA11y(props);
127964
128144
  const required3 = rule?.required === true || void 0;
127965
- const ruleKey = React10.useMemo(() => rule ? JSON.stringify(rule) : "", [rule]);
127966
- React10.useEffect(() => {
128145
+ const ruleKey = React11.useMemo(() => rule ? JSON.stringify(rule) : "", [rule]);
128146
+ React11.useEffect(() => {
127967
128147
  if (!formBag || !fieldId) return;
127968
128148
  formBag.register(fieldId, rule);
127969
128149
  return () => formBag.unregister(fieldId);
127970
128150
  }, [fieldId, formBag, ruleKey]);
127971
128151
  const formValue = serializeRichText && !edited && pristineRichValue !== void 0 ? pristineRichValue : serializeRichText ? richTextEditedHtml(pristineRichValue, pristineRichValue === void 0 ? "" : richTextHtmlToPlainText(pristineRichValue), local) : local;
127972
- React10.useEffect(() => {
128152
+ React11.useEffect(() => {
127973
128153
  if (formBag && fieldId) formBag.set(fieldId, formValue);
127974
128154
  }, [formValue, fieldId, formBag, binding2]);
127975
- React10.useEffect(() => {
128155
+ React11.useEffect(() => {
127976
128156
  if (previousBinding.current === binding2) return;
127977
128157
  previousBinding.current = binding2;
127978
128158
  pendingEdits.current = [];
@@ -127991,7 +128171,7 @@ var init_renderNode = __esm({
127991
128171
  const errorTextRaw = props.errorText ?? cfg.errorText;
127992
128172
  const errorTextResolved = useBoundString(errorTextRaw, ctx);
127993
128173
  const workerError = typeof boundError === "string" ? boundError : errorTextRaw == null ? void 0 : errorTextResolved;
127994
- const validationCatalog = React10.useMemo(
128174
+ const validationCatalog = React11.useMemo(
127995
128175
  () => ctx.catalog ? new Proxy({}, { get: (_t2, k2) => typeof k2 === "string" ? ctx.catalog.get(k2) : void 0 }) : void 0,
127996
128176
  [ctx.catalog]
127997
128177
  );
@@ -128006,7 +128186,7 @@ var init_renderNode = __esm({
128006
128186
  const hasWorkerError = Boolean(workerError && workerError.trim());
128007
128187
  const painted2 = rawMessage === null ? "" : translateOnly(rawMessage);
128008
128188
  const message = !painted2.trim() || ruleMessagePending && !hasWorkerError ? null : painted2;
128009
- const [feedbackShown, setFeedbackShown] = React10.useState(false);
128189
+ const [feedbackShown, setFeedbackShown] = React11.useState(false);
128010
128190
  const revealed = message !== null && shouldRevealError({
128011
128191
  rule,
128012
128192
  feedbackShown,
@@ -128015,11 +128195,11 @@ var init_renderNode = __esm({
128015
128195
  focused: isFocused,
128016
128196
  submitAttempted: formBag?.submitAttempted ?? false
128017
128197
  });
128018
- React10.useEffect(() => {
128198
+ React11.useEffect(() => {
128019
128199
  if (revealed) setFeedbackShown(true);
128020
128200
  }, [revealed]);
128021
128201
  const errored = erroredProp || revealed;
128022
- const generatedId = React10.useId();
128202
+ const generatedId = React11.useId();
128023
128203
  const errorId = revealed ? `${componentId ?? generatedId}__error` : void 0;
128024
128204
  const emit = (v2) => {
128025
128205
  if (onChangeAction && ctx.onAction) {
@@ -128031,16 +128211,16 @@ var init_renderNode = __esm({
128031
128211
  });
128032
128212
  }
128033
128213
  };
128034
- const ownsPrivateDraft = React10.useRef(false);
128035
- React10.useEffect(() => {
128214
+ const ownsPrivateDraft = React11.useRef(false);
128215
+ React11.useEffect(() => {
128036
128216
  if (visibilityToggle && !isBound) ownsPrivateDraft.current = true;
128037
128217
  }, [visibilityToggle, isBound]);
128038
- const clearSensitiveDraft = React10.useRef(() => {
128218
+ const clearSensitiveDraft = React11.useRef(() => {
128039
128219
  });
128040
128220
  clearSensitiveDraft.current = () => {
128041
128221
  if (ownsPrivateDraft.current && !isBound) emit("");
128042
128222
  };
128043
- React10.useEffect(() => () => clearSensitiveDraft.current(), []);
128223
+ React11.useEffect(() => () => clearSensitiveDraft.current(), []);
128044
128224
  const onInput = (e2) => {
128045
128225
  const v2 = e2.currentTarget.value;
128046
128226
  setLocal(v2);
@@ -128072,7 +128252,7 @@ var init_renderNode = __esm({
128072
128252
  const submitLabelRaw = props.submitLabel ?? cfg.submitLabel;
128073
128253
  const onSubmitAction = props.onSubmit ?? cfg.onSubmit;
128074
128254
  const enterKeyHint = !multilineBox && ENTER_KEY_HINTS.has(submitLabelRaw) ? submitLabelRaw : !multilineBox && onSubmitAction ? "done" : void 0;
128075
- const inputRef = React10.useRef(null);
128255
+ const inputRef = React11.useRef(null);
128076
128256
  useIsomorphicLayoutEffect(() => {
128077
128257
  const el2 = inputRef.current;
128078
128258
  const view = el2?.ownerDocument?.defaultView;
@@ -128087,8 +128267,8 @@ var init_renderNode = __esm({
128087
128267
  }, [local, multilineBox, maxLines]);
128088
128268
  const focusBinding = (typeof props.focusPath === "string" ? props.focusPath : typeof cfg.focusPath === "string" ? cfg.focusPath : void 0) ?? "";
128089
128269
  const focusTokenVal = useBoundValue(ctx, focusBinding);
128090
- const lastFocusToken = React10.useRef(void 0);
128091
- React10.useEffect(() => {
128270
+ const lastFocusToken = React11.useRef(void 0);
128271
+ React11.useEffect(() => {
128092
128272
  if (!focusBinding) return;
128093
128273
  const next = typeof focusTokenVal === "string" ? focusTokenVal : typeof focusTokenVal === "number" ? String(focusTokenVal) : "";
128094
128274
  if (!next || next === lastFocusToken.current) return;
@@ -128163,13 +128343,13 @@ var init_renderNode = __esm({
128163
128343
  };
128164
128344
  MENU_LONG_PRESS_MS = 500;
128165
128345
  MenuNode = withExtras("MenuNode", ({ props, ctx, wrap }) => {
128166
- const [open, setOpen] = React10.useState(false);
128167
- const hostRef = React10.useRef(null);
128346
+ const [open, setOpen] = React11.useState(false);
128347
+ const hostRef = React11.useRef(null);
128168
128348
  const context = props.style === "context";
128169
128349
  const previewMode = context && props.preview != null;
128170
128350
  const items = (Array.isArray(props.items) ? props.items : []).map((it2) => it2 && typeof it2.label === "string" && it2.label.startsWith("$item") ? { ...it2, label: resolveItemDeep2(it2.label, ctx) } : it2);
128171
128351
  const C2 = ctx.color;
128172
- React10.useEffect(() => {
128352
+ React11.useEffect(() => {
128173
128353
  if (!open) return;
128174
128354
  const onTop = () => menuRef.current != null && isWithinTopModal(menuRef.current);
128175
128355
  const onDown = (e2) => {
@@ -128195,17 +128375,17 @@ var init_renderNode = __esm({
128195
128375
  const flexGrow = typeof wrap?.flex === "string" ? parseFloat(wrap.flex) : typeof wrap?.flex === "number" ? wrap.flex : Number(wrap?.flexGrow ?? 0);
128196
128376
  const fill = wrap?.width === "100%" || Number.isFinite(flexGrow) && flexGrow > 0;
128197
128377
  const popupPlacement = fill ? { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 20, marginTop: 4 } : { position: "absolute", top: "100%", right: 0, zIndex: 20, marginTop: 4 };
128198
- const anchorRef = React10.useRef(null);
128199
- const menuRef = React10.useRef(null);
128200
- const dialogRef = React10.useRef(null);
128378
+ const anchorRef = React11.useRef(null);
128379
+ const menuRef = React11.useRef(null);
128380
+ const dialogRef = React11.useRef(null);
128201
128381
  const itemsKey = items.map((it2, i2) => `${it2?.id ?? i2}:${it2?.disabled ? 0 : 1}`).join("|");
128202
- React10.useEffect(() => {
128382
+ React11.useEffect(() => {
128203
128383
  if (!open || !modal) return;
128204
128384
  const menu = menuRef.current;
128205
128385
  if (!menu || menu.contains(document.activeElement)) return;
128206
128386
  (menu.querySelector('[role="menuitem"][tabindex="0"]') ?? menu).focus();
128207
128387
  }, [open, modal, itemsKey]);
128208
- React10.useEffect(() => {
128388
+ React11.useEffect(() => {
128209
128389
  if (!open || !modal) return;
128210
128390
  const layer = pushModalLayer(() => dialogRef.current);
128211
128391
  return () => {
@@ -128214,15 +128394,15 @@ var init_renderNode = __esm({
128214
128394
  if (active == null || active === document.body || !document.contains(active)) anchorRef.current?.focus();
128215
128395
  };
128216
128396
  }, [open, modal]);
128217
- const press = React10.useRef(null);
128218
- const pressFired = React10.useRef(false);
128397
+ const press = React11.useRef(null);
128398
+ const pressFired = React11.useRef(false);
128219
128399
  const cancelPress = () => {
128220
128400
  if (press.current) {
128221
128401
  clearTimeout(press.current.timer);
128222
128402
  press.current = null;
128223
128403
  }
128224
128404
  };
128225
- React10.useEffect(() => cancelPress, []);
128405
+ React11.useEffect(() => cancelPress, []);
128226
128406
  const contextHandlers = context ? {
128227
128407
  onContextMenu: (e2) => {
128228
128408
  e2.preventDefault();
@@ -128337,9 +128517,9 @@ var init_renderNode = __esm({
128337
128517
  const isBound = typeof raw === "string" && isBinding(raw);
128338
128518
  const bound = useBoundValue(ctx, isBound ? raw : "");
128339
128519
  const cursor = isBound ? typeof bound === "string" ? bound : "" : String(raw ?? "");
128340
- const ref = React10.useRef(null);
128341
- const fired = React10.useRef("");
128342
- React10.useEffect(() => {
128520
+ const ref = React11.useRef(null);
128521
+ const fired = React11.useRef("");
128522
+ React11.useEffect(() => {
128343
128523
  const el2 = ref.current;
128344
128524
  if (!cursor || !ctx.onAction || !el2 || typeof IntersectionObserver === "undefined") return;
128345
128525
  const io2 = new IntersectionObserver((entries) => {
@@ -128369,11 +128549,11 @@ var init_renderNode = __esm({
128369
128549
  ] });
128370
128550
  });
128371
128551
  FormView = withExtras("FormView", ({ props, ctx, wrap }) => {
128372
- const bagRef = React10.useRef(null);
128552
+ const bagRef = React11.useRef(null);
128373
128553
  if (!bagRef.current) bagRef.current = createFormBag();
128374
128554
  const bag = bagRef.current;
128375
- React10.useSyncExternalStore(
128376
- React10.useCallback((cb) => bag.subscribe(cb), [bag]),
128555
+ React11.useSyncExternalStore(
128556
+ React11.useCallback((cb) => bag.subscribe(cb), [bag]),
128377
128557
  () => bag.version,
128378
128558
  () => bag.version
128379
128559
  );
@@ -128390,7 +128570,7 @@ var init_renderNode = __esm({
128390
128570
  ctx.onAction?.({ ...action, args: merged });
128391
128571
  }
128392
128572
  };
128393
- const submitNode = React10.useMemo(() => {
128573
+ const submitNode = React11.useMemo(() => {
128394
128574
  const node = props.submitButton;
128395
128575
  if (!node || valid) return node;
128396
128576
  if (node.body) return { ...node, body: { ...node.body, props: { ...node.body.props ?? {}, disabled: true } } };
@@ -128440,11 +128620,11 @@ var init_renderNode = __esm({
128440
128620
  const startPositionPath = typeof props.startPositionSeconds === "string" && isBinding(props.startPositionSeconds) ? props.startPositionSeconds : "";
128441
128621
  const boundStartPosition = useResolvedScalar(startPositionPath || void 0, ctx);
128442
128622
  const initialStartPosition = startPositionPath && typeof boundStartPosition === "number" && Number.isFinite(boundStartPosition) ? Math.max(0, boundStartPosition) : Math.max(0, Number.isFinite(Number(props.startPositionSeconds)) ? Number(props.startPositionSeconds) : 0);
128443
- const [index, setIndex] = React10.useState(initialIndex);
128623
+ const [index, setIndex] = React11.useState(initialIndex);
128444
128624
  const queueReady = !itemsPath || Array.isArray(boundQueue);
128445
128625
  const seatKey = `${itemsPath ?? ""}|${startIndex}`;
128446
- const seated = React10.useRef(null);
128447
- React10.useEffect(() => {
128626
+ const seated = React11.useRef(null);
128627
+ React11.useEffect(() => {
128448
128628
  const last = Math.max(0, resolvedItems.length - 1);
128449
128629
  if (resolvedItems.length === 0) return;
128450
128630
  if (queueReady && seated.current !== seatKey) {
@@ -128459,19 +128639,19 @@ var init_renderNode = __esm({
128459
128639
  }
128460
128640
  setIndex((i2) => Math.min(Math.max(0, i2), last));
128461
128641
  }, [resolvedItems.length, startIndex, queueReady, seatKey]);
128462
- const [status, setStatus] = React10.useState("idle");
128463
- const [position, setPosition] = React10.useState(initialStartPosition);
128464
- const [duration2, setDuration] = React10.useState(0);
128465
- const [buffered, setBuffered] = React10.useState(0);
128466
- const [rate, setRateState] = React10.useState(1);
128467
- const [fullscreen, setFullscreen] = React10.useState(false);
128468
- const [error, setError] = React10.useState("");
128469
- const mediaRef = React10.useRef(null);
128470
- const hostRef = React10.useRef(null);
128471
- const autoplayConsumed = React10.useRef(false);
128642
+ const [status, setStatus] = React11.useState("idle");
128643
+ const [position, setPosition] = React11.useState(initialStartPosition);
128644
+ const [duration2, setDuration] = React11.useState(0);
128645
+ const [buffered, setBuffered] = React11.useState(0);
128646
+ const [rate, setRateState] = React11.useState(1);
128647
+ const [fullscreen, setFullscreen] = React11.useState(false);
128648
+ const [error, setError] = React11.useState("");
128649
+ const mediaRef = React11.useRef(null);
128650
+ const hostRef = React11.useRef(null);
128651
+ const autoplayConsumed = React11.useRef(false);
128472
128652
  const item = resolvedItems[index];
128473
128653
  const mediaKey2 = `${index}:${item?.id ?? item?.url ?? ""}`;
128474
- React10.useEffect(() => {
128654
+ React11.useEffect(() => {
128475
128655
  const outgoing = mediaRef.current;
128476
128656
  return () => {
128477
128657
  try {
@@ -128485,7 +128665,7 @@ var init_renderNode = __esm({
128485
128665
  const isYouTube = provider === "youtube";
128486
128666
  const isUnsupportedProvider = provider !== "direct" && !isYouTube;
128487
128667
  const isAudio = ["audio", "podcast", "radio"].includes(String(item?.kind ?? ""));
128488
- const capabilities = React10.useMemo(() => ({
128668
+ const capabilities = React11.useMemo(() => ({
128489
128669
  seek: !isUnsupportedProvider && item?.live !== true,
128490
128670
  rate: !isUnsupportedProvider && item?.live !== true,
128491
128671
  queue: !isUnsupportedProvider && items.length > 1,
@@ -128513,9 +128693,9 @@ var init_renderNode = __esm({
128513
128693
  error,
128514
128694
  capabilities
128515
128695
  };
128516
- const slotProvider = React10.useMemo(() => new MediaSlotProvider(state), []);
128517
- React10.useEffect(() => slotProvider.set(state));
128518
- React10.useEffect(() => {
128696
+ const slotProvider = React11.useMemo(() => new MediaSlotProvider(state), []);
128697
+ React11.useEffect(() => slotProvider.set(state));
128698
+ React11.useEffect(() => {
128519
128699
  if (!startPositionPath || typeof boundStartPosition !== "number" || !Number.isFinite(boundStartPosition) || status !== "idle") return;
128520
128700
  const next = Math.max(0, boundStartPosition);
128521
128701
  setPosition(next);
@@ -128526,7 +128706,7 @@ var init_renderNode = __esm({
128526
128706
  }
128527
128707
  }
128528
128708
  }, [startPositionPath, boundStartPosition, status]);
128529
- const emit = React10.useCallback((action, extra = {}) => {
128709
+ const emit = React11.useCallback((action, extra = {}) => {
128530
128710
  if (!action || !ctx.onAction) return;
128531
128711
  const snapshot2 = {
128532
128712
  sessionId,
@@ -128545,13 +128725,13 @@ var init_renderNode = __esm({
128545
128725
  };
128546
128726
  ctx.onAction({ ...action, args: { ...action.args ?? {}, ...snapshot2, ...extra }, params: { ...action.params ?? {}, sessionId, index: String(index), ...Object.fromEntries(Object.entries(extra).map(([k2, v2]) => [k2, String(v2)])) } });
128547
128727
  }, [ctx.onAction, sessionId, status, index, position, duration2, item, buffered, rate, props.muted, fullscreen, error]);
128548
- React10.useEffect(() => {
128728
+ React11.useEffect(() => {
128549
128729
  if (!isUnsupportedProvider || status === "error") return;
128550
128730
  setStatus("error");
128551
128731
  setError("provider_unsupported");
128552
128732
  emit(props.onError, { state: "error", status: "error", error: "provider_unsupported", code: "provider_unsupported" });
128553
128733
  }, [isUnsupportedProvider, status, emit, props.onError]);
128554
- const play = React10.useCallback(async () => {
128734
+ const play = React11.useCallback(async () => {
128555
128735
  if (isYouTube) return;
128556
128736
  if (isUnsupportedProvider) {
128557
128737
  setStatus("error");
@@ -128573,17 +128753,17 @@ var init_renderNode = __esm({
128573
128753
  emit(props.onError, { state: "blocked", status: "blocked", error: message, code: "playback_blocked" });
128574
128754
  }
128575
128755
  }, [isYouTube, isUnsupportedProvider, emit, props.onError]);
128576
- const pause = React10.useCallback(() => {
128756
+ const pause = React11.useCallback(() => {
128577
128757
  mediaRef.current?.pause();
128578
128758
  setStatus("paused");
128579
128759
  }, []);
128580
- const seek = React10.useCallback((seconds) => {
128760
+ const seek = React11.useCallback((seconds) => {
128581
128761
  const media = mediaRef.current;
128582
128762
  if (!media || !Number.isFinite(seconds)) return;
128583
128763
  media.currentTime = Math.max(0, Math.min(seconds, Number.isFinite(media.duration) ? media.duration : seconds));
128584
128764
  setPosition(media.currentTime);
128585
128765
  }, []);
128586
- const select2 = React10.useCallback((next) => {
128766
+ const select2 = React11.useCallback((next) => {
128587
128767
  if (resolvedItems.length === 0) return;
128588
128768
  const normalized = (next % resolvedItems.length + resolvedItems.length) % resolvedItems.length;
128589
128769
  const nextItem = resolvedItems[normalized];
@@ -128605,7 +128785,7 @@ var init_renderNode = __esm({
128605
128785
  error: ""
128606
128786
  });
128607
128787
  }, [resolvedItems, emit, props.onItemChange]);
128608
- const toggleFullscreen = React10.useCallback(async () => {
128788
+ const toggleFullscreen = React11.useCallback(async () => {
128609
128789
  if (props.fullscreen === "disabled") return;
128610
128790
  const host = hostRef.current;
128611
128791
  try {
@@ -128615,7 +128795,7 @@ var init_renderNode = __esm({
128615
128795
  setFullscreen((value) => !value);
128616
128796
  }
128617
128797
  }, [props.fullscreen]);
128618
- React10.useEffect(() => {
128798
+ React11.useEffect(() => {
128619
128799
  const listener = (event) => {
128620
128800
  const detail = event.detail;
128621
128801
  if (!detail || detail.sessionId !== sessionId) return;
@@ -128663,7 +128843,7 @@ var init_renderNode = __esm({
128663
128843
  window.addEventListener("himalaya-media-command", listener);
128664
128844
  return () => window.removeEventListener("himalaya-media-command", listener);
128665
128845
  }, [sessionId, index, play, pause, seek, select2, toggleFullscreen]);
128666
- React10.useEffect(() => {
128846
+ React11.useEffect(() => {
128667
128847
  const listener = () => {
128668
128848
  const value = document.fullscreenElement === hostRef.current;
128669
128849
  setFullscreen(value);
@@ -128672,14 +128852,14 @@ var init_renderNode = __esm({
128672
128852
  document.addEventListener("fullscreenchange", listener);
128673
128853
  return () => document.removeEventListener("fullscreenchange", listener);
128674
128854
  }, [emit, props.onFullscreenChange]);
128675
- React10.useEffect(() => {
128855
+ React11.useEffect(() => {
128676
128856
  const media = mediaRef.current;
128677
128857
  if (!media || isYouTube || isUnsupportedProvider) return;
128678
128858
  media.muted = props.muted === true;
128679
128859
  media.playbackRate = rate;
128680
128860
  if (position > 0) media.currentTime = position;
128681
128861
  }, [item?.url, isUnsupportedProvider]);
128682
- React10.useEffect(() => {
128862
+ React11.useEffect(() => {
128683
128863
  if (isYouTube || isUnsupportedProvider || props.autoplay === "never" || autoplayConsumed.current) return;
128684
128864
  if (props.autoplay === "once") {
128685
128865
  autoplayConsumed.current = true;
@@ -128881,15 +129061,15 @@ var init_renderNode = __esm({
128881
129061
  }
128882
129062
  );
128883
129063
  });
128884
- PdfDocumentCanvas = React10.lazy(() => Promise.resolve().then(() => (init_pdfDocument(), pdfDocument_exports)).then((module) => ({ default: module.PdfDocument })));
129064
+ PdfDocumentCanvas = React11.lazy(() => Promise.resolve().then(() => (init_pdfDocument(), pdfDocument_exports)).then((module) => ({ default: module.PdfDocument })));
128885
129065
  PdfViewNode = withExtras("PdfViewNode", ({ props, ctx, wrap }) => {
128886
129066
  const boundUrl = useResolvedScalar(props.url != null && isBinding(props.url) ? props.url : void 0, ctx);
128887
129067
  const url = props.url != null && isBinding(props.url) ? boundUrl : props.url;
128888
129068
  const rawUrl = typeof url === "string" && !isBinding(url) ? url : "";
128889
129069
  const plan = rawUrl ? pdfEmbedPlan(rawUrl, void 0, typeof document !== "undefined" ? document.baseURI : void 0) : null;
128890
129070
  const retypeSrc = plan?.mode === "retype" ? plan.src : null;
128891
- const [retyped, setRetyped] = React10.useState(null);
128892
- React10.useEffect(() => {
129071
+ const [retyped, setRetyped] = React11.useState(null);
129072
+ React11.useEffect(() => {
128893
129073
  if (!retypeSrc) return;
128894
129074
  let live3 = true;
128895
129075
  let made = null;
@@ -128911,11 +129091,11 @@ var init_renderNode = __esm({
128911
129091
  }, [retypeSrc]);
128912
129092
  const settled = retyped && retyped.from === retypeSrc ? retyped : null;
128913
129093
  const wantsShare = props.allowShare === true;
128914
- const [fellBackFrom, setFellBackFrom] = React10.useState(null);
129094
+ const [fellBackFrom, setFellBackFrom] = React11.useState(null);
128915
129095
  const directFellBack = plan?.mode === "direct" && fellBackFrom === plan.src;
128916
129096
  const directSrc = plan?.mode === "direct" && (wantsShare || props.showPageControls !== false && directFellBack) ? plan.src : null;
128917
- const [direct, setDirect] = React10.useState(null);
128918
- React10.useEffect(() => {
129097
+ const [direct, setDirect] = React11.useState(null);
129098
+ React11.useEffect(() => {
128919
129099
  if (!directSrc) return;
128920
129100
  let live3 = true;
128921
129101
  let made = null;
@@ -128932,16 +129112,16 @@ var init_renderNode = __esm({
128932
129112
  }, [directSrc, wantsShare]);
128933
129113
  const directDoc = direct && direct.from === directSrc ? direct : null;
128934
129114
  const fallbackPageCount = plan?.mode === "retype" ? settled?.pageCount ?? null : directDoc?.count ?? null;
128935
- const [nav, setNav] = React10.useState({ from: rawUrl, page: null, zoom: null });
129115
+ const [nav, setNav] = React11.useState({ from: rawUrl, page: null, zoom: null });
128936
129116
  const view = nav.from === rawUrl ? nav : { from: rawUrl, page: null, zoom: null };
128937
129117
  const src = plan?.mode === "direct" ? plan.src : settled?.url ?? null;
128938
- const [canvasCount, setCanvasCount] = React10.useState(null);
128939
- const onPageCount = React10.useCallback((count2) => {
129118
+ const [canvasCount, setCanvasCount] = React11.useState(null);
129119
+ const onPageCount = React11.useCallback((count2) => {
128940
129120
  if (!Number.isInteger(count2) || count2 < 1) return;
128941
129121
  setCanvasCount((cur) => cur?.from === src && cur.count === count2 ? cur : { from: src, count: count2 });
128942
129122
  }, [src]);
128943
129123
  const pageCount = canvasCount?.from === src ? canvasCount.count : fallbackPageCount;
128944
- const onFallback = React10.useCallback(() => setFellBackFrom(src), [src]);
129124
+ const onFallback = React11.useCallback(() => setFellBackFrom(src), [src]);
128945
129125
  const loading = plan?.mode === "retype" && !settled || directSrc != null && wantsShare && !directDoc && typeof window !== "undefined";
128946
129126
  const loadSrc = plan?.mode === "direct" && wantsShare ? directDoc?.blobUrl ?? src : src;
128947
129127
  const ph = typeof props.height === "number" && props.height > 0 ? props.height : void 0;
@@ -128991,7 +129171,7 @@ var init_renderNode = __esm({
128991
129171
  const data = base + pdfOpenFragment(sourceHash, { page, zoom: zoomable ? view.zoom : null, fitWidth: !zoomable });
128992
129172
  const label3 = typeof props.title === "string" && props.title ? props.title : "PDF document";
128993
129173
  const documentStyle = showPageControls || zoomable || allowShare ? { display: "block", width: "100%", flex: "1 1 auto", minHeight: ph ? 0 : 280, border: "none" } : frame;
128994
- const object7 = typeof window === "undefined" ? /* @__PURE__ */ jsx11("object", { "data-himalaya-pdf": "static-fallback", data, type: "application/pdf", "aria-label": label3, style: documentStyle }) : /* @__PURE__ */ jsx11(React10.Suspense, { fallback: /* @__PURE__ */ jsx11("div", { "data-himalaya-pdf": "loading", role: "img", "aria-label": "loading document", "aria-busy": "true", style: documentStyle }), children: /* @__PURE__ */ jsx11(
129174
+ const object7 = typeof window === "undefined" ? /* @__PURE__ */ jsx11("object", { "data-himalaya-pdf": "static-fallback", data, type: "application/pdf", "aria-label": label3, style: documentStyle }) : /* @__PURE__ */ jsx11(React11.Suspense, { fallback: /* @__PURE__ */ jsx11("div", { "data-himalaya-pdf": "loading", role: "img", "aria-label": "loading document", "aria-busy": "true", style: documentStyle }), children: /* @__PURE__ */ jsx11(
128995
129175
  PdfDocumentCanvas,
128996
129176
  {
128997
129177
  src: loadSrc ?? src,
@@ -129071,7 +129251,7 @@ var init_renderNode = __esm({
129071
129251
  const ar2 = typeof props.aspectRatio === "number" && props.aspectRatio > 0 ? props.aspectRatio : void 0;
129072
129252
  const frameStyle = { width: "100%", boxSizing: "border-box", border: "none", borderRadius: ctx.radius("md", 8), background: "#fff", ...scrollEnabled ? {} : { overflow: "hidden" }, ...h2 ? { height: h2 } : ar2 ? { aspectRatio: String(ar2) } : { height: 200 } };
129073
129253
  const frameKey = htmlStr ?? urlFrame?.src ?? null;
129074
- const [loadedKey, setLoadedKey] = React10.useState(null);
129254
+ const [loadedKey, setLoadedKey] = React11.useState(null);
129075
129255
  const loaded = loadedKey === frameKey;
129076
129256
  const frameProps = {
129077
129257
  title: "webview",
@@ -129102,19 +129282,19 @@ var init_renderNode = __esm({
129102
129282
  const onChange = props.onChange;
129103
129283
  const boundSel = useResolvedScalar(isBinding(props.selectedId) ? props.selectedId : void 0, ctx);
129104
129284
  const selectedId = isBinding(props.selectedId) ? boundSel : props.selectedId;
129105
- const [sel, setSel] = React10.useState(ctx.empty ? "" : String(selectedId ?? ""));
129106
- React10.useEffect(() => {
129285
+ const [sel, setSel] = React11.useState(ctx.empty ? "" : String(selectedId ?? ""));
129286
+ React11.useEffect(() => {
129107
129287
  if (!ctx.empty && selectedId != null) setSel(String(selectedId));
129108
129288
  }, [selectedId, ctx.empty]);
129109
- const pickerBag = React10.useContext(FormValuesContext);
129289
+ const pickerBag = React11.useContext(FormValuesContext);
129110
129290
  const pickerFieldId = props.__formFieldId;
129111
129291
  const pickerRuleKey = props.validation ? JSON.stringify(props.validation) : "";
129112
- React10.useEffect(() => {
129292
+ React11.useEffect(() => {
129113
129293
  if (!pickerBag || !pickerFieldId) return;
129114
129294
  pickerBag.register(pickerFieldId, props.validation);
129115
129295
  return () => pickerBag.unregister(pickerFieldId);
129116
129296
  }, [pickerFieldId, pickerBag, pickerRuleKey]);
129117
- React10.useEffect(() => {
129297
+ React11.useEffect(() => {
129118
129298
  if (pickerBag && pickerFieldId) pickerBag.set(pickerFieldId, sel);
129119
129299
  }, [sel, pickerFieldId, pickerBag]);
129120
129300
  const emitPick = (id) => {
@@ -129230,24 +129410,24 @@ var init_renderNode = __esm({
129230
129410
  const s2 = seedUnix();
129231
129411
  return s2 == null ? null : clampUnix(s2);
129232
129412
  };
129233
- const [val, setVal] = React10.useState(ctx.empty ? "" : toInput(shownSeed()));
129413
+ const [val, setVal] = React11.useState(ctx.empty ? "" : toInput(shownSeed()));
129234
129414
  const dateServiceBound = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:");
129235
129415
  const bagSource = () => dateServiceBound ? boundRaw : boundRaw !== void 0 && boundRaw !== null && boundRaw !== "" ? boundRaw : props.valueUnix;
129236
- const [dateBagVal, setDateBagVal] = React10.useState(ctx.empty ? "" : clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
129237
- React10.useEffect(() => {
129416
+ const [dateBagVal, setDateBagVal] = React11.useState(ctx.empty ? "" : clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
129417
+ React11.useEffect(() => {
129238
129418
  if (ctx.empty) return;
129239
129419
  setVal(toInput(shownSeed()));
129240
129420
  setDateBagVal(clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
129241
129421
  }, [boundRaw, props.valueUnix, props.valuePath, ctx.empty]);
129242
- const dateBag = React10.useContext(FormValuesContext);
129422
+ const dateBag = React11.useContext(FormValuesContext);
129243
129423
  const dateFieldId = props.__formFieldId;
129244
129424
  const dateRuleKey = props.validation ? JSON.stringify(props.validation) : "";
129245
- React10.useEffect(() => {
129425
+ React11.useEffect(() => {
129246
129426
  if (!dateBag || !dateFieldId) return;
129247
129427
  dateBag.register(dateFieldId, props.validation);
129248
129428
  return () => dateBag.unregister(dateFieldId);
129249
129429
  }, [dateFieldId, dateBag, dateRuleKey]);
129250
- React10.useEffect(() => {
129430
+ React11.useEffect(() => {
129251
129431
  if (dateBag && dateFieldId) dateBag.set(dateFieldId, dateBagVal);
129252
129432
  }, [dateBagVal, dateFieldId, dateBag]);
129253
129433
  if (!ctx.onAction) {
@@ -129316,11 +129496,11 @@ var init_renderNode = __esm({
129316
129496
  const valueBinding = isBinding(props.value) ? props.value : void 0;
129317
129497
  const boundValue = useResolvedScalar(valueBinding, ctx);
129318
129498
  const initialValue = ctx.empty ? "" : valueBinding ? boundValue == null ? "" : String(boundValue) : String(props.value ?? "");
129319
- const [local, setLocal] = React10.useState(initialValue);
129320
- React10.useEffect(() => {
129499
+ const [local, setLocal] = React11.useState(initialValue);
129500
+ React11.useEffect(() => {
129321
129501
  if (!ctx.empty && valueBinding) setLocal(boundValue == null ? "" : String(boundValue));
129322
129502
  }, [boundValue, ctx.empty, valueBinding]);
129323
- const timer = React10.useRef(null);
129503
+ const timer = React11.useRef(null);
129324
129504
  const dispatch = (action, v2) => {
129325
129505
  if (!action || !ctx.onAction) return;
129326
129506
  ctx.onAction({ ...action, params: { ...action.params ?? {}, value: v2 }, args: { ...action.args ?? {}, value: v2 } });
@@ -129362,33 +129542,33 @@ var init_renderNode = __esm({
129362
129542
  const boundValue = useResolvedScalar(props.valuePath, ctx);
129363
129543
  const effectiveValue = props.valuePath != null ? boundValue : props.value;
129364
129544
  const fallbackValue = effectiveValue ?? props.value ?? 0;
129365
- const [value, setValue] = React10.useState(() => {
129545
+ const [value, setValue] = React11.useState(() => {
129366
129546
  const seed2 = Number(fallbackValue);
129367
129547
  return Number.isFinite(seed2) ? Math.min(max, Math.max(min, seed2)) : 0;
129368
129548
  });
129369
- React10.useEffect(() => {
129549
+ React11.useEffect(() => {
129370
129550
  const next = Number(fallbackValue);
129371
129551
  if (Number.isFinite(next)) setValue(Math.min(max, Math.max(min, next)));
129372
129552
  }, [fallbackValue, min, max]);
129373
- const stepperBag = React10.useContext(FormValuesContext);
129553
+ const stepperBag = React11.useContext(FormValuesContext);
129374
129554
  const stepperFieldId = props.__formFieldId;
129375
129555
  const stepperRuleKey = props.validation ? JSON.stringify(props.validation) : "";
129376
- React10.useEffect(() => {
129556
+ React11.useEffect(() => {
129377
129557
  if (!stepperBag || !stepperFieldId) return;
129378
129558
  stepperBag.register(stepperFieldId, props.validation);
129379
129559
  return () => stepperBag.unregister(stepperFieldId);
129380
129560
  }, [stepperFieldId, stepperBag, stepperRuleKey]);
129381
129561
  const serviceBound = typeof props.valuePath === "string" && isBinding(props.valuePath) && props.valuePath.startsWith("$service:");
129382
- const [bagValue, setBagValue] = React10.useState(() => serviceBound ? boundValue != null ? encodeStepperFieldValue(boundValue, { min, max }) : "" : encodeStepperFieldValue(value, { min, max }));
129383
- React10.useEffect(() => {
129562
+ const [bagValue, setBagValue] = React11.useState(() => serviceBound ? boundValue != null ? encodeStepperFieldValue(boundValue, { min, max }) : "" : encodeStepperFieldValue(value, { min, max }));
129563
+ React11.useEffect(() => {
129384
129564
  if (!serviceBound || boundValue == null) return;
129385
129565
  setBagValue(encodeStepperFieldValue(boundValue, { min, max }));
129386
129566
  }, [boundValue, serviceBound, min, max]);
129387
- React10.useEffect(() => {
129567
+ React11.useEffect(() => {
129388
129568
  if (serviceBound) return;
129389
129569
  setBagValue(encodeStepperFieldValue(value, { min, max }));
129390
129570
  }, [value, serviceBound, min, max]);
129391
- React10.useEffect(() => {
129571
+ React11.useEffect(() => {
129392
129572
  if (stepperBag && stepperFieldId) stepperBag.set(stepperFieldId, bagValue);
129393
129573
  }, [bagValue, stepperFieldId, stepperBag]);
129394
129574
  const dispatch = (next) => {
@@ -129403,7 +129583,7 @@ var init_renderNode = __esm({
129403
129583
  dispatch(next);
129404
129584
  return next;
129405
129585
  };
129406
- const [pressed, setPressed] = React10.useState({ text: "", count: 0 });
129586
+ const [pressed, setPressed] = React11.useState({ text: "", count: 0 });
129407
129587
  const bump = (delta) => commit(value + delta);
129408
129588
  const press = (delta) => {
129409
129589
  const next = bump(delta);
@@ -129545,9 +129725,9 @@ var init_renderNode = __esm({
129545
129725
  const items = Array.isArray(props.items) ? props.items : [];
129546
129726
  const gridStagger = ctx.reduceMotion() ? 0 : Number(props.staggerMs ?? props.stagger_ms ?? 0);
129547
129727
  const stagger = (el2, i2) => {
129548
- if (!(gridStagger > 0) || !React10.isValidElement(el2)) return el2;
129728
+ if (!(gridStagger > 0) || !React11.isValidElement(el2)) return el2;
129549
129729
  const prev = el2.props.style ?? {};
129550
- return React10.cloneElement(el2, { style: { ...prev, animationDelay: `${i2 * gridStagger}ms` } });
129730
+ return React11.cloneElement(el2, { style: { ...prev, animationDelay: `${i2 * gridStagger}ms` } });
129551
129731
  };
129552
129732
  const inner = itemsPath && items[0] && ctx.provider ? /* @__PURE__ */ jsx11(
129553
129733
  BoundList,
@@ -129601,13 +129781,13 @@ var init_renderNode = __esm({
129601
129781
  revealProgress = /* @__PURE__ */ new Map();
129602
129782
  countWords = (s2) => s2.split(/\s+/).filter((t2) => t2 !== "").length;
129603
129783
  RevealText = ({ text: text9, reduce, markdownHtml }) => {
129604
- const tokens2 = React10.useMemo(() => text9.split(/(\s+)/).filter((t2) => t2 !== ""), [text9]);
129605
- const total = React10.useMemo(
129784
+ const tokens2 = React11.useMemo(() => text9.split(/(\s+)/).filter((t2) => t2 !== ""), [text9]);
129785
+ const total = React11.useMemo(
129606
129786
  () => markdownHtml != null ? revealHtml(markdownHtml, 0, void 0).total : countWords(text9),
129607
129787
  [text9, markdownHtml]
129608
129788
  );
129609
- const [shown2, setShown] = React10.useState(total);
129610
- const prevRef = React10.useRef(null);
129789
+ const [shown2, setShown] = React11.useState(total);
129790
+ const prevRef = React11.useRef(null);
129611
129791
  useIsomorphicLayoutEffect(() => {
129612
129792
  const prev = prevRef.current;
129613
129793
  prevRef.current = text9;
@@ -129730,8 +129910,8 @@ var init_renderNode = __esm({
129730
129910
  const boundInitials = useResolvedScalar(props.initials != null && isBinding(props.initials) ? props.initials : void 0, ctx);
129731
129911
  const boundAlt = useResolvedScalar(contentDescription, ctx);
129732
129912
  const fadeIn = motionDefaultsAnimate(ctx);
129733
- const [shownSrc, setShownSrc] = React10.useState(null);
129734
- const imgRef = React10.useRef(null);
129913
+ const [shownSrc, setShownSrc] = React11.useState(null);
129914
+ const imgRef = React11.useRef(null);
129735
129915
  const hasSource = props.url != null || props.initials != null || props.asset != null || props.icon != null;
129736
129916
  const banner = fillWidth === true || props.width == null && props.height == null && !props.initials;
129737
129917
  const w2 = banner ? "100%" : props.width ?? 40;
@@ -129745,7 +129925,7 @@ var init_renderNode = __esm({
129745
129925
  const ph = props.placeholder ? C2(props.placeholder, "#e6e6e6") : void 0;
129746
129926
  const imgUrl = props.url != null && isBinding(props.url) ? boundUrl : props.url;
129747
129927
  const imgInitials = props.initials != null && isBinding(props.initials) ? boundInitials : props.initials;
129748
- const [failedSrc, setFailedSrc] = React10.useState(null);
129928
+ const [failedSrc, setFailedSrc] = React11.useState(null);
129749
129929
  const resolvedSrc = imgUrl && typeof imgUrl === "string" ? resolveAssetUrl(imgUrl, ctx.assetBaseUrl) : null;
129750
129930
  const imgShown = !fadeIn || resolvedSrc != null && shownSrc === resolvedSrc;
129751
129931
  useIsomorphicLayoutEffect(() => {
@@ -129778,7 +129958,7 @@ var init_renderNode = __esm({
129778
129958
  if (imgInitials && typeof imgInitials === "string") {
129779
129959
  const alt = asText2(boundAlt).trim();
129780
129960
  const circle = avatarCircle(String(imgInitials), typeof w2 === "number" ? w2 : 40, C2, false, bodyFont(ctx));
129781
- return React10.cloneElement(circle, alt ? { role: "img", "aria-label": alt, [SELF_RENDERED_LEAF]: true } : { [ROLE_WHEN_NAMED]: "img", [SELF_RENDERED_LEAF]: true });
129961
+ return React11.cloneElement(circle, alt ? { role: "img", "aria-label": alt, [SELF_RENDERED_LEAF]: true } : { [ROLE_WHEN_NAMED]: "img", [SELF_RENDERED_LEAF]: true });
129782
129962
  }
129783
129963
  if (props.icon != null && props.url == null && props.asset == null && imgInitials == null) {
129784
129964
  const side2 = typeof w2 === "number" ? w2 : 40;
@@ -129843,7 +130023,7 @@ var init_renderNode = __esm({
129843
130023
  const a11y = described ? { role: "img", "aria-label": String(contentDescription), [SELF_RENDERED_LEAF]: true } : { "aria-hidden": "true", [INFERRED_DECORATIVE]: true, [SELF_RENDERED_LEAF]: true, [ROLE_WHEN_NAMED]: "img" };
129844
130024
  const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props.tint, ctx) ?? "textPrimary", "#636b78") });
129845
130025
  const swap = useIconSwap(iconName, ctx);
129846
- const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ? React10.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
130026
+ const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ? React11.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
129847
130027
  return /* @__PURE__ */ jsx11("span", { ...a11y, style: { display: "inline-grid", placeItems: "center", width: size + 6, height: size + 6, lineHeight: 1, flex: "none", ...wrap }, children: animatedGlyph });
129848
130028
  });
129849
130029
  EMPTY_STATE_SPACING = {
@@ -130015,12 +130195,12 @@ var init_renderNode = __esm({
130015
130195
  const C2 = ctx.color;
130016
130196
  const bound = useResolvedScalar(props.valuePath, ctx);
130017
130197
  const boundText = props.valuePath != null ? typeof bound === "string" ? bound : typeof bound === "number" ? String(bound) : "" : void 0;
130018
- const [typed, setTyped] = React10.useState(void 0);
130019
- React10.useEffect(() => {
130198
+ const [typed, setTyped] = React11.useState(void 0);
130199
+ React11.useEffect(() => {
130020
130200
  setTyped(void 0);
130021
130201
  }, [boundText, props.value, props.valuePath, typeof props.valuePath === "string" && props.valuePath.startsWith("$service:") ? ctx.provider : null]);
130022
130202
  const otpPath = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:") ? servicePath(props.valuePath) : "";
130023
- React10.useEffect(() => {
130203
+ React11.useEffect(() => {
130024
130204
  if (!ctx.provider || !otpPath) return;
130025
130205
  let subscribing = true;
130026
130206
  let active = true;
@@ -130110,12 +130290,38 @@ var init_renderNode = __esm({
130110
130290
  };
130111
130291
  return /* @__PURE__ */ jsx11("div", { ...a11y, style: { width: "100%", height: 6, borderRadius: 999, background: C2(boundTokenName(props.trackColorPath, props.trackColor, ctx) ?? "surfaceTertiary", "#eee"), overflow: "hidden", ...wrap }, children: /* @__PURE__ */ jsx11("div", { style: { width: `${Math.round((p2 ?? 0.4) * 100)}%`, height: "100%", borderRadius: 999, background: C2(boundTokenName(props.tintPath, props.tint, ctx) ?? "accentPrimary", "#116DFF"), opacity: p2 == null ? 0.45 : 1, ...animatedFill ? { transition: ctx.motionTransition(ctx.kit?.motion) } : {} } }) });
130112
130292
  });
130293
+ SnackbarNode = withExtras("SnackbarNode", ({ props, ctx, wrap }) => {
130294
+ const [phase, setPhase] = React11.useState("shown");
130295
+ const hideAfter = ctx.empty ? void 0 : snackbarAutoHideMs(props.durationMs);
130296
+ const identity = snackbarIdentity(props);
130297
+ React11.useEffect(() => {
130298
+ setPhase("shown");
130299
+ if (hideAfter === void 0) return;
130300
+ let fade;
130301
+ const hide = setTimeout(() => {
130302
+ setPhase("fading");
130303
+ fade = setTimeout(() => setPhase("gone"), SNACKBAR_FADE_MS);
130304
+ }, hideAfter);
130305
+ return () => {
130306
+ clearTimeout(hide);
130307
+ if (fade !== void 0) clearTimeout(fade);
130308
+ };
130309
+ }, [hideAfter, identity]);
130310
+ if (phase === "gone") return null;
130311
+ const dot = sevColor(ctx, props.severity ?? "info");
130312
+ return /* @__PURE__ */ jsxs8("div", { "data-snackbar-phase": phase, style: { display: "flex", alignItems: "center", gap: 10, background: "#1c1f26", color: "#fff", borderRadius: ctx.radius("md", 10), padding: "12px 14px", width: "100%", boxSizing: "border-box", fontFamily: bodyFont(ctx), fontWeight: 500, fontSize: pxToRem(14), ...wrap, ...phase === "fading" ? { opacity: 0, transition: `opacity ${SNACKBAR_FADE_MS}ms ease-out` } : {} }, children: [
130313
+ /* @__PURE__ */ jsx11("span", { style: { width: 18, height: 18, borderRadius: "50%", background: dot, display: "grid", placeItems: "center", fontSize: 11, flex: "none" }, children: "\u2713" }),
130314
+ /* @__PURE__ */ jsx11("span", { style: { flex: 1, minWidth: 0 }, children: txt(props.message, ctx) }),
130315
+ actionTextButton(ctx, props.action, asBoundText(props.actionLabel, ctx) || "Take action", "#fff", { flex: "none", textDecoration: "underline" })
130316
+ ] });
130317
+ });
130113
130318
  ACTIVITY_DEFAULT_NAME = "Loading";
130319
+ ACTIVITY_RING_ARC = 0.25;
130114
130320
  ActivityIndicatorNode = withExtras("ActivityIndicatorNode", ({ props, ctx, wrap }) => {
130115
130321
  const C2 = ctx.color;
130116
130322
  const size = props.size ?? 24;
130117
130323
  const tint = C2(boundTokenName(props.tintPath, props.tint, ctx) ?? "accentPrimary", "#116DFF");
130118
- const track = C2("surfaceTertiary", "#e3e6ea");
130324
+ const track = activityRingTrack(C2, tint, { cssMix: true });
130119
130325
  const thick = Math.max(3, Math.round(size / 8));
130120
130326
  const bound = useResolvedScalar(props.valuePath, ctx);
130121
130327
  const aiRaw = props.valuePath != null ? bound : props.value;
@@ -130128,7 +130334,11 @@ var init_renderNode = __esm({
130128
130334
  return /* @__PURE__ */ jsx11("div", { role: "progressbar", "aria-label": ACTIVITY_DEFAULT_NAME, ...a11y, style: { width: size, height: size, borderRadius: "50%", flex: "none", background: `conic-gradient(${tint} ${pct * 360}deg, ${track} 0deg)`, WebkitMask: ringMask, mask: ringMask, ...wrap } });
130129
130335
  }
130130
130336
  ensureSpinKeyframes();
130131
- return /* @__PURE__ */ jsx11("div", { role: "status", "aria-busy": "true", "aria-label": ACTIVITY_DEFAULT_NAME, style: { width: size, height: size, borderRadius: "50%", border: `${thick}px solid ${track}`, borderTopColor: tint, boxSizing: "border-box", flex: "none", animation: ctx.empty ? void 0 : "himalaya-spin 0.8s linear infinite", ...wrap } });
130337
+ if (props.ring === true) {
130338
+ const ringMask = `radial-gradient(farthest-side, transparent calc(100% - ${thick}px), #000 calc(100% - ${thick}px))`;
130339
+ return /* @__PURE__ */ jsx11("div", { role: "status", "aria-busy": "true", "aria-label": ACTIVITY_DEFAULT_NAME, "data-activity-look": "indeterminate-ring", style: { width: size, height: size, borderRadius: "50%", flex: "none", background: `conic-gradient(${tint} ${ACTIVITY_RING_ARC * 360}deg, ${track} 0deg)`, WebkitMask: ringMask, mask: ringMask, animation: ctx.empty || ctx.reduceMotion() ? void 0 : "himalaya-spin 0.8s linear infinite", ...wrap } });
130340
+ }
130341
+ return /* @__PURE__ */ jsx11("div", { role: "status", "aria-busy": "true", "aria-label": ACTIVITY_DEFAULT_NAME, style: { width: size, height: size, borderRadius: "50%", border: `${thick}px solid ${track}`, borderTopColor: tint, boxSizing: "border-box", flex: "none", animation: ctx.empty || ctx.reduceMotion() ? void 0 : "himalaya-spin 0.8s linear infinite", ...wrap } });
130132
130342
  });
130133
130343
  NATIVELY_TABBABLE = 'a[href], area[href], button, input:not([type="hidden"]), select, textarea, iframe, object, embed, audio[controls], video[controls], summary, [contenteditable]:not([contenteditable="false"]), [tabindex]';
130134
130344
  BottomSheetNode = (p2) => sheetIsNonModal(p2.props?.modal) ? /* @__PURE__ */ jsx11(BottomDrawerNode, { ...p2 }) : /* @__PURE__ */ jsx11(ModalBottomSheetNode, { ...p2 });
@@ -130140,8 +130350,8 @@ var init_renderNode = __esm({
130140
130350
  const gated = props.presentedPath != null || props.presented != null;
130141
130351
  const presented = props.presentedPath != null ? bound : props.presented;
130142
130352
  const gateOpen = !gated || presented === true || presented === "true";
130143
- const [dismissed, setDismissed] = React10.useState(false);
130144
- React10.useEffect(() => {
130353
+ const [dismissed, setDismissed] = React11.useState(false);
130354
+ React11.useEffect(() => {
130145
130355
  if (!gateOpen) setDismissed(false);
130146
130356
  }, [gateOpen]);
130147
130357
  const shown2 = gateOpen && !dismissed;
@@ -130149,26 +130359,26 @@ var init_renderNode = __esm({
130149
130359
  const dismissible = props.dismissible !== false;
130150
130360
  const edge = sheetEdge(props.edge);
130151
130361
  const detents = edge === "bottom" ? sheetDetents(props.detents) : [];
130152
- const [detentIndex, setDetentIndex] = React10.useState(0);
130153
- React10.useEffect(() => {
130362
+ const [detentIndex, setDetentIndex] = React11.useState(0);
130363
+ React11.useEffect(() => {
130154
130364
  if (!shown2) setDetentIndex(0);
130155
130365
  }, [shown2]);
130156
- const dialogRef = React10.useRef(null);
130366
+ const dialogRef = React11.useRef(null);
130157
130367
  const trapTab = useModalOverlay(dialogRef, shown2 && modal);
130158
- const latest = React10.useRef({ ctx, onDismiss: props.onDismiss });
130368
+ const latest = React11.useRef({ ctx, onDismiss: props.onDismiss });
130159
130369
  latest.current = { ctx, onDismiss: props.onDismiss };
130160
- const closed = React10.useRef(false);
130161
- React10.useEffect(() => {
130370
+ const closed = React11.useRef(false);
130371
+ React11.useEffect(() => {
130162
130372
  if (shown2) closed.current = false;
130163
130373
  }, [shown2]);
130164
- const dismiss = React10.useCallback(() => {
130374
+ const dismiss = React11.useCallback(() => {
130165
130375
  if (closed.current) return;
130166
130376
  closed.current = true;
130167
130377
  setDismissed(true);
130168
130378
  const { ctx: now, onDismiss } = latest.current;
130169
130379
  if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
130170
130380
  }, []);
130171
- React10.useEffect(() => {
130381
+ React11.useEffect(() => {
130172
130382
  if (!shown2 || !dismissible) return;
130173
130383
  const doc = dialogRef.current?.ownerDocument;
130174
130384
  if (!doc) return;
@@ -130182,11 +130392,11 @@ var init_renderNode = __esm({
130182
130392
  doc.addEventListener("keydown", onKey, true);
130183
130393
  return () => doc.removeEventListener("keydown", onKey, true);
130184
130394
  }, [shown2, dismissible, dismiss]);
130185
- const drag = React10.useRef(null);
130395
+ const drag = React11.useRef(null);
130186
130396
  const reduceMotion = ctx.reduceMotion();
130187
- const [mounted, setMounted] = React10.useState(shown2);
130188
- const [entered, setEntered] = React10.useState(shown2 && ctx.staticRender === true);
130189
- React10.useEffect(() => {
130397
+ const [mounted, setMounted] = React11.useState(shown2);
130398
+ const [entered, setEntered] = React11.useState(shown2 && ctx.staticRender === true);
130399
+ React11.useEffect(() => {
130190
130400
  if (shown2) {
130191
130401
  setMounted(true);
130192
130402
  if (reduceMotion || typeof requestAnimationFrame !== "function") {
@@ -130210,8 +130420,8 @@ var init_renderNode = __esm({
130210
130420
  const t2 = setTimeout(() => setMounted(false), DRAWER_EXIT_MS);
130211
130421
  return () => clearTimeout(t2);
130212
130422
  }, [shown2, reduceMotion]);
130213
- const scrimRef = React10.useRef(null);
130214
- const [rtl, setRtl] = React10.useState(false);
130423
+ const scrimRef = React11.useRef(null);
130424
+ const [rtl, setRtl] = React11.useState(false);
130215
130425
  useIsomorphicLayoutEffect(() => {
130216
130426
  const el2 = scrimRef.current;
130217
130427
  if (el2 && el2.ownerDocument.defaultView) setRtl(el2.ownerDocument.defaultView.getComputedStyle(el2).direction === "rtl");
@@ -130319,8 +130529,8 @@ var init_renderNode = __esm({
130319
130529
  const gated = props.presentedPath != null || props.presented != null;
130320
130530
  const presented = props.presentedPath != null ? bound : props.presented;
130321
130531
  const gateOpen = !gated || presented === true || presented === "true";
130322
- const [dismissed, setDismissed] = React10.useState(false);
130323
- React10.useEffect(() => {
130532
+ const [dismissed, setDismissed] = React11.useState(false);
130533
+ React11.useEffect(() => {
130324
130534
  if (!gateOpen) setDismissed(false);
130325
130535
  }, [gateOpen]);
130326
130536
  const shown2 = gateOpen && !dismissed;
@@ -130328,18 +130538,18 @@ var init_renderNode = __esm({
130328
130538
  const autoMs = drawerAutoDismissMs(props.autoDismissMs);
130329
130539
  const placement = sheetPlacement(props.placement);
130330
130540
  const detents = sheetDetents(props.detents);
130331
- const [detentIndex, setDetentIndex] = React10.useState(0);
130332
- const [expanded, setExpanded] = React10.useState(false);
130333
- React10.useEffect(() => {
130541
+ const [detentIndex, setDetentIndex] = React11.useState(0);
130542
+ const [expanded, setExpanded] = React11.useState(false);
130543
+ React11.useEffect(() => {
130334
130544
  if (!shown2) {
130335
130545
  setDetentIndex(0);
130336
130546
  setExpanded(false);
130337
130547
  }
130338
130548
  }, [shown2]);
130339
130549
  const reduceMotion = ctx.reduceMotion();
130340
- const [mounted, setMounted] = React10.useState(shown2);
130341
- const [entered, setEntered] = React10.useState(shown2 && ctx.staticRender === true);
130342
- React10.useEffect(() => {
130550
+ const [mounted, setMounted] = React11.useState(shown2);
130551
+ const [entered, setEntered] = React11.useState(shown2 && ctx.staticRender === true);
130552
+ React11.useEffect(() => {
130343
130553
  if (shown2) {
130344
130554
  setMounted(true);
130345
130555
  if (reduceMotion || typeof requestAnimationFrame !== "function") {
@@ -130363,10 +130573,10 @@ var init_renderNode = __esm({
130363
130573
  const t2 = setTimeout(() => setMounted(false), DRAWER_EXIT_MS);
130364
130574
  return () => clearTimeout(t2);
130365
130575
  }, [shown2, reduceMotion]);
130366
- const anchorRef = React10.useRef(null);
130367
- const panelRef = React10.useRef(null);
130368
- const [host, setHost] = React10.useState(null);
130369
- const [hostTop, setHostTop] = React10.useState(true);
130576
+ const anchorRef = React11.useRef(null);
130577
+ const panelRef = React11.useRef(null);
130578
+ const [host, setHost] = React11.useState(null);
130579
+ const [hostTop, setHostTop] = React11.useState(true);
130370
130580
  useIsomorphicLayoutEffect(() => {
130371
130581
  if (!host) {
130372
130582
  setHostTop(true);
@@ -130388,13 +130598,13 @@ var init_renderNode = __esm({
130388
130598
  };
130389
130599
  }, [host, mounted]);
130390
130600
  useIsomorphicLayoutEffect(() => {
130391
- const scope = anchorRef.current?.closest(`[${MODAL_SCOPE_ATTR}]`);
130392
- const own5 = (attr3) => Array.from(scope?.querySelectorAll(`[${attr3}]`) ?? []).find((el2) => el2.closest(`[${MODAL_SCOPE_ATTR}]`) === scope) ?? null;
130601
+ const scope2 = anchorRef.current?.closest(`[${MODAL_SCOPE_ATTR}]`);
130602
+ const own5 = (attr3) => Array.from(scope2?.querySelectorAll(`[${attr3}]`) ?? []).find((el2) => el2.closest(`[${MODAL_SCOPE_ATTR}]`) === scope2) ?? null;
130393
130603
  const overlay = placement === "overlay" ? own5(SHEET_OVERLAY_HOST_ATTR) : null;
130394
130604
  setHost(overlay ?? own5(DRAWER_HOST_ATTR));
130395
130605
  }, [mounted, placement]);
130396
130606
  const overHost = host?.hasAttribute(SHEET_OVERLAY_HOST_ATTR) ?? false;
130397
- const [regionPx, setRegionPx] = React10.useState(0);
130607
+ const [regionPx, setRegionPx] = React11.useState(0);
130398
130608
  useIsomorphicLayoutEffect(() => {
130399
130609
  if (!detents.length || !mounted) return;
130400
130610
  const region = host ? overHost ? host.parentElement : host.previousElementSibling : null;
@@ -130404,38 +130614,38 @@ var init_renderNode = __esm({
130404
130614
  window.addEventListener("resize", measure2);
130405
130615
  return () => window.removeEventListener("resize", measure2);
130406
130616
  }, [host, overHost, mounted, detents.length]);
130407
- const latest = React10.useRef({ ctx, onDismiss: props.onDismiss });
130617
+ const latest = React11.useRef({ ctx, onDismiss: props.onDismiss });
130408
130618
  latest.current = { ctx, onDismiss: props.onDismiss };
130409
- const closed = React10.useRef(false);
130410
- const remaining = React10.useRef(autoMs ?? 0);
130411
- React10.useEffect(() => {
130619
+ const closed = React11.useRef(false);
130620
+ const remaining = React11.useRef(autoMs ?? 0);
130621
+ React11.useEffect(() => {
130412
130622
  if (!shown2) return;
130413
130623
  closed.current = false;
130414
130624
  remaining.current = autoMs ?? 0;
130415
130625
  }, [shown2, autoMs]);
130416
- const close = React10.useCallback(() => {
130626
+ const close = React11.useCallback(() => {
130417
130627
  if (closed.current) return;
130418
130628
  closed.current = true;
130419
130629
  setDismissed(true);
130420
130630
  const { ctx: now, onDismiss } = latest.current;
130421
130631
  if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
130422
130632
  }, []);
130423
- const toDetent = React10.useCallback((next, from) => {
130633
+ const toDetent = React11.useCallback((next, from) => {
130424
130634
  if (next > from) setExpanded(true);
130425
130635
  setDetentIndex(next);
130426
130636
  }, []);
130427
- const [hover, setHover] = React10.useState(false);
130428
- const [pressed, setPressed] = React10.useState(false);
130429
- const [focusIn, setFocusIn] = React10.useState(false);
130637
+ const [hover, setHover] = React11.useState(false);
130638
+ const [pressed, setPressed] = React11.useState(false);
130639
+ const [focusIn, setFocusIn] = React11.useState(false);
130430
130640
  const paused = hover || pressed || focusIn;
130431
- React10.useEffect(() => {
130641
+ React11.useEffect(() => {
130432
130642
  if (!shown2) {
130433
130643
  setHover(false);
130434
130644
  setPressed(false);
130435
130645
  setFocusIn(false);
130436
130646
  }
130437
130647
  }, [shown2]);
130438
- React10.useEffect(() => {
130648
+ React11.useEffect(() => {
130439
130649
  if (!shown2 || !hostTop || autoMs == null || paused || expanded) return;
130440
130650
  const since = Date.now();
130441
130651
  const t2 = setTimeout(() => {
@@ -130446,7 +130656,7 @@ var init_renderNode = __esm({
130446
130656
  remaining.current = drawerRemainingMs(remaining.current, Date.now() - since);
130447
130657
  };
130448
130658
  }, [shown2, hostTop, autoMs, paused, expanded, close]);
130449
- React10.useEffect(() => {
130659
+ React11.useEffect(() => {
130450
130660
  if (!shown2 || !dismissible) return;
130451
130661
  const doc = panelRef.current?.ownerDocument;
130452
130662
  if (!doc) return;
@@ -130459,13 +130669,13 @@ var init_renderNode = __esm({
130459
130669
  doc.addEventListener("keydown", onKey, true);
130460
130670
  return () => doc.removeEventListener("keydown", onKey, true);
130461
130671
  }, [shown2, dismissible, close, host]);
130462
- const drag = React10.useRef(null);
130463
- const dragged = React10.useRef(false);
130464
- const [dragDy, setDragDy] = React10.useState(0);
130465
- React10.useEffect(() => {
130672
+ const drag = React11.useRef(null);
130673
+ const dragged = React11.useRef(false);
130674
+ const [dragDy, setDragDy] = React11.useState(0);
130675
+ React11.useEffect(() => {
130466
130676
  if (!shown2) setDragDy(0);
130467
130677
  }, [shown2]);
130468
- const dragState = React10.useRef({ index: 0, count: 0, dismissible });
130678
+ const dragState = React11.useRef({ index: 0, count: 0, dismissible });
130469
130679
  if (!shown2 && !mounted) return /* @__PURE__ */ jsx11("span", { ref: anchorRef, "data-bottom-drawer-anchor": "", hidden: true, ...{ [NODE_EXTRAS_TARGET]: "bottom-drawer-panel" } });
130470
130680
  const sheet = idiomControls(ctx.idiom).sheet;
130471
130681
  const r3 = `${sheet.cornerRadius}px`;
@@ -130607,23 +130817,23 @@ var init_renderNode = __esm({
130607
130817
  const rich = title !== "";
130608
130818
  const trigger = resolveTooltipTrigger(props.trigger, "pointer");
130609
130819
  const edge = resolveOverlayEdge("Tooltip", props.edge);
130610
- const [open, setOpen] = React10.useState(false);
130611
- const anchorRef = React10.useRef(null);
130612
- const bubbleRef = React10.useRef(null);
130613
- const pressTimer = React10.useRef(null);
130820
+ const [open, setOpen] = React11.useState(false);
130821
+ const anchorRef = React11.useRef(null);
130822
+ const bubbleRef = React11.useRef(null);
130823
+ const pressTimer = React11.useRef(null);
130614
130824
  const placement = useFlippedEdge(edge, open, bubbleRef, anchorRef);
130615
130825
  const placed = placement.edge;
130616
- const latest = React10.useRef({ ctx, onDismiss: props.onDismiss, open });
130826
+ const latest = React11.useRef({ ctx, onDismiss: props.onDismiss, open });
130617
130827
  latest.current = { ctx, onDismiss: props.onDismiss, open };
130618
- const holding = React10.useRef({ hover: false, focus: false });
130619
- const [needsTabStop, setNeedsTabStop] = React10.useState(false);
130828
+ const holding = React11.useRef({ hover: false, focus: false });
130829
+ const [needsTabStop, setNeedsTabStop] = React11.useState(false);
130620
130830
  useIsomorphicLayoutEffect(() => {
130621
130831
  const el2 = anchorRef.current;
130622
130832
  const want = trigger === "hover" && el2 != null && !hasTabStop(el2);
130623
130833
  if (want !== needsTabStop) setNeedsTabStop(want);
130624
130834
  });
130625
- const show = React10.useCallback(() => setOpen(true), []);
130626
- const dismiss = React10.useCallback(() => {
130835
+ const show = React11.useCallback(() => setOpen(true), []);
130836
+ const dismiss = React11.useCallback(() => {
130627
130837
  holding.current = { hover: false, focus: false };
130628
130838
  const { ctx: now, onDismiss, open: wasOpen } = latest.current;
130629
130839
  if (!wasOpen) return;
@@ -130631,7 +130841,7 @@ var init_renderNode = __esm({
130631
130841
  setOpen(false);
130632
130842
  if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
130633
130843
  }, []);
130634
- React10.useEffect(() => {
130844
+ React11.useEffect(() => {
130635
130845
  if (!open) return;
130636
130846
  const doc = bubbleRef.current?.ownerDocument;
130637
130847
  if (!doc) return;
@@ -130655,7 +130865,7 @@ var init_renderNode = __esm({
130655
130865
  if (timer) clearTimeout(timer);
130656
130866
  };
130657
130867
  }, [open, trigger, dismiss]);
130658
- React10.useEffect(() => () => {
130868
+ React11.useEffect(() => () => {
130659
130869
  if (pressTimer.current) clearTimeout(pressTimer.current);
130660
130870
  }, []);
130661
130871
  const cancelPress = () => {
@@ -130695,7 +130905,7 @@ var init_renderNode = __esm({
130695
130905
  };
130696
130906
  const hint = [title, text9].filter((s2) => s2 !== "").join(". ");
130697
130907
  const anchor = props.anchor ? renderNode(props.anchor, ctx) : null;
130698
- const wrapperHintId = `hm-tip-hint${React10.useId()}`;
130908
+ const wrapperHintId = `hm-tip-hint${React11.useId()}`;
130699
130909
  useIsomorphicLayoutEffect(() => {
130700
130910
  const wrapper = anchorRef.current;
130701
130911
  if (!wrapper || !hint || needsTabStop) return;
@@ -130717,7 +130927,7 @@ var init_renderNode = __esm({
130717
130927
  /* @__PURE__ */ jsx11(OverlayAnchorClip, { wrap, children: needsTabStop ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
130718
130928
  anchor,
130719
130929
  hint && /* @__PURE__ */ jsx11("span", { id: wrapperHintId, hidden: true, "data-hm-a11y-hint": "", children: hint })
130720
- ] }) : hint && React10.isValidElement(anchor) ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
130930
+ ] }) : hint && React11.isValidElement(anchor) ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
130721
130931
  /* @__PURE__ */ jsx11(A11yHintDescription, { hint, children: anchor }),
130722
130932
  /* @__PURE__ */ jsx11("span", { id: wrapperHintId, hidden: true, "data-hm-a11y-hint": "", children: hint })
130723
130933
  ] }) : /* @__PURE__ */ jsxs8(Fragment4, { children: [
@@ -130738,24 +130948,24 @@ var init_renderNode = __esm({
130738
130948
  const gateOpen = gate === true || gate === "true";
130739
130949
  const literal = props.presentedPath == null && props.presented != null;
130740
130950
  const identity = { path: props.presentedPath, presented: props.presented, provider: ctx.provider };
130741
- const [local, setLocal] = React10.useState({ ...identity, opened: false, dismissed: false });
130951
+ const [local, setLocal] = React11.useState({ ...identity, opened: false, dismissed: false });
130742
130952
  const sameGate = local.path === identity.path && local.presented === identity.presented && local.provider === identity.provider;
130743
130953
  const current = sameGate ? local : { ...identity, opened: false, dismissed: false };
130744
130954
  if (!sameGate) setLocal(current);
130745
- React10.useEffect(() => {
130955
+ React11.useEffect(() => {
130746
130956
  if (!gateOpen) setLocal((previous) => previous.dismissed ? { ...previous, dismissed: false } : previous);
130747
130957
  }, [gateOpen]);
130748
130958
  const shown2 = !gated || (gateOpen || current.opened) && !current.dismissed;
130749
130959
  const modal = gated && isOverlayModal("Popover", props.modal);
130750
- const dialogRef = React10.useRef(null);
130751
- const anchorRef = React10.useRef(null);
130752
- const boxRef = React10.useRef(null);
130960
+ const dialogRef = React11.useRef(null);
130961
+ const anchorRef = React11.useRef(null);
130962
+ const boxRef = React11.useRef(null);
130753
130963
  const trapTab = useModalOverlay(dialogRef, shown2 && modal);
130754
130964
  const placement = useFlippedEdge(resolveOverlayEdge("Popover", props.edge), gated && shown2, dialogRef, boxRef, 6);
130755
130965
  const placed = placement.edge;
130756
- const latest = React10.useRef({ ctx, onDismiss: props.onDismiss });
130966
+ const latest = React11.useRef({ ctx, onDismiss: props.onDismiss });
130757
130967
  latest.current = { ctx, onDismiss: props.onDismiss };
130758
- React10.useEffect(() => {
130968
+ React11.useEffect(() => {
130759
130969
  if (!gated || !shown2) return;
130760
130970
  const doc = dialogRef.current?.ownerDocument;
130761
130971
  if (!doc) return;
@@ -130793,8 +131003,8 @@ var init_renderNode = __esm({
130793
131003
  if (shown2) return;
130794
131004
  setLocal({ ...identity, opened: true, dismissed: false });
130795
131005
  } : void 0;
130796
- const [anchorIsButton, setAnchorIsButton] = React10.useState(false);
130797
- const [needsSeparateOpener, setNeedsSeparateOpener] = React10.useState(false);
131006
+ const [anchorIsButton, setAnchorIsButton] = React11.useState(false);
131007
+ const [needsSeparateOpener, setNeedsSeparateOpener] = React11.useState(false);
130798
131008
  useIsomorphicLayoutEffect(() => {
130799
131009
  const el2 = anchorRef.current;
130800
131010
  const want = literal && el2 != null && !hasTabStop(el2);
@@ -130821,7 +131031,7 @@ var init_renderNode = __esm({
130821
131031
  });
130822
131032
  ChipsInputNode = withExtras("ChipsInputNode", ({ props, ctx, wrap }) => {
130823
131033
  const placeholderText = useBoundString(props.placeholder, ctx);
130824
- const [draft, setDraft] = React10.useState("");
131034
+ const [draft, setDraft] = React11.useState("");
130825
131035
  const C2 = ctx.color;
130826
131036
  const bound = useResolvedScalar(props.valuesPath, ctx);
130827
131037
  const raw = props.valuesPath != null ? bound : props.values;
@@ -131014,7 +131224,7 @@ var init_renderNode = __esm({
131014
131224
  const who = asText2(a2.initials).trim();
131015
131225
  const initials = avatarCircle(who || "?", size, C2, true, bodyFont(ctx));
131016
131226
  const photo = typeof a2.imageUrl === "string" && a2.imageUrl && !isBinding(a2.imageUrl) ? a2.imageUrl : "";
131017
- const circle = photo ? React10.cloneElement(
131227
+ const circle = photo ? React11.cloneElement(
131018
131228
  initials,
131019
131229
  { style: { ...initials.props.style, position: "relative", overflow: "hidden" } },
131020
131230
  initials.props.children,
@@ -131022,7 +131232,7 @@ var init_renderNode = __esm({
131022
131232
  e2.currentTarget.style.display = "none";
131023
131233
  }, style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } })
131024
131234
  ) : initials;
131025
- return who ? /* @__PURE__ */ jsx11("div", { role: "listitem", style: wrapStyle, children: React10.cloneElement(circle, { role: "img", "aria-label": who }) }, i2) : /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: wrapStyle, children: circle }, i2);
131235
+ return who ? /* @__PURE__ */ jsx11("div", { role: "listitem", style: wrapStyle, children: React11.cloneElement(circle, { role: "img", "aria-label": who }) }, i2) : /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: wrapStyle, children: circle }, i2);
131026
131236
  }),
131027
131237
  overflow > 0 && /* @__PURE__ */ jsx11("div", { role: "listitem", style: { marginLeft: -(size - shift), width: size, height: size, borderRadius: "50%", border: `2px solid ${C2("surfacePrimary", "#fff")}`, background: C2("surfaceTertiary", "#e6e6e6"), color: C2("textPrimary", "#111"), display: "grid", placeItems: "center", fontSize: size * 0.32, fontWeight: 700, fontFamily: bodyFont(ctx) }, children: /* @__PURE__ */ jsxs8("span", { role: "img", "aria-label": `${overflow} more`, children: [
131028
131238
  "+",
@@ -131043,7 +131253,7 @@ var init_renderNode = __esm({
131043
131253
  const declared = Array.isArray(props.series) ? props.series : [];
131044
131254
  const multi = declared.length > 0;
131045
131255
  const singleBound = useBoundValue(ctx, typeof props.valuesPath === "string" && !multi ? props.valuesPath : "");
131046
- const seriesBindings = React10.useMemo(
131256
+ const seriesBindings = React11.useMemo(
131047
131257
  () => declared.map((d2) => typeof d2?.valuesPath === "string" ? d2.valuesPath : ""),
131048
131258
  // eslint-disable-next-line react-hooks/exhaustive-deps
131049
131259
  [declared.map((d2) => String(d2?.valuesPath ?? "")).join("\0")]
@@ -131189,9 +131399,9 @@ var init_renderNode = __esm({
131189
131399
  ] }) });
131190
131400
  });
131191
131401
  ShapeNode = withExtras("ShapeNode", ({ props, ctx, wrap }) => {
131192
- const ref = React10.useRef(null);
131193
- const [box, setBox] = React10.useState(null);
131194
- React10.useEffect(() => {
131402
+ const ref = React11.useRef(null);
131403
+ const [box, setBox] = React11.useState(null);
131404
+ React11.useEffect(() => {
131195
131405
  const el2 = ref.current;
131196
131406
  if (!el2) return;
131197
131407
  const measure2 = () => {
@@ -131349,10 +131559,10 @@ var init_renderNode = __esm({
131349
131559
  const isPlayable = !isFailed && !isUploading;
131350
131560
  const isPlaying = state === "playing";
131351
131561
  const isLoading = state === "loading";
131352
- const [scrub, setScrub] = React10.useState(null);
131353
- const [seeked, setSeeked] = React10.useState(null);
131562
+ const [scrub, setScrub] = React11.useState(null);
131563
+ const [seeked, setSeeked] = React11.useState(null);
131354
131564
  const positionMs = Math.max(0, num4(props.positionMsPath != null ? boundPosition : void 0, props.positionMs, 0));
131355
- React10.useEffect(() => {
131565
+ React11.useEffect(() => {
131356
131566
  setSeeked(null);
131357
131567
  }, [positionMs]);
131358
131568
  const effectivePositionMs = seeked ?? positionMs;
@@ -131394,8 +131604,8 @@ var init_renderNode = __esm({
131394
131604
  const barW = Math.max(0.6, slot * 0.58);
131395
131605
  const cut2 = progress * W2;
131396
131606
  const rates = Array.isArray(props.rates) ? props.rates.map(Number).filter((n2) => n2 > 0) : [];
131397
- const [pickedRate, setPickedRate] = React10.useState(null);
131398
- React10.useEffect(() => {
131607
+ const [pickedRate, setPickedRate] = React11.useState(null);
131608
+ React11.useEffect(() => {
131399
131609
  setPickedRate(null);
131400
131610
  }, [rate]);
131401
131611
  const effectiveRate = pickedRate ?? rate;
@@ -131572,9 +131782,9 @@ var init_renderNode = __esm({
131572
131782
  const items = (props.__pager ? props.pages : props.items) ?? [];
131573
131783
  const pages2 = items.filter((page) => isNodeLike(page) || page?.type);
131574
131784
  const requested = Math.max(0, Math.min(pages2.length - 1, props.currentIndex ?? 0));
131575
- const [current, setCurrent] = React10.useState(requested);
131576
- const rail = React10.useRef(null);
131577
- const currentRef = React10.useRef(current);
131785
+ const [current, setCurrent] = React11.useState(requested);
131786
+ const rail = React11.useRef(null);
131787
+ const currentRef = React11.useRef(current);
131578
131788
  const itemsPath = props.itemsPath ?? props.items_path;
131579
131789
  const boundRail = !!itemsPath && !!items[0] && !!ctx.provider;
131580
131790
  const select2 = (index) => {
@@ -131583,12 +131793,12 @@ var init_renderNode = __esm({
131583
131793
  setCurrent(index);
131584
131794
  if (props.onChange && ctx.onAction) ctx.onAction({ ...props.onChange, args: { ...props.onChange.args ?? {}, index } });
131585
131795
  };
131586
- React10.useEffect(() => {
131796
+ React11.useEffect(() => {
131587
131797
  currentRef.current = requested;
131588
131798
  setCurrent(requested);
131589
131799
  if (rail.current && !boundRail) rail.current.scrollLeft = requested * rail.current.clientWidth;
131590
131800
  }, [requested, boundRail, pages2.length]);
131591
- React10.useEffect(() => {
131801
+ React11.useEffect(() => {
131592
131802
  const interval = props.autoplayIntervalMs;
131593
131803
  if (props.__pager || boundRail || !Number.isFinite(interval) || interval <= 0 || pages2.length < 2 || ctx.reduceMotion()) return;
131594
131804
  const timer = setInterval(() => {
@@ -131631,19 +131841,19 @@ var init_renderNode = __esm({
131631
131841
  const opts = Array.isArray(rawOpts) ? rawOpts : [];
131632
131842
  const selectedId = isBinding(props.selectedId) ? boundSel : props.selectedId;
131633
131843
  const selIdx = Math.max(0, opts.findIndex((o2) => o2?.id === selectedId));
131634
- const viewport = React10.useRef(null);
131635
- const settle = React10.useRef(void 0);
131636
- const pickerId = React10.useId();
131844
+ const viewport = React11.useRef(null);
131845
+ const settle = React11.useRef(void 0);
131846
+ const pickerId = React11.useId();
131637
131847
  const interactive = !!ctx.onAction && !!props.onChange;
131638
131848
  const emit = (index) => {
131639
131849
  const id = opts[index]?.id;
131640
131850
  if (!interactive || id == null || index === selIdx) return;
131641
131851
  ctx.onAction({ ...props.onChange, args: { ...props.onChange.args ?? {}, selectedId: String(id) } });
131642
131852
  };
131643
- React10.useEffect(() => {
131853
+ React11.useEffect(() => {
131644
131854
  if (viewport.current) viewport.current.scrollTop = selIdx * 32;
131645
131855
  }, [selIdx, opts.length]);
131646
- React10.useEffect(() => () => clearTimeout(settle.current), []);
131856
+ React11.useEffect(() => () => clearTimeout(settle.current), []);
131647
131857
  return /* @__PURE__ */ jsxs8("div", { style: { position: "relative", width: "100%", maxWidth: 220, height: 160, overflow: "hidden", background: C2("surfaceSecondary", "#f5f7fa"), borderRadius: 12, ...wrap }, children: [
131648
131858
  /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: { position: "absolute", top: 64, left: 8, right: 8, height: 32, background: C2("surfacePrimary", "#fff"), borderRadius: 8, boxShadow: "inset 0 0 0 1px rgba(0,0,0,.06)" } }),
131649
131859
  /* @__PURE__ */ jsx11(
@@ -131754,23 +131964,23 @@ var init_renderNode = __esm({
131754
131964
  const hasEvents = !!(props.onMapTap || props.onMarkerTap || props.onRegionChange || props.onShapeTap);
131755
131965
  const boundShapes = useResolvedScalar(props.shapesPath, ctx);
131756
131966
  const shapesRaw = Array.isArray(boundShapes) ? boundShapes : Array.isArray(props.shapes) ? props.shapes : [];
131757
- const shapes = React10.useMemo(() => shapesRaw.map((sh) => {
131967
+ const shapes = React11.useMemo(() => shapesRaw.map((sh) => {
131758
131968
  const kind = parseShapeKind(sh?.kind);
131759
131969
  const pts = Array.isArray(sh?.points) ? sh.points.filter((p2) => p2 && typeof p2.latitude === "number" && typeof p2.longitude === "number") : [];
131760
131970
  const ring = kind === "circle" && pts.length ? circleRing(pts[0].latitude, pts[0].longitude, typeof sh.radiusM === "number" ? sh.radiusM : 0) : pts;
131761
131971
  return { ...sh, kind, points: ring };
131762
131972
  }), [JSON.stringify(shapesRaw)]);
131763
131973
  const boundCameraRaw = useResolvedScalar(props.cameraPath, ctx);
131764
- const commandedCamera = React10.useMemo(() => decodeCamera(boundCameraRaw), [boundCameraRaw]);
131765
- const [box, setBox] = React10.useState({ w: 400, h: h2 });
131766
- const [tileStatus, setTileStatus] = React10.useState({});
131767
- const [userCam, setUserCam] = React10.useState(null);
131768
- const dragRef = React10.useRef(null);
131769
- const dragMovedRef = React10.useRef(false);
131770
- const regionReportedRef = React10.useRef(false);
131771
- const [boxEl, setBoxEl] = React10.useState(null);
131772
- const attachBox = React10.useCallback((el2) => setBoxEl(el2), []);
131773
- React10.useEffect(() => {
131974
+ const commandedCamera = React11.useMemo(() => decodeCamera(boundCameraRaw), [boundCameraRaw]);
131975
+ const [box, setBox] = React11.useState({ w: 400, h: h2 });
131976
+ const [tileStatus, setTileStatus] = React11.useState({});
131977
+ const [userCam, setUserCam] = React11.useState(null);
131978
+ const dragRef = React11.useRef(null);
131979
+ const dragMovedRef = React11.useRef(false);
131980
+ const regionReportedRef = React11.useRef(false);
131981
+ const [boxEl, setBoxEl] = React11.useState(null);
131982
+ const attachBox = React11.useCallback((el2) => setBoxEl(el2), []);
131983
+ React11.useEffect(() => {
131774
131984
  const el2 = boxEl;
131775
131985
  if (!el2) return;
131776
131986
  const measure2 = () => {
@@ -131793,12 +132003,12 @@ var init_renderNode = __esm({
131793
132003
  const explicitSchematic = schematic && props.routeMode?.toLowerCase() === "schematic";
131794
132004
  const usesTileArm = !explicitSchematic && (otherTileReason || hasStaticMarkers) && (follow || !schematic);
131795
132005
  const pinsOnly = hasStaticMarkers && !otherTileReason;
131796
- const [userFix, setUserFix] = React10.useState(null);
131797
- const [followBroken, setFollowBroken] = React10.useState(false);
131798
- React10.useEffect(() => {
132006
+ const [userFix, setUserFix] = React11.useState(null);
132007
+ const [followBroken, setFollowBroken] = React11.useState(false);
132008
+ React11.useEffect(() => {
131799
132009
  if (follow) setFollowBroken(false);
131800
132010
  }, [follow]);
131801
- React10.useEffect(() => {
132011
+ React11.useEffect(() => {
131802
132012
  if (!observeUserLocation || !usesTileArm) return;
131803
132013
  const geo = typeof navigator !== "undefined" ? navigator.geolocation : void 0;
131804
132014
  if (!geo || typeof geo.watchPosition !== "function") return;
@@ -131825,7 +132035,7 @@ var init_renderNode = __esm({
131825
132035
  const z4 = userCam?.z ?? fitted;
131826
132036
  const cLat = followActive ? userFix.lat : userCam?.lat ?? baseLat;
131827
132037
  const cLng = followActive ? userFix.lng : userCam?.lng ?? baseLng;
131828
- React10.useEffect(() => {
132038
+ React11.useEffect(() => {
131829
132039
  const resolved2 = resolveCamera(commandedCamera, cLat, cLng, z4);
131830
132040
  if (!resolved2) return;
131831
132041
  setFollowBroken(true);
@@ -131907,7 +132117,7 @@ var init_renderNode = __esm({
131907
132117
  const endDrag = () => {
131908
132118
  dragRef.current = null;
131909
132119
  };
131910
- React10.useEffect(() => {
132120
+ React11.useEffect(() => {
131911
132121
  if (!boxEl || !usesTileArm || !interactive) return;
131912
132122
  const zoomOnWheel = (event) => {
131913
132123
  event.preventDefault();
@@ -131917,7 +132127,7 @@ var init_renderNode = __esm({
131917
132127
  boxEl.addEventListener("wheel", zoomOnWheel, { passive: false });
131918
132128
  return () => boxEl.removeEventListener("wheel", zoomOnWheel);
131919
132129
  }, [boxEl, usesTileArm, interactive, z4, cLat, cLng]);
131920
- React10.useEffect(() => {
132130
+ React11.useEffect(() => {
131921
132131
  const action = props.onRegionChange;
131922
132132
  const fire = ctx.onAction;
131923
132133
  if (!usesTileArm || !action || !fire) return;
@@ -132054,30 +132264,30 @@ var init_renderNode = __esm({
132054
132264
  const items = Array.isArray(props.items) ? props.items : [];
132055
132265
  const pages2 = items.filter((p2) => isNodeLike(p2) || p2?.type);
132056
132266
  const count2 = pages2.length;
132057
- const [index, setIndex] = React10.useState(typeof props.currentIndex === "number" ? props.currentIndex : 0);
132058
- const indexRef = React10.useRef(index);
132059
- const trackRef = React10.useRef(null);
132060
- const [hovered, setHovered] = React10.useState(false);
132061
- const [focused, setFocused] = React10.useState(false);
132267
+ const [index, setIndex] = React11.useState(typeof props.currentIndex === "number" ? props.currentIndex : 0);
132268
+ const indexRef = React11.useRef(index);
132269
+ const trackRef = React11.useRef(null);
132270
+ const [hovered, setHovered] = React11.useState(false);
132271
+ const [focused, setFocused] = React11.useState(false);
132062
132272
  const paused = hovered || focused;
132063
132273
  const interval = typeof props.autoplayIntervalMs === "number" && props.autoplayIntervalMs > 0 ? props.autoplayIntervalMs : 0;
132064
132274
  const autoplay = interval > 0 && count2 > 1 && !ctx.reduceMotion();
132065
132275
  const onChange = props.onChange;
132066
- const onChangeRef = React10.useRef(onChange);
132276
+ const onChangeRef = React11.useRef(onChange);
132067
132277
  onChangeRef.current = onChange;
132068
- const autoScrollRef = React10.useRef(null);
132069
- const endAutoScroll = React10.useCallback(() => {
132278
+ const autoScrollRef = React11.useRef(null);
132279
+ const endAutoScroll = React11.useCallback(() => {
132070
132280
  if (autoScrollRef.current) clearTimeout(autoScrollRef.current.timer);
132071
132281
  autoScrollRef.current = null;
132072
132282
  }, []);
132073
132283
  const requestedIndex = Math.max(0, Math.min(count2 - 1, typeof props.currentIndex === "number" ? props.currentIndex : 0));
132074
- React10.useEffect(() => {
132284
+ React11.useEffect(() => {
132075
132285
  endAutoScroll();
132076
132286
  indexRef.current = requestedIndex;
132077
132287
  setIndex(requestedIndex);
132078
132288
  if (trackRef.current) trackRef.current.scrollLeft = requestedIndex * trackRef.current.clientWidth;
132079
132289
  }, [requestedIndex, count2, endAutoScroll]);
132080
- React10.useEffect(() => {
132290
+ React11.useEffect(() => {
132081
132291
  const el2 = trackRef.current;
132082
132292
  el2?.addEventListener("scrollend", endAutoScroll);
132083
132293
  return () => {
@@ -132085,14 +132295,14 @@ var init_renderNode = __esm({
132085
132295
  endAutoScroll();
132086
132296
  };
132087
132297
  }, [endAutoScroll]);
132088
- const pageTo = React10.useCallback((page) => {
132298
+ const pageTo = React11.useCallback((page) => {
132089
132299
  if (page === indexRef.current) return;
132090
132300
  indexRef.current = page;
132091
132301
  setIndex(page);
132092
132302
  const action = onChangeRef.current;
132093
132303
  if (action && ctx.onAction) ctx.onAction({ ...action, args: { ...action.args ?? {}, index: page } });
132094
132304
  }, [ctx]);
132095
- React10.useEffect(() => {
132305
+ React11.useEffect(() => {
132096
132306
  if (!autoplay || paused) return;
132097
132307
  const id = setInterval(() => {
132098
132308
  const next = (indexRef.current + 1) % count2;
@@ -132157,7 +132367,7 @@ var init_renderNode = __esm({
132157
132367
  });
132158
132368
  BannerNode = withExtras("BannerNode", ({ props, ctx, wrap }) => {
132159
132369
  const C2 = ctx.color;
132160
- const [dismissed, setDismissed] = React10.useState(false);
132370
+ const [dismissed, setDismissed] = React11.useState(false);
132161
132371
  if (dismissed) return null;
132162
132372
  const accent = sevColor(ctx, props.severity ?? "info");
132163
132373
  return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", gap: 11, width: "100%", boxSizing: "border-box", borderRadius: ctx.radius("md", 10), padding: 13, background: `color-mix(in srgb, ${accent} 12%, ${C2("surfacePrimary", "#fff")})`, border: `1px solid color-mix(in srgb, ${accent} 32%, transparent)`, ...wrap }, children: [
@@ -132190,15 +132400,15 @@ var init_renderNode = __esm({
132190
132400
  const rawImageUrl = props.imageUrl != null && isBinding(props.imageUrl) ? boundImageUrl : props.imageUrl;
132191
132401
  const heroSrc = typeof rawImageUrl === "string" && rawImageUrl !== "" ? rawImageUrl : typeof props.imageAsset === "string" && isWebAssetPath(props.imageAsset) ? props.imageAsset : void 0;
132192
132402
  const resolvedHero = heroSrc ? resolveAssetUrl(heroSrc, ctx.assetBaseUrl) : void 0;
132193
- const [failedHero, setFailedHero] = React10.useState(null);
132403
+ const [failedHero, setFailedHero] = React11.useState(null);
132194
132404
  const imageUrl = resolvedHero && resolvedHero !== failedHero ? resolvedHero : void 0;
132195
132405
  const expanded = Math.max(0, typeof props.expandedHeight === "number" && Number.isFinite(props.expandedHeight) ? props.expandedHeight : 280);
132196
132406
  const collapsed = Math.max(0, Math.min(expanded, typeof props.collapsedHeight === "number" && props.collapsedHeight > 0 ? props.collapsedHeight : 64));
132197
132407
  const parallax = typeof props.parallaxFactor === "number" && Number.isFinite(props.parallaxFactor) ? Math.max(0, Math.min(1, props.parallaxFactor)) : 0.5;
132198
132408
  const span = Math.max(1, expanded - collapsed);
132199
- const rootRef = React10.useRef(null);
132200
- const [offset, setOffset] = React10.useState(0);
132201
- React10.useEffect(() => {
132409
+ const rootRef = React11.useRef(null);
132410
+ const [offset, setOffset] = React11.useState(0);
132411
+ React11.useEffect(() => {
132202
132412
  const el2 = rootRef.current;
132203
132413
  const win = el2?.ownerDocument?.defaultView;
132204
132414
  if (!el2 || !win) return;
@@ -132300,22 +132510,22 @@ var init_renderNode = __esm({
132300
132510
  const boundEnd = useResolvedScalar(props.selectedEndDatePath, ctx);
132301
132511
  const seedStart = (props.selectedStartDatePath != null ? typeof boundStart === "string" ? boundStart : "" : typeof props.selectedStartDate === "string" ? props.selectedStartDate : "") || "";
132302
132512
  const seedEnd = (props.selectedEndDatePath != null ? typeof boundEnd === "string" ? boundEnd : "" : typeof props.selectedEndDate === "string" ? props.selectedEndDate : "") || "";
132303
- const [range, setRange] = React10.useState({ start: seedStart, end: seedEnd });
132304
- const lastRangeSeed = React10.useRef(`${seedStart}|${seedEnd}`);
132305
- React10.useEffect(() => {
132513
+ const [range, setRange] = React11.useState({ start: seedStart, end: seedEnd });
132514
+ const lastRangeSeed = React11.useRef(`${seedStart}|${seedEnd}`);
132515
+ React11.useEffect(() => {
132306
132516
  const key3 = `${seedStart}|${seedEnd}`;
132307
132517
  if (lastRangeSeed.current === key3) return;
132308
132518
  lastRangeSeed.current = key3;
132309
132519
  setRange({ start: seedStart, end: seedEnd });
132310
132520
  }, [seedStart, seedEnd]);
132311
- const seed2 = React10.useMemo(
132521
+ const seed2 = React11.useMemo(
132312
132522
  () => monthSeed(drivenYear ?? props.year, drivenMonth ?? props.month, selectedDate),
132313
132523
  [drivenYear, drivenMonth, props.year, props.month, selectedDate]
132314
132524
  );
132315
- const [view, setView] = React10.useState(seed2);
132525
+ const [view, setView] = React11.useState(seed2);
132316
132526
  const seedKey = `${seed2.year}-${seed2.month}`;
132317
- const lastSeed = React10.useRef(seedKey);
132318
- React10.useEffect(() => {
132527
+ const lastSeed = React11.useRef(seedKey);
132528
+ React11.useEffect(() => {
132319
132529
  if (lastSeed.current === seedKey) return;
132320
132530
  lastSeed.current = seedKey;
132321
132531
  setView(seed2);
@@ -132326,7 +132536,7 @@ var init_renderNode = __esm({
132326
132536
  for (const d2 of decorations) if (d2 && typeof d2.date === "string") decByDate.set(d2.date, d2);
132327
132537
  const rows = monthMatrix(year, month, firstWeekday);
132328
132538
  const heads = weekdayLabels(firstWeekday);
132329
- const gridRef = React10.useRef(null);
132539
+ const gridRef = React11.useRef(null);
132330
132540
  const monthLabel = new Date(year, month - 1, 1).toLocaleDateString(void 0, { month: "long", year: "numeric" });
132331
132541
  const canPage = true;
132332
132542
  const changeMonth = (delta) => {
@@ -132449,7 +132659,7 @@ var init_renderNode = __esm({
132449
132659
  const events = Array.isArray(rawEvents) ? rawEvents : [];
132450
132660
  const boundAnchor = useResolvedScalar(props.anchorDatePath, ctx);
132451
132661
  const anchorRaw = props.anchorDatePath != null ? boundAnchor : props.anchorDate;
132452
- const [pagedAnchor, setPagedAnchor] = React10.useState(null);
132662
+ const [pagedAnchor, setPagedAnchor] = React11.useState(null);
132453
132663
  const localAnchor = pagedAnchor && Object.is(pagedAnchor.raw, anchorRaw) && pagedAnchor.path === props.anchorDatePath && pagedAnchor.mode === props.mode && pagedAnchor.provider === ctx.provider ? pagedAnchor.date : null;
132454
132664
  if (pagedAnchor && !localAnchor) setPagedAnchor(null);
132455
132665
  const anchor = localAnchor ?? (typeof anchorRaw === "string" ? parseLocalDate(anchorRaw) : null) ?? /* @__PURE__ */ new Date();
@@ -132689,7 +132899,7 @@ var init_renderNode = __esm({
132689
132899
  const boundEvents = useResolvedScalar(props.eventsPath, ctx);
132690
132900
  const rawEvents = props.eventsPath != null ? boundEvents : props.events;
132691
132901
  const events = Array.isArray(rawEvents) ? rawEvents : [];
132692
- const groups = React10.useMemo(() => {
132902
+ const groups = React11.useMemo(() => {
132693
132903
  const buckets = /* @__PURE__ */ new Map();
132694
132904
  for (const ev of events) {
132695
132905
  if (!ev) continue;
@@ -132709,18 +132919,18 @@ var init_renderNode = __esm({
132709
132919
  const onSelect = (ev) => dispatchCalendarAction(ctx, ev?.onTap ?? props.onSelectEvent, { eventId: ev?.id });
132710
132920
  const boundScrollTo = useResolvedScalar(props.scrollToDatePath, ctx);
132711
132921
  const scrollTarget = props.scrollToDatePath != null ? typeof boundScrollTo === "string" ? boundScrollTo : void 0 : typeof props.scrollToDate === "string" ? props.scrollToDate : void 0;
132712
- const containerRef = React10.useRef(null);
132713
- const [visibleDays, setVisibleDays] = React10.useState(CAL_AGENDA_INITIAL_DAYS);
132922
+ const containerRef = React11.useRef(null);
132923
+ const [visibleDays, setVisibleDays] = React11.useState(CAL_AGENDA_INITIAL_DAYS);
132714
132924
  const targetIndex = scrollTarget ? groups.findIndex((g2) => g2.key === scrollTarget) : -1;
132715
132925
  const windowEnd = Math.max(visibleDays, targetIndex >= 0 ? targetIndex + 1 : 0);
132716
132926
  const shown2 = groups.length > windowEnd ? groups.slice(0, windowEnd) : groups;
132717
132927
  const hasMore = groups.length > shown2.length;
132718
- React10.useEffect(() => {
132928
+ React11.useEffect(() => {
132719
132929
  if (!scrollTarget) return;
132720
132930
  containerRef.current?.querySelector(`[data-daygroup="${scrollTarget}"]`)?.scrollIntoView({ block: "start" });
132721
132931
  }, [scrollTarget, windowEnd]);
132722
- const sentinelRef = React10.useRef(null);
132723
- React10.useEffect(() => {
132932
+ const sentinelRef = React11.useRef(null);
132933
+ React11.useEffect(() => {
132724
132934
  if (!hasMore) return;
132725
132935
  const el2 = sentinelRef.current;
132726
132936
  if (!el2 || typeof IntersectionObserver === "undefined") return;
@@ -132837,26 +133047,26 @@ var init_renderNode = __esm({
132837
133047
  PRESENTED_SCOPE = '[aria-modal="true"], [role="dialog"], [role="alertdialog"], [role="menu"]';
132838
133048
  focusRoots = /* @__PURE__ */ new WeakMap();
132839
133049
  A11yHintDescription = ({ hint, idBase, children, ...forwarded }) => {
132840
- const descId = `${idBase ?? "hm"}__hint${React10.useId()}`;
133050
+ const descId = `${idBase ?? "hm"}__hint${React11.useId()}`;
132841
133051
  const own5 = children.props;
132842
133052
  const next = { ...forwarded };
132843
133053
  if (forwarded.style) next.style = { ...own5.style ?? {}, ...forwarded.style };
132844
133054
  const ids = [own5["aria-describedby"], forwarded["aria-describedby"], descId].flatMap((v2) => v2 ? String(v2).split(/\s+/) : []).filter(Boolean);
132845
133055
  next["aria-describedby"] = Array.from(new Set(ids)).join(" ");
132846
133056
  return /* @__PURE__ */ jsxs8(Fragment4, { children: [
132847
- React10.cloneElement(children, next),
133057
+ React11.cloneElement(children, next),
132848
133058
  /* @__PURE__ */ jsx11("span", { id: descId, hidden: true, "data-hm-a11y-hint": "", children: hint })
132849
133059
  ] });
132850
133060
  };
132851
133061
  reportedUnknownComponents = /* @__PURE__ */ new Set();
132852
133062
  UnknownComponentNode = ({ pkg, type, props, ctx, wrap, ...extras }) => {
132853
133063
  const hasTelemetry = !!ctx.emitTelemetry;
132854
- React10.useEffect(() => {
133064
+ React11.useEffect(() => {
132855
133065
  reportUnknownComponent(ctx, pkg, type);
132856
133066
  }, [ctx.appId, ctx.screenId, hasTelemetry, pkg, type]);
132857
133067
  const { style: extraStyle, children: extraChildren, ...attrs } = extras;
132858
133068
  const nodeProps = (entries) => entries.filter(([, v2]) => isNodeLike(v2) || Array.isArray(v2) && v2.some(isNodeLike));
132859
- const renderProps = (entries) => entries.map(([k2, v2]) => /* @__PURE__ */ jsx11(React10.Fragment, { children: Array.isArray(v2) ? kids2(v2.filter(isNodeLike), ctx) : renderNode(v2, ctx) }, k2));
133069
+ const renderProps = (entries) => entries.map(([k2, v2]) => /* @__PURE__ */ jsx11(React11.Fragment, { children: Array.isArray(v2) ? kids2(v2.filter(isNodeLike), ctx) : renderNode(v2, ctx) }, k2));
132860
133070
  const childKeys = nodeProps(Object.entries(props ?? {}));
132861
133071
  if (!unknownComponentShowsDeveloperLabel(ctx)) {
132862
133072
  const contentKeys = childKeys.filter(([k2]) => k2 === "child" || k2 === "children");
@@ -132880,7 +133090,7 @@ var init_renderNode = __esm({
132880
133090
  });
132881
133091
 
132882
133092
  // ../../core/web-renderer/src/renderToHtml.tsx
132883
- import React11 from "react";
133093
+ import React12 from "react";
132884
133094
  import { renderToStaticMarkup } from "react-dom/server";
132885
133095
  function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = null, width, chrome, opts) {
132886
133096
  const rtl = opts?.isRTL === true;
@@ -132900,18 +133110,18 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
132900
133110
  const dir = rtl ? { dir: "rtl" } : {};
132901
133111
  if (header || footer) {
132902
133112
  return withFocusRing(renderToStaticMarkup(
132903
- React11.createElement(
133113
+ React12.createElement(
132904
133114
  "div",
132905
133115
  // F-22 — same footer pin as ScreenHost: a full-height flex column + margin-top:auto
132906
133116
  // keeps the footer at the bottom edge even when the payload is short.
132907
133117
  { "data-testid": "screen-host", ...dir, ...footer ? { style: { display: "flex", flexDirection: "column", minHeight: "100%", flexGrow: 1 } } : {} },
132908
- header ? React11.createElement(
133118
+ header ? React12.createElement(
132909
133119
  "div",
132910
133120
  { "data-testid": "sticky-header", style: { position: "sticky", top: 0, zIndex: 10 } },
132911
133121
  renderNode(header, ctx)
132912
133122
  ) : null,
132913
133123
  renderNode(payload, ctx),
132914
- footer ? React11.createElement(
133124
+ footer ? React12.createElement(
132915
133125
  "div",
132916
133126
  { "data-testid": "sticky-footer", style: { position: "sticky", bottom: 0, zIndex: 10, marginTop: "auto" } },
132917
133127
  renderNode(footer, ctx)
@@ -132921,11 +133131,11 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
132921
133131
  }
132922
133132
  if (rtl) {
132923
133133
  return withFocusRing(renderToStaticMarkup(
132924
- React11.createElement("div", dir, renderNode(payload, ctx))
133134
+ React12.createElement("div", dir, renderNode(payload, ctx))
132925
133135
  ));
132926
133136
  }
132927
133137
  return withFocusRing(renderToStaticMarkup(
132928
- React11.createElement(React11.Fragment, null, renderNode(payload, ctx))
133138
+ React12.createElement(React12.Fragment, null, renderNode(payload, ctx))
132929
133139
  ));
132930
133140
  }
132931
133141
  var init_renderToHtml = __esm({
@@ -139901,9 +140111,9 @@ function renderedNameGaps(descriptor, state) {
139901
140111
  const found = /* @__PURE__ */ new Map();
139902
140112
  const rowsJudged = /* @__PURE__ */ new Map();
139903
140113
  const rowTemplateOf = /* @__PURE__ */ new Map();
139904
- const judge = (root, base, scope, depth, inRow) => {
140114
+ const judge = (root, base, scope2, depth, inRow) => {
139905
140115
  if (inRow) rowsJudged.set(base, (rowsJudged.get(base) ?? 0) + 1);
139906
- const ctx = { provider, scope, emptied: [], lists: [], unrendered: /* @__PURE__ */ new Set(), rowTemplates: [] };
140116
+ const ctx = { provider, scope: scope2, emptied: [], lists: [], unrendered: /* @__PURE__ */ new Set(), rowTemplates: [] };
139907
140117
  const projected = projectRenderedNames(root, "", "", ctx);
139908
140118
  for (const g2 of accessibleNameGaps(projected)) {
139909
140119
  const rel = g2.at === "root" ? "" : g2.at;
@@ -151919,8 +152129,8 @@ function mergePushInputs(content, flags) {
151919
152129
  }
151920
152130
  return merged;
151921
152131
  }
151922
- function missingPushInputs(i2, scope) {
151923
- const needed = scope === "push_and_signing" ? [...REQUIRED_ORDER, ...ASC_ORDER] : REQUIRED_ORDER;
152132
+ function missingPushInputs(i2, scope2) {
152133
+ const needed = scope2 === "push_and_signing" ? [...REQUIRED_ORDER, ...ASC_ORDER] : REQUIRED_ORDER;
151924
152134
  return needed.filter((name) => !text3(i2[name]));
151925
152135
  }
151926
152136
  function ascGroupError(i2) {
@@ -152695,8 +152905,8 @@ async function ask(question, deps) {
152695
152905
  rl2.close();
152696
152906
  }
152697
152907
  }
152698
- function defer(dir, input, scope, reason) {
152699
- return recordPushDeferral(dir, { reason, scope, missing: missingPushInputs(input, scope), identity: input, resume: resume(dir) });
152908
+ function defer(dir, input, scope2, reason) {
152909
+ return recordPushDeferral(dir, { reason, scope: scope2, missing: missingPushInputs(input, scope2), identity: input, resume: resume(dir) });
152700
152910
  }
152701
152911
  function renderPushStatus(http2, refresh = false) {
152702
152912
  const body = http2.body ?? {};
@@ -152759,9 +152969,9 @@ function logOwnershipFailure(io2, ownership) {
152759
152969
  endpoint: endpoints[ownership.check]
152760
152970
  }));
152761
152971
  }
152762
- async function collect(input, scope, io2, flags, deps) {
152972
+ async function collect(input, scope2, io2, flags, deps) {
152763
152973
  if (!io2.isTTY || flags.json === true) return true;
152764
- for (const name of missingPushInputs(input, scope)) {
152974
+ for (const name of missingPushInputs(input, scope2)) {
152765
152975
  const answer = await ask(`${PROMPTS[name]} (or Later to continue building):`, deps);
152766
152976
  if (later(answer)) return false;
152767
152977
  input[name] = answer;
@@ -152786,27 +152996,27 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
152786
152996
  const content = pushInputsFromContent(dir);
152787
152997
  const input = mergePushInputs({ ...local.selection, ...progress?.identity, ...content }, flags);
152788
152998
  if (!input.initialized) return refuse4(io2, "app_not_initialized", "Create the app with himi init first. Credentials are optional during app creation.");
152789
- let scope = progress?.scope === "push_and_signing" || flags["apple-signing"] === true || input.ascKeyFile || input.ascKeyId || input.ascIssuerId ? "push_and_signing" : "push_only";
152999
+ let scope2 = progress?.scope === "push_and_signing" || flags["apple-signing"] === true || input.ascKeyFile || input.ascKeyId || input.ascIssuerId ? "push_and_signing" : "push_only";
152790
153000
  if (operation === "setup" && flags["no-push-setup"] === true) {
152791
- io2.log(JSON.stringify(defer(dir, input, scope, "user_chose_later")));
153001
+ io2.log(JSON.stringify(defer(dir, input, scope2, "user_chose_later")));
152792
153002
  return 0;
152793
153003
  }
152794
- if (operation === "setup" && io2.isTTY && flags.json !== true && flags.yes !== true && scope === "push_only") {
153004
+ if (operation === "setup" && io2.isTTY && flags.json !== true && flags.yes !== true && scope2 === "push_only") {
152795
153005
  const choice = await ask("Apple signing: 1 Push only / 2 Push and automatic signing / Later:", deps);
152796
153006
  if (later(choice)) {
152797
- io2.log(JSON.stringify(defer(dir, input, scope, "user_chose_later")));
153007
+ io2.log(JSON.stringify(defer(dir, input, scope2, "user_chose_later")));
152798
153008
  return 0;
152799
153009
  }
152800
- if (choice === "2") scope = "push_and_signing";
153010
+ if (choice === "2") scope2 = "push_and_signing";
152801
153011
  else if (choice !== "1") return refuse4(io2, "invalid_setup_choice");
152802
153012
  }
152803
- if (operation === "setup" && !await collect(input, scope, io2, flags, deps)) {
152804
- io2.log(JSON.stringify(defer(dir, input, scope, "credentials_not_available")));
153013
+ if (operation === "setup" && !await collect(input, scope2, io2, flags, deps)) {
153014
+ io2.log(JSON.stringify(defer(dir, input, scope2, "credentials_not_available")));
152805
153015
  return 0;
152806
153016
  }
152807
153017
  const invalid = localIdentityRefusal(input);
152808
153018
  if (invalid) return refuse4(io2, invalid.code, invalid.message);
152809
- const missing = operation === "setup" ? missingPushInputs(input, scope) : !input.site ? ["site"] : [];
153019
+ const missing = operation === "setup" ? missingPushInputs(input, scope2) : !input.site ? ["site"] : [];
152810
153020
  if (missing.length) {
152811
153021
  io2.error(JSON.stringify({ ok: false, error: "needs_input", missing, resume: resume(dir), hint: "Provide file paths, never key contents. Or use --no-push-setup to continue building." }));
152812
153022
  return 2;
@@ -152827,7 +153037,7 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
152827
153037
  const valid = validateApnsAuthKey(apns.text);
152828
153038
  if (!valid.ok) return refuse4(io2, valid.code, valid.reason);
152829
153039
  let ascKey;
152830
- if (scope === "push_and_signing") {
153040
+ if (scope2 === "push_and_signing") {
152831
153041
  const asc = readKeyFile(input.ascKeyFile);
152832
153042
  if (!asc.ok) return refuse4(io2, asc.code, asc.reason);
152833
153043
  if (!isAppStoreConnectKey({ keyId: input.ascKeyId, issuerId: input.ascIssuerId, key: asc.text })) return refuse4(io2, "invalid_asc_key_file");
@@ -152845,7 +153055,7 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
152845
153055
  apnsKeyId: input.apnsKeyId,
152846
153056
  appleTeamId: input.appleTeamId,
152847
153057
  apnsEnvironment: input.apnsEnvironment,
152848
- scope,
153058
+ scope: scope2,
152849
153059
  claimRequired: ownership.state === "not_claimed"
152850
153060
  };
152851
153061
  if (flags.yes !== true || flags["dry-run"] === true) {
@@ -152856,9 +153066,9 @@ async function runNotifySetup(pos, flags, io2, deps = {}) {
152856
153066
  return 2;
152857
153067
  }
152858
153068
  io2.error(JSON.stringify({ plan: { ...plan, ...config2 ? { config: config2 } : {} } }));
152859
- const answer = await ask("Configure this site's push credentials through Branded/Ping" + (scope === "push_and_signing" ? " and request Apple signing resources" : "") + "? yes / Later:", deps);
153069
+ const answer = await ask("Configure this site's push credentials through Branded/Ping" + (scope2 === "push_and_signing" ? " and request Apple signing resources" : "") + "? yes / Later:", deps);
152860
153070
  if (answer.toLowerCase() !== "yes") {
152861
- io2.log(JSON.stringify(defer(dir, input, scope, "user_chose_later")));
153071
+ io2.log(JSON.stringify(defer(dir, input, scope2, "user_chose_later")));
152862
153072
  return 0;
152863
153073
  }
152864
153074
  }
@@ -158251,20 +158461,20 @@ function collectionName(name) {
158251
158461
  if (typeof name !== "string" || !/^[A-Za-z0-9]+$/.test(name)) throw new Error(`collection name must be alphanumeric: ${JSON.stringify(name)}`);
158252
158462
  }
158253
158463
  function planResourceChange(input) {
158254
- const { scope, catalog: catalog3, request } = input;
158464
+ const { scope: scope2, catalog: catalog3, request } = input;
158255
158465
  let normalizedRequest = structuredClone(request);
158256
158466
  let resource;
158257
158467
  const operations = [];
158258
158468
  if (request.kind === "put-kv") {
158259
158469
  if (!request.spec || typeof request.spec !== "object") throw new Error("invalid KV schema: spec is required");
158260
- const issues = validateDataResources({ kv: [request.spec] }, scope.app).filter((issue2) => issue2.severity === "error");
158470
+ const issues = validateDataResources({ kv: [request.spec] }, scope2.app).filter((issue2) => issue2.severity === "error");
158261
158471
  if (issues.length) throw new Error(`invalid KV schema: ${issues.map((issue2) => issue2.message).join("; ")}`);
158262
158472
  resource = `kv:${request.spec.name}`;
158263
158473
  const existing = byName(catalog3, "kv", request.spec.name);
158264
158474
  if (existing?.status === "deleted") throw new Error(`resource name "${request.spec.name}" is reserved by a tombstone; restore it instead`);
158265
158475
  const spec = provisionedKvSpec(request.spec);
158266
158476
  normalizedRequest = { kind: "put-kv", spec };
158267
- const record2 = { kind: "kv", name: request.spec.name, physicalId: kvResourceKey(scope, request.spec.name), status: "active", version: existing ? existing.version + 1 : 1, spec };
158477
+ const record2 = { kind: "kv", name: request.spec.name, physicalId: kvResourceKey(scope2, request.spec.name), status: "active", version: existing ? existing.version + 1 : 1, spec };
158268
158478
  if (!existing) operations.push({ kind: "create-kv", record: record2 });
158269
158479
  else if (JSON.stringify(existing.spec) !== JSON.stringify(spec)) operations.push({ kind: "update-kv", record: record2 });
158270
158480
  } else if (request.kind === "put-collection") {
@@ -158272,8 +158482,8 @@ function planResourceChange(input) {
158272
158482
  collectionName(request.name);
158273
158483
  const normalizedFields = request.fields.map((field) => ({ key: field?.key, displayName: field?.displayName, type: field?.type }));
158274
158484
  normalizedRequest = { kind: "put-collection", name: request.name, fields: normalizedFields };
158275
- const physical = `${namespacePrefix(scope.app)}${request.name}`;
158276
- const issues = validateCmsConfig({ collections: [{ id: physical, displayName: request.name, displayField: normalizedFields[0]?.key ?? "", readRole: "SITE_MEMBER", fields: normalizedFields }] }, scope.app).filter((issue2) => issue2.severity === "error");
158485
+ const physical = `${namespacePrefix(scope2.app)}${request.name}`;
158486
+ const issues = validateCmsConfig({ collections: [{ id: physical, displayName: request.name, displayField: normalizedFields[0]?.key ?? "", readRole: "SITE_MEMBER", fields: normalizedFields }] }, scope2.app).filter((issue2) => issue2.severity === "error");
158277
158487
  if (issues.length) throw new Error(`invalid collection schema: ${issues.map((issue2) => issue2.message).join("; ")}`);
158278
158488
  resource = `collection:${request.name}`;
158279
158489
  const existing = byName(catalog3, "collection", request.name);
@@ -158319,7 +158529,7 @@ function planResourceChange(input) {
158319
158529
  if (request.kind === "delete-resource" && existing.status === "active") operations.push({ kind: "tombstone-resource", resourceKind: request.resourceKind, name: request.name });
158320
158530
  if (request.kind === "restore-resource" && existing.status === "deleted") operations.push({ kind: "restore-resource", resourceKind: request.resourceKind, name: request.name });
158321
158531
  } else throw new Error(`unsupported resource change kind: ${String(request.kind)}`);
158322
- return finalize({ scope: { ...scope }, resource, baseVersion: catalog3.version, request: normalizedRequest, operations });
158532
+ return finalize({ scope: { ...scope2 }, resource, baseVersion: catalog3.version, request: normalizedRequest, operations });
158323
158533
  }
158324
158534
  var init_plan3 = __esm({
158325
158535
  "../../core/data-resources/src/plan.ts"() {
@@ -158348,9 +158558,9 @@ function authorizeResourceAdminCaller(caller) {
158348
158558
  if (caller.identity !== "installation") throw new ResourceApplyError("forbidden", "installation identity is required");
158349
158559
  if (!caller.wixPermissions.includes("wix.data.manage")) throw new ResourceApplyError("forbidden", "wix.data.manage permission is required");
158350
158560
  }
158351
- function verifyPlan(scope, plan) {
158561
+ function verifyPlan(scope2, plan) {
158352
158562
  const { hash: hash2, ...unsigned } = plan;
158353
- if (!equalScope(scope, plan.scope) || hashResourcePlan(unsigned) !== hash2) throw new ResourceApplyError("invalid_plan", "plan hash or app/site/environment scope does not match");
158563
+ if (!equalScope(scope2, plan.scope) || hashResourcePlan(unsigned) !== hash2) throw new ResourceApplyError("invalid_plan", "plan hash or app/site/environment scope does not match");
158354
158564
  if (plan.operations.length > 100) throw new ResourceApplyError("invalid_plan", "a resource plan may contain at most 100 operations");
158355
158565
  const invalid = (message) => {
158356
158566
  throw new ResourceApplyError("invalid_plan", message);
@@ -158358,11 +158568,11 @@ function verifyPlan(scope, plan) {
158358
158568
  for (const operation of plan.operations) {
158359
158569
  if (operation.kind === "create-kv" || operation.kind === "update-kv") {
158360
158570
  const record2 = operation.record;
158361
- if (plan.resource !== `kv:${record2.name}` || record2.kind !== "kv" || record2.status !== "active" || record2.physicalId !== kvResourceKey(scope, record2.name) || record2.spec.name !== record2.name || record2.spec.seed !== void 0) invalid("KV operation is not normalized to this plan scope");
158362
- if (validateDataResources({ kv: [record2.spec] }, scope.app).some((issue2) => issue2.severity === "error")) invalid("KV operation has an invalid schema");
158571
+ if (plan.resource !== `kv:${record2.name}` || record2.kind !== "kv" || record2.status !== "active" || record2.physicalId !== kvResourceKey(scope2, record2.name) || record2.spec.name !== record2.name || record2.spec.seed !== void 0) invalid("KV operation is not normalized to this plan scope");
158572
+ if (validateDataResources({ kv: [record2.spec] }, scope2.app).some((issue2) => issue2.severity === "error")) invalid("KV operation has an invalid schema");
158363
158573
  } else if (operation.kind === "create-collection") {
158364
158574
  const record2 = operation.record;
158365
- if (plan.resource !== `collection:${record2.name}` || record2.kind !== "collection" || record2.status !== "active" || record2.version !== 1 || record2.physicalId !== `${namespacePrefix(scope.app)}${record2.name}` || !/^[A-Za-z0-9]+$/.test(record2.name)) invalid("collection operation is not normalized to this plan scope");
158575
+ if (plan.resource !== `collection:${record2.name}` || record2.kind !== "collection" || record2.status !== "active" || record2.version !== 1 || record2.physicalId !== `${namespacePrefix(scope2.app)}${record2.name}` || !/^[A-Za-z0-9]+$/.test(record2.name)) invalid("collection operation is not normalized to this plan scope");
158366
158576
  const active = /* @__PURE__ */ new Set();
158367
158577
  for (const field of record2.fields) {
158368
158578
  const expectedPhysical = field.version === 1 ? field.logicalName : `${field.logicalName}__v${field.version}`;
@@ -158383,35 +158593,35 @@ function verifyPlan(scope, plan) {
158383
158593
  }
158384
158594
  }
158385
158595
  async function applyResourcePlan(input) {
158386
- const { scope, plan, expectedVersion, caller, store } = input;
158596
+ const { scope: scope2, plan, expectedVersion, caller, store } = input;
158387
158597
  if (!input.idempotencyKey?.trim()) throw new ResourceApplyError("idempotency_required", "a non-empty idempotency key is required");
158388
158598
  if (input.idempotencyKey.length > 256 || /[\u0000-\u001f\u007f]/.test(input.idempotencyKey)) throw new ResourceApplyError("invalid_plan", "idempotency key must be at most 256 characters and contain no control characters");
158389
- verifyPlan(scope, plan);
158599
+ verifyPlan(scope2, plan);
158390
158600
  authorizeResourceAdminCaller(caller);
158391
- const replay = await store.findIdempotency(scope, input.idempotencyKey);
158601
+ const replay = await store.findIdempotency(scope2, input.idempotencyKey);
158392
158602
  if (replay) {
158393
158603
  if (replay.planHash !== plan.hash) throw new ResourceApplyError("idempotency_conflict", "idempotency key was already used for a different plan");
158394
158604
  return { ...replay.result, replayed: true };
158395
158605
  }
158396
- return store.withLock(scope, plan.resource, input.idempotencyKey, async () => {
158397
- const afterLockReplay = await store.findIdempotency(scope, input.idempotencyKey);
158606
+ return store.withLock(scope2, plan.resource, input.idempotencyKey, async () => {
158607
+ const afterLockReplay = await store.findIdempotency(scope2, input.idempotencyKey);
158398
158608
  if (afterLockReplay) {
158399
158609
  if (afterLockReplay.planHash !== plan.hash) throw new ResourceApplyError("idempotency_conflict", "idempotency key was already used for a different plan");
158400
158610
  return { ...afterLockReplay.result, replayed: true };
158401
158611
  }
158402
- const catalog3 = await store.read(scope);
158612
+ const catalog3 = await store.read(scope2);
158403
158613
  if (expectedVersion !== plan.baseVersion || catalog3.version !== expectedVersion) throw new ResourceApplyError("stale_version", `expected ${expectedVersion}, current ${catalog3.version}, plan base ${plan.baseVersion}`);
158404
158614
  let replanned;
158405
158615
  try {
158406
- replanned = planResourceChange({ scope, catalog: catalog3, request: plan.request });
158616
+ replanned = planResourceChange({ scope: scope2, catalog: catalog3, request: plan.request });
158407
158617
  } catch (error) {
158408
158618
  throw new ResourceApplyError("invalid_plan", `plan request is no longer valid: ${error instanceof Error ? error.message : String(error)}`);
158409
158619
  }
158410
158620
  if (replanned.hash !== plan.hash) throw new ResourceApplyError("invalid_plan", "plan operations are not the canonical transition for its request and current catalog");
158411
158621
  if (plan.operations.length === 0) return { catalog: catalog3, replayed: false, auditId: `noop:${plan.hash.slice(0, 16)}` };
158412
158622
  const now = (input.now ?? (() => /* @__PURE__ */ new Date()))().toISOString();
158413
- const event = { id: `${plan.hash.slice(0, 16)}:${input.idempotencyKey}`, at: now, scope: { ...scope }, actor: `fn:${caller.functionName}`, planHash: plan.hash, idempotencyKey: input.idempotencyKey, fromVersion: catalog3.version, toVersion: catalog3.version + 1, operations: structuredClone(plan.operations) };
158414
- return store.commit({ scope, expectedVersion, plan, idempotencyKey: input.idempotencyKey, event });
158623
+ const event = { id: `${plan.hash.slice(0, 16)}:${input.idempotencyKey}`, at: now, scope: { ...scope2 }, actor: `fn:${caller.functionName}`, planHash: plan.hash, idempotencyKey: input.idempotencyKey, fromVersion: catalog3.version, toVersion: catalog3.version + 1, operations: structuredClone(plan.operations) };
158624
+ return store.commit({ scope: scope2, expectedVersion, plan, idempotencyKey: input.idempotencyKey, event });
158415
158625
  });
158416
158626
  }
158417
158627
  var ResourceApplyError;
@@ -158905,12 +159115,12 @@ function makeFunctionsHandler(options) {
158905
159115
  throw new Error("KV provider is not configured");
158906
159116
  }
158907
159117
  };
158908
- const scope = { app: target.app, siteId: siteBinding.siteId, environment: siteBinding.environment };
158909
- const catalog3 = options.resourceStore ? await options.resourceStore.read(scope) : { version: 0, resources: [] };
158910
- const capability = createFunctionDataCapability({ scope, data: selected.functionDataResources, catalog: catalog3, kv: options.dataKvProvider ?? emptyKv, ...wixApi ? { wix: wixApi } : {} });
159118
+ const scope2 = { app: target.app, siteId: siteBinding.siteId, environment: siteBinding.environment };
159119
+ const catalog3 = options.resourceStore ? await options.resourceStore.read(scope2) : { version: 0, resources: [] };
159120
+ const capability = createFunctionDataCapability({ scope: scope2, data: selected.functionDataResources, catalog: catalog3, kv: options.dataKvProvider ?? emptyKv, ...wixApi ? { wix: wixApi } : {} });
158911
159121
  dataApi = createFunctionDataRpc({
158912
159122
  capability,
158913
- scope,
159123
+ scope: scope2,
158914
159124
  catalog: catalog3,
158915
159125
  capabilities: active.capabilities,
158916
159126
  ...active.capabilities.includes("resource_admin") && options.resourceStore ? {
@@ -162165,16 +162375,24 @@ ${releaseId}`;
162165
162375
  }
162166
162376
  const exchangeClient = wixClientIdOf(utf8Decode(exchangeCfg.bytes));
162167
162377
  if ("error" in exchangeClient) return json5(501, { error: `member_exchange_${exchangeClient.error}` }, noStore);
162378
+ let rawBody;
162379
+ try {
162380
+ rawBody = await request.text();
162381
+ } catch {
162382
+ return json5(400, { error: "body_unreadable" }, noStore);
162383
+ }
162384
+ if (!rawBody) return json5(400, { error: "empty_body" }, noStore);
162168
162385
  let exchangeBody;
162169
162386
  try {
162170
- exchangeBody = await request.json();
162387
+ exchangeBody = JSON.parse(rawBody);
162171
162388
  } catch {
162172
- return json5(400, { error: "bad_request" }, noStore);
162389
+ return json5(400, { error: "invalid_json" }, noStore);
162173
162390
  }
162174
- if (!exchangeBody || typeof exchangeBody !== "object") return json5(400, { error: "bad_request" }, noStore);
162391
+ if (!exchangeBody || typeof exchangeBody !== "object" || Array.isArray(exchangeBody)) return json5(400, { error: "invalid_body" }, noStore);
162175
162392
  const exchanged = await exchangeMemberSession({ clientId: exchangeClient.clientId, sessionToken: exchangeBody.sessionToken }, webwixFetch);
162176
162393
  if (exchanged.ok) return json5(200, { accessToken: exchanged.accessToken, expiresAt: exchanged.expiresAt }, noStore);
162177
- return json5(exchanged.code === "bad_request" ? 400 : 502, { error: exchanged.code, ...exchanged.status !== void 0 ? { status: exchanged.status } : {} }, noStore);
162394
+ if (exchanged.code === "bad_request") return json5(400, { error: "invalid_session_token" }, noStore);
162395
+ return json5(502, { error: exchanged.code, ...exchanged.status !== void 0 ? { status: exchanged.status } : {} }, noStore);
162178
162396
  }
162179
162397
  if (request.method === "POST" && path2 === "/v1/__webwix/call") {
162180
162398
  const served = { rung: "none" };
@@ -163252,33 +163470,33 @@ var init_preview_assets_generated = __esm({
163252
163470
  "../../packages/serve/src/preview-assets.generated.ts"() {
163253
163471
  init_preview_assets_format();
163254
163472
  PREVIEW_ASSET_MANIFEST = [
163255
- { key: "assets/DashboardHost-D0mvqhuP.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2916, sha256: "50ccb0c80f7d58180ea4ebc4fdd8ce808eeae82ce08eb6bc820a96439e1bea0d" },
163256
- { key: "assets/DevDrawer-DiCOV7nR.js", contentType: "application/javascript; charset=utf-8", offset: 2924, length: 16744, sha256: "510c2b3e8c455f436fbd1e62eac1183b898aaa3a01850663e57ef04d209494b1" },
163257
- { key: "assets/IdiomCompare-B4n0TaQC.js", contentType: "application/javascript; charset=utf-8", offset: 19668, length: 1892, sha256: "c69e2e63891437c75a8590088abc6e5cad782bf00c97202e373107eb1ab75363" },
163258
- { key: "assets/LightboxViewer-DSCKZW9J.js", contentType: "application/javascript; charset=utf-8", offset: 21560, length: 8132, sha256: "d973386ff8b87ed6628879df733f321d5d55d2c0eec949f32c179d9b508585e3" },
163259
- { key: "assets/PhonePreviewControl-DPw27_19.js", contentType: "application/javascript; charset=utf-8", offset: 29692, length: 37729, sha256: "c5bb48cba2244024929344de2f2696b2c34e29a1ea226a6e2a0e7113cd61e8b5" },
163260
- { key: "assets/SchemeCompare-DXTQvgH8.js", contentType: "application/javascript; charset=utf-8", offset: 67421, length: 1824, sha256: "636e60a48ae8724015ac2c37e2b910018034e3093637af4b17b6cbdfa929f0c7" },
163261
- { key: "assets/index-CfM9xCA8.js", contentType: "application/javascript; charset=utf-8", offset: 69245, length: 1298089, sha256: "8dbbeae923b28302eadec54e81e95827238a8355754496bc0384af9eff1eb43e" },
163262
- { key: "assets/pdf-C6N-uMAD.js", contentType: "application/javascript; charset=utf-8", offset: 1367334, length: 488199, sha256: "dd4083dfaa586c8dbabe65b319aad2847d45a60b8dcd5cd84727019a5856f238" },
163263
- { key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset: 1855533, length: 73, sha256: "41bcfda4f3c8c0a81c785ea87c69afc8e7d0ed8c333324aee94c273d881bb6aa" },
163264
- { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 1855606, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
163265
- { key: "assets/pdfDocument-PbWZbvnf.js", contentType: "application/javascript; charset=utf-8", offset: 3172640, length: 3379, sha256: "c9ecd46918bfe855a8ed2bf6cf8e4dd349ed2ab22ad4add55466ccb41ed5cf4b" },
163266
- { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3176019, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
163267
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3178285, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
163268
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3182895, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
163269
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3671479, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
163270
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3762403, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
163271
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3853387, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
163272
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3944367, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
163273
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4035239, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
163274
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4126219, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
163275
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4234855, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
163276
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4343939, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
163277
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4452987, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
163278
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4560687, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
163279
- { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4648795, length: 6748, sha256: "4a92459977d7cefa1a6a7e020c3a63509737f083b3f2773557c1a5771665811a" },
163280
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4655543, length: 4947, sha256: "69879b410888d65dba1671dfb08cae67705e103a2f1df244b819f56136571e53" },
163281
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4660490, length: 17786, sha256: "084107ca997628c248f1b0ba3a7494744850df39fad813546ab8bdb82a6058da" }
163473
+ { key: "assets/DashboardHost-1jypScD2.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2916, sha256: "73b7086df0cf3448a2bfe3ba276ec00a38c55542caebb2156675a36738a83fa3" },
163474
+ { key: "assets/DevDrawer-BQ1xp__f.js", contentType: "application/javascript; charset=utf-8", offset: 2924, length: 16744, sha256: "d431422763f468ea57239ef416f3bce71549375b67f20e83d29511d75f15c46f" },
163475
+ { key: "assets/IdiomCompare-CK_q192T.js", contentType: "application/javascript; charset=utf-8", offset: 19668, length: 1892, sha256: "59ca2d4f2faac878ecae8740faecf1d8e50136c0bb2ab28cb3ec12cd6df5d7bc" },
163476
+ { key: "assets/LightboxViewer-COhqSEoj.js", contentType: "application/javascript; charset=utf-8", offset: 21560, length: 8132, sha256: "bf1696b76f086904f2e6f5aa88d73c809f0b75ccf0e2f85bb20170b4d4b93d43" },
163477
+ { key: "assets/PhonePreviewControl-CJBzXYBw.js", contentType: "application/javascript; charset=utf-8", offset: 29692, length: 37729, sha256: "bafcaf544306b6c960671f01480b68b97b8d9f639f59f71bfe0a40d1630483c3" },
163478
+ { key: "assets/SchemeCompare-s2ETtRsO.js", contentType: "application/javascript; charset=utf-8", offset: 67421, length: 1824, sha256: "c5f62861ae1843b28a961e2154c026e71e3f14b9bf933e3fb482eebaef2eb36f" },
163479
+ { key: "assets/index-C4uN0_ln.js", contentType: "application/javascript; charset=utf-8", offset: 69245, length: 1301860, sha256: "b9728fe4fee91086095f4f6ccd03c4eb067e10b39c513a7c7e67ad07001f4919" },
163480
+ { key: "assets/pdf-CJsqT7M-.js", contentType: "application/javascript; charset=utf-8", offset: 1371105, length: 488199, sha256: "5daa7c97dddee008bb1fc809bc405cb3b1fb6aad7392584218136961e503018d" },
163481
+ { key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset: 1859304, length: 73, sha256: "41bcfda4f3c8c0a81c785ea87c69afc8e7d0ed8c333324aee94c273d881bb6aa" },
163482
+ { key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 1859377, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
163483
+ { key: "assets/pdfDocument-Cii5pAUm.js", contentType: "application/javascript; charset=utf-8", offset: 3176411, length: 3379, sha256: "bab1c624304f13d68d450b4bc8abd0574d394b1e4cddd3ac0d5ff6151debad24" },
163484
+ { key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3179790, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
163485
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3182056, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
163486
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3186666, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
163487
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3675250, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
163488
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3766174, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
163489
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3857158, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
163490
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3948138, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
163491
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4039010, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
163492
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4129990, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
163493
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4238626, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
163494
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4347710, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
163495
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4456758, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
163496
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4564458, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
163497
+ { key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4652566, length: 6748, sha256: "4a92459977d7cefa1a6a7e020c3a63509737f083b3f2773557c1a5771665811a" },
163498
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 4659314, length: 4947, sha256: "f1696b9320a90e440ce6db5a9eb3cfc62260a1d7a8b32c0fa78c749b013359e0" },
163499
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4664261, length: 17786, sha256: "084107ca997628c248f1b0ba3a7494744850df39fad813546ab8bdb82a6058da" }
163282
163500
  ];
163283
163501
  }
163284
163502
  });
@@ -186013,27 +186231,27 @@ var HttpDataKvAdminProvider = class {
186013
186231
  if (!/^https?:\/\//.test(baseUrl)) throw new Error("data admin URL must be absolute http(s)");
186014
186232
  if (!token) throw new Error("data admin token is required");
186015
186233
  }
186016
- async request(method, scope, name, body) {
186234
+ async request(method, scope2, name, body) {
186017
186235
  const url = new URL(`/v1/data/admin/kv/${encodeURIComponent(name)}`, this.baseUrl);
186018
- url.searchParams.set("app", scope.app);
186019
- url.searchParams.set("site", scope.siteId);
186020
- url.searchParams.set("environment", scope.environment);
186236
+ url.searchParams.set("app", scope2.app);
186237
+ url.searchParams.set("site", scope2.siteId);
186238
+ url.searchParams.set("environment", scope2.environment);
186021
186239
  const serialized = body === void 0 ? void 0 : JSON.stringify(body);
186022
- const idempotencyKey = serialized === void 0 ? void 0 : createHash4("sha256").update(`${scope.app}\0${scope.siteId}\0${scope.environment}\0${method}\0${name}\0${serialized}`).digest("hex");
186240
+ const idempotencyKey = serialized === void 0 ? void 0 : createHash4("sha256").update(`${scope2.app}\0${scope2.siteId}\0${scope2.environment}\0${method}\0${name}\0${serialized}`).digest("hex");
186023
186241
  const response = await this.fetchImpl(url, { method, headers: { authorization: `Bearer ${this.token}`, "content-type": "application/json", ...idempotencyKey ? { "idempotency-key": idempotencyKey } : {} }, ...serialized === void 0 ? {} : { body: serialized } });
186024
186242
  if (response.status === 404 && method === "GET") return { exists: false };
186025
186243
  if (!response.ok) throw new Error(`data admin ${method} failed (${response.status}): ${(await response.text()).slice(0, 256)}`);
186026
186244
  return await response.json();
186027
186245
  }
186028
- inspect(scope, name) {
186029
- return this.request("GET", scope, name);
186246
+ inspect(scope2, name) {
186247
+ return this.request("GET", scope2, name);
186030
186248
  }
186031
- async create(scope, spec) {
186032
- const result = await this.request("PUT", scope, spec.name, { spec });
186249
+ async create(scope2, spec) {
186250
+ const result = await this.request("PUT", scope2, spec.name, { spec });
186033
186251
  return result.status;
186034
186252
  }
186035
- async seed(scope, spec, values, options = {}) {
186036
- const result = await this.request("POST", scope, spec.name, { values, force: options.force ?? false });
186253
+ async seed(scope2, spec, values, options = {}) {
186254
+ const result = await this.request("POST", scope2, spec.name, { values, force: options.force ?? false });
186037
186255
  return result.inserted;
186038
186256
  }
186039
186257
  };
@@ -188379,8 +188597,8 @@ function previewTokenNote(expiresAt, now = Date.now(), viaHandover = false) {
188379
188597
  const minutes = Math.max(1, Math.round(seconds / 60));
188380
188598
  return `${carrier}, and it expires at ${expiresAt} \u2014 about ${minutes} minute${minutes === 1 ? "" : "s"} from now; run the \`previewRenew\` command printed beside this note \u2014 from the same plane and credentials as this call (any \`--serve-url\`/\`--control-url\`/token flags you passed) \u2014 for a fresh one.`;
188381
188599
  }
188382
- function previewRenewCommand(app, release2, target, scope = {}) {
188383
- return `himi preview --app ${app} --release ${release2}` + (scope.screen ? ` --screen ${scope.screen}` : "") + (scope.surface ? ` --surface ${scope.surface}` : "") + (target !== "local" ? ` --target ${target}` : "");
188600
+ function previewRenewCommand(app, release2, target, scope2 = {}) {
188601
+ return `himi preview --app ${app} --release ${release2}` + (scope2.screen ? ` --screen ${scope2.screen}` : "") + (scope2.surface ? ` --surface ${scope2.surface}` : "") + (target !== "local" ? ` --target ${target}` : "");
188384
188602
  }
188385
188603
  function previewPlayerLink(app, release2, screenId) {
188386
188604
  return buildPlayerPreviewUrl({ app, releaseId: release2, screenId, source: "cli" });
@@ -193569,8 +193787,8 @@ default (no --glyph): ${DEFAULT_GLYPH2} \u2014 a mark that claims nothing, so th
193569
193787
  const rawLogs = r3.json?.logs ?? [];
193570
193788
  const logs = byLevel(rawLogs);
193571
193789
  const narrowed = !!(level || str10(flags.screen) || str10(flags.screenId) || num4(flags.since) !== void 0 || num4(flags.limit) !== void 0);
193572
- const scope = release2 ? "this release" : "this app";
193573
- const note = logs.length > 0 ? void 0 : narrowed ? `no worker \`console.*\` lines matched this query${level && rawLogs.length ? ` (${rawLogs.length} line(s) were hidden by --level ${level})` : ""}. Drop --level/--screen/--since/--limit to see the whole console channel for ${scope}; the telemetry EVENT stream is a separate channel, read with \`himi telemetry\`.` : `no worker \`console.*\` output on ${scope}. This is the console channel \u2014 distinct from the telemetry EVENT stream, which \`himi telemetry --app <app> --release <id>\` reads: ${scope} can carry many events and no console lines \u2014 commonly because the worker never logged any, though an empty channel can also mean the lines aged out or never made it through ingestion. Boot-time \`console.log\` is visible via \`himi validate\` / \`himi render\`.`;
193790
+ const scope2 = release2 ? "this release" : "this app";
193791
+ const note = logs.length > 0 ? void 0 : narrowed ? `no worker \`console.*\` lines matched this query${level && rawLogs.length ? ` (${rawLogs.length} line(s) were hidden by --level ${level})` : ""}. Drop --level/--screen/--since/--limit to see the whole console channel for ${scope2}; the telemetry EVENT stream is a separate channel, read with \`himi telemetry\`.` : `no worker \`console.*\` output on ${scope2}. This is the console channel \u2014 distinct from the telemetry EVENT stream, which \`himi telemetry --app <app> --release <id>\` reads: ${scope2} can carry many events and no console lines \u2014 commonly because the worker never logged any, though an empty channel can also mean the lines aged out or never made it through ingestion. Boot-time \`console.log\` is visible via \`himi validate\` / \`himi render\`.`;
193574
193792
  print({ ok: true, logs, ...note ? { note } : {} });
193575
193793
  return 0;
193576
193794
  }
@@ -194814,12 +195032,12 @@ ${label3}`);
194814
195032
  return 1;
194815
195033
  }
194816
195034
  const storedAt2 = saveControlToken(target, result.token);
194817
- let scope;
195035
+ let scope2;
194818
195036
  let exp;
194819
195037
  let sub;
194820
195038
  try {
194821
195039
  const c2 = JSON.parse(Buffer.from(result.token.split(".")[0], "base64url").toString("utf8"));
194822
- scope = c2.apps;
195040
+ scope2 = c2.apps;
194823
195041
  exp = c2.exp;
194824
195042
  sub = c2.sub;
194825
195043
  } catch {
@@ -194831,10 +195049,10 @@ ${label3}`);
194831
195049
  target,
194832
195050
  sub,
194833
195051
  exp,
194834
- scope,
195052
+ scope: scope2,
194835
195053
  storedAt: storedAt2,
194836
195054
  ...swap2 ? { notice: swap2 } : {},
194837
- ...Array.isArray(scope) && scope.length === 0 ? { hint: "you own no apps yet \u2014 claim one with `himi apps claim <slug>`" } : {}
195055
+ ...Array.isArray(scope2) && scope2.length === 0 ? { hint: "you own no apps yet \u2014 claim one with `himi apps claim <slug>`" } : {}
194838
195056
  });
194839
195057
  return 0;
194840
195058
  }
@@ -195387,9 +195605,9 @@ ${report3.ok ? "OK \u2014 data + serve plane reachable." : typeof report3.hint =
195387
195605
  throw new Error("KV admin not configured");
195388
195606
  } };
195389
195607
  }
195390
- const scope = { app, siteId: site, environment: environment2 };
195608
+ const scope2 = { app, siteId: site, environment: environment2 };
195391
195609
  try {
195392
- const report3 = sub === "plan" ? await planData({ scope, data, kv, call }) : sub === "create" ? await createData({ scope, data, kv, call, dryRun: flags["dry-run"] === true }) : await seedData({ scope, data, kv, call, dir, dryRun: flags["dry-run"] === true, force: flags.force === true });
195610
+ const report3 = sub === "plan" ? await planData({ scope: scope2, data, kv, call }) : sub === "create" ? await createData({ scope: scope2, data, kv, call, dryRun: flags["dry-run"] === true }) : await seedData({ scope: scope2, data, kv, call, dir, dryRun: flags["dry-run"] === true, force: flags.force === true });
195393
195611
  print(report3);
195394
195612
  return report3.ok ? 0 : 1;
195395
195613
  } catch (error) {