@pygmalionjs/pygmalion 0.5.16 → 0.5.18

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.
@@ -1,10 +1,10 @@
1
1
  var Kf = Object.defineProperty;
2
2
  var Uf = (e, t, n) => t in e ? Kf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var cn = (e, t, n) => Uf(e, typeof t != "symbol" ? t + "" : t, n);
3
+ var dn = (e, t, n) => Uf(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as s, jsxs as g, Fragment as Ue } from "react/jsx-runtime";
5
- import { R as ti, u as qf, c as fa, b as Kc, g as Ze, d as Yf, m as Lt, e as f, f as Xt, r as fn, h as ys, i as Gn, j as ha, k as bn, l as Uc, n as mr, p as Gf, o as Vn, q as We, t as Xf, v as Jf, w as Qf, x as Zf, y as eh, z as th, A as nh, B as vs, C as rh, D as oh, E as ih, G as sh, H as ah, I as lh, S as ch, J as dh, K as uh, L as fh, M as hh, O as ph, P as mh, Q as gh, T as bh, U as qc, V as xh, W as wl, X as yh, Y as Yc, Z as vh, _ as wh, $ as Sh, a0 as Nh, a1 as Ih, a2 as Ch, a3 as Gc, a4 as $h, a5 as Ph, a6 as X, a7 as Sl, a8 as Nl, a9 as Mh, aa as Qi, ab as Eh, ac as Vo, ad as ws, ae as kh, af as Xc, ag as Ah, ah as Rh, ai as Th, aj as Fh, s as Lh, ak as Jc, al as Qc, am as Ss, an as Zc, ao as Dh, ap as zh, aq as Il, ar as _h, as as Oh, at as Cl, au as Bh, av as jh, aw as Wh, ax as Hh, ay as Vh, az as Kh, aA as Uh, aB as qh, aC as Yh, aD as Gh, aE as Xh, aF as Jh, a as Qh, aG as Zh, aH as ep, aI as tp, aJ as np, aK as rp, aL as op, aM as ip, aN as sp, aO as ap, aP as lp, aQ as cp, aR as dp, aS as Lr, aT as $l, aU as up, aV as fp, aW as hp, aX as pp, aY as Pl } from "./FrozenRoutePreview-CZOpvN6z.js";
5
+ import { R as ti, u as qf, c as fa, b as Kc, g as Ze, d as Yf, m as Lt, e as f, f as Gt, r as hn, h as ys, i as Xn, j as ha, k as xn, l as Uc, n as mr, p as Gf, o as Kn, q as We, t as Xf, v as Jf, w as Qf, x as Zf, y as eh, z as th, A as nh, B as vs, C as rh, D as oh, E as ih, G as sh, H as ah, I as lh, S as ch, J as dh, K as uh, L as fh, M as hh, O as ph, P as mh, Q as gh, T as bh, U as qc, V as xh, W as wl, X as yh, Y as Yc, Z as vh, _ as wh, $ as Sh, a0 as Nh, a1 as Ih, a2 as Ch, a3 as Gc, a4 as $h, a5 as Ph, a6 as X, a7 as Sl, a8 as Nl, a9 as Mh, aa as Qi, ab as Eh, ac as Vo, ad as ws, ae as kh, af as Xc, ag as Ah, ah as Rh, ai as Th, aj as Fh, s as Lh, ak as Jc, al as Qc, am as Ss, an as Zc, ao as Dh, ap as zh, aq as Il, ar as _h, as as Oh, at as Cl, au as Bh, av as jh, aw as Wh, ax as Hh, ay as Vh, az as Kh, aA as Uh, aB as qh, aC as Yh, aD as Gh, aE as Xh, aF as Jh, a as Qh, aG as Zh, aH as ep, aI as tp, aJ as np, aK as rp, aL as op, aM as ip, aN as sp, aO as ap, aP as lp, aQ as cp, aR as dp, aS as Lr, aT as $l, aU as up, aV as fp, aW as hp, aX as pp, aY as Pl } from "./FrozenRoutePreview-CZOpvN6z.js";
6
6
  import { aZ as m0, a_ as g0, a$ as b0, b0 as x0, b1 as y0, b2 as v0, b3 as w0, b4 as S0, b5 as N0, b6 as I0, b7 as C0, b8 as $0, b9 as P0, ba as M0, bb as E0 } from "./FrozenRoutePreview-CZOpvN6z.js";
7
- import { useRef as Ie, useLayoutEffect as ni, useSyncExternalStore as Qe, useCallback as wt, useReducer as ed, useEffect as se, memo as td, createElement as to, useState as Y, useMemo as Ft } from "react";
7
+ import { useRef as Ie, useLayoutEffect as ni, useSyncExternalStore as Qe, useCallback as St, useReducer as ed, useEffect as se, memo as td, createElement as to, useState as Y, useMemo as Ft } from "react";
8
8
  import { createPortal as mp } from "react-dom";
