@readium/speech 0.1.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/LICENSE +28 -0
- package/README.md +144 -0
- package/build/WebSpeech/TmpNavigator.d.ts +39 -0
- package/build/WebSpeech/WebSpeechVoiceManager.d.ts +232 -0
- package/build/WebSpeech/index.d.ts +4 -0
- package/build/WebSpeech/webSpeechEngine.d.ts +67 -0
- package/build/WebSpeech/webSpeechEngineProvider.d.ts +11 -0
- package/build/ar-BYWkyZgW.cjs +1 -0
- package/build/ar-CJhBAgKq.js +13 -0
- package/build/bg-D7xe9YTl.cjs +1 -0
- package/build/bg-JvP4LoOT.js +13 -0
- package/build/bho-CpuLBMN3.js +13 -0
- package/build/bho-UB6aO8oz.cjs +1 -0
- package/build/bn-84u93pMd.js +13 -0
- package/build/bn-boRZ2pl5.cjs +1 -0
- package/build/ca-DdScTbex.js +13 -0
- package/build/ca-DkC8kSJ8.cjs +1 -0
- package/build/cmn-BsNLjyA4.cjs +1 -0
- package/build/cmn-Dd1zrvTE.js +13 -0
- package/build/cs-CDMne0uc.js +13 -0
- package/build/cs-p05r08p7.cjs +1 -0
- package/build/da-crefCup9.cjs +1 -0
- package/build/da-oFf4cHgj.js +13 -0
- package/build/de-Bjgc3bVq.js +13 -0
- package/build/de-xoW-RuhZ.cjs +1 -0
- package/build/el-C025sTug.cjs +1 -0
- package/build/el-FkKIcghI.js +13 -0
- package/build/en-DCQHxNny.js +13 -0
- package/build/en-Gmh32VcD.cjs +1 -0
- package/build/engine.d.ts +25 -0
- package/build/es-CDjjngpC.js +13 -0
- package/build/es-tgHiWsyf.cjs +1 -0
- package/build/eu-DxWirHU-.js +13 -0
- package/build/eu-uq15ZgwW.cjs +1 -0
- package/build/fa-CHOnwiFr.cjs +1 -0
- package/build/fa-CTVUniYi.js +13 -0
- package/build/fi-Bxlno6Zi.cjs +1 -0
- package/build/fi-Do6QFzRv.js +13 -0
- package/build/fr-B5-P9o29.js +13 -0
- package/build/fr-yAth5-FC.cjs +1 -0
- package/build/generated/language-metadata.d.ts +7 -0
- package/build/gl-BEgzCAO0.cjs +1 -0
- package/build/gl-DqSXeC_F.js +13 -0
- package/build/he-B-CTHJPL.cjs +1 -0
- package/build/he-CpyNwgaH.js +13 -0
- package/build/hi-C0yUjV1-.cjs +1 -0
- package/build/hi-CeOBacbl.js +13 -0
- package/build/hr-CSpU18l6.js +13 -0
- package/build/hr-CZvFOcdo.cjs +1 -0
- package/build/hu-_2PInItj.cjs +1 -0
- package/build/hu-oONHmpR6.js +13 -0
- package/build/id-BROcb7-t.cjs +1 -0
- package/build/id-BpZuB5Iw.js +13 -0
- package/build/index.cjs +27 -0
- package/build/index.d.ts +7 -0
- package/build/index.js +2801 -0
- package/build/it-Bmc8Ycff.cjs +1 -0
- package/build/it-CM4X84UA.js +13 -0
- package/build/ja-B8t6WOeg.cjs +1 -0
- package/build/ja-e-iw3c4_.js +13 -0
- package/build/kk-BdLCAb2s.js +13 -0
- package/build/kk-DskO1CW8.cjs +1 -0
- package/build/kn-BYRvouO5.js +13 -0
- package/build/kn-Cy3NH6na.cjs +1 -0
- package/build/ko-CZdQzppZ.cjs +1 -0
- package/build/ko-EIouMDK1.js +13 -0
- package/build/mr-9hGqBYlV.cjs +1 -0
- package/build/mr-DN-hwEV1.js +13 -0
- package/build/ms-B5E3oaWE.js +13 -0
- package/build/ms-DzpBxNFZ.cjs +1 -0
- package/build/navigator.d.ts +30 -0
- package/build/nb-BQfw9EEH.cjs +1 -0
- package/build/nb-DOw05HBh.js +13 -0
- package/build/nl-CEydw4A9.js +13 -0
- package/build/nl-CyM0R4Gr.cjs +1 -0
- package/build/pl-Da8XOMa1.cjs +1 -0
- package/build/pl-Ivj_eAP7.js +13 -0
- package/build/provider.d.ts +9 -0
- package/build/pt-BPEGqRmW.js +13 -0
- package/build/pt-tubyvYaM.cjs +1 -0
- package/build/ro-BQ617SOx.js +13 -0
- package/build/ro-C-rXDfuM.cjs +1 -0
- package/build/ru-DJocRaDd.cjs +1 -0
- package/build/ru-Dieeph4H.js +13 -0
- package/build/sk-BvpojIXp.cjs +1 -0
- package/build/sk-pEiOt4GQ.js +13 -0
- package/build/sl-D0X3JKvQ.cjs +1 -0
- package/build/sl-Z6jWAR8J.js +13 -0
- package/build/sv-4lEgrHda.cjs +1 -0
- package/build/sv-BT09piiZ.js +13 -0
- package/build/ta-B0YMGW5q.js +13 -0
- package/build/ta-CyeVPdIs.cjs +1 -0
- package/build/te-DqWIZZxL.cjs +1 -0
- package/build/te-ax-HNsAY.js +13 -0
- package/build/th-BcoSVZAp.cjs +1 -0
- package/build/th-C7Dbxwoz.js +13 -0
- package/build/tr-BuafNhfw.cjs +1 -0
- package/build/tr-mipEichO.js +13 -0
- package/build/uk-CHdx7DHz.js +13 -0
- package/build/uk-DkXNxnD9.cjs +1 -0
- package/build/utils/features.d.ts +23 -0
- package/build/utils/language.d.ts +6 -0
- package/build/utils/patches.d.ts +11 -0
- package/build/utterance.d.ts +6 -0
- package/build/vi-Ct2avSE6.cjs +1 -0
- package/build/vi-DrlcEwAD.js +13 -0
- package/build/voices/filters.d.ts +5 -0
- package/build/voices/languages.d.ts +44 -0
- package/build/voices/localized.d.ts +20 -0
- package/build/voices/packages.d.ts +2 -0
- package/build/voices/sorting.d.ts +7 -0
- package/build/voices/types.d.ts +87 -0
- package/build/voices/voiceDuplicates.d.ts +19 -0
- package/build/wuu-C6uQvT6g.js +13 -0
- package/build/wuu-DnwGQ6c-.cjs +1 -0
- package/build/yue-CFroa59o.js +13 -0
- package/build/yue-j9Y48sR-.cjs +1 -0
- package/package.json +59 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,2801 @@
|
|
|
1
|
+
const F = (e) => {
|
|
2
|
+
if (!e) return ["", void 0];
|
|
3
|
+
const t = e.replace(/_/g, "-");
|
|
4
|
+
try {
|
|
5
|
+
const r = new Intl.Locale(t);
|
|
6
|
+
return [
|
|
7
|
+
r.language.toLowerCase(),
|
|
8
|
+
r.region?.toUpperCase()
|
|
9
|
+
];
|
|
10
|
+
} catch {
|
|
11
|
+
const r = t.split("-");
|
|
12
|
+
return [
|
|
13
|
+
r[0].toLowerCase(),
|
|
14
|
+
r[1]?.toUpperCase()
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
}, x = {
|
|
18
|
+
ar: {
|
|
19
|
+
defaultRegion: "SA",
|
|
20
|
+
availableRegions: [
|
|
21
|
+
"001",
|
|
22
|
+
"AE",
|
|
23
|
+
"AS",
|
|
24
|
+
"BH",
|
|
25
|
+
"DZ",
|
|
26
|
+
"EG",
|
|
27
|
+
"IQ",
|
|
28
|
+
"JO",
|
|
29
|
+
"KW",
|
|
30
|
+
"LB",
|
|
31
|
+
"LY",
|
|
32
|
+
"MA",
|
|
33
|
+
"OM",
|
|
34
|
+
"QA",
|
|
35
|
+
"SA",
|
|
36
|
+
"SY",
|
|
37
|
+
"TN",
|
|
38
|
+
"YE"
|
|
39
|
+
],
|
|
40
|
+
testUtterance: "مرحبًا، اسمي {name} وأنا صوت عربي."
|
|
41
|
+
},
|
|
42
|
+
bg: {
|
|
43
|
+
defaultRegion: "BG",
|
|
44
|
+
availableRegions: [
|
|
45
|
+
"BG"
|
|
46
|
+
],
|
|
47
|
+
testUtterance: "Здравейте, казвам се {name} и съм български глас."
|
|
48
|
+
},
|
|
49
|
+
bho: {
|
|
50
|
+
defaultRegion: "IN",
|
|
51
|
+
availableRegions: [
|
|
52
|
+
"IN"
|
|
53
|
+
],
|
|
54
|
+
testUtterance: "नमस्कार, हमार नाम {name} ह आ हम भोजपुरी आवाज हईं"
|
|
55
|
+
},
|
|
56
|
+
bn: {
|
|
57
|
+
defaultRegion: "IN",
|
|
58
|
+
availableRegions: [
|
|
59
|
+
"BD",
|
|
60
|
+
"IN"
|
|
61
|
+
],
|
|
62
|
+
testUtterance: "হ্যালো, আমার নাম {name} এবং আমি একজন বাংলা ভয়েস।"
|
|
63
|
+
},
|
|
64
|
+
ca: {
|
|
65
|
+
defaultRegion: "ES",
|
|
66
|
+
availableRegions: [
|
|
67
|
+
"ES"
|
|
68
|
+
],
|
|
69
|
+
testUtterance: "Hola, em dic {name} i sóc una veu catalana"
|
|
70
|
+
},
|
|
71
|
+
cmn: {
|
|
72
|
+
defaultRegion: "CN",
|
|
73
|
+
availableRegions: [
|
|
74
|
+
"CN",
|
|
75
|
+
"CTW",
|
|
76
|
+
"TW"
|
|
77
|
+
],
|
|
78
|
+
testUtterance: "你好,我的名字是 {name},我是普通话配音。"
|
|
79
|
+
},
|
|
80
|
+
cs: {
|
|
81
|
+
defaultRegion: "CZ",
|
|
82
|
+
availableRegions: [
|
|
83
|
+
"CZ"
|
|
84
|
+
],
|
|
85
|
+
testUtterance: "Dobrý den, jmenuji se {name} a jsem český hlas."
|
|
86
|
+
},
|
|
87
|
+
da: {
|
|
88
|
+
defaultRegion: "DK",
|
|
89
|
+
availableRegions: [
|
|
90
|
+
"DK"
|
|
91
|
+
],
|
|
92
|
+
testUtterance: "Hej, mit navn er {name} og jeg er en dansk stemme."
|
|
93
|
+
},
|
|
94
|
+
de: {
|
|
95
|
+
defaultRegion: "DE",
|
|
96
|
+
availableRegions: [
|
|
97
|
+
"AT",
|
|
98
|
+
"CH",
|
|
99
|
+
"DE"
|
|
100
|
+
],
|
|
101
|
+
testUtterance: "Hallo, mein Name ist {name} und ich bin eine deutsche Stimme."
|
|
102
|
+
},
|
|
103
|
+
el: {
|
|
104
|
+
defaultRegion: "GR",
|
|
105
|
+
availableRegions: [
|
|
106
|
+
"GR"
|
|
107
|
+
],
|
|
108
|
+
testUtterance: "Γεια σας, με λένε {name} και είμαι ελληνική φωνή."
|
|
109
|
+
},
|
|
110
|
+
en: {
|
|
111
|
+
defaultRegion: "US",
|
|
112
|
+
availableRegions: [
|
|
113
|
+
"AU",
|
|
114
|
+
"CA",
|
|
115
|
+
"GB",
|
|
116
|
+
"HK",
|
|
117
|
+
"IE",
|
|
118
|
+
"IN",
|
|
119
|
+
"KE",
|
|
120
|
+
"NG",
|
|
121
|
+
"NZ",
|
|
122
|
+
"PH",
|
|
123
|
+
"SG",
|
|
124
|
+
"TZ",
|
|
125
|
+
"US",
|
|
126
|
+
"ZA"
|
|
127
|
+
],
|
|
128
|
+
testUtterance: "Hello, my name is {name} and I am an English voice."
|
|
129
|
+
},
|
|
130
|
+
es: {
|
|
131
|
+
defaultRegion: "ES",
|
|
132
|
+
availableRegions: [
|
|
133
|
+
"AR",
|
|
134
|
+
"BO",
|
|
135
|
+
"CL",
|
|
136
|
+
"CO",
|
|
137
|
+
"CR",
|
|
138
|
+
"CU",
|
|
139
|
+
"DO",
|
|
140
|
+
"EC",
|
|
141
|
+
"ES",
|
|
142
|
+
"GQ",
|
|
143
|
+
"GT",
|
|
144
|
+
"HN",
|
|
145
|
+
"MX",
|
|
146
|
+
"NI",
|
|
147
|
+
"PA",
|
|
148
|
+
"PE",
|
|
149
|
+
"PR",
|
|
150
|
+
"PY",
|
|
151
|
+
"SV",
|
|
152
|
+
"US",
|
|
153
|
+
"UY",
|
|
154
|
+
"VE"
|
|
155
|
+
],
|
|
156
|
+
testUtterance: "Hola, mi nombre es {name} y soy una voz española."
|
|
157
|
+
},
|
|
158
|
+
eu: {
|
|
159
|
+
defaultRegion: "ES",
|
|
160
|
+
availableRegions: [
|
|
161
|
+
"ES"
|
|
162
|
+
],
|
|
163
|
+
testUtterance: "Kaixo, nire izena {name} da eta euskal ahotsa naiz."
|
|
164
|
+
},
|
|
165
|
+
fa: {
|
|
166
|
+
defaultRegion: "IR",
|
|
167
|
+
availableRegions: [
|
|
168
|
+
"IR"
|
|
169
|
+
],
|
|
170
|
+
testUtterance: "سلام اسم من {name} و صدای فارسی هستم"
|
|
171
|
+
},
|
|
172
|
+
fi: {
|
|
173
|
+
defaultRegion: "FI",
|
|
174
|
+
availableRegions: [
|
|
175
|
+
"FI"
|
|
176
|
+
],
|
|
177
|
+
testUtterance: "Hei, nimeni on {name} ja olen suomalainen ääni."
|
|
178
|
+
},
|
|
179
|
+
fr: {
|
|
180
|
+
defaultRegion: "FR",
|
|
181
|
+
availableRegions: [
|
|
182
|
+
"BE",
|
|
183
|
+
"CA",
|
|
184
|
+
"CH",
|
|
185
|
+
"FR"
|
|
186
|
+
],
|
|
187
|
+
testUtterance: "Bonjour, mon nom est {name} et je suis une voix française."
|
|
188
|
+
},
|
|
189
|
+
gl: {
|
|
190
|
+
defaultRegion: "ES",
|
|
191
|
+
availableRegions: [
|
|
192
|
+
"ES"
|
|
193
|
+
],
|
|
194
|
+
testUtterance: "Ola, chámome {name} e son unha voz galega."
|
|
195
|
+
},
|
|
196
|
+
he: {
|
|
197
|
+
defaultRegion: "IL",
|
|
198
|
+
availableRegions: [
|
|
199
|
+
"IL"
|
|
200
|
+
],
|
|
201
|
+
testUtterance: "שלום, שמי {name} ואני קול עברי."
|
|
202
|
+
},
|
|
203
|
+
hi: {
|
|
204
|
+
defaultRegion: "IN",
|
|
205
|
+
availableRegions: [
|
|
206
|
+
"IN"
|
|
207
|
+
],
|
|
208
|
+
testUtterance: "नमस्कार, मेरा नाम {name} है और मैं एक हिंदी आवाज़ हूँ।"
|
|
209
|
+
},
|
|
210
|
+
hr: {
|
|
211
|
+
defaultRegion: "HR",
|
|
212
|
+
availableRegions: [
|
|
213
|
+
"HR"
|
|
214
|
+
],
|
|
215
|
+
testUtterance: "Pozdrav, ja sam {name} i hrvatski sam glas."
|
|
216
|
+
},
|
|
217
|
+
hu: {
|
|
218
|
+
defaultRegion: "HU",
|
|
219
|
+
availableRegions: [
|
|
220
|
+
"HU"
|
|
221
|
+
],
|
|
222
|
+
testUtterance: "Helló, a nevem {name} és magyar hangú vagyok."
|
|
223
|
+
},
|
|
224
|
+
id: {
|
|
225
|
+
defaultRegion: "ID",
|
|
226
|
+
availableRegions: [
|
|
227
|
+
"ID"
|
|
228
|
+
],
|
|
229
|
+
testUtterance: "Halo, nama saya {name} dan saya suara Indonesia."
|
|
230
|
+
},
|
|
231
|
+
it: {
|
|
232
|
+
defaultRegion: "IT",
|
|
233
|
+
availableRegions: [
|
|
234
|
+
"IT"
|
|
235
|
+
],
|
|
236
|
+
testUtterance: "Ciao, mi chiamo {name} e sono una voce italiana."
|
|
237
|
+
},
|
|
238
|
+
ja: {
|
|
239
|
+
defaultRegion: "JP",
|
|
240
|
+
availableRegions: [
|
|
241
|
+
"JP"
|
|
242
|
+
],
|
|
243
|
+
testUtterance: "こんにちは。私の名前は{name}で、日本語の声を担当しています。"
|
|
244
|
+
},
|
|
245
|
+
kk: {
|
|
246
|
+
defaultRegion: "KZ",
|
|
247
|
+
availableRegions: [
|
|
248
|
+
"KZ"
|
|
249
|
+
],
|
|
250
|
+
testUtterance: "Sälemetsiz be, meniñ atım {name} jäne men qazaq dawısımın."
|
|
251
|
+
},
|
|
252
|
+
kn: {
|
|
253
|
+
defaultRegion: "IN",
|
|
254
|
+
availableRegions: [
|
|
255
|
+
"IN"
|
|
256
|
+
],
|
|
257
|
+
testUtterance: "ಹಲೋ, ನನ್ನ ಹೆಸರು {name} ಮತ್ತು ನಾನು ಕನ್ನಡ ಧ್ವನಿ."
|
|
258
|
+
},
|
|
259
|
+
ko: {
|
|
260
|
+
defaultRegion: "KR",
|
|
261
|
+
availableRegions: [
|
|
262
|
+
"KR"
|
|
263
|
+
],
|
|
264
|
+
testUtterance: "안녕하세요, 저는 {name}이고 한국어 음성입니다."
|
|
265
|
+
},
|
|
266
|
+
mr: {
|
|
267
|
+
defaultRegion: "IN",
|
|
268
|
+
availableRegions: [
|
|
269
|
+
"IN"
|
|
270
|
+
],
|
|
271
|
+
testUtterance: "नमस्कार, माझे नाव {name} आहे आणि मी एक मराठी आवाज आहे."
|
|
272
|
+
},
|
|
273
|
+
ms: {
|
|
274
|
+
defaultRegion: "MY",
|
|
275
|
+
availableRegions: [
|
|
276
|
+
"MY"
|
|
277
|
+
],
|
|
278
|
+
testUtterance: "Hello, nama saya {name} dan saya suara Melayu."
|
|
279
|
+
},
|
|
280
|
+
nb: {
|
|
281
|
+
defaultRegion: "NO",
|
|
282
|
+
availableRegions: [
|
|
283
|
+
"NO"
|
|
284
|
+
],
|
|
285
|
+
testUtterance: "Hei, jeg heter {name} og er en norsk stemme."
|
|
286
|
+
},
|
|
287
|
+
nl: {
|
|
288
|
+
defaultRegion: "NL",
|
|
289
|
+
availableRegions: [
|
|
290
|
+
"BE",
|
|
291
|
+
"NL"
|
|
292
|
+
],
|
|
293
|
+
testUtterance: "Hallo, mijn naam is {name} en ik ben een Nederlandse stem."
|
|
294
|
+
},
|
|
295
|
+
pl: {
|
|
296
|
+
defaultRegion: "PL",
|
|
297
|
+
availableRegions: [
|
|
298
|
+
"PL"
|
|
299
|
+
],
|
|
300
|
+
testUtterance: "Cześć, nazywam się {name} i mam polski głos."
|
|
301
|
+
},
|
|
302
|
+
pt: {
|
|
303
|
+
defaultRegion: "BR",
|
|
304
|
+
availableRegions: [
|
|
305
|
+
"BR",
|
|
306
|
+
"PT"
|
|
307
|
+
],
|
|
308
|
+
testUtterance: "Olá, o meu nome é {name} e sou uma voz portuguesa."
|
|
309
|
+
},
|
|
310
|
+
ro: {
|
|
311
|
+
defaultRegion: "RO",
|
|
312
|
+
availableRegions: [
|
|
313
|
+
"RO"
|
|
314
|
+
],
|
|
315
|
+
testUtterance: "Buna ziua, ma numesc {name} si sunt o voce romaneasca."
|
|
316
|
+
},
|
|
317
|
+
ru: {
|
|
318
|
+
defaultRegion: "RU",
|
|
319
|
+
availableRegions: [
|
|
320
|
+
"RU"
|
|
321
|
+
],
|
|
322
|
+
testUtterance: "Здравствуйте, меня зовут {name} и я русский голос."
|
|
323
|
+
},
|
|
324
|
+
sk: {
|
|
325
|
+
defaultRegion: "SK",
|
|
326
|
+
availableRegions: [
|
|
327
|
+
"SK"
|
|
328
|
+
],
|
|
329
|
+
testUtterance: "Dobrý deň, volám sa {name} a som slovenský hlas."
|
|
330
|
+
},
|
|
331
|
+
sl: {
|
|
332
|
+
defaultRegion: "SI",
|
|
333
|
+
availableRegions: [
|
|
334
|
+
"SI"
|
|
335
|
+
],
|
|
336
|
+
testUtterance: "Pozdravljeni, moje ime je {name} in sem slovenski glas."
|
|
337
|
+
},
|
|
338
|
+
sv: {
|
|
339
|
+
defaultRegion: "SE",
|
|
340
|
+
availableRegions: [
|
|
341
|
+
"SE"
|
|
342
|
+
],
|
|
343
|
+
testUtterance: "Hej, jag heter {name} och jag är en svensk röst."
|
|
344
|
+
},
|
|
345
|
+
ta: {
|
|
346
|
+
defaultRegion: "IN",
|
|
347
|
+
availableRegions: [
|
|
348
|
+
"IN",
|
|
349
|
+
"LK",
|
|
350
|
+
"MY",
|
|
351
|
+
"SG"
|
|
352
|
+
],
|
|
353
|
+
testUtterance: "வணக்கம், என் பெயர் {name} மற்றும் நான் ஒரு தமிழ் குரல்"
|
|
354
|
+
},
|
|
355
|
+
te: {
|
|
356
|
+
defaultRegion: "IN",
|
|
357
|
+
availableRegions: [
|
|
358
|
+
"IN"
|
|
359
|
+
],
|
|
360
|
+
testUtterance: "హలో, నా పేరు {name} మరియు నేను తెలుగు వాణిని."
|
|
361
|
+
},
|
|
362
|
+
th: {
|
|
363
|
+
defaultRegion: "TH",
|
|
364
|
+
availableRegions: [
|
|
365
|
+
"TH"
|
|
366
|
+
],
|
|
367
|
+
testUtterance: "สวัสดีค่ะ ฉันชื่อ {name} และฉันเป็นคนมีเสียงภาษาไทย"
|
|
368
|
+
},
|
|
369
|
+
tr: {
|
|
370
|
+
defaultRegion: "TR",
|
|
371
|
+
availableRegions: [
|
|
372
|
+
"TR"
|
|
373
|
+
],
|
|
374
|
+
testUtterance: "Merhaba, adım {name} ve Türk sesiyim."
|
|
375
|
+
},
|
|
376
|
+
uk: {
|
|
377
|
+
defaultRegion: "UA",
|
|
378
|
+
availableRegions: [
|
|
379
|
+
"UA"
|
|
380
|
+
],
|
|
381
|
+
testUtterance: "Здравствуйте, меня зовут {name} и я украинский голос."
|
|
382
|
+
},
|
|
383
|
+
vi: {
|
|
384
|
+
defaultRegion: "VN",
|
|
385
|
+
availableRegions: [
|
|
386
|
+
"VN"
|
|
387
|
+
],
|
|
388
|
+
testUtterance: "Xin chào, tôi tên là {name} và tôi là giọng nói tiếng Việt."
|
|
389
|
+
},
|
|
390
|
+
wuu: {
|
|
391
|
+
defaultRegion: "CN",
|
|
392
|
+
availableRegions: [
|
|
393
|
+
"CN"
|
|
394
|
+
],
|
|
395
|
+
testUtterance: "你好,我的名字是 {name},我是吴语配音。"
|
|
396
|
+
},
|
|
397
|
+
yue: {
|
|
398
|
+
defaultRegion: "HK",
|
|
399
|
+
availableRegions: [
|
|
400
|
+
"HK"
|
|
401
|
+
],
|
|
402
|
+
testUtterance: "你好,我叫 {name},係越中文聲。"
|
|
403
|
+
}
|
|
404
|
+
}, me = /* @__PURE__ */ new Map(), Nt = /* @__PURE__ */ Object.assign({ "../../json/ar.json": () => import("./ar-CJhBAgKq.js"), "../../json/bg.json": () => import("./bg-JvP4LoOT.js"), "../../json/bho.json": () => import("./bho-CpuLBMN3.js"), "../../json/bn.json": () => import("./bn-84u93pMd.js"), "../../json/ca.json": () => import("./ca-DdScTbex.js"), "../../json/cmn.json": () => import("./cmn-Dd1zrvTE.js"), "../../json/cs.json": () => import("./cs-CDMne0uc.js"), "../../json/da.json": () => import("./da-oFf4cHgj.js"), "../../json/de.json": () => import("./de-Bjgc3bVq.js"), "../../json/el.json": () => import("./el-FkKIcghI.js"), "../../json/en.json": () => import("./en-DCQHxNny.js"), "../../json/es.json": () => import("./es-CDjjngpC.js"), "../../json/eu.json": () => import("./eu-DxWirHU-.js"), "../../json/fa.json": () => import("./fa-CTVUniYi.js"), "../../json/fi.json": () => import("./fi-Do6QFzRv.js"), "../../json/fr.json": () => import("./fr-B5-P9o29.js"), "../../json/gl.json": () => import("./gl-DqSXeC_F.js"), "../../json/he.json": () => import("./he-CpyNwgaH.js"), "../../json/hi.json": () => import("./hi-CeOBacbl.js"), "../../json/hr.json": () => import("./hr-CSpU18l6.js"), "../../json/hu.json": () => import("./hu-oONHmpR6.js"), "../../json/id.json": () => import("./id-BpZuB5Iw.js"), "../../json/it.json": () => import("./it-CM4X84UA.js"), "../../json/ja.json": () => import("./ja-e-iw3c4_.js"), "../../json/kk.json": () => import("./kk-BdLCAb2s.js"), "../../json/kn.json": () => import("./kn-BYRvouO5.js"), "../../json/ko.json": () => import("./ko-EIouMDK1.js"), "../../json/mr.json": () => import("./mr-DN-hwEV1.js"), "../../json/ms.json": () => import("./ms-B5E3oaWE.js"), "../../json/nb.json": () => import("./nb-DOw05HBh.js"), "../../json/nl.json": () => import("./nl-CEydw4A9.js"), "../../json/pl.json": () => import("./pl-Ivj_eAP7.js"), "../../json/pt.json": () => import("./pt-BPEGqRmW.js"), "../../json/ro.json": () => import("./ro-BQ617SOx.js"), "../../json/ru.json": () => import("./ru-Dieeph4H.js"), "../../json/sk.json": () => import("./sk-pEiOt4GQ.js"), "../../json/sl.json": () => import("./sl-Z6jWAR8J.js"), "../../json/sv.json": () => import("./sv-BT09piiZ.js"), "../../json/ta.json": () => import("./ta-B0YMGW5q.js"), "../../json/te.json": () => import("./te-ax-HNsAY.js"), "../../json/th.json": () => import("./th-C7Dbxwoz.js"), "../../json/tr.json": () => import("./tr-mipEichO.js"), "../../json/uk.json": () => import("./uk-CHdx7DHz.js"), "../../json/vi.json": () => import("./vi-DrlcEwAD.js"), "../../json/wuu.json": () => import("./wuu-C6uQvT6g.js"), "../../json/yue.json": () => import("./yue-CFroa59o.js") });
|
|
405
|
+
async function Lt(e) {
|
|
406
|
+
try {
|
|
407
|
+
const t = e.split("-")[0], r = Nt[`../../json/${t}.json`];
|
|
408
|
+
if (!r)
|
|
409
|
+
throw new Error(`No voice data found for language: ${e}`);
|
|
410
|
+
const i = (await r()).default;
|
|
411
|
+
return {
|
|
412
|
+
...i,
|
|
413
|
+
voices: i.voices.map(It)
|
|
414
|
+
};
|
|
415
|
+
} catch (t) {
|
|
416
|
+
return console.warn(`Failed to load voice data for ${e}:`, t), {
|
|
417
|
+
language: e,
|
|
418
|
+
defaultRegion: "",
|
|
419
|
+
testUtterance: "",
|
|
420
|
+
voices: []
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
function ze(e) {
|
|
425
|
+
return me.has(e) || me.set(e, Lt(e)), me.get(e);
|
|
426
|
+
}
|
|
427
|
+
const It = (e) => ({
|
|
428
|
+
...e,
|
|
429
|
+
gender: e.gender,
|
|
430
|
+
quality: e.quality ? Array.isArray(e.quality) ? e.quality.filter(
|
|
431
|
+
(t) => ["veryLow", "low", "normal", "high", "veryHigh"].includes(t)
|
|
432
|
+
) : [e.quality].filter(
|
|
433
|
+
(t) => ["veryLow", "low", "normal", "high", "veryHigh"].includes(t)
|
|
434
|
+
) : void 0,
|
|
435
|
+
localizedName: e.localizedName && ["android", "apple"].includes(e.localizedName) ? e.localizedName : void 0
|
|
436
|
+
}), re = {
|
|
437
|
+
cmn: "cmn",
|
|
438
|
+
"cmn-CN": "cmn-CN",
|
|
439
|
+
"cmn-TW": "cmn-TW",
|
|
440
|
+
zh: "cmn",
|
|
441
|
+
"zh-CN": "cmn-CN",
|
|
442
|
+
"zh-TW": "cmn-TW",
|
|
443
|
+
yue: "yue",
|
|
444
|
+
"yue-HK": "yue-HK",
|
|
445
|
+
"zh-HK": "yue-HK",
|
|
446
|
+
wuu: "wuu",
|
|
447
|
+
"wuu-CN": "wuu-CN"
|
|
448
|
+
}, j = (e) => {
|
|
449
|
+
if (!e) return "";
|
|
450
|
+
let t = e.toLowerCase().replace(/_/g, "-");
|
|
451
|
+
if (/\w{2,3}-\w{2,3}/.test(t)) {
|
|
452
|
+
const [r, n] = t.split("-");
|
|
453
|
+
t = `${r.toLowerCase()}-${n.toUpperCase()}`;
|
|
454
|
+
}
|
|
455
|
+
return re[t] || t;
|
|
456
|
+
}, Re = async (e) => {
|
|
457
|
+
if (!e) return [];
|
|
458
|
+
try {
|
|
459
|
+
const t = j(e);
|
|
460
|
+
try {
|
|
461
|
+
const n = await ze(t);
|
|
462
|
+
if (n?.voices?.length)
|
|
463
|
+
return n.voices;
|
|
464
|
+
} catch (n) {
|
|
465
|
+
console.warn(`Failed to load voices for ${t}:`, n);
|
|
466
|
+
}
|
|
467
|
+
const [r] = F(t);
|
|
468
|
+
if (r !== t)
|
|
469
|
+
try {
|
|
470
|
+
const n = await ze(r);
|
|
471
|
+
if (n?.voices?.length)
|
|
472
|
+
return n.voices;
|
|
473
|
+
} catch (n) {
|
|
474
|
+
console.warn(`Failed to load voices for base language ${r}:`, n);
|
|
475
|
+
}
|
|
476
|
+
return [];
|
|
477
|
+
} catch (t) {
|
|
478
|
+
return console.error(`Error in getVoices for ${e}:`, t), [];
|
|
479
|
+
}
|
|
480
|
+
}, _e = (e) => {
|
|
481
|
+
if (!e) return "";
|
|
482
|
+
try {
|
|
483
|
+
const t = j(e), r = x[t];
|
|
484
|
+
if (r?.testUtterance)
|
|
485
|
+
return r.testUtterance;
|
|
486
|
+
if (t in re) {
|
|
487
|
+
const i = re[t];
|
|
488
|
+
if (i && x[i]?.testUtterance)
|
|
489
|
+
return x[i].testUtterance;
|
|
490
|
+
}
|
|
491
|
+
const [n] = F(t);
|
|
492
|
+
return n !== t && x[n]?.testUtterance ? x[n].testUtterance : "";
|
|
493
|
+
} catch (t) {
|
|
494
|
+
return console.error(`Error in getTestUtterance for ${e}:`, t), "";
|
|
495
|
+
}
|
|
496
|
+
}, le = (e) => {
|
|
497
|
+
if (!e) return "";
|
|
498
|
+
try {
|
|
499
|
+
const t = j(e), r = x[t];
|
|
500
|
+
if (r?.defaultRegion)
|
|
501
|
+
return `${t}-${r.defaultRegion}`;
|
|
502
|
+
if (t in re) {
|
|
503
|
+
const i = re[t];
|
|
504
|
+
if (i) {
|
|
505
|
+
const s = x[i];
|
|
506
|
+
if (s?.defaultRegion)
|
|
507
|
+
return `${i}-${s.defaultRegion}`;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
const [n] = F(t);
|
|
511
|
+
if (n !== t) {
|
|
512
|
+
const i = x[n];
|
|
513
|
+
if (i?.defaultRegion)
|
|
514
|
+
return `${n}-${i.defaultRegion}`;
|
|
515
|
+
}
|
|
516
|
+
return "";
|
|
517
|
+
} catch (t) {
|
|
518
|
+
return console.error(`Failed to get default region for ${e}:`, t), "";
|
|
519
|
+
}
|
|
520
|
+
}, Ge = (e) => {
|
|
521
|
+
if (!e?.length) return [];
|
|
522
|
+
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
523
|
+
for (const [i, s] of e.entries()) {
|
|
524
|
+
if (!s) continue;
|
|
525
|
+
const u = j(s), [a, c] = F(u);
|
|
526
|
+
c && (t.add(c), n.has(c) || n.set(c, i)), r.has(a) || r.set(a, /* @__PURE__ */ new Set()), c && r.get(a).add(c);
|
|
527
|
+
}
|
|
528
|
+
return Array.from(r.entries()).map(([i, s]) => {
|
|
529
|
+
const u = new Set(
|
|
530
|
+
x[i]?.availableRegions || []
|
|
531
|
+
), a = Array.from(s), c = Array.from(t).filter(
|
|
532
|
+
(g) => u.has(g) && !a.includes(g)
|
|
533
|
+
), l = Array.from(/* @__PURE__ */ new Set([...a, ...c])).sort((g, p) => {
|
|
534
|
+
const h = n.get(g) ?? Number.MAX_SAFE_INTEGER, d = n.get(p) ?? Number.MAX_SAFE_INTEGER;
|
|
535
|
+
return h - d;
|
|
536
|
+
});
|
|
537
|
+
if (l.length === 0) {
|
|
538
|
+
const g = le(i), [, p] = F(g);
|
|
539
|
+
p && l.push(p);
|
|
540
|
+
}
|
|
541
|
+
return {
|
|
542
|
+
baseLang: i,
|
|
543
|
+
regions: l
|
|
544
|
+
};
|
|
545
|
+
});
|
|
546
|
+
};
|
|
547
|
+
async function ie(e) {
|
|
548
|
+
const t = /* @__PURE__ */ new Map();
|
|
549
|
+
for (const n of e) {
|
|
550
|
+
if (n.source !== "json") continue;
|
|
551
|
+
const [i] = F(n.language);
|
|
552
|
+
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
553
|
+
}
|
|
554
|
+
const r = /* @__PURE__ */ new Map();
|
|
555
|
+
for (const [n, i] of t.entries()) {
|
|
556
|
+
const s = /* @__PURE__ */ new Map(), u = await Re(n), a = /* @__PURE__ */ new Map();
|
|
557
|
+
u.forEach((c, l) => {
|
|
558
|
+
a.set(c.name.toLowerCase(), l), c.altNames?.forEach((g) => {
|
|
559
|
+
a.set(g.toLowerCase(), l);
|
|
560
|
+
});
|
|
561
|
+
});
|
|
562
|
+
for (const c of i) {
|
|
563
|
+
const l = c.name.toLowerCase(), g = a.get(l);
|
|
564
|
+
g !== void 0 && s.set(c.name, g);
|
|
565
|
+
}
|
|
566
|
+
s.size > 0 && r.set(n, s);
|
|
567
|
+
}
|
|
568
|
+
return r;
|
|
569
|
+
}
|
|
570
|
+
const xt = [{ 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 }], jt = {
|
|
571
|
+
voices: xt
|
|
572
|
+
}, Pt = [{ 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 }], Ut = {
|
|
573
|
+
voices: Pt
|
|
574
|
+
}, Dt = jt, Bt = Ut, Ce = (e, t) => Dt.voices.some(
|
|
575
|
+
(r) => e.includes(r.name) || t && r.nativeID?.some((n) => t.includes(n)) || r.altNames?.some((n) => e.includes(n))
|
|
576
|
+
), Ee = (e, t) => Bt.voices.some(
|
|
577
|
+
(r) => e.includes(r.name)
|
|
578
|
+
) || t === "veryLow", Me = (e) => e?.length ? e.filter((t) => !(t.isNovelty || Ce(t.name, t.voiceURI))) : [], We = (e) => e?.length ? e.filter((t) => !Ee(t.name, t.quality)) : [], Ft = { 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" } }, $t = {
|
|
579
|
+
quality: Ft
|
|
580
|
+
}, qe = {
|
|
581
|
+
apple: $t.quality
|
|
582
|
+
// android: androidQualities.quality
|
|
583
|
+
}, Ht = (e, t, r) => {
|
|
584
|
+
if (!e) return;
|
|
585
|
+
const n = Array.isArray(r) ? r : r ? [r] : [];
|
|
586
|
+
for (const i of n)
|
|
587
|
+
if (i && qe[i]) {
|
|
588
|
+
const s = qe[i], u = F(t)[0], a = s[t] || s[u];
|
|
589
|
+
if (a) {
|
|
590
|
+
const c = e.toLowerCase(), { normal: l, high: g } = a;
|
|
591
|
+
if (g && c.includes(g.toLowerCase()))
|
|
592
|
+
return "high";
|
|
593
|
+
if (l && c.includes(l.toLowerCase()))
|
|
594
|
+
return "normal";
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}, Vt = (e, t) => {
|
|
598
|
+
const r = qe[t];
|
|
599
|
+
if (r)
|
|
600
|
+
for (const [n, { high: i, normal: s }] of Object.entries(r)) {
|
|
601
|
+
const u = i && e.some((c) => c.includes(i)), a = s && e.some((c) => c.includes(s));
|
|
602
|
+
if (u && a)
|
|
603
|
+
return n;
|
|
604
|
+
}
|
|
605
|
+
}, zt = {
|
|
606
|
+
low: {
|
|
607
|
+
values: ["super-compact", "compact"],
|
|
608
|
+
quality: "low"
|
|
609
|
+
},
|
|
610
|
+
normal: {
|
|
611
|
+
values: ["enhanced"],
|
|
612
|
+
quality: "normal"
|
|
613
|
+
},
|
|
614
|
+
high: {
|
|
615
|
+
values: ["premium"],
|
|
616
|
+
quality: "high"
|
|
617
|
+
}
|
|
618
|
+
}, Je = (e) => {
|
|
619
|
+
if (!e) return;
|
|
620
|
+
const r = e.toLowerCase().split(/[._-]/);
|
|
621
|
+
for (const n of Object.values(zt))
|
|
622
|
+
if (n.values.some((i) => r.includes(i)))
|
|
623
|
+
return n.quality;
|
|
624
|
+
};
|
|
625
|
+
function _t(e, t) {
|
|
626
|
+
if (e.name === e.originalName) return e;
|
|
627
|
+
if (t.name === t.originalName) return t;
|
|
628
|
+
const r = [e.originalName, ...e.altNames || []], n = [t.originalName, ...t.altNames || []], i = r.findIndex((u) => n.includes(u)), s = n.findIndex((u) => r.includes(u));
|
|
629
|
+
return i === -1 && s === -1 || i !== -1 && (s === -1 || i <= s) ? e : t;
|
|
630
|
+
}
|
|
631
|
+
function Gt(e, t) {
|
|
632
|
+
if (!e.altNames && !t.altNames)
|
|
633
|
+
return !1;
|
|
634
|
+
const r = e.originalName, n = t.originalName, i = e.altNames || [], s = t.altNames || [];
|
|
635
|
+
return s.includes(r) || i.includes(n) ? !0 : i.filter((a) => s.includes(a)).length > 0;
|
|
636
|
+
}
|
|
637
|
+
class S {
|
|
638
|
+
static instance;
|
|
639
|
+
static initializationPromise = null;
|
|
640
|
+
systemLocale;
|
|
641
|
+
voices = [];
|
|
642
|
+
browserVoices = [];
|
|
643
|
+
isInitialized = !1;
|
|
644
|
+
constructor() {
|
|
645
|
+
if (typeof window > "u" || !window.speechSynthesis)
|
|
646
|
+
throw new Error("Web Speech API is not available in this environment");
|
|
647
|
+
this.systemLocale = navigator.languages?.[0]?.split("-")[0] || "en";
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Initialize voice manager
|
|
651
|
+
* @param options Configuration options for voice loading
|
|
652
|
+
* @param options.languages Optional array of preferred language codes to filter voices during initialization
|
|
653
|
+
* @param options.maxTimeout Maximum time in milliseconds to wait for voices to load (passed to getBrowserVoices)
|
|
654
|
+
* @param options.interval Interval in milliseconds between voice loading checks (passed to getBrowserVoices)
|
|
655
|
+
* @returns Promise that resolves with the WebSpeechVoiceManager instance
|
|
656
|
+
*/
|
|
657
|
+
static async initialize(t) {
|
|
658
|
+
return S.instance?.isInitialized ? S.instance : (S.initializationPromise || (S.initializationPromise = (async () => {
|
|
659
|
+
try {
|
|
660
|
+
const r = new S();
|
|
661
|
+
S.instance = r, r.browserVoices = await r.getBrowserVoices(t?.maxTimeout, t?.interval), r.updateSystemLocale(r.browserVoices);
|
|
662
|
+
let n = r.browserVoices;
|
|
663
|
+
return t?.languages && t.languages.length > 0 && (n = r.filterBrowserVoicesByLanguages(r.browserVoices, t.languages)), r.voices = await r.parseToReadiumSpeechVoices(n), r.isInitialized = !0, r;
|
|
664
|
+
} catch (r) {
|
|
665
|
+
throw S.initializationPromise = null, console.error("Failed to initialize WebSpeechVoiceManager:", r), r;
|
|
666
|
+
}
|
|
667
|
+
})()), S.initializationPromise);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Filter browser voices based on preferred languages
|
|
671
|
+
* @private
|
|
672
|
+
*/
|
|
673
|
+
filterBrowserVoicesByLanguages(t, r) {
|
|
674
|
+
if (!r?.length) return t;
|
|
675
|
+
const n = new Set(
|
|
676
|
+
r.map((i) => {
|
|
677
|
+
const s = j(i), [u] = S.extractLangRegionFromBCP47(s);
|
|
678
|
+
return u;
|
|
679
|
+
})
|
|
680
|
+
);
|
|
681
|
+
return t.filter((i) => {
|
|
682
|
+
if (!i?.lang) return !1;
|
|
683
|
+
const s = j(i.lang), [u] = S.extractLangRegionFromBCP47(s);
|
|
684
|
+
return n.has(u);
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Extract language and region from BCP47 language tag
|
|
689
|
+
* @param lang - The BCP47 language tag (e.g., "en-US", "zh-CN")
|
|
690
|
+
* @returns A tuple of [language, region] where language is lowercase and region is UPPERCASE
|
|
691
|
+
*/
|
|
692
|
+
static extractLangRegionFromBCP47(t) {
|
|
693
|
+
return F(t);
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Get display name for a language code
|
|
697
|
+
* @private
|
|
698
|
+
*/
|
|
699
|
+
static getLanguageDisplayName(t, r) {
|
|
700
|
+
try {
|
|
701
|
+
return new Intl.DisplayNames(
|
|
702
|
+
r ? [r] : [],
|
|
703
|
+
{ type: "language", languageDisplay: "standard" }
|
|
704
|
+
).of(t) || t.toUpperCase();
|
|
705
|
+
} catch {
|
|
706
|
+
return t.toUpperCase();
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Clean voice name by removing specific formatting
|
|
711
|
+
* @private
|
|
712
|
+
*/
|
|
713
|
+
cleanVoiceName(t) {
|
|
714
|
+
return t ? t.replace(/\s*\([^)]*\)/g, "").replace(/[^\p{L}\p{N}\s-]/gu, "").replace(/\s+/g, " ").trim() : "";
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Normalize voice name for comparison by removing common variations
|
|
718
|
+
* @private
|
|
719
|
+
*/
|
|
720
|
+
normalizeVoiceName(t) {
|
|
721
|
+
return this.cleanVoiceName(t.toLowerCase());
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Count occurrences of each voice based on language and normalized name
|
|
725
|
+
* @private
|
|
726
|
+
*/
|
|
727
|
+
countVoiceDuplicates(t) {
|
|
728
|
+
const r = /* @__PURE__ */ new Map();
|
|
729
|
+
for (const n of t) {
|
|
730
|
+
if (!n?.name || !n?.lang) continue;
|
|
731
|
+
const i = `${n.lang.toLowerCase()}_${this.normalizeVoiceName(n.name)}`;
|
|
732
|
+
r.set(i, (r.get(i) || 0) + 1);
|
|
733
|
+
}
|
|
734
|
+
return r;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Updates the system locale based on available voices by detecting quality indicators.
|
|
738
|
+
* The method extracts voice names and attempts to find a matching locale with both
|
|
739
|
+
* high and normal quality indicators. If found, updates the systemLocale property.
|
|
740
|
+
*
|
|
741
|
+
* @param voices - Array of SpeechSynthesisVoice objects to analyze for locale detection
|
|
742
|
+
* @returns void - Updates the systemLocale property if a matching locale is found
|
|
743
|
+
*/
|
|
744
|
+
updateSystemLocale(t) {
|
|
745
|
+
if (!t?.length) return;
|
|
746
|
+
const r = t.map((i) => i.name), n = Vt(r, "apple");
|
|
747
|
+
n && (this.systemLocale = n);
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Infer voice quality based on package, platform, JSON, or duplicate count
|
|
751
|
+
* Returns null if quality cannot be determined
|
|
752
|
+
* @private
|
|
753
|
+
*/
|
|
754
|
+
inferVoiceQuality(t, r, n) {
|
|
755
|
+
const i = t.voiceURI ? Je(t.voiceURI) : void 0;
|
|
756
|
+
if (i) return i;
|
|
757
|
+
if (r?.nativeID && Array.isArray(r.nativeID))
|
|
758
|
+
for (const s of r.nativeID) {
|
|
759
|
+
const u = Je(s);
|
|
760
|
+
if (u) return u;
|
|
761
|
+
}
|
|
762
|
+
if (r?.localizedName && t.voiceURI && t.lang) {
|
|
763
|
+
const s = Ht(
|
|
764
|
+
t.voiceURI,
|
|
765
|
+
this.systemLocale,
|
|
766
|
+
r.localizedName
|
|
767
|
+
);
|
|
768
|
+
if (s) return s;
|
|
769
|
+
}
|
|
770
|
+
if (r?.quality && r.quality.length > 0) {
|
|
771
|
+
const s = Math.min(n - 1, r.quality.length - 1), u = r.quality[s];
|
|
772
|
+
if (u)
|
|
773
|
+
return u;
|
|
774
|
+
}
|
|
775
|
+
return null;
|
|
776
|
+
}
|
|
777
|
+
/**
|
|
778
|
+
* Find matching JSON voice by name or alternative names
|
|
779
|
+
* @private
|
|
780
|
+
*/
|
|
781
|
+
findMatchingJsonVoice(t, r) {
|
|
782
|
+
return t.find(
|
|
783
|
+
(n) => this.normalizeVoiceName(n.name) === r || n.altNames?.some((i) => this.normalizeVoiceName(i) === r)
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Remove duplicate voices, keeping the highest quality version of each voice
|
|
788
|
+
* @param voices Array of voices to remove duplicates from
|
|
789
|
+
* @returns Filtered array with duplicates removed, keeping only the highest quality versions
|
|
790
|
+
*/
|
|
791
|
+
removeDuplicates(t) {
|
|
792
|
+
const r = /* @__PURE__ */ new Map();
|
|
793
|
+
for (const n of t) {
|
|
794
|
+
const i = `${n.language.toLowerCase()}_${this.normalizeVoiceName(n.name)}`, s = r.get(i);
|
|
795
|
+
if (!s)
|
|
796
|
+
r.set(i, n);
|
|
797
|
+
else if (Gt(n, s)) {
|
|
798
|
+
const u = _t(n, s);
|
|
799
|
+
r.set(i, u);
|
|
800
|
+
} else {
|
|
801
|
+
const u = S.getQualityValue(s.quality);
|
|
802
|
+
S.getQualityValue(n.quality) >= u && r.set(i, n);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return Array.from(r.values());
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Get test utterance for a given language
|
|
809
|
+
* @param language - Language code (e.g., "en", "fr", "es")
|
|
810
|
+
* @returns Promise that resolves to the test utterance text
|
|
811
|
+
*/
|
|
812
|
+
getTestUtterance(t) {
|
|
813
|
+
if (!t) return "";
|
|
814
|
+
const r = _e(t);
|
|
815
|
+
if (r) return r;
|
|
816
|
+
const [n] = S.extractLangRegionFromBCP47(t);
|
|
817
|
+
if (n && n !== t) {
|
|
818
|
+
const i = _e(n);
|
|
819
|
+
if (i) return i;
|
|
820
|
+
}
|
|
821
|
+
return "";
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Get all voices matching the filter criteria
|
|
825
|
+
* @returns Promise that resolves to an array of filtered voices
|
|
826
|
+
*/
|
|
827
|
+
getVoices(t = {}) {
|
|
828
|
+
if (!this.isInitialized)
|
|
829
|
+
throw new Error("WebSpeechVoiceManager not initialized. Call initialize() first.");
|
|
830
|
+
return this.filterVoices(t, [...this.voices]);
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Get available languages with voice counts
|
|
834
|
+
* @param localization Optional BCP 47 language tag to use for language names
|
|
835
|
+
* @param filterOptions Optional filters to apply to voices before counting languages
|
|
836
|
+
* @param voices Optional array of voices to count (defaults to this.voices)
|
|
837
|
+
*/
|
|
838
|
+
getLanguages(t, r, n) {
|
|
839
|
+
if (!n && !this.isInitialized)
|
|
840
|
+
throw new Error("WebSpeechVoiceManager not initialized. Call initialize() first.");
|
|
841
|
+
const i = n ?? this.voices, s = r ? this.filterVoices(r, i) : i, u = [], a = /* @__PURE__ */ new Set();
|
|
842
|
+
for (const c of s) {
|
|
843
|
+
const g = j(c.language).split("-")[0];
|
|
844
|
+
if (!a.has(g)) {
|
|
845
|
+
const p = S.getLanguageDisplayName(g, t), h = s.filter(
|
|
846
|
+
(d) => j(d.language).split("-")[0] === g
|
|
847
|
+
).length;
|
|
848
|
+
u.push({ code: g, label: p, count: h }), a.add(g);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return n ? u : u.sort((c, l) => c.label.localeCompare(l.label));
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Get available regions with voice counts
|
|
855
|
+
* @param localization Optional BCP 47 language tag to use for region names
|
|
856
|
+
* @param filterOptions Optional filters to apply to voices before counting regions
|
|
857
|
+
* @param voices Optional array of voices to count (defaults to this.voices)
|
|
858
|
+
*/
|
|
859
|
+
getRegions(t, r, n) {
|
|
860
|
+
if (!n && !this.isInitialized)
|
|
861
|
+
throw new Error("WebSpeechVoiceManager not initialized. Call initialize() first.");
|
|
862
|
+
const i = n ?? this.voices, s = r ? this.filterVoices(r, i) : i, u = [], a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
|
|
863
|
+
for (const l of s) {
|
|
864
|
+
const [, g] = S.extractLangRegionFromBCP47(l.language);
|
|
865
|
+
g && c.set(g, (c.get(g) || 0) + 1);
|
|
866
|
+
}
|
|
867
|
+
for (const l of s) {
|
|
868
|
+
const [, g] = S.extractLangRegionFromBCP47(l.language);
|
|
869
|
+
if (g && !a.has(g)) {
|
|
870
|
+
let p = l.language;
|
|
871
|
+
try {
|
|
872
|
+
const h = t || navigator.language;
|
|
873
|
+
p = new Intl.DisplayNames([h], { type: "region" }).of(g) || l.language;
|
|
874
|
+
} catch (h) {
|
|
875
|
+
console.warn(`Failed to get display name for region ${g}`, h);
|
|
876
|
+
}
|
|
877
|
+
u.push({
|
|
878
|
+
code: g,
|
|
879
|
+
label: p,
|
|
880
|
+
count: c.get(g) || 0
|
|
881
|
+
}), a.add(g);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
return n ? u : u.sort((l, g) => l.label.localeCompare(g.label));
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* Get the default voice for language preferences
|
|
888
|
+
* @param languages Array of preferred languages in order of preference, or a single language string
|
|
889
|
+
* @param voices Optional pre-filtered voices array to use instead of fetching voices
|
|
890
|
+
* @returns The default voice for the language, or null if no voices are available
|
|
891
|
+
*/
|
|
892
|
+
async getDefaultVoice(t, r) {
|
|
893
|
+
if (!t) return null;
|
|
894
|
+
const n = Array.isArray(t) ? t : [t];
|
|
895
|
+
let i = r || this.getVoices({ languages: n });
|
|
896
|
+
return i.length ? (i = await this.sortVoicesByRegions(n, i), i[0]) : null;
|
|
897
|
+
}
|
|
898
|
+
getBrowserVoices(t = 1e4, r = 10) {
|
|
899
|
+
const n = () => window.speechSynthesis?.getVoices() || [];
|
|
900
|
+
if (!window.speechSynthesis)
|
|
901
|
+
return Promise.resolve([]);
|
|
902
|
+
const i = n();
|
|
903
|
+
return Array.isArray(i) && i.length ? Promise.resolve(i) : new Promise((s, u) => {
|
|
904
|
+
let a = Math.floor(t / r), c = !1;
|
|
905
|
+
const l = () => {
|
|
906
|
+
if (c) return;
|
|
907
|
+
c = !0;
|
|
908
|
+
const g = () => {
|
|
909
|
+
if (a < 1) return s([]);
|
|
910
|
+
--a;
|
|
911
|
+
const p = n();
|
|
912
|
+
if (Array.isArray(p) && p.length) return s(p);
|
|
913
|
+
setTimeout(g, r);
|
|
914
|
+
};
|
|
915
|
+
setTimeout(g, r);
|
|
916
|
+
};
|
|
917
|
+
window.speechSynthesis.onvoiceschanged !== void 0 ? window.speechSynthesis.onvoiceschanged = () => {
|
|
918
|
+
const g = n();
|
|
919
|
+
Array.isArray(g) && g.length ? s(g) : l();
|
|
920
|
+
} : l(), setTimeout(() => s([]), t);
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Convert SpeechSynthesisVoice array to ReadiumSpeechVoice array
|
|
925
|
+
* @private
|
|
926
|
+
*/
|
|
927
|
+
async parseToReadiumSpeechVoices(t) {
|
|
928
|
+
const r = this.countVoiceDuplicates(t);
|
|
929
|
+
return await Promise.all(
|
|
930
|
+
t.filter((i) => i?.name && i?.lang).map(async (i) => {
|
|
931
|
+
const s = j(i.lang), [u] = S.extractLangRegionFromBCP47(s), a = this.normalizeVoiceName(i.name), c = `${i.lang.toLowerCase()}_${a}`, l = r.get(c) || 1;
|
|
932
|
+
let g = await Re(s);
|
|
933
|
+
(!g || g.length === 0) && (g = await Re(u));
|
|
934
|
+
const p = this.findMatchingJsonVoice(g, a), h = this.inferVoiceQuality(i, p, l);
|
|
935
|
+
return p ? {
|
|
936
|
+
...p,
|
|
937
|
+
source: "json",
|
|
938
|
+
originalName: i.name,
|
|
939
|
+
voiceURI: i.voiceURI,
|
|
940
|
+
quality: h,
|
|
941
|
+
isDefault: i.default || !1,
|
|
942
|
+
offlineAvailability: i.localService || !1,
|
|
943
|
+
isNovelty: Ce(i.name, i.voiceURI),
|
|
944
|
+
isLowQuality: Ee(i.name, h)
|
|
945
|
+
} : {
|
|
946
|
+
source: "browser",
|
|
947
|
+
label: this.cleanVoiceName(i.name),
|
|
948
|
+
name: i.name,
|
|
949
|
+
originalName: i.name,
|
|
950
|
+
language: s,
|
|
951
|
+
voiceURI: i.voiceURI,
|
|
952
|
+
quality: h,
|
|
953
|
+
isDefault: i.default || !1,
|
|
954
|
+
offlineAvailability: i.localService || !1,
|
|
955
|
+
isNovelty: Ce(i.name, i.voiceURI),
|
|
956
|
+
isLowQuality: Ee(i.name, h)
|
|
957
|
+
};
|
|
958
|
+
})
|
|
959
|
+
);
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Convert an ReadiumSpeechVoice to a native SpeechSynthesisVoice
|
|
963
|
+
*/
|
|
964
|
+
convertToSpeechSynthesisVoice(t) {
|
|
965
|
+
if (t)
|
|
966
|
+
return this.browserVoices.find(
|
|
967
|
+
(r) => r.voiceURI === t.voiceURI || r.name === t.originalName || this.normalizeVoiceName(r.name) === this.normalizeVoiceName(t.name)
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Filter voices based on the provided options
|
|
972
|
+
*/
|
|
973
|
+
filterVoices(t, r) {
|
|
974
|
+
let n = r ? [...r] : [...this.voices];
|
|
975
|
+
const i = {
|
|
976
|
+
excludeNovelty: !0,
|
|
977
|
+
// Default to true to filter out novelty voices
|
|
978
|
+
excludeVeryLowQuality: !0,
|
|
979
|
+
// Default to true to filter out very low quality voices
|
|
980
|
+
removeDuplicates: !0,
|
|
981
|
+
// Default to true - remove duplicates by default
|
|
982
|
+
...t
|
|
983
|
+
// Let explicit options override the defaults
|
|
984
|
+
};
|
|
985
|
+
if (i.languages) {
|
|
986
|
+
const s = Array.isArray(i.languages) ? i.languages : [i.languages];
|
|
987
|
+
n = n.filter((u) => s.some((a) => {
|
|
988
|
+
const c = a.toLowerCase(), l = u.language?.toLowerCase(), g = u.altLanguage?.toLowerCase();
|
|
989
|
+
if (l === c || g === c)
|
|
990
|
+
return !0;
|
|
991
|
+
const [p] = c.split("-");
|
|
992
|
+
return l && l.startsWith(p) || g && g.startsWith(p);
|
|
993
|
+
}));
|
|
994
|
+
}
|
|
995
|
+
if (i.source && (n = n.filter((s) => s.source === i.source)), i.gender && (n = n.filter((s) => s.gender === i.gender)), i.quality) {
|
|
996
|
+
const s = Array.isArray(i.quality) ? i.quality : [i.quality];
|
|
997
|
+
n = n.filter((u) => u.quality && s.includes(u.quality));
|
|
998
|
+
}
|
|
999
|
+
return i.offlineOnly && (n = n.filter((s) => s.offlineAvailability === !0)), i.provider && (n = n.filter(
|
|
1000
|
+
(s) => s.provider?.toLowerCase() === i.provider?.toLowerCase()
|
|
1001
|
+
)), i.excludeNovelty && (n = Me(n)), i.excludeVeryLowQuality && (n = We(n)), i.removeDuplicates && (n = this.removeDuplicates(n)), n;
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Filter out novelty voices
|
|
1005
|
+
* @param voices Array of voices to filter
|
|
1006
|
+
* @returns Filtered array with novelty voices removed
|
|
1007
|
+
*/
|
|
1008
|
+
filterOutNoveltyVoices(t) {
|
|
1009
|
+
const r = t ?? this.voices;
|
|
1010
|
+
return Me(r);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Filter out very low quality voices
|
|
1014
|
+
* @param voices Array of voices to filter
|
|
1015
|
+
* @returns Filtered array with very low quality voices removed
|
|
1016
|
+
*/
|
|
1017
|
+
filterOutVeryLowQualityVoices(t) {
|
|
1018
|
+
const r = t ?? this.voices;
|
|
1019
|
+
return We(r);
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Get the numeric value for a quality level
|
|
1023
|
+
* @param quality Quality level
|
|
1024
|
+
* @returns Numeric value (higher = better quality, 0 for undefined/null)
|
|
1025
|
+
*/
|
|
1026
|
+
static getQualityValue(t) {
|
|
1027
|
+
return t ? {
|
|
1028
|
+
veryLow: 1,
|
|
1029
|
+
low: 2,
|
|
1030
|
+
normal: 3,
|
|
1031
|
+
high: 4,
|
|
1032
|
+
veryHigh: 5
|
|
1033
|
+
}[t] ?? 0 : 0;
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Sort two voices by quality, using JSON order as fallback for undefined/null quality
|
|
1037
|
+
* @param a First voice
|
|
1038
|
+
* @param b Second voice
|
|
1039
|
+
* @param jsonOrderMaps Optional map of language codes to voice order maps
|
|
1040
|
+
* @param baseLang Base language code to use for looking up the order map
|
|
1041
|
+
* @returns Comparison result (-1, 0, or 1)
|
|
1042
|
+
*/
|
|
1043
|
+
static sortByQuality(t, r, n, i) {
|
|
1044
|
+
const s = S.getQualityValue(t.quality), u = S.getQualityValue(r.quality);
|
|
1045
|
+
if (n && i && t.source === "json" && r.source === "json") {
|
|
1046
|
+
const a = n.get(i);
|
|
1047
|
+
if (a) {
|
|
1048
|
+
const c = a.get(t.name), l = a.get(r.name);
|
|
1049
|
+
if (c !== void 0 && l !== void 0)
|
|
1050
|
+
return c - l;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
return u !== s ? u - s : t.name.localeCompare(r.name);
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Sort voices by quality, respecting JSON name order, then alphabetically for undefined/null quality
|
|
1057
|
+
* @param voices Array of voices to sort
|
|
1058
|
+
* @returns Sorted array of voices
|
|
1059
|
+
*/
|
|
1060
|
+
async sortVoicesByQuality(t) {
|
|
1061
|
+
const r = t || this.voices;
|
|
1062
|
+
if (!r?.length) return [];
|
|
1063
|
+
const n = await ie(r);
|
|
1064
|
+
return [...r].sort((i, s) => S.sortByQuality(i, s, n));
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Group voices by language based on processed preferred languages
|
|
1068
|
+
*/
|
|
1069
|
+
static groupVoicesByLanguage(t, r) {
|
|
1070
|
+
const n = new Map(r.map((u) => [u.baseLang, u])), i = /* @__PURE__ */ new Map(), s = [];
|
|
1071
|
+
for (const u of t) {
|
|
1072
|
+
const [a] = S.extractLangRegionFromBCP47(u.language);
|
|
1073
|
+
n.get(a) ? (i.has(a) || i.set(a, []), i.get(a).push(u)) : s.push(u);
|
|
1074
|
+
}
|
|
1075
|
+
return { voicesByLang: i, otherLangVoices: s };
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Sort regions by default then alphabetically, sort voices by quality
|
|
1079
|
+
*/
|
|
1080
|
+
static async sortByDefaultRegion(t, r) {
|
|
1081
|
+
const n = await ie(t), i = le(r);
|
|
1082
|
+
t.sort((s, u) => {
|
|
1083
|
+
const [, a] = S.extractLangRegionFromBCP47(s.language), [, c] = S.extractLangRegionFromBCP47(u.language), l = i && a === i.split("-")[1], g = i && c === i.split("-")[1];
|
|
1084
|
+
return l && !g ? -1 : !l && g ? 1 : S.sortByQuality(s, u, n, r);
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Sort voices alphabetically by language, then region, then quality
|
|
1089
|
+
*/
|
|
1090
|
+
static async sortAlphabetically(t) {
|
|
1091
|
+
const r = await ie(t);
|
|
1092
|
+
t.sort((n, i) => {
|
|
1093
|
+
const [s] = S.extractLangRegionFromBCP47(n.language), [u] = S.extractLangRegionFromBCP47(i.language), a = S.getLanguageDisplayName(s).toLowerCase(), c = S.getLanguageDisplayName(u).toLowerCase(), l = a.localeCompare(c);
|
|
1094
|
+
if (l !== 0)
|
|
1095
|
+
return l;
|
|
1096
|
+
if (s === u) {
|
|
1097
|
+
const g = le(s), [, p] = S.extractLangRegionFromBCP47(n.language), [, h] = S.extractLangRegionFromBCP47(i.language), d = g && p === g.split("-")[1], v = g && h === g.split("-")[1];
|
|
1098
|
+
if (d && !v) return -1;
|
|
1099
|
+
if (!d && v) return 1;
|
|
1100
|
+
if (p && h) {
|
|
1101
|
+
const O = p.localeCompare(h);
|
|
1102
|
+
if (O !== 0)
|
|
1103
|
+
return O;
|
|
1104
|
+
}
|
|
1105
|
+
return p && !h ? -1 : !p && h ? 1 : S.sortByQuality(n, i, r, s);
|
|
1106
|
+
}
|
|
1107
|
+
return S.sortByQuality(n, i, r, s);
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Sort voices by language preference, then alphabetically
|
|
1112
|
+
* @param voices Array of voices to sort
|
|
1113
|
+
* @param preferredLanguages Array of preferred language codes in order of preference
|
|
1114
|
+
* @returns Sorted array of voices
|
|
1115
|
+
*/
|
|
1116
|
+
async sortVoicesByLanguages(t, r) {
|
|
1117
|
+
const n = r || this.voices;
|
|
1118
|
+
if (!n?.length) return [];
|
|
1119
|
+
if (!t?.length) {
|
|
1120
|
+
const c = [...n];
|
|
1121
|
+
return await S.sortAlphabetically(c), c;
|
|
1122
|
+
}
|
|
1123
|
+
const i = Ge(t), { voicesByLang: s, otherLangVoices: u } = S.groupVoicesByLanguage(n, i), a = [];
|
|
1124
|
+
for (const c of i) {
|
|
1125
|
+
const l = s.get(c.baseLang);
|
|
1126
|
+
l && (await S.sortByDefaultRegion(l, c.baseLang), a.push(...l));
|
|
1127
|
+
}
|
|
1128
|
+
return await S.sortAlphabetically(u), a.push(...u), a;
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Sort languages by region preference, then voices by quality
|
|
1132
|
+
*/
|
|
1133
|
+
static async sortByPreferredRegion(t, r) {
|
|
1134
|
+
const n = await ie(t);
|
|
1135
|
+
t.sort((i, s) => {
|
|
1136
|
+
const [, u] = S.extractLangRegionFromBCP47(i.language), [, a] = S.extractLangRegionFromBCP47(s.language), c = u && r.regions.includes(u), l = a && r.regions.includes(a);
|
|
1137
|
+
if (c && l) {
|
|
1138
|
+
const v = r.regions.indexOf(u), O = r.regions.indexOf(a);
|
|
1139
|
+
return v === O ? S.sortByQuality(i, s, n, r.baseLang) : v - O;
|
|
1140
|
+
}
|
|
1141
|
+
if (c) return -1;
|
|
1142
|
+
if (l) return 1;
|
|
1143
|
+
const g = le(r.baseLang), [, p] = S.extractLangRegionFromBCP47(g), h = u === p, d = a === p;
|
|
1144
|
+
if (h && !d) return -1;
|
|
1145
|
+
if (!h && d) return 1;
|
|
1146
|
+
if (u && a) {
|
|
1147
|
+
const v = u.localeCompare(a);
|
|
1148
|
+
return v !== 0 ? v : S.sortByQuality(i, s, n, r.baseLang);
|
|
1149
|
+
}
|
|
1150
|
+
return u ? -1 : a ? 1 : S.sortByQuality(i, s, n, r.baseLang);
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* Sort voices by region preference, then alphabetically
|
|
1155
|
+
* @param voices Array of voices to sort
|
|
1156
|
+
* @param preferredLanguages Array of preferred language codes in order of preference
|
|
1157
|
+
* @returns Sorted array of voices
|
|
1158
|
+
*/
|
|
1159
|
+
async sortVoicesByRegions(t, r) {
|
|
1160
|
+
const n = r || this.voices;
|
|
1161
|
+
if (!n?.length) return [];
|
|
1162
|
+
const i = Ge(t || []), { voicesByLang: s, otherLangVoices: u } = S.groupVoicesByLanguage(n, i), a = [];
|
|
1163
|
+
for (const c of i) {
|
|
1164
|
+
const l = s.get(c.baseLang);
|
|
1165
|
+
l && (await S.sortByPreferredRegion(l, c), a.push(...l));
|
|
1166
|
+
}
|
|
1167
|
+
return await S.sortAlphabetically(u), a.push(...u), a;
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Group voices by the specified criteria
|
|
1171
|
+
* @param voices Array of voices to group
|
|
1172
|
+
* @param options Grouping options
|
|
1173
|
+
* @returns Object with voice groups keyed by the grouping criteria
|
|
1174
|
+
*/
|
|
1175
|
+
groupVoices(t, r) {
|
|
1176
|
+
const n = {}, i = r || this.voices;
|
|
1177
|
+
for (const s of i) {
|
|
1178
|
+
let u = "Unknown";
|
|
1179
|
+
switch (t) {
|
|
1180
|
+
case "languages":
|
|
1181
|
+
u = S.extractLangRegionFromBCP47(s.language)[0];
|
|
1182
|
+
break;
|
|
1183
|
+
case "gender":
|
|
1184
|
+
u = s.gender || "unknown";
|
|
1185
|
+
break;
|
|
1186
|
+
case "quality":
|
|
1187
|
+
u = s.quality || "unknown";
|
|
1188
|
+
break;
|
|
1189
|
+
case "region":
|
|
1190
|
+
const [, a] = S.extractLangRegionFromBCP47(s.language);
|
|
1191
|
+
u = a || "unknown";
|
|
1192
|
+
break;
|
|
1193
|
+
}
|
|
1194
|
+
n[u] || (n[u] = []), n[u].push(s);
|
|
1195
|
+
}
|
|
1196
|
+
return n;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
const Mt = ["webKit", "moz", "ms", "o"], Wt = [
|
|
1200
|
+
"boundary",
|
|
1201
|
+
"end",
|
|
1202
|
+
"error",
|
|
1203
|
+
"mark",
|
|
1204
|
+
"pause",
|
|
1205
|
+
"resume",
|
|
1206
|
+
"start"
|
|
1207
|
+
], Jt = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, Y = (e = {}, t) => Object.hasOwnProperty.call(e, t) || t in e || !!e[t], Qt = (e) => typeof window < "u" && e in window, Kt = (e) => {
|
|
1208
|
+
const t = Jt(e), r = Mt.map((i) => `${i}${t}`), n = [e, t].concat(r).find(Qt);
|
|
1209
|
+
return n && typeof window < "u" ? window[n] : void 0;
|
|
1210
|
+
}, Zt = () => {
|
|
1211
|
+
const e = {};
|
|
1212
|
+
[
|
|
1213
|
+
"speechSynthesis",
|
|
1214
|
+
"speechSynthesisUtterance",
|
|
1215
|
+
"speechSynthesisVoice",
|
|
1216
|
+
"speechSynthesisEvent",
|
|
1217
|
+
"speechSynthesisErrorEvent"
|
|
1218
|
+
].forEach((r) => {
|
|
1219
|
+
e[r] = Kt(r);
|
|
1220
|
+
}), e.onvoiceschanged = Y(e.speechSynthesis, "onvoiceschanged"), e.speechSynthesisSpeaking = Y(e.speechSynthesis, "speaking"), e.speechSynthesisPaused = Y(e.speechSynthesis, "paused");
|
|
1221
|
+
const t = e.speechSynthesisUtterance ? Y(e.speechSynthesisUtterance, "prototype") : !1;
|
|
1222
|
+
return Wt.forEach((r) => {
|
|
1223
|
+
const n = `on${r}`;
|
|
1224
|
+
e[n] = t && e.speechSynthesisUtterance ? Y(e.speechSynthesisUtterance.prototype, n) : !1;
|
|
1225
|
+
}), e;
|
|
1226
|
+
}, Xt = () => {
|
|
1227
|
+
const t = typeof window < "u" && (window.navigator || {}).userAgent || "", r = () => /android/i.test(t), n = () => /kaios/i.test(t), i = () => typeof window.InstallTrigger < "u" ? !0 : /firefox/i.test(t), s = () => typeof window.GestureEvent < "u" || /safari/i.test(t);
|
|
1228
|
+
return {
|
|
1229
|
+
isAndroid: r(),
|
|
1230
|
+
isFirefox: i() || n(),
|
|
1231
|
+
isSafari: s(),
|
|
1232
|
+
isKaiOS: n()
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
function Yt(e) {
|
|
1236
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1237
|
+
}
|
|
1238
|
+
var ye, Qe;
|
|
1239
|
+
function er() {
|
|
1240
|
+
if (Qe) return ye;
|
|
1241
|
+
Qe = 1, ye = t;
|
|
1242
|
+
function e(n) {
|
|
1243
|
+
return n instanceof Buffer ? Buffer.from(n) : new n.constructor(n.buffer.slice(), n.byteOffset, n.length);
|
|
1244
|
+
}
|
|
1245
|
+
function t(n) {
|
|
1246
|
+
if (n = n || {}, n.circles) return r(n);
|
|
1247
|
+
const i = /* @__PURE__ */ new Map();
|
|
1248
|
+
if (i.set(Date, (l) => new Date(l)), i.set(Map, (l, g) => new Map(u(Array.from(l), g))), i.set(Set, (l, g) => new Set(u(Array.from(l), g))), n.constructorHandlers)
|
|
1249
|
+
for (const l of n.constructorHandlers)
|
|
1250
|
+
i.set(l[0], l[1]);
|
|
1251
|
+
let s = null;
|
|
1252
|
+
return n.proto ? c : a;
|
|
1253
|
+
function u(l, g) {
|
|
1254
|
+
const p = Object.keys(l), h = new Array(p.length);
|
|
1255
|
+
for (let d = 0; d < p.length; d++) {
|
|
1256
|
+
const v = p[d], O = l[v];
|
|
1257
|
+
typeof O != "object" || O === null ? h[v] = O : O.constructor !== Object && (s = i.get(O.constructor)) ? h[v] = s(O, g) : ArrayBuffer.isView(O) ? h[v] = e(O) : h[v] = g(O);
|
|
1258
|
+
}
|
|
1259
|
+
return h;
|
|
1260
|
+
}
|
|
1261
|
+
function a(l) {
|
|
1262
|
+
if (typeof l != "object" || l === null) return l;
|
|
1263
|
+
if (Array.isArray(l)) return u(l, a);
|
|
1264
|
+
if (l.constructor !== Object && (s = i.get(l.constructor)))
|
|
1265
|
+
return s(l, a);
|
|
1266
|
+
const g = {};
|
|
1267
|
+
for (const p in l) {
|
|
1268
|
+
if (Object.hasOwnProperty.call(l, p) === !1) continue;
|
|
1269
|
+
const h = l[p];
|
|
1270
|
+
typeof h != "object" || h === null ? g[p] = h : h.constructor !== Object && (s = i.get(h.constructor)) ? g[p] = s(h, a) : ArrayBuffer.isView(h) ? g[p] = e(h) : g[p] = a(h);
|
|
1271
|
+
}
|
|
1272
|
+
return g;
|
|
1273
|
+
}
|
|
1274
|
+
function c(l) {
|
|
1275
|
+
if (typeof l != "object" || l === null) return l;
|
|
1276
|
+
if (Array.isArray(l)) return u(l, c);
|
|
1277
|
+
if (l.constructor !== Object && (s = i.get(l.constructor)))
|
|
1278
|
+
return s(l, c);
|
|
1279
|
+
const g = {};
|
|
1280
|
+
for (const p in l) {
|
|
1281
|
+
const h = l[p];
|
|
1282
|
+
typeof h != "object" || h === null ? g[p] = h : h.constructor !== Object && (s = i.get(h.constructor)) ? g[p] = s(h, c) : ArrayBuffer.isView(h) ? g[p] = e(h) : g[p] = c(h);
|
|
1283
|
+
}
|
|
1284
|
+
return g;
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
function r(n) {
|
|
1288
|
+
const i = [], s = [], u = /* @__PURE__ */ new Map();
|
|
1289
|
+
if (u.set(Date, (p) => new Date(p)), u.set(Map, (p, h) => new Map(c(Array.from(p), h))), u.set(Set, (p, h) => new Set(c(Array.from(p), h))), n.constructorHandlers)
|
|
1290
|
+
for (const p of n.constructorHandlers)
|
|
1291
|
+
u.set(p[0], p[1]);
|
|
1292
|
+
let a = null;
|
|
1293
|
+
return n.proto ? g : l;
|
|
1294
|
+
function c(p, h) {
|
|
1295
|
+
const d = Object.keys(p), v = new Array(d.length);
|
|
1296
|
+
for (let O = 0; O < d.length; O++) {
|
|
1297
|
+
const C = d[O], R = p[C];
|
|
1298
|
+
if (typeof R != "object" || R === null)
|
|
1299
|
+
v[C] = R;
|
|
1300
|
+
else if (R.constructor !== Object && (a = u.get(R.constructor)))
|
|
1301
|
+
v[C] = a(R, h);
|
|
1302
|
+
else if (ArrayBuffer.isView(R))
|
|
1303
|
+
v[C] = e(R);
|
|
1304
|
+
else {
|
|
1305
|
+
const N = i.indexOf(R);
|
|
1306
|
+
N !== -1 ? v[C] = s[N] : v[C] = h(R);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
return v;
|
|
1310
|
+
}
|
|
1311
|
+
function l(p) {
|
|
1312
|
+
if (typeof p != "object" || p === null) return p;
|
|
1313
|
+
if (Array.isArray(p)) return c(p, l);
|
|
1314
|
+
if (p.constructor !== Object && (a = u.get(p.constructor)))
|
|
1315
|
+
return a(p, l);
|
|
1316
|
+
const h = {};
|
|
1317
|
+
i.push(p), s.push(h);
|
|
1318
|
+
for (const d in p) {
|
|
1319
|
+
if (Object.hasOwnProperty.call(p, d) === !1) continue;
|
|
1320
|
+
const v = p[d];
|
|
1321
|
+
if (typeof v != "object" || v === null)
|
|
1322
|
+
h[d] = v;
|
|
1323
|
+
else if (v.constructor !== Object && (a = u.get(v.constructor)))
|
|
1324
|
+
h[d] = a(v, l);
|
|
1325
|
+
else if (ArrayBuffer.isView(v))
|
|
1326
|
+
h[d] = e(v);
|
|
1327
|
+
else {
|
|
1328
|
+
const O = i.indexOf(v);
|
|
1329
|
+
O !== -1 ? h[d] = s[O] : h[d] = l(v);
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return i.pop(), s.pop(), h;
|
|
1333
|
+
}
|
|
1334
|
+
function g(p) {
|
|
1335
|
+
if (typeof p != "object" || p === null) return p;
|
|
1336
|
+
if (Array.isArray(p)) return c(p, g);
|
|
1337
|
+
if (p.constructor !== Object && (a = u.get(p.constructor)))
|
|
1338
|
+
return a(p, g);
|
|
1339
|
+
const h = {};
|
|
1340
|
+
i.push(p), s.push(h);
|
|
1341
|
+
for (const d in p) {
|
|
1342
|
+
const v = p[d];
|
|
1343
|
+
if (typeof v != "object" || v === null)
|
|
1344
|
+
h[d] = v;
|
|
1345
|
+
else if (v.constructor !== Object && (a = u.get(v.constructor)))
|
|
1346
|
+
h[d] = a(v, g);
|
|
1347
|
+
else if (ArrayBuffer.isView(v))
|
|
1348
|
+
h[d] = e(v);
|
|
1349
|
+
else {
|
|
1350
|
+
const O = i.indexOf(v);
|
|
1351
|
+
O !== -1 ? h[d] = s[O] : h[d] = g(v);
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
return i.pop(), s.pop(), h;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
return ye;
|
|
1358
|
+
}
|
|
1359
|
+
var tr = er();
|
|
1360
|
+
const dt = /* @__PURE__ */ Yt(tr);
|
|
1361
|
+
dt();
|
|
1362
|
+
function Ne(e) {
|
|
1363
|
+
if (e == null || typeof e != "object") return !1;
|
|
1364
|
+
let t = Object.getPrototypeOf(e);
|
|
1365
|
+
return t !== null && t !== Object.prototype && Object.getPrototypeOf(t) !== null ? !1 : !(Symbol.iterator in e) && !(Symbol.toStringTag in e);
|
|
1366
|
+
}
|
|
1367
|
+
function G(e) {
|
|
1368
|
+
return typeof e == "string";
|
|
1369
|
+
}
|
|
1370
|
+
function rr(e) {
|
|
1371
|
+
return Number.isFinite(e);
|
|
1372
|
+
}
|
|
1373
|
+
function _(e) {
|
|
1374
|
+
return Number.isSafeInteger(e) && e >= 0;
|
|
1375
|
+
}
|
|
1376
|
+
function B(e) {
|
|
1377
|
+
return e != null;
|
|
1378
|
+
}
|
|
1379
|
+
function nr(e, t) {
|
|
1380
|
+
return Ne(e) && G(t) && t in e;
|
|
1381
|
+
}
|
|
1382
|
+
var ar = typeof globalThis == "object" && globalThis && globalThis.Object === Object && globalThis, sr = typeof self == "object" && self && self.Object === Object && self, je = ar || sr || Function("return this")(), W = je.Symbol, ht = Object.prototype, ir = ht.hasOwnProperty, or = ht.toString, ee = W ? W.toStringTag : void 0;
|
|
1383
|
+
function lr(e) {
|
|
1384
|
+
var t = ir.call(e, ee), r = e[ee];
|
|
1385
|
+
try {
|
|
1386
|
+
e[ee] = void 0;
|
|
1387
|
+
var n = !0;
|
|
1388
|
+
} catch {
|
|
1389
|
+
}
|
|
1390
|
+
var i = or.call(e);
|
|
1391
|
+
return n && (t ? e[ee] = r : delete e[ee]), i;
|
|
1392
|
+
}
|
|
1393
|
+
var ur = Object.prototype, cr = ur.toString;
|
|
1394
|
+
function gr(e) {
|
|
1395
|
+
return cr.call(e);
|
|
1396
|
+
}
|
|
1397
|
+
var pr = "[object Null]", dr = "[object Undefined]", Ke = W ? W.toStringTag : void 0;
|
|
1398
|
+
function ft(e) {
|
|
1399
|
+
return e == null ? e === void 0 ? dr : pr : Ke && Ke in Object(e) ? lr(e) : gr(e);
|
|
1400
|
+
}
|
|
1401
|
+
function mt(e) {
|
|
1402
|
+
return e != null && typeof e == "object";
|
|
1403
|
+
}
|
|
1404
|
+
var hr = "[object Symbol]";
|
|
1405
|
+
function fr(e) {
|
|
1406
|
+
return typeof e == "symbol" || mt(e) && ft(e) == hr;
|
|
1407
|
+
}
|
|
1408
|
+
function mr(e, t) {
|
|
1409
|
+
for (var r = -1, n = e == null ? 0 : e.length, i = Array(n); ++r < n; )
|
|
1410
|
+
i[r] = t(e[r], r, e);
|
|
1411
|
+
return i;
|
|
1412
|
+
}
|
|
1413
|
+
var yr = Array.isArray, Ze = W ? W.prototype : void 0, Xe = Ze ? Ze.toString : void 0;
|
|
1414
|
+
function Pe(e) {
|
|
1415
|
+
if (typeof e == "string")
|
|
1416
|
+
return e;
|
|
1417
|
+
if (yr(e))
|
|
1418
|
+
return mr(e, Pe) + "";
|
|
1419
|
+
if (fr(e))
|
|
1420
|
+
return Xe ? Xe.call(e) : "";
|
|
1421
|
+
var t = e + "";
|
|
1422
|
+
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
1423
|
+
}
|
|
1424
|
+
var br = /\s/;
|
|
1425
|
+
function vr(e) {
|
|
1426
|
+
for (var t = e.length; t-- && br.test(e.charAt(t)); )
|
|
1427
|
+
;
|
|
1428
|
+
return t;
|
|
1429
|
+
}
|
|
1430
|
+
var Sr = /^\s+/;
|
|
1431
|
+
function wr(e) {
|
|
1432
|
+
return e && e.slice(0, vr(e) + 1).replace(Sr, "");
|
|
1433
|
+
}
|
|
1434
|
+
function yt(e) {
|
|
1435
|
+
var t = typeof e;
|
|
1436
|
+
return e != null && (t == "object" || t == "function");
|
|
1437
|
+
}
|
|
1438
|
+
function bt(e) {
|
|
1439
|
+
return e;
|
|
1440
|
+
}
|
|
1441
|
+
var Or = "[object AsyncFunction]", Ar = "[object Function]", kr = "[object GeneratorFunction]", Tr = "[object Proxy]";
|
|
1442
|
+
function vt(e) {
|
|
1443
|
+
if (!yt(e))
|
|
1444
|
+
return !1;
|
|
1445
|
+
var t = ft(e);
|
|
1446
|
+
return t == Ar || t == kr || t == Or || t == Tr;
|
|
1447
|
+
}
|
|
1448
|
+
var be = je["__core-js_shared__"], Ye = (function() {
|
|
1449
|
+
var e = /[^.]+$/.exec(be && be.keys && be.keys.IE_PROTO || "");
|
|
1450
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
1451
|
+
})();
|
|
1452
|
+
function Rr(e) {
|
|
1453
|
+
return !!Ye && Ye in e;
|
|
1454
|
+
}
|
|
1455
|
+
var Cr = Function.prototype, Er = Cr.toString;
|
|
1456
|
+
function qr(e) {
|
|
1457
|
+
if (e != null) {
|
|
1458
|
+
try {
|
|
1459
|
+
return Er.call(e);
|
|
1460
|
+
} catch {
|
|
1461
|
+
}
|
|
1462
|
+
try {
|
|
1463
|
+
return e + "";
|
|
1464
|
+
} catch {
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
return "";
|
|
1468
|
+
}
|
|
1469
|
+
var Nr = /[\\^$.*+?()[\]{}|]/g, Lr = /^\[object .+?Constructor\]$/, Ir = Function.prototype, xr = Object.prototype, jr = Ir.toString, Pr = xr.hasOwnProperty, Ur = RegExp(
|
|
1470
|
+
"^" + jr.call(Pr).replace(Nr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1471
|
+
);
|
|
1472
|
+
function Dr(e) {
|
|
1473
|
+
if (!yt(e) || Rr(e))
|
|
1474
|
+
return !1;
|
|
1475
|
+
var t = vt(e) ? Ur : Lr;
|
|
1476
|
+
return t.test(qr(e));
|
|
1477
|
+
}
|
|
1478
|
+
function Br(e, t) {
|
|
1479
|
+
return e?.[t];
|
|
1480
|
+
}
|
|
1481
|
+
function Ue(e, t) {
|
|
1482
|
+
var r = Br(e, t);
|
|
1483
|
+
return Dr(r) ? r : void 0;
|
|
1484
|
+
}
|
|
1485
|
+
function Fr(e, t, r) {
|
|
1486
|
+
switch (r.length) {
|
|
1487
|
+
case 0:
|
|
1488
|
+
return e.call(t);
|
|
1489
|
+
case 1:
|
|
1490
|
+
return e.call(t, r[0]);
|
|
1491
|
+
case 2:
|
|
1492
|
+
return e.call(t, r[0], r[1]);
|
|
1493
|
+
case 3:
|
|
1494
|
+
return e.call(t, r[0], r[1], r[2]);
|
|
1495
|
+
}
|
|
1496
|
+
return e.apply(t, r);
|
|
1497
|
+
}
|
|
1498
|
+
var $r = 800, Hr = 16, Vr = Date.now;
|
|
1499
|
+
function zr(e) {
|
|
1500
|
+
var t = 0, r = 0;
|
|
1501
|
+
return function() {
|
|
1502
|
+
var n = Vr(), i = Hr - (n - r);
|
|
1503
|
+
if (r = n, i > 0) {
|
|
1504
|
+
if (++t >= $r)
|
|
1505
|
+
return arguments[0];
|
|
1506
|
+
} else
|
|
1507
|
+
t = 0;
|
|
1508
|
+
return e.apply(void 0, arguments);
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
function _r(e) {
|
|
1512
|
+
return function() {
|
|
1513
|
+
return e;
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
var et = (function() {
|
|
1517
|
+
try {
|
|
1518
|
+
var e = Ue(Object, "defineProperty");
|
|
1519
|
+
return e({}, "", {}), e;
|
|
1520
|
+
} catch {
|
|
1521
|
+
}
|
|
1522
|
+
})(), Gr = et ? function(e, t) {
|
|
1523
|
+
return et(e, "toString", {
|
|
1524
|
+
configurable: !0,
|
|
1525
|
+
enumerable: !1,
|
|
1526
|
+
value: _r(t),
|
|
1527
|
+
writable: !0
|
|
1528
|
+
});
|
|
1529
|
+
} : bt, Mr = zr(Gr);
|
|
1530
|
+
function Wr(e, t, r, n) {
|
|
1531
|
+
for (var i = e.length, s = r + -1; ++s < i; )
|
|
1532
|
+
if (t(e[s], s, e))
|
|
1533
|
+
return s;
|
|
1534
|
+
return -1;
|
|
1535
|
+
}
|
|
1536
|
+
function Jr(e) {
|
|
1537
|
+
return e !== e;
|
|
1538
|
+
}
|
|
1539
|
+
function Qr(e, t, r) {
|
|
1540
|
+
for (var n = r - 1, i = e.length; ++n < i; )
|
|
1541
|
+
if (e[n] === t)
|
|
1542
|
+
return n;
|
|
1543
|
+
return -1;
|
|
1544
|
+
}
|
|
1545
|
+
function De(e, t, r) {
|
|
1546
|
+
return t === t ? Qr(e, t, r) : Wr(e, Jr, r);
|
|
1547
|
+
}
|
|
1548
|
+
function Kr(e, t) {
|
|
1549
|
+
var r = e == null ? 0 : e.length;
|
|
1550
|
+
return !!r && De(e, t, 0) > -1;
|
|
1551
|
+
}
|
|
1552
|
+
function Zr(e, t) {
|
|
1553
|
+
return e === t || e !== e && t !== t;
|
|
1554
|
+
}
|
|
1555
|
+
var tt = Math.max;
|
|
1556
|
+
function Xr(e, t, r) {
|
|
1557
|
+
return t = tt(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1558
|
+
for (var n = arguments, i = -1, s = tt(n.length - t, 0), u = Array(s); ++i < s; )
|
|
1559
|
+
u[i] = n[t + i];
|
|
1560
|
+
i = -1;
|
|
1561
|
+
for (var a = Array(t + 1); ++i < t; )
|
|
1562
|
+
a[i] = n[i];
|
|
1563
|
+
return a[t] = r(u), Fr(e, this, a);
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
function Yr(e, t) {
|
|
1567
|
+
return Mr(Xr(e, t, bt), e + "");
|
|
1568
|
+
}
|
|
1569
|
+
var en = 9007199254740991;
|
|
1570
|
+
function tn(e) {
|
|
1571
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= en;
|
|
1572
|
+
}
|
|
1573
|
+
function rn(e) {
|
|
1574
|
+
return e != null && tn(e.length) && !vt(e);
|
|
1575
|
+
}
|
|
1576
|
+
var ne = Ue(Object, "create");
|
|
1577
|
+
function nn() {
|
|
1578
|
+
this.__data__ = ne ? ne(null) : {}, this.size = 0;
|
|
1579
|
+
}
|
|
1580
|
+
function an(e) {
|
|
1581
|
+
var t = this.has(e) && delete this.__data__[e];
|
|
1582
|
+
return this.size -= t ? 1 : 0, t;
|
|
1583
|
+
}
|
|
1584
|
+
var sn = "__lodash_hash_undefined__", on = Object.prototype, ln = on.hasOwnProperty;
|
|
1585
|
+
function un(e) {
|
|
1586
|
+
var t = this.__data__;
|
|
1587
|
+
if (ne) {
|
|
1588
|
+
var r = t[e];
|
|
1589
|
+
return r === sn ? void 0 : r;
|
|
1590
|
+
}
|
|
1591
|
+
return ln.call(t, e) ? t[e] : void 0;
|
|
1592
|
+
}
|
|
1593
|
+
var cn = Object.prototype, gn = cn.hasOwnProperty;
|
|
1594
|
+
function pn(e) {
|
|
1595
|
+
var t = this.__data__;
|
|
1596
|
+
return ne ? t[e] !== void 0 : gn.call(t, e);
|
|
1597
|
+
}
|
|
1598
|
+
var dn = "__lodash_hash_undefined__";
|
|
1599
|
+
function hn(e, t) {
|
|
1600
|
+
var r = this.__data__;
|
|
1601
|
+
return this.size += this.has(e) ? 0 : 1, r[e] = ne && t === void 0 ? dn : t, this;
|
|
1602
|
+
}
|
|
1603
|
+
function H(e) {
|
|
1604
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
1605
|
+
for (this.clear(); ++t < r; ) {
|
|
1606
|
+
var n = e[t];
|
|
1607
|
+
this.set(n[0], n[1]);
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
H.prototype.clear = nn;
|
|
1611
|
+
H.prototype.delete = an;
|
|
1612
|
+
H.prototype.get = un;
|
|
1613
|
+
H.prototype.has = pn;
|
|
1614
|
+
H.prototype.set = hn;
|
|
1615
|
+
function fn() {
|
|
1616
|
+
this.__data__ = [], this.size = 0;
|
|
1617
|
+
}
|
|
1618
|
+
function ge(e, t) {
|
|
1619
|
+
for (var r = e.length; r--; )
|
|
1620
|
+
if (Zr(e[r][0], t))
|
|
1621
|
+
return r;
|
|
1622
|
+
return -1;
|
|
1623
|
+
}
|
|
1624
|
+
var mn = Array.prototype, yn = mn.splice;
|
|
1625
|
+
function bn(e) {
|
|
1626
|
+
var t = this.__data__, r = ge(t, e);
|
|
1627
|
+
if (r < 0)
|
|
1628
|
+
return !1;
|
|
1629
|
+
var n = t.length - 1;
|
|
1630
|
+
return r == n ? t.pop() : yn.call(t, r, 1), --this.size, !0;
|
|
1631
|
+
}
|
|
1632
|
+
function vn(e) {
|
|
1633
|
+
var t = this.__data__, r = ge(t, e);
|
|
1634
|
+
return r < 0 ? void 0 : t[r][1];
|
|
1635
|
+
}
|
|
1636
|
+
function Sn(e) {
|
|
1637
|
+
return ge(this.__data__, e) > -1;
|
|
1638
|
+
}
|
|
1639
|
+
function wn(e, t) {
|
|
1640
|
+
var r = this.__data__, n = ge(r, e);
|
|
1641
|
+
return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this;
|
|
1642
|
+
}
|
|
1643
|
+
function K(e) {
|
|
1644
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
1645
|
+
for (this.clear(); ++t < r; ) {
|
|
1646
|
+
var n = e[t];
|
|
1647
|
+
this.set(n[0], n[1]);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
K.prototype.clear = fn;
|
|
1651
|
+
K.prototype.delete = bn;
|
|
1652
|
+
K.prototype.get = vn;
|
|
1653
|
+
K.prototype.has = Sn;
|
|
1654
|
+
K.prototype.set = wn;
|
|
1655
|
+
var On = Ue(je, "Map");
|
|
1656
|
+
function An() {
|
|
1657
|
+
this.size = 0, this.__data__ = {
|
|
1658
|
+
hash: new H(),
|
|
1659
|
+
map: new (On || K)(),
|
|
1660
|
+
string: new H()
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
function kn(e) {
|
|
1664
|
+
var t = typeof e;
|
|
1665
|
+
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
1666
|
+
}
|
|
1667
|
+
function pe(e, t) {
|
|
1668
|
+
var r = e.__data__;
|
|
1669
|
+
return kn(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
|
|
1670
|
+
}
|
|
1671
|
+
function Tn(e) {
|
|
1672
|
+
var t = pe(this, e).delete(e);
|
|
1673
|
+
return this.size -= t ? 1 : 0, t;
|
|
1674
|
+
}
|
|
1675
|
+
function Rn(e) {
|
|
1676
|
+
return pe(this, e).get(e);
|
|
1677
|
+
}
|
|
1678
|
+
function Cn(e) {
|
|
1679
|
+
return pe(this, e).has(e);
|
|
1680
|
+
}
|
|
1681
|
+
function En(e, t) {
|
|
1682
|
+
var r = pe(this, e), n = r.size;
|
|
1683
|
+
return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
|
|
1684
|
+
}
|
|
1685
|
+
function Z(e) {
|
|
1686
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
1687
|
+
for (this.clear(); ++t < r; ) {
|
|
1688
|
+
var n = e[t];
|
|
1689
|
+
this.set(n[0], n[1]);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
Z.prototype.clear = An;
|
|
1693
|
+
Z.prototype.delete = Tn;
|
|
1694
|
+
Z.prototype.get = Rn;
|
|
1695
|
+
Z.prototype.has = Cn;
|
|
1696
|
+
Z.prototype.set = En;
|
|
1697
|
+
function qn(e) {
|
|
1698
|
+
return e == null ? "" : Pe(e);
|
|
1699
|
+
}
|
|
1700
|
+
function Nn(e, t, r) {
|
|
1701
|
+
var n = -1, i = e.length;
|
|
1702
|
+
t < 0 && (t = -t > i ? 0 : i + t), r = r > i ? i : r, r < 0 && (r += i), i = t > r ? 0 : r - t >>> 0, t >>>= 0;
|
|
1703
|
+
for (var s = Array(i); ++n < i; )
|
|
1704
|
+
s[n] = e[n + t];
|
|
1705
|
+
return s;
|
|
1706
|
+
}
|
|
1707
|
+
function Ln(e, t, r) {
|
|
1708
|
+
var n = e.length;
|
|
1709
|
+
return r = r === void 0 ? n : r, !t && r >= n ? e : Nn(e, t, r);
|
|
1710
|
+
}
|
|
1711
|
+
var In = "\\ud800-\\udfff", xn = "\\u0300-\\u036f", jn = "\\ufe20-\\ufe2f", Pn = "\\u20d0-\\u20ff", Un = xn + jn + Pn, Dn = "\\ufe0e\\ufe0f", Bn = "\\u200d", Fn = RegExp("[" + Bn + In + Un + Dn + "]");
|
|
1712
|
+
function $n(e) {
|
|
1713
|
+
return Fn.test(e);
|
|
1714
|
+
}
|
|
1715
|
+
function Hn(e) {
|
|
1716
|
+
return e.split("");
|
|
1717
|
+
}
|
|
1718
|
+
var St = "\\ud800-\\udfff", Vn = "\\u0300-\\u036f", zn = "\\ufe20-\\ufe2f", _n = "\\u20d0-\\u20ff", Gn = Vn + zn + _n, Mn = "\\ufe0e\\ufe0f", Wn = "[" + St + "]", Le = "[" + Gn + "]", Ie = "\\ud83c[\\udffb-\\udfff]", Jn = "(?:" + Le + "|" + Ie + ")", wt = "[^" + St + "]", Ot = "(?:\\ud83c[\\udde6-\\uddff]){2}", At = "[\\ud800-\\udbff][\\udc00-\\udfff]", Qn = "\\u200d", kt = Jn + "?", Tt = "[" + Mn + "]?", Kn = "(?:" + Qn + "(?:" + [wt, Ot, At].join("|") + ")" + Tt + kt + ")*", Zn = Tt + kt + Kn, Xn = "(?:" + [wt + Le + "?", Le, Ot, At, Wn].join("|") + ")", Yn = RegExp(Ie + "(?=" + Ie + ")|" + Xn + Zn, "g");
|
|
1719
|
+
function ea(e) {
|
|
1720
|
+
return e.match(Yn) || [];
|
|
1721
|
+
}
|
|
1722
|
+
function rt(e) {
|
|
1723
|
+
return $n(e) ? ea(e) : Hn(e);
|
|
1724
|
+
}
|
|
1725
|
+
var ta = "__lodash_hash_undefined__";
|
|
1726
|
+
function ra(e) {
|
|
1727
|
+
return this.__data__.set(e, ta), this;
|
|
1728
|
+
}
|
|
1729
|
+
function na(e) {
|
|
1730
|
+
return this.__data__.has(e);
|
|
1731
|
+
}
|
|
1732
|
+
function ue(e) {
|
|
1733
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
1734
|
+
for (this.__data__ = new Z(); ++t < r; )
|
|
1735
|
+
this.add(e[t]);
|
|
1736
|
+
}
|
|
1737
|
+
ue.prototype.add = ue.prototype.push = ra;
|
|
1738
|
+
ue.prototype.has = na;
|
|
1739
|
+
function aa(e, t) {
|
|
1740
|
+
return e.has(t);
|
|
1741
|
+
}
|
|
1742
|
+
function sa(e) {
|
|
1743
|
+
return mt(e) && rn(e);
|
|
1744
|
+
}
|
|
1745
|
+
var ia = 200;
|
|
1746
|
+
function oa(e, t, r, n) {
|
|
1747
|
+
var i = -1, s = Kr, u = !0, a = e.length, c = [], l = t.length;
|
|
1748
|
+
if (!a)
|
|
1749
|
+
return c;
|
|
1750
|
+
t.length >= ia && (s = aa, u = !1, t = new ue(t));
|
|
1751
|
+
e:
|
|
1752
|
+
for (; ++i < a; ) {
|
|
1753
|
+
var g = e[i], p = g;
|
|
1754
|
+
if (g = g !== 0 ? g : 0, u && p === p) {
|
|
1755
|
+
for (var h = l; h--; )
|
|
1756
|
+
if (t[h] === p)
|
|
1757
|
+
continue e;
|
|
1758
|
+
c.push(g);
|
|
1759
|
+
} else s(t, p, n) || c.push(g);
|
|
1760
|
+
}
|
|
1761
|
+
return c;
|
|
1762
|
+
}
|
|
1763
|
+
function la(e, t) {
|
|
1764
|
+
for (var r = e.length; r-- && De(t, e[r], 0) > -1; )
|
|
1765
|
+
;
|
|
1766
|
+
return r;
|
|
1767
|
+
}
|
|
1768
|
+
function ua(e, t) {
|
|
1769
|
+
for (var r = -1, n = e.length; ++r < n && De(t, e[r], 0) > -1; )
|
|
1770
|
+
;
|
|
1771
|
+
return r;
|
|
1772
|
+
}
|
|
1773
|
+
function nt(e, t, r) {
|
|
1774
|
+
if (e = qn(e), e && t === void 0)
|
|
1775
|
+
return wr(e);
|
|
1776
|
+
if (!e || !(t = Pe(t)))
|
|
1777
|
+
return e;
|
|
1778
|
+
var n = rt(e), i = rt(t), s = ua(n, i), u = la(n, i) + 1;
|
|
1779
|
+
return Ln(n, s, u).join("");
|
|
1780
|
+
}
|
|
1781
|
+
var ca = Yr(function(e, t) {
|
|
1782
|
+
return sa(e) ? oa(e, t) : [];
|
|
1783
|
+
}), M = function() {
|
|
1784
|
+
return M = Object.assign || function(e) {
|
|
1785
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
1786
|
+
t = arguments[r];
|
|
1787
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
1788
|
+
}
|
|
1789
|
+
return e;
|
|
1790
|
+
}, M.apply(this, arguments);
|
|
1791
|
+
}, ga = "~", pa = "~~";
|
|
1792
|
+
function Be(e, t) {
|
|
1793
|
+
for (var r = {}, n = {}, i = e.split(pa), s = !1, u = 0; i.length > u; u++) {
|
|
1794
|
+
for (var a = i[u].split(ga), c = 0; c < a.length; c += 2) {
|
|
1795
|
+
var l = a[c], g = a[c + 1], p = "&" + l + ";";
|
|
1796
|
+
r[p] = g, s && (r["&" + l] = g), n[g] = p;
|
|
1797
|
+
}
|
|
1798
|
+
s = !0;
|
|
1799
|
+
}
|
|
1800
|
+
return t ? { entities: M(M({}, r), t.entities), characters: M(M({}, n), t.characters) } : { entities: r, characters: n };
|
|
1801
|
+
}
|
|
1802
|
+
var ve = {
|
|
1803
|
+
xml: /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,
|
|
1804
|
+
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,
|
|
1805
|
+
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
|
|
1806
|
+
}, J = {};
|
|
1807
|
+
J.xml = Be(`lt~<~gt~>~quot~"~apos~'~amp~&`);
|
|
1808
|
+
J.html4 = Be(`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~>`);
|
|
1809
|
+
J.html5 = Be('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~®', J.html4);
|
|
1810
|
+
var da = {
|
|
1811
|
+
0: 65533,
|
|
1812
|
+
128: 8364,
|
|
1813
|
+
130: 8218,
|
|
1814
|
+
131: 402,
|
|
1815
|
+
132: 8222,
|
|
1816
|
+
133: 8230,
|
|
1817
|
+
134: 8224,
|
|
1818
|
+
135: 8225,
|
|
1819
|
+
136: 710,
|
|
1820
|
+
137: 8240,
|
|
1821
|
+
138: 352,
|
|
1822
|
+
139: 8249,
|
|
1823
|
+
140: 338,
|
|
1824
|
+
142: 381,
|
|
1825
|
+
145: 8216,
|
|
1826
|
+
146: 8217,
|
|
1827
|
+
147: 8220,
|
|
1828
|
+
148: 8221,
|
|
1829
|
+
149: 8226,
|
|
1830
|
+
150: 8211,
|
|
1831
|
+
151: 8212,
|
|
1832
|
+
152: 732,
|
|
1833
|
+
153: 8482,
|
|
1834
|
+
154: 353,
|
|
1835
|
+
155: 8250,
|
|
1836
|
+
156: 339,
|
|
1837
|
+
158: 382,
|
|
1838
|
+
159: 376
|
|
1839
|
+
}, ha = String.fromCodePoint || function(e) {
|
|
1840
|
+
return String.fromCharCode(Math.floor((e - 65536) / 1024) + 55296, (e - 65536) % 1024 + 56320);
|
|
1841
|
+
}, Q = function() {
|
|
1842
|
+
return Q = Object.assign || function(e) {
|
|
1843
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
1844
|
+
t = arguments[r];
|
|
1845
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
1846
|
+
}
|
|
1847
|
+
return e;
|
|
1848
|
+
}, Q.apply(this, arguments);
|
|
1849
|
+
}, fa = Q(Q({}, J), { all: J.html5 }), ma = {
|
|
1850
|
+
scope: "body",
|
|
1851
|
+
level: "all"
|
|
1852
|
+
}, Se = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g, we = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g, at = {
|
|
1853
|
+
xml: {
|
|
1854
|
+
strict: Se,
|
|
1855
|
+
attribute: we,
|
|
1856
|
+
body: ve.xml
|
|
1857
|
+
},
|
|
1858
|
+
html4: {
|
|
1859
|
+
strict: Se,
|
|
1860
|
+
attribute: we,
|
|
1861
|
+
body: ve.html4
|
|
1862
|
+
},
|
|
1863
|
+
html5: {
|
|
1864
|
+
strict: Se,
|
|
1865
|
+
attribute: we,
|
|
1866
|
+
body: ve.html5
|
|
1867
|
+
}
|
|
1868
|
+
}, ya = Q(Q({}, at), { all: at.html5 }), Rt = String.fromCharCode, ba = Rt(65533);
|
|
1869
|
+
function va(e, t, r, n) {
|
|
1870
|
+
var i = e, s = e[e.length - 1];
|
|
1871
|
+
if (r && s === "=")
|
|
1872
|
+
i = e;
|
|
1873
|
+
else if (n && s !== ";")
|
|
1874
|
+
i = e;
|
|
1875
|
+
else {
|
|
1876
|
+
var u = t[e];
|
|
1877
|
+
if (u)
|
|
1878
|
+
i = u;
|
|
1879
|
+
else if (e[0] === "&" && e[1] === "#") {
|
|
1880
|
+
var a = e[2], c = a == "x" || a == "X" ? parseInt(e.substr(3), 16) : parseInt(e.substr(2));
|
|
1881
|
+
i = c >= 1114111 ? ba : c > 65535 ? ha(c) : Rt(da[c] || c);
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
return i;
|
|
1885
|
+
}
|
|
1886
|
+
function st(e, t) {
|
|
1887
|
+
var r = t === void 0 ? ma : t, n = r.level, i = n === void 0 ? "all" : n, s = r.scope, u = s === void 0 ? i === "xml" ? "strict" : "body" : s;
|
|
1888
|
+
if (!e)
|
|
1889
|
+
return "";
|
|
1890
|
+
var a = ya[i][u], c = fa[i].entities, l = u === "attribute", g = u === "strict";
|
|
1891
|
+
return e.replace(a, function(p) {
|
|
1892
|
+
return va(p, c, l, g);
|
|
1893
|
+
});
|
|
1894
|
+
}
|
|
1895
|
+
var Sa = { strictlyTwoElementsInRangeArrays: !1, progressFn: null };
|
|
1896
|
+
function ce(e, t) {
|
|
1897
|
+
if (!Array.isArray(e) || !e.length) return e;
|
|
1898
|
+
let r = { ...Sa, ...t }, n, i;
|
|
1899
|
+
if (r.strictlyTwoElementsInRangeArrays && !e.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(e[n], null, 4)}) has not two but ${i} elements!`);
|
|
1900
|
+
if (!e.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(e[n], null, 4)}) does not consist of only natural numbers!`);
|
|
1901
|
+
let s = e.length ** 2, u = 0;
|
|
1902
|
+
return Array.from(e).sort((a, c) => (r.progressFn && (u += 1, r.progressFn(Math.floor(u * 100 / s))), a[0] === c[0] ? a[1] < c[1] ? -1 : a[1] > c[1] ? 1 : 0 : a[0] < c[0] ? -1 : 1));
|
|
1903
|
+
}
|
|
1904
|
+
var it = { mergeType: 1, progressFn: null, joinRangesThatTouchEdges: !0 };
|
|
1905
|
+
function wa(e, t) {
|
|
1906
|
+
function r(l) {
|
|
1907
|
+
return !!l && typeof l == "object" && !Array.isArray(l);
|
|
1908
|
+
}
|
|
1909
|
+
if (!Array.isArray(e) || !e.length) return null;
|
|
1910
|
+
let n;
|
|
1911
|
+
if (t) if (r(t)) {
|
|
1912
|
+
if (n = { ...it, ...t }, n.progressFn && r(n.progressFn) && !Object.keys(n.progressFn).length) n.progressFn = null;
|
|
1913
|
+
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)}`);
|
|
1914
|
+
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)}`);
|
|
1915
|
+
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)}`);
|
|
1916
|
+
} else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
1917
|
+
${JSON.stringify(t, null, 4)} (type ${typeof t})`);
|
|
1918
|
+
else n = { ...it };
|
|
1919
|
+
let i = e.filter((l) => Array.isArray(l)).map((l) => [...l]).filter((l) => l[2] !== void 0 || l[0] !== l[1]), s, u, a;
|
|
1920
|
+
n.progressFn ? s = ce(i, { progressFn: (l) => {
|
|
1921
|
+
a = Math.floor(l / 5), a !== u && (u = a, n.progressFn(a));
|
|
1922
|
+
} }) : s = ce(i);
|
|
1923
|
+
let c = s.length - 1;
|
|
1924
|
+
for (let l = c; l > 0; l--) n.progressFn && (a = Math.floor((1 - l / c) * 78) + 21, a !== u && a > u && (u = 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);
|
|
1925
|
+
return s.length ? s : null;
|
|
1926
|
+
}
|
|
1927
|
+
var Oa = {}, Aa = Oa.NODE_ENV === "production", ot = "Invariant failed";
|
|
1928
|
+
function ka(e, t) {
|
|
1929
|
+
if (!e) {
|
|
1930
|
+
if (Aa)
|
|
1931
|
+
throw new Error(ot);
|
|
1932
|
+
var r = ot;
|
|
1933
|
+
throw new Error(r);
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
function Ta(e, t, r) {
|
|
1937
|
+
if (arguments.length === 0) throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");
|
|
1938
|
+
if (typeof e != "string") throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e, null, 4)}`);
|
|
1939
|
+
if (t && !Array.isArray(t)) throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t, null, 4)}`);
|
|
1940
|
+
if (!t?.filter((u) => u).length) return e;
|
|
1941
|
+
let n;
|
|
1942
|
+
Array.isArray(t) && Number.isInteger(t[0]) && Number.isInteger(t[1]) ? n = [Array.from(t)] : n = Array.from(t), n.length, n.filter((u) => u).forEach((u, a) => {
|
|
1943
|
+
if (!Array.isArray(u)) throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${a}th element not an array: ${JSON.stringify(u, null, 4)}, which is ${typeof u}`);
|
|
1944
|
+
if (!Number.isInteger(u[0])) {
|
|
1945
|
+
if (!Number.isInteger(+u[0]) || +u[0] < 0) throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${a}th element, array ${JSON.stringify(u, null, 0)}. Its first element is not an integer, string index, but ${typeof u[0]}, equal to: ${JSON.stringify(u[0], null, 4)}.`);
|
|
1946
|
+
n[a][0] = +n[a][0];
|
|
1947
|
+
}
|
|
1948
|
+
if (!Number.isInteger(u[1])) {
|
|
1949
|
+
if (!Number.isInteger(+u[1]) || +u[1] < 0) throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${a}th element, array ${JSON.stringify(u, null, 0)}. Its second element is not an integer, string index, but ${typeof u[1]}, equal to: ${JSON.stringify(u[1], null, 4)}.`);
|
|
1950
|
+
n[a][1] = +n[a][1];
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
let i = wa(n, { progressFn: (u) => {
|
|
1954
|
+
} });
|
|
1955
|
+
ka(i);
|
|
1956
|
+
let s = i.length;
|
|
1957
|
+
if (s > 0) {
|
|
1958
|
+
let u = e.slice(i[s - 1][1]);
|
|
1959
|
+
e = i.reduce((a, c, l, g) => {
|
|
1960
|
+
let p = l === 0 ? 0 : g[l - 1][1], h = g[l][0];
|
|
1961
|
+
return `${a}${e.slice(p, h)}${g[l][2] || ""}`;
|
|
1962
|
+
}, ""), e += u;
|
|
1963
|
+
}
|
|
1964
|
+
return e;
|
|
1965
|
+
}
|
|
1966
|
+
function Oe(e, t = 1) {
|
|
1967
|
+
let r = " ";
|
|
1968
|
+
function n(s) {
|
|
1969
|
+
return Array.from(s).reverse().join("");
|
|
1970
|
+
}
|
|
1971
|
+
function i(s, u, a) {
|
|
1972
|
+
let c = a ? `
|
|
1973
|
+
` : "\r", l = a ? "\r" : `
|
|
1974
|
+
`;
|
|
1975
|
+
if (!s) return s;
|
|
1976
|
+
let g = 0, p = "";
|
|
1977
|
+
for (let h = 0, d = s.length; h < d; h++) (s[h] === c || s[h] === l && s[h - 1] !== c) && g++, `\r
|
|
1978
|
+
`.includes(s[h]) || s[h] === r ? s[h] === r ? p += s[h] : s[h] === c ? g <= u && (p += s[h], s[h + 1] === l && (p += s[h + 1], h++)) : s[h] === l && s?.[h - 1] !== c && g <= u && (p += s[h]) : !s[h + 1] && !g && (p += " ");
|
|
1979
|
+
return p;
|
|
1980
|
+
}
|
|
1981
|
+
if (typeof e == "string" && e.length) {
|
|
1982
|
+
let s = 1;
|
|
1983
|
+
typeof +t == "number" && Number.isInteger(+t) && +t >= 0 && (s = +t);
|
|
1984
|
+
let u = "", a = "";
|
|
1985
|
+
if (!e.trim()) u = e;
|
|
1986
|
+
else if (!e[0].trim()) {
|
|
1987
|
+
for (let c = 0, l = e.length; c < l; c++) if (e[c].trim()) {
|
|
1988
|
+
u = e.slice(0, c);
|
|
1989
|
+
break;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
if (e.trim() && (e.slice(-1).trim() === "" || e.slice(-1) === r)) {
|
|
1993
|
+
for (let c = e.length; c--; ) if (e[c].trim()) {
|
|
1994
|
+
a = e.slice(c + 1);
|
|
1995
|
+
break;
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
return `${i(u, s, !1)}${e.trim()}${n(i(n(a), s, !0))}`;
|
|
1999
|
+
}
|
|
2000
|
+
return e;
|
|
2001
|
+
}
|
|
2002
|
+
var lt = { mergeType: 1, progressFn: null, joinRangesThatTouchEdges: !0 };
|
|
2003
|
+
function Ra(e, t) {
|
|
2004
|
+
function r(l) {
|
|
2005
|
+
return !!l && typeof l == "object" && !Array.isArray(l);
|
|
2006
|
+
}
|
|
2007
|
+
if (!Array.isArray(e) || !e.length) return null;
|
|
2008
|
+
let n;
|
|
2009
|
+
if (t) if (r(t)) {
|
|
2010
|
+
if (n = { ...lt, ...t }, n.progressFn && r(n.progressFn) && !Object.keys(n.progressFn).length) n.progressFn = null;
|
|
2011
|
+
else if (n.progressFn && typeof n.progressFn != "function") throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn, null, 4)}`);
|
|
2012
|
+
if (![1, 2, "1", "2"].includes(n.mergeType)) throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType, null, 4)}`);
|
|
2013
|
+
if (typeof n.joinRangesThatTouchEdges != "boolean") throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges, null, 4)}`);
|
|
2014
|
+
} else throw new Error(`ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
2015
|
+
${JSON.stringify(t, null, 4)} (type ${typeof t})`);
|
|
2016
|
+
else n = { ...lt };
|
|
2017
|
+
let i = e.filter((l) => Array.isArray(l)).map((l) => [...l]).filter((l) => l[2] !== void 0 || l[0] !== l[1]), s, u, a;
|
|
2018
|
+
n.progressFn ? s = ce(i, { progressFn: (l) => {
|
|
2019
|
+
a = Math.floor(l / 5), a !== u && (u = a, n.progressFn != null && n.progressFn(a));
|
|
2020
|
+
} }) : s = ce(i);
|
|
2021
|
+
let c = s.length - 1;
|
|
2022
|
+
for (let l = c; l > 0; l--) n.progressFn && (a = Math.floor((1 - l / c) * 78) + 21, a !== u && a > u && (u = 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);
|
|
2023
|
+
return s.length ? s : null;
|
|
2024
|
+
}
|
|
2025
|
+
var Ca = { limitToBeAddedWhitespace: !1, limitLinebreaksCount: 1, mergeType: 1 }, Ea = class {
|
|
2026
|
+
constructor(e) {
|
|
2027
|
+
let t = { ...Ca, ...e };
|
|
2028
|
+
if (t.mergeType && t.mergeType !== 1 && t.mergeType !== 2) if (G(t.mergeType) && t.mergeType.trim() === "1") t.mergeType = 1;
|
|
2029
|
+
else if (G(t.mergeType) && t.mergeType.trim() === "2") t.mergeType = 2;
|
|
2030
|
+
else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType, null, 4)}`);
|
|
2031
|
+
this.opts = t, this.ranges = [];
|
|
2032
|
+
}
|
|
2033
|
+
ranges;
|
|
2034
|
+
opts;
|
|
2035
|
+
add(e, t, r) {
|
|
2036
|
+
if (e == null && t == null) return;
|
|
2037
|
+
if (B(e) && !B(t)) {
|
|
2038
|
+
if (Array.isArray(e)) {
|
|
2039
|
+
if (e.length) {
|
|
2040
|
+
if (e.some((s) => Array.isArray(s))) {
|
|
2041
|
+
e.forEach((s) => {
|
|
2042
|
+
Array.isArray(s) && this.add(...s);
|
|
2043
|
+
});
|
|
2044
|
+
return;
|
|
2045
|
+
}
|
|
2046
|
+
e.length && _(+e[0]) && _(+e[1]) && this.add(...e);
|
|
2047
|
+
}
|
|
2048
|
+
return;
|
|
2049
|
+
}
|
|
2050
|
+
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(t, null, 0)})`);
|
|
2051
|
+
} else if (!B(e) && B(t)) throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t, null, 0)}) but first-one, "from" is not (${JSON.stringify(e, null, 0)})`);
|
|
2052
|
+
let n = +e, i = +t;
|
|
2053
|
+
if (_(n) && _(i)) {
|
|
2054
|
+
if (B(r) && !G(r) && !rr(r)) throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
|
|
2055
|
+
${JSON.stringify(r, null, 4)}`);
|
|
2056
|
+
if (B(this.ranges) && Array.isArray(this.last()) && n === this.last()[1]) {
|
|
2057
|
+
if (this.last()[1] = i, this.last()[2], this.last()[2] !== null && B(r)) {
|
|
2058
|
+
let s = this.last()[2] && this.last()[2].length && (!this.opts?.mergeType || this.opts.mergeType === 1) ? `${this.last()[2]}${r}` : r;
|
|
2059
|
+
this.opts.limitToBeAddedWhitespace && (s = Oe(s, this.opts.limitLinebreaksCount)), G(s) && !s.length || (this.last()[2] = s);
|
|
2060
|
+
}
|
|
2061
|
+
} else {
|
|
2062
|
+
this.ranges || (this.ranges = []);
|
|
2063
|
+
let s = r !== void 0 && !(G(r) && !r.length) ? [n, i, r && this.opts.limitToBeAddedWhitespace ? Oe(r, this.opts.limitLinebreaksCount) : r] : [n, i];
|
|
2064
|
+
this.ranges.push(s);
|
|
2065
|
+
}
|
|
2066
|
+
} else throw _(n) && n >= 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 i}" equal to: ${JSON.stringify(i, 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 n}" equal to: ${JSON.stringify(n, null, 4)}`);
|
|
2067
|
+
}
|
|
2068
|
+
push(e, t, r) {
|
|
2069
|
+
this.add(e, t, r);
|
|
2070
|
+
}
|
|
2071
|
+
current() {
|
|
2072
|
+
return Array.isArray(this.ranges) && this.ranges.length ? (this.ranges = Ra(this.ranges, { mergeType: this.opts.mergeType }), this.ranges && this.opts.limitToBeAddedWhitespace ? this.ranges.map((e) => B(e[2]) ? [e[0], e[1], Oe(e[2], this.opts.limitLinebreaksCount)] : e) : this.ranges) : null;
|
|
2073
|
+
}
|
|
2074
|
+
wipe() {
|
|
2075
|
+
this.ranges = [];
|
|
2076
|
+
}
|
|
2077
|
+
replace(e) {
|
|
2078
|
+
if (Array.isArray(e) && e.length) if (Array.isArray(e[0]) && _(e[0][0])) this.ranges = Array.from(e);
|
|
2079
|
+
else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0], null, 4)} should be an array and its first element should be an integer, a string index.`);
|
|
2080
|
+
else this.ranges = [];
|
|
2081
|
+
}
|
|
2082
|
+
last() {
|
|
2083
|
+
return Array.isArray(this.ranges) && this.ranges.length ? this.ranges[this.ranges.length - 1] : null;
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
dt();
|
|
2087
|
+
var Ae = " ";
|
|
2088
|
+
function qa({ str: e, idx: t = 0, stopAtNewlines: r = !1, stopAtRawNbsp: n = !1 }) {
|
|
2089
|
+
if (typeof e != "string" || !e.length || ((!t || typeof t != "number") && (t = 0), !e[t + 1])) return null;
|
|
2090
|
+
if (e[t + 1] && (e[t + 1].trim() || r && `
|
|
2091
|
+
\r`.includes(e[t + 1]) || n && e[t + 1] === Ae)) return t + 1;
|
|
2092
|
+
if (e[t + 2] && (e[t + 2].trim() || r && `
|
|
2093
|
+
\r`.includes(e[t + 2]) || n && e[t + 2] === Ae)) return t + 2;
|
|
2094
|
+
for (let i = t + 1, s = e.length; i < s; i++) if (e[i].trim() || r && `
|
|
2095
|
+
\r`.includes(e[i]) || n && e[i] === Ae) return i;
|
|
2096
|
+
return null;
|
|
2097
|
+
}
|
|
2098
|
+
function q(e, t = 0) {
|
|
2099
|
+
return qa({ str: e, idx: t, stopAtNewlines: !1, stopAtRawNbsp: !1 });
|
|
2100
|
+
}
|
|
2101
|
+
function Na(e) {
|
|
2102
|
+
return /[-_A-Za-z0-9]/.test(e);
|
|
2103
|
+
}
|
|
2104
|
+
function ut(e, t) {
|
|
2105
|
+
if (!e) return [];
|
|
2106
|
+
if (Array.isArray(e)) return e.filter((r) => typeof r == "string" && r.trim());
|
|
2107
|
+
if (typeof e == "string") return e.trim() ? [e] : [];
|
|
2108
|
+
throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_05] ${t} must be array containing zero or more strings or something falsey. Currently it's equal to: ${e}, that a type of ${typeof e}.`);
|
|
2109
|
+
}
|
|
2110
|
+
function oe(e, t, r, n) {
|
|
2111
|
+
for (let i = t, s = e.length; i < s; i++) {
|
|
2112
|
+
if (e.startsWith(r, i)) return !0;
|
|
2113
|
+
if (e.startsWith(n, i)) return !1;
|
|
2114
|
+
}
|
|
2115
|
+
return !1;
|
|
2116
|
+
}
|
|
2117
|
+
function ct(e, t, r) {
|
|
2118
|
+
return e?.quotes, e?.quotes?.value && oe(t, r + 1, e.quotes.value, ">"), e?.quotes?.next, oe(t, e?.quotes?.next - 1, e?.quotes?.value, ">"), !e?.quotes || !oe(t, r + 1, e.quotes.value, ">") && e?.quotes?.next !== -1 && oe(t, e?.quotes?.next - 1, e?.quotes?.value, ">");
|
|
2119
|
+
}
|
|
2120
|
+
function La(e, t) {
|
|
2121
|
+
return (t.match(new RegExp(e, "g")) || []).length;
|
|
2122
|
+
}
|
|
2123
|
+
var te = /* @__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"]), ke = /* @__PURE__ */ new Set(["a", "b", "i", "p", "q", "s", "u"]), Te = /* @__PURE__ */ new Set([".", ",", ";", "!", "?"]), gt = /* @__PURE__ */ new Set([".", ",", "?", ";", ")", "…", '"', "»"]), Ia = /* @__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"]), pt = { 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 };
|
|
2124
|
+
function Ct(e, t) {
|
|
2125
|
+
let r = Date.now(), n = [], i = [], s = [], u = [], a = {};
|
|
2126
|
+
function c() {
|
|
2127
|
+
a = { attributes: [] };
|
|
2128
|
+
}
|
|
2129
|
+
c();
|
|
2130
|
+
let l = null, g = null, p = null, h = !1, d = {}, v = { tagName: "", hrefValue: "", openingTagEnds: void 0 }, O = "", C = !1, R = null, N = !0;
|
|
2131
|
+
function ae(o, m, b) {
|
|
2132
|
+
if (Array.isArray(m.stripTogetherWithTheirContents) && (m.stripTogetherWithTheirContents.includes(a.name) || m.stripTogetherWithTheirContents.includes("*"))) if (a.slashPresent && Array.isArray(n) && n.some((y) => y.name === a.name)) {
|
|
2133
|
+
for (let y = n.length; y--; ) if (n[y].name === a.name) {
|
|
2134
|
+
u = u.filter(([A, T]) => (A < n[y].lastOpeningBracketAt || A >= o + 1) && (T <= n[y].lastOpeningBracketAt || T > o + 1));
|
|
2135
|
+
let k = o + 1;
|
|
2136
|
+
a.lastClosingBracketAt && (k = a.lastClosingBracketAt + 1), u.push([n[y].lastOpeningBracketAt, k]), gt.has(e[o]) && m.cb ? m.cb({ tag: a, deleteFrom: n[y].lastOpeningBracketAt, deleteTo: o + 1, insert: null, rangesArr: b, proposedReturn: [n[y].lastOpeningBracketAt, o, null] }) : m.cb && m.cb({ tag: a, deleteFrom: n[y].lastOpeningBracketAt, deleteTo: o, insert: "", rangesArr: b, proposedReturn: [n[y].lastOpeningBracketAt, o, ""] }), n.splice(y, 1);
|
|
2137
|
+
break;
|
|
2138
|
+
}
|
|
2139
|
+
} else a.slashPresent || n.push(a);
|
|
2140
|
+
else Array.isArray(m.ignoreTagsWithTheirContents) && he(o, m, a) && (N = !1);
|
|
2141
|
+
}
|
|
2142
|
+
function V(o, m, b, y, k, A) {
|
|
2143
|
+
if (Array.isArray(w.current()) && typeof b == "number" && w.current()[0][0] === 0 && w.current()[0][1] >= b) return "";
|
|
2144
|
+
if (e.length === y && A && !f?.dumpLinkHrefsNearby?.enabled) return null;
|
|
2145
|
+
let T = "";
|
|
2146
|
+
if (Number.isInteger(b) && b < k && (T += o.slice(b, k)), Number.isInteger(y) && y > A + 1) {
|
|
2147
|
+
let I = o.slice(A + 1, y);
|
|
2148
|
+
y && !q(e, y - 1) && (I = I.trimEnd()), I.includes(`
|
|
2149
|
+
`) && L(y, o) ? T += " " : T += I;
|
|
2150
|
+
}
|
|
2151
|
+
let z = !gt.has(o[m]), He = o[y - 1] !== ">" || !o[b].trim(), Ve = !['"', "("].includes(o[k - 1]), qt = ![";", ".", ":", "!"].includes(o[m]);
|
|
2152
|
+
if ((z || He && Ve && qt) && (He || Ve) && o[m] !== "!" && (!Ia.has(a.name) || typeof b == "number" && b < k || typeof y == "number" && y > A + 1)) {
|
|
2153
|
+
let I = T.match(/\n/g);
|
|
2154
|
+
return Array.isArray(I) && I.length ? I.length === 1 ? `
|
|
2155
|
+
` : I.length === 2 ? `
|
|
2156
|
+
|
|
2157
|
+
` : `
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
` : " ";
|
|
2161
|
+
}
|
|
2162
|
+
return "";
|
|
2163
|
+
}
|
|
2164
|
+
function de(o, m) {
|
|
2165
|
+
if (o.dumpLinkHrefsNearby?.enabled && v.tagName && v.tagName === a.name && a.lastOpeningBracketAt && (v.openingTagEnds && a.lastOpeningBracketAt > v.openingTagEnds || !v.openingTagEnds) && (C = !0), C) {
|
|
2166
|
+
let b = o.dumpLinkHrefsNearby?.putOnNewLine ? `
|
|
2167
|
+
|
|
2168
|
+
` : "";
|
|
2169
|
+
O = `${b}${v.hrefValue}`, (typeof m != "number" || q(e, m - 1)) && (O += b);
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
function L(o, m) {
|
|
2173
|
+
return m ? m[o] === "<" && m[o + 1] !== "%" : e[o] === "<" && e[o + 1] !== "%";
|
|
2174
|
+
}
|
|
2175
|
+
function P(o) {
|
|
2176
|
+
return e[o] === ">" && e[o - 1] !== "%";
|
|
2177
|
+
}
|
|
2178
|
+
function he(o, m, b) {
|
|
2179
|
+
if (m.ignoreTagsWithTheirContents.includes("*")) return !0;
|
|
2180
|
+
let y = e.indexOf(`<${b.name}`, o), k = e.indexOf(`</${b.name}`, o);
|
|
2181
|
+
return !b.slashPresent && k === -1 || b.slashPresent && !i.some((A) => A.name === b.name) || k > -1 && y > -1 && y < k ? !1 : m.ignoreTagsWithTheirContents.includes(b.name);
|
|
2182
|
+
}
|
|
2183
|
+
if (typeof e != "string") throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_01] Input must be string! Currently it's: ${(typeof e).toLowerCase()}, equal to:
|
|
2184
|
+
${JSON.stringify(e, null, 4)}`);
|
|
2185
|
+
if (t) if (Ne(t)) {
|
|
2186
|
+
if (t.reportProgressFunc && typeof t.reportProgressFunc != "function") throw new Error(`string-strip-html/stripHtml(): [THROW_ID_03] The Optional Options Object's key reportProgressFunc, callback function, should be a function but it was given as type ${typeof t.reportProgressFunc}, equal to ${JSON.stringify(t.reportProgressFunc, null, 4)}`);
|
|
2187
|
+
if (typeof t.dumpLinkHrefsNearby == "boolean" && t.dumpLinkHrefsNearby != null) throw new Error(`string-strip-html/stripHtml(): [THROW_ID_04] The Optional Options Object's key should be a plain object but it was given as type ${typeof t.dumpLinkHrefsNearby}, equal to ${JSON.stringify(t.dumpLinkHrefsNearby, null, 4)}`);
|
|
2188
|
+
} else throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_02] Optional Options Object must be a plain object! Currently it's: ${(typeof t).toLowerCase()}, equal to:
|
|
2189
|
+
${JSON.stringify(t, null, 4)}`);
|
|
2190
|
+
function fe() {
|
|
2191
|
+
C && (v = { tagName: "", hrefValue: "", openingTagEnds: void 0 }, C = !1);
|
|
2192
|
+
}
|
|
2193
|
+
let f = { ...pt, ...t, dumpLinkHrefsNearby: Object.assign({}, pt.dumpLinkHrefsNearby, t?.dumpLinkHrefsNearby) };
|
|
2194
|
+
if (nr(f, "returnRangesOnly")) throw new TypeError("string-strip-html/stripHtml(): [THROW_ID_05] The Optional Options Object's key returnRangesOnly has been removed from the API since v.5 release.");
|
|
2195
|
+
if (f.reportProgressFunc) {
|
|
2196
|
+
if (typeof f.reportProgressFuncFrom != "number") throw new Error(`string-strip-html/stripHtml(): [THROW_ID_06] The Optional Options Object's key reportProgressFuncFrom, callback function's "from" range, should be a number but it was given as type ${typeof f.reportProgressFuncFrom}, equal to ${JSON.stringify(f.reportProgressFuncFrom, null, 4)}`);
|
|
2197
|
+
if (typeof f.reportProgressFuncTo != "number") throw new Error(`string-strip-html/stripHtml(): [THROW_ID_07] The Optional Options Object's key reportProgressFuncTo, callback function's "to" range, should be a number but it was given as type ${typeof f.reportProgressFuncTo}, equal to ${JSON.stringify(f.reportProgressFuncTo, null, 4)}`);
|
|
2198
|
+
}
|
|
2199
|
+
f.ignoreTags = ut(f.ignoreTags, "resolvedOpts.ignoreTags"), f.onlyStripTags = ut(f.onlyStripTags, "resolvedOpts.onlyStripTags");
|
|
2200
|
+
let Fe = !!f.onlyStripTags.length;
|
|
2201
|
+
f.onlyStripTags.length && f.ignoreTags.length && (f.onlyStripTags = ca(f.onlyStripTags, ...f.ignoreTags)), f.stripTogetherWithTheirContents ? typeof f.stripTogetherWithTheirContents == "string" && f.stripTogetherWithTheirContents.length && (f.stripTogetherWithTheirContents = [f.stripTogetherWithTheirContents]) : f.stripTogetherWithTheirContents = [];
|
|
2202
|
+
let X = {};
|
|
2203
|
+
if (f.stripTogetherWithTheirContents && Array.isArray(f.stripTogetherWithTheirContents) && f.stripTogetherWithTheirContents.length && !f.stripTogetherWithTheirContents.every((o, m) => typeof o != "string" ? (X.el = o, X.i = m, !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 ${X.i} has a value ${X.el} which is not string but ${(typeof X.el).toLowerCase()}.`);
|
|
2204
|
+
f.cb || (f.cb = ({ rangesArr: o, proposedReturn: m }) => {
|
|
2205
|
+
m && o.push(...m);
|
|
2206
|
+
});
|
|
2207
|
+
let w = new Ea({ limitToBeAddedWhitespace: !0, limitLinebreaksCount: 2 });
|
|
2208
|
+
if (!f.skipHtmlDecoding) for (; e !== st(e, { scope: "strict" }); ) e = st(e, { scope: "strict" });
|
|
2209
|
+
let $ = !1, U = !1, se = 0, $e = 0, E = e.length, Et = Math.floor(E / 2);
|
|
2210
|
+
for (let o = 0; o < E; o++) {
|
|
2211
|
+
if (f.reportProgressFunc && (E > 1e3 && E < 2e3 ? o === Et && f.reportProgressFunc(Math.floor((f.reportProgressFuncTo - f.reportProgressFuncFrom) / 2)) : E >= 2e3 && (se = f.reportProgressFuncFrom + Math.floor(o / E * (f.reportProgressFuncTo - f.reportProgressFuncFrom)), se !== $e && ($e = se, f.reportProgressFunc(se)))), Object.keys(a).length > 1 && a.lastClosingBracketAt && a.lastClosingBracketAt < o && e[o] !== " " && R === null && (R = o), !$ && e[o] === "%" && e[o - 1] === "{" && e.includes("%}", o + 1)) {
|
|
2212
|
+
p = null;
|
|
2213
|
+
let m = e.indexOf("%}", o) - 1;
|
|
2214
|
+
if (m > o) {
|
|
2215
|
+
o = m;
|
|
2216
|
+
continue;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
if (!$ && P(o) && (!a || Object.keys(a).length < 2) && o > 1) {
|
|
2220
|
+
for (let m = o; m--; ) if (e[m - 1] === void 0 || P(m)) {
|
|
2221
|
+
let b = e[m - 1] === void 0 ? m : m + 1, y = e.slice(b, o + 1) || "";
|
|
2222
|
+
if ((y.includes("/>") || y.includes("/ >") || y.includes('="') || y.includes("='")) && e !== `<${nt(y.trim(), "/>")}>` && [...te].some((k) => nt(y.trim().split(/\s+/).filter((A) => A.trim()).filter((A, T) => T === 0), "/>").toLowerCase() === k) && Ct(`<${y.trim()}>`, f).result === "") {
|
|
2223
|
+
(!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([b, o + 1]), (!u.length || u[u.length - 1][0] !== a.lastOpeningBracketAt) && u.push([b, o + 1]);
|
|
2224
|
+
let k = V(e, o, b, o + 1, b, o + 1), A = o + 1;
|
|
2225
|
+
if (e[A] && !e[A].trim()) {
|
|
2226
|
+
for (let T = A; T < E; T++) if (e[T].trim()) {
|
|
2227
|
+
A = T;
|
|
2228
|
+
break;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
f.cb({ tag: a, deleteFrom: b, deleteTo: A, insert: k, rangesArr: w, proposedReturn: [b, A, k] });
|
|
2232
|
+
}
|
|
2233
|
+
break;
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
if (!U && e[o] === "/" && !a.quotes?.value && Number.isInteger(a.lastOpeningBracketAt) && !Number.isInteger(a.lastClosingBracketAt) && (a.slashPresent = o), e[o] === '"' || e[o] === "'") if (!U && a.nameStarts && a?.quotes?.value === e[o]) if (d.valueStarts === void 0) d = {}, delete a.quotes;
|
|
2237
|
+
else {
|
|
2238
|
+
d.valueEnds = o, d.value = e.slice(d.valueStarts, o), a.attributes.push(d), d = {}, delete a.quotes;
|
|
2239
|
+
let m;
|
|
2240
|
+
f.dumpLinkHrefsNearby?.enabled && !n.length && a.attributes.some((b) => {
|
|
2241
|
+
if (typeof b.name == "string" && b.name.toLowerCase() === "href") return m = `${f.dumpLinkHrefsNearby?.wrapHeads || ""}${b.value}${f.dumpLinkHrefsNearby?.wrapTails || ""}`, !0;
|
|
2242
|
+
}) && (v = { tagName: a.name, hrefValue: m, openingTagEnds: void 0 });
|
|
2243
|
+
}
|
|
2244
|
+
else !U && !a.quotes && a.nameStarts && (a.quotes = {}, a.quotes.value = e[o], a.quotes.start = o, a.quotes.next = e.indexOf(e[o], o + 1), d.nameStarts && d.nameEnds && d.nameEnds < o && d.nameStarts < o && !d.valueStarts && (d.name = e.slice(d.nameStarts, d.nameEnds)));
|
|
2245
|
+
if (a.nameStarts !== void 0 && a.nameEnds === void 0 && (!e[o].trim() || !Na(e[o]))) {
|
|
2246
|
+
if (a.nameEnds = o, a.name = e.slice(a.nameStarts, a.nameEnds + (!P(o) && e[o] !== "/" && e[o + 1] === void 0 ? 1 : 0)), e[a.nameStarts - 1] !== "!" && !a.name.replace(/-/g, "").length || /^\d+$/.test(a.name[0])) {
|
|
2247
|
+
a = {};
|
|
2248
|
+
continue;
|
|
2249
|
+
}
|
|
2250
|
+
if (typeof a.name == "string" && a.name.toLowerCase() === "doctype" && (U = !0), L(o)) {
|
|
2251
|
+
de(f);
|
|
2252
|
+
let m = V(e, o, a.leftOuterWhitespace, o, a.lastOpeningBracketAt, o);
|
|
2253
|
+
(f.stripTogetherWithTheirContents.includes(a.name) || f.stripTogetherWithTheirContents.includes("*")) && (u = u.filter(([b, y]) => !(b === a.leftOuterWhitespace && y === o))), f.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: o, insert: `${m}${O}${m}`, rangesArr: w, proposedReturn: [a.leftOuterWhitespace, o, `${m}${O}${m}`] }), fe(), ae(o, f, w);
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
if (a.quotes?.start && a.quotes.start < o && !a.quotes.end && d.nameEnds && d.equalsAt && !d.valueStarts && (d.valueStarts = o), !a.quotes && d.nameEnds && e[o] === "=" && !d.valueStarts && !d.equalsAt && (d.equalsAt = o), !a.quotes && d.nameStarts && d.nameEnds && !d.valueStarts && e[o].trim() && e[o] !== "=" && (a.attributes.push(d), d = {}), !a.quotes && d.nameStarts && !d.nameEnds && (U && `'"`.includes(e[d.nameStarts]) ? d.nameStarts < o && e[o] === e[d.nameStarts] && (d.nameEnds = o + 1, d.name = e.slice(d.nameStarts, d.nameEnds)) : e[o].trim() ? e[o] === "=" ? d.equalsAt || (d.nameEnds = o, d.equalsAt = o, d.name = e.slice(d.nameStarts, d.nameEnds)) : e[o] === "/" || P(o) ? (d.nameEnds = o, d.name = e.slice(d.nameStarts, d.nameEnds), a.attributes.push(d), d = {}) : L(o) && (d.nameEnds = o, d.name = e.slice(d.nameStarts, d.nameEnds), a.attributes.push(d), d = {}) : (d.nameEnds = o, d.name = e.slice(d.nameStarts, d.nameEnds))), !a.quotes && a.nameEnds < o && !e[o - 1].trim() && e[o].trim() && !"<>/!".includes(e[o]) && !d.nameStarts && !a.lastClosingBracketAt && (d.nameStarts = o), a.lastOpeningBracketAt !== null && a.lastOpeningBracketAt < o && e[o] === "/" && a.onlyPlausible && (a.onlyPlausible = !1), a.lastOpeningBracketAt !== null && a.lastOpeningBracketAt < o && e[o] !== "/" && (a.onlyPlausible === void 0 && ((!e[o].trim() || L(o)) && !a.slashPresent ? a.onlyPlausible = !0 : a.onlyPlausible = !1), e[o].trim() && a.nameStarts === void 0 && !L(o) && e[o] !== "/" && !P(o) && e[o] !== "!" && (a.nameStarts = o, a.nameContainsLetters = !1)), a.nameStarts && !a.quotes && typeof e[o] == "string" && e[o].toLowerCase() !== e[o].toUpperCase() && (a.nameContainsLetters = !0), P(o) && (ct(a, e, o) || a.quotes.value && typeof a.lastOpeningBracketAt == "number" && La(a.quotes.value, e.slice(a.lastOpeningBracketAt, o)) % 2 === 1 && !e.slice(a.lastOpeningBracketAt + 1, o).includes("<") && !e.slice(a.lastOpeningBracketAt + 1, o).includes(">")) && a.lastOpeningBracketAt !== void 0 && (a.lastClosingBracketAt = o, R = null, Object.keys(d).length && (a.attributes.push(d), d = {}), f.dumpLinkHrefsNearby?.enabled && v.tagName && !v.openingTagEnds && (v.openingTagEnds = o)), (!U || e[o] === ">") && a.lastOpeningBracketAt !== void 0) {
|
|
2257
|
+
if (a.lastClosingBracketAt === void 0) {
|
|
2258
|
+
if (a.lastOpeningBracketAt < o && !L(o) && (e[o + 1] === void 0 || L(o + 1) && !a?.quotes?.value) && a.nameContainsLetters && typeof a.nameStarts == "number") {
|
|
2259
|
+
if (a.name = e.slice(a.nameStarts, a.nameEnds || o + 1).toLowerCase(), (!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([a.lastOpeningBracketAt, o + 1]), f.ignoreTags.includes(a.name) || he(o, f, a) || !te.has(a.name) && (a.onlyPlausible || f.stripRecognisedHTMLOnly)) {
|
|
2260
|
+
a = {}, d = {};
|
|
2261
|
+
continue;
|
|
2262
|
+
}
|
|
2263
|
+
if ((te.has(a.name) || ke.has(a.name)) && (a.onlyPlausible === !1 || a.onlyPlausible === !0 && a.attributes.length) || e[o + 1] === void 0) {
|
|
2264
|
+
de(f);
|
|
2265
|
+
let m = V(e, o, a.leftOuterWhitespace, o + 1, a.lastOpeningBracketAt, a.lastClosingBracketAt);
|
|
2266
|
+
$ && a.name === "script" && a.slashPresent && ($ = !1);
|
|
2267
|
+
let b;
|
|
2268
|
+
m === null || O === null ? b = null : b = `${m}${O}${m}`, f.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: o + 1, insert: b, rangesArr: w, proposedReturn: [a.leftOuterWhitespace, o + 1, b] }), fe(), ae(o, f, w);
|
|
2269
|
+
}
|
|
2270
|
+
if (!u.length || u[u.length - 1][0] !== a.lastOpeningBracketAt && u[u.length - 1][1] !== o + 1) if (f.stripTogetherWithTheirContents.includes(a.name) || f.stripTogetherWithTheirContents.includes("*")) {
|
|
2271
|
+
let m;
|
|
2272
|
+
for (let b = n.length; b--; ) n[b].name === a.name && (m = n[b]);
|
|
2273
|
+
m ? (u = u.filter(([b]) => b !== m.lastOpeningBracketAt), u.push([m.lastOpeningBracketAt, o + 1])) : u.push([a.lastOpeningBracketAt, o + 1]);
|
|
2274
|
+
} else u.push([a.lastOpeningBracketAt, o + 1]);
|
|
2275
|
+
}
|
|
2276
|
+
} else if (o > a.lastClosingBracketAt && e[o].trim() || e[o + 1] === void 0 || f.ignoreIndentations && `\r
|
|
2277
|
+
`.includes(e[o])) {
|
|
2278
|
+
let m = a.lastClosingBracketAt === o ? o + 1 : o;
|
|
2279
|
+
f.trimOnlySpaces && m === E - 1 && R !== null && R < o && (m = R), (!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([a.lastOpeningBracketAt, a.lastClosingBracketAt + 1]);
|
|
2280
|
+
let b = f.ignoreTags.includes(a.name), y = he(o, f, a);
|
|
2281
|
+
if (!N || f.stripRecognisedHTMLOnly && typeof a.name == "string" && !te.has(a.name.toLowerCase()) && !ke.has(a.name.toLowerCase()) || !Fe && (b || y) || Fe && !f.onlyStripTags.includes(a.name) || f.ignoreTagsWithTheirContents.includes(a.name)) {
|
|
2282
|
+
if (y) if (a.slashPresent) {
|
|
2283
|
+
for (let k = i.length; k--; ) if (i[k].name === a.name) {
|
|
2284
|
+
i.splice(k, 1);
|
|
2285
|
+
break;
|
|
2286
|
+
}
|
|
2287
|
+
i.length || (N = !0);
|
|
2288
|
+
} else N && (N = !1), i.push(a);
|
|
2289
|
+
f.cb({ tag: a, deleteFrom: null, deleteTo: null, insert: null, rangesArr: w, proposedReturn: null }), a = {}, d = {};
|
|
2290
|
+
} else if (!a.onlyPlausible || a.attributes.length === 0 && a.name && (te.has(a.name.toLowerCase()) || ke.has(a.name.toLowerCase())) || a.attributes?.some((k) => k.equalsAt)) {
|
|
2291
|
+
(!u.length || u[u.length - 1][0] !== a.lastOpeningBracketAt) && u.push([a.lastOpeningBracketAt, a.lastClosingBracketAt + 1]);
|
|
2292
|
+
let k = V(e, o, a.leftOuterWhitespace, m, a.lastOpeningBracketAt, a.lastClosingBracketAt);
|
|
2293
|
+
O = "", C = !1, de(f, m);
|
|
2294
|
+
let A;
|
|
2295
|
+
typeof O == "string" && O.length ? (A = `${k}${O}${k === `
|
|
2296
|
+
|
|
2297
|
+
` ? `
|
|
2298
|
+
` : k}`, m === a.lastClosingBracketAt + 1 && (!e[m] || !Te.has(e[m])) && (A += " "), a.leftOuterWhitespace === a.lastOpeningBracketAt && w.last() && w.last()[1] < a.lastOpeningBracketAt && (!f?.dumpLinkHrefsNearby?.putOnNewLine || !Te.has(e[m])) && (A = " " + A)) : A = k, A !== null && (a.leftOuterWhitespace === 0 || !q(e, m - 1)) && (!f.dumpLinkHrefsNearby?.enabled || a.name !== "a") && (A = void 0);
|
|
2299
|
+
let T = 0;
|
|
2300
|
+
if (C && Te.has(e[m])) {
|
|
2301
|
+
f.dumpLinkHrefsNearby?.putOnNewLine && (A = `${e[m]}${A || ""}`);
|
|
2302
|
+
let z = q(e, m);
|
|
2303
|
+
z && A?.endsWith(`
|
|
2304
|
+
`) ? T += z - o : (!z || z > o) && T++;
|
|
2305
|
+
}
|
|
2306
|
+
f.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: m + T, insert: A, rangesArr: w, proposedReturn: [a.leftOuterWhitespace, m + T, A] }), fe(), ae(o, f, w);
|
|
2307
|
+
} else a = {};
|
|
2308
|
+
P(o) || (a = {});
|
|
2309
|
+
}
|
|
2310
|
+
U && (U = !1);
|
|
2311
|
+
}
|
|
2312
|
+
if ((!$ || e[o] === "<" && q(e, q(e, o)) && e[q(e, o)] === "/" && e.startsWith("script", q(e, q(e, o)))) && L(o) && !L(o - 1) && !`'"`.includes(e[o + 1]) && (!`'"`.includes(e[o + 2]) || /\w/.test(e[o + 1])) && !(e[o + 1] === "c" && e[o + 2] === ":") && !(e[o + 1] === "f" && e[o + 2] === "m" && e[o + 3] === "t" && e[o + 4] === ":") && !(e[o + 1] === "s" && e[o + 2] === "q" && e[o + 3] === "l" && e[o + 4] === ":") && !(e[o + 1] === "x" && e[o + 2] === ":") && !(e[o + 1] === "f" && e[o + 2] === "n" && e[o + 3] === ":") && ct(a, e, o)) {
|
|
2313
|
+
if (P(q(e, o))) continue;
|
|
2314
|
+
if (a.nameEnds && a.nameEnds < o && !a.lastClosingBracketAt && (a.onlyPlausible === !0 && a.attributes?.length || a.onlyPlausible === !1)) {
|
|
2315
|
+
let m = V(e, o, a.leftOuterWhitespace, o, a.lastOpeningBracketAt, o);
|
|
2316
|
+
f.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: o, insert: m, rangesArr: w, proposedReturn: [a.leftOuterWhitespace, o, m] }), ae(o, f, w), a = {}, d = {};
|
|
2317
|
+
}
|
|
2318
|
+
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 = o, a.slashPresent = !1, a.attributes = [], l === null ? a.leftOuterWhitespace = o : f.trimOnlySpaces && l === 0 ? a.leftOuterWhitespace = g || o : a.leftOuterWhitespace = l, `${e[o + 1]}${e[o + 2]}${e[o + 3]}` == "!--" || `${e[o + 1]}${e[o + 2]}${e[o + 3]}${e[o + 4]}${e[o + 5]}${e[o + 6]}${e[o + 7]}${e[o + 8]}` == "![CDATA[")) {
|
|
2319
|
+
let m = !0;
|
|
2320
|
+
e[o + 2] === "-" && (m = !1);
|
|
2321
|
+
let b;
|
|
2322
|
+
for (let y = o; y < E; y++) if ((!b && m && `${e[y - 2]}${e[y - 1]}${e[y]}` == "]]>" || !m && `${e[y - 2]}${e[y - 1]}${e[y]}` == "-->") && (b = y), b && (b < y && e[y].trim() || e[y + 1] === void 0)) {
|
|
2323
|
+
let k = y;
|
|
2324
|
+
(e[y + 1] === void 0 && !e[y].trim() || e[y] === ">") && (k += 1), (!s.length || s[s.length - 1][0] !== a.lastOpeningBracketAt) && s.push([a.lastOpeningBracketAt, b + 1]), (!u.length || u[u.length - 1][0] !== a.lastOpeningBracketAt) && u.push([a.lastOpeningBracketAt, b + 1]);
|
|
2325
|
+
let A = V(e, y, a.leftOuterWhitespace, k, a.lastOpeningBracketAt, b);
|
|
2326
|
+
f.cb({ tag: a, deleteFrom: a.leftOuterWhitespace, deleteTo: k, insert: A, rangesArr: w, proposedReturn: [a.leftOuterWhitespace, k, A] }), o = y - 1, e[y] === ">" && (o = y), a = {}, d = {};
|
|
2327
|
+
break;
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
!e[o].trim() || e[o].charCodeAt(0) === 847 ? (l === null && (l = o, a.lastOpeningBracketAt !== void 0 && a.lastOpeningBracketAt < o && a.nameStarts && a.nameStarts < a.lastOpeningBracketAt && o === a.lastOpeningBracketAt + 1 && !n.some((m) => m.name === a.name) && (a.onlyPlausible = !0, a.name = void 0, a.nameStarts = void 0)), (e[o] === `
|
|
2332
|
+
` || e[o] === "\r") && (p = o, h && (h = !1))) : (l !== null && (!a.quotes && d.equalsAt > l - 1 && d.nameEnds && d.equalsAt > d.nameEnds && e[o] !== '"' && e[o] !== "'" && (Ne(d) && a.attributes.push(d), d = {}, a.equalsSpottedAt = void 0), l = null), h || (h = !0, N && !$ && typeof p == "number" && o && p < o - 1 && (e.slice(p + 1, o).trim() ? p = null : f.ignoreIndentations || w.push([p + 1, o])))), e[o] === " " ? g === null && (g = o) : g !== null && (g = null), a.name === "script" && ($ = !a.slashPresent);
|
|
2333
|
+
}
|
|
2334
|
+
if (e && !f.ignoreIndentations && (f.trimOnlySpaces && e[0] === " " || !f.trimOnlySpaces && !e[0].trim())) for (let o = 0; o < E; o++) if (f.trimOnlySpaces && e[o] !== " " || !f.trimOnlySpaces && e[o].trim()) {
|
|
2335
|
+
w.push([0, o]);
|
|
2336
|
+
break;
|
|
2337
|
+
} else e[o + 1] || w.push([0, o + 1]);
|
|
2338
|
+
if (e && (f.trimOnlySpaces && e[~-e.length] === " " || !f.trimOnlySpaces && !e[~-e.length].trim())) {
|
|
2339
|
+
for (let o = e.length; o--; ) if (f.trimOnlySpaces && e[o] !== " " || !f.trimOnlySpaces && e[o].trim()) {
|
|
2340
|
+
w.push([o + 1, E]);
|
|
2341
|
+
break;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
let D = w.current();
|
|
2345
|
+
if (!t?.cb && D && (D[0] && !D[0][0] && (D[0][1], w.ranges[0] = [w.ranges[0][0], w.ranges[0][1]]), D[D.length - 1]?.[1] === e.length && (D[D.length - 1][0], w.ranges))) {
|
|
2346
|
+
let o = w.ranges[w.ranges.length - 1][0];
|
|
2347
|
+
e[o - 1] && (f.trimOnlySpaces && e[o - 1] === " " || !f.trimOnlySpaces && !e[o - 1].trim()) && (o -= 1);
|
|
2348
|
+
let m = w.ranges[w.ranges.length - 1][2];
|
|
2349
|
+
w.ranges[w.ranges.length - 1] = [o, w.ranges[w.ranges.length - 1][1]], m?.trim() && w.ranges[w.ranges.length - 1].push(m.trimEnd());
|
|
2350
|
+
}
|
|
2351
|
+
return { log: { timeTakenInMilliseconds: Date.now() - r }, result: Ta(e, w.current()), ranges: w.current(), allTagLocations: s, filteredTagLocations: u };
|
|
2352
|
+
}
|
|
2353
|
+
class xe {
|
|
2354
|
+
speechSynthesis;
|
|
2355
|
+
speechSynthesisUtterance;
|
|
2356
|
+
currentVoice = null;
|
|
2357
|
+
currentUtterances = [];
|
|
2358
|
+
currentUtteranceIndex = 0;
|
|
2359
|
+
playbackState = "idle";
|
|
2360
|
+
eventListeners = /* @__PURE__ */ new Map();
|
|
2361
|
+
voiceManager = null;
|
|
2362
|
+
voices = [];
|
|
2363
|
+
defaultVoice = null;
|
|
2364
|
+
// Enhanced properties for cross-browser compatibility
|
|
2365
|
+
resumeInfinityTimer;
|
|
2366
|
+
isSpeakingInternal = !1;
|
|
2367
|
+
isPausedInternal = !1;
|
|
2368
|
+
isAndroidPaused = !1;
|
|
2369
|
+
// Explicitly tracks Android's paused state
|
|
2370
|
+
pausedAtUtteranceIndex = null;
|
|
2371
|
+
// Tracks which utterance was playing when paused
|
|
2372
|
+
initialized = !1;
|
|
2373
|
+
maxLengthExceeded = "warn";
|
|
2374
|
+
utterancesBeingCancelled = !1;
|
|
2375
|
+
// Flag to track if utterances are being cancelled
|
|
2376
|
+
// Playback parameters
|
|
2377
|
+
rate = 1;
|
|
2378
|
+
pitch = 1;
|
|
2379
|
+
volume = 1;
|
|
2380
|
+
features;
|
|
2381
|
+
patches;
|
|
2382
|
+
constructor() {
|
|
2383
|
+
if (this.features = Zt(), this.patches = Xt(), !this.features.speechSynthesis || !this.features.speechSynthesisUtterance)
|
|
2384
|
+
throw new Error("Web Speech API is not available in this environment");
|
|
2385
|
+
this.speechSynthesis = this.features.speechSynthesis, this.speechSynthesisUtterance = this.features.speechSynthesisUtterance;
|
|
2386
|
+
}
|
|
2387
|
+
// From Easy Speech,
|
|
2388
|
+
// Check infinity pattern for long texts (except on problematic platforms)
|
|
2389
|
+
// Skip resume infinity for Microsoft Natural voices as they have different behavior
|
|
2390
|
+
shouldUseResumeInfinity() {
|
|
2391
|
+
const t = this.currentVoice, r = !!(t?.name && typeof t.name == "string" && t.name.toLocaleLowerCase().includes("(natural)"));
|
|
2392
|
+
return this.patches.isAndroid !== !0 && !this.patches.isFirefox && !this.patches.isSafari && !r;
|
|
2393
|
+
}
|
|
2394
|
+
// Creates a new SpeechSynthesisUtterance using detected constructor
|
|
2395
|
+
createUtterance(t) {
|
|
2396
|
+
return new this.speechSynthesisUtterance(t);
|
|
2397
|
+
}
|
|
2398
|
+
async initialize(t = {}) {
|
|
2399
|
+
const { languages: r, maxTimeout: n, interval: i, maxLengthExceeded: s = "warn" } = t;
|
|
2400
|
+
if (this.initialized)
|
|
2401
|
+
return !1;
|
|
2402
|
+
this.maxLengthExceeded = s;
|
|
2403
|
+
try {
|
|
2404
|
+
this.voiceManager = await S.initialize({
|
|
2405
|
+
languages: r,
|
|
2406
|
+
maxTimeout: n,
|
|
2407
|
+
interval: i
|
|
2408
|
+
}), this.voices = this.voiceManager.getVoices();
|
|
2409
|
+
const u = r || [...navigator.languages || ["en"]];
|
|
2410
|
+
return this.defaultVoice = await this.voiceManager.getDefaultVoice(u, this.voices), this.initialized = !0, !0;
|
|
2411
|
+
} catch (u) {
|
|
2412
|
+
return console.error("Failed to initialize WebSpeechEngine:", u), this.initialized = !1, !1;
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
// Text length validation matching EasySpeech
|
|
2416
|
+
validateText(t) {
|
|
2417
|
+
if (new TextEncoder().encode(t).length > 4096) {
|
|
2418
|
+
const n = "Text exceeds max length of 4096 bytes, which may not work with some voices.";
|
|
2419
|
+
switch (this.maxLengthExceeded) {
|
|
2420
|
+
case "none":
|
|
2421
|
+
break;
|
|
2422
|
+
case "error":
|
|
2423
|
+
throw new Error(`WebSpeechEngine: ${n}`);
|
|
2424
|
+
default:
|
|
2425
|
+
console.warn(`WebSpeechEngine: ${n}`);
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
getCurrentVoiceForUtterance(t) {
|
|
2430
|
+
return t && typeof t == "object" ? t : typeof t == "string" ? this.voices.find((r) => r.name === t || r.language === t) || null : this.currentVoice || this.defaultVoice;
|
|
2431
|
+
}
|
|
2432
|
+
getCurrentVoice() {
|
|
2433
|
+
return this.currentVoice;
|
|
2434
|
+
}
|
|
2435
|
+
// SSML Escaping
|
|
2436
|
+
escapeSSML(t) {
|
|
2437
|
+
return t.map((r) => ({
|
|
2438
|
+
...r,
|
|
2439
|
+
text: r.ssml ? Ct(r.text).result : r.text
|
|
2440
|
+
}));
|
|
2441
|
+
}
|
|
2442
|
+
// Queue Management
|
|
2443
|
+
loadUtterances(t) {
|
|
2444
|
+
this.currentUtterances = this.escapeSSML(t), this.currentUtteranceIndex = 0, this.setState("ready"), this.emitEvent({ type: "ready" });
|
|
2445
|
+
}
|
|
2446
|
+
// Voice Configuration
|
|
2447
|
+
async setVoice(t) {
|
|
2448
|
+
const r = this.currentVoice;
|
|
2449
|
+
if (typeof t == "string") {
|
|
2450
|
+
const n = this.voices.find((i) => i.name === t || i.language === t);
|
|
2451
|
+
n ? (this.currentVoice = n, r && r.name !== n.name && (this.currentUtteranceIndex = 0)) : console.warn(`Voice "${t}" not found`);
|
|
2452
|
+
} else
|
|
2453
|
+
this.currentVoice = t, r && r.name !== t.name && (this.currentUtteranceIndex = 0);
|
|
2454
|
+
this.voiceManager && this.defaultVoice && this.currentVoice && this.currentVoice.language !== this.defaultVoice.language && (this.defaultVoice = await this.voiceManager.getDefaultVoice([this.currentVoice.language], this.voices));
|
|
2455
|
+
}
|
|
2456
|
+
async getAvailableVoices() {
|
|
2457
|
+
if (this.voices.length > 0)
|
|
2458
|
+
return this.voices;
|
|
2459
|
+
try {
|
|
2460
|
+
return await this.initialize(), this.voices;
|
|
2461
|
+
} catch {
|
|
2462
|
+
return [];
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
// Playback Control
|
|
2466
|
+
speak(t) {
|
|
2467
|
+
if (t !== void 0) {
|
|
2468
|
+
if (t < 0 || t >= this.currentUtterances.length)
|
|
2469
|
+
throw new Error("Invalid utterance index");
|
|
2470
|
+
this.currentUtteranceIndex = t;
|
|
2471
|
+
}
|
|
2472
|
+
if (this.currentUtterances.length === 0) {
|
|
2473
|
+
console.warn("No utterances loaded");
|
|
2474
|
+
return;
|
|
2475
|
+
}
|
|
2476
|
+
this.cancelCurrentSpeech(), this.isSpeakingInternal = !0, this.isPausedInternal = !1, this.setState("playing"), this.emitEvent({ type: "start" }), this.stopResumeInfinity(), this.currentUtteranceIndex = t ?? 0, this.currentUtteranceIndex >= this.currentUtterances.length && (this.currentUtteranceIndex = 0), this.speakCurrentUtterance();
|
|
2477
|
+
}
|
|
2478
|
+
cancelCurrentSpeech() {
|
|
2479
|
+
this.patches.isFirefox && this.speechSynthesis.speaking && (this.utterancesBeingCancelled = !0, setTimeout(() => {
|
|
2480
|
+
this.utterancesBeingCancelled = !1;
|
|
2481
|
+
}, 100)), this.speechSynthesis.cancel();
|
|
2482
|
+
}
|
|
2483
|
+
speakCurrentUtterance() {
|
|
2484
|
+
if (this.currentUtteranceIndex >= this.currentUtterances.length) {
|
|
2485
|
+
this.setState("idle"), this.emitEvent({ type: "end" });
|
|
2486
|
+
return;
|
|
2487
|
+
}
|
|
2488
|
+
const t = this.currentUtterances[this.currentUtteranceIndex], r = (t.ssml, t.text);
|
|
2489
|
+
this.validateText(r);
|
|
2490
|
+
const n = this.createUtterance(r), i = this.getCurrentVoiceForUtterance(this.currentVoice);
|
|
2491
|
+
if (i && this.voiceManager) {
|
|
2492
|
+
const s = this.voiceManager.convertToSpeechSynthesisVoice(i);
|
|
2493
|
+
s && (n.voice = s, n.lang = s.lang);
|
|
2494
|
+
}
|
|
2495
|
+
t.language && (n.lang = t.language), n.rate = this.rate, n.pitch = this.pitch, n.volume = this.volume, n.onstart = () => {
|
|
2496
|
+
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);
|
|
2497
|
+
}, n.onend = () => {
|
|
2498
|
+
if (this.utterancesBeingCancelled) {
|
|
2499
|
+
this.utterancesBeingCancelled = !1;
|
|
2500
|
+
return;
|
|
2501
|
+
}
|
|
2502
|
+
this.playbackState !== "idle" && (this.isSpeakingInternal = !1, this.isPausedInternal = !1, this.stopResumeInfinity(), this.currentUtteranceIndex >= this.currentUtterances.length - 1 && this.setState("idle"), this.emitEvent({ type: "end" }));
|
|
2503
|
+
}, n.onerror = (s) => {
|
|
2504
|
+
if (s.error === "interrupted" && this.patches.isAndroid && this.isAndroidPaused)
|
|
2505
|
+
return;
|
|
2506
|
+
this.isSpeakingInternal = !1, this.isPausedInternal = !1, this.stopResumeInfinity(), this.setState("idle"), ["synthesis-unavailable", "audio-hardware", "voice-unavailable"].includes(s.error) && (console.log("[ENGINE] fatal error detected, resetting index to 0"), this.currentUtteranceIndex = 0), s.error === "interrupted" || s.error === "canceled" ? this.emitEvent({ type: "stop" }) : this.emitEvent({
|
|
2507
|
+
type: "error",
|
|
2508
|
+
detail: {
|
|
2509
|
+
error: s.error,
|
|
2510
|
+
// Preserve original error type
|
|
2511
|
+
message: `Speech synthesis error: ${s.error}`
|
|
2512
|
+
}
|
|
2513
|
+
});
|
|
2514
|
+
}, n.onpause = () => {
|
|
2515
|
+
this.isPausedInternal = !0, this.isSpeakingInternal = !1, this.emitEvent({ type: "pause" });
|
|
2516
|
+
}, n.onresume = () => {
|
|
2517
|
+
this.isPausedInternal = !1, this.isSpeakingInternal = !0, this.emitEvent({ type: "resume" });
|
|
2518
|
+
}, n.onboundary = (s) => {
|
|
2519
|
+
this.emitEvent({
|
|
2520
|
+
type: "boundary",
|
|
2521
|
+
detail: {
|
|
2522
|
+
charIndex: s.charIndex,
|
|
2523
|
+
charLength: s.charLength,
|
|
2524
|
+
elapsedTime: s.elapsedTime,
|
|
2525
|
+
name: s.name
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2528
|
+
}, n.onmark = (s) => {
|
|
2529
|
+
this.emitEvent({
|
|
2530
|
+
type: "mark",
|
|
2531
|
+
detail: {
|
|
2532
|
+
name: s.name
|
|
2533
|
+
}
|
|
2534
|
+
});
|
|
2535
|
+
}, this.speechSynthesis.speak(n);
|
|
2536
|
+
}
|
|
2537
|
+
startResumeInfinity(t) {
|
|
2538
|
+
this.shouldUseResumeInfinity() && (this.resumeInfinityTimer = window.setTimeout(() => {
|
|
2539
|
+
if (t) {
|
|
2540
|
+
const { paused: n, speaking: i } = this.speechSynthesis, s = i || this.isSpeakingInternal, u = n || this.isPausedInternal;
|
|
2541
|
+
s && !u && (this.speechSynthesis.pause(), this.speechSynthesis.resume());
|
|
2542
|
+
}
|
|
2543
|
+
this.startResumeInfinity(t);
|
|
2544
|
+
}, 5e3));
|
|
2545
|
+
}
|
|
2546
|
+
stopResumeInfinity() {
|
|
2547
|
+
this.resumeInfinityTimer && (clearTimeout(this.resumeInfinityTimer), this.resumeInfinityTimer = void 0);
|
|
2548
|
+
}
|
|
2549
|
+
pause() {
|
|
2550
|
+
this.playbackState === "playing" && (this.pausedAtUtteranceIndex = this.currentUtteranceIndex, this.patches.isAndroid ? (this.isAndroidPaused = !0, this.speechSynthesis.cancel()) : this.speechSynthesis.pause(), this.isPausedInternal = !0, this.isSpeakingInternal = !1, this.setState("paused"), this.emitEvent({ type: "pause" }));
|
|
2551
|
+
}
|
|
2552
|
+
resume() {
|
|
2553
|
+
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);
|
|
2554
|
+
}
|
|
2555
|
+
stop() {
|
|
2556
|
+
this.speechSynthesis.cancel(), this.currentUtteranceIndex = 0, this.patches.isAndroid && (this.isAndroidPaused = !1), this.setState("idle"), this.emitEvent({ type: "stop" });
|
|
2557
|
+
}
|
|
2558
|
+
// Playback Parameters
|
|
2559
|
+
setRate(t) {
|
|
2560
|
+
this.rate = Math.max(0.1, Math.min(10, t));
|
|
2561
|
+
}
|
|
2562
|
+
getRate() {
|
|
2563
|
+
return this.rate;
|
|
2564
|
+
}
|
|
2565
|
+
setPitch(t) {
|
|
2566
|
+
this.pitch = Math.max(0, Math.min(2, t));
|
|
2567
|
+
}
|
|
2568
|
+
getPitch() {
|
|
2569
|
+
return this.pitch;
|
|
2570
|
+
}
|
|
2571
|
+
setVolume(t) {
|
|
2572
|
+
this.volume = Math.max(0, Math.min(1, t));
|
|
2573
|
+
}
|
|
2574
|
+
getVolume() {
|
|
2575
|
+
return this.volume;
|
|
2576
|
+
}
|
|
2577
|
+
// State
|
|
2578
|
+
getState() {
|
|
2579
|
+
return this.playbackState;
|
|
2580
|
+
}
|
|
2581
|
+
getCurrentUtteranceIndex() {
|
|
2582
|
+
return this.currentUtteranceIndex;
|
|
2583
|
+
}
|
|
2584
|
+
setCurrentUtteranceIndex(t, r) {
|
|
2585
|
+
if (t < 0 || t >= this.currentUtterances.length) {
|
|
2586
|
+
r?.(!1);
|
|
2587
|
+
return;
|
|
2588
|
+
}
|
|
2589
|
+
t !== this.currentUtteranceIndex && (!this.isPausedInternal && this.isSpeakingInternal && this.cancelCurrentSpeech(), this.currentUtteranceIndex = t, r?.(!0));
|
|
2590
|
+
}
|
|
2591
|
+
getUtteranceCount() {
|
|
2592
|
+
return this.currentUtterances.length;
|
|
2593
|
+
}
|
|
2594
|
+
// Events
|
|
2595
|
+
on(t, r) {
|
|
2596
|
+
return this.eventListeners.has(t) || this.eventListeners.set(t, []), this.eventListeners.get(t).push(r), () => {
|
|
2597
|
+
const n = this.eventListeners.get(t);
|
|
2598
|
+
if (n) {
|
|
2599
|
+
const i = n.indexOf(r);
|
|
2600
|
+
i > -1 && n.splice(i, 1);
|
|
2601
|
+
}
|
|
2602
|
+
};
|
|
2603
|
+
}
|
|
2604
|
+
emitEvent(t) {
|
|
2605
|
+
const r = this.eventListeners.get(t.type);
|
|
2606
|
+
r && r.forEach((n) => n(t));
|
|
2607
|
+
}
|
|
2608
|
+
setState(t) {
|
|
2609
|
+
const r = this.playbackState;
|
|
2610
|
+
if (this.playbackState = t, r !== t)
|
|
2611
|
+
switch (t) {
|
|
2612
|
+
case "idle":
|
|
2613
|
+
this.emitEvent({ type: "idle" });
|
|
2614
|
+
break;
|
|
2615
|
+
case "loading":
|
|
2616
|
+
this.emitEvent({ type: "loading" });
|
|
2617
|
+
break;
|
|
2618
|
+
case "ready":
|
|
2619
|
+
this.emitEvent({ type: "ready" });
|
|
2620
|
+
break;
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
// Cleanup with comprehensive error handling
|
|
2624
|
+
async destroy() {
|
|
2625
|
+
this.stop(), this.stopResumeInfinity(), this.eventListeners.clear(), this.currentUtterances = [], this.currentVoice = null, this.voices = [], this.defaultVoice = null, this.initialized = !1;
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
class xa {
|
|
2629
|
+
id = "webspeech";
|
|
2630
|
+
name = "Web Speech API";
|
|
2631
|
+
engine = null;
|
|
2632
|
+
async getVoices() {
|
|
2633
|
+
if (!this.engine)
|
|
2634
|
+
throw new Error("No engine available. Create an engine first.");
|
|
2635
|
+
return this.engine.getAvailableVoices();
|
|
2636
|
+
}
|
|
2637
|
+
async createEngine(t) {
|
|
2638
|
+
const r = new xe();
|
|
2639
|
+
return await r.initialize(), t && await r.setVoice(t), r;
|
|
2640
|
+
}
|
|
2641
|
+
async destroy() {
|
|
2642
|
+
this.engine && (await this.engine.destroy(), this.engine = null);
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
class ja {
|
|
2646
|
+
engine;
|
|
2647
|
+
contentQueue = [];
|
|
2648
|
+
eventListeners = /* @__PURE__ */ new Map();
|
|
2649
|
+
// Navigator owns the state, not the engine
|
|
2650
|
+
navigatorState = "idle";
|
|
2651
|
+
constructor(t) {
|
|
2652
|
+
this.engine = t || new xe(), this.setupEngineListeners(), this.initializeEngine();
|
|
2653
|
+
}
|
|
2654
|
+
async initializeEngine() {
|
|
2655
|
+
if (this.engine instanceof xe)
|
|
2656
|
+
try {
|
|
2657
|
+
await this.engine.initialize();
|
|
2658
|
+
} catch (t) {
|
|
2659
|
+
console.warn("Failed to initialize WebSpeechEngine:", t);
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
setupEngineListeners() {
|
|
2663
|
+
this.engine.on("start", () => {
|
|
2664
|
+
this.setNavigatorState("playing"), this.emitEvent({ type: "start" });
|
|
2665
|
+
}), this.engine.on("end", () => {
|
|
2666
|
+
const t = this.engine.getCurrentUtteranceIndex(), r = this.engine.getUtteranceCount();
|
|
2667
|
+
t < r - 1 ? this.engine.speak(t + 1) : this.setNavigatorState("idle"), this.emitEvent({ type: "end" });
|
|
2668
|
+
}), this.engine.on("pause", () => {
|
|
2669
|
+
this.setNavigatorState("paused"), this.emitEvent({ type: "pause" });
|
|
2670
|
+
}), this.engine.on("resume", () => {
|
|
2671
|
+
this.setNavigatorState("playing"), this.emitEvent({ type: "resume" });
|
|
2672
|
+
}), this.engine.on("stop", () => {
|
|
2673
|
+
this.setNavigatorState("idle"), this.emitEvent({ type: "stop" });
|
|
2674
|
+
}), this.engine.on("error", (t) => {
|
|
2675
|
+
this.setNavigatorState("idle"), this.emitEvent(t);
|
|
2676
|
+
}), this.engine.on("ready", () => {
|
|
2677
|
+
this.contentQueue.length > 0 && (this.setNavigatorState("ready"), this.emitEvent({ type: "ready" }));
|
|
2678
|
+
}), this.engine.on("boundary", (t) => {
|
|
2679
|
+
this.emitEvent(t);
|
|
2680
|
+
}), this.engine.on("mark", (t) => {
|
|
2681
|
+
this.emitEvent(t);
|
|
2682
|
+
}), this.engine.on("voiceschanged", () => {
|
|
2683
|
+
this.emitEvent({ type: "voiceschanged" });
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
setNavigatorState(t) {
|
|
2687
|
+
this.navigatorState = t;
|
|
2688
|
+
}
|
|
2689
|
+
// Voice Management
|
|
2690
|
+
async getVoices() {
|
|
2691
|
+
return this.engine.getAvailableVoices();
|
|
2692
|
+
}
|
|
2693
|
+
setVoice(t) {
|
|
2694
|
+
this.engine.setVoice(t);
|
|
2695
|
+
}
|
|
2696
|
+
getCurrentVoice() {
|
|
2697
|
+
return this.engine.getCurrentVoice();
|
|
2698
|
+
}
|
|
2699
|
+
// Content Management
|
|
2700
|
+
loadContent(t) {
|
|
2701
|
+
const r = Array.isArray(t) ? t : [t];
|
|
2702
|
+
this.contentQueue = [...r], this.engine.loadUtterances(r), this.setNavigatorState("ready"), this.emitContentChangeEvent({ content: r });
|
|
2703
|
+
}
|
|
2704
|
+
getCurrentContent() {
|
|
2705
|
+
const t = this.getCurrentUtteranceIndex();
|
|
2706
|
+
return t < this.contentQueue.length ? this.contentQueue[t] : null;
|
|
2707
|
+
}
|
|
2708
|
+
getContentQueue() {
|
|
2709
|
+
return [...this.contentQueue];
|
|
2710
|
+
}
|
|
2711
|
+
getCurrentUtteranceIndex() {
|
|
2712
|
+
return this.engine.getCurrentUtteranceIndex();
|
|
2713
|
+
}
|
|
2714
|
+
// Playback Control - Navigator coordinates engine operations
|
|
2715
|
+
play() {
|
|
2716
|
+
if (this.navigatorState === "paused")
|
|
2717
|
+
this.setNavigatorState("playing"), this.engine.resume();
|
|
2718
|
+
else if (this.navigatorState === "ready" || this.navigatorState === "idle")
|
|
2719
|
+
this.setNavigatorState("playing"), this.engine.speak();
|
|
2720
|
+
else if (this.navigatorState === "playing")
|
|
2721
|
+
return;
|
|
2722
|
+
}
|
|
2723
|
+
pause() {
|
|
2724
|
+
this.navigatorState === "playing" && (this.setNavigatorState("paused"), this.engine.pause());
|
|
2725
|
+
}
|
|
2726
|
+
stop() {
|
|
2727
|
+
this.setNavigatorState("idle"), this.engine.stop(), this.emitEvent({ type: "stop" });
|
|
2728
|
+
}
|
|
2729
|
+
skipToPosition(t, r = !1) {
|
|
2730
|
+
const n = this.getCurrentUtteranceIndex();
|
|
2731
|
+
return t < 0 || t >= this.contentQueue.length ? !1 : (t === n || (this.navigatorState === "paused" && !r ? this.engine.setCurrentUtteranceIndex(t, (i) => {
|
|
2732
|
+
i && this.emitEvent({
|
|
2733
|
+
type: "skip",
|
|
2734
|
+
detail: { position: t }
|
|
2735
|
+
});
|
|
2736
|
+
}) : (this.setNavigatorState("playing"), this.engine.speak(t))), !0);
|
|
2737
|
+
}
|
|
2738
|
+
// Navigation - Navigator coordinates with proper state management
|
|
2739
|
+
next(t = !1) {
|
|
2740
|
+
const r = this.getCurrentUtteranceIndex();
|
|
2741
|
+
return this.skipToPosition(r + 1, t);
|
|
2742
|
+
}
|
|
2743
|
+
previous(t = !1) {
|
|
2744
|
+
const r = this.getCurrentUtteranceIndex();
|
|
2745
|
+
return this.skipToPosition(r - 1, t);
|
|
2746
|
+
}
|
|
2747
|
+
jumpTo(t, r = !1) {
|
|
2748
|
+
return this.skipToPosition(t, r);
|
|
2749
|
+
}
|
|
2750
|
+
// Playback Parameters
|
|
2751
|
+
setRate(t) {
|
|
2752
|
+
this.engine.setRate(t);
|
|
2753
|
+
}
|
|
2754
|
+
getRate() {
|
|
2755
|
+
return this.engine.getRate();
|
|
2756
|
+
}
|
|
2757
|
+
setPitch(t) {
|
|
2758
|
+
this.engine.setPitch(t);
|
|
2759
|
+
}
|
|
2760
|
+
getPitch() {
|
|
2761
|
+
return this.engine.getPitch();
|
|
2762
|
+
}
|
|
2763
|
+
setVolume(t) {
|
|
2764
|
+
this.engine.setVolume(t);
|
|
2765
|
+
}
|
|
2766
|
+
getVolume() {
|
|
2767
|
+
return this.engine.getVolume();
|
|
2768
|
+
}
|
|
2769
|
+
// State - Navigator is the single source of truth
|
|
2770
|
+
getState() {
|
|
2771
|
+
return this.navigatorState;
|
|
2772
|
+
}
|
|
2773
|
+
// Events
|
|
2774
|
+
on(t, r) {
|
|
2775
|
+
return this.eventListeners.has(t) || this.eventListeners.set(t, []), this.eventListeners.get(t).push(r), () => {
|
|
2776
|
+
const n = this.eventListeners.get(t);
|
|
2777
|
+
if (n) {
|
|
2778
|
+
const i = n.indexOf(r);
|
|
2779
|
+
i > -1 && n.splice(i, 1);
|
|
2780
|
+
}
|
|
2781
|
+
};
|
|
2782
|
+
}
|
|
2783
|
+
emitEvent(t) {
|
|
2784
|
+
const r = this.eventListeners.get(t.type);
|
|
2785
|
+
r && r.forEach((n) => n(t));
|
|
2786
|
+
}
|
|
2787
|
+
emitContentChangeEvent(t) {
|
|
2788
|
+
const r = this.eventListeners.get("contentchange");
|
|
2789
|
+
r && r.forEach((n) => n({ type: "contentchange", detail: t }));
|
|
2790
|
+
}
|
|
2791
|
+
async destroy() {
|
|
2792
|
+
this.eventListeners.clear(), await this.engine.destroy();
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
export {
|
|
2796
|
+
xe as WebSpeechEngine,
|
|
2797
|
+
xa as WebSpeechEngineProvider,
|
|
2798
|
+
ja as WebSpeechReadAloudNavigator,
|
|
2799
|
+
S as WebSpeechVoiceManager,
|
|
2800
|
+
re as chineseVariantMap
|
|
2801
|
+
};
|