@prosopo/client-bundle-example 2.8.1 → 2.9.4

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 (131) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +3 -2
  3. package/dist/assets/{captcha-BhkVCEXM.css → captcha-DAWM1slf.css} +1 -1
  4. package/dist/assets/{frictionless-explicit-C_AXK63E.js → frictionless-explicit-CtnTw8dK.js} +1 -1
  5. package/dist/assets/{frictionless-implicit-Dq_sNGRK.js → frictionless-implicit-BH7anfOq.js} +1 -1
  6. package/dist/assets/{image-explicit-DQvfVB7-.js → image-explicit-Dm_JoW0N.js} +1 -1
  7. package/dist/assets/image-implicit-M0Y7U93R.js +1 -0
  8. package/dist/assets/{index-Dpt_5E72.js → index-Ck5HfpfQ.js} +1 -1
  9. package/dist/assets/{invisible-frictionless-explicit-DugBtRe4.js → invisible-frictionless-explicit-CSPYfcNr.js} +1 -1
  10. package/dist/assets/{invisible-frictionless-implicit-DYYos8W9.js → invisible-frictionless-implicit-D0saDt4U.js} +1 -1
  11. package/dist/assets/{invisible-image-explicit-C5Z4gSb1.js → invisible-image-explicit-erOMAo-F.js} +1 -1
  12. package/dist/assets/{invisible-image-implicit-DfNFNlFj.js → invisible-image-implicit-c0sMfk2s.js} +1 -1
  13. package/dist/assets/{invisible-pow-explicit-DjqGWFUb.js → invisible-pow-explicit-BgMt7lhN.js} +1 -1
  14. package/dist/assets/{invisible-pow-implicit-BRXL14FH.js → invisible-pow-implicit-CnxS8gw2.js} +1 -1
  15. package/dist/assets/{pow-explicit-BexxbnHM.js → pow-explicit-BgDWNJK9.js} +1 -1
  16. package/dist/assets/{pow-implicit-Dpt_5E72.js → pow-implicit-Ck5HfpfQ.js} +1 -1
  17. package/dist/cjs/index.cjs +1 -0
  18. package/dist/frictionless-explicit.html +8 -8
  19. package/dist/frictionless-implicit.html +7 -7
  20. package/dist/image-explicit.html +4 -4
  21. package/dist/index.html +4 -4
  22. package/dist/invisible-frictionless-explicit.html +4 -4
  23. package/dist/invisible-frictionless-implicit.html +4 -4
  24. package/dist/invisible-image-explicit.html +4 -4
  25. package/dist/invisible-image-implicit.html +4 -4
  26. package/dist/invisible-pow-explicit.html +4 -4
  27. package/dist/invisible-pow-implicit.html +4 -4
  28. package/dist/plugins/navigation-injector.ts +1 -1
  29. package/dist/pow-explicit.html +4 -4
  30. package/dist/pow-implicit.html +4 -4
  31. package/env.staging +6 -0
  32. package/package.json +29 -16
  33. package/vite.cjs.config.ts +22 -0
  34. package/vite.config.ts +21 -2
  35. package/vite.esm.config.ts +20 -0
  36. package/dist/assets/ProcaptchaWidget-DrBDhP6X.js +0 -636
  37. package/dist/assets/ProcaptchaWidget-rAM-9Rap.js +0 -360
  38. package/dist/assets/Signer-DP9drQ55.js +0 -23
  39. package/dist/assets/_commonjsHelpers-DaMA6jEr.js +0 -8
  40. package/dist/assets/asU8a-CJdNkNEq.js +0 -9
  41. package/dist/assets/bip39-Du2cANEV.js +0 -365
  42. package/dist/assets/browser-ponyfill-Dy1JBTMg.js +0 -339
  43. package/dist/assets/captchaComponentProvider-DmV1WTrT.js +0 -1242
  44. package/dist/assets/captchaRenderer-RIsSZXCC.js +0 -70
  45. package/dist/assets/components.d.ts +0 -5
  46. package/dist/assets/components.d.ts.map +0 -1
  47. package/dist/assets/emotion-element-5486c51c.browser.esm-C3u8NMUC.js +0 -1807
  48. package/dist/assets/fp.esm-DYWeNGcH.js +0 -1654
  49. package/dist/assets/hash-_rWungeW.js +0 -1268
  50. package/dist/assets/i18nFrontend-CsPT71ro.js +0 -2273
  51. package/dist/assets/image-implicit-Bwa9QJO5.js +0 -1
  52. package/dist/assets/index-BVr9fC_3.js +0 -4386
  53. package/dist/assets/index-BjRdPnnE.js +0 -1198
  54. package/dist/assets/index-Cu5oL_7b.js +0 -81
  55. package/dist/assets/index-DxIFpl6U.js +0 -5416
  56. package/dist/assets/index-QVME9Prx.js +0 -32
  57. package/dist/assets/index-Wgw2GQWq.js +0 -596
  58. package/dist/assets/index.d.ts +0 -16
  59. package/dist/assets/index.d.ts.map +0 -1
  60. package/dist/assets/locales/ar/translation.json +0 -56
  61. package/dist/assets/locales/az/translation.json +0 -56
  62. package/dist/assets/locales/cs/translation.json +0 -56
  63. package/dist/assets/locales/de/translation.json +0 -56
  64. package/dist/assets/locales/el/translation.json +0 -56
  65. package/dist/assets/locales/en/translation.json +0 -56
  66. package/dist/assets/locales/es/translation.json +0 -56
  67. package/dist/assets/locales/fi/translation.json +0 -56
  68. package/dist/assets/locales/fr/translation.json +0 -56
  69. package/dist/assets/locales/hi/translation.json +0 -56
  70. package/dist/assets/locales/hu/translation.json +0 -56
  71. package/dist/assets/locales/id/translation.json +0 -56
  72. package/dist/assets/locales/it/translation.json +0 -56
  73. package/dist/assets/locales/ja/translation.json +0 -56
  74. package/dist/assets/locales/jv/translation.json +0 -56
  75. package/dist/assets/locales/ko/translation.json +0 -56
  76. package/dist/assets/locales/ml/translation.json +0 -56
  77. package/dist/assets/locales/ms/translation.json +0 -56
  78. package/dist/assets/locales/nl/translation.json +0 -56
  79. package/dist/assets/locales/no/translation.json +0 -56
  80. package/dist/assets/locales/pl/translation.json +0 -56
  81. package/dist/assets/locales/pt/translation.json +0 -56
  82. package/dist/assets/locales/pt-br/translation.json +0 -56
  83. package/dist/assets/locales/ro/translation.json +0 -56
  84. package/dist/assets/locales/ru/translation.json +0 -56
  85. package/dist/assets/locales/sr/translation.json +0 -56
  86. package/dist/assets/locales/sv/translation.json +0 -56
  87. package/dist/assets/locales/th/translation.json +0 -56
  88. package/dist/assets/locales/tr/translation.json +0 -56
  89. package/dist/assets/locales/uk/translation.json +0 -56
  90. package/dist/assets/locales/vi/translation.json +0 -56
  91. package/dist/assets/locales/zh-cn/translation.json +0 -56
  92. package/dist/assets/procaptcha.bundle.js +0 -7
  93. package/dist/assets/spread-DEmVz7RJ.js +0 -15
  94. package/dist/assets/tests/util/captchaType.test.d.ts +0 -2
  95. package/dist/assets/tests/util/captchaType.test.d.ts.map +0 -1
  96. package/dist/assets/tests/util/config.test.d.ts +0 -2
  97. package/dist/assets/tests/util/config.test.d.ts.map +0 -1
  98. package/dist/assets/tests/util/renderLogic.test.d.ts +0 -2
  99. package/dist/assets/tests/util/renderLogic.test.d.ts.map +0 -1
  100. package/dist/assets/toU8a-C68WUzs_.js +0 -24
  101. package/dist/assets/translations-DEL070wJ.js +0 -2918
  102. package/dist/assets/useTranslation-CJplXtqb.js +0 -158
  103. package/dist/assets/util/captcha/captchaComponentProvider.d.ts +0 -8
  104. package/dist/assets/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  105. package/dist/assets/util/captcha/captchaComponentsList.d.ts +0 -6
  106. package/dist/assets/util/captcha/captchaComponentsList.d.ts.map +0 -1
  107. package/dist/assets/util/captcha/captchaProps.d.ts +0 -9
  108. package/dist/assets/util/captcha/captchaProps.d.ts.map +0 -1
  109. package/dist/assets/util/captcha/captchaRenderer.d.ts +0 -24
  110. package/dist/assets/util/captcha/captchaRenderer.d.ts.map +0 -1
  111. package/dist/assets/util/captcha/captchaType.d.ts +0 -2
  112. package/dist/assets/util/captcha/captchaType.d.ts.map +0 -1
  113. package/dist/assets/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  114. package/dist/assets/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  115. package/dist/assets/util/captcha/components/imageCaptcha.d.ts +0 -4
  116. package/dist/assets/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  117. package/dist/assets/util/captcha/components/powCaptcha.d.ts +0 -4
  118. package/dist/assets/util/captcha/components/powCaptcha.d.ts.map +0 -1
  119. package/dist/assets/util/config.d.ts +0 -6
  120. package/dist/assets/util/config.d.ts.map +0 -1
  121. package/dist/assets/util/configCreator.d.ts +0 -5
  122. package/dist/assets/util/configCreator.d.ts.map +0 -1
  123. package/dist/assets/util/language.d.ts +0 -3
  124. package/dist/assets/util/language.d.ts.map +0 -1
  125. package/dist/assets/util/timeout.d.ts +0 -3
  126. package/dist/assets/util/timeout.d.ts.map +0 -1
  127. package/dist/assets/util/widgetFactory.d.ts +0 -18
  128. package/dist/assets/util/widgetFactory.d.ts.map +0 -1
  129. package/dist/assets/util/widgetThemeResolver.d.ts +0 -9
  130. package/dist/assets/util/widgetThemeResolver.d.ts.map +0 -1
  131. /package/dist/assets/{captcha-ByKnSsbG.js → captcha-BaCo3bEP.js} +0 -0
