pixelagent 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, Fragment as K, jsx as n } from "react/jsx-runtime";
2
- import { useState as S, useEffect as _, useRef as Y, useMemo as xe, useLayoutEffect as Kt, useCallback as $, useId as jt } from "react";
3
- import { getElementDisplayLabel as Xe, captureTextSnapshot as tt, captureInlineStyles as nt, restoreInlineStyles as we, restoreTextSnapshot as ke, getPreviewTargets as $e, clearTailwindStatePreview as Ce, applyTailwindStatePreview as ze, setEditableTextPreview as rt, getRelevantComputedStyles as Me, getEditableTextInfo as fe, readReactSource as Ge, detectStylingSystem as kt, countElementInstances as Ct, getScopeSelector as Mt, getCssSelector as At, copyToClipboard as St, getWindowSelectionText as Lt, getNearestReactComponentName as qt, getDomPath as Jt, resolveElementFromEntry as Et, getAnnotationSessionDisplay as Zt, loadAnnotationSession as Qt, saveAnnotationSession as en, DEFAULT_PIXEL_AGENT_UI_SETTINGS as tn, readHostThemeFromDocument as it, resolvePixelAgentChrome as nn, applyHostThemeToDocument as rn, pixelAgentRootAttributes as an, getElementsInArea as on, formatAllAnnotations as sn, formatAnnotation as ln } from "@pixelagent/shared";
2
+ import { useState as A, useEffect as H, useRef as X, useMemo as ke, useLayoutEffect as Kt, useCallback as E, useId as jt } from "react";
3
+ import { getElementDisplayLabel as Xe, captureTextSnapshot as tt, captureInlineStyles as nt, restoreInlineStyles as Ne, restoreTextSnapshot as Me, getPreviewTargets as Te, clearTailwindStatePreview as Ae, applyTailwindStatePreview as ze, setEditableTextPreview as rt, getRelevantComputedStyles as Se, getEditableTextInfo as fe, readReactSource as Ge, detectStylingSystem as kt, countElementInstances as Ct, getScopeSelector as Mt, getCssSelector as At, copyToClipboard as St, getWindowSelectionText as Lt, getNearestReactComponentName as qt, getDomPath as Jt, resolveElementFromEntry as Et, getAnnotationSessionDisplay as Zt, loadAnnotationSession as Qt, saveAnnotationSession as en, DEFAULT_PIXEL_AGENT_UI_SETTINGS as tn, readHostThemeFromDocument as it, resolvePixelAgentChrome as nn, applyHostThemeToDocument as rn, pixelAgentRootAttributes as an, getElementsInArea as on, formatAllAnnotations as sn, formatAnnotation as ln } from "@pixelagent/shared";
4
4
  export * from "@pixelagent/shared";
5
5
  import { createPortal as Ke } from "react-dom";
