@makefully/notefully 0.2.2 → 0.2.4

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.
package/dist/notefully.js CHANGED
@@ -1,4 +1,4 @@
1
- const me = {
1
+ const ve = {
2
2
  "launcher.open": "Leave a note…",
3
3
  "tool.crop": "Crop",
4
4
  "tool.resetCrop": "Reset crop",
@@ -14,9 +14,21 @@ const me = {
14
14
  "tool.video": "Record video",
15
15
  "tool.stopVideo": "Stop",
16
16
  "form.messagePlaceholder": "Describe the bug or the change you want…",
17
+ "form.placeholder.bug": "What did you expect to happen and what happened instead?",
18
+ "form.placeholder.idea": "What's your idea?",
19
+ "form.placeholder.other": "Describe what you are reporting in detail.",
20
+ "form.placeholder.custom": "{kind}: Describe what you are reporting in detail.",
21
+ "form.title.bug": "Report a Problem",
22
+ "form.title.idea": "Share an Idea",
23
+ "form.title.other": "Send Feedback",
24
+ "form.intro.bug": "Tell us what went wrong.",
25
+ "form.intro.idea": "Tell us what we could improve.",
26
+ "form.intro.other": "Let us know what you think.",
27
+ "form.screenshotNote": "A screenshot of this page is attached. Use the image tools to crop, annotate, remove, or retake the screenshot.",
17
28
  "form.author": "Author",
18
29
  "form.authorPlaceholder": "Anonymous",
19
- "form.submit": "Submit",
30
+ "form.submit": "Send Report",
31
+ "form.close": "Close",
20
32
  "form.done": "Done",
21
33
  "form.success": "Submitted!",
22
34
  "form.viewReport": "View Report",
@@ -33,6 +45,8 @@ const me = {
33
45
  "status.screenshotFailed": "Screenshot failed; you can still send text.",
34
46
  "status.recaptureFailed": "Recapture failed.",
35
47
  "status.submitFailed": "Submit failed.",
48
+ "status.submitTooLarge": "Screenshot too large; retrying smaller…",
49
+ "status.submitWithoutImage": "Submitted without screenshot.",
36
50
  "status.emptyReport": "Add a note, screenshot, or video first.",
37
51
  "status.missingConfig": "Notefully is missing endpoint or projectKey.",
38
52
  "status.speechUnsupported": "Speech recognition is not supported in this browser.",
@@ -55,9 +69,9 @@ const me = {
55
69
  "diag.timezone": "Timezone",
56
70
  "diag.viewport": "Viewport",
57
71
  "diag.user": "User"
58
- }, he = {
59
- "en-US": me
60
- }, Te = {
72
+ }, ke = {
73
+ "en-US": ve
74
+ }, De = {
61
75
  en: "en-US",
62
76
  no: "nb",
63
77
  tl: "fil",
@@ -84,33 +98,33 @@ const me = {
84
98
  "es-PR": ["es-419", "es"],
85
99
  "es-CU": ["es-419", "es"]
86
100
  }, ka = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
87
- let le = "en-US", Pt = {};
88
- function h(e, t) {
89
- !e || !t || typeof t != "object" || (he[String(e)] = t);
101
+ let ue = "en-US", Pt = {};
102
+ function f(e, t) {
103
+ !e || !t || typeof t != "object" || (ke[String(e)] = t);
90
104
  }
91
- function oe(e) {
105
+ function ie(e) {
92
106
  return String(e || "").trim().replace(/_/g, "-");
93
107
  }
94
108
  function ba(e) {
95
- const t = oe(e);
109
+ const t = ie(e);
96
110
  if (!t)
97
111
  return ["en-US"];
98
- const a = t, o = Te[a] || Te[a.toLowerCase()] || a, s = [], i = (n) => {
99
- n && !s.includes(n) && s.push(n);
112
+ const a = t, o = De[a] || De[a.toLowerCase()] || a, s = [], i = (l) => {
113
+ l && !s.includes(l) && s.push(l);
100
114
  };
101
115
  i(o);
102
- for (const [n, u] of Object.entries(va))
103
- n.toLowerCase() === o.toLowerCase() && u.forEach(i);
116
+ for (const [l, u] of Object.entries(va))
117
+ l.toLowerCase() === o.toLowerCase() && u.forEach(i);
104
118
  const r = o.split("-");
105
- for (let n = r.length - 1; n >= 1; n -= 1)
106
- i(r.slice(0, n).join("-"));
107
- return i(Te[r[0]] || r[0]), i("en-US"), s;
119
+ for (let l = r.length - 1; l >= 1; l -= 1)
120
+ i(r.slice(0, l).join("-"));
121
+ return i(De[r[0]] || r[0]), i("en-US"), s;
108
122
  }
109
123
  function wa(e) {
110
124
  for (const t of ba(e)) {
111
- if (he[t])
125
+ if (ke[t])
112
126
  return t;
113
- const a = Object.keys(he).find(
127
+ const a = Object.keys(ke).find(
114
128
  (o) => o.toLowerCase() === t.toLowerCase()
115
129
  );
116
130
  if (a)
@@ -121,33 +135,33 @@ function wa(e) {
121
135
  function Sa(e = {}) {
122
136
  var t;
123
137
  if (e.locale != null && String(e.locale).trim())
124
- return oe(e.locale);
138
+ return ie(e.locale);
125
139
  if (typeof document < "u") {
126
140
  const a = (t = document.documentElement) == null ? void 0 : t.lang;
127
141
  if (a && String(a).trim())
128
- return oe(a);
142
+ return ie(a);
129
143
  }
130
- return typeof navigator < "u" && navigator.language ? oe(navigator.language) : "en-US";
144
+ return typeof navigator < "u" && navigator.language ? ie(navigator.language) : "en-US";
131
145
  }
132
146
  function Aa(e, t) {
133
- return e != null && (le = oe(e) || "en-US"), le;
147
+ return e != null && (ue = ie(e) || "en-US"), ue;
134
148
  }
135
149
  function Ca(e) {
136
150
  Pt = e && typeof e == "object" ? { ...e } : {};
137
151
  }
138
- function fe() {
139
- return le;
152
+ function be() {
153
+ return ue;
140
154
  }
141
- function za(e = le) {
142
- const t = oe(e).split("-")[0].toLowerCase();
155
+ function za(e = ue) {
156
+ const t = ie(e).split("-")[0].toLowerCase();
143
157
  return ka.has(t) ? "rtl" : "ltr";
144
158
  }
145
- function m(e, t) {
146
- const a = String(e || ""), o = wa(le), s = he[o] || me;
147
- let i = Pt[a] ?? s[a] ?? me[a] ?? a;
148
- return String(i);
159
+ function p(e, t) {
160
+ const a = String(e || ""), o = wa(ue), s = ke[o] || ve;
161
+ let i = Pt[a] ?? s[a] ?? ve[a] ?? a;
162
+ return t && typeof t == "object" && (i = String(i).replace(/\{(\w+)\}/g, (r, l) => t[l] == null ? `{${l}}` : String(t[l]))), String(i);
149
163
  }
150
- const ja = {
164
+ const Ea = {
151
165
  "launcher.open": "Оставете бележка...",
152
166
  "tool.crop": "Реколта",
153
167
  "tool.resetCrop": "Нулиране на изрязването",
@@ -204,7 +218,7 @@ const ja = {
204
218
  "diag.timezone": "Часова зона",
205
219
  "diag.viewport": "Изгледна плоча",
206
220
  "diag.user": "Потребител"
207
- }, Ea = {
221
+ }, ja = {
208
222
  "launcher.open": "Deixa una nota...",
209
223
  "tool.crop": "Cultiu",
210
224
  "tool.resetCrop": "Restablir el cultiu",
@@ -375,7 +389,7 @@ const ja = {
375
389
  "diag.timezone": "Tidszone",
376
390
  "diag.viewport": "Viewport",
377
391
  "diag.user": "Bruger"
378
- }, La = {
392
+ }, xa = {
379
393
  "launcher.open": "Hinterlassen Sie eine Notiz...",
380
394
  "tool.crop": "Ernte",
381
395
  "tool.resetCrop": "Zuschnitt zurücksetzen",
@@ -432,7 +446,7 @@ const ja = {
432
446
  "diag.timezone": "Zeitzone",
433
447
  "diag.viewport": "Sichtfenster",
434
448
  "diag.user": "Nutzer"
435
- }, xa = {
449
+ }, La = {
436
450
  "launcher.open": "Αφήστε ένα σημείωμα...",
437
451
  "tool.crop": "Καλλιέργεια",
438
452
  "tool.resetCrop": "Επαναφορά της καλλιέργειας",
@@ -505,9 +519,21 @@ const ja = {
505
519
  "tool.video": "Record video",
506
520
  "tool.stopVideo": "Stop",
507
521
  "form.messagePlaceholder": "Describe the bug or the change you want…",
522
+ "form.placeholder.bug": "What did you expect to happen and what happened instead?",
523
+ "form.placeholder.idea": "What's your idea?",
524
+ "form.placeholder.other": "Describe what you are reporting in detail.",
525
+ "form.placeholder.custom": "{kind}: Describe what you are reporting in detail.",
526
+ "form.title.bug": "Report a Problem",
527
+ "form.title.idea": "Share an Idea",
528
+ "form.title.other": "Send Feedback",
529
+ "form.intro.bug": "Tell us what went wrong.",
530
+ "form.intro.idea": "Tell us what we could improve.",
531
+ "form.intro.other": "Let us know what you think.",
532
+ "form.screenshotNote": "A screenshot of this page is attached. Use the image tools to crop, annotate, remove, or retake the screenshot.",
508
533
  "form.author": "Author",
509
534
  "form.authorPlaceholder": "Anonymous",
510
- "form.submit": "Submit",
535
+ "form.submit": "Send Report",
536
+ "form.close": "Close",
511
537
  "form.done": "Done",
512
538
  "form.success": "Submitted!",
513
539
  "form.viewReport": "View Report",
@@ -524,6 +550,8 @@ const ja = {
524
550
  "status.screenshotFailed": "Screenshot failed; you can still send text.",
525
551
  "status.recaptureFailed": "Recapture failed.",
526
552
  "status.submitFailed": "Submit failed.",
553
+ "status.submitTooLarge": "Screenshot too large; retrying smaller…",
554
+ "status.submitWithoutImage": "Submitted without screenshot.",
527
555
  "status.emptyReport": "Add a note, screenshot, or video first.",
528
556
  "status.missingConfig": "Notefully is missing endpoint or projectKey.",
529
557
  "status.speechUnsupported": "Speech recognition is not supported in this browser.",
@@ -660,7 +688,7 @@ const ja = {
660
688
  "diag.timezone": "Zona horaria",
661
689
  "diag.viewport": "ViEWPORT",
662
690
  "diag.user": "Usuario"
663
- }, Oa = {
691
+ }, Da = {
664
692
  "launcher.open": "Jäta märkus...",
665
693
  "tool.crop": "Põllukultuur",
666
694
  "tool.resetCrop": "Lähtesta põllukultuur",
@@ -717,7 +745,7 @@ const ja = {
717
745
  "diag.timezone": "Ajavöönd",
718
746
  "diag.viewport": "Vaatenurk",
719
747
  "diag.user": "Kasutaja"
720
- }, Da = {
748
+ }, Oa = {
721
749
  "launcher.open": "Jätä muistiinpano...",
722
750
  "tool.crop": "Viljely",
723
751
  "tool.resetCrop": "Nollaa rajaus",
@@ -2371,46 +2399,46 @@ const ja = {
2371
2399
  "diag.viewport": "視埠",
2372
2400
  "diag.user": "使用者"
2373
2401
  };
2374
- h("en-US", me);
2375
- h("bg", ja);
2376
- h("ca", Ea);
2377
- h("cs", Ra);
2378
- h("da", Pa);
2379
- h("de", La);
2380
- h("el", xa);
2381
- h("en-GB", Ua);
2382
- h("es", Ta);
2383
- h("es-419", Fa);
2384
- h("et", Oa);
2385
- h("fi", Da);
2386
- h("fr", Ma);
2387
- h("hi", Ia);
2388
- h("hr", Va);
2389
- h("hu", $a);
2390
- h("id", Ba);
2391
- h("it", Na);
2392
- h("ja", Ka);
2393
- h("ko", Ha);
2394
- h("lt", Ga);
2395
- h("lv", qa);
2396
- h("nb", _a);
2397
- h("nl", Wa);
2398
- h("pl", Za);
2399
- h("pt-BR", Ja);
2400
- h("pt-PT", Ya);
2401
- h("ro", Xa);
2402
- h("ru", Qa);
2403
- h("sk", eo);
2404
- h("sl", to);
2405
- h("sr", ao);
2406
- h("sv", oo);
2407
- h("fil", io);
2408
- h("th", so);
2409
- h("tr", ro);
2410
- h("uk", no);
2411
- h("vi", lo);
2412
- h("zh-CN", uo);
2413
- h("zh-TW", co);
2402
+ f("en-US", ve);
2403
+ f("bg", Ea);
2404
+ f("ca", ja);
2405
+ f("cs", Ra);
2406
+ f("da", Pa);
2407
+ f("de", xa);
2408
+ f("el", La);
2409
+ f("en-GB", Ua);
2410
+ f("es", Ta);
2411
+ f("es-419", Fa);
2412
+ f("et", Da);
2413
+ f("fi", Oa);
2414
+ f("fr", Ma);
2415
+ f("hi", Ia);
2416
+ f("hr", Va);
2417
+ f("hu", $a);
2418
+ f("id", Ba);
2419
+ f("it", Na);
2420
+ f("ja", Ka);
2421
+ f("ko", Ha);
2422
+ f("lt", Ga);
2423
+ f("lv", qa);
2424
+ f("nb", _a);
2425
+ f("nl", Wa);
2426
+ f("pl", Za);
2427
+ f("pt-BR", Ja);
2428
+ f("pt-PT", Ya);
2429
+ f("ro", Xa);
2430
+ f("ru", Qa);
2431
+ f("sk", eo);
2432
+ f("sl", to);
2433
+ f("sr", ao);
2434
+ f("sv", oo);
2435
+ f("fil", io);
2436
+ f("th", so);
2437
+ f("tr", ro);
2438
+ f("uk", no);
2439
+ f("vi", lo);
2440
+ f("zh-CN", uo);
2441
+ f("zh-TW", co);
2414
2442
  function po(e, t) {
2415
2443
  if (e.match(/^[a-z]+:\/\//i))
2416
2444
  return e;
@@ -2429,29 +2457,29 @@ const go = /* @__PURE__ */ (() => {
2429
2457
  );
2430
2458
  return () => (e += 1, `u${t()}${e}`);
2431
2459
  })();
2432
- function G(e) {
2460
+ function J(e) {
2433
2461
  const t = [];
2434
2462
  for (let a = 0, o = e.length; a < o; a++)
2435
2463
  t.push(e[a]);
2436
2464
  return t;
2437
2465
  }
2438
- let te = null;
2439
- function Lt(e = {}) {
2440
- return te || (e.includeStyleProperties ? (te = e.includeStyleProperties, te) : (te = G(window.getComputedStyle(document.documentElement)), te));
2466
+ let ae = null;
2467
+ function xt(e = {}) {
2468
+ return ae || (e.includeStyleProperties ? (ae = e.includeStyleProperties, ae) : (ae = J(window.getComputedStyle(document.documentElement)), ae));
2441
2469
  }
2442
- function ye(e, t) {
2470
+ function we(e, t) {
2443
2471
  const o = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
2444
2472
  return o ? parseFloat(o.replace("px", "")) : 0;
2445
2473
  }
2446
2474
  function mo(e) {
2447
- const t = ye(e, "border-left-width"), a = ye(e, "border-right-width");
2475
+ const t = we(e, "border-left-width"), a = we(e, "border-right-width");
2448
2476
  return e.clientWidth + t + a;
2449
2477
  }
2450
2478
  function ho(e) {
2451
- const t = ye(e, "border-top-width"), a = ye(e, "border-bottom-width");
2479
+ const t = we(e, "border-top-width"), a = we(e, "border-bottom-width");
2452
2480
  return e.clientHeight + t + a;
2453
2481
  }
2454
- function xt(e, t = {}) {
2482
+ function Lt(e, t = {}) {
2455
2483
  const a = t.width || mo(e), o = t.height || ho(e);
2456
2484
  return { width: a, height: o };
2457
2485
  }
@@ -2464,11 +2492,11 @@ function fo() {
2464
2492
  const a = t && t.env ? t.env.devicePixelRatio : null;
2465
2493
  return a && (e = parseInt(a, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
2466
2494
  }
2467
- const R = 16384;
2495
+ const U = 16384;
2468
2496
  function yo(e) {
2469
- (e.width > R || e.height > R) && (e.width > R && e.height > R ? e.width > e.height ? (e.height *= R / e.width, e.width = R) : (e.width *= R / e.height, e.height = R) : e.width > R ? (e.height *= R / e.width, e.width = R) : (e.width *= R / e.height, e.height = R));
2497
+ (e.width > U || e.height > U) && (e.width > U && e.height > U ? e.width > e.height ? (e.height *= U / e.width, e.width = U) : (e.width *= U / e.height, e.height = U) : e.width > U ? (e.height *= U / e.width, e.width = U) : (e.width *= U / e.height, e.height = U));
2470
2498
  }
2471
- function ve(e) {
2499
+ function Se(e) {
2472
2500
  return new Promise((t, a) => {
2473
2501
  const o = new Image();
2474
2502
  o.onload = () => {
@@ -2485,18 +2513,18 @@ async function ko(e, t, a) {
2485
2513
  const o = "http://www.w3.org/2000/svg", s = document.createElementNS(o, "svg"), i = document.createElementNS(o, "foreignObject");
2486
2514
  return s.setAttribute("width", `${t}`), s.setAttribute("height", `${a}`), s.setAttribute("viewBox", `0 0 ${t} ${a}`), i.setAttribute("width", "100%"), i.setAttribute("height", "100%"), i.setAttribute("x", "0"), i.setAttribute("y", "0"), i.setAttribute("externalResourcesRequired", "true"), s.appendChild(i), i.appendChild(e), vo(s);
2487
2515
  }
2488
- const j = (e, t) => {
2516
+ const L = (e, t) => {
2489
2517
  if (e instanceof t)
2490
2518
  return !0;
2491
2519
  const a = Object.getPrototypeOf(e);
2492
- return a === null ? !1 : a.constructor.name === t.name || j(a, t);
2520
+ return a === null ? !1 : a.constructor.name === t.name || L(a, t);
2493
2521
  };
2494
2522
  function bo(e) {
2495
2523
  const t = e.getPropertyValue("content");
2496
2524
  return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
2497
2525
  }
2498
2526
  function wo(e, t) {
2499
- return Lt(t).map((a) => {
2527
+ return xt(t).map((a) => {
2500
2528
  const o = e.getPropertyValue(a), s = e.getPropertyPriority(a);
2501
2529
  return `${a}: ${o}${s ? " !important" : ""};`;
2502
2530
  }).join(" ");
@@ -2505,7 +2533,7 @@ function So(e, t, a, o) {
2505
2533
  const s = `.${e}:${t}`, i = a.cssText ? bo(a) : wo(a, o);
2506
2534
  return document.createTextNode(`${s}{${i}}`);
2507
2535
  }
2508
- function st(e, t, a, o) {
2536
+ function it(e, t, a, o) {
2509
2537
  const s = window.getComputedStyle(e, a), i = s.getPropertyValue("content");
2510
2538
  if (i === "" || i === "none")
2511
2539
  return;
@@ -2515,20 +2543,20 @@ function st(e, t, a, o) {
2515
2543
  } catch {
2516
2544
  return;
2517
2545
  }
2518
- const n = document.createElement("style");
2519
- n.appendChild(So(r, a, s, o)), t.appendChild(n);
2546
+ const l = document.createElement("style");
2547
+ l.appendChild(So(r, a, s, o)), t.appendChild(l);
2520
2548
  }
2521
2549
  function Ao(e, t, a) {
2522
- st(e, t, ":before", a), st(e, t, ":after", a);
2550
+ it(e, t, ":before", a), it(e, t, ":after", a);
2523
2551
  }
2524
- const rt = "application/font-woff", nt = "image/jpeg", Co = {
2525
- woff: rt,
2526
- woff2: rt,
2552
+ const st = "application/font-woff", rt = "image/jpeg", Co = {
2553
+ woff: st,
2554
+ woff2: st,
2527
2555
  ttf: "application/font-truetype",
2528
2556
  eot: "application/vnd.ms-fontobject",
2529
2557
  png: "image/png",
2530
- jpg: nt,
2531
- jpeg: nt,
2558
+ jpg: rt,
2559
+ jpeg: rt,
2532
2560
  gif: "image/gif",
2533
2561
  tiff: "image/tiff",
2534
2562
  svg: "image/svg+xml",
@@ -2538,17 +2566,17 @@ function zo(e) {
2538
2566
  const t = /\.([^./]*?)$/g.exec(e);
2539
2567
  return t ? t[1] : "";
2540
2568
  }
2541
- function We(e) {
2569
+ function _e(e) {
2542
2570
  const t = zo(e).toLowerCase();
2543
2571
  return Co[t] || "";
2544
2572
  }
2545
- function jo(e) {
2573
+ function Eo(e) {
2546
2574
  return e.split(/,/)[1];
2547
2575
  }
2548
- function $e(e) {
2576
+ function Be(e) {
2549
2577
  return e.search(/^(data:)/) !== -1;
2550
2578
  }
2551
- function Eo(e, t) {
2579
+ function jo(e, t) {
2552
2580
  return `data:${t};base64,${e}`;
2553
2581
  }
2554
2582
  async function Ut(e, t, a) {
@@ -2557,62 +2585,62 @@ async function Ut(e, t, a) {
2557
2585
  throw new Error(`Resource "${o.url}" not found`);
2558
2586
  const s = await o.blob();
2559
2587
  return new Promise((i, r) => {
2560
- const n = new FileReader();
2561
- n.onerror = r, n.onloadend = () => {
2588
+ const l = new FileReader();
2589
+ l.onerror = r, l.onloadend = () => {
2562
2590
  try {
2563
- i(a({ res: o, result: n.result }));
2591
+ i(a({ res: o, result: l.result }));
2564
2592
  } catch (u) {
2565
2593
  r(u);
2566
2594
  }
2567
- }, n.readAsDataURL(s);
2595
+ }, l.readAsDataURL(s);
2568
2596
  });
2569
2597
  }
2570
- const Fe = {};
2598
+ const Oe = {};
2571
2599
  function Ro(e, t, a) {
2572
2600
  let o = e.replace(/\?.*/, "");
2573
2601
  return a && (o = e), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), t ? `[${t}]${o}` : o;
2574
2602
  }
2575
- async function Ze(e, t, a) {
2603
+ async function We(e, t, a) {
2576
2604
  const o = Ro(e, t, a.includeQueryParams);
2577
- if (Fe[o] != null)
2578
- return Fe[o];
2605
+ if (Oe[o] != null)
2606
+ return Oe[o];
2579
2607
  a.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
2580
2608
  let s;
2581
2609
  try {
2582
- const i = await Ut(e, a.fetchRequestInit, ({ res: r, result: n }) => (t || (t = r.headers.get("Content-Type") || ""), jo(n)));
2583
- s = Eo(i, t);
2610
+ const i = await Ut(e, a.fetchRequestInit, ({ res: r, result: l }) => (t || (t = r.headers.get("Content-Type") || ""), Eo(l)));
2611
+ s = jo(i, t);
2584
2612
  } catch (i) {
2585
2613
  s = a.imagePlaceholder || "";
2586
2614
  let r = `Failed to fetch resource: ${e}`;
2587
2615
  i && (r = typeof i == "string" ? i : i.message), r && console.warn(r);
2588
2616
  }
2589
- return Fe[o] = s, s;
2617
+ return Oe[o] = s, s;
2590
2618
  }
2591
2619
  async function Po(e) {
2592
2620
  const t = e.toDataURL();
2593
- return t === "data:," ? e.cloneNode(!1) : ve(t);
2621
+ return t === "data:," ? e.cloneNode(!1) : Se(t);
2594
2622
  }
2595
- async function Lo(e, t) {
2623
+ async function xo(e, t) {
2596
2624
  if (e.currentSrc) {
2597
2625
  const i = document.createElement("canvas"), r = i.getContext("2d");
2598
2626
  i.width = e.clientWidth, i.height = e.clientHeight, r == null || r.drawImage(e, 0, 0, i.width, i.height);
2599
- const n = i.toDataURL();
2600
- return ve(n);
2627
+ const l = i.toDataURL();
2628
+ return Se(l);
2601
2629
  }
2602
- const a = e.poster, o = We(a), s = await Ze(a, o, t);
2603
- return ve(s);
2630
+ const a = e.poster, o = _e(a), s = await We(a, o, t);
2631
+ return Se(s);
2604
2632
  }
2605
- async function xo(e, t) {
2633
+ async function Lo(e, t) {
2606
2634
  var a;
2607
2635
  try {
2608
2636
  if (!((a = e == null ? void 0 : e.contentDocument) === null || a === void 0) && a.body)
2609
- return await je(e.contentDocument.body, t, !0);
2637
+ return await xe(e.contentDocument.body, t, !0);
2610
2638
  } catch {
2611
2639
  }
2612
2640
  return e.cloneNode(!1);
2613
2641
  }
2614
2642
  async function Uo(e, t) {
2615
- return j(e, HTMLCanvasElement) ? Po(e) : j(e, HTMLVideoElement) ? Lo(e, t) : j(e, HTMLIFrameElement) ? xo(e, t) : e.cloneNode(Tt(e));
2643
+ return L(e, HTMLCanvasElement) ? Po(e) : L(e, HTMLVideoElement) ? xo(e, t) : L(e, HTMLIFrameElement) ? Lo(e, t) : e.cloneNode(Tt(e));
2616
2644
  }
2617
2645
  const To = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Tt = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
2618
2646
  async function Fo(e, t, a) {
@@ -2620,31 +2648,31 @@ async function Fo(e, t, a) {
2620
2648
  if (Tt(t))
2621
2649
  return t;
2622
2650
  let i = [];
2623
- return To(e) && e.assignedNodes ? i = G(e.assignedNodes()) : j(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = G(e.contentDocument.body.childNodes) : i = G(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || j(e, HTMLVideoElement) || await i.reduce((r, n) => r.then(() => je(n, a)).then((u) => {
2651
+ return To(e) && e.assignedNodes ? i = J(e.assignedNodes()) : L(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = J(e.contentDocument.body.childNodes) : i = J(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || L(e, HTMLVideoElement) || await i.reduce((r, l) => r.then(() => xe(l, a)).then((u) => {
2624
2652
  u && t.appendChild(u);
2625
2653
  }), Promise.resolve()), t;
2626
2654
  }
2627
- function Oo(e, t, a) {
2655
+ function Do(e, t, a) {
2628
2656
  const o = t.style;
2629
2657
  if (!o)
2630
2658
  return;
2631
2659
  const s = window.getComputedStyle(e);
2632
- s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : Lt(a).forEach((i) => {
2660
+ s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : xt(a).forEach((i) => {
2633
2661
  let r = s.getPropertyValue(i);
2634
- i === "font-size" && r.endsWith("px") && (r = `${Math.floor(parseFloat(r.substring(0, r.length - 2))) - 0.1}px`), j(e, HTMLIFrameElement) && i === "display" && r === "inline" && (r = "block"), i === "d" && t.getAttribute("d") && (r = `path(${t.getAttribute("d")})`), o.setProperty(i, r, s.getPropertyPriority(i));
2662
+ i === "font-size" && r.endsWith("px") && (r = `${Math.floor(parseFloat(r.substring(0, r.length - 2))) - 0.1}px`), L(e, HTMLIFrameElement) && i === "display" && r === "inline" && (r = "block"), i === "d" && t.getAttribute("d") && (r = `path(${t.getAttribute("d")})`), o.setProperty(i, r, s.getPropertyPriority(i));
2635
2663
  });
2636
2664
  }
2637
- function Do(e, t) {
2638
- j(e, HTMLTextAreaElement) && (t.innerHTML = e.value), j(e, HTMLInputElement) && t.setAttribute("value", e.value);
2665
+ function Oo(e, t) {
2666
+ L(e, HTMLTextAreaElement) && (t.innerHTML = e.value), L(e, HTMLInputElement) && t.setAttribute("value", e.value);
2639
2667
  }
2640
2668
  function Mo(e, t) {
2641
- if (j(e, HTMLSelectElement)) {
2669
+ if (L(e, HTMLSelectElement)) {
2642
2670
  const o = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
2643
2671
  o && o.setAttribute("selected", "");
2644
2672
  }
2645
2673
  }
2646
2674
  function Io(e, t, a) {
2647
- return j(t, Element) && (Oo(e, t, a), Ao(e, t, a), Do(e, t), Mo(e, t)), t;
2675
+ return L(t, Element) && (Do(e, t, a), Ao(e, t, a), Oo(e, t), Mo(e, t)), t;
2648
2676
  }
2649
2677
  async function Vo(e, t) {
2650
2678
  const a = e.querySelectorAll ? e.querySelectorAll("use") : [];
@@ -2652,25 +2680,25 @@ async function Vo(e, t) {
2652
2680
  return e;
2653
2681
  const o = {};
2654
2682
  for (let i = 0; i < a.length; i++) {
2655
- const n = a[i].getAttribute("xlink:href");
2656
- if (n) {
2657
- const u = e.querySelector(n), d = document.querySelector(n);
2658
- !u && d && !o[n] && (o[n] = await je(d, t, !0));
2683
+ const l = a[i].getAttribute("xlink:href");
2684
+ if (l) {
2685
+ const u = e.querySelector(l), c = document.querySelector(l);
2686
+ !u && c && !o[l] && (o[l] = await xe(c, t, !0));
2659
2687
  }
2660
2688
  }
2661
2689
  const s = Object.values(o);
2662
2690
  if (s.length) {
2663
2691
  const i = "http://www.w3.org/1999/xhtml", r = document.createElementNS(i, "svg");
2664
2692
  r.setAttribute("xmlns", i), r.style.position = "absolute", r.style.width = "0", r.style.height = "0", r.style.overflow = "hidden", r.style.display = "none";
2665
- const n = document.createElementNS(i, "defs");
2666
- r.appendChild(n);
2693
+ const l = document.createElementNS(i, "defs");
2694
+ r.appendChild(l);
2667
2695
  for (let u = 0; u < s.length; u++)
2668
- n.appendChild(s[u]);
2696
+ l.appendChild(s[u]);
2669
2697
  e.appendChild(r);
2670
2698
  }
2671
2699
  return e;
2672
2700
  }
2673
- async function je(e, t, a) {
2701
+ async function xe(e, t, a) {
2674
2702
  return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) => Uo(o, t)).then((o) => Fo(e, o, t)).then((o) => Io(e, o, t)).then((o) => Vo(o, t));
2675
2703
  }
2676
2704
  const Ft = /url\((['"]?)([^'"]+?)\1\)/g, $o = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Bo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
@@ -2680,13 +2708,13 @@ function No(e) {
2680
2708
  }
2681
2709
  function Ko(e) {
2682
2710
  const t = [];
2683
- return e.replace(Ft, (a, o, s) => (t.push(s), a)), t.filter((a) => !$e(a));
2711
+ return e.replace(Ft, (a, o, s) => (t.push(s), a)), t.filter((a) => !Be(a));
2684
2712
  }
2685
2713
  async function Ho(e, t, a, o, s) {
2686
2714
  try {
2687
- const i = a ? po(t, a) : t, r = We(t);
2688
- let n;
2689
- return s || (n = await Ze(i, r, o)), e.replace(No(t), `$1${n}$3`);
2715
+ const i = a ? po(t, a) : t, r = _e(t);
2716
+ let l;
2717
+ return s || (l = await We(i, r, o)), e.replace(No(t), `$1${l}$3`);
2690
2718
  } catch {
2691
2719
  }
2692
2720
  return e;
@@ -2702,50 +2730,50 @@ function Go(e, { preferredFontFormat: t }) {
2702
2730
  }
2703
2731
  }) : e;
2704
2732
  }
2705
- function Ot(e) {
2733
+ function Dt(e) {
2706
2734
  return e.search(Ft) !== -1;
2707
2735
  }
2708
- async function Dt(e, t, a) {
2709
- if (!Ot(e))
2736
+ async function Ot(e, t, a) {
2737
+ if (!Dt(e))
2710
2738
  return e;
2711
2739
  const o = Go(e, a);
2712
- return Ko(o).reduce((i, r) => i.then((n) => Ho(n, r, t, a)), Promise.resolve(o));
2740
+ return Ko(o).reduce((i, r) => i.then((l) => Ho(l, r, t, a)), Promise.resolve(o));
2713
2741
  }
2714
- async function ae(e, t, a) {
2742
+ async function oe(e, t, a) {
2715
2743
  var o;
2716
2744
  const s = (o = t.style) === null || o === void 0 ? void 0 : o.getPropertyValue(e);
2717
2745
  if (s) {
2718
- const i = await Dt(s, null, a);
2746
+ const i = await Ot(s, null, a);
2719
2747
  return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
2720
2748
  }
2721
2749
  return !1;
2722
2750
  }
2723
2751
  async function qo(e, t) {
2724
- await ae("background", e, t) || await ae("background-image", e, t), await ae("mask", e, t) || await ae("-webkit-mask", e, t) || await ae("mask-image", e, t) || await ae("-webkit-mask-image", e, t);
2752
+ await oe("background", e, t) || await oe("background-image", e, t), await oe("mask", e, t) || await oe("-webkit-mask", e, t) || await oe("mask-image", e, t) || await oe("-webkit-mask-image", e, t);
2725
2753
  }
2726
2754
  async function _o(e, t) {
2727
- const a = j(e, HTMLImageElement);
2728
- if (!(a && !$e(e.src)) && !(j(e, SVGImageElement) && !$e(e.href.baseVal)))
2755
+ const a = L(e, HTMLImageElement);
2756
+ if (!(a && !Be(e.src)) && !(L(e, SVGImageElement) && !Be(e.href.baseVal)))
2729
2757
  return;
2730
- const o = a ? e.src : e.href.baseVal, s = await Ze(o, We(o), t);
2758
+ const o = a ? e.src : e.href.baseVal, s = await We(o, _e(o), t);
2731
2759
  await new Promise((i, r) => {
2732
2760
  e.onload = i, e.onerror = t.onImageErrorHandler ? (...u) => {
2733
2761
  try {
2734
2762
  i(t.onImageErrorHandler(...u));
2735
- } catch (d) {
2736
- r(d);
2763
+ } catch (c) {
2764
+ r(c);
2737
2765
  }
2738
2766
  } : r;
2739
- const n = e;
2740
- n.decode && (n.decode = i), n.loading === "lazy" && (n.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
2767
+ const l = e;
2768
+ l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
2741
2769
  });
2742
2770
  }
2743
2771
  async function Wo(e, t) {
2744
- const o = G(e.childNodes).map((s) => Mt(s, t));
2772
+ const o = J(e.childNodes).map((s) => Mt(s, t));
2745
2773
  await Promise.all(o).then(() => e);
2746
2774
  }
2747
2775
  async function Mt(e, t) {
2748
- j(e, Element) && (await qo(e, t), await _o(e, t), await Wo(e, t));
2776
+ L(e, Element) && (await qo(e, t), await _o(e, t), await Wo(e, t));
2749
2777
  }
2750
2778
  function Zo(e, t) {
2751
2779
  const { style: a } = e;
@@ -2755,19 +2783,19 @@ function Zo(e, t) {
2755
2783
  a[s] = o[s];
2756
2784
  }), e;
2757
2785
  }
2758
- const lt = {};
2759
- async function ut(e) {
2760
- let t = lt[e];
2786
+ const nt = {};
2787
+ async function lt(e) {
2788
+ let t = nt[e];
2761
2789
  if (t != null)
2762
2790
  return t;
2763
2791
  const o = await (await fetch(e)).text();
2764
- return t = { url: e, cssText: o }, lt[e] = t, t;
2792
+ return t = { url: e, cssText: o }, nt[e] = t, t;
2765
2793
  }
2766
- async function dt(e, t) {
2794
+ async function ut(e, t) {
2767
2795
  let a = e.cssText;
2768
2796
  const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (r) => {
2769
- let n = r.replace(o, "$1");
2770
- return n.startsWith("https://") || (n = new URL(n, e.url).href), Ut(n, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
2797
+ let l = r.replace(o, "$1");
2798
+ return l.startsWith("https://") || (l = new URL(l, e.url).href), Ut(l, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
2771
2799
  });
2772
2800
  return Promise.all(i).then(() => a);
2773
2801
  }
@@ -2784,15 +2812,15 @@ function ct(e) {
2784
2812
  t.push(u[0]);
2785
2813
  }
2786
2814
  o = o.replace(s, "");
2787
- const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, r = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", n = new RegExp(r, "gi");
2815
+ const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi, r = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", l = new RegExp(r, "gi");
2788
2816
  for (; ; ) {
2789
2817
  let u = i.exec(o);
2790
2818
  if (u === null) {
2791
- if (u = n.exec(o), u === null)
2819
+ if (u = l.exec(o), u === null)
2792
2820
  break;
2793
- i.lastIndex = n.lastIndex;
2821
+ i.lastIndex = l.lastIndex;
2794
2822
  } else
2795
- n.lastIndex = i.lastIndex;
2823
+ l.lastIndex = i.lastIndex;
2796
2824
  t.push(u[0]);
2797
2825
  }
2798
2826
  return t;
@@ -2802,36 +2830,36 @@ async function Jo(e, t) {
2802
2830
  return e.forEach((s) => {
2803
2831
  if ("cssRules" in s)
2804
2832
  try {
2805
- G(s.cssRules || []).forEach((i, r) => {
2833
+ J(s.cssRules || []).forEach((i, r) => {
2806
2834
  if (i.type === CSSRule.IMPORT_RULE) {
2807
- let n = r + 1;
2808
- const u = i.href, d = ut(u).then((p) => dt(p, t)).then((p) => ct(p).forEach((y) => {
2835
+ let l = r + 1;
2836
+ const u = i.href, c = lt(u).then((g) => ut(g, t)).then((g) => ct(g).forEach((v) => {
2809
2837
  try {
2810
- s.insertRule(y, y.startsWith("@import") ? n += 1 : s.cssRules.length);
2811
- } catch (v) {
2838
+ s.insertRule(v, v.startsWith("@import") ? l += 1 : s.cssRules.length);
2839
+ } catch (k) {
2812
2840
  console.error("Error inserting rule from remote css", {
2813
- rule: y,
2814
- error: v
2841
+ rule: v,
2842
+ error: k
2815
2843
  });
2816
2844
  }
2817
- })).catch((p) => {
2818
- console.error("Error loading remote css", p.toString());
2845
+ })).catch((g) => {
2846
+ console.error("Error loading remote css", g.toString());
2819
2847
  });
2820
- o.push(d);
2848
+ o.push(c);
2821
2849
  }
2822
2850
  });
2823
2851
  } catch (i) {
2824
- const r = e.find((n) => n.href == null) || document.styleSheets[0];
2825
- s.href != null && o.push(ut(s.href).then((n) => dt(n, t)).then((n) => ct(n).forEach((u) => {
2852
+ const r = e.find((l) => l.href == null) || document.styleSheets[0];
2853
+ s.href != null && o.push(lt(s.href).then((l) => ut(l, t)).then((l) => ct(l).forEach((u) => {
2826
2854
  r.insertRule(u, r.cssRules.length);
2827
- })).catch((n) => {
2828
- console.error("Error loading remote stylesheet", n);
2855
+ })).catch((l) => {
2856
+ console.error("Error loading remote stylesheet", l);
2829
2857
  })), console.error("Error inlining remote css file", i);
2830
2858
  }
2831
2859
  }), Promise.all(o).then(() => (e.forEach((s) => {
2832
2860
  if ("cssRules" in s)
2833
2861
  try {
2834
- G(s.cssRules || []).forEach((i) => {
2862
+ J(s.cssRules || []).forEach((i) => {
2835
2863
  a.push(i);
2836
2864
  });
2837
2865
  } catch (i) {
@@ -2840,12 +2868,12 @@ async function Jo(e, t) {
2840
2868
  }), a));
2841
2869
  }
2842
2870
  function Yo(e) {
2843
- return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Ot(t.style.getPropertyValue("src")));
2871
+ return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Dt(t.style.getPropertyValue("src")));
2844
2872
  }
2845
2873
  async function Xo(e, t) {
2846
2874
  if (e.ownerDocument == null)
2847
2875
  throw new Error("Provided element is not within a Document");
2848
- const a = G(e.ownerDocument.styleSheets), o = await Jo(a, t);
2876
+ const a = J(e.ownerDocument.styleSheets), o = await Jo(a, t);
2849
2877
  return Yo(o);
2850
2878
  }
2851
2879
  function It(e) {
@@ -2866,7 +2894,7 @@ async function ei(e, t) {
2866
2894
  const a = await Xo(e, t), o = Qo(e);
2867
2895
  return (await Promise.all(a.filter((i) => o.has(It(i.style.fontFamily))).map((i) => {
2868
2896
  const r = i.parentStyleSheet ? i.parentStyleSheet.href : null;
2869
- return Dt(i.cssText, r, t);
2897
+ return Ot(i.cssText, r, t);
2870
2898
  }))).join(`
2871
2899
  `);
2872
2900
  }
@@ -2878,19 +2906,19 @@ async function ti(e, t) {
2878
2906
  }
2879
2907
  }
2880
2908
  async function ai(e, t = {}) {
2881
- const { width: a, height: o } = xt(e, t), s = await je(e, t, !0);
2909
+ const { width: a, height: o } = Lt(e, t), s = await xe(e, t, !0);
2882
2910
  return await ti(s, t), await Mt(s, t), Zo(s, t), await ko(s, a, o);
2883
2911
  }
2884
2912
  async function oi(e, t = {}) {
2885
- const { width: a, height: o } = xt(e, t), s = await ai(e, t), i = await ve(s), r = document.createElement("canvas"), n = r.getContext("2d"), u = t.pixelRatio || fo(), d = t.canvasWidth || a, p = t.canvasHeight || o;
2886
- return r.width = d * u, r.height = p * u, t.skipAutoScale || yo(r), r.style.width = `${d}`, r.style.height = `${p}`, t.backgroundColor && (n.fillStyle = t.backgroundColor, n.fillRect(0, 0, r.width, r.height)), n.drawImage(i, 0, 0, r.width, r.height), r;
2913
+ const { width: a, height: o } = Lt(e, t), s = await ai(e, t), i = await Se(s), r = document.createElement("canvas"), l = r.getContext("2d"), u = t.pixelRatio || fo(), c = t.canvasWidth || a, g = t.canvasHeight || o;
2914
+ return r.width = c * u, r.height = g * u, t.skipAutoScale || yo(r), r.style.width = `${c}`, r.style.height = `${g}`, t.backgroundColor && (l.fillStyle = t.backgroundColor, l.fillRect(0, 0, r.width, r.height)), l.drawImage(i, 0, 0, r.width, r.height), r;
2887
2915
  }
2888
- async function pt(e, t = {}) {
2916
+ async function dt(e, t = {}) {
2889
2917
  return (await oi(e, t)).toDataURL();
2890
2918
  }
2891
- const ke = "data-nf-capture-chrome", ii = "data-nf-canvas-snap", si = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2919
+ const Ae = "data-nf-capture-chrome", ii = "data-nf-canvas-snap", si = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
2892
2920
  function Vt(e) {
2893
- return e instanceof Element && (e.hasAttribute(ke) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
2921
+ return e instanceof Element && (e.hasAttribute(Ae) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
2894
2922
  }
2895
2923
  function ri() {
2896
2924
  const e = [];
@@ -2933,27 +2961,27 @@ function ni() {
2933
2961
  }), () => e.forEach((a) => a.remove());
2934
2962
  }
2935
2963
  function li() {
2936
- const e = document.querySelector(`[${ke}]`);
2964
+ const e = document.querySelector(`[${Ae}]`);
2937
2965
  if (e)
2938
2966
  return e;
2939
2967
  const t = document.createElement("div");
2940
- return t.setAttribute(ke, "1"), t.className = "nf-capture-chrome", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.innerHTML = `<span class="nf-capture-chrome-pill">${m("status.capturing")}</span>`, document.body.appendChild(t), t;
2968
+ return t.setAttribute(Ae, "1"), t.className = "nf-capture-chrome", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.innerHTML = `<span class="nf-capture-chrome-pill">${p("status.capturing")}</span>`, document.body.appendChild(t), t;
2941
2969
  }
2942
2970
  function ui() {
2943
- document.querySelectorAll(`[${ke}]`).forEach((e) => e.remove());
2971
+ document.querySelectorAll(`[${Ae}]`).forEach((e) => e.remove());
2944
2972
  }
2945
- function Be() {
2973
+ function Ne() {
2946
2974
  return new Promise((e) => {
2947
2975
  requestAnimationFrame(() => requestAnimationFrame(e));
2948
2976
  });
2949
2977
  }
2950
- function q(e) {
2978
+ function Y(e) {
2951
2979
  if (typeof e != "string" || !e.startsWith("data:image/"))
2952
2980
  return !1;
2953
2981
  const t = e.indexOf(",");
2954
2982
  return t > 0 && t < e.length - 1;
2955
2983
  }
2956
- function di() {
2984
+ function ci() {
2957
2985
  const e = document.documentElement, t = document.body, a = Math.max(
2958
2986
  window.innerWidth || 0,
2959
2987
  (e == null ? void 0 : e.clientWidth) || 0,
@@ -2969,7 +2997,7 @@ function di() {
2969
2997
  );
2970
2998
  return { width: a, height: o };
2971
2999
  }
2972
- async function ci() {
3000
+ async function di() {
2973
3001
  const e = [], t = Array.from(document.querySelectorAll("canvas"));
2974
3002
  for (const a of t) {
2975
3003
  if (a.closest("#notefully") || Vt(a))
@@ -3003,17 +3031,17 @@ async function pi(e) {
3003
3031
  if (!e)
3004
3032
  return null;
3005
3033
  if (typeof e == "string")
3006
- return q(e) ? e : null;
3034
+ return Y(e) ? e : null;
3007
3035
  if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
3008
3036
  try {
3009
3037
  const t = e.toDataURL("image/png");
3010
- return q(t) ? t : null;
3038
+ return Y(t) ? t : null;
3011
3039
  } catch {
3012
3040
  return null;
3013
3041
  }
3014
3042
  if (typeof Blob < "u" && e instanceof Blob) {
3015
3043
  const t = await gi(e);
3016
- return q(t) ? t : null;
3044
+ return Y(t) ? t : null;
3017
3045
  }
3018
3046
  return null;
3019
3047
  }
@@ -3029,7 +3057,7 @@ async function gi(e) {
3029
3057
  async function mi() {
3030
3058
  var t;
3031
3059
  if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
3032
- throw new Error(m("status.screenUnsupported"));
3060
+ throw new Error(p("status.screenUnsupported"));
3033
3061
  const e = await navigator.mediaDevices.getDisplayMedia({
3034
3062
  video: { displaySurface: "browser" },
3035
3063
  audio: !1,
@@ -3038,14 +3066,14 @@ async function mi() {
3038
3066
  });
3039
3067
  try {
3040
3068
  const a = document.createElement("video");
3041
- a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((n) => {
3042
- a.onloadedmetadata = () => n();
3043
- }), await Be();
3069
+ a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((l) => {
3070
+ a.onloadedmetadata = () => l();
3071
+ }), await Ne();
3044
3072
  const o = a.videoWidth || 1, s = a.videoHeight || 1, i = document.createElement("canvas");
3045
3073
  i.width = o, i.height = s, i.getContext("2d").drawImage(a, 0, 0, o, s);
3046
3074
  const r = i.toDataURL("image/png");
3047
- if (!q(r))
3048
- throw new Error(m("status.screenEmpty"));
3075
+ if (!Y(r))
3076
+ throw new Error(p("status.screenEmpty"));
3049
3077
  return r;
3050
3078
  } finally {
3051
3079
  e.getTracks().forEach((a) => a.stop());
@@ -3058,32 +3086,32 @@ async function $t(e = {}) {
3058
3086
  t && (t.style.display = "none");
3059
3087
  const r = ni();
3060
3088
  try {
3061
- if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Be(), typeof e.capture == "function") {
3062
- const y = await pi(await e.capture());
3063
- if (y)
3064
- return y;
3089
+ if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Ne(), typeof e.capture == "function") {
3090
+ const v = await pi(await e.capture());
3091
+ if (v)
3092
+ return v;
3065
3093
  }
3066
- i = await ci(), await Be();
3067
- const { width: n, height: u } = di(), d = {
3094
+ i = await di(), await Ne();
3095
+ const { width: l, height: u } = ci(), c = {
3068
3096
  cacheBust: !0,
3069
- width: n,
3097
+ width: l,
3070
3098
  height: u,
3071
3099
  pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
3072
- filter: (y) => !Vt(y),
3100
+ filter: (v) => !Vt(v),
3073
3101
  // 404 / CORS images must not abort the whole capture.
3074
3102
  imagePlaceholder: si,
3075
3103
  onImageErrorHandler: () => {
3076
3104
  }
3077
3105
  };
3078
- let p = "";
3106
+ let g = "";
3079
3107
  try {
3080
- p = await pt(document.body, d);
3108
+ g = await dt(document.body, c);
3081
3109
  } catch {
3082
- p = await pt(document.body, { ...d, skipFonts: !0 });
3110
+ g = await dt(document.body, { ...c, skipFonts: !0 });
3083
3111
  }
3084
- if (!q(p))
3085
- throw new Error(m("status.captureEmpty"));
3086
- return p;
3112
+ if (!Y(g))
3113
+ throw new Error(p("status.captureEmpty"));
3114
+ return g;
3087
3115
  } finally {
3088
3116
  try {
3089
3117
  i();
@@ -3115,6 +3143,11 @@ function yi(e = {}) {
3115
3143
  height: window.innerHeight,
3116
3144
  dpr: window.devicePixelRatio || 1
3117
3145
  },
3146
+ screen: {
3147
+ width: typeof screen < "u" ? screen.width : null,
3148
+ height: typeof screen < "u" ? screen.height : null,
3149
+ dpr: window.devicePixelRatio || 1
3150
+ },
3118
3151
  user: {
3119
3152
  userId: e.userId || null,
3120
3153
  email: e.email || null,
@@ -3122,11 +3155,11 @@ function yi(e = {}) {
3122
3155
  }
3123
3156
  };
3124
3157
  }
3125
- const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
3158
+ const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
3126
3159
  id: "userId",
3127
3160
  username: "displayName",
3128
3161
  name: "displayName"
3129
- }, ht = /* @__PURE__ */ new Set([
3162
+ }, mt = /* @__PURE__ */ new Set([
3130
3163
  "endpoint",
3131
3164
  "projectKey",
3132
3165
  "version",
@@ -3144,7 +3177,7 @@ const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
3144
3177
  "displayLink",
3145
3178
  "locale",
3146
3179
  "translations"
3147
- ]), ft = {
3180
+ ]), ht = {
3148
3181
  slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
3149
3182
  projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
3150
3183
  project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
@@ -3155,14 +3188,14 @@ const gt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), mt = {
3155
3188
  };
3156
3189
  function vi(e = {}, t = {}) {
3157
3190
  const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
3158
- for (const r of gt)
3191
+ for (const r of pt)
3159
3192
  Object.prototype.hasOwnProperty.call(o, r) && (s[r] = o[r]);
3160
- for (const [r, n] of Object.entries(mt))
3161
- Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, n) || (s[n] = o[r]));
3193
+ for (const [r, l] of Object.entries(gt))
3194
+ Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, l) || (s[l] = o[r]));
3162
3195
  for (const r of Object.keys(o))
3163
- gt.has(r) || Object.prototype.hasOwnProperty.call(mt, r) || i.push(r);
3196
+ pt.has(r) || Object.prototype.hasOwnProperty.call(gt, r) || i.push(r);
3164
3197
  if (i.length) {
3165
- const r = i.some((n) => n === "name" || n === "slug" || n === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3198
+ const r = i.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
3166
3199
  a(
3167
3200
  `Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + r
3168
3201
  );
@@ -3170,23 +3203,23 @@ function vi(e = {}, t = {}) {
3170
3203
  return s;
3171
3204
  }
3172
3205
  function ki(e = {}, t = {}) {
3173
- const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !ht.has(i));
3206
+ const a = t.warn || Bt, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !mt.has(i));
3174
3207
  if (s.length)
3175
3208
  for (const i of s) {
3176
- if (ft[i]) {
3177
- a(`Notefully.init: ignoring "${i}". ${ft[i]}`);
3209
+ if (ht[i]) {
3210
+ a(`Notefully.init: ignoring "${i}". ${ht[i]}`);
3178
3211
  continue;
3179
3212
  }
3180
3213
  a(
3181
- `Notefully.init: ignoring unknown key "${i}". Supported: ${[...ht].join(", ")}.`
3214
+ `Notefully.init: ignoring unknown key "${i}". Supported: ${[...mt].join(", ")}.`
3182
3215
  );
3183
3216
  }
3184
3217
  }
3185
3218
  function Bt(e) {
3186
3219
  typeof console < "u" && typeof console.warn == "function" && console.warn(e);
3187
3220
  }
3188
- const yt = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, bi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3189
- function vt(e) {
3221
+ const ft = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, bi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
3222
+ function yt(e) {
3190
3223
  if (e instanceof Error)
3191
3224
  return e.stack || e.message || String(e);
3192
3225
  if (typeof e == "string")
@@ -3197,33 +3230,33 @@ function vt(e) {
3197
3230
  return String(e);
3198
3231
  }
3199
3232
  }
3200
- function Je(e) {
3233
+ function Ze(e) {
3201
3234
  if (!e || typeof e != "string")
3202
3235
  return "";
3203
3236
  let t = e.replace(/[\u0000-\u001F\u007F]/g, "").trim();
3204
- return t ? (yt.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !yt.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
3237
+ return t ? (ft.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !ft.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
3205
3238
  }
3206
3239
  function wi(e = []) {
3207
3240
  if (!e.length)
3208
3241
  return { text: "", segments: [{ text: "", style: null }] };
3209
3242
  const t = e[0];
3210
3243
  if (typeof t != "string" || !t.includes("%c")) {
3211
- const r = e.map(vt).join(" ");
3244
+ const r = e.map(yt).join(" ");
3212
3245
  return { text: r, segments: [{ text: r, style: null }] };
3213
3246
  }
3214
3247
  const a = t.split("%c"), o = [];
3215
3248
  let s = 1;
3216
3249
  for (let r = 0; r < a.length; r++) {
3217
- const n = a[r];
3250
+ const l = a[r];
3218
3251
  if (r === 0) {
3219
- n && o.push({ text: n, style: null });
3252
+ l && o.push({ text: l, style: null });
3220
3253
  continue;
3221
3254
  }
3222
- const u = s < e.length ? String(e[s++] ?? "") : "", d = Je(u) || null;
3223
- o.push({ text: n, style: d });
3255
+ const u = s < e.length ? String(e[s++] ?? "") : "", c = Ze(u) || null;
3256
+ o.push({ text: l, style: c });
3224
3257
  }
3225
3258
  if (s < e.length) {
3226
- const r = e.slice(s).map(vt).join(" ");
3259
+ const r = e.slice(s).map(yt).join(" ");
3227
3260
  r && o.push({
3228
3261
  text: (o.length ? " " : "") + r,
3229
3262
  style: null
@@ -3241,62 +3274,62 @@ function Si(e) {
3241
3274
  const a = t.split("%c"), o = a[a.length - 1], s = o.match(bi);
3242
3275
  let i = "";
3243
3276
  if (s) {
3244
- const u = s.index, d = /\s/.test(o[u]) ? u + 1 : u;
3245
- /^[a-z-]+\s*:/i.test(o.slice(d)) && (a[a.length - 1] = o.slice(0, d).replace(/\s+$/, ""), i = o.slice(d).trim());
3277
+ const u = s.index, c = /\s/.test(o[u]) ? u + 1 : u;
3278
+ /^[a-z-]+\s*:/i.test(o.slice(c)) && (a[a.length - 1] = o.slice(0, c).replace(/\s+$/, ""), i = o.slice(c).trim());
3246
3279
  }
3247
- const r = Je(i) || null, n = [];
3280
+ const r = Ze(i) || null, l = [];
3248
3281
  for (let u = 0; u < a.length; u++) {
3249
- const d = a[u];
3282
+ const c = a[u];
3250
3283
  if (u === 0) {
3251
- d && n.push({ text: d, style: null });
3284
+ c && l.push({ text: c, style: null });
3252
3285
  continue;
3253
3286
  }
3254
- n.push({
3255
- text: d,
3287
+ l.push({
3288
+ text: c,
3256
3289
  style: u === 1 ? r : null
3257
3290
  });
3258
3291
  }
3259
- return n.length ? n : [{ text: t, style: null }];
3292
+ return l.length ? l : [{ text: t, style: null }];
3260
3293
  }
3261
3294
  function Nt(e = {}) {
3262
3295
  return Array.isArray(e.segments) && e.segments.length ? e.segments.map((t) => ({
3263
3296
  text: String((t == null ? void 0 : t.text) ?? ""),
3264
- style: Je(t == null ? void 0 : t.style) || null
3297
+ style: Ze(t == null ? void 0 : t.style) || null
3265
3298
  })) : Si(e.text);
3266
3299
  }
3267
3300
  function Ai(e = {}) {
3268
3301
  return Nt(e).map((a) => a.text).join("");
3269
3302
  }
3270
- function kt(e) {
3303
+ function vt(e) {
3271
3304
  return String(e ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3272
3305
  }
3273
3306
  function Ci(e = {}) {
3274
3307
  return Nt(e).map((t) => {
3275
- const a = kt(t.text);
3276
- return t.style ? `<span class="nf-console-styled" style="${kt(t.style)}">${a}</span>` : a;
3308
+ const a = vt(t.text);
3309
+ return t.style ? `<span class="nf-console-styled" style="${vt(t.style)}">${a}</span>` : a;
3277
3310
  }).join("");
3278
3311
  }
3279
3312
  const zi = 80;
3280
- function ji() {
3313
+ function Ei() {
3281
3314
  const e = [], t = {};
3282
3315
  let a = !1;
3283
3316
  const o = (i, r) => {
3284
- let n = "", u = null;
3317
+ let l = "", u = null;
3285
3318
  try {
3286
- const p = wi(r);
3287
- n = p.text, u = p.segments;
3319
+ const g = wi(r);
3320
+ l = g.text, u = g.segments;
3288
3321
  } catch {
3289
- n = String(r[0]), u = [{ text: n, style: null }];
3322
+ l = String(r[0]), u = [{ text: l, style: null }];
3290
3323
  }
3291
- const d = {
3324
+ const c = {
3292
3325
  level: i,
3293
- text: n.slice(0, 2e3),
3326
+ text: l.slice(0, 2e3),
3294
3327
  at: Date.now()
3295
3328
  };
3296
- u && u.some((p) => p.style) && (d.segments = u.map((p) => ({
3297
- text: String(p.text || "").slice(0, 2e3),
3298
- style: p.style || null
3299
- }))), e.push(d), e.length > zi && e.shift();
3329
+ u && u.some((g) => g.style) && (c.segments = u.map((g) => ({
3330
+ text: String(g.text || "").slice(0, 2e3),
3331
+ style: g.style || null
3332
+ }))), e.push(c), e.length > zi && e.shift();
3300
3333
  };
3301
3334
  return {
3302
3335
  hook: () => {
@@ -3315,7 +3348,7 @@ function ji() {
3315
3348
  }
3316
3349
  };
3317
3350
  }
3318
- function Ei(e) {
3351
+ function ji(e) {
3319
3352
  const t = window.SpeechRecognition || window.webkitSpeechRecognition;
3320
3353
  let a = null, o = !1;
3321
3354
  const s = () => {
@@ -3328,11 +3361,11 @@ function Ei(e) {
3328
3361
  return {
3329
3362
  start: (r = {}) => {
3330
3363
  if (!t)
3331
- throw new Error(m("status.speechUnsupported"));
3332
- return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (n) => {
3364
+ throw new Error(p("status.speechUnsupported"));
3365
+ return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (l) => {
3333
3366
  let u = "";
3334
- for (let d = n.resultIndex; d < n.results.length; d += 1)
3335
- n.results[d].isFinal && (u += n.results[d][0].transcript);
3367
+ for (let c = l.resultIndex; c < l.results.length; c += 1)
3368
+ l.results[c].isFinal && (u += l.results[c][0].transcript);
3336
3369
  u && e(u);
3337
3370
  }, a.onerror = () => {
3338
3371
  o = !1;
@@ -3348,23 +3381,23 @@ function Ei(e) {
3348
3381
  const Ri = 60 * 1e3;
3349
3382
  function Pi({ onStart: e, onStop: t, onError: a }) {
3350
3383
  let o = null, s = null, i = [], r = null;
3351
- const n = () => {
3384
+ const l = () => {
3352
3385
  if (r && (clearTimeout(r), r = null), s && s.state !== "inactive")
3353
3386
  try {
3354
3387
  s.stop();
3355
3388
  } catch {
3356
3389
  }
3357
- o && (o.getTracks().forEach((p) => p.stop()), o = null);
3390
+ o && (o.getTracks().forEach((g) => g.stop()), o = null);
3358
3391
  }, u = () => {
3359
3392
  if (s && s.state === "recording") {
3360
3393
  s.stop();
3361
3394
  return;
3362
3395
  }
3363
- n(), t(null);
3396
+ l(), t(null);
3364
3397
  };
3365
3398
  return { start: async () => {
3366
- var p, y;
3367
- if (!((p = navigator.mediaDevices) != null && p.getDisplayMedia))
3399
+ var g, v;
3400
+ if (!((g = navigator.mediaDevices) != null && g.getDisplayMedia))
3368
3401
  throw new Error("Screen recording is not supported in this browser.");
3369
3402
  o = await navigator.mediaDevices.getDisplayMedia({
3370
3403
  video: { displaySurface: "browser" },
@@ -3373,15 +3406,15 @@ function Pi({ onStart: e, onStop: t, onError: a }) {
3373
3406
  selfBrowserSurface: "include"
3374
3407
  }), i = [], s = new MediaRecorder(o, {
3375
3408
  mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
3376
- }), s.ondataavailable = (v) => {
3377
- v.data && v.data.size && i.push(v.data);
3409
+ }), s.ondataavailable = (k) => {
3410
+ k.data && k.data.size && i.push(k.data);
3378
3411
  }, s.onstop = () => {
3379
- const v = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
3380
- n(), t(v);
3381
- }, (y = o.getVideoTracks()[0]) == null || y.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ri);
3412
+ const k = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
3413
+ l(), t(k);
3414
+ }, (v = o.getVideoTracks()[0]) == null || v.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ri);
3382
3415
  }, stop: u };
3383
3416
  }
3384
- function Li() {
3417
+ function xi() {
3385
3418
  const e = /* @__PURE__ */ new Set();
3386
3419
  return {
3387
3420
  alloc() {
@@ -3399,10 +3432,10 @@ function Li() {
3399
3432
  }
3400
3433
  };
3401
3434
  }
3402
- const Oe = { x: 0, y: 0, w: 1, h: 1 };
3403
- function Ye() {
3404
- const e = Li();
3405
- let t = [], a = { ...Oe }, o = 1;
3435
+ const Me = { x: 0, y: 0, w: 1, h: 1 };
3436
+ function Je() {
3437
+ const e = xi();
3438
+ let t = [], a = { ...Me }, o = 1;
3406
3439
  return {
3407
3440
  list: () => t.filter((i) => Ti(i, a)),
3408
3441
  all: () => t.slice(),
@@ -3411,13 +3444,13 @@ function Ye() {
3411
3444
  return a = Ui(i), a;
3412
3445
  },
3413
3446
  resetCrop() {
3414
- return a = { ...Oe }, a;
3447
+ return a = { ...Me }, a;
3415
3448
  },
3416
3449
  isCropped() {
3417
3450
  return a.x > 1e-6 || a.y > 1e-6 || a.w < 1 - 1e-6 || a.h < 1 - 1e-6;
3418
3451
  },
3419
3452
  add(i, r) {
3420
- const n = {
3453
+ const l = {
3421
3454
  id: `s${o++}`,
3422
3455
  type: i,
3423
3456
  number: e.alloc(),
@@ -3429,36 +3462,36 @@ function Ye() {
3429
3462
  y2: 0.28,
3430
3463
  ...r
3431
3464
  };
3432
- return t.push(n), n;
3465
+ return t.push(l), l;
3433
3466
  },
3434
3467
  update(i, r) {
3435
- const n = t.find((u) => u.id === i);
3436
- return n ? (Object.assign(n, r), n) : null;
3468
+ const l = t.find((u) => u.id === i);
3469
+ return l ? (Object.assign(l, r), l) : null;
3437
3470
  },
3438
3471
  remove(i) {
3439
3472
  const r = t.findIndex((u) => u.id === i);
3440
3473
  if (r < 0)
3441
3474
  return null;
3442
- const [n] = t.splice(r, 1);
3443
- return e.free(n.number), n;
3475
+ const [l] = t.splice(r, 1);
3476
+ return e.free(l.number), l;
3444
3477
  },
3445
3478
  reset() {
3446
- for (t = [], a = { ...Oe }, o = 1; e.peekUsed().length; )
3479
+ for (t = [], a = { ...Me }, o = 1; e.peekUsed().length; )
3447
3480
  e.free(e.peekUsed()[0]);
3448
3481
  }
3449
3482
  };
3450
3483
  }
3451
- function xi(e, t) {
3484
+ function Li(e, t) {
3452
3485
  const a = Number(t == null ? void 0 : t.w) || 1, o = Number(t == null ? void 0 : t.h) || 1, s = Number(t == null ? void 0 : t.x) || 0, i = Number(t == null ? void 0 : t.y) || 0;
3453
3486
  return (Array.isArray(e) ? e : []).map((r) => {
3454
- const n = {
3487
+ const l = {
3455
3488
  ...r,
3456
3489
  x: (r.x - s) / a,
3457
3490
  y: (r.y - i) / o,
3458
3491
  w: (r.w || 0) / a,
3459
3492
  h: (r.h || 0) / o
3460
3493
  };
3461
- return Number.isFinite(r.x2) && (n.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (n.y2 = (r.y2 - i) / o), n;
3494
+ return Number.isFinite(r.x2) && (l.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (l.y2 = (r.y2 - i) / o), l;
3462
3495
  });
3463
3496
  }
3464
3497
  function Ui(e) {
@@ -3469,7 +3502,7 @@ function Ti(e, t) {
3469
3502
  const a = e.type === "arrow" ? (e.x + (e.x2 ?? e.x)) / 2 : e.x + (e.w || 0) / 2, o = e.type === "arrow" ? (e.y + (e.y2 ?? e.y)) / 2 : e.y + (e.h || 0) / 2;
3470
3503
  return a >= t.x && o >= t.y && a <= t.x + t.w && o <= t.y + t.h;
3471
3504
  }
3472
- function Xe(e) {
3505
+ function Kt(e) {
3473
3506
  const t = Math.max(1, Number(e) || 1);
3474
3507
  return {
3475
3508
  stroke: Math.max(2, t * 75e-4),
@@ -3479,103 +3512,61 @@ function Xe(e) {
3479
3512
  arrowHeadAngle: 0.4
3480
3513
  };
3481
3514
  }
3482
- function Fi(e, {
3483
- stickers: t = [],
3484
- crop: a = { x: 0, y: 0, w: 1, h: 1 },
3485
- width: o,
3486
- height: s,
3487
- colors: i = {}
3488
- }) {
3489
- const r = i.mark || "#fdd341", n = i.markText || "#2a2140", u = Xe(o);
3490
- e.save(), e.lineWidth = u.stroke, e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = r, e.fillStyle = r, e.font = `700 ${Math.round(u.fontSize)}px ui-sans-serif, system-ui, sans-serif`, t.forEach((d) => {
3491
- const p = Ne(d.x, a, o), y = Ke(d.y, a, s), v = d.w / a.w * o, b = d.h / a.h * s, C = u.stroke / 2;
3492
- if (d.type === "rect")
3493
- e.strokeRect(
3494
- p + C,
3495
- y + C,
3496
- Math.max(0, v - u.stroke),
3497
- Math.max(0, b - u.stroke)
3498
- );
3499
- else if (d.type === "circle")
3500
- e.beginPath(), e.ellipse(
3501
- p + v / 2,
3502
- y + b / 2,
3503
- Math.max(0.5, v / 2 - C),
3504
- Math.max(0.5, b / 2 - C),
3505
- 0,
3506
- 0,
3507
- Math.PI * 2
3508
- ), e.stroke();
3509
- else if (d.type === "arrow") {
3510
- const P = Ne(d.x2 ?? d.x + d.w, a, o), $ = Ke(d.y2 ?? d.y, a, s);
3511
- Di(e, p, y, P, $, u);
3512
- }
3513
- if (d.number == null || d.number === "")
3514
- return;
3515
- const E = Oi(d, a, o, s, p, y, v), M = String(d.number);
3516
- e.beginPath(), e.arc(E.x, E.y, u.badgeRadius, 0, Math.PI * 2), e.fillStyle = r, e.fill(), e.fillStyle = n, e.textAlign = "center", e.textBaseline = "middle", e.fillText(M, E.x, E.y + 0.5), e.fillStyle = r;
3517
- }), e.restore();
3515
+ function Fi(e, t, a, o, s) {
3516
+ const i = Math.atan2(o - t, a - e), r = s.arrowHead, l = Math.min(s.stroke, r * 0.2), u = a, c = o, g = a - Math.cos(i) * r, v = o - Math.sin(i) * r, k = {
3517
+ x: u - r * Math.cos(i - s.arrowHeadAngle),
3518
+ y: c - r * Math.sin(i - s.arrowHeadAngle)
3519
+ }, w = {
3520
+ x: u - r * Math.cos(i + s.arrowHeadAngle),
3521
+ y: c - r * Math.sin(i + s.arrowHeadAngle)
3522
+ }, b = {
3523
+ x: a - Math.cos(i) * l,
3524
+ y: o - Math.sin(i) * l
3525
+ };
3526
+ return { angle: i, tipX: u, tipY: c, baseX: g, baseY: v, left: k, right: w, shaftEnd: b };
3527
+ }
3528
+ async function kt(e, t = {}) {
3529
+ const a = t.crop || { x: 0, y: 0, w: 1, h: 1 }, o = Math.max(1, Number(t.maxEdge) || 2048), s = t.webpQuality ?? 0.82, i = await Ii(e), r = Math.round(a.x * i.width), l = Math.round(a.y * i.height), u = Math.max(1, Math.round(a.w * i.width)), c = Math.max(1, Math.round(a.h * i.height)), g = Di(u, c, o), v = g.width, k = g.height, w = document.createElement("canvas");
3530
+ w.width = v, w.height = k, w.getContext("2d").drawImage(i, r, l, u, c, 0, 0, v, k);
3531
+ const z = await bt(w, "image/webp", s);
3532
+ if (z && z.size > 0 && z.type === "image/webp")
3533
+ return { blob: z, width: v, height: k, mime: "image/webp", ext: "webp" };
3534
+ const R = await bt(w, "image/png");
3535
+ if (!R || !R.size)
3536
+ throw new Error("Could not encode screenshot");
3537
+ return { blob: R, width: v, height: k, mime: "image/png", ext: "png" };
3538
+ }
3539
+ function Di(e, t, a = 2048) {
3540
+ const o = Math.max(1, Number(e) || 1), s = Math.max(1, Number(t) || 1), i = Math.max(1, Number(a) || 2048), r = Math.min(1, i / Math.max(o, s));
3541
+ return {
3542
+ width: Math.max(1, Math.round(o * r)),
3543
+ height: Math.max(1, Math.round(s * r)),
3544
+ scale: r
3545
+ };
3518
3546
  }
3519
- function Ne(e, t, a) {
3520
- return (e - t.x) / t.w * a;
3547
+ function Oi(e = 2048) {
3548
+ const t = Math.floor(Number(e) / 2);
3549
+ return Math.max(1, Math.min(1024, t || 1024));
3521
3550
  }
3522
- function Ke(e, t, a) {
3523
- return (e - t.y) / t.h * a;
3551
+ function Mi(e, t = null) {
3552
+ if ((t == null ? void 0 : t.code) === "payload_too_large" || Number(t == null ? void 0 : t.status) === 413 || Number(e == null ? void 0 : e.status) === 413)
3553
+ return !0;
3554
+ const a = String((e == null ? void 0 : e.message) || e || (t == null ? void 0 : t.error) || "").toLowerCase();
3555
+ return a.includes("failed to fetch") || a.includes("networkerror") || a.includes("load failed") || a.includes("too large") || a.includes("payload") || a.includes("entity too large") ? !0 : Number(e == null ? void 0 : e.status) === 413;
3524
3556
  }
3525
- function Oi(e, t, a, o, s, i, r) {
3526
- if (e.type === "arrow") {
3527
- const n = Ne(e.x2 ?? e.x + e.w, t, a), u = Ke(e.y2 ?? e.y, t, o);
3528
- return {
3529
- x: (s + n) / 2,
3530
- y: (i + u) / 2
3531
- };
3532
- }
3533
- return { x: s + r / 2, y: i };
3557
+ function Ii(e) {
3558
+ return new Promise((t, a) => {
3559
+ const o = new Image();
3560
+ o.onload = () => t(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = e;
3561
+ });
3534
3562
  }
3535
- function Kt(e, t, a, o, s) {
3536
- const i = Math.atan2(o - t, a - e), r = s.arrowHead, n = Math.min(s.stroke, r * 0.2), u = a, d = o, p = a - Math.cos(i) * r, y = o - Math.sin(i) * r, v = {
3537
- x: u - r * Math.cos(i - s.arrowHeadAngle),
3538
- y: d - r * Math.sin(i - s.arrowHeadAngle)
3539
- }, b = {
3540
- x: u - r * Math.cos(i + s.arrowHeadAngle),
3541
- y: d - r * Math.sin(i + s.arrowHeadAngle)
3542
- }, C = {
3543
- x: a - Math.cos(i) * n,
3544
- y: o - Math.sin(i) * n
3545
- };
3546
- return { angle: i, tipX: u, tipY: d, baseX: p, baseY: y, left: v, right: b, shaftEnd: C };
3547
- }
3548
- function Di(e, t, a, o, s, i) {
3549
- const r = Kt(t, a, o, s, i);
3550
- e.beginPath(), e.moveTo(t, a), e.lineTo(r.shaftEnd.x, r.shaftEnd.y), e.stroke(), e.beginPath(), e.moveTo(r.tipX, r.tipY), e.lineTo(r.left.x, r.left.y), e.lineTo(r.right.x, r.right.y), e.closePath(), e.fill();
3551
- }
3552
- function Mi(e, t) {
3553
- return Ht(e, t, [], {});
3554
- }
3555
- function Ii(e, t, a, o = {}) {
3556
- return Ht(e, t, a, o);
3557
- }
3558
- function Ht(e, t, a, o) {
3559
- return new Promise((s, i) => {
3560
- const r = new Image();
3561
- r.onload = () => {
3562
- const n = Math.round(t.x * r.width), u = Math.round(t.y * r.height), d = Math.max(1, Math.round(t.w * r.width)), p = Math.max(1, Math.round(t.h * r.height)), y = document.createElement("canvas");
3563
- y.width = d, y.height = p;
3564
- const v = y.getContext("2d");
3565
- v.drawImage(r, n, u, d, p, 0, 0, d, p), a != null && a.length && Fi(v, {
3566
- stickers: a,
3567
- crop: t,
3568
- width: d,
3569
- height: p,
3570
- colors: o
3571
- }), y.toBlob((b) => {
3572
- if (!b) {
3573
- i(new Error("Could not encode screenshot"));
3574
- return;
3575
- }
3576
- s(b);
3577
- }, "image/png");
3578
- }, r.onerror = () => i(new Error("Could not load screenshot")), r.src = e;
3563
+ function bt(e, t, a) {
3564
+ return new Promise((o) => {
3565
+ try {
3566
+ e.toBlob((s) => o(s), t, a);
3567
+ } catch {
3568
+ o(null);
3569
+ }
3579
3570
  });
3580
3571
  }
3581
3572
  const Vi = [
@@ -3598,7 +3589,7 @@ function Bi(e = {}) {
3598
3589
  const o = e[a];
3599
3590
  o == null || o === "" || a === "user" && !$i(o) || t.push({
3600
3591
  key: a,
3601
- label: m(`diag.${a}`),
3592
+ label: p(`diag.${a}`),
3602
3593
  value: o,
3603
3594
  redacted: !1
3604
3595
  });
@@ -3623,14 +3614,14 @@ function Ki(e = []) {
3623
3614
  const t = e.filter((a) => a.redacted).length;
3624
3615
  return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
3625
3616
  }
3626
- function be(e, t) {
3617
+ function Ce(e, t) {
3627
3618
  e.forEach((a) => {
3628
3619
  a.redacted = !!t;
3629
3620
  });
3630
3621
  }
3631
3622
  function Hi(e = {}) {
3632
3623
  const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted), s = a.length > 0 && a.some((i) => !i.redacted);
3633
- return o && s ? m("privacy.disclosure.both") : o ? m("privacy.disclosure.diagnostics") : s ? m("privacy.disclosure.logs") : "";
3624
+ return o && s ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : s ? p("privacy.disclosure.logs") : "";
3634
3625
  }
3635
3626
  function Gi(e) {
3636
3627
  if (e == null)
@@ -3658,68 +3649,73 @@ function qi(e = {}) {
3658
3649
  });
3659
3650
  return t.console = a, t;
3660
3651
  }
3661
- const W = [
3652
+ const _ = [
3662
3653
  { id: "bug", label: "Bug" },
3663
3654
  { id: "idea", label: "Idea" },
3664
3655
  { id: "other", label: "Other" }
3665
3656
  ];
3666
- function bt(e) {
3657
+ function wt(e) {
3667
3658
  return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
3668
3659
  }
3669
- function De(e) {
3660
+ function ye(e) {
3670
3661
  const t = String(e || "").trim();
3671
3662
  return t ? t.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
3672
3663
  }
3673
3664
  function _i(e) {
3674
3665
  if (!Array.isArray(e) || !e.length)
3675
- return W.map((o) => ({ ...o }));
3666
+ return _.map((o) => ({ ...o }));
3676
3667
  const t = /* @__PURE__ */ new Set(), a = [];
3677
3668
  for (const o of e) {
3678
- let s = "", i = "";
3679
- typeof o == "string" || typeof o == "number" ? (s = bt(o), i = De(s)) : o && typeof o == "object" && (s = bt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || De(s)).trim() || De(s)), !(!s || t.has(s)) && (t.add(s), a.push({ id: s, label: i }));
3669
+ let s = "", i = "", r = "", l = "";
3670
+ if (typeof o == "string" || typeof o == "number" ? (s = wt(o), i = ye(s)) : o && typeof o == "object" && (s = wt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || ye(s)).trim() || ye(s), r = String(o.title || "").trim(), l = String(o.description || o.intro || "").trim()), !s || t.has(s))
3671
+ continue;
3672
+ t.add(s);
3673
+ const u = { id: s, label: i };
3674
+ r && (u.title = r), l && (u.description = l), a.push(u);
3680
3675
  }
3681
- return a.length ? a : W.map((o) => ({ ...o }));
3676
+ return a.length ? a : _.map((o) => ({ ...o }));
3682
3677
  }
3683
- function Ee(e) {
3678
+ function Le(e) {
3684
3679
  var a;
3685
- const t = Array.isArray(e) && e.length ? e : W;
3680
+ const t = Array.isArray(e) && e.length ? e : _;
3686
3681
  return t.some((o) => o.id === "bug") ? "bug" : ((a = t[0]) == null ? void 0 : a.id) || "other";
3687
3682
  }
3688
- const Wi = ["maker", "all-business", "brighter-day", "quiet-night"], Gt = "maker", Zi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), He = 0.02, wt = 0.05, Ji = `
3683
+ const Wi = ["maker", "all-business", "brighter-day", "quiet-night"], Ht = "maker", Zi = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ke = 0.02, St = 0.05, Ji = `
3689
3684
  <svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
3690
3685
  <path fill="currentColor" d="M5.2 2.8h9.1A2.7 2.7 0 0 1 17 5.5v8.2c0 .4-.3.7-.7.7h-.1a.7.7 0 0 1-.7-.7V5.5c0-.7-.6-1.3-1.3-1.3H5.2c-.7 0-1.3.6-1.3 1.3v12.2c0 .7.6 1.3 1.3 1.3h6.4a.7.7 0 0 1 0 1.4H5.2A2.7 2.7 0 0 1 2.5 17.7V5.5A2.7 2.7 0 0 1 5.2 2.8zm1.6 4.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h6.2a.7.7 0 0 0 0-1.4H6.8zm0 3.2a.7.7 0 0 0 0 1.4h3.6a.7.7 0 0 0 0-1.4H6.8z"/>
3691
3686
  <path fill="currentColor" d="M14.7 13.05 20.2 7.55a1.55 1.55 0 0 1 2.2 2.2l-5.5 5.5-.45 1.9a.6.6 0 0 1-.72.45l-1.9-.45.87-1.9z"/>
3692
3687
  </svg>
3693
3688
  `;
3694
- function U(e) {
3689
+ function D(e) {
3695
3690
  return `<svg class="nf-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${e}</svg>`;
3696
3691
  }
3697
- const L = {
3698
- crop: U('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3699
- resetCrop: U('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3700
- arrow: U('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3701
- rect: U('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3702
- circle: U('<circle cx="12" cy="12" r="8"/>'),
3703
- discard: U('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3704
- recapture: U('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3705
- privacy: U('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3706
- audio: U('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
3707
- video: U('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3708
- openArrow: U('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>')
3709
- }, qt = ji();
3710
- qt.hook();
3711
- const _t = 10, Yi = 80, Wt = "notefully.author", Zt = "notefully.kind", Jt = "notefully.redactSections";
3712
- let c = {
3692
+ const T = {
3693
+ crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
3694
+ resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
3695
+ arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
3696
+ rect: D('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
3697
+ circle: D('<circle cx="12" cy="12" r="8"/>'),
3698
+ discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
3699
+ recapture: D('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
3700
+ privacy: D('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
3701
+ audio: D('<rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5 11a7 7 0 0 0 14 0"/><path d="M12 18v3"/>'),
3702
+ video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
3703
+ openArrow: D('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>'),
3704
+ close: D('<path d="M6 6l12 12M18 6 6 18"/>')
3705
+ }, Gt = Ei();
3706
+ Gt.hook();
3707
+ const qt = 10, Yi = 80, _t = "notefully.author", Wt = "notefully.kind", Zt = "notefully.redactSections";
3708
+ let d = {
3713
3709
  endpoint: "",
3714
3710
  projectKey: "",
3715
3711
  version: "0.0.0",
3716
3712
  name: "",
3717
3713
  targets: null,
3718
3714
  hideLauncher: !1,
3719
- theme: Gt,
3715
+ theme: Ht,
3720
3716
  video: !1,
3721
- consoleLogLimit: _t,
3722
- kinds: W.map((e) => ({ ...e })),
3717
+ consoleLogLimit: qt,
3718
+ kinds: _.map((e) => ({ ...e })),
3723
3719
  kindsCustom: !1,
3724
3720
  capture: null,
3725
3721
  onBeforeCapture: null,
@@ -3728,50 +3724,55 @@ let c = {
3728
3724
  displayLink: !1,
3729
3725
  locale: null,
3730
3726
  translations: null
3731
- }, ue = !1, Me = !1, I = {}, g = null, l = {}, k = Ye(), F = "", ie = "", V = null, _ = Ee(W), K = null, T = null, S = null, w = null, ge = null, J = null, ne = null, B = { w: 0, h: 0 }, Ie = !1, Re = !1, Pe = !1, D = [], O = [], H = !1;
3732
- function f(e) {
3733
- return g.querySelector(e);
3727
+ }, ce = !1, Ie = !1, N = {}, y = null, n = {}, A = Je(), G = "", se = "", K = null, H = Le(_), W = null, M = null, j = null, E = null, fe = null, Q = null, le = null, q = { w: 0, h: 0 }, Ve = !1, de = !1, pe = !1, $ = [], V = [], Z = !1;
3728
+ function h(e) {
3729
+ return y.querySelector(e);
3734
3730
  }
3735
- function Yt(e) {
3731
+ function Jt(e) {
3736
3732
  const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
3737
- return Wi.includes(t) ? t : Gt;
3733
+ return Wi.includes(t) ? t : Ht;
3738
3734
  }
3739
- function St(e, t) {
3740
- return g && getComputedStyle(g).getPropertyValue(e).trim() || t;
3741
- }
3742
- async function Xi(e) {
3743
- return (await fetch(e)).blob();
3744
- }
3745
- function A(e, t = !1) {
3746
- l.status && (l.status.textContent = e || "", ge && (clearTimeout(ge), ge = null), e && !t && (ge = setTimeout(() => {
3747
- l.status.textContent = "";
3735
+ function S(e, t = !1) {
3736
+ n.status && (n.status.textContent = e || "", fe && (clearTimeout(fe), fe = null), e && !t && (fe = setTimeout(() => {
3737
+ n.status.textContent = "";
3748
3738
  }, 4e3)));
3749
3739
  }
3750
- function Qe() {
3751
- return g && document.body.contains(g) || (g = document.createElement("div"), g.id = "notefully", g.innerHTML = `
3740
+ function Ye() {
3741
+ return y && document.body.contains(y) || (y = document.createElement("div"), y.id = "notefully", y.innerHTML = `
3752
3742
  <button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Ji}</button>
3753
3743
  <div class="nf-dialog" hidden>
3754
3744
  <div class="nf-panel">
3745
+ <button class="nf-close nf-icon-btn" type="button" data-i18n-title="form.close" data-i18n-aria="form.close">${T.close}</button>
3755
3746
  <div class="nf-panel-body">
3747
+ <div class="nf-heading">
3748
+ <h2 class="nf-title"></h2>
3749
+ <p class="nf-intro"></p>
3750
+ </div>
3756
3751
  <div class="nf-stage" hidden>
3757
- <div class="nf-palette">
3758
- <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${L.crop}</button>
3759
- <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${L.resetCrop}</button>
3760
- <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${L.arrow}</button>
3761
- <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${L.rect}</button>
3762
- <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${L.circle}</button>
3763
- <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${L.discard}</button>
3764
- <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${L.recapture}</button>
3752
+ <div class="nf-shot-block">
3753
+ <div class="nf-canvas"></div>
3754
+ <div class="nf-palette">
3755
+ <div class="nf-palette-tools">
3756
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${T.crop}</button>
3757
+ <button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${T.resetCrop}</button>
3758
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${T.arrow}</button>
3759
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${T.rect}</button>
3760
+ <button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${T.circle}</button>
3761
+ </div>
3762
+ <div class="nf-palette-shot">
3763
+ <button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${T.recapture}</button>
3764
+ <button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${T.discard}</button>
3765
+ </div>
3766
+ </div>
3765
3767
  </div>
3766
- <div class="nf-canvas"></div>
3767
3768
  </div>
3768
- <textarea class="nf-text" data-i18n-placeholder="form.messagePlaceholder"></textarea>
3769
+ <textarea class="nf-text"></textarea>
3769
3770
  <input class="nf-author" type="text" name="author" autocomplete="nickname" data-i18n-placeholder="form.authorPlaceholder" data-i18n-aria="form.author">
3770
3771
  <div class="nf-kind-row">
3771
3772
  <div class="nf-kind"></div>
3772
3773
  <div class="nf-privacy-summary">
3773
3774
  <span class="nf-privacy-text"></span>
3774
- <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${L.privacy}</button>
3775
+ <button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${T.privacy}</button>
3775
3776
  </div>
3776
3777
  </div>
3777
3778
  <div class="nf-privacy">
@@ -3781,9 +3782,9 @@ function Qe() {
3781
3782
  </div>
3782
3783
  </div>
3783
3784
  <div class="nf-actions">
3784
- <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${L.resetCrop}</button>
3785
- <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${L.audio}</button>
3786
- <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${L.video}</button>
3785
+ <button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${T.resetCrop}</button>
3786
+ <button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${T.audio}</button>
3787
+ <button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${T.video}</button>
3787
3788
  <button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
3788
3789
  </div>
3789
3790
  <div class="nf-status"></div>
@@ -3791,116 +3792,144 @@ function Qe() {
3791
3792
  <p class="nf-success-msg" hidden aria-live="polite" data-i18n-text="form.success"></p>
3792
3793
  <a class="nf-success-link" hidden target="_blank" rel="noopener noreferrer" data-i18n-aria="form.viewReport">
3793
3794
  <span class="nf-success-link-label" data-i18n-text="form.viewReport"></span>
3794
- ${L.openArrow}
3795
+ ${T.openArrow}
3795
3796
  </a>
3796
3797
  </div>
3797
3798
  </div>
3798
3799
  <button class="nf-stop-video" type="button" hidden data-i18n-text="tool.stopVideo"></button>
3799
- `, document.body.appendChild(g), l = {
3800
- launcher: f(".nf-launcher"),
3801
- dialog: f(".nf-dialog"),
3802
- panel: f(".nf-panel"),
3803
- panelBody: f(".nf-panel-body"),
3804
- successMsg: f(".nf-success-msg"),
3805
- successLink: f(".nf-success-link"),
3806
- stage: f(".nf-stage"),
3807
- palette: f(".nf-palette"),
3808
- canvas: f(".nf-canvas"),
3809
- text: f(".nf-text"),
3810
- author: f(".nf-author"),
3811
- kindRow: f(".nf-kind-row"),
3812
- kind: f(".nf-kind"),
3813
- privacy: f(".nf-privacy"),
3814
- privacySummary: f(".nf-privacy-summary"),
3815
- privacyText: f(".nf-privacy-text"),
3816
- privacyChange: f(".nf-privacy-change"),
3817
- privacyPanel: f(".nf-privacy-panel"),
3818
- privacyScroll: f(".nf-privacy-scroll"),
3819
- privacyDone: f(".nf-privacy-done"),
3820
- actions: f(".nf-actions"),
3821
- restore: f(".nf-restore"),
3822
- status: f(".nf-status"),
3823
- audio: f(".nf-audio"),
3824
- video: f(".nf-video"),
3825
- discard: f(".nf-discard-shot"),
3826
- recapture: f(".nf-recapture"),
3827
- stop: f(".nf-stop-video"),
3828
- resetCrop: f(".nf-reset-crop"),
3829
- submit: f(".nf-submit"),
3800
+ `, document.body.appendChild(y), n = {
3801
+ launcher: h(".nf-launcher"),
3802
+ dialog: h(".nf-dialog"),
3803
+ panel: h(".nf-panel"),
3804
+ close: h(".nf-close"),
3805
+ panelBody: h(".nf-panel-body"),
3806
+ heading: h(".nf-heading"),
3807
+ title: h(".nf-title"),
3808
+ intro: h(".nf-intro"),
3809
+ successMsg: h(".nf-success-msg"),
3810
+ successLink: h(".nf-success-link"),
3811
+ stage: h(".nf-stage"),
3812
+ shotBlock: h(".nf-shot-block"),
3813
+ palette: h(".nf-palette"),
3814
+ paletteTools: h(".nf-palette-tools"),
3815
+ paletteShot: h(".nf-palette-shot"),
3816
+ canvas: h(".nf-canvas"),
3817
+ text: h(".nf-text"),
3818
+ author: h(".nf-author"),
3819
+ kindRow: h(".nf-kind-row"),
3820
+ kind: h(".nf-kind"),
3821
+ privacy: h(".nf-privacy"),
3822
+ privacySummary: h(".nf-privacy-summary"),
3823
+ privacyText: h(".nf-privacy-text"),
3824
+ privacyChange: h(".nf-privacy-change"),
3825
+ privacyPanel: h(".nf-privacy-panel"),
3826
+ privacyScroll: h(".nf-privacy-scroll"),
3827
+ privacyDone: h(".nf-privacy-done"),
3828
+ actions: h(".nf-actions"),
3829
+ restore: h(".nf-restore"),
3830
+ status: h(".nf-status"),
3831
+ audio: h(".nf-audio"),
3832
+ video: h(".nf-video"),
3833
+ discard: h(".nf-discard-shot"),
3834
+ recapture: h(".nf-recapture"),
3835
+ stop: h(".nf-stop-video"),
3836
+ resetCrop: h(".nf-reset-crop"),
3837
+ submit: h(".nf-submit"),
3830
3838
  shot: null
3831
- }, ts(), se()), g;
3839
+ }, Qi(), re()), y;
3832
3840
  }
3833
- function se() {
3841
+ function re() {
3834
3842
  var e;
3835
- g && (Xt(), g.dataset.theme = Yt(c.theme), g.lang = fe(), g.dir = za(fe()), c.hideLauncher ? g.setAttribute("data-nf-hidden-launcher", "") : g.removeAttribute("data-nf-hidden-launcher"), l.video && (l.video.hidden = !c.video), Qi(), D.length && D.forEach((t) => {
3836
- t.label = m(`diag.${t.key}`);
3837
- }), Qt(), H ? it() : ot(), (e = l.dialog) != null && e.hidden && we());
3843
+ y && (Yt(), y.dataset.theme = Jt(d.theme), y.lang = be(), y.dir = za(be()), d.hideLauncher ? y.setAttribute("data-nf-hidden-launcher", "") : y.removeAttribute("data-nf-hidden-launcher"), n.video && (n.video.hidden = !d.video), Xi(), $.length && $.forEach((t) => {
3844
+ t.label = p(`diag.${t.key}`);
3845
+ }), Qt(), Z ? ot() : at(), (e = n.dialog) != null && e.hidden && ze());
3838
3846
  }
3839
- function Xt() {
3847
+ function Yt() {
3840
3848
  const e = Sa({
3841
- locale: c.locale == null ? void 0 : c.locale
3849
+ locale: d.locale == null ? void 0 : d.locale
3842
3850
  });
3843
- Ca(c.translations), Aa(e);
3844
- }
3845
- function Qi() {
3846
- if (g && (g.querySelectorAll("[data-i18n-title]").forEach((e) => {
3847
- e.title = m(e.getAttribute("data-i18n-title"));
3848
- }), g.querySelectorAll("[data-i18n-aria]").forEach((e) => {
3849
- e.setAttribute("aria-label", m(e.getAttribute("data-i18n-aria")));
3850
- }), g.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
3851
- e.setAttribute("placeholder", m(e.getAttribute("data-i18n-placeholder")));
3852
- }), g.querySelectorAll("[data-i18n-text]").forEach((e) => {
3853
- e.textContent = m(e.getAttribute("data-i18n-text"));
3854
- }), l.audio)) {
3855
- const e = l.audio.dataset.active === "true";
3856
- xe(e);
3851
+ Ca(d.translations), Aa(e);
3852
+ }
3853
+ function Xi() {
3854
+ if (y) {
3855
+ if (y.querySelectorAll("[data-i18n-title]").forEach((e) => {
3856
+ e.title = p(e.getAttribute("data-i18n-title"));
3857
+ }), y.querySelectorAll("[data-i18n-aria]").forEach((e) => {
3858
+ e.setAttribute("aria-label", p(e.getAttribute("data-i18n-aria")));
3859
+ }), y.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
3860
+ e.setAttribute("placeholder", p(e.getAttribute("data-i18n-placeholder")));
3861
+ }), y.querySelectorAll("[data-i18n-text]").forEach((e) => {
3862
+ e.textContent = p(e.getAttribute("data-i18n-text"));
3863
+ }), n.audio) {
3864
+ const e = n.audio.dataset.active === "true";
3865
+ Te(e);
3866
+ }
3867
+ Qe();
3857
3868
  }
3858
3869
  }
3859
- function es(e) {
3860
- if (c.kindsCustom)
3870
+ function Xt(e) {
3871
+ if (d.kindsCustom)
3861
3872
  return e.label;
3862
- const t = `kind.${e.id}`, a = m(t);
3873
+ const t = `kind.${e.id}`, a = p(t);
3863
3874
  return a === t ? e.label : a;
3864
3875
  }
3865
- function we() {
3866
- l.launcher && (l.launcher.hidden = !!c.hideLauncher);
3876
+ function ze() {
3877
+ n.launcher && (n.launcher.hidden = !!d.hideLauncher);
3867
3878
  }
3868
- function ts() {
3869
- l.launcher.addEventListener("click", () => ha()), f(".nf-dialog").addEventListener("click", (t) => {
3870
- Re && !Pe || t.target === l.dialog && re();
3871
- }), document.addEventListener("keydown", ca), g.querySelectorAll(".nf-tool").forEach((t) => {
3872
- t.addEventListener("click", () => de(t.dataset.tool));
3873
- }), l.resetCrop.addEventListener("click", cs), l.canvas.addEventListener("pointerdown", rs), l.canvas.addEventListener("dragstart", (t) => t.preventDefault());
3874
- const e = f(".nf-kind");
3875
- e && e.addEventListener("click", (t) => {
3876
- const a = t.target.closest("[data-kind]");
3877
- a && et(a.dataset.kind);
3878
- }), l.discard.addEventListener("click", ps), l.recapture.addEventListener("click", () => {
3879
- ms().catch((t) => A(t.message || m("status.recaptureFailed")));
3880
- }), l.restore.addEventListener("click", gs), l.audio.addEventListener("click", hs), l.video.addEventListener("click", fs), l.stop.addEventListener("click", () => ne == null ? void 0 : ne.stop()), l.privacyChange.addEventListener("click", () => ze(!H)), l.privacyDone.addEventListener("click", () => ze(!1)), l.privacyScroll.addEventListener("change", Ps), f(".nf-submit").addEventListener("click", () => {
3881
- ya().catch((t) => A(t.message || m("status.submitFailed")));
3882
- }), Qt(), de(null);
3883
- }
3884
- function z(e) {
3879
+ function Qi() {
3880
+ var t;
3881
+ n.launcher.addEventListener("click", () => ha()), h(".nf-dialog").addEventListener("click", (a) => {
3882
+ de && !pe || a.target === n.dialog && ee();
3883
+ }), (t = n.close) == null || t.addEventListener("click", () => {
3884
+ de && !pe || ee();
3885
+ }), document.addEventListener("keydown", da), y.querySelectorAll(".nf-tool").forEach((a) => {
3886
+ a.addEventListener("click", () => ge(a.dataset.tool));
3887
+ }), n.resetCrop.addEventListener("click", ds), n.canvas.addEventListener("pointerdown", rs), n.canvas.addEventListener("dragstart", (a) => a.preventDefault());
3888
+ const e = h(".nf-kind");
3889
+ e && e.addEventListener("click", (a) => {
3890
+ const o = a.target.closest("[data-kind]");
3891
+ o && Xe(o.dataset.kind);
3892
+ }), n.discard.addEventListener("click", ps), n.recapture.addEventListener("click", () => {
3893
+ ms().catch((a) => S(a.message || p("status.recaptureFailed")));
3894
+ }), n.restore.addEventListener("click", gs), n.audio.addEventListener("click", hs), n.video.addEventListener("click", fs), n.stop.addEventListener("click", () => le == null ? void 0 : le.stop()), n.privacyChange.addEventListener("click", () => Pe(!Z)), n.privacyDone.addEventListener("click", () => Pe(!1)), n.privacyScroll.addEventListener("change", Ps), h(".nf-submit").addEventListener("click", () => {
3895
+ ya().catch((a) => S(a.message || p("status.submitFailed")));
3896
+ }), Qt(), ge(null);
3897
+ }
3898
+ function x(e) {
3885
3899
  return String(e || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3886
3900
  }
3887
3901
  function Qt() {
3888
- const e = g == null ? void 0 : g.querySelector(".nf-kind");
3902
+ const e = y == null ? void 0 : y.querySelector(".nf-kind");
3889
3903
  if (!e)
3890
3904
  return;
3891
- const t = Array.isArray(c.kinds) && c.kinds.length ? c.kinds : W;
3892
- e.innerHTML = t.map((s) => `<button type="button" data-kind="${z(s.id)}">${z(es(s))}</button>`).join("");
3893
- const o = t.map((s) => s.id).includes(_) ? _ : Ee(t);
3894
- et(o);
3905
+ const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : _;
3906
+ e.innerHTML = t.map((s) => `<button type="button" data-kind="${x(s.id)}">${x(Xt(s))}</button>`).join("");
3907
+ const o = t.map((s) => s.id).includes(H) ? H : Le(t);
3908
+ Xe(o);
3895
3909
  }
3896
- function et(e) {
3897
- _ = (c.kinds || W).map((a) => a.id).includes(e) ? e : Ee(c.kinds), g == null || g.querySelectorAll("[data-kind]").forEach((a) => {
3898
- a.dataset.active = String(a.dataset.kind === _);
3899
- }), os(_);
3910
+ function Xe(e) {
3911
+ H = (d.kinds || _).map((a) => a.id).includes(e) ? e : Le(d.kinds), y == null || y.querySelectorAll("[data-kind]").forEach((a) => {
3912
+ a.dataset.active = String(a.dataset.kind === H);
3913
+ }), os(H), Qe();
3914
+ }
3915
+ function es() {
3916
+ return (Array.isArray(d.kinds) && d.kinds.length ? d.kinds : _).find((t) => t.id === H) || null;
3917
+ }
3918
+ function ts() {
3919
+ const e = es(), t = (e == null ? void 0 : e.id) || H || "other", a = t === "bug" || t === "idea" || t === "other", o = (e == null ? void 0 : e.title) && String(e.title).trim() || p(a ? `form.title.${t}` : "form.title.other"), s = (e == null ? void 0 : e.description) && String(e.description).trim() || p(a ? `form.intro.${t}` : "form.intro.other"), i = a ? p(`form.placeholder.${t}`) : p("form.placeholder.custom", {
3920
+ kind: e ? Xt(e) : ye(t)
3921
+ });
3922
+ return { title: o, intro: s, placeholder: i };
3923
+ }
3924
+ function Qe() {
3925
+ if (!n.title && !n.intro && !n.text)
3926
+ return;
3927
+ const e = ts(), t = I() ? ` ${p("form.screenshotNote")}` : "";
3928
+ n.title && (n.title.textContent = e.title), n.intro && (n.intro.textContent = `${e.intro}${t}`), n.text && n.text.setAttribute("placeholder", e.placeholder);
3900
3929
  }
3901
3930
  function as() {
3902
3931
  try {
3903
- return String(localStorage.getItem(Zt) || "").trim().toLowerCase();
3932
+ return String(localStorage.getItem(Wt) || "").trim().toLowerCase();
3904
3933
  } catch {
3905
3934
  return "";
3906
3935
  }
@@ -3909,128 +3938,128 @@ function os(e) {
3909
3938
  const t = String(e || "").trim().toLowerCase();
3910
3939
  if (t)
3911
3940
  try {
3912
- localStorage.setItem(Zt, t);
3941
+ localStorage.setItem(Wt, t);
3913
3942
  } catch {
3914
3943
  }
3915
3944
  }
3916
3945
  function is() {
3917
- const e = (c.kinds || W).map((a) => a.id), t = as();
3918
- return t && e.includes(t) ? t : Ee(c.kinds);
3946
+ const e = (d.kinds || _).map((a) => a.id), t = as();
3947
+ return t && e.includes(t) ? t : Le(d.kinds);
3919
3948
  }
3920
- function de(e) {
3921
- K = Zi.has(e) ? e : null, T = null, g.querySelectorAll(".nf-tool").forEach((t) => {
3922
- t.dataset.active = String(t.dataset.tool === K);
3923
- }), l.canvas && (l.canvas.dataset.draw = K ? "true" : "false"), Z() && x();
3949
+ function ge(e) {
3950
+ W = Zi.has(e) ? e : null, M = null, y.querySelectorAll(".nf-tool").forEach((t) => {
3951
+ t.dataset.active = String(t.dataset.tool === W);
3952
+ }), n.canvas && (n.canvas.dataset.draw = W ? "true" : "false"), I() && O();
3924
3953
  }
3925
3954
  function At(e) {
3926
3955
  return Math.min(1, Math.max(0, e));
3927
3956
  }
3928
- function ce() {
3929
- return l.shot || l.canvas;
3957
+ function me() {
3958
+ return n.shot || n.canvas;
3930
3959
  }
3931
- function Se(e) {
3932
- const t = ce().getBoundingClientRect();
3960
+ function Ee(e) {
3961
+ const t = me().getBoundingClientRect();
3933
3962
  return {
3934
3963
  x: At((e.clientX - t.left) / Math.max(t.width, 1)),
3935
3964
  y: At((e.clientY - t.top) / Math.max(t.height, 1))
3936
3965
  };
3937
3966
  }
3938
3967
  function ss(e) {
3939
- const t = ce().getBoundingClientRect();
3968
+ const t = me().getBoundingClientRect();
3940
3969
  return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
3941
3970
  }
3942
3971
  function ea(e) {
3943
- const t = Se(e), a = k.crop();
3972
+ const t = Ee(e), a = A.crop();
3944
3973
  return {
3945
3974
  x: a.x + t.x * a.w,
3946
3975
  y: a.y + t.y * a.h
3947
3976
  };
3948
3977
  }
3949
- function Le(e, t) {
3978
+ function Ue(e, t) {
3950
3979
  const a = Math.min(e.x, t.x), o = Math.min(e.y, t.y);
3951
3980
  return {
3952
3981
  x: a,
3953
3982
  y: o,
3954
- w: Math.max(He, Math.abs(t.x - e.x)),
3955
- h: Math.max(He, Math.abs(t.y - e.y))
3983
+ w: Math.max(Ke, Math.abs(t.x - e.x)),
3984
+ h: Math.max(Ke, Math.abs(t.y - e.y))
3956
3985
  };
3957
3986
  }
3958
- function tt(e) {
3959
- g && (e ? g.dataset.grabbing = "true" : delete g.dataset.grabbing);
3987
+ function et(e) {
3988
+ y && (e ? y.dataset.grabbing = "true" : delete y.dataset.grabbing);
3960
3989
  }
3961
- function Ve(e) {
3990
+ function $e(e) {
3962
3991
  try {
3963
- l.canvas.setPointerCapture(e.pointerId);
3992
+ n.canvas.setPointerCapture(e.pointerId);
3964
3993
  } catch {
3965
3994
  }
3966
3995
  }
3967
- function Ge() {
3968
- window.addEventListener("pointermove", aa), window.addEventListener("pointerup", Ae), window.addEventListener("pointercancel", Ae);
3996
+ function He() {
3997
+ window.addEventListener("pointermove", aa), window.addEventListener("pointerup", je), window.addEventListener("pointercancel", je);
3969
3998
  }
3970
3999
  function ta() {
3971
- window.removeEventListener("pointermove", aa), window.removeEventListener("pointerup", Ae), window.removeEventListener("pointercancel", Ae);
4000
+ window.removeEventListener("pointermove", aa), window.removeEventListener("pointerup", je), window.removeEventListener("pointercancel", je);
3972
4001
  }
3973
4002
  function rs(e) {
3974
- if (e.button !== 0 || !Z())
4003
+ if (e.button !== 0 || !I())
3975
4004
  return;
3976
4005
  if (!e.target.closest(".nf-sticker") && !ss(e)) {
3977
- T = null, x();
4006
+ M = null, O();
3978
4007
  return;
3979
4008
  }
3980
4009
  const t = e.target.closest(".nf-handle"), a = e.target.closest(".nf-sticker");
3981
4010
  if (a && a.dataset.preview !== "true") {
3982
- e.preventDefault(), e.stopPropagation(), T = a.dataset.id, Ve(e), ns({
4011
+ e.preventDefault(), e.stopPropagation(), M = a.dataset.id, $e(e), ns({
3983
4012
  kind: "sticker",
3984
- id: T,
4013
+ id: M,
3985
4014
  dir: (t == null ? void 0 : t.dataset.dir) || "move"
3986
- }, e), x();
4015
+ }, e), O();
3987
4016
  return;
3988
4017
  }
3989
- if (T = null, K === "crop") {
3990
- e.preventDefault(), Ve(e), S = { kind: "crop", start: Se(e), current: Se(e) }, Ge(), x();
4018
+ if (M = null, W === "crop") {
4019
+ e.preventDefault(), $e(e), j = { kind: "crop", start: Ee(e), current: Ee(e) }, He(), O();
3991
4020
  return;
3992
4021
  }
3993
- if (K === "arrow" || K === "rect" || K === "circle") {
3994
- e.preventDefault(), Ve(e);
4022
+ if (W === "arrow" || W === "rect" || W === "circle") {
4023
+ e.preventDefault(), $e(e);
3995
4024
  const o = ea(e);
3996
- S = { kind: "sticker", type: K, start: o, current: o }, Ge(), x();
4025
+ j = { kind: "sticker", type: W, start: o, current: o }, He(), O();
3997
4026
  return;
3998
4027
  }
3999
- x();
4028
+ O();
4000
4029
  }
4001
4030
  function ns(e, t) {
4002
4031
  t.preventDefault(), t.stopPropagation();
4003
- const a = ce().getBoundingClientRect(), o = k.list().find((s) => s.id === e.id);
4004
- w = {
4032
+ const a = me().getBoundingClientRect(), o = A.list().find((s) => s.id === e.id);
4033
+ E = {
4005
4034
  ...e,
4006
4035
  startX: t.clientX,
4007
4036
  startY: t.clientY,
4008
- crop: k.crop(),
4037
+ crop: A.crop(),
4009
4038
  sticker: o ? { ...o } : null,
4010
4039
  rect: a
4011
- }, tt(e.dir === "move" || e.dir === "start" || e.dir === "end"), Ge();
4040
+ }, et(e.dir === "move" || e.dir === "start" || e.dir === "end"), He();
4012
4041
  }
4013
4042
  function aa(e) {
4014
- if (S) {
4015
- S.current = S.kind === "crop" ? Se(e) : ea(e), x();
4043
+ if (j) {
4044
+ j.current = j.kind === "crop" ? Ee(e) : ea(e), O();
4016
4045
  return;
4017
4046
  }
4018
- if (!w)
4047
+ if (!E)
4019
4048
  return;
4020
- const t = (e.clientX - w.startX) / w.rect.width * w.crop.w, a = (e.clientY - w.startY) / w.rect.height * w.crop.h, o = w.sticker;
4049
+ const t = (e.clientX - E.startX) / E.rect.width * E.crop.w, a = (e.clientY - E.startY) / E.rect.height * E.crop.h, o = E.sticker;
4021
4050
  if (o) {
4022
- if (w.dir === "end")
4023
- k.update(o.id, {
4051
+ if (E.dir === "end")
4052
+ A.update(o.id, {
4024
4053
  x2: o.x2 + t,
4025
4054
  y2: o.y2 + a
4026
4055
  });
4027
- else if (w.dir === "start")
4028
- k.update(o.id, {
4056
+ else if (E.dir === "start")
4057
+ A.update(o.id, {
4029
4058
  x: o.x + t,
4030
4059
  y: o.y + a
4031
4060
  });
4032
- else if (w.dir === "move")
4033
- k.update(o.id, {
4061
+ else if (E.dir === "move")
4062
+ A.update(o.id, {
4034
4063
  x: o.x + t,
4035
4064
  y: o.y + a,
4036
4065
  x2: (o.x2 || o.x) + t,
@@ -4038,9 +4067,9 @@ function aa(e) {
4038
4067
  });
4039
4068
  else {
4040
4069
  const s = { x: o.x, y: o.y, w: o.w, h: o.h };
4041
- ls(s, w.dir, t, a), k.update(o.id, s);
4070
+ ls(s, E.dir, t, a), A.update(o.id, s);
4042
4071
  }
4043
- x();
4072
+ O();
4044
4073
  }
4045
4074
  }
4046
4075
  function ls(e, t, a, o) {
@@ -4053,52 +4082,52 @@ function ls(e, t, a, o) {
4053
4082
  e.y += e.h - s, e.h = s;
4054
4083
  }
4055
4084
  }
4056
- function Ae(e) {
4057
- if (ta(), tt(!1), S) {
4085
+ function je(e) {
4086
+ if (ta(), et(!1), j) {
4058
4087
  us();
4059
4088
  return;
4060
4089
  }
4061
- if (w) {
4062
- if (w.kind === "sticker") {
4063
- const t = l.canvas.getBoundingClientRect();
4064
- (e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (k.remove(w.id), T = null);
4090
+ if (E) {
4091
+ if (E.kind === "sticker") {
4092
+ const t = n.canvas.getBoundingClientRect();
4093
+ (e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (A.remove(E.id), M = null);
4065
4094
  }
4066
- w = null, x();
4095
+ E = null, O();
4067
4096
  }
4068
4097
  }
4069
4098
  function us() {
4070
- const e = S;
4071
- if (S = null, !e)
4099
+ const e = j;
4100
+ if (j = null, !e)
4072
4101
  return;
4073
4102
  if (e.kind === "crop") {
4074
- const a = Le(e.start, e.current);
4075
- if (Math.abs(e.current.x - e.start.x) < wt || Math.abs(e.current.y - e.start.y) < wt) {
4076
- x();
4103
+ const a = Ue(e.start, e.current);
4104
+ if (Math.abs(e.current.x - e.start.x) < St || Math.abs(e.current.y - e.start.y) < St) {
4105
+ O();
4077
4106
  return;
4078
4107
  }
4079
- const s = k.crop();
4080
- k.setCrop({
4108
+ const s = A.crop();
4109
+ A.setCrop({
4081
4110
  x: s.x + a.x * s.w,
4082
4111
  y: s.y + a.y * s.h,
4083
4112
  w: a.w * s.w,
4084
4113
  h: a.h * s.h
4085
- }), Y();
4114
+ }), te();
4086
4115
  return;
4087
4116
  }
4088
- const t = ds(e);
4089
- t && (T = t.id), x();
4117
+ const t = cs(e);
4118
+ t && (M = t.id), O();
4090
4119
  }
4091
- function ds(e) {
4120
+ function cs(e) {
4092
4121
  if (e.type === "arrow") {
4093
4122
  const t = e.current.x - e.start.x, a = e.current.y - e.start.y;
4094
- return Math.hypot(t, a) < He ? k.add("arrow", {
4123
+ return Math.hypot(t, a) < Ke ? A.add("arrow", {
4095
4124
  x: e.start.x,
4096
4125
  y: e.start.y,
4097
4126
  x2: e.start.x + 0.12,
4098
4127
  y2: e.start.y,
4099
4128
  w: 0.12,
4100
4129
  h: 0.02
4101
- }) : k.add("arrow", {
4130
+ }) : A.add("arrow", {
4102
4131
  x: e.start.x,
4103
4132
  y: e.start.y,
4104
4133
  x2: e.current.x,
@@ -4107,49 +4136,49 @@ function ds(e) {
4107
4136
  h: Math.abs(a)
4108
4137
  });
4109
4138
  }
4110
- return k.add(e.type, Le(e.start, e.current));
4139
+ return A.add(e.type, Ue(e.start, e.current));
4111
4140
  }
4112
- function cs() {
4113
- k.resetCrop(), T = null, Y();
4141
+ function ds() {
4142
+ A.resetCrop(), M = null, te();
4114
4143
  }
4115
- function Ce() {
4116
- l.resetCrop && (l.resetCrop.hidden = !k.isCropped());
4144
+ function Re() {
4145
+ n.resetCrop && (n.resetCrop.hidden = !A.isCropped());
4117
4146
  }
4118
- function xe(e) {
4119
- if (!l.audio)
4147
+ function Te(e) {
4148
+ if (!n.audio)
4120
4149
  return;
4121
- const t = m(e ? "tool.audioStop" : "tool.audio");
4122
- l.audio.title = t, l.audio.setAttribute("aria-label", t), l.audio.dataset.active = String(!!e);
4150
+ const t = p(e ? "tool.audioStop" : "tool.audio");
4151
+ n.audio.title = t, n.audio.setAttribute("aria-label", t), n.audio.dataset.active = String(!!e);
4123
4152
  }
4124
- function Z() {
4125
- return q(F);
4153
+ function I() {
4154
+ return Y(G);
4126
4155
  }
4127
- function pe() {
4128
- if (!l.stage || !l.palette || !l.actions || !l.recapture)
4156
+ function he() {
4157
+ if (!n.stage || !n.palette || !n.actions || !n.recapture)
4129
4158
  return;
4130
- const e = Z();
4131
- l.stage.hidden = !e && !V, l.palette.hidden = !e, l.discard && (l.discard.hidden = !e), l.restore && (l.restore.hidden = e || !ie), e ? (l.palette.appendChild(l.discard), l.palette.appendChild(l.recapture)) : l.audio ? l.audio.after(l.recapture) : l.actions.insertBefore(l.recapture, l.submit || null), l.recapture.hidden = !1;
4159
+ const e = I();
4160
+ n.stage.hidden = !e && !K, n.palette.hidden = !e, n.discard && (n.discard.hidden = !e), n.restore && (n.restore.hidden = e || !se), e && n.paletteShot ? (n.paletteShot.appendChild(n.recapture), n.paletteShot.appendChild(n.discard)) : n.audio ? n.audio.after(n.recapture) : n.actions.insertBefore(n.recapture, n.submit || null), n.recapture.hidden = !1, Qe();
4132
4161
  }
4133
4162
  function ps() {
4134
- Z() && (ie = F), F = "", de(null), pe(), Y();
4163
+ I() && (se = G), G = "", ge(null), he(), te();
4135
4164
  }
4136
4165
  function gs() {
4137
- q(ie) && (F = ie, pe(), Y());
4166
+ Y(se) && (G = se, he(), te());
4138
4167
  }
4139
4168
  function oa() {
4140
4169
  return {
4141
- capture: typeof c.capture == "function" ? c.capture : void 0,
4142
- onBeforeCapture: typeof c.onBeforeCapture == "function" ? c.onBeforeCapture : void 0
4170
+ capture: typeof d.capture == "function" ? d.capture : void 0,
4171
+ onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
4143
4172
  };
4144
4173
  }
4145
4174
  function ia(e) {
4146
- if (!q(e))
4147
- throw new Error(m("status.screenshotFailed"));
4148
- F = e, ie = e, k = Ye(), B = { w: 0, h: 0 }, T = null, S = null, w = null, de(null);
4175
+ if (!Y(e))
4176
+ throw new Error(p("status.screenshotFailed"));
4177
+ G = e, se = e, A = Je(), q = { w: 0, h: 0 }, M = null, j = null, E = null, ge(null);
4149
4178
  }
4150
4179
  async function ms() {
4151
- if (!(Me || !l.dialog || l.dialog.hidden)) {
4152
- Me = !0, l.recapture.disabled = !0, A(m("status.capturing"), !0), l.dialog.hidden = !0;
4180
+ if (!(Ie || !n.dialog || n.dialog.hidden)) {
4181
+ Ie = !0, n.recapture.disabled = !0, S(p("status.capturing"), !0), n.dialog.hidden = !0;
4153
4182
  try {
4154
4183
  let e = "";
4155
4184
  try {
@@ -4157,69 +4186,69 @@ async function ms() {
4157
4186
  } catch {
4158
4187
  e = await $t(oa());
4159
4188
  }
4160
- ia(e), A("");
4189
+ ia(e), S("");
4161
4190
  } catch (e) {
4162
- A((e == null ? void 0 : e.message) || m("status.screenshotFailed"));
4191
+ S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
4163
4192
  } finally {
4164
- l.dialog.hidden = !1, l.recapture.disabled = !1, Me = !1, pe(), Y();
4193
+ n.dialog.hidden = !1, n.recapture.disabled = !1, Ie = !1, he(), te();
4165
4194
  }
4166
4195
  }
4167
4196
  }
4168
4197
  function hs() {
4169
4198
  try {
4170
- if (J || (J = Ei((t) => {
4171
- const a = l.text.value.trim();
4172
- l.text.value = a ? `${a} ${t}` : t;
4173
- })), !J.isSupported()) {
4174
- A(m("status.audioUnsupported"));
4199
+ if (Q || (Q = ji((t) => {
4200
+ const a = n.text.value.trim();
4201
+ n.text.value = a ? `${a} ${t}` : t;
4202
+ })), !Q.isSupported()) {
4203
+ S(p("status.audioUnsupported"));
4175
4204
  return;
4176
4205
  }
4177
- const e = J.start({ lang: fe() });
4178
- xe(e), A(e ? m("status.listening") : "");
4206
+ const e = Q.start({ lang: be() });
4207
+ Te(e), S(e ? p("status.listening") : "");
4179
4208
  } catch (e) {
4180
- A(e.message);
4209
+ S(e.message);
4181
4210
  }
4182
4211
  }
4183
4212
  async function fs() {
4184
- if (!c.video) {
4185
- A(m("status.videoDisabled"));
4213
+ if (!d.video) {
4214
+ S(p("status.videoDisabled"));
4186
4215
  return;
4187
4216
  }
4188
- l.dialog.hidden = !0, l.stop.hidden = !1, se(), l.launcher.hidden = !0, ne = Pi({
4217
+ n.dialog.hidden = !0, n.stop.hidden = !1, re(), n.launcher.hidden = !0, le = Pi({
4189
4218
  onStart() {
4190
4219
  },
4191
4220
  onStop(e) {
4192
- V = e, l.stop.hidden = !0, we(), l.dialog.hidden = !1, pe(), Y(), A(m(e ? "status.videoAttached" : "status.recordingCancelled"));
4221
+ K = e, n.stop.hidden = !0, ze(), n.dialog.hidden = !1, he(), te(), S(p(e ? "status.videoAttached" : "status.recordingCancelled"));
4193
4222
  },
4194
4223
  onError(e) {
4195
- A(e.message);
4224
+ S(e.message);
4196
4225
  }
4197
4226
  });
4198
4227
  try {
4199
- await ne.start();
4228
+ await le.start();
4200
4229
  } catch (e) {
4201
- l.stop.hidden = !0, we(), l.dialog.hidden = !1, A(e.message);
4230
+ n.stop.hidden = !0, ze(), n.dialog.hidden = !1, S(e.message);
4202
4231
  }
4203
4232
  }
4204
- function Y() {
4205
- if (l.shot = null, !Z()) {
4206
- l.canvas.style.removeProperty("--nf-shot-aspect"), l.canvas.style.removeProperty("aspect-ratio"), l.canvas.innerHTML = V ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(V)}"></video>` : "", Ce();
4233
+ function te() {
4234
+ if (n.shot = null, !I()) {
4235
+ n.canvas.style.removeProperty("--nf-shot-aspect"), n.canvas.style.removeProperty("aspect-ratio"), n.canvas.innerHTML = K ? `<video class="nf-recording-preview" controls src="${URL.createObjectURL(K)}"></video>` : "", Re();
4207
4236
  return;
4208
4237
  }
4209
- l.canvas.innerHTML = `<div class="nf-shot"><img alt="${z(m("shot.alt"))}" src="${F}" draggable="false"></div>`, l.shot = l.canvas.querySelector(".nf-shot");
4210
- const e = l.shot.querySelector("img");
4238
+ n.canvas.innerHTML = `<div class="nf-shot"><img alt="${x(p("shot.alt"))}" src="${G}" draggable="false"></div>`, n.shot = n.canvas.querySelector(".nf-shot");
4239
+ const e = n.shot.querySelector("img");
4211
4240
  e.draggable = !1, e.addEventListener("dragstart", (a) => a.preventDefault());
4212
4241
  const t = () => {
4213
- ys(e), x();
4242
+ ys(e), O();
4214
4243
  };
4215
- e.addEventListener("load", t), e.complete && e.naturalWidth && t(), Ce();
4244
+ e.addEventListener("load", t), e.complete && e.naturalWidth && t(), Re();
4216
4245
  }
4217
4246
  function ys(e) {
4218
- const t = e.naturalWidth || B.w, a = e.naturalHeight || B.h;
4219
- if (t && a && (B = { w: t, h: a }, l.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), l.canvas.style.aspectRatio = `${t} / ${a}`), !l.shot || !B.w || !B.h)
4247
+ const t = e.naturalWidth || q.w, a = e.naturalHeight || q.h;
4248
+ if (t && a && (q = { w: t, h: a }, n.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), n.canvas.style.aspectRatio = `${t} / ${a}`), !n.shot || !q.w || !q.h)
4220
4249
  return;
4221
- const o = k.crop(), s = B.w / B.h, i = o.w / o.h * s, r = Math.min(1, i / s), n = Math.min(1, s / i);
4222
- l.shot.style.left = `${(1 - r) / 2 * 100}%`, l.shot.style.top = `${(1 - n) / 2 * 100}%`, l.shot.style.width = `${r * 100}%`, l.shot.style.height = `${n * 100}%`, e.style.width = `${100 / o.w}%`, e.style.height = `${100 / o.h}%`, e.style.left = `${-o.x / o.w * 100}%`, e.style.top = `${-o.y / o.h * 100}%`;
4250
+ const o = A.crop(), s = q.w / q.h, i = o.w / o.h * s, r = Math.min(1, i / s), l = Math.min(1, s / i);
4251
+ n.shot.style.left = `${(1 - r) / 2 * 100}%`, n.shot.style.top = `${(1 - l) / 2 * 100}%`, n.shot.style.width = `${r * 100}%`, n.shot.style.height = `${l * 100}%`, e.style.width = `${100 / o.w}%`, e.style.height = `${100 / o.h}%`, e.style.left = `${-o.x / o.w * 100}%`, e.style.top = `${-o.y / o.h * 100}%`;
4223
4252
  }
4224
4253
  function vs(e) {
4225
4254
  return e.type === "arrow" ? {
@@ -4236,42 +4265,42 @@ function vs(e) {
4236
4265
  id: "preview",
4237
4266
  type: e.type,
4238
4267
  number: "",
4239
- ...Le(e.start, e.current)
4268
+ ...Ue(e.start, e.current)
4240
4269
  };
4241
4270
  }
4242
- function x() {
4243
- if ((l.shot || l.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !Z() || !l.shot) {
4244
- Ce();
4271
+ function O() {
4272
+ if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !I() || !n.shot) {
4273
+ Re();
4245
4274
  return;
4246
4275
  }
4247
- const t = k.crop(), a = ce(), o = Xe(a.clientWidth || 400);
4248
- if (l.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), l.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), l.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), l.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (S == null ? void 0 : S.kind) === "crop") {
4276
+ const t = A.crop(), a = me(), o = Kt(a.clientWidth || 400);
4277
+ if (n.shot.style.setProperty("--nf-anno-stroke", `${o.stroke}px`), n.shot.style.setProperty("--nf-anno-badge", `${o.badgeRadius * 2}px`), n.shot.style.setProperty("--nf-anno-badge-font", `${o.fontSize}px`), n.shot.style.setProperty("--nf-anno-handle", `${Math.max(8, o.stroke * 2.5)}px`), (j == null ? void 0 : j.kind) === "crop") {
4249
4278
  const i = document.createElement("div");
4250
- i.className = "nf-crop", Ct(i, Le(S.start, S.current), { x: 0, y: 0, w: 1, h: 1 }), l.shot.appendChild(i);
4279
+ i.className = "nf-crop", Ct(i, Ue(j.start, j.current), { x: 0, y: 0, w: 1, h: 1 }), n.shot.appendChild(i);
4251
4280
  }
4252
- const s = k.list().slice();
4253
- if ((S == null ? void 0 : S.kind) === "sticker" && s.push(vs(S)), s.forEach((i) => {
4254
- const r = i.id === "preview", n = !r && i.id === T, u = document.createElement("div");
4255
- if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id, n && (u.dataset.selected = "true"), r && (u.dataset.preview = "true"), i.type === "arrow" ? ks(u, i, t, n, o) : (Ct(u, i, t), n && ["nw", "ne", "sw", "se"].forEach((d) => qe(u, d))), !r && i.number) {
4256
- const d = document.createElement("span");
4257
- d.className = "nf-badge", d.textContent = String(i.number), u.appendChild(d);
4281
+ const s = A.list().slice();
4282
+ if ((j == null ? void 0 : j.kind) === "sticker" && s.push(vs(j)), s.forEach((i) => {
4283
+ const r = i.id === "preview", l = !r && i.id === M, u = document.createElement("div");
4284
+ if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id, l && (u.dataset.selected = "true"), r && (u.dataset.preview = "true"), i.type === "arrow" ? ks(u, i, t, l, o) : (Ct(u, i, t), l && ["nw", "ne", "sw", "se"].forEach((c) => Ge(u, c))), !r && i.number) {
4285
+ const c = document.createElement("span");
4286
+ c.className = "nf-badge", c.textContent = String(i.number), u.appendChild(c);
4258
4287
  }
4259
- l.shot.appendChild(u);
4260
- }), l.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), V) {
4288
+ n.shot.appendChild(u);
4289
+ }), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), K) {
4261
4290
  const i = document.createElement("video");
4262
- i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(V), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", l.canvas.appendChild(i);
4291
+ i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(K), i.style.position = "absolute", i.style.right = "8px", i.style.bottom = "8px", i.style.width = "160px", n.canvas.appendChild(i);
4263
4292
  }
4264
- Ce();
4293
+ Re();
4265
4294
  }
4266
- function ks(e, t, a, o, s = Xe(400)) {
4267
- const i = ce(), r = i.clientWidth, n = i.clientHeight, u = (t.x - a.x) / a.w * r, d = (t.y - a.y) / a.h * n, p = ((t.x2 ?? t.x + t.w) - a.x) / a.w * r, y = ((t.y2 ?? t.y) - a.y) / a.h * n, v = Math.max(18, s.arrowHead + s.stroke * 2), b = Math.min(u, p) - v, C = Math.min(d, y) - v, E = Math.max(2, Math.abs(p - u)) + v * 2, M = Math.max(2, Math.abs(y - d)) + v * 2, P = u - b, $ = d - C, X = p - b, Q = y - C, N = Kt(P, $, X, Q, s), ee = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4268
- e.style.left = `${b}px`, e.style.top = `${C}px`, e.style.width = `${E}px`, e.style.height = `${M}px`, ee.setAttribute("class", "nf-arrow-svg"), ee.setAttribute("viewBox", `0 0 ${E} ${M}`), ee.setAttribute("width", String(E)), ee.setAttribute("height", String(M)), ee.innerHTML = `
4269
- <line class="nf-arrow-hit" x1="${P}" y1="${$}" x2="${X}" y2="${Q}" />
4270
- <line class="nf-arrow-shaft" x1="${P}" y1="${$}" x2="${N.shaftEnd.x}" y2="${N.shaftEnd.y}" />
4271
- <polygon class="nf-arrow-head" points="${N.tipX},${N.tipY} ${N.left.x},${N.left.y} ${N.right.x},${N.right.y}" />
4272
- `, e.appendChild(ee), o && (qe(e, "start", { left: P - 5, top: $ - 5 }), qe(e, "end", { left: X - 5, top: Q - 5 }));
4295
+ function ks(e, t, a, o, s = Kt(400)) {
4296
+ const i = me(), r = i.clientWidth, l = i.clientHeight, u = (t.x - a.x) / a.w * r, c = (t.y - a.y) / a.h * l, g = ((t.x2 ?? t.x + t.w) - a.x) / a.w * r, v = ((t.y2 ?? t.y) - a.y) / a.h * l, k = Math.max(18, s.arrowHead + s.stroke * 2), w = Math.min(u, g) - k, b = Math.min(c, v) - k, z = Math.max(2, Math.abs(g - u)) + k * 2, R = Math.max(2, Math.abs(v - c)) + k * 2, F = u - w, B = c - b, P = g - w, m = v - b, C = Fi(F, B, P, m, s), X = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4297
+ e.style.left = `${w}px`, e.style.top = `${b}px`, e.style.width = `${z}px`, e.style.height = `${R}px`, X.setAttribute("class", "nf-arrow-svg"), X.setAttribute("viewBox", `0 0 ${z} ${R}`), X.setAttribute("width", String(z)), X.setAttribute("height", String(R)), X.innerHTML = `
4298
+ <line class="nf-arrow-hit" x1="${F}" y1="${B}" x2="${P}" y2="${m}" />
4299
+ <line class="nf-arrow-shaft" x1="${F}" y1="${B}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
4300
+ <polygon class="nf-arrow-head" points="${C.tipX},${C.tipY} ${C.left.x},${C.left.y} ${C.right.x},${C.right.y}" />
4301
+ `, e.appendChild(X), o && (Ge(e, "start", { left: F - 5, top: B - 5 }), Ge(e, "end", { left: P - 5, top: m - 5 }));
4273
4302
  }
4274
- function qe(e, t, a) {
4303
+ function Ge(e, t, a) {
4275
4304
  const o = document.createElement("span");
4276
4305
  o.className = "nf-handle", o.dataset.dir = t, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), e.appendChild(o);
4277
4306
  }
@@ -4280,22 +4309,22 @@ function Ct(e, t, a) {
4280
4309
  }
4281
4310
  function sa() {
4282
4311
  try {
4283
- return String(localStorage.getItem(Wt) || "").trim();
4312
+ return String(localStorage.getItem(_t) || "").trim();
4284
4313
  } catch {
4285
4314
  return "";
4286
4315
  }
4287
4316
  }
4288
4317
  function bs(e) {
4289
4318
  const t = String(e || "").trim();
4290
- if (!(!t || t === _e()))
4319
+ if (!(!t || t === qe()))
4291
4320
  try {
4292
- localStorage.setItem(Wt, t);
4321
+ localStorage.setItem(_t, t);
4293
4322
  } catch {
4294
4323
  }
4295
4324
  }
4296
4325
  function ra() {
4297
4326
  try {
4298
- const e = localStorage.getItem(Jt);
4327
+ const e = localStorage.getItem(Zt);
4299
4328
  if (!e)
4300
4329
  return { diagnostics: !1, logs: !1 };
4301
4330
  const t = JSON.parse(e);
@@ -4313,7 +4342,7 @@ function zt(e = {}) {
4313
4342
  ...e
4314
4343
  };
4315
4344
  try {
4316
- localStorage.setItem(Jt, JSON.stringify({
4345
+ localStorage.setItem(Zt, JSON.stringify({
4317
4346
  diagnostics: !!t.diagnostics,
4318
4347
  logs: !!t.logs
4319
4348
  }));
@@ -4321,67 +4350,67 @@ function zt(e = {}) {
4321
4350
  }
4322
4351
  }
4323
4352
  function na() {
4324
- return !!(String(I.userId || "").trim() || String(I.email || "").trim() || String(I.displayName || "").trim());
4353
+ return !!(String(N.userId || "").trim() || String(N.email || "").trim() || String(N.displayName || "").trim());
4325
4354
  }
4326
4355
  function la() {
4327
4356
  return String(
4328
- I.displayName || I.email || I.userId || ""
4357
+ N.displayName || N.email || N.userId || ""
4329
4358
  ).trim();
4330
4359
  }
4331
- function _e() {
4332
- return m("form.authorPlaceholder");
4360
+ function qe() {
4361
+ return p("form.authorPlaceholder");
4333
4362
  }
4334
4363
  function ws() {
4335
4364
  var t;
4336
4365
  if (na())
4337
- return la() || _e();
4338
- const e = String(((t = l.author) == null ? void 0 : t.value) || "").trim();
4339
- return e ? (bs(e), e) : _e();
4366
+ return la() || qe();
4367
+ const e = String(((t = n.author) == null ? void 0 : t.value) || "").trim();
4368
+ return e ? (bs(e), e) : qe();
4340
4369
  }
4341
4370
  function ua() {
4342
- if (!l.author)
4371
+ if (!n.author)
4343
4372
  return;
4344
4373
  const e = na();
4345
- if (l.author.hidden = e, e) {
4346
- l.author.value = "";
4374
+ if (n.author.hidden = e, e) {
4375
+ n.author.value = "";
4347
4376
  return;
4348
4377
  }
4349
- l.author.value = sa();
4378
+ n.author.value = sa();
4350
4379
  }
4351
- function da(e, t = _t) {
4380
+ function ca(e, t = qt) {
4352
4381
  const a = Number(e);
4353
4382
  return Number.isFinite(a) ? Math.min(Yi, Math.max(0, Math.floor(a))) : t;
4354
4383
  }
4355
- function ca(e) {
4356
- e.key !== "Escape" || !l.dialog || l.dialog.hidden || Re && !Pe || re();
4384
+ function da(e) {
4385
+ e.key !== "Escape" || !n.dialog || n.dialog.hidden || de && !pe || ee();
4357
4386
  }
4358
4387
  function pa(e = {}) {
4359
4388
  ki(e);
4360
4389
  const t = Object.prototype.hasOwnProperty.call(e, "kinds");
4361
- c = {
4362
- ...c,
4363
- endpoint: String(e.endpoint || c.endpoint || "").replace(/\/$/, ""),
4364
- projectKey: e.projectKey == null ? c.projectKey : String(e.projectKey),
4365
- version: e.version == null ? c.version : String(e.version),
4366
- name: e.name == null ? c.name : String(e.name || ""),
4367
- targets: e.targets === void 0 ? c.targets : e.targets,
4368
- hideLauncher: e.hideLauncher == null ? c.hideLauncher : !!e.hideLauncher,
4369
- theme: Yt(e.theme ?? c.theme),
4370
- video: e.video == null ? c.video : !!e.video,
4371
- consoleLogLimit: e.consoleLogLimit == null ? c.consoleLogLimit : da(e.consoleLogLimit, c.consoleLogLimit),
4372
- kinds: t ? _i(e.kinds) : c.kinds,
4373
- kindsCustom: t ? !0 : c.kindsCustom,
4374
- capture: e.capture === void 0 ? c.capture : e.capture,
4375
- onBeforeCapture: e.onBeforeCapture === void 0 ? c.onBeforeCapture : e.onBeforeCapture,
4376
- onOpen: e.onOpen === void 0 ? c.onOpen : e.onOpen,
4377
- onClose: e.onClose === void 0 ? c.onClose : e.onClose,
4378
- displayLink: e.displayLink == null ? c.displayLink : !!e.displayLink,
4379
- locale: e.locale === void 0 ? c.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
4380
- translations: e.translations === void 0 ? c.translations : e.translations && typeof e.translations == "object" ? e.translations : null
4390
+ d = {
4391
+ ...d,
4392
+ endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
4393
+ projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
4394
+ version: e.version == null ? d.version : String(e.version),
4395
+ name: e.name == null ? d.name : String(e.name || ""),
4396
+ targets: e.targets === void 0 ? d.targets : e.targets,
4397
+ hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
4398
+ theme: Jt(e.theme ?? d.theme),
4399
+ video: e.video == null ? d.video : !!e.video,
4400
+ consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : ca(e.consoleLogLimit, d.consoleLogLimit),
4401
+ kinds: t ? _i(e.kinds) : d.kinds,
4402
+ kindsCustom: t ? !0 : d.kindsCustom,
4403
+ capture: e.capture === void 0 ? d.capture : e.capture,
4404
+ onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
4405
+ onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
4406
+ onClose: e.onClose === void 0 ? d.onClose : e.onClose,
4407
+ displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink,
4408
+ locale: e.locale === void 0 ? d.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
4409
+ translations: e.translations === void 0 ? d.translations : e.translations && typeof e.translations == "object" ? e.translations : null
4381
4410
  };
4382
4411
  }
4383
4412
  function ga(e) {
4384
- const t = c[e];
4413
+ const t = d[e];
4385
4414
  if (typeof t == "function")
4386
4415
  try {
4387
4416
  t();
@@ -4390,102 +4419,102 @@ function ga(e) {
4390
4419
  }
4391
4420
  }
4392
4421
  function Ss() {
4393
- return ue;
4422
+ return ce;
4394
4423
  }
4395
4424
  function As() {
4396
- return fe();
4425
+ return be();
4397
4426
  }
4398
4427
  function Cs(e, t) {
4399
- return c.locale = e == null || e === "" ? null : String(e), t !== void 0 && (c.translations = t && typeof t == "object" ? t : null), g ? se() : Xt(), Ue;
4428
+ return d.locale = e == null || e === "" ? null : String(e), t !== void 0 && (d.translations = t && typeof t == "object" ? t : null), y ? re() : Yt(), Fe;
4400
4429
  }
4401
- function at(e = {}) {
4402
- return pa(e), g && se(), Ue;
4430
+ function tt(e = {}) {
4431
+ return pa(e), y && re(), Fe;
4403
4432
  }
4404
4433
  function zs(e = {}) {
4405
- return pa(e), Qe(), se(), Ue;
4406
- }
4407
- function js(e) {
4408
- return at({ theme: e });
4434
+ return pa(e), Ye(), re(), Fe;
4409
4435
  }
4410
4436
  function Es(e) {
4437
+ return tt({ theme: e });
4438
+ }
4439
+ function js(e) {
4411
4440
  const t = !!e;
4412
- return !t && g && l.dialog && !l.dialog.hidden && re(), at({ hideLauncher: !t });
4441
+ return !t && y && n.dialog && !n.dialog.hidden && ee(), tt({ hideLauncher: !t });
4413
4442
  }
4414
4443
  function Rs() {
4415
4444
  const e = la() || sa() || void 0, t = yi({
4416
- ...I,
4417
- displayName: I.displayName || e
4445
+ ...N,
4446
+ displayName: N.displayName || e
4418
4447
  });
4419
- D = Bi(t), O = Ni(
4420
- qt.snapshot().slice(-da(c.consoleLogLimit))
4448
+ $ = Bi(t), V = Ni(
4449
+ Gt.snapshot().slice(-ca(d.consoleLogLimit))
4421
4450
  );
4422
4451
  const a = ra();
4423
- a.diagnostics && be(D, !0), a.logs && O.length && be(O, !0), H = !1;
4452
+ a.diagnostics && Ce($, !0), a.logs && V.length && Ce(V, !0), Z = !1;
4424
4453
  }
4425
- function ze(e) {
4426
- H = !!e, l.privacyPanel && (l.privacyPanel.hidden = !H), l.privacyChange && (l.privacyChange.setAttribute("aria-expanded", H ? "true" : "false"), l.privacyChange.dataset.active = String(H)), H && it();
4454
+ function Pe(e) {
4455
+ Z = !!e, n.privacyPanel && (n.privacyPanel.hidden = !Z), n.privacyChange && (n.privacyChange.setAttribute("aria-expanded", Z ? "true" : "false"), n.privacyChange.dataset.active = String(Z)), Z && ot();
4427
4456
  }
4428
- function ot() {
4429
- if (!l.privacy || !l.privacyText || !l.privacyChange)
4457
+ function at() {
4458
+ if (!n.privacy || !n.privacyText || !n.privacyChange)
4430
4459
  return;
4431
4460
  const e = Hi({
4432
- diagnostics: D,
4433
- logs: O
4461
+ diagnostics: $,
4462
+ logs: V
4434
4463
  });
4435
- l.privacyText.textContent = e, l.privacyText.hidden = !e;
4436
- const t = D.length === 0 && O.length === 0;
4437
- l.privacySummary && (l.privacySummary.hidden = t), l.privacy.hidden = t, l.privacyChange.hidden = !1;
4464
+ n.privacyText.textContent = e, n.privacyText.hidden = !e;
4465
+ const t = $.length === 0 && V.length === 0;
4466
+ n.privacySummary && (n.privacySummary.hidden = t), n.privacy.hidden = t, n.privacyChange.hidden = !1;
4438
4467
  }
4439
4468
  function ma(e, t, a) {
4440
4469
  return `<label class="nf-privacy-toggle">
4441
- <span class="nf-privacy-toggle-label">${z(m("privacy.redact"))}</span>
4442
- <input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${z(a)}">
4470
+ <span class="nf-privacy-toggle-label">${x(p("privacy.redact"))}</span>
4471
+ <input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${x(a)}">
4443
4472
  </label>`;
4444
4473
  }
4445
- function jt(e, t, a, o, s, i = null) {
4446
- const r = ma(s, !1, `${m("privacy.redact")} ${a}`), n = typeof o == "string" ? o : String(o || "");
4474
+ function Et(e, t, a, o, s, i = null) {
4475
+ const r = ma(s, !1, `${p("privacy.redact")} ${a}`), l = typeof o == "string" ? o : String(o || "");
4447
4476
  if (s) {
4448
- const d = n ? `${a}: ${n}` : a;
4449
- return `<div class="nf-privacy-row" data-kind="${z(e)}" data-id="${z(t)}" data-redacted="true">
4477
+ const c = l ? `${a}: ${l}` : a;
4478
+ return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}" data-redacted="true">
4450
4479
  <div class="nf-privacy-row-text">
4451
- <div class="nf-privacy-row-summary" title="${z(d)}">${z(d)}</div>
4480
+ <div class="nf-privacy-row-summary" title="${x(c)}">${x(c)}</div>
4452
4481
  </div>
4453
4482
  ${r}
4454
4483
  </div>`;
4455
4484
  }
4456
- const u = i ?? z(n);
4457
- return `<div class="nf-privacy-row" data-kind="${z(e)}" data-id="${z(t)}">
4485
+ const u = i ?? x(l);
4486
+ return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}">
4458
4487
  <div class="nf-privacy-row-text">
4459
- <div class="nf-privacy-row-title">${z(a)}</div>
4488
+ <div class="nf-privacy-row-title">${x(a)}</div>
4460
4489
  <div class="nf-privacy-row-detail">${u}</div>
4461
4490
  </div>
4462
4491
  ${r}
4463
4492
  </div>`;
4464
4493
  }
4465
- function Et(e, t, a, o) {
4494
+ function jt(e, t, a, o) {
4466
4495
  if (!a.length)
4467
4496
  return "";
4468
4497
  const s = Ki(a), i = s.checked && !s.indeterminate;
4469
- return `<section class="nf-privacy-section" data-section="${z(e)}"${i ? ' data-redacted="true"' : ""}>
4498
+ return `<section class="nf-privacy-section" data-section="${x(e)}"${i ? ' data-redacted="true"' : ""}>
4470
4499
  <div class="nf-privacy-section-head">
4471
- <h3 class="nf-privacy-section-title">${z(t)}</h3>
4472
- ${ma(s.checked, s.indeterminate, `${m("privacy.redact")} ${t}`)}
4500
+ <h3 class="nf-privacy-section-title">${x(t)}</h3>
4501
+ ${ma(s.checked, s.indeterminate, `${p("privacy.redact")} ${t}`)}
4473
4502
  </div>
4474
4503
  <div class="nf-privacy-rows"${i ? " hidden" : ""}>${o}</div>
4475
4504
  </section>`;
4476
4505
  }
4477
- function it() {
4478
- if (!l.privacyScroll)
4506
+ function ot() {
4507
+ if (!n.privacyScroll)
4479
4508
  return;
4480
- const e = D.map((a) => jt(
4509
+ const e = $.map((a) => Et(
4481
4510
  "diagnostic",
4482
4511
  a.key,
4483
4512
  a.label,
4484
4513
  Gi(a.value),
4485
4514
  a.redacted
4486
- )).join(""), t = O.map((a) => {
4515
+ )).join(""), t = V.map((a) => {
4487
4516
  const o = Ai(a);
4488
- return jt(
4517
+ return Et(
4489
4518
  "log",
4490
4519
  a.id,
4491
4520
  a.level,
@@ -4494,12 +4523,12 @@ function it() {
4494
4523
  a.redacted ? null : Ci(a)
4495
4524
  );
4496
4525
  }).join("");
4497
- l.privacyScroll.innerHTML = [
4498
- Et("diagnostics", m("privacy.section.diagnostics"), D, e),
4499
- O.length ? Et("logs", m("privacy.section.logs"), O, t) : ""
4500
- ].join(""), l.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4526
+ n.privacyScroll.innerHTML = [
4527
+ jt("diagnostics", p("privacy.section.diagnostics"), $, e),
4528
+ V.length ? jt("logs", p("privacy.section.logs"), V, t) : ""
4529
+ ].join(""), n.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
4501
4530
  a.indeterminate = !0, a.removeAttribute("data-indeterminate");
4502
- }), ot();
4531
+ }), at();
4503
4532
  }
4504
4533
  function Ps(e) {
4505
4534
  const t = e.target;
@@ -4509,167 +4538,205 @@ function Ps(e) {
4509
4538
  if (o) {
4510
4539
  const i = o.dataset.kind, r = o.dataset.id;
4511
4540
  if (i === "diagnostic") {
4512
- const n = D.find((u) => u.key === r);
4513
- n && (n.redacted = s);
4541
+ const l = $.find((u) => u.key === r);
4542
+ l && (l.redacted = s);
4514
4543
  } else if (i === "log") {
4515
- const n = O.find((u) => u.id === r);
4516
- n && (n.redacted = s);
4544
+ const l = V.find((u) => u.id === r);
4545
+ l && (l.redacted = s);
4517
4546
  }
4518
4547
  } else if (a) {
4519
4548
  const i = a.dataset.section;
4520
- i === "diagnostics" ? (be(D, s), zt({ diagnostics: s })) : i === "logs" && (be(O, s), zt({ logs: s }));
4549
+ i === "diagnostics" ? (Ce($, s), zt({ diagnostics: s })) : i === "logs" && (Ce(V, s), zt({ logs: s }));
4521
4550
  } else
4522
4551
  return;
4523
- it();
4552
+ ot();
4524
4553
  }
4525
4554
  async function ha() {
4526
- Qe(), ue || (ue = !0, ga("onOpen")), fa(), se(), l.launcher.hidden = !0, k = Ye(), B = { w: 0, h: 0 }, V = null, F = "", ie = "", T = null, S = null, w = null, _ = is(), et(_), de(null), xe(!1), l.text.value = "", ua(), A(""), Rs();
4555
+ Ye(), ce || (ce = !0, ga("onOpen")), fa(), re(), n.launcher.hidden = !0, A = Je(), q = { w: 0, h: 0 }, K = null, G = "", se = "", M = null, j = null, E = null, H = is(), Xe(H), ge(null), Te(!1), n.text.value = "", ua(), S(""), Rs();
4527
4556
  try {
4528
- ia(await $t(oa())), A("");
4557
+ ia(await $t(oa())), S("");
4529
4558
  } catch (t) {
4530
- F = "", A((t == null ? void 0 : t.message) || m("status.screenshotFailed"));
4559
+ G = "", S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
4531
4560
  }
4532
- pe(), ze(!1), ot(), l.dialog.hidden = !1, Y(), l.text.focus();
4561
+ he(), Pe(!1), at(), n.dialog.hidden = !1, te(), n.text.focus();
4533
4562
  }
4534
- function re() {
4535
- if (!g)
4563
+ function ee() {
4564
+ if (!y)
4536
4565
  return;
4537
- const e = ue;
4538
- J == null || J.stop(), xe(!1), ta(), S = null, w = null, tt(!1), fa(), ze(!1), l.dialog.hidden = !0, l.stop.hidden = !0, we(), e && (ue = !1, ga("onClose"));
4566
+ const e = ce;
4567
+ Q == null || Q.stop(), Te(!1), ta(), j = null, E = null, et(!1), fa(), Pe(!1), n.dialog.hidden = !0, n.stop.hidden = !0, ze(), e && (ce = !1, ga("onClose"));
4539
4568
  }
4540
- function Ls(e = "") {
4541
- const t = l.dialog, a = l.panel, o = l.panelBody, s = l.successMsg, i = l.successLink, r = String(e || "").trim(), n = !!(c.displayLink && r);
4569
+ function xs(e = "") {
4570
+ const t = n.dialog, a = n.panel, o = n.panelBody, s = n.successMsg, i = n.successLink, r = String(e || "").trim(), l = !!(d.displayLink && r);
4542
4571
  if (!t || !a || !o || !s)
4543
4572
  return Promise.resolve(!1);
4544
- Re = !0, Pe = n, A("");
4545
- const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, d = a.getBoundingClientRect();
4546
- if (o.hidden = !0, s.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky", n), t.style.opacity = "1", i && (n ? (i.hidden = !1, i.href = r) : (i.hidden = !0, i.removeAttribute("href"))), n) {
4573
+ de = !0, pe = l, S("");
4574
+ const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, c = a.getBoundingClientRect();
4575
+ if (o.hidden = !0, s.hidden = !1, t.classList.add("nf-success"), t.classList.toggle("nf-success-sticky", l), t.style.opacity = "1", i && (l ? (i.hidden = !1, i.href = r) : (i.hidden = !0, i.removeAttribute("href"))), l) {
4547
4576
  if (u)
4548
4577
  return Promise.resolve(!0);
4549
- const b = a.getBoundingClientRect(), C = b.width > 0 ? d.width / b.width : 1, E = b.height > 0 ? d.height / b.height : 1;
4550
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${C}, ${E})`, a.getBoundingClientRect(), new Promise((M) => {
4551
- let P = !1;
4552
- const $ = () => {
4553
- P || (P = !0, a.removeEventListener("transitionend", X), M(!0));
4554
- }, X = (Q) => {
4555
- Q.target !== a || Q.propertyName !== "transform" || $();
4578
+ const w = a.getBoundingClientRect(), b = w.width > 0 ? c.width / w.width : 1, z = w.height > 0 ? c.height / w.height : 1;
4579
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((R) => {
4580
+ let F = !1;
4581
+ const B = () => {
4582
+ F || (F = !0, a.removeEventListener("transitionend", P), R(!0));
4583
+ }, P = (m) => {
4584
+ m.target !== a || m.propertyName !== "transform" || B();
4556
4585
  };
4557
- a.addEventListener("transitionend", X), requestAnimationFrame(() => {
4586
+ a.addEventListener("transitionend", P), requestAnimationFrame(() => {
4558
4587
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4559
- }), window.setTimeout($, 700);
4588
+ }), window.setTimeout(B, 700);
4560
4589
  });
4561
4590
  }
4562
4591
  if (u)
4563
- return new Promise((b) => {
4564
- window.setTimeout(() => b(!1), 1e3);
4592
+ return new Promise((w) => {
4593
+ window.setTimeout(() => w(!1), 1e3);
4565
4594
  });
4566
- const p = a.getBoundingClientRect(), y = p.width > 0 ? d.width / p.width : 1, v = p.height > 0 ? d.height / p.height : 1;
4567
- return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${y}, ${v})`, a.getBoundingClientRect(), new Promise((b) => {
4568
- let C = !1;
4569
- const E = () => {
4570
- C || (C = !0, a.removeEventListener("transitionend", M), window.setTimeout(() => {
4571
- t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => b(!1), 280);
4595
+ const g = a.getBoundingClientRect(), v = g.width > 0 ? c.width / g.width : 1, k = g.height > 0 ? c.height / g.height : 1;
4596
+ return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${v}, ${k})`, a.getBoundingClientRect(), new Promise((w) => {
4597
+ let b = !1;
4598
+ const z = () => {
4599
+ b || (b = !0, a.removeEventListener("transitionend", R), window.setTimeout(() => {
4600
+ t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
4572
4601
  }, 1e3));
4573
- }, M = (P) => {
4574
- P.target !== a || P.propertyName !== "transform" || E();
4602
+ }, R = (F) => {
4603
+ F.target !== a || F.propertyName !== "transform" || z();
4575
4604
  };
4576
- a.addEventListener("transitionend", M), requestAnimationFrame(() => {
4605
+ a.addEventListener("transitionend", R), requestAnimationFrame(() => {
4577
4606
  a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
4578
- }), window.setTimeout(E, 700);
4607
+ }), window.setTimeout(z, 700);
4579
4608
  });
4580
4609
  }
4581
4610
  function fa() {
4582
- Re = !1, Pe = !1, l.dialog && (l.dialog.classList.remove("nf-success", "nf-success-sticky"), l.dialog.style.opacity = "", l.dialog.style.transition = "", l.panel && (l.panel.style.transform = "", l.panel.style.transition = "", l.panel.style.transformOrigin = ""), l.panelBody && (l.panelBody.hidden = !1), l.successMsg && (l.successMsg.hidden = !0), l.successLink && (l.successLink.hidden = !0, l.successLink.removeAttribute("href")));
4611
+ de = !1, pe = !1, n.dialog && (n.dialog.classList.remove("nf-success", "nf-success-sticky"), n.dialog.style.opacity = "", n.dialog.style.transition = "", n.panel && (n.panel.style.transform = "", n.panel.style.transition = "", n.panel.style.transformOrigin = ""), n.panelBody && (n.panelBody.hidden = !1), n.successMsg && (n.successMsg.hidden = !0), n.successLink && (n.successLink.hidden = !0, n.successLink.removeAttribute("href")));
4583
4612
  }
4584
- function xs(e = {}) {
4585
- I = { ...I, ...vi(e) }, ua();
4613
+ function Ls(e = {}) {
4614
+ N = { ...N, ...vi(e) }, ua();
4586
4615
  }
4587
4616
  async function ya() {
4588
- if (Qe(), Ie)
4617
+ var t, a;
4618
+ if (Ye(), Ve)
4589
4619
  return null;
4590
- const e = l.text.value.trim();
4591
- if (!e && !Z() && !V)
4592
- return A(m("status.emptyReport")), null;
4593
- if (!c.endpoint || !c.projectKey)
4594
- return A(m("status.missingConfig")), null;
4595
- Ie = !0, Rt(!0), A(m("status.submitting"), !0);
4620
+ const e = n.text.value.trim();
4621
+ if (!e && !I() && !K)
4622
+ return S(p("status.emptyReport")), null;
4623
+ if (!d.endpoint || !d.projectKey)
4624
+ return S(p("status.missingConfig")), null;
4625
+ Ve = !0, Rt(!0), S(p("status.submitting"), !0);
4596
4626
  try {
4597
- const t = ws(), a = new FormData();
4598
- a.append("message", e), a.append("kind", _), a.append("version", c.version || "0.0.0"), a.append("author", t), c.name && a.append("name", c.name), a.append("context", JSON.stringify(qi({
4599
- author: t,
4600
- diagnostics: D,
4601
- logs: O
4602
- })));
4603
- const o = k.crop(), s = k.list(), i = k.isCropped() ? xi(s, o) : s;
4604
- if (a.append("annotations", JSON.stringify(i)), Array.isArray(c.targets) && a.append("targets", JSON.stringify(c.targets)), Z()) {
4605
- const d = k.isCropped() ? await Mi(F, o) : await Xi(F);
4606
- if (a.append("screenshot", d, "screenshot.png"), s.length) {
4607
- const p = await Ii(
4608
- F,
4609
- o,
4610
- s,
4611
- {
4612
- mark: St("--nf-mark", "#fdd341"),
4613
- markText: St("--nf-mark-text", "#2a2140")
4614
- }
4615
- );
4616
- a.append("screenshotBaked", p, "screenshot.baked.png");
4627
+ const o = ws(), s = A.crop(), i = A.list(), r = A.isCropped(), l = r ? Li(i, s) : i, u = r ? { x: 0, y: 0, w: 1, h: 1 } : s, c = qi({
4628
+ author: o,
4629
+ diagnostics: $,
4630
+ logs: V
4631
+ }), g = {
4632
+ width: typeof screen < "u" ? screen.width : null,
4633
+ height: typeof screen < "u" ? screen.height : null,
4634
+ dpr: window.devicePixelRatio || 1
4635
+ }, v = [];
4636
+ let k = 2048, w = null, b = null;
4637
+ I() && (b = await kt(G, {
4638
+ crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4639
+ maxEdge: k
4640
+ }));
4641
+ for (let z = 1; z <= 3; z += 1) {
4642
+ const R = z === 3 || !b, F = R ? {
4643
+ ...b ? { width: b.width, height: b.height, mime: b.mime } : {},
4644
+ attempt: z,
4645
+ omitted: !0
4646
+ } : {
4647
+ width: b.width,
4648
+ height: b.height,
4649
+ mime: b.mime,
4650
+ attempt: z
4651
+ }, B = {
4652
+ ...c,
4653
+ screen: g,
4654
+ screenshotMeta: F
4655
+ };
4656
+ R && I() && (B.screenshotError = {
4657
+ message: (w == null ? void 0 : w.message) || "Screenshot omitted after failed uploads",
4658
+ attempts: [...v]
4659
+ });
4660
+ const P = new FormData();
4661
+ P.append("message", e), P.append("kind", H), P.append("version", d.version || "0.0.0"), P.append("author", o), d.name && P.append("name", d.name), P.append("context", JSON.stringify(B)), P.append("annotations", JSON.stringify(l)), P.append("crop", JSON.stringify(u)), Array.isArray(d.targets) && P.append("targets", JSON.stringify(d.targets)), !R && b && P.append("screenshot", b.blob, `screenshot.${b.ext}`), K && P.append("recording", K, "recording.webm");
4662
+ try {
4663
+ const m = await fetch(`${d.endpoint}/v1/reports`, {
4664
+ method: "POST",
4665
+ headers: {
4666
+ "X-Notefully-Key": d.projectKey
4667
+ },
4668
+ body: P
4669
+ });
4670
+ let C = null;
4671
+ try {
4672
+ C = await m.json();
4673
+ } catch {
4674
+ C = null;
4675
+ }
4676
+ if (!m.ok) {
4677
+ const ne = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
4678
+ throw ne.status = m.status, ne.code = C == null ? void 0 : C.code, ne.json = C, ne;
4679
+ }
4680
+ return R && I() && S(p("status.submitWithoutImage"), !0), await xs((C == null ? void 0 : C.trackerUrl) || "") || ee(), C;
4681
+ } catch (m) {
4682
+ if (w = m, v.push({
4683
+ attempt: z,
4684
+ maxEdge: R ? null : k,
4685
+ status: (m == null ? void 0 : m.status) || null,
4686
+ code: (m == null ? void 0 : m.code) || null,
4687
+ message: String((m == null ? void 0 : m.message) || m)
4688
+ }), R || !b)
4689
+ throw S(((t = m == null ? void 0 : m.json) == null ? void 0 : t.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4690
+ if (!Mi(m, (m == null ? void 0 : m.json) || null))
4691
+ throw S(((a = m == null ? void 0 : m.json) == null ? void 0 : a.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
4692
+ if (z === 1) {
4693
+ S(p("status.submitTooLarge"), !0), k = Oi(k), b = await kt(G, {
4694
+ crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
4695
+ maxEdge: k
4696
+ });
4697
+ continue;
4698
+ }
4699
+ S(p("status.submitTooLarge"), !0), b = null;
4617
4700
  }
4618
4701
  }
4619
- V && a.append("recording", V, "recording.webm");
4620
- const r = await fetch(`${c.endpoint}/v1/reports`, {
4621
- method: "POST",
4622
- headers: {
4623
- "X-Notefully-Key": c.projectKey
4624
- },
4625
- body: a
4626
- });
4627
- let n = null;
4628
- try {
4629
- n = await r.json();
4630
- } catch {
4631
- n = null;
4632
- }
4633
- if (!r.ok)
4634
- throw A((n == null ? void 0 : n.error) || m("status.submitFailed")), new Error((n == null ? void 0 : n.error) || `${m("status.submitFailed")} (${r.status})`);
4635
- return await Ls((n == null ? void 0 : n.trackerUrl) || "") || re(), n;
4702
+ throw w || new Error(p("status.submitFailed"));
4636
4703
  } finally {
4637
- Ie = !1, Rt(!1);
4704
+ Ve = !1, Rt(!1);
4638
4705
  }
4639
4706
  }
4640
4707
  function Rt(e) {
4641
- l.submit && (l.submit.disabled = !!e, l.submit.setAttribute("aria-busy", e ? "true" : "false"));
4708
+ n.submit && (n.submit.disabled = !!e, n.submit.setAttribute("aria-busy", e ? "true" : "false"));
4642
4709
  }
4643
4710
  function Us() {
4644
- re(), document.removeEventListener("keydown", ca), g == null || g.remove(), g = null, l = {};
4711
+ ee(), document.removeEventListener("keydown", da), y == null || y.remove(), y = null, n = {};
4645
4712
  }
4646
- const Ue = {
4713
+ const Fe = {
4647
4714
  init: zs,
4648
- configure: at,
4649
- setTheme: js,
4650
- setVisible: Es,
4715
+ configure: tt,
4716
+ setTheme: Es,
4717
+ setVisible: js,
4651
4718
  open: ha,
4652
- close: re,
4719
+ close: ee,
4653
4720
  isOpen: Ss,
4654
4721
  getLocale: As,
4655
4722
  setLocale: Cs,
4656
- identify: xs,
4723
+ identify: Ls,
4657
4724
  submit: ya,
4658
4725
  destroy: Us
4659
4726
  };
4660
- typeof window < "u" && (window.Notefully = Ue);
4727
+ typeof window < "u" && (window.Notefully = Fe);
4661
4728
  export {
4662
- re as close,
4663
- at as configure,
4664
- Ue as default,
4729
+ ee as close,
4730
+ tt as configure,
4731
+ Fe as default,
4665
4732
  Us as destroy,
4666
4733
  As as getLocaleTag,
4667
- xs as identify,
4734
+ Ls as identify,
4668
4735
  zs as init,
4669
4736
  Ss as isOpen,
4670
4737
  ha as open,
4671
4738
  Cs as setLocale,
4672
- js as setTheme,
4673
- Es as setVisible,
4739
+ Es as setTheme,
4740
+ js as setVisible,
4674
4741
  ya as submit
4675
4742
  };