@hortiview/default-components 0.0.11202 → 0.0.11919

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 (32) hide show
  1. package/README.md +55 -50
  2. package/dist/HealthCheckFailed-D-HxxKaW.js +1839 -0
  3. package/dist/InternationalizationWrapper-f8wtvSQv.js +41 -0
  4. package/dist/LoadingSpinner-cKWdZk2k.js +514 -0
  5. package/dist/assets/DefaultFormNumber.css +1 -0
  6. package/dist/assets/HealthCheckFailed.css +1 -0
  7. package/dist/assets/LoadingSpinner.css +1 -0
  8. package/dist/assets/index.css +1 -0
  9. package/dist/assets/useTranslation.css +1 -0
  10. package/dist/component-DsB0poTj-DaqoXt8b.js +530 -0
  11. package/dist/components/DefaultFormNumber/DefaultFormNumber.js +3603 -0
  12. package/dist/components/DefaultLoadingSpinner/DefaultLoadingSpinner.js +11 -0
  13. package/dist/components/HealthChecks/DataBaseHealthCheck.js +19 -0
  14. package/dist/components/HealthChecks/DefaultHealthCheck.js +19 -0
  15. package/dist/components/HealthChecks/IotServiceHealthCheck.js +19 -0
  16. package/dist/components/HealthChecks/PlatformHealthCheck.js +19 -0
  17. package/dist/components/ImpatienceLoadingSpinner/ImpatienceLoadingSpinner.js +18 -0
  18. package/dist/components/InternationalizationWrapper/InternationalizationWrapper.js +8 -0
  19. package/dist/i18n-BfBMXJfT.js +1739 -0
  20. package/dist/i18n.js +7 -0
  21. package/dist/index.es-D-CKRzIB-DytY6U2C.js +1029 -0
  22. package/dist/locales/en-US.js +11 -0
  23. package/dist/locales/es-MX.js +11 -0
  24. package/dist/locales/tr-TR.js +11 -0
  25. package/dist/main.js +16 -4
  26. package/dist/useTranslation-DCJK5-ax.js +4070 -0
  27. package/package.json +31 -8
  28. package/dist/assets/App.css +0 -1
  29. package/dist/assets/Button.css +0 -1
  30. package/dist/components/App/App.test.js +0 -32948
  31. package/dist/components/Button/Button.js +0 -11
  32. package/dist/components/Label/Label.js +0 -7
