@llumi/design-system 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/LICENSE +51 -0
  2. package/NOTICE +66 -0
  3. package/README.md +15 -205
  4. package/custom-elements.json +1184 -18
  5. package/dist/LICENSE +51 -0
  6. package/dist/NOTICE +66 -0
  7. package/dist/README.md +29 -0
  8. package/dist/adopt-global-styles-DykTxdm8.js +15 -0
  9. package/dist/base.css +2 -0
  10. package/dist/base.md +59 -0
  11. package/dist/bpmn.md +113 -0
  12. package/dist/bpmn.mjs +5076 -0
  13. package/dist/copy-button.md +128 -0
  14. package/dist/copy-button.mjs +161 -0
  15. package/dist/download-button.md +106 -0
  16. package/dist/download-button.mjs +177 -0
  17. package/dist/highlighter.md +45 -0
  18. package/dist/highlighter.mjs +403 -0
  19. package/dist/icon-button-BeLaqJmK.js +5 -0
  20. package/dist/icons-DBLWcA83.js +42 -0
  21. package/dist/index-elWLeWLs.js +7733 -0
  22. package/dist/llumi-element-DTeRDxao.js +22 -0
  23. package/dist/mermaid.md +58 -0
  24. package/dist/mermaid.mjs +254 -0
  25. package/dist/review.md +141 -0
  26. package/dist/review.mjs +1039 -690
  27. package/dist/slot-text-DW3pDxNK.js +51 -0
  28. package/dist/theme.css +2 -0
  29. package/package.json +49 -26
  30. package/dist/review.cjs +0 -172
  31. package/dist/review.css +0 -98
  32. package/dist/review.js +0 -172
  33. package/dist/types/components/review/comment-dialog.element.d.ts +0 -21
  34. package/dist/types/components/review/custom-target.utils.d.ts +0 -16
  35. package/dist/types/components/review/default-editor.element.d.ts +0 -19
  36. package/dist/types/components/review/highlight-manager.d.ts +0 -21
  37. package/dist/types/components/review/index.d.ts +0 -8
  38. package/dist/types/components/review/overall-comment-dialog.element.d.ts +0 -22
  39. package/dist/types/components/review/review-bar.element.d.ts +0 -26
  40. package/dist/types/components/review/review.element.d.ts +0 -56
  41. package/dist/types/components/review/review.machine.d.ts +0 -234
  42. package/dist/types/components/review/review.persistence.d.ts +0 -16
  43. package/dist/types/components/review/review.type.d.ts +0 -37
  44. package/dist/types/components/review/selection-comment-icons.element.d.ts +0 -17
  45. package/dist/types/components/review/selection-range.utils.d.ts +0 -6
  46. package/dist/types/components/review/sort-comments.utils.d.ts +0 -6
  47. package/dist/types/index.d.ts +0 -1
  48. package/dist/types/shared/cn.d.ts +0 -2
  49. package/dist/types/shared/icons.d.ts +0 -7
  50. package/dist/types/shared/tailwind-element.d.ts +0 -4
