@nemme/js-sdk 0.2.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.
Files changed (38) hide show
  1. package/README.md +8 -0
  2. package/dist/assets/js-sdk.css +1 -0
  3. package/dist/browser.d.ts +14 -0
  4. package/dist/client.d.ts +31 -0
  5. package/dist/config.d.ts +4 -0
  6. package/dist/deliveries/delivery-manager.d.ts +52 -0
  7. package/dist/forms/form-manager.d.ts +19 -0
  8. package/dist/forms/form-wrapper/form-wrapper.d.ts +13 -0
  9. package/dist/forms/form-wrapper/step.d.ts +13 -0
  10. package/dist/forms/form.d.ts +2 -0
  11. package/dist/forms/index.d.ts +5 -0
  12. package/dist/forms/question-choice/question-choice.d.ts +20 -0
  13. package/dist/forms/question-text/question-text.d.ts +15 -0
  14. package/dist/forms/question-wrapper.d.ts +14 -0
  15. package/dist/forms/transition-end/transition-end.d.ts +11 -0
  16. package/dist/forms/transition-start/transition-start.d.ts +12 -0
  17. package/dist/forms/transition-wrapper.d.ts +12 -0
  18. package/dist/i18n.d.ts +2 -0
  19. package/dist/index.cjs +68 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.esm.js +4904 -0
  23. package/dist/index.esm.js.map +1 -0
  24. package/dist/nemme-sdk.umd.js +68 -0
  25. package/dist/nemme-sdk.umd.js.map +1 -0
  26. package/dist/networking/httpClient.d.ts +36 -0
  27. package/dist/networking/index.d.ts +2 -0
  28. package/dist/react/NemmeProvider.d.ts +9 -0
  29. package/dist/react/context.d.ts +7 -0
  30. package/dist/react/index.d.ts +3 -0
  31. package/dist/react/useNemme.d.ts +8 -0
  32. package/dist/react/useNemmeContext.d.ts +1 -0
  33. package/dist/tracking/tracking-manager.d.ts +62 -0
  34. package/dist/translations/en.json.d.ts +9 -0
  35. package/dist/translations/nb.json.d.ts +4 -0
  36. package/dist/utils/index.d.ts +2 -0
  37. package/dist/utils/logger.d.ts +26 -0
  38. package/package.json +88 -0
