@prosopo/cli 3.6.73 → 3.6.75

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.
Files changed (59) hide show
  1. package/.turbo/turbo-build$colon$cjs.log +37 -27
  2. package/.turbo/turbo-build$colon$tsc.log +27 -27
  3. package/.turbo/turbo-build.log +30 -27
  4. package/CHANGELOG.md +32 -0
  5. package/dist/RateLimiter.js +118 -118
  6. package/dist/_virtual/_rolldown/runtime.js +3 -0
  7. package/dist/argv.js +37 -36
  8. package/dist/bundle/decodeBehavior-BnJdECMR.js +233 -0
  9. package/dist/bundle/decodeSimd-hDznYwxo.js +218 -0
  10. package/dist/bundle/i18nBackend-C078WszN.js +3553 -0
  11. package/dist/bundle/i18nFrontend-pIqw8hl9.js +850 -0
  12. package/dist/bundle/i18next-q3w8LsnI.js +1213 -0
  13. package/dist/bundle/node-ponyfill-BXKwLYwg.js +1534 -0
  14. package/dist/bundle/provider.cli.bundle.js +102274 -131288
  15. package/dist/bundle/src-DhRyWllF.js +1880 -0
  16. package/dist/cjs/RateLimiter.cjs +118 -118
  17. package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
  18. package/dist/cjs/argv.cjs +41 -38
  19. package/dist/cjs/cli.cjs +32 -43
  20. package/dist/cjs/commands/ensureExternalIndexes.cjs +26 -27
  21. package/dist/cjs/commands/ensureIndexes.cjs +24 -25
  22. package/dist/cjs/commands/index.cjs +18 -20
  23. package/dist/cjs/commands/migrateAbuserScoreThreshold.cjs +54 -65
  24. package/dist/cjs/commands/providerSetDataset.cjs +45 -59
  25. package/dist/cjs/commands/siteKeyRegister.cjs +93 -105
  26. package/dist/cjs/commands/siteKeyRegisterApi.cjs +84 -102
  27. package/dist/cjs/commands/storeCaptchasExternally.cjs +24 -24
  28. package/dist/cjs/commands/updateSpamEmailDomains.cjs +42 -49
  29. package/dist/cjs/commands/validators.cjs +18 -37
  30. package/dist/cjs/commands/version.cjs +14 -15
  31. package/dist/cjs/files.cjs +32 -30
  32. package/dist/cjs/index.cjs +15 -17
  33. package/dist/cjs/process.env.cjs +14 -25
  34. package/dist/cjs/prosopo.config.cjs +108 -132
  35. package/dist/cjs/reloader.cjs +54 -63
  36. package/dist/cjs/start.cjs +59 -81
  37. package/dist/cli.js +27 -37
  38. package/dist/commands/ensureExternalIndexes.js +24 -26
  39. package/dist/commands/ensureIndexes.js +22 -24
  40. package/dist/commands/index.js +10 -20
  41. package/dist/commands/migrateAbuserScoreThreshold.js +52 -64
  42. package/dist/commands/providerSetDataset.js +41 -41
  43. package/dist/commands/siteKeyRegister.js +90 -103
  44. package/dist/commands/siteKeyRegisterApi.js +82 -101
  45. package/dist/commands/storeCaptchasExternally.js +22 -23
  46. package/dist/commands/updateSpamEmailDomains.js +40 -48
  47. package/dist/commands/validators.js +15 -37
  48. package/dist/commands/version.js +13 -15
  49. package/dist/files.js +28 -30
  50. package/dist/index.js +5 -16
  51. package/dist/process.env.js +14 -28
  52. package/dist/prosopo.config.js +108 -131
  53. package/dist/reloader.js +49 -61
  54. package/dist/start.js +57 -79
  55. package/package.json +16 -16
  56. package/dist/bundle/decodeBehavior-Btp_pZCR.js +0 -224
  57. package/dist/bundle/decodeSimd-Cz4sdHHN.js +0 -212
  58. package/dist/bundle/i18nBackend-BiuZSvrn.js +0 -5366
  59. package/dist/bundle/index-DUVLsNmB.js +0 -2371
