@readium/speech 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/WebSpeech/TmpNavigator.d.ts +2 -0
- package/build/WebSpeech/WebSpeechVoiceManager.d.ts +22 -4
- package/build/WebSpeech/webSpeechEngine.d.ts +10 -0
- package/build/engine.d.ts +2 -0
- package/build/index.cjs +20 -20
- package/build/index.js +1008 -905
- package/build/navigator.d.ts +3 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const U = (t) => {
|
|
2
2
|
if (!t) return ["", void 0];
|
|
3
3
|
const e = t.replace(/_/g, "-");
|
|
4
4
|
try {
|
|
@@ -14,7 +14,7 @@ const W = (t) => {
|
|
|
14
14
|
r[1]?.toUpperCase()
|
|
15
15
|
];
|
|
16
16
|
}
|
|
17
|
-
},
|
|
17
|
+
}, H = {
|
|
18
18
|
ar: {
|
|
19
19
|
defaultRegion: "SA",
|
|
20
20
|
availableRegions: [
|
|
@@ -410,7 +410,7 @@ async function On(t) {
|
|
|
410
410
|
const i = (await r()).default;
|
|
411
411
|
return {
|
|
412
412
|
...i,
|
|
413
|
-
voices: i.voices.map(
|
|
413
|
+
voices: i.voices.map(Cn)
|
|
414
414
|
};
|
|
415
415
|
} catch (e) {
|
|
416
416
|
return console.warn(`Failed to load voice data for ${t}:`, e), {
|
|
@@ -424,7 +424,7 @@ async function On(t) {
|
|
|
424
424
|
function Mt(t) {
|
|
425
425
|
return Ke.has(t) || Ke.set(t, On(t)), Ke.get(t);
|
|
426
426
|
}
|
|
427
|
-
const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "apple"],
|
|
427
|
+
const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "apple"], Cn = (t) => ({
|
|
428
428
|
...t,
|
|
429
429
|
quality: t.quality?.filter((e) => xn.includes(e)),
|
|
430
430
|
localizedName: t.localizedName && En.includes(t.localizedName) ? t.localizedName : void 0
|
|
@@ -440,7 +440,7 @@ const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "a
|
|
|
440
440
|
"zh-HK": "yue-HK",
|
|
441
441
|
wuu: "wuu",
|
|
442
442
|
"wuu-CN": "wuu-CN"
|
|
443
|
-
},
|
|
443
|
+
}, D = (t) => {
|
|
444
444
|
if (!t) return "";
|
|
445
445
|
let e = t.toLowerCase().replace(/_/g, "-");
|
|
446
446
|
if (/\w{2,3}-\w{2,3}/.test(e)) {
|
|
@@ -451,7 +451,7 @@ const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "a
|
|
|
451
451
|
}, gt = async (t) => {
|
|
452
452
|
if (!t) return [];
|
|
453
453
|
try {
|
|
454
|
-
const e =
|
|
454
|
+
const e = D(t);
|
|
455
455
|
try {
|
|
456
456
|
const n = await Mt(e);
|
|
457
457
|
if (n?.voices?.length)
|
|
@@ -459,7 +459,7 @@ const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "a
|
|
|
459
459
|
} catch (n) {
|
|
460
460
|
console.warn(`Failed to load voices for ${e}:`, n);
|
|
461
461
|
}
|
|
462
|
-
const [r] =
|
|
462
|
+
const [r] = U(e);
|
|
463
463
|
if (r !== e)
|
|
464
464
|
try {
|
|
465
465
|
const n = await Mt(r);
|
|
@@ -475,36 +475,36 @@ const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "a
|
|
|
475
475
|
}, Vt = (t) => {
|
|
476
476
|
if (!t) return "";
|
|
477
477
|
try {
|
|
478
|
-
const e =
|
|
478
|
+
const e = D(t), r = H[e];
|
|
479
479
|
if (r?.testUtterance)
|
|
480
480
|
return r.testUtterance;
|
|
481
481
|
if (e in ke) {
|
|
482
482
|
const i = ke[e];
|
|
483
|
-
if (i &&
|
|
484
|
-
return
|
|
483
|
+
if (i && H[i]?.testUtterance)
|
|
484
|
+
return H[i].testUtterance;
|
|
485
485
|
}
|
|
486
|
-
const [n] =
|
|
487
|
-
return n !== e &&
|
|
486
|
+
const [n] = U(e);
|
|
487
|
+
return n !== e && H[n]?.testUtterance ? H[n].testUtterance : "";
|
|
488
488
|
} catch (e) {
|
|
489
489
|
return console.error(`Error in getTestUtterance for ${t}:`, e), "";
|
|
490
490
|
}
|
|
491
491
|
}, De = (t) => {
|
|
492
492
|
if (!t) return "";
|
|
493
493
|
try {
|
|
494
|
-
const e =
|
|
494
|
+
const e = D(t), r = H[e];
|
|
495
495
|
if (r?.defaultRegion)
|
|
496
496
|
return `${e}-${r.defaultRegion}`;
|
|
497
497
|
if (e in ke) {
|
|
498
498
|
const i = ke[e];
|
|
499
499
|
if (i) {
|
|
500
|
-
const s =
|
|
500
|
+
const s = H[i];
|
|
501
501
|
if (s?.defaultRegion)
|
|
502
502
|
return `${i}-${s.defaultRegion}`;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
const [n] =
|
|
505
|
+
const [n] = U(e);
|
|
506
506
|
if (n !== e) {
|
|
507
|
-
const i =
|
|
507
|
+
const i = H[n];
|
|
508
508
|
if (i?.defaultRegion)
|
|
509
509
|
return `${n}-${i.defaultRegion}`;
|
|
510
510
|
}
|
|
@@ -517,20 +517,20 @@ const xn = ["veryLow", "low", "normal", "high", "veryHigh"], En = ["android", "a
|
|
|
517
517
|
const e = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
518
518
|
for (const [i, s] of t.entries()) {
|
|
519
519
|
if (!s) continue;
|
|
520
|
-
const
|
|
521
|
-
c && (e.add(c), n.has(c) || n.set(c, i)), r.has(
|
|
520
|
+
const o = D(s), [a, c] = U(o);
|
|
521
|
+
c && (e.add(c), n.has(c) || n.set(c, i)), r.has(a) || r.set(a, /* @__PURE__ */ new Set()), c && r.get(a).add(c);
|
|
522
522
|
}
|
|
523
523
|
return Array.from(r.entries()).map(([i, s]) => {
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
),
|
|
527
|
-
(h) =>
|
|
528
|
-
), l = Array.from(/* @__PURE__ */ new Set([...
|
|
524
|
+
const o = new Set(
|
|
525
|
+
H[i]?.availableRegions || []
|
|
526
|
+
), a = Array.from(s), c = Array.from(e).filter(
|
|
527
|
+
(h) => o.has(h) && !a.includes(h)
|
|
528
|
+
), l = Array.from(/* @__PURE__ */ new Set([...a, ...c])).sort((h, d) => {
|
|
529
529
|
const g = n.get(h) ?? Number.MAX_SAFE_INTEGER, f = n.get(d) ?? Number.MAX_SAFE_INTEGER;
|
|
530
530
|
return g - f;
|
|
531
531
|
});
|
|
532
532
|
if (l.length === 0) {
|
|
533
|
-
const h = De(i), [, d] =
|
|
533
|
+
const h = De(i), [, d] = U(h);
|
|
534
534
|
d && l.push(d);
|
|
535
535
|
}
|
|
536
536
|
return {
|
|
@@ -543,46 +543,46 @@ async function Te(t) {
|
|
|
543
543
|
const e = /* @__PURE__ */ new Map();
|
|
544
544
|
for (const n of t) {
|
|
545
545
|
if (n.source !== "json") continue;
|
|
546
|
-
const [i] =
|
|
546
|
+
const [i] = U(n.language);
|
|
547
547
|
e.has(i) || e.set(i, []), e.get(i).push(n);
|
|
548
548
|
}
|
|
549
549
|
const r = /* @__PURE__ */ new Map();
|
|
550
550
|
for (const [n, i] of e.entries()) {
|
|
551
|
-
const s = /* @__PURE__ */ new Map(),
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
551
|
+
const s = /* @__PURE__ */ new Map(), o = await gt(n), a = /* @__PURE__ */ new Map();
|
|
552
|
+
o.forEach((c, l) => {
|
|
553
|
+
a.set(c.name.toLowerCase(), l), c.altNames?.forEach((h) => {
|
|
554
|
+
a.set(h.toLowerCase(), l);
|
|
555
555
|
});
|
|
556
556
|
});
|
|
557
557
|
for (const c of i) {
|
|
558
|
-
const l = c.name.toLowerCase(), h =
|
|
558
|
+
const l = c.name.toLowerCase(), h = a.get(l);
|
|
559
559
|
h !== void 0 && s.set(c.name, h);
|
|
560
560
|
}
|
|
561
561
|
s.size > 0 && r.set(n, s);
|
|
562
562
|
}
|
|
563
563
|
return r;
|
|
564
564
|
}
|
|
565
|
-
const
|
|
566
|
-
voices:
|
|
565
|
+
const An = [{ name: "Albert", nativeID: ["com.apple.speech.synthesis.voice.Albert"], note: "This novelty voice is part of a pack preloaded by Apple.", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Bad News", nativeID: ["com.apple.speech.synthesis.voice.BadNews"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Mauvaises nouvelles", "Malas noticias", "Brutte notizie"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Bahh", nativeID: ["com.apple.speech.synthesis.voice.Bahh"], note: "This novelty voice is part of a pack preloaded by Apple.", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Bells", nativeID: ["com.apple.speech.synthesis.voice.Bells"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Cloches", "Campanas", "Campane"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Boing", nativeID: ["com.apple.speech.synthesis.voice.Boing"], note: "This novelty voice is part of a pack preloaded by Apple.", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Bubbles", nativeID: ["com.apple.speech.synthesis.voice.Bubbles"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Bulles", "Burbujas", "Bollicine"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Cellos", nativeID: ["com.apple.speech.synthesis.voice.Cellos"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Violoncelles", "Violonchelos", "Violoncelli"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Good News", nativeID: ["com.apple.speech.synthesis.voice.GoodNews"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Bonnes nouvelles", "Buenas noticias", "Buone notizie"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Jester", nativeID: ["com.apple.speech.synthesis.voice.Hysterical"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Bouffon", "Bufón", "Giullare"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Organ", nativeID: ["com.apple.speech.synthesis.voice.Organ"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Orgue", "Órgano", "Organo"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Superstar", nativeID: ["com.apple.speech.synthesis.voice.Princess"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Superestrella"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Trinoids", nativeID: ["com.apple.speech.synthesis.voice.Trinoids"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Trinoïdes"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Whisper", nativeID: ["com.apple.speech.synthesis.voice.Whisper"], note: "This novelty voice is part of a pack preloaded by Apple.", altNames: ["Murmure", "Susurro", "Sussurro"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Wobble", nativeID: ["com.apple.speech.synthesis.voice.Deranged"], note: "This novelty voice is part of a pack preloaded by Apple.", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Zarvox", nativeID: ["com.apple.speech.synthesis.voice.Zarvox"], note: "This novelty voice is part of a pack preloaded by Apple.", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }], Tn = {
|
|
566
|
+
voices: An
|
|
567
567
|
}, Rn = [{ name: "Eddy", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Flo", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Grandma", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Grandpa", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Jacques", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Reed", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Rocko", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Sandy", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Shelley", localizedName: "apple", note: "Eloquence voices are preloaded by default on Apple devices.", language: "en-US", otherLanguages: ["en-GB", "de-DE", "fr-FR", "fr-CA", "es-ES", "es-MX", "fi-FI", "it-IT", "ja-JP", "ko-KR", "pt-BR", "zh-CN", "zh-HK"], os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Fred", language: "en-US", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Junior", language: "en-US", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Kathy", language: "en-US", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "Ralph", language: "en-US", os: ["macOS", "iOS", "iPadOS"], preloaded: !0 }, { name: "eSpeak Arabic", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ar", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Bulgarian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "bg", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Bengali", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "bn", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Catalan", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ca", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Chinese (Mandarin, latin as English)", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "cmn", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Czech", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "cs", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Danish", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "da", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak German", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "de", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Greek", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "el", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Spanish (Spain)", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "es", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Estonian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "et", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Finnish", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "fi", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Gujarati", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "gu", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Croatian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "hr", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Hungarian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "hu", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Indonesian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "id", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Italian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "it", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Kannada", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "kn", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Korean", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ko", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Lithuanian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "lt", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Latvian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "lv", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Malayalm", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ml", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Marathi", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "mr", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Malay", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ms", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Norwegian Bokmål", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "nb", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Polish", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "pl", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Portuguese (Brazil)", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "pt-br", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Romanian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ro", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Russian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ru", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Slovak", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "sk", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Slovenian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "sl", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Serbian", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "sv", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Swedish", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "sv", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Swahili", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "sw", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Tamil", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "ta", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Telugu", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "te", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Turkish", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "tr", os: ["ChromeOS"], preloaded: !0 }, { name: "eSpeak Vietnamese (Northern)", note: "eSpeak voices are preloaded by default on Chrome OS.", language: "vi", os: ["ChromeOS"], preloaded: !0 }], Nn = {
|
|
568
568
|
voices: Rn
|
|
569
569
|
}, Ln = Tn, In = Nn, ft = (t, e) => Ln.voices.some(
|
|
570
570
|
(r) => t.includes(r.name) || e && r.nativeID?.some((n) => e.includes(n)) || r.altNames?.some((n) => t.includes(n))
|
|
571
571
|
), pt = (t, e) => In.voices.some(
|
|
572
572
|
(r) => t.includes(r.name)
|
|
573
|
-
) || e === "veryLow", Gt = (t) => t?.length ? t.filter((e) => !(e.isNovelty || ft(e.name, e.voiceURI))) : [], Kt = (t) => t?.length ? t.filter((e) => !pt(e.name, e.quality)) : [], qn = { ar: { normal: "محسن", high: "استثنائي" }, ca: { normal: "millorada", high: "prèmium" }, "cmn-CN": { normal: "优化音质", high: "高音质" }, "cmn-TW": { normal: "增強音質", high: "高音質" }, cs: { normal: "vylepšená verze", high: "prémiový" }, da: { normal: "forbedret", high: "høj kvalitet" }, de: { normal: "erweitert", high: "premium" }, el: { normal: "βελτιωμένη", high: "υψηλής ποιότητας" }, en: { normal: "Enhanced", high: "Premium" }, es: { normal: "mejorada", high: "premium" }, fi: { normal: "parannettu", high: "korkealaatuinen" }, fr: { normal: "premium", high: "de qualité" }, he: { normal: "משופר", high: "פרימיום" }, hi: { normal: "बेहतर", high: "प्रीमियम" }, hr: { normal: "poboljšani", high: "vrhunski" }, hu: { normal: "továbbfejlesztett", high: "prémium" }, id: { normal: "Ditingkatkan", high: "Premium" }, it: { normal: "ottimizzata", high: "premium" }, ja: { normal: "拡張", high: "プレミアム" }, ko: { normal: "고품질", high: "프리미엄" }, ms: { normal: "Dipertingkat", high: "Premium" }, nb: { normal: "forbedret", high: "premium" }, nl: { normal: "verbeterd", high: "premium" }, pl: { normal: "rozszerzony", high: "premium" }, pt: { normal: "melhorada", high: "premium" }, ro: { normal: "îmbunătățită", high: "premium" }, ru: { normal: "улучшенный", high: "высшее качество" }, sk: { normal: "vylepšený", high: "prémiový" }, sl: { normal: "izboljšano", high: "prvovrsten" }, sv: { normal: "förbättrad", high: "premium" }, th: { normal: "คุณภาพสูง", high: "คุณภาพสูง" }, tr: { normal: "Geliştirilmiş", high: "Yüksek Kaliteli" }, uk: { normal: "вдосконалений", high: "високої якості" }, vi: { normal: "Nâng cao", high: "Cao cấp" } },
|
|
573
|
+
) || e === "veryLow", Gt = (t) => t?.length ? t.filter((e) => !(e.isNovelty || ft(e.name, e.voiceURI))) : [], Kt = (t) => t?.length ? t.filter((e) => !pt(e.name, e.quality)) : [], qn = { ar: { normal: "محسن", high: "استثنائي" }, ca: { normal: "millorada", high: "prèmium" }, "cmn-CN": { normal: "优化音质", high: "高音质" }, "cmn-TW": { normal: "增強音質", high: "高音質" }, cs: { normal: "vylepšená verze", high: "prémiový" }, da: { normal: "forbedret", high: "høj kvalitet" }, de: { normal: "erweitert", high: "premium" }, el: { normal: "βελτιωμένη", high: "υψηλής ποιότητας" }, en: { normal: "Enhanced", high: "Premium" }, es: { normal: "mejorada", high: "premium" }, fi: { normal: "parannettu", high: "korkealaatuinen" }, fr: { normal: "premium", high: "de qualité" }, he: { normal: "משופר", high: "פרימיום" }, hi: { normal: "बेहतर", high: "प्रीमियम" }, hr: { normal: "poboljšani", high: "vrhunski" }, hu: { normal: "továbbfejlesztett", high: "prémium" }, id: { normal: "Ditingkatkan", high: "Premium" }, it: { normal: "ottimizzata", high: "premium" }, ja: { normal: "拡張", high: "プレミアム" }, ko: { normal: "고품질", high: "프리미엄" }, ms: { normal: "Dipertingkat", high: "Premium" }, nb: { normal: "forbedret", high: "premium" }, nl: { normal: "verbeterd", high: "premium" }, pl: { normal: "rozszerzony", high: "premium" }, pt: { normal: "melhorada", high: "premium" }, ro: { normal: "îmbunătățită", high: "premium" }, ru: { normal: "улучшенный", high: "высшее качество" }, sk: { normal: "vylepšený", high: "prémiový" }, sl: { normal: "izboljšano", high: "prvovrsten" }, sv: { normal: "förbättrad", high: "premium" }, th: { normal: "คุณภาพสูง", high: "คุณภาพสูง" }, tr: { normal: "Geliştirilmiş", high: "Yüksek Kaliteli" }, uk: { normal: "вдосконалений", high: "високої якості" }, vi: { normal: "Nâng cao", high: "Cao cấp" } }, Pn = {
|
|
574
574
|
quality: qn
|
|
575
575
|
}, mt = {
|
|
576
|
-
apple:
|
|
576
|
+
apple: Pn.quality
|
|
577
577
|
// android: androidQualities.quality
|
|
578
|
-
},
|
|
578
|
+
}, $n = (t, e, r) => {
|
|
579
579
|
if (!t) return;
|
|
580
580
|
const n = Array.isArray(r) ? r : r ? [r] : [];
|
|
581
581
|
for (const i of n)
|
|
582
582
|
if (i && mt[i]) {
|
|
583
|
-
const s = mt[i],
|
|
584
|
-
if (
|
|
585
|
-
const c = t.toLowerCase(), { normal: l, high: h } =
|
|
583
|
+
const s = mt[i], o = U(e)[0], a = s[e] || s[o];
|
|
584
|
+
if (a) {
|
|
585
|
+
const c = t.toLowerCase(), { normal: l, high: h } = a;
|
|
586
586
|
if (h && c.includes(h.toLowerCase()))
|
|
587
587
|
return "high";
|
|
588
588
|
if (l && c.includes(l.toLowerCase()))
|
|
@@ -593,8 +593,8 @@ const Cn = [{ name: "Albert", nativeID: ["com.apple.speech.synthesis.voice.Alber
|
|
|
593
593
|
const r = mt[e];
|
|
594
594
|
if (r)
|
|
595
595
|
for (const [n, { high: i, normal: s }] of Object.entries(r)) {
|
|
596
|
-
const
|
|
597
|
-
if (
|
|
596
|
+
const o = i && t.some((c) => c.includes(i)), a = s && t.some((c) => c.includes(s));
|
|
597
|
+
if (o && a)
|
|
598
598
|
return n;
|
|
599
599
|
}
|
|
600
600
|
}, Bn = {
|
|
@@ -620,14 +620,14 @@ const Cn = [{ name: "Albert", nativeID: ["com.apple.speech.synthesis.voice.Alber
|
|
|
620
620
|
function jn(t, e) {
|
|
621
621
|
if (t.name === t.originalName) return t;
|
|
622
622
|
if (e.name === e.originalName) return e;
|
|
623
|
-
const r = [t.originalName, ...t.altNames || []], n = [e.originalName, ...e.altNames || []], i = r.findIndex((
|
|
623
|
+
const r = [t.originalName, ...t.altNames || []], n = [e.originalName, ...e.altNames || []], i = r.findIndex((o) => n.includes(o)), s = n.findIndex((o) => r.includes(o));
|
|
624
624
|
return i === -1 && s === -1 || i !== -1 && (s === -1 || i <= s) ? t : e;
|
|
625
625
|
}
|
|
626
626
|
function Un(t, e) {
|
|
627
627
|
if (!t.altNames && !e.altNames)
|
|
628
628
|
return !1;
|
|
629
629
|
const r = t.originalName, n = e.originalName, i = t.altNames || [], s = e.altNames || [];
|
|
630
|
-
return s.includes(r) || i.includes(n) ? !0 : i.filter((
|
|
630
|
+
return s.includes(r) || i.includes(n) ? !0 : i.filter((a) => s.includes(a)).length > 0;
|
|
631
631
|
}
|
|
632
632
|
class O {
|
|
633
633
|
static instance;
|
|
@@ -636,30 +636,41 @@ class O {
|
|
|
636
636
|
voices = [];
|
|
637
637
|
browserVoices = [];
|
|
638
638
|
isInitialized = !1;
|
|
639
|
+
// Base language codes already parsed into `voices`; null means unscoped (everything loaded)
|
|
640
|
+
scopedLanguages = null;
|
|
641
|
+
broadenPromises = /* @__PURE__ */ new Map();
|
|
639
642
|
constructor() {
|
|
640
643
|
if (typeof window > "u" || !window.speechSynthesis)
|
|
641
644
|
throw new Error("Web Speech API is not available in this environment");
|
|
642
645
|
this.systemLocale = navigator.languages?.[0]?.split("-")[0] || "en";
|
|
643
646
|
}
|
|
644
647
|
/**
|
|
645
|
-
* Initialize voice manager
|
|
648
|
+
* Initialize voice manager, or broaden an already-initialized singleton to
|
|
649
|
+
* also cover new languages. `languages` scope voice parsing to reduce
|
|
650
|
+
* per-language JSON loading; omitting it on the first call loads everything,
|
|
651
|
+
* but omitting it on a later call to an already-scoped instance is a no-op,
|
|
652
|
+
* not a retroactive broaden-to-everything.
|
|
646
653
|
* @param options Configuration options for voice loading
|
|
647
|
-
* @param options.languages Optional array of preferred language codes to filter
|
|
648
|
-
* @param options.maxTimeout Maximum time in milliseconds to wait for voices to load (passed to getBrowserVoices)
|
|
649
|
-
* @param options.interval Interval in milliseconds between voice loading checks (passed to getBrowserVoices)
|
|
654
|
+
* @param options.languages Optional array of preferred language codes to filter (or broaden to) voices
|
|
655
|
+
* @param options.maxTimeout Maximum time in milliseconds to wait for voices to load (passed to getBrowserVoices, first call only)
|
|
656
|
+
* @param options.interval Interval in milliseconds between voice loading checks (passed to getBrowserVoices, first call only)
|
|
650
657
|
* @returns Promise that resolves with the WebSpeechVoiceManager instance
|
|
651
658
|
*/
|
|
652
659
|
static async initialize(e) {
|
|
653
|
-
|
|
660
|
+
if (O.instance?.isInitialized) {
|
|
661
|
+
const r = O.instance;
|
|
662
|
+
return e?.languages && e.languages.length > 0 && await r.broadenLanguages(e.languages), r;
|
|
663
|
+
}
|
|
664
|
+
return O.initializationPromise || (O.initializationPromise = (async () => {
|
|
654
665
|
try {
|
|
655
666
|
const r = new O();
|
|
656
667
|
O.instance = r, r.browserVoices = await r.getBrowserVoices(e?.maxTimeout, e?.interval), r.updateSystemLocale(r.browserVoices);
|
|
657
668
|
let n = r.browserVoices;
|
|
658
|
-
return e?.languages && e.languages.length > 0
|
|
669
|
+
return e?.languages && e.languages.length > 0 ? (n = r.filterBrowserVoicesByLanguages(r.browserVoices, e.languages), r.scopedLanguages = O.toBaseLangSet(e.languages)) : r.scopedLanguages = null, r.voices = await r.parseToReadiumSpeechVoices(n), r.isInitialized = !0, r;
|
|
659
670
|
} catch (r) {
|
|
660
671
|
throw O.initializationPromise = null, console.error("Failed to initialize WebSpeechVoiceManager:", r), r;
|
|
661
672
|
}
|
|
662
|
-
})()), O.initializationPromise
|
|
673
|
+
})()), O.initializationPromise;
|
|
663
674
|
}
|
|
664
675
|
/**
|
|
665
676
|
* Filter browser voices based on preferred languages
|
|
@@ -667,25 +678,52 @@ class O {
|
|
|
667
678
|
*/
|
|
668
679
|
filterBrowserVoicesByLanguages(e, r) {
|
|
669
680
|
if (!r?.length) return e;
|
|
670
|
-
const n =
|
|
671
|
-
r.map((i) => {
|
|
672
|
-
const s = z(i), [a] = O.extractLangRegionFromBCP47(s);
|
|
673
|
-
return a;
|
|
674
|
-
})
|
|
675
|
-
);
|
|
681
|
+
const n = O.toBaseLangSet(r);
|
|
676
682
|
return e.filter((i) => {
|
|
677
683
|
if (!i?.lang) return !1;
|
|
678
|
-
const s =
|
|
679
|
-
return n.has(
|
|
684
|
+
const s = D(i.lang), [o] = O.extractLangRegionFromBCP47(s);
|
|
685
|
+
return n.has(o);
|
|
680
686
|
});
|
|
681
687
|
}
|
|
688
|
+
/**
|
|
689
|
+
* Extract base language codes (e.g. "en", "fr") from a list of BCP47 tags
|
|
690
|
+
* @private
|
|
691
|
+
*/
|
|
692
|
+
static toBaseLangSet(e) {
|
|
693
|
+
return new Set(
|
|
694
|
+
e.map((r) => {
|
|
695
|
+
const n = D(r), [i] = O.extractLangRegionFromBCP47(n);
|
|
696
|
+
return i;
|
|
697
|
+
})
|
|
698
|
+
);
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Broaden an already-initialized instance to also cover the given languages,
|
|
702
|
+
* reusing the already-fetched `browserVoices` (no new speechSynthesis fetch).
|
|
703
|
+
* No-op if the instance is already unscoped or already covers these languages.
|
|
704
|
+
* @private
|
|
705
|
+
*/
|
|
706
|
+
async broadenLanguages(e) {
|
|
707
|
+
if (this.scopedLanguages === null) return;
|
|
708
|
+
const n = [...O.toBaseLangSet(e)].filter((a) => !this.scopedLanguages.has(a));
|
|
709
|
+
if (n.length === 0) return;
|
|
710
|
+
const i = n.filter((a) => this.broadenPromises.has(a)), s = n.filter((a) => !this.broadenPromises.has(a));
|
|
711
|
+
let o;
|
|
712
|
+
s.length > 0 && (o = (async () => {
|
|
713
|
+
const a = this.filterBrowserVoicesByLanguages(this.browserVoices, s), c = await this.parseToReadiumSpeechVoices(a);
|
|
714
|
+
this.voices = [...this.voices, ...c], s.forEach((l) => this.scopedLanguages.add(l)), s.forEach((l) => this.broadenPromises.delete(l));
|
|
715
|
+
})(), s.forEach((a) => this.broadenPromises.set(a, o))), await Promise.all([
|
|
716
|
+
...o ? [o] : [],
|
|
717
|
+
...i.map((a) => this.broadenPromises.get(a))
|
|
718
|
+
]);
|
|
719
|
+
}
|
|
682
720
|
/**
|
|
683
721
|
* Extract language and region from BCP47 language tag
|
|
684
722
|
* @param lang - The BCP47 language tag (e.g., "en-US", "zh-CN")
|
|
685
723
|
* @returns A tuple of [language, region] where language is lowercase and region is UPPERCASE
|
|
686
724
|
*/
|
|
687
725
|
static extractLangRegionFromBCP47(e) {
|
|
688
|
-
return
|
|
726
|
+
return U(e);
|
|
689
727
|
}
|
|
690
728
|
/**
|
|
691
729
|
* Get display name for a language code
|
|
@@ -751,11 +789,11 @@ class O {
|
|
|
751
789
|
if (i) return i;
|
|
752
790
|
if (r?.nativeID && Array.isArray(r.nativeID))
|
|
753
791
|
for (const s of r.nativeID) {
|
|
754
|
-
const
|
|
755
|
-
if (
|
|
792
|
+
const o = Jt(s);
|
|
793
|
+
if (o) return o;
|
|
756
794
|
}
|
|
757
795
|
if (r?.localizedName && e.voiceURI && e.lang) {
|
|
758
|
-
const s =
|
|
796
|
+
const s = $n(
|
|
759
797
|
e.voiceURI,
|
|
760
798
|
this.systemLocale,
|
|
761
799
|
r.localizedName
|
|
@@ -763,9 +801,9 @@ class O {
|
|
|
763
801
|
if (s) return s;
|
|
764
802
|
}
|
|
765
803
|
if (r?.quality && r.quality.length > 0) {
|
|
766
|
-
const s = Math.min(n - 1, r.quality.length - 1),
|
|
767
|
-
if (
|
|
768
|
-
return
|
|
804
|
+
const s = Math.min(n - 1, r.quality.length - 1), o = r.quality[s];
|
|
805
|
+
if (o)
|
|
806
|
+
return o;
|
|
769
807
|
}
|
|
770
808
|
return null;
|
|
771
809
|
}
|
|
@@ -790,11 +828,11 @@ class O {
|
|
|
790
828
|
if (!s)
|
|
791
829
|
r.set(i, n);
|
|
792
830
|
else if (Un(n, s)) {
|
|
793
|
-
const
|
|
794
|
-
r.set(i,
|
|
831
|
+
const o = jn(n, s);
|
|
832
|
+
r.set(i, o);
|
|
795
833
|
} else {
|
|
796
|
-
const
|
|
797
|
-
O.getQualityValue(n.quality) >=
|
|
834
|
+
const o = O.getQualityValue(s.quality);
|
|
835
|
+
O.getQualityValue(n.quality) >= o && r.set(i, n);
|
|
798
836
|
}
|
|
799
837
|
}
|
|
800
838
|
return Array.from(r.values());
|
|
@@ -833,17 +871,17 @@ class O {
|
|
|
833
871
|
getLanguages(e, r, n) {
|
|
834
872
|
if (!n && !this.isInitialized)
|
|
835
873
|
throw new Error("WebSpeechVoiceManager not initialized. Call initialize() first.");
|
|
836
|
-
const i = n ?? this.voices, s = r ? this.filterVoices(r, i) : i,
|
|
874
|
+
const i = n ?? this.voices, s = r ? this.filterVoices(r, i) : i, o = [], a = /* @__PURE__ */ new Set();
|
|
837
875
|
for (const c of s) {
|
|
838
|
-
const h =
|
|
839
|
-
if (!
|
|
876
|
+
const h = D(c.language).split("-")[0];
|
|
877
|
+
if (!a.has(h)) {
|
|
840
878
|
const d = O.getLanguageDisplayName(h, e), g = s.filter(
|
|
841
|
-
(f) =>
|
|
879
|
+
(f) => D(f.language).split("-")[0] === h
|
|
842
880
|
).length;
|
|
843
|
-
|
|
881
|
+
o.push({ code: h, label: d, count: g }), a.add(h);
|
|
844
882
|
}
|
|
845
883
|
}
|
|
846
|
-
return n ?
|
|
884
|
+
return n ? o : o.sort((c, l) => c.label.localeCompare(l.label));
|
|
847
885
|
}
|
|
848
886
|
/**
|
|
849
887
|
* Get available regions with voice counts
|
|
@@ -854,14 +892,14 @@ class O {
|
|
|
854
892
|
getRegions(e, r, n) {
|
|
855
893
|
if (!n && !this.isInitialized)
|
|
856
894
|
throw new Error("WebSpeechVoiceManager not initialized. Call initialize() first.");
|
|
857
|
-
const i = n ?? this.voices, s = r ? this.filterVoices(r, i) : i,
|
|
895
|
+
const i = n ?? this.voices, s = r ? this.filterVoices(r, i) : i, o = [], a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
858
896
|
for (const l of s) {
|
|
859
897
|
const [, h] = O.extractLangRegionFromBCP47(l.language);
|
|
860
898
|
h && c.set(h, (c.get(h) || 0) + 1);
|
|
861
899
|
}
|
|
862
900
|
for (const l of s) {
|
|
863
901
|
const [, h] = O.extractLangRegionFromBCP47(l.language);
|
|
864
|
-
if (h && !
|
|
902
|
+
if (h && !a.has(h)) {
|
|
865
903
|
let d = l.language;
|
|
866
904
|
try {
|
|
867
905
|
const g = e || navigator.language;
|
|
@@ -869,14 +907,14 @@ class O {
|
|
|
869
907
|
} catch (g) {
|
|
870
908
|
console.warn(`Failed to get display name for region ${h}`, g);
|
|
871
909
|
}
|
|
872
|
-
|
|
910
|
+
o.push({
|
|
873
911
|
code: h,
|
|
874
912
|
label: d,
|
|
875
913
|
count: c.get(h) || 0
|
|
876
|
-
}),
|
|
914
|
+
}), a.add(h);
|
|
877
915
|
}
|
|
878
916
|
}
|
|
879
|
-
return n ?
|
|
917
|
+
return n ? o : o.sort((l, h) => l.label.localeCompare(h.label));
|
|
880
918
|
}
|
|
881
919
|
/**
|
|
882
920
|
* Get the default voice for language preferences
|
|
@@ -895,14 +933,14 @@ class O {
|
|
|
895
933
|
if (!window.speechSynthesis)
|
|
896
934
|
return Promise.resolve([]);
|
|
897
935
|
const i = n();
|
|
898
|
-
return Array.isArray(i) && i.length ? Promise.resolve(i) : new Promise((s,
|
|
899
|
-
let
|
|
936
|
+
return Array.isArray(i) && i.length ? Promise.resolve(i) : new Promise((s, o) => {
|
|
937
|
+
let a = Math.floor(e / r), c = !1;
|
|
900
938
|
const l = () => {
|
|
901
939
|
if (c) return;
|
|
902
940
|
c = !0;
|
|
903
941
|
const h = () => {
|
|
904
|
-
if (
|
|
905
|
-
--
|
|
942
|
+
if (a < 1) return s([]);
|
|
943
|
+
--a;
|
|
906
944
|
const d = n();
|
|
907
945
|
if (Array.isArray(d) && d.length) return s(d);
|
|
908
946
|
setTimeout(h, r);
|
|
@@ -923,10 +961,10 @@ class O {
|
|
|
923
961
|
const r = this.countVoiceDuplicates(e);
|
|
924
962
|
return await Promise.all(
|
|
925
963
|
e.filter((i) => i?.name && i?.lang).map(async (i) => {
|
|
926
|
-
const s =
|
|
964
|
+
const s = D(i.lang), [o] = O.extractLangRegionFromBCP47(s), a = this.normalizeVoiceName(i.name), c = `${i.lang.toLowerCase()}_${a}`, l = r.get(c) || 1;
|
|
927
965
|
let h = await gt(s);
|
|
928
|
-
(!h || h.length === 0) && (h = await gt(
|
|
929
|
-
const d = this.findMatchingJsonVoice(h,
|
|
966
|
+
(!h || h.length === 0) && (h = await gt(o));
|
|
967
|
+
const d = this.findMatchingJsonVoice(h, a), g = this.inferVoiceQuality(i, d, l);
|
|
930
968
|
return d ? {
|
|
931
969
|
...d,
|
|
932
970
|
label: d.label ?? this.cleanVoiceName(i.name),
|
|
@@ -981,8 +1019,8 @@ class O {
|
|
|
981
1019
|
};
|
|
982
1020
|
if (i.languages) {
|
|
983
1021
|
const s = Array.isArray(i.languages) ? i.languages : [i.languages];
|
|
984
|
-
n = n.filter((
|
|
985
|
-
const c =
|
|
1022
|
+
n = n.filter((o) => s.some((a) => {
|
|
1023
|
+
const c = a.toLowerCase(), l = o.language?.toLowerCase(), h = o.altLanguage?.toLowerCase();
|
|
986
1024
|
if (l === c || h === c)
|
|
987
1025
|
return !0;
|
|
988
1026
|
const [d] = c.split("-");
|
|
@@ -991,7 +1029,7 @@ class O {
|
|
|
991
1029
|
}
|
|
992
1030
|
if (i.source && (n = n.filter((s) => s.source === i.source)), i.gender && (n = n.filter((s) => s.gender === i.gender)), i.quality) {
|
|
993
1031
|
const s = Array.isArray(i.quality) ? i.quality : [i.quality];
|
|
994
|
-
n = n.filter((
|
|
1032
|
+
n = n.filter((o) => o.quality && s.includes(o.quality));
|
|
995
1033
|
}
|
|
996
1034
|
return i.offlineOnly && (n = n.filter((s) => s.offlineAvailability === !0)), i.provider && (n = n.filter(
|
|
997
1035
|
(s) => s.provider?.toLowerCase() === i.provider?.toLowerCase()
|
|
@@ -1038,16 +1076,16 @@ class O {
|
|
|
1038
1076
|
* @returns Comparison result (-1, 0, or 1)
|
|
1039
1077
|
*/
|
|
1040
1078
|
static sortByQuality(e, r, n, i) {
|
|
1041
|
-
const s = O.getQualityValue(e.quality),
|
|
1079
|
+
const s = O.getQualityValue(e.quality), o = O.getQualityValue(r.quality);
|
|
1042
1080
|
if (n && i && e.source === "json" && r.source === "json") {
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
const c =
|
|
1081
|
+
const a = n.get(i);
|
|
1082
|
+
if (a) {
|
|
1083
|
+
const c = a.get(e.name), l = a.get(r.name);
|
|
1046
1084
|
if (c !== void 0 && l !== void 0)
|
|
1047
1085
|
return c - l;
|
|
1048
1086
|
}
|
|
1049
1087
|
}
|
|
1050
|
-
return
|
|
1088
|
+
return o !== s ? o - s : e.name.localeCompare(r.name);
|
|
1051
1089
|
}
|
|
1052
1090
|
/**
|
|
1053
1091
|
* Sort voices by quality, respecting JSON name order, then alphabetically for undefined/null quality
|
|
@@ -1064,10 +1102,10 @@ class O {
|
|
|
1064
1102
|
* Group voices by language based on processed preferred languages
|
|
1065
1103
|
*/
|
|
1066
1104
|
static groupVoicesByLanguage(e, r) {
|
|
1067
|
-
const n = new Map(r.map((
|
|
1068
|
-
for (const
|
|
1069
|
-
const [
|
|
1070
|
-
n.get(
|
|
1105
|
+
const n = new Map(r.map((o) => [o.baseLang, o])), i = /* @__PURE__ */ new Map(), s = [];
|
|
1106
|
+
for (const o of e) {
|
|
1107
|
+
const [a] = O.extractLangRegionFromBCP47(o.language);
|
|
1108
|
+
n.get(a) ? (i.has(a) || i.set(a, []), i.get(a).push(o)) : s.push(o);
|
|
1071
1109
|
}
|
|
1072
1110
|
return { voicesByLang: i, otherLangVoices: s };
|
|
1073
1111
|
}
|
|
@@ -1076,9 +1114,9 @@ class O {
|
|
|
1076
1114
|
*/
|
|
1077
1115
|
static async sortByDefaultRegion(e, r) {
|
|
1078
1116
|
const n = await Te(e), i = De(r);
|
|
1079
|
-
e.sort((s,
|
|
1080
|
-
const [,
|
|
1081
|
-
return l && !h ? -1 : !l && h ? 1 : O.sortByQuality(s,
|
|
1117
|
+
e.sort((s, o) => {
|
|
1118
|
+
const [, a] = O.extractLangRegionFromBCP47(s.language), [, c] = O.extractLangRegionFromBCP47(o.language), l = i && a === i.split("-")[1], h = i && c === i.split("-")[1];
|
|
1119
|
+
return l && !h ? -1 : !l && h ? 1 : O.sortByQuality(s, o, n, r);
|
|
1082
1120
|
});
|
|
1083
1121
|
}
|
|
1084
1122
|
/**
|
|
@@ -1087,10 +1125,10 @@ class O {
|
|
|
1087
1125
|
static async sortAlphabetically(e) {
|
|
1088
1126
|
const r = await Te(e);
|
|
1089
1127
|
e.sort((n, i) => {
|
|
1090
|
-
const [s] = O.extractLangRegionFromBCP47(n.language), [
|
|
1128
|
+
const [s] = O.extractLangRegionFromBCP47(n.language), [o] = O.extractLangRegionFromBCP47(i.language), a = O.getLanguageDisplayName(s).toLowerCase(), c = O.getLanguageDisplayName(o).toLowerCase(), l = a.localeCompare(c);
|
|
1091
1129
|
if (l !== 0)
|
|
1092
1130
|
return l;
|
|
1093
|
-
if (s ===
|
|
1131
|
+
if (s === o) {
|
|
1094
1132
|
const h = De(s), [, d] = O.extractLangRegionFromBCP47(n.language), [, g] = O.extractLangRegionFromBCP47(i.language), f = h && d === h.split("-")[1], y = h && g === h.split("-")[1];
|
|
1095
1133
|
if (f && !y) return -1;
|
|
1096
1134
|
if (!f && y) return 1;
|
|
@@ -1117,12 +1155,12 @@ class O {
|
|
|
1117
1155
|
const c = [...n];
|
|
1118
1156
|
return await O.sortAlphabetically(c), c;
|
|
1119
1157
|
}
|
|
1120
|
-
const i = Wt(e), { voicesByLang: s, otherLangVoices:
|
|
1158
|
+
const i = Wt(e), { voicesByLang: s, otherLangVoices: o } = O.groupVoicesByLanguage(n, i), a = [];
|
|
1121
1159
|
for (const c of i) {
|
|
1122
1160
|
const l = s.get(c.baseLang);
|
|
1123
|
-
l && (await O.sortByDefaultRegion(l, c.baseLang),
|
|
1161
|
+
l && (await O.sortByDefaultRegion(l, c.baseLang), a.push(...l));
|
|
1124
1162
|
}
|
|
1125
|
-
return await O.sortAlphabetically(
|
|
1163
|
+
return await O.sortAlphabetically(o), a.push(...o), a;
|
|
1126
1164
|
}
|
|
1127
1165
|
/**
|
|
1128
1166
|
* Sort languages by region preference, then voices by quality
|
|
@@ -1130,21 +1168,21 @@ class O {
|
|
|
1130
1168
|
static async sortByPreferredRegion(e, r) {
|
|
1131
1169
|
const n = await Te(e);
|
|
1132
1170
|
e.sort((i, s) => {
|
|
1133
|
-
const [,
|
|
1171
|
+
const [, o] = O.extractLangRegionFromBCP47(i.language), [, a] = O.extractLangRegionFromBCP47(s.language), c = o && r.regions.includes(o), l = a && r.regions.includes(a);
|
|
1134
1172
|
if (c && l) {
|
|
1135
|
-
const y = r.regions.indexOf(
|
|
1173
|
+
const y = r.regions.indexOf(o), p = r.regions.indexOf(a);
|
|
1136
1174
|
return y === p ? O.sortByQuality(i, s, n, r.baseLang) : y - p;
|
|
1137
1175
|
}
|
|
1138
1176
|
if (c) return -1;
|
|
1139
1177
|
if (l) return 1;
|
|
1140
|
-
const h = De(r.baseLang), [, d] = O.extractLangRegionFromBCP47(h), g =
|
|
1178
|
+
const h = De(r.baseLang), [, d] = O.extractLangRegionFromBCP47(h), g = o === d, f = a === d;
|
|
1141
1179
|
if (g && !f) return -1;
|
|
1142
1180
|
if (!g && f) return 1;
|
|
1143
|
-
if (
|
|
1144
|
-
const y =
|
|
1181
|
+
if (o && a) {
|
|
1182
|
+
const y = o.localeCompare(a);
|
|
1145
1183
|
return y !== 0 ? y : O.sortByQuality(i, s, n, r.baseLang);
|
|
1146
1184
|
}
|
|
1147
|
-
return
|
|
1185
|
+
return o ? -1 : a ? 1 : O.sortByQuality(i, s, n, r.baseLang);
|
|
1148
1186
|
});
|
|
1149
1187
|
}
|
|
1150
1188
|
/**
|
|
@@ -1156,12 +1194,12 @@ class O {
|
|
|
1156
1194
|
async sortVoicesByRegions(e, r) {
|
|
1157
1195
|
const n = r || this.voices;
|
|
1158
1196
|
if (!n?.length) return [];
|
|
1159
|
-
const i = Wt(e || []), { voicesByLang: s, otherLangVoices:
|
|
1197
|
+
const i = Wt(e || []), { voicesByLang: s, otherLangVoices: o } = O.groupVoicesByLanguage(n, i), a = [];
|
|
1160
1198
|
for (const c of i) {
|
|
1161
1199
|
const l = s.get(c.baseLang);
|
|
1162
|
-
l && (await O.sortByPreferredRegion(l, c),
|
|
1200
|
+
l && (await O.sortByPreferredRegion(l, c), a.push(...l));
|
|
1163
1201
|
}
|
|
1164
|
-
return await O.sortAlphabetically(
|
|
1202
|
+
return await O.sortAlphabetically(o), a.push(...o), a;
|
|
1165
1203
|
}
|
|
1166
1204
|
/**
|
|
1167
1205
|
* Group voices by the specified criteria
|
|
@@ -1172,28 +1210,28 @@ class O {
|
|
|
1172
1210
|
groupVoices(e, r) {
|
|
1173
1211
|
const n = {}, i = r || this.voices;
|
|
1174
1212
|
for (const s of i) {
|
|
1175
|
-
let
|
|
1213
|
+
let o = "Unknown";
|
|
1176
1214
|
switch (e) {
|
|
1177
1215
|
case "languages":
|
|
1178
|
-
|
|
1216
|
+
o = O.extractLangRegionFromBCP47(s.language)[0];
|
|
1179
1217
|
break;
|
|
1180
1218
|
case "gender":
|
|
1181
|
-
|
|
1219
|
+
o = s.gender || "unknown";
|
|
1182
1220
|
break;
|
|
1183
1221
|
case "quality":
|
|
1184
|
-
|
|
1222
|
+
o = s.quality || "unknown";
|
|
1185
1223
|
break;
|
|
1186
1224
|
case "region":
|
|
1187
|
-
const [,
|
|
1188
|
-
|
|
1225
|
+
const [, a] = O.extractLangRegionFromBCP47(s.language);
|
|
1226
|
+
o = a || "unknown";
|
|
1189
1227
|
break;
|
|
1190
1228
|
}
|
|
1191
|
-
n[
|
|
1229
|
+
n[o] || (n[o] = []), n[o].push(s);
|
|
1192
1230
|
}
|
|
1193
1231
|
return n;
|
|
1194
1232
|
}
|
|
1195
1233
|
}
|
|
1196
|
-
const zn = ["webKit", "moz", "ms", "o"],
|
|
1234
|
+
const zn = ["webKit", "moz", "ms", "o"], Hn = [
|
|
1197
1235
|
"boundary",
|
|
1198
1236
|
"end",
|
|
1199
1237
|
"error",
|
|
@@ -1201,8 +1239,8 @@ const zn = ["webKit", "moz", "ms", "o"], _n = [
|
|
|
1201
1239
|
"pause",
|
|
1202
1240
|
"resume",
|
|
1203
1241
|
"start"
|
|
1204
|
-
],
|
|
1205
|
-
const e =
|
|
1242
|
+
], _n = (t) => `${t.charAt(0).toUpperCase()}${t.slice(1)}`, ge = (t = {}, e) => Object.hasOwnProperty.call(t, e) || e in t || !!t[e], Fn = (t) => typeof window < "u" && t in window, Mn = (t) => {
|
|
1243
|
+
const e = _n(t), r = zn.map((i) => `${i}${e}`), n = [t, e].concat(r).find(Fn);
|
|
1206
1244
|
return n && typeof window < "u" ? window[n] : void 0;
|
|
1207
1245
|
}, Vn = () => {
|
|
1208
1246
|
const t = {};
|
|
@@ -1216,7 +1254,7 @@ const zn = ["webKit", "moz", "ms", "o"], _n = [
|
|
|
1216
1254
|
t[r] = Mn(r);
|
|
1217
1255
|
}), t.onvoiceschanged = ge(t.speechSynthesis, "onvoiceschanged"), t.speechSynthesisSpeaking = ge(t.speechSynthesis, "speaking"), t.speechSynthesisPaused = ge(t.speechSynthesis, "paused");
|
|
1218
1256
|
const e = t.speechSynthesisUtterance ? ge(t.speechSynthesisUtterance, "prototype") : !1;
|
|
1219
|
-
return
|
|
1257
|
+
return Hn.forEach((r) => {
|
|
1220
1258
|
const n = `on${r}`;
|
|
1221
1259
|
t[n] = e && t.speechSynthesisUtterance ? ge(t.speechSynthesisUtterance.prototype, n) : !1;
|
|
1222
1260
|
}), t;
|
|
@@ -1242,12 +1280,12 @@ function Kn() {
|
|
|
1242
1280
|
function e(n) {
|
|
1243
1281
|
if (n = n || {}, n.circles) return r(n);
|
|
1244
1282
|
const i = /* @__PURE__ */ new Map();
|
|
1245
|
-
if (i.set(Date, (l) => new Date(l)), i.set(Map, (l, h) => new Map(
|
|
1283
|
+
if (i.set(Date, (l) => new Date(l)), i.set(Map, (l, h) => new Map(o(Array.from(l), h))), i.set(Set, (l, h) => new Set(o(Array.from(l), h))), n.constructorHandlers)
|
|
1246
1284
|
for (const l of n.constructorHandlers)
|
|
1247
1285
|
i.set(l[0], l[1]);
|
|
1248
1286
|
let s = null;
|
|
1249
|
-
return n.proto ? c :
|
|
1250
|
-
function
|
|
1287
|
+
return n.proto ? c : a;
|
|
1288
|
+
function o(l, h) {
|
|
1251
1289
|
const d = Object.keys(l), g = new Array(d.length);
|
|
1252
1290
|
for (let f = 0; f < d.length; f++) {
|
|
1253
1291
|
const y = d[f], p = l[y];
|
|
@@ -1255,22 +1293,22 @@ function Kn() {
|
|
|
1255
1293
|
}
|
|
1256
1294
|
return g;
|
|
1257
1295
|
}
|
|
1258
|
-
function
|
|
1296
|
+
function a(l) {
|
|
1259
1297
|
if (typeof l != "object" || l === null) return l;
|
|
1260
|
-
if (Array.isArray(l)) return
|
|
1298
|
+
if (Array.isArray(l)) return o(l, a);
|
|
1261
1299
|
if (l.constructor !== Object && (s = i.get(l.constructor)))
|
|
1262
|
-
return s(l,
|
|
1300
|
+
return s(l, a);
|
|
1263
1301
|
const h = {};
|
|
1264
1302
|
for (const d in l) {
|
|
1265
1303
|
if (Object.hasOwnProperty.call(l, d) === !1) continue;
|
|
1266
1304
|
const g = l[d];
|
|
1267
|
-
typeof g != "object" || g === null ? h[d] = g : g.constructor !== Object && (s = i.get(g.constructor)) ? h[d] = s(g,
|
|
1305
|
+
typeof g != "object" || g === null ? h[d] = g : g.constructor !== Object && (s = i.get(g.constructor)) ? h[d] = s(g, a) : ArrayBuffer.isView(g) ? h[d] = t(g) : h[d] = a(g);
|
|
1268
1306
|
}
|
|
1269
1307
|
return h;
|
|
1270
1308
|
}
|
|
1271
1309
|
function c(l) {
|
|
1272
1310
|
if (typeof l != "object" || l === null) return l;
|
|
1273
|
-
if (Array.isArray(l)) return
|
|
1311
|
+
if (Array.isArray(l)) return o(l, c);
|
|
1274
1312
|
if (l.constructor !== Object && (s = i.get(l.constructor)))
|
|
1275
1313
|
return s(l, c);
|
|
1276
1314
|
const h = {};
|
|
@@ -1282,11 +1320,11 @@ function Kn() {
|
|
|
1282
1320
|
}
|
|
1283
1321
|
}
|
|
1284
1322
|
function r(n) {
|
|
1285
|
-
const i = [], s = [],
|
|
1286
|
-
if (
|
|
1323
|
+
const i = [], s = [], o = /* @__PURE__ */ new Map();
|
|
1324
|
+
if (o.set(Date, (d) => new Date(d)), o.set(Map, (d, g) => new Map(c(Array.from(d), g))), o.set(Set, (d, g) => new Set(c(Array.from(d), g))), n.constructorHandlers)
|
|
1287
1325
|
for (const d of n.constructorHandlers)
|
|
1288
|
-
|
|
1289
|
-
let
|
|
1326
|
+
o.set(d[0], d[1]);
|
|
1327
|
+
let a = null;
|
|
1290
1328
|
return n.proto ? h : l;
|
|
1291
1329
|
function c(d, g) {
|
|
1292
1330
|
const f = Object.keys(d), y = new Array(f.length);
|
|
@@ -1294,8 +1332,8 @@ function Kn() {
|
|
|
1294
1332
|
const m = f[p], w = d[m];
|
|
1295
1333
|
if (typeof w != "object" || w === null)
|
|
1296
1334
|
y[m] = w;
|
|
1297
|
-
else if (w.constructor !== Object && (
|
|
1298
|
-
y[m] =
|
|
1335
|
+
else if (w.constructor !== Object && (a = o.get(w.constructor)))
|
|
1336
|
+
y[m] = a(w, g);
|
|
1299
1337
|
else if (ArrayBuffer.isView(w))
|
|
1300
1338
|
y[m] = t(w);
|
|
1301
1339
|
else {
|
|
@@ -1308,8 +1346,8 @@ function Kn() {
|
|
|
1308
1346
|
function l(d) {
|
|
1309
1347
|
if (typeof d != "object" || d === null) return d;
|
|
1310
1348
|
if (Array.isArray(d)) return c(d, l);
|
|
1311
|
-
if (d.constructor !== Object && (
|
|
1312
|
-
return
|
|
1349
|
+
if (d.constructor !== Object && (a = o.get(d.constructor)))
|
|
1350
|
+
return a(d, l);
|
|
1313
1351
|
const g = {};
|
|
1314
1352
|
i.push(d), s.push(g);
|
|
1315
1353
|
for (const f in d) {
|
|
@@ -1317,8 +1355,8 @@ function Kn() {
|
|
|
1317
1355
|
const y = d[f];
|
|
1318
1356
|
if (typeof y != "object" || y === null)
|
|
1319
1357
|
g[f] = y;
|
|
1320
|
-
else if (y.constructor !== Object && (
|
|
1321
|
-
g[f] =
|
|
1358
|
+
else if (y.constructor !== Object && (a = o.get(y.constructor)))
|
|
1359
|
+
g[f] = a(y, l);
|
|
1322
1360
|
else if (ArrayBuffer.isView(y))
|
|
1323
1361
|
g[f] = t(y);
|
|
1324
1362
|
else {
|
|
@@ -1331,16 +1369,16 @@ function Kn() {
|
|
|
1331
1369
|
function h(d) {
|
|
1332
1370
|
if (typeof d != "object" || d === null) return d;
|
|
1333
1371
|
if (Array.isArray(d)) return c(d, h);
|
|
1334
|
-
if (d.constructor !== Object && (
|
|
1335
|
-
return
|
|
1372
|
+
if (d.constructor !== Object && (a = o.get(d.constructor)))
|
|
1373
|
+
return a(d, h);
|
|
1336
1374
|
const g = {};
|
|
1337
1375
|
i.push(d), s.push(g);
|
|
1338
1376
|
for (const f in d) {
|
|
1339
1377
|
const y = d[f];
|
|
1340
1378
|
if (typeof y != "object" || y === null)
|
|
1341
1379
|
g[f] = y;
|
|
1342
|
-
else if (y.constructor !== Object && (
|
|
1343
|
-
g[f] =
|
|
1380
|
+
else if (y.constructor !== Object && (a = o.get(y.constructor)))
|
|
1381
|
+
g[f] = a(y, h);
|
|
1344
1382
|
else if (ArrayBuffer.isView(y))
|
|
1345
1383
|
g[f] = t(y);
|
|
1346
1384
|
else {
|
|
@@ -1354,8 +1392,8 @@ function Kn() {
|
|
|
1354
1392
|
return Je;
|
|
1355
1393
|
}
|
|
1356
1394
|
var Jn = Kn();
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1395
|
+
const Pr = /* @__PURE__ */ Gn(Jn);
|
|
1396
|
+
Pr();
|
|
1359
1397
|
function yt(t) {
|
|
1360
1398
|
if (t == null || typeof t != "object") return !1;
|
|
1361
1399
|
let e = Object.getPrototypeOf(t);
|
|
@@ -1370,13 +1408,13 @@ function Qn(t) {
|
|
|
1370
1408
|
function X(t) {
|
|
1371
1409
|
return Number.isSafeInteger(t) && t >= 0;
|
|
1372
1410
|
}
|
|
1373
|
-
function
|
|
1411
|
+
function M(t) {
|
|
1374
1412
|
return t != null;
|
|
1375
1413
|
}
|
|
1376
1414
|
function Xn(t, e) {
|
|
1377
1415
|
return yt(t) && ee(e) && e in t;
|
|
1378
1416
|
}
|
|
1379
|
-
var Zn = typeof globalThis == "object" && globalThis && globalThis.Object === Object && globalThis, Yn = typeof self == "object" && self && self.Object === Object && self, It = Zn || Yn || Function("return this")(), se = It.Symbol,
|
|
1417
|
+
var Zn = typeof globalThis == "object" && globalThis && globalThis.Object === Object && globalThis, Yn = typeof self == "object" && self && self.Object === Object && self, It = Zn || Yn || Function("return this")(), se = It.Symbol, $r = Object.prototype, ei = $r.hasOwnProperty, ti = $r.toString, fe = se ? se.toStringTag : void 0;
|
|
1380
1418
|
function ri(t) {
|
|
1381
1419
|
var e = ei.call(t, fe), r = t[fe];
|
|
1382
1420
|
try {
|
|
@@ -1391,9 +1429,9 @@ var ni = Object.prototype, ii = ni.toString;
|
|
|
1391
1429
|
function si(t) {
|
|
1392
1430
|
return ii.call(t);
|
|
1393
1431
|
}
|
|
1394
|
-
var
|
|
1432
|
+
var ai = "[object Null]", oi = "[object Undefined]", Xt = se ? se.toStringTag : void 0;
|
|
1395
1433
|
function Dr(t) {
|
|
1396
|
-
return t == null ? t === void 0 ?
|
|
1434
|
+
return t == null ? t === void 0 ? oi : ai : Xt && Xt in Object(t) ? ri(t) : si(t);
|
|
1397
1435
|
}
|
|
1398
1436
|
function Br(t) {
|
|
1399
1437
|
return t != null && typeof t == "object";
|
|
@@ -1463,7 +1501,7 @@ function Oi(t) {
|
|
|
1463
1501
|
}
|
|
1464
1502
|
return "";
|
|
1465
1503
|
}
|
|
1466
|
-
var xi = /[\\^$.*+?()[\]{}|]/g, Ei = /^\[object .+?Constructor\]$/,
|
|
1504
|
+
var xi = /[\\^$.*+?()[\]{}|]/g, Ei = /^\[object .+?Constructor\]$/, Ci = Function.prototype, Ai = Object.prototype, Ti = Ci.toString, Ri = Ai.hasOwnProperty, Ni = RegExp(
|
|
1467
1505
|
"^" + Ti.call(Ri).replace(xi, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1468
1506
|
);
|
|
1469
1507
|
function Li(t) {
|
|
@@ -1475,7 +1513,7 @@ function Li(t) {
|
|
|
1475
1513
|
function Ii(t, e) {
|
|
1476
1514
|
return t?.[e];
|
|
1477
1515
|
}
|
|
1478
|
-
function
|
|
1516
|
+
function Pt(t, e) {
|
|
1479
1517
|
var r = Ii(t, e);
|
|
1480
1518
|
return Li(r) ? r : void 0;
|
|
1481
1519
|
}
|
|
@@ -1492,13 +1530,13 @@ function qi(t, e, r) {
|
|
|
1492
1530
|
}
|
|
1493
1531
|
return t.apply(e, r);
|
|
1494
1532
|
}
|
|
1495
|
-
var
|
|
1533
|
+
var Pi = 800, $i = 16, Di = Date.now;
|
|
1496
1534
|
function Bi(t) {
|
|
1497
1535
|
var e = 0, r = 0;
|
|
1498
1536
|
return function() {
|
|
1499
|
-
var n = Di(), i =
|
|
1537
|
+
var n = Di(), i = $i - (n - r);
|
|
1500
1538
|
if (r = n, i > 0) {
|
|
1501
|
-
if (++e >=
|
|
1539
|
+
if (++e >= Pi)
|
|
1502
1540
|
return arguments[0];
|
|
1503
1541
|
} else
|
|
1504
1542
|
e = 0;
|
|
@@ -1512,7 +1550,7 @@ function ji(t) {
|
|
|
1512
1550
|
}
|
|
1513
1551
|
var tr = (function() {
|
|
1514
1552
|
try {
|
|
1515
|
-
var t =
|
|
1553
|
+
var t = Pt(Object, "defineProperty");
|
|
1516
1554
|
return t({}, "", {}), t;
|
|
1517
1555
|
} catch {
|
|
1518
1556
|
}
|
|
@@ -1524,13 +1562,13 @@ var tr = (function() {
|
|
|
1524
1562
|
writable: !0
|
|
1525
1563
|
});
|
|
1526
1564
|
} : Ur, zi = Bi(Ui);
|
|
1527
|
-
function
|
|
1565
|
+
function Hi(t, e, r, n) {
|
|
1528
1566
|
for (var i = t.length, s = r + -1; ++s < i; )
|
|
1529
1567
|
if (e(t[s], s, t))
|
|
1530
1568
|
return s;
|
|
1531
1569
|
return -1;
|
|
1532
1570
|
}
|
|
1533
|
-
function
|
|
1571
|
+
function _i(t) {
|
|
1534
1572
|
return t !== t;
|
|
1535
1573
|
}
|
|
1536
1574
|
function Fi(t, e, r) {
|
|
@@ -1539,12 +1577,12 @@ function Fi(t, e, r) {
|
|
|
1539
1577
|
return n;
|
|
1540
1578
|
return -1;
|
|
1541
1579
|
}
|
|
1542
|
-
function
|
|
1543
|
-
return e === e ? Fi(t, e, r) :
|
|
1580
|
+
function $t(t, e, r) {
|
|
1581
|
+
return e === e ? Fi(t, e, r) : Hi(t, _i, r);
|
|
1544
1582
|
}
|
|
1545
1583
|
function Mi(t, e) {
|
|
1546
1584
|
var r = t == null ? 0 : t.length;
|
|
1547
|
-
return !!r &&
|
|
1585
|
+
return !!r && $t(t, e, 0) > -1;
|
|
1548
1586
|
}
|
|
1549
1587
|
function Vi(t, e) {
|
|
1550
1588
|
return t === e || t !== t && e !== e;
|
|
@@ -1552,12 +1590,12 @@ function Vi(t, e) {
|
|
|
1552
1590
|
var rr = Math.max;
|
|
1553
1591
|
function Wi(t, e, r) {
|
|
1554
1592
|
return e = rr(e === void 0 ? t.length - 1 : e, 0), function() {
|
|
1555
|
-
for (var n = arguments, i = -1, s = rr(n.length - e, 0),
|
|
1556
|
-
|
|
1593
|
+
for (var n = arguments, i = -1, s = rr(n.length - e, 0), o = Array(s); ++i < s; )
|
|
1594
|
+
o[i] = n[e + i];
|
|
1557
1595
|
i = -1;
|
|
1558
|
-
for (var
|
|
1559
|
-
|
|
1560
|
-
return
|
|
1596
|
+
for (var a = Array(e + 1); ++i < e; )
|
|
1597
|
+
a[i] = n[i];
|
|
1598
|
+
return a[e] = r(o), qi(t, this, a);
|
|
1561
1599
|
};
|
|
1562
1600
|
}
|
|
1563
1601
|
function Gi(t, e) {
|
|
@@ -1570,7 +1608,7 @@ function Ji(t) {
|
|
|
1570
1608
|
function Qi(t) {
|
|
1571
1609
|
return t != null && Ji(t.length) && !zr(t);
|
|
1572
1610
|
}
|
|
1573
|
-
var Oe =
|
|
1611
|
+
var Oe = Pt(Object, "create");
|
|
1574
1612
|
function Xi() {
|
|
1575
1613
|
this.__data__ = Oe ? Oe(null) : {}, this.size = 0;
|
|
1576
1614
|
}
|
|
@@ -1592,10 +1630,10 @@ function ss(t) {
|
|
|
1592
1630
|
var e = this.__data__;
|
|
1593
1631
|
return Oe ? e[t] !== void 0 : is.call(e, t);
|
|
1594
1632
|
}
|
|
1595
|
-
var
|
|
1596
|
-
function
|
|
1633
|
+
var as = "__lodash_hash_undefined__";
|
|
1634
|
+
function os(t, e) {
|
|
1597
1635
|
var r = this.__data__;
|
|
1598
|
-
return this.size += this.has(t) ? 0 : 1, r[t] = Oe && e === void 0 ?
|
|
1636
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = Oe && e === void 0 ? as : e, this;
|
|
1599
1637
|
}
|
|
1600
1638
|
function K(t) {
|
|
1601
1639
|
var e = -1, r = t == null ? 0 : t.length;
|
|
@@ -1608,7 +1646,7 @@ K.prototype.clear = Xi;
|
|
|
1608
1646
|
K.prototype.delete = Zi;
|
|
1609
1647
|
K.prototype.get = rs;
|
|
1610
1648
|
K.prototype.has = ss;
|
|
1611
|
-
K.prototype.set =
|
|
1649
|
+
K.prototype.set = os;
|
|
1612
1650
|
function ls() {
|
|
1613
1651
|
this.__data__ = [], this.size = 0;
|
|
1614
1652
|
}
|
|
@@ -1649,7 +1687,7 @@ le.prototype.delete = hs;
|
|
|
1649
1687
|
le.prototype.get = ds;
|
|
1650
1688
|
le.prototype.has = gs;
|
|
1651
1689
|
le.prototype.set = fs;
|
|
1652
|
-
var ps =
|
|
1690
|
+
var ps = Pt(It, "Map");
|
|
1653
1691
|
function ms() {
|
|
1654
1692
|
this.size = 0, this.__data__ = {
|
|
1655
1693
|
hash: new K(),
|
|
@@ -1705,19 +1743,19 @@ function xs(t, e, r) {
|
|
|
1705
1743
|
var n = t.length;
|
|
1706
1744
|
return r = r === void 0 ? n : r, !e && r >= n ? t : Os(t, e, r);
|
|
1707
1745
|
}
|
|
1708
|
-
var Es = "\\ud800-\\udfff",
|
|
1746
|
+
var Es = "\\ud800-\\udfff", Cs = "\\u0300-\\u036f", As = "\\ufe20-\\ufe2f", Ts = "\\u20d0-\\u20ff", Rs = Cs + As + Ts, Ns = "\\ufe0e\\ufe0f", Ls = "\\u200d", Is = RegExp("[" + Ls + Es + Rs + Ns + "]");
|
|
1709
1747
|
function qs(t) {
|
|
1710
1748
|
return Is.test(t);
|
|
1711
1749
|
}
|
|
1712
|
-
function
|
|
1750
|
+
function Ps(t) {
|
|
1713
1751
|
return t.split("");
|
|
1714
1752
|
}
|
|
1715
|
-
var
|
|
1753
|
+
var Hr = "\\ud800-\\udfff", $s = "\\u0300-\\u036f", Ds = "\\ufe20-\\ufe2f", Bs = "\\u20d0-\\u20ff", js = $s + Ds + Bs, Us = "\\ufe0e\\ufe0f", zs = "[" + Hr + "]", bt = "[" + js + "]", vt = "\\ud83c[\\udffb-\\udfff]", Hs = "(?:" + bt + "|" + vt + ")", _r = "[^" + Hr + "]", Fr = "(?:\\ud83c[\\udde6-\\uddff]){2}", Mr = "[\\ud800-\\udbff][\\udc00-\\udfff]", _s = "\\u200d", Vr = Hs + "?", Wr = "[" + Us + "]?", Fs = "(?:" + _s + "(?:" + [_r, Fr, Mr].join("|") + ")" + Wr + Vr + ")*", Ms = Wr + Vr + Fs, Vs = "(?:" + [_r + bt + "?", bt, Fr, Mr, zs].join("|") + ")", Ws = RegExp(vt + "(?=" + vt + ")|" + Vs + Ms, "g");
|
|
1716
1754
|
function Gs(t) {
|
|
1717
1755
|
return t.match(Ws) || [];
|
|
1718
1756
|
}
|
|
1719
1757
|
function nr(t) {
|
|
1720
|
-
return qs(t) ? Gs(t) :
|
|
1758
|
+
return qs(t) ? Gs(t) : Ps(t);
|
|
1721
1759
|
}
|
|
1722
1760
|
var Ks = "__lodash_hash_undefined__";
|
|
1723
1761
|
function Js(t) {
|
|
@@ -1740,15 +1778,15 @@ function Zs(t) {
|
|
|
1740
1778
|
return Br(t) && Qi(t);
|
|
1741
1779
|
}
|
|
1742
1780
|
var Ys = 200;
|
|
1743
|
-
function
|
|
1744
|
-
var i = -1, s = Mi,
|
|
1745
|
-
if (!
|
|
1781
|
+
function ea(t, e, r, n) {
|
|
1782
|
+
var i = -1, s = Mi, o = !0, a = t.length, c = [], l = e.length;
|
|
1783
|
+
if (!a)
|
|
1746
1784
|
return c;
|
|
1747
|
-
e.length >= Ys && (s = Xs,
|
|
1785
|
+
e.length >= Ys && (s = Xs, o = !1, e = new je(e));
|
|
1748
1786
|
e:
|
|
1749
|
-
for (; ++i <
|
|
1787
|
+
for (; ++i < a; ) {
|
|
1750
1788
|
var h = t[i], d = h;
|
|
1751
|
-
if (h = h !== 0 ? h : 0,
|
|
1789
|
+
if (h = h !== 0 ? h : 0, o && d === d) {
|
|
1752
1790
|
for (var g = l; g--; )
|
|
1753
1791
|
if (e[g] === d)
|
|
1754
1792
|
continue e;
|
|
@@ -1757,13 +1795,13 @@ function eo(t, e, r, n) {
|
|
|
1757
1795
|
}
|
|
1758
1796
|
return c;
|
|
1759
1797
|
}
|
|
1760
|
-
function
|
|
1761
|
-
for (var r = t.length; r-- &&
|
|
1798
|
+
function ta(t, e) {
|
|
1799
|
+
for (var r = t.length; r-- && $t(e, t[r], 0) > -1; )
|
|
1762
1800
|
;
|
|
1763
1801
|
return r;
|
|
1764
1802
|
}
|
|
1765
|
-
function
|
|
1766
|
-
for (var r = -1, n = t.length; ++r < n &&
|
|
1803
|
+
function ra(t, e) {
|
|
1804
|
+
for (var r = -1, n = t.length; ++r < n && $t(e, t[r], 0) > -1; )
|
|
1767
1805
|
;
|
|
1768
1806
|
return r;
|
|
1769
1807
|
}
|
|
@@ -1772,11 +1810,11 @@ function ir(t, e, r) {
|
|
|
1772
1810
|
return pi(t);
|
|
1773
1811
|
if (!t || !(e = qt(e)))
|
|
1774
1812
|
return t;
|
|
1775
|
-
var n = nr(t), i = nr(e), s =
|
|
1776
|
-
return xs(n, s,
|
|
1813
|
+
var n = nr(t), i = nr(e), s = ra(n, i), o = ta(n, i) + 1;
|
|
1814
|
+
return xs(n, s, o).join("");
|
|
1777
1815
|
}
|
|
1778
|
-
var
|
|
1779
|
-
return Zs(t) ?
|
|
1816
|
+
var na = Gi(function(t, e) {
|
|
1817
|
+
return Zs(t) ? ea(t, e) : [];
|
|
1780
1818
|
}), ne = function() {
|
|
1781
1819
|
return ne = Object.assign || function(t) {
|
|
1782
1820
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
@@ -1785,11 +1823,11 @@ var no = Gi(function(t, e) {
|
|
|
1785
1823
|
}
|
|
1786
1824
|
return t;
|
|
1787
1825
|
}, ne.apply(this, arguments);
|
|
1788
|
-
},
|
|
1826
|
+
}, ia = "~", sa = "~~";
|
|
1789
1827
|
function Dt(t, e) {
|
|
1790
|
-
for (var r = {}, n = {}, i = t.split(
|
|
1791
|
-
for (var
|
|
1792
|
-
var l =
|
|
1828
|
+
for (var r = {}, n = {}, i = t.split(sa), s = !1, o = 0; i.length > o; o++) {
|
|
1829
|
+
for (var a = i[o].split(ia), c = 0; c < a.length; c += 2) {
|
|
1830
|
+
var l = a[c], h = a[c + 1], d = "&" + l + ";";
|
|
1793
1831
|
r[d] = h, s && (r["&" + l] = h), n[h] = d;
|
|
1794
1832
|
}
|
|
1795
1833
|
s = !0;
|
|
@@ -1800,11 +1838,11 @@ var Xe = {
|
|
|
1800
1838
|
xml: /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,
|
|
1801
1839
|
html4: /∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,
|
|
1802
1840
|
html5: /·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g
|
|
1803
|
-
},
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
oe.html5 = Dt('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®', oe.html4);
|
|
1807
|
-
var
|
|
1841
|
+
}, ae = {};
|
|
1842
|
+
ae.xml = Dt(`lt~<~gt~>~quot~"~apos~'~amp~&`);
|
|
1843
|
+
ae.html4 = Dt(`apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~~zwj~~lrm~~rlm~~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~"~amp~&~lt~<~gt~>`);
|
|
1844
|
+
ae.html5 = Dt('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~ ~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®', ae.html4);
|
|
1845
|
+
var aa = {
|
|
1808
1846
|
0: 65533,
|
|
1809
1847
|
128: 8364,
|
|
1810
1848
|
130: 8218,
|
|
@@ -1833,17 +1871,17 @@ var oo = {
|
|
|
1833
1871
|
156: 339,
|
|
1834
1872
|
158: 382,
|
|
1835
1873
|
159: 376
|
|
1836
|
-
},
|
|
1874
|
+
}, oa = String.fromCodePoint || function(t) {
|
|
1837
1875
|
return String.fromCharCode(Math.floor((t - 65536) / 1024) + 55296, (t - 65536) % 1024 + 56320);
|
|
1838
|
-
},
|
|
1839
|
-
return
|
|
1876
|
+
}, oe = function() {
|
|
1877
|
+
return oe = Object.assign || function(t) {
|
|
1840
1878
|
for (var e, r = 1, n = arguments.length; r < n; r++) {
|
|
1841
1879
|
e = arguments[r];
|
|
1842
1880
|
for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
1843
1881
|
}
|
|
1844
1882
|
return t;
|
|
1845
|
-
},
|
|
1846
|
-
},
|
|
1883
|
+
}, oe.apply(this, arguments);
|
|
1884
|
+
}, la = oe(oe({}, ae), { all: ae.html5 }), ca = {
|
|
1847
1885
|
scope: "body",
|
|
1848
1886
|
level: "all"
|
|
1849
1887
|
}, Ze = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g, Ye = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g, sr = {
|
|
@@ -1862,101 +1900,101 @@ var oo = {
|
|
|
1862
1900
|
attribute: Ye,
|
|
1863
1901
|
body: Xe.html5
|
|
1864
1902
|
}
|
|
1865
|
-
},
|
|
1866
|
-
function
|
|
1903
|
+
}, ua = oe(oe({}, sr), { all: sr.html5 }), Gr = String.fromCharCode, ha = Gr(65533);
|
|
1904
|
+
function da(t, e, r, n) {
|
|
1867
1905
|
var i = t, s = t[t.length - 1];
|
|
1868
1906
|
if (r && s === "=")
|
|
1869
1907
|
i = t;
|
|
1870
1908
|
else if (n && s !== ";")
|
|
1871
1909
|
i = t;
|
|
1872
1910
|
else {
|
|
1873
|
-
var
|
|
1874
|
-
if (
|
|
1875
|
-
i =
|
|
1911
|
+
var o = e[t];
|
|
1912
|
+
if (o)
|
|
1913
|
+
i = o;
|
|
1876
1914
|
else if (t[0] === "&" && t[1] === "#") {
|
|
1877
|
-
var
|
|
1878
|
-
i = c >= 1114111 ?
|
|
1915
|
+
var a = t[2], c = a == "x" || a == "X" ? parseInt(t.substr(3), 16) : parseInt(t.substr(2));
|
|
1916
|
+
i = c >= 1114111 ? ha : c > 65535 ? oa(c) : Gr(aa[c] || c);
|
|
1879
1917
|
}
|
|
1880
1918
|
}
|
|
1881
1919
|
return i;
|
|
1882
1920
|
}
|
|
1883
|
-
function
|
|
1884
|
-
var r = e === void 0 ?
|
|
1921
|
+
function ar(t, e) {
|
|
1922
|
+
var r = e === void 0 ? ca : e, n = r.level, i = n === void 0 ? "all" : n, s = r.scope, o = s === void 0 ? i === "xml" ? "strict" : "body" : s;
|
|
1885
1923
|
if (!t)
|
|
1886
1924
|
return "";
|
|
1887
|
-
var
|
|
1888
|
-
return t.replace(
|
|
1889
|
-
return
|
|
1925
|
+
var a = ua[i][o], c = la[i].entities, l = o === "attribute", h = o === "strict";
|
|
1926
|
+
return t.replace(a, function(d) {
|
|
1927
|
+
return da(d, c, l, h);
|
|
1890
1928
|
});
|
|
1891
1929
|
}
|
|
1892
|
-
var
|
|
1930
|
+
var ga = { strictlyTwoElementsInRangeArrays: !1, progressFn: null };
|
|
1893
1931
|
function Ue(t, e) {
|
|
1894
1932
|
if (!Array.isArray(t) || !t.length) return t;
|
|
1895
|
-
let r = { ...
|
|
1896
|
-
if (r.strictlyTwoElementsInRangeArrays && !t.every((
|
|
1897
|
-
if (!t.every((
|
|
1898
|
-
let s = t.length ** 2,
|
|
1899
|
-
return Array.from(t).sort((
|
|
1900
|
-
}
|
|
1901
|
-
var
|
|
1902
|
-
function
|
|
1933
|
+
let r = { ...ga, ...e }, n, i;
|
|
1934
|
+
if (r.strictlyTwoElementsInRangeArrays && !t.every((a, c) => !Array.isArray(a) || a.length !== 2 ? (n = c, i = a.length, !1) : !0)) throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${n}th range (${JSON.stringify(t[n], null, 4)}) has not two but ${i} elements!`);
|
|
1935
|
+
if (!t.every((a, c) => !Array.isArray(a) || !Number.isInteger(a[0]) || a[0] < 0 || !Number.isInteger(a[1]) || a[1] < 0 ? (n = c, !1) : !0)) throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${n}th range (${JSON.stringify(t[n], null, 4)}) does not consist of only natural numbers!`);
|
|
1936
|
+
let s = t.length ** 2, o = 0;
|
|
1937
|
+
return Array.from(t).sort((a, c) => (r.progressFn && (o += 1, r.progressFn(Math.floor(o * 100 / s))), a[0] === c[0] ? a[1] < c[1] ? -1 : a[1] > c[1] ? 1 : 0 : a[0] < c[0] ? -1 : 1));
|
|
1938
|
+
}
|
|
1939
|
+
var or = { mergeType: 1, progressFn: null, joinRangesThatTouchEdges: !0 };
|
|
1940
|
+
function fa(t, e) {
|
|
1903
1941
|
function r(l) {
|
|
1904
1942
|
return !!l && typeof l == "object" && !Array.isArray(l);
|
|
1905
1943
|
}
|
|
1906
1944
|
if (!Array.isArray(t) || !t.length) return null;
|
|
1907
1945
|
let n;
|
|
1908
1946
|
if (e) if (r(e)) {
|
|
1909
|
-
if (n = { ...
|
|
1947
|
+
if (n = { ...or, ...e }, n.progressFn && r(n.progressFn) && !Object.keys(n.progressFn).length) n.progressFn = null;
|
|
1910
1948
|
else if (n.progressFn && typeof n.progressFn != "function") throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn, null, 4)}`);
|
|
1911
1949
|
if (![1, 2, "1", "2"].includes(n.mergeType)) throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType, null, 4)}`);
|
|
1912
1950
|
if (typeof n.joinRangesThatTouchEdges != "boolean") throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges, null, 4)}`);
|
|
1913
1951
|
} else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
1914
1952
|
${JSON.stringify(e, null, 4)} (type ${typeof e})`);
|
|
1915
|
-
else n = { ...
|
|
1916
|
-
let i = t.filter((l) => Array.isArray(l)).map((l) => [...l]).filter((l) => l[2] !== void 0 || l[0] !== l[1]), s,
|
|
1953
|
+
else n = { ...or };
|
|
1954
|
+
let i = t.filter((l) => Array.isArray(l)).map((l) => [...l]).filter((l) => l[2] !== void 0 || l[0] !== l[1]), s, o, a;
|
|
1917
1955
|
n.progressFn ? s = Ue(i, { progressFn: (l) => {
|
|
1918
|
-
|
|
1956
|
+
a = Math.floor(l / 5), a !== o && (o = a, n.progressFn(a));
|
|
1919
1957
|
} }) : s = Ue(i);
|
|
1920
1958
|
let c = s.length - 1;
|
|
1921
|
-
for (let l = c; l > 0; l--) n.progressFn && (
|
|
1959
|
+
for (let l = c; l > 0; l--) n.progressFn && (a = Math.floor((1 - l / c) * 78) + 21, a !== o && a > o && (o = a, n.progressFn(a))), (s[l][0] <= s[l - 1][0] || !n.joinRangesThatTouchEdges && s[l][0] < s[l - 1][1] || n.joinRangesThatTouchEdges && s[l][0] <= s[l - 1][1]) && (s[l - 1][0] = Math.min(s[l][0], s[l - 1][0]), s[l - 1][1] = Math.max(s[l][1], s[l - 1][1]), s[l][2] !== void 0 && (s[l - 1][0] >= s[l][0] || s[l - 1][1] <= s[l][1]) && s[l - 1][2] !== null && (s[l][2] === null && s[l - 1][2] !== null ? s[l - 1][2] = null : s[l - 1][2] != null ? +n.mergeType == 2 && s[l - 1][0] === s[l][0] ? s[l - 1][2] = s[l][2] : s[l - 1][2] += s[l][2] : s[l - 1][2] = s[l][2]), s.splice(l, 1), l = s.length);
|
|
1922
1960
|
return s.length ? s : null;
|
|
1923
1961
|
}
|
|
1924
|
-
var
|
|
1925
|
-
function
|
|
1962
|
+
var pa = {}, ma = pa.NODE_ENV === "production", lr = "Invariant failed";
|
|
1963
|
+
function ya(t, e) {
|
|
1926
1964
|
if (!t) {
|
|
1927
|
-
if (
|
|
1965
|
+
if (ma)
|
|
1928
1966
|
throw new Error(lr);
|
|
1929
1967
|
var r = lr;
|
|
1930
1968
|
throw new Error(r);
|
|
1931
1969
|
}
|
|
1932
1970
|
}
|
|
1933
|
-
function
|
|
1971
|
+
function ba(t, e, r) {
|
|
1934
1972
|
if (arguments.length === 0) throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");
|
|
1935
1973
|
if (typeof t != "string") throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t, null, 4)}`);
|
|
1936
1974
|
if (e && !Array.isArray(e)) throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e, null, 4)}`);
|
|
1937
|
-
if (!e?.filter((
|
|
1975
|
+
if (!e?.filter((o) => o).length) return t;
|
|
1938
1976
|
let n;
|
|
1939
|
-
Array.isArray(e) && Number.isInteger(e[0]) && Number.isInteger(e[1]) ? n = [Array.from(e)] : n = Array.from(e), n.length, n.filter((
|
|
1940
|
-
if (!Array.isArray(
|
|
1941
|
-
if (!Number.isInteger(
|
|
1942
|
-
if (!Number.isInteger(+
|
|
1943
|
-
n[
|
|
1977
|
+
Array.isArray(e) && Number.isInteger(e[0]) && Number.isInteger(e[1]) ? n = [Array.from(e)] : n = Array.from(e), n.length, n.filter((o) => o).forEach((o, a) => {
|
|
1978
|
+
if (!Array.isArray(o)) throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${a}th element not an array: ${JSON.stringify(o, null, 4)}, which is ${typeof o}`);
|
|
1979
|
+
if (!Number.isInteger(o[0])) {
|
|
1980
|
+
if (!Number.isInteger(+o[0]) || +o[0] < 0) throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${a}th element, array ${JSON.stringify(o, null, 0)}. Its first element is not an integer, string index, but ${typeof o[0]}, equal to: ${JSON.stringify(o[0], null, 4)}.`);
|
|
1981
|
+
n[a][0] = +n[a][0];
|
|
1944
1982
|
}
|
|
1945
|
-
if (!Number.isInteger(
|
|
1946
|
-
if (!Number.isInteger(+
|
|
1947
|
-
n[
|
|
1983
|
+
if (!Number.isInteger(o[1])) {
|
|
1984
|
+
if (!Number.isInteger(+o[1]) || +o[1] < 0) throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${a}th element, array ${JSON.stringify(o, null, 0)}. Its second element is not an integer, string index, but ${typeof o[1]}, equal to: ${JSON.stringify(o[1], null, 4)}.`);
|
|
1985
|
+
n[a][1] = +n[a][1];
|
|
1948
1986
|
}
|
|
1949
1987
|
});
|
|
1950
|
-
let i =
|
|
1988
|
+
let i = fa(n, { progressFn: (o) => {
|
|
1951
1989
|
} });
|
|
1952
|
-
|
|
1990
|
+
ya(i);
|
|
1953
1991
|
let s = i.length;
|
|
1954
1992
|
if (s > 0) {
|
|
1955
|
-
let
|
|
1956
|
-
t = i.reduce((
|
|
1993
|
+
let o = t.slice(i[s - 1][1]);
|
|
1994
|
+
t = i.reduce((a, c, l, h) => {
|
|
1957
1995
|
let d = l === 0 ? 0 : h[l - 1][1], g = h[l][0];
|
|
1958
|
-
return `${
|
|
1959
|
-
}, ""), t +=
|
|
1996
|
+
return `${a}${t.slice(d, g)}${h[l][2] || ""}`;
|
|
1997
|
+
}, ""), t += o;
|
|
1960
1998
|
}
|
|
1961
1999
|
return t;
|
|
1962
2000
|
}
|
|
@@ -1965,39 +2003,39 @@ function et(t, e = 1) {
|
|
|
1965
2003
|
function n(s) {
|
|
1966
2004
|
return Array.from(s).reverse().join("");
|
|
1967
2005
|
}
|
|
1968
|
-
function i(s,
|
|
1969
|
-
let c =
|
|
1970
|
-
` : "\r", l =
|
|
2006
|
+
function i(s, o, a) {
|
|
2007
|
+
let c = a ? `
|
|
2008
|
+
` : "\r", l = a ? "\r" : `
|
|
1971
2009
|
`;
|
|
1972
2010
|
if (!s) return s;
|
|
1973
2011
|
let h = 0, d = "";
|
|
1974
2012
|
for (let g = 0, f = s.length; g < f; g++) (s[g] === c || s[g] === l && s[g - 1] !== c) && h++, `\r
|
|
1975
|
-
`.includes(s[g]) || s[g] === r ? s[g] === r ? d += s[g] : s[g] === c ? h <=
|
|
2013
|
+
`.includes(s[g]) || s[g] === r ? s[g] === r ? d += s[g] : s[g] === c ? h <= o && (d += s[g], s[g + 1] === l && (d += s[g + 1], g++)) : s[g] === l && s?.[g - 1] !== c && h <= o && (d += s[g]) : !s[g + 1] && !h && (d += " ");
|
|
1976
2014
|
return d;
|
|
1977
2015
|
}
|
|
1978
2016
|
if (typeof t == "string" && t.length) {
|
|
1979
2017
|
let s = 1;
|
|
1980
2018
|
typeof +e == "number" && Number.isInteger(+e) && +e >= 0 && (s = +e);
|
|
1981
|
-
let
|
|
1982
|
-
if (!t.trim())
|
|
2019
|
+
let o = "", a = "";
|
|
2020
|
+
if (!t.trim()) o = t;
|
|
1983
2021
|
else if (!t[0].trim()) {
|
|
1984
2022
|
for (let c = 0, l = t.length; c < l; c++) if (t[c].trim()) {
|
|
1985
|
-
|
|
2023
|
+
o = t.slice(0, c);
|
|
1986
2024
|
break;
|
|
1987
2025
|
}
|
|
1988
2026
|
}
|
|
1989
2027
|
if (t.trim() && (t.slice(-1).trim() === "" || t.slice(-1) === r)) {
|
|
1990
2028
|
for (let c = t.length; c--; ) if (t[c].trim()) {
|
|
1991
|
-
|
|
2029
|
+
a = t.slice(c + 1);
|
|
1992
2030
|
break;
|
|
1993
2031
|
}
|
|
1994
2032
|
}
|
|
1995
|
-
return `${i(
|
|
2033
|
+
return `${i(o, s, !1)}${t.trim()}${n(i(n(a), s, !0))}`;
|
|
1996
2034
|
}
|
|
1997
2035
|
return t;
|
|
1998
2036
|
}
|
|
1999
2037
|
var cr = { mergeType: 1, progressFn: null, joinRangesThatTouchEdges: !0 };
|
|
2000
|
-
function
|
|
2038
|
+
function va(t, e) {
|
|
2001
2039
|
function r(l) {
|
|
2002
2040
|
return !!l && typeof l == "object" && !Array.isArray(l);
|
|
2003
2041
|
}
|
|
@@ -2011,17 +2049,17 @@ function wo(t, e) {
|
|
|
2011
2049
|
} else throw new Error(`ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
2012
2050
|
${JSON.stringify(e, null, 4)} (type ${typeof e})`);
|
|
2013
2051
|
else n = { ...cr };
|
|
2014
|
-
let i = t.filter((l) => Array.isArray(l)).map((l) => [...l]).filter((l) => l[2] !== void 0 || l[0] !== l[1]), s,
|
|
2052
|
+
let i = t.filter((l) => Array.isArray(l)).map((l) => [...l]).filter((l) => l[2] !== void 0 || l[0] !== l[1]), s, o, a;
|
|
2015
2053
|
n.progressFn ? s = Ue(i, { progressFn: (l) => {
|
|
2016
|
-
|
|
2054
|
+
a = Math.floor(l / 5), a !== o && (o = a, n.progressFn != null && n.progressFn(a));
|
|
2017
2055
|
} }) : s = Ue(i);
|
|
2018
2056
|
let c = s.length - 1;
|
|
2019
|
-
for (let l = c; l > 0; l--) n.progressFn && (
|
|
2057
|
+
for (let l = c; l > 0; l--) n.progressFn && (a = Math.floor((1 - l / c) * 78) + 21, a !== o && a > o && (o = a, n.progressFn(a))), (s[l][0] <= s[l - 1][0] || !n.joinRangesThatTouchEdges && s[l][0] < s[l - 1][1] || n.joinRangesThatTouchEdges && s[l][0] <= s[l - 1][1]) && (s[l - 1][0] = Math.min(s[l][0], s[l - 1][0]), s[l - 1][1] = Math.max(s[l][1], s[l - 1][1]), s[l][2] !== void 0 && (s[l - 1][0] >= s[l][0] || s[l - 1][1] <= s[l][1]) && s[l - 1][2] !== null && (s[l][2] === null && s[l - 1][2] !== null ? s[l - 1][2] = null : s[l - 1][2] != null ? +(n || {})?.mergeType == 2 && s[l - 1][0] === s[l][0] ? s[l - 1][2] = s[l][2] : s[l - 1][2] += s[l][2] : s[l - 1][2] = s[l][2]), s.splice(l, 1), l = s.length);
|
|
2020
2058
|
return s.length ? s : null;
|
|
2021
2059
|
}
|
|
2022
|
-
var
|
|
2060
|
+
var wa = { limitToBeAddedWhitespace: !1, limitLinebreaksCount: 1, mergeType: 1 }, Sa = class {
|
|
2023
2061
|
constructor(e) {
|
|
2024
|
-
let r = { ...
|
|
2062
|
+
let r = { ...wa, ...e };
|
|
2025
2063
|
if (r.mergeType && r.mergeType !== 1 && r.mergeType !== 2) if (ee(r.mergeType) && r.mergeType.trim() === "1") r.mergeType = 1;
|
|
2026
2064
|
else if (ee(r.mergeType) && r.mergeType.trim() === "2") r.mergeType = 2;
|
|
2027
2065
|
else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof r.mergeType}", equal to ${JSON.stringify(r.mergeType, null, 4)}`);
|
|
@@ -2031,12 +2069,12 @@ var So = { limitToBeAddedWhitespace: !1, limitLinebreaksCount: 1, mergeType: 1 }
|
|
|
2031
2069
|
opts;
|
|
2032
2070
|
add(e, r, n) {
|
|
2033
2071
|
if (e == null && r == null) return;
|
|
2034
|
-
if (
|
|
2072
|
+
if (M(e) && !M(r)) {
|
|
2035
2073
|
if (Array.isArray(e)) {
|
|
2036
2074
|
if (e.length) {
|
|
2037
|
-
if (e.some((
|
|
2038
|
-
e.forEach((
|
|
2039
|
-
Array.isArray(
|
|
2075
|
+
if (e.some((o) => Array.isArray(o))) {
|
|
2076
|
+
e.forEach((o) => {
|
|
2077
|
+
Array.isArray(o) && this.add(...o);
|
|
2040
2078
|
});
|
|
2041
2079
|
return;
|
|
2042
2080
|
}
|
|
@@ -2045,20 +2083,20 @@ var So = { limitToBeAddedWhitespace: !1, limitLinebreaksCount: 1, mergeType: 1 }
|
|
|
2045
2083
|
return;
|
|
2046
2084
|
}
|
|
2047
2085
|
throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e, null, 0)}) but second-one, "to" is not (${JSON.stringify(r, null, 0)})`);
|
|
2048
|
-
} else if (!
|
|
2086
|
+
} else if (!M(e) && M(r)) throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(r, null, 0)}) but first-one, "from" is not (${JSON.stringify(e, null, 0)})`);
|
|
2049
2087
|
let i = +e, s = +r;
|
|
2050
2088
|
if (X(i) && X(s)) {
|
|
2051
|
-
if (
|
|
2089
|
+
if (M(n) && !ee(n) && !Qn(n)) throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof n}, equal to:
|
|
2052
2090
|
${JSON.stringify(n, null, 4)}`);
|
|
2053
|
-
if (
|
|
2054
|
-
if (this.last()[1] = s, this.last()[2], this.last()[2] !== null &&
|
|
2055
|
-
let
|
|
2056
|
-
this.opts.limitToBeAddedWhitespace && (
|
|
2091
|
+
if (M(this.ranges) && Array.isArray(this.last()) && i === this.last()[1]) {
|
|
2092
|
+
if (this.last()[1] = s, this.last()[2], this.last()[2] !== null && M(n)) {
|
|
2093
|
+
let o = this.last()[2] && this.last()[2].length && (!this.opts?.mergeType || this.opts.mergeType === 1) ? `${this.last()[2]}${n}` : n;
|
|
2094
|
+
this.opts.limitToBeAddedWhitespace && (o = et(o, this.opts.limitLinebreaksCount)), ee(o) && !o.length || (this.last()[2] = o);
|
|
2057
2095
|
}
|
|
2058
2096
|
} else {
|
|
2059
2097
|
this.ranges || (this.ranges = []);
|
|
2060
|
-
let
|
|
2061
|
-
this.ranges.push(
|
|
2098
|
+
let o = n !== void 0 && !(ee(n) && !n.length) ? [i, s, n && this.opts.limitToBeAddedWhitespace ? et(n, this.opts.limitLinebreaksCount) : n] : [i, s];
|
|
2099
|
+
this.ranges.push(o);
|
|
2062
2100
|
}
|
|
2063
2101
|
} else throw X(i) && i >= 0 ? new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof s}" equal to: ${JSON.stringify(s, null, 4)}`) : new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof i}" equal to: ${JSON.stringify(i, null, 4)}`);
|
|
2064
2102
|
}
|
|
@@ -2066,7 +2104,7 @@ ${JSON.stringify(n, null, 4)}`);
|
|
|
2066
2104
|
this.add(e, r, n);
|
|
2067
2105
|
}
|
|
2068
2106
|
current() {
|
|
2069
|
-
return Array.isArray(this.ranges) && this.ranges.length ? (this.ranges =
|
|
2107
|
+
return Array.isArray(this.ranges) && this.ranges.length ? (this.ranges = va(this.ranges, { mergeType: this.opts.mergeType }), this.ranges && this.opts.limitToBeAddedWhitespace ? this.ranges.map((e) => M(e[2]) ? [e[0], e[1], et(e[2], this.opts.limitLinebreaksCount)] : e) : this.ranges) : null;
|
|
2070
2108
|
}
|
|
2071
2109
|
wipe() {
|
|
2072
2110
|
this.ranges = [];
|
|
@@ -2080,9 +2118,9 @@ ${JSON.stringify(n, null, 4)}`);
|
|
|
2080
2118
|
return Array.isArray(this.ranges) && this.ranges.length ? this.ranges[this.ranges.length - 1] : null;
|
|
2081
2119
|
}
|
|
2082
2120
|
};
|
|
2083
|
-
|
|
2121
|
+
Pr();
|
|
2084
2122
|
var tt = " ";
|
|
2085
|
-
function
|
|
2123
|
+
function ka({ str: t, idx: e = 0, stopAtNewlines: r = !1, stopAtRawNbsp: n = !1 }) {
|
|
2086
2124
|
if (typeof t != "string" || !t.length || ((!e || typeof e != "number") && (e = 0), !t[e + 1])) return null;
|
|
2087
2125
|
if (t[e + 1] && (t[e + 1].trim() || r && `
|
|
2088
2126
|
\r`.includes(t[e + 1]) || n && t[e + 1] === tt)) return e + 1;
|
|
@@ -2092,10 +2130,10 @@ function Oo({ str: t, idx: e = 0, stopAtNewlines: r = !1, stopAtRawNbsp: n = !1
|
|
|
2092
2130
|
\r`.includes(t[i]) || n && t[i] === tt) return i;
|
|
2093
2131
|
return null;
|
|
2094
2132
|
}
|
|
2095
|
-
function
|
|
2096
|
-
return
|
|
2133
|
+
function j(t, e = 0) {
|
|
2134
|
+
return ka({ str: t, idx: e, stopAtNewlines: !1, stopAtRawNbsp: !1 });
|
|
2097
2135
|
}
|
|
2098
|
-
function
|
|
2136
|
+
function Oa(t) {
|
|
2099
2137
|
return /[-_A-Za-z0-9]/.test(t);
|
|
2100
2138
|
}
|
|
2101
2139
|
function ur(t, e) {
|
|
@@ -2114,42 +2152,42 @@ function Re(t, e, r, n) {
|
|
|
2114
2152
|
function hr(t, e, r) {
|
|
2115
2153
|
return t?.quotes, t?.quotes?.value && Re(e, r + 1, t.quotes.value, ">"), t?.quotes?.next, Re(e, t?.quotes?.next - 1, t?.quotes?.value, ">"), !t?.quotes || !Re(e, r + 1, t.quotes.value, ">") && t?.quotes?.next !== -1 && Re(e, t?.quotes?.next - 1, t?.quotes?.value, ">");
|
|
2116
2154
|
}
|
|
2117
|
-
function
|
|
2155
|
+
function xa(t, e) {
|
|
2118
2156
|
return (e.match(new RegExp(t, "g")) || []).length;
|
|
2119
2157
|
}
|
|
2120
|
-
var pe = /* @__PURE__ */ new Set(["!doctype", "abbr", "address", "area", "article", "aside", "audio", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "doctype", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "param", "picture", "pre", "progress", "rb", "rp", "rt", "rtc", "ruby", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "ul", "var", "video", "wbr", "xml"]), rt = /* @__PURE__ */ new Set(["a", "b", "i", "p", "q", "s", "u"]), nt = /* @__PURE__ */ new Set([".", ",", ";", "!", "?"]), dr = /* @__PURE__ */ new Set([".", ",", "?", ";", ")", "…", '"', "»"]),
|
|
2158
|
+
var pe = /* @__PURE__ */ new Set(["!doctype", "abbr", "address", "area", "article", "aside", "audio", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "doctype", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "param", "picture", "pre", "progress", "rb", "rp", "rt", "rtc", "ruby", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "ul", "var", "video", "wbr", "xml"]), rt = /* @__PURE__ */ new Set(["a", "b", "i", "p", "q", "s", "u"]), nt = /* @__PURE__ */ new Set([".", ",", ";", "!", "?"]), dr = /* @__PURE__ */ new Set([".", ",", "?", ";", ")", "…", '"', "»"]), Ea = /* @__PURE__ */ new Set(["a", "abbr", "acronym", "audio", "b", "bdi", "bdo", "big", "button", "canvas", "cite", "code", "data", "datalist", "del", "dfn", "em", "embed", "i", "iframe", "input", "ins", "kbd", "label", "map", "mark", "meter", "noscript", "object", "output", "picture", "progress", "q", "ruby", "s", "samp", "select", "slot", "small", "span", "strong", "sub", "sup", "svg", "template", "textarea", "time", "u", "tt", "var", "video", "wbr"]), gr = { ignoreTags: [], ignoreTagsWithTheirContents: [], onlyStripTags: [], stripTogetherWithTheirContents: ["script", "style", "xml"], skipHtmlDecoding: !1, trimOnlySpaces: !1, stripRecognisedHTMLOnly: !1, dumpLinkHrefsNearby: { enabled: !1, putOnNewLine: !1, wrapHeads: "", wrapTails: "" }, ignoreIndentations: !1, cb: null, reportProgressFunc: null, reportProgressFuncFrom: 0, reportProgressFuncTo: 100 };
|
|
2121
2159
|
function Kr(t, e) {
|
|
2122
|
-
let r = Date.now(), n = [], i = [], s = [],
|
|
2160
|
+
let r = Date.now(), n = [], i = [], s = [], o = [], a = {};
|
|
2123
2161
|
function c() {
|
|
2124
|
-
|
|
2162
|
+
a = { attributes: [] };
|
|
2125
2163
|
}
|
|
2126
2164
|
c();
|
|
2127
2165
|
let l = null, h = null, d = null, g = !1, f = {}, y = { tagName: "", hrefValue: "", openingTagEnds: void 0 }, p = "", m = !1, w = null, E = !0;
|
|
2128
2166
|
function x(u, v, k) {
|
|
2129
|
-
if (Array.isArray(v.stripTogetherWithTheirContents) && (v.stripTogetherWithTheirContents.includes(
|
|
2130
|
-
for (let S = n.length; S--; ) if (n[S].name ===
|
|
2131
|
-
|
|
2167
|
+
if (Array.isArray(v.stripTogetherWithTheirContents) && (v.stripTogetherWithTheirContents.includes(a.name) || v.stripTogetherWithTheirContents.includes("*"))) if (a.slashPresent && Array.isArray(n) && n.some((S) => S.name === a.name)) {
|
|
2168
|
+
for (let S = n.length; S--; ) if (n[S].name === a.name) {
|
|
2169
|
+
o = o.filter(([T, L]) => (T < n[S].lastOpeningBracketAt || T >= u + 1) && (L <= n[S].lastOpeningBracketAt || L > u + 1));
|
|
2132
2170
|
let R = u + 1;
|
|
2133
|
-
|
|
2171
|
+
a.lastClosingBracketAt && (R = a.lastClosingBracketAt + 1), o.push([n[S].lastOpeningBracketAt, R]), dr.has(t[u]) && v.cb ? v.cb({ tag: a, deleteFrom: n[S].lastOpeningBracketAt, deleteTo: u + 1, insert: null, rangesArr: k, proposedReturn: [n[S].lastOpeningBracketAt, u, null] }) : v.cb && v.cb({ tag: a, deleteFrom: n[S].lastOpeningBracketAt, deleteTo: u, insert: "", rangesArr: k, proposedReturn: [n[S].lastOpeningBracketAt, u, ""] }), n.splice(S, 1);
|
|
2134
2172
|
break;
|
|
2135
2173
|
}
|
|
2136
|
-
} else
|
|
2137
|
-
else Array.isArray(v.ignoreTagsWithTheirContents) && ue(u, v,
|
|
2174
|
+
} else a.slashPresent || n.push(a);
|
|
2175
|
+
else Array.isArray(v.ignoreTagsWithTheirContents) && ue(u, v, a) && (E = !1);
|
|
2138
2176
|
}
|
|
2139
2177
|
function N(u, v, k, S, R, T) {
|
|
2140
|
-
if (Array.isArray(
|
|
2178
|
+
if (Array.isArray(A.current()) && typeof k == "number" && A.current()[0][0] === 0 && A.current()[0][1] >= k) return "";
|
|
2141
2179
|
if (t.length === S && T && !b?.dumpLinkHrefsNearby?.enabled) return null;
|
|
2142
2180
|
let L = "";
|
|
2143
2181
|
if (Number.isInteger(k) && k < R && (L += u.slice(k, R)), Number.isInteger(S) && S > T + 1) {
|
|
2144
|
-
let
|
|
2145
|
-
S && !
|
|
2146
|
-
`) && q(S, u) ? L += " " : L +=
|
|
2182
|
+
let z = u.slice(T + 1, S);
|
|
2183
|
+
S && !j(t, S - 1) && (z = z.trimEnd()), z.includes(`
|
|
2184
|
+
`) && q(S, u) ? L += " " : L += z;
|
|
2147
2185
|
}
|
|
2148
|
-
let Q = !dr.has(u[v]),
|
|
2149
|
-
if ((Q ||
|
|
2150
|
-
let
|
|
2151
|
-
return Array.isArray(
|
|
2152
|
-
` :
|
|
2186
|
+
let Q = !dr.has(u[v]), _t = u[S - 1] !== ">" || !u[k].trim(), Ft = !['"', "("].includes(u[R - 1]), Sn = ![";", ".", ":", "!"].includes(u[v]);
|
|
2187
|
+
if ((Q || _t && Ft && Sn) && (_t || Ft) && u[v] !== "!" && (!Ea.has(a.name) || typeof k == "number" && k < R || typeof S == "number" && S > T + 1)) {
|
|
2188
|
+
let z = L.match(/\n/g);
|
|
2189
|
+
return Array.isArray(z) && z.length ? z.length === 1 ? `
|
|
2190
|
+
` : z.length === 2 ? `
|
|
2153
2191
|
|
|
2154
2192
|
` : `
|
|
2155
2193
|
|
|
@@ -2159,17 +2197,17 @@ function Kr(t, e) {
|
|
|
2159
2197
|
return "";
|
|
2160
2198
|
}
|
|
2161
2199
|
function I(u, v) {
|
|
2162
|
-
if (u.dumpLinkHrefsNearby?.enabled && y.tagName && y.tagName ===
|
|
2200
|
+
if (u.dumpLinkHrefsNearby?.enabled && y.tagName && y.tagName === a.name && a.lastOpeningBracketAt && (y.openingTagEnds && a.lastOpeningBracketAt > y.openingTagEnds || !y.openingTagEnds) && (m = !0), m) {
|
|
2163
2201
|
let k = u.dumpLinkHrefsNearby?.putOnNewLine ? `
|
|
2164
2202
|
|
|
2165
2203
|
` : "";
|
|
2166
|
-
p = `${k}${y.hrefValue}`, (typeof v != "number" ||
|
|
2204
|
+
p = `${k}${y.hrefValue}`, (typeof v != "number" || j(t, v - 1)) && (p += k);
|
|
2167
2205
|
}
|
|
2168
2206
|
}
|
|
2169
2207
|
function q(u, v) {
|
|
2170
2208
|
return v ? v[u] === "<" && v[u + 1] !== "%" : t[u] === "<" && t[u + 1] !== "%";
|
|
2171
2209
|
}
|
|
2172
|
-
function
|
|
2210
|
+
function B(u) {
|
|
2173
2211
|
return t[u] === ">" && t[u - 1] !== "%";
|
|
2174
2212
|
}
|
|
2175
2213
|
function ue(u, v, k) {
|
|
@@ -2195,17 +2233,17 @@ ${JSON.stringify(e, null, 4)}`);
|
|
|
2195
2233
|
}
|
|
2196
2234
|
b.ignoreTags = ur(b.ignoreTags, "resolvedOpts.ignoreTags"), b.onlyStripTags = ur(b.onlyStripTags, "resolvedOpts.onlyStripTags");
|
|
2197
2235
|
let zt = !!b.onlyStripTags.length;
|
|
2198
|
-
b.onlyStripTags.length && b.ignoreTags.length && (b.onlyStripTags =
|
|
2236
|
+
b.onlyStripTags.length && b.ignoreTags.length && (b.onlyStripTags = na(b.onlyStripTags, ...b.ignoreTags)), b.stripTogetherWithTheirContents ? typeof b.stripTogetherWithTheirContents == "string" && b.stripTogetherWithTheirContents.length && (b.stripTogetherWithTheirContents = [b.stripTogetherWithTheirContents]) : b.stripTogetherWithTheirContents = [];
|
|
2199
2237
|
let de = {};
|
|
2200
2238
|
if (b.stripTogetherWithTheirContents && Array.isArray(b.stripTogetherWithTheirContents) && b.stripTogetherWithTheirContents.length && !b.stripTogetherWithTheirContents.every((u, v) => typeof u != "string" ? (de.el = u, de.i = v, !1) : !0)) throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_08] Optional Options Object's key stripTogetherWithTheirContents was set to contain not just string elements! For example, element at index ${de.i} has a value ${de.el} which is not string but ${(typeof de.el).toLowerCase()}.`);
|
|
2201
2239
|
b.cb || (b.cb = ({ rangesArr: u, proposedReturn: v }) => {
|
|
2202
2240
|
v && u.push(...v);
|
|
2203
2241
|
});
|
|
2204
|
-
let
|
|
2205
|
-
if (!b.skipHtmlDecoding) for (; t !==
|
|
2206
|
-
let G = !1, _ = !1,
|
|
2207
|
-
for (let u = 0; u <
|
|
2208
|
-
if (b.reportProgressFunc && (
|
|
2242
|
+
let A = new Sa({ limitToBeAddedWhitespace: !0, limitLinebreaksCount: 2 });
|
|
2243
|
+
if (!b.skipHtmlDecoding) for (; t !== ar(t, { scope: "strict" }); ) t = ar(t, { scope: "strict" });
|
|
2244
|
+
let G = !1, _ = !1, Ae = 0, Ht = 0, $ = t.length, wn = Math.floor($ / 2);
|
|
2245
|
+
for (let u = 0; u < $; u++) {
|
|
2246
|
+
if (b.reportProgressFunc && ($ > 1e3 && $ < 2e3 ? u === wn && b.reportProgressFunc(Math.floor((b.reportProgressFuncTo - b.reportProgressFuncFrom) / 2)) : $ >= 2e3 && (Ae = b.reportProgressFuncFrom + Math.floor(u / $ * (b.reportProgressFuncTo - b.reportProgressFuncFrom)), Ae !== Ht && (Ht = Ae, b.reportProgressFunc(Ae)))), Object.keys(a).length > 1 && a.lastClosingBracketAt && a.lastClosingBracketAt < u && t[u] !== " " && w === null && (w = u), !G && t[u] === "%" && t[u - 1] === "{" && t.includes("%}", u + 1)) {
|
|
2209
2247
|
d = null;
|
|
2210
2248
|
let v = t.indexOf("%}", u) - 1;
|
|
2211
2249
|
if (v > u) {
|
|
@@ -2213,139 +2251,139 @@ ${JSON.stringify(e, null, 4)}`);
|
|
|
2213
2251
|
continue;
|
|
2214
2252
|
}
|
|
2215
2253
|
}
|
|
2216
|
-
if (!G &&
|
|
2217
|
-
for (let v = u; v--; ) if (t[v - 1] === void 0 ||
|
|
2254
|
+
if (!G && B(u) && (!a || Object.keys(a).length < 2) && u > 1) {
|
|
2255
|
+
for (let v = u; v--; ) if (t[v - 1] === void 0 || B(v)) {
|
|
2218
2256
|
let k = t[v - 1] === void 0 ? v : v + 1, S = t.slice(k, u + 1) || "";
|
|
2219
2257
|
if ((S.includes("/>") || S.includes("/ >") || S.includes('="') || S.includes("='")) && t !== `<${ir(S.trim(), "/>")}>` && [...pe].some((R) => ir(S.trim().split(/\s+/).filter((T) => T.trim()).filter((T, L) => L === 0), "/>").toLowerCase() === R) && Kr(`<${S.trim()}>`, b).result === "") {
|
|
2220
|
-
(!s.length || s[s.length - 1][0] !==
|
|
2258
|
+
(!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([k, u + 1]), (!o.length || o[o.length - 1][0] !== a.lastOpeningBracketAt) && o.push([k, u + 1]);
|
|
2221
2259
|
let R = N(t, u, k, u + 1, k, u + 1), T = u + 1;
|
|
2222
2260
|
if (t[T] && !t[T].trim()) {
|
|
2223
|
-
for (let L = T; L <
|
|
2261
|
+
for (let L = T; L < $; L++) if (t[L].trim()) {
|
|
2224
2262
|
T = L;
|
|
2225
2263
|
break;
|
|
2226
2264
|
}
|
|
2227
2265
|
}
|
|
2228
|
-
b.cb({ tag:
|
|
2266
|
+
b.cb({ tag: a, deleteFrom: k, deleteTo: T, insert: R, rangesArr: A, proposedReturn: [k, T, R] });
|
|
2229
2267
|
}
|
|
2230
2268
|
break;
|
|
2231
2269
|
}
|
|
2232
2270
|
}
|
|
2233
|
-
if (!_ && t[u] === "/" && !
|
|
2271
|
+
if (!_ && t[u] === "/" && !a.quotes?.value && Number.isInteger(a.lastOpeningBracketAt) && !Number.isInteger(a.lastClosingBracketAt) && (a.slashPresent = u), t[u] === '"' || t[u] === "'") if (!_ && a.nameStarts && a?.quotes?.value === t[u]) if (f.valueStarts === void 0) f = {}, delete a.quotes;
|
|
2234
2272
|
else {
|
|
2235
|
-
f.valueEnds = u, f.value = t.slice(f.valueStarts, u),
|
|
2273
|
+
f.valueEnds = u, f.value = t.slice(f.valueStarts, u), a.attributes.push(f), f = {}, delete a.quotes;
|
|
2236
2274
|
let v;
|
|
2237
|
-
b.dumpLinkHrefsNearby?.enabled && !n.length &&
|
|
2275
|
+
b.dumpLinkHrefsNearby?.enabled && !n.length && a.attributes.some((k) => {
|
|
2238
2276
|
if (typeof k.name == "string" && k.name.toLowerCase() === "href") return v = `${b.dumpLinkHrefsNearby?.wrapHeads || ""}${k.value}${b.dumpLinkHrefsNearby?.wrapTails || ""}`, !0;
|
|
2239
|
-
}) && (y = { tagName:
|
|
2277
|
+
}) && (y = { tagName: a.name, hrefValue: v, openingTagEnds: void 0 });
|
|
2240
2278
|
}
|
|
2241
|
-
else !_ && !
|
|
2242
|
-
if (
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2279
|
+
else !_ && !a.quotes && a.nameStarts && (a.quotes = {}, a.quotes.value = t[u], a.quotes.start = u, a.quotes.next = t.indexOf(t[u], u + 1), f.nameStarts && f.nameEnds && f.nameEnds < u && f.nameStarts < u && !f.valueStarts && (f.name = t.slice(f.nameStarts, f.nameEnds)));
|
|
2280
|
+
if (a.nameStarts !== void 0 && a.nameEnds === void 0 && (!t[u].trim() || !Oa(t[u]))) {
|
|
2281
|
+
if (a.nameEnds = u, a.name = t.slice(a.nameStarts, a.nameEnds + (!B(u) && t[u] !== "/" && t[u + 1] === void 0 ? 1 : 0)), t[a.nameStarts - 1] !== "!" && !a.name.replace(/-/g, "").length || /^\d+$/.test(a.name[0])) {
|
|
2282
|
+
a = {};
|
|
2245
2283
|
continue;
|
|
2246
2284
|
}
|
|
2247
|
-
if (typeof
|
|
2285
|
+
if (typeof a.name == "string" && a.name.toLowerCase() === "doctype" && (_ = !0), q(u)) {
|
|
2248
2286
|
I(b);
|
|
2249
|
-
let v = N(t, u,
|
|
2250
|
-
(b.stripTogetherWithTheirContents.includes(
|
|
2287
|
+
let v = N(t, u, a.leftOuterWhitespace, u, a.lastOpeningBracketAt, u);
|
|
2288
|
+
(b.stripTogetherWithTheirContents.includes(a.name) || b.stripTogetherWithTheirContents.includes("*")) && (o = o.filter(([k, S]) => !(k === a.leftOuterWhitespace && S === u))), b.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: u, insert: `${v}${p}${v}`, rangesArr: A, proposedReturn: [a.leftOuterWhitespace, u, `${v}${p}${v}`] }), he(), x(u, b, A);
|
|
2251
2289
|
}
|
|
2252
2290
|
}
|
|
2253
|
-
if (
|
|
2254
|
-
if (
|
|
2255
|
-
if (
|
|
2256
|
-
if (
|
|
2257
|
-
|
|
2291
|
+
if (a.quotes?.start && a.quotes.start < u && !a.quotes.end && f.nameEnds && f.equalsAt && !f.valueStarts && (f.valueStarts = u), !a.quotes && f.nameEnds && t[u] === "=" && !f.valueStarts && !f.equalsAt && (f.equalsAt = u), !a.quotes && f.nameStarts && f.nameEnds && !f.valueStarts && t[u].trim() && t[u] !== "=" && (a.attributes.push(f), f = {}), !a.quotes && f.nameStarts && !f.nameEnds && (_ && `'"`.includes(t[f.nameStarts]) ? f.nameStarts < u && t[u] === t[f.nameStarts] && (f.nameEnds = u + 1, f.name = t.slice(f.nameStarts, f.nameEnds)) : t[u].trim() ? t[u] === "=" ? f.equalsAt || (f.nameEnds = u, f.equalsAt = u, f.name = t.slice(f.nameStarts, f.nameEnds)) : t[u] === "/" || B(u) ? (f.nameEnds = u, f.name = t.slice(f.nameStarts, f.nameEnds), a.attributes.push(f), f = {}) : q(u) && (f.nameEnds = u, f.name = t.slice(f.nameStarts, f.nameEnds), a.attributes.push(f), f = {}) : (f.nameEnds = u, f.name = t.slice(f.nameStarts, f.nameEnds))), !a.quotes && a.nameEnds < u && !t[u - 1].trim() && t[u].trim() && !"<>/!".includes(t[u]) && !f.nameStarts && !a.lastClosingBracketAt && (f.nameStarts = u), a.lastOpeningBracketAt !== null && a.lastOpeningBracketAt < u && t[u] === "/" && a.onlyPlausible && (a.onlyPlausible = !1), a.lastOpeningBracketAt !== null && a.lastOpeningBracketAt < u && t[u] !== "/" && (a.onlyPlausible === void 0 && ((!t[u].trim() || q(u)) && !a.slashPresent ? a.onlyPlausible = !0 : a.onlyPlausible = !1), t[u].trim() && a.nameStarts === void 0 && !q(u) && t[u] !== "/" && !B(u) && t[u] !== "!" && (a.nameStarts = u, a.nameContainsLetters = !1)), a.nameStarts && !a.quotes && typeof t[u] == "string" && t[u].toLowerCase() !== t[u].toUpperCase() && (a.nameContainsLetters = !0), B(u) && (hr(a, t, u) || a.quotes.value && typeof a.lastOpeningBracketAt == "number" && xa(a.quotes.value, t.slice(a.lastOpeningBracketAt, u)) % 2 === 1 && !t.slice(a.lastOpeningBracketAt + 1, u).includes("<") && !t.slice(a.lastOpeningBracketAt + 1, u).includes(">")) && a.lastOpeningBracketAt !== void 0 && (a.lastClosingBracketAt = u, w = null, Object.keys(f).length && (a.attributes.push(f), f = {}), b.dumpLinkHrefsNearby?.enabled && y.tagName && !y.openingTagEnds && (y.openingTagEnds = u)), (!_ || t[u] === ">") && a.lastOpeningBracketAt !== void 0) {
|
|
2292
|
+
if (a.lastClosingBracketAt === void 0) {
|
|
2293
|
+
if (a.lastOpeningBracketAt < u && !q(u) && (t[u + 1] === void 0 || q(u + 1) && !a?.quotes?.value) && a.nameContainsLetters && typeof a.nameStarts == "number") {
|
|
2294
|
+
if (a.name = t.slice(a.nameStarts, a.nameEnds || u + 1).toLowerCase(), (!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([a.lastOpeningBracketAt, u + 1]), b.ignoreTags.includes(a.name) || ue(u, b, a) || !pe.has(a.name) && (a.onlyPlausible || b.stripRecognisedHTMLOnly)) {
|
|
2295
|
+
a = {}, f = {};
|
|
2258
2296
|
continue;
|
|
2259
2297
|
}
|
|
2260
|
-
if ((pe.has(
|
|
2298
|
+
if ((pe.has(a.name) || rt.has(a.name)) && (a.onlyPlausible === !1 || a.onlyPlausible === !0 && a.attributes.length) || t[u + 1] === void 0) {
|
|
2261
2299
|
I(b);
|
|
2262
|
-
let v = N(t, u,
|
|
2263
|
-
G &&
|
|
2300
|
+
let v = N(t, u, a.leftOuterWhitespace, u + 1, a.lastOpeningBracketAt, a.lastClosingBracketAt);
|
|
2301
|
+
G && a.name === "script" && a.slashPresent && (G = !1);
|
|
2264
2302
|
let k;
|
|
2265
|
-
v === null || p === null ? k = null : k = `${v}${p}${v}`, b.cb({ tag:
|
|
2303
|
+
v === null || p === null ? k = null : k = `${v}${p}${v}`, b.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: u + 1, insert: k, rangesArr: A, proposedReturn: [a.leftOuterWhitespace, u + 1, k] }), he(), x(u, b, A);
|
|
2266
2304
|
}
|
|
2267
|
-
if (!
|
|
2305
|
+
if (!o.length || o[o.length - 1][0] !== a.lastOpeningBracketAt && o[o.length - 1][1] !== u + 1) if (b.stripTogetherWithTheirContents.includes(a.name) || b.stripTogetherWithTheirContents.includes("*")) {
|
|
2268
2306
|
let v;
|
|
2269
|
-
for (let k = n.length; k--; ) n[k].name ===
|
|
2270
|
-
v ? (
|
|
2271
|
-
} else
|
|
2307
|
+
for (let k = n.length; k--; ) n[k].name === a.name && (v = n[k]);
|
|
2308
|
+
v ? (o = o.filter(([k]) => k !== v.lastOpeningBracketAt), o.push([v.lastOpeningBracketAt, u + 1])) : o.push([a.lastOpeningBracketAt, u + 1]);
|
|
2309
|
+
} else o.push([a.lastOpeningBracketAt, u + 1]);
|
|
2272
2310
|
}
|
|
2273
|
-
} else if (u >
|
|
2311
|
+
} else if (u > a.lastClosingBracketAt && t[u].trim() || t[u + 1] === void 0 || b.ignoreIndentations && `\r
|
|
2274
2312
|
`.includes(t[u])) {
|
|
2275
|
-
let v =
|
|
2276
|
-
b.trimOnlySpaces && v ===
|
|
2277
|
-
let k = b.ignoreTags.includes(
|
|
2278
|
-
if (!E || b.stripRecognisedHTMLOnly && typeof
|
|
2279
|
-
if (S) if (
|
|
2280
|
-
for (let R = i.length; R--; ) if (i[R].name ===
|
|
2313
|
+
let v = a.lastClosingBracketAt === u ? u + 1 : u;
|
|
2314
|
+
b.trimOnlySpaces && v === $ - 1 && w !== null && w < u && (v = w), (!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([a.lastOpeningBracketAt, a.lastClosingBracketAt + 1]);
|
|
2315
|
+
let k = b.ignoreTags.includes(a.name), S = ue(u, b, a);
|
|
2316
|
+
if (!E || b.stripRecognisedHTMLOnly && typeof a.name == "string" && !pe.has(a.name.toLowerCase()) && !rt.has(a.name.toLowerCase()) || !zt && (k || S) || zt && !b.onlyStripTags.includes(a.name) || b.ignoreTagsWithTheirContents.includes(a.name)) {
|
|
2317
|
+
if (S) if (a.slashPresent) {
|
|
2318
|
+
for (let R = i.length; R--; ) if (i[R].name === a.name) {
|
|
2281
2319
|
i.splice(R, 1);
|
|
2282
2320
|
break;
|
|
2283
2321
|
}
|
|
2284
2322
|
i.length || (E = !0);
|
|
2285
|
-
} else E && (E = !1), i.push(
|
|
2286
|
-
b.cb({ tag:
|
|
2287
|
-
} else if (!
|
|
2288
|
-
(!
|
|
2289
|
-
let R = N(t, u,
|
|
2323
|
+
} else E && (E = !1), i.push(a);
|
|
2324
|
+
b.cb({ tag: a, deleteFrom: null, deleteTo: null, insert: null, rangesArr: A, proposedReturn: null }), a = {}, f = {};
|
|
2325
|
+
} else if (!a.onlyPlausible || a.attributes.length === 0 && a.name && (pe.has(a.name.toLowerCase()) || rt.has(a.name.toLowerCase())) || a.attributes?.some((R) => R.equalsAt)) {
|
|
2326
|
+
(!o.length || o[o.length - 1][0] !== a.lastOpeningBracketAt) && o.push([a.lastOpeningBracketAt, a.lastClosingBracketAt + 1]);
|
|
2327
|
+
let R = N(t, u, a.leftOuterWhitespace, v, a.lastOpeningBracketAt, a.lastClosingBracketAt);
|
|
2290
2328
|
p = "", m = !1, I(b, v);
|
|
2291
2329
|
let T;
|
|
2292
2330
|
typeof p == "string" && p.length ? (T = `${R}${p}${R === `
|
|
2293
2331
|
|
|
2294
2332
|
` ? `
|
|
2295
|
-
` : R}`, v ===
|
|
2333
|
+
` : R}`, v === a.lastClosingBracketAt + 1 && (!t[v] || !nt.has(t[v])) && (T += " "), a.leftOuterWhitespace === a.lastOpeningBracketAt && A.last() && A.last()[1] < a.lastOpeningBracketAt && (!b?.dumpLinkHrefsNearby?.putOnNewLine || !nt.has(t[v])) && (T = " " + T)) : T = R, T !== null && (a.leftOuterWhitespace === 0 || !j(t, v - 1)) && (!b.dumpLinkHrefsNearby?.enabled || a.name !== "a") && (T = void 0);
|
|
2296
2334
|
let L = 0;
|
|
2297
2335
|
if (m && nt.has(t[v])) {
|
|
2298
2336
|
b.dumpLinkHrefsNearby?.putOnNewLine && (T = `${t[v]}${T || ""}`);
|
|
2299
|
-
let Q =
|
|
2337
|
+
let Q = j(t, v);
|
|
2300
2338
|
Q && T?.endsWith(`
|
|
2301
2339
|
`) ? L += Q - u : (!Q || Q > u) && L++;
|
|
2302
2340
|
}
|
|
2303
|
-
b.cb({ tag:
|
|
2304
|
-
} else
|
|
2305
|
-
|
|
2341
|
+
b.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: v + L, insert: T, rangesArr: A, proposedReturn: [a.leftOuterWhitespace, v + L, T] }), he(), x(u, b, A);
|
|
2342
|
+
} else a = {};
|
|
2343
|
+
B(u) || (a = {});
|
|
2306
2344
|
}
|
|
2307
2345
|
_ && (_ = !1);
|
|
2308
2346
|
}
|
|
2309
|
-
if ((!G || t[u] === "<" &&
|
|
2310
|
-
if (
|
|
2311
|
-
if (
|
|
2312
|
-
let v = N(t, u,
|
|
2313
|
-
b.cb({ tag:
|
|
2347
|
+
if ((!G || t[u] === "<" && j(t, j(t, u)) && t[j(t, u)] === "/" && t.startsWith("script", j(t, j(t, u)))) && q(u) && !q(u - 1) && !`'"`.includes(t[u + 1]) && (!`'"`.includes(t[u + 2]) || /\w/.test(t[u + 1])) && !(t[u + 1] === "c" && t[u + 2] === ":") && !(t[u + 1] === "f" && t[u + 2] === "m" && t[u + 3] === "t" && t[u + 4] === ":") && !(t[u + 1] === "s" && t[u + 2] === "q" && t[u + 3] === "l" && t[u + 4] === ":") && !(t[u + 1] === "x" && t[u + 2] === ":") && !(t[u + 1] === "f" && t[u + 2] === "n" && t[u + 3] === ":") && hr(a, t, u)) {
|
|
2348
|
+
if (B(j(t, u))) continue;
|
|
2349
|
+
if (a.nameEnds && a.nameEnds < u && !a.lastClosingBracketAt && (a.onlyPlausible === !0 && a.attributes?.length || a.onlyPlausible === !1)) {
|
|
2350
|
+
let v = N(t, u, a.leftOuterWhitespace, u, a.lastOpeningBracketAt, u);
|
|
2351
|
+
b.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: u, insert: v, rangesArr: A, proposedReturn: [a.leftOuterWhitespace, u, v] }), x(u, b, A), a = {}, f = {};
|
|
2314
2352
|
}
|
|
2315
|
-
if (
|
|
2353
|
+
if (a.lastOpeningBracketAt !== void 0 && a.onlyPlausible && a.name && !a.quotes && (a.lastOpeningBracketAt = void 0, a.name = void 0, a.onlyPlausible = !1), (a.lastOpeningBracketAt === void 0 || !a.onlyPlausible) && !a.quotes && (a.lastOpeningBracketAt = u, a.slashPresent = !1, a.attributes = [], l === null ? a.leftOuterWhitespace = u : b.trimOnlySpaces && l === 0 ? a.leftOuterWhitespace = h || u : a.leftOuterWhitespace = l, `${t[u + 1]}${t[u + 2]}${t[u + 3]}` == "!--" || `${t[u + 1]}${t[u + 2]}${t[u + 3]}${t[u + 4]}${t[u + 5]}${t[u + 6]}${t[u + 7]}${t[u + 8]}` == "![CDATA[")) {
|
|
2316
2354
|
let v = !0;
|
|
2317
2355
|
t[u + 2] === "-" && (v = !1);
|
|
2318
2356
|
let k;
|
|
2319
|
-
for (let S = u; S <
|
|
2357
|
+
for (let S = u; S < $; S++) if ((!k && v && `${t[S - 2]}${t[S - 1]}${t[S]}` == "]]>" || !v && `${t[S - 2]}${t[S - 1]}${t[S]}` == "-->") && (k = S), k && (k < S && t[S].trim() || t[S + 1] === void 0)) {
|
|
2320
2358
|
let R = S;
|
|
2321
|
-
(t[S + 1] === void 0 && !t[S].trim() || t[S] === ">") && (R += 1), (!s.length || s[s.length - 1][0] !==
|
|
2322
|
-
let T = N(t, S,
|
|
2323
|
-
b.cb({ tag:
|
|
2359
|
+
(t[S + 1] === void 0 && !t[S].trim() || t[S] === ">") && (R += 1), (!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([a.lastOpeningBracketAt, k + 1]), (!o.length || o[o.length - 1][0] !== a.lastOpeningBracketAt) && o.push([a.lastOpeningBracketAt, k + 1]);
|
|
2360
|
+
let T = N(t, S, a.leftOuterWhitespace, R, a.lastOpeningBracketAt, k);
|
|
2361
|
+
b.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: R, insert: T, rangesArr: A, proposedReturn: [a.leftOuterWhitespace, R, T] }), u = S - 1, t[S] === ">" && (u = S), a = {}, f = {};
|
|
2324
2362
|
break;
|
|
2325
2363
|
}
|
|
2326
2364
|
}
|
|
2327
2365
|
}
|
|
2328
|
-
!t[u].trim() || t[u].charCodeAt(0) === 847 ? (l === null && (l = u,
|
|
2329
|
-
` || t[u] === "\r") && (d = u, g && (g = !1))) : (l !== null && (!
|
|
2366
|
+
!t[u].trim() || t[u].charCodeAt(0) === 847 ? (l === null && (l = u, a.lastOpeningBracketAt !== void 0 && a.lastOpeningBracketAt < u && a.nameStarts && a.nameStarts < a.lastOpeningBracketAt && u === a.lastOpeningBracketAt + 1 && !n.some((v) => v.name === a.name) && (a.onlyPlausible = !0, a.name = void 0, a.nameStarts = void 0)), (t[u] === `
|
|
2367
|
+
` || t[u] === "\r") && (d = u, g && (g = !1))) : (l !== null && (!a.quotes && f.equalsAt > l - 1 && f.nameEnds && f.equalsAt > f.nameEnds && t[u] !== '"' && t[u] !== "'" && (yt(f) && a.attributes.push(f), f = {}, a.equalsSpottedAt = void 0), l = null), g || (g = !0, E && !G && typeof d == "number" && u && d < u - 1 && (t.slice(d + 1, u).trim() ? d = null : b.ignoreIndentations || A.push([d + 1, u])))), t[u] === " " ? h === null && (h = u) : h !== null && (h = null), a.name === "script" && (G = !a.slashPresent);
|
|
2330
2368
|
}
|
|
2331
|
-
if (t && !b.ignoreIndentations && (b.trimOnlySpaces && t[0] === " " || !b.trimOnlySpaces && !t[0].trim())) for (let u = 0; u <
|
|
2332
|
-
|
|
2369
|
+
if (t && !b.ignoreIndentations && (b.trimOnlySpaces && t[0] === " " || !b.trimOnlySpaces && !t[0].trim())) for (let u = 0; u < $; u++) if (b.trimOnlySpaces && t[u] !== " " || !b.trimOnlySpaces && t[u].trim()) {
|
|
2370
|
+
A.push([0, u]);
|
|
2333
2371
|
break;
|
|
2334
|
-
} else t[u + 1] ||
|
|
2372
|
+
} else t[u + 1] || A.push([0, u + 1]);
|
|
2335
2373
|
if (t && (b.trimOnlySpaces && t[~-t.length] === " " || !b.trimOnlySpaces && !t[~-t.length].trim())) {
|
|
2336
2374
|
for (let u = t.length; u--; ) if (b.trimOnlySpaces && t[u] !== " " || !b.trimOnlySpaces && t[u].trim()) {
|
|
2337
|
-
|
|
2375
|
+
A.push([u + 1, $]);
|
|
2338
2376
|
break;
|
|
2339
2377
|
}
|
|
2340
2378
|
}
|
|
2341
|
-
let
|
|
2342
|
-
if (!e?.cb &&
|
|
2343
|
-
let u =
|
|
2379
|
+
let F = A.current();
|
|
2380
|
+
if (!e?.cb && F && (F[0] && !F[0][0] && (F[0][1], A.ranges[0] = [A.ranges[0][0], A.ranges[0][1]]), F[F.length - 1]?.[1] === t.length && (F[F.length - 1][0], A.ranges))) {
|
|
2381
|
+
let u = A.ranges[A.ranges.length - 1][0];
|
|
2344
2382
|
t[u - 1] && (b.trimOnlySpaces && t[u - 1] === " " || !b.trimOnlySpaces && !t[u - 1].trim()) && (u -= 1);
|
|
2345
|
-
let v =
|
|
2346
|
-
|
|
2383
|
+
let v = A.ranges[A.ranges.length - 1][2];
|
|
2384
|
+
A.ranges[A.ranges.length - 1] = [u, A.ranges[A.ranges.length - 1][1]], v?.trim() && A.ranges[A.ranges.length - 1].push(v.trimEnd());
|
|
2347
2385
|
}
|
|
2348
|
-
return { log: { timeTakenInMilliseconds: Date.now() - r }, result:
|
|
2386
|
+
return { log: { timeTakenInMilliseconds: Date.now() - r }, result: ba(t, A.current()), ranges: A.current(), allTagLocations: s, filteredTagLocations: o };
|
|
2349
2387
|
}
|
|
2350
2388
|
class wt {
|
|
2351
2389
|
speechSynthesis;
|
|
@@ -2358,6 +2396,10 @@ class wt {
|
|
|
2358
2396
|
voiceManager = null;
|
|
2359
2397
|
voices = [];
|
|
2360
2398
|
defaultVoice = null;
|
|
2399
|
+
speakInContentLanguage = !1;
|
|
2400
|
+
languageVoiceCache = /* @__PURE__ */ new Map();
|
|
2401
|
+
warmingLanguages = /* @__PURE__ */ new Map();
|
|
2402
|
+
speakGeneration = 0;
|
|
2361
2403
|
// Enhanced properties for cross-browser compatibility
|
|
2362
2404
|
resumeInfinityTimer;
|
|
2363
2405
|
isSpeakingInternal = !1;
|
|
@@ -2403,10 +2445,10 @@ class wt {
|
|
|
2403
2445
|
maxTimeout: n,
|
|
2404
2446
|
interval: i
|
|
2405
2447
|
}), this.voices = this.voiceManager.getVoices();
|
|
2406
|
-
const
|
|
2407
|
-
return this.defaultVoice = await this.voiceManager.getDefaultVoice(
|
|
2408
|
-
} catch (
|
|
2409
|
-
return console.error("Failed to initialize WebSpeechEngine:",
|
|
2448
|
+
const o = r || [...navigator.languages || ["en"]];
|
|
2449
|
+
return this.defaultVoice = await this.voiceManager.getDefaultVoice(o, this.voices), this.initialized = !0, !0;
|
|
2450
|
+
} catch (o) {
|
|
2451
|
+
return console.error("Failed to initialize WebSpeechEngine:", o), this.initialized = !1, !1;
|
|
2410
2452
|
}
|
|
2411
2453
|
}
|
|
2412
2454
|
// Text length validation matching EasySpeech
|
|
@@ -2426,9 +2468,58 @@ class wt {
|
|
|
2426
2468
|
getCurrentVoiceForUtterance(e) {
|
|
2427
2469
|
return e && typeof e == "object" ? e : typeof e == "string" ? this.voices.find((r) => r.name === e || r.language === e) || null : this.currentVoice || this.defaultVoice;
|
|
2428
2470
|
}
|
|
2471
|
+
// No cross-region fallback: fr-FR content must not match an fr-CA voice.
|
|
2472
|
+
voiceMatchesLanguage(e, r) {
|
|
2473
|
+
const [n, i] = U(r), [s, o] = U(e.language);
|
|
2474
|
+
return s === n && (!i || o === i);
|
|
2475
|
+
}
|
|
2476
|
+
// Returns `undefined` (not a fallback voice) when content.language hasn't
|
|
2477
|
+
// been warmed into languageVoiceCache yet — callers must await for it.
|
|
2478
|
+
voiceForUtteranceSync(e) {
|
|
2479
|
+
const r = this.getCurrentVoiceForUtterance(this.currentVoice);
|
|
2480
|
+
if (!this.speakInContentLanguage || !e.language)
|
|
2481
|
+
return r;
|
|
2482
|
+
const n = D(e.language);
|
|
2483
|
+
if (r && this.voiceMatchesLanguage(r, n))
|
|
2484
|
+
return r;
|
|
2485
|
+
if (this.languageVoiceCache.has(n))
|
|
2486
|
+
return this.languageVoiceCache.get(n) ?? r;
|
|
2487
|
+
}
|
|
2488
|
+
// Awaits warming for a not-yet-seen content language rather than falling back
|
|
2489
|
+
// to the wrong-language voice.
|
|
2490
|
+
async voiceForUtterance(e) {
|
|
2491
|
+
const r = this.voiceForUtteranceSync(e);
|
|
2492
|
+
return r !== void 0 ? r : (await this.warmLanguageVoiceCache([e]), this.voiceForUtteranceSync(e) ?? this.getCurrentVoiceForUtterance(this.currentVoice));
|
|
2493
|
+
}
|
|
2494
|
+
// Dedupes in-flight warms per language so an awaited call and a
|
|
2495
|
+
// fire-and-forget one for the same language don't redo the work.
|
|
2496
|
+
async warmLanguageVoiceCache(e) {
|
|
2497
|
+
if (!this.speakInContentLanguage || !this.voiceManager)
|
|
2498
|
+
return;
|
|
2499
|
+
const r = new Set(
|
|
2500
|
+
e.map((o) => o.language).filter((o) => !!o).map((o) => D(o)).filter((o) => !this.languageVoiceCache.has(o))
|
|
2501
|
+
), n = [...r].filter((o) => this.warmingLanguages.has(o)), s = [...r].filter((o) => !this.warmingLanguages.has(o)).map((o) => {
|
|
2502
|
+
const a = (async () => {
|
|
2503
|
+
await O.initialize({ languages: [o] }), this.voices = this.voiceManager.getVoices();
|
|
2504
|
+
const c = this.voices.filter((d) => this.voiceMatchesLanguage(d, o)), h = (await this.voiceManager.sortVoicesByQuality(c))[0] ?? null;
|
|
2505
|
+
this.languageVoiceCache.set(o, h), h || this.emitEvent({ type: "languagefallback", detail: { language: o, reason: "no-matching-voice" } });
|
|
2506
|
+
})();
|
|
2507
|
+
return this.warmingLanguages.set(o, a.finally(() => this.warmingLanguages.delete(o))), this.warmingLanguages.get(o);
|
|
2508
|
+
});
|
|
2509
|
+
await Promise.all([
|
|
2510
|
+
...s,
|
|
2511
|
+
...n.map((o) => this.warmingLanguages.get(o))
|
|
2512
|
+
]);
|
|
2513
|
+
}
|
|
2429
2514
|
getCurrentVoice() {
|
|
2430
2515
|
return this.currentVoice;
|
|
2431
2516
|
}
|
|
2517
|
+
setSpeakInContentLanguage(e) {
|
|
2518
|
+
this.speakInContentLanguage = e, e && this.warmLanguageVoiceCache(this.currentUtterances);
|
|
2519
|
+
}
|
|
2520
|
+
getSpeakInContentLanguage() {
|
|
2521
|
+
return this.speakInContentLanguage;
|
|
2522
|
+
}
|
|
2432
2523
|
// Web Speech API has no SSML support: use the authored plain text, falling
|
|
2433
2524
|
// back to a tag-stripped rendering of the SSML only when no plain
|
|
2434
2525
|
// alternative was provided by the source.
|
|
@@ -2440,7 +2531,7 @@ class wt {
|
|
|
2440
2531
|
}
|
|
2441
2532
|
// Queue Management
|
|
2442
2533
|
loadUtterances(e) {
|
|
2443
|
-
this.currentUtterances = this.toPlainText(e), this.currentUtteranceIndex = 0, this.setState("ready"), this.emitEvent({ type: "ready" });
|
|
2534
|
+
this.currentUtterances = this.toPlainText(e), this.currentUtteranceIndex = 0, this.warmLanguageVoiceCache(this.currentUtterances), this.setState("ready"), this.emitEvent({ type: "ready" });
|
|
2444
2535
|
}
|
|
2445
2536
|
// Voice Configuration
|
|
2446
2537
|
async setVoice(e) {
|
|
@@ -2472,72 +2563,76 @@ class wt {
|
|
|
2472
2563
|
console.warn("No utterances loaded");
|
|
2473
2564
|
return;
|
|
2474
2565
|
}
|
|
2475
|
-
this.cancelCurrentSpeech()
|
|
2566
|
+
this.cancelCurrentSpeech();
|
|
2567
|
+
const r = ++this.speakGeneration;
|
|
2568
|
+
this.isSpeakingInternal = !0, this.isPausedInternal = !1, this.setState("playing"), this.emitEvent({ type: "start" }), this.stopResumeInfinity(), this.currentUtteranceIndex = e ?? 0, this.currentUtteranceIndex >= this.currentUtterances.length && (this.currentUtteranceIndex = 0), this.speakCurrentUtterance(r);
|
|
2476
2569
|
}
|
|
2477
2570
|
cancelCurrentSpeech() {
|
|
2478
2571
|
this.patches.isFirefox && this.speechSynthesis.speaking && (this.utterancesBeingCancelled = !0, setTimeout(() => {
|
|
2479
2572
|
this.utterancesBeingCancelled = !1;
|
|
2480
2573
|
}, 100)), this.speechSynthesis.cancel();
|
|
2481
2574
|
}
|
|
2482
|
-
speakCurrentUtterance() {
|
|
2575
|
+
async speakCurrentUtterance(e) {
|
|
2483
2576
|
if (this.currentUtteranceIndex >= this.currentUtterances.length) {
|
|
2484
2577
|
this.setState("idle"), this.emitEvent({ type: "end" });
|
|
2485
2578
|
return;
|
|
2486
2579
|
}
|
|
2487
|
-
const
|
|
2488
|
-
this.validateText(
|
|
2489
|
-
const
|
|
2490
|
-
if (
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
e.language && (n.lang = e.language), n.rate = this.rate, n.pitch = this.pitch, n.volume = this.volume, n.onstart = () => {
|
|
2495
|
-
this.isSpeakingInternal = !0, this.isPausedInternal = !1, this.setState("playing"), this.emitEvent({ type: "start" }), this.patches.isAndroid && this.isAndroidPaused && (this.isAndroidPaused = !1), this.shouldUseResumeInfinity() && this.startResumeInfinity(n);
|
|
2496
|
-
}, n.onend = () => {
|
|
2497
|
-
if (this.utterancesBeingCancelled) {
|
|
2498
|
-
this.utterancesBeingCancelled = !1;
|
|
2499
|
-
return;
|
|
2580
|
+
const r = this.currentUtterances[this.currentUtteranceIndex], n = r.plain ?? "";
|
|
2581
|
+
this.validateText(n);
|
|
2582
|
+
const i = this.createUtterance(n), s = await this.voiceForUtterance(r);
|
|
2583
|
+
if (e === this.speakGeneration) {
|
|
2584
|
+
if (s && this.voiceManager) {
|
|
2585
|
+
const o = this.voiceManager.convertToSpeechSynthesisVoice(s);
|
|
2586
|
+
o && (i.voice = o, i.lang = o.lang);
|
|
2500
2587
|
}
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
detail: {
|
|
2508
|
-
error: s.error,
|
|
2509
|
-
// Preserve original error type
|
|
2510
|
-
message: `Speech synthesis error: ${s.error}`
|
|
2511
|
-
}
|
|
2512
|
-
});
|
|
2513
|
-
}, n.onpause = () => {
|
|
2514
|
-
this.isPausedInternal = !0, this.isSpeakingInternal = !1, this.emitEvent({ type: "pause" });
|
|
2515
|
-
}, n.onresume = () => {
|
|
2516
|
-
this.isPausedInternal = !1, this.isSpeakingInternal = !0, this.emitEvent({ type: "resume" });
|
|
2517
|
-
}, n.onboundary = (s) => {
|
|
2518
|
-
this.emitEvent({
|
|
2519
|
-
type: "boundary",
|
|
2520
|
-
detail: {
|
|
2521
|
-
charIndex: s.charIndex,
|
|
2522
|
-
charLength: s.charLength,
|
|
2523
|
-
elapsedTime: s.elapsedTime,
|
|
2524
|
-
name: s.name
|
|
2525
|
-
}
|
|
2526
|
-
});
|
|
2527
|
-
}, n.onmark = (s) => {
|
|
2528
|
-
this.emitEvent({
|
|
2529
|
-
type: "mark",
|
|
2530
|
-
detail: {
|
|
2531
|
-
name: s.name
|
|
2588
|
+
r.language && (i.lang = r.language), i.rate = this.rate, i.pitch = this.pitch, i.volume = this.volume, i.onstart = () => {
|
|
2589
|
+
this.isSpeakingInternal = !0, this.isPausedInternal = !1, this.setState("playing"), this.emitEvent({ type: "start" }), this.patches.isAndroid && this.isAndroidPaused && (this.isAndroidPaused = !1), this.shouldUseResumeInfinity() && this.startResumeInfinity(i);
|
|
2590
|
+
}, i.onend = () => {
|
|
2591
|
+
if (this.utterancesBeingCancelled) {
|
|
2592
|
+
this.utterancesBeingCancelled = !1;
|
|
2593
|
+
return;
|
|
2532
2594
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2595
|
+
this.playbackState !== "idle" && (this.isSpeakingInternal = !1, this.isPausedInternal = !1, this.stopResumeInfinity(), this.currentUtteranceIndex >= this.currentUtterances.length - 1 && this.setState("idle"), this.emitEvent({ type: "end" }));
|
|
2596
|
+
}, i.onerror = (o) => {
|
|
2597
|
+
if (o.error === "interrupted" && this.patches.isAndroid && this.isAndroidPaused)
|
|
2598
|
+
return;
|
|
2599
|
+
this.isSpeakingInternal = !1, this.isPausedInternal = !1, this.stopResumeInfinity(), this.setState("idle"), ["synthesis-unavailable", "audio-hardware", "voice-unavailable"].includes(o.error) && (console.log("[ENGINE] fatal error detected, resetting index to 0"), this.currentUtteranceIndex = 0), o.error === "interrupted" || o.error === "canceled" ? this.emitEvent({ type: "stop" }) : this.emitEvent({
|
|
2600
|
+
type: "error",
|
|
2601
|
+
detail: {
|
|
2602
|
+
error: o.error,
|
|
2603
|
+
// Preserve original error type
|
|
2604
|
+
message: `Speech synthesis error: ${o.error}`
|
|
2605
|
+
}
|
|
2606
|
+
});
|
|
2607
|
+
}, i.onpause = () => {
|
|
2608
|
+
this.isPausedInternal = !0, this.isSpeakingInternal = !1, this.emitEvent({ type: "pause" });
|
|
2609
|
+
}, i.onresume = () => {
|
|
2610
|
+
this.isPausedInternal = !1, this.isSpeakingInternal = !0, this.emitEvent({ type: "resume" });
|
|
2611
|
+
}, i.onboundary = (o) => {
|
|
2612
|
+
this.emitEvent({
|
|
2613
|
+
type: "boundary",
|
|
2614
|
+
detail: {
|
|
2615
|
+
charIndex: o.charIndex,
|
|
2616
|
+
charLength: o.charLength,
|
|
2617
|
+
elapsedTime: o.elapsedTime,
|
|
2618
|
+
name: o.name
|
|
2619
|
+
}
|
|
2620
|
+
});
|
|
2621
|
+
}, i.onmark = (o) => {
|
|
2622
|
+
this.emitEvent({
|
|
2623
|
+
type: "mark",
|
|
2624
|
+
detail: {
|
|
2625
|
+
name: o.name
|
|
2626
|
+
}
|
|
2627
|
+
});
|
|
2628
|
+
}, this.speechSynthesis.speak(i);
|
|
2629
|
+
}
|
|
2535
2630
|
}
|
|
2536
2631
|
startResumeInfinity(e) {
|
|
2537
2632
|
this.shouldUseResumeInfinity() && (this.resumeInfinityTimer = window.setTimeout(() => {
|
|
2538
2633
|
if (e) {
|
|
2539
|
-
const { paused: n, speaking: i } = this.speechSynthesis, s = i || this.isSpeakingInternal,
|
|
2540
|
-
s && !
|
|
2634
|
+
const { paused: n, speaking: i } = this.speechSynthesis, s = i || this.isSpeakingInternal, o = n || this.isPausedInternal;
|
|
2635
|
+
s && !o && (this.speechSynthesis.pause(), this.speechSynthesis.resume());
|
|
2541
2636
|
}
|
|
2542
2637
|
this.startResumeInfinity(e);
|
|
2543
2638
|
}, 5e3));
|
|
@@ -2552,7 +2647,7 @@ class wt {
|
|
|
2552
2647
|
this.playbackState === "paused" && this.currentUtteranceIndex < this.currentUtterances.length && (this.isPausedInternal = !1, this.isSpeakingInternal = !0, this.setState("playing"), this.emitEvent({ type: "resume" }), this.patches.isAndroid || this.pausedAtUtteranceIndex !== this.currentUtteranceIndex ? this.speak(this.currentUtteranceIndex) : this.speechSynthesis.resume(), this.pausedAtUtteranceIndex = null);
|
|
2553
2648
|
}
|
|
2554
2649
|
stop() {
|
|
2555
|
-
this.speechSynthesis.cancel(), this.currentUtteranceIndex = 0, this.patches.isAndroid && (this.isAndroidPaused = !1), this.setState("idle"), this.emitEvent({ type: "stop" });
|
|
2650
|
+
this.speechSynthesis.cancel(), this.speakGeneration++, this.currentUtteranceIndex = 0, this.patches.isAndroid && (this.isAndroidPaused = !1), this.setState("idle"), this.emitEvent({ type: "stop" });
|
|
2556
2651
|
}
|
|
2557
2652
|
// Playback Parameters
|
|
2558
2653
|
setRate(e) {
|
|
@@ -2621,10 +2716,10 @@ class wt {
|
|
|
2621
2716
|
}
|
|
2622
2717
|
// Cleanup with comprehensive error handling
|
|
2623
2718
|
async destroy() {
|
|
2624
|
-
this.stop(), this.stopResumeInfinity(), this.eventListeners.clear(), this.currentUtterances = [], this.currentVoice = null, this.voices = [], this.defaultVoice = null, this.initialized = !1;
|
|
2719
|
+
this.stop(), this.stopResumeInfinity(), this.eventListeners.clear(), this.currentUtterances = [], this.currentVoice = null, this.voices = [], this.defaultVoice = null, this.languageVoiceCache.clear(), this.warmingLanguages.clear(), this.initialized = !1;
|
|
2625
2720
|
}
|
|
2626
2721
|
}
|
|
2627
|
-
class
|
|
2722
|
+
class ol {
|
|
2628
2723
|
id = "webspeech";
|
|
2629
2724
|
name = "Web Speech API";
|
|
2630
2725
|
engine = null;
|
|
@@ -2680,6 +2775,8 @@ class ll {
|
|
|
2680
2775
|
this.emitEvent(e);
|
|
2681
2776
|
}), this.engine.on("voiceschanged", () => {
|
|
2682
2777
|
this.emitEvent({ type: "voiceschanged" });
|
|
2778
|
+
}), this.engine.on("languagefallback", (e) => {
|
|
2779
|
+
this.emitEvent(e);
|
|
2683
2780
|
});
|
|
2684
2781
|
}
|
|
2685
2782
|
setNavigatorState(e) {
|
|
@@ -2695,6 +2792,12 @@ class ll {
|
|
|
2695
2792
|
getCurrentVoice() {
|
|
2696
2793
|
return this.engine.getCurrentVoice();
|
|
2697
2794
|
}
|
|
2795
|
+
setSpeakInContentLanguage(e) {
|
|
2796
|
+
this.engine.setSpeakInContentLanguage(e);
|
|
2797
|
+
}
|
|
2798
|
+
getSpeakInContentLanguage() {
|
|
2799
|
+
return this.engine.getSpeakInContentLanguage();
|
|
2800
|
+
}
|
|
2698
2801
|
// Content Management
|
|
2699
2802
|
loadContent(e) {
|
|
2700
2803
|
const r = Array.isArray(e) ? e : [e];
|
|
@@ -2791,17 +2894,17 @@ class ll {
|
|
|
2791
2894
|
this.eventListeners.clear(), await this.engine.destroy();
|
|
2792
2895
|
}
|
|
2793
2896
|
}
|
|
2794
|
-
let
|
|
2897
|
+
let Ca = class {
|
|
2795
2898
|
};
|
|
2796
|
-
function
|
|
2899
|
+
function Aa(t) {
|
|
2797
2900
|
return (t.getComputedStyle(t.document.documentElement).writingMode || t.getComputedStyle(t.document.body).writingMode) === "vertical-lr";
|
|
2798
2901
|
}
|
|
2799
|
-
function
|
|
2902
|
+
function Ta(t) {
|
|
2800
2903
|
const e = t.getComputedStyle(t.document.documentElement).writingMode || t.getComputedStyle(t.document.body).writingMode;
|
|
2801
2904
|
return e === "vertical-rl" || e === "vertical-lr";
|
|
2802
2905
|
}
|
|
2803
2906
|
function me(t) {
|
|
2804
|
-
const e =
|
|
2907
|
+
const e = Ta(t), r = e && Aa(t), n = t.innerWidth, i = t.innerHeight, s = t.document.scrollingElement, o = s.scrollLeft, a = s.scrollTop, c = parseInt(t.getComputedStyle(t.document.documentElement).getPropertyValue("column-count")), l = e && !r ? s.scrollWidth - n + o : o, h = a;
|
|
2805
2908
|
return { isVertical: e, isVertLR: r, viewportInlineSize: e ? i : n, viewportBlockSize: e ? n : i, pageInlineSize: e ? i : n / (c || 1), xDocOffset: l, yDocOffset: h, inlineScrollOffset: e ? h : l, blockScrollOffset: e ? l : h, inlineStart: (d) => e ? d.top : d.left, blockStart: (d) => e ? d.left : d.top, inlineSize: (d) => e ? d.height : d.width, blockSize: (d) => e ? d.width : d.height, applyPosition(d, g, f, y, p, m) {
|
|
2806
2909
|
d.style.position = "absolute", e ? (d.style.top = `${g * m}px`, d.style.left = `${f * m}px`, d.style.height = `${y * m}px`, d.style.width = `${p * m}px`) : (d.style.left = `${g * m}px`, d.style.top = `${f * m}px`, d.style.width = `${y * m}px`, d.style.height = `${p * m}px`);
|
|
2807
2910
|
}, toRect(d, g, f, y) {
|
|
@@ -2811,11 +2914,11 @@ function me(t) {
|
|
|
2811
2914
|
function fr(t, e) {
|
|
2812
2915
|
return t.document.documentElement.style.getPropertyValue(e);
|
|
2813
2916
|
}
|
|
2814
|
-
function
|
|
2917
|
+
function Ra(t) {
|
|
2815
2918
|
return t && Array.isArray(t) ? t : void 0;
|
|
2816
2919
|
}
|
|
2817
|
-
function
|
|
2818
|
-
return t && typeof t == "string" ? [t] :
|
|
2920
|
+
function Na(t) {
|
|
2921
|
+
return t && typeof t == "string" ? [t] : Ra(t);
|
|
2819
2922
|
}
|
|
2820
2923
|
function it(t) {
|
|
2821
2924
|
return isNaN(t) ? void 0 : t;
|
|
@@ -2829,16 +2932,16 @@ let ye = class Jr {
|
|
|
2829
2932
|
}
|
|
2830
2933
|
static deserialize(e) {
|
|
2831
2934
|
if (!e) return;
|
|
2832
|
-
const r = it(e.progression), n = it(e.totalProgression), i = it(e.position), s = /* @__PURE__ */ new Map(),
|
|
2833
|
-
return Object.entries(e).forEach(([
|
|
2834
|
-
|
|
2835
|
-
}), e.otherLocations instanceof Map && e.otherLocations.forEach((
|
|
2935
|
+
const r = it(e.progression), n = it(e.totalProgression), i = it(e.position), s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(["fragment", "fragments", "progression", "totalProgression", "position", "otherLocations"]);
|
|
2936
|
+
return Object.entries(e).forEach(([a, c]) => {
|
|
2937
|
+
o.has(a) || s.set(a, c);
|
|
2938
|
+
}), e.otherLocations instanceof Map && e.otherLocations.forEach((a, c) => s.set(c, a)), new Jr({ fragments: Na(e.fragments || e.fragment), progression: r !== void 0 && r >= 0 && r <= 1 ? r : void 0, totalProgression: n !== void 0 && n >= 0 && n <= 1 ? n : void 0, position: i !== void 0 && i > 0 ? i : void 0, otherLocations: s.size === 0 ? void 0 : s });
|
|
2836
2939
|
}
|
|
2837
2940
|
serialize() {
|
|
2838
2941
|
const e = {};
|
|
2839
2942
|
return this.fragments && (e.fragments = this.fragments), this.progression !== void 0 && (e.progression = this.progression), this.totalProgression !== void 0 && (e.totalProgression = this.totalProgression), this.position !== void 0 && (e.position = this.position), this.otherLocations && this.otherLocations.forEach((r, n) => e[n] = r), e;
|
|
2840
2943
|
}
|
|
2841
|
-
},
|
|
2944
|
+
}, La = class Qr {
|
|
2842
2945
|
constructor(e) {
|
|
2843
2946
|
this.after = e.after, this.before = e.before, this.highlight = e.highlight;
|
|
2844
2947
|
}
|
|
@@ -2849,7 +2952,7 @@ let ye = class Jr {
|
|
|
2849
2952
|
const e = {};
|
|
2850
2953
|
return this.after !== void 0 && (e.after = this.after), this.before !== void 0 && (e.before = this.before), this.highlight !== void 0 && (e.highlight = this.highlight), e;
|
|
2851
2954
|
}
|
|
2852
|
-
},
|
|
2955
|
+
}, Ia = class St {
|
|
2853
2956
|
constructor(e) {
|
|
2854
2957
|
const r = e.href.indexOf("#"), n = r >= 0 ? e.href.slice(r + 1) : void 0;
|
|
2855
2958
|
this.href = r >= 0 ? e.href.slice(0, r) : e.href, this.type = e.type, this.title = e.title;
|
|
@@ -2857,7 +2960,7 @@ let ye = class Jr {
|
|
|
2857
2960
|
this.locations = e.locations ? s ? new ye({ ...e.locations, fragments: [n] }) : e.locations : n ? new ye({ fragments: [n] }) : new ye({}), this.text = e.text;
|
|
2858
2961
|
}
|
|
2859
2962
|
static deserialize(e) {
|
|
2860
|
-
if (e && e.href && e.type) return new St({ href: e.href, type: e.type, title: e.title, locations: ye.deserialize(e.locations), text:
|
|
2963
|
+
if (e && e.href && e.type) return new St({ href: e.href, type: e.type, title: e.title, locations: ye.deserialize(e.locations), text: La.deserialize(e.text) });
|
|
2861
2964
|
}
|
|
2862
2965
|
serialize() {
|
|
2863
2966
|
const e = { href: this.href, type: this.type };
|
|
@@ -2870,11 +2973,11 @@ let ye = class Jr {
|
|
|
2870
2973
|
function pr(t) {
|
|
2871
2974
|
return t.split("").reverse().join("");
|
|
2872
2975
|
}
|
|
2873
|
-
function
|
|
2976
|
+
function qa(t, e, r) {
|
|
2874
2977
|
const n = pr(e);
|
|
2875
2978
|
return r.map((i) => {
|
|
2876
|
-
const s = Math.max(0, i.end - e.length - i.errors),
|
|
2877
|
-
return { start: Xr(
|
|
2979
|
+
const s = Math.max(0, i.end - e.length - i.errors), o = pr(t.slice(s, i.end));
|
|
2980
|
+
return { start: Xr(o, n, i.errors).reduce((a, c) => i.end - c.end < a ? i.end - c.end : a, i.end), end: i.end, errors: i.errors };
|
|
2878
2981
|
});
|
|
2879
2982
|
}
|
|
2880
2983
|
function st(t) {
|
|
@@ -2882,18 +2985,18 @@ function st(t) {
|
|
|
2882
2985
|
}
|
|
2883
2986
|
function mr(t, e, r, n) {
|
|
2884
2987
|
let i = t.P[r], s = t.M[r];
|
|
2885
|
-
const
|
|
2988
|
+
const o = n >>> 31, a = e[r] | o, c = a | s, l = (a & i) + i ^ i | a;
|
|
2886
2989
|
let h = s | ~(l | i), d = i & l;
|
|
2887
2990
|
const g = st(h & t.lastRowMask[r]) - st(d & t.lastRowMask[r]);
|
|
2888
|
-
return h <<= 1, d <<= 1, d |=
|
|
2991
|
+
return h <<= 1, d <<= 1, d |= o, h |= st(n) - o, i = d | ~(c | h), s = h & c, t.P[r] = i, t.M[r] = s, g;
|
|
2889
2992
|
}
|
|
2890
2993
|
function Xr(t, e, r) {
|
|
2891
2994
|
if (e.length === 0) return [];
|
|
2892
2995
|
r = Math.min(r, e.length);
|
|
2893
|
-
const n = [], i = 32, s = Math.ceil(e.length / i) - 1,
|
|
2894
|
-
|
|
2895
|
-
const
|
|
2896
|
-
for (let g = 0; g < 256; g++) l.push(
|
|
2996
|
+
const n = [], i = 32, s = Math.ceil(e.length / i) - 1, o = { P: new Uint32Array(s + 1), M: new Uint32Array(s + 1), lastRowMask: new Uint32Array(s + 1) };
|
|
2997
|
+
o.lastRowMask.fill(1 << 31), o.lastRowMask[s] = 1 << (e.length - 1) % i;
|
|
2998
|
+
const a = new Uint32Array(s + 1), c = /* @__PURE__ */ new Map(), l = [];
|
|
2999
|
+
for (let g = 0; g < 256; g++) l.push(a);
|
|
2897
3000
|
for (let g = 0; g < e.length; g += 1) {
|
|
2898
3001
|
const f = e.charCodeAt(g);
|
|
2899
3002
|
if (c.has(f)) continue;
|
|
@@ -2911,75 +3014,75 @@ function Xr(t, e, r) {
|
|
|
2911
3014
|
const d = new Uint32Array(s + 1);
|
|
2912
3015
|
for (let g = 0; g <= h; g += 1) d[g] = (g + 1) * i;
|
|
2913
3016
|
d[s] = e.length;
|
|
2914
|
-
for (let g = 0; g <= h; g += 1)
|
|
3017
|
+
for (let g = 0; g <= h; g += 1) o.P[g] = -1, o.M[g] = 0;
|
|
2915
3018
|
for (let g = 0; g < t.length; g += 1) {
|
|
2916
3019
|
const f = t.charCodeAt(g);
|
|
2917
3020
|
let y;
|
|
2918
|
-
f < l.length ? y = l[f] : (y = c.get(f), typeof y > "u" && (y =
|
|
3021
|
+
f < l.length ? y = l[f] : (y = c.get(f), typeof y > "u" && (y = a));
|
|
2919
3022
|
let p = 0;
|
|
2920
|
-
for (let m = 0; m <= h; m += 1) p = mr(
|
|
3023
|
+
for (let m = 0; m <= h; m += 1) p = mr(o, y, m, p), d[m] += p;
|
|
2921
3024
|
if (d[h] - p <= r && h < s && (y[h + 1] & 1 || p < 0)) {
|
|
2922
|
-
h += 1,
|
|
3025
|
+
h += 1, o.P[h] = -1, o.M[h] = 0;
|
|
2923
3026
|
let m;
|
|
2924
3027
|
if (h === s) {
|
|
2925
3028
|
const w = e.length % i;
|
|
2926
3029
|
m = w === 0 ? i : w;
|
|
2927
3030
|
} else m = i;
|
|
2928
|
-
d[h] = d[h - 1] + m - p + mr(
|
|
3031
|
+
d[h] = d[h - 1] + m - p + mr(o, y, h, p);
|
|
2929
3032
|
} else for (; h > 0 && d[h] >= r + i; ) h -= 1;
|
|
2930
3033
|
h === s && d[h] <= r && (d[h] < r && n.splice(0, n.length), n.push({ start: -1, end: g + 1, errors: d[h] }), r = d[h]);
|
|
2931
3034
|
}
|
|
2932
3035
|
return n;
|
|
2933
3036
|
}
|
|
2934
|
-
function
|
|
3037
|
+
function Pa(t, e, r) {
|
|
2935
3038
|
const n = Xr(t, e, r);
|
|
2936
|
-
return
|
|
3039
|
+
return qa(t, e, n);
|
|
2937
3040
|
}
|
|
2938
3041
|
function Zr(t, e, r) {
|
|
2939
3042
|
let n = 0;
|
|
2940
3043
|
const i = [];
|
|
2941
3044
|
for (; n !== -1; ) n = t.indexOf(e, n), n !== -1 && (i.push({ start: n, end: n + e.length, errors: 0 }), n += 1);
|
|
2942
|
-
return i.length > 0 ? i :
|
|
3045
|
+
return i.length > 0 ? i : Pa(t, e, r);
|
|
2943
3046
|
}
|
|
2944
3047
|
function yr(t, e) {
|
|
2945
3048
|
return e.length === 0 || t.length === 0 ? 0 : 1 - Zr(t, e, e.length)[0].errors / e.length;
|
|
2946
3049
|
}
|
|
2947
|
-
function
|
|
3050
|
+
function $a(t, e, r = {}) {
|
|
2948
3051
|
if (e.length === 0) return null;
|
|
2949
3052
|
const n = Math.min(256, e.length / 2), i = Zr(t, e, n);
|
|
2950
3053
|
if (i.length === 0) return null;
|
|
2951
|
-
const s = (
|
|
2952
|
-
const c = 1 -
|
|
3054
|
+
const s = (a) => {
|
|
3055
|
+
const c = 1 - a.errors / e.length, l = r.prefix ? yr(t.slice(Math.max(0, a.start - r.prefix.length), a.start), r.prefix) : 1, h = r.suffix ? yr(t.slice(a.end, a.end + r.suffix.length), r.suffix) : 1;
|
|
2953
3056
|
let d = 1;
|
|
2954
|
-
return typeof r.hint == "number" && (d = 1 - Math.abs(
|
|
2955
|
-
},
|
|
2956
|
-
return
|
|
3057
|
+
return typeof r.hint == "number" && (d = 1 - Math.abs(a.start - r.hint) / t.length), (50 * c + 20 * l + 20 * h + 2 * d) / 92;
|
|
3058
|
+
}, o = i.map((a) => ({ start: a.start, end: a.end, score: s(a) }));
|
|
3059
|
+
return o.sort((a, c) => c.score - a.score), o[0];
|
|
2957
3060
|
}
|
|
2958
3061
|
function kt(t, e, r) {
|
|
2959
3062
|
const n = r === 1 ? e : e - 1;
|
|
2960
3063
|
if (t.charAt(n).trim() !== "") return e;
|
|
2961
3064
|
let i, s;
|
|
2962
3065
|
if (r === 2 ? (i = t.substring(0, e), s = i.trimEnd()) : (i = t.substring(e), s = i.trimStart()), !s.length) return -1;
|
|
2963
|
-
const
|
|
2964
|
-
return r === 2 ? e -
|
|
3066
|
+
const o = i.length - s.length;
|
|
3067
|
+
return r === 2 ? e - o : e + o;
|
|
2965
3068
|
}
|
|
2966
3069
|
function br(t, e) {
|
|
2967
3070
|
const r = t.commonAncestorContainer.ownerDocument.createNodeIterator(t.commonAncestorContainer, NodeFilter.SHOW_TEXT), n = e === 1 ? t.startContainer : t.endContainer, i = e === 1 ? t.endContainer : t.startContainer;
|
|
2968
3071
|
let s = r.nextNode();
|
|
2969
3072
|
for (; s && s !== n; ) s = r.nextNode();
|
|
2970
3073
|
e === 2 && (s = r.previousNode());
|
|
2971
|
-
let
|
|
2972
|
-
const
|
|
3074
|
+
let o = -1;
|
|
3075
|
+
const a = () => {
|
|
2973
3076
|
if (s = e === 1 ? r.nextNode() : r.previousNode(), s) {
|
|
2974
3077
|
const c = s.textContent, l = e === 1 ? 0 : c.length;
|
|
2975
|
-
|
|
3078
|
+
o = kt(c, l, e);
|
|
2976
3079
|
}
|
|
2977
3080
|
};
|
|
2978
|
-
for (; s &&
|
|
2979
|
-
if (s &&
|
|
3081
|
+
for (; s && o === -1 && s !== i; ) a();
|
|
3082
|
+
if (s && o >= 0) return { node: s, offset: o };
|
|
2980
3083
|
throw new RangeError("No text nodes with non-whitespace text found in range");
|
|
2981
3084
|
}
|
|
2982
|
-
function
|
|
3085
|
+
function Da(t) {
|
|
2983
3086
|
if (!t.toString().trim().length) throw new RangeError("Range contains no non-whitespace text");
|
|
2984
3087
|
if (t.startContainer.nodeType !== Node.TEXT_NODE) throw new RangeError("Range startContainer is not a text node");
|
|
2985
3088
|
if (t.endContainer.nodeType !== Node.TEXT_NODE) throw new RangeError("Range endContainer is not a text node");
|
|
@@ -2988,12 +3091,12 @@ function Bo(t) {
|
|
|
2988
3091
|
const i = { start: kt(t.startContainer.textContent, t.startOffset, 1), end: kt(t.endContainer.textContent, t.endOffset, 2) };
|
|
2989
3092
|
if (i.start >= 0 && (e.setStart(t.startContainer, i.start), r = !0), i.end > 0 && (e.setEnd(t.endContainer, i.end), n = !0), r && n) return e;
|
|
2990
3093
|
if (!r) {
|
|
2991
|
-
const { node: s, offset:
|
|
2992
|
-
s &&
|
|
3094
|
+
const { node: s, offset: o } = br(e, 1);
|
|
3095
|
+
s && o >= 0 && e.setStart(s, o);
|
|
2993
3096
|
}
|
|
2994
3097
|
if (!n) {
|
|
2995
|
-
const { node: s, offset:
|
|
2996
|
-
s &&
|
|
3098
|
+
const { node: s, offset: o } = br(e, 2);
|
|
3099
|
+
s && o > 0 && e.setEnd(s, o);
|
|
2997
3100
|
}
|
|
2998
3101
|
return e;
|
|
2999
3102
|
}
|
|
@@ -3014,9 +3117,9 @@ function vr(t) {
|
|
|
3014
3117
|
function en(t, ...e) {
|
|
3015
3118
|
let r = e.shift();
|
|
3016
3119
|
const n = t.ownerDocument.createNodeIterator(t, NodeFilter.SHOW_TEXT), i = [];
|
|
3017
|
-
let s = n.nextNode(),
|
|
3018
|
-
for (; r !== void 0 && s; )
|
|
3019
|
-
for (; r !== void 0 &&
|
|
3120
|
+
let s = n.nextNode(), o, a = 0;
|
|
3121
|
+
for (; r !== void 0 && s; ) o = s, a + o.data.length > r ? (i.push({ node: o, offset: r - a }), r = e.shift()) : (s = n.nextNode(), a += o.data.length);
|
|
3122
|
+
for (; r !== void 0 && o && a === r; ) i.push({ node: o, offset: o.data.length }), r = e.shift();
|
|
3020
3123
|
if (r !== void 0) throw new RangeError("Offset exceeds text length");
|
|
3021
3124
|
return i;
|
|
3022
3125
|
}
|
|
@@ -3093,9 +3196,9 @@ let Le = class te {
|
|
|
3093
3196
|
return new ve(new Le(e, r), new Le(e, n));
|
|
3094
3197
|
}
|
|
3095
3198
|
static trimmedRange(e) {
|
|
3096
|
-
return
|
|
3199
|
+
return Da(ve.fromRange(e).toRange());
|
|
3097
3200
|
}
|
|
3098
|
-
},
|
|
3201
|
+
}, Ba = class xt {
|
|
3099
3202
|
constructor(e, r, n) {
|
|
3100
3203
|
this.root = e, this.start = r, this.end = n;
|
|
3101
3204
|
}
|
|
@@ -3112,13 +3215,13 @@ let Le = class te {
|
|
|
3112
3215
|
toRange() {
|
|
3113
3216
|
return Ot.fromOffsets(this.root, this.start, this.end).toRange();
|
|
3114
3217
|
}
|
|
3115
|
-
},
|
|
3218
|
+
}, ja = class Et {
|
|
3116
3219
|
constructor(e, r, n = {}) {
|
|
3117
3220
|
this.root = e, this.exact = r, this.context = n;
|
|
3118
3221
|
}
|
|
3119
3222
|
static fromRange(e, r) {
|
|
3120
|
-
const n = e.textContent, i = Ot.fromRange(r).relativeTo(e), s = i.start.offset,
|
|
3121
|
-
return new Et(e, n.slice(s,
|
|
3223
|
+
const n = e.textContent, i = Ot.fromRange(r).relativeTo(e), s = i.start.offset, o = i.end.offset, a = 32;
|
|
3224
|
+
return new Et(e, n.slice(s, o), { prefix: n.slice(Math.max(0, s - a), s), suffix: n.slice(o, Math.min(n.length, o + a)) });
|
|
3122
3225
|
}
|
|
3123
3226
|
static fromSelector(e, r) {
|
|
3124
3227
|
const { prefix: n, suffix: i } = r;
|
|
@@ -3131,22 +3234,22 @@ let Le = class te {
|
|
|
3131
3234
|
return this.toPositionAnchor(e).toRange();
|
|
3132
3235
|
}
|
|
3133
3236
|
toPositionAnchor(e = {}) {
|
|
3134
|
-
const r = this.root.textContent, n =
|
|
3237
|
+
const r = this.root.textContent, n = $a(r, this.exact, { ...this.context, hint: e.hint });
|
|
3135
3238
|
if (!n) throw new Error("Quote not found");
|
|
3136
|
-
return new
|
|
3239
|
+
return new Ba(this.root, n.start, n.end);
|
|
3137
3240
|
}
|
|
3138
3241
|
};
|
|
3139
|
-
function
|
|
3242
|
+
function Ua(t) {
|
|
3140
3243
|
const e = t.tagName.toUpperCase();
|
|
3141
3244
|
return e === "IMG" || e === "VIDEO" || e === "AUDIO" || e === "IFRAME" || e === "OBJECT" || e === "EMBED" || e === "CANVAS";
|
|
3142
3245
|
}
|
|
3143
|
-
function
|
|
3246
|
+
function za(t, e) {
|
|
3144
3247
|
try {
|
|
3145
3248
|
const r = e.locations, n = e.text;
|
|
3146
3249
|
if (n && n.highlight) {
|
|
3147
3250
|
let i;
|
|
3148
3251
|
r && Ne(r) && (i = t.querySelector(Ne(r))), i || (i = t.body);
|
|
3149
|
-
const s = new
|
|
3252
|
+
const s = new ja(i, n.highlight, { prefix: n.before, suffix: n.after });
|
|
3150
3253
|
try {
|
|
3151
3254
|
return s.toRange();
|
|
3152
3255
|
} catch {
|
|
@@ -3160,7 +3263,7 @@ function _o(t, e) {
|
|
|
3160
3263
|
}
|
|
3161
3264
|
if (i) {
|
|
3162
3265
|
const s = t.createRange();
|
|
3163
|
-
return i.childNodes.length === 0 ||
|
|
3266
|
+
return i.childNodes.length === 0 || Ua(i) ? (s.selectNode(i), s) : (s.setStartBefore(i), s.setEndAfter(i), s);
|
|
3164
3267
|
}
|
|
3165
3268
|
}
|
|
3166
3269
|
} catch (r) {
|
|
@@ -3168,12 +3271,12 @@ function _o(t, e) {
|
|
|
3168
3271
|
}
|
|
3169
3272
|
return null;
|
|
3170
3273
|
}
|
|
3171
|
-
function
|
|
3172
|
-
const r = e.map((c) => c.toUpperCase()), n = [], i = t.commonAncestorContainer, s = i.nodeType === Node.TEXT_NODE ? i.parentNode : i,
|
|
3173
|
-
let
|
|
3174
|
-
for (;
|
|
3175
|
-
if (t.intersectsNode(
|
|
3176
|
-
let c =
|
|
3274
|
+
function Ha(t, e) {
|
|
3275
|
+
const r = e.map((c) => c.toUpperCase()), n = [], i = t.commonAncestorContainer, s = i.nodeType === Node.TEXT_NODE ? i.parentNode : i, o = t.startContainer.ownerDocument.createTreeWalker(s, NodeFilter.SHOW_TEXT);
|
|
3276
|
+
let a = o.nextNode();
|
|
3277
|
+
for (; a; ) {
|
|
3278
|
+
if (t.intersectsNode(a)) {
|
|
3279
|
+
let c = a.parentNode, l = !1;
|
|
3177
3280
|
for (; c; ) {
|
|
3178
3281
|
if (c.nodeType === Node.ELEMENT_NODE && r.includes(c.tagName.toUpperCase())) {
|
|
3179
3282
|
l = !0;
|
|
@@ -3183,11 +3286,11 @@ function Ho(t, e) {
|
|
|
3183
3286
|
}
|
|
3184
3287
|
if (!l) {
|
|
3185
3288
|
const h = t.cloneRange();
|
|
3186
|
-
h.selectNode(
|
|
3289
|
+
h.selectNode(a), h.compareBoundaryPoints(Range.START_TO_START, t) < 0 && h.setStart(t.startContainer, t.startOffset), h.compareBoundaryPoints(Range.END_TO_END, t) > 0 && h.setEnd(t.endContainer, t.endOffset);
|
|
3187
3290
|
for (const d of h.getClientRects()) n.push({ left: d.left, right: d.right, top: d.top, bottom: d.bottom, width: d.width, height: d.height });
|
|
3188
3291
|
}
|
|
3189
3292
|
}
|
|
3190
|
-
|
|
3293
|
+
a = o.nextNode();
|
|
3191
3294
|
}
|
|
3192
3295
|
return n;
|
|
3193
3296
|
}
|
|
@@ -3200,69 +3303,69 @@ function Ie(t, e, r = !1, n = 0) {
|
|
|
3200
3303
|
for (const h of l) i.push({ bottom: h.bottom, height: h.height, left: h.left, right: h.right, top: h.top, width: h.width });
|
|
3201
3304
|
}
|
|
3202
3305
|
if (n) for (const l of i) l.left -= n, l.top -= n, l.right += n, l.bottom += n, l.width += n * 2, l.height += n * 2;
|
|
3203
|
-
const s = tn(i, 1, e, r),
|
|
3204
|
-
for (let l =
|
|
3205
|
-
const h =
|
|
3206
|
-
if (!(h.width * h.height > c)) if (
|
|
3306
|
+
const s = tn(i, 1, e, r), o = Fa(s, 1), a = rn(o), c = 4;
|
|
3307
|
+
for (let l = a.length - 1; l >= 0; l--) {
|
|
3308
|
+
const h = a[l];
|
|
3309
|
+
if (!(h.width * h.height > c)) if (a.length > 1) a.splice(l, 1);
|
|
3207
3310
|
else break;
|
|
3208
3311
|
}
|
|
3209
|
-
return
|
|
3312
|
+
return a;
|
|
3210
3313
|
}
|
|
3211
3314
|
function tn(t, e, r, n = !1) {
|
|
3212
3315
|
for (let i = 0; i < t.length; i++) for (let s = i + 1; s < t.length; s++) {
|
|
3213
|
-
const
|
|
3214
|
-
if (
|
|
3215
|
-
const c =
|
|
3216
|
-
if ((l && !r && !n || c && !l) && nn(
|
|
3217
|
-
const h = t.filter((g) => g !==
|
|
3316
|
+
const o = t[i], a = t[s];
|
|
3317
|
+
if (o === a) continue;
|
|
3318
|
+
const c = P(o.top, a.top, e) && P(o.bottom, a.bottom, e), l = P(o.left, a.left, e) && P(o.right, a.right, e);
|
|
3319
|
+
if ((l && !r && !n || c && !l) && nn(o, a, e)) {
|
|
3320
|
+
const h = t.filter((g) => g !== o && g !== a), d = _a(o, a);
|
|
3218
3321
|
return h.push(d), tn(h, e, r, n);
|
|
3219
3322
|
}
|
|
3220
3323
|
}
|
|
3221
3324
|
return t;
|
|
3222
3325
|
}
|
|
3223
|
-
function
|
|
3326
|
+
function _a(t, e) {
|
|
3224
3327
|
const r = Math.min(t.left, e.left), n = Math.max(t.right, e.right), i = Math.min(t.top, e.top), s = Math.max(t.bottom, e.bottom);
|
|
3225
3328
|
return { bottom: s, height: s - i, left: r, right: n, top: i, width: n - r };
|
|
3226
3329
|
}
|
|
3227
|
-
function
|
|
3330
|
+
function Fa(t, e) {
|
|
3228
3331
|
const r = new Set(t);
|
|
3229
3332
|
for (const n of t) {
|
|
3230
3333
|
if (!(n.width > 1 && n.height > 1)) {
|
|
3231
3334
|
r.delete(n);
|
|
3232
3335
|
continue;
|
|
3233
3336
|
}
|
|
3234
|
-
for (const i of t) if (n !== i && r.has(i) &&
|
|
3337
|
+
for (const i of t) if (n !== i && r.has(i) && Ma(i, n, e)) {
|
|
3235
3338
|
r.delete(n);
|
|
3236
3339
|
break;
|
|
3237
3340
|
}
|
|
3238
3341
|
}
|
|
3239
3342
|
return Array.from(r);
|
|
3240
3343
|
}
|
|
3241
|
-
function
|
|
3242
|
-
return
|
|
3344
|
+
function Ma(t, e, r) {
|
|
3345
|
+
return W(t, e.left, e.top, r) && W(t, e.right, e.top, r) && W(t, e.left, e.bottom, r) && W(t, e.right, e.bottom, r);
|
|
3243
3346
|
}
|
|
3244
|
-
function
|
|
3245
|
-
return (t.left < e ||
|
|
3347
|
+
function W(t, e, r, n) {
|
|
3348
|
+
return (t.left < e || P(t.left, e, n)) && (t.right > e || P(t.right, e, n)) && (t.top < r || P(t.top, r, n)) && (t.bottom > r || P(t.bottom, r, n));
|
|
3246
3349
|
}
|
|
3247
3350
|
function rn(t) {
|
|
3248
3351
|
for (let e = 0; e < t.length; e++) for (let r = e + 1; r < t.length; r++) {
|
|
3249
3352
|
const n = t[e], i = t[r];
|
|
3250
3353
|
if (n !== i && nn(n, i, -1)) {
|
|
3251
|
-
let s = [],
|
|
3252
|
-
const
|
|
3253
|
-
if (
|
|
3354
|
+
let s = [], o;
|
|
3355
|
+
const a = wr(n, i);
|
|
3356
|
+
if (a.length === 1) s = a, o = n;
|
|
3254
3357
|
else {
|
|
3255
3358
|
const l = wr(i, n);
|
|
3256
|
-
|
|
3359
|
+
a.length < l.length ? (s = a, o = n) : (s = l, o = i);
|
|
3257
3360
|
}
|
|
3258
|
-
const c = t.filter((l) => l !==
|
|
3361
|
+
const c = t.filter((l) => l !== o);
|
|
3259
3362
|
return Array.prototype.push.apply(c, s), rn(c);
|
|
3260
3363
|
}
|
|
3261
3364
|
}
|
|
3262
3365
|
return t;
|
|
3263
3366
|
}
|
|
3264
3367
|
function wr(t, e) {
|
|
3265
|
-
const r =
|
|
3368
|
+
const r = Va(e, t);
|
|
3266
3369
|
if (r.height === 0 || r.width === 0) return [t];
|
|
3267
3370
|
const n = [];
|
|
3268
3371
|
{
|
|
@@ -3283,118 +3386,118 @@ function wr(t, e) {
|
|
|
3283
3386
|
}
|
|
3284
3387
|
return n;
|
|
3285
3388
|
}
|
|
3286
|
-
function
|
|
3389
|
+
function Va(t, e) {
|
|
3287
3390
|
const r = Math.max(t.left, e.left), n = Math.min(t.right, e.right), i = Math.max(t.top, e.top), s = Math.min(t.bottom, e.bottom);
|
|
3288
3391
|
return { bottom: s, height: Math.max(0, s - i), left: r, right: n, top: i, width: Math.max(0, n - r) };
|
|
3289
3392
|
}
|
|
3290
3393
|
function nn(t, e, r) {
|
|
3291
|
-
return (t.left < e.right || r >= 0 &&
|
|
3394
|
+
return (t.left < e.right || r >= 0 && P(t.left, e.right, r)) && (e.left < t.right || r >= 0 && P(e.left, t.right, r)) && (t.top < e.bottom || r >= 0 && P(t.top, e.bottom, r)) && (e.top < t.bottom || r >= 0 && P(e.top, t.bottom, r));
|
|
3292
3395
|
}
|
|
3293
|
-
function
|
|
3396
|
+
function P(t, e, r) {
|
|
3294
3397
|
return Math.abs(t - e) <= r;
|
|
3295
3398
|
}
|
|
3296
|
-
let qe = null,
|
|
3297
|
-
const re = { r: 255, g: 255, b: 255, a: 1 }, Z = /* @__PURE__ */ new Map(),
|
|
3298
|
-
if (!qe) if (typeof OffscreenCanvas < "u") qe = new OffscreenCanvas(5, 5),
|
|
3399
|
+
let qe = null, at = null, be = 0;
|
|
3400
|
+
const re = { r: 255, g: 255, b: 255, a: 1 }, Z = /* @__PURE__ */ new Map(), Wa = () => {
|
|
3401
|
+
if (!qe) if (typeof OffscreenCanvas < "u") qe = new OffscreenCanvas(5, 5), at = qe.getContext("2d", { willReadFrequently: !0, desynchronized: !0 });
|
|
3299
3402
|
else {
|
|
3300
3403
|
const t = document.createElement("canvas");
|
|
3301
|
-
t.width = 5, t.height = 5, qe = t,
|
|
3404
|
+
t.width = 5, t.height = 5, qe = t, at = t.getContext("2d", { willReadFrequently: !0, desynchronized: !0 });
|
|
3302
3405
|
}
|
|
3303
|
-
return
|
|
3304
|
-
},
|
|
3406
|
+
return at;
|
|
3407
|
+
}, Ga = (t) => {
|
|
3305
3408
|
if (!t) return !0;
|
|
3306
3409
|
const e = t.trim().toLowerCase();
|
|
3307
3410
|
return e.startsWith("var(") || ["transparent", "currentcolor", "inherit", "initial", "revert", "unset", "revert-layer"].includes(e) ? !0 : ["linear-gradient", "radial-gradient", "conic-gradient", "repeating-linear-gradient", "repeating-radial-gradient", "repeating-conic-gradient"].some((r) => e.includes(r));
|
|
3308
|
-
},
|
|
3411
|
+
}, Pe = (t, e) => {
|
|
3309
3412
|
console.warn(`[Decorator] Could not parse color: "${t}". ${e} Falling back to ${JSON.stringify(re)} to compute contrast. Please use a CSS color value that can be computed to RGB(A).`);
|
|
3310
3413
|
}, J = (t, e = null) => {
|
|
3311
3414
|
const r = e ? `${t}|${e}` : t, n = Z.get(r);
|
|
3312
3415
|
if (n !== void 0) return n ?? re;
|
|
3313
|
-
if (
|
|
3314
|
-
const i =
|
|
3315
|
-
if (!i) return
|
|
3416
|
+
if (Ga(t)) return Pe(t, "Unsupported color format or special value."), Z.set(r, null), re;
|
|
3417
|
+
const i = Wa();
|
|
3418
|
+
if (!i) return Pe(t, "Could not get canvas context."), Z.set(r, null), re;
|
|
3316
3419
|
try {
|
|
3317
3420
|
be === 0 && i.clearRect(0, 0, 5, 5);
|
|
3318
|
-
const s = be % 5,
|
|
3319
|
-
i.clearRect(s,
|
|
3320
|
-
const
|
|
3421
|
+
const s = be % 5, o = Math.floor(be / 5);
|
|
3422
|
+
i.clearRect(s, o, 1, 1), e && (i.fillStyle = e, i.fillRect(s, o, 1, 1)), i.fillStyle = t, i.fillRect(s, o, 1, 1);
|
|
3423
|
+
const a = i.getImageData(s, o, 1, 1);
|
|
3321
3424
|
be = (be + 1) % 25;
|
|
3322
|
-
const [c, l, h, d] =
|
|
3323
|
-
if (d === 0) return
|
|
3425
|
+
const [c, l, h, d] = a.data;
|
|
3426
|
+
if (d === 0) return Pe(t, "Fully transparent color."), Z.set(r, null), re;
|
|
3324
3427
|
const g = { r: c, g: l, b: h, a: d / 255 };
|
|
3325
3428
|
return Z.set(r, g), g;
|
|
3326
3429
|
} catch (s) {
|
|
3327
|
-
return
|
|
3430
|
+
return Pe(t, `Error: ${s instanceof Error ? s.message : String(s)}`), Z.set(r, null), re;
|
|
3328
3431
|
}
|
|
3329
|
-
},
|
|
3432
|
+
}, ot = (t) => {
|
|
3330
3433
|
const e = t / 255;
|
|
3331
3434
|
return e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
|
|
3332
|
-
},
|
|
3333
|
-
const e =
|
|
3435
|
+
}, Ct = (t) => {
|
|
3436
|
+
const e = ot(t.r), r = ot(t.g), n = ot(t.b);
|
|
3334
3437
|
return 0.2126 * e + 0.7152 * r + 0.0722 * n;
|
|
3335
3438
|
}, ze = (t, e) => {
|
|
3336
|
-
const r = typeof t == "string" ? J(t) : t, n = typeof e == "string" ? J(e) : e, i =
|
|
3337
|
-
return (
|
|
3439
|
+
const r = typeof t == "string" ? J(t) : t, n = typeof e == "string" ? J(e) : e, i = Ct(r), s = Ct(n), o = Math.max(i, s), a = Math.min(i, s);
|
|
3440
|
+
return (o + 0.05) / (a + 0.05);
|
|
3338
3441
|
}, sn = (t, e = null) => {
|
|
3339
3442
|
const r = J(t, e), n = ze(r, { r: 255, g: 255, b: 255, a: 1 }), i = ze(r, { r: 0, g: 0, b: 0, a: 1 });
|
|
3340
3443
|
return n > i;
|
|
3341
|
-
}, Sr = (t, e = null) => sn(t, e) ? "white" : "black",
|
|
3444
|
+
}, Sr = (t, e = null) => sn(t, e) ? "white" : "black", Ka = (t) => {
|
|
3342
3445
|
const e = t.a !== void 0 ? t.a : 1;
|
|
3343
3446
|
return `rgba(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)}, ${e})`;
|
|
3344
|
-
},
|
|
3447
|
+
}, Ja = (t, e) => ({ r: Math.min(255, t.r + (255 - t.r) * e), g: Math.min(255, t.g + (255 - t.g) * e), b: Math.min(255, t.b + (255 - t.b) * e), a: t.a ?? 1 }), Qa = (t, e) => ({ r: Math.max(0, t.r * (1 - e)), g: Math.max(0, t.g * (1 - e)), b: Math.max(0, t.b * (1 - e)), a: t.a ?? 1 }), Y = (t, e = null, r = 3) => {
|
|
3345
3448
|
const n = J(t), i = e ? J(e) : { r: 255, g: 255, b: 255, a: 1 };
|
|
3346
3449
|
let s = ze(n, i);
|
|
3347
3450
|
if (s >= r) return t;
|
|
3348
|
-
const
|
|
3349
|
-
let
|
|
3451
|
+
const o = Ct(i) < 0.5;
|
|
3452
|
+
let a = { ...n, a: n.a ?? 1 };
|
|
3350
3453
|
const c = 20, l = 0.1;
|
|
3351
|
-
for (let h = 0; h < c && (
|
|
3352
|
-
return
|
|
3353
|
-
},
|
|
3454
|
+
for (let h = 0; h < c && (o ? a = Ja(a, l) : a = Qa(a, l), s = ze(a, i), !(s >= r)); h++) ;
|
|
3455
|
+
return Ka(a);
|
|
3456
|
+
}, an = () => typeof navigator > "u" ? "" : navigator.userAgent || "", on = () => typeof navigator > "u" ? void 0 : navigator.userAgentData || void 0;
|
|
3354
3457
|
let ln = class {
|
|
3355
3458
|
constructor() {
|
|
3356
|
-
const e =
|
|
3459
|
+
const e = on(), r = an(), n = (s) => (typeof s == "string" || typeof s == "number") && s ? String(s).replace(/_/g, ".").split(".").map((o) => parseInt(o) || 0) : [], i = (s = "") => {
|
|
3357
3460
|
if (!s) return [];
|
|
3358
|
-
const
|
|
3359
|
-
return
|
|
3461
|
+
const o = new RegExp("^.*" + s + "[ :\\/]?(\\d+([\\._]\\d+)*).*$");
|
|
3462
|
+
return o.test(r) ? n(r.replace(o, "$1")) : [];
|
|
3360
3463
|
};
|
|
3361
|
-
this.OS = ((s) => (/(macOS|Mac OS X)/.test(r) ? (/\(iP(hone|od touch);/.test(r) && (s.iOS = i("CPU (?:iPhone )?OS ")), /\(iPad;/.test(r) ? s.iOS = s.iPadOS = i("CPU (?:iPhone )?OS ") : /(macOS|Mac OS X) \d/.test(r) && (document.ontouchend !== void 0 ? s.iOS = s.iPadOS = i() : s.macOS = i("(?:macOS|Mac OS X) "))) : /Windows( NT)? \d/.test(r) ? s.Windows = ((
|
|
3362
|
-
const
|
|
3363
|
-
if (!(!
|
|
3364
|
-
if (/^i(OS|P(hone|od touch))$/.test(
|
|
3365
|
-
else if (/^iPad(OS)?$/.test(
|
|
3366
|
-
else if (/^(macOS|(Mac )?OS X|Mac(Intel)?)$/.test(
|
|
3367
|
-
else if (/^(Microsoft )?Windows$/.test(
|
|
3368
|
-
else if (/^(Google )?Android$/.test(
|
|
3369
|
-
else if (/^((Google )?Chrome OS|CrOS)$/.test(
|
|
3370
|
-
else if (/^(Linux|Ubuntu|X11)$/.test(
|
|
3464
|
+
this.OS = ((s) => (/(macOS|Mac OS X)/.test(r) ? (/\(iP(hone|od touch);/.test(r) && (s.iOS = i("CPU (?:iPhone )?OS ")), /\(iPad;/.test(r) ? s.iOS = s.iPadOS = i("CPU (?:iPhone )?OS ") : /(macOS|Mac OS X) \d/.test(r) && (document.ontouchend !== void 0 ? s.iOS = s.iPadOS = i() : s.macOS = i("(?:macOS|Mac OS X) "))) : /Windows( NT)? \d/.test(r) ? s.Windows = ((o) => o[0] !== 6 || !o[1] ? o : o[1] === 1 ? [7] : o[1] === 2 ? [8] : [8, 1])(i("Windows(?: NT)?")) : /Android \d/.test(r) ? s.Android = i("Android") : /CrOS/.test(r) ? s.ChromeOS = i() : /X11;/.test(r) && (s.Linux = i()), s))({}), e && e.getHighEntropyValues(["architecture", "model", "platform", "platformVersion", "uaFullVersion"]).then((s) => ((o) => {
|
|
3465
|
+
const a = s.platform, c = s.platformVersion;
|
|
3466
|
+
if (!(!a || !c)) {
|
|
3467
|
+
if (/^i(OS|P(hone|od touch))$/.test(a)) o.iOS = n(c);
|
|
3468
|
+
else if (/^iPad(OS)?$/.test(a)) o.iOS = o.iPadOS = n(c);
|
|
3469
|
+
else if (/^(macOS|(Mac )?OS X|Mac(Intel)?)$/.test(a)) document.ontouchend !== void 0 ? o.iOS = o.iPadOS = n() : o.macOS = n(c);
|
|
3470
|
+
else if (/^(Microsoft )?Windows$/.test(a)) o.Windows = n(c);
|
|
3471
|
+
else if (/^(Google )?Android$/.test(a)) o.Android = n(c);
|
|
3472
|
+
else if (/^((Google )?Chrome OS|CrOS)$/.test(a)) o.ChromeOS = n(c);
|
|
3473
|
+
else if (/^(Linux|Ubuntu|X11)$/.test(a)) o.Linux = n(c);
|
|
3371
3474
|
else return;
|
|
3372
|
-
Object.keys(this.OS).forEach((l) => delete this.OS[l]), Object.assign(this.OS,
|
|
3475
|
+
Object.keys(this.OS).forEach((l) => delete this.OS[l]), Object.assign(this.OS, o);
|
|
3373
3476
|
}
|
|
3374
3477
|
})({})), this.UA = ((s) => {
|
|
3375
|
-
let
|
|
3478
|
+
let o = !1;
|
|
3376
3479
|
if (e && Array.isArray(e.brands)) {
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3480
|
+
const a = e.brands.reduce((c, l) => (c[l.brand] = [l.version * 1], c), {});
|
|
3481
|
+
a["Google Chrome"] ? (o = !0, s.Blink = s.Chromium = a.Chromium || [], s.Chrome = a["Google Chrome"]) : a["Microsoft Edge"] ? (o = !0, s.Blink = s.Chromium = a.Chromium || [], s.Edge = a["Microsoft Edge"]) : a.Opera && (o = !0, s.Blink = s.Chromium = a.Chromium || [], s.Opera = a.Opera);
|
|
3379
3482
|
}
|
|
3380
|
-
return
|
|
3381
|
-
})({}), this.Env = { get: () => [this.OS, this.UA].reduce((s,
|
|
3382
|
-
for (const
|
|
3483
|
+
return o || (/ Gecko\/\d/.test(r) ? (s.Gecko = i("rv"), / Waterfox\/\d/.test(r) ? s.Waterfox = i("Waterfox") : / Firefox\/\d/.test(r) && (s.Firefox = i("Firefox"))) : / Edge\/\d/.test(r) ? (s.EdgeHTML = i("Edge"), s.Edge = s.EdgeHTML) : / Chrom(ium|e)\/\d/.test(r) ? (s.Blink = s.Chromium = ((a) => a[0] ? a : i("Chrome"))(i("Chromium")), / EdgA?\/\d/.test(r) ? s.Edge = ((a) => a[0] ? a : i("Edg"))(i("EdgA")) : / OPR\/\d/.test(r) ? s.Opera = i("OPR") : / Vivaldi\/\d/.test(r) ? s.Vivaldi = i("Vivaldi") : / Silk\/\d/.test(r) ? s.Silk = i("Silk") : / UCBrowser\/\d/.test(r) ? s.UCBrowser = i("UCBrowser") : / Phoebe\/\d/.test(r) ? s.Phoebe = i("Phoebe") : s.Chrome = ((a) => a[0] ? a : s.Chromium)(i("Chrome"))) : / AppleWebKit\/\d/.test(r) ? (s.WebKit = i("AppleWebKit"), / CriOS \d/.test(r) ? s.Chrome = i("CriOS") : / FxiOS \d/.test(r) ? s.Firefox = i("FxiOS") : / EdgiOS\/\d/.test(r) ? s.Edge = i("EdgiOS") : / Version\/\d/.test(r) && (s.Safari = i("Version"))) : / Trident\/\d/.test(r) && (s.Trident = i("Trident"), s.InternetExplorer = ((a) => a[0] ? a : i("MSIE"))(i("rv")))), /[\[; ]FB(AN|_IAB)\//.test(r) && (s.Facebook = i("FBAV")), / Line\/\d/.test(r) && (s.LINE = i("Line")), s;
|
|
3484
|
+
})({}), this.Env = { get: () => [this.OS, this.UA].reduce((s, o) => {
|
|
3485
|
+
for (const a in o) o[a] && s.push(a);
|
|
3383
3486
|
return s;
|
|
3384
3487
|
}, []) };
|
|
3385
3488
|
}
|
|
3386
3489
|
};
|
|
3387
|
-
class
|
|
3490
|
+
class Xa extends ln {
|
|
3388
3491
|
get iOSRequest() {
|
|
3389
|
-
const e =
|
|
3492
|
+
const e = on(), r = an();
|
|
3390
3493
|
if (this.OS.iOS && !this.OS.iPadOS) return "mobile";
|
|
3391
3494
|
if (this.OS.iPadOS) return /\(iPad;/.test(r) || e && /^iPad(OS)?$/.test(e.platform) ? "mobile" : "desktop";
|
|
3392
3495
|
}
|
|
3393
3496
|
}
|
|
3394
|
-
const
|
|
3395
|
-
new
|
|
3396
|
-
const kr = ["div", "span", "p", "br", "hr", "b", "i", "em", "strong", "s", "u", "mark", "small", "sub", "sup", "abbr", "cite", "code", "data", "dfn", "kbd", "q", "samp", "time", "var", "blockquote", "pre", "svg", "g", "path", "circle", "ellipse", "rect", "line", "polygon", "polyline", "text", "tspan", "defs", "use"],
|
|
3397
|
-
function
|
|
3497
|
+
const Za = new ln();
|
|
3498
|
+
new Xa();
|
|
3499
|
+
const kr = ["div", "span", "p", "br", "hr", "b", "i", "em", "strong", "s", "u", "mark", "small", "sub", "sup", "abbr", "cite", "code", "data", "dfn", "kbd", "q", "samp", "time", "var", "blockquote", "pre", "svg", "g", "path", "circle", "ellipse", "rect", "line", "polygon", "polyline", "text", "tspan", "defs", "use"], Ya = /^on/i, eo = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "xlink:href"]), to = /^\s*(javascript|data):/i;
|
|
3500
|
+
function ro(t, e) {
|
|
3398
3501
|
const r = t.document.createElement("div");
|
|
3399
3502
|
if ("Sanitizer" in t && typeof r.setHTML == "function") try {
|
|
3400
3503
|
const i = new t.Sanitizer({ allowElements: kr });
|
|
@@ -3402,36 +3505,36 @@ function na(t, e) {
|
|
|
3402
3505
|
} catch {
|
|
3403
3506
|
}
|
|
3404
3507
|
const n = t.document.implementation.createHTMLDocument("");
|
|
3405
|
-
for (n.body.innerHTML = e,
|
|
3508
|
+
for (n.body.innerHTML = e, no(n.body, new Set(kr)); n.body.firstChild; ) r.appendChild(t.document.adoptNode(n.body.firstChild));
|
|
3406
3509
|
return r.firstElementChild;
|
|
3407
3510
|
}
|
|
3408
|
-
function
|
|
3511
|
+
function no(t, e) {
|
|
3409
3512
|
const r = Array.from(t.querySelectorAll("*")).reverse();
|
|
3410
3513
|
for (const n of r) {
|
|
3411
3514
|
if (!e.has(n.localName)) {
|
|
3412
3515
|
n.replaceWith(...Array.from(n.childNodes));
|
|
3413
3516
|
continue;
|
|
3414
3517
|
}
|
|
3415
|
-
for (const { name: i, value: s } of Array.from(n.attributes)) (
|
|
3518
|
+
for (const { name: i, value: s } of Array.from(n.attributes)) (Ya.test(i) || eo.has(i) && to.test(s)) && n.removeAttribute(i);
|
|
3416
3519
|
}
|
|
3417
3520
|
}
|
|
3418
3521
|
function lt(t) {
|
|
3419
3522
|
switch (t) {
|
|
3420
|
-
case
|
|
3523
|
+
case C.Mask:
|
|
3421
3524
|
return "rgba(255, 255, 255, 0.5)";
|
|
3422
|
-
case
|
|
3423
|
-
case
|
|
3525
|
+
case C.Highlight:
|
|
3526
|
+
case C.HighlightUnderline:
|
|
3424
3527
|
return "#FFFF00";
|
|
3425
3528
|
default:
|
|
3426
3529
|
return "#FF0000";
|
|
3427
3530
|
}
|
|
3428
3531
|
}
|
|
3429
|
-
const
|
|
3430
|
-
var
|
|
3431
|
-
const
|
|
3432
|
-
class
|
|
3532
|
+
const C = { Highlight: "highlight", HighlightUnderline: "highlightUnderline", Underline: "underline", Strikethrough: "strikethrough", Outline: "outline", TextColor: "textColor", Mask: "mask", Template: "template" };
|
|
3533
|
+
var io = ((t) => (t.Wrap = "wrap", t.Viewport = "viewport", t.Bounds = "bounds", t.Page = "page", t))(io || {}), so = ((t) => (t.Boxes = "boxes", t.Bounds = "bounds", t))(so || {});
|
|
3534
|
+
const ao = () => "Highlight" in window, Or = ["IMG", "IMAGE", "AUDIO", "VIDEO", "SVG"];
|
|
3535
|
+
class oo {
|
|
3433
3536
|
constructor(e, r, n, i) {
|
|
3434
|
-
this.wnd = e, this.comms = r, this.id = n, this.name = i, this.items = [], this.lastItemId = 0, this.container = void 0, this._activatable = !1, this._hoverable = !1, this.hoveredItem = void 0, this.experimentalHighlights = !1, this._tintSubKeys = /* @__PURE__ */ new Map(), this._subKeyCounter = 0, this.maskSvg = void 0, this.shadowHost = void 0, this.shadowRoot = void 0, this.currentRender = 0,
|
|
3537
|
+
this.wnd = e, this.comms = r, this.id = n, this.name = i, this.items = [], this.lastItemId = 0, this.container = void 0, this._activatable = !1, this._hoverable = !1, this.hoveredItem = void 0, this.experimentalHighlights = !1, this._tintSubKeys = /* @__PURE__ */ new Map(), this._subKeyCounter = 0, this.maskSvg = void 0, this.shadowHost = void 0, this.shadowRoot = void 0, this.currentRender = 0, ao() && (this.experimentalHighlights = !0, this.notTextFlag = /* @__PURE__ */ new Map()), this.activationHandler = this.handleActivation.bind(this), this.wnd.document.addEventListener("pointerup", this.activationHandler), this.hoverHandler = this.handleHover.bind(this), this.wnd.document.addEventListener("pointermove", this.hoverHandler);
|
|
3435
3538
|
}
|
|
3436
3539
|
get activatable() {
|
|
3437
3540
|
return this._activatable;
|
|
@@ -3449,25 +3552,25 @@ class la {
|
|
|
3449
3552
|
}
|
|
3450
3553
|
}
|
|
3451
3554
|
add(e) {
|
|
3452
|
-
const r = `${this.id}-${this.lastItemId++}`, n =
|
|
3555
|
+
const r = `${this.id}-${this.lastItemId++}`, n = za(this.wnd.document, e.locator);
|
|
3453
3556
|
if (!n) {
|
|
3454
3557
|
this.comms.log("Can't locate DOM range for decoration", e);
|
|
3455
3558
|
return;
|
|
3456
3559
|
}
|
|
3457
3560
|
const i = n.commonAncestorContainer;
|
|
3458
3561
|
if (i.nodeType !== Node.TEXT_NODE && this.experimentalHighlights && (Or.includes(i.nodeName.toUpperCase()) && this.notTextFlag?.set(r, !0), n.cloneContents().querySelector(Or.join(", ").toLowerCase()) && this.notTextFlag?.set(r, !0), (i.textContent?.trim() || "").length === 0 && this.notTextFlag?.set(r, !0)), this.experimentalHighlights && !this.notTextFlag?.has(r)) {
|
|
3459
|
-
const
|
|
3460
|
-
for (;
|
|
3461
|
-
if (
|
|
3462
|
-
|
|
3562
|
+
const o = (a) => {
|
|
3563
|
+
for (; a && a.nodeType === Node.ELEMENT_NODE; ) {
|
|
3564
|
+
if (a.namespaceURI?.includes("svg")) return !0;
|
|
3565
|
+
a = a.parentNode;
|
|
3463
3566
|
}
|
|
3464
3567
|
return !1;
|
|
3465
3568
|
};
|
|
3466
|
-
(
|
|
3569
|
+
(o(n.startContainer) || o(n.endContainer)) && this.notTextFlag?.set(r, !0);
|
|
3467
3570
|
}
|
|
3468
3571
|
if (this.experimentalHighlights) {
|
|
3469
|
-
const { type:
|
|
3470
|
-
|
|
3572
|
+
const { type: o } = e.style, { layout: a, width: c, expand: l } = e.style;
|
|
3573
|
+
o !== C.TextColor && (o === C.Outline || o === C.Template || o === C.Mask || a !== void 0 && a !== "boxes" || c !== void 0 && c !== "wrap" || l) && this.notTextFlag?.set(r, !0);
|
|
3471
3574
|
}
|
|
3472
3575
|
const s = { decoration: e, id: r, range: n, hitRects: [], clickableElements: void 0, container: void 0 };
|
|
3473
3576
|
this.items.push(s), this.layout(s), s.hitRects = this.clientRectsToDocCoords(Ie(s.range, !1, !1, (s.decoration.style.expand ?? 0) + this.hitGap())), this.renderLayout([s]);
|
|
@@ -3475,12 +3578,12 @@ class la {
|
|
|
3475
3578
|
remove(e) {
|
|
3476
3579
|
const r = this.items.findIndex((s) => s.decoration.id === e);
|
|
3477
3580
|
if (r < 0) return;
|
|
3478
|
-
const n = this.items[r], i = n.decoration.style?.type ===
|
|
3581
|
+
const n = this.items[r], i = n.decoration.style?.type === C.Mask;
|
|
3479
3582
|
if (this.items.splice(r, 1), n.clickableElements = void 0, n.container && (n.container.remove(), n.container = void 0), this.experimentalHighlights && !this.notTextFlag?.has(n.id) && n.highlightSubKey) {
|
|
3480
3583
|
const s = this.wnd.CSS.highlights;
|
|
3481
|
-
s.get(n.highlightSubKey)?.delete(n.range), this.items.some((
|
|
3482
|
-
const
|
|
3483
|
-
|
|
3584
|
+
s.get(n.highlightSubKey)?.delete(n.range), this.items.some((a) => a.highlightSubKey === n.highlightSubKey) || s.delete(n.highlightSubKey);
|
|
3585
|
+
const o = this.wnd.document.getElementById(`${this.id}-style`);
|
|
3586
|
+
o && this._rebuildHighlightStylesheet(o);
|
|
3484
3587
|
}
|
|
3485
3588
|
this.notTextFlag?.delete(n.id), this.hoveredItem === n && (this.hoveredItem = void 0), i && this.updateSharedMask();
|
|
3486
3589
|
}
|
|
@@ -3502,7 +3605,7 @@ class la {
|
|
|
3502
3605
|
return { docX: e.clientX + r.xDocOffset, docY: e.clientY + r.yDocOffset };
|
|
3503
3606
|
}
|
|
3504
3607
|
effectiveZoom() {
|
|
3505
|
-
if (!
|
|
3608
|
+
if (!Za.UA.Blink) return 1;
|
|
3506
3609
|
const e = parseFloat(this.wnd.getComputedStyle(this.wnd.document.documentElement).zoom), r = parseFloat(this.wnd.getComputedStyle(this.wnd.document.body).zoom);
|
|
3507
3610
|
return (e || 1) * (r || 1);
|
|
3508
3611
|
}
|
|
@@ -3513,20 +3616,20 @@ class la {
|
|
|
3513
3616
|
if (!this._activatable) return;
|
|
3514
3617
|
const { docX: r, docY: n } = this.pointerToDocCoords(e), i = this.wnd.devicePixelRatio;
|
|
3515
3618
|
for (const s of this.items) {
|
|
3516
|
-
let
|
|
3517
|
-
if (s.decoration.style.type ===
|
|
3518
|
-
const c =
|
|
3519
|
-
if (
|
|
3520
|
-
|
|
3619
|
+
let o;
|
|
3620
|
+
if (s.decoration.style.type === C.Template) for (const a of s.clickableElements ?? []) {
|
|
3621
|
+
const c = a.getBoundingClientRect();
|
|
3622
|
+
if (W(c, e.clientX, e.clientY, 0)) {
|
|
3623
|
+
o = c;
|
|
3521
3624
|
break;
|
|
3522
3625
|
}
|
|
3523
3626
|
}
|
|
3524
|
-
else for (const
|
|
3525
|
-
|
|
3627
|
+
else for (const a of s.hitRects) if (W(a, r, n, 0)) {
|
|
3628
|
+
o = s.range.getBoundingClientRect();
|
|
3526
3629
|
break;
|
|
3527
3630
|
}
|
|
3528
|
-
if (
|
|
3529
|
-
this.comms.send("decoration_activated", { decorationId: s.decoration.id, group: this.name, rect: { top:
|
|
3631
|
+
if (o) {
|
|
3632
|
+
this.comms.send("decoration_activated", { decorationId: s.decoration.id, group: this.name, rect: { top: o.top * i, left: o.left * i, width: o.width * i, height: o.height * i }, point: { x: e.clientX * i, y: e.clientY * i } });
|
|
3530
3633
|
return;
|
|
3531
3634
|
}
|
|
3532
3635
|
}
|
|
@@ -3534,27 +3637,27 @@ class la {
|
|
|
3534
3637
|
handleHover(e) {
|
|
3535
3638
|
if (!this._hoverable) return;
|
|
3536
3639
|
const { docX: r, docY: n } = this.pointerToDocCoords(e), i = this.wnd.devicePixelRatio;
|
|
3537
|
-
let s,
|
|
3538
|
-
for (const
|
|
3539
|
-
if (
|
|
3640
|
+
let s, o;
|
|
3641
|
+
for (const a of this.items) {
|
|
3642
|
+
if (a.decoration.style.type === C.Template) for (const c of a.clickableElements ?? []) {
|
|
3540
3643
|
const l = c.getBoundingClientRect();
|
|
3541
|
-
if (
|
|
3542
|
-
s =
|
|
3644
|
+
if (W(l, e.clientX, e.clientY, 0)) {
|
|
3645
|
+
s = a, o = l;
|
|
3543
3646
|
break;
|
|
3544
3647
|
}
|
|
3545
3648
|
}
|
|
3546
|
-
else for (const c of
|
|
3547
|
-
s =
|
|
3649
|
+
else for (const c of a.hitRects) if (W(c, r, n, 0)) {
|
|
3650
|
+
s = a, o = a.range.getBoundingClientRect();
|
|
3548
3651
|
break;
|
|
3549
3652
|
}
|
|
3550
3653
|
if (s) break;
|
|
3551
3654
|
}
|
|
3552
3655
|
if (s !== this.hoveredItem) {
|
|
3553
3656
|
if (this.hoveredItem) {
|
|
3554
|
-
const
|
|
3555
|
-
this.comms.send("decoration_pointer_leave", { decorationId: this.hoveredItem.decoration.id, group: this.name, rect:
|
|
3657
|
+
const a = this.hoveredItem.range.commonAncestorContainer.isConnected ? this.hoveredItem.range.getBoundingClientRect() : null;
|
|
3658
|
+
this.comms.send("decoration_pointer_leave", { decorationId: this.hoveredItem.decoration.id, group: this.name, rect: a ? { top: a.top * i, left: a.left * i, width: a.width * i, height: a.height * i } : void 0, point: { x: e.clientX * i, y: e.clientY * i } });
|
|
3556
3659
|
}
|
|
3557
|
-
this.hoveredItem = s, s &&
|
|
3660
|
+
this.hoveredItem = s, s && o && this.comms.send("decoration_pointer_enter", { decorationId: s.decoration.id, group: this.name, rect: { top: o.top * i, left: o.left * i, width: o.width * i, height: o.height * i }, point: { x: e.clientX * i, y: e.clientY * i } });
|
|
3558
3661
|
}
|
|
3559
3662
|
}
|
|
3560
3663
|
requestLayout() {
|
|
@@ -3567,18 +3670,18 @@ class la {
|
|
|
3567
3670
|
});
|
|
3568
3671
|
}
|
|
3569
3672
|
experimentalLayout(e) {
|
|
3570
|
-
const r = this.requireContainer(!0), n = this.wnd.CSS.highlights, i = e.decoration.style, s = i.type ??
|
|
3673
|
+
const r = this.requireContainer(!0), n = this.wnd.CSS.highlights, i = e.decoration.style, s = i.type ?? C.Highlight, o = i.tint ?? lt(s), a = i.width, c = i.layout, l = this._getSubKey(s, o);
|
|
3571
3674
|
e.highlightSubKey && (n.get(e.highlightSubKey)?.delete(e.range), e.highlightSubKey !== l && !this.items.some((p) => p !== e && p.highlightSubKey === e.highlightSubKey) && n.delete(e.highlightSubKey)), e.highlightSubKey = l;
|
|
3572
3675
|
let h;
|
|
3573
3676
|
n.has(l) ? h = n.get(l) : (h = new this.wnd.Highlight(), n.set(l, h));
|
|
3574
3677
|
const d = (p, m) => this.wnd.document.caretPositionFromPoint?.(p, m) ?? null;
|
|
3575
|
-
if (s ===
|
|
3678
|
+
if (s === C.TextColor && (c === "bounds" || a === "bounds" || a === "page")) {
|
|
3576
3679
|
const p = me(this.wnd);
|
|
3577
3680
|
if (p.isVertical) console.warn("Vertical writing detected: caretPositionFromPoint has known bugs, falling back to original range"), h.add(e.range);
|
|
3578
3681
|
else {
|
|
3579
3682
|
const m = e.range.getBoundingClientRect();
|
|
3580
3683
|
let w, E;
|
|
3581
|
-
|
|
3684
|
+
a === "page" ? (w = Math.floor(p.inlineStart(m) / p.pageInlineSize) * p.pageInlineSize, E = p.pageInlineSize) : (w = p.inlineStart(m), E = p.inlineSize(m));
|
|
3582
3685
|
const x = d(w, p.blockStart(m) + 1), N = d(w + E, p.blockStart(m) + p.blockSize(m) - 1);
|
|
3583
3686
|
if (x && N) {
|
|
3584
3687
|
const I = this.wnd.document.createRange();
|
|
@@ -3586,35 +3689,35 @@ class la {
|
|
|
3586
3689
|
} else h.add(e.range);
|
|
3587
3690
|
}
|
|
3588
3691
|
} else h.add(e.range);
|
|
3589
|
-
const g = this.getBackgroundColor(), f = i.enforceContrast !== !1 ? Y(
|
|
3692
|
+
const g = this.getBackgroundColor(), f = i.enforceContrast !== !1 ? Y(o, g) : o;
|
|
3590
3693
|
let y;
|
|
3591
3694
|
switch (s) {
|
|
3592
|
-
case
|
|
3695
|
+
case C.Underline:
|
|
3593
3696
|
y = `::highlight(${l}) {
|
|
3594
3697
|
text-decoration: underline;
|
|
3595
3698
|
text-decoration-color: ${f};
|
|
3596
3699
|
text-decoration-thickness: 0.1em;
|
|
3597
3700
|
}`;
|
|
3598
3701
|
break;
|
|
3599
|
-
case
|
|
3702
|
+
case C.Strikethrough:
|
|
3600
3703
|
y = `::highlight(${l}) {
|
|
3601
3704
|
text-decoration: line-through;
|
|
3602
3705
|
text-decoration-color: ${f};
|
|
3603
3706
|
text-decoration-thickness: 0.1em;
|
|
3604
3707
|
}`;
|
|
3605
3708
|
break;
|
|
3606
|
-
case
|
|
3709
|
+
case C.Outline:
|
|
3607
3710
|
y = `::highlight(${l}) {
|
|
3608
3711
|
outline: 2px solid ${f};
|
|
3609
3712
|
outline-offset: 1px;
|
|
3610
3713
|
}`;
|
|
3611
3714
|
break;
|
|
3612
|
-
case
|
|
3715
|
+
case C.TextColor:
|
|
3613
3716
|
y = `::highlight(${l}) {
|
|
3614
3717
|
color: ${f};
|
|
3615
3718
|
}`;
|
|
3616
3719
|
break;
|
|
3617
|
-
case
|
|
3720
|
+
case C.HighlightUnderline: {
|
|
3618
3721
|
const { r: p, g: m, b: w } = J(f), E = `rgba(${p}, ${m}, ${w}, 0.3)`;
|
|
3619
3722
|
y = `::highlight(${l}) {
|
|
3620
3723
|
color: ${Sr(f, g)};
|
|
@@ -3625,7 +3728,7 @@ class la {
|
|
|
3625
3728
|
}`;
|
|
3626
3729
|
break;
|
|
3627
3730
|
}
|
|
3628
|
-
case
|
|
3731
|
+
case C.Highlight:
|
|
3629
3732
|
default:
|
|
3630
3733
|
y = `::highlight(${l}) {
|
|
3631
3734
|
color: ${Sr(f, g)};
|
|
@@ -3649,7 +3752,7 @@ class la {
|
|
|
3649
3752
|
if (this.experimentalHighlights && !this.notTextFlag?.has(e.id)) return this.experimentalLayout(e);
|
|
3650
3753
|
const r = this.wnd.document.createElement("div");
|
|
3651
3754
|
r.setAttribute("id", e.id), r.dataset.highlightId = e.decoration.id, r.style.setProperty("pointer-events", "none");
|
|
3652
|
-
const n = me(this.wnd), i = 1 / this.effectiveZoom(), s = e.decoration.style.expand ?? 0,
|
|
3755
|
+
const n = me(this.wnd), i = 1 / this.effectiveZoom(), s = e.decoration.style.expand ?? 0, o = (d, g, f, y = 0) => {
|
|
3653
3756
|
const p = e.decoration?.style?.width, m = g;
|
|
3654
3757
|
switch (p) {
|
|
3655
3758
|
case "viewport": {
|
|
@@ -3669,47 +3772,47 @@ class la {
|
|
|
3669
3772
|
default:
|
|
3670
3773
|
n.applyPosition(d, n.inlineStart(m) + n.inlineScrollOffset, n.blockStart(m) + n.blockScrollOffset, n.inlineSize(m), n.blockSize(m), i);
|
|
3671
3774
|
}
|
|
3672
|
-
},
|
|
3673
|
-
if (c.type !==
|
|
3775
|
+
}, a = e.range.getBoundingClientRect(), c = e.decoration.style, l = (() => {
|
|
3776
|
+
if (c.type !== C.Outline) return 0;
|
|
3674
3777
|
const d = c.width;
|
|
3675
3778
|
return d === "page" || d === "viewport" ? 3 : 0;
|
|
3676
3779
|
})();
|
|
3677
3780
|
let h;
|
|
3678
|
-
if (c.type ===
|
|
3781
|
+
if (c.type === C.Template) {
|
|
3679
3782
|
c.stylesheet && this.injectCustomStylesheet(c.stylesheet);
|
|
3680
|
-
const d =
|
|
3783
|
+
const d = ro(this.wnd, c.element);
|
|
3681
3784
|
if (!d) {
|
|
3682
3785
|
e.container = r, e.clickableElements = [];
|
|
3683
3786
|
return;
|
|
3684
3787
|
}
|
|
3685
3788
|
d.style.setProperty("pointer-events", "none"), h = d;
|
|
3686
3789
|
} else {
|
|
3687
|
-
const d = c, g = d.type ??
|
|
3688
|
-
if (g ===
|
|
3790
|
+
const d = c, g = d.type ?? C.Highlight, f = d.tint ?? lt(g);
|
|
3791
|
+
if (g === C.TextColor) {
|
|
3689
3792
|
e.container = r, e.clickableElements = [];
|
|
3690
3793
|
return;
|
|
3691
3794
|
}
|
|
3692
|
-
if (g ===
|
|
3795
|
+
if (g === C.Mask) {
|
|
3693
3796
|
e.container = r, e.clickableElements = [], this.updateSharedMask();
|
|
3694
3797
|
return;
|
|
3695
3798
|
}
|
|
3696
3799
|
const y = this.getCurrentDarkMode(), p = this.getBackgroundColor(), m = d.enforceContrast !== !1, w = (() => {
|
|
3697
3800
|
switch (g) {
|
|
3698
|
-
case
|
|
3801
|
+
case C.Underline: {
|
|
3699
3802
|
const x = m ? Y(f, p) : f, N = d.layout === "bounds", [I, q] = n.isVertical ? ["border-right", "border-left"] : ["border-bottom", "border-top"];
|
|
3700
3803
|
return [N ? `${q}: 0.1em solid ${x} !important` : null, `${I}: 0.1em solid ${x} !important`, "background-color: transparent !important", "box-sizing: border-box !important"].filter(Boolean).join("; ");
|
|
3701
3804
|
}
|
|
3702
|
-
case
|
|
3805
|
+
case C.Strikethrough: {
|
|
3703
3806
|
const x = m ? Y(f, p) : f;
|
|
3704
3807
|
return d.layout === "bounds" ? [`background: repeating-linear-gradient(-45deg, transparent, transparent 19px, ${x} 19px, ${x} 20px) !important`, "background-color: transparent !important", "box-sizing: border-box !important"].join("; ") : [`background-color: ${x} !important`, "box-sizing: border-box !important"].join("; ");
|
|
3705
3808
|
}
|
|
3706
|
-
case
|
|
3809
|
+
case C.Outline:
|
|
3707
3810
|
return [`outline: 2px solid ${m ? Y(f, p) : f} !important`, "outline-offset: 1px !important", "background-color: transparent !important", "box-sizing: border-box !important"].join("; ");
|
|
3708
|
-
case
|
|
3709
|
-
const x = m ? Y(f, p) : f, { r: N, g: I, b: q } = J(x),
|
|
3710
|
-
return [`background-color: ${
|
|
3811
|
+
case C.HighlightUnderline: {
|
|
3812
|
+
const x = m ? Y(f, p) : f, { r: N, g: I, b: q } = J(x), B = `rgba(${N}, ${I}, ${q}, 0.3)`, ue = d.layout === "bounds", [he, b] = n.isVertical ? ["border-right", "border-left"] : ["border-bottom", "border-top"];
|
|
3813
|
+
return [`background-color: ${B} !important`, ue ? `${b}: 0.1em solid ${x} !important` : null, `${he}: 0.1em solid ${x} !important`, "box-sizing: border-box !important"].filter(Boolean).join("; ");
|
|
3711
3814
|
}
|
|
3712
|
-
case
|
|
3815
|
+
case C.Highlight:
|
|
3713
3816
|
default:
|
|
3714
3817
|
return [`background-color: ${m ? Y(f, p) : f} !important`, `mix-blend-mode: ${y ? "exclusion" : "multiply"} !important`, "opacity: 1 !important", "box-sizing: border-box !important"].join("; ");
|
|
3715
3818
|
}
|
|
@@ -3719,10 +3822,10 @@ class la {
|
|
|
3719
3822
|
if (e.decoration?.style?.layout === "bounds") {
|
|
3720
3823
|
const d = h.cloneNode(!0);
|
|
3721
3824
|
d.style.setProperty("pointer-events", "none");
|
|
3722
|
-
const g = s ? { left:
|
|
3723
|
-
|
|
3825
|
+
const g = s ? { left: a.left - s, right: a.right + s, top: a.top - s, bottom: a.bottom + s, width: a.width + s * 2, height: a.height + s * 2 } : a;
|
|
3826
|
+
o(d, g, a, l), r.append(d);
|
|
3724
3827
|
} else {
|
|
3725
|
-
const d = c.type, g = d ===
|
|
3828
|
+
const d = c.type, g = d === C.Underline || d === C.Strikethrough, f = d === C.Strikethrough, y = g ? Ha(e.range, ["rt", "rp"]) : e.range;
|
|
3726
3829
|
let p = Ie(y, !0, n.isVertical, g ? 0 : s);
|
|
3727
3830
|
p = p.sort((m, w) => n.isVertical ? (n.isVertLR ? 1 : -1) * (m.left - w.left) : m.top - w.top);
|
|
3728
3831
|
for (let m of p) {
|
|
@@ -3733,7 +3836,7 @@ class la {
|
|
|
3733
3836
|
const x = n.blockSize(m) * 0.1, N = n.blockStart(m) + n.blockSize(m) / 2 - x / 2;
|
|
3734
3837
|
E = n.isVertical ? { left: N, right: N + x, top: m.top, bottom: m.bottom, width: x, height: m.height } : { top: N, bottom: N + x, left: m.left, right: m.right, height: x, width: m.width };
|
|
3735
3838
|
}
|
|
3736
|
-
s && g && (E = n.isVertical ? { ...E, top: E.top - s, bottom: E.bottom + s, height: E.height + s * 2 } : { ...E, left: E.left - s, right: E.right + s, width: E.width + s * 2 }),
|
|
3839
|
+
s && g && (E = n.isVertical ? { ...E, top: E.top - s, bottom: E.bottom + s, height: E.height + s * 2 } : { ...E, left: E.left - s, right: E.right + s, width: E.width + s * 2 }), o(w, E, a, l), r.append(w);
|
|
3737
3840
|
}
|
|
3738
3841
|
}
|
|
3739
3842
|
e.container = r, e.clickableElements = Array.from(r.querySelectorAll("[data-activable='1']")), e.clickableElements.length || (e.clickableElements = Array.from(r.children));
|
|
@@ -3757,12 +3860,12 @@ class la {
|
|
|
3757
3860
|
return fr(this.wnd, "--USER__backgroundColor") || this.wnd.getComputedStyle(this.wnd.document.documentElement).getPropertyValue("background-color");
|
|
3758
3861
|
}
|
|
3759
3862
|
updateSharedMask() {
|
|
3760
|
-
const e = this.items.filter((g) => g.decoration.style?.type ===
|
|
3863
|
+
const e = this.items.filter((g) => g.decoration.style?.type === C.Mask);
|
|
3761
3864
|
if (e.length === 0) {
|
|
3762
3865
|
this.maskSvg && (this.maskSvg.remove(), this.maskSvg = void 0), this.shadowRoot && (this.shadowRoot.innerHTML = "");
|
|
3763
3866
|
return;
|
|
3764
3867
|
}
|
|
3765
|
-
const r = me(this.wnd), n = 1 / this.effectiveZoom(), i = this.wnd.document.documentElement, s = i.scrollWidth,
|
|
3868
|
+
const r = me(this.wnd), n = 1 / this.effectiveZoom(), i = this.wnd.document.documentElement, s = i.scrollWidth, o = i.scrollHeight, a = [];
|
|
3766
3869
|
for (const g of e) {
|
|
3767
3870
|
const f = g.decoration.style, y = f.layout ?? "boxes", p = f.width ?? "wrap", m = f.expand ?? 0, w = g.range.getBoundingClientRect(), E = y === "bounds" ? [m ? { left: w.left - m, top: w.top - m, right: w.right + m, bottom: w.bottom + m, width: w.width + m * 2, height: w.height + m * 2 } : w] : Ie(g.range, !1, !1, m);
|
|
3768
3871
|
for (const x of E) {
|
|
@@ -3785,15 +3888,15 @@ class la {
|
|
|
3785
3888
|
default:
|
|
3786
3889
|
N = r.toRect(r.inlineStart(x), r.blockStart(x), r.inlineSize(x), r.blockSize(x));
|
|
3787
3890
|
}
|
|
3788
|
-
|
|
3891
|
+
a.push(N);
|
|
3789
3892
|
}
|
|
3790
3893
|
}
|
|
3791
|
-
const c = [`M0 0 H${s} V${
|
|
3894
|
+
const c = [`M0 0 H${s} V${o} H0 Z`, ...a.map((g) => {
|
|
3792
3895
|
const f = (g.left + r.xDocOffset) * n, y = (g.top + r.yDocOffset) * n, p = (g.right + r.xDocOffset) * n, m = (g.bottom + r.yDocOffset) * n;
|
|
3793
3896
|
return `M${f} ${y} H${p} V${m} H${f} Z`;
|
|
3794
3897
|
})].join(" "), l = "http://www.w3.org/2000/svg";
|
|
3795
3898
|
if (!this.maskSvg) {
|
|
3796
|
-
this.shadowRoot || (this.shadowHost = this.wnd.document.createElement("div"), this.shadowHost.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none", this.wnd.document.body.appendChild(this.shadowHost), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" })), this.maskSvg = this.wnd.document.createElementNS(l, "svg"), this.maskSvg.style.cssText = `position:absolute;top:0;left:0;width:${s}px;height:${
|
|
3899
|
+
this.shadowRoot || (this.shadowHost = this.wnd.document.createElement("div"), this.shadowHost.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none", this.wnd.document.body.appendChild(this.shadowHost), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" })), this.maskSvg = this.wnd.document.createElementNS(l, "svg"), this.maskSvg.style.cssText = `position:absolute;top:0;left:0;width:${s}px;height:${o}px;pointer-events:none;z-index:9999`, this.maskSvg.dataset.readium = "true";
|
|
3797
3900
|
const g = this.wnd.document.createElementNS(l, "defs"), f = this.wnd.document.createElementNS(l, "clipPath"), y = `${this.id}-mask-clip`;
|
|
3798
3901
|
f.setAttribute("id", y), f.setAttribute("clipPathUnits", "userSpaceOnUse");
|
|
3799
3902
|
const p = this.wnd.document.createElementNS(l, "path");
|
|
@@ -3801,13 +3904,13 @@ class la {
|
|
|
3801
3904
|
const m = this.wnd.document.createElementNS(l, "rect");
|
|
3802
3905
|
m.setAttribute("id", `${this.id}-mask-rect`), m.setAttribute("clip-path", `url(#${y})`), m.style.pointerEvents = "none", this.maskSvg.appendChild(m), this.shadowRoot.appendChild(this.maskSvg);
|
|
3803
3906
|
}
|
|
3804
|
-
this.maskSvg.style.width = `${s}px`, this.maskSvg.style.height = `${
|
|
3907
|
+
this.maskSvg.style.width = `${s}px`, this.maskSvg.style.height = `${o}px`;
|
|
3805
3908
|
const h = this.maskSvg.querySelector("path");
|
|
3806
3909
|
h && h.setAttribute("d", c);
|
|
3807
3910
|
const d = this.maskSvg.querySelector("rect");
|
|
3808
3911
|
if (d) {
|
|
3809
|
-
const g = e[0].decoration.style.tint, f = g ?? this.getBackgroundColor() ?? lt(
|
|
3810
|
-
d.setAttribute("x", "0"), d.setAttribute("y", "0"), d.setAttribute("width", String(s)), d.setAttribute("height", String(
|
|
3912
|
+
const g = e[0].decoration.style.tint, f = g ?? this.getBackgroundColor() ?? lt(C.Mask), y = g ? "1" : "0.5";
|
|
3913
|
+
d.setAttribute("x", "0"), d.setAttribute("y", "0"), d.setAttribute("width", String(s)), d.setAttribute("height", String(o)), d.setAttribute("fill", f), d.setAttribute("fill-opacity", y);
|
|
3811
3914
|
}
|
|
3812
3915
|
}
|
|
3813
3916
|
injectCustomStylesheet(e) {
|
|
@@ -3824,7 +3927,7 @@ class la {
|
|
|
3824
3927
|
this.wnd.document.getElementById(`${this.id}-custom-style`)?.remove(), this.container && (this.container.remove(), this.container = void 0);
|
|
3825
3928
|
}
|
|
3826
3929
|
}
|
|
3827
|
-
const cn = class we extends
|
|
3930
|
+
const cn = class we extends Ca {
|
|
3828
3931
|
constructor() {
|
|
3829
3932
|
super(...arguments), this.resizeFrame = 0, this.lastGroupId = 0, this.groups = /* @__PURE__ */ new Map(), this.handleResizer = this.handleResize.bind(this);
|
|
3830
3933
|
}
|
|
@@ -3846,29 +3949,29 @@ const cn = class we extends Co {
|
|
|
3846
3949
|
mount(e, r) {
|
|
3847
3950
|
return this.wnd = e, r.register("decorate", we.moduleName, (n, i) => {
|
|
3848
3951
|
const s = n;
|
|
3849
|
-
(s.action === "add" || s.action === "update") && s.decoration.locator && (s.decoration.locator =
|
|
3850
|
-
const
|
|
3952
|
+
(s.action === "add" || s.action === "update") && s.decoration.locator && (s.decoration.locator = Ia.deserialize(s.decoration.locator)), this.groups.has(s.group) || this.groups.set(s.group, new oo(e, r, `readium-decoration-${this.lastGroupId++}`, s.group));
|
|
3953
|
+
const o = this.groups.get(s.group);
|
|
3851
3954
|
switch (s.action) {
|
|
3852
3955
|
case "add":
|
|
3853
|
-
|
|
3956
|
+
o?.add(s.decoration);
|
|
3854
3957
|
break;
|
|
3855
3958
|
case "remove":
|
|
3856
|
-
|
|
3959
|
+
o?.remove(s.decoration.id);
|
|
3857
3960
|
break;
|
|
3858
3961
|
case "clear":
|
|
3859
|
-
|
|
3962
|
+
o?.clear();
|
|
3860
3963
|
break;
|
|
3861
3964
|
case "update":
|
|
3862
|
-
|
|
3965
|
+
o?.update(s.decoration);
|
|
3863
3966
|
break;
|
|
3864
3967
|
}
|
|
3865
3968
|
i(!0);
|
|
3866
3969
|
}), r.register("decoration_activatable", we.moduleName, (n, i) => {
|
|
3867
|
-
const s = n,
|
|
3868
|
-
|
|
3970
|
+
const s = n, o = this.groups.get(s.group);
|
|
3971
|
+
o && (o.activatable = s.activatable), i(!0);
|
|
3869
3972
|
}), r.register("decoration_hoverable", we.moduleName, (n, i) => {
|
|
3870
|
-
const s = n,
|
|
3871
|
-
|
|
3973
|
+
const s = n, o = this.groups.get(s.group);
|
|
3974
|
+
o && (o.hoverable = s.hoverable), i(!0);
|
|
3872
3975
|
}), this.resizeObserver = new ResizeObserver(() => e.requestAnimationFrame(() => this.handleResize())), this.resizeObserver.observe(e.document.documentElement), e.addEventListener("orientationchange", this.handleResizer), e.addEventListener("resize", this.handleResizer), this.styleObserver = new MutationObserver((n) => {
|
|
3873
3976
|
n.some((i) => i.type === "attributes" && i.attributeName === "style" && i.oldValue !== i.target.getAttribute("style")) && this.updateHighlightStyles();
|
|
3874
3977
|
}), this.styleObserver.observe(e.document.documentElement, { attributes: !0, attributeFilter: ["style"], attributeOldValue: !0 }), r.log("Decorator Mounted"), !0;
|
|
@@ -3878,37 +3981,37 @@ const cn = class we extends Co {
|
|
|
3878
3981
|
}
|
|
3879
3982
|
};
|
|
3880
3983
|
cn.moduleName = "decorator";
|
|
3881
|
-
let
|
|
3882
|
-
const
|
|
3883
|
-
function
|
|
3884
|
-
return t ===
|
|
3984
|
+
let lo = cn;
|
|
3985
|
+
const co = new Set(Object.values(C));
|
|
3986
|
+
function uo(t, e) {
|
|
3987
|
+
return t === C.TextColor ? typeof window < "u" && "Highlight" in window : co.has(t) ? !0 : !!e?.[t];
|
|
3885
3988
|
}
|
|
3886
3989
|
function xr(t, e) {
|
|
3887
3990
|
const { style: r } = t;
|
|
3888
|
-
if (r.type ===
|
|
3991
|
+
if (r.type === C.Template) {
|
|
3889
3992
|
const n = r;
|
|
3890
3993
|
return { ...t, style: { ...n, element: Er(n, t) } };
|
|
3891
3994
|
}
|
|
3892
3995
|
if (r.type && e?.[r.type]) {
|
|
3893
3996
|
const n = e[r.type];
|
|
3894
|
-
return { ...t, style: { type:
|
|
3997
|
+
return { ...t, style: { type: C.Template, layout: n.layout, width: n.width, stylesheet: n.stylesheet, element: Er(n, t) } };
|
|
3895
3998
|
}
|
|
3896
3999
|
return t;
|
|
3897
4000
|
}
|
|
3898
4001
|
function Er(t, e) {
|
|
3899
4002
|
return typeof t.element == "function" ? t.element(e) : t.element;
|
|
3900
4003
|
}
|
|
3901
|
-
function
|
|
4004
|
+
function ho(t, e) {
|
|
3902
4005
|
if (t.type !== e.type) return !1;
|
|
3903
|
-
if (t.type ===
|
|
4006
|
+
if (t.type === C.Template) {
|
|
3904
4007
|
const i = t, s = e;
|
|
3905
4008
|
return i.layout === s.layout && i.width === s.width && i.stylesheet === s.stylesheet;
|
|
3906
4009
|
}
|
|
3907
4010
|
const r = t, n = e;
|
|
3908
4011
|
return r.tint === n.tint && r.layout === n.layout && r.width === n.width && (r.enforceContrast ?? !0) === (n.enforceContrast ?? !0) && (r.expand ?? 0) === (n.expand ?? 0);
|
|
3909
4012
|
}
|
|
3910
|
-
function
|
|
3911
|
-
return t.locator.href === e.locator.href && JSON.stringify(t.locator.locations?.serialize?.() ?? t.locator.locations) === JSON.stringify(e.locator.locations?.serialize?.() ?? e.locator.locations) && JSON.stringify(t.locator.text ?? null) === JSON.stringify(e.locator.text ?? null) &&
|
|
4013
|
+
function go(t, e) {
|
|
4014
|
+
return t.locator.href === e.locator.href && JSON.stringify(t.locator.locations?.serialize?.() ?? t.locator.locations) === JSON.stringify(e.locator.locations?.serialize?.() ?? e.locator.locations) && JSON.stringify(t.locator.text ?? null) === JSON.stringify(e.locator.text ?? null) && ho(t.style, e.style) && JSON.stringify(t.extras ?? null) === JSON.stringify(e.extras ?? null);
|
|
3912
4015
|
}
|
|
3913
4016
|
let un = class {
|
|
3914
4017
|
constructor() {
|
|
@@ -3926,19 +4029,19 @@ let un = class {
|
|
|
3926
4029
|
this.queue = [];
|
|
3927
4030
|
}
|
|
3928
4031
|
};
|
|
3929
|
-
class
|
|
4032
|
+
class fo {
|
|
3930
4033
|
constructor() {
|
|
3931
|
-
this.frame = new
|
|
4034
|
+
this.frame = new po(this), this.host = new mo(this);
|
|
3932
4035
|
}
|
|
3933
4036
|
}
|
|
3934
|
-
let
|
|
4037
|
+
let po = class {
|
|
3935
4038
|
constructor(e) {
|
|
3936
4039
|
this.channel = e, this.registrar = /* @__PURE__ */ new Map(), this.outbox = new un(), this.ready = !0;
|
|
3937
4040
|
}
|
|
3938
4041
|
register(e, r, n) {
|
|
3939
4042
|
(Array.isArray(e) ? e : [e]).forEach((i) => {
|
|
3940
4043
|
const s = this.registrar.get(i) ?? [];
|
|
3941
|
-
if (s.find((
|
|
4044
|
+
if (s.find((o) => o.module === r)) throw new Error(`Duplicate callback for "${i}" in module "${r}"`);
|
|
3942
4045
|
s.push({ module: r, cb: n }), this.registrar.set(i, s);
|
|
3943
4046
|
});
|
|
3944
4047
|
}
|
|
@@ -3971,7 +4074,7 @@ let pa = class {
|
|
|
3971
4074
|
this.registrar.clear(), this.outbox.clear();
|
|
3972
4075
|
}
|
|
3973
4076
|
};
|
|
3974
|
-
class
|
|
4077
|
+
class mo {
|
|
3975
4078
|
constructor(e) {
|
|
3976
4079
|
this.channel = e, this.listeners = /* @__PURE__ */ new Map(), this.outbox = new un(), this.ready = !0;
|
|
3977
4080
|
}
|
|
@@ -3991,34 +4094,34 @@ class ma {
|
|
|
3991
4094
|
this.listeners.get(e)?.forEach((n) => n(r));
|
|
3992
4095
|
}
|
|
3993
4096
|
}
|
|
3994
|
-
class
|
|
4097
|
+
class yo {
|
|
3995
4098
|
constructor(e, r = {}) {
|
|
3996
4099
|
this.host = e, this._decorations = /* @__PURE__ */ new Map(), this._activationState = /* @__PURE__ */ new Map(), this._hoverState = /* @__PURE__ */ new Map(), this._observers = /* @__PURE__ */ new Map(), this._hoveredDecorations = /* @__PURE__ */ new Map(), this._config = r, e.on("decoration_activated", (n) => {
|
|
3997
|
-
const i = n, s = this._decorations.get(i.group)?.find((
|
|
3998
|
-
s && this._observers.get(i.group)?.forEach((
|
|
4100
|
+
const i = n, s = this._decorations.get(i.group)?.find((o) => o.id === i.decorationId);
|
|
4101
|
+
s && this._observers.get(i.group)?.forEach((o) => o.onDecorationActivated?.({ group: i.group, decoration: s, rect: i.rect, point: i.point }));
|
|
3999
4102
|
}), e.on("decoration_pointer_enter", (n) => {
|
|
4000
|
-
const i = n, s = this._decorations.get(i.group)?.find((
|
|
4001
|
-
s && (this._hoveredDecorations.set(i.group, s), this._observers.get(i.group)?.forEach((
|
|
4103
|
+
const i = n, s = this._decorations.get(i.group)?.find((o) => o.id === i.decorationId);
|
|
4104
|
+
s && (this._hoveredDecorations.set(i.group, s), this._observers.get(i.group)?.forEach((o) => o.onDecorationPointerEnter?.({ group: i.group, decoration: s, rect: i.rect, point: i.point })));
|
|
4002
4105
|
}), e.on("decoration_pointer_leave", (n) => {
|
|
4003
|
-
const i = n, s = this._decorations.get(i.group)?.find((
|
|
4004
|
-
this._hoveredDecorations.delete(i.group), s && this._observers.get(i.group)?.forEach((
|
|
4106
|
+
const i = n, s = this._decorations.get(i.group)?.find((o) => o.id === i.decorationId) ?? this._hoveredDecorations.get(i.group);
|
|
4107
|
+
this._hoveredDecorations.delete(i.group), s && this._observers.get(i.group)?.forEach((o) => o.onDecorationPointerLeave?.({ group: i.group, decoration: s, rect: i.rect, point: i.point }));
|
|
4005
4108
|
});
|
|
4006
4109
|
}
|
|
4007
4110
|
supportsDecorationStyle(e) {
|
|
4008
|
-
return
|
|
4111
|
+
return uo(e, this._config.decorationTemplates);
|
|
4009
4112
|
}
|
|
4010
4113
|
applyDecorations(e, r) {
|
|
4011
4114
|
const n = this._decorations.get(r) ?? [], i = new Map(n.map((c) => [c.id, c])), s = new Map(e.map((c) => [c.id, c]));
|
|
4012
4115
|
for (const [c, l] of i) {
|
|
4013
4116
|
const h = s.get(c);
|
|
4014
|
-
h ?
|
|
4117
|
+
h ? go(l, h) || this.host.send("decorate", { group: r, action: "update", decoration: xr(h, this._config.decorationTemplates) }) : this.host.send("decorate", { group: r, action: "remove", decoration: { id: c } });
|
|
4015
4118
|
}
|
|
4016
4119
|
for (const [c, l] of s) i.has(c) || this.host.send("decorate", { group: r, action: "add", decoration: xr(l, this._config.decorationTemplates) });
|
|
4017
4120
|
this._decorations.set(r, e);
|
|
4018
|
-
const
|
|
4019
|
-
|
|
4020
|
-
const
|
|
4021
|
-
|
|
4121
|
+
const o = this._activationState.get(r);
|
|
4122
|
+
o !== void 0 && this.host.send("decoration_activatable", { group: r, activatable: o });
|
|
4123
|
+
const a = this._hoverState.get(r);
|
|
4124
|
+
a !== void 0 && this.host.send("decoration_hoverable", { group: r, hoverable: a });
|
|
4022
4125
|
}
|
|
4023
4126
|
registerDecorationObserver(e, r) {
|
|
4024
4127
|
this._observers.has(e) || this._observers.set(e, /* @__PURE__ */ new Set()), this._observers.get(e).add(r), r.onDecorationActivated && (this._activationState.set(e, !0), this.host.send("decoration_activatable", { group: e, activatable: !0 })), (r.onDecorationPointerEnter || r.onDecorationPointerLeave) && (this._hoverState.set(e, !0), this.host.send("decoration_hoverable", { group: e, hoverable: !0 }));
|
|
@@ -4027,9 +4130,9 @@ class ya {
|
|
|
4027
4130
|
this._observers.forEach((r, n) => {
|
|
4028
4131
|
if (!r.has(e)) return;
|
|
4029
4132
|
r.delete(e);
|
|
4030
|
-
const i = [...r].some((
|
|
4133
|
+
const i = [...r].some((o) => o.onDecorationActivated);
|
|
4031
4134
|
this._activationState.has(n) && !i && (this._activationState.delete(n), this.host.send("decoration_activatable", { group: n, activatable: !1 }));
|
|
4032
|
-
const s = [...r].some((
|
|
4135
|
+
const s = [...r].some((o) => o.onDecorationPointerEnter || o.onDecorationPointerLeave);
|
|
4033
4136
|
this._hoverState.has(n) && !s && (this._hoverState.delete(n), this.host.send("decoration_hoverable", { group: n, hoverable: !1 }));
|
|
4034
4137
|
});
|
|
4035
4138
|
}
|
|
@@ -4037,25 +4140,25 @@ class ya {
|
|
|
4037
4140
|
this._decorations.clear(), this._activationState.clear(), this._hoverState.clear(), this._observers.clear(), this._hoveredDecorations.clear();
|
|
4038
4141
|
}
|
|
4039
4142
|
}
|
|
4040
|
-
function
|
|
4143
|
+
function bo(t) {
|
|
4041
4144
|
return t && Array.isArray(t) ? t : void 0;
|
|
4042
4145
|
}
|
|
4043
|
-
function
|
|
4044
|
-
return t && typeof t == "string" ? [t] :
|
|
4146
|
+
function vo(t) {
|
|
4147
|
+
return t && typeof t == "string" ? [t] : bo(t);
|
|
4045
4148
|
}
|
|
4046
4149
|
function ct(t) {
|
|
4047
4150
|
return isNaN(t) ? void 0 : t;
|
|
4048
4151
|
}
|
|
4049
|
-
class
|
|
4152
|
+
class V {
|
|
4050
4153
|
constructor(e) {
|
|
4051
4154
|
this.fragments = e.fragments ? e.fragments : new Array(), this.progression = e.progression, this.totalProgression = e.totalProgression, this.position = e.position, this.otherLocations = e.otherLocations;
|
|
4052
4155
|
}
|
|
4053
4156
|
static deserialize(e) {
|
|
4054
4157
|
if (!e) return;
|
|
4055
|
-
const r = ct(e.progression), n = ct(e.totalProgression), i = ct(e.position), s = /* @__PURE__ */ new Map(),
|
|
4056
|
-
return Object.entries(e).forEach(([
|
|
4057
|
-
|
|
4058
|
-
}), e.otherLocations instanceof Map && e.otherLocations.forEach((
|
|
4158
|
+
const r = ct(e.progression), n = ct(e.totalProgression), i = ct(e.position), s = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(["fragment", "fragments", "progression", "totalProgression", "position", "otherLocations"]);
|
|
4159
|
+
return Object.entries(e).forEach(([a, c]) => {
|
|
4160
|
+
o.has(a) || s.set(a, c);
|
|
4161
|
+
}), e.otherLocations instanceof Map && e.otherLocations.forEach((a, c) => s.set(c, a)), new V({ fragments: vo(e.fragments || e.fragment), progression: r !== void 0 && r >= 0 && r <= 1 ? r : void 0, totalProgression: n !== void 0 && n >= 0 && n <= 1 ? n : void 0, position: i !== void 0 && i > 0 ? i : void 0, otherLocations: s.size === 0 ? void 0 : s });
|
|
4059
4162
|
}
|
|
4060
4163
|
serialize() {
|
|
4061
4164
|
const e = {};
|
|
@@ -4074,37 +4177,37 @@ class We {
|
|
|
4074
4177
|
return this.after !== void 0 && (e.after = this.after), this.before !== void 0 && (e.before = this.before), this.highlight !== void 0 && (e.highlight = this.highlight), e;
|
|
4075
4178
|
}
|
|
4076
4179
|
}
|
|
4077
|
-
class
|
|
4180
|
+
class He {
|
|
4078
4181
|
constructor(e) {
|
|
4079
4182
|
const r = e.href.indexOf("#"), n = r >= 0 ? e.href.slice(r + 1) : void 0;
|
|
4080
4183
|
this.href = r >= 0 ? e.href.slice(0, r) : e.href, this.type = e.type, this.title = e.title;
|
|
4081
4184
|
const i = e.locations?.fragments, s = n && (!i || i.length === 0);
|
|
4082
|
-
this.locations = e.locations ? s ? new
|
|
4185
|
+
this.locations = e.locations ? s ? new V({ ...e.locations, fragments: [n] }) : e.locations : n ? new V({ fragments: [n] }) : new V({}), this.text = e.text;
|
|
4083
4186
|
}
|
|
4084
4187
|
static deserialize(e) {
|
|
4085
|
-
if (e && e.href && e.type) return new
|
|
4188
|
+
if (e && e.href && e.type) return new He({ href: e.href, type: e.type, title: e.title, locations: V.deserialize(e.locations), text: We.deserialize(e.text) });
|
|
4086
4189
|
}
|
|
4087
4190
|
serialize() {
|
|
4088
4191
|
const e = { href: this.href, type: this.type };
|
|
4089
4192
|
return this.title !== void 0 && (e.title = this.title), this.locations && (e.locations = this.locations.serialize()), this.text && (e.text = this.text.serialize()), e;
|
|
4090
4193
|
}
|
|
4091
4194
|
copyWithLocations(e) {
|
|
4092
|
-
return new
|
|
4195
|
+
return new He({ href: this.href, type: this.type, title: this.title, text: this.text, locations: new V({ ...this.locations, ...e }) });
|
|
4093
4196
|
}
|
|
4094
4197
|
}
|
|
4095
|
-
function
|
|
4096
|
-
const { highlight: r, before: n, after: i, selector: s, fragment:
|
|
4097
|
-
fragments:
|
|
4198
|
+
function wo(t, e = window) {
|
|
4199
|
+
const { highlight: r, before: n, after: i, selector: s, fragment: o } = t, c = r !== void 0 || n !== void 0 || i !== void 0 ? new We({ highlight: r, before: n, after: i }) : void 0, l = s ? /* @__PURE__ */ new Map([["cssSelector", s]]) : void 0, d = l !== void 0 || o !== void 0 ? new V({
|
|
4200
|
+
fragments: o ? [o] : void 0,
|
|
4098
4201
|
otherLocations: l
|
|
4099
4202
|
}) : void 0;
|
|
4100
|
-
return new
|
|
4203
|
+
return new He({
|
|
4101
4204
|
href: e.location.href,
|
|
4102
4205
|
type: "text/html",
|
|
4103
4206
|
text: c,
|
|
4104
4207
|
locations: d
|
|
4105
4208
|
});
|
|
4106
4209
|
}
|
|
4107
|
-
class
|
|
4210
|
+
class So extends yo {
|
|
4108
4211
|
constructor(e, r, n, i = {}) {
|
|
4109
4212
|
super(e.host, i), this.channel = e, this.wnd = r, this.decorator = n;
|
|
4110
4213
|
}
|
|
@@ -4117,7 +4220,7 @@ class Sa extends ya {
|
|
|
4117
4220
|
e.map(({ id: n, style: i, ...s }) => ({
|
|
4118
4221
|
id: n,
|
|
4119
4222
|
style: i,
|
|
4120
|
-
locator:
|
|
4223
|
+
locator: wo(s, this.wnd)
|
|
4121
4224
|
})),
|
|
4122
4225
|
r
|
|
4123
4226
|
);
|
|
@@ -4127,17 +4230,17 @@ class Sa extends ya {
|
|
|
4127
4230
|
}
|
|
4128
4231
|
}
|
|
4129
4232
|
function gl(t = window, e = {}) {
|
|
4130
|
-
const r = new
|
|
4131
|
-
return n.mount(t, r.frame), new
|
|
4233
|
+
const r = new fo(), n = new lo();
|
|
4234
|
+
return n.mount(t, r.frame), new So(r, t, n, e);
|
|
4132
4235
|
}
|
|
4133
|
-
const
|
|
4236
|
+
const ko = [
|
|
4134
4237
|
"heading1",
|
|
4135
4238
|
"heading2",
|
|
4136
4239
|
"heading3",
|
|
4137
4240
|
"heading4",
|
|
4138
4241
|
"heading5",
|
|
4139
4242
|
"heading6"
|
|
4140
|
-
],
|
|
4243
|
+
], Cr = {
|
|
4141
4244
|
"doc-abstract": "abstract",
|
|
4142
4245
|
"doc-acknowledgments": "acknowledgments",
|
|
4143
4246
|
"doc-afterword": "afterword",
|
|
@@ -4205,7 +4308,7 @@ const ka = [
|
|
|
4205
4308
|
term: "term",
|
|
4206
4309
|
"doc-tip": "tip",
|
|
4207
4310
|
"doc-toc": "toc"
|
|
4208
|
-
},
|
|
4311
|
+
}, Oo = {
|
|
4209
4312
|
abstract: "abstract",
|
|
4210
4313
|
acknowledgments: "acknowledgments",
|
|
4211
4314
|
afterword: "afterword",
|
|
@@ -4265,7 +4368,7 @@ const ka = [
|
|
|
4265
4368
|
glossterm: "term",
|
|
4266
4369
|
tip: "tip",
|
|
4267
4370
|
toc: "toc"
|
|
4268
|
-
},
|
|
4371
|
+
}, xo = {
|
|
4269
4372
|
article: "article",
|
|
4270
4373
|
aside: "aside",
|
|
4271
4374
|
audio: "audio",
|
|
@@ -4313,20 +4416,20 @@ function ut(t) {
|
|
|
4313
4416
|
if ((c === "presentation" || c === "none") && (i = !0), c === "heading") {
|
|
4314
4417
|
let l = 2;
|
|
4315
4418
|
const h = parseInt(t.getAttribute("aria-level") ?? "", 10);
|
|
4316
|
-
Number.isFinite(h) && h >= 1 && (l = Math.min(h, 6)), n.push(
|
|
4317
|
-
} else
|
|
4318
|
-
const
|
|
4319
|
-
if (
|
|
4320
|
-
for (const c of
|
|
4321
|
-
const l =
|
|
4419
|
+
Number.isFinite(h) && h >= 1 && (l = Math.min(h, 6)), n.push(ko[l - 1]);
|
|
4420
|
+
} else Cr[c] && n.push(Cr[c]);
|
|
4421
|
+
const o = t.getAttribute("epub:type");
|
|
4422
|
+
if (o)
|
|
4423
|
+
for (const c of o.split(/\s+/).filter(Boolean)) {
|
|
4424
|
+
const l = Oo[c];
|
|
4322
4425
|
l && n.push(l);
|
|
4323
4426
|
}
|
|
4324
4427
|
if (i)
|
|
4325
4428
|
return ["presentation"];
|
|
4326
|
-
const
|
|
4327
|
-
if (
|
|
4429
|
+
const a = t.tagName.toLowerCase();
|
|
4430
|
+
if (a === "body")
|
|
4328
4431
|
r("body");
|
|
4329
|
-
else if (
|
|
4432
|
+
else if (a === "th")
|
|
4330
4433
|
switch (t.getAttribute("scope")) {
|
|
4331
4434
|
case "col":
|
|
4332
4435
|
r("columnheader");
|
|
@@ -4338,34 +4441,34 @@ function ut(t) {
|
|
|
4338
4441
|
r("cell");
|
|
4339
4442
|
}
|
|
4340
4443
|
else {
|
|
4341
|
-
const c =
|
|
4444
|
+
const c = xo[a];
|
|
4342
4445
|
c && r(c);
|
|
4343
4446
|
}
|
|
4344
4447
|
for (const c of n) r(c);
|
|
4345
4448
|
return e;
|
|
4346
4449
|
}
|
|
4347
|
-
function
|
|
4450
|
+
function Ce(t) {
|
|
4348
4451
|
return t.plain === "" && t.ssml === "" && t.language === "";
|
|
4349
4452
|
}
|
|
4350
|
-
function
|
|
4351
|
-
if (!t ||
|
|
4453
|
+
function Eo(t) {
|
|
4454
|
+
if (!t || Ce(t)) return;
|
|
4352
4455
|
if (t.ssml === "" && t.language === "") return t.plain;
|
|
4353
4456
|
const e = { language: t.language };
|
|
4354
4457
|
return t.plain !== "" && (e.plain = t.plain), t.ssml !== "" && (e.ssml = t.ssml), e;
|
|
4355
4458
|
}
|
|
4356
|
-
function
|
|
4459
|
+
function Co(t, e) {
|
|
4357
4460
|
if (t.lang !== e.lang || t.tag !== e.tag) return !1;
|
|
4358
4461
|
const r = Object.entries(t.attrs ?? {}), n = Object.entries(e.attrs ?? {});
|
|
4359
4462
|
return r.length !== n.length ? !1 : r.every(([i, s]) => e.attrs?.[i] === s);
|
|
4360
4463
|
}
|
|
4361
|
-
const
|
|
4362
|
-
function
|
|
4363
|
-
return
|
|
4464
|
+
const _e = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), ht = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), Ao = /[\u00A0\u2007\u202F]/;
|
|
4465
|
+
function To(t) {
|
|
4466
|
+
return Ao.test(t);
|
|
4364
4467
|
}
|
|
4365
4468
|
function xe(t, e) {
|
|
4366
4469
|
let r = "", n = !1, i = !1;
|
|
4367
4470
|
for (const s of t)
|
|
4368
|
-
if (
|
|
4471
|
+
if (To(s))
|
|
4369
4472
|
r += s, n = !1, i = !0;
|
|
4370
4473
|
else if (/\s/.test(s)) {
|
|
4371
4474
|
if (e && !i || n) continue;
|
|
@@ -4373,10 +4476,10 @@ function xe(t, e) {
|
|
|
4373
4476
|
} else s !== "" && s !== "" && (r += s, n = !1, i = !0);
|
|
4374
4477
|
return r;
|
|
4375
4478
|
}
|
|
4376
|
-
function
|
|
4479
|
+
function Ar(t) {
|
|
4377
4480
|
return !!(t.getAttribute("aria-hidden") === "true" || t.hasAttribute("hidden"));
|
|
4378
4481
|
}
|
|
4379
|
-
function
|
|
4482
|
+
function At(t) {
|
|
4380
4483
|
let e = "";
|
|
4381
4484
|
const r = (n) => {
|
|
4382
4485
|
n.nodeType === 3 && (e += n.nodeValue ?? "");
|
|
@@ -4385,20 +4488,20 @@ function Ct(t) {
|
|
|
4385
4488
|
return r(t), e;
|
|
4386
4489
|
}
|
|
4387
4490
|
function Be(t) {
|
|
4388
|
-
return xe(
|
|
4491
|
+
return xe(At(t), !0).trim();
|
|
4389
4492
|
}
|
|
4390
|
-
function
|
|
4391
|
-
if (
|
|
4493
|
+
function Ro(t) {
|
|
4494
|
+
if (Ar(t))
|
|
4392
4495
|
return [null, !1];
|
|
4393
4496
|
const e = (t.getAttribute("aria-labelledby") ?? "").trim();
|
|
4394
4497
|
if (e) {
|
|
4395
|
-
const s = [...new Set(e.split(/\s+/).filter(Boolean))],
|
|
4396
|
-
if (
|
|
4498
|
+
const s = [...new Set(e.split(/\s+/).filter(Boolean))], o = t.ownerDocument, a = s.map((c) => o.getElementById(c)).filter((c) => c !== null);
|
|
4499
|
+
if (a.length > 0) {
|
|
4397
4500
|
let c = "";
|
|
4398
|
-
|
|
4399
|
-
if (
|
|
4501
|
+
a.forEach((h, d) => {
|
|
4502
|
+
if (Ar(h)) return;
|
|
4400
4503
|
const g = h.getAttribute("aria-label");
|
|
4401
|
-
c += g ||
|
|
4504
|
+
c += g || At(h), d < a.length - 1 && (c += " ");
|
|
4402
4505
|
});
|
|
4403
4506
|
const l = xe(c, !0).trim();
|
|
4404
4507
|
if (l !== "")
|
|
@@ -4410,9 +4513,9 @@ function Ra(t) {
|
|
|
4410
4513
|
return [{ language: "", plain: r }, !0];
|
|
4411
4514
|
const n = (t.getAttribute("aria-describedby") ?? "").trim();
|
|
4412
4515
|
if (n) {
|
|
4413
|
-
const
|
|
4414
|
-
if (
|
|
4415
|
-
const
|
|
4516
|
+
const o = [...new Set(n.split(/\s+/).filter(Boolean))].map((a) => t.ownerDocument.getElementById(a)).filter((a) => a !== null);
|
|
4517
|
+
if (o.length > 0) {
|
|
4518
|
+
const a = o.map((l) => At(l)).join(" "), c = xe(a, !0).trim();
|
|
4416
4519
|
if (c !== "")
|
|
4417
4520
|
return [{ language: "", plain: c }, !0];
|
|
4418
4521
|
}
|
|
@@ -4421,13 +4524,13 @@ function Ra(t) {
|
|
|
4421
4524
|
if (i === "img") {
|
|
4422
4525
|
const s = (t.getAttribute("alt") ?? "").trim();
|
|
4423
4526
|
if (s) return [{ language: "", plain: s }, !0];
|
|
4424
|
-
const
|
|
4425
|
-
if (
|
|
4527
|
+
const o = (t.getAttribute("title") ?? "").trim();
|
|
4528
|
+
if (o) return [{ language: "", plain: o }, !0];
|
|
4426
4529
|
} else if (i === "svg") {
|
|
4427
4530
|
const s = t.querySelector(":scope > title");
|
|
4428
4531
|
if (s) {
|
|
4429
|
-
const
|
|
4430
|
-
if (
|
|
4532
|
+
const o = Be(s);
|
|
4533
|
+
if (o) return [{ language: "", plain: o }, !0];
|
|
4431
4534
|
}
|
|
4432
4535
|
} else if (i === "math") {
|
|
4433
4536
|
const s = (t.getAttribute("alttext") ?? "").trim();
|
|
@@ -4435,17 +4538,17 @@ function Ra(t) {
|
|
|
4435
4538
|
}
|
|
4436
4539
|
return [null, !0];
|
|
4437
4540
|
}
|
|
4438
|
-
const
|
|
4541
|
+
const No = {
|
|
4439
4542
|
em: ["emphasis"],
|
|
4440
4543
|
b: ["emphasis"],
|
|
4441
4544
|
i: ["emphasis", { level: "reduced" }],
|
|
4442
4545
|
strong: ["emphasis", { level: "strong" }],
|
|
4443
4546
|
br: ["break"]
|
|
4444
4547
|
};
|
|
4445
|
-
function
|
|
4446
|
-
return
|
|
4548
|
+
function Lo(t) {
|
|
4549
|
+
return No[t] ?? ["", void 0];
|
|
4447
4550
|
}
|
|
4448
|
-
const
|
|
4551
|
+
const Io = /* @__PURE__ */ new Set([
|
|
4449
4552
|
"script",
|
|
4450
4553
|
"style",
|
|
4451
4554
|
"template",
|
|
@@ -4458,23 +4561,23 @@ const Ia = /* @__PURE__ */ new Set([
|
|
|
4458
4561
|
"rt",
|
|
4459
4562
|
"rp",
|
|
4460
4563
|
"rtc"
|
|
4461
|
-
]), Tt = "\\p{Pe}\\p{Pf}.,;:!?,。、;:!?،؛؟", Rt = "\\p{Ps}\\p{Pi}¿¡",
|
|
4564
|
+
]), Tt = "\\p{Pe}\\p{Pf}.,;:!?,。、;:!?،؛؟", Rt = "\\p{Ps}\\p{Pi}¿¡", qo = new RegExp(`^[${Tt}]`, "u"), Po = new RegExp(`^[${Rt}]`, "u");
|
|
4462
4565
|
function Ge(t) {
|
|
4463
|
-
return
|
|
4566
|
+
return qo.test(t);
|
|
4464
4567
|
}
|
|
4465
|
-
function
|
|
4466
|
-
return
|
|
4568
|
+
function $o(t) {
|
|
4569
|
+
return Po.test(t);
|
|
4467
4570
|
}
|
|
4468
4571
|
function Nt(t) {
|
|
4469
|
-
return !t.audioref && !t.imgref && !t.textref && !t.videoref && (!t.text ||
|
|
4572
|
+
return !t.audioref && !t.imgref && !t.textref && !t.videoref && (!t.text || Ce(t.text)) && !(t.children && t.children.length > 0) && !t.description;
|
|
4470
4573
|
}
|
|
4471
|
-
function
|
|
4472
|
-
return !t.audioref && !t.imgref && !t.textref && !t.videoref && (!t.text ||
|
|
4574
|
+
function Do(t) {
|
|
4575
|
+
return !t.audioref && !t.imgref && !t.textref && !t.videoref && (!t.text || Ce(t.text)) && !!(t.children && t.children.length > 0) && !(t.role && t.role.length > 0) && !t.id;
|
|
4473
4576
|
}
|
|
4474
|
-
function
|
|
4577
|
+
function Bo(t) {
|
|
4475
4578
|
return !(t.role && t.role.length > 0) && !t.id;
|
|
4476
4579
|
}
|
|
4477
|
-
class
|
|
4580
|
+
class $e {
|
|
4478
4581
|
el;
|
|
4479
4582
|
object = {};
|
|
4480
4583
|
children = [];
|
|
@@ -4484,16 +4587,16 @@ class Pe {
|
|
|
4484
4587
|
for (const n of this.children) {
|
|
4485
4588
|
const i = n.finalize();
|
|
4486
4589
|
if (!Nt(i)) {
|
|
4487
|
-
if (
|
|
4590
|
+
if (Do(i)) {
|
|
4488
4591
|
r.push(...i.children ?? []);
|
|
4489
4592
|
continue;
|
|
4490
4593
|
}
|
|
4491
4594
|
r.push(i);
|
|
4492
4595
|
}
|
|
4493
4596
|
}
|
|
4494
|
-
if (r.length > 0 && (e.children = r), (!e.text ||
|
|
4597
|
+
if (r.length > 0 && (e.children = r), (!e.text || Ce(e.text)) && e.children?.length === 1) {
|
|
4495
4598
|
const n = e.children[0];
|
|
4496
|
-
|
|
4599
|
+
Bo(n) && (n.text && (e.text = n.text), n.textref && (e.textref = n.textref), n.imgref && (e.imgref = n.imgref), n.audioref && (e.audioref = n.audioref), n.videoref && (e.videoref = n.videoref), e.children = n.children);
|
|
4497
4600
|
}
|
|
4498
4601
|
return e;
|
|
4499
4602
|
}
|
|
@@ -4501,14 +4604,14 @@ class Pe {
|
|
|
4501
4604
|
function Lt(t) {
|
|
4502
4605
|
const e = {};
|
|
4503
4606
|
t.id && (e.id = t.id), t.textref && (e.textref = t.textref), t.imgref && (e.imgref = t.imgref), t.audioref && (e.audioref = t.audioref), t.videoref && (e.videoref = t.videoref);
|
|
4504
|
-
const r =
|
|
4607
|
+
const r = Eo(t.text);
|
|
4505
4608
|
return r !== void 0 && (e.text = r), t.role && t.role.length > 0 && (e.role = t.role), t.children && t.children.length > 0 && (e.children = t.children.map(Lt)), t.description && (e.description = t.description), e;
|
|
4506
4609
|
}
|
|
4507
4610
|
function hn(t) {
|
|
4508
4611
|
const e = {};
|
|
4509
4612
|
return t.id && (e.id = t.id), t.textref && (e.textref = t.textref), t.imgref && (e.imgref = t.imgref), t.audioref && (e.audioref = t.audioref), t.videoref && (e.videoref = t.videoref), t.role && (e.role = t.role), t.description && (e.description = t.description), typeof t.text == "string" ? e.text = { plain: t.text, ssml: "", language: "" } : t.text && (e.text = { plain: t.text.plain ?? "", ssml: t.text.ssml ?? "", language: t.text.language }), t.children && (e.children = t.children.map(hn)), e;
|
|
4510
4613
|
}
|
|
4511
|
-
const
|
|
4614
|
+
const jo = 1;
|
|
4512
4615
|
function Tr(t) {
|
|
4513
4616
|
for (let e = t; e; e = e.parentElement) {
|
|
4514
4617
|
const r = e.getAttribute("xml:lang");
|
|
@@ -4518,9 +4621,9 @@ function Tr(t) {
|
|
|
4518
4621
|
}
|
|
4519
4622
|
return "";
|
|
4520
4623
|
}
|
|
4521
|
-
function
|
|
4624
|
+
function Uo(t) {
|
|
4522
4625
|
for (let e = t.firstChild; e; e = e.nextSibling)
|
|
4523
|
-
if (e.nodeType ===
|
|
4626
|
+
if (e.nodeType === jo) return !0;
|
|
4524
4627
|
return !1;
|
|
4525
4628
|
}
|
|
4526
4629
|
function Rr(t, e) {
|
|
@@ -4528,11 +4631,11 @@ function Rr(t, e) {
|
|
|
4528
4631
|
if (r === t) return !0;
|
|
4529
4632
|
return !1;
|
|
4530
4633
|
}
|
|
4531
|
-
function
|
|
4634
|
+
function zo(t) {
|
|
4532
4635
|
const e = t.slice(0, 500);
|
|
4533
4636
|
return /<\?xml\b/.test(e) || /xmlns:epub=/.test(e) || /DOCTYPE\s+html\s+PUBLIC\s+"-\/\/W3C\/\/DTD XHTML/i.test(e) ? "application/xhtml+xml" : "text/html";
|
|
4534
4637
|
}
|
|
4535
|
-
const
|
|
4638
|
+
const Ho = 3, _o = 1, Fo = /* @__PURE__ */ new Set([
|
|
4536
4639
|
"object",
|
|
4537
4640
|
"base",
|
|
4538
4641
|
"font",
|
|
@@ -4598,9 +4701,9 @@ const _a = 3, Ha = 1, Fa = /* @__PURE__ */ new Set([
|
|
|
4598
4701
|
"strike",
|
|
4599
4702
|
"nobr",
|
|
4600
4703
|
"rb"
|
|
4601
|
-
]),
|
|
4704
|
+
]), Mo = /* @__PURE__ */ new Set(["summary", "dfn", "span"]);
|
|
4602
4705
|
function Nr(t, e) {
|
|
4603
|
-
return
|
|
4706
|
+
return Mo.has(t) && e.length > 0 ? !0 : !Fo.has(t);
|
|
4604
4707
|
}
|
|
4605
4708
|
class Bt {
|
|
4606
4709
|
xmlParsed;
|
|
@@ -4609,7 +4712,7 @@ class Bt {
|
|
|
4609
4712
|
idAlloc = { claimed: /* @__PURE__ */ new Set(), counters: /* @__PURE__ */ new Map() };
|
|
4610
4713
|
noterefDepth = 0;
|
|
4611
4714
|
allowNode = null;
|
|
4612
|
-
root = new
|
|
4715
|
+
root = new $e();
|
|
4613
4716
|
current = this.root;
|
|
4614
4717
|
segments = [];
|
|
4615
4718
|
textAcc = "";
|
|
@@ -4633,12 +4736,12 @@ class Bt {
|
|
|
4633
4736
|
}
|
|
4634
4737
|
prescan(e) {
|
|
4635
4738
|
const r = [], n = (i, s) => {
|
|
4636
|
-
const
|
|
4637
|
-
if (
|
|
4739
|
+
const o = i.getAttribute("id");
|
|
4740
|
+
if (o && !this.ids.has(o) && this.ids.set(o, i), s = s || i.getAttribute("aria-hidden") === "true" || i.hasAttribute("hidden"), !s && i.tagName.toLowerCase() === "a" && ut(i).includes("noteref")) {
|
|
4638
4741
|
const c = i.getAttribute("href") ?? "";
|
|
4639
4742
|
c.startsWith("#") && r.push({ id: c.slice(1), ref: i });
|
|
4640
4743
|
}
|
|
4641
|
-
for (let
|
|
4744
|
+
for (let a = i.firstElementChild; a; a = a.nextElementSibling) n(a, s);
|
|
4642
4745
|
};
|
|
4643
4746
|
n(e, !1);
|
|
4644
4747
|
for (const i of r) {
|
|
@@ -4665,18 +4768,18 @@ class Bt {
|
|
|
4665
4768
|
return !e.children || e.children.length === 0 ? Nt(e) ? [] : [Lt(e)] : e.children.map(Lt);
|
|
4666
4769
|
}
|
|
4667
4770
|
descend(e) {
|
|
4668
|
-
const r = new
|
|
4771
|
+
const r = new $e();
|
|
4669
4772
|
r.el = e, r.noText = this.current.noText, this.current.children.push(r), this.current = r;
|
|
4670
4773
|
}
|
|
4671
4774
|
appendChild(e) {
|
|
4672
4775
|
e.noText = this.current.noText, this.current.children.push(e);
|
|
4673
4776
|
}
|
|
4674
4777
|
walk(e) {
|
|
4675
|
-
if (e.nodeType ===
|
|
4778
|
+
if (e.nodeType === Ho) {
|
|
4676
4779
|
this.text(e);
|
|
4677
4780
|
return;
|
|
4678
4781
|
}
|
|
4679
|
-
if (e.nodeType !==
|
|
4782
|
+
if (e.nodeType !== _o) return;
|
|
4680
4783
|
const r = e, n = this.current, i = this.head(r);
|
|
4681
4784
|
if (!i)
|
|
4682
4785
|
for (let s = r.firstChild; s; s = s.nextSibling) this.walk(s);
|
|
@@ -4686,8 +4789,8 @@ class Bt {
|
|
|
4686
4789
|
// wholesale, invisible, or explicitly skipped).
|
|
4687
4790
|
head(e) {
|
|
4688
4791
|
const r = e.tagName.toLowerCase();
|
|
4689
|
-
if (
|
|
4690
|
-
const [n, i] =
|
|
4792
|
+
if (Io.has(r) || this.suppressed.has(e) && e !== this.allowNode) return !0;
|
|
4793
|
+
const [n, i] = Ro(e);
|
|
4691
4794
|
if (!i && e !== this.allowNode) return !0;
|
|
4692
4795
|
const s = ut(e);
|
|
4693
4796
|
if ((r === "img" || r === "svg") && (s.includes("presentation") || n === null && e.hasAttribute("alt") && e.getAttribute("alt").trim() === ""))
|
|
@@ -4720,10 +4823,10 @@ class Bt {
|
|
|
4720
4823
|
if (!Nr(r, s))
|
|
4721
4824
|
return !1;
|
|
4722
4825
|
this.flushText(), this.descend(e);
|
|
4723
|
-
const
|
|
4724
|
-
s.length > 0 && (
|
|
4725
|
-
const
|
|
4726
|
-
return
|
|
4826
|
+
const o = this.current.object;
|
|
4827
|
+
s.length > 0 && (o.role = s), n && (o.description = n.plain, s.includes("figure") && (this.current.noText = !0));
|
|
4828
|
+
const a = e.getAttribute("id");
|
|
4829
|
+
return a && (o.id = a), !1;
|
|
4727
4830
|
}
|
|
4728
4831
|
tail(e, r, n) {
|
|
4729
4832
|
if (r) return;
|
|
@@ -4738,12 +4841,12 @@ class Bt {
|
|
|
4738
4841
|
return;
|
|
4739
4842
|
}
|
|
4740
4843
|
const n = this.textContext(e);
|
|
4741
|
-
|
|
4844
|
+
Co(n, this.currentCtx) || (this.closeSegment(), this.currentCtx = n), this.textAcc += xe(r, this.flowEndsWithSpace), this.updateFlowSpace();
|
|
4742
4845
|
}
|
|
4743
4846
|
textContext(e) {
|
|
4744
4847
|
const r = { lang: Tr(e.parentElement), tag: "" };
|
|
4745
4848
|
for (let n = e.parentElement; n && n !== this.current.el; n = n.parentElement) {
|
|
4746
|
-
const [i, s] =
|
|
4849
|
+
const [i, s] = Lo(n.tagName.toLowerCase());
|
|
4747
4850
|
if (i && i !== "break") {
|
|
4748
4851
|
r.tag = i, r.attrs = s;
|
|
4749
4852
|
break;
|
|
@@ -4762,7 +4865,7 @@ class Bt {
|
|
|
4762
4865
|
}
|
|
4763
4866
|
placeholder(e, r, n, i) {
|
|
4764
4867
|
if (Nt(n)) return;
|
|
4765
|
-
const s = new
|
|
4868
|
+
const s = new $e();
|
|
4766
4869
|
if (s.el = e, s.object = n, this.current.noText) {
|
|
4767
4870
|
this.appendChild(s);
|
|
4768
4871
|
return;
|
|
@@ -4777,21 +4880,21 @@ class Bt {
|
|
|
4777
4880
|
pagebreak(e, r, n) {
|
|
4778
4881
|
const i = { role: n }, s = (e.getAttribute("title") ?? "").trim();
|
|
4779
4882
|
s ? i.text = { plain: s, ssml: "", language: "" } : r && (i.text = { plain: r.plain ?? "", ssml: r.ssml ?? "", language: r.language });
|
|
4780
|
-
const
|
|
4781
|
-
if (!
|
|
4883
|
+
const o = !!(i.text && !Ce(i.text)), a = !this.xmlParsed && (Uo(e) || o && e.firstChild !== null);
|
|
4884
|
+
if (!o && !a) {
|
|
4782
4885
|
const l = Be(e);
|
|
4783
4886
|
l && (i.text = { plain: l, ssml: "", language: "" });
|
|
4784
4887
|
}
|
|
4785
4888
|
const c = e.getAttribute("id");
|
|
4786
|
-
return c && (i.textref = `#${c}`), this.placeholder(e, "pagebreak", i),
|
|
4889
|
+
return c && (i.textref = `#${c}`), this.placeholder(e, "pagebreak", i), a;
|
|
4787
4890
|
}
|
|
4788
4891
|
noteref(e, r) {
|
|
4789
4892
|
const n = { role: r }, i = Be(e);
|
|
4790
4893
|
i && (n.text = { plain: i, ssml: "", language: "" });
|
|
4791
4894
|
const s = e.getAttribute("href") ?? "";
|
|
4792
|
-
let
|
|
4793
|
-
if (!
|
|
4794
|
-
const
|
|
4895
|
+
let o = e.getAttribute("id") ?? "";
|
|
4896
|
+
if (!o && s.startsWith("#") && (o = s.slice(1)), s.startsWith("#")) {
|
|
4897
|
+
const a = s.slice(1), c = this.ids.get(a);
|
|
4795
4898
|
if (c && !Rr(c, e) && this.noterefDepth < 3) {
|
|
4796
4899
|
const l = new Bt(this.xmlParsed);
|
|
4797
4900
|
l.ids = this.ids, l.suppressed = this.suppressed, l.idAlloc = this.idAlloc, l.noterefDepth = this.noterefDepth + 1, l.allowNode = c, l.convert(c);
|
|
@@ -4802,7 +4905,7 @@ class Bt {
|
|
|
4802
4905
|
}));
|
|
4803
4906
|
}
|
|
4804
4907
|
}
|
|
4805
|
-
!n.children && s && (n.children = [{ textref: s }]), this.placeholder(e, "noteref", n,
|
|
4908
|
+
!n.children && s && (n.children = [{ textref: s }]), this.placeholder(e, "noteref", n, o || void 0);
|
|
4806
4909
|
}
|
|
4807
4910
|
link(e, r) {
|
|
4808
4911
|
const n = {};
|
|
@@ -4861,19 +4964,19 @@ class Bt {
|
|
|
4861
4964
|
}
|
|
4862
4965
|
let s = Tr(this.current.el ?? null);
|
|
4863
4966
|
i.length === 1 && i[0] !== "" && (s = i[0]);
|
|
4864
|
-
let
|
|
4967
|
+
let o = !1;
|
|
4865
4968
|
for (const p of e)
|
|
4866
4969
|
if (p.kind !== "text" || p.ctx.tag !== "" || p.ctx.lang !== s) {
|
|
4867
|
-
|
|
4970
|
+
o = !0;
|
|
4868
4971
|
break;
|
|
4869
4972
|
}
|
|
4870
|
-
if (
|
|
4973
|
+
if (o && s === "" && (s = "en"), o)
|
|
4871
4974
|
for (const p of e) {
|
|
4872
4975
|
if (p.kind !== "placeholder") continue;
|
|
4873
4976
|
let m = p.candidateID;
|
|
4874
4977
|
(!m || !this.claimId(m)) && (m = this.allocateId(p.tag)), p.child.object.id = m;
|
|
4875
4978
|
}
|
|
4876
|
-
let
|
|
4979
|
+
let a = "", c = !1, l = !1, h = !1, d = !1;
|
|
4877
4980
|
for (const p of e)
|
|
4878
4981
|
if (p.kind === "text") {
|
|
4879
4982
|
const m = p.text.startsWith(" "), w = p.text.replace(/^ +| +$/g, "");
|
|
@@ -4882,18 +4985,18 @@ class Bt {
|
|
|
4882
4985
|
continue;
|
|
4883
4986
|
}
|
|
4884
4987
|
let E = !1;
|
|
4885
|
-
if (
|
|
4988
|
+
if (a.length > 0) {
|
|
4886
4989
|
const x = c || d || m;
|
|
4887
4990
|
l ? E = !0 : h ? E = x && !Ge(w) : E = x;
|
|
4888
4991
|
}
|
|
4889
|
-
E && (
|
|
4992
|
+
E && (a += " "), a += w, c = p.text.endsWith(" "), l = !1, h = !1, d = !1;
|
|
4890
4993
|
} else p.kind === "break" ? l = !0 : p.kind === "placeholder" && (h = !0);
|
|
4891
4994
|
const g = e.some((p) => p.kind === "placeholder"), f = {
|
|
4892
|
-
plain:
|
|
4995
|
+
plain: o && !g ? "" : a.trim(),
|
|
4893
4996
|
ssml: "",
|
|
4894
4997
|
language: s
|
|
4895
4998
|
};
|
|
4896
|
-
if (
|
|
4999
|
+
if (o) {
|
|
4897
5000
|
let p = "";
|
|
4898
5001
|
for (const m of e)
|
|
4899
5002
|
if (m.kind === "text") {
|
|
@@ -4902,28 +5005,28 @@ class Bt {
|
|
|
4902
5005
|
p += `<${w}`;
|
|
4903
5006
|
for (const [x, N] of Object.entries(E ?? {}))
|
|
4904
5007
|
p += ` ${x}="${ht(N)}"`;
|
|
4905
|
-
m.ctx.lang !== s && m.ctx.lang !== "" && (p += ` xml:lang="${ht(m.ctx.lang)}"`), p += `>${
|
|
5008
|
+
m.ctx.lang !== s && m.ctx.lang !== "" && (p += ` xml:lang="${ht(m.ctx.lang)}"`), p += `>${_e(m.text)}</${w}>`;
|
|
4906
5009
|
} else
|
|
4907
|
-
p +=
|
|
5010
|
+
p += _e(m.text);
|
|
4908
5011
|
} else m.kind === "break" ? p += "<break/>" : m.kind === "placeholder" && (p += `<readium:${m.tag} id="${ht(m.child.object.id)}" />`);
|
|
4909
5012
|
f.ssml = p;
|
|
4910
5013
|
}
|
|
4911
|
-
const y = new
|
|
5014
|
+
const y = new $e();
|
|
4912
5015
|
y.object = { text: f };
|
|
4913
5016
|
for (const p of r)
|
|
4914
5017
|
y.children.push(p);
|
|
4915
5018
|
this.appendChild(y);
|
|
4916
5019
|
}
|
|
4917
5020
|
}
|
|
4918
|
-
const
|
|
4919
|
-
function
|
|
4920
|
-
const r = e ??
|
|
4921
|
-
return s && !
|
|
5021
|
+
const Vo = /<body[\s>]/i;
|
|
5022
|
+
function Wo(t, e) {
|
|
5023
|
+
const r = e ?? zo(t), n = new DOMParser().parseFromString(t, r), i = new Bt(r === "application/xhtml+xml"), s = n.querySelector("body");
|
|
5024
|
+
return s && !Vo.test(t) ? i.convertChildren(s) : i.convert(s ?? n.documentElement), i.result();
|
|
4922
5025
|
}
|
|
4923
5026
|
function fl(t, e) {
|
|
4924
|
-
return { guided:
|
|
5027
|
+
return { guided: Wo(t, e) };
|
|
4925
5028
|
}
|
|
4926
|
-
const
|
|
5029
|
+
const Go = {
|
|
4927
5030
|
// Collections / sections with their own substructure — start/end pairs.
|
|
4928
5031
|
footnote: { start: "Start of the footnote.", end: "End of the footnote." },
|
|
4929
5032
|
part: { start: "Start of the part.", end: "End of the part." },
|
|
@@ -4976,18 +5079,18 @@ const Ga = {
|
|
|
4976
5079
|
image: "Image.",
|
|
4977
5080
|
audio: "Audio.",
|
|
4978
5081
|
video: "Video."
|
|
4979
|
-
},
|
|
5082
|
+
}, Ko = /<lang xml:lang="[^"]*">([\s\S]*?)<\/lang>/g;
|
|
4980
5083
|
function dn(t) {
|
|
4981
|
-
return t.replace(
|
|
5084
|
+
return t.replace(Ko, "$1");
|
|
4982
5085
|
}
|
|
4983
|
-
const
|
|
4984
|
-
function
|
|
4985
|
-
return t.replace(
|
|
5086
|
+
const Jo = /\s*<readium:[a-zA-Z][\w-]*\s+id="[^"]*"\s*\/>\s*/g;
|
|
5087
|
+
function Qo(t) {
|
|
5088
|
+
return t.replace(Jo, (r, n, i) => {
|
|
4986
5089
|
const s = i.slice(n + r.length);
|
|
4987
5090
|
return s.length === 0 || Ge(s) ? "" : " ";
|
|
4988
5091
|
}).replace(/ {2,}/g, " ").trim();
|
|
4989
5092
|
}
|
|
4990
|
-
function
|
|
5093
|
+
function Xo(t) {
|
|
4991
5094
|
return t.includes("<");
|
|
4992
5095
|
}
|
|
4993
5096
|
function gn(t) {
|
|
@@ -4995,8 +5098,8 @@ function gn(t) {
|
|
|
4995
5098
|
if (typeof t == "string") return { plain: t };
|
|
4996
5099
|
const e = { language: t.language };
|
|
4997
5100
|
if (t.ssml) {
|
|
4998
|
-
const r =
|
|
4999
|
-
|
|
5101
|
+
const r = Qo(t.ssml);
|
|
5102
|
+
Xo(r) && (e.ssml = r);
|
|
5000
5103
|
}
|
|
5001
5104
|
return t.plain && (e.plain = t.plain), e.plain || e.ssml ? e : void 0;
|
|
5002
5105
|
}
|
|
@@ -5010,17 +5113,17 @@ function pn(t) {
|
|
|
5010
5113
|
function Lr(t) {
|
|
5011
5114
|
return t.replace(/<[^>]+>/g, "").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/ {2,}/g, " ");
|
|
5012
5115
|
}
|
|
5013
|
-
const
|
|
5116
|
+
const Zo = new RegExp(
|
|
5014
5117
|
`\\s+|[${Rt}]+|[${Tt}]+|[^\\s${Rt}${Tt}]+`,
|
|
5015
5118
|
"gu"
|
|
5016
5119
|
);
|
|
5017
5120
|
function dt(t) {
|
|
5018
5121
|
const e = [];
|
|
5019
|
-
for (const [r] of t.matchAll(
|
|
5020
|
-
/^\s/.test(r) ? e.push({ kind: "space" }) :
|
|
5122
|
+
for (const [r] of t.matchAll(Zo))
|
|
5123
|
+
/^\s/.test(r) ? e.push({ kind: "space" }) : $o(r) ? e.push({ kind: "open", text: r }) : Ge(r) ? e.push({ kind: "close", text: r }) : e.push({ kind: "word", text: r });
|
|
5021
5124
|
return e;
|
|
5022
5125
|
}
|
|
5023
|
-
function
|
|
5126
|
+
function Yo(t) {
|
|
5024
5127
|
let e = "", r = !1;
|
|
5025
5128
|
for (const n of t) {
|
|
5026
5129
|
if (n.kind === "space") {
|
|
@@ -5059,8 +5162,8 @@ function mn(t, e) {
|
|
|
5059
5162
|
!r[s].tagged && r[s + 1].tagged ? r[s + 1].tokens.unshift(...el(r[s].tokens)) : r[s].tagged && !r[s + 1].tagged && r[s].tokens.push(...tl(r[s + 1].tokens));
|
|
5060
5163
|
const i = [];
|
|
5061
5164
|
for (const s of r) {
|
|
5062
|
-
const
|
|
5063
|
-
|
|
5165
|
+
const o = Yo(s.tokens);
|
|
5166
|
+
o && i.push({ plain: o, language: s.language });
|
|
5064
5167
|
}
|
|
5065
5168
|
return i;
|
|
5066
5169
|
}
|
|
@@ -5085,15 +5188,15 @@ function Ee(t, e) {
|
|
|
5085
5188
|
return typeof t == "function" ? t(e) : t;
|
|
5086
5189
|
}
|
|
5087
5190
|
function ie(t, e) {
|
|
5088
|
-
return e === "ssml" ? { ssml:
|
|
5191
|
+
return e === "ssml" ? { ssml: _e(t) } : { plain: t };
|
|
5089
5192
|
}
|
|
5090
5193
|
function Ir(t, e, r, n, i) {
|
|
5091
5194
|
if (!e.contextualize) return;
|
|
5092
5195
|
const s = e.announcements[r];
|
|
5093
5196
|
if (s !== void 0) {
|
|
5094
5197
|
if (Fe(s)) {
|
|
5095
|
-
const
|
|
5096
|
-
t.push(ie(Ee(
|
|
5198
|
+
const o = n === "before" ? s.start : s.end;
|
|
5199
|
+
t.push(ie(Ee(o, i), e.format));
|
|
5097
5200
|
return;
|
|
5098
5201
|
}
|
|
5099
5202
|
n === "before" && t.push(ie(Ee(s, i), e.format));
|
|
@@ -5105,19 +5208,19 @@ function qr(t, e) {
|
|
|
5105
5208
|
function Ut(t, e) {
|
|
5106
5209
|
let r, n = !1;
|
|
5107
5210
|
const i = [];
|
|
5108
|
-
for (const
|
|
5109
|
-
const c = e === "ssml" ?
|
|
5110
|
-
if (c && (i.push(c),
|
|
5111
|
-
if (n &&
|
|
5112
|
-
r =
|
|
5211
|
+
for (const a of t) {
|
|
5212
|
+
const c = e === "ssml" ? a.ssml : a.plain;
|
|
5213
|
+
if (c && (i.push(c), a.language !== void 0)) {
|
|
5214
|
+
if (n && a.language !== r) return;
|
|
5215
|
+
r = a.language, n = !0;
|
|
5113
5216
|
}
|
|
5114
5217
|
}
|
|
5115
5218
|
if (i.length === 0) return;
|
|
5116
5219
|
let s = "";
|
|
5117
|
-
for (const
|
|
5118
|
-
|
|
5119
|
-
const
|
|
5120
|
-
return r && (
|
|
5220
|
+
for (const a of i)
|
|
5221
|
+
a.length === 1 && s.endsWith(a) || (s && !Ge(a) && (s += " "), s += a);
|
|
5222
|
+
const o = e === "ssml" ? { ssml: s } : { plain: s };
|
|
5223
|
+
return r && (o.language = r), o;
|
|
5121
5224
|
}
|
|
5122
5225
|
function il(t, e) {
|
|
5123
5226
|
const r = gn(t.text), n = r ? bn(r, e.format, e.language) : [];
|
|
@@ -5126,8 +5229,8 @@ function il(t, e) {
|
|
|
5126
5229
|
if (i === void 0) return n;
|
|
5127
5230
|
const s = ie(Ee(Fe(i) ? i.start : i), e.format);
|
|
5128
5231
|
if (n.length === 0) return [s];
|
|
5129
|
-
const
|
|
5130
|
-
return
|
|
5232
|
+
const o = Ut([s, ...n], e.format);
|
|
5233
|
+
return o ? (o.plain !== void 0 && (o.plain += "."), o.ssml !== void 0 && (o.ssml += "."), [o]) : [s, ...n];
|
|
5131
5234
|
}
|
|
5132
5235
|
function bn(t, e, r) {
|
|
5133
5236
|
if (e === "plain" && r !== "block-level" && r !== "none" && t.ssml && pn(t.ssml))
|
|
@@ -5136,45 +5239,45 @@ function bn(t, e, r) {
|
|
|
5136
5239
|
return i.language && (s.language = i.language), s;
|
|
5137
5240
|
});
|
|
5138
5241
|
const n = {};
|
|
5139
|
-
return t.language && (n.language = t.language), e === "ssml" ? n.ssml = t.ssml ??
|
|
5242
|
+
return t.language && (n.language = t.language), e === "ssml" ? n.ssml = t.ssml ?? _e(t.plain ?? "") : n.plain = t.plain ?? jt(t.ssml ?? ""), (r === "block-level" || r === "none") && (n.ssml && (n.ssml = dn(n.ssml)), r === "none" && delete n.language), [n];
|
|
5140
5243
|
}
|
|
5141
5244
|
function sl(t, e, r, n) {
|
|
5142
|
-
const i = typeof t.text == "object" ? t.text.language : void 0, s = new Map((t.children ?? []).map((c) => [c.id, c])),
|
|
5245
|
+
const i = typeof t.text == "object" ? t.text.language : void 0, s = new Map((t.children ?? []).map((c) => [c.id, c])), o = [];
|
|
5143
5246
|
for (const c of nl(e)) {
|
|
5144
5247
|
if (c.placeholderId !== void 0) {
|
|
5145
5248
|
const h = s.get(c.placeholderId);
|
|
5146
|
-
h && vn(h,
|
|
5249
|
+
h && vn(h, o, n);
|
|
5147
5250
|
continue;
|
|
5148
5251
|
}
|
|
5149
5252
|
if (!c.ssml) continue;
|
|
5150
5253
|
if (n.format === "plain" && n.language !== "block-level" && n.language !== "none" && pn(c.ssml)) {
|
|
5151
5254
|
for (const h of mn(c.ssml, i)) {
|
|
5152
5255
|
const d = { plain: h.plain };
|
|
5153
|
-
h.language && (d.language = h.language),
|
|
5256
|
+
h.language && (d.language = h.language), o.push(d);
|
|
5154
5257
|
}
|
|
5155
5258
|
continue;
|
|
5156
5259
|
}
|
|
5157
5260
|
const l = {};
|
|
5158
|
-
i && (l.language = i), n.format === "ssml" ? l.ssml = c.ssml : l.plain = jt(c.ssml), (n.language === "block-level" || n.language === "none") && (l.ssml && (l.ssml = dn(l.ssml)), n.language === "none" && delete l.language),
|
|
5261
|
+
i && (l.language = i), n.format === "ssml" ? l.ssml = c.ssml : l.plain = jt(c.ssml), (n.language === "block-level" || n.language === "none") && (l.ssml && (l.ssml = dn(l.ssml)), n.language === "none" && delete l.language), o.push(l);
|
|
5159
5262
|
}
|
|
5160
|
-
const
|
|
5161
|
-
r.push(...
|
|
5263
|
+
const a = o.length > 1 ? Ut(o, n.format) : void 0;
|
|
5264
|
+
r.push(...a ? [a] : o);
|
|
5162
5265
|
}
|
|
5163
5266
|
function vn(t, e, r) {
|
|
5164
5267
|
const n = t.role ?? [];
|
|
5165
5268
|
if (qr(n, r.skip)) return;
|
|
5166
5269
|
const i = n.includes("footnote"), s = n.filter(
|
|
5167
|
-
(
|
|
5270
|
+
(o) => !(i && (o === "footnote" || o === "aside")) && o !== "pagebreak"
|
|
5168
5271
|
);
|
|
5169
|
-
for (const
|
|
5170
|
-
Ir(e, r,
|
|
5272
|
+
for (const o of s)
|
|
5273
|
+
Ir(e, r, o, "before");
|
|
5171
5274
|
if (n.includes("noteref"))
|
|
5172
|
-
for (const
|
|
5173
|
-
const
|
|
5174
|
-
if (!qr(
|
|
5175
|
-
if (
|
|
5275
|
+
for (const o of t.children ?? []) {
|
|
5276
|
+
const a = o.role ?? [];
|
|
5277
|
+
if (!qr(a, r.skip))
|
|
5278
|
+
if (a.includes("footnote")) {
|
|
5176
5279
|
const c = [];
|
|
5177
|
-
Se([
|
|
5280
|
+
Se([o], c, r);
|
|
5178
5281
|
const l = r.contextualize ? r.announcements.footnote : void 0, h = [];
|
|
5179
5282
|
if (l !== void 0) {
|
|
5180
5283
|
const g = Fe(l) ? l.start : l;
|
|
@@ -5184,29 +5287,29 @@ function vn(t, e, r) {
|
|
|
5184
5287
|
const d = l !== void 0 && h.length > 1 ? Ut(h, r.format) : void 0;
|
|
5185
5288
|
e.push(...d ? [d] : h);
|
|
5186
5289
|
} else
|
|
5187
|
-
Se([
|
|
5290
|
+
Se([o], e, r);
|
|
5188
5291
|
}
|
|
5189
5292
|
else {
|
|
5190
|
-
const
|
|
5191
|
-
if (r.interruptSentence &&
|
|
5192
|
-
sl(t,
|
|
5293
|
+
const o = typeof t.text == "object" ? t.text.ssml : void 0;
|
|
5294
|
+
if (r.interruptSentence && o && rl(o))
|
|
5295
|
+
sl(t, o, e, r);
|
|
5193
5296
|
else if (n.includes("pagebreak"))
|
|
5194
5297
|
e.push(...il(t, r)), t.children && Se(t.children, e, r);
|
|
5195
5298
|
else {
|
|
5196
|
-
const
|
|
5197
|
-
|
|
5299
|
+
const a = gn(t.text);
|
|
5300
|
+
a && e.push(...bn(a, r.format, r.language)), t.children && Se(t.children, e, r);
|
|
5198
5301
|
}
|
|
5199
5302
|
}
|
|
5200
5303
|
t.description !== void 0 && e.push(ie(t.description, r.format));
|
|
5201
|
-
for (const
|
|
5202
|
-
Ir(e, r,
|
|
5304
|
+
for (const o of s)
|
|
5305
|
+
Ir(e, r, o, "after");
|
|
5203
5306
|
}
|
|
5204
5307
|
function Se(t, e, r) {
|
|
5205
5308
|
for (const n of t) vn(n, e, r);
|
|
5206
5309
|
}
|
|
5207
5310
|
function pl(t, e) {
|
|
5208
5311
|
const r = {
|
|
5209
|
-
announcements: { ...
|
|
5312
|
+
announcements: { ...Go, ...e.announcements },
|
|
5210
5313
|
skip: new Set(e.skip ?? []),
|
|
5211
5314
|
format: e.format ?? "plain",
|
|
5212
5315
|
contextualize: e.contextualize ?? !0,
|
|
@@ -5234,32 +5337,32 @@ const ml = [
|
|
|
5234
5337
|
"toc"
|
|
5235
5338
|
];
|
|
5236
5339
|
export {
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5340
|
+
co as BUILTIN_DECORATION_TYPES,
|
|
5341
|
+
yo as DecorationController,
|
|
5342
|
+
so as DecorationLayout,
|
|
5343
|
+
C as DecorationStyleType,
|
|
5344
|
+
io as DecorationWidth,
|
|
5345
|
+
lo as Decorator,
|
|
5346
|
+
fo as DirectCommsChannel,
|
|
5347
|
+
po as DirectCommsFrame,
|
|
5348
|
+
mo as DirectCommsHost,
|
|
5349
|
+
He as Locator,
|
|
5350
|
+
V as LocatorLocations,
|
|
5248
5351
|
We as LocatorText,
|
|
5249
|
-
|
|
5352
|
+
So as ReadiumSpeechDecorationController,
|
|
5250
5353
|
wt as WebSpeechEngine,
|
|
5251
|
-
|
|
5354
|
+
ol as WebSpeechEngineProvider,
|
|
5252
5355
|
ll as WebSpeechReadAloudNavigator,
|
|
5253
5356
|
O as WebSpeechVoiceManager,
|
|
5254
5357
|
ke as chineseVariantMap,
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5358
|
+
wo as createLocator,
|
|
5359
|
+
go as decorationsEqual,
|
|
5360
|
+
Go as defaultAnnouncements,
|
|
5258
5361
|
pl as extractUtterances,
|
|
5259
5362
|
fl as makeGnd,
|
|
5260
|
-
|
|
5363
|
+
Wo as parseMarkup,
|
|
5261
5364
|
xr as resolveDecorationForWire,
|
|
5262
5365
|
gl as setupDecorations,
|
|
5263
5366
|
ml as skippableRoles,
|
|
5264
|
-
|
|
5367
|
+
uo as supportsDecorationStyle
|
|
5265
5368
|
};
|