@@ -0,0 +1,4904 @@
1
+ var Gr = Object.defineProperty;
2
+ var Qr = (a, e, t) => e in a ? Gr(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
+ var I = (a, e, t) => Qr(a, typeof e != "symbol" ? e + "" : e, t);
4
+ import * as b from "react";
5
+ import yt, { createContext as Jt, useContext as Rr, useCallback as Ee, useState as Ye, useRef as Lr, useEffect as pt, useMemo as en, createElement as Ut } from "react";
6
+ import tn from "react-dom";
7
+ var Ce = {}, Xt;
8
+ function rn() {
9
+ if (Xt) return Ce;
10
+ Xt = 1;
11
+ var a = tn;
12
+ if (process.env.NODE_ENV === "production")
13
+ Ce.createRoot = a.createRoot, Ce.hydrateRoot = a.hydrateRoot;
14
+ else {
15
+ var e = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
16
+ Ce.createRoot = function(t, r) {
17
+ e.usingClientEntryPoint = !0;
18
+ try {
19
+ return a.createRoot(t, r);
20
+ } finally {
21
+ e.usingClientEntryPoint = !1;
22
+ }
23
+ }, Ce.hydrateRoot = function(t, r, n) {
24
+ e.usingClientEntryPoint = !0;
25
+ try {
26
+ return a.hydrateRoot(t, r, n);
27
+ } finally {
28
+ e.usingClientEntryPoint = !1;
29
+ }
30
+ };
31
+ }
32
+ return Ce;
33
+ }
34
+ var nn = rn();
35
+ const an = (a, e, t, r) => {
36
+ var i, o, l, c;
37
+ const n = [t, {
38
+ code: e,
39
+ ...r || {}
40
+ }];
41
+ if ((o = (i = a == null ? void 0 : a.services) == null ? void 0 : i.logger) != null && o.forward)
42
+ return a.services.logger.forward(n, "warn", "react-i18next::", !0);
43
+ Oe(n[0]) && (n[0] = `react-i18next:: ${n[0]}`), (c = (l = a == null ? void 0 : a.services) == null ? void 0 : l.logger) != null && c.warn ? a.services.logger.warn(...n) : console != null && console.warn && console.warn(...n);
44
+ }, Gt = {}, Bt = (a, e, t, r) => {
45
+ Oe(t) && Gt[t] || (Oe(t) && (Gt[t] = /* @__PURE__ */ new Date()), an(a, e, t, r));
46
+ }, jr = (a, e) => () => {
47
+ if (a.isInitialized)
48
+ e();
49
+ else {
50
+ const t = () => {
51
+ setTimeout(() => {
52
+ a.off("initialized", t);
53
+ }, 0), e();
54
+ };
55
+ a.on("initialized", t);
56
+ }
57
+ }, Wt = (a, e, t) => {
58
+ a.loadNamespaces(e, jr(a, t));
59
+ }, Qt = (a, e, t, r) => {
60
+ if (Oe(t) && (t = [t]), a.options.preload && a.options.preload.indexOf(e) > -1) return Wt(a, t, r);
61
+ t.forEach((n) => {
62
+ a.options.ns.indexOf(n) < 0 && a.options.ns.push(n);
63
+ }), a.loadLanguages(e, jr(a, r));
64
+ }, sn = (a, e, t = {}) => !e.languages || !e.languages.length ? (Bt(e, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
65
+ languages: e.languages
66
+ }), !0) : e.hasLoadedNamespace(a, {
67
+ lng: t.lng,
68
+ precheck: (r, n) => {
69
+ var i;
70
+ if (((i = t.bindI18n) == null ? void 0 : i.indexOf("languageChanging")) > -1 && r.services.backendConnector.backend && r.isLanguageChangingTo && !n(r.isLanguageChangingTo, a)) return !1;
71
+ }
72
+ }), Oe = (a) => typeof a == "string", on = (a) => typeof a == "object" && a !== null, ln = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, un = {
73
+ "&amp;": "&",
74
+ "&#38;": "&",
75
+ "&lt;": "<",
76
+ "&#60;": "<",
77
+ "&gt;": ">",
78
+ "&#62;": ">",
79
+ "&apos;": "'",
80
+ "&#39;": "'",
81
+ "&quot;": '"',
82
+ "&#34;": '"',
83
+ "&nbsp;": " ",
84
+ "&#160;": " ",
85
+ "&copy;": "©",
86
+ "&#169;": "©",
87
+ "&reg;": "®",
88
+ "&#174;": "®",
89
+ "&hellip;": "…",
90
+ "&#8230;": "…",
91
+ "&#x2F;": "/",
92
+ "&#47;": "/"
93
+ }, cn = (a) => un[a], dn = (a) => a.replace(ln, cn);
94
+ let zt = {
95
+ bindI18n: "languageChanged",
96
+ bindI18nStore: "",
97
+ transEmptyNodeValue: "",
98
+ transSupportBasicHtmlNodes: !0,
99
+ transWrapTextNodes: "",
100
+ transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
101
+ useSuspense: !0,
102
+ unescape: dn
103
+ };
104
+ const fn = (a = {}) => {
105
+ zt = {
106
+ ...zt,
107
+ ...a
108
+ };
109
+ }, hn = () => zt;
110
+ let Cr;
111
+ const pn = (a) => {
112
+ Cr = a;
113
+ }, gn = () => Cr, mn = {
114
+ type: "3rdParty",
115
+ init(a) {
116
+ fn(a.options.react), pn(a);
117
+ }
118
+ }, Tr = Jt();
119
+ class yn {
120
+ constructor() {
121
+ this.usedNamespaces = {};
122
+ }
123
+ addUsedNamespaces(e) {
124
+ e.forEach((t) => {
125
+ this.usedNamespaces[t] || (this.usedNamespaces[t] = !0);
126
+ });
127
+ }
128
+ getUsedNamespaces() {
129
+ return Object.keys(this.usedNamespaces);
130
+ }
131
+ }
132
+ const vn = (a, e) => {
133
+ const t = Lr();
134
+ return pt(() => {
135
+ t.current = a;
136
+ }, [a, e]), t.current;
137
+ }, Nr = (a, e, t, r) => a.getFixedT(e, t, r), bn = (a, e, t, r) => Ee(Nr(a, e, t, r), [a, e, t, r]), Zt = (a, e = {}) => {
138
+ var H, U, ee, q;
139
+ const {
140
+ i18n: t
141
+ } = e, {
142
+ i18n: r,
143
+ defaultNS: n
144
+ } = Rr(Tr) || {}, i = t || r || gn();
145
+ if (i && !i.reportNamespaces && (i.reportNamespaces = new yn()), !i) {
146
+ Bt(i, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
147
+ const V = (D, Y) => Oe(Y) ? Y : on(Y) && Oe(Y.defaultValue) ? Y.defaultValue : Array.isArray(D) ? D[D.length - 1] : D, F = [V, {}, !1];
148
+ return F.t = V, F.i18n = {}, F.ready = !1, F;
149
+ }
150
+ (H = i.options.react) != null && H.wait && Bt(i, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
151
+ const o = {
152
+ ...hn(),
153
+ ...i.options.react,
154
+ ...e
155
+ }, {
156
+ useSuspense: l,
157
+ keyPrefix: c
158
+ } = o;
159
+ let d = n || ((U = i.options) == null ? void 0 : U.defaultNS);
160
+ d = Oe(d) ? [d] : d || ["translation"], (q = (ee = i.reportNamespaces).addUsedNamespaces) == null || q.call(ee, d);
161
+ const h = (i.isInitialized || i.initializedStoreOnce) && d.every((V) => sn(V, i, o)), p = bn(i, e.lng || null, o.nsMode === "fallback" ? d : d[0], c), g = () => p, y = () => Nr(i, e.lng || null, o.nsMode === "fallback" ? d : d[0], c), [v, k] = Ye(g);
162
+ let C = d.join();
163
+ e.lng && (C = `${e.lng}${C}`);
164
+ const T = vn(C), P = Lr(!0);
165
+ pt(() => {
166
+ const {
167
+ bindI18n: V,
168
+ bindI18nStore: F
169
+ } = o;
170
+ P.current = !0, !h && !l && (e.lng ? Qt(i, e.lng, d, () => {
171
+ P.current && k(y);
172
+ }) : Wt(i, d, () => {
173
+ P.current && k(y);
174
+ })), h && T && T !== C && P.current && k(y);
175
+ const D = () => {
176
+ P.current && k(y);
177
+ };
178
+ return V && (i == null || i.on(V, D)), F && (i == null || i.store.on(F, D)), () => {
179
+ P.current = !1, i && (V == null || V.split(" ").forEach((Y) => i.off(Y, D))), F && i && F.split(" ").forEach((Y) => i.store.off(Y, D));
180
+ };
181
+ }, [i, C]), pt(() => {
182
+ P.current && h && k(g);
183
+ }, [i, c, h]);
184
+ const M = [v, i, h];
185
+ if (M.t = v, M.i18n = i, M.ready = h, h || !h && !l) return M;
186
+ throw new Promise((V) => {
187
+ e.lng ? Qt(i, e.lng, d, () => V()) : Wt(i, d, () => V());
188
+ });
189
+ };
190
+ function xn({
191
+ i18n: a,
192
+ defaultNS: e,
193
+ children: t
194
+ }) {
195
+ const r = en(() => ({
196
+ i18n: a,
197
+ defaultNS: e
198
+ }), [a, e]);
199
+ return Ut(Tr.Provider, {
200
+ value: r
201
+ }, t);
202
+ }
203
+ var ct = { exports: {} }, We = {};
204
+ /**
205
+ * @license React
206
+ * react-jsx-runtime.production.min.js
207
+ *
208
+ * Copyright (c) Facebook, Inc. and its affiliates.
209
+ *
210
+ * This source code is licensed under the MIT license found in the
211
+ * LICENSE file in the root directory of this source tree.
212
+ */
213
+ var er;
214
+ function wn() {
215
+ if (er) return We;
216
+ er = 1;
217
+ var a = yt, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, n = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
218
+ function o(l, c, d) {
219
+ var h, p = {}, g = null, y = null;
220
+ d !== void 0 && (g = "" + d), c.key !== void 0 && (g = "" + c.key), c.ref !== void 0 && (y = c.ref);
221
+ for (h in c) r.call(c, h) && !i.hasOwnProperty(h) && (p[h] = c[h]);
222
+ if (l && l.defaultProps) for (h in c = l.defaultProps, c) p[h] === void 0 && (p[h] = c[h]);
223
+ return { $$typeof: e, type: l, key: g, ref: y, props: p, _owner: n.current };
224
+ }
225
+ return We.Fragment = t, We.jsx = o, We.jsxs = o, We;
226
+ }
227
+ var ze = {};
228
+ /**
229
+ * @license React
230
+ * react-jsx-runtime.development.js
231
+ *
232
+ * Copyright (c) Facebook, Inc. and its affiliates.
233
+ *
234
+ * This source code is licensed under the MIT license found in the
235
+ * LICENSE file in the root directory of this source tree.
236
+ */
237
+ var tr;
238
+ function Sn() {
239
+ return tr || (tr = 1, process.env.NODE_ENV !== "production" && function() {
240
+ var a = yt, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), v = Symbol.iterator, k = "@@iterator";
241
+ function C(s) {
242
+ if (s === null || typeof s != "object")
243
+ return null;
244
+ var f = v && s[v] || s[k];
245
+ return typeof f == "function" ? f : null;
246
+ }
247
+ var T = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
248
+ function P(s) {
249
+ {
250
+ for (var f = arguments.length, m = new Array(f > 1 ? f - 1 : 0), x = 1; x < f; x++)
251
+ m[x - 1] = arguments[x];
252
+ M("error", s, m);
253
+ }
254
+ }
255
+ function M(s, f, m) {
256
+ {
257
+ var x = T.ReactDebugCurrentFrame, O = x.getStackAddendum();
258
+ O !== "" && (f += "%s", m = m.concat([O]));
259
+ var E = m.map(function(w) {
260
+ return String(w);
261
+ });
262
+ E.unshift("Warning: " + f), Function.prototype.apply.call(console[s], console, E);
263
+ }
264
+ }
265
+ var H = !1, U = !1, ee = !1, q = !1, V = !1, F;
266
+ F = Symbol.for("react.module.reference");
267
+ function D(s) {
268
+ return !!(typeof s == "string" || typeof s == "function" || s === r || s === i || V || s === n || s === d || s === h || q || s === y || H || U || ee || typeof s == "object" && s !== null && (s.$$typeof === g || s.$$typeof === p || s.$$typeof === o || s.$$typeof === l || s.$$typeof === c || // This needs to include all possible module reference object
269
+ // types supported by any Flight configuration anywhere since
270
+ // we don't know which Flight build this will end up being used
271
+ // with.
272
+ s.$$typeof === F || s.getModuleId !== void 0));
273
+ }
274
+ function Y(s, f, m) {
275
+ var x = s.displayName;
276
+ if (x)
277
+ return x;
278
+ var O = f.displayName || f.name || "";
279
+ return O !== "" ? m + "(" + O + ")" : m;
280
+ }
281
+ function ve(s) {
282
+ return s.displayName || "Context";
283
+ }
284
+ function _(s) {
285
+ if (s == null)
286
+ return null;
287
+ if (typeof s.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof s == "function")
288
+ return s.displayName || s.name || null;
289
+ if (typeof s == "string")
290
+ return s;
291
+ switch (s) {
292
+ case r:
293
+ return "Fragment";
294
+ case t:
295
+ return "Portal";
296
+ case i:
297
+ return "Profiler";
298
+ case n:
299
+ return "StrictMode";
300
+ case d:
301
+ return "Suspense";
302
+ case h:
303
+ return "SuspenseList";
304
+ }
305
+ if (typeof s == "object")
306
+ switch (s.$$typeof) {
307
+ case l:
308
+ var f = s;
309
+ return ve(f) + ".Consumer";
310
+ case o:
311
+ var m = s;
312
+ return ve(m._context) + ".Provider";
313
+ case c:
314
+ return Y(s, s.render, "ForwardRef");
315
+ case p:
316
+ var x = s.displayName || null;
317
+ return x !== null ? x : _(s.type) || "Memo";
318
+ case g: {
319
+ var O = s, E = O._payload, w = O._init;
320
+ try {
321
+ return _(w(E));
322
+ } catch {
323
+ return null;
324
+ }
325
+ }
326
+ }
327
+ return null;
328
+ }
329
+ var A = Object.assign, G = 0, Z, X, re, se, ye, W, te;
330
+ function ne() {
331
+ }
332
+ ne.__reactDisabledLog = !0;
333
+ function Pe() {
334
+ {
335
+ if (G === 0) {
336
+ Z = console.log, X = console.info, re = console.warn, se = console.error, ye = console.group, W = console.groupCollapsed, te = console.groupEnd;
337
+ var s = {
338
+ configurable: !0,
339
+ enumerable: !0,
340
+ value: ne,
341
+ writable: !0
342
+ };
343
+ Object.defineProperties(console, {
344
+ info: s,
345
+ log: s,
346
+ warn: s,
347
+ error: s,
348
+ group: s,
349
+ groupCollapsed: s,
350
+ groupEnd: s
351
+ });
352
+ }
353
+ G++;
354
+ }
355
+ }
356
+ function Re() {
357
+ {
358
+ if (G--, G === 0) {
359
+ var s = {
360
+ configurable: !0,
361
+ enumerable: !0,
362
+ writable: !0
363
+ };
364
+ Object.defineProperties(console, {
365
+ log: A({}, s, {
366
+ value: Z
367
+ }),
368
+ info: A({}, s, {
369
+ value: X
370
+ }),
371
+ warn: A({}, s, {
372
+ value: re
373
+ }),
374
+ error: A({}, s, {
375
+ value: se
376
+ }),
377
+ group: A({}, s, {
378
+ value: ye
379
+ }),
380
+ groupCollapsed: A({}, s, {
381
+ value: W
382
+ }),
383
+ groupEnd: A({}, s, {
384
+ value: te
385
+ })
386
+ });
387
+ }
388
+ G < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
389
+ }
390
+ }
391
+ var be = T.ReactCurrentDispatcher, xe;
392
+ function ue(s, f, m) {
393
+ {
394
+ if (xe === void 0)
395
+ try {
396
+ throw Error();
397
+ } catch (O) {
398
+ var x = O.stack.trim().match(/\n( *(at )?)/);
399
+ xe = x && x[1] || "";
400
+ }
401
+ return `
402
+ ` + xe + s;
403
+ }
404
+ }
405
+ var we = !1, ce;
406
+ {
407
+ var xt = typeof WeakMap == "function" ? WeakMap : Map;
408
+ ce = new xt();
409
+ }
410
+ function Fe(s, f) {
411
+ if (!s || we)
412
+ return "";
413
+ {
414
+ var m = ce.get(s);
415
+ if (m !== void 0)
416
+ return m;
417
+ }
418
+ var x;
419
+ we = !0;
420
+ var O = Error.prepareStackTrace;
421
+ Error.prepareStackTrace = void 0;
422
+ var E;
423
+ E = be.current, be.current = null, Pe();
424
+ try {
425
+ if (f) {
426
+ var w = function() {
427
+ throw Error();
428
+ };
429
+ if (Object.defineProperty(w.prototype, "props", {
430
+ set: function() {
431
+ throw Error();
432
+ }
433
+ }), typeof Reflect == "object" && Reflect.construct) {
434
+ try {
435
+ Reflect.construct(w, []);
436
+ } catch (K) {
437
+ x = K;
438
+ }
439
+ Reflect.construct(s, [], w);
440
+ } else {
441
+ try {
442
+ w.call();
443
+ } catch (K) {
444
+ x = K;
445
+ }
446
+ s.call(w.prototype);
447
+ }
448
+ } else {
449
+ try {
450
+ throw Error();
451
+ } catch (K) {
452
+ x = K;
453
+ }
454
+ s();
455
+ }
456
+ } catch (K) {
457
+ if (K && x && typeof K.stack == "string") {
458
+ for (var R = K.stack.split(`
459
+ `), N = x.stack.split(`
460
+ `), j = R.length - 1, $ = N.length - 1; j >= 1 && $ >= 0 && R[j] !== N[$]; )
461
+ $--;
462
+ for (; j >= 1 && $ >= 0; j--, $--)
463
+ if (R[j] !== N[$]) {
464
+ if (j !== 1 || $ !== 1)
465
+ do
466
+ if (j--, $--, $ < 0 || R[j] !== N[$]) {
467
+ var z = `
468
+ ` + R[j].replace(" at new ", " at ");
469
+ return s.displayName && z.includes("<anonymous>") && (z = z.replace("<anonymous>", s.displayName)), typeof s == "function" && ce.set(s, z), z;
470
+ }
471
+ while (j >= 1 && $ >= 0);
472
+ break;
473
+ }
474
+ }
475
+ } finally {
476
+ we = !1, be.current = E, Re(), Error.prepareStackTrace = O;
477
+ }
478
+ var Q = s ? s.displayName || s.name : "", B = Q ? ue(Q) : "";
479
+ return typeof s == "function" && ce.set(s, B), B;
480
+ }
481
+ function wt(s, f, m) {
482
+ return Fe(s, !1);
483
+ }
484
+ function St(s) {
485
+ var f = s.prototype;
486
+ return !!(f && f.isReactComponent);
487
+ }
488
+ function de(s, f, m) {
489
+ if (s == null)
490
+ return "";
491
+ if (typeof s == "function")
492
+ return Fe(s, St(s));
493
+ if (typeof s == "string")
494
+ return ue(s);
495
+ switch (s) {
496
+ case d:
497
+ return ue("Suspense");
498
+ case h:
499
+ return ue("SuspenseList");
500
+ }
501
+ if (typeof s == "object")
502
+ switch (s.$$typeof) {
503
+ case c:
504
+ return wt(s.render);
505
+ case p:
506
+ return de(s.type, f, m);
507
+ case g: {
508
+ var x = s, O = x._payload, E = x._init;
509
+ try {
510
+ return de(E(O), f, m);
511
+ } catch {
512
+ }
513
+ }
514
+ }
515
+ return "";
516
+ }
517
+ var ae = Object.prototype.hasOwnProperty, De = {}, _e = T.ReactDebugCurrentFrame;
518
+ function fe(s) {
519
+ if (s) {
520
+ var f = s._owner, m = de(s.type, s._source, f ? f.type : null);
521
+ _e.setExtraStackFrame(m);
522
+ } else
523
+ _e.setExtraStackFrame(null);
524
+ }
525
+ function kt(s, f, m, x, O) {
526
+ {
527
+ var E = Function.call.bind(ae);
528
+ for (var w in s)
529
+ if (E(s, w)) {
530
+ var R = void 0;
531
+ try {
532
+ if (typeof s[w] != "function") {
533
+ var N = Error((x || "React class") + ": " + m + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof s[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
534
+ throw N.name = "Invariant Violation", N;
535
+ }
536
+ R = s[w](f, w, x, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
537
+ } catch (j) {
538
+ R = j;
539
+ }
540
+ R && !(R instanceof Error) && (fe(O), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", x || "React class", m, w, typeof R), fe(null)), R instanceof Error && !(R.message in De) && (De[R.message] = !0, fe(O), P("Failed %s type: %s", m, R.message), fe(null));
541
+ }
542
+ }
543
+ }
544
+ var Et = Array.isArray;
545
+ function Se(s) {
546
+ return Et(s);
547
+ }
548
+ function Ot(s) {
549
+ {
550
+ var f = typeof Symbol == "function" && Symbol.toStringTag, m = f && s[Symbol.toStringTag] || s.constructor.name || "Object";
551
+ return m;
552
+ }
553
+ }
554
+ function Pt(s) {
555
+ try {
556
+ return tt(s), !1;
557
+ } catch {
558
+ return !0;
559
+ }
560
+ }
561
+ function tt(s) {
562
+ return "" + s;
563
+ }
564
+ function Me(s) {
565
+ if (Pt(s))
566
+ return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ot(s)), tt(s);
567
+ }
568
+ var rt = T.ReactCurrentOwner, Rt = {
569
+ key: !0,
570
+ ref: !0,
571
+ __self: !0,
572
+ __source: !0
573
+ }, Ae, Ie;
574
+ function Lt(s) {
575
+ if (ae.call(s, "ref")) {
576
+ var f = Object.getOwnPropertyDescriptor(s, "ref").get;
577
+ if (f && f.isReactWarning)
578
+ return !1;
579
+ }
580
+ return s.ref !== void 0;
581
+ }
582
+ function jt(s) {
583
+ if (ae.call(s, "key")) {
584
+ var f = Object.getOwnPropertyDescriptor(s, "key").get;
585
+ if (f && f.isReactWarning)
586
+ return !1;
587
+ }
588
+ return s.key !== void 0;
589
+ }
590
+ function Ct(s, f) {
591
+ typeof s.ref == "string" && rt.current;
592
+ }
593
+ function Tt(s, f) {
594
+ {
595
+ var m = function() {
596
+ Ae || (Ae = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
597
+ };
598
+ m.isReactWarning = !0, Object.defineProperty(s, "key", {
599
+ get: m,
600
+ configurable: !0
601
+ });
602
+ }
603
+ }
604
+ function Nt(s, f) {
605
+ {
606
+ var m = function() {
607
+ Ie || (Ie = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
608
+ };
609
+ m.isReactWarning = !0, Object.defineProperty(s, "ref", {
610
+ get: m,
611
+ configurable: !0
612
+ });
613
+ }
614
+ }
615
+ var $t = function(s, f, m, x, O, E, w) {
616
+ var R = {
617
+ // This tag allows us to uniquely identify this as a React Element
618
+ $$typeof: e,
619
+ // Built-in properties that belong on the element
620
+ type: s,
621
+ key: f,
622
+ ref: m,
623
+ props: w,
624
+ // Record the component responsible for creating this element.
625
+ _owner: E
626
+ };
627
+ return R._store = {}, Object.defineProperty(R._store, "validated", {
628
+ configurable: !1,
629
+ enumerable: !1,
630
+ writable: !0,
631
+ value: !1
632
+ }), Object.defineProperty(R, "_self", {
633
+ configurable: !1,
634
+ enumerable: !1,
635
+ writable: !1,
636
+ value: x
637
+ }), Object.defineProperty(R, "_source", {
638
+ configurable: !1,
639
+ enumerable: !1,
640
+ writable: !1,
641
+ value: O
642
+ }), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
643
+ };
644
+ function Ve(s, f, m, x, O) {
645
+ {
646
+ var E, w = {}, R = null, N = null;
647
+ m !== void 0 && (Me(m), R = "" + m), jt(f) && (Me(f.key), R = "" + f.key), Lt(f) && (N = f.ref, Ct(f, O));
648
+ for (E in f)
649
+ ae.call(f, E) && !Rt.hasOwnProperty(E) && (w[E] = f[E]);
650
+ if (s && s.defaultProps) {
651
+ var j = s.defaultProps;
652
+ for (E in j)
653
+ w[E] === void 0 && (w[E] = j[E]);
654
+ }
655
+ if (R || N) {
656
+ var $ = typeof s == "function" ? s.displayName || s.name || "Unknown" : s;
657
+ R && Tt(w, $), N && Nt(w, $);
658
+ }
659
+ return $t(s, R, N, O, x, rt.current, w);
660
+ }
661
+ }
662
+ var Le = T.ReactCurrentOwner, he = T.ReactDebugCurrentFrame;
663
+ function oe(s) {
664
+ if (s) {
665
+ var f = s._owner, m = de(s.type, s._source, f ? f.type : null);
666
+ he.setExtraStackFrame(m);
667
+ } else
668
+ he.setExtraStackFrame(null);
669
+ }
670
+ var ke;
671
+ ke = !1;
672
+ function je(s) {
673
+ return typeof s == "object" && s !== null && s.$$typeof === e;
674
+ }
675
+ function nt() {
676
+ {
677
+ if (Le.current) {
678
+ var s = _(Le.current.type);
679
+ if (s)
680
+ return `
681
+
682
+ Check the render method of \`` + s + "`.";
683
+ }
684
+ return "";
685
+ }
686
+ }
687
+ function at(s) {
688
+ return "";
689
+ }
690
+ var it = {};
691
+ function st(s) {
692
+ {
693
+ var f = nt();
694
+ if (!f) {
695
+ var m = typeof s == "string" ? s : s.displayName || s.name;
696
+ m && (f = `
697
+
698
+ Check the top-level render call using <` + m + ">.");
699
+ }
700
+ return f;
701
+ }
702
+ }
703
+ function He(s, f) {
704
+ {
705
+ if (!s._store || s._store.validated || s.key != null)
706
+ return;
707
+ s._store.validated = !0;
708
+ var m = st(f);
709
+ if (it[m])
710
+ return;
711
+ it[m] = !0;
712
+ var x = "";
713
+ s && s._owner && s._owner !== Le.current && (x = " It was passed a child from " + _(s._owner.type) + "."), oe(s), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, x), oe(null);
714
+ }
715
+ }
716
+ function ot(s, f) {
717
+ {
718
+ if (typeof s != "object")
719
+ return;
720
+ if (Se(s))
721
+ for (var m = 0; m < s.length; m++) {
722
+ var x = s[m];
723
+ je(x) && He(x, f);
724
+ }
725
+ else if (je(s))
726
+ s._store && (s._store.validated = !0);
727
+ else if (s) {
728
+ var O = C(s);
729
+ if (typeof O == "function" && O !== s.entries)
730
+ for (var E = O.call(s), w; !(w = E.next()).done; )
731
+ je(w.value) && He(w.value, f);
732
+ }
733
+ }
734
+ }
735
+ function Ft(s) {
736
+ {
737
+ var f = s.type;
738
+ if (f == null || typeof f == "string")
739
+ return;
740
+ var m;
741
+ if (typeof f == "function")
742
+ m = f.propTypes;
743
+ else if (typeof f == "object" && (f.$$typeof === c || // Note: Memo only checks outer props here.
744
+ // Inner props are checked in the reconciler.
745
+ f.$$typeof === p))
746
+ m = f.propTypes;
747
+ else
748
+ return;
749
+ if (m) {
750
+ var x = _(f);
751
+ kt(m, s.props, "prop", x, s);
752
+ } else if (f.PropTypes !== void 0 && !ke) {
753
+ ke = !0;
754
+ var O = _(f);
755
+ P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
756
+ }
757
+ typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
758
+ }
759
+ }
760
+ function lt(s) {
761
+ {
762
+ for (var f = Object.keys(s.props), m = 0; m < f.length; m++) {
763
+ var x = f[m];
764
+ if (x !== "children" && x !== "key") {
765
+ oe(s), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), oe(null);
766
+ break;
767
+ }
768
+ }
769
+ s.ref !== null && (oe(s), P("Invalid attribute `ref` supplied to `React.Fragment`."), oe(null));
770
+ }
771
+ }
772
+ var Ue = {};
773
+ function ut(s, f, m, x, O, E) {
774
+ {
775
+ var w = D(s);
776
+ if (!w) {
777
+ var R = "";
778
+ (s === void 0 || typeof s == "object" && s !== null && Object.keys(s).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
779
+ var N = at();
780
+ N ? R += N : R += nt();
781
+ var j;
782
+ s === null ? j = "null" : Se(s) ? j = "array" : s !== void 0 && s.$$typeof === e ? (j = "<" + (_(s.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : j = typeof s, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", j, R);
783
+ }
784
+ var $ = Ve(s, f, m, O, E);
785
+ if ($ == null)
786
+ return $;
787
+ if (w) {
788
+ var z = f.children;
789
+ if (z !== void 0)
790
+ if (x)
791
+ if (Se(z)) {
792
+ for (var Q = 0; Q < z.length; Q++)
793
+ ot(z[Q], s);
794
+ Object.freeze && Object.freeze(z);
795
+ } else
796
+ P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
797
+ else
798
+ ot(z, s);
799
+ }
800
+ if (ae.call(f, "key")) {
801
+ var B = _(s), K = Object.keys(f).filter(function(Xr) {
802
+ return Xr !== "key";
803
+ }), Be = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
804
+ if (!Ue[B + Be]) {
805
+ var At = K.length > 0 ? "{" + K.join(": ..., ") + ": ...}" : "{}";
806
+ P(`A props object containing a "key" prop is being spread into JSX:
807
+ let props = %s;
808
+ <%s {...props} />
809
+ React keys must be passed directly to JSX without using spread:
810
+ let props = %s;
811
+ <%s key={someKey} {...props} />`, Be, B, At, B), Ue[B + Be] = !0;
812
+ }
813
+ }
814
+ return s === r ? lt($) : Ft($), $;
815
+ }
816
+ }
817
+ function Dt(s, f, m) {
818
+ return ut(s, f, m, !0);
819
+ }
820
+ function _t(s, f, m) {
821
+ return ut(s, f, m, !1);
822
+ }
823
+ var Mt = _t, u = Dt;
824
+ ze.Fragment = r, ze.jsx = Mt, ze.jsxs = u;
825
+ }()), ze;
826
+ }
827
+ var rr;
828
+ function kn() {
829
+ return rr || (rr = 1, process.env.NODE_ENV === "production" ? ct.exports = wn() : ct.exports = Sn()), ct.exports;
830
+ }
831
+ var S = kn();
832
+ const En = ({ step: a, form: e, formState: t, onDismiss: r, onNextStep: n, onPreviousStep: i, onUpdateResponse: o }) => {
833
+ const { t: l } = Zt(), d = ((h) => {
834
+ let p = 0;
835
+ if (e.startTransition) {
836
+ if (h === p)
837
+ return { type: "start", transition: e.startTransition };
838
+ p++;
839
+ }
840
+ const g = h - p;
841
+ return g >= 0 && g < e.questions.length ? { type: "question", questionIndex: g, question: e.questions[g] } : (p += e.questions.length, e.endTransition && h === p ? { type: "end", transition: e.endTransition } : null);
842
+ })(a);
843
+ if ((d == null ? void 0 : d.type) === "start") {
844
+ const {
845
+ title: h,
846
+ description: p,
847
+ image: g,
848
+ includeOptOut: y,
849
+ customStartButton: v,
850
+ startButtonText: k,
851
+ customOptOutButton: C,
852
+ optOutButtonText: T
853
+ } = d.transition;
854
+ return /* @__PURE__ */ S.jsx(
855
+ Bn,
856
+ {
857
+ title: h,
858
+ description: p,
859
+ icon: e.icon,
860
+ image: g,
861
+ quitText: y ? C ? T : l("Quit") : void 0,
862
+ onQuit: y ? () => r(t) : void 0,
863
+ startText: v ? k : l("Start"),
864
+ onStart: n
865
+ }
866
+ );
867
+ }
868
+ if ((d == null ? void 0 : d.type) === "end") {
869
+ const { title: h, description: p, image: g, customEndButton: y, endButtonText: v, customEndButtonLink: k, endButtonLink: C } = d.transition;
870
+ return /* @__PURE__ */ S.jsx(
871
+ Un,
872
+ {
873
+ title: h,
874
+ description: p,
875
+ icon: e.icon,
876
+ image: g,
877
+ quitText: y ? v : l("Done"),
878
+ onQuit: n,
879
+ externalLink: k ? C : void 0
880
+ }
881
+ );
882
+ }
883
+ if ((d == null ? void 0 : d.type) === "question") {
884
+ const { question: h } = d;
885
+ if (h.questionType === "choice") {
886
+ const { title: p, description: g, image: y, alternatives: v, maxSelections: k, required: C } = h, T = t.responses[h.id] || [], P = (k ? T.length <= k || k === 4 : !0) && (C ? T.length > 0 : !0);
887
+ return /* @__PURE__ */ S.jsx(
888
+ In,
889
+ {
890
+ title: p,
891
+ description: g,
892
+ image: y,
893
+ alternatives: v,
894
+ onPrevious: i,
895
+ onNext: n,
896
+ icon: e.icon,
897
+ maxAlternatives: k,
898
+ onQuit: () => r(t),
899
+ selectedAlternatives: T,
900
+ onAlternativeSelect: (M) => {
901
+ if (k > 1) {
902
+ const U = T, ee = U.includes(M) ? U.filter((q) => q !== M) : k && U.length >= k && k != 4 ? U : [...U, M];
903
+ o(h.id, ee);
904
+ } else
905
+ T.includes(M) ? o(h.id, []) : o(h.id, [M]);
906
+ },
907
+ isValid: P
908
+ }
909
+ );
910
+ }
911
+ if (h.questionType === "text") {
912
+ const { title: p, description: g, image: y, maxChars: v, limited: k, required: C } = h, T = t.responses[h.id] || "", P = (k && v ? T.length <= v : !0) && (C ? T.length > 0 : !0);
913
+ return /* @__PURE__ */ S.jsx(
914
+ Hn,
915
+ {
916
+ title: p,
917
+ icon: e.icon,
918
+ description: g,
919
+ onNext: n,
920
+ onPrevious: i,
921
+ onQuit: () => r(t),
922
+ image: y,
923
+ maxCharacters: k ? v : void 0,
924
+ inputText: T,
925
+ setInputText: (M) => {
926
+ k && v && M.length > v || o(h.id, M);
927
+ },
928
+ isValid: P
929
+ }
930
+ );
931
+ }
932
+ }
933
+ return null;
934
+ }, On = ({ form: a, onDismiss: e, onComplete: t }) => {
935
+ const n = (a.startTransition ? 1 : 0) + a.questions.length + (a.endTransition ? 1 : 0) - 1, [i, o] = Ye({
936
+ responses: {},
937
+ currentStep: 0,
938
+ startedAt: /* @__PURE__ */ new Date()
939
+ }), l = Ee((p, g) => {
940
+ o((y) => ({
941
+ ...y,
942
+ responses: {
943
+ ...y.responses,
944
+ [p]: g
945
+ }
946
+ }));
947
+ }, []), c = Ee((p) => {
948
+ o((g) => ({
949
+ ...g,
950
+ currentStep: p
951
+ }));
952
+ }, []), d = Ee(() => {
953
+ if (i.currentStep < n)
954
+ c(i.currentStep + 1);
955
+ else {
956
+ const p = {
957
+ ...i,
958
+ completedAt: /* @__PURE__ */ new Date()
959
+ };
960
+ t(p);
961
+ }
962
+ }, [i, n, c, t]), h = Ee(() => {
963
+ i.currentStep > 0 && c(i.currentStep - 1);
964
+ }, [i.currentStep, c]);
965
+ return /* @__PURE__ */ S.jsx("div", { className: "flex flex-col justify-center items-center absolute inset-0 bg-overlay-background-default-light dark:bg-overlay-background-default-dark", children: /* @__PURE__ */ S.jsx(
966
+ En,
967
+ {
968
+ step: i.currentStep,
969
+ form: a,
970
+ formState: i,
971
+ onDismiss: e,
972
+ onNextStep: d,
973
+ onPreviousStep: h,
974
+ onUpdateResponse: l
975
+ }
976
+ ) });
977
+ }, Pn = /* @__PURE__ */ new Map([
978
+ [
979
+ "bold",
980
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
981
+ ],
982
+ [
983
+ "duotone",
984
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.createElement(
985
+ "path",
986
+ {
987
+ 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",
988
+ opacity: "0.2"
989
+ }
990
+ ), /* @__PURE__ */ b.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" }))
991
+ ],
992
+ [
993
+ "fill",
994
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
995
+ ],
996
+ [
997
+ "light",
998
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
999
+ ],
1000
+ [
1001
+ "regular",
1002
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1003
+ ],
1004
+ [
1005
+ "thin",
1006
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1007
+ ]
1008
+ ]), Rn = /* @__PURE__ */ new Map([
1009
+ [
1010
+ "bold",
1011
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1012
+ ],
1013
+ [
1014
+ "duotone",
1015
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.createElement("path", { d: "M160,48V208L80,128Z", opacity: "0.2" }), /* @__PURE__ */ b.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" }))
1016
+ ],
1017
+ [
1018
+ "fill",
1019
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1020
+ ],
1021
+ [
1022
+ "light",
1023
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1024
+ ],
1025
+ [
1026
+ "regular",
1027
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1028
+ ],
1029
+ [
1030
+ "thin",
1031
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1032
+ ]
1033
+ ]), Ln = /* @__PURE__ */ new Map([
1034
+ [
1035
+ "bold",
1036
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1037
+ ],
1038
+ [
1039
+ "duotone",
1040
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.createElement("path", { d: "M176,128,96,208V48Z", opacity: "0.2" }), /* @__PURE__ */ b.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" }))
1041
+ ],
1042
+ [
1043
+ "fill",
1044
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1045
+ ],
1046
+ [
1047
+ "light",
1048
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1049
+ ],
1050
+ [
1051
+ "regular",
1052
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1053
+ ],
1054
+ [
1055
+ "thin",
1056
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1057
+ ]
1058
+ ]), jn = /* @__PURE__ */ new Map([
1059
+ [
1060
+ "bold",
1061
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1062
+ ],
1063
+ [
1064
+ "duotone",
1065
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.createElement(
1066
+ "path",
1067
+ {
1068
+ 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",
1069
+ opacity: "0.2"
1070
+ }
1071
+ ), /* @__PURE__ */ b.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" }))
1072
+ ],
1073
+ [
1074
+ "fill",
1075
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1076
+ ],
1077
+ [
1078
+ "light",
1079
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1080
+ ],
1081
+ [
1082
+ "regular",
1083
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1084
+ ],
1085
+ [
1086
+ "thin",
1087
+ /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.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" }))
1088
+ ]
1089
+ ]), $r = Jt({
1090
+ color: "currentColor",
1091
+ size: "1em",
1092
+ weight: "regular",
1093
+ mirrored: !1
1094
+ }), et = b.forwardRef(
1095
+ (a, e) => {
1096
+ const {
1097
+ alt: t,
1098
+ color: r,
1099
+ size: n,
1100
+ weight: i,
1101
+ mirrored: o,
1102
+ children: l,
1103
+ weights: c,
1104
+ ...d
1105
+ } = a, {
1106
+ color: h = "currentColor",
1107
+ size: p,
1108
+ weight: g = "regular",
1109
+ mirrored: y = !1,
1110
+ ...v
1111
+ } = b.useContext($r);
1112
+ return /* @__PURE__ */ b.createElement(
1113
+ "svg",
1114
+ {
1115
+ ref: e,
1116
+ xmlns: "http://www.w3.org/2000/svg",
1117
+ width: n ?? p,
1118
+ height: n ?? p,
1119
+ fill: r ?? h,
1120
+ viewBox: "0 0 256 256",
1121
+ transform: o || y ? "scale(-1, 1)" : void 0,
1122
+ ...v,
1123
+ ...d
1124
+ },
1125
+ !!t && /* @__PURE__ */ b.createElement("title", null, t),
1126
+ l,
1127
+ c.get(i ?? g)
1128
+ );
1129
+ }
1130
+ );
1131
+ et.displayName = "IconBase";
1132
+ const Fr = b.forwardRef((a, e) => /* @__PURE__ */ b.createElement(et, { ref: e, ...a, weights: Pn }));
1133
+ Fr.displayName = "ArrowSquareOutIcon";
1134
+ const Dr = b.forwardRef((a, e) => /* @__PURE__ */ b.createElement(et, { ref: e, ...a, weights: Rn }));
1135
+ Dr.displayName = "CaretLeftIcon";
1136
+ const _r = b.forwardRef((a, e) => /* @__PURE__ */ b.createElement(et, { ref: e, ...a, weights: Ln }));
1137
+ _r.displayName = "CaretRightIcon";
1138
+ const vt = b.forwardRef((a, e) => /* @__PURE__ */ b.createElement(et, { ref: e, ...a, weights: jn }));
1139
+ vt.displayName = "XIcon";
1140
+ var It = { exports: {} }, qe = {};
1141
+ /**
1142
+ * @license React
1143
+ * react-jsx-runtime.production.min.js
1144
+ *
1145
+ * Copyright (c) Facebook, Inc. and its affiliates.
1146
+ *
1147
+ * This source code is licensed under the MIT license found in the
1148
+ * LICENSE file in the root directory of this source tree.
1149
+ */
1150
+ var nr;
1151
+ function Cn() {
1152
+ if (nr) return qe;
1153
+ nr = 1;
1154
+ var a = yt, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, n = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
1155
+ function o(l, c, d) {
1156
+ var h, p = {}, g = null, y = null;
1157
+ d !== void 0 && (g = "" + d), c.key !== void 0 && (g = "" + c.key), c.ref !== void 0 && (y = c.ref);
1158
+ for (h in c) r.call(c, h) && !i.hasOwnProperty(h) && (p[h] = c[h]);
1159
+ if (l && l.defaultProps) for (h in c = l.defaultProps, c) p[h] === void 0 && (p[h] = c[h]);
1160
+ return { $$typeof: e, type: l, key: g, ref: y, props: p, _owner: n.current };
1161
+ }
1162
+ return qe.Fragment = t, qe.jsx = o, qe.jsxs = o, qe;
1163
+ }
1164
+ var dt = {};
1165
+ /**
1166
+ * @license React
1167
+ * react-jsx-runtime.development.js
1168
+ *
1169
+ * Copyright (c) Facebook, Inc. and its affiliates.
1170
+ *
1171
+ * This source code is licensed under the MIT license found in the
1172
+ * LICENSE file in the root directory of this source tree.
1173
+ */
1174
+ var ar;
1175
+ function Tn() {
1176
+ return ar || (ar = 1, process.env.NODE_ENV !== "production" && function() {
1177
+ var a = yt, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), l = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), v = Symbol.iterator, k = "@@iterator";
1178
+ function C(u) {
1179
+ if (u === null || typeof u != "object")
1180
+ return null;
1181
+ var s = v && u[v] || u[k];
1182
+ return typeof s == "function" ? s : null;
1183
+ }
1184
+ var T = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1185
+ function P(u) {
1186
+ {
1187
+ for (var s = arguments.length, f = new Array(s > 1 ? s - 1 : 0), m = 1; m < s; m++)
1188
+ f[m - 1] = arguments[m];
1189
+ M("error", u, f);
1190
+ }
1191
+ }
1192
+ function M(u, s, f) {
1193
+ {
1194
+ var m = T.ReactDebugCurrentFrame, x = m.getStackAddendum();
1195
+ x !== "" && (s += "%s", f = f.concat([x]));
1196
+ var O = f.map(function(E) {
1197
+ return String(E);
1198
+ });
1199
+ O.unshift("Warning: " + s), Function.prototype.apply.call(console[u], console, O);
1200
+ }
1201
+ }
1202
+ var H = !1, U = !1, ee = !1, q = !1, V = !1, F;
1203
+ F = Symbol.for("react.module.reference");
1204
+ function D(u) {
1205
+ return !!(typeof u == "string" || typeof u == "function" || u === r || u === i || V || u === n || u === d || u === h || q || u === y || H || U || ee || typeof u == "object" && u !== null && (u.$$typeof === g || u.$$typeof === p || u.$$typeof === o || u.$$typeof === l || u.$$typeof === c || // This needs to include all possible module reference object
1206
+ // types supported by any Flight configuration anywhere since
1207
+ // we don't know which Flight build this will end up being used
1208
+ // with.
1209
+ u.$$typeof === F || u.getModuleId !== void 0));
1210
+ }
1211
+ function Y(u, s, f) {
1212
+ var m = u.displayName;
1213
+ if (m)
1214
+ return m;
1215
+ var x = s.displayName || s.name || "";
1216
+ return x !== "" ? f + "(" + x + ")" : f;
1217
+ }
1218
+ function ve(u) {
1219
+ return u.displayName || "Context";
1220
+ }
1221
+ function _(u) {
1222
+ if (u == null)
1223
+ return null;
1224
+ if (typeof u.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof u == "function")
1225
+ return u.displayName || u.name || null;
1226
+ if (typeof u == "string")
1227
+ return u;
1228
+ switch (u) {
1229
+ case r:
1230
+ return "Fragment";
1231
+ case t:
1232
+ return "Portal";
1233
+ case i:
1234
+ return "Profiler";
1235
+ case n:
1236
+ return "StrictMode";
1237
+ case d:
1238
+ return "Suspense";
1239
+ case h:
1240
+ return "SuspenseList";
1241
+ }
1242
+ if (typeof u == "object")
1243
+ switch (u.$$typeof) {
1244
+ case l:
1245
+ var s = u;
1246
+ return ve(s) + ".Consumer";
1247
+ case o:
1248
+ var f = u;
1249
+ return ve(f._context) + ".Provider";
1250
+ case c:
1251
+ return Y(u, u.render, "ForwardRef");
1252
+ case p:
1253
+ var m = u.displayName || null;
1254
+ return m !== null ? m : _(u.type) || "Memo";
1255
+ case g: {
1256
+ var x = u, O = x._payload, E = x._init;
1257
+ try {
1258
+ return _(E(O));
1259
+ } catch {
1260
+ return null;
1261
+ }
1262
+ }
1263
+ }
1264
+ return null;
1265
+ }
1266
+ var A = Object.assign, G = 0, Z, X, re, se, ye, W, te;
1267
+ function ne() {
1268
+ }
1269
+ ne.__reactDisabledLog = !0;
1270
+ function Pe() {
1271
+ {
1272
+ if (G === 0) {
1273
+ Z = console.log, X = console.info, re = console.warn, se = console.error, ye = console.group, W = console.groupCollapsed, te = console.groupEnd;
1274
+ var u = {
1275
+ configurable: !0,
1276
+ enumerable: !0,
1277
+ value: ne,
1278
+ writable: !0
1279
+ };
1280
+ Object.defineProperties(console, {
1281
+ info: u,
1282
+ log: u,
1283
+ warn: u,
1284
+ error: u,
1285
+ group: u,
1286
+ groupCollapsed: u,
1287
+ groupEnd: u
1288
+ });
1289
+ }
1290
+ G++;
1291
+ }
1292
+ }
1293
+ function Re() {
1294
+ {
1295
+ if (G--, G === 0) {
1296
+ var u = {
1297
+ configurable: !0,
1298
+ enumerable: !0,
1299
+ writable: !0
1300
+ };
1301
+ Object.defineProperties(console, {
1302
+ log: A({}, u, {
1303
+ value: Z
1304
+ }),
1305
+ info: A({}, u, {
1306
+ value: X
1307
+ }),
1308
+ warn: A({}, u, {
1309
+ value: re
1310
+ }),
1311
+ error: A({}, u, {
1312
+ value: se
1313
+ }),
1314
+ group: A({}, u, {
1315
+ value: ye
1316
+ }),
1317
+ groupCollapsed: A({}, u, {
1318
+ value: W
1319
+ }),
1320
+ groupEnd: A({}, u, {
1321
+ value: te
1322
+ })
1323
+ });
1324
+ }
1325
+ G < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1326
+ }
1327
+ }
1328
+ var be = T.ReactCurrentDispatcher, xe;
1329
+ function ue(u, s, f) {
1330
+ {
1331
+ if (xe === void 0)
1332
+ try {
1333
+ throw Error();
1334
+ } catch (x) {
1335
+ var m = x.stack.trim().match(/\n( *(at )?)/);
1336
+ xe = m && m[1] || "";
1337
+ }
1338
+ return `
1339
+ ` + xe + u;
1340
+ }
1341
+ }
1342
+ var we = !1, ce;
1343
+ {
1344
+ var xt = typeof WeakMap == "function" ? WeakMap : Map;
1345
+ ce = new xt();
1346
+ }
1347
+ function Fe(u, s) {
1348
+ if (!u || we)
1349
+ return "";
1350
+ {
1351
+ var f = ce.get(u);
1352
+ if (f !== void 0)
1353
+ return f;
1354
+ }
1355
+ var m;
1356
+ we = !0;
1357
+ var x = Error.prepareStackTrace;
1358
+ Error.prepareStackTrace = void 0;
1359
+ var O;
1360
+ O = be.current, be.current = null, Pe();
1361
+ try {
1362
+ if (s) {
1363
+ var E = function() {
1364
+ throw Error();
1365
+ };
1366
+ if (Object.defineProperty(E.prototype, "props", {
1367
+ set: function() {
1368
+ throw Error();
1369
+ }
1370
+ }), typeof Reflect == "object" && Reflect.construct) {
1371
+ try {
1372
+ Reflect.construct(E, []);
1373
+ } catch (B) {
1374
+ m = B;
1375
+ }
1376
+ Reflect.construct(u, [], E);
1377
+ } else {
1378
+ try {
1379
+ E.call();
1380
+ } catch (B) {
1381
+ m = B;
1382
+ }
1383
+ u.call(E.prototype);
1384
+ }
1385
+ } else {
1386
+ try {
1387
+ throw Error();
1388
+ } catch (B) {
1389
+ m = B;
1390
+ }
1391
+ u();
1392
+ }
1393
+ } catch (B) {
1394
+ if (B && m && typeof B.stack == "string") {
1395
+ for (var w = B.stack.split(`
1396
+ `), R = m.stack.split(`
1397
+ `), N = w.length - 1, j = R.length - 1; N >= 1 && j >= 0 && w[N] !== R[j]; )
1398
+ j--;
1399
+ for (; N >= 1 && j >= 0; N--, j--)
1400
+ if (w[N] !== R[j]) {
1401
+ if (N !== 1 || j !== 1)
1402
+ do
1403
+ if (N--, j--, j < 0 || w[N] !== R[j]) {
1404
+ var $ = `
1405
+ ` + w[N].replace(" at new ", " at ");
1406
+ return u.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", u.displayName)), typeof u == "function" && ce.set(u, $), $;
1407
+ }
1408
+ while (N >= 1 && j >= 0);
1409
+ break;
1410
+ }
1411
+ }
1412
+ } finally {
1413
+ we = !1, be.current = O, Re(), Error.prepareStackTrace = x;
1414
+ }
1415
+ var z = u ? u.displayName || u.name : "", Q = z ? ue(z) : "";
1416
+ return typeof u == "function" && ce.set(u, Q), Q;
1417
+ }
1418
+ function wt(u, s, f) {
1419
+ return Fe(u, !1);
1420
+ }
1421
+ function St(u) {
1422
+ var s = u.prototype;
1423
+ return !!(s && s.isReactComponent);
1424
+ }
1425
+ function de(u, s, f) {
1426
+ if (u == null)
1427
+ return "";
1428
+ if (typeof u == "function")
1429
+ return Fe(u, St(u));
1430
+ if (typeof u == "string")
1431
+ return ue(u);
1432
+ switch (u) {
1433
+ case d:
1434
+ return ue("Suspense");
1435
+ case h:
1436
+ return ue("SuspenseList");
1437
+ }
1438
+ if (typeof u == "object")
1439
+ switch (u.$$typeof) {
1440
+ case c:
1441
+ return wt(u.render);
1442
+ case p:
1443
+ return de(u.type);
1444
+ case g: {
1445
+ var m = u, x = m._payload, O = m._init;
1446
+ try {
1447
+ return de(O(x));
1448
+ } catch {
1449
+ }
1450
+ }
1451
+ }
1452
+ return "";
1453
+ }
1454
+ var ae = Object.prototype.hasOwnProperty, De = {}, _e = T.ReactDebugCurrentFrame;
1455
+ function fe(u) {
1456
+ if (u) {
1457
+ var s = de(u.type);
1458
+ _e.setExtraStackFrame(s);
1459
+ } else
1460
+ _e.setExtraStackFrame(null);
1461
+ }
1462
+ function kt(u, s, f, m, x) {
1463
+ {
1464
+ var O = Function.call.bind(ae);
1465
+ for (var E in u)
1466
+ if (O(u, E)) {
1467
+ var w = void 0;
1468
+ try {
1469
+ if (typeof u[E] != "function") {
1470
+ var R = Error((m || "React class") + ": " + f + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof u[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1471
+ throw R.name = "Invariant Violation", R;
1472
+ }
1473
+ w = u[E](s, E, m, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1474
+ } catch (N) {
1475
+ w = N;
1476
+ }
1477
+ w && !(w instanceof Error) && (fe(x), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", f, E, typeof w), fe(null)), w instanceof Error && !(w.message in De) && (De[w.message] = !0, fe(x), P("Failed %s type: %s", f, w.message), fe(null));
1478
+ }
1479
+ }
1480
+ }
1481
+ var Et = Array.isArray;
1482
+ function Se(u) {
1483
+ return Et(u);
1484
+ }
1485
+ function Ot(u) {
1486
+ {
1487
+ var s = typeof Symbol == "function" && Symbol.toStringTag, f = s && u[Symbol.toStringTag] || u.constructor.name || "Object";
1488
+ return f;
1489
+ }
1490
+ }
1491
+ function Pt(u) {
1492
+ try {
1493
+ return !1;
1494
+ } catch {
1495
+ return !0;
1496
+ }
1497
+ }
1498
+ function tt(u) {
1499
+ return "" + u;
1500
+ }
1501
+ function Me(u) {
1502
+ if (Pt())
1503
+ return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ot(u)), tt(u);
1504
+ }
1505
+ var rt = T.ReactCurrentOwner, Rt = {
1506
+ key: !0,
1507
+ ref: !0,
1508
+ __self: !0,
1509
+ __source: !0
1510
+ }, Ae, Ie;
1511
+ function Lt(u) {
1512
+ if (ae.call(u, "ref")) {
1513
+ var s = Object.getOwnPropertyDescriptor(u, "ref").get;
1514
+ if (s && s.isReactWarning)
1515
+ return !1;
1516
+ }
1517
+ return u.ref !== void 0;
1518
+ }
1519
+ function jt(u) {
1520
+ if (ae.call(u, "key")) {
1521
+ var s = Object.getOwnPropertyDescriptor(u, "key").get;
1522
+ if (s && s.isReactWarning)
1523
+ return !1;
1524
+ }
1525
+ return u.key !== void 0;
1526
+ }
1527
+ function Ct(u, s) {
1528
+ {
1529
+ var f = function() {
1530
+ Ae || (Ae = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
1531
+ };
1532
+ f.isReactWarning = !0, Object.defineProperty(u, "key", {
1533
+ get: f,
1534
+ configurable: !0
1535
+ });
1536
+ }
1537
+ }
1538
+ function Tt(u, s) {
1539
+ {
1540
+ var f = function() {
1541
+ Ie || (Ie = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
1542
+ };
1543
+ f.isReactWarning = !0, Object.defineProperty(u, "ref", {
1544
+ get: f,
1545
+ configurable: !0
1546
+ });
1547
+ }
1548
+ }
1549
+ var Nt = function(u, s, f, m, x, O, E) {
1550
+ var w = {
1551
+ // This tag allows us to uniquely identify this as a React Element
1552
+ $$typeof: e,
1553
+ // Built-in properties that belong on the element
1554
+ type: u,
1555
+ key: s,
1556
+ ref: f,
1557
+ props: E,
1558
+ // Record the component responsible for creating this element.
1559
+ _owner: O
1560
+ };
1561
+ return w._store = {}, Object.defineProperty(w._store, "validated", {
1562
+ configurable: !1,
1563
+ enumerable: !1,
1564
+ writable: !0,
1565
+ value: !1
1566
+ }), Object.defineProperty(w, "_self", {
1567
+ configurable: !1,
1568
+ enumerable: !1,
1569
+ writable: !1,
1570
+ value: m
1571
+ }), Object.defineProperty(w, "_source", {
1572
+ configurable: !1,
1573
+ enumerable: !1,
1574
+ writable: !1,
1575
+ value: x
1576
+ }), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
1577
+ };
1578
+ function $t(u, s, f, m, x) {
1579
+ {
1580
+ var O, E = {}, w = null, R = null;
1581
+ f !== void 0 && (Me(f), w = "" + f), jt(s) && (Me(s.key), w = "" + s.key), Lt(s) && (R = s.ref);
1582
+ for (O in s)
1583
+ ae.call(s, O) && !Rt.hasOwnProperty(O) && (E[O] = s[O]);
1584
+ if (u && u.defaultProps) {
1585
+ var N = u.defaultProps;
1586
+ for (O in N)
1587
+ E[O] === void 0 && (E[O] = N[O]);
1588
+ }
1589
+ if (w || R) {
1590
+ var j = typeof u == "function" ? u.displayName || u.name || "Unknown" : u;
1591
+ w && Ct(E, j), R && Tt(E, j);
1592
+ }
1593
+ return Nt(u, w, R, x, m, rt.current, E);
1594
+ }
1595
+ }
1596
+ var Ve = T.ReactCurrentOwner, Le = T.ReactDebugCurrentFrame;
1597
+ function he(u) {
1598
+ if (u) {
1599
+ var s = de(u.type);
1600
+ Le.setExtraStackFrame(s);
1601
+ } else
1602
+ Le.setExtraStackFrame(null);
1603
+ }
1604
+ var oe;
1605
+ oe = !1;
1606
+ function ke(u) {
1607
+ return typeof u == "object" && u !== null && u.$$typeof === e;
1608
+ }
1609
+ function je() {
1610
+ {
1611
+ if (Ve.current) {
1612
+ var u = _(Ve.current.type);
1613
+ if (u)
1614
+ return `
1615
+
1616
+ Check the render method of \`` + u + "`.";
1617
+ }
1618
+ return "";
1619
+ }
1620
+ }
1621
+ function nt(u) {
1622
+ return "";
1623
+ }
1624
+ var at = {};
1625
+ function it(u) {
1626
+ {
1627
+ var s = je();
1628
+ if (!s) {
1629
+ var f = typeof u == "string" ? u : u.displayName || u.name;
1630
+ f && (s = `
1631
+
1632
+ Check the top-level render call using <` + f + ">.");
1633
+ }
1634
+ return s;
1635
+ }
1636
+ }
1637
+ function st(u, s) {
1638
+ {
1639
+ if (!u._store || u._store.validated || u.key != null)
1640
+ return;
1641
+ u._store.validated = !0;
1642
+ var f = it(s);
1643
+ if (at[f])
1644
+ return;
1645
+ at[f] = !0;
1646
+ var m = "";
1647
+ u && u._owner && u._owner !== Ve.current && (m = " It was passed a child from " + _(u._owner.type) + "."), he(u), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, m), he(null);
1648
+ }
1649
+ }
1650
+ function He(u, s) {
1651
+ {
1652
+ if (typeof u != "object")
1653
+ return;
1654
+ if (Se(u))
1655
+ for (var f = 0; f < u.length; f++) {
1656
+ var m = u[f];
1657
+ ke(m) && st(m, s);
1658
+ }
1659
+ else if (ke(u))
1660
+ u._store && (u._store.validated = !0);
1661
+ else if (u) {
1662
+ var x = C(u);
1663
+ if (typeof x == "function" && x !== u.entries)
1664
+ for (var O = x.call(u), E; !(E = O.next()).done; )
1665
+ ke(E.value) && st(E.value, s);
1666
+ }
1667
+ }
1668
+ }
1669
+ function ot(u) {
1670
+ {
1671
+ var s = u.type;
1672
+ if (s == null || typeof s == "string")
1673
+ return;
1674
+ var f;
1675
+ if (typeof s == "function")
1676
+ f = s.propTypes;
1677
+ else if (typeof s == "object" && (s.$$typeof === c || // Note: Memo only checks outer props here.
1678
+ // Inner props are checked in the reconciler.
1679
+ s.$$typeof === p))
1680
+ f = s.propTypes;
1681
+ else
1682
+ return;
1683
+ if (f) {
1684
+ var m = _(s);
1685
+ kt(f, u.props, "prop", m, u);
1686
+ } else if (s.PropTypes !== void 0 && !oe) {
1687
+ oe = !0;
1688
+ var x = _(s);
1689
+ P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", x || "Unknown");
1690
+ }
1691
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1692
+ }
1693
+ }
1694
+ function Ft(u) {
1695
+ {
1696
+ for (var s = Object.keys(u.props), f = 0; f < s.length; f++) {
1697
+ var m = s[f];
1698
+ if (m !== "children" && m !== "key") {
1699
+ he(u), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), he(null);
1700
+ break;
1701
+ }
1702
+ }
1703
+ u.ref !== null && (he(u), P("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
1704
+ }
1705
+ }
1706
+ var lt = {};
1707
+ function Ue(u, s, f, m, x, O) {
1708
+ {
1709
+ var E = D(u);
1710
+ if (!E) {
1711
+ var w = "";
1712
+ (u === void 0 || typeof u == "object" && u !== null && Object.keys(u).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1713
+ var R = nt();
1714
+ R ? w += R : w += je();
1715
+ var N;
1716
+ u === null ? N = "null" : Se(u) ? N = "array" : u !== void 0 && u.$$typeof === e ? (N = "<" + (_(u.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : N = typeof u, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, w);
1717
+ }
1718
+ var j = $t(u, s, f, x, O);
1719
+ if (j == null)
1720
+ return j;
1721
+ if (E) {
1722
+ var $ = s.children;
1723
+ if ($ !== void 0)
1724
+ if (m)
1725
+ if (Se($)) {
1726
+ for (var z = 0; z < $.length; z++)
1727
+ He($[z], u);
1728
+ Object.freeze && Object.freeze($);
1729
+ } else
1730
+ P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1731
+ else
1732
+ He($, u);
1733
+ }
1734
+ if (ae.call(s, "key")) {
1735
+ var Q = _(u), B = Object.keys(s).filter(function(At) {
1736
+ return At !== "key";
1737
+ }), K = B.length > 0 ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}";
1738
+ if (!lt[Q + K]) {
1739
+ var Be = B.length > 0 ? "{" + B.join(": ..., ") + ": ...}" : "{}";
1740
+ P(`A props object containing a "key" prop is being spread into JSX:
1741
+ let props = %s;
1742
+ <%s {...props} />
1743
+ React keys must be passed directly to JSX without using spread:
1744
+ let props = %s;
1745
+ <%s key={someKey} {...props} />`, K, Q, Be, Q), lt[Q + K] = !0;
1746
+ }
1747
+ }
1748
+ return u === r ? Ft(j) : ot(j), j;
1749
+ }
1750
+ }
1751
+ function ut(u, s, f) {
1752
+ return Ue(u, s, f, !0);
1753
+ }
1754
+ function Dt(u, s, f) {
1755
+ return Ue(u, s, f, !1);
1756
+ }
1757
+ var _t = Dt, Mt = ut;
1758
+ dt.Fragment = r, dt.jsx = _t, dt.jsxs = Mt;
1759
+ }()), dt;
1760
+ }
1761
+ var ir;
1762
+ function Nn() {
1763
+ return ir || (ir = 1, process.env.NODE_ENV === "production" ? It.exports = /* @__PURE__ */ Cn() : It.exports = /* @__PURE__ */ Tn()), It.exports;
1764
+ }
1765
+ var ht = /* @__PURE__ */ Nn();
1766
+ const ge = ({
1767
+ variant: a = "primary",
1768
+ size: e = "medium",
1769
+ text: t,
1770
+ iconBefore: r,
1771
+ iconAfter: n,
1772
+ className: i,
1773
+ disabled: o = !1,
1774
+ ...l
1775
+ }) => /* @__PURE__ */ ht.jsx(
1776
+ "button",
1777
+ {
1778
+ className: ie(
1779
+ "flex gap-2 justify-center items-center rounded-lg disabled:pointer-events-none",
1780
+ $n(a),
1781
+ Fn(e),
1782
+ i
1783
+ ),
1784
+ disabled: o,
1785
+ ...l,
1786
+ children: /* @__PURE__ */ ht.jsxs(
1787
+ $r.Provider,
1788
+ {
1789
+ value: {
1790
+ size: e === "xsmall" ? 8 : 16,
1791
+ weight: "regular",
1792
+ className: ie(sr(a, o))
1793
+ },
1794
+ children: [
1795
+ r && r,
1796
+ t && /* @__PURE__ */ ht.jsx("span", { className: ie(sr(a, o), Dn(e)), children: t }),
1797
+ n && n
1798
+ ]
1799
+ }
1800
+ )
1801
+ }
1802
+ ), $n = (a) => {
1803
+ switch (a) {
1804
+ case "primary":
1805
+ 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";
1806
+ case "secondary":
1807
+ return "border border-grey-0/0 bg-secondary-action-base-light dark:bg-secondary-action-base-dark hover:bg-system-neutral-grey-8-light dark:hover:bg-system-neutral-grey-8-dark disabled:bg-secondary-action-disabled-light dark:disabled:bg-secondary-action-disabled-dark";
1808
+ case "neutral":
1809
+ return "border border-separator-regular-light dark:border-separator-regular-dark hover:bg-background-universal-overlay-light dark:hover:bg-background-universal-overlay-dark disabled:bg-secondary-action-disabled-light dark:disabled:bg-secondary-action-disabled-dark disabled:border-separator-opaque-light dark:disabled:border-separator-opaque-dark";
1810
+ case "subtle":
1811
+ return "border border-grey-0/0 hover:bg-background-universal-overlay-light dark:hover:bg-background-universal-overlay-dark";
1812
+ }
1813
+ }, sr = (a, e) => {
1814
+ if (e) return "text-label-tertiary-light dark:text-label-tertiary-dark";
1815
+ switch (a) {
1816
+ case "primary":
1817
+ return "text-nonadaptable-text-light";
1818
+ case "secondary":
1819
+ return "text-label-quaternary-light dark:text-label-quaternary-dark";
1820
+ case "neutral":
1821
+ return "text-label-primary-light dark:text-label-primary-dark";
1822
+ case "subtle":
1823
+ return "text-label-primary-light dark:text-label-primary-dark";
1824
+ }
1825
+ }, Fn = (a) => {
1826
+ switch (a) {
1827
+ case "xsmall":
1828
+ return "p-1";
1829
+ case "small":
1830
+ return "p-2";
1831
+ case "medium":
1832
+ return "p-3";
1833
+ }
1834
+ }, Dn = (a) => {
1835
+ switch (a) {
1836
+ case "xsmall":
1837
+ return "text-[10px] leading-[14px]";
1838
+ case "small":
1839
+ return "text-[13px] leading-[14px]";
1840
+ case "medium":
1841
+ return "text-[15px] leading-[16px] -tracking-0,1";
1842
+ }
1843
+ };
1844
+ function Mr(a) {
1845
+ var e, t, r = "";
1846
+ if (typeof a == "string" || typeof a == "number") r += a;
1847
+ else if (typeof a == "object") if (Array.isArray(a)) {
1848
+ var n = a.length;
1849
+ for (e = 0; e < n; e++) a[e] && (t = Mr(a[e])) && (r && (r += " "), r += t);
1850
+ } else for (t in a) a[t] && (r && (r += " "), r += t);
1851
+ return r;
1852
+ }
1853
+ function _n() {
1854
+ for (var a, e, t = 0, r = "", n = arguments.length; t < n; t++) (a = arguments[t]) && (e = Mr(a)) && (r && (r += " "), r += e);
1855
+ return r;
1856
+ }
1857
+ const ie = _n, me = ({ children: a, className: e, variant: t = "B1", significance: r = "primary", as: n }) => {
1858
+ const i = n ?? Mn[t], o = Ar[t];
1859
+ return /* @__PURE__ */ ht.jsx(i, { className: ie("font-sans", An[r], e, o), children: a });
1860
+ }, Ar = {
1861
+ Di1: "text-[72px] font-bold leading-[90px] -tracking-2,5",
1862
+ Di2: "text-[60px] font-bold leading-[72px] -tracking-2,0",
1863
+ Di3: "text-[48px] font-bold leading-[60px] -tracking-1,5",
1864
+ T1: "text-[40px] font-bold leading-[48px] -tracking-1,5",
1865
+ T2: "text-[32px] font-bold leading-[40px] -tracking-1",
1866
+ T3: "text-[24px] font-bold leading-[32px] -tracking-0,5",
1867
+ H1: "text-[24px] font-bold leading-[32px] -tracking-0,5",
1868
+ H2: "text-[20px] font-bold leading-[24px]",
1869
+ H3: "text-[15px] font-bold leading-[20px]",
1870
+ H4: "text-[13px] font-bold leading-[16px]",
1871
+ B1B: "text-[15px] font-bold leading-[24px] -tracking-0,1",
1872
+ B1: "text-[15px] leading-[24px] -tracking-0,1",
1873
+ B1Button: "text-[15px] leading-[16px] -tracking-0,1",
1874
+ B2: "text-[13px] leading-[20px]",
1875
+ B2Button: "text-[13px] leading-[16px]",
1876
+ D1B: "text-[12px] font-bold leading-[16px]",
1877
+ D1: "text-[12px] leading-[16px]",
1878
+ M: "text-[10px] leading-[16px]"
1879
+ }, Mn = {
1880
+ Di1: "h1",
1881
+ Di2: "h2",
1882
+ Di3: "h3",
1883
+ T1: "h1",
1884
+ T2: "h2",
1885
+ T3: "h3",
1886
+ H1: "h1",
1887
+ H2: "h2",
1888
+ H3: "h3",
1889
+ H4: "h4",
1890
+ B1B: "p",
1891
+ B1: "p",
1892
+ B1Button: "span",
1893
+ B2: "p",
1894
+ B2Button: "span",
1895
+ D1B: "p",
1896
+ D1: "p",
1897
+ M: "p"
1898
+ }, An = {
1899
+ primary: "text-label-primary-light dark:text-label-primary-dark",
1900
+ secondary: "text-label-secondary-light dark:text-label-secondary-dark",
1901
+ tertiary: "text-label-tertiary-light dark:text-label-tertiary-dark",
1902
+ quaternary: "text-label-quaternary-light dark:text-label-quaternary-dark",
1903
+ placeholder: "text-label-placeholder-light dark:text-label-placeholder-dark",
1904
+ "nonadaptable-text": "text-nonadaptable-text-light dark:text-nonadaptable-text-dark",
1905
+ disabled: "text-primary-action-disabled-light dark:text-primary-action-disabled-dark"
1906
+ }, Ir = ({
1907
+ title: a,
1908
+ icon: e,
1909
+ description: t,
1910
+ image: r,
1911
+ children: n,
1912
+ onPrevious: i,
1913
+ onNext: o,
1914
+ onQuit: l,
1915
+ isValid: c
1916
+ }) => {
1917
+ const { t: d } = Zt();
1918
+ return /* @__PURE__ */ S.jsxs(
1919
+ "div",
1920
+ {
1921
+ className: ie(
1922
+ "grid mx-4 my-8 rounded-xl border relative",
1923
+ "grid-cols-1 p-4 pt-10",
1924
+ "md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]",
1925
+ r ? "md:grid-cols-2" : "md:grid-cols-1",
1926
+ "border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick-light dark:material-ultra-thick-dark"
1927
+ ),
1928
+ children: [
1929
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col justify-between order-2 md:order-1", children: [
1930
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col", children: [
1931
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col gap-1 md:gap-2 pb-3", children: [
1932
+ e && /* @__PURE__ */ S.jsx(
1933
+ "div",
1934
+ {
1935
+ className: ie("h-8 w-8 rounded-lg overflow-hidden mb-1 md:mb-2", r ? "hidden md:block" : "block"),
1936
+ children: /* @__PURE__ */ S.jsx("img", { className: "w-full h-full object-cover", src: e, alt: "icon" })
1937
+ }
1938
+ ),
1939
+ /* @__PURE__ */ S.jsx(me, { variant: "H2", children: a }),
1940
+ t && t.trim().replace(/\n{3,}/g, `
1941
+
1942
+ `).split(`
1943
+
1944
+ `).map((h, p) => /* @__PURE__ */ S.jsx(me, { significance: "secondary", children: h.trim() }, p))
1945
+ ] }),
1946
+ n
1947
+ ] }),
1948
+ /* @__PURE__ */ S.jsxs("div", { className: "flex justify-end pt-4 gap-2", children: [
1949
+ /* @__PURE__ */ S.jsx(
1950
+ ge,
1951
+ {
1952
+ variant: "subtle",
1953
+ onClick: i,
1954
+ iconBefore: /* @__PURE__ */ S.jsx(Dr, {}),
1955
+ disabled: !i,
1956
+ text: d("Previous")
1957
+ }
1958
+ ),
1959
+ /* @__PURE__ */ S.jsx(
1960
+ ge,
1961
+ {
1962
+ variant: "subtle",
1963
+ onClick: o,
1964
+ iconAfter: /* @__PURE__ */ S.jsx(_r, {}),
1965
+ disabled: !o || !c,
1966
+ text: d("Next")
1967
+ }
1968
+ )
1969
+ ] }),
1970
+ l && /* @__PURE__ */ S.jsx(
1971
+ ge,
1972
+ {
1973
+ className: "absolute top-0 right-1 md:top-1",
1974
+ variant: "subtle",
1975
+ size: "small",
1976
+ onClick: l,
1977
+ iconAfter: /* @__PURE__ */ S.jsx(vt, {}),
1978
+ "aria-label": "quit"
1979
+ }
1980
+ )
1981
+ ] }),
1982
+ r && /* @__PURE__ */ S.jsx("div", { className: "flex flex-col justify-center order-1 md:order-2", children: /* @__PURE__ */ S.jsx("div", { className: "rounded-lg overflow-hidden mb-6 md:mb-0", children: /* @__PURE__ */ S.jsx("img", { className: "w-full h-full object-cover aspect-video md:aspect-square", src: r, alt: "image" }) }) })
1983
+ ]
1984
+ }
1985
+ );
1986
+ }, In = ({
1987
+ title: a,
1988
+ icon: e,
1989
+ description: t,
1990
+ image: r,
1991
+ onPrevious: n,
1992
+ onNext: i,
1993
+ onQuit: o,
1994
+ alternatives: l = [],
1995
+ onAlternativeSelect: c,
1996
+ selectedAlternatives: d,
1997
+ maxAlternatives: h,
1998
+ isValid: p
1999
+ }) => /* @__PURE__ */ S.jsx(
2000
+ Ir,
2001
+ {
2002
+ title: a,
2003
+ icon: e,
2004
+ description: t,
2005
+ image: r,
2006
+ onPrevious: n,
2007
+ onNext: i,
2008
+ onQuit: o,
2009
+ isValid: p,
2010
+ children: /* @__PURE__ */ S.jsx("div", { className: "flex flex-col max-h-[272px] md:max-h-full overflow-y-auto", children: h === 1 ? /* @__PURE__ */ S.jsx("div", { className: "flex flex-col py-3 md:py-4 gap-2 items-end md:items-start", children: l.map((g) => /* @__PURE__ */ S.jsxs(
2011
+ "button",
2012
+ {
2013
+ onClick: () => c(g.id),
2014
+ 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",
2015
+ children: [
2016
+ /* @__PURE__ */ S.jsx(me, { variant: "B1Button", children: g.text }),
2017
+ /* @__PURE__ */ S.jsx(Vn, { size: 20, selected: d.includes(g.id) })
2018
+ ]
2019
+ },
2020
+ g.id
2021
+ )) }) : /* @__PURE__ */ S.jsx("div", { className: "flex py-3 md:py-4 gap-2 justify-end md:justify-start flex-wrap", children: l.map((g) => /* @__PURE__ */ S.jsx(
2022
+ "button",
2023
+ {
2024
+ onClick: () => c(g.id),
2025
+ className: ie(
2026
+ "flex items-center gap-2 p-3 justify-end rounded-lg border",
2027
+ d.includes(g.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"
2028
+ ),
2029
+ children: /* @__PURE__ */ S.jsx(
2030
+ me,
2031
+ {
2032
+ variant: "B1Button",
2033
+ significance: d.includes(g.id) ? "quaternary" : "primary",
2034
+ children: g.text
2035
+ }
2036
+ )
2037
+ },
2038
+ g.id
2039
+ )) }) })
2040
+ }
2041
+ ), Vn = ({ size: a = 16, strokeColor: e = "currentColor", fillColor: t = "none", selected: r = !1 }) => {
2042
+ const n = a + 1, i = n / 2, o = (a - 2) / 2;
2043
+ return /* @__PURE__ */ S.jsxs(
2044
+ "svg",
2045
+ {
2046
+ width: a,
2047
+ height: a,
2048
+ viewBox: `0 0 ${n} ${n}`,
2049
+ fill: r ? t : "none",
2050
+ xmlns: "http://www.w3.org/2000/svg",
2051
+ children: [
2052
+ /* @__PURE__ */ S.jsx(
2053
+ "circle",
2054
+ {
2055
+ cx: i,
2056
+ cy: i,
2057
+ r: o,
2058
+ stroke: e,
2059
+ strokeWidth: "1.5",
2060
+ strokeLinecap: "round",
2061
+ strokeLinejoin: "round"
2062
+ }
2063
+ ),
2064
+ r && /* @__PURE__ */ S.jsx(
2065
+ "circle",
2066
+ {
2067
+ cx: i,
2068
+ cy: i,
2069
+ r: o - 3,
2070
+ fill: e
2071
+ }
2072
+ )
2073
+ ]
2074
+ }
2075
+ );
2076
+ }, Hn = ({
2077
+ title: a,
2078
+ icon: e,
2079
+ description: t,
2080
+ image: r,
2081
+ onPrevious: n,
2082
+ onNext: i,
2083
+ onQuit: o,
2084
+ inputText: l,
2085
+ setInputText: c,
2086
+ maxCharacters: d,
2087
+ isValid: h
2088
+ }) => {
2089
+ const { t: p } = Zt();
2090
+ return /* @__PURE__ */ S.jsx(
2091
+ Ir,
2092
+ {
2093
+ title: a,
2094
+ icon: e,
2095
+ description: t,
2096
+ image: r,
2097
+ onPrevious: n,
2098
+ onNext: i,
2099
+ onQuit: o,
2100
+ isValid: h,
2101
+ children: /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col py-3 gap-2", children: [
2102
+ d && /* @__PURE__ */ S.jsxs("div", { className: "flex items-center justify-between", children: [
2103
+ /* @__PURE__ */ S.jsx(me, { significance: "secondary", children: p("Max {{maxCharacters}} characters", { maxCharacters: d }) }),
2104
+ /* @__PURE__ */ S.jsx(me, { significance: "secondary", children: `${l.length}/${d}` })
2105
+ ] }),
2106
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col relative", children: [
2107
+ /* @__PURE__ */ S.jsx(
2108
+ me,
2109
+ {
2110
+ as: "div",
2111
+ className: ie(
2112
+ "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"
2113
+ ),
2114
+ children: l
2115
+ }
2116
+ ),
2117
+ /* @__PURE__ */ S.jsx(
2118
+ "textarea",
2119
+ {
2120
+ id: "primary",
2121
+ placeholder: p("Type your answer here"),
2122
+ className: ie(
2123
+ "absolute inset-0 resize-none",
2124
+ "overflow-hidden break-words outline-none resize-none bg-grey-0/0",
2125
+ "rounded-lg py-3 px-4 min-h-20 border border-separator-opaque-light dark:border-separator-opaque-dark",
2126
+ "text-label-primary-light dark:text-label-primary-dark",
2127
+ Ar.B1
2128
+ ),
2129
+ value: l,
2130
+ onChange: (g) => c(g.target.value)
2131
+ }
2132
+ )
2133
+ ] })
2134
+ ] })
2135
+ }
2136
+ );
2137
+ }, Vr = ({ title: a, icon: e, description: t, image: r, children: n, wrapperClassName: i }) => /* @__PURE__ */ S.jsxs(
2138
+ "div",
2139
+ {
2140
+ className: ie(
2141
+ "grid mx-4 my-8 rounded-xl border",
2142
+ "grid-cols-1 p-4 pt-10",
2143
+ "md:p-8 md:gap-16 md:max-w-[960px] md:min-w-[660px]",
2144
+ r ? "md:grid-cols-2" : "md:grid-cols-1",
2145
+ "border-separator-opaque-light dark:border-separator-opaque-dark material-ultra-thick-light dark:material-ultra-thick-dark",
2146
+ i
2147
+ ),
2148
+ children: [
2149
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col justify-between gap-6 md:gap-8 order-2 md:order-1", children: [
2150
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col gap-6 md:gap-8", children: [
2151
+ /* @__PURE__ */ S.jsxs("div", { className: "flex flex-col gap-2 md:gap-4", children: [
2152
+ e && /* @__PURE__ */ S.jsx("div", { className: ie("h-8 w-8 rounded-lg overflow-hidden", r ? "hidden md:block" : "block"), children: /* @__PURE__ */ S.jsx("img", { className: "w-full h-full object-cover", src: e, alt: "icon" }) }),
2153
+ /* @__PURE__ */ S.jsx(me, { variant: "H2", children: a })
2154
+ ] }),
2155
+ t && t.trim().replace(/\n{3,}/g, `
2156
+
2157
+ `).split(`
2158
+
2159
+ `).map((o, l) => /* @__PURE__ */ S.jsx(me, { children: o.trim() }, l))
2160
+ ] }),
2161
+ n
2162
+ ] }),
2163
+ r && /* @__PURE__ */ S.jsx("div", { className: "flex flex-col justify-center order-1 md:order-2", children: /* @__PURE__ */ S.jsx("div", { className: "rounded-lg overflow-hidden mb-6 md:mb-0", children: /* @__PURE__ */ S.jsx("img", { className: "w-full h-full object-cover aspect-video md:aspect-square", src: r, alt: "image" }) }) })
2164
+ ]
2165
+ }
2166
+ ), Un = ({ title: a, icon: e, description: t, image: r, quitText: n, onQuit: i, externalLink: o }) => /* @__PURE__ */ S.jsxs(Vr, { title: a, icon: e, description: t, image: r, children: [
2167
+ /* @__PURE__ */ S.jsx("div", { className: "flex justify-end gap-2", children: o ? /* @__PURE__ */ S.jsx(
2168
+ ge,
2169
+ {
2170
+ variant: "secondary",
2171
+ text: n,
2172
+ iconAfter: /* @__PURE__ */ S.jsx(Fr, {}),
2173
+ onClick: () => {
2174
+ window.open(o, "_blank"), i == null || i();
2175
+ }
2176
+ }
2177
+ ) : /* @__PURE__ */ S.jsx(ge, { variant: "secondary", onClick: i, text: n }) }),
2178
+ i && /* @__PURE__ */ S.jsx(
2179
+ ge,
2180
+ {
2181
+ className: "absolute -top-2 -right-2 md:-top-4 md:-right-4",
2182
+ variant: "secondary",
2183
+ size: "small",
2184
+ onClick: i,
2185
+ iconAfter: /* @__PURE__ */ S.jsx(vt, {}),
2186
+ "aria-label": "quit"
2187
+ }
2188
+ )
2189
+ ] }), Bn = ({
2190
+ title: a,
2191
+ icon: e,
2192
+ description: t,
2193
+ image: r,
2194
+ quitText: n,
2195
+ onQuit: i,
2196
+ startText: o,
2197
+ onStart: l
2198
+ }) => /* @__PURE__ */ S.jsxs(Vr, { title: a, icon: e, description: t, image: r, wrapperClassName: "relative", children: [
2199
+ /* @__PURE__ */ S.jsxs("div", { className: "flex justify-end gap-2", children: [
2200
+ i && n && /* @__PURE__ */ S.jsx(ge, { variant: "subtle", text: n, onClick: i }),
2201
+ /* @__PURE__ */ S.jsx(ge, { variant: "secondary", text: o, onClick: l })
2202
+ ] }),
2203
+ i && /* @__PURE__ */ S.jsx(
2204
+ ge,
2205
+ {
2206
+ className: "absolute top-0 right-1 md:top-1",
2207
+ variant: "subtle",
2208
+ size: "small",
2209
+ onClick: i,
2210
+ iconAfter: /* @__PURE__ */ S.jsx(vt, {}),
2211
+ "aria-label": "quit"
2212
+ }
2213
+ )
2214
+ ] });
2215
+ let Hr = {};
2216
+ function Wn() {
2217
+ return Hr;
2218
+ }
2219
+ function zn(a) {
2220
+ Hr = a;
2221
+ }
2222
+ const qn = {
2223
+ lessThanXSeconds: {
2224
+ one: "less than a second",
2225
+ other: "less than {{count}} seconds"
2226
+ },
2227
+ xSeconds: {
2228
+ one: "1 second",
2229
+ other: "{{count}} seconds"
2230
+ },
2231
+ halfAMinute: "half a minute",
2232
+ lessThanXMinutes: {
2233
+ one: "less than a minute",
2234
+ other: "less than {{count}} minutes"
2235
+ },
2236
+ xMinutes: {
2237
+ one: "1 minute",
2238
+ other: "{{count}} minutes"
2239
+ },
2240
+ aboutXHours: {
2241
+ one: "about 1 hour",
2242
+ other: "about {{count}} hours"
2243
+ },
2244
+ xHours: {
2245
+ one: "1 hour",
2246
+ other: "{{count}} hours"
2247
+ },
2248
+ xDays: {
2249
+ one: "1 day",
2250
+ other: "{{count}} days"
2251
+ },
2252
+ aboutXWeeks: {
2253
+ one: "about 1 week",
2254
+ other: "about {{count}} weeks"
2255
+ },
2256
+ xWeeks: {
2257
+ one: "1 week",
2258
+ other: "{{count}} weeks"
2259
+ },
2260
+ aboutXMonths: {
2261
+ one: "about 1 month",
2262
+ other: "about {{count}} months"
2263
+ },
2264
+ xMonths: {
2265
+ one: "1 month",
2266
+ other: "{{count}} months"
2267
+ },
2268
+ aboutXYears: {
2269
+ one: "about 1 year",
2270
+ other: "about {{count}} years"
2271
+ },
2272
+ xYears: {
2273
+ one: "1 year",
2274
+ other: "{{count}} years"
2275
+ },
2276
+ overXYears: {
2277
+ one: "over 1 year",
2278
+ other: "over {{count}} years"
2279
+ },
2280
+ almostXYears: {
2281
+ one: "almost 1 year",
2282
+ other: "almost {{count}} years"
2283
+ }
2284
+ }, Kn = (a, e, t) => {
2285
+ let r;
2286
+ const n = qn[a];
2287
+ return typeof n == "string" ? r = n : e === 1 ? r = n.one : r = n.other.replace("{{count}}", e.toString()), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "in " + r : r + " ago" : r;
2288
+ };
2289
+ function Vt(a) {
2290
+ return (e = {}) => {
2291
+ const t = e.width ? String(e.width) : a.defaultWidth;
2292
+ return a.formats[t] || a.formats[a.defaultWidth];
2293
+ };
2294
+ }
2295
+ const Jn = {
2296
+ lastWeek: "'last' eeee 'at' p",
2297
+ yesterday: "'yesterday at' p",
2298
+ today: "'today at' p",
2299
+ tomorrow: "'tomorrow at' p",
2300
+ nextWeek: "eeee 'at' p",
2301
+ other: "P"
2302
+ }, Zn = (a, e, t, r) => Jn[a];
2303
+ function Ke(a) {
2304
+ return (e, t) => {
2305
+ const r = t != null && t.context ? String(t.context) : "standalone";
2306
+ let n;
2307
+ if (r === "formatting" && a.formattingValues) {
2308
+ const o = a.defaultFormattingWidth || a.defaultWidth, l = t != null && t.width ? String(t.width) : o;
2309
+ n = a.formattingValues[l] || a.formattingValues[o];
2310
+ } else {
2311
+ const o = a.defaultWidth, l = t != null && t.width ? String(t.width) : a.defaultWidth;
2312
+ n = a.values[l] || a.values[o];
2313
+ }
2314
+ const i = a.argumentCallback ? a.argumentCallback(e) : e;
2315
+ return n[i];
2316
+ };
2317
+ }
2318
+ const Yn = {
2319
+ narrow: ["B", "A"],
2320
+ abbreviated: ["BC", "AD"],
2321
+ wide: ["Before Christ", "Anno Domini"]
2322
+ }, Xn = {
2323
+ narrow: ["1", "2", "3", "4"],
2324
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
2325
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
2326
+ }, Gn = {
2327
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
2328
+ abbreviated: [
2329
+ "Jan",
2330
+ "Feb",
2331
+ "Mar",
2332
+ "Apr",
2333
+ "May",
2334
+ "Jun",
2335
+ "Jul",
2336
+ "Aug",
2337
+ "Sep",
2338
+ "Oct",
2339
+ "Nov",
2340
+ "Dec"
2341
+ ],
2342
+ wide: [
2343
+ "January",
2344
+ "February",
2345
+ "March",
2346
+ "April",
2347
+ "May",
2348
+ "June",
2349
+ "July",
2350
+ "August",
2351
+ "September",
2352
+ "October",
2353
+ "November",
2354
+ "December"
2355
+ ]
2356
+ }, Qn = {
2357
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
2358
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
2359
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
2360
+ wide: [
2361
+ "Sunday",
2362
+ "Monday",
2363
+ "Tuesday",
2364
+ "Wednesday",
2365
+ "Thursday",
2366
+ "Friday",
2367
+ "Saturday"
2368
+ ]
2369
+ }, ea = {
2370
+ narrow: {
2371
+ am: "a",
2372
+ pm: "p",
2373
+ midnight: "mi",
2374
+ noon: "n",
2375
+ morning: "morning",
2376
+ afternoon: "afternoon",
2377
+ evening: "evening",
2378
+ night: "night"
2379
+ },
2380
+ abbreviated: {
2381
+ am: "AM",
2382
+ pm: "PM",
2383
+ midnight: "midnight",
2384
+ noon: "noon",
2385
+ morning: "morning",
2386
+ afternoon: "afternoon",
2387
+ evening: "evening",
2388
+ night: "night"
2389
+ },
2390
+ wide: {
2391
+ am: "a.m.",
2392
+ pm: "p.m.",
2393
+ midnight: "midnight",
2394
+ noon: "noon",
2395
+ morning: "morning",
2396
+ afternoon: "afternoon",
2397
+ evening: "evening",
2398
+ night: "night"
2399
+ }
2400
+ }, ta = {
2401
+ narrow: {
2402
+ am: "a",
2403
+ pm: "p",
2404
+ midnight: "mi",
2405
+ noon: "n",
2406
+ morning: "in the morning",
2407
+ afternoon: "in the afternoon",
2408
+ evening: "in the evening",
2409
+ night: "at night"
2410
+ },
2411
+ abbreviated: {
2412
+ am: "AM",
2413
+ pm: "PM",
2414
+ midnight: "midnight",
2415
+ noon: "noon",
2416
+ morning: "in the morning",
2417
+ afternoon: "in the afternoon",
2418
+ evening: "in the evening",
2419
+ night: "at night"
2420
+ },
2421
+ wide: {
2422
+ am: "a.m.",
2423
+ pm: "p.m.",
2424
+ midnight: "midnight",
2425
+ noon: "noon",
2426
+ morning: "in the morning",
2427
+ afternoon: "in the afternoon",
2428
+ evening: "in the evening",
2429
+ night: "at night"
2430
+ }
2431
+ }, ra = (a, e) => {
2432
+ const t = Number(a), r = t % 100;
2433
+ if (r > 20 || r < 10)
2434
+ switch (r % 10) {
2435
+ case 1:
2436
+ return t + "st";
2437
+ case 2:
2438
+ return t + "nd";
2439
+ case 3:
2440
+ return t + "rd";
2441
+ }
2442
+ return t + "th";
2443
+ }, na = {
2444
+ ordinalNumber: ra,
2445
+ era: Ke({
2446
+ values: Yn,
2447
+ defaultWidth: "wide"
2448
+ }),
2449
+ quarter: Ke({
2450
+ values: Xn,
2451
+ defaultWidth: "wide",
2452
+ argumentCallback: (a) => a - 1
2453
+ }),
2454
+ month: Ke({
2455
+ values: Gn,
2456
+ defaultWidth: "wide"
2457
+ }),
2458
+ day: Ke({
2459
+ values: Qn,
2460
+ defaultWidth: "wide"
2461
+ }),
2462
+ dayPeriod: Ke({
2463
+ values: ea,
2464
+ defaultWidth: "wide",
2465
+ formattingValues: ta,
2466
+ defaultFormattingWidth: "wide"
2467
+ })
2468
+ };
2469
+ function Je(a) {
2470
+ return (e, t = {}) => {
2471
+ const r = t.width, n = r && a.matchPatterns[r] || a.matchPatterns[a.defaultMatchWidth], i = e.match(n);
2472
+ if (!i)
2473
+ return null;
2474
+ const o = i[0], l = r && a.parsePatterns[r] || a.parsePatterns[a.defaultParseWidth], c = Array.isArray(l) ? ia(l, (p) => p.test(o)) : (
2475
+ // [TODO] -- I challenge you to fix the type
2476
+ aa(l, (p) => p.test(o))
2477
+ );
2478
+ let d;
2479
+ d = a.valueCallback ? a.valueCallback(c) : c, d = t.valueCallback ? (
2480
+ // [TODO] -- I challenge you to fix the type
2481
+ t.valueCallback(d)
2482
+ ) : d;
2483
+ const h = e.slice(o.length);
2484
+ return { value: d, rest: h };
2485
+ };
2486
+ }
2487
+ function aa(a, e) {
2488
+ for (const t in a)
2489
+ if (Object.prototype.hasOwnProperty.call(a, t) && e(a[t]))
2490
+ return t;
2491
+ }
2492
+ function ia(a, e) {
2493
+ for (let t = 0; t < a.length; t++)
2494
+ if (e(a[t]))
2495
+ return t;
2496
+ }
2497
+ function sa(a) {
2498
+ return (e, t = {}) => {
2499
+ const r = e.match(a.matchPattern);
2500
+ if (!r) return null;
2501
+ const n = r[0], i = e.match(a.parsePattern);
2502
+ if (!i) return null;
2503
+ let o = a.valueCallback ? a.valueCallback(i[0]) : i[0];
2504
+ o = t.valueCallback ? t.valueCallback(o) : o;
2505
+ const l = e.slice(n.length);
2506
+ return { value: o, rest: l };
2507
+ };
2508
+ }
2509
+ const oa = /^(\d+)(th|st|nd|rd)?/i, la = /\d+/i, ua = {
2510
+ narrow: /^(b|a)/i,
2511
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
2512
+ wide: /^(before christ|before common era|anno domini|common era)/i
2513
+ }, ca = {
2514
+ any: [/^b/i, /^(a|c)/i]
2515
+ }, da = {
2516
+ narrow: /^[1234]/i,
2517
+ abbreviated: /^q[1234]/i,
2518
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2519
+ }, fa = {
2520
+ any: [/1/i, /2/i, /3/i, /4/i]
2521
+ }, ha = {
2522
+ narrow: /^[jfmasond]/i,
2523
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
2524
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
2525
+ }, pa = {
2526
+ narrow: [
2527
+ /^j/i,
2528
+ /^f/i,
2529
+ /^m/i,
2530
+ /^a/i,
2531
+ /^m/i,
2532
+ /^j/i,
2533
+ /^j/i,
2534
+ /^a/i,
2535
+ /^s/i,
2536
+ /^o/i,
2537
+ /^n/i,
2538
+ /^d/i
2539
+ ],
2540
+ any: [
2541
+ /^ja/i,
2542
+ /^f/i,
2543
+ /^mar/i,
2544
+ /^ap/i,
2545
+ /^may/i,
2546
+ /^jun/i,
2547
+ /^jul/i,
2548
+ /^au/i,
2549
+ /^s/i,
2550
+ /^o/i,
2551
+ /^n/i,
2552
+ /^d/i
2553
+ ]
2554
+ }, ga = {
2555
+ narrow: /^[smtwf]/i,
2556
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
2557
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
2558
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
2559
+ }, ma = {
2560
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
2561
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
2562
+ }, ya = {
2563
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
2564
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
2565
+ }, va = {
2566
+ any: {
2567
+ am: /^a/i,
2568
+ pm: /^p/i,
2569
+ midnight: /^mi/i,
2570
+ noon: /^no/i,
2571
+ morning: /morning/i,
2572
+ afternoon: /afternoon/i,
2573
+ evening: /evening/i,
2574
+ night: /night/i
2575
+ }
2576
+ }, ba = {
2577
+ ordinalNumber: sa({
2578
+ matchPattern: oa,
2579
+ parsePattern: la,
2580
+ valueCallback: (a) => parseInt(a, 10)
2581
+ }),
2582
+ era: Je({
2583
+ matchPatterns: ua,
2584
+ defaultMatchWidth: "wide",
2585
+ parsePatterns: ca,
2586
+ defaultParseWidth: "any"
2587
+ }),
2588
+ quarter: Je({
2589
+ matchPatterns: da,
2590
+ defaultMatchWidth: "wide",
2591
+ parsePatterns: fa,
2592
+ defaultParseWidth: "any",
2593
+ valueCallback: (a) => a + 1
2594
+ }),
2595
+ month: Je({
2596
+ matchPatterns: ha,
2597
+ defaultMatchWidth: "wide",
2598
+ parsePatterns: pa,
2599
+ defaultParseWidth: "any"
2600
+ }),
2601
+ day: Je({
2602
+ matchPatterns: ga,
2603
+ defaultMatchWidth: "wide",
2604
+ parsePatterns: ma,
2605
+ defaultParseWidth: "any"
2606
+ }),
2607
+ dayPeriod: Je({
2608
+ matchPatterns: ya,
2609
+ defaultMatchWidth: "any",
2610
+ parsePatterns: va,
2611
+ defaultParseWidth: "any"
2612
+ })
2613
+ };
2614
+ function xa(a) {
2615
+ const e = {}, t = Wn();
2616
+ for (const r in t)
2617
+ Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
2618
+ for (const r in a)
2619
+ Object.prototype.hasOwnProperty.call(a, r) && (a[r] === void 0 ? delete e[r] : e[r] = a[r]);
2620
+ zn(e);
2621
+ }
2622
+ const wa = {
2623
+ full: "EEEE, d MMMM yyyy",
2624
+ long: "d MMMM yyyy",
2625
+ medium: "d MMM yyyy",
2626
+ short: "dd/MM/yyyy"
2627
+ }, Sa = {
2628
+ full: "HH:mm:ss zzzz",
2629
+ long: "HH:mm:ss z",
2630
+ medium: "HH:mm:ss",
2631
+ short: "HH:mm"
2632
+ }, ka = {
2633
+ full: "{{date}} 'at' {{time}}",
2634
+ long: "{{date}} 'at' {{time}}",
2635
+ medium: "{{date}}, {{time}}",
2636
+ short: "{{date}}, {{time}}"
2637
+ }, Ea = {
2638
+ date: Vt({
2639
+ formats: wa,
2640
+ defaultWidth: "full"
2641
+ }),
2642
+ time: Vt({
2643
+ formats: Sa,
2644
+ defaultWidth: "full"
2645
+ }),
2646
+ dateTime: Vt({
2647
+ formats: ka,
2648
+ defaultWidth: "full"
2649
+ })
2650
+ }, Oa = {
2651
+ code: "en-GB",
2652
+ formatDistance: Kn,
2653
+ formatLong: Ea,
2654
+ formatRelative: Zn,
2655
+ localize: na,
2656
+ match: ba,
2657
+ options: {
2658
+ weekStartsOn: 1,
2659
+ firstWeekContainsDate: 4
2660
+ }
2661
+ }, L = (a) => typeof a == "string", Ze = () => {
2662
+ let a, e;
2663
+ const t = new Promise((r, n) => {
2664
+ a = r, e = n;
2665
+ });
2666
+ return t.resolve = a, t.reject = e, t;
2667
+ }, or = (a) => a == null ? "" : "" + a, Pa = (a, e, t) => {
2668
+ a.forEach((r) => {
2669
+ e[r] && (t[r] = e[r]);
2670
+ });
2671
+ }, Ra = /###/g, lr = (a) => a && a.indexOf("###") > -1 ? a.replace(Ra, ".") : a, ur = (a) => !a || L(a), Xe = (a, e, t) => {
2672
+ const r = L(e) ? e.split(".") : e;
2673
+ let n = 0;
2674
+ for (; n < r.length - 1; ) {
2675
+ if (ur(a)) return {};
2676
+ const i = lr(r[n]);
2677
+ !a[i] && t && (a[i] = new t()), Object.prototype.hasOwnProperty.call(a, i) ? a = a[i] : a = {}, ++n;
2678
+ }
2679
+ return ur(a) ? {} : {
2680
+ obj: a,
2681
+ k: lr(r[n])
2682
+ };
2683
+ }, cr = (a, e, t) => {
2684
+ const {
2685
+ obj: r,
2686
+ k: n
2687
+ } = Xe(a, e, Object);
2688
+ if (r !== void 0 || e.length === 1) {
2689
+ r[n] = t;
2690
+ return;
2691
+ }
2692
+ let i = e[e.length - 1], o = e.slice(0, e.length - 1), l = Xe(a, o, Object);
2693
+ for (; l.obj === void 0 && o.length; )
2694
+ i = `${o[o.length - 1]}.${i}`, o = o.slice(0, o.length - 1), l = Xe(a, o, Object), l != null && l.obj && typeof l.obj[`${l.k}.${i}`] < "u" && (l.obj = void 0);
2695
+ l.obj[`${l.k}.${i}`] = t;
2696
+ }, La = (a, e, t, r) => {
2697
+ const {
2698
+ obj: n,
2699
+ k: i
2700
+ } = Xe(a, e, Object);
2701
+ n[i] = n[i] || [], n[i].push(t);
2702
+ }, gt = (a, e) => {
2703
+ const {
2704
+ obj: t,
2705
+ k: r
2706
+ } = Xe(a, e);
2707
+ if (t && Object.prototype.hasOwnProperty.call(t, r))
2708
+ return t[r];
2709
+ }, ja = (a, e, t) => {
2710
+ const r = gt(a, t);
2711
+ return r !== void 0 ? r : gt(e, t);
2712
+ }, Ur = (a, e, t) => {
2713
+ for (const r in e)
2714
+ r !== "__proto__" && r !== "constructor" && (r in a ? L(a[r]) || a[r] instanceof String || L(e[r]) || e[r] instanceof String ? t && (a[r] = e[r]) : Ur(a[r], e[r], t) : a[r] = e[r]);
2715
+ return a;
2716
+ }, Te = (a) => a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
2717
+ var Ca = {
2718
+ "&": "&amp;",
2719
+ "<": "&lt;",
2720
+ ">": "&gt;",
2721
+ '"': "&quot;",
2722
+ "'": "&#39;",
2723
+ "/": "&#x2F;"
2724
+ };
2725
+ const Ta = (a) => L(a) ? a.replace(/[&<>"'\/]/g, (e) => Ca[e]) : a;
2726
+ class Na {
2727
+ constructor(e) {
2728
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
2729
+ }
2730
+ getRegExp(e) {
2731
+ const t = this.regExpMap.get(e);
2732
+ if (t !== void 0)
2733
+ return t;
2734
+ const r = new RegExp(e);
2735
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, r), this.regExpQueue.push(e), r;
2736
+ }
2737
+ }
2738
+ const $a = [" ", ",", "?", "!", ";"], Fa = new Na(20), Da = (a, e, t) => {
2739
+ e = e || "", t = t || "";
2740
+ const r = $a.filter((o) => e.indexOf(o) < 0 && t.indexOf(o) < 0);
2741
+ if (r.length === 0) return !0;
2742
+ const n = Fa.getRegExp(`(${r.map((o) => o === "?" ? "\\?" : o).join("|")})`);
2743
+ let i = !n.test(a);
2744
+ if (!i) {
2745
+ const o = a.indexOf(t);
2746
+ o > 0 && !n.test(a.substring(0, o)) && (i = !0);
2747
+ }
2748
+ return i;
2749
+ }, qt = (a, e, t = ".") => {
2750
+ if (!a) return;
2751
+ if (a[e])
2752
+ return Object.prototype.hasOwnProperty.call(a, e) ? a[e] : void 0;
2753
+ const r = e.split(t);
2754
+ let n = a;
2755
+ for (let i = 0; i < r.length; ) {
2756
+ if (!n || typeof n != "object")
2757
+ return;
2758
+ let o, l = "";
2759
+ for (let c = i; c < r.length; ++c)
2760
+ if (c !== i && (l += t), l += r[c], o = n[l], o !== void 0) {
2761
+ if (["string", "number", "boolean"].indexOf(typeof o) > -1 && c < r.length - 1)
2762
+ continue;
2763
+ i += c - i + 1;
2764
+ break;
2765
+ }
2766
+ n = o;
2767
+ }
2768
+ return n;
2769
+ }, Ge = (a) => a == null ? void 0 : a.replace("_", "-"), _a = {
2770
+ type: "logger",
2771
+ log(a) {
2772
+ this.output("log", a);
2773
+ },
2774
+ warn(a) {
2775
+ this.output("warn", a);
2776
+ },
2777
+ error(a) {
2778
+ this.output("error", a);
2779
+ },
2780
+ output(a, e) {
2781
+ var t, r;
2782
+ (r = (t = console == null ? void 0 : console[a]) == null ? void 0 : t.apply) == null || r.call(t, console, e);
2783
+ }
2784
+ };
2785
+ let Ma = class Kt {
2786
+ constructor(e, t = {}) {
2787
+ this.init(e, t);
2788
+ }
2789
+ init(e, t = {}) {
2790
+ this.prefix = t.prefix || "i18next:", this.logger = e || _a, this.options = t, this.debug = t.debug;
2791
+ }
2792
+ log(...e) {
2793
+ return this.forward(e, "log", "", !0);
2794
+ }
2795
+ warn(...e) {
2796
+ return this.forward(e, "warn", "", !0);
2797
+ }
2798
+ error(...e) {
2799
+ return this.forward(e, "error", "");
2800
+ }
2801
+ deprecate(...e) {
2802
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
2803
+ }
2804
+ forward(e, t, r, n) {
2805
+ return n && !this.debug ? null : (L(e[0]) && (e[0] = `${r}${this.prefix} ${e[0]}`), this.logger[t](e));
2806
+ }
2807
+ create(e) {
2808
+ return new Kt(this.logger, {
2809
+ prefix: `${this.prefix}:${e}:`,
2810
+ ...this.options
2811
+ });
2812
+ }
2813
+ clone(e) {
2814
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new Kt(this.logger, e);
2815
+ }
2816
+ };
2817
+ var le = new Ma();
2818
+ class bt {
2819
+ constructor() {
2820
+ this.observers = {};
2821
+ }
2822
+ on(e, t) {
2823
+ return e.split(" ").forEach((r) => {
2824
+ this.observers[r] || (this.observers[r] = /* @__PURE__ */ new Map());
2825
+ const n = this.observers[r].get(t) || 0;
2826
+ this.observers[r].set(t, n + 1);
2827
+ }), this;
2828
+ }
2829
+ off(e, t) {
2830
+ if (this.observers[e]) {
2831
+ if (!t) {
2832
+ delete this.observers[e];
2833
+ return;
2834
+ }
2835
+ this.observers[e].delete(t);
2836
+ }
2837
+ }
2838
+ emit(e, ...t) {
2839
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([n, i]) => {
2840
+ for (let o = 0; o < i; o++)
2841
+ n(...t);
2842
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, i]) => {
2843
+ for (let o = 0; o < i; o++)
2844
+ n.apply(n, [e, ...t]);
2845
+ });
2846
+ }
2847
+ }
2848
+ class dr extends bt {
2849
+ constructor(e, t = {
2850
+ ns: ["translation"],
2851
+ defaultNS: "translation"
2852
+ }) {
2853
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
2854
+ }
2855
+ addNamespaces(e) {
2856
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
2857
+ }
2858
+ removeNamespaces(e) {
2859
+ const t = this.options.ns.indexOf(e);
2860
+ t > -1 && this.options.ns.splice(t, 1);
2861
+ }
2862
+ getResource(e, t, r, n = {}) {
2863
+ var d, h;
2864
+ const i = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, o = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
2865
+ let l;
2866
+ e.indexOf(".") > -1 ? l = e.split(".") : (l = [e, t], r && (Array.isArray(r) ? l.push(...r) : L(r) && i ? l.push(...r.split(i)) : l.push(r)));
2867
+ const c = gt(this.data, l);
2868
+ return !c && !t && !r && e.indexOf(".") > -1 && (e = l[0], t = l[1], r = l.slice(2).join(".")), c || !o || !L(r) ? c : qt((h = (d = this.data) == null ? void 0 : d[e]) == null ? void 0 : h[t], r, i);
2869
+ }
2870
+ addResource(e, t, r, n, i = {
2871
+ silent: !1
2872
+ }) {
2873
+ const o = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator;
2874
+ let l = [e, t];
2875
+ r && (l = l.concat(o ? r.split(o) : r)), e.indexOf(".") > -1 && (l = e.split("."), n = t, t = l[1]), this.addNamespaces(t), cr(this.data, l, n), i.silent || this.emit("added", e, t, r, n);
2876
+ }
2877
+ addResources(e, t, r, n = {
2878
+ silent: !1
2879
+ }) {
2880
+ for (const i in r)
2881
+ (L(r[i]) || Array.isArray(r[i])) && this.addResource(e, t, i, r[i], {
2882
+ silent: !0
2883
+ });
2884
+ n.silent || this.emit("added", e, t, r);
2885
+ }
2886
+ addResourceBundle(e, t, r, n, i, o = {
2887
+ silent: !1,
2888
+ skipCopy: !1
2889
+ }) {
2890
+ let l = [e, t];
2891
+ e.indexOf(".") > -1 && (l = e.split("."), n = r, r = t, t = l[1]), this.addNamespaces(t);
2892
+ let c = gt(this.data, l) || {};
2893
+ o.skipCopy || (r = JSON.parse(JSON.stringify(r))), n ? Ur(c, r, i) : c = {
2894
+ ...c,
2895
+ ...r
2896
+ }, cr(this.data, l, c), o.silent || this.emit("added", e, t, r);
2897
+ }
2898
+ removeResourceBundle(e, t) {
2899
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
2900
+ }
2901
+ hasResourceBundle(e, t) {
2902
+ return this.getResource(e, t) !== void 0;
2903
+ }
2904
+ getResourceBundle(e, t) {
2905
+ return t || (t = this.options.defaultNS), this.getResource(e, t);
2906
+ }
2907
+ getDataByLanguage(e) {
2908
+ return this.data[e];
2909
+ }
2910
+ hasLanguageSomeTranslations(e) {
2911
+ const t = this.getDataByLanguage(e);
2912
+ return !!(t && Object.keys(t) || []).find((n) => t[n] && Object.keys(t[n]).length > 0);
2913
+ }
2914
+ toJSON() {
2915
+ return this.data;
2916
+ }
2917
+ }
2918
+ var Br = {
2919
+ processors: {},
2920
+ addPostProcessor(a) {
2921
+ this.processors[a.name] = a;
2922
+ },
2923
+ handle(a, e, t, r, n) {
2924
+ return a.forEach((i) => {
2925
+ var o;
2926
+ e = ((o = this.processors[i]) == null ? void 0 : o.process(e, t, r, n)) ?? e;
2927
+ }), e;
2928
+ }
2929
+ };
2930
+ const fr = {}, hr = (a) => !L(a) && typeof a != "boolean" && typeof a != "number";
2931
+ class mt extends bt {
2932
+ constructor(e, t = {}) {
2933
+ super(), Pa(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = le.create("translator");
2934
+ }
2935
+ changeLanguage(e) {
2936
+ e && (this.language = e);
2937
+ }
2938
+ exists(e, t = {
2939
+ interpolation: {}
2940
+ }) {
2941
+ const r = {
2942
+ ...t
2943
+ };
2944
+ if (e == null) return !1;
2945
+ const n = this.resolve(e, r);
2946
+ return (n == null ? void 0 : n.res) !== void 0;
2947
+ }
2948
+ extractFromKey(e, t) {
2949
+ let r = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
2950
+ r === void 0 && (r = ":");
2951
+ const n = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
2952
+ let i = t.ns || this.options.defaultNS || [];
2953
+ const o = r && e.indexOf(r) > -1, l = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Da(e, r, n);
2954
+ if (o && !l) {
2955
+ const c = e.match(this.interpolator.nestingRegexp);
2956
+ if (c && c.length > 0)
2957
+ return {
2958
+ key: e,
2959
+ namespaces: L(i) ? [i] : i
2960
+ };
2961
+ const d = e.split(r);
2962
+ (r !== n || r === n && this.options.ns.indexOf(d[0]) > -1) && (i = d.shift()), e = d.join(n);
2963
+ }
2964
+ return {
2965
+ key: e,
2966
+ namespaces: L(i) ? [i] : i
2967
+ };
2968
+ }
2969
+ translate(e, t, r) {
2970
+ let n = typeof t == "object" ? {
2971
+ ...t
2972
+ } : t;
2973
+ if (typeof n != "object" && this.options.overloadTranslationOptionHandler && (n = this.options.overloadTranslationOptionHandler(arguments)), typeof options == "object" && (n = {
2974
+ ...n
2975
+ }), n || (n = {}), e == null) return "";
2976
+ Array.isArray(e) || (e = [String(e)]);
2977
+ const i = n.returnDetails !== void 0 ? n.returnDetails : this.options.returnDetails, o = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, {
2978
+ key: l,
2979
+ namespaces: c
2980
+ } = this.extractFromKey(e[e.length - 1], n), d = c[c.length - 1];
2981
+ let h = n.nsSeparator !== void 0 ? n.nsSeparator : this.options.nsSeparator;
2982
+ h === void 0 && (h = ":");
2983
+ const p = n.lng || this.language, g = n.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
2984
+ if ((p == null ? void 0 : p.toLowerCase()) === "cimode")
2985
+ return g ? i ? {
2986
+ res: `${d}${h}${l}`,
2987
+ usedKey: l,
2988
+ exactUsedKey: l,
2989
+ usedLng: p,
2990
+ usedNS: d,
2991
+ usedParams: this.getUsedParamsDetails(n)
2992
+ } : `${d}${h}${l}` : i ? {
2993
+ res: l,
2994
+ usedKey: l,
2995
+ exactUsedKey: l,
2996
+ usedLng: p,
2997
+ usedNS: d,
2998
+ usedParams: this.getUsedParamsDetails(n)
2999
+ } : l;
3000
+ const y = this.resolve(e, n);
3001
+ let v = y == null ? void 0 : y.res;
3002
+ const k = (y == null ? void 0 : y.usedKey) || l, C = (y == null ? void 0 : y.exactUsedKey) || l, T = ["[object Number]", "[object Function]", "[object RegExp]"], P = n.joinArrays !== void 0 ? n.joinArrays : this.options.joinArrays, M = !this.i18nFormat || this.i18nFormat.handleAsObject, H = n.count !== void 0 && !L(n.count), U = mt.hasDefaultValue(n), ee = H ? this.pluralResolver.getSuffix(p, n.count, n) : "", q = n.ordinal && H ? this.pluralResolver.getSuffix(p, n.count, {
3003
+ ordinal: !1
3004
+ }) : "", V = H && !n.ordinal && n.count === 0, F = V && n[`defaultValue${this.options.pluralSeparator}zero`] || n[`defaultValue${ee}`] || n[`defaultValue${q}`] || n.defaultValue;
3005
+ let D = v;
3006
+ M && !v && U && (D = F);
3007
+ const Y = hr(D), ve = Object.prototype.toString.apply(D);
3008
+ if (M && D && Y && T.indexOf(ve) < 0 && !(L(P) && Array.isArray(D))) {
3009
+ if (!n.returnObjects && !this.options.returnObjects) {
3010
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
3011
+ const _ = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(k, D, {
3012
+ ...n,
3013
+ ns: c
3014
+ }) : `key '${l} (${this.language})' returned an object instead of string.`;
3015
+ return i ? (y.res = _, y.usedParams = this.getUsedParamsDetails(n), y) : _;
3016
+ }
3017
+ if (o) {
3018
+ const _ = Array.isArray(D), A = _ ? [] : {}, G = _ ? C : k;
3019
+ for (const Z in D)
3020
+ if (Object.prototype.hasOwnProperty.call(D, Z)) {
3021
+ const X = `${G}${o}${Z}`;
3022
+ U && !v ? A[Z] = this.translate(X, {
3023
+ ...n,
3024
+ defaultValue: hr(F) ? F[Z] : void 0,
3025
+ joinArrays: !1,
3026
+ ns: c
3027
+ }) : A[Z] = this.translate(X, {
3028
+ ...n,
3029
+ joinArrays: !1,
3030
+ ns: c
3031
+ }), A[Z] === X && (A[Z] = D[Z]);
3032
+ }
3033
+ v = A;
3034
+ }
3035
+ } else if (M && L(P) && Array.isArray(v))
3036
+ v = v.join(P), v && (v = this.extendTranslation(v, e, n, r));
3037
+ else {
3038
+ let _ = !1, A = !1;
3039
+ !this.isValidLookup(v) && U && (_ = !0, v = F), this.isValidLookup(v) || (A = !0, v = l);
3040
+ const Z = (n.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && A ? void 0 : v, X = U && F !== v && this.options.updateMissing;
3041
+ if (A || _ || X) {
3042
+ if (this.logger.log(X ? "updateKey" : "missingKey", p, d, l, X ? F : v), o) {
3043
+ const W = this.resolve(l, {
3044
+ ...n,
3045
+ keySeparator: !1
3046
+ });
3047
+ W && W.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.");
3048
+ }
3049
+ let re = [];
3050
+ const se = this.languageUtils.getFallbackCodes(this.options.fallbackLng, n.lng || this.language);
3051
+ if (this.options.saveMissingTo === "fallback" && se && se[0])
3052
+ for (let W = 0; W < se.length; W++)
3053
+ re.push(se[W]);
3054
+ else this.options.saveMissingTo === "all" ? re = this.languageUtils.toResolveHierarchy(n.lng || this.language) : re.push(n.lng || this.language);
3055
+ const ye = (W, te, ne) => {
3056
+ var Re;
3057
+ const Pe = U && ne !== v ? ne : Z;
3058
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(W, d, te, Pe, X, n) : (Re = this.backendConnector) != null && Re.saveMissing && this.backendConnector.saveMissing(W, d, te, Pe, X, n), this.emit("missingKey", W, d, te, v);
3059
+ };
3060
+ this.options.saveMissing && (this.options.saveMissingPlurals && H ? re.forEach((W) => {
3061
+ const te = this.pluralResolver.getSuffixes(W, n);
3062
+ V && n[`defaultValue${this.options.pluralSeparator}zero`] && te.indexOf(`${this.options.pluralSeparator}zero`) < 0 && te.push(`${this.options.pluralSeparator}zero`), te.forEach((ne) => {
3063
+ ye([W], l + ne, n[`defaultValue${ne}`] || F);
3064
+ });
3065
+ }) : ye(re, l, F));
3066
+ }
3067
+ v = this.extendTranslation(v, e, n, y, r), A && v === l && this.options.appendNamespaceToMissingKey && (v = `${d}${h}${l}`), (A || _) && this.options.parseMissingKeyHandler && (v = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${d}${h}${l}` : l, _ ? v : void 0, n));
3068
+ }
3069
+ return i ? (y.res = v, y.usedParams = this.getUsedParamsDetails(n), y) : v;
3070
+ }
3071
+ extendTranslation(e, t, r, n, i) {
3072
+ var c, d;
3073
+ if ((c = this.i18nFormat) != null && c.parse)
3074
+ e = this.i18nFormat.parse(e, {
3075
+ ...this.options.interpolation.defaultVariables,
3076
+ ...r
3077
+ }, r.lng || this.language || n.usedLng, n.usedNS, n.usedKey, {
3078
+ resolved: n
3079
+ });
3080
+ else if (!r.skipInterpolation) {
3081
+ r.interpolation && this.interpolator.init({
3082
+ ...r,
3083
+ interpolation: {
3084
+ ...this.options.interpolation,
3085
+ ...r.interpolation
3086
+ }
3087
+ });
3088
+ const h = L(e) && (((d = r == null ? void 0 : r.interpolation) == null ? void 0 : d.skipOnVariables) !== void 0 ? r.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
3089
+ let p;
3090
+ if (h) {
3091
+ const y = e.match(this.interpolator.nestingRegexp);
3092
+ p = y && y.length;
3093
+ }
3094
+ let g = r.replace && !L(r.replace) ? r.replace : r;
3095
+ if (this.options.interpolation.defaultVariables && (g = {
3096
+ ...this.options.interpolation.defaultVariables,
3097
+ ...g
3098
+ }), e = this.interpolator.interpolate(e, g, r.lng || this.language || n.usedLng, r), h) {
3099
+ const y = e.match(this.interpolator.nestingRegexp), v = y && y.length;
3100
+ p < v && (r.nest = !1);
3101
+ }
3102
+ !r.lng && n && n.res && (r.lng = this.language || n.usedLng), r.nest !== !1 && (e = this.interpolator.nest(e, (...y) => (i == null ? void 0 : i[0]) === y[0] && !r.context ? (this.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${t[0]}`), null) : this.translate(...y, t), r)), r.interpolation && this.interpolator.reset();
3103
+ }
3104
+ const o = r.postProcess || this.options.postProcess, l = L(o) ? [o] : o;
3105
+ return e != null && (l != null && l.length) && r.applyPostProcessor !== !1 && (e = Br.handle(l, e, t, this.options && this.options.postProcessPassResolved ? {
3106
+ i18nResolved: {
3107
+ ...n,
3108
+ usedParams: this.getUsedParamsDetails(r)
3109
+ },
3110
+ ...r
3111
+ } : r, this)), e;
3112
+ }
3113
+ resolve(e, t = {}) {
3114
+ let r, n, i, o, l;
3115
+ return L(e) && (e = [e]), e.forEach((c) => {
3116
+ if (this.isValidLookup(r)) return;
3117
+ const d = this.extractFromKey(c, t), h = d.key;
3118
+ n = h;
3119
+ let p = d.namespaces;
3120
+ this.options.fallbackNS && (p = p.concat(this.options.fallbackNS));
3121
+ const g = t.count !== void 0 && !L(t.count), y = g && !t.ordinal && t.count === 0, v = t.context !== void 0 && (L(t.context) || typeof t.context == "number") && t.context !== "", k = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
3122
+ p.forEach((C) => {
3123
+ var T, P;
3124
+ this.isValidLookup(r) || (l = C, !fr[`${k[0]}-${C}`] && ((T = this.utils) != null && T.hasLoadedNamespace) && !((P = this.utils) != null && P.hasLoadedNamespace(l)) && (fr[`${k[0]}-${C}`] = !0, this.logger.warn(`key "${n}" for languages "${k.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), k.forEach((M) => {
3125
+ var ee;
3126
+ if (this.isValidLookup(r)) return;
3127
+ o = M;
3128
+ const H = [h];
3129
+ if ((ee = this.i18nFormat) != null && ee.addLookupKeys)
3130
+ this.i18nFormat.addLookupKeys(H, h, M, C, t);
3131
+ else {
3132
+ let q;
3133
+ g && (q = this.pluralResolver.getSuffix(M, t.count, t));
3134
+ const V = `${this.options.pluralSeparator}zero`, F = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
3135
+ if (g && (H.push(h + q), t.ordinal && q.indexOf(F) === 0 && H.push(h + q.replace(F, this.options.pluralSeparator)), y && H.push(h + V)), v) {
3136
+ const D = `${h}${this.options.contextSeparator}${t.context}`;
3137
+ H.push(D), g && (H.push(D + q), t.ordinal && q.indexOf(F) === 0 && H.push(D + q.replace(F, this.options.pluralSeparator)), y && H.push(D + V));
3138
+ }
3139
+ }
3140
+ let U;
3141
+ for (; U = H.pop(); )
3142
+ this.isValidLookup(r) || (i = U, r = this.getResource(M, C, U, t));
3143
+ }));
3144
+ });
3145
+ }), {
3146
+ res: r,
3147
+ usedKey: n,
3148
+ exactUsedKey: i,
3149
+ usedLng: o,
3150
+ usedNS: l
3151
+ };
3152
+ }
3153
+ isValidLookup(e) {
3154
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
3155
+ }
3156
+ getResource(e, t, r, n = {}) {
3157
+ var i;
3158
+ return (i = this.i18nFormat) != null && i.getResource ? this.i18nFormat.getResource(e, t, r, n) : this.resourceStore.getResource(e, t, r, n);
3159
+ }
3160
+ getUsedParamsDetails(e = {}) {
3161
+ const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], r = e.replace && !L(e.replace);
3162
+ let n = r ? e.replace : e;
3163
+ if (r && typeof e.count < "u" && (n.count = e.count), this.options.interpolation.defaultVariables && (n = {
3164
+ ...this.options.interpolation.defaultVariables,
3165
+ ...n
3166
+ }), !r) {
3167
+ n = {
3168
+ ...n
3169
+ };
3170
+ for (const i of t)
3171
+ delete n[i];
3172
+ }
3173
+ return n;
3174
+ }
3175
+ static hasDefaultValue(e) {
3176
+ const t = "defaultValue";
3177
+ for (const r in e)
3178
+ if (Object.prototype.hasOwnProperty.call(e, r) && t === r.substring(0, t.length) && e[r] !== void 0)
3179
+ return !0;
3180
+ return !1;
3181
+ }
3182
+ }
3183
+ class pr {
3184
+ constructor(e) {
3185
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = le.create("languageUtils");
3186
+ }
3187
+ getScriptPartFromCode(e) {
3188
+ if (e = Ge(e), !e || e.indexOf("-") < 0) return null;
3189
+ const t = e.split("-");
3190
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
3191
+ }
3192
+ getLanguagePartFromCode(e) {
3193
+ if (e = Ge(e), !e || e.indexOf("-") < 0) return e;
3194
+ const t = e.split("-");
3195
+ return this.formatLanguageCode(t[0]);
3196
+ }
3197
+ formatLanguageCode(e) {
3198
+ if (L(e) && e.indexOf("-") > -1) {
3199
+ let t;
3200
+ try {
3201
+ t = Intl.getCanonicalLocales(e)[0];
3202
+ } catch {
3203
+ }
3204
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
3205
+ }
3206
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
3207
+ }
3208
+ isSupportedCode(e) {
3209
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
3210
+ }
3211
+ getBestMatchFromCodes(e) {
3212
+ if (!e) return null;
3213
+ let t;
3214
+ return e.forEach((r) => {
3215
+ if (t) return;
3216
+ const n = this.formatLanguageCode(r);
3217
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
3218
+ }), !t && this.options.supportedLngs && e.forEach((r) => {
3219
+ if (t) return;
3220
+ const n = this.getScriptPartFromCode(r);
3221
+ if (this.isSupportedCode(n)) return t = n;
3222
+ const i = this.getLanguagePartFromCode(r);
3223
+ if (this.isSupportedCode(i)) return t = i;
3224
+ t = this.options.supportedLngs.find((o) => {
3225
+ if (o === i) return o;
3226
+ if (!(o.indexOf("-") < 0 && i.indexOf("-") < 0) && (o.indexOf("-") > 0 && i.indexOf("-") < 0 && o.substring(0, o.indexOf("-")) === i || o.indexOf(i) === 0 && i.length > 1))
3227
+ return o;
3228
+ });
3229
+ }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
3230
+ }
3231
+ getFallbackCodes(e, t) {
3232
+ if (!e) return [];
3233
+ if (typeof e == "function" && (e = e(t)), L(e) && (e = [e]), Array.isArray(e)) return e;
3234
+ if (!t) return e.default || [];
3235
+ let r = e[t];
3236
+ return r || (r = e[this.getScriptPartFromCode(t)]), r || (r = e[this.formatLanguageCode(t)]), r || (r = e[this.getLanguagePartFromCode(t)]), r || (r = e.default), r || [];
3237
+ }
3238
+ toResolveHierarchy(e, t) {
3239
+ const r = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), n = [], i = (o) => {
3240
+ o && (this.isSupportedCode(o) ? n.push(o) : this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`));
3241
+ };
3242
+ return L(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : L(e) && i(this.formatLanguageCode(e)), r.forEach((o) => {
3243
+ n.indexOf(o) < 0 && i(this.formatLanguageCode(o));
3244
+ }), n;
3245
+ }
3246
+ }
3247
+ const gr = {
3248
+ zero: 0,
3249
+ one: 1,
3250
+ two: 2,
3251
+ few: 3,
3252
+ many: 4,
3253
+ other: 5
3254
+ }, mr = {
3255
+ select: (a) => a === 1 ? "one" : "other",
3256
+ resolvedOptions: () => ({
3257
+ pluralCategories: ["one", "other"]
3258
+ })
3259
+ };
3260
+ class Aa {
3261
+ constructor(e, t = {}) {
3262
+ this.languageUtils = e, this.options = t, this.logger = le.create("pluralResolver"), this.pluralRulesCache = {};
3263
+ }
3264
+ addRule(e, t) {
3265
+ this.rules[e] = t;
3266
+ }
3267
+ clearCache() {
3268
+ this.pluralRulesCache = {};
3269
+ }
3270
+ getRule(e, t = {}) {
3271
+ const r = Ge(e === "dev" ? "en" : e), n = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
3272
+ cleanedCode: r,
3273
+ type: n
3274
+ });
3275
+ if (i in this.pluralRulesCache)
3276
+ return this.pluralRulesCache[i];
3277
+ let o;
3278
+ try {
3279
+ o = new Intl.PluralRules(r, {
3280
+ type: n
3281
+ });
3282
+ } catch {
3283
+ if (!Intl)
3284
+ return this.logger.error("No Intl support, please use an Intl polyfill!"), mr;
3285
+ if (!e.match(/-|_/)) return mr;
3286
+ const c = this.languageUtils.getLanguagePartFromCode(e);
3287
+ o = this.getRule(c, t);
3288
+ }
3289
+ return this.pluralRulesCache[i] = o, o;
3290
+ }
3291
+ needsPlural(e, t = {}) {
3292
+ let r = this.getRule(e, t);
3293
+ return r || (r = this.getRule("dev", t)), (r == null ? void 0 : r.resolvedOptions().pluralCategories.length) > 1;
3294
+ }
3295
+ getPluralFormsOfKey(e, t, r = {}) {
3296
+ return this.getSuffixes(e, r).map((n) => `${t}${n}`);
3297
+ }
3298
+ getSuffixes(e, t = {}) {
3299
+ let r = this.getRule(e, t);
3300
+ return r || (r = this.getRule("dev", t)), r ? r.resolvedOptions().pluralCategories.sort((n, i) => gr[n] - gr[i]).map((n) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${n}`) : [];
3301
+ }
3302
+ getSuffix(e, t, r = {}) {
3303
+ const n = this.getRule(e, r);
3304
+ return n ? `${this.options.prepend}${r.ordinal ? `ordinal${this.options.prepend}` : ""}${n.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, r));
3305
+ }
3306
+ }
3307
+ const yr = (a, e, t, r = ".", n = !0) => {
3308
+ let i = ja(a, e, t);
3309
+ return !i && n && L(t) && (i = qt(a, t, r), i === void 0 && (i = qt(e, t, r))), i;
3310
+ }, Ht = (a) => a.replace(/\$/g, "$$$$");
3311
+ class Ia {
3312
+ constructor(e = {}) {
3313
+ var t;
3314
+ this.logger = le.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((r) => r), this.init(e);
3315
+ }
3316
+ init(e = {}) {
3317
+ e.interpolation || (e.interpolation = {
3318
+ escapeValue: !0
3319
+ });
3320
+ const {
3321
+ escape: t,
3322
+ escapeValue: r,
3323
+ useRawValueToEscape: n,
3324
+ prefix: i,
3325
+ prefixEscaped: o,
3326
+ suffix: l,
3327
+ suffixEscaped: c,
3328
+ formatSeparator: d,
3329
+ unescapeSuffix: h,
3330
+ unescapePrefix: p,
3331
+ nestingPrefix: g,
3332
+ nestingPrefixEscaped: y,
3333
+ nestingSuffix: v,
3334
+ nestingSuffixEscaped: k,
3335
+ nestingOptionsSeparator: C,
3336
+ maxReplaces: T,
3337
+ alwaysFormat: P
3338
+ } = e.interpolation;
3339
+ this.escape = t !== void 0 ? t : Ta, this.escapeValue = r !== void 0 ? r : !0, this.useRawValueToEscape = n !== void 0 ? n : !1, this.prefix = i ? Te(i) : o || "{{", this.suffix = l ? Te(l) : c || "}}", this.formatSeparator = d || ",", this.unescapePrefix = h ? "" : p || "-", this.unescapeSuffix = this.unescapePrefix ? "" : h || "", this.nestingPrefix = g ? Te(g) : y || Te("$t("), this.nestingSuffix = v ? Te(v) : k || Te(")"), this.nestingOptionsSeparator = C || ",", this.maxReplaces = T || 1e3, this.alwaysFormat = P !== void 0 ? P : !1, this.resetRegExp();
3340
+ }
3341
+ reset() {
3342
+ this.options && this.init(this.options);
3343
+ }
3344
+ resetRegExp() {
3345
+ const e = (t, r) => (t == null ? void 0 : t.source) === r ? (t.lastIndex = 0, t) : new RegExp(r, "g");
3346
+ 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}`);
3347
+ }
3348
+ interpolate(e, t, r, n) {
3349
+ var y;
3350
+ let i, o, l;
3351
+ const c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, d = (v) => {
3352
+ if (v.indexOf(this.formatSeparator) < 0) {
3353
+ const P = yr(t, c, v, this.options.keySeparator, this.options.ignoreJSONStructure);
3354
+ return this.alwaysFormat ? this.format(P, void 0, r, {
3355
+ ...n,
3356
+ ...t,
3357
+ interpolationkey: v
3358
+ }) : P;
3359
+ }
3360
+ const k = v.split(this.formatSeparator), C = k.shift().trim(), T = k.join(this.formatSeparator).trim();
3361
+ return this.format(yr(t, c, C, this.options.keySeparator, this.options.ignoreJSONStructure), T, r, {
3362
+ ...n,
3363
+ ...t,
3364
+ interpolationkey: C
3365
+ });
3366
+ };
3367
+ this.resetRegExp();
3368
+ const h = (n == null ? void 0 : n.missingInterpolationHandler) || this.options.missingInterpolationHandler, p = ((y = n == null ? void 0 : n.interpolation) == null ? void 0 : y.skipOnVariables) !== void 0 ? n.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
3369
+ return [{
3370
+ regex: this.regexpUnescape,
3371
+ safeValue: (v) => Ht(v)
3372
+ }, {
3373
+ regex: this.regexp,
3374
+ safeValue: (v) => this.escapeValue ? Ht(this.escape(v)) : Ht(v)
3375
+ }].forEach((v) => {
3376
+ for (l = 0; i = v.regex.exec(e); ) {
3377
+ const k = i[1].trim();
3378
+ if (o = d(k), o === void 0)
3379
+ if (typeof h == "function") {
3380
+ const T = h(e, i, n);
3381
+ o = L(T) ? T : "";
3382
+ } else if (n && Object.prototype.hasOwnProperty.call(n, k))
3383
+ o = "";
3384
+ else if (p) {
3385
+ o = i[0];
3386
+ continue;
3387
+ } else
3388
+ this.logger.warn(`missed to pass in variable ${k} for interpolating ${e}`), o = "";
3389
+ else !L(o) && !this.useRawValueToEscape && (o = or(o));
3390
+ const C = v.safeValue(o);
3391
+ if (e = e.replace(i[0], C), p ? (v.regex.lastIndex += o.length, v.regex.lastIndex -= i[0].length) : v.regex.lastIndex = 0, l++, l >= this.maxReplaces)
3392
+ break;
3393
+ }
3394
+ }), e;
3395
+ }
3396
+ nest(e, t, r = {}) {
3397
+ let n, i, o;
3398
+ const l = (c, d) => {
3399
+ const h = this.nestingOptionsSeparator;
3400
+ if (c.indexOf(h) < 0) return c;
3401
+ const p = c.split(new RegExp(`${h}[ ]*{`));
3402
+ let g = `{${p[1]}`;
3403
+ c = p[0], g = this.interpolate(g, o);
3404
+ const y = g.match(/'/g), v = g.match(/"/g);
3405
+ (((y == null ? void 0 : y.length) ?? 0) % 2 === 0 && !v || v.length % 2 !== 0) && (g = g.replace(/'/g, '"'));
3406
+ try {
3407
+ o = JSON.parse(g), d && (o = {
3408
+ ...d,
3409
+ ...o
3410
+ });
3411
+ } catch (k) {
3412
+ return this.logger.warn(`failed parsing options string in nesting for key ${c}`, k), `${c}${h}${g}`;
3413
+ }
3414
+ return o.defaultValue && o.defaultValue.indexOf(this.prefix) > -1 && delete o.defaultValue, c;
3415
+ };
3416
+ for (; n = this.nestingRegexp.exec(e); ) {
3417
+ let c = [];
3418
+ o = {
3419
+ ...r
3420
+ }, o = o.replace && !L(o.replace) ? o.replace : o, o.applyPostProcessor = !1, delete o.defaultValue;
3421
+ let d = !1;
3422
+ if (n[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(n[1])) {
3423
+ const h = n[1].split(this.formatSeparator).map((p) => p.trim());
3424
+ n[1] = h.shift(), c = h, d = !0;
3425
+ }
3426
+ if (i = t(l.call(this, n[1].trim(), o), o), i && n[0] === e && !L(i)) return i;
3427
+ L(i) || (i = or(i)), i || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), i = ""), d && (i = c.reduce((h, p) => this.format(h, p, r.lng, {
3428
+ ...r,
3429
+ interpolationkey: n[1].trim()
3430
+ }), i.trim())), e = e.replace(n[0], i), this.regexp.lastIndex = 0;
3431
+ }
3432
+ return e;
3433
+ }
3434
+ }
3435
+ const Va = (a) => {
3436
+ let e = a.toLowerCase().trim();
3437
+ const t = {};
3438
+ if (a.indexOf("(") > -1) {
3439
+ const r = a.split("(");
3440
+ e = r[0].toLowerCase().trim();
3441
+ const n = r[1].substring(0, r[1].length - 1);
3442
+ e === "currency" && n.indexOf(":") < 0 ? t.currency || (t.currency = n.trim()) : e === "relativetime" && n.indexOf(":") < 0 ? t.range || (t.range = n.trim()) : n.split(";").forEach((o) => {
3443
+ if (o) {
3444
+ const [l, ...c] = o.split(":"), d = c.join(":").trim().replace(/^'+|'+$/g, ""), h = l.trim();
3445
+ t[h] || (t[h] = d), d === "false" && (t[h] = !1), d === "true" && (t[h] = !0), isNaN(d) || (t[h] = parseInt(d, 10));
3446
+ }
3447
+ });
3448
+ }
3449
+ return {
3450
+ formatName: e,
3451
+ formatOptions: t
3452
+ };
3453
+ }, vr = (a) => {
3454
+ const e = {};
3455
+ return (t, r, n) => {
3456
+ let i = n;
3457
+ n && n.interpolationkey && n.formatParams && n.formatParams[n.interpolationkey] && n[n.interpolationkey] && (i = {
3458
+ ...i,
3459
+ [n.interpolationkey]: void 0
3460
+ });
3461
+ const o = r + JSON.stringify(i);
3462
+ let l = e[o];
3463
+ return l || (l = a(Ge(r), n), e[o] = l), l(t);
3464
+ };
3465
+ }, Ha = (a) => (e, t, r) => a(Ge(t), r)(e);
3466
+ class Ua {
3467
+ constructor(e = {}) {
3468
+ this.logger = le.create("formatter"), this.options = e, this.init(e);
3469
+ }
3470
+ init(e, t = {
3471
+ interpolation: {}
3472
+ }) {
3473
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
3474
+ const r = t.cacheInBuiltFormats ? vr : Ha;
3475
+ this.formats = {
3476
+ number: r((n, i) => {
3477
+ const o = new Intl.NumberFormat(n, {
3478
+ ...i
3479
+ });
3480
+ return (l) => o.format(l);
3481
+ }),
3482
+ currency: r((n, i) => {
3483
+ const o = new Intl.NumberFormat(n, {
3484
+ ...i,
3485
+ style: "currency"
3486
+ });
3487
+ return (l) => o.format(l);
3488
+ }),
3489
+ datetime: r((n, i) => {
3490
+ const o = new Intl.DateTimeFormat(n, {
3491
+ ...i
3492
+ });
3493
+ return (l) => o.format(l);
3494
+ }),
3495
+ relativetime: r((n, i) => {
3496
+ const o = new Intl.RelativeTimeFormat(n, {
3497
+ ...i
3498
+ });
3499
+ return (l) => o.format(l, i.range || "day");
3500
+ }),
3501
+ list: r((n, i) => {
3502
+ const o = new Intl.ListFormat(n, {
3503
+ ...i
3504
+ });
3505
+ return (l) => o.format(l);
3506
+ })
3507
+ };
3508
+ }
3509
+ add(e, t) {
3510
+ this.formats[e.toLowerCase().trim()] = t;
3511
+ }
3512
+ addCached(e, t) {
3513
+ this.formats[e.toLowerCase().trim()] = vr(t);
3514
+ }
3515
+ format(e, t, r, n = {}) {
3516
+ const i = t.split(this.formatSeparator);
3517
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((l) => l.indexOf(")") > -1)) {
3518
+ const l = i.findIndex((c) => c.indexOf(")") > -1);
3519
+ i[0] = [i[0], ...i.splice(1, l)].join(this.formatSeparator);
3520
+ }
3521
+ return i.reduce((l, c) => {
3522
+ var p;
3523
+ const {
3524
+ formatName: d,
3525
+ formatOptions: h
3526
+ } = Va(c);
3527
+ if (this.formats[d]) {
3528
+ let g = l;
3529
+ try {
3530
+ const y = ((p = n == null ? void 0 : n.formatParams) == null ? void 0 : p[n.interpolationkey]) || {}, v = y.locale || y.lng || n.locale || n.lng || r;
3531
+ g = this.formats[d](l, v, {
3532
+ ...h,
3533
+ ...n,
3534
+ ...y
3535
+ });
3536
+ } catch (y) {
3537
+ this.logger.warn(y);
3538
+ }
3539
+ return g;
3540
+ } else
3541
+ this.logger.warn(`there was no format function for ${d}`);
3542
+ return l;
3543
+ }, e);
3544
+ }
3545
+ }
3546
+ const Ba = (a, e) => {
3547
+ a.pending[e] !== void 0 && (delete a.pending[e], a.pendingCount--);
3548
+ };
3549
+ class Wa extends bt {
3550
+ constructor(e, t, r, n = {}) {
3551
+ var i, o;
3552
+ super(), this.backend = e, this.store = t, this.services = r, this.languageUtils = r.languageUtils, this.options = n, this.logger = le.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], (o = (i = this.backend) == null ? void 0 : i.init) == null || o.call(i, r, n.backend, n);
3553
+ }
3554
+ queueLoad(e, t, r, n) {
3555
+ const i = {}, o = {}, l = {}, c = {};
3556
+ return e.forEach((d) => {
3557
+ let h = !0;
3558
+ t.forEach((p) => {
3559
+ const g = `${d}|${p}`;
3560
+ !r.reload && this.store.hasResourceBundle(d, p) ? this.state[g] = 2 : this.state[g] < 0 || (this.state[g] === 1 ? o[g] === void 0 && (o[g] = !0) : (this.state[g] = 1, h = !1, o[g] === void 0 && (o[g] = !0), i[g] === void 0 && (i[g] = !0), c[p] === void 0 && (c[p] = !0)));
3561
+ }), h || (l[d] = !0);
3562
+ }), (Object.keys(i).length || Object.keys(o).length) && this.queue.push({
3563
+ pending: o,
3564
+ pendingCount: Object.keys(o).length,
3565
+ loaded: {},
3566
+ errors: [],
3567
+ callback: n
3568
+ }), {
3569
+ toLoad: Object.keys(i),
3570
+ pending: Object.keys(o),
3571
+ toLoadLanguages: Object.keys(l),
3572
+ toLoadNamespaces: Object.keys(c)
3573
+ };
3574
+ }
3575
+ loaded(e, t, r) {
3576
+ const n = e.split("|"), i = n[0], o = n[1];
3577
+ t && this.emit("failedLoading", i, o, t), !t && r && this.store.addResourceBundle(i, o, r, void 0, void 0, {
3578
+ skipCopy: !0
3579
+ }), this.state[e] = t ? -1 : 2, t && r && (this.state[e] = 0);
3580
+ const l = {};
3581
+ this.queue.forEach((c) => {
3582
+ La(c.loaded, [i], o), Ba(c, e), t && c.errors.push(t), c.pendingCount === 0 && !c.done && (Object.keys(c.loaded).forEach((d) => {
3583
+ l[d] || (l[d] = {});
3584
+ const h = c.loaded[d];
3585
+ h.length && h.forEach((p) => {
3586
+ l[d][p] === void 0 && (l[d][p] = !0);
3587
+ });
3588
+ }), c.done = !0, c.errors.length ? c.callback(c.errors) : c.callback());
3589
+ }), this.emit("loaded", l), this.queue = this.queue.filter((c) => !c.done);
3590
+ }
3591
+ read(e, t, r, n = 0, i = this.retryTimeout, o) {
3592
+ if (!e.length) return o(null, {});
3593
+ if (this.readingCalls >= this.maxParallelReads) {
3594
+ this.waitingReads.push({
3595
+ lng: e,
3596
+ ns: t,
3597
+ fcName: r,
3598
+ tried: n,
3599
+ wait: i,
3600
+ callback: o
3601
+ });
3602
+ return;
3603
+ }
3604
+ this.readingCalls++;
3605
+ const l = (d, h) => {
3606
+ if (this.readingCalls--, this.waitingReads.length > 0) {
3607
+ const p = this.waitingReads.shift();
3608
+ this.read(p.lng, p.ns, p.fcName, p.tried, p.wait, p.callback);
3609
+ }
3610
+ if (d && h && n < this.maxRetries) {
3611
+ setTimeout(() => {
3612
+ this.read.call(this, e, t, r, n + 1, i * 2, o);
3613
+ }, i);
3614
+ return;
3615
+ }
3616
+ o(d, h);
3617
+ }, c = this.backend[r].bind(this.backend);
3618
+ if (c.length === 2) {
3619
+ try {
3620
+ const d = c(e, t);
3621
+ d && typeof d.then == "function" ? d.then((h) => l(null, h)).catch(l) : l(null, d);
3622
+ } catch (d) {
3623
+ l(d);
3624
+ }
3625
+ return;
3626
+ }
3627
+ return c(e, t, l);
3628
+ }
3629
+ prepareLoading(e, t, r = {}, n) {
3630
+ if (!this.backend)
3631
+ return this.logger.warn("No backend was added via i18next.use. Will not load resources."), n && n();
3632
+ L(e) && (e = this.languageUtils.toResolveHierarchy(e)), L(t) && (t = [t]);
3633
+ const i = this.queueLoad(e, t, r, n);
3634
+ if (!i.toLoad.length)
3635
+ return i.pending.length || n(), null;
3636
+ i.toLoad.forEach((o) => {
3637
+ this.loadOne(o);
3638
+ });
3639
+ }
3640
+ load(e, t, r) {
3641
+ this.prepareLoading(e, t, {}, r);
3642
+ }
3643
+ reload(e, t, r) {
3644
+ this.prepareLoading(e, t, {
3645
+ reload: !0
3646
+ }, r);
3647
+ }
3648
+ loadOne(e, t = "") {
3649
+ const r = e.split("|"), n = r[0], i = r[1];
3650
+ this.read(n, i, "read", void 0, void 0, (o, l) => {
3651
+ o && this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`, o), !o && l && this.logger.log(`${t}loaded namespace ${i} for language ${n}`, l), this.loaded(e, o, l);
3652
+ });
3653
+ }
3654
+ saveMissing(e, t, r, n, i, o = {}, l = () => {
3655
+ }) {
3656
+ var c, d, h, p, g;
3657
+ if ((d = (c = this.services) == null ? void 0 : c.utils) != null && d.hasLoadedNamespace && !((p = (h = this.services) == null ? void 0 : h.utils) != null && p.hasLoadedNamespace(t))) {
3658
+ this.logger.warn(`did not save key "${r}" 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!!!");
3659
+ return;
3660
+ }
3661
+ if (!(r == null || r === "")) {
3662
+ if ((g = this.backend) != null && g.create) {
3663
+ const y = {
3664
+ ...o,
3665
+ isUpdate: i
3666
+ }, v = this.backend.create.bind(this.backend);
3667
+ if (v.length < 6)
3668
+ try {
3669
+ let k;
3670
+ v.length === 5 ? k = v(e, t, r, n, y) : k = v(e, t, r, n), k && typeof k.then == "function" ? k.then((C) => l(null, C)).catch(l) : l(null, k);
3671
+ } catch (k) {
3672
+ l(k);
3673
+ }
3674
+ else
3675
+ v(e, t, r, n, l, y);
3676
+ }
3677
+ !e || !e[0] || this.store.addResource(e[0], t, r, n);
3678
+ }
3679
+ }
3680
+ }
3681
+ const br = () => ({
3682
+ debug: !1,
3683
+ initAsync: !0,
3684
+ ns: ["translation"],
3685
+ defaultNS: ["translation"],
3686
+ fallbackLng: ["dev"],
3687
+ fallbackNS: !1,
3688
+ supportedLngs: !1,
3689
+ nonExplicitSupportedLngs: !1,
3690
+ load: "all",
3691
+ preload: !1,
3692
+ simplifyPluralSuffix: !0,
3693
+ keySeparator: ".",
3694
+ nsSeparator: ":",
3695
+ pluralSeparator: "_",
3696
+ contextSeparator: "_",
3697
+ partialBundledLanguages: !1,
3698
+ saveMissing: !1,
3699
+ updateMissing: !1,
3700
+ saveMissingTo: "fallback",
3701
+ saveMissingPlurals: !0,
3702
+ missingKeyHandler: !1,
3703
+ missingInterpolationHandler: !1,
3704
+ postProcess: !1,
3705
+ postProcessPassResolved: !1,
3706
+ returnNull: !1,
3707
+ returnEmptyString: !0,
3708
+ returnObjects: !1,
3709
+ joinArrays: !1,
3710
+ returnedObjectHandler: !1,
3711
+ parseMissingKeyHandler: !1,
3712
+ appendNamespaceToMissingKey: !1,
3713
+ appendNamespaceToCIMode: !1,
3714
+ overloadTranslationOptionHandler: (a) => {
3715
+ let e = {};
3716
+ if (typeof a[1] == "object" && (e = a[1]), L(a[1]) && (e.defaultValue = a[1]), L(a[2]) && (e.tDescription = a[2]), typeof a[2] == "object" || typeof a[3] == "object") {
3717
+ const t = a[3] || a[2];
3718
+ Object.keys(t).forEach((r) => {
3719
+ e[r] = t[r];
3720
+ });
3721
+ }
3722
+ return e;
3723
+ },
3724
+ interpolation: {
3725
+ escapeValue: !0,
3726
+ format: (a) => a,
3727
+ prefix: "{{",
3728
+ suffix: "}}",
3729
+ formatSeparator: ",",
3730
+ unescapePrefix: "-",
3731
+ nestingPrefix: "$t(",
3732
+ nestingSuffix: ")",
3733
+ nestingOptionsSeparator: ",",
3734
+ maxReplaces: 1e3,
3735
+ skipOnVariables: !0
3736
+ },
3737
+ cacheInBuiltFormats: !0
3738
+ }), xr = (a) => {
3739
+ var e, t;
3740
+ return L(a.ns) && (a.ns = [a.ns]), L(a.fallbackLng) && (a.fallbackLng = [a.fallbackLng]), L(a.fallbackNS) && (a.fallbackNS = [a.fallbackNS]), ((t = (e = a.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (a.supportedLngs = a.supportedLngs.concat(["cimode"])), typeof a.initImmediate == "boolean" && (a.initAsync = a.initImmediate), a;
3741
+ }, ft = () => {
3742
+ }, za = (a) => {
3743
+ Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach((t) => {
3744
+ typeof a[t] == "function" && (a[t] = a[t].bind(a));
3745
+ });
3746
+ };
3747
+ class Qe extends bt {
3748
+ constructor(e = {}, t) {
3749
+ if (super(), this.options = xr(e), this.services = {}, this.logger = le, this.modules = {
3750
+ external: []
3751
+ }, za(this), t && !this.isInitialized && !e.isClone) {
3752
+ if (!this.options.initAsync)
3753
+ return this.init(e, t), this;
3754
+ setTimeout(() => {
3755
+ this.init(e, t);
3756
+ }, 0);
3757
+ }
3758
+ }
3759
+ init(e = {}, t) {
3760
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (L(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
3761
+ const r = br();
3762
+ this.options = {
3763
+ ...r,
3764
+ ...this.options,
3765
+ ...xr(e)
3766
+ }, this.options.interpolation = {
3767
+ ...r.interpolation,
3768
+ ...this.options.interpolation
3769
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator);
3770
+ const n = (d) => d ? typeof d == "function" ? new d() : d : null;
3771
+ if (!this.options.isClone) {
3772
+ this.modules.logger ? le.init(n(this.modules.logger), this.options) : le.init(null, this.options);
3773
+ let d;
3774
+ this.modules.formatter ? d = this.modules.formatter : d = Ua;
3775
+ const h = new pr(this.options);
3776
+ this.store = new dr(this.options.resources, this.options);
3777
+ const p = this.services;
3778
+ p.logger = le, p.resourceStore = this.store, p.languageUtils = h, p.pluralResolver = new Aa(h, {
3779
+ prepend: this.options.pluralSeparator,
3780
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
3781
+ }), d && (!this.options.interpolation.format || this.options.interpolation.format === r.interpolation.format) && (p.formatter = n(d), p.formatter.init(p, this.options), this.options.interpolation.format = p.formatter.format.bind(p.formatter)), p.interpolator = new Ia(this.options), p.utils = {
3782
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
3783
+ }, p.backendConnector = new Wa(n(this.modules.backend), p.resourceStore, p, this.options), p.backendConnector.on("*", (g, ...y) => {
3784
+ this.emit(g, ...y);
3785
+ }), this.modules.languageDetector && (p.languageDetector = n(this.modules.languageDetector), p.languageDetector.init && p.languageDetector.init(p, this.options.detection, this.options)), this.modules.i18nFormat && (p.i18nFormat = n(this.modules.i18nFormat), p.i18nFormat.init && p.i18nFormat.init(this)), this.translator = new mt(this.services, this.options), this.translator.on("*", (g, ...y) => {
3786
+ this.emit(g, ...y);
3787
+ }), this.modules.external.forEach((g) => {
3788
+ g.init && g.init(this);
3789
+ });
3790
+ }
3791
+ if (this.format = this.options.interpolation.format, t || (t = ft), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
3792
+ const d = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
3793
+ d.length > 0 && d[0] !== "dev" && (this.options.lng = d[0]);
3794
+ }
3795
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((d) => {
3796
+ this[d] = (...h) => this.store[d](...h);
3797
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((d) => {
3798
+ this[d] = (...h) => (this.store[d](...h), this);
3799
+ });
3800
+ const l = Ze(), c = () => {
3801
+ const d = (h, p) => {
3802
+ 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), l.resolve(p), t(h, p);
3803
+ };
3804
+ if (this.languages && !this.isInitialized) return d(null, this.t.bind(this));
3805
+ this.changeLanguage(this.options.lng, d);
3806
+ };
3807
+ return this.options.resources || !this.options.initAsync ? c() : setTimeout(c, 0), l;
3808
+ }
3809
+ loadResources(e, t = ft) {
3810
+ var i, o;
3811
+ let r = t;
3812
+ const n = L(e) ? e : this.language;
3813
+ if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
3814
+ if ((n == null ? void 0 : n.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
3815
+ const l = [], c = (d) => {
3816
+ if (!d || d === "cimode") return;
3817
+ this.services.languageUtils.toResolveHierarchy(d).forEach((p) => {
3818
+ p !== "cimode" && l.indexOf(p) < 0 && l.push(p);
3819
+ });
3820
+ };
3821
+ n ? c(n) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((h) => c(h)), (o = (i = this.options.preload) == null ? void 0 : i.forEach) == null || o.call(i, (d) => c(d)), this.services.backendConnector.load(l, this.options.ns, (d) => {
3822
+ !d && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), r(d);
3823
+ });
3824
+ } else
3825
+ r(null);
3826
+ }
3827
+ reloadResources(e, t, r) {
3828
+ const n = Ze();
3829
+ return typeof e == "function" && (r = e, e = void 0), typeof t == "function" && (r = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), r || (r = ft), this.services.backendConnector.reload(e, t, (i) => {
3830
+ n.resolve(), r(i);
3831
+ }), n;
3832
+ }
3833
+ use(e) {
3834
+ if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
3835
+ if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
3836
+ 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" && Br.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
3837
+ }
3838
+ setResolvedLanguage(e) {
3839
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
3840
+ for (let t = 0; t < this.languages.length; t++) {
3841
+ const r = this.languages[t];
3842
+ if (!(["cimode", "dev"].indexOf(r) > -1) && this.store.hasLanguageSomeTranslations(r)) {
3843
+ this.resolvedLanguage = r;
3844
+ break;
3845
+ }
3846
+ }
3847
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
3848
+ }
3849
+ }
3850
+ changeLanguage(e, t) {
3851
+ this.isLanguageChangingTo = e;
3852
+ const r = Ze();
3853
+ this.emit("languageChanging", e);
3854
+ const n = (l) => {
3855
+ this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
3856
+ }, i = (l, c) => {
3857
+ c ? this.isLanguageChangingTo === e && (n(c), this.translator.changeLanguage(c), this.isLanguageChangingTo = void 0, this.emit("languageChanged", c), this.logger.log("languageChanged", c)) : this.isLanguageChangingTo = void 0, r.resolve((...d) => this.t(...d)), t && t(l, (...d) => this.t(...d));
3858
+ }, o = (l) => {
3859
+ var h, p;
3860
+ !e && !l && this.services.languageDetector && (l = []);
3861
+ const c = L(l) ? l : l && l[0], d = this.store.hasLanguageSomeTranslations(c) ? c : this.services.languageUtils.getBestMatchFromCodes(L(l) ? [l] : l);
3862
+ d && (this.language || n(d), this.translator.language || this.translator.changeLanguage(d), (p = (h = this.services.languageDetector) == null ? void 0 : h.cacheUserLanguage) == null || p.call(h, d)), this.loadResources(d, (g) => {
3863
+ i(g, d);
3864
+ });
3865
+ };
3866
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? o(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(o) : this.services.languageDetector.detect(o) : o(e), r;
3867
+ }
3868
+ getFixedT(e, t, r) {
3869
+ const n = (i, o, ...l) => {
3870
+ let c;
3871
+ typeof o != "object" ? c = this.options.overloadTranslationOptionHandler([i, o].concat(l)) : c = {
3872
+ ...o
3873
+ }, c.lng = c.lng || n.lng, c.lngs = c.lngs || n.lngs, c.ns = c.ns || n.ns, c.keyPrefix !== "" && (c.keyPrefix = c.keyPrefix || r || n.keyPrefix);
3874
+ const d = this.options.keySeparator || ".";
3875
+ let h;
3876
+ return c.keyPrefix && Array.isArray(i) ? h = i.map((p) => `${c.keyPrefix}${d}${p}`) : h = c.keyPrefix ? `${c.keyPrefix}${d}${i}` : i, this.t(h, c);
3877
+ };
3878
+ return L(e) ? n.lng = e : n.lngs = e, n.ns = t, n.keyPrefix = r, n;
3879
+ }
3880
+ t(...e) {
3881
+ var t;
3882
+ return (t = this.translator) == null ? void 0 : t.translate(...e);
3883
+ }
3884
+ exists(...e) {
3885
+ var t;
3886
+ return (t = this.translator) == null ? void 0 : t.exists(...e);
3887
+ }
3888
+ setDefaultNamespace(e) {
3889
+ this.options.defaultNS = e;
3890
+ }
3891
+ hasLoadedNamespace(e, t = {}) {
3892
+ if (!this.isInitialized)
3893
+ return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
3894
+ if (!this.languages || !this.languages.length)
3895
+ return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
3896
+ const r = t.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
3897
+ if (r.toLowerCase() === "cimode") return !0;
3898
+ const o = (l, c) => {
3899
+ const d = this.services.backendConnector.state[`${l}|${c}`];
3900
+ return d === -1 || d === 0 || d === 2;
3901
+ };
3902
+ if (t.precheck) {
3903
+ const l = t.precheck(this, o);
3904
+ if (l !== void 0) return l;
3905
+ }
3906
+ return !!(this.hasResourceBundle(r, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || o(r, e) && (!n || o(i, e)));
3907
+ }
3908
+ loadNamespaces(e, t) {
3909
+ const r = Ze();
3910
+ return this.options.ns ? (L(e) && (e = [e]), e.forEach((n) => {
3911
+ this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
3912
+ }), this.loadResources((n) => {
3913
+ r.resolve(), t && t(n);
3914
+ }), r) : (t && t(), Promise.resolve());
3915
+ }
3916
+ loadLanguages(e, t) {
3917
+ const r = Ze();
3918
+ L(e) && (e = [e]);
3919
+ const n = this.options.preload || [], i = e.filter((o) => n.indexOf(o) < 0 && this.services.languageUtils.isSupportedCode(o));
3920
+ return i.length ? (this.options.preload = n.concat(i), this.loadResources((o) => {
3921
+ r.resolve(), t && t(o);
3922
+ }), r) : (t && t(), Promise.resolve());
3923
+ }
3924
+ dir(e) {
3925
+ var n, i;
3926
+ if (e || (e = this.resolvedLanguage || (((n = this.languages) == null ? void 0 : n.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
3927
+ 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"], r = ((i = this.services) == null ? void 0 : i.languageUtils) || new pr(br());
3928
+ return t.indexOf(r.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
3929
+ }
3930
+ static createInstance(e = {}, t) {
3931
+ return new Qe(e, t);
3932
+ }
3933
+ cloneInstance(e = {}, t = ft) {
3934
+ const r = e.forkResourceStore;
3935
+ r && delete e.forkResourceStore;
3936
+ const n = {
3937
+ ...this.options,
3938
+ ...e,
3939
+ isClone: !0
3940
+ }, i = new Qe(n);
3941
+ if ((e.debug !== void 0 || e.prefix !== void 0) && (i.logger = i.logger.clone(e)), ["store", "services", "language"].forEach((l) => {
3942
+ i[l] = this[l];
3943
+ }), i.services = {
3944
+ ...this.services
3945
+ }, i.services.utils = {
3946
+ hasLoadedNamespace: i.hasLoadedNamespace.bind(i)
3947
+ }, r) {
3948
+ const l = Object.keys(this.store.data).reduce((c, d) => (c[d] = {
3949
+ ...this.store.data[d]
3950
+ }, c[d] = Object.keys(c[d]).reduce((h, p) => (h[p] = {
3951
+ ...c[d][p]
3952
+ }, h), c[d]), c), {});
3953
+ i.store = new dr(l, n), i.services.resourceStore = i.store;
3954
+ }
3955
+ return i.translator = new mt(i.services, n), i.translator.on("*", (l, ...c) => {
3956
+ i.emit(l, ...c);
3957
+ }), i.init(n, t), i.translator.options = n, i.translator.backendConnector.services.utils = {
3958
+ hasLoadedNamespace: i.hasLoadedNamespace.bind(i)
3959
+ }, i;
3960
+ }
3961
+ toJSON() {
3962
+ return {
3963
+ options: this.options,
3964
+ store: this.store,
3965
+ language: this.language,
3966
+ languages: this.languages,
3967
+ resolvedLanguage: this.resolvedLanguage
3968
+ };
3969
+ }
3970
+ }
3971
+ const J = Qe.createInstance();
3972
+ J.createInstance = Qe.createInstance;
3973
+ J.createInstance;
3974
+ J.dir;
3975
+ J.init;
3976
+ J.loadResources;
3977
+ J.reloadResources;
3978
+ J.use;
3979
+ J.changeLanguage;
3980
+ J.getFixedT;
3981
+ J.t;
3982
+ J.exists;
3983
+ J.setDefaultNamespace;
3984
+ J.hasLoadedNamespace;
3985
+ J.loadNamespaces;
3986
+ J.loadLanguages;
3987
+ const {
3988
+ slice: qa,
3989
+ forEach: Ka
3990
+ } = [];
3991
+ function Ja(a) {
3992
+ return Ka.call(qa.call(arguments, 1), (e) => {
3993
+ if (e)
3994
+ for (const t in e)
3995
+ a[t] === void 0 && (a[t] = e[t]);
3996
+ }), a;
3997
+ }
3998
+ function Za(a) {
3999
+ return typeof a != "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(a));
4000
+ }
4001
+ const wr = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Ya = function(a, e) {
4002
+ const r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
4003
+ path: "/"
4004
+ }, n = encodeURIComponent(e);
4005
+ let i = `${a}=${n}`;
4006
+ if (r.maxAge > 0) {
4007
+ const o = r.maxAge - 0;
4008
+ if (Number.isNaN(o)) throw new Error("maxAge should be a Number");
4009
+ i += `; Max-Age=${Math.floor(o)}`;
4010
+ }
4011
+ if (r.domain) {
4012
+ if (!wr.test(r.domain))
4013
+ throw new TypeError("option domain is invalid");
4014
+ i += `; Domain=${r.domain}`;
4015
+ }
4016
+ if (r.path) {
4017
+ if (!wr.test(r.path))
4018
+ throw new TypeError("option path is invalid");
4019
+ i += `; Path=${r.path}`;
4020
+ }
4021
+ if (r.expires) {
4022
+ if (typeof r.expires.toUTCString != "function")
4023
+ throw new TypeError("option expires is invalid");
4024
+ i += `; Expires=${r.expires.toUTCString()}`;
4025
+ }
4026
+ if (r.httpOnly && (i += "; HttpOnly"), r.secure && (i += "; Secure"), r.sameSite)
4027
+ switch (typeof r.sameSite == "string" ? r.sameSite.toLowerCase() : r.sameSite) {
4028
+ case !0:
4029
+ i += "; SameSite=Strict";
4030
+ break;
4031
+ case "lax":
4032
+ i += "; SameSite=Lax";
4033
+ break;
4034
+ case "strict":
4035
+ i += "; SameSite=Strict";
4036
+ break;
4037
+ case "none":
4038
+ i += "; SameSite=None";
4039
+ break;
4040
+ default:
4041
+ throw new TypeError("option sameSite is invalid");
4042
+ }
4043
+ return r.partitioned && (i += "; Partitioned"), i;
4044
+ }, Sr = {
4045
+ create(a, e, t, r) {
4046
+ let n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
4047
+ path: "/",
4048
+ sameSite: "strict"
4049
+ };
4050
+ t && (n.expires = /* @__PURE__ */ new Date(), n.expires.setTime(n.expires.getTime() + t * 60 * 1e3)), r && (n.domain = r), document.cookie = Ya(a, e, n);
4051
+ },
4052
+ read(a) {
4053
+ const e = `${a}=`, t = document.cookie.split(";");
4054
+ for (let r = 0; r < t.length; r++) {
4055
+ let n = t[r];
4056
+ for (; n.charAt(0) === " "; ) n = n.substring(1, n.length);
4057
+ if (n.indexOf(e) === 0) return n.substring(e.length, n.length);
4058
+ }
4059
+ return null;
4060
+ },
4061
+ remove(a, e) {
4062
+ this.create(a, "", -1, e);
4063
+ }
4064
+ };
4065
+ var Xa = {
4066
+ name: "cookie",
4067
+ // Deconstruct the options object and extract the lookupCookie property
4068
+ lookup(a) {
4069
+ let {
4070
+ lookupCookie: e
4071
+ } = a;
4072
+ if (e && typeof document < "u")
4073
+ return Sr.read(e) || void 0;
4074
+ },
4075
+ // Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
4076
+ cacheUserLanguage(a, e) {
4077
+ let {
4078
+ lookupCookie: t,
4079
+ cookieMinutes: r,
4080
+ cookieDomain: n,
4081
+ cookieOptions: i
4082
+ } = e;
4083
+ t && typeof document < "u" && Sr.create(t, a, r, n, i);
4084
+ }
4085
+ }, Ga = {
4086
+ name: "querystring",
4087
+ // Deconstruct the options object and extract the lookupQuerystring property
4088
+ lookup(a) {
4089
+ var r;
4090
+ let {
4091
+ lookupQuerystring: e
4092
+ } = a, t;
4093
+ if (typeof window < "u") {
4094
+ let {
4095
+ search: n
4096
+ } = window.location;
4097
+ !window.location.search && ((r = window.location.hash) == null ? void 0 : r.indexOf("?")) > -1 && (n = window.location.hash.substring(window.location.hash.indexOf("?")));
4098
+ const o = n.substring(1).split("&");
4099
+ for (let l = 0; l < o.length; l++) {
4100
+ const c = o[l].indexOf("=");
4101
+ c > 0 && o[l].substring(0, c) === e && (t = o[l].substring(c + 1));
4102
+ }
4103
+ }
4104
+ return t;
4105
+ }
4106
+ }, Qa = {
4107
+ name: "hash",
4108
+ // Deconstruct the options object and extract the lookupHash property and the lookupFromHashIndex property
4109
+ lookup(a) {
4110
+ var n;
4111
+ let {
4112
+ lookupHash: e,
4113
+ lookupFromHashIndex: t
4114
+ } = a, r;
4115
+ if (typeof window < "u") {
4116
+ const {
4117
+ hash: i
4118
+ } = window.location;
4119
+ if (i && i.length > 2) {
4120
+ const o = i.substring(1);
4121
+ if (e) {
4122
+ const l = o.split("&");
4123
+ for (let c = 0; c < l.length; c++) {
4124
+ const d = l[c].indexOf("=");
4125
+ d > 0 && l[c].substring(0, d) === e && (r = l[c].substring(d + 1));
4126
+ }
4127
+ }
4128
+ if (r) return r;
4129
+ if (!r && t > -1) {
4130
+ const l = i.match(/\/([a-zA-Z-]*)/g);
4131
+ return Array.isArray(l) ? (n = l[typeof t == "number" ? t : 0]) == null ? void 0 : n.replace("/", "") : void 0;
4132
+ }
4133
+ }
4134
+ }
4135
+ return r;
4136
+ }
4137
+ };
4138
+ let Ne = null;
4139
+ const kr = () => {
4140
+ if (Ne !== null) return Ne;
4141
+ try {
4142
+ if (Ne = typeof window < "u" && window.localStorage !== null, !Ne)
4143
+ return !1;
4144
+ const a = "i18next.translate.boo";
4145
+ window.localStorage.setItem(a, "foo"), window.localStorage.removeItem(a);
4146
+ } catch {
4147
+ Ne = !1;
4148
+ }
4149
+ return Ne;
4150
+ };
4151
+ var ei = {
4152
+ name: "localStorage",
4153
+ // Deconstruct the options object and extract the lookupLocalStorage property
4154
+ lookup(a) {
4155
+ let {
4156
+ lookupLocalStorage: e
4157
+ } = a;
4158
+ if (e && kr())
4159
+ return window.localStorage.getItem(e) || void 0;
4160
+ },
4161
+ // Deconstruct the options object and extract the lookupLocalStorage property
4162
+ cacheUserLanguage(a, e) {
4163
+ let {
4164
+ lookupLocalStorage: t
4165
+ } = e;
4166
+ t && kr() && window.localStorage.setItem(t, a);
4167
+ }
4168
+ };
4169
+ let $e = null;
4170
+ const Er = () => {
4171
+ if ($e !== null) return $e;
4172
+ try {
4173
+ if ($e = typeof window < "u" && window.sessionStorage !== null, !$e)
4174
+ return !1;
4175
+ const a = "i18next.translate.boo";
4176
+ window.sessionStorage.setItem(a, "foo"), window.sessionStorage.removeItem(a);
4177
+ } catch {
4178
+ $e = !1;
4179
+ }
4180
+ return $e;
4181
+ };
4182
+ var ti = {
4183
+ name: "sessionStorage",
4184
+ lookup(a) {
4185
+ let {
4186
+ lookupSessionStorage: e
4187
+ } = a;
4188
+ if (e && Er())
4189
+ return window.sessionStorage.getItem(e) || void 0;
4190
+ },
4191
+ cacheUserLanguage(a, e) {
4192
+ let {
4193
+ lookupSessionStorage: t
4194
+ } = e;
4195
+ t && Er() && window.sessionStorage.setItem(t, a);
4196
+ }
4197
+ }, ri = {
4198
+ name: "navigator",
4199
+ lookup(a) {
4200
+ const e = [];
4201
+ if (typeof navigator < "u") {
4202
+ const {
4203
+ languages: t,
4204
+ userLanguage: r,
4205
+ language: n
4206
+ } = navigator;
4207
+ if (t)
4208
+ for (let i = 0; i < t.length; i++)
4209
+ e.push(t[i]);
4210
+ r && e.push(r), n && e.push(n);
4211
+ }
4212
+ return e.length > 0 ? e : void 0;
4213
+ }
4214
+ }, ni = {
4215
+ name: "htmlTag",
4216
+ // Deconstruct the options object and extract the htmlTag property
4217
+ lookup(a) {
4218
+ let {
4219
+ htmlTag: e
4220
+ } = a, t;
4221
+ const r = e || (typeof document < "u" ? document.documentElement : null);
4222
+ return r && typeof r.getAttribute == "function" && (t = r.getAttribute("lang")), t;
4223
+ }
4224
+ }, ai = {
4225
+ name: "path",
4226
+ // Deconstruct the options object and extract the lookupFromPathIndex property
4227
+ lookup(a) {
4228
+ var n;
4229
+ let {
4230
+ lookupFromPathIndex: e
4231
+ } = a;
4232
+ if (typeof window > "u") return;
4233
+ const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
4234
+ return Array.isArray(t) ? (n = t[typeof e == "number" ? e : 0]) == null ? void 0 : n.replace("/", "") : void 0;
4235
+ }
4236
+ }, ii = {
4237
+ name: "subdomain",
4238
+ lookup(a) {
4239
+ var n, i;
4240
+ let {
4241
+ lookupFromSubdomainIndex: e
4242
+ } = a;
4243
+ const t = typeof e == "number" ? e + 1 : 1, r = typeof window < "u" && ((i = (n = window.location) == null ? void 0 : n.hostname) == null ? void 0 : i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));
4244
+ if (r)
4245
+ return r[t];
4246
+ }
4247
+ };
4248
+ let Wr = !1;
4249
+ try {
4250
+ document.cookie, Wr = !0;
4251
+ } catch {
4252
+ }
4253
+ const zr = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
4254
+ Wr || zr.splice(1, 1);
4255
+ const si = () => ({
4256
+ order: zr,
4257
+ lookupQuerystring: "lng",
4258
+ lookupCookie: "i18next",
4259
+ lookupLocalStorage: "i18nextLng",
4260
+ lookupSessionStorage: "i18nextLng",
4261
+ // cache user language
4262
+ caches: ["localStorage"],
4263
+ excludeCacheFor: ["cimode"],
4264
+ // cookieMinutes: 10,
4265
+ // cookieDomain: 'myDomain'
4266
+ convertDetectedLanguage: (a) => a
4267
+ });
4268
+ class qr {
4269
+ constructor(e) {
4270
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4271
+ this.type = "languageDetector", this.detectors = {}, this.init(e, t);
4272
+ }
4273
+ init() {
4274
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
4275
+ languageUtils: {}
4276
+ }, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
4277
+ this.services = e, this.options = Ja(t, this.options || {}, si()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (n) => n.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = r, this.addDetector(Xa), this.addDetector(Ga), this.addDetector(ei), this.addDetector(ti), this.addDetector(ri), this.addDetector(ni), this.addDetector(ai), this.addDetector(ii), this.addDetector(Qa);
4278
+ }
4279
+ addDetector(e) {
4280
+ return this.detectors[e.name] = e, this;
4281
+ }
4282
+ detect() {
4283
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
4284
+ return e.forEach((r) => {
4285
+ if (this.detectors[r]) {
4286
+ let n = this.detectors[r].lookup(this.options);
4287
+ n && typeof n == "string" && (n = [n]), n && (t = t.concat(n));
4288
+ }
4289
+ }), t = t.filter((r) => r != null && !Za(r)).map((r) => this.options.convertDetectedLanguage(r)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
4290
+ }
4291
+ cacheUserLanguage(e) {
4292
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
4293
+ t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach((r) => {
4294
+ this.detectors[r] && this.detectors[r].cacheUserLanguage(e, this.options);
4295
+ }));
4296
+ }
4297
+ }
4298
+ qr.type = "languageDetector";
4299
+ const Kr = {
4300
+ apiBaseUrl: "https://api.nemme.io",
4301
+ debug: !1
4302
+ }, oi = "Previous", li = "Next", ui = {
4303
+ Previous: oi,
4304
+ Next: li,
4305
+ "Type your answer here": "Type your answer here",
4306
+ "Max {{maxCharacters}} characters": "Max {{maxCharacters}} characters"
4307
+ }, ci = {};
4308
+ xa({ locale: Oa });
4309
+ J.use(qr).use(mn).init({
4310
+ debug: Kr.debug,
4311
+ fallbackLng: "en",
4312
+ interpolation: {
4313
+ escapeValue: !1
4314
+ // not needed for react as it escapes by default
4315
+ },
4316
+ resources: {
4317
+ en: {
4318
+ translation: ui
4319
+ },
4320
+ nb: {
4321
+ tranlation: ci
4322
+ }
4323
+ }
4324
+ });
4325
+ const Or = {
4326
+ debug: 0,
4327
+ info: 1,
4328
+ warn: 2,
4329
+ error: 3
4330
+ };
4331
+ class Yt {
4332
+ constructor(e = {}) {
4333
+ I(this, "prefix");
4334
+ I(this, "enabled");
4335
+ I(this, "level");
4336
+ this.prefix = e.prefix || "Nemme SDK", this.enabled = e.enabled !== void 0 ? e.enabled : !0, this.level = e.level || "info";
4337
+ }
4338
+ shouldLog(e) {
4339
+ return this.enabled && Or[e] >= Or[this.level];
4340
+ }
4341
+ formatMessage(e) {
4342
+ return `[${this.prefix}] ${e}`;
4343
+ }
4344
+ debug(e, ...t) {
4345
+ this.shouldLog("debug") && console.debug(this.formatMessage(e), ...t);
4346
+ }
4347
+ info(e, ...t) {
4348
+ this.shouldLog("info") && console.info(this.formatMessage(e), ...t);
4349
+ }
4350
+ warn(e, ...t) {
4351
+ this.shouldLog("warn") && console.warn(this.formatMessage(e), ...t);
4352
+ }
4353
+ error(e, ...t) {
4354
+ this.shouldLog("error") && console.error(this.formatMessage(e), ...t);
4355
+ }
4356
+ // Create a child logger with a new prefix
4357
+ child(e) {
4358
+ return new Yt({
4359
+ prefix: `${this.prefix}:${e}`,
4360
+ enabled: this.enabled,
4361
+ level: this.level
4362
+ });
4363
+ }
4364
+ // Configure logger settings
4365
+ configure(e) {
4366
+ e.prefix !== void 0 && (this.prefix = e.prefix), e.enabled !== void 0 && (this.enabled = e.enabled), e.level !== void 0 && (this.level = e.level);
4367
+ }
4368
+ }
4369
+ const Jr = new Yt(), Pr = Jr.child("network"), di = 3e4, fi = (a, e) => {
4370
+ const t = new URL(a, Kr.apiBaseUrl);
4371
+ return e && Object.entries(e).forEach(([r, n]) => {
4372
+ n != null && t.searchParams.append(r, String(n));
4373
+ }), t.toString();
4374
+ }, pe = {
4375
+ /**
4376
+ * Make an HTTP request
4377
+ */
4378
+ async request(a, e = {}) {
4379
+ const { method: t = "GET", headers: r = {}, body: n, params: i, timeout: o = di } = e, l = fi(a, i), c = {
4380
+ "Content-Type": "application/json",
4381
+ Accept: "application/json",
4382
+ ...r
4383
+ }, d = {
4384
+ method: t,
4385
+ headers: c,
4386
+ body: n ? JSON.stringify(n) : void 0
4387
+ }, h = new AbortController(), p = setTimeout(() => h.abort(), o);
4388
+ d.signal = h.signal;
4389
+ try {
4390
+ const g = await fetch(l, d);
4391
+ let y;
4392
+ const v = g.headers.get("content-type");
4393
+ if (v && v.includes("application/json"))
4394
+ y = await g.json();
4395
+ else {
4396
+ const C = await g.text();
4397
+ try {
4398
+ y = JSON.parse(C);
4399
+ } catch {
4400
+ y = C;
4401
+ }
4402
+ }
4403
+ const k = {
4404
+ data: y,
4405
+ status: g.status,
4406
+ statusText: g.statusText,
4407
+ headers: g.headers,
4408
+ ok: g.ok
4409
+ };
4410
+ if (g.ok)
4411
+ k.ok = !0;
4412
+ else {
4413
+ const C = `Request failed with status ${g.status}: ${g.statusText}`;
4414
+ Pr.error(C, {
4415
+ url: l,
4416
+ method: t,
4417
+ status: g.status,
4418
+ data: k.data
4419
+ }), k.ok = !1, k.error = {
4420
+ message: C,
4421
+ details: k.data
4422
+ };
4423
+ }
4424
+ return k;
4425
+ } catch (g) {
4426
+ let y = "Network request failed", v = {};
4427
+ return g instanceof DOMException && g.name === "AbortError" ? (y = `Request timeout after ${o}ms`, v = { timeout: o, url: l }) : v = {
4428
+ message: g instanceof Error ? g.message : String(g),
4429
+ url: l,
4430
+ method: t
4431
+ }, Pr.error(y, v), {
4432
+ data: {},
4433
+ status: 0,
4434
+ statusText: y,
4435
+ headers: new Headers(),
4436
+ ok: !1,
4437
+ error: {
4438
+ message: y,
4439
+ details: v
4440
+ }
4441
+ };
4442
+ } finally {
4443
+ clearTimeout(p);
4444
+ }
4445
+ },
4446
+ /**
4447
+ * Convenience methods for common HTTP methods
4448
+ */
4449
+ async get(a, e = {}) {
4450
+ return this.request(a, { ...e, method: "GET" });
4451
+ },
4452
+ async post(a, e, t = {}) {
4453
+ return this.request(a, { ...t, method: "POST", body: e });
4454
+ },
4455
+ async put(a, e, t = {}) {
4456
+ return this.request(a, { ...t, method: "PUT", body: e });
4457
+ },
4458
+ async patch(a, e, t = {}) {
4459
+ return this.request(a, { ...t, method: "PATCH", body: e });
4460
+ },
4461
+ async delete(a, e = {}) {
4462
+ return this.request(a, { ...e, method: "DELETE" });
4463
+ }
4464
+ };
4465
+ class hi {
4466
+ constructor(e, t) {
4467
+ I(this, "logger");
4468
+ I(this, "headers");
4469
+ this.logger = e, this.headers = t;
4470
+ }
4471
+ async fetchAndDisplayForm(e, t, r) {
4472
+ this.logger.debug(`Fetching form config for: ${e}`);
4473
+ try {
4474
+ const n = await pe.get(`/external/forms/${e}`, {
4475
+ headers: this.headers
4476
+ });
4477
+ n.ok && n.data ? (this.logger.info(`Form config loaded for: ${e}`, n.data), this.displayForm(n.data, t, r)) : this.logger.warn(`No form config found for: ${e}`);
4478
+ } catch (n) {
4479
+ this.logger.error(`Failed to fetch form config for: ${e}`, n);
4480
+ }
4481
+ }
4482
+ displayForm(e, t, r) {
4483
+ const n = document.createElement("div");
4484
+ n.id = "nm", document.body.appendChild(n);
4485
+ const i = nn.createRoot(n), o = Ut(
4486
+ xn,
4487
+ { i18n: J },
4488
+ Ut(On, {
4489
+ form: e,
4490
+ onDismiss: async (l) => {
4491
+ await t(), await this.postFormResponse(e, l), i.unmount(), n.remove(), this.logger.info("Form dismissed", l);
4492
+ },
4493
+ onComplete: async (l) => {
4494
+ await r(), await this.postFormResponse(e, l), i.unmount(), n.remove(), this.logger.info("Form completed", l);
4495
+ }
4496
+ })
4497
+ );
4498
+ i.render(o);
4499
+ }
4500
+ async postFormResponse(e, t) {
4501
+ this.logger.info("Posting form response", t);
4502
+ const r = await pe.post(`/external/forms/${e.slug}`, t, {
4503
+ headers: this.headers
4504
+ });
4505
+ this.logger.info("Form response posted", r.data);
4506
+ }
4507
+ }
4508
+ class pi {
4509
+ constructor(e, t) {
4510
+ I(this, "logger");
4511
+ I(this, "headers");
4512
+ I(this, "formManager");
4513
+ I(this, "deliveries", []);
4514
+ this.logger = e, this.headers = t, this.formManager = new hi(e, t);
4515
+ }
4516
+ async loadDeliveries() {
4517
+ try {
4518
+ this.logger.debug("Loading deliveries");
4519
+ const e = await pe.get("/external/deliveries", { headers: this.headers });
4520
+ this.deliveries = e.data, this.logger.info(`Loaded ${this.deliveries.length} deliveries`);
4521
+ } catch (e) {
4522
+ this.logger.error("Failed to load deliveries", e), this.deliveries = [];
4523
+ }
4524
+ }
4525
+ async evaluateDeliveryTriggers(e) {
4526
+ for (const t of this.deliveries)
4527
+ for (const r of t.triggers)
4528
+ if (this.shouldTriggerDelivery(r, e)) {
4529
+ if (!await this.isDeliveryValid(t)) {
4530
+ this.logger.debug(`Delivery ${t.id} is not valid, skipping`);
4531
+ continue;
4532
+ }
4533
+ await this.executeDelivery(t, r);
4534
+ return;
4535
+ }
4536
+ }
4537
+ shouldTriggerDelivery(e, t) {
4538
+ if (this.hasActiveDelivery())
4539
+ return !1;
4540
+ switch (e.triggerType) {
4541
+ case "page_url":
4542
+ return e.urlPattern ? this.matchesUrlPattern(t.url, e.urlPattern) : !0;
4543
+ case "custom_event":
4544
+ return e.eventName ? t.eventName === e.eventName : !1;
4545
+ default:
4546
+ return !1;
4547
+ }
4548
+ }
4549
+ hasActiveDelivery() {
4550
+ return document.getElementById("nm") !== null;
4551
+ }
4552
+ async executeDelivery(e, t) {
4553
+ if (e.productType === "FRM") {
4554
+ this.logger.debug(`Triggering form delivery: ${e.productSlug}`, {
4555
+ triggerType: t.triggerType,
4556
+ urlPattern: t.urlPattern,
4557
+ eventName: t.eventName
4558
+ });
4559
+ try {
4560
+ const n = await this.createDeliveryResponse(e);
4561
+ await this.formManager.fetchAndDisplayForm(
4562
+ e.productSlug,
4563
+ async () => {
4564
+ this.logger.debug(`Form for delivery: ${e.productSlug} was cancelled`), n && await this.updateDeliveryResponse(e.id, n.id, !0);
4565
+ },
4566
+ async () => {
4567
+ this.logger.debug(`Form for delivery: ${e.productSlug} was completed`), n && await this.updateDeliveryResponse(e.id, n.id, !1, !0);
4568
+ }
4569
+ );
4570
+ } catch (n) {
4571
+ this.logger.error(`Failed to load form for delivery: ${e.productSlug}`, n);
4572
+ }
4573
+ }
4574
+ }
4575
+ matchesUrlPattern(e, t) {
4576
+ let r;
4577
+ try {
4578
+ r = new URL(e).pathname;
4579
+ } catch {
4580
+ r = e.startsWith("/") ? e : `/${e}`;
4581
+ }
4582
+ const n = t.replace(/\*\*/g, "§DOUBLE_STAR§").replace(/\*/g, "[^/]*").replace(/§DOUBLE_STAR§/g, ".*").replace(/\?/g, "."), o = new RegExp(`^${n}$`).test(r);
4583
+ return this.logger.debug("URL pattern matching", {
4584
+ originalUrl: e,
4585
+ pathname: r,
4586
+ pattern: t,
4587
+ regexPattern: n,
4588
+ matches: o
4589
+ }), o;
4590
+ }
4591
+ async createDeliveryResponse(e) {
4592
+ try {
4593
+ return (await pe.post(
4594
+ `/external/deliveries/${e.id}/responses`,
4595
+ {},
4596
+ { headers: this.headers }
4597
+ )).data;
4598
+ } catch (t) {
4599
+ this.logger.error(`Failed to create delivery response for delivery: ${e.id}`, t);
4600
+ }
4601
+ }
4602
+ async updateDeliveryResponse(e, t, r = !1, n = !1) {
4603
+ try {
4604
+ await pe.patch(
4605
+ `/external/deliveries/${e}/responses/${t}`,
4606
+ { wasDismissed: r, wasCompleted: n },
4607
+ { headers: this.headers }
4608
+ );
4609
+ } catch (i) {
4610
+ this.logger.error(`Failed to update delivery response: ${t} for delivery: ${e}`, i);
4611
+ }
4612
+ }
4613
+ async isDeliveryValid(e) {
4614
+ try {
4615
+ return (await pe.get(`/external/deliveries/${e.id}/should-deliver`, {
4616
+ headers: this.headers
4617
+ })).data;
4618
+ } catch (t) {
4619
+ return this.logger.error(`Failed to get delivery should-deliver for delivery: ${e.id}`, t), !1;
4620
+ }
4621
+ }
4622
+ }
4623
+ class gi {
4624
+ constructor({ logger: e, headers: t, sessionId: r, eventDefinitions: n, batchConfig: i, onPageView: o }) {
4625
+ I(this, "logger");
4626
+ I(this, "headers");
4627
+ I(this, "sessionId");
4628
+ I(this, "eventDefinitions", []);
4629
+ I(this, "onPageView");
4630
+ // Batching
4631
+ I(this, "backlog", []);
4632
+ I(this, "flushTimeout", null);
4633
+ I(this, "batchConfig", {
4634
+ enabled: !0,
4635
+ size: 10,
4636
+ delayMs: 1e4,
4637
+ // 10 seconds
4638
+ sendOnUnload: !0
4639
+ });
4640
+ // Page view tracking
4641
+ I(this, "originalHistoryMethods", null);
4642
+ I(this, "EVENT_PAGE_VIEW", "page_view");
4643
+ this.logger = e, this.headers = t, this.sessionId = r, this.eventDefinitions = n, this.onPageView = o, this.flushEvents = this.flushEvents.bind(this), this.handlePopState = this.handlePopState.bind(this), this.handleVisibilityChange = this.handleVisibilityChange.bind(this), this.setupBatching(i);
4644
+ }
4645
+ setupBatching(e) {
4646
+ typeof e == "boolean" ? this.batchConfig.enabled = e : e && (this.batchConfig = {
4647
+ ...this.batchConfig,
4648
+ ...e
4649
+ }), this.batchConfig.enabled && this.batchConfig.sendOnUnload && typeof window < "u" && (window.addEventListener("beforeunload", this.flushEvents), window.addEventListener("pagehide", this.flushEvents));
4650
+ }
4651
+ async setupPageViewTracking() {
4652
+ if (typeof window > "u") return;
4653
+ this.originalHistoryMethods = {
4654
+ pushState: history.pushState,
4655
+ replaceState: history.replaceState
4656
+ };
4657
+ const e = history.pushState;
4658
+ history.pushState = async (...r) => {
4659
+ e.apply(history, r), await this.trackPageView();
4660
+ };
4661
+ const t = history.replaceState;
4662
+ history.replaceState = async (...r) => {
4663
+ t.apply(history, r), await this.trackPageView();
4664
+ }, window.addEventListener("popstate", this.handlePopState), document.addEventListener("visibilitychange", this.handleVisibilityChange);
4665
+ }
4666
+ async track(e) {
4667
+ if (!this.sessionId) {
4668
+ this.logger.warn("Tracking manager not initialized, cannot track event");
4669
+ return;
4670
+ }
4671
+ const { eventKey: t, data: r = {} } = e;
4672
+ this.logger.debug("Tracking event", { eventKey: t, data: r });
4673
+ const n = {
4674
+ sessionId: this.sessionId,
4675
+ eventKey: t,
4676
+ data: r || {},
4677
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
4678
+ page: window.location.href
4679
+ };
4680
+ this.validateEvent(n), this.batchConfig.enabled ? (this.backlog.push(n), this.scheduleFlush()) : await this.sendEvents([n]);
4681
+ }
4682
+ async trackPageView() {
4683
+ var e;
4684
+ typeof window > "u" || (await this.track({
4685
+ eventKey: this.EVENT_PAGE_VIEW,
4686
+ data: {
4687
+ title: document.title
4688
+ }
4689
+ }), (e = this.onPageView) == null || e.call(this, window.location.href));
4690
+ }
4691
+ /**
4692
+ * Manually flush any pending events
4693
+ */
4694
+ async flush() {
4695
+ return this.flushEvents();
4696
+ }
4697
+ /**
4698
+ * Clean up event listeners and restore original history methods
4699
+ */
4700
+ destroy() {
4701
+ this.originalHistoryMethods && (history.pushState = this.originalHistoryMethods.pushState, history.replaceState = this.originalHistoryMethods.replaceState, this.originalHistoryMethods = null), typeof window < "u" && (window.removeEventListener("popstate", this.handlePopState), document.removeEventListener("visibilitychange", this.handleVisibilityChange), window.removeEventListener("beforeunload", this.flushEvents), window.removeEventListener("pagehide", this.flushEvents)), this.flushTimeout && (clearTimeout(this.flushTimeout), this.flushTimeout = null);
4702
+ }
4703
+ validateEvent(e) {
4704
+ if (e.eventKey === this.EVENT_PAGE_VIEW) return;
4705
+ const t = this.eventDefinitions.find((i) => i.eventKey === e.eventKey);
4706
+ if (!t) {
4707
+ this.logger.warn(`Event ${e.eventKey} is not registered`);
4708
+ return;
4709
+ }
4710
+ const r = t.properties, n = e.data;
4711
+ if (n)
4712
+ for (const i of Object.keys(n)) {
4713
+ const o = n[i], l = r.find((c) => c.name === i);
4714
+ if (!l) {
4715
+ this.logger.warn(`Property ${i} is not registered for event ${e.eventKey}`);
4716
+ return;
4717
+ }
4718
+ l.type === "string" && typeof o != "string" && this.logger.warn(
4719
+ `Property ${l.name} has type ${l.type} but value is of type ${typeof o}`
4720
+ ), l.type === "boolean" && typeof o != "boolean" && this.logger.warn(
4721
+ `Property ${l.name} has type ${l.type} but value is of type ${typeof o}`
4722
+ ), l.type === "number" && typeof o != "number" && this.logger.warn(
4723
+ `Property ${l.name} has type ${l.type} but value is of type ${typeof o}`
4724
+ );
4725
+ }
4726
+ }
4727
+ async handlePopState() {
4728
+ await this.trackPageView();
4729
+ }
4730
+ async handleVisibilityChange() {
4731
+ document.visibilityState === "visible" && await this.trackPageView();
4732
+ }
4733
+ scheduleFlush() {
4734
+ if (this.backlog.length >= this.batchConfig.size) {
4735
+ this.flushEvents();
4736
+ return;
4737
+ }
4738
+ this.flushTimeout || (this.flushTimeout = window.setTimeout(() => {
4739
+ this.flushEvents();
4740
+ }, this.batchConfig.delayMs));
4741
+ }
4742
+ async flushEvents() {
4743
+ if (this.flushTimeout && (clearTimeout(this.flushTimeout), this.flushTimeout = null), this.backlog.length === 0) return;
4744
+ const e = [...this.backlog];
4745
+ this.backlog = [];
4746
+ try {
4747
+ await this.sendEvents(e);
4748
+ } catch (t) {
4749
+ this.backlog.unshift(...e), this.logger.error("Failed to send batched events", t);
4750
+ }
4751
+ }
4752
+ async sendEvents(e) {
4753
+ if (e.length !== 0)
4754
+ if (e.length === 1) {
4755
+ const t = e[0];
4756
+ await pe.post("/external/trackings/track", t, { headers: this.headers });
4757
+ } else
4758
+ await pe.post("/external/trackings/batch", e, { headers: this.headers });
4759
+ }
4760
+ }
4761
+ class Zr {
4762
+ constructor(e) {
4763
+ I(this, "clientKey");
4764
+ I(this, "userIdentifier");
4765
+ I(this, "initialized", !1);
4766
+ I(this, "clientLogger", Jr.child("client"));
4767
+ I(this, "headers", {});
4768
+ // Module managers
4769
+ I(this, "trackingManager");
4770
+ this.clientKey = e;
4771
+ }
4772
+ /**
4773
+ * Create a new Nemme SDK client instance
4774
+ */
4775
+ async init({ userIdentifier: e, debug: t = !1, batch: r }) {
4776
+ if (!e) throw new Error("userIdentifier is required parameter");
4777
+ this.userIdentifier = e, this.clientLogger.configure({
4778
+ enabled: t,
4779
+ level: t ? "debug" : "info"
4780
+ }), this.headers = {
4781
+ "X-Client-Key": this.clientKey,
4782
+ "X-User-Id": this.userIdentifier
4783
+ };
4784
+ try {
4785
+ const n = await this.initializeSession();
4786
+ await this.initializeManagers(n, r), this.initialized = !0, this.clientLogger.info("Nemme client initialized", {
4787
+ clientKey: this.clientKey,
4788
+ userIdentifier: this.userIdentifier
4789
+ });
4790
+ } catch (n) {
4791
+ this.clientLogger.error("Error during initialization:", n);
4792
+ }
4793
+ return this;
4794
+ }
4795
+ async flush() {
4796
+ var e;
4797
+ return (e = this.trackingManager) == null ? void 0 : e.flush();
4798
+ }
4799
+ destroy() {
4800
+ var e;
4801
+ (e = this.trackingManager) == null || e.destroy();
4802
+ }
4803
+ async track(e) {
4804
+ if (!this.initialized || !this.trackingManager) {
4805
+ this.clientLogger.warn("Nemme client not initialized, some operations may fail");
4806
+ return;
4807
+ }
4808
+ return this.trackingManager.track(e);
4809
+ }
4810
+ async initializeSession() {
4811
+ var e;
4812
+ try {
4813
+ const t = await pe.post(
4814
+ "/external/trackings/initialize",
4815
+ {},
4816
+ { headers: this.headers }
4817
+ );
4818
+ if (!t.ok)
4819
+ throw new Error(((e = t.error) == null ? void 0 : e.message) || "Request for initialising session failed");
4820
+ return t.data;
4821
+ } catch (t) {
4822
+ throw this.clientLogger.error("Error during initialization", t), t;
4823
+ }
4824
+ }
4825
+ async initializeManagers(e, t) {
4826
+ const r = new pi(this.clientLogger, this.headers), n = new gi({
4827
+ logger: this.clientLogger,
4828
+ headers: this.headers,
4829
+ sessionId: e.sessionId,
4830
+ eventDefinitions: e.eventDefinitions,
4831
+ batchConfig: t,
4832
+ onPageView: async (i) => {
4833
+ await r.evaluateDeliveryTriggers({ url: i });
4834
+ }
4835
+ });
4836
+ await r.loadDeliveries(), typeof window < "u" && (await n.setupPageViewTracking(), await n.trackPageView(), await n.flush()), this.trackingManager = n;
4837
+ }
4838
+ }
4839
+ const mi = (a) => new Zr(a), Yr = Jt(void 0), wi = ({
4840
+ clientKey: a,
4841
+ config: e,
4842
+ children: t
4843
+ }) => {
4844
+ const [r, n] = Ye(null), [i, o] = Ye(!1), [l, c] = Ye(null);
4845
+ pt(() => {
4846
+ let h = null, p = !1;
4847
+ const g = async () => {
4848
+ try {
4849
+ const y = new Zr(a);
4850
+ if (await y.init(e), p) {
4851
+ y.destroy();
4852
+ return;
4853
+ }
4854
+ h = y, n(y), o(!0), c(null);
4855
+ } catch (y) {
4856
+ p || (c(y instanceof Error ? y.message : "Failed to initialize Nemme client"), o(!1));
4857
+ }
4858
+ };
4859
+ return n(null), o(!1), c(null), g(), () => {
4860
+ p = !0, h && h.destroy();
4861
+ };
4862
+ }, [a, e]);
4863
+ const d = {
4864
+ client: r,
4865
+ isInitialized: i,
4866
+ error: l
4867
+ };
4868
+ return /* @__PURE__ */ S.jsx(Yr.Provider, { value: d, children: t });
4869
+ }, yi = () => {
4870
+ const a = Rr(Yr);
4871
+ if (a === void 0)
4872
+ throw new Error("useNemmeContext must be used within a NemmeProvider");
4873
+ return a;
4874
+ }, Si = () => {
4875
+ const { client: a, isInitialized: e, error: t } = yi(), r = Ee(async (i) => {
4876
+ if (!a || !e) {
4877
+ console.warn("Nemme client not initialized");
4878
+ return;
4879
+ }
4880
+ return a.track(i);
4881
+ }, [a, e]), n = Ee(async () => {
4882
+ if (!a || !e) {
4883
+ console.warn("Nemme client not initialized");
4884
+ return;
4885
+ }
4886
+ return a.flush();
4887
+ }, [a, e]);
4888
+ return {
4889
+ track: r,
4890
+ flush: n,
4891
+ isInitialized: e,
4892
+ error: t,
4893
+ client: a
4894
+ };
4895
+ }, ki = (a) => mi(a);
4896
+ export {
4897
+ Zr as NemmeClient,
4898
+ wi as NemmeProvider,
4899
+ ki as NemmeSDK,
4900
+ ki as default,
4901
+ Si as useNemme,
4902
+ yi as useNemmeContext
4903
+ };
4904
+ //# sourceMappingURL=index.esm.js.map