@@ -0,0 +1,1213 @@
1
+ import { n as e, t } from "./provider.cli.bundle.js";
2
+ //#region ../locale/dist/i18SharedOptions.js
3
+ var n = {
4
+ debug: (typeof process < "u" ? process.env?.PROSOPO_LOG_LEVEL : void 0) === "debug",
5
+ fallbackLng: t.enum.en,
6
+ namespace: "translation",
7
+ supportedLngs: Object.values(e),
8
+ nonExplicitSupportedLngs: !1
9
+ }, r = (e) => typeof e == "string", i = () => {
10
+ let e, t, n = new Promise((n, r) => {
11
+ e = n, t = r;
12
+ });
13
+ return n.resolve = e, n.reject = t, n;
14
+ }, a = (e) => e == null ? "" : "" + e, o = (e, t, n) => {
15
+ e.forEach((e) => {
16
+ t[e] && (n[e] = t[e]);
17
+ });
18
+ }, s = /###/g, c = (e) => e && e.indexOf("###") > -1 ? e.replace(s, ".") : e, l = (e) => !e || r(e), u = (e, t, n) => {
19
+ let i = r(t) ? t.split(".") : t, a = 0;
20
+ for (; a < i.length - 1;) {
21
+ if (l(e)) return {};
22
+ let t = c(i[a]);
23
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++a;
24
+ }
25
+ return l(e) ? {} : {
26
+ obj: e,
27
+ k: c(i[a])
28
+ };
29
+ }, d = (e, t, n) => {
30
+ let { obj: r, k: i } = u(e, t, Object);
31
+ if (r !== void 0 || t.length === 1) {
32
+ r[i] = n;
33
+ return;
34
+ }
35
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = u(e, o, Object);
36
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = u(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
37
+ s.obj[`${s.k}.${a}`] = n;
38
+ }, f = (e, t, n, r) => {
39
+ let { obj: i, k: a } = u(e, t, Object);
40
+ i[a] = i[a] || [], i[a].push(n);
41
+ }, p = (e, t) => {
42
+ let { obj: n, k: r } = u(e, t);
43
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
44
+ }, m = (e, t, n) => {
45
+ let r = p(e, n);
46
+ return r === void 0 ? p(t, n) : r;
47
+ }, h = (e, t, n) => {
48
+ for (let i in t) i !== "__proto__" && i !== "constructor" && (i in e ? r(e[i]) || e[i] instanceof String || r(t[i]) || t[i] instanceof String ? n && (e[i] = t[i]) : h(e[i], t[i], n) : e[i] = t[i]);
49
+ return e;
50
+ }, g = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), _ = {
51
+ "&": "&amp;",
52
+ "<": "&lt;",
53
+ ">": "&gt;",
54
+ "\"": "&quot;",
55
+ "'": "&#39;",
56
+ "/": "&#x2F;"
57
+ }, v = (e) => r(e) ? e.replace(/[&<>"'\/]/g, (e) => _[e]) : e, y = class {
58
+ constructor(e) {
59
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
60
+ }
61
+ getRegExp(e) {
62
+ let t = this.regExpMap.get(e);
63
+ if (t !== void 0) return t;
64
+ let n = new RegExp(e);
65
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
66
+ }
67
+ }, b = [
68
+ " ",
69
+ ",",
70
+ "?",
71
+ "!",
72
+ ";"
73
+ ], x = new y(20), S = (e, t, n) => {
74
+ t ||= "", n ||= "";
75
+ let r = b.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
76
+ if (r.length === 0) return !0;
77
+ let i = x.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
78
+ if (!a) {
79
+ let t = e.indexOf(n);
80
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
81
+ }
82
+ return a;
83
+ }, C = function(e, t) {
84
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
85
+ if (!e) return;
86
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
87
+ let r = t.split(n), i = e;
88
+ for (let e = 0; e < r.length;) {
89
+ if (!i || typeof i != "object") return;
90
+ let t, a = "";
91
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
92
+ if ([
93
+ "string",
94
+ "number",
95
+ "boolean"
96
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
97
+ e += o - e + 1;
98
+ break;
99
+ }
100
+ i = t;
101
+ }
102
+ return i;
103
+ }, w = (e) => e?.replace("_", "-"), T = {
104
+ type: "logger",
105
+ log(e) {
106
+ this.output("log", e);
107
+ },
108
+ warn(e) {
109
+ this.output("warn", e);
110
+ },
111
+ error(e) {
112
+ this.output("error", e);
113
+ },
114
+ output(e, t) {
115
+ console?.[e]?.apply?.(console, t);
116
+ }
117
+ }, E = new class e {
118
+ constructor(e) {
119
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
120
+ this.init(e, t);
121
+ }
122
+ init(e) {
123
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
124
+ this.prefix = t.prefix || "i18next:", this.logger = e || T, this.options = t, this.debug = t.debug;
125
+ }
126
+ log() {
127
+ var e = [...arguments];
128
+ return this.forward(e, "log", "", !0);
129
+ }
130
+ warn() {
131
+ var e = [...arguments];
132
+ return this.forward(e, "warn", "", !0);
133
+ }
134
+ error() {
135
+ var e = [...arguments];
136
+ return this.forward(e, "error", "");
137
+ }
138
+ deprecate() {
139
+ var e = [...arguments];
140
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
141
+ }
142
+ forward(e, t, n, i) {
143
+ return i && !this.debug ? null : (r(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
144
+ }
145
+ create(t) {
146
+ return new e(this.logger, {
147
+ prefix: `${this.prefix}:${t}:`,
148
+ ...this.options
149
+ });
150
+ }
151
+ clone(t) {
152
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
153
+ }
154
+ }(), D = class {
155
+ constructor() {
156
+ this.observers = {};
157
+ }
158
+ on(e, t) {
159
+ return e.split(" ").forEach((e) => {
160
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
161
+ let n = this.observers[e].get(t) || 0;
162
+ this.observers[e].set(t, n + 1);
163
+ }), this;
164
+ }
165
+ off(e, t) {
166
+ if (this.observers[e]) {
167
+ if (!t) {
168
+ delete this.observers[e];
169
+ return;
170
+ }
171
+ this.observers[e].delete(t);
172
+ }
173
+ }
174
+ emit(e) {
175
+ var t = [...arguments].slice(1);
176
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach((e) => {
177
+ let [n, r] = e;
178
+ for (let e = 0; e < r; e++) n(...t);
179
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((n) => {
180
+ let [r, i] = n;
181
+ for (let n = 0; n < i; n++) r.apply(r, [e, ...t]);
182
+ });
183
+ }
184
+ }, O = class extends D {
185
+ constructor(e) {
186
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
187
+ ns: ["translation"],
188
+ defaultNS: "translation"
189
+ };
190
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
191
+ }
192
+ addNamespaces(e) {
193
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
194
+ }
195
+ removeNamespaces(e) {
196
+ let t = this.options.ns.indexOf(e);
197
+ t > -1 && this.options.ns.splice(t, 1);
198
+ }
199
+ getResource(e, t, n) {
200
+ let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = i.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : i.ignoreJSONStructure, s;
201
+ e.indexOf(".") > -1 ? s = e.split(".") : (s = [e, t], n && (Array.isArray(n) ? s.push(...n) : r(n) && a ? s.push(...n.split(a)) : s.push(n)));
202
+ let c = p(this.data, s);
203
+ return !c && !t && !n && e.indexOf(".") > -1 && (e = s[0], t = s[1], n = s.slice(2).join(".")), c || !o || !r(n) ? c : C(this.data?.[e]?.[t], n, a);
204
+ }
205
+ addResource(e, t, n, r) {
206
+ let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : { silent: !1 }, a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
207
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), d(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
208
+ }
209
+ addResources(e, t, n) {
210
+ let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : { silent: !1 };
211
+ for (let i in n) (r(n[i]) || Array.isArray(n[i])) && this.addResource(e, t, i, n[i], { silent: !0 });
212
+ i.silent || this.emit("added", e, t, n);
213
+ }
214
+ addResourceBundle(e, t, n, r, i) {
215
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
216
+ silent: !1,
217
+ skipCopy: !1
218
+ }, o = [e, t];
219
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
220
+ let s = p(this.data, o) || {};
221
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? h(s, n, i) : s = {
222
+ ...s,
223
+ ...n
224
+ }, d(this.data, o, s), a.silent || this.emit("added", e, t, n);
225
+ }
226
+ removeResourceBundle(e, t) {
227
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
228
+ }
229
+ hasResourceBundle(e, t) {
230
+ return this.getResource(e, t) !== void 0;
231
+ }
232
+ getResourceBundle(e, t) {
233
+ return t ||= this.options.defaultNS, this.getResource(e, t);
234
+ }
235
+ getDataByLanguage(e) {
236
+ return this.data[e];
237
+ }
238
+ hasLanguageSomeTranslations(e) {
239
+ let t = this.getDataByLanguage(e);
240
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
241
+ }
242
+ toJSON() {
243
+ return this.data;
244
+ }
245
+ }, k = {
246
+ processors: {},
247
+ addPostProcessor(e) {
248
+ this.processors[e.name] = e;
249
+ },
250
+ handle(e, t, n, r, i) {
251
+ return e.forEach((e) => {
252
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
253
+ }), t;
254
+ }
255
+ }, A = {}, j = (e) => !r(e) && typeof e != "boolean" && typeof e != "number", M = class e extends D {
256
+ constructor(e) {
257
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
258
+ super(), o([
259
+ "resourceStore",
260
+ "languageUtils",
261
+ "pluralResolver",
262
+ "interpolator",
263
+ "backendConnector",
264
+ "i18nFormat",
265
+ "utils"
266
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = E.create("translator");
267
+ }
268
+ changeLanguage(e) {
269
+ e && (this.language = e);
270
+ }
271
+ exists(e) {
272
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { interpolation: {} };
273
+ return e != null && this.resolve(e, t)?.res !== void 0;
274
+ }
275
+ extractFromKey(e, t) {
276
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
277
+ n === void 0 && (n = ":");
278
+ let i = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, a = t.ns || this.options.defaultNS || [], o = n && e.indexOf(n) > -1, s = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !S(e, n, i);
279
+ if (o && !s) {
280
+ let t = e.match(this.interpolator.nestingRegexp);
281
+ if (t && t.length > 0) return {
282
+ key: e,
283
+ namespaces: r(a) ? [a] : a
284
+ };
285
+ let o = e.split(n);
286
+ (n !== i || n === i && this.options.ns.indexOf(o[0]) > -1) && (a = o.shift()), e = o.join(i);
287
+ }
288
+ return {
289
+ key: e,
290
+ namespaces: r(a) ? [a] : a
291
+ };
292
+ }
293
+ translate(t, n, i) {
294
+ if (typeof n != "object" && this.options.overloadTranslationOptionHandler && (n = this.options.overloadTranslationOptionHandler(arguments)), typeof n == "object" && (n = { ...n }), n ||= {}, t == null) return "";
295
+ Array.isArray(t) || (t = [String(t)]);
296
+ let a = n.returnDetails === void 0 ? this.options.returnDetails : n.returnDetails, o = n.keySeparator === void 0 ? this.options.keySeparator : n.keySeparator, { key: s, namespaces: c } = this.extractFromKey(t[t.length - 1], n), l = c[c.length - 1], u = n.lng || this.language, d = n.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
297
+ if (u?.toLowerCase() === "cimode") {
298
+ if (d) {
299
+ let e = n.nsSeparator || this.options.nsSeparator;
300
+ return a ? {
301
+ res: `${l}${e}${s}`,
302
+ usedKey: s,
303
+ exactUsedKey: s,
304
+ usedLng: u,
305
+ usedNS: l,
306
+ usedParams: this.getUsedParamsDetails(n)
307
+ } : `${l}${e}${s}`;
308
+ }
309
+ return a ? {
310
+ res: s,
311
+ usedKey: s,
312
+ exactUsedKey: s,
313
+ usedLng: u,
314
+ usedNS: l,
315
+ usedParams: this.getUsedParamsDetails(n)
316
+ } : s;
317
+ }
318
+ let f = this.resolve(t, n), p = f?.res, m = f?.usedKey || s, h = f?.exactUsedKey || s, g = [
319
+ "[object Number]",
320
+ "[object Function]",
321
+ "[object RegExp]"
322
+ ], _ = n.joinArrays === void 0 ? this.options.joinArrays : n.joinArrays, v = !this.i18nFormat || this.i18nFormat.handleAsObject, y = n.count !== void 0 && !r(n.count), b = e.hasDefaultValue(n), x = y ? this.pluralResolver.getSuffix(u, n.count, n) : "", S = n.ordinal && y ? this.pluralResolver.getSuffix(u, n.count, { ordinal: !1 }) : "", C = y && !n.ordinal && n.count === 0, w = C && n[`defaultValue${this.options.pluralSeparator}zero`] || n[`defaultValue${x}`] || n[`defaultValue${S}`] || n.defaultValue, T = p;
323
+ v && !p && b && (T = w);
324
+ let E = j(T), D = Object.prototype.toString.apply(T);
325
+ if (v && T && E && g.indexOf(D) < 0 && !(r(_) && Array.isArray(T))) {
326
+ if (!n.returnObjects && !this.options.returnObjects) {
327
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
328
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, T, {
329
+ ...n,
330
+ ns: c
331
+ }) : `key '${s} (${this.language})' returned an object instead of string.`;
332
+ return a ? (f.res = e, f.usedParams = this.getUsedParamsDetails(n), f) : e;
333
+ }
334
+ if (o) {
335
+ let e = Array.isArray(T), t = e ? [] : {}, r = e ? h : m;
336
+ for (let e in T) if (Object.prototype.hasOwnProperty.call(T, e)) {
337
+ let i = `${r}${o}${e}`;
338
+ b && !p ? t[e] = this.translate(i, {
339
+ ...n,
340
+ defaultValue: j(w) ? w[e] : void 0,
341
+ joinArrays: !1,
342
+ ns: c
343
+ }) : t[e] = this.translate(i, {
344
+ ...n,
345
+ joinArrays: !1,
346
+ ns: c
347
+ }), t[e] === i && (t[e] = T[e]);
348
+ }
349
+ p = t;
350
+ }
351
+ } else if (v && r(_) && Array.isArray(p)) p = p.join(_), p &&= this.extendTranslation(p, t, n, i);
352
+ else {
353
+ let e = !1, r = !1;
354
+ !this.isValidLookup(p) && b && (e = !0, p = w), this.isValidLookup(p) || (r = !0, p = s);
355
+ let a = (n.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && r ? void 0 : p, c = b && w !== p && this.options.updateMissing;
356
+ if (r || e || c) {
357
+ if (this.logger.log(c ? "updateKey" : "missingKey", u, l, s, c ? w : p), o) {
358
+ let e = this.resolve(s, {
359
+ ...n,
360
+ keySeparator: !1
361
+ });
362
+ e && e.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.");
363
+ }
364
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, n.lng || this.language);
365
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
366
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(n.lng || this.language) : e.push(n.lng || this.language);
367
+ let r = (e, t, r) => {
368
+ let i = b && r !== p ? r : a;
369
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, l, t, i, c, n) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, l, t, i, c, n), this.emit("missingKey", e, l, t, p);
370
+ };
371
+ this.options.saveMissing && (this.options.saveMissingPlurals && y ? e.forEach((e) => {
372
+ let t = this.pluralResolver.getSuffixes(e, n);
373
+ C && n[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
374
+ r([e], s + t, n[`defaultValue${t}`] || w);
375
+ });
376
+ }) : r(e, s, w));
377
+ }
378
+ p = this.extendTranslation(p, t, n, f, i), r && p === s && this.options.appendNamespaceToMissingKey && (p = `${l}:${s}`), (r || e) && this.options.parseMissingKeyHandler && (p = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}:${s}` : s, e ? p : void 0));
379
+ }
380
+ return a ? (f.res = p, f.usedParams = this.getUsedParamsDetails(n), f) : p;
381
+ }
382
+ extendTranslation(e, t, n, i, a) {
383
+ var o = this;
384
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
385
+ ...this.options.interpolation.defaultVariables,
386
+ ...n
387
+ }, n.lng || this.language || i.usedLng, i.usedNS, i.usedKey, { resolved: i });
388
+ else if (!n.skipInterpolation) {
389
+ n.interpolation && this.interpolator.init({
390
+ ...n,
391
+ interpolation: {
392
+ ...this.options.interpolation,
393
+ ...n.interpolation
394
+ }
395
+ });
396
+ let s = r(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), c;
397
+ if (s) {
398
+ let t = e.match(this.interpolator.nestingRegexp);
399
+ c = t && t.length;
400
+ }
401
+ let l = n.replace && !r(n.replace) ? n.replace : n;
402
+ if (this.options.interpolation.defaultVariables && (l = {
403
+ ...this.options.interpolation.defaultVariables,
404
+ ...l
405
+ }), e = this.interpolator.interpolate(e, l, n.lng || this.language || i.usedLng, n), s) {
406
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
407
+ c < r && (n.nest = !1);
408
+ }
409
+ !n.lng && i && i.res && (n.lng = this.language || i.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, function() {
410
+ var e = [...arguments];
411
+ return a?.[0] === e[0] && !n.context ? (o.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : o.translate(...e, t);
412
+ }, n)), n.interpolation && this.interpolator.reset();
413
+ }
414
+ let s = n.postProcess || this.options.postProcess, c = r(s) ? [s] : s;
415
+ return e != null && c?.length && n.applyPostProcessor !== !1 && (e = k.handle(c, e, t, this.options && this.options.postProcessPassResolved ? {
416
+ i18nResolved: {
417
+ ...i,
418
+ usedParams: this.getUsedParamsDetails(n)
419
+ },
420
+ ...n
421
+ } : n, this)), e;
422
+ }
423
+ resolve(e) {
424
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n, i, a, o, s;
425
+ return r(e) && (e = [e]), e.forEach((e) => {
426
+ if (this.isValidLookup(n)) return;
427
+ let c = this.extractFromKey(e, t), l = c.key;
428
+ i = l;
429
+ let u = c.namespaces;
430
+ this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
431
+ let d = t.count !== void 0 && !r(t.count), f = d && !t.ordinal && t.count === 0, p = t.context !== void 0 && (r(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
432
+ u.forEach((e) => {
433
+ this.isValidLookup(n) || (s = e, !A[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(s) && (A[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" 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!!!")), m.forEach((r) => {
434
+ if (this.isValidLookup(n)) return;
435
+ o = r;
436
+ let i = [l];
437
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(i, l, r, e, t);
438
+ else {
439
+ let e;
440
+ d && (e = this.pluralResolver.getSuffix(r, t.count, t));
441
+ let n = `${this.options.pluralSeparator}zero`, a = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
442
+ if (d && (i.push(l + e), t.ordinal && e.indexOf(a) === 0 && i.push(l + e.replace(a, this.options.pluralSeparator)), f && i.push(l + n)), p) {
443
+ let r = `${l}${this.options.contextSeparator}${t.context}`;
444
+ i.push(r), d && (i.push(r + e), t.ordinal && e.indexOf(a) === 0 && i.push(r + e.replace(a, this.options.pluralSeparator)), f && i.push(r + n));
445
+ }
446
+ }
447
+ let s;
448
+ for (; s = i.pop();) this.isValidLookup(n) || (a = s, n = this.getResource(r, e, s, t));
449
+ }));
450
+ });
451
+ }), {
452
+ res: n,
453
+ usedKey: i,
454
+ exactUsedKey: a,
455
+ usedLng: o,
456
+ usedNS: s
457
+ };
458
+ }
459
+ isValidLookup(e) {
460
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
461
+ }
462
+ getResource(e, t, n) {
463
+ let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
464
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
465
+ }
466
+ getUsedParamsDetails() {
467
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = [
468
+ "defaultValue",
469
+ "ordinal",
470
+ "context",
471
+ "replace",
472
+ "lng",
473
+ "lngs",
474
+ "fallbackLng",
475
+ "ns",
476
+ "keySeparator",
477
+ "nsSeparator",
478
+ "returnObjects",
479
+ "returnDetails",
480
+ "joinArrays",
481
+ "postProcess",
482
+ "interpolation"
483
+ ], n = e.replace && !r(e.replace), i = n ? e.replace : e;
484
+ if (n && e.count !== void 0 && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
485
+ ...this.options.interpolation.defaultVariables,
486
+ ...i
487
+ }), !n) {
488
+ i = { ...i };
489
+ for (let e of t) delete i[e];
490
+ }
491
+ return i;
492
+ }
493
+ static hasDefaultValue(e) {
494
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
495
+ return !1;
496
+ }
497
+ }, N = class {
498
+ constructor(e) {
499
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = E.create("languageUtils");
500
+ }
501
+ getScriptPartFromCode(e) {
502
+ if (e = w(e), !e || e.indexOf("-") < 0) return null;
503
+ let t = e.split("-");
504
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
505
+ }
506
+ getLanguagePartFromCode(e) {
507
+ if (e = w(e), !e || e.indexOf("-") < 0) return e;
508
+ let t = e.split("-");
509
+ return this.formatLanguageCode(t[0]);
510
+ }
511
+ formatLanguageCode(e) {
512
+ if (r(e) && e.indexOf("-") > -1) {
513
+ let t;
514
+ try {
515
+ t = Intl.getCanonicalLocales(e)[0];
516
+ } catch {}
517
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
518
+ }
519
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
520
+ }
521
+ isSupportedCode(e) {
522
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
523
+ }
524
+ getBestMatchFromCodes(e) {
525
+ if (!e) return null;
526
+ let t;
527
+ return e.forEach((e) => {
528
+ if (t) return;
529
+ let n = this.formatLanguageCode(e);
530
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
531
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
532
+ if (t) return;
533
+ let n = this.getLanguagePartFromCode(e);
534
+ if (this.isSupportedCode(n)) return t = n;
535
+ t = this.options.supportedLngs.find((e) => {
536
+ if (e === n || !(e.indexOf("-") < 0 && n.indexOf("-") < 0) && (e.indexOf("-") > 0 && n.indexOf("-") < 0 && e.substring(0, e.indexOf("-")) === n || e.indexOf(n) === 0 && n.length > 1)) return e;
537
+ });
538
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
539
+ }
540
+ getFallbackCodes(e, t) {
541
+ if (!e) return [];
542
+ if (typeof e == "function" && (e = e(t)), r(e) && (e = [e]), Array.isArray(e)) return e;
543
+ if (!t) return e.default || [];
544
+ let n = e[t];
545
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
546
+ }
547
+ toResolveHierarchy(e, t) {
548
+ let n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], a = (e) => {
549
+ e && (this.isSupportedCode(e) ? i.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
550
+ };
551
+ return r(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : r(e) && a(this.formatLanguageCode(e)), n.forEach((e) => {
552
+ i.indexOf(e) < 0 && a(this.formatLanguageCode(e));
553
+ }), i;
554
+ }
555
+ }, P = {
556
+ zero: 0,
557
+ one: 1,
558
+ two: 2,
559
+ few: 3,
560
+ many: 4,
561
+ other: 5
562
+ }, F = {
563
+ select: (e) => e === 1 ? "one" : "other",
564
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
565
+ }, I = class {
566
+ constructor(e) {
567
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
568
+ this.languageUtils = e, this.options = t, this.logger = E.create("pluralResolver"), this.pluralRulesCache = {};
569
+ }
570
+ addRule(e, t) {
571
+ this.rules[e] = t;
572
+ }
573
+ clearCache() {
574
+ this.pluralRulesCache = {};
575
+ }
576
+ getRule(e) {
577
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = w(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
578
+ cleanedCode: n,
579
+ type: r
580
+ });
581
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
582
+ let a;
583
+ try {
584
+ a = new Intl.PluralRules(n, { type: r });
585
+ } catch {
586
+ if (!Intl) return this.logger.error("No Intl support, please use an Intl polyfill!"), F;
587
+ if (!e.match(/-|_/)) return F;
588
+ let n = this.languageUtils.getLanguagePartFromCode(e);
589
+ a = this.getRule(n, t);
590
+ }
591
+ return this.pluralRulesCache[i] = a, a;
592
+ }
593
+ needsPlural(e) {
594
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
595
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
596
+ }
597
+ getPluralFormsOfKey(e, t) {
598
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
599
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
600
+ }
601
+ getSuffixes(e) {
602
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
603
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => P[e] - P[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
604
+ }
605
+ getSuffix(e, t) {
606
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = this.getRule(e, n);
607
+ return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
608
+ }
609
+ }, L = function(e, t, n) {
610
+ let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o = m(e, t, n);
611
+ return !o && a && r(n) && (o = C(e, n, i), o === void 0 && (o = C(t, n, i))), o;
612
+ }, R = (e) => e.replace(/\$/g, "$$$$"), z = class {
613
+ constructor() {
614
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
615
+ this.logger = E.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
616
+ }
617
+ init() {
618
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
619
+ e.interpolation ||= { escapeValue: !0 };
620
+ let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: _, alwaysFormat: y } = e.interpolation;
621
+ this.escape = t === void 0 ? v : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? g(i) : a || "{{", this.suffix = o ? g(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? g(d) : f || g("$t("), this.nestingSuffix = p ? g(p) : m || g(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = _ || 1e3, this.alwaysFormat = y !== void 0 && y, this.resetRegExp();
622
+ }
623
+ reset() {
624
+ this.options && this.init(this.options);
625
+ }
626
+ resetRegExp() {
627
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
628
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
629
+ }
630
+ interpolate(e, t, n, i) {
631
+ let o, s, c, l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (e) => {
632
+ if (e.indexOf(this.formatSeparator) < 0) {
633
+ let r = L(t, l, e, this.options.keySeparator, this.options.ignoreJSONStructure);
634
+ return this.alwaysFormat ? this.format(r, void 0, n, {
635
+ ...i,
636
+ ...t,
637
+ interpolationkey: e
638
+ }) : r;
639
+ }
640
+ let r = e.split(this.formatSeparator), a = r.shift().trim(), o = r.join(this.formatSeparator).trim();
641
+ return this.format(L(t, l, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
642
+ ...i,
643
+ ...t,
644
+ interpolationkey: a
645
+ });
646
+ };
647
+ this.resetRegExp();
648
+ let d = i?.missingInterpolationHandler || this.options.missingInterpolationHandler, f = i?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : i.interpolation.skipOnVariables;
649
+ return [{
650
+ regex: this.regexpUnescape,
651
+ safeValue: (e) => R(e)
652
+ }, {
653
+ regex: this.regexp,
654
+ safeValue: (e) => this.escapeValue ? R(this.escape(e)) : R(e)
655
+ }].forEach((t) => {
656
+ for (c = 0; o = t.regex.exec(e);) {
657
+ let n = o[1].trim();
658
+ if (s = u(n), s === void 0) if (typeof d == "function") {
659
+ let t = d(e, o, i);
660
+ s = r(t) ? t : "";
661
+ } else if (i && Object.prototype.hasOwnProperty.call(i, n)) s = "";
662
+ else if (f) {
663
+ s = o[0];
664
+ continue;
665
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), s = "";
666
+ else !r(s) && !this.useRawValueToEscape && (s = a(s));
667
+ let l = t.safeValue(s);
668
+ if (e = e.replace(o[0], l), f ? (t.regex.lastIndex += s.length, t.regex.lastIndex -= o[0].length) : t.regex.lastIndex = 0, c++, c >= this.maxReplaces) break;
669
+ }
670
+ }), e;
671
+ }
672
+ nest(e, t) {
673
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, o, s, c = (e, t) => {
674
+ let n = this.nestingOptionsSeparator;
675
+ if (e.indexOf(n) < 0) return e;
676
+ let r = e.split(RegExp(`${n}[ ]*{`)), i = `{${r[1]}`;
677
+ e = r[0], i = this.interpolate(i, s);
678
+ let a = i.match(/'/g), o = i.match(/"/g);
679
+ ((a?.length ?? 0) % 2 == 0 && !o || o.length % 2 != 0) && (i = i.replace(/'/g, "\""));
680
+ try {
681
+ s = JSON.parse(i), t && (s = {
682
+ ...t,
683
+ ...s
684
+ });
685
+ } catch (t) {
686
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
687
+ }
688
+ return s.defaultValue && s.defaultValue.indexOf(this.prefix) > -1 && delete s.defaultValue, e;
689
+ };
690
+ for (; i = this.nestingRegexp.exec(e);) {
691
+ let l = [];
692
+ s = { ...n }, s = s.replace && !r(s.replace) ? s.replace : s, s.applyPostProcessor = !1, delete s.defaultValue;
693
+ let u = !1;
694
+ if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
695
+ let e = i[1].split(this.formatSeparator).map((e) => e.trim());
696
+ i[1] = e.shift(), l = e, u = !0;
697
+ }
698
+ if (o = t(c.call(this, i[1].trim(), s), s), o && i[0] === e && !r(o)) return o;
699
+ r(o) || (o = a(o)), o ||= (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), ""), u && (o = l.reduce((e, t) => this.format(e, t, n.lng, {
700
+ ...n,
701
+ interpolationkey: i[1].trim()
702
+ }), o.trim())), e = e.replace(i[0], o), this.regexp.lastIndex = 0;
703
+ }
704
+ return e;
705
+ }
706
+ }, B = (e) => {
707
+ let t = e.toLowerCase().trim(), n = {};
708
+ if (e.indexOf("(") > -1) {
709
+ let r = e.split("(");
710
+ t = r[0].toLowerCase().trim();
711
+ let i = r[1].substring(0, r[1].length - 1);
712
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
713
+ if (e) {
714
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
715
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
716
+ }
717
+ });
718
+ }
719
+ return {
720
+ formatName: t,
721
+ formatOptions: n
722
+ };
723
+ }, V = (e) => {
724
+ let t = {};
725
+ return (n, r, i) => {
726
+ let a = i;
727
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
728
+ ...a,
729
+ [i.interpolationkey]: void 0
730
+ });
731
+ let o = r + JSON.stringify(a), s = t[o];
732
+ return s || (s = e(w(r), i), t[o] = s), s(n);
733
+ };
734
+ }, H = class {
735
+ constructor() {
736
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
737
+ this.logger = E.create("formatter"), this.options = e, this.formats = {
738
+ number: V((e, t) => {
739
+ let n = new Intl.NumberFormat(e, { ...t });
740
+ return (e) => n.format(e);
741
+ }),
742
+ currency: V((e, t) => {
743
+ let n = new Intl.NumberFormat(e, {
744
+ ...t,
745
+ style: "currency"
746
+ });
747
+ return (e) => n.format(e);
748
+ }),
749
+ datetime: V((e, t) => {
750
+ let n = new Intl.DateTimeFormat(e, { ...t });
751
+ return (e) => n.format(e);
752
+ }),
753
+ relativetime: V((e, t) => {
754
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
755
+ return (e) => n.format(e, t.range || "day");
756
+ }),
757
+ list: V((e, t) => {
758
+ let n = new Intl.ListFormat(e, { ...t });
759
+ return (e) => n.format(e);
760
+ })
761
+ }, this.init(e);
762
+ }
763
+ init(e) {
764
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { interpolation: {} };
765
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
766
+ }
767
+ add(e, t) {
768
+ this.formats[e.toLowerCase().trim()] = t;
769
+ }
770
+ addCached(e, t) {
771
+ this.formats[e.toLowerCase().trim()] = V(t);
772
+ }
773
+ format(e, t, n) {
774
+ let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, i = t.split(this.formatSeparator);
775
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
776
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
777
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
778
+ }
779
+ return i.reduce((e, t) => {
780
+ let { formatName: i, formatOptions: a } = B(t);
781
+ if (this.formats[i]) {
782
+ let t = e;
783
+ try {
784
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
785
+ t = this.formats[i](e, s, {
786
+ ...a,
787
+ ...r,
788
+ ...o
789
+ });
790
+ } catch (e) {
791
+ this.logger.warn(e);
792
+ }
793
+ return t;
794
+ } else this.logger.warn(`there was no format function for ${i}`);
795
+ return e;
796
+ }, e);
797
+ }
798
+ }, U = (e, t) => {
799
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
800
+ }, W = class extends D {
801
+ constructor(e, t, n) {
802
+ let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
803
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = E.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
804
+ }
805
+ queueLoad(e, t, n, r) {
806
+ let i = {}, a = {}, o = {}, s = {};
807
+ return e.forEach((e) => {
808
+ let r = !0;
809
+ t.forEach((t) => {
810
+ let o = `${e}|${t}`;
811
+ !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
812
+ }), r || (o[e] = !0);
813
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
814
+ pending: a,
815
+ pendingCount: Object.keys(a).length,
816
+ loaded: {},
817
+ errors: [],
818
+ callback: r
819
+ }), {
820
+ toLoad: Object.keys(i),
821
+ pending: Object.keys(a),
822
+ toLoadLanguages: Object.keys(o),
823
+ toLoadNamespaces: Object.keys(s)
824
+ };
825
+ }
826
+ loaded(e, t, n) {
827
+ let r = e.split("|"), i = r[0], a = r[1];
828
+ t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
829
+ let o = {};
830
+ this.queue.forEach((n) => {
831
+ f(n.loaded, [i], a), U(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
832
+ o[e] || (o[e] = {});
833
+ let t = n.loaded[e];
834
+ t.length && t.forEach((t) => {
835
+ o[e][t] === void 0 && (o[e][t] = !0);
836
+ });
837
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
838
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
839
+ }
840
+ read(e, t, n) {
841
+ let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
842
+ if (!e.length) return a(null, {});
843
+ if (this.readingCalls >= this.maxParallelReads) {
844
+ this.waitingReads.push({
845
+ lng: e,
846
+ ns: t,
847
+ fcName: n,
848
+ tried: r,
849
+ wait: i,
850
+ callback: a
851
+ });
852
+ return;
853
+ }
854
+ this.readingCalls++;
855
+ let o = (o, s) => {
856
+ if (this.readingCalls--, this.waitingReads.length > 0) {
857
+ let e = this.waitingReads.shift();
858
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
859
+ }
860
+ if (o && s && r < this.maxRetries) {
861
+ setTimeout(() => {
862
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
863
+ }, i);
864
+ return;
865
+ }
866
+ a(o, s);
867
+ }, s = this.backend[n].bind(this.backend);
868
+ if (s.length === 2) {
869
+ try {
870
+ let n = s(e, t);
871
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
872
+ } catch (e) {
873
+ o(e);
874
+ }
875
+ return;
876
+ }
877
+ return s(e, t, o);
878
+ }
879
+ prepareLoading(e, t) {
880
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
881
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
882
+ r(e) && (e = this.languageUtils.toResolveHierarchy(e)), r(t) && (t = [t]);
883
+ let a = this.queueLoad(e, t, n, i);
884
+ if (!a.toLoad.length) return a.pending.length || i(), null;
885
+ a.toLoad.forEach((e) => {
886
+ this.loadOne(e);
887
+ });
888
+ }
889
+ load(e, t, n) {
890
+ this.prepareLoading(e, t, {}, n);
891
+ }
892
+ reload(e, t, n) {
893
+ this.prepareLoading(e, t, { reload: !0 }, n);
894
+ }
895
+ loadOne(e) {
896
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", n = e.split("|"), r = n[0], i = n[1];
897
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
898
+ n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
899
+ });
900
+ }
901
+ saveMissing(e, t, n, r, i) {
902
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {};
903
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
904
+ 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!!!");
905
+ return;
906
+ }
907
+ if (!(n == null || n === "")) {
908
+ if (this.backend?.create) {
909
+ let s = {
910
+ ...a,
911
+ isUpdate: i
912
+ }, c = this.backend.create.bind(this.backend);
913
+ if (c.length < 6) try {
914
+ let i;
915
+ i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
916
+ } catch (e) {
917
+ o(e);
918
+ }
919
+ else c(e, t, n, r, o, s);
920
+ }
921
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
922
+ }
923
+ }
924
+ }, G = () => ({
925
+ debug: !1,
926
+ initAsync: !0,
927
+ ns: ["translation"],
928
+ defaultNS: ["translation"],
929
+ fallbackLng: ["dev"],
930
+ fallbackNS: !1,
931
+ supportedLngs: !1,
932
+ nonExplicitSupportedLngs: !1,
933
+ load: "all",
934
+ preload: !1,
935
+ simplifyPluralSuffix: !0,
936
+ keySeparator: ".",
937
+ nsSeparator: ":",
938
+ pluralSeparator: "_",
939
+ contextSeparator: "_",
940
+ partialBundledLanguages: !1,
941
+ saveMissing: !1,
942
+ updateMissing: !1,
943
+ saveMissingTo: "fallback",
944
+ saveMissingPlurals: !0,
945
+ missingKeyHandler: !1,
946
+ missingInterpolationHandler: !1,
947
+ postProcess: !1,
948
+ postProcessPassResolved: !1,
949
+ returnNull: !1,
950
+ returnEmptyString: !0,
951
+ returnObjects: !1,
952
+ joinArrays: !1,
953
+ returnedObjectHandler: !1,
954
+ parseMissingKeyHandler: !1,
955
+ appendNamespaceToMissingKey: !1,
956
+ appendNamespaceToCIMode: !1,
957
+ overloadTranslationOptionHandler: (e) => {
958
+ let t = {};
959
+ if (typeof e[1] == "object" && (t = e[1]), r(e[1]) && (t.defaultValue = e[1]), r(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
960
+ let n = e[3] || e[2];
961
+ Object.keys(n).forEach((e) => {
962
+ t[e] = n[e];
963
+ });
964
+ }
965
+ return t;
966
+ },
967
+ interpolation: {
968
+ escapeValue: !0,
969
+ format: (e) => e,
970
+ prefix: "{{",
971
+ suffix: "}}",
972
+ formatSeparator: ",",
973
+ unescapePrefix: "-",
974
+ nestingPrefix: "$t(",
975
+ nestingSuffix: ")",
976
+ nestingOptionsSeparator: ",",
977
+ maxReplaces: 1e3,
978
+ skipOnVariables: !0
979
+ }
980
+ }), K = (e) => (r(e.ns) && (e.ns = [e.ns]), r(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), r(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs?.indexOf?.("cimode") < 0 && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), typeof e.initImmediate == "boolean" && (e.initAsync = e.initImmediate), e), q = () => {}, J = (e) => {
981
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
982
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
983
+ });
984
+ }, Y = class e extends D {
985
+ constructor() {
986
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
987
+ if (super(), this.options = K(e), this.services = {}, this.logger = E, this.modules = { external: [] }, J(this), t && !this.isInitialized && !e.isClone) {
988
+ if (!this.options.initAsync) return this.init(e, t), this;
989
+ setTimeout(() => {
990
+ this.init(e, t);
991
+ }, 0);
992
+ }
993
+ }
994
+ init() {
995
+ var e = this;
996
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
997
+ this.isInitializing = !0, typeof t == "function" && (n = t, t = {}), t.defaultNS == null && t.ns && (r(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
998
+ let a = G();
999
+ this.options = {
1000
+ ...a,
1001
+ ...this.options,
1002
+ ...K(t)
1003
+ }, this.options.interpolation = {
1004
+ ...a.interpolation,
1005
+ ...this.options.interpolation
1006
+ }, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1007
+ let o = (e) => e ? typeof e == "function" ? new e() : e : null;
1008
+ if (!this.options.isClone) {
1009
+ this.modules.logger ? E.init(o(this.modules.logger), this.options) : E.init(null, this.options);
1010
+ let t;
1011
+ t = this.modules.formatter ? this.modules.formatter : H;
1012
+ let n = new N(this.options);
1013
+ this.store = new O(this.options.resources, this.options);
1014
+ let r = this.services;
1015
+ r.logger = E, r.resourceStore = this.store, r.languageUtils = n, r.pluralResolver = new I(n, {
1016
+ prepend: this.options.pluralSeparator,
1017
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1018
+ }), t && (!this.options.interpolation.format || this.options.interpolation.format === a.interpolation.format) && (r.formatter = o(t), r.formatter.init(r, this.options), this.options.interpolation.format = r.formatter.format.bind(r.formatter)), r.interpolator = new z(this.options), r.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, r.backendConnector = new W(o(this.modules.backend), r.resourceStore, r, this.options), r.backendConnector.on("*", function(t) {
1019
+ var n = [...arguments].slice(1);
1020
+ e.emit(t, ...n);
1021
+ }), this.modules.languageDetector && (r.languageDetector = o(this.modules.languageDetector), r.languageDetector.init && r.languageDetector.init(r, this.options.detection, this.options)), this.modules.i18nFormat && (r.i18nFormat = o(this.modules.i18nFormat), r.i18nFormat.init && r.i18nFormat.init(this)), this.translator = new M(this.services, this.options), this.translator.on("*", function(t) {
1022
+ var n = [...arguments].slice(1);
1023
+ e.emit(t, ...n);
1024
+ }), this.modules.external.forEach((e) => {
1025
+ e.init && e.init(this);
1026
+ });
1027
+ }
1028
+ if (this.format = this.options.interpolation.format, n ||= q, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1029
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1030
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1031
+ }
1032
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1033
+ "getResource",
1034
+ "hasResourceBundle",
1035
+ "getResourceBundle",
1036
+ "getDataByLanguage"
1037
+ ].forEach((t) => {
1038
+ this[t] = function() {
1039
+ return e.store[t](...arguments);
1040
+ };
1041
+ }), [
1042
+ "addResource",
1043
+ "addResources",
1044
+ "addResourceBundle",
1045
+ "removeResourceBundle"
1046
+ ].forEach((t) => {
1047
+ this[t] = function() {
1048
+ return e.store[t](...arguments), e;
1049
+ };
1050
+ });
1051
+ let s = i(), c = () => {
1052
+ let e = (e, t) => {
1053
+ this.isInitializing = !1, 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), s.resolve(t), n(e, t);
1054
+ };
1055
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1056
+ this.changeLanguage(this.options.lng, e);
1057
+ };
1058
+ return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), s;
1059
+ }
1060
+ loadResources(e) {
1061
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : q, n = r(e) ? e : this.language;
1062
+ if (typeof e == "function" && (t = e), !this.options.resources || this.options.partialBundledLanguages) {
1063
+ if (n?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return t();
1064
+ let e = [], r = (t) => {
1065
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1066
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1067
+ });
1068
+ };
1069
+ n ? r(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => r(e)), this.options.preload?.forEach?.((e) => r(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1070
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), t(e);
1071
+ });
1072
+ } else t(null);
1073
+ }
1074
+ reloadResources(e, t, n) {
1075
+ let r = i();
1076
+ return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= q, this.services.backendConnector.reload(e, t, (e) => {
1077
+ r.resolve(), n(e);
1078
+ }), r;
1079
+ }
1080
+ use(e) {
1081
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1082
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1083
+ 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" && k.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1084
+ }
1085
+ setResolvedLanguage(e) {
1086
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) for (let e = 0; e < this.languages.length; e++) {
1087
+ let t = this.languages[e];
1088
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1089
+ this.resolvedLanguage = t;
1090
+ break;
1091
+ }
1092
+ }
1093
+ }
1094
+ changeLanguage(e, t) {
1095
+ var n = this;
1096
+ this.isLanguageChangingTo = e;
1097
+ let a = i();
1098
+ this.emit("languageChanging", e);
1099
+ let o = (e) => {
1100
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1101
+ }, s = (e, r) => {
1102
+ r ? (o(r), this.translator.changeLanguage(r), this.isLanguageChangingTo = void 0, this.emit("languageChanged", r), this.logger.log("languageChanged", r)) : this.isLanguageChangingTo = void 0, a.resolve(function() {
1103
+ return n.t(...arguments);
1104
+ }), t && t(e, function() {
1105
+ return n.t(...arguments);
1106
+ });
1107
+ }, c = (t) => {
1108
+ !e && !t && this.services.languageDetector && (t = []);
1109
+ let n = r(t) ? t : this.services.languageUtils.getBestMatchFromCodes(t);
1110
+ n && (this.language || o(n), this.translator.language || this.translator.changeLanguage(n), this.services.languageDetector?.cacheUserLanguage?.(n)), this.loadResources(n, (e) => {
1111
+ s(e, n);
1112
+ });
1113
+ };
1114
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? c(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(c) : this.services.languageDetector.detect(c) : c(e), a;
1115
+ }
1116
+ getFixedT(e, t, n) {
1117
+ var i = this;
1118
+ let a = function(e, t) {
1119
+ let r;
1120
+ if (typeof t != "object") {
1121
+ var o = [...arguments].slice(2);
1122
+ r = i.options.overloadTranslationOptionHandler([e, t].concat(o));
1123
+ } else r = { ...t };
1124
+ r.lng = r.lng || a.lng, r.lngs = r.lngs || a.lngs, r.ns = r.ns || a.ns, r.keyPrefix !== "" && (r.keyPrefix = r.keyPrefix || n || a.keyPrefix);
1125
+ let s = i.options.keySeparator || ".", c;
1126
+ return c = r.keyPrefix && Array.isArray(e) ? e.map((e) => `${r.keyPrefix}${s}${e}`) : r.keyPrefix ? `${r.keyPrefix}${s}${e}` : e, i.t(c, r);
1127
+ };
1128
+ return r(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = n, a;
1129
+ }
1130
+ t() {
1131
+ var e = [...arguments];
1132
+ return this.translator?.translate(...e);
1133
+ }
1134
+ exists() {
1135
+ var e = [...arguments];
1136
+ return this.translator?.exists(...e);
1137
+ }
1138
+ setDefaultNamespace(e) {
1139
+ this.options.defaultNS = e;
1140
+ }
1141
+ hasLoadedNamespace(e) {
1142
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1143
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1144
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1145
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1146
+ if (n.toLowerCase() === "cimode") return !0;
1147
+ let a = (e, t) => {
1148
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1149
+ return n === -1 || n === 0 || n === 2;
1150
+ };
1151
+ if (t.precheck) {
1152
+ let e = t.precheck(this, a);
1153
+ if (e !== void 0) return e;
1154
+ }
1155
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1156
+ }
1157
+ loadNamespaces(e, t) {
1158
+ let n = i();
1159
+ return this.options.ns ? (r(e) && (e = [e]), e.forEach((e) => {
1160
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1161
+ }), this.loadResources((e) => {
1162
+ n.resolve(), t && t(e);
1163
+ }), n) : (t && t(), Promise.resolve());
1164
+ }
1165
+ loadLanguages(e, t) {
1166
+ let n = i();
1167
+ r(e) && (e = [e]);
1168
+ let a = this.options.preload || [], o = e.filter((e) => a.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1169
+ return o.length ? (this.options.preload = a.concat(o), this.loadResources((e) => {
1170
+ n.resolve(), t && t(e);
1171
+ }), n) : (t && t(), Promise.resolve());
1172
+ }
1173
+ dir(e) {
1174
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1175
+ let t = /* @__PURE__ */ "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".split("."), n = this.services?.languageUtils || new N(G());
1176
+ return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1177
+ }
1178
+ static createInstance() {
1179
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
1180
+ return new e(t, n);
1181
+ }
1182
+ cloneInstance() {
1183
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : q, r = t.forkResourceStore;
1184
+ r && delete t.forkResourceStore;
1185
+ let i = {
1186
+ ...this.options,
1187
+ ...t,
1188
+ isClone: !0
1189
+ }, a = new e(i);
1190
+ return (t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1191
+ "store",
1192
+ "services",
1193
+ "language"
1194
+ ].forEach((e) => {
1195
+ a[e] = this[e];
1196
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new O(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), {})), {}), i), a.services.resourceStore = a.store), a.translator = new M(a.services, i), a.translator.on("*", function(e) {
1197
+ var t = [...arguments].slice(1);
1198
+ a.emit(e, ...t);
1199
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1200
+ }
1201
+ toJSON() {
1202
+ return {
1203
+ options: this.options,
1204
+ store: this.store,
1205
+ language: this.language,
1206
+ languages: this.languages,
1207
+ resolvedLanguage: this.resolvedLanguage
1208
+ };
1209
+ }
1210
+ }, X = Y.createInstance();
1211
+ X.createInstance = Y.createInstance, X.createInstance, X.dir, X.init, X.loadResources, X.reloadResources, X.use, X.changeLanguage, X.getFixedT, X.t, X.exists, X.setDefaultNamespace, X.hasLoadedNamespace, X.loadNamespaces, X.loadLanguages;
1212
+ //#endregion
1213
+ export { n, X as t };