@prosopo/procaptcha-bundle 3.0.12 → 3.1.6
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/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +17 -7
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -1
- package/CHANGELOG.md +374 -0
- package/dist/bundle/{ProcaptchaWidget-48FxVPQd.js → ProcaptchaWidget-CJ-4hVS1.js} +25 -25
- package/dist/bundle/{ProcaptchaWidget-B2BzhXLv.js → ProcaptchaWidget-Cw3s7cGX.js} +290 -268
- package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
- package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +1002 -0
- package/dist/bundle/{captchaRenderer-DdOlOCKw.js → captchaRenderer-s4QuLEen.js} +23 -22
- package/dist/bundle/{commonChunk-HCVkoCqn.js → commonChunk-BjvuHlB1.js} +62 -68
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-D7qvHZDV.js → emotion-element-c39617d8.browser.esm-BNNnmykm.js} +343 -345
- package/dist/bundle/index-BuQg3Zno.js +1884 -0
- package/dist/bundle/{index-DyYmvHVN.js → index-DIdd2cUz.js} +1 -1
- package/dist/bundle/{index-C00_J7av.js → index-IgqrmVIs.js} +61 -59
- package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/bundle/{utilChunk-sqstc6C5.js → utilChunk-DPr6oTOj.js} +22 -22
- package/dist/bundle/{utilCryptoChunk-qm-BM2eT.js → utilCryptoChunk-D6ZLkbFV.js} +176 -167
- package/dist/bundle/{web2Chunk-DCsWA5PR.js → web2Chunk-CNoojUDK.js} +1083 -983
- package/dist/bundle/web3Chunk-BlYvY4Ea.js +525 -0
- package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-aEfPZzrp.js} +3 -3
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
- package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
- package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
- package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
- package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
- package/dist/cjs/util/widgetFactory.cjs +7 -2
- package/dist/util/captcha/captchaComponentProvider.js +3 -2
- package/dist/util/captcha/captchaRenderer.js +4 -3
- package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
- package/dist/util/captcha/components/imageCaptcha.js +1 -1
- package/dist/util/captcha/components/powCaptcha.js +1 -1
- package/dist/util/widgetFactory.js +7 -2
- package/package.json +25 -26
- package/stats.html +1 -1
- package/vite.test.config.ts +3 -2
- package/dist/bundle/captchaComponentProvider-B7Vxx339.js +0 -968
- package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
- package/dist/bundle/nobleChunk-Qozzkbsq.js +0 -3648
- package/dist/bundle/web3Chunk-B8txCqUJ.js +0 -517
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $t = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { z as
|
|
9
|
-
import { h as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
function ni(n, e) {
|
|
4
|
+
var Nt = (n, e, t) => e.has(n) || $t("Cannot " + t);
|
|
5
|
+
var j = (n, e, t) => (Nt(n, e, "read from private field"), t ? t.call(n) : e.get(n)), me = (n, e, t) => e.has(n) ? $t("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), ye = (n, e, t, r) => (Nt(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t);
|
|
6
|
+
import { g as Hr } from "./bnChunk-DRlDxTFg.js";
|
|
7
|
+
import { j as Vr } from "./nobleChunk-Bbltwf44.js";
|
|
8
|
+
import { z as C, n as ke, o as y, a as w, b as q, s as p, c as ce, d as Br, u as _e, e as jt, f as Dt, g as Je, r as On, l as Ut } from "./zodChunk-aEfPZzrp.js";
|
|
9
|
+
import { j as Kr, s as qr, n as zr, a as Wr, b as Jr, c as Xr, d as Yr, e as Gr, f as Qr, g as Zr, k as ei, h as En, i as Tn, l as je, m as ti, o as ni, p as ri, q as ii, r as oi } from "./utilCryptoChunk-D6ZLkbFV.js";
|
|
10
|
+
import { r as nt, b as ft, o as Cn, u as dt, a as Ft, t as si, i as ai, c as De, k as rt, s as Ln } from "./utilChunk-DPr6oTOj.js";
|
|
11
|
+
function ui(n, e) {
|
|
13
12
|
for (var t = 0; t < e.length; t++) {
|
|
14
13
|
const r = e[t];
|
|
15
14
|
if (typeof r != "string" && !Array.isArray(r)) {
|
|
@@ -25,77 +24,68 @@ function ni(n, e) {
|
|
|
25
24
|
}
|
|
26
25
|
return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
R.nativeEnum(wt);
|
|
77
|
-
var Je = /* @__PURE__ */ ((n) => (n.image = "image", n.pow = "pow", n.frictionless = "frictionless", n.invisible = "invisible", n))(Je || {});
|
|
78
|
-
R.nativeEnum(Je);
|
|
79
|
-
const si = Ce(Je), ai = Je.frictionless, ui = [], li = 0.5, ci = 4, fi = 0.8, di = y({
|
|
80
|
-
captchaType: si.optional().default(ai),
|
|
81
|
-
domains: K(p()).optional().default([...ui]),
|
|
82
|
-
frictionlessThreshold: S().optional().default(li),
|
|
83
|
-
powDifficulty: S().optional().default(ci),
|
|
84
|
-
imageThreshold: S().optional().default(fi)
|
|
27
|
+
var h = /* @__PURE__ */ ((n) => (n.datasetId = "datasetId", n.user = "user", n.dapp = "dapp", n.provider = "provider", n.blockNumber = "blockNumber", n.requestHash = "requestHash", n.captchas = "captchas", n.commitmentId = "commitmentId", n.proof = "proof", n.dappSignature = "dappSignature", n.dappUserSignature = "dappUserSignature", n.providerUrl = "providerUrl", n.procaptchaResponse = "procaptcha-response", n.verifiedTimeout = "verifiedTimeout", n.maxVerifiedTime = "maxVerifiedTime", n.verified = "verified", n.status = "status", n.challenge = "challenge", n.difficulty = "difficulty", n.nonce = "nonce", n.timeouts = "timeouts", n.token = "token", n.secret = "secret", n.timestamp = "timestamp", n.signature = "signature", n.error = "error", n.siteKey = "siteKey", n.captchaType = "captchaType", n.sessionId = "sessionId", n.settings = "settings", n.domains = "domains", n.frictionlessThreshold = "frictionlessThreshold", n.powDifficulty = "powDifficulty", n.score = "score", n.tier = "tier", n.detectorKey = "detectorKey", n.ip = "ip", n.expirationInSeconds = "expirationInSeconds", n))(h || {}), St = /* @__PURE__ */ ((n) => (n.Free = "free", n.Professional = "professional", n.Enterprise = "enterprise", n))(St || {});
|
|
28
|
+
C.nativeEnum(St);
|
|
29
|
+
var Xe = /* @__PURE__ */ ((n) => (n.image = "image", n.pow = "pow", n.frictionless = "frictionless", n.invisible = "invisible", n))(Xe || {});
|
|
30
|
+
C.nativeEnum(Xe);
|
|
31
|
+
const li = ke(Xe), ci = Xe.frictionless, fi = [], di = 0.5, pi = 4, hi = 0.8;
|
|
32
|
+
var Pn = /* @__PURE__ */ ((n) => (n.Allow = "allow", n.Reject = "reject", n.Flag = "flag", n))(Pn || {});
|
|
33
|
+
const B = C.nativeEnum(Pn), gi = "allow", mi = "allow", yi = "allow", vi = 1e3, wi = 5e-3, bi = "reject", Si = "reject", xi = !1, Oi = y({
|
|
34
|
+
actions: y({
|
|
35
|
+
countryChangeAction: B.optional(),
|
|
36
|
+
cityChangeAction: B.optional(),
|
|
37
|
+
ispChangeAction: B.optional(),
|
|
38
|
+
distanceExceedAction: B.optional(),
|
|
39
|
+
abuseScoreExceedAction: B.optional()
|
|
40
|
+
}).partial(),
|
|
41
|
+
// all optional, so you can just override what you need
|
|
42
|
+
distanceThresholdKm: w().positive().optional(),
|
|
43
|
+
abuseScoreThreshold: w().positive().optional(),
|
|
44
|
+
requireAllConditions: ce().optional()
|
|
45
|
+
}), Ei = y({
|
|
46
|
+
actions: y({
|
|
47
|
+
countryChangeAction: B.optional().default(
|
|
48
|
+
gi
|
|
49
|
+
),
|
|
50
|
+
cityChangeAction: B.optional().default(
|
|
51
|
+
mi
|
|
52
|
+
),
|
|
53
|
+
ispChangeAction: B.optional().default(
|
|
54
|
+
yi
|
|
55
|
+
),
|
|
56
|
+
distanceExceedAction: B.optional().default(
|
|
57
|
+
bi
|
|
58
|
+
),
|
|
59
|
+
abuseScoreExceedAction: B.optional().default(
|
|
60
|
+
Si
|
|
61
|
+
)
|
|
62
|
+
}),
|
|
63
|
+
distanceThresholdKm: w().positive().optional().default(vi),
|
|
64
|
+
abuseScoreThreshold: w().positive().optional().default(wi),
|
|
65
|
+
requireAllConditions: C.boolean().optional().default(xi),
|
|
66
|
+
// overrides are now lightweight, not recursive
|
|
67
|
+
countryOverrides: C.record(p(), Oi).optional()
|
|
68
|
+
}), Ti = y({
|
|
69
|
+
captchaType: li.optional().default(ci),
|
|
70
|
+
domains: q(p()).optional().default([...fi]),
|
|
71
|
+
frictionlessThreshold: w().optional().default(di),
|
|
72
|
+
powDifficulty: w().optional().default(pi),
|
|
73
|
+
imageThreshold: w().optional().default(hi),
|
|
74
|
+
ipValidationRules: Ei.optional()
|
|
85
75
|
});
|
|
86
|
-
let
|
|
87
|
-
async function
|
|
76
|
+
let it;
|
|
77
|
+
async function Ia(n) {
|
|
88
78
|
return new Promise((e, t) => {
|
|
89
79
|
try {
|
|
90
|
-
Promise.resolve().then(() =>
|
|
91
|
-
|
|
80
|
+
Promise.resolve().then(() => ls).then(({ default: r }) => {
|
|
81
|
+
it ? e(it) : it = r(e);
|
|
92
82
|
});
|
|
93
83
|
} catch (r) {
|
|
94
84
|
t(r);
|
|
95
85
|
}
|
|
96
86
|
});
|
|
97
87
|
}
|
|
98
|
-
const
|
|
88
|
+
const kn = {
|
|
99
89
|
arabic: "ar",
|
|
100
90
|
azerbaijani: "az",
|
|
101
91
|
czech: "cs",
|
|
@@ -128,45 +118,45 @@ const Ln = {
|
|
|
128
118
|
ukrainian: "uk",
|
|
129
119
|
vietnamese: "vi",
|
|
130
120
|
chinese: "zh-CN"
|
|
131
|
-
},
|
|
132
|
-
Object.values(
|
|
121
|
+
}, In = C.enum(
|
|
122
|
+
Object.values(kn)
|
|
133
123
|
);
|
|
134
|
-
var
|
|
135
|
-
var
|
|
136
|
-
function
|
|
137
|
-
return n === null || typeof n != "object" ? null : (n =
|
|
124
|
+
var Rn = { exports: {} }, x = {};
|
|
125
|
+
var Ie = Symbol.for("react.element"), Ci = Symbol.for("react.portal"), Li = Symbol.for("react.fragment"), Pi = Symbol.for("react.strict_mode"), ki = Symbol.for("react.profiler"), Ii = Symbol.for("react.provider"), Ri = Symbol.for("react.context"), Ai = Symbol.for("react.forward_ref"), $i = Symbol.for("react.suspense"), Ni = Symbol.for("react.memo"), ji = Symbol.for("react.lazy"), _t = Symbol.iterator;
|
|
126
|
+
function Di(n) {
|
|
127
|
+
return n === null || typeof n != "object" ? null : (n = _t && n[_t] || n["@@iterator"], typeof n == "function" ? n : null);
|
|
138
128
|
}
|
|
139
|
-
var
|
|
129
|
+
var An = { isMounted: function() {
|
|
140
130
|
return !1;
|
|
141
131
|
}, enqueueForceUpdate: function() {
|
|
142
132
|
}, enqueueReplaceState: function() {
|
|
143
133
|
}, enqueueSetState: function() {
|
|
144
|
-
} },
|
|
145
|
-
function
|
|
146
|
-
this.props = n, this.context = e, this.refs =
|
|
134
|
+
} }, $n = Object.assign, Nn = {};
|
|
135
|
+
function pe(n, e, t) {
|
|
136
|
+
this.props = n, this.context = e, this.refs = Nn, this.updater = t || An;
|
|
147
137
|
}
|
|
148
|
-
|
|
149
|
-
|
|
138
|
+
pe.prototype.isReactComponent = {};
|
|
139
|
+
pe.prototype.setState = function(n, e) {
|
|
150
140
|
if (typeof n != "object" && typeof n != "function" && n != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
151
141
|
this.updater.enqueueSetState(this, n, e, "setState");
|
|
152
142
|
};
|
|
153
|
-
|
|
143
|
+
pe.prototype.forceUpdate = function(n) {
|
|
154
144
|
this.updater.enqueueForceUpdate(this, n, "forceUpdate");
|
|
155
145
|
};
|
|
156
146
|
function jn() {
|
|
157
147
|
}
|
|
158
|
-
jn.prototype =
|
|
159
|
-
function
|
|
160
|
-
this.props = n, this.context = e, this.refs =
|
|
148
|
+
jn.prototype = pe.prototype;
|
|
149
|
+
function xt(n, e, t) {
|
|
150
|
+
this.props = n, this.context = e, this.refs = Nn, this.updater = t || An;
|
|
161
151
|
}
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
var
|
|
167
|
-
function
|
|
152
|
+
var Ot = xt.prototype = new jn();
|
|
153
|
+
Ot.constructor = xt;
|
|
154
|
+
$n(Ot, pe.prototype);
|
|
155
|
+
Ot.isPureReactComponent = !0;
|
|
156
|
+
var Mt = Array.isArray, Dn = Object.prototype.hasOwnProperty, Et = { current: null }, Un = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
157
|
+
function Fn(n, e, t) {
|
|
168
158
|
var r, i = {}, o = null, s = null;
|
|
169
|
-
if (e != null) for (r in e.ref !== void 0 && (s = e.ref), e.key !== void 0 && (o = "" + e.key), e)
|
|
159
|
+
if (e != null) for (r in e.ref !== void 0 && (s = e.ref), e.key !== void 0 && (o = "" + e.key), e) Dn.call(e, r) && !Un.hasOwnProperty(r) && (i[r] = e[r]);
|
|
170
160
|
var a = arguments.length - 2;
|
|
171
161
|
if (a === 1) i.children = t;
|
|
172
162
|
else if (1 < a) {
|
|
@@ -174,25 +164,25 @@ function An(n, e, t) {
|
|
|
174
164
|
i.children = u;
|
|
175
165
|
}
|
|
176
166
|
if (n && n.defaultProps) for (r in a = n.defaultProps, a) i[r] === void 0 && (i[r] = a[r]);
|
|
177
|
-
return { $$typeof:
|
|
167
|
+
return { $$typeof: Ie, type: n, key: o, ref: s, props: i, _owner: Et.current };
|
|
178
168
|
}
|
|
179
|
-
function
|
|
180
|
-
return { $$typeof:
|
|
169
|
+
function Ui(n, e) {
|
|
170
|
+
return { $$typeof: Ie, type: n.type, key: e, ref: n.ref, props: n.props, _owner: n._owner };
|
|
181
171
|
}
|
|
182
|
-
function
|
|
183
|
-
return typeof n == "object" && n !== null && n.$$typeof ===
|
|
172
|
+
function Tt(n) {
|
|
173
|
+
return typeof n == "object" && n !== null && n.$$typeof === Ie;
|
|
184
174
|
}
|
|
185
|
-
function
|
|
175
|
+
function Fi(n) {
|
|
186
176
|
var e = { "=": "=0", ":": "=2" };
|
|
187
177
|
return "$" + n.replace(/[=:]/g, function(t) {
|
|
188
178
|
return e[t];
|
|
189
179
|
});
|
|
190
180
|
}
|
|
191
|
-
var
|
|
192
|
-
function
|
|
193
|
-
return typeof n == "object" && n !== null && n.key != null ?
|
|
181
|
+
var Ht = /\/+/g;
|
|
182
|
+
function ot(n, e) {
|
|
183
|
+
return typeof n == "object" && n !== null && n.key != null ? Fi("" + n.key) : e.toString(36);
|
|
194
184
|
}
|
|
195
|
-
function
|
|
185
|
+
function Ue(n, e, t, r, i) {
|
|
196
186
|
var o = typeof n;
|
|
197
187
|
(o === "undefined" || o === "boolean") && (n = null);
|
|
198
188
|
var s = !1;
|
|
@@ -204,31 +194,31 @@ function Ne(n, e, t, r, i) {
|
|
|
204
194
|
break;
|
|
205
195
|
case "object":
|
|
206
196
|
switch (n.$$typeof) {
|
|
207
|
-
case
|
|
208
|
-
case
|
|
197
|
+
case Ie:
|
|
198
|
+
case Ci:
|
|
209
199
|
s = !0;
|
|
210
200
|
}
|
|
211
201
|
}
|
|
212
|
-
if (s) return s = n, i = i(s), n = r === "" ? "." +
|
|
202
|
+
if (s) return s = n, i = i(s), n = r === "" ? "." + ot(s, 0) : r, Mt(i) ? (t = "", n != null && (t = n.replace(Ht, "$&/") + "/"), Ue(i, e, t, "", function(c) {
|
|
213
203
|
return c;
|
|
214
|
-
})) : i != null && (
|
|
215
|
-
if (s = 0, r = r === "" ? "." : r + ":",
|
|
204
|
+
})) : i != null && (Tt(i) && (i = Ui(i, t + (!i.key || s && s.key === i.key ? "" : ("" + i.key).replace(Ht, "$&/") + "/") + n)), e.push(i)), 1;
|
|
205
|
+
if (s = 0, r = r === "" ? "." : r + ":", Mt(n)) for (var a = 0; a < n.length; a++) {
|
|
216
206
|
o = n[a];
|
|
217
|
-
var u = r +
|
|
218
|
-
s +=
|
|
207
|
+
var u = r + ot(o, a);
|
|
208
|
+
s += Ue(o, e, t, u, i);
|
|
219
209
|
}
|
|
220
|
-
else if (u =
|
|
210
|
+
else if (u = Di(n), typeof u == "function") for (n = u.call(n), a = 0; !(o = n.next()).done; ) o = o.value, u = r + ot(o, a++), s += Ue(o, e, t, u, i);
|
|
221
211
|
else if (o === "object") throw e = String(n), Error("Objects are not valid as a React child (found: " + (e === "[object Object]" ? "object with keys {" + Object.keys(n).join(", ") + "}" : e) + "). If you meant to render a collection of children, use an array instead.");
|
|
222
212
|
return s;
|
|
223
213
|
}
|
|
224
|
-
function
|
|
214
|
+
function $e(n, e, t) {
|
|
225
215
|
if (n == null) return n;
|
|
226
216
|
var r = [], i = 0;
|
|
227
|
-
return
|
|
217
|
+
return Ue(n, r, "", "", function(o) {
|
|
228
218
|
return e.call(t, o, i++);
|
|
229
219
|
}), r;
|
|
230
220
|
}
|
|
231
|
-
function
|
|
221
|
+
function _i(n) {
|
|
232
222
|
if (n._status === -1) {
|
|
233
223
|
var e = n._result;
|
|
234
224
|
e = e(), e.then(function(t) {
|
|
@@ -240,41 +230,41 @@ function Ci(n) {
|
|
|
240
230
|
if (n._status === 1) return n._result.default;
|
|
241
231
|
throw n._result;
|
|
242
232
|
}
|
|
243
|
-
var
|
|
244
|
-
function
|
|
233
|
+
var A = { current: null }, Fe = { transition: null }, Mi = { ReactCurrentDispatcher: A, ReactCurrentBatchConfig: Fe, ReactCurrentOwner: Et };
|
|
234
|
+
function _n() {
|
|
245
235
|
throw Error("act(...) is not supported in production builds of React.");
|
|
246
236
|
}
|
|
247
|
-
x.Children = { map:
|
|
248
|
-
|
|
237
|
+
x.Children = { map: $e, forEach: function(n, e, t) {
|
|
238
|
+
$e(n, function() {
|
|
249
239
|
e.apply(this, arguments);
|
|
250
240
|
}, t);
|
|
251
241
|
}, count: function(n) {
|
|
252
242
|
var e = 0;
|
|
253
|
-
return
|
|
243
|
+
return $e(n, function() {
|
|
254
244
|
e++;
|
|
255
245
|
}), e;
|
|
256
246
|
}, toArray: function(n) {
|
|
257
|
-
return
|
|
247
|
+
return $e(n, function(e) {
|
|
258
248
|
return e;
|
|
259
249
|
}) || [];
|
|
260
250
|
}, only: function(n) {
|
|
261
|
-
if (!
|
|
251
|
+
if (!Tt(n)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
262
252
|
return n;
|
|
263
253
|
} };
|
|
264
|
-
x.Component =
|
|
265
|
-
x.Fragment =
|
|
266
|
-
x.Profiler =
|
|
267
|
-
x.PureComponent =
|
|
268
|
-
x.StrictMode =
|
|
269
|
-
x.Suspense =
|
|
270
|
-
x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED =
|
|
271
|
-
x.act =
|
|
254
|
+
x.Component = pe;
|
|
255
|
+
x.Fragment = Li;
|
|
256
|
+
x.Profiler = ki;
|
|
257
|
+
x.PureComponent = xt;
|
|
258
|
+
x.StrictMode = Pi;
|
|
259
|
+
x.Suspense = $i;
|
|
260
|
+
x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Mi;
|
|
261
|
+
x.act = _n;
|
|
272
262
|
x.cloneElement = function(n, e, t) {
|
|
273
263
|
if (n == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + n + ".");
|
|
274
|
-
var r =
|
|
264
|
+
var r = $n({}, n.props), i = n.key, o = n.ref, s = n._owner;
|
|
275
265
|
if (e != null) {
|
|
276
|
-
if (e.ref !== void 0 && (o = e.ref, s =
|
|
277
|
-
for (u in e)
|
|
266
|
+
if (e.ref !== void 0 && (o = e.ref, s = Et.current), e.key !== void 0 && (i = "" + e.key), n.type && n.type.defaultProps) var a = n.type.defaultProps;
|
|
267
|
+
for (u in e) Dn.call(e, u) && !Un.hasOwnProperty(u) && (r[u] = e[u] === void 0 && a !== void 0 ? a[u] : e[u]);
|
|
278
268
|
}
|
|
279
269
|
var u = arguments.length - 2;
|
|
280
270
|
if (u === 1) r.children = t;
|
|
@@ -283,90 +273,90 @@ x.cloneElement = function(n, e, t) {
|
|
|
283
273
|
for (var c = 0; c < u; c++) a[c] = arguments[c + 2];
|
|
284
274
|
r.children = a;
|
|
285
275
|
}
|
|
286
|
-
return { $$typeof:
|
|
276
|
+
return { $$typeof: Ie, type: n.type, key: i, ref: o, props: r, _owner: s };
|
|
287
277
|
};
|
|
288
278
|
x.createContext = function(n) {
|
|
289
|
-
return n = { $$typeof:
|
|
279
|
+
return n = { $$typeof: Ri, _currentValue: n, _currentValue2: n, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, n.Provider = { $$typeof: Ii, _context: n }, n.Consumer = n;
|
|
290
280
|
};
|
|
291
|
-
x.createElement =
|
|
281
|
+
x.createElement = Fn;
|
|
292
282
|
x.createFactory = function(n) {
|
|
293
|
-
var e =
|
|
283
|
+
var e = Fn.bind(null, n);
|
|
294
284
|
return e.type = n, e;
|
|
295
285
|
};
|
|
296
286
|
x.createRef = function() {
|
|
297
287
|
return { current: null };
|
|
298
288
|
};
|
|
299
289
|
x.forwardRef = function(n) {
|
|
300
|
-
return { $$typeof:
|
|
290
|
+
return { $$typeof: Ai, render: n };
|
|
301
291
|
};
|
|
302
|
-
x.isValidElement =
|
|
292
|
+
x.isValidElement = Tt;
|
|
303
293
|
x.lazy = function(n) {
|
|
304
|
-
return { $$typeof:
|
|
294
|
+
return { $$typeof: ji, _payload: { _status: -1, _result: n }, _init: _i };
|
|
305
295
|
};
|
|
306
296
|
x.memo = function(n, e) {
|
|
307
|
-
return { $$typeof:
|
|
297
|
+
return { $$typeof: Ni, type: n, compare: e === void 0 ? null : e };
|
|
308
298
|
};
|
|
309
299
|
x.startTransition = function(n) {
|
|
310
|
-
var e =
|
|
311
|
-
|
|
300
|
+
var e = Fe.transition;
|
|
301
|
+
Fe.transition = {};
|
|
312
302
|
try {
|
|
313
303
|
n();
|
|
314
304
|
} finally {
|
|
315
|
-
|
|
305
|
+
Fe.transition = e;
|
|
316
306
|
}
|
|
317
307
|
};
|
|
318
|
-
x.unstable_act =
|
|
308
|
+
x.unstable_act = _n;
|
|
319
309
|
x.useCallback = function(n, e) {
|
|
320
|
-
return
|
|
310
|
+
return A.current.useCallback(n, e);
|
|
321
311
|
};
|
|
322
312
|
x.useContext = function(n) {
|
|
323
|
-
return
|
|
313
|
+
return A.current.useContext(n);
|
|
324
314
|
};
|
|
325
315
|
x.useDebugValue = function() {
|
|
326
316
|
};
|
|
327
317
|
x.useDeferredValue = function(n) {
|
|
328
|
-
return
|
|
318
|
+
return A.current.useDeferredValue(n);
|
|
329
319
|
};
|
|
330
320
|
x.useEffect = function(n, e) {
|
|
331
|
-
return
|
|
321
|
+
return A.current.useEffect(n, e);
|
|
332
322
|
};
|
|
333
323
|
x.useId = function() {
|
|
334
|
-
return
|
|
324
|
+
return A.current.useId();
|
|
335
325
|
};
|
|
336
326
|
x.useImperativeHandle = function(n, e, t) {
|
|
337
|
-
return
|
|
327
|
+
return A.current.useImperativeHandle(n, e, t);
|
|
338
328
|
};
|
|
339
329
|
x.useInsertionEffect = function(n, e) {
|
|
340
|
-
return
|
|
330
|
+
return A.current.useInsertionEffect(n, e);
|
|
341
331
|
};
|
|
342
332
|
x.useLayoutEffect = function(n, e) {
|
|
343
|
-
return
|
|
333
|
+
return A.current.useLayoutEffect(n, e);
|
|
344
334
|
};
|
|
345
335
|
x.useMemo = function(n, e) {
|
|
346
|
-
return
|
|
336
|
+
return A.current.useMemo(n, e);
|
|
347
337
|
};
|
|
348
338
|
x.useReducer = function(n, e, t) {
|
|
349
|
-
return
|
|
339
|
+
return A.current.useReducer(n, e, t);
|
|
350
340
|
};
|
|
351
341
|
x.useRef = function(n) {
|
|
352
|
-
return
|
|
342
|
+
return A.current.useRef(n);
|
|
353
343
|
};
|
|
354
344
|
x.useState = function(n) {
|
|
355
|
-
return
|
|
345
|
+
return A.current.useState(n);
|
|
356
346
|
};
|
|
357
347
|
x.useSyncExternalStore = function(n, e, t) {
|
|
358
|
-
return
|
|
348
|
+
return A.current.useSyncExternalStore(n, e, t);
|
|
359
349
|
};
|
|
360
350
|
x.useTransition = function() {
|
|
361
|
-
return
|
|
351
|
+
return A.current.useTransition();
|
|
362
352
|
};
|
|
363
353
|
x.version = "18.3.1";
|
|
364
|
-
|
|
365
|
-
var F =
|
|
366
|
-
const
|
|
354
|
+
Rn.exports = x;
|
|
355
|
+
var F = Rn.exports;
|
|
356
|
+
const Hi = /* @__PURE__ */ Hr(F), Ra = /* @__PURE__ */ ui({
|
|
367
357
|
__proto__: null,
|
|
368
|
-
default:
|
|
369
|
-
}, [F]),
|
|
358
|
+
default: Hi
|
|
359
|
+
}, [F]), Vi = (n, e, t, r) => {
|
|
370
360
|
var o, s, a, u;
|
|
371
361
|
const i = [t, {
|
|
372
362
|
code: e,
|
|
@@ -374,10 +364,10 @@ const ki = /* @__PURE__ */ Ar(F), wa = /* @__PURE__ */ ni({
|
|
|
374
364
|
}];
|
|
375
365
|
if ((s = (o = n == null ? void 0 : n.services) == null ? void 0 : o.logger) != null && s.forward)
|
|
376
366
|
return n.services.logger.forward(i, "warn", "react-i18next::", !0);
|
|
377
|
-
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
},
|
|
367
|
+
ee(i[0]) && (i[0] = `react-i18next:: ${i[0]}`), (u = (a = n == null ? void 0 : n.services) == null ? void 0 : a.logger) != null && u.warn ? n.services.logger.warn(...i) : console != null && console.warn && [...i];
|
|
368
|
+
}, Vt = {}, pt = (n, e, t, r) => {
|
|
369
|
+
ee(t) && Vt[t] || (ee(t) && (Vt[t] = /* @__PURE__ */ new Date()), Vi(n, e, t, r));
|
|
370
|
+
}, Mn = (n, e) => () => {
|
|
381
371
|
if (n.isInitialized)
|
|
382
372
|
e();
|
|
383
373
|
else {
|
|
@@ -388,14 +378,14 @@ const ki = /* @__PURE__ */ Ar(F), wa = /* @__PURE__ */ ni({
|
|
|
388
378
|
};
|
|
389
379
|
n.on("initialized", t);
|
|
390
380
|
}
|
|
391
|
-
},
|
|
392
|
-
n.loadNamespaces(e,
|
|
393
|
-
},
|
|
394
|
-
if (
|
|
381
|
+
}, ht = (n, e, t) => {
|
|
382
|
+
n.loadNamespaces(e, Mn(n, t));
|
|
383
|
+
}, Bt = (n, e, t, r) => {
|
|
384
|
+
if (ee(t) && (t = [t]), n.options.preload && n.options.preload.indexOf(e) > -1) return ht(n, t, r);
|
|
395
385
|
t.forEach((i) => {
|
|
396
386
|
n.options.ns.indexOf(i) < 0 && n.options.ns.push(i);
|
|
397
|
-
}), n.loadLanguages(e,
|
|
398
|
-
},
|
|
387
|
+
}), n.loadLanguages(e, Mn(n, r));
|
|
388
|
+
}, Bi = (n, e, t = {}) => !e.languages || !e.languages.length ? (pt(e, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
399
389
|
languages: e.languages
|
|
400
390
|
}), !0) : e.hasLoadedNamespace(n, {
|
|
401
391
|
lng: t.lng,
|
|
@@ -403,7 +393,7 @@ const ki = /* @__PURE__ */ Ar(F), wa = /* @__PURE__ */ ni({
|
|
|
403
393
|
var o;
|
|
404
394
|
if (((o = t.bindI18n) == null ? void 0 : o.indexOf("languageChanging")) > -1 && r.services.backendConnector.backend && r.isLanguageChangingTo && !i(r.isLanguageChangingTo, n)) return !1;
|
|
405
395
|
}
|
|
406
|
-
}),
|
|
396
|
+
}), ee = (n) => typeof n == "string", Ki = (n) => typeof n == "object" && n !== null, qi = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g, zi = {
|
|
407
397
|
"&": "&",
|
|
408
398
|
"&": "&",
|
|
409
399
|
"<": "<",
|
|
@@ -424,8 +414,8 @@ const ki = /* @__PURE__ */ Ar(F), wa = /* @__PURE__ */ ni({
|
|
|
424
414
|
"…": "…",
|
|
425
415
|
"/": "/",
|
|
426
416
|
"/": "/"
|
|
427
|
-
},
|
|
428
|
-
let
|
|
417
|
+
}, Wi = (n) => zi[n], Ji = (n) => n.replace(qi, Wi);
|
|
418
|
+
let gt = {
|
|
429
419
|
bindI18n: "languageChanged",
|
|
430
420
|
bindI18nStore: "",
|
|
431
421
|
transEmptyNodeValue: "",
|
|
@@ -433,24 +423,24 @@ let pt = {
|
|
|
433
423
|
transWrapTextNodes: "",
|
|
434
424
|
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
435
425
|
useSuspense: !0,
|
|
436
|
-
unescape:
|
|
426
|
+
unescape: Ji
|
|
437
427
|
};
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
...
|
|
428
|
+
const Xi = (n = {}) => {
|
|
429
|
+
gt = {
|
|
430
|
+
...gt,
|
|
441
431
|
...n
|
|
442
432
|
};
|
|
443
|
-
},
|
|
444
|
-
let
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
},
|
|
433
|
+
}, Yi = () => gt;
|
|
434
|
+
let Hn;
|
|
435
|
+
const Gi = (n) => {
|
|
436
|
+
Hn = n;
|
|
437
|
+
}, Qi = () => Hn, Zi = {
|
|
448
438
|
type: "3rdParty",
|
|
449
439
|
init(n) {
|
|
450
|
-
|
|
440
|
+
Xi(n.options.react), Gi(n);
|
|
451
441
|
}
|
|
452
|
-
},
|
|
453
|
-
class
|
|
442
|
+
}, eo = F.createContext();
|
|
443
|
+
class to {
|
|
454
444
|
constructor() {
|
|
455
445
|
this.usedNamespaces = {};
|
|
456
446
|
}
|
|
@@ -463,120 +453,120 @@ class Vi {
|
|
|
463
453
|
return Object.keys(this.usedNamespaces);
|
|
464
454
|
}
|
|
465
455
|
}
|
|
466
|
-
const
|
|
456
|
+
const no = (n, e) => {
|
|
467
457
|
const t = F.useRef();
|
|
468
458
|
return F.useEffect(() => {
|
|
469
459
|
t.current = n;
|
|
470
460
|
}, [n, e]), t.current;
|
|
471
|
-
},
|
|
472
|
-
var
|
|
461
|
+
}, Vn = (n, e, t, r) => n.getFixedT(e, t, r), ro = (n, e, t, r) => F.useCallback(Vn(n, e, t, r), [n, e, t, r]), io = (n, e = {}) => {
|
|
462
|
+
var $, J, X, k;
|
|
473
463
|
const {
|
|
474
464
|
i18n: t
|
|
475
465
|
} = e, {
|
|
476
466
|
i18n: r,
|
|
477
467
|
defaultNS: i
|
|
478
|
-
} = F.useContext(
|
|
479
|
-
if (o && !o.reportNamespaces && (o.reportNamespaces = new
|
|
480
|
-
|
|
481
|
-
const O = (
|
|
482
|
-
return
|
|
468
|
+
} = F.useContext(eo) || {}, o = t || r || Qi();
|
|
469
|
+
if (o && !o.reportNamespaces && (o.reportNamespaces = new to()), !o) {
|
|
470
|
+
pt(o, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
471
|
+
const O = (R, T) => ee(T) ? T : Ki(T) && ee(T.defaultValue) ? T.defaultValue : Array.isArray(R) ? R[R.length - 1] : R, I = [O, {}, !1];
|
|
472
|
+
return I.t = O, I.i18n = {}, I.ready = !1, I;
|
|
483
473
|
}
|
|
484
|
-
(
|
|
474
|
+
($ = o.options.react) != null && $.wait && pt(o, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
485
475
|
const s = {
|
|
486
|
-
...
|
|
476
|
+
...Yi(),
|
|
487
477
|
...o.options.react,
|
|
488
478
|
...e
|
|
489
479
|
}, {
|
|
490
480
|
useSuspense: a,
|
|
491
481
|
keyPrefix: u
|
|
492
482
|
} = s;
|
|
493
|
-
let c = n || i || ((
|
|
494
|
-
c =
|
|
495
|
-
const l = (o.isInitialized || o.initializedStoreOnce) && c.every((O) =>
|
|
496
|
-
let
|
|
497
|
-
e.lng && (
|
|
498
|
-
const
|
|
483
|
+
let c = n || i || ((J = o.options) == null ? void 0 : J.defaultNS);
|
|
484
|
+
c = ee(c) ? [c] : c || ["translation"], (k = (X = o.reportNamespaces).addUsedNamespaces) == null || k.call(X, c);
|
|
485
|
+
const l = (o.isInitialized || o.initializedStoreOnce) && c.every((O) => Bi(O, o, s)), f = ro(o, e.lng || null, s.nsMode === "fallback" ? c : c[0], u), d = () => f, g = () => Vn(o, e.lng || null, s.nsMode === "fallback" ? c : c[0], u), [m, v] = F.useState(d);
|
|
486
|
+
let b = c.join();
|
|
487
|
+
e.lng && (b = `${e.lng}${b}`);
|
|
488
|
+
const P = no(b), E = F.useRef(!0);
|
|
499
489
|
F.useEffect(() => {
|
|
500
490
|
const {
|
|
501
491
|
bindI18n: O,
|
|
502
|
-
bindI18nStore:
|
|
492
|
+
bindI18nStore: I
|
|
503
493
|
} = s;
|
|
504
|
-
E.current = !0, !l && !a && (e.lng ?
|
|
494
|
+
E.current = !0, !l && !a && (e.lng ? Bt(o, e.lng, c, () => {
|
|
505
495
|
E.current && v(g);
|
|
506
|
-
}) :
|
|
496
|
+
}) : ht(o, c, () => {
|
|
507
497
|
E.current && v(g);
|
|
508
|
-
})), l &&
|
|
509
|
-
const
|
|
498
|
+
})), l && P && P !== b && E.current && v(g);
|
|
499
|
+
const R = () => {
|
|
510
500
|
E.current && v(g);
|
|
511
501
|
};
|
|
512
|
-
return O && (o == null || o.on(O,
|
|
513
|
-
E.current = !1, o && (O == null || O.split(" ").forEach((T) => o.off(T,
|
|
502
|
+
return O && (o == null || o.on(O, R)), I && (o == null || o.store.on(I, R)), () => {
|
|
503
|
+
E.current = !1, o && (O == null || O.split(" ").forEach((T) => o.off(T, R))), I && o && I.split(" ").forEach((T) => o.store.off(T, R));
|
|
514
504
|
};
|
|
515
|
-
}, [o,
|
|
505
|
+
}, [o, b]), F.useEffect(() => {
|
|
516
506
|
E.current && l && v(d);
|
|
517
507
|
}, [o, u, l]);
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
508
|
+
const L = [m, o, l];
|
|
509
|
+
if (L.t = m, L.i18n = o, L.ready = l, l || !l && !a) return L;
|
|
520
510
|
throw new Promise((O) => {
|
|
521
|
-
e.lng ?
|
|
511
|
+
e.lng ? Bt(o, e.lng, c, () => O()) : ht(o, c, () => O());
|
|
522
512
|
});
|
|
523
|
-
},
|
|
513
|
+
}, S = (n) => typeof n == "string", ve = () => {
|
|
524
514
|
let n, e;
|
|
525
515
|
const t = new Promise((r, i) => {
|
|
526
516
|
n = r, e = i;
|
|
527
517
|
});
|
|
528
518
|
return t.resolve = n, t.reject = e, t;
|
|
529
|
-
},
|
|
519
|
+
}, Kt = (n) => n == null ? "" : "" + n, oo = (n, e, t) => {
|
|
530
520
|
n.forEach((r) => {
|
|
531
521
|
e[r] && (t[r] = e[r]);
|
|
532
522
|
});
|
|
533
|
-
},
|
|
534
|
-
const r =
|
|
523
|
+
}, so = /###/g, qt = (n) => n && n.indexOf("###") > -1 ? n.replace(so, ".") : n, zt = (n) => !n || S(n), Oe = (n, e, t) => {
|
|
524
|
+
const r = S(e) ? e.split(".") : e;
|
|
535
525
|
let i = 0;
|
|
536
526
|
for (; i < r.length - 1; ) {
|
|
537
|
-
if (
|
|
538
|
-
const o =
|
|
527
|
+
if (zt(n)) return {};
|
|
528
|
+
const o = qt(r[i]);
|
|
539
529
|
!n[o] && t && (n[o] = new t()), Object.prototype.hasOwnProperty.call(n, o) ? n = n[o] : n = {}, ++i;
|
|
540
530
|
}
|
|
541
|
-
return
|
|
531
|
+
return zt(n) ? {} : {
|
|
542
532
|
obj: n,
|
|
543
|
-
k:
|
|
533
|
+
k: qt(r[i])
|
|
544
534
|
};
|
|
545
|
-
},
|
|
535
|
+
}, Wt = (n, e, t) => {
|
|
546
536
|
const {
|
|
547
537
|
obj: r,
|
|
548
538
|
k: i
|
|
549
|
-
} =
|
|
539
|
+
} = Oe(n, e, Object);
|
|
550
540
|
if (r !== void 0 || e.length === 1) {
|
|
551
541
|
r[i] = t;
|
|
552
542
|
return;
|
|
553
543
|
}
|
|
554
|
-
let o = e[e.length - 1], s = e.slice(0, e.length - 1), a =
|
|
544
|
+
let o = e[e.length - 1], s = e.slice(0, e.length - 1), a = Oe(n, s, Object);
|
|
555
545
|
for (; a.obj === void 0 && s.length; )
|
|
556
|
-
o = `${s[s.length - 1]}.${o}`, s = s.slice(0, s.length - 1), a =
|
|
546
|
+
o = `${s[s.length - 1]}.${o}`, s = s.slice(0, s.length - 1), a = Oe(n, s, Object), a != null && a.obj && typeof a.obj[`${a.k}.${o}`] < "u" && (a.obj = void 0);
|
|
557
547
|
a.obj[`${a.k}.${o}`] = t;
|
|
558
|
-
},
|
|
548
|
+
}, ao = (n, e, t, r) => {
|
|
559
549
|
const {
|
|
560
550
|
obj: i,
|
|
561
551
|
k: o
|
|
562
|
-
} =
|
|
552
|
+
} = Oe(n, e, Object);
|
|
563
553
|
i[o] = i[o] || [], i[o].push(t);
|
|
564
|
-
},
|
|
554
|
+
}, Me = (n, e) => {
|
|
565
555
|
const {
|
|
566
556
|
obj: t,
|
|
567
557
|
k: r
|
|
568
|
-
} =
|
|
558
|
+
} = Oe(n, e);
|
|
569
559
|
if (t && Object.prototype.hasOwnProperty.call(t, r))
|
|
570
560
|
return t[r];
|
|
571
|
-
},
|
|
572
|
-
const r =
|
|
573
|
-
return r !== void 0 ? r :
|
|
574
|
-
},
|
|
561
|
+
}, uo = (n, e, t) => {
|
|
562
|
+
const r = Me(n, t);
|
|
563
|
+
return r !== void 0 ? r : Me(e, t);
|
|
564
|
+
}, Bn = (n, e, t) => {
|
|
575
565
|
for (const r in e)
|
|
576
|
-
r !== "__proto__" && r !== "constructor" && (r in n ?
|
|
566
|
+
r !== "__proto__" && r !== "constructor" && (r in n ? S(n[r]) || n[r] instanceof String || S(e[r]) || e[r] instanceof String ? t && (n[r] = e[r]) : Bn(n[r], e[r], t) : n[r] = e[r]);
|
|
577
567
|
return n;
|
|
578
|
-
},
|
|
579
|
-
var
|
|
568
|
+
}, re = (n) => n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
569
|
+
var lo = {
|
|
580
570
|
"&": "&",
|
|
581
571
|
"<": "<",
|
|
582
572
|
">": ">",
|
|
@@ -584,8 +574,8 @@ var Gi = {
|
|
|
584
574
|
"'": "'",
|
|
585
575
|
"/": "/"
|
|
586
576
|
};
|
|
587
|
-
const
|
|
588
|
-
class
|
|
577
|
+
const co = (n) => S(n) ? n.replace(/[&<>"'\/]/g, (e) => lo[e]) : n;
|
|
578
|
+
class fo {
|
|
589
579
|
constructor(e) {
|
|
590
580
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
591
581
|
}
|
|
@@ -597,18 +587,18 @@ class Qi {
|
|
|
597
587
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, r), this.regExpQueue.push(e), r;
|
|
598
588
|
}
|
|
599
589
|
}
|
|
600
|
-
const
|
|
590
|
+
const po = [" ", ",", "?", "!", ";"], ho = new fo(20), go = (n, e, t) => {
|
|
601
591
|
e = e || "", t = t || "";
|
|
602
|
-
const r =
|
|
592
|
+
const r = po.filter((s) => e.indexOf(s) < 0 && t.indexOf(s) < 0);
|
|
603
593
|
if (r.length === 0) return !0;
|
|
604
|
-
const i =
|
|
594
|
+
const i = ho.getRegExp(`(${r.map((s) => s === "?" ? "\\?" : s).join("|")})`);
|
|
605
595
|
let o = !i.test(n);
|
|
606
596
|
if (!o) {
|
|
607
597
|
const s = n.indexOf(t);
|
|
608
598
|
s > 0 && !i.test(n.substring(0, s)) && (o = !0);
|
|
609
599
|
}
|
|
610
600
|
return o;
|
|
611
|
-
},
|
|
601
|
+
}, mt = function(n, e) {
|
|
612
602
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
|
|
613
603
|
if (!n) return;
|
|
614
604
|
if (n[e])
|
|
@@ -629,7 +619,7 @@ const Zi = [" ", ",", "?", "!", ";"], eo = new Qi(20), to = (n, e, t) => {
|
|
|
629
619
|
i = s;
|
|
630
620
|
}
|
|
631
621
|
return i;
|
|
632
|
-
},
|
|
622
|
+
}, He = (n) => n == null ? void 0 : n.replace("_", "-"), mo = {
|
|
633
623
|
type: "logger",
|
|
634
624
|
log(n) {
|
|
635
625
|
this.output("log", n);
|
|
@@ -645,14 +635,14 @@ const Zi = [" ", ",", "?", "!", ";"], eo = new Qi(20), to = (n, e, t) => {
|
|
|
645
635
|
(r = (t = console == null ? void 0 : console[n]) == null ? void 0 : t.apply) == null || r.call(t, console, e);
|
|
646
636
|
}
|
|
647
637
|
};
|
|
648
|
-
class
|
|
638
|
+
class Ve {
|
|
649
639
|
constructor(e) {
|
|
650
640
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
651
641
|
this.init(e, t);
|
|
652
642
|
}
|
|
653
643
|
init(e) {
|
|
654
644
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
655
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
645
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || mo, this.options = t, this.debug = t.debug;
|
|
656
646
|
}
|
|
657
647
|
log() {
|
|
658
648
|
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
@@ -675,20 +665,20 @@ class He {
|
|
|
675
665
|
return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
|
|
676
666
|
}
|
|
677
667
|
forward(e, t, r, i) {
|
|
678
|
-
return i && !this.debug ? null : (
|
|
668
|
+
return i && !this.debug ? null : (S(e[0]) && (e[0] = `${r}${this.prefix} ${e[0]}`), this.logger[t](e));
|
|
679
669
|
}
|
|
680
670
|
create(e) {
|
|
681
|
-
return new
|
|
671
|
+
return new Ve(this.logger, {
|
|
682
672
|
prefix: `${this.prefix}:${e}:`,
|
|
683
673
|
...this.options
|
|
684
674
|
});
|
|
685
675
|
}
|
|
686
676
|
clone(e) {
|
|
687
|
-
return e = e || this.options, e.prefix = e.prefix || this.prefix, new
|
|
677
|
+
return e = e || this.options, e.prefix = e.prefix || this.prefix, new Ve(this.logger, e);
|
|
688
678
|
}
|
|
689
679
|
}
|
|
690
|
-
var
|
|
691
|
-
class
|
|
680
|
+
var K = new Ve();
|
|
681
|
+
class Ye {
|
|
692
682
|
constructor() {
|
|
693
683
|
this.observers = {};
|
|
694
684
|
}
|
|
@@ -722,7 +712,7 @@ class Xe {
|
|
|
722
712
|
});
|
|
723
713
|
}
|
|
724
714
|
}
|
|
725
|
-
class
|
|
715
|
+
class Jt extends Ye {
|
|
726
716
|
constructor(e) {
|
|
727
717
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
728
718
|
ns: ["translation"],
|
|
@@ -742,9 +732,9 @@ class zt extends Xe {
|
|
|
742
732
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
743
733
|
const o = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, s = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
744
734
|
let a;
|
|
745
|
-
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], r && (Array.isArray(r) ? a.push(...r) :
|
|
746
|
-
const u =
|
|
747
|
-
return !u && !t && !r && e.indexOf(".") > -1 && (e = a[0], t = a[1], r = a.slice(2).join(".")), u || !s || !
|
|
735
|
+
e.indexOf(".") > -1 ? a = e.split(".") : (a = [e, t], r && (Array.isArray(r) ? a.push(...r) : S(r) && o ? a.push(...r.split(o)) : a.push(r)));
|
|
736
|
+
const u = Me(this.data, a);
|
|
737
|
+
return !u && !t && !r && e.indexOf(".") > -1 && (e = a[0], t = a[1], r = a.slice(2).join(".")), u || !s || !S(r) ? u : mt((l = (c = this.data) == null ? void 0 : c[e]) == null ? void 0 : l[t], r, o);
|
|
748
738
|
}
|
|
749
739
|
addResource(e, t, r, i) {
|
|
750
740
|
let o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
@@ -752,14 +742,14 @@ class zt extends Xe {
|
|
|
752
742
|
};
|
|
753
743
|
const s = o.keySeparator !== void 0 ? o.keySeparator : this.options.keySeparator;
|
|
754
744
|
let a = [e, t];
|
|
755
|
-
r && (a = a.concat(s ? r.split(s) : r)), e.indexOf(".") > -1 && (a = e.split("."), i = t, t = a[1]), this.addNamespaces(t),
|
|
745
|
+
r && (a = a.concat(s ? r.split(s) : r)), e.indexOf(".") > -1 && (a = e.split("."), i = t, t = a[1]), this.addNamespaces(t), Wt(this.data, a, i), o.silent || this.emit("added", e, t, r, i);
|
|
756
746
|
}
|
|
757
747
|
addResources(e, t, r) {
|
|
758
748
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
|
|
759
749
|
silent: !1
|
|
760
750
|
};
|
|
761
751
|
for (const o in r)
|
|
762
|
-
(
|
|
752
|
+
(S(r[o]) || Array.isArray(r[o])) && this.addResource(e, t, o, r[o], {
|
|
763
753
|
silent: !0
|
|
764
754
|
});
|
|
765
755
|
i.silent || this.emit("added", e, t, r);
|
|
@@ -770,11 +760,11 @@ class zt extends Xe {
|
|
|
770
760
|
skipCopy: !1
|
|
771
761
|
}, a = [e, t];
|
|
772
762
|
e.indexOf(".") > -1 && (a = e.split("."), i = r, r = t, t = a[1]), this.addNamespaces(t);
|
|
773
|
-
let u =
|
|
774
|
-
s.skipCopy || (r = JSON.parse(JSON.stringify(r))), i ?
|
|
763
|
+
let u = Me(this.data, a) || {};
|
|
764
|
+
s.skipCopy || (r = JSON.parse(JSON.stringify(r))), i ? Bn(u, r, o) : u = {
|
|
775
765
|
...u,
|
|
776
766
|
...r
|
|
777
|
-
},
|
|
767
|
+
}, Wt(this.data, a, u), s.silent || this.emit("added", e, t, r);
|
|
778
768
|
}
|
|
779
769
|
removeResourceBundle(e, t) {
|
|
780
770
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -796,7 +786,7 @@ class zt extends Xe {
|
|
|
796
786
|
return this.data;
|
|
797
787
|
}
|
|
798
788
|
}
|
|
799
|
-
var
|
|
789
|
+
var Kn = {
|
|
800
790
|
processors: {},
|
|
801
791
|
addPostProcessor(n) {
|
|
802
792
|
this.processors[n.name] = n;
|
|
@@ -808,11 +798,11 @@ var Vn = {
|
|
|
808
798
|
}), e;
|
|
809
799
|
}
|
|
810
800
|
};
|
|
811
|
-
const
|
|
812
|
-
class
|
|
801
|
+
const Xt = {}, Yt = (n) => !S(n) && typeof n != "boolean" && typeof n != "number";
|
|
802
|
+
class Be extends Ye {
|
|
813
803
|
constructor(e) {
|
|
814
804
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
815
|
-
super(),
|
|
805
|
+
super(), oo(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = K.create("translator");
|
|
816
806
|
}
|
|
817
807
|
changeLanguage(e) {
|
|
818
808
|
e && (this.language = e);
|
|
@@ -831,20 +821,20 @@ class Ve extends Xe {
|
|
|
831
821
|
r === void 0 && (r = ":");
|
|
832
822
|
const i = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
|
|
833
823
|
let o = t.ns || this.options.defaultNS || [];
|
|
834
|
-
const s = r && e.indexOf(r) > -1, a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !
|
|
824
|
+
const s = r && e.indexOf(r) > -1, a = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !go(e, r, i);
|
|
835
825
|
if (s && !a) {
|
|
836
826
|
const u = e.match(this.interpolator.nestingRegexp);
|
|
837
827
|
if (u && u.length > 0)
|
|
838
828
|
return {
|
|
839
829
|
key: e,
|
|
840
|
-
namespaces:
|
|
830
|
+
namespaces: S(o) ? [o] : o
|
|
841
831
|
};
|
|
842
832
|
const c = e.split(r);
|
|
843
833
|
(r !== i || r === i && this.options.ns.indexOf(c[0]) > -1) && (o = c.shift()), e = c.join(i);
|
|
844
834
|
}
|
|
845
835
|
return {
|
|
846
836
|
key: e,
|
|
847
|
-
namespaces:
|
|
837
|
+
namespaces: S(o) ? [o] : o
|
|
848
838
|
};
|
|
849
839
|
}
|
|
850
840
|
translate(e, t, r) {
|
|
@@ -879,13 +869,13 @@ class Ve extends Xe {
|
|
|
879
869
|
}
|
|
880
870
|
const f = this.resolve(e, t);
|
|
881
871
|
let d = f == null ? void 0 : f.res;
|
|
882
|
-
const g = (f == null ? void 0 : f.usedKey) || s, m = (f == null ? void 0 : f.exactUsedKey) || s, v = ["[object Number]", "[object Function]", "[object RegExp]"],
|
|
872
|
+
const g = (f == null ? void 0 : f.usedKey) || s, m = (f == null ? void 0 : f.exactUsedKey) || s, v = ["[object Number]", "[object Function]", "[object RegExp]"], b = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, P = !this.i18nFormat || this.i18nFormat.handleAsObject, E = t.count !== void 0 && !S(t.count), L = Be.hasDefaultValue(t), $ = E ? this.pluralResolver.getSuffix(c, t.count, t) : "", J = t.ordinal && E ? this.pluralResolver.getSuffix(c, t.count, {
|
|
883
873
|
ordinal: !1
|
|
884
|
-
}) : "",
|
|
874
|
+
}) : "", X = E && !t.ordinal && t.count === 0, k = X && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${$}`] || t[`defaultValue${J}`] || t.defaultValue;
|
|
885
875
|
let O = d;
|
|
886
|
-
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
876
|
+
P && !d && L && (O = k);
|
|
877
|
+
const I = Yt(O), R = Object.prototype.toString.apply(O);
|
|
878
|
+
if (P && O && I && v.indexOf(R) < 0 && !(S(b) && Array.isArray(O))) {
|
|
889
879
|
if (!t.returnObjects && !this.options.returnObjects) {
|
|
890
880
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
891
881
|
const T = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(g, O, {
|
|
@@ -895,56 +885,56 @@ class Ve extends Xe {
|
|
|
895
885
|
return i ? (f.res = T, f.usedParams = this.getUsedParamsDetails(t), f) : T;
|
|
896
886
|
}
|
|
897
887
|
if (o) {
|
|
898
|
-
const T = Array.isArray(O),
|
|
888
|
+
const T = Array.isArray(O), U = T ? [] : {}, kt = T ? m : g;
|
|
899
889
|
for (const _ in O)
|
|
900
890
|
if (Object.prototype.hasOwnProperty.call(O, _)) {
|
|
901
|
-
const
|
|
902
|
-
|
|
891
|
+
const z = `${kt}${o}${_}`;
|
|
892
|
+
L && !d ? U[_] = this.translate(z, {
|
|
903
893
|
...t,
|
|
904
|
-
defaultValue:
|
|
894
|
+
defaultValue: Yt(k) ? k[_] : void 0,
|
|
905
895
|
joinArrays: !1,
|
|
906
896
|
ns: a
|
|
907
|
-
}) :
|
|
897
|
+
}) : U[_] = this.translate(z, {
|
|
908
898
|
...t,
|
|
909
899
|
joinArrays: !1,
|
|
910
900
|
ns: a
|
|
911
|
-
}),
|
|
901
|
+
}), U[_] === z && (U[_] = O[_]);
|
|
912
902
|
}
|
|
913
|
-
d =
|
|
903
|
+
d = U;
|
|
914
904
|
}
|
|
915
|
-
} else if (
|
|
916
|
-
d = d.join(
|
|
905
|
+
} else if (P && S(b) && Array.isArray(d))
|
|
906
|
+
d = d.join(b), d && (d = this.extendTranslation(d, e, t, r));
|
|
917
907
|
else {
|
|
918
|
-
let T = !1,
|
|
919
|
-
!this.isValidLookup(d) &&
|
|
920
|
-
const _ = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) &&
|
|
921
|
-
if (
|
|
922
|
-
if (this.logger.log(
|
|
908
|
+
let T = !1, U = !1;
|
|
909
|
+
!this.isValidLookup(d) && L && (T = !0, d = k), this.isValidLookup(d) || (U = !0, d = s);
|
|
910
|
+
const _ = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && U ? void 0 : d, z = L && k !== d && this.options.updateMissing;
|
|
911
|
+
if (U || T || z) {
|
|
912
|
+
if (this.logger.log(z ? "updateKey" : "missingKey", c, u, s, z ? k : d), o) {
|
|
923
913
|
const N = this.resolve(s, {
|
|
924
914
|
...t,
|
|
925
915
|
keySeparator: !1
|
|
926
916
|
});
|
|
927
917
|
N && N.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
|
|
928
918
|
}
|
|
929
|
-
let
|
|
930
|
-
const
|
|
931
|
-
if (this.options.saveMissingTo === "fallback" &&
|
|
932
|
-
for (let N = 0; N <
|
|
933
|
-
|
|
934
|
-
else this.options.saveMissingTo === "all" ?
|
|
935
|
-
const
|
|
936
|
-
var
|
|
937
|
-
const
|
|
938
|
-
this.options.missingKeyHandler ? this.options.missingKeyHandler(N, u,
|
|
919
|
+
let he = [];
|
|
920
|
+
const Ae = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
|
|
921
|
+
if (this.options.saveMissingTo === "fallback" && Ae && Ae[0])
|
|
922
|
+
for (let N = 0; N < Ae.length; N++)
|
|
923
|
+
he.push(Ae[N]);
|
|
924
|
+
else this.options.saveMissingTo === "all" ? he = this.languageUtils.toResolveHierarchy(t.lng || this.language) : he.push(t.lng || this.language);
|
|
925
|
+
const It = (N, Q, ge) => {
|
|
926
|
+
var At;
|
|
927
|
+
const Rt = L && ge !== d ? ge : _;
|
|
928
|
+
this.options.missingKeyHandler ? this.options.missingKeyHandler(N, u, Q, Rt, z, t) : (At = this.backendConnector) != null && At.saveMissing && this.backendConnector.saveMissing(N, u, Q, Rt, z, t), this.emit("missingKey", N, u, Q, d);
|
|
939
929
|
};
|
|
940
|
-
this.options.saveMissing && (this.options.saveMissingPlurals && E ?
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
|
|
930
|
+
this.options.saveMissing && (this.options.saveMissingPlurals && E ? he.forEach((N) => {
|
|
931
|
+
const Q = this.pluralResolver.getSuffixes(N, t);
|
|
932
|
+
X && t[`defaultValue${this.options.pluralSeparator}zero`] && Q.indexOf(`${this.options.pluralSeparator}zero`) < 0 && Q.push(`${this.options.pluralSeparator}zero`), Q.forEach((ge) => {
|
|
933
|
+
It([N], s + ge, t[`defaultValue${ge}`] || k);
|
|
944
934
|
});
|
|
945
|
-
}) :
|
|
935
|
+
}) : It(he, s, k));
|
|
946
936
|
}
|
|
947
|
-
d = this.extendTranslation(d, e, t, f, r),
|
|
937
|
+
d = this.extendTranslation(d, e, t, f, r), U && d === s && this.options.appendNamespaceToMissingKey && (d = `${u}:${s}`), (U || T) && this.options.parseMissingKeyHandler && (d = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}:${s}` : s, T ? d : void 0));
|
|
948
938
|
}
|
|
949
939
|
return i ? (f.res = d, f.usedParams = this.getUsedParamsDetails(t), f) : d;
|
|
950
940
|
}
|
|
@@ -966,13 +956,13 @@ class Ve extends Xe {
|
|
|
966
956
|
...r.interpolation
|
|
967
957
|
}
|
|
968
958
|
});
|
|
969
|
-
const f =
|
|
959
|
+
const f = S(e) && (((l = r == null ? void 0 : r.interpolation) == null ? void 0 : l.skipOnVariables) !== void 0 ? r.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
970
960
|
let d;
|
|
971
961
|
if (f) {
|
|
972
962
|
const m = e.match(this.interpolator.nestingRegexp);
|
|
973
963
|
d = m && m.length;
|
|
974
964
|
}
|
|
975
|
-
let g = r.replace && !
|
|
965
|
+
let g = r.replace && !S(r.replace) ? r.replace : r;
|
|
976
966
|
if (this.options.interpolation.defaultVariables && (g = {
|
|
977
967
|
...this.options.interpolation.defaultVariables,
|
|
978
968
|
...g
|
|
@@ -981,13 +971,13 @@ class Ve extends Xe {
|
|
|
981
971
|
d < v && (r.nest = !1);
|
|
982
972
|
}
|
|
983
973
|
!r.lng && i && i.res && (r.lng = this.language || i.usedLng), r.nest !== !1 && (e = this.interpolator.nest(e, function() {
|
|
984
|
-
for (var m = arguments.length, v = new Array(m),
|
|
985
|
-
v[
|
|
974
|
+
for (var m = arguments.length, v = new Array(m), b = 0; b < m; b++)
|
|
975
|
+
v[b] = arguments[b];
|
|
986
976
|
return (o == null ? void 0 : o[0]) === v[0] && !r.context ? (s.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${t[0]}`), null) : s.translate(...v, t);
|
|
987
977
|
}, r)), r.interpolation && this.interpolator.reset();
|
|
988
978
|
}
|
|
989
|
-
const a = r.postProcess || this.options.postProcess, u =
|
|
990
|
-
return e != null && (u != null && u.length) && r.applyPostProcessor !== !1 && (e =
|
|
979
|
+
const a = r.postProcess || this.options.postProcess, u = S(a) ? [a] : a;
|
|
980
|
+
return e != null && (u != null && u.length) && r.applyPostProcessor !== !1 && (e = Kn.handle(u, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
991
981
|
i18nResolved: {
|
|
992
982
|
...i,
|
|
993
983
|
usedParams: this.getUsedParamsDetails(r)
|
|
@@ -997,34 +987,34 @@ class Ve extends Xe {
|
|
|
997
987
|
}
|
|
998
988
|
resolve(e) {
|
|
999
989
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r, i, o, s, a;
|
|
1000
|
-
return
|
|
990
|
+
return S(e) && (e = [e]), e.forEach((u) => {
|
|
1001
991
|
if (this.isValidLookup(r)) return;
|
|
1002
992
|
const c = this.extractFromKey(u, t), l = c.key;
|
|
1003
993
|
i = l;
|
|
1004
994
|
let f = c.namespaces;
|
|
1005
995
|
this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
|
|
1006
|
-
const d = t.count !== void 0 && !
|
|
1007
|
-
f.forEach((
|
|
1008
|
-
var
|
|
1009
|
-
this.isValidLookup(r) || (a =
|
|
1010
|
-
var
|
|
996
|
+
const d = t.count !== void 0 && !S(t.count), g = d && !t.ordinal && t.count === 0, m = t.context !== void 0 && (S(t.context) || typeof t.context == "number") && t.context !== "", v = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
997
|
+
f.forEach((b) => {
|
|
998
|
+
var P, E;
|
|
999
|
+
this.isValidLookup(r) || (a = b, !Xt[`${v[0]}-${b}`] && ((P = this.utils) != null && P.hasLoadedNamespace) && !((E = this.utils) != null && E.hasLoadedNamespace(a)) && (Xt[`${v[0]}-${b}`] = !0, this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${a}" 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!!!")), v.forEach((L) => {
|
|
1000
|
+
var X;
|
|
1011
1001
|
if (this.isValidLookup(r)) return;
|
|
1012
|
-
s =
|
|
1013
|
-
const
|
|
1014
|
-
if ((
|
|
1015
|
-
this.i18nFormat.addLookupKeys(
|
|
1002
|
+
s = L;
|
|
1003
|
+
const $ = [l];
|
|
1004
|
+
if ((X = this.i18nFormat) != null && X.addLookupKeys)
|
|
1005
|
+
this.i18nFormat.addLookupKeys($, l, L, b, t);
|
|
1016
1006
|
else {
|
|
1017
1007
|
let k;
|
|
1018
|
-
d && (k = this.pluralResolver.getSuffix(
|
|
1019
|
-
const O = `${this.options.pluralSeparator}zero`,
|
|
1020
|
-
if (d && (
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1008
|
+
d && (k = this.pluralResolver.getSuffix(L, t.count, t));
|
|
1009
|
+
const O = `${this.options.pluralSeparator}zero`, I = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
|
|
1010
|
+
if (d && ($.push(l + k), t.ordinal && k.indexOf(I) === 0 && $.push(l + k.replace(I, this.options.pluralSeparator)), g && $.push(l + O)), m) {
|
|
1011
|
+
const R = `${l}${this.options.contextSeparator}${t.context}`;
|
|
1012
|
+
$.push(R), d && ($.push(R + k), t.ordinal && k.indexOf(I) === 0 && $.push(R + k.replace(I, this.options.pluralSeparator)), g && $.push(R + O));
|
|
1023
1013
|
}
|
|
1024
1014
|
}
|
|
1025
|
-
let
|
|
1026
|
-
for (;
|
|
1027
|
-
this.isValidLookup(r) || (o =
|
|
1015
|
+
let J;
|
|
1016
|
+
for (; J = $.pop(); )
|
|
1017
|
+
this.isValidLookup(r) || (o = J, r = this.getResource(L, b, J, t));
|
|
1028
1018
|
}));
|
|
1029
1019
|
});
|
|
1030
1020
|
}), {
|
|
@@ -1045,7 +1035,7 @@ class Ve extends Xe {
|
|
|
1045
1035
|
}
|
|
1046
1036
|
getUsedParamsDetails() {
|
|
1047
1037
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1048
|
-
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], r = e.replace && !
|
|
1038
|
+
const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], r = e.replace && !S(e.replace);
|
|
1049
1039
|
let i = r ? e.replace : e;
|
|
1050
1040
|
if (r && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
|
|
1051
1041
|
...this.options.interpolation.defaultVariables,
|
|
@@ -1067,22 +1057,22 @@ class Ve extends Xe {
|
|
|
1067
1057
|
return !1;
|
|
1068
1058
|
}
|
|
1069
1059
|
}
|
|
1070
|
-
class
|
|
1060
|
+
class Gt {
|
|
1071
1061
|
constructor(e) {
|
|
1072
|
-
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger =
|
|
1062
|
+
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = K.create("languageUtils");
|
|
1073
1063
|
}
|
|
1074
1064
|
getScriptPartFromCode(e) {
|
|
1075
|
-
if (e =
|
|
1065
|
+
if (e = He(e), !e || e.indexOf("-") < 0) return null;
|
|
1076
1066
|
const t = e.split("-");
|
|
1077
1067
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
1078
1068
|
}
|
|
1079
1069
|
getLanguagePartFromCode(e) {
|
|
1080
|
-
if (e =
|
|
1070
|
+
if (e = He(e), !e || e.indexOf("-") < 0) return e;
|
|
1081
1071
|
const t = e.split("-");
|
|
1082
1072
|
return this.formatLanguageCode(t[0]);
|
|
1083
1073
|
}
|
|
1084
1074
|
formatLanguageCode(e) {
|
|
1085
|
-
if (
|
|
1075
|
+
if (S(e) && e.indexOf("-") > -1) {
|
|
1086
1076
|
let t;
|
|
1087
1077
|
try {
|
|
1088
1078
|
t = Intl.getCanonicalLocales(e)[0];
|
|
@@ -1115,7 +1105,7 @@ class Xt {
|
|
|
1115
1105
|
}
|
|
1116
1106
|
getFallbackCodes(e, t) {
|
|
1117
1107
|
if (!e) return [];
|
|
1118
|
-
if (typeof e == "function" && (e = e(t)),
|
|
1108
|
+
if (typeof e == "function" && (e = e(t)), S(e) && (e = [e]), Array.isArray(e)) return e;
|
|
1119
1109
|
if (!t) return e.default || [];
|
|
1120
1110
|
let r = e[t];
|
|
1121
1111
|
return r || (r = e[this.getScriptPartFromCode(t)]), r || (r = e[this.formatLanguageCode(t)]), r || (r = e[this.getLanguagePartFromCode(t)]), r || (r = e.default), r || [];
|
|
@@ -1124,28 +1114,28 @@ class Xt {
|
|
|
1124
1114
|
const r = this.getFallbackCodes(t || this.options.fallbackLng || [], e), i = [], o = (s) => {
|
|
1125
1115
|
s && (this.isSupportedCode(s) ? i.push(s) : this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`));
|
|
1126
1116
|
};
|
|
1127
|
-
return
|
|
1117
|
+
return S(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && o(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && o(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && o(this.getLanguagePartFromCode(e))) : S(e) && o(this.formatLanguageCode(e)), r.forEach((s) => {
|
|
1128
1118
|
i.indexOf(s) < 0 && o(this.formatLanguageCode(s));
|
|
1129
1119
|
}), i;
|
|
1130
1120
|
}
|
|
1131
1121
|
}
|
|
1132
|
-
const
|
|
1122
|
+
const Qt = {
|
|
1133
1123
|
zero: 0,
|
|
1134
1124
|
one: 1,
|
|
1135
1125
|
two: 2,
|
|
1136
1126
|
few: 3,
|
|
1137
1127
|
many: 4,
|
|
1138
1128
|
other: 5
|
|
1139
|
-
},
|
|
1129
|
+
}, Zt = {
|
|
1140
1130
|
select: (n) => n === 1 ? "one" : "other",
|
|
1141
1131
|
resolvedOptions: () => ({
|
|
1142
1132
|
pluralCategories: ["one", "other"]
|
|
1143
1133
|
})
|
|
1144
1134
|
};
|
|
1145
|
-
class
|
|
1135
|
+
class yo {
|
|
1146
1136
|
constructor(e) {
|
|
1147
1137
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1148
|
-
this.languageUtils = e, this.options = t, this.logger =
|
|
1138
|
+
this.languageUtils = e, this.options = t, this.logger = K.create("pluralResolver"), this.pluralRulesCache = {};
|
|
1149
1139
|
}
|
|
1150
1140
|
addRule(e, t) {
|
|
1151
1141
|
this.rules[e] = t;
|
|
@@ -1155,7 +1145,7 @@ class ro {
|
|
|
1155
1145
|
}
|
|
1156
1146
|
getRule(e) {
|
|
1157
1147
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1158
|
-
const r =
|
|
1148
|
+
const r = He(e === "dev" ? "en" : e), i = t.ordinal ? "ordinal" : "cardinal", o = JSON.stringify({
|
|
1159
1149
|
cleanedCode: r,
|
|
1160
1150
|
type: i
|
|
1161
1151
|
});
|
|
@@ -1168,8 +1158,8 @@ class ro {
|
|
|
1168
1158
|
});
|
|
1169
1159
|
} catch {
|
|
1170
1160
|
if (!Intl)
|
|
1171
|
-
return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
1172
|
-
if (!e.match(/-|_/)) return
|
|
1161
|
+
return this.logger.error("No Intl support, please use an Intl polyfill!"), Zt;
|
|
1162
|
+
if (!e.match(/-|_/)) return Zt;
|
|
1173
1163
|
const u = this.languageUtils.getLanguagePartFromCode(e);
|
|
1174
1164
|
s = this.getRule(u, t);
|
|
1175
1165
|
}
|
|
@@ -1185,7 +1175,7 @@ class ro {
|
|
|
1185
1175
|
}
|
|
1186
1176
|
getSuffixes(e) {
|
|
1187
1177
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = this.getRule(e, t);
|
|
1188
|
-
return r || (r = this.getRule("dev", t)), r ? r.resolvedOptions().pluralCategories.sort((i, o) =>
|
|
1178
|
+
return r || (r = this.getRule("dev", t)), r ? r.resolvedOptions().pluralCategories.sort((i, o) => Qt[i] - Qt[o]).map((i) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : [];
|
|
1189
1179
|
}
|
|
1190
1180
|
getSuffix(e, t) {
|
|
1191
1181
|
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
@@ -1193,15 +1183,15 @@ class ro {
|
|
|
1193
1183
|
return i ? `${this.options.prepend}${r.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, r));
|
|
1194
1184
|
}
|
|
1195
1185
|
}
|
|
1196
|
-
const
|
|
1197
|
-
let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o =
|
|
1198
|
-
return !o && i &&
|
|
1199
|
-
},
|
|
1200
|
-
class
|
|
1186
|
+
const en = function(n, e, t) {
|
|
1187
|
+
let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o = uo(n, e, t);
|
|
1188
|
+
return !o && i && S(t) && (o = mt(n, t, r), o === void 0 && (o = mt(e, t, r))), o;
|
|
1189
|
+
}, st = (n) => n.replace(/\$/g, "$$$$");
|
|
1190
|
+
class vo {
|
|
1201
1191
|
constructor() {
|
|
1202
1192
|
var t;
|
|
1203
1193
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1204
|
-
this.logger =
|
|
1194
|
+
this.logger = K.create("interpolator"), this.options = e, this.format = ((t = e == null ? void 0 : e.interpolation) == null ? void 0 : t.format) || ((r) => r), this.init(e);
|
|
1205
1195
|
}
|
|
1206
1196
|
init() {
|
|
1207
1197
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
@@ -1223,11 +1213,11 @@ class io {
|
|
|
1223
1213
|
nestingPrefixEscaped: g,
|
|
1224
1214
|
nestingSuffix: m,
|
|
1225
1215
|
nestingSuffixEscaped: v,
|
|
1226
|
-
nestingOptionsSeparator:
|
|
1227
|
-
maxReplaces:
|
|
1216
|
+
nestingOptionsSeparator: b,
|
|
1217
|
+
maxReplaces: P,
|
|
1228
1218
|
alwaysFormat: E
|
|
1229
1219
|
} = e.interpolation;
|
|
1230
|
-
this.escape = t !== void 0 ? t :
|
|
1220
|
+
this.escape = t !== void 0 ? t : co, this.escapeValue = r !== void 0 ? r : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = o ? re(o) : s || "{{", this.suffix = a ? re(a) : u || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? re(d) : g || re("$t("), this.nestingSuffix = m ? re(m) : v || re(")"), this.nestingOptionsSeparator = b || ",", this.maxReplaces = P || 1e3, this.alwaysFormat = E !== void 0 ? E : !1, this.resetRegExp();
|
|
1231
1221
|
}
|
|
1232
1222
|
reset() {
|
|
1233
1223
|
this.options && this.init(this.options);
|
|
@@ -1241,35 +1231,35 @@ class io {
|
|
|
1241
1231
|
let o, s, a;
|
|
1242
1232
|
const u = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (m) => {
|
|
1243
1233
|
if (m.indexOf(this.formatSeparator) < 0) {
|
|
1244
|
-
const E =
|
|
1234
|
+
const E = en(t, u, m, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
1245
1235
|
return this.alwaysFormat ? this.format(E, void 0, r, {
|
|
1246
1236
|
...i,
|
|
1247
1237
|
...t,
|
|
1248
1238
|
interpolationkey: m
|
|
1249
1239
|
}) : E;
|
|
1250
1240
|
}
|
|
1251
|
-
const v = m.split(this.formatSeparator),
|
|
1252
|
-
return this.format(
|
|
1241
|
+
const v = m.split(this.formatSeparator), b = v.shift().trim(), P = v.join(this.formatSeparator).trim();
|
|
1242
|
+
return this.format(en(t, u, b, this.options.keySeparator, this.options.ignoreJSONStructure), P, r, {
|
|
1253
1243
|
...i,
|
|
1254
1244
|
...t,
|
|
1255
|
-
interpolationkey:
|
|
1245
|
+
interpolationkey: b
|
|
1256
1246
|
});
|
|
1257
1247
|
};
|
|
1258
1248
|
this.resetRegExp();
|
|
1259
1249
|
const l = (i == null ? void 0 : i.missingInterpolationHandler) || this.options.missingInterpolationHandler, f = ((g = i == null ? void 0 : i.interpolation) == null ? void 0 : g.skipOnVariables) !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1260
1250
|
return [{
|
|
1261
1251
|
regex: this.regexpUnescape,
|
|
1262
|
-
safeValue: (m) =>
|
|
1252
|
+
safeValue: (m) => st(m)
|
|
1263
1253
|
}, {
|
|
1264
1254
|
regex: this.regexp,
|
|
1265
|
-
safeValue: (m) => this.escapeValue ?
|
|
1255
|
+
safeValue: (m) => this.escapeValue ? st(this.escape(m)) : st(m)
|
|
1266
1256
|
}].forEach((m) => {
|
|
1267
1257
|
for (a = 0; o = m.regex.exec(e); ) {
|
|
1268
1258
|
const v = o[1].trim();
|
|
1269
1259
|
if (s = c(v), s === void 0)
|
|
1270
1260
|
if (typeof l == "function") {
|
|
1271
|
-
const
|
|
1272
|
-
s =
|
|
1261
|
+
const P = l(e, o, i);
|
|
1262
|
+
s = S(P) ? P : "";
|
|
1273
1263
|
} else if (i && Object.prototype.hasOwnProperty.call(i, v))
|
|
1274
1264
|
s = "";
|
|
1275
1265
|
else if (f) {
|
|
@@ -1277,9 +1267,9 @@ class io {
|
|
|
1277
1267
|
continue;
|
|
1278
1268
|
} else
|
|
1279
1269
|
this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`), s = "";
|
|
1280
|
-
else !
|
|
1281
|
-
const
|
|
1282
|
-
if (e = e.replace(o[0],
|
|
1270
|
+
else !S(s) && !this.useRawValueToEscape && (s = Kt(s));
|
|
1271
|
+
const b = m.safeValue(s);
|
|
1272
|
+
if (e = e.replace(o[0], b), f ? (m.regex.lastIndex += s.length, m.regex.lastIndex -= o[0].length) : m.regex.lastIndex = 0, a++, a >= this.maxReplaces)
|
|
1283
1273
|
break;
|
|
1284
1274
|
}
|
|
1285
1275
|
}), e;
|
|
@@ -1308,14 +1298,14 @@ class io {
|
|
|
1308
1298
|
let u = [];
|
|
1309
1299
|
s = {
|
|
1310
1300
|
...r
|
|
1311
|
-
}, s = s.replace && !
|
|
1301
|
+
}, s = s.replace && !S(s.replace) ? s.replace : s, s.applyPostProcessor = !1, delete s.defaultValue;
|
|
1312
1302
|
let c = !1;
|
|
1313
1303
|
if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
|
|
1314
1304
|
const l = i[1].split(this.formatSeparator).map((f) => f.trim());
|
|
1315
1305
|
i[1] = l.shift(), u = l, c = !0;
|
|
1316
1306
|
}
|
|
1317
|
-
if (o = t(a.call(this, i[1].trim(), s), s), o && i[0] === e && !
|
|
1318
|
-
|
|
1307
|
+
if (o = t(a.call(this, i[1].trim(), s), s), o && i[0] === e && !S(o)) return o;
|
|
1308
|
+
S(o) || (o = Kt(o)), o || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), o = ""), c && (o = u.reduce((l, f) => this.format(l, f, r.lng, {
|
|
1319
1309
|
...r,
|
|
1320
1310
|
interpolationkey: i[1].trim()
|
|
1321
1311
|
}), o.trim())), e = e.replace(i[0], o), this.regexp.lastIndex = 0;
|
|
@@ -1323,7 +1313,7 @@ class io {
|
|
|
1323
1313
|
return e;
|
|
1324
1314
|
}
|
|
1325
1315
|
}
|
|
1326
|
-
const
|
|
1316
|
+
const wo = (n) => {
|
|
1327
1317
|
let e = n.toLowerCase().trim();
|
|
1328
1318
|
const t = {};
|
|
1329
1319
|
if (n.indexOf("(") > -1) {
|
|
@@ -1341,7 +1331,7 @@ const oo = (n) => {
|
|
|
1341
1331
|
formatName: e,
|
|
1342
1332
|
formatOptions: t
|
|
1343
1333
|
};
|
|
1344
|
-
},
|
|
1334
|
+
}, ie = (n) => {
|
|
1345
1335
|
const e = {};
|
|
1346
1336
|
return (t, r, i) => {
|
|
1347
1337
|
let o = i;
|
|
@@ -1351,39 +1341,39 @@ const oo = (n) => {
|
|
|
1351
1341
|
});
|
|
1352
1342
|
const s = r + JSON.stringify(o);
|
|
1353
1343
|
let a = e[s];
|
|
1354
|
-
return a || (a = n(
|
|
1344
|
+
return a || (a = n(He(r), i), e[s] = a), a(t);
|
|
1355
1345
|
};
|
|
1356
1346
|
};
|
|
1357
|
-
class
|
|
1347
|
+
class bo {
|
|
1358
1348
|
constructor() {
|
|
1359
1349
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1360
|
-
this.logger =
|
|
1361
|
-
number:
|
|
1350
|
+
this.logger = K.create("formatter"), this.options = e, this.formats = {
|
|
1351
|
+
number: ie((t, r) => {
|
|
1362
1352
|
const i = new Intl.NumberFormat(t, {
|
|
1363
1353
|
...r
|
|
1364
1354
|
});
|
|
1365
1355
|
return (o) => i.format(o);
|
|
1366
1356
|
}),
|
|
1367
|
-
currency:
|
|
1357
|
+
currency: ie((t, r) => {
|
|
1368
1358
|
const i = new Intl.NumberFormat(t, {
|
|
1369
1359
|
...r,
|
|
1370
1360
|
style: "currency"
|
|
1371
1361
|
});
|
|
1372
1362
|
return (o) => i.format(o);
|
|
1373
1363
|
}),
|
|
1374
|
-
datetime:
|
|
1364
|
+
datetime: ie((t, r) => {
|
|
1375
1365
|
const i = new Intl.DateTimeFormat(t, {
|
|
1376
1366
|
...r
|
|
1377
1367
|
});
|
|
1378
1368
|
return (o) => i.format(o);
|
|
1379
1369
|
}),
|
|
1380
|
-
relativetime:
|
|
1370
|
+
relativetime: ie((t, r) => {
|
|
1381
1371
|
const i = new Intl.RelativeTimeFormat(t, {
|
|
1382
1372
|
...r
|
|
1383
1373
|
});
|
|
1384
1374
|
return (o) => i.format(o, r.range || "day");
|
|
1385
1375
|
}),
|
|
1386
|
-
list:
|
|
1376
|
+
list: ie((t, r) => {
|
|
1387
1377
|
const i = new Intl.ListFormat(t, {
|
|
1388
1378
|
...r
|
|
1389
1379
|
});
|
|
@@ -1401,7 +1391,7 @@ class so {
|
|
|
1401
1391
|
this.formats[e.toLowerCase().trim()] = t;
|
|
1402
1392
|
}
|
|
1403
1393
|
addCached(e, t) {
|
|
1404
|
-
this.formats[e.toLowerCase().trim()] =
|
|
1394
|
+
this.formats[e.toLowerCase().trim()] = ie(t);
|
|
1405
1395
|
}
|
|
1406
1396
|
format(e, t, r) {
|
|
1407
1397
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
@@ -1415,7 +1405,7 @@ class so {
|
|
|
1415
1405
|
const {
|
|
1416
1406
|
formatName: c,
|
|
1417
1407
|
formatOptions: l
|
|
1418
|
-
} =
|
|
1408
|
+
} = wo(u);
|
|
1419
1409
|
if (this.formats[c]) {
|
|
1420
1410
|
let d = a;
|
|
1421
1411
|
try {
|
|
@@ -1435,14 +1425,14 @@ class so {
|
|
|
1435
1425
|
}, e);
|
|
1436
1426
|
}
|
|
1437
1427
|
}
|
|
1438
|
-
const
|
|
1428
|
+
const So = (n, e) => {
|
|
1439
1429
|
n.pending[e] !== void 0 && (delete n.pending[e], n.pendingCount--);
|
|
1440
1430
|
};
|
|
1441
|
-
class
|
|
1431
|
+
class xo extends Ye {
|
|
1442
1432
|
constructor(e, t, r) {
|
|
1443
1433
|
var o, s;
|
|
1444
1434
|
let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
|
|
1445
|
-
super(), this.backend = e, this.store = t, this.services = r, this.languageUtils = r.languageUtils, this.options = i, this.logger =
|
|
1435
|
+
super(), this.backend = e, this.store = t, this.services = r, this.languageUtils = r.languageUtils, this.options = i, this.logger = K.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], (s = (o = this.backend) == null ? void 0 : o.init) == null || s.call(o, r, i.backend, i);
|
|
1446
1436
|
}
|
|
1447
1437
|
queueLoad(e, t, r, i) {
|
|
1448
1438
|
const o = {}, s = {}, a = {}, u = {};
|
|
@@ -1472,7 +1462,7 @@ class uo extends Xe {
|
|
|
1472
1462
|
}), this.state[e] = t ? -1 : 2, t && r && (this.state[e] = 0);
|
|
1473
1463
|
const a = {};
|
|
1474
1464
|
this.queue.forEach((u) => {
|
|
1475
|
-
|
|
1465
|
+
ao(u.loaded, [o], s), So(u, e), t && u.errors.push(t), u.pendingCount === 0 && !u.done && (Object.keys(u.loaded).forEach((c) => {
|
|
1476
1466
|
a[c] || (a[c] = {});
|
|
1477
1467
|
const l = u.loaded[c];
|
|
1478
1468
|
l.length && l.forEach((f) => {
|
|
@@ -1524,7 +1514,7 @@ class uo extends Xe {
|
|
|
1524
1514
|
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
|
|
1525
1515
|
if (!this.backend)
|
|
1526
1516
|
return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
|
|
1527
|
-
|
|
1517
|
+
S(e) && (e = this.languageUtils.toResolveHierarchy(e)), S(t) && (t = [t]);
|
|
1528
1518
|
const o = this.queueLoad(e, t, r, i);
|
|
1529
1519
|
if (!o.toLoad.length)
|
|
1530
1520
|
return o.pending.length || i(), null;
|
|
@@ -1564,7 +1554,7 @@ class uo extends Xe {
|
|
|
1564
1554
|
if (m.length < 6)
|
|
1565
1555
|
try {
|
|
1566
1556
|
let v;
|
|
1567
|
-
m.length === 5 ? v = m(e, t, r, i, g) : v = m(e, t, r, i), v && typeof v.then == "function" ? v.then((
|
|
1557
|
+
m.length === 5 ? v = m(e, t, r, i, g) : v = m(e, t, r, i), v && typeof v.then == "function" ? v.then((b) => a(null, b)).catch(a) : a(null, v);
|
|
1568
1558
|
} catch (v) {
|
|
1569
1559
|
a(v);
|
|
1570
1560
|
}
|
|
@@ -1575,7 +1565,7 @@ class uo extends Xe {
|
|
|
1575
1565
|
}
|
|
1576
1566
|
}
|
|
1577
1567
|
}
|
|
1578
|
-
const
|
|
1568
|
+
const tn = () => ({
|
|
1579
1569
|
debug: !1,
|
|
1580
1570
|
initAsync: !0,
|
|
1581
1571
|
ns: ["translation"],
|
|
@@ -1610,7 +1600,7 @@ const Zt = () => ({
|
|
|
1610
1600
|
appendNamespaceToCIMode: !1,
|
|
1611
1601
|
overloadTranslationOptionHandler: (n) => {
|
|
1612
1602
|
let e = {};
|
|
1613
|
-
if (typeof n[1] == "object" && (e = n[1]),
|
|
1603
|
+
if (typeof n[1] == "object" && (e = n[1]), S(n[1]) && (e.defaultValue = n[1]), S(n[2]) && (e.tDescription = n[2]), typeof n[2] == "object" || typeof n[3] == "object") {
|
|
1614
1604
|
const t = n[3] || n[2];
|
|
1615
1605
|
Object.keys(t).forEach((r) => {
|
|
1616
1606
|
e[r] = t[r];
|
|
@@ -1631,21 +1621,21 @@ const Zt = () => ({
|
|
|
1631
1621
|
maxReplaces: 1e3,
|
|
1632
1622
|
skipOnVariables: !0
|
|
1633
1623
|
}
|
|
1634
|
-
}),
|
|
1624
|
+
}), nn = (n) => {
|
|
1635
1625
|
var e, t;
|
|
1636
|
-
return
|
|
1637
|
-
},
|
|
1638
|
-
},
|
|
1626
|
+
return S(n.ns) && (n.ns = [n.ns]), S(n.fallbackLng) && (n.fallbackLng = [n.fallbackLng]), S(n.fallbackNS) && (n.fallbackNS = [n.fallbackNS]), ((t = (e = n.supportedLngs) == null ? void 0 : e.indexOf) == null ? void 0 : t.call(e, "cimode")) < 0 && (n.supportedLngs = n.supportedLngs.concat(["cimode"])), typeof n.initImmediate == "boolean" && (n.initAsync = n.initImmediate), n;
|
|
1627
|
+
}, Ne = () => {
|
|
1628
|
+
}, Oo = (n) => {
|
|
1639
1629
|
Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t) => {
|
|
1640
1630
|
typeof n[t] == "function" && (n[t] = n[t].bind(n));
|
|
1641
1631
|
});
|
|
1642
1632
|
};
|
|
1643
|
-
class
|
|
1633
|
+
class Ee extends Ye {
|
|
1644
1634
|
constructor() {
|
|
1645
1635
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1646
|
-
if (super(), this.options =
|
|
1636
|
+
if (super(), this.options = nn(e), this.services = {}, this.logger = K, this.modules = {
|
|
1647
1637
|
external: []
|
|
1648
|
-
},
|
|
1638
|
+
}, Oo(this), t && !this.isInitialized && !e.isClone) {
|
|
1649
1639
|
if (!this.options.initAsync)
|
|
1650
1640
|
return this.init(e, t), this;
|
|
1651
1641
|
setTimeout(() => {
|
|
@@ -1656,42 +1646,42 @@ class Se extends Xe {
|
|
|
1656
1646
|
init() {
|
|
1657
1647
|
var e = this;
|
|
1658
1648
|
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
|
|
1659
|
-
this.isInitializing = !0, typeof t == "function" && (r = t, t = {}), t.defaultNS == null && t.ns && (
|
|
1660
|
-
const i =
|
|
1649
|
+
this.isInitializing = !0, typeof t == "function" && (r = t, t = {}), t.defaultNS == null && t.ns && (S(t.ns) ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
|
|
1650
|
+
const i = tn();
|
|
1661
1651
|
this.options = {
|
|
1662
1652
|
...i,
|
|
1663
1653
|
...this.options,
|
|
1664
|
-
...
|
|
1654
|
+
...nn(t)
|
|
1665
1655
|
}, this.options.interpolation = {
|
|
1666
1656
|
...i.interpolation,
|
|
1667
1657
|
...this.options.interpolation
|
|
1668
1658
|
}, t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
|
|
1669
1659
|
const o = (l) => l ? typeof l == "function" ? new l() : l : null;
|
|
1670
1660
|
if (!this.options.isClone) {
|
|
1671
|
-
this.modules.logger ?
|
|
1661
|
+
this.modules.logger ? K.init(o(this.modules.logger), this.options) : K.init(null, this.options);
|
|
1672
1662
|
let l;
|
|
1673
|
-
this.modules.formatter ? l = this.modules.formatter : l =
|
|
1674
|
-
const f = new
|
|
1675
|
-
this.store = new
|
|
1663
|
+
this.modules.formatter ? l = this.modules.formatter : l = bo;
|
|
1664
|
+
const f = new Gt(this.options);
|
|
1665
|
+
this.store = new Jt(this.options.resources, this.options);
|
|
1676
1666
|
const d = this.services;
|
|
1677
|
-
d.logger =
|
|
1667
|
+
d.logger = K, d.resourceStore = this.store, d.languageUtils = f, d.pluralResolver = new yo(f, {
|
|
1678
1668
|
prepend: this.options.pluralSeparator,
|
|
1679
1669
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1680
|
-
}), l && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (d.formatter = o(l), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new
|
|
1670
|
+
}), l && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (d.formatter = o(l), d.formatter.init(d, this.options), this.options.interpolation.format = d.formatter.format.bind(d.formatter)), d.interpolator = new vo(this.options), d.utils = {
|
|
1681
1671
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1682
|
-
}, d.backendConnector = new
|
|
1683
|
-
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0),
|
|
1684
|
-
v[
|
|
1672
|
+
}, d.backendConnector = new xo(o(this.modules.backend), d.resourceStore, d, this.options), d.backendConnector.on("*", function(g) {
|
|
1673
|
+
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), b = 1; b < m; b++)
|
|
1674
|
+
v[b - 1] = arguments[b];
|
|
1685
1675
|
e.emit(g, ...v);
|
|
1686
|
-
}), this.modules.languageDetector && (d.languageDetector = o(this.modules.languageDetector), d.languageDetector.init && d.languageDetector.init(d, this.options.detection, this.options)), this.modules.i18nFormat && (d.i18nFormat = o(this.modules.i18nFormat), d.i18nFormat.init && d.i18nFormat.init(this)), this.translator = new
|
|
1687
|
-
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0),
|
|
1688
|
-
v[
|
|
1676
|
+
}), this.modules.languageDetector && (d.languageDetector = o(this.modules.languageDetector), d.languageDetector.init && d.languageDetector.init(d, this.options.detection, this.options)), this.modules.i18nFormat && (d.i18nFormat = o(this.modules.i18nFormat), d.i18nFormat.init && d.i18nFormat.init(this)), this.translator = new Be(this.services, this.options), this.translator.on("*", function(g) {
|
|
1677
|
+
for (var m = arguments.length, v = new Array(m > 1 ? m - 1 : 0), b = 1; b < m; b++)
|
|
1678
|
+
v[b - 1] = arguments[b];
|
|
1689
1679
|
e.emit(g, ...v);
|
|
1690
1680
|
}), this.modules.external.forEach((g) => {
|
|
1691
1681
|
g.init && g.init(this);
|
|
1692
1682
|
});
|
|
1693
1683
|
}
|
|
1694
|
-
if (this.format = this.options.interpolation.format, r || (r =
|
|
1684
|
+
if (this.format = this.options.interpolation.format, r || (r = Ne), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
1695
1685
|
const l = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
1696
1686
|
l.length > 0 && l[0] !== "dev" && (this.options.lng = l[0]);
|
|
1697
1687
|
}
|
|
@@ -1704,7 +1694,7 @@ class Se extends Xe {
|
|
|
1704
1694
|
return e.store[l](...arguments), e;
|
|
1705
1695
|
};
|
|
1706
1696
|
});
|
|
1707
|
-
const u =
|
|
1697
|
+
const u = ve(), c = () => {
|
|
1708
1698
|
const l = (f, d) => {
|
|
1709
1699
|
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), u.resolve(d), r(f, d);
|
|
1710
1700
|
};
|
|
@@ -1715,8 +1705,8 @@ class Se extends Xe {
|
|
|
1715
1705
|
}
|
|
1716
1706
|
loadResources(e) {
|
|
1717
1707
|
var o, s;
|
|
1718
|
-
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1719
|
-
const i =
|
|
1708
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne;
|
|
1709
|
+
const i = S(e) ? e : this.language;
|
|
1720
1710
|
if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
1721
1711
|
if ((i == null ? void 0 : i.toLowerCase()) === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
|
|
1722
1712
|
const a = [], u = (c) => {
|
|
@@ -1732,15 +1722,15 @@ class Se extends Xe {
|
|
|
1732
1722
|
r(null);
|
|
1733
1723
|
}
|
|
1734
1724
|
reloadResources(e, t, r) {
|
|
1735
|
-
const i =
|
|
1736
|
-
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 =
|
|
1725
|
+
const i = ve();
|
|
1726
|
+
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 = Ne), this.services.backendConnector.reload(e, t, (o) => {
|
|
1737
1727
|
i.resolve(), r(o);
|
|
1738
1728
|
}), i;
|
|
1739
1729
|
}
|
|
1740
1730
|
use(e) {
|
|
1741
1731
|
if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
1742
1732
|
if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
1743
|
-
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" &&
|
|
1733
|
+
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" && Kn.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
1744
1734
|
}
|
|
1745
1735
|
setResolvedLanguage(e) {
|
|
1746
1736
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
|
|
@@ -1755,7 +1745,7 @@ class Se extends Xe {
|
|
|
1755
1745
|
changeLanguage(e, t) {
|
|
1756
1746
|
var r = this;
|
|
1757
1747
|
this.isLanguageChangingTo = e;
|
|
1758
|
-
const i =
|
|
1748
|
+
const i = ve();
|
|
1759
1749
|
this.emit("languageChanging", e);
|
|
1760
1750
|
const o = (u) => {
|
|
1761
1751
|
this.language = u, this.languages = this.services.languageUtils.toResolveHierarchy(u), this.resolvedLanguage = void 0, this.setResolvedLanguage(u);
|
|
@@ -1768,7 +1758,7 @@ class Se extends Xe {
|
|
|
1768
1758
|
}, a = (u) => {
|
|
1769
1759
|
var l, f;
|
|
1770
1760
|
!e && !u && this.services.languageDetector && (u = []);
|
|
1771
|
-
const c =
|
|
1761
|
+
const c = S(u) ? u : this.services.languageUtils.getBestMatchFromCodes(u);
|
|
1772
1762
|
c && (this.language || o(c), this.translator.language || this.translator.changeLanguage(c), (f = (l = this.services.languageDetector) == null ? void 0 : l.cacheUserLanguage) == null || f.call(l, c)), this.loadResources(c, (d) => {
|
|
1773
1763
|
s(d, c);
|
|
1774
1764
|
});
|
|
@@ -1792,7 +1782,7 @@ class Se extends Xe {
|
|
|
1792
1782
|
let g;
|
|
1793
1783
|
return u.keyPrefix && Array.isArray(s) ? g = s.map((m) => `${u.keyPrefix}${d}${m}`) : g = u.keyPrefix ? `${u.keyPrefix}${d}${s}` : s, i.t(g, u);
|
|
1794
1784
|
};
|
|
1795
|
-
return
|
|
1785
|
+
return S(e) ? o.lng = e : o.lngs = e, o.ns = t, o.keyPrefix = r, o;
|
|
1796
1786
|
}
|
|
1797
1787
|
t() {
|
|
1798
1788
|
var i;
|
|
@@ -1828,16 +1818,16 @@ class Se extends Xe {
|
|
|
1828
1818
|
return !!(this.hasResourceBundle(r, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || s(r, e) && (!i || s(o, e)));
|
|
1829
1819
|
}
|
|
1830
1820
|
loadNamespaces(e, t) {
|
|
1831
|
-
const r =
|
|
1832
|
-
return this.options.ns ? (
|
|
1821
|
+
const r = ve();
|
|
1822
|
+
return this.options.ns ? (S(e) && (e = [e]), e.forEach((i) => {
|
|
1833
1823
|
this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
|
|
1834
1824
|
}), this.loadResources((i) => {
|
|
1835
1825
|
r.resolve(), t && t(i);
|
|
1836
1826
|
}), r) : (t && t(), Promise.resolve());
|
|
1837
1827
|
}
|
|
1838
1828
|
loadLanguages(e, t) {
|
|
1839
|
-
const r =
|
|
1840
|
-
|
|
1829
|
+
const r = ve();
|
|
1830
|
+
S(e) && (e = [e]);
|
|
1841
1831
|
const i = this.options.preload || [], o = e.filter((s) => i.indexOf(s) < 0 && this.services.languageUtils.isSupportedCode(s));
|
|
1842
1832
|
return o.length ? (this.options.preload = i.concat(o), this.loadResources((s) => {
|
|
1843
1833
|
r.resolve(), t && t(s);
|
|
@@ -1846,22 +1836,22 @@ class Se extends Xe {
|
|
|
1846
1836
|
dir(e) {
|
|
1847
1837
|
var i, o;
|
|
1848
1838
|
if (e || (e = this.resolvedLanguage || (((i = this.languages) == null ? void 0 : i.length) > 0 ? this.languages[0] : this.language)), !e) return "rtl";
|
|
1849
|
-
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 = ((o = this.services) == null ? void 0 : o.languageUtils) || new
|
|
1839
|
+
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 = ((o = this.services) == null ? void 0 : o.languageUtils) || new Gt(tn());
|
|
1850
1840
|
return t.indexOf(r.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
1851
1841
|
}
|
|
1852
1842
|
static createInstance() {
|
|
1853
1843
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
|
|
1854
|
-
return new
|
|
1844
|
+
return new Ee(e, t);
|
|
1855
1845
|
}
|
|
1856
1846
|
cloneInstance() {
|
|
1857
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
1847
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Ne;
|
|
1858
1848
|
const r = e.forkResourceStore;
|
|
1859
1849
|
r && delete e.forkResourceStore;
|
|
1860
1850
|
const i = {
|
|
1861
1851
|
...this.options,
|
|
1862
1852
|
...e,
|
|
1863
1853
|
isClone: !0
|
|
1864
|
-
}, o = new
|
|
1854
|
+
}, o = new Ee(i);
|
|
1865
1855
|
if ((e.debug !== void 0 || e.prefix !== void 0) && (o.logger = o.logger.clone(e)), ["store", "services", "language"].forEach((a) => {
|
|
1866
1856
|
o[a] = this[a];
|
|
1867
1857
|
}), o.services = {
|
|
@@ -1874,9 +1864,9 @@ class Se extends Xe {
|
|
|
1874
1864
|
}, Object.keys(u[c]).reduce((l, f) => (l[f] = {
|
|
1875
1865
|
...u[c][f]
|
|
1876
1866
|
}, l), {})), {});
|
|
1877
|
-
o.store = new
|
|
1867
|
+
o.store = new Jt(a, i), o.services.resourceStore = o.store;
|
|
1878
1868
|
}
|
|
1879
|
-
return o.translator = new
|
|
1869
|
+
return o.translator = new Be(o.services, i), o.translator.on("*", function(a) {
|
|
1880
1870
|
for (var u = arguments.length, c = new Array(u > 1 ? u - 1 : 0), l = 1; l < u; l++)
|
|
1881
1871
|
c[l - 1] = arguments[l];
|
|
1882
1872
|
o.emit(a, ...c);
|
|
@@ -1894,20 +1884,20 @@ class Se extends Xe {
|
|
|
1894
1884
|
};
|
|
1895
1885
|
}
|
|
1896
1886
|
}
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1887
|
+
const oe = Ee.createInstance();
|
|
1888
|
+
oe.createInstance = Ee.createInstance;
|
|
1899
1889
|
const {
|
|
1900
|
-
slice:
|
|
1901
|
-
forEach:
|
|
1890
|
+
slice: Eo,
|
|
1891
|
+
forEach: To
|
|
1902
1892
|
} = [];
|
|
1903
|
-
function
|
|
1904
|
-
return
|
|
1893
|
+
function Co(n) {
|
|
1894
|
+
return To.call(Eo.call(arguments, 1), (e) => {
|
|
1905
1895
|
if (e)
|
|
1906
1896
|
for (const t in e)
|
|
1907
1897
|
n[t] === void 0 && (n[t] = e[t]);
|
|
1908
1898
|
}), n;
|
|
1909
1899
|
}
|
|
1910
|
-
const
|
|
1900
|
+
const rn = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, Lo = function(n, e) {
|
|
1911
1901
|
const r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
1912
1902
|
path: "/"
|
|
1913
1903
|
}, i = encodeURIComponent(e);
|
|
@@ -1918,12 +1908,12 @@ const tn = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, ho = function(n, e) {
|
|
|
1918
1908
|
o += `; Max-Age=${Math.floor(s)}`;
|
|
1919
1909
|
}
|
|
1920
1910
|
if (r.domain) {
|
|
1921
|
-
if (!
|
|
1911
|
+
if (!rn.test(r.domain))
|
|
1922
1912
|
throw new TypeError("option domain is invalid");
|
|
1923
1913
|
o += `; Domain=${r.domain}`;
|
|
1924
1914
|
}
|
|
1925
1915
|
if (r.path) {
|
|
1926
|
-
if (!
|
|
1916
|
+
if (!rn.test(r.path))
|
|
1927
1917
|
throw new TypeError("option path is invalid");
|
|
1928
1918
|
o += `; Path=${r.path}`;
|
|
1929
1919
|
}
|
|
@@ -1950,13 +1940,13 @@ const tn = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, ho = function(n, e) {
|
|
|
1950
1940
|
throw new TypeError("option sameSite is invalid");
|
|
1951
1941
|
}
|
|
1952
1942
|
return o;
|
|
1953
|
-
},
|
|
1943
|
+
}, on = {
|
|
1954
1944
|
create(n, e, t, r) {
|
|
1955
1945
|
let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
|
|
1956
1946
|
path: "/",
|
|
1957
1947
|
sameSite: "strict"
|
|
1958
1948
|
};
|
|
1959
|
-
t && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + t * 60 * 1e3)), r && (i.domain = r), document.cookie =
|
|
1949
|
+
t && (i.expires = /* @__PURE__ */ new Date(), i.expires.setTime(i.expires.getTime() + t * 60 * 1e3)), r && (i.domain = r), document.cookie = Lo(n, encodeURIComponent(e), i);
|
|
1960
1950
|
},
|
|
1961
1951
|
read(n) {
|
|
1962
1952
|
const e = `${n}=`, t = document.cookie.split(";");
|
|
@@ -1971,7 +1961,7 @@ const tn = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, ho = function(n, e) {
|
|
|
1971
1961
|
this.create(n, "", -1);
|
|
1972
1962
|
}
|
|
1973
1963
|
};
|
|
1974
|
-
var
|
|
1964
|
+
var Po = {
|
|
1975
1965
|
name: "cookie",
|
|
1976
1966
|
// Deconstruct the options object and extract the lookupCookie property
|
|
1977
1967
|
lookup(n) {
|
|
@@ -1979,7 +1969,7 @@ var go = {
|
|
|
1979
1969
|
lookupCookie: e
|
|
1980
1970
|
} = n;
|
|
1981
1971
|
if (e && typeof document < "u")
|
|
1982
|
-
return
|
|
1972
|
+
return on.read(e) || void 0;
|
|
1983
1973
|
},
|
|
1984
1974
|
// Deconstruct the options object and extract the lookupCookie, cookieMinutes, cookieDomain, and cookieOptions properties
|
|
1985
1975
|
cacheUserLanguage(n, e) {
|
|
@@ -1989,9 +1979,9 @@ var go = {
|
|
|
1989
1979
|
cookieDomain: i,
|
|
1990
1980
|
cookieOptions: o
|
|
1991
1981
|
} = e;
|
|
1992
|
-
t && typeof document < "u" &&
|
|
1982
|
+
t && typeof document < "u" && on.create(t, n, r, i, o);
|
|
1993
1983
|
}
|
|
1994
|
-
},
|
|
1984
|
+
}, ko = {
|
|
1995
1985
|
name: "querystring",
|
|
1996
1986
|
// Deconstruct the options object and extract the lookupQuerystring property
|
|
1997
1987
|
lookup(n) {
|
|
@@ -2013,26 +2003,26 @@ var go = {
|
|
|
2013
2003
|
return t;
|
|
2014
2004
|
}
|
|
2015
2005
|
};
|
|
2016
|
-
let
|
|
2017
|
-
const
|
|
2018
|
-
if (
|
|
2006
|
+
let we = null;
|
|
2007
|
+
const sn = () => {
|
|
2008
|
+
if (we !== null) return we;
|
|
2019
2009
|
try {
|
|
2020
|
-
|
|
2010
|
+
we = window !== "undefined" && window.localStorage !== null;
|
|
2021
2011
|
const n = "i18next.translate.boo";
|
|
2022
2012
|
window.localStorage.setItem(n, "foo"), window.localStorage.removeItem(n);
|
|
2023
2013
|
} catch {
|
|
2024
|
-
|
|
2014
|
+
we = !1;
|
|
2025
2015
|
}
|
|
2026
|
-
return
|
|
2016
|
+
return we;
|
|
2027
2017
|
};
|
|
2028
|
-
var
|
|
2018
|
+
var Io = {
|
|
2029
2019
|
name: "localStorage",
|
|
2030
2020
|
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
2031
2021
|
lookup(n) {
|
|
2032
2022
|
let {
|
|
2033
2023
|
lookupLocalStorage: e
|
|
2034
2024
|
} = n;
|
|
2035
|
-
if (e &&
|
|
2025
|
+
if (e && sn())
|
|
2036
2026
|
return window.localStorage.getItem(e) || void 0;
|
|
2037
2027
|
},
|
|
2038
2028
|
// Deconstruct the options object and extract the lookupLocalStorage property
|
|
@@ -2040,37 +2030,37 @@ var yo = {
|
|
|
2040
2030
|
let {
|
|
2041
2031
|
lookupLocalStorage: t
|
|
2042
2032
|
} = e;
|
|
2043
|
-
t &&
|
|
2033
|
+
t && sn() && window.localStorage.setItem(t, n);
|
|
2044
2034
|
}
|
|
2045
2035
|
};
|
|
2046
|
-
let
|
|
2047
|
-
const
|
|
2048
|
-
if (
|
|
2036
|
+
let be = null;
|
|
2037
|
+
const an = () => {
|
|
2038
|
+
if (be !== null) return be;
|
|
2049
2039
|
try {
|
|
2050
|
-
|
|
2040
|
+
be = window !== "undefined" && window.sessionStorage !== null;
|
|
2051
2041
|
const n = "i18next.translate.boo";
|
|
2052
2042
|
window.sessionStorage.setItem(n, "foo"), window.sessionStorage.removeItem(n);
|
|
2053
2043
|
} catch {
|
|
2054
|
-
|
|
2044
|
+
be = !1;
|
|
2055
2045
|
}
|
|
2056
|
-
return
|
|
2046
|
+
return be;
|
|
2057
2047
|
};
|
|
2058
|
-
var
|
|
2048
|
+
var Ro = {
|
|
2059
2049
|
name: "sessionStorage",
|
|
2060
2050
|
lookup(n) {
|
|
2061
2051
|
let {
|
|
2062
2052
|
lookupSessionStorage: e
|
|
2063
2053
|
} = n;
|
|
2064
|
-
if (e &&
|
|
2054
|
+
if (e && an())
|
|
2065
2055
|
return window.sessionStorage.getItem(e) || void 0;
|
|
2066
2056
|
},
|
|
2067
2057
|
cacheUserLanguage(n, e) {
|
|
2068
2058
|
let {
|
|
2069
2059
|
lookupSessionStorage: t
|
|
2070
2060
|
} = e;
|
|
2071
|
-
t &&
|
|
2061
|
+
t && an() && window.sessionStorage.setItem(t, n);
|
|
2072
2062
|
}
|
|
2073
|
-
},
|
|
2063
|
+
}, Ao = {
|
|
2074
2064
|
name: "navigator",
|
|
2075
2065
|
lookup(n) {
|
|
2076
2066
|
const e = [];
|
|
@@ -2087,7 +2077,7 @@ var vo = {
|
|
|
2087
2077
|
}
|
|
2088
2078
|
return e.length > 0 ? e : void 0;
|
|
2089
2079
|
}
|
|
2090
|
-
},
|
|
2080
|
+
}, $o = {
|
|
2091
2081
|
name: "htmlTag",
|
|
2092
2082
|
// Deconstruct the options object and extract the htmlTag property
|
|
2093
2083
|
lookup(n) {
|
|
@@ -2097,7 +2087,7 @@ var vo = {
|
|
|
2097
2087
|
const r = e || (typeof document < "u" ? document.documentElement : null);
|
|
2098
2088
|
return r && typeof r.getAttribute == "function" && (t = r.getAttribute("lang")), t;
|
|
2099
2089
|
}
|
|
2100
|
-
},
|
|
2090
|
+
}, No = {
|
|
2101
2091
|
name: "path",
|
|
2102
2092
|
// Deconstruct the options object and extract the lookupFromPathIndex property
|
|
2103
2093
|
lookup(n) {
|
|
@@ -2109,7 +2099,7 @@ var vo = {
|
|
|
2109
2099
|
const t = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
2110
2100
|
return Array.isArray(t) ? (i = t[typeof e == "number" ? e : 0]) == null ? void 0 : i.replace("/", "") : void 0;
|
|
2111
2101
|
}
|
|
2112
|
-
},
|
|
2102
|
+
}, jo = {
|
|
2113
2103
|
name: "subdomain",
|
|
2114
2104
|
lookup(n) {
|
|
2115
2105
|
var i, o;
|
|
@@ -2121,15 +2111,15 @@ var vo = {
|
|
|
2121
2111
|
return r[t];
|
|
2122
2112
|
}
|
|
2123
2113
|
};
|
|
2124
|
-
let
|
|
2114
|
+
let qn = !1;
|
|
2125
2115
|
try {
|
|
2126
|
-
|
|
2116
|
+
qn = !0;
|
|
2127
2117
|
} catch {
|
|
2128
2118
|
}
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
const
|
|
2132
|
-
order:
|
|
2119
|
+
const zn = ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"];
|
|
2120
|
+
qn || zn.splice(1, 1);
|
|
2121
|
+
const Do = () => ({
|
|
2122
|
+
order: zn,
|
|
2133
2123
|
lookupQuerystring: "lng",
|
|
2134
2124
|
lookupCookie: "i18next",
|
|
2135
2125
|
lookupLocalStorage: "i18nextLng",
|
|
@@ -2141,7 +2131,7 @@ const Oo = () => ({
|
|
|
2141
2131
|
// cookieDomain: 'myDomain'
|
|
2142
2132
|
convertDetectedLanguage: (n) => n
|
|
2143
2133
|
});
|
|
2144
|
-
class
|
|
2134
|
+
class Wn {
|
|
2145
2135
|
constructor(e) {
|
|
2146
2136
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2147
2137
|
this.type = "languageDetector", this.detectors = {}, this.init(e, t);
|
|
@@ -2150,7 +2140,7 @@ class qn {
|
|
|
2150
2140
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
2151
2141
|
languageUtils: {}
|
|
2152
2142
|
}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2153
|
-
this.services = e, this.options =
|
|
2143
|
+
this.services = e, this.options = Co(t, this.options || {}, Do()), typeof this.options.convertDetectedLanguage == "string" && this.options.convertDetectedLanguage.indexOf("15897") > -1 && (this.options.convertDetectedLanguage = (i) => i.replace("-", "_")), this.options.lookupFromUrlIndex && (this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex), this.i18nOptions = r, this.addDetector(Po), this.addDetector(ko), this.addDetector(Io), this.addDetector(Ro), this.addDetector(Ao), this.addDetector($o), this.addDetector(No), this.addDetector(jo);
|
|
2154
2144
|
}
|
|
2155
2145
|
addDetector(e) {
|
|
2156
2146
|
return this.detectors[e.name] = e, this;
|
|
@@ -2171,55 +2161,55 @@ class qn {
|
|
|
2171
2161
|
}));
|
|
2172
2162
|
}
|
|
2173
2163
|
}
|
|
2174
|
-
|
|
2175
|
-
function
|
|
2164
|
+
Wn.type = "languageDetector";
|
|
2165
|
+
function Uo(n, e) {
|
|
2176
2166
|
if (!(n instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
2177
2167
|
}
|
|
2178
|
-
function
|
|
2168
|
+
function Te(n) {
|
|
2179
2169
|
"@babel/helpers - typeof";
|
|
2180
|
-
return
|
|
2170
|
+
return Te = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2181
2171
|
return typeof e;
|
|
2182
2172
|
} : function(e) {
|
|
2183
2173
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2184
|
-
},
|
|
2174
|
+
}, Te(n);
|
|
2185
2175
|
}
|
|
2186
|
-
function
|
|
2187
|
-
if (
|
|
2176
|
+
function Fo(n, e) {
|
|
2177
|
+
if (Te(n) != "object" || !n) return n;
|
|
2188
2178
|
var t = n[Symbol.toPrimitive];
|
|
2189
2179
|
if (t !== void 0) {
|
|
2190
2180
|
var r = t.call(n, e);
|
|
2191
|
-
if (
|
|
2181
|
+
if (Te(r) != "object") return r;
|
|
2192
2182
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2193
2183
|
}
|
|
2194
2184
|
return String(n);
|
|
2195
2185
|
}
|
|
2196
|
-
function
|
|
2197
|
-
var e =
|
|
2198
|
-
return
|
|
2186
|
+
function _o(n) {
|
|
2187
|
+
var e = Fo(n, "string");
|
|
2188
|
+
return Te(e) == "symbol" ? e : e + "";
|
|
2199
2189
|
}
|
|
2200
|
-
function
|
|
2190
|
+
function Mo(n, e) {
|
|
2201
2191
|
for (var t = 0; t < e.length; t++) {
|
|
2202
2192
|
var r = e[t];
|
|
2203
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n,
|
|
2193
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n, _o(r.key), r);
|
|
2204
2194
|
}
|
|
2205
2195
|
}
|
|
2206
|
-
function
|
|
2207
|
-
return e &&
|
|
2196
|
+
function Ho(n, e, t) {
|
|
2197
|
+
return e && Mo(n.prototype, e), Object.defineProperty(n, "prototype", {
|
|
2208
2198
|
writable: !1
|
|
2209
2199
|
}), n;
|
|
2210
2200
|
}
|
|
2211
|
-
var
|
|
2212
|
-
function
|
|
2213
|
-
return
|
|
2201
|
+
var Jn = [], Vo = Jn.forEach, Bo = Jn.slice;
|
|
2202
|
+
function Ko(n) {
|
|
2203
|
+
return Vo.call(Bo.call(arguments, 1), function(e) {
|
|
2214
2204
|
if (e)
|
|
2215
2205
|
for (var t in e)
|
|
2216
2206
|
n[t] === void 0 && (n[t] = e[t]);
|
|
2217
2207
|
}), n;
|
|
2218
2208
|
}
|
|
2219
|
-
function
|
|
2209
|
+
function qo(n) {
|
|
2220
2210
|
return n ? typeof n == "function" ? new n() : n : null;
|
|
2221
2211
|
}
|
|
2222
|
-
function
|
|
2212
|
+
function zo() {
|
|
2223
2213
|
return {
|
|
2224
2214
|
handleEmptyResourcesAsFailed: !0,
|
|
2225
2215
|
cacheHitMode: "none"
|
|
@@ -2227,7 +2217,7 @@ function jo() {
|
|
|
2227
2217
|
// refreshExpirationTime: 60 * 60 * 1000
|
|
2228
2218
|
};
|
|
2229
2219
|
}
|
|
2230
|
-
function
|
|
2220
|
+
function un(n, e, t, r) {
|
|
2231
2221
|
var i = n.read.bind(n);
|
|
2232
2222
|
if (i.length === 2) {
|
|
2233
2223
|
try {
|
|
@@ -2242,17 +2232,17 @@ function sn(n, e, t, r) {
|
|
|
2242
2232
|
}
|
|
2243
2233
|
i(e, t, r);
|
|
2244
2234
|
}
|
|
2245
|
-
var
|
|
2235
|
+
var Xn = /* @__PURE__ */ function() {
|
|
2246
2236
|
function n(e) {
|
|
2247
2237
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2248
|
-
|
|
2238
|
+
Uo(this, n), this.backends = [], this.type = "backend", this.allOptions = r, this.init(e, t);
|
|
2249
2239
|
}
|
|
2250
|
-
return
|
|
2240
|
+
return Ho(n, [{
|
|
2251
2241
|
key: "init",
|
|
2252
2242
|
value: function(t) {
|
|
2253
2243
|
var r = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2254
|
-
this.services = t, this.options =
|
|
2255
|
-
r.backends[a] = r.backends[a] ||
|
|
2244
|
+
this.services = t, this.options = Ko(i, this.options || {}, zo()), this.allOptions = o, this.options.backends && this.options.backends.forEach(function(s, a) {
|
|
2245
|
+
r.backends[a] = r.backends[a] || qo(s), r.backends[a].init(t, r.options.backendOptions && r.options.backendOptions[a] || {}, o);
|
|
2256
2246
|
}), this.services && this.options.reloadInterval && setInterval(function() {
|
|
2257
2247
|
return r.reload();
|
|
2258
2248
|
}, this.options.reloadInterval);
|
|
@@ -2263,13 +2253,13 @@ var Wn = /* @__PURE__ */ function() {
|
|
|
2263
2253
|
var o = this, s = this.backends.length, a = function c(l) {
|
|
2264
2254
|
if (l >= s) return i(new Error("non of the backend loaded data", !0));
|
|
2265
2255
|
var f = l === s - 1, d = o.options.handleEmptyResourcesAsFailed && !f ? 0 : -1, g = o.backends[l];
|
|
2266
|
-
g.read ?
|
|
2256
|
+
g.read ? un(g, t, r, function(m, v, b) {
|
|
2267
2257
|
if (!m && v && Object.keys(v).length > d) {
|
|
2268
2258
|
if (i(null, v, l), u(l - 1, v), g.save && o.options.cacheHitMode && ["refresh", "refreshAndUpdateStore"].indexOf(o.options.cacheHitMode) > -1) {
|
|
2269
|
-
if (
|
|
2270
|
-
var
|
|
2271
|
-
|
|
2272
|
-
E ||
|
|
2259
|
+
if (b && o.options.refreshExpirationTime && b + o.options.refreshExpirationTime > Date.now()) return;
|
|
2260
|
+
var P = o.backends[l + 1];
|
|
2261
|
+
P && P.read && un(P, t, r, function(E, L) {
|
|
2262
|
+
E || L && (Object.keys(L).length <= d || (u(l, L), o.options.cacheHitMode === "refreshAndUpdateStore" && o.services && o.services.resourceStore && o.services.resourceStore.addResourceBundle(t, r, L)));
|
|
2273
2263
|
});
|
|
2274
2264
|
}
|
|
2275
2265
|
} else
|
|
@@ -2330,25 +2320,25 @@ var Wn = /* @__PURE__ */ function() {
|
|
|
2330
2320
|
}
|
|
2331
2321
|
}]), n;
|
|
2332
2322
|
}();
|
|
2333
|
-
|
|
2334
|
-
function
|
|
2323
|
+
Xn.type = "backend";
|
|
2324
|
+
function yt(n) {
|
|
2335
2325
|
"@babel/helpers - typeof";
|
|
2336
|
-
return
|
|
2326
|
+
return yt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2337
2327
|
return typeof e;
|
|
2338
2328
|
} : function(e) {
|
|
2339
2329
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2340
|
-
},
|
|
2330
|
+
}, yt(n);
|
|
2341
2331
|
}
|
|
2342
|
-
function
|
|
2343
|
-
return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" :
|
|
2332
|
+
function Yn() {
|
|
2333
|
+
return typeof XMLHttpRequest == "function" || (typeof XMLHttpRequest > "u" ? "undefined" : yt(XMLHttpRequest)) === "object";
|
|
2344
2334
|
}
|
|
2345
|
-
function
|
|
2335
|
+
function Wo(n) {
|
|
2346
2336
|
return !!n && typeof n.then == "function";
|
|
2347
2337
|
}
|
|
2348
|
-
function
|
|
2349
|
-
return
|
|
2338
|
+
function Jo(n) {
|
|
2339
|
+
return Wo(n) ? n : Promise.resolve(n);
|
|
2350
2340
|
}
|
|
2351
|
-
function
|
|
2341
|
+
function ln(n, e) {
|
|
2352
2342
|
var t = Object.keys(n);
|
|
2353
2343
|
if (Object.getOwnPropertySymbols) {
|
|
2354
2344
|
var r = Object.getOwnPropertySymbols(n);
|
|
@@ -2358,59 +2348,59 @@ function an(n, e) {
|
|
|
2358
2348
|
}
|
|
2359
2349
|
return t;
|
|
2360
2350
|
}
|
|
2361
|
-
function
|
|
2351
|
+
function cn(n) {
|
|
2362
2352
|
for (var e = 1; e < arguments.length; e++) {
|
|
2363
2353
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
2364
|
-
e % 2 ?
|
|
2365
|
-
|
|
2366
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) :
|
|
2354
|
+
e % 2 ? ln(Object(t), !0).forEach(function(r) {
|
|
2355
|
+
Xo(n, r, t[r]);
|
|
2356
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : ln(Object(t)).forEach(function(r) {
|
|
2367
2357
|
Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(t, r));
|
|
2368
2358
|
});
|
|
2369
2359
|
}
|
|
2370
2360
|
return n;
|
|
2371
2361
|
}
|
|
2372
|
-
function
|
|
2373
|
-
return (e =
|
|
2362
|
+
function Xo(n, e, t) {
|
|
2363
|
+
return (e = Yo(e)) in n ? Object.defineProperty(n, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : n[e] = t, n;
|
|
2374
2364
|
}
|
|
2375
|
-
function
|
|
2376
|
-
var e =
|
|
2377
|
-
return
|
|
2365
|
+
function Yo(n) {
|
|
2366
|
+
var e = Go(n, "string");
|
|
2367
|
+
return te(e) == "symbol" ? e : e + "";
|
|
2378
2368
|
}
|
|
2379
|
-
function
|
|
2380
|
-
if (
|
|
2369
|
+
function Go(n, e) {
|
|
2370
|
+
if (te(n) != "object" || !n) return n;
|
|
2381
2371
|
var t = n[Symbol.toPrimitive];
|
|
2382
2372
|
if (t !== void 0) {
|
|
2383
2373
|
var r = t.call(n, e);
|
|
2384
|
-
if (
|
|
2374
|
+
if (te(r) != "object") return r;
|
|
2385
2375
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2386
2376
|
}
|
|
2387
2377
|
return (e === "string" ? String : Number)(n);
|
|
2388
2378
|
}
|
|
2389
|
-
function
|
|
2379
|
+
function te(n) {
|
|
2390
2380
|
"@babel/helpers - typeof";
|
|
2391
|
-
return
|
|
2381
|
+
return te = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2392
2382
|
return typeof e;
|
|
2393
2383
|
} : function(e) {
|
|
2394
2384
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2395
|
-
},
|
|
2396
|
-
}
|
|
2397
|
-
var
|
|
2398
|
-
typeof global < "u" && global.fetch ?
|
|
2399
|
-
var
|
|
2400
|
-
|
|
2401
|
-
var
|
|
2402
|
-
typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ?
|
|
2403
|
-
typeof
|
|
2404
|
-
if (!
|
|
2385
|
+
}, te(n);
|
|
2386
|
+
}
|
|
2387
|
+
var Y = typeof fetch == "function" ? fetch : void 0;
|
|
2388
|
+
typeof global < "u" && global.fetch ? Y = global.fetch : typeof window < "u" && window.fetch && (Y = window.fetch);
|
|
2389
|
+
var Ce;
|
|
2390
|
+
Yn() && (typeof global < "u" && global.XMLHttpRequest ? Ce = global.XMLHttpRequest : typeof window < "u" && window.XMLHttpRequest && (Ce = window.XMLHttpRequest));
|
|
2391
|
+
var Ke;
|
|
2392
|
+
typeof ActiveXObject == "function" && (typeof global < "u" && global.ActiveXObject ? Ke = global.ActiveXObject : typeof window < "u" && window.ActiveXObject && (Ke = window.ActiveXObject));
|
|
2393
|
+
typeof Y != "function" && (Y = void 0);
|
|
2394
|
+
if (!Y && !Ce && !Ke)
|
|
2405
2395
|
try {
|
|
2406
2396
|
import("./browser-ponyfill-CvzSbL_o.js").then((n) => n.b).then(function(n) {
|
|
2407
|
-
|
|
2397
|
+
Y = n.default;
|
|
2408
2398
|
}).catch(function() {
|
|
2409
2399
|
});
|
|
2410
2400
|
} catch {
|
|
2411
2401
|
}
|
|
2412
|
-
var
|
|
2413
|
-
if (t &&
|
|
2402
|
+
var vt = function(e, t) {
|
|
2403
|
+
if (t && te(t) === "object") {
|
|
2414
2404
|
var r = "";
|
|
2415
2405
|
for (var i in t)
|
|
2416
2406
|
r += "&" + encodeURIComponent(i) + "=" + encodeURIComponent(t[i]);
|
|
@@ -2418,7 +2408,7 @@ var mt = function(e, t) {
|
|
|
2418
2408
|
e = e + (e.indexOf("?") !== -1 ? "&" : "?") + r.slice(1);
|
|
2419
2409
|
}
|
|
2420
2410
|
return e;
|
|
2421
|
-
},
|
|
2411
|
+
}, fn = function(e, t, r, i) {
|
|
2422
2412
|
var o = function(u) {
|
|
2423
2413
|
if (!u.ok) return r(u.statusText || "Error", {
|
|
2424
2414
|
status: u.status
|
|
@@ -2437,33 +2427,33 @@ var mt = function(e, t) {
|
|
|
2437
2427
|
return;
|
|
2438
2428
|
}
|
|
2439
2429
|
}
|
|
2440
|
-
typeof fetch == "function" ? fetch(e, t).then(o).catch(r) :
|
|
2441
|
-
},
|
|
2442
|
-
e.queryStringParams && (t =
|
|
2443
|
-
var o =
|
|
2430
|
+
typeof fetch == "function" ? fetch(e, t).then(o).catch(r) : Y(e, t).then(o).catch(r);
|
|
2431
|
+
}, dn = !1, Qo = function(e, t, r, i) {
|
|
2432
|
+
e.queryStringParams && (t = vt(t, e.queryStringParams));
|
|
2433
|
+
var o = cn({}, typeof e.customHeaders == "function" ? e.customHeaders() : e.customHeaders);
|
|
2444
2434
|
typeof window > "u" && typeof global < "u" && typeof global.process < "u" && global.process.versions && global.process.versions.node && (o["User-Agent"] = "i18next-http-backend (node/".concat(global.process.version, "; ").concat(global.process.platform, " ").concat(global.process.arch, ")")), r && (o["Content-Type"] = "application/json");
|
|
2445
|
-
var s = typeof e.requestOptions == "function" ? e.requestOptions(r) : e.requestOptions, a =
|
|
2435
|
+
var s = typeof e.requestOptions == "function" ? e.requestOptions(r) : e.requestOptions, a = cn({
|
|
2446
2436
|
method: r ? "POST" : "GET",
|
|
2447
2437
|
body: r ? e.stringify(r) : void 0,
|
|
2448
2438
|
headers: o
|
|
2449
|
-
},
|
|
2439
|
+
}, dn ? {} : s), u = typeof e.alternateFetch == "function" && e.alternateFetch.length >= 1 ? e.alternateFetch : void 0;
|
|
2450
2440
|
try {
|
|
2451
|
-
|
|
2441
|
+
fn(t, a, i, u);
|
|
2452
2442
|
} catch (c) {
|
|
2453
2443
|
if (!s || Object.keys(s).length === 0 || !c.message || c.message.indexOf("not implemented") < 0)
|
|
2454
2444
|
return i(c);
|
|
2455
2445
|
try {
|
|
2456
2446
|
Object.keys(s).forEach(function(l) {
|
|
2457
2447
|
delete a[l];
|
|
2458
|
-
}),
|
|
2448
|
+
}), fn(t, a, i, u), dn = !0;
|
|
2459
2449
|
} catch (l) {
|
|
2460
2450
|
i(l);
|
|
2461
2451
|
}
|
|
2462
2452
|
}
|
|
2463
|
-
},
|
|
2464
|
-
r &&
|
|
2453
|
+
}, Zo = function(e, t, r, i) {
|
|
2454
|
+
r && te(r) === "object" && (r = vt("", r).slice(1)), e.queryStringParams && (t = vt(t, e.queryStringParams));
|
|
2465
2455
|
try {
|
|
2466
|
-
var o =
|
|
2456
|
+
var o = Ce ? new Ce() : new Ke("MSXML2.XMLHTTP.3.0");
|
|
2467
2457
|
o.open(r ? "POST" : "GET", t, 1), e.crossDomain || o.setRequestHeader("X-Requested-With", "XMLHttpRequest"), o.withCredentials = !!e.withCredentials, r && o.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), o.overrideMimeType && o.overrideMimeType("application/json");
|
|
2468
2458
|
var s = e.customHeaders;
|
|
2469
2459
|
if (s = typeof s == "function" ? s() : s, s)
|
|
@@ -2477,23 +2467,23 @@ var mt = function(e, t) {
|
|
|
2477
2467
|
}, o.send(r);
|
|
2478
2468
|
} catch (u) {
|
|
2479
2469
|
}
|
|
2480
|
-
},
|
|
2470
|
+
}, es = function(e, t, r, i) {
|
|
2481
2471
|
if (typeof r == "function" && (i = r, r = void 0), i = i || function() {
|
|
2482
|
-
},
|
|
2483
|
-
return
|
|
2484
|
-
if (
|
|
2485
|
-
return
|
|
2472
|
+
}, Y && t.indexOf("file:") !== 0)
|
|
2473
|
+
return Qo(e, t, r, i);
|
|
2474
|
+
if (Yn() || typeof ActiveXObject == "function")
|
|
2475
|
+
return Zo(e, t, r, i);
|
|
2486
2476
|
i(new Error("No fetch and no xhr implementation found!"));
|
|
2487
2477
|
};
|
|
2488
|
-
function
|
|
2478
|
+
function fe(n) {
|
|
2489
2479
|
"@babel/helpers - typeof";
|
|
2490
|
-
return
|
|
2480
|
+
return fe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2491
2481
|
return typeof e;
|
|
2492
2482
|
} : function(e) {
|
|
2493
2483
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2494
|
-
},
|
|
2484
|
+
}, fe(n);
|
|
2495
2485
|
}
|
|
2496
|
-
function
|
|
2486
|
+
function pn(n, e) {
|
|
2497
2487
|
var t = Object.keys(n);
|
|
2498
2488
|
if (Object.getOwnPropertySymbols) {
|
|
2499
2489
|
var r = Object.getOwnPropertySymbols(n);
|
|
@@ -2503,47 +2493,47 @@ function fn(n, e) {
|
|
|
2503
2493
|
}
|
|
2504
2494
|
return t;
|
|
2505
2495
|
}
|
|
2506
|
-
function
|
|
2496
|
+
function at(n) {
|
|
2507
2497
|
for (var e = 1; e < arguments.length; e++) {
|
|
2508
2498
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
2509
|
-
e % 2 ?
|
|
2510
|
-
|
|
2511
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) :
|
|
2499
|
+
e % 2 ? pn(Object(t), !0).forEach(function(r) {
|
|
2500
|
+
Gn(n, r, t[r]);
|
|
2501
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : pn(Object(t)).forEach(function(r) {
|
|
2512
2502
|
Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(t, r));
|
|
2513
2503
|
});
|
|
2514
2504
|
}
|
|
2515
2505
|
return n;
|
|
2516
2506
|
}
|
|
2517
|
-
function
|
|
2507
|
+
function ts(n, e) {
|
|
2518
2508
|
if (!(n instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
2519
2509
|
}
|
|
2520
|
-
function
|
|
2510
|
+
function ns(n, e) {
|
|
2521
2511
|
for (var t = 0; t < e.length; t++) {
|
|
2522
2512
|
var r = e[t];
|
|
2523
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n,
|
|
2513
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(n, Qn(r.key), r);
|
|
2524
2514
|
}
|
|
2525
2515
|
}
|
|
2526
|
-
function
|
|
2527
|
-
return e &&
|
|
2516
|
+
function rs(n, e, t) {
|
|
2517
|
+
return e && ns(n.prototype, e), Object.defineProperty(n, "prototype", { writable: !1 }), n;
|
|
2528
2518
|
}
|
|
2529
|
-
function
|
|
2530
|
-
return (e =
|
|
2519
|
+
function Gn(n, e, t) {
|
|
2520
|
+
return (e = Qn(e)) in n ? Object.defineProperty(n, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : n[e] = t, n;
|
|
2531
2521
|
}
|
|
2532
|
-
function
|
|
2533
|
-
var e =
|
|
2534
|
-
return
|
|
2522
|
+
function Qn(n) {
|
|
2523
|
+
var e = is(n, "string");
|
|
2524
|
+
return fe(e) == "symbol" ? e : e + "";
|
|
2535
2525
|
}
|
|
2536
|
-
function
|
|
2537
|
-
if (
|
|
2526
|
+
function is(n, e) {
|
|
2527
|
+
if (fe(n) != "object" || !n) return n;
|
|
2538
2528
|
var t = n[Symbol.toPrimitive];
|
|
2539
2529
|
if (t !== void 0) {
|
|
2540
2530
|
var r = t.call(n, e);
|
|
2541
|
-
if (
|
|
2531
|
+
if (fe(r) != "object") return r;
|
|
2542
2532
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2543
2533
|
}
|
|
2544
2534
|
return String(n);
|
|
2545
2535
|
}
|
|
2546
|
-
var
|
|
2536
|
+
var os = function() {
|
|
2547
2537
|
return {
|
|
2548
2538
|
loadPath: "/locales/{{lng}}/{{ns}}.json",
|
|
2549
2539
|
addPath: "/locales/add/{{lng}}/{{ns}}",
|
|
@@ -2552,12 +2542,12 @@ var zo = function() {
|
|
|
2552
2542
|
},
|
|
2553
2543
|
stringify: JSON.stringify,
|
|
2554
2544
|
parsePayload: function(t, r, i) {
|
|
2555
|
-
return
|
|
2545
|
+
return Gn({}, r, i || "");
|
|
2556
2546
|
},
|
|
2557
2547
|
parseLoadPayload: function(t, r) {
|
|
2558
2548
|
},
|
|
2559
|
-
request:
|
|
2560
|
-
reloadInterval: typeof window < "u" ? !1 :
|
|
2549
|
+
request: es,
|
|
2550
|
+
reloadInterval: typeof window < "u" ? !1 : 3600 * 1e3,
|
|
2561
2551
|
customHeaders: {},
|
|
2562
2552
|
queryStringParams: {},
|
|
2563
2553
|
crossDomain: !1,
|
|
@@ -2569,20 +2559,20 @@ var zo = function() {
|
|
|
2569
2559
|
cache: "default"
|
|
2570
2560
|
}
|
|
2571
2561
|
};
|
|
2572
|
-
},
|
|
2562
|
+
}, Zn = function() {
|
|
2573
2563
|
function n(e) {
|
|
2574
2564
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2575
|
-
|
|
2565
|
+
ts(this, n), this.services = e, this.options = t, this.allOptions = r, this.type = "backend", this.init(e, t, r);
|
|
2576
2566
|
}
|
|
2577
|
-
return
|
|
2567
|
+
return rs(n, [{
|
|
2578
2568
|
key: "init",
|
|
2579
2569
|
value: function(t) {
|
|
2580
2570
|
var r = this, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
2581
|
-
if (this.services = t, this.options =
|
|
2571
|
+
if (this.services = t, this.options = at(at(at({}, os()), this.options || {}), i), this.allOptions = o, this.services && this.options.reloadInterval) {
|
|
2582
2572
|
var s = setInterval(function() {
|
|
2583
2573
|
return r.reload();
|
|
2584
2574
|
}, this.options.reloadInterval);
|
|
2585
|
-
|
|
2575
|
+
fe(s) === "object" && typeof s.unref == "function" && s.unref();
|
|
2586
2576
|
}
|
|
2587
2577
|
}
|
|
2588
2578
|
}, {
|
|
@@ -2599,7 +2589,7 @@ var zo = function() {
|
|
|
2599
2589
|
key: "_readAny",
|
|
2600
2590
|
value: function(t, r, i, o, s) {
|
|
2601
2591
|
var a = this, u = this.options.loadPath;
|
|
2602
|
-
typeof this.options.loadPath == "function" && (u = this.options.loadPath(t, i)), u =
|
|
2592
|
+
typeof this.options.loadPath == "function" && (u = this.options.loadPath(t, i)), u = Jo(u), u.then(function(c) {
|
|
2603
2593
|
if (!c) return s(null, {});
|
|
2604
2594
|
var l = a.services.interpolator.interpolate(c, {
|
|
2605
2595
|
lng: t.join("+"),
|
|
@@ -2616,8 +2606,8 @@ var zo = function() {
|
|
|
2616
2606
|
if (f && (f.status >= 500 && f.status < 600 || !f.status)) return r("failed loading " + t + "; status code: " + f.status, !0);
|
|
2617
2607
|
if (f && f.status >= 400 && f.status < 500) return r("failed loading " + t + "; status code: " + f.status, !1);
|
|
2618
2608
|
if (!f && l && l.message) {
|
|
2619
|
-
var d = l.message.toLowerCase(), g = ["failed", "fetch", "network", "load"].find(function(
|
|
2620
|
-
return d.indexOf(
|
|
2609
|
+
var d = l.message.toLowerCase(), g = ["failed", "fetch", "network", "load"].find(function(b) {
|
|
2610
|
+
return d.indexOf(b) > -1;
|
|
2621
2611
|
});
|
|
2622
2612
|
if (g)
|
|
2623
2613
|
return r("failed loading " + t + ": " + l.message, !0);
|
|
@@ -2647,8 +2637,8 @@ var zo = function() {
|
|
|
2647
2637
|
lng: d,
|
|
2648
2638
|
ns: r
|
|
2649
2639
|
});
|
|
2650
|
-
a.options.request(a.options, m, u, function(v,
|
|
2651
|
-
c += 1, l.push(v), f.push(
|
|
2640
|
+
a.options.request(a.options, m, u, function(v, b) {
|
|
2641
|
+
c += 1, l.push(v), f.push(b), c === t.length && typeof s == "function" && s(l, f);
|
|
2652
2642
|
});
|
|
2653
2643
|
});
|
|
2654
2644
|
}
|
|
@@ -2677,8 +2667,8 @@ var zo = function() {
|
|
|
2677
2667
|
}
|
|
2678
2668
|
}]);
|
|
2679
2669
|
}();
|
|
2680
|
-
|
|
2681
|
-
var
|
|
2670
|
+
Zn.type = "backend";
|
|
2671
|
+
var ss = function(e) {
|
|
2682
2672
|
return {
|
|
2683
2673
|
type: "backend",
|
|
2684
2674
|
init: function(r, i, o) {
|
|
@@ -2703,13 +2693,13 @@ var Wo = function(e) {
|
|
|
2703
2693
|
}
|
|
2704
2694
|
};
|
|
2705
2695
|
};
|
|
2706
|
-
const
|
|
2696
|
+
const as = {
|
|
2707
2697
|
debug: !1,
|
|
2708
|
-
fallbackLng:
|
|
2698
|
+
fallbackLng: In.enum.en,
|
|
2709
2699
|
namespace: "translation",
|
|
2710
|
-
supportedLngs: Object.values(
|
|
2700
|
+
supportedLngs: Object.values(kn),
|
|
2711
2701
|
nonExplicitSupportedLngs: !1
|
|
2712
|
-
},
|
|
2702
|
+
}, us = {
|
|
2713
2703
|
react: {
|
|
2714
2704
|
useSuspense: !0
|
|
2715
2705
|
},
|
|
@@ -2717,111 +2707,189 @@ const Jo = {
|
|
|
2717
2707
|
order: ["navigator", "htmlTag", "path", "subdomain"],
|
|
2718
2708
|
caches: ["localStorage", "cookie"]
|
|
2719
2709
|
}
|
|
2720
|
-
},
|
|
2710
|
+
}, hn = (n, e) => {
|
|
2721
2711
|
const t = import.meta.url.split("/").pop();
|
|
2722
2712
|
return `${import.meta.url.replace(`/${t}`, "")}/locales/${n}/${e}.json`;
|
|
2723
2713
|
};
|
|
2724
|
-
function
|
|
2725
|
-
return
|
|
2726
|
-
new
|
|
2714
|
+
function wt(n) {
|
|
2715
|
+
return oe.isInitialized || (oe.use(Xn).use(
|
|
2716
|
+
new Wn(null, {
|
|
2727
2717
|
order: ["cookie", "localStorage", "navigator"],
|
|
2728
2718
|
lookupQuerystring: "lng",
|
|
2729
2719
|
lookupCookie: "i18next",
|
|
2730
2720
|
lookupLocalStorage: "i18nextLng",
|
|
2731
2721
|
caches: ["localStorage", "cookie"]
|
|
2732
2722
|
})
|
|
2733
|
-
).use(
|
|
2734
|
-
...
|
|
2723
|
+
).use(Zi).init({
|
|
2724
|
+
...as,
|
|
2735
2725
|
backend: {
|
|
2736
2726
|
backends: [
|
|
2737
|
-
|
|
2727
|
+
Zn,
|
|
2738
2728
|
// if a namespace can't be loaded via normal http-backend loadPath, then the inMemoryLocalBackend will try to return the correct resources
|
|
2739
2729
|
// with dynamic import, you have to use the "default" key of the module ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#importing_defaults )
|
|
2740
|
-
|
|
2741
|
-
(e, t) => import(
|
|
2730
|
+
ss(
|
|
2731
|
+
(e, t) => import(hn(e, t))
|
|
2742
2732
|
)
|
|
2743
2733
|
],
|
|
2744
2734
|
backendOptions: [
|
|
2745
2735
|
{
|
|
2746
|
-
loadPath:
|
|
2736
|
+
loadPath: hn("{{lng}}", "{{ns}}")
|
|
2747
2737
|
}
|
|
2748
2738
|
]
|
|
2749
2739
|
},
|
|
2750
|
-
...
|
|
2751
|
-
}),
|
|
2752
|
-
n == null || n(
|
|
2753
|
-
})),
|
|
2740
|
+
...us
|
|
2741
|
+
}), oe.on("loaded", () => {
|
|
2742
|
+
n == null || n(oe);
|
|
2743
|
+
})), oe;
|
|
2754
2744
|
}
|
|
2755
|
-
const
|
|
2745
|
+
const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2756
2746
|
__proto__: null,
|
|
2757
|
-
default:
|
|
2758
|
-
initializeI18n:
|
|
2747
|
+
default: wt,
|
|
2748
|
+
initializeI18n: wt
|
|
2759
2749
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2760
|
-
function
|
|
2761
|
-
const e =
|
|
2762
|
-
return
|
|
2763
|
-
}
|
|
2764
|
-
const
|
|
2765
|
-
var
|
|
2766
|
-
|
|
2767
|
-
const
|
|
2768
|
-
const e = n.split(
|
|
2750
|
+
function Aa(n) {
|
|
2751
|
+
const e = wt();
|
|
2752
|
+
return io("translation", { i18n: e, ...n });
|
|
2753
|
+
}
|
|
2754
|
+
const Ct = 60 * 1e3, Re = Ct, er = Re * 2, tr = Re * 3, Lt = Re * 15, Ge = Ct, Qe = Ge * 2, nr = Ge * 3, rr = Ct * 15;
|
|
2755
|
+
var ir = /* @__PURE__ */ ((n) => (n.SelectAll = "SelectAll", n))(ir || {}), or = /* @__PURE__ */ ((n) => (n.Text = "text", n.Image = "image", n))(or || {});
|
|
2756
|
+
w();
|
|
2757
|
+
const cs = "___", fs = Br((n) => {
|
|
2758
|
+
const e = n.split(cs);
|
|
2769
2759
|
try {
|
|
2770
2760
|
return e.length === 4;
|
|
2771
2761
|
} catch {
|
|
2772
2762
|
return !1;
|
|
2773
2763
|
}
|
|
2774
|
-
}),
|
|
2775
|
-
captchaId:
|
|
2776
|
-
captchaContentId:
|
|
2764
|
+
}), ds = y({
|
|
2765
|
+
captchaId: _e([p(), jt()]),
|
|
2766
|
+
captchaContentId: _e([p(), jt()]),
|
|
2777
2767
|
salt: p().min(34),
|
|
2778
|
-
solution:
|
|
2779
|
-
unlabelled:
|
|
2780
|
-
timeLimit:
|
|
2781
|
-
}),
|
|
2768
|
+
solution: w().array().optional(),
|
|
2769
|
+
unlabelled: w().array().optional(),
|
|
2770
|
+
timeLimit: w().optional()
|
|
2771
|
+
}), sr = y({
|
|
2782
2772
|
hash: p(),
|
|
2783
2773
|
data: p(),
|
|
2784
|
-
type:
|
|
2785
|
-
}),
|
|
2774
|
+
type: ke(or)
|
|
2775
|
+
}), ar = sr.extend({
|
|
2786
2776
|
hash: p()
|
|
2787
|
-
}),
|
|
2777
|
+
}), ps = ar.extend({
|
|
2788
2778
|
label: p()
|
|
2789
|
-
}),
|
|
2779
|
+
}), hs = ar.extend({
|
|
2790
2780
|
label: p().optional()
|
|
2791
|
-
}),
|
|
2792
|
-
items:
|
|
2781
|
+
}), ur = ds.extend({
|
|
2782
|
+
items: q(sr),
|
|
2793
2783
|
target: p()
|
|
2794
|
-
}),
|
|
2784
|
+
}), gs = ur.extend({
|
|
2795
2785
|
solution: p().array().optional(),
|
|
2796
2786
|
unlabelled: p().array().optional()
|
|
2797
|
-
}),
|
|
2798
|
-
solution:
|
|
2799
|
-
unlabelled:
|
|
2800
|
-
}),
|
|
2801
|
-
|
|
2802
|
-
|
|
2787
|
+
}), ms = gs.extend({
|
|
2788
|
+
solution: w().array().optional(),
|
|
2789
|
+
unlabelled: w().array().optional()
|
|
2790
|
+
}), ys = q(ur);
|
|
2791
|
+
q(
|
|
2792
|
+
ms
|
|
2803
2793
|
);
|
|
2804
|
-
const
|
|
2794
|
+
const lr = y({
|
|
2805
2795
|
captchaId: p(),
|
|
2806
2796
|
captchaContentId: p(),
|
|
2807
2797
|
solution: p().array(),
|
|
2808
|
-
salt: p()
|
|
2798
|
+
salt: p()
|
|
2809
2799
|
});
|
|
2810
|
-
|
|
2800
|
+
q(lr);
|
|
2811
2801
|
y({
|
|
2812
|
-
items:
|
|
2802
|
+
items: q(hs)
|
|
2813
2803
|
});
|
|
2814
2804
|
y({
|
|
2815
|
-
items:
|
|
2805
|
+
items: q(ps)
|
|
2816
2806
|
});
|
|
2817
2807
|
y({
|
|
2818
|
-
captchas:
|
|
2819
|
-
format:
|
|
2808
|
+
captchas: ys,
|
|
2809
|
+
format: ke(ir)
|
|
2820
2810
|
});
|
|
2821
2811
|
y({
|
|
2822
|
-
labels:
|
|
2812
|
+
labels: q(p())
|
|
2823
2813
|
});
|
|
2824
|
-
|
|
2814
|
+
const $a = (n) => new Promise((e) => setTimeout(e, n)), Na = (n, e) => {
|
|
2815
|
+
let t = 0;
|
|
2816
|
+
const r = "0".repeat(e);
|
|
2817
|
+
for (; ; ) {
|
|
2818
|
+
const i = new TextEncoder().encode(t + n);
|
|
2819
|
+
if (vs(Vr(i)).startsWith(r))
|
|
2820
|
+
return t;
|
|
2821
|
+
t += 1;
|
|
2822
|
+
}
|
|
2823
|
+
}, vs = (n) => Array.from(n).map((e) => e.toString(16).padStart(2, "0")).join("");
|
|
2824
|
+
function W(n, e, t) {
|
|
2825
|
+
if (n.length === 0)
|
|
2826
|
+
throw new Error("Array is empty");
|
|
2827
|
+
if (!Number.isFinite(e))
|
|
2828
|
+
throw new Error(`Index ${e} is not a finite number`);
|
|
2829
|
+
if (e > 0 ? e = e % n.length : e = Math.ceil(Math.abs(e) / n.length) * n.length + e, e >= n.length)
|
|
2830
|
+
throw new Error(`Index ${e} larger than array length ${n.length}`);
|
|
2831
|
+
if (e < 0)
|
|
2832
|
+
throw new Error(`Index ${e} smaller than 0`);
|
|
2833
|
+
return n[e];
|
|
2834
|
+
}
|
|
2835
|
+
const ws = (n) => Array.isArray(n) && n !== null, bs = "dev", qe = new Array(256), cr = new Array(256 * 256);
|
|
2836
|
+
for (let n = 0; n < 256; n++)
|
|
2837
|
+
qe[n] = n.toString(16).padStart(2, "0");
|
|
2838
|
+
for (let n = 0; n < 256; n++) {
|
|
2839
|
+
const e = n << 8;
|
|
2840
|
+
for (let t = 0; t < 256; t++)
|
|
2841
|
+
cr[e | t] = qe[n] + qe[t];
|
|
2842
|
+
}
|
|
2843
|
+
function ut(n, e) {
|
|
2844
|
+
const t = n.length % 2 | 0, r = n.length - t | 0;
|
|
2845
|
+
for (let i = 0; i < r; i += 2)
|
|
2846
|
+
e += cr[n[i] << 8 | n[i + 1]];
|
|
2847
|
+
return t && (e += qe[n[r] | 0]), e;
|
|
2848
|
+
}
|
|
2849
|
+
function Ze(n, e = -1, t = !0) {
|
|
2850
|
+
const r = t ? "0x" : "";
|
|
2851
|
+
if (!(n != null && n.length))
|
|
2852
|
+
return r;
|
|
2853
|
+
if (e > 0) {
|
|
2854
|
+
const i = Math.ceil(e / 8);
|
|
2855
|
+
if (n.length > i)
|
|
2856
|
+
return `${ut(n.subarray(0, i / 2), r)}…${ut(n.subarray(n.length - i / 2), "")}`;
|
|
2857
|
+
}
|
|
2858
|
+
return ut(n, r);
|
|
2859
|
+
}
|
|
2860
|
+
const ja = (n) => ws(n) ? Ze(new Uint8Array(n)) : n.toString(), Da = (n, e) => {
|
|
2861
|
+
const t = n.replace(/^0x/, "").split("");
|
|
2862
|
+
let r = 0, i = t.length - 1;
|
|
2863
|
+
const o = e.length.toString(16).padStart(2, "0");
|
|
2864
|
+
t[r++] = W(o, 0), t[r++] = W(o, 1);
|
|
2865
|
+
const s = [], a = [];
|
|
2866
|
+
let u = 0;
|
|
2867
|
+
for (const c of e) {
|
|
2868
|
+
const l = c.toString(16), f = l.length;
|
|
2869
|
+
u += f;
|
|
2870
|
+
const d = i - f + 1;
|
|
2871
|
+
s.push(d), a.push(f);
|
|
2872
|
+
for (let g = 0; g < f; g++)
|
|
2873
|
+
t[d + g] = W(l, g);
|
|
2874
|
+
i -= f;
|
|
2875
|
+
}
|
|
2876
|
+
if (u > n.length)
|
|
2877
|
+
throw new Error(
|
|
2878
|
+
`Hex data length ${u} exceeds length of hex string ${t.length}`
|
|
2879
|
+
);
|
|
2880
|
+
for (let c = 0; c < e.length; c++) {
|
|
2881
|
+
const l = W(s, c).toString(16).padStart(2, "0");
|
|
2882
|
+
u += l.length;
|
|
2883
|
+
const f = W(a, c).toString(16).padStart(2, "0");
|
|
2884
|
+
if (u += f.length, u > n.length)
|
|
2885
|
+
throw new Error(
|
|
2886
|
+
`Hex data length ${u} exceeds length of hex string ${t.length}`
|
|
2887
|
+
);
|
|
2888
|
+
t[r++] = W(l, 0), t[r++] = W(l, 1), t[r++] = W(f, 0), t[r++] = W(f, 1);
|
|
2889
|
+
}
|
|
2890
|
+
return `0x${t.join("")}`;
|
|
2891
|
+
};
|
|
2892
|
+
var Ss = Object.defineProperty, xs = (n, e, t) => e in n ? Ss(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, gn = (n, e, t) => (xs(n, typeof e != "symbol" ? e + "" : e, t), t), lt = {
|
|
2825
2893
|
0: 0,
|
|
2826
2894
|
1: 1,
|
|
2827
2895
|
2: 2,
|
|
@@ -2845,20 +2913,20 @@ var os = Object.defineProperty, ss = (n, e, t) => e in n ? os(n, e, { enumerable
|
|
|
2845
2913
|
E: 14,
|
|
2846
2914
|
F: 15
|
|
2847
2915
|
};
|
|
2848
|
-
function
|
|
2916
|
+
function Os(n) {
|
|
2849
2917
|
const e = n.length % 2, t = (n[1] === "x" ? 2 : 0) + e, r = (n.length - t) / 2 + e, i = new Uint8Array(r);
|
|
2850
|
-
e && (i[0] = 0 |
|
|
2918
|
+
e && (i[0] = 0 | lt[n[2]]);
|
|
2851
2919
|
for (let o = 0; o < r; ) {
|
|
2852
|
-
const s = t + o * 2, a =
|
|
2920
|
+
const s = t + o * 2, a = lt[n[s]], u = lt[n[s + 1]];
|
|
2853
2921
|
i[e + o++] = a << 4 | u;
|
|
2854
2922
|
}
|
|
2855
2923
|
return i;
|
|
2856
2924
|
}
|
|
2857
|
-
var
|
|
2925
|
+
var mn = class extends Uint8Array {
|
|
2858
2926
|
constructor(n) {
|
|
2859
|
-
super(n),
|
|
2927
|
+
super(n), gn(this, "i", 0), gn(this, "v"), this.v = new DataView(n);
|
|
2860
2928
|
}
|
|
2861
|
-
},
|
|
2929
|
+
}, ne = (n) => (e) => n(e instanceof mn ? e : new mn(e instanceof Uint8Array ? e.buffer : typeof e == "string" ? Os(e).buffer : e)), et = (n) => {
|
|
2862
2930
|
const e = n.length;
|
|
2863
2931
|
let t = 0;
|
|
2864
2932
|
for (let i = 0; i < e; i++)
|
|
@@ -2870,7 +2938,7 @@ var hn = class extends Uint8Array {
|
|
|
2870
2938
|
}
|
|
2871
2939
|
return r;
|
|
2872
2940
|
};
|
|
2873
|
-
function
|
|
2941
|
+
function yn(n, e) {
|
|
2874
2942
|
const t = Object.keys(n), r = t.length, i = {};
|
|
2875
2943
|
for (let o = 0; o < r; o++) {
|
|
2876
2944
|
const s = t[o];
|
|
@@ -2878,120 +2946,120 @@ function gn(n, e) {
|
|
|
2878
2946
|
}
|
|
2879
2947
|
return i;
|
|
2880
2948
|
}
|
|
2881
|
-
var
|
|
2949
|
+
var D = (n, e) => {
|
|
2882
2950
|
const t = [n, e];
|
|
2883
2951
|
return t.enc = n, t.dec = e, t;
|
|
2884
|
-
},
|
|
2885
|
-
function
|
|
2886
|
-
return
|
|
2952
|
+
}, fr = (n, e) => (t) => n(e(t)), dr = (n, e) => (t) => e(n(t)), Es = ([n, e], t, r) => D(fr(n, t), dr(e, r));
|
|
2953
|
+
function Ts(n, e) {
|
|
2954
|
+
return ne((t) => {
|
|
2887
2955
|
const r = t.v[e](t.i, !0);
|
|
2888
2956
|
return t.i += n, r;
|
|
2889
2957
|
});
|
|
2890
2958
|
}
|
|
2891
|
-
function
|
|
2959
|
+
function Cs(n, e) {
|
|
2892
2960
|
return (t) => {
|
|
2893
2961
|
const r = new Uint8Array(n);
|
|
2894
2962
|
return new DataView(r.buffer)[e](0, t, !0), r;
|
|
2895
2963
|
};
|
|
2896
2964
|
}
|
|
2897
|
-
function
|
|
2898
|
-
return
|
|
2965
|
+
function G(n, e, t) {
|
|
2966
|
+
return D(Cs(n, t), Ts(n, e));
|
|
2899
2967
|
}
|
|
2900
|
-
var
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
var
|
|
2968
|
+
var de = G(1, "getUint8", "setUint8"), ze = G(2, "getUint16", "setUint16"), Le = G(4, "getUint32", "setUint32"), pr = G(8, "getBigUint64", "setBigUint64");
|
|
2969
|
+
G(1, "getInt8", "setInt8");
|
|
2970
|
+
G(2, "getInt16", "setInt16");
|
|
2971
|
+
G(4, "getInt32", "setInt32");
|
|
2972
|
+
G(8, "getBigInt64", "setBigInt64");
|
|
2973
|
+
var hr = (n) => {
|
|
2906
2974
|
const e = new Uint8Array(16), t = new DataView(e.buffer);
|
|
2907
2975
|
return t.setBigInt64(0, n, !0), t.setBigInt64(8, n >> 64n, !0), e;
|
|
2908
|
-
},
|
|
2976
|
+
}, gr = (n) => ne((e) => {
|
|
2909
2977
|
const { v: t, i: r } = e, i = t.getBigUint64(r, !0), o = t[n](r + 8, !0);
|
|
2910
2978
|
return e.i += 16, o << 64n | i;
|
|
2911
2979
|
});
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
var
|
|
2980
|
+
D(hr, gr("getBigUint64"));
|
|
2981
|
+
D(hr, gr("getBigInt64"));
|
|
2982
|
+
var mr = (n) => {
|
|
2915
2983
|
const e = new Uint8Array(32), t = new DataView(e.buffer);
|
|
2916
2984
|
return t.setBigInt64(0, n, !0), t.setBigInt64(8, n >> 64n, !0), t.setBigInt64(16, n >> 128n, !0), t.setBigInt64(24, n >> 192n, !0), e;
|
|
2917
|
-
},
|
|
2985
|
+
}, yr = (n) => ne((e) => {
|
|
2918
2986
|
let t = e.v.getBigUint64(e.i, !0);
|
|
2919
2987
|
return e.i += 8, t |= e.v.getBigUint64(e.i, !0) << 64n, e.i += 8, t |= e.v.getBigUint64(e.i, !0) << 128n, e.i += 8, t |= e.v[n](e.i, !0) << 192n, e.i += 8, t;
|
|
2920
2988
|
});
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
var
|
|
2989
|
+
D(mr, yr("getBigUint64"));
|
|
2990
|
+
D(mr, yr("getBigInt64"));
|
|
2991
|
+
var vr = Es(de, (n) => n ? 1 : 0, Boolean), Ls = [de[1], ze[1], Le[1]], Ps = ne((n) => {
|
|
2924
2992
|
const e = n[n.i], t = e & 3;
|
|
2925
2993
|
if (t < 3)
|
|
2926
|
-
return
|
|
2994
|
+
return Ls[t](n) >>> 2;
|
|
2927
2995
|
const r = (e >>> 2) + 4;
|
|
2928
2996
|
n.i++;
|
|
2929
2997
|
let i = 0n;
|
|
2930
2998
|
const o = r / 8 | 0;
|
|
2931
2999
|
let s = 0n;
|
|
2932
3000
|
for (let u = 0; u < o; u++)
|
|
2933
|
-
i =
|
|
3001
|
+
i = pr[1](n) << s | i, s += 64n;
|
|
2934
3002
|
let a = r % 8;
|
|
2935
|
-
return a > 3 && (i = BigInt(
|
|
2936
|
-
}),
|
|
3003
|
+
return a > 3 && (i = BigInt(Le[1](n)) << s | i, s += 32n, a -= 4), a > 1 && (i = BigInt(ze[1](n)) << s | i, s += 16n, a -= 2), a && (i = BigInt(de[1](n)) << s | i), i;
|
|
3004
|
+
}), ks = 1n << 56n, Is = 1 << 24, Rs = 256, As = 4294967295n, $s = 64, Ns = 16384, js = 1 << 30, Ds = (n) => {
|
|
2937
3005
|
if (n < 0)
|
|
2938
3006
|
throw new Error(`Wrong compact input (${n})`);
|
|
2939
3007
|
const e = Number(n) << 2;
|
|
2940
|
-
if (n <
|
|
2941
|
-
return
|
|
2942
|
-
if (n <
|
|
2943
|
-
return
|
|
2944
|
-
if (n <
|
|
2945
|
-
return
|
|
3008
|
+
if (n < $s)
|
|
3009
|
+
return de[0](e);
|
|
3010
|
+
if (n < Ns)
|
|
3011
|
+
return ze[0](e | 1);
|
|
3012
|
+
if (n < js)
|
|
3013
|
+
return Le[0](e | 2);
|
|
2946
3014
|
let t = [new Uint8Array(1)], r = BigInt(n);
|
|
2947
|
-
for (; r >=
|
|
2948
|
-
t.push(
|
|
2949
|
-
r >=
|
|
3015
|
+
for (; r >= ks; )
|
|
3016
|
+
t.push(pr[0](r)), r >>= 64n;
|
|
3017
|
+
r >= Is && (t.push(Le[0](Number(r & As))), r >>= 32n);
|
|
2950
3018
|
let i = Number(r);
|
|
2951
|
-
i >=
|
|
2952
|
-
const o =
|
|
3019
|
+
i >= Rs && (t.push(ze[0](i)), i >>= 16), i && t.push(de[0](i));
|
|
3020
|
+
const o = et(t);
|
|
2953
3021
|
return o[0] = o.length - 5 << 2 | 3, o;
|
|
2954
|
-
},
|
|
2955
|
-
const e =
|
|
2956
|
-
return
|
|
2957
|
-
},
|
|
2958
|
-
let e =
|
|
3022
|
+
}, wr = D(Ds, Ps), Us = new TextEncoder(), Fs = (n) => {
|
|
3023
|
+
const e = Us.encode(n);
|
|
3024
|
+
return et([wr.enc(e.length), e]);
|
|
3025
|
+
}, _s = new TextDecoder(), Ms = ne((n) => {
|
|
3026
|
+
let e = wr.dec(n);
|
|
2959
3027
|
const t = new DataView(n.buffer, n.i, e);
|
|
2960
|
-
return n.i += e,
|
|
2961
|
-
}), M =
|
|
2962
|
-
},
|
|
2963
|
-
|
|
2964
|
-
var
|
|
2965
|
-
const t =
|
|
3028
|
+
return n.i += e, _s.decode(t);
|
|
3029
|
+
}), M = D(Fs, Ms), Hs = () => {
|
|
3030
|
+
}, Vs = new Uint8Array(0);
|
|
3031
|
+
D(() => Vs, Hs);
|
|
3032
|
+
var br = (n) => ne((e) => {
|
|
3033
|
+
const t = de.dec(e);
|
|
2966
3034
|
if (t !== 0)
|
|
2967
|
-
return n ===
|
|
2968
|
-
}),
|
|
3035
|
+
return n === vr[1] ? t === 1 : n(e);
|
|
3036
|
+
}), Sr = (n) => (e) => {
|
|
2969
3037
|
const t = new Uint8Array(1);
|
|
2970
|
-
return e === void 0 ? (t[0] = 0, t) : (t[0] = 1, n ===
|
|
2971
|
-
}, H = (n) =>
|
|
2972
|
-
H.enc =
|
|
2973
|
-
H.dec =
|
|
2974
|
-
var
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
var
|
|
3038
|
+
return e === void 0 ? (t[0] = 0, t) : (t[0] = 1, n === vr[0] ? (t[0] = e ? 1 : 2, t) : et([t, n(e)]));
|
|
3039
|
+
}, H = (n) => D(Sr(n[0]), br(n[1]));
|
|
3040
|
+
H.enc = Sr;
|
|
3041
|
+
H.dec = br;
|
|
3042
|
+
var xr = (...n) => ne((e) => n.map((t) => t(e))), Or = (...n) => (e) => et(n.map((t, r) => t(e[r]))), tt = (...n) => D(Or(...n.map(([e]) => e)), xr(...n.map(([, e]) => e)));
|
|
3043
|
+
tt.enc = Or;
|
|
3044
|
+
tt.dec = xr;
|
|
3045
|
+
var Er = (n) => {
|
|
2978
3046
|
const e = Object.keys(n);
|
|
2979
|
-
return
|
|
2980
|
-
},
|
|
3047
|
+
return fr(tt.enc(...Object.values(n)), (t) => e.map((r) => t[r]));
|
|
3048
|
+
}, Tr = (n) => {
|
|
2981
3049
|
const e = Object.keys(n);
|
|
2982
|
-
return
|
|
2983
|
-
},
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
const
|
|
3050
|
+
return dr(tt.dec(...Object.values(n)), (t) => Object.fromEntries(t.map((r, i) => [e[i], r])));
|
|
3051
|
+
}, ue = (n) => D(Er(yn(n, (e) => e[0])), Tr(yn(n, (e) => e[1])));
|
|
3052
|
+
ue.enc = Er;
|
|
3053
|
+
ue.dec = Tr;
|
|
3054
|
+
const Bs = y({
|
|
2987
3055
|
[h.requestHash]: p()
|
|
2988
3056
|
});
|
|
2989
3057
|
y({
|
|
2990
3058
|
[h.challenge]: p()
|
|
2991
3059
|
});
|
|
2992
|
-
const
|
|
3060
|
+
const Ks = y({
|
|
2993
3061
|
[h.timestamp]: p()
|
|
2994
|
-
}),
|
|
3062
|
+
}), vn = y({
|
|
2995
3063
|
[h.challenge]: p().optional(),
|
|
2996
3064
|
[h.requestHash]: p().optional(),
|
|
2997
3065
|
[h.timestamp]: p().optional()
|
|
@@ -3002,35 +3070,35 @@ y({
|
|
|
3002
3070
|
[h.dapp]: p(),
|
|
3003
3071
|
[h.user]: p(),
|
|
3004
3072
|
[h.challenge]: p().optional(),
|
|
3005
|
-
[h.nonce]:
|
|
3073
|
+
[h.nonce]: w().optional(),
|
|
3006
3074
|
[h.timestamp]: p(),
|
|
3007
3075
|
[h.signature]: y({
|
|
3008
|
-
[h.provider]:
|
|
3009
|
-
[h.user]:
|
|
3076
|
+
[h.provider]: vn,
|
|
3077
|
+
[h.user]: vn
|
|
3010
3078
|
})
|
|
3011
3079
|
});
|
|
3012
|
-
const
|
|
3080
|
+
const qs = ue({
|
|
3013
3081
|
[h.commitmentId]: H(M),
|
|
3014
3082
|
[h.providerUrl]: H(M),
|
|
3015
3083
|
[h.dapp]: M,
|
|
3016
3084
|
[h.user]: M,
|
|
3017
3085
|
[h.challenge]: H(M),
|
|
3018
|
-
[h.nonce]: H(
|
|
3086
|
+
[h.nonce]: H(Le),
|
|
3019
3087
|
[h.timestamp]: M,
|
|
3020
|
-
[h.signature]:
|
|
3021
|
-
[h.provider]:
|
|
3088
|
+
[h.signature]: ue({
|
|
3089
|
+
[h.provider]: ue({
|
|
3022
3090
|
[h.challenge]: H(M),
|
|
3023
3091
|
[h.requestHash]: H(M)
|
|
3024
3092
|
}),
|
|
3025
|
-
[h.user]:
|
|
3093
|
+
[h.user]: ue({
|
|
3026
3094
|
[h.timestamp]: H(M),
|
|
3027
3095
|
[h.requestHash]: H(M)
|
|
3028
3096
|
})
|
|
3029
3097
|
})
|
|
3030
|
-
}),
|
|
3098
|
+
}), Cr = p().startsWith("0x"), Ua = (n) => {
|
|
3031
3099
|
var e, t, r, i;
|
|
3032
|
-
return
|
|
3033
|
-
|
|
3100
|
+
return Ze(
|
|
3101
|
+
qs.enc({
|
|
3034
3102
|
[h.commitmentId]: void 0,
|
|
3035
3103
|
[h.providerUrl]: void 0,
|
|
3036
3104
|
[h.challenge]: void 0,
|
|
@@ -3049,9 +3117,19 @@ const Ps = se({
|
|
|
3049
3117
|
}
|
|
3050
3118
|
})
|
|
3051
3119
|
);
|
|
3052
|
-
},
|
|
3053
|
-
var
|
|
3054
|
-
|
|
3120
|
+
}, Lr = 2, Pr = 0;
|
|
3121
|
+
var zs = /* @__PURE__ */ ((n) => (n.GetImageCaptchaChallenge = "/v1/prosopo/provider/client/captcha/image", n.GetPowCaptchaChallenge = "/v1/prosopo/provider/client/captcha/pow", n.GetFrictionlessCaptchaChallenge = "/v1/prosopo/provider/client/captcha/frictionless", n.SubmitImageCaptchaSolution = "/v1/prosopo/provider/client/solution", n.SubmitPowCaptchaSolution = "/v1/prosopo/provider/client/pow/solution", n.VerifyPowCaptchaSolution = "/v1/prosopo/provider/client/pow/verify", n.VerifyImageCaptchaSolutionDapp = "/v1/prosopo/provider/client/image/dapp/verify", n.GetProviderStatus = "/v1/prosopo/provider/client/status", n.SubmitUserEvents = "/v1/prosopo/provider/client/events", n))(zs || {}), Ws = /* @__PURE__ */ ((n) => (n.Healthz = "/healthz", n.GetProviderDetails = "/v1/prosopo/provider/public/details", n))(Ws || {});
|
|
3122
|
+
y({
|
|
3123
|
+
version: p(),
|
|
3124
|
+
message: p(),
|
|
3125
|
+
redis: y({
|
|
3126
|
+
actor: p(),
|
|
3127
|
+
isReady: ce(),
|
|
3128
|
+
awaitingTimeSeconds: w()
|
|
3129
|
+
}).array()
|
|
3130
|
+
});
|
|
3131
|
+
var Js = /* @__PURE__ */ ((n) => (n.SiteKeyRegister = "/v1/prosopo/provider/admin/sitekey/register", n.UpdateDetectorKey = "/v1/prosopo/provider/admin/detector/update", n.RemoveDetectorKey = "/v1/prosopo/provider/admin/detector/remove", n))(Js || {});
|
|
3132
|
+
const kr = {
|
|
3055
3133
|
"/v1/prosopo/provider/client/captcha/image": { windowMs: 6e4, limit: 30 },
|
|
3056
3134
|
"/v1/prosopo/provider/client/captcha/pow": { windowMs: 6e4, limit: 60 },
|
|
3057
3135
|
"/v1/prosopo/provider/client/solution": { windowMs: 6e4, limit: 60 },
|
|
@@ -3071,47 +3149,47 @@ const Cr = {
|
|
|
3071
3149
|
"/v1/prosopo/provider/admin/sitekey/register": { windowMs: 6e4, limit: 5 },
|
|
3072
3150
|
"/v1/prosopo/provider/admin/detector/update": { windowMs: 6e4, limit: 5 },
|
|
3073
3151
|
"/v1/prosopo/provider/admin/detector/remove": { windowMs: 6e4, limit: 5 }
|
|
3074
|
-
},
|
|
3152
|
+
}, Xs = (n) => y(
|
|
3075
3153
|
Object.entries(n).reduce(
|
|
3076
3154
|
(e, [t, r]) => {
|
|
3077
3155
|
const i = t;
|
|
3078
3156
|
return e[i] = y({
|
|
3079
|
-
windowMs:
|
|
3080
|
-
limit:
|
|
3157
|
+
windowMs: Dt.number().optional().default(r.windowMs),
|
|
3158
|
+
limit: Dt.number().optional().default(r.limit)
|
|
3081
3159
|
}), e;
|
|
3082
3160
|
},
|
|
3083
3161
|
{}
|
|
3084
3162
|
)
|
|
3085
|
-
),
|
|
3086
|
-
|
|
3163
|
+
), Ys = Xs(
|
|
3164
|
+
kr
|
|
3087
3165
|
);
|
|
3088
3166
|
y({
|
|
3089
3167
|
[h.user]: p(),
|
|
3090
3168
|
[h.dapp]: p(),
|
|
3091
|
-
[h.datasetId]:
|
|
3169
|
+
[h.datasetId]: _e([p(), q(w())]),
|
|
3092
3170
|
[h.sessionId]: p().optional()
|
|
3093
3171
|
});
|
|
3094
3172
|
y({
|
|
3095
3173
|
[h.user]: p(),
|
|
3096
3174
|
[h.dapp]: p(),
|
|
3097
|
-
[h.captchas]:
|
|
3175
|
+
[h.captchas]: q(lr),
|
|
3098
3176
|
[h.requestHash]: p(),
|
|
3099
3177
|
[h.timestamp]: p(),
|
|
3100
3178
|
[h.signature]: y({
|
|
3101
|
-
[h.user]:
|
|
3102
|
-
[h.provider]:
|
|
3179
|
+
[h.user]: Ks,
|
|
3180
|
+
[h.provider]: Bs
|
|
3103
3181
|
})
|
|
3104
3182
|
});
|
|
3105
3183
|
y({
|
|
3106
|
-
[h.token]:
|
|
3184
|
+
[h.token]: Cr,
|
|
3107
3185
|
[h.dappSignature]: p(),
|
|
3108
|
-
[h.maxVerifiedTime]:
|
|
3186
|
+
[h.maxVerifiedTime]: w().optional().default(Lt),
|
|
3109
3187
|
[h.ip]: p().optional()
|
|
3110
3188
|
});
|
|
3111
3189
|
y({
|
|
3112
|
-
[h.token]:
|
|
3190
|
+
[h.token]: Cr,
|
|
3113
3191
|
[h.dappSignature]: p(),
|
|
3114
|
-
[h.verifiedTimeout]:
|
|
3192
|
+
[h.verifiedTimeout]: w().optional().default(Qe),
|
|
3115
3193
|
[h.ip]: p().optional()
|
|
3116
3194
|
});
|
|
3117
3195
|
y({
|
|
@@ -3119,9 +3197,9 @@ y({
|
|
|
3119
3197
|
[h.dapp]: p(),
|
|
3120
3198
|
[h.sessionId]: p().optional()
|
|
3121
3199
|
});
|
|
3122
|
-
const
|
|
3123
|
-
[h.challenge]:
|
|
3124
|
-
[h.difficulty]:
|
|
3200
|
+
const Fa = y({
|
|
3201
|
+
[h.challenge]: fs,
|
|
3202
|
+
[h.difficulty]: w(),
|
|
3125
3203
|
[h.signature]: y({
|
|
3126
3204
|
[h.user]: y({
|
|
3127
3205
|
[h.timestamp]: p()
|
|
@@ -3132,8 +3210,8 @@ const xa = y({
|
|
|
3132
3210
|
}),
|
|
3133
3211
|
[h.user]: p(),
|
|
3134
3212
|
[h.dapp]: p(),
|
|
3135
|
-
[h.nonce]:
|
|
3136
|
-
[h.verifiedTimeout]:
|
|
3213
|
+
[h.nonce]: w(),
|
|
3214
|
+
[h.verifiedTimeout]: w().optional().default(Qe)
|
|
3137
3215
|
});
|
|
3138
3216
|
y({
|
|
3139
3217
|
[h.dapp]: p(),
|
|
@@ -3145,35 +3223,39 @@ y({
|
|
|
3145
3223
|
});
|
|
3146
3224
|
y({
|
|
3147
3225
|
[h.siteKey]: p(),
|
|
3148
|
-
[h.tier]:
|
|
3149
|
-
[h.settings]:
|
|
3226
|
+
[h.tier]: ke(St),
|
|
3227
|
+
[h.settings]: Ti.optional()
|
|
3150
3228
|
});
|
|
3151
|
-
const
|
|
3229
|
+
const _a = y({
|
|
3152
3230
|
[h.detectorKey]: p()
|
|
3153
|
-
}),
|
|
3231
|
+
}), Ma = y({
|
|
3232
|
+
[h.detectorKey]: p(),
|
|
3233
|
+
[h.expirationInSeconds]: w().positive().optional()
|
|
3234
|
+
}), Ir = y({
|
|
3154
3235
|
solved: y({
|
|
3155
|
-
count:
|
|
3156
|
-
}).optional().default({ count:
|
|
3236
|
+
count: w().positive()
|
|
3237
|
+
}).optional().default({ count: Lr }),
|
|
3157
3238
|
unsolved: y({
|
|
3158
|
-
count:
|
|
3159
|
-
}).optional().default({ count:
|
|
3239
|
+
count: w().nonnegative()
|
|
3240
|
+
}).optional().default({ count: Pr })
|
|
3160
3241
|
});
|
|
3161
|
-
var
|
|
3162
|
-
const
|
|
3242
|
+
var Rr = /* @__PURE__ */ ((n) => (n.ipAddress = "ipAddress", n.userAccount = "userAccount", n))(Rr || {});
|
|
3243
|
+
const Gs = ke(Rr);
|
|
3163
3244
|
y({
|
|
3164
|
-
global:
|
|
3165
|
-
hardBlock:
|
|
3166
|
-
type:
|
|
3245
|
+
global: ce(),
|
|
3246
|
+
hardBlock: ce(),
|
|
3247
|
+
type: Gs,
|
|
3167
3248
|
dappAccount: p().optional(),
|
|
3168
|
-
captchaConfig:
|
|
3249
|
+
captchaConfig: Ir.optional()
|
|
3169
3250
|
});
|
|
3170
3251
|
y({
|
|
3171
3252
|
[h.dapp]: p()
|
|
3172
3253
|
});
|
|
3173
|
-
const
|
|
3174
|
-
PENALTY_OLD_TIMESTAMP:
|
|
3175
|
-
PENALTY_ACCESS_RULE:
|
|
3176
|
-
|
|
3254
|
+
const Ar = 0.2, $r = 0.5, Nr = 0.2, Qs = y({
|
|
3255
|
+
PENALTY_OLD_TIMESTAMP: w().positive().optional().default(Ar),
|
|
3256
|
+
PENALTY_ACCESS_RULE: w().positive().optional().default($r),
|
|
3257
|
+
PENALTY_UNVERIFIED_HOST: w().positive().optional().default(Nr)
|
|
3258
|
+
}), wn = Je([
|
|
3177
3259
|
"trace",
|
|
3178
3260
|
"debug",
|
|
3179
3261
|
"info",
|
|
@@ -3182,29 +3264,29 @@ const As = y({
|
|
|
3182
3264
|
"fatal",
|
|
3183
3265
|
"log"
|
|
3184
3266
|
]);
|
|
3185
|
-
|
|
3267
|
+
Je([
|
|
3186
3268
|
"mongo",
|
|
3187
3269
|
"mongoMemory",
|
|
3188
3270
|
"provider",
|
|
3189
3271
|
"client",
|
|
3190
3272
|
"captcha"
|
|
3191
3273
|
]);
|
|
3192
|
-
const
|
|
3274
|
+
const bt = Je([
|
|
3193
3275
|
"development",
|
|
3194
3276
|
"staging",
|
|
3195
3277
|
"production"
|
|
3196
|
-
]),
|
|
3197
|
-
|
|
3278
|
+
]), Zs = On(
|
|
3279
|
+
bt,
|
|
3198
3280
|
y({
|
|
3199
3281
|
type: p(),
|
|
3200
3282
|
endpoint: p(),
|
|
3201
3283
|
dbname: p().default("prosopo"),
|
|
3202
3284
|
authSource: p().default("admin")
|
|
3203
3285
|
})
|
|
3204
|
-
),
|
|
3205
|
-
logLevel:
|
|
3206
|
-
defaultEnvironment:
|
|
3207
|
-
|
|
3286
|
+
), ea = y({
|
|
3287
|
+
logLevel: wn.optional().default(wn.enum.info),
|
|
3288
|
+
defaultEnvironment: bt.default(
|
|
3289
|
+
bt.Values.production
|
|
3208
3290
|
),
|
|
3209
3291
|
// The account with which to query the contract.merge sign transactions
|
|
3210
3292
|
account: y({
|
|
@@ -3213,117 +3295,128 @@ const vt = ze([
|
|
|
3213
3295
|
password: p().optional()
|
|
3214
3296
|
})
|
|
3215
3297
|
});
|
|
3216
|
-
|
|
3217
|
-
encoded:
|
|
3218
|
-
encoding:
|
|
3219
|
-
content:
|
|
3220
|
-
type:
|
|
3221
|
-
version:
|
|
3298
|
+
C.object({
|
|
3299
|
+
encoded: C.string(),
|
|
3300
|
+
encoding: C.object({
|
|
3301
|
+
content: C.array(C.string()),
|
|
3302
|
+
type: C.array(C.string()),
|
|
3303
|
+
version: C.string()
|
|
3222
3304
|
}),
|
|
3223
|
-
address:
|
|
3224
|
-
meta:
|
|
3225
|
-
genesisHash:
|
|
3226
|
-
name:
|
|
3227
|
-
whenCreated:
|
|
3305
|
+
address: C.string(),
|
|
3306
|
+
meta: C.object({
|
|
3307
|
+
genesisHash: C.string(),
|
|
3308
|
+
name: C.string(),
|
|
3309
|
+
whenCreated: C.number()
|
|
3228
3310
|
})
|
|
3229
3311
|
});
|
|
3230
|
-
const
|
|
3312
|
+
const jr = ea.merge(
|
|
3231
3313
|
y({
|
|
3232
|
-
database:
|
|
3233
|
-
devOnlyWatchEvents:
|
|
3314
|
+
database: Zs.optional(),
|
|
3315
|
+
devOnlyWatchEvents: ce().optional()
|
|
3234
3316
|
})
|
|
3235
|
-
),
|
|
3317
|
+
), ta = y({
|
|
3236
3318
|
baseURL: p().url(),
|
|
3237
|
-
port:
|
|
3319
|
+
port: w().optional().default(9229)
|
|
3320
|
+
}).default({
|
|
3321
|
+
baseURL: "http://localhost",
|
|
3322
|
+
port: 9229
|
|
3238
3323
|
});
|
|
3239
3324
|
y({
|
|
3240
|
-
requiredNumberOfSolutions:
|
|
3241
|
-
solutionWinningPercentage:
|
|
3242
|
-
captchaBlockRecency:
|
|
3325
|
+
requiredNumberOfSolutions: w().positive().min(2),
|
|
3326
|
+
solutionWinningPercentage: w().positive().max(100),
|
|
3327
|
+
captchaBlockRecency: w().positive().min(2)
|
|
3243
3328
|
});
|
|
3244
|
-
const
|
|
3329
|
+
const Dr = jr.merge(
|
|
3245
3330
|
y({
|
|
3246
3331
|
userAccountAddress: p().optional(),
|
|
3247
|
-
web2:
|
|
3248
|
-
solutionThreshold:
|
|
3332
|
+
web2: ce().optional().default(!0),
|
|
3333
|
+
solutionThreshold: w().positive().max(100).optional().default(80),
|
|
3249
3334
|
dappName: p().optional().default("ProsopoClientDapp"),
|
|
3250
3335
|
serverUrl: p().optional()
|
|
3251
3336
|
})
|
|
3252
|
-
),
|
|
3253
|
-
challengeTimeout:
|
|
3254
|
-
solutionTimeout:
|
|
3255
|
-
verifiedTimeout:
|
|
3256
|
-
cachedTimeout:
|
|
3257
|
-
},
|
|
3258
|
-
challengeTimeout:
|
|
3337
|
+
), Ur = {
|
|
3338
|
+
challengeTimeout: Re,
|
|
3339
|
+
solutionTimeout: er,
|
|
3340
|
+
verifiedTimeout: tr,
|
|
3341
|
+
cachedTimeout: Lt
|
|
3342
|
+
}, Fr = {
|
|
3343
|
+
challengeTimeout: Qe,
|
|
3259
3344
|
solutionTimeout: Ge,
|
|
3260
|
-
cachedTimeout:
|
|
3261
|
-
},
|
|
3262
|
-
maxVerifiedTime:
|
|
3263
|
-
},
|
|
3264
|
-
image:
|
|
3265
|
-
pow:
|
|
3266
|
-
contract:
|
|
3267
|
-
},
|
|
3345
|
+
cachedTimeout: nr
|
|
3346
|
+
}, _r = {
|
|
3347
|
+
maxVerifiedTime: rr
|
|
3348
|
+
}, Pt = {
|
|
3349
|
+
image: Ur,
|
|
3350
|
+
pow: Fr,
|
|
3351
|
+
contract: _r
|
|
3352
|
+
}, Mr = y({
|
|
3268
3353
|
image: y({
|
|
3269
3354
|
// Set this to a default value for the frontend
|
|
3270
|
-
challengeTimeout:
|
|
3355
|
+
challengeTimeout: w().positive().optional().default(Re),
|
|
3271
3356
|
// Set this to a default value for the frontend
|
|
3272
|
-
solutionTimeout:
|
|
3273
|
-
verifiedTimeout:
|
|
3274
|
-
cachedTimeout:
|
|
3275
|
-
}).default(
|
|
3357
|
+
solutionTimeout: w().positive().optional().default(er),
|
|
3358
|
+
verifiedTimeout: w().positive().optional().default(tr),
|
|
3359
|
+
cachedTimeout: w().positive().optional().default(Lt)
|
|
3360
|
+
}).default(Ur),
|
|
3276
3361
|
pow: y({
|
|
3277
|
-
verifiedTimeout:
|
|
3278
|
-
solutionTimeout:
|
|
3279
|
-
cachedTimeout:
|
|
3280
|
-
}).default(
|
|
3362
|
+
verifiedTimeout: w().positive().optional().default(Qe),
|
|
3363
|
+
solutionTimeout: w().positive().optional().default(Ge),
|
|
3364
|
+
cachedTimeout: w().positive().optional().default(nr)
|
|
3365
|
+
}).default(Fr),
|
|
3281
3366
|
contract: y({
|
|
3282
|
-
maxVerifiedTime:
|
|
3283
|
-
}).default(
|
|
3284
|
-
}).default(
|
|
3285
|
-
|
|
3367
|
+
maxVerifiedTime: w().positive().optional().default(rr)
|
|
3368
|
+
}).default(_r)
|
|
3369
|
+
}).default(Pt);
|
|
3370
|
+
Dr.merge(
|
|
3286
3371
|
y({
|
|
3287
3372
|
serverUrl: p().url().optional(),
|
|
3288
|
-
timeouts:
|
|
3373
|
+
timeouts: Mr.optional().default(Pt)
|
|
3289
3374
|
})
|
|
3290
3375
|
);
|
|
3291
3376
|
y({
|
|
3292
3377
|
area: y({
|
|
3293
|
-
width:
|
|
3294
|
-
height:
|
|
3378
|
+
width: w().positive(),
|
|
3379
|
+
height: w().positive()
|
|
3295
3380
|
}),
|
|
3296
|
-
offsetParameter:
|
|
3297
|
-
multiplier:
|
|
3298
|
-
fontSizeFactor:
|
|
3299
|
-
maxShadowBlur:
|
|
3300
|
-
numberOfRounds:
|
|
3301
|
-
seed:
|
|
3381
|
+
offsetParameter: w().positive(),
|
|
3382
|
+
multiplier: w().positive(),
|
|
3383
|
+
fontSizeFactor: w().positive(),
|
|
3384
|
+
maxShadowBlur: w().positive(),
|
|
3385
|
+
numberOfRounds: w().positive(),
|
|
3386
|
+
seed: w().positive()
|
|
3302
3387
|
});
|
|
3303
|
-
const
|
|
3304
|
-
var
|
|
3305
|
-
const
|
|
3388
|
+
const na = _e([Ut("light"), Ut("dark")]);
|
|
3389
|
+
var ra = /* @__PURE__ */ ((n) => (n.visible = "visible", n.invisible = "invisible", n))(ra || {});
|
|
3390
|
+
const ia = Je([
|
|
3306
3391
|
"visible",
|
|
3307
3392
|
"invisible"
|
|
3308
3393
|
/* invisible */
|
|
3309
|
-
]).optional(),
|
|
3394
|
+
]).optional(), Ha = Dr.and(
|
|
3310
3395
|
y({
|
|
3311
|
-
theme:
|
|
3312
|
-
captchas:
|
|
3313
|
-
language:
|
|
3314
|
-
mode:
|
|
3396
|
+
theme: na.optional().default("light"),
|
|
3397
|
+
captchas: Mr.optional().default(Pt),
|
|
3398
|
+
language: In.optional(),
|
|
3399
|
+
mode: ia.optional().default(
|
|
3315
3400
|
"visible"
|
|
3316
3401
|
/* visible */
|
|
3317
3402
|
)
|
|
3318
3403
|
})
|
|
3319
|
-
)
|
|
3320
|
-
|
|
3404
|
+
), oa = C.object({
|
|
3405
|
+
apiKey: C.string(),
|
|
3406
|
+
baseUrl: C.string().url()
|
|
3407
|
+
});
|
|
3408
|
+
jr.merge(
|
|
3321
3409
|
y({
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3410
|
+
host: p(),
|
|
3411
|
+
captchas: Ir.optional().default({
|
|
3412
|
+
solved: { count: Lr },
|
|
3413
|
+
unsolved: { count: Pr }
|
|
3414
|
+
}),
|
|
3415
|
+
penalties: Qs.optional().default({
|
|
3416
|
+
PENALTY_OLD_TIMESTAMP: Ar,
|
|
3417
|
+
PENALTY_ACCESS_RULE: $r,
|
|
3418
|
+
PENALTY_UNVERIFIED_HOST: Nr
|
|
3325
3419
|
}),
|
|
3326
|
-
penalties: As,
|
|
3327
3420
|
scheduledTasks: y({
|
|
3328
3421
|
captchaScheduler: y({
|
|
3329
3422
|
schedule: p().optional()
|
|
@@ -3332,17 +3425,22 @@ Pr.merge(
|
|
|
3332
3425
|
schedule: p().optional()
|
|
3333
3426
|
}).optional()
|
|
3334
3427
|
}).optional(),
|
|
3335
|
-
server:
|
|
3428
|
+
server: ta.optional(),
|
|
3336
3429
|
mongoEventsUri: p().optional(),
|
|
3337
3430
|
mongoCaptchaUri: p().optional(),
|
|
3338
3431
|
mongoClientUri: p().optional(),
|
|
3432
|
+
ipApi: oa,
|
|
3339
3433
|
redisConnection: y({
|
|
3340
3434
|
url: p(),
|
|
3341
|
-
password: p()
|
|
3435
|
+
password: p(),
|
|
3436
|
+
indexName: p().optional()
|
|
3437
|
+
}).default({
|
|
3438
|
+
url: "redis://localhost:6379",
|
|
3439
|
+
password: "root"
|
|
3342
3440
|
}),
|
|
3343
|
-
rateLimits:
|
|
3344
|
-
proxyCount:
|
|
3345
|
-
lRules:
|
|
3441
|
+
rateLimits: Ys.default(kr),
|
|
3442
|
+
proxyCount: w().optional().default(0),
|
|
3443
|
+
lRules: On(p(), w()).optional(),
|
|
3346
3444
|
authAccount: y({
|
|
3347
3445
|
address: p().optional(),
|
|
3348
3446
|
secret: p().optional(),
|
|
@@ -3350,7 +3448,7 @@ Pr.merge(
|
|
|
3350
3448
|
})
|
|
3351
3449
|
})
|
|
3352
3450
|
);
|
|
3353
|
-
const
|
|
3451
|
+
const sa = async () => (await import("./fp.esm-DYWeNGcH.js")).default, aa = async () => (await (await (await sa()).load()).get()).visitorId, se = new Uint8Array([161, 35, 3, 33, 0]), We = new Uint8Array([
|
|
3354
3452
|
48,
|
|
3355
3453
|
83,
|
|
3356
3454
|
2,
|
|
@@ -3367,40 +3465,40 @@ const Bs = async () => (await import("./fp.esm-DYWeNGcH.js")).default, Ks = asyn
|
|
|
3367
3465
|
34,
|
|
3368
3466
|
4,
|
|
3369
3467
|
32
|
|
3370
|
-
]),
|
|
3371
|
-
function
|
|
3372
|
-
const r = Array.isArray(t) || t === void 0 ? t : [t], i =
|
|
3373
|
-
if (!
|
|
3468
|
+
]), ua = 32, bn = 64, la = 32, Se = We.length;
|
|
3469
|
+
function ca(n, e, t) {
|
|
3470
|
+
const r = Array.isArray(t) || t === void 0 ? t : [t], i = Kr(e, n, r), o = i.subarray(0, We.length);
|
|
3471
|
+
if (!nt(o, We))
|
|
3374
3472
|
throw new Error("Invalid encoding header found in body");
|
|
3375
|
-
let s = i.subarray(
|
|
3376
|
-
if (!
|
|
3473
|
+
let s = i.subarray(Se, Se + bn), a = Se + bn, u = i.subarray(a, a + se.length);
|
|
3474
|
+
if (!nt(u, se) && (a = Se + la, s = i.subarray(Se, a), u = i.subarray(a, a + se.length), !nt(u, se)))
|
|
3377
3475
|
throw new Error("Invalid encoding divider found in body");
|
|
3378
|
-
const c = a +
|
|
3476
|
+
const c = a + se.length;
|
|
3379
3477
|
return {
|
|
3380
|
-
publicKey: i.subarray(c, c +
|
|
3478
|
+
publicKey: i.subarray(c, c + ua),
|
|
3381
3479
|
secretKey: s
|
|
3382
3480
|
};
|
|
3383
3481
|
}
|
|
3384
|
-
function
|
|
3482
|
+
function fa({ publicKey: n, secretKey: e }, t) {
|
|
3385
3483
|
if (!e)
|
|
3386
3484
|
throw new Error("Expected a valid secretKey to be passed to encode");
|
|
3387
|
-
const r =
|
|
3485
|
+
const r = ft(We, e, se, n);
|
|
3388
3486
|
if (!t)
|
|
3389
3487
|
return r;
|
|
3390
|
-
const { params: i, password: o, salt: s } =
|
|
3391
|
-
return
|
|
3488
|
+
const { params: i, password: o, salt: s } = qr(t), { encrypted: a, nonce: u } = zr(r, o.subarray(0, 32));
|
|
3489
|
+
return ft(Wr(s, i), u, a);
|
|
3392
3490
|
}
|
|
3393
|
-
function
|
|
3394
|
-
return
|
|
3395
|
-
|
|
3491
|
+
function da(n, { address: e, meta: t }, r, i) {
|
|
3492
|
+
return Cn(
|
|
3493
|
+
Jr(r, ["pkcs8", n], i),
|
|
3396
3494
|
{
|
|
3397
3495
|
address: e,
|
|
3398
3496
|
meta: t
|
|
3399
3497
|
}
|
|
3400
3498
|
);
|
|
3401
3499
|
}
|
|
3402
|
-
const
|
|
3403
|
-
sr25519:
|
|
3500
|
+
const pa = new Uint8Array([]), ha = {
|
|
3501
|
+
sr25519: Tn,
|
|
3404
3502
|
ed25519: () => {
|
|
3405
3503
|
throw new Error("Not Implemented");
|
|
3406
3504
|
},
|
|
@@ -3410,13 +3508,13 @@ const Gs = new Uint8Array([]), Ys = {
|
|
|
3410
3508
|
ethereum: () => {
|
|
3411
3509
|
throw new Error("Not Implemented");
|
|
3412
3510
|
}
|
|
3413
|
-
},
|
|
3511
|
+
}, ga = {
|
|
3414
3512
|
ecdsa: new Uint8Array([2]),
|
|
3415
3513
|
ed25519: new Uint8Array([0]),
|
|
3416
3514
|
ethereum: new Uint8Array([2]),
|
|
3417
3515
|
sr25519: new Uint8Array([1])
|
|
3418
|
-
},
|
|
3419
|
-
sr25519:
|
|
3516
|
+
}, ma = {
|
|
3517
|
+
sr25519: Zr,
|
|
3420
3518
|
ed25519: () => {
|
|
3421
3519
|
throw new Error("Not Implemented");
|
|
3422
3520
|
},
|
|
@@ -3426,7 +3524,7 @@ const Gs = new Uint8Array([]), Ys = {
|
|
|
3426
3524
|
ethereum: () => {
|
|
3427
3525
|
throw new Error("Not Implemented");
|
|
3428
3526
|
}
|
|
3429
|
-
},
|
|
3527
|
+
}, ct = {
|
|
3430
3528
|
sr25519: (n) => n,
|
|
3431
3529
|
ed25519: () => {
|
|
3432
3530
|
throw new Error("Not Implemented");
|
|
@@ -3438,20 +3536,20 @@ const Gs = new Uint8Array([]), Ys = {
|
|
|
3438
3536
|
throw new Error("Not Implemented");
|
|
3439
3537
|
}
|
|
3440
3538
|
};
|
|
3441
|
-
function
|
|
3442
|
-
return !n ||
|
|
3539
|
+
function xe(n) {
|
|
3540
|
+
return !n || si(n);
|
|
3443
3541
|
}
|
|
3444
|
-
function
|
|
3542
|
+
function ae({ toSS58: n, type: e }, { publicKey: t, secretKey: r }, i = {}, o = null, s) {
|
|
3445
3543
|
const a = (l, f) => {
|
|
3446
|
-
const d =
|
|
3544
|
+
const d = ca(l, f || o, s);
|
|
3447
3545
|
if (d.secretKey.length === 64)
|
|
3448
3546
|
t = d.publicKey, r = d.secretKey;
|
|
3449
3547
|
else {
|
|
3450
|
-
const g =
|
|
3548
|
+
const g = ha[e](d.secretKey);
|
|
3451
3549
|
t = g.publicKey, r = g.secretKey;
|
|
3452
3550
|
}
|
|
3453
|
-
}, u = (l) => (
|
|
3454
|
-
const l =
|
|
3551
|
+
}, u = (l) => (xe(r) && o && a(l, o), o = fa({ publicKey: t, secretKey: r }, l), s = void 0, o), c = () => {
|
|
3552
|
+
const l = ct[e](t);
|
|
3455
3553
|
return n(l);
|
|
3456
3554
|
};
|
|
3457
3555
|
return {
|
|
@@ -3459,10 +3557,10 @@ function oe({ toSS58: n, type: e }, { publicKey: t, secretKey: r }, i = {}, o =
|
|
|
3459
3557
|
return c();
|
|
3460
3558
|
},
|
|
3461
3559
|
get addressRaw() {
|
|
3462
|
-
return
|
|
3560
|
+
return ct[e](t);
|
|
3463
3561
|
},
|
|
3464
3562
|
get isLocked() {
|
|
3465
|
-
return
|
|
3563
|
+
return xe(r);
|
|
3466
3564
|
},
|
|
3467
3565
|
get meta() {
|
|
3468
3566
|
return i;
|
|
@@ -3476,29 +3574,29 @@ function oe({ toSS58: n, type: e }, { publicKey: t, secretKey: r }, i = {}, o =
|
|
|
3476
3574
|
// eslint-disable-next-line sort-keys
|
|
3477
3575
|
decodePkcs8: a,
|
|
3478
3576
|
derive: (l, f) => {
|
|
3479
|
-
if (
|
|
3577
|
+
if (xe(r))
|
|
3480
3578
|
throw new Error("Cannot derive on a locked keypair");
|
|
3481
|
-
const { path: d } =
|
|
3482
|
-
return
|
|
3579
|
+
const { path: d } = ei(l), g = En({ publicKey: t, secretKey: r }, d, e);
|
|
3580
|
+
return ae({ toSS58: n, type: e }, g, f, null);
|
|
3483
3581
|
},
|
|
3484
3582
|
encodePkcs8: (l) => u(l),
|
|
3485
3583
|
lock: () => {
|
|
3486
3584
|
r = new Uint8Array([]);
|
|
3487
3585
|
},
|
|
3488
3586
|
setMeta: (l) => {
|
|
3489
|
-
i =
|
|
3587
|
+
i = Cn({}, i, l);
|
|
3490
3588
|
},
|
|
3491
3589
|
sign: (l, f = {}) => {
|
|
3492
|
-
if (
|
|
3590
|
+
if (xe(r))
|
|
3493
3591
|
throw new Error("Cannot sign with a locked key pair");
|
|
3494
|
-
return
|
|
3495
|
-
f.withType ?
|
|
3496
|
-
|
|
3592
|
+
return ft(
|
|
3593
|
+
f.withType ? ga[e] : pa,
|
|
3594
|
+
ma[e](dt(l), { publicKey: t, secretKey: r })
|
|
3497
3595
|
);
|
|
3498
3596
|
},
|
|
3499
3597
|
toJson: (l) => {
|
|
3500
|
-
const f = ["ecdsa", "ethereum"].includes(e) ? t.length === 20 ?
|
|
3501
|
-
return
|
|
3598
|
+
const f = ["ecdsa", "ethereum"].includes(e) ? t.length === 20 ? Ft(t) : Ft(Qr(t)) : c();
|
|
3599
|
+
return da(
|
|
3502
3600
|
e,
|
|
3503
3601
|
{ address: f, meta: i },
|
|
3504
3602
|
u(l),
|
|
@@ -3508,45 +3606,45 @@ function oe({ toSS58: n, type: e }, { publicKey: t, secretKey: r }, i = {}, o =
|
|
|
3508
3606
|
unlock: (l) => {
|
|
3509
3607
|
a(l);
|
|
3510
3608
|
},
|
|
3511
|
-
verify: (l, f, d) =>
|
|
3609
|
+
verify: (l, f, d) => Gr(
|
|
3512
3610
|
l,
|
|
3513
3611
|
f,
|
|
3514
|
-
|
|
3612
|
+
ct[e](dt(d))
|
|
3515
3613
|
).isValid,
|
|
3516
3614
|
vrfSign: (l, f, d) => {
|
|
3517
|
-
if (
|
|
3615
|
+
if (xe(r))
|
|
3518
3616
|
throw new Error("Cannot sign with a locked key pair");
|
|
3519
|
-
return
|
|
3617
|
+
return Yr(l, { secretKey: r }, f, d);
|
|
3520
3618
|
},
|
|
3521
|
-
vrfVerify: (l, f, d, g, m) =>
|
|
3619
|
+
vrfVerify: (l, f, d, g, m) => Xr(l, f, t, g, m)
|
|
3522
3620
|
};
|
|
3523
3621
|
}
|
|
3524
|
-
var
|
|
3525
|
-
class
|
|
3622
|
+
var Z;
|
|
3623
|
+
class ya {
|
|
3526
3624
|
constructor() {
|
|
3527
|
-
|
|
3625
|
+
me(this, Z, {});
|
|
3528
3626
|
}
|
|
3529
3627
|
add(e) {
|
|
3530
|
-
return
|
|
3628
|
+
return j(this, Z)[je(e.address).toString()] = e, e;
|
|
3531
3629
|
}
|
|
3532
3630
|
all() {
|
|
3533
|
-
return Object.values(
|
|
3631
|
+
return Object.values(j(this, Z));
|
|
3534
3632
|
}
|
|
3535
3633
|
get(e) {
|
|
3536
|
-
const t =
|
|
3634
|
+
const t = j(this, Z)[je(e).toString()];
|
|
3537
3635
|
if (!t)
|
|
3538
3636
|
throw new Error(
|
|
3539
|
-
`Unable to retrieve keypair '${
|
|
3637
|
+
`Unable to retrieve keypair '${ai(e) || De(e) ? Ze(dt(e)) : e}'`
|
|
3540
3638
|
);
|
|
3541
3639
|
return t;
|
|
3542
3640
|
}
|
|
3543
3641
|
remove(e) {
|
|
3544
|
-
delete
|
|
3642
|
+
delete j(this, Z)[je(e).toString()];
|
|
3545
3643
|
}
|
|
3546
3644
|
}
|
|
3547
|
-
|
|
3548
|
-
const
|
|
3549
|
-
sr25519: (n) =>
|
|
3645
|
+
Z = new WeakMap();
|
|
3646
|
+
const va = "bottom drive obey lake curtain smoke basket hold race lonely fit walk", Sn = {
|
|
3647
|
+
sr25519: (n) => Tn(n),
|
|
3550
3648
|
ed25519: () => {
|
|
3551
3649
|
throw new Error("Not Implemented");
|
|
3552
3650
|
},
|
|
@@ -3557,20 +3655,20 @@ const ta = "bottom drive obey lake curtain smoke basket hold race lonely fit wal
|
|
|
3557
3655
|
throw new Error("Not Implemented");
|
|
3558
3656
|
}
|
|
3559
3657
|
};
|
|
3560
|
-
function
|
|
3658
|
+
function wa({ publicKey: n }) {
|
|
3561
3659
|
return n;
|
|
3562
3660
|
}
|
|
3563
|
-
var V,
|
|
3564
|
-
class
|
|
3661
|
+
var V, Pe, le;
|
|
3662
|
+
class ba {
|
|
3565
3663
|
constructor(e = {}) {
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
if (this.decodeAddress =
|
|
3664
|
+
me(this, V);
|
|
3665
|
+
me(this, Pe);
|
|
3666
|
+
me(this, le);
|
|
3667
|
+
if (this.decodeAddress = je, this.encodeAddress = (t, r) => ti(t, r ?? j(this, le)), e.type = e.type || "sr25519", !["sr25519"].includes(e.type || "undefined"))
|
|
3570
3668
|
throw new Error(
|
|
3571
3669
|
`Expected a keyring type of either 'sr25519', found '${e.type || "unknown"}`
|
|
3572
3670
|
);
|
|
3573
|
-
|
|
3671
|
+
ye(this, V, new ya()), ye(this, le, e.ss58Format), ye(this, Pe, e.type);
|
|
3574
3672
|
}
|
|
3575
3673
|
/**
|
|
3576
3674
|
* @description retrieve the pairs (alias for getPairs)
|
|
@@ -3588,14 +3686,14 @@ class ra {
|
|
|
3588
3686
|
* @description Returns the type of the keyring, ed25519, sr25519 or ecdsa
|
|
3589
3687
|
*/
|
|
3590
3688
|
get type() {
|
|
3591
|
-
return
|
|
3689
|
+
return j(this, Pe);
|
|
3592
3690
|
}
|
|
3593
3691
|
/**
|
|
3594
3692
|
* @name addPair
|
|
3595
3693
|
* @summary Stores an account, given a keyring pair, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
|
3596
3694
|
*/
|
|
3597
3695
|
addPair(e) {
|
|
3598
|
-
return
|
|
3696
|
+
return j(this, V).add(e);
|
|
3599
3697
|
}
|
|
3600
3698
|
/**
|
|
3601
3699
|
* @name addFromAddress
|
|
@@ -3608,7 +3706,7 @@ class ra {
|
|
|
3608
3706
|
addFromAddress(e, t = {}, r = null, i = this.type, o, s) {
|
|
3609
3707
|
const a = this.decodeAddress(e, o);
|
|
3610
3708
|
return this.addPair(
|
|
3611
|
-
|
|
3709
|
+
ae(
|
|
3612
3710
|
{ toSS58: this.encodeAddress, type: i },
|
|
3613
3711
|
{ publicKey: a, secretKey: new Uint8Array() },
|
|
3614
3712
|
t,
|
|
@@ -3654,9 +3752,9 @@ class ra {
|
|
|
3654
3752
|
*/
|
|
3655
3753
|
addFromSeed(e, t = {}, r = this.type) {
|
|
3656
3754
|
return this.addPair(
|
|
3657
|
-
|
|
3755
|
+
ae(
|
|
3658
3756
|
{ toSS58: this.encodeAddress, type: r },
|
|
3659
|
-
|
|
3757
|
+
Sn[r](e),
|
|
3660
3758
|
t,
|
|
3661
3759
|
null
|
|
3662
3760
|
)
|
|
@@ -3690,8 +3788,8 @@ class ra {
|
|
|
3690
3788
|
const c = Array.isArray(i) ? i : [i];
|
|
3691
3789
|
if (!["sr25519"].includes(u))
|
|
3692
3790
|
throw new Error(`Unknown crypto type ${u}`);
|
|
3693
|
-
const l =
|
|
3694
|
-
return
|
|
3791
|
+
const l = De(e) ? rt(e) : this.decodeAddress(e, a), f = De(t) ? rt(t) : ni(t);
|
|
3792
|
+
return ae(
|
|
3695
3793
|
{ toSS58: this.encodeAddress, type: u },
|
|
3696
3794
|
{ publicKey: l, secretKey: new Uint8Array() },
|
|
3697
3795
|
s,
|
|
@@ -3704,7 +3802,7 @@ class ra {
|
|
|
3704
3802
|
* @summary Creates a pair from an explicit publicKey/secreteKey combination
|
|
3705
3803
|
*/
|
|
3706
3804
|
createFromPair(e, t = {}, r = this.type) {
|
|
3707
|
-
return
|
|
3805
|
+
return ae({ toSS58: this.encodeAddress, type: r }, e, t, null);
|
|
3708
3806
|
}
|
|
3709
3807
|
/**
|
|
3710
3808
|
* @name createFromUri
|
|
@@ -3712,10 +3810,10 @@ class ra {
|
|
|
3712
3810
|
* @description This creates a pair from the suri, but does not add it to the keyring
|
|
3713
3811
|
*/
|
|
3714
3812
|
createFromUri(e, t = {}, r = this.type) {
|
|
3715
|
-
const i = e.startsWith("//") ? `${
|
|
3813
|
+
const i = e.startsWith("//") ? `${va}${e}` : e, { password: o, path: s, phrase: a } = ri(i);
|
|
3716
3814
|
let u;
|
|
3717
|
-
if (
|
|
3718
|
-
u =
|
|
3815
|
+
if (De(a, 256))
|
|
3816
|
+
u = rt(a);
|
|
3719
3817
|
else {
|
|
3720
3818
|
const f = a.split(" ");
|
|
3721
3819
|
if ([12, 15, 18, 21, 24].includes(f.length))
|
|
@@ -3723,17 +3821,17 @@ class ra {
|
|
|
3723
3821
|
throw new Error(
|
|
3724
3822
|
"Not implemented - Prosopo Keyring supports sr25519 only"
|
|
3725
3823
|
);
|
|
3726
|
-
})() :
|
|
3824
|
+
})() : ii(a, o);
|
|
3727
3825
|
else {
|
|
3728
3826
|
if (a.length > 32)
|
|
3729
3827
|
throw new Error(
|
|
3730
3828
|
"specified phrase is not a valid mnemonic and is invalid as a raw seed at > 32 bytes"
|
|
3731
3829
|
);
|
|
3732
|
-
u =
|
|
3830
|
+
u = Ln(a.padEnd(32));
|
|
3733
3831
|
}
|
|
3734
3832
|
}
|
|
3735
|
-
const l =
|
|
3736
|
-
return
|
|
3833
|
+
const l = En(Sn[r](u), s, r);
|
|
3834
|
+
return ae(
|
|
3737
3835
|
{ toSS58: this.encodeAddress, type: r },
|
|
3738
3836
|
l,
|
|
3739
3837
|
t,
|
|
@@ -3747,7 +3845,7 @@ class ra {
|
|
|
3747
3845
|
* a key lookup using the provided account address or public key (after decoding it).
|
|
3748
3846
|
*/
|
|
3749
3847
|
getPair(e) {
|
|
3750
|
-
return
|
|
3848
|
+
return j(this, V).get(e);
|
|
3751
3849
|
}
|
|
3752
3850
|
/**
|
|
3753
3851
|
* @name getPairs
|
|
@@ -3755,7 +3853,7 @@ class ra {
|
|
|
3755
3853
|
* @description Returns an array list of all the keyring pair values that are stored in the keyring pair dictionary.
|
|
3756
3854
|
*/
|
|
3757
3855
|
getPairs() {
|
|
3758
|
-
return
|
|
3856
|
+
return j(this, V).all();
|
|
3759
3857
|
}
|
|
3760
3858
|
/**
|
|
3761
3859
|
* @name getPublicKeys
|
|
@@ -3763,21 +3861,21 @@ class ra {
|
|
|
3763
3861
|
* @description Returns an array list of all the public keys associated with each of the keyring pair values that are stored in the keyring pair dictionary.
|
|
3764
3862
|
*/
|
|
3765
3863
|
getPublicKeys() {
|
|
3766
|
-
return
|
|
3864
|
+
return j(this, V).all().map(wa);
|
|
3767
3865
|
}
|
|
3768
3866
|
/**
|
|
3769
3867
|
* @name removePair
|
|
3770
3868
|
* @description Deletes the provided input address or public key from the stored Keyring Pair Dictionary.
|
|
3771
3869
|
*/
|
|
3772
3870
|
removePair(e) {
|
|
3773
|
-
|
|
3871
|
+
j(this, V).remove(e);
|
|
3774
3872
|
}
|
|
3775
3873
|
/**
|
|
3776
3874
|
* @name setSS58Format;
|
|
3777
3875
|
* @description Sets the ss58 format for the keyring
|
|
3778
3876
|
*/
|
|
3779
3877
|
setSS58Format(e) {
|
|
3780
|
-
|
|
3878
|
+
ye(this, le, e);
|
|
3781
3879
|
}
|
|
3782
3880
|
/**
|
|
3783
3881
|
* @name toJson
|
|
@@ -3788,14 +3886,14 @@ class ra {
|
|
|
3788
3886
|
* may backup their account to a JSON file that contains this information.
|
|
3789
3887
|
*/
|
|
3790
3888
|
toJson(e, t) {
|
|
3791
|
-
return
|
|
3889
|
+
return j(this, V).get(e).toJson(t);
|
|
3792
3890
|
}
|
|
3793
3891
|
}
|
|
3794
|
-
V = new WeakMap(),
|
|
3795
|
-
class
|
|
3892
|
+
V = new WeakMap(), Pe = new WeakMap(), le = new WeakMap();
|
|
3893
|
+
class Sa {
|
|
3796
3894
|
}
|
|
3797
|
-
const
|
|
3798
|
-
class
|
|
3895
|
+
const xa = async () => (await import("./Signer-DP9drQ55.js")).default, Oa = async () => (await import("./utilCryptoChunk-D6ZLkbFV.js").then((n) => n.w)).entropyToMnemonic;
|
|
3896
|
+
class xn extends Sa {
|
|
3799
3897
|
async getAccount(e) {
|
|
3800
3898
|
const t = await this.createAccount(e), r = await this.createExtension(t);
|
|
3801
3899
|
return {
|
|
@@ -3804,14 +3902,14 @@ class bn extends ia {
|
|
|
3804
3902
|
};
|
|
3805
3903
|
}
|
|
3806
3904
|
async createExtension(e) {
|
|
3807
|
-
const t = await
|
|
3905
|
+
const t = await xa(), r = new t(async () => {
|
|
3808
3906
|
});
|
|
3809
3907
|
return r.signRaw = async (i) => {
|
|
3810
3908
|
const o = e.keypair.sign(i.data);
|
|
3811
3909
|
return {
|
|
3812
3910
|
id: 1,
|
|
3813
3911
|
// the id of the request to sign. This should be incremented each time and adjust the signature, but we're hacking around this. Hence the signature will always be the same given the same payload.
|
|
3814
|
-
signature:
|
|
3912
|
+
signature: Ze(o)
|
|
3815
3913
|
};
|
|
3816
3914
|
}, {
|
|
3817
3915
|
accounts: {
|
|
@@ -3820,12 +3918,12 @@ class bn extends ia {
|
|
|
3820
3918
|
}
|
|
3821
3919
|
},
|
|
3822
3920
|
name: "procaptcha-web2",
|
|
3823
|
-
version:
|
|
3921
|
+
version: bs,
|
|
3824
3922
|
signer: r
|
|
3825
3923
|
};
|
|
3826
3924
|
}
|
|
3827
3925
|
async createAccount(e) {
|
|
3828
|
-
const t = await
|
|
3926
|
+
const t = await aa(), r = oi(t, 128).slice(2), i = Ln(r), s = (await Oa())(i), a = "sr25519", c = new ba({
|
|
3829
3927
|
type: a
|
|
3830
3928
|
}).addFromMnemonic(s), l = c.address;
|
|
3831
3929
|
return {
|
|
@@ -3835,33 +3933,35 @@ class bn extends ia {
|
|
|
3835
3933
|
};
|
|
3836
3934
|
}
|
|
3837
3935
|
}
|
|
3838
|
-
const
|
|
3936
|
+
const Va = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3839
3937
|
__proto__: null,
|
|
3840
|
-
ExtensionWeb2:
|
|
3841
|
-
default:
|
|
3938
|
+
ExtensionWeb2: xn,
|
|
3939
|
+
default: xn
|
|
3842
3940
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3843
3941
|
export {
|
|
3844
3942
|
h as A,
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3943
|
+
Xe as C,
|
|
3944
|
+
Sa as E,
|
|
3945
|
+
In as L,
|
|
3946
|
+
ra as M,
|
|
3947
|
+
Ha as P,
|
|
3948
|
+
Ma as R,
|
|
3949
|
+
Fa as S,
|
|
3950
|
+
_a as U,
|
|
3951
|
+
W as a,
|
|
3952
|
+
bt as b,
|
|
3953
|
+
zs as c,
|
|
3954
|
+
Ws as d,
|
|
3955
|
+
Js as e,
|
|
3956
|
+
Ra as f,
|
|
3957
|
+
Da as g,
|
|
3958
|
+
Ua as h,
|
|
3959
|
+
ja as i,
|
|
3960
|
+
Hi as j,
|
|
3961
|
+
Na as k,
|
|
3962
|
+
Ia as l,
|
|
3963
|
+
Va as m,
|
|
3864
3964
|
F as r,
|
|
3865
|
-
|
|
3866
|
-
|
|
3965
|
+
$a as s,
|
|
3966
|
+
Aa as u
|
|
3867
3967
|
};
|