@deriv-com/translations 0.0.0-development

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.
@@ -0,0 +1,1593 @@
1
+ const ue = {
2
+ type: "logger",
3
+ log(i) {
4
+ this.output("log", i);
5
+ },
6
+ warn(i) {
7
+ this.output("warn", i);
8
+ },
9
+ error(i) {
10
+ this.output("error", i);
11
+ },
12
+ output(i, e) {
13
+ console && console[i] && console[i].apply(console, e);
14
+ }
15
+ };
16
+ class M {
17
+ constructor(e) {
18
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
19
+ this.init(e, t);
20
+ }
21
+ init(e) {
22
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23
+ this.prefix = t.prefix || "i18next:", this.logger = e || ue, this.options = t, this.debug = t.debug;
24
+ }
25
+ log() {
26
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
27
+ t[n] = arguments[n];
28
+ return this.forward(t, "log", "", !0);
29
+ }
30
+ warn() {
31
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
32
+ t[n] = arguments[n];
33
+ return this.forward(t, "warn", "", !0);
34
+ }
35
+ error() {
36
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
37
+ t[n] = arguments[n];
38
+ return this.forward(t, "error", "");
39
+ }
40
+ deprecate() {
41
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
42
+ t[n] = arguments[n];
43
+ return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
44
+ }
45
+ forward(e, t, n, s) {
46
+ return s && !this.debug ? null : (typeof e[0] == "string" && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
47
+ }
48
+ create(e) {
49
+ return new M(this.logger, {
50
+ prefix: `${this.prefix}:${e}:`,
51
+ ...this.options
52
+ });
53
+ }
54
+ clone(e) {
55
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new M(this.logger, e);
56
+ }
57
+ }
58
+ var k = new M();
59
+ class Y {
60
+ constructor() {
61
+ this.observers = {};
62
+ }
63
+ on(e, t) {
64
+ return e.split(" ").forEach((n) => {
65
+ this.observers[n] = this.observers[n] || [], this.observers[n].push(t);
66
+ }), this;
67
+ }
68
+ off(e, t) {
69
+ if (this.observers[e]) {
70
+ if (!t) {
71
+ delete this.observers[e];
72
+ return;
73
+ }
74
+ this.observers[e] = this.observers[e].filter((n) => n !== t);
75
+ }
76
+ }
77
+ emit(e) {
78
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
79
+ n[s - 1] = arguments[s];
80
+ this.observers[e] && [].concat(this.observers[e]).forEach((a) => {
81
+ a(...n);
82
+ }), this.observers["*"] && [].concat(this.observers["*"]).forEach((a) => {
83
+ a.apply(a, [e, ...n]);
84
+ });
85
+ }
86
+ }
87
+ function D() {
88
+ let i, e;
89
+ const t = new Promise((n, s) => {
90
+ i = n, e = s;
91
+ });
92
+ return t.resolve = i, t.reject = e, t;
93
+ }
94
+ function q(i) {
95
+ return i == null ? "" : "" + i;
96
+ }
97
+ function fe(i, e, t) {
98
+ i.forEach((n) => {
99
+ e[n] && (t[n] = e[n]);
100
+ });
101
+ }
102
+ function G(i, e, t) {
103
+ function n(a) {
104
+ return a && a.indexOf("###") > -1 ? a.replace(/###/g, ".") : a;
105
+ }
106
+ function s() {
107
+ return !i || typeof i == "string";
108
+ }
109
+ const r = typeof e != "string" ? [].concat(e) : e.split(".");
110
+ for (; r.length > 1; ) {
111
+ if (s())
112
+ return {};
113
+ const a = n(r.shift());
114
+ !i[a] && t && (i[a] = new t()), Object.prototype.hasOwnProperty.call(i, a) ? i = i[a] : i = {};
115
+ }
116
+ return s() ? {} : {
117
+ obj: i,
118
+ k: n(r.shift())
119
+ };
120
+ }
121
+ function _(i, e, t) {
122
+ const {
123
+ obj: n,
124
+ k: s
125
+ } = G(i, e, Object);
126
+ n[s] = t;
127
+ }
128
+ function ge(i, e, t, n) {
129
+ const {
130
+ obj: s,
131
+ k: r
132
+ } = G(i, e, Object);
133
+ s[r] = s[r] || [], n && (s[r] = s[r].concat(t)), n || s[r].push(t);
134
+ }
135
+ function H(i, e) {
136
+ const {
137
+ obj: t,
138
+ k: n
139
+ } = G(i, e);
140
+ if (t)
141
+ return t[n];
142
+ }
143
+ function he(i, e, t) {
144
+ const n = H(i, t);
145
+ return n !== void 0 ? n : H(e, t);
146
+ }
147
+ function oe(i, e, t) {
148
+ for (const n in e)
149
+ n !== "__proto__" && n !== "constructor" && (n in i ? typeof i[n] == "string" || i[n] instanceof String || typeof e[n] == "string" || e[n] instanceof String ? t && (i[n] = e[n]) : oe(i[n], e[n], t) : i[n] = e[n]);
150
+ return i;
151
+ }
152
+ function I(i) {
153
+ return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
154
+ }
155
+ var ce = {
156
+ "&": "&amp;",
157
+ "<": "&lt;",
158
+ ">": "&gt;",
159
+ '"': "&quot;",
160
+ "'": "&#39;",
161
+ "/": "&#x2F;"
162
+ };
163
+ function de(i) {
164
+ return typeof i == "string" ? i.replace(/[&<>"'\/]/g, (e) => ce[e]) : i;
165
+ }
166
+ const pe = [" ", ",", "?", "!", ";"];
167
+ function me(i, e, t) {
168
+ e = e || "", t = t || "";
169
+ const n = pe.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
170
+ if (n.length === 0)
171
+ return !0;
172
+ const s = new RegExp(`(${n.map((a) => a === "?" ? "\\?" : a).join("|")})`);
173
+ let r = !s.test(i);
174
+ if (!r) {
175
+ const a = i.indexOf(t);
176
+ a > 0 && !s.test(i.substring(0, a)) && (r = !0);
177
+ }
178
+ return r;
179
+ }
180
+ function J(i, e) {
181
+ let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
182
+ if (!i)
183
+ return;
184
+ if (i[e])
185
+ return i[e];
186
+ const n = e.split(t);
187
+ let s = i;
188
+ for (let r = 0; r < n.length; ++r) {
189
+ if (!s || typeof s[n[r]] == "string" && r + 1 < n.length)
190
+ return;
191
+ if (s[n[r]] === void 0) {
192
+ let a = 2, l = n.slice(r, r + a).join(t), o = s[l];
193
+ for (; o === void 0 && n.length > r + a; )
194
+ a++, l = n.slice(r, r + a).join(t), o = s[l];
195
+ if (o === void 0)
196
+ return;
197
+ if (o === null)
198
+ return null;
199
+ if (e.endsWith(l)) {
200
+ if (typeof o == "string")
201
+ return o;
202
+ if (l && typeof o[l] == "string")
203
+ return o[l];
204
+ }
205
+ const f = n.slice(r + a).join(t);
206
+ return f ? J(o, f, t) : void 0;
207
+ }
208
+ s = s[n[r]];
209
+ }
210
+ return s;
211
+ }
212
+ function z(i) {
213
+ return i && i.indexOf("_") > 0 ? i.replace("_", "-") : i;
214
+ }
215
+ class ee extends Y {
216
+ constructor(e) {
217
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
218
+ ns: ["translation"],
219
+ defaultNS: "translation"
220
+ };
221
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
222
+ }
223
+ addNamespaces(e) {
224
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
225
+ }
226
+ removeNamespaces(e) {
227
+ const t = this.options.ns.indexOf(e);
228
+ t > -1 && this.options.ns.splice(t, 1);
229
+ }
230
+ getResource(e, t, n) {
231
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
232
+ const r = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, a = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure;
233
+ let l = [e, t];
234
+ n && typeof n != "string" && (l = l.concat(n)), n && typeof n == "string" && (l = l.concat(r ? n.split(r) : n)), e.indexOf(".") > -1 && (l = e.split("."));
235
+ const o = H(this.data, l);
236
+ return o || !a || typeof n != "string" ? o : J(this.data && this.data[e] && this.data[e][t], n, r);
237
+ }
238
+ addResource(e, t, n, s) {
239
+ let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
240
+ silent: !1
241
+ };
242
+ const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
243
+ let l = [e, t];
244
+ n && (l = l.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (l = e.split("."), s = t, t = l[1]), this.addNamespaces(t), _(this.data, l, s), r.silent || this.emit("added", e, t, n, s);
245
+ }
246
+ addResources(e, t, n) {
247
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
248
+ silent: !1
249
+ };
250
+ for (const r in n)
251
+ (typeof n[r] == "string" || Object.prototype.toString.apply(n[r]) === "[object Array]") && this.addResource(e, t, r, n[r], {
252
+ silent: !0
253
+ });
254
+ s.silent || this.emit("added", e, t, n);
255
+ }
256
+ addResourceBundle(e, t, n, s, r) {
257
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
258
+ silent: !1
259
+ }, l = [e, t];
260
+ e.indexOf(".") > -1 && (l = e.split("."), s = n, n = t, t = l[1]), this.addNamespaces(t);
261
+ let o = H(this.data, l) || {};
262
+ s ? oe(o, n, r) : o = {
263
+ ...o,
264
+ ...n
265
+ }, _(this.data, l, o), a.silent || this.emit("added", e, t, n);
266
+ }
267
+ removeResourceBundle(e, t) {
268
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
269
+ }
270
+ hasResourceBundle(e, t) {
271
+ return this.getResource(e, t) !== void 0;
272
+ }
273
+ getResourceBundle(e, t) {
274
+ return t || (t = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? {
275
+ ...this.getResource(e, t)
276
+ } : this.getResource(e, t);
277
+ }
278
+ getDataByLanguage(e) {
279
+ return this.data[e];
280
+ }
281
+ hasLanguageSomeTranslations(e) {
282
+ const t = this.getDataByLanguage(e);
283
+ return !!(t && Object.keys(t) || []).find((s) => t[s] && Object.keys(t[s]).length > 0);
284
+ }
285
+ toJSON() {
286
+ return this.data;
287
+ }
288
+ }
289
+ var le = {
290
+ processors: {},
291
+ addPostProcessor(i) {
292
+ this.processors[i.name] = i;
293
+ },
294
+ handle(i, e, t, n, s) {
295
+ return i.forEach((r) => {
296
+ this.processors[r] && (e = this.processors[r].process(e, t, n, s));
297
+ }), e;
298
+ }
299
+ };
300
+ const te = {};
301
+ class W extends Y {
302
+ constructor(e) {
303
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
304
+ super(), fe(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = k.create("translator");
305
+ }
306
+ changeLanguage(e) {
307
+ e && (this.language = e);
308
+ }
309
+ exists(e) {
310
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
311
+ interpolation: {}
312
+ };
313
+ if (e == null)
314
+ return !1;
315
+ const n = this.resolve(e, t);
316
+ return n && n.res !== void 0;
317
+ }
318
+ extractFromKey(e, t) {
319
+ let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
320
+ n === void 0 && (n = ":");
321
+ const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
322
+ let r = t.ns || this.options.defaultNS || [];
323
+ const a = n && e.indexOf(n) > -1, l = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !me(e, n, s);
324
+ if (a && !l) {
325
+ const o = e.match(this.interpolator.nestingRegexp);
326
+ if (o && o.length > 0)
327
+ return {
328
+ key: e,
329
+ namespaces: r
330
+ };
331
+ const f = e.split(n);
332
+ (n !== s || n === s && this.options.ns.indexOf(f[0]) > -1) && (r = f.shift()), e = f.join(s);
333
+ }
334
+ return typeof r == "string" && (r = [r]), {
335
+ key: e,
336
+ namespaces: r
337
+ };
338
+ }
339
+ translate(e, t, n) {
340
+ if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
341
+ ...t
342
+ }), t || (t = {}), e == null)
343
+ return "";
344
+ Array.isArray(e) || (e = [String(e)]);
345
+ const s = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
346
+ key: a,
347
+ namespaces: l
348
+ } = this.extractFromKey(e[e.length - 1], t), o = l[l.length - 1], f = t.lng || this.language, g = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
349
+ if (f && f.toLowerCase() === "cimode") {
350
+ if (g) {
351
+ const L = t.nsSeparator || this.options.nsSeparator;
352
+ return s ? {
353
+ res: `${o}${L}${a}`,
354
+ usedKey: a,
355
+ exactUsedKey: a,
356
+ usedLng: f,
357
+ usedNS: o,
358
+ usedParams: this.getUsedParamsDetails(t)
359
+ } : `${o}${L}${a}`;
360
+ }
361
+ return s ? {
362
+ res: a,
363
+ usedKey: a,
364
+ exactUsedKey: a,
365
+ usedLng: f,
366
+ usedNS: o,
367
+ usedParams: this.getUsedParamsDetails(t)
368
+ } : a;
369
+ }
370
+ const c = this.resolve(e, t);
371
+ let u = c && c.res;
372
+ const m = c && c.usedKey || a, p = c && c.exactUsedKey || a, x = Object.prototype.toString.apply(u), v = ["[object Number]", "[object Function]", "[object RegExp]"], P = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, O = !this.i18nFormat || this.i18nFormat.handleAsObject;
373
+ if (O && u && (typeof u != "string" && typeof u != "boolean" && typeof u != "number") && v.indexOf(x) < 0 && !(typeof P == "string" && x === "[object Array]")) {
374
+ if (!t.returnObjects && !this.options.returnObjects) {
375
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
376
+ const L = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, u, {
377
+ ...t,
378
+ ns: l
379
+ }) : `key '${a} (${this.language})' returned an object instead of string.`;
380
+ return s ? (c.res = L, c.usedParams = this.getUsedParamsDetails(t), c) : L;
381
+ }
382
+ if (r) {
383
+ const L = x === "[object Array]", R = L ? [] : {}, $ = L ? p : m;
384
+ for (const w in u)
385
+ if (Object.prototype.hasOwnProperty.call(u, w)) {
386
+ const h = `${$}${r}${w}`;
387
+ R[w] = this.translate(h, {
388
+ ...t,
389
+ joinArrays: !1,
390
+ ns: l
391
+ }), R[w] === h && (R[w] = u[w]);
392
+ }
393
+ u = R;
394
+ }
395
+ } else if (O && typeof P == "string" && x === "[object Array]")
396
+ u = u.join(P), u && (u = this.extendTranslation(u, e, t, n));
397
+ else {
398
+ let L = !1, R = !1;
399
+ const $ = t.count !== void 0 && typeof t.count != "string", w = W.hasDefaultValue(t), h = $ ? this.pluralResolver.getSuffix(f, t.count, t) : "", N = t.ordinal && $ ? this.pluralResolver.getSuffix(f, t.count, {
400
+ ordinal: !1
401
+ }) : "", d = t[`defaultValue${h}`] || t[`defaultValue${N}`] || t.defaultValue;
402
+ !this.isValidLookup(u) && w && (L = !0, u = d), this.isValidLookup(u) || (R = !0, u = a);
403
+ const b = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && R ? void 0 : u, S = w && d !== u && this.options.updateMissing;
404
+ if (R || L || S) {
405
+ if (this.logger.log(S ? "updateKey" : "missingKey", f, o, a, S ? d : u), r) {
406
+ const F = this.resolve(a, {
407
+ ...t,
408
+ keySeparator: !1
409
+ });
410
+ F && F.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
411
+ }
412
+ let j = [];
413
+ const K = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
414
+ if (this.options.saveMissingTo === "fallback" && K && K[0])
415
+ for (let F = 0; F < K.length; F++)
416
+ j.push(K[F]);
417
+ else
418
+ this.options.saveMissingTo === "all" ? j = this.languageUtils.toResolveHierarchy(t.lng || this.language) : j.push(t.lng || this.language);
419
+ const Q = (F, E, X) => {
420
+ const Z = w && X !== u ? X : b;
421
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(F, o, E, Z, S, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(F, o, E, Z, S, t), this.emit("missingKey", F, o, E, u);
422
+ };
423
+ this.options.saveMissing && (this.options.saveMissingPlurals && $ ? j.forEach((F) => {
424
+ this.pluralResolver.getSuffixes(F, t).forEach((E) => {
425
+ Q([F], a + E, t[`defaultValue${E}`] || d);
426
+ });
427
+ }) : Q(j, a, d));
428
+ }
429
+ u = this.extendTranslation(u, e, t, c, n), R && u === a && this.options.appendNamespaceToMissingKey && (u = `${o}:${a}`), (R || L) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${o}:${a}` : a, L ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
430
+ }
431
+ return s ? (c.res = u, c.usedParams = this.getUsedParamsDetails(t), c) : u;
432
+ }
433
+ extendTranslation(e, t, n, s, r) {
434
+ var a = this;
435
+ if (this.i18nFormat && this.i18nFormat.parse)
436
+ e = this.i18nFormat.parse(e, {
437
+ ...this.options.interpolation.defaultVariables,
438
+ ...n
439
+ }, n.lng || this.language || s.usedLng, s.usedNS, s.usedKey, {
440
+ resolved: s
441
+ });
442
+ else if (!n.skipInterpolation) {
443
+ n.interpolation && this.interpolator.init({
444
+ ...n,
445
+ interpolation: {
446
+ ...this.options.interpolation,
447
+ ...n.interpolation
448
+ }
449
+ });
450
+ const f = typeof e == "string" && (n && n.interpolation && n.interpolation.skipOnVariables !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
451
+ let g;
452
+ if (f) {
453
+ const u = e.match(this.interpolator.nestingRegexp);
454
+ g = u && u.length;
455
+ }
456
+ let c = n.replace && typeof n.replace != "string" ? n.replace : n;
457
+ if (this.options.interpolation.defaultVariables && (c = {
458
+ ...this.options.interpolation.defaultVariables,
459
+ ...c
460
+ }), e = this.interpolator.interpolate(e, c, n.lng || this.language, n), f) {
461
+ const u = e.match(this.interpolator.nestingRegexp), m = u && u.length;
462
+ g < m && (n.nest = !1);
463
+ }
464
+ !n.lng && this.options.compatibilityAPI !== "v1" && s && s.res && (n.lng = s.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, function() {
465
+ for (var u = arguments.length, m = new Array(u), p = 0; p < u; p++)
466
+ m[p] = arguments[p];
467
+ return r && r[0] === m[0] && !n.context ? (a.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`), null) : a.translate(...m, t);
468
+ }, n)), n.interpolation && this.interpolator.reset();
469
+ }
470
+ const l = n.postProcess || this.options.postProcess, o = typeof l == "string" ? [l] : l;
471
+ return e != null && o && o.length && n.applyPostProcessor !== !1 && (e = le.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
472
+ i18nResolved: {
473
+ ...s,
474
+ usedParams: this.getUsedParamsDetails(n)
475
+ },
476
+ ...n
477
+ } : n, this)), e;
478
+ }
479
+ resolve(e) {
480
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n, s, r, a, l;
481
+ return typeof e == "string" && (e = [e]), e.forEach((o) => {
482
+ if (this.isValidLookup(n))
483
+ return;
484
+ const f = this.extractFromKey(o, t), g = f.key;
485
+ s = g;
486
+ let c = f.namespaces;
487
+ this.options.fallbackNS && (c = c.concat(this.options.fallbackNS));
488
+ const u = t.count !== void 0 && typeof t.count != "string", m = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), p = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", x = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
489
+ c.forEach((v) => {
490
+ this.isValidLookup(n) || (l = v, !te[`${x[0]}-${v}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(l) && (te[`${x[0]}-${v}`] = !0, this.logger.warn(`key "${s}" for languages "${x.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), x.forEach((P) => {
491
+ if (this.isValidLookup(n))
492
+ return;
493
+ a = P;
494
+ const O = [g];
495
+ if (this.i18nFormat && this.i18nFormat.addLookupKeys)
496
+ this.i18nFormat.addLookupKeys(O, g, P, v, t);
497
+ else {
498
+ let L;
499
+ u && (L = this.pluralResolver.getSuffix(P, t.count, t));
500
+ const R = `${this.options.pluralSeparator}zero`, $ = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
501
+ if (u && (O.push(g + L), t.ordinal && L.indexOf($) === 0 && O.push(g + L.replace($, this.options.pluralSeparator)), m && O.push(g + R)), p) {
502
+ const w = `${g}${this.options.contextSeparator}${t.context}`;
503
+ O.push(w), u && (O.push(w + L), t.ordinal && L.indexOf($) === 0 && O.push(w + L.replace($, this.options.pluralSeparator)), m && O.push(w + R));
504
+ }
505
+ }
506
+ let T;
507
+ for (; T = O.pop(); )
508
+ this.isValidLookup(n) || (r = T, n = this.getResource(P, v, T, t));
509
+ }));
510
+ });
511
+ }), {
512
+ res: n,
513
+ usedKey: s,
514
+ exactUsedKey: r,
515
+ usedLng: a,
516
+ usedNS: l
517
+ };
518
+ }
519
+ isValidLookup(e) {
520
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
521
+ }
522
+ getResource(e, t, n) {
523
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
524
+ return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, t, n, s) : this.resourceStore.getResource(e, t, n, s);
525
+ }
526
+ getUsedParamsDetails() {
527
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
528
+ const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && typeof e.replace != "string";
529
+ let s = n ? e.replace : e;
530
+ if (n && typeof e.count < "u" && (s.count = e.count), this.options.interpolation.defaultVariables && (s = {
531
+ ...this.options.interpolation.defaultVariables,
532
+ ...s
533
+ }), !n) {
534
+ s = {
535
+ ...s
536
+ };
537
+ for (const r of t)
538
+ delete s[r];
539
+ }
540
+ return s;
541
+ }
542
+ static hasDefaultValue(e) {
543
+ const t = "defaultValue";
544
+ for (const n in e)
545
+ if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, t.length) && e[n] !== void 0)
546
+ return !0;
547
+ return !1;
548
+ }
549
+ }
550
+ function B(i) {
551
+ return i.charAt(0).toUpperCase() + i.slice(1);
552
+ }
553
+ class ne {
554
+ constructor(e) {
555
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = k.create("languageUtils");
556
+ }
557
+ getScriptPartFromCode(e) {
558
+ if (e = z(e), !e || e.indexOf("-") < 0)
559
+ return null;
560
+ const t = e.split("-");
561
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
562
+ }
563
+ getLanguagePartFromCode(e) {
564
+ if (e = z(e), !e || e.indexOf("-") < 0)
565
+ return e;
566
+ const t = e.split("-");
567
+ return this.formatLanguageCode(t[0]);
568
+ }
569
+ formatLanguageCode(e) {
570
+ if (typeof e == "string" && e.indexOf("-") > -1) {
571
+ const t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
572
+ let n = e.split("-");
573
+ return this.options.lowerCaseLng ? n = n.map((s) => s.toLowerCase()) : n.length === 2 ? (n[0] = n[0].toLowerCase(), n[1] = n[1].toUpperCase(), t.indexOf(n[1].toLowerCase()) > -1 && (n[1] = B(n[1].toLowerCase()))) : n.length === 3 && (n[0] = n[0].toLowerCase(), n[1].length === 2 && (n[1] = n[1].toUpperCase()), n[0] !== "sgn" && n[2].length === 2 && (n[2] = n[2].toUpperCase()), t.indexOf(n[1].toLowerCase()) > -1 && (n[1] = B(n[1].toLowerCase())), t.indexOf(n[2].toLowerCase()) > -1 && (n[2] = B(n[2].toLowerCase()))), n.join("-");
574
+ }
575
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
576
+ }
577
+ isSupportedCode(e) {
578
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
579
+ }
580
+ getBestMatchFromCodes(e) {
581
+ if (!e)
582
+ return null;
583
+ let t;
584
+ return e.forEach((n) => {
585
+ if (t)
586
+ return;
587
+ const s = this.formatLanguageCode(n);
588
+ (!this.options.supportedLngs || this.isSupportedCode(s)) && (t = s);
589
+ }), !t && this.options.supportedLngs && e.forEach((n) => {
590
+ if (t)
591
+ return;
592
+ const s = this.getLanguagePartFromCode(n);
593
+ if (this.isSupportedCode(s))
594
+ return t = s;
595
+ t = this.options.supportedLngs.find((r) => {
596
+ if (r === s)
597
+ return r;
598
+ if (!(r.indexOf("-") < 0 && s.indexOf("-") < 0) && r.indexOf(s) === 0)
599
+ return r;
600
+ });
601
+ }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
602
+ }
603
+ getFallbackCodes(e, t) {
604
+ if (!e)
605
+ return [];
606
+ if (typeof e == "function" && (e = e(t)), typeof e == "string" && (e = [e]), Object.prototype.toString.apply(e) === "[object Array]")
607
+ return e;
608
+ if (!t)
609
+ return e.default || [];
610
+ let n = e[t];
611
+ return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
612
+ }
613
+ toResolveHierarchy(e, t) {
614
+ const n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), s = [], r = (a) => {
615
+ a && (this.isSupportedCode(a) ? s.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
616
+ };
617
+ return typeof e == "string" && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(e))) : typeof e == "string" && r(this.formatLanguageCode(e)), n.forEach((a) => {
618
+ s.indexOf(a) < 0 && r(this.formatLanguageCode(a));
619
+ }), s;
620
+ }
621
+ }
622
+ let ye = [{
623
+ lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
624
+ nr: [1, 2],
625
+ fc: 1
626
+ }, {
627
+ lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
628
+ nr: [1, 2],
629
+ fc: 2
630
+ }, {
631
+ lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
632
+ nr: [1],
633
+ fc: 3
634
+ }, {
635
+ lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
636
+ nr: [1, 2, 5],
637
+ fc: 4
638
+ }, {
639
+ lngs: ["ar"],
640
+ nr: [0, 1, 2, 3, 11, 100],
641
+ fc: 5
642
+ }, {
643
+ lngs: ["cs", "sk"],
644
+ nr: [1, 2, 5],
645
+ fc: 6
646
+ }, {
647
+ lngs: ["csb", "pl"],
648
+ nr: [1, 2, 5],
649
+ fc: 7
650
+ }, {
651
+ lngs: ["cy"],
652
+ nr: [1, 2, 3, 8],
653
+ fc: 8
654
+ }, {
655
+ lngs: ["fr"],
656
+ nr: [1, 2],
657
+ fc: 9
658
+ }, {
659
+ lngs: ["ga"],
660
+ nr: [1, 2, 3, 7, 11],
661
+ fc: 10
662
+ }, {
663
+ lngs: ["gd"],
664
+ nr: [1, 2, 3, 20],
665
+ fc: 11
666
+ }, {
667
+ lngs: ["is"],
668
+ nr: [1, 2],
669
+ fc: 12
670
+ }, {
671
+ lngs: ["jv"],
672
+ nr: [0, 1],
673
+ fc: 13
674
+ }, {
675
+ lngs: ["kw"],
676
+ nr: [1, 2, 3, 4],
677
+ fc: 14
678
+ }, {
679
+ lngs: ["lt"],
680
+ nr: [1, 2, 10],
681
+ fc: 15
682
+ }, {
683
+ lngs: ["lv"],
684
+ nr: [1, 2, 0],
685
+ fc: 16
686
+ }, {
687
+ lngs: ["mk"],
688
+ nr: [1, 2],
689
+ fc: 17
690
+ }, {
691
+ lngs: ["mnk"],
692
+ nr: [0, 1, 2],
693
+ fc: 18
694
+ }, {
695
+ lngs: ["mt"],
696
+ nr: [1, 2, 11, 20],
697
+ fc: 19
698
+ }, {
699
+ lngs: ["or"],
700
+ nr: [2, 1],
701
+ fc: 2
702
+ }, {
703
+ lngs: ["ro"],
704
+ nr: [1, 2, 20],
705
+ fc: 20
706
+ }, {
707
+ lngs: ["sl"],
708
+ nr: [5, 1, 2, 3],
709
+ fc: 21
710
+ }, {
711
+ lngs: ["he", "iw"],
712
+ nr: [1, 2, 20, 21],
713
+ fc: 22
714
+ }], be = {
715
+ 1: function(i) {
716
+ return +(i > 1);
717
+ },
718
+ 2: function(i) {
719
+ return +(i != 1);
720
+ },
721
+ 3: function(i) {
722
+ return 0;
723
+ },
724
+ 4: function(i) {
725
+ return i % 10 == 1 && i % 100 != 11 ? 0 : i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 10 || i % 100 >= 20) ? 1 : 2;
726
+ },
727
+ 5: function(i) {
728
+ return i == 0 ? 0 : i == 1 ? 1 : i == 2 ? 2 : i % 100 >= 3 && i % 100 <= 10 ? 3 : i % 100 >= 11 ? 4 : 5;
729
+ },
730
+ 6: function(i) {
731
+ return i == 1 ? 0 : i >= 2 && i <= 4 ? 1 : 2;
732
+ },
733
+ 7: function(i) {
734
+ return i == 1 ? 0 : i % 10 >= 2 && i % 10 <= 4 && (i % 100 < 10 || i % 100 >= 20) ? 1 : 2;
735
+ },
736
+ 8: function(i) {
737
+ return i == 1 ? 0 : i == 2 ? 1 : i != 8 && i != 11 ? 2 : 3;
738
+ },
739
+ 9: function(i) {
740
+ return +(i >= 2);
741
+ },
742
+ 10: function(i) {
743
+ return i == 1 ? 0 : i == 2 ? 1 : i < 7 ? 2 : i < 11 ? 3 : 4;
744
+ },
745
+ 11: function(i) {
746
+ return i == 1 || i == 11 ? 0 : i == 2 || i == 12 ? 1 : i > 2 && i < 20 ? 2 : 3;
747
+ },
748
+ 12: function(i) {
749
+ return +(i % 10 != 1 || i % 100 == 11);
750
+ },
751
+ 13: function(i) {
752
+ return +(i !== 0);
753
+ },
754
+ 14: function(i) {
755
+ return i == 1 ? 0 : i == 2 ? 1 : i == 3 ? 2 : 3;
756
+ },
757
+ 15: function(i) {
758
+ return i % 10 == 1 && i % 100 != 11 ? 0 : i % 10 >= 2 && (i % 100 < 10 || i % 100 >= 20) ? 1 : 2;
759
+ },
760
+ 16: function(i) {
761
+ return i % 10 == 1 && i % 100 != 11 ? 0 : i !== 0 ? 1 : 2;
762
+ },
763
+ 17: function(i) {
764
+ return i == 1 || i % 10 == 1 && i % 100 != 11 ? 0 : 1;
765
+ },
766
+ 18: function(i) {
767
+ return i == 0 ? 0 : i == 1 ? 1 : 2;
768
+ },
769
+ 19: function(i) {
770
+ return i == 1 ? 0 : i == 0 || i % 100 > 1 && i % 100 < 11 ? 1 : i % 100 > 10 && i % 100 < 20 ? 2 : 3;
771
+ },
772
+ 20: function(i) {
773
+ return i == 1 ? 0 : i == 0 || i % 100 > 0 && i % 100 < 20 ? 1 : 2;
774
+ },
775
+ 21: function(i) {
776
+ return i % 100 == 1 ? 1 : i % 100 == 2 ? 2 : i % 100 == 3 || i % 100 == 4 ? 3 : 0;
777
+ },
778
+ 22: function(i) {
779
+ return i == 1 ? 0 : i == 2 ? 1 : (i < 0 || i > 10) && i % 10 == 0 ? 2 : 3;
780
+ }
781
+ };
782
+ const xe = ["v1", "v2", "v3"], Se = ["v4"], se = {
783
+ zero: 0,
784
+ one: 1,
785
+ two: 2,
786
+ few: 3,
787
+ many: 4,
788
+ other: 5
789
+ };
790
+ function ve() {
791
+ const i = {};
792
+ return ye.forEach((e) => {
793
+ e.lngs.forEach((t) => {
794
+ i[t] = {
795
+ numbers: e.nr,
796
+ plurals: be[e.fc]
797
+ };
798
+ });
799
+ }), i;
800
+ }
801
+ class Le {
802
+ constructor(e) {
803
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
804
+ this.languageUtils = e, this.options = t, this.logger = k.create("pluralResolver"), (!this.options.compatibilityJSON || Se.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = ve();
805
+ }
806
+ addRule(e, t) {
807
+ this.rules[e] = t;
808
+ }
809
+ getRule(e) {
810
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
811
+ if (this.shouldUseIntlApi())
812
+ try {
813
+ return new Intl.PluralRules(z(e), {
814
+ type: t.ordinal ? "ordinal" : "cardinal"
815
+ });
816
+ } catch {
817
+ return;
818
+ }
819
+ return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
820
+ }
821
+ needsPlural(e) {
822
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
823
+ const n = this.getRule(e, t);
824
+ return this.shouldUseIntlApi() ? n && n.resolvedOptions().pluralCategories.length > 1 : n && n.numbers.length > 1;
825
+ }
826
+ getPluralFormsOfKey(e, t) {
827
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
828
+ return this.getSuffixes(e, n).map((s) => `${t}${s}`);
829
+ }
830
+ getSuffixes(e) {
831
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
832
+ const n = this.getRule(e, t);
833
+ return n ? this.shouldUseIntlApi() ? n.resolvedOptions().pluralCategories.sort((s, r) => se[s] - se[r]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : n.numbers.map((s) => this.getSuffix(e, s, t)) : [];
834
+ }
835
+ getSuffix(e, t) {
836
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
837
+ const s = this.getRule(e, n);
838
+ return s ? this.shouldUseIntlApi() ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(t)}` : this.getSuffixRetroCompatible(s, t) : (this.logger.warn(`no plural rule found for: ${e}`), "");
839
+ }
840
+ getSuffixRetroCompatible(e, t) {
841
+ const n = e.noAbs ? e.plurals(t) : e.plurals(Math.abs(t));
842
+ let s = e.numbers[n];
843
+ this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (s === 2 ? s = "plural" : s === 1 && (s = ""));
844
+ const r = () => this.options.prepend && s.toString() ? this.options.prepend + s.toString() : s.toString();
845
+ return this.options.compatibilityJSON === "v1" ? s === 1 ? "" : typeof s == "number" ? `_plural_${s.toString()}` : r() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? r() : this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
846
+ }
847
+ shouldUseIntlApi() {
848
+ return !xe.includes(this.options.compatibilityJSON);
849
+ }
850
+ }
851
+ function ie(i, e, t) {
852
+ let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = he(i, e, t);
853
+ return !r && s && typeof t == "string" && (r = J(i, t, n), r === void 0 && (r = J(e, t, n))), r;
854
+ }
855
+ class Oe {
856
+ constructor() {
857
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
858
+ this.logger = k.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
859
+ }
860
+ init() {
861
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
862
+ e.interpolation || (e.interpolation = {
863
+ escapeValue: !0
864
+ });
865
+ const t = e.interpolation;
866
+ this.escape = t.escape !== void 0 ? t.escape : de, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? I(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? I(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? I(t.nestingPrefix) : t.nestingPrefixEscaped || I("$t("), this.nestingSuffix = t.nestingSuffix ? I(t.nestingSuffix) : t.nestingSuffixEscaped || I(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
867
+ }
868
+ reset() {
869
+ this.options && this.init(this.options);
870
+ }
871
+ resetRegExp() {
872
+ const e = `${this.prefix}(.+?)${this.suffix}`;
873
+ this.regexp = new RegExp(e, "g");
874
+ const t = `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;
875
+ this.regexpUnescape = new RegExp(t, "g");
876
+ const n = `${this.nestingPrefix}(.+?)${this.nestingSuffix}`;
877
+ this.nestingRegexp = new RegExp(n, "g");
878
+ }
879
+ interpolate(e, t, n, s) {
880
+ let r, a, l;
881
+ const o = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
882
+ function f(p) {
883
+ return p.replace(/\$/g, "$$$$");
884
+ }
885
+ const g = (p) => {
886
+ if (p.indexOf(this.formatSeparator) < 0) {
887
+ const O = ie(t, o, p, this.options.keySeparator, this.options.ignoreJSONStructure);
888
+ return this.alwaysFormat ? this.format(O, void 0, n, {
889
+ ...s,
890
+ ...t,
891
+ interpolationkey: p
892
+ }) : O;
893
+ }
894
+ const x = p.split(this.formatSeparator), v = x.shift().trim(), P = x.join(this.formatSeparator).trim();
895
+ return this.format(ie(t, o, v, this.options.keySeparator, this.options.ignoreJSONStructure), P, n, {
896
+ ...s,
897
+ ...t,
898
+ interpolationkey: v
899
+ });
900
+ };
901
+ this.resetRegExp();
902
+ const c = s && s.missingInterpolationHandler || this.options.missingInterpolationHandler, u = s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
903
+ return [{
904
+ regex: this.regexpUnescape,
905
+ safeValue: (p) => f(p)
906
+ }, {
907
+ regex: this.regexp,
908
+ safeValue: (p) => this.escapeValue ? f(this.escape(p)) : f(p)
909
+ }].forEach((p) => {
910
+ for (l = 0; r = p.regex.exec(e); ) {
911
+ const x = r[1].trim();
912
+ if (a = g(x), a === void 0)
913
+ if (typeof c == "function") {
914
+ const P = c(e, r, s);
915
+ a = typeof P == "string" ? P : "";
916
+ } else if (s && Object.prototype.hasOwnProperty.call(s, x))
917
+ a = "";
918
+ else if (u) {
919
+ a = r[0];
920
+ continue;
921
+ } else
922
+ this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`), a = "";
923
+ else
924
+ typeof a != "string" && !this.useRawValueToEscape && (a = q(a));
925
+ const v = p.safeValue(a);
926
+ if (e = e.replace(r[0], v), u ? (p.regex.lastIndex += a.length, p.regex.lastIndex -= r[0].length) : p.regex.lastIndex = 0, l++, l >= this.maxReplaces)
927
+ break;
928
+ }
929
+ }), e;
930
+ }
931
+ nest(e, t) {
932
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s, r, a;
933
+ function l(o, f) {
934
+ const g = this.nestingOptionsSeparator;
935
+ if (o.indexOf(g) < 0)
936
+ return o;
937
+ const c = o.split(new RegExp(`${g}[ ]*{`));
938
+ let u = `{${c[1]}`;
939
+ o = c[0], u = this.interpolate(u, a);
940
+ const m = u.match(/'/g), p = u.match(/"/g);
941
+ (m && m.length % 2 === 0 && !p || p.length % 2 !== 0) && (u = u.replace(/'/g, '"'));
942
+ try {
943
+ a = JSON.parse(u), f && (a = {
944
+ ...f,
945
+ ...a
946
+ });
947
+ } catch (x) {
948
+ return this.logger.warn(`failed parsing options string in nesting for key ${o}`, x), `${o}${g}${u}`;
949
+ }
950
+ return delete a.defaultValue, o;
951
+ }
952
+ for (; s = this.nestingRegexp.exec(e); ) {
953
+ let o = [];
954
+ a = {
955
+ ...n
956
+ }, a = a.replace && typeof a.replace != "string" ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
957
+ let f = !1;
958
+ if (s[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(s[1])) {
959
+ const g = s[1].split(this.formatSeparator).map((c) => c.trim());
960
+ s[1] = g.shift(), o = g, f = !0;
961
+ }
962
+ if (r = t(l.call(this, s[1].trim(), a), a), r && s[0] === e && typeof r != "string")
963
+ return r;
964
+ typeof r != "string" && (r = q(r)), r || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), r = ""), f && (r = o.reduce((g, c) => this.format(g, c, n.lng, {
965
+ ...n,
966
+ interpolationkey: s[1].trim()
967
+ }), r.trim())), e = e.replace(s[0], r), this.regexp.lastIndex = 0;
968
+ }
969
+ return e;
970
+ }
971
+ }
972
+ function we(i) {
973
+ let e = i.toLowerCase().trim();
974
+ const t = {};
975
+ if (i.indexOf("(") > -1) {
976
+ const n = i.split("(");
977
+ e = n[0].toLowerCase().trim();
978
+ const s = n[1].substring(0, n[1].length - 1);
979
+ e === "currency" && s.indexOf(":") < 0 ? t.currency || (t.currency = s.trim()) : e === "relativetime" && s.indexOf(":") < 0 ? t.range || (t.range = s.trim()) : s.split(";").forEach((a) => {
980
+ if (!a)
981
+ return;
982
+ const [l, ...o] = a.split(":"), f = o.join(":").trim().replace(/^'+|'+$/g, "");
983
+ t[l.trim()] || (t[l.trim()] = f), f === "false" && (t[l.trim()] = !1), f === "true" && (t[l.trim()] = !0), isNaN(f) || (t[l.trim()] = parseInt(f, 10));
984
+ });
985
+ }
986
+ return {
987
+ formatName: e,
988
+ formatOptions: t
989
+ };
990
+ }
991
+ function A(i) {
992
+ const e = {};
993
+ return function(n, s, r) {
994
+ const a = s + JSON.stringify(r);
995
+ let l = e[a];
996
+ return l || (l = i(z(s), r), e[a] = l), l(n);
997
+ };
998
+ }
999
+ class Ne {
1000
+ constructor() {
1001
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1002
+ this.logger = k.create("formatter"), this.options = e, this.formats = {
1003
+ number: A((t, n) => {
1004
+ const s = new Intl.NumberFormat(t, {
1005
+ ...n
1006
+ });
1007
+ return (r) => s.format(r);
1008
+ }),
1009
+ currency: A((t, n) => {
1010
+ const s = new Intl.NumberFormat(t, {
1011
+ ...n,
1012
+ style: "currency"
1013
+ });
1014
+ return (r) => s.format(r);
1015
+ }),
1016
+ datetime: A((t, n) => {
1017
+ const s = new Intl.DateTimeFormat(t, {
1018
+ ...n
1019
+ });
1020
+ return (r) => s.format(r);
1021
+ }),
1022
+ relativetime: A((t, n) => {
1023
+ const s = new Intl.RelativeTimeFormat(t, {
1024
+ ...n
1025
+ });
1026
+ return (r) => s.format(r, n.range || "day");
1027
+ }),
1028
+ list: A((t, n) => {
1029
+ const s = new Intl.ListFormat(t, {
1030
+ ...n
1031
+ });
1032
+ return (r) => s.format(r);
1033
+ })
1034
+ }, this.init(e);
1035
+ }
1036
+ init(e) {
1037
+ const n = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1038
+ interpolation: {}
1039
+ }).interpolation;
1040
+ this.formatSeparator = n.formatSeparator ? n.formatSeparator : n.formatSeparator || ",";
1041
+ }
1042
+ add(e, t) {
1043
+ this.formats[e.toLowerCase().trim()] = t;
1044
+ }
1045
+ addCached(e, t) {
1046
+ this.formats[e.toLowerCase().trim()] = A(t);
1047
+ }
1048
+ format(e, t, n) {
1049
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1050
+ return t.split(this.formatSeparator).reduce((l, o) => {
1051
+ const {
1052
+ formatName: f,
1053
+ formatOptions: g
1054
+ } = we(o);
1055
+ if (this.formats[f]) {
1056
+ let c = l;
1057
+ try {
1058
+ const u = s && s.formatParams && s.formatParams[s.interpolationkey] || {}, m = u.locale || u.lng || s.locale || s.lng || n;
1059
+ c = this.formats[f](l, m, {
1060
+ ...g,
1061
+ ...s,
1062
+ ...u
1063
+ });
1064
+ } catch (u) {
1065
+ this.logger.warn(u);
1066
+ }
1067
+ return c;
1068
+ } else
1069
+ this.logger.warn(`there was no format function for ${f}`);
1070
+ return l;
1071
+ }, e);
1072
+ }
1073
+ }
1074
+ function Pe(i, e) {
1075
+ i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
1076
+ }
1077
+ class Re extends Y {
1078
+ constructor(e, t, n) {
1079
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1080
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = s, this.logger = k.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(n, s.backend, s);
1081
+ }
1082
+ queueLoad(e, t, n, s) {
1083
+ const r = {}, a = {}, l = {}, o = {};
1084
+ return e.forEach((f) => {
1085
+ let g = !0;
1086
+ t.forEach((c) => {
1087
+ const u = `${f}|${c}`;
1088
+ !n.reload && this.store.hasResourceBundle(f, c) ? this.state[u] = 2 : this.state[u] < 0 || (this.state[u] === 1 ? a[u] === void 0 && (a[u] = !0) : (this.state[u] = 1, g = !1, a[u] === void 0 && (a[u] = !0), r[u] === void 0 && (r[u] = !0), o[c] === void 0 && (o[c] = !0)));
1089
+ }), g || (l[f] = !0);
1090
+ }), (Object.keys(r).length || Object.keys(a).length) && this.queue.push({
1091
+ pending: a,
1092
+ pendingCount: Object.keys(a).length,
1093
+ loaded: {},
1094
+ errors: [],
1095
+ callback: s
1096
+ }), {
1097
+ toLoad: Object.keys(r),
1098
+ pending: Object.keys(a),
1099
+ toLoadLanguages: Object.keys(l),
1100
+ toLoadNamespaces: Object.keys(o)
1101
+ };
1102
+ }
1103
+ loaded(e, t, n) {
1104
+ const s = e.split("|"), r = s[0], a = s[1];
1105
+ t && this.emit("failedLoading", r, a, t), n && this.store.addResourceBundle(r, a, n), this.state[e] = t ? -1 : 2;
1106
+ const l = {};
1107
+ this.queue.forEach((o) => {
1108
+ ge(o.loaded, [r], a), Pe(o, e), t && o.errors.push(t), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((f) => {
1109
+ l[f] || (l[f] = {});
1110
+ const g = o.loaded[f];
1111
+ g.length && g.forEach((c) => {
1112
+ l[f][c] === void 0 && (l[f][c] = !0);
1113
+ });
1114
+ }), o.done = !0, o.errors.length ? o.callback(o.errors) : o.callback());
1115
+ }), this.emit("loaded", l), this.queue = this.queue.filter((o) => !o.done);
1116
+ }
1117
+ read(e, t, n) {
1118
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
1119
+ if (!e.length)
1120
+ return a(null, {});
1121
+ if (this.readingCalls >= this.maxParallelReads) {
1122
+ this.waitingReads.push({
1123
+ lng: e,
1124
+ ns: t,
1125
+ fcName: n,
1126
+ tried: s,
1127
+ wait: r,
1128
+ callback: a
1129
+ });
1130
+ return;
1131
+ }
1132
+ this.readingCalls++;
1133
+ const l = (f, g) => {
1134
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1135
+ const c = this.waitingReads.shift();
1136
+ this.read(c.lng, c.ns, c.fcName, c.tried, c.wait, c.callback);
1137
+ }
1138
+ if (f && g && s < this.maxRetries) {
1139
+ setTimeout(() => {
1140
+ this.read.call(this, e, t, n, s + 1, r * 2, a);
1141
+ }, r);
1142
+ return;
1143
+ }
1144
+ a(f, g);
1145
+ }, o = this.backend[n].bind(this.backend);
1146
+ if (o.length === 2) {
1147
+ try {
1148
+ const f = o(e, t);
1149
+ f && typeof f.then == "function" ? f.then((g) => l(null, g)).catch(l) : l(null, f);
1150
+ } catch (f) {
1151
+ l(f);
1152
+ }
1153
+ return;
1154
+ }
1155
+ return o(e, t, l);
1156
+ }
1157
+ prepareLoading(e, t) {
1158
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = arguments.length > 3 ? arguments[3] : void 0;
1159
+ if (!this.backend)
1160
+ return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
1161
+ typeof e == "string" && (e = this.languageUtils.toResolveHierarchy(e)), typeof t == "string" && (t = [t]);
1162
+ const r = this.queueLoad(e, t, n, s);
1163
+ if (!r.toLoad.length)
1164
+ return r.pending.length || s(), null;
1165
+ r.toLoad.forEach((a) => {
1166
+ this.loadOne(a);
1167
+ });
1168
+ }
1169
+ load(e, t, n) {
1170
+ this.prepareLoading(e, t, {}, n);
1171
+ }
1172
+ reload(e, t, n) {
1173
+ this.prepareLoading(e, t, {
1174
+ reload: !0
1175
+ }, n);
1176
+ }
1177
+ loadOne(e) {
1178
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1179
+ const n = e.split("|"), s = n[0], r = n[1];
1180
+ this.read(s, r, "read", void 0, void 0, (a, l) => {
1181
+ a && this.logger.warn(`${t}loading namespace ${r} for language ${s} failed`, a), !a && l && this.logger.log(`${t}loaded namespace ${r} for language ${s}`, l), this.loaded(e, a, l);
1182
+ });
1183
+ }
1184
+ saveMissing(e, t, n, s, r) {
1185
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, l = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1186
+ };
1187
+ if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t)) {
1188
+ this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1189
+ return;
1190
+ }
1191
+ if (!(n == null || n === "")) {
1192
+ if (this.backend && this.backend.create) {
1193
+ const o = {
1194
+ ...a,
1195
+ isUpdate: r
1196
+ }, f = this.backend.create.bind(this.backend);
1197
+ if (f.length < 6)
1198
+ try {
1199
+ let g;
1200
+ f.length === 5 ? g = f(e, t, n, s, o) : g = f(e, t, n, s), g && typeof g.then == "function" ? g.then((c) => l(null, c)).catch(l) : l(null, g);
1201
+ } catch (g) {
1202
+ l(g);
1203
+ }
1204
+ else
1205
+ f(e, t, n, s, l, o);
1206
+ }
1207
+ !e || !e[0] || this.store.addResource(e[0], t, n, s);
1208
+ }
1209
+ }
1210
+ }
1211
+ function re() {
1212
+ return {
1213
+ debug: !1,
1214
+ initImmediate: !0,
1215
+ ns: ["translation"],
1216
+ defaultNS: ["translation"],
1217
+ fallbackLng: ["dev"],
1218
+ fallbackNS: !1,
1219
+ supportedLngs: !1,
1220
+ nonExplicitSupportedLngs: !1,
1221
+ load: "all",
1222
+ preload: !1,
1223
+ simplifyPluralSuffix: !0,
1224
+ keySeparator: ".",
1225
+ nsSeparator: ":",
1226
+ pluralSeparator: "_",
1227
+ contextSeparator: "_",
1228
+ partialBundledLanguages: !1,
1229
+ saveMissing: !1,
1230
+ updateMissing: !1,
1231
+ saveMissingTo: "fallback",
1232
+ saveMissingPlurals: !0,
1233
+ missingKeyHandler: !1,
1234
+ missingInterpolationHandler: !1,
1235
+ postProcess: !1,
1236
+ postProcessPassResolved: !1,
1237
+ returnNull: !1,
1238
+ returnEmptyString: !0,
1239
+ returnObjects: !1,
1240
+ joinArrays: !1,
1241
+ returnedObjectHandler: !1,
1242
+ parseMissingKeyHandler: !1,
1243
+ appendNamespaceToMissingKey: !1,
1244
+ appendNamespaceToCIMode: !1,
1245
+ overloadTranslationOptionHandler: function(e) {
1246
+ let t = {};
1247
+ if (typeof e[1] == "object" && (t = e[1]), typeof e[1] == "string" && (t.defaultValue = e[1]), typeof e[2] == "string" && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1248
+ const n = e[3] || e[2];
1249
+ Object.keys(n).forEach((s) => {
1250
+ t[s] = n[s];
1251
+ });
1252
+ }
1253
+ return t;
1254
+ },
1255
+ interpolation: {
1256
+ escapeValue: !0,
1257
+ format: (i) => i,
1258
+ prefix: "{{",
1259
+ suffix: "}}",
1260
+ formatSeparator: ",",
1261
+ unescapePrefix: "-",
1262
+ nestingPrefix: "$t(",
1263
+ nestingSuffix: ")",
1264
+ nestingOptionsSeparator: ",",
1265
+ maxReplaces: 1e3,
1266
+ skipOnVariables: !0
1267
+ }
1268
+ };
1269
+ }
1270
+ function ae(i) {
1271
+ return typeof i.ns == "string" && (i.ns = [i.ns]), typeof i.fallbackLng == "string" && (i.fallbackLng = [i.fallbackLng]), typeof i.fallbackNS == "string" && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i;
1272
+ }
1273
+ function U() {
1274
+ }
1275
+ function Ce(i) {
1276
+ Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
1277
+ typeof i[t] == "function" && (i[t] = i[t].bind(i));
1278
+ });
1279
+ }
1280
+ class V extends Y {
1281
+ constructor() {
1282
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1283
+ if (super(), this.options = ae(e), this.services = {}, this.logger = k, this.modules = {
1284
+ external: []
1285
+ }, Ce(this), t && !this.isInitialized && !e.isClone) {
1286
+ if (!this.options.initImmediate)
1287
+ return this.init(e, t), this;
1288
+ setTimeout(() => {
1289
+ this.init(e, t);
1290
+ }, 0);
1291
+ }
1292
+ }
1293
+ init() {
1294
+ var e = this;
1295
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
1296
+ typeof t == "function" && (n = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (typeof t.ns == "string" ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1297
+ const s = re();
1298
+ this.options = {
1299
+ ...s,
1300
+ ...this.options,
1301
+ ...ae(t)
1302
+ }, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
1303
+ ...s.interpolation,
1304
+ ...this.options.interpolation
1305
+ }), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1306
+ function r(g) {
1307
+ return g ? typeof g == "function" ? new g() : g : null;
1308
+ }
1309
+ if (!this.options.isClone) {
1310
+ this.modules.logger ? k.init(r(this.modules.logger), this.options) : k.init(null, this.options);
1311
+ let g;
1312
+ this.modules.formatter ? g = this.modules.formatter : typeof Intl < "u" && (g = Ne);
1313
+ const c = new ne(this.options);
1314
+ this.store = new ee(this.options.resources, this.options);
1315
+ const u = this.services;
1316
+ u.logger = k, u.resourceStore = this.store, u.languageUtils = c, u.pluralResolver = new Le(c, {
1317
+ prepend: this.options.pluralSeparator,
1318
+ compatibilityJSON: this.options.compatibilityJSON,
1319
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1320
+ }), g && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (u.formatter = r(g), u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new Oe(this.options), u.utils = {
1321
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1322
+ }, u.backendConnector = new Re(r(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(m) {
1323
+ for (var p = arguments.length, x = new Array(p > 1 ? p - 1 : 0), v = 1; v < p; v++)
1324
+ x[v - 1] = arguments[v];
1325
+ e.emit(m, ...x);
1326
+ }), this.modules.languageDetector && (u.languageDetector = r(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = r(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new W(this.services, this.options), this.translator.on("*", function(m) {
1327
+ for (var p = arguments.length, x = new Array(p > 1 ? p - 1 : 0), v = 1; v < p; v++)
1328
+ x[v - 1] = arguments[v];
1329
+ e.emit(m, ...x);
1330
+ }), this.modules.external.forEach((m) => {
1331
+ m.init && m.init(this);
1332
+ });
1333
+ }
1334
+ if (this.format = this.options.interpolation.format, n || (n = U), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1335
+ const g = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1336
+ g.length > 0 && g[0] !== "dev" && (this.options.lng = g[0]);
1337
+ }
1338
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((g) => {
1339
+ this[g] = function() {
1340
+ return e.store[g](...arguments);
1341
+ };
1342
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((g) => {
1343
+ this[g] = function() {
1344
+ return e.store[g](...arguments), e;
1345
+ };
1346
+ });
1347
+ const o = D(), f = () => {
1348
+ const g = (c, u) => {
1349
+ this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), o.resolve(u), n(c, u);
1350
+ };
1351
+ if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized)
1352
+ return g(null, this.t.bind(this));
1353
+ this.changeLanguage(this.options.lng, g);
1354
+ };
1355
+ return this.options.resources || !this.options.initImmediate ? f() : setTimeout(f, 0), o;
1356
+ }
1357
+ loadResources(e) {
1358
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : U;
1359
+ const s = typeof e == "string" ? e : this.language;
1360
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1361
+ if (s && s.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0))
1362
+ return n();
1363
+ const r = [], a = (l) => {
1364
+ if (!l || l === "cimode")
1365
+ return;
1366
+ this.services.languageUtils.toResolveHierarchy(l).forEach((f) => {
1367
+ f !== "cimode" && r.indexOf(f) < 0 && r.push(f);
1368
+ });
1369
+ };
1370
+ s ? a(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((o) => a(o)), this.options.preload && this.options.preload.forEach((l) => a(l)), this.services.backendConnector.load(r, this.options.ns, (l) => {
1371
+ !l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(l);
1372
+ });
1373
+ } else
1374
+ n(null);
1375
+ }
1376
+ reloadResources(e, t, n) {
1377
+ const s = D();
1378
+ return e || (e = this.languages), t || (t = this.options.ns), n || (n = U), this.services.backendConnector.reload(e, t, (r) => {
1379
+ s.resolve(), n(r);
1380
+ }), s;
1381
+ }
1382
+ use(e) {
1383
+ if (!e)
1384
+ throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1385
+ if (!e.type)
1386
+ throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1387
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && le.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1388
+ }
1389
+ setResolvedLanguage(e) {
1390
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1391
+ for (let t = 0; t < this.languages.length; t++) {
1392
+ const n = this.languages[t];
1393
+ if (!(["cimode", "dev"].indexOf(n) > -1) && this.store.hasLanguageSomeTranslations(n)) {
1394
+ this.resolvedLanguage = n;
1395
+ break;
1396
+ }
1397
+ }
1398
+ }
1399
+ changeLanguage(e, t) {
1400
+ var n = this;
1401
+ this.isLanguageChangingTo = e;
1402
+ const s = D();
1403
+ this.emit("languageChanging", e);
1404
+ const r = (o) => {
1405
+ this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
1406
+ }, a = (o, f) => {
1407
+ f ? (r(f), this.translator.changeLanguage(f), this.isLanguageChangingTo = void 0, this.emit("languageChanged", f), this.logger.log("languageChanged", f)) : this.isLanguageChangingTo = void 0, s.resolve(function() {
1408
+ return n.t(...arguments);
1409
+ }), t && t(o, function() {
1410
+ return n.t(...arguments);
1411
+ });
1412
+ }, l = (o) => {
1413
+ !e && !o && this.services.languageDetector && (o = []);
1414
+ const f = typeof o == "string" ? o : this.services.languageUtils.getBestMatchFromCodes(o);
1415
+ f && (this.language || r(f), this.translator.language || this.translator.changeLanguage(f), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(f)), this.loadResources(f, (g) => {
1416
+ a(g, f);
1417
+ });
1418
+ };
1419
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? l(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(l) : this.services.languageDetector.detect(l) : l(e), s;
1420
+ }
1421
+ getFixedT(e, t, n) {
1422
+ var s = this;
1423
+ const r = function(a, l) {
1424
+ let o;
1425
+ if (typeof l != "object") {
1426
+ for (var f = arguments.length, g = new Array(f > 2 ? f - 2 : 0), c = 2; c < f; c++)
1427
+ g[c - 2] = arguments[c];
1428
+ o = s.options.overloadTranslationOptionHandler([a, l].concat(g));
1429
+ } else
1430
+ o = {
1431
+ ...l
1432
+ };
1433
+ o.lng = o.lng || r.lng, o.lngs = o.lngs || r.lngs, o.ns = o.ns || r.ns, o.keyPrefix = o.keyPrefix || n || r.keyPrefix;
1434
+ const u = s.options.keySeparator || ".";
1435
+ let m;
1436
+ return o.keyPrefix && Array.isArray(a) ? m = a.map((p) => `${o.keyPrefix}${u}${p}`) : m = o.keyPrefix ? `${o.keyPrefix}${u}${a}` : a, s.t(m, o);
1437
+ };
1438
+ return typeof e == "string" ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1439
+ }
1440
+ t() {
1441
+ return this.translator && this.translator.translate(...arguments);
1442
+ }
1443
+ exists() {
1444
+ return this.translator && this.translator.exists(...arguments);
1445
+ }
1446
+ setDefaultNamespace(e) {
1447
+ this.options.defaultNS = e;
1448
+ }
1449
+ hasLoadedNamespace(e) {
1450
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1451
+ if (!this.isInitialized)
1452
+ return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1453
+ if (!this.languages || !this.languages.length)
1454
+ return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1455
+ const n = t.lng || this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
1456
+ if (n.toLowerCase() === "cimode")
1457
+ return !0;
1458
+ const a = (l, o) => {
1459
+ const f = this.services.backendConnector.state[`${l}|${o}`];
1460
+ return f === -1 || f === 2;
1461
+ };
1462
+ if (t.precheck) {
1463
+ const l = t.precheck(this, a);
1464
+ if (l !== void 0)
1465
+ return l;
1466
+ }
1467
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!s || a(r, e)));
1468
+ }
1469
+ loadNamespaces(e, t) {
1470
+ const n = D();
1471
+ return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((s) => {
1472
+ this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
1473
+ }), this.loadResources((s) => {
1474
+ n.resolve(), t && t(s);
1475
+ }), n) : (t && t(), Promise.resolve());
1476
+ }
1477
+ loadLanguages(e, t) {
1478
+ const n = D();
1479
+ typeof e == "string" && (e = [e]);
1480
+ const s = this.options.preload || [], r = e.filter((a) => s.indexOf(a) < 0);
1481
+ return r.length ? (this.options.preload = s.concat(r), this.loadResources((a) => {
1482
+ n.resolve(), t && t(a);
1483
+ }), n) : (t && t(), Promise.resolve());
1484
+ }
1485
+ dir(e) {
1486
+ if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e)
1487
+ return "rtl";
1488
+ const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = this.services && this.services.languageUtils || new ne(re());
1489
+ return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1490
+ }
1491
+ static createInstance() {
1492
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1493
+ return new V(e, t);
1494
+ }
1495
+ cloneInstance() {
1496
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : U;
1497
+ const n = e.forkResourceStore;
1498
+ n && delete e.forkResourceStore;
1499
+ const s = {
1500
+ ...this.options,
1501
+ ...e,
1502
+ isClone: !0
1503
+ }, r = new V(s);
1504
+ return (e.debug !== void 0 || e.prefix !== void 0) && (r.logger = r.logger.clone(e)), ["store", "services", "language"].forEach((l) => {
1505
+ r[l] = this[l];
1506
+ }), r.services = {
1507
+ ...this.services
1508
+ }, r.services.utils = {
1509
+ hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1510
+ }, n && (r.store = new ee(this.store.data, s), r.services.resourceStore = r.store), r.translator = new W(r.services, s), r.translator.on("*", function(l) {
1511
+ for (var o = arguments.length, f = new Array(o > 1 ? o - 1 : 0), g = 1; g < o; g++)
1512
+ f[g - 1] = arguments[g];
1513
+ r.emit(l, ...f);
1514
+ }), r.init(s, t), r.translator.options = s, r.translator.backendConnector.services.utils = {
1515
+ hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1516
+ }, r;
1517
+ }
1518
+ toJSON() {
1519
+ return {
1520
+ options: this.options,
1521
+ store: this.store,
1522
+ language: this.language,
1523
+ languages: this.languages,
1524
+ resolvedLanguage: this.resolvedLanguage
1525
+ };
1526
+ }
1527
+ }
1528
+ const C = V.createInstance();
1529
+ C.createInstance = V.createInstance;
1530
+ C.createInstance;
1531
+ C.dir;
1532
+ C.init;
1533
+ C.loadResources;
1534
+ C.reloadResources;
1535
+ C.use;
1536
+ C.changeLanguage;
1537
+ C.getFixedT;
1538
+ C.t;
1539
+ C.exists;
1540
+ C.setDefaultNamespace;
1541
+ C.hasLoadedNamespace;
1542
+ C.loadNamespaces;
1543
+ C.loadLanguages;
1544
+ var Fe = {};
1545
+ /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
1546
+ (function(i) {
1547
+ (function(e) {
1548
+ e(typeof DO_NOT_EXPORT_CRC > "u" ? i : {});
1549
+ })(function(e) {
1550
+ e.version = "1.2.2";
1551
+ function t() {
1552
+ for (var h = 0, N = new Array(256), d = 0; d != 256; ++d)
1553
+ h = d, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, h = h & 1 ? -306674912 ^ h >>> 1 : h >>> 1, N[d] = h;
1554
+ return typeof Int32Array < "u" ? new Int32Array(N) : N;
1555
+ }
1556
+ var n = t();
1557
+ function s(h) {
1558
+ var N = 0, d = 0, y = 0, b = typeof Int32Array < "u" ? new Int32Array(4096) : new Array(4096);
1559
+ for (y = 0; y != 256; ++y)
1560
+ b[y] = h[y];
1561
+ for (y = 0; y != 256; ++y)
1562
+ for (d = h[y], N = 256 + y; N < 4096; N += 256)
1563
+ d = b[N] = d >>> 8 ^ h[d & 255];
1564
+ var S = [];
1565
+ for (y = 1; y != 16; ++y)
1566
+ S[y - 1] = typeof Int32Array < "u" ? b.subarray(y * 256, y * 256 + 256) : b.slice(y * 256, y * 256 + 256);
1567
+ return S;
1568
+ }
1569
+ var r = s(n), a = r[0], l = r[1], o = r[2], f = r[3], g = r[4], c = r[5], u = r[6], m = r[7], p = r[8], x = r[9], v = r[10], P = r[11], O = r[12], T = r[13], L = r[14];
1570
+ function R(h, N) {
1571
+ for (var d = N ^ -1, y = 0, b = h.length; y < b; )
1572
+ d = d >>> 8 ^ n[(d ^ h.charCodeAt(y++)) & 255];
1573
+ return ~d;
1574
+ }
1575
+ function $(h, N) {
1576
+ for (var d = N ^ -1, y = h.length - 15, b = 0; b < y; )
1577
+ d = L[h[b++] ^ d & 255] ^ T[h[b++] ^ d >> 8 & 255] ^ O[h[b++] ^ d >> 16 & 255] ^ P[h[b++] ^ d >>> 24] ^ v[h[b++]] ^ x[h[b++]] ^ p[h[b++]] ^ m[h[b++]] ^ u[h[b++]] ^ c[h[b++]] ^ g[h[b++]] ^ f[h[b++]] ^ o[h[b++]] ^ l[h[b++]] ^ a[h[b++]] ^ n[h[b++]];
1578
+ for (y += 15; b < y; )
1579
+ d = d >>> 8 ^ n[(d ^ h[b++]) & 255];
1580
+ return ~d;
1581
+ }
1582
+ function w(h, N) {
1583
+ for (var d = N ^ -1, y = 0, b = h.length, S = 0, j = 0; y < b; )
1584
+ S = h.charCodeAt(y++), S < 128 ? d = d >>> 8 ^ n[(d ^ S) & 255] : S < 2048 ? (d = d >>> 8 ^ n[(d ^ (192 | S >> 6 & 31)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S & 63)) & 255]) : S >= 55296 && S < 57344 ? (S = (S & 1023) + 64, j = h.charCodeAt(y++) & 1023, d = d >>> 8 ^ n[(d ^ (240 | S >> 8 & 7)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S >> 2 & 63)) & 255], d = d >>> 8 ^ n[(d ^ (128 | j >> 6 & 15 | (S & 3) << 4)) & 255], d = d >>> 8 ^ n[(d ^ (128 | j & 63)) & 255]) : (d = d >>> 8 ^ n[(d ^ (224 | S >> 12 & 15)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S >> 6 & 63)) & 255], d = d >>> 8 ^ n[(d ^ (128 | S & 63)) & 255]);
1585
+ return ~d;
1586
+ }
1587
+ e.table = n, e.bstr = R, e.buf = $, e.str = w;
1588
+ });
1589
+ })(Fe);
1590
+ export {
1591
+ Fe as c,
1592
+ C as i
1593
+ };