6
6
  function $t({
@@ -9,8 +9,8 @@ function $t({
9
9
  multiSelected: i = [],
10
10
  primarySelected: r = null
11
11
  }) {
12
- const [a, s] = S([]), o = r ?? t;
13
- if (_(() => {
12
+ const [a, s] = A([]), o = r ?? t;
13
+ if (H(() => {
14
14
  const l = /* @__PURE__ */ new Map(), f = i.length > 0;
15
15
  e && !t && !f && l.set(e, !1), t && l.set(t, !0);
16
16
  for (const m of i)
@@ -80,24 +80,24 @@ function dn(e, t, i, r = It) {
80
80
  const u = c.getContext("2d");
81
81
  if (!u) return null;
82
82
  const l = u.createImageData(s, o), f = l.data, p = Math.min(0.5, i / Math.min(e, t)), v = 0.3, m = 0.2, g = Math.max(0.4, p + 0.1);
83
- let b = 0;
84
- const E = new Float32Array(s * o * 2);
85
- let N = 0;
86
- for (let k = 0; k < o; k++)
87
- for (let I = 0; I < s; I++) {
88
- const P = I / s - 0.5, R = k / o - 0.5, x = un(P, R, v, m, g), T = at(0.8, 0, x - 0.15), C = at(0, 1, T), h = (P * C + 0.5) * s - I, F = (R * C + 0.5) * o - k;
89
- Math.abs(h) > b && (b = Math.abs(h)), Math.abs(F) > b && (b = Math.abs(F)), E[N++] = h, E[N++] = F;
90
- }
91
- if (b === 0) return null;
92
- b *= 0.4 * r;
83
+ let y = 0;
84
+ const S = new Float32Array(s * o * 2);
93
85
  let w = 0;
94
- for (let k = 0; k < f.length; k += 4) {
95
- const I = E[w++] / b + 0.5, P = E[w++] / b + 0.5;
96
- f[k] = I * 255, f[k + 1] = P * 255, f[k + 2] = 0, f[k + 3] = 255;
86
+ for (let N = 0; N < o; N++)
87
+ for (let $ = 0; $ < s; $++) {
88
+ const _ = $ / s - 0.5, R = N / o - 0.5, x = un(_, R, v, m, g), I = at(0.8, 0, x - 0.15), L = at(0, 1, I), h = (_ * L + 0.5) * s - $, F = (R * L + 0.5) * o - N;
89
+ Math.abs(h) > y && (y = Math.abs(h)), Math.abs(F) > y && (y = Math.abs(F)), S[w++] = h, S[w++] = F;
90
+ }
91
+ if (y === 0) return null;
92
+ y *= 0.4 * r;
93
+ let k = 0;
94
+ for (let N = 0; N < f.length; N += 4) {
95
+ const $ = S[k++] / y + 0.5, _ = S[k++] / y + 0.5;
96
+ f[N] = $ * 255, f[N + 1] = _ * 255, f[N + 2] = 0, f[N + 3] = 255;
97
97
  }
98
98
  return u.putImageData(l, 0, 0), {
99
99
  href: c.toDataURL("image/png"),
100
- scale: b / a,
100
+ scale: y / a,
101
101
  width: s,
102
102
  height: o
103
103
  };
@@ -137,23 +137,23 @@ function Tt({
137
137
  style: s,
138
138
  children: o
139
139
  }) {
140
- const c = t ?? (e === "capsule" ? 9999 : 20), u = r === "enhanced" ? cn : It, l = Y(null), f = xe(() => `pa-lg-${++fn}`, []), [p, v] = S(null);
140
+ const c = t ?? (e === "capsule" ? 9999 : 20), u = r === "enhanced" ? cn : It, l = X(null), f = ke(() => `pa-lg-${++fn}`, []), [p, v] = A(null);
141
141
  Kt(() => {
142
142
  const g = l.current;
143
143
  if (!g) return;
144
- let b = 0;
145
- const E = () => {
146
- cancelAnimationFrame(b), b = requestAnimationFrame(() => {
147
- const w = g.getBoundingClientRect(), k = Math.round(w.width), I = Math.round(w.height);
148
- if (k < 8 || I < 8) return;
149
- const P = e === "capsule" ? I / 2 : Math.min(c, k / 2, I / 2), R = dn(k, I, P, u);
144
+ let y = 0;
145
+ const S = () => {
146
+ cancelAnimationFrame(y), y = requestAnimationFrame(() => {
147
+ const k = g.getBoundingClientRect(), N = Math.round(k.width), $ = Math.round(k.height);
148
+ if (N < 8 || $ < 8) return;
149
+ const _ = e === "capsule" ? $ / 2 : Math.min(c, N / 2, $ / 2), R = dn(N, $, _, u);
150
150
  R && v(R);
151
151
  });
152
152
  };
153
- E();
154
- const N = new ResizeObserver(E);
155
- return N.observe(g), () => {
156
- cancelAnimationFrame(b), N.disconnect();
153
+ S();
154
+ const w = new ResizeObserver(S);
155
+ return w.observe(g), () => {
156
+ cancelAnimationFrame(y), w.disconnect();
157
157
  };
158
158
  }, [e, c, u]);
159
159
  const m = p && Ue() && typeof document < "u" ? Ke(
@@ -235,7 +235,7 @@ function Tt({
235
235
  )
236
236
  ] });
237
237
  }
238
- function H({
238
+ function V({
239
239
  variant: e = "regular",
240
240
  className: t = "",
241
241
  children: i,
@@ -251,7 +251,7 @@ function H({
251
251
  }
252
252
  );
253
253
  }
254
- function Te({
254
+ function Pe({
255
255
  variant: e = "sheet",
256
256
  side: t = "left",
257
257
  className: i = "",
@@ -273,7 +273,7 @@ function Rt({
273
273
  defaultPosition: e = null,
274
274
  computeDefaultPosition: t
275
275
  } = {}) {
276
- const [i, r] = S(e), [a, s] = S(!1), o = Y(null), c = Y(null), u = $(() => {
276
+ const [i, r] = A(e), [a, s] = A(!1), o = X(null), c = X(null), u = E(() => {
277
277
  if (i !== null) return;
278
278
  const m = c.current;
279
279
  if (!m) return;
@@ -285,45 +285,45 @@ function Rt({
285
285
  }
286
286
  );
287
287
  }, [i, t]);
288
- _(() => {
288
+ H(() => {
289
289
  u();
290
- }, [u]), _(() => {
290
+ }, [u]), H(() => {
291
291
  const m = () => {
292
292
  r((g) => {
293
293
  if (!g || !c.current) return g;
294
- const b = c.current.getBoundingClientRect();
294
+ const y = c.current.getBoundingClientRect();
295
295
  return {
296
- x: Math.min(g.x, window.innerWidth - b.width),
297
- y: Math.min(g.y, window.innerHeight - b.height)
296
+ x: Math.min(g.x, window.innerWidth - y.width),
297
+ y: Math.min(g.y, window.innerHeight - y.height)
298
298
  };
299
299
  });
300
300
  };
301
301
  return window.addEventListener("resize", m), () => window.removeEventListener("resize", m);
302
302
  }, []);
303
- const l = $(
303
+ const l = E(
304
304
  (m) => {
305
305
  if (m.button !== 0) return;
306
306
  const g = c.current;
307
307
  if (!g) return;
308
- let b = i;
309
- if (!b) {
310
- const E = g.getBoundingClientRect();
311
- b = { x: E.left, y: E.top }, r(b);
308
+ let y = i;
309
+ if (!y) {
310
+ const S = g.getBoundingClientRect();
311
+ y = { x: S.left, y: S.top }, r(y);
312
312
  }
313
313
  o.current = {
314
314
  pointerId: m.pointerId,
315
315
  startX: m.clientX,
316
316
  startY: m.clientY,
317
- originX: b.x,
318
- originY: b.y
317
+ originX: y.x,
318
+ originY: y.y
319
319
  }, s(!0), m.currentTarget.setPointerCapture(m.pointerId), m.preventDefault();
320
320
  },
321
321
  [i]
322
- ), f = $((m) => {
322
+ ), f = E((m) => {
323
323
  if (!o.current || o.current.pointerId !== m.pointerId) return;
324
- const g = c.current, b = (g == null ? void 0 : g.offsetWidth) ?? 320, E = (g == null ? void 0 : g.offsetHeight) ?? 48, N = m.clientX - o.current.startX, w = m.clientY - o.current.startY, k = Math.max(8, Math.min(window.innerWidth - b - 8, o.current.originX + N)), I = Math.max(8, Math.min(window.innerHeight - E - 8, o.current.originY + w));
325
- r({ x: k, y: I });
326
- }, []), p = $((m) => {
324
+ const g = c.current, y = (g == null ? void 0 : g.offsetWidth) ?? 320, S = (g == null ? void 0 : g.offsetHeight) ?? 48, w = m.clientX - o.current.startX, k = m.clientY - o.current.startY, N = Math.max(8, Math.min(window.innerWidth - y - 8, o.current.originX + w)), $ = Math.max(8, Math.min(window.innerHeight - S - 8, o.current.originY + k));
325
+ r({ x: N, y: $ });
326
+ }, []), p = E((m) => {
327
327
  if (!(!o.current || o.current.pointerId !== m.pointerId)) {
328
328
  o.current = null, s(!1);
329
329
  try {
@@ -482,56 +482,56 @@ function Nn() {
482
482
  return t ? { "data-pa-chrome": t } : {};
483
483
  }
484
484
  function _e({ label: e, value: t, onChange: i }) {
485
- const [r, a] = S(!1), [s, o] = S(() => ot(t)), c = Y(null), u = Y(null), l = Y(null), f = jt(), [p, v] = S({ top: 0, left: 0, width: 260 }), m = Ot(s), g = bn(Pt(m)), b = je(t) ? t : vn(m), E = e.toLowerCase().includes("color") ? e : `${e} color`;
486
- _(() => {
485
+ const [r, a] = A(!1), [s, o] = A(() => ot(t)), c = X(null), u = X(null), l = X(null), f = jt(), [p, v] = A({ top: 0, left: 0, width: 260 }), m = Ot(s), g = bn(Pt(m)), y = je(t) ? t : vn(m), S = e.toLowerCase().includes("color") ? e : `${e} color`;
486
+ H(() => {
487
487
  o(ot(t));
488
488
  }, [t]);
489
- const N = $(
489
+ const w = E(
490
490
  (x) => {
491
491
  o(x), i(wn(x));
492
492
  },
493
493
  [i]
494
- ), w = $(
494
+ ), k = E(
495
495
  (x) => {
496
- N(Dt(x));
496
+ w(Dt(x));
497
497
  },
498
- [N]
499
- ), k = $(() => {
498
+ [w]
499
+ ), N = E(() => {
500
500
  const x = c.current;
501
501
  if (!x) return;
502
- const T = x.getBoundingClientRect(), C = 260;
503
- let h = T.left;
504
- h + C > window.innerWidth - 12 && (h = window.innerWidth - C - 12), h = Math.max(12, h);
505
- let F = T.bottom + 8;
506
- const W = 320;
507
- F + W > window.innerHeight - 12 && (F = Math.max(12, T.top - W - 8)), v({ top: F, left: h, width: C });
502
+ const I = x.getBoundingClientRect(), L = 260;
503
+ let h = I.left;
504
+ h + L > window.innerWidth - 12 && (h = window.innerWidth - L - 12), h = Math.max(12, h);
505
+ let F = I.bottom + 8;
506
+ const U = 320;
507
+ F + U > window.innerHeight - 12 && (F = Math.max(12, I.top - U - 8)), v({ top: F, left: h, width: L });
508
508
  }, []);
509
- _(() => {
509
+ H(() => {
510
510
  if (!r) return;
511
- k();
512
- const x = (C) => {
513
- var F, W;
514
- const h = C.target;
515
- (F = c.current) != null && F.contains(h) || (W = u.current) != null && W.contains(h) || a(!1);
516
- }, T = (C) => {
517
- C.key === "Escape" && a(!1);
511
+ N();
512
+ const x = (L) => {
513
+ var F, U;
514
+ const h = L.target;
515
+ (F = c.current) != null && F.contains(h) || (U = u.current) != null && U.contains(h) || a(!1);
516
+ }, I = (L) => {
517
+ L.key === "Escape" && a(!1);
518
518
  };
519
- return window.addEventListener("mousedown", x, !0), window.addEventListener("keydown", T), window.addEventListener("resize", k), window.addEventListener("scroll", k, !0), () => {
520
- window.removeEventListener("mousedown", x, !0), window.removeEventListener("keydown", T), window.removeEventListener("resize", k), window.removeEventListener("scroll", k, !0);
519
+ return window.addEventListener("mousedown", x, !0), window.addEventListener("keydown", I), window.addEventListener("resize", N), window.addEventListener("scroll", N, !0), () => {
520
+ window.removeEventListener("mousedown", x, !0), window.removeEventListener("keydown", I), window.removeEventListener("resize", N), window.removeEventListener("scroll", N, !0);
521
521
  };
522
- }, [r, k]);
523
- const I = (x, T) => {
524
- var W;
525
- const C = (W = l.current) == null ? void 0 : W.getBoundingClientRect();
526
- if (!C) return;
527
- const { x: h, y: F } = xn(x, T, C);
528
- N({ ...s, s: h, v: 100 - F });
529
- }, P = (x) => {
530
- x.preventDefault(), I(x.clientX, x.clientY);
531
- const T = (h) => I(h.clientX, h.clientY), C = () => {
532
- window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", C);
522
+ }, [r, N]);
523
+ const $ = (x, I) => {
524
+ var U;
525
+ const L = (U = l.current) == null ? void 0 : U.getBoundingClientRect();
526
+ if (!L) return;
527
+ const { x: h, y: F } = xn(x, I, L);
528
+ w({ ...s, s: h, v: 100 - F });
529
+ }, _ = (x) => {
530
+ x.preventDefault(), $(x.clientX, x.clientY);
531
+ const I = (h) => $(h.clientX, h.clientY), L = () => {
532
+ window.removeEventListener("mousemove", I), window.removeEventListener("mouseup", L);
533
533
  };
534
- window.addEventListener("mousemove", T), window.addEventListener("mouseup", C);
534
+ window.addEventListener("mousemove", I), window.addEventListener("mouseup", L);
535
535
  }, R = r ? Ke(
536
536
  /* @__PURE__ */ n(
537
537
  "div",
@@ -545,7 +545,7 @@ function _e({ label: e, value: t, onChange: i }) {
545
545
  ref: u,
546
546
  id: f,
547
547
  role: "dialog",
548
- "aria-label": E,
548
+ "aria-label": S,
549
549
  className: "pa-color-picker",
550
550
  style: { top: p.top, left: p.left, width: p.width },
551
551
  children: [
@@ -554,11 +554,11 @@ function _e({ label: e, value: t, onChange: i }) {
554
554
  "span",
555
555
  {
556
556
  className: "pa-color-picker-preview",
557
- style: { backgroundColor: b },
557
+ style: { backgroundColor: y },
558
558
  "aria-hidden": "true"
559
559
  }
560
560
  ),
561
- /* @__PURE__ */ n("span", { className: "pa-color-picker-header-label", children: E })
561
+ /* @__PURE__ */ n("span", { className: "pa-color-picker-header-label", children: S })
562
562
  ] }),
563
563
  /* @__PURE__ */ n(
564
564
  "div",
@@ -566,7 +566,7 @@ function _e({ label: e, value: t, onChange: i }) {
566
566
  ref: l,
567
567
  className: "pa-color-picker-sb",
568
568
  style: { "--pa-picker-h": String(Math.round(s.h)) },
569
- onMouseDown: P,
569
+ onMouseDown: _,
570
570
  children: /* @__PURE__ */ n(
571
571
  "span",
572
572
  {
@@ -587,7 +587,7 @@ function _e({ label: e, value: t, onChange: i }) {
587
587
  max: 360,
588
588
  value: Math.round(s.h),
589
589
  "aria-label": "Hue",
590
- onChange: (x) => N({ ...s, h: parseFloat(x.target.value) })
590
+ onChange: (x) => w({ ...s, h: parseFloat(x.target.value) })
591
591
  }
592
592
  ),
593
593
  /* @__PURE__ */ n(
@@ -608,7 +608,7 @@ function _e({ label: e, value: t, onChange: i }) {
608
608
  type: "text",
609
609
  value: g,
610
610
  spellCheck: !1,
611
- onChange: (x) => w(yn(x.target.value, m))
611
+ onChange: (x) => k(yn(x.target.value, m))
612
612
  }
613
613
  )
614
614
  ] }),
@@ -622,9 +622,9 @@ function _e({ label: e, value: t, onChange: i }) {
622
622
  min: 0,
623
623
  max: 255,
624
624
  value: m[x],
625
- onChange: (T) => {
626
- const C = kn(parseInt(T.target.value, 10));
627
- w({ ...m, [x]: C });
625
+ onChange: (I) => {
626
+ const L = kn(parseInt(I.target.value, 10));
627
+ k({ ...m, [x]: L });
628
628
  }
629
629
  }
630
630
  )
@@ -648,10 +648,10 @@ function _e({ label: e, value: t, onChange: i }) {
648
648
  "aria-haspopup": "dialog",
649
649
  "aria-controls": r ? f : void 0,
650
650
  onClick: () => {
651
- r || k(), a((x) => !x);
651
+ r || N(), a((x) => !x);
652
652
  },
653
653
  children: [
654
- /* @__PURE__ */ n("span", { className: "pa-color-field-swatch", style: { backgroundColor: b }, "aria-hidden": "true" }),
654
+ /* @__PURE__ */ n("span", { className: "pa-color-field-swatch", style: { backgroundColor: y }, "aria-hidden": "true" }),
655
655
  /* @__PURE__ */ n(
656
656
  "input",
657
657
  {
@@ -673,7 +673,7 @@ function kn(e) {
673
673
  return Number.isFinite(e) ? Math.min(255, Math.max(0, e)) : 0;
674
674
  }
675
675
  function ue({ title: e, children: t, defaultOpen: i = !0, badge: r }) {
676
- const [a, s] = S(i);
676
+ const [a, s] = A(i);
677
677
  return /* @__PURE__ */ d("section", { className: `pa-edit-section ${a ? "pa-edit-section--open" : ""}`, children: [
678
678
  /* @__PURE__ */ d(
679
679
  "button",
@@ -705,8 +705,8 @@ const pe = [
705
705
  { value: "Helvetica, Arial, sans-serif", label: "Helvetica" },
706
706
  { value: '"JetBrains Mono", ui-monospace, monospace', label: "JetBrains Mono" },
707
707
  { value: "ui-monospace, monospace", label: "Monospace" }
708
- ], Ie = "";
709
- function Ae(e) {
708
+ ], Re = "";
709
+ function Le(e) {
710
710
  var i;
711
711
  return (((i = e.split(",")[0]) == null ? void 0 : i.trim()) ?? "").replace(/^["']|["']$/g, "");
712
712
  }
@@ -714,28 +714,28 @@ function Cn(e) {
714
714
  const t = e.trim();
715
715
  if (!t)
716
716
  return {
717
- selectValue: Ie,
717
+ selectValue: Re,
718
718
  options: pe
719
719
  };
720
- const i = Ae(t).toLowerCase(), r = pe.find(
721
- (s) => s.value === t || Ae(s.value).toLowerCase() === i
720
+ const i = Le(t).toLowerCase(), r = pe.find(
721
+ (s) => s.value === t || Le(s.value).toLowerCase() === i
722
722
  );
723
723
  if (r)
724
724
  return { selectValue: r.value, options: pe };
725
725
  const a = pe.find((s) => {
726
- const o = Ae(s.value).toLowerCase();
726
+ const o = Le(s.value).toLowerCase();
727
727
  return t.toLowerCase().includes(o) || o.includes(i);
728
728
  });
729
729
  return a ? { selectValue: a.value, options: pe } : {
730
730
  selectValue: t,
731
731
  options: [
732
732
  ...pe,
733
- { value: t, label: Ae(t) || "Custom" }
733
+ { value: t, label: Le(t) || "Custom" }
734
734
  ]
735
735
  };
736
736
  }
737
737
  function Mn({ value: e, onChange: t }) {
738
- const { selectValue: i, options: r } = xe(
738
+ const { selectValue: i, options: r } = ke(
739
739
  () => Cn(e),
740
740
  [e]
741
741
  );
@@ -745,13 +745,13 @@ function Mn({ value: e, onChange: t }) {
745
745
  "select",
746
746
  {
747
747
  className: "pa-select pa-font-family-select",
748
- value: i || Ie,
748
+ value: i || Re,
749
749
  onChange: (a) => {
750
750
  const s = a.target.value;
751
- s && s !== Ie && t(s);
751
+ s && s !== Re && t(s);
752
752
  },
753
753
  children: [
754
- /* @__PURE__ */ n("option", { value: Ie, disabled: !0, children: "Select font style" }),
754
+ /* @__PURE__ */ n("option", { value: Re, disabled: !0, children: "Select font style" }),
755
755
  r.map((a) => /* @__PURE__ */ n("option", { value: a.value, children: a.label }, a.value))
756
756
  ]
757
757
  }
@@ -928,7 +928,7 @@ function Pn() {
928
928
  /* @__PURE__ */ n("line", { x1: "1.5", y1: "10.5", x2: "10.5", y2: "10.5", stroke: "currentColor", strokeWidth: "1.5" })
929
929
  ] });
930
930
  }
931
- function Se({ side: e }) {
931
+ function Ee({ side: e }) {
932
932
  const t = {
933
933
  top: { x1: 1.5, y1: 1.5, x2: 10.5, y2: 1.5 },
934
934
  right: { x1: 10.5, y1: 1.5, x2: 10.5, y2: 10.5 },
@@ -949,8 +949,8 @@ function Dn() {
949
949
  ] });
950
950
  }
951
951
  function he({ icon: e, display: t, ariaLabel: i, mixed: r, onCommit: a }) {
952
- const [s, o] = S(t);
953
- return _(() => {
952
+ const [s, o] = A(t);
953
+ return H(() => {
954
954
  o(t);
955
955
  }, [t]), /* @__PURE__ */ d("label", { className: `pa-spacing-cell ${r ? "pa-spacing-cell--mixed" : ""}`, children: [
956
956
  /* @__PURE__ */ n("span", { className: "pa-spacing-cell-icon", children: e }),
@@ -972,7 +972,7 @@ function he({ icon: e, display: t, ariaLabel: i, mixed: r, onCommit: a }) {
972
972
  ] });
973
973
  }
974
974
  function ut({ label: e, value: t, onChange: i }) {
975
- const r = In(t), [a, s] = S(!1), o = (l) => {
975
+ const r = In(t), [a, s] = A(!1), o = (l) => {
976
976
  i(Tn({ ...r, ...l }));
977
977
  }, c = r.left !== r.right, u = r.top !== r.bottom;
978
978
  return /* @__PURE__ */ d("div", { className: "pa-prop-row pa-prop-row--compact pa-spacing-row", children: [
@@ -990,7 +990,7 @@ function ut({ label: e, value: t, onChange: i }) {
990
990
  /* @__PURE__ */ n(
991
991
  he,
992
992
  {
993
- icon: /* @__PURE__ */ n(Se, { side: "left" }),
993
+ icon: /* @__PURE__ */ n(Ee, { side: "left" }),
994
994
  display: le(r.left),
995
995
  ariaLabel: `${e} left`,
996
996
  onCommit: (l) => o({ left: ce(l) })
@@ -999,7 +999,7 @@ function ut({ label: e, value: t, onChange: i }) {
999
999
  /* @__PURE__ */ n(
1000
1000
  he,
1001
1001
  {
1002
- icon: /* @__PURE__ */ n(Se, { side: "top" }),
1002
+ icon: /* @__PURE__ */ n(Ee, { side: "top" }),
1003
1003
  display: le(r.top),
1004
1004
  ariaLabel: `${e} top`,
1005
1005
  onCommit: (l) => o({ top: ce(l) })
@@ -1008,7 +1008,7 @@ function ut({ label: e, value: t, onChange: i }) {
1008
1008
  /* @__PURE__ */ n(
1009
1009
  he,
1010
1010
  {
1011
- icon: /* @__PURE__ */ n(Se, { side: "right" }),
1011
+ icon: /* @__PURE__ */ n(Ee, { side: "right" }),
1012
1012
  display: le(r.right),
1013
1013
  ariaLabel: `${e} right`,
1014
1014
  onCommit: (l) => o({ right: ce(l) })
@@ -1017,7 +1017,7 @@ function ut({ label: e, value: t, onChange: i }) {
1017
1017
  /* @__PURE__ */ n(
1018
1018
  he,
1019
1019
  {
1020
- icon: /* @__PURE__ */ n(Se, { side: "bottom" }),
1020
+ icon: /* @__PURE__ */ n(Ee, { side: "bottom" }),
1021
1021
  display: le(r.bottom),
1022
1022
  ariaLabel: `${e} bottom`,
1023
1023
  onCommit: (l) => o({ bottom: ce(l) })
@@ -1208,10 +1208,10 @@ function Gn({
1208
1208
  scopeHint: f,
1209
1209
  stateHint: p
1210
1210
  }) {
1211
- var T, C;
1212
- const v = e["font-weight"] ?? "", m = e["font-style"] ?? "normal", g = e["text-decoration"] ?? "none", b = Yn(e["text-align"] ?? "left"), E = ((T = e.display) == null ? void 0 : T.trim()) ?? "", N = !!E, w = Xn.has(E), k = [...mt];
1213
- E && !mt.includes(E) && k.push(E);
1214
- const I = ((C = e.gap) == null ? void 0 : C.trim()) ?? "", P = I === "normal" || I === "" ? "0px" : I, R = e["border-style"] ?? "none", x = [...ft];
1211
+ var I, L;
1212
+ const v = e["font-weight"] ?? "", m = e["font-style"] ?? "normal", g = e["text-decoration"] ?? "none", y = Yn(e["text-align"] ?? "left"), S = ((I = e.display) == null ? void 0 : I.trim()) ?? "", w = !!S, k = Xn.has(S), N = [...mt];
1213
+ S && !mt.includes(S) && N.push(S);
1214
+ const $ = ((L = e.gap) == null ? void 0 : L.trim()) ?? "", _ = $ === "normal" || $ === "" ? "0px" : $, R = e["border-style"] ?? "none", x = [...ft];
1215
1215
  return R && !ft.includes(R) && x.push(R), /* @__PURE__ */ d("div", { className: "pa-edit-sections", children: [
1216
1216
  /* @__PURE__ */ d(ue, { title: "Targeting", defaultOpen: !0, children: [
1217
1217
  /* @__PURE__ */ d("div", { className: "pa-edit-field-grid pa-edit-field-grid--2", children: [
@@ -1327,7 +1327,7 @@ function Gn({
1327
1327
  On,
1328
1328
  {
1329
1329
  ariaLabel: "Text align",
1330
- value: b,
1330
+ value: y,
1331
1331
  onChange: (h) => t("text-align", h),
1332
1332
  options: [
1333
1333
  {
@@ -1426,25 +1426,25 @@ function Gn({
1426
1426
  onChange: (h) => t("margin", h)
1427
1427
  }
1428
1428
  ),
1429
- N && /* @__PURE__ */ d("label", { className: "pa-prop-row pa-prop-row--compact", children: [
1429
+ w && /* @__PURE__ */ d("label", { className: "pa-prop-row pa-prop-row--compact", children: [
1430
1430
  /* @__PURE__ */ n("span", { className: "pa-edit-field-label", children: "Display" }),
1431
1431
  /* @__PURE__ */ n(
1432
1432
  "select",
1433
1433
  {
1434
1434
  className: "pa-select",
1435
- value: E,
1435
+ value: S,
1436
1436
  onChange: (h) => t("display", h.target.value),
1437
- children: k.map((h) => /* @__PURE__ */ n("option", { value: h, children: h }, h))
1437
+ children: N.map((h) => /* @__PURE__ */ n("option", { value: h, children: h }, h))
1438
1438
  }
1439
1439
  )
1440
1440
  ] }),
1441
- w && /* @__PURE__ */ n(
1441
+ k && /* @__PURE__ */ n(
1442
1442
  ie,
1443
1443
  {
1444
1444
  compact: !0,
1445
1445
  property: "gap",
1446
1446
  label: "Gap",
1447
- value: P,
1447
+ value: _,
1448
1448
  onChange: (h) => t("gap", h)
1449
1449
  }
1450
1450
  )
@@ -1536,139 +1536,145 @@ const Kn = 50, gt = [
1536
1536
  "opacity"
1537
1537
  ];
1538
1538
  function jn(e, t, i) {
1539
- var ee;
1540
- const r = Y([]), a = Y(/* @__PURE__ */ new Set()), s = Y([]), o = Y(null), c = Y([]), [u, l] = S({}), [f, p] = S({}), [v, m] = S("none"), [g, b] = S(""), [E, N] = S(""), [w, k] = S(() => /* @__PURE__ */ new Map()), [I, P] = S(!1), R = $(() => {
1541
- const M = Array.from(a.current);
1539
+ var oe;
1540
+ const r = X([]), a = X(/* @__PURE__ */ new Set()), s = X([]), o = X(null), c = X([]), u = X(
1541
+ null
1542
+ ), [l, f] = A({}), [p, v] = A({}), [m, g] = A("none"), [y, S] = A(""), [w, k] = A(""), [N, $] = A(() => /* @__PURE__ */ new Map()), [_, R] = A(!1), x = E(() => {
1543
+ const C = Array.from(a.current);
1542
1544
  return {
1543
- inline: nt(M, [...gt]),
1544
- text: e && v !== "none" ? tt(e, v) : null
1545
+ inline: nt(C, [...gt]),
1546
+ text: e && m !== "none" ? tt(e, m) : null
1545
1547
  };
1546
- }, [e, v]), x = $(() => {
1547
- c.current.push(R()), c.current.length > Kn && c.current.shift(), P(c.current.length > 0);
1548
- }, [R]), T = $(
1549
- (M) => {
1550
- var L;
1548
+ }, [e, m]), I = E(() => {
1549
+ c.current.push(x()), c.current.length > Kn && c.current.shift(), R(c.current.length > 0);
1550
+ }, [x]), L = E(
1551
+ (C) => {
1552
+ var Y;
1551
1553
  if (!e) return;
1552
- const O = Array.from(a.current);
1553
- we(s.current.filter((z) => O.includes(z.element))), o.current && ke(o.current);
1554
- const D = $e(e, t);
1555
- r.current = D, a.current = new Set(D), Ce(O), ze(D, i);
1556
- const U = e ? ((L = w.get(e)) == null ? void 0 : L.get(i)) ?? [] : [];
1557
- if (M && U.length > 0)
1558
- for (const z of U)
1559
- if (z.property === "textContent" || z.property === "value")
1560
- for (const X of D)
1561
- rt(X, z.property, z.newValue);
1554
+ const P = Array.from(a.current);
1555
+ Ne(s.current.filter((T) => P.includes(T.element))), o.current && Me(o.current);
1556
+ const O = Te(e, t);
1557
+ r.current = O, a.current = new Set(O), Ae(P), ze(O, i);
1558
+ const D = e ? ((Y = N.get(e)) == null ? void 0 : Y.get(i)) ?? [] : [];
1559
+ if (C && D.length > 0)
1560
+ for (const T of D)
1561
+ if (T.property === "textContent" || T.property === "value")
1562
+ for (const z of O)
1563
+ rt(z, T.property, T.newValue);
1562
1564
  else
1563
- for (const X of D)
1564
- X.style.setProperty(z.property, z.newValue);
1565
+ for (const z of O)
1566
+ z.style.setProperty(T.property, T.newValue);
1565
1567
  },
1566
- [e, t, i, w]
1568
+ [e, t, i, N]
1567
1569
  );
1568
- _(() => {
1570
+ H(() => {
1569
1571
  if (!e) {
1570
- r.current = [], a.current = /* @__PURE__ */ new Set(), s.current = [], o.current = null, c.current = [], l({}), p({}), m("none"), b(""), N(""), k(/* @__PURE__ */ new Map()), P(!1);
1572
+ r.current = [], a.current = /* @__PURE__ */ new Set(), s.current = [], o.current = null, c.current = [], f({}), v({}), g("none"), S(""), k(""), $(/* @__PURE__ */ new Map()), R(!1);
1571
1573
  return;
1572
1574
  }
1573
- const M = $e(e, t);
1574
- r.current = M, a.current = new Set(M), s.current = nt(M, [...gt]), c.current = [], P(!1);
1575
- const O = Me(e);
1576
- l(O), p(O);
1577
- const D = fe(e);
1578
- return m(D.kind), b(D.value), N(D.value), o.current = D.kind !== "none" ? tt(e, D.kind) : null, ze(M, i), () => Ce(M);
1579
- }, [e]), _(() => {
1580
- e && T(!0);
1581
- }, [t]), _(() => {
1582
- var U;
1575
+ const C = Te(e, t);
1576
+ r.current = C, a.current = new Set(C), s.current = nt(C, [...gt]), c.current = [], R(!1);
1577
+ const P = Se(e);
1578
+ f(P), v(P);
1579
+ const O = fe(e);
1580
+ return g(O.kind), S(O.value), k(O.value), o.current = O.kind !== "none" ? tt(e, O.kind) : null, ze(C, i), () => Ae(C);
1581
+ }, [e]), H(() => {
1582
+ e && L(!0);
1583
+ }, [t]), H(() => {
1584
+ var Y;
1583
1585
  if (!e) return;
1584
- const M = $e(e, t);
1585
- r.current = M, we(
1586
- s.current.filter((L) => M.includes(L.element))
1586
+ const C = Te(e, t);
1587
+ r.current = C, Ne(
1588
+ s.current.filter((T) => C.includes(T.element))
1587
1589
  );
1588
- const O = ((U = w.get(e)) == null ? void 0 : U.get(i)) ?? [];
1589
- for (const L of O)
1590
- if (!(L.property === "textContent" || L.property === "value"))
1591
- for (const z of M)
1592
- z.style.setProperty(L.property, L.newValue);
1593
- const D = { ...f };
1594
- for (const L of O)
1595
- L.property === "textContent" || L.property === "value" || (D[L.property] = L.newValue);
1596
- l(D), Ce(Array.from(a.current)), ze(M, i), a.current = new Set(M);
1590
+ const P = ((Y = N.get(e)) == null ? void 0 : Y.get(i)) ?? [];
1591
+ for (const T of P)
1592
+ if (!(T.property === "textContent" || T.property === "value"))
1593
+ for (const z of C)
1594
+ z.style.setProperty(T.property, T.newValue);
1595
+ const O = u.current;
1596
+ if (O !== null && O.element === e && O.state !== i) {
1597
+ const T = { ...p };
1598
+ for (const z of P)
1599
+ z.property === "textContent" || z.property === "value" || (T[z.property] = z.newValue);
1600
+ f(T);
1601
+ }
1602
+ u.current = { element: e, state: i }, Ae(Array.from(a.current)), ze(C, i), a.current = new Set(C);
1597
1603
  }, [i, e, t]);
1598
- const C = $(
1599
- (M, O, D) => {
1600
- e && k((U) => {
1601
- const L = new Map(U), z = new Map(L.get(e) ?? /* @__PURE__ */ new Map()), q = (z.get(i) ?? []).filter((Re) => Re.property !== M);
1602
- return D === O ? q.length === 0 ? z.delete(i) : z.set(i, q) : z.set(i, [...q, { property: M, oldValue: O, newValue: D }]), z.size === 0 ? L.delete(e) : L.set(e, z), L;
1604
+ const h = E(
1605
+ (C, P, O) => {
1606
+ e && $((D) => {
1607
+ const Y = new Map(D), T = new Map(Y.get(e) ?? /* @__PURE__ */ new Map()), ve = (T.get(i) ?? []).filter((be) => be.property !== C);
1608
+ return O === P ? ve.length === 0 ? T.delete(i) : T.set(i, ve) : T.set(i, [...ve, { property: C, oldValue: P, newValue: O }]), T.size === 0 ? Y.delete(e) : Y.set(e, T), Y;
1603
1609
  });
1604
1610
  },
1605
1611
  [e, i]
1606
- ), h = $(
1607
- (M, O) => {
1612
+ ), F = E(
1613
+ (C, P) => {
1608
1614
  if (!e) return;
1609
- const D = { [M]: O };
1610
- M === "border-width" && (u["border-style"] ?? "none") === "none" && Sn(O) && (D["border-style"] = "solid"), x(), l((U) => ({ ...U, ...D }));
1611
- for (const [U, L] of Object.entries(D)) {
1612
- const z = f[U] ?? "";
1613
- for (const X of r.current)
1614
- X.style.setProperty(U, L), a.current.add(X);
1615
- C(U, z, L);
1615
+ const O = { [C]: P };
1616
+ C === "border-width" && (l["border-style"] ?? "none") === "none" && Sn(P) && (O["border-style"] = "solid"), I(), f((D) => ({ ...D, ...O }));
1617
+ for (const [D, Y] of Object.entries(O)) {
1618
+ const T = p[D] ?? "";
1619
+ for (const z of r.current)
1620
+ z.style.setProperty(D, Y), a.current.add(z);
1621
+ h(D, T, Y);
1616
1622
  }
1617
1623
  },
1618
- [e, f, u, x, C]
1619
- ), F = $(
1620
- (M) => {
1621
- if (!(!e || v === "none")) {
1622
- x(), b(M);
1623
- for (const O of r.current)
1624
- rt(O, v, M), a.current.add(O);
1625
- C(v, E, M);
1624
+ [e, p, l, I, h]
1625
+ ), U = E(
1626
+ (C) => {
1627
+ if (!(!e || m === "none")) {
1628
+ I(), S(C);
1629
+ for (const P of r.current)
1630
+ rt(P, m, C), a.current.add(P);
1631
+ h(m, w, C);
1626
1632
  }
1627
1633
  },
1628
- [e, v, E, x, C]
1629
- ), W = $(() => {
1630
- const M = c.current.pop();
1631
- if (M && (we(M.inline), M.text && ke(M.text), P(c.current.length > 0), e)) {
1632
- l(Me(e));
1633
- const O = fe(e);
1634
- O.kind !== "none" && b(O.value);
1634
+ [e, m, w, I, h]
1635
+ ), ge = E(() => {
1636
+ const C = c.current.pop();
1637
+ if (C && (Ne(C.inline), C.text && Me(C.text), R(c.current.length > 0), e)) {
1638
+ f(Se(e));
1639
+ const P = fe(e);
1640
+ P.kind !== "none" && S(P.value);
1635
1641
  }
1636
- }, [e]), ge = $(() => {
1637
- if (we(s.current), o.current && ke(o.current), c.current = [], P(!1), k(/* @__PURE__ */ new Map()), e) {
1638
- l(Me(e));
1639
- const M = fe(e);
1640
- b(M.value);
1642
+ }, [e]), Z = E(() => {
1643
+ if (Ne(s.current), o.current && Me(o.current), c.current = [], R(!1), $(/* @__PURE__ */ new Map()), e) {
1644
+ f(Se(e));
1645
+ const C = fe(e);
1646
+ S(C.value);
1641
1647
  }
1642
- }, [e]), j = $(() => {
1643
- we(s.current), o.current && ke(o.current);
1644
- }, []), oe = $(() => {
1645
- if (j(), Ce(Array.from(a.current)), c.current = [], P(!1), k(/* @__PURE__ */ new Map()), e) {
1646
- l(Me(e));
1647
- const M = fe(e);
1648
- M.kind !== "none" && b(M.value);
1648
+ }, [e]), te = E(() => {
1649
+ Ne(s.current), o.current && Me(o.current);
1650
+ }, []), re = E(() => {
1651
+ if (te(), Ae(Array.from(a.current)), c.current = [], R(!1), $(/* @__PURE__ */ new Map()), e) {
1652
+ f(Se(e));
1653
+ const C = fe(e);
1654
+ C.kind !== "none" && S(C.value);
1649
1655
  }
1650
- }, [j, e]), re = e ? ((ee = w.get(e)) == null ? void 0 : ee.get(i)) ?? [] : [];
1651
- let V = 0;
1652
- for (const M of w.values())
1653
- for (const O of M.values()) V += O.length;
1654
- const G = $(() => {
1655
- k(/* @__PURE__ */ new Map());
1656
+ }, [te, e]), W = e ? ((oe = N.get(e)) == null ? void 0 : oe.get(i)) ?? [] : [];
1657
+ let G = 0;
1658
+ for (const C of N.values())
1659
+ for (const P of C.values()) G += P.length;
1660
+ const ne = E(() => {
1661
+ $(/* @__PURE__ */ new Map());
1656
1662
  }, []);
1657
1663
  return {
1658
- values: u,
1659
- textKind: v,
1660
- textValue: g,
1661
- pendingChanges: re,
1662
- pendingByElement: w,
1663
- totalPendingCount: V,
1664
- clearAllPending: G,
1665
- canUndo: I,
1666
- updateProperty: h,
1667
- updateText: F,
1668
- undo: W,
1669
- reset: ge,
1670
- clearPreviews: oe,
1671
- revertPreviews: j
1664
+ values: l,
1665
+ textKind: m,
1666
+ textValue: y,
1667
+ pendingChanges: W,
1668
+ pendingByElement: N,
1669
+ totalPendingCount: G,
1670
+ clearAllPending: ne,
1671
+ canUndo: _,
1672
+ updateProperty: F,
1673
+ updateText: U,
1674
+ undo: ge,
1675
+ reset: Z,
1676
+ clearPreviews: re,
1677
+ revertPreviews: te
1672
1678
  };
1673
1679
  }
1674
1680
  function qn({
@@ -1689,63 +1695,63 @@ function qn({
1689
1695
  values: v,
1690
1696
  textKind: m,
1691
1697
  textValue: g,
1692
- pendingChanges: b,
1693
- pendingByElement: E,
1694
- totalPendingCount: N,
1695
- clearAllPending: w,
1696
- canUndo: k,
1697
- updateProperty: I,
1698
- updateText: P,
1698
+ pendingChanges: y,
1699
+ pendingByElement: S,
1700
+ totalPendingCount: w,
1701
+ clearAllPending: k,
1702
+ canUndo: N,
1703
+ updateProperty: $,
1704
+ updateText: _,
1699
1705
  undo: R,
1700
1706
  reset: x,
1701
- clearPreviews: T,
1702
- revertPreviews: C
1703
- } = jn(e, a, o), { elementRef: h, isDragging: F, style: W, dragHandleProps: ge } = Rt({
1704
- computeDefaultPosition: (L) => ({
1705
- x: window.innerWidth - L.width - 16,
1707
+ clearPreviews: I,
1708
+ revertPreviews: L
1709
+ } = jn(e, a, o), { elementRef: h, isDragging: F, style: U, dragHandleProps: ge } = Rt({
1710
+ computeDefaultPosition: (D) => ({
1711
+ x: window.innerWidth - D.width - 16,
1706
1712
  y: 16
1707
1713
  })
1708
1714
  });
1709
- _(() => (p == null || p({ clearPreviews: T, revertPreviews: C }), () => p == null ? void 0 : p(null)), [p, T, C]);
1710
- const j = $(
1711
- (L) => {
1712
- if (f(L.target)) return;
1713
- const X = document.elementsFromPoint(L.clientX, L.clientY).find(
1714
- (q) => q instanceof Element && !q.closest(
1715
+ H(() => (p == null || p({ clearPreviews: I, revertPreviews: L }), () => p == null ? void 0 : p(null)), [p, I, L]);
1716
+ const Z = E(
1717
+ (D) => {
1718
+ if (f(D.target)) return;
1719
+ const T = document.elementsFromPoint(D.clientX, D.clientY).find(
1720
+ (z) => z instanceof Element && !z.closest(
1715
1721
  "[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]"
1716
1722
  )
1717
1723
  );
1718
- r(X ?? null);
1724
+ r(T ?? null);
1719
1725
  },
1720
1726
  [f, r]
1721
- ), oe = $(
1722
- (L) => {
1723
- if (f(L.target)) return;
1724
- L.preventDefault(), L.stopPropagation();
1725
- const X = document.elementsFromPoint(L.clientX, L.clientY).find(
1726
- (q) => q instanceof Element && !q.closest(
1727
+ ), te = E(
1728
+ (D) => {
1729
+ if (f(D.target)) return;
1730
+ D.preventDefault(), D.stopPropagation();
1731
+ const T = document.elementsFromPoint(D.clientX, D.clientY).find(
1732
+ (z) => z instanceof Element && !z.closest(
1727
1733
  "[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]"
1728
1734
  )
1729
1735
  );
1730
- i(X ?? null);
1736
+ i(T ?? null);
1731
1737
  },
1732
1738
  [f, i]
1733
1739
  );
1734
- _(() => (document.addEventListener("mousemove", j, !0), document.addEventListener("click", oe, !0), () => {
1735
- document.removeEventListener("mousemove", j, !0), document.removeEventListener("click", oe, !0);
1736
- }), [j, oe]);
1740
+ H(() => (document.addEventListener("mousemove", Z, !0), document.addEventListener("click", te, !0), () => {
1741
+ document.removeEventListener("mousemove", Z, !0), document.removeEventListener("click", te, !0);
1742
+ }), [Z, te]);
1737
1743
  const re = async () => {
1738
- if (N === 0) return;
1739
- const L = await u(E);
1740
- L.applied && (w(), L.skipRevert || C());
1741
- }, V = e ? Ge(e) : null, G = e ? kt(e) : null, ee = e ? Ct(e) : 0, M = e ? Mt(e, "all-instances") : "", O = o !== "normal" && G === "tailwind" ? "Tailwind variant preview: matching hover:/focus:/… classes are applied without the prefix." : o !== "normal" ? "State preview uses focus/disabled simulation where possible." : null, D = ee > 1 ? a === "all-instances" ? `Preview & Apply on ${ee} elements (${M}).` : `This instance only — ${ee - 1} other on page.` : a === "all-instances" ? "Only one match — scope has no effect." : null, U = xe(() => !e || a !== "all-instances" ? [] : $e(e, "all-instances"), [e, a]);
1744
+ if (w === 0) return;
1745
+ const D = await u(S);
1746
+ D.applied && (k(), D.skipRevert || L());
1747
+ }, W = e ? Ge(e) : null, G = e ? kt(e) : null, ne = e ? Ct(e) : 0, oe = e ? Mt(e, "all-instances") : "", C = o !== "normal" && G === "tailwind" ? "Tailwind variant preview: matching hover:/focus:/… classes are applied without the prefix." : o !== "normal" ? "State preview uses focus/disabled simulation where possible." : null, P = ne > 1 ? a === "all-instances" ? `Preview & Apply on ${ne} elements (${oe}).` : `This instance only — ${ne - 1} other on page.` : a === "all-instances" ? "Only one match — scope has no effect." : null, O = ke(() => !e || a !== "all-instances" ? [] : Te(e, "all-instances"), [e, a]);
1742
1748
  return /* @__PURE__ */ d(K, { children: [
1743
1749
  /* @__PURE__ */ n(
1744
1750
  $t,
1745
1751
  {
1746
1752
  element: a === "all-instances" ? null : t,
1747
1753
  selected: e,
1748
- multiSelected: U,
1754
+ multiSelected: O,
1749
1755
  primarySelected: e
1750
1756
  }
1751
1757
  ),
@@ -1754,8 +1760,8 @@ function qn({
1754
1760
  {
1755
1761
  ref: h,
1756
1762
  className: `pa-edit-panel-float ${F ? "pa-edit-panel-float--dragging" : ""}`,
1757
- style: W,
1758
- children: /* @__PURE__ */ n(Te, { variant: "sheet", side: "right", className: "pa-edit-panel-glass", children: /* @__PURE__ */ d("div", { className: "pa-edit-panel-inner", children: [
1763
+ style: U,
1764
+ children: /* @__PURE__ */ n(Pe, { variant: "sheet", side: "right", className: "pa-edit-panel-glass", children: /* @__PURE__ */ d("div", { className: "pa-edit-panel-inner", children: [
1759
1765
  /* @__PURE__ */ d("div", { className: "pa-edit-panel-header", children: [
1760
1766
  /* @__PURE__ */ n(
1761
1767
  "button",
@@ -1784,16 +1790,16 @@ function qn({
1784
1790
  {
1785
1791
  className: "pa-edit-meta-label",
1786
1792
  title: `This instance: ${At(e)}
1787
- All instances: ${M}`,
1793
+ All instances: ${oe}`,
1788
1794
  children: Xe(e)
1789
1795
  }
1790
1796
  ),
1791
- ((V == null ? void 0 : V.sourceFile) || G) && /* @__PURE__ */ d("span", { className: "pa-edit-source", children: [
1792
- (V == null ? void 0 : V.sourceFile) && /* @__PURE__ */ d(K, { children: [
1793
- V.sourceFile,
1794
- V.lineNumber ? `:${V.lineNumber}` : ""
1797
+ ((W == null ? void 0 : W.sourceFile) || G) && /* @__PURE__ */ d("span", { className: "pa-edit-source", children: [
1798
+ (W == null ? void 0 : W.sourceFile) && /* @__PURE__ */ d(K, { children: [
1799
+ W.sourceFile,
1800
+ W.lineNumber ? `:${W.lineNumber}` : ""
1795
1801
  ] }),
1796
- V != null && V.sourceFile && G ? " · " : "",
1802
+ W != null && W.sourceFile && G ? " · " : "",
1797
1803
  G ?? ""
1798
1804
  ] })
1799
1805
  ] }),
@@ -1801,31 +1807,31 @@ All instances: ${M}`,
1801
1807
  Gn,
1802
1808
  {
1803
1809
  values: v,
1804
- onPropertyChange: I,
1810
+ onPropertyChange: $,
1805
1811
  textKind: m,
1806
1812
  textValue: g,
1807
- onTextChange: P,
1813
+ onTextChange: _,
1808
1814
  targetScope: a,
1809
1815
  onTargetScopeChange: s,
1810
1816
  elementState: o,
1811
1817
  onElementStateChange: c,
1812
- instanceCount: ee,
1813
- scopeHint: D,
1814
- stateHint: O
1818
+ instanceCount: ne,
1819
+ scopeHint: P,
1820
+ stateHint: C
1815
1821
  }
1816
1822
  ) }),
1817
1823
  /* @__PURE__ */ d("div", { className: "pa-edit-panel-sticky", children: [
1818
1824
  /* @__PURE__ */ d("div", { className: "pa-edit-actions", children: [
1819
- /* @__PURE__ */ n(H, { variant: "regular", onClick: R, disabled: !k, children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
1825
+ /* @__PURE__ */ n(V, { variant: "regular", onClick: R, disabled: !N, children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
1820
1826
  /* @__PURE__ */ n(mn, { className: "pa-glass-btn-icon" }),
1821
1827
  /* @__PURE__ */ n("span", { children: "Undo" })
1822
1828
  ] }) }),
1823
1829
  /* @__PURE__ */ n(
1824
- H,
1830
+ V,
1825
1831
  {
1826
1832
  variant: "regular",
1827
1833
  onClick: x,
1828
- disabled: b.length === 0,
1834
+ disabled: y.length === 0,
1829
1835
  children: /* @__PURE__ */ d("span", { className: "pa-glass-btn-inner", children: [
1830
1836
  /* @__PURE__ */ n(gn, { className: "pa-glass-btn-icon" }),
1831
1837
  /* @__PURE__ */ n("span", { children: "Reset" })
@@ -1838,16 +1844,16 @@ All instances: ${M}`,
1838
1844
  "span",
1839
1845
  {
1840
1846
  className: l ? /fail/i.test(l) ? "pa-change-count pa-change-count--error" : "pa-change-count pa-change-count--success" : "pa-change-count",
1841
- children: l ?? `${N} pending change${N !== 1 ? "s" : ""}`
1847
+ children: l ?? `${w} pending change${w !== 1 ? "s" : ""}`
1842
1848
  }
1843
1849
  ),
1844
1850
  /* @__PURE__ */ n(
1845
- H,
1851
+ V,
1846
1852
  {
1847
1853
  variant: "glass-primary",
1848
1854
  onClick: re,
1849
- disabled: N === 0,
1850
- title: V != null && V.sourceFile ? void 0 : "No source file — Apply copies selector + changes to clipboard",
1855
+ disabled: w === 0,
1856
+ title: W != null && W.sourceFile ? void 0 : "No source file — Apply copies selector + changes to clipboard",
1851
1857
  children: "Apply"
1852
1858
  }
1853
1859
  )
@@ -1882,8 +1888,8 @@ async function Jn(e, t = {}) {
1882
1888
  return await St(JSON.stringify(e, null, 2)), { mode: "clipboard" };
1883
1889
  }
1884
1890
  function Zn(e) {
1885
- const [t, i] = S(null);
1886
- return _(() => {
1891
+ const [t, i] = A(null);
1892
+ return H(() => {
1887
1893
  if (!e) {
1888
1894
  i(null);
1889
1895
  return;
@@ -1896,7 +1902,7 @@ function Zn(e) {
1896
1902
  };
1897
1903
  }, [e]), t;
1898
1904
  }
1899
- const ae = 8, Q = 8, Qn = 12, er = 300, tr = 280;
1905
+ const ae = 8, J = 8, Qn = 12, er = 300, tr = 280;
1900
1906
  function He(e, t, i, r) {
1901
1907
  return {
1902
1908
  top: e,
@@ -1933,7 +1939,7 @@ function Ve(e, t) {
1933
1939
  window.innerWidth - t - ae
1934
1940
  );
1935
1941
  }
1936
- function Le(e, t) {
1942
+ function $e(e, t) {
1937
1943
  return Math.min(
1938
1944
  Math.max(ae, e),
1939
1945
  window.innerHeight - t - ae
@@ -1947,19 +1953,19 @@ function ar(e, t) {
1947
1953
  }
1948
1954
  function or(e, t = er, i = tr) {
1949
1955
  const r = rr(), s = e.top > window.innerHeight * 0.45 ? [
1950
- { placement: "above", top: e.top - i - Q, left: e.left },
1951
- { placement: "below", top: e.bottom + Q, left: e.left },
1952
- { placement: "right", top: e.top, left: e.right + Q },
1953
- { placement: "left", top: e.top, left: e.left - t - Q }
1956
+ { placement: "above", top: e.top - i - J, left: e.left },
1957
+ { placement: "below", top: e.bottom + J, left: e.left },
1958
+ { placement: "right", top: e.top, left: e.right + J },
1959
+ { placement: "left", top: e.top, left: e.left - t - J }
1954
1960
  ] : [
1955
- { placement: "below", top: e.bottom + Q, left: e.left },
1956
- { placement: "above", top: e.top - i - Q, left: e.left },
1957
- { placement: "right", top: e.top, left: e.right + Q },
1958
- { placement: "left", top: e.top, left: e.left - t - Q }
1961
+ { placement: "below", top: e.bottom + J, left: e.left },
1962
+ { placement: "above", top: e.top - i - J, left: e.left },
1963
+ { placement: "right", top: e.top, left: e.right + J },
1964
+ { placement: "left", top: e.top, left: e.left - t - J }
1959
1965
  ];
1960
1966
  for (const { top: u, left: l } of s) {
1961
1967
  const f = He(
1962
- Le(u, i),
1968
+ $e(u, i),
1963
1969
  Ve(l, t),
1964
1970
  t,
1965
1971
  i
@@ -1967,11 +1973,11 @@ function or(e, t = er, i = tr) {
1967
1973
  if (ar(f, r))
1968
1974
  return { top: f.top, left: f.left };
1969
1975
  }
1970
- let o = Le(e.top - i - Q, i), c = Ve(e.left, t);
1976
+ let o = $e(e.top - i - J, i), c = Ve(e.left, t);
1971
1977
  if (r) {
1972
1978
  let u = He(o, c, t, i);
1973
- Ye(u, r) && (o = Le(r.top - i - Q, i), u = He(o, c, t, i)), Ye(u, r) && (o = Le(e.bottom + Q, i), c = Ve(
1974
- Math.min(e.left, r.left - t - Q),
1979
+ Ye(u, r) && (o = $e(r.top - i - J, i), u = He(o, c, t, i)), Ye(u, r) && (o = $e(e.bottom + J, i), c = Ve(
1980
+ Math.min(e.left, r.left - t - J),
1975
1981
  t
1976
1982
  ));
1977
1983
  }
@@ -1983,24 +1989,24 @@ function sr({
1983
1989
  onSubmit: i,
1984
1990
  onCancel: r
1985
1991
  }) {
1986
- const [a, s] = S(""), o = Y(null), c = Y(null), u = e[0] ?? null, l = t ? new DOMRect(t.x, t.y, t.width, t.height) : null, f = Zn(u), p = l ?? f, v = Lt(), m = u ? fe(u) : { kind: "none", value: "" }, g = m.kind !== "none" ? m.value : void 0;
1987
- if (_(() => {
1988
- var w;
1989
- (w = o.current) == null || w.focus();
1990
- }, [e]), _(() => {
1991
- const w = (k) => {
1992
- k.key === "Escape" && r();
1992
+ const [a, s] = A(""), o = X(null), c = X(null), u = e[0] ?? null, l = t ? new DOMRect(t.x, t.y, t.width, t.height) : null, f = Zn(u), p = l ?? f, v = Lt(), m = u ? fe(u) : { kind: "none", value: "" }, g = m.kind !== "none" ? m.value : void 0;
1993
+ if (H(() => {
1994
+ var k;
1995
+ (k = o.current) == null || k.focus();
1996
+ }, [e]), H(() => {
1997
+ const k = (N) => {
1998
+ N.key === "Escape" && r();
1993
1999
  };
1994
- return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
2000
+ return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
1995
2001
  }, [r]), !p) return null;
1996
- const b = or(p), E = e.length > 1 ? `${e.length} selected` : u ? Xe(u) : "Area selection", N = (w) => {
1997
- a.trim() && i(a, w);
2002
+ const y = or(p), S = e.length > 1 ? `${e.length} selected` : u ? Xe(u) : "Area selection", w = (k) => {
2003
+ a.trim() && i(a, k);
1998
2004
  };
1999
2005
  return /* @__PURE__ */ n(
2000
- Te,
2006
+ Pe,
2001
2007
  {
2002
2008
  variant: "popover",
2003
- style: { top: b.top, left: b.left },
2009
+ style: { top: y.top, left: y.left },
2004
2010
  children: /* @__PURE__ */ d(
2005
2011
  "div",
2006
2012
  {
@@ -2010,7 +2016,7 @@ function sr({
2010
2016
  "aria-label": "Add annotation",
2011
2017
  className: "pa-popover-body",
2012
2018
  children: [
2013
- /* @__PURE__ */ n("div", { className: "pa-popover-header", children: /* @__PURE__ */ n("span", { className: "pa-popover-selector", children: E }) }),
2019
+ /* @__PURE__ */ n("div", { className: "pa-popover-header", children: /* @__PURE__ */ n("span", { className: "pa-popover-selector", children: S }) }),
2014
2020
  (v || g) && /* @__PURE__ */ d("div", { className: "pa-popover-context", children: [
2015
2021
  v && /* @__PURE__ */ d("p", { className: "pa-popover-context-line", children: [
2016
2022
  /* @__PURE__ */ n("span", { className: "pa-popover-context-label", children: "Selected" }),
@@ -2029,32 +2035,32 @@ function sr({
2029
2035
  ref: o,
2030
2036
  className: "pa-textarea",
2031
2037
  value: a,
2032
- onChange: (w) => s(w.target.value),
2038
+ onChange: (k) => s(k.target.value),
2033
2039
  placeholder: "Describe the change...",
2034
2040
  rows: 3,
2035
- onKeyDown: (w) => {
2036
- w.key === "Enter" && (w.metaKey || w.ctrlKey) && (w.preventDefault(), N(w.shiftKey)), w.key === "Escape" && r();
2041
+ onKeyDown: (k) => {
2042
+ k.key === "Enter" && (k.metaKey || k.ctrlKey) && (k.preventDefault(), w(k.shiftKey)), k.key === "Escape" && r();
2037
2043
  }
2038
2044
  }
2039
2045
  )
2040
2046
  ] }),
2041
2047
  /* @__PURE__ */ n("p", { className: "pa-popover-hint", children: "⌘↵ Add · ⇧⌘↵ Add & next · Esc Cancel" }),
2042
2048
  /* @__PURE__ */ d("div", { className: "pa-popover-actions", children: [
2043
- /* @__PURE__ */ n(H, { variant: "ghost", onClick: r, children: "Cancel" }),
2049
+ /* @__PURE__ */ n(V, { variant: "ghost", onClick: r, children: "Cancel" }),
2044
2050
  /* @__PURE__ */ n(
2045
- H,
2051
+ V,
2046
2052
  {
2047
2053
  variant: "ghost",
2048
- onClick: () => N(!0),
2054
+ onClick: () => w(!0),
2049
2055
  disabled: !a.trim(),
2050
2056
  children: "Add & next"
2051
2057
  }
2052
2058
  ),
2053
2059
  /* @__PURE__ */ n(
2054
- H,
2060
+ V,
2055
2061
  {
2056
2062
  variant: "glass-primary",
2057
- onClick: () => N(!1),
2063
+ onClick: () => w(!1),
2058
2064
  disabled: !a.trim(),
2059
2065
  children: "Add"
2060
2066
  }
@@ -2145,8 +2151,8 @@ function ur(e) {
2145
2151
  }
2146
2152
  const pr = 20;
2147
2153
  function hr({ annotations: e }) {
2148
- const [t, i] = S([]);
2149
- return _(() => {
2154
+ const [t, i] = A([]);
2155
+ return H(() => {
2150
2156
  if (e.length === 0) {
2151
2157
  i([]);
2152
2158
  return;
@@ -2191,7 +2197,7 @@ function hr({ annotations: e }) {
2191
2197
  )) });
2192
2198
  }
2193
2199
  const Ze = "[data-pixelagent-root],[data-pixelagent-toolbar-portal],[data-pixelagent-picker-portal]";
2194
- function Ee(e) {
2200
+ function Ie(e) {
2195
2201
  return e instanceof Element ? !!e.closest(Ze) : !1;
2196
2202
  }
2197
2203
  function vt(e, t) {
@@ -2230,20 +2236,20 @@ function fr({
2230
2236
  copiedEntryId: l,
2231
2237
  copyAllFrom: f
2232
2238
  }) {
2233
- const [p, v] = S(null), [m, g] = S("");
2234
- _(() => {
2235
- const N = (w) => {
2236
- w.key === "Escape" && (t ? r() : i());
2239
+ const [p, v] = A(null), [m, g] = A("");
2240
+ H(() => {
2241
+ const w = (k) => {
2242
+ k.key === "Escape" && (t ? r() : i());
2237
2243
  };
2238
- return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
2244
+ return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
2239
2245
  }, [t, r, i]);
2240
- const b = (N) => {
2241
- v(N.id), g(N.note);
2242
- }, E = (N) => {
2243
- m.trim() && (c(N, { note: m.trim() }), v(null));
2246
+ const y = (w) => {
2247
+ v(w.id), g(w.note);
2248
+ }, S = (w) => {
2249
+ m.trim() && (c(w, { note: m.trim() }), v(null));
2244
2250
  };
2245
2251
  return /* @__PURE__ */ d(
2246
- Te,
2252
+ Pe,
2247
2253
  {
2248
2254
  variant: "sheet",
2249
2255
  side: "right",
@@ -2252,7 +2258,7 @@ function fr({
2252
2258
  /* @__PURE__ */ d("div", { className: "pa-session-header", children: [
2253
2259
  /* @__PURE__ */ d("div", { className: "pa-session-header-main", children: [
2254
2260
  /* @__PURE__ */ n(
2255
- H,
2261
+ V,
2256
2262
  {
2257
2263
  variant: "ghost",
2258
2264
  className: "pa-glass-btn--sm pa-session-collapse-btn",
@@ -2276,7 +2282,7 @@ function fr({
2276
2282
  feedback: f === "session" ? u : null,
2277
2283
  slotClassName: "pa-copy-feedback-slot--session",
2278
2284
  children: /* @__PURE__ */ n(
2279
- H,
2285
+ V,
2280
2286
  {
2281
2287
  variant: "glass-primary",
2282
2288
  className: "pa-glass-btn--sm",
@@ -2287,14 +2293,14 @@ function fr({
2287
2293
  )
2288
2294
  }
2289
2295
  ),
2290
- /* @__PURE__ */ n(H, { variant: "ghost", onClick: r, "aria-label": "Close session panel", children: "✕" })
2296
+ /* @__PURE__ */ n(V, { variant: "ghost", onClick: r, "aria-label": "Close session panel", children: "✕" })
2291
2297
  ] })
2292
2298
  ] }),
2293
2299
  !t && /* @__PURE__ */ d("ul", { className: "pa-session-list", children: [
2294
2300
  e.length === 0 && /* @__PURE__ */ n("li", { className: "pa-session-empty", children: "No annotations yet. Click an element, drag an area, or Shift+click for multi-select." }),
2295
- e.map((N) => {
2296
- const w = Zt(N);
2297
- return /* @__PURE__ */ n("li", { className: "pa-session-item", children: p === N.id ? /* @__PURE__ */ d("div", { className: "pa-session-edit", children: [
2301
+ e.map((w) => {
2302
+ const k = Zt(w);
2303
+ return /* @__PURE__ */ n("li", { className: "pa-session-item", children: p === w.id ? /* @__PURE__ */ d("div", { className: "pa-session-edit", children: [
2298
2304
  /* @__PURE__ */ d("label", { className: "pa-label", children: [
2299
2305
  "Note",
2300
2306
  /* @__PURE__ */ n(
@@ -2302,18 +2308,18 @@ function fr({
2302
2308
  {
2303
2309
  className: "pa-textarea",
2304
2310
  value: m,
2305
- onChange: (k) => g(k.target.value),
2311
+ onChange: (N) => g(N.target.value),
2306
2312
  rows: 3
2307
2313
  }
2308
2314
  )
2309
2315
  ] }),
2310
2316
  /* @__PURE__ */ d("div", { className: "pa-session-item-actions", children: [
2311
- /* @__PURE__ */ n(H, { variant: "ghost", onClick: () => v(null), children: "Cancel" }),
2317
+ /* @__PURE__ */ n(V, { variant: "ghost", onClick: () => v(null), children: "Cancel" }),
2312
2318
  /* @__PURE__ */ n(
2313
- H,
2319
+ V,
2314
2320
  {
2315
2321
  variant: "glass-primary",
2316
- onClick: () => E(N.id),
2322
+ onClick: () => S(w.id),
2317
2323
  disabled: !m.trim(),
2318
2324
  children: "Save"
2319
2325
  }
@@ -2321,12 +2327,12 @@ function fr({
2321
2327
  ] })
2322
2328
  ] }) : /* @__PURE__ */ d(K, { children: [
2323
2329
  /* @__PURE__ */ d("div", { className: "pa-session-content", children: [
2324
- /* @__PURE__ */ n("span", { className: "pa-session-target", children: w.target }),
2325
- /* @__PURE__ */ n("p", { className: "pa-session-note", children: w.note }),
2326
- w.meta && /* @__PURE__ */ n("p", { className: "pa-session-meta-line", children: w.meta })
2330
+ /* @__PURE__ */ n("span", { className: "pa-session-target", children: k.target }),
2331
+ /* @__PURE__ */ n("p", { className: "pa-session-note", children: k.note }),
2332
+ k.meta && /* @__PURE__ */ n("p", { className: "pa-session-meta-line", children: k.meta })
2327
2333
  ] }),
2328
2334
  /* @__PURE__ */ d("div", { className: "pa-session-item-actions", children: [
2329
- u === "Copied!" && l === N.id ? /* @__PURE__ */ n(
2335
+ u === "Copied!" && l === w.id ? /* @__PURE__ */ n(
2330
2336
  "span",
2331
2337
  {
2332
2338
  className: "pa-status pa-copy-feedback-slot pa-copy-feedback-slot--item",
@@ -2335,37 +2341,37 @@ function fr({
2335
2341
  children: "Copied!"
2336
2342
  }
2337
2343
  ) : /* @__PURE__ */ n(
2338
- H,
2344
+ V,
2339
2345
  {
2340
2346
  variant: "glass-primary",
2341
2347
  className: "pa-glass-btn--sm",
2342
- onClick: () => s(N.id),
2348
+ onClick: () => s(w.id),
2343
2349
  "aria-label": "Copy annotation",
2344
2350
  children: "Copy"
2345
2351
  }
2346
2352
  ),
2347
2353
  /* @__PURE__ */ n(
2348
- H,
2354
+ V,
2349
2355
  {
2350
2356
  variant: "ghost",
2351
2357
  className: "pa-glass-btn--sm",
2352
- onClick: () => b(N),
2358
+ onClick: () => y(w),
2353
2359
  "aria-label": "Edit annotation note",
2354
2360
  children: "✎"
2355
2361
  }
2356
2362
  ),
2357
2363
  /* @__PURE__ */ n(
2358
- H,
2364
+ V,
2359
2365
  {
2360
2366
  variant: "ghost",
2361
2367
  className: "pa-glass-btn--sm",
2362
- onClick: () => o(N.id),
2368
+ onClick: () => o(w.id),
2363
2369
  "aria-label": "Remove annotation",
2364
2370
  children: "✕"
2365
2371
  }
2366
2372
  )
2367
2373
  ] })
2368
- ] }) }, N.id);
2374
+ ] }) }, w.id);
2369
2375
  })
2370
2376
  ] })
2371
2377
  ]
@@ -2425,8 +2431,8 @@ function br({
2425
2431
  chrome: r,
2426
2432
  onToggleHostTheme: a
2427
2433
  }) {
2428
- const s = Y(null);
2429
- return _(() => {
2434
+ const s = X(null);
2435
+ return H(() => {
2430
2436
  if (!e) return;
2431
2437
  const o = (u) => {
2432
2438
  u.key === "Escape" && t();
@@ -2438,7 +2444,7 @@ function br({
2438
2444
  return window.addEventListener("keydown", o), window.addEventListener("mousedown", c), () => {
2439
2445
  window.removeEventListener("keydown", o), window.removeEventListener("mousedown", c);
2440
2446
  };
2441
- }, [e, t]), e ? /* @__PURE__ */ n("div", { ref: s, className: "pa-settings-menu", role: "dialog", "aria-label": "PixelAgent settings", children: /* @__PURE__ */ n(Te, { variant: "popover", className: "pa-settings-menu-panel", children: /* @__PURE__ */ d("div", { className: "pa-settings-menu-inner", children: [
2447
+ }, [e, t]), e ? /* @__PURE__ */ n("div", { ref: s, className: "pa-settings-menu", role: "dialog", "aria-label": "PixelAgent settings", children: /* @__PURE__ */ n(Pe, { variant: "popover", className: "pa-settings-menu-panel", children: /* @__PURE__ */ d("div", { className: "pa-settings-menu-inner", children: [
2442
2448
  /* @__PURE__ */ d("header", { className: "pa-settings-menu-header", children: [
2443
2449
  /* @__PURE__ */ n("h4", { className: "pa-settings-menu-title", children: "Settings" }),
2444
2450
  /* @__PURE__ */ n("p", { className: "pa-settings-menu-subtitle", children: "Appearance and chrome" })
@@ -2448,7 +2454,7 @@ function br({
2448
2454
  /* @__PURE__ */ d("div", { className: "pa-settings-row", children: [
2449
2455
  /* @__PURE__ */ n("span", { className: "pa-settings-row-value", children: i === "dark" ? "Dark canvas" : "Light canvas" }),
2450
2456
  /* @__PURE__ */ n(
2451
- H,
2457
+ V,
2452
2458
  {
2453
2459
  variant: "icon",
2454
2460
  onClick: a,
@@ -2529,17 +2535,17 @@ function Cr({
2529
2535
  copyStatus: v,
2530
2536
  copyAllFrom: m,
2531
2537
  onActivateAnnotate: g,
2532
- onActivateEdit: b,
2533
- onDeactivate: E,
2534
- onCopyAll: N,
2535
- onCaptureModeChange: w,
2536
- onConfirmMultiSelect: k
2538
+ onActivateEdit: y,
2539
+ onDeactivate: S,
2540
+ onCopyAll: w,
2541
+ onCaptureModeChange: k,
2542
+ onConfirmMultiSelect: N
2537
2543
  }) {
2538
- const { elementRef: I, isDragging: P, style: R, dragHandleProps: x } = Rt(), T = /* @__PURE__ */ d(
2544
+ const { elementRef: $, isDragging: _, style: R, dragHandleProps: x } = Rt(), I = /* @__PURE__ */ d(
2539
2545
  "div",
2540
2546
  {
2541
- ref: I,
2542
- className: `pa-toolbar-float ${P ? "pa-toolbar-float--dragging" : ""}`,
2547
+ ref: $,
2548
+ className: `pa-toolbar-float ${_ ? "pa-toolbar-float--dragging" : ""}`,
2543
2549
  style: R,
2544
2550
  role: "toolbar",
2545
2551
  "aria-label": "PixelAgent",
@@ -2576,16 +2582,16 @@ function Cr({
2576
2582
  {
2577
2583
  className: "pa-select pa-toolbar-capture-select",
2578
2584
  value: l,
2579
- onChange: (C) => w(C.target.value),
2585
+ onChange: (L) => k(L.target.value),
2580
2586
  "aria-label": "Capture mode",
2581
- children: Nr.map((C) => /* @__PURE__ */ n("option", { value: C, children: kr[C] }, C))
2587
+ children: Nr.map((L) => /* @__PURE__ */ n("option", { value: L, children: kr[L] }, L))
2582
2588
  }
2583
2589
  ),
2584
2590
  p > 0 && /* @__PURE__ */ n(
2585
- H,
2591
+ V,
2586
2592
  {
2587
2593
  variant: "glass-primary",
2588
- onClick: k,
2594
+ onClick: N,
2589
2595
  "aria-label": "Annotate selected elements",
2590
2596
  children: p
2591
2597
  }
@@ -2596,10 +2602,10 @@ function Cr({
2596
2602
  feedback: m === "toolbar" ? v : null,
2597
2603
  slotClassName: "pa-copy-feedback-slot--toolbar",
2598
2604
  children: /* @__PURE__ */ n(
2599
- H,
2605
+ V,
2600
2606
  {
2601
2607
  variant: "glass-primary",
2602
- onClick: N,
2608
+ onClick: w,
2603
2609
  disabled: f === 0,
2604
2610
  "aria-label": f > 0 ? `Copy all annotations (${f})` : "Copy all annotations",
2605
2611
  children: f > 0 ? `Copy (${f})` : "Copy"
@@ -2610,11 +2616,11 @@ function Cr({
2610
2616
  ] })
2611
2617
  ] }),
2612
2618
  /* @__PURE__ */ n(
2613
- H,
2619
+ V,
2614
2620
  {
2615
2621
  variant: "icon",
2616
2622
  className: "pa-toolbar-close",
2617
- onClick: E,
2623
+ onClick: S,
2618
2624
  "aria-label": "Close",
2619
2625
  children: /* @__PURE__ */ n(
2620
2626
  "svg",
@@ -2638,13 +2644,13 @@ function Cr({
2638
2644
  }
2639
2645
  )
2640
2646
  ] }) : /* @__PURE__ */ d("div", { className: "pa-toolbar-segment", children: [
2641
- /* @__PURE__ */ n(H, { onClick: g, children: "Annotate" }),
2642
- /* @__PURE__ */ n(H, { onClick: b, children: "Edit" })
2647
+ /* @__PURE__ */ n(V, { onClick: g, children: "Annotate" }),
2648
+ /* @__PURE__ */ n(V, { onClick: y, children: "Edit" })
2643
2649
  ] }),
2644
2650
  !c && /* @__PURE__ */ d(K, { children: [
2645
2651
  /* @__PURE__ */ n("span", { className: "pa-toolbar-divider", "aria-hidden": "true" }),
2646
2652
  /* @__PURE__ */ n(
2647
- H,
2653
+ V,
2648
2654
  {
2649
2655
  variant: "icon",
2650
2656
  className: "pa-toolbar-settings",
@@ -2662,34 +2668,34 @@ function Cr({
2662
2668
  ]
2663
2669
  }
2664
2670
  );
2665
- return typeof document > "u" ? T : Ke(
2671
+ return typeof document > "u" ? I : Ke(
2666
2672
  /* @__PURE__ */ n(
2667
2673
  "div",
2668
2674
  {
2669
2675
  className: "pa-root pa-root--toolbar-portal",
2670
2676
  "data-pixelagent-toolbar-portal": !0,
2671
2677
  ...e,
2672
- children: T
2678
+ children: I
2673
2679
  }
2674
2680
  ),
2675
2681
  document.body
2676
2682
  );
2677
2683
  }
2678
2684
  function Mr() {
2679
- const e = Y(Qt()), [t, i] = S(
2685
+ const e = X(Qt()), [t, i] = A(
2680
2686
  () => {
2681
2687
  var s;
2682
2688
  return ((s = e.current) == null ? void 0 : s.annotations) ?? [];
2683
2689
  }
2684
2690
  );
2685
- _(() => {
2691
+ H(() => {
2686
2692
  en({ annotations: t });
2687
2693
  }, [t]);
2688
- const r = $((s, o) => {
2694
+ const r = E((s, o) => {
2689
2695
  i(
2690
2696
  (c) => c.map((u) => u.id === s ? { ...u, ...o } : u)
2691
2697
  );
2692
- }, []), a = $((s) => {
2698
+ }, []), a = E((s) => {
2693
2699
  i((o) => o.filter((c) => c.id !== s));
2694
2700
  }, []);
2695
2701
  return {
@@ -2704,17 +2710,17 @@ function Ar({
2704
2710
  hostTheme: t,
2705
2711
  onHostThemeChange: i
2706
2712
  }) {
2707
- const r = xe(
2713
+ const r = ke(
2708
2714
  () => ({ ...tn, ...e }),
2709
2715
  [e]
2710
- ), [a, s] = S(
2716
+ ), [a, s] = A(
2711
2717
  () => t ?? it(r) ?? "dark"
2712
- ), [o, c] = S(!1), u = t ?? a;
2713
- _(() => {
2718
+ ), [o, c] = A(!1), u = t ?? a;
2719
+ H(() => {
2714
2720
  if (t !== void 0) return;
2715
2721
  const v = () => {
2716
- const b = it(r);
2717
- b && s(b);
2722
+ const y = it(r);
2723
+ y && s(y);
2718
2724
  };
2719
2725
  v();
2720
2726
  const m = r.hostThemeAttribute, g = new MutationObserver(v);
@@ -2723,17 +2729,17 @@ function Ar({
2723
2729
  attributeFilter: [m]
2724
2730
  }), () => g.disconnect();
2725
2731
  }, [t, r]);
2726
- const l = xe(
2732
+ const l = ke(
2727
2733
  () => nn(r, u),
2728
2734
  [r, u]
2729
- ), f = $(() => {
2735
+ ), f = E(() => {
2730
2736
  const v = u === "dark" ? "light" : "dark";
2731
2737
  if (i) {
2732
2738
  i(v);
2733
2739
  return;
2734
2740
  }
2735
2741
  s(v), rn(v, r);
2736
- }, [u, i, r]), p = $(() => {
2742
+ }, [u, i, r]), p = E(() => {
2737
2743
  c((v) => !v);
2738
2744
  }, []);
2739
2745
  return {
@@ -2803,174 +2809,174 @@ function $r({
2803
2809
  onApply: a,
2804
2810
  runtimeStateStyles: s
2805
2811
  } = {}) {
2806
- const o = Ar({ ui: e, hostTheme: t, onHostThemeChange: i }), [c, u] = S(null);
2807
- _(() => {
2812
+ const o = Ar({ ui: e, hostTheme: t, onHostThemeChange: i }), [c, u] = A(null);
2813
+ H(() => {
2808
2814
  if (r || a) return;
2809
- let y = !1;
2810
- return fetch(yt, { method: "GET" }).then((A) => {
2811
- !y && A.status === 405 && u(yt);
2815
+ let b = !1;
2816
+ return fetch(yt, { method: "GET" }).then((M) => {
2817
+ !b && M.status === 405 && u(yt);
2812
2818
  }).catch(() => {
2813
2819
  }), () => {
2814
- y = !0;
2820
+ b = !0;
2815
2821
  };
2816
2822
  }, [r, a]);
2817
- const [l, f] = S(!1), [p, v] = S("idle"), [m, g] = S("element"), {
2818
- annotations: b,
2819
- setAnnotations: E,
2820
- updateAnnotation: N,
2821
- removeAnnotation: w
2822
- } = Mr(), [k, I] = S(null), [P, R] = S(null), [x, T] = S([]), [C, h] = S(null), [F, W] = S(null), [ge, j] = S(!1), [oe, re] = S(!1), V = l && p === "annotate" && b.length > 0 && !ge, [G, ee] = S("this-instance"), [M, O] = S("normal"), [D, U] = S(null), [L, z] = S(null), [X, q] = S(null), Re = Y(null), Pe = Y(null), de = $(
2823
- (y, A) => {
2824
- Pe.current && clearTimeout(Pe.current), U(y), z((A == null ? void 0 : A.entryId) ?? null), q((A == null ? void 0 : A.copyAllFrom) ?? null), Pe.current = setTimeout(() => {
2825
- U(null), z(null), q(null);
2823
+ const [l, f] = A(!1), [p, v] = A("idle"), [m, g] = A("element"), {
2824
+ annotations: y,
2825
+ setAnnotations: S,
2826
+ updateAnnotation: w,
2827
+ removeAnnotation: k
2828
+ } = Mr(), [N, $] = A(null), [_, R] = A(null), [x, I] = A([]), [L, h] = A(null), [F, U] = A(null), [ge, Z] = A(!1), [te, re] = A(!1), W = l && p === "annotate" && y.length > 0 && !ge, [G, ne] = A("this-instance"), [oe, C] = A("normal"), [P, O] = A(null), [D, Y] = A(null), [T, z] = A(null), ve = X(null), be = X(null), de = E(
2829
+ (b, M) => {
2830
+ be.current && clearTimeout(be.current), O(b), Y((M == null ? void 0 : M.entryId) ?? null), z((M == null ? void 0 : M.copyAllFrom) ?? null), be.current = setTimeout(() => {
2831
+ O(null), Y(null), z(null);
2826
2832
  }, 2500);
2827
2833
  },
2828
2834
  []
2829
- ), Ne = $(
2830
- async (y, A, J) => {
2831
- if (y)
2835
+ ), Ce = E(
2836
+ async (b, M, j) => {
2837
+ if (b)
2832
2838
  try {
2833
- await St(y), de(A, J);
2839
+ await St(b), de(M, j);
2834
2840
  } catch {
2835
- de("Copy failed — check clipboard permissions", J);
2841
+ de("Copy failed — check clipboard permissions", j);
2836
2842
  }
2837
2843
  },
2838
2844
  [de]
2839
- ), ve = $(
2840
- (y, A) => {
2841
- y.length === 0 && !A || (h({ elements: y, areaBbox: A }), R(y[0] ?? null));
2845
+ ), ye = E(
2846
+ (b, M) => {
2847
+ b.length === 0 && !M || (h({ elements: b, areaBbox: M }), R(b[0] ?? null));
2842
2848
  },
2843
2849
  []
2844
- ), De = $(
2845
- (y) => {
2846
- if (!(!l || p !== "annotate" || Ee(y.target))) {
2850
+ ), De = E(
2851
+ (b) => {
2852
+ if (!(!l || p !== "annotate" || Ie(b.target))) {
2847
2853
  if (F) {
2848
- W(
2849
- (A) => A && { ...A, currentX: y.clientX, currentY: y.clientY }
2854
+ U(
2855
+ (M) => M && { ...M, currentX: b.clientX, currentY: b.clientY }
2850
2856
  );
2851
2857
  return;
2852
2858
  }
2853
- m !== "area" && I(vt(y.clientX, y.clientY));
2859
+ m !== "area" && $(vt(b.clientX, b.clientY));
2854
2860
  }
2855
2861
  },
2856
2862
  [l, p, F, m]
2857
- ), Oe = $(
2858
- (y) => {
2859
- !l || p !== "annotate" || Ee(y.target) || m !== "area" || y.button !== 0 || (y.preventDefault(), y.stopPropagation(), W({
2860
- startX: y.clientX,
2861
- startY: y.clientY,
2862
- currentX: y.clientX,
2863
- currentY: y.clientY
2863
+ ), Oe = E(
2864
+ (b) => {
2865
+ !l || p !== "annotate" || Ie(b.target) || m !== "area" || b.button !== 0 || (b.preventDefault(), b.stopPropagation(), U({
2866
+ startX: b.clientX,
2867
+ startY: b.clientY,
2868
+ currentX: b.clientX,
2869
+ currentY: b.clientY
2864
2870
  }), h(null));
2865
2871
  },
2866
2872
  [l, p, m]
2867
- ), Fe = $(() => {
2873
+ ), Fe = E(() => {
2868
2874
  if (!F) return;
2869
- const y = Nt(F);
2870
- if (W(null), y.width < 8 || y.height < 8) return;
2871
- const A = on(y, Ze);
2872
- ve(A, y);
2873
- }, [F, ve]), Be = $(
2874
- (y) => {
2875
- if (!l || p !== "annotate" || Ee(y.target) || m === "area") return;
2876
- y.preventDefault(), y.stopPropagation();
2877
- const A = vt(y.clientX, y.clientY);
2878
- if (!A) return;
2879
- if (y.shiftKey || m === "multi") {
2880
- T((te) => te.includes(A) ? te.filter((B) => B !== A) : [...te, A]), R(A);
2875
+ const b = Nt(F);
2876
+ if (U(null), b.width < 8 || b.height < 8) return;
2877
+ const M = on(b, Ze);
2878
+ ye(M, b);
2879
+ }, [F, ye]), Be = E(
2880
+ (b) => {
2881
+ if (!l || p !== "annotate" || Ie(b.target) || m === "area") return;
2882
+ b.preventDefault(), b.stopPropagation();
2883
+ const M = vt(b.clientX, b.clientY);
2884
+ if (!M) return;
2885
+ if (b.shiftKey || m === "multi") {
2886
+ I((Q) => Q.includes(M) ? Q.filter((B) => B !== M) : [...Q, M]), R(M);
2881
2887
  return;
2882
2888
  }
2883
- const J = x.length > 0 ? x : [A];
2884
- ve(J.includes(A) ? J : [A]);
2889
+ const j = x.length > 0 ? x : [M];
2890
+ ye(j.includes(M) ? j : [M]);
2885
2891
  },
2886
- [l, p, m, x, ve]
2892
+ [l, p, m, x, ye]
2887
2893
  );
2888
- _(() => {
2889
- !P || G !== "all-instances" || Ct(P) <= 1 && ee("this-instance");
2890
- }, [P, G]), _(() => {
2894
+ H(() => {
2895
+ !_ || G !== "all-instances" || Ct(_) <= 1 && ne("this-instance");
2896
+ }, [_, G]), H(() => {
2891
2897
  if (l)
2892
2898
  return document.addEventListener("mousemove", De, !0), document.addEventListener("mousedown", Oe, !0), document.addEventListener("mouseup", Fe, !0), document.addEventListener("click", Be, !0), () => {
2893
2899
  document.removeEventListener("mousemove", De, !0), document.removeEventListener("mousedown", Oe, !0), document.removeEventListener("mouseup", Fe, !0), document.removeEventListener("click", Be, !0);
2894
2900
  };
2895
2901
  }, [l, De, Oe, Fe, Be]);
2896
- const Vt = $(
2897
- (y, A) => {
2898
- if (!C || !y.trim()) return;
2899
- const { elements: J, areaBbox: te } = C;
2900
- if (J.length === 0 && !te) return;
2901
- const be = cr({
2902
- elements: J,
2903
- note: y,
2904
- areaBbox: te
2902
+ const Vt = E(
2903
+ (b, M) => {
2904
+ if (!L || !b.trim()) return;
2905
+ const { elements: j, areaBbox: Q } = L;
2906
+ if (j.length === 0 && !Q) return;
2907
+ const we = cr({
2908
+ elements: j,
2909
+ note: b,
2910
+ areaBbox: Q
2905
2911
  });
2906
- E((B) => [...B, be]), j(!1), re(!1), A ? (h(null), R(null)) : (h(null), R(null), T([]));
2912
+ S((B) => [...B, we]), Z(!1), re(!1), M ? (h(null), R(null)) : (h(null), R(null), I([]));
2907
2913
  },
2908
- [C, E]
2909
- ), Wt = $(() => {
2914
+ [L, S]
2915
+ ), Wt = E(() => {
2910
2916
  h(null), R(null);
2911
- }, []), Qe = $(
2912
- async (y) => {
2913
- const A = sn(b);
2914
- await Ne(A, "Copied all!", { copyAllFrom: y });
2917
+ }, []), Qe = E(
2918
+ async (b) => {
2919
+ const M = sn(y);
2920
+ await Ce(M, "Copied all!", { copyAllFrom: b });
2915
2921
  },
2916
- [b, Ne]
2917
- ), Ut = $(
2918
- async (y) => {
2919
- const A = b.find((J) => J.id === y);
2920
- A && await Ne(ln(A), "Copied!", { entryId: y });
2922
+ [y, Ce]
2923
+ ), Ut = E(
2924
+ async (b) => {
2925
+ const M = y.find((j) => j.id === b);
2926
+ M && await Ce(ln(M), "Copied!", { entryId: b });
2921
2927
  },
2922
- [b, Ne]
2923
- ), Yt = $(
2924
- async (y) => {
2925
- const A = [];
2926
- for (const [B, Z] of y)
2927
- for (const [se, ne] of Z)
2928
- ne.length > 0 && A.push([B, se, ne]);
2929
- if (A.length === 0) return { applied: !1 };
2928
+ [y, Ce]
2929
+ ), Yt = E(
2930
+ async (b) => {
2931
+ const M = [];
2932
+ for (const [B, q] of b)
2933
+ for (const [se, ee] of q)
2934
+ ee.length > 0 && M.push([B, se, ee]);
2935
+ if (M.length === 0) return { applied: !1 };
2930
2936
  if (s) {
2931
- for (const [B, Z, se] of A) {
2932
- if (Z === "normal") continue;
2933
- const ne = Sr(B);
2934
- for (const ye of se)
2935
- B.style.removeProperty(ye.property), Er(ne, Z, ye.property, ye.newValue);
2937
+ for (const [B, q, se] of M) {
2938
+ if (q === "normal") continue;
2939
+ const ee = Sr(B);
2940
+ for (const xe of se)
2941
+ B.style.removeProperty(xe.property), Er(ee, q, xe.property, xe.newValue);
2936
2942
  }
2937
- for (const [B, Z, se] of A)
2938
- if (Z === "normal")
2939
- for (const ne of se)
2940
- B.style.setProperty(ne.property, ne.newValue);
2943
+ for (const [B, q, se] of M)
2944
+ if (q === "normal")
2945
+ for (const ee of se)
2946
+ B.style.setProperty(ee.property, ee.newValue);
2941
2947
  return de("Change applied"), { applied: !0, skipRevert: !0 };
2942
2948
  }
2943
- const J = r ?? c ?? void 0, te = [];
2944
- for (const [B, Z, se] of A) {
2945
- const ne = Ge(B), ye = {
2949
+ const j = r ?? c ?? void 0, Q = [];
2950
+ for (const [B, q, se] of M) {
2951
+ const ee = Ge(B), xe = {
2946
2952
  schemaVersion: 1,
2947
2953
  elementSelector: Mt(B, G),
2948
- sourceFile: ne.sourceFile,
2949
- lineNumber: ne.lineNumber,
2954
+ sourceFile: ee.sourceFile,
2955
+ lineNumber: ee.lineNumber,
2950
2956
  targetScope: G,
2951
- state: Z,
2957
+ state: q,
2952
2958
  stylingSystem: kt(B),
2953
2959
  changes: se
2954
2960
  };
2955
- te.push(await Jn(ye, { applyEndpoint: J, onApply: a }));
2961
+ Q.push(await Jn(xe, { applyEndpoint: j, onApply: a }));
2956
2962
  }
2957
- const be = te.every(
2963
+ const we = Q.every(
2958
2964
  (B) => B.mode === "mcp" && B.result.success && B.result.linesChanged.length > 0
2959
2965
  );
2960
- return de(be ? "Change applied" : "Apply failed"), te.forEach((B, Z) => {
2961
- B.mode === "error" ? console.error(`[pixelagent] Apply #${Z} failed:`, B.message) : B.mode === "clipboard" ? console.warn(`[pixelagent] Apply #${Z} fell back to clipboard`) : B.mode === "mcp" && !B.result.success && console.warn(`[pixelagent] Apply #${Z} reported no changes:`, B.result);
2962
- }), { applied: be };
2966
+ return de(we ? "Change applied" : "Apply failed"), Q.forEach((B, q) => {
2967
+ B.mode === "error" ? console.error(`[pixelagent] Apply #${q} failed:`, B.message) : B.mode === "clipboard" ? console.warn(`[pixelagent] Apply #${q} fell back to clipboard`) : B.mode === "mcp" && !B.result.success && console.warn(`[pixelagent] Apply #${q} reported no changes:`, B.result);
2968
+ }), { applied: we };
2963
2969
  },
2964
2970
  [G, r, c, a, s, de]
2965
- ), et = (y) => {
2966
- o.setSettingsOpen(!1), f(!0), v(y), R(null), I(null), h(null), T([]), W(null), y === "annotate" && j(!1);
2971
+ ), et = (b) => {
2972
+ o.setSettingsOpen(!1), f(!0), v(b), R(null), $(null), h(null), I([]), U(null), b === "annotate" && Z(!1);
2967
2973
  }, Xt = () => {
2968
- f(!1), v("idle"), R(null), I(null), h(null), T([]), W(null), j(!1), re(!1);
2974
+ f(!1), v("idle"), R(null), $(null), h(null), I([]), U(null), Z(!1), re(!1);
2969
2975
  }, Gt = F ? Nt(F) : null;
2970
2976
  return /* @__PURE__ */ d(
2971
2977
  "div",
2972
2978
  {
2973
- ref: Re,
2979
+ ref: ve,
2974
2980
  className: "pa-root",
2975
2981
  "data-pixelagent-root": !0,
2976
2982
  ...o.rootAttributes,
@@ -2988,17 +2994,17 @@ function $r({
2988
2994
  active: l,
2989
2995
  mode: p,
2990
2996
  captureMode: m,
2991
- annotationCount: b.length,
2997
+ annotationCount: y.length,
2992
2998
  multiSelectCount: x.length,
2993
- copyStatus: D,
2994
- copyAllFrom: X,
2999
+ copyStatus: P,
3000
+ copyAllFrom: T,
2995
3001
  onActivateAnnotate: () => et("annotate"),
2996
3002
  onActivateEdit: () => et("edit"),
2997
3003
  onDeactivate: Xt,
2998
3004
  onCopyAll: () => Qe("toolbar"),
2999
3005
  onCaptureModeChange: g,
3000
3006
  onConfirmMultiSelect: () => {
3001
- x.length > 0 && ve(x);
3007
+ x.length > 0 && ye(x);
3002
3008
  }
3003
3009
  }
3004
3010
  ),
@@ -3006,19 +3012,19 @@ function $r({
3006
3012
  /* @__PURE__ */ n(
3007
3013
  $t,
3008
3014
  {
3009
- element: k,
3010
- selected: P,
3015
+ element: N,
3016
+ selected: _,
3011
3017
  multiSelected: x
3012
3018
  }
3013
3019
  ),
3014
- /* @__PURE__ */ n(hr, { annotations: b }),
3020
+ /* @__PURE__ */ n(hr, { annotations: y }),
3015
3021
  /* @__PURE__ */ n(lr, { area: Gt, isDragging: !!F })
3016
3022
  ] }),
3017
- l && p === "annotate" && C && /* @__PURE__ */ n(
3023
+ l && p === "annotate" && L && /* @__PURE__ */ n(
3018
3024
  sr,
3019
3025
  {
3020
- elements: C.elements,
3021
- areaBbox: C.areaBbox,
3026
+ elements: L.elements,
3027
+ areaBbox: L.areaBbox,
3022
3028
  onSubmit: Vt,
3023
3029
  onCancel: Wt
3024
3030
  }
@@ -3026,35 +3032,35 @@ function $r({
3026
3032
  l && p === "edit" && /* @__PURE__ */ n(
3027
3033
  qn,
3028
3034
  {
3029
- selectedElement: P,
3030
- hoveredElement: k,
3035
+ selectedElement: _,
3036
+ hoveredElement: N,
3031
3037
  onSelectElement: R,
3032
- onHoverElement: I,
3038
+ onHoverElement: $,
3033
3039
  targetScope: G,
3034
- onTargetScopeChange: ee,
3035
- elementState: M,
3036
- onElementStateChange: O,
3040
+ onTargetScopeChange: ne,
3041
+ elementState: oe,
3042
+ onElementStateChange: C,
3037
3043
  onApply: Yt,
3038
- applyStatus: p === "edit" ? D : null,
3039
- isToolbarTarget: Ee
3044
+ applyStatus: p === "edit" ? P : null,
3045
+ isToolbarTarget: Ie
3040
3046
  }
3041
3047
  ),
3042
- V && /* @__PURE__ */ n(
3048
+ W && /* @__PURE__ */ n(
3043
3049
  fr,
3044
3050
  {
3045
- annotations: b,
3046
- collapsed: oe,
3047
- onToggleCollapsed: () => re((y) => !y),
3051
+ annotations: y,
3052
+ collapsed: te,
3053
+ onToggleCollapsed: () => re((b) => !b),
3048
3054
  onClose: () => {
3049
- j(!0), re(!1);
3055
+ Z(!0), re(!1);
3050
3056
  },
3051
3057
  onCopyAll: () => Qe("session"),
3052
3058
  onCopyOne: Ut,
3053
- onRemove: w,
3054
- onUpdate: N,
3055
- copyStatus: D,
3056
- copiedEntryId: L,
3057
- copyAllFrom: X
3059
+ onRemove: k,
3060
+ onUpdate: w,
3061
+ copyStatus: P,
3062
+ copiedEntryId: D,
3063
+ copyAllFrom: T
3058
3064
  }
3059
3065
  )
3060
3066
  ]