@nemme/js-sdk 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/dist/assets/js-sdk.css +1 -1
- package/dist/client.d.ts +4 -1
- package/dist/deliveries/delivery-manager.d.ts +4 -3
- package/dist/forms/form-manager.d.ts +9 -4
- package/dist/forms/form-wrapper/form-wrapper.d.ts +1 -0
- package/dist/forms/question-choice/question-choice.d.ts +2 -0
- package/dist/forms/question-text/question-text.d.ts +2 -0
- package/dist/forms/question-wrapper.d.ts +2 -0
- package/dist/forms/transition-end/transition-end.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1255 -1246
- package/dist/index.esm.js.map +1 -1
- package/dist/nemme-sdk.umd.js +5 -5
- package/dist/nemme-sdk.umd.js.map +1 -1
- package/dist/tracking/tracking-manager.d.ts +3 -1
- package/dist/translations/en.json.d.ts +2 -0
- package/package.json +14 -17
- package/dist/forms/form.d.ts +0 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,54 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import It from "react-dom";
|
|
7
|
-
var le = {}, Fe;
|
|
8
|
-
function Ht() {
|
|
9
|
-
if (Fe) return le;
|
|
10
|
-
Fe = 1;
|
|
11
|
-
var i = It;
|
|
12
|
-
return le.createRoot = i.createRoot, le.hydrateRoot = i.hydrateRoot, le;
|
|
13
|
-
}
|
|
14
|
-
var Bt = Ht();
|
|
15
|
-
const qt = (i, e, t, n) => {
|
|
16
|
-
var s, a, o, c;
|
|
17
|
-
const r = [t, {
|
|
1
|
+
import * as g from "react";
|
|
2
|
+
import rt, { createContext as Se, useContext as st, useCallback as K, useState as X, useRef as at, useEffect as oe, useMemo as $t, createElement as pe } from "react";
|
|
3
|
+
import { createRoot as Rt } from "react-dom/client";
|
|
4
|
+
const Ft = (r, e, t, n) => {
|
|
5
|
+
const i = [t, {
|
|
18
6
|
code: e,
|
|
19
7
|
...n || {}
|
|
20
8
|
}];
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
if (
|
|
9
|
+
if (r?.services?.logger?.forward)
|
|
10
|
+
return r.services.logger.forward(i, "warn", "react-i18next::", !0);
|
|
11
|
+
B(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), r?.services?.logger?.warn ? r.services.logger.warn(...i) : console?.warn && console.warn(...i);
|
|
12
|
+
}, je = {}, me = (r, e, t, n) => {
|
|
13
|
+
B(t) && je[t] || (B(t) && (je[t] = /* @__PURE__ */ new Date()), Ft(r, e, t, n));
|
|
14
|
+
}, ot = (r, e) => () => {
|
|
15
|
+
if (r.isInitialized)
|
|
28
16
|
e();
|
|
29
17
|
else {
|
|
30
18
|
const t = () => {
|
|
31
19
|
setTimeout(() => {
|
|
32
|
-
|
|
20
|
+
r.off("initialized", t);
|
|
33
21
|
}, 0), e();
|
|
34
22
|
};
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
41
|
-
t.forEach((
|
|
42
|
-
|
|
43
|
-
}),
|
|
44
|
-
},
|
|
23
|
+
r.on("initialized", t);
|
|
24
|
+
}
|
|
25
|
+
}, ye = (r, e, t) => {
|
|
26
|
+
r.loadNamespaces(e, ot(r, t));
|
|
27
|
+
}, Te = (r, e, t, n) => {
|
|
28
|
+
if (B(t) && (t = [t]), r.options.preload && r.options.preload.indexOf(e) > -1) return ye(r, t, n);
|
|
29
|
+
t.forEach((i) => {
|
|
30
|
+
r.options.ns.indexOf(i) < 0 && r.options.ns.push(i);
|
|
31
|
+
}), r.loadLanguages(e, ot(r, n));
|
|
32
|
+
}, Mt = (r, e, t = {}) => !e.languages || !e.languages.length ? (me(e, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
45
33
|
languages: e.languages
|
|
46
|
-
}), !0) : e.hasLoadedNamespace(
|
|
34
|
+
}), !0) : e.hasLoadedNamespace(r, {
|
|
47
35
|
lng: t.lng,
|
|
48
|
-
precheck: (n,
|
|
49
|
-
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !
|
|
36
|
+
precheck: (n, i) => {
|
|
37
|
+
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !i(n.isLanguageChangingTo, r)) return !1;
|
|
50
38
|
}
|
|
51
|
-
}),
|
|
39
|
+
}), B = (r) => typeof r == "string", Dt = (r) => typeof r == "object" && r !== null, At = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, It = {
|
|
52
40
|
"&": "&",
|
|
53
41
|
"&": "&",
|
|
54
42
|
"<": "<",
|
|
@@ -69,8 +57,8 @@ const qt = (i, e, t, n) => {
|
|
|
69
57
|
"…": "…",
|
|
70
58
|
"/": "/",
|
|
71
59
|
"/": "/"
|
|
72
|
-
},
|
|
73
|
-
let
|
|
60
|
+
}, Vt = (r) => It[r], Ht = (r) => r.replace(At, Vt);
|
|
61
|
+
let xe = {
|
|
74
62
|
bindI18n: "languageChanged",
|
|
75
63
|
bindI18nStore: "",
|
|
76
64
|
transEmptyNodeValue: "",
|
|
@@ -78,24 +66,24 @@ let ke = {
|
|
|
78
66
|
transWrapTextNodes: "",
|
|
79
67
|
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
80
68
|
useSuspense: !0,
|
|
81
|
-
unescape:
|
|
69
|
+
unescape: Ht
|
|
82
70
|
};
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
...
|
|
86
|
-
...
|
|
71
|
+
const Kt = (r = {}) => {
|
|
72
|
+
xe = {
|
|
73
|
+
...xe,
|
|
74
|
+
...r
|
|
87
75
|
};
|
|
88
|
-
},
|
|
89
|
-
let
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
},
|
|
76
|
+
}, Bt = () => xe;
|
|
77
|
+
let lt;
|
|
78
|
+
const zt = (r) => {
|
|
79
|
+
lt = r;
|
|
80
|
+
}, qt = () => lt, Ut = {
|
|
93
81
|
type: "3rdParty",
|
|
94
|
-
init(
|
|
95
|
-
|
|
82
|
+
init(r) {
|
|
83
|
+
Kt(r.options.react), zt(r);
|
|
96
84
|
}
|
|
97
|
-
},
|
|
98
|
-
class
|
|
85
|
+
}, ct = Se();
|
|
86
|
+
class _t {
|
|
99
87
|
constructor() {
|
|
100
88
|
this.usedNamespaces = {};
|
|
101
89
|
}
|
|
@@ -108,78 +96,77 @@ class en {
|
|
|
108
96
|
return Object.keys(this.usedNamespaces);
|
|
109
97
|
}
|
|
110
98
|
}
|
|
111
|
-
const
|
|
112
|
-
const t =
|
|
113
|
-
return
|
|
114
|
-
t.current =
|
|
115
|
-
}, [
|
|
116
|
-
},
|
|
117
|
-
var P, N, V, j;
|
|
99
|
+
const Wt = (r, e) => {
|
|
100
|
+
const t = at();
|
|
101
|
+
return oe(() => {
|
|
102
|
+
t.current = r;
|
|
103
|
+
}, [r, e]), t.current;
|
|
104
|
+
}, dt = (r, e, t, n) => r.getFixedT(e, t, n), Zt = (r, e, t, n) => K(dt(r, e, t, n), [r, e, t, n]), ke = (r, e = {}) => {
|
|
118
105
|
const {
|
|
119
106
|
i18n: t
|
|
120
107
|
} = e, {
|
|
121
108
|
i18n: n,
|
|
122
|
-
defaultNS:
|
|
123
|
-
} =
|
|
124
|
-
if (s && !s.reportNamespaces && (s.reportNamespaces = new
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
}
|
|
129
|
-
|
|
109
|
+
defaultNS: i
|
|
110
|
+
} = st(ct) || {}, s = t || n || qt();
|
|
111
|
+
if (s && !s.reportNamespaces && (s.reportNamespaces = new _t()), !s) {
|
|
112
|
+
me(s, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
113
|
+
const S = (E, P) => B(P) ? P : Dt(P) && B(P.defaultValue) ? P.defaultValue : Array.isArray(E) ? E[E.length - 1] : E, k = [S, {}, !1];
|
|
114
|
+
return k.t = S, k.i18n = {}, k.ready = !1, k;
|
|
115
|
+
}
|
|
116
|
+
s.options.react?.wait && me(s, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
130
117
|
const a = {
|
|
131
|
-
...
|
|
118
|
+
...Bt(),
|
|
132
119
|
...s.options.react,
|
|
133
120
|
...e
|
|
134
121
|
}, {
|
|
135
122
|
useSuspense: o,
|
|
136
123
|
keyPrefix: c
|
|
137
124
|
} = a;
|
|
138
|
-
let l =
|
|
139
|
-
l =
|
|
140
|
-
const d = (s.isInitialized || s.initializedStoreOnce) && l.every((
|
|
125
|
+
let l = i || s.options?.defaultNS;
|
|
126
|
+
l = B(l) ? [l] : l || ["translation"], s.reportNamespaces.addUsedNamespaces?.(l);
|
|
127
|
+
const d = (s.isInitialized || s.initializedStoreOnce) && l.every((S) => Mt(S, s, a)), u = Zt(s, e.lng || null, a.nsMode === "fallback" ? l : l[0], c), h = () => u, f = () => dt(s, e.lng || null, a.nsMode === "fallback" ? l : l[0], c), [p, y] = X(h);
|
|
141
128
|
let b = l.join();
|
|
142
129
|
e.lng && (b = `${e.lng}${b}`);
|
|
143
|
-
const
|
|
144
|
-
|
|
130
|
+
const v = Wt(b), w = at(!0);
|
|
131
|
+
oe(() => {
|
|
145
132
|
const {
|
|
146
|
-
bindI18n:
|
|
147
|
-
bindI18nStore:
|
|
133
|
+
bindI18n: S,
|
|
134
|
+
bindI18nStore: k
|
|
148
135
|
} = a;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}) :
|
|
152
|
-
|
|
153
|
-
})), d &&
|
|
154
|
-
const
|
|
155
|
-
|
|
136
|
+
w.current = !0, !d && !o && (e.lng ? Te(s, e.lng, l, () => {
|
|
137
|
+
w.current && y(f);
|
|
138
|
+
}) : ye(s, l, () => {
|
|
139
|
+
w.current && y(f);
|
|
140
|
+
})), d && v && v !== b && w.current && y(f);
|
|
141
|
+
const E = () => {
|
|
142
|
+
w.current && y(f);
|
|
156
143
|
};
|
|
157
|
-
return
|
|
158
|
-
|
|
144
|
+
return S && s?.on(S, E), k && s?.store.on(k, E), () => {
|
|
145
|
+
w.current = !1, s && S && S?.split(" ").forEach((P) => s.off(P, E)), k && s && k.split(" ").forEach((P) => s.store.off(P, E));
|
|
159
146
|
};
|
|
160
|
-
}, [s, b]),
|
|
161
|
-
|
|
147
|
+
}, [s, b]), oe(() => {
|
|
148
|
+
w.current && d && y(h);
|
|
162
149
|
}, [s, c, d]);
|
|
163
|
-
const L = [
|
|
164
|
-
if (L.t =
|
|
165
|
-
throw new Promise((
|
|
166
|
-
e.lng ?
|
|
150
|
+
const L = [p, s, d];
|
|
151
|
+
if (L.t = p, L.i18n = s, L.ready = d, d || !d && !o) return L;
|
|
152
|
+
throw new Promise((S) => {
|
|
153
|
+
e.lng ? Te(s, e.lng, l, () => S()) : ye(s, l, () => S());
|
|
167
154
|
});
|
|
168
155
|
};
|
|
169
|
-
function
|
|
170
|
-
i18n:
|
|
156
|
+
function Jt({
|
|
157
|
+
i18n: r,
|
|
171
158
|
defaultNS: e,
|
|
172
159
|
children: t
|
|
173
160
|
}) {
|
|
174
|
-
const n =
|
|
175
|
-
i18n:
|
|
161
|
+
const n = $t(() => ({
|
|
162
|
+
i18n: r,
|
|
176
163
|
defaultNS: e
|
|
177
|
-
}), [
|
|
178
|
-
return
|
|
164
|
+
}), [r, e]);
|
|
165
|
+
return pe(ct.Provider, {
|
|
179
166
|
value: n
|
|
180
167
|
}, t);
|
|
181
168
|
}
|
|
182
|
-
var
|
|
169
|
+
var he = { exports: {} }, Z = {};
|
|
183
170
|
/**
|
|
184
171
|
* @license React
|
|
185
172
|
* react-jsx-runtime.production.min.js
|
|
@@ -189,334 +176,366 @@ var me = { exports: {} }, Y = {};
|
|
|
189
176
|
* This source code is licensed under the MIT license found in the
|
|
190
177
|
* LICENSE file in the root directory of this source tree.
|
|
191
178
|
*/
|
|
192
|
-
var
|
|
193
|
-
function
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
var
|
|
179
|
+
var $e;
|
|
180
|
+
function Qt() {
|
|
181
|
+
if ($e) return Z;
|
|
182
|
+
$e = 1;
|
|
183
|
+
var r = rt, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
197
184
|
function a(o, c, l) {
|
|
198
185
|
var d, u = {}, h = null, f = null;
|
|
199
186
|
l !== void 0 && (h = "" + l), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
|
200
187
|
for (d in c) n.call(c, d) && !s.hasOwnProperty(d) && (u[d] = c[d]);
|
|
201
188
|
if (o && o.defaultProps) for (d in c = o.defaultProps, c) u[d] === void 0 && (u[d] = c[d]);
|
|
202
|
-
return { $$typeof: e, type: o, key: h, ref: f, props: u, _owner:
|
|
189
|
+
return { $$typeof: e, type: o, key: h, ref: f, props: u, _owner: i.current };
|
|
203
190
|
}
|
|
204
|
-
return
|
|
191
|
+
return Z.Fragment = t, Z.jsx = a, Z.jsxs = a, Z;
|
|
205
192
|
}
|
|
206
|
-
var
|
|
207
|
-
function
|
|
208
|
-
return
|
|
193
|
+
var Re;
|
|
194
|
+
function Gt() {
|
|
195
|
+
return Re || (Re = 1, he.exports = Qt()), he.exports;
|
|
209
196
|
}
|
|
210
|
-
var m =
|
|
211
|
-
const
|
|
212
|
-
const { t: o } =
|
|
197
|
+
var m = Gt();
|
|
198
|
+
const Yt = ({ step: r, form: e, formState: t, onDismiss: n, onNextStep: i, onPreviousStep: s, onUpdateResponse: a }) => {
|
|
199
|
+
const { t: o } = ke(), l = ((d) => {
|
|
213
200
|
let u = 0;
|
|
214
201
|
if (e.startTransition) {
|
|
215
202
|
if (d === u)
|
|
216
|
-
return {
|
|
203
|
+
return {
|
|
204
|
+
type: "start",
|
|
205
|
+
transition: e.startTransition,
|
|
206
|
+
hasPreviousStep: !1,
|
|
207
|
+
hasNextStep: e.questions.length > 0 || !!e.endTransition
|
|
208
|
+
};
|
|
217
209
|
u++;
|
|
218
210
|
}
|
|
219
211
|
const h = d - u;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
212
|
+
if (h >= 0 && h < e.questions.length)
|
|
213
|
+
return {
|
|
214
|
+
type: "question",
|
|
215
|
+
questionIndex: h,
|
|
216
|
+
question: e.questions[h],
|
|
217
|
+
hasPreviousStep: d > 0,
|
|
218
|
+
hasNextStep: d < e.questions.length - 1 || !!e.endTransition
|
|
219
|
+
};
|
|
220
|
+
if (u += e.questions.length, e.endTransition && d === u)
|
|
221
|
+
return {
|
|
222
|
+
type: "end",
|
|
223
|
+
transition: e.endTransition,
|
|
224
|
+
hasPreviousStep: d > 0,
|
|
225
|
+
hasNextStep: !1
|
|
226
|
+
};
|
|
227
|
+
throw new Error("Invalid step order");
|
|
228
|
+
})(r);
|
|
229
|
+
if (l.type === "start") {
|
|
223
230
|
const {
|
|
224
231
|
title: d,
|
|
225
232
|
description: u,
|
|
226
233
|
image: h,
|
|
227
234
|
includeOptOut: f,
|
|
228
|
-
customStartButton:
|
|
235
|
+
customStartButton: p,
|
|
229
236
|
startButtonText: y,
|
|
230
237
|
customOptOutButton: b,
|
|
231
|
-
optOutButtonText:
|
|
238
|
+
optOutButtonText: v
|
|
232
239
|
} = l.transition;
|
|
233
240
|
return /* @__PURE__ */ m.jsx(
|
|
234
|
-
|
|
241
|
+
yn,
|
|
235
242
|
{
|
|
236
243
|
title: d,
|
|
237
244
|
description: u,
|
|
238
245
|
icon: e.icon,
|
|
239
246
|
image: h,
|
|
240
|
-
quitText: f ? b ?
|
|
247
|
+
quitText: f ? b ? v : o("Quit") : void 0,
|
|
241
248
|
onQuit: f ? () => n(t) : void 0,
|
|
242
|
-
startText:
|
|
243
|
-
onStart:
|
|
249
|
+
startText: p ? y : o("Start"),
|
|
250
|
+
onStart: i
|
|
244
251
|
}
|
|
245
252
|
);
|
|
246
253
|
}
|
|
247
|
-
if (
|
|
248
|
-
const { title: d, description: u, image: h, customEndButton: f, endButtonText:
|
|
254
|
+
if (l.type === "end") {
|
|
255
|
+
const { title: d, description: u, image: h, customEndButton: f, endButtonText: p, customEndButtonLink: y, endButtonLink: b } = l.transition;
|
|
249
256
|
return /* @__PURE__ */ m.jsx(
|
|
250
|
-
|
|
257
|
+
mn,
|
|
251
258
|
{
|
|
252
259
|
title: d,
|
|
253
260
|
description: u,
|
|
254
261
|
icon: e.icon,
|
|
255
262
|
image: h,
|
|
256
|
-
quitText: f ?
|
|
257
|
-
onQuit:
|
|
263
|
+
quitText: f ? p : o("Done"),
|
|
264
|
+
onQuit: i,
|
|
258
265
|
externalLink: y ? b : void 0
|
|
259
266
|
}
|
|
260
267
|
);
|
|
261
268
|
}
|
|
262
|
-
if (
|
|
269
|
+
if (l.type === "question") {
|
|
263
270
|
const { question: d } = l;
|
|
271
|
+
if (!d) throw new Error("No question found");
|
|
264
272
|
if (d.questionType === "choice") {
|
|
265
|
-
const { title: u, description: h, image: f, alternatives:
|
|
273
|
+
const { title: u, description: h, image: f, alternatives: p, maxSelections: y, required: b } = d, v = t.responses[d.id] || [], w = (y ? v.length <= y || y === 4 : !0) && (b ? v.length > 0 : !0);
|
|
266
274
|
return /* @__PURE__ */ m.jsx(
|
|
267
|
-
|
|
275
|
+
fn,
|
|
268
276
|
{
|
|
269
277
|
title: u,
|
|
270
278
|
description: h,
|
|
271
279
|
image: f,
|
|
272
|
-
alternatives:
|
|
280
|
+
alternatives: p,
|
|
273
281
|
onPrevious: s,
|
|
274
|
-
onNext:
|
|
282
|
+
onNext: i,
|
|
275
283
|
icon: e.icon,
|
|
276
284
|
maxAlternatives: y,
|
|
277
285
|
onQuit: () => n(t),
|
|
278
|
-
selectedAlternatives:
|
|
286
|
+
selectedAlternatives: v,
|
|
279
287
|
onAlternativeSelect: (L) => {
|
|
280
288
|
if (y > 1) {
|
|
281
|
-
const
|
|
282
|
-
a(d.id,
|
|
289
|
+
const k = v, E = k.includes(L) ? k.filter((P) => P !== L) : y && k.length >= y && y != 4 ? k : [...k, L];
|
|
290
|
+
a(d.id, E);
|
|
283
291
|
} else
|
|
284
|
-
|
|
292
|
+
v.includes(L) ? a(d.id, []) : a(d.id, [L]);
|
|
285
293
|
},
|
|
286
|
-
isValid:
|
|
294
|
+
isValid: w,
|
|
295
|
+
hasPreviousStep: l.hasPreviousStep,
|
|
296
|
+
hasNextStep: l.hasNextStep
|
|
287
297
|
}
|
|
288
298
|
);
|
|
289
299
|
}
|
|
290
300
|
if (d.questionType === "text") {
|
|
291
|
-
const { title: u, description: h, image: f, maxChars:
|
|
301
|
+
const { title: u, description: h, image: f, maxChars: p, limited: y, required: b } = d, v = t.responses[d.id] || "", w = (y && p ? v.length <= p : !0) && (b ? v.length > 0 : !0);
|
|
292
302
|
return /* @__PURE__ */ m.jsx(
|
|
293
|
-
|
|
303
|
+
pn,
|
|
294
304
|
{
|
|
295
305
|
title: u,
|
|
296
306
|
icon: e.icon,
|
|
297
307
|
description: h,
|
|
298
|
-
onNext:
|
|
308
|
+
onNext: i,
|
|
299
309
|
onPrevious: s,
|
|
300
310
|
onQuit: () => n(t),
|
|
301
311
|
image: f,
|
|
302
|
-
maxCharacters: y ?
|
|
303
|
-
inputText:
|
|
312
|
+
maxCharacters: y ? p : void 0,
|
|
313
|
+
inputText: v,
|
|
304
314
|
setInputText: (L) => {
|
|
305
|
-
y &&
|
|
315
|
+
y && p && L.length > p || a(d.id, L);
|
|
306
316
|
},
|
|
307
|
-
isValid:
|
|
317
|
+
isValid: w,
|
|
318
|
+
hasPreviousStep: l.hasPreviousStep,
|
|
319
|
+
hasNextStep: l.hasNextStep
|
|
308
320
|
}
|
|
309
321
|
);
|
|
310
322
|
}
|
|
311
323
|
}
|
|
312
324
|
return null;
|
|
313
|
-
},
|
|
314
|
-
const
|
|
325
|
+
}, Xt = ({ form: r, onDismiss: e, onComplete: t, zIndex: n = 100 }) => {
|
|
326
|
+
const s = (r.startTransition ? 1 : 0) + r.questions.length + (r.endTransition ? 1 : 0) - 1, [a, o] = X({
|
|
315
327
|
responses: {},
|
|
316
328
|
currentStep: 0,
|
|
317
329
|
startedAt: /* @__PURE__ */ new Date()
|
|
318
|
-
}),
|
|
319
|
-
|
|
320
|
-
...
|
|
330
|
+
}), c = K((h, f) => {
|
|
331
|
+
o((p) => ({
|
|
332
|
+
...p,
|
|
321
333
|
responses: {
|
|
322
|
-
...
|
|
323
|
-
[
|
|
334
|
+
...p.responses,
|
|
335
|
+
[h]: f
|
|
324
336
|
}
|
|
325
337
|
}));
|
|
326
|
-
}, []),
|
|
327
|
-
|
|
328
|
-
...
|
|
329
|
-
currentStep:
|
|
338
|
+
}, []), l = K((h) => {
|
|
339
|
+
o((f) => ({
|
|
340
|
+
...f,
|
|
341
|
+
currentStep: h
|
|
330
342
|
}));
|
|
331
|
-
}, []),
|
|
332
|
-
if (
|
|
333
|
-
|
|
343
|
+
}, []), d = K(() => {
|
|
344
|
+
if (a.currentStep < s)
|
|
345
|
+
l(a.currentStep + 1);
|
|
334
346
|
else {
|
|
335
|
-
const
|
|
336
|
-
...
|
|
347
|
+
const h = {
|
|
348
|
+
...a,
|
|
337
349
|
completedAt: /* @__PURE__ */ new Date()
|
|
338
350
|
};
|
|
339
|
-
t(
|
|
351
|
+
t(h);
|
|
340
352
|
}
|
|
341
|
-
}, [
|
|
342
|
-
|
|
343
|
-
}, [
|
|
344
|
-
return /* @__PURE__ */ m.jsx(
|
|
345
|
-
|
|
353
|
+
}, [a, s, l, t]), u = K(() => {
|
|
354
|
+
a.currentStep > 0 && l(a.currentStep - 1);
|
|
355
|
+
}, [a.currentStep, l]);
|
|
356
|
+
return /* @__PURE__ */ m.jsx(
|
|
357
|
+
"div",
|
|
346
358
|
{
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
359
|
+
className: "flex flex-col justify-center items-center absolute inset-0 bg-overlay-background-default-light dark:bg-overlay-background-default-dark",
|
|
360
|
+
style: { zIndex: n },
|
|
361
|
+
children: /* @__PURE__ */ m.jsx(
|
|
362
|
+
Yt,
|
|
363
|
+
{
|
|
364
|
+
step: a.currentStep,
|
|
365
|
+
form: r,
|
|
366
|
+
formState: a,
|
|
367
|
+
onDismiss: e,
|
|
368
|
+
onNextStep: d,
|
|
369
|
+
onPreviousStep: u,
|
|
370
|
+
onUpdateResponse: c
|
|
371
|
+
}
|
|
372
|
+
)
|
|
354
373
|
}
|
|
355
|
-
)
|
|
356
|
-
},
|
|
374
|
+
);
|
|
375
|
+
}, en = /* @__PURE__ */ new Map([
|
|
357
376
|
[
|
|
358
377
|
"bold",
|
|
359
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z" }))
|
|
360
379
|
],
|
|
361
380
|
[
|
|
362
381
|
"duotone",
|
|
363
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(
|
|
364
383
|
"path",
|
|
365
384
|
{
|
|
366
385
|
d: "M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z",
|
|
367
386
|
opacity: "0.2"
|
|
368
387
|
}
|
|
369
|
-
), /* @__PURE__ */
|
|
388
|
+
), /* @__PURE__ */ g.createElement("path", { d: "M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z" }))
|
|
370
389
|
],
|
|
371
390
|
[
|
|
372
391
|
"fill",
|
|
373
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z" }))
|
|
374
393
|
],
|
|
375
394
|
[
|
|
376
395
|
"light",
|
|
377
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z" }))
|
|
378
397
|
],
|
|
379
398
|
[
|
|
380
399
|
"regular",
|
|
381
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z" }))
|
|
382
401
|
],
|
|
383
402
|
[
|
|
384
403
|
"thin",
|
|
385
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z" }))
|
|
386
405
|
]
|
|
387
|
-
]),
|
|
406
|
+
]), tn = /* @__PURE__ */ new Map([
|
|
388
407
|
[
|
|
389
408
|
"bold",
|
|
390
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z" }))
|
|
391
410
|
],
|
|
392
411
|
[
|
|
393
412
|
"duotone",
|
|
394
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M160,48V208L80,128Z", opacity: "0.2" }), /* @__PURE__ */ g.createElement("path", { d: "M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z" }))
|
|
395
414
|
],
|
|
396
415
|
[
|
|
397
416
|
"fill",
|
|
398
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z" }))
|
|
399
418
|
],
|
|
400
419
|
[
|
|
401
420
|
"light",
|
|
402
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z" }))
|
|
403
422
|
],
|
|
404
423
|
[
|
|
405
424
|
"regular",
|
|
406
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z" }))
|
|
407
426
|
],
|
|
408
427
|
[
|
|
409
428
|
"thin",
|
|
410
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z" }))
|
|
411
430
|
]
|
|
412
|
-
]),
|
|
431
|
+
]), nn = /* @__PURE__ */ new Map([
|
|
413
432
|
[
|
|
414
433
|
"bold",
|
|
415
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z" }))
|
|
416
435
|
],
|
|
417
436
|
[
|
|
418
437
|
"duotone",
|
|
419
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }), /* @__PURE__ */ g.createElement("path", { d: "M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z" }))
|
|
420
439
|
],
|
|
421
440
|
[
|
|
422
441
|
"fill",
|
|
423
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z" }))
|
|
424
443
|
],
|
|
425
444
|
[
|
|
426
445
|
"light",
|
|
427
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z" }))
|
|
428
447
|
],
|
|
429
448
|
[
|
|
430
449
|
"regular",
|
|
431
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" }))
|
|
432
451
|
],
|
|
433
452
|
[
|
|
434
453
|
"thin",
|
|
435
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z" }))
|
|
436
455
|
]
|
|
437
|
-
]),
|
|
456
|
+
]), rn = /* @__PURE__ */ new Map([
|
|
438
457
|
[
|
|
439
458
|
"bold",
|
|
440
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z" }))
|
|
441
460
|
],
|
|
442
461
|
[
|
|
443
462
|
"duotone",
|
|
444
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement(
|
|
445
464
|
"path",
|
|
446
465
|
{
|
|
447
466
|
d: "M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",
|
|
448
467
|
opacity: "0.2"
|
|
449
468
|
}
|
|
450
|
-
), /* @__PURE__ */
|
|
469
|
+
), /* @__PURE__ */ g.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
|
|
451
470
|
],
|
|
452
471
|
[
|
|
453
472
|
"fill",
|
|
454
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
|
|
455
474
|
],
|
|
456
475
|
[
|
|
457
476
|
"light",
|
|
458
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z" }))
|
|
459
478
|
],
|
|
460
479
|
[
|
|
461
480
|
"regular",
|
|
462
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z" }))
|
|
463
482
|
],
|
|
464
483
|
[
|
|
465
484
|
"thin",
|
|
466
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ g.createElement(g.Fragment, null, /* @__PURE__ */ g.createElement("path", { d: "M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z" }))
|
|
467
486
|
]
|
|
468
|
-
]),
|
|
487
|
+
]), ut = Se({
|
|
469
488
|
color: "currentColor",
|
|
470
489
|
size: "1em",
|
|
471
490
|
weight: "regular",
|
|
472
491
|
mirrored: !1
|
|
473
|
-
}),
|
|
474
|
-
(
|
|
492
|
+
}), ie = g.forwardRef(
|
|
493
|
+
(r, e) => {
|
|
475
494
|
const {
|
|
476
495
|
alt: t,
|
|
477
496
|
color: n,
|
|
478
|
-
size:
|
|
497
|
+
size: i,
|
|
479
498
|
weight: s,
|
|
480
499
|
mirrored: a,
|
|
481
500
|
children: o,
|
|
482
501
|
weights: c,
|
|
483
502
|
...l
|
|
484
|
-
} =
|
|
503
|
+
} = r, {
|
|
485
504
|
color: d = "currentColor",
|
|
486
505
|
size: u,
|
|
487
506
|
weight: h = "regular",
|
|
488
507
|
mirrored: f = !1,
|
|
489
|
-
...
|
|
490
|
-
} =
|
|
491
|
-
return /* @__PURE__ */
|
|
508
|
+
...p
|
|
509
|
+
} = g.useContext(ut);
|
|
510
|
+
return /* @__PURE__ */ g.createElement(
|
|
492
511
|
"svg",
|
|
493
512
|
{
|
|
494
513
|
ref: e,
|
|
495
514
|
xmlns: "http://www.w3.org/2000/svg",
|
|
496
|
-
width:
|
|
497
|
-
height:
|
|
515
|
+
width: i ?? u,
|
|
516
|
+
height: i ?? u,
|
|
498
517
|
fill: n ?? d,
|
|
499
518
|
viewBox: "0 0 256 256",
|
|
500
519
|
transform: a || f ? "scale(-1, 1)" : void 0,
|
|
501
|
-
...
|
|
520
|
+
...p,
|
|
502
521
|
...l
|
|
503
522
|
},
|
|
504
|
-
!!t && /* @__PURE__ */
|
|
523
|
+
!!t && /* @__PURE__ */ g.createElement("title", null, t),
|
|
505
524
|
o,
|
|
506
525
|
c.get(s ?? h)
|
|
507
526
|
);
|
|
508
527
|
}
|
|
509
528
|
);
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
var
|
|
529
|
+
ie.displayName = "IconBase";
|
|
530
|
+
const ht = g.forwardRef((r, e) => /* @__PURE__ */ g.createElement(ie, { ref: e, ...r, weights: en }));
|
|
531
|
+
ht.displayName = "ArrowSquareOutIcon";
|
|
532
|
+
const ft = g.forwardRef((r, e) => /* @__PURE__ */ g.createElement(ie, { ref: e, ...r, weights: tn }));
|
|
533
|
+
ft.displayName = "CaretLeftIcon";
|
|
534
|
+
const gt = g.forwardRef((r, e) => /* @__PURE__ */ g.createElement(ie, { ref: e, ...r, weights: nn }));
|
|
535
|
+
gt.displayName = "CaretRightIcon";
|
|
536
|
+
const de = g.forwardRef((r, e) => /* @__PURE__ */ g.createElement(ie, { ref: e, ...r, weights: rn }));
|
|
537
|
+
de.displayName = "XIcon";
|
|
538
|
+
var Fe = { exports: {} }, J = {};
|
|
520
539
|
/**
|
|
521
540
|
* @license React
|
|
522
541
|
* react-jsx-runtime.production.min.js
|
|
@@ -526,63 +545,63 @@ var Ie = { exports: {} }, X = {};
|
|
|
526
545
|
* This source code is licensed under the MIT license found in the
|
|
527
546
|
* LICENSE file in the root directory of this source tree.
|
|
528
547
|
*/
|
|
529
|
-
var
|
|
530
|
-
function
|
|
531
|
-
if (
|
|
532
|
-
|
|
533
|
-
var
|
|
548
|
+
var Me;
|
|
549
|
+
function sn() {
|
|
550
|
+
if (Me) return J;
|
|
551
|
+
Me = 1;
|
|
552
|
+
var r = rt, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
534
553
|
function a(o, c, l) {
|
|
535
554
|
var d, u = {}, h = null, f = null;
|
|
536
555
|
l !== void 0 && (h = "" + l), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
|
537
556
|
for (d in c) n.call(c, d) && !s.hasOwnProperty(d) && (u[d] = c[d]);
|
|
538
557
|
if (o && o.defaultProps) for (d in c = o.defaultProps, c) u[d] === void 0 && (u[d] = c[d]);
|
|
539
|
-
return { $$typeof: e, type: o, key: h, ref: f, props: u, _owner:
|
|
558
|
+
return { $$typeof: e, type: o, key: h, ref: f, props: u, _owner: i.current };
|
|
540
559
|
}
|
|
541
|
-
return
|
|
560
|
+
return J.Fragment = t, J.jsx = a, J.jsxs = a, J;
|
|
542
561
|
}
|
|
543
|
-
var
|
|
544
|
-
function
|
|
545
|
-
return
|
|
562
|
+
var De;
|
|
563
|
+
function an() {
|
|
564
|
+
return De || (De = 1, Fe.exports = /* @__PURE__ */ sn()), Fe.exports;
|
|
546
565
|
}
|
|
547
|
-
var
|
|
548
|
-
const
|
|
549
|
-
variant:
|
|
566
|
+
var ae = /* @__PURE__ */ an();
|
|
567
|
+
const A = ({
|
|
568
|
+
variant: r = "primary",
|
|
550
569
|
size: e = "medium",
|
|
551
570
|
text: t,
|
|
552
571
|
iconBefore: n,
|
|
553
|
-
iconAfter:
|
|
572
|
+
iconAfter: i,
|
|
554
573
|
className: s,
|
|
555
574
|
disabled: a = !1,
|
|
556
575
|
...o
|
|
557
|
-
}) => /* @__PURE__ */
|
|
576
|
+
}) => /* @__PURE__ */ ae.jsx(
|
|
558
577
|
"button",
|
|
559
578
|
{
|
|
560
|
-
className:
|
|
579
|
+
className: j(
|
|
561
580
|
"flex gap-2 justify-center items-center rounded-lg disabled:pointer-events-none",
|
|
562
|
-
|
|
563
|
-
|
|
581
|
+
on(r),
|
|
582
|
+
ln(e),
|
|
564
583
|
s
|
|
565
584
|
),
|
|
566
585
|
disabled: a,
|
|
567
586
|
...o,
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
|
|
587
|
+
children: /* @__PURE__ */ ae.jsxs(
|
|
588
|
+
ut.Provider,
|
|
570
589
|
{
|
|
571
590
|
value: {
|
|
572
591
|
size: e === "xsmall" ? 8 : 16,
|
|
573
592
|
weight: "regular",
|
|
574
|
-
className:
|
|
593
|
+
className: j(Ae(r, a))
|
|
575
594
|
},
|
|
576
595
|
children: [
|
|
577
596
|
n && n,
|
|
578
|
-
t && /* @__PURE__ */
|
|
579
|
-
|
|
597
|
+
t && /* @__PURE__ */ ae.jsx("span", { className: j(Ae(r, a), cn(e)), children: t }),
|
|
598
|
+
i && i
|
|
580
599
|
]
|
|
581
600
|
}
|
|
582
601
|
)
|
|
583
602
|
}
|
|
584
|
-
),
|
|
585
|
-
switch (
|
|
603
|
+
), on = (r) => {
|
|
604
|
+
switch (r) {
|
|
586
605
|
case "primary":
|
|
587
606
|
return "border border-grey-0/0 bg-primary-action-button-light dark:bg-primary-action-button-dark hover:bg-primary-action-button-hover-light dark:hover:bg-primary-action-button-hover-dark disabled:bg-primary-action-disabled-light dark:disabled:bg-primary-action-disabled-dark";
|
|
588
607
|
case "secondary":
|
|
@@ -592,9 +611,9 @@ const B = ({
|
|
|
592
611
|
case "subtle":
|
|
593
612
|
return "border border-grey-0/0 hover:bg-background-universal-overlay-light dark:hover:bg-background-universal-overlay-dark";
|
|
594
613
|
}
|
|
595
|
-
},
|
|
614
|
+
}, Ae = (r, e) => {
|
|
596
615
|
if (e) return "text-label-tertiary-light dark:text-label-tertiary-dark";
|
|
597
|
-
switch (
|
|
616
|
+
switch (r) {
|
|
598
617
|
case "primary":
|
|
599
618
|
return "text-nonadaptable-text-light";
|
|
600
619
|
case "secondary":
|
|
@@ -604,8 +623,8 @@ const B = ({
|
|
|
604
623
|
case "subtle":
|
|
605
624
|
return "text-label-primary-light dark:text-label-primary-dark";
|
|
606
625
|
}
|
|
607
|
-
},
|
|
608
|
-
switch (
|
|
626
|
+
}, ln = (r) => {
|
|
627
|
+
switch (r) {
|
|
609
628
|
case "xsmall":
|
|
610
629
|
return "p-1";
|
|
611
630
|
case "small":
|
|
@@ -613,8 +632,8 @@ const B = ({
|
|
|
613
632
|
case "medium":
|
|
614
633
|
return "p-3";
|
|
615
634
|
}
|
|
616
|
-
},
|
|
617
|
-
switch (
|
|
635
|
+
}, cn = (r) => {
|
|
636
|
+
switch (r) {
|
|
618
637
|
case "xsmall":
|
|
619
638
|
return "text-[10px] leading-[14px]";
|
|
620
639
|
case "small":
|
|
@@ -623,23 +642,23 @@ const B = ({
|
|
|
623
642
|
return "text-[15px] leading-[16px] -tracking-0,1";
|
|
624
643
|
}
|
|
625
644
|
};
|
|
626
|
-
function
|
|
645
|
+
function pt(r) {
|
|
627
646
|
var e, t, n = "";
|
|
628
|
-
if (typeof
|
|
629
|
-
else if (typeof
|
|
630
|
-
var
|
|
631
|
-
for (e = 0; e <
|
|
632
|
-
} else for (t in
|
|
647
|
+
if (typeof r == "string" || typeof r == "number") n += r;
|
|
648
|
+
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
649
|
+
var i = r.length;
|
|
650
|
+
for (e = 0; e < i; e++) r[e] && (t = pt(r[e])) && (n && (n += " "), n += t);
|
|
651
|
+
} else for (t in r) r[t] && (n && (n += " "), n += t);
|
|
633
652
|
return n;
|
|
634
653
|
}
|
|
635
|
-
function
|
|
636
|
-
for (var
|
|
654
|
+
function dn() {
|
|
655
|
+
for (var r, e, t = 0, n = "", i = arguments.length; t < i; t++) (r = arguments[t]) && (e = pt(r)) && (n && (n += " "), n += e);
|
|
637
656
|
return n;
|
|
638
657
|
}
|
|
639
|
-
const
|
|
640
|
-
const s =
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
},
|
|
658
|
+
const j = dn, I = ({ children: r, className: e, variant: t = "B1", significance: n = "primary", as: i }) => {
|
|
659
|
+
const s = i ?? un[t], a = mt[t];
|
|
660
|
+
return /* @__PURE__ */ ae.jsx(s, { className: j("font-sans", hn[n], e, a), children: r });
|
|
661
|
+
}, mt = {
|
|
643
662
|
Di1: "text-[72px] font-bold leading-[90px] -tracking-2,5",
|
|
644
663
|
Di2: "text-[60px] font-bold leading-[72px] -tracking-2,0",
|
|
645
664
|
Di3: "text-[48px] font-bold leading-[60px] -tracking-1,5",
|
|
@@ -658,7 +677,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
658
677
|
D1B: "text-[12px] font-bold leading-[16px]",
|
|
659
678
|
D1: "text-[12px] leading-[16px]",
|
|
660
679
|
M: "text-[10px] leading-[16px]"
|
|
661
|
-
},
|
|
680
|
+
}, un = {
|
|
662
681
|
Di1: "h1",
|
|
663
682
|
Di2: "h2",
|
|
664
683
|
Di3: "h3",
|
|
@@ -677,7 +696,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
677
696
|
D1B: "p",
|
|
678
697
|
D1: "p",
|
|
679
698
|
M: "p"
|
|
680
|
-
},
|
|
699
|
+
}, hn = {
|
|
681
700
|
primary: "text-label-primary-light dark:text-label-primary-dark",
|
|
682
701
|
secondary: "text-label-secondary-light dark:text-label-secondary-dark",
|
|
683
702
|
tertiary: "text-label-tertiary-light dark:text-label-tertiary-dark",
|
|
@@ -685,27 +704,29 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
685
704
|
placeholder: "text-label-placeholder-light dark:text-label-placeholder-dark",
|
|
686
705
|
"nonadaptable-text": "text-nonadaptable-text-light dark:text-nonadaptable-text-dark",
|
|
687
706
|
disabled: "text-primary-action-disabled-light dark:text-primary-action-disabled-dark"
|
|
688
|
-
},
|
|
689
|
-
title:
|
|
707
|
+
}, yt = ({
|
|
708
|
+
title: r,
|
|
690
709
|
icon: e,
|
|
691
710
|
description: t,
|
|
692
711
|
image: n,
|
|
693
|
-
children:
|
|
712
|
+
children: i,
|
|
694
713
|
onPrevious: s,
|
|
695
714
|
onNext: a,
|
|
696
715
|
onQuit: o,
|
|
697
|
-
isValid: c
|
|
716
|
+
isValid: c,
|
|
717
|
+
hasPreviousStep: l,
|
|
718
|
+
hasNextStep: d
|
|
698
719
|
}) => {
|
|
699
|
-
const { t:
|
|
720
|
+
const { t: u } = ke();
|
|
700
721
|
return /* @__PURE__ */ m.jsxs(
|
|
701
722
|
"div",
|
|
702
723
|
{
|
|
703
|
-
className:
|
|
724
|
+
className: j(
|
|
704
725
|
"grid mx-4 my-8 rounded-xl border relative",
|
|
705
726
|
"grid-cols-1 p-4 pt-10",
|
|
706
727
|
"md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]",
|
|
707
728
|
n ? "md:grid-cols-2" : "md:grid-cols-1",
|
|
708
|
-
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick
|
|
729
|
+
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick"
|
|
709
730
|
),
|
|
710
731
|
children: [
|
|
711
732
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col justify-between order-2 md:order-1", children: [
|
|
@@ -714,49 +735,49 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
714
735
|
e && /* @__PURE__ */ m.jsx(
|
|
715
736
|
"div",
|
|
716
737
|
{
|
|
717
|
-
className:
|
|
738
|
+
className: j("h-8 w-8 rounded-lg overflow-hidden mb-1 md:mb-2", n ? "hidden md:block" : "block"),
|
|
718
739
|
children: /* @__PURE__ */ m.jsx("img", { className: "w-full h-full object-cover", src: e, alt: "icon" })
|
|
719
740
|
}
|
|
720
741
|
),
|
|
721
|
-
/* @__PURE__ */ m.jsx(
|
|
742
|
+
/* @__PURE__ */ m.jsx(I, { variant: "H2", children: r }),
|
|
722
743
|
t && t.trim().replace(/\n{3,}/g, `
|
|
723
744
|
|
|
724
745
|
`).split(`
|
|
725
746
|
|
|
726
|
-
`).map((
|
|
747
|
+
`).map((h, f) => /* @__PURE__ */ m.jsx(I, { significance: "secondary", children: h.trim() }, f))
|
|
727
748
|
] }),
|
|
728
|
-
|
|
749
|
+
i
|
|
729
750
|
] }),
|
|
730
751
|
/* @__PURE__ */ m.jsxs("div", { className: "flex justify-end pt-4 gap-2", children: [
|
|
731
|
-
/* @__PURE__ */ m.jsx(
|
|
732
|
-
|
|
752
|
+
l && /* @__PURE__ */ m.jsx(
|
|
753
|
+
A,
|
|
733
754
|
{
|
|
734
755
|
variant: "subtle",
|
|
735
756
|
onClick: s,
|
|
736
|
-
iconBefore: /* @__PURE__ */ m.jsx(
|
|
757
|
+
iconBefore: /* @__PURE__ */ m.jsx(ft, {}),
|
|
737
758
|
disabled: !s,
|
|
738
|
-
text:
|
|
759
|
+
text: u("Previous")
|
|
739
760
|
}
|
|
740
761
|
),
|
|
741
762
|
/* @__PURE__ */ m.jsx(
|
|
742
|
-
|
|
763
|
+
A,
|
|
743
764
|
{
|
|
744
765
|
variant: "subtle",
|
|
745
766
|
onClick: a,
|
|
746
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
767
|
+
iconAfter: /* @__PURE__ */ m.jsx(gt, {}),
|
|
747
768
|
disabled: !a || !c,
|
|
748
|
-
text:
|
|
769
|
+
text: u(d ? "Next" : "Submit")
|
|
749
770
|
}
|
|
750
771
|
)
|
|
751
772
|
] }),
|
|
752
773
|
o && /* @__PURE__ */ m.jsx(
|
|
753
|
-
|
|
774
|
+
A,
|
|
754
775
|
{
|
|
755
776
|
className: "absolute top-0 right-1 md:top-1",
|
|
756
777
|
variant: "subtle",
|
|
757
778
|
size: "small",
|
|
758
779
|
onClick: o,
|
|
759
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
780
|
+
iconAfter: /* @__PURE__ */ m.jsx(de, {}),
|
|
760
781
|
"aria-label": "quit"
|
|
761
782
|
}
|
|
762
783
|
)
|
|
@@ -765,69 +786,73 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
765
786
|
]
|
|
766
787
|
}
|
|
767
788
|
);
|
|
768
|
-
},
|
|
769
|
-
title:
|
|
789
|
+
}, fn = ({
|
|
790
|
+
title: r,
|
|
770
791
|
icon: e,
|
|
771
792
|
description: t,
|
|
772
793
|
image: n,
|
|
773
|
-
onPrevious:
|
|
794
|
+
onPrevious: i,
|
|
774
795
|
onNext: s,
|
|
775
796
|
onQuit: a,
|
|
776
797
|
alternatives: o = [],
|
|
777
798
|
onAlternativeSelect: c,
|
|
778
799
|
selectedAlternatives: l,
|
|
779
800
|
maxAlternatives: d,
|
|
780
|
-
isValid: u
|
|
801
|
+
isValid: u,
|
|
802
|
+
hasPreviousStep: h,
|
|
803
|
+
hasNextStep: f
|
|
781
804
|
}) => /* @__PURE__ */ m.jsx(
|
|
782
|
-
|
|
805
|
+
yt,
|
|
783
806
|
{
|
|
784
|
-
title:
|
|
807
|
+
title: r,
|
|
785
808
|
icon: e,
|
|
786
809
|
description: t,
|
|
787
810
|
image: n,
|
|
788
|
-
onPrevious:
|
|
811
|
+
onPrevious: i,
|
|
789
812
|
onNext: s,
|
|
790
813
|
onQuit: a,
|
|
791
814
|
isValid: u,
|
|
792
|
-
|
|
815
|
+
hasPreviousStep: h,
|
|
816
|
+
hasNextStep: f,
|
|
817
|
+
children: /* @__PURE__ */ m.jsx("div", { className: "flex flex-col max-h-[272px] md:max-h-full overflow-y-auto", children: d === 1 ? /* @__PURE__ */ m.jsx("div", { className: "flex flex-col py-3 md:py-4 gap-2 items-end md:items-start", children: o.map((p) => /* @__PURE__ */ m.jsxs(
|
|
793
818
|
"button",
|
|
794
819
|
{
|
|
795
|
-
onClick: () => c(
|
|
820
|
+
onClick: () => c(p.id),
|
|
796
821
|
className: "flex items-center gap-2 p-3 justify-end rounded-lg border text-label-primary-light dark:text-label-primary-dark border-separator-regular-light dark:border-separator-regular-dark",
|
|
797
822
|
children: [
|
|
798
|
-
/* @__PURE__ */ m.jsx(
|
|
799
|
-
/* @__PURE__ */ m.jsx(
|
|
823
|
+
/* @__PURE__ */ m.jsx(I, { variant: "B1Button", children: p.text }),
|
|
824
|
+
/* @__PURE__ */ m.jsx(gn, { size: 20, selected: l.includes(p.id) })
|
|
800
825
|
]
|
|
801
826
|
},
|
|
802
|
-
|
|
803
|
-
)) }) : /* @__PURE__ */ m.jsx("div", { className: "flex py-3 md:py-4 gap-2 justify-end md:justify-start flex-wrap", children: o.map((
|
|
827
|
+
p.id
|
|
828
|
+
)) }) : /* @__PURE__ */ m.jsx("div", { className: "flex py-3 md:py-4 gap-2 justify-end md:justify-start flex-wrap", children: o.map((p) => /* @__PURE__ */ m.jsx(
|
|
804
829
|
"button",
|
|
805
830
|
{
|
|
806
|
-
onClick: () => c(
|
|
807
|
-
className:
|
|
831
|
+
onClick: () => c(p.id),
|
|
832
|
+
className: j(
|
|
808
833
|
"flex items-center gap-2 p-3 justify-end rounded-lg border",
|
|
809
|
-
l.includes(
|
|
834
|
+
l.includes(p.id) ? "text-label-quaternary-light dark:text-label-quaternary-dark border-label-quaternary-light dark:border-label-quaternary-dark bg-secondary-action-base-light dark:bg-secondary-action-base-dark" : "text-label-primary-light dark:text-label-primary-dark border-separator-regular-light dark:border-separator-regular-dark"
|
|
810
835
|
),
|
|
811
836
|
children: /* @__PURE__ */ m.jsx(
|
|
812
|
-
|
|
837
|
+
I,
|
|
813
838
|
{
|
|
814
839
|
variant: "B1Button",
|
|
815
|
-
significance: l.includes(
|
|
816
|
-
children:
|
|
840
|
+
significance: l.includes(p.id) ? "quaternary" : "primary",
|
|
841
|
+
children: p.text
|
|
817
842
|
}
|
|
818
843
|
)
|
|
819
844
|
},
|
|
820
|
-
|
|
845
|
+
p.id
|
|
821
846
|
)) }) })
|
|
822
847
|
}
|
|
823
|
-
),
|
|
824
|
-
const
|
|
848
|
+
), gn = ({ size: r = 16, strokeColor: e = "currentColor", fillColor: t = "none", selected: n = !1 }) => {
|
|
849
|
+
const i = r + 1, s = i / 2, a = (r - 2) / 2;
|
|
825
850
|
return /* @__PURE__ */ m.jsxs(
|
|
826
851
|
"svg",
|
|
827
852
|
{
|
|
828
|
-
width:
|
|
829
|
-
height:
|
|
830
|
-
viewBox: `0 0 ${
|
|
853
|
+
width: r,
|
|
854
|
+
height: r,
|
|
855
|
+
viewBox: `0 0 ${i} ${i}`,
|
|
831
856
|
fill: n ? t : "none",
|
|
832
857
|
xmlns: "http://www.w3.org/2000/svg",
|
|
833
858
|
children: [
|
|
@@ -855,42 +880,46 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
855
880
|
]
|
|
856
881
|
}
|
|
857
882
|
);
|
|
858
|
-
},
|
|
859
|
-
title:
|
|
883
|
+
}, pn = ({
|
|
884
|
+
title: r,
|
|
860
885
|
icon: e,
|
|
861
886
|
description: t,
|
|
862
887
|
image: n,
|
|
863
|
-
onPrevious:
|
|
888
|
+
onPrevious: i,
|
|
864
889
|
onNext: s,
|
|
865
890
|
onQuit: a,
|
|
866
891
|
inputText: o,
|
|
867
892
|
setInputText: c,
|
|
868
893
|
maxCharacters: l,
|
|
869
|
-
isValid: d
|
|
894
|
+
isValid: d,
|
|
895
|
+
hasPreviousStep: u,
|
|
896
|
+
hasNextStep: h
|
|
870
897
|
}) => {
|
|
871
|
-
const { t:
|
|
898
|
+
const { t: f } = ke();
|
|
872
899
|
return /* @__PURE__ */ m.jsx(
|
|
873
|
-
|
|
900
|
+
yt,
|
|
874
901
|
{
|
|
875
|
-
title:
|
|
902
|
+
title: r,
|
|
876
903
|
icon: e,
|
|
877
904
|
description: t,
|
|
878
905
|
image: n,
|
|
879
|
-
onPrevious:
|
|
906
|
+
onPrevious: i,
|
|
880
907
|
onNext: s,
|
|
881
908
|
onQuit: a,
|
|
882
909
|
isValid: d,
|
|
910
|
+
hasPreviousStep: u,
|
|
911
|
+
hasNextStep: h,
|
|
883
912
|
children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col py-3 gap-2", children: [
|
|
884
913
|
l && /* @__PURE__ */ m.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
885
|
-
/* @__PURE__ */ m.jsx(
|
|
886
|
-
/* @__PURE__ */ m.jsx(
|
|
914
|
+
/* @__PURE__ */ m.jsx(I, { significance: "secondary", children: f("Max {{maxCharacters}} characters", { maxCharacters: l }) }),
|
|
915
|
+
/* @__PURE__ */ m.jsx(I, { significance: "secondary", children: `${o.length}/${l}` })
|
|
887
916
|
] }),
|
|
888
917
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col relative", children: [
|
|
889
918
|
/* @__PURE__ */ m.jsx(
|
|
890
|
-
|
|
919
|
+
I,
|
|
891
920
|
{
|
|
892
921
|
as: "div",
|
|
893
|
-
className:
|
|
922
|
+
className: j(
|
|
894
923
|
"overflow-y-hidden whitespace-pre-wrap invisible break-words rounded-lg py-3 px-4 min-h-20 border-separator-opaque-light dark:border-separator-opaque-dark"
|
|
895
924
|
),
|
|
896
925
|
children: o
|
|
@@ -900,108 +929,108 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
900
929
|
"textarea",
|
|
901
930
|
{
|
|
902
931
|
id: "primary",
|
|
903
|
-
placeholder:
|
|
904
|
-
className:
|
|
932
|
+
placeholder: f("Type your answer here"),
|
|
933
|
+
className: j(
|
|
905
934
|
"absolute inset-0 resize-none",
|
|
906
|
-
"overflow-hidden break-words outline-
|
|
935
|
+
"overflow-hidden break-words outline-hidden resize-none material-medium",
|
|
907
936
|
"rounded-lg py-3 px-4 min-h-20 border border-separator-opaque-light dark:border-separator-opaque-dark",
|
|
908
937
|
"text-label-primary-light dark:text-label-primary-dark",
|
|
909
|
-
|
|
938
|
+
mt.B1
|
|
910
939
|
),
|
|
911
940
|
value: o,
|
|
912
|
-
onChange: (
|
|
941
|
+
onChange: (p) => c(p.target.value)
|
|
913
942
|
}
|
|
914
943
|
)
|
|
915
944
|
] })
|
|
916
945
|
] })
|
|
917
946
|
}
|
|
918
947
|
);
|
|
919
|
-
},
|
|
948
|
+
}, xt = ({ title: r, icon: e, description: t, image: n, children: i, wrapperClassName: s }) => /* @__PURE__ */ m.jsxs(
|
|
920
949
|
"div",
|
|
921
950
|
{
|
|
922
|
-
className:
|
|
951
|
+
className: j(
|
|
923
952
|
"grid mx-4 my-8 rounded-xl border",
|
|
924
953
|
"grid-cols-1 p-4 pt-10",
|
|
925
954
|
"md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]",
|
|
926
955
|
n ? "md:grid-cols-2" : "md:grid-cols-1",
|
|
927
|
-
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick
|
|
956
|
+
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick",
|
|
928
957
|
s
|
|
929
958
|
),
|
|
930
959
|
children: [
|
|
931
960
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col justify-between gap-6 md:gap-8 order-2 md:order-1", children: [
|
|
932
961
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-6 md:gap-8", children: [
|
|
933
962
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-2 md:gap-4", children: [
|
|
934
|
-
e && /* @__PURE__ */ m.jsx("div", { className:
|
|
935
|
-
/* @__PURE__ */ m.jsx(
|
|
963
|
+
e && /* @__PURE__ */ m.jsx("div", { className: j("h-8 w-8 rounded-lg overflow-hidden", n ? "hidden md:block" : "block"), children: /* @__PURE__ */ m.jsx("img", { className: "w-full h-full object-cover", src: e, alt: "icon" }) }),
|
|
964
|
+
/* @__PURE__ */ m.jsx(I, { variant: "H2", children: r })
|
|
936
965
|
] }),
|
|
937
966
|
t && t.trim().replace(/\n{3,}/g, `
|
|
938
967
|
|
|
939
968
|
`).split(`
|
|
940
969
|
|
|
941
|
-
`).map((a, o) => /* @__PURE__ */ m.jsx(
|
|
970
|
+
`).map((a, o) => /* @__PURE__ */ m.jsx(I, { children: a.trim() }, o))
|
|
942
971
|
] }),
|
|
943
|
-
|
|
972
|
+
i
|
|
944
973
|
] }),
|
|
945
974
|
n && /* @__PURE__ */ m.jsx("div", { className: "flex flex-col justify-center order-1 md:order-2", children: /* @__PURE__ */ m.jsx("div", { className: "rounded-lg overflow-hidden mb-6 md:mb-0", children: /* @__PURE__ */ m.jsx("img", { className: "w-full h-full object-cover aspect-video md:aspect-square", src: n, alt: "image" }) }) })
|
|
946
975
|
]
|
|
947
976
|
}
|
|
948
|
-
),
|
|
977
|
+
), mn = ({ title: r, icon: e, description: t, image: n, quitText: i, onQuit: s, externalLink: a }) => /* @__PURE__ */ m.jsxs(xt, { title: r, icon: e, description: t, image: n, children: [
|
|
949
978
|
/* @__PURE__ */ m.jsx("div", { className: "flex justify-end gap-2", children: a ? /* @__PURE__ */ m.jsx(
|
|
950
|
-
|
|
979
|
+
A,
|
|
951
980
|
{
|
|
952
981
|
variant: "secondary",
|
|
953
|
-
text:
|
|
954
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
982
|
+
text: i,
|
|
983
|
+
iconAfter: /* @__PURE__ */ m.jsx(ht, {}),
|
|
955
984
|
onClick: () => {
|
|
956
|
-
window.open(a, "_blank"), s
|
|
985
|
+
window.open(a, "_blank"), s();
|
|
957
986
|
}
|
|
958
987
|
}
|
|
959
|
-
) : /* @__PURE__ */ m.jsx(
|
|
960
|
-
|
|
961
|
-
|
|
988
|
+
) : /* @__PURE__ */ m.jsx(A, { variant: "secondary", onClick: s, text: i }) }),
|
|
989
|
+
a && /* @__PURE__ */ m.jsx(
|
|
990
|
+
A,
|
|
962
991
|
{
|
|
963
992
|
className: "absolute -top-2 -right-2 md:-top-4 md:-right-4",
|
|
964
993
|
variant: "secondary",
|
|
965
994
|
size: "small",
|
|
966
995
|
onClick: s,
|
|
967
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
996
|
+
iconAfter: /* @__PURE__ */ m.jsx(de, {}),
|
|
968
997
|
"aria-label": "quit"
|
|
969
998
|
}
|
|
970
999
|
)
|
|
971
|
-
] }),
|
|
972
|
-
title:
|
|
1000
|
+
] }), yn = ({
|
|
1001
|
+
title: r,
|
|
973
1002
|
icon: e,
|
|
974
1003
|
description: t,
|
|
975
1004
|
image: n,
|
|
976
|
-
quitText:
|
|
1005
|
+
quitText: i,
|
|
977
1006
|
onQuit: s,
|
|
978
1007
|
startText: a,
|
|
979
1008
|
onStart: o
|
|
980
|
-
}) => /* @__PURE__ */ m.jsxs(
|
|
1009
|
+
}) => /* @__PURE__ */ m.jsxs(xt, { title: r, icon: e, description: t, image: n, wrapperClassName: "relative", children: [
|
|
981
1010
|
/* @__PURE__ */ m.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
982
|
-
s &&
|
|
983
|
-
/* @__PURE__ */ m.jsx(
|
|
1011
|
+
s && i && /* @__PURE__ */ m.jsx(A, { variant: "subtle", text: i, onClick: s }),
|
|
1012
|
+
/* @__PURE__ */ m.jsx(A, { variant: "secondary", text: a, onClick: o })
|
|
984
1013
|
] }),
|
|
985
1014
|
s && /* @__PURE__ */ m.jsx(
|
|
986
|
-
|
|
1015
|
+
A,
|
|
987
1016
|
{
|
|
988
1017
|
className: "absolute top-0 right-1 md:top-1",
|
|
989
1018
|
variant: "subtle",
|
|
990
1019
|
size: "small",
|
|
991
1020
|
onClick: s,
|
|
992
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
1021
|
+
iconAfter: /* @__PURE__ */ m.jsx(de, {}),
|
|
993
1022
|
"aria-label": "quit"
|
|
994
1023
|
}
|
|
995
1024
|
)
|
|
996
1025
|
] });
|
|
997
|
-
let
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1026
|
+
let bt = {};
|
|
1027
|
+
function xn() {
|
|
1028
|
+
return bt;
|
|
1000
1029
|
}
|
|
1001
|
-
function
|
|
1002
|
-
|
|
1030
|
+
function bn(r) {
|
|
1031
|
+
bt = r;
|
|
1003
1032
|
}
|
|
1004
|
-
const
|
|
1033
|
+
const wn = {
|
|
1005
1034
|
lessThanXSeconds: {
|
|
1006
1035
|
one: "less than a second",
|
|
1007
1036
|
other: "less than {{count}} seconds"
|
|
@@ -1063,49 +1092,49 @@ const Nn = {
|
|
|
1063
1092
|
one: "almost 1 year",
|
|
1064
1093
|
other: "almost {{count}} years"
|
|
1065
1094
|
}
|
|
1066
|
-
},
|
|
1095
|
+
}, vn = (r, e, t) => {
|
|
1067
1096
|
let n;
|
|
1068
|
-
const
|
|
1069
|
-
return typeof
|
|
1097
|
+
const i = wn[r];
|
|
1098
|
+
return typeof i == "string" ? n = i : e === 1 ? n = i.one : n = i.other.replace("{{count}}", e.toString()), t?.addSuffix ? t.comparison && t.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
1070
1099
|
};
|
|
1071
|
-
function
|
|
1100
|
+
function fe(r) {
|
|
1072
1101
|
return (e = {}) => {
|
|
1073
|
-
const t = e.width ? String(e.width) :
|
|
1074
|
-
return
|
|
1102
|
+
const t = e.width ? String(e.width) : r.defaultWidth;
|
|
1103
|
+
return r.formats[t] || r.formats[r.defaultWidth];
|
|
1075
1104
|
};
|
|
1076
1105
|
}
|
|
1077
|
-
const
|
|
1106
|
+
const Sn = {
|
|
1078
1107
|
lastWeek: "'last' eeee 'at' p",
|
|
1079
1108
|
yesterday: "'yesterday at' p",
|
|
1080
1109
|
today: "'today at' p",
|
|
1081
1110
|
tomorrow: "'tomorrow at' p",
|
|
1082
1111
|
nextWeek: "eeee 'at' p",
|
|
1083
1112
|
other: "P"
|
|
1084
|
-
},
|
|
1085
|
-
function Q(
|
|
1113
|
+
}, kn = (r, e, t, n) => Sn[r];
|
|
1114
|
+
function Q(r) {
|
|
1086
1115
|
return (e, t) => {
|
|
1087
|
-
const n = t
|
|
1088
|
-
let
|
|
1089
|
-
if (n === "formatting" &&
|
|
1090
|
-
const a =
|
|
1091
|
-
|
|
1116
|
+
const n = t?.context ? String(t.context) : "standalone";
|
|
1117
|
+
let i;
|
|
1118
|
+
if (n === "formatting" && r.formattingValues) {
|
|
1119
|
+
const a = r.defaultFormattingWidth || r.defaultWidth, o = t?.width ? String(t.width) : a;
|
|
1120
|
+
i = r.formattingValues[o] || r.formattingValues[a];
|
|
1092
1121
|
} else {
|
|
1093
|
-
const a =
|
|
1094
|
-
|
|
1122
|
+
const a = r.defaultWidth, o = t?.width ? String(t.width) : r.defaultWidth;
|
|
1123
|
+
i = r.values[o] || r.values[a];
|
|
1095
1124
|
}
|
|
1096
|
-
const s =
|
|
1097
|
-
return
|
|
1125
|
+
const s = r.argumentCallback ? r.argumentCallback(e) : e;
|
|
1126
|
+
return i[s];
|
|
1098
1127
|
};
|
|
1099
1128
|
}
|
|
1100
|
-
const
|
|
1129
|
+
const Ln = {
|
|
1101
1130
|
narrow: ["B", "A"],
|
|
1102
1131
|
abbreviated: ["BC", "AD"],
|
|
1103
1132
|
wide: ["Before Christ", "Anno Domini"]
|
|
1104
|
-
},
|
|
1133
|
+
}, En = {
|
|
1105
1134
|
narrow: ["1", "2", "3", "4"],
|
|
1106
1135
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1107
1136
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1108
|
-
},
|
|
1137
|
+
}, Pn = {
|
|
1109
1138
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1110
1139
|
abbreviated: [
|
|
1111
1140
|
"Jan",
|
|
@@ -1135,7 +1164,7 @@ const Tn = {
|
|
|
1135
1164
|
"November",
|
|
1136
1165
|
"December"
|
|
1137
1166
|
]
|
|
1138
|
-
},
|
|
1167
|
+
}, On = {
|
|
1139
1168
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1140
1169
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1141
1170
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -1148,7 +1177,7 @@ const Tn = {
|
|
|
1148
1177
|
"Friday",
|
|
1149
1178
|
"Saturday"
|
|
1150
1179
|
]
|
|
1151
|
-
},
|
|
1180
|
+
}, Nn = {
|
|
1152
1181
|
narrow: {
|
|
1153
1182
|
am: "a",
|
|
1154
1183
|
pm: "p",
|
|
@@ -1179,7 +1208,7 @@ const Tn = {
|
|
|
1179
1208
|
evening: "evening",
|
|
1180
1209
|
night: "night"
|
|
1181
1210
|
}
|
|
1182
|
-
},
|
|
1211
|
+
}, Cn = {
|
|
1183
1212
|
narrow: {
|
|
1184
1213
|
am: "a",
|
|
1185
1214
|
pm: "p",
|
|
@@ -1210,8 +1239,8 @@ const Tn = {
|
|
|
1210
1239
|
evening: "in the evening",
|
|
1211
1240
|
night: "at night"
|
|
1212
1241
|
}
|
|
1213
|
-
},
|
|
1214
|
-
const t = Number(
|
|
1242
|
+
}, jn = (r, e) => {
|
|
1243
|
+
const t = Number(r), n = t % 100;
|
|
1215
1244
|
if (n > 20 || n < 10)
|
|
1216
1245
|
switch (n % 10) {
|
|
1217
1246
|
case 1:
|
|
@@ -1222,43 +1251,43 @@ const Tn = {
|
|
|
1222
1251
|
return t + "rd";
|
|
1223
1252
|
}
|
|
1224
1253
|
return t + "th";
|
|
1225
|
-
},
|
|
1226
|
-
ordinalNumber:
|
|
1254
|
+
}, Tn = {
|
|
1255
|
+
ordinalNumber: jn,
|
|
1227
1256
|
era: Q({
|
|
1228
|
-
values:
|
|
1257
|
+
values: Ln,
|
|
1229
1258
|
defaultWidth: "wide"
|
|
1230
1259
|
}),
|
|
1231
1260
|
quarter: Q({
|
|
1232
|
-
values:
|
|
1261
|
+
values: En,
|
|
1233
1262
|
defaultWidth: "wide",
|
|
1234
|
-
argumentCallback: (
|
|
1263
|
+
argumentCallback: (r) => r - 1
|
|
1235
1264
|
}),
|
|
1236
1265
|
month: Q({
|
|
1237
|
-
values:
|
|
1266
|
+
values: Pn,
|
|
1238
1267
|
defaultWidth: "wide"
|
|
1239
1268
|
}),
|
|
1240
1269
|
day: Q({
|
|
1241
|
-
values:
|
|
1270
|
+
values: On,
|
|
1242
1271
|
defaultWidth: "wide"
|
|
1243
1272
|
}),
|
|
1244
1273
|
dayPeriod: Q({
|
|
1245
|
-
values:
|
|
1274
|
+
values: Nn,
|
|
1246
1275
|
defaultWidth: "wide",
|
|
1247
|
-
formattingValues:
|
|
1276
|
+
formattingValues: Cn,
|
|
1248
1277
|
defaultFormattingWidth: "wide"
|
|
1249
1278
|
})
|
|
1250
1279
|
};
|
|
1251
|
-
function
|
|
1280
|
+
function G(r) {
|
|
1252
1281
|
return (e, t = {}) => {
|
|
1253
|
-
const n = t.width,
|
|
1282
|
+
const n = t.width, i = n && r.matchPatterns[n] || r.matchPatterns[r.defaultMatchWidth], s = e.match(i);
|
|
1254
1283
|
if (!s)
|
|
1255
1284
|
return null;
|
|
1256
|
-
const a = s[0], o = n &&
|
|
1285
|
+
const a = s[0], o = n && r.parsePatterns[n] || r.parsePatterns[r.defaultParseWidth], c = Array.isArray(o) ? Rn(o, (u) => u.test(a)) : (
|
|
1257
1286
|
// [TODO] -- I challenge you to fix the type
|
|
1258
|
-
|
|
1287
|
+
$n(o, (u) => u.test(a))
|
|
1259
1288
|
);
|
|
1260
1289
|
let l;
|
|
1261
|
-
l =
|
|
1290
|
+
l = r.valueCallback ? r.valueCallback(c) : c, l = t.valueCallback ? (
|
|
1262
1291
|
// [TODO] -- I challenge you to fix the type
|
|
1263
1292
|
t.valueCallback(l)
|
|
1264
1293
|
) : l;
|
|
@@ -1266,45 +1295,45 @@ function ee(i) {
|
|
|
1266
1295
|
return { value: l, rest: d };
|
|
1267
1296
|
};
|
|
1268
1297
|
}
|
|
1269
|
-
function
|
|
1270
|
-
for (const t in
|
|
1271
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1298
|
+
function $n(r, e) {
|
|
1299
|
+
for (const t in r)
|
|
1300
|
+
if (Object.prototype.hasOwnProperty.call(r, t) && e(r[t]))
|
|
1272
1301
|
return t;
|
|
1273
1302
|
}
|
|
1274
|
-
function
|
|
1275
|
-
for (let t = 0; t <
|
|
1276
|
-
if (e(
|
|
1303
|
+
function Rn(r, e) {
|
|
1304
|
+
for (let t = 0; t < r.length; t++)
|
|
1305
|
+
if (e(r[t]))
|
|
1277
1306
|
return t;
|
|
1278
1307
|
}
|
|
1279
|
-
function
|
|
1308
|
+
function Fn(r) {
|
|
1280
1309
|
return (e, t = {}) => {
|
|
1281
|
-
const n = e.match(
|
|
1310
|
+
const n = e.match(r.matchPattern);
|
|
1282
1311
|
if (!n) return null;
|
|
1283
|
-
const
|
|
1312
|
+
const i = n[0], s = e.match(r.parsePattern);
|
|
1284
1313
|
if (!s) return null;
|
|
1285
|
-
let a =
|
|
1314
|
+
let a = r.valueCallback ? r.valueCallback(s[0]) : s[0];
|
|
1286
1315
|
a = t.valueCallback ? t.valueCallback(a) : a;
|
|
1287
|
-
const o = e.slice(
|
|
1316
|
+
const o = e.slice(i.length);
|
|
1288
1317
|
return { value: a, rest: o };
|
|
1289
1318
|
};
|
|
1290
1319
|
}
|
|
1291
|
-
const
|
|
1320
|
+
const Mn = /^(\d+)(th|st|nd|rd)?/i, Dn = /\d+/i, An = {
|
|
1292
1321
|
narrow: /^(b|a)/i,
|
|
1293
1322
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1294
1323
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1295
|
-
},
|
|
1324
|
+
}, In = {
|
|
1296
1325
|
any: [/^b/i, /^(a|c)/i]
|
|
1297
|
-
},
|
|
1326
|
+
}, Vn = {
|
|
1298
1327
|
narrow: /^[1234]/i,
|
|
1299
1328
|
abbreviated: /^q[1234]/i,
|
|
1300
1329
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1301
|
-
},
|
|
1330
|
+
}, Hn = {
|
|
1302
1331
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1303
|
-
},
|
|
1332
|
+
}, Kn = {
|
|
1304
1333
|
narrow: /^[jfmasond]/i,
|
|
1305
1334
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1306
1335
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1307
|
-
},
|
|
1336
|
+
}, Bn = {
|
|
1308
1337
|
narrow: [
|
|
1309
1338
|
/^j/i,
|
|
1310
1339
|
/^f/i,
|
|
@@ -1333,18 +1362,18 @@ const Un = /^(\d+)(th|st|nd|rd)?/i, zn = /\d+/i, Kn = {
|
|
|
1333
1362
|
/^n/i,
|
|
1334
1363
|
/^d/i
|
|
1335
1364
|
]
|
|
1336
|
-
},
|
|
1365
|
+
}, zn = {
|
|
1337
1366
|
narrow: /^[smtwf]/i,
|
|
1338
1367
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1339
1368
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1340
1369
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1341
|
-
},
|
|
1370
|
+
}, qn = {
|
|
1342
1371
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1343
1372
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1344
|
-
},
|
|
1373
|
+
}, Un = {
|
|
1345
1374
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1346
1375
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1347
|
-
},
|
|
1376
|
+
}, _n = {
|
|
1348
1377
|
any: {
|
|
1349
1378
|
am: /^a/i,
|
|
1350
1379
|
pm: /^p/i,
|
|
@@ -1355,148 +1384,148 @@ const Un = /^(\d+)(th|st|nd|rd)?/i, zn = /\d+/i, Kn = {
|
|
|
1355
1384
|
evening: /evening/i,
|
|
1356
1385
|
night: /night/i
|
|
1357
1386
|
}
|
|
1358
|
-
},
|
|
1359
|
-
ordinalNumber:
|
|
1360
|
-
matchPattern:
|
|
1361
|
-
parsePattern:
|
|
1362
|
-
valueCallback: (
|
|
1387
|
+
}, Wn = {
|
|
1388
|
+
ordinalNumber: Fn({
|
|
1389
|
+
matchPattern: Mn,
|
|
1390
|
+
parsePattern: Dn,
|
|
1391
|
+
valueCallback: (r) => parseInt(r, 10)
|
|
1363
1392
|
}),
|
|
1364
|
-
era:
|
|
1365
|
-
matchPatterns:
|
|
1393
|
+
era: G({
|
|
1394
|
+
matchPatterns: An,
|
|
1366
1395
|
defaultMatchWidth: "wide",
|
|
1367
|
-
parsePatterns:
|
|
1396
|
+
parsePatterns: In,
|
|
1368
1397
|
defaultParseWidth: "any"
|
|
1369
1398
|
}),
|
|
1370
|
-
quarter:
|
|
1371
|
-
matchPatterns:
|
|
1399
|
+
quarter: G({
|
|
1400
|
+
matchPatterns: Vn,
|
|
1372
1401
|
defaultMatchWidth: "wide",
|
|
1373
|
-
parsePatterns:
|
|
1402
|
+
parsePatterns: Hn,
|
|
1374
1403
|
defaultParseWidth: "any",
|
|
1375
|
-
valueCallback: (
|
|
1404
|
+
valueCallback: (r) => r + 1
|
|
1376
1405
|
}),
|
|
1377
|
-
month:
|
|
1378
|
-
matchPatterns:
|
|
1406
|
+
month: G({
|
|
1407
|
+
matchPatterns: Kn,
|
|
1379
1408
|
defaultMatchWidth: "wide",
|
|
1380
|
-
parsePatterns:
|
|
1409
|
+
parsePatterns: Bn,
|
|
1381
1410
|
defaultParseWidth: "any"
|
|
1382
1411
|
}),
|
|
1383
|
-
day:
|
|
1384
|
-
matchPatterns:
|
|
1412
|
+
day: G({
|
|
1413
|
+
matchPatterns: zn,
|
|
1385
1414
|
defaultMatchWidth: "wide",
|
|
1386
|
-
parsePatterns:
|
|
1415
|
+
parsePatterns: qn,
|
|
1387
1416
|
defaultParseWidth: "any"
|
|
1388
1417
|
}),
|
|
1389
|
-
dayPeriod:
|
|
1390
|
-
matchPatterns:
|
|
1418
|
+
dayPeriod: G({
|
|
1419
|
+
matchPatterns: Un,
|
|
1391
1420
|
defaultMatchWidth: "any",
|
|
1392
|
-
parsePatterns:
|
|
1421
|
+
parsePatterns: _n,
|
|
1393
1422
|
defaultParseWidth: "any"
|
|
1394
1423
|
})
|
|
1395
1424
|
};
|
|
1396
|
-
function
|
|
1397
|
-
const e = {}, t =
|
|
1425
|
+
function Zn(r) {
|
|
1426
|
+
const e = {}, t = xn();
|
|
1398
1427
|
for (const n in t)
|
|
1399
1428
|
Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
1400
|
-
for (const n in
|
|
1401
|
-
Object.prototype.hasOwnProperty.call(
|
|
1402
|
-
|
|
1429
|
+
for (const n in r)
|
|
1430
|
+
Object.prototype.hasOwnProperty.call(r, n) && (r[n] === void 0 ? delete e[n] : e[n] = r[n]);
|
|
1431
|
+
bn(e);
|
|
1403
1432
|
}
|
|
1404
|
-
const
|
|
1433
|
+
const Jn = {
|
|
1405
1434
|
full: "EEEE, d MMMM yyyy",
|
|
1406
1435
|
long: "d MMMM yyyy",
|
|
1407
1436
|
medium: "d MMM yyyy",
|
|
1408
1437
|
short: "dd/MM/yyyy"
|
|
1409
|
-
},
|
|
1438
|
+
}, Qn = {
|
|
1410
1439
|
full: "HH:mm:ss zzzz",
|
|
1411
1440
|
long: "HH:mm:ss z",
|
|
1412
1441
|
medium: "HH:mm:ss",
|
|
1413
1442
|
short: "HH:mm"
|
|
1414
|
-
},
|
|
1443
|
+
}, Gn = {
|
|
1415
1444
|
full: "{{date}} 'at' {{time}}",
|
|
1416
1445
|
long: "{{date}} 'at' {{time}}",
|
|
1417
1446
|
medium: "{{date}}, {{time}}",
|
|
1418
1447
|
short: "{{date}}, {{time}}"
|
|
1419
|
-
},
|
|
1420
|
-
date:
|
|
1421
|
-
formats:
|
|
1448
|
+
}, Yn = {
|
|
1449
|
+
date: fe({
|
|
1450
|
+
formats: Jn,
|
|
1422
1451
|
defaultWidth: "full"
|
|
1423
1452
|
}),
|
|
1424
|
-
time:
|
|
1425
|
-
formats:
|
|
1453
|
+
time: fe({
|
|
1454
|
+
formats: Qn,
|
|
1426
1455
|
defaultWidth: "full"
|
|
1427
1456
|
}),
|
|
1428
|
-
dateTime:
|
|
1429
|
-
formats:
|
|
1457
|
+
dateTime: fe({
|
|
1458
|
+
formats: Gn,
|
|
1430
1459
|
defaultWidth: "full"
|
|
1431
1460
|
})
|
|
1432
|
-
},
|
|
1461
|
+
}, Xn = {
|
|
1433
1462
|
code: "en-GB",
|
|
1434
|
-
formatDistance:
|
|
1435
|
-
formatLong:
|
|
1436
|
-
formatRelative:
|
|
1437
|
-
localize:
|
|
1438
|
-
match:
|
|
1463
|
+
formatDistance: vn,
|
|
1464
|
+
formatLong: Yn,
|
|
1465
|
+
formatRelative: kn,
|
|
1466
|
+
localize: Tn,
|
|
1467
|
+
match: Wn,
|
|
1439
1468
|
options: {
|
|
1440
1469
|
weekStartsOn: 1,
|
|
1441
1470
|
firstWeekContainsDate: 4
|
|
1442
1471
|
}
|
|
1443
|
-
}, x = (
|
|
1444
|
-
let
|
|
1445
|
-
const t = new Promise((n,
|
|
1446
|
-
|
|
1472
|
+
}, x = (r) => typeof r == "string", Y = () => {
|
|
1473
|
+
let r, e;
|
|
1474
|
+
const t = new Promise((n, i) => {
|
|
1475
|
+
r = n, e = i;
|
|
1447
1476
|
});
|
|
1448
|
-
return t.resolve =
|
|
1449
|
-
},
|
|
1450
|
-
|
|
1477
|
+
return t.resolve = r, t.reject = e, t;
|
|
1478
|
+
}, Ie = (r) => r == null ? "" : "" + r, ei = (r, e, t) => {
|
|
1479
|
+
r.forEach((n) => {
|
|
1451
1480
|
e[n] && (t[n] = e[n]);
|
|
1452
1481
|
});
|
|
1453
|
-
},
|
|
1482
|
+
}, ti = /###/g, Ve = (r) => r && r.indexOf("###") > -1 ? r.replace(ti, ".") : r, He = (r) => !r || x(r), ee = (r, e, t) => {
|
|
1454
1483
|
const n = x(e) ? e.split(".") : e;
|
|
1455
|
-
let
|
|
1456
|
-
for (;
|
|
1457
|
-
if (
|
|
1458
|
-
const s =
|
|
1459
|
-
!
|
|
1484
|
+
let i = 0;
|
|
1485
|
+
for (; i < n.length - 1; ) {
|
|
1486
|
+
if (He(r)) return {};
|
|
1487
|
+
const s = Ve(n[i]);
|
|
1488
|
+
!r[s] && t && (r[s] = new t()), Object.prototype.hasOwnProperty.call(r, s) ? r = r[s] : r = {}, ++i;
|
|
1460
1489
|
}
|
|
1461
|
-
return
|
|
1462
|
-
obj:
|
|
1463
|
-
k:
|
|
1490
|
+
return He(r) ? {} : {
|
|
1491
|
+
obj: r,
|
|
1492
|
+
k: Ve(n[i])
|
|
1464
1493
|
};
|
|
1465
|
-
},
|
|
1494
|
+
}, Ke = (r, e, t) => {
|
|
1466
1495
|
const {
|
|
1467
1496
|
obj: n,
|
|
1468
|
-
k:
|
|
1469
|
-
} =
|
|
1497
|
+
k: i
|
|
1498
|
+
} = ee(r, e, Object);
|
|
1470
1499
|
if (n !== void 0 || e.length === 1) {
|
|
1471
|
-
n[
|
|
1500
|
+
n[i] = t;
|
|
1472
1501
|
return;
|
|
1473
1502
|
}
|
|
1474
|
-
let s = e[e.length - 1], a = e.slice(0, e.length - 1), o =
|
|
1503
|
+
let s = e[e.length - 1], a = e.slice(0, e.length - 1), o = ee(r, a, Object);
|
|
1475
1504
|
for (; o.obj === void 0 && a.length; )
|
|
1476
|
-
s = `${a[a.length - 1]}.${s}`, a = a.slice(0, a.length - 1), o =
|
|
1505
|
+
s = `${a[a.length - 1]}.${s}`, a = a.slice(0, a.length - 1), o = ee(r, a, Object), o?.obj && typeof o.obj[`${o.k}.${s}`] < "u" && (o.obj = void 0);
|
|
1477
1506
|
o.obj[`${o.k}.${s}`] = t;
|
|
1478
|
-
},
|
|
1507
|
+
}, ni = (r, e, t, n) => {
|
|
1479
1508
|
const {
|
|
1480
|
-
obj:
|
|
1509
|
+
obj: i,
|
|
1481
1510
|
k: s
|
|
1482
|
-
} =
|
|
1483
|
-
|
|
1484
|
-
},
|
|
1511
|
+
} = ee(r, e, Object);
|
|
1512
|
+
i[s] = i[s] || [], i[s].push(t);
|
|
1513
|
+
}, le = (r, e) => {
|
|
1485
1514
|
const {
|
|
1486
1515
|
obj: t,
|
|
1487
1516
|
k: n
|
|
1488
|
-
} =
|
|
1517
|
+
} = ee(r, e);
|
|
1489
1518
|
if (t && Object.prototype.hasOwnProperty.call(t, n))
|
|
1490
1519
|
return t[n];
|
|
1491
|
-
},
|
|
1492
|
-
const n =
|
|
1493
|
-
return n !== void 0 ? n :
|
|
1494
|
-
},
|
|
1520
|
+
}, ii = (r, e, t) => {
|
|
1521
|
+
const n = le(r, t);
|
|
1522
|
+
return n !== void 0 ? n : le(e, t);
|
|
1523
|
+
}, wt = (r, e, t) => {
|
|
1495
1524
|
for (const n in e)
|
|
1496
|
-
n !== "__proto__" && n !== "constructor" && (n in
|
|
1497
|
-
return
|
|
1498
|
-
},
|
|
1499
|
-
var
|
|
1525
|
+
n !== "__proto__" && n !== "constructor" && (n in r ? x(r[n]) || r[n] instanceof String || x(e[n]) || e[n] instanceof String ? t && (r[n] = e[n]) : wt(r[n], e[n], t) : r[n] = e[n]);
|
|
1526
|
+
return r;
|
|
1527
|
+
}, z = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
1528
|
+
var ri = {
|
|
1500
1529
|
"&": "&",
|
|
1501
1530
|
"<": "<",
|
|
1502
1531
|
">": ">",
|
|
@@ -1504,8 +1533,8 @@ var hr = {
|
|
|
1504
1533
|
"'": "'",
|
|
1505
1534
|
"/": "/"
|
|
1506
1535
|
};
|
|
1507
|
-
const
|
|
1508
|
-
class
|
|
1536
|
+
const si = (r) => x(r) ? r.replace(/[&<>"'\/]/g, (e) => ri[e]) : r;
|
|
1537
|
+
class ai {
|
|
1509
1538
|
constructor(e) {
|
|
1510
1539
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1511
1540
|
}
|
|
@@ -1517,59 +1546,58 @@ class gr {
|
|
|
1517
1546
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
1518
1547
|
}
|
|
1519
1548
|
}
|
|
1520
|
-
const
|
|
1549
|
+
const oi = [" ", ",", "?", "!", ";"], li = new ai(20), ci = (r, e, t) => {
|
|
1521
1550
|
e = e || "", t = t || "";
|
|
1522
|
-
const n =
|
|
1551
|
+
const n = oi.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
1523
1552
|
if (n.length === 0) return !0;
|
|
1524
|
-
const
|
|
1525
|
-
let s = !
|
|
1553
|
+
const i = li.getRegExp(`(${n.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
1554
|
+
let s = !i.test(r);
|
|
1526
1555
|
if (!s) {
|
|
1527
|
-
const a =
|
|
1528
|
-
a > 0 && !
|
|
1556
|
+
const a = r.indexOf(t);
|
|
1557
|
+
a > 0 && !i.test(r.substring(0, a)) && (s = !0);
|
|
1529
1558
|
}
|
|
1530
1559
|
return s;
|
|
1531
|
-
},
|
|
1532
|
-
if (!
|
|
1533
|
-
if (
|
|
1534
|
-
return Object.prototype.hasOwnProperty.call(
|
|
1560
|
+
}, be = (r, e, t = ".") => {
|
|
1561
|
+
if (!r) return;
|
|
1562
|
+
if (r[e])
|
|
1563
|
+
return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
|
|
1535
1564
|
const n = e.split(t);
|
|
1536
|
-
let
|
|
1565
|
+
let i = r;
|
|
1537
1566
|
for (let s = 0; s < n.length; ) {
|
|
1538
|
-
if (!
|
|
1567
|
+
if (!i || typeof i != "object")
|
|
1539
1568
|
return;
|
|
1540
1569
|
let a, o = "";
|
|
1541
1570
|
for (let c = s; c < n.length; ++c)
|
|
1542
|
-
if (c !== s && (o += t), o += n[c], a =
|
|
1571
|
+
if (c !== s && (o += t), o += n[c], a = i[o], a !== void 0) {
|
|
1543
1572
|
if (["string", "number", "boolean"].indexOf(typeof a) > -1 && c < n.length - 1)
|
|
1544
1573
|
continue;
|
|
1545
1574
|
s += c - s + 1;
|
|
1546
1575
|
break;
|
|
1547
1576
|
}
|
|
1548
|
-
|
|
1577
|
+
i = a;
|
|
1549
1578
|
}
|
|
1550
|
-
return
|
|
1551
|
-
},
|
|
1579
|
+
return i;
|
|
1580
|
+
}, te = (r) => r?.replace("_", "-"), di = {
|
|
1552
1581
|
type: "logger",
|
|
1553
|
-
log(
|
|
1554
|
-
this.output("log",
|
|
1582
|
+
log(r) {
|
|
1583
|
+
this.output("log", r);
|
|
1555
1584
|
},
|
|
1556
|
-
warn(
|
|
1557
|
-
this.output("warn",
|
|
1585
|
+
warn(r) {
|
|
1586
|
+
this.output("warn", r);
|
|
1558
1587
|
},
|
|
1559
|
-
error(
|
|
1560
|
-
this.output("error",
|
|
1588
|
+
error(r) {
|
|
1589
|
+
this.output("error", r);
|
|
1561
1590
|
},
|
|
1562
|
-
output(
|
|
1563
|
-
|
|
1564
|
-
(n = (t = console == null ? void 0 : console[i]) == null ? void 0 : t.apply) == null || n.call(t, console, e);
|
|
1591
|
+
output(r, e) {
|
|
1592
|
+
console?.[r]?.apply?.(console, e);
|
|
1565
1593
|
}
|
|
1566
1594
|
};
|
|
1567
|
-
let
|
|
1595
|
+
let ui = class we {
|
|
1568
1596
|
constructor(e, t = {}) {
|
|
1569
1597
|
this.init(e, t);
|
|
1570
1598
|
}
|
|
1571
1599
|
init(e, t = {}) {
|
|
1572
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
1600
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || di, this.options = t, this.debug = t.debug;
|
|
1573
1601
|
}
|
|
1574
1602
|
log(...e) {
|
|
1575
1603
|
return this.forward(e, "log", "", !0);
|
|
@@ -1583,29 +1611,29 @@ let br = class Le {
|
|
|
1583
1611
|
deprecate(...e) {
|
|
1584
1612
|
return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
|
|
1585
1613
|
}
|
|
1586
|
-
forward(e, t, n,
|
|
1587
|
-
return
|
|
1614
|
+
forward(e, t, n, i) {
|
|
1615
|
+
return i && !this.debug ? null : (x(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
1588
1616
|
}
|
|
1589
1617
|
create(e) {
|
|
1590
|
-
return new
|
|
1618
|
+
return new we(this.logger, {
|
|
1591
1619
|
prefix: `${this.prefix}:${e}:`,
|
|
1592
1620
|
...this.options
|
|
1593
1621
|
});
|
|
1594
1622
|
}
|
|
1595
1623
|
clone(e) {
|
|
1596
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new
|
|
1624
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new we(this.logger, e);
|
|
1597
1625
|
}
|
|
1598
1626
|
};
|
|
1599
|
-
var
|
|
1600
|
-
class
|
|
1627
|
+
var F = new ui();
|
|
1628
|
+
class ue {
|
|
1601
1629
|
constructor() {
|
|
1602
1630
|
this.observers = {};
|
|
1603
1631
|
}
|
|
1604
1632
|
on(e, t) {
|
|
1605
1633
|
return e.split(" ").forEach((n) => {
|
|
1606
1634
|
this.observers[n] || (this.observers[n] = /* @__PURE__ */ new Map());
|
|
1607
|
-
const
|
|
1608
|
-
this.observers[n].set(t,
|
|
1635
|
+
const i = this.observers[n].get(t) || 0;
|
|
1636
|
+
this.observers[n].set(t, i + 1);
|
|
1609
1637
|
}), this;
|
|
1610
1638
|
}
|
|
1611
1639
|
off(e, t) {
|
|
@@ -1618,16 +1646,16 @@ class pe {
|
|
|
1618
1646
|
}
|
|
1619
1647
|
}
|
|
1620
1648
|
emit(e, ...t) {
|
|
1621
|
-
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([
|
|
1649
|
+
this.observers[e] && Array.from(this.observers[e].entries()).forEach(([i, s]) => {
|
|
1622
1650
|
for (let a = 0; a < s; a++)
|
|
1623
|
-
|
|
1624
|
-
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([
|
|
1651
|
+
i(...t);
|
|
1652
|
+
}), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([i, s]) => {
|
|
1625
1653
|
for (let a = 0; a < s; a++)
|
|
1626
|
-
|
|
1654
|
+
i.apply(i, [e, ...t]);
|
|
1627
1655
|
});
|
|
1628
1656
|
}
|
|
1629
1657
|
}
|
|
1630
|
-
class
|
|
1658
|
+
class Be extends ue {
|
|
1631
1659
|
constructor(e, t = {
|
|
1632
1660
|
ns: ["translation"],
|
|
1633
1661
|
defaultNS: "translation"
|
|
@@ -1641,41 +1669,40 @@ class We extends pe {
|
|
|
1641
1669
|
const t = this.options.ns.indexOf(e);
|
|
1642
1670
|
t > -1 && this.options.ns.splice(t, 1);
|
|
1643
1671
|
}
|
|
1644
|
-
getResource(e, t, n,
|
|
1645
|
-
|
|
1646
|
-
const s = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator, a = r.ignoreJSONStructure !== void 0 ? r.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
1672
|
+
getResource(e, t, n, i = {}) {
|
|
1673
|
+
const s = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
1647
1674
|
let o;
|
|
1648
1675
|
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : x(n) && s ? o.push(...n.split(s)) : o.push(n)));
|
|
1649
|
-
const c =
|
|
1650
|
-
return !c && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), c || !a || !x(n) ? c :
|
|
1676
|
+
const c = le(this.data, o);
|
|
1677
|
+
return !c && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), c || !a || !x(n) ? c : be(this.data?.[e]?.[t], n, s);
|
|
1651
1678
|
}
|
|
1652
|
-
addResource(e, t, n,
|
|
1679
|
+
addResource(e, t, n, i, s = {
|
|
1653
1680
|
silent: !1
|
|
1654
1681
|
}) {
|
|
1655
1682
|
const a = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
|
|
1656
1683
|
let o = [e, t];
|
|
1657
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."),
|
|
1684
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), i = t, t = o[1]), this.addNamespaces(t), Ke(this.data, o, i), s.silent || this.emit("added", e, t, n, i);
|
|
1658
1685
|
}
|
|
1659
|
-
addResources(e, t, n,
|
|
1686
|
+
addResources(e, t, n, i = {
|
|
1660
1687
|
silent: !1
|
|
1661
1688
|
}) {
|
|
1662
1689
|
for (const s in n)
|
|
1663
1690
|
(x(n[s]) || Array.isArray(n[s])) && this.addResource(e, t, s, n[s], {
|
|
1664
1691
|
silent: !0
|
|
1665
1692
|
});
|
|
1666
|
-
|
|
1693
|
+
i.silent || this.emit("added", e, t, n);
|
|
1667
1694
|
}
|
|
1668
|
-
addResourceBundle(e, t, n,
|
|
1695
|
+
addResourceBundle(e, t, n, i, s, a = {
|
|
1669
1696
|
silent: !1,
|
|
1670
1697
|
skipCopy: !1
|
|
1671
1698
|
}) {
|
|
1672
1699
|
let o = [e, t];
|
|
1673
|
-
e.indexOf(".") > -1 && (o = e.split("."),
|
|
1674
|
-
let c =
|
|
1675
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))),
|
|
1700
|
+
e.indexOf(".") > -1 && (o = e.split("."), i = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
1701
|
+
let c = le(this.data, o) || {};
|
|
1702
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), i ? wt(c, n, s) : c = {
|
|
1676
1703
|
...c,
|
|
1677
1704
|
...n
|
|
1678
|
-
},
|
|
1705
|
+
}, Ke(this.data, o, c), a.silent || this.emit("added", e, t, n);
|
|
1679
1706
|
}
|
|
1680
1707
|
removeResourceBundle(e, t) {
|
|
1681
1708
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -1691,43 +1718,39 @@ class We extends pe {
|
|
|
1691
1718
|
}
|
|
1692
1719
|
hasLanguageSomeTranslations(e) {
|
|
1693
1720
|
const t = this.getDataByLanguage(e);
|
|
1694
|
-
return !!(t && Object.keys(t) || []).find((
|
|
1721
|
+
return !!(t && Object.keys(t) || []).find((i) => t[i] && Object.keys(t[i]).length > 0);
|
|
1695
1722
|
}
|
|
1696
1723
|
toJSON() {
|
|
1697
1724
|
return this.data;
|
|
1698
1725
|
}
|
|
1699
1726
|
}
|
|
1700
|
-
var
|
|
1727
|
+
var vt = {
|
|
1701
1728
|
processors: {},
|
|
1702
|
-
addPostProcessor(
|
|
1703
|
-
this.processors[
|
|
1729
|
+
addPostProcessor(r) {
|
|
1730
|
+
this.processors[r.name] = r;
|
|
1704
1731
|
},
|
|
1705
|
-
handle(
|
|
1706
|
-
return
|
|
1707
|
-
|
|
1708
|
-
e = ((a = this.processors[s]) == null ? void 0 : a.process(e, t, n, r)) ?? e;
|
|
1732
|
+
handle(r, e, t, n, i) {
|
|
1733
|
+
return r.forEach((s) => {
|
|
1734
|
+
e = this.processors[s]?.process(e, t, n, i) ?? e;
|
|
1709
1735
|
}), e;
|
|
1710
1736
|
}
|
|
1711
1737
|
};
|
|
1712
|
-
const
|
|
1713
|
-
function
|
|
1714
|
-
const
|
|
1738
|
+
const St = Symbol("i18next/PATH_KEY");
|
|
1739
|
+
function hi() {
|
|
1740
|
+
const r = [], e = /* @__PURE__ */ Object.create(null);
|
|
1715
1741
|
let t;
|
|
1716
|
-
return e.get = (n,
|
|
1717
|
-
var s;
|
|
1718
|
-
return (s = t == null ? void 0 : t.revoke) == null || s.call(t), r === Pt ? i : (i.push(r), t = Proxy.revocable(n, e), t.proxy);
|
|
1719
|
-
}, Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
1742
|
+
return e.get = (n, i) => (t?.revoke?.(), i === St ? r : (r.push(i), t = Proxy.revocable(n, e), t.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
1720
1743
|
}
|
|
1721
|
-
function
|
|
1744
|
+
function ve(r, e) {
|
|
1722
1745
|
const {
|
|
1723
|
-
[
|
|
1724
|
-
} =
|
|
1725
|
-
return t.join(
|
|
1746
|
+
[St]: t
|
|
1747
|
+
} = r(hi());
|
|
1748
|
+
return t.join(e?.keySeparator ?? ".");
|
|
1726
1749
|
}
|
|
1727
|
-
const
|
|
1728
|
-
class
|
|
1750
|
+
const ze = {}, qe = (r) => !x(r) && typeof r != "boolean" && typeof r != "number";
|
|
1751
|
+
class ce extends ue {
|
|
1729
1752
|
constructor(e, t = {}) {
|
|
1730
|
-
super(),
|
|
1753
|
+
super(), ei(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = F.create("translator");
|
|
1731
1754
|
}
|
|
1732
1755
|
changeLanguage(e) {
|
|
1733
1756
|
e && (this.language = e);
|
|
@@ -1738,16 +1761,14 @@ class fe extends pe {
|
|
|
1738
1761
|
const n = {
|
|
1739
1762
|
...t
|
|
1740
1763
|
};
|
|
1741
|
-
|
|
1742
|
-
const r = this.resolve(e, n);
|
|
1743
|
-
return (r == null ? void 0 : r.res) !== void 0;
|
|
1764
|
+
return e == null ? !1 : this.resolve(e, n)?.res !== void 0;
|
|
1744
1765
|
}
|
|
1745
1766
|
extractFromKey(e, t) {
|
|
1746
1767
|
let n = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
|
|
1747
1768
|
n === void 0 && (n = ":");
|
|
1748
|
-
const
|
|
1769
|
+
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
1749
1770
|
let s = t.ns || this.options.defaultNS || [];
|
|
1750
|
-
const a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
1771
|
+
const a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !ci(e, n, i);
|
|
1751
1772
|
if (a && !o) {
|
|
1752
1773
|
const c = e.match(this.interpolator.nestingRegexp);
|
|
1753
1774
|
if (c && c.length > 0)
|
|
@@ -1756,7 +1777,7 @@ class fe extends pe {
|
|
|
1756
1777
|
namespaces: x(s) ? [s] : s
|
|
1757
1778
|
};
|
|
1758
1779
|
const l = e.split(n);
|
|
1759
|
-
(n !==
|
|
1780
|
+
(n !== i || n === i && this.options.ns.indexOf(l[0]) > -1) && (s = l.shift()), e = l.join(i);
|
|
1760
1781
|
}
|
|
1761
1782
|
return {
|
|
1762
1783
|
key: e,
|
|
@@ -1764,118 +1785,116 @@ class fe extends pe {
|
|
|
1764
1785
|
};
|
|
1765
1786
|
}
|
|
1766
1787
|
translate(e, t, n) {
|
|
1767
|
-
let
|
|
1788
|
+
let i = typeof t == "object" ? {
|
|
1768
1789
|
...t
|
|
1769
1790
|
} : t;
|
|
1770
|
-
if (typeof
|
|
1771
|
-
...
|
|
1772
|
-
}),
|
|
1773
|
-
typeof e == "function" && (e =
|
|
1791
|
+
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = {
|
|
1792
|
+
...i
|
|
1793
|
+
}), i || (i = {}), e == null) return "";
|
|
1794
|
+
typeof e == "function" && (e = ve(e, {
|
|
1774
1795
|
...this.options,
|
|
1775
|
-
...
|
|
1796
|
+
...i
|
|
1776
1797
|
})), Array.isArray(e) || (e = [String(e)]);
|
|
1777
|
-
const s =
|
|
1798
|
+
const s = i.returnDetails !== void 0 ? i.returnDetails : this.options.returnDetails, a = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, {
|
|
1778
1799
|
key: o,
|
|
1779
1800
|
namespaces: c
|
|
1780
|
-
} = this.extractFromKey(e[e.length - 1],
|
|
1781
|
-
let d =
|
|
1801
|
+
} = this.extractFromKey(e[e.length - 1], i), l = c[c.length - 1];
|
|
1802
|
+
let d = i.nsSeparator !== void 0 ? i.nsSeparator : this.options.nsSeparator;
|
|
1782
1803
|
d === void 0 && (d = ":");
|
|
1783
|
-
const u =
|
|
1784
|
-
if (
|
|
1804
|
+
const u = i.lng || this.language, h = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
1805
|
+
if (u?.toLowerCase() === "cimode")
|
|
1785
1806
|
return h ? s ? {
|
|
1786
1807
|
res: `${l}${d}${o}`,
|
|
1787
1808
|
usedKey: o,
|
|
1788
1809
|
exactUsedKey: o,
|
|
1789
1810
|
usedLng: u,
|
|
1790
1811
|
usedNS: l,
|
|
1791
|
-
usedParams: this.getUsedParamsDetails(
|
|
1812
|
+
usedParams: this.getUsedParamsDetails(i)
|
|
1792
1813
|
} : `${l}${d}${o}` : s ? {
|
|
1793
1814
|
res: o,
|
|
1794
1815
|
usedKey: o,
|
|
1795
1816
|
exactUsedKey: o,
|
|
1796
1817
|
usedLng: u,
|
|
1797
1818
|
usedNS: l,
|
|
1798
|
-
usedParams: this.getUsedParamsDetails(
|
|
1819
|
+
usedParams: this.getUsedParamsDetails(i)
|
|
1799
1820
|
} : o;
|
|
1800
|
-
const f = this.resolve(e,
|
|
1801
|
-
let
|
|
1802
|
-
const y =
|
|
1821
|
+
const f = this.resolve(e, i);
|
|
1822
|
+
let p = f?.res;
|
|
1823
|
+
const y = f?.usedKey || o, b = f?.exactUsedKey || o, v = ["[object Number]", "[object Function]", "[object RegExp]"], w = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, L = !this.i18nFormat || this.i18nFormat.handleAsObject, S = i.count !== void 0 && !x(i.count), k = ce.hasDefaultValue(i), E = S ? this.pluralResolver.getSuffix(u, i.count, i) : "", P = i.ordinal && S ? this.pluralResolver.getSuffix(u, i.count, {
|
|
1803
1824
|
ordinal: !1
|
|
1804
|
-
}) : "",
|
|
1805
|
-
let
|
|
1806
|
-
L && !
|
|
1807
|
-
const
|
|
1808
|
-
if (L &&
|
|
1809
|
-
if (!
|
|
1825
|
+
}) : "", Pe = S && !i.ordinal && i.count === 0, V = Pe && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${E}`] || i[`defaultValue${P}`] || i.defaultValue;
|
|
1826
|
+
let T = p;
|
|
1827
|
+
L && !p && k && (T = V);
|
|
1828
|
+
const jt = qe(T), Tt = Object.prototype.toString.apply(T);
|
|
1829
|
+
if (L && T && jt && v.indexOf(Tt) < 0 && !(x(w) && Array.isArray(T))) {
|
|
1830
|
+
if (!i.returnObjects && !this.options.returnObjects) {
|
|
1810
1831
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
1811
|
-
const
|
|
1812
|
-
...
|
|
1832
|
+
const $ = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(y, T, {
|
|
1833
|
+
...i,
|
|
1813
1834
|
ns: c
|
|
1814
1835
|
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
1815
|
-
return s ? (f.res =
|
|
1836
|
+
return s ? (f.res = $, f.usedParams = this.getUsedParamsDetails(i), f) : $;
|
|
1816
1837
|
}
|
|
1817
1838
|
if (a) {
|
|
1818
|
-
const
|
|
1819
|
-
for (const
|
|
1820
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1821
|
-
const
|
|
1822
|
-
|
|
1823
|
-
...
|
|
1824
|
-
defaultValue:
|
|
1839
|
+
const $ = Array.isArray(T), C = $ ? [] : {}, Oe = $ ? b : y;
|
|
1840
|
+
for (const R in T)
|
|
1841
|
+
if (Object.prototype.hasOwnProperty.call(T, R)) {
|
|
1842
|
+
const M = `${Oe}${a}${R}`;
|
|
1843
|
+
k && !p ? C[R] = this.translate(M, {
|
|
1844
|
+
...i,
|
|
1845
|
+
defaultValue: qe(V) ? V[R] : void 0,
|
|
1825
1846
|
joinArrays: !1,
|
|
1826
1847
|
ns: c
|
|
1827
|
-
}) : R
|
|
1828
|
-
...
|
|
1848
|
+
}) : C[R] = this.translate(M, {
|
|
1849
|
+
...i,
|
|
1829
1850
|
joinArrays: !1,
|
|
1830
1851
|
ns: c
|
|
1831
|
-
}), R
|
|
1852
|
+
}), C[R] === M && (C[R] = T[R]);
|
|
1832
1853
|
}
|
|
1833
|
-
|
|
1854
|
+
p = C;
|
|
1834
1855
|
}
|
|
1835
|
-
} else if (L && x(
|
|
1836
|
-
|
|
1856
|
+
} else if (L && x(w) && Array.isArray(p))
|
|
1857
|
+
p = p.join(w), p && (p = this.extendTranslation(p, e, i, n));
|
|
1837
1858
|
else {
|
|
1838
|
-
let
|
|
1839
|
-
!this.isValidLookup(
|
|
1840
|
-
const
|
|
1841
|
-
if (
|
|
1842
|
-
if (this.logger.log(
|
|
1843
|
-
const
|
|
1844
|
-
...
|
|
1859
|
+
let $ = !1, C = !1;
|
|
1860
|
+
!this.isValidLookup(p) && k && ($ = !0, p = V), this.isValidLookup(p) || (C = !0, p = o);
|
|
1861
|
+
const R = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && C ? void 0 : p, M = k && V !== p && this.options.updateMissing;
|
|
1862
|
+
if (C || $ || M) {
|
|
1863
|
+
if (this.logger.log(M ? "updateKey" : "missingKey", u, l, o, M ? V : p), a) {
|
|
1864
|
+
const N = this.resolve(o, {
|
|
1865
|
+
...i,
|
|
1845
1866
|
keySeparator: !1
|
|
1846
1867
|
});
|
|
1847
|
-
|
|
1868
|
+
N && N.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
1848
1869
|
}
|
|
1849
|
-
let
|
|
1850
|
-
const
|
|
1851
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
1852
|
-
for (let
|
|
1853
|
-
|
|
1854
|
-
else this.options.saveMissingTo === "all" ?
|
|
1855
|
-
const
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler($, l, U, Te, I, r) : (Re = this.backendConnector) != null && Re.saveMissing && this.backendConnector.saveMissing($, l, U, Te, I, r), this.emit("missingKey", $, l, U, g);
|
|
1870
|
+
let _ = [];
|
|
1871
|
+
const re = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
|
|
1872
|
+
if (this.options.saveMissingTo === "fallback" && re && re[0])
|
|
1873
|
+
for (let N = 0; N < re.length; N++)
|
|
1874
|
+
_.push(re[N]);
|
|
1875
|
+
else this.options.saveMissingTo === "all" ? _ = this.languageUtils.toResolveHierarchy(i.lng || this.language) : _.push(i.lng || this.language);
|
|
1876
|
+
const Ne = (N, H, W) => {
|
|
1877
|
+
const Ce = k && W !== p ? W : R;
|
|
1878
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(N, l, H, Ce, M, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(N, l, H, Ce, M, i), this.emit("missingKey", N, l, H, p);
|
|
1859
1879
|
};
|
|
1860
|
-
this.options.saveMissing && (this.options.saveMissingPlurals &&
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1863
|
-
|
|
1880
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && S ? _.forEach((N) => {
|
|
1881
|
+
const H = this.pluralResolver.getSuffixes(N, i);
|
|
1882
|
+
Pe && i[`defaultValue${this.options.pluralSeparator}zero`] && H.indexOf(`${this.options.pluralSeparator}zero`) < 0 && H.push(`${this.options.pluralSeparator}zero`), H.forEach((W) => {
|
|
1883
|
+
Ne([N], o + W, i[`defaultValue${W}`] || V);
|
|
1864
1884
|
});
|
|
1865
|
-
}) :
|
|
1885
|
+
}) : Ne(_, o, V));
|
|
1866
1886
|
}
|
|
1867
|
-
|
|
1887
|
+
p = this.extendTranslation(p, e, i, f, n), C && p === o && this.options.appendNamespaceToMissingKey && (p = `${l}${d}${o}`), (C || $) && this.options.parseMissingKeyHandler && (p = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${d}${o}` : o, $ ? p : void 0, i));
|
|
1868
1888
|
}
|
|
1869
|
-
return s ? (f.res =
|
|
1889
|
+
return s ? (f.res = p, f.usedParams = this.getUsedParamsDetails(i), f) : p;
|
|
1870
1890
|
}
|
|
1871
|
-
extendTranslation(e, t, n,
|
|
1872
|
-
|
|
1873
|
-
if ((c = this.i18nFormat) != null && c.parse)
|
|
1891
|
+
extendTranslation(e, t, n, i, s) {
|
|
1892
|
+
if (this.i18nFormat?.parse)
|
|
1874
1893
|
e = this.i18nFormat.parse(e, {
|
|
1875
1894
|
...this.options.interpolation.defaultVariables,
|
|
1876
1895
|
...n
|
|
1877
|
-
}, n.lng || this.language ||
|
|
1878
|
-
resolved:
|
|
1896
|
+
}, n.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
|
|
1897
|
+
resolved: i
|
|
1879
1898
|
});
|
|
1880
1899
|
else if (!n.skipInterpolation) {
|
|
1881
1900
|
n.interpolation && this.interpolator.init({
|
|
@@ -1885,66 +1904,64 @@ class fe extends pe {
|
|
|
1885
1904
|
...n.interpolation
|
|
1886
1905
|
}
|
|
1887
1906
|
});
|
|
1888
|
-
const
|
|
1889
|
-
let
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1892
|
-
|
|
1907
|
+
const c = x(e) && (n?.interpolation?.skipOnVariables !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
1908
|
+
let l;
|
|
1909
|
+
if (c) {
|
|
1910
|
+
const u = e.match(this.interpolator.nestingRegexp);
|
|
1911
|
+
l = u && u.length;
|
|
1893
1912
|
}
|
|
1894
|
-
let
|
|
1895
|
-
if (this.options.interpolation.defaultVariables && (
|
|
1913
|
+
let d = n.replace && !x(n.replace) ? n.replace : n;
|
|
1914
|
+
if (this.options.interpolation.defaultVariables && (d = {
|
|
1896
1915
|
...this.options.interpolation.defaultVariables,
|
|
1897
|
-
...
|
|
1898
|
-
}), e = this.interpolator.interpolate(e,
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1916
|
+
...d
|
|
1917
|
+
}), e = this.interpolator.interpolate(e, d, n.lng || this.language || i.usedLng, n), c) {
|
|
1918
|
+
const u = e.match(this.interpolator.nestingRegexp), h = u && u.length;
|
|
1919
|
+
l < h && (n.nest = !1);
|
|
1901
1920
|
}
|
|
1902
|
-
!n.lng &&
|
|
1921
|
+
!n.lng && i && i.res && (n.lng = this.language || i.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...u) => s?.[0] === u[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${u[0]} in key: ${t[0]}`), null) : this.translate(...u, t), n)), n.interpolation && this.interpolator.reset();
|
|
1903
1922
|
}
|
|
1904
1923
|
const a = n.postProcess || this.options.postProcess, o = x(a) ? [a] : a;
|
|
1905
|
-
return e != null &&
|
|
1924
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = vt.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
1906
1925
|
i18nResolved: {
|
|
1907
|
-
...
|
|
1926
|
+
...i,
|
|
1908
1927
|
usedParams: this.getUsedParamsDetails(n)
|
|
1909
1928
|
},
|
|
1910
1929
|
...n
|
|
1911
1930
|
} : n, this)), e;
|
|
1912
1931
|
}
|
|
1913
1932
|
resolve(e, t = {}) {
|
|
1914
|
-
let n,
|
|
1933
|
+
let n, i, s, a, o;
|
|
1915
1934
|
return x(e) && (e = [e]), e.forEach((c) => {
|
|
1916
1935
|
if (this.isValidLookup(n)) return;
|
|
1917
1936
|
const l = this.extractFromKey(c, t), d = l.key;
|
|
1918
|
-
|
|
1937
|
+
i = d;
|
|
1919
1938
|
let u = l.namespaces;
|
|
1920
1939
|
this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
|
|
1921
|
-
const h = t.count !== void 0 && !x(t.count), f = h && !t.ordinal && t.count === 0,
|
|
1940
|
+
const h = t.count !== void 0 && !x(t.count), f = h && !t.ordinal && t.count === 0, p = t.context !== void 0 && (x(t.context) || typeof t.context == "number") && t.context !== "", y = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
1922
1941
|
u.forEach((b) => {
|
|
1923
|
-
|
|
1924
|
-
this.isValidLookup(n) || (o = b, !Ze[`${y[0]}-${b}`] && ((w = this.utils) != null && w.hasLoadedNamespace) && !((S = this.utils) != null && S.hasLoadedNamespace(o)) && (Ze[`${y[0]}-${b}`] = !0, this.logger.warn(`key "${r}" for languages "${y.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!!!")), y.forEach((L) => {
|
|
1925
|
-
var V;
|
|
1942
|
+
this.isValidLookup(n) || (o = b, !ze[`${y[0]}-${b}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (ze[`${y[0]}-${b}`] = !0, this.logger.warn(`key "${i}" for languages "${y.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!!!")), y.forEach((v) => {
|
|
1926
1943
|
if (this.isValidLookup(n)) return;
|
|
1927
|
-
a =
|
|
1928
|
-
const
|
|
1929
|
-
if (
|
|
1930
|
-
this.i18nFormat.addLookupKeys(
|
|
1944
|
+
a = v;
|
|
1945
|
+
const w = [d];
|
|
1946
|
+
if (this.i18nFormat?.addLookupKeys)
|
|
1947
|
+
this.i18nFormat.addLookupKeys(w, d, v, b, t);
|
|
1931
1948
|
else {
|
|
1932
|
-
let
|
|
1933
|
-
h && (
|
|
1934
|
-
const
|
|
1935
|
-
if (h && (t.ordinal &&
|
|
1936
|
-
const
|
|
1937
|
-
|
|
1949
|
+
let S;
|
|
1950
|
+
h && (S = this.pluralResolver.getSuffix(v, t.count, t));
|
|
1951
|
+
const k = `${this.options.pluralSeparator}zero`, E = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
1952
|
+
if (h && (t.ordinal && S.indexOf(E) === 0 && w.push(d + S.replace(E, this.options.pluralSeparator)), w.push(d + S), f && w.push(d + k)), p) {
|
|
1953
|
+
const P = `${d}${this.options.contextSeparator || "_"}${t.context}`;
|
|
1954
|
+
w.push(P), h && (t.ordinal && S.indexOf(E) === 0 && w.push(P + S.replace(E, this.options.pluralSeparator)), w.push(P + S), f && w.push(P + k));
|
|
1938
1955
|
}
|
|
1939
1956
|
}
|
|
1940
|
-
let
|
|
1941
|
-
for (;
|
|
1942
|
-
this.isValidLookup(n) || (s =
|
|
1957
|
+
let L;
|
|
1958
|
+
for (; L = w.pop(); )
|
|
1959
|
+
this.isValidLookup(n) || (s = L, n = this.getResource(v, b, L, t));
|
|
1943
1960
|
}));
|
|
1944
1961
|
});
|
|
1945
1962
|
}), {
|
|
1946
1963
|
res: n,
|
|
1947
|
-
usedKey:
|
|
1964
|
+
usedKey: i,
|
|
1948
1965
|
exactUsedKey: s,
|
|
1949
1966
|
usedLng: a,
|
|
1950
1967
|
usedNS: o
|
|
@@ -1953,24 +1970,23 @@ class fe extends pe {
|
|
|
1953
1970
|
isValidLookup(e) {
|
|
1954
1971
|
return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
|
|
1955
1972
|
}
|
|
1956
|
-
getResource(e, t, n,
|
|
1957
|
-
|
|
1958
|
-
return (s = this.i18nFormat) != null && s.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
|
|
1973
|
+
getResource(e, t, n, i = {}) {
|
|
1974
|
+
return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, i) : this.resourceStore.getResource(e, t, n, i);
|
|
1959
1975
|
}
|
|
1960
1976
|
getUsedParamsDetails(e = {}) {
|
|
1961
1977
|
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], n = e.replace && !x(e.replace);
|
|
1962
|
-
let
|
|
1963
|
-
if (n && typeof e.count < "u" && (
|
|
1978
|
+
let i = n ? e.replace : e;
|
|
1979
|
+
if (n && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
|
|
1964
1980
|
...this.options.interpolation.defaultVariables,
|
|
1965
|
-
...
|
|
1981
|
+
...i
|
|
1966
1982
|
}), !n) {
|
|
1967
|
-
|
|
1968
|
-
...
|
|
1983
|
+
i = {
|
|
1984
|
+
...i
|
|
1969
1985
|
};
|
|
1970
1986
|
for (const s of t)
|
|
1971
|
-
delete
|
|
1987
|
+
delete i[s];
|
|
1972
1988
|
}
|
|
1973
|
-
return
|
|
1989
|
+
return i;
|
|
1974
1990
|
}
|
|
1975
1991
|
static hasDefaultValue(e) {
|
|
1976
1992
|
const t = "defaultValue";
|
|
@@ -1980,17 +1996,17 @@ class fe extends pe {
|
|
|
1980
1996
|
return !1;
|
|
1981
1997
|
}
|
|
1982
1998
|
}
|
|
1983
|
-
class
|
|
1999
|
+
class Ue {
|
|
1984
2000
|
constructor(e) {
|
|
1985
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
2001
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = F.create("languageUtils");
|
|
1986
2002
|
}
|
|
1987
2003
|
getScriptPartFromCode(e) {
|
|
1988
|
-
if (e =
|
|
2004
|
+
if (e = te(e), !e || e.indexOf("-") < 0) return null;
|
|
1989
2005
|
const t = e.split("-");
|
|
1990
2006
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
1991
2007
|
}
|
|
1992
2008
|
getLanguagePartFromCode(e) {
|
|
1993
|
-
if (e =
|
|
2009
|
+
if (e = te(e), !e || e.indexOf("-") < 0) return e;
|
|
1994
2010
|
const t = e.split("-");
|
|
1995
2011
|
return this.formatLanguageCode(t[0]);
|
|
1996
2012
|
}
|
|
@@ -2013,12 +2029,12 @@ class Ge {
|
|
|
2013
2029
|
let t;
|
|
2014
2030
|
return e.forEach((n) => {
|
|
2015
2031
|
if (t) return;
|
|
2016
|
-
const
|
|
2017
|
-
(!this.options.supportedLngs || this.isSupportedCode(
|
|
2032
|
+
const i = this.formatLanguageCode(n);
|
|
2033
|
+
(!this.options.supportedLngs || this.isSupportedCode(i)) && (t = i);
|
|
2018
2034
|
}), !t && this.options.supportedLngs && e.forEach((n) => {
|
|
2019
2035
|
if (t) return;
|
|
2020
|
-
const
|
|
2021
|
-
if (this.isSupportedCode(
|
|
2036
|
+
const i = this.getScriptPartFromCode(n);
|
|
2037
|
+
if (this.isSupportedCode(i)) return t = i;
|
|
2022
2038
|
const s = this.getLanguagePartFromCode(n);
|
|
2023
2039
|
if (this.isSupportedCode(s)) return t = s;
|
|
2024
2040
|
t = this.options.supportedLngs.find((a) => {
|
|
@@ -2036,30 +2052,30 @@ class Ge {
|
|
|
2036
2052
|
return n || (n = e[this.getScriptPartFromCode(t)]), n || (n = e[this.formatLanguageCode(t)]), n || (n = e[this.getLanguagePartFromCode(t)]), n || (n = e.default), n || [];
|
|
2037
2053
|
}
|
|
2038
2054
|
toResolveHierarchy(e, t) {
|
|
2039
|
-
const n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e),
|
|
2040
|
-
a && (this.isSupportedCode(a) ?
|
|
2055
|
+
const n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), i = [], s = (a) => {
|
|
2056
|
+
a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
|
|
2041
2057
|
};
|
|
2042
2058
|
return x(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && s(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && s(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && s(this.getLanguagePartFromCode(e))) : x(e) && s(this.formatLanguageCode(e)), n.forEach((a) => {
|
|
2043
|
-
|
|
2044
|
-
}),
|
|
2059
|
+
i.indexOf(a) < 0 && s(this.formatLanguageCode(a));
|
|
2060
|
+
}), i;
|
|
2045
2061
|
}
|
|
2046
2062
|
}
|
|
2047
|
-
const
|
|
2063
|
+
const _e = {
|
|
2048
2064
|
zero: 0,
|
|
2049
2065
|
one: 1,
|
|
2050
2066
|
two: 2,
|
|
2051
2067
|
few: 3,
|
|
2052
2068
|
many: 4,
|
|
2053
2069
|
other: 5
|
|
2054
|
-
},
|
|
2055
|
-
select: (
|
|
2070
|
+
}, We = {
|
|
2071
|
+
select: (r) => r === 1 ? "one" : "other",
|
|
2056
2072
|
resolvedOptions: () => ({
|
|
2057
2073
|
pluralCategories: ["one", "other"]
|
|
2058
2074
|
})
|
|
2059
2075
|
};
|
|
2060
|
-
class
|
|
2076
|
+
class fi {
|
|
2061
2077
|
constructor(e, t = {}) {
|
|
2062
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
2078
|
+
this.languageUtils = e, this.options = t, this.logger = F.create("pluralResolver"), this.pluralRulesCache = {};
|
|
2063
2079
|
}
|
|
2064
2080
|
addRule(e, t) {
|
|
2065
2081
|
this.rules[e] = t;
|
|
@@ -2068,21 +2084,21 @@ class vr {
|
|
|
2068
2084
|
this.pluralRulesCache = {};
|
|
2069
2085
|
}
|
|
2070
2086
|
getRule(e, t = {}) {
|
|
2071
|
-
const n =
|
|
2087
|
+
const n = te(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", s = JSON.stringify({
|
|
2072
2088
|
cleanedCode: n,
|
|
2073
|
-
type:
|
|
2089
|
+
type: i
|
|
2074
2090
|
});
|
|
2075
2091
|
if (s in this.pluralRulesCache)
|
|
2076
2092
|
return this.pluralRulesCache[s];
|
|
2077
2093
|
let a;
|
|
2078
2094
|
try {
|
|
2079
2095
|
a = new Intl.PluralRules(n, {
|
|
2080
|
-
type:
|
|
2096
|
+
type: i
|
|
2081
2097
|
});
|
|
2082
2098
|
} catch {
|
|
2083
2099
|
if (!Intl)
|
|
2084
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
2085
|
-
if (!e.match(/-|_/)) return
|
|
2100
|
+
return this.logger.error("No Intl support, please use an Intl polyfill!"), We;
|
|
2101
|
+
if (!e.match(/-|_/)) return We;
|
|
2086
2102
|
const c = this.languageUtils.getLanguagePartFromCode(e);
|
|
2087
2103
|
a = this.getRule(c, t);
|
|
2088
2104
|
}
|
|
@@ -2090,28 +2106,27 @@ class vr {
|
|
|
2090
2106
|
}
|
|
2091
2107
|
needsPlural(e, t = {}) {
|
|
2092
2108
|
let n = this.getRule(e, t);
|
|
2093
|
-
return n || (n = this.getRule("dev", t)),
|
|
2109
|
+
return n || (n = this.getRule("dev", t)), n?.resolvedOptions().pluralCategories.length > 1;
|
|
2094
2110
|
}
|
|
2095
2111
|
getPluralFormsOfKey(e, t, n = {}) {
|
|
2096
|
-
return this.getSuffixes(e, n).map((
|
|
2112
|
+
return this.getSuffixes(e, n).map((i) => `${t}${i}`);
|
|
2097
2113
|
}
|
|
2098
2114
|
getSuffixes(e, t = {}) {
|
|
2099
2115
|
let n = this.getRule(e, t);
|
|
2100
|
-
return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((
|
|
2116
|
+
return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((i, s) => _e[i] - _e[s]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
|
|
2101
2117
|
}
|
|
2102
2118
|
getSuffix(e, t, n = {}) {
|
|
2103
|
-
const
|
|
2104
|
-
return
|
|
2119
|
+
const i = this.getRule(e, n);
|
|
2120
|
+
return i ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
|
|
2105
2121
|
}
|
|
2106
2122
|
}
|
|
2107
|
-
const
|
|
2108
|
-
let s =
|
|
2109
|
-
return !s &&
|
|
2110
|
-
},
|
|
2111
|
-
class
|
|
2123
|
+
const Ze = (r, e, t, n = ".", i = !0) => {
|
|
2124
|
+
let s = ii(r, e, t);
|
|
2125
|
+
return !s && i && x(t) && (s = be(r, t, n), s === void 0 && (s = be(e, t, n))), s;
|
|
2126
|
+
}, ge = (r) => r.replace(/\$/g, "$$$$");
|
|
2127
|
+
class gi {
|
|
2112
2128
|
constructor(e = {}) {
|
|
2113
|
-
|
|
2114
|
-
this.logger = A.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((n) => n), this.init(e);
|
|
2129
|
+
this.logger = F.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((t) => t), this.init(e);
|
|
2115
2130
|
}
|
|
2116
2131
|
init(e = {}) {
|
|
2117
2132
|
e.interpolation || (e.interpolation = {
|
|
@@ -2120,7 +2135,7 @@ class kr {
|
|
|
2120
2135
|
const {
|
|
2121
2136
|
escape: t,
|
|
2122
2137
|
escapeValue: n,
|
|
2123
|
-
useRawValueToEscape:
|
|
2138
|
+
useRawValueToEscape: i,
|
|
2124
2139
|
prefix: s,
|
|
2125
2140
|
prefixEscaped: a,
|
|
2126
2141
|
suffix: o,
|
|
@@ -2130,79 +2145,78 @@ class kr {
|
|
|
2130
2145
|
unescapePrefix: u,
|
|
2131
2146
|
nestingPrefix: h,
|
|
2132
2147
|
nestingPrefixEscaped: f,
|
|
2133
|
-
nestingSuffix:
|
|
2148
|
+
nestingSuffix: p,
|
|
2134
2149
|
nestingSuffixEscaped: y,
|
|
2135
2150
|
nestingOptionsSeparator: b,
|
|
2136
|
-
maxReplaces:
|
|
2137
|
-
alwaysFormat:
|
|
2151
|
+
maxReplaces: v,
|
|
2152
|
+
alwaysFormat: w
|
|
2138
2153
|
} = e.interpolation;
|
|
2139
|
-
this.escape = t !== void 0 ? t :
|
|
2154
|
+
this.escape = t !== void 0 ? t : si, this.escapeValue = n !== void 0 ? n : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? z(s) : a || "{{", this.suffix = o ? z(o) : c || "}}", this.formatSeparator = l || ",", this.unescapePrefix = d ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : d || "", this.nestingPrefix = h ? z(h) : f || z("$t("), this.nestingSuffix = p ? z(p) : y || z(")"), this.nestingOptionsSeparator = b || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = w !== void 0 ? w : !1, this.resetRegExp();
|
|
2140
2155
|
}
|
|
2141
2156
|
reset() {
|
|
2142
2157
|
this.options && this.init(this.options);
|
|
2143
2158
|
}
|
|
2144
2159
|
resetRegExp() {
|
|
2145
|
-
const e = (t, n) =>
|
|
2160
|
+
const e = (t, n) => t?.source === n ? (t.lastIndex = 0, t) : new RegExp(n, "g");
|
|
2146
2161
|
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}`);
|
|
2147
2162
|
}
|
|
2148
|
-
interpolate(e, t, n,
|
|
2149
|
-
var f;
|
|
2163
|
+
interpolate(e, t, n, i) {
|
|
2150
2164
|
let s, a, o;
|
|
2151
|
-
const c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (
|
|
2152
|
-
if (
|
|
2153
|
-
const
|
|
2154
|
-
return this.alwaysFormat ? this.format(
|
|
2155
|
-
...
|
|
2165
|
+
const c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (f) => {
|
|
2166
|
+
if (f.indexOf(this.formatSeparator) < 0) {
|
|
2167
|
+
const v = Ze(t, c, f, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
2168
|
+
return this.alwaysFormat ? this.format(v, void 0, n, {
|
|
2169
|
+
...i,
|
|
2156
2170
|
...t,
|
|
2157
|
-
interpolationkey:
|
|
2158
|
-
}) :
|
|
2171
|
+
interpolationkey: f
|
|
2172
|
+
}) : v;
|
|
2159
2173
|
}
|
|
2160
|
-
const
|
|
2161
|
-
return this.format(
|
|
2162
|
-
...
|
|
2174
|
+
const p = f.split(this.formatSeparator), y = p.shift().trim(), b = p.join(this.formatSeparator).trim();
|
|
2175
|
+
return this.format(Ze(t, c, y, this.options.keySeparator, this.options.ignoreJSONStructure), b, n, {
|
|
2176
|
+
...i,
|
|
2163
2177
|
...t,
|
|
2164
|
-
interpolationkey:
|
|
2178
|
+
interpolationkey: y
|
|
2165
2179
|
});
|
|
2166
2180
|
};
|
|
2167
2181
|
this.resetRegExp();
|
|
2168
|
-
const d =
|
|
2182
|
+
const d = i?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = i?.interpolation?.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
2169
2183
|
return [{
|
|
2170
2184
|
regex: this.regexpUnescape,
|
|
2171
|
-
safeValue: (
|
|
2185
|
+
safeValue: (f) => ge(f)
|
|
2172
2186
|
}, {
|
|
2173
2187
|
regex: this.regexp,
|
|
2174
|
-
safeValue: (
|
|
2175
|
-
}].forEach((
|
|
2176
|
-
for (o = 0; s =
|
|
2177
|
-
const
|
|
2178
|
-
if (a = l(
|
|
2188
|
+
safeValue: (f) => this.escapeValue ? ge(this.escape(f)) : ge(f)
|
|
2189
|
+
}].forEach((f) => {
|
|
2190
|
+
for (o = 0; s = f.regex.exec(e); ) {
|
|
2191
|
+
const p = s[1].trim();
|
|
2192
|
+
if (a = l(p), a === void 0)
|
|
2179
2193
|
if (typeof d == "function") {
|
|
2180
|
-
const
|
|
2181
|
-
a = x(
|
|
2182
|
-
} else if (
|
|
2194
|
+
const b = d(e, s, i);
|
|
2195
|
+
a = x(b) ? b : "";
|
|
2196
|
+
} else if (i && Object.prototype.hasOwnProperty.call(i, p))
|
|
2183
2197
|
a = "";
|
|
2184
2198
|
else if (u) {
|
|
2185
2199
|
a = s[0];
|
|
2186
2200
|
continue;
|
|
2187
2201
|
} else
|
|
2188
|
-
this.logger.warn(`missed to pass in variable ${
|
|
2189
|
-
else !x(a) && !this.useRawValueToEscape && (a =
|
|
2190
|
-
const
|
|
2191
|
-
if (e = e.replace(s[0],
|
|
2202
|
+
this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), a = "";
|
|
2203
|
+
else !x(a) && !this.useRawValueToEscape && (a = Ie(a));
|
|
2204
|
+
const y = f.safeValue(a);
|
|
2205
|
+
if (e = e.replace(s[0], y), u ? (f.regex.lastIndex += a.length, f.regex.lastIndex -= s[0].length) : f.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
2192
2206
|
break;
|
|
2193
2207
|
}
|
|
2194
2208
|
}), e;
|
|
2195
2209
|
}
|
|
2196
2210
|
nest(e, t, n = {}) {
|
|
2197
|
-
let
|
|
2211
|
+
let i, s, a;
|
|
2198
2212
|
const o = (c, l) => {
|
|
2199
2213
|
const d = this.nestingOptionsSeparator;
|
|
2200
2214
|
if (c.indexOf(d) < 0) return c;
|
|
2201
2215
|
const u = c.split(new RegExp(`${d}[ ]*{`));
|
|
2202
2216
|
let h = `{${u[1]}`;
|
|
2203
2217
|
c = u[0], h = this.interpolate(h, a);
|
|
2204
|
-
const f = h.match(/'/g),
|
|
2205
|
-
((
|
|
2218
|
+
const f = h.match(/'/g), p = h.match(/"/g);
|
|
2219
|
+
((f?.length ?? 0) % 2 === 0 && !p || p.length % 2 !== 0) && (h = h.replace(/'/g, '"'));
|
|
2206
2220
|
try {
|
|
2207
2221
|
a = JSON.parse(h), l && (a = {
|
|
2208
2222
|
...l,
|
|
@@ -2213,29 +2227,29 @@ class kr {
|
|
|
2213
2227
|
}
|
|
2214
2228
|
return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, c;
|
|
2215
2229
|
};
|
|
2216
|
-
for (;
|
|
2230
|
+
for (; i = this.nestingRegexp.exec(e); ) {
|
|
2217
2231
|
let c = [];
|
|
2218
2232
|
a = {
|
|
2219
2233
|
...n
|
|
2220
2234
|
}, a = a.replace && !x(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
2221
|
-
const l = /{.*}/.test(
|
|
2222
|
-
if (l !== -1 && (c =
|
|
2223
|
-
x(s) || (s =
|
|
2235
|
+
const l = /{.*}/.test(i[1]) ? i[1].lastIndexOf("}") + 1 : i[1].indexOf(this.formatSeparator);
|
|
2236
|
+
if (l !== -1 && (c = i[1].slice(l).split(this.formatSeparator).map((d) => d.trim()).filter(Boolean), i[1] = i[1].slice(0, l)), s = t(o.call(this, i[1].trim(), a), a), s && i[0] === e && !x(s)) return s;
|
|
2237
|
+
x(s) || (s = Ie(s)), s || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), s = ""), c.length && (s = c.reduce((d, u) => this.format(d, u, n.lng, {
|
|
2224
2238
|
...n,
|
|
2225
|
-
interpolationkey:
|
|
2226
|
-
}), s.trim())), e = e.replace(
|
|
2239
|
+
interpolationkey: i[1].trim()
|
|
2240
|
+
}), s.trim())), e = e.replace(i[0], s), this.regexp.lastIndex = 0;
|
|
2227
2241
|
}
|
|
2228
2242
|
return e;
|
|
2229
2243
|
}
|
|
2230
2244
|
}
|
|
2231
|
-
const
|
|
2232
|
-
let e =
|
|
2245
|
+
const pi = (r) => {
|
|
2246
|
+
let e = r.toLowerCase().trim();
|
|
2233
2247
|
const t = {};
|
|
2234
|
-
if (
|
|
2235
|
-
const n =
|
|
2248
|
+
if (r.indexOf("(") > -1) {
|
|
2249
|
+
const n = r.split("(");
|
|
2236
2250
|
e = n[0].toLowerCase().trim();
|
|
2237
|
-
const
|
|
2238
|
-
e === "currency" &&
|
|
2251
|
+
const i = n[1].substring(0, n[1].length - 1);
|
|
2252
|
+
e === "currency" && i.indexOf(":") < 0 ? t.currency || (t.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? t.range || (t.range = i.trim()) : i.split(";").forEach((a) => {
|
|
2239
2253
|
if (a) {
|
|
2240
2254
|
const [o, ...c] = a.split(":"), l = c.join(":").trim().replace(/^'+|'+$/g, ""), d = o.trim();
|
|
2241
2255
|
t[d] || (t[d] = l), l === "false" && (t[d] = !1), l === "true" && (t[d] = !0), isNaN(l) || (t[d] = parseInt(l, 10));
|
|
@@ -2246,56 +2260,56 @@ const Sr = (i) => {
|
|
|
2246
2260
|
formatName: e,
|
|
2247
2261
|
formatOptions: t
|
|
2248
2262
|
};
|
|
2249
|
-
},
|
|
2263
|
+
}, Je = (r) => {
|
|
2250
2264
|
const e = {};
|
|
2251
|
-
return (t, n,
|
|
2252
|
-
let s =
|
|
2253
|
-
|
|
2265
|
+
return (t, n, i) => {
|
|
2266
|
+
let s = i;
|
|
2267
|
+
i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (s = {
|
|
2254
2268
|
...s,
|
|
2255
|
-
[
|
|
2269
|
+
[i.interpolationkey]: void 0
|
|
2256
2270
|
});
|
|
2257
2271
|
const a = n + JSON.stringify(s);
|
|
2258
2272
|
let o = e[a];
|
|
2259
|
-
return o || (o =
|
|
2273
|
+
return o || (o = r(te(n), i), e[a] = o), o(t);
|
|
2260
2274
|
};
|
|
2261
|
-
},
|
|
2262
|
-
class
|
|
2275
|
+
}, mi = (r) => (e, t, n) => r(te(t), n)(e);
|
|
2276
|
+
class yi {
|
|
2263
2277
|
constructor(e = {}) {
|
|
2264
|
-
this.logger =
|
|
2278
|
+
this.logger = F.create("formatter"), this.options = e, this.init(e);
|
|
2265
2279
|
}
|
|
2266
2280
|
init(e, t = {
|
|
2267
2281
|
interpolation: {}
|
|
2268
2282
|
}) {
|
|
2269
2283
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
2270
|
-
const n = t.cacheInBuiltFormats ?
|
|
2284
|
+
const n = t.cacheInBuiltFormats ? Je : mi;
|
|
2271
2285
|
this.formats = {
|
|
2272
|
-
number: n((
|
|
2273
|
-
const a = new Intl.NumberFormat(
|
|
2286
|
+
number: n((i, s) => {
|
|
2287
|
+
const a = new Intl.NumberFormat(i, {
|
|
2274
2288
|
...s
|
|
2275
2289
|
});
|
|
2276
2290
|
return (o) => a.format(o);
|
|
2277
2291
|
}),
|
|
2278
|
-
currency: n((
|
|
2279
|
-
const a = new Intl.NumberFormat(
|
|
2292
|
+
currency: n((i, s) => {
|
|
2293
|
+
const a = new Intl.NumberFormat(i, {
|
|
2280
2294
|
...s,
|
|
2281
2295
|
style: "currency"
|
|
2282
2296
|
});
|
|
2283
2297
|
return (o) => a.format(o);
|
|
2284
2298
|
}),
|
|
2285
|
-
datetime: n((
|
|
2286
|
-
const a = new Intl.DateTimeFormat(
|
|
2299
|
+
datetime: n((i, s) => {
|
|
2300
|
+
const a = new Intl.DateTimeFormat(i, {
|
|
2287
2301
|
...s
|
|
2288
2302
|
});
|
|
2289
2303
|
return (o) => a.format(o);
|
|
2290
2304
|
}),
|
|
2291
|
-
relativetime: n((
|
|
2292
|
-
const a = new Intl.RelativeTimeFormat(
|
|
2305
|
+
relativetime: n((i, s) => {
|
|
2306
|
+
const a = new Intl.RelativeTimeFormat(i, {
|
|
2293
2307
|
...s
|
|
2294
2308
|
});
|
|
2295
2309
|
return (o) => a.format(o, s.range || "day");
|
|
2296
2310
|
}),
|
|
2297
|
-
list: n((
|
|
2298
|
-
const a = new Intl.ListFormat(
|
|
2311
|
+
list: n((i, s) => {
|
|
2312
|
+
const a = new Intl.ListFormat(i, {
|
|
2299
2313
|
...s
|
|
2300
2314
|
});
|
|
2301
2315
|
return (o) => a.format(o);
|
|
@@ -2306,48 +2320,46 @@ class Er {
|
|
|
2306
2320
|
this.formats[e.toLowerCase().trim()] = t;
|
|
2307
2321
|
}
|
|
2308
2322
|
addCached(e, t) {
|
|
2309
|
-
this.formats[e.toLowerCase().trim()] =
|
|
2323
|
+
this.formats[e.toLowerCase().trim()] = Je(t);
|
|
2310
2324
|
}
|
|
2311
|
-
format(e, t, n,
|
|
2325
|
+
format(e, t, n, i = {}) {
|
|
2312
2326
|
const s = t.split(this.formatSeparator);
|
|
2313
2327
|
if (s.length > 1 && s[0].indexOf("(") > 1 && s[0].indexOf(")") < 0 && s.find((o) => o.indexOf(")") > -1)) {
|
|
2314
2328
|
const o = s.findIndex((c) => c.indexOf(")") > -1);
|
|
2315
2329
|
s[0] = [s[0], ...s.splice(1, o)].join(this.formatSeparator);
|
|
2316
2330
|
}
|
|
2317
2331
|
return s.reduce((o, c) => {
|
|
2318
|
-
var u;
|
|
2319
2332
|
const {
|
|
2320
2333
|
formatName: l,
|
|
2321
2334
|
formatOptions: d
|
|
2322
|
-
} =
|
|
2335
|
+
} = pi(c);
|
|
2323
2336
|
if (this.formats[l]) {
|
|
2324
|
-
let
|
|
2337
|
+
let u = o;
|
|
2325
2338
|
try {
|
|
2326
|
-
const
|
|
2327
|
-
|
|
2339
|
+
const h = i?.formatParams?.[i.interpolationkey] || {}, f = h.locale || h.lng || i.locale || i.lng || n;
|
|
2340
|
+
u = this.formats[l](o, f, {
|
|
2328
2341
|
...d,
|
|
2329
|
-
...
|
|
2330
|
-
...
|
|
2342
|
+
...i,
|
|
2343
|
+
...h
|
|
2331
2344
|
});
|
|
2332
|
-
} catch (
|
|
2333
|
-
this.logger.warn(
|
|
2345
|
+
} catch (h) {
|
|
2346
|
+
this.logger.warn(h);
|
|
2334
2347
|
}
|
|
2335
|
-
return
|
|
2348
|
+
return u;
|
|
2336
2349
|
} else
|
|
2337
2350
|
this.logger.warn(`there was no format function for ${l}`);
|
|
2338
2351
|
return o;
|
|
2339
2352
|
}, e);
|
|
2340
2353
|
}
|
|
2341
2354
|
}
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2355
|
+
const xi = (r, e) => {
|
|
2356
|
+
r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
|
|
2344
2357
|
};
|
|
2345
|
-
class
|
|
2346
|
-
constructor(e, t, n,
|
|
2347
|
-
|
|
2348
|
-
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = A.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], (a = (s = this.backend) == null ? void 0 : s.init) == null || a.call(s, n, r.backend, r);
|
|
2358
|
+
class bi extends ue {
|
|
2359
|
+
constructor(e, t, n, i = {}) {
|
|
2360
|
+
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = i, this.logger = F.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, i.backend, i);
|
|
2349
2361
|
}
|
|
2350
|
-
queueLoad(e, t, n,
|
|
2362
|
+
queueLoad(e, t, n, i) {
|
|
2351
2363
|
const s = {}, a = {}, o = {}, c = {};
|
|
2352
2364
|
return e.forEach((l) => {
|
|
2353
2365
|
let d = !0;
|
|
@@ -2360,7 +2372,7 @@ class Pr extends pe {
|
|
|
2360
2372
|
pendingCount: Object.keys(a).length,
|
|
2361
2373
|
loaded: {},
|
|
2362
2374
|
errors: [],
|
|
2363
|
-
callback:
|
|
2375
|
+
callback: i
|
|
2364
2376
|
}), {
|
|
2365
2377
|
toLoad: Object.keys(s),
|
|
2366
2378
|
pending: Object.keys(a),
|
|
@@ -2369,13 +2381,13 @@ class Pr extends pe {
|
|
|
2369
2381
|
};
|
|
2370
2382
|
}
|
|
2371
2383
|
loaded(e, t, n) {
|
|
2372
|
-
const
|
|
2384
|
+
const i = e.split("|"), s = i[0], a = i[1];
|
|
2373
2385
|
t && this.emit("failedLoading", s, a, t), !t && n && this.store.addResourceBundle(s, a, n, void 0, void 0, {
|
|
2374
2386
|
skipCopy: !0
|
|
2375
2387
|
}), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
|
|
2376
2388
|
const o = {};
|
|
2377
2389
|
this.queue.forEach((c) => {
|
|
2378
|
-
|
|
2390
|
+
ni(c.loaded, [s], a), xi(c, e), t && c.errors.push(t), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((l) => {
|
|
2379
2391
|
o[l] || (o[l] = {});
|
|
2380
2392
|
const d = c.loaded[l];
|
|
2381
2393
|
d.length && d.forEach((u) => {
|
|
@@ -2384,14 +2396,14 @@ class Pr extends pe {
|
|
|
2384
2396
|
}), c.done = !0, c.errors.length ? c.callback(c.errors) : c.callback());
|
|
2385
2397
|
}), this.emit("loaded", o), this.queue = this.queue.filter((c) => !c.done);
|
|
2386
2398
|
}
|
|
2387
|
-
read(e, t, n,
|
|
2399
|
+
read(e, t, n, i = 0, s = this.retryTimeout, a) {
|
|
2388
2400
|
if (!e.length) return a(null, {});
|
|
2389
2401
|
if (this.readingCalls >= this.maxParallelReads) {
|
|
2390
2402
|
this.waitingReads.push({
|
|
2391
2403
|
lng: e,
|
|
2392
2404
|
ns: t,
|
|
2393
2405
|
fcName: n,
|
|
2394
|
-
tried:
|
|
2406
|
+
tried: i,
|
|
2395
2407
|
wait: s,
|
|
2396
2408
|
callback: a
|
|
2397
2409
|
});
|
|
@@ -2403,9 +2415,9 @@ class Pr extends pe {
|
|
|
2403
2415
|
const u = this.waitingReads.shift();
|
|
2404
2416
|
this.read(u.lng, u.ns, u.fcName, u.tried, u.wait, u.callback);
|
|
2405
2417
|
}
|
|
2406
|
-
if (l && d &&
|
|
2418
|
+
if (l && d && i < this.maxRetries) {
|
|
2407
2419
|
setTimeout(() => {
|
|
2408
|
-
this.read.call(this, e, t, n,
|
|
2420
|
+
this.read.call(this, e, t, n, i + 1, s * 2, a);
|
|
2409
2421
|
}, s);
|
|
2410
2422
|
return;
|
|
2411
2423
|
}
|
|
@@ -2422,13 +2434,13 @@ class Pr extends pe {
|
|
|
2422
2434
|
}
|
|
2423
2435
|
return c(e, t, o);
|
|
2424
2436
|
}
|
|
2425
|
-
prepareLoading(e, t, n = {},
|
|
2437
|
+
prepareLoading(e, t, n = {}, i) {
|
|
2426
2438
|
if (!this.backend)
|
|
2427
|
-
return this.logger.warn("No backend was added via i18next.use. Will not load resources."),
|
|
2439
|
+
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
|
|
2428
2440
|
x(e) && (e = this.languageUtils.toResolveHierarchy(e)), x(t) && (t = [t]);
|
|
2429
|
-
const s = this.queueLoad(e, t, n,
|
|
2441
|
+
const s = this.queueLoad(e, t, n, i);
|
|
2430
2442
|
if (!s.toLoad.length)
|
|
2431
|
-
return s.pending.length ||
|
|
2443
|
+
return s.pending.length || i(), null;
|
|
2432
2444
|
s.toLoad.forEach((a) => {
|
|
2433
2445
|
this.loadOne(a);
|
|
2434
2446
|
});
|
|
@@ -2442,39 +2454,38 @@ class Pr extends pe {
|
|
|
2442
2454
|
}, n);
|
|
2443
2455
|
}
|
|
2444
2456
|
loadOne(e, t = "") {
|
|
2445
|
-
const n = e.split("|"),
|
|
2446
|
-
this.read(
|
|
2447
|
-
a && this.logger.warn(`${t}loading namespace ${s} for language ${
|
|
2457
|
+
const n = e.split("|"), i = n[0], s = n[1];
|
|
2458
|
+
this.read(i, s, "read", void 0, void 0, (a, o) => {
|
|
2459
|
+
a && this.logger.warn(`${t}loading namespace ${s} for language ${i} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${s} for language ${i}`, o), this.loaded(e, a, o);
|
|
2448
2460
|
});
|
|
2449
2461
|
}
|
|
2450
|
-
saveMissing(e, t, n,
|
|
2462
|
+
saveMissing(e, t, n, i, s, a = {}, o = () => {
|
|
2451
2463
|
}) {
|
|
2452
|
-
|
|
2453
|
-
if ((l = (c = this.services) == null ? void 0 : c.utils) != null && l.hasLoadedNamespace && !((u = (d = this.services) == null ? void 0 : d.utils) != null && u.hasLoadedNamespace(t))) {
|
|
2464
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
|
|
2454
2465
|
this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
|
|
2455
2466
|
return;
|
|
2456
2467
|
}
|
|
2457
2468
|
if (!(n == null || n === "")) {
|
|
2458
|
-
if (
|
|
2459
|
-
const
|
|
2469
|
+
if (this.backend?.create) {
|
|
2470
|
+
const c = {
|
|
2460
2471
|
...a,
|
|
2461
2472
|
isUpdate: s
|
|
2462
|
-
},
|
|
2463
|
-
if (
|
|
2473
|
+
}, l = this.backend.create.bind(this.backend);
|
|
2474
|
+
if (l.length < 6)
|
|
2464
2475
|
try {
|
|
2465
|
-
let
|
|
2466
|
-
|
|
2467
|
-
} catch (
|
|
2468
|
-
o(
|
|
2476
|
+
let d;
|
|
2477
|
+
l.length === 5 ? d = l(e, t, n, i, c) : d = l(e, t, n, i), d && typeof d.then == "function" ? d.then((u) => o(null, u)).catch(o) : o(null, d);
|
|
2478
|
+
} catch (d) {
|
|
2479
|
+
o(d);
|
|
2469
2480
|
}
|
|
2470
2481
|
else
|
|
2471
|
-
|
|
2482
|
+
l(e, t, n, i, o, c);
|
|
2472
2483
|
}
|
|
2473
|
-
!e || !e[0] || this.store.addResource(e[0], t, n,
|
|
2484
|
+
!e || !e[0] || this.store.addResource(e[0], t, n, i);
|
|
2474
2485
|
}
|
|
2475
2486
|
}
|
|
2476
2487
|
}
|
|
2477
|
-
const
|
|
2488
|
+
const Qe = () => ({
|
|
2478
2489
|
debug: !1,
|
|
2479
2490
|
initAsync: !0,
|
|
2480
2491
|
ns: ["translation"],
|
|
@@ -2507,10 +2518,10 @@ const tt = () => ({
|
|
|
2507
2518
|
parseMissingKeyHandler: !1,
|
|
2508
2519
|
appendNamespaceToMissingKey: !1,
|
|
2509
2520
|
appendNamespaceToCIMode: !1,
|
|
2510
|
-
overloadTranslationOptionHandler: (
|
|
2521
|
+
overloadTranslationOptionHandler: (r) => {
|
|
2511
2522
|
let e = {};
|
|
2512
|
-
if (typeof
|
|
2513
|
-
const t =
|
|
2523
|
+
if (typeof r[1] == "object" && (e = r[1]), x(r[1]) && (e.defaultValue = r[1]), x(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
|
|
2524
|
+
const t = r[3] || r[2];
|
|
2514
2525
|
Object.keys(t).forEach((n) => {
|
|
2515
2526
|
e[n] = t[n];
|
|
2516
2527
|
});
|
|
@@ -2519,7 +2530,7 @@ const tt = () => ({
|
|
|
2519
2530
|
},
|
|
2520
2531
|
interpolation: {
|
|
2521
2532
|
escapeValue: !0,
|
|
2522
|
-
format: (
|
|
2533
|
+
format: (r) => r,
|
|
2523
2534
|
prefix: "{{",
|
|
2524
2535
|
suffix: "}}",
|
|
2525
2536
|
formatSeparator: ",",
|
|
@@ -2531,20 +2542,17 @@ const tt = () => ({
|
|
|
2531
2542
|
skipOnVariables: !0
|
|
2532
2543
|
},
|
|
2533
2544
|
cacheInBuiltFormats: !0
|
|
2534
|
-
}),
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
}, Nr = (i) => {
|
|
2539
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
2540
|
-
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
2545
|
+
}), Ge = (r) => (x(r.ns) && (r.ns = [r.ns]), x(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), x(r.fallbackNS) && (r.fallbackNS = [r.fallbackNS]), r.supportedLngs?.indexOf?.("cimode") < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), typeof r.initImmediate == "boolean" && (r.initAsync = r.initImmediate), r), se = () => {
|
|
2546
|
+
}, wi = (r) => {
|
|
2547
|
+
Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
|
|
2548
|
+
typeof r[t] == "function" && (r[t] = r[t].bind(r));
|
|
2541
2549
|
});
|
|
2542
2550
|
};
|
|
2543
|
-
class
|
|
2551
|
+
class ne extends ue {
|
|
2544
2552
|
constructor(e = {}, t) {
|
|
2545
|
-
if (super(), this.options =
|
|
2553
|
+
if (super(), this.options = Ge(e), this.services = {}, this.logger = F, this.modules = {
|
|
2546
2554
|
external: []
|
|
2547
|
-
},
|
|
2555
|
+
}, wi(this), t && !this.isInitialized && !e.isClone) {
|
|
2548
2556
|
if (!this.options.initAsync)
|
|
2549
2557
|
return this.init(e, t), this;
|
|
2550
2558
|
setTimeout(() => {
|
|
@@ -2554,37 +2562,37 @@ class se extends pe {
|
|
|
2554
2562
|
}
|
|
2555
2563
|
init(e = {}, t) {
|
|
2556
2564
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (x(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
2557
|
-
const n =
|
|
2565
|
+
const n = Qe();
|
|
2558
2566
|
this.options = {
|
|
2559
2567
|
...n,
|
|
2560
2568
|
...this.options,
|
|
2561
|
-
...
|
|
2569
|
+
...Ge(e)
|
|
2562
2570
|
}, this.options.interpolation = {
|
|
2563
2571
|
...n.interpolation,
|
|
2564
2572
|
...this.options.interpolation
|
|
2565
2573
|
}, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator);
|
|
2566
|
-
const
|
|
2574
|
+
const i = (l) => l ? typeof l == "function" ? new l() : l : null;
|
|
2567
2575
|
if (!this.options.isClone) {
|
|
2568
|
-
this.modules.logger ?
|
|
2576
|
+
this.modules.logger ? F.init(i(this.modules.logger), this.options) : F.init(null, this.options);
|
|
2569
2577
|
let l;
|
|
2570
|
-
this.modules.formatter ? l = this.modules.formatter : l =
|
|
2571
|
-
const d = new
|
|
2572
|
-
this.store = new
|
|
2578
|
+
this.modules.formatter ? l = this.modules.formatter : l = yi;
|
|
2579
|
+
const d = new Ue(this.options);
|
|
2580
|
+
this.store = new Be(this.options.resources, this.options);
|
|
2573
2581
|
const u = this.services;
|
|
2574
|
-
u.logger =
|
|
2582
|
+
u.logger = F, u.resourceStore = this.store, u.languageUtils = d, u.pluralResolver = new fi(d, {
|
|
2575
2583
|
prepend: this.options.pluralSeparator,
|
|
2576
2584
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
2577
|
-
}), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), l && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (u.formatter =
|
|
2585
|
+
}), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), l && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (u.formatter = i(l), u.formatter.init && u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new gi(this.options), u.utils = {
|
|
2578
2586
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
2579
|
-
}, u.backendConnector = new
|
|
2580
|
-
this.emit(f, ...
|
|
2581
|
-
}), this.modules.languageDetector && (u.languageDetector =
|
|
2582
|
-
this.emit(f, ...
|
|
2587
|
+
}, u.backendConnector = new bi(i(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", (f, ...p) => {
|
|
2588
|
+
this.emit(f, ...p);
|
|
2589
|
+
}), this.modules.languageDetector && (u.languageDetector = i(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = i(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new ce(this.services, this.options), this.translator.on("*", (f, ...p) => {
|
|
2590
|
+
this.emit(f, ...p);
|
|
2583
2591
|
}), this.modules.external.forEach((f) => {
|
|
2584
2592
|
f.init && f.init(this);
|
|
2585
2593
|
});
|
|
2586
2594
|
}
|
|
2587
|
-
if (this.format = this.options.interpolation.format, t || (t =
|
|
2595
|
+
if (this.format = this.options.interpolation.format, t || (t = se), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2588
2596
|
const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2589
2597
|
l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
|
|
2590
2598
|
}
|
|
@@ -2593,7 +2601,7 @@ class se extends pe {
|
|
|
2593
2601
|
}), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((l) => {
|
|
2594
2602
|
this[l] = (...d) => (this.store[l](...d), this);
|
|
2595
2603
|
});
|
|
2596
|
-
const o =
|
|
2604
|
+
const o = Y(), c = () => {
|
|
2597
2605
|
const l = (d, u) => {
|
|
2598
2606
|
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), o.resolve(u), t(d, u);
|
|
2599
2607
|
};
|
|
@@ -2602,34 +2610,33 @@ class se extends pe {
|
|
|
2602
2610
|
};
|
|
2603
2611
|
return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), o;
|
|
2604
2612
|
}
|
|
2605
|
-
loadResources(e, t =
|
|
2606
|
-
var s, a;
|
|
2613
|
+
loadResources(e, t = se) {
|
|
2607
2614
|
let n = t;
|
|
2608
|
-
const
|
|
2615
|
+
const i = x(e) ? e : this.language;
|
|
2609
2616
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
2610
|
-
if (
|
|
2611
|
-
const
|
|
2612
|
-
if (!
|
|
2613
|
-
this.services.languageUtils.toResolveHierarchy(
|
|
2614
|
-
|
|
2617
|
+
if (i?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
2618
|
+
const s = [], a = (o) => {
|
|
2619
|
+
if (!o || o === "cimode") return;
|
|
2620
|
+
this.services.languageUtils.toResolveHierarchy(o).forEach((l) => {
|
|
2621
|
+
l !== "cimode" && s.indexOf(l) < 0 && s.push(l);
|
|
2615
2622
|
});
|
|
2616
2623
|
};
|
|
2617
|
-
|
|
2618
|
-
!
|
|
2624
|
+
i ? a(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((c) => a(c)), this.options.preload?.forEach?.((o) => a(o)), this.services.backendConnector.load(s, this.options.ns, (o) => {
|
|
2625
|
+
!o && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(o);
|
|
2619
2626
|
});
|
|
2620
2627
|
} else
|
|
2621
2628
|
n(null);
|
|
2622
2629
|
}
|
|
2623
2630
|
reloadResources(e, t, n) {
|
|
2624
|
-
const
|
|
2625
|
-
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), n || (n =
|
|
2626
|
-
|
|
2627
|
-
}),
|
|
2631
|
+
const i = Y();
|
|
2632
|
+
return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), n || (n = se), this.services.backendConnector.reload(e, t, (s) => {
|
|
2633
|
+
i.resolve(), n(s);
|
|
2634
|
+
}), i;
|
|
2628
2635
|
}
|
|
2629
2636
|
use(e) {
|
|
2630
2637
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
2631
2638
|
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
2632
|
-
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" &&
|
|
2639
|
+
return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && vt.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
2633
2640
|
}
|
|
2634
2641
|
setResolvedLanguage(e) {
|
|
2635
2642
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -2645,47 +2652,44 @@ class se extends pe {
|
|
|
2645
2652
|
}
|
|
2646
2653
|
changeLanguage(e, t) {
|
|
2647
2654
|
this.isLanguageChangingTo = e;
|
|
2648
|
-
const n =
|
|
2655
|
+
const n = Y();
|
|
2649
2656
|
this.emit("languageChanging", e);
|
|
2650
|
-
const
|
|
2657
|
+
const i = (o) => {
|
|
2651
2658
|
this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
|
|
2652
2659
|
}, s = (o, c) => {
|
|
2653
|
-
c ? this.isLanguageChangingTo === e && (
|
|
2660
|
+
c ? this.isLanguageChangingTo === e && (i(c), this.translator.changeLanguage(c), this.isLanguageChangingTo = void 0, this.emit("languageChanged", c), this.logger.log("languageChanged", c)) : this.isLanguageChangingTo = void 0, n.resolve((...l) => this.t(...l)), t && t(o, (...l) => this.t(...l));
|
|
2654
2661
|
}, a = (o) => {
|
|
2655
|
-
var d, u;
|
|
2656
2662
|
!e && !o && this.services.languageDetector && (o = []);
|
|
2657
2663
|
const c = x(o) ? o : o && o[0], l = this.store.hasLanguageSomeTranslations(c) ? c : this.services.languageUtils.getBestMatchFromCodes(x(o) ? [o] : o);
|
|
2658
|
-
l && (this.language ||
|
|
2659
|
-
s(
|
|
2664
|
+
l && (this.language || i(l), this.translator.language || this.translator.changeLanguage(l), this.services.languageDetector?.cacheUserLanguage?.(l)), this.loadResources(l, (d) => {
|
|
2665
|
+
s(d, l);
|
|
2660
2666
|
});
|
|
2661
2667
|
};
|
|
2662
2668
|
return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
|
|
2663
2669
|
}
|
|
2664
2670
|
getFixedT(e, t, n) {
|
|
2665
|
-
const
|
|
2671
|
+
const i = (s, a, ...o) => {
|
|
2666
2672
|
let c;
|
|
2667
2673
|
typeof a != "object" ? c = this.options.overloadTranslationOptionHandler([s, a].concat(o)) : c = {
|
|
2668
2674
|
...a
|
|
2669
|
-
}, c.lng = c.lng ||
|
|
2675
|
+
}, c.lng = c.lng || i.lng, c.lngs = c.lngs || i.lngs, c.ns = c.ns || i.ns, c.keyPrefix !== "" && (c.keyPrefix = c.keyPrefix || n || i.keyPrefix);
|
|
2670
2676
|
const l = this.options.keySeparator || ".";
|
|
2671
2677
|
let d;
|
|
2672
|
-
return c.keyPrefix && Array.isArray(s) ? d = s.map((u) => (typeof u == "function" && (u =
|
|
2678
|
+
return c.keyPrefix && Array.isArray(s) ? d = s.map((u) => (typeof u == "function" && (u = ve(u, {
|
|
2673
2679
|
...this.options,
|
|
2674
2680
|
...a
|
|
2675
|
-
})), `${c.keyPrefix}${l}${u}`)) : (typeof s == "function" && (s =
|
|
2681
|
+
})), `${c.keyPrefix}${l}${u}`)) : (typeof s == "function" && (s = ve(s, {
|
|
2676
2682
|
...this.options,
|
|
2677
2683
|
...a
|
|
2678
2684
|
})), d = c.keyPrefix ? `${c.keyPrefix}${l}${s}` : s), this.t(d, c);
|
|
2679
2685
|
};
|
|
2680
|
-
return x(e) ?
|
|
2686
|
+
return x(e) ? i.lng = e : i.lngs = e, i.ns = t, i.keyPrefix = n, i;
|
|
2681
2687
|
}
|
|
2682
2688
|
t(...e) {
|
|
2683
|
-
|
|
2684
|
-
return (t = this.translator) == null ? void 0 : t.translate(...e);
|
|
2689
|
+
return this.translator?.translate(...e);
|
|
2685
2690
|
}
|
|
2686
2691
|
exists(...e) {
|
|
2687
|
-
|
|
2688
|
-
return (t = this.translator) == null ? void 0 : t.exists(...e);
|
|
2692
|
+
return this.translator?.exists(...e);
|
|
2689
2693
|
}
|
|
2690
2694
|
setDefaultNamespace(e) {
|
|
2691
2695
|
this.options.defaultNS = e;
|
|
@@ -2695,7 +2699,7 @@ class se extends pe {
|
|
|
2695
2699
|
return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
|
|
2696
2700
|
if (!this.languages || !this.languages.length)
|
|
2697
2701
|
return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
|
|
2698
|
-
const n = t.lng || this.resolvedLanguage || this.languages[0],
|
|
2702
|
+
const n = t.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, s = this.languages[this.languages.length - 1];
|
|
2699
2703
|
if (n.toLowerCase() === "cimode") return !0;
|
|
2700
2704
|
const a = (o, c) => {
|
|
2701
2705
|
const l = this.services.backendConnector.state[`${o}|${c}`];
|
|
@@ -2705,49 +2709,48 @@ class se extends pe {
|
|
|
2705
2709
|
const o = t.precheck(this, a);
|
|
2706
2710
|
if (o !== void 0) return o;
|
|
2707
2711
|
}
|
|
2708
|
-
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!
|
|
2712
|
+
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!i || a(s, e)));
|
|
2709
2713
|
}
|
|
2710
2714
|
loadNamespaces(e, t) {
|
|
2711
|
-
const n =
|
|
2712
|
-
return this.options.ns ? (x(e) && (e = [e]), e.forEach((
|
|
2713
|
-
this.options.ns.indexOf(
|
|
2714
|
-
}), this.loadResources((
|
|
2715
|
-
n.resolve(), t && t(
|
|
2715
|
+
const n = Y();
|
|
2716
|
+
return this.options.ns ? (x(e) && (e = [e]), e.forEach((i) => {
|
|
2717
|
+
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
2718
|
+
}), this.loadResources((i) => {
|
|
2719
|
+
n.resolve(), t && t(i);
|
|
2716
2720
|
}), n) : (t && t(), Promise.resolve());
|
|
2717
2721
|
}
|
|
2718
2722
|
loadLanguages(e, t) {
|
|
2719
|
-
const n =
|
|
2723
|
+
const n = Y();
|
|
2720
2724
|
x(e) && (e = [e]);
|
|
2721
|
-
const
|
|
2722
|
-
return s.length ? (this.options.preload =
|
|
2725
|
+
const i = this.options.preload || [], s = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
|
|
2726
|
+
return s.length ? (this.options.preload = i.concat(s), this.loadResources((a) => {
|
|
2723
2727
|
n.resolve(), t && t(a);
|
|
2724
2728
|
}), n) : (t && t(), Promise.resolve());
|
|
2725
2729
|
}
|
|
2726
2730
|
dir(e) {
|
|
2727
|
-
|
|
2728
|
-
if (e || (e = this.resolvedLanguage || (((r = this.languages) == null ? void 0 : r.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
2731
|
+
if (e || (e = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
2729
2732
|
try {
|
|
2730
|
-
const
|
|
2731
|
-
if (
|
|
2732
|
-
const
|
|
2733
|
-
if (
|
|
2733
|
+
const i = new Intl.Locale(e);
|
|
2734
|
+
if (i && i.getTextInfo) {
|
|
2735
|
+
const s = i.getTextInfo();
|
|
2736
|
+
if (s && s.direction) return s.direction;
|
|
2734
2737
|
}
|
|
2735
2738
|
} catch {
|
|
2736
2739
|
}
|
|
2737
|
-
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n =
|
|
2740
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = this.services?.languageUtils || new Ue(Qe());
|
|
2738
2741
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
2739
2742
|
}
|
|
2740
2743
|
static createInstance(e = {}, t) {
|
|
2741
|
-
return new
|
|
2744
|
+
return new ne(e, t);
|
|
2742
2745
|
}
|
|
2743
|
-
cloneInstance(e = {}, t =
|
|
2746
|
+
cloneInstance(e = {}, t = se) {
|
|
2744
2747
|
const n = e.forkResourceStore;
|
|
2745
2748
|
n && delete e.forkResourceStore;
|
|
2746
|
-
const
|
|
2749
|
+
const i = {
|
|
2747
2750
|
...this.options,
|
|
2748
2751
|
...e,
|
|
2749
2752
|
isClone: !0
|
|
2750
|
-
}, s = new
|
|
2753
|
+
}, s = new ne(i);
|
|
2751
2754
|
if ((e.debug !== void 0 || e.prefix !== void 0) && (s.logger = s.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
|
|
2752
2755
|
s[o] = this[o];
|
|
2753
2756
|
}), s.services = {
|
|
@@ -2760,11 +2763,11 @@ class se extends pe {
|
|
|
2760
2763
|
}, c[l] = Object.keys(c[l]).reduce((d, u) => (d[u] = {
|
|
2761
2764
|
...c[l][u]
|
|
2762
2765
|
}, d), c[l]), c), {});
|
|
2763
|
-
s.store = new
|
|
2766
|
+
s.store = new Be(o, i), s.services.resourceStore = s.store;
|
|
2764
2767
|
}
|
|
2765
|
-
return s.translator = new
|
|
2768
|
+
return s.translator = new ce(s.services, i), s.translator.on("*", (o, ...c) => {
|
|
2766
2769
|
s.emit(o, ...c);
|
|
2767
|
-
}), s.init(
|
|
2770
|
+
}), s.init(i, t), s.translator.options = i, s.translator.backendConnector.services.utils = {
|
|
2768
2771
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
2769
2772
|
}, s;
|
|
2770
2773
|
}
|
|
@@ -2778,53 +2781,53 @@ class se extends pe {
|
|
|
2778
2781
|
};
|
|
2779
2782
|
}
|
|
2780
2783
|
}
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2784
|
+
const O = ne.createInstance();
|
|
2785
|
+
O.createInstance = ne.createInstance;
|
|
2786
|
+
O.createInstance;
|
|
2787
|
+
O.dir;
|
|
2788
|
+
O.init;
|
|
2789
|
+
O.loadResources;
|
|
2790
|
+
O.reloadResources;
|
|
2791
|
+
O.use;
|
|
2792
|
+
O.changeLanguage;
|
|
2793
|
+
O.getFixedT;
|
|
2794
|
+
O.t;
|
|
2795
|
+
O.exists;
|
|
2796
|
+
O.setDefaultNamespace;
|
|
2797
|
+
O.hasLoadedNamespace;
|
|
2798
|
+
O.loadNamespaces;
|
|
2799
|
+
O.loadLanguages;
|
|
2797
2800
|
const {
|
|
2798
|
-
slice:
|
|
2799
|
-
forEach:
|
|
2801
|
+
slice: vi,
|
|
2802
|
+
forEach: Si
|
|
2800
2803
|
} = [];
|
|
2801
|
-
function
|
|
2802
|
-
return
|
|
2804
|
+
function ki(r) {
|
|
2805
|
+
return Si.call(vi.call(arguments, 1), (e) => {
|
|
2803
2806
|
if (e)
|
|
2804
2807
|
for (const t in e)
|
|
2805
|
-
|
|
2806
|
-
}),
|
|
2808
|
+
r[t] === void 0 && (r[t] = e[t]);
|
|
2809
|
+
}), r;
|
|
2807
2810
|
}
|
|
2808
|
-
function
|
|
2809
|
-
return typeof
|
|
2811
|
+
function Li(r) {
|
|
2812
|
+
return typeof r != "string" ? !1 : [/<\s*script.*?>/i, /<\s*\/\s*script\s*>/i, /<\s*img.*?on\w+\s*=/i, /<\s*\w+\s*on\w+\s*=.*?>/i, /javascript\s*:/i, /vbscript\s*:/i, /expression\s*\(/i, /eval\s*\(/i, /alert\s*\(/i, /document\.cookie/i, /document\.write\s*\(/i, /window\.location/i, /innerHTML/i].some((t) => t.test(r));
|
|
2810
2813
|
}
|
|
2811
|
-
const
|
|
2814
|
+
const Ye = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Ei = function(r, e) {
|
|
2812
2815
|
const n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2813
2816
|
path: "/"
|
|
2814
|
-
},
|
|
2815
|
-
let s = `${
|
|
2817
|
+
}, i = encodeURIComponent(e);
|
|
2818
|
+
let s = `${r}=${i}`;
|
|
2816
2819
|
if (n.maxAge > 0) {
|
|
2817
2820
|
const a = n.maxAge - 0;
|
|
2818
2821
|
if (Number.isNaN(a)) throw new Error("maxAge should be a Number");
|
|
2819
2822
|
s += `; Max-Age=${Math.floor(a)}`;
|
|
2820
2823
|
}
|
|
2821
2824
|
if (n.domain) {
|
|
2822
|
-
if (!
|
|
2825
|
+
if (!Ye.test(n.domain))
|
|
2823
2826
|
throw new TypeError("option domain is invalid");
|
|
2824
2827
|
s += `; Domain=${n.domain}`;
|
|
2825
2828
|
}
|
|
2826
2829
|
if (n.path) {
|
|
2827
|
-
if (!
|
|
2830
|
+
if (!Ye.test(n.path))
|
|
2828
2831
|
throw new TypeError("option path is invalid");
|
|
2829
2832
|
s += `; Path=${n.path}`;
|
|
2830
2833
|
}
|
|
@@ -2851,219 +2854,215 @@ const rt = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Rr = function(i, e) {
|
|
|
2851
2854
|
throw new TypeError("option sameSite is invalid");
|
|
2852
2855
|
}
|
|
2853
2856
|
return n.partitioned && (s += "; Partitioned"), s;
|
|
2854
|
-
},
|
|
2855
|
-
create(
|
|
2856
|
-
let
|
|
2857
|
+
}, Xe = {
|
|
2858
|
+
create(r, e, t, n) {
|
|
2859
|
+
let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
2857
2860
|
path: "/",
|
|
2858
2861
|
sameSite: "strict"
|
|
2859
2862
|
};
|
|
2860
|
-
t && (
|
|
2863
|
+
t && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + t * 60 * 1e3)), n && (i.domain = n), document.cookie = Ei(r, e, i);
|
|
2861
2864
|
},
|
|
2862
|
-
read(
|
|
2863
|
-
const e = `${
|
|
2865
|
+
read(r) {
|
|
2866
|
+
const e = `${r}=`, t = document.cookie.split(";");
|
|
2864
2867
|
for (let n = 0; n < t.length; n++) {
|
|
2865
|
-
let
|
|
2866
|
-
for (;
|
|
2867
|
-
if (
|
|
2868
|
+
let i = t[n];
|
|
2869
|
+
for (; i.charAt(0) === " "; ) i = i.substring(1, i.length);
|
|
2870
|
+
if (i.indexOf(e) === 0) return i.substring(e.length, i.length);
|
|
2868
2871
|
}
|
|
2869
2872
|
return null;
|
|
2870
2873
|
},
|
|
2871
|
-
remove(
|
|
2872
|
-
this.create(
|
|
2874
|
+
remove(r, e) {
|
|
2875
|
+
this.create(r, "", -1, e);
|
|
2873
2876
|
}
|
|
2874
2877
|
};
|
|
2875
|
-
var
|
|
2878
|
+
var Pi = {
|
|
2876
2879
|
name: "cookie",
|
|
2877
2880
|
// Deconstruct the options object and extract the lookupCookie property
|
|
2878
|
-
lookup(
|
|
2881
|
+
lookup(r) {
|
|
2879
2882
|
let {
|
|
2880
2883
|
lookupCookie: e
|
|
2881
|
-
} =
|
|
2884
|
+
} = r;
|
|
2882
2885
|
if (e && typeof document < "u")
|
|
2883
|
-
return
|
|
2886
|
+
return Xe.read(e) || void 0;
|
|
2884
2887
|
},
|
|
2885
2888
|
// Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
|
|
2886
|
-
cacheUserLanguage(
|
|
2889
|
+
cacheUserLanguage(r, e) {
|
|
2887
2890
|
let {
|
|
2888
2891
|
lookupCookie: t,
|
|
2889
2892
|
cookieMinutes: n,
|
|
2890
|
-
cookieDomain:
|
|
2893
|
+
cookieDomain: i,
|
|
2891
2894
|
cookieOptions: s
|
|
2892
2895
|
} = e;
|
|
2893
|
-
t && typeof document < "u" &&
|
|
2896
|
+
t && typeof document < "u" && Xe.create(t, r, n, i, s);
|
|
2894
2897
|
}
|
|
2895
|
-
},
|
|
2898
|
+
}, Oi = {
|
|
2896
2899
|
name: "querystring",
|
|
2897
2900
|
// Deconstruct the options object and extract the lookupQuerystring property
|
|
2898
|
-
lookup(
|
|
2899
|
-
var n;
|
|
2901
|
+
lookup(r) {
|
|
2900
2902
|
let {
|
|
2901
2903
|
lookupQuerystring: e
|
|
2902
|
-
} =
|
|
2904
|
+
} = r, t;
|
|
2903
2905
|
if (typeof window < "u") {
|
|
2904
2906
|
let {
|
|
2905
|
-
search:
|
|
2907
|
+
search: n
|
|
2906
2908
|
} = window.location;
|
|
2907
|
-
!window.location.search &&
|
|
2908
|
-
const
|
|
2909
|
-
for (let
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2909
|
+
!window.location.search && window.location.hash?.indexOf("?") > -1 && (n = window.location.hash.substring(window.location.hash.indexOf("?")));
|
|
2910
|
+
const s = n.substring(1).split("&");
|
|
2911
|
+
for (let a = 0; a < s.length; a++) {
|
|
2912
|
+
const o = s[a].indexOf("=");
|
|
2913
|
+
o > 0 && s[a].substring(0, o) === e && (t = s[a].substring(o + 1));
|
|
2912
2914
|
}
|
|
2913
2915
|
}
|
|
2914
2916
|
return t;
|
|
2915
2917
|
}
|
|
2916
|
-
},
|
|
2918
|
+
}, Ni = {
|
|
2917
2919
|
name: "hash",
|
|
2918
2920
|
// Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
|
|
2919
|
-
lookup(
|
|
2920
|
-
var r;
|
|
2921
|
+
lookup(r) {
|
|
2921
2922
|
let {
|
|
2922
2923
|
lookupHash: e,
|
|
2923
2924
|
lookupFromHashIndex: t
|
|
2924
|
-
} =
|
|
2925
|
+
} = r, n;
|
|
2925
2926
|
if (typeof window < "u") {
|
|
2926
2927
|
const {
|
|
2927
|
-
hash:
|
|
2928
|
+
hash: i
|
|
2928
2929
|
} = window.location;
|
|
2929
|
-
if (
|
|
2930
|
-
const
|
|
2930
|
+
if (i && i.length > 2) {
|
|
2931
|
+
const s = i.substring(1);
|
|
2931
2932
|
if (e) {
|
|
2932
|
-
const
|
|
2933
|
-
for (let
|
|
2934
|
-
const
|
|
2935
|
-
|
|
2933
|
+
const a = s.split("&");
|
|
2934
|
+
for (let o = 0; o < a.length; o++) {
|
|
2935
|
+
const c = a[o].indexOf("=");
|
|
2936
|
+
c > 0 && a[o].substring(0, c) === e && (n = a[o].substring(c + 1));
|
|
2936
2937
|
}
|
|
2937
2938
|
}
|
|
2938
2939
|
if (n) return n;
|
|
2939
2940
|
if (!n && t > -1) {
|
|
2940
|
-
const
|
|
2941
|
-
return Array.isArray(
|
|
2941
|
+
const a = i.match(/\/([a-zA-Z-]*)/g);
|
|
2942
|
+
return Array.isArray(a) ? a[typeof t == "number" ? t : 0]?.replace("/", "") : void 0;
|
|
2942
2943
|
}
|
|
2943
2944
|
}
|
|
2944
2945
|
}
|
|
2945
2946
|
return n;
|
|
2946
2947
|
}
|
|
2947
2948
|
};
|
|
2948
|
-
let
|
|
2949
|
-
const
|
|
2950
|
-
if (
|
|
2949
|
+
let q = null;
|
|
2950
|
+
const et = () => {
|
|
2951
|
+
if (q !== null) return q;
|
|
2951
2952
|
try {
|
|
2952
|
-
if (
|
|
2953
|
+
if (q = typeof window < "u" && window.localStorage !== null, !q)
|
|
2953
2954
|
return !1;
|
|
2954
|
-
const
|
|
2955
|
-
window.localStorage.setItem(
|
|
2955
|
+
const r = "i18next.translate.boo";
|
|
2956
|
+
window.localStorage.setItem(r, "foo"), window.localStorage.removeItem(r);
|
|
2956
2957
|
} catch {
|
|
2957
|
-
|
|
2958
|
+
q = !1;
|
|
2958
2959
|
}
|
|
2959
|
-
return
|
|
2960
|
+
return q;
|
|
2960
2961
|
};
|
|
2961
|
-
var
|
|
2962
|
+
var Ci = {
|
|
2962
2963
|
name: "localStorage",
|
|
2963
2964
|
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
2964
|
-
lookup(
|
|
2965
|
+
lookup(r) {
|
|
2965
2966
|
let {
|
|
2966
2967
|
lookupLocalStorage: e
|
|
2967
|
-
} =
|
|
2968
|
-
if (e &&
|
|
2968
|
+
} = r;
|
|
2969
|
+
if (e && et())
|
|
2969
2970
|
return window.localStorage.getItem(e) || void 0;
|
|
2970
2971
|
},
|
|
2971
2972
|
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
2972
|
-
cacheUserLanguage(
|
|
2973
|
+
cacheUserLanguage(r, e) {
|
|
2973
2974
|
let {
|
|
2974
2975
|
lookupLocalStorage: t
|
|
2975
2976
|
} = e;
|
|
2976
|
-
t &&
|
|
2977
|
+
t && et() && window.localStorage.setItem(t, r);
|
|
2977
2978
|
}
|
|
2978
2979
|
};
|
|
2979
|
-
let
|
|
2980
|
-
const
|
|
2981
|
-
if (
|
|
2980
|
+
let U = null;
|
|
2981
|
+
const tt = () => {
|
|
2982
|
+
if (U !== null) return U;
|
|
2982
2983
|
try {
|
|
2983
|
-
if (
|
|
2984
|
+
if (U = typeof window < "u" && window.sessionStorage !== null, !U)
|
|
2984
2985
|
return !1;
|
|
2985
|
-
const
|
|
2986
|
-
window.sessionStorage.setItem(
|
|
2986
|
+
const r = "i18next.translate.boo";
|
|
2987
|
+
window.sessionStorage.setItem(r, "foo"), window.sessionStorage.removeItem(r);
|
|
2987
2988
|
} catch {
|
|
2988
|
-
|
|
2989
|
+
U = !1;
|
|
2989
2990
|
}
|
|
2990
|
-
return
|
|
2991
|
+
return U;
|
|
2991
2992
|
};
|
|
2992
|
-
var
|
|
2993
|
+
var ji = {
|
|
2993
2994
|
name: "sessionStorage",
|
|
2994
|
-
lookup(
|
|
2995
|
+
lookup(r) {
|
|
2995
2996
|
let {
|
|
2996
2997
|
lookupSessionStorage: e
|
|
2997
|
-
} =
|
|
2998
|
-
if (e &&
|
|
2998
|
+
} = r;
|
|
2999
|
+
if (e && tt())
|
|
2999
3000
|
return window.sessionStorage.getItem(e) || void 0;
|
|
3000
3001
|
},
|
|
3001
|
-
cacheUserLanguage(
|
|
3002
|
+
cacheUserLanguage(r, e) {
|
|
3002
3003
|
let {
|
|
3003
3004
|
lookupSessionStorage: t
|
|
3004
3005
|
} = e;
|
|
3005
|
-
t &&
|
|
3006
|
+
t && tt() && window.sessionStorage.setItem(t, r);
|
|
3006
3007
|
}
|
|
3007
|
-
},
|
|
3008
|
+
}, Ti = {
|
|
3008
3009
|
name: "navigator",
|
|
3009
|
-
lookup(
|
|
3010
|
+
lookup(r) {
|
|
3010
3011
|
const e = [];
|
|
3011
3012
|
if (typeof navigator < "u") {
|
|
3012
3013
|
const {
|
|
3013
3014
|
languages: t,
|
|
3014
3015
|
userLanguage: n,
|
|
3015
|
-
language:
|
|
3016
|
+
language: i
|
|
3016
3017
|
} = navigator;
|
|
3017
3018
|
if (t)
|
|
3018
3019
|
for (let s = 0; s < t.length; s++)
|
|
3019
3020
|
e.push(t[s]);
|
|
3020
|
-
n && e.push(n),
|
|
3021
|
+
n && e.push(n), i && e.push(i);
|
|
3021
3022
|
}
|
|
3022
3023
|
return e.length > 0 ? e : void 0;
|
|
3023
3024
|
}
|
|
3024
|
-
},
|
|
3025
|
+
}, $i = {
|
|
3025
3026
|
name: "htmlTag",
|
|
3026
3027
|
// Deconstruct the options object and extract the htmlTag property
|
|
3027
|
-
lookup(
|
|
3028
|
+
lookup(r) {
|
|
3028
3029
|
let {
|
|
3029
3030
|
htmlTag: e
|
|
3030
|
-
} =
|
|
3031
|
+
} = r, t;
|
|
3031
3032
|
const n = e || (typeof document < "u" ? document.documentElement : null);
|
|
3032
3033
|
return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
|
|
3033
3034
|
}
|
|
3034
|
-
},
|
|
3035
|
+
}, Ri = {
|
|
3035
3036
|
name: "path",
|
|
3036
3037
|
// Deconstruct the options object and extract the lookupFromPathIndex property
|
|
3037
|
-
lookup(
|
|
3038
|
-
var r;
|
|
3038
|
+
lookup(r) {
|
|
3039
3039
|
let {
|
|
3040
3040
|
lookupFromPathIndex: e
|
|
3041
|
-
} =
|
|
3041
|
+
} = r;
|
|
3042
3042
|
if (typeof window > "u") return;
|
|
3043
3043
|
const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
3044
|
-
return Array.isArray(t) ?
|
|
3044
|
+
return Array.isArray(t) ? t[typeof e == "number" ? e : 0]?.replace("/", "") : void 0;
|
|
3045
3045
|
}
|
|
3046
|
-
},
|
|
3046
|
+
}, Fi = {
|
|
3047
3047
|
name: "subdomain",
|
|
3048
|
-
lookup(
|
|
3049
|
-
var r, s;
|
|
3048
|
+
lookup(r) {
|
|
3050
3049
|
let {
|
|
3051
3050
|
lookupFromSubdomainIndex: e
|
|
3052
|
-
} =
|
|
3053
|
-
const t = typeof e == "number" ? e + 1 : 1, n = typeof window < "u" &&
|
|
3051
|
+
} = r;
|
|
3052
|
+
const t = typeof e == "number" ? e + 1 : 1, n = typeof window < "u" && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
|
3054
3053
|
if (n)
|
|
3055
3054
|
return n[t];
|
|
3056
3055
|
}
|
|
3057
3056
|
};
|
|
3058
|
-
let
|
|
3057
|
+
let kt = !1;
|
|
3059
3058
|
try {
|
|
3060
|
-
document.cookie,
|
|
3059
|
+
document.cookie, kt = !0;
|
|
3061
3060
|
} catch {
|
|
3062
3061
|
}
|
|
3063
|
-
const
|
|
3064
|
-
|
|
3065
|
-
const
|
|
3066
|
-
order:
|
|
3062
|
+
const Lt = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
|
|
3063
|
+
kt || Lt.splice(1, 1);
|
|
3064
|
+
const Mi = () => ({
|
|
3065
|
+
order: Lt,
|
|
3067
3066
|
lookupQuerystring: "lng",
|
|
3068
3067
|
lookupCookie: "i18next",
|
|
3069
3068
|
lookupLocalStorage: "i18nextLng",
|
|
@@ -3073,9 +3072,9 @@ const Ur = () => ({
|
|
|
3073
3072
|
excludeCacheFor: ["cimode"],
|
|
3074
3073
|
// cookieMinutes: 10,
|
|
3075
3074
|
// cookieDomain: 'myDomain'
|
|
3076
|
-
convertDetectedLanguage: (
|
|
3075
|
+
convertDetectedLanguage: (r) => r
|
|
3077
3076
|
});
|
|
3078
|
-
class
|
|
3077
|
+
class Et {
|
|
3079
3078
|
constructor(e) {
|
|
3080
3079
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
3081
3080
|
this.type = "languageDetector", this.detectors = {}, this.init(e, t);
|
|
@@ -3084,7 +3083,7 @@ class jt {
|
|
|
3084
3083
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
3085
3084
|
languageUtils: {}
|
|
3086
3085
|
}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3087
|
-
this.services = e, this.options =
|
|
3086
|
+
this.services = e, this.options = ki(t, this.options || {}, Mi()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (i) => i.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(Pi), this.addDetector(Oi), this.addDetector(Ci), this.addDetector(ji), this.addDetector(Ti), this.addDetector($i), this.addDetector(Ri), this.addDetector(Fi), this.addDetector(Ni);
|
|
3088
3087
|
}
|
|
3089
3088
|
addDetector(e) {
|
|
3090
3089
|
return this.detectors[e.name] = e, this;
|
|
@@ -3093,10 +3092,10 @@ class jt {
|
|
|
3093
3092
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
|
|
3094
3093
|
return e.forEach((n) => {
|
|
3095
3094
|
if (this.detectors[n]) {
|
|
3096
|
-
let
|
|
3097
|
-
|
|
3095
|
+
let i = this.detectors[n].lookup(this.options);
|
|
3096
|
+
i && typeof i == "string" && (i = [i]), i && (t = t.concat(i));
|
|
3098
3097
|
}
|
|
3099
|
-
}), t = t.filter((n) => n != null && !
|
|
3098
|
+
}), t = t.filter((n) => n != null && !Li(n)).map((n) => this.options.convertDetectedLanguage(n)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
|
|
3100
3099
|
}
|
|
3101
3100
|
cacheUserLanguage(e) {
|
|
3102
3101
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
|
|
@@ -3105,19 +3104,21 @@ class jt {
|
|
|
3105
3104
|
}));
|
|
3106
3105
|
}
|
|
3107
3106
|
}
|
|
3108
|
-
|
|
3109
|
-
const
|
|
3107
|
+
Et.type = "languageDetector";
|
|
3108
|
+
const Pt = {
|
|
3110
3109
|
apiBaseUrl: "https://api.nemme.io",
|
|
3111
3110
|
debug: !1
|
|
3112
|
-
},
|
|
3113
|
-
Previous:
|
|
3114
|
-
Next:
|
|
3111
|
+
}, Di = "Previous", Ai = "Next", Ii = "Done", Vi = "Submit", Hi = {
|
|
3112
|
+
Previous: Di,
|
|
3113
|
+
Next: Ai,
|
|
3114
|
+
Done: Ii,
|
|
3115
|
+
Submit: Vi,
|
|
3115
3116
|
"Type your answer here": "Type your answer here",
|
|
3116
3117
|
"Max {{maxCharacters}} characters": "Max {{maxCharacters}} characters"
|
|
3117
|
-
},
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
debug:
|
|
3118
|
+
}, Ki = {};
|
|
3119
|
+
Zn({ locale: Xn });
|
|
3120
|
+
O.use(Et).use(Ut).init({
|
|
3121
|
+
debug: Pt.debug,
|
|
3121
3122
|
fallbackLng: "en",
|
|
3122
3123
|
interpolation: {
|
|
3123
3124
|
escapeValue: !1
|
|
@@ -3125,28 +3126,28 @@ C.use(jt).use(Qt).init({
|
|
|
3125
3126
|
},
|
|
3126
3127
|
resources: {
|
|
3127
3128
|
en: {
|
|
3128
|
-
translation:
|
|
3129
|
+
translation: Hi
|
|
3129
3130
|
},
|
|
3130
3131
|
nb: {
|
|
3131
|
-
tranlation:
|
|
3132
|
+
tranlation: Ki
|
|
3132
3133
|
}
|
|
3133
3134
|
}
|
|
3134
3135
|
});
|
|
3135
|
-
const
|
|
3136
|
+
const nt = {
|
|
3136
3137
|
debug: 0,
|
|
3137
3138
|
info: 1,
|
|
3138
3139
|
warn: 2,
|
|
3139
3140
|
error: 3
|
|
3140
3141
|
};
|
|
3141
|
-
class
|
|
3142
|
+
class Le {
|
|
3143
|
+
prefix;
|
|
3144
|
+
enabled;
|
|
3145
|
+
level;
|
|
3142
3146
|
constructor(e = {}) {
|
|
3143
|
-
v(this, "prefix");
|
|
3144
|
-
v(this, "enabled");
|
|
3145
|
-
v(this, "level");
|
|
3146
3147
|
this.prefix = e.prefix || "Nemme SDK", this.enabled = e.enabled !== void 0 ? e.enabled : !0, this.level = e.level || "info";
|
|
3147
3148
|
}
|
|
3148
3149
|
shouldLog(e) {
|
|
3149
|
-
return this.enabled &&
|
|
3150
|
+
return this.enabled && nt[e] >= nt[this.level];
|
|
3150
3151
|
}
|
|
3151
3152
|
formatMessage(e) {
|
|
3152
3153
|
return `[${this.prefix}] ${e}`;
|
|
@@ -3165,7 +3166,7 @@ class Ne {
|
|
|
3165
3166
|
}
|
|
3166
3167
|
// Create a child logger with a new prefix
|
|
3167
3168
|
child(e) {
|
|
3168
|
-
return new
|
|
3169
|
+
return new Le({
|
|
3169
3170
|
prefix: `${this.prefix}:${e}`,
|
|
3170
3171
|
enabled: this.enabled,
|
|
3171
3172
|
level: this.level
|
|
@@ -3176,31 +3177,31 @@ class Ne {
|
|
|
3176
3177
|
e.prefix !== void 0 && (this.prefix = e.prefix), e.enabled !== void 0 && (this.enabled = e.enabled), e.level !== void 0 && (this.level = e.level);
|
|
3177
3178
|
}
|
|
3178
3179
|
}
|
|
3179
|
-
const
|
|
3180
|
-
const t = new URL(
|
|
3181
|
-
return e && Object.entries(e).forEach(([n,
|
|
3182
|
-
|
|
3180
|
+
const Ot = new Le(), it = Ot.child("network"), Bi = 3e4, zi = (r, e) => {
|
|
3181
|
+
const t = new URL(r, Pt.apiBaseUrl);
|
|
3182
|
+
return e && Object.entries(e).forEach(([n, i]) => {
|
|
3183
|
+
i != null && t.searchParams.append(n, String(i));
|
|
3183
3184
|
}), t.toString();
|
|
3184
|
-
},
|
|
3185
|
+
}, D = {
|
|
3185
3186
|
/**
|
|
3186
3187
|
* Make an HTTP request
|
|
3187
3188
|
*/
|
|
3188
|
-
async request(
|
|
3189
|
-
const { method: t = "GET", headers: n = {}, body:
|
|
3189
|
+
async request(r, e = {}) {
|
|
3190
|
+
const { method: t = "GET", headers: n = {}, body: i, params: s, timeout: a = Bi } = e, o = zi(r, s), c = {
|
|
3190
3191
|
"Content-Type": "application/json",
|
|
3191
3192
|
Accept: "application/json",
|
|
3192
3193
|
...n
|
|
3193
3194
|
}, l = {
|
|
3194
3195
|
method: t,
|
|
3195
3196
|
headers: c,
|
|
3196
|
-
body:
|
|
3197
|
+
body: i ? JSON.stringify(i) : void 0
|
|
3197
3198
|
}, d = new AbortController(), u = setTimeout(() => d.abort(), a);
|
|
3198
3199
|
l.signal = d.signal;
|
|
3199
3200
|
try {
|
|
3200
3201
|
const h = await fetch(o, l);
|
|
3201
3202
|
let f;
|
|
3202
|
-
const
|
|
3203
|
-
if (
|
|
3203
|
+
const p = h.headers.get("content-type");
|
|
3204
|
+
if (p && p.includes("application/json"))
|
|
3204
3205
|
f = await h.json();
|
|
3205
3206
|
else {
|
|
3206
3207
|
const b = await h.text();
|
|
@@ -3221,7 +3222,7 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3221
3222
|
y.ok = !0;
|
|
3222
3223
|
else {
|
|
3223
3224
|
const b = `Request failed with status ${h.status}: ${h.statusText}`;
|
|
3224
|
-
|
|
3225
|
+
it.error(b, {
|
|
3225
3226
|
url: o,
|
|
3226
3227
|
method: t,
|
|
3227
3228
|
status: h.status,
|
|
@@ -3233,12 +3234,12 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3233
3234
|
}
|
|
3234
3235
|
return y;
|
|
3235
3236
|
} catch (h) {
|
|
3236
|
-
let f = "Network request failed",
|
|
3237
|
-
return h instanceof DOMException && h.name === "AbortError" ? (f = `Request timeout after ${a}ms`,
|
|
3237
|
+
let f = "Network request failed", p = {};
|
|
3238
|
+
return h instanceof DOMException && h.name === "AbortError" ? (f = `Request timeout after ${a}ms`, p = { timeout: a, url: o }) : p = {
|
|
3238
3239
|
message: h instanceof Error ? h.message : String(h),
|
|
3239
3240
|
url: o,
|
|
3240
3241
|
method: t
|
|
3241
|
-
},
|
|
3242
|
+
}, it.error(f, p), {
|
|
3242
3243
|
data: {},
|
|
3243
3244
|
status: 0,
|
|
3244
3245
|
statusText: f,
|
|
@@ -3246,7 +3247,7 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3246
3247
|
ok: !1,
|
|
3247
3248
|
error: {
|
|
3248
3249
|
message: f,
|
|
3249
|
-
details:
|
|
3250
|
+
details: p
|
|
3250
3251
|
}
|
|
3251
3252
|
};
|
|
3252
3253
|
} finally {
|
|
@@ -3256,77 +3257,79 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3256
3257
|
/**
|
|
3257
3258
|
* Convenience methods for common HTTP methods
|
|
3258
3259
|
*/
|
|
3259
|
-
async get(
|
|
3260
|
-
return this.request(
|
|
3260
|
+
async get(r, e = {}) {
|
|
3261
|
+
return this.request(r, { ...e, method: "GET" });
|
|
3261
3262
|
},
|
|
3262
|
-
async post(
|
|
3263
|
-
return this.request(
|
|
3263
|
+
async post(r, e, t = {}) {
|
|
3264
|
+
return this.request(r, { ...t, method: "POST", body: e });
|
|
3264
3265
|
},
|
|
3265
|
-
async put(
|
|
3266
|
-
return this.request(
|
|
3266
|
+
async put(r, e, t = {}) {
|
|
3267
|
+
return this.request(r, { ...t, method: "PUT", body: e });
|
|
3267
3268
|
},
|
|
3268
|
-
async patch(
|
|
3269
|
-
return this.request(
|
|
3269
|
+
async patch(r, e, t = {}) {
|
|
3270
|
+
return this.request(r, { ...t, method: "PATCH", body: e });
|
|
3270
3271
|
},
|
|
3271
|
-
async delete(
|
|
3272
|
-
return this.request(
|
|
3272
|
+
async delete(r, e = {}) {
|
|
3273
|
+
return this.request(r, { ...e, method: "DELETE" });
|
|
3273
3274
|
}
|
|
3274
3275
|
};
|
|
3275
|
-
class
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3276
|
+
class qi {
|
|
3277
|
+
logger;
|
|
3278
|
+
headers;
|
|
3279
|
+
config;
|
|
3280
|
+
constructor(e, t, n = {}) {
|
|
3281
|
+
this.logger = e, this.headers = t, this.config = n;
|
|
3280
3282
|
}
|
|
3281
3283
|
async fetchAndDisplayForm(e, t, n) {
|
|
3282
3284
|
this.logger.debug(`Fetching form config for: ${e}`);
|
|
3283
3285
|
try {
|
|
3284
|
-
const
|
|
3286
|
+
const i = await D.get(`/external/forms/${e}`, {
|
|
3285
3287
|
headers: this.headers
|
|
3286
3288
|
});
|
|
3287
|
-
|
|
3288
|
-
} catch (
|
|
3289
|
-
this.logger.error(`Failed to fetch form config for: ${e}`,
|
|
3289
|
+
i.ok && i.data ? (this.logger.info(`Form config loaded for: ${e}`, i.data), this.displayForm(i.data, t, n)) : this.logger.warn(`No form config found for: ${e}`);
|
|
3290
|
+
} catch (i) {
|
|
3291
|
+
this.logger.error(`Failed to fetch form config for: ${e}`, i);
|
|
3290
3292
|
}
|
|
3291
3293
|
}
|
|
3292
3294
|
displayForm(e, t, n) {
|
|
3293
|
-
const
|
|
3294
|
-
|
|
3295
|
-
const s =
|
|
3296
|
-
|
|
3297
|
-
{ i18n:
|
|
3298
|
-
|
|
3295
|
+
const i = document.createElement("div");
|
|
3296
|
+
i.id = "nm", i.className = this.config.theme === "dark" || window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "", document.body.appendChild(i);
|
|
3297
|
+
const s = Rt(i), a = pe(
|
|
3298
|
+
Jt,
|
|
3299
|
+
{ i18n: O },
|
|
3300
|
+
pe(Xt, {
|
|
3299
3301
|
form: e,
|
|
3300
3302
|
onDismiss: async (o) => {
|
|
3301
|
-
await t(),
|
|
3303
|
+
await t(), s.unmount(), i.remove(), this.logger.info("Form dismissed", o);
|
|
3302
3304
|
},
|
|
3303
3305
|
onComplete: async (o) => {
|
|
3304
|
-
await n(), await this.postFormResponse(e, o), s.unmount(),
|
|
3305
|
-
}
|
|
3306
|
+
await n(), await this.postFormResponse(e, o), s.unmount(), i.remove(), this.logger.info("Form completed", o);
|
|
3307
|
+
},
|
|
3308
|
+
zIndex: this.config.zIndex
|
|
3306
3309
|
})
|
|
3307
3310
|
);
|
|
3308
3311
|
s.render(a);
|
|
3309
3312
|
}
|
|
3310
3313
|
async postFormResponse(e, t) {
|
|
3311
3314
|
this.logger.info("Posting form response", t);
|
|
3312
|
-
const n = await
|
|
3315
|
+
const n = await D.post(`/external/forms/${e.slug}`, t, {
|
|
3313
3316
|
headers: this.headers
|
|
3314
3317
|
});
|
|
3315
3318
|
this.logger.info("Form response posted", n.data);
|
|
3316
3319
|
}
|
|
3317
3320
|
}
|
|
3318
|
-
class
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
this.logger = e, this.headers = t, this.formManager = new
|
|
3321
|
+
class Ui {
|
|
3322
|
+
logger;
|
|
3323
|
+
headers;
|
|
3324
|
+
formManager;
|
|
3325
|
+
deliveries = [];
|
|
3326
|
+
constructor(e, t, n) {
|
|
3327
|
+
this.logger = e, this.headers = t, this.formManager = new qi(e, t, n);
|
|
3325
3328
|
}
|
|
3326
3329
|
async loadDeliveries() {
|
|
3327
3330
|
try {
|
|
3328
3331
|
this.logger.debug("Loading deliveries");
|
|
3329
|
-
const e = await
|
|
3332
|
+
const e = await D.get("/external/deliveries", { headers: this.headers });
|
|
3330
3333
|
this.deliveries = e.data, this.logger.info(`Loaded ${this.deliveries.length} deliveries`);
|
|
3331
3334
|
} catch (e) {
|
|
3332
3335
|
this.logger.error("Failed to load deliveries", e), this.deliveries = [];
|
|
@@ -3351,7 +3354,7 @@ class Yr {
|
|
|
3351
3354
|
case "page_url":
|
|
3352
3355
|
return e.urlPattern ? this.matchesUrlPattern(t.url, e.urlPattern) : !0;
|
|
3353
3356
|
case "custom_event":
|
|
3354
|
-
return e.
|
|
3357
|
+
return e.eventKey ? t.eventKey === e.eventKey : !1;
|
|
3355
3358
|
default:
|
|
3356
3359
|
return !1;
|
|
3357
3360
|
}
|
|
@@ -3364,21 +3367,21 @@ class Yr {
|
|
|
3364
3367
|
this.logger.debug(`Triggering form delivery: ${e.productSlug}`, {
|
|
3365
3368
|
triggerType: t.triggerType,
|
|
3366
3369
|
urlPattern: t.urlPattern,
|
|
3367
|
-
|
|
3370
|
+
eventKey: t.eventKey
|
|
3368
3371
|
});
|
|
3369
3372
|
try {
|
|
3370
|
-
const
|
|
3373
|
+
const i = await this.createDeliveryResponse(e);
|
|
3371
3374
|
await this.formManager.fetchAndDisplayForm(
|
|
3372
3375
|
e.productSlug,
|
|
3373
3376
|
async () => {
|
|
3374
|
-
this.logger.debug(`Form for delivery: ${e.productSlug} was cancelled`),
|
|
3377
|
+
this.logger.debug(`Form for delivery: ${e.productSlug} was cancelled`), i && await this.updateDeliveryResponse(e.id, i.id, !0);
|
|
3375
3378
|
},
|
|
3376
3379
|
async () => {
|
|
3377
|
-
this.logger.debug(`Form for delivery: ${e.productSlug} was completed`),
|
|
3380
|
+
this.logger.debug(`Form for delivery: ${e.productSlug} was completed`), i && await this.updateDeliveryResponse(e.id, i.id, !1, !0);
|
|
3378
3381
|
}
|
|
3379
3382
|
);
|
|
3380
|
-
} catch (
|
|
3381
|
-
this.logger.error(`Failed to load form for delivery: ${e.productSlug}`,
|
|
3383
|
+
} catch (i) {
|
|
3384
|
+
this.logger.error(`Failed to load form for delivery: ${e.productSlug}`, i);
|
|
3382
3385
|
}
|
|
3383
3386
|
}
|
|
3384
3387
|
}
|
|
@@ -3389,18 +3392,24 @@ class Yr {
|
|
|
3389
3392
|
} catch {
|
|
3390
3393
|
n = e.startsWith("/") ? e : `/${e}`;
|
|
3391
3394
|
}
|
|
3392
|
-
const
|
|
3395
|
+
const i = (d) => {
|
|
3396
|
+
if (!d) return "/";
|
|
3397
|
+
let u = d.startsWith("/") ? d : `/${d}`;
|
|
3398
|
+
return u.length > 1 && u.endsWith("/") && (u = u.slice(0, -1)), u;
|
|
3399
|
+
}, s = i(n), a = i(t), o = a.replace(/\*\*/g, "§DOUBLE_STAR§").replace(/\*/g, "[^/]*").replace(/§DOUBLE_STAR§/g, ".*").replace(/\?/g, "."), l = new RegExp(`^${o}$`).test(s);
|
|
3393
3400
|
return this.logger.debug("URL pattern matching", {
|
|
3394
3401
|
originalUrl: e,
|
|
3395
3402
|
pathname: n,
|
|
3403
|
+
normalizedPathname: s,
|
|
3396
3404
|
pattern: t,
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3405
|
+
normalizedPattern: a,
|
|
3406
|
+
regexPattern: o,
|
|
3407
|
+
matches: l
|
|
3408
|
+
}), l;
|
|
3400
3409
|
}
|
|
3401
3410
|
async createDeliveryResponse(e) {
|
|
3402
3411
|
try {
|
|
3403
|
-
return (await
|
|
3412
|
+
return (await D.post(
|
|
3404
3413
|
`/external/deliveries/${e.id}/responses`,
|
|
3405
3414
|
{},
|
|
3406
3415
|
{ headers: this.headers }
|
|
@@ -3409,11 +3418,11 @@ class Yr {
|
|
|
3409
3418
|
this.logger.error(`Failed to create delivery response for delivery: ${e.id}`, t);
|
|
3410
3419
|
}
|
|
3411
3420
|
}
|
|
3412
|
-
async updateDeliveryResponse(e, t, n = !1,
|
|
3421
|
+
async updateDeliveryResponse(e, t, n = !1, i = !1) {
|
|
3413
3422
|
try {
|
|
3414
|
-
await
|
|
3423
|
+
await D.patch(
|
|
3415
3424
|
`/external/deliveries/${e}/responses/${t}`,
|
|
3416
|
-
{ wasDismissed: n, wasCompleted:
|
|
3425
|
+
{ wasDismissed: n, wasCompleted: i },
|
|
3417
3426
|
{ headers: this.headers }
|
|
3418
3427
|
);
|
|
3419
3428
|
} catch (s) {
|
|
@@ -3422,7 +3431,7 @@ class Yr {
|
|
|
3422
3431
|
}
|
|
3423
3432
|
async isDeliveryValid(e) {
|
|
3424
3433
|
try {
|
|
3425
|
-
return (await
|
|
3434
|
+
return (await D.get(`/external/deliveries/${e.id}/should-deliver`, {
|
|
3426
3435
|
headers: this.headers
|
|
3427
3436
|
})).data;
|
|
3428
3437
|
} catch (t) {
|
|
@@ -3430,27 +3439,28 @@ class Yr {
|
|
|
3430
3439
|
}
|
|
3431
3440
|
}
|
|
3432
3441
|
}
|
|
3433
|
-
class
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3442
|
+
class _i {
|
|
3443
|
+
logger;
|
|
3444
|
+
headers;
|
|
3445
|
+
sessionId;
|
|
3446
|
+
eventDefinitions = [];
|
|
3447
|
+
onPageView;
|
|
3448
|
+
onEvent;
|
|
3449
|
+
// Batching
|
|
3450
|
+
backlog = [];
|
|
3451
|
+
flushTimeout = null;
|
|
3452
|
+
batchConfig = {
|
|
3453
|
+
enabled: !0,
|
|
3454
|
+
size: 10,
|
|
3455
|
+
delayMs: 1e4,
|
|
3456
|
+
// 10 seconds
|
|
3457
|
+
sendOnUnload: !0
|
|
3458
|
+
};
|
|
3459
|
+
// Page view tracking
|
|
3460
|
+
originalHistoryMethods = null;
|
|
3461
|
+
EVENT_PAGE_VIEW = "page_view";
|
|
3462
|
+
constructor({ logger: e, headers: t, sessionId: n, eventDefinitions: i, batchConfig: s, onPageView: a, onEvent: o }) {
|
|
3463
|
+
this.logger = e, this.headers = t, this.sessionId = n, this.eventDefinitions = i, this.onPageView = a, this.onEvent = o, this.flushEvents = this.flushEvents.bind(this), this.handlePopState = this.handlePopState.bind(this), this.handleVisibilityChange = this.handleVisibilityChange.bind(this), this.setupBatching(s);
|
|
3454
3464
|
}
|
|
3455
3465
|
setupBatching(e) {
|
|
3456
3466
|
typeof e == "boolean" ? this.batchConfig.enabled = e : e && (this.batchConfig = {
|
|
@@ -3480,23 +3490,22 @@ class Xr {
|
|
|
3480
3490
|
}
|
|
3481
3491
|
const { eventKey: t, data: n = {} } = e;
|
|
3482
3492
|
this.logger.debug("Tracking event", { eventKey: t, data: n });
|
|
3483
|
-
const
|
|
3493
|
+
const i = window.location.href, s = {
|
|
3484
3494
|
sessionId: this.sessionId,
|
|
3485
3495
|
eventKey: t,
|
|
3486
3496
|
data: n || {},
|
|
3487
3497
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3488
|
-
page:
|
|
3498
|
+
page: i
|
|
3489
3499
|
};
|
|
3490
|
-
this.validateEvent(
|
|
3500
|
+
this.validateEvent(s), this.batchConfig.enabled ? (this.backlog.push(s), this.scheduleFlush()) : await this.sendEvents([s]), t === this.EVENT_PAGE_VIEW ? this.onPageView?.(window.location.href) : this.onEvent?.(s, i);
|
|
3491
3501
|
}
|
|
3492
3502
|
async trackPageView() {
|
|
3493
|
-
|
|
3494
|
-
typeof window > "u" || (await this.track({
|
|
3503
|
+
typeof window > "u" || await this.track({
|
|
3495
3504
|
eventKey: this.EVENT_PAGE_VIEW,
|
|
3496
3505
|
data: {
|
|
3497
3506
|
title: document.title
|
|
3498
3507
|
}
|
|
3499
|
-
})
|
|
3508
|
+
});
|
|
3500
3509
|
}
|
|
3501
3510
|
/**
|
|
3502
3511
|
* Manually flush any pending events
|
|
@@ -3517,10 +3526,10 @@ class Xr {
|
|
|
3517
3526
|
this.logger.warn(`Event ${e.eventKey} is not registered`);
|
|
3518
3527
|
return;
|
|
3519
3528
|
}
|
|
3520
|
-
const n = t.properties,
|
|
3521
|
-
if (
|
|
3522
|
-
for (const s of Object.keys(
|
|
3523
|
-
const a =
|
|
3529
|
+
const n = t.properties, i = e.data;
|
|
3530
|
+
if (i)
|
|
3531
|
+
for (const s of Object.keys(i)) {
|
|
3532
|
+
const a = i[s], o = n.find((c) => c.name === s);
|
|
3524
3533
|
if (!o) {
|
|
3525
3534
|
this.logger.warn(`Property ${s} is not registered for event ${e.eventKey}`);
|
|
3526
3535
|
return;
|
|
@@ -3563,26 +3572,27 @@ class Xr {
|
|
|
3563
3572
|
if (e.length !== 0)
|
|
3564
3573
|
if (e.length === 1) {
|
|
3565
3574
|
const t = e[0];
|
|
3566
|
-
await
|
|
3575
|
+
await D.post("/external/trackings/track", t, { headers: this.headers });
|
|
3567
3576
|
} else
|
|
3568
|
-
await
|
|
3577
|
+
await D.post("/external/trackings/batch", e, { headers: this.headers });
|
|
3569
3578
|
}
|
|
3570
3579
|
}
|
|
3571
|
-
class
|
|
3580
|
+
class Ee {
|
|
3581
|
+
clientKey;
|
|
3582
|
+
userIdentifier;
|
|
3583
|
+
initialized = !1;
|
|
3584
|
+
clientLogger = Ot.child("client");
|
|
3585
|
+
headers = {};
|
|
3586
|
+
formConfig;
|
|
3572
3587
|
constructor(e) {
|
|
3573
|
-
v(this, "clientKey");
|
|
3574
|
-
v(this, "userIdentifier");
|
|
3575
|
-
v(this, "initialized", !1);
|
|
3576
|
-
v(this, "clientLogger", Tt.child("client"));
|
|
3577
|
-
v(this, "headers", {});
|
|
3578
|
-
// Module managers
|
|
3579
|
-
v(this, "trackingManager");
|
|
3580
3588
|
this.clientKey = e;
|
|
3581
3589
|
}
|
|
3590
|
+
// Module managers
|
|
3591
|
+
trackingManager;
|
|
3582
3592
|
/**
|
|
3583
3593
|
* Create a new Nemme SDK client instance
|
|
3584
3594
|
*/
|
|
3585
|
-
async init({ userIdentifier: e, debug: t = !1, batch: n }) {
|
|
3595
|
+
async init({ userIdentifier: e, debug: t = !1, batch: n, formConfig: i }) {
|
|
3586
3596
|
if (!e) throw new Error("userIdentifier is required parameter");
|
|
3587
3597
|
this.userIdentifier = e, this.clientLogger.configure({
|
|
3588
3598
|
enabled: t,
|
|
@@ -3590,25 +3600,23 @@ class Ce {
|
|
|
3590
3600
|
}), this.headers = {
|
|
3591
3601
|
"X-Client-Key": this.clientKey,
|
|
3592
3602
|
"X-User-Id": this.userIdentifier
|
|
3593
|
-
};
|
|
3603
|
+
}, this.formConfig = i;
|
|
3594
3604
|
try {
|
|
3595
|
-
const
|
|
3596
|
-
await this.initializeManagers(
|
|
3605
|
+
const s = await this.initializeSession();
|
|
3606
|
+
await this.initializeManagers(s, n), this.initialized = !0, this.clientLogger.info("Nemme client initialized", {
|
|
3597
3607
|
clientKey: this.clientKey,
|
|
3598
3608
|
userIdentifier: this.userIdentifier
|
|
3599
3609
|
});
|
|
3600
|
-
} catch (
|
|
3601
|
-
this.clientLogger.error("Error during initialization:",
|
|
3610
|
+
} catch (s) {
|
|
3611
|
+
this.clientLogger.error("Error during initialization:", s);
|
|
3602
3612
|
}
|
|
3603
3613
|
return this;
|
|
3604
3614
|
}
|
|
3605
3615
|
async flush() {
|
|
3606
|
-
|
|
3607
|
-
return (e = this.trackingManager) == null ? void 0 : e.flush();
|
|
3616
|
+
return this.trackingManager?.flush();
|
|
3608
3617
|
}
|
|
3609
3618
|
destroy() {
|
|
3610
|
-
|
|
3611
|
-
(e = this.trackingManager) == null || e.destroy();
|
|
3619
|
+
this.trackingManager?.destroy();
|
|
3612
3620
|
}
|
|
3613
3621
|
async track(e) {
|
|
3614
3622
|
if (!this.initialized || !this.trackingManager) {
|
|
@@ -3618,22 +3626,21 @@ class Ce {
|
|
|
3618
3626
|
return this.trackingManager.track(e);
|
|
3619
3627
|
}
|
|
3620
3628
|
async initializeSession() {
|
|
3621
|
-
var e;
|
|
3622
3629
|
try {
|
|
3623
|
-
const
|
|
3630
|
+
const e = await D.post(
|
|
3624
3631
|
"/external/trackings/initialize",
|
|
3625
3632
|
{},
|
|
3626
3633
|
{ headers: this.headers }
|
|
3627
3634
|
);
|
|
3628
|
-
if (!
|
|
3629
|
-
throw new Error(
|
|
3630
|
-
return
|
|
3631
|
-
} catch (
|
|
3632
|
-
throw this.clientLogger.error("Error during initialization",
|
|
3635
|
+
if (!e.ok)
|
|
3636
|
+
throw new Error(e.error?.message || "Request for initialising session failed");
|
|
3637
|
+
return e.data;
|
|
3638
|
+
} catch (e) {
|
|
3639
|
+
throw this.clientLogger.error("Error during initialization", e), e;
|
|
3633
3640
|
}
|
|
3634
3641
|
}
|
|
3635
3642
|
async initializeManagers(e, t) {
|
|
3636
|
-
const n = new
|
|
3643
|
+
const n = new Ui(this.clientLogger, this.headers, this.formConfig), i = new _i({
|
|
3637
3644
|
logger: this.clientLogger,
|
|
3638
3645
|
headers: this.headers,
|
|
3639
3646
|
sessionId: e.sessionId,
|
|
@@ -3641,81 +3648,83 @@ class Ce {
|
|
|
3641
3648
|
batchConfig: t,
|
|
3642
3649
|
onPageView: async (s) => {
|
|
3643
3650
|
await n.evaluateDeliveryTriggers({ url: s });
|
|
3651
|
+
},
|
|
3652
|
+
onEvent: async (s, a) => {
|
|
3653
|
+
await n.evaluateDeliveryTriggers({ eventKey: s.eventKey, eventData: s.data, url: a });
|
|
3644
3654
|
}
|
|
3645
3655
|
});
|
|
3646
|
-
await n.loadDeliveries(), typeof window < "u" && (await
|
|
3656
|
+
await n.loadDeliveries(), typeof window < "u" && (await i.setupPageViewTracking(), await i.trackPageView(), await i.flush()), this.trackingManager = i;
|
|
3647
3657
|
}
|
|
3648
3658
|
}
|
|
3649
|
-
const
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
children: t
|
|
3653
|
-
}) => {
|
|
3654
|
-
const [n, r] = ne(null), [s, a] = ne(!1), [o, c] = ne(null);
|
|
3655
|
-
ue(() => {
|
|
3659
|
+
const Nt = (r) => new Ee(r), Ct = Se(void 0), Xi = ({ clientKey: r, config: e, children: t }) => {
|
|
3660
|
+
const [n, i] = X(null), [s, a] = X(!1), [o, c] = X(null);
|
|
3661
|
+
oe(() => {
|
|
3656
3662
|
let d = null, u = !1;
|
|
3657
3663
|
const h = async () => {
|
|
3658
3664
|
try {
|
|
3659
|
-
const f = new
|
|
3665
|
+
const f = new Ee(r);
|
|
3660
3666
|
if (await f.init(e), u) {
|
|
3661
3667
|
f.destroy();
|
|
3662
3668
|
return;
|
|
3663
3669
|
}
|
|
3664
|
-
d = f,
|
|
3670
|
+
d = f, i(f), a(!0), c(null);
|
|
3665
3671
|
} catch (f) {
|
|
3666
3672
|
u || (c(f instanceof Error ? f.message : "Failed to initialize Nemme client"), a(!1));
|
|
3667
3673
|
}
|
|
3668
3674
|
};
|
|
3669
|
-
return
|
|
3675
|
+
return i(null), a(!1), c(null), h(), () => {
|
|
3670
3676
|
u = !0, d && d.destroy();
|
|
3671
3677
|
};
|
|
3672
|
-
}, [
|
|
3678
|
+
}, [r, e]);
|
|
3673
3679
|
const l = {
|
|
3674
3680
|
client: n,
|
|
3675
3681
|
isInitialized: s,
|
|
3676
3682
|
error: o
|
|
3677
3683
|
};
|
|
3678
|
-
return /* @__PURE__ */ m.jsx(
|
|
3679
|
-
},
|
|
3680
|
-
const
|
|
3681
|
-
if (
|
|
3684
|
+
return /* @__PURE__ */ m.jsx(Ct.Provider, { value: l, children: t });
|
|
3685
|
+
}, Wi = () => {
|
|
3686
|
+
const r = st(Ct);
|
|
3687
|
+
if (r === void 0)
|
|
3682
3688
|
throw new Error("useNemmeContext must be used within a NemmeProvider");
|
|
3683
|
-
return
|
|
3684
|
-
},
|
|
3685
|
-
const { client:
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3689
|
+
return r;
|
|
3690
|
+
}, er = () => {
|
|
3691
|
+
const { client: r, isInitialized: e, error: t } = Wi(), n = K(
|
|
3692
|
+
async (s) => {
|
|
3693
|
+
if (!r || !e) {
|
|
3694
|
+
console.warn("Nemme client not initialized");
|
|
3695
|
+
return;
|
|
3696
|
+
}
|
|
3697
|
+
return r.track(s);
|
|
3698
|
+
},
|
|
3699
|
+
[r, e]
|
|
3700
|
+
), i = K(async () => {
|
|
3701
|
+
if (!r || !e) {
|
|
3693
3702
|
console.warn("Nemme client not initialized");
|
|
3694
3703
|
return;
|
|
3695
3704
|
}
|
|
3696
|
-
return
|
|
3697
|
-
}, [
|
|
3705
|
+
return r.flush();
|
|
3706
|
+
}, [r, e]);
|
|
3698
3707
|
return {
|
|
3699
3708
|
track: n,
|
|
3700
|
-
flush:
|
|
3709
|
+
flush: i,
|
|
3701
3710
|
isInitialized: e,
|
|
3702
3711
|
error: t,
|
|
3703
|
-
client:
|
|
3712
|
+
client: r
|
|
3704
3713
|
};
|
|
3705
|
-
},
|
|
3706
|
-
const { clientKey: e, ...t } =
|
|
3707
|
-
return await
|
|
3708
|
-
},
|
|
3709
|
-
NemmeClient:
|
|
3710
|
-
init:
|
|
3714
|
+
}, Zi = (r) => Nt(r), Ji = async (r) => {
|
|
3715
|
+
const { clientKey: e, ...t } = r;
|
|
3716
|
+
return await Nt(e).init(t);
|
|
3717
|
+
}, Qi = Object.assign((r) => Zi(r), {
|
|
3718
|
+
NemmeClient: Ee,
|
|
3719
|
+
init: Ji
|
|
3711
3720
|
});
|
|
3712
|
-
typeof window < "u" && (window.NemmeSDK =
|
|
3721
|
+
typeof window < "u" && (window.NemmeSDK = Qi);
|
|
3713
3722
|
export {
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3723
|
+
Ee as NemmeClient,
|
|
3724
|
+
Xi as NemmeProvider,
|
|
3725
|
+
Qi as NemmeSDK,
|
|
3726
|
+
Qi as default,
|
|
3727
|
+
er as useNemme,
|
|
3728
|
+
Wi as useNemmeContext
|
|
3720
3729
|
};
|
|
3721
3730
|
//# sourceMappingURL=index.esm.js.map
|