@@ -1,2273 +0,0 @@
1
- import { h as Ye, L as Ze } from "./translations-DEL070wJ.js";
2
- const _e = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, et = {
3
- "&": "&",
4
- "&": "&",
5
- "&lt;": "<",
6
- "&#60;": "<",
7
- "&gt;": ">",
8
- "&#62;": ">",
9
- "&apos;": "'",
10
- "&#39;": "'",
11
- "&quot;": '"',
12
- "&#34;": '"',
13
- "&nbsp;": " ",
14
- "&#160;": " ",
15
- "&copy;": "©",
16
- "&#169;": "©",
17
- "&reg;": "®",
18
- "&#174;": "®",
19
- "&hellip;": "…",
20
- "&#8230;": "…",
21
- "&#x2F;": "/",
22
- "&#47;": "/"
23
- }, tt = (r) => et[r], nt = (r) => r.replace(_e, tt);
24
- let ae = {
25
- bindI18n: "languageChanged",
26
- bindI18nStore: "",
27
- transEmptyNodeValue: "",
28
- transSupportBasicHtmlNodes: !0,
29
- transWrapTextNodes: "",
30
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
31
- useSuspense: !0,
32
- unescape: nt
33
- };
34
- const it = (r = {}) => {
35
- ae = {
36
- ...ae,
37
- ...r
38
- };
39
- }, fn = () => ae;
40
- let Ue;
41
- const rt = (r) => {
42
- Ue = r;
43
- }, cn = () => Ue, st = {
44
- type: "3rdParty",
45
- init(r) {
46
- it(r.options.react), rt(r);
47
- }
48
- }, m = (r) => typeof r == "string", V = () => {
49
- let r, e;
50
- const t = new Promise((n, i) => {
51
- r = n, e = i;
52
- });
53
- return t.resolve = r, t.reject = e, t;
54
- }, ge = (r) => r == null ? "" : "" + r, at = (r, e, t) => {
55
- r.forEach((n) => {
56
- e[n] && (t[n] = e[n]);
57
- });
58
- }, ot = /###/g, pe = (r) => r && r.indexOf("###") > -1 ? r.replace(ot, ".") : r, me = (r) => !r || m(r), z = (r, e, t) => {
59
- const n = m(e) ? e.split(".") : e;
60
- let i = 0;
61
- for (; i < n.length - 1; ) {
62
- if (me(r)) return {};
63
- const s = pe(n[i]);
64
- !r[s] && t && (r[s] = new t()), Object.prototype.hasOwnProperty.call(r, s) ? r = r[s] : r = {}, ++i;
65
- }
66
- return me(r) ? {} : {
67
- obj: r,
68
- k: pe(n[i])
69
- };
70
- }, ye = (r, e, t) => {
71
- const {
72
- obj: n,
73
- k: i
74
- } = z(r, e, Object);
75
- if (n !== void 0 || e.length === 1) {
76
- n[i] = t;
77
- return;
78
- }
79
- let s = e[e.length - 1], a = e.slice(0, e.length - 1), o = z(r, a, Object);
80
- for (; o.obj === void 0 && a.length; )
81
- s = `${a[a.length - 1]}.${s}`, a = a.slice(0, a.length - 1), o = z(r, a, Object), o != null && o.obj && typeof o.obj[`${o.k}.${s}`] < "u" && (o.obj = void 0);
82
- o.obj[`${o.k}.${s}`] = t;
83
- }, ut = (r, e, t, n) => {
84
- const {
85
- obj: i,
86
- k: s
87
- } = z(r, e, Object);
88
- i[s] = i[s] || [], i[s].push(t);
89
- }, Z = (r, e) => {
90
- const {
91
- obj: t,
92
- k: n
93
- } = z(r, e);
94
- if (t && Object.prototype.hasOwnProperty.call(t, n))
95
- return t[n];
96
- }, lt = (r, e, t) => {
97
- const n = Z(r, t);
98
- return n !== void 0 ? n : Z(e, t);
99
- }, Me = (r, e, t) => {
100
- for (const n in e)
101
- n !== "__proto__" && n !== "constructor" && (n in r ? m(r[n]) || r[n] instanceof String || m(e[n]) || e[n] instanceof String ? t && (r[n] = e[n]) : Me(r[n], e[n], t) : r[n] = e[n]);
102
- return r;
103
- }, D = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
104
- var ft = {
105
- "&": "&amp;",
106
- "<": "&lt;",
107
- ">": "&gt;",
108
- '"': "&quot;",
109
- "'": "&#39;",
110
- "/": "&#x2F;"
111
- };
112
- const ct = (r) => m(r) ? r.replace(/[&<>"'\/]/g, (e) => ft[e]) : r;
113
- class dt {
114
- constructor(e) {
115
- this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
116
- }
117
- getRegExp(e) {
118
- const t = this.regExpMap.get(e);
119
- if (t !== void 0)
120
- return t;
121
- const n = new RegExp(e);
122
- return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
123
- }
124
- }
125
- const ht = [" ", ",", "?", "!", ";"], gt = new dt(20), pt = (r, e, t) => {
126
- e = e || "", t = t || "";
127
- const n = ht.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
128
- if (n.length === 0) return !0;
129
- const i = gt.getRegExp(`(${n.map((a) => a === "?" ? "\\?" : a).join("|")})`);
130
- let s = !i.test(r);
131
- if (!s) {
132
- const a = r.indexOf(t);
133
- a > 0 && !i.test(r.substring(0, a)) && (s = !0);
134
- }
135
- return s;
136
- }, oe = function(r, e) {
137
- let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
138
- if (!r) return;
139
- if (r[e])
140
- return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
141
- const n = e.split(t);
142
- let i = r;
143
- for (let s = 0; s < n.length; ) {
144
- if (!i || typeof i != "object")
145
- return;
146
- let a, o = "";
147
- for (let u = s; u < n.length; ++u)
148
- if (u !== s && (o += t), o += n[u], a = i[o], a !== void 0) {
149
- if (["string", "number", "boolean"].indexOf(typeof a) > -1 && u < n.length - 1)
150
- continue;
151
- s += u - s + 1;
152
- break;
153
- }
154
- i = a;
155
- }
156
- return i;
157
- }, _ = (r) => r == null ? void 0 : r.replace("_", "-"), mt = {
158
- type: "logger",
159
- log(r) {
160
- this.output("log", r);
161
- },
162
- warn(r) {
163
- this.output("warn", r);
164
- },
165
- error(r) {
166
- this.output("error", r);
167
- },
168
- output(r, e) {
169
- var t, n;
170
- (n = (t = console == null ? void 0 : console[r]) == null ? void 0 : t.apply) == null || n.call(t, console, e);
171
- }
172
- };
173
- class ee {
174
- constructor(e) {
175
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
176
- this.init(e, t);
177
- }
178
- init(e) {
179
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
180
- this.prefix = t.prefix || "i18next:", this.logger = e || mt, this.options = t, this.debug = t.debug;
181
- }
182
- log() {
183
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
184
- t[n] = arguments[n];
185
- return this.forward(t, "log", "", !0);
186
- }
187
- warn() {
188
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
189
- t[n] = arguments[n];
190
- return this.forward(t, "warn", "", !0);
191
- }
192
- error() {
193
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
194
- t[n] = arguments[n];
195
- return this.forward(t, "error", "");
196
- }
197
- deprecate() {
198
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
199
- t[n] = arguments[n];
200
- return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
201
- }
202
- forward(e, t, n, i) {
203
- return i && !this.debug ? null : (m(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
204
- }
205
- create(e) {
206
- return new ee(this.logger, {
207
- prefix: `${this.prefix}:${e}:`,
208
- ...this.options
209
- });
210
- }
211
- clone(e) {
212
- return e = e || this.options, e.prefix = e.prefix || this.prefix, new ee(this.logger, e);
213
- }
214
- }
215
- var $ = new ee();
216
- class ie {
217
- constructor() {
218
- this.observers = {};
219
- }
220
- on(e, t) {
221
- return e.split(" ").forEach((n) => {
222
- this.observers[n] || (this.observers[n] = /* @__PURE__ */ new Map());
223
- const i = this.observers[n].get(t) || 0;
224
- this.observers[n].set(t, i + 1);
225
- }), this;
226
- }
227
- off(e, t) {
228
- if (this.observers[e]) {
229
- if (!t) {
230
- delete this.observers[e];
231
- return;
232
- }
233
- this.observers[e].delete(t);
234
- }
235
- }
236
- emit(e) {
237
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
238
- n[i - 1] = arguments[i];
239
- this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
240
- let [o, u] = a;
241
- for (let f = 0; f < u; f++)
242
- o(...n);
243
- }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
244
- let [o, u] = a;
245
- for (let f = 0; f < u; f++)
246
- o.apply(o, [e, ...n]);
247
- });
248
- }
249
- }
250
- class be extends ie {
251
- constructor(e) {
252
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
253
- ns: ["translation"],
254
- defaultNS: "translation"
255
- };
256
- super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
257
- }
258
- addNamespaces(e) {
259
- this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
260
- }
261
- removeNamespaces(e) {
262
- const t = this.options.ns.indexOf(e);
263
- t > -1 && this.options.ns.splice(t, 1);
264
- }
265
- getResource(e, t, n) {
266
- var f, l;
267
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
268
- const s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
269
- let o;
270
- e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : m(n) && s ? o.push(...n.split(s)) : o.push(n)));
271
- const u = Z(this.data, o);
272
- return !u && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), u || !a || !m(n) ? u : oe((l = (f = this.data) == null ? void 0 : f[e]) == null ? void 0 : l[t], n, s);
273
- }
274
- addResource(e, t, n, i) {
275
- let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
276
- silent: !1
277
- };
278
- const a = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
279
- let o = [e, t];
280
- n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), ye(this.data, o, i), s.silent || this.emit("added", e, t, n, i);
281
- }
282
- addResources(e, t, n) {
283
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
284
- silent: !1
285
- };
286
- for (const s in n)
287
- (m(n[s]) || Array.isArray(n[s])) && this.addResource(e, t, s, n[s], {
288
- silent: !0
289
- });
290
- i.silent || this.emit("added", e, t, n);
291
- }
292
- addResourceBundle(e, t, n, i, s) {
293
- let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
294
- silent: !1,
295
- skipCopy: !1
296
- }, o = [e, t];
297
- e.indexOf(".") > -1 && (o = e.split("."), i = n, n = t, t = o[1]), this.addNamespaces(t);
298
- let u = Z(this.data, o) || {};
299
- a.skipCopy || (n = JSON.parse(JSON.stringify(n))), i ? Me(u, n, s) : u = {
300
- ...u,
301
- ...n
302
- }, ye(this.data, o, u), a.silent || this.emit("added", e, t, n);
303
- }
304
- removeResourceBundle(e, t) {
305
- this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
306
- }
307
- hasResourceBundle(e, t) {
308
- return this.getResource(e, t) !== void 0;
309
- }
310
- getResourceBundle(e, t) {
311
- return t || (t = this.options.defaultNS), this.getResource(e, t);
312
- }
313
- getDataByLanguage(e) {
314
- return this.data[e];
315
- }
316
- hasLanguageSomeTranslations(e) {
317
- const t = this.getDataByLanguage(e);
318
- return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
319
- }
320
- toJSON() {
321
- return this.data;
322
- }
323
- }
324
- var Ke = {
325
- processors: {},
326
- addPostProcessor(r) {
327
- this.processors[r.name] = r;
328
- },
329
- handle(r, e, t, n, i) {
330
- return r.forEach((s) => {
331
- var a;
332
- e = ((a = this.processors[s]) == null ? void 0 : a.process(e, t, n, i)) ?? e;
333
- }), e;
334
- }
335
- };
336
- const ve = {}, Se = (r) => !m(r) && typeof r != "boolean" && typeof r != "number";
337
- class te extends ie {
338
- constructor(e) {
339
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
340
- super(), at(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = $.create("translator");
341
- }
342
- changeLanguage(e) {
343
- e && (this.language = e);
344
- }
345
- exists(e) {
346
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
347
- interpolation: {}
348
- };
349
- if (e == null)
350
- return !1;
351
- const n = this.resolve(e, t);
352
- return (n == null ? void 0 : n.res) !== void 0;
353
- }
354
- extractFromKey(e, t) {
355
- let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
356
- n === void 0 && (n = ":");
357
- const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
358
- let s = t.ns || this.options.defaultNS || [];
359
- const a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !pt(e, n, i);
360
- if (a && !o) {
361
- const u = e.match(this.interpolator.nestingRegexp);
362
- if (u && u.length > 0)
363
- return {
364
- key: e,
365
- namespaces: m(s) ? [s] : s
366
- };
367
- const f = e.split(n);
368
- (n !== i || n === i && this.options.ns.indexOf(f[0]) > -1) && (s = f.shift()), e = f.join(i);
369
- }
370
- return {
371
- key: e,
372
- namespaces: m(s) ? [s] : s
373
- };
374
- }
375
- translate(e, t, n) {
376
- if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
377
- ...t
378
- }), t || (t = {}), e == null) return "";
379
- Array.isArray(e) || (e = [String(e)]);
380
- const i = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
381
- key: a,
382
- namespaces: o
383
- } = this.extractFromKey(e[e.length - 1], t), u = o[o.length - 1], f = t.lng || this.language, l = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
384
- if ((f == null ? void 0 : f.toLowerCase()) === "cimode") {
385
- if (l) {
386
- const O = t.nsSeparator || this.options.nsSeparator;
387
- return i ? {
388
- res: `${u}${O}${a}`,
389
- usedKey: a,
390
- exactUsedKey: a,
391
- usedLng: f,
392
- usedNS: u,
393
- usedParams: this.getUsedParamsDetails(t)
394
- } : `${u}${O}${a}`;
395
- }
396
- return i ? {
397
- res: a,
398
- usedKey: a,
399
- exactUsedKey: a,
400
- usedLng: f,
401
- usedNS: u,
402
- usedParams: this.getUsedParamsDetails(t)
403
- } : a;
404
- }
405
- const d = this.resolve(e, t);
406
- let c = d == null ? void 0 : d.res;
407
- const h = (d == null ? void 0 : d.usedKey) || a, g = (d == null ? void 0 : d.exactUsedKey) || a, p = ["[object Number]", "[object Function]", "[object RegExp]"], y = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, S = t.count !== void 0 && !m(t.count), x = te.hasDefaultValue(t), P = S ? this.pluralResolver.getSuffix(f, t.count, t) : "", H = t.ordinal && S ? this.pluralResolver.getSuffix(f, t.count, {
408
- ordinal: !1
409
- }) : "", U = S && !t.ordinal && t.count === 0, v = U && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${P}`] || t[`defaultValue${H}`] || t.defaultValue;
410
- let w = c;
411
- b && !c && x && (w = v);
412
- const F = Se(w), A = Object.prototype.toString.apply(w);
413
- if (b && w && F && p.indexOf(A) < 0 && !(m(y) && Array.isArray(w))) {
414
- if (!t.returnObjects && !this.options.returnObjects) {
415
- this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
416
- const O = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(h, w, {
417
- ...t,
418
- ns: o
419
- }) : `key '${a} (${this.language})' returned an object instead of string.`;
420
- return i ? (d.res = O, d.usedParams = this.getUsedParamsDetails(t), d) : O;
421
- }
422
- if (s) {
423
- const O = Array.isArray(w), k = O ? [] : {}, fe = O ? g : h;
424
- for (const C in w)
425
- if (Object.prototype.hasOwnProperty.call(w, C)) {
426
- const R = `${fe}${s}${C}`;
427
- x && !c ? k[C] = this.translate(R, {
428
- ...t,
429
- defaultValue: Se(v) ? v[C] : void 0,
430
- joinArrays: !1,
431
- ns: o
432
- }) : k[C] = this.translate(R, {
433
- ...t,
434
- joinArrays: !1,
435
- ns: o
436
- }), k[C] === R && (k[C] = w[C]);
437
- }
438
- c = k;
439
- }
440
- } else if (b && m(y) && Array.isArray(c))
441
- c = c.join(y), c && (c = this.extendTranslation(c, e, t, n));
442
- else {
443
- let O = !1, k = !1;
444
- !this.isValidLookup(c) && x && (O = !0, c = v), this.isValidLookup(c) || (k = !0, c = a);
445
- const C = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && k ? void 0 : c, R = x && v !== c && this.options.updateMissing;
446
- if (k || O || R) {
447
- if (this.logger.log(R ? "updateKey" : "missingKey", f, u, a, R ? v : c), s) {
448
- const L = this.resolve(a, {
449
- ...t,
450
- keySeparator: !1
451
- });
452
- 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.");
453
- }
454
- let M = [];
455
- const Q = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
456
- if (this.options.saveMissingTo === "fallback" && Q && Q[0])
457
- for (let L = 0; L < Q.length; L++)
458
- M.push(Q[L]);
459
- else this.options.saveMissingTo === "all" ? M = this.languageUtils.toResolveHierarchy(t.lng || this.language) : M.push(t.lng || this.language);
460
- const ce = (L, E, K) => {
461
- var he;
462
- const de = x && K !== c ? K : C;
463
- this.options.missingKeyHandler ? this.options.missingKeyHandler(L, u, E, de, R, t) : (he = this.backendConnector) != null && he.saveMissing && this.backendConnector.saveMissing(L, u, E, de, R, t), this.emit("missingKey", L, u, E, c);
464
- };
465
- this.options.saveMissing && (this.options.saveMissingPlurals && S ? M.forEach((L) => {
466
- const E = this.pluralResolver.getSuffixes(L, t);
467
- U && t[`defaultValue${this.options.pluralSeparator}zero`] && E.indexOf(`${this.options.pluralSeparator}zero`) < 0 && E.push(`${this.options.pluralSeparator}zero`), E.forEach((K) => {
468
- ce([L], a + K, t[`defaultValue${K}`] || v);
469
- });
470
- }) : ce(M, a, v));
471
- }
472
- c = this.extendTranslation(c, e, t, d, n), k && c === a && this.options.appendNamespaceToMissingKey && (c = `${u}:${a}`), (k || O) && this.options.parseMissingKeyHandler && (c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}:${a}` : a, O ? c : void 0));
473
- }
474
- return i ? (d.res = c, d.usedParams = this.getUsedParamsDetails(t), d) : c;
475
- }
476
- extendTranslation(e, t, n, i, s) {
477
- var f, l;
478
- var a = this;
479
- if ((f = this.i18nFormat) != null && f.parse)
480
- e = this.i18nFormat.parse(e, {
481
- ...this.options.interpolation.defaultVariables,
482
- ...n
483
- }, n.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
484
- resolved: i
485
- });
486
- else if (!n.skipInterpolation) {
487
- n.interpolation && this.interpolator.init({
488
- ...n,
489
- interpolation: {
490
- ...this.options.interpolation,
491
- ...n.interpolation
492
- }
493
- });
494
- const d = m(e) && (((l = n == null ? void 0 : n.interpolation) == null ? void 0 : l.skipOnVariables) !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
495
- let c;
496
- if (d) {
497
- const g = e.match(this.interpolator.nestingRegexp);
498
- c = g && g.length;
499
- }
500
- let h = n.replace && !m(n.replace) ? n.replace : n;
501
- if (this.options.interpolation.defaultVariables && (h = {
502
- ...this.options.interpolation.defaultVariables,
503
- ...h
504
- }), e = this.interpolator.interpolate(e, h, n.lng || this.language || i.usedLng, n), d) {
505
- const g = e.match(this.interpolator.nestingRegexp), p = g && g.length;
506
- c < p && (n.nest = !1);
507
- }
508
- !n.lng && i && i.res && (n.lng = this.language || i.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, function() {
509
- for (var g = arguments.length, p = new Array(g), y = 0; y < g; y++)
510
- p[y] = arguments[y];
511
- return (s == null ? void 0 : s[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);
512
- }, n)), n.interpolation && this.interpolator.reset();
513
- }
514
- const o = n.postProcess || this.options.postProcess, u = m(o) ? [o] : o;
515
- return e != null && (u != null && u.length) && n.applyPostProcessor !== !1 && (e = Ke.handle(u, e, t, this.options && this.options.postProcessPassResolved ? {
516
- i18nResolved: {
517
- ...i,
518
- usedParams: this.getUsedParamsDetails(n)
519
- },
520
- ...n
521
- } : n, this)), e;
522
- }
523
- resolve(e) {
524
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n, i, s, a, o;
525
- return m(e) && (e = [e]), e.forEach((u) => {
526
- if (this.isValidLookup(n)) return;
527
- const f = this.extractFromKey(u, t), l = f.key;
528
- i = l;
529
- let d = f.namespaces;
530
- this.options.fallbackNS && (d = d.concat(this.options.fallbackNS));
531
- const c = t.count !== void 0 && !m(t.count), h = c && !t.ordinal && t.count === 0, g = t.context !== void 0 && (m(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
532
- d.forEach((y) => {
533
- var b, S;
534
- this.isValidLookup(n) || (o = y, !ve[`${p[0]}-${y}`] && ((b = this.utils) != null && b.hasLoadedNamespace) && !((S = this.utils) != null && S.hasLoadedNamespace(o)) && (ve[`${p[0]}-${y}`] = !0, this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${o}" 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((x) => {
535
- var U;
536
- if (this.isValidLookup(n)) return;
537
- a = x;
538
- const P = [l];
539
- if ((U = this.i18nFormat) != null && U.addLookupKeys)
540
- this.i18nFormat.addLookupKeys(P, l, x, y, t);
541
- else {
542
- let v;
543
- c && (v = this.pluralResolver.getSuffix(x, t.count, t));
544
- const w = `${this.options.pluralSeparator}zero`, F = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
545
- if (c && (P.push(l + v), t.ordinal && v.indexOf(F) === 0 && P.push(l + v.replace(F, this.options.pluralSeparator)), h && P.push(l + w)), g) {
546
- const A = `${l}${this.options.contextSeparator}${t.context}`;
547
- P.push(A), c && (P.push(A + v), t.ordinal && v.indexOf(F) === 0 && P.push(A + v.replace(F, this.options.pluralSeparator)), h && P.push(A + w));
548
- }
549
- }
550
- let H;
551
- for (; H = P.pop(); )
552
- this.isValidLookup(n) || (s = H, n = this.getResource(x, y, H, t));
553
- }));
554
- });
555
- }), {
556
- res: n,
557
- usedKey: i,
558
- exactUsedKey: s,
559
- usedLng: a,
560
- usedNS: o
561
- };
562
- }
563
- isValidLookup(e) {
564
- return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
565
- }
566
- getResource(e, t, n) {
567
- var s;
568
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
569
- return (s = this.i18nFormat) != null && s.getResource ? this.i18nFormat.getResource(e, t, n, i) : this.resourceStore.getResource(e, t, n, i);
570
- }
571
- getUsedParamsDetails() {
572
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
573
- const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && !m(e.replace);
574
- let i = n ? e.replace : e;
575
- if (n && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
576
- ...this.options.interpolation.defaultVariables,
577
- ...i
578
- }), !n) {
579
- i = {
580
- ...i
581
- };
582
- for (const s of t)
583
- delete i[s];
584
- }
585
- return i;
586
- }
587
- static hasDefaultValue(e) {
588
- const t = "defaultValue";
589
- for (const n in e)
590
- if (Object.prototype.hasOwnProperty.call(e, n) && t === n.substring(0, t.length) && e[n] !== void 0)
591
- return !0;
592
- return !1;
593
- }
594
- }
595
- class xe {
596
- constructor(e) {
597
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = $.create("languageUtils");
598
- }
599
- getScriptPartFromCode(e) {
600
- if (e = _(e), !e || e.indexOf("-") < 0) return null;
601
- const t = e.split("-");
602
- return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
603
- }
604
- getLanguagePartFromCode(e) {
605
- if (e = _(e), !e || e.indexOf("-") < 0) return e;
606
- const t = e.split("-");
607
- return this.formatLanguageCode(t[0]);
608
- }
609
- formatLanguageCode(e) {
610
- if (m(e) && e.indexOf("-") > -1) {
611
- let t;
612
- try {
613
- t = Intl.getCanonicalLocales(e)[0];
614
- } catch {
615
- }
616
- return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
617
- }
618
- return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
619
- }
620
- isSupportedCode(e) {
621
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
622
- }
623
- getBestMatchFromCodes(e) {
624
- if (!e) return null;
625
- let t;
626
- return e.forEach((n) => {
627
- if (t) return;
628
- const i = this.formatLanguageCode(n);
629
- (!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
630
- }), !t && this.options.supportedLngs && e.forEach((n) => {
631
- if (t) return;
632
- const i = this.getLanguagePartFromCode(n);
633
- if (this.isSupportedCode(i)) return t = i;
634
- t = this.options.supportedLngs.find((s) => {
635
- if (s === i) return s;
636
- if (!(s.indexOf("-") < 0 && i.indexOf("-") < 0) && (s.indexOf("-") > 0 && i.indexOf("-") < 0 && s.substring(0, s.indexOf("-")) === i || s.indexOf(i) === 0 && i.length > 1))
637
- return s;
638
- });
639
- }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
640
- }
641
- getFallbackCodes(e, t) {
642
- if (!e) return [];
643
- if (typeof e == "function" && (e = e(t)), m(e) && (e = [e]), Array.isArray(e)) return e;
644
- if (!t) return e.default || [];
645
- let n = e[t];
646
- return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
647
- }
648
- toResolveHierarchy(e, t) {
649
- const n = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], s = (a) => {
650
- a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
651
- };
652
- return m(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(e))) : m(e) && s(this.formatLanguageCode(e)), n.forEach((a) => {
653
- i.indexOf(a) < 0 && s(this.formatLanguageCode(a));
654
- }), i;
655
- }
656
- }
657
- const we = {
658
- zero: 0,
659
- one: 1,
660
- two: 2,
661
- few: 3,
662
- many: 4,
663
- other: 5
664
- }, Oe = {
665
- select: (r) => r === 1 ? "one" : "other",
666
- resolvedOptions: () => ({
667
- pluralCategories: ["one", "other"]
668
- })
669
- };
670
- class yt {
671
- constructor(e) {
672
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
673
- this.languageUtils = e, this.options = t, this.logger = $.create("pluralResolver"), this.pluralRulesCache = {};
674
- }
675
- addRule(e, t) {
676
- this.rules[e] = t;
677
- }
678
- clearCache() {
679
- this.pluralRulesCache = {};
680
- }
681
- getRule(e) {
682
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
683
- const n = _(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", s = JSON.stringify({
684
- cleanedCode: n,
685
- type: i
686
- });
687
- if (s in this.pluralRulesCache)
688
- return this.pluralRulesCache[s];
689
- let a;
690
- try {
691
- a = new Intl.PluralRules(n, {
692
- type: i
693
- });
694
- } catch {
695
- if (!Intl)
696
- return this.logger.error("No Intl support, please use an Intl polyfill!"), Oe;
697
- if (!e.match(/-|_/)) return Oe;
698
- const u = this.languageUtils.getLanguagePartFromCode(e);
699
- a = this.getRule(u, t);
700
- }
701
- return this.pluralRulesCache[s] = a, a;
702
- }
703
- needsPlural(e) {
704
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
705
- return n || (n = this.getRule("dev", t)), (n == null ? void 0 : n.resolvedOptions().pluralCategories.length) > 1;
706
- }
707
- getPluralFormsOfKey(e, t) {
708
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
709
- return this.getSuffixes(e, n).map((i) => `${t}${i}`);
710
- }
711
- getSuffixes(e) {
712
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = this.getRule(e, t);
713
- return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((i, s) => we[i] - we[s]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
714
- }
715
- getSuffix(e, t) {
716
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
717
- const i = this.getRule(e, n);
718
- return i ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
719
- }
720
- }
721
- const Le = function(r, e, t) {
722
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, s = lt(r, e, t);
723
- return !s && i && m(t) && (s = oe(r, t, n), s === void 0 && (s = oe(e, t, n))), s;
724
- }, re = (r) => r.replace(/\$/g, "$$$$");
725
- class bt {
726
- constructor() {
727
- var t;
728
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
729
- this.logger = $.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((n) => n), this.init(e);
730
- }
731
- init() {
732
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
733
- e.interpolation || (e.interpolation = {
734
- escapeValue: !0
735
- });
736
- const {
737
- escape: t,
738
- escapeValue: n,
739
- useRawValueToEscape: i,
740
- prefix: s,
741
- prefixEscaped: a,
742
- suffix: o,
743
- suffixEscaped: u,
744
- formatSeparator: f,
745
- unescapeSuffix: l,
746
- unescapePrefix: d,
747
- nestingPrefix: c,
748
- nestingPrefixEscaped: h,
749
- nestingSuffix: g,
750
- nestingSuffixEscaped: p,
751
- nestingOptionsSeparator: y,
752
- maxReplaces: b,
753
- alwaysFormat: S
754
- } = e.interpolation;
755
- this.escape = t !== void 0 ? t : ct, this.escapeValue = n !== void 0 ? n : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? D(s) : a || "{{", this.suffix = o ? D(o) : u || "}}", this.formatSeparator = f || ",", this.unescapePrefix = l ? "" : d || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = c ? D(c) : h || D("$t("), this.nestingSuffix = g ? D(g) : p || D(")"), this.nestingOptionsSeparator = y || ",", this.maxReplaces = b || 1e3, this.alwaysFormat = S !== void 0 ? S : !1, this.resetRegExp();
756
- }
757
- reset() {
758
- this.options && this.init(this.options);
759
- }
760
- resetRegExp() {
761
- const e = (t, n) => (t == null ? void 0 : t.source) === n ? (t.lastIndex = 0, t) : new RegExp(n, "g");
762
- 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}`);
763
- }
764
- interpolate(e, t, n, i) {
765
- var h;
766
- let s, a, o;
767
- const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, f = (g) => {
768
- if (g.indexOf(this.formatSeparator) < 0) {
769
- const S = Le(t, u, g, this.options.keySeparator, this.options.ignoreJSONStructure);
770
- return this.alwaysFormat ? this.format(S, void 0, n, {
771
- ...i,
772
- ...t,
773
- interpolationkey: g
774
- }) : S;
775
- }
776
- const p = g.split(this.formatSeparator), y = p.shift().trim(), b = p.join(this.formatSeparator).trim();
777
- return this.format(Le(t, u, y, this.options.keySeparator, this.options.ignoreJSONStructure), b, n, {
778
- ...i,
779
- ...t,
780
- interpolationkey: y
781
- });
782
- };
783
- this.resetRegExp();
784
- const l = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, d = ((h = i == null ? void 0 : i.interpolation) == null ? void 0 : h.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
785
- return [{
786
- regex: this.regexpUnescape,
787
- safeValue: (g) => re(g)
788
- }, {
789
- regex: this.regexp,
790
- safeValue: (g) => this.escapeValue ? re(this.escape(g)) : re(g)
791
- }].forEach((g) => {
792
- for (o = 0; s = g.regex.exec(e); ) {
793
- const p = s[1].trim();
794
- if (a = f(p), a === void 0)
795
- if (typeof l == "function") {
796
- const b = l(e, s, i);
797
- a = m(b) ? b : "";
798
- } else if (i && Object.prototype.hasOwnProperty.call(i, p))
799
- a = "";
800
- else if (d) {
801
- a = s[0];
802
- continue;
803
- } else
804
- this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), a = "";
805
- else !m(a) && !this.useRawValueToEscape && (a = ge(a));
806
- const y = g.safeValue(a);
807
- if (e = e.replace(s[0], y), d ? (g.regex.lastIndex += a.length, g.regex.lastIndex -= s[0].length) : g.regex.lastIndex = 0, o++, o >= this.maxReplaces)
808
- break;
809
- }
810
- }), e;
811
- }
812
- nest(e, t) {
813
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, s, a;
814
- const o = (u, f) => {
815
- const l = this.nestingOptionsSeparator;
816
- if (u.indexOf(l) < 0) return u;
817
- const d = u.split(new RegExp(`${l}[ ]*{`));
818
- let c = `{${d[1]}`;
819
- u = d[0], c = this.interpolate(c, a);
820
- const h = c.match(/'/g), g = c.match(/"/g);
821
- (((h == null ? void 0 : h.length) ?? 0) % 2 === 0 && !g || g.length % 2 !== 0) && (c = c.replace(/'/g, '"'));
822
- try {
823
- a = JSON.parse(c), f && (a = {
824
- ...f,
825
- ...a
826
- });
827
- } catch (p) {
828
- return this.logger.warn(`failed parsing options string in nesting for key ${u}`, p), `${u}${l}${c}`;
829
- }
830
- return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, u;
831
- };
832
- for (; i = this.nestingRegexp.exec(e); ) {
833
- let u = [];
834
- a = {
835
- ...n
836
- }, a = a.replace && !m(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
837
- let f = !1;
838
- if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
839
- const l = i[1].split(this.formatSeparator).map((d) => d.trim());
840
- i[1] = l.shift(), u = l, f = !0;
841
- }
842
- if (s = t(o.call(this, i[1].trim(), a), a), s && i[0] === e && !m(s)) return s;
843
- m(s) || (s = ge(s)), s || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), s = ""), f && (s = u.reduce((l, d) => this.format(l, d, n.lng, {
844
- ...n,
845
- interpolationkey: i[1].trim()
846
- }), s.trim())), e = e.replace(i[0], s), this.regexp.lastIndex = 0;
847
- }
848
- return e;
849
- }
850
- }
851
- const vt = (r) => {
852
- let e = r.toLowerCase().trim();
853
- const t = {};
854
- if (r.indexOf("(") > -1) {
855
- const n = r.split("(");
856
- e = n[0].toLowerCase().trim();
857
- const i = n[1].substring(0, n[1].length - 1);
858
- e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((a) => {
859
- if (a) {
860
- const [o, ...u] = a.split(":"), f = u.join(":").trim().replace(/^'+|'+$/g, ""), l = o.trim();
861
- t[l] || (t[l] = f), f === "false" && (t[l] = !1), f === "true" && (t[l] = !0), isNaN(f) || (t[l] = parseInt(f, 10));
862
- }
863
- });
864
- }
865
- return {
866
- formatName: e,
867
- formatOptions: t
868
- };
869
- }, T = (r) => {
870
- const e = {};
871
- return (t, n, i) => {
872
- let s = i;
873
- i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (s = {
874
- ...s,
875
- [i.interpolationkey]: void 0
876
- });
877
- const a = n + JSON.stringify(s);
878
- let o = e[a];
879
- return o || (o = r(_(n), i), e[a] = o), o(t);
880
- };
881
- };
882
- class St {
883
- constructor() {
884
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
885
- this.logger = $.create("formatter"), this.options = e, this.formats = {
886
- number: T((t, n) => {
887
- const i = new Intl.NumberFormat(t, {
888
- ...n
889
- });
890
- return (s) => i.format(s);
891
- }),
892
- currency: T((t, n) => {
893
- const i = new Intl.NumberFormat(t, {
894
- ...n,
895
- style: "currency"
896
- });
897
- return (s) => i.format(s);
898
- }),
899
- datetime: T((t, n) => {
900
- const i = new Intl.DateTimeFormat(t, {
901
- ...n
902
- });
903
- return (s) => i.format(s);
904
- }),
905
- relativetime: T((t, n) => {
906
- const i = new Intl.RelativeTimeFormat(t, {
907
- ...n
908
- });
909
- return (s) => i.format(s, n.range || "day");
910
- }),
911
- list: T((t, n) => {
912
- const i = new Intl.ListFormat(t, {
913
- ...n
914
- });
915
- return (s) => i.format(s);
916
- })
917
- }, this.init(e);
918
- }
919
- init(e) {
920
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
921
- interpolation: {}
922
- };
923
- this.formatSeparator = t.interpolation.formatSeparator || ",";
924
- }
925
- add(e, t) {
926
- this.formats[e.toLowerCase().trim()] = t;
927
- }
928
- addCached(e, t) {
929
- this.formats[e.toLowerCase().trim()] = T(t);
930
- }
931
- format(e, t, n) {
932
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
933
- const s = t.split(this.formatSeparator);
934
- if (s.length > 1 && s[0].indexOf("(") > 1 && s[0].indexOf(")") < 0 && s.find((o) => o.indexOf(")") > -1)) {
935
- const o = s.findIndex((u) => u.indexOf(")") > -1);
936
- s[0] = [s[0], ...s.splice(1, o)].join(this.formatSeparator);
937
- }
938
- return s.reduce((o, u) => {
939
- var d;
940
- const {
941
- formatName: f,
942
- formatOptions: l
943
- } = vt(u);
944
- if (this.formats[f]) {
945
- let c = o;
946
- try {
947
- const h = ((d = i == null ? void 0 : i.formatParams) == null ? void 0 : d[i.interpolationkey]) || {}, g = h.locale || h.lng || i.locale || i.lng || n;
948
- c = this.formats[f](o, g, {
949
- ...l,
950
- ...i,
951
- ...h
952
- });
953
- } catch (h) {
954
- this.logger.warn(h);
955
- }
956
- return c;
957
- } else
958
- this.logger.warn(`there was no format function for ${f}`);
959
- return o;
960
- }, e);
961
- }
962
- }
963
- const xt = (r, e) => {
964
- r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
965
- };
966
- class wt extends ie {
967
- constructor(e, t, n) {
968
- var s, a;
969
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
970
- super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = i, this.logger = $.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (a = (s = this.backend) == null ? void 0 : s.init) == null || a.call(s, n, i.backend, i);
971
- }
972
- queueLoad(e, t, n, i) {
973
- const s = {}, a = {}, o = {}, u = {};
974
- return e.forEach((f) => {
975
- let l = !0;
976
- t.forEach((d) => {
977
- const c = `${f}|${d}`;
978
- !n.reload && this.store.hasResourceBundle(f, d) ? this.state[c] = 2 : this.state[c] < 0 || (this.state[c] === 1 ? a[c] === void 0 && (a[c] = !0) : (this.state[c] = 1, l = !1, a[c] === void 0 && (a[c] = !0), s[c] === void 0 && (s[c] = !0), u[d] === void 0 && (u[d] = !0)));
979
- }), l || (o[f] = !0);
980
- }), (Object.keys(s).length || Object.keys(a).length) && this.queue.push({
981
- pending: a,
982
- pendingCount: Object.keys(a).length,
983
- loaded: {},
984
- errors: [],
985
- callback: i
986
- }), {
987
- toLoad: Object.keys(s),
988
- pending: Object.keys(a),
989
- toLoadLanguages: Object.keys(o),
990
- toLoadNamespaces: Object.keys(u)
991
- };
992
- }
993
- loaded(e, t, n) {
994
- const i = e.split("|"), s = i[0], a = i[1];
995
- t && this.emit("failedLoading", s, a, t), !t && n && this.store.addResourceBundle(s, a, n, void 0, void 0, {
996
- skipCopy: !0
997
- }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
998
- const o = {};
999
- this.queue.forEach((u) => {
1000
- ut(u.loaded, [s], a), xt(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((f) => {
1001
- o[f] || (o[f] = {});
1002
- const l = u.loaded[f];
1003
- l.length && l.forEach((d) => {
1004
- o[f][d] === void 0 && (o[f][d] = !0);
1005
- });
1006
- }), u.done = !0, u.errors.length ? u.callback(u.errors) : u.callback());
1007
- }), this.emit("loaded", o), this.queue = this.queue.filter((u) => !u.done);
1008
- }
1009
- read(e, t, n) {
1010
- let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
1011
- if (!e.length) return a(null, {});
1012
- if (this.readingCalls >= this.maxParallelReads) {
1013
- this.waitingReads.push({
1014
- lng: e,
1015
- ns: t,
1016
- fcName: n,
1017
- tried: i,
1018
- wait: s,
1019
- callback: a
1020
- });
1021
- return;
1022
- }
1023
- this.readingCalls++;
1024
- const o = (f, l) => {
1025
- if (this.readingCalls--, this.waitingReads.length > 0) {
1026
- const d = this.waitingReads.shift();
1027
- this.read(d.lng, d.ns, d.fcName, d.tried, d.wait, d.callback);
1028
- }
1029
- if (f && l && i < this.maxRetries) {
1030
- setTimeout(() => {
1031
- this.read.call(this, e, t, n, i + 1, s * 2, a);
1032
- }, s);
1033
- return;
1034
- }
1035
- a(f, l);
1036
- }, u = this.backend[n].bind(this.backend);
1037
- if (u.length === 2) {
1038
- try {
1039
- const f = u(e, t);
1040
- f && typeof f.then == "function" ? f.then((l) => o(null, l)).catch(o) : o(null, f);
1041
- } catch (f) {
1042
- o(f);
1043
- }
1044
- return;
1045
- }
1046
- return u(e, t, o);
1047
- }
1048
- prepareLoading(e, t) {
1049
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
1050
- if (!this.backend)
1051
- return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
1052
- m(e) && (e = this.languageUtils.toResolveHierarchy(e)), m(t) && (t = [t]);
1053
- const s = this.queueLoad(e, t, n, i);
1054
- if (!s.toLoad.length)
1055
- return s.pending.length || i(), null;
1056
- s.toLoad.forEach((a) => {
1057
- this.loadOne(a);
1058
- });
1059
- }
1060
- load(e, t, n) {
1061
- this.prepareLoading(e, t, {}, n);
1062
- }
1063
- reload(e, t, n) {
1064
- this.prepareLoading(e, t, {
1065
- reload: !0
1066
- }, n);
1067
- }
1068
- loadOne(e) {
1069
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1070
- const n = e.split("|"), i = n[0], s = n[1];
1071
- this.read(i, s, "read", void 0, void 0, (a, o) => {
1072
- a && this.logger.warn(`${t}loading namespace ${s} for language ${i} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${s} for language ${i}`, o), this.loaded(e, a, o);
1073
- });
1074
- }
1075
- saveMissing(e, t, n, i, s) {
1076
- var u, f, l, d, c;
1077
- let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1078
- };
1079
- if ((f = (u = this.services) == null ? void 0 : u.utils) != null && f.hasLoadedNamespace && !((d = (l = this.services) == null ? void 0 : l.utils) != null && d.hasLoadedNamespace(t))) {
1080
- 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!!!");
1081
- return;
1082
- }
1083
- if (!(n == null || n === "")) {
1084
- if ((c = this.backend) != null && c.create) {
1085
- const h = {
1086
- ...a,
1087
- isUpdate: s
1088
- }, g = this.backend.create.bind(this.backend);
1089
- if (g.length < 6)
1090
- try {
1091
- let p;
1092
- g.length === 5 ? p = g(e, t, n, i, h) : p = g(e, t, n, i), p && typeof p.then == "function" ? p.then((y) => o(null, y)).catch(o) : o(null, p);
1093
- } catch (p) {
1094
- o(p);
1095
- }
1096
- else
1097
- g(e, t, n, i, o, h);
1098
- }
1099
- !e || !e[0] || this.store.addResource(e[0], t, n, i);
1100
- }
1101
- }
1102
- }
1103
- const Pe = () => ({
1104
- debug: !1,
1105
- initAsync: !0,
1106
- ns: ["translation"],
1107
- defaultNS: ["translation"],
1108
- fallbackLng: ["dev"],
1109
- fallbackNS: !1,
1110
- supportedLngs: !1,
1111
- nonExplicitSupportedLngs: !1,
1112
- load: "all",
1113
- preload: !1,
1114
- simplifyPluralSuffix: !0,
1115
- keySeparator: ".",
1116
- nsSeparator: ":",
1117
- pluralSeparator: "_",
1118
- contextSeparator: "_",
1119
- partialBundledLanguages: !1,
1120
- saveMissing: !1,
1121
- updateMissing: !1,
1122
- saveMissingTo: "fallback",
1123
- saveMissingPlurals: !0,
1124
- missingKeyHandler: !1,
1125
- missingInterpolationHandler: !1,
1126
- postProcess: !1,
1127
- postProcessPassResolved: !1,
1128
- returnNull: !1,
1129
- returnEmptyString: !0,
1130
- returnObjects: !1,
1131
- joinArrays: !1,
1132
- returnedObjectHandler: !1,
1133
- parseMissingKeyHandler: !1,
1134
- appendNamespaceToMissingKey: !1,
1135
- appendNamespaceToCIMode: !1,
1136
- overloadTranslationOptionHandler: (r) => {
1137
- let e = {};
1138
- if (typeof r[1] == "object" && (e = r[1]), m(r[1]) && (e.defaultValue = r[1]), m(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
1139
- const t = r[3] || r[2];
1140
- Object.keys(t).forEach((n) => {
1141
- e[n] = t[n];
1142
- });
1143
- }
1144
- return e;
1145
- },
1146
- interpolation: {
1147
- escapeValue: !0,
1148
- format: (r) => r,
1149
- prefix: "{{",
1150
- suffix: "}}",
1151
- formatSeparator: ",",
1152
- unescapePrefix: "-",
1153
- nestingPrefix: "$t(",
1154
- nestingSuffix: ")",
1155
- nestingOptionsSeparator: ",",
1156
- maxReplaces: 1e3,
1157
- skipOnVariables: !0
1158
- }
1159
- }), ke = (r) => {
1160
- var e, t;
1161
- return m(r.ns) && (r.ns = [r.ns]), m(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), m(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;
1162
- }, G = () => {
1163
- }, Ot = (r) => {
1164
- Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
1165
- typeof r[t] == "function" && (r[t] = r[t].bind(r));
1166
- });
1167
- };
1168
- class X extends ie {
1169
- constructor() {
1170
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1171
- if (super(), this.options = ke(e), this.services = {}, this.logger = $, this.modules = {
1172
- external: []
1173
- }, Ot(this), t && !this.isInitialized && !e.isClone) {
1174
- if (!this.options.initAsync)
1175
- return this.init(e, t), this;
1176
- setTimeout(() => {
1177
- this.init(e, t);
1178
- }, 0);
1179
- }
1180
- }
1181
- init() {
1182
- var e = this;
1183
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
1184
- this.isInitializing = !0, typeof t == "function" && (n = t, t = {}), t.defaultNS == null && t.ns && (m(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1185
- const i = Pe();
1186
- this.options = {
1187
- ...i,
1188
- ...this.options,
1189
- ...ke(t)
1190
- }, this.options.interpolation = {
1191
- ...i.interpolation,
1192
- ...this.options.interpolation
1193
- }, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1194
- const s = (l) => l ? typeof l == "function" ? new l() : l : null;
1195
- if (!this.options.isClone) {
1196
- this.modules.logger ? $.init(s(this.modules.logger), this.options) : $.init(null, this.options);
1197
- let l;
1198
- this.modules.formatter ? l = this.modules.formatter : l = St;
1199
- const d = new xe(this.options);
1200
- this.store = new be(this.options.resources, this.options);
1201
- const c = this.services;
1202
- c.logger = $, c.resourceStore = this.store, c.languageUtils = d, c.pluralResolver = new yt(d, {
1203
- prepend: this.options.pluralSeparator,
1204
- simplifyPluralSuffix: this.options.simplifyPluralSuffix
1205
- }), l && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (c.formatter = s(l), c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new bt(this.options), c.utils = {
1206
- hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1207
- }, c.backendConnector = new wt(s(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", function(h) {
1208
- for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), y = 1; y < g; y++)
1209
- p[y - 1] = arguments[y];
1210
- e.emit(h, ...p);
1211
- }), this.modules.languageDetector && (c.languageDetector = s(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = s(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new te(this.services, this.options), this.translator.on("*", function(h) {
1212
- for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), y = 1; y < g; y++)
1213
- p[y - 1] = arguments[y];
1214
- e.emit(h, ...p);
1215
- }), this.modules.external.forEach((h) => {
1216
- h.init && h.init(this);
1217
- });
1218
- }
1219
- if (this.format = this.options.interpolation.format, n || (n = G), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1220
- const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1221
- l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
1222
- }
1223
- !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) => {
1224
- this[l] = function() {
1225
- return e.store[l](...arguments);
1226
- };
1227
- }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((l) => {
1228
- this[l] = function() {
1229
- return e.store[l](...arguments), e;
1230
- };
1231
- });
1232
- const u = V(), f = () => {
1233
- const l = (d, c) => {
1234
- 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), u.resolve(c), n(d, c);
1235
- };
1236
- if (this.languages && !this.isInitialized) return l(null, this.t.bind(this));
1237
- this.changeLanguage(this.options.lng, l);
1238
- };
1239
- return this.options.resources || !this.options.initAsync ? f() : setTimeout(f, 0), u;
1240
- }
1241
- loadResources(e) {
1242
- var s, a;
1243
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : G;
1244
- const i = m(e) ? e : this.language;
1245
- if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1246
- if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1247
- const o = [], u = (f) => {
1248
- if (!f || f === "cimode") return;
1249
- this.services.languageUtils.toResolveHierarchy(f).forEach((d) => {
1250
- d !== "cimode" && o.indexOf(d) < 0 && o.push(d);
1251
- });
1252
- };
1253
- i ? u(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l) => u(l)), (a = (s = this.options.preload) == null ? void 0 : s.forEach) == null || a.call(s, (f) => u(f)), this.services.backendConnector.load(o, this.options.ns, (f) => {
1254
- !f && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(f);
1255
- });
1256
- } else
1257
- n(null);
1258
- }
1259
- reloadResources(e, t, n) {
1260
- const i = V();
1261
- 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 = G), this.services.backendConnector.reload(e, t, (s) => {
1262
- i.resolve(), n(s);
1263
- }), i;
1264
- }
1265
- use(e) {
1266
- if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1267
- if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1268
- 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" && Ke.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1269
- }
1270
- setResolvedLanguage(e) {
1271
- if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1272
- for (let t = 0; t < this.languages.length; t++) {
1273
- const n = this.languages[t];
1274
- if (!(["cimode", "dev"].indexOf(n) > -1) && this.store.hasLanguageSomeTranslations(n)) {
1275
- this.resolvedLanguage = n;
1276
- break;
1277
- }
1278
- }
1279
- }
1280
- changeLanguage(e, t) {
1281
- var n = this;
1282
- this.isLanguageChangingTo = e;
1283
- const i = V();
1284
- this.emit("languageChanging", e);
1285
- const s = (u) => {
1286
- this.language = u, this.languages = this.services.languageUtils.toResolveHierarchy(u), this.resolvedLanguage = void 0, this.setResolvedLanguage(u);
1287
- }, a = (u, f) => {
1288
- f ? (s(f), this.translator.changeLanguage(f), this.isLanguageChangingTo = void 0, this.emit("languageChanged", f), this.logger.log("languageChanged", f)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
1289
- return n.t(...arguments);
1290
- }), t && t(u, function() {
1291
- return n.t(...arguments);
1292
- });
1293
- }, o = (u) => {
1294
- var l, d;
1295
- !e && !u && this.services.languageDetector && (u = []);
1296
- const f = m(u) ? u : this.services.languageUtils.getBestMatchFromCodes(u);
1297
- f && (this.language || s(f), this.translator.language || this.translator.changeLanguage(f), (d = (l = this.services.languageDetector) == null ? void 0 : l.cacheUserLanguage) == null || d.call(l, f)), this.loadResources(f, (c) => {
1298
- a(c, f);
1299
- });
1300
- };
1301
- return !e && this.services.languageDetector && !this.services.languageDetector.async ? o(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(o) : this.services.languageDetector.detect(o) : o(e), i;
1302
- }
1303
- getFixedT(e, t, n) {
1304
- var i = this;
1305
- const s = function(a, o) {
1306
- let u;
1307
- if (typeof o != "object") {
1308
- for (var f = arguments.length, l = new Array(f > 2 ? f - 2 : 0), d = 2; d < f; d++)
1309
- l[d - 2] = arguments[d];
1310
- u = i.options.overloadTranslationOptionHandler([a, o].concat(l));
1311
- } else
1312
- u = {
1313
- ...o
1314
- };
1315
- u.lng = u.lng || s.lng, u.lngs = u.lngs || s.lngs, u.ns = u.ns || s.ns, u.keyPrefix !== "" && (u.keyPrefix = u.keyPrefix || n || s.keyPrefix);
1316
- const c = i.options.keySeparator || ".";
1317
- let h;
1318
- return u.keyPrefix && Array.isArray(a) ? h = a.map((g) => `${u.keyPrefix}${c}${g}`) : h = u.keyPrefix ? `${u.keyPrefix}${c}${a}` : a, i.t(h, u);
1319
- };
1320
- return m(e) ? s.lng = e : s.lngs = e, s.ns = t, s.keyPrefix = n, s;
1321
- }
1322
- t() {
1323
- var i;
1324
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1325
- t[n] = arguments[n];
1326
- return (i = this.translator) == null ? void 0 : i.translate(...t);
1327
- }
1328
- exists() {
1329
- var i;
1330
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
1331
- t[n] = arguments[n];
1332
- return (i = this.translator) == null ? void 0 : i.exists(...t);
1333
- }
1334
- setDefaultNamespace(e) {
1335
- this.options.defaultNS = e;
1336
- }
1337
- hasLoadedNamespace(e) {
1338
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1339
- if (!this.isInitialized)
1340
- return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1341
- if (!this.languages || !this.languages.length)
1342
- return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1343
- const n = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, s = this.languages[this.languages.length - 1];
1344
- if (n.toLowerCase() === "cimode") return !0;
1345
- const a = (o, u) => {
1346
- const f = this.services.backendConnector.state[`${o}|${u}`];
1347
- return f === -1 || f === 0 || f === 2;
1348
- };
1349
- if (t.precheck) {
1350
- const o = t.precheck(this, a);
1351
- if (o !== void 0) return o;
1352
- }
1353
- return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!i || a(s, e)));
1354
- }
1355
- loadNamespaces(e, t) {
1356
- const n = V();
1357
- return this.options.ns ? (m(e) && (e = [e]), e.forEach((i) => {
1358
- this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
1359
- }), this.loadResources((i) => {
1360
- n.resolve(), t && t(i);
1361
- }), n) : (t && t(), Promise.resolve());
1362
- }
1363
- loadLanguages(e, t) {
1364
- const n = V();
1365
- m(e) && (e = [e]);
1366
- const i = this.options.preload || [], s = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
1367
- return s.length ? (this.options.preload = i.concat(s), this.loadResources((a) => {
1368
- n.resolve(), t && t(a);
1369
- }), n) : (t && t(), Promise.resolve());
1370
- }
1371
- dir(e) {
1372
- var i, s;
1373
- if (e || (e = this.resolvedLanguage || (((i = this.languages) == null ? void 0 : i.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1374
- 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 = ((s = this.services) == null ? void 0 : s.languageUtils) || new xe(Pe());
1375
- return t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1376
- }
1377
- static createInstance() {
1378
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1379
- return new X(e, t);
1380
- }
1381
- cloneInstance() {
1382
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : G;
1383
- const n = e.forkResourceStore;
1384
- n && delete e.forkResourceStore;
1385
- const i = {
1386
- ...this.options,
1387
- ...e,
1388
- isClone: !0
1389
- }, s = new X(i);
1390
- if ((e.debug !== void 0 || e.prefix !== void 0) && (s.logger = s.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
1391
- s[o] = this[o];
1392
- }), s.services = {
1393
- ...this.services
1394
- }, s.services.utils = {
1395
- hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
1396
- }, n) {
1397
- const o = Object.keys(this.store.data).reduce((u, f) => (u[f] = {
1398
- ...this.store.data[f]
1399
- }, Object.keys(u[f]).reduce((l, d) => (l[d] = {
1400
- ...u[f][d]
1401
- }, l), {})), {});
1402
- s.store = new be(o, i), s.services.resourceStore = s.store;
1403
- }
1404
- return s.translator = new te(s.services, i), s.translator.on("*", function(o) {
1405
- for (var u = arguments.length, f = new Array(u > 1 ? u - 1 : 0), l = 1; l < u; l++)
1406
- f[l - 1] = arguments[l];
1407
- s.emit(o, ...f);
1408
- }), s.init(i, t), s.translator.options = i, s.translator.backendConnector.services.utils = {
1409
- hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
1410
- }, s;
1411
- }
1412
- toJSON() {
1413
- return {
1414
- options: this.options,
1415
- store: this.store,
1416
- language: this.language,
1417
- languages: this.languages,
1418
- resolvedLanguage: this.resolvedLanguage
1419
- };
1420
- }
1421
- }
1422
- const Y = X.createInstance();
1423
- Y.createInstance = X.createInstance;
1424
- const {
1425
- slice: Lt,
1426
- forEach: Pt
1427
- } = [];
1428
- function kt(r) {
1429
- return Pt.call(Lt.call(arguments, 1), (e) => {
1430
- if (e)
1431
- for (const t in e)
1432
- r[t] === void 0 && (r[t] = e[t]);
1433
- }), r;
1434
- }
1435
- const Ce = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Ct = function(r, e) {
1436
- const n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
1437
- path: "/"
1438
- }, i = encodeURIComponent(e);
1439
- let s = `${r}=${i}`;
1440
- if (n.maxAge > 0) {
1441
- const a = n.maxAge - 0;
1442
- if (Number.isNaN(a)) throw new Error("maxAge should be a Number");
1443
- s += `; Max-Age=${Math.floor(a)}`;
1444
- }
1445
- if (n.domain) {
1446
- if (!Ce.test(n.domain))
1447
- throw new TypeError("option domain is invalid");
1448
- s += `; Domain=${n.domain}`;
1449
- }
1450
- if (n.path) {
1451
- if (!Ce.test(n.path))
1452
- throw new TypeError("option path is invalid");
1453
- s += `; Path=${n.path}`;
1454
- }
1455
- if (n.expires) {
1456
- if (typeof n.expires.toUTCString != "function")
1457
- throw new TypeError("option expires is invalid");
1458
- s += `; Expires=${n.expires.toUTCString()}`;
1459
- }
1460
- if (n.httpOnly && (s += "; HttpOnly"), n.secure && (s += "; Secure"), n.sameSite)
1461
- switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
1462
- case !0:
1463
- s += "; SameSite=Strict";
1464
- break;
1465
- case "lax":
1466
- s += "; SameSite=Lax";
1467
- break;
1468
- case "strict":
1469
- s += "; SameSite=Strict";
1470
- break;
1471
- case "none":
1472
- s += "; SameSite=None";
1473
- break;
1474
- default:
1475
- throw new TypeError("option sameSite is invalid");
1476
- }
1477
- return s;
1478
- }, $e = {
1479
- create(r, e, t, n) {
1480
- let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
1481
- path: "/",
1482
- sameSite: "strict"
1483
- };
1484
- t && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + t * 60 * 1e3)), n && (i.domain = n), document.cookie = Ct(r, encodeURIComponent(e), i);
1485
- },
1486
- read(r) {
1487
- const e = `${r}=`, t = document.cookie.split(";");
1488
- for (let n = 0; n < t.length; n++) {
1489
- let i = t[n];
1490
- for (; i.charAt(0) === " "; ) i = i.substring(1, i.length);
1491
- if (i.indexOf(e) === 0) return i.substring(e.length, i.length);
1492
- }
1493
- return null;
1494
- },
1495
- remove(r) {
1496
- this.create(r, "", -1);
1497
- }
1498
- };
1499
- var $t = {
1500
- name: "cookie",
1501
- // Deconstruct the options object and extract the lookupCookie property
1502
- lookup(r) {
1503
- let {
1504
- lookupCookie: e
1505
- } = r;
1506
- if (e && typeof document < "u")
1507
- return $e.read(e) || void 0;
1508
- },
1509
- // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
1510
- cacheUserLanguage(r, e) {
1511
- let {
1512
- lookupCookie: t,
1513
- cookieMinutes: n,
1514
- cookieDomain: i,
1515
- cookieOptions: s
1516
- } = e;
1517
- t && typeof document < "u" && $e.create(t, r, n, i, s);
1518
- }
1519
- }, Rt = {
1520
- name: "querystring",
1521
- // Deconstruct the options object and extract the lookupQuerystring property
1522
- lookup(r) {
1523
- var n;
1524
- let {
1525
- lookupQuerystring: e
1526
- } = r, t;
1527
- if (typeof window < "u") {
1528
- let {
1529
- search: i
1530
- } = window.location;
1531
- !window.location.search && ((n = window.location.hash) == null ? void 0 : n.indexOf("?")) > -1 && (i = window.location.hash.substring(window.location.hash.indexOf("?")));
1532
- const a = i.substring(1).split("&");
1533
- for (let o = 0; o < a.length; o++) {
1534
- const u = a[o].indexOf("=");
1535
- u > 0 && a[o].substring(0, u) === e && (t = a[o].substring(u + 1));
1536
- }
1537
- }
1538
- return t;
1539
- }
1540
- };
1541
- let q = null;
1542
- const Re = () => {
1543
- if (q !== null) return q;
1544
- try {
1545
- q = window !== "undefined" && window.localStorage !== null;
1546
- const r = "i18next.translate.boo";
1547
- window.localStorage.setItem(r, "foo"), window.localStorage.removeItem(r);
1548
- } catch {
1549
- q = !1;
1550
- }
1551
- return q;
1552
- };
1553
- var jt = {
1554
- name: "localStorage",
1555
- // Deconstruct the options object and extract the lookupLocalStorage property
1556
- lookup(r) {
1557
- let {
1558
- lookupLocalStorage: e
1559
- } = r;
1560
- if (e && Re())
1561
- return window.localStorage.getItem(e) || void 0;
1562
- },
1563
- // Deconstruct the options object and extract the lookupLocalStorage property
1564
- cacheUserLanguage(r, e) {
1565
- let {
1566
- lookupLocalStorage: t
1567
- } = e;
1568
- t && Re() && window.localStorage.setItem(t, r);
1569
- }
1570
- };
1571
- let B = null;
1572
- const je = () => {
1573
- if (B !== null) return B;
1574
- try {
1575
- B = window !== "undefined" && window.sessionStorage !== null;
1576
- const r = "i18next.translate.boo";
1577
- window.sessionStorage.setItem(r, "foo"), window.sessionStorage.removeItem(r);
1578
- } catch {
1579
- B = !1;
1580
- }
1581
- return B;
1582
- };
1583
- var Et = {
1584
- name: "sessionStorage",
1585
- lookup(r) {
1586
- let {
1587
- lookupSessionStorage: e
1588
- } = r;
1589
- if (e && je())
1590
- return window.sessionStorage.getItem(e) || void 0;
1591
- },
1592
- cacheUserLanguage(r, e) {
1593
- let {
1594
- lookupSessionStorage: t
1595
- } = e;
1596
- t && je() && window.sessionStorage.setItem(t, r);
1597
- }
1598
- }, Nt = {
1599
- name: "navigator",
1600
- lookup(r) {
1601
- const e = [];
1602
- if (typeof navigator < "u") {
1603
- const {
1604
- languages: t,
1605
- userLanguage: n,
1606
- language: i
1607
- } = navigator;
1608
- if (t)
1609
- for (let s = 0; s < t.length; s++)
1610
- e.push(t[s]);
1611
- n && e.push(n), i && e.push(i);
1612
- }
1613
- return e.length > 0 ? e : void 0;
1614
- }
1615
- }, Ft = {
1616
- name: "htmlTag",
1617
- // Deconstruct the options object and extract the htmlTag property
1618
- lookup(r) {
1619
- let {
1620
- htmlTag: e
1621
- } = r, t;
1622
- const n = e || (typeof document < "u" ? document.documentElement : null);
1623
- return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
1624
- }
1625
- }, At = {
1626
- name: "path",
1627
- // Deconstruct the options object and extract the lookupFromPathIndex property
1628
- lookup(r) {
1629
- var i;
1630
- let {
1631
- lookupFromPathIndex: e
1632
- } = r;
1633
- if (typeof window > "u") return;
1634
- const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
1635
- return Array.isArray(t) ? (i = t[typeof e == "number" ? e : 0]) == null ? void 0 : i.replace("/", "") : void 0;
1636
- }
1637
- }, Dt = {
1638
- name: "subdomain",
1639
- lookup(r) {
1640
- var i, s;
1641
- let {
1642
- lookupFromSubdomainIndex: e
1643
- } = r;
1644
- const t = typeof e == "number" ? e + 1 : 1, n = typeof window < "u" && ((s = (i = window.location) == null ? void 0 : i.hostname) == null ? void 0 : s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));
1645
- if (n)
1646
- return n[t];
1647
- }
1648
- };
1649
- let Ve = !1;
1650
- try {
1651
- Ve = !0;
1652
- } catch {
1653
- }
1654
- const qe = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
1655
- Ve || qe.splice(1, 1);
1656
- const Tt = () => ({
1657
- order: qe,
1658
- lookupQuerystring: "lng",
1659
- lookupCookie: "i18next",
1660
- lookupLocalStorage: "i18nextLng",
1661
- lookupSessionStorage: "i18nextLng",
1662
- // cache user language
1663
- caches: ["localStorage"],
1664
- excludeCacheFor: ["cimode"],
1665
- // cookieMinutes: 10,
1666
- // cookieDomain: 'myDomain'
1667
- convertDetectedLanguage: (r) => r
1668
- });
1669
- class Be {
1670
- constructor(e) {
1671
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1672
- this.type = "languageDetector", this.detectors = {}, this.init(e, t);
1673
- }
1674
- init() {
1675
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
1676
- languageUtils: {}
1677
- }, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1678
- this.services = e, this.options = kt(t, this.options || {}, Tt()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (i) => i.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector($t), this.addDetector(Rt), this.addDetector(jt), this.addDetector(Et), this.addDetector(Nt), this.addDetector(Ft), this.addDetector(At), this.addDetector(Dt);
1679
- }
1680
- addDetector(e) {
1681
- return this.detectors[e.name] = e, this;
1682
- }
1683
- detect() {
1684
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
1685
- return e.forEach((n) => {
1686
- if (this.detectors[n]) {
1687
- let i = this.detectors[n].lookup(this.options);
1688
- i && typeof i == "string" && (i = [i]), i && (t = t.concat(i));
1689
- }
1690
- }), t = t.map((n) => this.options.convertDetectedLanguage(n)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
1691
- }
1692
- cacheUserLanguage(e) {
1693
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
1694
- t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach((n) => {
1695
- this.detectors[n] && this.detectors[n].cacheUserLanguage(e, this.options);
1696
- }));
1697
- }
1698
- }
1699
- Be.type = "languageDetector";
1700
- function It(r, e) {
1701
- if (!(r instanceof e)) throw new TypeError("Cannot call a class as a function");
1702
- }
1703
- function J(r) {
1704
- "@babel/helpers - typeof";
1705
- return J = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1706
- return typeof e;
1707
- } : function(e) {
1708
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1709
- }, J(r);
1710
- }
1711
- function Ht(r, e) {
1712
- if (J(r) != "object" || !r) return r;
1713
- var t = r[Symbol.toPrimitive];
1714
- if (t !== void 0) {
1715
- var n = t.call(r, e);
1716
- if (J(n) != "object") return n;
1717
- throw new TypeError("@@toPrimitive must return a primitive value.");
1718
- }
1719
- return String(r);
1720
- }
1721
- function Ut(r) {
1722
- var e = Ht(r, "string");
1723
- return J(e) == "symbol" ? e : e + "";
1724
- }
1725
- function Mt(r, e) {
1726
- for (var t = 0; t < e.length; t++) {
1727
- var n = e[t];
1728
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, Ut(n.key), n);
1729
- }
1730
- }
1731
- function Kt(r, e, t) {
1732
- return e && Mt(r.prototype, e), Object.defineProperty(r, "prototype", {
1733
- writable: !1
1734
- }), r;
1735
- }
1736
- var ze = [], Vt = ze.forEach, qt = ze.slice;
1737
- function Bt(r) {
1738
- return Vt.call(qt.call(arguments, 1), function(e) {
1739
- if (e)
1740
- for (var t in e)
1741
- r[t] === void 0 && (r[t] = e[t]);
1742
- }), r;
1743
- }
1744
- function zt(r) {
1745
- return r ? typeof r == "function" ? new r() : r : null;
1746
- }
1747
- function Xt() {
1748
- return {
1749
- handleEmptyResourcesAsFailed: !0,
1750
- cacheHitMode: "none"
1751
- // reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000
1752
- // refreshExpirationTime: 60 * 60 * 1000
1753
- };
1754
- }
1755
- function Ee(r, e, t, n) {
1756
- var i = r.read.bind(r);
1757
- if (i.length === 2) {
1758
- try {
1759
- var s = i(e, t);
1760
- s && typeof s.then == "function" ? s.then(function(a) {
1761
- return n(null, a);
1762
- }).catch(n) : n(null, s);
1763
- } catch (a) {
1764
- n(a);
1765
- }
1766
- return;
1767
- }
1768
- i(e, t, n);
1769
- }
1770
- var Xe = /* @__PURE__ */ function() {
1771
- function r(e) {
1772
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1773
- It(this, r), this.backends = [], this.type = "backend", this.allOptions = n, this.init(e, t);
1774
- }
1775
- return Kt(r, [{
1776
- key: "init",
1777
- value: function(t) {
1778
- var n = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1779
- this.services = t, this.options = Bt(i, this.options || {}, Xt()), this.allOptions = s, this.options.backends && this.options.backends.forEach(function(a, o) {
1780
- n.backends[o] = n.backends[o] || zt(a), n.backends[o].init(t, n.options.backendOptions && n.options.backendOptions[o] || {}, s);
1781
- }), this.services && this.options.reloadInterval && setInterval(function() {
1782
- return n.reload();
1783
- }, this.options.reloadInterval);
1784
- }
1785
- }, {
1786
- key: "read",
1787
- value: function(t, n, i) {
1788
- var s = this, a = this.backends.length, o = function f(l) {
1789
- if (l >= a) return i(new Error("non of the backend loaded data", !0));
1790
- var d = l === a - 1, c = s.options.handleEmptyResourcesAsFailed && !d ? 0 : -1, h = s.backends[l];
1791
- h.read ? Ee(h, t, n, function(g, p, y) {
1792
- if (!g && p && Object.keys(p).length > c) {
1793
- if (i(null, p, l), u(l - 1, p), h.save && s.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(s.options.cacheHitMode) > -1) {
1794
- if (y && s.options.refreshExpirationTime && y + s.options.refreshExpirationTime > Date.now()) return;
1795
- var b = s.backends[l + 1];
1796
- b && b.read && Ee(b, t, n, function(S, x) {
1797
- S || x && (Object.keys(x).length <= c || (u(l, x), s.options.cacheHitMode === "refreshAndUpdateStore" && s.services && s.services.resourceStore && s.services.resourceStore.addResourceBundle(t, n, x)));
1798
- });
1799
- }
1800
- } else
1801
- f(l + 1);
1802
- }) : f(l + 1);
1803
- }, u = function f(l, d) {
1804
- if (!(l < 0)) {
1805
- var c = s.backends[l];
1806
- c.save && c.save(t, n, d), f(l - 1, d);
1807
- }
1808
- };
1809
- o(0);
1810
- }
1811
- }, {
1812
- key: "create",
1813
- value: function(t, n, i, s) {
1814
- var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {
1815
- }, o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
1816
- this.backends.forEach(function(u) {
1817
- if (u.create) {
1818
- var f = u.create.bind(u);
1819
- if (f.length < 6) {
1820
- try {
1821
- var l;
1822
- f.length === 5 ? l = f(t, n, i, s, o) : l = f(t, n, i, s), l && typeof l.then == "function" ? l.then(function(d) {
1823
- return a(null, d);
1824
- }).catch(a) : a(null, l);
1825
- } catch (d) {
1826
- a(d);
1827
- }
1828
- return;
1829
- }
1830
- f(t, n, i, s, a, o);
1831
- }
1832
- });
1833
- }
1834
- }, {
1835
- key: "reload",
1836
- value: function() {
1837
- var t = this, n = this.services, i = n.backendConnector, s = n.languageUtils, a = n.logger, o = i.language;
1838
- if (!(o && o.toLowerCase() === "cimode")) {
1839
- var u = [], f = function(d) {
1840
- var c = s.toResolveHierarchy(d);
1841
- c.forEach(function(h) {
1842
- u.indexOf(h) < 0 && u.push(h);
1843
- });
1844
- };
1845
- f(o), this.allOptions.preload && this.allOptions.preload.forEach(function(l) {
1846
- return f(l);
1847
- }), u.forEach(function(l) {
1848
- t.allOptions.ns.forEach(function(d) {
1849
- i.read(l, d, "read", null, null, function(c, h) {
1850
- c && a.warn("loading namespace ".concat(d, " for language ").concat(l, " failed"), c), !c && h && a.log("loaded namespace ".concat(d, " for language ").concat(l), h), i.loaded("".concat(l, "|").concat(d), c, h);
1851
- });
1852
- });
1853
- });
1854
- }
1855
- }
1856
- }]), r;
1857
- }();
1858
- Xe.type = "backend";
1859
- function ue(r) {
1860
- "@babel/helpers - typeof";
1861
- return ue = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1862
- return typeof e;
1863
- } : function(e) {
1864
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1865
- }, ue(r);
1866
- }
1867
- function Je() {
1868
- return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : ue(XMLHttpRequest)) === "object";
1869
- }
1870
- function Jt(r) {
1871
- return !!r && typeof r.then == "function";
1872
- }
1873
- function Wt(r) {
1874
- return Jt(r) ? r : Promise.resolve(r);
1875
- }
1876
- function Ne(r, e) {
1877
- var t = Object.keys(r);
1878
- if (Object.getOwnPropertySymbols) {
1879
- var n = Object.getOwnPropertySymbols(r);
1880
- e && (n = n.filter(function(i) {
1881
- return Object.getOwnPropertyDescriptor(r, i).enumerable;
1882
- })), t.push.apply(t, n);
1883
- }
1884
- return t;
1885
- }
1886
- function Fe(r) {
1887
- for (var e = 1; e < arguments.length; e++) {
1888
- var t = arguments[e] != null ? arguments[e] : {};
1889
- e % 2 ? Ne(Object(t), !0).forEach(function(n) {
1890
- Qt(r, n, t[n]);
1891
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : Ne(Object(t)).forEach(function(n) {
1892
- Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
1893
- });
1894
- }
1895
- return r;
1896
- }
1897
- function Qt(r, e, t) {
1898
- return (e = Gt(e)) in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
1899
- }
1900
- function Gt(r) {
1901
- var e = Yt(r, "string");
1902
- return N(e) == "symbol" ? e : e + "";
1903
- }
1904
- function Yt(r, e) {
1905
- if (N(r) != "object" || !r) return r;
1906
- var t = r[Symbol.toPrimitive];
1907
- if (t !== void 0) {
1908
- var n = t.call(r, e);
1909
- if (N(n) != "object") return n;
1910
- throw new TypeError("@@toPrimitive must return a primitive value.");
1911
- }
1912
- return (e === "string" ? String : Number)(r);
1913
- }
1914
- function N(r) {
1915
- "@babel/helpers - typeof";
1916
- return N = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1917
- return typeof e;
1918
- } : function(e) {
1919
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1920
- }, N(r);
1921
- }
1922
- var j = typeof fetch == "function" ? fetch : void 0;
1923
- typeof global < "u" && global.fetch ? j = global.fetch : typeof window < "u" && window.fetch && (j = window.fetch);
1924
- var W;
1925
- Je() && (typeof global < "u" && global.XMLHttpRequest ? W = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (W = window.XMLHttpRequest));
1926
- var ne;
1927
- typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? ne = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (ne = window.ActiveXObject));
1928
- typeof j != "function" && (j = void 0);
1929
- if (!j && !W && !ne)
1930
- try {
1931
- import("./browser-ponyfill-Dy1JBTMg.js").then((r) => r.b).then(function(r) {
1932
- j = r.default;
1933
- }).catch(function() {
1934
- });
1935
- } catch {
1936
- }
1937
- var le = function(e, t) {
1938
- if (t && N(t) === "object") {
1939
- var n = "";
1940
- for (var i in t)
1941
- n += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(t[i]);
1942
- if (!n) return e;
1943
- e = e + (e.indexOf("?") !== -1 ? "&" : "?") + n.slice(1);
1944
- }
1945
- return e;
1946
- }, Ae = function(e, t, n, i) {
1947
- var s = function(u) {
1948
- if (!u.ok) return n(u.statusText || "Error", {
1949
- status: u.status
1950
- });
1951
- u.text().then(function(f) {
1952
- n(null, {
1953
- status: u.status,
1954
- data: f
1955
- });
1956
- }).catch(n);
1957
- };
1958
- if (i) {
1959
- var a = i(e, t);
1960
- if (a instanceof Promise) {
1961
- a.then(s).catch(n);
1962
- return;
1963
- }
1964
- }
1965
- typeof fetch == "function" ? fetch(e, t).then(s).catch(n) : j(e, t).then(s).catch(n);
1966
- }, De = !1, Zt = function(e, t, n, i) {
1967
- e.queryStringParams && (t = le(t, e.queryStringParams));
1968
- var s = Fe({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
1969
- typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (s["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), n && (s["Content-Type"] = "application/json");
1970
- var a = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, o = Fe({
1971
- method: n ? "POST" : "GET",
1972
- body: n ? e.stringify(n) : void 0,
1973
- headers: s
1974
- }, De ? {} : a), u = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
1975
- try {
1976
- Ae(t, o, i, u);
1977
- } catch (f) {
1978
- if (!a || Object.keys(a).length === 0 || !f.message || f.message.indexOf("not implemented") < 0)
1979
- return i(f);
1980
- try {
1981
- Object.keys(a).forEach(function(l) {
1982
- delete o[l];
1983
- }), Ae(t, o, i, u), De = !0;
1984
- } catch (l) {
1985
- i(l);
1986
- }
1987
- }
1988
- }, _t = function(e, t, n, i) {
1989
- n && N(n) === "object" && (n = le("", n).slice(1)), e.queryStringParams && (t = le(t, e.queryStringParams));
1990
- try {
1991
- var s = W ? new W() : new ne("MSXML2.XMLHTTP.3.0");
1992
- s.open(n ? "POST" : "GET", t, 1), e.crossDomain || s.setRequestHeader("X-Requested-With", "XMLHttpRequest"), s.withCredentials = !!e.withCredentials, n && s.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), s.overrideMimeType && s.overrideMimeType("application/json");
1993
- var a = e.customHeaders;
1994
- if (a = typeof a == "function" ? a() : a, a)
1995
- for (var o in a)
1996
- s.setRequestHeader(o, a[o]);
1997
- s.onreadystatechange = function() {
1998
- s.readyState > 3 && i(s.status >= 400 ? s.statusText : null, {
1999
- status: s.status,
2000
- data: s.responseText
2001
- });
2002
- }, s.send(n);
2003
- } catch (u) {
2004
- }
2005
- }, en = function(e, t, n, i) {
2006
- if (typeof n == "function" && (i = n, n = void 0), i = i || function() {
2007
- }, j && t.indexOf("file:") !== 0)
2008
- return Zt(e, t, n, i);
2009
- if (Je() || typeof ActiveXObject == "function")
2010
- return _t(e, t, n, i);
2011
- i(new Error("No fetch and no xhr implementation found!"));
2012
- };
2013
- function I(r) {
2014
- "@babel/helpers - typeof";
2015
- return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2016
- return typeof e;
2017
- } : function(e) {
2018
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2019
- }, I(r);
2020
- }
2021
- function Te(r, e) {
2022
- var t = Object.keys(r);
2023
- if (Object.getOwnPropertySymbols) {
2024
- var n = Object.getOwnPropertySymbols(r);
2025
- e && (n = n.filter(function(i) {
2026
- return Object.getOwnPropertyDescriptor(r, i).enumerable;
2027
- })), t.push.apply(t, n);
2028
- }
2029
- return t;
2030
- }
2031
- function se(r) {
2032
- for (var e = 1; e < arguments.length; e++) {
2033
- var t = arguments[e] != null ? arguments[e] : {};
2034
- e % 2 ? Te(Object(t), !0).forEach(function(n) {
2035
- We(r, n, t[n]);
2036
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : Te(Object(t)).forEach(function(n) {
2037
- Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
2038
- });
2039
- }
2040
- return r;
2041
- }
2042
- function tn(r, e) {
2043
- if (!(r instanceof e)) throw new TypeError("Cannot call a class as a function");
2044
- }
2045
- function nn(r, e) {
2046
- for (var t = 0; t < e.length; t++) {
2047
- var n = e[t];
2048
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, Qe(n.key), n);
2049
- }
2050
- }
2051
- function rn(r, e, t) {
2052
- return e && nn(r.prototype, e), Object.defineProperty(r, "prototype", { writable: !1 }), r;
2053
- }
2054
- function We(r, e, t) {
2055
- return (e = Qe(e)) in r ? Object.defineProperty(r, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = t, r;
2056
- }
2057
- function Qe(r) {
2058
- var e = sn(r, "string");
2059
- return I(e) == "symbol" ? e : e + "";
2060
- }
2061
- function sn(r, e) {
2062
- if (I(r) != "object" || !r) return r;
2063
- var t = r[Symbol.toPrimitive];
2064
- if (t !== void 0) {
2065
- var n = t.call(r, e);
2066
- if (I(n) != "object") return n;
2067
- throw new TypeError("@@toPrimitive must return a primitive value.");
2068
- }
2069
- return String(r);
2070
- }
2071
- var an = function() {
2072
- return {
2073
- loadPath: "/locales/{{lng}}/{{ns}}.json",
2074
- addPath: "/locales/add/{{lng}}/{{ns}}",
2075
- parse: function(t) {
2076
- return JSON.parse(t);
2077
- },
2078
- stringify: JSON.stringify,
2079
- parsePayload: function(t, n, i) {
2080
- return We({}, n, i || "");
2081
- },
2082
- parseLoadPayload: function(t, n) {
2083
- },
2084
- request: en,
2085
- reloadInterval: typeof window < "u" ? !1 : 60 * 60 * 1e3,
2086
- customHeaders: {},
2087
- queryStringParams: {},
2088
- crossDomain: !1,
2089
- withCredentials: !1,
2090
- overrideMimeType: !1,
2091
- requestOptions: {
2092
- mode: "cors",
2093
- credentials: "same-origin",
2094
- cache: "default"
2095
- }
2096
- };
2097
- }, Ge = function() {
2098
- function r(e) {
2099
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2100
- tn(this, r), this.services = e, this.options = t, this.allOptions = n, this.type = "backend", this.init(e, t, n);
2101
- }
2102
- return rn(r, [{
2103
- key: "init",
2104
- value: function(t) {
2105
- var n = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2106
- if (this.services = t, this.options = se(se(se({}, an()), this.options || {}), i), this.allOptions = s, this.services && this.options.reloadInterval) {
2107
- var a = setInterval(function() {
2108
- return n.reload();
2109
- }, this.options.reloadInterval);
2110
- I(a) === "object" && typeof a.unref == "function" && a.unref();
2111
- }
2112
- }
2113
- }, {
2114
- key: "readMulti",
2115
- value: function(t, n, i) {
2116
- this._readAny(t, t, n, n, i);
2117
- }
2118
- }, {
2119
- key: "read",
2120
- value: function(t, n, i) {
2121
- this._readAny([t], t, [n], n, i);
2122
- }
2123
- }, {
2124
- key: "_readAny",
2125
- value: function(t, n, i, s, a) {
2126
- var o = this, u = this.options.loadPath;
2127
- typeof this.options.loadPath == "function" && (u = this.options.loadPath(t, i)), u = Wt(u), u.then(function(f) {
2128
- if (!f) return a(null, {});
2129
- var l = o.services.interpolator.interpolate(f, {
2130
- lng: t.join("+"),
2131
- ns: i.join("+")
2132
- });
2133
- o.loadUrl(l, a, n, s);
2134
- });
2135
- }
2136
- }, {
2137
- key: "loadUrl",
2138
- value: function(t, n, i, s) {
2139
- var a = this, o = typeof i == "string" ? [i] : i, u = typeof s == "string" ? [s] : s, f = this.options.parseLoadPayload(o, u);
2140
- this.options.request(this.options, t, f, function(l, d) {
2141
- if (d && (d.status >= 500 && d.status < 600 || !d.status)) return n("failed loading " + t + "; status code: " + d.status, !0);
2142
- if (d && d.status >= 400 && d.status < 500) return n("failed loading " + t + "; status code: " + d.status, !1);
2143
- if (!d && l && l.message) {
2144
- var c = l.message.toLowerCase(), h = ["failed", "fetch", "network", "load"].find(function(y) {
2145
- return c.indexOf(y) > -1;
2146
- });
2147
- if (h)
2148
- return n("failed loading " + t + ": " + l.message, !0);
2149
- }
2150
- if (l) return n(l, !1);
2151
- var g, p;
2152
- try {
2153
- typeof d.data == "string" ? g = a.options.parse(d.data, i, s) : g = d.data;
2154
- } catch {
2155
- p = "failed parsing " + t + " to json";
2156
- }
2157
- if (p) return n(p, !1);
2158
- n(null, g);
2159
- });
2160
- }
2161
- }, {
2162
- key: "create",
2163
- value: function(t, n, i, s, a) {
2164
- var o = this;
2165
- if (this.options.addPath) {
2166
- typeof t == "string" && (t = [t]);
2167
- var u = this.options.parsePayload(n, i, s), f = 0, l = [], d = [];
2168
- t.forEach(function(c) {
2169
- var h = o.options.addPath;
2170
- typeof o.options.addPath == "function" && (h = o.options.addPath(c, n));
2171
- var g = o.services.interpolator.interpolate(h, {
2172
- lng: c,
2173
- ns: n
2174
- });
2175
- o.options.request(o.options, g, u, function(p, y) {
2176
- f += 1, l.push(p), d.push(y), f === t.length && typeof a == "function" && a(l, d);
2177
- });
2178
- });
2179
- }
2180
- }
2181
- }, {
2182
- key: "reload",
2183
- value: function() {
2184
- var t = this, n = this.services, i = n.backendConnector, s = n.languageUtils, a = n.logger, o = i.language;
2185
- if (!(o && o.toLowerCase() === "cimode")) {
2186
- var u = [], f = function(d) {
2187
- var c = s.toResolveHierarchy(d);
2188
- c.forEach(function(h) {
2189
- u.indexOf(h) < 0 && u.push(h);
2190
- });
2191
- };
2192
- f(o), this.allOptions.preload && this.allOptions.preload.forEach(function(l) {
2193
- return f(l);
2194
- }), u.forEach(function(l) {
2195
- t.allOptions.ns.forEach(function(d) {
2196
- i.read(l, d, "read", null, null, function(c, h) {
2197
- c && a.warn("loading namespace ".concat(d, " for language ").concat(l, " failed"), c), !c && h && a.log("loaded namespace ".concat(d, " for language ").concat(l), h), i.loaded("".concat(l, "|").concat(d), c, h);
2198
- });
2199
- });
2200
- });
2201
- }
2202
- }
2203
- }]);
2204
- }();
2205
- Ge.type = "backend";
2206
- var on = function(e) {
2207
- return {
2208
- type: "backend",
2209
- init: function(n, i, s) {
2210
- },
2211
- read: function(n, i, s) {
2212
- if (typeof e == "function") {
2213
- if (e.length < 3) {
2214
- try {
2215
- var a = e(n, i);
2216
- a && typeof a.then == "function" ? a.then(function(o) {
2217
- return s(null, o && o.default || o);
2218
- }).catch(s) : s(null, a);
2219
- } catch (o) {
2220
- s(o);
2221
- }
2222
- return;
2223
- }
2224
- e(n, i, s);
2225
- return;
2226
- }
2227
- s(null, e && e[n] && e[n][i]);
2228
- }
2229
- };
2230
- };
2231
- const un = {
2232
- react: {
2233
- useSuspense: !0
2234
- },
2235
- detection: {
2236
- order: ["navigator", "htmlTag", "path", "subdomain"],
2237
- caches: ["localStorage", "cookie"]
2238
- }
2239
- }, Ie = (r, e) => {
2240
- const t = import.meta.url.split("/").pop();
2241
- return `${import.meta.url.replace(`/${t}`, "")}/locales/${r}/${e}.json`;
2242
- };
2243
- function He() {
2244
- return Y.isInitialized || Y.use(Xe).use(Be).use(st).init({
2245
- debug: !0,
2246
- fallbackLng: Ze.enum.en,
2247
- namespace: "translation",
2248
- supportedLngs: Ye,
2249
- backend: {
2250
- backends: [
2251
- Ge,
2252
- on((r, e) => import(Ie(r, e)))
2253
- ],
2254
- backendOptions: [
2255
- {
2256
- loadPath: Ie("{{lng}}", "{{ns}}")
2257
- }
2258
- ]
2259
- },
2260
- ...un
2261
- }), Y;
2262
- }
2263
- const dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2264
- __proto__: null,
2265
- default: He,
2266
- initializeI18n: He
2267
- }, Symbol.toStringTag, { value: "Module" }));
2268
- export {
2269
- fn as a,
2270
- dn as b,
2271
- cn as g,
2272
- He as i
2273
- };