@snmt-react-ui/user-select 2.7.21 → 2.7.22
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/user-select.js +611 -605
- package/package.json +4 -4
package/dist/user-select.js
CHANGED
|
@@ -20,7 +20,7 @@ function V1() {
|
|
|
20
20
|
e[t] = arguments[t];
|
|
21
21
|
s1(e[0]) && j1[e[0]] || (s1(e[0]) && (j1[e[0]] = /* @__PURE__ */ new Date()), Ve(...e));
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const ce = (i, e) => () => {
|
|
24
24
|
if (i.isInitialized)
|
|
25
25
|
e();
|
|
26
26
|
else {
|
|
@@ -32,20 +32,20 @@ const he = (i, e) => () => {
|
|
|
32
32
|
i.on("initialized", t);
|
|
33
33
|
}
|
|
34
34
|
}, W1 = (i, e, t) => {
|
|
35
|
-
i.loadNamespaces(e,
|
|
35
|
+
i.loadNamespaces(e, ce(i, t));
|
|
36
36
|
}, G1 = (i, e, t, s) => {
|
|
37
37
|
s1(t) && (t = [t]), t.forEach((n) => {
|
|
38
38
|
i.options.ns.indexOf(n) < 0 && i.options.ns.push(n);
|
|
39
|
-
}), i.loadLanguages(e,
|
|
39
|
+
}), i.loadLanguages(e, ce(i, s));
|
|
40
40
|
}, Ae = function(i, e) {
|
|
41
41
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
42
42
|
const s = e.languages[0], n = e.options ? e.options.fallbackLng : !1, a = e.languages[e.languages.length - 1];
|
|
43
43
|
if (s.toLowerCase() === "cimode") return !0;
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return
|
|
44
|
+
const h = (o, g) => {
|
|
45
|
+
const d = e.services.backendConnector.state[`${o}|${g}`];
|
|
46
|
+
return d === -1 || d === 2;
|
|
47
47
|
};
|
|
48
|
-
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !
|
|
48
|
+
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !h(e.isLanguageChangingTo, i) ? !1 : !!(e.hasResourceBundle(s, i) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || h(s, i) && (!n || h(a, i)));
|
|
49
49
|
}, Te = function(i, e) {
|
|
50
50
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
51
51
|
return !e.languages || !e.languages.length ? (V1("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(i, {
|
|
@@ -104,7 +104,7 @@ const Ue = (i, e) => {
|
|
|
104
104
|
return j(() => {
|
|
105
105
|
t.current = i;
|
|
106
106
|
}, [i, e]), t.current;
|
|
107
|
-
},
|
|
107
|
+
}, he = (i, e, t, s) => i.getFixedT(e, t, s), ze = (i, e, t, s) => $(he(i, e, t, s), [i, e, t, s]), Je = function(i) {
|
|
108
108
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
109
109
|
const {
|
|
110
110
|
i18n: t
|
|
@@ -114,47 +114,47 @@ const Ue = (i, e) => {
|
|
|
114
114
|
} = r1(Fe) || {}, a = t || s || Pe();
|
|
115
115
|
if (a && !a.reportNamespaces && (a.reportNamespaces = new Ye()), !a) {
|
|
116
116
|
V1("You will need to pass in an i18next instance by using initReactI18next");
|
|
117
|
-
const f = (
|
|
118
|
-
return
|
|
117
|
+
const f = (R, v) => s1(v) ? v : Ze(v) && s1(v.defaultValue) ? v.defaultValue : Array.isArray(R) ? R[R.length - 1] : R, x = [f, {}, !1];
|
|
118
|
+
return x.t = f, x.i18n = {}, x.ready = !1, x;
|
|
119
119
|
}
|
|
120
120
|
a.options.react && a.options.react.wait !== void 0 && V1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
121
|
-
const
|
|
121
|
+
const h = {
|
|
122
122
|
...Ke(),
|
|
123
123
|
...a.options.react,
|
|
124
124
|
...e
|
|
125
125
|
}, {
|
|
126
126
|
useSuspense: o,
|
|
127
|
-
keyPrefix:
|
|
128
|
-
} =
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
const l = (a.isInitialized || a.initializedStoreOnce) &&
|
|
132
|
-
let m =
|
|
127
|
+
keyPrefix: g
|
|
128
|
+
} = h;
|
|
129
|
+
let d = i;
|
|
130
|
+
d = s1(d) ? [d] : d || ["translation"], a.reportNamespaces.addUsedNamespaces && a.reportNamespaces.addUsedNamespaces(d);
|
|
131
|
+
const l = (a.isInitialized || a.initializedStoreOnce) && d.every((f) => Te(f, a, h)), c = ze(a, e.lng || null, h.nsMode === "fallback" ? d : d[0], g), u = () => c, p = () => he(a, e.lng || null, h.nsMode === "fallback" ? d : d[0], g), [w, k] = T(u);
|
|
132
|
+
let m = d.join();
|
|
133
133
|
e.lng && (m = `${e.lng}${m}`);
|
|
134
|
-
const _ = Ue(m),
|
|
134
|
+
const _ = Ue(m), N = q(!0);
|
|
135
135
|
j(() => {
|
|
136
136
|
const {
|
|
137
137
|
bindI18n: f,
|
|
138
|
-
bindI18nStore:
|
|
139
|
-
} =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}) : W1(a,
|
|
143
|
-
|
|
144
|
-
})), l && _ && _ !== m &&
|
|
145
|
-
const
|
|
146
|
-
|
|
138
|
+
bindI18nStore: x
|
|
139
|
+
} = h;
|
|
140
|
+
N.current = !0, !l && !o && (e.lng ? G1(a, e.lng, d, () => {
|
|
141
|
+
N.current && k(p);
|
|
142
|
+
}) : W1(a, d, () => {
|
|
143
|
+
N.current && k(p);
|
|
144
|
+
})), l && _ && _ !== m && N.current && k(p);
|
|
145
|
+
const R = () => {
|
|
146
|
+
N.current && k(p);
|
|
147
147
|
};
|
|
148
|
-
return f && a && a.on(f,
|
|
149
|
-
|
|
148
|
+
return f && a && a.on(f, R), x && a && a.store.on(x, R), () => {
|
|
149
|
+
N.current = !1, f && a && f.split(" ").forEach((v) => a.off(v, R)), x && a && x.split(" ").forEach((v) => a.store.off(v, R));
|
|
150
150
|
};
|
|
151
151
|
}, [a, m]), j(() => {
|
|
152
|
-
|
|
153
|
-
}, [a,
|
|
152
|
+
N.current && l && k(u);
|
|
153
|
+
}, [a, g, l]);
|
|
154
154
|
const S = [w, a, l];
|
|
155
155
|
if (S.t = w, S.i18n = a, S.ready = l, l || !l && !o) return S;
|
|
156
156
|
throw new Promise((f) => {
|
|
157
|
-
e.lng ? G1(a, e.lng,
|
|
157
|
+
e.lng ? G1(a, e.lng, d, () => f()) : W1(a, d, () => f());
|
|
158
158
|
});
|
|
159
159
|
}, p1 = ({
|
|
160
160
|
children: i,
|
|
@@ -163,7 +163,7 @@ const Ue = (i, e) => {
|
|
|
163
163
|
alignItems: s = "normal",
|
|
164
164
|
justifyContent: n = "normal",
|
|
165
165
|
flex: a,
|
|
166
|
-
gap:
|
|
166
|
+
gap: h,
|
|
167
167
|
padding: o
|
|
168
168
|
}) => /* @__PURE__ */ r(
|
|
169
169
|
Re,
|
|
@@ -174,7 +174,7 @@ const Ue = (i, e) => {
|
|
|
174
174
|
align: s,
|
|
175
175
|
justify: n,
|
|
176
176
|
flex: a,
|
|
177
|
-
gap:
|
|
177
|
+
gap: h,
|
|
178
178
|
style: { padding: o },
|
|
179
179
|
children: i
|
|
180
180
|
}
|
|
@@ -206,19 +206,19 @@ const Qe = ({
|
|
|
206
206
|
disabled: n = !1,
|
|
207
207
|
disableUncheck: a = !1
|
|
208
208
|
}) => {
|
|
209
|
-
const [
|
|
209
|
+
const [h, o] = T(i), [g, d] = T(e);
|
|
210
210
|
j(() => {
|
|
211
|
-
o(i),
|
|
211
|
+
o(i), d(e);
|
|
212
212
|
}, [i, e]);
|
|
213
213
|
const { theme: l } = r1(D1);
|
|
214
214
|
return /* @__PURE__ */ r(
|
|
215
215
|
be,
|
|
216
216
|
{
|
|
217
217
|
className: `snmt-checkbox snmt-checkbox-${l}`,
|
|
218
|
-
checked:
|
|
219
|
-
indeterminate:
|
|
220
|
-
onChange: (
|
|
221
|
-
a &&
|
|
218
|
+
checked: h,
|
|
219
|
+
indeterminate: g,
|
|
220
|
+
onChange: (c) => {
|
|
221
|
+
a && h || (d(!1), o(c.target.checked), s && s(c));
|
|
222
222
|
},
|
|
223
223
|
disabled: n,
|
|
224
224
|
children: t
|
|
@@ -593,7 +593,7 @@ const Xe = ({
|
|
|
593
593
|
)
|
|
594
594
|
] })
|
|
595
595
|
}
|
|
596
|
-
),
|
|
596
|
+
), ct = ({
|
|
597
597
|
width: i = 20,
|
|
598
598
|
height: e = 20,
|
|
599
599
|
color: t = y.GREY_DARK_5,
|
|
@@ -633,7 +633,7 @@ const Xe = ({
|
|
|
633
633
|
)
|
|
634
634
|
]
|
|
635
635
|
}
|
|
636
|
-
),
|
|
636
|
+
), ht = ({
|
|
637
637
|
width: i = 20,
|
|
638
638
|
height: e = 20,
|
|
639
639
|
color: t = "#001E52",
|
|
@@ -2577,7 +2577,7 @@ const Xe = ({
|
|
|
2577
2577
|
}
|
|
2578
2578
|
)
|
|
2579
2579
|
}
|
|
2580
|
-
),
|
|
2580
|
+
), c2 = ({
|
|
2581
2581
|
width: i = 24,
|
|
2582
2582
|
height: e = 24,
|
|
2583
2583
|
color: t = y.GREY_DARK_2,
|
|
@@ -2617,7 +2617,7 @@ const Xe = ({
|
|
|
2617
2617
|
)
|
|
2618
2618
|
]
|
|
2619
2619
|
}
|
|
2620
|
-
),
|
|
2620
|
+
), h2 = ({
|
|
2621
2621
|
width: i = 24,
|
|
2622
2622
|
height: e = 24,
|
|
2623
2623
|
color: t = y.GREY_DARK_2,
|
|
@@ -2704,98 +2704,98 @@ const Xe = ({
|
|
|
2704
2704
|
color: s,
|
|
2705
2705
|
className: n,
|
|
2706
2706
|
disabled: a = !1,
|
|
2707
|
-
onClick:
|
|
2707
|
+
onClick: h
|
|
2708
2708
|
}) => {
|
|
2709
|
-
const [o,
|
|
2709
|
+
const [o, g] = T(n), { theme: d } = r1(de), l = a ? d && d === "dark" ? y.GREY_LIGHT_4 : y.GREY_DARK_1 : s, c = a ? void 0 : h;
|
|
2710
2710
|
return j(() => {
|
|
2711
2711
|
if (n) {
|
|
2712
|
-
|
|
2712
|
+
c && !a && g(`${n} clickable`);
|
|
2713
2713
|
return;
|
|
2714
2714
|
}
|
|
2715
|
-
|
|
2716
|
-
}, [
|
|
2715
|
+
c && !a && g("clickable");
|
|
2716
|
+
}, [c, n, a]), /* @__PURE__ */ r(i1, { children: (() => {
|
|
2717
2717
|
switch (i) {
|
|
2718
2718
|
case "nextIcon":
|
|
2719
|
-
return St({ width: e, height: t, color: l, className: o, onClick:
|
|
2719
|
+
return St({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2720
2720
|
case "prevIcon":
|
|
2721
|
-
return Vt({ width: e, height: t, color: l, className: o, onClick:
|
|
2721
|
+
return Vt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2722
2722
|
case "arrowDown":
|
|
2723
|
-
return Xe({ width: e, height: t, color: l, className: o, onClick:
|
|
2723
|
+
return Xe({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2724
2724
|
case "info":
|
|
2725
|
-
return et({ width: e, height: t, color: l, className: o, onClick:
|
|
2725
|
+
return et({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2726
2726
|
case "arrowRight":
|
|
2727
|
-
return tt({ width: e, height: t, color: l, className: o, onClick:
|
|
2727
|
+
return tt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2728
2728
|
case "calendar":
|
|
2729
|
-
return it({ width: e, height: t, color: l, className: o, onClick:
|
|
2729
|
+
return it({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2730
2730
|
case "ok":
|
|
2731
|
-
return st({ width: e, height: t, color: l, className: o, onClick:
|
|
2731
|
+
return st({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2732
2732
|
case "cancel":
|
|
2733
|
-
return nt({ width: e, height: t, color: l, className: o, onClick:
|
|
2733
|
+
return nt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2734
2734
|
case "add":
|
|
2735
|
-
return rt({ width: e, height: t, color: l, className: o, onClick:
|
|
2735
|
+
return rt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2736
2736
|
case "list":
|
|
2737
|
-
return ot({ width: e, height: t, color: l, className: o, onClick:
|
|
2737
|
+
return ot({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2738
2738
|
case "dragAndDrop":
|
|
2739
|
-
return at({ width: e, height: t, color: l, className: o, onClick:
|
|
2739
|
+
return at({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2740
2740
|
case "filter":
|
|
2741
|
-
return lt({ width: e, height: t, color: l, className: o, onClick:
|
|
2741
|
+
return lt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2742
2742
|
case "attention":
|
|
2743
|
-
return
|
|
2743
|
+
return ct({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2744
2744
|
case "users":
|
|
2745
|
-
return
|
|
2745
|
+
return ht({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2746
2746
|
case "mySkillsMatrix":
|
|
2747
2747
|
return dt({
|
|
2748
2748
|
width: e,
|
|
2749
2749
|
height: t,
|
|
2750
2750
|
color: l,
|
|
2751
2751
|
className: o,
|
|
2752
|
-
onClick:
|
|
2752
|
+
onClick: c
|
|
2753
2753
|
});
|
|
2754
2754
|
case "skills":
|
|
2755
|
-
return gt({ width: e, height: t, color: l, className: o, onClick:
|
|
2755
|
+
return gt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2756
2756
|
case "skillsMatrices":
|
|
2757
2757
|
return ut({
|
|
2758
2758
|
width: e,
|
|
2759
2759
|
height: t,
|
|
2760
2760
|
color: l,
|
|
2761
2761
|
className: o,
|
|
2762
|
-
onClick:
|
|
2762
|
+
onClick: c
|
|
2763
2763
|
});
|
|
2764
2764
|
case "history":
|
|
2765
|
-
return Ct({ width: e, height: t, color: l, className: o, onClick:
|
|
2765
|
+
return Ct({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2766
2766
|
case "logOut":
|
|
2767
|
-
return pt({ width: e, height: t, color: l, className: o, onClick:
|
|
2767
|
+
return pt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2768
2768
|
case "settings":
|
|
2769
|
-
return ft({ width: e, height: t, color: l, className: o, onClick:
|
|
2769
|
+
return ft({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2770
2770
|
case "trash":
|
|
2771
|
-
return mt({ width: e, height: t, color: l, className: o, onClick:
|
|
2771
|
+
return mt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2772
2772
|
case "settings4":
|
|
2773
|
-
return wt({ width: e, height: t, color: l, className: o, onClick:
|
|
2773
|
+
return wt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2774
2774
|
case "success":
|
|
2775
|
-
return kt({ width: e, height: t, color: l, className: o, onClick:
|
|
2775
|
+
return kt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2776
2776
|
case "checkCircle":
|
|
2777
|
-
return Lt({ width: e, height: t, color: l, className: o, onClick:
|
|
2777
|
+
return Lt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2778
2778
|
case "errorSmall":
|
|
2779
|
-
return vt({ width: e, height: t, color: l, className: o, onClick:
|
|
2779
|
+
return vt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2780
2780
|
case "infoMedium":
|
|
2781
|
-
return Nt({ width: e, height: t, color: l, className: o, onClick:
|
|
2781
|
+
return Nt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2782
2782
|
case "attentionMedium":
|
|
2783
2783
|
return xt({
|
|
2784
2784
|
width: e,
|
|
2785
2785
|
height: t,
|
|
2786
2786
|
color: l,
|
|
2787
2787
|
className: o,
|
|
2788
|
-
onClick:
|
|
2788
|
+
onClick: c
|
|
2789
2789
|
});
|
|
2790
2790
|
case "errorMedium":
|
|
2791
|
-
return Rt({ width: e, height: t, color: l, className: o, onClick:
|
|
2791
|
+
return Rt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2792
2792
|
case "visibilityIcon":
|
|
2793
2793
|
return Mt({
|
|
2794
2794
|
width: e,
|
|
2795
2795
|
height: t,
|
|
2796
2796
|
color: l,
|
|
2797
2797
|
className: o,
|
|
2798
|
-
onClick:
|
|
2798
|
+
onClick: c
|
|
2799
2799
|
});
|
|
2800
2800
|
case "visibilityOffIcon":
|
|
2801
2801
|
return bt({
|
|
@@ -2803,7 +2803,7 @@ const Xe = ({
|
|
|
2803
2803
|
height: t,
|
|
2804
2804
|
color: l,
|
|
2805
2805
|
className: o,
|
|
2806
|
-
onClick:
|
|
2806
|
+
onClick: c
|
|
2807
2807
|
});
|
|
2808
2808
|
case "selectArrowIcon":
|
|
2809
2809
|
return yt({
|
|
@@ -2811,7 +2811,7 @@ const Xe = ({
|
|
|
2811
2811
|
height: t,
|
|
2812
2812
|
color: l,
|
|
2813
2813
|
className: o,
|
|
2814
|
-
onClick:
|
|
2814
|
+
onClick: c
|
|
2815
2815
|
});
|
|
2816
2816
|
case "expandArrowIcon":
|
|
2817
2817
|
return Et({
|
|
@@ -2819,7 +2819,7 @@ const Xe = ({
|
|
|
2819
2819
|
height: t,
|
|
2820
2820
|
color: l,
|
|
2821
2821
|
className: o,
|
|
2822
|
-
onClick:
|
|
2822
|
+
onClick: c
|
|
2823
2823
|
});
|
|
2824
2824
|
case "expandActiveArrowIcon":
|
|
2825
2825
|
return _t({
|
|
@@ -2827,78 +2827,78 @@ const Xe = ({
|
|
|
2827
2827
|
height: t,
|
|
2828
2828
|
color: l,
|
|
2829
2829
|
className: o,
|
|
2830
|
-
onClick:
|
|
2830
|
+
onClick: c
|
|
2831
2831
|
});
|
|
2832
2832
|
case "sortUp":
|
|
2833
|
-
return Ht({ width: e, height: t, color: l, className: o, onClick:
|
|
2833
|
+
return Ht({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2834
2834
|
case "sortDown":
|
|
2835
|
-
return It({ width: e, height: t, color: l, className: o, onClick:
|
|
2835
|
+
return It({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2836
2836
|
case "search":
|
|
2837
|
-
return Ot({ width: e, height: t, color: l, className: o, onClick:
|
|
2837
|
+
return Ot({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2838
2838
|
case "arrowUpFilled":
|
|
2839
|
-
return Tt({ width: e, height: t, color: l, className: o, onClick:
|
|
2839
|
+
return Tt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2840
2840
|
case "arrowDownFilled":
|
|
2841
|
-
return At({ width: e, height: t, color: l, className: o, onClick:
|
|
2841
|
+
return At({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2842
2842
|
case "link":
|
|
2843
|
-
return Zt({ width: e, height: t, color: l, className: o, onClick:
|
|
2843
|
+
return Zt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2844
2844
|
case "telegram":
|
|
2845
|
-
return Bt({ width: e, height: t, color: l, className: o, onClick:
|
|
2845
|
+
return Bt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2846
2846
|
case "mail":
|
|
2847
|
-
return Wt({ width: e, height: t, color: l, className: o, onClick:
|
|
2847
|
+
return Wt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2848
2848
|
case "github":
|
|
2849
|
-
return Dt({ width: e, height: t, color: l, className: o, onClick:
|
|
2849
|
+
return Dt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2850
2850
|
case "linkedIn":
|
|
2851
|
-
return jt({ width: e, height: t, color: l, className: o, onClick:
|
|
2851
|
+
return jt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2852
2852
|
case "emptyStateIcon":
|
|
2853
|
-
return Gt({ width: e, height: t, color: l, className: o, onClick:
|
|
2853
|
+
return Gt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2854
2854
|
case "filtersIcon":
|
|
2855
|
-
return Kt({ width: e, height: t, color: l, className: o, onClick:
|
|
2855
|
+
return Kt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2856
2856
|
case "dotMenuIcon":
|
|
2857
|
-
return $t({ width: e, height: t, color: l, className: o, onClick:
|
|
2857
|
+
return $t({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2858
2858
|
case "plusCircle":
|
|
2859
|
-
return Pt({ width: e, height: t, color: l, className: o, onClick:
|
|
2859
|
+
return Pt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2860
2860
|
case "warning":
|
|
2861
|
-
return Ft({ width: e, height: t, color: l, className: o, onClick:
|
|
2861
|
+
return Ft({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2862
2862
|
case "back":
|
|
2863
|
-
return Yt({ width: e, height: t, color: l, className: o, onClick:
|
|
2863
|
+
return Yt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2864
2864
|
case "bell":
|
|
2865
|
-
return Ut({ width: e, height: t, color: l, className: o, onClick:
|
|
2865
|
+
return Ut({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2866
2866
|
case "contract":
|
|
2867
|
-
return Jt({ width: e, height: t, color: l, className: o, onClick:
|
|
2867
|
+
return Jt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2868
2868
|
case "trash2":
|
|
2869
|
-
return zt({ width: e, height: t, color: l, className: o, onClick:
|
|
2869
|
+
return zt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2870
2870
|
case "resourceManager":
|
|
2871
|
-
return qt({ width: e, height: t, color: l, className: o, onClick:
|
|
2871
|
+
return qt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2872
2872
|
case "settings2":
|
|
2873
|
-
return Qt({ width: e, height: t, color: l, className: o, onClick:
|
|
2873
|
+
return Qt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2874
2874
|
case "image":
|
|
2875
|
-
return Xt({ width: e, height: t, color: l, className: o, onClick:
|
|
2875
|
+
return Xt({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2876
2876
|
case "edit":
|
|
2877
|
-
return e2({ width: e, height: t, color: l, className: o, onClick:
|
|
2877
|
+
return e2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2878
2878
|
case "filledArrowRight":
|
|
2879
|
-
return t2({ width: e, height: t, color: l, className: o, onClick:
|
|
2879
|
+
return t2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2880
2880
|
case "burgerMenu":
|
|
2881
|
-
return i2({ width: e, height: t, color: l, className: o, onClick:
|
|
2881
|
+
return i2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2882
2882
|
case "signOut":
|
|
2883
|
-
return s2({ width: e, height: t, color: l, className: o, onClick:
|
|
2883
|
+
return s2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2884
2884
|
case "refresh":
|
|
2885
|
-
return n2({ width: e, height: t, color: l, className: o, onClick:
|
|
2885
|
+
return n2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2886
2886
|
case "projects":
|
|
2887
|
-
return r2({ width: e, height: t, color: l, className: o, onClick:
|
|
2887
|
+
return r2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2888
2888
|
case "profile":
|
|
2889
|
-
return g2({ width: e, height: t, color: l, className: o, onClick:
|
|
2889
|
+
return g2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2890
2890
|
case "exit":
|
|
2891
|
-
return o2({ width: e, height: t, color: l, className: o, onClick:
|
|
2891
|
+
return o2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2892
2892
|
case "client":
|
|
2893
|
-
return a2({ width: e, height: t, color: l, className: o, onClick:
|
|
2893
|
+
return a2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2894
2894
|
case "calendar2":
|
|
2895
|
-
return l2({ width: e, height: t, color: l, className: o, onClick:
|
|
2895
|
+
return l2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2896
2896
|
case "openPointCircle":
|
|
2897
|
-
return
|
|
2897
|
+
return c2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2898
2898
|
case "community":
|
|
2899
|
-
return
|
|
2899
|
+
return h2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2900
2900
|
case "docs":
|
|
2901
|
-
return d2({ width: e, height: t, color: l, className: o, onClick:
|
|
2901
|
+
return d2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
2902
2902
|
default:
|
|
2903
2903
|
return /* @__PURE__ */ r(i1, { children: "No Icon provided" });
|
|
2904
2904
|
}
|
|
@@ -2926,30 +2926,33 @@ const Xe = ({
|
|
|
2926
2926
|
children: s,
|
|
2927
2927
|
onClick: n,
|
|
2928
2928
|
collapsed: a,
|
|
2929
|
-
whiteSpace:
|
|
2929
|
+
whiteSpace: h = "normal",
|
|
2930
2930
|
/** This prop allows you to enable tooltip if text size is too big */
|
|
2931
2931
|
trim: o = !1
|
|
2932
|
-
},
|
|
2933
|
-
const
|
|
2934
|
-
_1(
|
|
2935
|
-
const [l,
|
|
2932
|
+
}, g) => {
|
|
2933
|
+
const d = q(null);
|
|
2934
|
+
_1(g, () => d.current);
|
|
2935
|
+
const [l, c] = T(!1);
|
|
2936
2936
|
j(() => {
|
|
2937
|
+
var m;
|
|
2937
2938
|
if (!o) return;
|
|
2938
|
-
const
|
|
2939
|
-
|
|
2940
|
-
}, _ = new ResizeObserver(m);
|
|
2941
|
-
return g.current && _.observe(g.current), () => {
|
|
2942
|
-
_.disconnect();
|
|
2939
|
+
const _ = () => {
|
|
2940
|
+
d.current && c(d.current.scrollWidth > d.current.clientWidth);
|
|
2943
2941
|
};
|
|
2944
|
-
|
|
2942
|
+
_();
|
|
2943
|
+
const N = new ResizeObserver(_);
|
|
2944
|
+
return d.current && N.observe(d.current), (m = d.current) != null && m.parentElement && N.observe(d.current.parentElement), () => {
|
|
2945
|
+
N.disconnect();
|
|
2946
|
+
};
|
|
2947
|
+
}, [o]);
|
|
2945
2948
|
const u = e === "h1" || e === "h2" || e === "h3" || e === "h4";
|
|
2946
2949
|
let p = `snmt-typography snmt-typography-${e}`;
|
|
2947
2950
|
i && i !== "inherit" && (p += ` snmt-typography-align-${i}`), a && (p += " collapsed"), o && (p += " collapsed");
|
|
2948
2951
|
const w = {
|
|
2949
2952
|
className: p,
|
|
2950
|
-
style: { color: t, whiteSpace: o ? "nowrap" :
|
|
2953
|
+
style: { color: t, whiteSpace: o ? "nowrap" : h, display: o ? "block" : "" },
|
|
2951
2954
|
onClick: n,
|
|
2952
|
-
ref:
|
|
2955
|
+
ref: d
|
|
2953
2956
|
}, k = u ? /* @__PURE__ */ r(C2, { level: f2[e], ...w, children: s }) : /* @__PURE__ */ r(p2, { ...w, children: s });
|
|
2954
2957
|
return o && l ? /* @__PURE__ */ r(u2, { placement: "top", title: s, children: k }) : k;
|
|
2955
2958
|
}
|
|
@@ -4557,7 +4560,7 @@ const w2 = ({
|
|
|
4557
4560
|
}
|
|
4558
4561
|
)
|
|
4559
4562
|
}
|
|
4560
|
-
),
|
|
4563
|
+
), c5 = ({
|
|
4561
4564
|
className: i,
|
|
4562
4565
|
color: e = E.GREY_DARK_5,
|
|
4563
4566
|
height: t = 24,
|
|
@@ -4609,7 +4612,7 @@ const w2 = ({
|
|
|
4609
4612
|
)
|
|
4610
4613
|
]
|
|
4611
4614
|
}
|
|
4612
|
-
),
|
|
4615
|
+
), h5 = ({
|
|
4613
4616
|
className: i,
|
|
4614
4617
|
color: e = E.GREY_DARK_5,
|
|
4615
4618
|
height: t = 24,
|
|
@@ -5433,98 +5436,98 @@ const w2 = ({
|
|
|
5433
5436
|
color: s,
|
|
5434
5437
|
className: n,
|
|
5435
5438
|
disabled: a = !1,
|
|
5436
|
-
onClick:
|
|
5439
|
+
onClick: h
|
|
5437
5440
|
}) => {
|
|
5438
|
-
const [o,
|
|
5441
|
+
const [o, g] = T(n), { theme: d } = r1(ge), l = a ? d && d === "dark" ? E.GREY_LIGHT_4 : E.GREY_DARK_1 : s, c = a ? void 0 : h;
|
|
5439
5442
|
return j(() => {
|
|
5440
5443
|
if (n) {
|
|
5441
|
-
|
|
5444
|
+
c && !a && g(`${n} clickable`);
|
|
5442
5445
|
return;
|
|
5443
5446
|
}
|
|
5444
|
-
|
|
5445
|
-
}, [
|
|
5447
|
+
c && !a && g("clickable");
|
|
5448
|
+
}, [c, n, a]), /* @__PURE__ */ r(i1, { children: (() => {
|
|
5446
5449
|
switch (i) {
|
|
5447
5450
|
case "nextIcon":
|
|
5448
|
-
return Q2({ width: e, height: t, color: l, className: o, onClick:
|
|
5451
|
+
return Q2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5449
5452
|
case "prevIcon":
|
|
5450
|
-
return X2({ width: e, height: t, color: l, className: o, onClick:
|
|
5453
|
+
return X2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5451
5454
|
case "arrowDown":
|
|
5452
|
-
return w2({ width: e, height: t, color: l, className: o, onClick:
|
|
5455
|
+
return w2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5453
5456
|
case "info":
|
|
5454
|
-
return k2({ width: e, height: t, color: l, className: o, onClick:
|
|
5457
|
+
return k2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5455
5458
|
case "arrowRight":
|
|
5456
|
-
return L2({ width: e, height: t, color: l, className: o, onClick:
|
|
5459
|
+
return L2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5457
5460
|
case "calendar":
|
|
5458
|
-
return v2({ width: e, height: t, color: l, className: o, onClick:
|
|
5461
|
+
return v2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5459
5462
|
case "ok":
|
|
5460
|
-
return N2({ width: e, height: t, color: l, className: o, onClick:
|
|
5463
|
+
return N2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5461
5464
|
case "cancel":
|
|
5462
|
-
return x2({ width: e, height: t, color: l, className: o, onClick:
|
|
5465
|
+
return x2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5463
5466
|
case "add":
|
|
5464
|
-
return R2({ width: e, height: t, color: l, className: o, onClick:
|
|
5467
|
+
return R2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5465
5468
|
case "list":
|
|
5466
|
-
return M2({ width: e, height: t, color: l, className: o, onClick:
|
|
5469
|
+
return M2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5467
5470
|
case "dragAndDrop":
|
|
5468
|
-
return b2({ width: e, height: t, color: l, className: o, onClick:
|
|
5471
|
+
return b2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5469
5472
|
case "filter":
|
|
5470
|
-
return y2({ width: e, height: t, color: l, className: o, onClick:
|
|
5473
|
+
return y2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5471
5474
|
case "attention":
|
|
5472
|
-
return E2({ width: e, height: t, color: l, className: o, onClick:
|
|
5475
|
+
return E2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5473
5476
|
case "users":
|
|
5474
|
-
return _2({ width: e, height: t, color: l, className: o, onClick:
|
|
5477
|
+
return _2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5475
5478
|
case "mySkillsMatrix":
|
|
5476
5479
|
return H2({
|
|
5477
5480
|
width: e,
|
|
5478
5481
|
height: t,
|
|
5479
5482
|
color: l,
|
|
5480
5483
|
className: o,
|
|
5481
|
-
onClick:
|
|
5484
|
+
onClick: c
|
|
5482
5485
|
});
|
|
5483
5486
|
case "skills":
|
|
5484
|
-
return I2({ width: e, height: t, color: l, className: o, onClick:
|
|
5487
|
+
return I2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5485
5488
|
case "skillsMatrices":
|
|
5486
5489
|
return O2({
|
|
5487
5490
|
width: e,
|
|
5488
5491
|
height: t,
|
|
5489
5492
|
color: l,
|
|
5490
5493
|
className: o,
|
|
5491
|
-
onClick:
|
|
5494
|
+
onClick: c
|
|
5492
5495
|
});
|
|
5493
5496
|
case "history":
|
|
5494
|
-
return S2({ width: e, height: t, color: l, className: o, onClick:
|
|
5497
|
+
return S2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5495
5498
|
case "logOut":
|
|
5496
|
-
return V2({ width: e, height: t, color: l, className: o, onClick:
|
|
5499
|
+
return V2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5497
5500
|
case "settings":
|
|
5498
|
-
return A2({ width: e, height: t, color: l, className: o, onClick:
|
|
5501
|
+
return A2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5499
5502
|
case "trash":
|
|
5500
|
-
return T2({ width: e, height: t, color: l, className: o, onClick:
|
|
5503
|
+
return T2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5501
5504
|
case "settings4":
|
|
5502
|
-
return Z2({ width: e, height: t, color: l, className: o, onClick:
|
|
5505
|
+
return Z2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5503
5506
|
case "success":
|
|
5504
|
-
return D2({ width: e, height: t, color: l, className: o, onClick:
|
|
5507
|
+
return D2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5505
5508
|
case "checkCircle":
|
|
5506
|
-
return B2({ width: e, height: t, color: l, className: o, onClick:
|
|
5509
|
+
return B2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5507
5510
|
case "errorSmall":
|
|
5508
|
-
return j2({ width: e, height: t, color: l, className: o, onClick:
|
|
5511
|
+
return j2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5509
5512
|
case "infoMedium":
|
|
5510
|
-
return W2({ width: e, height: t, color: l, className: o, onClick:
|
|
5513
|
+
return W2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5511
5514
|
case "attentionMedium":
|
|
5512
5515
|
return G2({
|
|
5513
5516
|
width: e,
|
|
5514
5517
|
height: t,
|
|
5515
5518
|
color: l,
|
|
5516
5519
|
className: o,
|
|
5517
|
-
onClick:
|
|
5520
|
+
onClick: c
|
|
5518
5521
|
});
|
|
5519
5522
|
case "errorMedium":
|
|
5520
|
-
return K2({ width: e, height: t, color: l, className: o, onClick:
|
|
5523
|
+
return K2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5521
5524
|
case "visibilityIcon":
|
|
5522
5525
|
return $2({
|
|
5523
5526
|
width: e,
|
|
5524
5527
|
height: t,
|
|
5525
5528
|
color: l,
|
|
5526
5529
|
className: o,
|
|
5527
|
-
onClick:
|
|
5530
|
+
onClick: c
|
|
5528
5531
|
});
|
|
5529
5532
|
case "visibilityOffIcon":
|
|
5530
5533
|
return P2({
|
|
@@ -5532,7 +5535,7 @@ const w2 = ({
|
|
|
5532
5535
|
height: t,
|
|
5533
5536
|
color: l,
|
|
5534
5537
|
className: o,
|
|
5535
|
-
onClick:
|
|
5538
|
+
onClick: c
|
|
5536
5539
|
});
|
|
5537
5540
|
case "selectArrowIcon":
|
|
5538
5541
|
return F2({
|
|
@@ -5540,7 +5543,7 @@ const w2 = ({
|
|
|
5540
5543
|
height: t,
|
|
5541
5544
|
color: l,
|
|
5542
5545
|
className: o,
|
|
5543
|
-
onClick:
|
|
5546
|
+
onClick: c
|
|
5544
5547
|
});
|
|
5545
5548
|
case "expandArrowIcon":
|
|
5546
5549
|
return Y2({
|
|
@@ -5548,7 +5551,7 @@ const w2 = ({
|
|
|
5548
5551
|
height: t,
|
|
5549
5552
|
color: l,
|
|
5550
5553
|
className: o,
|
|
5551
|
-
onClick:
|
|
5554
|
+
onClick: c
|
|
5552
5555
|
});
|
|
5553
5556
|
case "expandActiveArrowIcon":
|
|
5554
5557
|
return U2({
|
|
@@ -5556,78 +5559,78 @@ const w2 = ({
|
|
|
5556
5559
|
height: t,
|
|
5557
5560
|
color: l,
|
|
5558
5561
|
className: o,
|
|
5559
|
-
onClick:
|
|
5562
|
+
onClick: c
|
|
5560
5563
|
});
|
|
5561
5564
|
case "sortUp":
|
|
5562
|
-
return z2({ width: e, height: t, color: l, className: o, onClick:
|
|
5565
|
+
return z2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5563
5566
|
case "sortDown":
|
|
5564
|
-
return J2({ width: e, height: t, color: l, className: o, onClick:
|
|
5567
|
+
return J2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5565
5568
|
case "search":
|
|
5566
|
-
return q2({ width: e, height: t, color: l, className: o, onClick:
|
|
5569
|
+
return q2({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5567
5570
|
case "arrowUpFilled":
|
|
5568
|
-
return t5({ width: e, height: t, color: l, className: o, onClick:
|
|
5571
|
+
return t5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5569
5572
|
case "arrowDownFilled":
|
|
5570
|
-
return e5({ width: e, height: t, color: l, className: o, onClick:
|
|
5573
|
+
return e5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5571
5574
|
case "link":
|
|
5572
|
-
return i5({ width: e, height: t, color: l, className: o, onClick:
|
|
5575
|
+
return i5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5573
5576
|
case "telegram":
|
|
5574
|
-
return n5({ width: e, height: t, color: l, className: o, onClick:
|
|
5577
|
+
return n5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5575
5578
|
case "mail":
|
|
5576
|
-
return o5({ width: e, height: t, color: l, className: o, onClick:
|
|
5579
|
+
return o5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5577
5580
|
case "github":
|
|
5578
|
-
return s5({ width: e, height: t, color: l, className: o, onClick:
|
|
5581
|
+
return s5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5579
5582
|
case "linkedIn":
|
|
5580
|
-
return r5({ width: e, height: t, color: l, className: o, onClick:
|
|
5583
|
+
return r5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5581
5584
|
case "emptyStateIcon":
|
|
5582
|
-
return a5({ width: e, height: t, color: l, className: o, onClick:
|
|
5585
|
+
return a5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5583
5586
|
case "filtersIcon":
|
|
5584
|
-
return l5({ width: e, height: t, color: l, className: o, onClick:
|
|
5587
|
+
return l5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5585
5588
|
case "dotMenuIcon":
|
|
5586
|
-
return
|
|
5589
|
+
return c5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5587
5590
|
case "plusCircle":
|
|
5588
|
-
return
|
|
5591
|
+
return h5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5589
5592
|
case "warning":
|
|
5590
|
-
return d5({ width: e, height: t, color: l, className: o, onClick:
|
|
5593
|
+
return d5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5591
5594
|
case "back":
|
|
5592
|
-
return g5({ width: e, height: t, color: l, className: o, onClick:
|
|
5595
|
+
return g5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5593
5596
|
case "bell":
|
|
5594
|
-
return u5({ width: e, height: t, color: l, className: o, onClick:
|
|
5597
|
+
return u5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5595
5598
|
case "contract":
|
|
5596
|
-
return p5({ width: e, height: t, color: l, className: o, onClick:
|
|
5599
|
+
return p5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5597
5600
|
case "trash2":
|
|
5598
|
-
return C5({ width: e, height: t, color: l, className: o, onClick:
|
|
5601
|
+
return C5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5599
5602
|
case "resourceManager":
|
|
5600
|
-
return f5({ width: e, height: t, color: l, className: o, onClick:
|
|
5603
|
+
return f5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5601
5604
|
case "settings2":
|
|
5602
|
-
return m5({ width: e, height: t, color: l, className: o, onClick:
|
|
5605
|
+
return m5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5603
5606
|
case "image":
|
|
5604
|
-
return w5({ width: e, height: t, color: l, className: o, onClick:
|
|
5607
|
+
return w5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5605
5608
|
case "edit":
|
|
5606
|
-
return k5({ width: e, height: t, color: l, className: o, onClick:
|
|
5609
|
+
return k5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5607
5610
|
case "filledArrowRight":
|
|
5608
|
-
return L5({ width: e, height: t, color: l, className: o, onClick:
|
|
5611
|
+
return L5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5609
5612
|
case "burgerMenu":
|
|
5610
|
-
return v5({ width: e, height: t, color: l, className: o, onClick:
|
|
5613
|
+
return v5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5611
5614
|
case "signOut":
|
|
5612
|
-
return N5({ width: e, height: t, color: l, className: o, onClick:
|
|
5615
|
+
return N5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5613
5616
|
case "refresh":
|
|
5614
|
-
return x5({ width: e, height: t, color: l, className: o, onClick:
|
|
5617
|
+
return x5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5615
5618
|
case "projects":
|
|
5616
|
-
return R5({ width: e, height: t, color: l, className: o, onClick:
|
|
5619
|
+
return R5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5617
5620
|
case "profile":
|
|
5618
|
-
return I5({ width: e, height: t, color: l, className: o, onClick:
|
|
5621
|
+
return I5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5619
5622
|
case "exit":
|
|
5620
|
-
return M5({ width: e, height: t, color: l, className: o, onClick:
|
|
5623
|
+
return M5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5621
5624
|
case "client":
|
|
5622
|
-
return b5({ width: e, height: t, color: l, className: o, onClick:
|
|
5625
|
+
return b5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5623
5626
|
case "calendar2":
|
|
5624
|
-
return y5({ width: e, height: t, color: l, className: o, onClick:
|
|
5627
|
+
return y5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5625
5628
|
case "openPointCircle":
|
|
5626
|
-
return E5({ width: e, height: t, color: l, className: o, onClick:
|
|
5629
|
+
return E5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5627
5630
|
case "community":
|
|
5628
|
-
return _5({ width: e, height: t, color: l, className: o, onClick:
|
|
5631
|
+
return _5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5629
5632
|
case "docs":
|
|
5630
|
-
return H5({ width: e, height: t, color: l, className: o, onClick:
|
|
5633
|
+
return H5({ width: e, height: t, color: l, className: o, onClick: c });
|
|
5631
5634
|
default:
|
|
5632
5635
|
return /* @__PURE__ */ r(i1, { children: "No Icon provided" });
|
|
5633
5636
|
}
|
|
@@ -5647,7 +5650,7 @@ const ue = ({
|
|
|
5647
5650
|
closable: n = !0,
|
|
5648
5651
|
disabled: a = !1
|
|
5649
5652
|
}) => {
|
|
5650
|
-
const
|
|
5653
|
+
const h = t === "small" ? 10 : 12.5, o = () => {
|
|
5651
5654
|
a || s == null || s();
|
|
5652
5655
|
};
|
|
5653
5656
|
return /* @__PURE__ */ r(
|
|
@@ -5659,8 +5662,8 @@ const ue = ({
|
|
|
5659
5662
|
{
|
|
5660
5663
|
name: "errorSmall",
|
|
5661
5664
|
color: a ? f1.GREY_DARK_1 : f1.GREY_DARK_2,
|
|
5662
|
-
width:
|
|
5663
|
-
height:
|
|
5665
|
+
width: h,
|
|
5666
|
+
height: h,
|
|
5664
5667
|
onClick: o
|
|
5665
5668
|
}
|
|
5666
5669
|
),
|
|
@@ -5700,30 +5703,33 @@ const ue = ({
|
|
|
5700
5703
|
children: s,
|
|
5701
5704
|
onClick: n,
|
|
5702
5705
|
collapsed: a,
|
|
5703
|
-
whiteSpace:
|
|
5706
|
+
whiteSpace: h = "normal",
|
|
5704
5707
|
/** This prop allows you to enable tooltip if text size is too big */
|
|
5705
5708
|
trim: o = !1
|
|
5706
|
-
},
|
|
5707
|
-
const
|
|
5708
|
-
_1(
|
|
5709
|
-
const [l,
|
|
5709
|
+
}, g) => {
|
|
5710
|
+
const d = q(null);
|
|
5711
|
+
_1(g, () => d.current);
|
|
5712
|
+
const [l, c] = T(!1);
|
|
5710
5713
|
j(() => {
|
|
5714
|
+
var m;
|
|
5711
5715
|
if (!o) return;
|
|
5712
|
-
const
|
|
5713
|
-
|
|
5714
|
-
}
|
|
5715
|
-
|
|
5716
|
-
|
|
5716
|
+
const _ = () => {
|
|
5717
|
+
d.current && c(d.current.scrollWidth > d.current.clientWidth);
|
|
5718
|
+
};
|
|
5719
|
+
_();
|
|
5720
|
+
const N = new ResizeObserver(_);
|
|
5721
|
+
return d.current && N.observe(d.current), (m = d.current) != null && m.parentElement && N.observe(d.current.parentElement), () => {
|
|
5722
|
+
N.disconnect();
|
|
5717
5723
|
};
|
|
5718
|
-
}, [o
|
|
5724
|
+
}, [o]);
|
|
5719
5725
|
const u = e === "h1" || e === "h2" || e === "h3" || e === "h4";
|
|
5720
5726
|
let p = `snmt-typography snmt-typography-${e}`;
|
|
5721
5727
|
i && i !== "inherit" && (p += ` snmt-typography-align-${i}`), a && (p += " collapsed"), o && (p += " collapsed");
|
|
5722
5728
|
const w = {
|
|
5723
5729
|
className: p,
|
|
5724
|
-
style: { color: t, whiteSpace: o ? "nowrap" :
|
|
5730
|
+
style: { color: t, whiteSpace: o ? "nowrap" : h, display: o ? "block" : "" },
|
|
5725
5731
|
onClick: n,
|
|
5726
|
-
ref:
|
|
5732
|
+
ref: d
|
|
5727
5733
|
}, k = u ? /* @__PURE__ */ r(A5, { level: Z5[e], ...w, children: s }) : /* @__PURE__ */ r(T5, { ...w, children: s });
|
|
5728
5734
|
return o && l ? /* @__PURE__ */ r(V5, { placement: "top", title: s, children: k }) : k;
|
|
5729
5735
|
}
|
|
@@ -5735,7 +5741,7 @@ const ue = ({
|
|
|
5735
5741
|
placement: n = "topRight",
|
|
5736
5742
|
noPadding: a = !1
|
|
5737
5743
|
}) => {
|
|
5738
|
-
const [
|
|
5744
|
+
const [h, o] = T(!1);
|
|
5739
5745
|
return /* @__PURE__ */ r(
|
|
5740
5746
|
Ee,
|
|
5741
5747
|
{
|
|
@@ -5744,9 +5750,9 @@ const ue = ({
|
|
|
5744
5750
|
placement: n,
|
|
5745
5751
|
trigger: "click",
|
|
5746
5752
|
overlayClassName: `snmt-popover ${a ? "" : "padding"}`,
|
|
5747
|
-
open: t ??
|
|
5748
|
-
onOpenChange: (
|
|
5749
|
-
o(
|
|
5753
|
+
open: t ?? h,
|
|
5754
|
+
onOpenChange: (g) => {
|
|
5755
|
+
o(g), s == null || s(g);
|
|
5750
5756
|
},
|
|
5751
5757
|
children: /* @__PURE__ */ r("div", { className: "wrapper", children: i })
|
|
5752
5758
|
}
|
|
@@ -5770,16 +5776,16 @@ const W5 = ({
|
|
|
5770
5776
|
closable: s = !0,
|
|
5771
5777
|
disabled: n,
|
|
5772
5778
|
options: a,
|
|
5773
|
-
extraOptions:
|
|
5779
|
+
extraOptions: h
|
|
5774
5780
|
}) => {
|
|
5775
|
-
const { locale: o } = r1(D1), { t:
|
|
5781
|
+
const { locale: o } = r1(D1), { t: g } = Je("common", { lng: o }), [d, l] = T(!1);
|
|
5776
5782
|
if (j(() => {
|
|
5777
5783
|
i.length || l(!1);
|
|
5778
5784
|
}, [i]), !i.length)
|
|
5779
5785
|
return null;
|
|
5780
|
-
const
|
|
5786
|
+
const c = (u) => {
|
|
5781
5787
|
var p, w;
|
|
5782
|
-
return ((p = a == null ? void 0 : a.find((k) => k.value === u)) == null ? void 0 : p.label) || ((w =
|
|
5788
|
+
return ((p = a == null ? void 0 : a.find((k) => k.value === u)) == null ? void 0 : p.label) || ((w = h == null ? void 0 : h.find((k) => k.value === u)) == null ? void 0 : w.label) || u;
|
|
5783
5789
|
};
|
|
5784
5790
|
return /* @__PURE__ */ C(
|
|
5785
5791
|
B5,
|
|
@@ -5792,18 +5798,18 @@ const W5 = ({
|
|
|
5792
5798
|
onClose: () => e(u),
|
|
5793
5799
|
closable: s,
|
|
5794
5800
|
disabled: n,
|
|
5795
|
-
children:
|
|
5801
|
+
children: c(u)
|
|
5796
5802
|
},
|
|
5797
5803
|
u
|
|
5798
5804
|
)) }) })
|
|
5799
5805
|
),
|
|
5800
5806
|
placement: "bottomRight",
|
|
5801
|
-
isOpen:
|
|
5807
|
+
isOpen: d,
|
|
5802
5808
|
setIsOpen: l,
|
|
5803
5809
|
children: [
|
|
5804
5810
|
i.length,
|
|
5805
5811
|
" ",
|
|
5806
|
-
|
|
5812
|
+
g("more")
|
|
5807
5813
|
]
|
|
5808
5814
|
}
|
|
5809
5815
|
);
|
|
@@ -5823,23 +5829,23 @@ const W5 = ({
|
|
|
5823
5829
|
mode: s,
|
|
5824
5830
|
search: n = !1,
|
|
5825
5831
|
options: a,
|
|
5826
|
-
width:
|
|
5832
|
+
width: h,
|
|
5827
5833
|
disabled: o = !1,
|
|
5828
|
-
required:
|
|
5829
|
-
clearable:
|
|
5834
|
+
required: g = !1,
|
|
5835
|
+
clearable: d = !1,
|
|
5830
5836
|
scrollThresholdValue: l = 50,
|
|
5831
|
-
onSearchChange:
|
|
5837
|
+
onSearchChange: c,
|
|
5832
5838
|
onDropdownVisibleChange: u,
|
|
5833
5839
|
onScrollToEnd: p,
|
|
5834
5840
|
onPopupScroll: w,
|
|
5835
5841
|
id: k,
|
|
5836
5842
|
extraOptions: m,
|
|
5837
5843
|
dropdownRender: _,
|
|
5838
|
-
optionRender:
|
|
5844
|
+
optionRender: N,
|
|
5839
5845
|
isLoading: S,
|
|
5840
5846
|
readOnly: f,
|
|
5841
|
-
error:
|
|
5842
|
-
},
|
|
5847
|
+
error: x
|
|
5848
|
+
}, R) => {
|
|
5843
5849
|
const [v, P] = T(!1), [J, F] = T(!1), [H, D] = T(!0), [I, V] = T(i), Z = q(null);
|
|
5844
5850
|
j(() => {
|
|
5845
5851
|
V(i);
|
|
@@ -5926,7 +5932,7 @@ const W5 = ({
|
|
|
5926
5932
|
className: `snmt-select-1-15-6 ${J ? "snmt-select-focused" : ""}
|
|
5927
5933
|
${s ? "" : "snmt-select-single"} ${f ? "snmt-select-read-only" : ""}`,
|
|
5928
5934
|
ref: Z,
|
|
5929
|
-
style: { width:
|
|
5935
|
+
style: { width: h },
|
|
5930
5936
|
children: [
|
|
5931
5937
|
/* @__PURE__ */ r(
|
|
5932
5938
|
xe,
|
|
@@ -5934,7 +5940,7 @@ const W5 = ({
|
|
|
5934
5940
|
className: "snmt-select-blank",
|
|
5935
5941
|
popupClassName: f ? "dropdown-read-only" : "",
|
|
5936
5942
|
id: k,
|
|
5937
|
-
ref:
|
|
5943
|
+
ref: R,
|
|
5938
5944
|
showSearch: !!n,
|
|
5939
5945
|
filterOption: n && U,
|
|
5940
5946
|
onDropdownVisibleChange: W,
|
|
@@ -5949,7 +5955,7 @@ const W5 = ({
|
|
|
5949
5955
|
onFocus: O,
|
|
5950
5956
|
onBlur: K,
|
|
5951
5957
|
onSearch: (L) => {
|
|
5952
|
-
D(!L),
|
|
5958
|
+
D(!L), c && c(L);
|
|
5953
5959
|
},
|
|
5954
5960
|
onSelect: () => D(!0),
|
|
5955
5961
|
onDeselect: () => D(!0),
|
|
@@ -5959,7 +5965,7 @@ const W5 = ({
|
|
|
5959
5965
|
onPopupScroll: v1,
|
|
5960
5966
|
prefix: S && /* @__PURE__ */ r(K1, { size: 15 }),
|
|
5961
5967
|
suffixIcon: /* @__PURE__ */ r("div", { className: "wrapper-suffix-icon", children: s !== "filter" && /* @__PURE__ */ C(i1, { children: [
|
|
5962
|
-
I && !!I.length && (s ||
|
|
5968
|
+
I && !!I.length && (s || d) && /* @__PURE__ */ r(
|
|
5963
5969
|
"div",
|
|
5964
5970
|
{
|
|
5965
5971
|
onClick: e1,
|
|
@@ -5987,7 +5993,7 @@ const W5 = ({
|
|
|
5987
5993
|
] }) }),
|
|
5988
5994
|
removeIcon: /* @__PURE__ */ r(u1, { name: "errorSmall", color: Q.GREY_DARK_1 }),
|
|
5989
5995
|
options: a,
|
|
5990
|
-
optionRender: (L) =>
|
|
5996
|
+
optionRender: (L) => N ? N(L.data) : /* @__PURE__ */ C(p1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
|
|
5991
5997
|
/* @__PURE__ */ C(p1, { alignItems: "center", gap: 12, children: [
|
|
5992
5998
|
s && /* @__PURE__ */ r(
|
|
5993
5999
|
Qe,
|
|
@@ -6020,22 +6026,22 @@ const W5 = ({
|
|
|
6020
6026
|
/* @__PURE__ */ r(
|
|
6021
6027
|
"label",
|
|
6022
6028
|
{
|
|
6023
|
-
className: `${J || z ? "label-floating" : ""} ${o ? "label-disabled" : ""} ${J ? "label-focused" : ""} ${S ? "label-loading" : ""} ${
|
|
6024
|
-
children:
|
|
6029
|
+
className: `${J || z ? "label-floating" : ""} ${o ? "label-disabled" : ""} ${J ? "label-focused" : ""} ${S ? "label-loading" : ""} ${x ? "label-error" : ""}`,
|
|
6030
|
+
children: g ? `${t}*` : t
|
|
6025
6031
|
}
|
|
6026
6032
|
),
|
|
6027
6033
|
/* @__PURE__ */ r(
|
|
6028
6034
|
"fieldset",
|
|
6029
6035
|
{
|
|
6030
|
-
className: `${J ? "fieldset-focused" : ""} ${o ? "fieldset-disabled" : ""} ${z ? "fieldset-filled" : ""} ${
|
|
6031
|
-
children: /* @__PURE__ */ r("legend", { children: /* @__PURE__ */ r("span", { children:
|
|
6036
|
+
className: `${J ? "fieldset-focused" : ""} ${o ? "fieldset-disabled" : ""} ${z ? "fieldset-filled" : ""} ${x ? "fieldset-error" : ""}`,
|
|
6037
|
+
children: /* @__PURE__ */ r("legend", { children: /* @__PURE__ */ r("span", { children: g ? `${t}*` : t }) })
|
|
6032
6038
|
}
|
|
6033
6039
|
)
|
|
6034
6040
|
] })
|
|
6035
6041
|
]
|
|
6036
6042
|
}
|
|
6037
6043
|
),
|
|
6038
|
-
|
|
6044
|
+
x && /* @__PURE__ */ C(p1, { justifyContent: "flex-start", gap: 6, children: [
|
|
6039
6045
|
/* @__PURE__ */ r(
|
|
6040
6046
|
u1,
|
|
6041
6047
|
{
|
|
@@ -6045,7 +6051,7 @@ const W5 = ({
|
|
|
6045
6051
|
width: 16
|
|
6046
6052
|
}
|
|
6047
6053
|
),
|
|
6048
|
-
typeof
|
|
6054
|
+
typeof x == "string" ? /* @__PURE__ */ r(D5, { color: Q.NOTIFICATION_ERROR_DARK, variant: "body4", children: x }) : x
|
|
6049
6055
|
] })
|
|
6050
6056
|
] });
|
|
6051
6057
|
}
|
|
@@ -6077,23 +6083,23 @@ const I1 = 100, l1 = {
|
|
|
6077
6083
|
value: s,
|
|
6078
6084
|
id: n,
|
|
6079
6085
|
disabled: a,
|
|
6080
|
-
scrollThresholdValue:
|
|
6086
|
+
scrollThresholdValue: h,
|
|
6081
6087
|
placeholder: o,
|
|
6082
|
-
mode:
|
|
6083
|
-
loadOnClosedState:
|
|
6088
|
+
mode: g,
|
|
6089
|
+
loadOnClosedState: d,
|
|
6084
6090
|
preloadOptions: l,
|
|
6085
|
-
extraOptions:
|
|
6091
|
+
extraOptions: c,
|
|
6086
6092
|
onDropdownVisibleChange: u,
|
|
6087
6093
|
optionRender: p,
|
|
6088
6094
|
dropdownRender: w,
|
|
6089
6095
|
readOnly: k,
|
|
6090
6096
|
clearable: m = !1,
|
|
6091
6097
|
required: _ = !1,
|
|
6092
|
-
error:
|
|
6098
|
+
error: N
|
|
6093
6099
|
}, S) => {
|
|
6094
|
-
const [f,
|
|
6095
|
-
|
|
6096
|
-
), W = P1(
|
|
6100
|
+
const [f, x] = T(), [R, v] = T(l1), [P, J] = T(!1), [F, H] = T(), [D, I] = T(!1), [V, Z] = T(
|
|
6101
|
+
c ?? []
|
|
6102
|
+
), W = P1(R.offset), U = P1(F), [O, K] = T(!1), G = q(!1), e1 = $(
|
|
6097
6103
|
async ({
|
|
6098
6104
|
limit: A = I1,
|
|
6099
6105
|
offset: z,
|
|
@@ -6106,7 +6112,7 @@ const I1 = 100, l1 = {
|
|
|
6106
6112
|
offset: z,
|
|
6107
6113
|
search: L
|
|
6108
6114
|
});
|
|
6109
|
-
|
|
6115
|
+
x(
|
|
6110
6116
|
(B) => z === 0 ? b.options : [...B ?? [], ...b.options]
|
|
6111
6117
|
), v((B) => ({
|
|
6112
6118
|
...B,
|
|
@@ -6126,12 +6132,12 @@ const I1 = 100, l1 = {
|
|
|
6126
6132
|
[t1]
|
|
6127
6133
|
), L1 = $(
|
|
6128
6134
|
async (A) => {
|
|
6129
|
-
P || A &&
|
|
6135
|
+
P || A && R.count && R.count > ((f == null ? void 0 : f.length) ?? 0) && v((z) => ({
|
|
6130
6136
|
...z,
|
|
6131
6137
|
offset: z.offset + I1
|
|
6132
6138
|
}));
|
|
6133
6139
|
},
|
|
6134
|
-
[P, f == null ? void 0 : f.length,
|
|
6140
|
+
[P, f == null ? void 0 : f.length, R.count]
|
|
6135
6141
|
), v1 = $(
|
|
6136
6142
|
(A) => {
|
|
6137
6143
|
I(A), !A && F && (H(void 0), v(l1), K(!0)), u == null || u(A);
|
|
@@ -6139,22 +6145,22 @@ const I1 = 100, l1 = {
|
|
|
6139
6145
|
[u, F]
|
|
6140
6146
|
);
|
|
6141
6147
|
j(() => {
|
|
6142
|
-
!G.current || P || (O || D && (W !==
|
|
6143
|
-
}, [O, D,
|
|
6144
|
-
(
|
|
6148
|
+
!G.current || P || (O || D && (W !== R.offset || U !== F || !f)) && (e1({ offset: R.offset, limit: I1, search: F }), O && K(!1));
|
|
6149
|
+
}, [O, D, R.offset, F, W, U, f, P]), j(() => {
|
|
6150
|
+
(d || l) && e1(l1), G.current = !0;
|
|
6145
6151
|
}, []), j(() => {
|
|
6146
|
-
|
|
6147
|
-
const z =
|
|
6152
|
+
c && Z((A) => {
|
|
6153
|
+
const z = c.filter(
|
|
6148
6154
|
(L) => !A.some((b) => b.value === L.value)
|
|
6149
6155
|
);
|
|
6150
6156
|
return [...A, ...z];
|
|
6151
6157
|
});
|
|
6152
|
-
}, [
|
|
6158
|
+
}, [c]);
|
|
6153
6159
|
const o1 = $(
|
|
6154
6160
|
(A) => {
|
|
6155
6161
|
t && t(A);
|
|
6156
6162
|
let z = [];
|
|
6157
|
-
if (
|
|
6163
|
+
if (g ? z = Array.isArray(A) ? A : [] : z = A ? [A] : [], F) {
|
|
6158
6164
|
const L = z.filter(
|
|
6159
6165
|
(b) => !(V != null && V.some((B) => B.value === b))
|
|
6160
6166
|
);
|
|
@@ -6170,7 +6176,7 @@ const I1 = 100, l1 = {
|
|
|
6170
6176
|
]), H(void 0), v(l1), K(!0);
|
|
6171
6177
|
}
|
|
6172
6178
|
},
|
|
6173
|
-
[t, F,
|
|
6179
|
+
[t, F, g, f, V]
|
|
6174
6180
|
), N1 = Ne(
|
|
6175
6181
|
() => ({
|
|
6176
6182
|
id: n,
|
|
@@ -6183,7 +6189,7 @@ const I1 = 100, l1 = {
|
|
|
6183
6189
|
value: s,
|
|
6184
6190
|
onSearchChange: g1,
|
|
6185
6191
|
onDropdownVisibleChange: v1,
|
|
6186
|
-
scrollThresholdValue:
|
|
6192
|
+
scrollThresholdValue: h,
|
|
6187
6193
|
onScrollToEnd: L1,
|
|
6188
6194
|
disabled: a,
|
|
6189
6195
|
extraOptions: V,
|
|
@@ -6193,7 +6199,7 @@ const I1 = 100, l1 = {
|
|
|
6193
6199
|
readOnly: k,
|
|
6194
6200
|
clearable: m,
|
|
6195
6201
|
required: _,
|
|
6196
|
-
error:
|
|
6202
|
+
error: N
|
|
6197
6203
|
}),
|
|
6198
6204
|
[
|
|
6199
6205
|
n,
|
|
@@ -6205,7 +6211,7 @@ const I1 = 100, l1 = {
|
|
|
6205
6211
|
s,
|
|
6206
6212
|
g1,
|
|
6207
6213
|
v1,
|
|
6208
|
-
|
|
6214
|
+
h,
|
|
6209
6215
|
L1,
|
|
6210
6216
|
a,
|
|
6211
6217
|
V,
|
|
@@ -6215,14 +6221,14 @@ const I1 = 100, l1 = {
|
|
|
6215
6221
|
k,
|
|
6216
6222
|
m,
|
|
6217
6223
|
_,
|
|
6218
|
-
|
|
6224
|
+
N
|
|
6219
6225
|
]
|
|
6220
6226
|
);
|
|
6221
6227
|
return _1(S, () => ({
|
|
6222
6228
|
refetchOptions: async () => {
|
|
6223
6229
|
v(l1), H(void 0), K(!0);
|
|
6224
6230
|
}
|
|
6225
|
-
})),
|
|
6231
|
+
})), g ? /* @__PURE__ */ r($1, { ...N1, value: s, mode: g }) : /* @__PURE__ */ r("div", { className: "snmt-async-select", children: /* @__PURE__ */ r($1, { ...N1, value: s }) });
|
|
6226
6232
|
}
|
|
6227
6233
|
);
|
|
6228
6234
|
var R1 = /* @__PURE__ */ ((i) => (i.ACTIVE = "Active", i.ARCHIVED = "Archived", i))(R1 || {});
|
|
@@ -6269,11 +6275,11 @@ const Ce = (i, e) => () => {
|
|
|
6269
6275
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6270
6276
|
const s = e.languages[0], n = e.options ? e.options.fallbackLng : !1, a = e.languages[e.languages.length - 1];
|
|
6271
6277
|
if (s.toLowerCase() === "cimode") return !0;
|
|
6272
|
-
const
|
|
6273
|
-
const
|
|
6274
|
-
return
|
|
6278
|
+
const h = (o, g) => {
|
|
6279
|
+
const d = e.services.backendConnector.state[`${o}|${g}`];
|
|
6280
|
+
return d === -1 || d === 2;
|
|
6275
6281
|
};
|
|
6276
|
-
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !
|
|
6282
|
+
return t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !h(e.isLanguageChangingTo, i) ? !1 : !!(e.hasResourceBundle(s, i) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || h(s, i) && (!n || h(a, i)));
|
|
6277
6283
|
}, F5 = function(i, e) {
|
|
6278
6284
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
6279
6285
|
return !e.languages || !e.languages.length ? (A1("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(i, {
|
|
@@ -6356,49 +6362,49 @@ const ri = (i, e) => {
|
|
|
6356
6362
|
} = r1(si) || {}, a = t || s || ti();
|
|
6357
6363
|
if (a && !a.reportNamespaces && (a.reportNamespaces = new ni()), !a) {
|
|
6358
6364
|
A1("You will need to pass in an i18next instance by using initReactI18next");
|
|
6359
|
-
const f = (
|
|
6360
|
-
return
|
|
6365
|
+
const f = (R, v) => n1(v) ? v : Y5(v) && n1(v.defaultValue) ? v.defaultValue : Array.isArray(R) ? R[R.length - 1] : R, x = [f, {}, !1];
|
|
6366
|
+
return x.t = f, x.i18n = {}, x.ready = !1, x;
|
|
6361
6367
|
}
|
|
6362
6368
|
a.options.react && a.options.react.wait !== void 0 && A1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
6363
|
-
const
|
|
6369
|
+
const h = {
|
|
6364
6370
|
...X5(),
|
|
6365
6371
|
...a.options.react,
|
|
6366
6372
|
...e
|
|
6367
6373
|
}, {
|
|
6368
6374
|
useSuspense: o,
|
|
6369
|
-
keyPrefix:
|
|
6370
|
-
} =
|
|
6371
|
-
let
|
|
6372
|
-
|
|
6373
|
-
const l = (a.isInitialized || a.initializedStoreOnce) &&
|
|
6374
|
-
let m =
|
|
6375
|
+
keyPrefix: g
|
|
6376
|
+
} = h;
|
|
6377
|
+
let d = i;
|
|
6378
|
+
d = n1(d) ? [d] : d || ["translation"], a.reportNamespaces.addUsedNamespaces && a.reportNamespaces.addUsedNamespaces(d);
|
|
6379
|
+
const l = (a.isInitialized || a.initializedStoreOnce) && d.every((f) => F5(f, a, h)), c = oi(a, e.lng || null, h.nsMode === "fallback" ? d : d[0], g), u = () => c, p = () => fe(a, e.lng || null, h.nsMode === "fallback" ? d : d[0], g), [w, k] = T(u);
|
|
6380
|
+
let m = d.join();
|
|
6375
6381
|
e.lng && (m = `${e.lng}${m}`);
|
|
6376
|
-
const _ = ri(m),
|
|
6382
|
+
const _ = ri(m), N = q(!0);
|
|
6377
6383
|
j(() => {
|
|
6378
6384
|
const {
|
|
6379
6385
|
bindI18n: f,
|
|
6380
|
-
bindI18nStore:
|
|
6381
|
-
} =
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
}) : U1(a,
|
|
6385
|
-
|
|
6386
|
-
})), l && _ && _ !== m &&
|
|
6387
|
-
const
|
|
6388
|
-
|
|
6386
|
+
bindI18nStore: x
|
|
6387
|
+
} = h;
|
|
6388
|
+
N.current = !0, !l && !o && (e.lng ? z1(a, e.lng, d, () => {
|
|
6389
|
+
N.current && k(p);
|
|
6390
|
+
}) : U1(a, d, () => {
|
|
6391
|
+
N.current && k(p);
|
|
6392
|
+
})), l && _ && _ !== m && N.current && k(p);
|
|
6393
|
+
const R = () => {
|
|
6394
|
+
N.current && k(p);
|
|
6389
6395
|
};
|
|
6390
|
-
return f && a && a.on(f,
|
|
6391
|
-
|
|
6396
|
+
return f && a && a.on(f, R), x && a && a.store.on(x, R), () => {
|
|
6397
|
+
N.current = !1, f && a && f.split(" ").forEach((v) => a.off(v, R)), x && a && x.split(" ").forEach((v) => a.store.off(v, R));
|
|
6392
6398
|
};
|
|
6393
6399
|
}, [a, m]), j(() => {
|
|
6394
|
-
|
|
6395
|
-
}, [a,
|
|
6400
|
+
N.current && l && k(u);
|
|
6401
|
+
}, [a, g, l]);
|
|
6396
6402
|
const S = [w, a, l];
|
|
6397
6403
|
if (S.t = w, S.i18n = a, S.ready = l, l || !l && !o) return S;
|
|
6398
6404
|
throw new Promise((f) => {
|
|
6399
|
-
e.lng ? z1(a, e.lng,
|
|
6405
|
+
e.lng ? z1(a, e.lng, d, () => f()) : U1(a, d, () => f());
|
|
6400
6406
|
});
|
|
6401
|
-
},
|
|
6407
|
+
}, M = (i) => typeof i == "string", C1 = () => {
|
|
6402
6408
|
let i, e;
|
|
6403
6409
|
const t = new Promise((s, n) => {
|
|
6404
6410
|
i = s, e = n;
|
|
@@ -6408,8 +6414,8 @@ const ri = (i, e) => {
|
|
|
6408
6414
|
i.forEach((s) => {
|
|
6409
6415
|
e[s] && (t[s] = e[s]);
|
|
6410
6416
|
});
|
|
6411
|
-
},
|
|
6412
|
-
const s =
|
|
6417
|
+
}, ci = /###/g, q1 = (i) => i && i.indexOf("###") > -1 ? i.replace(ci, ".") : i, Q1 = (i) => !i || M(i), m1 = (i, e, t) => {
|
|
6418
|
+
const s = M(e) ? e.split(".") : e;
|
|
6413
6419
|
let n = 0;
|
|
6414
6420
|
for (; n < s.length - 1; ) {
|
|
6415
6421
|
if (Q1(i)) return {};
|
|
@@ -6429,11 +6435,11 @@ const ri = (i, e) => {
|
|
|
6429
6435
|
s[n] = t;
|
|
6430
6436
|
return;
|
|
6431
6437
|
}
|
|
6432
|
-
let a = e[e.length - 1],
|
|
6433
|
-
for (; o.obj === void 0 &&
|
|
6434
|
-
a = `${
|
|
6438
|
+
let a = e[e.length - 1], h = e.slice(0, e.length - 1), o = m1(i, h, Object);
|
|
6439
|
+
for (; o.obj === void 0 && h.length; )
|
|
6440
|
+
a = `${h[h.length - 1]}.${a}`, h = h.slice(0, h.length - 1), o = m1(i, h, Object), o && o.obj && typeof o.obj[`${o.k}.${a}`] < "u" && (o.obj = void 0);
|
|
6435
6441
|
o.obj[`${o.k}.${a}`] = t;
|
|
6436
|
-
},
|
|
6442
|
+
}, hi = (i, e, t, s) => {
|
|
6437
6443
|
const {
|
|
6438
6444
|
obj: n,
|
|
6439
6445
|
k: a
|
|
@@ -6451,9 +6457,9 @@ const ri = (i, e) => {
|
|
|
6451
6457
|
return s !== void 0 ? s : M1(e, t);
|
|
6452
6458
|
}, me = (i, e, t) => {
|
|
6453
6459
|
for (const s in e)
|
|
6454
|
-
s !== "__proto__" && s !== "constructor" && (s in i ?
|
|
6460
|
+
s !== "__proto__" && s !== "constructor" && (s in i ? M(i[s]) || i[s] instanceof String || M(e[s]) || e[s] instanceof String ? t && (i[s] = e[s]) : me(i[s], e[s], t) : i[s] = e[s]);
|
|
6455
6461
|
return i;
|
|
6456
|
-
},
|
|
6462
|
+
}, c1 = (i) => i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
6457
6463
|
var gi = {
|
|
6458
6464
|
"&": "&",
|
|
6459
6465
|
"<": "<",
|
|
@@ -6462,7 +6468,7 @@ var gi = {
|
|
|
6462
6468
|
"'": "'",
|
|
6463
6469
|
"/": "/"
|
|
6464
6470
|
};
|
|
6465
|
-
const ui = (i) =>
|
|
6471
|
+
const ui = (i) => M(i) ? i.replace(/[&<>"'\/]/g, (e) => gi[e]) : i;
|
|
6466
6472
|
class Ci {
|
|
6467
6473
|
constructor(e) {
|
|
6468
6474
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
@@ -6477,13 +6483,13 @@ class Ci {
|
|
|
6477
6483
|
}
|
|
6478
6484
|
const pi = [" ", ",", "?", "!", ";"], fi = new Ci(20), mi = (i, e, t) => {
|
|
6479
6485
|
e = e || "", t = t || "";
|
|
6480
|
-
const s = pi.filter((
|
|
6486
|
+
const s = pi.filter((h) => e.indexOf(h) < 0 && t.indexOf(h) < 0);
|
|
6481
6487
|
if (s.length === 0) return !0;
|
|
6482
|
-
const n = fi.getRegExp(`(${s.map((
|
|
6488
|
+
const n = fi.getRegExp(`(${s.map((h) => h === "?" ? "\\?" : h).join("|")})`);
|
|
6483
6489
|
let a = !n.test(i);
|
|
6484
6490
|
if (!a) {
|
|
6485
|
-
const
|
|
6486
|
-
|
|
6491
|
+
const h = i.indexOf(t);
|
|
6492
|
+
h > 0 && !n.test(i.substring(0, h)) && (a = !0);
|
|
6487
6493
|
}
|
|
6488
6494
|
return a;
|
|
6489
6495
|
}, Z1 = function(i, e) {
|
|
@@ -6495,15 +6501,15 @@ const pi = [" ", ",", "?", "!", ";"], fi = new Ci(20), mi = (i, e, t) => {
|
|
|
6495
6501
|
for (let a = 0; a < s.length; ) {
|
|
6496
6502
|
if (!n || typeof n != "object")
|
|
6497
6503
|
return;
|
|
6498
|
-
let
|
|
6499
|
-
for (let
|
|
6500
|
-
if (
|
|
6501
|
-
if (["string", "number", "boolean"].indexOf(typeof
|
|
6504
|
+
let h, o = "";
|
|
6505
|
+
for (let g = a; g < s.length; ++g)
|
|
6506
|
+
if (g !== a && (o += t), o += s[g], h = n[o], h !== void 0) {
|
|
6507
|
+
if (["string", "number", "boolean"].indexOf(typeof h) > -1 && g < s.length - 1)
|
|
6502
6508
|
continue;
|
|
6503
|
-
a +=
|
|
6509
|
+
a += g - a + 1;
|
|
6504
6510
|
break;
|
|
6505
6511
|
}
|
|
6506
|
-
n =
|
|
6512
|
+
n = h;
|
|
6507
6513
|
}
|
|
6508
6514
|
return n;
|
|
6509
6515
|
}, b1 = (i) => i && i.replace("_", "-"), wi = {
|
|
@@ -6551,7 +6557,7 @@ class y1 {
|
|
|
6551
6557
|
return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
|
|
6552
6558
|
}
|
|
6553
6559
|
forward(e, t, s, n) {
|
|
6554
|
-
return n && !this.debug ? null : (
|
|
6560
|
+
return n && !this.debug ? null : (M(e[0]) && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
6555
6561
|
}
|
|
6556
6562
|
create(e) {
|
|
6557
6563
|
return new y1(this.logger, {
|
|
@@ -6587,13 +6593,13 @@ class H1 {
|
|
|
6587
6593
|
emit(e) {
|
|
6588
6594
|
for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
6589
6595
|
s[n - 1] = arguments[n];
|
|
6590
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach((
|
|
6591
|
-
let [o,
|
|
6592
|
-
for (let
|
|
6596
|
+
this.observers[e] && Array.from(this.observers[e].entries()).forEach((h) => {
|
|
6597
|
+
let [o, g] = h;
|
|
6598
|
+
for (let d = 0; d < g; d++)
|
|
6593
6599
|
o(...s);
|
|
6594
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((
|
|
6595
|
-
let [o,
|
|
6596
|
-
for (let
|
|
6600
|
+
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((h) => {
|
|
6601
|
+
let [o, g] = h;
|
|
6602
|
+
for (let d = 0; d < g; d++)
|
|
6597
6603
|
o.apply(o, [e, ...s]);
|
|
6598
6604
|
});
|
|
6599
6605
|
}
|
|
@@ -6615,41 +6621,41 @@ class ee extends H1 {
|
|
|
6615
6621
|
}
|
|
6616
6622
|
getResource(e, t, s) {
|
|
6617
6623
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
6618
|
-
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator,
|
|
6624
|
+
const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, h = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
6619
6625
|
let o;
|
|
6620
|
-
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) :
|
|
6621
|
-
const
|
|
6622
|
-
return !
|
|
6626
|
+
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], s && (Array.isArray(s) ? o.push(...s) : M(s) && a ? o.push(...s.split(a)) : o.push(s)));
|
|
6627
|
+
const g = M1(this.data, o);
|
|
6628
|
+
return !g && !t && !s && e.indexOf(".") > -1 && (e = o[0], t = o[1], s = o.slice(2).join(".")), g || !h || !M(s) ? g : Z1(this.data && this.data[e] && this.data[e][t], s, a);
|
|
6623
6629
|
}
|
|
6624
6630
|
addResource(e, t, s, n) {
|
|
6625
6631
|
let a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
6626
6632
|
silent: !1
|
|
6627
6633
|
};
|
|
6628
|
-
const
|
|
6634
|
+
const h = a.keySeparator !== void 0 ? a.keySeparator : this.options.keySeparator;
|
|
6629
6635
|
let o = [e, t];
|
|
6630
|
-
s && (o = o.concat(
|
|
6636
|
+
s && (o = o.concat(h ? s.split(h) : s)), e.indexOf(".") > -1 && (o = e.split("."), n = t, t = o[1]), this.addNamespaces(t), X1(this.data, o, n), a.silent || this.emit("added", e, t, s, n);
|
|
6631
6637
|
}
|
|
6632
6638
|
addResources(e, t, s) {
|
|
6633
6639
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
6634
6640
|
silent: !1
|
|
6635
6641
|
};
|
|
6636
6642
|
for (const a in s)
|
|
6637
|
-
(
|
|
6643
|
+
(M(s[a]) || Array.isArray(s[a])) && this.addResource(e, t, a, s[a], {
|
|
6638
6644
|
silent: !0
|
|
6639
6645
|
});
|
|
6640
6646
|
n.silent || this.emit("added", e, t, s);
|
|
6641
6647
|
}
|
|
6642
6648
|
addResourceBundle(e, t, s, n, a) {
|
|
6643
|
-
let
|
|
6649
|
+
let h = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
|
|
6644
6650
|
silent: !1,
|
|
6645
6651
|
skipCopy: !1
|
|
6646
6652
|
}, o = [e, t];
|
|
6647
6653
|
e.indexOf(".") > -1 && (o = e.split("."), n = s, s = t, t = o[1]), this.addNamespaces(t);
|
|
6648
|
-
let
|
|
6649
|
-
|
|
6650
|
-
...
|
|
6654
|
+
let g = M1(this.data, o) || {};
|
|
6655
|
+
h.skipCopy || (s = JSON.parse(JSON.stringify(s))), n ? me(g, s, a) : g = {
|
|
6656
|
+
...g,
|
|
6651
6657
|
...s
|
|
6652
|
-
}, X1(this.data, o,
|
|
6658
|
+
}, X1(this.data, o, g), h.silent || this.emit("added", e, t, s);
|
|
6653
6659
|
}
|
|
6654
6660
|
removeResourceBundle(e, t) {
|
|
6655
6661
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -6707,20 +6713,20 @@ class E1 extends H1 {
|
|
|
6707
6713
|
s === void 0 && (s = ":");
|
|
6708
6714
|
const n = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
6709
6715
|
let a = t.ns || this.options.defaultNS || [];
|
|
6710
|
-
const
|
|
6711
|
-
if (
|
|
6712
|
-
const
|
|
6713
|
-
if (
|
|
6716
|
+
const h = s && e.indexOf(s) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !mi(e, s, n);
|
|
6717
|
+
if (h && !o) {
|
|
6718
|
+
const g = e.match(this.interpolator.nestingRegexp);
|
|
6719
|
+
if (g && g.length > 0)
|
|
6714
6720
|
return {
|
|
6715
6721
|
key: e,
|
|
6716
|
-
namespaces:
|
|
6722
|
+
namespaces: M(a) ? [a] : a
|
|
6717
6723
|
};
|
|
6718
|
-
const
|
|
6719
|
-
(s !== n || s === n && this.options.ns.indexOf(
|
|
6724
|
+
const d = e.split(s);
|
|
6725
|
+
(s !== n || s === n && this.options.ns.indexOf(d[0]) > -1) && (a = d.shift()), e = d.join(n);
|
|
6720
6726
|
}
|
|
6721
6727
|
return {
|
|
6722
6728
|
key: e,
|
|
6723
|
-
namespaces:
|
|
6729
|
+
namespaces: M(a) ? [a] : a
|
|
6724
6730
|
};
|
|
6725
6731
|
}
|
|
6726
6732
|
translate(e, t, s) {
|
|
@@ -6729,67 +6735,67 @@ class E1 extends H1 {
|
|
|
6729
6735
|
}), t || (t = {}), e == null) return "";
|
|
6730
6736
|
Array.isArray(e) || (e = [String(e)]);
|
|
6731
6737
|
const n = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, a = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
|
|
6732
|
-
key:
|
|
6738
|
+
key: h,
|
|
6733
6739
|
namespaces: o
|
|
6734
|
-
} = this.extractFromKey(e[e.length - 1], t),
|
|
6735
|
-
if (
|
|
6740
|
+
} = this.extractFromKey(e[e.length - 1], t), g = o[o.length - 1], d = t.lng || this.language, l = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
6741
|
+
if (d && d.toLowerCase() === "cimode") {
|
|
6736
6742
|
if (l) {
|
|
6737
6743
|
const f = t.nsSeparator || this.options.nsSeparator;
|
|
6738
6744
|
return n ? {
|
|
6739
|
-
res: `${
|
|
6740
|
-
usedKey:
|
|
6741
|
-
exactUsedKey:
|
|
6742
|
-
usedLng:
|
|
6743
|
-
usedNS:
|
|
6745
|
+
res: `${g}${f}${h}`,
|
|
6746
|
+
usedKey: h,
|
|
6747
|
+
exactUsedKey: h,
|
|
6748
|
+
usedLng: d,
|
|
6749
|
+
usedNS: g,
|
|
6744
6750
|
usedParams: this.getUsedParamsDetails(t)
|
|
6745
|
-
} : `${
|
|
6751
|
+
} : `${g}${f}${h}`;
|
|
6746
6752
|
}
|
|
6747
6753
|
return n ? {
|
|
6748
|
-
res:
|
|
6749
|
-
usedKey:
|
|
6750
|
-
exactUsedKey:
|
|
6751
|
-
usedLng:
|
|
6752
|
-
usedNS:
|
|
6754
|
+
res: h,
|
|
6755
|
+
usedKey: h,
|
|
6756
|
+
exactUsedKey: h,
|
|
6757
|
+
usedLng: d,
|
|
6758
|
+
usedNS: g,
|
|
6753
6759
|
usedParams: this.getUsedParamsDetails(t)
|
|
6754
|
-
} :
|
|
6760
|
+
} : h;
|
|
6755
6761
|
}
|
|
6756
|
-
const
|
|
6757
|
-
let u =
|
|
6758
|
-
const p =
|
|
6759
|
-
if (
|
|
6762
|
+
const c = this.resolve(e, t);
|
|
6763
|
+
let u = c && c.res;
|
|
6764
|
+
const p = c && c.usedKey || h, w = c && c.exactUsedKey || h, k = Object.prototype.toString.apply(u), m = ["[object Number]", "[object Function]", "[object RegExp]"], _ = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, N = !this.i18nFormat || this.i18nFormat.handleAsObject, S = !M(u) && typeof u != "boolean" && typeof u != "number";
|
|
6765
|
+
if (N && u && S && m.indexOf(k) < 0 && !(M(_) && Array.isArray(u))) {
|
|
6760
6766
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
6761
6767
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
6762
6768
|
const f = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(p, u, {
|
|
6763
6769
|
...t,
|
|
6764
6770
|
ns: o
|
|
6765
|
-
}) : `key '${
|
|
6766
|
-
return n ? (
|
|
6771
|
+
}) : `key '${h} (${this.language})' returned an object instead of string.`;
|
|
6772
|
+
return n ? (c.res = f, c.usedParams = this.getUsedParamsDetails(t), c) : f;
|
|
6767
6773
|
}
|
|
6768
6774
|
if (a) {
|
|
6769
|
-
const f = Array.isArray(u),
|
|
6775
|
+
const f = Array.isArray(u), x = f ? [] : {}, R = f ? w : p;
|
|
6770
6776
|
for (const v in u)
|
|
6771
6777
|
if (Object.prototype.hasOwnProperty.call(u, v)) {
|
|
6772
|
-
const P = `${
|
|
6773
|
-
|
|
6778
|
+
const P = `${R}${a}${v}`;
|
|
6779
|
+
x[v] = this.translate(P, {
|
|
6774
6780
|
...t,
|
|
6775
6781
|
joinArrays: !1,
|
|
6776
6782
|
ns: o
|
|
6777
|
-
}),
|
|
6783
|
+
}), x[v] === P && (x[v] = u[v]);
|
|
6778
6784
|
}
|
|
6779
|
-
u =
|
|
6785
|
+
u = x;
|
|
6780
6786
|
}
|
|
6781
|
-
} else if (
|
|
6787
|
+
} else if (N && M(_) && Array.isArray(u))
|
|
6782
6788
|
u = u.join(_), u && (u = this.extendTranslation(u, e, t, s));
|
|
6783
6789
|
else {
|
|
6784
|
-
let f = !1,
|
|
6785
|
-
const
|
|
6790
|
+
let f = !1, x = !1;
|
|
6791
|
+
const R = t.count !== void 0 && !M(t.count), v = E1.hasDefaultValue(t), P = R ? this.pluralResolver.getSuffix(d, t.count, t) : "", J = t.ordinal && R ? this.pluralResolver.getSuffix(d, t.count, {
|
|
6786
6792
|
ordinal: !1
|
|
6787
|
-
}) : "", F =
|
|
6788
|
-
!this.isValidLookup(u) && v && (f = !0, u = H), this.isValidLookup(u) || (
|
|
6789
|
-
const I = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) &&
|
|
6790
|
-
if (
|
|
6791
|
-
if (this.logger.log(V ? "updateKey" : "missingKey",
|
|
6792
|
-
const O = this.resolve(
|
|
6793
|
+
}) : "", F = R && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), H = F && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${P}`] || t[`defaultValue${J}`] || t.defaultValue;
|
|
6794
|
+
!this.isValidLookup(u) && v && (f = !0, u = H), this.isValidLookup(u) || (x = !0, u = h);
|
|
6795
|
+
const I = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && x ? void 0 : u, V = v && H !== u && this.options.updateMissing;
|
|
6796
|
+
if (x || f || V) {
|
|
6797
|
+
if (this.logger.log(V ? "updateKey" : "missingKey", d, g, h, V ? H : u), a) {
|
|
6798
|
+
const O = this.resolve(h, {
|
|
6793
6799
|
...t,
|
|
6794
6800
|
keySeparator: !1
|
|
6795
6801
|
});
|
|
@@ -6803,21 +6809,21 @@ class E1 extends H1 {
|
|
|
6803
6809
|
else this.options.saveMissingTo === "all" ? Z = this.languageUtils.toResolveHierarchy(t.lng || this.language) : Z.push(t.lng || this.language);
|
|
6804
6810
|
const U = (O, K, G) => {
|
|
6805
6811
|
const e1 = v && G !== u ? G : I;
|
|
6806
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(O,
|
|
6812
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(O, g, K, e1, V, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(O, g, K, e1, V, t), this.emit("missingKey", O, g, K, u);
|
|
6807
6813
|
};
|
|
6808
|
-
this.options.saveMissing && (this.options.saveMissingPlurals &&
|
|
6814
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && R ? Z.forEach((O) => {
|
|
6809
6815
|
const K = this.pluralResolver.getSuffixes(O, t);
|
|
6810
6816
|
F && t[`defaultValue${this.options.pluralSeparator}zero`] && K.indexOf(`${this.options.pluralSeparator}zero`) < 0 && K.push(`${this.options.pluralSeparator}zero`), K.forEach((G) => {
|
|
6811
|
-
U([O],
|
|
6817
|
+
U([O], h + G, t[`defaultValue${G}`] || H);
|
|
6812
6818
|
});
|
|
6813
|
-
}) : U(Z,
|
|
6819
|
+
}) : U(Z, h, H));
|
|
6814
6820
|
}
|
|
6815
|
-
u = this.extendTranslation(u, e, t,
|
|
6821
|
+
u = this.extendTranslation(u, e, t, c, s), x && u === h && this.options.appendNamespaceToMissingKey && (u = `${g}:${h}`), (x || f) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${g}:${h}` : h, f ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
|
|
6816
6822
|
}
|
|
6817
|
-
return n ? (
|
|
6823
|
+
return n ? (c.res = u, c.usedParams = this.getUsedParamsDetails(t), c) : u;
|
|
6818
6824
|
}
|
|
6819
6825
|
extendTranslation(e, t, s, n, a) {
|
|
6820
|
-
var
|
|
6826
|
+
var h = this;
|
|
6821
6827
|
if (this.i18nFormat && this.i18nFormat.parse)
|
|
6822
6828
|
e = this.i18nFormat.parse(e, {
|
|
6823
6829
|
...this.options.interpolation.defaultVariables,
|
|
@@ -6833,28 +6839,28 @@ class E1 extends H1 {
|
|
|
6833
6839
|
...s.interpolation
|
|
6834
6840
|
}
|
|
6835
6841
|
});
|
|
6836
|
-
const
|
|
6842
|
+
const d = M(e) && (s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
6837
6843
|
let l;
|
|
6838
|
-
if (
|
|
6844
|
+
if (d) {
|
|
6839
6845
|
const u = e.match(this.interpolator.nestingRegexp);
|
|
6840
6846
|
l = u && u.length;
|
|
6841
6847
|
}
|
|
6842
|
-
let
|
|
6843
|
-
if (this.options.interpolation.defaultVariables && (
|
|
6848
|
+
let c = s.replace && !M(s.replace) ? s.replace : s;
|
|
6849
|
+
if (this.options.interpolation.defaultVariables && (c = {
|
|
6844
6850
|
...this.options.interpolation.defaultVariables,
|
|
6845
|
-
...
|
|
6846
|
-
}), e = this.interpolator.interpolate(e,
|
|
6851
|
+
...c
|
|
6852
|
+
}), e = this.interpolator.interpolate(e, c, s.lng || this.language || n.usedLng, s), d) {
|
|
6847
6853
|
const u = e.match(this.interpolator.nestingRegexp), p = u && u.length;
|
|
6848
6854
|
l < p && (s.nest = !1);
|
|
6849
6855
|
}
|
|
6850
6856
|
!s.lng && this.options.compatibilityAPI !== "v1" && n && n.res && (s.lng = this.language || n.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
6851
6857
|
for (var u = arguments.length, p = new Array(u), w = 0; w < u; w++)
|
|
6852
6858
|
p[w] = arguments[w];
|
|
6853
|
-
return a && a[0] === p[0] && !s.context ? (
|
|
6859
|
+
return a && a[0] === p[0] && !s.context ? (h.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`), null) : h.translate(...p, t);
|
|
6854
6860
|
}, s)), s.interpolation && this.interpolator.reset();
|
|
6855
6861
|
}
|
|
6856
|
-
const o = s.postProcess || this.options.postProcess,
|
|
6857
|
-
return e != null &&
|
|
6862
|
+
const o = s.postProcess || this.options.postProcess, g = M(o) ? [o] : o;
|
|
6863
|
+
return e != null && g && g.length && s.applyPostProcessor !== !1 && (e = we.handle(g, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
6858
6864
|
i18nResolved: {
|
|
6859
6865
|
...n,
|
|
6860
6866
|
usedParams: this.getUsedParamsDetails(s)
|
|
@@ -6863,32 +6869,32 @@ class E1 extends H1 {
|
|
|
6863
6869
|
} : s, this)), e;
|
|
6864
6870
|
}
|
|
6865
6871
|
resolve(e) {
|
|
6866
|
-
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, a,
|
|
6867
|
-
return
|
|
6872
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, a, h, o;
|
|
6873
|
+
return M(e) && (e = [e]), e.forEach((g) => {
|
|
6868
6874
|
if (this.isValidLookup(s)) return;
|
|
6869
|
-
const
|
|
6875
|
+
const d = this.extractFromKey(g, t), l = d.key;
|
|
6870
6876
|
n = l;
|
|
6871
|
-
let
|
|
6872
|
-
this.options.fallbackNS && (
|
|
6873
|
-
const u = t.count !== void 0 && !
|
|
6874
|
-
|
|
6877
|
+
let c = d.namespaces;
|
|
6878
|
+
this.options.fallbackNS && (c = c.concat(this.options.fallbackNS));
|
|
6879
|
+
const u = t.count !== void 0 && !M(t.count), p = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), w = t.context !== void 0 && (M(t.context) || typeof t.context == "number") && t.context !== "", k = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
6880
|
+
c.forEach((m) => {
|
|
6875
6881
|
this.isValidLookup(s) || (o = m, !te[`${k[0]}-${m}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(o) && (te[`${k[0]}-${m}`] = !0, this.logger.warn(`key "${n}" for languages "${k.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!!!")), k.forEach((_) => {
|
|
6876
6882
|
if (this.isValidLookup(s)) return;
|
|
6877
|
-
|
|
6878
|
-
const
|
|
6883
|
+
h = _;
|
|
6884
|
+
const N = [l];
|
|
6879
6885
|
if (this.i18nFormat && this.i18nFormat.addLookupKeys)
|
|
6880
|
-
this.i18nFormat.addLookupKeys(
|
|
6886
|
+
this.i18nFormat.addLookupKeys(N, l, _, m, t);
|
|
6881
6887
|
else {
|
|
6882
6888
|
let f;
|
|
6883
6889
|
u && (f = this.pluralResolver.getSuffix(_, t.count, t));
|
|
6884
|
-
const
|
|
6885
|
-
if (u && (
|
|
6890
|
+
const x = `${this.options.pluralSeparator}zero`, R = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
6891
|
+
if (u && (N.push(l + f), t.ordinal && f.indexOf(R) === 0 && N.push(l + f.replace(R, this.options.pluralSeparator)), p && N.push(l + x)), w) {
|
|
6886
6892
|
const v = `${l}${this.options.contextSeparator}${t.context}`;
|
|
6887
|
-
|
|
6893
|
+
N.push(v), u && (N.push(v + f), t.ordinal && f.indexOf(R) === 0 && N.push(v + f.replace(R, this.options.pluralSeparator)), p && N.push(v + x));
|
|
6888
6894
|
}
|
|
6889
6895
|
}
|
|
6890
6896
|
let S;
|
|
6891
|
-
for (; S =
|
|
6897
|
+
for (; S = N.pop(); )
|
|
6892
6898
|
this.isValidLookup(s) || (a = S, s = this.getResource(_, m, S, t));
|
|
6893
6899
|
}));
|
|
6894
6900
|
});
|
|
@@ -6896,7 +6902,7 @@ class E1 extends H1 {
|
|
|
6896
6902
|
res: s,
|
|
6897
6903
|
usedKey: n,
|
|
6898
6904
|
exactUsedKey: a,
|
|
6899
|
-
usedLng:
|
|
6905
|
+
usedLng: h,
|
|
6900
6906
|
usedNS: o
|
|
6901
6907
|
};
|
|
6902
6908
|
}
|
|
@@ -6909,7 +6915,7 @@ class E1 extends H1 {
|
|
|
6909
6915
|
}
|
|
6910
6916
|
getUsedParamsDetails() {
|
|
6911
6917
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
6912
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !
|
|
6918
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && !M(e.replace);
|
|
6913
6919
|
let n = s ? e.replace : e;
|
|
6914
6920
|
if (s && typeof e.count < "u" && (n.count = e.count), this.options.interpolation.defaultVariables && (n = {
|
|
6915
6921
|
...this.options.interpolation.defaultVariables,
|
|
@@ -6947,7 +6953,7 @@ class ie {
|
|
|
6947
6953
|
return this.formatLanguageCode(t[0]);
|
|
6948
6954
|
}
|
|
6949
6955
|
formatLanguageCode(e) {
|
|
6950
|
-
if (
|
|
6956
|
+
if (M(e) && e.indexOf("-") > -1) {
|
|
6951
6957
|
if (typeof Intl < "u" && typeof Intl.getCanonicalLocales < "u")
|
|
6952
6958
|
try {
|
|
6953
6959
|
let n = Intl.getCanonicalLocales(e)[0];
|
|
@@ -6983,17 +6989,17 @@ class ie {
|
|
|
6983
6989
|
}
|
|
6984
6990
|
getFallbackCodes(e, t) {
|
|
6985
6991
|
if (!e) return [];
|
|
6986
|
-
if (typeof e == "function" && (e = e(t)),
|
|
6992
|
+
if (typeof e == "function" && (e = e(t)), M(e) && (e = [e]), Array.isArray(e)) return e;
|
|
6987
6993
|
if (!t) return e.default || [];
|
|
6988
6994
|
let s = e[t];
|
|
6989
6995
|
return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
|
|
6990
6996
|
}
|
|
6991
6997
|
toResolveHierarchy(e, t) {
|
|
6992
|
-
const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), n = [], a = (
|
|
6993
|
-
|
|
6998
|
+
const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), n = [], a = (h) => {
|
|
6999
|
+
h && (this.isSupportedCode(h) ? n.push(h) : this.logger.warn(`rejecting language code not found in supportedLngs: ${h}`));
|
|
6994
7000
|
};
|
|
6995
|
-
return
|
|
6996
|
-
n.indexOf(
|
|
7001
|
+
return M(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && a(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && a(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && a(this.getLanguagePartFromCode(e))) : M(e) && a(this.formatLanguageCode(e)), s.forEach((h) => {
|
|
7002
|
+
n.indexOf(h) < 0 && a(this.formatLanguageCode(h));
|
|
6997
7003
|
}), n;
|
|
6998
7004
|
}
|
|
6999
7005
|
}
|
|
@@ -7151,17 +7157,17 @@ class Ri {
|
|
|
7151
7157
|
});
|
|
7152
7158
|
if (a in this.pluralRulesCache)
|
|
7153
7159
|
return this.pluralRulesCache[a];
|
|
7154
|
-
let
|
|
7160
|
+
let h;
|
|
7155
7161
|
try {
|
|
7156
|
-
|
|
7162
|
+
h = new Intl.PluralRules(s, {
|
|
7157
7163
|
type: n
|
|
7158
7164
|
});
|
|
7159
7165
|
} catch {
|
|
7160
7166
|
if (!e.match(/-|_/)) return;
|
|
7161
|
-
const
|
|
7162
|
-
|
|
7167
|
+
const g = this.languageUtils.getLanguagePartFromCode(e);
|
|
7168
|
+
h = this.getRule(g, t);
|
|
7163
7169
|
}
|
|
7164
|
-
return this.pluralRulesCache[a] =
|
|
7170
|
+
return this.pluralRulesCache[a] = h, h;
|
|
7165
7171
|
}
|
|
7166
7172
|
return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
|
|
7167
7173
|
}
|
|
@@ -7197,7 +7203,7 @@ class Ri {
|
|
|
7197
7203
|
}
|
|
7198
7204
|
const ne = function(i, e, t) {
|
|
7199
7205
|
let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = di(i, e, t);
|
|
7200
|
-
return !a && n &&
|
|
7206
|
+
return !a && n && M(t) && (a = Z1(i, t, s), a === void 0 && (a = Z1(e, t, s))), a;
|
|
7201
7207
|
}, S1 = (i) => i.replace(/\$/g, "$$$$");
|
|
7202
7208
|
class Mi {
|
|
7203
7209
|
constructor() {
|
|
@@ -7214,21 +7220,21 @@ class Mi {
|
|
|
7214
7220
|
escapeValue: s,
|
|
7215
7221
|
useRawValueToEscape: n,
|
|
7216
7222
|
prefix: a,
|
|
7217
|
-
prefixEscaped:
|
|
7223
|
+
prefixEscaped: h,
|
|
7218
7224
|
suffix: o,
|
|
7219
|
-
suffixEscaped:
|
|
7220
|
-
formatSeparator:
|
|
7225
|
+
suffixEscaped: g,
|
|
7226
|
+
formatSeparator: d,
|
|
7221
7227
|
unescapeSuffix: l,
|
|
7222
|
-
unescapePrefix:
|
|
7228
|
+
unescapePrefix: c,
|
|
7223
7229
|
nestingPrefix: u,
|
|
7224
7230
|
nestingPrefixEscaped: p,
|
|
7225
7231
|
nestingSuffix: w,
|
|
7226
7232
|
nestingSuffixEscaped: k,
|
|
7227
7233
|
nestingOptionsSeparator: m,
|
|
7228
7234
|
maxReplaces: _,
|
|
7229
|
-
alwaysFormat:
|
|
7235
|
+
alwaysFormat: N
|
|
7230
7236
|
} = e.interpolation;
|
|
7231
|
-
this.escape = t !== void 0 ? t : ui, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = a ?
|
|
7237
|
+
this.escape = t !== void 0 ? t : ui, this.escapeValue = s !== void 0 ? s : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = a ? c1(a) : h || "{{", this.suffix = o ? c1(o) : g || "}}", this.formatSeparator = d || ",", this.unescapePrefix = l ? "" : c || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = u ? c1(u) : p || c1("$t("), this.nestingSuffix = w ? c1(w) : k || c1(")"), this.nestingOptionsSeparator = m || ",", this.maxReplaces = _ || 1e3, this.alwaysFormat = N !== void 0 ? N : !1, this.resetRegExp();
|
|
7232
7238
|
}
|
|
7233
7239
|
reset() {
|
|
7234
7240
|
this.options && this.init(this.options);
|
|
@@ -7238,10 +7244,10 @@ class Mi {
|
|
|
7238
7244
|
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}`);
|
|
7239
7245
|
}
|
|
7240
7246
|
interpolate(e, t, s, n) {
|
|
7241
|
-
let a,
|
|
7242
|
-
const
|
|
7247
|
+
let a, h, o;
|
|
7248
|
+
const g = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, d = (p) => {
|
|
7243
7249
|
if (p.indexOf(this.formatSeparator) < 0) {
|
|
7244
|
-
const _ = ne(t,
|
|
7250
|
+
const _ = ne(t, g, p, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
7245
7251
|
return this.alwaysFormat ? this.format(_, void 0, s, {
|
|
7246
7252
|
...n,
|
|
7247
7253
|
...t,
|
|
@@ -7249,14 +7255,14 @@ class Mi {
|
|
|
7249
7255
|
}) : _;
|
|
7250
7256
|
}
|
|
7251
7257
|
const w = p.split(this.formatSeparator), k = w.shift().trim(), m = w.join(this.formatSeparator).trim();
|
|
7252
|
-
return this.format(ne(t,
|
|
7258
|
+
return this.format(ne(t, g, k, this.options.keySeparator, this.options.ignoreJSONStructure), m, s, {
|
|
7253
7259
|
...n,
|
|
7254
7260
|
...t,
|
|
7255
7261
|
interpolationkey: k
|
|
7256
7262
|
});
|
|
7257
7263
|
};
|
|
7258
7264
|
this.resetRegExp();
|
|
7259
|
-
const l = n && n.missingInterpolationHandler || this.options.missingInterpolationHandler,
|
|
7265
|
+
const l = n && n.missingInterpolationHandler || this.options.missingInterpolationHandler, c = n && n.interpolation && n.interpolation.skipOnVariables !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
7260
7266
|
return [{
|
|
7261
7267
|
regex: this.regexpUnescape,
|
|
7262
7268
|
safeValue: (p) => S1(p)
|
|
@@ -7266,56 +7272,56 @@ class Mi {
|
|
|
7266
7272
|
}].forEach((p) => {
|
|
7267
7273
|
for (o = 0; a = p.regex.exec(e); ) {
|
|
7268
7274
|
const w = a[1].trim();
|
|
7269
|
-
if (
|
|
7275
|
+
if (h = d(w), h === void 0)
|
|
7270
7276
|
if (typeof l == "function") {
|
|
7271
7277
|
const m = l(e, a, n);
|
|
7272
|
-
|
|
7278
|
+
h = M(m) ? m : "";
|
|
7273
7279
|
} else if (n && Object.prototype.hasOwnProperty.call(n, w))
|
|
7274
|
-
|
|
7275
|
-
else if (
|
|
7276
|
-
|
|
7280
|
+
h = "";
|
|
7281
|
+
else if (c) {
|
|
7282
|
+
h = a[0];
|
|
7277
7283
|
continue;
|
|
7278
7284
|
} else
|
|
7279
|
-
this.logger.warn(`missed to pass in variable ${w} for interpolating ${e}`),
|
|
7280
|
-
else !
|
|
7281
|
-
const k = p.safeValue(
|
|
7282
|
-
if (e = e.replace(a[0], k),
|
|
7285
|
+
this.logger.warn(`missed to pass in variable ${w} for interpolating ${e}`), h = "";
|
|
7286
|
+
else !M(h) && !this.useRawValueToEscape && (h = J1(h));
|
|
7287
|
+
const k = p.safeValue(h);
|
|
7288
|
+
if (e = e.replace(a[0], k), c ? (p.regex.lastIndex += h.length, p.regex.lastIndex -= a[0].length) : p.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
7283
7289
|
break;
|
|
7284
7290
|
}
|
|
7285
7291
|
}), e;
|
|
7286
7292
|
}
|
|
7287
7293
|
nest(e, t) {
|
|
7288
|
-
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, a,
|
|
7289
|
-
const o = (
|
|
7294
|
+
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, a, h;
|
|
7295
|
+
const o = (g, d) => {
|
|
7290
7296
|
const l = this.nestingOptionsSeparator;
|
|
7291
|
-
if (
|
|
7292
|
-
const
|
|
7293
|
-
let u = `{${
|
|
7294
|
-
|
|
7297
|
+
if (g.indexOf(l) < 0) return g;
|
|
7298
|
+
const c = g.split(new RegExp(`${l}[ ]*{`));
|
|
7299
|
+
let u = `{${c[1]}`;
|
|
7300
|
+
g = c[0], u = this.interpolate(u, h);
|
|
7295
7301
|
const p = u.match(/'/g), w = u.match(/"/g);
|
|
7296
7302
|
(p && p.length % 2 === 0 && !w || w.length % 2 !== 0) && (u = u.replace(/'/g, '"'));
|
|
7297
7303
|
try {
|
|
7298
|
-
|
|
7299
|
-
...
|
|
7300
|
-
...
|
|
7304
|
+
h = JSON.parse(u), d && (h = {
|
|
7305
|
+
...d,
|
|
7306
|
+
...h
|
|
7301
7307
|
});
|
|
7302
7308
|
} catch (k) {
|
|
7303
|
-
return this.logger.warn(`failed parsing options string in nesting for key ${
|
|
7309
|
+
return this.logger.warn(`failed parsing options string in nesting for key ${g}`, k), `${g}${l}${u}`;
|
|
7304
7310
|
}
|
|
7305
|
-
return
|
|
7311
|
+
return h.defaultValue && h.defaultValue.indexOf(this.prefix) > -1 && delete h.defaultValue, g;
|
|
7306
7312
|
};
|
|
7307
7313
|
for (; n = this.nestingRegexp.exec(e); ) {
|
|
7308
|
-
let
|
|
7309
|
-
|
|
7314
|
+
let g = [];
|
|
7315
|
+
h = {
|
|
7310
7316
|
...s
|
|
7311
|
-
},
|
|
7312
|
-
let
|
|
7317
|
+
}, h = h.replace && !M(h.replace) ? h.replace : h, h.applyPostProcessor = !1, delete h.defaultValue;
|
|
7318
|
+
let d = !1;
|
|
7313
7319
|
if (n[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(n[1])) {
|
|
7314
|
-
const l = n[1].split(this.formatSeparator).map((
|
|
7315
|
-
n[1] = l.shift(),
|
|
7320
|
+
const l = n[1].split(this.formatSeparator).map((c) => c.trim());
|
|
7321
|
+
n[1] = l.shift(), g = l, d = !0;
|
|
7316
7322
|
}
|
|
7317
|
-
if (a = t(o.call(this, n[1].trim(),
|
|
7318
|
-
|
|
7323
|
+
if (a = t(o.call(this, n[1].trim(), h), h), a && n[0] === e && !M(a)) return a;
|
|
7324
|
+
M(a) || (a = J1(a)), a || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), a = ""), d && (a = g.reduce((l, c) => this.format(l, c, s.lng, {
|
|
7319
7325
|
...s,
|
|
7320
7326
|
interpolationkey: n[1].trim()
|
|
7321
7327
|
}), a.trim())), e = e.replace(n[0], a), this.regexp.lastIndex = 0;
|
|
@@ -7330,10 +7336,10 @@ const bi = (i) => {
|
|
|
7330
7336
|
const s = i.split("(");
|
|
7331
7337
|
e = s[0].toLowerCase().trim();
|
|
7332
7338
|
const n = s[1].substring(0, s[1].length - 1);
|
|
7333
|
-
e === "currency" && n.indexOf(":") < 0 ? t.currency || (t.currency = n.trim()) : e === "relativetime" && n.indexOf(":") < 0 ? t.range || (t.range = n.trim()) : n.split(";").forEach((
|
|
7334
|
-
if (
|
|
7335
|
-
const [o, ...
|
|
7336
|
-
t[l] || (t[l] =
|
|
7339
|
+
e === "currency" && n.indexOf(":") < 0 ? t.currency || (t.currency = n.trim()) : e === "relativetime" && n.indexOf(":") < 0 ? t.range || (t.range = n.trim()) : n.split(";").forEach((h) => {
|
|
7340
|
+
if (h) {
|
|
7341
|
+
const [o, ...g] = h.split(":"), d = g.join(":").trim().replace(/^'+|'+$/g, ""), l = o.trim();
|
|
7342
|
+
t[l] || (t[l] = d), d === "false" && (t[l] = !1), d === "true" && (t[l] = !0), isNaN(d) || (t[l] = parseInt(d, 10));
|
|
7337
7343
|
}
|
|
7338
7344
|
});
|
|
7339
7345
|
}
|
|
@@ -7341,7 +7347,7 @@ const bi = (i) => {
|
|
|
7341
7347
|
formatName: e,
|
|
7342
7348
|
formatOptions: t
|
|
7343
7349
|
};
|
|
7344
|
-
},
|
|
7350
|
+
}, h1 = (i) => {
|
|
7345
7351
|
const e = {};
|
|
7346
7352
|
return (t, s, n) => {
|
|
7347
7353
|
let a = n;
|
|
@@ -7349,41 +7355,41 @@ const bi = (i) => {
|
|
|
7349
7355
|
...a,
|
|
7350
7356
|
[n.interpolationkey]: void 0
|
|
7351
7357
|
});
|
|
7352
|
-
const
|
|
7353
|
-
let o = e[
|
|
7354
|
-
return o || (o = i(b1(s), n), e[
|
|
7358
|
+
const h = s + JSON.stringify(a);
|
|
7359
|
+
let o = e[h];
|
|
7360
|
+
return o || (o = i(b1(s), n), e[h] = o), o(t);
|
|
7355
7361
|
};
|
|
7356
7362
|
};
|
|
7357
7363
|
class yi {
|
|
7358
7364
|
constructor() {
|
|
7359
7365
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7360
7366
|
this.logger = X.create("formatter"), this.options = e, this.formats = {
|
|
7361
|
-
number:
|
|
7367
|
+
number: h1((t, s) => {
|
|
7362
7368
|
const n = new Intl.NumberFormat(t, {
|
|
7363
7369
|
...s
|
|
7364
7370
|
});
|
|
7365
7371
|
return (a) => n.format(a);
|
|
7366
7372
|
}),
|
|
7367
|
-
currency:
|
|
7373
|
+
currency: h1((t, s) => {
|
|
7368
7374
|
const n = new Intl.NumberFormat(t, {
|
|
7369
7375
|
...s,
|
|
7370
7376
|
style: "currency"
|
|
7371
7377
|
});
|
|
7372
7378
|
return (a) => n.format(a);
|
|
7373
7379
|
}),
|
|
7374
|
-
datetime:
|
|
7380
|
+
datetime: h1((t, s) => {
|
|
7375
7381
|
const n = new Intl.DateTimeFormat(t, {
|
|
7376
7382
|
...s
|
|
7377
7383
|
});
|
|
7378
7384
|
return (a) => n.format(a);
|
|
7379
7385
|
}),
|
|
7380
|
-
relativetime:
|
|
7386
|
+
relativetime: h1((t, s) => {
|
|
7381
7387
|
const n = new Intl.RelativeTimeFormat(t, {
|
|
7382
7388
|
...s
|
|
7383
7389
|
});
|
|
7384
7390
|
return (a) => n.format(a, s.range || "day");
|
|
7385
7391
|
}),
|
|
7386
|
-
list:
|
|
7392
|
+
list: h1((t, s) => {
|
|
7387
7393
|
const n = new Intl.ListFormat(t, {
|
|
7388
7394
|
...s
|
|
7389
7395
|
});
|
|
@@ -7401,25 +7407,25 @@ class yi {
|
|
|
7401
7407
|
this.formats[e.toLowerCase().trim()] = t;
|
|
7402
7408
|
}
|
|
7403
7409
|
addCached(e, t) {
|
|
7404
|
-
this.formats[e.toLowerCase().trim()] =
|
|
7410
|
+
this.formats[e.toLowerCase().trim()] = h1(t);
|
|
7405
7411
|
}
|
|
7406
7412
|
format(e, t, s) {
|
|
7407
7413
|
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
7408
7414
|
const a = t.split(this.formatSeparator);
|
|
7409
7415
|
if (a.length > 1 && a[0].indexOf("(") > 1 && a[0].indexOf(")") < 0 && a.find((o) => o.indexOf(")") > -1)) {
|
|
7410
|
-
const o = a.findIndex((
|
|
7416
|
+
const o = a.findIndex((g) => g.indexOf(")") > -1);
|
|
7411
7417
|
a[0] = [a[0], ...a.splice(1, o)].join(this.formatSeparator);
|
|
7412
7418
|
}
|
|
7413
|
-
return a.reduce((o,
|
|
7419
|
+
return a.reduce((o, g) => {
|
|
7414
7420
|
const {
|
|
7415
|
-
formatName:
|
|
7421
|
+
formatName: d,
|
|
7416
7422
|
formatOptions: l
|
|
7417
|
-
} = bi(
|
|
7418
|
-
if (this.formats[
|
|
7419
|
-
let
|
|
7423
|
+
} = bi(g);
|
|
7424
|
+
if (this.formats[d]) {
|
|
7425
|
+
let c = o;
|
|
7420
7426
|
try {
|
|
7421
7427
|
const u = n && n.formatParams && n.formatParams[n.interpolationkey] || {}, p = u.locale || u.lng || n.locale || n.lng || s;
|
|
7422
|
-
|
|
7428
|
+
c = this.formats[d](o, p, {
|
|
7423
7429
|
...l,
|
|
7424
7430
|
...n,
|
|
7425
7431
|
...u
|
|
@@ -7427,9 +7433,9 @@ class yi {
|
|
|
7427
7433
|
} catch (u) {
|
|
7428
7434
|
this.logger.warn(u);
|
|
7429
7435
|
}
|
|
7430
|
-
return
|
|
7436
|
+
return c;
|
|
7431
7437
|
} else
|
|
7432
|
-
this.logger.warn(`there was no format function for ${
|
|
7438
|
+
this.logger.warn(`there was no format function for ${d}`);
|
|
7433
7439
|
return o;
|
|
7434
7440
|
}, e);
|
|
7435
7441
|
}
|
|
@@ -7443,45 +7449,45 @@ class _i extends H1 {
|
|
|
7443
7449
|
super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = X.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, n.backend, n);
|
|
7444
7450
|
}
|
|
7445
7451
|
queueLoad(e, t, s, n) {
|
|
7446
|
-
const a = {},
|
|
7447
|
-
return e.forEach((
|
|
7452
|
+
const a = {}, h = {}, o = {}, g = {};
|
|
7453
|
+
return e.forEach((d) => {
|
|
7448
7454
|
let l = !0;
|
|
7449
|
-
t.forEach((
|
|
7450
|
-
const u = `${
|
|
7451
|
-
!s.reload && this.store.hasResourceBundle(
|
|
7452
|
-
}), l || (o[
|
|
7453
|
-
}), (Object.keys(a).length || Object.keys(
|
|
7454
|
-
pending:
|
|
7455
|
-
pendingCount: Object.keys(
|
|
7455
|
+
t.forEach((c) => {
|
|
7456
|
+
const u = `${d}|${c}`;
|
|
7457
|
+
!s.reload && this.store.hasResourceBundle(d, c) ? this.state[u] = 2 : this.state[u] < 0 || (this.state[u] === 1 ? h[u] === void 0 && (h[u] = !0) : (this.state[u] = 1, l = !1, h[u] === void 0 && (h[u] = !0), a[u] === void 0 && (a[u] = !0), g[c] === void 0 && (g[c] = !0)));
|
|
7458
|
+
}), l || (o[d] = !0);
|
|
7459
|
+
}), (Object.keys(a).length || Object.keys(h).length) && this.queue.push({
|
|
7460
|
+
pending: h,
|
|
7461
|
+
pendingCount: Object.keys(h).length,
|
|
7456
7462
|
loaded: {},
|
|
7457
7463
|
errors: [],
|
|
7458
7464
|
callback: n
|
|
7459
7465
|
}), {
|
|
7460
7466
|
toLoad: Object.keys(a),
|
|
7461
|
-
pending: Object.keys(
|
|
7467
|
+
pending: Object.keys(h),
|
|
7462
7468
|
toLoadLanguages: Object.keys(o),
|
|
7463
|
-
toLoadNamespaces: Object.keys(
|
|
7469
|
+
toLoadNamespaces: Object.keys(g)
|
|
7464
7470
|
};
|
|
7465
7471
|
}
|
|
7466
7472
|
loaded(e, t, s) {
|
|
7467
|
-
const n = e.split("|"), a = n[0],
|
|
7468
|
-
t && this.emit("failedLoading", a,
|
|
7473
|
+
const n = e.split("|"), a = n[0], h = n[1];
|
|
7474
|
+
t && this.emit("failedLoading", a, h, t), !t && s && this.store.addResourceBundle(a, h, s, void 0, void 0, {
|
|
7469
7475
|
skipCopy: !0
|
|
7470
7476
|
}), this.state[e] = t ? -1 : 2, t && s && (this.state[e] = 0);
|
|
7471
7477
|
const o = {};
|
|
7472
|
-
this.queue.forEach((
|
|
7473
|
-
|
|
7474
|
-
o[
|
|
7475
|
-
const l =
|
|
7476
|
-
l.length && l.forEach((
|
|
7477
|
-
o[
|
|
7478
|
+
this.queue.forEach((g) => {
|
|
7479
|
+
hi(g.loaded, [a], h), Ei(g, e), t && g.errors.push(t), g.pendingCount === 0 && !g.done && (Object.keys(g.loaded).forEach((d) => {
|
|
7480
|
+
o[d] || (o[d] = {});
|
|
7481
|
+
const l = g.loaded[d];
|
|
7482
|
+
l.length && l.forEach((c) => {
|
|
7483
|
+
o[d][c] === void 0 && (o[d][c] = !0);
|
|
7478
7484
|
});
|
|
7479
|
-
}),
|
|
7480
|
-
}), this.emit("loaded", o), this.queue = this.queue.filter((
|
|
7485
|
+
}), g.done = !0, g.errors.length ? g.callback(g.errors) : g.callback());
|
|
7486
|
+
}), this.emit("loaded", o), this.queue = this.queue.filter((g) => !g.done);
|
|
7481
7487
|
}
|
|
7482
7488
|
read(e, t, s) {
|
|
7483
|
-
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout,
|
|
7484
|
-
if (!e.length) return
|
|
7489
|
+
let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, h = arguments.length > 5 ? arguments[5] : void 0;
|
|
7490
|
+
if (!e.length) return h(null, {});
|
|
7485
7491
|
if (this.readingCalls >= this.maxParallelReads) {
|
|
7486
7492
|
this.waitingReads.push({
|
|
7487
7493
|
lng: e,
|
|
@@ -7489,45 +7495,45 @@ class _i extends H1 {
|
|
|
7489
7495
|
fcName: s,
|
|
7490
7496
|
tried: n,
|
|
7491
7497
|
wait: a,
|
|
7492
|
-
callback:
|
|
7498
|
+
callback: h
|
|
7493
7499
|
});
|
|
7494
7500
|
return;
|
|
7495
7501
|
}
|
|
7496
7502
|
this.readingCalls++;
|
|
7497
|
-
const o = (
|
|
7503
|
+
const o = (d, l) => {
|
|
7498
7504
|
if (this.readingCalls--, this.waitingReads.length > 0) {
|
|
7499
|
-
const
|
|
7500
|
-
this.read(
|
|
7505
|
+
const c = this.waitingReads.shift();
|
|
7506
|
+
this.read(c.lng, c.ns, c.fcName, c.tried, c.wait, c.callback);
|
|
7501
7507
|
}
|
|
7502
|
-
if (
|
|
7508
|
+
if (d && l && n < this.maxRetries) {
|
|
7503
7509
|
setTimeout(() => {
|
|
7504
|
-
this.read.call(this, e, t, s, n + 1, a * 2,
|
|
7510
|
+
this.read.call(this, e, t, s, n + 1, a * 2, h);
|
|
7505
7511
|
}, a);
|
|
7506
7512
|
return;
|
|
7507
7513
|
}
|
|
7508
|
-
|
|
7509
|
-
},
|
|
7510
|
-
if (
|
|
7514
|
+
h(d, l);
|
|
7515
|
+
}, g = this.backend[s].bind(this.backend);
|
|
7516
|
+
if (g.length === 2) {
|
|
7511
7517
|
try {
|
|
7512
|
-
const
|
|
7513
|
-
|
|
7514
|
-
} catch (
|
|
7515
|
-
o(
|
|
7518
|
+
const d = g(e, t);
|
|
7519
|
+
d && typeof d.then == "function" ? d.then((l) => o(null, l)).catch(o) : o(null, d);
|
|
7520
|
+
} catch (d) {
|
|
7521
|
+
o(d);
|
|
7516
7522
|
}
|
|
7517
7523
|
return;
|
|
7518
7524
|
}
|
|
7519
|
-
return
|
|
7525
|
+
return g(e, t, o);
|
|
7520
7526
|
}
|
|
7521
7527
|
prepareLoading(e, t) {
|
|
7522
7528
|
let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = arguments.length > 3 ? arguments[3] : void 0;
|
|
7523
7529
|
if (!this.backend)
|
|
7524
7530
|
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), n && n();
|
|
7525
|
-
|
|
7531
|
+
M(e) && (e = this.languageUtils.toResolveHierarchy(e)), M(t) && (t = [t]);
|
|
7526
7532
|
const a = this.queueLoad(e, t, s, n);
|
|
7527
7533
|
if (!a.toLoad.length)
|
|
7528
7534
|
return a.pending.length || n(), null;
|
|
7529
|
-
a.toLoad.forEach((
|
|
7530
|
-
this.loadOne(
|
|
7535
|
+
a.toLoad.forEach((h) => {
|
|
7536
|
+
this.loadOne(h);
|
|
7531
7537
|
});
|
|
7532
7538
|
}
|
|
7533
7539
|
load(e, t, s) {
|
|
@@ -7541,12 +7547,12 @@ class _i extends H1 {
|
|
|
7541
7547
|
loadOne(e) {
|
|
7542
7548
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
7543
7549
|
const s = e.split("|"), n = s[0], a = s[1];
|
|
7544
|
-
this.read(n, a, "read", void 0, void 0, (
|
|
7545
|
-
|
|
7550
|
+
this.read(n, a, "read", void 0, void 0, (h, o) => {
|
|
7551
|
+
h && this.logger.warn(`${t}loading namespace ${a} for language ${n} failed`, h), !h && o && this.logger.log(`${t}loaded namespace ${a} for language ${n}`, o), this.loaded(e, h, o);
|
|
7546
7552
|
});
|
|
7547
7553
|
}
|
|
7548
7554
|
saveMissing(e, t, s, n, a) {
|
|
7549
|
-
let
|
|
7555
|
+
let h = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
|
|
7550
7556
|
};
|
|
7551
7557
|
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t)) {
|
|
7552
7558
|
this.logger.warn(`did not save key "${s}" 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!!!");
|
|
@@ -7554,19 +7560,19 @@ class _i extends H1 {
|
|
|
7554
7560
|
}
|
|
7555
7561
|
if (!(s == null || s === "")) {
|
|
7556
7562
|
if (this.backend && this.backend.create) {
|
|
7557
|
-
const
|
|
7558
|
-
...
|
|
7563
|
+
const g = {
|
|
7564
|
+
...h,
|
|
7559
7565
|
isUpdate: a
|
|
7560
|
-
},
|
|
7561
|
-
if (
|
|
7566
|
+
}, d = this.backend.create.bind(this.backend);
|
|
7567
|
+
if (d.length < 6)
|
|
7562
7568
|
try {
|
|
7563
7569
|
let l;
|
|
7564
|
-
|
|
7570
|
+
d.length === 5 ? l = d(e, t, s, n, g) : l = d(e, t, s, n), l && typeof l.then == "function" ? l.then((c) => o(null, c)).catch(o) : o(null, l);
|
|
7565
7571
|
} catch (l) {
|
|
7566
7572
|
o(l);
|
|
7567
7573
|
}
|
|
7568
7574
|
else
|
|
7569
|
-
|
|
7575
|
+
d(e, t, s, n, o, g);
|
|
7570
7576
|
}
|
|
7571
7577
|
!e || !e[0] || this.store.addResource(e[0], t, s, n);
|
|
7572
7578
|
}
|
|
@@ -7607,7 +7613,7 @@ const re = () => ({
|
|
|
7607
7613
|
appendNamespaceToCIMode: !1,
|
|
7608
7614
|
overloadTranslationOptionHandler: (i) => {
|
|
7609
7615
|
let e = {};
|
|
7610
|
-
if (typeof i[1] == "object" && (e = i[1]),
|
|
7616
|
+
if (typeof i[1] == "object" && (e = i[1]), M(i[1]) && (e.defaultValue = i[1]), M(i[2]) && (e.tDescription = i[2]), typeof i[2] == "object" || typeof i[3] == "object") {
|
|
7611
7617
|
const t = i[3] || i[2];
|
|
7612
7618
|
Object.keys(t).forEach((s) => {
|
|
7613
7619
|
e[s] = t[s];
|
|
@@ -7628,7 +7634,7 @@ const re = () => ({
|
|
|
7628
7634
|
maxReplaces: 1e3,
|
|
7629
7635
|
skipOnVariables: !0
|
|
7630
7636
|
}
|
|
7631
|
-
}), oe = (i) => (
|
|
7637
|
+
}), oe = (i) => (M(i.ns) && (i.ns = [i.ns]), M(i.fallbackLng) && (i.fallbackLng = [i.fallbackLng]), M(i.fallbackNS) && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i), x1 = () => {
|
|
7632
7638
|
}, Hi = (i) => {
|
|
7633
7639
|
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
7634
7640
|
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
@@ -7650,7 +7656,7 @@ class w1 extends H1 {
|
|
|
7650
7656
|
init() {
|
|
7651
7657
|
var e = this;
|
|
7652
7658
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
|
|
7653
|
-
this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (
|
|
7659
|
+
this.isInitializing = !0, typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (M(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
7654
7660
|
const n = re();
|
|
7655
7661
|
this.options = {
|
|
7656
7662
|
...n,
|
|
@@ -7665,10 +7671,10 @@ class w1 extends H1 {
|
|
|
7665
7671
|
this.modules.logger ? X.init(a(this.modules.logger), this.options) : X.init(null, this.options);
|
|
7666
7672
|
let l;
|
|
7667
7673
|
this.modules.formatter ? l = this.modules.formatter : typeof Intl < "u" && (l = yi);
|
|
7668
|
-
const
|
|
7674
|
+
const c = new ie(this.options);
|
|
7669
7675
|
this.store = new ee(this.options.resources, this.options);
|
|
7670
7676
|
const u = this.services;
|
|
7671
|
-
u.logger = X, u.resourceStore = this.store, u.languageUtils =
|
|
7677
|
+
u.logger = X, u.resourceStore = this.store, u.languageUtils = c, u.pluralResolver = new Ri(c, {
|
|
7672
7678
|
prepend: this.options.pluralSeparator,
|
|
7673
7679
|
compatibilityJSON: this.options.compatibilityJSON,
|
|
7674
7680
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
@@ -7699,27 +7705,27 @@ class w1 extends H1 {
|
|
|
7699
7705
|
return e.store[l](...arguments), e;
|
|
7700
7706
|
};
|
|
7701
7707
|
});
|
|
7702
|
-
const
|
|
7703
|
-
const l = (
|
|
7704
|
-
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options),
|
|
7708
|
+
const g = C1(), d = () => {
|
|
7709
|
+
const l = (c, u) => {
|
|
7710
|
+
this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), g.resolve(u), s(c, u);
|
|
7705
7711
|
};
|
|
7706
7712
|
if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return l(null, this.t.bind(this));
|
|
7707
7713
|
this.changeLanguage(this.options.lng, l);
|
|
7708
7714
|
};
|
|
7709
|
-
return this.options.resources || !this.options.initImmediate ?
|
|
7715
|
+
return this.options.resources || !this.options.initImmediate ? d() : setTimeout(d, 0), g;
|
|
7710
7716
|
}
|
|
7711
7717
|
loadResources(e) {
|
|
7712
7718
|
let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x1;
|
|
7713
|
-
const n =
|
|
7719
|
+
const n = M(e) ? e : this.language;
|
|
7714
7720
|
if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
7715
7721
|
if (n && n.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return s();
|
|
7716
|
-
const a = [],
|
|
7722
|
+
const a = [], h = (o) => {
|
|
7717
7723
|
if (!o || o === "cimode") return;
|
|
7718
|
-
this.services.languageUtils.toResolveHierarchy(o).forEach((
|
|
7719
|
-
|
|
7724
|
+
this.services.languageUtils.toResolveHierarchy(o).forEach((d) => {
|
|
7725
|
+
d !== "cimode" && a.indexOf(d) < 0 && a.push(d);
|
|
7720
7726
|
});
|
|
7721
7727
|
};
|
|
7722
|
-
n ?
|
|
7728
|
+
n ? h(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((g) => h(g)), this.options.preload && this.options.preload.forEach((o) => h(o)), this.services.backendConnector.load(a, this.options.ns, (o) => {
|
|
7723
7729
|
!o && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), s(o);
|
|
7724
7730
|
});
|
|
7725
7731
|
} else
|
|
@@ -7751,41 +7757,41 @@ class w1 extends H1 {
|
|
|
7751
7757
|
this.isLanguageChangingTo = e;
|
|
7752
7758
|
const n = C1();
|
|
7753
7759
|
this.emit("languageChanging", e);
|
|
7754
|
-
const a = (
|
|
7755
|
-
this.language =
|
|
7756
|
-
},
|
|
7757
|
-
|
|
7760
|
+
const a = (g) => {
|
|
7761
|
+
this.language = g, this.languages = this.services.languageUtils.toResolveHierarchy(g), this.resolvedLanguage = void 0, this.setResolvedLanguage(g);
|
|
7762
|
+
}, h = (g, d) => {
|
|
7763
|
+
d ? (a(d), this.translator.changeLanguage(d), this.isLanguageChangingTo = void 0, this.emit("languageChanged", d), this.logger.log("languageChanged", d)) : this.isLanguageChangingTo = void 0, n.resolve(function() {
|
|
7758
7764
|
return s.t(...arguments);
|
|
7759
|
-
}), t && t(
|
|
7765
|
+
}), t && t(g, function() {
|
|
7760
7766
|
return s.t(...arguments);
|
|
7761
7767
|
});
|
|
7762
|
-
}, o = (
|
|
7763
|
-
!e && !
|
|
7764
|
-
const
|
|
7765
|
-
|
|
7766
|
-
|
|
7768
|
+
}, o = (g) => {
|
|
7769
|
+
!e && !g && this.services.languageDetector && (g = []);
|
|
7770
|
+
const d = M(g) ? g : this.services.languageUtils.getBestMatchFromCodes(g);
|
|
7771
|
+
d && (this.language || a(d), this.translator.language || this.translator.changeLanguage(d), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(d)), this.loadResources(d, (l) => {
|
|
7772
|
+
h(l, d);
|
|
7767
7773
|
});
|
|
7768
7774
|
};
|
|
7769
7775
|
return !e && this.services.languageDetector && !this.services.languageDetector.async ? o(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(o) : this.services.languageDetector.detect(o) : o(e), n;
|
|
7770
7776
|
}
|
|
7771
7777
|
getFixedT(e, t, s) {
|
|
7772
7778
|
var n = this;
|
|
7773
|
-
const a = function(
|
|
7774
|
-
let
|
|
7779
|
+
const a = function(h, o) {
|
|
7780
|
+
let g;
|
|
7775
7781
|
if (typeof o != "object") {
|
|
7776
|
-
for (var
|
|
7777
|
-
l[
|
|
7778
|
-
|
|
7782
|
+
for (var d = arguments.length, l = new Array(d > 2 ? d - 2 : 0), c = 2; c < d; c++)
|
|
7783
|
+
l[c - 2] = arguments[c];
|
|
7784
|
+
g = n.options.overloadTranslationOptionHandler([h, o].concat(l));
|
|
7779
7785
|
} else
|
|
7780
|
-
|
|
7786
|
+
g = {
|
|
7781
7787
|
...o
|
|
7782
7788
|
};
|
|
7783
|
-
|
|
7789
|
+
g.lng = g.lng || a.lng, g.lngs = g.lngs || a.lngs, g.ns = g.ns || a.ns, g.keyPrefix !== "" && (g.keyPrefix = g.keyPrefix || s || a.keyPrefix);
|
|
7784
7790
|
const u = n.options.keySeparator || ".";
|
|
7785
7791
|
let p;
|
|
7786
|
-
return
|
|
7792
|
+
return g.keyPrefix && Array.isArray(h) ? p = h.map((w) => `${g.keyPrefix}${u}${w}`) : p = g.keyPrefix ? `${g.keyPrefix}${u}${h}` : h, n.t(p, g);
|
|
7787
7793
|
};
|
|
7788
|
-
return
|
|
7794
|
+
return M(e) ? a.lng = e : a.lngs = e, a.ns = t, a.keyPrefix = s, a;
|
|
7789
7795
|
}
|
|
7790
7796
|
t() {
|
|
7791
7797
|
return this.translator && this.translator.translate(...arguments);
|
|
@@ -7804,19 +7810,19 @@ class w1 extends H1 {
|
|
|
7804
7810
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
7805
7811
|
const s = t.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, a = this.languages[this.languages.length - 1];
|
|
7806
7812
|
if (s.toLowerCase() === "cimode") return !0;
|
|
7807
|
-
const
|
|
7808
|
-
const
|
|
7809
|
-
return
|
|
7813
|
+
const h = (o, g) => {
|
|
7814
|
+
const d = this.services.backendConnector.state[`${o}|${g}`];
|
|
7815
|
+
return d === -1 || d === 0 || d === 2;
|
|
7810
7816
|
};
|
|
7811
7817
|
if (t.precheck) {
|
|
7812
|
-
const o = t.precheck(this,
|
|
7818
|
+
const o = t.precheck(this, h);
|
|
7813
7819
|
if (o !== void 0) return o;
|
|
7814
7820
|
}
|
|
7815
|
-
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages ||
|
|
7821
|
+
return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || h(s, e) && (!n || h(a, e)));
|
|
7816
7822
|
}
|
|
7817
7823
|
loadNamespaces(e, t) {
|
|
7818
7824
|
const s = C1();
|
|
7819
|
-
return this.options.ns ? (
|
|
7825
|
+
return this.options.ns ? (M(e) && (e = [e]), e.forEach((n) => {
|
|
7820
7826
|
this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
|
|
7821
7827
|
}), this.loadResources((n) => {
|
|
7822
7828
|
s.resolve(), t && t(n);
|
|
@@ -7824,10 +7830,10 @@ class w1 extends H1 {
|
|
|
7824
7830
|
}
|
|
7825
7831
|
loadLanguages(e, t) {
|
|
7826
7832
|
const s = C1();
|
|
7827
|
-
|
|
7828
|
-
const n = this.options.preload || [], a = e.filter((
|
|
7829
|
-
return a.length ? (this.options.preload = n.concat(a), this.loadResources((
|
|
7830
|
-
s.resolve(), t && t(
|
|
7833
|
+
M(e) && (e = [e]);
|
|
7834
|
+
const n = this.options.preload || [], a = e.filter((h) => n.indexOf(h) < 0 && this.services.languageUtils.isSupportedCode(h));
|
|
7835
|
+
return a.length ? (this.options.preload = n.concat(a), this.loadResources((h) => {
|
|
7836
|
+
s.resolve(), t && t(h);
|
|
7831
7837
|
}), s) : (t && t(), Promise.resolve());
|
|
7832
7838
|
}
|
|
7833
7839
|
dir(e) {
|
|
@@ -7855,9 +7861,9 @@ class w1 extends H1 {
|
|
|
7855
7861
|
}, a.services.utils = {
|
|
7856
7862
|
hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
|
|
7857
7863
|
}, s && (a.store = new ee(this.store.data, n), a.services.resourceStore = a.store), a.translator = new E1(a.services, n), a.translator.on("*", function(o) {
|
|
7858
|
-
for (var
|
|
7859
|
-
|
|
7860
|
-
a.emit(o, ...
|
|
7864
|
+
for (var g = arguments.length, d = new Array(g > 1 ? g - 1 : 0), l = 1; l < g; l++)
|
|
7865
|
+
d[l - 1] = arguments[l];
|
|
7866
|
+
a.emit(o, ...d);
|
|
7861
7867
|
}), a.init(n, t), a.translator.options = n, a.translator.backendConnector.services.utils = {
|
|
7862
7868
|
hasLoadedNamespace: a.hasLoadedNamespace.bind(a)
|
|
7863
7869
|
}, a;
|
|
@@ -7915,20 +7921,20 @@ const Ki = k1(
|
|
|
7915
7921
|
disabled: s,
|
|
7916
7922
|
value: n,
|
|
7917
7923
|
onChange: a,
|
|
7918
|
-
onError:
|
|
7924
|
+
onError: h,
|
|
7919
7925
|
allowEmpty: o = !1,
|
|
7920
|
-
showAvatar:
|
|
7921
|
-
clearable:
|
|
7926
|
+
showAvatar: g = !1,
|
|
7927
|
+
clearable: d,
|
|
7922
7928
|
required: l,
|
|
7923
|
-
error:
|
|
7929
|
+
error: c
|
|
7924
7930
|
}, u) => {
|
|
7925
|
-
const { axiosPeople: p, locale: w } = r1(_e), { t: k } = ai("common", { lng: w }), [m, _] = T([]), [
|
|
7926
|
-
if (_1(u, () =>
|
|
7931
|
+
const { axiosPeople: p, locale: w } = r1(_e), { t: k } = ai("common", { lng: w }), [m, _] = T([]), [N, S] = T(!0), f = q(m), x = q(null);
|
|
7932
|
+
if (_1(u, () => x.current), !p)
|
|
7927
7933
|
throw new Error(
|
|
7928
7934
|
`UserSelect requires "axiosPeople" to fetch users.
|
|
7929
7935
|
Please provide it via SNMTUiContext.`
|
|
7930
7936
|
);
|
|
7931
|
-
const
|
|
7937
|
+
const R = $(
|
|
7932
7938
|
(H) => {
|
|
7933
7939
|
let D = "";
|
|
7934
7940
|
return H.deletedAt && (D += `[${k("deleted")}] `), H.status === R1.ARCHIVED && (D += `[${k("archived")}] `), `${D}${H.firstName} ${H.lastName}`;
|
|
@@ -7952,13 +7958,13 @@ const Ki = k1(
|
|
|
7952
7958
|
return {
|
|
7953
7959
|
options: O.map((G) => ({
|
|
7954
7960
|
value: G.id,
|
|
7955
|
-
label:
|
|
7956
|
-
image:
|
|
7961
|
+
label: R(G),
|
|
7962
|
+
image: g ? G.avatarUrl : void 0
|
|
7957
7963
|
})),
|
|
7958
7964
|
count: K.count
|
|
7959
7965
|
};
|
|
7960
7966
|
} catch (U) {
|
|
7961
|
-
return
|
|
7967
|
+
return h && h({
|
|
7962
7968
|
status: ((V = U.response) == null ? void 0 : V.status) ?? 500,
|
|
7963
7969
|
message: ((W = (Z = U.response) == null ? void 0 : Z.data) == null ? void 0 : W.message) ?? "Error while fetching options"
|
|
7964
7970
|
}), {
|
|
@@ -7967,7 +7973,7 @@ const Ki = k1(
|
|
|
7967
7973
|
};
|
|
7968
7974
|
}
|
|
7969
7975
|
},
|
|
7970
|
-
[p, i,
|
|
7976
|
+
[p, i, R, g, h]
|
|
7971
7977
|
), P = $(
|
|
7972
7978
|
async (H) => {
|
|
7973
7979
|
var D, I, V;
|
|
@@ -7984,24 +7990,24 @@ const Ki = k1(
|
|
|
7984
7990
|
})).data.data);
|
|
7985
7991
|
const U = W.map((O) => ({
|
|
7986
7992
|
value: O.id,
|
|
7987
|
-
label:
|
|
7988
|
-
image:
|
|
7993
|
+
label: R(O),
|
|
7994
|
+
image: g ? O.avatarUrl : void 0
|
|
7989
7995
|
}));
|
|
7990
7996
|
return [...f.current, ...U];
|
|
7991
7997
|
} catch (Z) {
|
|
7992
|
-
return
|
|
7998
|
+
return h && h({
|
|
7993
7999
|
status: ((D = Z.response) == null ? void 0 : D.status) ?? 500,
|
|
7994
8000
|
message: ((V = (I = Z.response) == null ? void 0 : I.data) == null ? void 0 : V.message) ?? "Error while fetching selected items"
|
|
7995
8001
|
}), [];
|
|
7996
8002
|
}
|
|
7997
8003
|
},
|
|
7998
|
-
[p,
|
|
8004
|
+
[p, R, h, g]
|
|
7999
8005
|
);
|
|
8000
8006
|
j(() => {
|
|
8001
8007
|
f.current = m;
|
|
8002
8008
|
}, [m]), j(() => {
|
|
8003
8009
|
var H;
|
|
8004
|
-
(H =
|
|
8010
|
+
(H = x.current) == null || H.refetchOptions();
|
|
8005
8011
|
}, [i]), j(() => {
|
|
8006
8012
|
if (!n) {
|
|
8007
8013
|
S(!1);
|
|
@@ -8032,15 +8038,15 @@ const Ki = k1(
|
|
|
8032
8038
|
},
|
|
8033
8039
|
[o, v]
|
|
8034
8040
|
);
|
|
8035
|
-
if (
|
|
8041
|
+
if (N)
|
|
8036
8042
|
return /* @__PURE__ */ r(K5, {});
|
|
8037
8043
|
const F = {
|
|
8038
|
-
ref:
|
|
8044
|
+
ref: x,
|
|
8039
8045
|
placeholder: t,
|
|
8040
8046
|
disabled: s,
|
|
8041
|
-
clearable:
|
|
8047
|
+
clearable: d,
|
|
8042
8048
|
required: l,
|
|
8043
|
-
error:
|
|
8049
|
+
error: c
|
|
8044
8050
|
};
|
|
8045
8051
|
return e ? /* @__PURE__ */ r(
|
|
8046
8052
|
F1,
|