@makefully/notefully 0.2.1 → 0.2.3
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.css +1 -1
- package/dist/notefully.iife.js +34 -34
- package/dist/notefully.js +1231 -1125
- package/package.json +1 -1
package/dist/notefully.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const he = {
|
|
2
2
|
"launcher.open": "Leave a note…",
|
|
3
3
|
"tool.crop": "Crop",
|
|
4
4
|
"tool.resetCrop": "Reset crop",
|
|
@@ -33,6 +33,8 @@ const me = {
|
|
|
33
33
|
"status.screenshotFailed": "Screenshot failed; you can still send text.",
|
|
34
34
|
"status.recaptureFailed": "Recapture failed.",
|
|
35
35
|
"status.submitFailed": "Submit failed.",
|
|
36
|
+
"status.submitTooLarge": "Screenshot too large; retrying smaller…",
|
|
37
|
+
"status.submitWithoutImage": "Submitted without screenshot.",
|
|
36
38
|
"status.emptyReport": "Add a note, screenshot, or video first.",
|
|
37
39
|
"status.missingConfig": "Notefully is missing endpoint or projectKey.",
|
|
38
40
|
"status.speechUnsupported": "Speech recognition is not supported in this browser.",
|
|
@@ -55,15 +57,15 @@ const me = {
|
|
|
55
57
|
"diag.timezone": "Timezone",
|
|
56
58
|
"diag.viewport": "Viewport",
|
|
57
59
|
"diag.user": "User"
|
|
58
|
-
},
|
|
59
|
-
"en-US":
|
|
60
|
-
},
|
|
60
|
+
}, fe = {
|
|
61
|
+
"en-US": he
|
|
62
|
+
}, Fe = {
|
|
61
63
|
en: "en-US",
|
|
62
64
|
no: "nb",
|
|
63
65
|
tl: "fil",
|
|
64
66
|
"zh-Hans": "zh-CN",
|
|
65
67
|
"zh-Hant": "zh-TW"
|
|
66
|
-
},
|
|
68
|
+
}, fa = {
|
|
67
69
|
"es-MX": ["es-419", "es"],
|
|
68
70
|
"es-AR": ["es-419", "es"],
|
|
69
71
|
"es-CL": ["es-419", "es"],
|
|
@@ -83,34 +85,34 @@ const me = {
|
|
|
83
85
|
"es-DO": ["es-419", "es"],
|
|
84
86
|
"es-PR": ["es-419", "es"],
|
|
85
87
|
"es-CU": ["es-419", "es"]
|
|
86
|
-
},
|
|
87
|
-
let
|
|
88
|
+
}, ya = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
|
|
89
|
+
let ue = "en-US", Rt = {};
|
|
88
90
|
function h(e, t) {
|
|
89
|
-
!e || !t || typeof t != "object" || (
|
|
91
|
+
!e || !t || typeof t != "object" || (fe[String(e)] = t);
|
|
90
92
|
}
|
|
91
93
|
function oe(e) {
|
|
92
94
|
return String(e || "").trim().replace(/_/g, "-");
|
|
93
95
|
}
|
|
94
|
-
function
|
|
96
|
+
function va(e) {
|
|
95
97
|
const t = oe(e);
|
|
96
98
|
if (!t)
|
|
97
99
|
return ["en-US"];
|
|
98
|
-
const a = t, o =
|
|
99
|
-
l && !
|
|
100
|
+
const a = t, o = Fe[a] || Fe[a.toLowerCase()] || a, s = [], i = (l) => {
|
|
101
|
+
l && !s.includes(l) && s.push(l);
|
|
100
102
|
};
|
|
101
103
|
i(o);
|
|
102
|
-
for (const [l, u] of Object.entries(
|
|
104
|
+
for (const [l, u] of Object.entries(fa))
|
|
103
105
|
l.toLowerCase() === o.toLowerCase() && u.forEach(i);
|
|
104
|
-
const
|
|
105
|
-
for (let l =
|
|
106
|
-
i(
|
|
107
|
-
return i(
|
|
108
|
-
}
|
|
109
|
-
function
|
|
110
|
-
for (const t of
|
|
111
|
-
if (
|
|
106
|
+
const r = o.split("-");
|
|
107
|
+
for (let l = r.length - 1; l >= 1; l -= 1)
|
|
108
|
+
i(r.slice(0, l).join("-"));
|
|
109
|
+
return i(Fe[r[0]] || r[0]), i("en-US"), s;
|
|
110
|
+
}
|
|
111
|
+
function ka(e) {
|
|
112
|
+
for (const t of va(e)) {
|
|
113
|
+
if (fe[t])
|
|
112
114
|
return t;
|
|
113
|
-
const a = Object.keys(
|
|
115
|
+
const a = Object.keys(fe).find(
|
|
114
116
|
(o) => o.toLowerCase() === t.toLowerCase()
|
|
115
117
|
);
|
|
116
118
|
if (a)
|
|
@@ -118,7 +120,7 @@ function fa(e) {
|
|
|
118
120
|
}
|
|
119
121
|
return "en-US";
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function ba(e = {}) {
|
|
122
124
|
var t;
|
|
123
125
|
if (e.locale != null && String(e.locale).trim())
|
|
124
126
|
return oe(e.locale);
|
|
@@ -129,25 +131,25 @@ function ya(e = {}) {
|
|
|
129
131
|
}
|
|
130
132
|
return typeof navigator < "u" && navigator.language ? oe(navigator.language) : "en-US";
|
|
131
133
|
}
|
|
132
|
-
function
|
|
133
|
-
return e != null && (
|
|
134
|
+
function wa(e, t) {
|
|
135
|
+
return e != null && (ue = oe(e) || "en-US"), ue;
|
|
134
136
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
137
|
+
function Sa(e) {
|
|
138
|
+
Rt = e && typeof e == "object" ? { ...e } : {};
|
|
137
139
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
140
|
+
function ye() {
|
|
141
|
+
return ue;
|
|
140
142
|
}
|
|
141
|
-
function
|
|
143
|
+
function Aa(e = ue) {
|
|
142
144
|
const t = oe(e).split("-")[0].toLowerCase();
|
|
143
|
-
return
|
|
145
|
+
return ya.has(t) ? "rtl" : "ltr";
|
|
144
146
|
}
|
|
145
|
-
function
|
|
146
|
-
const a = String(e || ""), o =
|
|
147
|
-
let i =
|
|
147
|
+
function p(e, t) {
|
|
148
|
+
const a = String(e || ""), o = ka(ue), s = fe[o] || he;
|
|
149
|
+
let i = Rt[a] ?? s[a] ?? he[a] ?? a;
|
|
148
150
|
return String(i);
|
|
149
151
|
}
|
|
150
|
-
const
|
|
152
|
+
const Ca = {
|
|
151
153
|
"launcher.open": "Оставете бележка...",
|
|
152
154
|
"tool.crop": "Реколта",
|
|
153
155
|
"tool.resetCrop": "Нулиране на изрязването",
|
|
@@ -204,7 +206,7 @@ const wa = {
|
|
|
204
206
|
"diag.timezone": "Часова зона",
|
|
205
207
|
"diag.viewport": "Изгледна плоча",
|
|
206
208
|
"diag.user": "Потребител"
|
|
207
|
-
},
|
|
209
|
+
}, za = {
|
|
208
210
|
"launcher.open": "Deixa una nota...",
|
|
209
211
|
"tool.crop": "Cultiu",
|
|
210
212
|
"tool.resetCrop": "Restablir el cultiu",
|
|
@@ -261,7 +263,7 @@ const wa = {
|
|
|
261
263
|
"diag.timezone": "Zona horària",
|
|
262
264
|
"diag.viewport": "Porta de vista",
|
|
263
265
|
"diag.user": "Usuari"
|
|
264
|
-
},
|
|
266
|
+
}, Ea = {
|
|
265
267
|
"launcher.open": "Zanechte poznámku...",
|
|
266
268
|
"tool.crop": "Oříznout",
|
|
267
269
|
"tool.resetCrop": "Obnovit oříznutí",
|
|
@@ -318,7 +320,7 @@ const wa = {
|
|
|
318
320
|
"diag.timezone": "Časové pásmo",
|
|
319
321
|
"diag.viewport": "Výřez",
|
|
320
322
|
"diag.user": "Uživatel"
|
|
321
|
-
},
|
|
323
|
+
}, ja = {
|
|
322
324
|
"launcher.open": "Efterlad en note...",
|
|
323
325
|
"tool.crop": "Afgrøde",
|
|
324
326
|
"tool.resetCrop": "Nulstil afgrøde",
|
|
@@ -375,7 +377,7 @@ const wa = {
|
|
|
375
377
|
"diag.timezone": "Tidszone",
|
|
376
378
|
"diag.viewport": "Viewport",
|
|
377
379
|
"diag.user": "Bruger"
|
|
378
|
-
},
|
|
380
|
+
}, Ra = {
|
|
379
381
|
"launcher.open": "Hinterlassen Sie eine Notiz...",
|
|
380
382
|
"tool.crop": "Ernte",
|
|
381
383
|
"tool.resetCrop": "Zuschnitt zurücksetzen",
|
|
@@ -432,7 +434,7 @@ const wa = {
|
|
|
432
434
|
"diag.timezone": "Zeitzone",
|
|
433
435
|
"diag.viewport": "Sichtfenster",
|
|
434
436
|
"diag.user": "Nutzer"
|
|
435
|
-
},
|
|
437
|
+
}, Pa = {
|
|
436
438
|
"launcher.open": "Αφήστε ένα σημείωμα...",
|
|
437
439
|
"tool.crop": "Καλλιέργεια",
|
|
438
440
|
"tool.resetCrop": "Επαναφορά της καλλιέργειας",
|
|
@@ -489,7 +491,7 @@ const wa = {
|
|
|
489
491
|
"diag.timezone": "Ζώνη ώρας",
|
|
490
492
|
"diag.viewport": "Θύρα προβολής",
|
|
491
493
|
"diag.user": "Χρήστης"
|
|
492
|
-
},
|
|
494
|
+
}, xa = {
|
|
493
495
|
"launcher.open": "Leave a note…",
|
|
494
496
|
"tool.crop": "Crop",
|
|
495
497
|
"tool.resetCrop": "Reset crop",
|
|
@@ -524,6 +526,8 @@ const wa = {
|
|
|
524
526
|
"status.screenshotFailed": "Screenshot failed; you can still send text.",
|
|
525
527
|
"status.recaptureFailed": "Recapture failed.",
|
|
526
528
|
"status.submitFailed": "Submit failed.",
|
|
529
|
+
"status.submitTooLarge": "Screenshot too large; retrying smaller…",
|
|
530
|
+
"status.submitWithoutImage": "Submitted without screenshot.",
|
|
527
531
|
"status.emptyReport": "Add a note, screenshot, or video first.",
|
|
528
532
|
"status.missingConfig": "Notefully is missing endpoint or projectKey.",
|
|
529
533
|
"status.speechUnsupported": "Speech recognition is not supported in this browser.",
|
|
@@ -546,7 +550,7 @@ const wa = {
|
|
|
546
550
|
"diag.timezone": "Timezone",
|
|
547
551
|
"diag.viewport": "Viewport",
|
|
548
552
|
"diag.user": "User"
|
|
549
|
-
},
|
|
553
|
+
}, La = {
|
|
550
554
|
"launcher.open": "Deja una nota...",
|
|
551
555
|
"tool.crop": "Cultivo",
|
|
552
556
|
"tool.resetCrop": "Restablecer cultivo",
|
|
@@ -603,7 +607,7 @@ const wa = {
|
|
|
603
607
|
"diag.timezone": "Zona horaria",
|
|
604
608
|
"diag.viewport": "Ventana",
|
|
605
609
|
"diag.user": "Usuario"
|
|
606
|
-
},
|
|
610
|
+
}, Ua = {
|
|
607
611
|
"launcher.open": "Deja una nota...",
|
|
608
612
|
"tool.crop": "Cultivo",
|
|
609
613
|
"tool.resetCrop": "Restablecer recorte",
|
|
@@ -660,7 +664,7 @@ const wa = {
|
|
|
660
664
|
"diag.timezone": "Zona horaria",
|
|
661
665
|
"diag.viewport": "ViEWPORT",
|
|
662
666
|
"diag.user": "Usuario"
|
|
663
|
-
},
|
|
667
|
+
}, Ta = {
|
|
664
668
|
"launcher.open": "Jäta märkus...",
|
|
665
669
|
"tool.crop": "Põllukultuur",
|
|
666
670
|
"tool.resetCrop": "Lähtesta põllukultuur",
|
|
@@ -717,7 +721,7 @@ const wa = {
|
|
|
717
721
|
"diag.timezone": "Ajavöönd",
|
|
718
722
|
"diag.viewport": "Vaatenurk",
|
|
719
723
|
"diag.user": "Kasutaja"
|
|
720
|
-
},
|
|
724
|
+
}, Fa = {
|
|
721
725
|
"launcher.open": "Jätä muistiinpano...",
|
|
722
726
|
"tool.crop": "Viljely",
|
|
723
727
|
"tool.resetCrop": "Nollaa rajaus",
|
|
@@ -774,7 +778,7 @@ const wa = {
|
|
|
774
778
|
"diag.timezone": "Aikavyöhyke",
|
|
775
779
|
"diag.viewport": "Näyttöikkuna",
|
|
776
780
|
"diag.user": "Käyttäjä"
|
|
777
|
-
},
|
|
781
|
+
}, Oa = {
|
|
778
782
|
"launcher.open": "Laissez un message...",
|
|
779
783
|
"tool.crop": "Récolte",
|
|
780
784
|
"tool.resetCrop": "Réinitialiser la récolte",
|
|
@@ -831,7 +835,7 @@ const wa = {
|
|
|
831
835
|
"diag.timezone": "Fuseau horaire",
|
|
832
836
|
"diag.viewport": "Viewport",
|
|
833
837
|
"diag.user": "Utilisateur"
|
|
834
|
-
},
|
|
838
|
+
}, Da = {
|
|
835
839
|
"launcher.open": "एक नोट छोड़ें...",
|
|
836
840
|
"tool.crop": "क्रॉप",
|
|
837
841
|
"tool.resetCrop": "क्रॉप रीसेट करें",
|
|
@@ -888,7 +892,7 @@ const wa = {
|
|
|
888
892
|
"diag.timezone": "टाइमज़ोन",
|
|
889
893
|
"diag.viewport": "व्यूपोर्ट",
|
|
890
894
|
"diag.user": "यूज़र"
|
|
891
|
-
},
|
|
895
|
+
}, Ma = {
|
|
892
896
|
"launcher.open": "Ostavite poruku...",
|
|
893
897
|
"tool.crop": "Usjev",
|
|
894
898
|
"tool.resetCrop": "Resetirajte obrezivanje",
|
|
@@ -945,7 +949,7 @@ const wa = {
|
|
|
945
949
|
"diag.timezone": "Vremenska zona",
|
|
946
950
|
"diag.viewport": "Prikaznica",
|
|
947
951
|
"diag.user": "Korisnik"
|
|
948
|
-
},
|
|
952
|
+
}, Ia = {
|
|
949
953
|
"launcher.open": "Hagyjon egy jegyzetet...",
|
|
950
954
|
"tool.crop": "Termés",
|
|
951
955
|
"tool.resetCrop": "Vágás visszaállítása",
|
|
@@ -1002,7 +1006,7 @@ const wa = {
|
|
|
1002
1006
|
"diag.timezone": "Időzóna",
|
|
1003
1007
|
"diag.viewport": "Nézetablak",
|
|
1004
1008
|
"diag.user": "Felhasználó"
|
|
1005
|
-
},
|
|
1009
|
+
}, Va = {
|
|
1006
1010
|
"launcher.open": "Tinggalkan catatan...",
|
|
1007
1011
|
"tool.crop": "Panas",
|
|
1008
1012
|
"tool.resetCrop": "Setel ulang tanaman",
|
|
@@ -1059,7 +1063,7 @@ const wa = {
|
|
|
1059
1063
|
"diag.timezone": "Zona Waktu",
|
|
1060
1064
|
"diag.viewport": "Pintu pandang",
|
|
1061
1065
|
"diag.user": "Pengguna"
|
|
1062
|
-
},
|
|
1066
|
+
}, $a = {
|
|
1063
1067
|
"launcher.open": "Lascia una nota...",
|
|
1064
1068
|
"tool.crop": "Ritaglia",
|
|
1065
1069
|
"tool.resetCrop": "Reimposta il ritaglio",
|
|
@@ -1116,7 +1120,7 @@ const wa = {
|
|
|
1116
1120
|
"diag.timezone": "Fuso orario",
|
|
1117
1121
|
"diag.viewport": "Viewport",
|
|
1118
1122
|
"diag.user": "Utente"
|
|
1119
|
-
},
|
|
1123
|
+
}, Ba = {
|
|
1120
1124
|
"launcher.open": "メモを残してください...",
|
|
1121
1125
|
"tool.crop": "クロップ",
|
|
1122
1126
|
"tool.resetCrop": "トリミングをリセット",
|
|
@@ -1173,7 +1177,7 @@ const wa = {
|
|
|
1173
1177
|
"diag.timezone": "タイムゾーン",
|
|
1174
1178
|
"diag.viewport": "ビューポート",
|
|
1175
1179
|
"diag.user": "ユーザ"
|
|
1176
|
-
},
|
|
1180
|
+
}, Na = {
|
|
1177
1181
|
"launcher.open": "메모 남기기...",
|
|
1178
1182
|
"tool.crop": "크롭",
|
|
1179
1183
|
"tool.resetCrop": "크롭 재설정",
|
|
@@ -1230,7 +1234,7 @@ const wa = {
|
|
|
1230
1234
|
"diag.timezone": "타임존",
|
|
1231
1235
|
"diag.viewport": "뷰포트",
|
|
1232
1236
|
"diag.user": "사용자"
|
|
1233
|
-
},
|
|
1237
|
+
}, Ka = {
|
|
1234
1238
|
"launcher.open": "Palikite pastabą...",
|
|
1235
1239
|
"tool.crop": "Apkarpyti",
|
|
1236
1240
|
"tool.resetCrop": "Iš naujo nustatyti apkarpymą",
|
|
@@ -1287,7 +1291,7 @@ const wa = {
|
|
|
1287
1291
|
"diag.timezone": "Laiko juosta",
|
|
1288
1292
|
"diag.viewport": "Peržiūros sritis",
|
|
1289
1293
|
"diag.user": "Vartotojas"
|
|
1290
|
-
},
|
|
1294
|
+
}, Ha = {
|
|
1291
1295
|
"launcher.open": "Atstājiet piezīmi...",
|
|
1292
1296
|
"tool.crop": "Kultūraugs",
|
|
1293
1297
|
"tool.resetCrop": "Atiestatīt apgriešanu",
|
|
@@ -1344,7 +1348,7 @@ const wa = {
|
|
|
1344
1348
|
"diag.timezone": "Laika josla",
|
|
1345
1349
|
"diag.viewport": "Skatu laukums",
|
|
1346
1350
|
"diag.user": "Lietotājs"
|
|
1347
|
-
},
|
|
1351
|
+
}, Ga = {
|
|
1348
1352
|
"launcher.open": "Legg igjen et notat...",
|
|
1349
1353
|
"tool.crop": "Beskjæring",
|
|
1350
1354
|
"tool.resetCrop": "Tilbakestill beskjæring",
|
|
@@ -1401,7 +1405,7 @@ const wa = {
|
|
|
1401
1405
|
"diag.timezone": "Tidssone",
|
|
1402
1406
|
"diag.viewport": "Visningsport",
|
|
1403
1407
|
"diag.user": "Bruker"
|
|
1404
|
-
},
|
|
1408
|
+
}, qa = {
|
|
1405
1409
|
"launcher.open": "Laat een briefje achter...",
|
|
1406
1410
|
"tool.crop": "Gewas",
|
|
1407
1411
|
"tool.resetCrop": "Bijsnijden opnieuw instellen",
|
|
@@ -1458,7 +1462,7 @@ const wa = {
|
|
|
1458
1462
|
"diag.timezone": "Tijdzone",
|
|
1459
1463
|
"diag.viewport": "Viewport",
|
|
1460
1464
|
"diag.user": "Gebruiker"
|
|
1461
|
-
},
|
|
1465
|
+
}, _a = {
|
|
1462
1466
|
"launcher.open": "Zostaw notatkę...",
|
|
1463
1467
|
"tool.crop": "Uprawa",
|
|
1464
1468
|
"tool.resetCrop": "Resetuj kadrowanie",
|
|
@@ -1515,7 +1519,7 @@ const wa = {
|
|
|
1515
1519
|
"diag.timezone": "Strefa czasowa",
|
|
1516
1520
|
"diag.viewport": "rzutnia",
|
|
1517
1521
|
"diag.user": "Użytkownik"
|
|
1518
|
-
},
|
|
1522
|
+
}, Wa = {
|
|
1519
1523
|
"launcher.open": "Deixe uma nota...",
|
|
1520
1524
|
"tool.crop": "Colheita",
|
|
1521
1525
|
"tool.resetCrop": "Redefinir o corte",
|
|
@@ -1572,7 +1576,7 @@ const wa = {
|
|
|
1572
1576
|
"diag.timezone": "Fuso horário",
|
|
1573
1577
|
"diag.viewport": "Janela de visualização",
|
|
1574
1578
|
"diag.user": "Usuário"
|
|
1575
|
-
},
|
|
1579
|
+
}, Za = {
|
|
1576
1580
|
"launcher.open": "Deixe uma nota...",
|
|
1577
1581
|
"tool.crop": "Colheita",
|
|
1578
1582
|
"tool.resetCrop": "Redefinir o recorte",
|
|
@@ -1629,7 +1633,7 @@ const wa = {
|
|
|
1629
1633
|
"diag.timezone": "Fuso horário",
|
|
1630
1634
|
"diag.viewport": "Viewport",
|
|
1631
1635
|
"diag.user": "Utilizador"
|
|
1632
|
-
},
|
|
1636
|
+
}, Ja = {
|
|
1633
1637
|
"launcher.open": "Lăsați o notă...",
|
|
1634
1638
|
"tool.crop": "Cultură",
|
|
1635
1639
|
"tool.resetCrop": "Resetați recolta",
|
|
@@ -1686,7 +1690,7 @@ const wa = {
|
|
|
1686
1690
|
"diag.timezone": "Fus orar",
|
|
1687
1691
|
"diag.viewport": "Portul de vizualizare",
|
|
1688
1692
|
"diag.user": "Utilizator"
|
|
1689
|
-
},
|
|
1693
|
+
}, Ya = {
|
|
1690
1694
|
"launcher.open": "Оставьте заметку...",
|
|
1691
1695
|
"tool.crop": "урожай",
|
|
1692
1696
|
"tool.resetCrop": "Сбросить урожай",
|
|
@@ -1743,7 +1747,7 @@ const wa = {
|
|
|
1743
1747
|
"diag.timezone": "Часовой пояс",
|
|
1744
1748
|
"diag.viewport": "окно просмотра",
|
|
1745
1749
|
"diag.user": "Пользователь"
|
|
1746
|
-
},
|
|
1750
|
+
}, Xa = {
|
|
1747
1751
|
"launcher.open": "Zanechať poznámku...",
|
|
1748
1752
|
"tool.crop": "Oplodina",
|
|
1749
1753
|
"tool.resetCrop": "Obnoviť orezanie",
|
|
@@ -1800,7 +1804,7 @@ const wa = {
|
|
|
1800
1804
|
"diag.timezone": "Časové pásmo",
|
|
1801
1805
|
"diag.viewport": "Zobrazenie",
|
|
1802
1806
|
"diag.user": "Používateľ"
|
|
1803
|
-
},
|
|
1807
|
+
}, Qa = {
|
|
1804
1808
|
"launcher.open": "Pustite opombo...",
|
|
1805
1809
|
"tool.crop": "Pridelek",
|
|
1806
1810
|
"tool.resetCrop": "Ponastavi obrezovanje",
|
|
@@ -1857,7 +1861,7 @@ const wa = {
|
|
|
1857
1861
|
"diag.timezone": "Časovni pas",
|
|
1858
1862
|
"diag.viewport": "Razgledna plošča",
|
|
1859
1863
|
"diag.user": "Uporabnik"
|
|
1860
|
-
},
|
|
1864
|
+
}, eo = {
|
|
1861
1865
|
"launcher.open": "Ostavite belešku...",
|
|
1862
1866
|
"tool.crop": "Usjev",
|
|
1863
1867
|
"tool.resetCrop": "Resetujte usev",
|
|
@@ -1914,7 +1918,7 @@ const wa = {
|
|
|
1914
1918
|
"diag.timezone": "Vremenska zona",
|
|
1915
1919
|
"diag.viewport": "Viedport",
|
|
1916
1920
|
"diag.user": "Korisnik"
|
|
1917
|
-
},
|
|
1921
|
+
}, to = {
|
|
1918
1922
|
"launcher.open": "Lämna en anteckning...",
|
|
1919
1923
|
"tool.crop": "Skörda",
|
|
1920
1924
|
"tool.resetCrop": "Återställ beskärning",
|
|
@@ -1971,7 +1975,7 @@ const wa = {
|
|
|
1971
1975
|
"diag.timezone": "Tidszon",
|
|
1972
1976
|
"diag.viewport": "Viewport",
|
|
1973
1977
|
"diag.user": "Användare"
|
|
1974
|
-
},
|
|
1978
|
+
}, ao = {
|
|
1975
1979
|
"launcher.open": "Mag-iwan ng tala...",
|
|
1976
1980
|
"tool.crop": "Pag-ani",
|
|
1977
1981
|
"tool.resetCrop": "I-reset ang panani",
|
|
@@ -2028,7 +2032,7 @@ const wa = {
|
|
|
2028
2032
|
"diag.timezone": "Timesone",
|
|
2029
2033
|
"diag.viewport": "Viewport",
|
|
2030
2034
|
"diag.user": "Gumagamit"
|
|
2031
|
-
},
|
|
2035
|
+
}, oo = {
|
|
2032
2036
|
"launcher.open": "ทิ้งหมายเหตุ...",
|
|
2033
2037
|
"tool.crop": "พืชผล",
|
|
2034
2038
|
"tool.resetCrop": "รีเซ็ตการตัดพืช",
|
|
@@ -2085,7 +2089,7 @@ const wa = {
|
|
|
2085
2089
|
"diag.timezone": "เขตเวลา",
|
|
2086
2090
|
"diag.viewport": "พอร์ตมุมมอง",
|
|
2087
2091
|
"diag.user": "ผู้ใช้"
|
|
2088
|
-
},
|
|
2092
|
+
}, io = {
|
|
2089
2093
|
"launcher.open": "Bir not bırakın...",
|
|
2090
2094
|
"tool.crop": "Mahsul",
|
|
2091
2095
|
"tool.resetCrop": "Kırpmayı sıfırla",
|
|
@@ -2142,7 +2146,7 @@ const wa = {
|
|
|
2142
2146
|
"diag.timezone": "Saat dilimi",
|
|
2143
2147
|
"diag.viewport": "Görünüm noktası",
|
|
2144
2148
|
"diag.user": "Kullanıcı"
|
|
2145
|
-
},
|
|
2149
|
+
}, so = {
|
|
2146
2150
|
"launcher.open": "Залиште записку...",
|
|
2147
2151
|
"tool.crop": "Урожай",
|
|
2148
2152
|
"tool.resetCrop": "Скинути обрізку",
|
|
@@ -2199,7 +2203,7 @@ const wa = {
|
|
|
2199
2203
|
"diag.timezone": "Часовий пояс",
|
|
2200
2204
|
"diag.viewport": "Вигляд",
|
|
2201
2205
|
"diag.user": "Користувач"
|
|
2202
|
-
},
|
|
2206
|
+
}, ro = {
|
|
2203
2207
|
"launcher.open": "Để lại một ghi chú...",
|
|
2204
2208
|
"tool.crop": "Cây trồng",
|
|
2205
2209
|
"tool.resetCrop": "Đặt lại cây trồng",
|
|
@@ -2256,7 +2260,7 @@ const wa = {
|
|
|
2256
2260
|
"diag.timezone": "Múi giờ",
|
|
2257
2261
|
"diag.viewport": "Cổng quan sát",
|
|
2258
2262
|
"diag.user": "Người dùng"
|
|
2259
|
-
},
|
|
2263
|
+
}, no = {
|
|
2260
2264
|
"launcher.open": "留个笔记...",
|
|
2261
2265
|
"tool.crop": "作物",
|
|
2262
2266
|
"tool.resetCrop": "重置裁剪",
|
|
@@ -2313,7 +2317,7 @@ const wa = {
|
|
|
2313
2317
|
"diag.timezone": "时区",
|
|
2314
2318
|
"diag.viewport": "视口",
|
|
2315
2319
|
"diag.user": "用户"
|
|
2316
|
-
},
|
|
2320
|
+
}, lo = {
|
|
2317
2321
|
"launcher.open": "留下筆記...",
|
|
2318
2322
|
"tool.crop": "作物",
|
|
2319
2323
|
"tool.resetCrop": "重設裁切",
|
|
@@ -2371,57 +2375,57 @@ const wa = {
|
|
|
2371
2375
|
"diag.viewport": "視埠",
|
|
2372
2376
|
"diag.user": "使用者"
|
|
2373
2377
|
};
|
|
2374
|
-
h("en-US",
|
|
2375
|
-
h("bg",
|
|
2376
|
-
h("ca",
|
|
2377
|
-
h("cs",
|
|
2378
|
-
h("da",
|
|
2379
|
-
h("de",
|
|
2380
|
-
h("el",
|
|
2381
|
-
h("en-GB",
|
|
2382
|
-
h("es",
|
|
2383
|
-
h("es-419",
|
|
2384
|
-
h("et",
|
|
2385
|
-
h("fi",
|
|
2386
|
-
h("fr",
|
|
2387
|
-
h("hi",
|
|
2388
|
-
h("hr",
|
|
2389
|
-
h("hu",
|
|
2390
|
-
h("id",
|
|
2391
|
-
h("it",
|
|
2392
|
-
h("ja",
|
|
2393
|
-
h("ko",
|
|
2394
|
-
h("lt",
|
|
2395
|
-
h("lv",
|
|
2396
|
-
h("nb",
|
|
2397
|
-
h("nl",
|
|
2398
|
-
h("pl",
|
|
2399
|
-
h("pt-BR",
|
|
2400
|
-
h("pt-PT",
|
|
2401
|
-
h("ro",
|
|
2402
|
-
h("ru",
|
|
2403
|
-
h("sk",
|
|
2404
|
-
h("sl",
|
|
2405
|
-
h("sr",
|
|
2406
|
-
h("sv",
|
|
2407
|
-
h("fil",
|
|
2408
|
-
h("th",
|
|
2409
|
-
h("tr",
|
|
2410
|
-
h("uk",
|
|
2411
|
-
h("vi",
|
|
2412
|
-
h("zh-CN",
|
|
2413
|
-
h("zh-TW",
|
|
2414
|
-
function
|
|
2378
|
+
h("en-US", he);
|
|
2379
|
+
h("bg", Ca);
|
|
2380
|
+
h("ca", za);
|
|
2381
|
+
h("cs", Ea);
|
|
2382
|
+
h("da", ja);
|
|
2383
|
+
h("de", Ra);
|
|
2384
|
+
h("el", Pa);
|
|
2385
|
+
h("en-GB", xa);
|
|
2386
|
+
h("es", La);
|
|
2387
|
+
h("es-419", Ua);
|
|
2388
|
+
h("et", Ta);
|
|
2389
|
+
h("fi", Fa);
|
|
2390
|
+
h("fr", Oa);
|
|
2391
|
+
h("hi", Da);
|
|
2392
|
+
h("hr", Ma);
|
|
2393
|
+
h("hu", Ia);
|
|
2394
|
+
h("id", Va);
|
|
2395
|
+
h("it", $a);
|
|
2396
|
+
h("ja", Ba);
|
|
2397
|
+
h("ko", Na);
|
|
2398
|
+
h("lt", Ka);
|
|
2399
|
+
h("lv", Ha);
|
|
2400
|
+
h("nb", Ga);
|
|
2401
|
+
h("nl", qa);
|
|
2402
|
+
h("pl", _a);
|
|
2403
|
+
h("pt-BR", Wa);
|
|
2404
|
+
h("pt-PT", Za);
|
|
2405
|
+
h("ro", Ja);
|
|
2406
|
+
h("ru", Ya);
|
|
2407
|
+
h("sk", Xa);
|
|
2408
|
+
h("sl", Qa);
|
|
2409
|
+
h("sr", eo);
|
|
2410
|
+
h("sv", to);
|
|
2411
|
+
h("fil", ao);
|
|
2412
|
+
h("th", oo);
|
|
2413
|
+
h("tr", io);
|
|
2414
|
+
h("uk", so);
|
|
2415
|
+
h("vi", ro);
|
|
2416
|
+
h("zh-CN", no);
|
|
2417
|
+
h("zh-TW", lo);
|
|
2418
|
+
function uo(e, t) {
|
|
2415
2419
|
if (e.match(/^[a-z]+:\/\//i))
|
|
2416
2420
|
return e;
|
|
2417
2421
|
if (e.match(/^\/\//))
|
|
2418
2422
|
return window.location.protocol + e;
|
|
2419
2423
|
if (e.match(/^[a-z]+:/i))
|
|
2420
2424
|
return e;
|
|
2421
|
-
const a = document.implementation.createHTMLDocument(), o = a.createElement("base"),
|
|
2422
|
-
return a.head.appendChild(o), a.body.appendChild(
|
|
2425
|
+
const a = document.implementation.createHTMLDocument(), o = a.createElement("base"), s = a.createElement("a");
|
|
2426
|
+
return a.head.appendChild(o), a.body.appendChild(s), t && (o.href = t), s.href = e, s.href;
|
|
2423
2427
|
}
|
|
2424
|
-
const
|
|
2428
|
+
const co = /* @__PURE__ */ (() => {
|
|
2425
2429
|
let e = 0;
|
|
2426
2430
|
const t = () => (
|
|
2427
2431
|
// eslint-disable-next-line no-bitwise
|
|
@@ -2429,33 +2433,33 @@ const no = /* @__PURE__ */ (() => {
|
|
|
2429
2433
|
);
|
|
2430
2434
|
return () => (e += 1, `u${t()}${e}`);
|
|
2431
2435
|
})();
|
|
2432
|
-
function
|
|
2436
|
+
function W(e) {
|
|
2433
2437
|
const t = [];
|
|
2434
2438
|
for (let a = 0, o = e.length; a < o; a++)
|
|
2435
2439
|
t.push(e[a]);
|
|
2436
2440
|
return t;
|
|
2437
2441
|
}
|
|
2438
2442
|
let te = null;
|
|
2439
|
-
function
|
|
2440
|
-
return te || (e.includeStyleProperties ? (te = e.includeStyleProperties, te) : (te =
|
|
2443
|
+
function Pt(e = {}) {
|
|
2444
|
+
return te || (e.includeStyleProperties ? (te = e.includeStyleProperties, te) : (te = W(window.getComputedStyle(document.documentElement)), te));
|
|
2441
2445
|
}
|
|
2442
|
-
function
|
|
2446
|
+
function ve(e, t) {
|
|
2443
2447
|
const o = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
2444
2448
|
return o ? parseFloat(o.replace("px", "")) : 0;
|
|
2445
2449
|
}
|
|
2446
|
-
function
|
|
2447
|
-
const t =
|
|
2450
|
+
function po(e) {
|
|
2451
|
+
const t = ve(e, "border-left-width"), a = ve(e, "border-right-width");
|
|
2448
2452
|
return e.clientWidth + t + a;
|
|
2449
2453
|
}
|
|
2450
|
-
function
|
|
2451
|
-
const t =
|
|
2454
|
+
function go(e) {
|
|
2455
|
+
const t = ve(e, "border-top-width"), a = ve(e, "border-bottom-width");
|
|
2452
2456
|
return e.clientHeight + t + a;
|
|
2453
2457
|
}
|
|
2454
|
-
function
|
|
2455
|
-
const a = t.width ||
|
|
2458
|
+
function xt(e, t = {}) {
|
|
2459
|
+
const a = t.width || po(e), o = t.height || go(e);
|
|
2456
2460
|
return { width: a, height: o };
|
|
2457
2461
|
}
|
|
2458
|
-
function
|
|
2462
|
+
function mo() {
|
|
2459
2463
|
let e, t;
|
|
2460
2464
|
try {
|
|
2461
2465
|
t = process;
|
|
@@ -2464,11 +2468,11 @@ function co() {
|
|
|
2464
2468
|
const a = t && t.env ? t.env.devicePixelRatio : null;
|
|
2465
2469
|
return a && (e = parseInt(a, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
|
|
2466
2470
|
}
|
|
2467
|
-
const
|
|
2468
|
-
function
|
|
2469
|
-
(e.width >
|
|
2471
|
+
const U = 16384;
|
|
2472
|
+
function ho(e) {
|
|
2473
|
+
(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
2474
|
}
|
|
2471
|
-
function
|
|
2475
|
+
function ke(e) {
|
|
2472
2476
|
return new Promise((t, a) => {
|
|
2473
2477
|
const o = new Image();
|
|
2474
2478
|
o.onload = () => {
|
|
@@ -2478,52 +2482,52 @@ function ve(e) {
|
|
|
2478
2482
|
}, o.onerror = a, o.crossOrigin = "anonymous", o.decoding = "async", o.src = e;
|
|
2479
2483
|
});
|
|
2480
2484
|
}
|
|
2481
|
-
async function
|
|
2485
|
+
async function fo(e) {
|
|
2482
2486
|
return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((t) => `data:image/svg+xml;charset=utf-8,${t}`);
|
|
2483
2487
|
}
|
|
2484
|
-
async function
|
|
2485
|
-
const o = "http://www.w3.org/2000/svg",
|
|
2486
|
-
return
|
|
2488
|
+
async function yo(e, t, a) {
|
|
2489
|
+
const o = "http://www.w3.org/2000/svg", s = document.createElementNS(o, "svg"), i = document.createElementNS(o, "foreignObject");
|
|
2490
|
+
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), fo(s);
|
|
2487
2491
|
}
|
|
2488
|
-
const
|
|
2492
|
+
const L = (e, t) => {
|
|
2489
2493
|
if (e instanceof t)
|
|
2490
2494
|
return !0;
|
|
2491
2495
|
const a = Object.getPrototypeOf(e);
|
|
2492
|
-
return a === null ? !1 : a.constructor.name === t.name ||
|
|
2496
|
+
return a === null ? !1 : a.constructor.name === t.name || L(a, t);
|
|
2493
2497
|
};
|
|
2494
|
-
function
|
|
2498
|
+
function vo(e) {
|
|
2495
2499
|
const t = e.getPropertyValue("content");
|
|
2496
2500
|
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
2497
2501
|
}
|
|
2498
|
-
function
|
|
2499
|
-
return
|
|
2500
|
-
const o = e.getPropertyValue(a),
|
|
2501
|
-
return `${a}: ${o}${
|
|
2502
|
+
function ko(e, t) {
|
|
2503
|
+
return Pt(t).map((a) => {
|
|
2504
|
+
const o = e.getPropertyValue(a), s = e.getPropertyPriority(a);
|
|
2505
|
+
return `${a}: ${o}${s ? " !important" : ""};`;
|
|
2502
2506
|
}).join(" ");
|
|
2503
2507
|
}
|
|
2504
|
-
function
|
|
2505
|
-
const
|
|
2506
|
-
return document.createTextNode(`${
|
|
2508
|
+
function bo(e, t, a, o) {
|
|
2509
|
+
const s = `.${e}:${t}`, i = a.cssText ? vo(a) : ko(a, o);
|
|
2510
|
+
return document.createTextNode(`${s}{${i}}`);
|
|
2507
2511
|
}
|
|
2508
|
-
function
|
|
2509
|
-
const
|
|
2512
|
+
function ot(e, t, a, o) {
|
|
2513
|
+
const s = window.getComputedStyle(e, a), i = s.getPropertyValue("content");
|
|
2510
2514
|
if (i === "" || i === "none")
|
|
2511
2515
|
return;
|
|
2512
|
-
const
|
|
2516
|
+
const r = co();
|
|
2513
2517
|
try {
|
|
2514
|
-
t.className = `${t.className} ${
|
|
2518
|
+
t.className = `${t.className} ${r}`;
|
|
2515
2519
|
} catch {
|
|
2516
2520
|
return;
|
|
2517
2521
|
}
|
|
2518
2522
|
const l = document.createElement("style");
|
|
2519
|
-
l.appendChild(
|
|
2523
|
+
l.appendChild(bo(r, a, s, o)), t.appendChild(l);
|
|
2520
2524
|
}
|
|
2521
|
-
function
|
|
2522
|
-
|
|
2525
|
+
function wo(e, t, a) {
|
|
2526
|
+
ot(e, t, ":before", a), ot(e, t, ":after", a);
|
|
2523
2527
|
}
|
|
2524
|
-
const
|
|
2525
|
-
woff:
|
|
2526
|
-
woff2:
|
|
2528
|
+
const it = "application/font-woff", st = "image/jpeg", So = {
|
|
2529
|
+
woff: it,
|
|
2530
|
+
woff2: it,
|
|
2527
2531
|
ttf: "application/font-truetype",
|
|
2528
2532
|
eot: "application/vnd.ms-fontobject",
|
|
2529
2533
|
png: "image/png",
|
|
@@ -2534,75 +2538,75 @@ const rt = "application/font-woff", st = "image/jpeg", ko = {
|
|
|
2534
2538
|
svg: "image/svg+xml",
|
|
2535
2539
|
webp: "image/webp"
|
|
2536
2540
|
};
|
|
2537
|
-
function
|
|
2541
|
+
function Ao(e) {
|
|
2538
2542
|
const t = /\.([^./]*?)$/g.exec(e);
|
|
2539
2543
|
return t ? t[1] : "";
|
|
2540
2544
|
}
|
|
2541
|
-
function
|
|
2542
|
-
const t =
|
|
2543
|
-
return
|
|
2545
|
+
function _e(e) {
|
|
2546
|
+
const t = Ao(e).toLowerCase();
|
|
2547
|
+
return So[t] || "";
|
|
2544
2548
|
}
|
|
2545
|
-
function
|
|
2549
|
+
function Co(e) {
|
|
2546
2550
|
return e.split(/,/)[1];
|
|
2547
2551
|
}
|
|
2548
|
-
function
|
|
2552
|
+
function Be(e) {
|
|
2549
2553
|
return e.search(/^(data:)/) !== -1;
|
|
2550
2554
|
}
|
|
2551
|
-
function
|
|
2555
|
+
function zo(e, t) {
|
|
2552
2556
|
return `data:${t};base64,${e}`;
|
|
2553
2557
|
}
|
|
2554
|
-
async function
|
|
2558
|
+
async function Lt(e, t, a) {
|
|
2555
2559
|
const o = await fetch(e, t);
|
|
2556
2560
|
if (o.status === 404)
|
|
2557
2561
|
throw new Error(`Resource "${o.url}" not found`);
|
|
2558
|
-
const
|
|
2559
|
-
return new Promise((i,
|
|
2562
|
+
const s = await o.blob();
|
|
2563
|
+
return new Promise((i, r) => {
|
|
2560
2564
|
const l = new FileReader();
|
|
2561
|
-
l.onerror =
|
|
2565
|
+
l.onerror = r, l.onloadend = () => {
|
|
2562
2566
|
try {
|
|
2563
2567
|
i(a({ res: o, result: l.result }));
|
|
2564
2568
|
} catch (u) {
|
|
2565
|
-
|
|
2569
|
+
r(u);
|
|
2566
2570
|
}
|
|
2567
|
-
}, l.readAsDataURL(
|
|
2571
|
+
}, l.readAsDataURL(s);
|
|
2568
2572
|
});
|
|
2569
2573
|
}
|
|
2570
|
-
const
|
|
2571
|
-
function
|
|
2574
|
+
const Oe = {};
|
|
2575
|
+
function Eo(e, t, a) {
|
|
2572
2576
|
let o = e.replace(/\?.*/, "");
|
|
2573
2577
|
return a && (o = e), /ttf|otf|eot|woff2?/i.test(o) && (o = o.replace(/.*\//, "")), t ? `[${t}]${o}` : o;
|
|
2574
2578
|
}
|
|
2575
|
-
async function
|
|
2576
|
-
const o =
|
|
2577
|
-
if (
|
|
2578
|
-
return
|
|
2579
|
+
async function We(e, t, a) {
|
|
2580
|
+
const o = Eo(e, t, a.includeQueryParams);
|
|
2581
|
+
if (Oe[o] != null)
|
|
2582
|
+
return Oe[o];
|
|
2579
2583
|
a.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
2580
|
-
let
|
|
2584
|
+
let s;
|
|
2581
2585
|
try {
|
|
2582
|
-
const i = await
|
|
2583
|
-
|
|
2586
|
+
const i = await Lt(e, a.fetchRequestInit, ({ res: r, result: l }) => (t || (t = r.headers.get("Content-Type") || ""), Co(l)));
|
|
2587
|
+
s = zo(i, t);
|
|
2584
2588
|
} catch (i) {
|
|
2585
|
-
|
|
2586
|
-
let
|
|
2587
|
-
i && (
|
|
2589
|
+
s = a.imagePlaceholder || "";
|
|
2590
|
+
let r = `Failed to fetch resource: ${e}`;
|
|
2591
|
+
i && (r = typeof i == "string" ? i : i.message), r && console.warn(r);
|
|
2588
2592
|
}
|
|
2589
|
-
return
|
|
2593
|
+
return Oe[o] = s, s;
|
|
2590
2594
|
}
|
|
2591
|
-
async function
|
|
2595
|
+
async function jo(e) {
|
|
2592
2596
|
const t = e.toDataURL();
|
|
2593
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
2597
|
+
return t === "data:," ? e.cloneNode(!1) : ke(t);
|
|
2594
2598
|
}
|
|
2595
|
-
async function
|
|
2599
|
+
async function Ro(e, t) {
|
|
2596
2600
|
if (e.currentSrc) {
|
|
2597
|
-
const i = document.createElement("canvas"),
|
|
2598
|
-
i.width = e.clientWidth, i.height = e.clientHeight,
|
|
2601
|
+
const i = document.createElement("canvas"), r = i.getContext("2d");
|
|
2602
|
+
i.width = e.clientWidth, i.height = e.clientHeight, r == null || r.drawImage(e, 0, 0, i.width, i.height);
|
|
2599
2603
|
const l = i.toDataURL();
|
|
2600
|
-
return
|
|
2604
|
+
return ke(l);
|
|
2601
2605
|
}
|
|
2602
|
-
const a = e.poster, o =
|
|
2603
|
-
return
|
|
2606
|
+
const a = e.poster, o = _e(a), s = await We(a, o, t);
|
|
2607
|
+
return ke(s);
|
|
2604
2608
|
}
|
|
2605
|
-
async function
|
|
2609
|
+
async function Po(e, t) {
|
|
2606
2610
|
var a;
|
|
2607
2611
|
try {
|
|
2608
2612
|
if (!((a = e == null ? void 0 : e.contentDocument) === null || a === void 0) && a.body)
|
|
@@ -2611,42 +2615,42 @@ async function jo(e, t) {
|
|
|
2611
2615
|
}
|
|
2612
2616
|
return e.cloneNode(!1);
|
|
2613
2617
|
}
|
|
2614
|
-
async function
|
|
2615
|
-
return
|
|
2618
|
+
async function xo(e, t) {
|
|
2619
|
+
return L(e, HTMLCanvasElement) ? jo(e) : L(e, HTMLVideoElement) ? Ro(e, t) : L(e, HTMLIFrameElement) ? Po(e, t) : e.cloneNode(Ut(e));
|
|
2616
2620
|
}
|
|
2617
|
-
const
|
|
2618
|
-
async function
|
|
2619
|
-
var o,
|
|
2620
|
-
if (
|
|
2621
|
+
const Lo = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Ut = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
2622
|
+
async function Uo(e, t, a) {
|
|
2623
|
+
var o, s;
|
|
2624
|
+
if (Ut(t))
|
|
2621
2625
|
return t;
|
|
2622
2626
|
let i = [];
|
|
2623
|
-
return
|
|
2627
|
+
return Lo(e) && e.assignedNodes ? i = W(e.assignedNodes()) : L(e, HTMLIFrameElement) && (!((o = e.contentDocument) === null || o === void 0) && o.body) ? i = W(e.contentDocument.body.childNodes) : i = W(((s = e.shadowRoot) !== null && s !== void 0 ? s : e).childNodes), i.length === 0 || L(e, HTMLVideoElement) || await i.reduce((r, l) => r.then(() => je(l, a)).then((u) => {
|
|
2624
2628
|
u && t.appendChild(u);
|
|
2625
2629
|
}), Promise.resolve()), t;
|
|
2626
2630
|
}
|
|
2627
|
-
function
|
|
2631
|
+
function To(e, t, a) {
|
|
2628
2632
|
const o = t.style;
|
|
2629
2633
|
if (!o)
|
|
2630
2634
|
return;
|
|
2631
|
-
const
|
|
2632
|
-
|
|
2633
|
-
let
|
|
2634
|
-
i === "font-size" &&
|
|
2635
|
+
const s = window.getComputedStyle(e);
|
|
2636
|
+
s.cssText ? (o.cssText = s.cssText, o.transformOrigin = s.transformOrigin) : Pt(a).forEach((i) => {
|
|
2637
|
+
let r = s.getPropertyValue(i);
|
|
2638
|
+
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
2639
|
});
|
|
2636
2640
|
}
|
|
2637
|
-
function
|
|
2638
|
-
|
|
2641
|
+
function Fo(e, t) {
|
|
2642
|
+
L(e, HTMLTextAreaElement) && (t.innerHTML = e.value), L(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
2639
2643
|
}
|
|
2640
|
-
function
|
|
2641
|
-
if (
|
|
2642
|
-
const o = Array.from(t.children).find((
|
|
2644
|
+
function Oo(e, t) {
|
|
2645
|
+
if (L(e, HTMLSelectElement)) {
|
|
2646
|
+
const o = Array.from(t.children).find((s) => e.value === s.getAttribute("value"));
|
|
2643
2647
|
o && o.setAttribute("selected", "");
|
|
2644
2648
|
}
|
|
2645
2649
|
}
|
|
2646
|
-
function
|
|
2647
|
-
return
|
|
2650
|
+
function Do(e, t, a) {
|
|
2651
|
+
return L(t, Element) && (To(e, t, a), wo(e, t, a), Fo(e, t), Oo(e, t)), t;
|
|
2648
2652
|
}
|
|
2649
|
-
async function
|
|
2653
|
+
async function Mo(e, t) {
|
|
2650
2654
|
const a = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
2651
2655
|
if (a.length === 0)
|
|
2652
2656
|
return e;
|
|
@@ -2654,137 +2658,137 @@ async function Fo(e, t) {
|
|
|
2654
2658
|
for (let i = 0; i < a.length; i++) {
|
|
2655
2659
|
const l = a[i].getAttribute("xlink:href");
|
|
2656
2660
|
if (l) {
|
|
2657
|
-
const u = e.querySelector(l),
|
|
2658
|
-
!u &&
|
|
2661
|
+
const u = e.querySelector(l), c = document.querySelector(l);
|
|
2662
|
+
!u && c && !o[l] && (o[l] = await je(c, t, !0));
|
|
2659
2663
|
}
|
|
2660
2664
|
}
|
|
2661
|
-
const
|
|
2662
|
-
if (
|
|
2663
|
-
const i = "http://www.w3.org/1999/xhtml",
|
|
2664
|
-
|
|
2665
|
+
const s = Object.values(o);
|
|
2666
|
+
if (s.length) {
|
|
2667
|
+
const i = "http://www.w3.org/1999/xhtml", r = document.createElementNS(i, "svg");
|
|
2668
|
+
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
2669
|
const l = document.createElementNS(i, "defs");
|
|
2666
|
-
|
|
2667
|
-
for (let u = 0; u <
|
|
2668
|
-
l.appendChild(
|
|
2669
|
-
e.appendChild(
|
|
2670
|
+
r.appendChild(l);
|
|
2671
|
+
for (let u = 0; u < s.length; u++)
|
|
2672
|
+
l.appendChild(s[u]);
|
|
2673
|
+
e.appendChild(r);
|
|
2670
2674
|
}
|
|
2671
2675
|
return e;
|
|
2672
2676
|
}
|
|
2673
2677
|
async function je(e, t, a) {
|
|
2674
|
-
return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) =>
|
|
2678
|
+
return !a && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((o) => xo(o, t)).then((o) => Uo(e, o, t)).then((o) => Do(e, o, t)).then((o) => Mo(o, t));
|
|
2675
2679
|
}
|
|
2676
|
-
const
|
|
2677
|
-
function
|
|
2680
|
+
const Tt = /url\((['"]?)([^'"]+?)\1\)/g, Io = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Vo = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
2681
|
+
function $o(e) {
|
|
2678
2682
|
const t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
2679
2683
|
return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
2680
2684
|
}
|
|
2681
|
-
function
|
|
2685
|
+
function Bo(e) {
|
|
2682
2686
|
const t = [];
|
|
2683
|
-
return e.replace(
|
|
2687
|
+
return e.replace(Tt, (a, o, s) => (t.push(s), a)), t.filter((a) => !Be(a));
|
|
2684
2688
|
}
|
|
2685
|
-
async function
|
|
2689
|
+
async function No(e, t, a, o, s) {
|
|
2686
2690
|
try {
|
|
2687
|
-
const i = a ?
|
|
2691
|
+
const i = a ? uo(t, a) : t, r = _e(t);
|
|
2688
2692
|
let l;
|
|
2689
|
-
return
|
|
2693
|
+
return s || (l = await We(i, r, o)), e.replace($o(t), `$1${l}$3`);
|
|
2690
2694
|
} catch {
|
|
2691
2695
|
}
|
|
2692
2696
|
return e;
|
|
2693
2697
|
}
|
|
2694
|
-
function
|
|
2695
|
-
return t ? e.replace(
|
|
2698
|
+
function Ko(e, { preferredFontFormat: t }) {
|
|
2699
|
+
return t ? e.replace(Vo, (a) => {
|
|
2696
2700
|
for (; ; ) {
|
|
2697
|
-
const [o, ,
|
|
2698
|
-
if (!
|
|
2701
|
+
const [o, , s] = Io.exec(a) || [];
|
|
2702
|
+
if (!s)
|
|
2699
2703
|
return "";
|
|
2700
|
-
if (
|
|
2704
|
+
if (s === t)
|
|
2701
2705
|
return `src: ${o};`;
|
|
2702
2706
|
}
|
|
2703
2707
|
}) : e;
|
|
2704
2708
|
}
|
|
2705
|
-
function
|
|
2706
|
-
return e.search(
|
|
2709
|
+
function Ft(e) {
|
|
2710
|
+
return e.search(Tt) !== -1;
|
|
2707
2711
|
}
|
|
2708
|
-
async function
|
|
2709
|
-
if (!
|
|
2712
|
+
async function Ot(e, t, a) {
|
|
2713
|
+
if (!Ft(e))
|
|
2710
2714
|
return e;
|
|
2711
|
-
const o =
|
|
2712
|
-
return
|
|
2715
|
+
const o = Ko(e, a);
|
|
2716
|
+
return Bo(o).reduce((i, r) => i.then((l) => No(l, r, t, a)), Promise.resolve(o));
|
|
2713
2717
|
}
|
|
2714
2718
|
async function ae(e, t, a) {
|
|
2715
2719
|
var o;
|
|
2716
|
-
const
|
|
2717
|
-
if (
|
|
2718
|
-
const i = await
|
|
2720
|
+
const s = (o = t.style) === null || o === void 0 ? void 0 : o.getPropertyValue(e);
|
|
2721
|
+
if (s) {
|
|
2722
|
+
const i = await Ot(s, null, a);
|
|
2719
2723
|
return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
|
|
2720
2724
|
}
|
|
2721
2725
|
return !1;
|
|
2722
2726
|
}
|
|
2723
|
-
async function
|
|
2727
|
+
async function Ho(e, t) {
|
|
2724
2728
|
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);
|
|
2725
2729
|
}
|
|
2726
|
-
async function
|
|
2727
|
-
const a =
|
|
2728
|
-
if (!(a &&
|
|
2730
|
+
async function Go(e, t) {
|
|
2731
|
+
const a = L(e, HTMLImageElement);
|
|
2732
|
+
if (!(a && !Be(e.src)) && !(L(e, SVGImageElement) && !Be(e.href.baseVal)))
|
|
2729
2733
|
return;
|
|
2730
|
-
const o = a ? e.src : e.href.baseVal,
|
|
2731
|
-
await new Promise((i,
|
|
2734
|
+
const o = a ? e.src : e.href.baseVal, s = await We(o, _e(o), t);
|
|
2735
|
+
await new Promise((i, r) => {
|
|
2732
2736
|
e.onload = i, e.onerror = t.onImageErrorHandler ? (...u) => {
|
|
2733
2737
|
try {
|
|
2734
2738
|
i(t.onImageErrorHandler(...u));
|
|
2735
|
-
} catch (
|
|
2736
|
-
|
|
2739
|
+
} catch (c) {
|
|
2740
|
+
r(c);
|
|
2737
2741
|
}
|
|
2738
|
-
} :
|
|
2742
|
+
} : r;
|
|
2739
2743
|
const l = e;
|
|
2740
|
-
l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src =
|
|
2744
|
+
l.decode && (l.decode = i), l.loading === "lazy" && (l.loading = "eager"), a ? (e.srcset = "", e.src = s) : e.href.baseVal = s;
|
|
2741
2745
|
});
|
|
2742
2746
|
}
|
|
2743
|
-
async function
|
|
2744
|
-
const o =
|
|
2747
|
+
async function qo(e, t) {
|
|
2748
|
+
const o = W(e.childNodes).map((s) => Dt(s, t));
|
|
2745
2749
|
await Promise.all(o).then(() => e);
|
|
2746
2750
|
}
|
|
2747
|
-
async function
|
|
2748
|
-
|
|
2751
|
+
async function Dt(e, t) {
|
|
2752
|
+
L(e, Element) && (await Ho(e, t), await Go(e, t), await qo(e, t));
|
|
2749
2753
|
}
|
|
2750
|
-
function
|
|
2754
|
+
function _o(e, t) {
|
|
2751
2755
|
const { style: a } = e;
|
|
2752
2756
|
t.backgroundColor && (a.backgroundColor = t.backgroundColor), t.width && (a.width = `${t.width}px`), t.height && (a.height = `${t.height}px`);
|
|
2753
2757
|
const o = t.style;
|
|
2754
|
-
return o != null && Object.keys(o).forEach((
|
|
2755
|
-
a[
|
|
2758
|
+
return o != null && Object.keys(o).forEach((s) => {
|
|
2759
|
+
a[s] = o[s];
|
|
2756
2760
|
}), e;
|
|
2757
2761
|
}
|
|
2758
|
-
const
|
|
2759
|
-
async function
|
|
2760
|
-
let t =
|
|
2762
|
+
const rt = {};
|
|
2763
|
+
async function nt(e) {
|
|
2764
|
+
let t = rt[e];
|
|
2761
2765
|
if (t != null)
|
|
2762
2766
|
return t;
|
|
2763
2767
|
const o = await (await fetch(e)).text();
|
|
2764
|
-
return t = { url: e, cssText: o },
|
|
2768
|
+
return t = { url: e, cssText: o }, rt[e] = t, t;
|
|
2765
2769
|
}
|
|
2766
|
-
async function
|
|
2770
|
+
async function lt(e, t) {
|
|
2767
2771
|
let a = e.cssText;
|
|
2768
|
-
const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (
|
|
2769
|
-
let l =
|
|
2770
|
-
return l.startsWith("https://") || (l = new URL(l, e.url).href),
|
|
2772
|
+
const o = /url\(["']?([^"')]+)["']?\)/g, i = (a.match(/url\([^)]+\)/g) || []).map(async (r) => {
|
|
2773
|
+
let l = r.replace(o, "$1");
|
|
2774
|
+
return l.startsWith("https://") || (l = new URL(l, e.url).href), Lt(l, t.fetchRequestInit, ({ result: u }) => (a = a.replace(r, `url(${u})`), [r, u]));
|
|
2771
2775
|
});
|
|
2772
2776
|
return Promise.all(i).then(() => a);
|
|
2773
2777
|
}
|
|
2774
|
-
function
|
|
2778
|
+
function ut(e) {
|
|
2775
2779
|
if (e == null)
|
|
2776
2780
|
return [];
|
|
2777
2781
|
const t = [], a = /(\/\*[\s\S]*?\*\/)/gi;
|
|
2778
2782
|
let o = e.replace(a, "");
|
|
2779
|
-
const
|
|
2783
|
+
const s = new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
2780
2784
|
for (; ; ) {
|
|
2781
|
-
const u =
|
|
2785
|
+
const u = s.exec(o);
|
|
2782
2786
|
if (u === null)
|
|
2783
2787
|
break;
|
|
2784
2788
|
t.push(u[0]);
|
|
2785
2789
|
}
|
|
2786
|
-
o = o.replace(
|
|
2787
|
-
const i = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,
|
|
2790
|
+
o = o.replace(s, "");
|
|
2791
|
+
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
2792
|
for (; ; ) {
|
|
2789
2793
|
let u = i.exec(o);
|
|
2790
2794
|
if (u === null) {
|
|
@@ -2797,102 +2801,102 @@ function dt(e) {
|
|
|
2797
2801
|
}
|
|
2798
2802
|
return t;
|
|
2799
2803
|
}
|
|
2800
|
-
async function
|
|
2804
|
+
async function Wo(e, t) {
|
|
2801
2805
|
const a = [], o = [];
|
|
2802
|
-
return e.forEach((
|
|
2803
|
-
if ("cssRules" in
|
|
2806
|
+
return e.forEach((s) => {
|
|
2807
|
+
if ("cssRules" in s)
|
|
2804
2808
|
try {
|
|
2805
|
-
|
|
2809
|
+
W(s.cssRules || []).forEach((i, r) => {
|
|
2806
2810
|
if (i.type === CSSRule.IMPORT_RULE) {
|
|
2807
|
-
let l =
|
|
2808
|
-
const u = i.href,
|
|
2811
|
+
let l = r + 1;
|
|
2812
|
+
const u = i.href, c = nt(u).then((g) => lt(g, t)).then((g) => ut(g).forEach((v) => {
|
|
2809
2813
|
try {
|
|
2810
|
-
|
|
2811
|
-
} catch (
|
|
2814
|
+
s.insertRule(v, v.startsWith("@import") ? l += 1 : s.cssRules.length);
|
|
2815
|
+
} catch (k) {
|
|
2812
2816
|
console.error("Error inserting rule from remote css", {
|
|
2813
|
-
rule:
|
|
2814
|
-
error:
|
|
2817
|
+
rule: v,
|
|
2818
|
+
error: k
|
|
2815
2819
|
});
|
|
2816
2820
|
}
|
|
2817
|
-
})).catch((
|
|
2818
|
-
console.error("Error loading remote css",
|
|
2821
|
+
})).catch((g) => {
|
|
2822
|
+
console.error("Error loading remote css", g.toString());
|
|
2819
2823
|
});
|
|
2820
|
-
o.push(
|
|
2824
|
+
o.push(c);
|
|
2821
2825
|
}
|
|
2822
2826
|
});
|
|
2823
2827
|
} catch (i) {
|
|
2824
|
-
const
|
|
2825
|
-
|
|
2826
|
-
|
|
2828
|
+
const r = e.find((l) => l.href == null) || document.styleSheets[0];
|
|
2829
|
+
s.href != null && o.push(nt(s.href).then((l) => lt(l, t)).then((l) => ut(l).forEach((u) => {
|
|
2830
|
+
r.insertRule(u, r.cssRules.length);
|
|
2827
2831
|
})).catch((l) => {
|
|
2828
2832
|
console.error("Error loading remote stylesheet", l);
|
|
2829
2833
|
})), console.error("Error inlining remote css file", i);
|
|
2830
2834
|
}
|
|
2831
|
-
}), Promise.all(o).then(() => (e.forEach((
|
|
2832
|
-
if ("cssRules" in
|
|
2835
|
+
}), Promise.all(o).then(() => (e.forEach((s) => {
|
|
2836
|
+
if ("cssRules" in s)
|
|
2833
2837
|
try {
|
|
2834
|
-
|
|
2838
|
+
W(s.cssRules || []).forEach((i) => {
|
|
2835
2839
|
a.push(i);
|
|
2836
2840
|
});
|
|
2837
2841
|
} catch (i) {
|
|
2838
|
-
console.error(`Error while reading CSS rules from ${
|
|
2842
|
+
console.error(`Error while reading CSS rules from ${s.href}`, i);
|
|
2839
2843
|
}
|
|
2840
2844
|
}), a));
|
|
2841
2845
|
}
|
|
2842
|
-
function
|
|
2843
|
-
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) =>
|
|
2846
|
+
function Zo(e) {
|
|
2847
|
+
return e.filter((t) => t.type === CSSRule.FONT_FACE_RULE).filter((t) => Ft(t.style.getPropertyValue("src")));
|
|
2844
2848
|
}
|
|
2845
|
-
async function
|
|
2849
|
+
async function Jo(e, t) {
|
|
2846
2850
|
if (e.ownerDocument == null)
|
|
2847
2851
|
throw new Error("Provided element is not within a Document");
|
|
2848
|
-
const a =
|
|
2849
|
-
return
|
|
2852
|
+
const a = W(e.ownerDocument.styleSheets), o = await Wo(a, t);
|
|
2853
|
+
return Zo(o);
|
|
2850
2854
|
}
|
|
2851
|
-
function
|
|
2855
|
+
function Mt(e) {
|
|
2852
2856
|
return e.trim().replace(/["']/g, "");
|
|
2853
2857
|
}
|
|
2854
|
-
function
|
|
2858
|
+
function Yo(e) {
|
|
2855
2859
|
const t = /* @__PURE__ */ new Set();
|
|
2856
2860
|
function a(o) {
|
|
2857
2861
|
(o.style.fontFamily || getComputedStyle(o).fontFamily).split(",").forEach((i) => {
|
|
2858
|
-
t.add(
|
|
2862
|
+
t.add(Mt(i));
|
|
2859
2863
|
}), Array.from(o.children).forEach((i) => {
|
|
2860
2864
|
i instanceof HTMLElement && a(i);
|
|
2861
2865
|
});
|
|
2862
2866
|
}
|
|
2863
2867
|
return a(e), t;
|
|
2864
2868
|
}
|
|
2865
|
-
async function
|
|
2866
|
-
const a = await
|
|
2867
|
-
return (await Promise.all(a.filter((i) => o.has(
|
|
2868
|
-
const
|
|
2869
|
-
return
|
|
2869
|
+
async function Xo(e, t) {
|
|
2870
|
+
const a = await Jo(e, t), o = Yo(e);
|
|
2871
|
+
return (await Promise.all(a.filter((i) => o.has(Mt(i.style.fontFamily))).map((i) => {
|
|
2872
|
+
const r = i.parentStyleSheet ? i.parentStyleSheet.href : null;
|
|
2873
|
+
return Ot(i.cssText, r, t);
|
|
2870
2874
|
}))).join(`
|
|
2871
2875
|
`);
|
|
2872
2876
|
}
|
|
2873
|
-
async function
|
|
2874
|
-
const a = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await
|
|
2877
|
+
async function Qo(e, t) {
|
|
2878
|
+
const a = t.fontEmbedCSS != null ? t.fontEmbedCSS : t.skipFonts ? null : await Xo(e, t);
|
|
2875
2879
|
if (a) {
|
|
2876
|
-
const o = document.createElement("style"),
|
|
2877
|
-
o.appendChild(
|
|
2880
|
+
const o = document.createElement("style"), s = document.createTextNode(a);
|
|
2881
|
+
o.appendChild(s), e.firstChild ? e.insertBefore(o, e.firstChild) : e.appendChild(o);
|
|
2878
2882
|
}
|
|
2879
2883
|
}
|
|
2880
|
-
async function
|
|
2881
|
-
const { width: a, height: o } =
|
|
2882
|
-
return await
|
|
2884
|
+
async function ei(e, t = {}) {
|
|
2885
|
+
const { width: a, height: o } = xt(e, t), s = await je(e, t, !0);
|
|
2886
|
+
return await Qo(s, t), await Dt(s, t), _o(s, t), await yo(s, a, o);
|
|
2883
2887
|
}
|
|
2884
|
-
async function
|
|
2885
|
-
const { width: a, height: o } =
|
|
2886
|
-
return
|
|
2888
|
+
async function ti(e, t = {}) {
|
|
2889
|
+
const { width: a, height: o } = xt(e, t), s = await ei(e, t), i = await ke(s), r = document.createElement("canvas"), l = r.getContext("2d"), u = t.pixelRatio || mo(), c = t.canvasWidth || a, g = t.canvasHeight || o;
|
|
2890
|
+
return r.width = c * u, r.height = g * u, t.skipAutoScale || ho(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
2891
|
}
|
|
2888
2892
|
async function ct(e, t = {}) {
|
|
2889
|
-
return (await
|
|
2893
|
+
return (await ti(e, t)).toDataURL();
|
|
2890
2894
|
}
|
|
2891
|
-
const
|
|
2892
|
-
function
|
|
2893
|
-
return e instanceof Element && (e.hasAttribute(
|
|
2895
|
+
const be = "data-nf-capture-chrome", ai = "data-nf-canvas-snap", oi = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
|
2896
|
+
function It(e) {
|
|
2897
|
+
return e instanceof Element && (e.hasAttribute(be) || e.hasAttribute("data-nf-mask-cover") || e.id === "notefully");
|
|
2894
2898
|
}
|
|
2895
|
-
function
|
|
2899
|
+
function ii() {
|
|
2896
2900
|
const e = [];
|
|
2897
2901
|
return Array.from(document.styleSheets).forEach((t) => {
|
|
2898
2902
|
try {
|
|
@@ -2916,11 +2920,11 @@ function ti() {
|
|
|
2916
2920
|
});
|
|
2917
2921
|
};
|
|
2918
2922
|
}
|
|
2919
|
-
function
|
|
2923
|
+
function si() {
|
|
2920
2924
|
const e = [];
|
|
2921
2925
|
return document.querySelectorAll('input[type="password"], [data-notefully-mask]').forEach((a) => {
|
|
2922
|
-
const o = a.getBoundingClientRect(),
|
|
2923
|
-
|
|
2926
|
+
const o = a.getBoundingClientRect(), s = document.createElement("div");
|
|
2927
|
+
s.setAttribute("data-nf-mask-cover", "1"), s.style.cssText = [
|
|
2924
2928
|
"position:fixed",
|
|
2925
2929
|
`left:${o.left}px`,
|
|
2926
2930
|
`top:${o.top}px`,
|
|
@@ -2929,31 +2933,31 @@ function ai() {
|
|
|
2929
2933
|
"background:#111",
|
|
2930
2934
|
"z-index:2147483646",
|
|
2931
2935
|
"pointer-events:none"
|
|
2932
|
-
].join(";"), document.body.appendChild(
|
|
2936
|
+
].join(";"), document.body.appendChild(s), e.push(s);
|
|
2933
2937
|
}), () => e.forEach((a) => a.remove());
|
|
2934
2938
|
}
|
|
2935
|
-
function
|
|
2936
|
-
const e = document.querySelector(`[${
|
|
2939
|
+
function ri() {
|
|
2940
|
+
const e = document.querySelector(`[${be}]`);
|
|
2937
2941
|
if (e)
|
|
2938
2942
|
return e;
|
|
2939
2943
|
const t = document.createElement("div");
|
|
2940
|
-
return t.setAttribute(
|
|
2944
|
+
return t.setAttribute(be, "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
2945
|
}
|
|
2942
|
-
function
|
|
2943
|
-
document.querySelectorAll(`[${
|
|
2946
|
+
function ni() {
|
|
2947
|
+
document.querySelectorAll(`[${be}]`).forEach((e) => e.remove());
|
|
2944
2948
|
}
|
|
2945
|
-
function
|
|
2949
|
+
function Ne() {
|
|
2946
2950
|
return new Promise((e) => {
|
|
2947
2951
|
requestAnimationFrame(() => requestAnimationFrame(e));
|
|
2948
2952
|
});
|
|
2949
2953
|
}
|
|
2950
|
-
function
|
|
2954
|
+
function Z(e) {
|
|
2951
2955
|
if (typeof e != "string" || !e.startsWith("data:image/"))
|
|
2952
2956
|
return !1;
|
|
2953
2957
|
const t = e.indexOf(",");
|
|
2954
2958
|
return t > 0 && t < e.length - 1;
|
|
2955
2959
|
}
|
|
2956
|
-
function
|
|
2960
|
+
function li() {
|
|
2957
2961
|
const e = document.documentElement, t = document.body, a = Math.max(
|
|
2958
2962
|
window.innerWidth || 0,
|
|
2959
2963
|
(e == null ? void 0 : e.clientWidth) || 0,
|
|
@@ -2969,10 +2973,10 @@ function ri() {
|
|
|
2969
2973
|
);
|
|
2970
2974
|
return { width: a, height: o };
|
|
2971
2975
|
}
|
|
2972
|
-
async function
|
|
2976
|
+
async function ui() {
|
|
2973
2977
|
const e = [], t = Array.from(document.querySelectorAll("canvas"));
|
|
2974
2978
|
for (const a of t) {
|
|
2975
|
-
if (a.closest("#notefully") ||
|
|
2979
|
+
if (a.closest("#notefully") || It(a))
|
|
2976
2980
|
continue;
|
|
2977
2981
|
let o = "";
|
|
2978
2982
|
try {
|
|
@@ -2982,8 +2986,8 @@ async function si() {
|
|
|
2982
2986
|
}
|
|
2983
2987
|
if (!o || o === "data:,")
|
|
2984
2988
|
continue;
|
|
2985
|
-
const
|
|
2986
|
-
|
|
2989
|
+
const s = document.createElement("img"), i = getComputedStyle(a);
|
|
2990
|
+
s.setAttribute(ai, "1"), s.alt = "", s.src = o, s.className = a.className, s.style.cssText = a.style.cssText, s.style.width = i.width, s.style.height = i.height, s.style.maxWidth = i.maxWidth, s.style.maxHeight = i.maxHeight, s.style.objectFit = "fill", s.style.display = i.display === "inline" ? "inline-block" : i.display, a.replaceWith(s), e.push({ canvas: a, img: s });
|
|
2987
2991
|
}
|
|
2988
2992
|
return await Promise.all(e.map(({ img: a }) => {
|
|
2989
2993
|
if (!a.complete)
|
|
@@ -2999,37 +3003,37 @@ async function si() {
|
|
|
2999
3003
|
});
|
|
3000
3004
|
};
|
|
3001
3005
|
}
|
|
3002
|
-
async function
|
|
3006
|
+
async function ci(e) {
|
|
3003
3007
|
if (!e)
|
|
3004
3008
|
return null;
|
|
3005
3009
|
if (typeof e == "string")
|
|
3006
|
-
return
|
|
3010
|
+
return Z(e) ? e : null;
|
|
3007
3011
|
if (typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement)
|
|
3008
3012
|
try {
|
|
3009
3013
|
const t = e.toDataURL("image/png");
|
|
3010
|
-
return
|
|
3014
|
+
return Z(t) ? t : null;
|
|
3011
3015
|
} catch {
|
|
3012
3016
|
return null;
|
|
3013
3017
|
}
|
|
3014
3018
|
if (typeof Blob < "u" && e instanceof Blob) {
|
|
3015
|
-
const t = await
|
|
3016
|
-
return
|
|
3019
|
+
const t = await di(e);
|
|
3020
|
+
return Z(t) ? t : null;
|
|
3017
3021
|
}
|
|
3018
3022
|
return null;
|
|
3019
3023
|
}
|
|
3020
|
-
async function
|
|
3024
|
+
async function di(e) {
|
|
3021
3025
|
if (typeof FileReader == "function")
|
|
3022
|
-
return new Promise((o,
|
|
3026
|
+
return new Promise((o, s) => {
|
|
3023
3027
|
const i = new FileReader();
|
|
3024
|
-
i.onload = () => o(String(i.result || "")), i.onerror = () =>
|
|
3028
|
+
i.onload = () => o(String(i.result || "")), i.onerror = () => s(i.error || new Error("Could not read capture blob")), i.readAsDataURL(e);
|
|
3025
3029
|
});
|
|
3026
3030
|
const t = Buffer.from(await e.arrayBuffer());
|
|
3027
3031
|
return `data:${e.type || "application/octet-stream"};base64,${t.toString("base64")}`;
|
|
3028
3032
|
}
|
|
3029
|
-
async function
|
|
3033
|
+
async function pi() {
|
|
3030
3034
|
var t;
|
|
3031
3035
|
if (!((t = navigator.mediaDevices) != null && t.getDisplayMedia))
|
|
3032
|
-
throw new Error(
|
|
3036
|
+
throw new Error(p("status.screenUnsupported"));
|
|
3033
3037
|
const e = await navigator.mediaDevices.getDisplayMedia({
|
|
3034
3038
|
video: { displaySurface: "browser" },
|
|
3035
3039
|
audio: !1,
|
|
@@ -3040,74 +3044,74 @@ async function ui() {
|
|
|
3040
3044
|
const a = document.createElement("video");
|
|
3041
3045
|
a.muted = !0, a.playsInline = !0, a.srcObject = e, await a.play(), a.videoWidth || await new Promise((l) => {
|
|
3042
3046
|
a.onloadedmetadata = () => l();
|
|
3043
|
-
}), await
|
|
3044
|
-
const o = a.videoWidth || 1,
|
|
3045
|
-
i.width = o, i.height =
|
|
3046
|
-
const
|
|
3047
|
-
if (!
|
|
3048
|
-
throw new Error(
|
|
3049
|
-
return
|
|
3047
|
+
}), await Ne();
|
|
3048
|
+
const o = a.videoWidth || 1, s = a.videoHeight || 1, i = document.createElement("canvas");
|
|
3049
|
+
i.width = o, i.height = s, i.getContext("2d").drawImage(a, 0, 0, o, s);
|
|
3050
|
+
const r = i.toDataURL("image/png");
|
|
3051
|
+
if (!Z(r))
|
|
3052
|
+
throw new Error(p("status.screenEmpty"));
|
|
3053
|
+
return r;
|
|
3050
3054
|
} finally {
|
|
3051
3055
|
e.getTracks().forEach((a) => a.stop());
|
|
3052
3056
|
}
|
|
3053
3057
|
}
|
|
3054
|
-
async function
|
|
3055
|
-
const t = document.getElementById("notefully"), a = t ? t.style.display : "", o =
|
|
3058
|
+
async function Vt(e = {}) {
|
|
3059
|
+
const t = document.getElementById("notefully"), a = t ? t.style.display : "", o = ri(), s = ii();
|
|
3056
3060
|
let i = () => {
|
|
3057
3061
|
};
|
|
3058
3062
|
t && (t.style.display = "none");
|
|
3059
|
-
const
|
|
3063
|
+
const r = si();
|
|
3060
3064
|
try {
|
|
3061
|
-
if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await
|
|
3062
|
-
const
|
|
3063
|
-
if (
|
|
3064
|
-
return
|
|
3065
|
+
if (typeof e.onBeforeCapture == "function" && await e.onBeforeCapture(), await Ne(), typeof e.capture == "function") {
|
|
3066
|
+
const v = await ci(await e.capture());
|
|
3067
|
+
if (v)
|
|
3068
|
+
return v;
|
|
3065
3069
|
}
|
|
3066
|
-
i = await
|
|
3067
|
-
const { width: l, height: u } =
|
|
3070
|
+
i = await ui(), await Ne();
|
|
3071
|
+
const { width: l, height: u } = li(), c = {
|
|
3068
3072
|
cacheBust: !0,
|
|
3069
3073
|
width: l,
|
|
3070
3074
|
height: u,
|
|
3071
3075
|
pixelRatio: Math.min(window.devicePixelRatio || 1, 2),
|
|
3072
|
-
filter: (
|
|
3076
|
+
filter: (v) => !It(v),
|
|
3073
3077
|
// 404 / CORS images must not abort the whole capture.
|
|
3074
|
-
imagePlaceholder:
|
|
3078
|
+
imagePlaceholder: oi,
|
|
3075
3079
|
onImageErrorHandler: () => {
|
|
3076
3080
|
}
|
|
3077
3081
|
};
|
|
3078
|
-
let
|
|
3082
|
+
let g = "";
|
|
3079
3083
|
try {
|
|
3080
|
-
|
|
3084
|
+
g = await ct(document.body, c);
|
|
3081
3085
|
} catch {
|
|
3082
|
-
|
|
3086
|
+
g = await ct(document.body, { ...c, skipFonts: !0 });
|
|
3083
3087
|
}
|
|
3084
|
-
if (!
|
|
3085
|
-
throw new Error(
|
|
3086
|
-
return
|
|
3088
|
+
if (!Z(g))
|
|
3089
|
+
throw new Error(p("status.captureEmpty"));
|
|
3090
|
+
return g;
|
|
3087
3091
|
} finally {
|
|
3088
3092
|
try {
|
|
3089
3093
|
i();
|
|
3090
3094
|
} catch {
|
|
3091
3095
|
}
|
|
3092
|
-
|
|
3096
|
+
r(), s(), o.remove(), ni(), t && (t.style.display = a);
|
|
3093
3097
|
}
|
|
3094
3098
|
}
|
|
3095
|
-
function
|
|
3099
|
+
function gi(e = "") {
|
|
3096
3100
|
const t = String(e || "");
|
|
3097
3101
|
return t ? /Windows NT/i.test(t) ? "Windows" : /iPhone|iPad|iPod/i.test(t) ? "iOS" : /Mac OS X|Macintosh/i.test(t) ? "macOS" : /Android/i.test(t) ? "Android" : /CrOS/i.test(t) ? "ChromeOS" : /Linux/i.test(t) ? "Linux" : "Other" : "";
|
|
3098
3102
|
}
|
|
3099
|
-
function
|
|
3103
|
+
function mi(e = "") {
|
|
3100
3104
|
const t = String(e || "");
|
|
3101
3105
|
return t ? /Edg\//i.test(t) ? "Edge" : /OPR\/|Opera/i.test(t) ? "Opera" : /Firefox\//i.test(t) ? "Firefox" : /Chrome\//i.test(t) || /CriOS\//i.test(t) ? "Chrome" : /Safari\//i.test(t) ? "Safari" : "Other" : "";
|
|
3102
3106
|
}
|
|
3103
|
-
function
|
|
3107
|
+
function hi(e = {}) {
|
|
3104
3108
|
const t = navigator.userAgent;
|
|
3105
3109
|
return {
|
|
3106
3110
|
url: location.href,
|
|
3107
3111
|
title: document.title,
|
|
3108
3112
|
userAgent: t,
|
|
3109
|
-
os:
|
|
3110
|
-
browser:
|
|
3113
|
+
os: gi(t),
|
|
3114
|
+
browser: mi(t),
|
|
3111
3115
|
language: navigator.language,
|
|
3112
3116
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
3113
3117
|
viewport: {
|
|
@@ -3115,6 +3119,11 @@ function pi(e = {}) {
|
|
|
3115
3119
|
height: window.innerHeight,
|
|
3116
3120
|
dpr: window.devicePixelRatio || 1
|
|
3117
3121
|
},
|
|
3122
|
+
screen: {
|
|
3123
|
+
width: typeof screen < "u" ? screen.width : null,
|
|
3124
|
+
height: typeof screen < "u" ? screen.height : null,
|
|
3125
|
+
dpr: window.devicePixelRatio || 1
|
|
3126
|
+
},
|
|
3118
3127
|
user: {
|
|
3119
3128
|
userId: e.userId || null,
|
|
3120
3129
|
email: e.email || null,
|
|
@@ -3122,11 +3131,11 @@ function pi(e = {}) {
|
|
|
3122
3131
|
}
|
|
3123
3132
|
};
|
|
3124
3133
|
}
|
|
3125
|
-
const
|
|
3134
|
+
const dt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), pt = {
|
|
3126
3135
|
id: "userId",
|
|
3127
3136
|
username: "displayName",
|
|
3128
3137
|
name: "displayName"
|
|
3129
|
-
},
|
|
3138
|
+
}, gt = /* @__PURE__ */ new Set([
|
|
3130
3139
|
"endpoint",
|
|
3131
3140
|
"projectKey",
|
|
3132
3141
|
"version",
|
|
@@ -3144,7 +3153,7 @@ const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
|
|
|
3144
3153
|
"displayLink",
|
|
3145
3154
|
"locale",
|
|
3146
3155
|
"translations"
|
|
3147
|
-
]),
|
|
3156
|
+
]), mt = {
|
|
3148
3157
|
slug: "Use init({ name }) for a per-app report prefix (same idea as package.json name). slug is not a widget option.",
|
|
3149
3158
|
projectSlug: "Use init({ name }) for a per-app report prefix. projectSlug is not a widget option.",
|
|
3150
3159
|
project: "Pass projectKey (nfk_…) from Showfully Notefully settings — there is no project option on the widget.",
|
|
@@ -3153,60 +3162,156 @@ const pt = /* @__PURE__ */ new Set(["userId", "email", "displayName"]), gt = {
|
|
|
3153
3162
|
email: "Pass people via Notefully.identify({ userId, email, displayName }), not init().",
|
|
3154
3163
|
displayName: "Pass people via Notefully.identify({ userId, email, displayName }), not init()."
|
|
3155
3164
|
};
|
|
3156
|
-
function
|
|
3157
|
-
const a = t.warn ||
|
|
3158
|
-
for (const
|
|
3159
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
3160
|
-
for (const [
|
|
3161
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
3162
|
-
for (const
|
|
3163
|
-
|
|
3165
|
+
function fi(e = {}, t = {}) {
|
|
3166
|
+
const a = t.warn || $t, o = e && typeof e == "object" ? e : {}, s = {}, i = [];
|
|
3167
|
+
for (const r of dt)
|
|
3168
|
+
Object.prototype.hasOwnProperty.call(o, r) && (s[r] = o[r]);
|
|
3169
|
+
for (const [r, l] of Object.entries(pt))
|
|
3170
|
+
Object.prototype.hasOwnProperty.call(o, r) && (Object.prototype.hasOwnProperty.call(s, l) || (s[l] = o[r]));
|
|
3171
|
+
for (const r of Object.keys(o))
|
|
3172
|
+
dt.has(r) || Object.prototype.hasOwnProperty.call(pt, r) || i.push(r);
|
|
3164
3173
|
if (i.length) {
|
|
3165
|
-
const
|
|
3174
|
+
const r = i.some((l) => l === "name" || l === "slug" || l === "projectSlug") ? " Pass the package/report name via Notefully.init({ name }), not identify()." : "";
|
|
3166
3175
|
a(
|
|
3167
|
-
`Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` +
|
|
3176
|
+
`Notefully.identify: ignoring unknown key(s): ${i.join(", ")}. Supported: userId, email, displayName (aliases: id → userId; username/name → displayName).` + r
|
|
3168
3177
|
);
|
|
3169
3178
|
}
|
|
3170
|
-
return
|
|
3171
|
-
}
|
|
3172
|
-
function
|
|
3173
|
-
const a = t.warn ||
|
|
3174
|
-
if (
|
|
3175
|
-
for (const i of
|
|
3176
|
-
if (
|
|
3177
|
-
a(`Notefully.init: ignoring "${i}". ${
|
|
3179
|
+
return s;
|
|
3180
|
+
}
|
|
3181
|
+
function yi(e = {}, t = {}) {
|
|
3182
|
+
const a = t.warn || $t, o = e && typeof e == "object" ? e : {}, s = Object.keys(o).filter((i) => !gt.has(i));
|
|
3183
|
+
if (s.length)
|
|
3184
|
+
for (const i of s) {
|
|
3185
|
+
if (mt[i]) {
|
|
3186
|
+
a(`Notefully.init: ignoring "${i}". ${mt[i]}`);
|
|
3178
3187
|
continue;
|
|
3179
3188
|
}
|
|
3180
3189
|
a(
|
|
3181
|
-
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...
|
|
3190
|
+
`Notefully.init: ignoring unknown key "${i}". Supported: ${[...gt].join(", ")}.`
|
|
3182
3191
|
);
|
|
3183
3192
|
}
|
|
3184
3193
|
}
|
|
3185
|
-
function
|
|
3194
|
+
function $t(e) {
|
|
3186
3195
|
typeof console < "u" && typeof console.warn == "function" && console.warn(e);
|
|
3187
3196
|
}
|
|
3188
|
-
const
|
|
3189
|
-
function
|
|
3197
|
+
const ht = /expression\s*\(|url\s*\(|@import|javascript:|behavior\s*:|-moz-binding|\bbinding\s*:/i, vi = /(?:^|\s)(?=[a-z-]+\s*:\s*[^;]+;)/i;
|
|
3198
|
+
function ft(e) {
|
|
3199
|
+
if (e instanceof Error)
|
|
3200
|
+
return e.stack || e.message || String(e);
|
|
3201
|
+
if (typeof e == "string")
|
|
3202
|
+
return e;
|
|
3203
|
+
try {
|
|
3204
|
+
return JSON.stringify(e);
|
|
3205
|
+
} catch {
|
|
3206
|
+
return String(e);
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
function Ze(e) {
|
|
3210
|
+
if (!e || typeof e != "string")
|
|
3211
|
+
return "";
|
|
3212
|
+
let t = e.replace(/[\u0000-\u001F\u007F]/g, "").trim();
|
|
3213
|
+
return t ? (ht.test(t) && (t = t.split(";").map((a) => a.trim()).filter((a) => a && !ht.test(a)).join("; "), t && !t.endsWith(";") && (t += ";")), t.slice(0, 500)) : "";
|
|
3214
|
+
}
|
|
3215
|
+
function ki(e = []) {
|
|
3216
|
+
if (!e.length)
|
|
3217
|
+
return { text: "", segments: [{ text: "", style: null }] };
|
|
3218
|
+
const t = e[0];
|
|
3219
|
+
if (typeof t != "string" || !t.includes("%c")) {
|
|
3220
|
+
const r = e.map(ft).join(" ");
|
|
3221
|
+
return { text: r, segments: [{ text: r, style: null }] };
|
|
3222
|
+
}
|
|
3223
|
+
const a = t.split("%c"), o = [];
|
|
3224
|
+
let s = 1;
|
|
3225
|
+
for (let r = 0; r < a.length; r++) {
|
|
3226
|
+
const l = a[r];
|
|
3227
|
+
if (r === 0) {
|
|
3228
|
+
l && o.push({ text: l, style: null });
|
|
3229
|
+
continue;
|
|
3230
|
+
}
|
|
3231
|
+
const u = s < e.length ? String(e[s++] ?? "") : "", c = Ze(u) || null;
|
|
3232
|
+
o.push({ text: l, style: c });
|
|
3233
|
+
}
|
|
3234
|
+
if (s < e.length) {
|
|
3235
|
+
const r = e.slice(s).map(ft).join(" ");
|
|
3236
|
+
r && o.push({
|
|
3237
|
+
text: (o.length ? " " : "") + r,
|
|
3238
|
+
style: null
|
|
3239
|
+
});
|
|
3240
|
+
}
|
|
3241
|
+
return {
|
|
3242
|
+
text: o.map((r) => r.text).join(""),
|
|
3243
|
+
segments: o.length ? o : [{ text: "", style: null }]
|
|
3244
|
+
};
|
|
3245
|
+
}
|
|
3246
|
+
function bi(e) {
|
|
3247
|
+
const t = String(e ?? "");
|
|
3248
|
+
if (!t.includes("%c"))
|
|
3249
|
+
return [{ text: t, style: null }];
|
|
3250
|
+
const a = t.split("%c"), o = a[a.length - 1], s = o.match(vi);
|
|
3251
|
+
let i = "";
|
|
3252
|
+
if (s) {
|
|
3253
|
+
const u = s.index, c = /\s/.test(o[u]) ? u + 1 : u;
|
|
3254
|
+
/^[a-z-]+\s*:/i.test(o.slice(c)) && (a[a.length - 1] = o.slice(0, c).replace(/\s+$/, ""), i = o.slice(c).trim());
|
|
3255
|
+
}
|
|
3256
|
+
const r = Ze(i) || null, l = [];
|
|
3257
|
+
for (let u = 0; u < a.length; u++) {
|
|
3258
|
+
const c = a[u];
|
|
3259
|
+
if (u === 0) {
|
|
3260
|
+
c && l.push({ text: c, style: null });
|
|
3261
|
+
continue;
|
|
3262
|
+
}
|
|
3263
|
+
l.push({
|
|
3264
|
+
text: c,
|
|
3265
|
+
style: u === 1 ? r : null
|
|
3266
|
+
});
|
|
3267
|
+
}
|
|
3268
|
+
return l.length ? l : [{ text: t, style: null }];
|
|
3269
|
+
}
|
|
3270
|
+
function Bt(e = {}) {
|
|
3271
|
+
return Array.isArray(e.segments) && e.segments.length ? e.segments.map((t) => ({
|
|
3272
|
+
text: String((t == null ? void 0 : t.text) ?? ""),
|
|
3273
|
+
style: Ze(t == null ? void 0 : t.style) || null
|
|
3274
|
+
})) : bi(e.text);
|
|
3275
|
+
}
|
|
3276
|
+
function wi(e = {}) {
|
|
3277
|
+
return Bt(e).map((a) => a.text).join("");
|
|
3278
|
+
}
|
|
3279
|
+
function yt(e) {
|
|
3280
|
+
return String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3281
|
+
}
|
|
3282
|
+
function Si(e = {}) {
|
|
3283
|
+
return Bt(e).map((t) => {
|
|
3284
|
+
const a = yt(t.text);
|
|
3285
|
+
return t.style ? `<span class="nf-console-styled" style="${yt(t.style)}">${a}</span>` : a;
|
|
3286
|
+
}).join("");
|
|
3287
|
+
}
|
|
3288
|
+
const Ai = 80;
|
|
3289
|
+
function Ci() {
|
|
3190
3290
|
const e = [], t = {};
|
|
3191
3291
|
let a = !1;
|
|
3192
|
-
const o = (i,
|
|
3193
|
-
let l = "";
|
|
3292
|
+
const o = (i, r) => {
|
|
3293
|
+
let l = "", u = null;
|
|
3194
3294
|
try {
|
|
3195
|
-
|
|
3295
|
+
const g = ki(r);
|
|
3296
|
+
l = g.text, u = g.segments;
|
|
3196
3297
|
} catch {
|
|
3197
|
-
l = String(
|
|
3298
|
+
l = String(r[0]), u = [{ text: l, style: null }];
|
|
3198
3299
|
}
|
|
3199
|
-
|
|
3300
|
+
const c = {
|
|
3200
3301
|
level: i,
|
|
3201
3302
|
text: l.slice(0, 2e3),
|
|
3202
3303
|
at: Date.now()
|
|
3203
|
-
}
|
|
3304
|
+
};
|
|
3305
|
+
u && u.some((g) => g.style) && (c.segments = u.map((g) => ({
|
|
3306
|
+
text: String(g.text || "").slice(0, 2e3),
|
|
3307
|
+
style: g.style || null
|
|
3308
|
+
}))), e.push(c), e.length > Ai && e.shift();
|
|
3204
3309
|
};
|
|
3205
3310
|
return {
|
|
3206
3311
|
hook: () => {
|
|
3207
3312
|
a || typeof window > "u" || (a = !0, ["log", "info", "warn", "error"].forEach((i) => {
|
|
3208
|
-
t[i] = console[i].bind(console), console[i] = (...
|
|
3209
|
-
o(i,
|
|
3313
|
+
t[i] = console[i].bind(console), console[i] = (...r) => {
|
|
3314
|
+
o(i, r), t[i](...r);
|
|
3210
3315
|
};
|
|
3211
3316
|
}), window.addEventListener("error", (i) => {
|
|
3212
3317
|
o("error", [i.message || "window.error"]);
|
|
@@ -3219,10 +3324,10 @@ function fi() {
|
|
|
3219
3324
|
}
|
|
3220
3325
|
};
|
|
3221
3326
|
}
|
|
3222
|
-
function
|
|
3327
|
+
function zi(e) {
|
|
3223
3328
|
const t = window.SpeechRecognition || window.webkitSpeechRecognition;
|
|
3224
3329
|
let a = null, o = !1;
|
|
3225
|
-
const
|
|
3330
|
+
const s = () => {
|
|
3226
3331
|
if (o = !1, a)
|
|
3227
3332
|
try {
|
|
3228
3333
|
a.stop();
|
|
@@ -3230,13 +3335,13 @@ function yi(e) {
|
|
|
3230
3335
|
}
|
|
3231
3336
|
};
|
|
3232
3337
|
return {
|
|
3233
|
-
start: (
|
|
3338
|
+
start: (r = {}) => {
|
|
3234
3339
|
if (!t)
|
|
3235
|
-
throw new Error(
|
|
3236
|
-
return o ? (
|
|
3340
|
+
throw new Error(p("status.speechUnsupported"));
|
|
3341
|
+
return o ? (s(), !1) : (a = new t(), a.continuous = !0, a.interimResults = !0, a.lang = r.lang || navigator.language || "en-US", a.onresult = (l) => {
|
|
3237
3342
|
let u = "";
|
|
3238
|
-
for (let
|
|
3239
|
-
l.results[
|
|
3343
|
+
for (let c = l.resultIndex; c < l.results.length; c += 1)
|
|
3344
|
+
l.results[c].isFinal && (u += l.results[c][0].transcript);
|
|
3240
3345
|
u && e(u);
|
|
3241
3346
|
}, a.onerror = () => {
|
|
3242
3347
|
o = !1;
|
|
@@ -3244,48 +3349,48 @@ function yi(e) {
|
|
|
3244
3349
|
o = !1;
|
|
3245
3350
|
}, a.start(), o = !0, !0);
|
|
3246
3351
|
},
|
|
3247
|
-
stop:
|
|
3352
|
+
stop: s,
|
|
3248
3353
|
isSupported: () => !!t,
|
|
3249
3354
|
isActive: () => o
|
|
3250
3355
|
};
|
|
3251
3356
|
}
|
|
3252
|
-
const
|
|
3253
|
-
function
|
|
3254
|
-
let o = null,
|
|
3357
|
+
const Ei = 60 * 1e3;
|
|
3358
|
+
function ji({ onStart: e, onStop: t, onError: a }) {
|
|
3359
|
+
let o = null, s = null, i = [], r = null;
|
|
3255
3360
|
const l = () => {
|
|
3256
|
-
if (
|
|
3361
|
+
if (r && (clearTimeout(r), r = null), s && s.state !== "inactive")
|
|
3257
3362
|
try {
|
|
3258
|
-
|
|
3363
|
+
s.stop();
|
|
3259
3364
|
} catch {
|
|
3260
3365
|
}
|
|
3261
|
-
o && (o.getTracks().forEach((
|
|
3366
|
+
o && (o.getTracks().forEach((g) => g.stop()), o = null);
|
|
3262
3367
|
}, u = () => {
|
|
3263
|
-
if (
|
|
3264
|
-
|
|
3368
|
+
if (s && s.state === "recording") {
|
|
3369
|
+
s.stop();
|
|
3265
3370
|
return;
|
|
3266
3371
|
}
|
|
3267
3372
|
l(), t(null);
|
|
3268
3373
|
};
|
|
3269
3374
|
return { start: async () => {
|
|
3270
|
-
var
|
|
3271
|
-
if (!((
|
|
3375
|
+
var g, v;
|
|
3376
|
+
if (!((g = navigator.mediaDevices) != null && g.getDisplayMedia))
|
|
3272
3377
|
throw new Error("Screen recording is not supported in this browser.");
|
|
3273
3378
|
o = await navigator.mediaDevices.getDisplayMedia({
|
|
3274
3379
|
video: { displaySurface: "browser" },
|
|
3275
3380
|
audio: !1,
|
|
3276
3381
|
preferCurrentTab: !0,
|
|
3277
3382
|
selfBrowserSurface: "include"
|
|
3278
|
-
}), i = [],
|
|
3383
|
+
}), i = [], s = new MediaRecorder(o, {
|
|
3279
3384
|
mimeType: MediaRecorder.isTypeSupported("video/webm;codecs=vp9") ? "video/webm;codecs=vp9" : "video/webm"
|
|
3280
|
-
}),
|
|
3281
|
-
|
|
3282
|
-
},
|
|
3283
|
-
const
|
|
3284
|
-
l(), t(
|
|
3285
|
-
}, (
|
|
3385
|
+
}), s.ondataavailable = (k) => {
|
|
3386
|
+
k.data && k.data.size && i.push(k.data);
|
|
3387
|
+
}, s.onstop = () => {
|
|
3388
|
+
const k = i.length ? new Blob(i, { type: s.mimeType || "video/webm" }) : null;
|
|
3389
|
+
l(), t(k);
|
|
3390
|
+
}, (v = o.getVideoTracks()[0]) == null || v.addEventListener("ended", () => u()), s.start(), r = setTimeout(u, Ei);
|
|
3286
3391
|
}, stop: u };
|
|
3287
3392
|
}
|
|
3288
|
-
function
|
|
3393
|
+
function Ri() {
|
|
3289
3394
|
const e = /* @__PURE__ */ new Set();
|
|
3290
3395
|
return {
|
|
3291
3396
|
alloc() {
|
|
@@ -3303,24 +3408,24 @@ function bi() {
|
|
|
3303
3408
|
}
|
|
3304
3409
|
};
|
|
3305
3410
|
}
|
|
3306
|
-
const
|
|
3411
|
+
const De = { x: 0, y: 0, w: 1, h: 1 };
|
|
3307
3412
|
function Je() {
|
|
3308
|
-
const e =
|
|
3309
|
-
let t = [], a = { ...
|
|
3413
|
+
const e = Ri();
|
|
3414
|
+
let t = [], a = { ...De }, o = 1;
|
|
3310
3415
|
return {
|
|
3311
|
-
list: () => t.filter((i) =>
|
|
3416
|
+
list: () => t.filter((i) => Li(i, a)),
|
|
3312
3417
|
all: () => t.slice(),
|
|
3313
3418
|
crop: () => ({ ...a }),
|
|
3314
3419
|
setCrop(i) {
|
|
3315
|
-
return a =
|
|
3420
|
+
return a = xi(i), a;
|
|
3316
3421
|
},
|
|
3317
3422
|
resetCrop() {
|
|
3318
|
-
return a = { ...
|
|
3423
|
+
return a = { ...De }, a;
|
|
3319
3424
|
},
|
|
3320
3425
|
isCropped() {
|
|
3321
3426
|
return a.x > 1e-6 || a.y > 1e-6 || a.w < 1 - 1e-6 || a.h < 1 - 1e-6;
|
|
3322
3427
|
},
|
|
3323
|
-
add(i,
|
|
3428
|
+
add(i, r) {
|
|
3324
3429
|
const l = {
|
|
3325
3430
|
id: `s${o++}`,
|
|
3326
3431
|
type: i,
|
|
@@ -3331,49 +3436,49 @@ function Je() {
|
|
|
3331
3436
|
h: i === "arrow" ? 0.05 : 0.16,
|
|
3332
3437
|
x2: 0.4,
|
|
3333
3438
|
y2: 0.28,
|
|
3334
|
-
...
|
|
3439
|
+
...r
|
|
3335
3440
|
};
|
|
3336
3441
|
return t.push(l), l;
|
|
3337
3442
|
},
|
|
3338
|
-
update(i,
|
|
3443
|
+
update(i, r) {
|
|
3339
3444
|
const l = t.find((u) => u.id === i);
|
|
3340
|
-
return l ? (Object.assign(l,
|
|
3445
|
+
return l ? (Object.assign(l, r), l) : null;
|
|
3341
3446
|
},
|
|
3342
3447
|
remove(i) {
|
|
3343
|
-
const
|
|
3344
|
-
if (
|
|
3448
|
+
const r = t.findIndex((u) => u.id === i);
|
|
3449
|
+
if (r < 0)
|
|
3345
3450
|
return null;
|
|
3346
|
-
const [l] = t.splice(
|
|
3451
|
+
const [l] = t.splice(r, 1);
|
|
3347
3452
|
return e.free(l.number), l;
|
|
3348
3453
|
},
|
|
3349
3454
|
reset() {
|
|
3350
|
-
for (t = [], a = { ...
|
|
3455
|
+
for (t = [], a = { ...De }, o = 1; e.peekUsed().length; )
|
|
3351
3456
|
e.free(e.peekUsed()[0]);
|
|
3352
3457
|
}
|
|
3353
3458
|
};
|
|
3354
3459
|
}
|
|
3355
|
-
function
|
|
3356
|
-
const a = Number(t == null ? void 0 : t.w) || 1, o = Number(t == null ? void 0 : t.h) || 1,
|
|
3357
|
-
return (Array.isArray(e) ? e : []).map((
|
|
3460
|
+
function Pi(e, t) {
|
|
3461
|
+
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;
|
|
3462
|
+
return (Array.isArray(e) ? e : []).map((r) => {
|
|
3358
3463
|
const l = {
|
|
3359
|
-
...
|
|
3360
|
-
x: (
|
|
3361
|
-
y: (
|
|
3362
|
-
w: (
|
|
3363
|
-
h: (
|
|
3464
|
+
...r,
|
|
3465
|
+
x: (r.x - s) / a,
|
|
3466
|
+
y: (r.y - i) / o,
|
|
3467
|
+
w: (r.w || 0) / a,
|
|
3468
|
+
h: (r.h || 0) / o
|
|
3364
3469
|
};
|
|
3365
|
-
return Number.isFinite(
|
|
3470
|
+
return Number.isFinite(r.x2) && (l.x2 = (r.x2 - s) / a), Number.isFinite(r.y2) && (l.y2 = (r.y2 - i) / o), l;
|
|
3366
3471
|
});
|
|
3367
3472
|
}
|
|
3368
|
-
function
|
|
3369
|
-
const t = Math.min(Math.max(e.x, 0), 0.95), a = Math.min(Math.max(e.y, 0), 0.95), o = Math.min(Math.max(e.w, 0.05), 1 - t),
|
|
3370
|
-
return { x: t, y: a, w: o, h:
|
|
3473
|
+
function xi(e) {
|
|
3474
|
+
const t = Math.min(Math.max(e.x, 0), 0.95), a = Math.min(Math.max(e.y, 0), 0.95), o = Math.min(Math.max(e.w, 0.05), 1 - t), s = Math.min(Math.max(e.h, 0.05), 1 - a);
|
|
3475
|
+
return { x: t, y: a, w: o, h: s };
|
|
3371
3476
|
}
|
|
3372
|
-
function
|
|
3477
|
+
function Li(e, t) {
|
|
3373
3478
|
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;
|
|
3374
3479
|
return a >= t.x && o >= t.y && a <= t.x + t.w && o <= t.y + t.h;
|
|
3375
3480
|
}
|
|
3376
|
-
function
|
|
3481
|
+
function Nt(e) {
|
|
3377
3482
|
const t = Math.max(1, Number(e) || 1);
|
|
3378
3483
|
return {
|
|
3379
3484
|
stroke: Math.max(2, t * 75e-4),
|
|
@@ -3383,106 +3488,64 @@ function Ye(e) {
|
|
|
3383
3488
|
arrowHeadAngle: 0.4
|
|
3384
3489
|
};
|
|
3385
3490
|
}
|
|
3386
|
-
function
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
const s = i.mark || "#fdd341", l = i.markText || "#2a2140", u = Ye(o);
|
|
3394
|
-
e.save(), e.lineWidth = u.stroke, e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = s, e.fillStyle = s, e.font = `700 ${Math.round(u.fontSize)}px ui-sans-serif, system-ui, sans-serif`, t.forEach((d) => {
|
|
3395
|
-
const p = Ne(d.x, a, o), y = Ke(d.y, a, r), v = d.w / a.w * o, b = d.h / a.h * r, z = u.stroke / 2;
|
|
3396
|
-
if (d.type === "rect")
|
|
3397
|
-
e.strokeRect(
|
|
3398
|
-
p + z,
|
|
3399
|
-
y + z,
|
|
3400
|
-
Math.max(0, v - u.stroke),
|
|
3401
|
-
Math.max(0, b - u.stroke)
|
|
3402
|
-
);
|
|
3403
|
-
else if (d.type === "circle")
|
|
3404
|
-
e.beginPath(), e.ellipse(
|
|
3405
|
-
p + v / 2,
|
|
3406
|
-
y + b / 2,
|
|
3407
|
-
Math.max(0.5, v / 2 - z),
|
|
3408
|
-
Math.max(0.5, b / 2 - z),
|
|
3409
|
-
0,
|
|
3410
|
-
0,
|
|
3411
|
-
Math.PI * 2
|
|
3412
|
-
), e.stroke();
|
|
3413
|
-
else if (d.type === "arrow") {
|
|
3414
|
-
const P = Ne(d.x2 ?? d.x + d.w, a, o), $ = Ke(d.y2 ?? d.y, a, r);
|
|
3415
|
-
ji(e, p, y, P, $, u);
|
|
3416
|
-
}
|
|
3417
|
-
if (d.number == null || d.number === "")
|
|
3418
|
-
return;
|
|
3419
|
-
const E = Ci(d, a, o, r, p, y, v), M = String(d.number);
|
|
3420
|
-
e.beginPath(), e.arc(E.x, E.y, u.badgeRadius, 0, Math.PI * 2), e.fillStyle = s, e.fill(), e.fillStyle = l, e.textAlign = "center", e.textBaseline = "middle", e.fillText(M, E.x, E.y + 0.5), e.fillStyle = s;
|
|
3421
|
-
}), e.restore();
|
|
3422
|
-
}
|
|
3423
|
-
function Ne(e, t, a) {
|
|
3424
|
-
return (e - t.x) / t.w * a;
|
|
3425
|
-
}
|
|
3426
|
-
function Ke(e, t, a) {
|
|
3427
|
-
return (e - t.y) / t.h * a;
|
|
3428
|
-
}
|
|
3429
|
-
function Ci(e, t, a, o, r, i, s) {
|
|
3430
|
-
if (e.type === "arrow") {
|
|
3431
|
-
const l = Ne(e.x2 ?? e.x + e.w, t, a), u = Ke(e.y2 ?? e.y, t, o);
|
|
3432
|
-
return {
|
|
3433
|
-
x: (r + l) / 2,
|
|
3434
|
-
y: (i + u) / 2
|
|
3435
|
-
};
|
|
3436
|
-
}
|
|
3437
|
-
return { x: r + s / 2, y: i };
|
|
3438
|
-
}
|
|
3439
|
-
function It(e, t, a, o, r) {
|
|
3440
|
-
const i = Math.atan2(o - t, a - e), s = r.arrowHead, l = Math.min(r.stroke, s * 0.2), u = a, d = o, p = a - Math.cos(i) * s, y = o - Math.sin(i) * s, v = {
|
|
3441
|
-
x: u - s * Math.cos(i - r.arrowHeadAngle),
|
|
3442
|
-
y: d - s * Math.sin(i - r.arrowHeadAngle)
|
|
3491
|
+
function Ui(e, t, a, o, s) {
|
|
3492
|
+
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 = {
|
|
3493
|
+
x: u - r * Math.cos(i - s.arrowHeadAngle),
|
|
3494
|
+
y: c - r * Math.sin(i - s.arrowHeadAngle)
|
|
3495
|
+
}, w = {
|
|
3496
|
+
x: u - r * Math.cos(i + s.arrowHeadAngle),
|
|
3497
|
+
y: c - r * Math.sin(i + s.arrowHeadAngle)
|
|
3443
3498
|
}, b = {
|
|
3444
|
-
x: u - s * Math.cos(i + r.arrowHeadAngle),
|
|
3445
|
-
y: d - s * Math.sin(i + r.arrowHeadAngle)
|
|
3446
|
-
}, z = {
|
|
3447
3499
|
x: a - Math.cos(i) * l,
|
|
3448
3500
|
y: o - Math.sin(i) * l
|
|
3449
3501
|
};
|
|
3450
|
-
return { angle: i, tipX: u, tipY:
|
|
3451
|
-
}
|
|
3452
|
-
function
|
|
3453
|
-
const
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
}
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3502
|
+
return { angle: i, tipX: u, tipY: c, baseX: g, baseY: v, left: k, right: w, shaftEnd: b };
|
|
3503
|
+
}
|
|
3504
|
+
async function vt(e, t = {}) {
|
|
3505
|
+
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 Di(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 = Ti(u, c, o), v = g.width, k = g.height, w = document.createElement("canvas");
|
|
3506
|
+
w.width = v, w.height = k, w.getContext("2d").drawImage(i, r, l, u, c, 0, 0, v, k);
|
|
3507
|
+
const z = await kt(w, "image/webp", s);
|
|
3508
|
+
if (z && z.size > 0 && z.type === "image/webp")
|
|
3509
|
+
return { blob: z, width: v, height: k, mime: "image/webp", ext: "webp" };
|
|
3510
|
+
const R = await kt(w, "image/png");
|
|
3511
|
+
if (!R || !R.size)
|
|
3512
|
+
throw new Error("Could not encode screenshot");
|
|
3513
|
+
return { blob: R, width: v, height: k, mime: "image/png", ext: "png" };
|
|
3514
|
+
}
|
|
3515
|
+
function Ti(e, t, a = 2048) {
|
|
3516
|
+
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));
|
|
3517
|
+
return {
|
|
3518
|
+
width: Math.max(1, Math.round(o * r)),
|
|
3519
|
+
height: Math.max(1, Math.round(s * r)),
|
|
3520
|
+
scale: r
|
|
3521
|
+
};
|
|
3522
|
+
}
|
|
3523
|
+
function Fi(e = 2048) {
|
|
3524
|
+
const t = Math.floor(Number(e) / 2);
|
|
3525
|
+
return Math.max(1, Math.min(1024, t || 1024));
|
|
3526
|
+
}
|
|
3527
|
+
function Oi(e, t = null) {
|
|
3528
|
+
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)
|
|
3529
|
+
return !0;
|
|
3530
|
+
const a = String((e == null ? void 0 : e.message) || e || (t == null ? void 0 : t.error) || "").toLowerCase();
|
|
3531
|
+
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;
|
|
3532
|
+
}
|
|
3533
|
+
function Di(e) {
|
|
3534
|
+
return new Promise((t, a) => {
|
|
3535
|
+
const o = new Image();
|
|
3536
|
+
o.onload = () => t(o), o.onerror = () => a(new Error("Could not load screenshot")), o.src = e;
|
|
3483
3537
|
});
|
|
3484
3538
|
}
|
|
3485
|
-
|
|
3539
|
+
function kt(e, t, a) {
|
|
3540
|
+
return new Promise((o) => {
|
|
3541
|
+
try {
|
|
3542
|
+
e.toBlob((s) => o(s), t, a);
|
|
3543
|
+
} catch {
|
|
3544
|
+
o(null);
|
|
3545
|
+
}
|
|
3546
|
+
});
|
|
3547
|
+
}
|
|
3548
|
+
const Mi = [
|
|
3486
3549
|
"url",
|
|
3487
3550
|
"title",
|
|
3488
3551
|
"userAgent",
|
|
@@ -3493,47 +3556,50 @@ const Pi = [
|
|
|
3493
3556
|
"viewport",
|
|
3494
3557
|
"user"
|
|
3495
3558
|
];
|
|
3496
|
-
function
|
|
3559
|
+
function Ii(e) {
|
|
3497
3560
|
return !e || typeof e != "object" ? !1 : !!(e.userId || e.email || e.displayName);
|
|
3498
3561
|
}
|
|
3499
|
-
function
|
|
3562
|
+
function Vi(e = {}) {
|
|
3500
3563
|
const t = [];
|
|
3501
|
-
for (const a of
|
|
3564
|
+
for (const a of Mi) {
|
|
3502
3565
|
const o = e[a];
|
|
3503
|
-
o == null || o === "" || a === "user" && !
|
|
3566
|
+
o == null || o === "" || a === "user" && !Ii(o) || t.push({
|
|
3504
3567
|
key: a,
|
|
3505
|
-
label:
|
|
3568
|
+
label: p(`diag.${a}`),
|
|
3506
3569
|
value: o,
|
|
3507
3570
|
redacted: !1
|
|
3508
3571
|
});
|
|
3509
3572
|
}
|
|
3510
3573
|
return t;
|
|
3511
3574
|
}
|
|
3512
|
-
function
|
|
3513
|
-
return e.map((t, a) =>
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3575
|
+
function $i(e = []) {
|
|
3576
|
+
return e.map((t, a) => {
|
|
3577
|
+
const o = {
|
|
3578
|
+
id: `log-${a}-${t.at || 0}`,
|
|
3579
|
+
level: t.level || "log",
|
|
3580
|
+
text: String(t.text || ""),
|
|
3581
|
+
at: t.at || 0,
|
|
3582
|
+
redacted: !1
|
|
3583
|
+
};
|
|
3584
|
+
return Array.isArray(t.segments) && t.segments.length && (o.segments = t.segments), o;
|
|
3585
|
+
});
|
|
3520
3586
|
}
|
|
3521
|
-
function
|
|
3587
|
+
function Bi(e = []) {
|
|
3522
3588
|
if (!e.length)
|
|
3523
3589
|
return { checked: !1, indeterminate: !1 };
|
|
3524
3590
|
const t = e.filter((a) => a.redacted).length;
|
|
3525
3591
|
return t === 0 ? { checked: !1, indeterminate: !1 } : t === e.length ? { checked: !0, indeterminate: !1 } : { checked: !1, indeterminate: !0 };
|
|
3526
3592
|
}
|
|
3527
|
-
function
|
|
3593
|
+
function we(e, t) {
|
|
3528
3594
|
e.forEach((a) => {
|
|
3529
3595
|
a.redacted = !!t;
|
|
3530
3596
|
});
|
|
3531
3597
|
}
|
|
3532
|
-
function
|
|
3533
|
-
const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted),
|
|
3534
|
-
return o &&
|
|
3598
|
+
function Ni(e = {}) {
|
|
3599
|
+
const t = e.diagnostics || [], a = e.logs || [], o = t.some((i) => !i.redacted), s = a.length > 0 && a.some((i) => !i.redacted);
|
|
3600
|
+
return o && s ? p("privacy.disclosure.both") : o ? p("privacy.disclosure.diagnostics") : s ? p("privacy.disclosure.logs") : "";
|
|
3535
3601
|
}
|
|
3536
|
-
function
|
|
3602
|
+
function Ki(e) {
|
|
3537
3603
|
if (e == null)
|
|
3538
3604
|
return "";
|
|
3539
3605
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
@@ -3544,80 +3610,83 @@ function Oi(e) {
|
|
|
3544
3610
|
return String(e);
|
|
3545
3611
|
}
|
|
3546
3612
|
}
|
|
3547
|
-
function
|
|
3613
|
+
function Hi(e = {}) {
|
|
3548
3614
|
const t = {};
|
|
3549
3615
|
e.author != null && e.author !== "" && (t.author = e.author);
|
|
3550
3616
|
for (const o of e.diagnostics || [])
|
|
3551
3617
|
o.redacted || (t[o.key] = o.value);
|
|
3552
|
-
const a = (e.logs || []).filter((o) => !o.redacted).map((o) =>
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3618
|
+
const a = (e.logs || []).filter((o) => !o.redacted).map((o) => {
|
|
3619
|
+
const s = {
|
|
3620
|
+
level: o.level,
|
|
3621
|
+
text: o.text,
|
|
3622
|
+
at: o.at
|
|
3623
|
+
};
|
|
3624
|
+
return Array.isArray(o.segments) && o.segments.length && (s.segments = o.segments), s;
|
|
3625
|
+
});
|
|
3557
3626
|
return t.console = a, t;
|
|
3558
3627
|
}
|
|
3559
|
-
const
|
|
3628
|
+
const Y = [
|
|
3560
3629
|
{ id: "bug", label: "Bug" },
|
|
3561
3630
|
{ id: "idea", label: "Idea" },
|
|
3562
3631
|
{ id: "other", label: "Other" }
|
|
3563
3632
|
];
|
|
3564
|
-
function
|
|
3633
|
+
function bt(e) {
|
|
3565
3634
|
return String(e || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32);
|
|
3566
3635
|
}
|
|
3567
|
-
function
|
|
3636
|
+
function Me(e) {
|
|
3568
3637
|
const t = String(e || "").trim();
|
|
3569
3638
|
return t ? t.split(/[-_\s]+/).filter(Boolean).map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ") : "";
|
|
3570
3639
|
}
|
|
3571
|
-
function
|
|
3640
|
+
function Gi(e) {
|
|
3572
3641
|
if (!Array.isArray(e) || !e.length)
|
|
3573
|
-
return
|
|
3642
|
+
return Y.map((o) => ({ ...o }));
|
|
3574
3643
|
const t = /* @__PURE__ */ new Set(), a = [];
|
|
3575
3644
|
for (const o of e) {
|
|
3576
|
-
let
|
|
3577
|
-
typeof o == "string" || typeof o == "number" ? (
|
|
3645
|
+
let s = "", i = "";
|
|
3646
|
+
typeof o == "string" || typeof o == "number" ? (s = bt(o), i = Me(s)) : o && typeof o == "object" && (s = bt(o.id ?? o.value ?? o.kind), i = String(o.label || o.name || Me(s)).trim() || Me(s)), !(!s || t.has(s)) && (t.add(s), a.push({ id: s, label: i }));
|
|
3578
3647
|
}
|
|
3579
|
-
return a.length ? a :
|
|
3648
|
+
return a.length ? a : Y.map((o) => ({ ...o }));
|
|
3580
3649
|
}
|
|
3581
|
-
function
|
|
3650
|
+
function Re(e) {
|
|
3582
3651
|
var a;
|
|
3583
|
-
const t = Array.isArray(e) && e.length ? e :
|
|
3652
|
+
const t = Array.isArray(e) && e.length ? e : Y;
|
|
3584
3653
|
return t.some((o) => o.id === "bug") ? "bug" : ((a = t[0]) == null ? void 0 : a.id) || "other";
|
|
3585
3654
|
}
|
|
3586
|
-
const
|
|
3655
|
+
const qi = ["maker", "all-business", "brighter-day", "quiet-night"], Kt = "maker", _i = /* @__PURE__ */ new Set(["crop", "arrow", "rect", "circle"]), Ke = 0.02, wt = 0.05, Wi = `
|
|
3587
3656
|
<svg class="nf-launcher-icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
3588
3657
|
<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"/>
|
|
3589
3658
|
<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"/>
|
|
3590
3659
|
</svg>
|
|
3591
3660
|
`;
|
|
3592
|
-
function
|
|
3661
|
+
function D(e) {
|
|
3593
3662
|
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>`;
|
|
3594
3663
|
}
|
|
3595
|
-
const
|
|
3596
|
-
crop:
|
|
3597
|
-
resetCrop:
|
|
3598
|
-
arrow:
|
|
3599
|
-
rect:
|
|
3600
|
-
circle:
|
|
3601
|
-
discard:
|
|
3602
|
-
recapture:
|
|
3603
|
-
privacy:
|
|
3604
|
-
audio:
|
|
3605
|
-
video:
|
|
3606
|
-
openArrow:
|
|
3607
|
-
},
|
|
3608
|
-
|
|
3609
|
-
const
|
|
3610
|
-
let
|
|
3664
|
+
const F = {
|
|
3665
|
+
crop: D('<path d="M6 3v5H1M18 21v-5h5M8 5h8a2 2 0 0 1 2 2v8M16 19H8a2 2 0 0 1-2-2V8"/>'),
|
|
3666
|
+
resetCrop: D('<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>'),
|
|
3667
|
+
arrow: D('<path d="M5 19 19 5"/><path d="M9 5h10v10"/>'),
|
|
3668
|
+
rect: D('<rect x="4" y="6" width="16" height="12" rx="1.5"/>'),
|
|
3669
|
+
circle: D('<circle cx="12" cy="12" r="8"/>'),
|
|
3670
|
+
discard: D('<path d="M4 7h16"/><path d="M9 7V5h6v2"/><path d="M6 7l1 13h10l1-13"/>'),
|
|
3671
|
+
recapture: D('<path d="M4 8h3l2-2h6l2 2h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>'),
|
|
3672
|
+
privacy: D('<path d="M8 6h13M8 12h13M8 18h13"/><path d="M3 6h.01M3 12h.01M3 18h.01"/>'),
|
|
3673
|
+
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"/>'),
|
|
3674
|
+
video: D('<rect x="3" y="7" width="13" height="10" rx="2"/><path d="M16 10.5 21 8v8l-5-2.5z"/>'),
|
|
3675
|
+
openArrow: D('<path d="M5 12h14"/><path d="m13 6 6 6-6 6"/>')
|
|
3676
|
+
}, Ht = Ci();
|
|
3677
|
+
Ht.hook();
|
|
3678
|
+
const Gt = 10, Zi = 80, qt = "notefully.author", _t = "notefully.kind", Wt = "notefully.redactSections";
|
|
3679
|
+
let d = {
|
|
3611
3680
|
endpoint: "",
|
|
3612
3681
|
projectKey: "",
|
|
3613
3682
|
version: "0.0.0",
|
|
3614
3683
|
name: "",
|
|
3615
3684
|
targets: null,
|
|
3616
3685
|
hideLauncher: !1,
|
|
3617
|
-
theme:
|
|
3686
|
+
theme: Kt,
|
|
3618
3687
|
video: !1,
|
|
3619
|
-
consoleLogLimit:
|
|
3620
|
-
kinds:
|
|
3688
|
+
consoleLogLimit: Gt,
|
|
3689
|
+
kinds: Y.map((e) => ({ ...e })),
|
|
3621
3690
|
kindsCustom: !1,
|
|
3622
3691
|
capture: null,
|
|
3623
3692
|
onBeforeCapture: null,
|
|
@@ -3626,40 +3695,34 @@ let c = {
|
|
|
3626
3695
|
displayLink: !1,
|
|
3627
3696
|
locale: null,
|
|
3628
3697
|
translations: null
|
|
3629
|
-
},
|
|
3630
|
-
function
|
|
3631
|
-
return
|
|
3698
|
+
}, ce = !1, Ie = !1, N = {}, f = null, n = {}, A = Je(), H = "", ie = "", K = null, J = Re(Y), q = null, M = null, j = null, E = null, me = null, Q = null, le = null, G = { w: 0, h: 0 }, Ve = !1, Pe = !1, xe = !1, V = [], I = [], _ = !1;
|
|
3699
|
+
function y(e) {
|
|
3700
|
+
return f.querySelector(e);
|
|
3632
3701
|
}
|
|
3633
|
-
function
|
|
3702
|
+
function Zt(e) {
|
|
3634
3703
|
const t = String(e || "").trim().toLowerCase().replace(/\s+/g, "-");
|
|
3635
|
-
return
|
|
3636
|
-
}
|
|
3637
|
-
function vt(e, t) {
|
|
3638
|
-
return g && getComputedStyle(g).getPropertyValue(e).trim() || t;
|
|
3704
|
+
return qi.includes(t) ? t : Kt;
|
|
3639
3705
|
}
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
}
|
|
3643
|
-
function A(e, t = !1) {
|
|
3644
|
-
n.status && (n.status.textContent = e || "", ge && (clearTimeout(ge), ge = null), e && !t && (ge = setTimeout(() => {
|
|
3706
|
+
function S(e, t = !1) {
|
|
3707
|
+
n.status && (n.status.textContent = e || "", me && (clearTimeout(me), me = null), e && !t && (me = setTimeout(() => {
|
|
3645
3708
|
n.status.textContent = "";
|
|
3646
3709
|
}, 4e3)));
|
|
3647
3710
|
}
|
|
3648
|
-
function
|
|
3649
|
-
return
|
|
3650
|
-
<button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${
|
|
3711
|
+
function Ye() {
|
|
3712
|
+
return f && document.body.contains(f) || (f = document.createElement("div"), f.id = "notefully", f.innerHTML = `
|
|
3713
|
+
<button class="nf-launcher" type="button" data-i18n-title="launcher.open" data-i18n-aria="launcher.open">${Wi}</button>
|
|
3651
3714
|
<div class="nf-dialog" hidden>
|
|
3652
3715
|
<div class="nf-panel">
|
|
3653
3716
|
<div class="nf-panel-body">
|
|
3654
3717
|
<div class="nf-stage" hidden>
|
|
3655
3718
|
<div class="nf-palette">
|
|
3656
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${
|
|
3657
|
-
<button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${
|
|
3658
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${
|
|
3659
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${
|
|
3660
|
-
<button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${
|
|
3661
|
-
<button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${
|
|
3662
|
-
<button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${
|
|
3719
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="crop" data-i18n-title="tool.crop" data-i18n-aria="tool.crop">${F.crop}</button>
|
|
3720
|
+
<button class="nf-reset-crop nf-icon-btn" type="button" data-i18n-title="tool.resetCrop" data-i18n-aria="tool.resetCrop" hidden>${F.resetCrop}</button>
|
|
3721
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="arrow" data-i18n-title="tool.arrow" data-i18n-aria="tool.arrow">${F.arrow}</button>
|
|
3722
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="rect" data-i18n-title="tool.rect" data-i18n-aria="tool.rect">${F.rect}</button>
|
|
3723
|
+
<button class="nf-tool nf-icon-btn" type="button" data-tool="circle" data-i18n-title="tool.circle" data-i18n-aria="tool.circle">${F.circle}</button>
|
|
3724
|
+
<button class="nf-discard-shot nf-icon-btn" type="button" data-i18n-title="tool.discard" data-i18n-aria="tool.discard">${F.discard}</button>
|
|
3725
|
+
<button class="nf-recapture nf-icon-btn" type="button" data-i18n-title="tool.recapture" data-i18n-aria="tool.recapture">${F.recapture}</button>
|
|
3663
3726
|
</div>
|
|
3664
3727
|
<div class="nf-canvas"></div>
|
|
3665
3728
|
</div>
|
|
@@ -3669,7 +3732,7 @@ function Xe() {
|
|
|
3669
3732
|
<div class="nf-kind"></div>
|
|
3670
3733
|
<div class="nf-privacy-summary">
|
|
3671
3734
|
<span class="nf-privacy-text"></span>
|
|
3672
|
-
<button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${
|
|
3735
|
+
<button class="nf-privacy-change nf-icon-btn" type="button" data-i18n-title="tool.privacy" data-i18n-aria="tool.privacy" aria-expanded="false">${F.privacy}</button>
|
|
3673
3736
|
</div>
|
|
3674
3737
|
</div>
|
|
3675
3738
|
<div class="nf-privacy">
|
|
@@ -3679,9 +3742,9 @@ function Xe() {
|
|
|
3679
3742
|
</div>
|
|
3680
3743
|
</div>
|
|
3681
3744
|
<div class="nf-actions">
|
|
3682
|
-
<button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${
|
|
3683
|
-
<button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${
|
|
3684
|
-
<button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${
|
|
3745
|
+
<button class="nf-restore nf-icon-btn" type="button" data-i18n-title="tool.restore" data-i18n-aria="tool.restore" hidden>${F.resetCrop}</button>
|
|
3746
|
+
<button class="nf-audio nf-icon-btn" type="button" data-i18n-title="tool.audio" data-i18n-aria="tool.audio">${F.audio}</button>
|
|
3747
|
+
<button class="nf-video nf-icon-btn" type="button" data-i18n-title="tool.video" data-i18n-aria="tool.video">${F.video}</button>
|
|
3685
3748
|
<button class="nf-submit" type="button" data-i18n-text="form.submit"></button>
|
|
3686
3749
|
</div>
|
|
3687
3750
|
<div class="nf-status"></div>
|
|
@@ -3689,156 +3752,156 @@ function Xe() {
|
|
|
3689
3752
|
<p class="nf-success-msg" hidden aria-live="polite" data-i18n-text="form.success"></p>
|
|
3690
3753
|
<a class="nf-success-link" hidden target="_blank" rel="noopener noreferrer" data-i18n-aria="form.viewReport">
|
|
3691
3754
|
<span class="nf-success-link-label" data-i18n-text="form.viewReport"></span>
|
|
3692
|
-
${
|
|
3755
|
+
${F.openArrow}
|
|
3693
3756
|
</a>
|
|
3694
3757
|
</div>
|
|
3695
3758
|
</div>
|
|
3696
3759
|
<button class="nf-stop-video" type="button" hidden data-i18n-text="tool.stopVideo"></button>
|
|
3697
|
-
`, document.body.appendChild(
|
|
3698
|
-
launcher:
|
|
3699
|
-
dialog:
|
|
3700
|
-
panel:
|
|
3701
|
-
panelBody:
|
|
3702
|
-
successMsg:
|
|
3703
|
-
successLink:
|
|
3704
|
-
stage:
|
|
3705
|
-
palette:
|
|
3706
|
-
canvas:
|
|
3707
|
-
text:
|
|
3708
|
-
author:
|
|
3709
|
-
kindRow:
|
|
3710
|
-
kind:
|
|
3711
|
-
privacy:
|
|
3712
|
-
privacySummary:
|
|
3713
|
-
privacyText:
|
|
3714
|
-
privacyChange:
|
|
3715
|
-
privacyPanel:
|
|
3716
|
-
privacyScroll:
|
|
3717
|
-
privacyDone:
|
|
3718
|
-
actions:
|
|
3719
|
-
restore:
|
|
3720
|
-
status:
|
|
3721
|
-
audio:
|
|
3722
|
-
video:
|
|
3723
|
-
discard:
|
|
3724
|
-
recapture:
|
|
3725
|
-
stop:
|
|
3726
|
-
resetCrop:
|
|
3727
|
-
submit:
|
|
3760
|
+
`, document.body.appendChild(f), n = {
|
|
3761
|
+
launcher: y(".nf-launcher"),
|
|
3762
|
+
dialog: y(".nf-dialog"),
|
|
3763
|
+
panel: y(".nf-panel"),
|
|
3764
|
+
panelBody: y(".nf-panel-body"),
|
|
3765
|
+
successMsg: y(".nf-success-msg"),
|
|
3766
|
+
successLink: y(".nf-success-link"),
|
|
3767
|
+
stage: y(".nf-stage"),
|
|
3768
|
+
palette: y(".nf-palette"),
|
|
3769
|
+
canvas: y(".nf-canvas"),
|
|
3770
|
+
text: y(".nf-text"),
|
|
3771
|
+
author: y(".nf-author"),
|
|
3772
|
+
kindRow: y(".nf-kind-row"),
|
|
3773
|
+
kind: y(".nf-kind"),
|
|
3774
|
+
privacy: y(".nf-privacy"),
|
|
3775
|
+
privacySummary: y(".nf-privacy-summary"),
|
|
3776
|
+
privacyText: y(".nf-privacy-text"),
|
|
3777
|
+
privacyChange: y(".nf-privacy-change"),
|
|
3778
|
+
privacyPanel: y(".nf-privacy-panel"),
|
|
3779
|
+
privacyScroll: y(".nf-privacy-scroll"),
|
|
3780
|
+
privacyDone: y(".nf-privacy-done"),
|
|
3781
|
+
actions: y(".nf-actions"),
|
|
3782
|
+
restore: y(".nf-restore"),
|
|
3783
|
+
status: y(".nf-status"),
|
|
3784
|
+
audio: y(".nf-audio"),
|
|
3785
|
+
video: y(".nf-video"),
|
|
3786
|
+
discard: y(".nf-discard-shot"),
|
|
3787
|
+
recapture: y(".nf-recapture"),
|
|
3788
|
+
stop: y(".nf-stop-video"),
|
|
3789
|
+
resetCrop: y(".nf-reset-crop"),
|
|
3790
|
+
submit: y(".nf-submit"),
|
|
3728
3791
|
shot: null
|
|
3729
|
-
},
|
|
3792
|
+
}, Xi(), se()), f;
|
|
3730
3793
|
}
|
|
3731
|
-
function
|
|
3794
|
+
function se() {
|
|
3732
3795
|
var e;
|
|
3733
|
-
|
|
3734
|
-
t.label =
|
|
3735
|
-
}),
|
|
3796
|
+
f && (Jt(), f.dataset.theme = Zt(d.theme), f.lang = ye(), f.dir = Aa(ye()), d.hideLauncher ? f.setAttribute("data-nf-hidden-launcher", "") : f.removeAttribute("data-nf-hidden-launcher"), n.video && (n.video.hidden = !d.video), Ji(), V.length && V.forEach((t) => {
|
|
3797
|
+
t.label = p(`diag.${t.key}`);
|
|
3798
|
+
}), Yt(), _ ? at() : tt(), (e = n.dialog) != null && e.hidden && Se());
|
|
3736
3799
|
}
|
|
3737
|
-
function
|
|
3738
|
-
const e =
|
|
3739
|
-
locale:
|
|
3800
|
+
function Jt() {
|
|
3801
|
+
const e = ba({
|
|
3802
|
+
locale: d.locale == null ? void 0 : d.locale
|
|
3740
3803
|
});
|
|
3741
|
-
|
|
3742
|
-
}
|
|
3743
|
-
function
|
|
3744
|
-
if (
|
|
3745
|
-
e.title =
|
|
3746
|
-
}),
|
|
3747
|
-
e.setAttribute("aria-label",
|
|
3748
|
-
}),
|
|
3749
|
-
e.setAttribute("placeholder",
|
|
3750
|
-
}),
|
|
3751
|
-
e.textContent =
|
|
3804
|
+
Sa(d.translations), wa(e);
|
|
3805
|
+
}
|
|
3806
|
+
function Ji() {
|
|
3807
|
+
if (f && (f.querySelectorAll("[data-i18n-title]").forEach((e) => {
|
|
3808
|
+
e.title = p(e.getAttribute("data-i18n-title"));
|
|
3809
|
+
}), f.querySelectorAll("[data-i18n-aria]").forEach((e) => {
|
|
3810
|
+
e.setAttribute("aria-label", p(e.getAttribute("data-i18n-aria")));
|
|
3811
|
+
}), f.querySelectorAll("[data-i18n-placeholder]").forEach((e) => {
|
|
3812
|
+
e.setAttribute("placeholder", p(e.getAttribute("data-i18n-placeholder")));
|
|
3813
|
+
}), f.querySelectorAll("[data-i18n-text]").forEach((e) => {
|
|
3814
|
+
e.textContent = p(e.getAttribute("data-i18n-text"));
|
|
3752
3815
|
}), n.audio)) {
|
|
3753
3816
|
const e = n.audio.dataset.active === "true";
|
|
3754
|
-
|
|
3817
|
+
Ue(e);
|
|
3755
3818
|
}
|
|
3756
3819
|
}
|
|
3757
|
-
function
|
|
3758
|
-
if (
|
|
3820
|
+
function Yi(e) {
|
|
3821
|
+
if (d.kindsCustom)
|
|
3759
3822
|
return e.label;
|
|
3760
|
-
const t = `kind.${e.id}`, a =
|
|
3823
|
+
const t = `kind.${e.id}`, a = p(t);
|
|
3761
3824
|
return a === t ? e.label : a;
|
|
3762
3825
|
}
|
|
3763
|
-
function
|
|
3764
|
-
n.launcher && (n.launcher.hidden = !!
|
|
3826
|
+
function Se() {
|
|
3827
|
+
n.launcher && (n.launcher.hidden = !!d.hideLauncher);
|
|
3765
3828
|
}
|
|
3766
|
-
function
|
|
3767
|
-
n.launcher.addEventListener("click", () =>
|
|
3768
|
-
|
|
3769
|
-
}), document.addEventListener("keydown",
|
|
3829
|
+
function Xi() {
|
|
3830
|
+
n.launcher.addEventListener("click", () => ga()), y(".nf-dialog").addEventListener("click", (t) => {
|
|
3831
|
+
Pe && !xe || t.target === n.dialog && re();
|
|
3832
|
+
}), document.addEventListener("keydown", ua), f.querySelectorAll(".nf-tool").forEach((t) => {
|
|
3770
3833
|
t.addEventListener("click", () => de(t.dataset.tool));
|
|
3771
|
-
}), n.resetCrop.addEventListener("click",
|
|
3772
|
-
const e =
|
|
3834
|
+
}), n.resetCrop.addEventListener("click", ls), n.canvas.addEventListener("pointerdown", os), n.canvas.addEventListener("dragstart", (t) => t.preventDefault());
|
|
3835
|
+
const e = y(".nf-kind");
|
|
3773
3836
|
e && e.addEventListener("click", (t) => {
|
|
3774
3837
|
const a = t.target.closest("[data-kind]");
|
|
3775
|
-
a &&
|
|
3776
|
-
}), n.discard.addEventListener("click",
|
|
3777
|
-
|
|
3778
|
-
}), n.restore.addEventListener("click",
|
|
3779
|
-
|
|
3780
|
-
}),
|
|
3781
|
-
}
|
|
3782
|
-
function
|
|
3838
|
+
a && Xe(a.dataset.kind);
|
|
3839
|
+
}), n.discard.addEventListener("click", us), n.recapture.addEventListener("click", () => {
|
|
3840
|
+
ds().catch((t) => S(t.message || p("status.recaptureFailed")));
|
|
3841
|
+
}), n.restore.addEventListener("click", cs), n.audio.addEventListener("click", ps), n.video.addEventListener("click", gs), n.stop.addEventListener("click", () => le == null ? void 0 : le.stop()), n.privacyChange.addEventListener("click", () => Ee(!_)), n.privacyDone.addEventListener("click", () => Ee(!1)), n.privacyScroll.addEventListener("change", Es), y(".nf-submit").addEventListener("click", () => {
|
|
3842
|
+
ha().catch((t) => S(t.message || p("status.submitFailed")));
|
|
3843
|
+
}), Yt(), de(null);
|
|
3844
|
+
}
|
|
3845
|
+
function x(e) {
|
|
3783
3846
|
return String(e || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3784
3847
|
}
|
|
3785
|
-
function
|
|
3786
|
-
const e =
|
|
3848
|
+
function Yt() {
|
|
3849
|
+
const e = f == null ? void 0 : f.querySelector(".nf-kind");
|
|
3787
3850
|
if (!e)
|
|
3788
3851
|
return;
|
|
3789
|
-
const t = Array.isArray(
|
|
3790
|
-
e.innerHTML = t.map((
|
|
3791
|
-
const o = t.map((
|
|
3792
|
-
|
|
3852
|
+
const t = Array.isArray(d.kinds) && d.kinds.length ? d.kinds : Y;
|
|
3853
|
+
e.innerHTML = t.map((s) => `<button type="button" data-kind="${x(s.id)}">${x(Yi(s))}</button>`).join("");
|
|
3854
|
+
const o = t.map((s) => s.id).includes(J) ? J : Re(t);
|
|
3855
|
+
Xe(o);
|
|
3793
3856
|
}
|
|
3794
|
-
function
|
|
3795
|
-
|
|
3796
|
-
a.dataset.active = String(a.dataset.kind ===
|
|
3797
|
-
}),
|
|
3857
|
+
function Xe(e) {
|
|
3858
|
+
J = (d.kinds || Y).map((a) => a.id).includes(e) ? e : Re(d.kinds), f == null || f.querySelectorAll("[data-kind]").forEach((a) => {
|
|
3859
|
+
a.dataset.active = String(a.dataset.kind === J);
|
|
3860
|
+
}), es(J);
|
|
3798
3861
|
}
|
|
3799
|
-
function
|
|
3862
|
+
function Qi() {
|
|
3800
3863
|
try {
|
|
3801
|
-
return String(localStorage.getItem(
|
|
3864
|
+
return String(localStorage.getItem(_t) || "").trim().toLowerCase();
|
|
3802
3865
|
} catch {
|
|
3803
3866
|
return "";
|
|
3804
3867
|
}
|
|
3805
3868
|
}
|
|
3806
|
-
function
|
|
3869
|
+
function es(e) {
|
|
3807
3870
|
const t = String(e || "").trim().toLowerCase();
|
|
3808
3871
|
if (t)
|
|
3809
3872
|
try {
|
|
3810
|
-
localStorage.setItem(
|
|
3873
|
+
localStorage.setItem(_t, t);
|
|
3811
3874
|
} catch {
|
|
3812
3875
|
}
|
|
3813
3876
|
}
|
|
3814
|
-
function
|
|
3815
|
-
const e = (
|
|
3816
|
-
return t && e.includes(t) ? t :
|
|
3877
|
+
function ts() {
|
|
3878
|
+
const e = (d.kinds || Y).map((a) => a.id), t = Qi();
|
|
3879
|
+
return t && e.includes(t) ? t : Re(d.kinds);
|
|
3817
3880
|
}
|
|
3818
3881
|
function de(e) {
|
|
3819
|
-
|
|
3820
|
-
t.dataset.active = String(t.dataset.tool ===
|
|
3821
|
-
}), n.canvas && (n.canvas.dataset.draw =
|
|
3882
|
+
q = _i.has(e) ? e : null, M = null, f.querySelectorAll(".nf-tool").forEach((t) => {
|
|
3883
|
+
t.dataset.active = String(t.dataset.tool === q);
|
|
3884
|
+
}), n.canvas && (n.canvas.dataset.draw = q ? "true" : "false"), B() && O();
|
|
3822
3885
|
}
|
|
3823
|
-
function
|
|
3886
|
+
function St(e) {
|
|
3824
3887
|
return Math.min(1, Math.max(0, e));
|
|
3825
3888
|
}
|
|
3826
|
-
function
|
|
3889
|
+
function pe() {
|
|
3827
3890
|
return n.shot || n.canvas;
|
|
3828
3891
|
}
|
|
3829
|
-
function
|
|
3830
|
-
const t =
|
|
3892
|
+
function Ae(e) {
|
|
3893
|
+
const t = pe().getBoundingClientRect();
|
|
3831
3894
|
return {
|
|
3832
|
-
x:
|
|
3833
|
-
y:
|
|
3895
|
+
x: St((e.clientX - t.left) / Math.max(t.width, 1)),
|
|
3896
|
+
y: St((e.clientY - t.top) / Math.max(t.height, 1))
|
|
3834
3897
|
};
|
|
3835
3898
|
}
|
|
3836
|
-
function
|
|
3837
|
-
const t =
|
|
3899
|
+
function as(e) {
|
|
3900
|
+
const t = pe().getBoundingClientRect();
|
|
3838
3901
|
return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
|
|
3839
3902
|
}
|
|
3840
|
-
function
|
|
3841
|
-
const t =
|
|
3903
|
+
function Xt(e) {
|
|
3904
|
+
const t = Ae(e), a = A.crop();
|
|
3842
3905
|
return {
|
|
3843
3906
|
x: a.x + t.x * a.w,
|
|
3844
3907
|
y: a.y + t.y * a.h
|
|
@@ -3849,154 +3912,154 @@ function Le(e, t) {
|
|
|
3849
3912
|
return {
|
|
3850
3913
|
x: a,
|
|
3851
3914
|
y: o,
|
|
3852
|
-
w: Math.max(
|
|
3853
|
-
h: Math.max(
|
|
3915
|
+
w: Math.max(Ke, Math.abs(t.x - e.x)),
|
|
3916
|
+
h: Math.max(Ke, Math.abs(t.y - e.y))
|
|
3854
3917
|
};
|
|
3855
3918
|
}
|
|
3856
|
-
function
|
|
3857
|
-
|
|
3919
|
+
function Qe(e) {
|
|
3920
|
+
f && (e ? f.dataset.grabbing = "true" : delete f.dataset.grabbing);
|
|
3858
3921
|
}
|
|
3859
|
-
function
|
|
3922
|
+
function $e(e) {
|
|
3860
3923
|
try {
|
|
3861
3924
|
n.canvas.setPointerCapture(e.pointerId);
|
|
3862
3925
|
} catch {
|
|
3863
3926
|
}
|
|
3864
3927
|
}
|
|
3865
|
-
function
|
|
3866
|
-
window.addEventListener("pointermove",
|
|
3928
|
+
function He() {
|
|
3929
|
+
window.addEventListener("pointermove", ea), window.addEventListener("pointerup", Ce), window.addEventListener("pointercancel", Ce);
|
|
3867
3930
|
}
|
|
3868
|
-
function
|
|
3869
|
-
window.removeEventListener("pointermove",
|
|
3931
|
+
function Qt() {
|
|
3932
|
+
window.removeEventListener("pointermove", ea), window.removeEventListener("pointerup", Ce), window.removeEventListener("pointercancel", Ce);
|
|
3870
3933
|
}
|
|
3871
|
-
function
|
|
3872
|
-
if (e.button !== 0 || !
|
|
3934
|
+
function os(e) {
|
|
3935
|
+
if (e.button !== 0 || !B())
|
|
3873
3936
|
return;
|
|
3874
|
-
if (!e.target.closest(".nf-sticker") && !
|
|
3875
|
-
|
|
3937
|
+
if (!e.target.closest(".nf-sticker") && !as(e)) {
|
|
3938
|
+
M = null, O();
|
|
3876
3939
|
return;
|
|
3877
3940
|
}
|
|
3878
3941
|
const t = e.target.closest(".nf-handle"), a = e.target.closest(".nf-sticker");
|
|
3879
3942
|
if (a && a.dataset.preview !== "true") {
|
|
3880
|
-
e.preventDefault(), e.stopPropagation(),
|
|
3943
|
+
e.preventDefault(), e.stopPropagation(), M = a.dataset.id, $e(e), is({
|
|
3881
3944
|
kind: "sticker",
|
|
3882
|
-
id:
|
|
3945
|
+
id: M,
|
|
3883
3946
|
dir: (t == null ? void 0 : t.dataset.dir) || "move"
|
|
3884
|
-
}, e),
|
|
3947
|
+
}, e), O();
|
|
3885
3948
|
return;
|
|
3886
3949
|
}
|
|
3887
|
-
if (
|
|
3888
|
-
e.preventDefault(),
|
|
3950
|
+
if (M = null, q === "crop") {
|
|
3951
|
+
e.preventDefault(), $e(e), j = { kind: "crop", start: Ae(e), current: Ae(e) }, He(), O();
|
|
3889
3952
|
return;
|
|
3890
3953
|
}
|
|
3891
|
-
if (
|
|
3892
|
-
e.preventDefault(),
|
|
3893
|
-
const o =
|
|
3894
|
-
|
|
3954
|
+
if (q === "arrow" || q === "rect" || q === "circle") {
|
|
3955
|
+
e.preventDefault(), $e(e);
|
|
3956
|
+
const o = Xt(e);
|
|
3957
|
+
j = { kind: "sticker", type: q, start: o, current: o }, He(), O();
|
|
3895
3958
|
return;
|
|
3896
3959
|
}
|
|
3897
|
-
|
|
3960
|
+
O();
|
|
3898
3961
|
}
|
|
3899
|
-
function
|
|
3962
|
+
function is(e, t) {
|
|
3900
3963
|
t.preventDefault(), t.stopPropagation();
|
|
3901
|
-
const a =
|
|
3902
|
-
|
|
3964
|
+
const a = pe().getBoundingClientRect(), o = A.list().find((s) => s.id === e.id);
|
|
3965
|
+
E = {
|
|
3903
3966
|
...e,
|
|
3904
3967
|
startX: t.clientX,
|
|
3905
3968
|
startY: t.clientY,
|
|
3906
|
-
crop:
|
|
3969
|
+
crop: A.crop(),
|
|
3907
3970
|
sticker: o ? { ...o } : null,
|
|
3908
3971
|
rect: a
|
|
3909
|
-
},
|
|
3972
|
+
}, Qe(e.dir === "move" || e.dir === "start" || e.dir === "end"), He();
|
|
3910
3973
|
}
|
|
3911
|
-
function
|
|
3912
|
-
if (
|
|
3913
|
-
|
|
3974
|
+
function ea(e) {
|
|
3975
|
+
if (j) {
|
|
3976
|
+
j.current = j.kind === "crop" ? Ae(e) : Xt(e), O();
|
|
3914
3977
|
return;
|
|
3915
3978
|
}
|
|
3916
|
-
if (!
|
|
3979
|
+
if (!E)
|
|
3917
3980
|
return;
|
|
3918
|
-
const t = (e.clientX -
|
|
3981
|
+
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;
|
|
3919
3982
|
if (o) {
|
|
3920
|
-
if (
|
|
3921
|
-
|
|
3983
|
+
if (E.dir === "end")
|
|
3984
|
+
A.update(o.id, {
|
|
3922
3985
|
x2: o.x2 + t,
|
|
3923
3986
|
y2: o.y2 + a
|
|
3924
3987
|
});
|
|
3925
|
-
else if (
|
|
3926
|
-
|
|
3988
|
+
else if (E.dir === "start")
|
|
3989
|
+
A.update(o.id, {
|
|
3927
3990
|
x: o.x + t,
|
|
3928
3991
|
y: o.y + a
|
|
3929
3992
|
});
|
|
3930
|
-
else if (
|
|
3931
|
-
|
|
3993
|
+
else if (E.dir === "move")
|
|
3994
|
+
A.update(o.id, {
|
|
3932
3995
|
x: o.x + t,
|
|
3933
3996
|
y: o.y + a,
|
|
3934
3997
|
x2: (o.x2 || o.x) + t,
|
|
3935
3998
|
y2: (o.y2 || o.y) + a
|
|
3936
3999
|
});
|
|
3937
4000
|
else {
|
|
3938
|
-
const
|
|
3939
|
-
|
|
4001
|
+
const s = { x: o.x, y: o.y, w: o.w, h: o.h };
|
|
4002
|
+
ss(s, E.dir, t, a), A.update(o.id, s);
|
|
3940
4003
|
}
|
|
3941
|
-
|
|
4004
|
+
O();
|
|
3942
4005
|
}
|
|
3943
4006
|
}
|
|
3944
|
-
function
|
|
4007
|
+
function ss(e, t, a, o) {
|
|
3945
4008
|
if (t.includes("e") && (e.w = Math.max(0.04, e.w + a)), t.includes("s") && (e.h = Math.max(0.04, e.h + o)), t.includes("w")) {
|
|
3946
|
-
const
|
|
3947
|
-
e.x += e.w -
|
|
4009
|
+
const s = Math.max(0.04, e.w - a);
|
|
4010
|
+
e.x += e.w - s, e.w = s;
|
|
3948
4011
|
}
|
|
3949
4012
|
if (t.includes("n")) {
|
|
3950
|
-
const
|
|
3951
|
-
e.y += e.h -
|
|
4013
|
+
const s = Math.max(0.04, e.h - o);
|
|
4014
|
+
e.y += e.h - s, e.h = s;
|
|
3952
4015
|
}
|
|
3953
4016
|
}
|
|
3954
|
-
function
|
|
3955
|
-
if (
|
|
3956
|
-
|
|
4017
|
+
function Ce(e) {
|
|
4018
|
+
if (Qt(), Qe(!1), j) {
|
|
4019
|
+
rs();
|
|
3957
4020
|
return;
|
|
3958
4021
|
}
|
|
3959
|
-
if (
|
|
3960
|
-
if (
|
|
4022
|
+
if (E) {
|
|
4023
|
+
if (E.kind === "sticker") {
|
|
3961
4024
|
const t = n.canvas.getBoundingClientRect();
|
|
3962
|
-
(e.clientX < t.left - 24 || e.clientX > t.right + 24 || e.clientY < t.top - 24 || e.clientY > t.bottom + 24) && (
|
|
4025
|
+
(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);
|
|
3963
4026
|
}
|
|
3964
|
-
|
|
4027
|
+
E = null, O();
|
|
3965
4028
|
}
|
|
3966
4029
|
}
|
|
3967
|
-
function
|
|
3968
|
-
const e =
|
|
3969
|
-
if (
|
|
4030
|
+
function rs() {
|
|
4031
|
+
const e = j;
|
|
4032
|
+
if (j = null, !e)
|
|
3970
4033
|
return;
|
|
3971
4034
|
if (e.kind === "crop") {
|
|
3972
4035
|
const a = Le(e.start, e.current);
|
|
3973
|
-
if (Math.abs(e.current.x - e.start.x) <
|
|
3974
|
-
|
|
4036
|
+
if (Math.abs(e.current.x - e.start.x) < wt || Math.abs(e.current.y - e.start.y) < wt) {
|
|
4037
|
+
O();
|
|
3975
4038
|
return;
|
|
3976
4039
|
}
|
|
3977
|
-
const
|
|
3978
|
-
|
|
3979
|
-
x:
|
|
3980
|
-
y:
|
|
3981
|
-
w: a.w *
|
|
3982
|
-
h: a.h *
|
|
3983
|
-
}),
|
|
4040
|
+
const s = A.crop();
|
|
4041
|
+
A.setCrop({
|
|
4042
|
+
x: s.x + a.x * s.w,
|
|
4043
|
+
y: s.y + a.y * s.h,
|
|
4044
|
+
w: a.w * s.w,
|
|
4045
|
+
h: a.h * s.h
|
|
4046
|
+
}), ee();
|
|
3984
4047
|
return;
|
|
3985
4048
|
}
|
|
3986
|
-
const t =
|
|
3987
|
-
t && (
|
|
4049
|
+
const t = ns(e);
|
|
4050
|
+
t && (M = t.id), O();
|
|
3988
4051
|
}
|
|
3989
|
-
function
|
|
4052
|
+
function ns(e) {
|
|
3990
4053
|
if (e.type === "arrow") {
|
|
3991
4054
|
const t = e.current.x - e.start.x, a = e.current.y - e.start.y;
|
|
3992
|
-
return Math.hypot(t, a) <
|
|
4055
|
+
return Math.hypot(t, a) < Ke ? A.add("arrow", {
|
|
3993
4056
|
x: e.start.x,
|
|
3994
4057
|
y: e.start.y,
|
|
3995
4058
|
x2: e.start.x + 0.12,
|
|
3996
4059
|
y2: e.start.y,
|
|
3997
4060
|
w: 0.12,
|
|
3998
4061
|
h: 0.02
|
|
3999
|
-
}) :
|
|
4062
|
+
}) : A.add("arrow", {
|
|
4000
4063
|
x: e.start.x,
|
|
4001
4064
|
y: e.start.y,
|
|
4002
4065
|
x2: e.current.x,
|
|
@@ -4005,121 +4068,121 @@ function er(e) {
|
|
|
4005
4068
|
h: Math.abs(a)
|
|
4006
4069
|
});
|
|
4007
4070
|
}
|
|
4008
|
-
return
|
|
4071
|
+
return A.add(e.type, Le(e.start, e.current));
|
|
4009
4072
|
}
|
|
4010
|
-
function
|
|
4011
|
-
|
|
4073
|
+
function ls() {
|
|
4074
|
+
A.resetCrop(), M = null, ee();
|
|
4012
4075
|
}
|
|
4013
4076
|
function ze() {
|
|
4014
|
-
n.resetCrop && (n.resetCrop.hidden = !
|
|
4077
|
+
n.resetCrop && (n.resetCrop.hidden = !A.isCropped());
|
|
4015
4078
|
}
|
|
4016
|
-
function
|
|
4079
|
+
function Ue(e) {
|
|
4017
4080
|
if (!n.audio)
|
|
4018
4081
|
return;
|
|
4019
|
-
const t =
|
|
4082
|
+
const t = p(e ? "tool.audioStop" : "tool.audio");
|
|
4020
4083
|
n.audio.title = t, n.audio.setAttribute("aria-label", t), n.audio.dataset.active = String(!!e);
|
|
4021
4084
|
}
|
|
4022
|
-
function
|
|
4023
|
-
return
|
|
4085
|
+
function B() {
|
|
4086
|
+
return Z(H);
|
|
4024
4087
|
}
|
|
4025
|
-
function
|
|
4088
|
+
function ge() {
|
|
4026
4089
|
if (!n.stage || !n.palette || !n.actions || !n.recapture)
|
|
4027
4090
|
return;
|
|
4028
|
-
const e =
|
|
4029
|
-
n.stage.hidden = !e && !
|
|
4091
|
+
const e = B();
|
|
4092
|
+
n.stage.hidden = !e && !K, n.palette.hidden = !e, n.discard && (n.discard.hidden = !e), n.restore && (n.restore.hidden = e || !ie), e ? (n.palette.appendChild(n.discard), n.palette.appendChild(n.recapture)) : n.audio ? n.audio.after(n.recapture) : n.actions.insertBefore(n.recapture, n.submit || null), n.recapture.hidden = !1;
|
|
4030
4093
|
}
|
|
4031
|
-
function
|
|
4032
|
-
|
|
4094
|
+
function us() {
|
|
4095
|
+
B() && (ie = H), H = "", de(null), ge(), ee();
|
|
4033
4096
|
}
|
|
4034
|
-
function
|
|
4035
|
-
|
|
4097
|
+
function cs() {
|
|
4098
|
+
Z(ie) && (H = ie, ge(), ee());
|
|
4036
4099
|
}
|
|
4037
|
-
function
|
|
4100
|
+
function ta() {
|
|
4038
4101
|
return {
|
|
4039
|
-
capture: typeof
|
|
4040
|
-
onBeforeCapture: typeof
|
|
4102
|
+
capture: typeof d.capture == "function" ? d.capture : void 0,
|
|
4103
|
+
onBeforeCapture: typeof d.onBeforeCapture == "function" ? d.onBeforeCapture : void 0
|
|
4041
4104
|
};
|
|
4042
4105
|
}
|
|
4043
|
-
function
|
|
4044
|
-
if (!
|
|
4045
|
-
throw new Error(
|
|
4046
|
-
|
|
4106
|
+
function aa(e) {
|
|
4107
|
+
if (!Z(e))
|
|
4108
|
+
throw new Error(p("status.screenshotFailed"));
|
|
4109
|
+
H = e, ie = e, A = Je(), G = { w: 0, h: 0 }, M = null, j = null, E = null, de(null);
|
|
4047
4110
|
}
|
|
4048
|
-
async function
|
|
4049
|
-
if (!(
|
|
4050
|
-
|
|
4111
|
+
async function ds() {
|
|
4112
|
+
if (!(Ie || !n.dialog || n.dialog.hidden)) {
|
|
4113
|
+
Ie = !0, n.recapture.disabled = !0, S(p("status.capturing"), !0), n.dialog.hidden = !0;
|
|
4051
4114
|
try {
|
|
4052
4115
|
let e = "";
|
|
4053
4116
|
try {
|
|
4054
|
-
e = await
|
|
4117
|
+
e = await pi();
|
|
4055
4118
|
} catch {
|
|
4056
|
-
e = await
|
|
4119
|
+
e = await Vt(ta());
|
|
4057
4120
|
}
|
|
4058
|
-
|
|
4121
|
+
aa(e), S("");
|
|
4059
4122
|
} catch (e) {
|
|
4060
|
-
|
|
4123
|
+
S((e == null ? void 0 : e.message) || p("status.screenshotFailed"));
|
|
4061
4124
|
} finally {
|
|
4062
|
-
n.dialog.hidden = !1, n.recapture.disabled = !1,
|
|
4125
|
+
n.dialog.hidden = !1, n.recapture.disabled = !1, Ie = !1, ge(), ee();
|
|
4063
4126
|
}
|
|
4064
4127
|
}
|
|
4065
4128
|
}
|
|
4066
|
-
function
|
|
4129
|
+
function ps() {
|
|
4067
4130
|
try {
|
|
4068
|
-
if (
|
|
4131
|
+
if (Q || (Q = zi((t) => {
|
|
4069
4132
|
const a = n.text.value.trim();
|
|
4070
4133
|
n.text.value = a ? `${a} ${t}` : t;
|
|
4071
|
-
})), !
|
|
4072
|
-
|
|
4134
|
+
})), !Q.isSupported()) {
|
|
4135
|
+
S(p("status.audioUnsupported"));
|
|
4073
4136
|
return;
|
|
4074
4137
|
}
|
|
4075
|
-
const e =
|
|
4076
|
-
|
|
4138
|
+
const e = Q.start({ lang: ye() });
|
|
4139
|
+
Ue(e), S(e ? p("status.listening") : "");
|
|
4077
4140
|
} catch (e) {
|
|
4078
|
-
|
|
4141
|
+
S(e.message);
|
|
4079
4142
|
}
|
|
4080
4143
|
}
|
|
4081
|
-
async function
|
|
4082
|
-
if (!
|
|
4083
|
-
|
|
4144
|
+
async function gs() {
|
|
4145
|
+
if (!d.video) {
|
|
4146
|
+
S(p("status.videoDisabled"));
|
|
4084
4147
|
return;
|
|
4085
4148
|
}
|
|
4086
|
-
n.dialog.hidden = !0, n.stop.hidden = !1,
|
|
4149
|
+
n.dialog.hidden = !0, n.stop.hidden = !1, se(), n.launcher.hidden = !0, le = ji({
|
|
4087
4150
|
onStart() {
|
|
4088
4151
|
},
|
|
4089
4152
|
onStop(e) {
|
|
4090
|
-
|
|
4153
|
+
K = e, n.stop.hidden = !0, Se(), n.dialog.hidden = !1, ge(), ee(), S(p(e ? "status.videoAttached" : "status.recordingCancelled"));
|
|
4091
4154
|
},
|
|
4092
4155
|
onError(e) {
|
|
4093
|
-
|
|
4156
|
+
S(e.message);
|
|
4094
4157
|
}
|
|
4095
4158
|
});
|
|
4096
4159
|
try {
|
|
4097
|
-
await
|
|
4160
|
+
await le.start();
|
|
4098
4161
|
} catch (e) {
|
|
4099
|
-
n.stop.hidden = !0,
|
|
4162
|
+
n.stop.hidden = !0, Se(), n.dialog.hidden = !1, S(e.message);
|
|
4100
4163
|
}
|
|
4101
4164
|
}
|
|
4102
|
-
function
|
|
4103
|
-
if (n.shot = null, !
|
|
4104
|
-
n.canvas.style.removeProperty("--nf-shot-aspect"), n.canvas.style.removeProperty("aspect-ratio"), n.canvas.innerHTML =
|
|
4165
|
+
function ee() {
|
|
4166
|
+
if (n.shot = null, !B()) {
|
|
4167
|
+
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>` : "", ze();
|
|
4105
4168
|
return;
|
|
4106
4169
|
}
|
|
4107
|
-
n.canvas.innerHTML = `<div class="nf-shot"><img alt="${
|
|
4170
|
+
n.canvas.innerHTML = `<div class="nf-shot"><img alt="${x(p("shot.alt"))}" src="${H}" draggable="false"></div>`, n.shot = n.canvas.querySelector(".nf-shot");
|
|
4108
4171
|
const e = n.shot.querySelector("img");
|
|
4109
4172
|
e.draggable = !1, e.addEventListener("dragstart", (a) => a.preventDefault());
|
|
4110
4173
|
const t = () => {
|
|
4111
|
-
|
|
4174
|
+
ms(e), O();
|
|
4112
4175
|
};
|
|
4113
4176
|
e.addEventListener("load", t), e.complete && e.naturalWidth && t(), ze();
|
|
4114
4177
|
}
|
|
4115
|
-
function
|
|
4116
|
-
const t = e.naturalWidth ||
|
|
4117
|
-
if (t && a && (
|
|
4178
|
+
function ms(e) {
|
|
4179
|
+
const t = e.naturalWidth || G.w, a = e.naturalHeight || G.h;
|
|
4180
|
+
if (t && a && (G = { w: t, h: a }, n.canvas.style.setProperty("--nf-shot-aspect", String(t / a)), n.canvas.style.aspectRatio = `${t} / ${a}`), !n.shot || !G.w || !G.h)
|
|
4118
4181
|
return;
|
|
4119
|
-
const o =
|
|
4120
|
-
n.shot.style.left = `${(1 -
|
|
4182
|
+
const o = A.crop(), s = G.w / G.h, i = o.w / o.h * s, r = Math.min(1, i / s), l = Math.min(1, s / i);
|
|
4183
|
+
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}%`;
|
|
4121
4184
|
}
|
|
4122
|
-
function
|
|
4185
|
+
function hs(e) {
|
|
4123
4186
|
return e.type === "arrow" ? {
|
|
4124
4187
|
id: "preview",
|
|
4125
4188
|
type: "arrow",
|
|
@@ -4137,63 +4200,63 @@ function lr(e) {
|
|
|
4137
4200
|
...Le(e.start, e.current)
|
|
4138
4201
|
};
|
|
4139
4202
|
}
|
|
4140
|
-
function
|
|
4141
|
-
if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !
|
|
4203
|
+
function O() {
|
|
4204
|
+
if ((n.shot || n.canvas).querySelectorAll(".nf-sticker, .nf-crop").forEach((i) => i.remove()), !B() || !n.shot) {
|
|
4142
4205
|
ze();
|
|
4143
4206
|
return;
|
|
4144
4207
|
}
|
|
4145
|
-
const t =
|
|
4146
|
-
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`), (
|
|
4208
|
+
const t = A.crop(), a = pe(), o = Nt(a.clientWidth || 400);
|
|
4209
|
+
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") {
|
|
4147
4210
|
const i = document.createElement("div");
|
|
4148
|
-
i.className = "nf-crop",
|
|
4211
|
+
i.className = "nf-crop", At(i, Le(j.start, j.current), { x: 0, y: 0, w: 1, h: 1 }), n.shot.appendChild(i);
|
|
4149
4212
|
}
|
|
4150
|
-
const
|
|
4151
|
-
if ((
|
|
4152
|
-
const
|
|
4153
|
-
if (u.className = `nf-sticker nf-${i.type}`, u.dataset.id = i.id, l && (u.dataset.selected = "true"),
|
|
4154
|
-
const
|
|
4155
|
-
|
|
4213
|
+
const s = A.list().slice();
|
|
4214
|
+
if ((j == null ? void 0 : j.kind) === "sticker" && s.push(hs(j)), s.forEach((i) => {
|
|
4215
|
+
const r = i.id === "preview", l = !r && i.id === M, u = document.createElement("div");
|
|
4216
|
+
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" ? fs(u, i, t, l, o) : (At(u, i, t), l && ["nw", "ne", "sw", "se"].forEach((c) => Ge(u, c))), !r && i.number) {
|
|
4217
|
+
const c = document.createElement("span");
|
|
4218
|
+
c.className = "nf-badge", c.textContent = String(i.number), u.appendChild(c);
|
|
4156
4219
|
}
|
|
4157
4220
|
n.shot.appendChild(u);
|
|
4158
|
-
}), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()),
|
|
4221
|
+
}), n.canvas.querySelectorAll(":scope > .nf-recording-preview").forEach((i) => i.remove()), K) {
|
|
4159
4222
|
const i = document.createElement("video");
|
|
4160
|
-
i.className = "nf-recording-preview", i.controls = !0, i.src = URL.createObjectURL(
|
|
4223
|
+
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);
|
|
4161
4224
|
}
|
|
4162
4225
|
ze();
|
|
4163
4226
|
}
|
|
4164
|
-
function
|
|
4165
|
-
const i =
|
|
4166
|
-
e.style.left = `${
|
|
4167
|
-
<line class="nf-arrow-hit" x1="${
|
|
4168
|
-
<line class="nf-arrow-shaft" x1="${
|
|
4169
|
-
<polygon class="nf-arrow-head" points="${
|
|
4170
|
-
`, e.appendChild(
|
|
4227
|
+
function fs(e, t, a, o, s = Nt(400)) {
|
|
4228
|
+
const i = pe(), 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, T = u - w, $ = c - b, P = g - w, m = v - b, C = Ui(T, $, P, m, s), X = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
4229
|
+
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 = `
|
|
4230
|
+
<line class="nf-arrow-hit" x1="${T}" y1="${$}" x2="${P}" y2="${m}" />
|
|
4231
|
+
<line class="nf-arrow-shaft" x1="${T}" y1="${$}" x2="${C.shaftEnd.x}" y2="${C.shaftEnd.y}" />
|
|
4232
|
+
<polygon class="nf-arrow-head" points="${C.tipX},${C.tipY} ${C.left.x},${C.left.y} ${C.right.x},${C.right.y}" />
|
|
4233
|
+
`, e.appendChild(X), o && (Ge(e, "start", { left: T - 5, top: $ - 5 }), Ge(e, "end", { left: P - 5, top: m - 5 }));
|
|
4171
4234
|
}
|
|
4172
|
-
function
|
|
4235
|
+
function Ge(e, t, a) {
|
|
4173
4236
|
const o = document.createElement("span");
|
|
4174
4237
|
o.className = "nf-handle", o.dataset.dir = t, a && (o.style.left = `${a.left}px`, o.style.top = `${a.top}px`), e.appendChild(o);
|
|
4175
4238
|
}
|
|
4176
|
-
function
|
|
4239
|
+
function At(e, t, a) {
|
|
4177
4240
|
e.style.left = `${(t.x - a.x) / a.w * 100}%`, e.style.top = `${(t.y - a.y) / a.h * 100}%`, e.style.width = `${t.w / a.w * 100}%`, e.style.height = `${t.h / a.h * 100}%`;
|
|
4178
4241
|
}
|
|
4179
|
-
function
|
|
4242
|
+
function oa() {
|
|
4180
4243
|
try {
|
|
4181
|
-
return String(localStorage.getItem(
|
|
4244
|
+
return String(localStorage.getItem(qt) || "").trim();
|
|
4182
4245
|
} catch {
|
|
4183
4246
|
return "";
|
|
4184
4247
|
}
|
|
4185
4248
|
}
|
|
4186
|
-
function
|
|
4249
|
+
function ys(e) {
|
|
4187
4250
|
const t = String(e || "").trim();
|
|
4188
|
-
if (!(!t || t ===
|
|
4251
|
+
if (!(!t || t === qe()))
|
|
4189
4252
|
try {
|
|
4190
|
-
localStorage.setItem(
|
|
4253
|
+
localStorage.setItem(qt, t);
|
|
4191
4254
|
} catch {
|
|
4192
4255
|
}
|
|
4193
4256
|
}
|
|
4194
|
-
function
|
|
4257
|
+
function ia() {
|
|
4195
4258
|
try {
|
|
4196
|
-
const e = localStorage.getItem(
|
|
4259
|
+
const e = localStorage.getItem(Wt);
|
|
4197
4260
|
if (!e)
|
|
4198
4261
|
return { diagnostics: !1, logs: !1 };
|
|
4199
4262
|
const t = JSON.parse(e);
|
|
@@ -4205,81 +4268,81 @@ function ta() {
|
|
|
4205
4268
|
return { diagnostics: !1, logs: !1 };
|
|
4206
4269
|
}
|
|
4207
4270
|
}
|
|
4208
|
-
function
|
|
4271
|
+
function Ct(e = {}) {
|
|
4209
4272
|
const t = {
|
|
4210
|
-
...
|
|
4273
|
+
...ia(),
|
|
4211
4274
|
...e
|
|
4212
4275
|
};
|
|
4213
4276
|
try {
|
|
4214
|
-
localStorage.setItem(
|
|
4277
|
+
localStorage.setItem(Wt, JSON.stringify({
|
|
4215
4278
|
diagnostics: !!t.diagnostics,
|
|
4216
4279
|
logs: !!t.logs
|
|
4217
4280
|
}));
|
|
4218
4281
|
} catch {
|
|
4219
4282
|
}
|
|
4220
4283
|
}
|
|
4221
|
-
function
|
|
4222
|
-
return !!(String(
|
|
4284
|
+
function sa() {
|
|
4285
|
+
return !!(String(N.userId || "").trim() || String(N.email || "").trim() || String(N.displayName || "").trim());
|
|
4223
4286
|
}
|
|
4224
|
-
function
|
|
4287
|
+
function ra() {
|
|
4225
4288
|
return String(
|
|
4226
|
-
|
|
4289
|
+
N.displayName || N.email || N.userId || ""
|
|
4227
4290
|
).trim();
|
|
4228
4291
|
}
|
|
4229
|
-
function
|
|
4230
|
-
return
|
|
4292
|
+
function qe() {
|
|
4293
|
+
return p("form.authorPlaceholder");
|
|
4231
4294
|
}
|
|
4232
|
-
function
|
|
4295
|
+
function vs() {
|
|
4233
4296
|
var t;
|
|
4234
|
-
if (
|
|
4235
|
-
return
|
|
4297
|
+
if (sa())
|
|
4298
|
+
return ra() || qe();
|
|
4236
4299
|
const e = String(((t = n.author) == null ? void 0 : t.value) || "").trim();
|
|
4237
|
-
return e ? (
|
|
4300
|
+
return e ? (ys(e), e) : qe();
|
|
4238
4301
|
}
|
|
4239
|
-
function
|
|
4302
|
+
function na() {
|
|
4240
4303
|
if (!n.author)
|
|
4241
4304
|
return;
|
|
4242
|
-
const e =
|
|
4305
|
+
const e = sa();
|
|
4243
4306
|
if (n.author.hidden = e, e) {
|
|
4244
4307
|
n.author.value = "";
|
|
4245
4308
|
return;
|
|
4246
4309
|
}
|
|
4247
|
-
n.author.value =
|
|
4310
|
+
n.author.value = oa();
|
|
4248
4311
|
}
|
|
4249
|
-
function
|
|
4312
|
+
function la(e, t = Gt) {
|
|
4250
4313
|
const a = Number(e);
|
|
4251
|
-
return Number.isFinite(a) ? Math.min(
|
|
4314
|
+
return Number.isFinite(a) ? Math.min(Zi, Math.max(0, Math.floor(a))) : t;
|
|
4252
4315
|
}
|
|
4253
|
-
function
|
|
4254
|
-
e.key !== "Escape" || !n.dialog || n.dialog.hidden ||
|
|
4316
|
+
function ua(e) {
|
|
4317
|
+
e.key !== "Escape" || !n.dialog || n.dialog.hidden || Pe && !xe || re();
|
|
4255
4318
|
}
|
|
4256
|
-
function
|
|
4257
|
-
|
|
4319
|
+
function ca(e = {}) {
|
|
4320
|
+
yi(e);
|
|
4258
4321
|
const t = Object.prototype.hasOwnProperty.call(e, "kinds");
|
|
4259
|
-
|
|
4260
|
-
...
|
|
4261
|
-
endpoint: String(e.endpoint ||
|
|
4262
|
-
projectKey: e.projectKey == null ?
|
|
4263
|
-
version: e.version == null ?
|
|
4264
|
-
name: e.name == null ?
|
|
4265
|
-
targets: e.targets === void 0 ?
|
|
4266
|
-
hideLauncher: e.hideLauncher == null ?
|
|
4267
|
-
theme:
|
|
4268
|
-
video: e.video == null ?
|
|
4269
|
-
consoleLogLimit: e.consoleLogLimit == null ?
|
|
4270
|
-
kinds: t ?
|
|
4271
|
-
kindsCustom: t ? !0 :
|
|
4272
|
-
capture: e.capture === void 0 ?
|
|
4273
|
-
onBeforeCapture: e.onBeforeCapture === void 0 ?
|
|
4274
|
-
onOpen: e.onOpen === void 0 ?
|
|
4275
|
-
onClose: e.onClose === void 0 ?
|
|
4276
|
-
displayLink: e.displayLink == null ?
|
|
4277
|
-
locale: e.locale === void 0 ?
|
|
4278
|
-
translations: e.translations === void 0 ?
|
|
4322
|
+
d = {
|
|
4323
|
+
...d,
|
|
4324
|
+
endpoint: String(e.endpoint || d.endpoint || "").replace(/\/$/, ""),
|
|
4325
|
+
projectKey: e.projectKey == null ? d.projectKey : String(e.projectKey),
|
|
4326
|
+
version: e.version == null ? d.version : String(e.version),
|
|
4327
|
+
name: e.name == null ? d.name : String(e.name || ""),
|
|
4328
|
+
targets: e.targets === void 0 ? d.targets : e.targets,
|
|
4329
|
+
hideLauncher: e.hideLauncher == null ? d.hideLauncher : !!e.hideLauncher,
|
|
4330
|
+
theme: Zt(e.theme ?? d.theme),
|
|
4331
|
+
video: e.video == null ? d.video : !!e.video,
|
|
4332
|
+
consoleLogLimit: e.consoleLogLimit == null ? d.consoleLogLimit : la(e.consoleLogLimit, d.consoleLogLimit),
|
|
4333
|
+
kinds: t ? Gi(e.kinds) : d.kinds,
|
|
4334
|
+
kindsCustom: t ? !0 : d.kindsCustom,
|
|
4335
|
+
capture: e.capture === void 0 ? d.capture : e.capture,
|
|
4336
|
+
onBeforeCapture: e.onBeforeCapture === void 0 ? d.onBeforeCapture : e.onBeforeCapture,
|
|
4337
|
+
onOpen: e.onOpen === void 0 ? d.onOpen : e.onOpen,
|
|
4338
|
+
onClose: e.onClose === void 0 ? d.onClose : e.onClose,
|
|
4339
|
+
displayLink: e.displayLink == null ? d.displayLink : !!e.displayLink,
|
|
4340
|
+
locale: e.locale === void 0 ? d.locale : e.locale == null || e.locale === "" ? null : String(e.locale),
|
|
4341
|
+
translations: e.translations === void 0 ? d.translations : e.translations && typeof e.translations == "object" ? e.translations : null
|
|
4279
4342
|
};
|
|
4280
4343
|
}
|
|
4281
|
-
function
|
|
4282
|
-
const t =
|
|
4344
|
+
function da(e) {
|
|
4345
|
+
const t = d[e];
|
|
4283
4346
|
if (typeof t == "function")
|
|
4284
4347
|
try {
|
|
4285
4348
|
t();
|
|
@@ -4287,282 +4350,325 @@ function la(e) {
|
|
|
4287
4350
|
console.warn(`Notefully.${e} failed:`, a);
|
|
4288
4351
|
}
|
|
4289
4352
|
}
|
|
4290
|
-
function
|
|
4291
|
-
return
|
|
4353
|
+
function ks() {
|
|
4354
|
+
return ce;
|
|
4292
4355
|
}
|
|
4293
|
-
function
|
|
4294
|
-
return
|
|
4356
|
+
function bs() {
|
|
4357
|
+
return ye();
|
|
4295
4358
|
}
|
|
4296
|
-
function
|
|
4297
|
-
return
|
|
4359
|
+
function ws(e, t) {
|
|
4360
|
+
return d.locale = e == null || e === "" ? null : String(e), t !== void 0 && (d.translations = t && typeof t == "object" ? t : null), f ? se() : Jt(), Te;
|
|
4298
4361
|
}
|
|
4299
|
-
function
|
|
4300
|
-
return
|
|
4362
|
+
function et(e = {}) {
|
|
4363
|
+
return ca(e), f && se(), Te;
|
|
4301
4364
|
}
|
|
4302
|
-
function
|
|
4303
|
-
return
|
|
4365
|
+
function Ss(e = {}) {
|
|
4366
|
+
return ca(e), Ye(), se(), Te;
|
|
4304
4367
|
}
|
|
4305
|
-
function
|
|
4306
|
-
return
|
|
4368
|
+
function As(e) {
|
|
4369
|
+
return et({ theme: e });
|
|
4307
4370
|
}
|
|
4308
|
-
function
|
|
4371
|
+
function Cs(e) {
|
|
4309
4372
|
const t = !!e;
|
|
4310
|
-
return !t &&
|
|
4373
|
+
return !t && f && n.dialog && !n.dialog.hidden && re(), et({ hideLauncher: !t });
|
|
4311
4374
|
}
|
|
4312
|
-
function
|
|
4313
|
-
const e =
|
|
4314
|
-
...
|
|
4315
|
-
displayName:
|
|
4375
|
+
function zs() {
|
|
4376
|
+
const e = ra() || oa() || void 0, t = hi({
|
|
4377
|
+
...N,
|
|
4378
|
+
displayName: N.displayName || e
|
|
4316
4379
|
});
|
|
4317
|
-
|
|
4318
|
-
|
|
4380
|
+
V = Vi(t), I = $i(
|
|
4381
|
+
Ht.snapshot().slice(-la(d.consoleLogLimit))
|
|
4319
4382
|
);
|
|
4320
|
-
const a =
|
|
4321
|
-
a.diagnostics &&
|
|
4383
|
+
const a = ia();
|
|
4384
|
+
a.diagnostics && we(V, !0), a.logs && I.length && we(I, !0), _ = !1;
|
|
4322
4385
|
}
|
|
4323
|
-
function
|
|
4324
|
-
|
|
4386
|
+
function Ee(e) {
|
|
4387
|
+
_ = !!e, n.privacyPanel && (n.privacyPanel.hidden = !_), n.privacyChange && (n.privacyChange.setAttribute("aria-expanded", _ ? "true" : "false"), n.privacyChange.dataset.active = String(_)), _ && at();
|
|
4325
4388
|
}
|
|
4326
|
-
function
|
|
4389
|
+
function tt() {
|
|
4327
4390
|
if (!n.privacy || !n.privacyText || !n.privacyChange)
|
|
4328
4391
|
return;
|
|
4329
|
-
const e =
|
|
4330
|
-
diagnostics:
|
|
4331
|
-
logs:
|
|
4392
|
+
const e = Ni({
|
|
4393
|
+
diagnostics: V,
|
|
4394
|
+
logs: I
|
|
4332
4395
|
});
|
|
4333
4396
|
n.privacyText.textContent = e, n.privacyText.hidden = !e;
|
|
4334
|
-
const t =
|
|
4397
|
+
const t = V.length === 0 && I.length === 0;
|
|
4335
4398
|
n.privacySummary && (n.privacySummary.hidden = t), n.privacy.hidden = t, n.privacyChange.hidden = !1;
|
|
4336
4399
|
}
|
|
4337
|
-
function
|
|
4400
|
+
function pa(e, t, a) {
|
|
4338
4401
|
return `<label class="nf-privacy-toggle">
|
|
4339
|
-
<span class="nf-privacy-toggle-label">${
|
|
4340
|
-
<input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${
|
|
4402
|
+
<span class="nf-privacy-toggle-label">${x(p("privacy.redact"))}</span>
|
|
4403
|
+
<input type="checkbox" ${e ? "checked" : ""} ${t ? 'data-indeterminate="true"' : ""} aria-label="${x(a)}">
|
|
4341
4404
|
</label>`;
|
|
4342
4405
|
}
|
|
4343
|
-
function
|
|
4344
|
-
const
|
|
4345
|
-
if (
|
|
4346
|
-
const
|
|
4347
|
-
return `<div class="nf-privacy-row" data-kind="${
|
|
4406
|
+
function zt(e, t, a, o, s, i = null) {
|
|
4407
|
+
const r = pa(s, !1, `${p("privacy.redact")} ${a}`), l = typeof o == "string" ? o : String(o || "");
|
|
4408
|
+
if (s) {
|
|
4409
|
+
const c = l ? `${a}: ${l}` : a;
|
|
4410
|
+
return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}" data-redacted="true">
|
|
4348
4411
|
<div class="nf-privacy-row-text">
|
|
4349
|
-
<div class="nf-privacy-row-summary" title="${
|
|
4412
|
+
<div class="nf-privacy-row-summary" title="${x(c)}">${x(c)}</div>
|
|
4350
4413
|
</div>
|
|
4351
|
-
${
|
|
4414
|
+
${r}
|
|
4352
4415
|
</div>`;
|
|
4353
4416
|
}
|
|
4354
|
-
|
|
4417
|
+
const u = i ?? x(l);
|
|
4418
|
+
return `<div class="nf-privacy-row" data-kind="${x(e)}" data-id="${x(t)}">
|
|
4355
4419
|
<div class="nf-privacy-row-text">
|
|
4356
|
-
<div class="nf-privacy-row-title">${
|
|
4357
|
-
<div class="nf-privacy-row-detail">${
|
|
4420
|
+
<div class="nf-privacy-row-title">${x(a)}</div>
|
|
4421
|
+
<div class="nf-privacy-row-detail">${u}</div>
|
|
4358
4422
|
</div>
|
|
4359
|
-
${
|
|
4423
|
+
${r}
|
|
4360
4424
|
</div>`;
|
|
4361
4425
|
}
|
|
4362
|
-
function
|
|
4426
|
+
function Et(e, t, a, o) {
|
|
4363
4427
|
if (!a.length)
|
|
4364
4428
|
return "";
|
|
4365
|
-
const
|
|
4366
|
-
return `<section class="nf-privacy-section" data-section="${
|
|
4429
|
+
const s = Bi(a), i = s.checked && !s.indeterminate;
|
|
4430
|
+
return `<section class="nf-privacy-section" data-section="${x(e)}"${i ? ' data-redacted="true"' : ""}>
|
|
4367
4431
|
<div class="nf-privacy-section-head">
|
|
4368
|
-
<h3 class="nf-privacy-section-title">${
|
|
4369
|
-
${
|
|
4432
|
+
<h3 class="nf-privacy-section-title">${x(t)}</h3>
|
|
4433
|
+
${pa(s.checked, s.indeterminate, `${p("privacy.redact")} ${t}`)}
|
|
4370
4434
|
</div>
|
|
4371
4435
|
<div class="nf-privacy-rows"${i ? " hidden" : ""}>${o}</div>
|
|
4372
4436
|
</section>`;
|
|
4373
4437
|
}
|
|
4374
|
-
function
|
|
4438
|
+
function at() {
|
|
4375
4439
|
if (!n.privacyScroll)
|
|
4376
4440
|
return;
|
|
4377
|
-
const e =
|
|
4441
|
+
const e = V.map((a) => zt(
|
|
4378
4442
|
"diagnostic",
|
|
4379
4443
|
a.key,
|
|
4380
4444
|
a.label,
|
|
4381
|
-
|
|
4382
|
-
a.redacted
|
|
4383
|
-
)).join(""), t = O.map((a) => St(
|
|
4384
|
-
"log",
|
|
4385
|
-
a.id,
|
|
4386
|
-
a.level,
|
|
4387
|
-
a.text,
|
|
4445
|
+
Ki(a.value),
|
|
4388
4446
|
a.redacted
|
|
4389
|
-
)).join("")
|
|
4447
|
+
)).join(""), t = I.map((a) => {
|
|
4448
|
+
const o = wi(a);
|
|
4449
|
+
return zt(
|
|
4450
|
+
"log",
|
|
4451
|
+
a.id,
|
|
4452
|
+
a.level,
|
|
4453
|
+
o,
|
|
4454
|
+
a.redacted,
|
|
4455
|
+
a.redacted ? null : Si(a)
|
|
4456
|
+
);
|
|
4457
|
+
}).join("");
|
|
4390
4458
|
n.privacyScroll.innerHTML = [
|
|
4391
|
-
|
|
4392
|
-
|
|
4459
|
+
Et("diagnostics", p("privacy.section.diagnostics"), V, e),
|
|
4460
|
+
I.length ? Et("logs", p("privacy.section.logs"), I, t) : ""
|
|
4393
4461
|
].join(""), n.privacyScroll.querySelectorAll('input[data-indeterminate="true"]').forEach((a) => {
|
|
4394
4462
|
a.indeterminate = !0, a.removeAttribute("data-indeterminate");
|
|
4395
|
-
}),
|
|
4463
|
+
}), tt();
|
|
4396
4464
|
}
|
|
4397
|
-
function
|
|
4465
|
+
function Es(e) {
|
|
4398
4466
|
const t = e.target;
|
|
4399
4467
|
if (!(t instanceof HTMLInputElement) || t.type !== "checkbox")
|
|
4400
4468
|
return;
|
|
4401
|
-
const a = t.closest("[data-section]"), o = t.closest(".nf-privacy-row"),
|
|
4469
|
+
const a = t.closest("[data-section]"), o = t.closest(".nf-privacy-row"), s = t.checked;
|
|
4402
4470
|
if (o) {
|
|
4403
|
-
const i = o.dataset.kind,
|
|
4471
|
+
const i = o.dataset.kind, r = o.dataset.id;
|
|
4404
4472
|
if (i === "diagnostic") {
|
|
4405
|
-
const l =
|
|
4406
|
-
l && (l.redacted =
|
|
4473
|
+
const l = V.find((u) => u.key === r);
|
|
4474
|
+
l && (l.redacted = s);
|
|
4407
4475
|
} else if (i === "log") {
|
|
4408
|
-
const l =
|
|
4409
|
-
l && (l.redacted =
|
|
4476
|
+
const l = I.find((u) => u.id === r);
|
|
4477
|
+
l && (l.redacted = s);
|
|
4410
4478
|
}
|
|
4411
4479
|
} else if (a) {
|
|
4412
4480
|
const i = a.dataset.section;
|
|
4413
|
-
i === "diagnostics" ? (
|
|
4481
|
+
i === "diagnostics" ? (we(V, s), Ct({ diagnostics: s })) : i === "logs" && (we(I, s), Ct({ logs: s }));
|
|
4414
4482
|
} else
|
|
4415
4483
|
return;
|
|
4416
|
-
|
|
4484
|
+
at();
|
|
4417
4485
|
}
|
|
4418
|
-
async function
|
|
4419
|
-
|
|
4486
|
+
async function ga() {
|
|
4487
|
+
Ye(), ce || (ce = !0, da("onOpen")), ma(), se(), n.launcher.hidden = !0, A = Je(), G = { w: 0, h: 0 }, K = null, H = "", ie = "", M = null, j = null, E = null, J = ts(), Xe(J), de(null), Ue(!1), n.text.value = "", na(), S(""), zs();
|
|
4420
4488
|
try {
|
|
4421
|
-
|
|
4489
|
+
aa(await Vt(ta())), S("");
|
|
4422
4490
|
} catch (t) {
|
|
4423
|
-
|
|
4491
|
+
H = "", S((t == null ? void 0 : t.message) || p("status.screenshotFailed"));
|
|
4424
4492
|
}
|
|
4425
|
-
|
|
4493
|
+
ge(), Ee(!1), tt(), n.dialog.hidden = !1, ee(), n.text.focus();
|
|
4426
4494
|
}
|
|
4427
|
-
function
|
|
4428
|
-
if (!
|
|
4495
|
+
function re() {
|
|
4496
|
+
if (!f)
|
|
4429
4497
|
return;
|
|
4430
|
-
const e =
|
|
4431
|
-
|
|
4498
|
+
const e = ce;
|
|
4499
|
+
Q == null || Q.stop(), Ue(!1), Qt(), j = null, E = null, Qe(!1), ma(), Ee(!1), n.dialog.hidden = !0, n.stop.hidden = !0, Se(), e && (ce = !1, da("onClose"));
|
|
4432
4500
|
}
|
|
4433
|
-
function
|
|
4434
|
-
const t = n.dialog, a = n.panel, o = n.panelBody,
|
|
4435
|
-
if (!t || !a || !o || !
|
|
4501
|
+
function js(e = "") {
|
|
4502
|
+
const t = n.dialog, a = n.panel, o = n.panelBody, s = n.successMsg, i = n.successLink, r = String(e || "").trim(), l = !!(d.displayLink && r);
|
|
4503
|
+
if (!t || !a || !o || !s)
|
|
4436
4504
|
return Promise.resolve(!1);
|
|
4437
|
-
|
|
4438
|
-
const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches,
|
|
4439
|
-
if (o.hidden = !0,
|
|
4505
|
+
Pe = !0, xe = l, S("");
|
|
4506
|
+
const u = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches, c = a.getBoundingClientRect();
|
|
4507
|
+
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) {
|
|
4440
4508
|
if (u)
|
|
4441
4509
|
return Promise.resolve(!0);
|
|
4442
|
-
const
|
|
4443
|
-
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${
|
|
4444
|
-
let
|
|
4510
|
+
const w = a.getBoundingClientRect(), b = w.width > 0 ? c.width / w.width : 1, z = w.height > 0 ? c.height / w.height : 1;
|
|
4511
|
+
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${b}, ${z})`, a.getBoundingClientRect(), new Promise((R) => {
|
|
4512
|
+
let T = !1;
|
|
4445
4513
|
const $ = () => {
|
|
4446
|
-
|
|
4447
|
-
},
|
|
4448
|
-
|
|
4514
|
+
T || (T = !0, a.removeEventListener("transitionend", P), R(!0));
|
|
4515
|
+
}, P = (m) => {
|
|
4516
|
+
m.target !== a || m.propertyName !== "transform" || $();
|
|
4449
4517
|
};
|
|
4450
|
-
a.addEventListener("transitionend",
|
|
4518
|
+
a.addEventListener("transitionend", P), requestAnimationFrame(() => {
|
|
4451
4519
|
a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
|
|
4452
4520
|
}), window.setTimeout($, 700);
|
|
4453
4521
|
});
|
|
4454
4522
|
}
|
|
4455
4523
|
if (u)
|
|
4456
|
-
return new Promise((
|
|
4457
|
-
window.setTimeout(() =>
|
|
4524
|
+
return new Promise((w) => {
|
|
4525
|
+
window.setTimeout(() => w(!1), 1e3);
|
|
4458
4526
|
});
|
|
4459
|
-
const
|
|
4460
|
-
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${
|
|
4461
|
-
let
|
|
4462
|
-
const
|
|
4463
|
-
|
|
4464
|
-
t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() =>
|
|
4527
|
+
const g = a.getBoundingClientRect(), v = g.width > 0 ? c.width / g.width : 1, k = g.height > 0 ? c.height / g.height : 1;
|
|
4528
|
+
return a.style.transformOrigin = "center center", a.style.transition = "none", a.style.transform = `scale(${v}, ${k})`, a.getBoundingClientRect(), new Promise((w) => {
|
|
4529
|
+
let b = !1;
|
|
4530
|
+
const z = () => {
|
|
4531
|
+
b || (b = !0, a.removeEventListener("transitionend", R), window.setTimeout(() => {
|
|
4532
|
+
t.style.transition = "opacity 0.28s ease", t.style.opacity = "0", window.setTimeout(() => w(!1), 280);
|
|
4465
4533
|
}, 1e3));
|
|
4466
|
-
},
|
|
4467
|
-
|
|
4534
|
+
}, R = (T) => {
|
|
4535
|
+
T.target !== a || T.propertyName !== "transform" || z();
|
|
4468
4536
|
};
|
|
4469
|
-
a.addEventListener("transitionend",
|
|
4537
|
+
a.addEventListener("transitionend", R), requestAnimationFrame(() => {
|
|
4470
4538
|
a.style.transition = "transform 0.48s cubic-bezier(0.22, 1, 0.36, 1)", a.style.transform = "scale(1)";
|
|
4471
|
-
}), window.setTimeout(
|
|
4539
|
+
}), window.setTimeout(z, 700);
|
|
4472
4540
|
});
|
|
4473
4541
|
}
|
|
4474
|
-
function
|
|
4475
|
-
|
|
4542
|
+
function ma() {
|
|
4543
|
+
Pe = !1, xe = !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")));
|
|
4476
4544
|
}
|
|
4477
|
-
function
|
|
4478
|
-
|
|
4545
|
+
function Rs(e = {}) {
|
|
4546
|
+
N = { ...N, ...fi(e) }, na();
|
|
4479
4547
|
}
|
|
4480
|
-
async function
|
|
4481
|
-
|
|
4548
|
+
async function ha() {
|
|
4549
|
+
var t, a;
|
|
4550
|
+
if (Ye(), Ve)
|
|
4482
4551
|
return null;
|
|
4483
4552
|
const e = n.text.value.trim();
|
|
4484
|
-
if (!e && !
|
|
4485
|
-
return
|
|
4486
|
-
if (!
|
|
4487
|
-
return
|
|
4488
|
-
|
|
4553
|
+
if (!e && !B() && !K)
|
|
4554
|
+
return S(p("status.emptyReport")), null;
|
|
4555
|
+
if (!d.endpoint || !d.projectKey)
|
|
4556
|
+
return S(p("status.missingConfig")), null;
|
|
4557
|
+
Ve = !0, jt(!0), S(p("status.submitting"), !0);
|
|
4489
4558
|
try {
|
|
4490
|
-
const
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4559
|
+
const o = vs(), s = A.crop(), i = A.list(), r = A.isCropped(), l = r ? Pi(i, s) : i, u = r ? { x: 0, y: 0, w: 1, h: 1 } : s, c = Hi({
|
|
4560
|
+
author: o,
|
|
4561
|
+
diagnostics: V,
|
|
4562
|
+
logs: I
|
|
4563
|
+
}), g = {
|
|
4564
|
+
width: typeof screen < "u" ? screen.width : null,
|
|
4565
|
+
height: typeof screen < "u" ? screen.height : null,
|
|
4566
|
+
dpr: window.devicePixelRatio || 1
|
|
4567
|
+
}, v = [];
|
|
4568
|
+
let k = 2048, w = null, b = null;
|
|
4569
|
+
B() && (b = await vt(H, {
|
|
4570
|
+
crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
|
|
4571
|
+
maxEdge: k
|
|
4572
|
+
}));
|
|
4573
|
+
for (let z = 1; z <= 3; z += 1) {
|
|
4574
|
+
const R = z === 3 || !b, T = R ? {
|
|
4575
|
+
...b ? { width: b.width, height: b.height, mime: b.mime } : {},
|
|
4576
|
+
attempt: z,
|
|
4577
|
+
omitted: !0
|
|
4578
|
+
} : {
|
|
4579
|
+
width: b.width,
|
|
4580
|
+
height: b.height,
|
|
4581
|
+
mime: b.mime,
|
|
4582
|
+
attempt: z
|
|
4583
|
+
}, $ = {
|
|
4584
|
+
...c,
|
|
4585
|
+
screen: g,
|
|
4586
|
+
screenshotMeta: T
|
|
4587
|
+
};
|
|
4588
|
+
R && B() && ($.screenshotError = {
|
|
4589
|
+
message: (w == null ? void 0 : w.message) || "Screenshot omitted after failed uploads",
|
|
4590
|
+
attempts: [...v]
|
|
4591
|
+
});
|
|
4592
|
+
const P = new FormData();
|
|
4593
|
+
P.append("message", e), P.append("kind", J), P.append("version", d.version || "0.0.0"), P.append("author", o), d.name && P.append("name", d.name), P.append("context", JSON.stringify($)), 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");
|
|
4594
|
+
try {
|
|
4595
|
+
const m = await fetch(`${d.endpoint}/v1/reports`, {
|
|
4596
|
+
method: "POST",
|
|
4597
|
+
headers: {
|
|
4598
|
+
"X-Notefully-Key": d.projectKey
|
|
4599
|
+
},
|
|
4600
|
+
body: P
|
|
4601
|
+
});
|
|
4602
|
+
let C = null;
|
|
4603
|
+
try {
|
|
4604
|
+
C = await m.json();
|
|
4605
|
+
} catch {
|
|
4606
|
+
C = null;
|
|
4607
|
+
}
|
|
4608
|
+
if (!m.ok) {
|
|
4609
|
+
const ne = new Error((C == null ? void 0 : C.error) || `${p("status.submitFailed")} (${m.status})`);
|
|
4610
|
+
throw ne.status = m.status, ne.code = C == null ? void 0 : C.code, ne.json = C, ne;
|
|
4611
|
+
}
|
|
4612
|
+
return R && B() && S(p("status.submitWithoutImage"), !0), await js((C == null ? void 0 : C.trackerUrl) || "") || re(), C;
|
|
4613
|
+
} catch (m) {
|
|
4614
|
+
if (w = m, v.push({
|
|
4615
|
+
attempt: z,
|
|
4616
|
+
maxEdge: R ? null : k,
|
|
4617
|
+
status: (m == null ? void 0 : m.status) || null,
|
|
4618
|
+
code: (m == null ? void 0 : m.code) || null,
|
|
4619
|
+
message: String((m == null ? void 0 : m.message) || m)
|
|
4620
|
+
}), R || !b)
|
|
4621
|
+
throw S(((t = m == null ? void 0 : m.json) == null ? void 0 : t.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
|
|
4622
|
+
if (!Oi(m, (m == null ? void 0 : m.json) || null))
|
|
4623
|
+
throw S(((a = m == null ? void 0 : m.json) == null ? void 0 : a.error) || (m == null ? void 0 : m.message) || p("status.submitFailed")), m;
|
|
4624
|
+
if (z === 1) {
|
|
4625
|
+
S(p("status.submitTooLarge"), !0), k = Fi(k), b = await vt(H, {
|
|
4626
|
+
crop: r ? s : { x: 0, y: 0, w: 1, h: 1 },
|
|
4627
|
+
maxEdge: k
|
|
4628
|
+
});
|
|
4629
|
+
continue;
|
|
4630
|
+
}
|
|
4631
|
+
S(p("status.submitTooLarge"), !0), b = null;
|
|
4510
4632
|
}
|
|
4511
4633
|
}
|
|
4512
|
-
|
|
4513
|
-
const s = await fetch(`${c.endpoint}/v1/reports`, {
|
|
4514
|
-
method: "POST",
|
|
4515
|
-
headers: {
|
|
4516
|
-
"X-Notefully-Key": c.projectKey
|
|
4517
|
-
},
|
|
4518
|
-
body: a
|
|
4519
|
-
});
|
|
4520
|
-
let l = null;
|
|
4521
|
-
try {
|
|
4522
|
-
l = await s.json();
|
|
4523
|
-
} catch {
|
|
4524
|
-
l = null;
|
|
4525
|
-
}
|
|
4526
|
-
if (!s.ok)
|
|
4527
|
-
throw A((l == null ? void 0 : l.error) || m("status.submitFailed")), new Error((l == null ? void 0 : l.error) || `${m("status.submitFailed")} (${s.status})`);
|
|
4528
|
-
return await br((l == null ? void 0 : l.trackerUrl) || "") || se(), l;
|
|
4634
|
+
throw w || new Error(p("status.submitFailed"));
|
|
4529
4635
|
} finally {
|
|
4530
|
-
|
|
4636
|
+
Ve = !1, jt(!1);
|
|
4531
4637
|
}
|
|
4532
4638
|
}
|
|
4533
|
-
function
|
|
4639
|
+
function jt(e) {
|
|
4534
4640
|
n.submit && (n.submit.disabled = !!e, n.submit.setAttribute("aria-busy", e ? "true" : "false"));
|
|
4535
4641
|
}
|
|
4536
|
-
function
|
|
4537
|
-
|
|
4538
|
-
}
|
|
4539
|
-
const
|
|
4540
|
-
init:
|
|
4541
|
-
configure:
|
|
4542
|
-
setTheme:
|
|
4543
|
-
setVisible:
|
|
4544
|
-
open:
|
|
4545
|
-
close:
|
|
4546
|
-
isOpen:
|
|
4547
|
-
getLocale:
|
|
4548
|
-
setLocale:
|
|
4549
|
-
identify:
|
|
4550
|
-
submit:
|
|
4551
|
-
destroy:
|
|
4642
|
+
function Ps() {
|
|
4643
|
+
re(), document.removeEventListener("keydown", ua), f == null || f.remove(), f = null, n = {};
|
|
4644
|
+
}
|
|
4645
|
+
const Te = {
|
|
4646
|
+
init: Ss,
|
|
4647
|
+
configure: et,
|
|
4648
|
+
setTheme: As,
|
|
4649
|
+
setVisible: Cs,
|
|
4650
|
+
open: ga,
|
|
4651
|
+
close: re,
|
|
4652
|
+
isOpen: ks,
|
|
4653
|
+
getLocale: bs,
|
|
4654
|
+
setLocale: ws,
|
|
4655
|
+
identify: Rs,
|
|
4656
|
+
submit: ha,
|
|
4657
|
+
destroy: Ps
|
|
4552
4658
|
};
|
|
4553
|
-
typeof window < "u" && (window.Notefully =
|
|
4659
|
+
typeof window < "u" && (window.Notefully = Te);
|
|
4554
4660
|
export {
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4661
|
+
re as close,
|
|
4662
|
+
et as configure,
|
|
4663
|
+
Te as default,
|
|
4664
|
+
Ps as destroy,
|
|
4665
|
+
bs as getLocaleTag,
|
|
4666
|
+
Rs as identify,
|
|
4667
|
+
Ss as init,
|
|
4668
|
+
ks as isOpen,
|
|
4669
|
+
ga as open,
|
|
4670
|
+
ws as setLocale,
|
|
4671
|
+
As as setTheme,
|
|
4672
|
+
Cs as setVisible,
|
|
4673
|
+
ha as submit
|
|
4568
4674
|
};
|