package/dist/review.mjs CHANGED
@@ -1,185 +1,187 @@
1
- import { fromCallback as ct, setup as Tt, emit as dt, assign as x, stateIn as kt, enqueueActions as Lt, createActor as zt } from "xstate";
2
- import { tinykeys as Ot } from "tinykeys";
3
- import { svg as _, html as v, LitElement as At, unsafeCSS as Dt } from "lit";
4
- import { property as f, query as F, state as Mt, customElement as A } from "lit/decorators.js";
5
- import { clsx as _t } from "clsx";
6
- import { twMerge as Nt } from "tailwind-merge";
7
- import { autoUpdate as vt, computePosition as wt, offset as bt, flip as xt, shift as yt, size as Ct } from "@floating-ui/dom";
8
- import { classMap as Pt } from "lit/directives/class-map.js";
9
- import { repeat as $t } from "lit/directives/repeat.js";
10
- import { styleMap as Rt } from "lit/directives/style-map.js";
11
- function ht(n, e) {
12
- const t = n.getAttribute("data-review-id");
1
+ import { fromCallback as rt, setup as xt, emit as st, assign as E, stateIn as yt, enqueueActions as It, createActor as St } from "https://cdn.jsdelivr.net/npm/xstate@5.32.2";
2
+ import { a as Tt } from "./adopt-global-styles-DykTxdm8.js";
3
+ import { tinykeys as Lt } from "https://cdn.jsdelivr.net/npm/tinykeys@3.1.0";
4
+ import { html as w, css as F } from "https://cdn.jsdelivr.net/npm/lit@3.3.3";
5
+ import { property as v, query as U, state as Ot, customElement as k } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/decorators.js";
6
+ import { classMap as A } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/directives/class-map.js";
7
+ import { i as M } from "./icons-DBLWcA83.js";
8
+ import { L as C } from "./llumi-element-DTeRDxao.js";
9
+ import { autoUpdate as gt, computePosition as ut, offset as pt, flip as ft, shift as vt, size as bt } from "https://cdn.jsdelivr.net/npm/@floating-ui/dom@1.7.6";
10
+ import { repeat as At } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/directives/repeat.js";
11
+ import { styleMap as Dt } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/directives/style-map.js";
12
+ /*! @llumi/design-system v2.0.0 | (c) 2026 pAIrprog SAS | license: https://cdn.jsdelivr.net/npm/@llumi/design-system@2.0.0/LICENSE | bundled third-party components under MIT, see NOTICE | @license */
13
+ function at(o, e) {
14
+ const t = o.getAttribute("data-review-id");
13
15
  if (t) return t;
14
- for (const i of e ?? [])
15
- if (n.matches(i.selector)) {
16
- const o = i.toId(n);
17
- if (o) return o;
16
+ for (const n of e ?? [])
17
+ if (o.matches(n.selector)) {
18
+ const i = n.toId(o);
19
+ if (i) return i;
18
20
  }
19
21
  return null;
20
22
  }
21
- function N(n, e) {
22
- const t = n.closest("[data-review-id]");
23
+ function _(o, e) {
24
+ const t = o.closest("[data-review-id]");
23
25
  if (t) {
24
- const i = t.getAttribute("data-review-id");
25
- if (i) return { element: t, targetId: i };
26
- }
27
- for (const i of e ?? []) {
28
- const o = n.closest(i.selector);
29
- if (o) {
30
- const r = i.toId(o);
31
- if (r) return { element: o, targetId: r };
26
+ const n = t.getAttribute("data-review-id");
27
+ if (n) return { element: t, targetId: n };
28
+ }
29
+ for (const n of e ?? []) {
30
+ const i = o.closest(n.selector);
31
+ if (i) {
32
+ const r = n.toId(i);
33
+ if (r) return { element: i, targetId: r };
32
34
  }
33
35
  }
34
36
  return null;
35
37
  }
36
- function P(n, e) {
37
- const t = /* @__PURE__ */ new Set(), i = [];
38
- for (const o of Array.from(
39
- n.querySelectorAll("[data-review-id]")
38
+ function D(o, e) {
39
+ const t = /* @__PURE__ */ new Set(), n = [];
40
+ for (const i of Array.from(
41
+ o.querySelectorAll("[data-review-id]")
40
42
  )) {
41
- const r = o.getAttribute("data-review-id");
43
+ const r = i.getAttribute("data-review-id");
42
44
  if (!r) continue;
43
- const a = o.hasAttribute("data-review-selectable");
44
- i.push({
45
- element: o,
45
+ const s = i.hasAttribute("data-review-selectable");
46
+ n.push({
47
+ element: i,
46
48
  targetId: r,
47
- kind: a ? "both" : "element"
48
- }), t.add(o);
49
+ kind: s ? "both" : "element"
50
+ }), t.add(i);
49
51
  }
50
- for (const o of e ?? [])
52
+ for (const i of e ?? [])
51
53
  for (const r of Array.from(
52
- n.querySelectorAll(o.selector)
54
+ o.querySelectorAll(i.selector)
53
55
  )) {
54
56
  if (t.has(r)) continue;
55
- const a = o.toId(r);
56
- if (!a) continue;
57
- const s = r.hasAttribute("data-review-selectable");
58
- i.push({
57
+ const s = i.toId(r);
58
+ if (!s) continue;
59
+ const a = r.hasAttribute("data-review-selectable");
60
+ n.push({
59
61
  element: r,
60
- targetId: a,
61
- kind: s ? "both" : "element"
62
+ targetId: s,
63
+ kind: a ? "both" : "element"
62
64
  }), t.add(r);
63
65
  }
64
- for (const o of Array.from(
65
- n.querySelectorAll("[data-review-selectable]")
66
+ for (const i of Array.from(
67
+ o.querySelectorAll("[data-review-selectable]")
66
68
  )) {
67
- if (t.has(o)) continue;
68
- const r = o.getAttribute("data-review-selectable");
69
- r && (i.push({ element: o, targetId: r, kind: "selectable" }), t.add(o));
69
+ if (t.has(i)) continue;
70
+ const r = i.getAttribute("data-review-selectable");
71
+ r && (n.push({ element: i, targetId: r, kind: "selectable" }), t.add(i));
70
72
  }
71
- return i;
73
+ return n;
72
74
  }
73
- const nt = "review-highlight-hover", C = "review-highlight-commented", G = "review-highlight-editing", j = "review-highlight-uncommented", V = "review-target", gt = "review-active";
74
- function B(n) {
75
- n.classList.remove(
76
- nt,
77
- C,
78
- G,
79
- j
75
+ const J = "review-highlight-hover", y = "review-highlight-commented", $ = "review-highlight-editing", H = "review-highlight-uncommented", j = "review-target", lt = "review-active";
76
+ function q(o) {
77
+ o.classList.remove(
78
+ J,
79
+ y,
80
+ $,
81
+ H
80
82
  );
81
83
  }
82
- function Ht(n, e) {
83
- let t = null, i = null, o = null;
84
+ function kt(o, e) {
85
+ let t = null, n = null, i = null;
84
86
  function r(c) {
85
- n.classList.add(gt);
86
- const h = P(n, e);
87
- for (const { element: p, targetId: d, kind: T } of h)
88
- (T === "element" || T === "both") && (p.hasAttribute("data-review-id") || p.classList.add(V), c.has(d) && p.classList.add(C));
89
- }
90
- function a() {
91
- n.classList.remove(gt), t && (clearTimeout(t), t = null);
92
- const c = P(n, e);
93
- for (const { element: h } of c)
94
- B(h), h.classList.remove(V);
95
- }
96
- function s(c) {
97
- const h = P(n, e), p = [];
98
- for (const { element: d } of h)
99
- !d.classList.contains(C) && !d.classList.contains(G) && (d.classList.add(j), p.push(d));
87
+ o.classList.add(lt);
88
+ const m = D(o, e);
89
+ for (const { element: f, targetId: d, kind: O } of m)
90
+ (O === "element" || O === "both") && (f.hasAttribute("data-review-id") || f.classList.add(j), c.has(d) && f.classList.add(y));
91
+ }
92
+ function s() {
93
+ o.classList.remove(lt), t && (clearTimeout(t), t = null);
94
+ const c = D(o, e);
95
+ for (const { element: m } of c)
96
+ q(m), m.classList.remove(j);
97
+ }
98
+ function a(c) {
99
+ const m = D(o, e), f = [];
100
+ for (const { element: d } of m)
101
+ !d.classList.contains(y) && !d.classList.contains($) && (d.classList.add(H), f.push(d));
100
102
  c && (t && clearTimeout(t), t = setTimeout(() => {
101
103
  t = null;
102
- for (const d of p)
103
- d.classList.contains(G) || d.classList.remove(j);
104
+ for (const d of f)
105
+ d.classList.contains($) || d.classList.remove(H);
104
106
  }, 500));
105
107
  }
106
108
  function l() {
107
109
  t && (clearTimeout(t), t = null);
108
- const c = P(n, e);
109
- for (const { element: h } of c)
110
- h.classList.remove(j);
110
+ const c = D(o, e);
111
+ for (const { element: m } of c)
112
+ m.classList.remove(H);
111
113
  }
112
- function u(c, h) {
113
- h || (B(c), c.classList.add(G));
114
+ function h(c, m) {
115
+ m || (q(c), c.classList.add($));
114
116
  }
115
- function m(c, h) {
116
- B(c), h && c.classList.add(C);
117
+ function u(c, m) {
118
+ q(c), m && c.classList.add(y);
117
119
  }
118
- function b(c, h) {
119
- (ht(c, e) ?? c.getAttribute("data-review-selectable")) !== h && c.classList.add(nt);
120
+ function p(c, m) {
121
+ (at(c, e) ?? c.getAttribute("data-review-selectable")) !== m && c.classList.add(J);
120
122
  }
121
- function g(c, h, p) {
122
- const d = ht(c, e) ?? c.getAttribute("data-review-selectable");
123
- d !== h && (c.classList.remove(nt), d && (p != null && p.has(d)) && c.classList.add(C));
123
+ function g(c, m, f) {
124
+ const d = at(c, e) ?? c.getAttribute("data-review-selectable");
125
+ d !== m && (c.classList.remove(J), d && (f != null && f.has(d)) && c.classList.add(y));
124
126
  }
125
- function It(c) {
126
- q(), o = c.editingTarget ?? null, i = new MutationObserver((h) => {
127
- for (const p of h) {
128
- for (const d of Array.from(p.removedNodes)) {
127
+ function Et(c) {
128
+ W(), i = c.editingTarget ?? null, n = new MutationObserver((m) => {
129
+ for (const f of m) {
130
+ for (const d of Array.from(f.removedNodes)) {
129
131
  if (!(d instanceof HTMLElement)) continue;
130
- o && (d === o || d.contains(o)) && (o = null, c.onTargetDisconnected()), (d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
132
+ i && (d === i || d.contains(i)) && (i = null, c.onTargetDisconnected()), (d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
131
133
  }
132
- for (const d of Array.from(p.addedNodes)) {
134
+ for (const d of Array.from(f.addedNodes)) {
133
135
  if (!(d instanceof HTMLElement)) continue;
134
- const T = [
136
+ const O = [
135
137
  ...d.matches("[data-review-id]") ? [d] : [],
136
138
  ...Array.from(
137
139
  d.querySelectorAll("[data-review-id]")
138
140
  )
139
141
  ];
140
- for (const I of T) {
141
- const M = I.getAttribute("data-review-id");
142
- M && c.commentedIds.has(M) && I.classList.add(C);
142
+ for (const T of O) {
143
+ const R = T.getAttribute("data-review-id");
144
+ R && c.commentedIds.has(R) && T.classList.add(y);
143
145
  }
144
- for (const I of e ?? []) {
145
- const M = [
146
- ...d.matches(I.selector) ? [d] : [],
147
- ...Array.from(d.querySelectorAll(I.selector))
146
+ for (const T of e ?? []) {
147
+ const R = [
148
+ ...d.matches(T.selector) ? [d] : [],
149
+ ...Array.from(d.querySelectorAll(T.selector))
148
150
  ];
149
- for (const W of M) {
150
- const lt = I.toId(W);
151
- W.classList.add(V), lt && c.commentedIds.has(lt) && W.classList.add(C);
151
+ for (const X of R) {
152
+ const ot = T.toId(X);
153
+ X.classList.add(j), ot && c.commentedIds.has(ot) && X.classList.add(y);
152
154
  }
153
155
  }
154
156
  (d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
155
157
  }
156
158
  }
157
- }), i.observe(n, { childList: !0, subtree: !0 });
159
+ }), n.observe(o, { childList: !0, subtree: !0 });
158
160
  }
159
- function q() {
160
- i && (i.disconnect(), i = null), o = null;
161
+ function W() {
162
+ n && (n.disconnect(), n = null), i = null;
161
163
  }
162
- function St() {
163
- a(), q();
164
+ function wt() {
165
+ s(), W();
164
166
  }
165
167
  return {
166
168
  activate: r,
167
- deactivate: a,
168
- reveal: s,
169
+ deactivate: s,
170
+ reveal: a,
169
171
  unreveal: l,
170
- setEditing: u,
171
- clearEditing: m,
172
- applyHover: b,
172
+ setEditing: h,
173
+ clearEditing: u,
174
+ applyHover: p,
173
175
  clearHover: g,
174
- startObserving: It,
175
- stopObserving: q,
176
- destroy: St
176
+ startObserving: Et,
177
+ stopObserving: W,
178
+ destroy: wt
177
179
  };
178
180
  }
179
- const Gt = `:root{--review-highlight-uncommented-color: oklch(.7 0 0 / .15);--review-highlight-commented-color: oklch(.7 0 0 / .3);--review-highlight-color: oklch(.7 0 0 / .5);--review-highlight-editing-color: oklch(.6 0 0 / .7);--review-badge-icon-color: oklch(.35 0 0);--review-z-index: 9998;--review-selection-commented-color: oklch(.85 .08 250 / .4);--review-selection-editing-color: oklch(.75 .12 250 / .6);--review-selection-hover-color: oklch(.8 .1 250 / .5)}[data-review-id],[data-review-selectable],.review-target{outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease}.review-highlight-uncommented{outline-color:var(--review-highlight-uncommented-color)}.review-highlight-commented{outline-color:var(--review-highlight-commented-color);position:relative}.review-highlight-hover{outline-color:var(--review-highlight-color)}.review-highlight-commented:after{content:"";position:absolute;top:-12px;right:-14px;width:20px;height:20px;border-radius:50%;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");background-size:12px 12px;background-repeat:no-repeat;background-position:center;box-shadow:0 1px 3px #0000001a;pointer-events:none}.review-highlight-editing:after{display:none}[data-review-selectable]:not([data-review-id]).review-highlight-commented:after{display:none}.review-highlight-editing{outline-color:var(--review-highlight-editing-color)}::highlight(review-selection-commented){background-color:var(--review-selection-commented-color)}::highlight(review-selection-editing){background-color:var(--review-selection-editing-color)}::highlight(review-selection-hover){background-color:var(--review-selection-hover-color)}.review-active [data-review-id],.review-active .review-target{cursor:pointer}.review-active [data-review-selectable]{cursor:text}`;
180
- function jt(n, e) {
181
- const t = n.find(
182
- (o) => o.targetId === e && !o.selection
181
+ const Nt = `:root{--review-highlight-uncommented-color: oklch(.7 0 0 / .15);--review-highlight-commented-color: oklch(.7 0 0 / .3);--review-highlight-color: oklch(.7 0 0 / .5);--review-highlight-editing-color: oklch(.6 0 0 / .7);--review-badge-icon-color: oklch(.35 0 0);--review-z-index: 9998;--review-selection-commented-color: oklch(.85 .08 250 / .4);--review-selection-editing-color: oklch(.75 .12 250 / .6);--review-selection-hover-color: oklch(.8 .1 250 / .5)}[data-review-id],[data-review-selectable],.review-target{outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease}.review-highlight-uncommented{outline-color:var(--review-highlight-uncommented-color)}.review-highlight-commented{outline-color:var(--review-highlight-commented-color);position:relative}.review-highlight-hover{outline-color:var(--review-highlight-color)}.review-highlight-commented:after{content:"";position:absolute;top:-12px;right:-14px;width:20px;height:20px;border-radius:50%;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");background-size:12px 12px;background-repeat:no-repeat;background-position:center;box-shadow:0 1px 3px #0000001a;pointer-events:none}.review-highlight-editing:after{display:none}[data-review-selectable]:not([data-review-id]).review-highlight-commented:after{display:none}.review-highlight-editing{outline-color:var(--review-highlight-editing-color)}::highlight(review-selection-commented){background-color:var(--review-selection-commented-color)}::highlight(review-selection-editing){background-color:var(--review-selection-editing-color)}::highlight(review-selection-hover){background-color:var(--review-selection-hover-color)}.review-active [data-review-id],.review-active .review-target{cursor:pointer}.review-active [data-review-selectable]{cursor:text}`;
182
+ function Pt(o, e) {
183
+ const t = o.find(
184
+ (i) => i.targetId === e && !i.selection
183
185
  );
184
186
  return t ? { comment: t, isNew: !1 } : { comment: {
185
187
  commentId: crypto.randomUUID(),
@@ -188,14 +190,14 @@ function jt(n, e) {
188
190
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
189
191
  }, isNew: !0 };
190
192
  }
191
- function Ut(n) {
192
- let e = n.comments;
193
- if (n.editingCommentId !== null) {
193
+ function Rt(o) {
194
+ let e = o.comments;
195
+ if (o.editingCommentId !== null) {
194
196
  const t = e.find(
195
- (i) => i.commentId === n.editingCommentId
197
+ (n) => n.commentId === o.editingCommentId
196
198
  );
197
199
  t && t.content === "" && (e = e.filter(
198
- (i) => i.commentId !== n.editingCommentId
200
+ (n) => n.commentId !== o.editingCommentId
199
201
  ));
200
202
  }
201
203
  return {
@@ -205,29 +207,29 @@ function Ut(n) {
205
207
  selectionRange: null
206
208
  };
207
209
  }
208
- function Y(n) {
209
- const e = n.comments.filter((o) => o.content.trim()), t = e.length > 0, i = n.overallComment.trim().length > 0;
210
- return !t && !i ? { status: "approved" } : {
210
+ function B(o) {
211
+ const e = o.comments.filter((i) => i.content.trim()), t = e.length > 0, n = o.overallComment.trim().length > 0;
212
+ return !t && !n ? { status: "approved" } : {
211
213
  status: "commented",
212
214
  comments: e,
213
- overallComment: i ? n.overallComment.trim() : void 0
215
+ overallComment: n ? o.overallComment.trim() : void 0
214
216
  };
215
217
  }
216
- function Ft(n) {
218
+ function _t(o) {
217
219
  const e = /* @__PURE__ */ new Set();
218
- for (const t of n.comments)
220
+ for (const t of o.comments)
219
221
  !t.selection && t.content.trim() && e.add(t.targetId);
220
222
  return e;
221
223
  }
222
- function Kt() {
223
- const n = ct(
224
- ({ sendBack: t, input: i }) => {
225
- const o = () => t({ type: "RELEASE_ANNOTATE" }), r = (l) => {
224
+ function Mt() {
225
+ const o = rt(
226
+ ({ sendBack: t, input: n }) => {
227
+ const i = () => t({ type: "RELEASE_ANNOTATE" }), r = (l) => {
226
228
  l.key === "Alt" && (l.preventDefault(), t({ type: "HOLD_ANNOTATE" }));
227
- }, a = (l) => {
229
+ }, s = (l) => {
228
230
  l.key === "Alt" && t({ type: "RELEASE_ANNOTATE" });
229
- }, s = Ot(window, {
230
- [i.shortcut]: (l) => {
231
+ }, a = Lt(window, {
232
+ [n.shortcut]: (l) => {
231
233
  l.preventDefault(), t({ type: "TOGGLE" });
232
234
  },
233
235
  "$mod+Enter": (l) => {
@@ -240,22 +242,22 @@ function Kt() {
240
242
  l.preventDefault(), t({ type: "CLOSE" });
241
243
  }
242
244
  });
243
- return window.addEventListener("keydown", r), window.addEventListener("keyup", a), window.addEventListener("blur", o), () => {
244
- s(), window.removeEventListener("keydown", r), window.removeEventListener("keyup", a), window.removeEventListener("blur", o);
245
+ return window.addEventListener("keydown", r), window.addEventListener("keyup", s), window.addEventListener("blur", i), () => {
246
+ a(), window.removeEventListener("keydown", r), window.removeEventListener("keyup", s), window.removeEventListener("blur", i);
245
247
  };
246
248
  }
247
- ), e = ct(({ sendBack: t, input: i }) => {
248
- const o = new MutationObserver((r) => {
249
- for (const a of r)
250
- for (const s of Array.from(a.removedNodes))
251
- if (s instanceof HTMLElement && (s === i.targetElement || s.contains(i.targetElement))) {
249
+ ), e = rt(({ sendBack: t, input: n }) => {
250
+ const i = new MutationObserver((r) => {
251
+ for (const s of r)
252
+ for (const a of Array.from(s.removedNodes))
253
+ if (a instanceof HTMLElement && (a === n.targetElement || a.contains(n.targetElement))) {
252
254
  t({ type: "TARGET_DISCONNECTED" });
253
255
  return;
254
256
  }
255
257
  });
256
- return o.observe(i.wrapperElement, { childList: !0, subtree: !0 }), () => o.disconnect();
258
+ return i.observe(n.wrapperElement, { childList: !0, subtree: !0 }), () => i.disconnect();
257
259
  });
258
- return Tt({
260
+ return xt({
259
261
  types: {
260
262
  context: {},
261
263
  events: {},
@@ -263,23 +265,23 @@ function Kt() {
263
265
  emitted: {}
264
266
  },
265
267
  actors: {
266
- keyboardActor: n,
268
+ keyboardActor: o,
267
269
  mutationObserverActor: e
268
270
  },
269
271
  guards: {
270
- isCommentingEditing: kt({ commenting: "editing" }),
272
+ isCommentingEditing: yt({ commenting: "editing" }),
271
273
  hasSelectionCommentId: ({ event: t }) => t.type !== "CLICK" ? !1 : !!t.selectionCommentId,
272
274
  hasTargetId: ({ event: t }) => t.type !== "CLICK" ? !1 : !!t.targetId && !t.selectionCommentId,
273
275
  hasNoTarget: ({ event: t }) => t.type !== "CLICK" ? !1 : !t.targetId && !t.selectionCommentId,
274
- isSameComment: ({ context: t, event: i }) => {
275
- if (i.type !== "CLICK") return !1;
276
- if (i.selectionCommentId)
277
- return t.editingCommentId === i.selectionCommentId;
278
- if (i.targetId) {
279
- const o = t.comments.find(
276
+ isSameComment: ({ context: t, event: n }) => {
277
+ if (n.type !== "CLICK") return !1;
278
+ if (n.selectionCommentId)
279
+ return t.editingCommentId === n.selectionCommentId;
280
+ if (n.targetId) {
281
+ const i = t.comments.find(
280
282
  (r) => r.commentId === t.editingCommentId
281
283
  );
282
- return !!o && o.targetId === i.targetId && !o.selection;
284
+ return !!i && i.targetId === n.targetId && !i.selection;
283
285
  }
284
286
  return !1;
285
287
  }
@@ -288,64 +290,64 @@ function Kt() {
288
290
  flashDuration: 500
289
291
  },
290
292
  actions: {
291
- openElementComment: x(({ context: t, event: i }) => {
292
- if (i.type !== "CLICK" || !i.targetId) return {};
293
- const { comment: o, isNew: r } = jt(
293
+ openElementComment: E(({ context: t, event: n }) => {
294
+ if (n.type !== "CLICK" || !n.targetId) return {};
295
+ const { comment: i, isNew: r } = Pt(
294
296
  t.comments,
295
- i.targetId
297
+ n.targetId
296
298
  );
297
299
  return {
298
- comments: r ? [...t.comments, o] : t.comments,
299
- editingCommentId: o.commentId,
300
- targetElement: i.element ?? null,
300
+ comments: r ? [...t.comments, i] : t.comments,
301
+ editingCommentId: i.commentId,
302
+ targetElement: n.element ?? null,
301
303
  selectionRange: null
302
304
  };
303
305
  }),
304
- openSelectionComment: x(({ event: t }) => t.type !== "CLICK" || !t.selectionCommentId ? {} : {
306
+ openSelectionComment: E(({ event: t }) => t.type !== "CLICK" || !t.selectionCommentId ? {} : {
305
307
  editingCommentId: t.selectionCommentId,
306
308
  targetElement: t.element ?? null,
307
309
  selectionRange: null
308
310
  }),
309
- createSelectionComment: x(({ context: t, event: i }) => {
310
- if (i.type !== "SELECT_TEXT") return {};
311
- const o = {
311
+ createSelectionComment: E(({ context: t, event: n }) => {
312
+ if (n.type !== "SELECT_TEXT") return {};
313
+ const i = {
312
314
  commentId: crypto.randomUUID(),
313
- targetId: i.targetId,
315
+ targetId: n.targetId,
314
316
  content: "",
315
317
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
316
- selection: i.selectionRange
318
+ selection: n.selectionRange
317
319
  };
318
320
  return {
319
- comments: [...t.comments, o],
320
- editingCommentId: o.commentId,
321
- targetElement: i.targetElement,
322
- selectionRange: i.selectionRange
321
+ comments: [...t.comments, i],
322
+ editingCommentId: i.commentId,
323
+ targetElement: n.targetElement,
324
+ selectionRange: n.selectionRange
323
325
  };
324
326
  }),
325
- updateContent: x(({ context: t, event: i }) => i.type !== "COMMENT_CHANGE" ? {} : t.editingCommentId === null ? { overallComment: i.content } : {
327
+ updateContent: E(({ context: t, event: n }) => n.type !== "COMMENT_CHANGE" ? {} : t.editingCommentId === null ? { overallComment: n.content } : {
326
328
  comments: t.comments.map(
327
- (o) => o.commentId === t.editingCommentId ? { ...o, content: i.content } : o
329
+ (i) => i.commentId === t.editingCommentId ? { ...i, content: n.content } : i
328
330
  )
329
331
  }),
330
- deleteComment: x(({ context: t }) => ({
332
+ deleteComment: E(({ context: t }) => ({
331
333
  comments: t.comments.filter(
332
- (i) => i.commentId !== t.editingCommentId
334
+ (n) => n.commentId !== t.editingCommentId
333
335
  ),
334
336
  editingCommentId: null,
335
337
  targetElement: null,
336
338
  selectionRange: null
337
339
  })),
338
- cleanup: x(({ context: t }) => Ut(t)),
339
- emitChanged: dt(({ context: t }) => ({
340
+ cleanup: E(({ context: t }) => Rt(t)),
341
+ emitChanged: st(({ context: t }) => ({
340
342
  type: "REVIEW_CHANGED",
341
- result: Y(t)
343
+ result: B(t)
342
344
  })),
343
345
  persistSave: ({ context: t }) => {
344
- t.persistence.save(Y(t));
346
+ t.persistence.save(B(t));
345
347
  },
346
- emitSubmitted: dt(({ context: t }) => ({
348
+ emitSubmitted: st(({ context: t }) => ({
347
349
  type: "REVIEW_SUBMITTED",
348
- result: Y(t)
350
+ result: B(t)
349
351
  })),
350
352
  // Highlight lifecycle actions — call manager methods directly via
351
353
  // callbacks passed through input. The machine owns WHEN highlights
@@ -353,7 +355,7 @@ function Kt() {
353
355
  // Actions run synchronously during transitions — no timing gap.
354
356
  // Never add useEffects that react to derived machine state.
355
357
  highlightsActivate: ({ context: t }) => {
356
- t.highlights.activate(Ft(t));
358
+ t.highlights.activate(_t(t));
357
359
  },
358
360
  highlightsDeactivate: ({ context: t }) => {
359
361
  t.highlights.deactivate();
@@ -368,21 +370,21 @@ function Kt() {
368
370
  t.highlights.unreveal();
369
371
  },
370
372
  editingTargetSet: ({ context: t }) => {
371
- var o;
373
+ var i;
372
374
  if (!t.targetElement) return;
373
- const i = !!((o = t.comments.find(
375
+ const n = !!((i = t.comments.find(
374
376
  (r) => r.commentId === t.editingCommentId
375
- )) != null && o.selection);
376
- t.highlights.setEditing(t.targetElement, i);
377
+ )) != null && i.selection);
378
+ t.highlights.setEditing(t.targetElement, n);
377
379
  },
378
380
  editingTargetCleared: ({ context: t }) => {
379
381
  if (!t.targetElement) return;
380
- const i = t.comments.find(
381
- (o) => o.commentId === t.editingCommentId
382
+ const n = t.comments.find(
383
+ (i) => i.commentId === t.editingCommentId
382
384
  );
383
385
  t.highlights.clearEditing(
384
386
  t.targetElement,
385
- !!(i != null && i.content.trim())
387
+ !!(n != null && n.content.trim())
386
388
  );
387
389
  }
388
390
  }
@@ -390,9 +392,9 @@ function Kt() {
390
392
  id: "review",
391
393
  type: "parallel",
392
394
  context: ({ input: t }) => {
393
- const i = t.persistence.load() ?? t.initialData, o = (i == null ? void 0 : i.status) === "commented" ? i.comments ?? [] : [], r = (i == null ? void 0 : i.status) === "commented" ? i.overallComment ?? "" : "";
395
+ const n = t.persistence.load() ?? t.initialData, i = (n == null ? void 0 : n.status) === "commented" ? n.comments ?? [] : [], r = (n == null ? void 0 : n.status) === "commented" ? n.overallComment ?? "" : "";
394
396
  return {
395
- comments: o,
397
+ comments: i,
396
398
  overallComment: r,
397
399
  editingCommentId: null,
398
400
  targetElement: null,
@@ -439,8 +441,8 @@ function Kt() {
439
441
  on: {
440
442
  TOGGLE: {
441
443
  target: "inactive",
442
- actions: Lt(({ enqueue: t, check: i }) => {
443
- i("isCommentingEditing") && t.raise({ type: "CLOSE" });
444
+ actions: It(({ enqueue: t, check: n }) => {
445
+ n("isCommentingEditing") && t.raise({ type: "CLOSE" });
444
446
  })
445
447
  }
446
448
  },
@@ -517,7 +519,7 @@ function Kt() {
517
519
  },
518
520
  OPEN_OVERALL: {
519
521
  target: "editing.element",
520
- actions: x({
522
+ actions: E({
521
523
  editingCommentId: null,
522
524
  targetElement: null,
523
525
  selectionRange: null
@@ -616,7 +618,7 @@ function Kt() {
616
618
  actions: [
617
619
  "editingTargetCleared",
618
620
  "cleanup",
619
- x({
621
+ E({
620
622
  editingCommentId: null,
621
623
  targetElement: null,
622
624
  selectionRange: null
@@ -634,7 +636,7 @@ function Kt() {
634
636
  }
635
637
  });
636
638
  }
637
- const ut = {
639
+ const ct = {
638
640
  load: () => {
639
641
  },
640
642
  save: () => {
@@ -642,210 +644,180 @@ const ut = {
642
644
  clear: () => {
643
645
  }
644
646
  };
645
- function J() {
647
+ function V() {
646
648
  try {
647
649
  return typeof localStorage > "u" ? void 0 : localStorage;
648
650
  } catch {
649
651
  return;
650
652
  }
651
653
  }
652
- function Xt(n) {
653
- if (typeof n != "object" || n === null) return !1;
654
- const e = n.status;
654
+ function $t(o) {
655
+ if (typeof o != "object" || o === null) return !1;
656
+ const e = o.status;
655
657
  return e === "approved" || e === "commented";
656
658
  }
657
- function qt(n) {
659
+ function Ht(o) {
658
660
  return {
659
661
  load() {
660
- const e = J();
662
+ const e = V();
661
663
  if (e)
662
664
  try {
663
- const t = e.getItem(n);
665
+ const t = e.getItem(o);
664
666
  if (t === null) return;
665
- const i = JSON.parse(t);
666
- return Xt(i) ? i : void 0;
667
+ const n = JSON.parse(t);
668
+ return $t(n) ? n : void 0;
667
669
  } catch {
668
670
  return;
669
671
  }
670
672
  },
671
673
  save(e) {
672
- const t = J();
674
+ const t = V();
673
675
  if (t)
674
676
  try {
675
677
  if (e.status === "approved") {
676
- t.removeItem(n);
678
+ t.removeItem(o);
677
679
  return;
678
680
  }
679
- t.setItem(n, JSON.stringify(e));
681
+ t.setItem(o, JSON.stringify(e));
680
682
  } catch {
681
683
  }
682
684
  },
683
685
  clear() {
684
- const e = J();
686
+ const e = V();
685
687
  if (e)
686
688
  try {
687
- e.removeItem(n);
689
+ e.removeItem(o);
688
690
  } catch {
689
691
  }
690
692
  }
691
693
  };
692
694
  }
693
- const Wt = 3;
694
- function Vt(n) {
695
+ const Gt = 3;
696
+ function zt(o) {
695
697
  const e = window.getSelection();
696
698
  if (!e || e.isCollapsed || e.rangeCount === 0)
697
699
  return null;
698
- const t = e.getRangeAt(0), i = t.toString();
699
- if (i.length < Wt) return null;
700
- const o = Jt(
701
- n,
700
+ const t = e.getRangeAt(0), n = t.toString();
701
+ if (n.length < Gt) return null;
702
+ const i = Kt(
703
+ o,
702
704
  t.startContainer,
703
705
  t.startOffset
704
- ), r = o + i.length;
705
- if (o < 0) return null;
706
- const a = Qt(
707
- n.textContent ?? "",
708
- i,
709
- o
706
+ ), r = i + n.length;
707
+ if (i < 0) return null;
708
+ const s = Wt(
709
+ o.textContent ?? "",
710
+ n,
711
+ i
710
712
  );
711
- return { startOffset: o, endOffset: r, selectedText: i, matchIndex: a };
713
+ return { startOffset: i, endOffset: r, selectedText: n, matchIndex: s };
712
714
  }
713
- function mt(n, e) {
714
- const t = n.textContent ?? "";
715
+ function Q(o, e) {
716
+ const t = o.textContent ?? "";
715
717
  if (t.slice(
716
718
  e.startOffset,
717
719
  e.endOffset
718
720
  ) === e.selectedText)
719
- return pt(
720
- n,
721
+ return dt(
722
+ o,
721
723
  e.startOffset,
722
724
  e.endOffset
723
725
  );
724
- const o = Zt(
726
+ const i = Xt(
725
727
  t,
726
728
  e.selectedText,
727
729
  e.matchIndex
728
730
  );
729
- return o < 0 ? null : pt(
730
- n,
731
+ return i < 0 ? null : dt(
731
732
  o,
732
- o + e.selectedText.length
733
+ i,
734
+ i + e.selectedText.length
733
735
  );
734
736
  }
735
- function Bt(n, e) {
736
- if (n.isCollapsed || n.rangeCount === 0) return !1;
737
- const t = n.getRangeAt(0);
737
+ function Ft(o, e) {
738
+ if (o.isCollapsed || o.rangeCount === 0) return !1;
739
+ const t = o.getRangeAt(0);
738
740
  return e.contains(t.startContainer) && e.contains(t.endContainer);
739
741
  }
740
- function Q(n) {
741
- const e = n instanceof HTMLElement ? n : n.parentElement;
742
+ function Y(o) {
743
+ const e = o instanceof HTMLElement ? o : o.parentElement;
742
744
  return (e == null ? void 0 : e.closest("[data-review-selectable]")) ?? null;
743
745
  }
744
- function Yt(n, e) {
745
- var a;
746
- if (n.isCollapsed || n.rangeCount === 0) return null;
747
- const t = n.getRangeAt(0), i = t.cloneRange(), o = e.contains(t.startContainer), r = e.contains(t.endContainer);
748
- if (o && r) return i;
749
- if (o && !r) {
750
- const s = te(e);
751
- return s && i.setEnd(s, ((a = s.textContent) == null ? void 0 : a.length) ?? 0), i;
746
+ function Ut(o, e) {
747
+ var s;
748
+ if (o.isCollapsed || o.rangeCount === 0) return null;
749
+ const t = o.getRangeAt(0), n = t.cloneRange(), i = e.contains(t.startContainer), r = e.contains(t.endContainer);
750
+ if (i && r) return n;
751
+ if (i && !r) {
752
+ const a = jt(e);
753
+ return a && n.setEnd(a, ((s = a.textContent) == null ? void 0 : s.length) ?? 0), n;
752
754
  }
753
755
  return null;
754
756
  }
755
- function Jt(n, e, t) {
757
+ function Kt(o, e, t) {
756
758
  var r;
757
- const i = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
758
- let o = 0;
759
- for (; i.nextNode(); ) {
760
- if (i.currentNode === e) return o + t;
761
- o += ((r = i.currentNode.textContent) == null ? void 0 : r.length) ?? 0;
759
+ const n = document.createTreeWalker(o, NodeFilter.SHOW_TEXT);
760
+ let i = 0;
761
+ for (; n.nextNode(); ) {
762
+ if (n.currentNode === e) return i + t;
763
+ i += ((r = n.currentNode.textContent) == null ? void 0 : r.length) ?? 0;
762
764
  }
763
765
  return -1;
764
766
  }
765
- function pt(n, e, t) {
766
- var s;
767
- const i = document.createTreeWalker(n, NodeFilter.SHOW_TEXT), o = document.createRange();
768
- let r = 0, a = !1;
769
- for (; i.nextNode(); ) {
770
- const l = ((s = i.currentNode.textContent) == null ? void 0 : s.length) ?? 0;
771
- if (!a && r + l > e && (o.setStart(i.currentNode, e - r), a = !0), a && r + l >= t)
772
- return o.setEnd(i.currentNode, t - r), o;
767
+ function dt(o, e, t) {
768
+ var a;
769
+ const n = document.createTreeWalker(o, NodeFilter.SHOW_TEXT), i = document.createRange();
770
+ let r = 0, s = !1;
771
+ for (; n.nextNode(); ) {
772
+ const l = ((a = n.currentNode.textContent) == null ? void 0 : a.length) ?? 0;
773
+ if (!s && r + l > e && (i.setStart(n.currentNode, e - r), s = !0), s && r + l >= t)
774
+ return i.setEnd(n.currentNode, t - r), i;
773
775
  r += l;
774
776
  }
775
777
  return null;
776
778
  }
777
- function Qt(n, e, t) {
778
- let i = 0, o = 0;
779
+ function Wt(o, e, t) {
780
+ let n = 0, i = 0;
779
781
  for (; ; ) {
780
- const r = n.indexOf(e, o);
781
- if (r < 0 || r === t) return i;
782
- o = r + 1, i++;
782
+ const r = o.indexOf(e, i);
783
+ if (r < 0 || r === t) return n;
784
+ i = r + 1, n++;
783
785
  }
784
786
  }
785
- function Zt(n, e, t) {
786
- let i = 0, o = 0;
787
+ function Xt(o, e, t) {
788
+ let n = 0, i = 0;
787
789
  for (; ; ) {
788
- const r = n.indexOf(e, o);
790
+ const r = o.indexOf(e, i);
789
791
  if (r < 0) return -1;
790
- if (i === t) return r;
791
- o = r + 1, i++;
792
+ if (n === t) return r;
793
+ i = r + 1, n++;
792
794
  }
793
795
  }
794
- function te(n) {
795
- const e = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
796
+ function jt(o) {
797
+ const e = document.createTreeWalker(o, NodeFilter.SHOW_TEXT);
796
798
  let t = null;
797
799
  for (; e.nextNode(); )
798
800
  t = e.currentNode;
799
801
  return t;
800
802
  }
801
- function ee(n, e) {
802
- const t = /* @__PURE__ */ new Map();
803
- return e.querySelectorAll("[data-review-id]").forEach((o, r) => {
804
- const a = o.getAttribute("data-review-id");
805
- a && t.set(a, r);
806
- }), [...n].sort((o, r) => {
807
- const a = t.get(o.targetId) ?? Number.MAX_SAFE_INTEGER, s = t.get(r.targetId) ?? Number.MAX_SAFE_INTEGER;
808
- return a - s;
803
+ function qt(o, e, t) {
804
+ const n = /* @__PURE__ */ new Map(), i = D(e, t).sort((r, s) => {
805
+ const a = r.element.compareDocumentPosition(s.element);
806
+ return a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 0;
807
+ });
808
+ for (const [r, s] of i.entries())
809
+ n.set(s.targetId, r);
810
+ return [...o].sort((r, s) => {
811
+ const a = n.get(r.targetId) ?? Number.MAX_SAFE_INTEGER, l = n.get(s.targetId) ?? Number.MAX_SAFE_INTEGER;
812
+ return a - l;
809
813
  });
810
814
  }
811
- function k(...n) {
812
- return Nt(_t(n));
813
- }
814
- function $(n) {
815
- return v`<svg
816
- xmlns="http://www.w3.org/2000/svg"
817
- viewBox="0 0 24 24"
818
- fill="none"
819
- stroke="currentColor"
820
- stroke-width="2"
821
- stroke-linecap="round"
822
- stroke-linejoin="round"
823
- aria-hidden="true"
824
- >
825
- ${n}
826
- </svg>`;
827
- }
828
- const U = {
829
- check: $(_`<path d="M20 6 9 17l-5-5" />`),
830
- gripVertical: $(
831
- _`<circle cx="9" cy="12" r="1" /><circle cx="9" cy="5" r="1" /><circle cx="9" cy="19" r="1" /><circle cx="15" cy="12" r="1" /><circle cx="15" cy="5" r="1" /><circle cx="15" cy="19" r="1" />`
832
- ),
833
- messageSquare: $(
834
- _`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />`
835
- ),
836
- trash: $(
837
- _`<path d="M3 6h18" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`
838
- )
839
- }, ie = '/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-zinc-50:oklch(98.5% 0 0);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-\\[calc\\(var\\(--review-z-index\\,9998\\)\\+1\\)\\]{z-index:calc(var(--review-z-index,9998) + 1)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-7{height:calc(var(--spacing) * 7)}.h-\\[18px\\]{height:18px}.max-h-\\[200px\\]{max-height:200px}.w-7{width:calc(var(--spacing) * 7)}.w-\\[400px\\]{width:400px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.min-w-\\[18px\\]{min-width:18px}.flex-1{flex:1}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-3\\.5{--tw-translate-x:calc(var(--spacing) * 3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[llumi-fade-in_0\\.15s_ease-out\\]{animation:.15s ease-out llumi-fade-in}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-zinc-200{border-color:var(--color-zinc-200)}.border-zinc-300{border-color:var(--color-zinc-300)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.bg-zinc-200{background-color:var(--color-zinc-200)}.bg-zinc-300{background-color:var(--color-zinc-300)}.bg-zinc-900{background-color:var(--color-zinc-900)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-white{color:var(--color-white)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-700{color:var(--color-zinc-700)}.text-zinc-900{color:var(--color-zinc-900)}.italic{font-style:italic}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-zinc-400\\/20{--tw-ring-color:#9f9fa933}@supports (color:color-mix(in lab,red,red)){.ring-zinc-400\\/20{--tw-ring-color:color-mix(in oklab, var(--color-zinc-400) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:max-w-\\[60px\\]:is(:where(.group):hover *){max-width:60px}}.placeholder\\:text-zinc-400::placeholder{color:var(--color-zinc-400)}@media(hover:hover){.hover\\:bg-zinc-50:hover{background-color:var(--color-zinc-50)}.hover\\:bg-zinc-200:hover{background-color:var(--color-zinc-200)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-white:hover{color:var(--color-white)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-zinc-950:active{background-color:var(--color-zinc-950)}}@keyframes llumi-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}', ne = Dt(ie), at = class at extends At {
815
+ var Bt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, x = (o, e, t, n) => {
816
+ for (var i = n > 1 ? void 0 : n ? Vt(e, t) : e, r = o.length - 1, s; r >= 0; r--)
817
+ (s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
818
+ return n && i && Bt(e, t, i), i;
840
819
  };
841
- at.styles = ne;
842
- let E = at;
843
- var oe = Object.defineProperty, re = Object.getOwnPropertyDescriptor, y = (n, e, t, i) => {
844
- for (var o = i > 1 ? void 0 : i ? re(e, t) : e, r = n.length - 1, a; r >= 0; r--)
845
- (a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
846
- return i && o && oe(e, t, o), o;
847
- };
848
- const ae = {
820
+ const Yt = {
849
821
  "top-left": { top: "16px", left: "16px" },
850
822
  "top-center": { top: "16px", left: "50%", translateX: "-50%" },
851
823
  "top-right": { top: "16px", right: "16px" },
@@ -853,22 +825,22 @@ const ae = {
853
825
  "bottom-center": { bottom: "16px", left: "50%", translateX: "-50%" },
854
826
  "bottom-right": { bottom: "16px", right: "16px" }
855
827
  };
856
- let w = class extends E {
828
+ let b = class extends C {
857
829
  constructor() {
858
- super(...arguments), this.mode = "idle", this.commentCount = 0, this.hasOverallComment = !1, this.overallCommentOpen = !1, this.barPosition = "bottom-center", this.dragOffset = null, this.dragStart = null, this.onDragStart = (n) => {
830
+ super(...arguments), this.mode = "idle", this.commentCount = 0, this.hasOverallComment = !1, this.overallCommentOpen = !1, this.barPosition = "bottom-center", this.dragOffset = null, this.dragStart = null, this.onDragStart = (o) => {
859
831
  const e = this.bar.getBoundingClientRect();
860
832
  this.dragStart = {
861
- px: n.clientX,
862
- py: n.clientY,
833
+ px: o.clientX,
834
+ py: o.clientY,
863
835
  ox: e.left,
864
836
  oy: e.top
865
837
  }, window.addEventListener("pointermove", this.onDragMove), window.addEventListener("pointerup", this.onDragEnd);
866
- }, this.onDragMove = (n) => {
838
+ }, this.onDragMove = (o) => {
867
839
  if (!this.dragStart) return;
868
- const e = this.dragStart.ox + (n.clientX - this.dragStart.px), t = this.dragStart.oy + (n.clientY - this.dragStart.py), i = 16, o = window.innerWidth - this.bar.offsetWidth - i, r = window.innerHeight - this.bar.offsetHeight - i;
840
+ const e = this.dragStart.ox + (o.clientX - this.dragStart.px), t = this.dragStart.oy + (o.clientY - this.dragStart.py), n = 16, i = window.innerWidth - this.bar.offsetWidth - n, r = window.innerHeight - this.bar.offsetHeight - n;
869
841
  this.dragOffset = {
870
- x: Math.max(i, Math.min(e, o)),
871
- y: Math.max(i, Math.min(t, r))
842
+ x: Math.max(n, Math.min(e, i)),
843
+ y: Math.max(n, Math.min(t, r))
872
844
  };
873
845
  }, this.onDragEnd = () => {
874
846
  this.dragStart = null, window.removeEventListener("pointermove", this.onDragMove), window.removeEventListener("pointerup", this.onDragEnd);
@@ -878,65 +850,73 @@ let w = class extends E {
878
850
  return this.bar ?? null;
879
851
  }
880
852
  render() {
881
- const n = this.mode !== "idle", e = this.commentCount + (this.hasOverallComment ? 1 : 0), t = e > 0, i = ae[this.barPosition], o = this.dragOffset ? `position:fixed;left:${this.dragOffset.x}px;top:${this.dragOffset.y}px;z-index:var(--review-z-index,9998);` : `position:fixed;${i.top ? `top:${i.top};` : ""}${i.bottom ? `bottom:${i.bottom};` : ""}${i.left ? `left:${i.left};` : ""}${i.right ? `right:${i.right};` : ""}${i.translateX ? `transform:translateX(${i.translateX});` : ""}z-index:var(--review-z-index,9998);`;
882
- return v`<div
853
+ const o = this.mode !== "idle", e = this.commentCount + (this.hasOverallComment ? 1 : 0), t = e > 0, n = Yt[this.barPosition], i = this.dragOffset ? `position:fixed;left:${this.dragOffset.x}px;top:${this.dragOffset.y}px;z-index:var(--review-z-index,9998);` : `position:fixed;${n.top ? `top:${n.top};` : ""}${n.bottom ? `bottom:${n.bottom};` : ""}${n.left ? `left:${n.left};` : ""}${n.right ? `right:${n.right};` : ""}${n.translateX ? `transform:translateX(${n.translateX});` : ""}z-index:var(--review-z-index,9998);`;
854
+ return w`<div
883
855
  data-bar
884
- class=${k(
885
- "flex items-center gap-2 rounded-full border border-zinc-200 bg-white p-1 shadow-lg",
886
- n && "ring-1 ring-zinc-400/20"
887
- )}
888
- style=${o}
856
+ class=${A({ bar: !0, "bar--active": o })}
857
+ style=${i}
889
858
  >
890
859
  <div
891
- class="flex h-7 w-7 cursor-grab items-center justify-center text-zinc-400 active:cursor-grabbing"
860
+ class="grip"
892
861
  @pointerdown=${this.onDragStart}
893
862
  >
894
- <span class="size-3">${U.gripVertical}</span>
863
+ <span class="icon icon-12">${M.gripVertical}</span>
895
864
  </div>
896
865
 
897
- <label class="flex cursor-pointer items-center gap-2 px-1">
898
- <span class=${k("select-none text-xs font-medium transition-colors duration-150", n ? "text-zinc-900" : "text-zinc-500")}>Annotate</span>
866
+ <label class="label">
867
+ <span class=${A({
868
+ "label-text": !0,
869
+ "label-text--active": o,
870
+ "label-text--idle": !o
871
+ })}>Annotate</span>
899
872
  <button
900
873
  type="button"
901
874
  role="switch"
902
- aria-checked=${n ? "true" : "false"}
875
+ aria-checked=${o ? "true" : "false"}
903
876
  data-toggle
904
877
  @click=${this.onToggle}
905
- class=${k(
906
- "relative inline-flex h-4 w-7 items-center rounded-full transition-colors",
907
- n ? "bg-zinc-900" : "bg-zinc-300"
908
- )}
878
+ class=${A({
879
+ toggle: !0,
880
+ "toggle--active": o,
881
+ "toggle--idle": !o
882
+ })}
909
883
  >
910
- <span class=${k("inline-block size-3 transform rounded-full bg-white transition-transform", n ? "translate-x-3.5" : "translate-x-0.5")}></span>
884
+ <span class=${A({
885
+ knob: !0,
886
+ "knob--active": o,
887
+ "knob--idle": !o
888
+ })}></span>
911
889
  </button>
912
890
  </label>
913
891
 
914
- <div class="h-4 w-px bg-zinc-200"></div>
892
+ <div class="divider"></div>
915
893
 
916
894
  <button
917
895
  type="button"
918
896
  data-overall
919
897
  @click=${this.onOverallToggle}
920
- class=${k(
921
- "relative flex h-7 items-center gap-1.5 rounded-full px-3 text-xs font-medium",
922
- this.hasOverallComment ? "bg-zinc-900 text-white hover:bg-zinc-800 active:bg-zinc-950" : this.overallCommentOpen ? "bg-zinc-100 hover:bg-zinc-200" : "border border-zinc-200 hover:bg-zinc-50"
923
- )}
898
+ class=${A({
899
+ overall: !0,
900
+ "overall--has": this.hasOverallComment,
901
+ "overall--open": !this.hasOverallComment && this.overallCommentOpen,
902
+ "overall--idle": !this.hasOverallComment && !this.overallCommentOpen
903
+ })}
924
904
  >
925
905
  Comment
926
- <span class="size-3.5">${U.messageSquare}</span>
906
+ <span class="icon icon-14">${M.messageSquare}</span>
927
907
  </button>
928
908
 
929
- <div class="h-4 w-px bg-zinc-200"></div>
909
+ <div class="divider"></div>
930
910
 
931
911
  <button
932
912
  type="button"
933
913
  data-submit
934
914
  @click=${this.onSubmit}
935
- class="flex h-7 items-center gap-1.5 rounded-full bg-zinc-900 pl-3 pr-2 text-xs font-medium text-white hover:bg-zinc-800 active:bg-zinc-950"
915
+ class="submit"
936
916
  >
937
917
  ${t ? "Submit" : "Approve"}
938
- <span class="flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-white/25 px-1 text-[11px] font-semibold">
939
- ${t ? e : v`<span class="size-3">${U.check}</span>`}
918
+ <span class="badge">
919
+ ${t ? e : w`<span class="icon icon-12">${M.check}</span>`}
940
920
  </span>
941
921
  </button>
942
922
  </div>`;
@@ -960,55 +940,245 @@ let w = class extends E {
960
940
  super.disconnectedCallback(), window.removeEventListener("pointermove", this.onDragMove), window.removeEventListener("pointerup", this.onDragEnd);
961
941
  }
962
942
  };
963
- y([
964
- f()
965
- ], w.prototype, "mode", 2);
966
- y([
967
- f({ type: Number })
968
- ], w.prototype, "commentCount", 2);
969
- y([
970
- f({ type: Boolean })
971
- ], w.prototype, "hasOverallComment", 2);
972
- y([
973
- f({ type: Boolean })
974
- ], w.prototype, "overallCommentOpen", 2);
975
- y([
976
- f()
977
- ], w.prototype, "barPosition", 2);
978
- y([
979
- F("[data-bar]")
980
- ], w.prototype, "bar", 2);
981
- y([
982
- Mt()
983
- ], w.prototype, "dragOffset", 2);
984
- w = y([
985
- A("llumi-review-bar")
986
- ], w);
987
- var se = Object.defineProperty, le = Object.getOwnPropertyDescriptor, D = (n, e, t, i) => {
988
- for (var o = i > 1 ? void 0 : i ? le(e, t) : e, r = n.length - 1, a; r >= 0; r--)
989
- (a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
990
- return i && o && se(e, t, o), o;
943
+ b.styles = [
944
+ C.styles,
945
+ F`
946
+ :host {
947
+ color-scheme: light;
948
+ color: #18181b;
949
+ }
950
+ .bar {
951
+ display: flex;
952
+ align-items: center;
953
+ gap: 8px;
954
+ border-radius: 9999px;
955
+ border: 1px solid #e4e4e7;
956
+ background-color: #fff;
957
+ padding: 4px;
958
+ box-shadow:
959
+ 0 10px 15px -3px rgb(0 0 0 / 0.1),
960
+ 0 4px 6px -4px rgb(0 0 0 / 0.1);
961
+ }
962
+ .bar--active {
963
+ box-shadow:
964
+ 0 0 0 1px rgb(161 161 170 / 0.2),
965
+ 0 10px 15px -3px rgb(0 0 0 / 0.1),
966
+ 0 4px 6px -4px rgb(0 0 0 / 0.1);
967
+ }
968
+ .grip {
969
+ display: flex;
970
+ height: 28px;
971
+ width: 28px;
972
+ align-items: center;
973
+ justify-content: center;
974
+ color: #a1a1aa;
975
+ cursor: grab;
976
+ }
977
+ .grip:active {
978
+ cursor: grabbing;
979
+ }
980
+ .icon {
981
+ display: block;
982
+ }
983
+ .icon svg {
984
+ display: block;
985
+ width: 100%;
986
+ height: 100%;
987
+ }
988
+ .icon-12 {
989
+ width: 12px;
990
+ height: 12px;
991
+ }
992
+ .icon-14 {
993
+ width: 14px;
994
+ height: 14px;
995
+ }
996
+ .label {
997
+ display: flex;
998
+ cursor: pointer;
999
+ align-items: center;
1000
+ gap: 8px;
1001
+ padding: 0 4px;
1002
+ }
1003
+ .label-text {
1004
+ user-select: none;
1005
+ font-size: 12px;
1006
+ line-height: 16px;
1007
+ font-weight: 500;
1008
+ transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
1009
+ }
1010
+ .label-text--active {
1011
+ color: #18181b;
1012
+ }
1013
+ .label-text--idle {
1014
+ color: #71717a;
1015
+ }
1016
+ .toggle {
1017
+ position: relative;
1018
+ display: inline-flex;
1019
+ height: 16px;
1020
+ width: 28px;
1021
+ align-items: center;
1022
+ border-radius: 9999px;
1023
+ border: 0;
1024
+ margin: 0;
1025
+ padding: 0;
1026
+ font-family: inherit;
1027
+ color: inherit;
1028
+ cursor: pointer;
1029
+ transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
1030
+ }
1031
+ .toggle--active {
1032
+ background-color: #18181b;
1033
+ }
1034
+ .toggle--idle {
1035
+ background-color: #d4d4d8;
1036
+ }
1037
+ .knob {
1038
+ display: inline-block;
1039
+ width: 12px;
1040
+ height: 12px;
1041
+ border-radius: 9999px;
1042
+ background-color: #fff;
1043
+ transition: translate 150ms cubic-bezier(0.4, 0, 0.2, 1);
1044
+ }
1045
+ .knob--active {
1046
+ translate: 14px 0;
1047
+ }
1048
+ .knob--idle {
1049
+ translate: 2px 0;
1050
+ }
1051
+ .divider {
1052
+ height: 16px;
1053
+ width: 1px;
1054
+ background-color: #e4e4e7;
1055
+ }
1056
+ .overall {
1057
+ position: relative;
1058
+ display: flex;
1059
+ height: 28px;
1060
+ align-items: center;
1061
+ gap: 6px;
1062
+ border-radius: 9999px;
1063
+ padding: 0 12px;
1064
+ font-family: inherit;
1065
+ font-size: 12px;
1066
+ line-height: 16px;
1067
+ font-weight: 500;
1068
+ color: inherit;
1069
+ background-color: transparent;
1070
+ border: 0;
1071
+ margin: 0;
1072
+ cursor: pointer;
1073
+ }
1074
+ .overall--has {
1075
+ background-color: #18181b;
1076
+ color: #fff;
1077
+ }
1078
+ .overall--has:hover {
1079
+ background-color: #27272a;
1080
+ }
1081
+ .overall--has:active {
1082
+ background-color: #09090b;
1083
+ }
1084
+ .overall--open {
1085
+ background-color: #f4f4f5;
1086
+ }
1087
+ .overall--open:hover {
1088
+ background-color: #e4e4e7;
1089
+ }
1090
+ .overall--idle {
1091
+ border: 1px solid #e4e4e7;
1092
+ }
1093
+ .overall--idle:hover {
1094
+ background-color: #fafafa;
1095
+ }
1096
+ .submit {
1097
+ display: flex;
1098
+ height: 28px;
1099
+ align-items: center;
1100
+ gap: 6px;
1101
+ border-radius: 9999px;
1102
+ padding: 0 8px 0 12px;
1103
+ background-color: #18181b;
1104
+ color: #fff;
1105
+ font-family: inherit;
1106
+ font-size: 12px;
1107
+ line-height: 16px;
1108
+ font-weight: 500;
1109
+ border: 0;
1110
+ margin: 0;
1111
+ cursor: pointer;
1112
+ }
1113
+ .submit:hover {
1114
+ background-color: #27272a;
1115
+ }
1116
+ .submit:active {
1117
+ background-color: #09090b;
1118
+ }
1119
+ .badge {
1120
+ display: flex;
1121
+ height: 18px;
1122
+ min-width: 18px;
1123
+ align-items: center;
1124
+ justify-content: center;
1125
+ border-radius: 9999px;
1126
+ background-color: rgb(255 255 255 / 0.25);
1127
+ padding: 0 4px;
1128
+ font-size: 11px;
1129
+ line-height: 16px;
1130
+ font-weight: 600;
1131
+ }
1132
+ `
1133
+ ];
1134
+ x([
1135
+ v()
1136
+ ], b.prototype, "mode", 2);
1137
+ x([
1138
+ v({ type: Number })
1139
+ ], b.prototype, "commentCount", 2);
1140
+ x([
1141
+ v({ type: Boolean })
1142
+ ], b.prototype, "hasOverallComment", 2);
1143
+ x([
1144
+ v({ type: Boolean })
1145
+ ], b.prototype, "overallCommentOpen", 2);
1146
+ x([
1147
+ v()
1148
+ ], b.prototype, "barPosition", 2);
1149
+ x([
1150
+ U("[data-bar]")
1151
+ ], b.prototype, "bar", 2);
1152
+ x([
1153
+ Ot()
1154
+ ], b.prototype, "dragOffset", 2);
1155
+ b = x([
1156
+ k("llumi-review-bar")
1157
+ ], b);
1158
+ var Jt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, N = (o, e, t, n) => {
1159
+ for (var i = n > 1 ? void 0 : n ? Qt(e, t) : e, r = o.length - 1, s; r >= 0; r--)
1160
+ (s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
1161
+ return n && i && Jt(e, t, i), i;
991
1162
  };
992
- let S = class extends E {
1163
+ let I = class extends C {
993
1164
  constructor() {
994
1165
  super(...arguments), this.value = "", this.autoFocus = !1, this.placeholder = "Write a comment...";
995
1166
  }
996
1167
  /** Focus the inner textarea (the element itself isn't focusable). */
997
1168
  focus() {
998
- var n;
999
- (n = this.textarea) == null || n.focus();
1169
+ var o;
1170
+ (o = this.textarea) == null || o.focus();
1000
1171
  }
1001
1172
  render() {
1002
- return v`<textarea
1173
+ return w`<textarea
1003
1174
  rows="1"
1004
1175
  placeholder=${this.placeholder}
1005
1176
  .value=${this.value}
1006
- class="w-full resize-none bg-transparent text-sm text-zinc-900 placeholder:text-zinc-400 focus:outline-none max-h-[200px] overflow-y-auto"
1007
1177
  @input=${this.onInput}
1008
1178
  ></textarea>`;
1009
1179
  }
1010
- onInput(n) {
1011
- const e = n.target.value;
1180
+ onInput(o) {
1181
+ const e = o.target.value;
1012
1182
  this.autoGrow(), this.dispatchEvent(
1013
1183
  new CustomEvent("change", {
1014
1184
  detail: e,
@@ -1018,8 +1188,8 @@ let S = class extends E {
1018
1188
  );
1019
1189
  }
1020
1190
  autoGrow() {
1021
- const n = this.textarea;
1022
- n && (n.style.height = "auto", n.style.height = `${n.scrollHeight}px`);
1191
+ const o = this.textarea;
1192
+ o && (o.style.height = "auto", o.style.height = `${o.scrollHeight}px`);
1023
1193
  }
1024
1194
  firstUpdated() {
1025
1195
  this.autoFocus && this.textarea.focus(), this.autoGrow();
@@ -1028,53 +1198,73 @@ let S = class extends E {
1028
1198
  this.autoGrow();
1029
1199
  }
1030
1200
  };
1031
- D([
1032
- f()
1033
- ], S.prototype, "value", 2);
1034
- D([
1035
- f({ type: Boolean })
1036
- ], S.prototype, "autoFocus", 2);
1037
- D([
1038
- f()
1039
- ], S.prototype, "placeholder", 2);
1040
- D([
1041
- F("textarea")
1042
- ], S.prototype, "textarea", 2);
1043
- S = D([
1044
- A("llumi-default-editor")
1045
- ], S);
1046
- var ce = Object.defineProperty, de = Object.getOwnPropertyDescriptor, K = (n, e, t, i) => {
1047
- for (var o = i > 1 ? void 0 : i ? de(e, t) : e, r = n.length - 1, a; r >= 0; r--)
1048
- (a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
1049
- return i && o && ce(e, t, o), o;
1201
+ I.styles = [
1202
+ C.styles,
1203
+ F`
1204
+ textarea {
1205
+ width: 100%;
1206
+ resize: none;
1207
+ background-color: transparent;
1208
+ color: #18181b;
1209
+ font-family: inherit;
1210
+ font-size: 0.875rem;
1211
+ line-height: 1.25rem;
1212
+ max-height: 200px;
1213
+ overflow-y: auto;
1214
+ margin: 0;
1215
+ padding: 0;
1216
+ border: 0;
1217
+ }
1218
+ textarea::placeholder {
1219
+ color: #a1a1aa;
1220
+ }
1221
+ textarea:focus {
1222
+ outline: none;
1223
+ }
1224
+ `
1225
+ ];
1226
+ N([
1227
+ v()
1228
+ ], I.prototype, "value", 2);
1229
+ N([
1230
+ v({ type: Boolean })
1231
+ ], I.prototype, "autoFocus", 2);
1232
+ N([
1233
+ v()
1234
+ ], I.prototype, "placeholder", 2);
1235
+ N([
1236
+ U("textarea")
1237
+ ], I.prototype, "textarea", 2);
1238
+ I = N([
1239
+ k("llumi-default-editor")
1240
+ ], I);
1241
+ var Zt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, P = (o, e, t, n) => {
1242
+ for (var i = n > 1 ? void 0 : n ? te(e, t) : e, r = o.length - 1, s; r >= 0; r--)
1243
+ (s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
1244
+ return n && i && Zt(e, t, i), i;
1050
1245
  };
1051
- let z = class extends E {
1246
+ let S = class extends C {
1052
1247
  constructor() {
1053
- super(...arguments), this.targetElement = null, this.value = "";
1248
+ super(...arguments), this.targetElement = null, this.anchor = null, this.value = "";
1054
1249
  }
1055
1250
  render() {
1056
- const n = this.value.trim().length > 0;
1057
- return v`<div
1251
+ const o = this.value.trim().length > 0;
1252
+ return w`<div
1058
1253
  data-floating
1059
- class="z-[calc(var(--review-z-index,9998)+1)]"
1254
+ class="floating"
1060
1255
  style="position:absolute;top:0;left:0;"
1061
1256
  >
1062
- <div
1063
- class=${Pt({
1064
- "relative w-[400px] rounded-lg border border-zinc-200 bg-white shadow-xl": !0,
1065
- "animate-[llumi-fade-in_0.15s_ease-out]": !0
1066
- })}
1067
- >
1068
- ${n ? v`<button
1257
+ <div class="panel">
1258
+ ${o ? w`<button
1069
1259
  type="button"
1070
1260
  data-delete
1261
+ class="delete-btn"
1071
1262
  @click=${this.onDelete}
1072
- class="group absolute top-2 right-2 z-10 flex items-center gap-1 rounded-md px-1.5 py-1 text-zinc-400 transition-all duration-150 hover:bg-zinc-900 hover:text-white"
1073
1263
  >
1074
- <span class="size-3.5">${U.trash}</span>
1075
- <span class="max-w-0 overflow-hidden text-xs transition-all duration-150 group-hover:max-w-[60px]">Delete</span>
1264
+ <span class="icon icon-14">${M.trash}</span>
1265
+ <span class="delete-label">Delete</span>
1076
1266
  </button>` : null}
1077
- <div class="p-3" @change=${this.onEditorChange} @cancel=${this.onCancel} @delete=${this.onDelete}>
1267
+ <div class="editor-wrap" @change=${this.onEditorChange} @cancel=${this.onCancel} @delete=${this.onDelete}>
1078
1268
  <slot name="editor">
1079
1269
  <llumi-default-editor .value=${this.value} autoFocus></llumi-default-editor>
1080
1270
  </slot>
@@ -1082,95 +1272,174 @@ let z = class extends E {
1082
1272
  </div>
1083
1273
  </div>`;
1084
1274
  }
1085
- onEditorChange(n) {
1086
- if (typeof n.detail != "string") return;
1087
- const e = n.detail;
1088
- n.stopPropagation(), this.dispatchEvent(
1275
+ onEditorChange(o) {
1276
+ if (typeof o.detail != "string") return;
1277
+ const e = o.detail;
1278
+ o.stopPropagation(), this.dispatchEvent(
1089
1279
  new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
1090
1280
  );
1091
1281
  }
1092
- onCancel(n) {
1093
- n.stopPropagation(), this.dispatchEvent(
1282
+ onCancel(o) {
1283
+ o.stopPropagation(), this.dispatchEvent(
1094
1284
  new CustomEvent("close", { bubbles: !0, composed: !0 })
1095
1285
  );
1096
1286
  }
1097
- onDelete(n) {
1098
- n.stopPropagation(), this.dispatchEvent(
1287
+ onDelete(o) {
1288
+ o.stopPropagation(), this.dispatchEvent(
1099
1289
  new CustomEvent("delete", { bubbles: !0, composed: !0 })
1100
1290
  );
1101
1291
  }
1102
1292
  startPositioning() {
1103
1293
  var t;
1104
- const n = this.targetElement, e = this.floating;
1105
- !n || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = vt(n, e, () => {
1106
- wt(n, e, {
1294
+ const o = this.anchor ?? this.targetElement, e = this.floating;
1295
+ !o || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = gt(o, e, () => {
1296
+ ut(o, e, {
1107
1297
  placement: "right",
1108
1298
  middleware: [
1109
- bt(12),
1110
- xt({ padding: 16 }),
1111
- yt({ padding: 16, crossAxis: !0 }),
1112
- Ct({
1299
+ pt(12),
1300
+ ft({ padding: 16 }),
1301
+ vt({ padding: 16, crossAxis: !0 }),
1302
+ bt({
1113
1303
  padding: 16,
1114
- apply({ availableWidth: i, elements: o }) {
1115
- Object.assign(o.floating.style, {
1116
- maxWidth: `${Math.min(400, i)}px`
1304
+ apply({ availableWidth: n, elements: i }) {
1305
+ Object.assign(i.floating.style, {
1306
+ maxWidth: `${Math.min(400, n)}px`
1117
1307
  });
1118
1308
  }
1119
1309
  })
1120
1310
  ]
1121
- }).then(({ x: i, y: o }) => {
1122
- Object.assign(e.style, { left: `${i}px`, top: `${o}px` });
1311
+ }).then(({ x: n, y: i }) => {
1312
+ Object.assign(e.style, { left: `${n}px`, top: `${i}px` });
1123
1313
  });
1124
1314
  }));
1125
1315
  }
1126
- updated(n) {
1127
- n.has("targetElement") && (this.startPositioning(), this.focusEditor());
1316
+ updated(o) {
1317
+ (o.has("targetElement") || o.has("anchor")) && (this.startPositioning(), this.focusEditor());
1128
1318
  }
1129
1319
  focusEditor() {
1130
- const n = this.renderRoot.querySelector(
1320
+ const o = this.renderRoot.querySelector(
1131
1321
  'slot[name="editor"]'
1132
- ), t = ((n == null ? void 0 : n.assignedElements()) ?? [])[0] ?? this.renderRoot.querySelector("llumi-default-editor");
1322
+ ), t = ((o == null ? void 0 : o.assignedElements()) ?? [])[0] ?? this.renderRoot.querySelector("llumi-default-editor");
1133
1323
  t == null || t.focus();
1134
1324
  }
1135
1325
  disconnectedCallback() {
1136
- var n;
1137
- super.disconnectedCallback(), (n = this.cleanup) == null || n.call(this), this.cleanup = void 0;
1326
+ var o;
1327
+ super.disconnectedCallback(), (o = this.cleanup) == null || o.call(this), this.cleanup = void 0;
1138
1328
  }
1139
1329
  };
1140
- K([
1141
- f({ attribute: !1 })
1142
- ], z.prototype, "targetElement", 2);
1143
- K([
1144
- f()
1145
- ], z.prototype, "value", 2);
1146
- K([
1147
- F("[data-floating]")
1148
- ], z.prototype, "floating", 2);
1149
- z = K([
1150
- A("llumi-comment-dialog")
1151
- ], z);
1152
- var he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, X = (n, e, t, i) => {
1153
- for (var o = i > 1 ? void 0 : i ? ge(e, t) : e, r = n.length - 1, a; r >= 0; r--)
1154
- (a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
1155
- return i && o && he(e, t, o), o;
1330
+ S.styles = [
1331
+ C.styles,
1332
+ F`
1333
+ .floating {
1334
+ z-index: calc(var(--review-z-index, 9998) + 1);
1335
+ }
1336
+ .panel {
1337
+ position: relative;
1338
+ width: 400px;
1339
+ border-radius: 8px;
1340
+ border: 1px solid #e4e4e7;
1341
+ background-color: #fff;
1342
+ box-shadow:
1343
+ 0 20px 25px -5px rgb(0 0 0 / 0.1),
1344
+ 0 8px 10px -6px rgb(0 0 0 / 0.1);
1345
+ animation: llumi-fade-in 0.15s ease-out;
1346
+ }
1347
+ .delete-btn {
1348
+ position: absolute;
1349
+ top: 8px;
1350
+ right: 8px;
1351
+ z-index: 10;
1352
+ display: flex;
1353
+ align-items: center;
1354
+ gap: 4px;
1355
+ border-radius: 6px;
1356
+ padding: 4px 6px;
1357
+ color: #a1a1aa;
1358
+ background-color: transparent;
1359
+ border: 0;
1360
+ margin: 0;
1361
+ font-family: inherit;
1362
+ cursor: pointer;
1363
+ transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
1364
+ }
1365
+ .delete-btn:hover {
1366
+ background-color: #18181b;
1367
+ color: #fff;
1368
+ }
1369
+ .icon {
1370
+ display: block;
1371
+ }
1372
+ .icon svg {
1373
+ display: block;
1374
+ width: 100%;
1375
+ height: 100%;
1376
+ }
1377
+ .icon-14 {
1378
+ width: 14px;
1379
+ height: 14px;
1380
+ }
1381
+ .delete-label {
1382
+ font-size: 0.75rem;
1383
+ line-height: 1rem;
1384
+ max-width: 0;
1385
+ overflow: hidden;
1386
+ transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
1387
+ }
1388
+ .delete-btn:hover .delete-label {
1389
+ max-width: 60px;
1390
+ }
1391
+ .editor-wrap {
1392
+ padding: 12px;
1393
+ }
1394
+ @keyframes llumi-fade-in {
1395
+ from {
1396
+ opacity: 0;
1397
+ transform: translateY(4px);
1398
+ }
1399
+ to {
1400
+ opacity: 1;
1401
+ transform: translateY(0);
1402
+ }
1403
+ }
1404
+ `
1405
+ ];
1406
+ P([
1407
+ v({ attribute: !1 })
1408
+ ], S.prototype, "targetElement", 2);
1409
+ P([
1410
+ v({ attribute: !1 })
1411
+ ], S.prototype, "anchor", 2);
1412
+ P([
1413
+ v()
1414
+ ], S.prototype, "value", 2);
1415
+ P([
1416
+ U("[data-floating]")
1417
+ ], S.prototype, "floating", 2);
1418
+ S = P([
1419
+ k("llumi-comment-dialog")
1420
+ ], S);
1421
+ var ee = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, K = (o, e, t, n) => {
1422
+ for (var i = n > 1 ? void 0 : n ? ne(e, t) : e, r = o.length - 1, s; r >= 0; r--)
1423
+ (s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
1424
+ return n && i && ee(e, t, i), i;
1156
1425
  };
1157
- let O = class extends E {
1426
+ let L = class extends C {
1158
1427
  constructor() {
1159
- super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (n) => {
1160
- n.key === "Escape" && (n.preventDefault(), this.emitClose());
1161
- }, this.onDocPointerdown = (n) => {
1162
- const e = n.composedPath();
1428
+ super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (o) => {
1429
+ o.key === "Escape" && (o.preventDefault(), this.emitClose());
1430
+ }, this.onDocPointerdown = (o) => {
1431
+ const e = o.composedPath();
1163
1432
  this.floating && !e.includes(this.floating) && !e.includes(this) && this.emitClose();
1164
1433
  };
1165
1434
  }
1166
1435
  render() {
1167
- return v`<div
1436
+ return w`<div
1168
1437
  data-floating
1169
- class="z-[calc(var(--review-z-index,9998)+1)]"
1438
+ class="floating"
1170
1439
  style="position:absolute;top:0;left:0;"
1171
1440
  >
1172
- <div class="w-[400px] rounded-lg border border-zinc-200 bg-white shadow-xl animate-[llumi-fade-in_0.15s_ease-out]">
1173
- <div class="p-3" @change=${this.onEditorChange}>
1441
+ <div class="panel">
1442
+ <div class="editor-wrap" @change=${this.onEditorChange}>
1174
1443
  <slot name="editor">
1175
1444
  <llumi-default-editor
1176
1445
  .value=${this.value}
@@ -1182,10 +1451,10 @@ let O = class extends E {
1182
1451
  </div>
1183
1452
  </div>`;
1184
1453
  }
1185
- onEditorChange(n) {
1186
- if (typeof n.detail != "string") return;
1187
- const e = n.detail;
1188
- n.stopPropagation(), this.dispatchEvent(
1454
+ onEditorChange(o) {
1455
+ if (typeof o.detail != "string") return;
1456
+ const e = o.detail;
1457
+ o.stopPropagation(), this.dispatchEvent(
1189
1458
  new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
1190
1459
  );
1191
1460
  }
@@ -1196,77 +1465,108 @@ let O = class extends E {
1196
1465
  }
1197
1466
  startPositioning() {
1198
1467
  var t;
1199
- const n = this.barElement, e = this.floating;
1200
- !n || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = vt(n, e, () => {
1201
- wt(n, e, {
1468
+ const o = this.barElement, e = this.floating;
1469
+ !o || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = gt(o, e, () => {
1470
+ ut(o, e, {
1202
1471
  placement: "top",
1203
1472
  middleware: [
1204
- bt(12),
1205
- xt({ padding: 16 }),
1206
- yt({ padding: 16, crossAxis: !0 }),
1207
- Ct({
1473
+ pt(12),
1474
+ ft({ padding: 16 }),
1475
+ vt({ padding: 16, crossAxis: !0 }),
1476
+ bt({
1208
1477
  padding: 16,
1209
- apply({ availableWidth: i, elements: o }) {
1210
- Object.assign(o.floating.style, {
1211
- maxWidth: `${Math.min(400, i)}px`
1478
+ apply({ availableWidth: n, elements: i }) {
1479
+ Object.assign(i.floating.style, {
1480
+ maxWidth: `${Math.min(400, n)}px`
1212
1481
  });
1213
1482
  }
1214
1483
  })
1215
1484
  ]
1216
- }).then(({ x: i, y: o }) => {
1217
- Object.assign(e.style, { left: `${i}px`, top: `${o}px` });
1485
+ }).then(({ x: n, y: i }) => {
1486
+ Object.assign(e.style, { left: `${n}px`, top: `${i}px` });
1218
1487
  });
1219
1488
  }));
1220
1489
  }
1221
1490
  connectedCallback() {
1222
1491
  super.connectedCallback(), document.addEventListener("keydown", this.onDocKeydown), document.addEventListener("pointerdown", this.onDocPointerdown, !0);
1223
1492
  }
1224
- updated(n) {
1225
- n.has("barElement") && this.startPositioning();
1493
+ updated(o) {
1494
+ o.has("barElement") && this.startPositioning();
1226
1495
  }
1227
1496
  disconnectedCallback() {
1228
- var n;
1229
- super.disconnectedCallback(), (n = this.cleanup) == null || n.call(this), this.cleanup = void 0, document.removeEventListener("keydown", this.onDocKeydown), document.removeEventListener("pointerdown", this.onDocPointerdown, !0);
1497
+ var o;
1498
+ super.disconnectedCallback(), (o = this.cleanup) == null || o.call(this), this.cleanup = void 0, document.removeEventListener("keydown", this.onDocKeydown), document.removeEventListener("pointerdown", this.onDocPointerdown, !0);
1230
1499
  }
1231
1500
  };
1232
- X([
1233
- f({ attribute: !1 })
1234
- ], O.prototype, "barElement", 2);
1235
- X([
1236
- f()
1237
- ], O.prototype, "value", 2);
1238
- X([
1239
- F("[data-floating]")
1240
- ], O.prototype, "floating", 2);
1241
- O = X([
1242
- A("llumi-overall-comment-dialog")
1243
- ], O);
1244
- var ue = Object.defineProperty, me = Object.getOwnPropertyDescriptor, Et = (n, e, t, i) => {
1245
- for (var o = i > 1 ? void 0 : i ? me(e, t) : e, r = n.length - 1, a; r >= 0; r--)
1246
- (a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
1247
- return i && o && ue(e, t, o), o;
1501
+ L.styles = [
1502
+ C.styles,
1503
+ F`
1504
+ .floating {
1505
+ z-index: calc(var(--review-z-index, 9998) + 1);
1506
+ }
1507
+ .panel {
1508
+ width: 400px;
1509
+ border-radius: 8px;
1510
+ border: 1px solid #e4e4e7;
1511
+ background-color: #fff;
1512
+ box-shadow:
1513
+ 0 20px 25px -5px rgb(0 0 0 / 0.1),
1514
+ 0 8px 10px -6px rgb(0 0 0 / 0.1);
1515
+ animation: llumi-fade-in 0.15s ease-out;
1516
+ }
1517
+ .editor-wrap {
1518
+ padding: 12px;
1519
+ }
1520
+ @keyframes llumi-fade-in {
1521
+ from {
1522
+ opacity: 0;
1523
+ transform: translateY(4px);
1524
+ }
1525
+ to {
1526
+ opacity: 1;
1527
+ transform: translateY(0);
1528
+ }
1529
+ }
1530
+ `
1531
+ ];
1532
+ K([
1533
+ v({ attribute: !1 })
1534
+ ], L.prototype, "barElement", 2);
1535
+ K([
1536
+ v()
1537
+ ], L.prototype, "value", 2);
1538
+ K([
1539
+ U("[data-floating]")
1540
+ ], L.prototype, "floating", 2);
1541
+ L = K([
1542
+ k("llumi-overall-comment-dialog")
1543
+ ], L);
1544
+ var ie = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, Ct = (o, e, t, n) => {
1545
+ for (var i = n > 1 ? void 0 : n ? oe(e, t) : e, r = o.length - 1, s; r >= 0; r--)
1546
+ (s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
1547
+ return n && i && ie(e, t, i), i;
1248
1548
  };
1249
- const pe = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E";
1250
- let ot = class extends E {
1549
+ const re = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E";
1550
+ let Z = class extends C {
1251
1551
  constructor() {
1252
1552
  super(...arguments), this.positions = [];
1253
1553
  }
1254
1554
  render() {
1255
- return v`${$t(
1555
+ return w`${At(
1256
1556
  this.positions,
1257
- (n) => n.commentId,
1258
- (n) => v`<button
1557
+ (o) => o.commentId,
1558
+ (o) => w`<button
1259
1559
  type="button"
1260
- @click=${(e) => this.onClick(e, n.commentId)}
1261
- style=${Rt({
1560
+ @click=${(e) => this.onClick(e, o.commentId)}
1561
+ style=${Dt({
1262
1562
  position: "absolute",
1263
- top: `${n.top - 10}px`,
1264
- left: `${n.left + 2}px`,
1563
+ top: `${o.top - 10}px`,
1564
+ left: `${o.left + 2}px`,
1265
1565
  width: "20px",
1266
1566
  height: "20px",
1267
1567
  borderRadius: "50%",
1268
1568
  backgroundColor: "white",
1269
- backgroundImage: `url("${pe}")`,
1569
+ backgroundImage: `url("${re}")`,
1270
1570
  backgroundSize: "12px 12px",
1271
1571
  backgroundRepeat: "no-repeat",
1272
1572
  backgroundPosition: "center",
@@ -1279,8 +1579,8 @@ let ot = class extends E {
1279
1579
  ></button>`
1280
1580
  )}`;
1281
1581
  }
1282
- onClick(n, e) {
1283
- n.stopPropagation(), this.dispatchEvent(
1582
+ onClick(o, e) {
1583
+ o.stopPropagation(), this.dispatchEvent(
1284
1584
  new CustomEvent("icon-click", {
1285
1585
  detail: e,
1286
1586
  bubbles: !0,
@@ -1289,84 +1589,158 @@ let ot = class extends E {
1289
1589
  );
1290
1590
  }
1291
1591
  };
1292
- Et([
1293
- f({ attribute: !1 })
1294
- ], ot.prototype, "positions", 2);
1295
- ot = Et([
1296
- A("llumi-selection-comment-icons")
1297
- ], ot);
1298
- const R = "data-review-selectable", Z = "review-selection-commented", tt = "review-selection-editing", L = "review-selection-hover", fe = "$mod+Shift+M", ft = "data-llumi-review";
1299
- let et = !1;
1300
- function ve() {
1301
- if (et) return;
1302
- if (document.querySelector(`style[${ft}]`)) {
1303
- et = !0;
1304
- return;
1305
- }
1306
- const n = document.createElement("style");
1307
- n.setAttribute(ft, ""), n.textContent = Gt, document.head.append(n), et = !0;
1308
- }
1309
- function H() {
1592
+ Ct([
1593
+ v({ attribute: !1 })
1594
+ ], Z.prototype, "positions", 2);
1595
+ Z = Ct([
1596
+ k("llumi-selection-comment-icons")
1597
+ ], Z);
1598
+ const z = "data-review-selectable", ht = "review-selection-commented", mt = "review-selection-editing", G = "review-selection-hover";
1599
+ function tt() {
1310
1600
  if (!(typeof CSS > "u"))
1311
1601
  return CSS.highlights;
1312
1602
  }
1313
- function it(...n) {
1603
+ function et(...o) {
1314
1604
  return new Highlight(
1315
- ...n
1605
+ ...o
1316
1606
  );
1317
1607
  }
1318
- const st = class st extends HTMLElement {
1608
+ class se {
1609
+ constructor(e) {
1610
+ this.ranges = /* @__PURE__ */ new Map(), this.repositionRaf = 0, this.reposition = () => {
1611
+ this.repositionRaf || (this.repositionRaf = requestAnimationFrame(() => {
1612
+ if (this.repositionRaf = 0, !this.ctx.isAnnotating() || this.ranges.size === 0) return;
1613
+ const t = [];
1614
+ for (const [n, i] of this.ranges) {
1615
+ const r = this.iconPositionForRange(n, i);
1616
+ r && t.push(r);
1617
+ }
1618
+ this.ctx.icons.positions = t;
1619
+ }));
1620
+ }, this.ctx = e;
1621
+ }
1622
+ /** Read accessor: the element's pointer hit-testing iterates this. */
1623
+ get rangeMap() {
1624
+ return this.ranges;
1625
+ }
1626
+ /**
1627
+ * Rebuild the commented/editing highlight registries, the `rangeMap`, and
1628
+ * the icon positions from the given selection comments + the machine
1629
+ * snapshot's `editingCommentId` / `comments` (the editing range may belong
1630
+ * to a comment whose content is not yet committed, hence the fallback).
1631
+ */
1632
+ update(e) {
1633
+ const t = tt();
1634
+ if (!t) return;
1635
+ const n = et(), i = et(), r = /* @__PURE__ */ new Map(), s = [], a = this.ctx.getSnapshot();
1636
+ for (const h of e) {
1637
+ if (!h.selection) continue;
1638
+ const u = this.ctx.host.querySelector(
1639
+ `[${z}="${h.targetId}"]`
1640
+ );
1641
+ if (!u) continue;
1642
+ const p = Q(u, h.selection);
1643
+ if (!p) continue;
1644
+ r.set(h.commentId, p), h.commentId === a.editingCommentId ? i.add(p) : n.add(p);
1645
+ const g = this.iconPositionForRange(h.commentId, p);
1646
+ g && s.push(g);
1647
+ }
1648
+ const l = a.editingCommentId;
1649
+ if (l && !r.has(l)) {
1650
+ const h = a.comments.find(
1651
+ (u) => u.commentId === l
1652
+ );
1653
+ if (h != null && h.selection) {
1654
+ const u = this.ctx.host.querySelector(
1655
+ `[${z}="${h.targetId}"]`
1656
+ );
1657
+ if (u) {
1658
+ const p = Q(u, h.selection);
1659
+ p && i.add(p);
1660
+ }
1661
+ }
1662
+ }
1663
+ this.ranges = r, t.set(
1664
+ ht,
1665
+ n
1666
+ ), t.set(mt, i), this.ctx.icons.positions = s;
1667
+ }
1668
+ // Page-coordinate position of a selection comment's icon, anchored to the
1669
+ // end of its range (so it sits just past the selected text).
1670
+ iconPositionForRange(e, t) {
1671
+ const n = t.getClientRects(), i = n[n.length - 1];
1672
+ return i ? {
1673
+ commentId: e,
1674
+ top: i.top + window.scrollY,
1675
+ left: i.right + window.scrollX
1676
+ } : null;
1677
+ }
1678
+ /** Clear all three highlight registries, the `rangeMap`, and icon positions. */
1679
+ clear() {
1680
+ const e = tt();
1681
+ e && (e.delete(ht), e.delete(mt), e.delete(G)), this.ranges.clear(), this.ctx.icons.positions = [];
1682
+ }
1683
+ /** Capture-phase scroll + resize listeners, so icons recompute on any scroll. */
1684
+ attachListeners() {
1685
+ window.addEventListener("scroll", this.reposition, !0), window.addEventListener("resize", this.reposition);
1686
+ }
1687
+ /** Remove listeners and cancel any pending rAF. */
1688
+ detachListeners() {
1689
+ window.removeEventListener("scroll", this.reposition, !0), window.removeEventListener("resize", this.reposition), this.repositionRaf && cancelAnimationFrame(this.repositionRaf);
1690
+ }
1691
+ }
1692
+ const ae = "$mod+Shift+M", it = class it extends HTMLElement {
1319
1693
  constructor() {
1320
- super(...arguments), this.persistence = ut, this.manager = null, this.rangeMap = /* @__PURE__ */ new Map(), this.hoveredComment = null, this.selectionJustHandled = !1, this.selectionComments = [], this.commentDialog = null, this.overallDialog = null, this.onPointerUp = () => {
1694
+ super(...arguments), this.persistence = ct, this.manager = null, this.hoveredComment = null, this.selectionJustHandled = !1, this.selectionComments = [], this.commentDialog = null, this.commentDialogAnchorId = null, this.overallDialog = null, this.onPointerUp = () => {
1321
1695
  if (!this.isAnnotating()) return;
1322
1696
  const e = window.getSelection();
1323
1697
  if (!e || e.isCollapsed || e.rangeCount === 0)
1324
1698
  return;
1325
- const t = e.getRangeAt(0), i = Q(t.startContainer);
1326
- if (!i) return;
1327
- const o = Q(t.endContainer);
1328
- if (o && o !== i) {
1699
+ const t = e.getRangeAt(0), n = Y(t.startContainer);
1700
+ if (!n) return;
1701
+ const i = Y(t.endContainer);
1702
+ if (i && i !== n) {
1329
1703
  e.removeAllRanges();
1330
1704
  return;
1331
1705
  }
1332
- if (!o || !Bt(e, i)) {
1333
- const s = Yt(e, i);
1334
- if (!s) return;
1335
- e.removeAllRanges(), e.addRange(s);
1706
+ if (!i || !Ft(e, n)) {
1707
+ const a = Ut(e, n);
1708
+ if (!a) return;
1709
+ e.removeAllRanges(), e.addRange(a);
1336
1710
  }
1337
- const r = i.getAttribute(R);
1711
+ const r = n.getAttribute(z);
1338
1712
  if (!r) return;
1339
- const a = Vt(i);
1340
- a && (e.removeAllRanges(), this.selectionJustHandled = !0, this.actor.send({
1713
+ const s = zt(n);
1714
+ s && (e.removeAllRanges(), this.selectionJustHandled = !0, this.actor.send({
1341
1715
  type: "SELECT_TEXT",
1342
1716
  targetId: r,
1343
- targetElement: i,
1344
- selectionRange: a
1717
+ targetElement: n,
1718
+ selectionRange: s
1345
1719
  }));
1346
1720
  }, this.onPointerMove = (e) => {
1347
1721
  if (!this.isAnnotating()) return;
1348
- const t = H();
1722
+ const t = tt();
1349
1723
  if (!t) return;
1350
- const i = this.caretPosition(e.clientX, e.clientY);
1351
- if (!i) {
1352
- this.hoveredComment && (t.delete(L), this.hoveredComment = null);
1724
+ const n = this.caretPosition(e.clientX, e.clientY);
1725
+ if (!n) {
1726
+ this.hoveredComment && (t.delete(G), this.hoveredComment = null);
1353
1727
  return;
1354
1728
  }
1355
- let o = null;
1356
- for (const [r, a] of this.rangeMap)
1357
- if (a.isPointInRange(i.offsetNode, i.offset)) {
1358
- o = r;
1729
+ let i = null;
1730
+ for (const [r, s] of this.painter.rangeMap)
1731
+ if (s.isPointInRange(n.offsetNode, n.offset)) {
1732
+ i = r;
1359
1733
  break;
1360
1734
  }
1361
- if (o !== this.hoveredComment)
1362
- if (this.hoveredComment = o, o) {
1363
- const r = this.rangeMap.get(o);
1735
+ if (i !== this.hoveredComment)
1736
+ if (this.hoveredComment = i, i) {
1737
+ const r = this.painter.rangeMap.get(i);
1364
1738
  r && t.set(
1365
- L,
1366
- it(r)
1739
+ G,
1740
+ et(r)
1367
1741
  );
1368
1742
  } else
1369
- t.delete(L);
1743
+ t.delete(G);
1370
1744
  }, this.onClickCapture = (e) => {
1371
1745
  if (!this.isAnnotating() || e.defaultPrevented) return;
1372
1746
  if (this.selectionJustHandled) {
@@ -1375,40 +1749,40 @@ const st = class st extends HTMLElement {
1375
1749
  }
1376
1750
  const t = window.getSelection();
1377
1751
  if (t && !t.isCollapsed) return;
1378
- const i = this.caretPosition(e.clientX, e.clientY);
1379
- if (i) {
1380
- for (const [s, l] of this.rangeMap)
1381
- if (l.isPointInRange(i.offsetNode, i.offset)) {
1382
- const u = this.selectionComments.find(
1383
- (b) => b.commentId === s
1752
+ const n = this.caretPosition(e.clientX, e.clientY);
1753
+ if (n) {
1754
+ for (const [a, l] of this.painter.rangeMap)
1755
+ if (l.isPointInRange(n.offsetNode, n.offset)) {
1756
+ const h = this.selectionComments.find(
1757
+ (p) => p.commentId === a
1384
1758
  );
1759
+ if (!h) continue;
1760
+ const u = Y(n.offsetNode);
1385
1761
  if (!u) continue;
1386
- const m = Q(i.offsetNode);
1387
- if (!m) continue;
1388
1762
  e.stopPropagation(), e.preventDefault(), this.actor.send({
1389
1763
  type: "CLICK",
1390
- targetId: u.targetId,
1391
- element: m,
1392
- selectionCommentId: s
1764
+ targetId: h.targetId,
1765
+ element: u,
1766
+ selectionCommentId: a
1393
1767
  });
1394
1768
  return;
1395
1769
  }
1396
1770
  }
1397
- const o = e.target, a = o.closest(
1771
+ const i = e.target, s = i.closest(
1398
1772
  ".review-highlight-hover, .review-highlight-commented, .review-highlight-editing"
1399
1773
  );
1400
- if (a && this.contains(a)) {
1774
+ if (s && this.contains(s)) {
1401
1775
  e.stopPropagation(), e.preventDefault();
1402
- const s = N(o, this.customTargets);
1403
- s ? this.actor.send({
1776
+ const a = _(i, this.customTargets);
1777
+ a ? this.actor.send({
1404
1778
  type: "CLICK",
1405
- targetId: s.targetId,
1406
- element: s.element
1779
+ targetId: a.targetId,
1780
+ element: a.element
1407
1781
  }) : this.actor.send({ type: "CLICK" });
1408
1782
  }
1409
1783
  }, this.onWrapperClick = (e) => {
1410
1784
  if (!this.contains(e.target) || !this.isAnnotating()) return;
1411
- const t = N(e.target, this.customTargets);
1785
+ const t = _(e.target, this.customTargets);
1412
1786
  t ? (e.stopPropagation(), e.preventDefault(), this.actor.send({
1413
1787
  type: "CLICK",
1414
1788
  targetId: t.targetId,
@@ -1417,40 +1791,40 @@ const st = class st extends HTMLElement {
1417
1791
  }, this.onMouseOver = (e) => {
1418
1792
  const t = this.manager;
1419
1793
  if (!t || !this.isAnnotating()) return;
1420
- const i = this.currentEditingTargetId(), o = N(
1794
+ const n = this.currentEditingTargetId(), i = _(
1421
1795
  e.target,
1422
1796
  this.customTargets
1423
1797
  );
1424
- if (o) {
1425
- t.applyHover(o.element, i);
1798
+ if (i) {
1799
+ t.applyHover(i.element, n);
1426
1800
  return;
1427
1801
  }
1428
1802
  const r = e.target.closest(
1429
1803
  "[data-review-selectable]"
1430
1804
  );
1431
- r && t.applyHover(r, i);
1805
+ r && t.applyHover(r, n);
1432
1806
  }, this.onMouseOut = (e) => {
1433
1807
  const t = this.manager;
1434
1808
  if (!t || !this.isAnnotating()) return;
1435
- const i = this.currentEditingTargetId(), o = /* @__PURE__ */ new Set();
1436
- for (const s of this.actor.getSnapshot().context.comments)
1437
- !s.selection && s.content.trim() && o.add(s.targetId);
1438
- const r = N(
1809
+ const n = this.currentEditingTargetId(), i = /* @__PURE__ */ new Set();
1810
+ for (const a of this.actor.getSnapshot().context.comments)
1811
+ !a.selection && a.content.trim() && i.add(a.targetId);
1812
+ const r = _(
1439
1813
  e.target,
1440
1814
  this.customTargets
1441
1815
  );
1442
1816
  if (r) {
1443
- t.clearHover(r.element, i, o);
1817
+ t.clearHover(r.element, n, i);
1444
1818
  return;
1445
1819
  }
1446
- const a = e.target.closest(
1820
+ const s = e.target.closest(
1447
1821
  "[data-review-selectable]"
1448
1822
  );
1449
- a && t.clearHover(a, i);
1823
+ s && t.clearHover(s, n, i);
1450
1824
  };
1451
1825
  }
1452
1826
  get shortcut() {
1453
- return this.getAttribute("shortcut") ?? fe;
1827
+ return this.getAttribute("shortcut") ?? ae;
1454
1828
  }
1455
1829
  get barPosition() {
1456
1830
  return this.getAttribute("bar-position") ?? "bottom-center";
@@ -1463,11 +1837,11 @@ const st = class st extends HTMLElement {
1463
1837
  return e != null && e.trim() ? e : null;
1464
1838
  }
1465
1839
  connectedCallback() {
1466
- ve(), this.style.position === "" && (this.style.position = "relative"), this.style.display === "" && (this.style.display = "block");
1840
+ Tt("review", Nt), this.style.position === "" && (this.style.position = "relative"), this.style.display === "" && (this.style.display = "block");
1467
1841
  const e = this.buildHighlightCallbacks();
1468
- this.persistence = this.persistKey ? qt(this.persistKey) : ut;
1469
- const t = Kt();
1470
- this.actor = zt(t, {
1842
+ this.persistence = this.persistKey ? Ht(this.persistKey) : ct;
1843
+ const t = Mt();
1844
+ this.actor = St(t, {
1471
1845
  input: {
1472
1846
  shortcut: this.shortcut,
1473
1847
  initialData: this.initialData,
@@ -1475,13 +1849,16 @@ const st = class st extends HTMLElement {
1475
1849
  highlights: e,
1476
1850
  persistence: this.persistence
1477
1851
  }
1478
- }), this.actor.on("REVIEW_CHANGED", (i) => this.emitChange(i.result)), this.actor.on("REVIEW_SUBMITTED", (i) => this.emitSubmit(i.result)), this.mountChrome(), this.actor.subscribe(() => this.syncFromSnapshot()), this.actor.start(), this.manager = Ht(this, this.customTargets), this.actor.send({ type: "MOUNTED" }), this.addEventListener("pointerup", this.onPointerUp), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("click", this.onClickCapture, !0), this.addEventListener("click", this.onWrapperClick), this.addEventListener("mouseover", this.onMouseOver), this.addEventListener("mouseout", this.onMouseOut), this.syncFromSnapshot();
1852
+ }), this.actor.on("REVIEW_CHANGED", (n) => this.emitChange(n.result)), this.actor.on("REVIEW_SUBMITTED", (n) => this.emitSubmit(n.result)), this.mountChrome(), this.painter = new se({
1853
+ host: this,
1854
+ icons: this.icons,
1855
+ getSnapshot: () => this.actor.getSnapshot().context,
1856
+ isAnnotating: () => this.isAnnotating()
1857
+ }), this.actor.subscribe(() => this.syncFromSnapshot()), this.actor.start(), this.manager = kt(this, this.customTargets), this.actor.send({ type: "MOUNTED" }), this.addEventListener("pointerup", this.onPointerUp), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("click", this.onClickCapture, !0), this.addEventListener("click", this.onWrapperClick), this.addEventListener("mouseover", this.onMouseOver), this.addEventListener("mouseout", this.onMouseOut), this.painter.attachListeners(), this.syncFromSnapshot();
1479
1858
  }
1480
1859
  disconnectedCallback() {
1481
- var t, i, o, r, a, s;
1482
- this.removeEventListener("pointerup", this.onPointerUp), this.removeEventListener("pointermove", this.onPointerMove), this.removeEventListener("click", this.onClickCapture, !0), this.removeEventListener("click", this.onWrapperClick), this.removeEventListener("mouseover", this.onMouseOver), this.removeEventListener("mouseout", this.onMouseOut);
1483
- const e = H();
1484
- e && (e.delete(Z), e.delete(tt), e.delete(L)), this.icons && (this.icons.positions = []), (t = this.manager) == null || t.destroy(), this.manager = null, (i = this.actor) == null || i.stop(), (o = this.bar) == null || o.remove(), (r = this.commentDialog) == null || r.remove(), (a = this.overallDialog) == null || a.remove(), (s = this.icons) == null || s.remove();
1860
+ var e, t, n, i, r, s, a, l;
1861
+ this.removeEventListener("pointerup", this.onPointerUp), this.removeEventListener("pointermove", this.onPointerMove), this.removeEventListener("click", this.onClickCapture, !0), this.removeEventListener("click", this.onWrapperClick), this.removeEventListener("mouseover", this.onMouseOver), this.removeEventListener("mouseout", this.onMouseOut), (e = this.painter) == null || e.detachListeners(), (t = this.painter) == null || t.clear(), (n = this.manager) == null || n.destroy(), this.manager = null, (i = this.actor) == null || i.stop(), (r = this.bar) == null || r.remove(), (s = this.commentDialog) == null || s.remove(), (a = this.overallDialog) == null || a.remove(), (l = this.icons) == null || l.remove();
1485
1862
  }
1486
1863
  attributeChangedCallback() {
1487
1864
  this.bar && (this.bar.barPosition = this.barPosition);
@@ -1489,7 +1866,11 @@ const st = class st extends HTMLElement {
1489
1866
  buildDetailResult(e) {
1490
1867
  return e.status === "commented" ? {
1491
1868
  ...e,
1492
- comments: ee(e.comments, this)
1869
+ comments: qt(
1870
+ e.comments,
1871
+ this,
1872
+ this.customTargets
1873
+ )
1493
1874
  } : e;
1494
1875
  }
1495
1876
  emitChange(e) {
@@ -1517,6 +1898,18 @@ const st = class st extends HTMLElement {
1517
1898
  clearPersisted() {
1518
1899
  this.persistence.clear();
1519
1900
  }
1901
+ // Build a floating-ui virtual reference that tracks a selection's live rect.
1902
+ // `contextElement` lets autoUpdate find the right scroll ancestors. Returns
1903
+ // null when the range can't be restored, so the dialog falls back to anchoring
1904
+ // on the whole element.
1905
+ selectionAnchor(e, t) {
1906
+ const n = Q(e, t);
1907
+ return n ? {
1908
+ getBoundingClientRect: () => n.getBoundingClientRect(),
1909
+ getClientRects: () => n.getClientRects(),
1910
+ contextElement: e
1911
+ } : null;
1912
+ }
1520
1913
  // --- chrome lifecycle ---
1521
1914
  mountChrome() {
1522
1915
  this.bar = document.createElement("llumi-review-bar"), this.bar.barPosition = this.barPosition, this.bar.addEventListener(
@@ -1538,26 +1931,26 @@ const st = class st extends HTMLElement {
1538
1931
  ), document.body.append(this.icons);
1539
1932
  }
1540
1933
  onIconClick(e) {
1541
- const t = this.actor.getSnapshot().context.comments.find((o) => o.commentId === e);
1934
+ const t = this.actor.getSnapshot().context.comments.find((i) => i.commentId === e);
1542
1935
  if (!t) return;
1543
- const i = this.querySelector(
1544
- `[${R}="${t.targetId}"]`
1936
+ const n = this.querySelector(
1937
+ `[${z}="${t.targetId}"]`
1545
1938
  );
1546
- i && this.actor.send({
1939
+ n && this.actor.send({
1547
1940
  type: "CLICK",
1548
1941
  targetId: t.targetId,
1549
- element: i,
1942
+ element: n,
1550
1943
  selectionCommentId: e
1551
1944
  });
1552
1945
  }
1553
- // --- snapshot → UI sync (replaces review.component.tsx render) ---
1946
+ // --- snapshot → UI sync ---
1554
1947
  syncFromSnapshot() {
1555
- const e = this.actor.getSnapshot(), { comments: t, overallComment: i, editingCommentId: o, targetElement: r } = e.context;
1948
+ const e = this.actor.getSnapshot(), { comments: t, overallComment: n, editingCommentId: i, targetElement: r } = e.context;
1556
1949
  this.selectionComments = t.filter(
1557
1950
  (g) => g.selection && g.content.trim()
1558
1951
  );
1559
- const a = !e.matches({ annotating: "inactive" }), s = e.matches({ commenting: "editing" }), l = o ? t.find((g) => g.commentId === o) : null, u = s && o === null, m = t.filter((g) => g.content.trim()).length, b = i.trim().length > 0;
1560
- this.bar.mode = a ? l ? "editing" : "commenting" : "idle", this.bar.commentCount = m, this.bar.hasOverallComment = b, this.bar.overallCommentOpen = u, this.icons.style.display = a ? "" : "none", s && l && r ? (this.commentDialog || (this.commentDialog = document.createElement(
1952
+ const s = !e.matches({ annotating: "inactive" }), a = e.matches({ commenting: "editing" }), l = i ? t.find((g) => g.commentId === i) : null, h = a && i === null, u = t.filter((g) => g.content.trim()).length, p = n.trim().length > 0;
1953
+ this.bar.mode = s ? l ? "editing" : "commenting" : "idle", this.bar.commentCount = u, this.bar.hasOverallComment = p, this.bar.overallCommentOpen = h, this.icons.style.display = s ? "" : "none", a && l && r ? (this.commentDialog || (this.commentDialog = document.createElement(
1561
1954
  "llumi-comment-dialog"
1562
1955
  ), this.commentDialog.addEventListener(
1563
1956
  "change",
@@ -1571,7 +1964,7 @@ const st = class st extends HTMLElement {
1571
1964
  ), this.commentDialog.addEventListener(
1572
1965
  "close",
1573
1966
  () => this.actor.send({ type: "CLOSE" })
1574
- ), document.body.append(this.commentDialog)), this.commentDialog.targetElement = r, this.commentDialog.value = l.content) : this.commentDialog && (this.commentDialog.remove(), this.commentDialog = null), u ? (this.overallDialog || (this.overallDialog = document.createElement(
1967
+ ), document.body.append(this.commentDialog)), l.commentId !== this.commentDialogAnchorId && (this.commentDialogAnchorId = l.commentId, this.commentDialog.anchor = l.selection ? this.selectionAnchor(r, l.selection) : null, this.commentDialog.targetElement = r), this.commentDialog.value = l.content) : this.commentDialog && (this.commentDialog.remove(), this.commentDialog = null, this.commentDialogAnchorId = null), h ? (this.overallDialog || (this.overallDialog = document.createElement(
1575
1968
  "llumi-overall-comment-dialog"
1576
1969
  ), this.overallDialog.addEventListener(
1577
1970
  "change",
@@ -1582,9 +1975,9 @@ const st = class st extends HTMLElement {
1582
1975
  ), this.overallDialog.addEventListener(
1583
1976
  "close",
1584
1977
  () => this.actor.send({ type: "CLOSE" })
1585
- ), document.body.append(this.overallDialog)), this.overallDialog.barElement = this.bar.barRoot, this.overallDialog.value = i) : this.overallDialog && (this.overallDialog.remove(), this.overallDialog = null), a && this.updateSelectionHighlights();
1978
+ ), document.body.append(this.overallDialog)), this.overallDialog.barElement = this.bar.barRoot, this.overallDialog.value = n) : this.overallDialog && (this.overallDialog.remove(), this.overallDialog = null), s && this.painter.update(this.selectionComments);
1586
1979
  }
1587
- // --- highlight callbacks (port of use-review.ts `highlights`) ---
1980
+ // --- highlight callbacks ---
1588
1981
  buildHighlightCallbacks() {
1589
1982
  return {
1590
1983
  activate: (e) => {
@@ -1592,16 +1985,13 @@ const st = class st extends HTMLElement {
1592
1985
  t && (t.activate(e), t.startObserving({
1593
1986
  editingTarget: this.actor.getSnapshot().context.targetElement,
1594
1987
  onTargetDisconnected: () => this.actor.send({ type: "CLOSE" }),
1595
- onSelectableReconnected: () => this.updateSelectionHighlights(),
1988
+ onSelectableReconnected: () => this.painter.update(this.selectionComments),
1596
1989
  commentedIds: e
1597
1990
  }));
1598
1991
  },
1599
1992
  deactivate: () => {
1600
1993
  const e = this.manager;
1601
- if (!e) return;
1602
- e.deactivate(), e.stopObserving();
1603
- const t = H();
1604
- t && (t.delete(Z), t.delete(tt), t.delete(L)), this.rangeMap.clear(), this.icons.positions = [];
1994
+ e && (e.deactivate(), e.stopObserving(), this.painter.clear());
1605
1995
  },
1606
1996
  reveal: (e) => {
1607
1997
  var t;
@@ -1612,66 +2002,25 @@ const st = class st extends HTMLElement {
1612
2002
  return (e = this.manager) == null ? void 0 : e.unreveal();
1613
2003
  },
1614
2004
  setEditing: (e, t) => {
1615
- var i;
1616
- (i = this.manager) == null || i.setEditing(e, t), this.updateSelectionHighlights();
2005
+ var n;
2006
+ (n = this.manager) == null || n.setEditing(e, t), this.painter.update(this.selectionComments);
1617
2007
  },
1618
2008
  clearEditing: (e, t) => {
1619
- var i;
1620
- (i = this.manager) == null || i.clearEditing(e, t), this.updateSelectionHighlights();
2009
+ var n;
2010
+ (n = this.manager) == null || n.clearEditing(e, t), this.painter.update(this.selectionComments);
1621
2011
  }
1622
2012
  };
1623
2013
  }
1624
- // --- selection highlight painting (port of updateSelectionHighlights) ---
1625
- updateSelectionHighlights() {
1626
- const e = H();
1627
- if (!e) return;
1628
- const t = it(), i = it(), o = /* @__PURE__ */ new Map(), r = [], a = this.actor.getSnapshot().context;
1629
- for (const l of this.selectionComments) {
1630
- if (!l.selection) continue;
1631
- const u = this.querySelector(
1632
- `[${R}="${l.targetId}"]`
1633
- );
1634
- if (!u) continue;
1635
- const m = mt(u, l.selection);
1636
- if (!m) continue;
1637
- o.set(l.commentId, m), l.commentId === a.editingCommentId ? i.add(m) : t.add(m);
1638
- const b = m.getClientRects(), g = b[b.length - 1];
1639
- g && r.push({
1640
- commentId: l.commentId,
1641
- top: g.top + window.scrollY,
1642
- left: g.right + window.scrollX
1643
- });
1644
- }
1645
- const s = a.editingCommentId;
1646
- if (s && !o.has(s)) {
1647
- const l = a.comments.find(
1648
- (u) => u.commentId === s
1649
- );
1650
- if (l != null && l.selection) {
1651
- const u = this.querySelector(
1652
- `[${R}="${l.targetId}"]`
1653
- );
1654
- if (u) {
1655
- const m = mt(u, l.selection);
1656
- m && i.add(m);
1657
- }
1658
- }
1659
- }
1660
- this.rangeMap = o, e.set(
1661
- Z,
1662
- t
1663
- ), e.set(tt, i), this.icons.positions = r;
1664
- }
1665
2014
  isAnnotating() {
1666
2015
  return !this.actor.getSnapshot().matches({ annotating: "inactive" });
1667
2016
  }
1668
2017
  caretPosition(e, t) {
1669
2018
  if ("caretPositionFromPoint" in document) {
1670
- const i = document.caretPositionFromPoint(e, t);
1671
- if (i) return i;
2019
+ const n = document.caretPositionFromPoint(e, t);
2020
+ if (n) return n;
1672
2021
  } else if ("caretRangeFromPoint" in document) {
1673
- const i = document.caretRangeFromPoint(e, t);
1674
- if (i) return { offsetNode: i.startContainer, offset: i.startOffset };
2022
+ const n = document.caretRangeFromPoint(e, t);
2023
+ if (n) return { offsetNode: n.startContainer, offset: n.startOffset };
1675
2024
  }
1676
2025
  return null;
1677
2026
  }
@@ -1679,17 +2028,17 @@ const st = class st extends HTMLElement {
1679
2028
  var t;
1680
2029
  const e = this.actor.getSnapshot().context;
1681
2030
  if (e.editingCommentId)
1682
- return ((t = e.comments.find((i) => i.commentId === e.editingCommentId)) == null ? void 0 : t.targetId) ?? void 0;
2031
+ return ((t = e.comments.find((n) => n.commentId === e.editingCommentId)) == null ? void 0 : t.targetId) ?? void 0;
1683
2032
  }
1684
2033
  };
1685
- st.observedAttributes = ["bar-position", "shortcut", "default-mode"];
1686
- let rt = st;
1687
- customElements.get("llumi-review") || customElements.define("llumi-review", rt);
2034
+ it.observedAttributes = ["bar-position", "shortcut", "default-mode"];
2035
+ let nt = it;
2036
+ customElements.get("llumi-review") || customElements.define("llumi-review", nt);
1688
2037
  export {
1689
- z as LlumiCommentDialog,
1690
- S as LlumiDefaultEditor,
1691
- O as LlumiOverallCommentDialog,
1692
- rt as LlumiReview,
1693
- w as LlumiReviewBar,
1694
- ot as LlumiSelectionCommentIcons
2038
+ S as LlumiCommentDialog,
2039
+ I as LlumiDefaultEditor,
2040
+ L as LlumiOverallCommentDialog,
2041
+ nt as LlumiReview,
2042
+ b as LlumiReviewBar,
2043
+ Z as LlumiSelectionCommentIcons
1695
2044
  };