@nemme/js-sdk 0.2.1 → 0.2.3
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 +113 -3
- 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 +8 -4
- package/dist/forms/form-wrapper/form-wrapper.d.ts +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +588 -577
- 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/package.json +3 -7
- package/dist/forms/form.d.ts +0 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var Ft = Object.defineProperty;
|
|
2
|
+
var Mt = (i, e, t) => e in i ? Ft(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var w = (i, e, t) => Mt(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as p from "react";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
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) => {
|
|
5
|
+
import ot, { createContext as Ee, useContext as lt, useCallback as q, useState as ne, useRef as ct, useEffect as de, useMemo as Dt, createElement as xe } from "react";
|
|
6
|
+
import { createRoot as At } from "react-dom/client";
|
|
7
|
+
const Vt = (i, e, t, n) => {
|
|
16
8
|
var s, a, o, c;
|
|
17
9
|
const r = [t, {
|
|
18
10
|
code: e,
|
|
@@ -20,10 +12,10 @@ const qt = (i, e, t, n) => {
|
|
|
20
12
|
}];
|
|
21
13
|
if ((a = (s = i == null ? void 0 : i.services) == null ? void 0 : s.logger) != null && a.forward)
|
|
22
14
|
return i.services.logger.forward(r, "warn", "react-i18next::", !0);
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
15
|
+
U(r[0]) && (r[0] = `react-i18next:: ${r[0]}`), (c = (o = i == null ? void 0 : i.services) == null ? void 0 : o.logger) != null && c.warn ? i.services.logger.warn(...r) : console != null && console.warn && console.warn(...r);
|
|
16
|
+
}, Re = {}, be = (i, e, t, n) => {
|
|
17
|
+
U(t) && Re[t] || (U(t) && (Re[t] = /* @__PURE__ */ new Date()), Vt(i, e, t, n));
|
|
18
|
+
}, dt = (i, e) => () => {
|
|
27
19
|
if (i.isInitialized)
|
|
28
20
|
e();
|
|
29
21
|
else {
|
|
@@ -34,21 +26,21 @@ const qt = (i, e, t, n) => {
|
|
|
34
26
|
};
|
|
35
27
|
i.on("initialized", t);
|
|
36
28
|
}
|
|
37
|
-
},
|
|
38
|
-
i.loadNamespaces(e,
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
29
|
+
}, we = (i, e, t) => {
|
|
30
|
+
i.loadNamespaces(e, dt(i, t));
|
|
31
|
+
}, Fe = (i, e, t, n) => {
|
|
32
|
+
if (U(t) && (t = [t]), i.options.preload && i.options.preload.indexOf(e) > -1) return we(i, t, n);
|
|
41
33
|
t.forEach((r) => {
|
|
42
34
|
i.options.ns.indexOf(r) < 0 && i.options.ns.push(r);
|
|
43
|
-
}), i.loadLanguages(e,
|
|
44
|
-
},
|
|
35
|
+
}), i.loadLanguages(e, dt(i, n));
|
|
36
|
+
}, It = (i, e, t = {}) => !e.languages || !e.languages.length ? (be(e, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
45
37
|
languages: e.languages
|
|
46
38
|
}), !0) : e.hasLoadedNamespace(i, {
|
|
47
39
|
lng: t.lng,
|
|
48
40
|
precheck: (n, r) => {
|
|
49
41
|
if (t.bindI18n && t.bindI18n.indexOf("languageChanging") > -1 && n.services.backendConnector.backend && n.isLanguageChangingTo && !r(n.isLanguageChangingTo, i)) return !1;
|
|
50
42
|
}
|
|
51
|
-
}),
|
|
43
|
+
}), U = (i) => typeof i == "string", Ht = (i) => typeof i == "object" && i !== null, Bt = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, zt = {
|
|
52
44
|
"&": "&",
|
|
53
45
|
"&": "&",
|
|
54
46
|
"<": "<",
|
|
@@ -69,8 +61,8 @@ const qt = (i, e, t, n) => {
|
|
|
69
61
|
"…": "…",
|
|
70
62
|
"/": "/",
|
|
71
63
|
"/": "/"
|
|
72
|
-
},
|
|
73
|
-
let
|
|
64
|
+
}, Kt = (i) => zt[i], qt = (i) => i.replace(Bt, Kt);
|
|
65
|
+
let ve = {
|
|
74
66
|
bindI18n: "languageChanged",
|
|
75
67
|
bindI18nStore: "",
|
|
76
68
|
transEmptyNodeValue: "",
|
|
@@ -78,24 +70,24 @@ let ke = {
|
|
|
78
70
|
transWrapTextNodes: "",
|
|
79
71
|
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
80
72
|
useSuspense: !0,
|
|
81
|
-
unescape:
|
|
73
|
+
unescape: qt
|
|
82
74
|
};
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
...
|
|
75
|
+
const Ut = (i = {}) => {
|
|
76
|
+
ve = {
|
|
77
|
+
...ve,
|
|
86
78
|
...i
|
|
87
79
|
};
|
|
88
|
-
},
|
|
89
|
-
let
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
},
|
|
80
|
+
}, _t = () => ve;
|
|
81
|
+
let ut;
|
|
82
|
+
const Wt = (i) => {
|
|
83
|
+
ut = i;
|
|
84
|
+
}, Zt = () => ut, Jt = {
|
|
93
85
|
type: "3rdParty",
|
|
94
86
|
init(i) {
|
|
95
|
-
|
|
87
|
+
Ut(i.options.react), Wt(i);
|
|
96
88
|
}
|
|
97
|
-
},
|
|
98
|
-
class
|
|
89
|
+
}, ht = Ee();
|
|
90
|
+
class Gt {
|
|
99
91
|
constructor() {
|
|
100
92
|
this.usedNamespaces = {};
|
|
101
93
|
}
|
|
@@ -108,78 +100,78 @@ class en {
|
|
|
108
100
|
return Object.keys(this.usedNamespaces);
|
|
109
101
|
}
|
|
110
102
|
}
|
|
111
|
-
const
|
|
112
|
-
const t =
|
|
113
|
-
return
|
|
103
|
+
const Yt = (i, e) => {
|
|
104
|
+
const t = ct();
|
|
105
|
+
return de(() => {
|
|
114
106
|
t.current = i;
|
|
115
107
|
}, [i, e]), t.current;
|
|
116
|
-
},
|
|
117
|
-
var P,
|
|
108
|
+
}, ft = (i, e, t, n) => i.getFixedT(e, t, n), Xt = (i, e, t, n) => q(ft(i, e, t, n), [i, e, t, n]), Oe = (i, e = {}) => {
|
|
109
|
+
var P, C, V, j;
|
|
118
110
|
const {
|
|
119
111
|
i18n: t
|
|
120
112
|
} = e, {
|
|
121
113
|
i18n: n,
|
|
122
114
|
defaultNS: r
|
|
123
|
-
} =
|
|
124
|
-
if (s && !s.reportNamespaces && (s.reportNamespaces = new
|
|
125
|
-
|
|
126
|
-
const O = (
|
|
115
|
+
} = lt(ht) || {}, s = t || n || Zt();
|
|
116
|
+
if (s && !s.reportNamespaces && (s.reportNamespaces = new Gt()), !s) {
|
|
117
|
+
be(s, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
118
|
+
const O = (S, $) => U($) ? $ : Ht($) && U($.defaultValue) ? $.defaultValue : Array.isArray(S) ? S[S.length - 1] : S, E = [O, {}, !1];
|
|
127
119
|
return E.t = O, E.i18n = {}, E.ready = !1, E;
|
|
128
120
|
}
|
|
129
|
-
(P = s.options.react) != null && P.wait &&
|
|
121
|
+
(P = s.options.react) != null && P.wait && be(s, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
130
122
|
const a = {
|
|
131
|
-
...
|
|
123
|
+
..._t(),
|
|
132
124
|
...s.options.react,
|
|
133
125
|
...e
|
|
134
126
|
}, {
|
|
135
127
|
useSuspense: o,
|
|
136
128
|
keyPrefix: c
|
|
137
129
|
} = a;
|
|
138
|
-
let l = r || ((
|
|
139
|
-
l =
|
|
140
|
-
const d = (s.isInitialized || s.initializedStoreOnce) && l.every((O) =>
|
|
130
|
+
let l = r || ((C = s.options) == null ? void 0 : C.defaultNS);
|
|
131
|
+
l = U(l) ? [l] : l || ["translation"], (j = (V = s.reportNamespaces).addUsedNamespaces) == null || j.call(V, l);
|
|
132
|
+
const d = (s.isInitialized || s.initializedStoreOnce) && l.every((O) => It(O, s, a)), u = Xt(s, e.lng || null, a.nsMode === "fallback" ? l : l[0], c), h = () => u, f = () => ft(s, e.lng || null, a.nsMode === "fallback" ? l : l[0], c), [g, y] = ne(h);
|
|
141
133
|
let b = l.join();
|
|
142
134
|
e.lng && (b = `${e.lng}${b}`);
|
|
143
|
-
const
|
|
144
|
-
|
|
135
|
+
const v = Yt(b), k = ct(!0);
|
|
136
|
+
de(() => {
|
|
145
137
|
const {
|
|
146
138
|
bindI18n: O,
|
|
147
139
|
bindI18nStore: E
|
|
148
140
|
} = a;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}) :
|
|
152
|
-
|
|
153
|
-
})), d &&
|
|
154
|
-
const
|
|
155
|
-
|
|
141
|
+
k.current = !0, !d && !o && (e.lng ? Fe(s, e.lng, l, () => {
|
|
142
|
+
k.current && y(f);
|
|
143
|
+
}) : we(s, l, () => {
|
|
144
|
+
k.current && y(f);
|
|
145
|
+
})), d && v && v !== b && k.current && y(f);
|
|
146
|
+
const S = () => {
|
|
147
|
+
k.current && y(f);
|
|
156
148
|
};
|
|
157
|
-
return O && (s == null || s.on(O,
|
|
158
|
-
|
|
149
|
+
return O && (s == null || s.on(O, S)), E && (s == null || s.store.on(E, S)), () => {
|
|
150
|
+
k.current = !1, s && O && (O == null || O.split(" ").forEach(($) => s.off($, S))), E && s && E.split(" ").forEach(($) => s.store.off($, S));
|
|
159
151
|
};
|
|
160
|
-
}, [s, b]),
|
|
161
|
-
|
|
152
|
+
}, [s, b]), de(() => {
|
|
153
|
+
k.current && d && y(h);
|
|
162
154
|
}, [s, c, d]);
|
|
163
155
|
const L = [g, s, d];
|
|
164
156
|
if (L.t = g, L.i18n = s, L.ready = d, d || !d && !o) return L;
|
|
165
157
|
throw new Promise((O) => {
|
|
166
|
-
e.lng ?
|
|
158
|
+
e.lng ? Fe(s, e.lng, l, () => O()) : we(s, l, () => O());
|
|
167
159
|
});
|
|
168
160
|
};
|
|
169
|
-
function
|
|
161
|
+
function Qt({
|
|
170
162
|
i18n: i,
|
|
171
163
|
defaultNS: e,
|
|
172
164
|
children: t
|
|
173
165
|
}) {
|
|
174
|
-
const n =
|
|
166
|
+
const n = Dt(() => ({
|
|
175
167
|
i18n: i,
|
|
176
168
|
defaultNS: e
|
|
177
169
|
}), [i, e]);
|
|
178
|
-
return
|
|
170
|
+
return xe(ht.Provider, {
|
|
179
171
|
value: n
|
|
180
172
|
}, t);
|
|
181
173
|
}
|
|
182
|
-
var
|
|
174
|
+
var pe = { exports: {} }, Y = {};
|
|
183
175
|
/**
|
|
184
176
|
* @license React
|
|
185
177
|
* react-jsx-runtime.production.min.js
|
|
@@ -189,11 +181,11 @@ var me = { exports: {} }, Y = {};
|
|
|
189
181
|
* This source code is licensed under the MIT license found in the
|
|
190
182
|
* LICENSE file in the root directory of this source tree.
|
|
191
183
|
*/
|
|
192
|
-
var
|
|
193
|
-
function
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
var i =
|
|
184
|
+
var Me;
|
|
185
|
+
function en() {
|
|
186
|
+
if (Me) return Y;
|
|
187
|
+
Me = 1;
|
|
188
|
+
var i = ot, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
197
189
|
function a(o, c, l) {
|
|
198
190
|
var d, u = {}, h = null, f = null;
|
|
199
191
|
l !== void 0 && (h = "" + l), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
|
@@ -203,13 +195,13 @@ function sn() {
|
|
|
203
195
|
}
|
|
204
196
|
return Y.Fragment = t, Y.jsx = a, Y.jsxs = a, Y;
|
|
205
197
|
}
|
|
206
|
-
var
|
|
207
|
-
function
|
|
208
|
-
return
|
|
198
|
+
var De;
|
|
199
|
+
function tn() {
|
|
200
|
+
return De || (De = 1, pe.exports = en()), pe.exports;
|
|
209
201
|
}
|
|
210
|
-
var m =
|
|
211
|
-
const
|
|
212
|
-
const { t: o } =
|
|
202
|
+
var m = tn();
|
|
203
|
+
const nn = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPreviousStep: s, onUpdateResponse: a }) => {
|
|
204
|
+
const { t: o } = Oe(), l = ((d) => {
|
|
213
205
|
let u = 0;
|
|
214
206
|
if (e.startTransition) {
|
|
215
207
|
if (d === u)
|
|
@@ -228,16 +220,16 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
228
220
|
customStartButton: g,
|
|
229
221
|
startButtonText: y,
|
|
230
222
|
customOptOutButton: b,
|
|
231
|
-
optOutButtonText:
|
|
223
|
+
optOutButtonText: v
|
|
232
224
|
} = l.transition;
|
|
233
225
|
return /* @__PURE__ */ m.jsx(
|
|
234
|
-
|
|
226
|
+
vn,
|
|
235
227
|
{
|
|
236
228
|
title: d,
|
|
237
229
|
description: u,
|
|
238
230
|
icon: e.icon,
|
|
239
231
|
image: h,
|
|
240
|
-
quitText: f ? b ?
|
|
232
|
+
quitText: f ? b ? v : o("Quit") : void 0,
|
|
241
233
|
onQuit: f ? () => n(t) : void 0,
|
|
242
234
|
startText: g ? y : o("Start"),
|
|
243
235
|
onStart: r
|
|
@@ -247,7 +239,7 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
247
239
|
if ((l == null ? void 0 : l.type) === "end") {
|
|
248
240
|
const { title: d, description: u, image: h, customEndButton: f, endButtonText: g, customEndButtonLink: y, endButtonLink: b } = l.transition;
|
|
249
241
|
return /* @__PURE__ */ m.jsx(
|
|
250
|
-
|
|
242
|
+
wn,
|
|
251
243
|
{
|
|
252
244
|
title: d,
|
|
253
245
|
description: u,
|
|
@@ -262,9 +254,9 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
262
254
|
if ((l == null ? void 0 : l.type) === "question") {
|
|
263
255
|
const { question: d } = l;
|
|
264
256
|
if (d.questionType === "choice") {
|
|
265
|
-
const { title: u, description: h, image: f, alternatives: g, maxSelections: y, required: b } = d,
|
|
257
|
+
const { title: u, description: h, image: f, alternatives: g, maxSelections: y, required: b } = d, v = t.responses[d.id] || [], k = (y ? v.length <= y || y === 4 : !0) && (b ? v.length > 0 : !0);
|
|
266
258
|
return /* @__PURE__ */ m.jsx(
|
|
267
|
-
|
|
259
|
+
yn,
|
|
268
260
|
{
|
|
269
261
|
title: u,
|
|
270
262
|
description: h,
|
|
@@ -275,22 +267,22 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
275
267
|
icon: e.icon,
|
|
276
268
|
maxAlternatives: y,
|
|
277
269
|
onQuit: () => n(t),
|
|
278
|
-
selectedAlternatives:
|
|
270
|
+
selectedAlternatives: v,
|
|
279
271
|
onAlternativeSelect: (L) => {
|
|
280
272
|
if (y > 1) {
|
|
281
|
-
const
|
|
273
|
+
const C = v, V = C.includes(L) ? C.filter((j) => j !== L) : y && C.length >= y && y != 4 ? C : [...C, L];
|
|
282
274
|
a(d.id, V);
|
|
283
275
|
} else
|
|
284
|
-
|
|
276
|
+
v.includes(L) ? a(d.id, []) : a(d.id, [L]);
|
|
285
277
|
},
|
|
286
|
-
isValid:
|
|
278
|
+
isValid: k
|
|
287
279
|
}
|
|
288
280
|
);
|
|
289
281
|
}
|
|
290
282
|
if (d.questionType === "text") {
|
|
291
|
-
const { title: u, description: h, image: f, maxChars: g, limited: y, required: b } = d,
|
|
283
|
+
const { title: u, description: h, image: f, maxChars: g, limited: y, required: b } = d, v = t.responses[d.id] || "", k = (y && g ? v.length <= g : !0) && (b ? v.length > 0 : !0);
|
|
292
284
|
return /* @__PURE__ */ m.jsx(
|
|
293
|
-
|
|
285
|
+
bn,
|
|
294
286
|
{
|
|
295
287
|
title: u,
|
|
296
288
|
icon: e.icon,
|
|
@@ -300,60 +292,67 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
300
292
|
onQuit: () => n(t),
|
|
301
293
|
image: f,
|
|
302
294
|
maxCharacters: y ? g : void 0,
|
|
303
|
-
inputText:
|
|
295
|
+
inputText: v,
|
|
304
296
|
setInputText: (L) => {
|
|
305
297
|
y && g && L.length > g || a(d.id, L);
|
|
306
298
|
},
|
|
307
|
-
isValid:
|
|
299
|
+
isValid: k
|
|
308
300
|
}
|
|
309
301
|
);
|
|
310
302
|
}
|
|
311
303
|
}
|
|
312
304
|
return null;
|
|
313
|
-
},
|
|
314
|
-
const
|
|
305
|
+
}, rn = ({ form: i, onDismiss: e, onComplete: t, zIndex: n = 100 }) => {
|
|
306
|
+
const s = (i.startTransition ? 1 : 0) + i.questions.length + (i.endTransition ? 1 : 0) - 1, [a, o] = ne({
|
|
315
307
|
responses: {},
|
|
316
308
|
currentStep: 0,
|
|
317
309
|
startedAt: /* @__PURE__ */ new Date()
|
|
318
|
-
}),
|
|
319
|
-
|
|
320
|
-
...
|
|
310
|
+
}), c = q((h, f) => {
|
|
311
|
+
o((g) => ({
|
|
312
|
+
...g,
|
|
321
313
|
responses: {
|
|
322
|
-
...
|
|
323
|
-
[
|
|
314
|
+
...g.responses,
|
|
315
|
+
[h]: f
|
|
324
316
|
}
|
|
325
317
|
}));
|
|
326
|
-
}, []),
|
|
327
|
-
|
|
328
|
-
...
|
|
329
|
-
currentStep:
|
|
318
|
+
}, []), l = q((h) => {
|
|
319
|
+
o((f) => ({
|
|
320
|
+
...f,
|
|
321
|
+
currentStep: h
|
|
330
322
|
}));
|
|
331
|
-
}, []),
|
|
332
|
-
if (
|
|
333
|
-
|
|
323
|
+
}, []), d = q(() => {
|
|
324
|
+
if (a.currentStep < s)
|
|
325
|
+
l(a.currentStep + 1);
|
|
334
326
|
else {
|
|
335
|
-
const
|
|
336
|
-
...
|
|
327
|
+
const h = {
|
|
328
|
+
...a,
|
|
337
329
|
completedAt: /* @__PURE__ */ new Date()
|
|
338
330
|
};
|
|
339
|
-
t(
|
|
331
|
+
t(h);
|
|
340
332
|
}
|
|
341
|
-
}, [
|
|
342
|
-
|
|
343
|
-
}, [
|
|
344
|
-
return /* @__PURE__ */ m.jsx(
|
|
345
|
-
|
|
333
|
+
}, [a, s, l, t]), u = q(() => {
|
|
334
|
+
a.currentStep > 0 && l(a.currentStep - 1);
|
|
335
|
+
}, [a.currentStep, l]);
|
|
336
|
+
return /* @__PURE__ */ m.jsx(
|
|
337
|
+
"div",
|
|
346
338
|
{
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
339
|
+
className: "flex flex-col justify-center items-center absolute inset-0 bg-overlay-background-default-light dark:bg-overlay-background-default-dark",
|
|
340
|
+
style: { zIndex: n },
|
|
341
|
+
children: /* @__PURE__ */ m.jsx(
|
|
342
|
+
nn,
|
|
343
|
+
{
|
|
344
|
+
step: a.currentStep,
|
|
345
|
+
form: i,
|
|
346
|
+
formState: a,
|
|
347
|
+
onDismiss: e,
|
|
348
|
+
onNextStep: d,
|
|
349
|
+
onPreviousStep: u,
|
|
350
|
+
onUpdateResponse: c
|
|
351
|
+
}
|
|
352
|
+
)
|
|
354
353
|
}
|
|
355
|
-
)
|
|
356
|
-
},
|
|
354
|
+
);
|
|
355
|
+
}, sn = /* @__PURE__ */ new Map([
|
|
357
356
|
[
|
|
358
357
|
"bold",
|
|
359
358
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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" }))
|
|
@@ -384,7 +383,7 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
384
383
|
"thin",
|
|
385
384
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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
385
|
]
|
|
387
|
-
]),
|
|
386
|
+
]), an = /* @__PURE__ */ new Map([
|
|
388
387
|
[
|
|
389
388
|
"bold",
|
|
390
389
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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" }))
|
|
@@ -409,7 +408,7 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
409
408
|
"thin",
|
|
410
409
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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
410
|
]
|
|
412
|
-
]),
|
|
411
|
+
]), on = /* @__PURE__ */ new Map([
|
|
413
412
|
[
|
|
414
413
|
"bold",
|
|
415
414
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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" }))
|
|
@@ -434,7 +433,7 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
434
433
|
"thin",
|
|
435
434
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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
435
|
]
|
|
437
|
-
]),
|
|
436
|
+
]), ln = /* @__PURE__ */ new Map([
|
|
438
437
|
[
|
|
439
438
|
"bold",
|
|
440
439
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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" }))
|
|
@@ -465,7 +464,7 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
465
464
|
"thin",
|
|
466
465
|
/* @__PURE__ */ p.createElement(p.Fragment, null, /* @__PURE__ */ p.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
466
|
]
|
|
468
|
-
]),
|
|
467
|
+
]), gt = Ee({
|
|
469
468
|
color: "currentColor",
|
|
470
469
|
size: "1em",
|
|
471
470
|
weight: "regular",
|
|
@@ -487,7 +486,7 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
487
486
|
weight: h = "regular",
|
|
488
487
|
mirrored: f = !1,
|
|
489
488
|
...g
|
|
490
|
-
} = p.useContext(
|
|
489
|
+
} = p.useContext(gt);
|
|
491
490
|
return /* @__PURE__ */ p.createElement(
|
|
492
491
|
"svg",
|
|
493
492
|
{
|
|
@@ -508,15 +507,15 @@ const on = ({ step: i, form: e, formState: t, onDismiss: n, onNextStep: r, onPre
|
|
|
508
507
|
}
|
|
509
508
|
);
|
|
510
509
|
ae.displayName = "IconBase";
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
var
|
|
510
|
+
const pt = p.forwardRef((i, e) => /* @__PURE__ */ p.createElement(ae, { ref: e, ...i, weights: sn }));
|
|
511
|
+
pt.displayName = "ArrowSquareOutIcon";
|
|
512
|
+
const mt = p.forwardRef((i, e) => /* @__PURE__ */ p.createElement(ae, { ref: e, ...i, weights: an }));
|
|
513
|
+
mt.displayName = "CaretLeftIcon";
|
|
514
|
+
const yt = p.forwardRef((i, e) => /* @__PURE__ */ p.createElement(ae, { ref: e, ...i, weights: on }));
|
|
515
|
+
yt.displayName = "CaretRightIcon";
|
|
516
|
+
const fe = p.forwardRef((i, e) => /* @__PURE__ */ p.createElement(ae, { ref: e, ...i, weights: ln }));
|
|
517
|
+
fe.displayName = "XIcon";
|
|
518
|
+
var Ae = { exports: {} }, X = {};
|
|
520
519
|
/**
|
|
521
520
|
* @license React
|
|
522
521
|
* react-jsx-runtime.production.min.js
|
|
@@ -526,11 +525,11 @@ var Ie = { exports: {} }, X = {};
|
|
|
526
525
|
* This source code is licensed under the MIT license found in the
|
|
527
526
|
* LICENSE file in the root directory of this source tree.
|
|
528
527
|
*/
|
|
529
|
-
var
|
|
530
|
-
function
|
|
531
|
-
if (
|
|
532
|
-
|
|
533
|
-
var i =
|
|
528
|
+
var Ve;
|
|
529
|
+
function cn() {
|
|
530
|
+
if (Ve) return X;
|
|
531
|
+
Ve = 1;
|
|
532
|
+
var i = ot, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
534
533
|
function a(o, c, l) {
|
|
535
534
|
var d, u = {}, h = null, f = null;
|
|
536
535
|
l !== void 0 && (h = "" + l), c.key !== void 0 && (h = "" + c.key), c.ref !== void 0 && (f = c.ref);
|
|
@@ -540,11 +539,11 @@ function fn() {
|
|
|
540
539
|
}
|
|
541
540
|
return X.Fragment = t, X.jsx = a, X.jsxs = a, X;
|
|
542
541
|
}
|
|
543
|
-
var
|
|
544
|
-
function
|
|
545
|
-
return
|
|
542
|
+
var Ie;
|
|
543
|
+
function dn() {
|
|
544
|
+
return Ie || (Ie = 1, Ae.exports = /* @__PURE__ */ cn()), Ae.exports;
|
|
546
545
|
}
|
|
547
|
-
var
|
|
546
|
+
var ce = /* @__PURE__ */ dn();
|
|
548
547
|
const B = ({
|
|
549
548
|
variant: i = "primary",
|
|
550
549
|
size: e = "medium",
|
|
@@ -554,34 +553,34 @@ const B = ({
|
|
|
554
553
|
className: s,
|
|
555
554
|
disabled: a = !1,
|
|
556
555
|
...o
|
|
557
|
-
}) => /* @__PURE__ */
|
|
556
|
+
}) => /* @__PURE__ */ ce.jsx(
|
|
558
557
|
"button",
|
|
559
558
|
{
|
|
560
559
|
className: F(
|
|
561
560
|
"flex gap-2 justify-center items-center rounded-lg disabled:pointer-events-none",
|
|
562
|
-
|
|
563
|
-
|
|
561
|
+
un(i),
|
|
562
|
+
hn(e),
|
|
564
563
|
s
|
|
565
564
|
),
|
|
566
565
|
disabled: a,
|
|
567
566
|
...o,
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
-
|
|
567
|
+
children: /* @__PURE__ */ ce.jsxs(
|
|
568
|
+
gt.Provider,
|
|
570
569
|
{
|
|
571
570
|
value: {
|
|
572
571
|
size: e === "xsmall" ? 8 : 16,
|
|
573
572
|
weight: "regular",
|
|
574
|
-
className: F(
|
|
573
|
+
className: F(He(i, a))
|
|
575
574
|
},
|
|
576
575
|
children: [
|
|
577
576
|
n && n,
|
|
578
|
-
t && /* @__PURE__ */
|
|
577
|
+
t && /* @__PURE__ */ ce.jsx("span", { className: F(He(i, a), fn(e)), children: t }),
|
|
579
578
|
r && r
|
|
580
579
|
]
|
|
581
580
|
}
|
|
582
581
|
)
|
|
583
582
|
}
|
|
584
|
-
),
|
|
583
|
+
), un = (i) => {
|
|
585
584
|
switch (i) {
|
|
586
585
|
case "primary":
|
|
587
586
|
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";
|
|
@@ -592,7 +591,7 @@ const B = ({
|
|
|
592
591
|
case "subtle":
|
|
593
592
|
return "border border-grey-0/0 hover:bg-background-universal-overlay-light dark:hover:bg-background-universal-overlay-dark";
|
|
594
593
|
}
|
|
595
|
-
},
|
|
594
|
+
}, He = (i, e) => {
|
|
596
595
|
if (e) return "text-label-tertiary-light dark:text-label-tertiary-dark";
|
|
597
596
|
switch (i) {
|
|
598
597
|
case "primary":
|
|
@@ -604,7 +603,7 @@ const B = ({
|
|
|
604
603
|
case "subtle":
|
|
605
604
|
return "text-label-primary-light dark:text-label-primary-dark";
|
|
606
605
|
}
|
|
607
|
-
},
|
|
606
|
+
}, hn = (i) => {
|
|
608
607
|
switch (i) {
|
|
609
608
|
case "xsmall":
|
|
610
609
|
return "p-1";
|
|
@@ -613,7 +612,7 @@ const B = ({
|
|
|
613
612
|
case "medium":
|
|
614
613
|
return "p-3";
|
|
615
614
|
}
|
|
616
|
-
},
|
|
615
|
+
}, fn = (i) => {
|
|
617
616
|
switch (i) {
|
|
618
617
|
case "xsmall":
|
|
619
618
|
return "text-[10px] leading-[14px]";
|
|
@@ -623,23 +622,23 @@ const B = ({
|
|
|
623
622
|
return "text-[15px] leading-[16px] -tracking-0,1";
|
|
624
623
|
}
|
|
625
624
|
};
|
|
626
|
-
function
|
|
625
|
+
function xt(i) {
|
|
627
626
|
var e, t, n = "";
|
|
628
627
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
629
628
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
630
629
|
var r = i.length;
|
|
631
|
-
for (e = 0; e < r; e++) i[e] && (t =
|
|
630
|
+
for (e = 0; e < r; e++) i[e] && (t = xt(i[e])) && (n && (n += " "), n += t);
|
|
632
631
|
} else for (t in i) i[t] && (n && (n += " "), n += t);
|
|
633
632
|
return n;
|
|
634
633
|
}
|
|
635
|
-
function
|
|
636
|
-
for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e =
|
|
634
|
+
function gn() {
|
|
635
|
+
for (var i, e, t = 0, n = "", r = arguments.length; t < r; t++) (i = arguments[t]) && (e = xt(i)) && (n && (n += " "), n += e);
|
|
637
636
|
return n;
|
|
638
637
|
}
|
|
639
|
-
const F =
|
|
640
|
-
const s = r ??
|
|
641
|
-
return /* @__PURE__ */
|
|
642
|
-
},
|
|
638
|
+
const F = gn, z = ({ children: i, className: e, variant: t = "B1", significance: n = "primary", as: r }) => {
|
|
639
|
+
const s = r ?? pn[t], a = bt[t];
|
|
640
|
+
return /* @__PURE__ */ ce.jsx(s, { className: F("font-sans", mn[n], e, a), children: i });
|
|
641
|
+
}, bt = {
|
|
643
642
|
Di1: "text-[72px] font-bold leading-[90px] -tracking-2,5",
|
|
644
643
|
Di2: "text-[60px] font-bold leading-[72px] -tracking-2,0",
|
|
645
644
|
Di3: "text-[48px] font-bold leading-[60px] -tracking-1,5",
|
|
@@ -658,7 +657,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
658
657
|
D1B: "text-[12px] font-bold leading-[16px]",
|
|
659
658
|
D1: "text-[12px] leading-[16px]",
|
|
660
659
|
M: "text-[10px] leading-[16px]"
|
|
661
|
-
},
|
|
660
|
+
}, pn = {
|
|
662
661
|
Di1: "h1",
|
|
663
662
|
Di2: "h2",
|
|
664
663
|
Di3: "h3",
|
|
@@ -677,7 +676,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
677
676
|
D1B: "p",
|
|
678
677
|
D1: "p",
|
|
679
678
|
M: "p"
|
|
680
|
-
},
|
|
679
|
+
}, mn = {
|
|
681
680
|
primary: "text-label-primary-light dark:text-label-primary-dark",
|
|
682
681
|
secondary: "text-label-secondary-light dark:text-label-secondary-dark",
|
|
683
682
|
tertiary: "text-label-tertiary-light dark:text-label-tertiary-dark",
|
|
@@ -685,7 +684,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
685
684
|
placeholder: "text-label-placeholder-light dark:text-label-placeholder-dark",
|
|
686
685
|
"nonadaptable-text": "text-nonadaptable-text-light dark:text-nonadaptable-text-dark",
|
|
687
686
|
disabled: "text-primary-action-disabled-light dark:text-primary-action-disabled-dark"
|
|
688
|
-
},
|
|
687
|
+
}, wt = ({
|
|
689
688
|
title: i,
|
|
690
689
|
icon: e,
|
|
691
690
|
description: t,
|
|
@@ -696,7 +695,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
696
695
|
onQuit: o,
|
|
697
696
|
isValid: c
|
|
698
697
|
}) => {
|
|
699
|
-
const { t: l } =
|
|
698
|
+
const { t: l } = Oe();
|
|
700
699
|
return /* @__PURE__ */ m.jsxs(
|
|
701
700
|
"div",
|
|
702
701
|
{
|
|
@@ -705,7 +704,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
705
704
|
"grid-cols-1 p-4 pt-10",
|
|
706
705
|
"md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]",
|
|
707
706
|
n ? "md:grid-cols-2" : "md:grid-cols-1",
|
|
708
|
-
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick
|
|
707
|
+
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick"
|
|
709
708
|
),
|
|
710
709
|
children: [
|
|
711
710
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col justify-between order-2 md:order-1", children: [
|
|
@@ -718,12 +717,12 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
718
717
|
children: /* @__PURE__ */ m.jsx("img", { className: "w-full h-full object-cover", src: e, alt: "icon" })
|
|
719
718
|
}
|
|
720
719
|
),
|
|
721
|
-
/* @__PURE__ */ m.jsx(
|
|
720
|
+
/* @__PURE__ */ m.jsx(z, { variant: "H2", children: i }),
|
|
722
721
|
t && t.trim().replace(/\n{3,}/g, `
|
|
723
722
|
|
|
724
723
|
`).split(`
|
|
725
724
|
|
|
726
|
-
`).map((d, u) => /* @__PURE__ */ m.jsx(
|
|
725
|
+
`).map((d, u) => /* @__PURE__ */ m.jsx(z, { significance: "secondary", children: d.trim() }, u))
|
|
727
726
|
] }),
|
|
728
727
|
r
|
|
729
728
|
] }),
|
|
@@ -733,7 +732,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
733
732
|
{
|
|
734
733
|
variant: "subtle",
|
|
735
734
|
onClick: s,
|
|
736
|
-
iconBefore: /* @__PURE__ */ m.jsx(
|
|
735
|
+
iconBefore: /* @__PURE__ */ m.jsx(mt, {}),
|
|
737
736
|
disabled: !s,
|
|
738
737
|
text: l("Previous")
|
|
739
738
|
}
|
|
@@ -743,7 +742,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
743
742
|
{
|
|
744
743
|
variant: "subtle",
|
|
745
744
|
onClick: a,
|
|
746
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
745
|
+
iconAfter: /* @__PURE__ */ m.jsx(yt, {}),
|
|
747
746
|
disabled: !a || !c,
|
|
748
747
|
text: l("Next")
|
|
749
748
|
}
|
|
@@ -756,7 +755,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
756
755
|
variant: "subtle",
|
|
757
756
|
size: "small",
|
|
758
757
|
onClick: o,
|
|
759
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
758
|
+
iconAfter: /* @__PURE__ */ m.jsx(fe, {}),
|
|
760
759
|
"aria-label": "quit"
|
|
761
760
|
}
|
|
762
761
|
)
|
|
@@ -765,7 +764,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
765
764
|
]
|
|
766
765
|
}
|
|
767
766
|
);
|
|
768
|
-
},
|
|
767
|
+
}, yn = ({
|
|
769
768
|
title: i,
|
|
770
769
|
icon: e,
|
|
771
770
|
description: t,
|
|
@@ -779,7 +778,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
779
778
|
maxAlternatives: d,
|
|
780
779
|
isValid: u
|
|
781
780
|
}) => /* @__PURE__ */ m.jsx(
|
|
782
|
-
|
|
781
|
+
wt,
|
|
783
782
|
{
|
|
784
783
|
title: i,
|
|
785
784
|
icon: e,
|
|
@@ -795,8 +794,8 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
795
794
|
onClick: () => c(h.id),
|
|
796
795
|
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
796
|
children: [
|
|
798
|
-
/* @__PURE__ */ m.jsx(
|
|
799
|
-
/* @__PURE__ */ m.jsx(
|
|
797
|
+
/* @__PURE__ */ m.jsx(z, { variant: "B1Button", children: h.text }),
|
|
798
|
+
/* @__PURE__ */ m.jsx(xn, { size: 20, selected: l.includes(h.id) })
|
|
800
799
|
]
|
|
801
800
|
},
|
|
802
801
|
h.id
|
|
@@ -809,7 +808,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
809
808
|
l.includes(h.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
809
|
),
|
|
811
810
|
children: /* @__PURE__ */ m.jsx(
|
|
812
|
-
|
|
811
|
+
z,
|
|
813
812
|
{
|
|
814
813
|
variant: "B1Button",
|
|
815
814
|
significance: l.includes(h.id) ? "quaternary" : "primary",
|
|
@@ -820,7 +819,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
820
819
|
h.id
|
|
821
820
|
)) }) })
|
|
822
821
|
}
|
|
823
|
-
),
|
|
822
|
+
), xn = ({ size: i = 16, strokeColor: e = "currentColor", fillColor: t = "none", selected: n = !1 }) => {
|
|
824
823
|
const r = i + 1, s = r / 2, a = (i - 2) / 2;
|
|
825
824
|
return /* @__PURE__ */ m.jsxs(
|
|
826
825
|
"svg",
|
|
@@ -855,7 +854,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
855
854
|
]
|
|
856
855
|
}
|
|
857
856
|
);
|
|
858
|
-
},
|
|
857
|
+
}, bn = ({
|
|
859
858
|
title: i,
|
|
860
859
|
icon: e,
|
|
861
860
|
description: t,
|
|
@@ -868,9 +867,9 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
868
867
|
maxCharacters: l,
|
|
869
868
|
isValid: d
|
|
870
869
|
}) => {
|
|
871
|
-
const { t: u } =
|
|
870
|
+
const { t: u } = Oe();
|
|
872
871
|
return /* @__PURE__ */ m.jsx(
|
|
873
|
-
|
|
872
|
+
wt,
|
|
874
873
|
{
|
|
875
874
|
title: i,
|
|
876
875
|
icon: e,
|
|
@@ -882,12 +881,12 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
882
881
|
isValid: d,
|
|
883
882
|
children: /* @__PURE__ */ m.jsxs("div", { className: "flex flex-col py-3 gap-2", children: [
|
|
884
883
|
l && /* @__PURE__ */ m.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
885
|
-
/* @__PURE__ */ m.jsx(
|
|
886
|
-
/* @__PURE__ */ m.jsx(
|
|
884
|
+
/* @__PURE__ */ m.jsx(z, { significance: "secondary", children: u("Max {{maxCharacters}} characters", { maxCharacters: l }) }),
|
|
885
|
+
/* @__PURE__ */ m.jsx(z, { significance: "secondary", children: `${o.length}/${l}` })
|
|
887
886
|
] }),
|
|
888
887
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col relative", children: [
|
|
889
888
|
/* @__PURE__ */ m.jsx(
|
|
890
|
-
|
|
889
|
+
z,
|
|
891
890
|
{
|
|
892
891
|
as: "div",
|
|
893
892
|
className: F(
|
|
@@ -903,10 +902,10 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
903
902
|
placeholder: u("Type your answer here"),
|
|
904
903
|
className: F(
|
|
905
904
|
"absolute inset-0 resize-none",
|
|
906
|
-
"overflow-hidden break-words outline-none resize-none
|
|
905
|
+
"overflow-hidden break-words outline-none resize-none material-medium",
|
|
907
906
|
"rounded-lg py-3 px-4 min-h-20 border border-separator-opaque-light dark:border-separator-opaque-dark",
|
|
908
907
|
"text-label-primary-light dark:text-label-primary-dark",
|
|
909
|
-
|
|
908
|
+
bt.B1
|
|
910
909
|
),
|
|
911
910
|
value: o,
|
|
912
911
|
onChange: (h) => c(h.target.value)
|
|
@@ -916,7 +915,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
916
915
|
] })
|
|
917
916
|
}
|
|
918
917
|
);
|
|
919
|
-
},
|
|
918
|
+
}, vt = ({ title: i, icon: e, description: t, image: n, children: r, wrapperClassName: s }) => /* @__PURE__ */ m.jsxs(
|
|
920
919
|
"div",
|
|
921
920
|
{
|
|
922
921
|
className: F(
|
|
@@ -924,7 +923,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
924
923
|
"grid-cols-1 p-4 pt-10",
|
|
925
924
|
"md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]",
|
|
926
925
|
n ? "md:grid-cols-2" : "md:grid-cols-1",
|
|
927
|
-
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick
|
|
926
|
+
"border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick",
|
|
928
927
|
s
|
|
929
928
|
),
|
|
930
929
|
children: [
|
|
@@ -932,26 +931,26 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
932
931
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-6 md:gap-8", children: [
|
|
933
932
|
/* @__PURE__ */ m.jsxs("div", { className: "flex flex-col gap-2 md:gap-4", children: [
|
|
934
933
|
e && /* @__PURE__ */ m.jsx("div", { className: F("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" }) }),
|
|
935
|
-
/* @__PURE__ */ m.jsx(
|
|
934
|
+
/* @__PURE__ */ m.jsx(z, { variant: "H2", children: i })
|
|
936
935
|
] }),
|
|
937
936
|
t && t.trim().replace(/\n{3,}/g, `
|
|
938
937
|
|
|
939
938
|
`).split(`
|
|
940
939
|
|
|
941
|
-
`).map((a, o) => /* @__PURE__ */ m.jsx(
|
|
940
|
+
`).map((a, o) => /* @__PURE__ */ m.jsx(z, { children: a.trim() }, o))
|
|
942
941
|
] }),
|
|
943
942
|
r
|
|
944
943
|
] }),
|
|
945
944
|
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
945
|
]
|
|
947
946
|
}
|
|
948
|
-
),
|
|
947
|
+
), wn = ({ title: i, icon: e, description: t, image: n, quitText: r, onQuit: s, externalLink: a }) => /* @__PURE__ */ m.jsxs(vt, { title: i, icon: e, description: t, image: n, children: [
|
|
949
948
|
/* @__PURE__ */ m.jsx("div", { className: "flex justify-end gap-2", children: a ? /* @__PURE__ */ m.jsx(
|
|
950
949
|
B,
|
|
951
950
|
{
|
|
952
951
|
variant: "secondary",
|
|
953
952
|
text: r,
|
|
954
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
953
|
+
iconAfter: /* @__PURE__ */ m.jsx(pt, {}),
|
|
955
954
|
onClick: () => {
|
|
956
955
|
window.open(a, "_blank"), s == null || s();
|
|
957
956
|
}
|
|
@@ -964,11 +963,11 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
964
963
|
variant: "secondary",
|
|
965
964
|
size: "small",
|
|
966
965
|
onClick: s,
|
|
967
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
966
|
+
iconAfter: /* @__PURE__ */ m.jsx(fe, {}),
|
|
968
967
|
"aria-label": "quit"
|
|
969
968
|
}
|
|
970
969
|
)
|
|
971
|
-
] }),
|
|
970
|
+
] }), vn = ({
|
|
972
971
|
title: i,
|
|
973
972
|
icon: e,
|
|
974
973
|
description: t,
|
|
@@ -977,7 +976,7 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
977
976
|
onQuit: s,
|
|
978
977
|
startText: a,
|
|
979
978
|
onStart: o
|
|
980
|
-
}) => /* @__PURE__ */ m.jsxs(
|
|
979
|
+
}) => /* @__PURE__ */ m.jsxs(vt, { title: i, icon: e, description: t, image: n, wrapperClassName: "relative", children: [
|
|
981
980
|
/* @__PURE__ */ m.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
982
981
|
s && r && /* @__PURE__ */ m.jsx(B, { variant: "subtle", text: r, onClick: s }),
|
|
983
982
|
/* @__PURE__ */ m.jsx(B, { variant: "secondary", text: a, onClick: o })
|
|
@@ -989,19 +988,19 @@ const F = xn, q = ({ children: i, className: e, variant: t = "B1", significance:
|
|
|
989
988
|
variant: "subtle",
|
|
990
989
|
size: "small",
|
|
991
990
|
onClick: s,
|
|
992
|
-
iconAfter: /* @__PURE__ */ m.jsx(
|
|
991
|
+
iconAfter: /* @__PURE__ */ m.jsx(fe, {}),
|
|
993
992
|
"aria-label": "quit"
|
|
994
993
|
}
|
|
995
994
|
)
|
|
996
995
|
] });
|
|
997
|
-
let
|
|
998
|
-
function
|
|
999
|
-
return
|
|
996
|
+
let St = {};
|
|
997
|
+
function Sn() {
|
|
998
|
+
return St;
|
|
1000
999
|
}
|
|
1001
|
-
function
|
|
1002
|
-
|
|
1000
|
+
function kn(i) {
|
|
1001
|
+
St = i;
|
|
1003
1002
|
}
|
|
1004
|
-
const
|
|
1003
|
+
const Ln = {
|
|
1005
1004
|
lessThanXSeconds: {
|
|
1006
1005
|
one: "less than a second",
|
|
1007
1006
|
other: "less than {{count}} seconds"
|
|
@@ -1063,25 +1062,25 @@ const Nn = {
|
|
|
1063
1062
|
one: "almost 1 year",
|
|
1064
1063
|
other: "almost {{count}} years"
|
|
1065
1064
|
}
|
|
1066
|
-
},
|
|
1065
|
+
}, En = (i, e, t) => {
|
|
1067
1066
|
let n;
|
|
1068
|
-
const r =
|
|
1067
|
+
const r = Ln[i];
|
|
1069
1068
|
return typeof r == "string" ? n = r : e === 1 ? n = r.one : n = r.other.replace("{{count}}", e.toString()), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
1070
1069
|
};
|
|
1071
|
-
function
|
|
1070
|
+
function me(i) {
|
|
1072
1071
|
return (e = {}) => {
|
|
1073
1072
|
const t = e.width ? String(e.width) : i.defaultWidth;
|
|
1074
1073
|
return i.formats[t] || i.formats[i.defaultWidth];
|
|
1075
1074
|
};
|
|
1076
1075
|
}
|
|
1077
|
-
const
|
|
1076
|
+
const On = {
|
|
1078
1077
|
lastWeek: "'last' eeee 'at' p",
|
|
1079
1078
|
yesterday: "'yesterday at' p",
|
|
1080
1079
|
today: "'today at' p",
|
|
1081
1080
|
tomorrow: "'tomorrow at' p",
|
|
1082
1081
|
nextWeek: "eeee 'at' p",
|
|
1083
1082
|
other: "P"
|
|
1084
|
-
},
|
|
1083
|
+
}, Pn = (i, e, t, n) => On[i];
|
|
1085
1084
|
function Q(i) {
|
|
1086
1085
|
return (e, t) => {
|
|
1087
1086
|
const n = t != null && t.context ? String(t.context) : "standalone";
|
|
@@ -1097,15 +1096,15 @@ function Q(i) {
|
|
|
1097
1096
|
return r[s];
|
|
1098
1097
|
};
|
|
1099
1098
|
}
|
|
1100
|
-
const
|
|
1099
|
+
const Cn = {
|
|
1101
1100
|
narrow: ["B", "A"],
|
|
1102
1101
|
abbreviated: ["BC", "AD"],
|
|
1103
1102
|
wide: ["Before Christ", "Anno Domini"]
|
|
1104
|
-
},
|
|
1103
|
+
}, Nn = {
|
|
1105
1104
|
narrow: ["1", "2", "3", "4"],
|
|
1106
1105
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1107
1106
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1108
|
-
},
|
|
1107
|
+
}, jn = {
|
|
1109
1108
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1110
1109
|
abbreviated: [
|
|
1111
1110
|
"Jan",
|
|
@@ -1135,7 +1134,7 @@ const Tn = {
|
|
|
1135
1134
|
"November",
|
|
1136
1135
|
"December"
|
|
1137
1136
|
]
|
|
1138
|
-
},
|
|
1137
|
+
}, Tn = {
|
|
1139
1138
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1140
1139
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1141
1140
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -1148,7 +1147,7 @@ const Tn = {
|
|
|
1148
1147
|
"Friday",
|
|
1149
1148
|
"Saturday"
|
|
1150
1149
|
]
|
|
1151
|
-
},
|
|
1150
|
+
}, $n = {
|
|
1152
1151
|
narrow: {
|
|
1153
1152
|
am: "a",
|
|
1154
1153
|
pm: "p",
|
|
@@ -1179,7 +1178,7 @@ const Tn = {
|
|
|
1179
1178
|
evening: "evening",
|
|
1180
1179
|
night: "night"
|
|
1181
1180
|
}
|
|
1182
|
-
},
|
|
1181
|
+
}, Rn = {
|
|
1183
1182
|
narrow: {
|
|
1184
1183
|
am: "a",
|
|
1185
1184
|
pm: "p",
|
|
@@ -1210,7 +1209,7 @@ const Tn = {
|
|
|
1210
1209
|
evening: "in the evening",
|
|
1211
1210
|
night: "at night"
|
|
1212
1211
|
}
|
|
1213
|
-
},
|
|
1212
|
+
}, Fn = (i, e) => {
|
|
1214
1213
|
const t = Number(i), n = t % 100;
|
|
1215
1214
|
if (n > 20 || n < 10)
|
|
1216
1215
|
switch (n % 10) {
|
|
@@ -1222,29 +1221,29 @@ const Tn = {
|
|
|
1222
1221
|
return t + "rd";
|
|
1223
1222
|
}
|
|
1224
1223
|
return t + "th";
|
|
1225
|
-
},
|
|
1226
|
-
ordinalNumber:
|
|
1224
|
+
}, Mn = {
|
|
1225
|
+
ordinalNumber: Fn,
|
|
1227
1226
|
era: Q({
|
|
1228
|
-
values:
|
|
1227
|
+
values: Cn,
|
|
1229
1228
|
defaultWidth: "wide"
|
|
1230
1229
|
}),
|
|
1231
1230
|
quarter: Q({
|
|
1232
|
-
values:
|
|
1231
|
+
values: Nn,
|
|
1233
1232
|
defaultWidth: "wide",
|
|
1234
1233
|
argumentCallback: (i) => i - 1
|
|
1235
1234
|
}),
|
|
1236
1235
|
month: Q({
|
|
1237
|
-
values:
|
|
1236
|
+
values: jn,
|
|
1238
1237
|
defaultWidth: "wide"
|
|
1239
1238
|
}),
|
|
1240
1239
|
day: Q({
|
|
1241
|
-
values:
|
|
1240
|
+
values: Tn,
|
|
1242
1241
|
defaultWidth: "wide"
|
|
1243
1242
|
}),
|
|
1244
1243
|
dayPeriod: Q({
|
|
1245
|
-
values:
|
|
1244
|
+
values: $n,
|
|
1246
1245
|
defaultWidth: "wide",
|
|
1247
|
-
formattingValues:
|
|
1246
|
+
formattingValues: Rn,
|
|
1248
1247
|
defaultFormattingWidth: "wide"
|
|
1249
1248
|
})
|
|
1250
1249
|
};
|
|
@@ -1253,9 +1252,9 @@ function ee(i) {
|
|
|
1253
1252
|
const n = t.width, r = n && i.matchPatterns[n] || i.matchPatterns[i.defaultMatchWidth], s = e.match(r);
|
|
1254
1253
|
if (!s)
|
|
1255
1254
|
return null;
|
|
1256
|
-
const a = s[0], o = n && i.parsePatterns[n] || i.parsePatterns[i.defaultParseWidth], c = Array.isArray(o) ?
|
|
1255
|
+
const a = s[0], o = n && i.parsePatterns[n] || i.parsePatterns[i.defaultParseWidth], c = Array.isArray(o) ? An(o, (u) => u.test(a)) : (
|
|
1257
1256
|
// [TODO] -- I challenge you to fix the type
|
|
1258
|
-
|
|
1257
|
+
Dn(o, (u) => u.test(a))
|
|
1259
1258
|
);
|
|
1260
1259
|
let l;
|
|
1261
1260
|
l = i.valueCallback ? i.valueCallback(c) : c, l = t.valueCallback ? (
|
|
@@ -1266,17 +1265,17 @@ function ee(i) {
|
|
|
1266
1265
|
return { value: l, rest: d };
|
|
1267
1266
|
};
|
|
1268
1267
|
}
|
|
1269
|
-
function
|
|
1268
|
+
function Dn(i, e) {
|
|
1270
1269
|
for (const t in i)
|
|
1271
1270
|
if (Object.prototype.hasOwnProperty.call(i, t) && e(i[t]))
|
|
1272
1271
|
return t;
|
|
1273
1272
|
}
|
|
1274
|
-
function
|
|
1273
|
+
function An(i, e) {
|
|
1275
1274
|
for (let t = 0; t < i.length; t++)
|
|
1276
1275
|
if (e(i[t]))
|
|
1277
1276
|
return t;
|
|
1278
1277
|
}
|
|
1279
|
-
function
|
|
1278
|
+
function Vn(i) {
|
|
1280
1279
|
return (e, t = {}) => {
|
|
1281
1280
|
const n = e.match(i.matchPattern);
|
|
1282
1281
|
if (!n) return null;
|
|
@@ -1288,23 +1287,23 @@ function qn(i) {
|
|
|
1288
1287
|
return { value: a, rest: o };
|
|
1289
1288
|
};
|
|
1290
1289
|
}
|
|
1291
|
-
const
|
|
1290
|
+
const In = /^(\d+)(th|st|nd|rd)?/i, Hn = /\d+/i, Bn = {
|
|
1292
1291
|
narrow: /^(b|a)/i,
|
|
1293
1292
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1294
1293
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1295
|
-
},
|
|
1294
|
+
}, zn = {
|
|
1296
1295
|
any: [/^b/i, /^(a|c)/i]
|
|
1297
|
-
},
|
|
1296
|
+
}, Kn = {
|
|
1298
1297
|
narrow: /^[1234]/i,
|
|
1299
1298
|
abbreviated: /^q[1234]/i,
|
|
1300
1299
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1301
|
-
},
|
|
1300
|
+
}, qn = {
|
|
1302
1301
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1303
|
-
},
|
|
1302
|
+
}, Un = {
|
|
1304
1303
|
narrow: /^[jfmasond]/i,
|
|
1305
1304
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1306
1305
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1307
|
-
},
|
|
1306
|
+
}, _n = {
|
|
1308
1307
|
narrow: [
|
|
1309
1308
|
/^j/i,
|
|
1310
1309
|
/^f/i,
|
|
@@ -1333,18 +1332,18 @@ const zn = /^(\d+)(th|st|nd|rd)?/i, Un = /\d+/i, Kn = {
|
|
|
1333
1332
|
/^n/i,
|
|
1334
1333
|
/^d/i
|
|
1335
1334
|
]
|
|
1336
|
-
},
|
|
1335
|
+
}, Wn = {
|
|
1337
1336
|
narrow: /^[smtwf]/i,
|
|
1338
1337
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1339
1338
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1340
1339
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1341
|
-
},
|
|
1340
|
+
}, Zn = {
|
|
1342
1341
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1343
1342
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1344
|
-
},
|
|
1343
|
+
}, Jn = {
|
|
1345
1344
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1346
1345
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1347
|
-
},
|
|
1346
|
+
}, Gn = {
|
|
1348
1347
|
any: {
|
|
1349
1348
|
am: /^a/i,
|
|
1350
1349
|
pm: /^p/i,
|
|
@@ -1355,87 +1354,87 @@ const zn = /^(\d+)(th|st|nd|rd)?/i, Un = /\d+/i, Kn = {
|
|
|
1355
1354
|
evening: /evening/i,
|
|
1356
1355
|
night: /night/i
|
|
1357
1356
|
}
|
|
1358
|
-
},
|
|
1359
|
-
ordinalNumber:
|
|
1360
|
-
matchPattern:
|
|
1361
|
-
parsePattern:
|
|
1357
|
+
}, Yn = {
|
|
1358
|
+
ordinalNumber: Vn({
|
|
1359
|
+
matchPattern: In,
|
|
1360
|
+
parsePattern: Hn,
|
|
1362
1361
|
valueCallback: (i) => parseInt(i, 10)
|
|
1363
1362
|
}),
|
|
1364
1363
|
era: ee({
|
|
1365
|
-
matchPatterns:
|
|
1364
|
+
matchPatterns: Bn,
|
|
1366
1365
|
defaultMatchWidth: "wide",
|
|
1367
|
-
parsePatterns:
|
|
1366
|
+
parsePatterns: zn,
|
|
1368
1367
|
defaultParseWidth: "any"
|
|
1369
1368
|
}),
|
|
1370
1369
|
quarter: ee({
|
|
1371
|
-
matchPatterns:
|
|
1370
|
+
matchPatterns: Kn,
|
|
1372
1371
|
defaultMatchWidth: "wide",
|
|
1373
|
-
parsePatterns:
|
|
1372
|
+
parsePatterns: qn,
|
|
1374
1373
|
defaultParseWidth: "any",
|
|
1375
1374
|
valueCallback: (i) => i + 1
|
|
1376
1375
|
}),
|
|
1377
1376
|
month: ee({
|
|
1378
|
-
matchPatterns:
|
|
1377
|
+
matchPatterns: Un,
|
|
1379
1378
|
defaultMatchWidth: "wide",
|
|
1380
|
-
parsePatterns:
|
|
1379
|
+
parsePatterns: _n,
|
|
1381
1380
|
defaultParseWidth: "any"
|
|
1382
1381
|
}),
|
|
1383
1382
|
day: ee({
|
|
1384
|
-
matchPatterns:
|
|
1383
|
+
matchPatterns: Wn,
|
|
1385
1384
|
defaultMatchWidth: "wide",
|
|
1386
|
-
parsePatterns:
|
|
1385
|
+
parsePatterns: Zn,
|
|
1387
1386
|
defaultParseWidth: "any"
|
|
1388
1387
|
}),
|
|
1389
1388
|
dayPeriod: ee({
|
|
1390
|
-
matchPatterns:
|
|
1389
|
+
matchPatterns: Jn,
|
|
1391
1390
|
defaultMatchWidth: "any",
|
|
1392
|
-
parsePatterns:
|
|
1391
|
+
parsePatterns: Gn,
|
|
1393
1392
|
defaultParseWidth: "any"
|
|
1394
1393
|
})
|
|
1395
1394
|
};
|
|
1396
|
-
function
|
|
1397
|
-
const e = {}, t =
|
|
1395
|
+
function Xn(i) {
|
|
1396
|
+
const e = {}, t = Sn();
|
|
1398
1397
|
for (const n in t)
|
|
1399
1398
|
Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
1400
1399
|
for (const n in i)
|
|
1401
1400
|
Object.prototype.hasOwnProperty.call(i, n) && (i[n] === void 0 ? delete e[n] : e[n] = i[n]);
|
|
1402
|
-
|
|
1401
|
+
kn(e);
|
|
1403
1402
|
}
|
|
1404
|
-
const
|
|
1403
|
+
const Qn = {
|
|
1405
1404
|
full: "EEEE, d MMMM yyyy",
|
|
1406
1405
|
long: "d MMMM yyyy",
|
|
1407
1406
|
medium: "d MMM yyyy",
|
|
1408
1407
|
short: "dd/MM/yyyy"
|
|
1409
|
-
},
|
|
1408
|
+
}, er = {
|
|
1410
1409
|
full: "HH:mm:ss zzzz",
|
|
1411
1410
|
long: "HH:mm:ss z",
|
|
1412
1411
|
medium: "HH:mm:ss",
|
|
1413
1412
|
short: "HH:mm"
|
|
1414
|
-
},
|
|
1413
|
+
}, tr = {
|
|
1415
1414
|
full: "{{date}} 'at' {{time}}",
|
|
1416
1415
|
long: "{{date}} 'at' {{time}}",
|
|
1417
1416
|
medium: "{{date}}, {{time}}",
|
|
1418
1417
|
short: "{{date}}, {{time}}"
|
|
1419
|
-
},
|
|
1420
|
-
date:
|
|
1421
|
-
formats:
|
|
1418
|
+
}, nr = {
|
|
1419
|
+
date: me({
|
|
1420
|
+
formats: Qn,
|
|
1422
1421
|
defaultWidth: "full"
|
|
1423
1422
|
}),
|
|
1424
|
-
time:
|
|
1425
|
-
formats:
|
|
1423
|
+
time: me({
|
|
1424
|
+
formats: er,
|
|
1426
1425
|
defaultWidth: "full"
|
|
1427
1426
|
}),
|
|
1428
|
-
dateTime:
|
|
1429
|
-
formats:
|
|
1427
|
+
dateTime: me({
|
|
1428
|
+
formats: tr,
|
|
1430
1429
|
defaultWidth: "full"
|
|
1431
1430
|
})
|
|
1432
|
-
},
|
|
1431
|
+
}, rr = {
|
|
1433
1432
|
code: "en-GB",
|
|
1434
|
-
formatDistance:
|
|
1435
|
-
formatLong:
|
|
1436
|
-
formatRelative:
|
|
1437
|
-
localize:
|
|
1438
|
-
match:
|
|
1433
|
+
formatDistance: En,
|
|
1434
|
+
formatLong: nr,
|
|
1435
|
+
formatRelative: Pn,
|
|
1436
|
+
localize: Mn,
|
|
1437
|
+
match: Yn,
|
|
1439
1438
|
options: {
|
|
1440
1439
|
weekStartsOn: 1,
|
|
1441
1440
|
firstWeekContainsDate: 4
|
|
@@ -1446,23 +1445,23 @@ const rr = {
|
|
|
1446
1445
|
i = n, e = r;
|
|
1447
1446
|
});
|
|
1448
1447
|
return t.resolve = i, t.reject = e, t;
|
|
1449
|
-
},
|
|
1448
|
+
}, Be = (i) => i == null ? "" : "" + i, ir = (i, e, t) => {
|
|
1450
1449
|
i.forEach((n) => {
|
|
1451
1450
|
e[n] && (t[n] = e[n]);
|
|
1452
1451
|
});
|
|
1453
|
-
},
|
|
1452
|
+
}, sr = /###/g, ze = (i) => i && i.indexOf("###") > -1 ? i.replace(sr, ".") : i, Ke = (i) => !i || x(i), re = (i, e, t) => {
|
|
1454
1453
|
const n = x(e) ? e.split(".") : e;
|
|
1455
1454
|
let r = 0;
|
|
1456
1455
|
for (; r < n.length - 1; ) {
|
|
1457
1456
|
if (Ke(i)) return {};
|
|
1458
|
-
const s =
|
|
1457
|
+
const s = ze(n[r]);
|
|
1459
1458
|
!i[s] && t && (i[s] = new t()), Object.prototype.hasOwnProperty.call(i, s) ? i = i[s] : i = {}, ++r;
|
|
1460
1459
|
}
|
|
1461
1460
|
return Ke(i) ? {} : {
|
|
1462
1461
|
obj: i,
|
|
1463
|
-
k:
|
|
1462
|
+
k: ze(n[r])
|
|
1464
1463
|
};
|
|
1465
|
-
},
|
|
1464
|
+
}, qe = (i, e, t) => {
|
|
1466
1465
|
const {
|
|
1467
1466
|
obj: n,
|
|
1468
1467
|
k: r
|
|
@@ -1475,28 +1474,28 @@ const rr = {
|
|
|
1475
1474
|
for (; o.obj === void 0 && a.length; )
|
|
1476
1475
|
s = `${a[a.length - 1]}.${s}`, a = a.slice(0, a.length - 1), o = re(i, a, Object), o != null && o.obj && typeof o.obj[`${o.k}.${s}`] < "u" && (o.obj = void 0);
|
|
1477
1476
|
o.obj[`${o.k}.${s}`] = t;
|
|
1478
|
-
},
|
|
1477
|
+
}, ar = (i, e, t, n) => {
|
|
1479
1478
|
const {
|
|
1480
1479
|
obj: r,
|
|
1481
1480
|
k: s
|
|
1482
1481
|
} = re(i, e, Object);
|
|
1483
1482
|
r[s] = r[s] || [], r[s].push(t);
|
|
1484
|
-
},
|
|
1483
|
+
}, ue = (i, e) => {
|
|
1485
1484
|
const {
|
|
1486
1485
|
obj: t,
|
|
1487
1486
|
k: n
|
|
1488
1487
|
} = re(i, e);
|
|
1489
1488
|
if (t && Object.prototype.hasOwnProperty.call(t, n))
|
|
1490
1489
|
return t[n];
|
|
1491
|
-
},
|
|
1492
|
-
const n =
|
|
1493
|
-
return n !== void 0 ? n :
|
|
1494
|
-
},
|
|
1490
|
+
}, or = (i, e, t) => {
|
|
1491
|
+
const n = ue(i, t);
|
|
1492
|
+
return n !== void 0 ? n : ue(e, t);
|
|
1493
|
+
}, kt = (i, e, t) => {
|
|
1495
1494
|
for (const n in e)
|
|
1496
|
-
n !== "__proto__" && n !== "constructor" && (n in i ? x(i[n]) || i[n] instanceof String || x(e[n]) || e[n] instanceof String ? t && (i[n] = e[n]) :
|
|
1495
|
+
n !== "__proto__" && n !== "constructor" && (n in i ? x(i[n]) || i[n] instanceof String || x(e[n]) || e[n] instanceof String ? t && (i[n] = e[n]) : kt(i[n], e[n], t) : i[n] = e[n]);
|
|
1497
1496
|
return i;
|
|
1498
1497
|
}, _ = (i) => i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
1499
|
-
var
|
|
1498
|
+
var lr = {
|
|
1500
1499
|
"&": "&",
|
|
1501
1500
|
"<": "<",
|
|
1502
1501
|
">": ">",
|
|
@@ -1504,8 +1503,8 @@ var hr = {
|
|
|
1504
1503
|
"'": "'",
|
|
1505
1504
|
"/": "/"
|
|
1506
1505
|
};
|
|
1507
|
-
const
|
|
1508
|
-
class
|
|
1506
|
+
const cr = (i) => x(i) ? i.replace(/[&<>"'\/]/g, (e) => lr[e]) : i;
|
|
1507
|
+
class dr {
|
|
1509
1508
|
constructor(e) {
|
|
1510
1509
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
1511
1510
|
}
|
|
@@ -1517,11 +1516,11 @@ class gr {
|
|
|
1517
1516
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
1518
1517
|
}
|
|
1519
1518
|
}
|
|
1520
|
-
const
|
|
1519
|
+
const ur = [" ", ",", "?", "!", ";"], hr = new dr(20), fr = (i, e, t) => {
|
|
1521
1520
|
e = e || "", t = t || "";
|
|
1522
|
-
const n =
|
|
1521
|
+
const n = ur.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
|
|
1523
1522
|
if (n.length === 0) return !0;
|
|
1524
|
-
const r =
|
|
1523
|
+
const r = hr.getRegExp(`(${n.map((a) => a === "?" ? "\\?" : a).join("|")})`);
|
|
1525
1524
|
let s = !r.test(i);
|
|
1526
1525
|
if (!s) {
|
|
1527
1526
|
const a = i.indexOf(t);
|
|
@@ -1548,7 +1547,7 @@ const pr = [" ", ",", "?", "!", ";"], mr = new gr(20), yr = (i, e, t) => {
|
|
|
1548
1547
|
r = a;
|
|
1549
1548
|
}
|
|
1550
1549
|
return r;
|
|
1551
|
-
}, ie = (i) => i == null ? void 0 : i.replace("_", "-"),
|
|
1550
|
+
}, ie = (i) => i == null ? void 0 : i.replace("_", "-"), gr = {
|
|
1552
1551
|
type: "logger",
|
|
1553
1552
|
log(i) {
|
|
1554
1553
|
this.output("log", i);
|
|
@@ -1564,12 +1563,12 @@ const pr = [" ", ",", "?", "!", ";"], mr = new gr(20), yr = (i, e, t) => {
|
|
|
1564
1563
|
(n = (t = console == null ? void 0 : console[i]) == null ? void 0 : t.apply) == null || n.call(t, console, e);
|
|
1565
1564
|
}
|
|
1566
1565
|
};
|
|
1567
|
-
let
|
|
1566
|
+
let pr = class ke {
|
|
1568
1567
|
constructor(e, t = {}) {
|
|
1569
1568
|
this.init(e, t);
|
|
1570
1569
|
}
|
|
1571
1570
|
init(e, t = {}) {
|
|
1572
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
1571
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || gr, this.options = t, this.debug = t.debug;
|
|
1573
1572
|
}
|
|
1574
1573
|
log(...e) {
|
|
1575
1574
|
return this.forward(e, "log", "", !0);
|
|
@@ -1587,17 +1586,17 @@ let br = class Le {
|
|
|
1587
1586
|
return r && !this.debug ? null : (x(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
1588
1587
|
}
|
|
1589
1588
|
create(e) {
|
|
1590
|
-
return new
|
|
1589
|
+
return new ke(this.logger, {
|
|
1591
1590
|
prefix: `${this.prefix}:${e}:`,
|
|
1592
1591
|
...this.options
|
|
1593
1592
|
});
|
|
1594
1593
|
}
|
|
1595
1594
|
clone(e) {
|
|
1596
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new
|
|
1595
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new ke(this.logger, e);
|
|
1597
1596
|
}
|
|
1598
1597
|
};
|
|
1599
|
-
var A = new
|
|
1600
|
-
class
|
|
1598
|
+
var A = new pr();
|
|
1599
|
+
class ge {
|
|
1601
1600
|
constructor() {
|
|
1602
1601
|
this.observers = {};
|
|
1603
1602
|
}
|
|
@@ -1627,7 +1626,7 @@ class pe {
|
|
|
1627
1626
|
});
|
|
1628
1627
|
}
|
|
1629
1628
|
}
|
|
1630
|
-
class
|
|
1629
|
+
class Ue extends ge {
|
|
1631
1630
|
constructor(e, t = {
|
|
1632
1631
|
ns: ["translation"],
|
|
1633
1632
|
defaultNS: "translation"
|
|
@@ -1646,7 +1645,7 @@ class We extends pe {
|
|
|
1646
1645
|
const s = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator, a = r.ignoreJSONStructure !== void 0 ? r.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
1647
1646
|
let o;
|
|
1648
1647
|
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 =
|
|
1648
|
+
const c = ue(this.data, o);
|
|
1650
1649
|
return !c && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), c || !a || !x(n) ? c : Se((d = (l = this.data) == null ? void 0 : l[e]) == null ? void 0 : d[t], n, s);
|
|
1651
1650
|
}
|
|
1652
1651
|
addResource(e, t, n, r, s = {
|
|
@@ -1654,7 +1653,7 @@ class We extends pe {
|
|
|
1654
1653
|
}) {
|
|
1655
1654
|
const a = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator;
|
|
1656
1655
|
let o = [e, t];
|
|
1657
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
1656
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), qe(this.data, o, r), s.silent || this.emit("added", e, t, n, r);
|
|
1658
1657
|
}
|
|
1659
1658
|
addResources(e, t, n, r = {
|
|
1660
1659
|
silent: !1
|
|
@@ -1671,11 +1670,11 @@ class We extends pe {
|
|
|
1671
1670
|
}) {
|
|
1672
1671
|
let o = [e, t];
|
|
1673
1672
|
e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
1674
|
-
let c =
|
|
1675
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
1673
|
+
let c = ue(this.data, o) || {};
|
|
1674
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? kt(c, n, s) : c = {
|
|
1676
1675
|
...c,
|
|
1677
1676
|
...n
|
|
1678
|
-
},
|
|
1677
|
+
}, qe(this.data, o, c), a.silent || this.emit("added", e, t, n);
|
|
1679
1678
|
}
|
|
1680
1679
|
removeResourceBundle(e, t) {
|
|
1681
1680
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -1697,7 +1696,7 @@ class We extends pe {
|
|
|
1697
1696
|
return this.data;
|
|
1698
1697
|
}
|
|
1699
1698
|
}
|
|
1700
|
-
var
|
|
1699
|
+
var Lt = {
|
|
1701
1700
|
processors: {},
|
|
1702
1701
|
addPostProcessor(i) {
|
|
1703
1702
|
this.processors[i.name] = i;
|
|
@@ -1709,25 +1708,25 @@ var Ot = {
|
|
|
1709
1708
|
}), e;
|
|
1710
1709
|
}
|
|
1711
1710
|
};
|
|
1712
|
-
const
|
|
1713
|
-
function
|
|
1711
|
+
const Et = Symbol("i18next/PATH_KEY");
|
|
1712
|
+
function mr() {
|
|
1714
1713
|
const i = [], e = /* @__PURE__ */ Object.create(null);
|
|
1715
1714
|
let t;
|
|
1716
1715
|
return e.get = (n, r) => {
|
|
1717
1716
|
var s;
|
|
1718
|
-
return (s = t == null ? void 0 : t.revoke) == null || s.call(t), r ===
|
|
1717
|
+
return (s = t == null ? void 0 : t.revoke) == null || s.call(t), r === Et ? i : (i.push(r), t = Proxy.revocable(n, e), t.proxy);
|
|
1719
1718
|
}, Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
|
|
1720
1719
|
}
|
|
1721
|
-
function
|
|
1720
|
+
function Le(i, e) {
|
|
1722
1721
|
const {
|
|
1723
|
-
[
|
|
1724
|
-
} = i(
|
|
1722
|
+
[Et]: t
|
|
1723
|
+
} = i(mr());
|
|
1725
1724
|
return t.join((e == null ? void 0 : e.keySeparator) ?? ".");
|
|
1726
1725
|
}
|
|
1727
|
-
const
|
|
1728
|
-
class
|
|
1726
|
+
const _e = {}, We = (i) => !x(i) && typeof i != "boolean" && typeof i != "number";
|
|
1727
|
+
class he extends ge {
|
|
1729
1728
|
constructor(e, t = {}) {
|
|
1730
|
-
super(),
|
|
1729
|
+
super(), ir(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = A.create("translator");
|
|
1731
1730
|
}
|
|
1732
1731
|
changeLanguage(e) {
|
|
1733
1732
|
e && (this.language = e);
|
|
@@ -1747,7 +1746,7 @@ class fe extends pe {
|
|
|
1747
1746
|
n === void 0 && (n = ":");
|
|
1748
1747
|
const r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
1749
1748
|
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 && !
|
|
1749
|
+
const a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !fr(e, n, r);
|
|
1751
1750
|
if (a && !o) {
|
|
1752
1751
|
const c = e.match(this.interpolator.nestingRegexp);
|
|
1753
1752
|
if (c && c.length > 0)
|
|
@@ -1770,7 +1769,7 @@ class fe extends pe {
|
|
|
1770
1769
|
if (typeof r != "object" && this.options.overloadTranslationOptionHandler && (r = this.options.overloadTranslationOptionHandler(arguments)), typeof r == "object" && (r = {
|
|
1771
1770
|
...r
|
|
1772
1771
|
}), r || (r = {}), e == null) return "";
|
|
1773
|
-
typeof e == "function" && (e =
|
|
1772
|
+
typeof e == "function" && (e = Le(e, {
|
|
1774
1773
|
...this.options,
|
|
1775
1774
|
...r
|
|
1776
1775
|
})), Array.isArray(e) || (e = [String(e)]);
|
|
@@ -1799,70 +1798,70 @@ class fe extends pe {
|
|
|
1799
1798
|
} : o;
|
|
1800
1799
|
const f = this.resolve(e, r);
|
|
1801
1800
|
let g = f == null ? void 0 : f.res;
|
|
1802
|
-
const y = (f == null ? void 0 : f.usedKey) || o, b = (f == null ? void 0 : f.exactUsedKey) || o,
|
|
1801
|
+
const y = (f == null ? void 0 : f.usedKey) || o, b = (f == null ? void 0 : f.exactUsedKey) || o, v = ["[object Number]", "[object Function]", "[object RegExp]"], k = r.joinArrays !== void 0 ? r.joinArrays : this.options.joinArrays, L = !this.i18nFormat || this.i18nFormat.handleAsObject, P = r.count !== void 0 && !x(r.count), C = he.hasDefaultValue(r), V = P ? this.pluralResolver.getSuffix(u, r.count, r) : "", j = r.ordinal && P ? this.pluralResolver.getSuffix(u, r.count, {
|
|
1803
1802
|
ordinal: !1
|
|
1804
1803
|
}) : "", O = P && !r.ordinal && r.count === 0, E = O && r[`defaultValue${this.options.pluralSeparator}zero`] || r[`defaultValue${V}`] || r[`defaultValue${j}`] || r.defaultValue;
|
|
1805
|
-
let
|
|
1806
|
-
L && !g &&
|
|
1807
|
-
const
|
|
1808
|
-
if (L &&
|
|
1804
|
+
let S = g;
|
|
1805
|
+
L && !g && C && (S = E);
|
|
1806
|
+
const $ = We(S), Rt = Object.prototype.toString.apply(S);
|
|
1807
|
+
if (L && S && $ && v.indexOf(Rt) < 0 && !(x(k) && Array.isArray(S))) {
|
|
1809
1808
|
if (!r.returnObjects && !this.options.returnObjects) {
|
|
1810
1809
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
1811
|
-
const M = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(y,
|
|
1810
|
+
const M = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(y, S, {
|
|
1812
1811
|
...r,
|
|
1813
1812
|
ns: c
|
|
1814
1813
|
}) : `key '${o} (${this.language})' returned an object instead of string.`;
|
|
1815
1814
|
return s ? (f.res = M, f.usedParams = this.getUsedParamsDetails(r), f) : M;
|
|
1816
1815
|
}
|
|
1817
1816
|
if (a) {
|
|
1818
|
-
const M = Array.isArray(
|
|
1819
|
-
for (const D in
|
|
1820
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1821
|
-
const I = `${
|
|
1822
|
-
|
|
1817
|
+
const M = Array.isArray(S), R = M ? [] : {}, Ne = M ? b : y;
|
|
1818
|
+
for (const D in S)
|
|
1819
|
+
if (Object.prototype.hasOwnProperty.call(S, D)) {
|
|
1820
|
+
const I = `${Ne}${a}${D}`;
|
|
1821
|
+
C && !g ? R[D] = this.translate(I, {
|
|
1823
1822
|
...r,
|
|
1824
|
-
defaultValue:
|
|
1823
|
+
defaultValue: We(E) ? E[D] : void 0,
|
|
1825
1824
|
joinArrays: !1,
|
|
1826
1825
|
ns: c
|
|
1827
1826
|
}) : R[D] = this.translate(I, {
|
|
1828
1827
|
...r,
|
|
1829
1828
|
joinArrays: !1,
|
|
1830
1829
|
ns: c
|
|
1831
|
-
}), R[D] === I && (R[D] =
|
|
1830
|
+
}), R[D] === I && (R[D] = S[D]);
|
|
1832
1831
|
}
|
|
1833
1832
|
g = R;
|
|
1834
1833
|
}
|
|
1835
|
-
} else if (L && x(
|
|
1836
|
-
g = g.join(
|
|
1834
|
+
} else if (L && x(k) && Array.isArray(g))
|
|
1835
|
+
g = g.join(k), g && (g = this.extendTranslation(g, e, r, n));
|
|
1837
1836
|
else {
|
|
1838
1837
|
let M = !1, R = !1;
|
|
1839
|
-
!this.isValidLookup(g) &&
|
|
1840
|
-
const D = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && R ? void 0 : g, I =
|
|
1838
|
+
!this.isValidLookup(g) && C && (M = !0, g = E), this.isValidLookup(g) || (R = !0, g = o);
|
|
1839
|
+
const D = (r.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && R ? void 0 : g, I = C && E !== g && this.options.updateMissing;
|
|
1841
1840
|
if (R || M || I) {
|
|
1842
1841
|
if (this.logger.log(I ? "updateKey" : "missingKey", u, l, o, I ? E : g), a) {
|
|
1843
|
-
const
|
|
1842
|
+
const T = this.resolve(o, {
|
|
1844
1843
|
...r,
|
|
1845
1844
|
keySeparator: !1
|
|
1846
1845
|
});
|
|
1847
|
-
|
|
1846
|
+
T && T.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
1847
|
}
|
|
1849
1848
|
let J = [];
|
|
1850
1849
|
const oe = this.languageUtils.getFallbackCodes(this.options.fallbackLng, r.lng || this.language);
|
|
1851
1850
|
if (this.options.saveMissingTo === "fallback" && oe && oe[0])
|
|
1852
|
-
for (let
|
|
1853
|
-
J.push(oe[
|
|
1851
|
+
for (let T = 0; T < oe.length; T++)
|
|
1852
|
+
J.push(oe[T]);
|
|
1854
1853
|
else this.options.saveMissingTo === "all" ? J = this.languageUtils.toResolveHierarchy(r.lng || this.language) : J.push(r.lng || this.language);
|
|
1855
|
-
const
|
|
1856
|
-
var
|
|
1857
|
-
const Te =
|
|
1858
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(
|
|
1854
|
+
const je = (T, K, G) => {
|
|
1855
|
+
var $e;
|
|
1856
|
+
const Te = C && G !== g ? G : D;
|
|
1857
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(T, l, K, Te, I, r) : ($e = this.backendConnector) != null && $e.saveMissing && this.backendConnector.saveMissing(T, l, K, Te, I, r), this.emit("missingKey", T, l, K, g);
|
|
1859
1858
|
};
|
|
1860
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && P ? J.forEach((
|
|
1861
|
-
const
|
|
1862
|
-
O && r[`defaultValue${this.options.pluralSeparator}zero`] &&
|
|
1863
|
-
|
|
1859
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && P ? J.forEach((T) => {
|
|
1860
|
+
const K = this.pluralResolver.getSuffixes(T, r);
|
|
1861
|
+
O && r[`defaultValue${this.options.pluralSeparator}zero`] && K.indexOf(`${this.options.pluralSeparator}zero`) < 0 && K.push(`${this.options.pluralSeparator}zero`), K.forEach((G) => {
|
|
1862
|
+
je([T], o + G, r[`defaultValue${G}`] || E);
|
|
1864
1863
|
});
|
|
1865
|
-
}) :
|
|
1864
|
+
}) : je(J, o, E));
|
|
1866
1865
|
}
|
|
1867
1866
|
g = this.extendTranslation(g, e, r, f, n), R && g === o && this.options.appendNamespaceToMissingKey && (g = `${l}${d}${o}`), (R || M) && this.options.parseMissingKeyHandler && (g = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}${d}${o}` : o, M ? g : void 0, r));
|
|
1868
1867
|
}
|
|
@@ -1902,7 +1901,7 @@ class fe extends pe {
|
|
|
1902
1901
|
!n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...f) => (s == null ? void 0 : s[0]) === f[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`), null) : this.translate(...f, t), n)), n.interpolation && this.interpolator.reset();
|
|
1903
1902
|
}
|
|
1904
1903
|
const a = n.postProcess || this.options.postProcess, o = x(a) ? [a] : a;
|
|
1905
|
-
return e != null && (o != null && o.length) && n.applyPostProcessor !== !1 && (e =
|
|
1904
|
+
return e != null && (o != null && o.length) && n.applyPostProcessor !== !1 && (e = Lt.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
1906
1905
|
i18nResolved: {
|
|
1907
1906
|
...r,
|
|
1908
1907
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -1920,8 +1919,8 @@ class fe extends pe {
|
|
|
1920
1919
|
this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
|
|
1921
1920
|
const h = t.count !== void 0 && !x(t.count), f = h && !t.ordinal && t.count === 0, g = 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
1921
|
u.forEach((b) => {
|
|
1923
|
-
var
|
|
1924
|
-
this.isValidLookup(n) || (o = b, !
|
|
1922
|
+
var v, k;
|
|
1923
|
+
this.isValidLookup(n) || (o = b, !_e[`${y[0]}-${b}`] && ((v = this.utils) != null && v.hasLoadedNamespace) && !((k = this.utils) != null && k.hasLoadedNamespace(o)) && (_e[`${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
1924
|
var V;
|
|
1926
1925
|
if (this.isValidLookup(n)) return;
|
|
1927
1926
|
a = L;
|
|
@@ -1933,13 +1932,13 @@ class fe extends pe {
|
|
|
1933
1932
|
h && (j = this.pluralResolver.getSuffix(L, t.count, t));
|
|
1934
1933
|
const O = `${this.options.pluralSeparator}zero`, E = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
1935
1934
|
if (h && (t.ordinal && j.indexOf(E) === 0 && P.push(d + j.replace(E, this.options.pluralSeparator)), P.push(d + j), f && P.push(d + O)), g) {
|
|
1936
|
-
const
|
|
1937
|
-
P.push(
|
|
1935
|
+
const S = `${d}${this.options.contextSeparator || "_"}${t.context}`;
|
|
1936
|
+
P.push(S), h && (t.ordinal && j.indexOf(E) === 0 && P.push(S + j.replace(E, this.options.pluralSeparator)), P.push(S + j), f && P.push(S + O));
|
|
1938
1937
|
}
|
|
1939
1938
|
}
|
|
1940
|
-
let
|
|
1941
|
-
for (;
|
|
1942
|
-
this.isValidLookup(n) || (s =
|
|
1939
|
+
let C;
|
|
1940
|
+
for (; C = P.pop(); )
|
|
1941
|
+
this.isValidLookup(n) || (s = C, n = this.getResource(L, b, C, t));
|
|
1943
1942
|
}));
|
|
1944
1943
|
});
|
|
1945
1944
|
}), {
|
|
@@ -1980,7 +1979,7 @@ class fe extends pe {
|
|
|
1980
1979
|
return !1;
|
|
1981
1980
|
}
|
|
1982
1981
|
}
|
|
1983
|
-
class
|
|
1982
|
+
class Ze {
|
|
1984
1983
|
constructor(e) {
|
|
1985
1984
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = A.create("languageUtils");
|
|
1986
1985
|
}
|
|
@@ -2044,20 +2043,20 @@ class Ge {
|
|
|
2044
2043
|
}), r;
|
|
2045
2044
|
}
|
|
2046
2045
|
}
|
|
2047
|
-
const
|
|
2046
|
+
const Je = {
|
|
2048
2047
|
zero: 0,
|
|
2049
2048
|
one: 1,
|
|
2050
2049
|
two: 2,
|
|
2051
2050
|
few: 3,
|
|
2052
2051
|
many: 4,
|
|
2053
2052
|
other: 5
|
|
2054
|
-
},
|
|
2053
|
+
}, Ge = {
|
|
2055
2054
|
select: (i) => i === 1 ? "one" : "other",
|
|
2056
2055
|
resolvedOptions: () => ({
|
|
2057
2056
|
pluralCategories: ["one", "other"]
|
|
2058
2057
|
})
|
|
2059
2058
|
};
|
|
2060
|
-
class
|
|
2059
|
+
class yr {
|
|
2061
2060
|
constructor(e, t = {}) {
|
|
2062
2061
|
this.languageUtils = e, this.options = t, this.logger = A.create("pluralResolver"), this.pluralRulesCache = {};
|
|
2063
2062
|
}
|
|
@@ -2081,8 +2080,8 @@ class vr {
|
|
|
2081
2080
|
});
|
|
2082
2081
|
} catch {
|
|
2083
2082
|
if (!Intl)
|
|
2084
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
2085
|
-
if (!e.match(/-|_/)) return
|
|
2083
|
+
return this.logger.error("No Intl support, please use an Intl polyfill!"), Ge;
|
|
2084
|
+
if (!e.match(/-|_/)) return Ge;
|
|
2086
2085
|
const c = this.languageUtils.getLanguagePartFromCode(e);
|
|
2087
2086
|
a = this.getRule(c, t);
|
|
2088
2087
|
}
|
|
@@ -2097,18 +2096,18 @@ class vr {
|
|
|
2097
2096
|
}
|
|
2098
2097
|
getSuffixes(e, t = {}) {
|
|
2099
2098
|
let n = this.getRule(e, t);
|
|
2100
|
-
return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((r, s) =>
|
|
2099
|
+
return n || (n = this.getRule("dev", t)), n ? n.resolvedOptions().pluralCategories.sort((r, s) => Je[r] - Je[s]).map((r) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${r}`) : [];
|
|
2101
2100
|
}
|
|
2102
2101
|
getSuffix(e, t, n = {}) {
|
|
2103
2102
|
const r = this.getRule(e, n);
|
|
2104
2103
|
return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
|
|
2105
2104
|
}
|
|
2106
2105
|
}
|
|
2107
|
-
const
|
|
2108
|
-
let s =
|
|
2106
|
+
const Ye = (i, e, t, n = ".", r = !0) => {
|
|
2107
|
+
let s = or(i, e, t);
|
|
2109
2108
|
return !s && r && x(t) && (s = Se(i, t, n), s === void 0 && (s = Se(e, t, n))), s;
|
|
2110
|
-
},
|
|
2111
|
-
class
|
|
2109
|
+
}, ye = (i) => i.replace(/\$/g, "$$$$");
|
|
2110
|
+
class xr {
|
|
2112
2111
|
constructor(e = {}) {
|
|
2113
2112
|
var t;
|
|
2114
2113
|
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);
|
|
@@ -2133,10 +2132,10 @@ class kr {
|
|
|
2133
2132
|
nestingSuffix: g,
|
|
2134
2133
|
nestingSuffixEscaped: y,
|
|
2135
2134
|
nestingOptionsSeparator: b,
|
|
2136
|
-
maxReplaces:
|
|
2137
|
-
alwaysFormat:
|
|
2135
|
+
maxReplaces: v,
|
|
2136
|
+
alwaysFormat: k
|
|
2138
2137
|
} = e.interpolation;
|
|
2139
|
-
this.escape = t !== void 0 ? t :
|
|
2138
|
+
this.escape = t !== void 0 ? t : cr, this.escapeValue = n !== void 0 ? n : !0, this.useRawValueToEscape = r !== void 0 ? r : !1, this.prefix = s ? _(s) : a || "{{", this.suffix = o ? _(o) : c || "}}", this.formatSeparator = l || ",", this.unescapePrefix = d ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : d || "", this.nestingPrefix = h ? _(h) : f || _("$t("), this.nestingSuffix = g ? _(g) : y || _(")"), this.nestingOptionsSeparator = b || ",", this.maxReplaces = v || 1e3, this.alwaysFormat = k !== void 0 ? k : !1, this.resetRegExp();
|
|
2140
2139
|
}
|
|
2141
2140
|
reset() {
|
|
2142
2141
|
this.options && this.init(this.options);
|
|
@@ -2150,15 +2149,15 @@ class kr {
|
|
|
2150
2149
|
let s, a, o;
|
|
2151
2150
|
const c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, l = (g) => {
|
|
2152
2151
|
if (g.indexOf(this.formatSeparator) < 0) {
|
|
2153
|
-
const
|
|
2154
|
-
return this.alwaysFormat ? this.format(
|
|
2152
|
+
const k = Ye(t, c, g, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
2153
|
+
return this.alwaysFormat ? this.format(k, void 0, n, {
|
|
2155
2154
|
...r,
|
|
2156
2155
|
...t,
|
|
2157
2156
|
interpolationkey: g
|
|
2158
|
-
}) :
|
|
2157
|
+
}) : k;
|
|
2159
2158
|
}
|
|
2160
|
-
const y = g.split(this.formatSeparator), b = y.shift().trim(),
|
|
2161
|
-
return this.format(
|
|
2159
|
+
const y = g.split(this.formatSeparator), b = y.shift().trim(), v = y.join(this.formatSeparator).trim();
|
|
2160
|
+
return this.format(Ye(t, c, b, this.options.keySeparator, this.options.ignoreJSONStructure), v, n, {
|
|
2162
2161
|
...r,
|
|
2163
2162
|
...t,
|
|
2164
2163
|
interpolationkey: b
|
|
@@ -2168,17 +2167,17 @@ class kr {
|
|
|
2168
2167
|
const d = (r == null ? void 0 : r.missingInterpolationHandler) || this.options.missingInterpolationHandler, u = ((f = r == null ? void 0 : r.interpolation) == null ? void 0 : f.skipOnVariables) !== void 0 ? r.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
2169
2168
|
return [{
|
|
2170
2169
|
regex: this.regexpUnescape,
|
|
2171
|
-
safeValue: (g) =>
|
|
2170
|
+
safeValue: (g) => ye(g)
|
|
2172
2171
|
}, {
|
|
2173
2172
|
regex: this.regexp,
|
|
2174
|
-
safeValue: (g) => this.escapeValue ?
|
|
2173
|
+
safeValue: (g) => this.escapeValue ? ye(this.escape(g)) : ye(g)
|
|
2175
2174
|
}].forEach((g) => {
|
|
2176
2175
|
for (o = 0; s = g.regex.exec(e); ) {
|
|
2177
2176
|
const y = s[1].trim();
|
|
2178
2177
|
if (a = l(y), a === void 0)
|
|
2179
2178
|
if (typeof d == "function") {
|
|
2180
|
-
const
|
|
2181
|
-
a = x(
|
|
2179
|
+
const v = d(e, s, r);
|
|
2180
|
+
a = x(v) ? v : "";
|
|
2182
2181
|
} else if (r && Object.prototype.hasOwnProperty.call(r, y))
|
|
2183
2182
|
a = "";
|
|
2184
2183
|
else if (u) {
|
|
@@ -2186,7 +2185,7 @@ class kr {
|
|
|
2186
2185
|
continue;
|
|
2187
2186
|
} else
|
|
2188
2187
|
this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`), a = "";
|
|
2189
|
-
else !x(a) && !this.useRawValueToEscape && (a =
|
|
2188
|
+
else !x(a) && !this.useRawValueToEscape && (a = Be(a));
|
|
2190
2189
|
const b = g.safeValue(a);
|
|
2191
2190
|
if (e = e.replace(s[0], b), u ? (g.regex.lastIndex += a.length, g.regex.lastIndex -= s[0].length) : g.regex.lastIndex = 0, o++, o >= this.maxReplaces)
|
|
2192
2191
|
break;
|
|
@@ -2220,7 +2219,7 @@ class kr {
|
|
|
2220
2219
|
}, a = a.replace && !x(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
2221
2220
|
const l = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
2222
2221
|
if (l !== -1 && (c = r[1].slice(l).split(this.formatSeparator).map((d) => d.trim()).filter(Boolean), r[1] = r[1].slice(0, l)), s = t(o.call(this, r[1].trim(), a), a), s && r[0] === e && !x(s)) return s;
|
|
2223
|
-
x(s) || (s =
|
|
2222
|
+
x(s) || (s = Be(s)), s || (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), s = ""), c.length && (s = c.reduce((d, u) => this.format(d, u, n.lng, {
|
|
2224
2223
|
...n,
|
|
2225
2224
|
interpolationkey: r[1].trim()
|
|
2226
2225
|
}), s.trim())), e = e.replace(r[0], s), this.regexp.lastIndex = 0;
|
|
@@ -2228,7 +2227,7 @@ class kr {
|
|
|
2228
2227
|
return e;
|
|
2229
2228
|
}
|
|
2230
2229
|
}
|
|
2231
|
-
const
|
|
2230
|
+
const br = (i) => {
|
|
2232
2231
|
let e = i.toLowerCase().trim();
|
|
2233
2232
|
const t = {};
|
|
2234
2233
|
if (i.indexOf("(") > -1) {
|
|
@@ -2246,7 +2245,7 @@ const Sr = (i) => {
|
|
|
2246
2245
|
formatName: e,
|
|
2247
2246
|
formatOptions: t
|
|
2248
2247
|
};
|
|
2249
|
-
},
|
|
2248
|
+
}, Xe = (i) => {
|
|
2250
2249
|
const e = {};
|
|
2251
2250
|
return (t, n, r) => {
|
|
2252
2251
|
let s = r;
|
|
@@ -2258,8 +2257,8 @@ const Sr = (i) => {
|
|
|
2258
2257
|
let o = e[a];
|
|
2259
2258
|
return o || (o = i(ie(n), r), e[a] = o), o(t);
|
|
2260
2259
|
};
|
|
2261
|
-
},
|
|
2262
|
-
class
|
|
2260
|
+
}, wr = (i) => (e, t, n) => i(ie(t), n)(e);
|
|
2261
|
+
class vr {
|
|
2263
2262
|
constructor(e = {}) {
|
|
2264
2263
|
this.logger = A.create("formatter"), this.options = e, this.init(e);
|
|
2265
2264
|
}
|
|
@@ -2267,7 +2266,7 @@ class Er {
|
|
|
2267
2266
|
interpolation: {}
|
|
2268
2267
|
}) {
|
|
2269
2268
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
2270
|
-
const n = t.cacheInBuiltFormats ?
|
|
2269
|
+
const n = t.cacheInBuiltFormats ? Xe : wr;
|
|
2271
2270
|
this.formats = {
|
|
2272
2271
|
number: n((r, s) => {
|
|
2273
2272
|
const a = new Intl.NumberFormat(r, {
|
|
@@ -2306,7 +2305,7 @@ class Er {
|
|
|
2306
2305
|
this.formats[e.toLowerCase().trim()] = t;
|
|
2307
2306
|
}
|
|
2308
2307
|
addCached(e, t) {
|
|
2309
|
-
this.formats[e.toLowerCase().trim()] =
|
|
2308
|
+
this.formats[e.toLowerCase().trim()] = Xe(t);
|
|
2310
2309
|
}
|
|
2311
2310
|
format(e, t, n, r = {}) {
|
|
2312
2311
|
const s = t.split(this.formatSeparator);
|
|
@@ -2319,7 +2318,7 @@ class Er {
|
|
|
2319
2318
|
const {
|
|
2320
2319
|
formatName: l,
|
|
2321
2320
|
formatOptions: d
|
|
2322
|
-
} =
|
|
2321
|
+
} = br(c);
|
|
2323
2322
|
if (this.formats[l]) {
|
|
2324
2323
|
let h = o;
|
|
2325
2324
|
try {
|
|
@@ -2339,10 +2338,10 @@ class Er {
|
|
|
2339
2338
|
}, e);
|
|
2340
2339
|
}
|
|
2341
2340
|
}
|
|
2342
|
-
const
|
|
2341
|
+
const Sr = (i, e) => {
|
|
2343
2342
|
i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
|
|
2344
2343
|
};
|
|
2345
|
-
class
|
|
2344
|
+
class kr extends ge {
|
|
2346
2345
|
constructor(e, t, n, r = {}) {
|
|
2347
2346
|
var s, a;
|
|
2348
2347
|
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);
|
|
@@ -2375,7 +2374,7 @@ class Pr extends pe {
|
|
|
2375
2374
|
}), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
|
|
2376
2375
|
const o = {};
|
|
2377
2376
|
this.queue.forEach((c) => {
|
|
2378
|
-
|
|
2377
|
+
ar(c.loaded, [s], a), Sr(c, e), t && c.errors.push(t), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((l) => {
|
|
2379
2378
|
o[l] || (o[l] = {});
|
|
2380
2379
|
const d = c.loaded[l];
|
|
2381
2380
|
d.length && d.forEach((u) => {
|
|
@@ -2474,7 +2473,7 @@ class Pr extends pe {
|
|
|
2474
2473
|
}
|
|
2475
2474
|
}
|
|
2476
2475
|
}
|
|
2477
|
-
const
|
|
2476
|
+
const Qe = () => ({
|
|
2478
2477
|
debug: !1,
|
|
2479
2478
|
initAsync: !0,
|
|
2480
2479
|
ns: ["translation"],
|
|
@@ -2531,20 +2530,20 @@ const tt = () => ({
|
|
|
2531
2530
|
skipOnVariables: !0
|
|
2532
2531
|
},
|
|
2533
2532
|
cacheInBuiltFormats: !0
|
|
2534
|
-
}),
|
|
2533
|
+
}), et = (i) => {
|
|
2535
2534
|
var e, t;
|
|
2536
2535
|
return x(i.ns) && (i.ns = [i.ns]), x(i.fallbackLng) && (i.fallbackLng = [i.fallbackLng]), x(i.fallbackNS) && (i.fallbackNS = [i.fallbackNS]), ((t = (e = i.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), typeof i.initImmediate == "boolean" && (i.initAsync = i.initImmediate), i;
|
|
2537
|
-
},
|
|
2538
|
-
},
|
|
2536
|
+
}, le = () => {
|
|
2537
|
+
}, Lr = (i) => {
|
|
2539
2538
|
Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
|
|
2540
2539
|
typeof i[t] == "function" && (i[t] = i[t].bind(i));
|
|
2541
2540
|
});
|
|
2542
2541
|
};
|
|
2543
|
-
class se extends
|
|
2542
|
+
class se extends ge {
|
|
2544
2543
|
constructor(e = {}, t) {
|
|
2545
|
-
if (super(), this.options =
|
|
2544
|
+
if (super(), this.options = et(e), this.services = {}, this.logger = A, this.modules = {
|
|
2546
2545
|
external: []
|
|
2547
|
-
},
|
|
2546
|
+
}, Lr(this), t && !this.isInitialized && !e.isClone) {
|
|
2548
2547
|
if (!this.options.initAsync)
|
|
2549
2548
|
return this.init(e, t), this;
|
|
2550
2549
|
setTimeout(() => {
|
|
@@ -2554,11 +2553,11 @@ class se extends pe {
|
|
|
2554
2553
|
}
|
|
2555
2554
|
init(e = {}, t) {
|
|
2556
2555
|
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 =
|
|
2556
|
+
const n = Qe();
|
|
2558
2557
|
this.options = {
|
|
2559
2558
|
...n,
|
|
2560
2559
|
...this.options,
|
|
2561
|
-
...
|
|
2560
|
+
...et(e)
|
|
2562
2561
|
}, this.options.interpolation = {
|
|
2563
2562
|
...n.interpolation,
|
|
2564
2563
|
...this.options.interpolation
|
|
@@ -2567,24 +2566,24 @@ class se extends pe {
|
|
|
2567
2566
|
if (!this.options.isClone) {
|
|
2568
2567
|
this.modules.logger ? A.init(r(this.modules.logger), this.options) : A.init(null, this.options);
|
|
2569
2568
|
let l;
|
|
2570
|
-
this.modules.formatter ? l = this.modules.formatter : l =
|
|
2571
|
-
const d = new
|
|
2572
|
-
this.store = new
|
|
2569
|
+
this.modules.formatter ? l = this.modules.formatter : l = vr;
|
|
2570
|
+
const d = new Ze(this.options);
|
|
2571
|
+
this.store = new Ue(this.options.resources, this.options);
|
|
2573
2572
|
const u = this.services;
|
|
2574
|
-
u.logger = A, u.resourceStore = this.store, u.languageUtils = d, u.pluralResolver = new
|
|
2573
|
+
u.logger = A, u.resourceStore = this.store, u.languageUtils = d, u.pluralResolver = new yr(d, {
|
|
2575
2574
|
prepend: this.options.pluralSeparator,
|
|
2576
2575
|
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 = r(l), u.formatter.init && u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new
|
|
2576
|
+
}), 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 = r(l), u.formatter.init && u.formatter.init(u, this.options), this.options.interpolation.format = u.formatter.format.bind(u.formatter)), u.interpolator = new xr(this.options), u.utils = {
|
|
2578
2577
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
2579
|
-
}, u.backendConnector = new
|
|
2578
|
+
}, u.backendConnector = new kr(r(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", (f, ...g) => {
|
|
2580
2579
|
this.emit(f, ...g);
|
|
2581
|
-
}), this.modules.languageDetector && (u.languageDetector = r(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = r(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new
|
|
2580
|
+
}), this.modules.languageDetector && (u.languageDetector = r(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = r(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new he(this.services, this.options), this.translator.on("*", (f, ...g) => {
|
|
2582
2581
|
this.emit(f, ...g);
|
|
2583
2582
|
}), this.modules.external.forEach((f) => {
|
|
2584
2583
|
f.init && f.init(this);
|
|
2585
2584
|
});
|
|
2586
2585
|
}
|
|
2587
|
-
if (this.format = this.options.interpolation.format, t || (t =
|
|
2586
|
+
if (this.format = this.options.interpolation.format, t || (t = le), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
2588
2587
|
const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
2589
2588
|
l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
|
|
2590
2589
|
}
|
|
@@ -2602,7 +2601,7 @@ class se extends pe {
|
|
|
2602
2601
|
};
|
|
2603
2602
|
return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), o;
|
|
2604
2603
|
}
|
|
2605
|
-
loadResources(e, t =
|
|
2604
|
+
loadResources(e, t = le) {
|
|
2606
2605
|
var s, a;
|
|
2607
2606
|
let n = t;
|
|
2608
2607
|
const r = x(e) ? e : this.language;
|
|
@@ -2622,14 +2621,14 @@ class se extends pe {
|
|
|
2622
2621
|
}
|
|
2623
2622
|
reloadResources(e, t, n) {
|
|
2624
2623
|
const r = te();
|
|
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 =
|
|
2624
|
+
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 = le), this.services.backendConnector.reload(e, t, (s) => {
|
|
2626
2625
|
r.resolve(), n(s);
|
|
2627
2626
|
}), r;
|
|
2628
2627
|
}
|
|
2629
2628
|
use(e) {
|
|
2630
2629
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
2631
2630
|
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" &&
|
|
2631
|
+
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" && Lt.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
2633
2632
|
}
|
|
2634
2633
|
setResolvedLanguage(e) {
|
|
2635
2634
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -2669,10 +2668,10 @@ class se extends pe {
|
|
|
2669
2668
|
}, c.lng = c.lng || r.lng, c.lngs = c.lngs || r.lngs, c.ns = c.ns || r.ns, c.keyPrefix !== "" && (c.keyPrefix = c.keyPrefix || n || r.keyPrefix);
|
|
2670
2669
|
const l = this.options.keySeparator || ".";
|
|
2671
2670
|
let d;
|
|
2672
|
-
return c.keyPrefix && Array.isArray(s) ? d = s.map((u) => (typeof u == "function" && (u =
|
|
2671
|
+
return c.keyPrefix && Array.isArray(s) ? d = s.map((u) => (typeof u == "function" && (u = Le(u, {
|
|
2673
2672
|
...this.options,
|
|
2674
2673
|
...a
|
|
2675
|
-
})), `${c.keyPrefix}${l}${u}`)) : (typeof s == "function" && (s =
|
|
2674
|
+
})), `${c.keyPrefix}${l}${u}`)) : (typeof s == "function" && (s = Le(s, {
|
|
2676
2675
|
...this.options,
|
|
2677
2676
|
...a
|
|
2678
2677
|
})), d = c.keyPrefix ? `${c.keyPrefix}${l}${s}` : s), this.t(d, c);
|
|
@@ -2734,13 +2733,13 @@ class se extends pe {
|
|
|
2734
2733
|
}
|
|
2735
2734
|
} catch {
|
|
2736
2735
|
}
|
|
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 = ((s = this.services) == null ? void 0 : s.languageUtils) || new
|
|
2736
|
+
const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], n = ((s = this.services) == null ? void 0 : s.languageUtils) || new Ze(Qe());
|
|
2738
2737
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
2739
2738
|
}
|
|
2740
2739
|
static createInstance(e = {}, t) {
|
|
2741
2740
|
return new se(e, t);
|
|
2742
2741
|
}
|
|
2743
|
-
cloneInstance(e = {}, t =
|
|
2742
|
+
cloneInstance(e = {}, t = le) {
|
|
2744
2743
|
const n = e.forkResourceStore;
|
|
2745
2744
|
n && delete e.forkResourceStore;
|
|
2746
2745
|
const r = {
|
|
@@ -2760,9 +2759,9 @@ class se extends pe {
|
|
|
2760
2759
|
}, c[l] = Object.keys(c[l]).reduce((d, u) => (d[u] = {
|
|
2761
2760
|
...c[l][u]
|
|
2762
2761
|
}, d), c[l]), c), {});
|
|
2763
|
-
s.store = new
|
|
2762
|
+
s.store = new Ue(o, r), s.services.resourceStore = s.store;
|
|
2764
2763
|
}
|
|
2765
|
-
return s.translator = new
|
|
2764
|
+
return s.translator = new he(s.services, r), s.translator.on("*", (o, ...c) => {
|
|
2766
2765
|
s.emit(o, ...c);
|
|
2767
2766
|
}), s.init(r, t), s.translator.options = r, s.translator.backendConnector.services.utils = {
|
|
2768
2767
|
hasLoadedNamespace: s.hasLoadedNamespace.bind(s)
|
|
@@ -2778,37 +2777,37 @@ class se extends pe {
|
|
|
2778
2777
|
};
|
|
2779
2778
|
}
|
|
2780
2779
|
}
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2780
|
+
const N = se.createInstance();
|
|
2781
|
+
N.createInstance = se.createInstance;
|
|
2782
|
+
N.createInstance;
|
|
2783
|
+
N.dir;
|
|
2784
|
+
N.init;
|
|
2785
|
+
N.loadResources;
|
|
2786
|
+
N.reloadResources;
|
|
2787
|
+
N.use;
|
|
2788
|
+
N.changeLanguage;
|
|
2789
|
+
N.getFixedT;
|
|
2790
|
+
N.t;
|
|
2791
|
+
N.exists;
|
|
2792
|
+
N.setDefaultNamespace;
|
|
2793
|
+
N.hasLoadedNamespace;
|
|
2794
|
+
N.loadNamespaces;
|
|
2795
|
+
N.loadLanguages;
|
|
2797
2796
|
const {
|
|
2798
|
-
slice:
|
|
2799
|
-
forEach:
|
|
2797
|
+
slice: Er,
|
|
2798
|
+
forEach: Or
|
|
2800
2799
|
} = [];
|
|
2801
|
-
function
|
|
2802
|
-
return
|
|
2800
|
+
function Pr(i) {
|
|
2801
|
+
return Or.call(Er.call(arguments, 1), (e) => {
|
|
2803
2802
|
if (e)
|
|
2804
2803
|
for (const t in e)
|
|
2805
2804
|
i[t] === void 0 && (i[t] = e[t]);
|
|
2806
2805
|
}), i;
|
|
2807
2806
|
}
|
|
2808
|
-
function
|
|
2807
|
+
function Cr(i) {
|
|
2809
2808
|
return typeof i != "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(i));
|
|
2810
2809
|
}
|
|
2811
|
-
const
|
|
2810
|
+
const tt = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Nr = function(i, e) {
|
|
2812
2811
|
const n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
2813
2812
|
path: "/"
|
|
2814
2813
|
}, r = encodeURIComponent(e);
|
|
@@ -2819,12 +2818,12 @@ const rt = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Rr = function(i, e) {
|
|
|
2819
2818
|
s += `; Max-Age=${Math.floor(a)}`;
|
|
2820
2819
|
}
|
|
2821
2820
|
if (n.domain) {
|
|
2822
|
-
if (!
|
|
2821
|
+
if (!tt.test(n.domain))
|
|
2823
2822
|
throw new TypeError("option domain is invalid");
|
|
2824
2823
|
s += `; Domain=${n.domain}`;
|
|
2825
2824
|
}
|
|
2826
2825
|
if (n.path) {
|
|
2827
|
-
if (!
|
|
2826
|
+
if (!tt.test(n.path))
|
|
2828
2827
|
throw new TypeError("option path is invalid");
|
|
2829
2828
|
s += `; Path=${n.path}`;
|
|
2830
2829
|
}
|
|
@@ -2851,13 +2850,13 @@ const rt = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Rr = function(i, e) {
|
|
|
2851
2850
|
throw new TypeError("option sameSite is invalid");
|
|
2852
2851
|
}
|
|
2853
2852
|
return n.partitioned && (s += "; Partitioned"), s;
|
|
2854
|
-
},
|
|
2853
|
+
}, nt = {
|
|
2855
2854
|
create(i, e, t, n) {
|
|
2856
2855
|
let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
2857
2856
|
path: "/",
|
|
2858
2857
|
sameSite: "strict"
|
|
2859
2858
|
};
|
|
2860
|
-
t && (r.expires = /* @__PURE__ */ new Date(), r.expires.setTime(r.expires.getTime() + t * 60 * 1e3)), n && (r.domain = n), document.cookie =
|
|
2859
|
+
t && (r.expires = /* @__PURE__ */ new Date(), r.expires.setTime(r.expires.getTime() + t * 60 * 1e3)), n && (r.domain = n), document.cookie = Nr(i, e, r);
|
|
2861
2860
|
},
|
|
2862
2861
|
read(i) {
|
|
2863
2862
|
const e = `${i}=`, t = document.cookie.split(";");
|
|
@@ -2872,7 +2871,7 @@ const rt = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Rr = function(i, e) {
|
|
|
2872
2871
|
this.create(i, "", -1, e);
|
|
2873
2872
|
}
|
|
2874
2873
|
};
|
|
2875
|
-
var
|
|
2874
|
+
var jr = {
|
|
2876
2875
|
name: "cookie",
|
|
2877
2876
|
// Deconstruct the options object and extract the lookupCookie property
|
|
2878
2877
|
lookup(i) {
|
|
@@ -2880,7 +2879,7 @@ var Fr = {
|
|
|
2880
2879
|
lookupCookie: e
|
|
2881
2880
|
} = i;
|
|
2882
2881
|
if (e && typeof document < "u")
|
|
2883
|
-
return
|
|
2882
|
+
return nt.read(e) || void 0;
|
|
2884
2883
|
},
|
|
2885
2884
|
// Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
|
|
2886
2885
|
cacheUserLanguage(i, e) {
|
|
@@ -2890,9 +2889,9 @@ var Fr = {
|
|
|
2890
2889
|
cookieDomain: r,
|
|
2891
2890
|
cookieOptions: s
|
|
2892
2891
|
} = e;
|
|
2893
|
-
t && typeof document < "u" &&
|
|
2892
|
+
t && typeof document < "u" && nt.create(t, i, n, r, s);
|
|
2894
2893
|
}
|
|
2895
|
-
},
|
|
2894
|
+
}, Tr = {
|
|
2896
2895
|
name: "querystring",
|
|
2897
2896
|
// Deconstruct the options object and extract the lookupQuerystring property
|
|
2898
2897
|
lookup(i) {
|
|
@@ -2913,7 +2912,7 @@ var Fr = {
|
|
|
2913
2912
|
}
|
|
2914
2913
|
return t;
|
|
2915
2914
|
}
|
|
2916
|
-
},
|
|
2915
|
+
}, $r = {
|
|
2917
2916
|
name: "hash",
|
|
2918
2917
|
// Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
|
|
2919
2918
|
lookup(i) {
|
|
@@ -2946,7 +2945,7 @@ var Fr = {
|
|
|
2946
2945
|
}
|
|
2947
2946
|
};
|
|
2948
2947
|
let W = null;
|
|
2949
|
-
const
|
|
2948
|
+
const rt = () => {
|
|
2950
2949
|
if (W !== null) return W;
|
|
2951
2950
|
try {
|
|
2952
2951
|
if (W = typeof window < "u" && window.localStorage !== null, !W)
|
|
@@ -2958,14 +2957,14 @@ const st = () => {
|
|
|
2958
2957
|
}
|
|
2959
2958
|
return W;
|
|
2960
2959
|
};
|
|
2961
|
-
var
|
|
2960
|
+
var Rr = {
|
|
2962
2961
|
name: "localStorage",
|
|
2963
2962
|
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
2964
2963
|
lookup(i) {
|
|
2965
2964
|
let {
|
|
2966
2965
|
lookupLocalStorage: e
|
|
2967
2966
|
} = i;
|
|
2968
|
-
if (e &&
|
|
2967
|
+
if (e && rt())
|
|
2969
2968
|
return window.localStorage.getItem(e) || void 0;
|
|
2970
2969
|
},
|
|
2971
2970
|
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
@@ -2973,11 +2972,11 @@ var Ar = {
|
|
|
2973
2972
|
let {
|
|
2974
2973
|
lookupLocalStorage: t
|
|
2975
2974
|
} = e;
|
|
2976
|
-
t &&
|
|
2975
|
+
t && rt() && window.localStorage.setItem(t, i);
|
|
2977
2976
|
}
|
|
2978
2977
|
};
|
|
2979
2978
|
let Z = null;
|
|
2980
|
-
const
|
|
2979
|
+
const it = () => {
|
|
2981
2980
|
if (Z !== null) return Z;
|
|
2982
2981
|
try {
|
|
2983
2982
|
if (Z = typeof window < "u" && window.sessionStorage !== null, !Z)
|
|
@@ -2989,22 +2988,22 @@ const at = () => {
|
|
|
2989
2988
|
}
|
|
2990
2989
|
return Z;
|
|
2991
2990
|
};
|
|
2992
|
-
var
|
|
2991
|
+
var Fr = {
|
|
2993
2992
|
name: "sessionStorage",
|
|
2994
2993
|
lookup(i) {
|
|
2995
2994
|
let {
|
|
2996
2995
|
lookupSessionStorage: e
|
|
2997
2996
|
} = i;
|
|
2998
|
-
if (e &&
|
|
2997
|
+
if (e && it())
|
|
2999
2998
|
return window.sessionStorage.getItem(e) || void 0;
|
|
3000
2999
|
},
|
|
3001
3000
|
cacheUserLanguage(i, e) {
|
|
3002
3001
|
let {
|
|
3003
3002
|
lookupSessionStorage: t
|
|
3004
3003
|
} = e;
|
|
3005
|
-
t &&
|
|
3004
|
+
t && it() && window.sessionStorage.setItem(t, i);
|
|
3006
3005
|
}
|
|
3007
|
-
},
|
|
3006
|
+
}, Mr = {
|
|
3008
3007
|
name: "navigator",
|
|
3009
3008
|
lookup(i) {
|
|
3010
3009
|
const e = [];
|
|
@@ -3021,7 +3020,7 @@ var Vr = {
|
|
|
3021
3020
|
}
|
|
3022
3021
|
return e.length > 0 ? e : void 0;
|
|
3023
3022
|
}
|
|
3024
|
-
},
|
|
3023
|
+
}, Dr = {
|
|
3025
3024
|
name: "htmlTag",
|
|
3026
3025
|
// Deconstruct the options object and extract the htmlTag property
|
|
3027
3026
|
lookup(i) {
|
|
@@ -3031,7 +3030,7 @@ var Vr = {
|
|
|
3031
3030
|
const n = e || (typeof document < "u" ? document.documentElement : null);
|
|
3032
3031
|
return n && typeof n.getAttribute == "function" && (t = n.getAttribute("lang")), t;
|
|
3033
3032
|
}
|
|
3034
|
-
},
|
|
3033
|
+
}, Ar = {
|
|
3035
3034
|
name: "path",
|
|
3036
3035
|
// Deconstruct the options object and extract the lookupFromPathIndex property
|
|
3037
3036
|
lookup(i) {
|
|
@@ -3043,7 +3042,7 @@ var Vr = {
|
|
|
3043
3042
|
const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
3044
3043
|
return Array.isArray(t) ? (r = t[typeof e == "number" ? e : 0]) == null ? void 0 : r.replace("/", "") : void 0;
|
|
3045
3044
|
}
|
|
3046
|
-
},
|
|
3045
|
+
}, Vr = {
|
|
3047
3046
|
name: "subdomain",
|
|
3048
3047
|
lookup(i) {
|
|
3049
3048
|
var r, s;
|
|
@@ -3055,15 +3054,15 @@ var Vr = {
|
|
|
3055
3054
|
return n[t];
|
|
3056
3055
|
}
|
|
3057
3056
|
};
|
|
3058
|
-
let
|
|
3057
|
+
let Ot = !1;
|
|
3059
3058
|
try {
|
|
3060
|
-
document.cookie,
|
|
3059
|
+
document.cookie, Ot = !0;
|
|
3061
3060
|
} catch {
|
|
3062
3061
|
}
|
|
3063
|
-
const
|
|
3064
|
-
|
|
3065
|
-
const
|
|
3066
|
-
order:
|
|
3062
|
+
const Pt = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
|
|
3063
|
+
Ot || Pt.splice(1, 1);
|
|
3064
|
+
const Ir = () => ({
|
|
3065
|
+
order: Pt,
|
|
3067
3066
|
lookupQuerystring: "lng",
|
|
3068
3067
|
lookupCookie: "i18next",
|
|
3069
3068
|
lookupLocalStorage: "i18nextLng",
|
|
@@ -3075,7 +3074,7 @@ const zr = () => ({
|
|
|
3075
3074
|
// cookieDomain: 'myDomain'
|
|
3076
3075
|
convertDetectedLanguage: (i) => i
|
|
3077
3076
|
});
|
|
3078
|
-
class
|
|
3077
|
+
class Ct {
|
|
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 = Pr(t, this.options || {}, Ir()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (r) => r.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(jr), this.addDetector(Tr), this.addDetector(Rr), this.addDetector(Fr), this.addDetector(Mr), this.addDetector(Dr), this.addDetector(Ar), this.addDetector(Vr), this.addDetector($r);
|
|
3088
3087
|
}
|
|
3089
3088
|
addDetector(e) {
|
|
3090
3089
|
return this.detectors[e.name] = e, this;
|
|
@@ -3096,7 +3095,7 @@ class jt {
|
|
|
3096
3095
|
let r = this.detectors[n].lookup(this.options);
|
|
3097
3096
|
r && typeof r == "string" && (r = [r]), r && (t = t.concat(r));
|
|
3098
3097
|
}
|
|
3099
|
-
}), t = t.filter((n) => n != null && !
|
|
3098
|
+
}), t = t.filter((n) => n != null && !Cr(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,19 @@ class jt {
|
|
|
3105
3104
|
}));
|
|
3106
3105
|
}
|
|
3107
3106
|
}
|
|
3108
|
-
|
|
3109
|
-
const
|
|
3107
|
+
Ct.type = "languageDetector";
|
|
3108
|
+
const Nt = {
|
|
3110
3109
|
apiBaseUrl: "https://api.nemme.io",
|
|
3111
3110
|
debug: !1
|
|
3112
|
-
},
|
|
3113
|
-
Previous:
|
|
3114
|
-
Next:
|
|
3111
|
+
}, Hr = "Previous", Br = "Next", zr = {
|
|
3112
|
+
Previous: Hr,
|
|
3113
|
+
Next: Br,
|
|
3115
3114
|
"Type your answer here": "Type your answer here",
|
|
3116
3115
|
"Max {{maxCharacters}} characters": "Max {{maxCharacters}} characters"
|
|
3117
|
-
},
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
debug:
|
|
3116
|
+
}, Kr = {};
|
|
3117
|
+
Xn({ locale: rr });
|
|
3118
|
+
N.use(Ct).use(Jt).init({
|
|
3119
|
+
debug: Nt.debug,
|
|
3121
3120
|
fallbackLng: "en",
|
|
3122
3121
|
interpolation: {
|
|
3123
3122
|
escapeValue: !1
|
|
@@ -3125,28 +3124,28 @@ C.use(jt).use(Qt).init({
|
|
|
3125
3124
|
},
|
|
3126
3125
|
resources: {
|
|
3127
3126
|
en: {
|
|
3128
|
-
translation:
|
|
3127
|
+
translation: zr
|
|
3129
3128
|
},
|
|
3130
3129
|
nb: {
|
|
3131
|
-
tranlation:
|
|
3130
|
+
tranlation: Kr
|
|
3132
3131
|
}
|
|
3133
3132
|
}
|
|
3134
3133
|
});
|
|
3135
|
-
const
|
|
3134
|
+
const st = {
|
|
3136
3135
|
debug: 0,
|
|
3137
3136
|
info: 1,
|
|
3138
3137
|
warn: 2,
|
|
3139
3138
|
error: 3
|
|
3140
3139
|
};
|
|
3141
|
-
class
|
|
3140
|
+
class Pe {
|
|
3142
3141
|
constructor(e = {}) {
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3142
|
+
w(this, "prefix");
|
|
3143
|
+
w(this, "enabled");
|
|
3144
|
+
w(this, "level");
|
|
3146
3145
|
this.prefix = e.prefix || "Nemme SDK", this.enabled = e.enabled !== void 0 ? e.enabled : !0, this.level = e.level || "info";
|
|
3147
3146
|
}
|
|
3148
3147
|
shouldLog(e) {
|
|
3149
|
-
return this.enabled &&
|
|
3148
|
+
return this.enabled && st[e] >= st[this.level];
|
|
3150
3149
|
}
|
|
3151
3150
|
formatMessage(e) {
|
|
3152
3151
|
return `[${this.prefix}] ${e}`;
|
|
@@ -3165,7 +3164,7 @@ class Ne {
|
|
|
3165
3164
|
}
|
|
3166
3165
|
// Create a child logger with a new prefix
|
|
3167
3166
|
child(e) {
|
|
3168
|
-
return new
|
|
3167
|
+
return new Pe({
|
|
3169
3168
|
prefix: `${this.prefix}:${e}`,
|
|
3170
3169
|
enabled: this.enabled,
|
|
3171
3170
|
level: this.level
|
|
@@ -3176,8 +3175,8 @@ class Ne {
|
|
|
3176
3175
|
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
3176
|
}
|
|
3178
3177
|
}
|
|
3179
|
-
const
|
|
3180
|
-
const t = new URL(i,
|
|
3178
|
+
const jt = new Pe(), at = jt.child("network"), qr = 3e4, Ur = (i, e) => {
|
|
3179
|
+
const t = new URL(i, Nt.apiBaseUrl);
|
|
3181
3180
|
return e && Object.entries(e).forEach(([n, r]) => {
|
|
3182
3181
|
r != null && t.searchParams.append(n, String(r));
|
|
3183
3182
|
}), t.toString();
|
|
@@ -3186,7 +3185,7 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3186
3185
|
* Make an HTTP request
|
|
3187
3186
|
*/
|
|
3188
3187
|
async request(i, e = {}) {
|
|
3189
|
-
const { method: t = "GET", headers: n = {}, body: r, params: s, timeout: a =
|
|
3188
|
+
const { method: t = "GET", headers: n = {}, body: r, params: s, timeout: a = qr } = e, o = Ur(i, s), c = {
|
|
3190
3189
|
"Content-Type": "application/json",
|
|
3191
3190
|
Accept: "application/json",
|
|
3192
3191
|
...n
|
|
@@ -3221,7 +3220,7 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3221
3220
|
y.ok = !0;
|
|
3222
3221
|
else {
|
|
3223
3222
|
const b = `Request failed with status ${h.status}: ${h.statusText}`;
|
|
3224
|
-
|
|
3223
|
+
at.error(b, {
|
|
3225
3224
|
url: o,
|
|
3226
3225
|
method: t,
|
|
3227
3226
|
status: h.status,
|
|
@@ -3238,7 +3237,7 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3238
3237
|
message: h instanceof Error ? h.message : String(h),
|
|
3239
3238
|
url: o,
|
|
3240
3239
|
method: t
|
|
3241
|
-
},
|
|
3240
|
+
}, at.error(f, g), {
|
|
3242
3241
|
data: {},
|
|
3243
3242
|
status: 0,
|
|
3244
3243
|
statusText: f,
|
|
@@ -3272,11 +3271,12 @@ const Tt = new Ne(), lt = Tt.child("network"), Zr = 3e4, Jr = (i, e) => {
|
|
|
3272
3271
|
return this.request(i, { ...e, method: "DELETE" });
|
|
3273
3272
|
}
|
|
3274
3273
|
};
|
|
3275
|
-
class
|
|
3276
|
-
constructor(e, t) {
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
this
|
|
3274
|
+
class _r {
|
|
3275
|
+
constructor(e, t, n = {}) {
|
|
3276
|
+
w(this, "logger");
|
|
3277
|
+
w(this, "headers");
|
|
3278
|
+
w(this, "config");
|
|
3279
|
+
this.logger = e, this.headers = t, this.config = n;
|
|
3280
3280
|
}
|
|
3281
3281
|
async fetchAndDisplayForm(e, t, n) {
|
|
3282
3282
|
this.logger.debug(`Fetching form config for: ${e}`);
|
|
@@ -3292,17 +3292,18 @@ class Gr {
|
|
|
3292
3292
|
displayForm(e, t, n) {
|
|
3293
3293
|
const r = document.createElement("div");
|
|
3294
3294
|
r.id = "nm", document.body.appendChild(r);
|
|
3295
|
-
const s =
|
|
3296
|
-
|
|
3297
|
-
{ i18n:
|
|
3298
|
-
|
|
3295
|
+
const s = At(r), a = xe(
|
|
3296
|
+
Qt,
|
|
3297
|
+
{ i18n: N },
|
|
3298
|
+
xe(rn, {
|
|
3299
3299
|
form: e,
|
|
3300
3300
|
onDismiss: async (o) => {
|
|
3301
|
-
await t(),
|
|
3301
|
+
await t(), s.unmount(), r.remove(), this.logger.info("Form dismissed", o);
|
|
3302
3302
|
},
|
|
3303
3303
|
onComplete: async (o) => {
|
|
3304
3304
|
await n(), await this.postFormResponse(e, o), s.unmount(), r.remove(), this.logger.info("Form completed", o);
|
|
3305
|
-
}
|
|
3305
|
+
},
|
|
3306
|
+
zIndex: this.config.zIndex
|
|
3306
3307
|
})
|
|
3307
3308
|
);
|
|
3308
3309
|
s.render(a);
|
|
@@ -3315,13 +3316,13 @@ class Gr {
|
|
|
3315
3316
|
this.logger.info("Form response posted", n.data);
|
|
3316
3317
|
}
|
|
3317
3318
|
}
|
|
3318
|
-
class
|
|
3319
|
-
constructor(e, t) {
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
this.logger = e, this.headers = t, this.formManager = new
|
|
3319
|
+
class Wr {
|
|
3320
|
+
constructor(e, t, n) {
|
|
3321
|
+
w(this, "logger");
|
|
3322
|
+
w(this, "headers");
|
|
3323
|
+
w(this, "formManager");
|
|
3324
|
+
w(this, "deliveries", []);
|
|
3325
|
+
this.logger = e, this.headers = t, this.formManager = new _r(e, t, n);
|
|
3325
3326
|
}
|
|
3326
3327
|
async loadDeliveries() {
|
|
3327
3328
|
try {
|
|
@@ -3351,7 +3352,7 @@ class Yr {
|
|
|
3351
3352
|
case "page_url":
|
|
3352
3353
|
return e.urlPattern ? this.matchesUrlPattern(t.url, e.urlPattern) : !0;
|
|
3353
3354
|
case "custom_event":
|
|
3354
|
-
return e.
|
|
3355
|
+
return e.eventKey ? t.eventKey === e.eventKey : !1;
|
|
3355
3356
|
default:
|
|
3356
3357
|
return !1;
|
|
3357
3358
|
}
|
|
@@ -3364,7 +3365,7 @@ class Yr {
|
|
|
3364
3365
|
this.logger.debug(`Triggering form delivery: ${e.productSlug}`, {
|
|
3365
3366
|
triggerType: t.triggerType,
|
|
3366
3367
|
urlPattern: t.urlPattern,
|
|
3367
|
-
|
|
3368
|
+
eventKey: t.eventKey
|
|
3368
3369
|
});
|
|
3369
3370
|
try {
|
|
3370
3371
|
const r = await this.createDeliveryResponse(e);
|
|
@@ -3389,14 +3390,20 @@ class Yr {
|
|
|
3389
3390
|
} catch {
|
|
3390
3391
|
n = e.startsWith("/") ? e : `/${e}`;
|
|
3391
3392
|
}
|
|
3392
|
-
const r =
|
|
3393
|
+
const r = (d) => {
|
|
3394
|
+
if (!d) return "/";
|
|
3395
|
+
let u = d.startsWith("/") ? d : `/${d}`;
|
|
3396
|
+
return u.length > 1 && u.endsWith("/") && (u = u.slice(0, -1)), u;
|
|
3397
|
+
}, s = r(n), a = r(t), o = a.replace(/\*\*/g, "§DOUBLE_STAR§").replace(/\*/g, "[^/]*").replace(/§DOUBLE_STAR§/g, ".*").replace(/\?/g, "."), l = new RegExp(`^${o}$`).test(s);
|
|
3393
3398
|
return this.logger.debug("URL pattern matching", {
|
|
3394
3399
|
originalUrl: e,
|
|
3395
3400
|
pathname: n,
|
|
3401
|
+
normalizedPathname: s,
|
|
3396
3402
|
pattern: t,
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3403
|
+
normalizedPattern: a,
|
|
3404
|
+
regexPattern: o,
|
|
3405
|
+
matches: l
|
|
3406
|
+
}), l;
|
|
3400
3407
|
}
|
|
3401
3408
|
async createDeliveryResponse(e) {
|
|
3402
3409
|
try {
|
|
@@ -3430,17 +3437,18 @@ class Yr {
|
|
|
3430
3437
|
}
|
|
3431
3438
|
}
|
|
3432
3439
|
}
|
|
3433
|
-
class
|
|
3434
|
-
constructor({ logger: e, headers: t, sessionId: n, eventDefinitions: r, batchConfig: s, onPageView: a }) {
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
+
class Zr {
|
|
3441
|
+
constructor({ logger: e, headers: t, sessionId: n, eventDefinitions: r, batchConfig: s, onPageView: a, onEvent: o }) {
|
|
3442
|
+
w(this, "logger");
|
|
3443
|
+
w(this, "headers");
|
|
3444
|
+
w(this, "sessionId");
|
|
3445
|
+
w(this, "eventDefinitions", []);
|
|
3446
|
+
w(this, "onPageView");
|
|
3447
|
+
w(this, "onEvent");
|
|
3440
3448
|
// Batching
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3449
|
+
w(this, "backlog", []);
|
|
3450
|
+
w(this, "flushTimeout", null);
|
|
3451
|
+
w(this, "batchConfig", {
|
|
3444
3452
|
enabled: !0,
|
|
3445
3453
|
size: 10,
|
|
3446
3454
|
delayMs: 1e4,
|
|
@@ -3448,9 +3456,9 @@ class Xr {
|
|
|
3448
3456
|
sendOnUnload: !0
|
|
3449
3457
|
});
|
|
3450
3458
|
// Page view tracking
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
this.logger = e, this.headers = t, this.sessionId = n, this.eventDefinitions = r, this.onPageView = a, this.flushEvents = this.flushEvents.bind(this), this.handlePopState = this.handlePopState.bind(this), this.handleVisibilityChange = this.handleVisibilityChange.bind(this), this.setupBatching(s);
|
|
3459
|
+
w(this, "originalHistoryMethods", null);
|
|
3460
|
+
w(this, "EVENT_PAGE_VIEW", "page_view");
|
|
3461
|
+
this.logger = e, this.headers = t, this.sessionId = n, this.eventDefinitions = r, 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
3462
|
}
|
|
3455
3463
|
setupBatching(e) {
|
|
3456
3464
|
typeof e == "boolean" ? this.batchConfig.enabled = e : e && (this.batchConfig = {
|
|
@@ -3474,29 +3482,29 @@ class Xr {
|
|
|
3474
3482
|
}, window.addEventListener("popstate", this.handlePopState), document.addEventListener("visibilitychange", this.handleVisibilityChange);
|
|
3475
3483
|
}
|
|
3476
3484
|
async track(e) {
|
|
3485
|
+
var a, o;
|
|
3477
3486
|
if (!this.sessionId) {
|
|
3478
3487
|
this.logger.warn("Tracking manager not initialized, cannot track event");
|
|
3479
3488
|
return;
|
|
3480
3489
|
}
|
|
3481
3490
|
const { eventKey: t, data: n = {} } = e;
|
|
3482
3491
|
this.logger.debug("Tracking event", { eventKey: t, data: n });
|
|
3483
|
-
const r = {
|
|
3492
|
+
const r = window.location.href, s = {
|
|
3484
3493
|
sessionId: this.sessionId,
|
|
3485
3494
|
eventKey: t,
|
|
3486
3495
|
data: n || {},
|
|
3487
3496
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3488
|
-
page:
|
|
3497
|
+
page: r
|
|
3489
3498
|
};
|
|
3490
|
-
this.validateEvent(
|
|
3499
|
+
this.validateEvent(s), this.batchConfig.enabled ? (this.backlog.push(s), this.scheduleFlush()) : await this.sendEvents([s]), t === this.EVENT_PAGE_VIEW ? (a = this.onPageView) == null || a.call(this, window.location.href) : (o = this.onEvent) == null || o.call(this, s, r);
|
|
3491
3500
|
}
|
|
3492
3501
|
async trackPageView() {
|
|
3493
|
-
|
|
3494
|
-
typeof window > "u" || (await this.track({
|
|
3502
|
+
typeof window > "u" || await this.track({
|
|
3495
3503
|
eventKey: this.EVENT_PAGE_VIEW,
|
|
3496
3504
|
data: {
|
|
3497
3505
|
title: document.title
|
|
3498
3506
|
}
|
|
3499
|
-
})
|
|
3507
|
+
});
|
|
3500
3508
|
}
|
|
3501
3509
|
/**
|
|
3502
3510
|
* Manually flush any pending events
|
|
@@ -3570,19 +3578,20 @@ class Xr {
|
|
|
3570
3578
|
}
|
|
3571
3579
|
class Ce {
|
|
3572
3580
|
constructor(e) {
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3581
|
+
w(this, "clientKey");
|
|
3582
|
+
w(this, "userIdentifier");
|
|
3583
|
+
w(this, "initialized", !1);
|
|
3584
|
+
w(this, "clientLogger", jt.child("client"));
|
|
3585
|
+
w(this, "headers", {});
|
|
3586
|
+
w(this, "formConfig");
|
|
3578
3587
|
// Module managers
|
|
3579
|
-
|
|
3588
|
+
w(this, "trackingManager");
|
|
3580
3589
|
this.clientKey = e;
|
|
3581
3590
|
}
|
|
3582
3591
|
/**
|
|
3583
3592
|
* Create a new Nemme SDK client instance
|
|
3584
3593
|
*/
|
|
3585
|
-
async init({ userIdentifier: e, debug: t = !1, batch: n }) {
|
|
3594
|
+
async init({ userIdentifier: e, debug: t = !1, batch: n, formConfig: r }) {
|
|
3586
3595
|
if (!e) throw new Error("userIdentifier is required parameter");
|
|
3587
3596
|
this.userIdentifier = e, this.clientLogger.configure({
|
|
3588
3597
|
enabled: t,
|
|
@@ -3590,15 +3599,15 @@ class Ce {
|
|
|
3590
3599
|
}), this.headers = {
|
|
3591
3600
|
"X-Client-Key": this.clientKey,
|
|
3592
3601
|
"X-User-Id": this.userIdentifier
|
|
3593
|
-
};
|
|
3602
|
+
}, this.formConfig = r;
|
|
3594
3603
|
try {
|
|
3595
|
-
const
|
|
3596
|
-
await this.initializeManagers(
|
|
3604
|
+
const s = await this.initializeSession();
|
|
3605
|
+
await this.initializeManagers(s, n), this.initialized = !0, this.clientLogger.info("Nemme client initialized", {
|
|
3597
3606
|
clientKey: this.clientKey,
|
|
3598
3607
|
userIdentifier: this.userIdentifier
|
|
3599
3608
|
});
|
|
3600
|
-
} catch (
|
|
3601
|
-
this.clientLogger.error("Error during initialization:",
|
|
3609
|
+
} catch (s) {
|
|
3610
|
+
this.clientLogger.error("Error during initialization:", s);
|
|
3602
3611
|
}
|
|
3603
3612
|
return this;
|
|
3604
3613
|
}
|
|
@@ -3633,7 +3642,7 @@ class Ce {
|
|
|
3633
3642
|
}
|
|
3634
3643
|
}
|
|
3635
3644
|
async initializeManagers(e, t) {
|
|
3636
|
-
const n = new
|
|
3645
|
+
const n = new Wr(this.clientLogger, this.headers, this.formConfig), r = new Zr({
|
|
3637
3646
|
logger: this.clientLogger,
|
|
3638
3647
|
headers: this.headers,
|
|
3639
3648
|
sessionId: e.sessionId,
|
|
@@ -3641,18 +3650,17 @@ class Ce {
|
|
|
3641
3650
|
batchConfig: t,
|
|
3642
3651
|
onPageView: async (s) => {
|
|
3643
3652
|
await n.evaluateDeliveryTriggers({ url: s });
|
|
3653
|
+
},
|
|
3654
|
+
onEvent: async (s, a) => {
|
|
3655
|
+
await n.evaluateDeliveryTriggers({ eventKey: s.eventKey, eventData: s.data, url: a });
|
|
3644
3656
|
}
|
|
3645
3657
|
});
|
|
3646
3658
|
await n.loadDeliveries(), typeof window < "u" && (await r.setupPageViewTracking(), await r.trackPageView(), await r.flush()), this.trackingManager = r;
|
|
3647
3659
|
}
|
|
3648
3660
|
}
|
|
3649
|
-
const
|
|
3650
|
-
clientKey: i,
|
|
3651
|
-
config: e,
|
|
3652
|
-
children: t
|
|
3653
|
-
}) => {
|
|
3661
|
+
const Tt = (i) => new Ce(i), $t = Ee(void 0), ni = ({ clientKey: i, config: e, children: t }) => {
|
|
3654
3662
|
const [n, r] = ne(null), [s, a] = ne(!1), [o, c] = ne(null);
|
|
3655
|
-
|
|
3663
|
+
de(() => {
|
|
3656
3664
|
let d = null, u = !1;
|
|
3657
3665
|
const h = async () => {
|
|
3658
3666
|
try {
|
|
@@ -3675,20 +3683,23 @@ const Rt = (i) => new Ce(i), Ft = Oe(void 0), ai = ({
|
|
|
3675
3683
|
isInitialized: s,
|
|
3676
3684
|
error: o
|
|
3677
3685
|
};
|
|
3678
|
-
return /* @__PURE__ */ m.jsx(
|
|
3679
|
-
},
|
|
3680
|
-
const i =
|
|
3686
|
+
return /* @__PURE__ */ m.jsx($t.Provider, { value: l, children: t });
|
|
3687
|
+
}, Jr = () => {
|
|
3688
|
+
const i = lt($t);
|
|
3681
3689
|
if (i === void 0)
|
|
3682
3690
|
throw new Error("useNemmeContext must be used within a NemmeProvider");
|
|
3683
3691
|
return i;
|
|
3684
|
-
},
|
|
3685
|
-
const { client: i, isInitialized: e, error: t } =
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
+
}, ri = () => {
|
|
3693
|
+
const { client: i, isInitialized: e, error: t } = Jr(), n = q(
|
|
3694
|
+
async (s) => {
|
|
3695
|
+
if (!i || !e) {
|
|
3696
|
+
console.warn("Nemme client not initialized");
|
|
3697
|
+
return;
|
|
3698
|
+
}
|
|
3699
|
+
return i.track(s);
|
|
3700
|
+
},
|
|
3701
|
+
[i, e]
|
|
3702
|
+
), r = q(async () => {
|
|
3692
3703
|
if (!i || !e) {
|
|
3693
3704
|
console.warn("Nemme client not initialized");
|
|
3694
3705
|
return;
|
|
@@ -3702,20 +3713,20 @@ const Rt = (i) => new Ce(i), Ft = Oe(void 0), ai = ({
|
|
|
3702
3713
|
error: t,
|
|
3703
3714
|
client: i
|
|
3704
3715
|
};
|
|
3705
|
-
},
|
|
3716
|
+
}, Gr = (i) => Tt(i), Yr = async (i) => {
|
|
3706
3717
|
const { clientKey: e, ...t } = i;
|
|
3707
|
-
return await
|
|
3708
|
-
},
|
|
3718
|
+
return await Tt(e).init(t);
|
|
3719
|
+
}, Xr = Object.assign((i) => Gr(i), {
|
|
3709
3720
|
NemmeClient: Ce,
|
|
3710
|
-
init:
|
|
3721
|
+
init: Yr
|
|
3711
3722
|
});
|
|
3712
|
-
typeof window < "u" && (window.NemmeSDK =
|
|
3723
|
+
typeof window < "u" && (window.NemmeSDK = Xr);
|
|
3713
3724
|
export {
|
|
3714
3725
|
Ce as NemmeClient,
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3726
|
+
ni as NemmeProvider,
|
|
3727
|
+
Xr as NemmeSDK,
|
|
3728
|
+
Xr as default,
|
|
3729
|
+
ri as useNemme,
|
|
3730
|
+
Jr as useNemmeContext
|
|
3720
3731
|
};
|
|
3721
3732
|
//# sourceMappingURL=index.esm.js.map
|