@mp-front/components 0.0.1-next-9 → 0.0.1-next-11
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/carousel.component-BcjDXzve.cjs +80 -0
- package/dist/carousel.component-CdgrJtst.js +12762 -0
- package/dist/components/carousel/carousel-container.component.d.ts +2 -0
- package/dist/components/carousel/carousel-container.component.d.ts.map +1 -0
- package/dist/components/carousel/carousel-dots.component.d.ts +3 -0
- package/dist/components/carousel/carousel-dots.component.d.ts.map +1 -0
- package/dist/components/carousel/carousel-item.component.d.ts +3 -0
- package/dist/components/carousel/carousel-item.component.d.ts.map +1 -0
- package/dist/components/carousel/carousel-next-button.component.d.ts +2 -0
- package/dist/components/carousel/carousel-next-button.component.d.ts.map +1 -0
- package/dist/components/carousel/carousel-prev-button.component.d.ts +2 -0
- package/dist/components/carousel/carousel-prev-button.component.d.ts.map +1 -0
- package/dist/components/carousel/carousel.component.d.ts +4 -0
- package/dist/components/carousel/carousel.component.d.ts.map +1 -0
- package/dist/components/carousel/carousel.constants.d.ts +2 -0
- package/dist/components/carousel/carousel.constants.d.ts.map +1 -0
- package/dist/components/carousel/carousel.context.d.ts +4 -0
- package/dist/components/carousel/carousel.context.d.ts.map +1 -0
- package/dist/components/carousel/carousel.stories.d.ts +14 -0
- package/dist/components/carousel/carousel.stories.d.ts.map +1 -0
- package/dist/components/carousel/carousel.types.d.ts +58 -0
- package/dist/components/carousel/carousel.types.d.ts.map +1 -0
- package/dist/components/carousel/utils/handle-key-down.d.ts +3 -0
- package/dist/components/carousel/utils/handle-key-down.d.ts.map +1 -0
- package/dist/components/carousel/utils/index.d.ts +3 -0
- package/dist/components/carousel/utils/index.d.ts.map +1 -0
- package/dist/components/carousel/utils/number-with-range.d.ts +2 -0
- package/dist/components/carousel/utils/number-with-range.d.ts.map +1 -0
- package/dist/components/carousel/utils/tween-scale.d.ts +3 -0
- package/dist/components/carousel/utils/tween-scale.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/modal/dialog.overlay.d.ts.map +1 -1
- package/dist/components/progress/progress.component.d.ts +1 -1
- package/dist/components/progress/progress.component.d.ts.map +1 -1
- package/dist/components/progress/progress.types.d.ts +1 -0
- package/dist/components/progress/progress.types.d.ts.map +1 -1
- package/dist/layout/header/right-side.component.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/ui-components-index.cjs +2 -2
- package/dist/ui-components-index.js +67 -58
- package/dist/ui-components-layout.cjs +1 -1
- package/dist/ui-components-layout.js +345 -345
- package/package.json +2 -1
- package/dist/toggle-group.component-Cs7zS-s6.js +0 -11256
- package/dist/toggle-group.component-DOQKWhkg.cjs +0 -80
|
@@ -2,17 +2,17 @@ import { j as x } from "./proxy-uRb7Bek8.js";
|
|
|
2
2
|
import { a as V } from "./classNames-BiTpavcN.js";
|
|
3
3
|
import * as U from "react";
|
|
4
4
|
import { useMemo as Ie, createElement as Ve, Fragment as De } from "react";
|
|
5
|
-
import { P as Ae, K as Re, z as B, a2 as He,
|
|
5
|
+
import { P as Ae, K as Re, z as B, a2 as He, a7 as Ke, ab as Me } from "./carousel.component-CdgrJtst.js";
|
|
6
6
|
import { s as ze, a as Ue, I as Be, u as Je } from "./useTranslation-B0fSob9I.js";
|
|
7
7
|
import { u as Ze } from "./index-q_fyr_Rn.js";
|
|
8
8
|
var _e = "Separator", fe = "horizontal", We = ["horizontal", "vertical"], Pe = U.forwardRef((r, e) => {
|
|
9
|
-
const { decorative: t, orientation:
|
|
9
|
+
const { decorative: t, orientation: i = fe, ...s } = r, n = Ye(i) ? i : fe, o = t ? { role: "none" } : { "aria-orientation": n === "vertical" ? n : void 0, role: "separator" };
|
|
10
10
|
return /* @__PURE__ */ x.jsx(
|
|
11
11
|
Ae.div,
|
|
12
12
|
{
|
|
13
13
|
"data-orientation": n,
|
|
14
14
|
...o,
|
|
15
|
-
...
|
|
15
|
+
...s,
|
|
16
16
|
ref: e
|
|
17
17
|
}
|
|
18
18
|
);
|
|
@@ -24,58 +24,58 @@ function Ye(r) {
|
|
|
24
24
|
var Ge = Pe;
|
|
25
25
|
const g = (r) => typeof r == "string", K = () => {
|
|
26
26
|
let r, e;
|
|
27
|
-
const t = new Promise((
|
|
28
|
-
r =
|
|
27
|
+
const t = new Promise((i, s) => {
|
|
28
|
+
r = i, e = s;
|
|
29
29
|
});
|
|
30
30
|
return t.resolve = r, t.reject = e, t;
|
|
31
31
|
}, ce = (r) => r == null ? "" : "" + r, Qe = (r, e, t) => {
|
|
32
|
-
r.forEach((
|
|
33
|
-
e[
|
|
32
|
+
r.forEach((i) => {
|
|
33
|
+
e[i] && (t[i] = e[i]);
|
|
34
34
|
});
|
|
35
35
|
}, qe = /###/g, he = (r) => r && r.indexOf("###") > -1 ? r.replace(qe, ".") : r, de = (r) => !r || g(r), M = (r, e, t) => {
|
|
36
|
-
const
|
|
37
|
-
let
|
|
38
|
-
for (;
|
|
36
|
+
const i = g(e) ? e.split(".") : e;
|
|
37
|
+
let s = 0;
|
|
38
|
+
for (; s < i.length - 1; ) {
|
|
39
39
|
if (de(r)) return {};
|
|
40
|
-
const n = he(s
|
|
41
|
-
!r[n] && t && (r[n] = new t()), Object.prototype.hasOwnProperty.call(r, n) ? r = r[n] : r = {}, ++
|
|
40
|
+
const n = he(i[s]);
|
|
41
|
+
!r[n] && t && (r[n] = new t()), Object.prototype.hasOwnProperty.call(r, n) ? r = r[n] : r = {}, ++s;
|
|
42
42
|
}
|
|
43
43
|
return de(r) ? {} : {
|
|
44
44
|
obj: r,
|
|
45
|
-
k: he(s
|
|
45
|
+
k: he(i[s])
|
|
46
46
|
};
|
|
47
47
|
}, pe = (r, e, t) => {
|
|
48
48
|
const {
|
|
49
|
-
obj:
|
|
50
|
-
k:
|
|
49
|
+
obj: i,
|
|
50
|
+
k: s
|
|
51
51
|
} = M(r, e, Object);
|
|
52
|
-
if (
|
|
53
|
-
s
|
|
52
|
+
if (i !== void 0 || e.length === 1) {
|
|
53
|
+
i[s] = t;
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
let n = e[e.length - 1], a = e.slice(0, e.length - 1), o = M(r, a, Object);
|
|
57
57
|
for (; o.obj === void 0 && a.length; )
|
|
58
58
|
n = `${a[a.length - 1]}.${n}`, a = a.slice(0, a.length - 1), o = M(r, a, Object), o != null && o.obj && typeof o.obj[`${o.k}.${n}`] < "u" && (o.obj = void 0);
|
|
59
59
|
o.obj[`${o.k}.${n}`] = t;
|
|
60
|
-
}, Xe = (r, e, t,
|
|
60
|
+
}, Xe = (r, e, t, i) => {
|
|
61
61
|
const {
|
|
62
|
-
obj:
|
|
62
|
+
obj: s,
|
|
63
63
|
k: n
|
|
64
64
|
} = M(r, e, Object);
|
|
65
|
-
|
|
65
|
+
s[n] = s[n] || [], s[n].push(t);
|
|
66
66
|
}, G = (r, e) => {
|
|
67
67
|
const {
|
|
68
68
|
obj: t,
|
|
69
|
-
k:
|
|
69
|
+
k: i
|
|
70
70
|
} = M(r, e);
|
|
71
|
-
if (t && Object.prototype.hasOwnProperty.call(t,
|
|
72
|
-
return t[
|
|
71
|
+
if (t && Object.prototype.hasOwnProperty.call(t, i))
|
|
72
|
+
return t[i];
|
|
73
73
|
}, et = (r, e, t) => {
|
|
74
|
-
const
|
|
75
|
-
return
|
|
74
|
+
const i = G(r, t);
|
|
75
|
+
return i !== void 0 ? i : G(e, t);
|
|
76
76
|
}, $e = (r, e, t) => {
|
|
77
|
-
for (const
|
|
78
|
-
|
|
77
|
+
for (const i in e)
|
|
78
|
+
i !== "__proto__" && i !== "constructor" && (i in r ? g(r[i]) || r[i] instanceof String || g(e[i]) || e[i] instanceof String ? t && (r[i] = e[i]) : $e(r[i], e[i], t) : r[i] = e[i]);
|
|
79
79
|
return r;
|
|
80
80
|
}, I = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
81
81
|
var tt = {
|
|
@@ -95,41 +95,41 @@ class it {
|
|
|
95
95
|
const t = this.regExpMap.get(e);
|
|
96
96
|
if (t !== void 0)
|
|
97
97
|
return t;
|
|
98
|
-
const
|
|
99
|
-
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e,
|
|
98
|
+
const i = new RegExp(e);
|
|
99
|
+
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, i), this.regExpQueue.push(e), i;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
const nt = [" ", ",", "?", "!", ";"], rt = new it(20), at = (r, e, t) => {
|
|
103
103
|
e = e || "", t = t || "";
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
let n = !
|
|
104
|
+
const i = nt.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
105
|
+
if (i.length === 0) return !0;
|
|
106
|
+
const s = rt.getRegExp(`(${i.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
107
|
+
let n = !s.test(r);
|
|
108
108
|
if (!n) {
|
|
109
109
|
const a = r.indexOf(t);
|
|
110
|
-
a > 0 && !
|
|
110
|
+
a > 0 && !s.test(r.substring(0, a)) && (n = !0);
|
|
111
111
|
}
|
|
112
112
|
return n;
|
|
113
113
|
}, ie = (r, e, t = ".") => {
|
|
114
114
|
if (!r) return;
|
|
115
115
|
if (r[e])
|
|
116
116
|
return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
|
|
117
|
-
const
|
|
118
|
-
let
|
|
119
|
-
for (let n = 0; n <
|
|
120
|
-
if (!
|
|
117
|
+
const i = e.split(t);
|
|
118
|
+
let s = r;
|
|
119
|
+
for (let n = 0; n < i.length; ) {
|
|
120
|
+
if (!s || typeof s != "object")
|
|
121
121
|
return;
|
|
122
122
|
let a, o = "";
|
|
123
|
-
for (let u = n; u <
|
|
124
|
-
if (u !== n && (o += t), o +=
|
|
125
|
-
if (["string", "number", "boolean"].indexOf(typeof a) > -1 && u <
|
|
123
|
+
for (let u = n; u < i.length; ++u)
|
|
124
|
+
if (u !== n && (o += t), o += i[u], a = s[o], a !== void 0) {
|
|
125
|
+
if (["string", "number", "boolean"].indexOf(typeof a) > -1 && u < i.length - 1)
|
|
126
126
|
continue;
|
|
127
127
|
n += u - n + 1;
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
s = a;
|
|
131
131
|
}
|
|
132
|
-
return
|
|
132
|
+
return s;
|
|
133
133
|
}, J = (r) => r == null ? void 0 : r.replace("_", "-"), ot = {
|
|
134
134
|
type: "logger",
|
|
135
135
|
log(r) {
|
|
@@ -142,8 +142,8 @@ const nt = [" ", ",", "?", "!", ";"], rt = new it(20), at = (r, e, t) => {
|
|
|
142
142
|
this.output("error", r);
|
|
143
143
|
},
|
|
144
144
|
output(r, e) {
|
|
145
|
-
var t,
|
|
146
|
-
(
|
|
145
|
+
var t, i;
|
|
146
|
+
(i = (t = console == null ? void 0 : console[r]) == null ? void 0 : t.apply) == null || i.call(t, console, e);
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
class Q {
|
|
@@ -165,8 +165,8 @@ class Q {
|
|
|
165
165
|
deprecate(...e) {
|
|
166
166
|
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
167
167
|
}
|
|
168
|
-
forward(e, t,
|
|
169
|
-
return
|
|
168
|
+
forward(e, t, i, s) {
|
|
169
|
+
return s && !this.debug ? null : (g(e[0]) && (e[0] = `${i}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
170
170
|
}
|
|
171
171
|
create(e) {
|
|
172
172
|
return new Q(this.logger, {
|
|
@@ -184,10 +184,10 @@ class X {
|
|
|
184
184
|
this.observers = {};
|
|
185
185
|
}
|
|
186
186
|
on(e, t) {
|
|
187
|
-
return e.split(" ").forEach((
|
|
188
|
-
this.observers[
|
|
189
|
-
const
|
|
190
|
-
this.observers[
|
|
187
|
+
return e.split(" ").forEach((i) => {
|
|
188
|
+
this.observers[i] || (this.observers[i] = /* @__PURE__ */ new Map());
|
|
189
|
+
const s = this.observers[i].get(t) || 0;
|
|
190
|
+
this.observers[i].set(t, s + 1);
|
|
191
191
|
}), this;
|
|
192
192
|
}
|
|
193
193
|
off(e, t) {
|
|
@@ -200,12 +200,12 @@ class X {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
emit(e, ...t) {
|
|
203
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([
|
|
203
|
+
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([s, n]) => {
|
|
204
204
|
for (let a = 0; a < n; a++)
|
|
205
|
-
|
|
206
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([
|
|
205
|
+
s(...t);
|
|
206
|
+
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([s, n]) => {
|
|
207
207
|
for (let a = 0; a < n; a++)
|
|
208
|
-
|
|
208
|
+
s.apply(s, [e, ...t]);
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -223,41 +223,41 @@ class ge extends X {
|
|
|
223
223
|
const t = this.options.ns.indexOf(e);
|
|
224
224
|
t > -1 && this.options.ns.splice(t, 1);
|
|
225
225
|
}
|
|
226
|
-
getResource(e, t,
|
|
226
|
+
getResource(e, t, i, s = {}) {
|
|
227
227
|
var l, c;
|
|
228
|
-
const n =
|
|
228
|
+
const n = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, a = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
229
229
|
let o;
|
|
230
|
-
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t],
|
|
230
|
+
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], i && (Array.isArray(i) ? o.push(...i) : g(i) && n ? o.push(...i.split(n)) : o.push(i)));
|
|
231
231
|
const u = G(this.data, o);
|
|
232
|
-
return !u && !t && !
|
|
232
|
+
return !u && !t && !i && e.indexOf(".") > -1 && (e = o[0], t = o[1], i = o.slice(2).join(".")), u || !a || !g(i) ? u : ie((c = (l = this.data) == null ? void 0 : l[e]) == null ? void 0 : c[t], i, n);
|
|
233
233
|
}
|
|
234
|
-
addResource(e, t,
|
|
234
|
+
addResource(e, t, i, s, n = {
|
|
235
235
|
silent: !1
|
|
236
236
|
}) {
|
|
237
237
|
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
|
|
238
238
|
let o = [e, t];
|
|
239
|
-
|
|
239
|
+
i && (o = o.concat(a ? i.split(a) : i)), e.indexOf(".") > -1 && (o = e.split("."), s = t, t = o[1]), this.addNamespaces(t), pe(this.data, o, s), n.silent || this.emit("added", e, t, i, s);
|
|
240
240
|
}
|
|
241
|
-
addResources(e, t,
|
|
241
|
+
addResources(e, t, i, s = {
|
|
242
242
|
silent: !1
|
|
243
243
|
}) {
|
|
244
|
-
for (const n in
|
|
245
|
-
(g(
|
|
244
|
+
for (const n in i)
|
|
245
|
+
(g(i[n]) || Array.isArray(i[n])) && this.addResource(e, t, n, i[n], {
|
|
246
246
|
silent: !0
|
|
247
247
|
});
|
|
248
|
-
|
|
248
|
+
s.silent || this.emit("added", e, t, i);
|
|
249
249
|
}
|
|
250
|
-
addResourceBundle(e, t,
|
|
250
|
+
addResourceBundle(e, t, i, s, n, a = {
|
|
251
251
|
silent: !1,
|
|
252
252
|
skipCopy: !1
|
|
253
253
|
}) {
|
|
254
254
|
let o = [e, t];
|
|
255
|
-
e.indexOf(".") > -1 && (o = e.split("."),
|
|
255
|
+
e.indexOf(".") > -1 && (o = e.split("."), s = i, i = t, t = o[1]), this.addNamespaces(t);
|
|
256
256
|
let u = G(this.data, o) || {};
|
|
257
|
-
a.skipCopy || (
|
|
257
|
+
a.skipCopy || (i = JSON.parse(JSON.stringify(i))), s ? $e(u, i, n) : u = {
|
|
258
258
|
...u,
|
|
259
|
-
...
|
|
260
|
-
}, pe(this.data, o, u), a.silent || this.emit("added", e, t,
|
|
259
|
+
...i
|
|
260
|
+
}, pe(this.data, o, u), a.silent || this.emit("added", e, t, i);
|
|
261
261
|
}
|
|
262
262
|
removeResourceBundle(e, t) {
|
|
263
263
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -273,7 +273,7 @@ class ge extends X {
|
|
|
273
273
|
}
|
|
274
274
|
hasLanguageSomeTranslations(e) {
|
|
275
275
|
const t = this.getDataByLanguage(e);
|
|
276
|
-
return !!(t && Object.keys(t) || []).find((
|
|
276
|
+
return !!(t && Object.keys(t) || []).find((s) => t[s] && Object.keys(t[s]).length > 0);
|
|
277
277
|
}
|
|
278
278
|
toJSON() {
|
|
279
279
|
return this.data;
|
|
@@ -284,10 +284,10 @@ var je = {
|
|
|
284
284
|
addPostProcessor(r) {
|
|
285
285
|
this.processors[r.name] = r;
|
|
286
286
|
},
|
|
287
|
-
handle(r, e, t,
|
|
287
|
+
handle(r, e, t, i, s) {
|
|
288
288
|
return r.forEach((n) => {
|
|
289
289
|
var a;
|
|
290
|
-
e = ((a = this.processors[n]) == null ? void 0 : a.process(e, t,
|
|
290
|
+
e = ((a = this.processors[n]) == null ? void 0 : a.process(e, t, i, s)) ?? e;
|
|
291
291
|
}), e;
|
|
292
292
|
}
|
|
293
293
|
};
|
|
@@ -295,9 +295,9 @@ const ke = Symbol("i18next/PATH_KEY");
|
|
|
295
295
|
function lt() {
|
|
296
296
|
const r = [], e = /* @__PURE__ */ Object.create(null);
|
|
297
297
|
let t;
|
|
298
|
-
return e.get = (
|
|
298
|
+
return e.get = (i, s) => {
|
|
299
299
|
var n;
|
|
300
|
-
return (n = t == null ? void 0 : t.revoke) == null || n.call(t),
|
|
300
|
+
return (n = t == null ? void 0 : t.revoke) == null || n.call(t), s === ke ? r : (r.push(s), t = Proxy.revocable(i, e), t.proxy);
|
|
301
301
|
}, Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
302
302
|
}
|
|
303
303
|
function ne(r, e) {
|
|
@@ -317,21 +317,21 @@ class q extends X {
|
|
|
317
317
|
exists(e, t = {
|
|
318
318
|
interpolation: {}
|
|
319
319
|
}) {
|
|
320
|
-
const
|
|
320
|
+
const i = {
|
|
321
321
|
...t
|
|
322
322
|
};
|
|
323
323
|
if (e == null) return !1;
|
|
324
|
-
const
|
|
325
|
-
if ((
|
|
326
|
-
const n = ee(
|
|
327
|
-
return !(
|
|
324
|
+
const s = this.resolve(e, i);
|
|
325
|
+
if ((s == null ? void 0 : s.res) === void 0) return !1;
|
|
326
|
+
const n = ee(s.res);
|
|
327
|
+
return !(i.returnObjects === !1 && n);
|
|
328
328
|
}
|
|
329
329
|
extractFromKey(e, t) {
|
|
330
|
-
let
|
|
331
|
-
|
|
332
|
-
const
|
|
330
|
+
let i = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
|
|
331
|
+
i === void 0 && (i = ":");
|
|
332
|
+
const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
333
333
|
let n = t.ns || this.options.defaultNS || [];
|
|
334
|
-
const a =
|
|
334
|
+
const a = i && e.indexOf(i) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !at(e, i, s);
|
|
335
335
|
if (a && !o) {
|
|
336
336
|
const u = e.match(this.interpolator.nestingRegexp);
|
|
337
337
|
if (u && u.length > 0)
|
|
@@ -339,32 +339,32 @@ class q extends X {
|
|
|
339
339
|
key: e,
|
|
340
340
|
namespaces: g(n) ? [n] : n
|
|
341
341
|
};
|
|
342
|
-
const l = e.split(
|
|
343
|
-
(
|
|
342
|
+
const l = e.split(i);
|
|
343
|
+
(i !== s || i === s && this.options.ns.indexOf(l[0]) > -1) && (n = l.shift()), e = l.join(s);
|
|
344
344
|
}
|
|
345
345
|
return {
|
|
346
346
|
key: e,
|
|
347
347
|
namespaces: g(n) ? [n] : n
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
translate(e, t,
|
|
351
|
-
let
|
|
350
|
+
translate(e, t, i) {
|
|
351
|
+
let s = typeof t == "object" ? {
|
|
352
352
|
...t
|
|
353
353
|
} : t;
|
|
354
|
-
if (typeof
|
|
355
|
-
...
|
|
356
|
-
}),
|
|
354
|
+
if (typeof s != "object" && this.options.overloadTranslationOptionHandler && (s = this.options.overloadTranslationOptionHandler(arguments)), typeof s == "object" && (s = {
|
|
355
|
+
...s
|
|
356
|
+
}), s || (s = {}), e == null) return "";
|
|
357
357
|
typeof e == "function" && (e = ne(e, {
|
|
358
358
|
...this.options,
|
|
359
|
-
...
|
|
359
|
+
...s
|
|
360
360
|
})), Array.isArray(e) || (e = [String(e)]);
|
|
361
|
-
const n =
|
|
361
|
+
const n = s.returnDetails !== void 0 ? s.returnDetails : this.options.returnDetails, a = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, {
|
|
362
362
|
key: o,
|
|
363
363
|
namespaces: u
|
|
364
|
-
} = this.extractFromKey(e[e.length - 1],
|
|
365
|
-
let c =
|
|
364
|
+
} = this.extractFromKey(e[e.length - 1], s), l = u[u.length - 1];
|
|
365
|
+
let c = s.nsSeparator !== void 0 ? s.nsSeparator : this.options.nsSeparator;
|
|
366
366
|
c === void 0 && (c = ":");
|
|
367
|
-
const f =
|
|
367
|
+
const f = s.lng || this.language, p = s.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
368
368
|
if ((f == null ? void 0 : f.toLowerCase()) === "cimode")
|
|
369
369
|
return p ? n ? {
|
|
370
370
|
res: `${l}${c}${o}`,
|
|
@@ -372,31 +372,31 @@ class q extends X {
|
|
|
372
372
|
exactUsedKey: o,
|
|
373
373
|
usedLng: f,
|
|
374
374
|
usedNS: l,
|
|
375
|
-
usedParams: this.getUsedParamsDetails(
|
|
375
|
+
usedParams: this.getUsedParamsDetails(s)
|
|
376
376
|
} : `${l}${c}${o}` : n ? {
|
|
377
377
|
res: o,
|
|
378
378
|
usedKey: o,
|
|
379
379
|
exactUsedKey: o,
|
|
380
380
|
usedLng: f,
|
|
381
381
|
usedNS: l,
|
|
382
|
-
usedParams: this.getUsedParamsDetails(
|
|
382
|
+
usedParams: this.getUsedParamsDetails(s)
|
|
383
383
|
} : o;
|
|
384
|
-
const d = this.resolve(e,
|
|
384
|
+
const d = this.resolve(e, s);
|
|
385
385
|
let h = d == null ? void 0 : d.res;
|
|
386
|
-
const m = (d == null ? void 0 : d.usedKey) || o, y = (d == null ? void 0 : d.exactUsedKey) || o, v = ["[object Number]", "[object Function]", "[object RegExp]"], w =
|
|
386
|
+
const m = (d == null ? void 0 : d.usedKey) || o, y = (d == null ? void 0 : d.exactUsedKey) || o, v = ["[object Number]", "[object Function]", "[object RegExp]"], w = s.joinArrays !== void 0 ? s.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, L = s.count !== void 0 && !g(s.count), j = q.hasDefaultValue(s), _ = L ? this.pluralResolver.getSuffix(f, s.count, s) : "", k = s.ordinal && L ? this.pluralResolver.getSuffix(f, s.count, {
|
|
387
387
|
ordinal: !1
|
|
388
|
-
}) : "", D = L && !
|
|
388
|
+
}) : "", D = L && !s.ordinal && s.count === 0, O = D && s[`defaultValue${this.options.pluralSeparator}zero`] || s[`defaultValue${_}`] || s[`defaultValue${k}`] || s.defaultValue;
|
|
389
389
|
let b = h;
|
|
390
390
|
F && !h && j && (b = O);
|
|
391
391
|
const Fe = ee(b), Te = Object.prototype.toString.apply(b);
|
|
392
392
|
if (F && b && Fe && v.indexOf(Te) < 0 && !(g(w) && Array.isArray(b))) {
|
|
393
|
-
if (!
|
|
393
|
+
if (!s.returnObjects && !this.options.returnObjects) {
|
|
394
394
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
395
395
|
const R = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, b, {
|
|
396
|
-
...
|
|
396
|
+
...s,
|
|
397
397
|
ns: u
|
|
398
398
|
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
399
|
-
return n ? (d.res = R, d.usedParams = this.getUsedParamsDetails(
|
|
399
|
+
return n ? (d.res = R, d.usedParams = this.getUsedParamsDetails(s), d) : R;
|
|
400
400
|
}
|
|
401
401
|
if (a) {
|
|
402
402
|
const R = Array.isArray(b), N = R ? [] : {}, ae = R ? y : m;
|
|
@@ -404,12 +404,12 @@ class q extends X {
|
|
|
404
404
|
if (Object.prototype.hasOwnProperty.call(b, P)) {
|
|
405
405
|
const E = `${ae}${a}${P}`;
|
|
406
406
|
j && !h ? N[P] = this.translate(E, {
|
|
407
|
-
...
|
|
407
|
+
...s,
|
|
408
408
|
defaultValue: ee(O) ? O[P] : void 0,
|
|
409
409
|
joinArrays: !1,
|
|
410
410
|
ns: u
|
|
411
411
|
}) : N[P] = this.translate(E, {
|
|
412
|
-
...
|
|
412
|
+
...s,
|
|
413
413
|
joinArrays: !1,
|
|
414
414
|
ns: u
|
|
415
415
|
}), N[P] === E && (N[P] = b[P]);
|
|
@@ -417,97 +417,97 @@ class q extends X {
|
|
|
417
417
|
h = N;
|
|
418
418
|
}
|
|
419
419
|
} else if (F && g(w) && Array.isArray(h))
|
|
420
|
-
h = h.join(w), h && (h = this.extendTranslation(h, e,
|
|
420
|
+
h = h.join(w), h && (h = this.extendTranslation(h, e, s, i));
|
|
421
421
|
else {
|
|
422
422
|
let R = !1, N = !1;
|
|
423
423
|
!this.isValidLookup(h) && j && (R = !0, h = O), this.isValidLookup(h) || (N = !0, h = o);
|
|
424
|
-
const P = (
|
|
424
|
+
const P = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && N ? void 0 : h, E = j && O !== h && this.options.updateMissing;
|
|
425
425
|
if (N || R || E) {
|
|
426
426
|
if (this.logger.log(E ? "updateKey" : "missingKey", f, l, o, E ? O : h), a) {
|
|
427
427
|
const C = this.resolve(o, {
|
|
428
|
-
...
|
|
428
|
+
...s,
|
|
429
429
|
keySeparator: !1
|
|
430
430
|
});
|
|
431
431
|
C && C.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.");
|
|
432
432
|
}
|
|
433
433
|
let A = [];
|
|
434
|
-
const W = this.languageUtils.getFallbackCodes(this.options.fallbackLng,
|
|
434
|
+
const W = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s.lng || this.language);
|
|
435
435
|
if (this.options.saveMissingTo === "fallback" && W && W[0])
|
|
436
436
|
for (let C = 0; C < W.length; C++)
|
|
437
437
|
A.push(W[C]);
|
|
438
|
-
else this.options.saveMissingTo === "all" ? A = this.languageUtils.toResolveHierarchy(
|
|
438
|
+
else this.options.saveMissingTo === "all" ? A = this.languageUtils.toResolveHierarchy(s.lng || this.language) : A.push(s.lng || this.language);
|
|
439
439
|
const oe = (C, T, H) => {
|
|
440
440
|
var ue;
|
|
441
441
|
const le = j && H !== h ? H : P;
|
|
442
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(C, l, T, le, E,
|
|
442
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(C, l, T, le, E, s) : (ue = this.backendConnector) != null && ue.saveMissing && this.backendConnector.saveMissing(C, l, T, le, E, s), this.emit("missingKey", C, l, T, h);
|
|
443
443
|
};
|
|
444
444
|
this.options.saveMissing && (this.options.saveMissingPlurals && L ? A.forEach((C) => {
|
|
445
|
-
const T = this.pluralResolver.getSuffixes(C,
|
|
446
|
-
D &&
|
|
447
|
-
oe([C], o + H,
|
|
445
|
+
const T = this.pluralResolver.getSuffixes(C, s);
|
|
446
|
+
D && s[`defaultValue${this.options.pluralSeparator}zero`] && T.indexOf(`${this.options.pluralSeparator}zero`) < 0 && T.push(`${this.options.pluralSeparator}zero`), T.forEach((H) => {
|
|
447
|
+
oe([C], o + H, s[`defaultValue${H}`] || O);
|
|
448
448
|
});
|
|
449
449
|
}) : oe(A, o, O));
|
|
450
450
|
}
|
|
451
|
-
h = this.extendTranslation(h, e,
|
|
451
|
+
h = this.extendTranslation(h, e, s, d, i), N && h === o && this.options.appendNamespaceToMissingKey && (h = `${l}${c}${o}`), (N || R) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${c}${o}` : o, R ? h : void 0, s));
|
|
452
452
|
}
|
|
453
|
-
return n ? (d.res = h, d.usedParams = this.getUsedParamsDetails(
|
|
453
|
+
return n ? (d.res = h, d.usedParams = this.getUsedParamsDetails(s), d) : h;
|
|
454
454
|
}
|
|
455
|
-
extendTranslation(e, t,
|
|
455
|
+
extendTranslation(e, t, i, s, n) {
|
|
456
456
|
var u, l;
|
|
457
457
|
if ((u = this.i18nFormat) != null && u.parse)
|
|
458
458
|
e = this.i18nFormat.parse(e, {
|
|
459
459
|
...this.options.interpolation.defaultVariables,
|
|
460
|
-
...
|
|
461
|
-
},
|
|
462
|
-
resolved:
|
|
460
|
+
...i
|
|
461
|
+
}, i.lng || this.language || s.usedLng, s.usedNS, s.usedKey, {
|
|
462
|
+
resolved: s
|
|
463
463
|
});
|
|
464
|
-
else if (!
|
|
465
|
-
|
|
466
|
-
...
|
|
464
|
+
else if (!i.skipInterpolation) {
|
|
465
|
+
i.interpolation && this.interpolator.init({
|
|
466
|
+
...i,
|
|
467
467
|
interpolation: {
|
|
468
468
|
...this.options.interpolation,
|
|
469
|
-
...
|
|
469
|
+
...i.interpolation
|
|
470
470
|
}
|
|
471
471
|
});
|
|
472
|
-
const c = g(e) && (((l =
|
|
472
|
+
const c = g(e) && (((l = i == null ? void 0 : i.interpolation) == null ? void 0 : l.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
473
473
|
let f;
|
|
474
474
|
if (c) {
|
|
475
475
|
const d = e.match(this.interpolator.nestingRegexp);
|
|
476
476
|
f = d && d.length;
|
|
477
477
|
}
|
|
478
|
-
let p =
|
|
478
|
+
let p = i.replace && !g(i.replace) ? i.replace : i;
|
|
479
479
|
if (this.options.interpolation.defaultVariables && (p = {
|
|
480
480
|
...this.options.interpolation.defaultVariables,
|
|
481
481
|
...p
|
|
482
|
-
}), e = this.interpolator.interpolate(e, p,
|
|
482
|
+
}), e = this.interpolator.interpolate(e, p, i.lng || this.language || s.usedLng, i), c) {
|
|
483
483
|
const d = e.match(this.interpolator.nestingRegexp), h = d && d.length;
|
|
484
|
-
f < h && (
|
|
484
|
+
f < h && (i.nest = !1);
|
|
485
485
|
}
|
|
486
|
-
!
|
|
486
|
+
!i.lng && s && s.res && (i.lng = this.language || s.usedLng), i.nest !== !1 && (e = this.interpolator.nest(e, (...d) => (n == null ? void 0 : n[0]) === d[0] && !i.context ? (this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${t[0]}`), null) : this.translate(...d, t), i)), i.interpolation && this.interpolator.reset();
|
|
487
487
|
}
|
|
488
|
-
const a =
|
|
489
|
-
return e != null && (o != null && o.length) &&
|
|
488
|
+
const a = i.postProcess || this.options.postProcess, o = g(a) ? [a] : a;
|
|
489
|
+
return e != null && (o != null && o.length) && i.applyPostProcessor !== !1 && (e = je.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
490
490
|
i18nResolved: {
|
|
491
|
-
...
|
|
492
|
-
usedParams: this.getUsedParamsDetails(
|
|
491
|
+
...s,
|
|
492
|
+
usedParams: this.getUsedParamsDetails(i)
|
|
493
493
|
},
|
|
494
|
-
...
|
|
495
|
-
} :
|
|
494
|
+
...i
|
|
495
|
+
} : i, this)), e;
|
|
496
496
|
}
|
|
497
497
|
resolve(e, t = {}) {
|
|
498
|
-
let
|
|
498
|
+
let i, s, n, a, o;
|
|
499
499
|
return g(e) && (e = [e]), e.forEach((u) => {
|
|
500
|
-
if (this.isValidLookup(
|
|
500
|
+
if (this.isValidLookup(i)) return;
|
|
501
501
|
const l = this.extractFromKey(u, t), c = l.key;
|
|
502
|
-
|
|
502
|
+
s = c;
|
|
503
503
|
let f = l.namespaces;
|
|
504
504
|
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
505
505
|
const p = t.count !== void 0 && !g(t.count), d = p && !t.ordinal && t.count === 0, h = t.context !== void 0 && (g(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
506
506
|
f.forEach((y) => {
|
|
507
507
|
var v, w;
|
|
508
|
-
this.isValidLookup(
|
|
508
|
+
this.isValidLookup(i) || (o = y, !me[`${m[0]}-${y}`] && ((v = this.utils) != null && v.hasLoadedNamespace) && !((w = this.utils) != null && w.hasLoadedNamespace(o)) && (me[`${m[0]}-${y}`] = !0, this.logger.warn(`key "${s}" for languages "${m.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!!!")), m.forEach((F) => {
|
|
509
509
|
var _;
|
|
510
|
-
if (this.isValidLookup(
|
|
510
|
+
if (this.isValidLookup(i)) return;
|
|
511
511
|
a = F;
|
|
512
512
|
const L = [c];
|
|
513
513
|
if ((_ = this.i18nFormat) != null && _.addLookupKeys)
|
|
@@ -523,12 +523,12 @@ class q extends X {
|
|
|
523
523
|
}
|
|
524
524
|
let j;
|
|
525
525
|
for (; j = L.pop(); )
|
|
526
|
-
this.isValidLookup(
|
|
526
|
+
this.isValidLookup(i) || (n = j, i = this.getResource(F, y, j, t));
|
|
527
527
|
}));
|
|
528
528
|
});
|
|
529
529
|
}), {
|
|
530
|
-
res:
|
|
531
|
-
usedKey:
|
|
530
|
+
res: i,
|
|
531
|
+
usedKey: s,
|
|
532
532
|
exactUsedKey: n,
|
|
533
533
|
usedLng: a,
|
|
534
534
|
usedNS: o
|
|
@@ -537,29 +537,29 @@ class q extends X {
|
|
|
537
537
|
isValidLookup(e) {
|
|
538
538
|
return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
|
|
539
539
|
}
|
|
540
|
-
getResource(e, t,
|
|
540
|
+
getResource(e, t, i, s = {}) {
|
|
541
541
|
var n;
|
|
542
|
-
return (n = this.i18nFormat) != null && n.getResource ? this.i18nFormat.getResource(e, t,
|
|
542
|
+
return (n = this.i18nFormat) != null && n.getResource ? this.i18nFormat.getResource(e, t, i, s) : this.resourceStore.getResource(e, t, i, s);
|
|
543
543
|
}
|
|
544
544
|
getUsedParamsDetails(e = {}) {
|
|
545
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"],
|
|
546
|
-
let
|
|
547
|
-
if (
|
|
545
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], i = e.replace && !g(e.replace);
|
|
546
|
+
let s = i ? e.replace : e;
|
|
547
|
+
if (i && typeof e.count < "u" && (s.count = e.count), this.options.interpolation.defaultVariables && (s = {
|
|
548
548
|
...this.options.interpolation.defaultVariables,
|
|
549
|
-
...
|
|
550
|
-
}), !
|
|
551
|
-
|
|
552
|
-
...
|
|
549
|
+
...s
|
|
550
|
+
}), !i) {
|
|
551
|
+
s = {
|
|
552
|
+
...s
|
|
553
553
|
};
|
|
554
554
|
for (const n of t)
|
|
555
|
-
delete
|
|
555
|
+
delete s[n];
|
|
556
556
|
}
|
|
557
|
-
return
|
|
557
|
+
return s;
|
|
558
558
|
}
|
|
559
559
|
static hasDefaultValue(e) {
|
|
560
560
|
const t = "defaultValue";
|
|
561
|
-
for (const
|
|
562
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
561
|
+
for (const i in e)
|
|
562
|
+
if (Object.prototype.hasOwnProperty.call(e, i) && t === i.substring(0, t.length) && e[i] !== void 0)
|
|
563
563
|
return !0;
|
|
564
564
|
return !1;
|
|
565
565
|
}
|
|
@@ -595,15 +595,15 @@ class xe {
|
|
|
595
595
|
getBestMatchFromCodes(e) {
|
|
596
596
|
if (!e) return null;
|
|
597
597
|
let t;
|
|
598
|
-
return e.forEach((
|
|
598
|
+
return e.forEach((i) => {
|
|
599
599
|
if (t) return;
|
|
600
|
-
const
|
|
601
|
-
(!this.options.supportedLngs || this.isSupportedCode(
|
|
602
|
-
}), !t && this.options.supportedLngs && e.forEach((
|
|
600
|
+
const s = this.formatLanguageCode(i);
|
|
601
|
+
(!this.options.supportedLngs || this.isSupportedCode(s)) && (t = s);
|
|
602
|
+
}), !t && this.options.supportedLngs && e.forEach((i) => {
|
|
603
603
|
if (t) return;
|
|
604
|
-
const
|
|
605
|
-
if (this.isSupportedCode(
|
|
606
|
-
const n = this.getLanguagePartFromCode(
|
|
604
|
+
const s = this.getScriptPartFromCode(i);
|
|
605
|
+
if (this.isSupportedCode(s)) return t = s;
|
|
606
|
+
const n = this.getLanguagePartFromCode(i);
|
|
607
607
|
if (this.isSupportedCode(n)) return t = n;
|
|
608
608
|
t = this.options.supportedLngs.find((a) => {
|
|
609
609
|
if (a === n) return a;
|
|
@@ -616,16 +616,16 @@ class xe {
|
|
|
616
616
|
if (!e) return [];
|
|
617
617
|
if (typeof e == "function" && (e = e(t)), g(e) && (e = [e]), Array.isArray(e)) return e;
|
|
618
618
|
if (!t) return e.default || [];
|
|
619
|
-
let
|
|
620
|
-
return
|
|
619
|
+
let i = e[t];
|
|
620
|
+
return i || (i = e[this.getScriptPartFromCode(t)]), i || (i = e[this.formatLanguageCode(t)]), i || (i = e[this.getLanguagePartFromCode(t)]), i || (i = e.default), i || [];
|
|
621
621
|
}
|
|
622
622
|
toResolveHierarchy(e, t) {
|
|
623
|
-
const
|
|
624
|
-
a && (this.isSupportedCode(a) ?
|
|
623
|
+
const i = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), s = [], n = (a) => {
|
|
624
|
+
a && (this.isSupportedCode(a) ? s.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
|
|
625
625
|
};
|
|
626
|
-
return g(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && n(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && n(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && n(this.getLanguagePartFromCode(e))) : g(e) && n(this.formatLanguageCode(e)),
|
|
627
|
-
|
|
628
|
-
}),
|
|
626
|
+
return g(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && n(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && n(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && n(this.getLanguagePartFromCode(e))) : g(e) && n(this.formatLanguageCode(e)), i.forEach((a) => {
|
|
627
|
+
s.indexOf(a) < 0 && n(this.formatLanguageCode(a));
|
|
628
|
+
}), s;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
const ye = {
|
|
@@ -649,16 +649,16 @@ class ut {
|
|
|
649
649
|
this.pluralRulesCache = {};
|
|
650
650
|
}
|
|
651
651
|
getRule(e, t = {}) {
|
|
652
|
-
const
|
|
653
|
-
cleanedCode:
|
|
654
|
-
type:
|
|
652
|
+
const i = J(e === "dev" ? "en" : e), s = t.ordinal ? "ordinal" : "cardinal", n = JSON.stringify({
|
|
653
|
+
cleanedCode: i,
|
|
654
|
+
type: s
|
|
655
655
|
});
|
|
656
656
|
if (n in this.pluralRulesCache)
|
|
657
657
|
return this.pluralRulesCache[n];
|
|
658
658
|
let a;
|
|
659
659
|
try {
|
|
660
|
-
a = new Intl.PluralRules(
|
|
661
|
-
type:
|
|
660
|
+
a = new Intl.PluralRules(i, {
|
|
661
|
+
type: s
|
|
662
662
|
});
|
|
663
663
|
} catch {
|
|
664
664
|
if (typeof Intl > "u")
|
|
@@ -670,29 +670,29 @@ class ut {
|
|
|
670
670
|
return this.pluralRulesCache[n] = a, a;
|
|
671
671
|
}
|
|
672
672
|
needsPlural(e, t = {}) {
|
|
673
|
-
let
|
|
674
|
-
return
|
|
673
|
+
let i = this.getRule(e, t);
|
|
674
|
+
return i || (i = this.getRule("dev", t)), (i == null ? void 0 : i.resolvedOptions().pluralCategories.length) > 1;
|
|
675
675
|
}
|
|
676
|
-
getPluralFormsOfKey(e, t,
|
|
677
|
-
return this.getSuffixes(e,
|
|
676
|
+
getPluralFormsOfKey(e, t, i = {}) {
|
|
677
|
+
return this.getSuffixes(e, i).map((s) => `${t}${s}`);
|
|
678
678
|
}
|
|
679
679
|
getSuffixes(e, t = {}) {
|
|
680
|
-
let
|
|
681
|
-
return
|
|
680
|
+
let i = this.getRule(e, t);
|
|
681
|
+
return i || (i = this.getRule("dev", t)), i ? i.resolvedOptions().pluralCategories.sort((s, n) => ye[s] - ye[n]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
|
|
682
682
|
}
|
|
683
|
-
getSuffix(e, t,
|
|
684
|
-
const
|
|
685
|
-
return
|
|
683
|
+
getSuffix(e, t, i = {}) {
|
|
684
|
+
const s = this.getRule(e, i);
|
|
685
|
+
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));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
const be = (r, e, t,
|
|
688
|
+
const be = (r, e, t, i = ".", s = !0) => {
|
|
689
689
|
let n = et(r, e, t);
|
|
690
|
-
return !n &&
|
|
690
|
+
return !n && s && g(t) && (n = ie(r, t, i), n === void 0 && (n = ie(e, t, i))), n;
|
|
691
691
|
}, te = (r) => r.replace(/\$/g, "$$$$");
|
|
692
692
|
class Le {
|
|
693
693
|
constructor(e = {}) {
|
|
694
694
|
var t;
|
|
695
|
-
this.logger = $.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((
|
|
695
|
+
this.logger = $.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((i) => i), this.init(e);
|
|
696
696
|
}
|
|
697
697
|
init(e = {}) {
|
|
698
698
|
e.interpolation || (e.interpolation = {
|
|
@@ -700,8 +700,8 @@ class Le {
|
|
|
700
700
|
});
|
|
701
701
|
const {
|
|
702
702
|
escape: t,
|
|
703
|
-
escapeValue:
|
|
704
|
-
useRawValueToEscape:
|
|
703
|
+
escapeValue: i,
|
|
704
|
+
useRawValueToEscape: s,
|
|
705
705
|
prefix: n,
|
|
706
706
|
prefixEscaped: a,
|
|
707
707
|
suffix: o,
|
|
@@ -717,36 +717,36 @@ class Le {
|
|
|
717
717
|
maxReplaces: v,
|
|
718
718
|
alwaysFormat: w
|
|
719
719
|
} = e.interpolation;
|
|
720
|
-
this.escape = t !== void 0 ? t : st, this.escapeValue =
|
|
720
|
+
this.escape = t !== void 0 ? t : st, this.escapeValue = i !== void 0 ? i : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = n ? I(n) : a || "{{", this.suffix = o ? I(o) : u || "}}", this.formatSeparator = l || ",", this.unescapePrefix = c ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : c || "", this.nestingPrefix = p ? I(p) : d || I("$t("), this.nestingSuffix = h ? I(h) : m || I(")"), this.nestingOptionsSeparator = y || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
|
|
721
721
|
}
|
|
722
722
|
reset() {
|
|
723
723
|
this.options && this.init(this.options);
|
|
724
724
|
}
|
|
725
725
|
resetRegExp() {
|
|
726
|
-
const e = (t,
|
|
726
|
+
const e = (t, i) => (t == null ? void 0 : t.source) === i ? (t.lastIndex = 0, t) : new RegExp(i, "g");
|
|
727
727
|
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}`);
|
|
728
728
|
}
|
|
729
|
-
interpolate(e, t,
|
|
729
|
+
interpolate(e, t, i, s) {
|
|
730
730
|
var d;
|
|
731
731
|
let n, a, o;
|
|
732
732
|
const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (h) => {
|
|
733
733
|
if (h.indexOf(this.formatSeparator) < 0) {
|
|
734
734
|
const w = be(t, u, h, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
735
|
-
return this.alwaysFormat ? this.format(w, void 0,
|
|
736
|
-
...
|
|
735
|
+
return this.alwaysFormat ? this.format(w, void 0, i, {
|
|
736
|
+
...s,
|
|
737
737
|
...t,
|
|
738
738
|
interpolationkey: h
|
|
739
739
|
}) : w;
|
|
740
740
|
}
|
|
741
741
|
const m = h.split(this.formatSeparator), y = m.shift().trim(), v = m.join(this.formatSeparator).trim();
|
|
742
|
-
return this.format(be(t, u, y, this.options.keySeparator, this.options.ignoreJSONStructure), v,
|
|
743
|
-
...
|
|
742
|
+
return this.format(be(t, u, y, this.options.keySeparator, this.options.ignoreJSONStructure), v, i, {
|
|
743
|
+
...s,
|
|
744
744
|
...t,
|
|
745
745
|
interpolationkey: y
|
|
746
746
|
});
|
|
747
747
|
};
|
|
748
748
|
this.resetRegExp();
|
|
749
|
-
const c = (
|
|
749
|
+
const c = (s == null ? void 0 : s.missingInterpolationHandler) || this.options.missingInterpolationHandler, f = ((d = s == null ? void 0 : s.interpolation) == null ? void 0 : d.skipOnVariables) !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
750
750
|
return [{
|
|
751
751
|
regex: this.regexpUnescape,
|
|
752
752
|
safeValue: (h) => te(h)
|
|
@@ -758,9 +758,9 @@ class Le {
|
|
|
758
758
|
const m = n[1].trim();
|
|
759
759
|
if (a = l(m), a === void 0)
|
|
760
760
|
if (typeof c == "function") {
|
|
761
|
-
const v = c(e, n,
|
|
761
|
+
const v = c(e, n, s);
|
|
762
762
|
a = g(v) ? v : "";
|
|
763
|
-
} else if (
|
|
763
|
+
} else if (s && Object.prototype.hasOwnProperty.call(s, m))
|
|
764
764
|
a = "";
|
|
765
765
|
else if (f) {
|
|
766
766
|
a = n[0];
|
|
@@ -774,8 +774,8 @@ class Le {
|
|
|
774
774
|
}
|
|
775
775
|
}), e;
|
|
776
776
|
}
|
|
777
|
-
nest(e, t,
|
|
778
|
-
let
|
|
777
|
+
nest(e, t, i = {}) {
|
|
778
|
+
let s, n, a;
|
|
779
779
|
const o = (u, l) => {
|
|
780
780
|
const c = this.nestingOptionsSeparator;
|
|
781
781
|
if (u.indexOf(c) < 0) return u;
|
|
@@ -794,17 +794,17 @@ class Le {
|
|
|
794
794
|
}
|
|
795
795
|
return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, u;
|
|
796
796
|
};
|
|
797
|
-
for (;
|
|
797
|
+
for (; s = this.nestingRegexp.exec(e); ) {
|
|
798
798
|
let u = [];
|
|
799
799
|
a = {
|
|
800
|
-
...
|
|
800
|
+
...i
|
|
801
801
|
}, a = a.replace && !g(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
802
|
-
const l = /{.*}/.test(
|
|
803
|
-
if (l !== -1 && (u =
|
|
804
|
-
g(n) || (n = ce(n)), n || (this.logger.warn(`missed to resolve ${
|
|
805
|
-
...
|
|
806
|
-
interpolationkey:
|
|
807
|
-
}), n.trim())), e = e.replace(
|
|
802
|
+
const l = /{.*}/.test(s[1]) ? s[1].lastIndexOf("}") + 1 : s[1].indexOf(this.formatSeparator);
|
|
803
|
+
if (l !== -1 && (u = s[1].slice(l).split(this.formatSeparator).map((c) => c.trim()).filter(Boolean), s[1] = s[1].slice(0, l)), n = t(o.call(this, s[1].trim(), a), a), n && s[0] === e && !g(n)) return n;
|
|
804
|
+
g(n) || (n = ce(n)), n || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), n = ""), u.length && (n = u.reduce((c, f) => this.format(c, f, i.lng, {
|
|
805
|
+
...i,
|
|
806
|
+
interpolationkey: s[1].trim()
|
|
807
|
+
}), n.trim())), e = e.replace(s[0], n), this.regexp.lastIndex = 0;
|
|
808
808
|
}
|
|
809
809
|
return e;
|
|
810
810
|
}
|
|
@@ -813,10 +813,10 @@ const ft = (r) => {
|
|
|
813
813
|
let e = r.toLowerCase().trim();
|
|
814
814
|
const t = {};
|
|
815
815
|
if (r.indexOf("(") > -1) {
|
|
816
|
-
const
|
|
817
|
-
e =
|
|
818
|
-
const
|
|
819
|
-
e === "currency" &&
|
|
816
|
+
const i = r.split("(");
|
|
817
|
+
e = i[0].toLowerCase().trim();
|
|
818
|
+
const s = i[1].substring(0, i[1].length - 1);
|
|
819
|
+
e === "currency" && s.indexOf(":") < 0 ? t.currency || (t.currency = s.trim()) : e === "relativetime" && s.indexOf(":") < 0 ? t.range || (t.range = s.trim()) : s.split(";").forEach((a) => {
|
|
820
820
|
if (a) {
|
|
821
821
|
const [o, ...u] = a.split(":"), l = u.join(":").trim().replace(/^'+|'+$/g, ""), c = o.trim();
|
|
822
822
|
t[c] || (t[c] = l), l === "false" && (t[c] = !1), l === "true" && (t[c] = !0), isNaN(l) || (t[c] = parseInt(l, 10));
|
|
@@ -829,17 +829,17 @@ const ft = (r) => {
|
|
|
829
829
|
};
|
|
830
830
|
}, Oe = (r) => {
|
|
831
831
|
const e = {};
|
|
832
|
-
return (t,
|
|
833
|
-
let n =
|
|
834
|
-
|
|
832
|
+
return (t, i, s) => {
|
|
833
|
+
let n = s;
|
|
834
|
+
s && s.interpolationkey && s.formatParams && s.formatParams[s.interpolationkey] && s[s.interpolationkey] && (n = {
|
|
835
835
|
...n,
|
|
836
|
-
[
|
|
836
|
+
[s.interpolationkey]: void 0
|
|
837
837
|
});
|
|
838
|
-
const a =
|
|
838
|
+
const a = i + JSON.stringify(n);
|
|
839
839
|
let o = e[a];
|
|
840
|
-
return o || (o = r(J(
|
|
840
|
+
return o || (o = r(J(i), s), e[a] = o), o(t);
|
|
841
841
|
};
|
|
842
|
-
}, ct = (r) => (e, t,
|
|
842
|
+
}, ct = (r) => (e, t, i) => r(J(t), i)(e);
|
|
843
843
|
class ht {
|
|
844
844
|
constructor(e = {}) {
|
|
845
845
|
this.logger = $.create("formatter"), this.options = e, this.init(e);
|
|
@@ -848,35 +848,35 @@ class ht {
|
|
|
848
848
|
interpolation: {}
|
|
849
849
|
}) {
|
|
850
850
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
851
|
-
const
|
|
851
|
+
const i = t.cacheInBuiltFormats ? Oe : ct;
|
|
852
852
|
this.formats = {
|
|
853
|
-
number:
|
|
854
|
-
const a = new Intl.NumberFormat(
|
|
853
|
+
number: i((s, n) => {
|
|
854
|
+
const a = new Intl.NumberFormat(s, {
|
|
855
855
|
...n
|
|
856
856
|
});
|
|
857
857
|
return (o) => a.format(o);
|
|
858
858
|
}),
|
|
859
|
-
currency:
|
|
860
|
-
const a = new Intl.NumberFormat(
|
|
859
|
+
currency: i((s, n) => {
|
|
860
|
+
const a = new Intl.NumberFormat(s, {
|
|
861
861
|
...n,
|
|
862
862
|
style: "currency"
|
|
863
863
|
});
|
|
864
864
|
return (o) => a.format(o);
|
|
865
865
|
}),
|
|
866
|
-
datetime:
|
|
867
|
-
const a = new Intl.DateTimeFormat(
|
|
866
|
+
datetime: i((s, n) => {
|
|
867
|
+
const a = new Intl.DateTimeFormat(s, {
|
|
868
868
|
...n
|
|
869
869
|
});
|
|
870
870
|
return (o) => a.format(o);
|
|
871
871
|
}),
|
|
872
|
-
relativetime:
|
|
873
|
-
const a = new Intl.RelativeTimeFormat(
|
|
872
|
+
relativetime: i((s, n) => {
|
|
873
|
+
const a = new Intl.RelativeTimeFormat(s, {
|
|
874
874
|
...n
|
|
875
875
|
});
|
|
876
876
|
return (o) => a.format(o, n.range || "day");
|
|
877
877
|
}),
|
|
878
|
-
list:
|
|
879
|
-
const a = new Intl.ListFormat(
|
|
878
|
+
list: i((s, n) => {
|
|
879
|
+
const a = new Intl.ListFormat(s, {
|
|
880
880
|
...n
|
|
881
881
|
});
|
|
882
882
|
return (o) => a.format(o);
|
|
@@ -889,7 +889,7 @@ class ht {
|
|
|
889
889
|
addCached(e, t) {
|
|
890
890
|
this.formats[e.toLowerCase().trim()] = Oe(t);
|
|
891
891
|
}
|
|
892
|
-
format(e, t,
|
|
892
|
+
format(e, t, i, s = {}) {
|
|
893
893
|
const n = t.split(this.formatSeparator);
|
|
894
894
|
if (n.length > 1 && n[0].indexOf("(") > 1 && n[0].indexOf(")") < 0 && n.find((o) => o.indexOf(")") > -1)) {
|
|
895
895
|
const o = n.findIndex((u) => u.indexOf(")") > -1);
|
|
@@ -904,10 +904,10 @@ class ht {
|
|
|
904
904
|
if (this.formats[l]) {
|
|
905
905
|
let p = o;
|
|
906
906
|
try {
|
|
907
|
-
const d = ((f =
|
|
907
|
+
const d = ((f = s == null ? void 0 : s.formatParams) == null ? void 0 : f[s.interpolationkey]) || {}, h = d.locale || d.lng || s.locale || s.lng || i;
|
|
908
908
|
p = this.formats[l](o, h, {
|
|
909
909
|
...c,
|
|
910
|
-
...
|
|
910
|
+
...s,
|
|
911
911
|
...d
|
|
912
912
|
});
|
|
913
913
|
} catch (d) {
|
|
@@ -924,24 +924,24 @@ const dt = (r, e) => {
|
|
|
924
924
|
r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
|
|
925
925
|
};
|
|
926
926
|
class pt extends X {
|
|
927
|
-
constructor(e, t,
|
|
927
|
+
constructor(e, t, i, s = {}) {
|
|
928
928
|
var n, a;
|
|
929
|
-
super(), this.backend = e, this.store = t, this.services =
|
|
929
|
+
super(), this.backend = e, this.store = t, this.services = i, this.languageUtils = i.languageUtils, this.options = s, this.logger = $.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], (a = (n = this.backend) == null ? void 0 : n.init) == null || a.call(n, i, s.backend, s);
|
|
930
930
|
}
|
|
931
|
-
queueLoad(e, t,
|
|
931
|
+
queueLoad(e, t, i, s) {
|
|
932
932
|
const n = {}, a = {}, o = {}, u = {};
|
|
933
933
|
return e.forEach((l) => {
|
|
934
934
|
let c = !0;
|
|
935
935
|
t.forEach((f) => {
|
|
936
936
|
const p = `${l}|${f}`;
|
|
937
|
-
!
|
|
937
|
+
!i.reload && this.store.hasResourceBundle(l, f) ? this.state[p] = 2 : this.state[p] < 0 || (this.state[p] === 1 ? a[p] === void 0 && (a[p] = !0) : (this.state[p] = 1, c = !1, a[p] === void 0 && (a[p] = !0), n[p] === void 0 && (n[p] = !0), u[f] === void 0 && (u[f] = !0)));
|
|
938
938
|
}), c || (o[l] = !0);
|
|
939
939
|
}), (Object.keys(n).length || Object.keys(a).length) && this.queue.push({
|
|
940
940
|
pending: a,
|
|
941
941
|
pendingCount: Object.keys(a).length,
|
|
942
942
|
loaded: {},
|
|
943
943
|
errors: [],
|
|
944
|
-
callback:
|
|
944
|
+
callback: s
|
|
945
945
|
}), {
|
|
946
946
|
toLoad: Object.keys(n),
|
|
947
947
|
pending: Object.keys(a),
|
|
@@ -949,11 +949,11 @@ class pt extends X {
|
|
|
949
949
|
toLoadNamespaces: Object.keys(u)
|
|
950
950
|
};
|
|
951
951
|
}
|
|
952
|
-
loaded(e, t,
|
|
953
|
-
const
|
|
954
|
-
t && this.emit("failedLoading", n, a, t), !t &&
|
|
952
|
+
loaded(e, t, i) {
|
|
953
|
+
const s = e.split("|"), n = s[0], a = s[1];
|
|
954
|
+
t && this.emit("failedLoading", n, a, t), !t && i && this.store.addResourceBundle(n, a, i, void 0, void 0, {
|
|
955
955
|
skipCopy: !0
|
|
956
|
-
}), this.state[e] = t ? -1 : 2, t &&
|
|
956
|
+
}), this.state[e] = t ? -1 : 2, t && i && (this.state[e] = 0);
|
|
957
957
|
const o = {};
|
|
958
958
|
this.queue.forEach((u) => {
|
|
959
959
|
Xe(u.loaded, [n], a), dt(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((l) => {
|
|
@@ -965,14 +965,14 @@ class pt extends X {
|
|
|
965
965
|
}), u.done = !0, u.errors.length ? u.callback(u.errors) : u.callback());
|
|
966
966
|
}), this.emit("loaded", o), this.queue = this.queue.filter((u) => !u.done);
|
|
967
967
|
}
|
|
968
|
-
read(e, t,
|
|
968
|
+
read(e, t, i, s = 0, n = this.retryTimeout, a) {
|
|
969
969
|
if (!e.length) return a(null, {});
|
|
970
970
|
if (this.readingCalls >= this.maxParallelReads) {
|
|
971
971
|
this.waitingReads.push({
|
|
972
972
|
lng: e,
|
|
973
973
|
ns: t,
|
|
974
|
-
fcName:
|
|
975
|
-
tried:
|
|
974
|
+
fcName: i,
|
|
975
|
+
tried: s,
|
|
976
976
|
wait: n,
|
|
977
977
|
callback: a
|
|
978
978
|
});
|
|
@@ -984,14 +984,14 @@ class pt extends X {
|
|
|
984
984
|
const f = this.waitingReads.shift();
|
|
985
985
|
this.read(f.lng, f.ns, f.fcName, f.tried, f.wait, f.callback);
|
|
986
986
|
}
|
|
987
|
-
if (l && c &&
|
|
987
|
+
if (l && c && s < this.maxRetries) {
|
|
988
988
|
setTimeout(() => {
|
|
989
|
-
this.read.call(this, e, t,
|
|
989
|
+
this.read.call(this, e, t, i, s + 1, n * 2, a);
|
|
990
990
|
}, n);
|
|
991
991
|
return;
|
|
992
992
|
}
|
|
993
993
|
a(l, c);
|
|
994
|
-
}, u = this.backend[
|
|
994
|
+
}, u = this.backend[i].bind(this.backend);
|
|
995
995
|
if (u.length === 2) {
|
|
996
996
|
try {
|
|
997
997
|
const l = u(e, t);
|
|
@@ -1003,39 +1003,39 @@ class pt extends X {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
return u(e, t, o);
|
|
1005
1005
|
}
|
|
1006
|
-
prepareLoading(e, t,
|
|
1006
|
+
prepareLoading(e, t, i = {}, s) {
|
|
1007
1007
|
if (!this.backend)
|
|
1008
|
-
return this.logger.warn("No backend was added via i18next.use. Will not load resources."),
|
|
1008
|
+
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
|
|
1009
1009
|
g(e) && (e = this.languageUtils.toResolveHierarchy(e)), g(t) && (t = [t]);
|
|
1010
|
-
const n = this.queueLoad(e, t,
|
|
1010
|
+
const n = this.queueLoad(e, t, i, s);
|
|
1011
1011
|
if (!n.toLoad.length)
|
|
1012
|
-
return n.pending.length ||
|
|
1012
|
+
return n.pending.length || s(), null;
|
|
1013
1013
|
n.toLoad.forEach((a) => {
|
|
1014
1014
|
this.loadOne(a);
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
|
-
load(e, t,
|
|
1018
|
-
this.prepareLoading(e, t, {},
|
|
1017
|
+
load(e, t, i) {
|
|
1018
|
+
this.prepareLoading(e, t, {}, i);
|
|
1019
1019
|
}
|
|
1020
|
-
reload(e, t,
|
|
1020
|
+
reload(e, t, i) {
|
|
1021
1021
|
this.prepareLoading(e, t, {
|
|
1022
1022
|
reload: !0
|
|
1023
|
-
},
|
|
1023
|
+
}, i);
|
|
1024
1024
|
}
|
|
1025
1025
|
loadOne(e, t = "") {
|
|
1026
|
-
const
|
|
1027
|
-
this.read(
|
|
1028
|
-
a && this.logger.warn(`${t}loading namespace ${n} for language ${
|
|
1026
|
+
const i = e.split("|"), s = i[0], n = i[1];
|
|
1027
|
+
this.read(s, n, "read", void 0, void 0, (a, o) => {
|
|
1028
|
+
a && this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${n} for language ${s}`, o), this.loaded(e, a, o);
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
|
-
saveMissing(e, t,
|
|
1031
|
+
saveMissing(e, t, i, s, n, a = {}, o = () => {
|
|
1032
1032
|
}) {
|
|
1033
1033
|
var u, l, c, f, p;
|
|
1034
1034
|
if ((l = (u = this.services) == null ? void 0 : u.utils) != null && l.hasLoadedNamespace && !((f = (c = this.services) == null ? void 0 : c.utils) != null && f.hasLoadedNamespace(t))) {
|
|
1035
|
-
this.logger.warn(`did not save key "${
|
|
1035
|
+
this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
1036
1036
|
return;
|
|
1037
1037
|
}
|
|
1038
|
-
if (!(
|
|
1038
|
+
if (!(i == null || i === "")) {
|
|
1039
1039
|
if ((p = this.backend) != null && p.create) {
|
|
1040
1040
|
const d = {
|
|
1041
1041
|
...a,
|
|
@@ -1044,14 +1044,14 @@ class pt extends X {
|
|
|
1044
1044
|
if (h.length < 6)
|
|
1045
1045
|
try {
|
|
1046
1046
|
let m;
|
|
1047
|
-
h.length === 5 ? m = h(e, t,
|
|
1047
|
+
h.length === 5 ? m = h(e, t, i, s, d) : m = h(e, t, i, s), m && typeof m.then == "function" ? m.then((y) => o(null, y)).catch(o) : o(null, m);
|
|
1048
1048
|
} catch (m) {
|
|
1049
1049
|
o(m);
|
|
1050
1050
|
}
|
|
1051
1051
|
else
|
|
1052
|
-
h(e, t,
|
|
1052
|
+
h(e, t, i, s, o, d);
|
|
1053
1053
|
}
|
|
1054
|
-
!e || !e[0] || this.store.addResource(e[0], t,
|
|
1054
|
+
!e || !e[0] || this.store.addResource(e[0], t, i, s);
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
@@ -1092,8 +1092,8 @@ const se = () => ({
|
|
|
1092
1092
|
let e = {};
|
|
1093
1093
|
if (typeof r[1] == "object" && (e = r[1]), g(r[1]) && (e.defaultValue = r[1]), g(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
|
|
1094
1094
|
const t = r[3] || r[2];
|
|
1095
|
-
Object.keys(t).forEach((
|
|
1096
|
-
e[
|
|
1095
|
+
Object.keys(t).forEach((i) => {
|
|
1096
|
+
e[i] = t[i];
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
1099
|
return e;
|
|
@@ -1123,8 +1123,8 @@ const se = () => ({
|
|
|
1123
1123
|
};
|
|
1124
1124
|
let we = !1;
|
|
1125
1125
|
const mt = (r) => {
|
|
1126
|
-
var e, t,
|
|
1127
|
-
return !!(((
|
|
1126
|
+
var e, t, i, s, n, a, o, u, l;
|
|
1127
|
+
return !!(((i = (t = (e = r == null ? void 0 : r.modules) == null ? void 0 : e.backend) == null ? void 0 : t.name) == null ? void 0 : i.indexOf("Locize")) > 0 || ((o = (a = (n = (s = r == null ? void 0 : r.modules) == null ? void 0 : s.backend) == null ? void 0 : n.constructor) == null ? void 0 : a.name) == null ? void 0 : o.indexOf("Locize")) > 0 || (l = (u = r == null ? void 0 : r.options) == null ? void 0 : u.backend) != null && l.backends && r.options.backend.backends.some((c) => {
|
|
1128
1128
|
var f, p, d;
|
|
1129
1129
|
return ((f = c == null ? void 0 : c.name) == null ? void 0 : f.indexOf("Locize")) > 0 || ((d = (p = c == null ? void 0 : c.constructor) == null ? void 0 : p.name) == null ? void 0 : d.indexOf("Locize")) > 0;
|
|
1130
1130
|
}));
|
|
@@ -1143,18 +1143,18 @@ class z extends X {
|
|
|
1143
1143
|
}
|
|
1144
1144
|
init(e = {}, t) {
|
|
1145
1145
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (g(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
1146
|
-
const
|
|
1146
|
+
const i = se();
|
|
1147
1147
|
this.options = {
|
|
1148
|
-
...
|
|
1148
|
+
...i,
|
|
1149
1149
|
...this.options,
|
|
1150
1150
|
...Ce(e)
|
|
1151
1151
|
}, this.options.interpolation = {
|
|
1152
|
-
...
|
|
1152
|
+
...i.interpolation,
|
|
1153
1153
|
...this.options.interpolation
|
|
1154
|
-
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler =
|
|
1155
|
-
const
|
|
1154
|
+
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = i.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !mt(this) && !we && (typeof console < "u" && typeof console.info < "u" && console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), we = !0);
|
|
1155
|
+
const s = (l) => l ? typeof l == "function" ? new l() : l : null;
|
|
1156
1156
|
if (!this.options.isClone) {
|
|
1157
|
-
this.modules.logger ? $.init(
|
|
1157
|
+
this.modules.logger ? $.init(s(this.modules.logger), this.options) : $.init(null, this.options);
|
|
1158
1158
|
let l;
|
|
1159
1159
|
this.modules.formatter ? l = this.modules.formatter : l = ht;
|
|
1160
1160
|
const c = new xe(this.options);
|
|
@@ -1163,11 +1163,11 @@ class z extends X {
|
|
|
1163
1163
|
f.logger = $, f.resourceStore = this.store, f.languageUtils = c, f.pluralResolver = new ut(c, {
|
|
1164
1164
|
prepend: this.options.pluralSeparator,
|
|
1165
1165
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1166
|
-
}), this.options.interpolation.format && this.options.interpolation.format !==
|
|
1166
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== i.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), l && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (f.formatter = s(l), f.formatter.init && f.formatter.init(f, this.options), this.options.interpolation.format = f.formatter.format.bind(f.formatter)), f.interpolator = new Le(this.options), f.utils = {
|
|
1167
1167
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1168
|
-
}, f.backendConnector = new pt(
|
|
1168
|
+
}, f.backendConnector = new pt(s(this.modules.backend), f.resourceStore, f, this.options), f.backendConnector.on("*", (d, ...h) => {
|
|
1169
1169
|
this.emit(d, ...h);
|
|
1170
|
-
}), this.modules.languageDetector && (f.languageDetector =
|
|
1170
|
+
}), this.modules.languageDetector && (f.languageDetector = s(this.modules.languageDetector), f.languageDetector.init && f.languageDetector.init(f, this.options.detection, this.options)), this.modules.i18nFormat && (f.i18nFormat = s(this.modules.i18nFormat), f.i18nFormat.init && f.i18nFormat.init(this)), this.translator = new q(this.services, this.options), this.translator.on("*", (d, ...h) => {
|
|
1171
1171
|
this.emit(d, ...h);
|
|
1172
1172
|
}), this.modules.external.forEach((d) => {
|
|
1173
1173
|
d.init && d.init(this);
|
|
@@ -1193,27 +1193,27 @@ class z extends X {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
loadResources(e, t = Y) {
|
|
1195
1195
|
var n, a;
|
|
1196
|
-
let
|
|
1197
|
-
const
|
|
1198
|
-
if (typeof e == "function" && (
|
|
1199
|
-
if ((
|
|
1196
|
+
let i = t;
|
|
1197
|
+
const s = g(e) ? e : this.language;
|
|
1198
|
+
if (typeof e == "function" && (i = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1199
|
+
if ((s == null ? void 0 : s.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return i();
|
|
1200
1200
|
const o = [], u = (l) => {
|
|
1201
1201
|
if (!l || l === "cimode") return;
|
|
1202
1202
|
this.services.languageUtils.toResolveHierarchy(l).forEach((f) => {
|
|
1203
1203
|
f !== "cimode" && o.indexOf(f) < 0 && o.push(f);
|
|
1204
1204
|
});
|
|
1205
1205
|
};
|
|
1206
|
-
|
|
1207
|
-
!l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language),
|
|
1206
|
+
s ? u(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((c) => u(c)), (a = (n = this.options.preload) == null ? void 0 : n.forEach) == null || a.call(n, (l) => u(l)), this.services.backendConnector.load(o, this.options.ns, (l) => {
|
|
1207
|
+
!l && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), i(l);
|
|
1208
1208
|
});
|
|
1209
1209
|
} else
|
|
1210
|
-
|
|
1210
|
+
i(null);
|
|
1211
1211
|
}
|
|
1212
|
-
reloadResources(e, t,
|
|
1213
|
-
const
|
|
1214
|
-
return typeof e == "function" && (
|
|
1215
|
-
|
|
1216
|
-
}),
|
|
1212
|
+
reloadResources(e, t, i) {
|
|
1213
|
+
const s = K();
|
|
1214
|
+
return typeof e == "function" && (i = e, e = void 0), typeof t == "function" && (i = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), i || (i = Y), this.services.backendConnector.reload(e, t, (n) => {
|
|
1215
|
+
s.resolve(), i(n);
|
|
1216
|
+
}), s;
|
|
1217
1217
|
}
|
|
1218
1218
|
use(e) {
|
|
1219
1219
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
@@ -1223,9 +1223,9 @@ class z extends X {
|
|
|
1223
1223
|
setResolvedLanguage(e) {
|
|
1224
1224
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
1225
1225
|
for (let t = 0; t < this.languages.length; t++) {
|
|
1226
|
-
const
|
|
1227
|
-
if (!(["cimode", "dev"].indexOf(
|
|
1228
|
-
this.resolvedLanguage =
|
|
1226
|
+
const i = this.languages[t];
|
|
1227
|
+
if (!(["cimode", "dev"].indexOf(i) > -1) && this.store.hasLanguageSomeTranslations(i)) {
|
|
1228
|
+
this.resolvedLanguage = i;
|
|
1229
1229
|
break;
|
|
1230
1230
|
}
|
|
1231
1231
|
}
|
|
@@ -1234,28 +1234,28 @@ class z extends X {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
changeLanguage(e, t) {
|
|
1236
1236
|
this.isLanguageChangingTo = e;
|
|
1237
|
-
const
|
|
1237
|
+
const i = K();
|
|
1238
1238
|
this.emit("languageChanging", e);
|
|
1239
|
-
const
|
|
1239
|
+
const s = (o) => {
|
|
1240
1240
|
this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
|
|
1241
1241
|
}, n = (o, u) => {
|
|
1242
|
-
u ? this.isLanguageChangingTo === e && (
|
|
1242
|
+
u ? this.isLanguageChangingTo === e && (s(u), this.translator.changeLanguage(u), this.isLanguageChangingTo = void 0, this.emit("languageChanged", u), this.logger.log("languageChanged", u)) : this.isLanguageChangingTo = void 0, i.resolve((...l) => this.t(...l)), t && t(o, (...l) => this.t(...l));
|
|
1243
1243
|
}, a = (o) => {
|
|
1244
1244
|
var c, f;
|
|
1245
1245
|
!e && !o && this.services.languageDetector && (o = []);
|
|
1246
1246
|
const u = g(o) ? o : o && o[0], l = this.store.hasLanguageSomeTranslations(u) ? u : this.services.languageUtils.getBestMatchFromCodes(g(o) ? [o] : o);
|
|
1247
|
-
l && (this.language ||
|
|
1247
|
+
l && (this.language || s(l), this.translator.language || this.translator.changeLanguage(l), (f = (c = this.services.languageDetector) == null ? void 0 : c.cacheUserLanguage) == null || f.call(c, l)), this.loadResources(l, (p) => {
|
|
1248
1248
|
n(p, l);
|
|
1249
1249
|
});
|
|
1250
1250
|
};
|
|
1251
|
-
return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e),
|
|
1251
|
+
return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), i;
|
|
1252
1252
|
}
|
|
1253
|
-
getFixedT(e, t,
|
|
1254
|
-
const
|
|
1253
|
+
getFixedT(e, t, i) {
|
|
1254
|
+
const s = (n, a, ...o) => {
|
|
1255
1255
|
let u;
|
|
1256
1256
|
typeof a != "object" ? u = this.options.overloadTranslationOptionHandler([n, a].concat(o)) : u = {
|
|
1257
1257
|
...a
|
|
1258
|
-
}, u.lng = u.lng ||
|
|
1258
|
+
}, u.lng = u.lng || s.lng, u.lngs = u.lngs || s.lngs, u.ns = u.ns || s.ns, u.keyPrefix !== "" && (u.keyPrefix = u.keyPrefix || i || s.keyPrefix);
|
|
1259
1259
|
const l = this.options.keySeparator || ".";
|
|
1260
1260
|
let c;
|
|
1261
1261
|
return u.keyPrefix && Array.isArray(n) ? c = n.map((f) => (typeof f == "function" && (f = ne(f, {
|
|
@@ -1266,7 +1266,7 @@ class z extends X {
|
|
|
1266
1266
|
...a
|
|
1267
1267
|
})), c = u.keyPrefix ? `${u.keyPrefix}${l}${n}` : n), this.t(c, u);
|
|
1268
1268
|
};
|
|
1269
|
-
return g(e) ?
|
|
1269
|
+
return g(e) ? s.lng = e : s.lngs = e, s.ns = t, s.keyPrefix = i, s;
|
|
1270
1270
|
}
|
|
1271
1271
|
t(...e) {
|
|
1272
1272
|
var t;
|
|
@@ -1284,8 +1284,8 @@ class z extends X {
|
|
|
1284
1284
|
return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
|
|
1285
1285
|
if (!this.languages || !this.languages.length)
|
|
1286
1286
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
1287
|
-
const
|
|
1288
|
-
if (
|
|
1287
|
+
const i = t.lng || this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, n = this.languages[this.languages.length - 1];
|
|
1288
|
+
if (i.toLowerCase() === "cimode") return !0;
|
|
1289
1289
|
const a = (o, u) => {
|
|
1290
1290
|
const l = this.services.backendConnector.state[`${o}|${u}`];
|
|
1291
1291
|
return l === -1 || l === 0 || l === 2;
|
|
@@ -1294,27 +1294,27 @@ class z extends X {
|
|
|
1294
1294
|
const o = t.precheck(this, a);
|
|
1295
1295
|
if (o !== void 0) return o;
|
|
1296
1296
|
}
|
|
1297
|
-
return !!(this.hasResourceBundle(
|
|
1297
|
+
return !!(this.hasResourceBundle(i, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(i, e) && (!s || a(n, e)));
|
|
1298
1298
|
}
|
|
1299
1299
|
loadNamespaces(e, t) {
|
|
1300
|
-
const
|
|
1301
|
-
return this.options.ns ? (g(e) && (e = [e]), e.forEach((
|
|
1302
|
-
this.options.ns.indexOf(
|
|
1303
|
-
}), this.loadResources((
|
|
1304
|
-
|
|
1305
|
-
}),
|
|
1300
|
+
const i = K();
|
|
1301
|
+
return this.options.ns ? (g(e) && (e = [e]), e.forEach((s) => {
|
|
1302
|
+
this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
|
|
1303
|
+
}), this.loadResources((s) => {
|
|
1304
|
+
i.resolve(), t && t(s);
|
|
1305
|
+
}), i) : (t && t(), Promise.resolve());
|
|
1306
1306
|
}
|
|
1307
1307
|
loadLanguages(e, t) {
|
|
1308
|
-
const
|
|
1308
|
+
const i = K();
|
|
1309
1309
|
g(e) && (e = [e]);
|
|
1310
|
-
const
|
|
1311
|
-
return n.length ? (this.options.preload =
|
|
1312
|
-
|
|
1313
|
-
}),
|
|
1310
|
+
const s = this.options.preload || [], n = e.filter((a) => s.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
|
|
1311
|
+
return n.length ? (this.options.preload = s.concat(n), this.loadResources((a) => {
|
|
1312
|
+
i.resolve(), t && t(a);
|
|
1313
|
+
}), i) : (t && t(), Promise.resolve());
|
|
1314
1314
|
}
|
|
1315
1315
|
dir(e) {
|
|
1316
|
-
var
|
|
1317
|
-
if (e || (e = this.resolvedLanguage || (((
|
|
1316
|
+
var s, n;
|
|
1317
|
+
if (e || (e = this.resolvedLanguage || (((s = this.languages) == null ? void 0 : s.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1318
1318
|
try {
|
|
1319
1319
|
const a = new Intl.Locale(e);
|
|
1320
1320
|
if (a && a.getTextInfo) {
|
|
@@ -1323,34 +1323,34 @@ class z extends X {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
} catch {
|
|
1325
1325
|
}
|
|
1326
|
-
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"],
|
|
1327
|
-
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(
|
|
1326
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], i = ((n = this.services) == null ? void 0 : n.languageUtils) || new xe(se());
|
|
1327
|
+
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(i.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1328
1328
|
}
|
|
1329
1329
|
static createInstance(e = {}, t) {
|
|
1330
|
-
const
|
|
1331
|
-
return
|
|
1330
|
+
const i = new z(e, t);
|
|
1331
|
+
return i.createInstance = z.createInstance, i;
|
|
1332
1332
|
}
|
|
1333
1333
|
cloneInstance(e = {}, t = Y) {
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1336
|
-
const
|
|
1334
|
+
const i = e.forkResourceStore;
|
|
1335
|
+
i && delete e.forkResourceStore;
|
|
1336
|
+
const s = {
|
|
1337
1337
|
...this.options,
|
|
1338
1338
|
...e,
|
|
1339
1339
|
isClone: !0
|
|
1340
|
-
}, n = new z(
|
|
1340
|
+
}, n = new z(s);
|
|
1341
1341
|
if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
1342
1342
|
n[o] = this[o];
|
|
1343
1343
|
}), n.services = {
|
|
1344
1344
|
...this.services
|
|
1345
1345
|
}, n.services.utils = {
|
|
1346
1346
|
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
1347
|
-
},
|
|
1347
|
+
}, i) {
|
|
1348
1348
|
const o = Object.keys(this.store.data).reduce((u, l) => (u[l] = {
|
|
1349
1349
|
...this.store.data[l]
|
|
1350
1350
|
}, u[l] = Object.keys(u[l]).reduce((c, f) => (c[f] = {
|
|
1351
1351
|
...u[l][f]
|
|
1352
1352
|
}, c), u[l]), u), {});
|
|
1353
|
-
n.store = new ge(o,
|
|
1353
|
+
n.store = new ge(o, s), n.services.resourceStore = n.store;
|
|
1354
1354
|
}
|
|
1355
1355
|
if (e.interpolation) {
|
|
1356
1356
|
const u = {
|
|
@@ -1358,14 +1358,14 @@ class z extends X {
|
|
|
1358
1358
|
...this.options.interpolation,
|
|
1359
1359
|
...e.interpolation
|
|
1360
1360
|
}, l = {
|
|
1361
|
-
...
|
|
1361
|
+
...s,
|
|
1362
1362
|
interpolation: u
|
|
1363
1363
|
};
|
|
1364
1364
|
n.services.interpolator = new Le(l);
|
|
1365
1365
|
}
|
|
1366
|
-
return n.translator = new q(n.services,
|
|
1366
|
+
return n.translator = new q(n.services, s), n.translator.on("*", (o, ...u) => {
|
|
1367
1367
|
n.emit(o, ...u);
|
|
1368
|
-
}), n.init(
|
|
1368
|
+
}), n.init(s, t), n.translator.options = s, n.translator.backendConnector.services.utils = {
|
|
1369
1369
|
hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
|
|
1370
1370
|
}, n;
|
|
1371
1371
|
}
|
|
@@ -1405,12 +1405,12 @@ function yt({
|
|
|
1405
1405
|
defaultNS: e,
|
|
1406
1406
|
children: t
|
|
1407
1407
|
}) {
|
|
1408
|
-
const
|
|
1408
|
+
const i = Ie(() => ({
|
|
1409
1409
|
i18n: r,
|
|
1410
1410
|
defaultNS: e
|
|
1411
1411
|
}), [r, e]);
|
|
1412
1412
|
return Ve(Be.Provider, {
|
|
1413
|
-
value:
|
|
1413
|
+
value: i
|
|
1414
1414
|
}, t);
|
|
1415
1415
|
}
|
|
1416
1416
|
const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className: V("[&_svg]:w-40", r), ...e }), bt = (r) => /* @__PURE__ */ U.createElement("svg", { height: "1em", width: "1em", fill: "currentColor", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ U.createElement("path", { d: "M1.86879 5.11875C2.52504 3.25 4.28754 2 6.26879 2H25.7813C27.7625 2 29.525 3.25 30.1813 5.11875L31.3313 8.40625C32.0188 10.375 31.3938 12.4 30.025 13.6812V25.5063C30.025 27.9937 28.0125 30.0063 25.525 30.0063H6.52504C4.03754 30.0063 2.02504 27.9937 2.02504 25.5063V13.6812C0.656291 12.4 0.0312907 10.375 0.718791 8.40625L1.86879 5.11875ZM5.02504 14.9875V20H27.025V14.9875C26.9 14.9938 26.7813 15 26.6563 15C25.2938 15 24.0438 14.4437 23.1438 13.5437C22.2313 14.4437 20.9813 15 19.5875 15C18.2 15 16.9375 14.4375 16.025 13.5312C15.1125 14.4375 13.85 15 12.4625 15C11.0688 15 9.81879 14.4437 8.90629 13.5437C8.00629 14.45 6.76254 15 5.39379 15C5.26879 15 5.14379 14.9938 5.01879 14.9875H5.02504ZM10.8813 5L10.4063 9.73125C10.2875 10.9437 11.2375 12 12.4563 12C13.5938 12 14.5188 11.075 14.5188 9.9375V5H10.875H10.8813ZM17.525 9.9375C17.525 11.075 18.45 12 19.5875 12C20.8063 12 21.7625 10.9437 21.6375 9.73125L21.1625 5H17.5188V9.9375H17.525ZM24.7063 10.2375C24.8063 11.2375 25.65 12 26.65 12C28 12 28.9438 10.6687 28.4938 9.4L27.35 6.1125C27.1188 5.44375 26.4875 5 25.7813 5H24.1813L24.7063 10.2375ZM5.40004 12C6.40629 12 7.24379 11.2375 7.34379 10.2375L7.86879 5H6.26879C5.56254 5 4.93754 5.44375 4.70004 6.1125L3.55004 9.4C3.10629 10.675 4.05004 12 5.39379 12H5.40004ZM5.02504 25.5C5.02504 26.3312 5.69379 27 6.52504 27H25.525C26.3563 27 27.025 26.3312 27.025 25.5V23H5.02504V25.5Z" })), Lt = (r) => /* @__PURE__ */ U.createElement("svg", { height: "1em", width: "1em", fill: "currentColor", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ U.createElement("path", { d: "M14.7688 8.45C15.5563 7.80625 16.7125 7.85625 17.4438 8.5875L25.4438 16.5875C26.0188 17.1625 26.1875 18.0188 25.875 18.7688C25.5625 19.5188 24.8375 20 24.0313 20H8.03127C7.22502 20 6.49377 19.5125 6.18127 18.7625C5.86877 18.0125 6.04377 17.1563 6.61877 16.5875L14.6188 8.5875L14.7688 8.45Z" })), { Text: ve } = Re, Ot = ({ className: r, children: e }) => {
|
|
@@ -1422,8 +1422,8 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1422
1422
|
] }),
|
|
1423
1423
|
/* @__PURE__ */ x.jsx(ve, { className: "text-grays-macropay-05", size: "sm", weight: "semibold", children: e })
|
|
1424
1424
|
] });
|
|
1425
|
-
}, { Text: Ne } = Re, Ct = ({ name: r, role: e, imageUrl: t, items:
|
|
1426
|
-
const { md:
|
|
1425
|
+
}, { Text: Ne } = Re, Ct = ({ name: r, role: e, imageUrl: t, items: i = [] }) => {
|
|
1426
|
+
const { md: s } = Ze();
|
|
1427
1427
|
if (!r || r.trim() === "")
|
|
1428
1428
|
return null;
|
|
1429
1429
|
const n = /* @__PURE__ */ x.jsxs(B, { gap: 1, direction: "vertical", children: [
|
|
@@ -1432,7 +1432,7 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1432
1432
|
] });
|
|
1433
1433
|
return /* @__PURE__ */ x.jsxs(B, { align: "center", gap: 2, children: [
|
|
1434
1434
|
/* @__PURE__ */ x.jsx(He, { src: t, alt: r, size: "sm" }),
|
|
1435
|
-
|
|
1435
|
+
s && n,
|
|
1436
1436
|
/* @__PURE__ */ x.jsx(
|
|
1437
1437
|
Ke,
|
|
1438
1438
|
{
|
|
@@ -1441,10 +1441,10 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1441
1441
|
content: "z-10 shadow-sm"
|
|
1442
1442
|
},
|
|
1443
1443
|
trigger: /* @__PURE__ */ x.jsx(Lt, { className: "rotate-180" }),
|
|
1444
|
-
items:
|
|
1444
|
+
items: s ? i : [
|
|
1445
1445
|
{ label: n, id: "user-name", type: "label" },
|
|
1446
1446
|
{ id: "separator-1", type: "separator" },
|
|
1447
|
-
...
|
|
1447
|
+
...i
|
|
1448
1448
|
]
|
|
1449
1449
|
}
|
|
1450
1450
|
)
|
|
@@ -1452,10 +1452,10 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1452
1452
|
}, Ee = ({ className: r, children: e }) => {
|
|
1453
1453
|
if (Array.isArray(e) && e.length === 0)
|
|
1454
1454
|
return null;
|
|
1455
|
-
const t = (s) => s ===
|
|
1456
|
-
return /* @__PURE__ */ x.jsx(B, { align: "center", gap: 4, className: V(r), children:
|
|
1455
|
+
const t = e.filter((s) => s !== null), i = (s) => s === t.length - 1;
|
|
1456
|
+
return /* @__PURE__ */ x.jsx(B, { align: "center", gap: 4, className: V(r), children: t.map((s, n) => /* @__PURE__ */ x.jsxs(De, { children: [
|
|
1457
1457
|
s,
|
|
1458
|
-
|
|
1458
|
+
i(n) ? null : /* @__PURE__ */ x.jsx(
|
|
1459
1459
|
Ge,
|
|
1460
1460
|
{
|
|
1461
1461
|
"data-slot": "separator",
|
|
@@ -1466,7 +1466,7 @@ const St = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx("div", { className:
|
|
|
1466
1466
|
)
|
|
1467
1467
|
}
|
|
1468
1468
|
)
|
|
1469
|
-
] },
|
|
1469
|
+
] }, n)) });
|
|
1470
1470
|
};
|
|
1471
1471
|
Ee.disPlayName = "Layout.Header.RightSide";
|
|
1472
1472
|
const Z = ({ className: r, ...e }) => /* @__PURE__ */ x.jsx(
|
|
@@ -1491,7 +1491,7 @@ const wt = ({
|
|
|
1491
1491
|
"div",
|
|
1492
1492
|
{
|
|
1493
1493
|
className: V(
|
|
1494
|
-
"flex w-full flex-1 flex-col px-4 pt-5 [&>div]:flex [&>div]:items-start [&>div]:justify-center [&>div>div]:w-full [&>div>div]:max-w-243",
|
|
1494
|
+
"flex w-full flex-1 flex-col px-0 md:px-4 pt-5 [&>div]:flex [&>div]:items-start [&>div]:justify-center [&>div>div]:w-full [&>div>div]:max-w-243",
|
|
1495
1495
|
r
|
|
1496
1496
|
),
|
|
1497
1497
|
...t,
|