@@ -0,0 +1,1739 @@
1
+ import Re from "./locales/en-US.js";
2
+ import Pe from "./locales/es-MX.js";
3
+ import Ne from "./locales/tr-TR.js";
4
+ const Ee = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, Fe = {
5
+ "&": "&",
6
+ "&": "&",
7
+ "&lt;": "<",
8
+ "&#60;": "<",
9
+ "&gt;": ">",
10
+ "&#62;": ">",
11
+ "&apos;": "'",
12
+ "&#39;": "'",
13
+ "&quot;": '"',
14
+ "&#34;": '"',
15
+ "&nbsp;": " ",
16
+ "&#160;": " ",
17
+ "&copy;": "©",
18
+ "&#169;": "©",
19
+ "&reg;": "®",
20
+ "&#174;": "®",
21
+ "&hellip;": "…",
22
+ "&#8230;": "…",
23
+ "&#x2F;": "/",
24
+ "&#47;": "/"
25
+ }, De = (r) => Fe[r], Ie = (r) => r.replace(Ee, De);
26
+ let _ = {
27
+ bindI18n: "languageChanged",
28
+ bindI18nStore: "",
29
+ transEmptyNodeValue: "",
30
+ transSupportBasicHtmlNodes: !0,
31
+ transWrapTextNodes: "",
32
+ transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
33
+ useSuspense: !0,
34
+ unescape: Ie
35
+ };
36
+ const je = (r = {}) => {
37
+ _ = {
38
+ ..._,
39
+ ...r
40
+ };
41
+ }, St = () => _;
42
+ let Oe;
43
+ const Ae = (r) => {
44
+ Oe = r;
45
+ }, bt = () => Oe, Te = {
46
+ type: "3rdParty",
47
+ init(r) {
48
+ je(r.options.react), Ae(r);
49
+ }
50
+ }, h = (r) => typeof r == "string", H = () => {
51
+ let r, e;
52
+ const t = new Promise((n, s) => {
53
+ r = n, e = s;
54
+ });
55
+ return t.resolve = r, t.reject = e, t;
56
+ }, re = (r) => r == null ? "" : "" + r, Ve = (r, e, t) => {
57
+ r.forEach((n) => {
58
+ e[n] && (t[n] = e[n]);
59
+ });
60
+ }, Ue = /###/g, ae = (r) => r && r.indexOf("###") > -1 ? r.replace(Ue, ".") : r, oe = (r) => !r || h(r), z = (r, e, t) => {
61
+ const n = h(e) ? e.split(".") : e;
62
+ let s = 0;
63
+ for (; s < n.length - 1; ) {
64
+ if (oe(r)) return {};
65
+ const i = ae(n[s]);
66
+ !r[i] && t && (r[i] = new t()), Object.prototype.hasOwnProperty.call(r, i) ? r = r[i] : r = {}, ++s;
67
+ }
68
+ return oe(r) ? {} : {
69
+ obj: r,
70
+ k: ae(n[s])
71
+ };
72
+ }, le = (r, e, t) => {
73
+ const {
74
+ obj: n,
75
+ k: s
76
+ } = z(r, e, Object);
77
+ if (n !== void 0 || e.length === 1) {
78
+ n[s] = t;
79
+ return;
80
+ }
81
+ let i = e[e.length - 1], a = e.slice(0, e.length - 1), l = z(r, a, Object);
82
+ for (; l.obj === void 0 && a.length; )
83
+ i = `${a[a.length - 1]}.${i}`, a = a.slice(0, a.length - 1), l = z(r, a, Object), l != null && l.obj && typeof l.obj[`${l.k}.${i}`] < "u" && (l.obj = void 0);
84
+ l.obj[`${l.k}.${i}`] = t;
85
+ }, Ke = (r, e, t, n) => {
86
+ const {
87
+ obj: s,
88
+ k: i
89
+ } = z(r, e, Object);
90
+ s[i] = s[i] || [], s[i].push(t);
91
+ }, Q = (r, e) => {
92
+ const {
93
+ obj: t,
94
+ k: n
95
+ } = z(r, e);
96
+ if (t && Object.prototype.hasOwnProperty.call(t, n))
97
+ return t[n];
98
+ }, Me = (r, e, t) => {
99
+ const n = Q(r, t);
100
+ return n !== void 0 ? n : Q(e, t);
101
+ }, Le = (r, e, t) => {
102
+ for (const n in e)
103
+ n !== "__proto__" && n !== "constructor" && (n in r ? h(r[n]) || r[n] instanceof String || h(e[n]) || e[n] instanceof String ? t && (r[n] = e[n]) : Le(r[n], e[n], t) : r[n] = e[n]);
104
+ return r;
105
+ }, I = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
106
+ var He = {
107
+ "&": "&amp;",
108
+ "<": "&lt;",
109
+ ">": "&gt;",
110
+ '"': "&quot;",
111
+ "'": "&#39;",
112
+ "/": "&#x2F;"
113
+ };
114
+ const ze = (r) => h(r) ? r.replace(/[&<>"'\/]/g, (e) => He[e]) : r;
115
+ class Be {
116
+ constructor(e) {
117
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
118
+ }
119
+ getRegExp(e) {
120
+ const t = this.regExpMap.get(e);
121
+ if (t !== void 0)
122
+ return t;
123
+ const n = new RegExp(e);
124
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
125
+ }
126
+ }
127
+ const Je = [" ", ",", "?", "!", ";"], We = new Be(20), Qe = (r, e, t) => {
128
+ e = e || "", t = t || "";
129
+ const n = Je.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
130
+ if (n.length === 0) return !0;
131
+ const s = We.getRegExp(`(${n.map((a) => a === "?" ? "\\?" : a).join("|")})`);
132
+ let i = !s.test(r);
133
+ if (!i) {
134
+ const a = r.indexOf(t);
135
+ a > 0 && !s.test(r.substring(0, a)) && (i = !0);
136
+ }
137
+ return i;
138
+ }, ee = function(r, e) {
139
+ let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
140
+ if (!r) return;
141
+ if (r[e])
142
+ return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
143
+ const n = e.split(t);
144
+ let s = r;
145
+ for (let i = 0; i < n.length; ) {
146
+ if (!s || typeof s != "object")
147
+ return;
148
+ let a, l = "";
149
+ for (let o = i; o < n.length; ++o)
150
+ if (o !== i && (l += t), l += n[o], a = s[l], a !== void 0) {
151
+ if (["string", "number", "boolean"].indexOf(typeof a) > -1 && o < n.length - 1)
152
+ continue;
153
+ i += o - i + 1;
154
+ break;
155
+ }
156
+ s = a;
157
+ }
158
+ return s;
159
+ }, q = (r) => r == null ? void 0 : r.replace("_", "-"), qe = {
160
+ type: "logger",
161
+ log(r) {
162
+ this.output("log", r);
163
+ },
164
+ warn(r) {
165
+ this.output("warn", r);
166
+ },
167
+ error(r) {
168
+ this.output("error", r);
169
+ },
170
+ output(r, e) {
171
+ var t, n;
172
+ (n = (t = console == null ? void 0 : console[r]) == null ? void 0 : t.apply) == null || n.call(t, console, e);
173
+ }
174
+ };
175
+ class Y {
176
+ constructor(e) {
177
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
178
+ this.init(e, t);
179
+ }
180
+ init(e) {
181
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
182
+ this.prefix = t.prefix || "i18next:", this.logger = e || qe, this.options = t, this.debug = t.debug;
183
+ }
184
+ log() {
185
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
186
+ t[n] = arguments[n];
187
+ return this.forward(t, "log", "", !0);
188
+ }
189
+ warn() {
190
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
191
+ t[n] = arguments[n];
192
+ return this.forward(t, "warn", "", !0);
193
+ }
194
+ error() {
195
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
196
+ t[n] = arguments[n];
197
+ return this.forward(t, "error", "");
198
+ }
199
+ deprecate() {
200
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
201
+ t[n] = arguments[n];
202
+ return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
203
+ }
204
+ forward(e, t, n, s) {
205
+ return s && !this.debug ? null : (h(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
206
+ }
207
+ create(e) {
208
+ return new Y(this.logger, {
209
+ prefix: `${this.prefix}:${e}:`,
210
+ ...this.options
211
+ });
212
+ }
213
+ clone(e) {
214
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new Y(this.logger, e);
215
+ }
216
+ }
217
+ var P = new Y();
218
+ class Z {
219
+ constructor() {
220
+ this.observers = {};
221
+ }
222
+ on(e, t) {
223
+ return e.split(" ").forEach((n) => {
224
+ this.observers[n] || (this.observers[n] = /* @__PURE__ */ new Map());
225
+ const s = this.observers[n].get(t) || 0;
226
+ this.observers[n].set(t, s + 1);
227
+ }), this;
228
+ }
229
+ off(e, t) {
230
+ if (this.observers[e]) {
231
+ if (!t) {
232
+ delete this.observers[e];
233
+ return;
234
+ }
235
+ this.observers[e].delete(t);
236
+ }
237
+ }
238
+ emit(e) {
239
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
240
+ n[s - 1] = arguments[s];
241
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
242
+ let [l, o] = a;
243
+ for (let u = 0; u < o; u++)
244
+ l(...n);
245
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
246
+ let [l, o] = a;
247
+ for (let u = 0; u < o; u++)
248
+ l.apply(l, [e, ...n]);
249
+ });
250
+ }
251
+ }
252
+ class ue extends Z {
253
+ constructor(e) {
254
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
255
+ ns: ["translation"],
256
+ defaultNS: "translation"
257
+ };
258
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
259
+ }
260
+ addNamespaces(e) {
261
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
262
+ }
263
+ removeNamespaces(e) {
264
+ const t = this.options.ns.indexOf(e);
265
+ t > -1 && this.options.ns.splice(t, 1);
266
+ }
267
+ getResource(e, t, n) {
268
+ var u, d;
269
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
270
+ const i = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, a = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure;
271
+ let l;
272
+ e.indexOf(".") > -1 ? l = e.split(".") : (l = [e, t], n && (Array.isArray(n) ? l.push(...n) : h(n) && i ? l.push(...n.split(i)) : l.push(n)));
273
+ const o = Q(this.data, l);
274
+ return !o && !t && !n && e.indexOf(".") > -1 && (e = l[0], t = l[1], n = l.slice(2).join(".")), o || !a || !h(n) ? o : ee((d = (u = this.data) == null ? void 0 : u[e]) == null ? void 0 : d[t], n, i);
275
+ }
276
+ addResource(e, t, n, s) {
277
+ let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
278
+ silent: !1
279
+ };
280
+ const a = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator;
281
+ let l = [e, t];
282
+ n && (l = l.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (l = e.split("."), s = t, t = l[1]), this.addNamespaces(t), le(this.data, l, s), i.silent || this.emit("added", e, t, n, s);
283
+ }
284
+ addResources(e, t, n) {
285
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
286
+ silent: !1
287
+ };
288
+ for (const i in n)
289
+ (h(n[i]) || Array.isArray(n[i])) && this.addResource(e, t, i, n[i], {
290
+ silent: !0
291
+ });
292
+ s.silent || this.emit("added", e, t, n);
293
+ }
294
+ addResourceBundle(e, t, n, s, i) {
295
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
296
+ silent: !1,
297
+ skipCopy: !1
298
+ }, l = [e, t];
299
+ e.indexOf(".") > -1 && (l = e.split("."), s = n, n = t, t = l[1]), this.addNamespaces(t);
300
+ let o = Q(this.data, l) || {};
301
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), s ? Le(o, n, i) : o = {
302
+ ...o,
303
+ ...n
304
+ }, le(this.data, l, o), a.silent || this.emit("added", e, t, n);
305
+ }
306
+ removeResourceBundle(e, t) {
307
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
308
+ }
309
+ hasResourceBundle(e, t) {
310
+ return this.getResource(e, t) !== void 0;
311
+ }
312
+ getResourceBundle(e, t) {
313
+ return t || (t = this.options.defaultNS), this.getResource(e, t);
314
+ }
315
+ getDataByLanguage(e) {
316
+ return this.data[e];
317
+ }
318
+ hasLanguageSomeTranslations(e) {
319
+ const t = this.getDataByLanguage(e);
320
+ return !!(t && Object.keys(t) || []).find((s) => t[s] && Object.keys(t[s]).length > 0);
321
+ }
322
+ toJSON() {
323
+ return this.data;
324
+ }
325
+ }
326
+ var ve = {
327
+ processors: {},
328
+ addPostProcessor(r) {
329
+ this.processors[r.name] = r;
330
+ },
331
+ handle(r, e, t, n, s) {
332
+ return r.forEach((i) => {
333
+ var a;
334
+ e = ((a = this.processors[i]) == null ? void 0 : a.process(e, t, n, s)) ?? e;
335
+ }), e;
336
+ }
337
+ };
338
+ const fe = {}, de = (r) => !h(r) && typeof r != "boolean" && typeof r != "number";
339
+ class G extends Z {
340
+ constructor(e) {
341
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
342
+ super(), Ve(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
343
+ }
344
+ changeLanguage(e) {
345
+ e && (this.language = e);
346
+ }
347
+ exists(e) {
348
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
349
+ interpolation: {}
350
+ };
351
+ if (e == null)
352
+ return !1;
353
+ const n = this.resolve(e, t);
354
+ return (n == null ? void 0 : n.res) !== void 0;
355
+ }
356
+ extractFromKey(e, t) {
357
+ let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
358
+ n === void 0 && (n = ":");
359
+ const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
360
+ let i = t.ns || this.options.defaultNS || [];
361
+ const a = n && e.indexOf(n) > -1, l = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Qe(e, n, s);
362
+ if (a && !l) {
363
+ const o = e.match(this.interpolator.nestingRegexp);
364
+ if (o && o.length > 0)
365
+ return {
366
+ key: e,
367
+ namespaces: h(i) ? [i] : i
368
+ };
369
+ const u = e.split(n);
370
+ (n !== s || n === s && this.options.ns.indexOf(u[0]) > -1) && (i = u.shift()), e = u.join(s);
371
+ }
372
+ return {
373
+ key: e,
374
+ namespaces: h(i) ? [i] : i
375
+ };
376
+ }
377
+ translate(e, t, n) {
378
+ if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
379
+ ...t
380
+ }), t || (t = {}), e == null) return "";
381
+ Array.isArray(e) || (e = [String(e)]);
382
+ const s = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
383
+ key: a,
384
+ namespaces: l
385
+ } = this.extractFromKey(e[e.length - 1], t), o = l[l.length - 1], u = t.lng || this.language, d = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
386
+ if ((u == null ? void 0 : u.toLowerCase()) === "cimode") {
387
+ if (d) {
388
+ const L = t.nsSeparator || this.options.nsSeparator;
389
+ return s ? {
390
+ res: `${o}${L}${a}`,
391
+ usedKey: a,
392
+ exactUsedKey: a,
393
+ usedLng: u,
394
+ usedNS: o,
395
+ usedParams: this.getUsedParamsDetails(t)
396
+ } : `${o}${L}${a}`;
397
+ }
398
+ return s ? {
399
+ res: a,
400
+ usedKey: a,
401
+ exactUsedKey: a,
402
+ usedLng: u,
403
+ usedNS: o,
404
+ usedParams: this.getUsedParamsDetails(t)
405
+ } : a;
406
+ }
407
+ const c = this.resolve(e, t);
408
+ let f = c == null ? void 0 : c.res;
409
+ const m = (c == null ? void 0 : c.usedKey) || a, g = (c == null ? void 0 : c.exactUsedKey) || a, p = ["[object Number]", "[object Function]", "[object RegExp]"], x = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, w = t.count !== void 0 && !h(t.count), $ = G.hasDefaultValue(t), C = w ? this.pluralResolver.getSuffix(u, t.count, t) : "", V = t.ordinal && w ? this.pluralResolver.getSuffix(u, t.count, {
410
+ ordinal: !1
411
+ }) : "", U = w && !t.ordinal && t.count === 0, y = U && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${C}`] || t[`defaultValue${V}`] || t.defaultValue;
412
+ let O = f;
413
+ b && !f && $ && (O = y);
414
+ const F = de(O), D = Object.prototype.toString.apply(O);
415
+ if (b && O && F && p.indexOf(D) < 0 && !(h(x) && Array.isArray(O))) {
416
+ if (!t.returnObjects && !this.options.returnObjects) {
417
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
418
+ const L = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, O, {
419
+ ...t,
420
+ ns: l
421
+ }) : `key '${a} (${this.language})' returned an object instead of string.`;
422
+ return s ? (c.res = L, c.usedParams = this.getUsedParamsDetails(t), c) : L;
423
+ }
424
+ if (i) {
425
+ const L = Array.isArray(O), k = L ? [] : {}, te = L ? g : m;
426
+ for (const R in O)
427
+ if (Object.prototype.hasOwnProperty.call(O, R)) {
428
+ const N = `${te}${i}${R}`;
429
+ $ && !f ? k[R] = this.translate(N, {
430
+ ...t,
431
+ defaultValue: de(y) ? y[R] : void 0,
432
+ joinArrays: !1,
433
+ ns: l
434
+ }) : k[R] = this.translate(N, {
435
+ ...t,
436
+ joinArrays: !1,
437
+ ns: l
438
+ }), k[R] === N && (k[R] = O[R]);
439
+ }
440
+ f = k;
441
+ }
442
+ } else if (b && h(x) && Array.isArray(f))
443
+ f = f.join(x), f && (f = this.extendTranslation(f, e, t, n));
444
+ else {
445
+ let L = !1, k = !1;
446
+ !this.isValidLookup(f) && $ && (L = !0, f = y), this.isValidLookup(f) || (k = !0, f = a);
447
+ const R = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && k ? void 0 : f, N = $ && y !== f && this.options.updateMissing;
448
+ if (k || L || N) {
449
+ if (this.logger.log(N ? "updateKey" : "missingKey", u, o, a, N ? y : f), i) {
450
+ const v = this.resolve(a, {
451
+ ...t,
452
+ keySeparator: !1
453
+ });
454
+ v && v.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.");
455
+ }
456
+ let K = [];
457
+ const J = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
458
+ if (this.options.saveMissingTo === "fallback" && J && J[0])
459
+ for (let v = 0; v < J.length; v++)
460
+ K.push(J[v]);
461
+ else this.options.saveMissingTo === "all" ? K = this.languageUtils.toResolveHierarchy(t.lng || this.language) : K.push(t.lng || this.language);
462
+ const ne = (v, E, M) => {
463
+ var ie;
464
+ const se = $ && M !== f ? M : R;
465
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(v, o, E, se, N, t) : (ie = this.backendConnector) != null && ie.saveMissing && this.backendConnector.saveMissing(v, o, E, se, N, t), this.emit("missingKey", v, o, E, f);
466
+ };
467
+ this.options.saveMissing && (this.options.saveMissingPlurals && w ? K.forEach((v) => {
468
+ const E = this.pluralResolver.getSuffixes(v, t);
469
+ U && t[`defaultValue${this.options.pluralSeparator}zero`] && E.indexOf(`${this.options.pluralSeparator}zero`) < 0 && E.push(`${this.options.pluralSeparator}zero`), E.forEach((M) => {
470
+ ne([v], a + M, t[`defaultValue${M}`] || y);
471
+ });
472
+ }) : ne(K, a, y));
473
+ }
474
+ f = this.extendTranslation(f, e, t, c, n), k && f === a && this.options.appendNamespaceToMissingKey && (f = `${o}:${a}`), (k || L) && this.options.parseMissingKeyHandler && (f = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${o}:${a}` : a, L ? f : void 0));
475
+ }
476
+ return s ? (c.res = f, c.usedParams = this.getUsedParamsDetails(t), c) : f;
477
+ }
478
+ extendTranslation(e, t, n, s, i) {
479
+ var u, d;
480
+ var a = this;
481
+ if ((u = this.i18nFormat) != null && u.parse)
482
+ e = this.i18nFormat.parse(e, {
483
+ ...this.options.interpolation.defaultVariables,
484
+ ...n
485
+ }, n.lng || this.language || s.usedLng, s.usedNS, s.usedKey, {
486
+ resolved: s
487
+ });
488
+ else if (!n.skipInterpolation) {
489
+ n.interpolation && this.interpolator.init({
490
+ ...n,
491
+ interpolation: {
492
+ ...this.options.interpolation,
493
+ ...n.interpolation
494
+ }
495
+ });
496
+ const c = h(e) && (((d = n == null ? void 0 : n.interpolation) == null ? void 0 : d.skipOnVariables) !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
497
+ let f;
498
+ if (c) {
499
+ const g = e.match(this.interpolator.nestingRegexp);
500
+ f = g && g.length;
501
+ }
502
+ let m = n.replace && !h(n.replace) ? n.replace : n;
503
+ if (this.options.interpolation.defaultVariables && (m = {
504
+ ...this.options.interpolation.defaultVariables,
505
+ ...m
506
+ }), e = this.interpolator.interpolate(e, m, n.lng || this.language || s.usedLng, n), c) {
507
+ const g = e.match(this.interpolator.nestingRegexp), p = g && g.length;
508
+ f < p && (n.nest = !1);
509
+ }
510
+ !n.lng && s && s.res && (n.lng = this.language || s.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, function() {
511
+ for (var g = arguments.length, p = new Array(g), x = 0; x < g; x++)
512
+ p[x] = arguments[x];
513
+ return (i == null ? void 0 : i[0]) === p[0] && !n.context ? (a.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`), null) : a.translate(...p, t);
514
+ }, n)), n.interpolation && this.interpolator.reset();
515
+ }
516
+ const l = n.postProcess || this.options.postProcess, o = h(l) ? [l] : l;
517
+ return e != null && (o != null && o.length) && n.applyPostProcessor !== !1 && (e = ve.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
518
+ i18nResolved: {
519
+ ...s,
520
+ usedParams: this.getUsedParamsDetails(n)
521
+ },
522
+ ...n
523
+ } : n, this)), e;
524
+ }
525
+ resolve(e) {
526
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n, s, i, a, l;
527
+ return h(e) && (e = [e]), e.forEach((o) => {
528
+ if (this.isValidLookup(n)) return;
529
+ const u = this.extractFromKey(o, t), d = u.key;
530
+ s = d;
531
+ let c = u.namespaces;
532
+ this.options.fallbackNS && (c = c.concat(this.options.fallbackNS));
533
+ const f = t.count !== void 0 && !h(t.count), m = f && !t.ordinal && t.count === 0, g = t.context !== void 0 && (h(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
534
+ c.forEach((x) => {
535
+ var b, w;
536
+ this.isValidLookup(n) || (l = x, !fe[`${p[0]}-${x}`] && ((b = this.utils) != null && b.hasLoadedNamespace) && !((w = this.utils) != null && w.hasLoadedNamespace(l)) && (fe[`${p[0]}-${x}`] = !0, this.logger.warn(`key "${s}" for languages "${p.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!!!")), p.forEach(($) => {
537
+ var U;
538
+ if (this.isValidLookup(n)) return;
539
+ a = $;
540
+ const C = [d];
541
+ if ((U = this.i18nFormat) != null && U.addLookupKeys)
542
+ this.i18nFormat.addLookupKeys(C, d, $, x, t);
543
+ else {
544
+ let y;
545
+ f && (y = this.pluralResolver.getSuffix($, t.count, t));
546
+ const O = `${this.options.pluralSeparator}zero`, F = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
547
+ if (f && (C.push(d + y), t.ordinal && y.indexOf(F) === 0 && C.push(d + y.replace(F, this.options.pluralSeparator)), m && C.push(d + O)), g) {
548
+ const D = `${d}${this.options.contextSeparator}${t.context}`;
549
+ C.push(D), f && (C.push(D + y), t.ordinal && y.indexOf(F) === 0 && C.push(D + y.replace(F, this.options.pluralSeparator)), m && C.push(D + O));
550
+ }
551
+ }
552
+ let V;
553
+ for (; V = C.pop(); )
554
+ this.isValidLookup(n) || (i = V, n = this.getResource($, x, V, t));
555
+ }));
556
+ });
557
+ }), {
558
+ res: n,
559
+ usedKey: s,
560
+ exactUsedKey: i,
561
+ usedLng: a,
562
+ usedNS: l
563
+ };
564
+ }
565
+ isValidLookup(e) {
566
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
567
+ }
568
+ getResource(e, t, n) {
569
+ var i;
570
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
571
+ return (i = this.i18nFormat) != null && i.getResource ? this.i18nFormat.getResource(e, t, n, s) : this.resourceStore.getResource(e, t, n, s);
572
+ }
573
+ getUsedParamsDetails() {
574
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
575
+ const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && !h(e.replace);
576
+ let s = n ? e.replace : e;
577
+ if (n && typeof e.count < "u" && (s.count = e.count), this.options.interpolation.defaultVariables && (s = {
578
+ ...this.options.interpolation.defaultVariables,
579
+ ...s
580
+ }), !n) {
581
+ s = {
582
+ ...s
583
+ };
584
+ for (const i of t)
585
+ delete s[i];
586
+ }
587
+ return s;
588
+ }
589
+ static hasDefaultValue(e) {
590
+ const t = "defaultValue";
591
+ for (const n in e)
592
+ if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, t.length) && e[n] !== void 0)
593
+ return !0;
594
+ return !1;
595
+ }
596
+ }
597
+ class ce {
598
+ constructor(e) {
599
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
600
+ }
601
+ getScriptPartFromCode(e) {
602
+ if (e = q(e), !e || e.indexOf("-") < 0) return null;
603
+ const t = e.split("-");
604
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
605
+ }
606
+ getLanguagePartFromCode(e) {
607
+ if (e = q(e), !e || e.indexOf("-") < 0) return e;
608
+ const t = e.split("-");
609
+ return this.formatLanguageCode(t[0]);
610
+ }
611
+ formatLanguageCode(e) {
612
+ if (h(e) && e.indexOf("-") > -1) {
613
+ let t;
614
+ try {
615
+ t = Intl.getCanonicalLocales(e)[0];
616
+ } catch {
617
+ }
618
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
619
+ }
620
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
621
+ }
622
+ isSupportedCode(e) {
623
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
624
+ }
625
+ getBestMatchFromCodes(e) {
626
+ if (!e) return null;
627
+ let t;
628
+ return e.forEach((n) => {
629
+ if (t) return;
630
+ const s = this.formatLanguageCode(n);
631
+ (!this.options.supportedLngs || this.isSupportedCode(s)) && (t = s);
632
+ }), !t && this.options.supportedLngs && e.forEach((n) => {
633
+ if (t) return;
634
+ const s = this.getLanguagePartFromCode(n);
635
+ if (this.isSupportedCode(s)) return t = s;
636
+ t = this.options.supportedLngs.find((i) => {
637
+ if (i === s) return i;
638
+ if (!(i.indexOf("-") < 0 && s.indexOf("-") < 0) && (i.indexOf("-") > 0 && s.indexOf("-") < 0 && i.substring(0, i.indexOf("-")) === s || i.indexOf(s) === 0 && s.length > 1))
639
+ return i;
640
+ });
641
+ }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
642
+ }
643
+ getFallbackCodes(e, t) {
644
+ if (!e) return [];
645
+ if (typeof e == "function" && (e = e(t)), h(e) && (e = [e]), Array.isArray(e)) return e;
646
+ if (!t) return e.default || [];
647
+ let n = e[t];
648
+ return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
649
+ }
650
+ toResolveHierarchy(e, t) {
651
+ const n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), s = [], i = (a) => {
652
+ a && (this.isSupportedCode(a) ? s.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
653
+ };
654
+ return h(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : h(e) && i(this.formatLanguageCode(e)), n.forEach((a) => {
655
+ s.indexOf(a) < 0 && i(this.formatLanguageCode(a));
656
+ }), s;
657
+ }
658
+ }
659
+ const ge = {
660
+ zero: 0,
661
+ one: 1,
662
+ two: 2,
663
+ few: 3,
664
+ many: 4,
665
+ other: 5
666
+ }, he = {
667
+ select: (r) => r === 1 ? "one" : "other",
668
+ resolvedOptions: () => ({
669
+ pluralCategories: ["one", "other"]
670
+ })
671
+ };
672
+ class Ye {
673
+ constructor(e) {
674
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
675
+ this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), this.pluralRulesCache = {};
676
+ }
677
+ addRule(e, t) {
678
+ this.rules[e] = t;
679
+ }
680
+ clearCache() {
681
+ this.pluralRulesCache = {};
682
+ }
683
+ getRule(e) {
684
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
685
+ const n = q(e === "dev" ? "en" : e), s = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
686
+ cleanedCode: n,
687
+ type: s
688
+ });
689
+ if (i in this.pluralRulesCache)
690
+ return this.pluralRulesCache[i];
691
+ let a;
692
+ try {
693
+ a = new Intl.PluralRules(n, {
694
+ type: s
695
+ });
696
+ } catch {
697
+ if (!Intl)
698
+ return this.logger.error("No Intl support, please use an Intl polyfill!"), he;
699
+ if (!e.match(/-|_/)) return he;
700
+ const o = this.languageUtils.getLanguagePartFromCode(e);
701
+ a = this.getRule(o, t);
702
+ }
703
+ return this.pluralRulesCache[i] = a, a;
704
+ }
705
+ needsPlural(e) {
706
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
707
+ return n || (n = this.getRule("dev", t)), (n == null ? void 0 : n.resolvedOptions().pluralCategories.length) > 1;
708
+ }
709
+ getPluralFormsOfKey(e, t) {
710
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
711
+ return this.getSuffixes(e, n).map((s) => `${t}${s}`);
712
+ }
713
+ getSuffixes(e) {
714
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
715
+ return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((s, i) => ge[s] - ge[i]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
716
+ }
717
+ getSuffix(e, t) {
718
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
719
+ const s = this.getRule(e, n);
720
+ return s ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
721
+ }
722
+ }
723
+ const pe = function(r, e, t) {
724
+ let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = Me(r, e, t);
725
+ return !i && s && h(t) && (i = ee(r, t, n), i === void 0 && (i = ee(e, t, n))), i;
726
+ }, X = (r) => r.replace(/\$/g, "$$$$");
727
+ class Ge {
728
+ constructor() {
729
+ var t;
730
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
731
+ this.logger = P.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((n) => n), this.init(e);
732
+ }
733
+ init() {
734
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
735
+ e.interpolation || (e.interpolation = {
736
+ escapeValue: !0
737
+ });
738
+ const {
739
+ escape: t,
740
+ escapeValue: n,
741
+ useRawValueToEscape: s,
742
+ prefix: i,
743
+ prefixEscaped: a,
744
+ suffix: l,
745
+ suffixEscaped: o,
746
+ formatSeparator: u,
747
+ unescapeSuffix: d,
748
+ unescapePrefix: c,
749
+ nestingPrefix: f,
750
+ nestingPrefixEscaped: m,
751
+ nestingSuffix: g,
752
+ nestingSuffixEscaped: p,
753
+ nestingOptionsSeparator: x,
754
+ maxReplaces: b,
755
+ alwaysFormat: w
756
+ } = e.interpolation;
757
+ this.escape = t !== void 0 ? t : ze, this.escapeValue = n !== void 0 ? n : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = i ? I(i) : a || "{{", this.suffix = l ? I(l) : o || "}}", this.formatSeparator = u || ",", this.unescapePrefix = d ? "" : c || "-", this.unescapeSuffix = this.unescapePrefix ? "" : d || "", this.nestingPrefix = f ? I(f) : m || I("$t("), this.nestingSuffix = g ? I(g) : p || I(")"), this.nestingOptionsSeparator = x || ",", this.maxReplaces = b || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
758
+ }
759
+ reset() {
760
+ this.options && this.init(this.options);
761
+ }
762
+ resetRegExp() {
763
+ const e = (t, n) => (t == null ? void 0 : t.source) === n ? (t.lastIndex = 0, t) : new RegExp(n, "g");
764
+ 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}`);
765
+ }
766
+ interpolate(e, t, n, s) {
767
+ var m;
768
+ let i, a, l;
769
+ const o = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (g) => {
770
+ if (g.indexOf(this.formatSeparator) < 0) {
771
+ const w = pe(t, o, g, this.options.keySeparator, this.options.ignoreJSONStructure);
772
+ return this.alwaysFormat ? this.format(w, void 0, n, {
773
+ ...s,
774
+ ...t,
775
+ interpolationkey: g
776
+ }) : w;
777
+ }
778
+ const p = g.split(this.formatSeparator), x = p.shift().trim(), b = p.join(this.formatSeparator).trim();
779
+ return this.format(pe(t, o, x, this.options.keySeparator, this.options.ignoreJSONStructure), b, n, {
780
+ ...s,
781
+ ...t,
782
+ interpolationkey: x
783
+ });
784
+ };
785
+ this.resetRegExp();
786
+ const d = (s == null ? void 0 : s.missingInterpolationHandler) || this.options.missingInterpolationHandler, c = ((m = s == null ? void 0 : s.interpolation) == null ? void 0 : m.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
787
+ return [{
788
+ regex: this.regexpUnescape,
789
+ safeValue: (g) => X(g)
790
+ }, {
791
+ regex: this.regexp,
792
+ safeValue: (g) => this.escapeValue ? X(this.escape(g)) : X(g)
793
+ }].forEach((g) => {
794
+ for (l = 0; i = g.regex.exec(e); ) {
795
+ const p = i[1].trim();
796
+ if (a = u(p), a === void 0)
797
+ if (typeof d == "function") {
798
+ const b = d(e, i, s);
799
+ a = h(b) ? b : "";
800
+ } else if (s && Object.prototype.hasOwnProperty.call(s, p))
801
+ a = "";
802
+ else if (c) {
803
+ a = i[0];
804
+ continue;
805
+ } else
806
+ this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), a = "";
807
+ else !h(a) && !this.useRawValueToEscape && (a = re(a));
808
+ const x = g.safeValue(a);
809
+ if (e = e.replace(i[0], x), c ? (g.regex.lastIndex += a.length, g.regex.lastIndex -= i[0].length) : g.regex.lastIndex = 0, l++, l >= this.maxReplaces)
810
+ break;
811
+ }
812
+ }), e;
813
+ }
814
+ nest(e, t) {
815
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s, i, a;
816
+ const l = (o, u) => {
817
+ const d = this.nestingOptionsSeparator;
818
+ if (o.indexOf(d) < 0) return o;
819
+ const c = o.split(new RegExp(`${d}[ ]*{`));
820
+ let f = `{${c[1]}`;
821
+ o = c[0], f = this.interpolate(f, a);
822
+ const m = f.match(/'/g), g = f.match(/"/g);
823
+ (((m == null ? void 0 : m.length) ?? 0) % 2 === 0 && !g || g.length % 2 !== 0) && (f = f.replace(/'/g, '"'));
824
+ try {
825
+ a = JSON.parse(f), u && (a = {
826
+ ...u,
827
+ ...a
828
+ });
829
+ } catch (p) {
830
+ return this.logger.warn(`failed parsing options string in nesting for key ${o}`, p), `${o}${d}${f}`;
831
+ }
832
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, o;
833
+ };
834
+ for (; s = this.nestingRegexp.exec(e); ) {
835
+ let o = [];
836
+ a = {
837
+ ...n
838
+ }, a = a.replace && !h(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
839
+ let u = !1;
840
+ if (s[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(s[1])) {
841
+ const d = s[1].split(this.formatSeparator).map((c) => c.trim());
842
+ s[1] = d.shift(), o = d, u = !0;
843
+ }
844
+ if (i = t(l.call(this, s[1].trim(), a), a), i && s[0] === e && !h(i)) return i;
845
+ h(i) || (i = re(i)), i || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), i = ""), u && (i = o.reduce((d, c) => this.format(d, c, n.lng, {
846
+ ...n,
847
+ interpolationkey: s[1].trim()
848
+ }), i.trim())), e = e.replace(s[0], i), this.regexp.lastIndex = 0;
849
+ }
850
+ return e;
851
+ }
852
+ }
853
+ const Ze = (r) => {
854
+ let e = r.toLowerCase().trim();
855
+ const t = {};
856
+ if (r.indexOf("(") > -1) {
857
+ const n = r.split("(");
858
+ e = n[0].toLowerCase().trim();
859
+ const s = n[1].substring(0, n[1].length - 1);
860
+ 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) => {
861
+ if (a) {
862
+ const [l, ...o] = a.split(":"), u = o.join(":").trim().replace(/^'+|'+$/g, ""), d = l.trim();
863
+ t[d] || (t[d] = u), u === "false" && (t[d] = !1), u === "true" && (t[d] = !0), isNaN(u) || (t[d] = parseInt(u, 10));
864
+ }
865
+ });
866
+ }
867
+ return {
868
+ formatName: e,
869
+ formatOptions: t
870
+ };
871
+ }, j = (r) => {
872
+ const e = {};
873
+ return (t, n, s) => {
874
+ let i = s;
875
+ s && s.interpolationkey && s.formatParams && s.formatParams[s.interpolationkey] && s[s.interpolationkey] && (i = {
876
+ ...i,
877
+ [s.interpolationkey]: void 0
878
+ });
879
+ const a = n + JSON.stringify(i);
880
+ let l = e[a];
881
+ return l || (l = r(q(n), s), e[a] = l), l(t);
882
+ };
883
+ };
884
+ class Xe {
885
+ constructor() {
886
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
887
+ this.logger = P.create("formatter"), this.options = e, this.formats = {
888
+ number: j((t, n) => {
889
+ const s = new Intl.NumberFormat(t, {
890
+ ...n
891
+ });
892
+ return (i) => s.format(i);
893
+ }),
894
+ currency: j((t, n) => {
895
+ const s = new Intl.NumberFormat(t, {
896
+ ...n,
897
+ style: "currency"
898
+ });
899
+ return (i) => s.format(i);
900
+ }),
901
+ datetime: j((t, n) => {
902
+ const s = new Intl.DateTimeFormat(t, {
903
+ ...n
904
+ });
905
+ return (i) => s.format(i);
906
+ }),
907
+ relativetime: j((t, n) => {
908
+ const s = new Intl.RelativeTimeFormat(t, {
909
+ ...n
910
+ });
911
+ return (i) => s.format(i, n.range || "day");
912
+ }),
913
+ list: j((t, n) => {
914
+ const s = new Intl.ListFormat(t, {
915
+ ...n
916
+ });
917
+ return (i) => s.format(i);
918
+ })
919
+ }, this.init(e);
920
+ }
921
+ init(e) {
922
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
923
+ interpolation: {}
924
+ };
925
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
926
+ }
927
+ add(e, t) {
928
+ this.formats[e.toLowerCase().trim()] = t;
929
+ }
930
+ addCached(e, t) {
931
+ this.formats[e.toLowerCase().trim()] = j(t);
932
+ }
933
+ format(e, t, n) {
934
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
935
+ const i = t.split(this.formatSeparator);
936
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((l) => l.indexOf(")") > -1)) {
937
+ const l = i.findIndex((o) => o.indexOf(")") > -1);
938
+ i[0] = [i[0], ...i.splice(1, l)].join(this.formatSeparator);
939
+ }
940
+ return i.reduce((l, o) => {
941
+ var c;
942
+ const {
943
+ formatName: u,
944
+ formatOptions: d
945
+ } = Ze(o);
946
+ if (this.formats[u]) {
947
+ let f = l;
948
+ try {
949
+ const m = ((c = s == null ? void 0 : s.formatParams) == null ? void 0 : c[s.interpolationkey]) || {}, g = m.locale || m.lng || s.locale || s.lng || n;
950
+ f = this.formats[u](l, g, {
951
+ ...d,
952
+ ...s,
953
+ ...m
954
+ });
955
+ } catch (m) {
956
+ this.logger.warn(m);
957
+ }
958
+ return f;
959
+ } else
960
+ this.logger.warn(`there was no format function for ${u}`);
961
+ return l;
962
+ }, e);
963
+ }
964
+ }
965
+ const _e = (r, e) => {
966
+ r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
967
+ };
968
+ class et extends Z {
969
+ constructor(e, t, n) {
970
+ var i, a;
971
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
972
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = s, this.logger = P.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 = [], (a = (i = this.backend) == null ? void 0 : i.init) == null || a.call(i, n, s.backend, s);
973
+ }
974
+ queueLoad(e, t, n, s) {
975
+ const i = {}, a = {}, l = {}, o = {};
976
+ return e.forEach((u) => {
977
+ let d = !0;
978
+ t.forEach((c) => {
979
+ const f = `${u}|${c}`;
980
+ !n.reload && this.store.hasResourceBundle(u, c) ? this.state[f] = 2 : this.state[f] < 0 || (this.state[f] === 1 ? a[f] === void 0 && (a[f] = !0) : (this.state[f] = 1, d = !1, a[f] === void 0 && (a[f] = !0), i[f] === void 0 && (i[f] = !0), o[c] === void 0 && (o[c] = !0)));
981
+ }), d || (l[u] = !0);
982
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
983
+ pending: a,
984
+ pendingCount: Object.keys(a).length,
985
+ loaded: {},
986
+ errors: [],
987
+ callback: s
988
+ }), {
989
+ toLoad: Object.keys(i),
990
+ pending: Object.keys(a),
991
+ toLoadLanguages: Object.keys(l),
992
+ toLoadNamespaces: Object.keys(o)
993
+ };
994
+ }
995
+ loaded(e, t, n) {
996
+ const s = e.split("|"), i = s[0], a = s[1];
997
+ t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, {
998
+ skipCopy: !0
999
+ }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
1000
+ const l = {};
1001
+ this.queue.forEach((o) => {
1002
+ Ke(o.loaded, [i], a), _e(o, e), t && o.errors.push(t), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((u) => {
1003
+ l[u] || (l[u] = {});
1004
+ const d = o.loaded[u];
1005
+ d.length && d.forEach((c) => {
1006
+ l[u][c] === void 0 && (l[u][c] = !0);
1007
+ });
1008
+ }), o.done = !0, o.errors.length ? o.callback(o.errors) : o.callback());
1009
+ }), this.emit("loaded", l), this.queue = this.queue.filter((o) => !o.done);
1010
+ }
1011
+ read(e, t, n) {
1012
+ let s = 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;
1013
+ if (!e.length) return a(null, {});
1014
+ if (this.readingCalls >= this.maxParallelReads) {
1015
+ this.waitingReads.push({
1016
+ lng: e,
1017
+ ns: t,
1018
+ fcName: n,
1019
+ tried: s,
1020
+ wait: i,
1021
+ callback: a
1022
+ });
1023
+ return;
1024
+ }
1025
+ this.readingCalls++;
1026
+ const l = (u, d) => {
1027
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1028
+ const c = this.waitingReads.shift();
1029
+ this.read(c.lng, c.ns, c.fcName, c.tried, c.wait, c.callback);
1030
+ }
1031
+ if (u && d && s < this.maxRetries) {
1032
+ setTimeout(() => {
1033
+ this.read.call(this, e, t, n, s + 1, i * 2, a);
1034
+ }, i);
1035
+ return;
1036
+ }
1037
+ a(u, d);
1038
+ }, o = this.backend[n].bind(this.backend);
1039
+ if (o.length === 2) {
1040
+ try {
1041
+ const u = o(e, t);
1042
+ u && typeof u.then == "function" ? u.then((d) => l(null, d)).catch(l) : l(null, u);
1043
+ } catch (u) {
1044
+ l(u);
1045
+ }
1046
+ return;
1047
+ }
1048
+ return o(e, t, l);
1049
+ }
1050
+ prepareLoading(e, t) {
1051
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = arguments.length > 3 ? arguments[3] : void 0;
1052
+ if (!this.backend)
1053
+ return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
1054
+ h(e) && (e = this.languageUtils.toResolveHierarchy(e)), h(t) && (t = [t]);
1055
+ const i = this.queueLoad(e, t, n, s);
1056
+ if (!i.toLoad.length)
1057
+ return i.pending.length || s(), null;
1058
+ i.toLoad.forEach((a) => {
1059
+ this.loadOne(a);
1060
+ });
1061
+ }
1062
+ load(e, t, n) {
1063
+ this.prepareLoading(e, t, {}, n);
1064
+ }
1065
+ reload(e, t, n) {
1066
+ this.prepareLoading(e, t, {
1067
+ reload: !0
1068
+ }, n);
1069
+ }
1070
+ loadOne(e) {
1071
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1072
+ const n = e.split("|"), s = n[0], i = n[1];
1073
+ this.read(s, i, "read", void 0, void 0, (a, l) => {
1074
+ a && this.logger.warn(`${t}loading namespace ${i} for language ${s} failed`, a), !a && l && this.logger.log(`${t}loaded namespace ${i} for language ${s}`, l), this.loaded(e, a, l);
1075
+ });
1076
+ }
1077
+ saveMissing(e, t, n, s, i) {
1078
+ var o, u, d, c, f;
1079
+ let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, l = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1080
+ };
1081
+ if ((u = (o = this.services) == null ? void 0 : o.utils) != null && u.hasLoadedNamespace && !((c = (d = this.services) == null ? void 0 : d.utils) != null && c.hasLoadedNamespace(t))) {
1082
+ 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!!!");
1083
+ return;
1084
+ }
1085
+ if (!(n == null || n === "")) {
1086
+ if ((f = this.backend) != null && f.create) {
1087
+ const m = {
1088
+ ...a,
1089
+ isUpdate: i
1090
+ }, g = this.backend.create.bind(this.backend);
1091
+ if (g.length < 6)
1092
+ try {
1093
+ let p;
1094
+ g.length === 5 ? p = g(e, t, n, s, m) : p = g(e, t, n, s), p && typeof p.then == "function" ? p.then((x) => l(null, x)).catch(l) : l(null, p);
1095
+ } catch (p) {
1096
+ l(p);
1097
+ }
1098
+ else
1099
+ g(e, t, n, s, l, m);
1100
+ }
1101
+ !e || !e[0] || this.store.addResource(e[0], t, n, s);
1102
+ }
1103
+ }
1104
+ }
1105
+ const me = () => ({
1106
+ debug: !1,
1107
+ initAsync: !0,
1108
+ ns: ["translation"],
1109
+ defaultNS: ["translation"],
1110
+ fallbackLng: ["dev"],
1111
+ fallbackNS: !1,
1112
+ supportedLngs: !1,
1113
+ nonExplicitSupportedLngs: !1,
1114
+ load: "all",
1115
+ preload: !1,
1116
+ simplifyPluralSuffix: !0,
1117
+ keySeparator: ".",
1118
+ nsSeparator: ":",
1119
+ pluralSeparator: "_",
1120
+ contextSeparator: "_",
1121
+ partialBundledLanguages: !1,
1122
+ saveMissing: !1,
1123
+ updateMissing: !1,
1124
+ saveMissingTo: "fallback",
1125
+ saveMissingPlurals: !0,
1126
+ missingKeyHandler: !1,
1127
+ missingInterpolationHandler: !1,
1128
+ postProcess: !1,
1129
+ postProcessPassResolved: !1,
1130
+ returnNull: !1,
1131
+ returnEmptyString: !0,
1132
+ returnObjects: !1,
1133
+ joinArrays: !1,
1134
+ returnedObjectHandler: !1,
1135
+ parseMissingKeyHandler: !1,
1136
+ appendNamespaceToMissingKey: !1,
1137
+ appendNamespaceToCIMode: !1,
1138
+ overloadTranslationOptionHandler: (r) => {
1139
+ let e = {};
1140
+ if (typeof r[1] == "object" && (e = r[1]), h(r[1]) && (e.defaultValue = r[1]), h(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
1141
+ const t = r[3] || r[2];
1142
+ Object.keys(t).forEach((n) => {
1143
+ e[n] = t[n];
1144
+ });
1145
+ }
1146
+ return e;
1147
+ },
1148
+ interpolation: {
1149
+ escapeValue: !0,
1150
+ format: (r) => r,
1151
+ prefix: "{{",
1152
+ suffix: "}}",
1153
+ formatSeparator: ",",
1154
+ unescapePrefix: "-",
1155
+ nestingPrefix: "$t(",
1156
+ nestingSuffix: ")",
1157
+ nestingOptionsSeparator: ",",
1158
+ maxReplaces: 1e3,
1159
+ skipOnVariables: !0
1160
+ }
1161
+ }), xe = (r) => {
1162
+ var e, t;
1163
+ return h(r.ns) && (r.ns = [r.ns]), h(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), h(r.fallbackNS) && (r.fallbackNS = [r.fallbackNS]), ((t = (e = r.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), typeof r.initImmediate == "boolean" && (r.initAsync = r.initImmediate), r;
1164
+ }, W = () => {
1165
+ }, tt = (r) => {
1166
+ Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
1167
+ typeof r[t] == "function" && (r[t] = r[t].bind(r));
1168
+ });
1169
+ };
1170
+ class B extends Z {
1171
+ constructor() {
1172
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1173
+ if (super(), this.options = xe(e), this.services = {}, this.logger = P, this.modules = {
1174
+ external: []
1175
+ }, tt(this), t && !this.isInitialized && !e.isClone) {
1176
+ if (!this.options.initAsync)
1177
+ return this.init(e, t), this;
1178
+ setTimeout(() => {
1179
+ this.init(e, t);
1180
+ }, 0);
1181
+ }
1182
+ }
1183
+ init() {
1184
+ var e = this;
1185
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
1186
+ this.isInitializing = !0, typeof t == "function" && (n = t, t = {}), t.defaultNS == null && t.ns && (h(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1187
+ const s = me();
1188
+ this.options = {
1189
+ ...s,
1190
+ ...this.options,
1191
+ ...xe(t)
1192
+ }, this.options.interpolation = {
1193
+ ...s.interpolation,
1194
+ ...this.options.interpolation
1195
+ }, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1196
+ const i = (d) => d ? typeof d == "function" ? new d() : d : null;
1197
+ if (!this.options.isClone) {
1198
+ this.modules.logger ? P.init(i(this.modules.logger), this.options) : P.init(null, this.options);
1199
+ let d;
1200
+ this.modules.formatter ? d = this.modules.formatter : d = Xe;
1201
+ const c = new ce(this.options);
1202
+ this.store = new ue(this.options.resources, this.options);
1203
+ const f = this.services;
1204
+ f.logger = P, f.resourceStore = this.store, f.languageUtils = c, f.pluralResolver = new Ye(c, {
1205
+ prepend: this.options.pluralSeparator,
1206
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1207
+ }), d && (!this.options.interpolation.format || this.options.interpolation.format === s.interpolation.format) && (f.formatter = i(d), f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new Ge(this.options), f.utils = {
1208
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1209
+ }, f.backendConnector = new et(i(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", function(m) {
1210
+ for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), x = 1; x < g; x++)
1211
+ p[x - 1] = arguments[x];
1212
+ e.emit(m, ...p);
1213
+ }), this.modules.languageDetector && (f.languageDetector = i(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = i(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new G(this.services, this.options), this.translator.on("*", function(m) {
1214
+ for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), x = 1; x < g; x++)
1215
+ p[x - 1] = arguments[x];
1216
+ e.emit(m, ...p);
1217
+ }), this.modules.external.forEach((m) => {
1218
+ m.init && m.init(this);
1219
+ });
1220
+ }
1221
+ if (this.format = this.options.interpolation.format, n || (n = W), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1222
+ const d = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1223
+ d.length > 0 && d[0] !== "dev" && (this.options.lng = d[0]);
1224
+ }
1225
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((d) => {
1226
+ this[d] = function() {
1227
+ return e.store[d](...arguments);
1228
+ };
1229
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((d) => {
1230
+ this[d] = function() {
1231
+ return e.store[d](...arguments), e;
1232
+ };
1233
+ });
1234
+ const o = H(), u = () => {
1235
+ const d = (c, f) => {
1236
+ 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), o.resolve(f), n(c, f);
1237
+ };
1238
+ if (this.languages && !this.isInitialized) return d(null, this.t.bind(this));
1239
+ this.changeLanguage(this.options.lng, d);
1240
+ };
1241
+ return this.options.resources || !this.options.initAsync ? u() : setTimeout(u, 0), o;
1242
+ }
1243
+ loadResources(e) {
1244
+ var i, a;
1245
+ let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : W;
1246
+ const s = h(e) ? e : this.language;
1247
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1248
+ if ((s == null ? void 0 : s.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1249
+ const l = [], o = (u) => {
1250
+ if (!u || u === "cimode") return;
1251
+ this.services.languageUtils.toResolveHierarchy(u).forEach((c) => {
1252
+ c !== "cimode" && l.indexOf(c) < 0 && l.push(c);
1253
+ });
1254
+ };
1255
+ s ? o(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((d) => o(d)), (a = (i = this.options.preload) == null ? void 0 : i.forEach) == null || a.call(i, (u) => o(u)), this.services.backendConnector.load(l, this.options.ns, (u) => {
1256
+ !u && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(u);
1257
+ });
1258
+ } else
1259
+ n(null);
1260
+ }
1261
+ reloadResources(e, t, n) {
1262
+ const s = H();
1263
+ return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), n || (n = W), this.services.backendConnector.reload(e, t, (i) => {
1264
+ s.resolve(), n(i);
1265
+ }), s;
1266
+ }
1267
+ use(e) {
1268
+ if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1269
+ if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1270
+ 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" && ve.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1271
+ }
1272
+ setResolvedLanguage(e) {
1273
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1274
+ for (let t = 0; t < this.languages.length; t++) {
1275
+ const n = this.languages[t];
1276
+ if (!(["cimode", "dev"].indexOf(n) > -1) && this.store.hasLanguageSomeTranslations(n)) {
1277
+ this.resolvedLanguage = n;
1278
+ break;
1279
+ }
1280
+ }
1281
+ }
1282
+ changeLanguage(e, t) {
1283
+ var n = this;
1284
+ this.isLanguageChangingTo = e;
1285
+ const s = H();
1286
+ this.emit("languageChanging", e);
1287
+ const i = (o) => {
1288
+ this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
1289
+ }, a = (o, u) => {
1290
+ u ? (i(u), this.translator.changeLanguage(u), this.isLanguageChangingTo = void 0, this.emit("languageChanged", u), this.logger.log("languageChanged", u)) : this.isLanguageChangingTo = void 0, s.resolve(function() {
1291
+ return n.t(...arguments);
1292
+ }), t && t(o, function() {
1293
+ return n.t(...arguments);
1294
+ });
1295
+ }, l = (o) => {
1296
+ var d, c;
1297
+ !e && !o && this.services.languageDetector && (o = []);
1298
+ const u = h(o) ? o : this.services.languageUtils.getBestMatchFromCodes(o);
1299
+ u && (this.language || i(u), this.translator.language || this.translator.changeLanguage(u), (c = (d = this.services.languageDetector) == null ? void 0 : d.cacheUserLanguage) == null || c.call(d, u)), this.loadResources(u, (f) => {
1300
+ a(f, u);
1301
+ });
1302
+ };
1303
+ 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;
1304
+ }
1305
+ getFixedT(e, t, n) {
1306
+ var s = this;
1307
+ const i = function(a, l) {
1308
+ let o;
1309
+ if (typeof l != "object") {
1310
+ for (var u = arguments.length, d = new Array(u > 2 ? u - 2 : 0), c = 2; c < u; c++)
1311
+ d[c - 2] = arguments[c];
1312
+ o = s.options.overloadTranslationOptionHandler([a, l].concat(d));
1313
+ } else
1314
+ o = {
1315
+ ...l
1316
+ };
1317
+ o.lng = o.lng || i.lng, o.lngs = o.lngs || i.lngs, o.ns = o.ns || i.ns, o.keyPrefix !== "" && (o.keyPrefix = o.keyPrefix || n || i.keyPrefix);
1318
+ const f = s.options.keySeparator || ".";
1319
+ let m;
1320
+ return o.keyPrefix && Array.isArray(a) ? m = a.map((g) => `${o.keyPrefix}${f}${g}`) : m = o.keyPrefix ? `${o.keyPrefix}${f}${a}` : a, s.t(m, o);
1321
+ };
1322
+ return h(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = n, i;
1323
+ }
1324
+ t() {
1325
+ var s;
1326
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1327
+ t[n] = arguments[n];
1328
+ return (s = this.translator) == null ? void 0 : s.translate(...t);
1329
+ }
1330
+ exists() {
1331
+ var s;
1332
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1333
+ t[n] = arguments[n];
1334
+ return (s = this.translator) == null ? void 0 : s.exists(...t);
1335
+ }
1336
+ setDefaultNamespace(e) {
1337
+ this.options.defaultNS = e;
1338
+ }
1339
+ hasLoadedNamespace(e) {
1340
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1341
+ if (!this.isInitialized)
1342
+ return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1343
+ if (!this.languages || !this.languages.length)
1344
+ return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1345
+ const n = t.lng || this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1346
+ if (n.toLowerCase() === "cimode") return !0;
1347
+ const a = (l, o) => {
1348
+ const u = this.services.backendConnector.state[`${l}|${o}`];
1349
+ return u === -1 || u === 0 || u === 2;
1350
+ };
1351
+ if (t.precheck) {
1352
+ const l = t.precheck(this, a);
1353
+ if (l !== void 0) return l;
1354
+ }
1355
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!s || a(i, e)));
1356
+ }
1357
+ loadNamespaces(e, t) {
1358
+ const n = H();
1359
+ return this.options.ns ? (h(e) && (e = [e]), e.forEach((s) => {
1360
+ this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
1361
+ }), this.loadResources((s) => {
1362
+ n.resolve(), t && t(s);
1363
+ }), n) : (t && t(), Promise.resolve());
1364
+ }
1365
+ loadLanguages(e, t) {
1366
+ const n = H();
1367
+ h(e) && (e = [e]);
1368
+ const s = this.options.preload || [], i = e.filter((a) => s.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
1369
+ return i.length ? (this.options.preload = s.concat(i), this.loadResources((a) => {
1370
+ n.resolve(), t && t(a);
1371
+ }), n) : (t && t(), Promise.resolve());
1372
+ }
1373
+ dir(e) {
1374
+ var s, i;
1375
+ if (e || (e = this.resolvedLanguage || (((s = this.languages) == null ? void 0 : s.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1376
+ 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 = ((i = this.services) == null ? void 0 : i.languageUtils) || new ce(me());
1377
+ return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1378
+ }
1379
+ static createInstance() {
1380
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1381
+ return new B(e, t);
1382
+ }
1383
+ cloneInstance() {
1384
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : W;
1385
+ const n = e.forkResourceStore;
1386
+ n && delete e.forkResourceStore;
1387
+ const s = {
1388
+ ...this.options,
1389
+ ...e,
1390
+ isClone: !0
1391
+ }, i = new B(s);
1392
+ if ((e.debug !== void 0 || e.prefix !== void 0) && (i.logger = i.logger.clone(e)), ["store", "services", "language"].forEach((l) => {
1393
+ i[l] = this[l];
1394
+ }), i.services = {
1395
+ ...this.services
1396
+ }, i.services.utils = {
1397
+ hasLoadedNamespace: i.hasLoadedNamespace.bind(i)
1398
+ }, n) {
1399
+ const l = Object.keys(this.store.data).reduce((o, u) => (o[u] = {
1400
+ ...this.store.data[u]
1401
+ }, Object.keys(o[u]).reduce((d, c) => (d[c] = {
1402
+ ...o[u][c]
1403
+ }, d), {})), {});
1404
+ i.store = new ue(l, s), i.services.resourceStore = i.store;
1405
+ }
1406
+ return i.translator = new G(i.services, s), i.translator.on("*", function(l) {
1407
+ for (var o = arguments.length, u = new Array(o > 1 ? o - 1 : 0), d = 1; d < o; d++)
1408
+ u[d - 1] = arguments[d];
1409
+ i.emit(l, ...u);
1410
+ }), i.init(s, t), i.translator.options = s, i.translator.backendConnector.services.utils = {
1411
+ hasLoadedNamespace: i.hasLoadedNamespace.bind(i)
1412
+ }, i;
1413
+ }
1414
+ toJSON() {
1415
+ return {
1416
+ options: this.options,
1417
+ store: this.store,
1418
+ language: this.language,
1419
+ languages: this.languages,
1420
+ resolvedLanguage: this.resolvedLanguage
1421
+ };
1422
+ }
1423
+ }
1424
+ const S = B.createInstance();
1425
+ S.createInstance = B.createInstance;
1426
+ S.createInstance;
1427
+ S.dir;
1428
+ S.init;
1429
+ S.loadResources;
1430
+ S.reloadResources;
1431
+ S.use;
1432
+ S.changeLanguage;
1433
+ S.getFixedT;
1434
+ S.t;
1435
+ S.exists;
1436
+ S.setDefaultNamespace;
1437
+ S.hasLoadedNamespace;
1438
+ S.loadNamespaces;
1439
+ S.loadLanguages;
1440
+ const {
1441
+ slice: nt,
1442
+ forEach: st
1443
+ } = [];
1444
+ function it(r) {
1445
+ return st.call(nt.call(arguments, 1), (e) => {
1446
+ if (e)
1447
+ for (const t in e)
1448
+ r[t] === void 0 && (r[t] = e[t]);
1449
+ }), r;
1450
+ }
1451
+ const ye = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, rt = function(r, e) {
1452
+ const n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
1453
+ path: "/"
1454
+ }, s = encodeURIComponent(e);
1455
+ let i = `${r}=${s}`;
1456
+ if (n.maxAge > 0) {
1457
+ const a = n.maxAge - 0;
1458
+ if (Number.isNaN(a)) throw new Error("maxAge should be a Number");
1459
+ i += `; Max-Age=${Math.floor(a)}`;
1460
+ }
1461
+ if (n.domain) {
1462
+ if (!ye.test(n.domain))
1463
+ throw new TypeError("option domain is invalid");
1464
+ i += `; Domain=${n.domain}`;
1465
+ }
1466
+ if (n.path) {
1467
+ if (!ye.test(n.path))
1468
+ throw new TypeError("option path is invalid");
1469
+ i += `; Path=${n.path}`;
1470
+ }
1471
+ if (n.expires) {
1472
+ if (typeof n.expires.toUTCString != "function")
1473
+ throw new TypeError("option expires is invalid");
1474
+ i += `; Expires=${n.expires.toUTCString()}`;
1475
+ }
1476
+ if (n.httpOnly && (i += "; HttpOnly"), n.secure && (i += "; Secure"), n.sameSite)
1477
+ switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
1478
+ case !0:
1479
+ i += "; SameSite=Strict";
1480
+ break;
1481
+ case "lax":
1482
+ i += "; SameSite=Lax";
1483
+ break;
1484
+ case "strict":
1485
+ i += "; SameSite=Strict";
1486
+ break;
1487
+ case "none":
1488
+ i += "; SameSite=None";
1489
+ break;
1490
+ default:
1491
+ throw new TypeError("option sameSite is invalid");
1492
+ }
1493
+ return i;
1494
+ }, Se = {
1495
+ create(r, e, t, n) {
1496
+ let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
1497
+ path: "/",
1498
+ sameSite: "strict"
1499
+ };
1500
+ t && (s.expires = /* @__PURE__ */ new Date(), s.expires.setTime(s.expires.getTime() + t * 60 * 1e3)), n && (s.domain = n), document.cookie = rt(r, encodeURIComponent(e), s);
1501
+ },
1502
+ read(r) {
1503
+ const e = `${r}=`, t = document.cookie.split(";");
1504
+ for (let n = 0; n < t.length; n++) {
1505
+ let s = t[n];
1506
+ for (; s.charAt(0) === " "; ) s = s.substring(1, s.length);
1507
+ if (s.indexOf(e) === 0) return s.substring(e.length, s.length);
1508
+ }
1509
+ return null;
1510
+ },
1511
+ remove(r) {
1512
+ this.create(r, "", -1);
1513
+ }
1514
+ };
1515
+ var at = {
1516
+ name: "cookie",
1517
+ // Deconstruct the options object and extract the lookupCookie property
1518
+ lookup(r) {
1519
+ let {
1520
+ lookupCookie: e
1521
+ } = r;
1522
+ if (e && typeof document < "u")
1523
+ return Se.read(e) || void 0;
1524
+ },
1525
+ // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
1526
+ cacheUserLanguage(r, e) {
1527
+ let {
1528
+ lookupCookie: t,
1529
+ cookieMinutes: n,
1530
+ cookieDomain: s,
1531
+ cookieOptions: i
1532
+ } = e;
1533
+ t && typeof document < "u" && Se.create(t, r, n, s, i);
1534
+ }
1535
+ }, ot = {
1536
+ name: "querystring",
1537
+ // Deconstruct the options object and extract the lookupQuerystring property
1538
+ lookup(r) {
1539
+ var n;
1540
+ let {
1541
+ lookupQuerystring: e
1542
+ } = r, t;
1543
+ if (typeof window < "u") {
1544
+ let {
1545
+ search: s
1546
+ } = window.location;
1547
+ !window.location.search && ((n = window.location.hash) == null ? void 0 : n.indexOf("?")) > -1 && (s = window.location.hash.substring(window.location.hash.indexOf("?")));
1548
+ const a = s.substring(1).split("&");
1549
+ for (let l = 0; l < a.length; l++) {
1550
+ const o = a[l].indexOf("=");
1551
+ o > 0 && a[l].substring(0, o) === e && (t = a[l].substring(o + 1));
1552
+ }
1553
+ }
1554
+ return t;
1555
+ }
1556
+ };
1557
+ let A = null;
1558
+ const be = () => {
1559
+ if (A !== null) return A;
1560
+ try {
1561
+ if (A = typeof window < "u" && window.localStorage !== null, !A)
1562
+ return !1;
1563
+ const r = "i18next.translate.boo";
1564
+ window.localStorage.setItem(r, "foo"), window.localStorage.removeItem(r);
1565
+ } catch {
1566
+ A = !1;
1567
+ }
1568
+ return A;
1569
+ };
1570
+ var lt = {
1571
+ name: "localStorage",
1572
+ // Deconstruct the options object and extract the lookupLocalStorage property
1573
+ lookup(r) {
1574
+ let {
1575
+ lookupLocalStorage: e
1576
+ } = r;
1577
+ if (e && be())
1578
+ return window.localStorage.getItem(e) || void 0;
1579
+ },
1580
+ // Deconstruct the options object and extract the lookupLocalStorage property
1581
+ cacheUserLanguage(r, e) {
1582
+ let {
1583
+ lookupLocalStorage: t
1584
+ } = e;
1585
+ t && be() && window.localStorage.setItem(t, r);
1586
+ }
1587
+ };
1588
+ let T = null;
1589
+ const we = () => {
1590
+ if (T !== null) return T;
1591
+ try {
1592
+ if (T = typeof window < "u" && window.sessionStorage !== null, !T)
1593
+ return !1;
1594
+ const r = "i18next.translate.boo";
1595
+ window.sessionStorage.setItem(r, "foo"), window.sessionStorage.removeItem(r);
1596
+ } catch {
1597
+ T = !1;
1598
+ }
1599
+ return T;
1600
+ };
1601
+ var ut = {
1602
+ name: "sessionStorage",
1603
+ lookup(r) {
1604
+ let {
1605
+ lookupSessionStorage: e
1606
+ } = r;
1607
+ if (e && we())
1608
+ return window.sessionStorage.getItem(e) || void 0;
1609
+ },
1610
+ cacheUserLanguage(r, e) {
1611
+ let {
1612
+ lookupSessionStorage: t
1613
+ } = e;
1614
+ t && we() && window.sessionStorage.setItem(t, r);
1615
+ }
1616
+ }, ft = {
1617
+ name: "navigator",
1618
+ lookup(r) {
1619
+ const e = [];
1620
+ if (typeof navigator < "u") {
1621
+ const {
1622
+ languages: t,
1623
+ userLanguage: n,
1624
+ language: s
1625
+ } = navigator;
1626
+ if (t)
1627
+ for (let i = 0; i < t.length; i++)
1628
+ e.push(t[i]);
1629
+ n && e.push(n), s && e.push(s);
1630
+ }
1631
+ return e.length > 0 ? e : void 0;
1632
+ }
1633
+ }, dt = {
1634
+ name: "htmlTag",
1635
+ // Deconstruct the options object and extract the htmlTag property
1636
+ lookup(r) {
1637
+ let {
1638
+ htmlTag: e
1639
+ } = r, t;
1640
+ const n = e || (typeof document < "u" ? document.documentElement : null);
1641
+ return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
1642
+ }
1643
+ }, ct = {
1644
+ name: "path",
1645
+ // Deconstruct the options object and extract the lookupFromPathIndex property
1646
+ lookup(r) {
1647
+ var s;
1648
+ let {
1649
+ lookupFromPathIndex: e
1650
+ } = r;
1651
+ if (typeof window > "u") return;
1652
+ const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
1653
+ return Array.isArray(t) ? (s = t[typeof e == "number" ? e : 0]) == null ? void 0 : s.replace("/", "") : void 0;
1654
+ }
1655
+ }, gt = {
1656
+ name: "subdomain",
1657
+ lookup(r) {
1658
+ var s, i;
1659
+ let {
1660
+ lookupFromSubdomainIndex: e
1661
+ } = r;
1662
+ const t = typeof e == "number" ? e + 1 : 1, n = typeof window < "u" && ((i = (s = window.location) == null ? void 0 : s.hostname) == null ? void 0 : i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));
1663
+ if (n)
1664
+ return n[t];
1665
+ }
1666
+ };
1667
+ let Ce = !1;
1668
+ try {
1669
+ document.cookie, Ce = !0;
1670
+ } catch {
1671
+ }
1672
+ const ke = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
1673
+ Ce || ke.splice(1, 1);
1674
+ const ht = () => ({
1675
+ order: ke,
1676
+ lookupQuerystring: "lng",
1677
+ lookupCookie: "i18next",
1678
+ lookupLocalStorage: "i18nextLng",
1679
+ lookupSessionStorage: "i18nextLng",
1680
+ // cache user language
1681
+ caches: ["localStorage"],
1682
+ excludeCacheFor: ["cimode"],
1683
+ // cookieMinutes: 10,
1684
+ // cookieDomain: 'myDomain'
1685
+ convertDetectedLanguage: (r) => r
1686
+ });
1687
+ class $e {
1688
+ constructor(e) {
1689
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1690
+ this.type = "languageDetector", this.detectors = {}, this.init(e, t);
1691
+ }
1692
+ init() {
1693
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1694
+ languageUtils: {}
1695
+ }, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1696
+ this.services = e, this.options = it(t, this.options || {}, ht()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (s) => s.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(at), this.addDetector(ot), this.addDetector(lt), this.addDetector(ut), this.addDetector(ft), this.addDetector(dt), this.addDetector(ct), this.addDetector(gt);
1697
+ }
1698
+ addDetector(e) {
1699
+ return this.detectors[e.name] = e, this;
1700
+ }
1701
+ detect() {
1702
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
1703
+ return e.forEach((n) => {
1704
+ if (this.detectors[n]) {
1705
+ let s = this.detectors[n].lookup(this.options);
1706
+ s && typeof s == "string" && (s = [s]), s && (t = t.concat(s));
1707
+ }
1708
+ }), t = t.map((n) => this.options.convertDetectedLanguage(n)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
1709
+ }
1710
+ cacheUserLanguage(e) {
1711
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
1712
+ t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach((n) => {
1713
+ this.detectors[n] && this.detectors[n].cacheUserLanguage(e, this.options);
1714
+ }));
1715
+ }
1716
+ }
1717
+ $e.type = "languageDetector";
1718
+ const pt = S.createInstance();
1719
+ pt.use($e).use(Te).init({
1720
+ lng: "en",
1721
+ fallbackLng: "en",
1722
+ debug: !0,
1723
+ resources: {
1724
+ en: { translation: Re },
1725
+ es: { translation: Pe },
1726
+ tr: { translation: Ne }
1727
+ },
1728
+ returnObjects: !0,
1729
+ returnNull: !1,
1730
+ interpolation: {
1731
+ escapeValue: !1
1732
+ // not needed for react as it escapes by default
1733
+ }
1734
+ });
1735
+ export {
1736
+ St as a,
1737
+ bt as g,
1738
+ pt as i
1739
+ };