9
9
  const pa = {
10
10
  fullEnter: 0.75,
@@ -263,7 +263,7 @@ const Ap = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
263
263
  getFrameTier: od,
264
264
  subscribeFrameBitmapScale: ad,
265
265
  subscribeFrameLod: ma
266
- }, Symbol.toStringTag, { value: "Module" })), cd = /^sha256-[a-f0-9]{64}$/, Rp = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), un = {
266
+ }, Symbol.toStringTag, { value: "Module" })), cd = /^sha256-[a-f0-9]{64}$/, Rp = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), fn = {
267
267
  bundleBytes: 128 * 1024 * 1024,
268
268
  snapshotBytes: 8 * 1024 * 1024,
269
269
  bodyBytes: 8 * 1024 * 1024,
@@ -277,7 +277,7 @@ const Ap = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
277
277
  function $i(e) {
278
278
  return new TextEncoder().encode(e).byteLength;
279
279
  }
280
- function zn(e) {
280
+ function _n(e) {
281
281
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
282
282
  const t = Object.getPrototypeOf(e);
283
283
  return t === Object.prototype || t === null;
@@ -290,7 +290,7 @@ function Tp(e) {
290
290
  }
291
291
  }
292
292
  function Zi(e) {
293
- return typeof e == "string" && e.length > 0 && e.length <= un.identifierLength && e === e.trim() && !Rp.has(e);
293
+ return typeof e == "string" && e.length > 0 && e.length <= fn.identifierLength && e === e.trim() && !Rp.has(e);
294
294
  }
295
295
  function Fp(e) {
296
296
  const t = /(?:expression\s*\(|-moz-binding\s*:|(?:^|[;{])\s*behavior\s*:)/i;
@@ -303,14 +303,14 @@ function Fp(e) {
303
303
  return !1;
304
304
  }
305
305
  function Lp(e) {
306
- return typeof e != "string" || e.length === 0 ? "snapshot must be a non-empty string" : $i(e) > un.snapshotBytes ? "snapshot exceeds the byte limit" : /<\s*(?:script|iframe|object|embed|applet|portal)\b/i.test(e) ? "snapshot contains an active element" : /<\s*meta\b[^>]*http-equiv\s*=\s*["']?\s*refresh\b/i.test(e) ? "snapshot contains a refresh directive" : /\s(?:on[a-z][\w:-]*|srcdoc)\s*=/i.test(e) ? "snapshot contains an active attribute" : /\s(?:href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*|'?\s*)(?:javascript|vbscript|data\s*:\s*text\/html)\s*:/i.test(
306
+ return typeof e != "string" || e.length === 0 ? "snapshot must be a non-empty string" : $i(e) > fn.snapshotBytes ? "snapshot exceeds the byte limit" : /<\s*(?:script|iframe|object|embed|applet|portal)\b/i.test(e) ? "snapshot contains an active element" : /<\s*meta\b[^>]*http-equiv\s*=\s*["']?\s*refresh\b/i.test(e) ? "snapshot contains a refresh directive" : /\s(?:on[a-z][\w:-]*|srcdoc)\s*=/i.test(e) ? "snapshot contains an active attribute" : /\s(?:href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*|'?\s*)(?:javascript|vbscript|data\s*:\s*text\/html)\s*:/i.test(
307
307
  e
308
308
  ) ? "snapshot contains an active URL" : Fp(e) ? "snapshot contains an active style expression" : null;
309
309
  }
310
310
  function Al(e, t, n) {
311
- if (!zn(e))
311
+ if (!_n(e))
312
312
  return n.push(`${t} assets must be a record.`), /* @__PURE__ */ new Set();
313
- const r = /* @__PURE__ */ new Set(), o = t === "head" ? un.headAssetBytes : un.stylesheetAssetBytes;
313
+ const r = /* @__PURE__ */ new Set(), o = t === "head" ? fn.headAssetBytes : fn.stylesheetAssetBytes;
314
314
  for (const [i, a] of Object.entries(e)) {
315
315
  if (!cd.test(i) || typeof a != "string") {
316
316
  n.push(`${t} asset "${i}" is invalid.`);
@@ -328,31 +328,31 @@ function dd(e, t) {
328
328
  }
329
329
  function Pi(e) {
330
330
  const t = [], n = Tp(e);
331
- if (!zn(e) || e.version !== 2)
331
+ if (!_n(e) || e.version !== 2)
332
332
  return {
333
333
  valid: !1,
334
334
  errors: ["Route preview artifact must be a version 2 record."],
335
335
  bytes: n
336
336
  };
337
- Zi(e.namespace) || t.push("Artifact namespace is invalid."), e.sourceRevision != null && !Zi(e.sourceRevision) && t.push("Artifact source revision is invalid."), n > un.bundleBytes && t.push("Artifact exceeds the bundle byte limit.");
338
- const r = zn(e.assets) ? e.assets : null;
337
+ Zi(e.namespace) || t.push("Artifact namespace is invalid."), e.sourceRevision != null && !Zi(e.sourceRevision) && t.push("Artifact source revision is invalid."), n > fn.bundleBytes && t.push("Artifact exceeds the bundle byte limit.");
338
+ const r = _n(e.assets) ? e.assets : null;
339
339
  r || t.push("Artifact assets must be a record.");
340
340
  const o = Al(r == null ? void 0 : r.head, "head", t), i = Al(
341
341
  r == null ? void 0 : r.stylesheets,
342
342
  "stylesheet",
343
343
  t
344
344
  );
345
- if (o.size + i.size > un.assetCount && t.push("Artifact has too many shared assets."), !zn(e.frames))
345
+ if (o.size + i.size > fn.assetCount && t.push("Artifact has too many shared assets."), !_n(e.frames))
346
346
  return t.push("Artifact frames must be a record."), { valid: !1, errors: t, bytes: n };
347
347
  const a = Object.entries(e.frames);
348
- a.length > un.frameCount && t.push("Artifact has too many frames.");
348
+ a.length > fn.frameCount && t.push("Artifact has too many frames.");
349
349
  const l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
350
350
  for (const [d, u] of a) {
351
351
  if (!Zi(d)) {
352
352
  t.push(`Frame identifier "${d}" is invalid.`);
353
353
  continue;
354
354
  }
355
- if (!zn(u) || !zn(u.document)) {
355
+ if (!_n(u) || !_n(u.document)) {
356
356
  t.push(`Frame "${d}" is invalid.`);
357
357
  continue;
358
358
  }
@@ -367,17 +367,17 @@ function Pi(e) {
367
367
  t.push(`Frame "${d}" document metadata is invalid.`);
368
368
  continue;
369
369
  }
370
- if (p.doctype && !/^<!doctype\s+[^>]+>$/i.test(p.doctype) && t.push(`Frame "${d}" doctype is invalid.`), typeof u.body != "string" || $i(u.body) > un.bodyBytes) {
370
+ if (p.doctype && !/^<!doctype\s+[^>]+>$/i.test(p.doctype) && t.push(`Frame "${d}" doctype is invalid.`), typeof u.body != "string" || $i(u.body) > fn.bodyBytes) {
371
371
  t.push(`Frame "${d}" body is invalid.`);
372
372
  continue;
373
373
  }
374
- if (!Array.isArray(u.head) || u.head.length > un.headReferencesPerFrame) {
374
+ if (!Array.isArray(u.head) || u.head.length > fn.headReferencesPerFrame) {
375
375
  t.push(`Frame "${d}" head references are invalid.`);
376
376
  continue;
377
377
  }
378
378
  let m = !0;
379
379
  for (const w of u.head) {
380
- if (!zn(w) || !["head", "stylesheet"].includes(String(w.kind)) || typeof w.hash != "string" || !cd.test(w.hash)) {
380
+ if (!_n(w) || !["head", "stylesheet"].includes(String(w.kind)) || typeof w.hash != "string" || !cd.test(w.hash)) {
381
381
  t.push(`Frame "${d}" contains an invalid head reference.`), m = !1;
382
382
  continue;
383
383
  }
@@ -411,7 +411,7 @@ const fd = /^sha256-[a-f0-9]{64}$/, Dp = /^[A-Za-z][A-Za-z0-9]*(?:[-_.:][A-Za-z0
411
411
  ]), Bp = /* @__PURE__ */ new Set(["interaction", "assertion"]), hd = /* @__PURE__ */ new Set([
412
412
  "image/png",
413
413
  "image/webp"
414
- ]), Mt = {
414
+ ]), Et = {
415
415
  bundleBytes: 256 * 1024 * 1024,
416
416
  screenshotAssetBytes: 16 * 1024 * 1024,
417
417
  screenshotAssetCount: 2048,
@@ -434,22 +434,22 @@ function Wp(e) {
434
434
  return Number.POSITIVE_INFINITY;
435
435
  }
436
436
  }
437
- function Pt(e) {
437
+ function Mt(e) {
438
438
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
439
439
  const t = Object.getPrototypeOf(e);
440
440
  return t === Object.prototype || t === null;
441
441
  }
442
442
  function Eo(e) {
443
- return typeof e == "string" && e.length > 0 && e.length <= Mt.identifierLength && e === e.trim() && !_p.has(e);
443
+ return typeof e == "string" && e.length > 0 && e.length <= Et.identifierLength && e === e.trim() && !_p.has(e);
444
444
  }
445
445
  function pd(e) {
446
- return Pt(e) && Number.isInteger(e.width) && Number(e.width) > 0 && Number(e.width) <= Mt.viewportDimension && Number.isInteger(e.height) && Number(e.height) > 0 && Number(e.height) <= Mt.viewportDimension;
446
+ return Mt(e) && Number.isInteger(e.width) && Number(e.width) > 0 && Number(e.width) <= Et.viewportDimension && Number.isInteger(e.height) && Number(e.height) > 0 && Number(e.height) <= Et.viewportDimension;
447
447
  }
448
448
  function Hp(e, t) {
449
449
  return pd(e) && e.width === t.width && e.height === t.height;
450
450
  }
451
451
  function Rl(e) {
452
- return typeof e == "string" && e.length > 0 && e.length <= Mt.tokenLength && Dp.test(e);
452
+ return typeof e == "string" && e.length > 0 && e.length <= Et.tokenLength && Dp.test(e);
453
453
  }
454
454
  function es(e, t) {
455
455
  return e == null || typeof e == "string" && e.length > 0 && e.length <= t && !/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/.test(e);
@@ -461,10 +461,10 @@ function Vp(e) {
461
461
  return e.length / 4 * 3 - t;
462
462
  }
463
463
  function md(e) {
464
- const t = Pt(e) ? e : {}, n = Pt(t.frames) ? t.frames : {}, r = {};
464
+ const t = Mt(e) ? e : {}, n = Mt(t.frames) ? t.frames : {}, r = {};
465
465
  for (const [i, a] of Object.entries(n))
466
- Pt(a) && a.snapshot !== void 0 && (r[i] = a.snapshot);
467
- const o = Pt(t.assets) ? t.assets : {};
466
+ Mt(a) && a.snapshot !== void 0 && (r[i] = a.snapshot);
467
+ const o = Mt(t.assets) ? t.assets : {};
468
468
  return {
469
469
  version: 2,
470
470
  namespace: t.namespace,
@@ -477,18 +477,18 @@ function md(e) {
477
477
  };
478
478
  }
479
479
  function Kp(e, t) {
480
- if (!Pt(e))
480
+ if (!Mt(e))
481
481
  return t.push("Screenshot assets must be a record."), /* @__PURE__ */ new Map();
482
482
  const n = /* @__PURE__ */ new Map();
483
483
  for (const [r, o] of Object.entries(e)) {
484
- if (!fd.test(r) || !Pt(o)) {
484
+ if (!fd.test(r) || !Mt(o)) {
485
485
  t.push(`Screenshot asset "${r}" is invalid.`);
486
486
  continue;
487
487
  }
488
488
  const i = Vp(o.data);
489
489
  if (!hd.has(
490
490
  o.mediaType
491
- ) || !Number.isInteger(o.width) || Number(o.width) <= 0 || Number(o.width) > Mt.viewportDimension || !Number.isInteger(o.height) || Number(o.height) <= 0 || Number(o.height) > Mt.viewportDimension || !Number.isInteger(o.byteLength) || Number(o.byteLength) <= 0 || Number(o.byteLength) > Mt.screenshotAssetBytes || i !== o.byteLength) {
491
+ ) || !Number.isInteger(o.width) || Number(o.width) <= 0 || Number(o.width) > Et.viewportDimension || !Number.isInteger(o.height) || Number(o.height) <= 0 || Number(o.height) > Et.viewportDimension || !Number.isInteger(o.byteLength) || Number(o.byteLength) <= 0 || Number(o.byteLength) > Et.screenshotAssetBytes || i !== o.byteLength) {
492
492
  t.push(`Screenshot asset "${r}" metadata or data is invalid.`);
493
493
  continue;
494
494
  }
@@ -497,44 +497,44 @@ function Kp(e, t) {
497
497
  o
498
498
  );
499
499
  }
500
- return n.size > Mt.screenshotAssetCount && t.push("Artifact has too many screenshot assets."), n;
500
+ return n.size > Et.screenshotAssetCount && t.push("Artifact has too many screenshot assets."), n;
501
501
  }
502
502
  function Up(e, t, n, r) {
503
- if (!Pt(e)) {
503
+ if (!Mt(e)) {
504
504
  r.push(`Frame "${t}" contains an invalid diagnostic.`);
505
505
  return;
506
506
  }
507
- Rl(e.stage) || r.push(`Frame "${t}" diagnostic stage is invalid.`), Rl(e.code) || r.push(`Frame "${t}" diagnostic code is invalid.`), es(e.selector, Mt.selectorLength) || r.push(`Frame "${t}" diagnostic selector is invalid.`), es(e.label, Mt.labelLength) || r.push(`Frame "${t}" diagnostic label is invalid.`), es(e.message, Mt.messageLength) || r.push(`Frame "${t}" diagnostic message is invalid.`), Hp(e.viewport, n) || r.push(`Frame "${t}" diagnostic viewport is invalid.`);
507
+ Rl(e.stage) || r.push(`Frame "${t}" diagnostic stage is invalid.`), Rl(e.code) || r.push(`Frame "${t}" diagnostic code is invalid.`), es(e.selector, Et.selectorLength) || r.push(`Frame "${t}" diagnostic selector is invalid.`), es(e.label, Et.labelLength) || r.push(`Frame "${t}" diagnostic label is invalid.`), es(e.message, Et.messageLength) || r.push(`Frame "${t}" diagnostic message is invalid.`), Hp(e.viewport, n) || r.push(`Frame "${t}" diagnostic viewport is invalid.`);
508
508
  }
509
509
  function qp(e) {
510
510
  return typeof e == "string" && e.split(/[._:-]/).some((t) => Bp.has(t.toLowerCase()));
511
511
  }
512
512
  function Mi(e) {
513
513
  const t = [], n = Wp(e);
514
- if (!Pt(e) || e.version !== 3)
514
+ if (!Mt(e) || e.version !== 3)
515
515
  return {
516
516
  valid: !1,
517
517
  errors: ["Route preview artifact must be a version 3 record."],
518
518
  bytes: n
519
519
  };
520
- Eo(e.namespace) || t.push("Artifact namespace is invalid."), e.sourceRevision != null && !Eo(e.sourceRevision) && t.push("Artifact source revision is invalid."), n > Mt.bundleBytes && t.push("Artifact exceeds the bundle byte limit.");
521
- const r = Pt(e.assets) ? e.assets : null;
520
+ Eo(e.namespace) || t.push("Artifact namespace is invalid."), e.sourceRevision != null && !Eo(e.sourceRevision) && t.push("Artifact source revision is invalid."), n > Et.bundleBytes && t.push("Artifact exceeds the bundle byte limit.");
521
+ const r = Mt(e.assets) ? e.assets : null;
522
522
  r || t.push("Artifact assets must be a record.");
523
523
  const o = Kp(
524
524
  r == null ? void 0 : r.screenshots,
525
525
  t
526
526
  ), i = Pi(md(e));
527
- if (t.push(...i.errors.map((c) => `Snapshot data: ${c}`)), !Pt(e.frames))
527
+ if (t.push(...i.errors.map((c) => `Snapshot data: ${c}`)), !Mt(e.frames))
528
528
  return t.push("Artifact frames must be a record."), { valid: !1, errors: t, bytes: n };
529
529
  const a = Object.entries(e.frames);
530
- a.length > Mt.frameCount && t.push("Artifact has too many frames.");
530
+ a.length > Et.frameCount && t.push("Artifact has too many frames.");
531
531
  const l = /* @__PURE__ */ new Set();
532
532
  for (const [c, d] of a) {
533
533
  if (!Eo(c)) {
534
534
  t.push(`Frame identifier "${c}" is invalid.`);
535
535
  continue;
536
536
  }
537
- if (!Pt(d) || !Op.has(d.status) || !pd(d.viewport)) {
537
+ if (!Mt(d) || !Op.has(d.status) || !pd(d.viewport)) {
538
538
  t.push(`Frame "${c}" status or viewport is invalid.`);
539
539
  continue;
540
540
  }
@@ -543,7 +543,7 @@ function Mi(e) {
543
543
  continue;
544
544
  }
545
545
  const u = d.diagnostics;
546
- if (!Array.isArray(u) || u.length > Mt.diagnosticCountPerFrame) {
546
+ if (!Array.isArray(u) || u.length > Et.diagnosticCountPerFrame) {
547
547
  t.push(`Frame "${c}" diagnostics are invalid.`);
548
548
  continue;
549
549
  }
@@ -552,7 +552,7 @@ function Mi(e) {
552
552
  let p = !1;
553
553
  if (d.screenshot !== void 0) {
554
554
  const b = d.screenshot;
555
- if (!Pt(b) || typeof b.hash != "string" || !fd.test(b.hash) || !hd.has(
555
+ if (!Mt(b) || typeof b.hash != "string" || !fd.test(b.hash) || !hd.has(
556
556
  b.mediaType
557
557
  ) || !Number.isInteger(b.width) || !Number.isInteger(b.height))
558
558
  t.push(`Frame "${c}" screenshot reference is invalid.`);
@@ -565,7 +565,7 @@ function Mi(e) {
565
565
  }
566
566
  const m = d.snapshot !== void 0;
567
567
  d.status === "ready" ? ((!m || !p) && t.push(`Frame "${c}" ready output is incomplete.`), u.length !== 0 && t.push(`Frame "${c}" ready output cannot contain diagnostics.`)) : d.status === "rendered-with-qa-failure" ? ((!m || !p) && t.push(`Frame "${c}" QA failure must preserve stable output.`), (u.length === 0 || !u.some(
568
- (b) => Pt(b) ? qp(b.stage) : !1
568
+ (b) => Mt(b) ? qp(b.stage) : !1
569
569
  )) && t.push(`Frame "${c}" QA failure requires a QA diagnostic.`)) : u.length === 0 && t.push(`Frame "${c}" capture error requires a diagnostic.`);
570
570
  }
571
571
  for (const c of o.keys())
@@ -622,10 +622,10 @@ function ba(e = {}) {
622
622
  );
623
623
  }
624
624
  let vd = ba(), Kr = 0, Fl = 0, Uo = 0, ns = !1;
625
- const Ot = [], mt = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new Map(), br = /* @__PURE__ */ new Set(), Ht = /* @__PURE__ */ new Map(), xr = /* @__PURE__ */ new Map(), bt = /* @__PURE__ */ new Map(), wd = /* @__PURE__ */ new Map(), xa = /* @__PURE__ */ new Map(), Ll = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new Map(), ko = /* @__PURE__ */ new Map();
625
+ const Bt = [], mt = /* @__PURE__ */ new Map(), Ut = /* @__PURE__ */ new Map(), br = /* @__PURE__ */ new Set(), Vt = /* @__PURE__ */ new Map(), xr = /* @__PURE__ */ new Map(), bt = /* @__PURE__ */ new Map(), wd = /* @__PURE__ */ new Map(), xa = /* @__PURE__ */ new Map(), Ll = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new Map(), ko = /* @__PURE__ */ new Map();
626
626
  let Ao = 0, nm = 0, rs = !1;
627
627
  const qo = [], oi = /* @__PURE__ */ new Map();
628
- let Vt = 0, rn = 0, dr = bd, Is, Ur = null;
628
+ let Kt = 0, rn = 0, dr = bd, Is, Ur = null;
629
629
  const qr = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Set(), ii = /* @__PURE__ */ new Set();
630
630
  let ya = 0, va = 0;
631
631
  const si = /* @__PURE__ */ new Set(), ai = /* @__PURE__ */ new Map(), wa = /* @__PURE__ */ new Map();
@@ -656,7 +656,7 @@ function As(e) {
656
656
  function hr(e, t) {
657
657
  e.set(t, (e.get(t) ?? 0) + 1);
658
658
  }
659
- function pn(e) {
659
+ function mn(e) {
660
660
  if (ur > 0) {
661
661
  e == null ? Ps = !0 : $s.add(e);
662
662
  return;
@@ -693,7 +693,7 @@ function vr() {
693
693
  hr(Na, i), fr(ci, i);
694
694
  for (const i of [...si]) i();
695
695
  }
696
- if (r) pn();
696
+ if (r) mn();
697
697
  else if (o.length > 0) {
698
698
  ya += 1;
699
699
  for (const i of o)
@@ -743,15 +743,15 @@ function Md(e) {
743
743
  function Ls() {
744
744
  return Kr;
745
745
  }
746
- function Xn(e) {
747
- return mt.has(e) || bt.has(e) || Kt.has(e);
746
+ function Jn(e) {
747
+ return mt.has(e) || bt.has(e) || Ut.has(e);
748
748
  }
749
749
  function Ei(e) {
750
750
  var t;
751
- return Xn(e) && ((t = Ht.get(e)) == null ? void 0 : t.stale) !== !0;
751
+ return Jn(e) && ((t = Vt.get(e)) == null ? void 0 : t.stale) !== !0;
752
752
  }
753
753
  function $a(e) {
754
- return Ht.get(e) ?? null;
754
+ return Vt.get(e) ?? null;
755
755
  }
756
756
  function Ds() {
757
757
  return va;
@@ -774,7 +774,7 @@ function rm(e, t) {
774
774
  dataUrl: `data:${r.mediaType};base64,${r.data}`
775
775
  };
776
776
  }
777
- function mn(e, t) {
777
+ function gn(e, t) {
778
778
  const n = e.trim();
779
779
  return n ? xr.get(
780
780
  Ir({
@@ -796,7 +796,7 @@ function zs(e, t) {
796
796
  }
797
797
  return n;
798
798
  }
799
- function yt(e, t) {
799
+ function vt(e, t) {
800
800
  const n = zs(e, t);
801
801
  if (n.length !== 0) {
802
802
  yr();
@@ -808,7 +808,7 @@ function yt(e, t) {
808
808
  }
809
809
  }
810
810
  function _s(e) {
811
- return mt.has(e) || bt.has(e) || Kt.has(e) || dt.has(e);
811
+ return mt.has(e) || bt.has(e) || Ut.has(e) || dt.has(e);
812
812
  }
813
813
  function Cr(e) {
814
814
  const t = e == null ? void 0 : e.trim();
@@ -829,10 +829,10 @@ function Os(e, t = /* @__PURE__ */ new Set()) {
829
829
  return t.delete(e), n;
830
830
  }
831
831
  let Pa = null, kd = !1;
832
- const hn = /* @__PURE__ */ new Map();
833
- let Kn = 0;
832
+ const pn = /* @__PURE__ */ new Map();
833
+ let Un = 0;
834
834
  function Bs(e) {
835
- Kn += 1, Pa = e, hn.clear(), !e && xr.size > 0 && (xr.clear(), nn());
835
+ Un += 1, Pa = e, pn.clear(), !e && xr.size > 0 && (xr.clear(), nn());
836
836
  }
837
837
  function Ad(e) {
838
838
  kd = e;
@@ -860,13 +860,13 @@ function js(e, t, n = {}) {
860
860
  const i = {
861
861
  id: r,
862
862
  ...t ? { fingerprint: t } : {}
863
- }, a = Ir(i), l = hn.get(a);
863
+ }, a = Ir(i), l = pn.get(a);
864
864
  if (l) return l;
865
- const c = mn(r, t);
865
+ const c = gn(r, t);
866
866
  if (c.status === "exact" || c.status === "error" && !n.retry)
867
867
  return Promise.resolve(c);
868
- yt([i], { status: "generating" });
869
- const d = Kn;
868
+ vt([i], { status: "generating" });
869
+ const d = Un;
870
870
  let u;
871
871
  try {
872
872
  u = o([i]);
@@ -875,32 +875,32 @@ function js(e, t, n = {}) {
875
875
  }
876
876
  const p = Promise.resolve(u).then(
877
877
  (m) => {
878
- if (d !== Kn)
879
- return mn(r, t);
878
+ if (d !== Un)
879
+ return gn(r, t);
880
880
  const b = (m == null ? void 0 : m.status) === "accepted" ? { status: "exact" } : (m == null ? void 0 : m.status) === "rejected" ? {
881
881
  status: "error",
882
882
  reason: "rejected",
883
883
  message: m.message
884
884
  } : {
885
885
  status: "error",
886
- reason: "unavailable",
886
+ reason: (m == null ? void 0 : m.status) === "unavailable" && m.notPrepared ? "not-prepared" : "unavailable",
887
887
  message: ((m == null ? void 0 : m.status) === "unavailable" ? m.message : void 0) ?? "The exact preview endpoint returned no current capture."
888
888
  };
889
- return yt([i], b), b;
889
+ return vt([i], b), b;
890
890
  },
891
891
  (m) => {
892
- if (d !== Kn)
893
- return mn(r, t);
894
- const b = {
892
+ if (d !== Un)
893
+ return gn(r, t);
894
+ const x = {
895
895
  status: "error",
896
- reason: "unavailable",
896
+ reason: (m == null ? void 0 : m.pygmalionNotPrepared) === !0 ? "not-prepared" : "unavailable",
897
897
  message: m instanceof Error && m.message ? m.message : "The exact preview request failed."
898
898
  };
899
- return yt([i], b), b;
899
+ return vt([i], x), x;
900
900
  }
901
901
  );
902
- return hn.set(a, p), p.finally(() => {
903
- hn.get(a) === p && hn.delete(a);
902
+ return pn.set(a, p), p.finally(() => {
903
+ pn.get(a) === p && pn.delete(a);
904
904
  }), p;
905
905
  }
906
906
  function Fd(e, t = {}) {
@@ -914,16 +914,16 @@ function Fd(e, t = {}) {
914
914
  id: u,
915
915
  ...d.fingerprint ? { fingerprint: d.fingerprint } : {}
916
916
  }, m = Ir(p);
917
- if (i.has(m) || hn.has(m)) continue;
918
- const b = mn(
917
+ if (i.has(m) || pn.has(m)) continue;
918
+ const b = gn(
919
919
  u,
920
920
  d.fingerprint
921
921
  );
922
922
  b.status === "exact" || b.status === "generating" || b.status === "error" && !t.retry || (i.add(m), r.push(p), o.push(m));
923
923
  }
924
924
  if (r.length === 0) return null;
925
- yt(r, { status: "generating" });
926
- const a = Kn;
925
+ vt(r, { status: "generating" });
926
+ const a = Un;
927
927
  let l;
928
928
  try {
929
929
  l = n(r);
@@ -932,7 +932,7 @@ function Fd(e, t = {}) {
932
932
  }
933
933
  const c = Promise.resolve(l).then(
934
934
  (d) => {
935
- if (a !== Kn)
935
+ if (a !== Un)
936
936
  return { status: "idle" };
937
937
  const u = (d == null ? void 0 : d.status) === "accepted" ? { status: "exact" } : (d == null ? void 0 : d.status) === "rejected" ? {
938
938
  status: "error",
@@ -943,24 +943,24 @@ function Fd(e, t = {}) {
943
943
  reason: "unavailable",
944
944
  message: ((d == null ? void 0 : d.status) === "unavailable" ? d.message : void 0) ?? "The exact preview endpoint returned no current capture."
945
945
  };
946
- return yt(r, u), u;
946
+ return vt(r, u), u;
947
947
  },
948
948
  (d) => {
949
- if (a !== Kn)
949
+ if (a !== Un)
950
950
  return { status: "idle" };
951
951
  const u = {
952
952
  status: "error",
953
953
  reason: "unavailable",
954
954
  message: d instanceof Error && d.message ? d.message : "The exact preview request failed."
955
955
  };
956
- return yt(r, u), u;
956
+ return vt(r, u), u;
957
957
  }
958
958
  );
959
959
  for (const d of o)
960
- hn.set(d, c);
960
+ pn.set(d, c);
961
961
  return c.finally(() => {
962
962
  for (const d of o)
963
- hn.get(d) === c && hn.delete(d);
963
+ pn.get(d) === c && pn.delete(d);
964
964
  }), c;
965
965
  }
966
966
  function ki(e) {
@@ -1068,10 +1068,10 @@ function Ma(e) {
1068
1068
  function di(e) {
1069
1069
  const t = bt.get(e);
1070
1070
  if (!t) return !1;
1071
- bt.delete(e), Vt = Math.max(0, Vt - t.ownBytes);
1071
+ bt.delete(e), Kt = Math.max(0, Kt - t.ownBytes);
1072
1072
  for (const n of t.head) {
1073
1073
  const r = Ma(n.kind), o = r.get(n.key);
1074
- o && (o.references -= 1, !(o.references > 0) && (r.delete(n.key), Vt = Math.max(0, Vt - o.bytes)));
1074
+ o && (o.references -= 1, !(o.references > 0) && (r.delete(n.key), Kt = Math.max(0, Kt - o.bytes)));
1075
1075
  }
1076
1076
  return !0;
1077
1077
  }
@@ -1117,7 +1117,7 @@ function cm(e, t, n, r) {
1117
1117
  p.references += 1;
1118
1118
  else {
1119
1119
  const m = c.length * 2;
1120
- d.set(u, { content: c, bytes: m, references: 1 }), Vt += m;
1120
+ d.set(u, { content: c, bytes: m, references: 1 }), Kt += m;
1121
1121
  }
1122
1122
  return { kind: l, key: u };
1123
1123
  }), a = (o.body.length + o.document.doctype.length + o.document.htmlAttributes.length + o.document.headAttributes.length + o.document.bodyAttributes.length + i.reduce((l, c) => l + c.key.length, 0)) * 2;
@@ -1129,7 +1129,7 @@ function cm(e, t, n, r) {
1129
1129
  head: i,
1130
1130
  body: o.body,
1131
1131
  shadow: null
1132
- }), Vt += a, !0;
1132
+ }), Kt += a, !0;
1133
1133
  }
1134
1134
  function dm(e, t) {
1135
1135
  let n = Ll.get(e);
@@ -1192,8 +1192,8 @@ function um(e) {
1192
1192
  stylesheetLinksHtml: r.join("")
1193
1193
  }, e.shadow;
1194
1194
  }
1195
- function Bn(e) {
1196
- const t = Kt.get(e);
1195
+ function jn(e) {
1196
+ const t = Ut.get(e);
1197
1197
  if (t) return um(t);
1198
1198
  const n = bt.get(e);
1199
1199
  return n ? (bt.delete(e), n.lastAccess = Date.now(), bt.set(e, n), lm(n)) : null;
@@ -1220,7 +1220,7 @@ function Ws(e, t) {
1220
1220
  ...x.fingerprint ? { fingerprint: x.fingerprint } : {}
1221
1221
  };
1222
1222
  if (w) {
1223
- if (mn(v.id, v.fingerprint).status === "idle")
1223
+ if (gn(v.id, v.fingerprint).status === "idle")
1224
1224
  for (const S of zs([v], {
1225
1225
  status: "outdated",
1226
1226
  message: "Select this frame to generate the exact preview."
@@ -1274,7 +1274,7 @@ function Ws(e, t) {
1274
1274
  const R = e.frames[w];
1275
1275
  if (!R) continue;
1276
1276
  const H = x.fingerprint != null && R.fingerprint === x.fingerprint, A = c && !(t.allowMatchingFrameIdentity && H) || x.fingerprint != null && !H;
1277
- if (Ht.set(v, {
1277
+ if (Vt.set(v, {
1278
1278
  status: R.status,
1279
1279
  diagnostics: R.diagnostics,
1280
1280
  ...A ? { stale: !0 } : {},
@@ -1284,34 +1284,34 @@ function Ws(e, t) {
1284
1284
  )
1285
1285
  }), dt.add(v), R.snapshot && m) {
1286
1286
  const N = os(t.appOrigin, x.route);
1287
- br.delete(v), Kt.set(v, {
1287
+ br.delete(v), Ut.set(v, {
1288
1288
  bundle: m,
1289
1289
  frameId: w,
1290
1290
  previewBase: N,
1291
1291
  shadow: null
1292
1292
  });
1293
1293
  }
1294
- nn({ key: v }), pn(v), d(x, A), u += 1;
1294
+ nn({ key: v }), mn(v), d(x, A), u += 1;
1295
1295
  continue;
1296
1296
  }
1297
- if (Xn(v) && ((b = Ht.get(v)) == null ? void 0 : b.stale) !== !0) {
1297
+ if (Jn(v) && ((b = Vt.get(v)) == null ? void 0 : b.stale) !== !0) {
1298
1298
  d(x, !1);
1299
1299
  continue;
1300
1300
  }
1301
1301
  if (e.version === 2) {
1302
1302
  if (!e.frames[w]) continue;
1303
1303
  const H = os(t.appOrigin, x.route);
1304
- br.delete(v), Kt.set(v, {
1304
+ br.delete(v), Ut.set(v, {
1305
1305
  bundle: e,
1306
1306
  frameId: w,
1307
1307
  previewBase: H,
1308
1308
  shadow: null
1309
- }), Ht.set(v, {
1309
+ }), Vt.set(v, {
1310
1310
  status: "ready",
1311
1311
  diagnostics: [],
1312
1312
  ...c ? { stale: !0 } : {},
1313
1313
  screenshot: null
1314
- }), dt.add(v), nn({ key: v }), pn(v), d(x, c), u += 1;
1314
+ }), dt.add(v), nn({ key: v }), mn(v), d(x, c), u += 1;
1315
1315
  continue;
1316
1316
  }
1317
1317
  const S = e.snapshots[w];
@@ -1329,7 +1329,7 @@ function Ws(e, t) {
1329
1329
  }
1330
1330
  $ = $.replaceAll("__PYGMALION_PREVIEW_BASE__", R);
1331
1331
  }
1332
- Ti(v, $) ? (Ht.set(v, {
1332
+ Ti(v, $) ? (Vt.set(v, {
1333
1333
  status: "ready",
1334
1334
  diagnostics: [],
1335
1335
  ...c ? { stale: !0 } : {},
@@ -1363,7 +1363,7 @@ function is(e) {
1363
1363
  e.onsuccess = () => t(e.result), e.onerror = () => n(e.error ?? new Error("IndexedDB request failed"));
1364
1364
  });
1365
1365
  }
1366
- function Tn(e) {
1366
+ function Fn(e) {
1367
1367
  return new Promise((t, n) => {
1368
1368
  e.oncomplete = () => t(), e.onabort = () => n(e.error ?? new Error("IndexedDB transaction aborted")), e.onerror = () => n(e.error ?? new Error("IndexedDB transaction failed"));
1369
1369
  });
@@ -1395,26 +1395,26 @@ async function fm() {
1395
1395
  }
1396
1396
  class hm {
1397
1397
  constructor(t) {
1398
- cn(this, "pruneScheduled", !1);
1399
- cn(this, "pruneInFlight", null);
1400
- cn(this, "database");
1398
+ dn(this, "pruneScheduled", !1);
1399
+ dn(this, "pruneInFlight", null);
1400
+ dn(this, "database");
1401
1401
  this.database = t;
1402
1402
  }
1403
1403
  async read(t) {
1404
- const n = this.database.transaction(pt, "readonly"), r = Tn(n), o = await is(
1404
+ const n = this.database.transaction(pt, "readonly"), r = Fn(n), o = await is(
1405
1405
  n.objectStore(pt).get(t)
1406
1406
  );
1407
1407
  return await r, o;
1408
1408
  }
1409
1409
  async readMany(t) {
1410
- const n = this.database.transaction(pt, "readonly"), r = Tn(n), o = n.objectStore(pt), i = t.map((l) => is(o.get(l))), a = await Promise.all(i);
1410
+ const n = this.database.transaction(pt, "readonly"), r = Fn(n), o = n.objectStore(pt), i = t.map((l) => is(o.get(l))), a = await Promise.all(i);
1411
1411
  return await r, new Map(t.map((l, c) => [l, a[c]]));
1412
1412
  }
1413
1413
  async write(t) {
1414
1414
  const n = this.database.transaction(
1415
1415
  pt,
1416
1416
  "readwrite"
1417
- ), r = Tn(n);
1417
+ ), r = Fn(n);
1418
1418
  n.objectStore(pt).put(t), await r, this.schedulePrune();
1419
1419
  }
1420
1420
  schedulePrune() {
@@ -1433,7 +1433,7 @@ class hm {
1433
1433
  const t = this.database.transaction(
1434
1434
  pt,
1435
1435
  "readonly"
1436
- ), n = Tn(t), r = await is(
1436
+ ), n = Fn(t), r = await is(
1437
1437
  t.objectStore(pt).getAll()
1438
1438
  );
1439
1439
  await n;
@@ -1442,15 +1442,15 @@ class hm {
1442
1442
  const i = this.database.transaction(
1443
1443
  pt,
1444
1444
  "readwrite"
1445
- ), a = Tn(i), l = i.objectStore(pt);
1445
+ ), a = Fn(i), l = i.objectStore(pt);
1446
1446
  o.forEach((c) => l.delete(c)), await a;
1447
1447
  }
1448
1448
  async remove(t) {
1449
- const n = this.database.transaction(pt, "readwrite"), r = Tn(n);
1449
+ const n = this.database.transaction(pt, "readwrite"), r = Fn(n);
1450
1450
  n.objectStore(pt).delete(t), await r;
1451
1451
  }
1452
1452
  async clear(t) {
1453
- const n = this.database.transaction(pt, "readwrite"), r = Tn(n), o = n.objectStore(pt);
1453
+ const n = this.database.transaction(pt, "readwrite"), r = Fn(n), o = n.objectStore(pt);
1454
1454
  if (!t)
1455
1455
  o.clear();
1456
1456
  else {
@@ -1521,21 +1521,21 @@ function Qr() {
1521
1521
  }
1522
1522
  function mm() {
1523
1523
  var e;
1524
- for (let t = Ot.length - 1; t >= 0; t -= 1)
1525
- (e = Ot[t]) != null && e.cancelled && Ot.splice(t, 1);
1524
+ for (let t = Bt.length - 1; t >= 0; t -= 1)
1525
+ (e = Bt[t]) != null && e.cancelled && Bt.splice(t, 1);
1526
1526
  }
1527
1527
  function gm() {
1528
- if (mm(), Ot.length === 0) return null;
1528
+ if (mm(), Bt.length === 0) return null;
1529
1529
  let e = 0, t = 0;
1530
- for (let o = 1; o < Ot.length; o += 1) {
1531
- const i = Ot[o], a = Ot[e], l = Ot[t];
1530
+ for (let o = 1; o < Bt.length; o += 1) {
1531
+ const i = Bt[o], a = Bt[e], l = Bt[t];
1532
1532
  i.order < a.order && (e = o), (i.priority < l.priority || i.priority === l.priority && i.order < l.order) && (t = o);
1533
1533
  }
1534
1534
  const r = t !== e && Uo >= Yp ? e : t;
1535
- return r === e ? Uo = 0 : Uo += 1, Ot.splice(r, 1)[0] ?? null;
1535
+ return r === e ? Uo = 0 : Uo += 1, Bt.splice(r, 1)[0] ?? null;
1536
1536
  }
1537
1537
  function bm() {
1538
- for (; Kr < vd && Ot.length > 0; ) {
1538
+ for (; Kr < vd && Bt.length > 0; ) {
1539
1539
  const e = gm();
1540
1540
  if (!e) break;
1541
1541
  Kr += 1, Dl();
@@ -1545,7 +1545,7 @@ function bm() {
1545
1545
  };
1546
1546
  e.release = n, e.resolve(n);
1547
1547
  }
1548
- Ot.length === 0 && (Uo = 0);
1548
+ Bt.length === 0 && (Uo = 0);
1549
1549
  }
1550
1550
  function Od(e = 0) {
1551
1551
  let t;
@@ -1557,7 +1557,7 @@ function Od(e = 0) {
1557
1557
  priority: Number.isFinite(e) ? e : 0,
1558
1558
  release: null,
1559
1559
  resolve: r
1560
- }, Fl += 1, Ot.push(t), Qr();
1560
+ }, Fl += 1, Bt.push(t), Qr();
1561
1561
  }),
1562
1562
  updatePriority: (r) => {
1563
1563
  if (t.cancelled || t.release) return;
@@ -1574,7 +1574,7 @@ function Bd(e) {
1574
1574
  const t = Number.isFinite(e) ? Math.floor(e) : ba();
1575
1575
  vd = Math.min(gd, Math.max(1, t)), Qr();
1576
1576
  }
1577
- function Jt(e) {
1577
+ function Xt(e) {
1578
1578
  var a;
1579
1579
  const t = mt.get(e);
1580
1580
  if (t)
@@ -1582,7 +1582,7 @@ function Jt(e) {
1582
1582
  const n = bt.get(e);
1583
1583
  if (n)
1584
1584
  return bt.delete(e), n.lastAccess = Date.now(), bt.set(e, n), am(n);
1585
- const r = Kt.get(e);
1585
+ const r = Ut.get(e);
1586
1586
  if (!r) return null;
1587
1587
  const o = ud(
1588
1588
  r.bundle,
@@ -1593,31 +1593,31 @@ function Jt(e) {
1593
1593
  o,
1594
1594
  r.previewBase
1595
1595
  );
1596
- return ((a = Ht.get(e)) == null ? void 0 : a.stale) !== !0 && Ai(i) && !br.has(e) && (br.add(e), Ra(e, i)), i;
1596
+ return ((a = Vt.get(e)) == null ? void 0 : a.stale) !== !0 && Ai(i) && !br.has(e) && (br.add(e), Ra(e, i)), i;
1597
1597
  }
1598
1598
  function Aa(e, t, n = pr(e), r = Date.now()) {
1599
1599
  var l, c, d;
1600
1600
  const o = t.length * 2;
1601
1601
  if (!e || !Ai(t) || o > ga)
1602
1602
  return !1;
1603
- Kt.delete(e), di(e);
1603
+ Ut.delete(e), di(e);
1604
1604
  const i = mt.get(e);
1605
- i && (Vt -= i.bytes, mt.delete(e));
1605
+ i && (Kt -= i.bytes, mt.delete(e));
1606
1606
  const a = Cr(n);
1607
1607
  cm(e, t, a, r) || (mt.set(e, {
1608
1608
  bytes: o,
1609
1609
  value: t,
1610
1610
  namespace: a,
1611
1611
  lastAccess: r
1612
- }), Vt += o), yr();
1612
+ }), Kt += o), yr();
1613
1613
  try {
1614
- for (((l = Ht.get(e)) == null ? void 0 : l.stale) === !0 && (Ht.delete(e), nn({ key: e })); mt.size + bt.size > Gp || Vt > Xp; ) {
1614
+ for (((l = Vt.get(e)) == null ? void 0 : l.stale) === !0 && (Vt.delete(e), nn({ key: e })); mt.size + bt.size > Gp || Kt > Xp; ) {
1615
1615
  const u = mt.keys().next().value, p = bt.keys().next().value, m = u ? ((c = mt.get(u)) == null ? void 0 : c.lastAccess) ?? Number.POSITIVE_INFINITY : Number.POSITIVE_INFINITY, b = p ? ((d = bt.get(p)) == null ? void 0 : d.lastAccess) ?? Number.POSITIVE_INFINITY : Number.POSITIVE_INFINITY, x = m <= b ? u : p;
1616
1616
  if (!x) break;
1617
1617
  const w = mt.get(x);
1618
- w ? (Vt -= w.bytes, mt.delete(x)) : di(x), dt.delete(x), pn(x);
1618
+ w ? (Kt -= w.bytes, mt.delete(x)) : di(x), dt.delete(x), mn(x);
1619
1619
  }
1620
- dt.add(e), pn(e);
1620
+ dt.add(e), mn(e);
1621
1621
  } finally {
1622
1622
  vr();
1623
1623
  }
@@ -1648,8 +1648,8 @@ function Ti(e, t) {
1648
1648
  return n && Ra(e, t), n;
1649
1649
  }
1650
1650
  function Wd(e) {
1651
- if (Kt.has(e)) return Promise.resolve(null);
1652
- const t = Jt(e);
1651
+ if (Ut.has(e)) return Promise.resolve(null);
1652
+ const t = Xt(e);
1653
1653
  if (t) return Promise.resolve(t);
1654
1654
  if (dt.has(e)) return Promise.resolve(null);
1655
1655
  const n = qr.get(e);
@@ -1688,8 +1688,8 @@ function Wd(e) {
1688
1688
  async function Ta(e) {
1689
1689
  const t = [...new Set(e.filter(Boolean))], n = /* @__PURE__ */ new Map(), r = [];
1690
1690
  for (const u of t) {
1691
- if (Kt.has(u)) continue;
1692
- const p = Jt(u);
1691
+ if (Ut.has(u)) continue;
1692
+ const p = Xt(u);
1693
1693
  p ? n.set(u, p) : dt.has(u) || r.push(u);
1694
1694
  }
1695
1695
  if (!r.length) return n;
@@ -1698,7 +1698,7 @@ async function Ta(e) {
1698
1698
  yr();
1699
1699
  try {
1700
1700
  r.forEach((u) => {
1701
- dt.add(u), pn(u);
1701
+ dt.add(u), mn(u);
1702
1702
  });
1703
1703
  } finally {
1704
1704
  vr();
@@ -1731,7 +1731,7 @@ async function Ta(e) {
1731
1731
  );
1732
1732
  } catch {
1733
1733
  u.forEach((m) => {
1734
- dt.add(m), pn(m);
1734
+ dt.add(m), mn(m);
1735
1735
  });
1736
1736
  continue;
1737
1737
  }
@@ -1739,7 +1739,7 @@ async function Ta(e) {
1739
1739
  u.map(async (m) => {
1740
1740
  const b = p.get(m), x = jd(b, m);
1741
1741
  if (dt.add(m), !x) {
1742
- if (pn(m), b != null)
1742
+ if (mn(m), b != null)
1743
1743
  try {
1744
1744
  await i.remove(m);
1745
1745
  } catch {
@@ -1774,22 +1774,22 @@ async function Ta(e) {
1774
1774
  function xm(e) {
1775
1775
  const t = e ? Cr(e) : null;
1776
1776
  if (!t)
1777
- mt.clear(), bt.clear(), wd.clear(), xa.clear(), Kt.clear(), br.clear(), Ht.clear(), xr.clear(), Vt = 0;
1777
+ mt.clear(), bt.clear(), wd.clear(), xa.clear(), Ut.clear(), br.clear(), Vt.clear(), xr.clear(), Kt = 0;
1778
1778
  else {
1779
1779
  for (const [r, o] of mt)
1780
- o.namespace === t && (mt.delete(r), Vt -= o.bytes);
1780
+ o.namespace === t && (mt.delete(r), Kt -= o.bytes);
1781
1781
  for (const [r, o] of [...bt])
1782
1782
  o.namespace === t && di(r);
1783
- for (const r of Kt.keys())
1784
- pr(r) === t && (Kt.delete(r), br.delete(r));
1785
- for (const r of Ht.keys())
1786
- pr(r) === t && Ht.delete(r);
1783
+ for (const r of Ut.keys())
1784
+ pr(r) === t && (Ut.delete(r), br.delete(r));
1785
+ for (const r of Vt.keys())
1786
+ pr(r) === t && Vt.delete(r);
1787
1787
  }
1788
1788
  if (rn += 1, !t) dt.clear();
1789
1789
  else
1790
1790
  for (const r of dt)
1791
1791
  pr(r) === t && dt.delete(r);
1792
- nn(), pn();
1792
+ nn(), mn();
1793
1793
  const n = rn;
1794
1794
  Ri().then(async (r) => {
1795
1795
  if (!(!r || rn !== n))
@@ -1801,7 +1801,7 @@ function xm(e) {
1801
1801
  }
1802
1802
  function Fa(e, t, n) {
1803
1803
  if (!e) throw new Error("A route preview task key is required.");
1804
- const r = _n.get(e);
1804
+ const r = On.get(e);
1805
1805
  if (r)
1806
1806
  return r.ticket.updatePriority(t), r.promise;
1807
1807
  const o = Od(t), i = (async () => {
@@ -1812,24 +1812,24 @@ function Fa(e, t, n) {
1812
1812
  a();
1813
1813
  }
1814
1814
  })();
1815
- return _n.set(e, { promise: i, ticket: o }), i.then(
1815
+ return On.set(e, { promise: i, ticket: o }), i.then(
1816
1816
  () => {
1817
1817
  var a;
1818
- ((a = _n.get(e)) == null ? void 0 : a.promise) === i && _n.delete(e);
1818
+ ((a = On.get(e)) == null ? void 0 : a.promise) === i && On.delete(e);
1819
1819
  },
1820
1820
  () => {
1821
1821
  var a;
1822
- ((a = _n.get(e)) == null ? void 0 : a.promise) === i && _n.delete(e);
1822
+ ((a = On.get(e)) == null ? void 0 : a.promise) === i && On.delete(e);
1823
1823
  }
1824
1824
  ), i;
1825
1825
  }
1826
1826
  function ui(e, t, n, r = e) {
1827
- const o = Jt(e);
1827
+ const o = Xt(e);
1828
1828
  if (o) return Promise.resolve(o);
1829
1829
  const i = ko.get(r);
1830
1830
  if (i) {
1831
1831
  i.priority = Math.min(i.priority, t);
1832
- const d = _n.get(i.taskKey);
1832
+ const d = On.get(i.taskKey);
1833
1833
  return d == null || d.ticket.updatePriority(t), i.promise;
1834
1834
  }
1835
1835
  const a = rn, l = `snapshot:${a}:${r}`, c = {
@@ -1838,7 +1838,7 @@ function ui(e, t, n, r = e) {
1838
1838
  promise: Promise.resolve(null)
1839
1839
  };
1840
1840
  return c.promise = Wd(e).then((d) => d || rn !== a ? d : Fa(l, c.priority, async () => {
1841
- const u = Jt(e);
1841
+ const u = Xt(e);
1842
1842
  if (u) return u;
1843
1843
  const p = await n();
1844
1844
  return p && rn === a && Ti(e, p), p;
@@ -1965,15 +1965,15 @@ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1965
1965
  getRoutePreviewArtifactIdentityVersion: Pd,
1966
1966
  getRoutePreviewArtifactKeyVersion: Cd,
1967
1967
  getRoutePreviewArtifactOutcome: $a,
1968
- getRoutePreviewArtifactResolution: mn,
1968
+ getRoutePreviewArtifactResolution: gn,
1969
1969
  getRoutePreviewArtifactRevision: Ds,
1970
1970
  getRoutePreviewCacheNamespace: ka,
1971
- getRoutePreviewShadowArtifact: Bn,
1972
- getRoutePreviewSnapshot: Jt,
1971
+ getRoutePreviewShadowArtifact: jn,
1972
+ getRoutePreviewSnapshot: Xt,
1973
1973
  getRoutePreviewSnapshotKeyVersion: Fs,
1974
1974
  getRoutePreviewSnapshotRevision: Rs,
1975
1975
  hasExactRoutePreviewSnapshot: Ei,
1976
- hasRoutePreviewSnapshot: Xn,
1976
+ hasRoutePreviewSnapshot: Jn,
1977
1977
  hydrateRoutePreviewSnapshot: Wd,
1978
1978
  isRoutePreviewSnapshotHydrated: _s,
1979
1979
  prehydrateRoutePreviewSnapshots: Ta,
@@ -1991,7 +1991,7 @@ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1991
1991
  serializeRoutePreview: La,
1992
1992
  setRoutePreviewArtifactEndpointConfigured: Ad,
1993
1993
  setRoutePreviewArtifactFrameRequester: Bs,
1994
- setRoutePreviewArtifactResolution: yt,
1994
+ setRoutePreviewArtifactResolution: vt,
1995
1995
  setRoutePreviewCacheNamespace: Dd,
1996
1996
  setRoutePreviewConcurrency: Bd,
1997
1997
  setRoutePreviewPersistenceForTests: pm,
@@ -2007,7 +2007,7 @@ const Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2007
2007
  waitForRoutePreviewSettle: Cm
2008
2008
  }, Symbol.toStringTag, { value: "Module" }));
2009
2009
  let co = [], zl = "[]";
2010
- const Jn = /* @__PURE__ */ new Map(), Ks = /* @__PURE__ */ new Set();
2010
+ const Qn = /* @__PURE__ */ new Map(), Ks = /* @__PURE__ */ new Set();
2011
2011
  let Hd = 0;
2012
2012
  function $m(e) {
2013
2013
  return e ? JSON.parse(JSON.stringify(e)) : void 0;
@@ -2060,7 +2060,7 @@ function Da() {
2060
2060
  }
2061
2061
  function Mm(e) {
2062
2062
  const t = Pm(e), n = JSON.stringify(t);
2063
- n !== zl && (co = t, zl = n, Jn.clear(), Da());
2063
+ n !== zl && (co = t, zl = n, Qn.clear(), Da());
2064
2064
  }
2065
2065
  function Em() {
2066
2066
  return co;
@@ -2068,7 +2068,7 @@ function Em() {
2068
2068
  function km(e) {
2069
2069
  const t = co.find((n) => n.id === e);
2070
2070
  if (t)
2071
- return Jn.get(t.id) ?? t.defaultValue;
2071
+ return Qn.get(t.id) ?? t.defaultValue;
2072
2072
  }
2073
2073
  function Am(e, t) {
2074
2074
  const n = co.find((r) => r.id === e);
@@ -2077,15 +2077,15 @@ function Am(e, t) {
2077
2077
  throw new Error(
2078
2078
  `Preview environment control "${e}" has no option "${t}".`
2079
2079
  );
2080
- Jn.get(e) !== t && (Jn.set(e, t), Da());
2080
+ Qn.get(e) !== t && (Qn.set(e, t), Da());
2081
2081
  }
2082
2082
  function Vw() {
2083
- Jn.size && (Jn.clear(), Da());
2083
+ Qn.size && (Qn.clear(), Da());
2084
2084
  }
2085
2085
  function Rm() {
2086
2086
  let e;
2087
2087
  for (const t of co) {
2088
- const n = Jn.get(t.id);
2088
+ const n = Qn.get(t.id);
2089
2089
  if (n == null) continue;
2090
2090
  const r = t.options.find((o) => o.value === n);
2091
2091
  e = Lt(e, r == null ? void 0 : r.environment);
@@ -2098,20 +2098,20 @@ function za(e) {
2098
2098
  function wr() {
2099
2099
  return Hd;
2100
2100
  }
2101
- function gn(e, t) {
2101
+ function bn(e, t) {
2102
2102
  const n = t ?? e.id === f.activePageId;
2103
2103
  return Lt(
2104
2104
  e.environment,
2105
2105
  n ? Rm() : void 0
2106
2106
  );
2107
2107
  }
2108
- function jt(e, t, n = {
2108
+ function Wt(e, t, n = {
2109
2109
  width: e.width ?? 390,
2110
2110
  height: e.height ?? 600
2111
2111
  }, r) {
2112
2112
  const o = Lt(
2113
- Xt(),
2114
- gn(e, r)
2113
+ Gt(),
2114
+ bn(e, r)
2115
2115
  );
2116
2116
  return ki({
2117
2117
  namespace: ka(),
@@ -2127,10 +2127,10 @@ function jt(e, t, n = {
2127
2127
  }
2128
2128
  const Tm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2129
2129
  __proto__: null,
2130
- pagePreviewEnvironment: gn,
2131
- routePreviewCacheKey: jt
2130
+ pagePreviewEnvironment: bn,
2131
+ routePreviewCacheKey: Wt
2132
2132
  }, Symbol.toStringTag, { value: "Module" })), Fm = /* @__PURE__ */ new Set(), Yr = /* @__PURE__ */ new Map();
2133
- let $t = [];
2133
+ let Pt = [];
2134
2134
  const Vd = 2;
2135
2135
  function Kd(e, t) {
2136
2136
  for (const r of [...Fm]) r();
@@ -2146,23 +2146,23 @@ function Kd(e, t) {
2146
2146
  function _a(e, t = Vd) {
2147
2147
  if (!e) return !1;
2148
2148
  const n = Math.max(1, t);
2149
- if ($t[0] === e && $t.length <= n) return !1;
2150
- const r = [e, ...$t.filter((i) => i !== e)].slice(0, n);
2151
- if (r.length === $t.length && r.every((i, a) => i === $t[a]))
2149
+ if (Pt[0] === e && Pt.length <= n) return !1;
2150
+ const r = [e, ...Pt.filter((i) => i !== e)].slice(0, n);
2151
+ if (r.length === Pt.length && r.every((i, a) => i === Pt[a]))
2152
2152
  return !1;
2153
- const o = $t;
2154
- return $t = r, Kd(o, r), !0;
2153
+ const o = Pt;
2154
+ return Pt = r, Kd(o, r), !0;
2155
2155
  }
2156
2156
  function Lm(e) {
2157
- if (!$t.includes(e)) return;
2158
- const t = $t;
2159
- $t = $t.filter((n) => n !== e), Kd(t, $t);
2157
+ if (!Pt.includes(e)) return;
2158
+ const t = Pt;
2159
+ Pt = Pt.filter((n) => n !== e), Kd(t, Pt);
2160
2160
  }
2161
2161
  function Oa(e) {
2162
- return $t.includes(e);
2162
+ return Pt.includes(e);
2163
2163
  }
2164
2164
  function Ud() {
2165
- return $t;
2165
+ return Pt;
2166
2166
  }
2167
2167
  function Dm(e, t) {
2168
2168
  let n = Yr.get(e);
@@ -2187,17 +2187,17 @@ function zm(e, t) {
2187
2187
  route: e.route,
2188
2188
  width: n,
2189
2189
  height: r,
2190
- key: jt(e, t)
2190
+ key: Wt(e, t)
2191
2191
  }, fi.set(e, i));
2192
- const a = Jt(i.key);
2192
+ const a = Xt(i.key);
2193
2193
  if (a != null) return a.length * 2;
2194
- const l = Bn(i.key);
2194
+ const l = jn(i.key);
2195
2195
  return l ? l.bodyHtml.length * 2 : 0;
2196
2196
  }
2197
2197
  function _m(e, t) {
2198
2198
  var a;
2199
2199
  if (e.route == null) return null;
2200
- const n = fi.get(e), r = (n == null ? void 0 : n.key) ?? jt(e, t), o = (a = $a(r)) == null ? void 0 : a.screenshot;
2200
+ const n = fi.get(e), r = (n == null ? void 0 : n.key) ?? Wt(e, t), o = (a = $a(r)) == null ? void 0 : a.screenshot;
2201
2201
  if (!o) return null;
2202
2202
  const i = e.width ?? 390;
2203
2203
  return i > 0 ? o.width / i : null;
@@ -2213,7 +2213,7 @@ function Om() {
2213
2213
  });
2214
2214
  }
2215
2215
  function qd() {
2216
- const e = Gn(), t = f.selectedCanvasObject;
2216
+ const e = Xn(), t = f.selectedCanvasObject;
2217
2217
  return f.pages.filter(
2218
2218
  (n) => (n.canvas ?? "default") === f.activeCanvas && f.isScreenStateShown(n)
2219
2219
  ).map((n) => ({
@@ -2222,7 +2222,7 @@ function qd() {
2222
2222
  x: n.x ?? 0,
2223
2223
  y: n.y ?? 0,
2224
2224
  width: n.width ?? 390,
2225
- height: fn(n)
2225
+ height: hn(n)
2226
2226
  },
2227
2227
  pinned: n.id === f.activePageId || (t == null ? void 0 : t.kind) === "frame" && t.id === n.id || // Catalog sheets must stay mounted so their DOM bounds can be measured.
2228
2228
  n.frameSizeMode === "content" || Oa(n.id),
@@ -2289,7 +2289,7 @@ const jm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2289
2289
  CameraLayer: Yd,
2290
2290
  __debugReadEditorFrames: Om
2291
2291
  }, Symbol.toStringTag, { value: "Module" }));
2292
- function Bt(e) {
2292
+ function jt(e) {
2293
2293
  return typeof e == "number" && Number.isFinite(e) ? Math.max(0, e) : 0;
2294
2294
  }
2295
2295
  function Us(e) {
@@ -2317,9 +2317,9 @@ function Gd(e) {
2317
2317
  1,
2318
2318
  Math.ceil(
2319
2319
  Math.max(
2320
- Bt(t.clientWidth),
2321
- Bt(t.offsetWidth),
2322
- Bt(t.scrollWidth),
2320
+ jt(t.clientWidth),
2321
+ jt(t.offsetWidth),
2322
+ jt(t.scrollWidth),
2323
2323
  n.width,
2324
2324
  i - r
2325
2325
  )
@@ -2329,9 +2329,9 @@ function Gd(e) {
2329
2329
  1,
2330
2330
  Math.ceil(
2331
2331
  Math.max(
2332
- Bt(t.clientHeight),
2333
- Bt(t.offsetHeight),
2334
- Bt(t.scrollHeight),
2332
+ jt(t.clientHeight),
2333
+ jt(t.offsetHeight),
2334
+ jt(t.scrollHeight),
2335
2335
  n.height,
2336
2336
  a - o
2337
2337
  )
@@ -2340,15 +2340,15 @@ function Gd(e) {
2340
2340
  };
2341
2341
  }
2342
2342
  function Bl(e) {
2343
- const t = e, n = Us(e), r = Bt(t.offsetWidth), o = Bt(t.offsetHeight), i = Bt(t.clientWidth), a = Bt(t.clientHeight);
2343
+ const t = e, n = Us(e), r = jt(t.offsetWidth), o = jt(t.offsetHeight), i = jt(t.clientWidth), a = jt(t.clientHeight);
2344
2344
  return {
2345
2345
  width: Math.max(
2346
2346
  1,
2347
- Math.ceil(r || i || Bt(n.width))
2347
+ Math.ceil(r || i || jt(n.width))
2348
2348
  ),
2349
2349
  height: Math.max(
2350
2350
  1,
2351
- Math.ceil(o || a || Bt(n.height))
2351
+ Math.ceil(o || a || jt(n.height))
2352
2352
  )
2353
2353
  };
2354
2354
  }
@@ -2426,10 +2426,10 @@ function qm() {
2426
2426
  };
2427
2427
  }
2428
2428
  function Ym() {
2429
- const e = Qe(ha, bn, bn), t = Qe(
2429
+ const e = Qe(ha, xn, xn), t = Qe(
2430
2430
  Uc,
2431
- Gn,
2432
- Gn
2431
+ Xn,
2432
+ Xn
2433
2433
  ), n = Qe(
2434
2434
  za,
2435
2435
  wr,
@@ -2438,7 +2438,7 @@ function Ym() {
2438
2438
  return { appOrigin: e, previewRevision: t, environmentControlRevision: n };
2439
2439
  }
2440
2440
  function Gm(e) {
2441
- const { pageId: t, routePreviewKey: n, authoredRoutePreviewKey: r, canonicalId: o } = e, i = e.fingerprint ?? void 0, a = e.batchHydrated ?? !1, l = wt(
2441
+ const { pageId: t, routePreviewKey: n, authoredRoutePreviewKey: r, canonicalId: o } = e, i = e.fingerprint ?? void 0, a = e.batchHydrated ?? !1, l = St(
2442
2442
  (v) => {
2443
2443
  const S = Id(
2444
2444
  n,
@@ -2453,21 +2453,21 @@ function Gm(e) {
2453
2453
  };
2454
2454
  },
2455
2455
  [n, o, i]
2456
- ), c = wt(
2456
+ ), c = St(
2457
2457
  () => Cd(n) + Pd(o, i),
2458
2458
  [n, o, i]
2459
2459
  ), d = Qe(
2460
2460
  l,
2461
2461
  c,
2462
2462
  c
2463
- ), u = wt(
2463
+ ), u = St(
2464
2464
  (v) => Dm(t, v),
2465
2465
  [t]
2466
- ), p = wt(() => Oa(t), [t]), m = Qe(
2466
+ ), p = St(() => Oa(t), [t]), m = Qe(
2467
2467
  u,
2468
2468
  p,
2469
2469
  () => !1
2470
- ), b = wt(
2470
+ ), b = St(
2471
2471
  (v) => {
2472
2472
  const S = Ts(
2473
2473
  n,
@@ -2481,7 +2481,7 @@ function Gm(e) {
2481
2481
  };
2482
2482
  },
2483
2483
  [n, r]
2484
- ), x = wt(
2484
+ ), x = St(
2485
2485
  () => Fs(n) + Fs(r),
2486
2486
  [n, r]
2487
2487
  );
@@ -2527,7 +2527,7 @@ function Jd() {
2527
2527
  }
2528
2528
  const Zm = 2, eg = 18e4;
2529
2529
  let tg = eg;
2530
- const Wt = [], Un = {
2530
+ const Ht = [], qn = {
2531
2531
  boots: 0,
2532
2532
  reuses: 0,
2533
2533
  parks: 0,
@@ -2548,10 +2548,10 @@ function Zd(e) {
2548
2548
  return JSON.stringify(e.preset ?? null);
2549
2549
  }
2550
2550
  function qs(e) {
2551
- e.timer != null && clearTimeout(e.timer), e.iframe.remove(), Un.evictions += 1;
2551
+ e.timer != null && clearTimeout(e.timer), e.iframe.remove(), qn.evictions += 1;
2552
2552
  }
2553
2553
  function Ba() {
2554
- const e = Wt.splice(0, Wt.length);
2554
+ const e = Ht.splice(0, Ht.length);
2555
2555
  for (const t of e) qs(t);
2556
2556
  }
2557
2557
  function eu(e, t) {
@@ -2569,17 +2569,17 @@ function eu(e, t) {
2569
2569
  return !0;
2570
2570
  }
2571
2571
  function tu(e) {
2572
- return Wt.some((t) => eu(t, e));
2572
+ return Ht.some((t) => eu(t, e));
2573
2573
  }
2574
2574
  function rg(e) {
2575
2575
  let t = -1, n = -1;
2576
- for (let o = 0; o < Wt.length; o += 1) {
2577
- const i = Wt[o];
2576
+ for (let o = 0; o < Ht.length; o += 1) {
2577
+ const i = Ht[o];
2578
2578
  eu(i, e) && i.executed.length > n && (n = i.executed.length, t = o);
2579
2579
  }
2580
2580
  if (t < 0) return null;
2581
- const [r] = Wt.splice(t, 1);
2582
- return r.timer != null && clearTimeout(r.timer), Un.reuses += 1, { iframe: r.iframe, skip: r.executed.length };
2581
+ const [r] = Ht.splice(t, 1);
2582
+ return r.timer != null && clearTimeout(r.timer), qn.reuses += 1, { iframe: r.iframe, skip: r.executed.length };
2583
2583
  }
2584
2584
  function og(e, t, n) {
2585
2585
  var i, a;
@@ -2593,10 +2593,10 @@ function og(e, t, n) {
2593
2593
  timer: null
2594
2594
  };
2595
2595
  for (o.timer = setTimeout(() => {
2596
- const l = Wt.indexOf(o);
2597
- l < 0 || (Wt.splice(l, 1), qs(o));
2598
- }, tg), (a = (i = o.timer) == null ? void 0 : i.unref) == null || a.call(i), Wt.push(o), Un.parks += 1; Wt.length > Zm; ) {
2599
- const l = Wt.shift();
2596
+ const l = Ht.indexOf(o);
2597
+ l < 0 || (Ht.splice(l, 1), qs(o));
2598
+ }, tg), (a = (i = o.timer) == null ? void 0 : i.unref) == null || a.call(i), Ht.push(o), qn.parks += 1; Ht.length > Zm; ) {
2599
+ const l = Ht.shift();
2600
2600
  l && qs(l);
2601
2601
  }
2602
2602
  }
@@ -2663,7 +2663,7 @@ function Fi(e = {}) {
2663
2663
  const W = A.waypoints[0];
2664
2664
  z.style.width = `${Math.round(W.width)}px`, z.style.height = `${Math.round(W.height)}px`, k || T.appendChild(z);
2665
2665
  try {
2666
- k || (await i(z, A.url), Un.boots += 1, Un.bootsByRunner[n] = (Un.bootsByRunner[n] ?? 0) + 1);
2666
+ k || (await i(z, A.url), qn.boots += 1, qn.bootsByRunner[n] = (qn.bootsByRunner[n] ?? 0) + 1);
2667
2667
  for (let oe = 0; oe < A.waypoints.length; oe += 1) {
2668
2668
  if (N !== p) {
2669
2669
  for (let I = oe; I < A.waypoints.length; I += 1)
@@ -2773,7 +2773,7 @@ function Fi(e = {}) {
2773
2773
  },
2774
2774
  /** How many finished walks currently have an instance parked for reuse. */
2775
2775
  debugWarmInstancesParked() {
2776
- return Wt.length;
2776
+ return Ht.length;
2777
2777
  }
2778
2778
  };
2779
2779
  }
@@ -2783,7 +2783,7 @@ function uo() {
2783
2783
  }
2784
2784
  const sg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2785
2785
  __proto__: null,
2786
- __flowSessionWarmDebug: Un,
2786
+ __flowSessionWarmDebug: qn,
2787
2787
  createFlowSessionIframe: Jd,
2788
2788
  createFlowSessionRunner: Fi,
2789
2789
  evictFlowSessionWarmInstances: Ba,
@@ -2866,20 +2866,20 @@ function Li(e, t, n) {
2866
2866
  const u = c.interactiveStateId ? (c.interactions ?? []).slice(((a = c.baseInteractions) == null ? void 0 : a.length) ?? 0) : [];
2867
2867
  r.push({
2868
2868
  screenId: l.screenId,
2869
- cacheKey: jt(c, n, void 0, !1),
2869
+ cacheKey: Wt(c, n, void 0, !1),
2870
2870
  width: c.width ?? 390,
2871
- height: fn(c),
2871
+ height: hn(c),
2872
2872
  steps: [...l.steps ?? [], ...u],
2873
2873
  assertions: c.assertions
2874
2874
  });
2875
2875
  }
2876
2876
  return r.length === 0 ? null : {
2877
2877
  id: e.id,
2878
- url: mr(bn(), e.route, {
2878
+ url: mr(xn(), e.route, {
2879
2879
  ...Lt(
2880
2880
  Lt(
2881
2881
  Gf(i),
2882
- Xt()
2882
+ Gt()
2883
2883
  ),
2884
2884
  e.environment
2885
2885
  ) ?? {},
@@ -2918,7 +2918,7 @@ function su(e) {
2918
2918
  u.waypoints.some(
2919
2919
  (m) => {
2920
2920
  var b;
2921
- return !Xn(m.cacheKey) && r.screenState(m.screenId) == null && ((b = n.get(m.screenId)) == null ? void 0 : b.layersImported) !== !0;
2921
+ return !Jn(m.cacheKey) && r.screenState(m.screenId) == null && ((b = n.get(m.screenId)) == null ? void 0 : b.layersImported) !== !0;
2922
2922
  }
2923
2923
  ) && o.push(u);
2924
2924
  }
@@ -2985,8 +2985,8 @@ function lu(e, t, n) {
2985
2985
  (p) => p.screenId === r
2986
2986
  );
2987
2987
  if (l < 0) return !1;
2988
- const c = jt(e, n, t, !1), d = async (p) => {
2989
- const m = Vn();
2988
+ const c = Wt(e, n, t, !1), d = async (p) => {
2989
+ const m = Kn();
2990
2990
  if (!m) {
2991
2991
  $n.controllerMissing += 1;
2992
2992
  return;
@@ -3441,7 +3441,7 @@ function Wl(e, t = Rg) {
3441
3441
  n.push(e.slice(r, r + t));
3442
3442
  return n;
3443
3443
  }
3444
- function Qt(e, t) {
3444
+ function Jt(e, t) {
3445
3445
  const n = e.trim();
3446
3446
  if (!n && t != null) return t;
3447
3447
  if (Go(n)) return n;
@@ -3486,7 +3486,7 @@ function gu(e) {
3486
3486
  if (!Array.isArray(e))
3487
3487
  throw new TypeError("Preview recipes must be an array.");
3488
3488
  const t = /* @__PURE__ */ new Set(), n = e.map(({ id: r, recipe: o }) => {
3489
- const i = Qt(r);
3489
+ const i = Jt(r);
3490
3490
  if (t.has(i))
3491
3491
  throw new TypeError(`Duplicate preview recipe identity: ${i}`);
3492
3492
  return t.add(i), {
@@ -3500,8 +3500,8 @@ function Lg(e, t = {}) {
3500
3500
  const n = Og(e), r = t.dependencyDigest;
3501
3501
  return gu([
3502
3502
  {
3503
- id: Qt(e.id ?? "", "frame"),
3504
- recipe: r == null ? n : { recipe: n, dependencyDigest: Qt(r) }
3503
+ id: Jt(e.id ?? "", "frame"),
3504
+ recipe: r == null ? n : { recipe: n, dependencyDigest: Jt(r) }
3505
3505
  }
3506
3506
  ]);
3507
3507
  }
@@ -3590,7 +3590,7 @@ function Kw({
3590
3590
  recipeVersion: n,
3591
3591
  scope: r = Cg
3592
3592
  }) {
3593
- const o = Qt(r), i = Qt(
3593
+ const o = Jt(r), i = Jt(
3594
3594
  e,
3595
3595
  $g
3596
3596
  ), a = Tg(n), l = gu(t);
@@ -3654,17 +3654,17 @@ function Bg({
3654
3654
  }
3655
3655
  );
3656
3656
  if (!d.ok) {
3657
- const p = await d.json().catch(() => null), m = Qn(p) && typeof p.error == "string" ? p.error : null, b = typeof d.status == "number" && d.status > 0 ? ` (${d.status}${d.statusText ? ` ${d.statusText}` : ""})` : "";
3658
- throw new Error(
3657
+ const p = await d.json().catch(() => null), m = Mn(p) && typeof p.error == "string" ? p.error : null, b = typeof d.status == "number" && d.status > 0 ? ` (${d.status}${d.statusText ? ` ${d.statusText}` : ""})` : "", x = new Error(
3659
3658
  `Preview artifact request failed${b}${m ? `: ${m}` : "."}`
3660
3659
  );
3660
+ throw Mn(p) && p.retryable === !0 && (x.pygmalionNotPrepared = !0), x;
3661
3661
  }
3662
3662
  const u = await d.json().catch(() => null);
3663
- return Qn(u) && u.artifact !== void 0 ? u.artifact : u;
3663
+ return Mn(u) && u.artifact !== void 0 ? u.artifact : u;
3664
3664
  };
3665
3665
  }
3666
3666
  function jg(e, t) {
3667
- if (!Qn(e) || e.ok !== !0)
3667
+ if (!Mn(e) || e.ok !== !0)
3668
3668
  return { valid: !1, errors: ["Preview artifact resolution is invalid."] };
3669
3669
  const n = new Set(t.map((d) => d.id)), r = /* @__PURE__ */ new Set(), o = [], i = (d) => {
3670
3670
  const u = e[d];
@@ -3696,8 +3696,8 @@ async function Wg({
3696
3696
  frames: o
3697
3697
  }) {
3698
3698
  const i = {
3699
- namespace: Qt(e),
3700
- sourceRevision: Qt(t)
3699
+ namespace: Jt(e),
3700
+ sourceRevision: Jt(t)
3701
3701
  };
3702
3702
  let a;
3703
3703
  try {
@@ -3721,7 +3721,7 @@ async function Wg({
3721
3721
  errors: l.errors
3722
3722
  };
3723
3723
  }
3724
- function Qn(e) {
3724
+ function Mn(e) {
3725
3725
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
3726
3726
  const t = Object.getPrototypeOf(e);
3727
3727
  return t === Object.prototype || t === null;
@@ -3749,7 +3749,7 @@ function Vg(e) {
3749
3749
  }
3750
3750
  function Kg(e) {
3751
3751
  const t = [];
3752
- if (!Qn(e) || e.version !== 1)
3752
+ if (!Mn(e) || e.version !== 1)
3753
3753
  return {
3754
3754
  valid: !1,
3755
3755
  artifact: null,
@@ -3757,7 +3757,7 @@ function Kg(e) {
3757
3757
  "Preview artifact must be a version 1, version 2, or version 3 bundle."
3758
3758
  ]
3759
3759
  };
3760
- if (Go(e.namespace) || t.push("Preview artifact namespace is invalid."), e.sourceRevision != null && !Go(e.sourceRevision) && t.push("Preview artifact source revision is invalid."), !Qn(e.snapshots))
3760
+ if (Go(e.namespace) || t.push("Preview artifact namespace is invalid."), e.sourceRevision != null && !Go(e.sourceRevision) && t.push("Preview artifact source revision is invalid."), !Mn(e.snapshots))
3761
3761
  t.push("Preview artifact snapshots must be a record.");
3762
3762
  else {
3763
3763
  const n = Object.entries(e.snapshots);
@@ -3777,14 +3777,14 @@ function Kg(e) {
3777
3777
  };
3778
3778
  }
3779
3779
  function Ug(e, t, n = {}) {
3780
- const r = Qn(e) && e.version === 3 ? (() => {
3780
+ const r = Mn(e) && e.version === 3 ? (() => {
3781
3781
  const o = Mi(e);
3782
3782
  return {
3783
3783
  valid: o.valid,
3784
3784
  artifact: o.valid ? e : null,
3785
3785
  errors: o.errors
3786
3786
  };
3787
- })() : Qn(e) && e.version === 2 ? (() => {
3787
+ })() : Mn(e) && e.version === 2 ? (() => {
3788
3788
  const o = Pi(e);
3789
3789
  return {
3790
3790
  valid: o.valid,
@@ -3797,7 +3797,7 @@ function Ug(e, t, n = {}) {
3797
3797
  artifact: null,
3798
3798
  reason: "invalid-bundle",
3799
3799
  errors: r.errors
3800
- } : t && r.artifact.namespace !== Qt(t.namespace) ? {
3800
+ } : t && r.artifact.namespace !== Jt(t.namespace) ? {
3801
3801
  valid: !1,
3802
3802
  artifact: null,
3803
3803
  reason: "namespace-mismatch",
@@ -3807,7 +3807,7 @@ function Ug(e, t, n = {}) {
3807
3807
  } : t && // A per-frame answer is judged frame by frame: the bundle names the last
3808
3808
  // publish, not the revision every frame in it came from. Rejecting on that
3809
3809
  // value would undo the point of asking per frame.
3810
- !n.perFrameIdentity && r.artifact.sourceRevision !== Qt(t.sourceRevision) ? {
3810
+ !n.perFrameIdentity && r.artifact.sourceRevision !== Jt(t.sourceRevision) ? {
3811
3811
  valid: !1,
3812
3812
  artifact: null,
3813
3813
  reason: "revision-mismatch",
@@ -3843,8 +3843,8 @@ async function Yg({
3843
3843
  generate: i
3844
3844
  }) {
3845
3845
  const a = {
3846
- namespace: Qt(e),
3847
- sourceRevision: Qt(t)
3846
+ namespace: Jt(e),
3847
+ sourceRevision: Jt(t)
3848
3848
  };
3849
3849
  let l;
3850
3850
  try {
@@ -4113,7 +4113,13 @@ function Iu({
4113
4113
  captureStatus: n,
4114
4114
  diagnostic: r
4115
4115
  }) {
4116
- return t.status === "error" ? {
4116
+ return t.status === "error" ? t.reason === "not-prepared" ? {
4117
+ title: "Preview not prepared",
4118
+ detail: "Refresh the source to draw this frame from the running app",
4119
+ tone: "info",
4120
+ role: "status",
4121
+ retryable: !0
4122
+ } : {
4117
4123
  title: "Preview refresh failed",
4118
4124
  detail: t.message,
4119
4125
  tone: "error",
@@ -4815,7 +4821,7 @@ function _u() {
4815
4821
  for (const n of f.canvasPages) {
4816
4822
  if (!n.section) continue;
4817
4823
  const r = n.x ?? 0, o = n.y ?? 0;
4818
- t(n.section, r, o, r + (n.width ?? 390), o + fn(n));
4824
+ t(n.section, r, o, r + (n.width ?? 390), o + hn(n));
4819
4825
  }
4820
4826
  return e;
4821
4827
  }
@@ -5304,7 +5310,7 @@ function Lb(e) {
5304
5310
  stylesheetLinksHtml: e.snapshot ? Fb(e.snapshot) : ""
5305
5311
  };
5306
5312
  }
5307
- function jn(e, t) {
5313
+ function Wn(e, t) {
5308
5314
  Sr(e);
5309
5315
  const n = kb(e), r = io(t);
5310
5316
  if (!r) return ec(n);
@@ -5354,7 +5360,7 @@ function Qo(e, t, n) {
5354
5360
  if (c === "style") {
5355
5361
  Sr(l.value), o && a.setAttribute(
5356
5362
  l.name,
5357
- jn(l.value, o)
5363
+ Wn(l.value, o)
5358
5364
  );
5359
5365
  continue;
5360
5366
  }
@@ -5391,7 +5397,7 @@ function Za(e, t, n, r) {
5391
5397
  return;
5392
5398
  }
5393
5399
  if (o === "style") {
5394
- e.setAttribute(t, jn(n, r));
5400
+ e.setAttribute(t, Wn(n, r));
5395
5401
  return;
5396
5402
  }
5397
5403
  if (o === "srcset") {
@@ -5527,8 +5533,8 @@ function _b(e, t) {
5527
5533
  }
5528
5534
  class Ob {
5529
5535
  constructor() {
5530
- cn(this, "sharedStyles", /* @__PURE__ */ new Map());
5531
- cn(this, "overrideStyles", /* @__PURE__ */ new Map());
5536
+ dn(this, "sharedStyles", /* @__PURE__ */ new Map());
5537
+ dn(this, "overrideStyles", /* @__PURE__ */ new Map());
5532
5538
  }
5533
5539
  acquire(t, n, r, o, i, a) {
5534
5540
  const l = xi(o);
@@ -5698,8 +5704,8 @@ function jb(e, t, n = Bb) {
5698
5704
  const p = Xr(r.sharedCssText);
5699
5705
  if (t.sharedCssHash && t.sharedCssHash !== p)
5700
5706
  throw new Error("The provided shared CSS hash does not match its content.");
5701
- const m = jn(r.sharedCssText, a), b = Xr(m), x = (t.sharedStylesheets ?? []).map((z) => {
5702
- const Z = jn(z.cssText, a);
5707
+ const m = Wn(r.sharedCssText, a), b = Xr(m), x = (t.sharedStylesheets ?? []).map((z) => {
5708
+ const Z = Wn(z.cssText, a);
5703
5709
  return {
5704
5710
  cssText: Z,
5705
5711
  key: `${z.key}:${Xr(Z)}`
@@ -5716,7 +5722,7 @@ function jb(e, t, n = Bb) {
5716
5722
  ), H = n.acquireOverride(
5717
5723
  o,
5718
5724
  v,
5719
- jn(t.overrideCssText ?? "", a)
5725
+ Wn(t.overrideCssText ?? "", a)
5720
5726
  );
5721
5727
  let A = !1;
5722
5728
  const N = {
@@ -5732,13 +5738,13 @@ function jb(e, t, n = Bb) {
5732
5738
  updateOverrideCss: (z) => {
5733
5739
  A || n.updateOverrideCss(
5734
5740
  v,
5735
- jn(z, a)
5741
+ Wn(z, a)
5736
5742
  );
5737
5743
  },
5738
5744
  updateSharedCss: (z) => {
5739
5745
  A || n.updateSharedCss(
5740
5746
  b,
5741
- jn(z, a)
5747
+ Wn(z, a)
5742
5748
  );
5743
5749
  },
5744
5750
  teardown: () => {
@@ -5998,7 +6004,7 @@ function qb(e, t, n, r) {
5998
6004
  return o || (Hu.has(e) || ea.has(e) || typeof OffscreenCanvas > "u" || typeof createImageBitmap > "u" || typeof fetch > "u" || !(n > 0) || !(r > 0) || (ea.add(e), Ub(e, t, n, r)), null);
5999
6005
  }
6000
6006
  function Yb(e, t) {
6001
- const n = wt(
6007
+ const n = St(
6002
6008
  (o) => ma(e, o),
6003
6009
  [e]
6004
6010
  ), r = Qe(
@@ -6009,7 +6015,7 @@ function Yb(e, t) {
6009
6015
  return t ? "full" : r;
6010
6016
  }
6011
6017
  function Gb(e) {
6012
- const t = wt(
6018
+ const t = St(
6013
6019
  (n) => ma(e, n),
6014
6020
  [e]
6015
6021
  );
@@ -6078,15 +6084,15 @@ const ex = We(function({
6078
6084
  const { appOrigin: l, previewRevision: c } = Ym(), d = Ie(null), u = Ie(null), p = Ie(null), m = Ie(null), b = Ie(null), x = Ie(!1), w = Ie(qm()), v = Ie(
6079
6085
  () => {
6080
6086
  }
6081
- ), S = Ie(null), $ = Ie(!1), R = Ie(null), H = Ie(0), A = Ie(null), [N, T] = Y(null), [j, k] = Y(!1), z = (N == null ? void 0 : N.width) ?? t.width ?? 390, Z = (N == null ? void 0 : N.height) ?? fn(t), M = (N == null ? void 0 : N.x) ?? t.x ?? 0, W = (N == null ? void 0 : N.y) ?? t.y ?? 0, ee = Lt(
6082
- Xt(),
6083
- gn(t, n)
6084
- ), q = jt(
6087
+ ), S = Ie(null), $ = Ie(!1), R = Ie(null), H = Ie(0), A = Ie(null), [N, T] = Y(null), [j, k] = Y(!1), z = (N == null ? void 0 : N.width) ?? t.width ?? 390, Z = (N == null ? void 0 : N.height) ?? hn(t), M = (N == null ? void 0 : N.x) ?? t.x ?? 0, W = (N == null ? void 0 : N.y) ?? t.y ?? 0, ee = Lt(
6088
+ Gt(),
6089
+ bn(t, n)
6090
+ ), q = Wt(
6085
6091
  t,
6086
6092
  c,
6087
6093
  void 0,
6088
6094
  n
6089
- ), Me = jt(
6095
+ ), Me = Wt(
6090
6096
  t,
6091
6097
  c,
6092
6098
  t.authoredFrameSize ?? {
@@ -6100,13 +6106,13 @@ const ex = We(function({
6100
6106
  route: t.route,
6101
6107
  width: t.width,
6102
6108
  height: t.height,
6103
- environment: gn(t, n),
6109
+ environment: bn(t, n),
6104
6110
  preset: t.preset,
6105
6111
  interactions: t.interactions,
6106
6112
  assertions: t.assertions
6107
6113
  },
6108
6114
  c,
6109
- Xt()
6115
+ Gt()
6110
6116
  ) : null, ne = Gm({
6111
6117
  pageId: t.id,
6112
6118
  routePreviewKey: q,
@@ -6114,7 +6120,7 @@ const ex = We(function({
6114
6120
  canonicalId: t.importPageId ?? t.id,
6115
6121
  fingerprint: fe,
6116
6122
  batchHydrated: i
6117
- }), { previewIntended: ie } = ne, P = a && ne.cacheHydrated, E = a ? Bn(q) : null, I = a ? $a(q) : null, V = t.width ?? 390, ae = (I == null ? void 0 : I.screenshot) ?? null, xe = Jb(
6123
+ }), { previewIntended: ie } = ne, P = a && ne.cacheHydrated, E = a ? jn(q) : null, I = a ? $a(q) : null, V = t.width ?? 390, ae = (I == null ? void 0 : I.screenshot) ?? null, xe = Jb(
6118
6124
  q,
6119
6125
  ae,
6120
6126
  V,
@@ -6124,18 +6130,18 @@ const ex = We(function({
6124
6130
  ae.height * V / Math.max(1, ae.width)
6125
6131
  )
6126
6132
  ) : 1
6127
- ), Re = a ? mn(
6133
+ ), Re = a ? gn(
6128
6134
  t.importPageId ?? t.id,
6129
6135
  fe ?? void 0
6130
- ) : { status: "idle" }, de = Iu({
6136
+ ) : { status: "idle" }, le = Iu({
6131
6137
  stale: (I == null ? void 0 : I.stale) === !0,
6132
6138
  resolution: Re,
6133
6139
  captureStatus: I == null ? void 0 : I.status,
6134
6140
  diagnostic: (mo = I == null ? void 0 : I.diagnostics[0]) == null ? void 0 : mo.message
6135
6141
  }), [Le, De] = Y(
6136
- () => a && !E ? Jt(q) : null
6137
- ), [Ye, ot] = Y(!1), [F, ce] = Y(!1), re = Ie(null), Ee = () => {
6138
- !a || t.route == null || t.layersImported || $e || re.current == null && (re.current = setTimeout(() => {
6142
+ () => a && !E ? Xt(q) : null
6143
+ ), [Ye, ot] = Y(!1), [F, de] = Y(!1), re = Ie(null), Ee = () => {
6144
+ !a || t.route == null || t.layersImported || Pe || re.current == null && (re.current = setTimeout(() => {
6139
6145
  re.current = null, _a(t.id);
6140
6146
  }, 220));
6141
6147
  }, O = () => {
@@ -6146,10 +6152,10 @@ const ex = We(function({
6146
6152
  }, [t.layersImported, t.id]);
6147
6153
  const [ve, we] = Y(!1), Q = n || r || ie || Ye || ve, ge = Yb(t.id, Q), Oe = Gb(t.id);
6148
6154
  Zb(t.id, ge);
6149
- const [B, K] = Y(null), [ke, J] = Y(0), [je, Ne] = Y([]), ze = Le ?? (P && !E ? Jt(q) : null), tt = E != null || ze != null || (I == null ? void 0 : I.screenshot) != null, $e = n, Se = a && Rd({
6150
- detailActive: $e,
6155
+ const [B, K] = Y(null), [ke, J] = Y(0), [je, Ne] = Y([]), ze = Le ?? (P && !E ? Xt(q) : null), tt = E != null || ze != null || (I == null ? void 0 : I.screenshot) != null, Pe = n, Se = a && Rd({
6156
+ detailActive: Pe,
6151
6157
  previewIntended: ie
6152
- }), Pe = Ft(() => !r || t.route == null || !t.layersImported ? null : Me === q && ze != null ? ze : Jt(Me) ?? ze, [
6158
+ }), $e = Ft(() => !r || t.route == null || !t.layersImported ? null : Me === q && ze != null ? ze : Xt(Me) ?? ze, [
6153
6159
  Me,
6154
6160
  P,
6155
6161
  ze,
@@ -6158,7 +6164,7 @@ const ex = We(function({
6158
6164
  q,
6159
6165
  r
6160
6166
  ]), Ce = Km(
6161
- Pe != null,
6167
+ $e != null,
6162
6168
  Um({
6163
6169
  resizeDraftActive: N != null,
6164
6170
  importedAtCommittedWidth: t.layerImportViewportWidth == null || t.layerImportViewportWidth === (t.width ?? 390),
@@ -6167,7 +6173,7 @@ const ex = We(function({
6167
6173
  ) === "responsive-preview", Ke = {
6168
6174
  width: t.width ?? 390,
6169
6175
  height: t.height ?? 600
6170
- }, zt = f.provisionalLayerImportRevision(t.id) != null, xn = bg(
6176
+ }, zt = f.provisionalLayerImportRevision(t.id) != null, on = bg(
6171
6177
  t,
6172
6178
  Ke
6173
6179
  );
@@ -6186,7 +6192,7 @@ const ex = We(function({
6186
6192
  t.height,
6187
6193
  c
6188
6194
  ]);
6189
- const Ut = xg(t);
6195
+ const Qt = xg(t);
6190
6196
  se(() => {
6191
6197
  t.route == null || t.interactiveStateId == null || t.layersImported || fu(t, c);
6192
6198
  }, [
@@ -6212,7 +6218,7 @@ const ex = We(function({
6212
6218
  return pe.observe(U), () => pe.disconnect();
6213
6219
  }, []), se(() => {
6214
6220
  if (!n || !t.importLayers || t.layersImported || t.route != null) return;
6215
- const U = Vn();
6221
+ const U = Kn();
6216
6222
  if (!U) return;
6217
6223
  let pe = !1, be = 0;
6218
6224
  const Te = requestAnimationFrame(() => {
@@ -6234,7 +6240,7 @@ const ex = We(function({
6234
6240
  }, [n, t.id, t.importLayers, t.layersImported, t.route]), se(() => {
6235
6241
  var U, pe;
6236
6242
  (U = m.current) == null || U.resolve(null), m.current = null, (pe = b.current) == null || pe.resolve(), b.current = null, ot(!1), we(!1), K(null), J(0), Ne([]), De(
6237
- Bn(q) ? null : Jt(q)
6243
+ jn(q) ? null : Xt(q)
6238
6244
  ), H.current += 1, $.current = !1, R.current = null, S.current = null, v.current(), v.current = () => {
6239
6245
  }, f.resetPageDocumentHeight(t.id);
6240
6246
  }, [q]), se(
@@ -6251,7 +6257,7 @@ const ex = We(function({
6251
6257
  return;
6252
6258
  }
6253
6259
  De(
6254
- Bn(q) ? null : Jt(q)
6260
+ jn(q) ? null : Xt(q)
6255
6261
  );
6256
6262
  }, [P, a, q]), se(() => {
6257
6263
  var Ae, me;
@@ -6271,7 +6277,7 @@ const ex = We(function({
6271
6277
  pe = setTimeout(() => {
6272
6278
  U && (K(null), J((ft) => ft + 1));
6273
6279
  }, qe);
6274
- }, Te = $e ? -1e4 : (((Ae = t.interactions) == null ? void 0 : Ae.length) ?? 0) + (((me = t.assertions) == null ? void 0 : me.length) ?? 0) + (t.preset ? 1 : 0);
6280
+ }, Te = Pe ? -1e4 : (((Ae = t.interactions) == null ? void 0 : Ae.length) ?? 0) + (((me = t.assertions) == null ? void 0 : me.length) ?? 0) + (t.preset ? 1 : 0);
6275
6281
  return ui(
6276
6282
  q,
6277
6283
  Te,
@@ -6296,7 +6302,7 @@ const ex = We(function({
6296
6302
  if (U) {
6297
6303
  if (ye) {
6298
6304
  De(
6299
- Bn(q) ? null : ye
6305
+ jn(q) ? null : ye
6300
6306
  ), K(null);
6301
6307
  return;
6302
6308
  }
@@ -6310,7 +6316,7 @@ const ex = We(function({
6310
6316
  (ye == null ? void 0 : ye.key) === oe && (m.current = null, ye.resolve(null)), ot(!1);
6311
6317
  };
6312
6318
  }, [
6313
- $e,
6319
+ Pe,
6314
6320
  P,
6315
6321
  t.layersImported,
6316
6322
  t.route,
@@ -6324,7 +6330,7 @@ const ex = We(function({
6324
6330
  const U = ze != null && Ei(q);
6325
6331
  !a || !Td({
6326
6332
  cacheHydrated: P,
6327
- detailActive: $e,
6333
+ detailActive: Pe,
6328
6334
  hasRoute: t.route != null,
6329
6335
  layersImported: !!t.layersImported,
6330
6336
  hasExactArtifact: !!(E && !(I != null && I.stale)),
@@ -6335,7 +6341,7 @@ const ex = We(function({
6335
6341
  fe ?? void 0
6336
6342
  );
6337
6343
  }, [
6338
- $e,
6344
+ Pe,
6339
6345
  P,
6340
6346
  t.route,
6341
6347
  t.layersImported,
@@ -6349,30 +6355,30 @@ const ex = We(function({
6349
6355
  q,
6350
6356
  a
6351
6357
  ]);
6352
- const qt = Ft(
6358
+ const _t = Ft(
6353
6359
  () => (I == null ? void 0 : I.stale) !== !0 && (E != null ? wl({ bodyAttributes: E.bodyAttributes }) : wl({ snapshotHtml: ze })),
6354
6360
  [ze, E, I == null ? void 0 : I.stale]
6355
- ), Et = a && !P, Be = gg(
6361
+ ), xt = a && !P, Be = gg(
6356
6362
  t.importPageId ?? t.id
6357
- ), He = yg(t.id), Mn = f.frozenPromotionRefused(t.id), _t = (qt || Et || Be || Ut) && !Mn && !t.layersImported && t.importLayers === !0 && t.route != null && // A replay that reported issues registers stale and cannot promote —
6363
+ ), He = yg(t.id), En = f.frozenPromotionRefused(t.id), Ot = (_t || xt || Be || Qt) && !En && !t.layersImported && t.importLayers === !0 && t.route != null && // A replay that reported issues registers stale and cannot promote —
6358
6364
  // fall back to the boot path instead of holding the frame on it.
6359
6365
  je.length === 0;
6360
6366
  se(() => {
6361
6367
  if (t.route != null) {
6362
- if (!$e && !j) {
6368
+ if (!Pe && !j) {
6363
6369
  jl(t.id);
6364
6370
  return;
6365
6371
  }
6366
- $e && pg(t.id);
6372
+ Pe && pg(t.id);
6367
6373
  }
6368
- }, [$e, j, t.id, t.route]), se(() => () => jl(t.id), [t.id]), se(() => {
6369
- if (!$e || !P || // The live detail grant obeys the same contract as the render gate:
6374
+ }, [Pe, j, t.id, t.route]), se(() => () => jl(t.id), [t.id]), se(() => {
6375
+ if (!Pe || !P || // The live detail grant obeys the same contract as the render gate:
6370
6376
  // while a promotable capture exists (or may still arrive), activation
6371
6377
  // waits for the bootless promotion instead of booting the app. Granting
6372
6378
  // here regardless was the bypass that let a live boot — against a dead
6373
6379
  // backend, a cold dev server — deliver the import a healthy capture
6374
6380
  // already covered.
6375
- _t || t.route == null || t.layersImported || !tt || B)
6381
+ Ot || t.route == null || t.layersImported || !tt || B)
6376
6382
  return;
6377
6383
  let U = !0;
6378
6384
  const pe = `detail:${oe}`;
@@ -6396,9 +6402,9 @@ const ex = We(function({
6396
6402
  (be == null ? void 0 : be.key) === pe && (b.current = null, be.resolve()), we(!1);
6397
6403
  };
6398
6404
  }, [
6399
- $e,
6405
+ Pe,
6400
6406
  P,
6401
- _t,
6407
+ Ot,
6402
6408
  tt,
6403
6409
  t.importLayers,
6404
6410
  t.layersImported,
@@ -6423,10 +6429,10 @@ const ex = We(function({
6423
6429
  oe,
6424
6430
  tt
6425
6431
  ]);
6426
- const Zn = l.trim().length > 0, Bi = Zn && Wa(t, { detailActive: $e }) ? ja({
6432
+ const Zn = l.trim().length > 0, Bi = Zn && Wa(t, { detailActive: Pe }) ? ja({
6427
6433
  origin: l,
6428
6434
  route: t.route ?? "",
6429
- environment: gn(t, n),
6435
+ environment: bn(t, n),
6430
6436
  width: z,
6431
6437
  height: Z
6432
6438
  }) : null, D = async (U, pe, be) => {
@@ -6455,13 +6461,13 @@ const ex = We(function({
6455
6461
  }, p.current = me.iframe, Pr(), !0) : !1;
6456
6462
  };
6457
6463
  se(() => {
6458
- ce(!1);
6464
+ de(!1);
6459
6465
  }, [oe]);
6460
- const on = async () => {
6466
+ const sn = async () => {
6461
6467
  if (!p.current) return null;
6462
6468
  if ($.current) return R.current;
6463
6469
  if (S.current) return S.current;
6464
- const U = Vn();
6470
+ const U = Kn();
6465
6471
  if (!U) return null;
6466
6472
  const pe = p.current, be = H.current, Te = (async () => {
6467
6473
  const Ae = await U.prepareScreenCapture(pe, {
@@ -6490,12 +6496,12 @@ const ex = We(function({
6490
6496
  }), be;
6491
6497
  }, lt = () => t.layersImported && f.provisionalLayerImportRevision(t.id) == null, te = async () => {
6492
6498
  if (!t.importLayers || lt() || !p.current || x.current) return t.layersImported;
6493
- const U = Vn();
6499
+ const U = Kn();
6494
6500
  if (!U) return !1;
6495
6501
  const pe = p.current;
6496
6502
  x.current = !0;
6497
6503
  try {
6498
- const be = await on();
6504
+ const be = await sn();
6499
6505
  if (lt()) return !0;
6500
6506
  if (be && !be.complete)
6501
6507
  return f.setPageLayerImportError(
@@ -6532,21 +6538,21 @@ const ex = We(function({
6532
6538
  const pe = U.clientX, be = U.clientY, Te = t.x ?? 0, Ae = t.y ?? 0;
6533
6539
  let me = !1;
6534
6540
  const ye = (ft) => {
6535
- const St = (ft.clientX - pe) / f.zoom, kt = (ft.clientY - be) / f.zoom;
6536
- if (!(!me && Math.hypot(St, kt) < 3)) {
6541
+ const Nt = (ft.clientX - pe) / f.zoom, kt = (ft.clientY - be) / f.zoom;
6542
+ if (!(!me && Math.hypot(Nt, kt) < 3)) {
6537
6543
  if (!me) {
6538
6544
  if (!f.beginFrameTransform(t.id, "move")) return;
6539
6545
  me = !0;
6540
6546
  }
6541
- f.moveFrame(t.id, Te + St, Ae + kt, !1);
6547
+ f.moveFrame(t.id, Te + Nt, Ae + kt, !1);
6542
6548
  }
6543
6549
  }, qe = () => {
6544
6550
  if (window.removeEventListener("mousemove", ye), window.removeEventListener("mouseup", qe), !me) return;
6545
- const ft = t.x ?? 0, St = t.y ?? 0, kt = ft + (t.width ?? 390), En = St + Z;
6546
- for (const [kn, nt] of _u()) {
6547
- const wn = nt.explicit ? 0 : zu, go = nt.x0 - wn, bo = nt.y0 - wn, sn = nt.x1 + wn, Gt = nt.y1 + wn;
6548
- if (kn !== t.section && ft < sn && kt > go && St < Gt && En > bo) {
6549
- f.setPageSection(t.id, kn);
6551
+ const ft = t.x ?? 0, Nt = t.y ?? 0, kt = ft + (t.width ?? 390), kn = Nt + Z;
6552
+ for (const [An, nt] of _u()) {
6553
+ const wn = nt.explicit ? 0 : zu, go = nt.x0 - wn, bo = nt.y0 - wn, an = nt.x1 + wn, Yt = nt.y1 + wn;
6554
+ if (An !== t.section && ft < an && kt > go && Nt < Yt && kn > bo) {
6555
+ f.setPageSection(t.id, An);
6550
6556
  break;
6551
6557
  }
6552
6558
  }
@@ -6558,7 +6564,7 @@ const ex = We(function({
6558
6564
  const be = pe.clientX, Te = pe.clientY, Ae = { x: t.x ?? 0, y: t.y ?? 0, width: z, height: Z }, me = U.includes("e") || U.includes("w"), ye = U.includes("n") || U.includes("s");
6559
6565
  let qe = !1;
6560
6566
  const ft = (kt) => {
6561
- const En = (kt.clientX - be) / f.zoom, kn = (kt.clientY - Te) / f.zoom, nt = Lu(Ae, U, En, kn, 1, 1);
6567
+ const kn = (kt.clientX - be) / f.zoom, An = (kt.clientY - Te) / f.zoom, nt = Lu(Ae, U, kn, An, 1, 1);
6562
6568
  if (!(Math.round(nt.x) === Math.round(Ae.x) && Math.round(nt.y) === Math.round(Ae.y) && Math.round(nt.width) === Math.round(Ae.width) && Math.round(nt.height) === Math.round(Ae.height))) {
6563
6569
  if (!qe) {
6564
6570
  if (!f.beginFrameTransform(t.id, "resize")) return;
@@ -6566,8 +6572,8 @@ const ex = We(function({
6566
6572
  }
6567
6573
  A.current = nt, T(nt);
6568
6574
  }
6569
- }, St = () => {
6570
- window.removeEventListener("mousemove", ft), window.removeEventListener("mouseup", St);
6575
+ }, Nt = () => {
6576
+ window.removeEventListener("mousemove", ft), window.removeEventListener("mouseup", Nt);
6571
6577
  const kt = A.current;
6572
6578
  A.current = null, qe && kt && f.resizeFrame(t.id, kt, {
6573
6579
  recordHistory: !1,
@@ -6575,8 +6581,8 @@ const ex = We(function({
6575
6581
  resizeHeight: ye
6576
6582
  }), T(null);
6577
6583
  };
6578
- window.addEventListener("mousemove", ft), window.addEventListener("mouseup", St);
6579
- }, yn = t.frameSizeMode === "content" || $e || j && ge !== "detached", st = xd({
6584
+ window.addEventListener("mousemove", ft), window.addEventListener("mouseup", Nt);
6585
+ }, yn = t.frameSizeMode === "content" || Pe || j && ge !== "detached", st = xd({
6580
6586
  hasRoute: t.route != null,
6581
6587
  layersImported: !!t.layersImported,
6582
6588
  cacheHydrated: P,
@@ -6589,21 +6595,21 @@ const ex = We(function({
6589
6595
  t.id
6590
6596
  ), $r = !t.layersImported || Ve != null, ut = (
6591
6597
  // No live origin means no prepared checkout — see liveOriginReady.
6592
- Zn && a && (He || st === "live" || ve || ($e && !_t || // Hover intent while the artifact cache is still hydrating — or a
6598
+ Zn && a && (He || st === "live" || ve || (Pe && !Ot || // Hover intent while the artifact cache is still hydrating — or a
6593
6599
  // flow session owes this screen — must not warm-boot the app: the
6594
6600
  // capture that makes the boot unnecessary may simply not have
6595
6601
  // arrived yet. Intent prepares the frozen mount.
6596
- ie && !qt && !Et && !Be && !Ut) && t.route != null && $r && // A viewport-variant session owes the resized screen its exact-width
6602
+ ie && !_t && !xt && !Be && !Qt) && t.route != null && $r && // A viewport-variant session owes the resized screen its exact-width
6597
6603
  // replay; the live re-measure stays parked unless the session fails.
6598
- !xn)
6604
+ !on)
6599
6605
  ), at = ub({
6600
6606
  // Keep a frame being prepared at its canvas position. Preparing it elsewhere
6601
6607
  // would move the iframe to another parent on open, reload it, and waste the
6602
6608
  // work. A provisionally imported page shows its tree in the frame instead,
6603
6609
  // so its live producer boots offscreen.
6604
- active: ($e || ie) && Ve == null,
6610
+ active: (Pe || ie) && Ve == null,
6605
6611
  live: ut
6606
- }), Yt = !o && tt && // A live slot only outranks the capture while live can actually run. The
6612
+ }), qt = !o && tt && // A live slot only outranks the capture while live can actually run. The
6607
6613
  // frame the designer works in claims a slot as soon as it is active, so
6608
6614
  // before a checkout exists that claim suppressed the static surface and the
6609
6615
  // live route could not render either — the frame sat empty in front of the
@@ -6615,7 +6621,7 @@ const ex = We(function({
6615
6621
  // Hover intent mounts the frozen DOM so the activation click promotes
6616
6622
  // through D2 (~50ms) instead of waiting on a live boot; an activation
6617
6623
  // that arrived without the hover mounts it here and promotes on mount.
6618
- preparedForPromotion: ie || _t,
6624
+ preparedForPromotion: ie || Ot,
6619
6625
  preferDom: vh() === "dom"
6620
6626
  }), ji = t.layersImported && f.pageRequiresLiveSharedPreview(t), ho = tt && f.frozenPreviewMutations().some((U) => !!U.staleReason);
6621
6627
  se(() => {
@@ -6645,11 +6651,11 @@ const ex = We(function({
6645
6651
  ee
6646
6652
  ), Pr = () => {
6647
6653
  const U = H.current + 1;
6648
- H.current = U, ce(!1), $.current = !1, R.current = null, S.current = null, (async () => {
6654
+ H.current = U, de(!1), $.current = !1, R.current = null, S.current = null, (async () => {
6649
6655
  var pe;
6650
6656
  try {
6651
- const be = await on();
6652
- Yc(be), ce(!0);
6657
+ const be = await sn();
6658
+ Yc(be), de(!0);
6653
6659
  const Te = p.current;
6654
6660
  if ((Te ? he(Te) : !1) && await new Promise((ye) => {
6655
6661
  requestAnimationFrame(
@@ -6672,7 +6678,7 @@ const ex = We(function({
6672
6678
  ) : null;
6673
6679
  if (me) {
6674
6680
  Ti(q, me), De(
6675
- Bn(q) ? null : me
6681
+ jn(q) ? null : me
6676
6682
  );
6677
6683
  const ye = m.current;
6678
6684
  (ye == null ? void 0 : ye.key) === oe && (m.current = null, ye.resolve(me));
@@ -6688,7 +6694,7 @@ const ex = We(function({
6688
6694
  }
6689
6695
  f.activePageId === t.id && await te();
6690
6696
  } catch (be) {
6691
- ce(!0);
6697
+ de(!0);
6692
6698
  const Te = be instanceof Error ? be.message : "Failed to reproduce the live screen preview.", Ae = m.current;
6693
6699
  (Ae == null ? void 0 : Ae.key) === oe ? (m.current = null, Ae.reject(be)) : K(Te);
6694
6700
  } finally {
@@ -6722,10 +6728,10 @@ const ex = We(function({
6722
6728
  "data-frame-id": t.id,
6723
6729
  "data-canonical-frame-id": t.importPageId ?? t.id,
6724
6730
  "data-frame-active": n || void 0,
6725
- "data-frame-detail-active": $e || void 0,
6731
+ "data-frame-detail-active": Pe || void 0,
6726
6732
  "data-preview-state": st,
6727
6733
  "data-pyg-static-surface": Zt,
6728
- "data-pyg-static-route": String(Yt),
6734
+ "data-pyg-static-route": String(qt),
6729
6735
  "data-pyg-has-snapshot": String(tt),
6730
6736
  "data-pyg-artifact": String(E != null),
6731
6737
  "data-pyg-live-slot": String(!!He),
@@ -6821,12 +6827,12 @@ const ex = We(function({
6821
6827
  position: "absolute",
6822
6828
  inset: 0,
6823
6829
  // display:none prevents layout and makes reproduction inaccurate.
6824
- visibility: F && $e ? "visible" : "hidden"
6830
+ visibility: F && Pe ? "visible" : "hidden"
6825
6831
  },
6826
6832
  children: vn
6827
6833
  }
6828
6834
  ),
6829
- F && $e ? null : /* @__PURE__ */ s(
6835
+ F && Pe ? null : /* @__PURE__ */ s(
6830
6836
  "div",
6831
6837
  {
6832
6838
  "data-preview-arriving": !0,
@@ -6885,11 +6891,11 @@ const ex = We(function({
6885
6891
  // page imported, and the frame then shows the authored placeholder —
6886
6892
  // one empty div — while a 453KB snapshot of the real screen sits
6887
6893
  // unused beside it. Measured: layerImportCount 1, snapshot present.
6888
- (t.layerImportCount == null || t.layerImportCount > 1) && yn && ($e || t.route == null || ji) ? $e ? Ce && Pe != null ? /* @__PURE__ */ s(
6894
+ (t.layerImportCount == null || t.layerImportCount > 1) && yn && (Pe || t.route == null || ji) ? Pe ? Ce && $e != null ? /* @__PURE__ */ s(
6889
6895
  yh,
6890
6896
  {
6891
6897
  page: t,
6892
- snapshot: Pe,
6898
+ snapshot: $e,
6893
6899
  height: Z,
6894
6900
  onDocumentHeightChange: (U) => {
6895
6901
  f.setPageDocumentHeight(t.id, U);
@@ -6901,7 +6907,7 @@ const ex = We(function({
6901
6907
  }
6902
6908
  },
6903
6909
  `responsive:${t.id}:${c}`
6904
- ) : /* @__PURE__ */ s(Yl, { node: t.root }) : /* @__PURE__ */ s(Gl, { root: t.root }) : t.route != null && Yt ? (
6910
+ ) : /* @__PURE__ */ s(Yl, { node: t.root }) : /* @__PURE__ */ s(Gl, { root: t.root }) : t.route != null && qt ? (
6905
6911
  // A detached frame renders at most a screenshot: the frozen DOM
6906
6912
  // preview stays unmounted until the tier reattaches.
6907
6913
  (Zt === "screenshot" || ge === "detached") && xe ? /* @__PURE__ */ s(
@@ -6969,7 +6975,7 @@ const ex = We(function({
6969
6975
  },
6970
6976
  `snapshot:${q}`
6971
6977
  ) : null
6972
- ) : yn ? t.route == null || t.layersImported ? $e ? /* @__PURE__ */ s(Yl, { node: t.root }) : /* @__PURE__ */ s(Gl, { root: t.root }) : /* @__PURE__ */ g(
6978
+ ) : yn ? t.route == null || t.layersImported ? Pe ? /* @__PURE__ */ s(Yl, { node: t.root }) : /* @__PURE__ */ s(Gl, { root: t.root }) : /* @__PURE__ */ g(
6973
6979
  "div",
6974
6980
  {
6975
6981
  role: "status",
@@ -7016,14 +7022,14 @@ const ex = We(function({
7016
7022
  )
7017
7023
  }
7018
7024
  ),
7019
- de && /* @__PURE__ */ g(
7025
+ le && /* @__PURE__ */ g(
7020
7026
  "div",
7021
7027
  {
7022
7028
  "data-pygmalion-artifact-diagnostic": "",
7023
7029
  "data-artifact-resolution": Re.status,
7024
- "data-artifact-tone": de.tone,
7025
- role: de.role,
7026
- title: de.detail,
7030
+ "data-artifact-tone": le.tone,
7031
+ role: le.role,
7032
+ title: le.detail,
7027
7033
  style: {
7028
7034
  position: "absolute",
7029
7035
  top: 8,
@@ -7033,18 +7039,18 @@ const ex = We(function({
7033
7039
  maxWidth: "min(320px, calc(100% - 16px))",
7034
7040
  alignItems: "center",
7035
7041
  gap: 6,
7036
- border: de.tone === "info" ? "1px solid #b6d4fe" : de.tone === "error" ? "1px solid #f1aeb5" : "1px solid #ffe69c",
7042
+ border: le.tone === "info" ? "1px solid #b6d4fe" : le.tone === "error" ? "1px solid #f1aeb5" : "1px solid #ffe69c",
7037
7043
  borderRadius: 6,
7038
7044
  padding: "5px 8px",
7039
- color: de.tone === "info" ? "#084298" : de.tone === "error" ? "#842029" : "#664d03",
7040
- background: de.tone === "info" ? "rgba(207, 226, 255, 0.96)" : de.tone === "error" ? "rgba(248, 215, 218, 0.96)" : "rgba(255, 243, 205, 0.96)",
7045
+ color: le.tone === "info" ? "#084298" : le.tone === "error" ? "#842029" : "#664d03",
7046
+ background: le.tone === "info" ? "rgba(207, 226, 255, 0.96)" : le.tone === "error" ? "rgba(248, 215, 218, 0.96)" : "rgba(255, 243, 205, 0.96)",
7041
7047
  boxShadow: "0 1px 4px rgba(0,0,0,.12)",
7042
7048
  fontSize: 11,
7043
7049
  lineHeight: 1.3,
7044
- pointerEvents: de.retryable ? "auto" : "none"
7050
+ pointerEvents: le.retryable ? "auto" : "none"
7045
7051
  },
7046
7052
  children: [
7047
- /* @__PURE__ */ s("strong", { style: { whiteSpace: "nowrap" }, children: de.title }),
7053
+ /* @__PURE__ */ s("strong", { style: { whiteSpace: "nowrap" }, children: le.title }),
7048
7054
  /* @__PURE__ */ s(
7049
7055
  "span",
7050
7056
  {
@@ -7053,10 +7059,10 @@ const ex = We(function({
7053
7059
  textOverflow: "ellipsis",
7054
7060
  whiteSpace: "nowrap"
7055
7061
  },
7056
- children: de.detail
7062
+ children: le.detail
7057
7063
  }
7058
7064
  ),
7059
- de.retryable && fe && /* @__PURE__ */ s(
7065
+ le.retryable && fe && /* @__PURE__ */ s(
7060
7066
  "button",
7061
7067
  {
7062
7068
  type: "button",
@@ -7427,9 +7433,9 @@ ${l}` : l;
7427
7433
  }
7428
7434
  class fx {
7429
7435
  constructor() {
7430
- cn(this, "status", "idle");
7431
- cn(this, "pending", 0);
7432
- cn(this, "message", "");
7436
+ dn(this, "status", "idle");
7437
+ dn(this, "pending", 0);
7438
+ dn(this, "message", "");
7433
7439
  Ch(this);
7434
7440
  }
7435
7441
  setPending(t) {
@@ -7484,14 +7490,14 @@ function yi(e) {
7484
7490
  function lc(e) {
7485
7491
  return JSON.stringify(e);
7486
7492
  }
7487
- let In = null, Do = /* @__PURE__ */ new Map(), cs = /* @__PURE__ */ new Map(), qn = /* @__PURE__ */ new Map(), Hn = null, Br = null, mx = 0;
7493
+ let In = null, Do = /* @__PURE__ */ new Map(), cs = /* @__PURE__ */ new Map(), Yn = /* @__PURE__ */ new Map(), Vn = null, Br = null, mx = 0;
7488
7494
  function tl() {
7489
- Rt.setPending(qn.size);
7495
+ Rt.setPending(Yn.size);
7490
7496
  }
7491
7497
  function Ku(e) {
7492
- for (const t of e) qn.set(yi(t.element), t);
7493
- tl(), Hn && clearTimeout(Hn), Hn = setTimeout(() => {
7494
- Hn = null, Uu().catch(() => {
7498
+ for (const t of e) Yn.set(yi(t.element), t);
7499
+ tl(), Vn && clearTimeout(Vn), Vn = setTimeout(() => {
7500
+ Vn = null, Uu().catch(() => {
7495
7501
  });
7496
7502
  }, 240);
7497
7503
  }
@@ -7499,14 +7505,14 @@ function cc(e) {
7499
7505
  const t = new Map(
7500
7506
  e.map((n) => [yi(n.element), n])
7501
7507
  );
7502
- for (const [n, r] of qn) t.set(n, r);
7503
- qn = t, tl();
7508
+ for (const [n, r] of Yn) t.set(n, r);
7509
+ Yn = t, tl();
7504
7510
  }
7505
7511
  async function Uu() {
7506
7512
  return Br || (Br = (async () => {
7507
- for (; qn.size > 0; ) {
7508
- const e = [...qn.values()];
7509
- qn = /* @__PURE__ */ new Map(), tl();
7513
+ for (; Yn.size > 0; ) {
7514
+ const e = [...Yn.values()];
7515
+ Yn = /* @__PURE__ */ new Map(), tl();
7510
7516
  const t = Ph();
7511
7517
  if (!t) {
7512
7518
  cc(e), Rt.setStatus("idle", "");
@@ -7564,9 +7570,9 @@ function qu(e) {
7564
7570
  cs = t, n.length && Ku(n);
7565
7571
  }
7566
7572
  async function bx() {
7567
- Hn && (clearTimeout(Hn), Hn = null), await Uu();
7573
+ Vn && (clearTimeout(Vn), Vn = null), await Uu();
7568
7574
  }
7569
- let nl = [], Yn = null;
7575
+ let nl = [], Gn = null;
7570
7576
  const ao = /* @__PURE__ */ new Map();
7571
7577
  function xx(e) {
7572
7578
  nl = e;
@@ -7575,7 +7581,7 @@ function vi() {
7575
7581
  return nl;
7576
7582
  }
7577
7583
  function yx(e) {
7578
- Yn = e;
7584
+ Gn = e;
7579
7585
  }
7580
7586
  function vx(e) {
7581
7587
  var t;
@@ -7587,11 +7593,11 @@ function Yu() {
7587
7593
  function wx(e, t) {
7588
7594
  ao.set(e, t), document.documentElement.style.setProperty(e, t);
7589
7595
  const n = Yu();
7590
- Yn == null || Yn(n), qu(n);
7596
+ Gn == null || Gn(n), qu(n);
7591
7597
  }
7592
7598
  function Xw() {
7593
7599
  for (const e of ao.keys()) document.documentElement.style.removeProperty(e);
7594
- ao.clear(), Yn == null || Yn([]), qu([]);
7600
+ ao.clear(), Gn == null || Gn([]), qu([]);
7595
7601
  }
7596
7602
  const Sx = [
7597
7603
  { label: "W", prop: "width" },
@@ -7924,7 +7930,7 @@ function zo(e, t) {
7924
7930
  function pc(e) {
7925
7931
  return e.includes("center") ? "center" : e.includes("end") ? "end" : "start";
7926
7932
  }
7927
- function Fn(e) {
7933
+ function Ln(e) {
7928
7934
  return e ? e.minWidth != null && e.maxWidth != null ? `${e.minWidth}–${e.maxWidth}px` : e.minWidth != null ? `${e.minWidth}px or more` : `${e.maxWidth}px or less` : "entire";
7929
7935
  }
7930
7936
  function jx(e, t) {
@@ -7961,7 +7967,7 @@ function fs({
7961
7967
  }
7962
7968
  );
7963
7969
  }
7964
- function Ct({
7970
+ function $t({
7965
7971
  label: e,
7966
7972
  value: t,
7967
7973
  min: n = 0,
@@ -8052,23 +8058,23 @@ function mc({
8052
8058
  affectedFrames: n = []
8053
8059
  }) {
8054
8060
  var gl, bl, xl, yl, vl;
8055
- const r = Ie(null), [o, i] = Y(null), [a, l] = Y(null), [c, d] = Y(null), [u, p] = Y("cases"), [m, b] = Y(!1), [x, w] = Y(Rx), [v, S] = Y(null), [$, R] = Y("original"), [H, A] = Y("default"), [N, T] = Y("item"), [j, k] = Y("base"), [z, Z] = Y({ minWidth: 768 }), [M, W] = Y(null), [ee, q] = Y(!0), [Me, oe] = Y(!1), [fe, ne] = Y(!1), [ie, P] = Y(null), [E, I] = Y(""), [V, ae] = Y(!1), [xe, Re] = Y(""), [de, Le] = Y(!1), [De, Ye] = Y(""), [ot, F] = Y(null), [ce, re] = Y(""), [Ee, O] = Y(""), [ve, we] = Y(0), [Q, ge] = ed((h) => h + 1, 0), Oe = Ie(""), B = Ie(null), K = Ie(null);
8061
+ const r = Ie(null), [o, i] = Y(null), [a, l] = Y(null), [c, d] = Y(null), [u, p] = Y("cases"), [m, b] = Y(!1), [x, w] = Y(Rx), [v, S] = Y(null), [$, R] = Y("original"), [H, A] = Y("default"), [N, T] = Y("item"), [j, k] = Y("base"), [z, Z] = Y({ minWidth: 768 }), [M, W] = Y(null), [ee, q] = Y(!0), [Me, oe] = Y(!1), [fe, ne] = Y(!1), [ie, P] = Y(null), [E, I] = Y(""), [V, ae] = Y(!1), [xe, Re] = Y(""), [le, Le] = Y(!1), [De, Ye] = Y(""), [ot, F] = Y(null), [de, re] = Y(""), [Ee, O] = Y(""), [ve, we] = Y(0), [Q, ge] = ed((h) => h + 1, 0), Oe = Ie(""), B = Ie(null), K = Ie(null);
8056
8062
  K.current = a;
8057
8063
  const ke = Ie(null);
8058
8064
  ke.current = c;
8059
8065
  const J = Ie(n);
8060
8066
  J.current = n;
8061
8067
  const je = X.buildApplyPayload(), Ne = JSON.stringify(je), ze = Ex(je), tt = JSON.stringify(ze);
8062
- function $e() {
8068
+ function Pe() {
8063
8069
  var h;
8064
8070
  (h = B.current) == null || h.cleanup(), B.current = null;
8065
8071
  }
8066
- const Se = !!e, Pe = Se ? ((gl = e.current) == null ? void 0 : gl.contentDocument) ?? null : ((bl = t == null ? void 0 : t.current) == null ? void 0 : bl.ownerDocument) ?? null, Ce = (Pe == null ? void 0 : Pe.defaultView) ?? null, Ke = Ft(() => fa(Ze()), []), zt = Ft(
8072
+ const Se = !!e, $e = Se ? ((gl = e.current) == null ? void 0 : gl.contentDocument) ?? null : ((bl = t == null ? void 0 : t.current) == null ? void 0 : bl.ownerDocument) ?? null, Ce = ($e == null ? void 0 : $e.defaultView) ?? null, Ke = Ft(() => fa(Ze()), []), zt = Ft(
8067
8073
  () => Object.entries(Ze()).filter(
8068
8074
  ([h, y]) => /^[A-Z][A-Za-z0-9_$]*$/.test(h) && !!y.importPath && Sl(h) != null
8069
8075
  ).sort(([h], [y]) => h.localeCompare(y)),
8070
8076
  []
8071
- ), xn = Ft(() => {
8077
+ ), on = Ft(() => {
8072
8078
  const h = vi(), y = {};
8073
8079
  for (const [C, _] of Object.entries(Ix))
8074
8080
  y[C] = h.filter((L) => _.test(L.name));
@@ -8103,13 +8109,13 @@ function mc({
8103
8109
  (ue) => (ue.sourcePaths ?? []).some(
8104
8110
  (_e) => _.some((ht) => kx(_e, ht))
8105
8111
  )
8106
- ).map((ue) => ({ id: ws(ue), name: ue.name })), le = [
8112
+ ).map((ue) => ({ id: ws(ue), name: ue.name })), ce = [
8107
8113
  ...J.current,
8108
8114
  ...L.filter(
8109
8115
  (ue) => !J.current.some((_e) => _e.id === ue.id)
8110
8116
  )
8111
8117
  ];
8112
- X.updateAffectedFrames(le);
8118
+ X.updateAffectedFrames(ce);
8113
8119
  }).catch((C) => {
8114
8120
  y || Ye(String(C));
8115
8121
  }).finally(() => {
@@ -8118,18 +8124,18 @@ function mc({
8118
8124
  y = !0;
8119
8125
  };
8120
8126
  }, [tt]), se(() => ge(), [a]), se(() => {
8121
- $e(), S(null), R("original"), A("default"), T("item"), W(null), re(""), O(""), we(a ? Nl(a) ?? 0 : 0);
8127
+ Pe(), S(null), R("original"), A("default"), T("item"), W(null), re(""), O(""), we(a ? Nl(a) ?? 0 : 0);
8122
8128
  }, [a]), se(() => {
8123
- $e();
8129
+ Pe();
8124
8130
  const h = a != null && a.isConnected ? a : null;
8125
8131
  if (h) {
8126
8132
  if (v == null && $ === "original" && H === "default") {
8127
8133
  window.requestAnimationFrame(() => ge());
8128
8134
  return;
8129
8135
  }
8130
- return B.current = zx(h, { repeat: v, text: $, state: H }), ge(), () => $e();
8136
+ return B.current = zx(h, { repeat: v, text: $, state: H }), ge(), () => Pe();
8131
8137
  }
8132
- }, [a, v, $, H]), se(() => () => $e(), []), se(() => {
8138
+ }, [a, v, $, H]), se(() => () => Pe(), []), se(() => {
8133
8139
  const h = [window];
8134
8140
  Se && Ce && Ce !== window && h.push(Ce), !Se && (t != null && t.current) && h.push(t.current);
8135
8141
  const y = () => ge();
@@ -8158,13 +8164,13 @@ function mc({
8158
8164
  const h = c;
8159
8165
  if (!h) return;
8160
8166
  let y = !1;
8161
- const C = (le) => {
8167
+ const C = (ce) => {
8162
8168
  if (y) return;
8163
8169
  y = !0, h.removeAttribute("contenteditable");
8164
8170
  const ue = h.textContent ?? "";
8165
- h.textContent = Oe.current, le && ue !== Oe.current && (X.recordText(h, ue, Be(h), J.current), X.toast("change text")), d(null);
8166
- }, _ = (le) => {
8167
- le.stopPropagation(), le.key === "Enter" ? (le.preventDefault(), C(!0)) : le.key === "Escape" && C(!1);
8171
+ h.textContent = Oe.current, ce && ue !== Oe.current && (X.recordText(h, ue, Be(h), J.current), X.toast("change text")), d(null);
8172
+ }, _ = (ce) => {
8173
+ ce.stopPropagation(), ce.key === "Enter" ? (ce.preventDefault(), C(!0)) : ce.key === "Escape" && C(!1);
8168
8174
  }, L = () => C(!0);
8169
8175
  return h.addEventListener("keydown", _), h.addEventListener("blur", L), () => {
8170
8176
  h.removeEventListener("keydown", _), h.removeEventListener("blur", L);
@@ -8174,23 +8180,23 @@ function mc({
8174
8180
  ne(!0);
8175
8181
  const h = window.setTimeout(() => ne(!1), 1800);
8176
8182
  return () => window.clearTimeout(h);
8177
- }, [X.toastSeq]), !Pe || !Ce)
8183
+ }, [X.toastSeq]), !$e || !Ce)
8178
8184
  return /* @__PURE__ */ s("div", { ref: r, className: "absolute inset-0 flex items-start justify-center pt-10", children: Se && /* @__PURE__ */ s("span", { className: "rounded bg-black/70 px-3 py-1.5 text-[12px] text-white", children: "Cross-origin applications cannot be inspected." }) });
8179
- const Ut = Se ? Pe.body : (t == null ? void 0 : t.current) ?? null, qt = (h) => {
8185
+ const Qt = Se ? $e.body : (t == null ? void 0 : t.current) ?? null, _t = (h) => {
8180
8186
  if (Se) {
8181
8187
  const C = e.current;
8182
8188
  if (!C) return null;
8183
8189
  const _ = C.contentDocument;
8184
8190
  if (!_) return null;
8185
- const L = C.getBoundingClientRect(), le = _.elementFromPoint(h.clientX - L.left, h.clientY - L.top);
8186
- return !le || le.nodeType !== 1 || le === _.body || le === _.documentElement ? null : le;
8191
+ const L = C.getBoundingClientRect(), ce = _.elementFromPoint(h.clientX - L.left, h.clientY - L.top);
8192
+ return !ce || ce.nodeType !== 1 || ce === _.body || ce === _.documentElement ? null : ce;
8187
8193
  }
8188
8194
  const y = t == null ? void 0 : t.current;
8189
8195
  if (!y) return null;
8190
- for (const C of Pe.elementsFromPoint(h.clientX, h.clientY))
8196
+ for (const C of $e.elementsFromPoint(h.clientX, h.clientY))
8191
8197
  if (C.nodeType === 1 && y.contains(C) && C !== y) return C;
8192
8198
  return null;
8193
- }, Et = (h) => {
8199
+ }, xt = (h) => {
8194
8200
  var C;
8195
8201
  if (Se) return { left: h.left, top: h.top, width: h.width, height: h.height };
8196
8202
  const y = (C = r.current) == null ? void 0 : C.getBoundingClientRect();
@@ -8202,20 +8208,20 @@ function mc({
8202
8208
  return C ? `${_}.${C}` : _;
8203
8209
  }, He = (h) => {
8204
8210
  const y = [];
8205
- for (let C = h; C && C !== Ut && y.length < 8; C = C.parentElement)
8211
+ for (let C = h; C && C !== Qt && y.length < 8; C = C.parentElement)
8206
8212
  y.unshift(C);
8207
8213
  return y;
8208
- }, Mn = (h) => {
8214
+ }, En = (h) => {
8209
8215
  if (X.hasPendingStructuralEdit(h)) {
8210
8216
  X.toast("Please undo the structural changes and then edit the text.");
8211
8217
  return;
8212
8218
  }
8213
8219
  l(h), Oe.current = h.textContent ?? "", h.setAttribute("contenteditable", "plaintext-only"), h.isContentEditable || h.setAttribute("contenteditable", "true"), d(h), h.focus();
8214
- const y = Pe.createRange();
8220
+ const y = $e.createRange();
8215
8221
  y.selectNodeContents(h);
8216
8222
  const C = Ce.getSelection();
8217
8223
  C == null || C.removeAllRanges(), C == null || C.addRange(y);
8218
- }, _t = (h, y) => {
8224
+ }, Ot = (h, y) => {
8219
8225
  var C;
8220
8226
  lt && (X.recordStyle(
8221
8227
  lt,
@@ -8231,7 +8237,7 @@ function mc({
8231
8237
  X.toast("Works with existing application method without code diff connection");
8232
8238
  return;
8233
8239
  }
8234
- if (de) {
8240
+ if (le) {
8235
8241
  X.toast("Please check the diff after the impact screen calculation is complete.");
8236
8242
  return;
8237
8243
  }
@@ -8261,22 +8267,22 @@ function mc({
8261
8267
  try {
8262
8268
  const L = await h(C);
8263
8269
  X.clearApplied(), F((L == null ? void 0 : L.qa) ?? null), P(null), I(""), Re("");
8264
- const le = L != null && L.qa ? L.qa.complete ? ` · ${L.qa.frames.length} affected frames checked` : ` · ${L.qa.failures.length} QA failures` : "";
8265
- X.toast(`${(L == null ? void 0 : L.message) ?? `Applied ${(L == null ? void 0 : L.applied) ?? _} changes`}${le}`);
8270
+ const ce = L != null && L.qa ? L.qa.complete ? ` · ${L.qa.frames.length} affected frames checked` : ` · ${L.qa.failures.length} QA failures` : "";
8271
+ X.toast(`${(L == null ? void 0 : L.message) ?? `Applied ${(L == null ? void 0 : L.applied) ?? _} changes`}${ce}`);
8266
8272
  } catch (L) {
8267
8273
  X.toast(`Apply failed:${String(L).slice(0, 80)}`);
8268
8274
  }
8269
- }, D = a != null && a.isConnected ? a : null, on = o != null && o.isConnected ? o : null, he = D != null && D.parentElement && D.parentElement !== Ut ? D.parentElement : null, lt = N === "container" && he ? he : D, te = D ? Et(D.getBoundingClientRect()) : null, G = he ? Et(he.getBoundingClientRect()) : null, er = N === "container" && lt && lt !== D ? Et(lt.getBoundingClientRect()) : null, yn = on && on !== D ? Et(on.getBoundingClientRect()) : null, st = D ? Ce.getComputedStyle(D) : null, Ve = he ? Ce.getComputedStyle(he) : null, $r = lt ? Ce.getComputedStyle(lt) : null, ut = D ? Be(D) : "", at = D ? Ke(D) : null, Yt = D ? Mh(D) : null, Zt = D ? X.structuralEditKind(D) : null, ji = D ? X.hasPendingValueEdit(D) : !1, ho = D ? X.structuralBlockReason(D, "insert") : "No elements are selected.", po = D ? X.structuralBlockReason(D, "remove") : "No elements are selected.", Pr = D ? X.structuralBlockReason(D, "move") : "No elements are selected.", vn = D && D.parentElement ? Array.from(D.parentElement.children).indexOf(D) : -1, mo = ((xl = D == null ? void 0 : D.parentElement) == null ? void 0 : xl.children.length) ?? 0, U = at ? Ze()[at.name] ?? null : null, pe = Yt && /^[A-Z]/.test(Yt.elementName) ? (at == null ? void 0 : at.name) ?? null : null, be = D ? X.componentInsertBlockReason(D, pe) : "No elements are selected.", Te = ce.trim().toLocaleLowerCase(), Ae = zt.filter(
8275
+ }, D = a != null && a.isConnected ? a : null, sn = o != null && o.isConnected ? o : null, he = D != null && D.parentElement && D.parentElement !== Qt ? D.parentElement : null, lt = N === "container" && he ? he : D, te = D ? xt(D.getBoundingClientRect()) : null, G = he ? xt(he.getBoundingClientRect()) : null, er = N === "container" && lt && lt !== D ? xt(lt.getBoundingClientRect()) : null, yn = sn && sn !== D ? xt(sn.getBoundingClientRect()) : null, st = D ? Ce.getComputedStyle(D) : null, Ve = he ? Ce.getComputedStyle(he) : null, $r = lt ? Ce.getComputedStyle(lt) : null, ut = D ? Be(D) : "", at = D ? Ke(D) : null, qt = D ? Mh(D) : null, Zt = D ? X.structuralEditKind(D) : null, ji = D ? X.hasPendingValueEdit(D) : !1, ho = D ? X.structuralBlockReason(D, "insert") : "No elements are selected.", po = D ? X.structuralBlockReason(D, "remove") : "No elements are selected.", Pr = D ? X.structuralBlockReason(D, "move") : "No elements are selected.", vn = D && D.parentElement ? Array.from(D.parentElement.children).indexOf(D) : -1, mo = ((xl = D == null ? void 0 : D.parentElement) == null ? void 0 : xl.children.length) ?? 0, U = at ? Ze()[at.name] ?? null : null, pe = qt && /^[A-Z]/.test(qt.elementName) ? (at == null ? void 0 : at.name) ?? null : null, be = D ? X.componentInsertBlockReason(D, pe) : "No elements are selected.", Te = de.trim().toLocaleLowerCase(), Ae = zt.filter(
8270
8276
  ([h, y]) => !Te || h.toLocaleLowerCase().includes(Te) || y.importPath.toLocaleLowerCase().includes(Te)
8271
- ), me = Ae.find(([h]) => h === Ee) ?? Ae[0] ?? null, ye = (me == null ? void 0 : me[1]) ?? null, qe = me ? Sl(me[0]) : null, St = (D ? Nl(D) : null) ?? 0, kt = D ? Lx(D, (at == null ? void 0 : at.props) ?? null, U) : !1, En = D ? Dx(D, (at == null ? void 0 : at.props) ?? null, U) : [], kn = D ? Ju(D) : [], nt = { count: kn.length }, wn = Me && D && on && on !== D ? [D, on] : null, go = X.entries, bo = Object.entries((at == null ? void 0 : at.primitiveProps) ?? {}), sn = je, Gt = go.reduce((h, y) => {
8277
+ ), me = Ae.find(([h]) => h === Ee) ?? Ae[0] ?? null, ye = (me == null ? void 0 : me[1]) ?? null, qe = me ? Sl(me[0]) : null, Nt = (D ? Nl(D) : null) ?? 0, kt = D ? Lx(D, (at == null ? void 0 : at.props) ?? null, U) : !1, kn = D ? Dx(D, (at == null ? void 0 : at.props) ?? null, U) : [], An = D ? Ju(D) : [], nt = { count: An.length }, wn = Me && D && sn && sn !== D ? [D, sn] : null, go = X.entries, bo = Object.entries((at == null ? void 0 : at.primitiveProps) ?? {}), an = je, Yt = go.reduce((h, y) => {
8272
8278
  const C = h.find((_) => _.el === y.el);
8273
8279
  return C ? (C.label = y.label, C.items.push(y)) : h.push({ id: y.id, el: y.el, label: y.label, items: [y] }), h;
8274
- }, []), xo = sn.styles.length + sn.texts.length + sn.operations.length, yo = Vo() != null, Wi = yo && E !== Ne, wf = Gt.filter(
8280
+ }, []), xo = an.styles.length + an.texts.length + an.operations.length, yo = Vo() != null, Wi = yo && E !== Ne, wf = Yt.filter(
8275
8281
  (h) => h.items.some((y) => !Qi(y))
8276
- ).length, Hi = v != null || $ !== "original" || H !== "default", Mr = Hi && D ? jx(D, Ce) : null, Ge = Ox(Ve), tr = Ge != null, Nt = Bx(he), an = j === "custom" ? z.minWidth != null || z.maxWidth != null ? {
8282
+ ).length, Hi = v != null || $ !== "original" || H !== "default", Mr = Hi && D ? jx(D, Ce) : null, Ge = Ox(Ve), tr = Ge != null, It = Bx(he), ln = j === "custom" ? z.minWidth != null || z.maxWidth != null ? {
8277
8283
  ...z.minWidth != null ? { minWidth: Math.max(0, Math.round(z.minWidth)) } : {},
8278
8284
  ...z.maxWidth != null ? { maxWidth: Math.max(0, Math.round(z.maxWidth)) } : {}
8279
- } : null : ((yl = uc.find((h) => h.id === j)) == null ? void 0 : yl.media) ?? null, Vi = kn.filter((h) => h.isConnected && Ce.getComputedStyle(h).getPropertyValue("display") !== "none").map((h, y) => ({ el: h, index: y, rect: Et(h.getBoundingClientRect()) })).filter(({ rect: h }) => h.width > 0 && h.height > 0), Ki = Vi.slice().sort((h, y) => h.rect.top - y.rect.top || h.rect.left - y.rect.left).reduce((h, y) => {
8285
+ } : null : ((yl = uc.find((h) => h.id === j)) == null ? void 0 : yl.media) ?? null, Vi = An.filter((h) => h.isConnected && Ce.getComputedStyle(h).getPropertyValue("display") !== "none").map((h, y) => ({ el: h, index: y, rect: xt(h.getBoundingClientRect()) })).filter(({ rect: h }) => h.width > 0 && h.height > 0), Ki = Vi.slice().sort((h, y) => h.rect.top - y.rect.top || h.rect.left - y.rect.left).reduce((h, y) => {
8280
8286
  const C = h.find((_) => Math.abs(_.top - y.rect.top) < 6);
8281
8287
  return C ? (C.top = Math.min(C.top, y.rect.top), C.bottom = Math.max(C.bottom, y.rect.top + y.rect.height), C.left = Math.min(C.left, y.rect.left), C.right = Math.max(C.right, y.rect.left + y.rect.width), C.items.push(y), C.items.sort((_, L) => _.rect.left - L.rect.left)) : h.push({
8282
8288
  top: y.rect.top,
@@ -8287,8 +8293,8 @@ function mc({
8287
8293
  }), h;
8288
8294
  }, []).sort((h, y) => h.top - y.top), Sf = Ki.flatMap(
8289
8295
  (h, y) => h.items.slice(0, -1).map((C, _) => {
8290
- const L = h.items[_ + 1], le = C.rect.left + C.rect.width, ue = L.rect.left, _e = Math.max(C.rect.top, L.rect.top), ht = Math.min(C.rect.top + C.rect.height, L.rect.top + L.rect.height);
8291
- return { key: `${y}-${_}`, left: le, top: _e, width: Math.max(0, ue - le), height: Math.max(16, ht - _e) };
8296
+ const L = h.items[_ + 1], ce = C.rect.left + C.rect.width, ue = L.rect.left, _e = Math.max(C.rect.top, L.rect.top), ht = Math.min(C.rect.top + C.rect.height, L.rect.top + L.rect.height);
8297
+ return { key: `${y}-${_}`, left: ce, top: _e, width: Math.max(0, ue - ce), height: Math.max(16, ht - _e) };
8292
8298
  })
8293
8299
  ), Nf = Ki.slice(0, -1).map((h, y) => {
8294
8300
  const C = Ki[y + 1];
@@ -8299,45 +8305,45 @@ function mc({
8299
8305
  width: Math.max(16, Math.min(h.right, C.right) - Math.max(h.left, C.left)),
8300
8306
  height: Math.max(0, C.top - h.bottom)
8301
8307
  };
8302
- }), ln = Math.max(0, At(Ve, "column-gap", At(Ve, "gap"))), Er = Math.max(0, At(Ve, "row-gap", At(Ve, "gap"))), It = {
8308
+ }), cn = Math.max(0, At(Ve, "column-gap", At(Ve, "gap"))), Er = Math.max(0, At(Ve, "row-gap", At(Ve, "gap"))), Ct = {
8303
8309
  top: Math.max(0, At(Ve, "padding-top")),
8304
8310
  right: Math.max(0, At(Ve, "padding-right")),
8305
8311
  bottom: Math.max(0, At(Ve, "padding-bottom")),
8306
8312
  left: Math.max(0, At(Ve, "padding-left"))
8307
- }, If = It.left, Cf = It.top, kr = (Ve == null ? void 0 : Ve.getPropertyValue("justify-content")) || "normal", il = (Ve == null ? void 0 : Ve.getPropertyValue("align-items")) || "normal", Ui = (Ve == null ? void 0 : Ve.getPropertyValue("flex-direction")) || "row", $f = pc(Ui.includes("column") ? il : kr), Pf = pc(Ui.includes("column") ? kr : il), Mf = zo(
8313
+ }, If = Ct.left, Cf = Ct.top, kr = (Ve == null ? void 0 : Ve.getPropertyValue("justify-content")) || "normal", il = (Ve == null ? void 0 : Ve.getPropertyValue("align-items")) || "normal", Ui = (Ve == null ? void 0 : Ve.getPropertyValue("flex-direction")) || "row", $f = pc(Ui.includes("column") ? il : kr), Pf = pc(Ui.includes("column") ? kr : il), Mf = zo(
8308
8314
  (he == null ? void 0 : he.style.getPropertyValue("width")) || (G && G.width >= window.innerWidth * 0.8 ? "100%" : ""),
8309
8315
  (G == null ? void 0 : G.width) ?? 0
8310
8316
  ), Ef = zo(
8311
8317
  (he == null ? void 0 : he.style.getPropertyValue("height")) || "",
8312
8318
  (G == null ? void 0 : G.height) ?? 0
8313
- ), kf = zo((D == null ? void 0 : D.style.getPropertyValue("width")) || "", (te == null ? void 0 : te.width) ?? 0), Af = zo((D == null ? void 0 : D.style.getPropertyValue("height")) || "", (te == null ? void 0 : te.height) ?? 0), sl = (st == null ? void 0 : st.getPropertyValue("align-self")) || "auto", Rf = At(st, "order"), Ar = (D == null ? void 0 : D.style.getPropertyValue("grid-column")) || (st == null ? void 0 : st.getPropertyValue("grid-column")) || "auto", al = Number(((vl = /span\s+(\d+)/.exec(Ar)) == null ? void 0 : vl[1]) ?? 1), qi = (st == null ? void 0 : st.getPropertyValue("position")) === "absolute", nr = us(he, (te == null ? void 0 : te.width) ?? 240), xt = v ?? Math.max(1, nt.count), vo = Math.max(
8319
+ ), kf = zo((D == null ? void 0 : D.style.getPropertyValue("width")) || "", (te == null ? void 0 : te.width) ?? 0), Af = zo((D == null ? void 0 : D.style.getPropertyValue("height")) || "", (te == null ? void 0 : te.height) ?? 0), sl = (st == null ? void 0 : st.getPropertyValue("align-self")) || "auto", Rf = At(st, "order"), Ar = (D == null ? void 0 : D.style.getPropertyValue("grid-column")) || (st == null ? void 0 : st.getPropertyValue("grid-column")) || "auto", al = Number(((vl = /span\s+(\d+)/.exec(Ar)) == null ? void 0 : vl[1]) ?? 1), qi = (st == null ? void 0 : st.getPropertyValue("position")) === "absolute", nr = us(he, (te == null ? void 0 : te.width) ?? 240), yt = v ?? Math.max(1, nt.count), vo = Math.max(
8314
8320
  0,
8315
- ((G == null ? void 0 : G.width) ?? 0) - It.left - It.right
8321
+ ((G == null ? void 0 : G.width) ?? 0) - Ct.left - Ct.right
8316
8322
  ), Tf = Math.max(
8317
8323
  1,
8318
8324
  Math.min(
8319
- xt,
8320
- Math.floor((vo + ln) / (nr + ln))
8325
+ yt,
8326
+ Math.floor((vo + cn) / (nr + cn))
8321
8327
  )
8322
- ), wo = Ge === "stack" ? 1 : Ge === "scroll" ? xt : Nt ?? Tf, Ff = Ge === "scroll" ? 1 : Math.max(1, Math.ceil(xt / Math.max(1, wo))), ll = Ge === "stack" ? vo : Ge === "scroll" ? Math.max(nr, (te == null ? void 0 : te.width) ?? 0) : Math.max(
8328
+ ), wo = Ge === "stack" ? 1 : Ge === "scroll" ? yt : It ?? Tf, Ff = Ge === "scroll" ? 1 : Math.max(1, Math.ceil(yt / Math.max(1, wo))), ll = Ge === "stack" ? vo : Ge === "scroll" ? Math.max(nr, (te == null ? void 0 : te.width) ?? 0) : Math.max(
8323
8329
  0,
8324
- (vo - ln * Math.max(0, wo - 1)) / Math.max(1, wo)
8330
+ (vo - cn * Math.max(0, wo - 1)) / Math.max(1, wo)
8325
8331
  ), Yi = Math.max(
8326
8332
  0,
8327
- (vo - ln * Math.max(0, xt - 1)) / xt
8328
- ), cl = Math.max(80, Math.floor(Yi)), Lf = Yi < 160, dl = Ge === "grid" && Nt === xt, Df = Ge === "scroll" ? `${xt} items · horizontal scroll · ${Math.round(ll)}px cards` : `${xt} items · ${Ff} rows × ${wo} columns · about ${Math.round(ll)}px each`, zf = u === "cases" && !m && !!he && !!G && !!te, An = !!he && he.scrollWidth > he.clientWidth + 1 && !["auto", "scroll"].includes((Ve == null ? void 0 : Ve.getPropertyValue("overflow-x")) ?? ""), ul = [
8333
+ (vo - cn * Math.max(0, yt - 1)) / yt
8334
+ ), cl = Math.max(80, Math.floor(Yi)), Lf = Yi < 160, dl = Ge === "grid" && It === yt, Df = Ge === "scroll" ? `${yt} items · horizontal scroll · ${Math.round(ll)}px cards` : `${yt} items · ${Ff} rows × ${wo} columns · about ${Math.round(ll)}px each`, zf = u === "cases" && !m && !!he && !!G && !!te, Rn = !!he && he.scrollWidth > he.clientWidth + 1 && !["auto", "scroll"].includes((Ve == null ? void 0 : Ve.getPropertyValue("overflow-x")) ?? ""), ul = [
8329
8335
  v != null ? `${v} items` : null,
8330
8336
  $ === "long" ? "long text" : $ === "extreme" ? "extreme text" : null,
8331
8337
  H === "selected" ? "selection status" : H === "disabled" ? "inactive" : H === "loading" ? "loading status" : null
8332
- ].filter(Boolean), So = (h) => S(h == null ? null : _x(h)), Rn = (h, y, C) => {
8338
+ ].filter(Boolean), So = (h) => S(h == null ? null : _x(h)), Tn = (h, y, C) => {
8333
8339
  C ? h.style.setProperty(y, C) : h.style.removeProperty(y);
8334
8340
  }, No = (h, y, C, _) => {
8335
8341
  if (h.button !== 0) return;
8336
8342
  h.preventDefault(), h.stopPropagation();
8337
- const L = h.clientX, le = h.clientY, ue = document.body.style.cursor, _e = document.body.style.userSelect;
8343
+ const L = h.clientX, ce = h.clientY, ue = document.body.style.cursor, _e = document.body.style.userSelect;
8338
8344
  document.body.style.cursor = y, document.body.style.userSelect = "none";
8339
8345
  const ht = (Nn) => {
8340
- C(Nn.clientX - L, Nn.clientY - le), ge();
8346
+ C(Nn.clientX - L, Nn.clientY - ce), ge();
8341
8347
  }, Sn = () => {
8342
8348
  window.removeEventListener("pointermove", ht), window.removeEventListener("pointerup", Sn), document.body.style.cursor = ue, document.body.style.userSelect = _e, _(), ge();
8343
8349
  };
@@ -8348,7 +8354,7 @@ function mc({
8348
8354
  h,
8349
8355
  y,
8350
8356
  Be(he),
8351
- an,
8357
+ ln,
8352
8358
  J.current
8353
8359
  );
8354
8360
  }, rt = (h, y) => {
@@ -8358,7 +8364,7 @@ function mc({
8358
8364
  h,
8359
8365
  y,
8360
8366
  Be(D),
8361
- an,
8367
+ ln,
8362
8368
  J.current
8363
8369
  ), (C = B.current) == null || C.mirrorStyle(D, h, y));
8364
8370
  }, Gi = (h) => {
@@ -8372,7 +8378,7 @@ function mc({
8372
8378
  T("container"), X.toast(`${y.label}change to batch`);
8373
8379
  }
8374
8380
  }, Rr = (h) => {
8375
- !he || !D || (Xe("display", "grid"), Xe("grid-template-columns", `repeat(${h}, minmax(0, 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Maximum ${h} per row · ${Fn(an)}`));
8381
+ !he || !D || (Xe("display", "grid"), Xe("grid-template-columns", `repeat(${h}, minmax(0, 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Maximum ${h} per row · ${Ln(ln)}`));
8376
8382
  }, Io = (h) => {
8377
8383
  if (!he || !D) return;
8378
8384
  const y = Math.max(
@@ -8384,20 +8390,20 @@ function mc({
8384
8390
  )
8385
8391
  )
8386
8392
  );
8387
- Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${y}px, 100%), 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Automatic columns · minimum ${y}px · ${Fn(an)}`);
8393
+ Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${y}px, 100%), 1fr))`), rt("width", "auto"), rt("min-width", "0"), X.toast(`Automatic columns · minimum ${y}px · ${Ln(ln)}`);
8388
8394
  }, Xi = (h, y) => {
8389
8395
  if (!he) return;
8390
- const C = he.style.getPropertyValue(h), _ = h === "column-gap" ? ln : h === "row-gap" ? Er : It[h.replace("padding-", "")];
8396
+ const C = he.style.getPropertyValue(h), _ = h === "column-gap" ? cn : h === "row-gap" ? Er : Ct[h.replace("padding-", "")];
8391
8397
  let L = _;
8392
- const le = h === "column-gap" || h === "padding-left" || h === "padding-right", ue = h === "padding-right" || h === "padding-bottom" ? -1 : 1;
8398
+ const ce = h === "column-gap" || h === "padding-left" || h === "padding-right", ue = h === "padding-right" || h === "padding-bottom" ? -1 : 1;
8393
8399
  W(h), h.startsWith("padding-") && q(!1), No(
8394
8400
  y,
8395
- le ? "ew-resize" : "ns-resize",
8401
+ ce ? "ew-resize" : "ns-resize",
8396
8402
  (_e, ht) => {
8397
- L = Math.max(0, Math.min(256, Math.round(_ + (le ? _e : ht) * ue))), he.style.setProperty(h, `${L}px`);
8403
+ L = Math.max(0, Math.min(256, Math.round(_ + (ce ? _e : ht) * ue))), he.style.setProperty(h, `${L}px`);
8398
8404
  },
8399
8405
  () => {
8400
- Rn(he, h, C), Xe(h, `${L}px`), W(null), X.toast(
8406
+ Tn(he, h, C), Xe(h, `${L}px`), W(null), X.toast(
8401
8407
  `${h === "column-gap" ? "column spacing" : h === "row-gap" ? "row spacing" : h.replace("padding-", "padding")} ${L}px`
8402
8408
  );
8403
8409
  }
@@ -8405,33 +8411,33 @@ function mc({
8405
8411
  }, Co = (h, y) => {
8406
8412
  if (!he || !G) return;
8407
8413
  const C = he.style.getPropertyValue("width"), _ = he.style.getPropertyValue("height");
8408
- let L = Math.round(G.width), le = Math.round(G.height);
8414
+ let L = Math.round(G.width), ce = Math.round(G.height);
8409
8415
  No(
8410
8416
  y,
8411
8417
  h === "width" ? "ew-resize" : h === "height" ? "ns-resize" : "nwse-resize",
8412
8418
  (ue, _e) => {
8413
- h !== "height" && (L = Math.max(200, Math.min(1920, Math.round(G.width + ue))), he.style.setProperty("width", `${L}px`)), h !== "width" && (le = Math.max(80, Math.min(1600, Math.round(G.height + _e))), he.style.setProperty("height", `${le}px`));
8419
+ h !== "height" && (L = Math.max(200, Math.min(1920, Math.round(G.width + ue))), he.style.setProperty("width", `${L}px`)), h !== "width" && (ce = Math.max(80, Math.min(1600, Math.round(G.height + _e))), he.style.setProperty("height", `${ce}px`));
8414
8420
  },
8415
8421
  () => {
8416
- Rn(he, "width", C), Rn(he, "height", _), h !== "height" && Xe("width", `${L}px`), h !== "width" && Xe("height", `${le}px`), X.toast(`container${L} × ${le}px`);
8422
+ Tn(he, "width", C), Tn(he, "height", _), h !== "height" && Xe("width", `${L}px`), h !== "width" && Xe("height", `${ce}px`), X.toast(`container${L} × ${ce}px`);
8417
8423
  }
8418
8424
  );
8419
8425
  }, _f = (h) => {
8420
8426
  if (!he || !D) return;
8421
8427
  const y = he.style.getPropertyValue("display"), C = he.style.getPropertyValue("grid-template-columns"), _ = D.style.getPropertyValue("min-width"), L = us(he, (te == null ? void 0 : te.width) ?? 240);
8422
- let le = L;
8428
+ let ce = L;
8423
8429
  No(
8424
8430
  h,
8425
8431
  "ew-resize",
8426
8432
  (ue) => {
8427
8433
  var _e;
8428
- le = Math.max(80, Math.min(600, Math.round(L + ue))), he.style.setProperty("display", "grid"), he.style.setProperty(
8434
+ ce = Math.max(80, Math.min(600, Math.round(L + ue))), he.style.setProperty("display", "grid"), he.style.setProperty(
8429
8435
  "grid-template-columns",
8430
- `repeat(auto-fit, minmax(min(${le}px, 100%), 1fr))`
8436
+ `repeat(auto-fit, minmax(min(${ce}px, 100%), 1fr))`
8431
8437
  ), D.style.setProperty("min-width", "0"), (_e = B.current) == null || _e.mirrorStyle(D, "min-width", "0");
8432
8438
  },
8433
8439
  () => {
8434
- Rn(he, "display", y), Rn(he, "grid-template-columns", C), Rn(D, "min-width", _), Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${le}px, 100%), 1fr))`), rt("min-width", "0"), X.toast(`item minimum width${le}px`);
8440
+ Tn(he, "display", y), Tn(he, "grid-template-columns", C), Tn(D, "min-width", _), Xe("display", "grid"), Xe("grid-template-columns", `repeat(auto-fit, minmax(min(${ce}px, 100%), 1fr))`), rt("min-width", "0"), X.toast(`item minimum width${ce}px`);
8435
8441
  }
8436
8442
  );
8437
8443
  }, Of = (h) => {
@@ -8441,12 +8447,12 @@ function mc({
8441
8447
  No(
8442
8448
  h,
8443
8449
  "ns-resize",
8444
- (L, le) => {
8450
+ (L, ce) => {
8445
8451
  var ue;
8446
- _ = Math.max(40, Math.min(1200, Math.round(C + le))), D.style.setProperty("height", `${_}px`), (ue = B.current) == null || ue.mirrorStyle(D, "height", `${_}px`);
8452
+ _ = Math.max(40, Math.min(1200, Math.round(C + ce))), D.style.setProperty("height", `${_}px`), (ue = B.current) == null || ue.mirrorStyle(D, "height", `${_}px`);
8447
8453
  },
8448
8454
  () => {
8449
- Rn(D, "height", y), rt("height", `${_}px`), X.toast(`item height${_}px`);
8455
+ Tn(D, "height", y), rt("height", `${_}px`), X.toast(`item height${_}px`);
8450
8456
  }
8451
8457
  );
8452
8458
  }, $o = (h, y, C) => {
@@ -8478,25 +8484,25 @@ function mc({
8478
8484
  "text-overflow": "ellipsis",
8479
8485
  "overflow-wrap": "normal"
8480
8486
  };
8481
- for (const [L, le] of Object.entries(C))
8487
+ for (const [L, ce] of Object.entries(C))
8482
8488
  X.recordStyle(
8483
8489
  y,
8484
8490
  L,
8485
- le,
8491
+ ce,
8486
8492
  Be(y),
8487
- an,
8493
+ ln,
8488
8494
  J.current
8489
- ), (_ = B.current) == null || _.mirrorStyle(y, L, le);
8495
+ ), (_ = B.current) == null || _.mirrorStyle(y, L, ce);
8490
8496
  X.toast(h === "wrap" ? "Change to multi-line content" : "Change to one line abbreviation");
8491
8497
  }, Tr = m ? Px : $x, jf = u === "cases" && G && G.left + G.width > window.innerWidth - Tr - 32 || te && te.left + te.width / 2 > window.innerWidth / 2 ? 16 : Math.max(16, window.innerWidth - Tr - 16), Wf = Se ? 54 : 64, pl = Math.max(8, Math.min((x == null ? void 0 : x.x) ?? jf, window.innerWidth - Tr - 8)), ml = Math.max(8, Math.min((x == null ? void 0 : x.y) ?? Wf, window.innerHeight - 80)), Hf = (h) => {
8492
8498
  if (h.button !== 0) return;
8493
8499
  h.preventDefault();
8494
8500
  const y = { x: h.clientX, y: h.clientY, left: pl, top: ml };
8495
8501
  let C = { x: y.left, y: y.top };
8496
- const _ = (le) => {
8502
+ const _ = (ce) => {
8497
8503
  C = {
8498
- x: Math.max(8, Math.min(y.left + le.clientX - y.x, window.innerWidth - Tr - 8)),
8499
- y: Math.max(8, Math.min(y.top + le.clientY - y.y, window.innerHeight - 80))
8504
+ x: Math.max(8, Math.min(y.left + ce.clientX - y.x, window.innerWidth - Tr - 8)),
8505
+ y: Math.max(8, Math.min(y.top + ce.clientY - y.y, window.innerHeight - 80))
8500
8506
  }, w(C);
8501
8507
  }, L = () => {
8502
8508
  fc(C), window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", L);
@@ -8513,9 +8519,9 @@ function mc({
8513
8519
  pointerEvents: "none"
8514
8520
  }), rr = { lines: [], labels: [] };
8515
8521
  if (wn) {
8516
- const h = Et(wn[0].getBoundingClientRect()), y = Et(wn[1].getBoundingClientRect()), C = h.left + h.width, _ = h.top + h.height, L = y.left + y.width, le = y.top + y.height, ue = C <= y.left ? { from: C, to: y.left } : L <= h.left ? { from: L, to: h.left } : null, _e = _ <= y.top ? { from: _, to: y.top } : le <= h.top ? { from: le, to: h.top } : null;
8522
+ const h = xt(wn[0].getBoundingClientRect()), y = xt(wn[1].getBoundingClientRect()), C = h.left + h.width, _ = h.top + h.height, L = y.left + y.width, ce = y.top + y.height, ue = C <= y.left ? { from: C, to: y.left } : L <= h.left ? { from: L, to: h.left } : null, _e = _ <= y.top ? { from: _, to: y.top } : ce <= h.top ? { from: ce, to: h.top } : null;
8517
8523
  if (ue && ue.to - ue.from > 0.5) {
8518
- const ht = ue.to - ue.from, Sn = Math.max(h.top, y.top), Nn = Math.min(_, le), Fr = Nn > Sn ? (Sn + Nn) / 2 : (h.top + _ + y.top + le) / 4;
8524
+ const ht = ue.to - ue.from, Sn = Math.max(h.top, y.top), Nn = Math.min(_, ce), Fr = Nn > Sn ? (Sn + Nn) / 2 : (h.top + _ + y.top + ce) / 4;
8519
8525
  rr.lines.push({ left: ue.from, top: Fr - 0.5, width: ht, height: 1 }), rr.labels.push({ x: ue.from + ht / 2, y: Fr, text: `${Math.round(ht)}px` });
8520
8526
  }
8521
8527
  if (_e && _e.to - _e.from > 0.5) {
@@ -8536,19 +8542,19 @@ function mc({
8536
8542
  "data-inspect-layer": !0,
8537
8543
  className: "absolute inset-0",
8538
8544
  style: { cursor: "crosshair", pointerEvents: c ? "none" : "auto" },
8539
- onMouseMove: (h) => i(qt(h)),
8545
+ onMouseMove: (h) => i(_t(h)),
8540
8546
  onMouseLeave: () => i(null),
8541
8547
  onWheel: (h) => {
8542
8548
  var y;
8543
8549
  Se ? Ce.scrollBy(h.deltaX, h.deltaY) : (y = t == null ? void 0 : t.current) == null || y.scrollBy(h.deltaX, h.deltaY);
8544
8550
  },
8545
8551
  onClick: (h) => {
8546
- const y = qt(h);
8552
+ const y = _t(h);
8547
8553
  y && l(y);
8548
8554
  },
8549
8555
  onDoubleClick: (h) => {
8550
- const y = qt(h);
8551
- y && ds(y) && Mn(y);
8556
+ const y = _t(h);
8557
+ y && ds(y) && En(y);
8552
8558
  }
8553
8559
  }
8554
8560
  ),
@@ -8608,7 +8614,7 @@ function mc({
8608
8614
  ))
8609
8615
  ] }),
8610
8616
  zf && G && /* @__PURE__ */ g(Ue, { children: [
8611
- /* @__PURE__ */ s("div", { style: Po(G, An ? "#f24822" : "#9747ff", !0) }),
8617
+ /* @__PURE__ */ s("div", { style: Po(G, Rn ? "#f24822" : "#9747ff", !0) }),
8612
8618
  /* @__PURE__ */ g(
8613
8619
  "div",
8614
8620
  {
@@ -8619,10 +8625,10 @@ function mc({
8619
8625
  pointerEvents: "none",
8620
8626
  zIndex: 11
8621
8627
  },
8622
- className: `rounded px-1.5 py-0.5 text-[10px] font-semibold text-white ${An ? "bg-[#f24822]" : "bg-[#9747ff]"}`,
8628
+ className: `rounded px-1.5 py-0.5 text-[10px] font-semibold text-white ${Rn ? "bg-[#f24822]" : "bg-[#9747ff]"}`,
8623
8629
  children: [
8624
- Nt ? `maximum${Nt}row/row` : `Automatic Placement Minimum${nr}px`,
8625
- an && ` · ${Fn(an)}`
8630
+ It ? `maximum${It}row/row` : `Automatic Placement Minimum${nr}px`,
8631
+ ln && ` · ${Ln(ln)}`
8626
8632
  ]
8627
8633
  }
8628
8634
  ),
@@ -8639,7 +8645,7 @@ function mc({
8639
8645
  top: h.top + 8,
8640
8646
  zIndex: 13
8641
8647
  },
8642
- className: `flex h-[22px] w-[22px] items-center justify-center rounded-full border text-[12px] font-bold shadow-sm ${Nt === y + 1 ? "border-[#9747ff] bg-[#9747ff] text-white" : "border-[#c4b5fd] bg-white text-[#7c3aed] hover:bg-[#f5f3ff]"}`,
8648
+ className: `flex h-[22px] w-[22px] items-center justify-center rounded-full border text-[12px] font-bold shadow-sm ${It === y + 1 ? "border-[#9747ff] bg-[#9747ff] text-white" : "border-[#c4b5fd] bg-white text-[#7c3aed] hover:bg-[#f5f3ff]"}`,
8643
8649
  onClick: (C) => {
8644
8650
  C.stopPropagation(), Rr(y + 1);
8645
8651
  },
@@ -8668,8 +8674,8 @@ function mc({
8668
8674
  {
8669
8675
  type: "button",
8670
8676
  "data-case-column-gap-handle": y,
8671
- "aria-label": `column spacing${Math.round(ln)}px`,
8672
- title: `column spacing${Math.round(ln)}px`,
8677
+ "aria-label": `column spacing${Math.round(cn)}px`,
8678
+ title: `column spacing${Math.round(cn)}px`,
8673
8679
  style: {
8674
8680
  position: "absolute",
8675
8681
  left: h.left + h.width / 2,
@@ -8682,7 +8688,7 @@ function mc({
8682
8688
  onPointerEnter: () => W("column-gap"),
8683
8689
  onPointerLeave: () => W(null),
8684
8690
  onPointerDown: (C) => Xi("column-gap", C),
8685
- children: Math.round(ln)
8691
+ children: Math.round(cn)
8686
8692
  }
8687
8693
  )
8688
8694
  ] }, `column-gap-${h.key}`)),
@@ -8728,32 +8734,32 @@ function mc({
8728
8734
  [
8729
8735
  {
8730
8736
  side: "top",
8731
- value: It.top,
8737
+ value: Ct.top,
8732
8738
  left: G.left + G.width / 2,
8733
- top: G.top + Math.max(It.top / 2, 16),
8739
+ top: G.top + Math.max(Ct.top / 2, 16),
8734
8740
  cursor: "ns-resize",
8735
8741
  className: "h-[18px] min-w-[26px] -translate-x-1/2 -translate-y-1/2"
8736
8742
  },
8737
8743
  {
8738
8744
  side: "right",
8739
- value: It.right,
8740
- left: G.left + G.width - Math.max(It.right / 2, 24),
8745
+ value: Ct.right,
8746
+ left: G.left + G.width - Math.max(Ct.right / 2, 24),
8741
8747
  top: G.top + G.height / 2,
8742
8748
  cursor: "ew-resize",
8743
8749
  className: "h-[26px] min-w-[20px] -translate-x-1/2 -translate-y-1/2"
8744
8750
  },
8745
8751
  {
8746
8752
  side: "bottom",
8747
- value: It.bottom,
8753
+ value: Ct.bottom,
8748
8754
  left: G.left + G.width / 2,
8749
- top: G.top + G.height - Math.max(It.bottom / 2, 16),
8755
+ top: G.top + G.height - Math.max(Ct.bottom / 2, 16),
8750
8756
  cursor: "ns-resize",
8751
8757
  className: "h-[18px] min-w-[26px] -translate-x-1/2 -translate-y-1/2"
8752
8758
  },
8753
8759
  {
8754
8760
  side: "left",
8755
- value: It.left,
8756
- left: G.left + Math.max(It.left / 2, 24),
8761
+ value: Ct.left,
8762
+ left: G.left + Math.max(Ct.left / 2, 24),
8757
8763
  top: G.top + G.height / 2,
8758
8764
  cursor: "ew-resize",
8759
8765
  className: "h-[26px] min-w-[20px] -translate-x-1/2 -translate-y-1/2"
@@ -8981,13 +8987,13 @@ function mc({
8981
8987
  /* @__PURE__ */ s(fs, { active: u === "edit", onClick: () => p("edit"), children: "Edit" }),
8982
8988
  /* @__PURE__ */ g(fs, { active: u === "source", onClick: () => p("source"), children: [
8983
8989
  "Changes ",
8984
- Gt.length > 0 ? Gt.length : ""
8990
+ Yt.length > 0 ? Yt.length : ""
8985
8991
  ] })
8986
8992
  ] })
8987
8993
  ] }),
8988
8994
  !m && /* @__PURE__ */ s(Ue, { children: (!D || !st) && u !== "source" ? /* @__PURE__ */ g("div", { className: "flex min-h-0 flex-1 flex-col", children: [
8989
8995
  /* @__PURE__ */ s("div", { className: "px-4 py-8 text-center text-[12px] leading-relaxed text-[#71717a]", children: "Select an element on the canvas." }),
8990
- Gt.length > 0 && /* @__PURE__ */ g(
8996
+ Yt.length > 0 && /* @__PURE__ */ g(
8991
8997
  "button",
8992
8998
  {
8993
8999
  type: "button",
@@ -8995,7 +9001,7 @@ function mc({
8995
9001
  onClick: () => p("source"),
8996
9002
  children: [
8997
9003
  "Review ",
8998
- Gt.length,
9004
+ Yt.length,
8999
9005
  " changes"
9000
9006
  ]
9001
9007
  }
@@ -9016,22 +9022,22 @@ function mc({
9016
9022
  /* @__PURE__ */ s(Je, { title: "Case result", children: /* @__PURE__ */ g(
9017
9023
  "div",
9018
9024
  {
9019
- className: `rounded-lg border px-3 py-2.5 ${An ? "border-[#fed7aa] bg-[#fff7ed]" : "border-[#bfdbfe] bg-[#eff6ff]"}`,
9025
+ className: `rounded-lg border px-3 py-2.5 ${Rn ? "border-[#fed7aa] bg-[#fff7ed]" : "border-[#bfdbfe] bg-[#eff6ff]"}`,
9020
9026
  children: [
9021
9027
  /* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
9022
- /* @__PURE__ */ s("span", { className: `min-w-0 flex-1 text-[11px] font-semibold ${An ? "text-[#c2410c]" : "text-[#1d4ed8]"}`, children: Df }),
9028
+ /* @__PURE__ */ s("span", { className: `min-w-0 flex-1 text-[11px] font-semibold ${Rn ? "text-[#c2410c]" : "text-[#1d4ed8]"}`, children: Df }),
9023
9029
  /* @__PURE__ */ s(
9024
9030
  "span",
9025
9031
  {
9026
- className: `shrink-0 rounded px-1.5 py-0.5 text-[9px] font-semibold ${An ? "bg-[#ffedd5] text-[#c2410c]" : "bg-[#dcfce7] text-[#166534]"}`,
9027
- children: An ? "Overflow" : "Layout valid"
9032
+ className: `shrink-0 rounded px-1.5 py-0.5 text-[9px] font-semibold ${Rn ? "bg-[#ffedd5] text-[#c2410c]" : "bg-[#dcfce7] text-[#166534]"}`,
9033
+ children: Rn ? "Overflow" : "Layout valid"
9028
9034
  }
9029
9035
  )
9030
9036
  ] }),
9031
- /* @__PURE__ */ g("div", { className: `mt-1 text-[9px] ${An ? "text-[#9a3412]" : "text-[#64748b]"}`, children: [
9037
+ /* @__PURE__ */ g("div", { className: `mt-1 text-[9px] ${Rn ? "text-[#9a3412]" : "text-[#64748b]"}`, children: [
9032
9038
  ul.length > 0 ? ul.join(" · ") : "Current data",
9033
9039
  " · ",
9034
- Fn(an)
9040
+ Ln(ln)
9035
9041
  ] })
9036
9042
  ]
9037
9043
  }
@@ -9100,7 +9106,7 @@ function mc({
9100
9106
  className: `h-7 rounded-md text-[10px] font-semibold ${v === h ? "bg-[#0d99ff] text-white" : "bg-[#f4f4f5] text-[#52525b] hover:bg-[#e9e9ee]"}`,
9101
9107
  onClick: () => {
9102
9108
  if (h == null) {
9103
- $e(), S(null), ge();
9109
+ Pe(), S(null), ge();
9104
9110
  return;
9105
9111
  }
9106
9112
  So(h);
@@ -9160,12 +9166,12 @@ function mc({
9160
9166
  ] })
9161
9167
  }
9162
9168
  ),
9163
- En.length > 0 && /* @__PURE__ */ s(Je, { title: "State preview", children: /* @__PURE__ */ s("div", { className: `grid gap-1 ${En.length >= 3 ? "grid-cols-4" : "grid-cols-3"}`, children: [
9169
+ kn.length > 0 && /* @__PURE__ */ s(Je, { title: "State preview", children: /* @__PURE__ */ s("div", { className: `grid gap-1 ${kn.length >= 3 ? "grid-cols-4" : "grid-cols-3"}`, children: [
9164
9170
  ["default", "Default"],
9165
9171
  ["selected", "Selected"],
9166
9172
  ["disabled", "Disabled"],
9167
9173
  ["loading", "Loading"]
9168
- ].filter(([h]) => h === "default" || En.includes(h)).map(([h, y]) => /* @__PURE__ */ s(
9174
+ ].filter(([h]) => h === "default" || kn.includes(h)).map(([h, y]) => /* @__PURE__ */ s(
9169
9175
  "button",
9170
9176
  {
9171
9177
  type: "button",
@@ -9180,7 +9186,7 @@ function mc({
9180
9186
  Je,
9181
9187
  {
9182
9188
  title: "Screen scope · Breakpoint",
9183
- action: /* @__PURE__ */ s("span", { className: "text-[10px] tabular-nums text-[#71717a]", children: Fn(an) }),
9189
+ action: /* @__PURE__ */ s("span", { className: "text-[10px] tabular-nums text-[#71717a]", children: Ln(ln) }),
9184
9190
  children: [
9185
9191
  /* @__PURE__ */ g("div", { className: "grid grid-cols-5 gap-1", children: [
9186
9192
  uc.map((h) => /* @__PURE__ */ s(
@@ -9207,7 +9213,7 @@ function mc({
9207
9213
  ] }),
9208
9214
  j === "custom" && /* @__PURE__ */ g("div", { className: "mt-1.5 grid grid-cols-2 gap-1", children: [
9209
9215
  /* @__PURE__ */ s(
9210
- Ct,
9216
+ $t,
9211
9217
  {
9212
9218
  label: "Min",
9213
9219
  value: z.minWidth ?? 0,
@@ -9218,7 +9224,7 @@ function mc({
9218
9224
  }
9219
9225
  ),
9220
9226
  /* @__PURE__ */ s(
9221
- Ct,
9227
+ $t,
9222
9228
  {
9223
9229
  label: "Max",
9224
9230
  value: z.maxWidth ?? 0,
@@ -9255,15 +9261,15 @@ function mc({
9255
9261
  "button",
9256
9262
  {
9257
9263
  type: "button",
9258
- "aria-label": `Fit all ${xt} items in one row`,
9264
+ "aria-label": `Fit all ${yt} items in one row`,
9259
9265
  "aria-pressed": dl,
9260
9266
  className: `w-full rounded-lg border px-3 py-2.5 text-left ${dl ? "border-[#7c3aed] bg-[#f5f3ff] text-[#5b21b6]" : "border-[#dedee3] bg-white text-[#27272a] hover:border-[#a78bfa] hover:bg-[#faf8ff]"}`,
9261
- onClick: () => Rr(xt),
9267
+ onClick: () => Rr(yt),
9262
9268
  children: [
9263
9269
  /* @__PURE__ */ g("span", { className: "flex items-center justify-between gap-2", children: [
9264
9270
  /* @__PURE__ */ g("span", { className: "text-[11px] font-semibold", children: [
9265
9271
  "Fit all ",
9266
- xt,
9272
+ yt,
9267
9273
  " items in one row"
9268
9274
  ] }),
9269
9275
  /* @__PURE__ */ g("span", { className: "rounded bg-white/80 px-1.5 py-0.5 text-[9px] font-semibold", children: [
@@ -9283,16 +9289,16 @@ function mc({
9283
9289
  {
9284
9290
  key: "fixed",
9285
9291
  title: "Can be opened fixed",
9286
- detail: `${Nt ?? xt} Columns`,
9287
- active: Ge === "grid" && Nt != null,
9292
+ detail: `${It ?? yt} Columns`,
9293
+ active: Ge === "grid" && It != null,
9288
9294
  icon: /* @__PURE__ */ s(_o, { mode: "grid" }),
9289
- action: () => Rr(Nt ?? xt)
9295
+ action: () => Rr(It ?? yt)
9290
9296
  },
9291
9297
  {
9292
9298
  key: "auto",
9293
9299
  title: "automatic line break",
9294
9300
  detail: `Min W ${Math.round(nr)}`,
9295
- active: Ge === "grid" && Nt == null,
9301
+ active: Ge === "grid" && It == null,
9296
9302
  icon: /* @__PURE__ */ s("span", { className: "text-[15px] leading-none", children: "↪" }),
9297
9303
  action: () => Io()
9298
9304
  },
@@ -9377,7 +9383,7 @@ function mc({
9377
9383
  }
9378
9384
  )
9379
9385
  ] }),
9380
- Ge === "grid" && Nt != null && /* @__PURE__ */ g("div", { className: "mt-3 rounded-lg bg-[#f7f7f8] p-2.5", children: [
9386
+ Ge === "grid" && It != null && /* @__PURE__ */ g("div", { className: "mt-3 rounded-lg bg-[#f7f7f8] p-2.5", children: [
9381
9387
  /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
9382
9388
  /* @__PURE__ */ s("span", { className: "text-[10px] font-semibold text-[#52525b]", children: "Columns" }),
9383
9389
  /* @__PURE__ */ s("span", { className: "text-[9px] text-[#71717a]", children: "How many per line" })
@@ -9388,32 +9394,32 @@ function mc({
9388
9394
  {
9389
9395
  type: "button",
9390
9396
  "aria-label": `${h} items per row`,
9391
- "aria-pressed": Nt === h,
9392
- className: `h-8 rounded-md text-[10px] font-semibold ${Nt === h ? "bg-[#18181b] text-white" : "bg-white text-[#52525b] hover:bg-[#e9e9ee]"}`,
9397
+ "aria-pressed": It === h,
9398
+ className: `h-8 rounded-md text-[10px] font-semibold ${It === h ? "bg-[#18181b] text-white" : "bg-white text-[#52525b] hover:bg-[#e9e9ee]"}`,
9393
9399
  onClick: () => Rr(h),
9394
9400
  children: h
9395
9401
  },
9396
9402
  h
9397
9403
  )),
9398
9404
  /* @__PURE__ */ s(
9399
- Ct,
9405
+ $t,
9400
9406
  {
9401
9407
  label: "directly",
9402
- value: Nt,
9408
+ value: It,
9403
9409
  min: 1,
9404
9410
  onCommit: (h) => Rr(Math.min(24, h))
9405
9411
  }
9406
9412
  )
9407
9413
  ] })
9408
9414
  ] }),
9409
- Ge === "grid" && Nt == null && /* @__PURE__ */ g("div", { className: "mt-3 rounded-lg bg-[#f7f7f8] p-2.5", children: [
9415
+ Ge === "grid" && It == null && /* @__PURE__ */ g("div", { className: "mt-3 rounded-lg bg-[#f7f7f8] p-2.5", children: [
9410
9416
  /* @__PURE__ */ g("div", { className: "flex items-center justify-between", children: [
9411
9417
  /* @__PURE__ */ s("span", { className: "text-[10px] font-semibold text-[#52525b]", children: "Minimum width" }),
9412
9418
  /* @__PURE__ */ s("span", { className: "text-[9px] text-[#71717a]", children: "Wrap when it becomes narrower than the width" })
9413
9419
  ] }),
9414
9420
  /* @__PURE__ */ g("div", { className: "mt-1.5 grid grid-cols-[minmax(0,1fr)_auto] gap-1", children: [
9415
9421
  /* @__PURE__ */ s(
9416
- Ct,
9422
+ $t,
9417
9423
  {
9418
9424
  label: "Min W",
9419
9425
  value: nr,
@@ -9421,14 +9427,14 @@ function mc({
9421
9427
  onCommit: Io
9422
9428
  }
9423
9429
  ),
9424
- xt > 1 && /* @__PURE__ */ g(
9430
+ yt > 1 && /* @__PURE__ */ g(
9425
9431
  "button",
9426
9432
  {
9427
9433
  type: "button",
9428
9434
  className: "h-7 rounded-md bg-white px-2 text-[9px] font-semibold text-[#007be5] hover:bg-[#e5f4ff]",
9429
9435
  onClick: () => Io(cl),
9430
9436
  children: [
9431
- xt,
9437
+ yt,
9432
9438
  " items · ",
9433
9439
  cl
9434
9440
  ]
@@ -9462,15 +9468,15 @@ function mc({
9462
9468
  /* @__PURE__ */ s("div", { className: "text-[10px] text-[#71717a]", children: "Gap" }),
9463
9469
  /* @__PURE__ */ g("div", { className: "mt-1 flex flex-col gap-1", children: [
9464
9470
  Ge !== "stack" && /* @__PURE__ */ s(
9465
- Ct,
9471
+ $t,
9466
9472
  {
9467
9473
  label: "↔",
9468
- value: ln,
9474
+ value: cn,
9469
9475
  onCommit: (h) => Xe("column-gap", `${h}px`)
9470
9476
  }
9471
9477
  ),
9472
9478
  Ge !== "scroll" && /* @__PURE__ */ s(
9473
- Ct,
9479
+ $t,
9474
9480
  {
9475
9481
  label: "↕",
9476
9482
  value: Er,
@@ -9506,18 +9512,18 @@ function mc({
9506
9512
  )
9507
9513
  ] }),
9508
9514
  ee ? /* @__PURE__ */ g("div", { className: "mt-1 grid grid-cols-2 gap-1", children: [
9509
- /* @__PURE__ */ s(Ct, { label: "↔", value: If, onCommit: (h) => Ji("left", h) }),
9510
- /* @__PURE__ */ s(Ct, { label: "↕", value: Cf, onCommit: (h) => Ji("top", h) })
9515
+ /* @__PURE__ */ s($t, { label: "↔", value: If, onCommit: (h) => Ji("left", h) }),
9516
+ /* @__PURE__ */ s($t, { label: "↕", value: Cf, onCommit: (h) => Ji("top", h) })
9511
9517
  ] }) : /* @__PURE__ */ s("div", { className: "mt-1 grid grid-cols-4 gap-1", children: [
9512
9518
  ["T", "top"],
9513
9519
  ["R", "right"],
9514
9520
  ["B", "bottom"],
9515
9521
  ["L", "left"]
9516
9522
  ].map(([h, y]) => /* @__PURE__ */ s(
9517
- Ct,
9523
+ $t,
9518
9524
  {
9519
9525
  label: h,
9520
- value: It[y],
9526
+ value: Ct[y],
9521
9527
  onCommit: (C) => Ji(y, C)
9522
9528
  },
9523
9529
  y
@@ -9579,7 +9585,7 @@ function mc({
9579
9585
  ] }),
9580
9586
  /* @__PURE__ */ g("div", { className: "mt-1 grid grid-cols-2 gap-1", children: [
9581
9587
  /* @__PURE__ */ s(
9582
- Ct,
9588
+ $t,
9583
9589
  {
9584
9590
  label: "Minimum W",
9585
9591
  value: At(st, "min-width"),
@@ -9587,7 +9593,7 @@ function mc({
9587
9593
  }
9588
9594
  ),
9589
9595
  /* @__PURE__ */ s(
9590
- Ct,
9596
+ $t,
9591
9597
  {
9592
9598
  label: "Max W",
9593
9599
  value: At(st, "max-width"),
@@ -9595,7 +9601,7 @@ function mc({
9595
9601
  }
9596
9602
  ),
9597
9603
  /* @__PURE__ */ s(
9598
- Ct,
9604
+ $t,
9599
9605
  {
9600
9606
  label: "Minimum H",
9601
9607
  value: At(st, "min-height"),
@@ -9603,7 +9609,7 @@ function mc({
9603
9609
  }
9604
9610
  ),
9605
9611
  /* @__PURE__ */ s(
9606
- Ct,
9612
+ $t,
9607
9613
  {
9608
9614
  label: "max H",
9609
9615
  value: At(st, "max-height"),
@@ -9612,7 +9618,7 @@ function mc({
9612
9618
  )
9613
9619
  ] }),
9614
9620
  /* @__PURE__ */ g("div", { className: `mt-1.5 grid gap-1 ${Ge === "grid" ? "grid-cols-[1fr_2fr]" : "grid-cols-1"}`, children: [
9615
- /* @__PURE__ */ s(Ct, { label: "order", value: Rf, min: -999, onCommit: (h) => rt("order", `${h}`) }),
9621
+ /* @__PURE__ */ s($t, { label: "order", value: Rf, min: -999, onCommit: (h) => rt("order", `${h}`) }),
9616
9622
  Ge === "grid" && /* @__PURE__ */ g("div", { className: "grid grid-cols-5 gap-1", children: [
9617
9623
  [1, 2, 3, 4].map((h) => /* @__PURE__ */ s(
9618
9624
  "button",
@@ -9679,7 +9685,7 @@ function mc({
9679
9685
  type: "button",
9680
9686
  className: "h-9 rounded-md bg-[#f4f4f5] text-[10px] font-semibold text-[#52525b] hover:bg-[#e9e9ee]",
9681
9687
  onClick: () => {
9682
- $e(), S(null), R("original"), A("default"), ge();
9688
+ Pe(), S(null), R("original"), A("default"), ge();
9683
9689
  },
9684
9690
  children: "Reset case preview"
9685
9691
  }
@@ -9690,7 +9696,7 @@ function mc({
9690
9696
  type: "button",
9691
9697
  className: "h-9 rounded-md bg-[#18181b] text-[10px] font-semibold text-white hover:bg-black",
9692
9698
  onClick: () => {
9693
- Gt.length > 0 && !window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") || ($e(), S(null), R("original"), A("default"), X.discardPending(), P(null), I(""), Re(""), X.toast("Reset all unapplied changes"), ge());
9699
+ Yt.length > 0 && !window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") || (Pe(), S(null), R("original"), A("default"), X.discardPending(), P(null), I(""), Re(""), X.toast("Reset all unapplied changes"), ge());
9694
9700
  },
9695
9701
  children: "Reset changes"
9696
9702
  }
@@ -9801,7 +9807,7 @@ function mc({
9801
9807
  "input",
9802
9808
  {
9803
9809
  type: "search",
9804
- value: ce,
9810
+ value: de,
9805
9811
  placeholder: "Search for component name or import path",
9806
9812
  "aria-label": "Search for component to insert",
9807
9813
  className: "h-8 w-full rounded-md bg-[#f4f4f5] px-2 text-[10px] text-[#18181b] outline-none placeholder:text-[#a1a1aa] focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
@@ -9851,7 +9857,7 @@ function mc({
9851
9857
  ] }),
9852
9858
  /* @__PURE__ */ g("div", { children: [
9853
9859
  "slot: children[",
9854
- Math.min(ve, St),
9860
+ Math.min(ve, Nt),
9855
9861
  "]"
9856
9862
  ] })
9857
9863
  ] }),
@@ -9861,10 +9867,10 @@ function mc({
9861
9867
  "select",
9862
9868
  {
9863
9869
  "aria-label": "Component insertion location",
9864
- value: Math.min(ve, St),
9870
+ value: Math.min(ve, Nt),
9865
9871
  className: "h-8 min-w-0 rounded-md bg-[#f4f4f5] px-2 text-[10px] font-semibold text-[#52525b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
9866
9872
  onChange: (h) => we(Number(h.currentTarget.value)),
9867
- children: Array.from({ length: St + 1 }, (h, y) => /* @__PURE__ */ s("option", { value: y, children: y === 0 ? "0 · First" : y === St ? `${y} · Last` : `${y} · After item ${y}` }, y))
9873
+ children: Array.from({ length: Nt + 1 }, (h, y) => /* @__PURE__ */ s("option", { value: y, children: y === 0 ? "0 · First" : y === Nt ? `${y} · Last` : `${y} · After item ${y}` }, y))
9868
9874
  }
9869
9875
  )
9870
9876
  ] }),
@@ -9880,7 +9886,7 @@ function mc({
9880
9886
  X.recordComponentInsert(
9881
9887
  D,
9882
9888
  h,
9883
- Math.min(ve, St),
9889
+ Math.min(ve, Nt),
9884
9890
  `${h} → ${ut}`,
9885
9891
  pe,
9886
9892
  J.current
@@ -9897,7 +9903,7 @@ function mc({
9897
9903
  title: "Styles",
9898
9904
  action: Hi ? /* @__PURE__ */ s("button", { type: "button", className: "text-[10px] font-semibold text-[#0d99ff]", onClick: () => p("cases"), children: "Back to cases" }) : void 0,
9899
9905
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: (N === "container" ? Nx : Sx).map(({ label: h, prop: y, tokenGroup: C }) => {
9900
- const _ = C ? xn[C] : [];
9906
+ const _ = C ? on[C] : [];
9901
9907
  return /* @__PURE__ */ g("label", { className: "grid grid-cols-[56px_minmax(0,1fr)_82px] items-center gap-1.5 text-[10px] text-[#71717a]", children: [
9902
9908
  /* @__PURE__ */ s("span", { className: "shrink-0", children: h }),
9903
9909
  /* @__PURE__ */ s(
@@ -9907,10 +9913,10 @@ function mc({
9907
9913
  defaultValue: $r.getPropertyValue(y),
9908
9914
  className: "h-7 min-w-0 rounded-md bg-[#f4f4f5] px-2 text-[11px] text-[#18181b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
9909
9915
  onKeyDown: (L) => {
9910
- L.key === "Enter" && _t(y, L.target.value);
9916
+ L.key === "Enter" && Ot(y, L.target.value);
9911
9917
  },
9912
9918
  onBlur: (L) => {
9913
- L.currentTarget.value !== $r.getPropertyValue(y) && _t(y, L.currentTarget.value);
9919
+ L.currentTarget.value !== $r.getPropertyValue(y) && Ot(y, L.currentTarget.value);
9914
9920
  }
9915
9921
  },
9916
9922
  `${Q}-${N}-${y}`
@@ -9922,7 +9928,7 @@ function mc({
9922
9928
  value: "",
9923
9929
  className: "h-7 min-w-0 rounded-md bg-[#f4f4f5] px-1.5 text-[10px] text-[#52525b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff]",
9924
9930
  onChange: (L) => {
9925
- L.target.value && _t(y, `var(${L.target.value})`);
9931
+ L.target.value && Ot(y, `var(${L.target.value})`);
9926
9932
  },
9927
9933
  children: [
9928
9934
  /* @__PURE__ */ s("option", { value: "", children: "Token" }),
@@ -9938,21 +9944,21 @@ function mc({
9938
9944
  }) })
9939
9945
  }
9940
9946
  ),
9941
- N === "item" && D && Yt && bo.length > 0 && /* @__PURE__ */ g(Je, { title: "Component props", children: [
9947
+ N === "item" && D && qt && bo.length > 0 && /* @__PURE__ */ g(Je, { title: "Component props", children: [
9942
9948
  /* @__PURE__ */ g("div", { className: "mb-2 rounded-md bg-[#f4f4f5] px-2 py-1.5 text-[9px] leading-relaxed text-[#71717a]", children: [
9943
9949
  /* @__PURE__ */ g("div", { className: "truncate font-mono text-[#52525b]", children: [
9944
- Yt.elementName,
9950
+ qt.elementName,
9945
9951
  " · ",
9946
- Yt.componentFile,
9952
+ qt.componentFile,
9947
9953
  ":",
9948
- Yt.sourceStart
9954
+ qt.sourceStart
9949
9955
  ] }),
9950
9956
  "DOM properties are previewed immediately. Component-specific props, such as variant, are confirmed in HMR after changes are applied."
9951
9957
  ] }),
9952
9958
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: bo.map(([h, y]) => {
9953
9959
  const C = go.find(
9954
9960
  (ue) => ue.kind === "prop" && ue.el === D && ue.prop === h
9955
- ), _ = C ? typeof y == "boolean" ? C.to === "true" : typeof y == "number" ? Number(C.to) : C.to : y, L = Eh(D, h), le = (ue) => {
9961
+ ), _ = C ? typeof y == "boolean" ? C.to === "true" : typeof y == "number" ? Number(C.to) : C.to : y, L = Eh(D, h), ce = (ue) => {
9956
9962
  const _e = typeof y == "number" ? Number(ue) : ue;
9957
9963
  typeof _e == "number" && !Number.isFinite(_e) || _e !== _ && X.recordProp(
9958
9964
  D,
@@ -9960,7 +9966,7 @@ function mc({
9960
9966
  y,
9961
9967
  _e,
9962
9968
  ut,
9963
- Yt,
9969
+ qt,
9964
9970
  J.current
9965
9971
  );
9966
9972
  };
@@ -9983,7 +9989,7 @@ function mc({
9983
9989
  y,
9984
9990
  ue.currentTarget.value === "true",
9985
9991
  ut,
9986
- Yt,
9992
+ qt,
9987
9993
  J.current
9988
9994
  ),
9989
9995
  children: [
@@ -10000,9 +10006,9 @@ function mc({
10000
10006
  defaultValue: String(_),
10001
10007
  className: "h-7 min-w-0 rounded-md bg-[#f4f4f5] px-2 text-[11px] text-[#18181b] outline-none focus:ring-1 focus:ring-inset focus:ring-[#0d99ff] disabled:text-[#a1a1aa]",
10002
10008
  onKeyDown: (ue) => {
10003
- ue.key === "Enter" && (le(ue.currentTarget.value), ue.currentTarget.blur());
10009
+ ue.key === "Enter" && (ce(ue.currentTarget.value), ue.currentTarget.blur());
10004
10010
  },
10005
- onBlur: (ue) => le(ue.currentTarget.value)
10011
+ onBlur: (ue) => ce(ue.currentTarget.value)
10006
10012
  },
10007
10013
  `${Q}-prop-${h}`
10008
10014
  ),
@@ -10092,10 +10098,10 @@ function mc({
10092
10098
  "button",
10093
10099
  {
10094
10100
  type: "button",
10095
- disabled: Gt.length === 0,
10101
+ disabled: Yt.length === 0,
10096
10102
  className: "mt-1.5 h-8 w-full rounded-md border border-[#fecaca] bg-[#fff7f7] text-[10px] font-semibold text-[#b91c1c] hover:bg-[#fef2f2] disabled:border-[#e4e4e7] disabled:bg-[#f4f4f5] disabled:text-[#a1a1aa]",
10097
10103
  onClick: () => {
10098
- window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") && ($e(), S(null), R("original"), A("default"), X.discardPending(), P(null), I(""), Re(""), X.toast("Reset all unapplied changes"));
10104
+ window.confirm("Reset all unapplied editor changes? This also clears undo and redo history.") && (Pe(), S(null), R("original"), A("default"), X.discardPending(), P(null), I(""), Re(""), X.toast("Reset all unapplied changes"));
10099
10105
  },
10100
10106
  children: "Reset changes"
10101
10107
  }
@@ -10104,10 +10110,10 @@ function mc({
10104
10110
  "button",
10105
10111
  {
10106
10112
  type: "button",
10107
- disabled: xo === 0 || V || de,
10113
+ disabled: xo === 0 || V || le,
10108
10114
  className: "mt-1.5 h-8 w-full rounded-md border border-[#c4b5fd] bg-[#faf5ff] text-[10px] font-semibold text-[#6d28d9] hover:bg-[#f3e8ff] disabled:border-[#e4e4e7] disabled:bg-[#f4f4f5] disabled:text-[#a1a1aa]",
10109
10115
  onClick: () => void Zn(),
10110
- children: V ? "Generating code diff…" : de ? "Calculating impact screen…" : Wi ? "Check code diff" : `Code diff confirmed · r${(ie == null ? void 0 : ie.revision) ?? "—"}`
10116
+ children: V ? "Generating code diff…" : le ? "Calculating impact screen…" : Wi ? "Check code diff" : `Code diff confirmed · r${(ie == null ? void 0 : ie.revision) ?? "—"}`
10111
10117
  }
10112
10118
  ) : /* @__PURE__ */ s("p", { className: "mt-1.5 rounded bg-[#f4f4f5] px-2 py-1 text-[9px] text-[#71717a]", children: "There is no diff callback, so it works in the traditional apply manner." }),
10113
10119
  /* @__PURE__ */ s("p", { className: "mt-1.5 text-[9px] leading-relaxed text-[#71717a]", children: yo ? "You must check the code diff of the current payload to apply it. As changes are added, existing diffs become outdated." : "Only one final change remains per element, attribute, or breakpoint, and intermediate operations are stored only in Undo/Redo memory." }),
@@ -10155,11 +10161,11 @@ function mc({
10155
10161
  ),
10156
10162
  children: /* @__PURE__ */ g("div", { className: "flex flex-col gap-1.5", children: [
10157
10163
  ot.frames.map((h) => {
10158
- var L, le;
10164
+ var L, ce;
10159
10165
  const y = h.domChanged === !0, C = h.screenshotChanged === !0, _ = [
10160
10166
  ["Before change", h.before.screenshotUrl],
10161
10167
  ["After change", (L = h.after) == null ? void 0 : L.screenshotUrl],
10162
- ["Diff", ((le = h.pixelDiff) == null ? void 0 : le.heatmapUrl) ?? void 0]
10168
+ ["Diff", ((ce = h.pixelDiff) == null ? void 0 : ce.heatmapUrl) ?? void 0]
10163
10169
  ].filter((ue) => typeof ue[1] == "string");
10164
10170
  return /* @__PURE__ */ g(
10165
10171
  "div",
@@ -10249,7 +10255,7 @@ function mc({
10249
10255
  }
10250
10256
  ),
10251
10257
  /* @__PURE__ */ s(Je, { title: "Saveable changes", children: xo > 0 ? /* @__PURE__ */ g("div", { className: "flex flex-col gap-2", children: [
10252
- sn.styles.map((h) => {
10258
+ an.styles.map((h) => {
10253
10259
  var y, C;
10254
10260
  return /* @__PURE__ */ g(
10255
10261
  "div",
@@ -10264,7 +10270,7 @@ function mc({
10264
10270
  ] }),
10265
10271
  h.media && /* @__PURE__ */ g("div", { className: "mt-0.5 text-[9px] font-semibold text-[#7c3aed]", children: [
10266
10272
  "@media ",
10267
- Fn(h.media)
10273
+ Ln(h.media)
10268
10274
  ] }),
10269
10275
  /* @__PURE__ */ s("div", { className: "mt-1 flex flex-col gap-0.5 font-mono text-[10px] text-[#52525b]", children: Object.entries(h.declarations).map(([_, L]) => /* @__PURE__ */ g("div", { className: "truncate", children: [
10270
10276
  _,
@@ -10276,7 +10282,7 @@ function mc({
10276
10282
  `${h.file}-${h.className}-${((y = h.media) == null ? void 0 : y.minWidth) ?? ""}-${((C = h.media) == null ? void 0 : C.maxWidth) ?? ""}`
10277
10283
  );
10278
10284
  }),
10279
- sn.texts.map((h) => /* @__PURE__ */ g("div", { className: "rounded-md border border-[#e4e4e7] bg-[#fafafa] px-2.5 py-2", children: [
10285
+ an.texts.map((h) => /* @__PURE__ */ g("div", { className: "rounded-md border border-[#e4e4e7] bg-[#fafafa] px-2.5 py-2", children: [
10280
10286
  /* @__PURE__ */ s("div", { className: "truncate text-[10px] font-semibold text-[#27272a]", children: h.componentFile }),
10281
10287
  /* @__PURE__ */ g("div", { className: "mt-1 truncate text-[10px] text-[#52525b]", children: [
10282
10288
  '"',
@@ -10291,7 +10297,7 @@ function mc({
10291
10297
  ] })
10292
10298
  ] })
10293
10299
  ] }, `${h.componentFile}-${h.oldText}`)),
10294
- sn.operations.map((h) => {
10300
+ an.operations.map((h) => {
10295
10301
  const y = Ax(h), C = h.scope === "instance" ? "This screen" : "Shared source", _ = h.affectedFrames.length > 0 ? h.affectedFrames.map((L) => L.name).join(", ") : "current element";
10296
10302
  return /* @__PURE__ */ g(
10297
10303
  "div",
@@ -10327,9 +10333,9 @@ function mc({
10327
10333
  `${h.kind}-${h.identity.componentFile}-${h.identity.sourceStart}-${y.prop}`
10328
10334
  );
10329
10335
  }),
10330
- sn.operations.some((h) => h.scope === "shared-source") && /* @__PURE__ */ s("p", { className: "text-[9px] leading-relaxed text-[#71717a]", children: de ? "Calculating every screen affected by the shared source." : "Affected screens are derived from the source dependency graph." })
10336
+ an.operations.some((h) => h.scope === "shared-source") && /* @__PURE__ */ s("p", { className: "text-[9px] leading-relaxed text-[#71717a]", children: le ? "Calculating every screen affected by the shared source." : "Affected screens are derived from the source dependency graph." })
10331
10337
  ] }) : /* @__PURE__ */ s("div", { className: "text-[11px] leading-relaxed text-[#a1a1aa]", children: "No changes can be saved yet. Items that only changed the screen are identified in the final changes below." }) }),
10332
- /* @__PURE__ */ s(Je, { title: "Recent changes", children: Gt.length > 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [...Gt].reverse().map((h) => {
10338
+ /* @__PURE__ */ s(Je, { title: "Recent changes", children: Yt.length > 0 ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [...Yt].reverse().map((h) => {
10333
10339
  const y = h.items.some(Qi), C = h.items.some((_) => !Qi(_));
10334
10340
  return /* @__PURE__ */ g("div", { className: "rounded-md bg-[#f7f7f8] px-2.5 py-2 text-[10px] leading-relaxed text-[#52525b]", children: [
10335
10341
  /* @__PURE__ */ g("div", { className: "mb-0.5 flex items-center gap-1", children: [
@@ -10348,7 +10354,7 @@ function mc({
10348
10354
  /* @__PURE__ */ s("b", { children: _.to })
10349
10355
  ] }),
10350
10356
  _.token && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#ede9fe] px-1 text-[8px] font-semibold text-[#6d28d9]", children: "token" }),
10351
- _.media && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#f3e8ff] px-1 text-[8px] font-semibold text-[#7c3aed]", children: Fn(_.media) }),
10357
+ _.media && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#f3e8ff] px-1 text-[8px] font-semibold text-[#7c3aed]", children: Ln(_.media) }),
10352
10358
  _.sourceScope && /* @__PURE__ */ s("span", { className: "shrink-0 rounded bg-[#ede9fe] px-1 text-[8px] font-semibold text-[#6d28d9]", children: _.sourceScope === "instance" ? "This screen" : "Shared source" })
10353
10359
  ] }, _.id)) })
10354
10360
  ] }, h.id);
@@ -10444,11 +10450,11 @@ function gc() {
10444
10450
  ] });
10445
10451
  }
10446
10452
  const Wx = We(function({ onClose: t }) {
10447
- const n = Qe(ha, bn, bn), r = f.activePage, o = Ie(null), i = Ie(null), [a, l] = Y(!1);
10453
+ const n = Qe(ha, xn, xn), r = f.activePage, o = Ie(null), i = Ie(null), [a, l] = Y(!1);
10448
10454
  if (se(() => X.reset(), []), r.route != null) {
10449
10455
  const c = () => {
10450
10456
  if (!o.current) return;
10451
- const d = Vn(), u = d ? d.captureIframe(o.current) : Ah(o.current, {
10457
+ const d = Kn(), u = d ? d.captureIframe(o.current) : Ah(o.current, {
10452
10458
  resolveInstance: fa(Ze()),
10453
10459
  instanceMode: "expand",
10454
10460
  mediaMode: "layers",
@@ -10525,8 +10531,8 @@ const Wx = We(function({ onClose: t }) {
10525
10531
  n,
10526
10532
  r.route ?? "",
10527
10533
  Lt(
10528
- Xt(),
10529
- gn(r, !0)
10534
+ Gt(),
10535
+ bn(r, !0)
10530
10536
  )
10531
10537
  ),
10532
10538
  className: "h-full w-full border-0 bg-white"
@@ -10693,7 +10699,7 @@ function Vx({
10693
10699
  }
10694
10700
  );
10695
10701
  }
10696
- const On = "View only — switch to Editing to change this.", xc = /* @__PURE__ */ new Set([
10702
+ const Bn = "View only — switch to Editing to change this.", xc = /* @__PURE__ */ new Set([
10697
10703
  "Delete",
10698
10704
  "Backspace",
10699
10705
  "Enter",
@@ -11394,7 +11400,7 @@ function dy({
11394
11400
  onFrameFocus: e = (t) => f.selectFrame(t)
11395
11401
  }) {
11396
11402
  var x;
11397
- const t = Vn(), [n, r] = Y(t ? "atoms" : "components"), [o, i] = Y(""), a = o.trim().toLowerCase(), l = (t == null ? void 0 : t.getAssets(n).filter(
11403
+ const t = Kn(), [n, r] = Y(t ? "atoms" : "components"), [o, i] = Y(""), a = o.trim().toLowerCase(), l = (t == null ? void 0 : t.getAssets(n).filter(
11398
11404
  (w) => {
11399
11405
  var v, S, $, R;
11400
11406
  return !a || w.name.toLowerCase().includes(a) || ((v = w.codeName) == null ? void 0 : v.toLowerCase().includes(a)) || ((S = w.sourcePath) == null ? void 0 : S.toLowerCase().includes(a)) || (($ = w.scenarioId) == null ? void 0 : $.toLowerCase().includes(a)) || ((R = w.description) == null ? void 0 : R.toLowerCase().includes(a));
@@ -11464,7 +11470,7 @@ function uy({
11464
11470
  Md,
11465
11471
  Ls,
11466
11472
  Ls
11467
- ), o = e ? n.filter((l) => Xn(l)).length : 0, i = e ? n.filter((l) => Ei(l)).length : 0, a = t && i === n.length;
11473
+ ), o = e ? n.filter((l) => Jn(l)).length : 0, i = e ? n.filter((l) => Ei(l)).length : 0, a = t && i === n.length;
11468
11474
  return /* @__PURE__ */ s(
11469
11475
  "div",
11470
11476
  {
@@ -11482,7 +11488,7 @@ const fy = "pygmalion.design-ir", hy = 1, py = {
11482
11488
  maxNodes: 1e4,
11483
11489
  maxDepth: 64,
11484
11490
  maxOutputBytes: 2 * 1024 * 1024
11485
- }, Wn = /* @__PURE__ */ new Map();
11491
+ }, Hn = /* @__PURE__ */ new Map();
11486
11492
  function nf(e) {
11487
11493
  if (!e || typeof e != "object" || Object.isFrozen(e))
11488
11494
  return e;
@@ -11669,13 +11675,13 @@ function vy(e) {
11669
11675
  throw new Error("Design codegen adapters require an id, label, and language.");
11670
11676
  if (!/^[-a-z0-9]+$/i.test(t))
11671
11677
  throw new Error(`Design codegen adapter id "${t}" is invalid.`);
11672
- const n = Wn.get(t), r = { ...e, id: t };
11673
- return Wn.set(t, r), () => {
11674
- Wn.get(t) === r && (n ? Wn.set(t, n) : Wn.delete(t));
11678
+ const n = Hn.get(t), r = { ...e, id: t };
11679
+ return Hn.set(t, r), () => {
11680
+ Hn.get(t) === r && (n ? Hn.set(t, n) : Hn.delete(t));
11675
11681
  };
11676
11682
  }
11677
11683
  function wy() {
11678
- return [...Wn.values()].sort(
11684
+ return [...Hn.values()].sort(
11679
11685
  (e, t) => e.label.localeCompare(t.label)
11680
11686
  );
11681
11687
  }
@@ -11683,7 +11689,7 @@ function Sy(e, t = {}) {
11683
11689
  const n = t.target ?? "jsx-tailwind", r = t.purpose ?? "export", o = yy(t.limits), i = rf(
11684
11690
  e,
11685
11691
  t.frame
11686
- ), { document: a } = i, l = [...i.diagnostics], c = Wn.get(n);
11692
+ ), { document: a } = i, l = [...i.diagnostics], c = Hn.get(n);
11687
11693
  if (c || l.push({
11688
11694
  severity: "error",
11689
11695
  stage: "generate",
@@ -12114,7 +12120,7 @@ function Ly(e) {
12114
12120
  n.warnings.length > 0 && t.add(n.frameId);
12115
12121
  return t;
12116
12122
  }
12117
- function Ln(e) {
12123
+ function Dn(e) {
12118
12124
  return [...new Set([...e].filter(Boolean))].sort(
12119
12125
  (t, n) => t.localeCompare(n)
12120
12126
  );
@@ -12149,7 +12155,7 @@ function af(e, t) {
12149
12155
  const u = /* @__PURE__ */ new Map();
12150
12156
  for (const M of e.sourceGroups) {
12151
12157
  if (!M.shared) continue;
12152
- const W = Ln(
12158
+ const W = Dn(
12153
12159
  M.nodeIds.flatMap(
12154
12160
  (ee) => (a.get(ee) ?? []).map((q) => q.frameId)
12155
12161
  )
@@ -12232,10 +12238,10 @@ function af(e, t) {
12232
12238
  aliasScreenIds: ee.screenIds.filter(
12233
12239
  (ne) => ne !== ee.canonicalScreenId
12234
12240
  ),
12235
- relatedFrameIds: Ln(
12241
+ relatedFrameIds: Dn(
12236
12242
  u.get(W) ?? []
12237
12243
  ).filter((ne) => ne !== M.frameId),
12238
- branchTargetFrameIds: Ln(
12244
+ branchTargetFrameIds: Dn(
12239
12245
  [...b.get(W) ?? []].map(
12240
12246
  (ne) => {
12241
12247
  var ie;
@@ -12261,7 +12267,7 @@ function af(e, t) {
12261
12267
  aliasScreenIds: M.screenIds.filter(
12262
12268
  (ee) => ee !== M.canonicalScreenId
12263
12269
  ),
12264
- aliasFrameIds: Ln(
12270
+ aliasFrameIds: Dn(
12265
12271
  M.screenIds.filter((ee) => ee !== M.canonicalScreenId).map((ee) => {
12266
12272
  var q;
12267
12273
  return (q = i.get(ee)) == null ? void 0 : q.frameId;
@@ -12271,21 +12277,21 @@ function af(e, t) {
12271
12277
  }).sort((M, W) => M.nodeId.localeCompare(W.nodeId)), N = e.sourceGroups.filter((M) => M.shared).map((M) => ({
12272
12278
  sourceKey: M.sourceKey,
12273
12279
  nodeIds: M.nodeIds,
12274
- frameIds: Ln(
12280
+ frameIds: Dn(
12275
12281
  M.nodeIds.flatMap(
12276
12282
  (W) => (a.get(W) ?? []).map((ee) => ee.frameId)
12277
12283
  )
12278
12284
  )
12279
12285
  })).sort((M, W) => M.sourceKey.localeCompare(W.sourceKey)), T = new Set(
12280
12286
  H.flatMap((M) => M.warnings)
12281
- ), j = Ln(
12287
+ ), j = Dn(
12282
12288
  e.startNodeIds.map(
12283
12289
  (M) => {
12284
12290
  var W;
12285
12291
  return (W = c.get(M)) == null ? void 0 : W.frameId;
12286
12292
  }
12287
12293
  )
12288
- ), k = Ln(
12294
+ ), k = Dn(
12289
12295
  e.branches.map(
12290
12296
  (M) => {
12291
12297
  var W;
@@ -13624,7 +13630,7 @@ const ov = We(function({
13624
13630
  "data-coverage-claim": r.scenarioId,
13625
13631
  "data-coverage-kind": r.kind,
13626
13632
  disabled: o,
13627
- title: o ? On : r.reason ?? Mc(r),
13633
+ title: o ? Bn : r.reason ?? Mc(r),
13628
13634
  className: "flex h-7 items-center justify-between gap-2 rounded-md bg-[#fafafa] px-2 text-left ring-1 ring-inset ring-[#ececec] hover:bg-[#f0f7ff] disabled:cursor-not-allowed disabled:opacity-45 disabled:hover:bg-[#fafafa]",
13629
13635
  onClick: () => {
13630
13636
  Gy(r);
@@ -13915,7 +13921,7 @@ const cv = We(function({
13915
13921
  { v: "fit", label: "Hug" },
13916
13922
  { v: "fixed", label: "Fixed" }
13917
13923
  ];
13918
- function vt({ label: e, value: t }) {
13924
+ function wt({ label: e, value: t }) {
13919
13925
  return /* @__PURE__ */ g("div", { className: "flex items-baseline justify-between gap-2 text-[11px]", children: [
13920
13926
  /* @__PURE__ */ s("span", { className: "shrink-0 text-[#999]", children: e }),
13921
13927
  /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-right text-[#333]", title: t, children: t })
@@ -13930,32 +13936,32 @@ const mv = We(function({
13930
13936
  const n = t.type === "component" ? Ze()[t.componentName] : void 0, r = Object.entries(t.componentProps ?? {});
13931
13937
  return /* @__PURE__ */ g("div", { "data-read-only-inspector": "node", className: "min-h-0 flex-1 overflow-auto", children: [
13932
13938
  /* @__PURE__ */ g(Fe, { title: t.name, children: [
13933
- /* @__PURE__ */ s(vt, { label: "Type", value: t.type }),
13934
- t.domTag && /* @__PURE__ */ s(vt, { label: "Tag", value: t.domTag }),
13935
- /* @__PURE__ */ s(vt, { label: "Width", value: kc(t.widthMode, t.width) }),
13936
- /* @__PURE__ */ s(vt, { label: "Height", value: kc(t.heightMode, t.height) }),
13937
- t.type === "text" && t.text && /* @__PURE__ */ s(vt, { label: "Text", value: t.text })
13939
+ /* @__PURE__ */ s(wt, { label: "Type", value: t.type }),
13940
+ t.domTag && /* @__PURE__ */ s(wt, { label: "Tag", value: t.domTag }),
13941
+ /* @__PURE__ */ s(wt, { label: "Width", value: kc(t.widthMode, t.width) }),
13942
+ /* @__PURE__ */ s(wt, { label: "Height", value: kc(t.heightMode, t.height) }),
13943
+ t.type === "text" && t.text && /* @__PURE__ */ s(wt, { label: "Text", value: t.text })
13938
13944
  ] }),
13939
13945
  n && /* @__PURE__ */ g(Fe, { title: "Component", children: [
13940
- /* @__PURE__ */ s(vt, { label: "Name", value: t.componentName }),
13941
- r.map(([o, i]) => /* @__PURE__ */ s(vt, { label: o, value: String(i) }, o))
13946
+ /* @__PURE__ */ s(wt, { label: "Name", value: t.componentName }),
13947
+ r.map(([o, i]) => /* @__PURE__ */ s(wt, { label: o, value: String(i) }, o))
13942
13948
  ] }),
13943
- t.sourceComponent && /* @__PURE__ */ s(Fe, { title: "Source", children: /* @__PURE__ */ s(vt, { label: "Component", value: t.sourceComponent }) })
13949
+ t.sourceComponent && /* @__PURE__ */ s(Fe, { title: "Source", children: /* @__PURE__ */ s(wt, { label: "Component", value: t.sourceComponent }) })
13944
13950
  ] });
13945
13951
  }), gv = We(function({
13946
13952
  section: t,
13947
13953
  members: n
13948
13954
  }) {
13949
13955
  return /* @__PURE__ */ s("div", { "data-read-only-inspector": "section", className: "min-h-0 flex-1 overflow-auto", children: /* @__PURE__ */ g(Fe, { title: "Section", children: [
13950
- /* @__PURE__ */ s(vt, { label: "Name", value: t.name }),
13956
+ /* @__PURE__ */ s(wt, { label: "Name", value: t.name }),
13951
13957
  /* @__PURE__ */ s(
13952
- vt,
13958
+ wt,
13953
13959
  {
13954
13960
  label: "Bounds",
13955
13961
  value: `${Math.round(t.x)}, ${Math.round(t.y)} · ${Math.round(t.width)} × ${Math.round(t.height)}`
13956
13962
  }
13957
13963
  ),
13958
- /* @__PURE__ */ s(vt, { label: "Frames", value: String(n) })
13964
+ /* @__PURE__ */ s(wt, { label: "Frames", value: String(n) })
13959
13965
  ] }) });
13960
13966
  });
13961
13967
  function bv({ node: e }) {
@@ -14303,16 +14309,16 @@ const Sv = We(function({ page: t }) {
14303
14309
  onChange: (b) => r({ name: b.target.value })
14304
14310
  }
14305
14311
  ) }) : /* @__PURE__ */ s("div", { "data-read-only-inspector": "frame", children: /* @__PURE__ */ g(Fe, { title: "Frame", children: [
14306
- /* @__PURE__ */ s(vt, { label: "Name", value: t.name }),
14312
+ /* @__PURE__ */ s(wt, { label: "Name", value: t.name }),
14307
14313
  /* @__PURE__ */ s(
14308
- vt,
14314
+ wt,
14309
14315
  {
14310
14316
  label: "Size",
14311
14317
  value: `${Math.round(t.width ?? 390)} × ${Math.round(t.height ?? 600)}`
14312
14318
  }
14313
14319
  ),
14314
- t.route && /* @__PURE__ */ s(vt, { label: "Route", value: t.route }),
14315
- t.section && /* @__PURE__ */ s(vt, { label: "Section", value: t.section })
14320
+ t.route && /* @__PURE__ */ s(wt, { label: "Route", value: t.route }),
14321
+ t.section && /* @__PURE__ */ s(wt, { label: "Section", value: t.section })
14316
14322
  ] }) }),
14317
14323
  /* @__PURE__ */ g(Fe, { title: "Preview", children: [
14318
14324
  /* @__PURE__ */ g("div", { className: "flex gap-1.5", children: [
@@ -15063,8 +15069,8 @@ function Lv(e, t = {}) {
15063
15069
  }
15064
15070
  return { run: w, cancel: v };
15065
15071
  }
15066
- const Lc = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", Dv = 600, dn = 200, en = 280, zv = 480, ps = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", Vr = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
15067
- function Dn({
15072
+ const Lc = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", Dv = 600, un = 200, en = 280, zv = 480, ps = "absolute bottom-11 left-1/2 z-40 w-44 -translate-x-1/2 rounded-xl bg-[#1e1e1e] p-1.5 text-[12px] shadow-[0_4px_20px_rgba(0,0,0,.25)]", Vr = (e) => `flex h-9 w-9 items-center justify-center rounded-lg ${e ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
15073
+ function zn({
15068
15074
  icon: e,
15069
15075
  label: t,
15070
15076
  shortcut: n,
@@ -15101,12 +15107,12 @@ const _v = We(function({
15101
15107
  se(() => i, []);
15102
15108
  const a = Qe(
15103
15109
  Uc,
15104
- Gn,
15105
- Gn
15110
+ Xn,
15111
+ Xn
15106
15112
  ), l = Qe(
15107
15113
  ha,
15108
- bn,
15109
- bn
15114
+ xn,
15115
+ xn
15110
15116
  );
15111
15117
  Qe(
15112
15118
  za,
@@ -15131,17 +15137,17 @@ const _v = We(function({
15131
15137
  x: F.x ?? 0,
15132
15138
  y: F.y ?? 0,
15133
15139
  width: F.width ?? 390,
15134
- height: fn(F)
15135
- })) : [], m = f.pages.filter((F) => F.route != null).sort((F, ce) => {
15140
+ height: hn(F)
15141
+ })) : [], m = f.pages.filter((F) => F.route != null).sort((F, de) => {
15136
15142
  if (F.id === f.activePageId) return -1;
15137
- if (ce.id === f.activePageId) return 1;
15138
- const re = (F.canvas ?? "default") === f.activeCanvas, Ee = (ce.canvas ?? "default") === f.activeCanvas;
15143
+ if (de.id === f.activePageId) return 1;
15144
+ const re = (F.canvas ?? "default") === f.activeCanvas, Ee = (de.canvas ?? "default") === f.activeCanvas;
15139
15145
  return re !== Ee ? re ? -1 : 1 : 0;
15140
- }), b = m.map((F) => jt(F, a)), x = [
15146
+ }), b = m.map((F) => Wt(F, a)), x = [
15141
15147
  ...new Set(
15142
15148
  m.flatMap((F) => [
15143
- jt(F, a),
15144
- jt(
15149
+ Wt(F, a),
15150
+ Wt(
15145
15151
  F,
15146
15152
  a,
15147
15153
  F.authoredFrameSize ?? {
@@ -15166,9 +15172,9 @@ const _v = We(function({
15166
15172
  se(() => {
15167
15173
  var Oe;
15168
15174
  if (!t || !$ || typeof document > "u") return;
15169
- const F = Vn();
15175
+ const F = Kn();
15170
15176
  if (!F) return;
15171
- const ce = Xt(), re = n.current, Ee = re ? {
15177
+ const de = Gt(), re = n.current, Ee = re ? {
15172
15178
  panX: f.panX,
15173
15179
  panY: f.panY,
15174
15180
  zoom: f.zoom,
@@ -15177,19 +15183,19 @@ const _v = We(function({
15177
15183
  } : null, O = new Map(f.pages.map((B) => [B.id, B])), ve = [];
15178
15184
  for (const B of f.pages) {
15179
15185
  if (B.route == null || B.layersImported || fo(B.importPageId ?? B.id)) continue;
15180
- const K = jt(B, a), ke = B.width ?? 390, J = fn(B), je = (((Oe = B.interactions) == null ? void 0 : Oe.length) ?? 0) > 0, Ne = B.importPageId ?? B.id, ze = Va(
15186
+ const K = Wt(B, a), ke = B.width ?? 390, J = hn(B), je = (((Oe = B.interactions) == null ? void 0 : Oe.length) ?? 0) > 0, Ne = B.importPageId ?? B.id, ze = Va(
15181
15187
  {
15182
15188
  canonicalId: Ne,
15183
15189
  route: B.route,
15184
15190
  width: B.width,
15185
15191
  height: B.height,
15186
- environment: gn(B),
15192
+ environment: bn(B),
15187
15193
  preset: B.preset,
15188
15194
  interactions: B.interactions,
15189
15195
  assertions: B.assertions
15190
15196
  },
15191
15197
  a,
15192
- ce
15198
+ de
15193
15199
  );
15194
15200
  ve.push({
15195
15201
  pageId: B.id,
@@ -15200,7 +15206,7 @@ const _v = We(function({
15200
15206
  }) ? ja({
15201
15207
  origin: l,
15202
15208
  route: B.route,
15203
- environment: gn(B),
15209
+ environment: bn(B),
15204
15210
  width: ke,
15205
15211
  height: J
15206
15212
  }) : null,
@@ -15214,22 +15220,22 @@ const _v = We(function({
15214
15220
  });
15215
15221
  }
15216
15222
  const we = Ev(ve, {
15217
- hasSnapshot: Xn
15223
+ hasSnapshot: Jn
15218
15224
  }), Q = Ha(), ge = Lv({
15219
15225
  leaseInstance: async (B) => {
15220
15226
  const K = O.get(B.pageId);
15221
15227
  if (!K || K.route == null) return null;
15222
- const ke = K.width ?? 390, J = fn(K), je = mr(
15228
+ const ke = K.width ?? 390, J = hn(K), je = mr(
15223
15229
  l,
15224
15230
  K.route,
15225
15231
  Lt(
15226
- ce,
15227
- gn(K)
15232
+ de,
15233
+ bn(K)
15228
15234
  )
15229
15235
  );
15230
15236
  if (B.groupKey != null) {
15231
- const $e = B.groupKey, Se = await Q.lease({
15232
- key: $e,
15237
+ const Pe = B.groupKey, Se = await Q.lease({
15238
+ key: Pe,
15233
15239
  url: je,
15234
15240
  width: ke,
15235
15241
  height: J
@@ -15240,25 +15246,25 @@ const _v = We(function({
15240
15246
  iframe: Se.iframe,
15241
15247
  release: () => Se.release(),
15242
15248
  discard: () => {
15243
- Q.discard($e), Se.release();
15249
+ Q.discard(Pe), Se.release();
15244
15250
  }
15245
15251
  };
15246
15252
  }
15247
15253
  const Ne = document.createElement("iframe");
15248
15254
  Ne.setAttribute("tabindex", "-1"), Ne.setAttribute("aria-hidden", "true"), Ne.setAttribute("data-pygmalion-sweep-instance", ""), Ne.style.position = "fixed", Ne.style.top = "0", Ne.style.left = "-20000px", Ne.style.border = "0", Ne.style.pointerEvents = "none", Ne.style.width = `${Math.round(ke)}px`, Ne.style.height = `${Math.round(J)}px`, document.body.appendChild(Ne);
15249
15255
  try {
15250
- await new Promise(($e, Se) => {
15251
- const Pe = () => {
15256
+ await new Promise((Pe, Se) => {
15257
+ const $e = () => {
15252
15258
  Ne.removeEventListener("load", Ce), Ne.removeEventListener("error", Ke);
15253
15259
  }, Ce = () => {
15254
- Pe(), $e();
15260
+ $e(), Pe();
15255
15261
  }, Ke = () => {
15256
- Pe(), Se(new Error(`The sweep preview failed to load ${je}.`));
15262
+ $e(), Se(new Error(`The sweep preview failed to load ${je}.`));
15257
15263
  };
15258
15264
  Ne.addEventListener("load", Ce), Ne.addEventListener("error", Ke), Ne.src = je;
15259
15265
  });
15260
- } catch ($e) {
15261
- throw Ne.remove(), $e;
15266
+ } catch (Pe) {
15267
+ throw Ne.remove(), Pe;
15262
15268
  }
15263
15269
  let ze = !1;
15264
15270
  const tt = () => {
@@ -15301,8 +15307,8 @@ const _v = We(function({
15301
15307
  const B = f.pages.find(
15302
15308
  (K) => K.id === f.activePageId
15303
15309
  );
15304
- return !B || B.route == null ? !1 : B.importLayers && !B.layersImported ? !0 : !B.layersImported && !Xn(
15305
- jt(B, a)
15310
+ return !B || B.route == null ? !1 : B.importLayers && !B.layersImported ? !0 : !B.layersImported && !Jn(
15311
+ Wt(B, a)
15306
15312
  );
15307
15313
  }
15308
15314
  });
@@ -15332,10 +15338,10 @@ const _v = We(function({
15332
15338
  se(() => {
15333
15339
  if (!t || !$) return;
15334
15340
  const F = setTimeout(() => {
15335
- const ce = f.pages.find(
15341
+ const de = f.pages.find(
15336
15342
  (re) => re.id === N
15337
15343
  );
15338
- ce && au(ce, a);
15344
+ de && au(de, a);
15339
15345
  }, Dv);
15340
15346
  return () => clearTimeout(F);
15341
15347
  }, [
@@ -15346,9 +15352,9 @@ const _v = We(function({
15346
15352
  ]);
15347
15353
  const [T, j] = Y(!1), [k, z] = Y(null), [Z, M] = Y("layers"), [W, ee] = Y("story"), [q, Me] = Y(null), oe = Object.keys(Ze()), fe = f.canAddFrame, ne = f.editMode, ie = (F) => {
15348
15354
  f.setTool(F), Me(null);
15349
- }, [P, E] = Y(!0), [I, V] = Y(!0), [ae, xe] = Y(en), [Re, de] = Y(en), Le = Ie(!1), De = (F) => {
15350
- const ce = f.pages.find((we) => we.id === F), re = n.current;
15351
- if (!ce || !re) {
15355
+ }, [P, E] = Y(!0), [I, V] = Y(!0), [ae, xe] = Y(en), [Re, le] = Y(en), Le = Ie(!1), De = (F) => {
15356
+ const de = f.pages.find((we) => we.id === F), re = n.current;
15357
+ if (!de || !re) {
15352
15358
  f.selectFrame(F);
15353
15359
  return;
15354
15360
  }
@@ -15360,11 +15366,11 @@ const _v = We(function({
15360
15366
  insetTop: 12,
15361
15367
  insetBottom: 64
15362
15368
  }, O = {
15363
- x: ce.x ?? 0,
15364
- y: ce.y ?? 0,
15365
- width: ce.width ?? 390,
15366
- height: fn(ce)
15367
- }, ve = (ce.canvas ?? "default") === f.activeCanvas ? Uh(O, Ee, {
15369
+ x: de.x ?? 0,
15370
+ y: de.y ?? 0,
15371
+ width: de.width ?? 390,
15372
+ height: hn(de)
15373
+ }, ve = (de.canvas ?? "default") === f.activeCanvas ? Uh(O, Ee, {
15368
15374
  panX: f.panX,
15369
15375
  panY: f.panY,
15370
15376
  zoom: f.zoom
@@ -15377,7 +15383,7 @@ const _v = We(function({
15377
15383
  se(() => {
15378
15384
  const F = n.current;
15379
15385
  if (!F) return;
15380
- const ce = (re) => {
15386
+ const de = (re) => {
15381
15387
  const Ee = ey(re);
15382
15388
  if (Ee !== "native-preview") {
15383
15389
  if (Ee === "programmatic-preview") {
@@ -15391,7 +15397,7 @@ const _v = We(function({
15391
15397
  f.panBy(-re.deltaX, -re.deltaY);
15392
15398
  }
15393
15399
  };
15394
- return F.addEventListener("wheel", ce, { passive: !1 }), () => F.removeEventListener("wheel", ce);
15400
+ return F.addEventListener("wheel", de, { passive: !1 }), () => F.removeEventListener("wheel", de);
15395
15401
  }, []), se(() => {
15396
15402
  const F = () => {
15397
15403
  const O = n.current;
@@ -15402,7 +15408,7 @@ const _v = We(function({
15402
15408
  if (!ve.length) return;
15403
15409
  const we = Math.min(...ve.map((J) => J.x ?? 0)), Q = Math.min(...ve.map((J) => J.y ?? 0)), ge = Math.max(...ve.map((J) => (J.x ?? 0) + (J.width ?? 390))), Oe = Math.max(...ve.map((J) => (J.y ?? 0) + (J.height ?? 600))), B = ge - we, K = Oe - Q, ke = Math.max(0.25, Math.min((O.clientWidth - 120) / B, (O.clientHeight - 200) / K, 1.5));
15404
15410
  f.setZoom(ke), f.setPan((O.clientWidth - B * ke) / 2 - we * ke, (O.clientHeight - K * ke) / 2 - Q * ke);
15405
- }, ce = () => {
15411
+ }, de = () => {
15406
15412
  const O = n.current;
15407
15413
  if (!O) return;
15408
15414
  const ve = f.activePage, we = ve.width ?? 390, Q = ve.height ?? 600, ge = Math.max(0.25, Math.min((O.clientWidth - 560) / we, (O.clientHeight - 140) / Q));
@@ -15498,7 +15504,7 @@ const _v = We(function({
15498
15504
  return;
15499
15505
  }
15500
15506
  if (O.code === "Digit2") {
15501
- ce();
15507
+ de();
15502
15508
  return;
15503
15509
  }
15504
15510
  if (O.key === "Tab") {
@@ -15586,14 +15592,14 @@ const _v = We(function({
15586
15592
  window.removeEventListener("keydown", re), window.removeEventListener("keyup", Ee);
15587
15593
  };
15588
15594
  }, [I]);
15589
- const Ye = (F) => (ce) => {
15590
- ce.preventDefault();
15591
- const re = ce.clientX, Ee = F === "left" ? ae : Re, O = (we) => {
15595
+ const Ye = (F) => (de) => {
15596
+ de.preventDefault();
15597
+ const re = de.clientX, Ee = F === "left" ? ae : Re, O = (we) => {
15592
15598
  const Q = F === "left" ? we.clientX - re : re - we.clientX, ge = Math.max(
15593
- dn,
15599
+ un,
15594
15600
  Math.min(zv, Ee + Q)
15595
15601
  );
15596
- F === "left" ? xe(ge) : de(ge);
15602
+ F === "left" ? xe(ge) : le(ge);
15597
15603
  }, ve = () => {
15598
15604
  window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", ve);
15599
15605
  };
@@ -15628,11 +15634,11 @@ const _v = We(function({
15628
15634
  onPointerMove: (F) => {
15629
15635
  var ve;
15630
15636
  if (!Yx(f.editMode, f.tool)) return;
15631
- const ce = (ve = n.current) == null ? void 0 : ve.getBoundingClientRect();
15632
- if (!ce) return;
15637
+ const de = (ve = n.current) == null ? void 0 : ve.getBoundingClientRect();
15638
+ if (!de) return;
15633
15639
  const re = vc(
15634
15640
  p,
15635
- yc(F, ce, {
15641
+ yc(F, de, {
15636
15642
  panX: f.panX,
15637
15643
  panY: f.panY,
15638
15644
  zoom: f.zoom
@@ -15669,8 +15675,8 @@ const _v = We(function({
15669
15675
  onMouseDown: (F) => {
15670
15676
  var we;
15671
15677
  if (T || F.button !== 0) return;
15672
- const ce = n.current;
15673
- if ((F.metaKey || F.ctrlKey) && ce) {
15678
+ const de = n.current;
15679
+ if ((F.metaKey || F.ctrlKey) && de) {
15674
15680
  const Q = { x: F.clientX, y: F.clientY, px: f.panX, py: f.panY }, ge = (B) => {
15675
15681
  Le.current = !0, f.setPan(Q.px + (B.clientX - Q.x), Q.py + (B.clientY - Q.y));
15676
15682
  }, Oe = () => {
@@ -15728,13 +15734,13 @@ const _v = We(function({
15728
15734
  window.addEventListener("mousemove", O), window.addEventListener("mouseup", ve);
15729
15735
  },
15730
15736
  onClick: (F) => {
15731
- var ce;
15737
+ var de;
15732
15738
  if (Le.current) {
15733
15739
  Le.current = !1;
15734
15740
  return;
15735
15741
  }
15736
15742
  if (!f.editMode) {
15737
- const re = (ce = n.current) == null ? void 0 : ce.getBoundingClientRect(), Ee = re ? vc(
15743
+ const re = (de = n.current) == null ? void 0 : de.getBoundingClientRect(), Ee = re ? vc(
15738
15744
  p,
15739
15745
  yc(F, re, {
15740
15746
  panX: f.panX,
@@ -15764,13 +15770,13 @@ const _v = We(function({
15764
15770
  f.pages.filter(
15765
15771
  (F) => (F.route != null || (F.canvas ?? "default") === f.activeCanvas) && f.isScreenStateShown(F)
15766
15772
  ).map((F) => {
15767
- var ce;
15773
+ var de;
15768
15774
  return /* @__PURE__ */ s(
15769
15775
  ex,
15770
15776
  {
15771
15777
  page: F,
15772
15778
  active: F.id === f.activePageId,
15773
- selected: ((ce = f.selectedCanvasObject) == null ? void 0 : ce.kind) === "frame" && f.selectedCanvasObject.id === F.id,
15779
+ selected: ((de = f.selectedCanvasObject) == null ? void 0 : de.kind) === "frame" && f.selectedCanvasObject.id === F.id,
15774
15780
  cacheHydrated: $,
15775
15781
  previewIdentityReady: t,
15776
15782
  backgroundOnly: (F.canvas ?? "default") !== f.activeCanvas
@@ -15810,10 +15816,10 @@ const _v = We(function({
15810
15816
  {
15811
15817
  type: "button",
15812
15818
  "aria-label": "Minimum left panel width",
15813
- "aria-pressed": ae === dn,
15814
- title: `Minimum width · ${dn}px`,
15815
- className: `h-5 rounded px-1.5 text-[8px] font-semibold ${ae === dn ? "bg-white text-[#333] shadow-sm" : "text-[#888] hover:text-[#333]"}`,
15816
- onClick: () => xe(dn),
15819
+ "aria-pressed": ae === un,
15820
+ title: `Minimum width · ${un}px`,
15821
+ className: `h-5 rounded px-1.5 text-[8px] font-semibold ${ae === un ? "bg-white text-[#333] shadow-sm" : "text-[#888] hover:text-[#333]"}`,
15822
+ onClick: () => xe(un),
15817
15823
  children: "Min"
15818
15824
  }
15819
15825
  ),
@@ -15846,13 +15852,13 @@ const _v = We(function({
15846
15852
  /* @__PURE__ */ s("div", { className: "mt-2 flex gap-3", children: [
15847
15853
  ["layers", "Layers"],
15848
15854
  ["assets", "Assets"]
15849
- ].map(([F, ce]) => /* @__PURE__ */ s(
15855
+ ].map(([F, de]) => /* @__PURE__ */ s(
15850
15856
  "button",
15851
15857
  {
15852
15858
  type: "button",
15853
15859
  className: `border-b-2 pb-1.5 text-[11px] ${Z === F ? "border-[#0d99ff] font-semibold text-[#333]" : "border-transparent text-[#999] hover:text-[#333]"}`,
15854
15860
  onClick: () => M(F),
15855
- children: ce
15861
+ children: de
15856
15862
  },
15857
15863
  F
15858
15864
  )) })
@@ -15906,7 +15912,7 @@ const _v = We(function({
15906
15912
  {
15907
15913
  type: "button",
15908
15914
  "aria-pressed": !f.editMode,
15909
- title: f.editMode ? "Editing — click to switch to view only" : `${On} Click to start editing.`,
15915
+ title: f.editMode ? "Editing — click to switch to view only" : `${Bn} Click to start editing.`,
15910
15916
  className: `flex h-7 items-center gap-1 rounded-lg px-3 text-[11px] ${f.editMode ? "bg-[#f5f5f5] text-[#333] hover:bg-[#ececec]" : "bg-amber-500 font-semibold text-white hover:bg-amber-600"}`,
15911
15917
  onClick: () => f.toggleEditMode(),
15912
15918
  children: [
@@ -15928,7 +15934,7 @@ const _v = We(function({
15928
15934
  {
15929
15935
  type: "button",
15930
15936
  disabled: !f.editMode,
15931
- title: f.editMode ? "Apply changes" : On,
15937
+ title: f.editMode ? "Apply changes" : Bn,
15932
15938
  className: "h-7 rounded-lg bg-[#0d99ff] px-3 text-[11px] font-semibold text-white hover:bg-[#0b87e0] disabled:cursor-not-allowed disabled:bg-[#e6e6e6] disabled:text-[#999]",
15933
15939
  onClick: () => f.setApplyOpen(!0),
15934
15940
  children: "Apply"
@@ -15955,7 +15961,7 @@ const _v = We(function({
15955
15961
  {
15956
15962
  type: "button",
15957
15963
  "aria-pressed": !f.editMode,
15958
- title: f.editMode ? "Editing — click to switch to view only" : `${On} Click to start editing.`,
15964
+ title: f.editMode ? "Editing — click to switch to view only" : `${Bn} Click to start editing.`,
15959
15965
  className: `flex h-7 items-center gap-1 rounded-lg px-2.5 text-[11px] ${f.editMode ? "bg-[#f5f5f5] text-[#333] hover:bg-[#ececec]" : "bg-amber-500 font-semibold text-white hover:bg-amber-600"}`,
15960
15966
  onClick: () => f.toggleEditMode(),
15961
15967
  children: [
@@ -16000,7 +16006,7 @@ const _v = We(function({
16000
16006
  {
16001
16007
  type: "button",
16002
16008
  disabled: !f.editMode,
16003
- title: f.editMode ? "Apply changes" : On,
16009
+ title: f.editMode ? "Apply changes" : Bn,
16004
16010
  className: "h-7 rounded-lg bg-[#0d99ff] px-3 text-[11px] font-semibold text-white hover:bg-[#0b87e0] disabled:cursor-not-allowed disabled:bg-[#e6e6e6] disabled:text-[#999]",
16005
16011
  onClick: () => f.setApplyOpen(!0),
16006
16012
  children: "Apply"
@@ -16016,10 +16022,10 @@ const _v = We(function({
16016
16022
  {
16017
16023
  type: "button",
16018
16024
  "aria-label": "Minimum right panel width",
16019
- "aria-pressed": Re === dn,
16020
- title: `Minimum panel width · ${dn}px`,
16021
- className: `flex h-5 w-5 items-center justify-center rounded text-[10px] ${Re === dn ? "bg-[#f2f2f2] text-[#333]" : "text-[#999] hover:bg-[#f5f5f5]"}`,
16022
- onClick: () => de(dn),
16025
+ "aria-pressed": Re === un,
16026
+ title: `Minimum panel width · ${un}px`,
16027
+ className: `flex h-5 w-5 items-center justify-center rounded text-[10px] ${Re === un ? "bg-[#f2f2f2] text-[#333]" : "text-[#999] hover:bg-[#f5f5f5]"}`,
16028
+ onClick: () => le(un),
16023
16029
  children: "−"
16024
16030
  }
16025
16031
  ),
@@ -16031,7 +16037,7 @@ const _v = We(function({
16031
16037
  "aria-pressed": Re === en,
16032
16038
  title: `Default panel width · ${en}px`,
16033
16039
  className: `flex h-5 w-5 items-center justify-center rounded text-[10px] ${Re === en ? "bg-[#f2f2f2] text-[#333]" : "text-[#999] hover:bg-[#f5f5f5]"}`,
16034
- onClick: () => de(en),
16040
+ onClick: () => le(en),
16035
16041
  children: "↔"
16036
16042
  }
16037
16043
  ),
@@ -16127,9 +16133,9 @@ const _v = We(function({
16127
16133
  }
16128
16134
  ),
16129
16135
  q === "cursor" && /* @__PURE__ */ g("div", { className: ps, children: [
16130
- /* @__PURE__ */ s(Dn, { checked: f.tool === "select", icon: /* @__PURE__ */ s(Xl, { size: 14 }), label: "Move", shortcut: "V", onClick: () => ie("select") }),
16131
- /* @__PURE__ */ s(Dn, { checked: f.tool === "hand", icon: /* @__PURE__ */ s(Jl, { size: 14 }), label: "Hand", shortcut: "H", onClick: () => ie("hand") }),
16132
- /* @__PURE__ */ s(Dn, { checked: f.tool === "zoom", icon: /* @__PURE__ */ s(Ql, { size: 14 }), label: "Zoom in/out", shortcut: "K", onClick: () => ie("zoom") })
16136
+ /* @__PURE__ */ s(zn, { checked: f.tool === "select", icon: /* @__PURE__ */ s(Xl, { size: 14 }), label: "Move", shortcut: "V", onClick: () => ie("select") }),
16137
+ /* @__PURE__ */ s(zn, { checked: f.tool === "hand", icon: /* @__PURE__ */ s(Jl, { size: 14 }), label: "Hand", shortcut: "H", onClick: () => ie("hand") }),
16138
+ /* @__PURE__ */ s(zn, { checked: f.tool === "zoom", icon: /* @__PURE__ */ s(Ql, { size: 14 }), label: "Zoom in/out", shortcut: "K", onClick: () => ie("zoom") })
16133
16139
  ] })
16134
16140
  ] }),
16135
16141
  /* @__PURE__ */ g("div", { className: "relative flex items-center", children: [
@@ -16156,7 +16162,7 @@ const _v = We(function({
16156
16162
  ),
16157
16163
  q === "frame" && /* @__PURE__ */ g("div", { className: ps, children: [
16158
16164
  /* @__PURE__ */ s(
16159
- Dn,
16165
+ zn,
16160
16166
  {
16161
16167
  icon: /* @__PURE__ */ s(Zs, { size: 14 }),
16162
16168
  label: fe ? "Frame" : "Frame — screen canvas only",
@@ -16166,7 +16172,7 @@ const _v = We(function({
16166
16172
  }
16167
16173
  }
16168
16174
  ),
16169
- /* @__PURE__ */ s(Dn, { checked: f.tool === "section", icon: /* @__PURE__ */ s(mi, { size: 14 }), label: "Section", shortcut: "⇧S", onClick: () => ie("section") })
16175
+ /* @__PURE__ */ s(zn, { checked: f.tool === "section", icon: /* @__PURE__ */ s(mi, { size: 14 }), label: "Section", shortcut: "⇧S", onClick: () => ie("section") })
16170
16176
  ] })
16171
16177
  ] }),
16172
16178
  /* @__PURE__ */ s("span", { className: "mx-1 h-5 w-px bg-[#e6e6e6]" }),
@@ -16175,7 +16181,7 @@ const _v = We(function({
16175
16181
  "button",
16176
16182
  {
16177
16183
  type: "button",
16178
- title: ne ? "Add Rows (F)" : On,
16184
+ title: ne ? "Add Rows (F)" : Bn,
16179
16185
  "aria-label": "Add Rows",
16180
16186
  disabled: !ne,
16181
16187
  className: `${Vr(!1)} disabled:cursor-not-allowed disabled:text-[#c9c9c9] disabled:hover:bg-transparent`,
@@ -16195,7 +16201,7 @@ const _v = We(function({
16195
16201
  ),
16196
16202
  q === "layout" && /* @__PURE__ */ g("div", { className: ps, children: [
16197
16203
  /* @__PURE__ */ s(
16198
- Dn,
16204
+ zn,
16199
16205
  {
16200
16206
  icon: /* @__PURE__ */ s(gi, { size: 14 }),
16201
16207
  label: "Rows",
@@ -16207,7 +16213,7 @@ const _v = We(function({
16207
16213
  }
16208
16214
  ),
16209
16215
  /* @__PURE__ */ s(
16210
- Dn,
16216
+ zn,
16211
16217
  {
16212
16218
  icon: /* @__PURE__ */ s(Ya, { size: 14 }),
16213
16219
  label: "Columns",
@@ -16223,7 +16229,7 @@ const _v = We(function({
16223
16229
  "button",
16224
16230
  {
16225
16231
  type: "button",
16226
- title: ne ? "Add Text (T)" : On,
16232
+ title: ne ? "Add Text (T)" : Bn,
16227
16233
  "aria-label": "Add text",
16228
16234
  disabled: !ne,
16229
16235
  className: `${Vr(!1)} disabled:cursor-not-allowed disabled:text-[#c9c9c9] disabled:hover:bg-transparent`,
@@ -16297,7 +16303,7 @@ function Wv(e, t, n, r = Ov) {
16297
16303
  const o = /* @__PURE__ */ new Map();
16298
16304
  return e.forEach((i, a) => {
16299
16305
  if (!Wa(i)) return;
16300
- const l = i.width ?? 390, c = fn(i), d = ja({
16306
+ const l = i.width ?? 390, c = hn(i), d = ja({
16301
16307
  origin: t,
16302
16308
  route: i.route ?? "",
16303
16309
  environment: i.environment,
@@ -16570,7 +16576,7 @@ function Gv(e) {
16570
16576
  S += 1;
16571
16577
  const ae = b(I.from, V, "source"), xe = b(I.to, V, "target");
16572
16578
  if (!ae || !xe || ae === xe) continue;
16573
- const Re = d(I.fromScope, ae), de = d(I.toScope, xe), Le = `${ae}\0${xe}`, De = w.get(Le);
16579
+ const Re = d(I.fromScope, ae), le = d(I.toScope, xe), Le = `${ae}\0${xe}`, De = w.get(Le);
16574
16580
  if (De) {
16575
16581
  const ot = {
16576
16582
  ...De,
@@ -16580,7 +16586,7 @@ function Gv(e) {
16580
16586
  ]),
16581
16587
  toNodeIds: ct([
16582
16588
  ...De.toNodeIds ?? [De.to],
16583
- ...de
16589
+ ...le
16584
16590
  ]),
16585
16591
  sourceEdgeIds: ct([
16586
16592
  ...De.sourceEdgeIds,
@@ -16597,7 +16603,7 @@ function Gv(e) {
16597
16603
  from: ae,
16598
16604
  to: xe,
16599
16605
  fromNodeIds: Re,
16600
- toNodeIds: de,
16606
+ toNodeIds: le,
16601
16607
  kind: ((ne = I.kind) == null ? void 0 : ne.trim()) || void 0,
16602
16608
  label: ((ie = I.label) == null ? void 0 : ie.trim()) || void 0,
16603
16609
  origin: P,
@@ -18083,7 +18089,7 @@ function s0(e = {}) {
18083
18089
  refs: [],
18084
18090
  defaultRef: null,
18085
18091
  worktreeRef: null
18086
- }), N = Ie(null), T = Ie(null), j = wt(
18092
+ }), N = Ie(null), T = Ie(null), j = St(
18087
18093
  async (I = !0, V) => {
18088
18094
  if (V != null && N.current && await N.current.catch(() => {
18089
18095
  }), N.current) return N.current;
@@ -18098,9 +18104,9 @@ function s0(e = {}) {
18098
18104
  } : {},
18099
18105
  ...I || xe ? {} : xs()
18100
18106
  });
18101
- let de = await tn(Re);
18102
- if (I || (de = await Pw({
18103
- initial: de,
18107
+ let le = await tn(Re);
18108
+ if (I || (le = await Pw({
18109
+ initial: le,
18104
18110
  fetchStatus: async () => tn(
18105
18111
  await o(`${a}/status`, xs())
18106
18112
  ),
@@ -18110,13 +18116,17 @@ function s0(e = {}) {
18110
18116
  ...xs(xf)
18111
18117
  })
18112
18118
  )
18113
- })), de.state !== "ready" || !de.appOrigin || !de.commit)
18114
- throw new Error(de.error ?? "Pygmalion could not prepare the source preview");
18119
+ })), le.state === "idle" && !le.error) {
18120
+ w(le);
18121
+ return;
18122
+ }
18123
+ if (le.state !== "ready" || !le.appOrigin || !le.commit)
18124
+ throw new Error(le.error ?? "Pygmalion could not prepare the source preview");
18115
18125
  const Le = await tn(
18116
18126
  await o(`${l}/open`, {
18117
18127
  method: "POST",
18118
18128
  headers: { "content-type": "application/json" },
18119
- body: JSON.stringify({ sessionId: b, baseDevSha: de.commit })
18129
+ body: JSON.stringify({ sessionId: b, baseDevSha: le.commit })
18120
18130
  })
18121
18131
  );
18122
18132
  if (!Le.ok || !Le.session)
@@ -18134,7 +18144,7 @@ function s0(e = {}) {
18134
18144
  throw new Error(Ye.error ?? "Pygmalion could not check the design session");
18135
18145
  De = Ye.session;
18136
18146
  }
18137
- w(de), S(De), R(De.appOrigin ?? de.appOrigin);
18147
+ w(le), S(De), R(De.appOrigin ?? le.appOrigin);
18138
18148
  } catch (xe) {
18139
18149
  w((Re) => ({
18140
18150
  ...Re,
@@ -18151,7 +18161,7 @@ function s0(e = {}) {
18151
18161
  }
18152
18162
  },
18153
18163
  [o, a, l, b]
18154
- ), k = wt(async () => {
18164
+ ), k = St(async () => {
18155
18165
  try {
18156
18166
  const I = await tn(
18157
18167
  await o(`${a}/refs`)
@@ -18164,7 +18174,7 @@ function s0(e = {}) {
18164
18174
  } catch {
18165
18175
  return H;
18166
18176
  }
18167
- }, [o, a, H]), z = wt(
18177
+ }, [o, a, H]), z = St(
18168
18178
  async (I, V) => {
18169
18179
  if (v != null && v.branchName && !(V != null && V.discardEdits))
18170
18180
  throw new Error(
@@ -18173,9 +18183,9 @@ function s0(e = {}) {
18173
18183
  await j(!0, I), await k();
18174
18184
  },
18175
18185
  [k, j, v == null ? void 0 : v.branchName]
18176
- ), Z = wt(
18186
+ ), Z = St(
18177
18187
  async (I) => {
18178
- var de;
18188
+ var le;
18179
18189
  if (!v) throw new Error("Pygmalion design session is not ready");
18180
18190
  const V = T.current;
18181
18191
  if (V && (V.sessionId !== v.id || V.baseDevSha !== v.baseDevSha || V.revision !== v.revision || V.fingerprint !== JSON.stringify(I)))
@@ -18198,7 +18208,7 @@ function s0(e = {}) {
18198
18208
  S(ae.session), ae.session.appOrigin && R(ae.session.appOrigin);
18199
18209
  const xe = ae.applied ?? I.styles.length + I.texts.length + I.operations.length;
18200
18210
  let Re;
18201
- if (V != null && V.qaBaselineId && ((de = V.qaFrameIds) != null && de.length) && ae.session.appOrigin)
18211
+ if (V != null && V.qaBaselineId && ((le = V.qaFrameIds) != null && le.length) && ae.session.appOrigin)
18202
18212
  try {
18203
18213
  Re = await Hc(o, u, {
18204
18214
  phase: "changed",
@@ -18225,9 +18235,9 @@ function s0(e = {}) {
18225
18235
  };
18226
18236
  },
18227
18237
  [o, i, u, v, l]
18228
- ), M = wt(
18238
+ ), M = St(
18229
18239
  async (I) => {
18230
- var de;
18240
+ var le;
18231
18241
  if (!v) throw new Error("Pygmalion design session is not ready");
18232
18242
  T.current = null;
18233
18243
  const V = await tn(
@@ -18256,7 +18266,7 @@ function s0(e = {}) {
18256
18266
  frameIds: ae
18257
18267
  }), !xe.complete)
18258
18268
  throw new Error(
18259
- ((de = xe.failures[0]) == null ? void 0 : de.error) ?? `Failed to capture ${ae.length - xe.frames.length} affected frames`
18269
+ ((le = xe.failures[0]) == null ? void 0 : le.error) ?? `Failed to capture ${ae.length - xe.frames.length} affected frames`
18260
18270
  );
18261
18271
  }
18262
18272
  return T.current = {
@@ -18281,7 +18291,7 @@ function s0(e = {}) {
18281
18291
  l,
18282
18292
  d
18283
18293
  ]
18284
- ), W = wt(
18294
+ ), W = St(
18285
18295
  async (I) => {
18286
18296
  if (I.length === 0) return { files: [] };
18287
18297
  const V = await tn(
@@ -18296,7 +18306,7 @@ function s0(e = {}) {
18296
18306
  return { files: Array.isArray(V.files) ? V.files : [] };
18297
18307
  },
18298
18308
  [o, c]
18299
- ), ee = wt(async () => {
18309
+ ), ee = St(async () => {
18300
18310
  if (!(v != null && v.canRevert) || !v.headSha)
18301
18311
  throw new Error("There are no reversible changes applied");
18302
18312
  const I = await tn(
@@ -18623,15 +18633,15 @@ function f0({
18623
18633
  V,
18624
18634
  E
18625
18635
  ]
18626
- ), [xe, Re] = Y(null), de = xe === ae;
18627
- yf = de;
18636
+ ), [xe, Re] = Y(null), le = xe === ae;
18637
+ yf = le;
18628
18638
  const [Le, De] = Y();
18629
18639
  c && (c.assertComplete(), Jh(c));
18630
18640
  const Ye = e ?? (c == null ? void 0 : c.getRegistry()), ot = t ?? (c == null ? void 0 : c.getTokens()), F = n ?? (c == null ? void 0 : c.getInitialPages());
18631
18641
  Ye && Qh(Ye), nx(i ?? []), ot && xx(ot), Vy(a ?? []), yx(d ?? null), Dd(m), Ad(
18632
18642
  !!(x != null && x.trim())
18633
18643
  );
18634
- const ce = Le ?? b, re = Ft(
18644
+ const de = Le ?? b, re = Ft(
18635
18645
  () => (F ?? []).flatMap(
18636
18646
  (K) => K.route && K.importPageId ? [
18637
18647
  {
@@ -18647,18 +18657,18 @@ function f0({
18647
18657
  ] : []
18648
18658
  ),
18649
18659
  [F]
18650
- ), Ee = p ?? Gn(), O = typeof (ce == null ? void 0 : ce.sourceRevision) == "string" ? ce.sourceRevision : null, ve = O && Ee.startsWith("pending") ? Ee.replace(/^pending/, O) : Ee;
18660
+ ), Ee = p ?? Xn(), O = typeof (de == null ? void 0 : de.sourceRevision) == "string" ? de.sourceRevision : null, ve = O && Ee.startsWith("pending") ? Ee.replace(/^pending/, O) : Ee;
18651
18661
  vf = ve;
18652
- const we = u ?? bn(), Q = Ie([]), ge = Ie([]), Oe = Ft(
18662
+ const we = u ?? xn(), Q = Ie([]), ge = Ie([]), Oe = Ft(
18653
18663
  () => re.map((K) => ({
18654
18664
  id: K.canonicalId,
18655
18665
  fingerprint: Va(
18656
18666
  K,
18657
18667
  ve,
18658
- Xt()
18668
+ Gt()
18659
18669
  )
18660
18670
  })),
18661
- [re, ve, de]
18671
+ [re, ve, le]
18662
18672
  );
18663
18673
  Q.current = Oe, ge.current = re.map(
18664
18674
  (K) => ki({
@@ -18668,7 +18678,7 @@ function f0({
18668
18678
  width: K.width ?? 390,
18669
18679
  height: K.height ?? 600,
18670
18680
  environment: Lt(
18671
- Xt(),
18681
+ Gt(),
18672
18682
  K.environment
18673
18683
  ),
18674
18684
  preset: K.preset,
@@ -18678,12 +18688,12 @@ function f0({
18678
18688
  ), w != null && Bd(w), up(S ?? null), $ != null && Zh($), R != null && ep(R), f.initEditMode(o !== "view-only"), ou(H ?? []), Xy(A ?? []), tp(N ?? []), np(T ?? []), rp(j ?? [], k), op(z ?? []), ip(Z ?? [], M), sp(W ?? []), hg(ee ?? 0), ap(q ?? []), sb(Me ?? []), fp(oe ?? null), hp(ne ?? null), lp(ie ?? null), pp(P ?? null), F && f.initPagesFromComponents(F, { initialCanvas: r }), ni(() => {
18679
18689
  u != null && cp(u), p != null && dp(p), Mm(l ?? []);
18680
18690
  }, [u, l, p]), ni(() => {
18681
- !ce || !F || !de || Ws(ce, {
18691
+ !de || !F || !le || Ws(de, {
18682
18692
  namespace: m ?? "",
18683
18693
  previewRevision: ve,
18684
18694
  // A capture only needs somewhere to fetch its assets — not the checkout.
18685
18695
  appOrigin: $l(),
18686
- baselineEnvironment: Xt(),
18696
+ baselineEnvironment: Gt(),
18687
18697
  allowStaleIdentity: !!x,
18688
18698
  allowMatchingFrameIdentity: Le != null,
18689
18699
  pages: re.map((K, ke) => {
@@ -18695,7 +18705,7 @@ function f0({
18695
18705
  })
18696
18706
  });
18697
18707
  }, [
18698
- ce,
18708
+ de,
18699
18709
  Oe,
18700
18710
  re,
18701
18711
  x,
@@ -18704,7 +18714,7 @@ function f0({
18704
18714
  we,
18705
18715
  F,
18706
18716
  ve,
18707
- de
18717
+ le
18708
18718
  ]), se(() => {
18709
18719
  Pl(fe ?? null);
18710
18720
  const K = gx(f);
@@ -18712,7 +18722,7 @@ function f0({
18712
18722
  K(), Pl(null);
18713
18723
  };
18714
18724
  }, [fe]), se(() => {
18715
- if (De(void 0), !de || !x || !(m != null && m.trim()) || !(p != null && p.trim()))
18725
+ if (De(void 0), !le || !x || !(m != null && m.trim()) || !(p != null && p.trim()))
18716
18726
  return;
18717
18727
  const K = new AbortController(), ke = Bg({
18718
18728
  endpoint: x,
@@ -18722,73 +18732,77 @@ function f0({
18722
18732
  namespace: m,
18723
18733
  previewRevision: p,
18724
18734
  appOrigin: $l(),
18725
- baselineEnvironment: Xt(),
18735
+ baselineEnvironment: Gt(),
18726
18736
  allowStaleIdentity: !0,
18727
18737
  allowMatchingFrameIdentity: !0,
18728
- pages: re.map((Pe, Ce) => {
18738
+ pages: re.map(($e, Ce) => {
18729
18739
  var Ke;
18730
18740
  return {
18731
- ...Pe,
18741
+ ...$e,
18732
18742
  fingerprint: (Ke = Oe[Ce]) == null ? void 0 : Ke.fingerprint
18733
18743
  };
18734
18744
  })
18735
18745
  }), De(Se);
18736
- }, Ne = (Se, Pe, Ce) => Yg({
18746
+ }, Ne = (Se, $e, Ce) => Yg({
18737
18747
  namespace: m,
18738
18748
  sourceRevision: J,
18739
18749
  transport: ke,
18740
18750
  signal: Ce,
18741
18751
  ...Se.length ? { frames: Se } : {},
18742
- ...Pe ? {} : { generate: !1 }
18743
- }), ze = (Se, Pe) => {
18744
- const Ce = new Set(Pe);
18752
+ ...$e ? {} : { generate: !1 }
18753
+ }), ze = (Se, $e) => {
18754
+ const Ce = new Set($e);
18745
18755
  return Se.filter((Ke) => Ce.has(Ke.id));
18746
- }, tt = (Se, Pe) => Se instanceof Error && Se.message ? Se.message : Pe, $e = new AbortController();
18756
+ }, tt = (Se, $e) => Se instanceof Error && Se.message ? Se.message : $e, Pe = new AbortController();
18747
18757
  if (Bs(async (Se) => {
18748
- var Ce, Ke, zt;
18749
- const Pe = await Ne(Se, !0, $e.signal);
18750
- if (Pe.status === "accepted") {
18751
- je(Pe.artifact);
18752
- const xn = new Set(((Ce = Pe.frameResolution) == null ? void 0 : Ce.exact) ?? []);
18753
- if (Se.every((qt) => xn.has(qt.id)))
18758
+ var Ce, Ke, zt, on;
18759
+ const $e = await Ne(Se, !0, Pe.signal);
18760
+ if ($e.status === "accepted") {
18761
+ je($e.artifact);
18762
+ const Qt = new Set(((Ce = $e.frameResolution) == null ? void 0 : Ce.exact) ?? []);
18763
+ if (Se.every((xt) => Qt.has(xt.id)))
18754
18764
  return { status: "accepted" };
18755
- const Ut = [
18756
- ...((Ke = Pe.frameResolution) == null ? void 0 : Ke.missing) ?? [],
18757
- ...((zt = Pe.frameResolution) == null ? void 0 : zt.stale) ?? []
18765
+ const _t = [
18766
+ ...((Ke = $e.frameResolution) == null ? void 0 : Ke.missing) ?? [],
18767
+ ...((zt = $e.frameResolution) == null ? void 0 : zt.stale) ?? []
18758
18768
  ];
18759
18769
  return {
18760
18770
  status: "unavailable",
18761
- message: Ut.length ? `The exact preview endpoint did not return a current capture for ${Ut.join(", ")}.` : "The exact preview endpoint returned no current capture."
18771
+ message: _t.length ? `The exact preview endpoint did not return a current capture for ${_t.join(", ")}.` : "The exact preview endpoint returned no current capture."
18762
18772
  };
18763
18773
  }
18764
- return Pe.status === "rejected" ? {
18774
+ return $e.status === "rejected" ? {
18765
18775
  status: "rejected",
18766
- message: Pe.errors.join(" ") || "The preview artifact was rejected."
18776
+ message: $e.errors.join(" ") || "The preview artifact was rejected."
18767
18777
  } : {
18768
18778
  status: "unavailable",
18769
18779
  message: tt(
18770
- Pe.error,
18780
+ $e.error,
18771
18781
  "The exact preview endpoint is unavailable."
18772
- )
18782
+ ),
18783
+ // The endpoint says whether this is a wait or a defect. Carry the flag
18784
+ // rather than the wording: the frame badge decides on it, and a red
18785
+ // alert on every not-yet-prepared frame is how the real one gets ignored.
18786
+ ...(on = $e.error) != null && on.pygmalionNotPrepared ? { notPrepared: !0 } : {}
18773
18787
  };
18774
18788
  }), Q.current.length) {
18775
18789
  const Se = Q.current.filter((Ce) => {
18776
- const Ke = mn(
18790
+ const Ke = gn(
18777
18791
  Ce.id,
18778
18792
  Ce.fingerprint
18779
18793
  ).status;
18780
18794
  return Ke !== "exact" && Ke !== "generating";
18781
18795
  });
18782
- yt(Se, { status: "checking" });
18783
- const Pe = (Ce) => Ce.filter((Ke) => {
18784
- const zt = mn(
18796
+ vt(Se, { status: "checking" });
18797
+ const $e = (Ce) => Ce.filter((Ke) => {
18798
+ const zt = gn(
18785
18799
  Ke.id,
18786
18800
  Ke.fingerprint
18787
18801
  ).status;
18788
18802
  return zt !== "generating" && zt !== "exact";
18789
18803
  });
18790
18804
  (async () => {
18791
- var Ut, qt, Et;
18805
+ var Qt, _t, xt;
18792
18806
  const Ce = ge.current.slice(
18793
18807
  0,
18794
18808
  Q.current.length
@@ -18799,15 +18813,15 @@ function f0({
18799
18813
  (Be, He) => Ce[He] ? Ei(Ce[He]) : !1
18800
18814
  ).map((Be) => Be.id)
18801
18815
  );
18802
- yt(
18803
- Pe(
18816
+ vt(
18817
+ $e(
18804
18818
  Se.filter((Be) => Ke.has(Be.id))
18805
18819
  ),
18806
18820
  { status: "exact" }
18807
18821
  );
18808
- const zt = Pe(
18822
+ const zt = $e(
18809
18823
  Se.filter((Be) => !Ke.has(Be.id))
18810
- ), xn = [];
18824
+ ), on = [];
18811
18825
  for (const Be of Wl(
18812
18826
  zt
18813
18827
  )) {
@@ -18820,31 +18834,31 @@ function f0({
18820
18834
  });
18821
18835
  if (K.signal.aborted) return;
18822
18836
  if (He.status === "accepted") {
18823
- xn.push(
18837
+ on.push(
18824
18838
  ...ze(Be, He.resolution.exact)
18825
18839
  );
18826
- const _t = ze(Be, [
18840
+ const Ot = ze(Be, [
18827
18841
  ...He.resolution.missing,
18828
18842
  ...He.resolution.stale
18829
18843
  ]);
18830
- yt(Pe(_t), {
18844
+ vt($e(Ot), {
18831
18845
  status: "outdated",
18832
18846
  message: "Select this frame to generate the exact preview."
18833
18847
  });
18834
18848
  continue;
18835
18849
  }
18836
- const Mn = He.status === "rejected" ? He.errors.join(" ") || "The preview artifact probe was rejected." : tt(
18850
+ const En = He.status === "rejected" ? He.errors.join(" ") || "The preview artifact probe was rejected." : tt(
18837
18851
  He.error,
18838
18852
  "The exact preview endpoint is unavailable."
18839
18853
  );
18840
- yt(Pe(Be), {
18854
+ vt($e(Be), {
18841
18855
  status: "error",
18842
18856
  reason: He.status === "rejected" ? "rejected" : "unavailable",
18843
- message: Mn
18857
+ message: En
18844
18858
  });
18845
18859
  }
18846
18860
  for (const Be of Wl(
18847
- Pe(xn)
18861
+ $e(on)
18848
18862
  )) {
18849
18863
  const He = await Ne(
18850
18864
  Be,
@@ -18853,34 +18867,34 @@ function f0({
18853
18867
  );
18854
18868
  if (K.signal.aborted) return;
18855
18869
  if (He.status === "accepted") {
18856
- je(He.artifact), yt(
18857
- ze(Be, ((Ut = He.frameResolution) == null ? void 0 : Ut.exact) ?? []),
18870
+ je(He.artifact), vt(
18871
+ ze(Be, ((Qt = He.frameResolution) == null ? void 0 : Qt.exact) ?? []),
18858
18872
  { status: "exact" }
18859
18873
  );
18860
- const _t = ze(Be, [
18861
- ...((qt = He.frameResolution) == null ? void 0 : qt.missing) ?? [],
18862
- ...((Et = He.frameResolution) == null ? void 0 : Et.stale) ?? []
18874
+ const Ot = ze(Be, [
18875
+ ...((_t = He.frameResolution) == null ? void 0 : _t.missing) ?? [],
18876
+ ...((xt = He.frameResolution) == null ? void 0 : xt.stale) ?? []
18863
18877
  ]);
18864
- yt(Pe(_t), {
18878
+ vt($e(Ot), {
18865
18879
  status: "outdated",
18866
18880
  message: "Select this frame to generate the exact preview."
18867
18881
  });
18868
18882
  continue;
18869
18883
  }
18870
- const Mn = He.status === "rejected" ? He.errors.join(" ") || "The preview artifact was rejected." : tt(
18884
+ const En = He.status === "rejected" ? He.errors.join(" ") || "The preview artifact was rejected." : tt(
18871
18885
  He.error,
18872
18886
  "The exact preview endpoint is unavailable."
18873
18887
  );
18874
- yt(Pe(Be), {
18888
+ vt($e(Be), {
18875
18889
  status: "error",
18876
18890
  reason: He.status === "rejected" ? "rejected" : "unavailable",
18877
- message: Mn
18891
+ message: En
18878
18892
  });
18879
18893
  }
18880
18894
  })().catch((Ce) => {
18881
18895
  if (K.signal.aborted) return;
18882
- const Ke = Pe(Se);
18883
- yt(Ke, {
18896
+ const Ke = $e(Se);
18897
+ vt(Ke, {
18884
18898
  status: "error",
18885
18899
  reason: "unavailable",
18886
18900
  message: tt(
@@ -18891,14 +18905,14 @@ function f0({
18891
18905
  });
18892
18906
  }
18893
18907
  return () => {
18894
- Bs(null), $e.abort(), K.abort();
18908
+ Bs(null), Pe.abort(), K.abort();
18895
18909
  };
18896
18910
  }, [
18897
18911
  x,
18898
18912
  m,
18899
18913
  p,
18900
18914
  u,
18901
- de
18915
+ le
18902
18916
  ]), se(() => {
18903
18917
  let K = !0;
18904
18918
  if (!I)
@@ -18936,17 +18950,17 @@ function f0({
18936
18950
  }, [v]);
18937
18951
  const B = Ie(null);
18938
18952
  return se(() => {
18939
- if (typeof document > "u" || !de) return;
18940
- const K = u ?? bn();
18953
+ if (typeof document > "u" || !le) return;
18954
+ const K = u ?? xn();
18941
18955
  if (!K) return;
18942
- const ke = `${K}|${p ?? Gn()}`;
18956
+ const ke = `${K}|${p ?? Xn()}`;
18943
18957
  return B.current != null && B.current !== ke && Ig(), B.current = ke, Vv({
18944
18958
  editor: f,
18945
18959
  getPages: () => f.pages,
18946
18960
  appOrigin: K,
18947
- baselineEnvironment: Xt()
18961
+ baselineEnvironment: Gt()
18948
18962
  });
18949
- }, [u, de, p]), /* @__PURE__ */ s(_v, { previewIdentityReady: de });
18963
+ }, [u, le, p]), /* @__PURE__ */ s(_v, { previewIdentityReady: le });
18950
18964
  }
18951
18965
  export {
18952
18966
  py as DEFAULT_DESIGN_COMPILE_LIMITS,
@@ -19004,7 +19018,7 @@ export {
19004
19018
  Em as getPreviewEnvironmentControls,
19005
19019
  Rm as getPreviewEnvironmentOverride,
19006
19020
  ba as getRecommendedPygmalionPreviewConcurrency,
19007
- Xt as getStoryboardBaselineEnvironment,
19021
+ Gt as getStoryboardBaselineEnvironment,
19008
19022
  hf as getStoryboardDiscoveryBaselineEnvironment,
19009
19023
  lo as getStoryboardGraph,
19010
19024
  ab as getSurfaceClassifications,