@ogcio/design-system-react 1.22.1 → 1.24.0

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