@pygmalionjs/pygmalion 0.2.36 → 0.2.38

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.
@@ -1676,7 +1676,7 @@ function Qu(t) {
1676
1676
  };
1677
1677
  return t.observing_ && t.observing_.length > 0 && (e.dependencies = tg(t.observing_).map(Qu)), e;
1678
1678
  }
1679
- function O0(t, e) {
1679
+ function P0(t, e) {
1680
1680
  return ef(pr(t, e));
1681
1681
  }
1682
1682
  function ef(t) {
@@ -1775,7 +1775,7 @@ function tf(t, e) {
1775
1775
  function Oi(t) {
1776
1776
  return process.env.NODE_ENV !== "production" && arguments.length !== 1 && j("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"), tf(t);
1777
1777
  }
1778
- function P0(t, e) {
1778
+ function M0(t, e) {
1779
1779
  return process.env.NODE_ENV !== "production" && !Dn(e) ? j("expected a property name as second argument") : tf(t, e);
1780
1780
  }
1781
1781
  function og() {
@@ -2121,33 +2121,33 @@ var Jo = {
2121
2121
  return r > -1 ? (this.splice(r, 1), !0) : !1;
2122
2122
  }
2123
2123
  };
2124
- Ae("at", $t);
2125
- Ae("concat", $t);
2126
- Ae("flat", $t);
2127
- Ae("includes", $t);
2128
- Ae("indexOf", $t);
2129
- Ae("join", $t);
2130
- Ae("lastIndexOf", $t);
2131
- Ae("slice", $t);
2132
- Ae("toString", $t);
2133
- Ae("toLocaleString", $t);
2134
- Ae("toSorted", $t);
2135
- Ae("toSpliced", $t);
2136
- Ae("with", $t);
2137
- Ae("every", Qt);
2138
- Ae("filter", Qt);
2139
- Ae("find", Qt);
2140
- Ae("findIndex", Qt);
2141
- Ae("findLast", Qt);
2142
- Ae("findLastIndex", Qt);
2143
- Ae("flatMap", Qt);
2144
- Ae("forEach", Qt);
2145
- Ae("map", Qt);
2146
- Ae("some", Qt);
2147
- Ae("toReversed", Qt);
2148
- Ae("reduce", nf);
2149
- Ae("reduceRight", nf);
2150
- function Ae(t, e) {
2124
+ Oe("at", $t);
2125
+ Oe("concat", $t);
2126
+ Oe("flat", $t);
2127
+ Oe("includes", $t);
2128
+ Oe("indexOf", $t);
2129
+ Oe("join", $t);
2130
+ Oe("lastIndexOf", $t);
2131
+ Oe("slice", $t);
2132
+ Oe("toString", $t);
2133
+ Oe("toLocaleString", $t);
2134
+ Oe("toSorted", $t);
2135
+ Oe("toSpliced", $t);
2136
+ Oe("with", $t);
2137
+ Oe("every", Qt);
2138
+ Oe("filter", Qt);
2139
+ Oe("find", Qt);
2140
+ Oe("findIndex", Qt);
2141
+ Oe("findLast", Qt);
2142
+ Oe("findLastIndex", Qt);
2143
+ Oe("flatMap", Qt);
2144
+ Oe("forEach", Qt);
2145
+ Oe("map", Qt);
2146
+ Oe("some", Qt);
2147
+ Oe("toReversed", Qt);
2148
+ Oe("reduce", nf);
2149
+ Oe("reduceRight", nf);
2150
+ function Oe(t, e) {
2151
2151
  typeof Array.prototype[t] == "function" && (Jo[t] = e(t));
2152
2152
  }
2153
2153
  function $t(t) {
@@ -3403,7 +3403,7 @@ var ta;
3403
3403
  Ag(vp);
3404
3404
  ta = Ha.finalizeAllImmediately;
3405
3405
  let hf = {};
3406
- function M0(t) {
3406
+ function I0(t) {
3407
3407
  hf = t;
3408
3408
  }
3409
3409
  function _e() {
@@ -4813,7 +4813,7 @@ function gf(t) {
4813
4813
  ${n.join(`
4814
4814
  `)}`);
4815
4815
  }
4816
- function I0(t, e, n = {}) {
4816
+ function $0(t, e, n = {}) {
4817
4817
  gf(e);
4818
4818
  const r = e.flatMap(
4819
4819
  (o) => t.filter((s) => {
@@ -4845,7 +4845,7 @@ function I0(t, e, n = {}) {
4845
4845
  );
4846
4846
  return r;
4847
4847
  }
4848
- function $0(t, e, n = {}) {
4848
+ function k0(t, e, n = {}) {
4849
4849
  var u, f, p, g, x;
4850
4850
  if (gf(e), e.length === 0)
4851
4851
  return {
@@ -4899,7 +4899,7 @@ function $0(t, e, n = {}) {
4899
4899
  expectedCount: o.length
4900
4900
  };
4901
4901
  }
4902
- function k0({
4902
+ function T0({
4903
4903
  cases: t,
4904
4904
  scenarios: e,
4905
4905
  behaviorScenarios: n = [],
@@ -5152,7 +5152,7 @@ async function Cb(t, e) {
5152
5152
  failures: n
5153
5153
  };
5154
5154
  }
5155
- function T0(t, e = {}) {
5155
+ function D0(t, e = {}) {
5156
5156
  const n = t.registry, r = [...t.tokens], i = Es(n), o = { ...xb, ...e.layerOptions }, s = () => {
5157
5157
  const c = Ar.map((u) => {
5158
5158
  const f = t.collections[u];
@@ -5347,7 +5347,7 @@ ${c.join(`
5347
5347
  };
5348
5348
  }
5349
5349
  let vf = null;
5350
- function D0(t) {
5350
+ function R0(t) {
5351
5351
  vf = t;
5352
5352
  }
5353
5353
  function or() {
@@ -5358,7 +5358,7 @@ const Ga = /* @__PURE__ */ new Set();
5358
5358
  let Xa = "";
5359
5359
  const Ja = /* @__PURE__ */ new Set();
5360
5360
  let xf = null, yf = null, wf = null, Sf = null, Nf = null, _f = null;
5361
- function R0(t) {
5361
+ function z0(t) {
5362
5362
  if (Ya !== t) {
5363
5363
  Ya = t;
5364
5364
  for (const e of Ga) e();
@@ -5370,7 +5370,7 @@ function Mi() {
5370
5370
  function Cf(t) {
5371
5371
  return Ga.add(t), () => Ga.delete(t);
5372
5372
  }
5373
- function z0(t) {
5373
+ function F0(t) {
5374
5374
  if (Xa !== t) {
5375
5375
  Xa = t;
5376
5376
  for (const e of Ja) e();
@@ -5383,43 +5383,43 @@ function Ef(t) {
5383
5383
  return Ja.add(t), () => Ja.delete(t);
5384
5384
  }
5385
5385
  let Af = "";
5386
- function F0(t) {
5386
+ function L0(t) {
5387
5387
  Af = t;
5388
5388
  }
5389
5389
  function Za() {
5390
5390
  return Af;
5391
5391
  }
5392
- function L0(t) {
5392
+ function j0(t) {
5393
5393
  xf = t;
5394
5394
  }
5395
5395
  function Eb() {
5396
5396
  return xf;
5397
5397
  }
5398
- function j0(t) {
5398
+ function V0(t) {
5399
5399
  yf = t;
5400
5400
  }
5401
5401
  function Of() {
5402
5402
  return yf;
5403
5403
  }
5404
- function V0(t) {
5404
+ function B0(t) {
5405
5405
  wf = t;
5406
5406
  }
5407
5407
  function To() {
5408
5408
  return wf;
5409
5409
  }
5410
- function B0(t) {
5410
+ function H0(t) {
5411
5411
  Sf = t;
5412
5412
  }
5413
5413
  function Ab() {
5414
5414
  return Sf;
5415
5415
  }
5416
- function H0(t) {
5416
+ function W0(t) {
5417
5417
  Nf = t;
5418
5418
  }
5419
5419
  function Ob() {
5420
5420
  return Nf;
5421
5421
  }
5422
- function W0(t) {
5422
+ function K0(t) {
5423
5423
  _f = t;
5424
5424
  }
5425
5425
  function xd() {
@@ -8132,7 +8132,7 @@ function Nv(t) {
8132
8132
  }
8133
8133
  return e;
8134
8134
  }
8135
- function K0(t) {
8135
+ function U0(t) {
8136
8136
  const e = t.map(As), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = [];
8137
8137
  for (const s of e)
8138
8138
  i.push(...Nv(s)), n.has(s.id) && i.push(`Connection id "${s.id}" is duplicated.`), r.has(s.componentName) && i.push(
@@ -8150,10 +8150,10 @@ ${i.join(`
8150
8150
  Ad = o;
8151
8151
  }
8152
8152
  }
8153
- function U0() {
8153
+ function q0() {
8154
8154
  return [...Fr.values()].map(As);
8155
8155
  }
8156
- function q0(t) {
8156
+ function Y0(t) {
8157
8157
  const e = Fr.get(t);
8158
8158
  return e ? As(e) : void 0;
8159
8159
  }
@@ -8475,7 +8475,7 @@ async function Rf() {
8475
8475
  ai = null;
8476
8476
  }), ai);
8477
8477
  }
8478
- function Y0(t) {
8478
+ function G0(t) {
8479
8479
  kn == null || kn();
8480
8480
  const e = Md(t);
8481
8481
  return xo = new Map(e.map((n) => [is(n), n])), kn = Yu(
@@ -8515,13 +8515,13 @@ async function Rv() {
8515
8515
  }
8516
8516
  let Kc = [], ar = null;
8517
8517
  const Ti = /* @__PURE__ */ new Map();
8518
- function G0(t) {
8518
+ function X0(t) {
8519
8519
  Kc = t;
8520
8520
  }
8521
8521
  function os() {
8522
8522
  return Kc;
8523
8523
  }
8524
- function X0(t) {
8524
+ function J0(t) {
8525
8525
  ar = t;
8526
8526
  }
8527
8527
  function zv(t) {
@@ -8536,7 +8536,7 @@ function Fv(t, e) {
8536
8536
  const n = Ff();
8537
8537
  ar == null || ar(n), zf(n);
8538
8538
  }
8539
- function J0() {
8539
+ function Z0() {
8540
8540
  for (const t of Ti.keys()) document.documentElement.style.removeProperty(t);
8541
8541
  Ti.clear(), ar == null || ar([]), zf([]);
8542
8542
  }
@@ -8999,7 +8999,7 @@ function Fd({
8999
8999
  affectedFrames: n = []
9000
9000
  }) {
9001
9001
  var Ol, Pl, Ml, Il, $l;
9002
- const r = ue(null), [i, o] = W(null), [s, a] = W(null), [c, d] = W(null), [u, f] = W("cases"), [p, g] = W(!1), [x, v] = W(Gv), [S, N] = W(null), [C, R] = W("original"), [O, Y] = W("default"), [w, E] = W("item"), [$, X] = W("base"), [ee, Ie] = W({ minWidth: 768 }), [xe, V] = W(null), [U, fe] = W(!0), [K, ge] = W(!1), [J, Me] = W(!1), [pe, se] = W(null), [Re, Ee] = W(""), [ot, je] = W(!1), [yt, st] = W(""), [Oe, M] = W(!1), [he, re] = W(""), [me, D] = W(null), [le, ce] = W(""), [G, we] = W(""), [$e, be] = W(0), [Ce, oe] = gu((h) => h + 1, 0), Pe = ue(""), Ue = ue(null), wt = ue(null);
9002
+ const r = ue(null), [i, o] = W(null), [s, a] = W(null), [c, d] = W(null), [u, f] = W("cases"), [p, g] = W(!1), [x, v] = W(Gv), [S, N] = W(null), [C, R] = W("original"), [O, Y] = W("default"), [w, E] = W("item"), [$, X] = W("base"), [ee, Ie] = W({ minWidth: 768 }), [xe, V] = W(null), [U, fe] = W(!0), [K, ge] = W(!1), [J, Me] = W(!1), [pe, se] = W(null), [Re, Ee] = W(""), [ot, je] = W(!1), [yt, st] = W(""), [Pe, M] = W(!1), [he, re] = W(""), [me, D] = W(null), [le, ce] = W(""), [G, we] = W(""), [$e, be] = W(0), [Ce, oe] = gu((h) => h + 1, 0), Ae = ue(""), Ue = ue(null), wt = ue(null);
9003
9003
  wt.current = s;
9004
9004
  const qi = ue(null);
9005
9005
  qi.current = c;
@@ -9109,7 +9109,7 @@ function Fd({
9109
9109
  if (y) return;
9110
9110
  y = !0, h.removeAttribute("contenteditable");
9111
9111
  const Q = h.textContent ?? "";
9112
- h.textContent = Pe.current, Z && Q !== Pe.current && (H.recordText(h, Q, dt(h), Ve.current), H.toast("change text")), d(null);
9112
+ h.textContent = Ae.current, Z && Q !== Ae.current && (H.recordText(h, Q, dt(h), Ve.current), H.toast("change text")), d(null);
9113
9113
  }, k = (Z) => {
9114
9114
  Z.stopPropagation(), Z.key === "Enter" ? (Z.preventDefault(), _(!0)) : Z.key === "Escape" && _(!1);
9115
9115
  }, P = () => _(!0);
@@ -9157,7 +9157,7 @@ function Fd({
9157
9157
  H.toast("Please undo the structural changes and then edit the text.");
9158
9158
  return;
9159
9159
  }
9160
- a(h), Pe.current = h.textContent ?? "", h.setAttribute("contenteditable", "plaintext-only"), h.isContentEditable || h.setAttribute("contenteditable", "true"), d(h), h.focus();
9160
+ a(h), Ae.current = h.textContent ?? "", h.setAttribute("contenteditable", "plaintext-only"), h.isContentEditable || h.setAttribute("contenteditable", "true"), d(h), h.focus();
9161
9161
  const y = qt.createRange();
9162
9162
  y.selectNodeContents(h);
9163
9163
  const _ = We.getSelection();
@@ -9178,7 +9178,7 @@ function Fd({
9178
9178
  H.toast("Works with existing application method without code diff connection");
9179
9179
  return;
9180
9180
  }
9181
- if (Oe) {
9181
+ if (Pe) {
9182
9182
  H.toast("Please check the diff after the impact screen calculation is complete.");
9183
9183
  return;
9184
9184
  }
@@ -11051,10 +11051,10 @@ function Fd({
11051
11051
  "button",
11052
11052
  {
11053
11053
  type: "button",
11054
- disabled: eo === 0 || ot || Oe,
11054
+ disabled: eo === 0 || ot || Pe,
11055
11055
  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]",
11056
11056
  onClick: () => void ie(),
11057
- children: ot ? "Generating code diff…" : Oe ? "Calculating impact screen…" : Fs ? "Check code diff" : `Code diff confirmed · r${(pe == null ? void 0 : pe.revision) ?? "—"}`
11057
+ children: ot ? "Generating code diff…" : Pe ? "Calculating impact screen…" : Fs ? "Check code diff" : `Code diff confirmed · r${(pe == null ? void 0 : pe.revision) ?? "—"}`
11058
11058
  }
11059
11059
  ) : /* @__PURE__ */ l("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." }),
11060
11060
  /* @__PURE__ */ l("p", { className: "mt-1.5 text-[9px] leading-relaxed text-[#71717a]", children: to ? "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." }),
@@ -11274,7 +11274,7 @@ function Fd({
11274
11274
  `${h.kind}-${h.identity.componentFile}-${h.identity.sourceStart}-${y.prop}`
11275
11275
  );
11276
11276
  }),
11277
- Hn.operations.some((h) => h.scope === "shared-source") && /* @__PURE__ */ l("p", { className: "text-[9px] leading-relaxed text-[#71717a]", children: Oe ? "Calculating every screen affected by the shared source." : "Affected screens are derived from the source dependency graph." })
11277
+ Hn.operations.some((h) => h.scope === "shared-source") && /* @__PURE__ */ l("p", { className: "text-[9px] leading-relaxed text-[#71717a]", children: Pe ? "Calculating every screen affected by the shared source." : "Affected screens are derived from the source dependency graph." })
11278
11278
  ] }) : /* @__PURE__ */ l("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." }) }),
11279
11279
  /* @__PURE__ */ l(De, { title: "Recent changes", children: fn.length > 0 ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [...fn].reverse().map((h) => {
11280
11280
  const y = h.items.some(on), _ = h.items.some((k) => !on(k));
@@ -11795,13 +11795,16 @@ function hx(t, e, n, r = Gf) {
11795
11795
  function px(t, e) {
11796
11796
  return e !== "select" ? "delegate-to-canvas" : t ? "delegate-to-layer" : "select-frame";
11797
11797
  }
11798
- function mx(t, e, n) {
11798
+ function mx(t, e) {
11799
+ return t && e ? "responsive-preview" : "editable-layers";
11800
+ }
11801
+ function gx(t, e, n) {
11799
11802
  return !Number.isFinite(n.zoom) || n.zoom <= 0 ? null : {
11800
11803
  x: (t.clientX - e.left - n.panX) / n.zoom,
11801
11804
  y: (t.clientY - e.top - n.panY) / n.zoom
11802
11805
  };
11803
11806
  }
11804
- function gx(t, e) {
11807
+ function bx(t, e) {
11805
11808
  if (!e) return null;
11806
11809
  for (let n = t.length - 1; n >= 0; n -= 1) {
11807
11810
  const r = t[n];
@@ -11810,10 +11813,10 @@ function gx(t, e) {
11810
11813
  }
11811
11814
  return null;
11812
11815
  }
11813
- function bx(t, e) {
11816
+ function vx(t, e) {
11814
11817
  return e == null ? { action: "clear" } : e === t ? { action: "idle" } : { action: "restart", frameId: e };
11815
11818
  }
11816
- function vx(t, e) {
11819
+ function xx(t, e) {
11817
11820
  return !(t && e === "select");
11818
11821
  }
11819
11822
  const No = 1;
@@ -11821,7 +11824,7 @@ function Xf(t, e, n) {
11821
11824
  const r = e < 0 ? t.scrollLeft > No : e > 0 ? t.scrollLeft + t.clientWidth < t.scrollWidth - No : !1, i = n < 0 ? t.scrollTop > No : n > 0 ? t.scrollTop + t.clientHeight < t.scrollHeight - No : !1;
11822
11825
  return r || i;
11823
11826
  }
11824
- function xx(t) {
11827
+ function yx(t) {
11825
11828
  var n;
11826
11829
  const e = (n = t.ownerDocument.defaultView) == null ? void 0 : n.getComputedStyle(t);
11827
11830
  return e ? [e.overflow, e.overflowX, e.overflowY].some(
@@ -11835,7 +11838,7 @@ function Jf(t) {
11835
11838
  return e && t instanceof e ? t : null;
11836
11839
  }
11837
11840
  function Zf(t, e, n) {
11838
- return xx(t) && Xf(t, e, n);
11841
+ return yx(t) && Xf(t, e, n);
11839
11842
  }
11840
11843
  function Qf(t, e, n, r) {
11841
11844
  let i = t;
@@ -11848,13 +11851,13 @@ function Qf(t, e, n, r) {
11848
11851
  }
11849
11852
  return null;
11850
11853
  }
11851
- function yx(t) {
11854
+ function wx(t) {
11852
11855
  for (const e of t.composedPath())
11853
11856
  if (e instanceof HTMLElement && e.dataset.pygmalionFrameScrollSurface === "true")
11854
11857
  return e;
11855
11858
  return null;
11856
11859
  }
11857
- function wx(t, e) {
11860
+ function Sx(t, e) {
11858
11861
  for (const n of t.composedPath())
11859
11862
  if (n instanceof HTMLElement) {
11860
11863
  if (Zf(n, t.deltaX, t.deltaY))
@@ -11863,7 +11866,7 @@ function wx(t, e) {
11863
11866
  }
11864
11867
  return null;
11865
11868
  }
11866
- function Sx(t, e) {
11869
+ function Nx(t, e) {
11867
11870
  const n = t.getBoundingClientRect();
11868
11871
  if (e.clientX < n.left || e.clientX > n.right || e.clientY < n.top || e.clientY > n.bottom)
11869
11872
  return !1;
@@ -11883,7 +11886,7 @@ function Sx(t, e) {
11883
11886
  const a = r.scrollingElement, c = Jf(a);
11884
11887
  return c && Xf(c, e.deltaX, e.deltaY) ? (i.scrollBy({ left: e.deltaX, top: e.deltaY }), !0) : !1;
11885
11888
  }
11886
- function Nx(t, e) {
11889
+ function _x(t, e) {
11887
11890
  const n = t.elementFromPoint(e.clientX, e.clientY), r = Qf(
11888
11891
  n,
11889
11892
  t.host,
@@ -11892,45 +11895,45 @@ function Nx(t, e) {
11892
11895
  );
11893
11896
  return r ? (r.scrollBy({ left: e.deltaX, top: e.deltaY }), !0) : !1;
11894
11897
  }
11895
- function _x(t) {
11898
+ function Cx(t) {
11896
11899
  if (t.ctrlKey || t.metaKey) return "canvas";
11897
- const e = yx(t);
11900
+ const e = wx(t);
11898
11901
  if (!e) return "canvas";
11899
- if (wx(t, e)) return "native-preview";
11902
+ if (Sx(t, e)) return "native-preview";
11900
11903
  for (const n of e.querySelectorAll("iframe"))
11901
- if (Sx(n, t))
11904
+ if (Nx(n, t))
11902
11905
  return "programmatic-preview";
11903
11906
  for (const n of e.querySelectorAll("*"))
11904
- if (n.shadowRoot && Nx(n.shadowRoot, t))
11907
+ if (n.shadowRoot && _x(n.shadowRoot, t))
11905
11908
  return "programmatic-preview";
11906
11909
  return "canvas";
11907
11910
  }
11908
11911
  const ac = /* @__PURE__ */ new Set();
11909
11912
  let sn = [];
11910
- const Cx = 2;
11913
+ const Ex = 2;
11911
11914
  function eh() {
11912
11915
  for (const t of ac) t();
11913
11916
  }
11914
- function th(t, e = Cx) {
11917
+ function th(t, e = Ex) {
11915
11918
  if (!t) return !1;
11916
11919
  const n = Math.max(1, e);
11917
11920
  if (sn[0] === t && sn.length <= n) return !1;
11918
11921
  const r = [t, ...sn.filter((i) => i !== t)].slice(0, n);
11919
11922
  return r.length === sn.length && r.every((i, o) => i === sn[o]) ? !1 : (sn = r, eh(), !0);
11920
11923
  }
11921
- function Ex(t) {
11924
+ function Ax(t) {
11922
11925
  sn.includes(t) && (sn = sn.filter((e) => e !== t), eh());
11923
11926
  }
11924
- function Ax(t) {
11927
+ function Ox(t) {
11925
11928
  return sn.includes(t);
11926
11929
  }
11927
- function Ox(t) {
11930
+ function Px(t) {
11928
11931
  return ac.add(t), () => {
11929
11932
  ac.delete(t);
11930
11933
  };
11931
11934
  }
11932
- const Px = 4;
11933
- function Mx(t) {
11935
+ const Mx = 4;
11936
+ function Ix(t) {
11934
11937
  const e = t.environment ? JSON.stringify(t.environment, Object.keys(t.environment).sort()) : "";
11935
11938
  return [
11936
11939
  t.origin,
@@ -11939,16 +11942,16 @@ function Mx(t) {
11939
11942
  e
11940
11943
  ].join("|");
11941
11944
  }
11942
- function Ix(t, e = {}) {
11945
+ function $x(t, e = {}) {
11943
11946
  var n;
11944
11947
  return !t.session || t.route == null || t.layersImported || (((n = t.interactions) == null ? void 0 : n.length) ?? 0) > 0 ? !1 : e.detailActive !== !0;
11945
11948
  }
11946
- function $x() {
11949
+ function kx() {
11947
11950
  const t = document.createElement("iframe");
11948
11951
  return t.setAttribute("tabindex", "-1"), t.setAttribute("aria-hidden", "true"), t.setAttribute("data-pygmalion-live-instance", ""), t.style.position = "fixed", t.style.top = "0", t.style.left = "-20000px", t.style.border = "0", t.style.pointerEvents = "none", t;
11949
11952
  }
11950
- function kx(t = {}) {
11951
- const e = t.createIframe ?? $x, n = t.resolveContainer ?? (() => typeof document > "u" ? null : document.body), r = Math.max(1, t.maximumInstances ?? Px), i = /* @__PURE__ */ new Map();
11953
+ function Tx(t = {}) {
11954
+ const e = t.createIframe ?? kx, n = t.resolveContainer ?? (() => typeof document > "u" ? null : document.body), r = Math.max(1, t.maximumInstances ?? Mx), i = /* @__PURE__ */ new Map();
11952
11955
  function o(s, a, c, d) {
11953
11956
  return s.iframe.style.width = `${Math.round(c)}px`, s.iframe.style.height = `${Math.round(d)}px`, new Promise((u, f) => {
11954
11957
  const p = () => {
@@ -12015,10 +12018,10 @@ function kx(t = {}) {
12015
12018
  };
12016
12019
  }
12017
12020
  let Ud = null;
12018
- function Tx() {
12019
- return Ud ?? (Ud = kx()), Ud;
12021
+ function Dx() {
12022
+ return Ud ?? (Ud = Tx()), Ud;
12020
12023
  }
12021
- function Dx(t) {
12024
+ function Rx(t) {
12022
12025
  return {
12023
12026
  capturedFrames: t.frames.length,
12024
12027
  failedFrames: t.failures.length,
@@ -12034,12 +12037,12 @@ function Dx(t) {
12034
12037
  )
12035
12038
  };
12036
12039
  }
12037
- function Rx(t) {
12040
+ function zx(t) {
12038
12041
  if (!t.after) return "Baseline capture complete";
12039
12042
  const e = [];
12040
12043
  return t.domChanged && e.push("DOM"), t.screenshotChanged && e.push("Pixel"), t.pixelDiff && e.push(`${(t.pixelDiff.diffRatio * 100).toFixed(2)}%`), e.length > 0 ? e.join(" · ") : "No change";
12041
12044
  }
12042
- function zx(t) {
12045
+ function Fx(t) {
12043
12046
  return t.operations.length + t.texts.length + t.styles.reduce(
12044
12047
  (e, n) => e + Object.keys(n.declarations).length,
12045
12048
  0
@@ -12064,7 +12067,7 @@ function qd({
12064
12067
  qa: t,
12065
12068
  title: e
12066
12069
  }) {
12067
- const n = Dx(t);
12070
+ const n = Rx(t);
12068
12071
  return /* @__PURE__ */ b(
12069
12072
  "section",
12070
12073
  {
@@ -12096,7 +12099,7 @@ function qd({
12096
12099
  children: [
12097
12100
  /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
12098
12101
  /* @__PURE__ */ l("code", { className: "min-w-0 flex-1 truncate text-[#444]", children: r.id }),
12099
- /* @__PURE__ */ l("span", { className: "shrink-0 text-[#777]", children: Rx(r) })
12102
+ /* @__PURE__ */ l("span", { className: "shrink-0 text-[#777]", children: zx(r) })
12100
12103
  ] }),
12101
12104
  /* @__PURE__ */ b("div", { className: "mt-1 flex flex-wrap gap-2", children: [
12102
12105
  /* @__PURE__ */ l(xa, { href: r.before.screenshotUrl, label: "Before change" }),
@@ -12125,10 +12128,10 @@ function qd({
12125
12128
  }
12126
12129
  );
12127
12130
  }
12128
- const Fx = lt(function() {
12131
+ const Lx = lt(function() {
12129
12132
  const [e, n] = W(null), [r, i] = W(""), [o, s] = W(null), [a, c] = W(null);
12130
12133
  if (!m.applyOpen) return null;
12131
- const d = m.getPendingSourceChanges(), u = JSON.stringify(d.payload), f = zx(d.payload), p = (o == null ? void 0 : o.fingerprint) === u && o.journalRevision === d.revision, g = Ff(), x = Za(), v = m.pages.filter(
12134
+ const d = m.getPendingSourceChanges(), u = JSON.stringify(d.payload), f = Fx(d.payload), p = (o == null ? void 0 : o.fingerprint) === u && o.journalRevision === d.revision, g = Ff(), x = Za(), v = m.pages.filter(
12132
12135
  (w) => w.route == null && w.importLayers !== !0 && w.publish !== !1 && (!x || (w.canvas ?? "default") === x)
12133
12136
  ).map((w) => ({
12134
12137
  id: w.id,
@@ -12367,8 +12370,8 @@ const Fx = lt(function() {
12367
12370
  ] })
12368
12371
  ] })
12369
12372
  ] });
12370
- }), Lx = /^#[0-9a-fA-F]{6}$/, jx = /^(#|rgb|hsl|oklch|var\()/;
12371
- function Vx({ name: t, group: e, dark: n }) {
12373
+ }), jx = /^#[0-9a-fA-F]{6}$/, Vx = /^(#|rgb|hsl|oklch|var\()/;
12374
+ function Bx({ name: t, group: e, dark: n }) {
12372
12375
  const [r, i] = W(!1), [, o] = W(0), s = zv(t), a = t.replace(/^--/, ""), c = (d) => {
12373
12376
  d && d !== s && (Fv(t, d), o((u) => u + 1));
12374
12377
  };
@@ -12381,7 +12384,7 @@ function Vx({ name: t, group: e, dark: n }) {
12381
12384
  title: `${t} · ${s} — Click to edit`,
12382
12385
  onClick: () => i((d) => !d),
12383
12386
  children: [
12384
- jx.test(s.trim()) ? /* @__PURE__ */ b("span", { className: "flex h-3.5 w-3.5 shrink-0 overflow-hidden rounded-[3px] border border-black/10", children: [
12387
+ Vx.test(s.trim()) ? /* @__PURE__ */ b("span", { className: "flex h-3.5 w-3.5 shrink-0 overflow-hidden rounded-[3px] border border-black/10", children: [
12385
12388
  /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", style: { background: `var(${t}, ${s})` } }),
12386
12389
  n && n !== s && /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", style: { background: n } })
12387
12390
  ] }) : /* @__PURE__ */ l("span", { className: "shrink-0 rounded bg-[#f0f0f0] px-1 text-[9px] text-[#666]", children: s }),
@@ -12391,7 +12394,7 @@ function Vx({ name: t, group: e, dark: n }) {
12391
12394
  }
12392
12395
  ),
12393
12396
  r && /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 pb-1.5 pl-5", children: [
12394
- Lx.test(s) && /* @__PURE__ */ l(
12397
+ jx.test(s) && /* @__PURE__ */ l(
12395
12398
  "input",
12396
12399
  {
12397
12400
  type: "color",
@@ -12416,7 +12419,7 @@ function Vx({ name: t, group: e, dark: n }) {
12416
12419
  ] })
12417
12420
  ] });
12418
12421
  }
12419
- function Bx({ name: t }) {
12422
+ function Hx({ name: t }) {
12420
12423
  const e = _e()[t];
12421
12424
  if (!e) return null;
12422
12425
  const n = e.component, r = ki(t), i = r ? _v(r.id, { limit: 6 }) : null, o = (i == null ? void 0 : i.cases) ?? [], a = Object.keys(e.props ?? {})[0], c = a ? (e.props[a] ?? []).slice(0, 6) : [""];
@@ -12526,10 +12529,10 @@ function Yd({
12526
12529
  }
12527
12530
  )
12528
12531
  ] }),
12529
- i && /* @__PURE__ */ l(Bx, { name: t })
12532
+ i && /* @__PURE__ */ l(Hx, { name: t })
12530
12533
  ] });
12531
12534
  }
12532
- function Hx({
12535
+ function Wx({
12533
12536
  asset: t,
12534
12537
  onFrameFocus: e
12535
12538
  }) {
@@ -12562,7 +12565,7 @@ const Gd = {
12562
12565
  components: "Components",
12563
12566
  screens: "Screens"
12564
12567
  };
12565
- function Wx({
12568
+ function Kx({
12566
12569
  onFrameFocus: t = (e) => m.selectFrame(e)
12567
12570
  }) {
12568
12571
  var x;
@@ -12598,10 +12601,10 @@ function Wx({
12598
12601
  ) }),
12599
12602
  /* @__PURE__ */ l("div", { className: "min-h-0 flex-1 overflow-auto px-1.5 py-1.5", children: n === "design-tokens" ? d.length === 0 ? /* @__PURE__ */ l("div", { className: "px-2 py-3 text-[11px] text-[#b3b3b3]", children: os().length === 0 ? "No tokens injected" : "No search results" }) : u.map((v) => /* @__PURE__ */ b("div", { children: [
12600
12603
  /* @__PURE__ */ l("div", { className: "px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase text-[#999]", children: v }),
12601
- d.filter((S) => (S.group ?? "etc") === v).map((S) => /* @__PURE__ */ l(Vx, { name: S.name, group: S.group, dark: S.dark }, S.name))
12604
+ d.filter((S) => (S.group ?? "etc") === v).map((S) => /* @__PURE__ */ l(Bx, { name: S.name, group: S.group, dark: S.dark }, S.name))
12602
12605
  ] }, v)) : n === "screens" ? a.length === 0 ? /* @__PURE__ */ l("div", { className: "px-2 py-3 text-[11px] text-[#b3b3b3]", children: "No search results" }) : f.map((v) => /* @__PURE__ */ b("div", { children: [
12603
12606
  /* @__PURE__ */ l("div", { className: "px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase text-[#999]", children: v }),
12604
- a.filter((S) => S.section === v).map((S) => /* @__PURE__ */ l(Hx, { asset: S, onFrameFocus: t }, S.id))
12607
+ a.filter((S) => S.section === v).map((S) => /* @__PURE__ */ l(Wx, { asset: S, onFrameFocus: t }, S.id))
12605
12608
  ] }, v)) : c.length === 0 ? /* @__PURE__ */ l("div", { className: "px-2 py-3 text-[11px] text-[#b3b3b3]", children: "No search results" }) : e ? f.map((v) => /* @__PURE__ */ b("div", { children: [
12606
12609
  /* @__PURE__ */ l("div", { className: "px-2 pb-0.5 pt-2 text-[10px] font-semibold uppercase text-[#999]", children: v }),
12607
12610
  a.filter((S) => S.section === v && S.codeName && _e()[S.codeName]).map((S) => /* @__PURE__ */ l(
@@ -12618,7 +12621,7 @@ function Wx({
12618
12621
  /* @__PURE__ */ l("div", { className: "border-t border-[#e6e6e6] px-3 py-2 text-[10px] leading-relaxed text-[#b3b3b3]", children: p != null && p.complete ? `dev@${((x = p.sourceSha) == null ? void 0 : x.slice(0, 8)) ?? "-"} · Code inventory complete` : "Code inventory" })
12619
12622
  ] });
12620
12623
  }
12621
- const Kx = "pygmalion.design-ir", Ux = 1, qx = {
12624
+ const Ux = "pygmalion.design-ir", qx = 1, Yx = {
12622
12625
  previewNodeLimit: 1200,
12623
12626
  maxNodes: 1e4,
12624
12627
  maxDepth: 64,
@@ -12632,13 +12635,13 @@ function nh(t) {
12632
12635
  nh(e);
12633
12636
  return t;
12634
12637
  }
12635
- function Yx(t) {
12638
+ function Gx(t) {
12636
12639
  return new TextEncoder().encode(t).byteLength;
12637
12640
  }
12638
- function Gx(t) {
12641
+ function Xx(t) {
12639
12642
  return t.startsWith("data:") ? "embedded" : t.startsWith("blob:") ? "ephemeral" : /^https?:\/\//i.test(t) ? "remote" : "project";
12640
12643
  }
12641
- function Xx(t) {
12644
+ function Jx(t) {
12642
12645
  const e = [], n = t.domTag.toLowerCase(), r = t.domAttributes.src;
12643
12646
  r && ["img", "picture", "source"].includes(n) ? e.push({ kind: "image", source: r }) : r && n === "video" && e.push({ kind: "video", source: r });
12644
12647
  const i = t.domAttributes.poster;
@@ -12660,7 +12663,7 @@ function ls(t) {
12660
12663
  t.message
12661
12664
  ].join("\0");
12662
12665
  }
12663
- function Jx(t) {
12666
+ function Zx(t) {
12664
12667
  const e = _e(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = [];
12665
12668
  let o = 0, s = 0, a = 0;
12666
12669
  const c = (p, g, x) => {
@@ -12698,10 +12701,10 @@ function Jx(t) {
12698
12701
  nodeId: p.id,
12699
12702
  nodePath: x
12700
12703
  });
12701
- for (const S of Xx(p)) {
12704
+ for (const S of Jx(p)) {
12702
12705
  const N = `${S.kind}\0${S.source}`, C = r.get(N) ?? {
12703
12706
  ...S,
12704
- portability: Gx(S.source),
12707
+ portability: Xx(S.source),
12705
12708
  nodeIds: /* @__PURE__ */ new Set()
12706
12709
  };
12707
12710
  C.nodeIds.add(p.id), r.set(N, C), C.portability === "ephemeral" && i.push({
@@ -12778,8 +12781,8 @@ function Jx(t) {
12778
12781
  )
12779
12782
  };
12780
12783
  }
12781
- function Zx(t) {
12782
- const e = { ...qx, ...t };
12784
+ function Qx(t) {
12785
+ const e = { ...Yx, ...t };
12783
12786
  for (const [n, r] of Object.entries(e))
12784
12787
  if (!Number.isFinite(r) || r <= 0)
12785
12788
  throw new Error(`Design compile limit "${n}" must be positive.`);
@@ -12789,14 +12792,14 @@ function Zx(t) {
12789
12792
  );
12790
12793
  return e;
12791
12794
  }
12792
- function Z0(t, e) {
12795
+ function Q0(t, e) {
12793
12796
  return rh(t, e).document;
12794
12797
  }
12795
12798
  function rh(t, e) {
12796
- const n = Yt(t), r = Jx(n);
12799
+ const n = Yt(t), r = Zx(n);
12797
12800
  return { document: nh({
12798
- schema: Kx,
12799
- version: Ux,
12801
+ schema: Ux,
12802
+ version: qx,
12800
12803
  root: n,
12801
12804
  ...e ? { frame: { ...e } } : {},
12802
12805
  components: r.components,
@@ -12804,7 +12807,7 @@ function rh(t, e) {
12804
12807
  metrics: r.metrics
12805
12808
  }), diagnostics: r.diagnostics };
12806
12809
  }
12807
- function Qx(t) {
12810
+ function ey(t) {
12808
12811
  const e = t.id.trim();
12809
12812
  if (!e || !t.label.trim() || !t.language.trim())
12810
12813
  throw new Error("Design codegen adapters require an id, label, and language.");
@@ -12815,13 +12818,13 @@ function Qx(t) {
12815
12818
  Qn.get(e) === r && (n ? Qn.set(e, n) : Qn.delete(e));
12816
12819
  };
12817
12820
  }
12818
- function ey() {
12821
+ function ty() {
12819
12822
  return [...Qn.values()].sort(
12820
12823
  (t, e) => t.label.localeCompare(e.label)
12821
12824
  );
12822
12825
  }
12823
- function ty(t, e = {}) {
12824
- const n = e.target ?? "jsx-tailwind", r = e.purpose ?? "export", i = Zx(e.limits), o = rh(
12826
+ function ny(t, e = {}) {
12827
+ const n = e.target ?? "jsx-tailwind", r = e.purpose ?? "export", i = Qx(e.limits), o = rh(
12825
12828
  t,
12826
12829
  e.frame
12827
12830
  ), { document: s } = o, a = [...o.diagnostics], c = Qn.get(n);
@@ -12891,7 +12894,7 @@ function ty(t, e = {}) {
12891
12894
  message: p instanceof Error ? p.message : "The target generator failed."
12892
12895
  });
12893
12896
  }
12894
- const u = Yx(d);
12897
+ const u = Gx(d);
12895
12898
  u > i.maxOutputBytes && (a.push({
12896
12899
  severity: "error",
12897
12900
  stage: "resource",
@@ -12915,14 +12918,14 @@ function ty(t, e = {}) {
12915
12918
  metrics: { ...s.metrics, outputBytes: f === "ready" ? u : 0 }
12916
12919
  };
12917
12920
  }
12918
- Qx({
12921
+ ey({
12919
12922
  id: "jsx-tailwind",
12920
12923
  label: "JSX + Tailwind",
12921
12924
  language: "jsx",
12922
12925
  extension: ".jsx",
12923
12926
  generate: ({ document: t }) => Hc(t.root, t.frame)
12924
12927
  });
12925
- function ny(t) {
12928
+ function ry(t) {
12926
12929
  const e = /* @__PURE__ */ new Map();
12927
12930
  for (const n of t) {
12928
12931
  const r = [
@@ -12935,17 +12938,17 @@ function ny(t) {
12935
12938
  }
12936
12939
  return [...e.values()];
12937
12940
  }
12938
- const ry = lt(function() {
12941
+ const iy = lt(function() {
12939
12942
  var f;
12940
12943
  const [e, n] = W("jsx-tailwind"), [r, i] = W(!1);
12941
12944
  if (!m.codeOpen) return null;
12942
- const o = ey(), s = o.some((p) => p.id === e) ? e : ((f = o[0]) == null ? void 0 : f.id) ?? e, a = ty(m.root, {
12945
+ const o = ty(), s = o.some((p) => p.id === e) ? e : ((f = o[0]) == null ? void 0 : f.id) ?? e, a = ny(m.root, {
12943
12946
  target: s,
12944
12947
  purpose: "interactive",
12945
12948
  force: r
12946
12949
  }), c = a.document.components.filter(
12947
12950
  (p) => p.connectionId
12948
- ).length, d = ny(a.diagnostics), u = d.slice(0, 4);
12951
+ ).length, d = ry(a.diagnostics), u = d.slice(0, 4);
12949
12952
  return /* @__PURE__ */ b("div", { className: "flex h-2/5 min-h-[180px] flex-none flex-col border-t border-[#e6e6e6] bg-[#1e1e1e]", children: [
12950
12953
  /* @__PURE__ */ b("div", { className: "flex items-center gap-2 px-3 py-1.5 text-[11px] text-neutral-400", children: [
12951
12954
  /* @__PURE__ */ l(
@@ -13024,7 +13027,7 @@ const ry = lt(function() {
13024
13027
  )
13025
13028
  ] }) : a.status === "blocked" ? /* @__PURE__ */ l("div", { className: "flex min-h-0 flex-1 items-center justify-center px-6 text-center text-[11px] text-red-300", children: "Resolve the compiler errors before generating code." }) : /* @__PURE__ */ l("pre", { className: "min-h-0 flex-1 overflow-auto px-3 pb-3 text-[11px] leading-relaxed text-emerald-300", children: a.code })
13026
13029
  ] });
13027
- }), iy = lt(function() {
13030
+ }), oy = lt(function() {
13028
13031
  var a;
13029
13032
  const e = m.ctxMenu;
13030
13033
  if (!e) return null;
@@ -13099,7 +13102,7 @@ const ry = lt(function() {
13099
13102
  });
13100
13103
  let cc = null;
13101
13104
  const lc = /* @__PURE__ */ new Set();
13102
- function Q0(t) {
13105
+ function e1(t) {
13103
13106
  if (!Object.is(cc, t)) {
13104
13107
  cc = t;
13105
13108
  for (const e of lc) e();
@@ -13320,7 +13323,7 @@ function di({
13320
13323
  }
13321
13324
  );
13322
13325
  }
13323
- function oy({
13326
+ function sy({
13324
13327
  children: t,
13325
13328
  count: e
13326
13329
  }) {
@@ -13352,7 +13355,7 @@ function ui({
13352
13355
  children: "›"
13353
13356
  }
13354
13357
  ),
13355
- /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ l(oy, { count: e, children: t }) })
13358
+ /* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: /* @__PURE__ */ l(sy, { count: e, children: t }) })
13356
13359
  ]
13357
13360
  }
13358
13361
  ),
@@ -13425,7 +13428,7 @@ function Xd({
13425
13428
  ] })
13426
13429
  ] });
13427
13430
  }
13428
- function sy({
13431
+ function ay({
13429
13432
  model: t,
13430
13433
  onSelectFrame: e,
13431
13434
  activeFrameId: n,
@@ -13681,7 +13684,7 @@ function Jd(t, e, n) {
13681
13684
  );
13682
13685
  return Math.round(t);
13683
13686
  }
13684
- function e1(t) {
13687
+ function t1(t) {
13685
13688
  sh = t.map((e) => {
13686
13689
  const n = String(e.label ?? "").trim();
13687
13690
  if (!n) throw new Error("Viewport preset is missing a label.");
@@ -13699,10 +13702,10 @@ function ah() {
13699
13702
  function ch(t, e) {
13700
13703
  return Math.round(e.width) !== t.width ? !1 : t.height == null || Math.round(e.height) === t.height;
13701
13704
  }
13702
- function ay({ type: t }) {
13705
+ function cy({ type: t }) {
13703
13706
  return /* @__PURE__ */ l("span", { className: `shrink-0 ${t === "component" ? "text-[#9747ff]" : "text-[#999]"}`, children: t === "text" ? /* @__PURE__ */ l(Bf, { size: 10 }) : t === "columns" ? /* @__PURE__ */ l(Uc, { size: 10 }) : t === "component" ? /* @__PURE__ */ l(Di, { size: 10 }) : /* @__PURE__ */ l(as, { size: 10 }) });
13704
13707
  }
13705
- const cy = _i(function t({ node: e, depth: n }) {
13708
+ const ly = _i(function t({ node: e, depth: n }) {
13706
13709
  return kf(() => {
13707
13710
  const r = m.isSelected(e.id), i = m.collapsed.has(e.id), o = e.children.length > 0, s = m.renamingId === e.id, a = e.type === "text" ? e.text : e.name, c = (d) => {
13708
13711
  const u = d.trim();
@@ -13739,7 +13742,7 @@ const cy = _i(function t({ node: e, depth: n }) {
13739
13742
  children: /* @__PURE__ */ l(yi, { open: !i })
13740
13743
  }
13741
13744
  ),
13742
- /* @__PURE__ */ l(ay, { type: e.type }),
13745
+ /* @__PURE__ */ l(cy, { type: e.type }),
13743
13746
  s ? /* @__PURE__ */ l(
13744
13747
  "input",
13745
13748
  {
@@ -13799,7 +13802,7 @@ const cy = _i(function t({ node: e, depth: n }) {
13799
13802
  ] });
13800
13803
  });
13801
13804
  });
13802
- function ly({
13805
+ function dy({
13803
13806
  id: t,
13804
13807
  name: e,
13805
13808
  active: n,
@@ -13836,7 +13839,7 @@ function ly({
13836
13839
  }
13837
13840
  );
13838
13841
  }
13839
- const dy = lt(function({
13842
+ const uy = lt(function({
13840
13843
  onFrameFocus: e = (i) => m.selectFrame(i),
13841
13844
  storyboardConnectionMode: n = "story",
13842
13845
  onStoryboardConnectionModeChange: r = () => {
@@ -13907,7 +13910,7 @@ const dy = lt(function({
13907
13910
  }) })
13908
13911
  ] }),
13909
13912
  a && /* @__PURE__ */ l(
13910
- sy,
13913
+ ay,
13911
13914
  {
13912
13915
  model: a,
13913
13916
  onSelectFrame: e,
@@ -14003,7 +14006,7 @@ const dy = lt(function({
14003
14006
  /* @__PURE__ */ l("span", { className: "h-px flex-1 bg-[#e6e6e6]" })
14004
14007
  ] }),
14005
14008
  /* @__PURE__ */ l(
14006
- ly,
14009
+ dy,
14007
14010
  {
14008
14011
  id: p.id,
14009
14012
  name: p.name,
@@ -14024,14 +14027,14 @@ const dy = lt(function({
14024
14027
  }
14025
14028
  ),
14026
14029
  /* @__PURE__ */ l("div", { className: "px-3 pb-1 pt-1 text-[11px] font-semibold text-[#333]", children: "Layers" }),
14027
- /* @__PURE__ */ l("div", { className: "min-h-0 flex-1 overflow-auto pb-2", children: /* @__PURE__ */ l(cy, { node: m.root, depth: 0 }) })
14030
+ /* @__PURE__ */ l("div", { className: "min-h-0 flex-1 overflow-auto pb-2", children: /* @__PURE__ */ l(ly, { node: m.root, depth: 0 }) })
14028
14031
  ] });
14029
- }), uy = "__pygmalion_environment", t1 = "/__pygmalion-storyboard/environment";
14032
+ }), fy = "__pygmalion_environment", n1 = "/__pygmalion-storyboard/environment";
14030
14033
  let lh;
14031
14034
  function $r(t) {
14032
14035
  return t ? JSON.parse(JSON.stringify(t)) : void 0;
14033
14036
  }
14034
- function n1(t) {
14037
+ function r1(t) {
14035
14038
  lh = $r(t);
14036
14039
  }
14037
14040
  function dc() {
@@ -14059,7 +14062,7 @@ function Kr(t, e) {
14059
14062
  }
14060
14063
  } : $r(t) : $r(e);
14061
14064
  }
14062
- function fy(t) {
14065
+ function hy(t) {
14063
14066
  const e = new TextEncoder().encode(t);
14064
14067
  let n = "";
14065
14068
  for (const r of e) n += String.fromCharCode(r);
@@ -14079,8 +14082,8 @@ function Zd(t, e, n) {
14079
14082
  ), s.search = c.search, s.hash = c.hash, s;
14080
14083
  })();
14081
14084
  return a.searchParams.set(
14082
- uy,
14083
- fy(JSON.stringify(n))
14085
+ fy,
14086
+ hy(JSON.stringify(n))
14084
14087
  ), a.href;
14085
14088
  } catch {
14086
14089
  return r;
@@ -14089,10 +14092,10 @@ function Zd(t, e, n) {
14089
14092
  let Ki = [], Qd = "[]";
14090
14093
  const mr = /* @__PURE__ */ new Map(), uc = /* @__PURE__ */ new Set();
14091
14094
  let dh = 0;
14092
- function hy(t) {
14095
+ function py(t) {
14093
14096
  return t ? JSON.parse(JSON.stringify(t)) : void 0;
14094
14097
  }
14095
- function py(t) {
14098
+ function my(t) {
14096
14099
  const e = /* @__PURE__ */ new Set();
14097
14100
  return t.map((n) => {
14098
14101
  const r = String(n.id ?? "").trim(), i = String(n.label ?? "").trim(), o = String(n.defaultValue ?? "").trim();
@@ -14116,7 +14119,7 @@ function py(t) {
14116
14119
  value: d,
14117
14120
  label: u,
14118
14121
  ...c.description ? { description: c.description } : {},
14119
- ...c.environment ? { environment: hy(c.environment) } : {}
14122
+ ...c.environment ? { environment: py(c.environment) } : {}
14120
14123
  };
14121
14124
  });
14122
14125
  if (!a.length)
@@ -14138,19 +14141,19 @@ function Yc() {
14138
14141
  dh += 1;
14139
14142
  for (const t of uc) t();
14140
14143
  }
14141
- function r1(t) {
14142
- const e = py(t), n = JSON.stringify(e);
14144
+ function i1(t) {
14145
+ const e = my(t), n = JSON.stringify(e);
14143
14146
  n !== Qd && (Ki = e, Qd = n, mr.clear(), Yc());
14144
14147
  }
14145
- function my() {
14148
+ function gy() {
14146
14149
  return Ki;
14147
14150
  }
14148
- function gy(t) {
14151
+ function by(t) {
14149
14152
  const e = Ki.find((n) => n.id === t);
14150
14153
  if (e)
14151
14154
  return mr.get(e.id) ?? e.defaultValue;
14152
14155
  }
14153
- function by(t, e) {
14156
+ function vy(t, e) {
14154
14157
  const n = Ki.find((r) => r.id === t);
14155
14158
  if (!n) throw new Error(`Unknown preview environment control "${t}".`);
14156
14159
  if (!n.options.some((r) => r.value === e))
@@ -14159,10 +14162,10 @@ function by(t, e) {
14159
14162
  );
14160
14163
  mr.get(t) !== e && (mr.set(t, e), Yc());
14161
14164
  }
14162
- function i1() {
14165
+ function o1() {
14163
14166
  mr.size && (mr.clear(), Yc());
14164
14167
  }
14165
- function vy() {
14168
+ function xy() {
14166
14169
  let t;
14167
14170
  for (const e of Ki) {
14168
14171
  const n = mr.get(e.id);
@@ -14178,12 +14181,12 @@ function Gc(t) {
14178
14181
  function Lr() {
14179
14182
  return dh;
14180
14183
  }
14181
- const xy = [
14184
+ const yy = [
14182
14185
  { v: "fill", label: "Fill" },
14183
14186
  { v: "fit", label: "Hug" },
14184
14187
  { v: "fixed", label: "Fixed" }
14185
14188
  ];
14186
- function yy({ node: t }) {
14189
+ function wy({ node: t }) {
14187
14190
  const e = m.sharedSourceImpactFor(t);
14188
14191
  if (e.frames.length < 2) return null;
14189
14192
  const n = m.sharedSourceEditScopeFor(t), r = e.frames.slice(0, 3).map((s) => s.name), i = e.frames.length - r.length, o = `${r.join(" · ")}${i > 0 ? ` · ${i} more` : ""}`;
@@ -14218,7 +14221,7 @@ function yy({ node: t }) {
14218
14221
  /* @__PURE__ */ l("div", { className: "text-[10px] leading-relaxed text-[#999]", children: "Unsupported source operations remain limited to the selected frame." })
14219
14222
  ] });
14220
14223
  }
14221
- function wy({ node: t }) {
14224
+ function Sy({ node: t }) {
14222
14225
  const e = Object.entries(t.sourceProps);
14223
14226
  if (e.length === 0) return null;
14224
14227
  const n = t.domAttributes["data-pygmalion-own-source"] ?? t.domAttributes["data-pygmalion-source"] ?? "", r = n.split("|", 2).join(":");
@@ -14320,7 +14323,7 @@ function eu({ value: t, onChange: e }) {
14320
14323
  className: "h-7 min-w-0 flex-1 rounded-md bg-[#f5f5f5] px-1.5 text-[11px] text-[#333] outline-none hover:ring-1 hover:ring-inset hover:ring-[#e6e6e6]",
14321
14324
  value: t,
14322
14325
  onChange: (n) => e(n.target.value),
14323
- children: xy.map((n) => /* @__PURE__ */ l("option", { value: n.v, children: n.label }, n.v))
14326
+ children: yy.map((n) => /* @__PURE__ */ l("option", { value: n.v, children: n.label }, n.v))
14324
14327
  }
14325
14328
  );
14326
14329
  }
@@ -14434,7 +14437,7 @@ function tu({
14434
14437
  )) });
14435
14438
  }
14436
14439
  const nu = ["start", "center", "end"];
14437
- function Sy({ node: t }) {
14440
+ function Ny({ node: t }) {
14438
14441
  const e = t.type === "rows", n = (i, o) => m.patch(
14439
14442
  t,
14440
14443
  e ? { justify: i, alignItems: o } : { justify: o, alignItems: i }
@@ -14470,14 +14473,14 @@ function Sy({ node: t }) {
14470
14473
  )
14471
14474
  ] });
14472
14475
  }
14473
- function Ny(t) {
14476
+ function _y(t) {
14474
14477
  const e = t.root.domStyle.display;
14475
14478
  if (e === "grid" || e === "inline-grid") return "grid";
14476
14479
  if (e === "block" || e === "contents") return "free";
14477
14480
  const n = t.root.domStyle.flexDirection;
14478
14481
  return n != null && n.startsWith("row") ? "horizontal" : n != null && n.startsWith("column") ? "vertical" : t.root.type === "columns" ? "horizontal" : "vertical";
14479
14482
  }
14480
- function _y({ mode: t }) {
14483
+ function Cy({ mode: t }) {
14481
14484
  return t === "grid" ? /* @__PURE__ */ l("span", { "aria-hidden": "true", className: "grid h-4 w-4 grid-cols-2 gap-[3px]", children: [0, 1, 2, 3].map((e) => /* @__PURE__ */ l("i", { className: "rounded-[2px] border border-current" }, e)) }) : t === "vertical" || t === "horizontal" ? /* @__PURE__ */ b("span", { "aria-hidden": "true", className: `flex items-center gap-[3px] ${t === "vertical" ? "flex-col" : ""}`, children: [
14482
14485
  /* @__PURE__ */ l("i", { className: "h-[5px] w-[5px] rounded-[2px] border border-current" }),
14483
14486
  /* @__PURE__ */ l("i", { className: "h-[5px] w-[5px] rounded-[2px] border border-current" }),
@@ -14488,13 +14491,13 @@ function _y({ mode: t }) {
14488
14491
  /* @__PURE__ */ l("i", { className: "absolute bottom-0 left-[4px] h-[5px] w-[5px] rounded-[2px] border border-current" })
14489
14492
  ] });
14490
14493
  }
14491
- const Cy = lt(function({ page: e }) {
14494
+ const Ey = lt(function({ page: e }) {
14492
14495
  At(
14493
14496
  Gc,
14494
14497
  Lr,
14495
14498
  Lr
14496
14499
  );
14497
- const n = e.route == null, r = (g) => m.patchPage(e.id, g), i = Ny(e), o = (g) => {
14500
+ const n = e.route == null, r = (g) => m.patchPage(e.id, g), i = _y(e), o = (g) => {
14498
14501
  const x = { ...e.root.domStyle };
14499
14502
  g === "free" ? (x.display = "block", x.position = "relative", delete x.flexDirection, delete x.gridTemplateColumns) : g === "grid" ? (x.display = "grid", x.gridTemplateColumns || (x.gridTemplateColumns = "repeat(2, minmax(0, 1fr))"), x.gap || (x.gap = `${e.root.gap}px`), delete x.flexDirection) : (x.display = "flex", x.flexDirection = g === "horizontal" ? "row" : "column", delete x.gridTemplateColumns), m.patch(e.root, {
14500
14503
  type: g === "horizontal" ? "columns" : "rows",
@@ -14523,7 +14526,7 @@ const Cy = lt(function({ page: e }) {
14523
14526
  resizeHeight: g.height != null
14524
14527
  }
14525
14528
  );
14526
- }, d = ah(), u = my(), f = e.authoredFrameSize, p = m.frameSizeDiffersFromAuthored(e.id);
14529
+ }, d = ah(), u = gy(), f = e.authoredFrameSize, p = m.frameSizeDiffersFromAuthored(e.id);
14527
14530
  return /* @__PURE__ */ b("div", { "data-object-props": "frame", className: "min-h-0 flex-1 overflow-auto", children: [
14528
14531
  /* @__PURE__ */ l(Fe, { title: "Frame", children: /* @__PURE__ */ l(
14529
14532
  "input",
@@ -14622,7 +14625,7 @@ const Cy = lt(function({ page: e }) {
14622
14625
  gridTemplateColumns: `repeat(${g.options.length}, minmax(0, 1fr))`
14623
14626
  },
14624
14627
  children: g.options.map((x) => {
14625
- const v = gy(g.id) === x.value;
14628
+ const v = by(g.id) === x.value;
14626
14629
  return /* @__PURE__ */ l(
14627
14630
  "button",
14628
14631
  {
@@ -14630,7 +14633,7 @@ const Cy = lt(function({ page: e }) {
14630
14633
  "aria-pressed": v,
14631
14634
  title: x.description,
14632
14635
  className: `h-8 truncate rounded-md px-2 text-[10px] font-semibold ${v ? "bg-white text-[#333] shadow-sm ring-1 ring-inset ring-[#dedee3]" : "text-[#777] hover:text-[#333]"}`,
14633
- onClick: () => by(g.id, x.value),
14636
+ onClick: () => vy(g.id, x.value),
14634
14637
  children: x.label
14635
14638
  },
14636
14639
  x.value
@@ -14705,7 +14708,7 @@ const Cy = lt(function({ page: e }) {
14705
14708
  "aria-pressed": i === g,
14706
14709
  className: `flex h-8 items-center justify-center rounded-md ${i === g ? "bg-white text-[#18181b] shadow-sm ring-1 ring-inset ring-[#dedee3]" : "text-[#777] hover:text-[#333]"}`,
14707
14710
  onClick: () => o(g),
14708
- children: /* @__PURE__ */ l(_y, { mode: g })
14711
+ children: /* @__PURE__ */ l(Cy, { mode: g })
14709
14712
  },
14710
14713
  g
14711
14714
  )) }),
@@ -14785,7 +14788,7 @@ const Cy = lt(function({ page: e }) {
14785
14788
  )
14786
14789
  ] })
14787
14790
  ] });
14788
- }), Ey = lt(function({ section: e }) {
14791
+ }), Ay = lt(function({ section: e }) {
14789
14792
  const n = m.canvasPages.filter((r) => r.section === e.name).length;
14790
14793
  return /* @__PURE__ */ b("div", { "data-object-props": "section", className: "min-h-0 flex-1 overflow-auto", children: [
14791
14794
  /* @__PURE__ */ b(Fe, { title: "Section", children: [
@@ -14862,15 +14865,15 @@ const Cy = lt(function({ page: e }) {
14862
14865
  }
14863
14866
  ) })
14864
14867
  ] });
14865
- }), Ay = lt(function() {
14868
+ }), Oy = lt(function() {
14866
14869
  var c, d;
14867
14870
  if (((c = m.selectedCanvasObject) == null ? void 0 : c.kind) === "frame") {
14868
14871
  const u = m.selectedFrame;
14869
- return u ? /* @__PURE__ */ l(Cy, { page: u }) : null;
14872
+ return u ? /* @__PURE__ */ l(Ey, { page: u }) : null;
14870
14873
  }
14871
14874
  if (((d = m.selectedCanvasObject) == null ? void 0 : d.kind) === "section") {
14872
14875
  const u = m.selectedSection;
14873
- return u ? /* @__PURE__ */ l(Ey, { section: u }) : null;
14876
+ return u ? /* @__PURE__ */ l(Ay, { section: u }) : null;
14874
14877
  }
14875
14878
  const e = m.selected;
14876
14879
  if (!e)
@@ -14885,8 +14888,8 @@ const Cy = lt(function({ page: e }) {
14885
14888
  m.selectedIds.length,
14886
14889
  " selected · Property edits use the primary selection"
14887
14890
  ] }),
14888
- /* @__PURE__ */ l(yy, { node: e }),
14889
14891
  /* @__PURE__ */ l(wy, { node: e }),
14892
+ /* @__PURE__ */ l(Sy, { node: e }),
14890
14893
  /* @__PURE__ */ l(Fe, { title: e.name, children: /* @__PURE__ */ l(
14891
14894
  "input",
14892
14895
  {
@@ -14949,7 +14952,7 @@ const Cy = lt(function({ page: e }) {
14949
14952
  onChange: (u) => n({ type: u })
14950
14953
  }
14951
14954
  ),
14952
- /* @__PURE__ */ l(Sy, { node: e }),
14955
+ /* @__PURE__ */ l(Ny, { node: e }),
14953
14956
  /* @__PURE__ */ b("div", { className: "flex gap-1.5", children: [
14954
14957
  /* @__PURE__ */ l(Ke, { label: "Gap", value: e.gap, onChange: (u) => n({ gap: u }) }),
14955
14958
  /* @__PURE__ */ l(Ke, { label: "Padding", value: e.padding, onChange: (u) => n({ padding: u }) })
@@ -15066,11 +15069,11 @@ const Cy = lt(function({ page: e }) {
15066
15069
  ] })
15067
15070
  ] });
15068
15071
  });
15069
- function Oy(t) {
15072
+ function Py(t) {
15070
15073
  return [...new Set(t)].sort().join(`
15071
15074
  `);
15072
15075
  }
15073
- const uh = /^sha256-[a-f0-9]{64}$/, Py = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), yn = {
15076
+ const uh = /^sha256-[a-f0-9]{64}$/, My = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), yn = {
15074
15077
  bundleBytes: 128 * 1024 * 1024,
15075
15078
  snapshotBytes: 8 * 1024 * 1024,
15076
15079
  bodyBytes: 8 * 1024 * 1024,
@@ -15089,7 +15092,7 @@ function Jn(t) {
15089
15092
  const e = Object.getPrototypeOf(t);
15090
15093
  return e === Object.prototype || e === null;
15091
15094
  }
15092
- function My(t) {
15095
+ function Iy(t) {
15093
15096
  try {
15094
15097
  return Os(JSON.stringify(t));
15095
15098
  } catch {
@@ -15097,9 +15100,9 @@ function My(t) {
15097
15100
  }
15098
15101
  }
15099
15102
  function ya(t) {
15100
- return typeof t == "string" && t.length > 0 && t.length <= yn.identifierLength && t === t.trim() && !Py.has(t);
15103
+ return typeof t == "string" && t.length > 0 && t.length <= yn.identifierLength && t === t.trim() && !My.has(t);
15101
15104
  }
15102
- function Iy(t) {
15105
+ function $y(t) {
15103
15106
  const e = /(?:expression\s*\(|-moz-binding\s*:|(?:^|[;{])\s*behavior\s*:)/i;
15104
15107
  for (const n of t.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi))
15105
15108
  if (e.test(n[1] ?? "")) return !0;
@@ -15109,10 +15112,10 @@ function Iy(t) {
15109
15112
  if (e.test(n[1] ?? n[2] ?? n[3] ?? "")) return !0;
15110
15113
  return !1;
15111
15114
  }
15112
- function $y(t) {
15115
+ function ky(t) {
15113
15116
  return typeof t != "string" || t.length === 0 ? "snapshot must be a non-empty string" : Os(t) > yn.snapshotBytes ? "snapshot exceeds the byte limit" : /<\s*(?:script|iframe|object|embed|applet|portal)\b/i.test(t) ? "snapshot contains an active element" : /<\s*meta\b[^>]*http-equiv\s*=\s*["']?\s*refresh\b/i.test(t) ? "snapshot contains a refresh directive" : /\s(?:on[a-z][\w:-]*|srcdoc)\s*=/i.test(t) ? "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(
15114
15117
  t
15115
- ) ? "snapshot contains an active URL" : Iy(t) ? "snapshot contains an active style expression" : null;
15118
+ ) ? "snapshot contains an active URL" : $y(t) ? "snapshot contains an active style expression" : null;
15116
15119
  }
15117
15120
  function ru(t, e, n) {
15118
15121
  if (!Jn(t))
@@ -15134,7 +15137,7 @@ function fh(t, e) {
15134
15137
  return `${r.doctype}<html${r.htmlAttributes}><head${r.headAttributes}>${n}</head><body${r.bodyAttributes}>${e.body}</body></html>`;
15135
15138
  }
15136
15139
  function Ps(t) {
15137
- const e = [], n = My(t);
15140
+ const e = [], n = Iy(t);
15138
15141
  if (!Jn(t) || t.version !== 2)
15139
15142
  return {
15140
15143
  valid: !1,
@@ -15195,7 +15198,7 @@ function Ps(t) {
15195
15198
  const g = fh(
15196
15199
  t,
15197
15200
  u
15198
- ), x = $y(g);
15201
+ ), x = ky(g);
15199
15202
  x && e.push(`Frame "${d}" reconstructs an unsafe snapshot: ${x}.`);
15200
15203
  }
15201
15204
  for (const d of i)
@@ -15211,11 +15214,11 @@ function hh(t, e) {
15211
15214
  const r = t, i = r.frames[e];
15212
15215
  return i ? fh(r, i) : null;
15213
15216
  }
15214
- const ph = /^sha256-[a-f0-9]{64}$/, ky = /^[A-Za-z][A-Za-z0-9]*(?:[-_.:][A-Za-z0-9]+)*$/, Ty = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/, Dy = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), Ry = /* @__PURE__ */ new Set([
15217
+ const ph = /^sha256-[a-f0-9]{64}$/, Ty = /^[A-Za-z][A-Za-z0-9]*(?:[-_.:][A-Za-z0-9]+)*$/, Dy = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/, Ry = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]), zy = /* @__PURE__ */ new Set([
15215
15218
  "ready",
15216
15219
  "rendered-with-qa-failure",
15217
15220
  "capture-error"
15218
- ]), zy = /* @__PURE__ */ new Set(["interaction", "assertion"]), mh = /* @__PURE__ */ new Set([
15221
+ ]), Fy = /* @__PURE__ */ new Set(["interaction", "assertion"]), mh = /* @__PURE__ */ new Set([
15219
15222
  "image/png",
15220
15223
  "image/webp"
15221
15224
  ]), bt = {
@@ -15231,12 +15234,12 @@ const ph = /^sha256-[a-f0-9]{64}$/, ky = /^[A-Za-z][A-Za-z0-9]*(?:[-_.:][A-Za-z0
15231
15234
  messageLength: 4096,
15232
15235
  viewportDimension: 32768
15233
15236
  };
15234
- function Fy(t) {
15237
+ function Ly(t) {
15235
15238
  return new TextEncoder().encode(t).byteLength;
15236
15239
  }
15237
- function Ly(t) {
15240
+ function jy(t) {
15238
15241
  try {
15239
- return Fy(JSON.stringify(t));
15242
+ return Ly(JSON.stringify(t));
15240
15243
  } catch {
15241
15244
  return Number.POSITIVE_INFINITY;
15242
15245
  }
@@ -15247,22 +15250,22 @@ function mt(t) {
15247
15250
  return e === Object.prototype || e === null;
15248
15251
  }
15249
15252
  function wa(t) {
15250
- return typeof t == "string" && t.length > 0 && t.length <= bt.identifierLength && t === t.trim() && !Dy.has(t);
15253
+ return typeof t == "string" && t.length > 0 && t.length <= bt.identifierLength && t === t.trim() && !Ry.has(t);
15251
15254
  }
15252
15255
  function gh(t) {
15253
15256
  return mt(t) && Number.isInteger(t.width) && Number(t.width) > 0 && Number(t.width) <= bt.viewportDimension && Number.isInteger(t.height) && Number(t.height) > 0 && Number(t.height) <= bt.viewportDimension;
15254
15257
  }
15255
- function jy(t, e) {
15258
+ function Vy(t, e) {
15256
15259
  return gh(t) && t.width === e.width && t.height === e.height;
15257
15260
  }
15258
15261
  function iu(t) {
15259
- return typeof t == "string" && t.length > 0 && t.length <= bt.tokenLength && ky.test(t);
15262
+ return typeof t == "string" && t.length > 0 && t.length <= bt.tokenLength && Ty.test(t);
15260
15263
  }
15261
15264
  function Sa(t, e) {
15262
15265
  return t == null || typeof t == "string" && t.length > 0 && t.length <= e && !/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/.test(t);
15263
15266
  }
15264
- function Vy(t) {
15265
- if (typeof t != "string" || t.length === 0 || !Ty.test(t))
15267
+ function By(t) {
15268
+ if (typeof t != "string" || t.length === 0 || !Dy.test(t))
15266
15269
  return null;
15267
15270
  const e = t.endsWith("==") ? 2 : t.endsWith("=") ? 1 : 0;
15268
15271
  return t.length / 4 * 3 - e;
@@ -15283,7 +15286,7 @@ function bh(t) {
15283
15286
  frames: r
15284
15287
  };
15285
15288
  }
15286
- function By(t, e) {
15289
+ function Hy(t, e) {
15287
15290
  if (!mt(t))
15288
15291
  return e.push("Screenshot assets must be a record."), /* @__PURE__ */ new Map();
15289
15292
  const n = /* @__PURE__ */ new Map();
@@ -15292,7 +15295,7 @@ function By(t, e) {
15292
15295
  e.push(`Screenshot asset "${r}" is invalid.`);
15293
15296
  continue;
15294
15297
  }
15295
- const o = Vy(i.data);
15298
+ const o = By(i.data);
15296
15299
  if (!mh.has(
15297
15300
  i.mediaType
15298
15301
  ) || !Number.isInteger(i.width) || Number(i.width) <= 0 || Number(i.width) > bt.viewportDimension || !Number.isInteger(i.height) || Number(i.height) <= 0 || Number(i.height) > bt.viewportDimension || !Number.isInteger(i.byteLength) || Number(i.byteLength) <= 0 || Number(i.byteLength) > bt.screenshotAssetBytes || o !== i.byteLength) {
@@ -15306,18 +15309,18 @@ function By(t, e) {
15306
15309
  }
15307
15310
  return n.size > bt.screenshotAssetCount && e.push("Artifact has too many screenshot assets."), n;
15308
15311
  }
15309
- function Hy(t, e, n, r) {
15312
+ function Wy(t, e, n, r) {
15310
15313
  if (!mt(t)) {
15311
15314
  r.push(`Frame "${e}" contains an invalid diagnostic.`);
15312
15315
  return;
15313
15316
  }
15314
- iu(t.stage) || r.push(`Frame "${e}" diagnostic stage is invalid.`), iu(t.code) || r.push(`Frame "${e}" diagnostic code is invalid.`), Sa(t.selector, bt.selectorLength) || r.push(`Frame "${e}" diagnostic selector is invalid.`), Sa(t.label, bt.labelLength) || r.push(`Frame "${e}" diagnostic label is invalid.`), Sa(t.message, bt.messageLength) || r.push(`Frame "${e}" diagnostic message is invalid.`), jy(t.viewport, n) || r.push(`Frame "${e}" diagnostic viewport is invalid.`);
15317
+ iu(t.stage) || r.push(`Frame "${e}" diagnostic stage is invalid.`), iu(t.code) || r.push(`Frame "${e}" diagnostic code is invalid.`), Sa(t.selector, bt.selectorLength) || r.push(`Frame "${e}" diagnostic selector is invalid.`), Sa(t.label, bt.labelLength) || r.push(`Frame "${e}" diagnostic label is invalid.`), Sa(t.message, bt.messageLength) || r.push(`Frame "${e}" diagnostic message is invalid.`), Vy(t.viewport, n) || r.push(`Frame "${e}" diagnostic viewport is invalid.`);
15315
15318
  }
15316
- function Wy(t) {
15317
- return typeof t == "string" && t.split(/[._:-]/).some((e) => zy.has(e.toLowerCase()));
15319
+ function Ky(t) {
15320
+ return typeof t == "string" && t.split(/[._:-]/).some((e) => Fy.has(e.toLowerCase()));
15318
15321
  }
15319
15322
  function Ms(t) {
15320
- const e = [], n = Ly(t);
15323
+ const e = [], n = jy(t);
15321
15324
  if (!mt(t) || t.version !== 3)
15322
15325
  return {
15323
15326
  valid: !1,
@@ -15327,7 +15330,7 @@ function Ms(t) {
15327
15330
  wa(t.namespace) || e.push("Artifact namespace is invalid."), t.sourceRevision != null && !wa(t.sourceRevision) && e.push("Artifact source revision is invalid."), n > bt.bundleBytes && e.push("Artifact exceeds the bundle byte limit.");
15328
15331
  const r = mt(t.assets) ? t.assets : null;
15329
15332
  r || e.push("Artifact assets must be a record.");
15330
- const i = By(
15333
+ const i = Hy(
15331
15334
  r == null ? void 0 : r.screenshots,
15332
15335
  e
15333
15336
  ), o = Ps(bh(t));
@@ -15341,7 +15344,7 @@ function Ms(t) {
15341
15344
  e.push(`Frame identifier "${c}" is invalid.`);
15342
15345
  continue;
15343
15346
  }
15344
- if (!mt(d) || !Ry.has(d.status) || !gh(d.viewport)) {
15347
+ if (!mt(d) || !zy.has(d.status) || !gh(d.viewport)) {
15345
15348
  e.push(`Frame "${c}" status or viewport is invalid.`);
15346
15349
  continue;
15347
15350
  }
@@ -15351,7 +15354,7 @@ function Ms(t) {
15351
15354
  continue;
15352
15355
  }
15353
15356
  for (const g of u)
15354
- Hy(g, c, d.viewport, e);
15357
+ Wy(g, c, d.viewport, e);
15355
15358
  let f = !1;
15356
15359
  if (d.screenshot !== void 0) {
15357
15360
  const g = d.screenshot;
@@ -15368,14 +15371,14 @@ function Ms(t) {
15368
15371
  }
15369
15372
  const p = d.snapshot !== void 0;
15370
15373
  d.status === "ready" ? ((!p || !f) && e.push(`Frame "${c}" ready output is incomplete.`), u.length !== 0 && e.push(`Frame "${c}" ready output cannot contain diagnostics.`)) : d.status === "rendered-with-qa-failure" ? ((!p || !f) && e.push(`Frame "${c}" QA failure must preserve stable output.`), (u.length === 0 || !u.some(
15371
- (g) => mt(g) ? Wy(g.stage) : !1
15374
+ (g) => mt(g) ? Ky(g.stage) : !1
15372
15375
  )) && e.push(`Frame "${c}" QA failure requires a QA diagnostic.`)) : u.length === 0 && e.push(`Frame "${c}" capture error requires a diagnostic.`);
15373
15376
  }
15374
15377
  for (const c of i.keys())
15375
15378
  a.has(c) || e.push(`Screenshot asset "${c}" is unreferenced.`);
15376
15379
  return { valid: e.length === 0, errors: e, bytes: n };
15377
15380
  }
15378
- function o1(t, e) {
15381
+ function s1(t, e) {
15379
15382
  var i;
15380
15383
  const n = Ms(t);
15381
15384
  if (!n.valid)
@@ -15388,7 +15391,7 @@ function o1(t, e) {
15388
15391
  e
15389
15392
  ) : null;
15390
15393
  }
15391
- function s1(t, e) {
15394
+ function a1(t, e) {
15392
15395
  var s;
15393
15396
  const n = Ms(t);
15394
15397
  if (!n.valid)
@@ -15405,7 +15408,7 @@ function s1(t, e) {
15405
15408
  dataUrl: `data:${o.mediaType};base64,${o.data}`
15406
15409
  };
15407
15410
  }
15408
- const Ky = "pygmalion-preview", Uy = "unknown", qy = 512, Yy = 2048, Gy = 8 * 1024 * 1024, Xy = 128 * 1024 * 1024, Jy = /* @__PURE__ */ new Set([
15411
+ const Uy = "pygmalion-preview", qy = "unknown", Yy = 512, Gy = 2048, Xy = 8 * 1024 * 1024, Jy = 128 * 1024 * 1024, Zy = /* @__PURE__ */ new Set([
15409
15412
  "__proto__",
15410
15413
  "constructor",
15411
15414
  "prototype"
@@ -15416,7 +15419,7 @@ function En(t, e) {
15416
15419
  if (Fo(n)) return n;
15417
15420
  throw new TypeError("Preview identity must be a non-empty bounded string.");
15418
15421
  }
15419
- function Zy(t) {
15422
+ function Qy(t) {
15420
15423
  const e = t ?? 1;
15421
15424
  if (!Number.isSafeInteger(e) || e < 1)
15422
15425
  throw new TypeError(
@@ -15443,7 +15446,7 @@ function fc(t, e = /* @__PURE__ */ new Set()) {
15443
15446
  }
15444
15447
  return e.delete(t), n;
15445
15448
  }
15446
- function Qy(t) {
15449
+ function ew(t) {
15447
15450
  let e = 2166136261, n = 2654435769;
15448
15451
  for (let r = 0; r < t.length; r += 1) {
15449
15452
  const i = t.charCodeAt(r);
@@ -15463,10 +15466,10 @@ function vh(t) {
15463
15466
  recipe: fc(i)
15464
15467
  };
15465
15468
  });
15466
- return Qy(JSON.stringify(n));
15469
+ return ew(JSON.stringify(n));
15467
15470
  }
15468
- function ew(t, e = {}) {
15469
- const n = rw(t), r = e.dependencyDigest;
15471
+ function tw(t, e = {}) {
15472
+ const n = iw(t), r = e.dependencyDigest;
15470
15473
  return vh([
15471
15474
  {
15472
15475
  id: En(t.id ?? "", "frame"),
@@ -15475,16 +15478,16 @@ function ew(t, e = {}) {
15475
15478
  ]);
15476
15479
  }
15477
15480
  const hc = /* @__PURE__ */ new Map();
15478
- function a1(t) {
15481
+ function c1(t) {
15479
15482
  hc.clear();
15480
15483
  for (const e of t ?? [])
15481
15484
  typeof (e == null ? void 0 : e.path) != "string" || !e.path.trim() || typeof e.dependencyDigest != "string" || !e.dependencyDigest || hc.set(e.path, e.dependencyDigest);
15482
15485
  }
15483
- function tw(t) {
15486
+ function nw(t) {
15484
15487
  return hc.get(t);
15485
15488
  }
15486
- function nw(t, e, n) {
15487
- return ew(
15489
+ function rw(t, e, n) {
15490
+ return tw(
15488
15491
  {
15489
15492
  id: t.canonicalId,
15490
15493
  route: t.route,
@@ -15501,23 +15504,23 @@ function nw(t, e, n) {
15501
15504
  {
15502
15505
  // A route's own digest when the scan published one; the revision is the
15503
15506
  // fallback, which only means "invalidate as often as before".
15504
- dependencyDigest: tw(t.route) ?? e.split(":")[0] ?? e
15507
+ dependencyDigest: nw(t.route) ?? e.split(":")[0] ?? e
15505
15508
  }
15506
15509
  );
15507
15510
  }
15508
- function c1({
15511
+ function l1({
15509
15512
  sourceRevision: t,
15510
15513
  recipes: e,
15511
15514
  recipeVersion: n,
15512
- scope: r = Ky
15515
+ scope: r = Uy
15513
15516
  }) {
15514
15517
  const i = En(r), o = En(
15515
15518
  t,
15516
- Uy
15517
- ), s = Zy(n), a = vh(e);
15519
+ qy
15520
+ ), s = Qy(n), a = vh(e);
15518
15521
  return `${i}:${encodeURIComponent(o)}:recipe-v${s}:${a}`;
15519
15522
  }
15520
- function rw(t) {
15523
+ function iw(t) {
15521
15524
  return {
15522
15525
  route: t.route,
15523
15526
  path: t.path,
@@ -15544,7 +15547,7 @@ function rw(t) {
15544
15547
  assertions: t.assertions
15545
15548
  };
15546
15549
  }
15547
- function l1({
15550
+ function d1({
15548
15551
  endpoint: t,
15549
15552
  fetcher: e,
15550
15553
  captureBaseUrl: n
@@ -15591,9 +15594,9 @@ function xh(t) {
15591
15594
  return new TextEncoder().encode(t).byteLength;
15592
15595
  }
15593
15596
  function Fo(t) {
15594
- return typeof t == "string" && t.length > 0 && t.length <= qy && t === t.trim() && !Jy.has(t);
15597
+ return typeof t == "string" && t.length > 0 && t.length <= Yy && t === t.trim() && !Zy.has(t);
15595
15598
  }
15596
- function iw(t) {
15599
+ function ow(t) {
15597
15600
  const e = /(?:expression\s*\(|-moz-binding\s*:|(?:^|[;{])\s*behavior\s*:)/i;
15598
15601
  for (const n of t.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi))
15599
15602
  if (e.test(n[1] ?? "")) return !0;
@@ -15603,12 +15606,12 @@ function iw(t) {
15603
15606
  if (e.test(n[1] ?? n[2] ?? n[3] ?? "")) return !0;
15604
15607
  return !1;
15605
15608
  }
15606
- function ow(t) {
15607
- return typeof t != "string" || t.length === 0 || xh(t) > Gy ? !1 : !(/<\s*(?:script|iframe|object|embed|applet|portal)\b/i.test(t) || /<\s*meta\b[^>]*http-equiv\s*=\s*["']?\s*refresh\b/i.test(t) || /\s(?:on[a-z][\w:-]*|srcdoc)\s*=/i.test(t) || /\s(?:href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*|'?\s*)(?:javascript|vbscript|data\s*:\s*text\/html)\s*:/i.test(
15609
+ function sw(t) {
15610
+ return typeof t != "string" || t.length === 0 || xh(t) > Xy ? !1 : !(/<\s*(?:script|iframe|object|embed|applet|portal)\b/i.test(t) || /<\s*meta\b[^>]*http-equiv\s*=\s*["']?\s*refresh\b/i.test(t) || /\s(?:on[a-z][\w:-]*|srcdoc)\s*=/i.test(t) || /\s(?:href|src|action|formaction|xlink:href)\s*=\s*(?:"\s*|'?\s*)(?:javascript|vbscript|data\s*:\s*text\/html)\s*:/i.test(
15608
15611
  t
15609
- ) || iw(t));
15612
+ ) || ow(t));
15610
15613
  }
15611
- function sw(t) {
15614
+ function aw(t) {
15612
15615
  const e = [];
15613
15616
  if (!jr(t) || t.version !== 1)
15614
15617
  return {
@@ -15622,12 +15625,12 @@ function sw(t) {
15622
15625
  e.push("Preview artifact snapshots must be a record.");
15623
15626
  else {
15624
15627
  const n = Object.entries(t.snapshots);
15625
- n.length > Yy && e.push("Preview artifact has too many frames.");
15628
+ n.length > Gy && e.push("Preview artifact has too many frames.");
15626
15629
  for (const [r, i] of n)
15627
- (!Fo(r) || !ow(i)) && e.push(`Preview artifact frame "${r}" is invalid.`);
15630
+ (!Fo(r) || !sw(i)) && e.push(`Preview artifact frame "${r}" is invalid.`);
15628
15631
  }
15629
15632
  try {
15630
- xh(JSON.stringify(t)) > Xy && e.push("Preview artifact exceeds the bundle byte limit.");
15633
+ xh(JSON.stringify(t)) > Jy && e.push("Preview artifact exceeds the bundle byte limit.");
15631
15634
  } catch {
15632
15635
  e.push("Preview artifact is not serializable.");
15633
15636
  }
@@ -15637,7 +15640,7 @@ function sw(t) {
15637
15640
  errors: e
15638
15641
  };
15639
15642
  }
15640
- function aw(t, e, n = {}) {
15643
+ function cw(t, e, n = {}) {
15641
15644
  const r = jr(t) && t.version === 3 ? (() => {
15642
15645
  const i = Ms(t);
15643
15646
  return {
@@ -15652,7 +15655,7 @@ function aw(t, e, n = {}) {
15652
15655
  artifact: i.valid ? t : null,
15653
15656
  errors: i.errors
15654
15657
  };
15655
- })() : sw(t);
15658
+ })() : aw(t);
15656
15659
  return !r.valid || !r.artifact ? {
15657
15660
  valid: !1,
15658
15661
  artifact: null,
@@ -15681,7 +15684,7 @@ function aw(t, e, n = {}) {
15681
15684
  errors: []
15682
15685
  };
15683
15686
  }
15684
- function cw(t, e, n) {
15687
+ function lw(t, e, n) {
15685
15688
  var a;
15686
15689
  const r = [], i = [], o = [], s = t.sourceRevision === e.sourceRevision;
15687
15690
  for (const c of n) {
@@ -15695,7 +15698,7 @@ function cw(t, e, n) {
15695
15698
  }
15696
15699
  return { exact: r, missing: i, stale: o };
15697
15700
  }
15698
- async function d1({
15701
+ async function u1({
15699
15702
  namespace: t,
15700
15703
  sourceRevision: e,
15701
15704
  transport: n,
@@ -15721,14 +15724,14 @@ async function d1({
15721
15724
  }
15722
15725
  if (a == null)
15723
15726
  return { status: "unavailable", artifact: null };
15724
- const c = aw(a, s, {
15727
+ const c = cw(a, s, {
15725
15728
  perFrameIdentity: i != null
15726
15729
  });
15727
15730
  return c.valid ? {
15728
15731
  status: "accepted",
15729
15732
  artifact: c.artifact,
15730
15733
  ...i ? {
15731
- frameResolution: cw(
15734
+ frameResolution: lw(
15732
15735
  c.artifact,
15733
15736
  s,
15734
15737
  i
@@ -15741,11 +15744,11 @@ async function d1({
15741
15744
  errors: c.errors
15742
15745
  };
15743
15746
  }
15744
- const ou = 12, yh = 32, lw = 8, dw = 80, Xc = 8 * 1024 * 1024, uw = 64 * 1024 * 1024, fw = 256, hw = 256 * 1024 * 1024, pw = 2, Na = 32, mw = 2, Ri = 2, gw = "pygmalion-instant-canvas", tt = "route-previews", wh = "pygmalion-default";
15745
- function bw(t) {
15747
+ const ou = 12, yh = 32, dw = 8, uw = 80, Xc = 8 * 1024 * 1024, fw = 64 * 1024 * 1024, hw = 256, pw = 256 * 1024 * 1024, mw = 2, Na = 32, gw = 2, Ri = 2, bw = "pygmalion-instant-canvas", tt = "route-previews", wh = "pygmalion-default";
15748
+ function vw(t) {
15746
15749
  return !t.hasRoute || t.layersImported ? "detailed" : t.cacheHydrated ? t.hasSnapshot ? "cached" : t.liveGranted ? "live" : "placeholder" : "hydrating";
15747
15750
  }
15748
- function vw(t, e = {}) {
15751
+ function xw(t, e = {}) {
15749
15752
  const n = Number.isFinite(t) ? Math.max(0, Math.floor(t)) : 0, r = Number.isFinite(e.maxAttempts) ? Math.max(1, Math.floor(e.maxAttempts)) : 3;
15750
15753
  if (n + 1 >= r) return null;
15751
15754
  const i = Number.isFinite(e.baseDelayMs) ? Math.max(0, Math.floor(e.baseDelayMs)) : 250;
@@ -15762,7 +15765,7 @@ function Sh(t = {}) {
15762
15765
  }
15763
15766
  let Nh = Sh(), mi = 0, su = 0, Lo = 0, _a = !1;
15764
15767
  const Rt = [], nt = /* @__PURE__ */ new Map(), Wt = /* @__PURE__ */ new Map(), Xt = /* @__PURE__ */ new Map(), Vr = /* @__PURE__ */ new Map(), it = /* @__PURE__ */ new Map(), _h = /* @__PURE__ */ new Map(), Jc = /* @__PURE__ */ new Map(), au = /* @__PURE__ */ new WeakMap(), Zn = /* @__PURE__ */ new Map(), _o = /* @__PURE__ */ new Map();
15765
- let Co = 0, xw = 0, Ca = !1;
15768
+ let Co = 0, yw = 0, Ca = !1;
15766
15769
  const jo = [], us = /* @__PURE__ */ new Map();
15767
15770
  let Vt = 0, un = 0, Tr = wh, Eo = null;
15768
15771
  const Ao = /* @__PURE__ */ new Map(), rt = /* @__PURE__ */ new Set(), pc = /* @__PURE__ */ new Set();
@@ -15776,32 +15779,32 @@ function _n() {
15776
15779
  Ch += 1;
15777
15780
  for (const t of pc) t();
15778
15781
  }
15779
- function yw() {
15782
+ function ww() {
15780
15783
  wi += 1;
15781
15784
  }
15782
- function ww() {
15785
+ function Sw() {
15783
15786
  wi = Math.max(
15784
15787
  0,
15785
15788
  wi - 1
15786
15789
  ), !(wi > 0 || !mc) && (mc = !1, _n());
15787
15790
  }
15788
- function Sw(t) {
15791
+ function Nw(t) {
15789
15792
  return pc.add(t), () => pc.delete(t);
15790
15793
  }
15791
15794
  function cu() {
15792
15795
  return Ch;
15793
15796
  }
15794
- function Nw() {
15797
+ function _w() {
15795
15798
  return mi;
15796
15799
  }
15797
15800
  function Zc(t) {
15798
15801
  return nt.has(t) || it.has(t) || Wt.has(t);
15799
15802
  }
15800
- function _w(t) {
15803
+ function Cw(t) {
15801
15804
  var e;
15802
15805
  return Zc(t) && ((e = Xt.get(t)) == null ? void 0 : e.stale) !== !0;
15803
15806
  }
15804
- function Cw(t) {
15807
+ function Ew(t) {
15805
15808
  return Xt.get(t) ?? null;
15806
15809
  }
15807
15810
  function fs() {
@@ -15817,7 +15820,7 @@ function Ui() {
15817
15820
  function Qc(t) {
15818
15821
  return `${t.id.trim()}\0${t.fingerprint ?? ""}`;
15819
15822
  }
15820
- function Ew(t, e) {
15823
+ function Aw(t, e) {
15821
15824
  var i;
15822
15825
  const n = (i = t.frames[e]) == null ? void 0 : i.screenshot;
15823
15826
  if (!n) return null;
@@ -15878,7 +15881,7 @@ function vc(t, e = /* @__PURE__ */ new Set()) {
15878
15881
  let Oh = null;
15879
15882
  const gi = /* @__PURE__ */ new Map();
15880
15883
  let Vo = 0;
15881
- function u1(t) {
15884
+ function f1(t) {
15882
15885
  Vo += 1, Oh = t, gi.clear(), !t && Vr.size > 0 && (Vr.clear(), Ui());
15883
15886
  }
15884
15887
  function du(t, e, n = {}) {
@@ -15976,7 +15979,7 @@ function Mh(t) {
15976
15979
  );
15977
15980
  return ((e == null ? void 0 : e[1]) ?? (e == null ? void 0 : e[2]) ?? (e == null ? void 0 : e[3]) ?? "").trim() || null;
15978
15981
  }
15979
- function Aw(t, e, n) {
15982
+ function Ow(t, e, n) {
15980
15983
  var c;
15981
15984
  let r = t === "head" ? 2166136261 : 2654435769, i = t === "head" ? 2246822507 : 3266489909;
15982
15985
  for (let d = 0; d < e.length; d += 1) {
@@ -15989,14 +15992,14 @@ function Aw(t, e, n) {
15989
15992
  a += 1, s = `${o}:${a}`;
15990
15993
  return s;
15991
15994
  }
15992
- function Ow(t) {
15995
+ function Pw(t) {
15993
15996
  if (/^<style\b/i.test(t)) return !0;
15994
15997
  const e = t.match(
15995
15998
  /\brel\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/i
15996
15999
  );
15997
16000
  return ((e == null ? void 0 : e[1]) ?? (e == null ? void 0 : e[2]) ?? (e == null ? void 0 : e[3]) ?? "").split(/\s+/).some((n) => n.toLowerCase() === "stylesheet");
15998
16001
  }
15999
- function Pw(t) {
16002
+ function Mw(t) {
16000
16003
  const e = t.match(
16001
16004
  /^\s*(?:(<!doctype\s+[^>]+>)\s*)?<html\b([^>]*)>\s*<head\b([^>]*)>([\s\S]*?)<\/head>\s*<body\b([^>]*)>([\s\S]*?)<\/body>\s*<\/html>\s*$/i
16002
16005
  );
@@ -16018,7 +16021,7 @@ function Pw(t) {
16018
16021
  const r = [], i = e[4] ?? "", o = /<style\b[^>]*>[\s\S]*?<\/style\s*>|<link\b[^>]*>/gi;
16019
16022
  let s = 0;
16020
16023
  for (const c of i.matchAll(o)) {
16021
- if (c.index == null || !Ow(c[0])) continue;
16024
+ if (c.index == null || !Pw(c[0])) continue;
16022
16025
  const d = i.slice(s, c.index);
16023
16026
  d && r.push({ kind: "head", content: d }), r.push({ kind: "stylesheet", content: c[0] }), s = c.index + c[0].length;
16024
16027
  }
@@ -16042,14 +16045,14 @@ function hs(t) {
16042
16045
  }
16043
16046
  return !0;
16044
16047
  }
16045
- function Mw(t) {
16048
+ function Iw(t) {
16046
16049
  const e = t.head.map((r) => {
16047
16050
  var i;
16048
16051
  return ((i = tl(r.kind).get(r.key)) == null ? void 0 : i.content) ?? "";
16049
16052
  }).join(""), n = t.document;
16050
16053
  return `${n.doctype}<html${n.htmlAttributes}><head${n.headAttributes}>${e}</head><body${n.bodyAttributes}>${t.body}</body></html>`;
16051
16054
  }
16052
- function Iw(t) {
16055
+ function $w(t) {
16053
16056
  var r;
16054
16057
  if (t.shadow) return t.shadow;
16055
16058
  const e = [], n = [];
@@ -16074,12 +16077,12 @@ function Iw(t) {
16074
16077
  stylesheetLinksHtml: n.join("")
16075
16078
  }, t.shadow;
16076
16079
  }
16077
- function $w(t, e, n, r) {
16078
- const i = Pw(e);
16080
+ function kw(t, e, n, r) {
16081
+ const i = Mw(e);
16079
16082
  if (!i) return !1;
16080
16083
  hs(t);
16081
16084
  const o = i.head.map(({ kind: a, content: c }) => {
16082
- const d = tl(a), u = Aw(a, c, d), f = d.get(u);
16085
+ const d = tl(a), u = Ow(a, c, d), f = d.get(u);
16083
16086
  if (f)
16084
16087
  f.references += 1;
16085
16088
  else {
@@ -16098,7 +16101,7 @@ function $w(t, e, n, r) {
16098
16101
  shadow: null
16099
16102
  }), Vt += s, !0;
16100
16103
  }
16101
- function kw(t, e) {
16104
+ function Tw(t, e) {
16102
16105
  let n = au.get(t);
16103
16106
  n || (n = /* @__PURE__ */ new Map(), au.set(t, n));
16104
16107
  const r = n.get(e);
@@ -16117,7 +16120,7 @@ function kw(t, e) {
16117
16120
  } else /^<link\b/i.test(i) && (s = { kind: "link", html: i });
16118
16121
  return s && n.set(e, s), s;
16119
16122
  }
16120
- function Tw(t) {
16123
+ function Dw(t) {
16121
16124
  if (t.shadow) return t.shadow;
16122
16125
  const e = t.bundle.frames[t.frameId];
16123
16126
  if (!e)
@@ -16125,7 +16128,7 @@ function Tw(t) {
16125
16128
  const n = [], r = [];
16126
16129
  for (const i of e.head) {
16127
16130
  if (i.kind !== "stylesheet") continue;
16128
- const o = kw(
16131
+ const o = Tw(
16129
16132
  t.bundle,
16130
16133
  i.hash
16131
16134
  );
@@ -16162,14 +16165,14 @@ function Tw(t) {
16162
16165
  function fi(t) {
16163
16166
  const e = it.get(t);
16164
16167
  if (e)
16165
- return it.delete(t), e.lastAccess = Date.now(), it.set(t, e), Iw(e);
16168
+ return it.delete(t), e.lastAccess = Date.now(), it.set(t, e), $w(e);
16166
16169
  const n = Wt.get(t);
16167
- return n ? Tw(n) : null;
16170
+ return n ? Dw(n) : null;
16168
16171
  }
16169
- function Dw(t) {
16172
+ function Rw(t) {
16170
16173
  return t.split(":", 1)[0] ?? "";
16171
16174
  }
16172
- function f1(t, e) {
16175
+ function h1(t, e) {
16173
16176
  var x;
16174
16177
  const n = Ur(e.namespace), r = (t == null ? void 0 : t.version) === 2 ? Ps(t) : null, i = (t == null ? void 0 : t.version) === 3 ? Ms(t) : null;
16175
16178
  if (!t || t.version !== 1 && t.version !== 2 && t.version !== 3 || typeof t.namespace != "string" || !t.namespace.trim() || t.namespace !== t.namespace.trim() || t.sourceRevision != null && (typeof t.sourceRevision != "string" || !t.sourceRevision.trim() || t.sourceRevision !== t.sourceRevision.trim()) || t.version === 1 && (!t.snapshots || typeof t.snapshots != "object" || Array.isArray(t.snapshots)) || t.version === 2 && !(r != null && r.valid) || t.version === 3 && !(i != null && i.valid))
@@ -16177,7 +16180,7 @@ function f1(t, e) {
16177
16180
  const o = t.namespace !== n;
16178
16181
  if (o && !e.allowStaleIdentity)
16179
16182
  return { accepted: 0, rejected: 0, reason: "namespace-mismatch" };
16180
- const s = Dw(
16183
+ const s = Rw(
16181
16184
  e.previewRevision
16182
16185
  ), a = t.sourceRevision != null && t.sourceRevision !== s;
16183
16186
  if (a && !e.allowStaleIdentity)
@@ -16241,7 +16244,7 @@ function f1(t, e) {
16241
16244
  status: O.status,
16242
16245
  diagnostics: O.diagnostics,
16243
16246
  ...w ? { stale: !0 } : {},
16244
- screenshot: Ew(
16247
+ screenshot: Aw(
16245
16248
  t,
16246
16249
  S
16247
16250
  )
@@ -16312,7 +16315,7 @@ function Dr(t) {
16312
16315
  return Tr;
16313
16316
  }
16314
16317
  }
16315
- function h1(t) {
16318
+ function p1(t) {
16316
16319
  Tr = Ur(t);
16317
16320
  }
16318
16321
  function Ih() {
@@ -16328,21 +16331,21 @@ function Gn(t) {
16328
16331
  t.oncomplete = () => e(), t.onabort = () => n(t.error ?? new Error("IndexedDB transaction aborted")), t.onerror = () => n(t.error ?? new Error("IndexedDB transaction failed"));
16329
16332
  });
16330
16333
  }
16331
- function Rw(t) {
16334
+ function zw(t) {
16332
16335
  const e = [...t].filter(
16333
16336
  (i) => i && typeof i.key == "string" && Number.isFinite(i.lastAccess)
16334
16337
  ).sort((i, o) => o.lastAccess - i.lastAccess);
16335
16338
  let n = 0;
16336
16339
  const r = [];
16337
16340
  return e.forEach((i, o) => {
16338
- n += Number(i.bytes) || 0, (o >= fw || n > hw) && r.push(i.key);
16341
+ n += Number(i.bytes) || 0, (o >= hw || n > pw) && r.push(i.key);
16339
16342
  }), r;
16340
16343
  }
16341
- async function zw() {
16344
+ async function Fw() {
16342
16345
  const t = globalThis.indexedDB;
16343
16346
  if (!t) throw new Error("IndexedDB unavailable");
16344
16347
  return new Promise((e, n) => {
16345
- const r = t.open(gw, 1);
16348
+ const r = t.open(bw, 1);
16346
16349
  r.onupgradeneeded = () => {
16347
16350
  const i = r.result;
16348
16351
  if (i.objectStoreNames.contains(tt)) return;
@@ -16353,7 +16356,7 @@ async function zw() {
16353
16356
  }, r.onsuccess = () => e(r.result), r.onerror = () => n(r.error ?? new Error("IndexedDB open failed")), r.onblocked = () => n(new Error("IndexedDB open blocked"));
16354
16357
  });
16355
16358
  }
16356
- class Fw {
16359
+ class Lw {
16357
16360
  constructor(e) {
16358
16361
  I(this, "pruneScheduled", !1);
16359
16362
  I(this, "pruneInFlight", null);
@@ -16397,7 +16400,7 @@ class Fw {
16397
16400
  e.objectStore(tt).getAll()
16398
16401
  );
16399
16402
  await n;
16400
- const i = Rw(r);
16403
+ const i = zw(r);
16401
16404
  if (!i.length) return;
16402
16405
  const o = this.database.transaction(
16403
16406
  tt,
@@ -16426,8 +16429,8 @@ class Fw {
16426
16429
  async function Is() {
16427
16430
  return Eo || (Eo = (async () => {
16428
16431
  try {
16429
- return new Fw(
16430
- await zw()
16432
+ return new Lw(
16433
+ await Fw()
16431
16434
  );
16432
16435
  } catch {
16433
16436
  return null;
@@ -16436,7 +16439,7 @@ async function Is() {
16436
16439
  }
16437
16440
  function xc() {
16438
16441
  Ca || (Ca = !0, queueMicrotask(() => {
16439
- for (Ca = !1; Co < pw && jo.length > 0; ) {
16442
+ for (Ca = !1; Co < mw && jo.length > 0; ) {
16440
16443
  jo.sort(
16441
16444
  (e, n) => e.priority - n.priority || e.order - n.order
16442
16445
  );
@@ -16451,7 +16454,7 @@ function xc() {
16451
16454
  }
16452
16455
  }));
16453
16456
  }
16454
- function Lw(t, e, n) {
16457
+ function jw(t, e, n) {
16455
16458
  const r = us.get(t);
16456
16459
  if (r)
16457
16460
  return r.request.priority = Math.min(r.request.priority, e), xc(), r.promise;
@@ -16459,7 +16462,7 @@ function Lw(t, e, n) {
16459
16462
  const o = new Promise((s, a) => {
16460
16463
  i = {
16461
16464
  key: t,
16462
- order: xw++,
16465
+ order: yw++,
16463
16466
  priority: Number.isFinite(e) ? e : 0,
16464
16467
  task: n,
16465
16468
  resolve: s,
@@ -16473,27 +16476,27 @@ function Lw(t, e, n) {
16473
16476
  }
16474
16477
  function Ni() {
16475
16478
  _a || (_a = !0, queueMicrotask(() => {
16476
- _a = !1, Bw();
16479
+ _a = !1, Hw();
16477
16480
  }));
16478
16481
  }
16479
- function jw() {
16482
+ function Vw() {
16480
16483
  var t;
16481
16484
  for (let e = Rt.length - 1; e >= 0; e -= 1)
16482
16485
  (t = Rt[e]) != null && t.cancelled && Rt.splice(e, 1);
16483
16486
  }
16484
- function Vw() {
16485
- if (jw(), Rt.length === 0) return null;
16487
+ function Bw() {
16488
+ if (Vw(), Rt.length === 0) return null;
16486
16489
  let t = 0, e = 0;
16487
16490
  for (let i = 1; i < Rt.length; i += 1) {
16488
16491
  const o = Rt[i], s = Rt[t], a = Rt[e];
16489
16492
  o.order < s.order && (t = i), (o.priority < a.priority || o.priority === a.priority && o.order < a.order) && (e = i);
16490
16493
  }
16491
- const r = e !== t && Lo >= lw ? t : e;
16494
+ const r = e !== t && Lo >= dw ? t : e;
16492
16495
  return r === t ? Lo = 0 : Lo += 1, Rt.splice(r, 1)[0] ?? null;
16493
16496
  }
16494
- function Bw() {
16497
+ function Hw() {
16495
16498
  for (; mi < Nh && Rt.length > 0; ) {
16496
- const t = Vw();
16499
+ const t = Bw();
16497
16500
  if (!t) break;
16498
16501
  mi += 1, _n();
16499
16502
  let e = !1;
@@ -16504,7 +16507,7 @@ function Bw() {
16504
16507
  }
16505
16508
  Rt.length === 0 && (Lo = 0);
16506
16509
  }
16507
- function Hw(t = 0) {
16510
+ function Ww(t = 0) {
16508
16511
  let e;
16509
16512
  return {
16510
16513
  promise: new Promise((r) => {
@@ -16527,7 +16530,7 @@ function Hw(t = 0) {
16527
16530
  }
16528
16531
  };
16529
16532
  }
16530
- function p1(t) {
16533
+ function m1(t) {
16531
16534
  const e = Number.isFinite(t) ? Math.floor(t) : Sh();
16532
16535
  Nh = Math.min(yh, Math.max(1, e)), Ni();
16533
16536
  }
@@ -16537,7 +16540,7 @@ function wn(t) {
16537
16540
  return nt.delete(t), e.lastAccess = Date.now(), nt.set(t, e), e.value;
16538
16541
  const n = it.get(t);
16539
16542
  if (n)
16540
- return it.delete(t), n.lastAccess = Date.now(), it.set(t, n), Mw(n);
16543
+ return it.delete(t), n.lastAccess = Date.now(), it.set(t, n), Iw(n);
16541
16544
  const r = Wt.get(t);
16542
16545
  if (!r) return null;
16543
16546
  const i = hh(
@@ -16555,12 +16558,12 @@ function nl(t, e, n = Dr(t), r = Date.now()) {
16555
16558
  const o = nt.get(t);
16556
16559
  o && (Vt -= o.bytes, nt.delete(t));
16557
16560
  const s = Ur(n);
16558
- for ($w(t, e, s, r) || (nt.set(t, {
16561
+ for (kw(t, e, s, r) || (nt.set(t, {
16559
16562
  bytes: i,
16560
16563
  value: e,
16561
16564
  namespace: s,
16562
16565
  lastAccess: r
16563
- }), Vt += i), ((a = Xt.get(t)) == null ? void 0 : a.stale) === !0 && (Xt.delete(t), Ui()); nt.size + it.size > dw || Vt > uw; ) {
16566
+ }), Vt += i), ((a = Xt.get(t)) == null ? void 0 : a.stale) === !0 && (Xt.delete(t), Ui()); nt.size + it.size > uw || Vt > fw; ) {
16564
16567
  const u = nt.keys().next().value, f = it.keys().next().value, p = u ? ((c = nt.get(u)) == null ? void 0 : c.lastAccess) ?? Number.POSITIVE_INFINITY : Number.POSITIVE_INFINITY, g = f ? ((d = it.get(f)) == null ? void 0 : d.lastAccess) ?? Number.POSITIVE_INFINITY : Number.POSITIVE_INFINITY, x = p <= g ? u : f;
16565
16568
  if (!x) break;
16566
16569
  const v = nt.get(x);
@@ -16592,7 +16595,7 @@ function rl(t, e) {
16592
16595
  const n = nl(t, e);
16593
16596
  return n && kh(t, e), n;
16594
16597
  }
16595
- function Ww(t) {
16598
+ function Kw(t) {
16596
16599
  if (Wt.has(t)) return Promise.resolve(null);
16597
16600
  const e = wn(t);
16598
16601
  if (e) return Promise.resolve(e);
@@ -16630,7 +16633,7 @@ function Ww(t) {
16630
16633
  });
16631
16634
  return Ao.set(t, i), i;
16632
16635
  }
16633
- async function Kw(t) {
16636
+ async function Uw(t) {
16634
16637
  const e = [...new Set(t.filter(Boolean))], n = /* @__PURE__ */ new Map(), r = [];
16635
16638
  for (const u of e) {
16636
16639
  if (Wt.has(u)) continue;
@@ -16694,20 +16697,20 @@ async function Kw(t) {
16694
16697
  ), p && _n();
16695
16698
  }
16696
16699
  }
16697
- yw();
16700
+ ww();
16698
16701
  try {
16699
16702
  await Promise.all(
16700
16703
  Array.from(
16701
- { length: Math.min(mw, a.length) },
16704
+ { length: Math.min(gw, a.length) },
16702
16705
  () => d()
16703
16706
  )
16704
16707
  );
16705
16708
  } finally {
16706
- ww();
16709
+ Sw();
16707
16710
  }
16708
16711
  return n;
16709
16712
  }
16710
- function m1(t) {
16713
+ function g1(t) {
16711
16714
  const e = t ? Ur(t) : null;
16712
16715
  if (!e)
16713
16716
  nt.clear(), it.clear(), _h.clear(), Jc.clear(), Wt.clear(), Xt.clear(), Vr.clear(), Vt = 0;
@@ -16740,7 +16743,7 @@ function Th(t, e, n) {
16740
16743
  const r = Zn.get(t);
16741
16744
  if (r)
16742
16745
  return r.ticket.updatePriority(e), r.promise;
16743
- const i = Hw(e), o = (async () => {
16746
+ const i = Ww(e), o = (async () => {
16744
16747
  const s = await i.promise;
16745
16748
  try {
16746
16749
  return await n();
@@ -16773,7 +16776,7 @@ function uu(t, e, n, r = t) {
16773
16776
  taskKey: a,
16774
16777
  promise: Promise.resolve(null)
16775
16778
  };
16776
- return c.promise = Ww(t).then((d) => d || un !== s ? d : Th(a, c.priority, async () => {
16779
+ return c.promise = Kw(t).then((d) => d || un !== s ? d : Th(a, c.priority, async () => {
16777
16780
  const u = wn(t);
16778
16781
  if (u) return u;
16779
16782
  const f = await n();
@@ -16782,7 +16785,7 @@ function uu(t, e, n, r = t) {
16782
16785
  _o.get(r) === c && _o.delete(r);
16783
16786
  }), _o.set(r, c), c.promise;
16784
16787
  }
16785
- function Uw(t, e) {
16788
+ function qw(t, e) {
16786
16789
  const n = t.querySelectorAll(
16787
16790
  "input, textarea, select"
16788
16791
  ), r = e.querySelectorAll(
@@ -16810,7 +16813,7 @@ function Uw(t, e) {
16810
16813
  }
16811
16814
  });
16812
16815
  }
16813
- function qw(t, e) {
16816
+ function Yw(t, e) {
16814
16817
  const n = t.querySelectorAll("canvas"), r = e.querySelectorAll("canvas");
16815
16818
  n.forEach((i, o) => {
16816
16819
  const s = r[o];
@@ -16822,13 +16825,13 @@ function qw(t, e) {
16822
16825
  }
16823
16826
  });
16824
16827
  }
16825
- function Yw(t, e) {
16828
+ function Gw(t, e) {
16826
16829
  var n;
16827
16830
  try {
16828
16831
  const r = t.contentDocument;
16829
16832
  if (!(r != null && r.documentElement)) return null;
16830
16833
  const i = r.documentElement.cloneNode(!0);
16831
- Uw(r, i), qw(r, i), i.querySelectorAll('script, noscript, iframe, object, embed, link[rel="modulepreload"], link[rel="preload"][as="script"]').forEach((d) => d.remove()), i.querySelectorAll("*").forEach((d) => {
16834
+ qw(r, i), Yw(r, i), i.querySelectorAll('script, noscript, iframe, object, embed, link[rel="modulepreload"], link[rel="preload"][as="script"]').forEach((d) => d.remove()), i.querySelectorAll("*").forEach((d) => {
16832
16835
  for (const u of Array.from(d.attributes))
16833
16836
  u.name.toLowerCase().startsWith("on") && d.removeAttribute(u.name);
16834
16837
  });
@@ -16844,13 +16847,13 @@ function Yw(t, e) {
16844
16847
  return null;
16845
16848
  }
16846
16849
  }
16847
- function Gw({
16850
+ function Xw({
16848
16851
  hasScreenshot: t,
16849
16852
  hasDomSnapshot: e
16850
16853
  }) {
16851
16854
  return t ? "screenshot" : e ? "dom" : "none";
16852
16855
  }
16853
- function Xw({
16856
+ function Jw({
16854
16857
  stale: t,
16855
16858
  resolution: e,
16856
16859
  captureStatus: n,
@@ -16894,13 +16897,13 @@ function Xw({
16894
16897
  retryable: !1
16895
16898
  } : null;
16896
16899
  }
16897
- function Jw({
16900
+ function Zw({
16898
16901
  active: t,
16899
16902
  live: e
16900
16903
  }) {
16901
16904
  return e ? t ? "canvas" : "isolated-producer" : "none";
16902
16905
  }
16903
- const Zw = /* @__PURE__ */ new Set([
16906
+ const Qw = /* @__PURE__ */ new Set([
16904
16907
  "embed",
16905
16908
  "iframe",
16906
16909
  "object",
@@ -16919,16 +16922,16 @@ const Zw = /* @__PURE__ */ new Set([
16919
16922
  ":host>html,:host>html>body{display:block;box-sizing:border-box;width:100%;height:100%;margin:0;}",
16920
16923
  "*,*::before,*::after{animation:none!important;transition:none!important;caret-color:transparent!important;}",
16921
16924
  'a,button,input,select,textarea,[role="button"]{pointer-events:none!important;}'
16922
- ].join(""), Qw = bi(Rh);
16925
+ ].join(""), e0 = bi(Rh);
16923
16926
  function ps(t) {
16924
16927
  return t.replaceAll(`\r
16925
16928
  `, `
16926
16929
  `).trim();
16927
16930
  }
16928
- function e0(t) {
16931
+ function t0(t) {
16929
16932
  return t.replace(/:root\b/g, ":host>html");
16930
16933
  }
16931
- const t0 = /* @__PURE__ */ new Map([
16934
+ const n0 = /* @__PURE__ */ new Map([
16932
16935
  ["vw", "cqw"],
16933
16936
  ["svw", "cqw"],
16934
16937
  ["lvw", "cqw"],
@@ -16940,16 +16943,16 @@ const t0 = /* @__PURE__ */ new Map([
16940
16943
  ["vmin", "cqmin"],
16941
16944
  ["vmax", "cqmax"]
16942
16945
  ]);
16943
- function n0(t) {
16946
+ function r0(t) {
16944
16947
  return t.replace(
16945
16948
  /(-?(?:\d+(?:\.\d*)?|\.\d+))(d?vw|d?vh|svw|svh|lvw|lvh|vmin|vmax)\b/gi,
16946
- (e, n, r) => `${n}${t0.get(r.toLowerCase())}`
16949
+ (e, n, r) => `${n}${n0.get(r.toLowerCase())}`
16947
16950
  );
16948
16951
  }
16949
16952
  function fu(t) {
16950
16953
  let e = "", n = 0, r = 0;
16951
16954
  const i = (o) => {
16952
- e += n0(t.slice(n, o));
16955
+ e += r0(t.slice(n, o));
16953
16956
  };
16954
16957
  for (; r < t.length; ) {
16955
16958
  const o = t[r], s = t[r + 1];
@@ -17013,7 +17016,7 @@ function ol(t) {
17013
17016
  ))
17014
17017
  throw new Error("The frozen preview contains active or unsafe content.");
17015
17018
  }
17016
- function r0(t) {
17019
+ function i0(t) {
17017
17020
  const e = [];
17018
17021
  return t.replace(
17019
17022
  /<style\b[^>]*>([\s\S]*?)<\/style\s*>/gi,
@@ -17021,7 +17024,7 @@ function r0(t) {
17021
17024
  ), e.join(`
17022
17025
  `);
17023
17026
  }
17024
- function i0(t) {
17027
+ function o0(t) {
17025
17028
  var r;
17026
17029
  const e = ((r = t.match(/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i)) == null ? void 0 : r[1]) ?? "", n = [];
17027
17030
  return e.replace(/<link\b[^>]*>/gi, (i) => {
@@ -17029,12 +17032,12 @@ function i0(t) {
17029
17032
  return ((o == null ? void 0 : o[1]) ?? (o == null ? void 0 : o[2]) ?? (o == null ? void 0 : o[3]) ?? "").toLowerCase().split(/\s+/).includes("stylesheet") && n.push(i), "";
17030
17033
  }), n.join("");
17031
17034
  }
17032
- function o0(t) {
17035
+ function s0(t) {
17033
17036
  if (t.snapshot != null && t.bodyHtml != null)
17034
17037
  throw new Error("Provide either snapshot or bodyHtml, not both.");
17035
17038
  const e = t.snapshot ?? t.bodyHtml ?? "";
17036
17039
  ol(e);
17037
- const n = r0(e), r = e.match(/<body\b[^>]*>([\s\S]*?)<\/body\s*>/i), i = ((r == null ? void 0 : r[1]) ?? e).replace(
17040
+ const n = i0(e), r = e.match(/<body\b[^>]*>([\s\S]*?)<\/body\s*>/i), i = ((r == null ? void 0 : r[1]) ?? e).replace(
17038
17041
  /<style\b[^>]*>[\s\S]*?<\/style\s*>/gi,
17039
17042
  ""
17040
17043
  ), o = [t.sharedCssText ?? "", n].map(ps).filter(Boolean).join(`
@@ -17042,12 +17045,12 @@ function o0(t) {
17042
17045
  return Br(o), {
17043
17046
  bodyHtml: i,
17044
17047
  sharedCssText: o,
17045
- stylesheetLinksHtml: t.snapshot ? i0(t.snapshot) : ""
17048
+ stylesheetLinksHtml: t.snapshot ? o0(t.snapshot) : ""
17046
17049
  };
17047
17050
  }
17048
17051
  function er(t, e) {
17049
17052
  Br(t);
17050
- const n = e0(t), r = zi(e);
17053
+ const n = t0(t), r = zi(e);
17051
17054
  if (!r) return fu(n);
17052
17055
  const i = (a) => {
17053
17056
  const c = a.trim();
@@ -17086,7 +17089,7 @@ function Bo(t, e, n) {
17086
17089
  r.innerHTML = e;
17087
17090
  const i = zi(n);
17088
17091
  for (const s of Array.from(r.content.querySelectorAll("*"))) {
17089
- if (Zw.has(s.localName.toLowerCase()))
17092
+ if (Qw.has(s.localName.toLowerCase()))
17090
17093
  throw new Error("The frozen preview contains a blocked element.");
17091
17094
  for (const a of Array.from(s.attributes)) {
17092
17095
  const c = a.name.toLowerCase();
@@ -17117,7 +17120,7 @@ function Bo(t, e, n) {
17117
17120
  }
17118
17121
  return r.content;
17119
17122
  }
17120
- function s0(t) {
17123
+ function a0(t) {
17121
17124
  if (t.nodeType === 9) return t;
17122
17125
  const e = t.ownerDocument;
17123
17126
  if (!e) throw new Error("The preview root is not connected to a document.");
@@ -17168,9 +17171,9 @@ function pu(t, e, n, r) {
17168
17171
  r
17169
17172
  );
17170
17173
  }
17171
- function a0(t, e, n = {}) {
17174
+ function c0(t, e, n = {}) {
17172
17175
  var a;
17173
- const r = s0(t), i = [], o = [];
17176
+ const r = a0(t), i = [], o = [];
17174
17177
  for (const c of e) {
17175
17178
  let d;
17176
17179
  try {
@@ -17255,7 +17258,7 @@ function a0(t, e, n = {}) {
17255
17258
  }
17256
17259
  };
17257
17260
  }
17258
- function c0(t, e) {
17261
+ function l0(t, e) {
17259
17262
  var i;
17260
17263
  const r = (i = t.host.ownerDocument.defaultView) == null ? void 0 : i.CSSStyleSheet;
17261
17264
  if (!r || !("adoptedStyleSheets" in t)) return null;
@@ -17266,7 +17269,7 @@ function c0(t, e) {
17266
17269
  return null;
17267
17270
  }
17268
17271
  }
17269
- class l0 {
17272
+ class d0 {
17270
17273
  constructor() {
17271
17274
  I(this, "sharedStyles", /* @__PURE__ */ new Map());
17272
17275
  I(this, "overrideStyles", /* @__PURE__ */ new Map());
@@ -17279,7 +17282,7 @@ class l0 {
17279
17282
  key: r,
17280
17283
  sourceText: a,
17281
17284
  text: a,
17282
- sheet: c0(n, a),
17285
+ sheet: l0(n, a),
17283
17286
  roots: /* @__PURE__ */ new Map()
17284
17287
  }, e.set(r, c);
17285
17288
  else if (c.sourceText !== a && !o)
@@ -17395,10 +17398,10 @@ class l0 {
17395
17398
  }
17396
17399
  }
17397
17400
  }
17398
- const d0 = new l0(), Oo = /* @__PURE__ */ new WeakMap();
17399
- function u0(t, e, n = d0) {
17401
+ const u0 = new d0(), Oo = /* @__PURE__ */ new WeakMap();
17402
+ function f0(t, e, n = u0) {
17400
17403
  var E, $, X;
17401
- const r = o0(e), i = t.shadowRoot ?? t.attachShadow({ mode: "open" });
17404
+ const r = s0(e), i = t.shadowRoot ?? t.attachShadow({ mode: "open" });
17402
17405
  (E = Oo.get(i)) == null || E.teardown(), i.replaceChildren();
17403
17406
  const o = t.ownerDocument, s = zi(e.baseUrl) ?? void 0, a = o.createElement("html"), c = o.createElement("body");
17404
17407
  if (c.dataset.pygmalionShadowPreview = "", e.snapshot) {
@@ -17449,7 +17452,7 @@ function u0(t, e, n = d0) {
17449
17452
  [g, ...x.map((ee) => ee.key)].join(":")
17450
17453
  ), S = ((X = e.overrideKey) == null ? void 0 : X.trim()) || `preview:${v}`, N = n.acquireShared(
17451
17454
  i,
17452
- Qw,
17455
+ e0,
17453
17456
  Rh
17454
17457
  ), C = n.acquireShared(i, g, p), R = n.acquireSharedMany(
17455
17458
  i,
@@ -17492,8 +17495,8 @@ function u0(t, e, n = d0) {
17492
17495
  };
17493
17496
  return Oo.set(i, w), w;
17494
17497
  }
17495
- const mu = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", gn = 200, nn = 280, f0 = 480, Pa = "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)]", hi = (t) => `flex h-9 w-9 items-center justify-center rounded-lg ${t ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
17496
- class h0 extends bp {
17498
+ const mu = "absolute z-20 flex flex-col overflow-hidden rounded-[13px] border border-[#e6e6e6] bg-white shadow-[0_2px_14px_rgba(0,0,0,.08)]", gn = 200, nn = 280, h0 = 480, Pa = "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)]", hi = (t) => `flex h-9 w-9 items-center justify-center rounded-lg ${t ? "bg-[#0d99ff] text-white" : "text-[#333] hover:bg-[#f5f5f5]"}`;
17499
+ class p0 extends bp {
17497
17500
  constructor() {
17498
17501
  super(...arguments);
17499
17502
  I(this, "state", { failed: !1 });
@@ -17514,7 +17517,7 @@ class h0 extends bp {
17514
17517
  function Ho(t) {
17515
17518
  return Kr(
17516
17519
  t.environment,
17517
- t.id === m.activePageId ? vy() : void 0
17520
+ t.id === m.activePageId ? xy() : void 0
17518
17521
  );
17519
17522
  }
17520
17523
  function tr(t, e, n = {
@@ -17564,7 +17567,7 @@ function Xn({
17564
17567
  )
17565
17568
  );
17566
17569
  }
17567
- const p0 = [
17570
+ const m0 = [
17568
17571
  { edge: "nw", cursor: "nwse-resize", style: { left: -5, top: -5 } },
17569
17572
  { edge: "n", cursor: "ns-resize", style: { left: "50%", top: -5, transform: "translateX(-50%)" } },
17570
17573
  { edge: "ne", cursor: "nesw-resize", style: { right: -5, top: -5 } },
@@ -17610,7 +17613,7 @@ function Lh({
17610
17613
  children: /* @__PURE__ */ l(qc, { size: 12 })
17611
17614
  }
17612
17615
  ),
17613
- p0.map((o) => /* @__PURE__ */ l(
17616
+ m0.map((o) => /* @__PURE__ */ l(
17614
17617
  "button",
17615
17618
  {
17616
17619
  type: "button",
@@ -17625,7 +17628,7 @@ function Lh({
17625
17628
  ] });
17626
17629
  }
17627
17630
  const jh = 28;
17628
- function m0(t) {
17631
+ function g0(t) {
17629
17632
  const e = t.explicit ? 0 : jh;
17630
17633
  return {
17631
17634
  x: t.x0 - e,
@@ -17652,7 +17655,7 @@ function Vh() {
17652
17655
  }
17653
17656
  return t;
17654
17657
  }
17655
- const g0 = lt(function() {
17658
+ const b0 = lt(function() {
17656
17659
  const e = m.sectionRenameTarget, n = (o, s) => {
17657
17660
  m.renameSection(m.activeCanvas, o, s), m.setSectionRenameTarget(null);
17658
17661
  }, r = (o, s) => (a) => {
@@ -17699,7 +17702,7 @@ const g0 = lt(function() {
17699
17702
  };
17700
17703
  return /* @__PURE__ */ l(Ye, { children: [...Vh().entries()].map(([o, s]) => {
17701
17704
  var d;
17702
- const a = m0(s), c = ((d = m.selectedCanvasObject) == null ? void 0 : d.kind) === "section" && m.selectedCanvasObject.name === o;
17705
+ const a = g0(s), c = ((d = m.selectedCanvasObject) == null ? void 0 : d.kind) === "section" && m.selectedCanvasObject.name === o;
17703
17706
  return /* @__PURE__ */ b(
17704
17707
  "div",
17705
17708
  {
@@ -17794,7 +17797,7 @@ const g0 = lt(function() {
17794
17797
  );
17795
17798
  }) });
17796
17799
  });
17797
- function b0({
17800
+ function v0({
17798
17801
  page: t,
17799
17802
  snapshot: e,
17800
17803
  height: n,
@@ -17860,34 +17863,34 @@ function b0({
17860
17863
  K.setAttribute("hidden", ""), K.setAttribute("data-pygmalion-sandbox-replay", "source");
17861
17864
  let je = bu(Ee);
17862
17865
  const yt = () => {
17863
- const Oe = je;
17864
- je = null, Ee.remove(), K.toggleAttribute("hidden", ot), K.removeAttribute("data-pygmalion-sandbox-replay"), Oe && queueMicrotask(() => Oe.unmount());
17866
+ const Pe = je;
17867
+ je = null, Ee.remove(), K.toggleAttribute("hidden", ot), K.removeAttribute("data-pygmalion-sandbox-replay"), Pe && queueMicrotask(() => Pe.unmount());
17865
17868
  };
17866
17869
  $.push(yt);
17867
- const st = (Oe) => {
17870
+ const st = (Pe) => {
17868
17871
  if (u.current !== Y) return;
17869
17872
  ee += 1;
17870
- const M = Oe instanceof Error ? Oe.message : String(Oe), he = `Component sandbox rendering failed:${se.name} · ${M}`;
17873
+ const M = Pe instanceof Error ? Pe.message : String(Pe), he = `Component sandbox rendering failed:${se.name} · ${M}`;
17871
17874
  w.push(he), Ee.setAttribute("data-pygmalion-sandbox-replay", "stale"), K.toggleAttribute("hidden", ot), x("stale"), p((re) => {
17872
17875
  const me = [.../* @__PURE__ */ new Set([...re, he])];
17873
17876
  return o == null || o(me), me;
17874
17877
  });
17875
17878
  };
17876
17879
  try {
17877
- const Oe = Re.children === "text" ? se.childrenText : void 0;
17880
+ const Pe = Re.children === "text" ? se.childrenText : void 0;
17878
17881
  je == null || je.render(
17879
17882
  cr(
17880
- h0,
17883
+ p0,
17881
17884
  { onError: st },
17882
17885
  cr(
17883
17886
  Re.component,
17884
17887
  { ...se.props },
17885
- Oe
17888
+ Pe
17886
17889
  )
17887
17890
  )
17888
17891
  ), X += 1;
17889
- } catch (Oe) {
17890
- st(Oe);
17892
+ } catch (Pe) {
17893
+ st(Pe);
17891
17894
  }
17892
17895
  continue;
17893
17896
  }
@@ -18014,8 +18017,8 @@ function b0({
18014
18017
  }
18015
18018
  );
18016
18019
  }
18017
- const v0 = lt(b0), Po = /* @__PURE__ */ new Map();
18018
- async function x0(t, e) {
18020
+ const x0 = lt(v0), Po = /* @__PURE__ */ new Map();
18021
+ async function y0(t, e) {
18019
18022
  const n = _e()[e.name];
18020
18023
  if (!n)
18021
18024
  throw new Error(`Component registry entry not found:${e.name}`);
@@ -18038,7 +18041,7 @@ async function x0(t, e) {
18038
18041
  });
18039
18042
  return Po.set(r, o), o;
18040
18043
  }
18041
- const y0 = lt(function({
18044
+ const w0 = lt(function({
18042
18045
  page: e,
18043
18046
  snapshot: n,
18044
18047
  artifact: r,
@@ -18058,7 +18061,7 @@ const y0 = lt(function({
18058
18061
  if (!w) return;
18059
18062
  let E = null;
18060
18063
  try {
18061
- E = u0(w, {
18064
+ E = f0(w, {
18062
18065
  ...r ? {
18063
18066
  bodyHtml: r.bodyHtml,
18064
18067
  bodyAttributes: r.bodyAttributes,
@@ -18090,7 +18093,7 @@ const y0 = lt(function({
18090
18093
  if (!w) return;
18091
18094
  f.current();
18092
18095
  let E = !1;
18093
- const $ = a0(w.root, R, {
18096
+ const $ = c0(w.root, R, {
18094
18097
  baseUrl: o
18095
18098
  }), X = [$.cleanup], ee = [...$.issues], Ie = w.root.host.ownerDocument, xe = () => {
18096
18099
  const K = [...new Set(ee)];
@@ -18108,7 +18111,7 @@ const y0 = lt(function({
18108
18111
  return ee.push(`DOM selector cannot be applied:${K.key}`), [];
18109
18112
  }
18110
18113
  return ge.length ? [
18111
- x0(s, K.component).then(
18114
+ y0(s, K.component).then(
18112
18115
  (J) => ({ elements: ge, markup: J, mutation: K }),
18113
18116
  (J) => (ee.push(J instanceof Error ? J.message : String(J)), null)
18114
18117
  )
@@ -18199,7 +18202,7 @@ const y0 = lt(function({
18199
18202
  ]
18200
18203
  }
18201
18204
  );
18202
- }), w0 = lt(function({
18205
+ }), S0 = lt(function({
18203
18206
  page: e,
18204
18207
  active: n,
18205
18208
  selected: r,
@@ -18230,7 +18233,7 @@ const y0 = lt(function({
18230
18233
  width: e.width ?? 390,
18231
18234
  height: e.height ?? 600
18232
18235
  }
18233
- ), fe = `${s}|${V}`, K = e.route ? nw(
18236
+ ), fe = `${s}|${V}`, K = e.route ? rw(
18234
18237
  {
18235
18238
  canonicalId: e.importPageId ?? e.id,
18236
18239
  route: e.route,
@@ -18249,10 +18252,10 @@ const y0 = lt(function({
18249
18252
  fs,
18250
18253
  fs
18251
18254
  );
18252
- const ge = fi(V), J = Cw(V), Me = Si(
18255
+ const ge = fi(V), J = Ew(V), Me = Si(
18253
18256
  e.importPageId ?? e.id,
18254
18257
  K ?? void 0
18255
- ), pe = Xw({
18258
+ ), pe = Jw({
18256
18259
  stale: (J == null ? void 0 : J.stale) === !0,
18257
18260
  resolution: Me,
18258
18261
  captureStatus: J == null ? void 0 : J.status,
@@ -18260,20 +18263,20 @@ const y0 = lt(function({
18260
18263
  }), [se, Re] = W(
18261
18264
  () => ge ? null : wn(V)
18262
18265
  ), [Ee, ot] = W(!1), [je, yt] = W(!1), st = At(
18263
- Ox,
18264
- () => Ax(e.id),
18266
+ Px,
18267
+ () => Ox(e.id),
18265
18268
  () => !1
18266
- ), Oe = ue(null), M = () => {
18267
- e.route == null || e.layersImported || oe || Oe.current == null && (Oe.current = setTimeout(() => {
18268
- Oe.current = null, th(e.id);
18269
+ ), Pe = ue(null), M = () => {
18270
+ e.route == null || e.layersImported || oe || Pe.current == null && (Pe.current = setTimeout(() => {
18271
+ Pe.current = null, th(e.id);
18269
18272
  }, 220));
18270
18273
  }, he = () => {
18271
- Oe.current != null && (clearTimeout(Oe.current), Oe.current = null);
18274
+ Pe.current != null && (clearTimeout(Pe.current), Pe.current = null);
18272
18275
  };
18273
18276
  ae(() => he, []), ae(() => {
18274
- e.layersImported && Ex(e.id);
18277
+ e.layersImported && Ax(e.id);
18275
18278
  }, [e.layersImported, e.id]);
18276
- const [re, me] = W(!1), [D, le] = W(null), [ce, G] = W(0), [we, $e] = W([]), be = se ?? (o && !ge ? wn(V) : null), Ce = ge != null || be != null || (J == null ? void 0 : J.screenshot) != null, oe = n, Pe = Mo(() => !r || e.route == null || !e.layersImported ? null : U === V && be != null ? be : wn(U) ?? be, [
18279
+ const [re, me] = W(!1), [D, le] = W(null), [ce, G] = W(0), [we, $e] = W([]), be = se ?? (o && !ge ? wn(V) : null), Ce = ge != null || be != null || (J == null ? void 0 : J.screenshot) != null, oe = n, Ae = Mo(() => !r || e.route == null || !e.layersImported ? null : U === V && be != null ? be : wn(U) ?? be, [
18277
18280
  U,
18278
18281
  o,
18279
18282
  be,
@@ -18281,7 +18284,10 @@ const y0 = lt(function({
18281
18284
  e.route,
18282
18285
  V,
18283
18286
  r
18284
- ]), Ue = Pe != null;
18287
+ ]), Ue = mx(
18288
+ Ae != null,
18289
+ O != null
18290
+ ) === "responsive-preview";
18285
18291
  ae(() => {
18286
18292
  const B = c.current;
18287
18293
  if (!B || typeof IntersectionObserver > "u") {
@@ -18342,7 +18348,7 @@ const y0 = lt(function({
18342
18348
  const ie = (L) => {
18343
18349
  if (!B) return;
18344
18350
  ot(!1);
18345
- const Ne = vw(ce);
18351
+ const Ne = xw(ce);
18346
18352
  if (Ne == null) {
18347
18353
  le(
18348
18354
  L instanceof Error ? L.message : "Failed to pin screen preview."
@@ -18466,7 +18472,7 @@ const y0 = lt(function({
18466
18472
  fe,
18467
18473
  Ce
18468
18474
  ]);
18469
- const wt = Ix(e, { detailActive: oe }) ? Mx({
18475
+ const wt = $x(e, { detailActive: oe }) ? Ix({
18470
18476
  origin: s,
18471
18477
  route: e.route ?? "",
18472
18478
  environment: Ho(e),
@@ -18475,7 +18481,7 @@ const y0 = lt(function({
18475
18481
  }) : null, qi = async (B, q, ie) => {
18476
18482
  const Se = wt;
18477
18483
  if (Se == null) return !1;
18478
- const A = Tx();
18484
+ const A = Dx();
18479
18485
  let ne = null;
18480
18486
  try {
18481
18487
  ne = await A.lease({
@@ -18545,7 +18551,7 @@ const y0 = lt(function({
18545
18551
  e.id,
18546
18552
  ie.error ?? `${ie.failedLabel ?? "Screen Capture Conditions"}Could not reproduce .`
18547
18553
  ), !1;
18548
- const Se = await Lw(
18554
+ const Se = await jw(
18549
18555
  V,
18550
18556
  n ? -1e4 : w ? -1e3 : 0,
18551
18557
  async () => u.current !== q || e.layersImported || m.activePageId !== e.id ? null : B.captureIframeWhenStable(q)
@@ -18604,18 +18610,18 @@ const y0 = lt(function({
18604
18610
  }), Y(null);
18605
18611
  };
18606
18612
  window.addEventListener("mousemove", F), window.addEventListener("mouseup", z);
18607
- }, St = e.frameSizeMode === "content" || oe || w, Ge = bw({
18613
+ }, St = e.frameSizeMode === "content" || oe || w, Ge = vw({
18608
18614
  hasRoute: e.route != null,
18609
18615
  layersImported: !!e.layersImported,
18610
18616
  cacheHydrated: o,
18611
18617
  hasSnapshot: Ce,
18612
18618
  liveGranted: Ee
18613
- }), qt = Ge === "live" || re || (oe || st) && e.route != null && !e.layersImported, We = Jw({
18619
+ }), qt = Ge === "live" || re || (oe || st) && e.route != null && !e.layersImported, We = Zw({
18614
18620
  // Keep a frame being prepared at its canvas position. Preparing it elsewhere
18615
18621
  // would move the iframe to another parent on open, reload it, and waste the work.
18616
18622
  active: oe || st,
18617
18623
  live: qt
18618
- }), Yi = !i && Ce, Gi = Gw({
18624
+ }), Yi = !i && Ce, Gi = Xw({
18619
18625
  hasScreenshot: (J == null ? void 0 : J.screenshot) != null,
18620
18626
  hasDomSnapshot: ge != null || be != null
18621
18627
  }), ks = e.layersImported && m.pageRequiresLiveSharedPreview(e), Xi = Ce && m.frozenPreviewMutations().some((B) => !!B.staleReason);
@@ -18656,7 +18662,7 @@ const y0 = lt(function({
18656
18662
  () => requestAnimationFrame(() => ne())
18657
18663
  );
18658
18664
  });
18659
- const A = ie ? Yw(
18665
+ const A = ie ? Gw(
18660
18666
  ie,
18661
18667
  `${s}${e.route ?? ""}`
18662
18668
  ) : null;
@@ -18852,11 +18858,11 @@ const y0 = lt(function({
18852
18858
  )
18853
18859
  }
18854
18860
  )
18855
- ] }) : e.layersImported && St && (oe || e.route == null || ks) ? oe ? Ue ? /* @__PURE__ */ l(
18856
- v0,
18861
+ ] }) : e.layersImported && St && (oe || e.route == null || ks) ? oe ? Ue && Ae != null ? /* @__PURE__ */ l(
18862
+ x0,
18857
18863
  {
18858
18864
  page: e,
18859
- snapshot: Pe,
18865
+ snapshot: Ae,
18860
18866
  height: X,
18861
18867
  onDocumentHeightChange: (B) => {
18862
18868
  m.setPageDocumentHeight(e.id, B);
@@ -18883,7 +18889,7 @@ const y0 = lt(function({
18883
18889
  }
18884
18890
  }
18885
18891
  ) : Gi === "dom" ? /* @__PURE__ */ l(
18886
- y0,
18892
+ w0,
18887
18893
  {
18888
18894
  page: e,
18889
18895
  snapshot: be ?? void 0,
@@ -19060,8 +19066,8 @@ const y0 = lt(function({
19060
19066
  `preview-producer:${fe}`
19061
19067
  )
19062
19068
  ] });
19063
- }), g1 = lt(function() {
19064
- var Oe;
19069
+ }), b1 = lt(function() {
19070
+ var Pe;
19065
19071
  const e = ue(null), n = ue(null), r = ue(null), i = () => {
19066
19072
  r.current != null && (clearTimeout(r.current), r.current = null);
19067
19073
  };
@@ -19072,7 +19078,7 @@ const y0 = lt(function({
19072
19078
  Ii
19073
19079
  );
19074
19080
  At(
19075
- Sw,
19081
+ Nw,
19076
19082
  cu,
19077
19083
  cu
19078
19084
  ), At(
@@ -19122,10 +19128,10 @@ const y0 = lt(function({
19122
19128
  )
19123
19129
  ])
19124
19130
  )
19125
- ], p = Oy(f), [g, x] = W("");
19131
+ ], p = Py(f), [g, x] = W("");
19126
19132
  ae(() => {
19127
19133
  let M = !0;
19128
- return x(""), Kw(f).then(() => {
19134
+ return x(""), Uw(f).then(() => {
19129
19135
  M && x(p);
19130
19136
  }), () => {
19131
19137
  M = !1;
@@ -19134,7 +19140,7 @@ const y0 = lt(function({
19134
19140
  const v = g === p, S = u.filter(
19135
19141
  (M) => Zc(M)
19136
19142
  ).length, N = u.filter(
19137
- (M) => _w(M)
19143
+ (M) => Cw(M)
19138
19144
  ).length, C = u.length, R = v && N === C, [O, Y] = W(!1), [w, E] = W(null), [$, X] = W("layers"), [ee, Ie] = W("story"), [xe, V] = W(null), U = Object.keys(_e()), fe = m.canAddFrame, K = (M) => {
19139
19145
  m.setTool(M), V(null);
19140
19146
  }, [ge, J] = W(!0), [Me, pe] = W(!0), [se, Re] = W(nn), [Ee, ot] = W(nn), je = ue(!1), yt = (M) => {
@@ -19165,7 +19171,7 @@ const y0 = lt(function({
19165
19171
  const M = e.current;
19166
19172
  if (!M) return;
19167
19173
  const he = (re) => {
19168
- const me = _x(re);
19174
+ const me = Cx(re);
19169
19175
  if (me !== "native-preview") {
19170
19176
  if (me === "programmatic-preview") {
19171
19177
  re.preventDefault();
@@ -19185,7 +19191,7 @@ const y0 = lt(function({
19185
19191
  if (!D) return;
19186
19192
  const le = m.canvasPages;
19187
19193
  if (!le.length) return;
19188
- const ce = Math.min(...le.map((Pe) => Pe.x ?? 0)), G = Math.min(...le.map((Pe) => Pe.y ?? 0)), we = Math.max(...le.map((Pe) => (Pe.x ?? 0) + (Pe.width ?? 390))), $e = Math.max(...le.map((Pe) => (Pe.y ?? 0) + (Pe.height ?? 600))), be = we - ce, Ce = $e - G, oe = Math.max(0.25, Math.min((D.clientWidth - 120) / be, (D.clientHeight - 200) / Ce, 1.5));
19194
+ const ce = Math.min(...le.map((Ae) => Ae.x ?? 0)), G = Math.min(...le.map((Ae) => Ae.y ?? 0)), we = Math.max(...le.map((Ae) => (Ae.x ?? 0) + (Ae.width ?? 390))), $e = Math.max(...le.map((Ae) => (Ae.y ?? 0) + (Ae.height ?? 600))), be = we - ce, Ce = $e - G, oe = Math.max(0.25, Math.min((D.clientWidth - 120) / be, (D.clientHeight - 200) / Ce, 1.5));
19189
19195
  m.setZoom(oe), m.setPan((D.clientWidth - be * oe) / 2 - ce * oe, (D.clientHeight - Ce * oe) / 2 - G * oe);
19190
19196
  }, he = () => {
19191
19197
  const D = e.current;
@@ -19372,7 +19378,7 @@ const y0 = lt(function({
19372
19378
  const re = he.clientX, me = M === "left" ? se : Ee, D = (ce) => {
19373
19379
  const G = M === "left" ? ce.clientX - re : re - ce.clientX, we = Math.max(
19374
19380
  gn,
19375
- Math.min(f0, me + G)
19381
+ Math.min(h0, me + G)
19376
19382
  );
19377
19383
  M === "left" ? Re(we) : ot(we);
19378
19384
  }, le = () => {
@@ -19390,7 +19396,7 @@ const y0 = lt(function({
19390
19396
  "data-preview-frame-count": C,
19391
19397
  "data-preview-cached-count": S,
19392
19398
  "data-preview-exact-count": N,
19393
- "data-preview-live-count": Nw(),
19399
+ "data-preview-live-count": _w(),
19394
19400
  children: [
19395
19401
  /* @__PURE__ */ l(
19396
19402
  "div",
@@ -19402,17 +19408,17 @@ const y0 = lt(function({
19402
19408
  },
19403
19409
  onPointerMove: (M) => {
19404
19410
  var le;
19405
- if (!vx(m.editMode, m.tool)) return;
19411
+ if (!xx(m.editMode, m.tool)) return;
19406
19412
  const he = (le = e.current) == null ? void 0 : le.getBoundingClientRect();
19407
19413
  if (!he) return;
19408
- const re = gx(
19414
+ const re = bx(
19409
19415
  c,
19410
- mx(M, he, {
19416
+ gx(M, he, {
19411
19417
  panX: m.panX,
19412
19418
  panY: m.panY,
19413
19419
  zoom: m.zoom
19414
19420
  })
19415
- ), me = bx(
19421
+ ), me = vx(
19416
19422
  n.current,
19417
19423
  re
19418
19424
  );
@@ -19476,8 +19482,8 @@ const y0 = lt(function({
19476
19482
  window.removeEventListener("mousemove", we), window.removeEventListener("mouseup", $e), E(null);
19477
19483
  const Ce = (Ue = e.current) == null ? void 0 : Ue.getBoundingClientRect();
19478
19484
  if (!Ce) return;
19479
- const oe = (wt) => (wt - Ce.left - m.panX) / m.zoom, Pe = (wt) => (wt - Ce.top - m.panY) / m.zoom;
19480
- m.createSectionFromRect(oe(G.x), Pe(G.y), oe(be.clientX), Pe(be.clientY));
19485
+ const oe = (wt) => (wt - Ce.left - m.panX) / m.zoom, Ae = (wt) => (wt - Ce.top - m.panY) / m.zoom;
19486
+ m.createSectionFromRect(oe(G.x), Ae(G.y), oe(be.clientX), Ae(be.clientY));
19481
19487
  };
19482
19488
  window.addEventListener("mousemove", we), window.addEventListener("mouseup", $e);
19483
19489
  return;
@@ -19487,13 +19493,13 @@ const y0 = lt(function({
19487
19493
  const D = (G) => {
19488
19494
  if (!me && Math.hypot(G.clientX - re.x, G.clientY - re.y) < 4) return;
19489
19495
  me = !0, je.current = !0, E({ x0: re.x, y0: re.y, x1: G.clientX, y1: G.clientY });
19490
- const we = Math.min(re.x, G.clientX), $e = Math.max(re.x, G.clientX), be = Math.min(re.y, G.clientY), Ce = Math.max(re.y, G.clientY), oe = m.root.children.filter((Pe) => {
19491
- if (Pe.hidden || Pe.locked) return !1;
19492
- const Ue = document.querySelector(`[data-node-id="${Pe.id}"]`);
19496
+ const we = Math.min(re.x, G.clientX), $e = Math.max(re.x, G.clientX), be = Math.min(re.y, G.clientY), Ce = Math.max(re.y, G.clientY), oe = m.root.children.filter((Ae) => {
19497
+ if (Ae.hidden || Ae.locked) return !1;
19498
+ const Ue = document.querySelector(`[data-node-id="${Ae.id}"]`);
19493
19499
  if (!Ue) return !1;
19494
19500
  const wt = Ue.getBoundingClientRect();
19495
19501
  return wt.left < $e && wt.right > we && wt.top < Ce && wt.bottom > be;
19496
- }).map((Pe) => Pe.id);
19502
+ }).map((Ae) => Ae.id);
19497
19503
  m.setSelection(oe);
19498
19504
  }, le = () => {
19499
19505
  window.removeEventListener("mousemove", D), window.removeEventListener("mouseup", le), E(null);
@@ -19523,7 +19529,7 @@ const y0 = lt(function({
19523
19529
  pointerEvents: m.editMode && m.tool === "select" ? void 0 : "none"
19524
19530
  },
19525
19531
  children: [
19526
- /* @__PURE__ */ l(g0, {}),
19532
+ /* @__PURE__ */ l(b0, {}),
19527
19533
  a && /* @__PURE__ */ l(
19528
19534
  ux,
19529
19535
  {
@@ -19536,7 +19542,7 @@ const y0 = lt(function({
19536
19542
  m.pages.filter((M) => M.route != null || (M.canvas ?? "default") === m.activeCanvas).map((M) => {
19537
19543
  var he;
19538
19544
  return /* @__PURE__ */ l(
19539
- w0,
19545
+ S0,
19540
19546
  {
19541
19547
  page: M,
19542
19548
  active: M.id === m.activePageId,
@@ -19628,13 +19634,13 @@ const y0 = lt(function({
19628
19634
  )) })
19629
19635
  ] }),
19630
19636
  $ === "layers" ? /* @__PURE__ */ l(
19631
- dy,
19637
+ uy,
19632
19638
  {
19633
19639
  onFrameFocus: yt,
19634
19640
  storyboardConnectionMode: ee,
19635
19641
  onStoryboardConnectionModeChange: Ie
19636
19642
  }
19637
- ) : /* @__PURE__ */ l(Wx, { onFrameFocus: yt }),
19643
+ ) : /* @__PURE__ */ l(Kx, { onFrameFocus: yt }),
19638
19644
  /* @__PURE__ */ l(
19639
19645
  "div",
19640
19646
  {
@@ -19753,7 +19759,7 @@ const y0 = lt(function({
19753
19759
  ] })
19754
19760
  ] }),
19755
19761
  /* @__PURE__ */ b("header", { className: "flex h-10 items-center gap-3 border-b border-[#e6e6e6] px-3", children: [
19756
- /* @__PURE__ */ l("span", { className: "text-[11px] font-semibold text-[#333]", children: ((Oe = m.selectedCanvasObject) == null ? void 0 : Oe.kind) === "frame" ? "Preview" : "Design" }),
19762
+ /* @__PURE__ */ l("span", { className: "text-[11px] font-semibold text-[#333]", children: ((Pe = m.selectedCanvasObject) == null ? void 0 : Pe.kind) === "frame" ? "Preview" : "Design" }),
19757
19763
  /* @__PURE__ */ b("span", { className: "ml-auto flex items-center gap-1 text-[11px] text-[#666]", children: [
19758
19764
  /* @__PURE__ */ l(
19759
19765
  "button",
@@ -19815,8 +19821,8 @@ const y0 = lt(function({
19815
19821
  )
19816
19822
  ] })
19817
19823
  ] }),
19818
- /* @__PURE__ */ l(Ay, {}),
19819
- /* @__PURE__ */ l(ry, {}),
19824
+ /* @__PURE__ */ l(Oy, {}),
19825
+ /* @__PURE__ */ l(iy, {}),
19820
19826
  /* @__PURE__ */ l(
19821
19827
  "div",
19822
19828
  {
@@ -20035,98 +20041,98 @@ const y0 = lt(function({
20035
20041
  children: m.tool === "section" && /* @__PURE__ */ l("div", { style: { position: "absolute", bottom: "100%", left: 0, marginBottom: 4, fontSize: 13, fontWeight: 700, color: "#666" }, children: "Section" })
20036
20042
  }
20037
20043
  ),
20038
- /* @__PURE__ */ l(Fx, {}),
20039
- /* @__PURE__ */ l(iy, {}),
20044
+ /* @__PURE__ */ l(Lx, {}),
20045
+ /* @__PURE__ */ l(oy, {}),
20040
20046
  m.previewOpen && /* @__PURE__ */ l(lx, { onClose: () => m.closePreview() })
20041
20047
  ]
20042
20048
  }
20043
20049
  );
20044
20050
  });
20045
20051
  export {
20046
- Z0 as $,
20052
+ Q0 as $,
20047
20053
  Ea as A,
20048
- n1 as B,
20049
- a1 as C,
20050
- g1 as D,
20054
+ r1 as B,
20055
+ c1 as C,
20056
+ b1 as D,
20051
20057
  H as E,
20052
- b0 as F,
20058
+ v0 as F,
20053
20059
  Ii as G,
20054
20060
  Mi as H,
20055
- d1 as I,
20056
- X0 as J,
20057
- W0 as K,
20058
- L0 as L,
20059
- j0 as M,
20061
+ u1 as I,
20062
+ J0 as J,
20063
+ K0 as K,
20064
+ j0 as L,
20065
+ V0 as M,
20060
20066
  qe as N,
20061
- B0 as O,
20062
- H0 as P,
20063
- qx as Q,
20067
+ H0 as O,
20068
+ W0 as P,
20069
+ Yx as Q,
20064
20070
  Ar as R,
20065
- t1 as S,
20066
- Kx as T,
20067
- Ux as U,
20068
- uy as V,
20071
+ n1 as S,
20072
+ Ux as T,
20073
+ qx as U,
20074
+ fy as V,
20069
20075
  Fv as W,
20070
- i1 as X,
20071
- m1 as Y,
20072
- ty as Z,
20073
- T0 as _,
20074
- M0 as a,
20075
- k0 as a0,
20076
- c1 as a1,
20077
- ew as a2,
20076
+ o1 as X,
20077
+ g1 as Y,
20078
+ ny as Z,
20079
+ D0 as _,
20080
+ I0 as a,
20081
+ T0 as a0,
20082
+ l1 as a1,
20083
+ tw as a2,
20078
20084
  vh as a3,
20079
- rw as a4,
20085
+ iw as a4,
20080
20086
  oh as a5,
20081
20087
  Zd as a6,
20082
20088
  _v as a7,
20083
- I0 as a8,
20084
- $0 as a9,
20085
- ey as aa,
20086
- q0 as ab,
20089
+ $0 as a8,
20090
+ k0 as a9,
20091
+ ty as aa,
20092
+ Y0 as ab,
20087
20093
  ki as ac,
20088
- U0 as ad,
20089
- gy as ae,
20090
- my as af,
20091
- vy as ag,
20094
+ q0 as ad,
20095
+ by as ae,
20096
+ gy as af,
20097
+ xy as ag,
20092
20098
  Sh as ah,
20093
20099
  ds as ai,
20094
20100
  ah as aj,
20095
20101
  yb as ak,
20096
- s1 as al,
20097
- o1 as am,
20098
- Qx as an,
20099
- J0 as ao,
20100
- cw as ap,
20101
- by as aq,
20102
+ a1 as al,
20103
+ s1 as am,
20104
+ ey as an,
20105
+ Z0 as ao,
20106
+ lw as ap,
20107
+ vy as aq,
20102
20108
  Gc as ar,
20103
20109
  ih as as,
20104
20110
  Tf as at,
20105
- aw as au,
20111
+ cw as au,
20106
20112
  Ms as av,
20107
- Q0 as b,
20108
- D0 as c,
20109
- K0 as d,
20113
+ e1 as b,
20114
+ R0 as c,
20115
+ U0 as d,
20110
20116
  m as e,
20111
- G0 as f,
20112
- O0 as g,
20113
- e1 as h,
20114
- P0 as i,
20115
- h1 as j,
20116
- nw as k,
20117
+ X0 as f,
20118
+ P0 as g,
20119
+ t1 as h,
20120
+ M0 as i,
20121
+ p1 as j,
20122
+ rw as k,
20117
20123
  dc as l,
20118
20124
  Kr as m,
20119
- p1 as n,
20120
- F0 as o,
20121
- V0 as p,
20122
- R0 as q,
20123
- z0 as r,
20125
+ m1 as n,
20126
+ L0 as o,
20127
+ B0 as p,
20128
+ z0 as q,
20129
+ F0 as r,
20124
20130
  Yt as s,
20125
- r1 as t,
20126
- f1 as u,
20127
- Y0 as v,
20128
- l1 as w,
20129
- Dw as x,
20130
- u1 as y,
20131
+ i1 as t,
20132
+ h1 as u,
20133
+ G0 as v,
20134
+ d1 as w,
20135
+ Rw as x,
20136
+ f1 as y,
20131
20137
  Si as z
20132
20138
  };