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