review-lens-react 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,153 +1,184 @@
1
- import { jsx as i, jsxs as o, Fragment as ae } from "react/jsx-runtime";
2
- import { createContext as mt, useMemo as se, useState as N, useCallback as W, useEffect as B, useContext as pt, useRef as re, useLayoutEffect as gt } from "react";
1
+ import { jsx as i, jsxs as s, Fragment as ae } from "react/jsx-runtime";
2
+ import { createContext as gt, useMemo as oe, useState as x, useCallback as D, useEffect as P, useContext as ft, useRef as re, useLayoutEffect as wt } from "react";
3
3
  const Be = [
4
4
  "https://www.googleapis.com/auth/spreadsheets",
5
5
  "https://www.googleapis.com/auth/userinfo.email"
6
- ], ft = "https://www.googleapis.com/auth/gmail.send", wt = "https://www.googleapis.com/oauth2/v3/userinfo", bt = "https://gmail.googleapis.com/gmail/v1/users/me/messages/send";
7
- function vt(e) {
8
- const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users", s = e.enableEmailNotifications ? [...Be, ft].join(" ") : Be.join(" ");
9
- let c, h;
10
- async function w() {
11
- return c ?? (c = At(e.googleClientId, s)), c;
6
+ ], vt = "https://www.googleapis.com/auth/gmail.send", Pe = "https://www.googleapis.com/oauth2/v3/userinfo", bt = "https://gmail.googleapis.com/gmail/v1/users/me/messages/send", yt = "review-lens-google-token", kt = 6e4;
7
+ function St(e) {
8
+ const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users", o = e.enableEmailNotifications ? [...Be, vt].join(" ") : Be.join(" "), c = $t(e.googleClientId, o);
9
+ let u, w;
10
+ async function g() {
11
+ const p = Mt(c);
12
+ if (p)
13
+ return p.accessToken;
14
+ u ?? (u = Tt(e.googleClientId, o).then((h) => (Bt(c, h), h)));
15
+ const v = await u;
16
+ return Date.now() >= v.expiresAt ? (u = void 0, g()) : v.accessToken;
12
17
  }
13
- async function p(g, f, m) {
14
- const S = await w(), x = await fetch(
15
- `https://sheets.googleapis.com/v4/spreadsheets/${g}${f}`,
18
+ async function b(p, v, h) {
19
+ const k = await g(), l = await fetch(
20
+ `https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
16
21
  {
17
- ...m,
22
+ ...h,
18
23
  headers: {
19
- Authorization: `Bearer ${S}`,
24
+ Authorization: `Bearer ${k}`,
20
25
  "Content-Type": "application/json",
21
- ...m == null ? void 0 : m.headers
26
+ ...h == null ? void 0 : h.headers
22
27
  }
23
28
  }
24
29
  );
25
- if (!x.ok)
26
- throw new Error(`Google Sheets request failed with ${x.status}`);
27
- return x.json();
30
+ if (l.status === 401) {
31
+ De(c), u = void 0;
32
+ const C = await g(), f = await fetch(
33
+ `https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
34
+ {
35
+ ...h,
36
+ headers: {
37
+ Authorization: `Bearer ${C}`,
38
+ "Content-Type": "application/json",
39
+ ...h == null ? void 0 : h.headers
40
+ }
41
+ }
42
+ );
43
+ if (!f.ok)
44
+ throw new Error(`Google Sheets request failed with ${f.status}`);
45
+ return f.json();
46
+ }
47
+ if (!l.ok)
48
+ throw new Error(`Google Sheets request failed with ${l.status}`);
49
+ return l.json();
28
50
  }
29
- async function b(g, f) {
30
- return (await p(
31
- g,
32
- `/values/${encodeURIComponent(f)}`
51
+ async function A(p, v) {
52
+ return (await b(
53
+ p,
54
+ `/values/${encodeURIComponent(v)}`
33
55
  )).values ?? [];
34
56
  }
35
57
  return {
36
58
  async getCurrentUser() {
37
- if (!h) {
38
- const g = await w(), f = await fetch(wt, {
39
- headers: { Authorization: `Bearer ${g}` }
40
- });
41
- if (!f.ok)
42
- throw new Error(`Google userinfo request failed with ${f.status}`);
43
- h = (await f.json()).email;
44
- }
45
- if (!h)
59
+ if (w || (w = await L()), !w)
46
60
  throw new Error("Google account did not return an email address");
47
- return { email: h };
61
+ return { email: w };
48
62
  },
49
- async getPermissions(g) {
50
- const [{ email: f }, m] = await Promise.all([
63
+ async getPermissions(p) {
64
+ const [{ email: v }, h] = await Promise.all([
51
65
  this.getCurrentUser(),
52
- b(e.usersSpreadsheetId, r)
53
- ]), S = ue(m), x = f.toLowerCase(), E = S.find(
54
- (l) => {
55
- var A;
56
- return ((A = l.email) == null ? void 0 : A.toLowerCase()) === x && l.active !== "false" && (!l.projectKey || l.projectKey === g);
66
+ A(e.usersSpreadsheetId, r)
67
+ ]), k = ue(h), l = v.toLowerCase(), C = k.find(
68
+ (f) => {
69
+ var y;
70
+ return ((y = f.email) == null ? void 0 : y.toLowerCase()) === l && f.active !== "false" && (!f.projectKey || f.projectKey === p);
57
71
  }
58
72
  );
59
- return Nt((E == null ? void 0 : E.role) ?? "designer");
73
+ return Et((C == null ? void 0 : C.role) ?? "designer");
60
74
  },
61
- async listFeedback(g) {
62
- return ue(await b(e.contentSpreadsheetId, t)).map(je).filter((m) => m !== null).filter(
63
- (m) => m.projectKey === g.projectKey && m.contentId === g.contentId && m.normalizedPath === g.normalizedPath
64
- ).sort((m, S) => S.createdAt.localeCompare(m.createdAt));
75
+ async listFeedback(p) {
76
+ return ue(await A(e.contentSpreadsheetId, t)).map(Ue).filter((h) => h !== null).filter(
77
+ (h) => h.projectKey === p.projectKey && h.contentId === p.contentId && h.normalizedPath === p.normalizedPath
78
+ ).sort((h, k) => k.createdAt.localeCompare(h.createdAt));
65
79
  },
66
- async createFeedback(g) {
67
- const f = (/* @__PURE__ */ new Date()).toISOString(), m = {
68
- ...g,
80
+ async createFeedback(p) {
81
+ const v = (/* @__PURE__ */ new Date()).toISOString(), h = {
82
+ ...p,
69
83
  id: crypto.randomUUID(),
70
84
  attachments: [],
71
- createdAt: f,
72
- updatedAt: f
85
+ createdAt: v,
86
+ updatedAt: v
73
87
  };
74
- return await p(
88
+ return await b(
75
89
  e.contentSpreadsheetId,
76
90
  `/values/${encodeURIComponent(t)}:append?valueInputOption=RAW`,
77
91
  {
78
92
  method: "POST",
79
- body: JSON.stringify({ values: [_e(m)] })
93
+ body: JSON.stringify({ values: [je(h)] })
80
94
  }
81
- ), m;
95
+ ), h;
82
96
  },
83
- async updateFeedback(g, f) {
84
- const m = await b(e.contentSpreadsheetId, t), S = m[0] ?? Pe, x = S.indexOf("id");
85
- if (x === -1)
97
+ async updateFeedback(p, v) {
98
+ const h = await A(e.contentSpreadsheetId, t), k = h[0] ?? _e, l = k.indexOf("id");
99
+ if (l === -1)
86
100
  throw new Error(`Sheet ${t} is missing an id column`);
87
- const E = m.findIndex((C, F) => F > 0 && C[x] === g);
88
- if (E < 1)
89
- throw new Error(`Feedback ${g} was not found`);
90
- const l = (/* @__PURE__ */ new Date()).toISOString(), A = je(Ke(S, m[E]));
91
- if (!A)
92
- throw new Error(`Feedback ${g} could not be parsed before updating`);
93
- const v = {
94
- ...A,
95
- ...f,
96
- updatedAt: l
97
- }, y = _e(v);
98
- return await p(
101
+ const C = h.findIndex((M, j) => j > 0 && M[l] === p);
102
+ if (C < 1)
103
+ throw new Error(`Feedback ${p} was not found`);
104
+ const f = (/* @__PURE__ */ new Date()).toISOString(), y = Ue(Oe(k, h[C]));
105
+ if (!y)
106
+ throw new Error(`Feedback ${p} could not be parsed before updating`);
107
+ const N = {
108
+ ...y,
109
+ ...v,
110
+ updatedAt: f
111
+ }, F = je(N);
112
+ return await b(
99
113
  e.contentSpreadsheetId,
100
- `/values/${encodeURIComponent(t)}!A${E + 1}:${Ft(
101
- Pe.length
102
- )}${E + 1}?valueInputOption=RAW`,
114
+ `/values/${encodeURIComponent(t)}!A${C + 1}:${It(
115
+ _e.length
116
+ )}${C + 1}?valueInputOption=RAW`,
103
117
  {
104
118
  method: "PUT",
105
- body: JSON.stringify({ values: [y] })
119
+ body: JSON.stringify({ values: [F] })
106
120
  }
107
- ), v;
121
+ ), N;
108
122
  },
109
- async listMessages(g) {
110
- return ue(await b(e.contentSpreadsheetId, n)).map(kt).filter((m) => m !== null).filter((m) => m.feedbackId === g).sort((m, S) => m.createdAt.localeCompare(S.createdAt));
123
+ async listMessages(p) {
124
+ return ue(await A(e.contentSpreadsheetId, n)).map(Ct).filter((h) => h !== null).filter((h) => h.feedbackId === p).sort((h, k) => h.createdAt.localeCompare(k.createdAt));
111
125
  },
112
- async createMessage(g) {
113
- const f = {
114
- ...g,
126
+ async createMessage(p) {
127
+ const v = {
128
+ ...p,
115
129
  id: crypto.randomUUID(),
116
130
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
117
131
  };
118
- return await p(
132
+ return await b(
119
133
  e.contentSpreadsheetId,
120
134
  `/values/${encodeURIComponent(n)}:append?valueInputOption=RAW`,
121
135
  {
122
136
  method: "POST",
123
- body: JSON.stringify({ values: [St(f)] })
137
+ body: JSON.stringify({ values: [Nt(v)] })
124
138
  }
125
- ), f;
139
+ ), v;
126
140
  },
127
- async sendEmail(g) {
128
- if (!e.enableEmailNotifications || g.to.length === 0)
141
+ async sendEmail(p) {
142
+ if (!e.enableEmailNotifications || p.to.length === 0)
129
143
  return;
130
- const f = await w(), m = await this.getCurrentUser(), S = await fetch(bt, {
144
+ const v = await g(), h = await this.getCurrentUser(), k = await fetch(bt, {
131
145
  method: "POST",
132
146
  headers: {
133
- Authorization: `Bearer ${f}`,
147
+ Authorization: `Bearer ${v}`,
134
148
  "Content-Type": "application/json"
135
149
  },
136
150
  body: JSON.stringify({
137
- raw: It({
138
- from: m.email,
139
- to: g.to,
140
- subject: g.subject,
141
- text: g.text
151
+ raw: _t({
152
+ from: h.email,
153
+ to: p.to,
154
+ subject: p.subject,
155
+ text: p.text
142
156
  })
143
157
  })
144
158
  });
145
- if (!S.ok)
146
- throw new Error(`Gmail send request failed with ${S.status}`);
159
+ if (!k.ok)
160
+ throw new Error(`Gmail send request failed with ${k.status}`);
147
161
  }
148
162
  };
163
+ async function L() {
164
+ const p = await fetch(Pe, {
165
+ headers: { Authorization: `Bearer ${await g()}` }
166
+ });
167
+ if (p.status === 401) {
168
+ De(c), u = void 0;
169
+ const h = await fetch(Pe, {
170
+ headers: { Authorization: `Bearer ${await g()}` }
171
+ });
172
+ if (!h.ok)
173
+ throw new Error(`Google userinfo request failed with ${h.status}`);
174
+ return (await h.json()).email;
175
+ }
176
+ if (!p.ok)
177
+ throw new Error(`Google userinfo request failed with ${p.status}`);
178
+ return (await p.json()).email;
179
+ }
149
180
  }
150
- const Pe = [
181
+ const _e = [
151
182
  "id",
152
183
  "projectKey",
153
184
  "contentId",
@@ -176,8 +207,8 @@ const Pe = [
176
207
  "fixedBy",
177
208
  "resolvedAt",
178
209
  "resolvedBy"
179
- ], yt = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
180
- function _e(e) {
210
+ ], xt = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
211
+ function je(e) {
181
212
  return [
182
213
  e.id,
183
214
  e.projectKey,
@@ -209,17 +240,17 @@ function _e(e) {
209
240
  e.resolvedBy ?? ""
210
241
  ];
211
242
  }
212
- function St(e) {
213
- return yt.map((t) => e[t]);
243
+ function Nt(e) {
244
+ return xt.map((t) => e[t]);
214
245
  }
215
246
  function ue(e) {
216
247
  const [t, ...n] = e;
217
- return t ? n.map((r) => Ke(t, r)) : [];
248
+ return t ? n.map((r) => Oe(t, r)) : [];
218
249
  }
219
- function Ke(e, t) {
250
+ function Oe(e, t) {
220
251
  return Object.fromEntries(e.map((n, r) => [n, t[r] ?? ""]));
221
252
  }
222
- function je(e) {
253
+ function Ue(e) {
223
254
  return e.id ? {
224
255
  id: e.id,
225
256
  projectKey: e.projectKey,
@@ -233,16 +264,16 @@ function je(e) {
233
264
  width: 0,
234
265
  height: 0
235
266
  }),
236
- createdCssSnapshot: Ue(e.createdCssSnapshotJson),
237
- fixedCssSnapshot: e.fixedCssSnapshotJson ? Ue(e.fixedCssSnapshotJson) : void 0,
267
+ createdCssSnapshot: We(e.createdCssSnapshotJson),
268
+ fixedCssSnapshot: e.fixedCssSnapshotJson ? We(e.fixedCssSnapshotJson) : void 0,
238
269
  comment: e.comment,
239
- status: Ct(e.status),
240
- severity: xt(e.severity),
241
- category: Et(e.category),
270
+ status: Lt(e.status),
271
+ severity: At(e.severity),
272
+ category: Ft(e.category),
242
273
  assigneeEmail: e.assigneeEmail || void 0,
243
274
  viewportWidth: Number(e.viewportWidth) || 0,
244
275
  viewportHeight: Number(e.viewportHeight) || 0,
245
- viewportPreset: Lt(e.viewportPreset),
276
+ viewportPreset: Rt(e.viewportPreset),
246
277
  screenshotUrl: e.screenshotUrl || void 0,
247
278
  screenshotThumbnailUrl: e.screenshotThumbnailUrl || void 0,
248
279
  attachments: fe(e.attachmentJson, []),
@@ -255,7 +286,7 @@ function je(e) {
255
286
  resolvedBy: e.resolvedBy || void 0
256
287
  } : null;
257
288
  }
258
- function kt(e) {
289
+ function Ct(e) {
259
290
  return !e.id || !e.feedbackId ? null : {
260
291
  id: e.id,
261
292
  feedbackId: e.feedbackId,
@@ -271,7 +302,7 @@ function fe(e, t) {
271
302
  return t;
272
303
  }
273
304
  }
274
- function Ue(e) {
305
+ function We(e) {
275
306
  const t = fe(e, {});
276
307
  return {
277
308
  margin: t.margin ?? "",
@@ -299,22 +330,22 @@ function Ue(e) {
299
330
  height: t.height ?? 0
300
331
  };
301
332
  }
302
- function Nt(e) {
333
+ function Et(e) {
303
334
  return e === "admin" ? ["create", "read", "reply", "update", "assign"] : e === "developer" ? ["read", "reply", "update", "assign"] : ["create", "read", "reply"];
304
335
  }
305
- function Ct(e) {
336
+ function Lt(e) {
306
337
  return e === "in_progress" || e === "needs_clarification" || e === "fixed" || e === "wontfix" || e === "resolved" ? e : "open";
307
338
  }
308
- function xt(e) {
339
+ function At(e) {
309
340
  return e === "low" || e === "high" ? e : "medium";
310
341
  }
311
- function Et(e) {
342
+ function Ft(e) {
312
343
  return e === "visual" || e === "copy" || e === "accessibility" || e === "responsive" ? e : "bug";
313
344
  }
314
- function Lt(e) {
345
+ function Rt(e) {
315
346
  return e === "mobile" || e === "tablet" || e === "desktop" ? e : "custom";
316
347
  }
317
- function Ft(e) {
348
+ function It(e) {
318
349
  let t = e, n = "";
319
350
  for (; t > 0; ) {
320
351
  const r = (t - 1) % 26;
@@ -322,24 +353,58 @@ function Ft(e) {
322
353
  }
323
354
  return n;
324
355
  }
325
- async function At(e, t) {
326
- return await Rt(), new Promise((n, r) => {
356
+ async function Tt(e, t) {
357
+ return await Pt(), new Promise((n, r) => {
327
358
  var c;
328
- const s = (c = window.google) == null ? void 0 : c.accounts.oauth2.initTokenClient({
359
+ const o = (c = window.google) == null ? void 0 : c.accounts.oauth2.initTokenClient({
329
360
  client_id: e,
330
361
  scope: t,
331
- callback: (h) => {
332
- if (h.error || !h.access_token) {
333
- r(new Error(h.error ?? "Google OAuth did not return an access token"));
362
+ callback: (u) => {
363
+ if (u.error || !u.access_token) {
364
+ r(new Error(u.error ?? "Google OAuth did not return an access token"));
334
365
  return;
335
366
  }
336
- n(h.access_token);
367
+ const w = u.expires_in ?? 3600;
368
+ n({
369
+ accessToken: u.access_token,
370
+ expiresAt: Date.now() + w * 1e3
371
+ });
337
372
  }
338
373
  });
339
- s == null || s.requestAccessToken({ prompt: "" });
374
+ o == null || o.requestAccessToken({ prompt: "" });
340
375
  });
341
376
  }
342
- function Rt() {
377
+ function $t(e, t) {
378
+ return `${yt}:${e}:${t}`;
379
+ }
380
+ function Mt(e) {
381
+ try {
382
+ const t = window.localStorage.getItem(e);
383
+ if (!t)
384
+ return;
385
+ const n = JSON.parse(t);
386
+ if (typeof n.accessToken != "string" || typeof n.expiresAt != "number" || Date.now() >= n.expiresAt - kt) {
387
+ window.localStorage.removeItem(e);
388
+ return;
389
+ }
390
+ return n;
391
+ } catch {
392
+ return;
393
+ }
394
+ }
395
+ function Bt(e, t) {
396
+ try {
397
+ window.localStorage.setItem(e, JSON.stringify(t));
398
+ } catch {
399
+ }
400
+ }
401
+ function De(e) {
402
+ try {
403
+ window.localStorage.removeItem(e);
404
+ } catch {
405
+ }
406
+ }
407
+ function Pt() {
343
408
  var e;
344
409
  return (e = window.google) != null && e.accounts.oauth2 ? Promise.resolve() : new Promise((t, n) => {
345
410
  const r = document.querySelector(
@@ -351,11 +416,11 @@ function Rt() {
351
416
  });
352
417
  return;
353
418
  }
354
- const s = document.createElement("script");
355
- s.src = "https://accounts.google.com/gsi/client", s.async = !0, s.defer = !0, s.onload = () => t(), s.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(s);
419
+ const o = document.createElement("script");
420
+ o.src = "https://accounts.google.com/gsi/client", o.async = !0, o.defer = !0, o.onload = () => t(), o.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(o);
356
421
  });
357
422
  }
358
- function It(e) {
423
+ function _t(e) {
359
424
  const t = [
360
425
  `From: ${e.from}`,
361
426
  `To: ${e.to.join(", ")}`,
@@ -365,26 +430,26 @@ function It(e) {
365
430
  e.text
366
431
  ].join(`\r
367
432
  `);
368
- return Mt(t);
433
+ return jt(t);
369
434
  }
370
- function Mt(e) {
435
+ function jt(e) {
371
436
  const t = new TextEncoder().encode(e);
372
437
  let n = "";
373
438
  return t.forEach((r) => {
374
439
  n += String.fromCharCode(r);
375
440
  }), btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
376
441
  }
377
- function $t(e) {
442
+ function Ut(e) {
378
443
  return new URL(e, window.location.href).pathname.replace(/\/+$/, "") || "/";
379
444
  }
380
- const Je = mt(null);
381
- function wn({ config: e, children: t }) {
382
- const n = se(() => e.adapter ? e.adapter : vt({
445
+ const Ge = gt(null);
446
+ function xn({ config: e, children: t }) {
447
+ const n = oe(() => e.adapter ? e.adapter : St({
383
448
  googleClientId: me(e.googleClientId, "googleClientId"),
384
449
  contentSpreadsheetId: me(e.contentSpreadsheetId, "contentSpreadsheetId"),
385
450
  usersSpreadsheetId: me(e.usersSpreadsheetId, "usersSpreadsheetId"),
386
451
  feedbackSheetName: e.sheetName ?? "Feedback",
387
- enableEmailNotifications: Oe(e)
452
+ enableEmailNotifications: qe(e)
388
453
  }), [
389
454
  e.adapter,
390
455
  e.contentSpreadsheetId,
@@ -392,106 +457,106 @@ function wn({ config: e, children: t }) {
392
457
  e.googleClientId,
393
458
  e.sheetName,
394
459
  e.usersSpreadsheetId
395
- ]), r = e.currentUrl ?? window.location.href, s = (e.normalizeUrl ?? $t)(r), [c, h] = N(), [w, p] = N([]), [b, g] = N([]), f = W(async () => {
396
- const v = await n.listFeedback({
460
+ ]), r = e.currentUrl ?? window.location.href, o = (e.normalizeUrl ?? Ut)(r), [c, u] = x(), [w, g] = x([]), [b, A] = x([]), L = D(async () => {
461
+ const f = await n.listFeedback({
397
462
  projectKey: e.projectKey,
398
463
  contentId: e.contentId,
399
- normalizedPath: s
464
+ normalizedPath: o
400
465
  });
401
- g(v);
402
- }, [n, e.contentId, e.projectKey, s]);
403
- B(() => {
404
- let v = !0;
466
+ A(f);
467
+ }, [n, e.contentId, e.projectKey, o]);
468
+ P(() => {
469
+ let f = !0;
405
470
  async function y() {
406
- const [C, F] = await Promise.all([
471
+ const [N, F] = await Promise.all([
407
472
  n.getCurrentUser(),
408
473
  n.getPermissions(e.projectKey)
409
474
  ]);
410
- v && (h(C), p(F), await f());
475
+ f && (u(N), g(F), await L());
411
476
  }
412
477
  return y(), () => {
413
- v = !1;
478
+ f = !1;
414
479
  };
415
- }, [n, e.projectKey, f]);
416
- const m = W(
417
- async (v) => {
418
- const y = await n.createFeedback(v);
419
- return g((C) => [y, ...C]), pe(e, n, {
420
- actorEmail: (c == null ? void 0 : c.email) ?? v.authorEmail,
480
+ }, [n, e.projectKey, L]);
481
+ const p = D(
482
+ async (f) => {
483
+ const y = await n.createFeedback(f);
484
+ return A((N) => [y, ...N]), pe(e, n, {
485
+ actorEmail: (c == null ? void 0 : c.email) ?? f.authorEmail,
421
486
  item: y,
422
487
  kind: "created"
423
488
  }), y;
424
489
  },
425
490
  [n, e, c == null ? void 0 : c.email]
426
- ), S = W(
427
- async (v, y) => {
428
- const C = b.find((_) => _.id === v), F = await n.updateFeedback(v, y);
429
- return g(
430
- (_) => _.map((H) => H.id === v ? F : H)
491
+ ), v = D(
492
+ async (f, y) => {
493
+ const N = b.find((M) => M.id === f), F = await n.updateFeedback(f, y);
494
+ return A(
495
+ (M) => M.map((j) => j.id === f ? F : j)
431
496
  ), pe(e, n, {
432
497
  actorEmail: c == null ? void 0 : c.email,
433
498
  item: F,
434
- kind: Bt(y),
435
- previousItem: C
499
+ kind: Dt(y),
500
+ previousItem: N
436
501
  }), F;
437
502
  },
438
503
  [n, e, c == null ? void 0 : c.email, b]
439
- ), x = W(
440
- (v) => n.listMessages(v),
504
+ ), h = D(
505
+ (f) => n.listMessages(f),
441
506
  [n]
442
- ), E = W(
443
- async (v) => {
444
- const y = await n.createMessage(v), C = b.find((F) => F.id === v.feedbackId);
445
- return C && pe(e, n, {
446
- actorEmail: v.authorEmail,
447
- item: C,
507
+ ), k = D(
508
+ async (f) => {
509
+ const y = await n.createMessage(f), N = b.find((F) => F.id === f.feedbackId);
510
+ return N && pe(e, n, {
511
+ actorEmail: f.authorEmail,
512
+ item: N,
448
513
  kind: "reply",
449
- replyBody: v.body
514
+ replyBody: f.body
450
515
  }), y;
451
516
  },
452
517
  [n, e, b]
453
- ), l = W(
454
- async (v, y) => {
455
- const C = e.uploadAttachment ?? n.uploadAttachment;
456
- if (!C)
518
+ ), l = D(
519
+ async (f, y) => {
520
+ const N = e.uploadAttachment ?? n.uploadAttachment;
521
+ if (!N)
457
522
  throw new Error("Review Lens attachment upload is not configured");
458
- return C(v, y);
523
+ return N(f, y);
459
524
  },
460
525
  [n, e]
461
- ), A = se(
526
+ ), C = oe(
462
527
  () => ({
463
528
  config: e,
464
529
  adapter: n,
465
530
  currentUser: c,
466
531
  permissions: w,
467
532
  feedback: b,
468
- normalizedPath: s,
469
- refreshFeedback: f,
470
- createFeedback: m,
471
- updateFeedback: S,
472
- listMessages: x,
473
- createMessage: E,
533
+ normalizedPath: o,
534
+ refreshFeedback: L,
535
+ createFeedback: p,
536
+ updateFeedback: v,
537
+ listMessages: h,
538
+ createMessage: k,
474
539
  uploadAttachment: l
475
540
  }),
476
541
  [
477
542
  n,
478
543
  e,
479
- m,
544
+ p,
480
545
  c,
481
546
  b,
482
- s,
547
+ o,
483
548
  w,
484
- f,
485
- S,
486
- x,
487
- E,
549
+ L,
550
+ v,
551
+ h,
552
+ k,
488
553
  l
489
554
  ]
490
555
  );
491
- return /* @__PURE__ */ i(Je.Provider, { value: A, children: t });
556
+ return /* @__PURE__ */ i(Ge.Provider, { value: C, children: t });
492
557
  }
493
- function Tt() {
494
- const e = pt(Je);
558
+ function Wt() {
559
+ const e = ft(Ge);
495
560
  if (!e)
496
561
  throw new Error("useReviewLens must be used inside ReviewLensProvider");
497
562
  return e;
@@ -501,60 +566,60 @@ function me(e, t) {
501
566
  throw new Error(`review-lens-react requires config.${t} when no adapter is provided`);
502
567
  return e;
503
568
  }
504
- function Oe(e) {
569
+ function qe(e) {
505
570
  return typeof e.emailNotifications == "object" ? e.emailNotifications.enabled !== !1 : !!e.emailNotifications;
506
571
  }
507
- function Bt(e) {
572
+ function Dt(e) {
508
573
  return e.status === "resolved" ? "resolved" : e.status === "fixed" || e.fixedAt || e.fixedBy ? "fixed" : e.status ? "status" : "assigneeEmail" in e ? "assigned" : "updated";
509
574
  }
510
575
  async function pe(e, t, n) {
511
- if (!Oe(e) || !t.sendEmail)
576
+ if (!qe(e) || !t.sendEmail)
512
577
  return;
513
- const r = Pt(n);
578
+ const r = zt(n);
514
579
  if (r.length !== 0)
515
580
  try {
516
581
  await t.sendEmail({
517
582
  to: r,
518
- subject: _t(e, n),
519
- text: jt(n)
583
+ subject: Ht(e, n),
584
+ text: Kt(n)
520
585
  });
521
- } catch (s) {
522
- console.warn("Review Lens email notification failed", s);
586
+ } catch (o) {
587
+ console.warn("Review Lens email notification failed", o);
523
588
  }
524
589
  }
525
- function Pt(e) {
590
+ function zt(e) {
526
591
  var n;
527
592
  const t = /* @__PURE__ */ new Set();
528
593
  return t.add(e.item.authorEmail), (n = e.previousItem) != null && n.assigneeEmail && t.add(e.previousItem.assigneeEmail), e.item.assigneeEmail && t.add(e.item.assigneeEmail), [...t].filter((r) => {
529
- var s;
530
- return r ? r.toLowerCase() !== ((s = e.actorEmail) == null ? void 0 : s.toLowerCase()) : !1;
594
+ var o;
595
+ return r ? r.toLowerCase() !== ((o = e.actorEmail) == null ? void 0 : o.toLowerCase()) : !1;
531
596
  });
532
597
  }
533
- function _t(e, t) {
534
- return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${qe(t)}`;
598
+ function Ht(e, t) {
599
+ return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${Ve(t)}`;
535
600
  }
536
- function jt(e) {
601
+ function Kt(e) {
537
602
  const t = [
538
603
  "[Review Lens]",
539
- qe(e),
540
- Ut(e),
604
+ Ve(e),
605
+ Jt(e),
541
606
  "",
542
607
  `Review: ${e.item.comment}`,
543
- `Status: ${Ve(e.item.status)}`,
608
+ `Status: ${Ye(e.item.status)}`,
544
609
  `Author: ${e.item.authorEmail}`,
545
610
  `Assignee: ${e.item.assigneeEmail ?? "Unassigned"}`,
546
- `Link: ${Wt(e.item)}`
611
+ `Link: ${Ot(e.item)}`
547
612
  ];
548
613
  return e.replyBody && t.splice(2, 0, `Reply: ${e.replyBody}`, ""), t.join(`
549
614
  `);
550
615
  }
551
- function Ut(e) {
616
+ function Jt(e) {
552
617
  return e.actorEmail ? `Sent by Review Lens on behalf of ${e.actorEmail}.` : "Sent by Review Lens on behalf of the signed-in Google user.";
553
618
  }
554
- function qe(e) {
555
- return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${Ve(e.item.status)}` : e.kind === "fixed" ? "Review marked fixed" : e.kind === "resolved" ? "Review resolved" : e.kind === "reply" ? "New review reply" : "Review updated";
619
+ function Ve(e) {
620
+ return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${Ye(e.item.status)}` : e.kind === "fixed" ? "Review marked fixed" : e.kind === "resolved" ? "Review resolved" : e.kind === "reply" ? "New review reply" : "Review updated";
556
621
  }
557
- function Wt(e) {
622
+ function Ot(e) {
558
623
  try {
559
624
  const t = new URL(e.originalUrl);
560
625
  return t.searchParams.set("reviewLensFeedback", e.id), t.toString();
@@ -562,10 +627,10 @@ function Wt(e) {
562
627
  return e.originalUrl;
563
628
  }
564
629
  }
565
- function Ve(e) {
630
+ function Ye(e) {
566
631
  return e.replace(/_/g, " ");
567
632
  }
568
- const Dt = [
633
+ const Gt = [
569
634
  "data-review-id",
570
635
  "data-testid",
571
636
  "data-test-id",
@@ -573,43 +638,43 @@ const Dt = [
573
638
  "name"
574
639
  ];
575
640
  function Q(e) {
576
- const t = e.getBoundingClientRect(), n = zt(e);
641
+ const t = e.getBoundingClientRect(), n = qt(e);
577
642
  return {
578
643
  selector: n.selector,
579
644
  selectorStrategy: n.strategy,
580
- fingerprint: Kt(e, t),
581
- cssSnapshot: Jt(e, t),
645
+ fingerprint: Yt(e, t),
646
+ cssSnapshot: Xt(e, t),
582
647
  rect: t
583
648
  };
584
649
  }
585
- function zt(e) {
586
- for (const t of Dt) {
650
+ function qt(e) {
651
+ for (const t of Gt) {
587
652
  const n = e.getAttribute(t);
588
653
  if (n)
589
654
  return {
590
- selector: `[${t}="${We(n)}"]`,
655
+ selector: `[${t}="${ze(n)}"]`,
591
656
  strategy: "stable-attribute"
592
657
  };
593
658
  }
594
- return e.id ? { selector: `#${We(e.id)}`, strategy: "stable-attribute" } : { selector: Ht(e), strategy: "css-path" };
659
+ return e.id ? { selector: `#${ze(e.id)}`, strategy: "stable-attribute" } : { selector: Vt(e), strategy: "css-path" };
595
660
  }
596
- function Ht(e) {
661
+ function Vt(e) {
597
662
  const t = [];
598
663
  let n = e;
599
664
  for (; n && n.nodeType === Node.ELEMENT_NODE && n !== document.body; ) {
600
- const r = n.parentElement, s = n.tagName.toLowerCase();
665
+ const r = n.parentElement, o = n.tagName.toLowerCase();
601
666
  if (!r) {
602
- t.unshift(s);
667
+ t.unshift(o);
603
668
  break;
604
669
  }
605
- const c = n.tagName, h = Array.from(r.children).filter(
606
- (p) => p.tagName === c
607
- ), w = h.indexOf(n) + 1;
608
- t.unshift(h.length > 1 ? `${s}:nth-of-type(${w})` : s), n = r;
670
+ const c = n.tagName, u = Array.from(r.children).filter(
671
+ (g) => g.tagName === c
672
+ ), w = u.indexOf(n) + 1;
673
+ t.unshift(u.length > 1 ? `${o}:nth-of-type(${w})` : o), n = r;
609
674
  }
610
675
  return t.join(" > ");
611
676
  }
612
- function Kt(e, t) {
677
+ function Yt(e, t) {
613
678
  var n;
614
679
  return {
615
680
  tagName: e.tagName.toLowerCase(),
@@ -621,7 +686,7 @@ function Kt(e, t) {
621
686
  height: Math.round(t.height)
622
687
  };
623
688
  }
624
- function Jt(e, t) {
689
+ function Xt(e, t) {
625
690
  const n = window.getComputedStyle(e);
626
691
  return {
627
692
  margin: ge(n.marginTop, n.marginRight, n.marginBottom, n.marginLeft),
@@ -662,11 +727,11 @@ function Jt(e, t) {
662
727
  function ge(e, t, n, r) {
663
728
  return e === t && t === n && n === r ? e : `${e} ${t} ${n} ${r}`;
664
729
  }
665
- function We(e) {
730
+ function ze(e) {
666
731
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&");
667
732
  }
668
- function Ot({ className: e, title: t = "Review Lens logo" }) {
669
- return /* @__PURE__ */ o(
733
+ function Qt({ className: e, title: t = "Review Lens logo" }) {
734
+ return /* @__PURE__ */ s(
670
735
  "svg",
671
736
  {
672
737
  className: e,
@@ -702,18 +767,18 @@ function Ot({ className: e, title: t = "Review Lens logo" }) {
702
767
  }
703
768
  );
704
769
  }
705
- const qt = [
770
+ const Zt = [
706
771
  { label: "Desktop", value: "desktop" },
707
772
  { label: "Tablet", value: "tablet" },
708
773
  { label: "Mobile", value: "mobile" }
709
- ], Ge = [
774
+ ], Xe = [
710
775
  "open",
711
776
  "in_progress",
712
777
  "needs_clarification",
713
778
  "fixed",
714
779
  "wontfix",
715
780
  "resolved"
716
- ], Ye = ["low", "medium", "high"], Xe = ["bug", "visual", "copy", "accessibility", "responsive"], oe = {
781
+ ], Qe = ["low", "medium", "high"], Ze = ["bug", "visual", "copy", "accessibility", "responsive"], se = {
717
782
  open: "Open",
718
783
  in_progress: "In progress",
719
784
  needs_clarification: "Needs clarification",
@@ -731,156 +796,156 @@ const qt = [
731
796
  accessibility: "Accessibility",
732
797
  responsive: "Responsive"
733
798
  };
734
- function bn({
799
+ function Nn({
735
800
  open: e,
736
801
  onOpenChange: t,
737
802
  placement: n = "top-right",
738
803
  showResolved: r = !1,
739
- syncSelectionToUrl: s = !1,
740
- responsivePresets: c = qt
804
+ syncSelectionToUrl: o = !1,
805
+ responsivePresets: c = Zt
741
806
  }) {
742
- var Te;
807
+ var Me;
743
808
  const {
744
- adapter: h,
809
+ adapter: u,
745
810
  config: w,
746
- currentUser: p,
811
+ currentUser: g,
747
812
  feedback: b,
748
- normalizedPath: g,
749
- permissions: f,
750
- createFeedback: m,
751
- updateFeedback: S,
752
- listMessages: x,
753
- createMessage: E,
813
+ normalizedPath: A,
814
+ permissions: L,
815
+ createFeedback: p,
816
+ updateFeedback: v,
817
+ listMessages: h,
818
+ createMessage: k,
754
819
  uploadAttachment: l
755
- } = Tt(), [A, v] = N(), [y, C] = N(), [F, _] = N(""), [H, Ze] = N("medium"), [we, et] = N("visual"), [be, ve] = N(""), [ye, tt] = N(
756
- ((Te = c[0]) == null ? void 0 : Te.value) ?? "desktop"
757
- ), [k, K] = N(), [M, P] = N("review"), [nt, Se] = N(!1), [J, ke] = N("all"), [O, Ne] = N("all"), [q, Ce] = N("all"), [V, xe] = N("all"), [G, Ee] = N("all"), [it, rt] = N(!1), [at, Le] = N({}), [le, de] = N(""), te = re(null), Fe = re(e), ce = re(
758
- s ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
759
- ), $ = !!p, T = f.includes("create"), Ae = f.includes("reply"), Re = f.includes("update"), st = f.includes("assign"), j = A ?? y, ot = !!y, lt = !!(w.captureScreenshot && (w.uploadAttachment || h.uploadAttachment)), dt = se(() => {
760
- const a = b.map((u) => u.assigneeEmail).filter((u) => !!u);
761
- return p != null && p.email && a.push(p.email), Array.from(new Set(a)).sort((u, d) => u.localeCompare(d));
762
- }, [p == null ? void 0 : p.email, b]), R = se(
763
- () => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) => q === "all" || a.category === q).filter((a) => V === "all" || a.assigneeEmail === V).filter((a) => G === "all" || a.viewportPreset === G),
820
+ } = Wt(), [C, f] = x(), [y, N] = x(), [F, M] = x(""), [j, tt] = x("medium"), [we, nt] = x("visual"), [ve, be] = x(""), [ye, it] = x(
821
+ ((Me = c[0]) == null ? void 0 : Me.value) ?? "desktop"
822
+ ), [S, K] = x(), [T, _] = x("review"), [rt, ke] = x(!1), [J, Se] = x("all"), [O, xe] = x("all"), [G, Ne] = x("all"), [q, Ce] = x("all"), [V, Ee] = x("all"), [at, ot] = x(!1), [st, Le] = x({}), [le, ce] = x(""), te = re(null), Ae = re(e), de = re(
823
+ o ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
824
+ ), $ = !!g, B = L.includes("create"), Fe = L.includes("reply"), Re = L.includes("update"), lt = L.includes("assign"), U = C ?? y, ct = !!y, dt = !!(w.captureScreenshot && (w.uploadAttachment || u.uploadAttachment)), ht = oe(() => {
825
+ const a = b.map((m) => m.assigneeEmail).filter((m) => !!m);
826
+ return g != null && g.email && a.push(g.email), Array.from(new Set(a)).sort((m, d) => m.localeCompare(d));
827
+ }, [g == null ? void 0 : g.email, b]), R = oe(
828
+ () => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) => G === "all" || a.category === G).filter((a) => q === "all" || a.assigneeEmail === q).filter((a) => V === "all" || a.viewportPreset === V),
764
829
  [
765
- V,
766
830
  q,
831
+ G,
767
832
  b,
768
833
  O,
769
834
  r,
770
835
  J,
771
- G
836
+ V
772
837
  ]
773
- ), ct = [
838
+ ), ut = [
774
839
  J,
775
840
  O,
841
+ G,
776
842
  q,
777
- V,
778
- G
843
+ V
779
844
  ].filter((a) => a !== "all").length;
780
- B(() => {
845
+ P(() => {
781
846
  if (e) {
782
- Fe.current = !0;
847
+ Ae.current = !0;
783
848
  return;
784
849
  }
785
- if (v(void 0), C(void 0), _(""), de(""), P("review"), s && Fe.current) {
850
+ if (f(void 0), N(void 0), M(""), ce(""), _("review"), o && Ae.current) {
786
851
  const a = new URL(window.location.href);
787
852
  a.searchParams.has("reviewLensFeedback") && (a.searchParams.delete("reviewLensFeedback"), window.history.replaceState({}, "", a));
788
853
  }
789
- }, [e, s]), B(() => {
790
- $ || (v(void 0), C(void 0));
791
- }, [$]), B(() => {
792
- !y || M !== "review" || window.requestAnimationFrame(() => {
793
- var a, u, d;
794
- (u = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || u.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
854
+ }, [e, o]), P(() => {
855
+ $ || (f(void 0), N(void 0));
856
+ }, [$]), P(() => {
857
+ !y || T !== "review" || window.requestAnimationFrame(() => {
858
+ var a, m, d;
859
+ (m = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || m.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
795
860
  });
796
- }, [y, M]), B(() => {
797
- if (!k)
861
+ }, [y, T]), P(() => {
862
+ if (!S)
798
863
  return;
799
864
  let a = !0;
800
- return x(k.id).then((u) => {
801
- a && Le((d) => ({ ...d, [k.id]: u }));
865
+ return h(S.id).then((m) => {
866
+ a && Le((d) => ({ ...d, [S.id]: m }));
802
867
  }), () => {
803
868
  a = !1;
804
869
  };
805
- }, [x, k]), B(() => {
806
- if (!s || !ce.current || b.length === 0)
870
+ }, [h, S]), P(() => {
871
+ if (!o || !de.current || b.length === 0)
807
872
  return;
808
- const a = b.find((u) => u.id === ce.current);
809
- a && (ce.current = null, t == null || t(!0), D(a, { syncUrl: !1 }));
810
- }, [b, s]), B(() => {
811
- if (!e || !s || k || b.length === 0)
873
+ const a = b.find((m) => m.id === de.current);
874
+ a && (de.current = null, t == null || t(!0), z(a, { syncUrl: !1 }));
875
+ }, [b, o]), P(() => {
876
+ if (!e || !o || S || b.length === 0)
812
877
  return;
813
- const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), u = b.find((d) => d.id === a);
814
- u && D(u, { syncUrl: !1 });
815
- }, [b, e, k, s]), B(() => {
878
+ const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), m = b.find((d) => d.id === a);
879
+ m && z(m, { syncUrl: !1 });
880
+ }, [b, e, S, o]), P(() => {
816
881
  if (!e)
817
882
  return;
818
883
  function a(d) {
819
- var L;
820
- if (d.key === "Shift" && Se(!0), d.key === "Escape") {
884
+ var E;
885
+ if (d.key === "Shift" && ke(!0), d.key === "Escape") {
821
886
  d.preventDefault(), t == null || t(!1);
822
887
  return;
823
888
  }
824
- hn(d.target) || ((d.key === "n" || d.key === "ArrowDown") && (d.preventDefault(), Ie(1)), (d.key === "p" || d.key === "ArrowUp") && (d.preventDefault(), Ie(-1)), d.key === "c" && (d.preventDefault(), P("review"), (L = te.current) == null || L.focus()), d.key === "f" && k && Re && (d.preventDefault(), $e(k)));
889
+ wn(d.target) || ((d.key === "n" || d.key === "ArrowDown") && (d.preventDefault(), Ie(1)), (d.key === "p" || d.key === "ArrowUp") && (d.preventDefault(), Ie(-1)), d.key === "c" && (d.preventDefault(), _("review"), (E = te.current) == null || E.focus()), d.key === "f" && S && Re && (d.preventDefault(), $e(S)));
825
890
  }
826
- function u(d) {
827
- d.key === "Shift" && Se(!1);
891
+ function m(d) {
892
+ d.key === "Shift" && ke(!1);
828
893
  }
829
- return window.addEventListener("keydown", a), window.addEventListener("keyup", u), () => {
830
- window.removeEventListener("keydown", a), window.removeEventListener("keyup", u);
894
+ return window.addEventListener("keydown", a), window.addEventListener("keyup", m), () => {
895
+ window.removeEventListener("keydown", a), window.removeEventListener("keyup", m);
831
896
  };
832
897
  });
833
- const he = W((a) => {
834
- const u = a.target instanceof Element ? a.target : null;
835
- if (u)
836
- return u.closest("[data-review-lens-ui]") ? null : u;
898
+ const he = D((a) => {
899
+ const m = a.target instanceof Element ? a.target : null;
900
+ if (m)
901
+ return m.closest("[data-review-lens-ui]") ? null : m;
837
902
  const d = document.elementFromPoint(a.clientX, a.clientY);
838
903
  return !d || d.closest("[data-review-lens-ui]") ? null : d;
839
904
  }, []);
840
- if (B(() => {
905
+ if (P(() => {
841
906
  if (!e || !$)
842
907
  return;
843
908
  function a(d) {
844
- const L = he(d);
845
- v(L ? Q(L) : void 0);
909
+ const E = he(d);
910
+ f(E ? Q(E) : void 0);
846
911
  }
847
- function u(d) {
848
- const L = he(d);
849
- L && (d.preventDefault(), d.stopPropagation(), C(Q(L)), P("review"));
912
+ function m(d) {
913
+ const E = he(d);
914
+ E && (d.preventDefault(), d.stopPropagation(), N(Q(E)), _("review"));
850
915
  }
851
- return window.addEventListener("mousemove", a, !0), window.addEventListener("click", u, !0), () => {
852
- window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", u, !0);
916
+ return window.addEventListener("mousemove", a, !0), window.addEventListener("click", m, !0), () => {
917
+ window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", m, !0);
853
918
  };
854
919
  }, [$, he, e]), !e)
855
920
  return null;
856
- function D(a, u = { syncUrl: !0 }) {
857
- var L;
858
- if (K(a), C(void 0), P("feedback"), s && u.syncUrl !== !1) {
921
+ function z(a, m = { syncUrl: !0 }) {
922
+ var E;
923
+ if (K(a), N(void 0), _("feedback"), o && m.syncUrl !== !1) {
859
924
  const ne = new URL(window.location.href);
860
925
  ne.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", ne);
861
926
  }
862
- const d = z(a.selector);
927
+ const d = H(a.selector);
863
928
  if (!d) {
864
- v(void 0);
929
+ f(void 0);
865
930
  return;
866
931
  }
867
- (L = d.scrollIntoView) == null || L.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
868
- v(Q(d));
932
+ (E = d.scrollIntoView) == null || E.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
933
+ f(Q(d));
869
934
  });
870
935
  }
871
936
  function Ie(a) {
872
937
  if (R.length === 0)
873
938
  return;
874
- const u = k ? R.findIndex((L) => L.id === k.id) : -1, d = u < 0 ? a > 0 ? 0 : R.length - 1 : (u + a + R.length) % R.length;
875
- D(R[d]);
939
+ const m = S ? R.findIndex((E) => E.id === S.id) : -1, d = m < 0 ? a > 0 ? 0 : R.length - 1 : (m + a + R.length) % R.length;
940
+ z(R[d]);
876
941
  }
877
- async function Me() {
878
- if (!y || !F.trim() || !p || !T)
942
+ async function Te() {
943
+ if (!y || !F.trim() || !g || !B)
879
944
  return;
880
- let a = await m({
945
+ let a = await p({
881
946
  projectKey: w.projectKey,
882
947
  contentId: w.contentId,
883
- normalizedPath: g,
948
+ normalizedPath: A,
884
949
  originalUrl: w.currentUrl ?? window.location.href,
885
950
  selector: y.selector,
886
951
  selectorStrategy: y.selectorStrategy,
@@ -888,115 +953,115 @@ function bn({
888
953
  createdCssSnapshot: y.cssSnapshot,
889
954
  comment: F.trim(),
890
955
  status: "open",
891
- severity: H,
956
+ severity: j,
892
957
  category: we,
893
- assigneeEmail: be.trim() || void 0,
958
+ assigneeEmail: ve.trim() || void 0,
894
959
  viewportWidth: window.innerWidth,
895
960
  viewportHeight: window.innerHeight,
896
961
  viewportPreset: ye,
897
962
  screenshotUrl: void 0,
898
963
  screenshotThumbnailUrl: void 0,
899
- authorEmail: p.email
964
+ authorEmail: g.email
900
965
  });
901
966
  if (w.captureScreenshot)
902
967
  try {
903
- const u = await w.captureScreenshot(y), d = await l(a.id, {
968
+ const m = await w.captureScreenshot(y), d = await l(a.id, {
904
969
  type: "screenshot",
905
- data: u,
906
- createdBy: p.email
970
+ data: m,
971
+ createdBy: g.email
907
972
  });
908
- a = await S(a.id, {
973
+ a = await v(a.id, {
909
974
  attachments: [d],
910
975
  screenshotUrl: d.url,
911
976
  screenshotThumbnailUrl: d.thumbnailUrl
912
977
  });
913
978
  } catch {
914
979
  }
915
- if (_(""), ve(""), C(void 0), v(void 0), P("feedback"), K(a), s) {
916
- const u = new URL(window.location.href);
917
- u.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", u);
980
+ if (M(""), be(""), N(void 0), f(void 0), _("feedback"), K(a), o) {
981
+ const m = new URL(window.location.href);
982
+ m.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", m);
918
983
  }
919
984
  }
920
- async function ht(a, u) {
921
- const d = (/* @__PURE__ */ new Date()).toISOString(), L = u === "resolved" ? { status: u, resolvedAt: d, resolvedBy: p == null ? void 0 : p.email } : { status: u }, ne = await S(a.id, L);
985
+ async function mt(a, m) {
986
+ const d = (/* @__PURE__ */ new Date()).toISOString(), E = m === "resolved" ? { status: m, resolvedAt: d, resolvedBy: g == null ? void 0 : g.email } : { status: m }, ne = await v(a.id, E);
922
987
  K(ne);
923
988
  }
924
989
  async function $e(a) {
925
- const u = z(a.selector);
926
- if (!u || !p)
990
+ const m = H(a.selector);
991
+ if (!m || !g)
927
992
  return;
928
- const d = Q(u), L = await S(a.id, {
993
+ const d = Q(m), E = await v(a.id, {
929
994
  status: "fixed",
930
995
  fixedCssSnapshot: d.cssSnapshot,
931
996
  fixedAt: (/* @__PURE__ */ new Date()).toISOString(),
932
- fixedBy: p.email
997
+ fixedBy: g.email
933
998
  });
934
- K(L);
999
+ K(E);
935
1000
  }
936
- async function ut(a) {
937
- if (!le.trim() || !p || !Ae)
1001
+ async function pt(a) {
1002
+ if (!le.trim() || !g || !Fe)
938
1003
  return;
939
- const u = await E({
1004
+ const m = await k({
940
1005
  feedbackId: a.id,
941
1006
  body: le.trim(),
942
- authorEmail: p.email
1007
+ authorEmail: g.email
943
1008
  });
944
1009
  Le((d) => ({
945
1010
  ...d,
946
- [a.id]: [...d[a.id] ?? [], u]
947
- })), de("");
1011
+ [a.id]: [...d[a.id] ?? [], m]
1012
+ })), ce("");
948
1013
  }
949
- return /* @__PURE__ */ o("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
950
- $ && j ? /* @__PURE__ */ i(Zt, { target: j, locked: !!y }) : null,
951
- $ && y && A && nt ? /* @__PURE__ */ i(en, { from: y, to: A }) : null,
952
- $ ? /* @__PURE__ */ o(ae, { children: [
1014
+ return /* @__PURE__ */ s("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
1015
+ $ && U ? /* @__PURE__ */ i(on, { target: U, locked: !!y }) : null,
1016
+ $ && y && C && rt ? /* @__PURE__ */ i(sn, { from: y, to: C }) : null,
1017
+ $ ? /* @__PURE__ */ s(ae, { children: [
953
1018
  /* @__PURE__ */ i(
954
- tn,
1019
+ ln,
955
1020
  {
956
1021
  feedback: R,
957
- selectedFeedback: k,
958
- onSelect: D
1022
+ selectedFeedback: S,
1023
+ onSelect: z
959
1024
  }
960
1025
  ),
961
1026
  /* @__PURE__ */ i(
962
- rn,
1027
+ dn,
963
1028
  {
964
1029
  feedback: R,
965
- selectedFeedback: k,
966
- onSelect: D
1030
+ selectedFeedback: S,
1031
+ onSelect: z
967
1032
  }
968
1033
  )
969
1034
  ] }) : null,
970
- /* @__PURE__ */ o("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
971
- /* @__PURE__ */ o("header", { className: "review-lens-panel__header", children: [
972
- /* @__PURE__ */ o("div", { className: "review-lens-brand", children: [
973
- /* @__PURE__ */ i(Ot, { className: "review-lens-brand__mark" }),
974
- /* @__PURE__ */ o("div", { children: [
1035
+ /* @__PURE__ */ s("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
1036
+ /* @__PURE__ */ s("header", { className: "review-lens-panel__header", children: [
1037
+ /* @__PURE__ */ s("div", { className: "review-lens-brand", children: [
1038
+ /* @__PURE__ */ i(Qt, { className: "review-lens-brand__mark" }),
1039
+ /* @__PURE__ */ s("div", { children: [
975
1040
  /* @__PURE__ */ i("p", { className: "review-lens-kicker", children: "Review Lens" }),
976
- /* @__PURE__ */ i("h2", { children: M === "summary" ? "Summary" : M === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
1041
+ /* @__PURE__ */ i("h2", { children: T === "summary" ? "Summary" : T === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
977
1042
  ] })
978
1043
  ] }),
979
1044
  /* @__PURE__ */ i("button", { type: "button", onClick: () => t == null ? void 0 : t(!1), children: "Close" })
980
1045
  ] }),
981
- /* @__PURE__ */ o("div", { className: "review-lens-panel__body", children: [
982
- /* @__PURE__ */ o("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
1046
+ /* @__PURE__ */ s("div", { className: "review-lens-panel__body", children: [
1047
+ /* @__PURE__ */ s("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
983
1048
  /* @__PURE__ */ i(
984
1049
  "button",
985
1050
  {
986
1051
  type: "button",
987
1052
  role: "tab",
988
- "aria-selected": M === "review",
989
- onClick: () => P("review"),
1053
+ "aria-selected": T === "review",
1054
+ onClick: () => _("review"),
990
1055
  children: "Review"
991
1056
  }
992
1057
  ),
993
- /* @__PURE__ */ o(
1058
+ /* @__PURE__ */ s(
994
1059
  "button",
995
1060
  {
996
1061
  type: "button",
997
1062
  role: "tab",
998
- "aria-selected": M === "feedback",
999
- onClick: () => P("feedback"),
1063
+ "aria-selected": T === "feedback",
1064
+ onClick: () => _("feedback"),
1000
1065
  children: [
1001
1066
  "Feedback ",
1002
1067
  /* @__PURE__ */ i("span", { children: R.length })
@@ -1008,34 +1073,34 @@ function bn({
1008
1073
  {
1009
1074
  type: "button",
1010
1075
  role: "tab",
1011
- "aria-selected": M === "summary",
1012
- onClick: () => P("summary"),
1076
+ "aria-selected": T === "summary",
1077
+ onClick: () => _("summary"),
1013
1078
  children: "Summary"
1014
1079
  }
1015
1080
  )
1016
1081
  ] }),
1017
- M === "review" ? /* @__PURE__ */ o("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
1018
- /* @__PURE__ */ o("div", { className: "review-lens-inspection", children: [
1082
+ T === "review" ? /* @__PURE__ */ s("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
1083
+ /* @__PURE__ */ s("div", { className: "review-lens-inspection", children: [
1019
1084
  $ ? null : /* @__PURE__ */ i("p", { children: "Authenticate with Google to inspect this page." }),
1020
- $ && j ? /* @__PURE__ */ o(ae, { children: [
1021
- /* @__PURE__ */ i(an, { target: j }),
1022
- /* @__PURE__ */ i(De, { title: "Accessibility", items: sn(j) }),
1085
+ $ && U ? /* @__PURE__ */ s(ae, { children: [
1086
+ /* @__PURE__ */ i(hn, { target: U }),
1087
+ /* @__PURE__ */ i(He, { title: "Accessibility", items: un(U) }),
1023
1088
  /* @__PURE__ */ i(
1024
- De,
1089
+ He,
1025
1090
  {
1026
1091
  title: "Design tokens",
1027
- items: on(j.cssSnapshot, w.designTokens)
1092
+ items: mn(U.cssSnapshot, w.designTokens)
1028
1093
  }
1029
1094
  )
1030
1095
  ] }) : null,
1031
- $ && !j ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
1096
+ $ && !U ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
1032
1097
  ] }),
1033
- ot ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ o(
1098
+ ct ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ s(
1034
1099
  "form",
1035
1100
  {
1036
1101
  className: "review-lens-feedback-form",
1037
1102
  onSubmit: (a) => {
1038
- a.preventDefault(), Me();
1103
+ a.preventDefault(), Te();
1039
1104
  },
1040
1105
  children: [
1041
1106
  /* @__PURE__ */ i("label", { htmlFor: "review-lens-comment", children: "New feedback" }),
@@ -1045,181 +1110,181 @@ function bn({
1045
1110
  ref: te,
1046
1111
  id: "review-lens-comment",
1047
1112
  value: F,
1048
- disabled: !T,
1049
- onChange: (a) => _(a.target.value),
1113
+ disabled: !B,
1114
+ onChange: (a) => M(a.target.value),
1050
1115
  onKeyDown: (a) => {
1051
- a.key === "Enter" && a.metaKey && (a.preventDefault(), Me());
1116
+ a.key === "Enter" && a.metaKey && (a.preventDefault(), Te());
1052
1117
  },
1053
- placeholder: T ? "Describe the UX issue..." : "You do not have permission to comment."
1118
+ placeholder: B ? "Describe the UX issue..." : "You do not have permission to comment."
1054
1119
  }
1055
1120
  ),
1056
- /* @__PURE__ */ o("div", { className: "review-lens-form-grid", children: [
1057
- /* @__PURE__ */ o("label", { children: [
1121
+ /* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
1122
+ /* @__PURE__ */ s("label", { children: [
1058
1123
  "Severity",
1059
1124
  /* @__PURE__ */ i(
1060
1125
  "select",
1061
1126
  {
1062
- value: H,
1063
- onChange: (a) => Ze(a.target.value),
1064
- disabled: !T,
1065
- children: Ye.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
1127
+ value: j,
1128
+ onChange: (a) => tt(a.target.value),
1129
+ disabled: !B,
1130
+ children: Qe.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
1066
1131
  }
1067
1132
  )
1068
1133
  ] }),
1069
- /* @__PURE__ */ o("label", { children: [
1134
+ /* @__PURE__ */ s("label", { children: [
1070
1135
  "Type",
1071
1136
  /* @__PURE__ */ i(
1072
1137
  "select",
1073
1138
  {
1074
1139
  value: we,
1075
- onChange: (a) => et(a.target.value),
1076
- disabled: !T,
1077
- children: Xe.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
1140
+ onChange: (a) => nt(a.target.value),
1141
+ disabled: !B,
1142
+ children: Ze.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
1078
1143
  }
1079
1144
  )
1080
1145
  ] }),
1081
- /* @__PURE__ */ o("label", { children: [
1146
+ /* @__PURE__ */ s("label", { children: [
1082
1147
  "Assignee",
1083
1148
  /* @__PURE__ */ i(
1084
1149
  "input",
1085
1150
  {
1086
- value: be,
1087
- onChange: (a) => ve(a.target.value),
1088
- disabled: !T,
1151
+ value: ve,
1152
+ onChange: (a) => be(a.target.value),
1153
+ disabled: !B,
1089
1154
  placeholder: "optional@email.com"
1090
1155
  }
1091
1156
  )
1092
1157
  ] }),
1093
- /* @__PURE__ */ o("label", { children: [
1158
+ /* @__PURE__ */ s("label", { children: [
1094
1159
  "Viewport",
1095
1160
  /* @__PURE__ */ i(
1096
1161
  "select",
1097
1162
  {
1098
1163
  value: ye,
1099
- onChange: (a) => tt(a.target.value),
1100
- disabled: !T,
1164
+ onChange: (a) => it(a.target.value),
1165
+ disabled: !B,
1101
1166
  children: c.map((a) => /* @__PURE__ */ i("option", { value: a.value, children: a.label }, a.value))
1102
1167
  }
1103
1168
  )
1104
1169
  ] })
1105
1170
  ] }),
1106
- T ? /* @__PURE__ */ o("p", { className: "review-lens-feedback-form__hint", children: [
1171
+ B ? /* @__PURE__ */ s("p", { className: "review-lens-feedback-form__hint", children: [
1107
1172
  "Press ",
1108
1173
  /* @__PURE__ */ i("kbd", { children: "Command" }),
1109
1174
  " + ",
1110
1175
  /* @__PURE__ */ i("kbd", { children: "Enter" }),
1111
1176
  " to submit.",
1112
- lt ? " Screenshot capture runs after save." : ""
1177
+ dt ? " Screenshot capture runs after save." : ""
1113
1178
  ] }) : null,
1114
- /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !T, children: "Save feedback" }) })
1179
+ /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !B, children: "Save feedback" }) })
1115
1180
  ]
1116
1181
  }
1117
1182
  ) }) : null
1118
1183
  ] }) : null,
1119
- M === "feedback" ? /* @__PURE__ */ o("div", { className: "review-lens-comments", children: [
1184
+ T === "feedback" ? /* @__PURE__ */ s("div", { className: "review-lens-comments", children: [
1120
1185
  /* @__PURE__ */ i(
1121
- Vt,
1186
+ en,
1122
1187
  {
1123
- open: it,
1124
- activeCount: ct,
1188
+ open: at,
1189
+ activeCount: ut,
1125
1190
  statusFilter: J,
1126
1191
  severityFilter: O,
1127
- categoryFilter: q,
1128
- assigneeFilter: V,
1129
- viewportFilter: G,
1130
- assignees: dt,
1192
+ categoryFilter: G,
1193
+ assigneeFilter: q,
1194
+ viewportFilter: V,
1195
+ assignees: ht,
1131
1196
  responsivePresets: c,
1132
- onStatusChange: ke,
1133
- onSeverityChange: Ne,
1134
- onCategoryChange: Ce,
1135
- onAssigneeChange: xe,
1197
+ onStatusChange: Se,
1198
+ onSeverityChange: xe,
1199
+ onCategoryChange: Ne,
1200
+ onAssigneeChange: Ce,
1136
1201
  onViewportChange: Ee,
1137
- onToggle: () => rt((a) => !a),
1202
+ onToggle: () => ot((a) => !a),
1138
1203
  onClear: () => {
1139
- ke("all"), Ne("all"), Ce("all"), xe("all"), Ee("all");
1204
+ Se("all"), xe("all"), Ne("all"), Ce("all"), Ee("all");
1140
1205
  }
1141
1206
  }
1142
1207
  ),
1143
- /* @__PURE__ */ o("div", { className: "review-lens-list-panel", children: [
1144
- /* @__PURE__ */ o("div", { className: "review-lens-comments__header", children: [
1208
+ /* @__PURE__ */ s("div", { className: "review-lens-list-panel", children: [
1209
+ /* @__PURE__ */ s("div", { className: "review-lens-comments__header", children: [
1145
1210
  /* @__PURE__ */ i("h3", { children: "All feedback" }),
1146
1211
  /* @__PURE__ */ i("span", { children: R.length })
1147
1212
  ] }),
1148
- /* @__PURE__ */ o("div", { className: "review-lens-comments__list", children: [
1213
+ /* @__PURE__ */ s("div", { className: "review-lens-comments__list", children: [
1149
1214
  R.length === 0 ? /* @__PURE__ */ i("p", { children: "No feedback for this view." }) : null,
1150
1215
  R.map((a) => /* @__PURE__ */ i(
1151
- Gt,
1216
+ tn,
1152
1217
  {
1153
1218
  item: a,
1154
- selected: (k == null ? void 0 : k.id) === a.id,
1155
- onSelect: D
1219
+ selected: (S == null ? void 0 : S.id) === a.id,
1220
+ onSelect: z
1156
1221
  },
1157
1222
  a.id
1158
1223
  ))
1159
1224
  ] })
1160
1225
  ] }),
1161
- k ? /* @__PURE__ */ o("div", { className: "review-lens-selected-panel", children: [
1226
+ S ? /* @__PURE__ */ s("div", { className: "review-lens-selected-panel", children: [
1162
1227
  /* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1163
1228
  /* @__PURE__ */ i(
1164
- Yt,
1229
+ nn,
1165
1230
  {
1166
- item: k,
1167
- messages: at[k.id] ?? [],
1231
+ item: S,
1232
+ messages: st[S.id] ?? [],
1168
1233
  messageDraft: le,
1169
- canReply: Ae,
1234
+ canReply: Fe,
1170
1235
  canUpdate: Re,
1171
- canAssign: st,
1172
- syncSelectionToUrl: s,
1173
- onMessageDraftChange: de,
1174
- onSubmitMessage: () => void ut(k),
1175
- onStatusChange: (a) => void ht(k, a),
1176
- onAssigneeChange: (a) => void S(k.id, {
1236
+ canAssign: lt,
1237
+ syncSelectionToUrl: o,
1238
+ onMessageDraftChange: ce,
1239
+ onSubmitMessage: () => void pt(S),
1240
+ onStatusChange: (a) => void mt(S, a),
1241
+ onAssigneeChange: (a) => void v(S.id, {
1177
1242
  assigneeEmail: a.trim() || void 0
1178
1243
  }).then(K),
1179
- onMarkFixed: () => void $e(k)
1244
+ onMarkFixed: () => void $e(S)
1180
1245
  },
1181
- k.id
1246
+ S.id
1182
1247
  )
1183
- ] }) : /* @__PURE__ */ o("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
1248
+ ] }) : /* @__PURE__ */ s("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
1184
1249
  /* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1185
1250
  /* @__PURE__ */ i("p", { children: "Select a feedback item above to review status, assignment, drift, and replies." })
1186
1251
  ] })
1187
1252
  ] }) : null,
1188
- M === "summary" ? /* @__PURE__ */ i(Qt, { feedback: b }) : null
1253
+ T === "summary" ? /* @__PURE__ */ i(an, { feedback: b }) : null
1189
1254
  ] })
1190
1255
  ] })
1191
1256
  ] });
1192
1257
  }
1193
- function Vt({
1258
+ function en({
1194
1259
  open: e,
1195
1260
  activeCount: t,
1196
1261
  statusFilter: n,
1197
1262
  severityFilter: r,
1198
- categoryFilter: s,
1263
+ categoryFilter: o,
1199
1264
  assigneeFilter: c,
1200
- viewportFilter: h,
1265
+ viewportFilter: u,
1201
1266
  assignees: w,
1202
- responsivePresets: p,
1267
+ responsivePresets: g,
1203
1268
  onStatusChange: b,
1204
- onSeverityChange: g,
1205
- onCategoryChange: f,
1206
- onAssigneeChange: m,
1207
- onViewportChange: S,
1208
- onToggle: x,
1209
- onClear: E
1269
+ onSeverityChange: A,
1270
+ onCategoryChange: L,
1271
+ onAssigneeChange: p,
1272
+ onViewportChange: v,
1273
+ onToggle: h,
1274
+ onClear: k
1210
1275
  }) {
1211
- return /* @__PURE__ */ o("div", { className: "review-lens-filter-shell", children: [
1212
- /* @__PURE__ */ o("div", { className: "review-lens-filter-bar", children: [
1213
- /* @__PURE__ */ o("button", { type: "button", "aria-expanded": e, onClick: x, children: [
1276
+ return /* @__PURE__ */ s("div", { className: "review-lens-filter-shell", children: [
1277
+ /* @__PURE__ */ s("div", { className: "review-lens-filter-bar", children: [
1278
+ /* @__PURE__ */ s("button", { type: "button", "aria-expanded": e, onClick: h, children: [
1214
1279
  "Filters",
1215
1280
  t > 0 ? /* @__PURE__ */ i("span", { children: t }) : null
1216
1281
  ] }),
1217
- t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: E, children: "Clear" }) : null
1282
+ t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: k, children: "Clear" }) : null
1218
1283
  ] }),
1219
- e ? /* @__PURE__ */ o("div", { className: "review-lens-filters", children: [
1220
- /* @__PURE__ */ o("label", { children: [
1284
+ e ? /* @__PURE__ */ s("div", { className: "review-lens-filters", children: [
1285
+ /* @__PURE__ */ s("label", { children: [
1221
1286
  "Status",
1222
- /* @__PURE__ */ o(
1287
+ /* @__PURE__ */ s(
1223
1288
  "select",
1224
1289
  {
1225
1290
  "aria-label": "Filter status",
@@ -1227,49 +1292,49 @@ function Vt({
1227
1292
  onChange: (l) => b(l.target.value),
1228
1293
  children: [
1229
1294
  /* @__PURE__ */ i("option", { value: "all", children: "All statuses" }),
1230
- Ge.map((l) => /* @__PURE__ */ i("option", { value: l, children: oe[l] }, l))
1295
+ Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
1231
1296
  ]
1232
1297
  }
1233
1298
  )
1234
1299
  ] }),
1235
- /* @__PURE__ */ o("label", { children: [
1300
+ /* @__PURE__ */ s("label", { children: [
1236
1301
  "Priority",
1237
- /* @__PURE__ */ o(
1302
+ /* @__PURE__ */ s(
1238
1303
  "select",
1239
1304
  {
1240
1305
  "aria-label": "Filter severity",
1241
1306
  value: r,
1242
- onChange: (l) => g(l.target.value),
1307
+ onChange: (l) => A(l.target.value),
1243
1308
  children: [
1244
1309
  /* @__PURE__ */ i("option", { value: "all", children: "All priorities" }),
1245
- Ye.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
1310
+ Qe.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
1246
1311
  ]
1247
1312
  }
1248
1313
  )
1249
1314
  ] }),
1250
- /* @__PURE__ */ o("label", { children: [
1315
+ /* @__PURE__ */ s("label", { children: [
1251
1316
  "Type",
1252
- /* @__PURE__ */ o(
1317
+ /* @__PURE__ */ s(
1253
1318
  "select",
1254
1319
  {
1255
1320
  "aria-label": "Filter type",
1256
- value: s,
1257
- onChange: (l) => f(l.target.value),
1321
+ value: o,
1322
+ onChange: (l) => L(l.target.value),
1258
1323
  children: [
1259
1324
  /* @__PURE__ */ i("option", { value: "all", children: "All types" }),
1260
- Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
1325
+ Ze.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
1261
1326
  ]
1262
1327
  }
1263
1328
  )
1264
1329
  ] }),
1265
- /* @__PURE__ */ o("label", { children: [
1330
+ /* @__PURE__ */ s("label", { children: [
1266
1331
  "Assignee",
1267
- /* @__PURE__ */ o(
1332
+ /* @__PURE__ */ s(
1268
1333
  "select",
1269
1334
  {
1270
1335
  "aria-label": "Filter assignee",
1271
1336
  value: c,
1272
- onChange: (l) => m(l.target.value),
1337
+ onChange: (l) => p(l.target.value),
1273
1338
  children: [
1274
1339
  /* @__PURE__ */ i("option", { value: "all", children: "All assignees" }),
1275
1340
  w.map((l) => /* @__PURE__ */ i("option", { value: l, children: l }, l))
@@ -1277,17 +1342,17 @@ function Vt({
1277
1342
  }
1278
1343
  )
1279
1344
  ] }),
1280
- /* @__PURE__ */ o("label", { children: [
1345
+ /* @__PURE__ */ s("label", { children: [
1281
1346
  "Viewport",
1282
- /* @__PURE__ */ o(
1347
+ /* @__PURE__ */ s(
1283
1348
  "select",
1284
1349
  {
1285
1350
  "aria-label": "Filter viewport",
1286
- value: h,
1287
- onChange: (l) => S(l.target.value),
1351
+ value: u,
1352
+ onChange: (l) => v(l.target.value),
1288
1353
  children: [
1289
1354
  /* @__PURE__ */ i("option", { value: "all", children: "All viewports" }),
1290
- p.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
1355
+ g.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
1291
1356
  ]
1292
1357
  }
1293
1358
  )
@@ -1295,13 +1360,13 @@ function Vt({
1295
1360
  ] }) : null
1296
1361
  ] });
1297
1362
  }
1298
- function Gt({
1363
+ function tn({
1299
1364
  item: e,
1300
1365
  selected: t,
1301
1366
  onSelect: n
1302
1367
  }) {
1303
- const r = Qe(e);
1304
- return /* @__PURE__ */ o(
1368
+ const r = et(e);
1369
+ return /* @__PURE__ */ s(
1305
1370
  "article",
1306
1371
  {
1307
1372
  tabIndex: 0,
@@ -1311,22 +1376,22 @@ function Gt({
1311
1376
  t ? "review-lens-comment--selected" : ""
1312
1377
  ].filter(Boolean).join(" "),
1313
1378
  onClick: () => n(e),
1314
- onKeyDown: (s) => {
1315
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), n(e));
1379
+ onKeyDown: (o) => {
1380
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), n(e));
1316
1381
  },
1317
1382
  children: [
1318
- /* @__PURE__ */ o("div", { className: "review-lens-comment__header", children: [
1319
- /* @__PURE__ */ i("span", { children: oe[e.status] }),
1383
+ /* @__PURE__ */ s("div", { className: "review-lens-comment__header", children: [
1384
+ /* @__PURE__ */ i("span", { children: se[e.status] }),
1320
1385
  /* @__PURE__ */ i("strong", { children: Z[e.severity] })
1321
1386
  ] }),
1322
- /* @__PURE__ */ o("div", { className: "review-lens-comment__content", children: [
1387
+ /* @__PURE__ */ s("div", { className: "review-lens-comment__content", children: [
1323
1388
  /* @__PURE__ */ i("p", { children: e.comment }),
1324
- /* @__PURE__ */ o("span", { children: [
1389
+ /* @__PURE__ */ s("span", { children: [
1325
1390
  e.authorEmail,
1326
1391
  e.assigneeEmail ? ` -> ${e.assigneeEmail}` : ""
1327
1392
  ] })
1328
1393
  ] }),
1329
- /* @__PURE__ */ o("div", { className: "review-lens-tags", children: [
1394
+ /* @__PURE__ */ s("div", { className: "review-lens-tags", children: [
1330
1395
  /* @__PURE__ */ i("span", { children: ee[e.category] }),
1331
1396
  /* @__PURE__ */ i("span", { children: e.viewportPreset }),
1332
1397
  /* @__PURE__ */ i("span", { children: r.label })
@@ -1335,96 +1400,96 @@ function Gt({
1335
1400
  }
1336
1401
  );
1337
1402
  }
1338
- function Yt({
1403
+ function nn({
1339
1404
  item: e,
1340
1405
  messages: t,
1341
1406
  messageDraft: n,
1342
1407
  canReply: r,
1343
- canUpdate: s,
1408
+ canUpdate: o,
1344
1409
  canAssign: c,
1345
- syncSelectionToUrl: h,
1410
+ syncSelectionToUrl: u,
1346
1411
  onMessageDraftChange: w,
1347
- onSubmitMessage: p,
1412
+ onSubmitMessage: g,
1348
1413
  onStatusChange: b,
1349
- onAssigneeChange: g,
1350
- onMarkFixed: f
1414
+ onAssigneeChange: A,
1415
+ onMarkFixed: L
1351
1416
  }) {
1352
- const [m, S] = N(!1), x = Qe(e);
1353
- function E() {
1417
+ const [p, v] = x(!1), h = et(e);
1418
+ function k() {
1354
1419
  const l = new URL(window.location.href);
1355
- l.searchParams.set("reviewLensFeedback", e.id), Xt(l.toString()).then((A) => {
1356
- A && (S(!0), setTimeout(() => S(!1), 2e3));
1420
+ l.searchParams.set("reviewLensFeedback", e.id), rn(l.toString()).then((C) => {
1421
+ C && (v(!0), setTimeout(() => v(!1), 2e3));
1357
1422
  });
1358
1423
  }
1359
- return /* @__PURE__ */ o("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
1360
- /* @__PURE__ */ o("div", { className: "review-lens-detail__header", children: [
1361
- /* @__PURE__ */ o("h3", { children: [
1424
+ return /* @__PURE__ */ s("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
1425
+ /* @__PURE__ */ s("div", { className: "review-lens-detail__header", children: [
1426
+ /* @__PURE__ */ s("h3", { children: [
1362
1427
  ee[e.category],
1363
1428
  " feedback"
1364
1429
  ] }),
1365
- /* @__PURE__ */ o("div", { className: "review-lens-detail__header-actions", children: [
1366
- h ? /* @__PURE__ */ i(
1430
+ /* @__PURE__ */ s("div", { className: "review-lens-detail__header-actions", children: [
1431
+ u ? /* @__PURE__ */ i(
1367
1432
  "button",
1368
1433
  {
1369
1434
  type: "button",
1370
1435
  className: "review-lens-copy-link",
1371
- onClick: E,
1436
+ onClick: k,
1372
1437
  "aria-label": "Copy link to this feedback",
1373
- children: m ? "Copied!" : "Copy link"
1438
+ children: p ? "Copied!" : "Copy link"
1374
1439
  }
1375
1440
  ) : null,
1376
1441
  /* @__PURE__ */ i("strong", { children: Z[e.severity] })
1377
1442
  ] })
1378
1443
  ] }),
1379
1444
  /* @__PURE__ */ i("blockquote", { children: e.comment }),
1380
- /* @__PURE__ */ o("dl", { className: "review-lens-detail-meta", children: [
1381
- /* @__PURE__ */ o("div", { children: [
1445
+ /* @__PURE__ */ s("dl", { className: "review-lens-detail-meta", children: [
1446
+ /* @__PURE__ */ s("div", { children: [
1382
1447
  /* @__PURE__ */ i("dt", { children: "Target" }),
1383
- /* @__PURE__ */ i("dd", { children: x.label })
1448
+ /* @__PURE__ */ i("dd", { children: h.label })
1384
1449
  ] }),
1385
- /* @__PURE__ */ o("div", { children: [
1450
+ /* @__PURE__ */ s("div", { children: [
1386
1451
  /* @__PURE__ */ i("dt", { children: "Viewport" }),
1387
1452
  /* @__PURE__ */ i("dd", { children: e.viewportPreset })
1388
1453
  ] }),
1389
- e.screenshotUrl ? /* @__PURE__ */ o("div", { children: [
1454
+ e.screenshotUrl ? /* @__PURE__ */ s("div", { children: [
1390
1455
  /* @__PURE__ */ i("dt", { children: "Evidence" }),
1391
1456
  /* @__PURE__ */ i("dd", { children: /* @__PURE__ */ i("a", { href: e.screenshotUrl, target: "_blank", rel: "noreferrer", children: "Screenshot" }) })
1392
1457
  ] }) : null
1393
1458
  ] }),
1394
- /* @__PURE__ */ o("div", { className: "review-lens-form-grid", children: [
1395
- /* @__PURE__ */ o("label", { children: [
1459
+ /* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
1460
+ /* @__PURE__ */ s("label", { children: [
1396
1461
  "Status",
1397
1462
  /* @__PURE__ */ i(
1398
1463
  "select",
1399
1464
  {
1400
1465
  value: e.status,
1401
- disabled: !s,
1466
+ disabled: !o,
1402
1467
  onChange: (l) => b(l.target.value),
1403
- children: Ge.map((l) => /* @__PURE__ */ i("option", { value: l, children: oe[l] }, l))
1468
+ children: Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
1404
1469
  }
1405
1470
  )
1406
1471
  ] }),
1407
- /* @__PURE__ */ o("label", { children: [
1472
+ /* @__PURE__ */ s("label", { children: [
1408
1473
  "Assignee",
1409
1474
  /* @__PURE__ */ i(
1410
1475
  "input",
1411
1476
  {
1412
1477
  defaultValue: e.assigneeEmail ?? "",
1413
1478
  disabled: !c,
1414
- onBlur: (l) => g(l.target.value),
1479
+ onBlur: (l) => A(l.target.value),
1415
1480
  placeholder: "optional@email.com"
1416
1481
  }
1417
1482
  )
1418
1483
  ] })
1419
1484
  ] }),
1420
- /* @__PURE__ */ o("div", { className: "review-lens-status-actions", children: [
1485
+ /* @__PURE__ */ s("div", { className: "review-lens-status-actions", children: [
1421
1486
  /* @__PURE__ */ i(
1422
1487
  "button",
1423
1488
  {
1424
1489
  type: "button",
1425
1490
  className: "review-lens-button-secondary",
1426
- disabled: !s,
1427
- onClick: f,
1491
+ disabled: !o,
1492
+ onClick: L,
1428
1493
  children: "Mark fixed"
1429
1494
  }
1430
1495
  ),
@@ -1433,19 +1498,19 @@ function Yt({
1433
1498
  {
1434
1499
  type: "button",
1435
1500
  className: "review-lens-button-primary",
1436
- disabled: !s,
1501
+ disabled: !o,
1437
1502
  onClick: () => b("resolved"),
1438
1503
  children: "Resolve"
1439
1504
  }
1440
1505
  )
1441
1506
  ] }),
1442
- /* @__PURE__ */ o("div", { className: "review-lens-thread", children: [
1443
- /* @__PURE__ */ o("div", { className: "review-lens-thread__header", children: [
1507
+ /* @__PURE__ */ s("div", { className: "review-lens-thread", children: [
1508
+ /* @__PURE__ */ s("div", { className: "review-lens-thread__header", children: [
1444
1509
  /* @__PURE__ */ i("h3", { children: "Thread" }),
1445
1510
  /* @__PURE__ */ i("span", { children: t.length })
1446
1511
  ] }),
1447
1512
  t.length === 0 ? /* @__PURE__ */ i("p", { children: "No replies yet." }) : null,
1448
- t.map((l) => /* @__PURE__ */ o("div", { className: "review-lens-thread__message", children: [
1513
+ t.map((l) => /* @__PURE__ */ s("div", { className: "review-lens-thread__message", children: [
1449
1514
  /* @__PURE__ */ i("p", { children: l.body }),
1450
1515
  /* @__PURE__ */ i("span", { children: l.authorEmail })
1451
1516
  ] }, l.id)),
@@ -1459,11 +1524,11 @@ function Yt({
1459
1524
  placeholder: r ? "Reply..." : "You do not have permission to reply."
1460
1525
  }
1461
1526
  ),
1462
- /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: p, children: "Reply" }) })
1527
+ /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: g, children: "Reply" }) })
1463
1528
  ] })
1464
1529
  ] });
1465
1530
  }
1466
- async function Xt(e) {
1531
+ async function rn(e) {
1467
1532
  var n;
1468
1533
  if ((n = navigator.clipboard) != null && n.writeText)
1469
1534
  return await navigator.clipboard.writeText(e), !0;
@@ -1475,9 +1540,9 @@ async function Xt(e) {
1475
1540
  t.remove();
1476
1541
  }
1477
1542
  }
1478
- function Qt({ feedback: e }) {
1479
- return /* @__PURE__ */ o("div", { className: "review-lens-summary", role: "tabpanel", children: [
1480
- /* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => oe[t.status]) }),
1543
+ function an({ feedback: e }) {
1544
+ return /* @__PURE__ */ s("div", { className: "review-lens-summary", role: "tabpanel", children: [
1545
+ /* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => se[t.status]) }),
1481
1546
  /* @__PURE__ */ i(Y, { title: "Severity", values: X(e, (t) => Z[t.severity]) }),
1482
1547
  /* @__PURE__ */ i(Y, { title: "Type", values: X(e, (t) => ee[t.category]) }),
1483
1548
  /* @__PURE__ */ i(Y, { title: "Assignee", values: X(e, (t) => t.assigneeEmail ?? "Unassigned") }),
@@ -1485,17 +1550,17 @@ function Qt({ feedback: e }) {
1485
1550
  ] });
1486
1551
  }
1487
1552
  function Y({ title: e, values: t }) {
1488
- return /* @__PURE__ */ o("section", { children: [
1553
+ return /* @__PURE__ */ s("section", { children: [
1489
1554
  /* @__PURE__ */ i("h3", { children: e }),
1490
- /* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ o("div", { children: [
1555
+ /* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
1491
1556
  /* @__PURE__ */ i("dt", { children: n }),
1492
1557
  /* @__PURE__ */ i("dd", { children: r })
1493
1558
  ] }, n)) })
1494
1559
  ] });
1495
1560
  }
1496
- function Zt({ target: e, locked: t }) {
1497
- const n = pn(e), r = dn(e.fingerprint);
1498
- return /* @__PURE__ */ o(
1561
+ function on({ target: e, locked: t }) {
1562
+ const n = yn(e), r = gn(e.fingerprint);
1563
+ return /* @__PURE__ */ s(
1499
1564
  "div",
1500
1565
  {
1501
1566
  className: t ? "review-lens-highlight review-lens-highlight--locked" : "review-lens-highlight",
@@ -1542,9 +1607,9 @@ function Zt({ target: e, locked: t }) {
1542
1607
  }
1543
1608
  }
1544
1609
  ),
1545
- /* @__PURE__ */ o("div", { className: "review-lens-highlight__label", children: [
1610
+ /* @__PURE__ */ s("div", { className: "review-lens-highlight__label", children: [
1546
1611
  /* @__PURE__ */ i("strong", { children: r }),
1547
- /* @__PURE__ */ o("span", { children: [
1612
+ /* @__PURE__ */ s("span", { children: [
1548
1613
  Math.round(e.rect.width),
1549
1614
  " x ",
1550
1615
  Math.round(e.rect.height)
@@ -1554,8 +1619,8 @@ function Zt({ target: e, locked: t }) {
1554
1619
  }
1555
1620
  );
1556
1621
  }
1557
- function en({ from: e, to: t }) {
1558
- const n = cn(e.rect, t.rect);
1622
+ function sn({ from: e, to: t }) {
1623
+ const n = fn(e.rect, t.rect);
1559
1624
  return n.length === 0 ? null : /* @__PURE__ */ i(ae, { children: n.map((r) => /* @__PURE__ */ i(
1560
1625
  "div",
1561
1626
  {
@@ -1571,13 +1636,13 @@ function en({ from: e, to: t }) {
1571
1636
  r.key
1572
1637
  )) });
1573
1638
  }
1574
- function tn({
1639
+ function ln({
1575
1640
  feedback: e,
1576
1641
  selectedFeedback: t,
1577
1642
  onSelect: n
1578
1643
  }) {
1579
1644
  return /* @__PURE__ */ i(ae, { children: e.map((r) => /* @__PURE__ */ i(
1580
- nn,
1645
+ cn,
1581
1646
  {
1582
1647
  feedback: r,
1583
1648
  selected: (t == null ? void 0 : t.id) === r.id,
@@ -1586,23 +1651,23 @@ function tn({
1586
1651
  r.id
1587
1652
  )) });
1588
1653
  }
1589
- function nn({
1654
+ function cn({
1590
1655
  feedback: e,
1591
1656
  selected: t,
1592
1657
  onSelect: n
1593
1658
  }) {
1594
1659
  const r = re(null);
1595
- return gt(() => {
1596
- let s = 0;
1660
+ return wt(() => {
1661
+ let o = 0;
1597
1662
  const c = () => {
1598
- s = 0;
1599
- const w = r.current, p = z(e.selector), b = p == null ? void 0 : p.getBoundingClientRect();
1663
+ o = 0;
1664
+ const w = r.current, g = H(e.selector), b = g == null ? void 0 : g.getBoundingClientRect();
1600
1665
  !w || !b || (w.style.top = `${b.top}px`, w.style.left = `${b.right}px`, w.hidden = b.bottom < 0 || b.top > window.innerHeight);
1601
- }, h = () => {
1602
- s || (s = window.requestAnimationFrame(c));
1666
+ }, u = () => {
1667
+ o || (o = window.requestAnimationFrame(c));
1603
1668
  };
1604
- return c(), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
1605
- s && window.cancelAnimationFrame(s), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
1669
+ return c(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1670
+ o && window.cancelAnimationFrame(o), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1606
1671
  };
1607
1672
  }, [e.selector]), /* @__PURE__ */ i(
1608
1673
  "button",
@@ -1615,35 +1680,35 @@ function nn({
1615
1680
  }
1616
1681
  );
1617
1682
  }
1618
- function rn({
1683
+ function dn({
1619
1684
  feedback: e,
1620
1685
  selectedFeedback: t,
1621
1686
  onSelect: n
1622
1687
  }) {
1623
- const r = e.map((s) => {
1624
- const c = z(s.selector), h = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
1688
+ const r = e.map((o) => {
1689
+ const c = H(o.selector), u = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
1625
1690
  document.documentElement.scrollHeight,
1626
1691
  document.body.scrollHeight,
1627
1692
  window.innerHeight
1628
1693
  );
1629
- return !h || w <= 0 ? null : {
1630
- item: s,
1631
- top: Math.min(100, Math.max(0, (h.top + window.scrollY) / w * 100))
1694
+ return !u || w <= 0 ? null : {
1695
+ item: o,
1696
+ top: Math.min(100, Math.max(0, (u.top + window.scrollY) / w * 100))
1632
1697
  };
1633
- }).filter((s) => s !== null);
1634
- return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((s) => /* @__PURE__ */ i(
1698
+ }).filter((o) => o !== null);
1699
+ return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((o) => /* @__PURE__ */ i(
1635
1700
  "button",
1636
1701
  {
1637
1702
  type: "button",
1638
- className: (t == null ? void 0 : t.id) === s.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
1639
- style: { top: `${s.top}%` },
1640
- onClick: () => n(s.item),
1641
- "aria-label": `Jump to feedback from ${s.item.authorEmail}`
1703
+ className: (t == null ? void 0 : t.id) === o.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
1704
+ style: { top: `${o.top}%` },
1705
+ onClick: () => n(o.item),
1706
+ "aria-label": `Jump to feedback from ${o.item.authorEmail}`
1642
1707
  },
1643
- s.item.id
1708
+ o.item.id
1644
1709
  )) });
1645
1710
  }
1646
- function an({ target: e }) {
1711
+ function hn({ target: e }) {
1647
1712
  const t = [
1648
1713
  ["Selector", e.selector],
1649
1714
  ["Size", `${e.cssSnapshot.width} x ${e.cssSnapshot.height}`],
@@ -1656,120 +1721,120 @@ function an({ target: e }) {
1656
1721
  ["Color", e.cssSnapshot.color],
1657
1722
  ["Background", e.cssSnapshot.backgroundColor]
1658
1723
  ];
1659
- return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ o("div", { children: [
1724
+ return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
1660
1725
  /* @__PURE__ */ i("dt", { children: n }),
1661
1726
  /* @__PURE__ */ i("dd", { children: r })
1662
1727
  ] }, n)) });
1663
1728
  }
1664
- function De({ title: e, items: t }) {
1665
- return /* @__PURE__ */ o("section", { className: "review-lens-insights", children: [
1729
+ function He({ title: e, items: t }) {
1730
+ return /* @__PURE__ */ s("section", { className: "review-lens-insights", children: [
1666
1731
  /* @__PURE__ */ i("h3", { children: e }),
1667
1732
  t.length === 0 ? /* @__PURE__ */ i("p", { children: "No issues detected." }) : null,
1668
1733
  t.length > 0 ? /* @__PURE__ */ i("ul", { children: t.map((n) => /* @__PURE__ */ i("li", { children: n }, n)) }) : null
1669
1734
  ] });
1670
1735
  }
1671
- function z(e) {
1736
+ function H(e) {
1672
1737
  try {
1673
1738
  return document.querySelector(e);
1674
1739
  } catch {
1675
1740
  return null;
1676
1741
  }
1677
1742
  }
1678
- function Qe(e) {
1679
- const t = z(e.selector);
1743
+ function et(e) {
1744
+ const t = H(e.selector);
1680
1745
  if (!t)
1681
1746
  return { label: "Target missing", level: "warning" };
1682
1747
  const n = Q(t);
1683
1748
  return n.fingerprint.tagName !== e.elementFingerprint.tagName ? { label: "Element changed", level: "warning" } : Math.abs(n.fingerprint.width - e.elementFingerprint.width) > 2 || Math.abs(n.fingerprint.height - e.elementFingerprint.height) > 2 ? { label: "Size changed", level: "warning" } : n.cssSnapshot.fontSize !== e.createdCssSnapshot.fontSize || n.cssSnapshot.color !== e.createdCssSnapshot.color || n.cssSnapshot.padding !== e.createdCssSnapshot.padding ? { label: "Style changed", level: "warning" } : { label: "Target unchanged", level: "ok" };
1684
1749
  }
1685
- function sn(e) {
1686
- var p;
1687
- const t = z(e.selector);
1750
+ function un(e) {
1751
+ var g;
1752
+ const t = H(e.selector);
1688
1753
  if (!t)
1689
1754
  return ["Selected element is no longer available."];
1690
- const n = [], r = t.tagName.toLowerCase(), s = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(r) || s === "button" || s === "link", h = t.getAttribute("aria-label") || t.getAttribute("title") || ((p = t.textContent) == null ? void 0 : p.trim());
1691
- c && !h && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), r === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
1755
+ const n = [], r = t.tagName.toLowerCase(), o = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(r) || o === "button" || o === "link", u = t.getAttribute("aria-label") || t.getAttribute("title") || ((g = t.textContent) == null ? void 0 : g.trim());
1756
+ c && !u && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), r === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
1692
1757
  const w = /^h[1-6]$/.test(r) ? Number(r.slice(1)) : 0;
1693
- return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."), un(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
1758
+ return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."), vn(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
1694
1759
  }
1695
- function on(e, t = {}) {
1760
+ function mn(e, t = {}) {
1696
1761
  const n = [];
1697
- return U("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), U("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), U("Font size", e.fontSize, t.fontSize, n), U("Line height", e.lineHeight, t.lineHeight, n), U("Text color", e.color, t.color, n), U("Background", e.backgroundColor, t.color, n), U("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
1762
+ return W("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), W("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), W("Font size", e.fontSize, t.fontSize, n), W("Line height", e.lineHeight, t.lineHeight, n), W("Text color", e.color, t.color, n), W("Background", e.backgroundColor, t.color, n), W("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
1698
1763
  }
1699
- function U(e, t, n, r, s = {}) {
1700
- !n || n.length === 0 || !t || ln(t, n, s) || r.push(`${e} ${t} is outside configured tokens.`);
1764
+ function W(e, t, n, r, o = {}) {
1765
+ !n || n.length === 0 || !t || pn(t, n, o) || r.push(`${e} ${t} is outside configured tokens.`);
1701
1766
  }
1702
- function ln(e, t, n = {}) {
1767
+ function pn(e, t, n = {}) {
1703
1768
  if (t.includes(e))
1704
1769
  return !0;
1705
1770
  if (!n.allowComposite)
1706
1771
  return !1;
1707
1772
  const r = e.trim().split(/\s+/);
1708
- return r.length > 1 && r.every((s) => t.includes(s));
1773
+ return r.length > 1 && r.every((o) => t.includes(o));
1709
1774
  }
1710
- function dn(e) {
1775
+ function gn(e) {
1711
1776
  const t = e.id ? `#${e.id}` : "", n = e.className ? `.${e.className.split(/\s+/).filter(Boolean).slice(0, 2).join(".")}` : "", r = e.ariaLabel ? `[aria-label="${e.ariaLabel}"]` : "";
1712
1777
  return `${e.tagName}${t}${n}${r}` || e.tagName;
1713
1778
  }
1714
- function cn(e, t) {
1715
- const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, s = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
1779
+ function fn(e, t) {
1780
+ const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, o = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
1716
1781
  if (e.right <= t.left || t.right <= e.left) {
1717
- const c = e.right <= t.left ? e.right : t.right, h = e.right <= t.left ? t.left : e.left;
1782
+ const c = e.right <= t.left ? e.right : t.right, u = e.right <= t.left ? t.left : e.left;
1718
1783
  n.push({
1719
1784
  key: "horizontal",
1720
1785
  axis: "horizontal",
1721
- top: ze(s, 0, window.innerHeight),
1786
+ top: Ke(o, 0, window.innerHeight),
1722
1787
  left: c,
1723
- width: Math.max(h - c, 1),
1788
+ width: Math.max(u - c, 1),
1724
1789
  height: 1,
1725
- label: `${Math.round(h - c)}px`
1790
+ label: `${Math.round(u - c)}px`
1726
1791
  });
1727
1792
  }
1728
1793
  if (e.bottom <= t.top || t.bottom <= e.top) {
1729
- const c = e.bottom <= t.top ? e.bottom : t.bottom, h = e.bottom <= t.top ? t.top : e.top;
1794
+ const c = e.bottom <= t.top ? e.bottom : t.bottom, u = e.bottom <= t.top ? t.top : e.top;
1730
1795
  n.push({
1731
1796
  key: "vertical",
1732
1797
  axis: "vertical",
1733
1798
  top: c,
1734
- left: ze(r, 0, window.innerWidth),
1799
+ left: Ke(r, 0, window.innerWidth),
1735
1800
  width: 1,
1736
- height: Math.max(h - c, 1),
1737
- label: `${Math.round(h - c)}px`
1801
+ height: Math.max(u - c, 1),
1802
+ label: `${Math.round(u - c)}px`
1738
1803
  });
1739
1804
  }
1740
1805
  return n;
1741
1806
  }
1742
- function ze(e, t, n) {
1807
+ function Ke(e, t, n) {
1743
1808
  return Math.min(Math.max(e, t), n);
1744
1809
  }
1745
1810
  function X(e, t) {
1746
1811
  const n = /* @__PURE__ */ new Map();
1747
1812
  for (const r of e) {
1748
- const s = t(r);
1749
- n.set(s, (n.get(s) ?? 0) + 1);
1813
+ const o = t(r);
1814
+ n.set(o, (n.get(o) ?? 0) + 1);
1750
1815
  }
1751
- return Array.from(n.entries()).sort((r, s) => s[1] - r[1] || r[0].localeCompare(s[0]));
1816
+ return Array.from(n.entries()).sort((r, o) => o[1] - r[1] || r[0].localeCompare(o[0]));
1752
1817
  }
1753
- function hn(e) {
1818
+ function wn(e) {
1754
1819
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e instanceof HTMLElement && e.isContentEditable;
1755
1820
  }
1756
- function un(e, t) {
1757
- const n = He(e), r = He(t);
1758
- return !n || !r || r.alpha === 0 ? !1 : mn(n, r) < 4.5;
1821
+ function vn(e, t) {
1822
+ const n = Je(e), r = Je(t);
1823
+ return !n || !r || r.alpha === 0 ? !1 : bn(n, r) < 4.5;
1759
1824
  }
1760
- function He(e) {
1825
+ function Je(e) {
1761
1826
  const t = e.match(/rgba?\(([^)]+)\)/);
1762
1827
  if (!t)
1763
1828
  return null;
1764
- const [n, r, s, c = "1"] = t[1].split(",").map((h) => h.trim());
1829
+ const [n, r, o, c = "1"] = t[1].split(",").map((u) => u.trim());
1765
1830
  return {
1766
1831
  red: Number(n),
1767
1832
  green: Number(r),
1768
- blue: Number(s),
1833
+ blue: Number(o),
1769
1834
  alpha: Number(c)
1770
1835
  };
1771
1836
  }
1772
- function mn(e, t) {
1837
+ function bn(e, t) {
1773
1838
  const n = Math.max(ie(e), ie(t)), r = Math.min(ie(e), ie(t));
1774
1839
  return (n + 0.05) / (r + 0.05);
1775
1840
  }
@@ -1780,7 +1845,7 @@ function ie(e) {
1780
1845
  });
1781
1846
  return t[0] * 0.2126 + t[1] * 0.7152 + t[2] * 0.0722;
1782
1847
  }
1783
- function pn(e) {
1848
+ function yn(e) {
1784
1849
  const t = {
1785
1850
  top: I(e.cssSnapshot.marginTop),
1786
1851
  right: I(e.cssSnapshot.marginRight),
@@ -1796,31 +1861,31 @@ function pn(e) {
1796
1861
  right: I(e.cssSnapshot.paddingRight),
1797
1862
  bottom: I(e.cssSnapshot.paddingBottom),
1798
1863
  left: I(e.cssSnapshot.paddingLeft)
1799
- }, s = {
1864
+ }, o = {
1800
1865
  top: e.rect.top,
1801
1866
  left: e.rect.left,
1802
1867
  width: Math.max(e.rect.width, 0),
1803
1868
  height: Math.max(e.rect.height, 0)
1804
1869
  }, c = {
1805
- top: s.top - t.top,
1806
- left: s.left - t.left,
1807
- width: s.width + t.left + t.right,
1808
- height: s.height + t.top + t.bottom
1809
- }, h = {
1810
- top: s.top + n.top,
1811
- left: s.left + n.left,
1812
- width: Math.max(s.width - n.left - n.right, 0),
1813
- height: Math.max(s.height - n.top - n.bottom, 0)
1870
+ top: o.top - t.top,
1871
+ left: o.left - t.left,
1872
+ width: o.width + t.left + t.right,
1873
+ height: o.height + t.top + t.bottom
1874
+ }, u = {
1875
+ top: o.top + n.top,
1876
+ left: o.left + n.left,
1877
+ width: Math.max(o.width - n.left - n.right, 0),
1878
+ height: Math.max(o.height - n.top - n.bottom, 0)
1814
1879
  }, w = {
1815
- top: h.top + r.top,
1816
- left: h.left + r.left,
1817
- width: Math.max(h.width - r.left - r.right, 0),
1818
- height: Math.max(h.height - r.top - r.bottom, 0)
1880
+ top: u.top + r.top,
1881
+ left: u.left + r.left,
1882
+ width: Math.max(u.width - r.left - r.right, 0),
1883
+ height: Math.max(u.height - r.top - r.bottom, 0)
1819
1884
  };
1820
1885
  return {
1821
1886
  margin: c,
1822
- border: s,
1823
- padding: h,
1887
+ border: o,
1888
+ padding: u,
1824
1889
  content: w
1825
1890
  };
1826
1891
  }
@@ -1829,11 +1894,11 @@ function I(e) {
1829
1894
  return Number.isFinite(t) ? t : 0;
1830
1895
  }
1831
1896
  export {
1832
- Ot as ReviewLensLogo,
1833
- bn as ReviewLensOverlay,
1834
- wn as ReviewLensProvider,
1897
+ Qt as ReviewLensLogo,
1898
+ Nn as ReviewLensOverlay,
1899
+ xn as ReviewLensProvider,
1835
1900
  Q as buildElementTarget,
1836
- vt as createGoogleSheetsAdapter,
1837
- $t as normalizeReviewUrl,
1838
- Tt as useReviewLens
1901
+ St as createGoogleSheetsAdapter,
1902
+ Ut as normalizeReviewUrl,
1903
+ Wt as useReviewLens
1839
1904
  };