@prosopo/cli 3.8.15 → 3.8.18

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.
@@ -1,905 +0,0 @@
1
- import { n as e, t } from "./i18next-CzgfK_Ir.js";
2
- import { l as n } from "./provider.cli.bundle.js";
3
- //#region ../../node_modules/react-i18next/dist/es/unescape.js
4
- var r = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, i = {
5
- "&": "&",
6
- "&": "&",
7
- "&lt;": "<",
8
- "&#60;": "<",
9
- "&gt;": ">",
10
- "&#62;": ">",
11
- "&apos;": "'",
12
- "&#39;": "'",
13
- "&quot;": "\"",
14
- "&#34;": "\"",
15
- "&nbsp;": " ",
16
- "&#160;": " ",
17
- "&copy;": "©",
18
- "&#169;": "©",
19
- "&reg;": "®",
20
- "&#174;": "®",
21
- "&hellip;": "…",
22
- "&#8230;": "…",
23
- "&#x2F;": "/",
24
- "&#47;": "/"
25
- }, a = (e) => i[e], o = {
26
- bindI18n: "languageChanged",
27
- bindI18nStore: "",
28
- transEmptyNodeValue: "",
29
- transSupportBasicHtmlNodes: !0,
30
- transWrapTextNodes: "",
31
- transKeepBasicHtmlNodesFor: [
32
- "br",
33
- "strong",
34
- "i",
35
- "p"
36
- ],
37
- useSuspense: !0,
38
- unescape: (e) => e.replace(r, a),
39
- transDefaultProps: void 0
40
- }, s = (e = {}) => {
41
- o = {
42
- ...o,
43
- ...e
44
- };
45
- }, c = {
46
- type: "3rdParty",
47
- init(e) {
48
- s(e.options.react);
49
- }
50
- }, { slice: l, forEach: u } = [];
51
- function d(e) {
52
- return u.call(l.call(arguments, 1), (t) => {
53
- if (t) for (let n in t) e[n] === void 0 && (e[n] = t[n]);
54
- }), e;
55
- }
56
- function f(e) {
57
- return typeof e == "string" && [
58
- /<\s*script.*?>/i,
59
- /<\s*\/\s*script\s*>/i,
60
- /<\s*img.*?on\w+\s*=/i,
61
- /<\s*\w+\s*on\w+\s*=.*?>/i,
62
- /javascript\s*:/i,
63
- /vbscript\s*:/i,
64
- /expression\s*\(/i,
65
- /eval\s*\(/i,
66
- /alert\s*\(/i,
67
- /document\.cookie/i,
68
- /document\.write\s*\(/i,
69
- /window\.location/i,
70
- /innerHTML/i
71
- ].some((t) => t.test(e));
72
- }
73
- var p = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, ee = function(e, t) {
74
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { path: "/" }, r = `${e}=${encodeURIComponent(t)}`;
75
- if (n.maxAge > 0) {
76
- let e = n.maxAge - 0;
77
- if (Number.isNaN(e)) throw Error("maxAge should be a Number");
78
- r += `; Max-Age=${Math.floor(e)}`;
79
- }
80
- if (n.domain) {
81
- if (!p.test(n.domain)) throw TypeError("option domain is invalid");
82
- r += `; Domain=${n.domain}`;
83
- }
84
- if (n.path) {
85
- if (!p.test(n.path)) throw TypeError("option path is invalid");
86
- r += `; Path=${n.path}`;
87
- }
88
- if (n.expires) {
89
- if (typeof n.expires.toUTCString != "function") throw TypeError("option expires is invalid");
90
- r += `; Expires=${n.expires.toUTCString()}`;
91
- }
92
- if (n.httpOnly && (r += "; HttpOnly"), n.secure && (r += "; Secure"), n.sameSite) switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
93
- case !0:
94
- r += "; SameSite=Strict";
95
- break;
96
- case "lax":
97
- r += "; SameSite=Lax";
98
- break;
99
- case "strict":
100
- r += "; SameSite=Strict";
101
- break;
102
- case "none":
103
- r += "; SameSite=None";
104
- break;
105
- default: throw TypeError("option sameSite is invalid");
106
- }
107
- return n.partitioned && (r += "; Partitioned"), r;
108
- }, m = {
109
- create(e, t, n, r) {
110
- let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
111
- path: "/",
112
- sameSite: "strict"
113
- };
114
- n && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + n * 60 * 1e3)), r && (i.domain = r), document.cookie = ee(e, t, i);
115
- },
116
- read(e) {
117
- let t = `${e}=`, n = document.cookie.split(";");
118
- for (let e = 0; e < n.length; e++) {
119
- let r = n[e];
120
- for (; r.charAt(0) === " ";) r = r.substring(1, r.length);
121
- if (r.indexOf(t) === 0) return r.substring(t.length, r.length);
122
- }
123
- return null;
124
- },
125
- remove(e, t) {
126
- this.create(e, "", -1, t);
127
- }
128
- }, te = {
129
- name: "cookie",
130
- lookup(e) {
131
- let { lookupCookie: t } = e;
132
- if (t && typeof document < "u") return m.read(t) || void 0;
133
- },
134
- cacheUserLanguage(e, t) {
135
- let { lookupCookie: n, cookieMinutes: r, cookieDomain: i, cookieOptions: a } = t;
136
- n && typeof document < "u" && m.create(n, e, r, i, a);
137
- }
138
- }, ne = {
139
- name: "querystring",
140
- lookup(e) {
141
- let { lookupQuerystring: t } = e, n;
142
- if (typeof window < "u") {
143
- let { search: e } = window.location;
144
- !window.location.search && window.location.hash?.indexOf("?") > -1 && (e = window.location.hash.substring(window.location.hash.indexOf("?")));
145
- let r = e.substring(1).split("&");
146
- for (let e = 0; e < r.length; e++) {
147
- let i = r[e].indexOf("=");
148
- i > 0 && r[e].substring(0, i) === t && (n = r[e].substring(i + 1));
149
- }
150
- }
151
- return n;
152
- }
153
- }, re = {
154
- name: "hash",
155
- lookup(e) {
156
- let { lookupHash: t, lookupFromHashIndex: n } = e, r;
157
- if (typeof window < "u") {
158
- let { hash: e } = window.location;
159
- if (e && e.length > 2) {
160
- let i = e.substring(1);
161
- if (t) {
162
- let e = i.split("&");
163
- for (let n = 0; n < e.length; n++) {
164
- let i = e[n].indexOf("=");
165
- i > 0 && e[n].substring(0, i) === t && (r = e[n].substring(i + 1));
166
- }
167
- }
168
- if (r) return r;
169
- if (!r && n > -1) {
170
- let t = e.match(/\/([a-zA-Z-]*)/g);
171
- return Array.isArray(t) ? t[typeof n == "number" ? n : 0]?.replace("/", "") : void 0;
172
- }
173
- }
174
- }
175
- return r;
176
- }
177
- }, h = null, g = () => {
178
- if (h !== null) return h;
179
- try {
180
- if (h = typeof window < "u" && window.localStorage !== null, !h) return !1;
181
- let e = "i18next.translate.boo";
182
- window.localStorage.setItem(e, "foo"), window.localStorage.removeItem(e);
183
- } catch {
184
- h = !1;
185
- }
186
- return h;
187
- }, ie = {
188
- name: "localStorage",
189
- lookup(e) {
190
- let { lookupLocalStorage: t } = e;
191
- if (t && g()) return window.localStorage.getItem(t) || void 0;
192
- },
193
- cacheUserLanguage(e, t) {
194
- let { lookupLocalStorage: n } = t;
195
- n && g() && window.localStorage.setItem(n, e);
196
- }
197
- }, _ = null, v = () => {
198
- if (_ !== null) return _;
199
- try {
200
- if (_ = typeof window < "u" && window.sessionStorage !== null, !_) return !1;
201
- let e = "i18next.translate.boo";
202
- window.sessionStorage.setItem(e, "foo"), window.sessionStorage.removeItem(e);
203
- } catch {
204
- _ = !1;
205
- }
206
- return _;
207
- }, y = {
208
- name: "sessionStorage",
209
- lookup(e) {
210
- let { lookupSessionStorage: t } = e;
211
- if (t && v()) return window.sessionStorage.getItem(t) || void 0;
212
- },
213
- cacheUserLanguage(e, t) {
214
- let { lookupSessionStorage: n } = t;
215
- n && v() && window.sessionStorage.setItem(n, e);
216
- }
217
- }, ae = {
218
- name: "navigator",
219
- lookup(e) {
220
- let t = [];
221
- if (typeof navigator < "u") {
222
- let { languages: e, userLanguage: n, language: r } = navigator;
223
- if (e) for (let n = 0; n < e.length; n++) t.push(e[n]);
224
- n && t.push(n), r && t.push(r);
225
- }
226
- return t.length > 0 ? t : void 0;
227
- }
228
- }, oe = {
229
- name: "htmlTag",
230
- lookup(e) {
231
- let { htmlTag: t } = e, n, r = t || (typeof document < "u" ? document.documentElement : null);
232
- return r && typeof r.getAttribute == "function" && (n = r.getAttribute("lang")), n;
233
- }
234
- }, se = {
235
- name: "path",
236
- lookup(e) {
237
- let { lookupFromPathIndex: t } = e;
238
- if (typeof window > "u") return;
239
- let n = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
240
- if (Array.isArray(n)) return n[typeof t == "number" ? t : 0]?.replace("/", "");
241
- }
242
- }, ce = {
243
- name: "subdomain",
244
- lookup(e) {
245
- let { lookupFromSubdomainIndex: t } = e, n = typeof t == "number" ? t + 1 : 1, r = typeof window < "u" && window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
246
- if (r) return r[n];
247
- }
248
- }, b = !1;
249
- try {
250
- document.cookie, b = !0;
251
- } catch {}
252
- var x = [
253
- "querystring",
254
- "cookie",
255
- "localStorage",
256
- "sessionStorage",
257
- "navigator",
258
- "htmlTag"
259
- ];
260
- b || x.splice(1, 1);
261
- var S = () => ({
262
- order: x,
263
- lookupQuerystring: "lng",
264
- lookupCookie: "i18next",
265
- lookupLocalStorage: "i18nextLng",
266
- lookupSessionStorage: "i18nextLng",
267
- caches: ["localStorage"],
268
- excludeCacheFor: ["cimode"],
269
- convertDetectedLanguage: (e) => e
270
- }), C = class {
271
- constructor(e) {
272
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
273
- this.type = "languageDetector", this.detectors = {}, this.init(e, t);
274
- }
275
- init() {
276
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { languageUtils: {} }, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
277
- this.services = e, this.options = d(t, this.options || {}, S()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (e) => e.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = n, this.addDetector(te), this.addDetector(ne), this.addDetector(ie), this.addDetector(y), this.addDetector(ae), this.addDetector(oe), this.addDetector(se), this.addDetector(ce), this.addDetector(re);
278
- }
279
- addDetector(e) {
280
- return this.detectors[e.name] = e, this;
281
- }
282
- detect() {
283
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.order, t = [];
284
- return e.forEach((e) => {
285
- if (this.detectors[e]) {
286
- let n = this.detectors[e].lookup(this.options);
287
- n && typeof n == "string" && (n = [n]), n && (t = t.concat(n));
288
- }
289
- }), t = t.filter((e) => e != null && !f(e)).map((e) => this.options.convertDetectedLanguage(e)), this.services && this.services.languageUtils && this.services.languageUtils.getBestMatchFromCodes ? t : t.length > 0 ? t[0] : null;
290
- }
291
- cacheUserLanguage(e) {
292
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.caches;
293
- t && (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(e) > -1 || t.forEach((t) => {
294
- this.detectors[t] && this.detectors[t].cacheUserLanguage(e, this.options);
295
- }));
296
- }
297
- };
298
- C.type = "languageDetector";
299
- //#endregion
300
- //#region ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
301
- function le(e, t) {
302
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
303
- }
304
- //#endregion
305
- //#region ../../node_modules/@babel/runtime/helpers/esm/typeof.js
306
- function w(e) {
307
- "@babel/helpers - typeof";
308
- return w = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
309
- return typeof e;
310
- } : function(e) {
311
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
312
- }, w(e);
313
- }
314
- //#endregion
315
- //#region ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
316
- function ue(e, t) {
317
- if (w(e) != "object" || !e) return e;
318
- var n = e[Symbol.toPrimitive];
319
- if (n !== void 0) {
320
- var r = n.call(e, t || "default");
321
- if (w(r) != "object") return r;
322
- throw TypeError("@@toPrimitive must return a primitive value.");
323
- }
324
- return (t === "string" ? String : Number)(e);
325
- }
326
- //#endregion
327
- //#region ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
328
- function de(e) {
329
- var t = ue(e, "string");
330
- return w(t) == "symbol" ? t : t + "";
331
- }
332
- //#endregion
333
- //#region ../../node_modules/@babel/runtime/helpers/esm/createClass.js
334
- function T(e, t) {
335
- for (var n = 0; n < t.length; n++) {
336
- var r = t[n];
337
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, de(r.key), r);
338
- }
339
- }
340
- function E(e, t, n) {
341
- return t && T(e.prototype, t), n && T(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
342
- }
343
- //#endregion
344
- //#region ../../node_modules/i18next-chained-backend/dist/esm/i18nextChainedBackend.js
345
- var D = [], fe = D.forEach, pe = D.slice;
346
- function me(e) {
347
- return fe.call(pe.call(arguments, 1), function(t) {
348
- if (t) for (var n in t) e[n] === void 0 && (e[n] = t[n]);
349
- }), e;
350
- }
351
- function he(e) {
352
- return e ? typeof e == "function" ? new e() : e : null;
353
- }
354
- function ge() {
355
- return {
356
- handleEmptyResourcesAsFailed: !0,
357
- cacheHitMode: "none"
358
- };
359
- }
360
- function O(e, t, n, r) {
361
- var i = e.read.bind(e);
362
- if (i.length === 2) {
363
- try {
364
- var a = i(t, n);
365
- a && typeof a.then == "function" ? a.then(function(e) {
366
- return r(null, e);
367
- }).catch(r) : r(null, a);
368
- } catch (e) {
369
- r(e);
370
- }
371
- return;
372
- }
373
- i(t, n, r);
374
- }
375
- var k = /*#__PURE__*/ function() {
376
- function e(t) {
377
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
378
- le(this, e), this.backends = [], this.type = "backend", this.allOptions = r, this.init(t, n);
379
- }
380
- return E(e, [
381
- {
382
- key: "init",
383
- value: function(e) {
384
- var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
385
- this.services = e, this.options = me(n, this.options || {}, ge()), this.allOptions = r, this.options.backends && this.options.backends.forEach(function(n, i) {
386
- t.backends[i] = t.backends[i] || he(n), t.backends[i].init(e, t.options.backendOptions && t.options.backendOptions[i] || {}, r);
387
- }), this.services && this.options.reloadInterval && setInterval(function() {
388
- return t.reload();
389
- }, this.options.reloadInterval);
390
- }
391
- },
392
- {
393
- key: "read",
394
- value: function(e, t, n) {
395
- var r = this, i = this.backends.length, a = function a(s) {
396
- if (s >= i) return n(Error("non of the backend loaded data", !0));
397
- var c = s === i - 1, l = r.options.handleEmptyResourcesAsFailed && !c ? 0 : -1, u = r.backends[s];
398
- u.read ? O(u, e, t, function(i, c, d) {
399
- if (!i && c && Object.keys(c).length > l) {
400
- if (n(null, c, s), o(s - 1, c), u.save && r.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(r.options.cacheHitMode) > -1) {
401
- if (d && r.options.refreshExpirationTime && d + r.options.refreshExpirationTime > Date.now()) return;
402
- var f = r.backends[s + 1];
403
- f && f.read && O(f, e, t, function(n, i) {
404
- n || i && (Object.keys(i).length <= l || (o(s, i), r.options.cacheHitMode === "refreshAndUpdateStore" && r.services && r.services.resourceStore && r.services.resourceStore.addResourceBundle(e, t, i)));
405
- });
406
- }
407
- } else a(s + 1);
408
- }) : a(s + 1);
409
- }, o = function n(i, a) {
410
- if (!(i < 0)) {
411
- var o = r.backends[i];
412
- o.save && o.save(e, t, a), n(i - 1, a);
413
- }
414
- };
415
- a(0);
416
- }
417
- },
418
- {
419
- key: "create",
420
- value: function(e, t, n, r) {
421
- var i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {}, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
422
- this.backends.forEach(function(o) {
423
- if (o.create) {
424
- var s = o.create.bind(o);
425
- if (s.length < 6) {
426
- try {
427
- var c = s.length === 5 ? s(e, t, n, r, a) : s(e, t, n, r);
428
- c && typeof c.then == "function" ? c.then(function(e) {
429
- return i(null, e);
430
- }).catch(i) : i(null, c);
431
- } catch (e) {
432
- i(e);
433
- }
434
- return;
435
- }
436
- s(e, t, n, r, i, a);
437
- }
438
- });
439
- }
440
- },
441
- {
442
- key: "reload",
443
- value: function() {
444
- var e = this, t = this.services, n = t.backendConnector, r = t.languageUtils, i = t.logger, a = n.language;
445
- if (!(a && a.toLowerCase() === "cimode")) {
446
- var o = [], s = function(e) {
447
- r.toResolveHierarchy(e).forEach(function(e) {
448
- o.indexOf(e) < 0 && o.push(e);
449
- });
450
- };
451
- s(a), this.allOptions.preload && this.allOptions.preload.forEach(function(e) {
452
- return s(e);
453
- }), o.forEach(function(t) {
454
- e.allOptions.ns.forEach(function(e) {
455
- n.read(t, e, "read", null, null, function(r, a) {
456
- r && i.warn(`loading namespace ${e} for language ${t} failed`, r), !r && a && i.log(`loaded namespace ${e} for language ${t}`, a), n.loaded(`${t}|${e}`, r, a);
457
- });
458
- });
459
- });
460
- }
461
- }
462
- }
463
- ]), e;
464
- }();
465
- k.type = "backend";
466
- //#endregion
467
- //#region ../../node_modules/i18next-http-backend/esm/utils.js
468
- function A(e) {
469
- "@babel/helpers - typeof";
470
- return A = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
471
- return typeof e;
472
- } : function(e) {
473
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
474
- }, A(e);
475
- }
476
- var j = [];
477
- j.forEach, j.slice;
478
- function M() {
479
- return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : A(XMLHttpRequest)) === "object";
480
- }
481
- function _e(e) {
482
- return !!e && typeof e.then == "function";
483
- }
484
- function N(e) {
485
- return _e(e) ? e : Promise.resolve(e);
486
- }
487
- //#endregion
488
- //#region ../../node_modules/i18next-http-backend/esm/request.js
489
- function P(e, t) {
490
- var n = Object.keys(e);
491
- if (Object.getOwnPropertySymbols) {
492
- var r = Object.getOwnPropertySymbols(e);
493
- t && (r = r.filter(function(t) {
494
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
495
- })), n.push.apply(n, r);
496
- }
497
- return n;
498
- }
499
- function F(e) {
500
- for (var t = 1; t < arguments.length; t++) {
501
- var n = arguments[t] == null ? {} : arguments[t];
502
- t % 2 ? P(Object(n), !0).forEach(function(t) {
503
- I(e, t, n[t]);
504
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : P(Object(n)).forEach(function(t) {
505
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
506
- });
507
- }
508
- return e;
509
- }
510
- function I(e, t, n) {
511
- return (t = ve(t)) in e ? Object.defineProperty(e, t, {
512
- value: n,
513
- enumerable: !0,
514
- configurable: !0,
515
- writable: !0
516
- }) : e[t] = n, e;
517
- }
518
- function ve(e) {
519
- var t = ye(e, "string");
520
- return L(t) == "symbol" ? t : t + "";
521
- }
522
- function ye(e, t) {
523
- if (L(e) != "object" || !e) return e;
524
- var n = e[Symbol.toPrimitive];
525
- if (n !== void 0) {
526
- var r = n.call(e, t || "default");
527
- if (L(r) != "object") return r;
528
- throw TypeError("@@toPrimitive must return a primitive value.");
529
- }
530
- return (t === "string" ? String : Number)(e);
531
- }
532
- function L(e) {
533
- "@babel/helpers - typeof";
534
- return L = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
535
- return typeof e;
536
- } : function(e) {
537
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
538
- }, L(e);
539
- }
540
- var R = typeof fetch == "function" ? fetch : void 0;
541
- typeof global < "u" && global.fetch ? R = global.fetch : typeof window < "u" && window.fetch && (R = window.fetch);
542
- var z;
543
- M() && (typeof global < "u" && global.XMLHttpRequest ? z = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (z = window.XMLHttpRequest));
544
- var B;
545
- if (typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? B = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (B = window.ActiveXObject)), typeof R != "function" && (R = void 0), !R && !z && !B) try {
546
- import("./node-ponyfill-ByScaio2.js").then((e) => /* @__PURE__ */ n(e.default, 1)).then(function(e) {
547
- R = e.default;
548
- }).catch(function() {});
549
- } catch {}
550
- var V = function(e, t) {
551
- if (t && L(t) === "object") {
552
- var n = "";
553
- for (var r in t) n += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(t[r]);
554
- if (!n) return e;
555
- e = e + (e.indexOf("?") === -1 ? "?" : "&") + n.slice(1);
556
- }
557
- return e;
558
- }, H = function(e, t, n, r) {
559
- var i = function(e) {
560
- if (!e.ok) return n(e.statusText || "Error", { status: e.status });
561
- e.text().then(function(t) {
562
- n(null, {
563
- status: e.status,
564
- data: t
565
- });
566
- }).catch(n);
567
- };
568
- if (r) {
569
- var a = r(e, t);
570
- if (a instanceof Promise) {
571
- a.then(i).catch(n);
572
- return;
573
- }
574
- }
575
- typeof fetch == "function" ? fetch(e, t).then(i).catch(n) : R(e, t).then(i).catch(n);
576
- }, U = !1, be = function(e, t, n, r) {
577
- e.queryStringParams && (t = V(t, e.queryStringParams));
578
- var i = F({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
579
- typeof window > "u" && typeof global < "u" && global.process !== void 0 && global.process.versions && global.process.versions.node && (i["User-Agent"] = `i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`), n && (i["Content-Type"] = "application/json");
580
- var a = typeof e.requestOptions == "function" ? e.requestOptions(n) : e.requestOptions, o = F({
581
- method: n ? "POST" : "GET",
582
- body: n ? e.stringify(n) : void 0,
583
- headers: i
584
- }, U ? {} : a), s = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
585
- try {
586
- H(t, o, r, s);
587
- } catch (e) {
588
- if (!a || Object.keys(a).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return r(e);
589
- try {
590
- Object.keys(a).forEach(function(e) {
591
- delete o[e];
592
- }), H(t, o, r, s), U = !0;
593
- } catch (e) {
594
- r(e);
595
- }
596
- }
597
- }, xe = function(e, t, n, r) {
598
- n && L(n) === "object" && (n = V("", n).slice(1)), e.queryStringParams && (t = V(t, e.queryStringParams));
599
- try {
600
- var i = z ? new z() : new B("MSXML2.XMLHTTP.3.0");
601
- i.open(n ? "POST" : "GET", t, 1), e.crossDomain || i.setRequestHeader("X-Requested-With", "XMLHttpRequest"), i.withCredentials = !!e.withCredentials, n && i.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), i.overrideMimeType && i.overrideMimeType("application/json");
602
- var a = e.customHeaders;
603
- if (a = typeof a == "function" ? a() : a, a) for (var o in a) i.setRequestHeader(o, a[o]);
604
- i.onreadystatechange = function() {
605
- i.readyState > 3 && r(i.status >= 400 ? i.statusText : null, {
606
- status: i.status,
607
- data: i.responseText
608
- });
609
- }, i.send(n);
610
- } catch (e) {
611
- console && console.log(e);
612
- }
613
- }, Se = function(e, t, n, r) {
614
- if (typeof n == "function" && (r = n, n = void 0), r ||= function() {}, R && t.indexOf("file:") !== 0) return be(e, t, n, r);
615
- if (M() || typeof ActiveXObject == "function") return xe(e, t, n, r);
616
- r(/* @__PURE__ */ Error("No fetch and no xhr implementation found!"));
617
- };
618
- //#endregion
619
- //#region ../../node_modules/i18next-http-backend/esm/index.js
620
- function W(e) {
621
- "@babel/helpers - typeof";
622
- return W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
623
- return typeof e;
624
- } : function(e) {
625
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
626
- }, W(e);
627
- }
628
- function G(e, t) {
629
- var n = Object.keys(e);
630
- if (Object.getOwnPropertySymbols) {
631
- var r = Object.getOwnPropertySymbols(e);
632
- t && (r = r.filter(function(t) {
633
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
634
- })), n.push.apply(n, r);
635
- }
636
- return n;
637
- }
638
- function K(e) {
639
- for (var t = 1; t < arguments.length; t++) {
640
- var n = arguments[t] == null ? {} : arguments[t];
641
- t % 2 ? G(Object(n), !0).forEach(function(t) {
642
- J(e, t, n[t]);
643
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : G(Object(n)).forEach(function(t) {
644
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
645
- });
646
- }
647
- return e;
648
- }
649
- function Ce(e, t) {
650
- if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
651
- }
652
- function q(e, t) {
653
- for (var n = 0; n < t.length; n++) {
654
- var r = t[n];
655
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Y(r.key), r);
656
- }
657
- }
658
- function we(e, t, n) {
659
- return t && q(e.prototype, t), n && q(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
660
- }
661
- function J(e, t, n) {
662
- return (t = Y(t)) in e ? Object.defineProperty(e, t, {
663
- value: n,
664
- enumerable: !0,
665
- configurable: !0,
666
- writable: !0
667
- }) : e[t] = n, e;
668
- }
669
- function Y(e) {
670
- var t = Te(e, "string");
671
- return W(t) == "symbol" ? t : t + "";
672
- }
673
- function Te(e, t) {
674
- if (W(e) != "object" || !e) return e;
675
- var n = e[Symbol.toPrimitive];
676
- if (n !== void 0) {
677
- var r = n.call(e, t || "default");
678
- if (W(r) != "object") return r;
679
- throw TypeError("@@toPrimitive must return a primitive value.");
680
- }
681
- return (t === "string" ? String : Number)(e);
682
- }
683
- var Ee = function() {
684
- return {
685
- loadPath: "/locales/{{lng}}/{{ns}}.json",
686
- addPath: "/locales/add/{{lng}}/{{ns}}",
687
- parse: function(e) {
688
- return JSON.parse(e);
689
- },
690
- stringify: JSON.stringify,
691
- parsePayload: function(e, t, n) {
692
- return J({}, t, n || "");
693
- },
694
- parseLoadPayload: function(e, t) {},
695
- request: Se,
696
- reloadInterval: typeof window < "u" ? !1 : 3600 * 1e3,
697
- customHeaders: {},
698
- queryStringParams: {},
699
- crossDomain: !1,
700
- withCredentials: !1,
701
- overrideMimeType: !1,
702
- requestOptions: {
703
- mode: "cors",
704
- credentials: "same-origin",
705
- cache: "default"
706
- }
707
- };
708
- }, X = function() {
709
- function e(t) {
710
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
711
- Ce(this, e), this.services = t, this.options = n, this.allOptions = r, this.type = "backend", this.init(t, n, r);
712
- }
713
- return we(e, [
714
- {
715
- key: "init",
716
- value: function(e) {
717
- var t = this, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
718
- if (this.services = e, this.options = K(K(K({}, Ee()), this.options || {}), n), this.allOptions = r, this.services && this.options.reloadInterval) {
719
- var i = setInterval(function() {
720
- return t.reload();
721
- }, this.options.reloadInterval);
722
- W(i) === "object" && typeof i.unref == "function" && i.unref();
723
- }
724
- }
725
- },
726
- {
727
- key: "readMulti",
728
- value: function(e, t, n) {
729
- this._readAny(e, e, t, t, n);
730
- }
731
- },
732
- {
733
- key: "read",
734
- value: function(e, t, n) {
735
- this._readAny([e], e, [t], t, n);
736
- }
737
- },
738
- {
739
- key: "_readAny",
740
- value: function(e, t, n, r, i) {
741
- var a = this, o = this.options.loadPath;
742
- typeof this.options.loadPath == "function" && (o = this.options.loadPath(e, n)), o = N(o), o.then(function(o) {
743
- if (!o) return i(null, {});
744
- var s = a.services.interpolator.interpolate(o, {
745
- lng: e.join("+"),
746
- ns: n.join("+")
747
- });
748
- a.loadUrl(s, i, t, r);
749
- });
750
- }
751
- },
752
- {
753
- key: "loadUrl",
754
- value: function(e, t, n, r) {
755
- var i = this, a = typeof n == "string" ? [n] : n, o = typeof r == "string" ? [r] : r, s = this.options.parseLoadPayload(a, o);
756
- this.options.request(this.options, e, s, function(a, o) {
757
- if (o && (o.status >= 500 && o.status < 600 || !o.status)) return t("failed loading " + e + "; status code: " + o.status, !0);
758
- if (o && o.status >= 400 && o.status < 500) return t("failed loading " + e + "; status code: " + o.status, !1);
759
- if (!o && a && a.message) {
760
- var s = a.message.toLowerCase();
761
- if ([
762
- "failed",
763
- "fetch",
764
- "network",
765
- "load"
766
- ].find(function(e) {
767
- return s.indexOf(e) > -1;
768
- })) return t("failed loading " + e + ": " + a.message, !0);
769
- }
770
- if (a) return t(a, !1);
771
- var c, l;
772
- try {
773
- c = typeof o.data == "string" ? i.options.parse(o.data, n, r) : o.data;
774
- } catch {
775
- l = "failed parsing " + e + " to json";
776
- }
777
- if (l) return t(l, !1);
778
- t(null, c);
779
- });
780
- }
781
- },
782
- {
783
- key: "create",
784
- value: function(e, t, n, r, i) {
785
- var a = this;
786
- if (this.options.addPath) {
787
- typeof e == "string" && (e = [e]);
788
- var o = this.options.parsePayload(t, n, r), s = 0, c = [], l = [];
789
- e.forEach(function(n) {
790
- var r = a.options.addPath;
791
- typeof a.options.addPath == "function" && (r = a.options.addPath(n, t));
792
- var u = a.services.interpolator.interpolate(r, {
793
- lng: n,
794
- ns: t
795
- });
796
- a.options.request(a.options, u, o, function(t, n) {
797
- s += 1, c.push(t), l.push(n), s === e.length && typeof i == "function" && i(c, l);
798
- });
799
- });
800
- }
801
- }
802
- },
803
- {
804
- key: "reload",
805
- value: function() {
806
- var e = this, t = this.services, n = t.backendConnector, r = t.languageUtils, i = t.logger, a = n.language;
807
- if (!(a && a.toLowerCase() === "cimode")) {
808
- var o = [], s = function(e) {
809
- r.toResolveHierarchy(e).forEach(function(e) {
810
- o.indexOf(e) < 0 && o.push(e);
811
- });
812
- };
813
- s(a), this.allOptions.preload && this.allOptions.preload.forEach(function(e) {
814
- return s(e);
815
- }), o.forEach(function(t) {
816
- e.allOptions.ns.forEach(function(e) {
817
- n.read(t, e, "read", null, null, function(r, a) {
818
- r && i.warn(`loading namespace ${e} for language ${t} failed`, r), !r && a && i.log(`loaded namespace ${e} for language ${t}`, a), n.loaded(`${t}|${e}`, r, a);
819
- });
820
- });
821
- });
822
- }
823
- }
824
- }
825
- ]);
826
- }();
827
- X.type = "backend";
828
- //#endregion
829
- //#region ../../node_modules/i18next-resources-to-backend/dist/esm/index.js
830
- var De = [
831
- "__proto__",
832
- "constructor",
833
- "prototype"
834
- ], Z = function(e, t) {
835
- return !(typeof e != "string" || e.length > 128 || De.indexOf(e) > -1 || e.indexOf("..") > -1 || e.indexOf("\\") > -1 || !t && e.indexOf("/") > -1 || /[\x00-\x1F\x7F]/.test(e));
836
- }, Oe = function(e) {
837
- return {
838
- type: "backend",
839
- init: function(e, t, n) {},
840
- read: function(t, n, r) {
841
- if (!Z(t, !1) || !Z(n, !0)) return r(/* @__PURE__ */ Error("i18next-resources-to-backend: unsafe language/namespace value"), !1);
842
- if (typeof e == "function") {
843
- if (e.length < 3) {
844
- try {
845
- var i = e(t, n);
846
- i && typeof i.then == "function" ? i.then(function(e) {
847
- return r(null, e && e.default || e);
848
- }).catch(r) : r(null, i);
849
- } catch (e) {
850
- r(e);
851
- }
852
- return;
853
- }
854
- e(t, n, r);
855
- return;
856
- }
857
- r(null, e && e[t] && e[t][n]);
858
- }
859
- };
860
- }, ke = {
861
- react: { useSuspense: !0 },
862
- detection: {
863
- order: [
864
- "navigator",
865
- "htmlTag",
866
- "path",
867
- "subdomain"
868
- ],
869
- caches: ["localStorage", "cookie"]
870
- }
871
- }, Q = (e, t) => {
872
- let n = import.meta.url.split("/").pop();
873
- return `${import.meta.url.replace(`/${n}`, "")}/locales/${e}/${t}.json`;
874
- };
875
- function $(n, r) {
876
- if (t.isInitialized) n?.(t);
877
- else {
878
- t.use(k).use(new C(null, {
879
- order: [
880
- "cookie",
881
- "localStorage",
882
- "navigator"
883
- ],
884
- lookupQuerystring: "lng",
885
- lookupCookie: "i18next",
886
- lookupLocalStorage: "i18nextLng",
887
- caches: ["localStorage", "cookie"]
888
- })).use(c).init({
889
- ...e,
890
- ...r ? { lng: r } : {},
891
- backend: {
892
- backends: [X, Oe((e, t) => import(Q(e, t)))],
893
- backendOptions: [{ loadPath: Q("{{lng}}", "{{ns}}") }]
894
- },
895
- ...ke
896
- });
897
- let i = !1;
898
- t.on("loaded", () => {
899
- i || (i = !0, n?.(t));
900
- });
901
- }
902
- return t;
903
- }
904
- //#endregion
905
- export { $ as default, $ as initializeI18n };