@nemme/js-sdk 0.2.3 → 0.3.0

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