wcz-test 7.1.3 → 7.2.1
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.
- package/dist/DialogsContext-CGAKEKKW.js +546 -0
- package/dist/DialogsContext-CGAKEKKW.js.map +1 -0
- package/dist/{DialogsHooks-BXfwbYWP.js → DialogsHooks-BZUdpDVJ.js} +14 -14
- package/dist/DialogsHooks-BZUdpDVJ.js.map +1 -0
- package/dist/RouterListItemButton-C_jUvB6C.js +18 -0
- package/dist/{RouterListItemButton-DrW6M53Y.js.map → RouterListItemButton-C_jUvB6C.js.map} +1 -1
- package/dist/compiler-runtime-BNHg76kC.js +37 -0
- package/dist/compiler-runtime-BNHg76kC.js.map +1 -0
- package/dist/components/core/Layout.d.ts +1 -1
- package/dist/components.js +686 -682
- package/dist/components.js.map +1 -1
- package/dist/env-Dy8Ynqa-.js +75 -0
- package/dist/env-Dy8Ynqa-.js.map +1 -0
- package/dist/exports/hooks.d.ts +1 -1
- package/dist/exports/middleware.d.ts +1 -0
- package/dist/exports/server.d.ts +1 -0
- package/dist/exports/utils.d.ts +2 -2
- package/dist/hooks/UseScanDetection.d.ts +28 -0
- package/dist/hooks.js +603 -610
- package/dist/hooks.js.map +1 -1
- package/dist/{i18next-Bx3TmZAT.js → i18next-8reizFda.js} +71 -63
- package/dist/i18next-8reizFda.js.map +1 -0
- package/dist/{index-DchOf6FV.js → index-CsRHHlp3.js} +9 -6
- package/dist/index-CsRHHlp3.js.map +1 -0
- package/dist/index.js +662 -821
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/msalClient.d.ts +20 -0
- package/dist/lib/auth/msalServer.d.ts +11 -0
- package/dist/lib/auth/scopes.d.ts +2 -0
- package/dist/lib/auth/utils.d.ts +0 -0
- package/dist/lib/theme.d.ts +1 -0
- package/dist/lib/utils.d.ts +2 -10
- package/dist/middleware/authMiddleware.d.ts +6 -0
- package/dist/middleware.js +1101 -0
- package/dist/middleware.js.map +1 -0
- package/dist/models/TokenPayload.d.ts +8 -0
- package/dist/models/User.d.ts +10 -13
- package/dist/msalClient-l-DV8PoB.js +76 -0
- package/dist/msalClient-l-DV8PoB.js.map +1 -0
- package/dist/providers/AuthProvider.d.ts +0 -2
- package/dist/queries/FileHooks.d.ts +1 -1
- package/dist/queries/GraphQueries.d.ts +0 -20
- package/dist/query.js +1 -1
- package/dist/server.js +36 -0
- package/dist/server.js.map +1 -0
- package/dist/utils-BGMLqA26.js +81 -0
- package/dist/utils-BGMLqA26.js.map +1 -0
- package/dist/utils.js +9 -6
- package/dist/utils.js.map +1 -1
- package/package.json +20 -11
- package/dist/DialogsContext-8xfQ3X-k.js +0 -285
- package/dist/DialogsContext-8xfQ3X-k.js.map +0 -1
- package/dist/DialogsHooks-BXfwbYWP.js.map +0 -1
- package/dist/RouterListItemButton-DrW6M53Y.js +0 -17
- package/dist/hooks/User.d.ts +0 -8
- package/dist/i18next-Bx3TmZAT.js.map +0 -1
- package/dist/index-DchOf6FV.js.map +0 -1
- package/dist/utils-Dttzp8un.js +0 -10879
- package/dist/utils-Dttzp8un.js.map +0 -1
|
@@ -4,23 +4,23 @@ const d = (o) => typeof o == "string", K = () => {
|
|
|
4
4
|
o = i, e = s;
|
|
5
5
|
});
|
|
6
6
|
return t.resolve = o, t.reject = e, t;
|
|
7
|
-
},
|
|
7
|
+
}, ie = (o) => o == null ? "" : "" + o, be = (o, e, t) => {
|
|
8
8
|
o.forEach((i) => {
|
|
9
9
|
e[i] && (t[i] = e[i]);
|
|
10
10
|
});
|
|
11
|
-
}, Le = /###/g,
|
|
11
|
+
}, Le = /###/g, ne = (o) => o && o.indexOf("###") > -1 ? o.replace(Le, ".") : o, re = (o) => !o || d(o), A = (o, e, t) => {
|
|
12
12
|
const i = d(e) ? e.split(".") : e;
|
|
13
13
|
let s = 0;
|
|
14
14
|
for (; s < i.length - 1; ) {
|
|
15
|
-
if (
|
|
16
|
-
const n =
|
|
15
|
+
if (re(o)) return {};
|
|
16
|
+
const n = ne(i[s]);
|
|
17
17
|
!o[n] && t && (o[n] = new t()), Object.prototype.hasOwnProperty.call(o, n) ? o = o[n] : o = {}, ++s;
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return re(o) ? {} : {
|
|
20
20
|
obj: o,
|
|
21
|
-
k:
|
|
21
|
+
k: ne(i[s])
|
|
22
22
|
};
|
|
23
|
-
},
|
|
23
|
+
}, ae = (o, e, t) => {
|
|
24
24
|
const {
|
|
25
25
|
obj: i,
|
|
26
26
|
k: s
|
|
@@ -53,7 +53,7 @@ const d = (o) => typeof o == "string", K = () => {
|
|
|
53
53
|
for (const i in e)
|
|
54
54
|
i !== "__proto__" && i !== "constructor" && (i in o ? d(o[i]) || o[i] instanceof String || d(e[i]) || e[i] instanceof String ? t && (o[i] = e[i]) : me(o[i], e[i], t) : o[i] = e[i]);
|
|
55
55
|
return o;
|
|
56
|
-
},
|
|
56
|
+
}, T = (o) => o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
57
57
|
var Ce = {
|
|
58
58
|
"&": "&",
|
|
59
59
|
"<": "<",
|
|
@@ -86,7 +86,7 @@ const $e = [" ", ",", "?", "!", ";"], Ne = new Pe(20), ke = (o, e, t) => {
|
|
|
86
86
|
r > 0 && !s.test(o.substring(0, r)) && (n = !0);
|
|
87
87
|
}
|
|
88
88
|
return n;
|
|
89
|
-
},
|
|
89
|
+
}, Z = (o, e, t = ".") => {
|
|
90
90
|
if (!o) return;
|
|
91
91
|
if (o[e])
|
|
92
92
|
return Object.prototype.hasOwnProperty.call(o, e) ? o[e] : void 0;
|
|
@@ -184,7 +184,7 @@ class Y {
|
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
class
|
|
187
|
+
class oe extends Y {
|
|
188
188
|
constructor(e, t = {
|
|
189
189
|
ns: ["translation"],
|
|
190
190
|
defaultNS: "translation"
|
|
@@ -203,14 +203,14 @@ class ae extends Y {
|
|
|
203
203
|
let a;
|
|
204
204
|
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], i && (Array.isArray(i) ? a.push(...i) : d(i) && n ? a.push(...i.split(n)) : a.push(i)));
|
|
205
205
|
const l = z(this.data, a);
|
|
206
|
-
return !l && !t && !i && e.indexOf(".") > -1 && (e = a[0], t = a[1], i = a.slice(2).join(".")), l || !r || !d(i) ? l :
|
|
206
|
+
return !l && !t && !i && e.indexOf(".") > -1 && (e = a[0], t = a[1], i = a.slice(2).join(".")), l || !r || !d(i) ? l : Z(this.data?.[e]?.[t], i, n);
|
|
207
207
|
}
|
|
208
208
|
addResource(e, t, i, s, n = {
|
|
209
209
|
silent: !1
|
|
210
210
|
}) {
|
|
211
211
|
const r = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
|
|
212
212
|
let a = [e, t];
|
|
213
|
-
i && (a = a.concat(r ? i.split(r) : i)), e.indexOf(".") > -1 && (a = e.split("."), s = t, t = a[1]), this.addNamespaces(t),
|
|
213
|
+
i && (a = a.concat(r ? i.split(r) : i)), e.indexOf(".") > -1 && (a = e.split("."), s = t, t = a[1]), this.addNamespaces(t), ae(this.data, a, s), n.silent || this.emit("added", e, t, i, s);
|
|
214
214
|
}
|
|
215
215
|
addResources(e, t, i, s = {
|
|
216
216
|
silent: !1
|
|
@@ -231,7 +231,7 @@ class ae extends Y {
|
|
|
231
231
|
r.skipCopy || (i = JSON.parse(JSON.stringify(i))), s ? me(l, i, n) : l = {
|
|
232
232
|
...l,
|
|
233
233
|
...i
|
|
234
|
-
},
|
|
234
|
+
}, ae(this.data, a, l), r.silent || this.emit("added", e, t, i);
|
|
235
235
|
}
|
|
236
236
|
removeResourceBundle(e, t) {
|
|
237
237
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -270,13 +270,13 @@ function je() {
|
|
|
270
270
|
let t;
|
|
271
271
|
return e.get = (i, s) => (t?.revoke?.(), s === ye ? o : (o.push(s), t = Proxy.revocable(i, e), t.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function X(o, e) {
|
|
274
274
|
const {
|
|
275
275
|
[ye]: t
|
|
276
276
|
} = o(je());
|
|
277
277
|
return t.join(e?.keySeparator ?? ".");
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const le = {}, _ = (o) => !d(o) && typeof o != "boolean" && typeof o != "number";
|
|
280
280
|
class W extends Y {
|
|
281
281
|
constructor(e, t = {}) {
|
|
282
282
|
super(), be(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
|
|
@@ -324,7 +324,7 @@ class W extends Y {
|
|
|
324
324
|
if (typeof s != "object" && this.options.overloadTranslationOptionHandler && (s = this.options.overloadTranslationOptionHandler(arguments)), typeof s == "object" && (s = {
|
|
325
325
|
...s
|
|
326
326
|
}), s || (s = {}), e == null) return "";
|
|
327
|
-
typeof e == "function" && (e =
|
|
327
|
+
typeof e == "function" && (e = X(e, {
|
|
328
328
|
...this.options,
|
|
329
329
|
...s
|
|
330
330
|
})), Array.isArray(e) || (e = [String(e)]);
|
|
@@ -353,9 +353,9 @@ class W extends Y {
|
|
|
353
353
|
} : a;
|
|
354
354
|
const p = this.resolve(e, s);
|
|
355
355
|
let c = p?.res;
|
|
356
|
-
const m = p?.usedKey || a, y = p?.exactUsedKey || a, L = ["[object Number]", "[object Function]", "[object RegExp]"], x = s.joinArrays !== void 0 ? s.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, b = s.count !== void 0 && !d(s.count), N = W.hasDefaultValue(s), E = b ? this.pluralResolver.getSuffix(f, s.count, s) : "",
|
|
356
|
+
const m = p?.usedKey || a, y = p?.exactUsedKey || a, L = ["[object Number]", "[object Function]", "[object RegExp]"], x = s.joinArrays !== void 0 ? s.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, b = s.count !== void 0 && !d(s.count), N = W.hasDefaultValue(s), E = b ? this.pluralResolver.getSuffix(f, s.count, s) : "", I = s.ordinal && b ? this.pluralResolver.getSuffix(f, s.count, {
|
|
357
357
|
ordinal: !1
|
|
358
|
-
}) : "",
|
|
358
|
+
}) : "", q = b && !s.ordinal && s.count === 0, k = q && s[`defaultValue${this.options.pluralSeparator}zero`] || s[`defaultValue${E}`] || s[`defaultValue${I}`] || s.defaultValue;
|
|
359
359
|
let w = c;
|
|
360
360
|
F && !c && N && (w = k);
|
|
361
361
|
const Se = _(w), Oe = Object.prototype.toString.apply(w);
|
|
@@ -369,10 +369,10 @@ class W extends Y {
|
|
|
369
369
|
return n ? (p.res = C, p.usedParams = this.getUsedParamsDetails(s), p) : C;
|
|
370
370
|
}
|
|
371
371
|
if (r) {
|
|
372
|
-
const C = Array.isArray(w), v = C ? [] : {},
|
|
372
|
+
const C = Array.isArray(w), v = C ? [] : {}, ee = C ? y : m;
|
|
373
373
|
for (const R in w)
|
|
374
374
|
if (Object.prototype.hasOwnProperty.call(w, R)) {
|
|
375
|
-
const $ = `${
|
|
375
|
+
const $ = `${ee}${r}${R}`;
|
|
376
376
|
N && !c ? v[R] = this.translate($, {
|
|
377
377
|
...s,
|
|
378
378
|
defaultValue: _(k) ? k[R] : void 0,
|
|
@@ -406,16 +406,16 @@ class W extends Y {
|
|
|
406
406
|
for (let O = 0; O < M.length; O++)
|
|
407
407
|
D.push(M[O]);
|
|
408
408
|
else this.options.saveMissingTo === "all" ? D = this.languageUtils.toResolveHierarchy(s.lng || this.language) : D.push(s.lng || this.language);
|
|
409
|
-
const
|
|
410
|
-
const
|
|
411
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(O, u, j,
|
|
409
|
+
const te = (O, j, V) => {
|
|
410
|
+
const se = N && V !== c ? V : R;
|
|
411
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(O, u, j, se, $, s) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(O, u, j, se, $, s), this.emit("missingKey", O, u, j, c);
|
|
412
412
|
};
|
|
413
413
|
this.options.saveMissing && (this.options.saveMissingPlurals && b ? D.forEach((O) => {
|
|
414
414
|
const j = this.pluralResolver.getSuffixes(O, s);
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
q && s[`defaultValue${this.options.pluralSeparator}zero`] && j.indexOf(`${this.options.pluralSeparator}zero`) < 0 && j.push(`${this.options.pluralSeparator}zero`), j.forEach((V) => {
|
|
416
|
+
te([O], a + V, s[`defaultValue${V}`] || k);
|
|
417
417
|
});
|
|
418
|
-
}) :
|
|
418
|
+
}) : te(D, a, k));
|
|
419
419
|
}
|
|
420
420
|
c = this.extendTranslation(c, e, s, p, i), v && c === a && this.options.appendNamespaceToMissingKey && (c = `${u}${h}${a}`), (v || C) && this.options.parseMissingKeyHandler && (c = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${h}${a}` : a, C ? c : void 0, s));
|
|
421
421
|
}
|
|
@@ -472,7 +472,7 @@ class W extends Y {
|
|
|
472
472
|
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
473
473
|
const g = t.count !== void 0 && !d(t.count), p = g && !t.ordinal && t.count === 0, c = t.context !== void 0 && (d(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
474
474
|
f.forEach((y) => {
|
|
475
|
-
this.isValidLookup(i) || (a = y, !
|
|
475
|
+
this.isValidLookup(i) || (a = y, !le[`${m[0]}-${y}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(a) && (le[`${m[0]}-${y}`] = !0, this.logger.warn(`key "${s}" for languages "${m.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((L) => {
|
|
476
476
|
if (this.isValidLookup(i)) return;
|
|
477
477
|
r = L;
|
|
478
478
|
const x = [h];
|
|
@@ -483,8 +483,8 @@ class W extends Y {
|
|
|
483
483
|
g && (b = this.pluralResolver.getSuffix(L, t.count, t));
|
|
484
484
|
const N = `${this.options.pluralSeparator}zero`, E = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
485
485
|
if (g && (t.ordinal && b.indexOf(E) === 0 && x.push(h + b.replace(E, this.options.pluralSeparator)), x.push(h + b), p && x.push(h + N)), c) {
|
|
486
|
-
const
|
|
487
|
-
x.push(
|
|
486
|
+
const I = `${h}${this.options.contextSeparator || "_"}${t.context}`;
|
|
487
|
+
x.push(I), g && (t.ordinal && b.indexOf(E) === 0 && x.push(I + b.replace(E, this.options.pluralSeparator)), x.push(I + b), p && x.push(I + N));
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
let F;
|
|
@@ -529,7 +529,7 @@ class W extends Y {
|
|
|
529
529
|
return !1;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
class
|
|
532
|
+
class ue {
|
|
533
533
|
constructor(e) {
|
|
534
534
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
|
|
535
535
|
}
|
|
@@ -593,14 +593,14 @@ class le {
|
|
|
593
593
|
}), s;
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
|
-
const
|
|
596
|
+
const fe = {
|
|
597
597
|
zero: 0,
|
|
598
598
|
one: 1,
|
|
599
599
|
two: 2,
|
|
600
600
|
few: 3,
|
|
601
601
|
many: 4,
|
|
602
602
|
other: 5
|
|
603
|
-
},
|
|
603
|
+
}, he = {
|
|
604
604
|
select: (o) => o === 1 ? "one" : "other",
|
|
605
605
|
resolvedOptions: () => ({
|
|
606
606
|
pluralCategories: ["one", "other"]
|
|
@@ -610,9 +610,6 @@ class Ee {
|
|
|
610
610
|
constructor(e, t = {}) {
|
|
611
611
|
this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), this.pluralRulesCache = {};
|
|
612
612
|
}
|
|
613
|
-
addRule(e, t) {
|
|
614
|
-
this.rules[e] = t;
|
|
615
|
-
}
|
|
616
613
|
clearCache() {
|
|
617
614
|
this.pluralRulesCache = {};
|
|
618
615
|
}
|
|
@@ -630,8 +627,8 @@ class Ee {
|
|
|
630
627
|
});
|
|
631
628
|
} catch {
|
|
632
629
|
if (!Intl)
|
|
633
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
634
|
-
if (!e.match(/-|_/)) return
|
|
630
|
+
return this.logger.error("No Intl support, please use an Intl polyfill!"), he;
|
|
631
|
+
if (!e.match(/-|_/)) return he;
|
|
635
632
|
const l = this.languageUtils.getLanguagePartFromCode(e);
|
|
636
633
|
r = this.getRule(l, t);
|
|
637
634
|
}
|
|
@@ -646,18 +643,18 @@ class Ee {
|
|
|
646
643
|
}
|
|
647
644
|
getSuffixes(e, t = {}) {
|
|
648
645
|
let i = this.getRule(e, t);
|
|
649
|
-
return i || (i = this.getRule("dev", t)), i ? i.resolvedOptions().pluralCategories.sort((s, n) =>
|
|
646
|
+
return i || (i = this.getRule("dev", t)), i ? i.resolvedOptions().pluralCategories.sort((s, n) => fe[s] - fe[n]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
|
|
650
647
|
}
|
|
651
648
|
getSuffix(e, t, i = {}) {
|
|
652
649
|
const s = this.getRule(e, i);
|
|
653
650
|
return s ? `${this.options.prepend}${i.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, i));
|
|
654
651
|
}
|
|
655
652
|
}
|
|
656
|
-
const
|
|
653
|
+
const ce = (o, e, t, i = ".", s = !0) => {
|
|
657
654
|
let n = we(o, e, t);
|
|
658
|
-
return !n && s && d(t) && (n =
|
|
655
|
+
return !n && s && d(t) && (n = Z(o, t, i), n === void 0 && (n = Z(e, t, i))), n;
|
|
659
656
|
}, Q = (o) => o.replace(/\$/g, "$$$$");
|
|
660
|
-
class
|
|
657
|
+
class de {
|
|
661
658
|
constructor(e = {}) {
|
|
662
659
|
this.logger = P.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((t) => t), this.init(e);
|
|
663
660
|
}
|
|
@@ -684,7 +681,7 @@ class ce {
|
|
|
684
681
|
maxReplaces: L,
|
|
685
682
|
alwaysFormat: x
|
|
686
683
|
} = e.interpolation;
|
|
687
|
-
this.escape = t !== void 0 ? t : Re, this.escapeValue = i !== void 0 ? i : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = n ?
|
|
684
|
+
this.escape = t !== void 0 ? t : Re, this.escapeValue = i !== void 0 ? i : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = n ? T(n) : r || "{{", this.suffix = a ? T(a) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = h ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = g ? T(g) : p || T("$t("), this.nestingSuffix = c ? T(c) : m || T(")"), this.nestingOptionsSeparator = y || ",", this.maxReplaces = L || 1e3, this.alwaysFormat = x !== void 0 ? x : !1, this.resetRegExp();
|
|
688
685
|
}
|
|
689
686
|
reset() {
|
|
690
687
|
this.options && this.init(this.options);
|
|
@@ -697,7 +694,7 @@ class ce {
|
|
|
697
694
|
let n, r, a;
|
|
698
695
|
const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (p) => {
|
|
699
696
|
if (p.indexOf(this.formatSeparator) < 0) {
|
|
700
|
-
const L =
|
|
697
|
+
const L = ce(t, l, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
701
698
|
return this.alwaysFormat ? this.format(L, void 0, i, {
|
|
702
699
|
...s,
|
|
703
700
|
...t,
|
|
@@ -705,7 +702,7 @@ class ce {
|
|
|
705
702
|
}) : L;
|
|
706
703
|
}
|
|
707
704
|
const c = p.split(this.formatSeparator), m = c.shift().trim(), y = c.join(this.formatSeparator).trim();
|
|
708
|
-
return this.format(
|
|
705
|
+
return this.format(ce(t, l, m, this.options.keySeparator, this.options.ignoreJSONStructure), y, i, {
|
|
709
706
|
...s,
|
|
710
707
|
...t,
|
|
711
708
|
interpolationkey: m
|
|
@@ -733,7 +730,7 @@ class ce {
|
|
|
733
730
|
continue;
|
|
734
731
|
} else
|
|
735
732
|
this.logger.warn(`missed to pass in variable ${c} for interpolating ${e}`), r = "";
|
|
736
|
-
else !d(r) && !this.useRawValueToEscape && (r =
|
|
733
|
+
else !d(r) && !this.useRawValueToEscape && (r = ie(r));
|
|
737
734
|
const m = p.safeValue(r);
|
|
738
735
|
if (e = e.replace(n[0], m), f ? (p.regex.lastIndex += r.length, p.regex.lastIndex -= n[0].length) : p.regex.lastIndex = 0, a++, a >= this.maxReplaces)
|
|
739
736
|
break;
|
|
@@ -767,7 +764,7 @@ class ce {
|
|
|
767
764
|
}, r = r.replace && !d(r.replace) ? r.replace : r, r.applyPostProcessor = !1, delete r.defaultValue;
|
|
768
765
|
const u = /{.*}/.test(s[1]) ? s[1].lastIndexOf("}") + 1 : s[1].indexOf(this.formatSeparator);
|
|
769
766
|
if (u !== -1 && (l = s[1].slice(u).split(this.formatSeparator).map((h) => h.trim()).filter(Boolean), s[1] = s[1].slice(0, u)), n = t(a.call(this, s[1].trim(), r), r), n && s[0] === e && !d(n)) return n;
|
|
770
|
-
d(n) || (n =
|
|
767
|
+
d(n) || (n = ie(n)), n || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), n = ""), l.length && (n = l.reduce((h, f) => this.format(h, f, i.lng, {
|
|
771
768
|
...i,
|
|
772
769
|
interpolationkey: s[1].trim()
|
|
773
770
|
}), n.trim())), e = e.replace(s[0], n), this.regexp.lastIndex = 0;
|
|
@@ -775,7 +772,7 @@ class ce {
|
|
|
775
772
|
return e;
|
|
776
773
|
}
|
|
777
774
|
}
|
|
778
|
-
const
|
|
775
|
+
const Ie = (o) => {
|
|
779
776
|
let e = o.toLowerCase().trim();
|
|
780
777
|
const t = {};
|
|
781
778
|
if (o.indexOf("(") > -1) {
|
|
@@ -793,7 +790,7 @@ const Te = (o) => {
|
|
|
793
790
|
formatName: e,
|
|
794
791
|
formatOptions: t
|
|
795
792
|
};
|
|
796
|
-
},
|
|
793
|
+
}, pe = (o) => {
|
|
797
794
|
const e = {};
|
|
798
795
|
return (t, i, s) => {
|
|
799
796
|
let n = s;
|
|
@@ -805,7 +802,7 @@ const Te = (o) => {
|
|
|
805
802
|
let a = e[r];
|
|
806
803
|
return a || (a = o(H(i), s), e[r] = a), a(t);
|
|
807
804
|
};
|
|
808
|
-
},
|
|
805
|
+
}, Te = (o) => (e, t, i) => o(H(t), i)(e);
|
|
809
806
|
class De {
|
|
810
807
|
constructor(e = {}) {
|
|
811
808
|
this.logger = P.create("formatter"), this.options = e, this.init(e);
|
|
@@ -814,7 +811,7 @@ class De {
|
|
|
814
811
|
interpolation: {}
|
|
815
812
|
}) {
|
|
816
813
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
817
|
-
const i = t.cacheInBuiltFormats ?
|
|
814
|
+
const i = t.cacheInBuiltFormats ? pe : Te;
|
|
818
815
|
this.formats = {
|
|
819
816
|
number: i((s, n) => {
|
|
820
817
|
const r = new Intl.NumberFormat(s, {
|
|
@@ -853,7 +850,7 @@ class De {
|
|
|
853
850
|
this.formats[e.toLowerCase().trim()] = t;
|
|
854
851
|
}
|
|
855
852
|
addCached(e, t) {
|
|
856
|
-
this.formats[e.toLowerCase().trim()] =
|
|
853
|
+
this.formats[e.toLowerCase().trim()] = pe(t);
|
|
857
854
|
}
|
|
858
855
|
format(e, t, i, s = {}) {
|
|
859
856
|
const n = t.split(this.formatSeparator);
|
|
@@ -865,7 +862,7 @@ class De {
|
|
|
865
862
|
const {
|
|
866
863
|
formatName: u,
|
|
867
864
|
formatOptions: h
|
|
868
|
-
} =
|
|
865
|
+
} = Ie(l);
|
|
869
866
|
if (this.formats[u]) {
|
|
870
867
|
let f = a;
|
|
871
868
|
try {
|
|
@@ -1018,7 +1015,7 @@ class Ke extends Y {
|
|
|
1018
1015
|
}
|
|
1019
1016
|
}
|
|
1020
1017
|
}
|
|
1021
|
-
const
|
|
1018
|
+
const G = () => ({
|
|
1022
1019
|
debug: !1,
|
|
1023
1020
|
initAsync: !0,
|
|
1024
1021
|
ns: ["translation"],
|
|
@@ -1095,7 +1092,7 @@ class U extends Y {
|
|
|
1095
1092
|
}
|
|
1096
1093
|
init(e = {}, t) {
|
|
1097
1094
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (d(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
1098
|
-
const i =
|
|
1095
|
+
const i = G();
|
|
1099
1096
|
this.options = {
|
|
1100
1097
|
...i,
|
|
1101
1098
|
...this.options,
|
|
@@ -1109,13 +1106,13 @@ class U extends Y {
|
|
|
1109
1106
|
this.modules.logger ? P.init(s(this.modules.logger), this.options) : P.init(null, this.options);
|
|
1110
1107
|
let u;
|
|
1111
1108
|
this.modules.formatter ? u = this.modules.formatter : u = De;
|
|
1112
|
-
const h = new
|
|
1113
|
-
this.store = new
|
|
1109
|
+
const h = new ue(this.options);
|
|
1110
|
+
this.store = new oe(this.options.resources, this.options);
|
|
1114
1111
|
const f = this.services;
|
|
1115
1112
|
f.logger = P, f.resourceStore = this.store, f.languageUtils = h, f.pluralResolver = new Ee(h, {
|
|
1116
1113
|
prepend: this.options.pluralSeparator,
|
|
1117
1114
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1118
|
-
}), this.options.interpolation.format && this.options.interpolation.format !== i.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), u && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (f.formatter = s(u), f.formatter.init && f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new
|
|
1115
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== i.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), u && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (f.formatter = s(u), f.formatter.init && f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new de(this.options), f.utils = {
|
|
1119
1116
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1120
1117
|
}, f.backendConnector = new Ke(s(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", (p, ...c) => {
|
|
1121
1118
|
this.emit(p, ...c);
|
|
@@ -1208,10 +1205,10 @@ class U extends Y {
|
|
|
1208
1205
|
}, l.lng = l.lng || s.lng, l.lngs = l.lngs || s.lngs, l.ns = l.ns || s.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || i || s.keyPrefix);
|
|
1209
1206
|
const u = this.options.keySeparator || ".";
|
|
1210
1207
|
let h;
|
|
1211
|
-
return l.keyPrefix && Array.isArray(n) ? h = n.map((f) => (typeof f == "function" && (f =
|
|
1208
|
+
return l.keyPrefix && Array.isArray(n) ? h = n.map((f) => (typeof f == "function" && (f = X(f, {
|
|
1212
1209
|
...this.options,
|
|
1213
1210
|
...r
|
|
1214
|
-
})), `${l.keyPrefix}${u}${f}`)) : (typeof n == "function" && (n =
|
|
1211
|
+
})), `${l.keyPrefix}${u}${f}`)) : (typeof n == "function" && (n = X(n, {
|
|
1215
1212
|
...this.options,
|
|
1216
1213
|
...r
|
|
1217
1214
|
})), h = l.keyPrefix ? `${l.keyPrefix}${u}${n}` : n), this.t(h, l);
|
|
@@ -1270,7 +1267,7 @@ class U extends Y {
|
|
|
1270
1267
|
}
|
|
1271
1268
|
} catch {
|
|
1272
1269
|
}
|
|
1273
|
-
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], i = this.services?.languageUtils || new
|
|
1270
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], i = this.services?.languageUtils || new ue(G());
|
|
1274
1271
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(i.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1275
1272
|
}
|
|
1276
1273
|
static createInstance(e = {}, t) {
|
|
@@ -1297,9 +1294,20 @@ class U extends Y {
|
|
|
1297
1294
|
}, l[u] = Object.keys(l[u]).reduce((h, f) => (h[f] = {
|
|
1298
1295
|
...l[u][f]
|
|
1299
1296
|
}, h), l[u]), l), {});
|
|
1300
|
-
n.store = new
|
|
1297
|
+
n.store = new oe(a, s), n.services.resourceStore = n.store;
|
|
1298
|
+
}
|
|
1299
|
+
if (e.interpolation) {
|
|
1300
|
+
const l = {
|
|
1301
|
+
...G().interpolation,
|
|
1302
|
+
...this.options.interpolation,
|
|
1303
|
+
...e.interpolation
|
|
1304
|
+
}, u = {
|
|
1305
|
+
...s,
|
|
1306
|
+
interpolation: l
|
|
1307
|
+
};
|
|
1308
|
+
n.services.interpolator = new de(u);
|
|
1301
1309
|
}
|
|
1302
|
-
return
|
|
1310
|
+
return n.translator = new W(n.services, s), n.translator.on("*", (a, ...l) => {
|
|
1303
1311
|
n.emit(a, ...l);
|
|
1304
1312
|
}), n.init(s, t), n.translator.options = s, n.translator.backendConnector.services.utils = {
|
|
1305
1313
|
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
@@ -1334,4 +1342,4 @@ export {
|
|
|
1334
1342
|
S as i,
|
|
1335
1343
|
Ue as t
|
|
1336
1344
|
};
|
|
1337
|
-
//# sourceMappingURL=i18next-
|
|
1345
|
+
//# sourceMappingURL=i18next-8reizFda.js.map
|