vbss-translator 1.0.2 → 1.1.1
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/README.md +537 -171
- package/dist/cli/index.js +64 -0
- package/dist/generator.cjs +32 -0
- package/dist/generator.d.ts +19 -0
- package/dist/generator.js +360 -0
- package/dist/vbss-translator.d.ts +118 -5
- package/dist/vbss-translator.js +3142 -420
- package/dist/vbss-translator.umd.cjs +18 -10
- package/package.json +111 -53
package/dist/vbss-translator.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
1
|
+
var en = Object.defineProperty;
|
|
2
|
+
var tn = (t, e, r) => e in t ? en(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var te = (t, e, r) => tn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import ar, { createContext as rn, useContext as nn, useMemo as ce, useState as Be, useEffect as lt, useCallback as $e, useRef as sn, startTransition as on } from "react";
|
|
5
|
+
var qe = { exports: {} }, Se = {};
|
|
3
6
|
/**
|
|
4
7
|
* @license React
|
|
5
8
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,21 +12,21 @@ var J = { exports: {} }, $ = {};
|
|
|
9
12
|
* This source code is licensed under the MIT license found in the
|
|
10
13
|
* LICENSE file in the root directory of this source tree.
|
|
11
14
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
for (
|
|
21
|
-
if (
|
|
22
|
-
return { $$typeof:
|
|
23
|
-
}
|
|
24
|
-
return
|
|
25
|
-
}
|
|
26
|
-
var
|
|
15
|
+
var Ut;
|
|
16
|
+
function an() {
|
|
17
|
+
if (Ut) return Se;
|
|
18
|
+
Ut = 1;
|
|
19
|
+
var t = ar, e = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
|
+
function i(l, f, d) {
|
|
21
|
+
var u, h = {}, _ = null, k = null;
|
|
22
|
+
d !== void 0 && (_ = "" + d), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (k = f.ref);
|
|
23
|
+
for (u in f) n.call(f, u) && !a.hasOwnProperty(u) && (h[u] = f[u]);
|
|
24
|
+
if (l && l.defaultProps) for (u in f = l.defaultProps, f) h[u] === void 0 && (h[u] = f[u]);
|
|
25
|
+
return { $$typeof: e, type: l, key: _, ref: k, props: h, _owner: s.current };
|
|
26
|
+
}
|
|
27
|
+
return Se.Fragment = r, Se.jsx = i, Se.jsxs = i, Se;
|
|
28
|
+
}
|
|
29
|
+
var Ae = {};
|
|
27
30
|
/**
|
|
28
31
|
* @license React
|
|
29
32
|
* react-jsx-runtime.development.js
|
|
@@ -33,91 +36,91 @@ var W = {};
|
|
|
33
36
|
* This source code is licensed under the MIT license found in the
|
|
34
37
|
* LICENSE file in the root directory of this source tree.
|
|
35
38
|
*/
|
|
36
|
-
var
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
var
|
|
40
|
-
function
|
|
41
|
-
if (
|
|
39
|
+
var It;
|
|
40
|
+
function ln() {
|
|
41
|
+
return It || (It = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
42
|
+
var t = ar, e = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), m = Symbol.iterator, y = "@@iterator";
|
|
43
|
+
function g(o) {
|
|
44
|
+
if (o === null || typeof o != "object")
|
|
42
45
|
return null;
|
|
43
|
-
var
|
|
44
|
-
return typeof
|
|
46
|
+
var p = m && o[m] || o[y];
|
|
47
|
+
return typeof p == "function" ? p : null;
|
|
45
48
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
49
|
+
var A = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
50
|
+
function L(o) {
|
|
48
51
|
{
|
|
49
|
-
for (var
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
for (var p = arguments.length, E = new Array(p > 1 ? p - 1 : 0), v = 1; v < p; v++)
|
|
53
|
+
E[v - 1] = arguments[v];
|
|
54
|
+
D("error", o, E);
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
|
-
function
|
|
57
|
+
function D(o, p, E) {
|
|
55
58
|
{
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
return String(
|
|
59
|
+
var v = A.ReactDebugCurrentFrame, P = v.getStackAddendum();
|
|
60
|
+
P !== "" && (p += "%s", E = E.concat([P]));
|
|
61
|
+
var F = E.map(function(S) {
|
|
62
|
+
return String(S);
|
|
60
63
|
});
|
|
61
|
-
|
|
64
|
+
F.unshift("Warning: " + p), Function.prototype.apply.call(console[o], console, F);
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
return !!(typeof
|
|
67
|
+
var C = !1, $ = !1, se = !1, q = !1, W = !1, Z;
|
|
68
|
+
Z = Symbol.for("react.module.reference");
|
|
69
|
+
function fe(o) {
|
|
70
|
+
return !!(typeof o == "string" || typeof o == "function" || o === n || o === a || W || o === s || o === d || o === u || q || o === k || C || $ || se || typeof o == "object" && o !== null && (o.$$typeof === _ || o.$$typeof === h || o.$$typeof === i || o.$$typeof === l || o.$$typeof === f || // This needs to include all possible module reference object
|
|
68
71
|
// types supported by any Flight configuration anywhere since
|
|
69
72
|
// we don't know which Flight build this will end up being used
|
|
70
73
|
// with.
|
|
71
|
-
|
|
74
|
+
o.$$typeof === Z || o.getModuleId !== void 0));
|
|
72
75
|
}
|
|
73
|
-
function
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
return
|
|
77
|
-
var
|
|
78
|
-
return
|
|
76
|
+
function le(o, p, E) {
|
|
77
|
+
var v = o.displayName;
|
|
78
|
+
if (v)
|
|
79
|
+
return v;
|
|
80
|
+
var P = p.displayName || p.name || "";
|
|
81
|
+
return P !== "" ? E + "(" + P + ")" : E;
|
|
79
82
|
}
|
|
80
|
-
function
|
|
81
|
-
return
|
|
83
|
+
function ie(o) {
|
|
84
|
+
return o.displayName || "Context";
|
|
82
85
|
}
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
86
|
+
function H(o) {
|
|
87
|
+
if (o == null)
|
|
85
88
|
return null;
|
|
86
|
-
if (typeof
|
|
87
|
-
return
|
|
88
|
-
if (typeof
|
|
89
|
-
return
|
|
90
|
-
switch (
|
|
91
|
-
case
|
|
89
|
+
if (typeof o.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
|
|
90
|
+
return o.displayName || o.name || null;
|
|
91
|
+
if (typeof o == "string")
|
|
92
|
+
return o;
|
|
93
|
+
switch (o) {
|
|
94
|
+
case n:
|
|
92
95
|
return "Fragment";
|
|
93
|
-
case
|
|
96
|
+
case r:
|
|
94
97
|
return "Portal";
|
|
95
|
-
case
|
|
98
|
+
case a:
|
|
96
99
|
return "Profiler";
|
|
97
|
-
case
|
|
100
|
+
case s:
|
|
98
101
|
return "StrictMode";
|
|
99
|
-
case
|
|
102
|
+
case d:
|
|
100
103
|
return "Suspense";
|
|
101
|
-
case
|
|
104
|
+
case u:
|
|
102
105
|
return "SuspenseList";
|
|
103
106
|
}
|
|
104
|
-
if (typeof
|
|
105
|
-
switch (
|
|
106
|
-
case
|
|
107
|
-
var
|
|
108
|
-
return
|
|
109
|
-
case
|
|
110
|
-
var
|
|
111
|
-
return
|
|
112
|
-
case
|
|
113
|
-
return
|
|
114
|
-
case
|
|
115
|
-
var
|
|
116
|
-
return
|
|
117
|
-
case
|
|
118
|
-
var
|
|
107
|
+
if (typeof o == "object")
|
|
108
|
+
switch (o.$$typeof) {
|
|
109
|
+
case l:
|
|
110
|
+
var p = o;
|
|
111
|
+
return ie(p) + ".Consumer";
|
|
112
|
+
case i:
|
|
113
|
+
var E = o;
|
|
114
|
+
return ie(E._context) + ".Provider";
|
|
115
|
+
case f:
|
|
116
|
+
return le(o, o.render, "ForwardRef");
|
|
117
|
+
case h:
|
|
118
|
+
var v = o.displayName || null;
|
|
119
|
+
return v !== null ? v : H(o.type) || "Memo";
|
|
120
|
+
case _: {
|
|
121
|
+
var P = o, F = P._payload, S = P._init;
|
|
119
122
|
try {
|
|
120
|
-
return
|
|
123
|
+
return H(S(F));
|
|
121
124
|
} catch {
|
|
122
125
|
return null;
|
|
123
126
|
}
|
|
@@ -125,541 +128,3260 @@ function hr() {
|
|
|
125
128
|
}
|
|
126
129
|
return null;
|
|
127
130
|
}
|
|
128
|
-
var
|
|
129
|
-
function
|
|
131
|
+
var K = Object.assign, b = 0, R, x, T, N, oe, U, M;
|
|
132
|
+
function J() {
|
|
130
133
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
134
|
+
J.__reactDisabledLog = !0;
|
|
135
|
+
function ue() {
|
|
133
136
|
{
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
var
|
|
137
|
+
if (b === 0) {
|
|
138
|
+
R = console.log, x = console.info, T = console.warn, N = console.error, oe = console.group, U = console.groupCollapsed, M = console.groupEnd;
|
|
139
|
+
var o = {
|
|
137
140
|
configurable: !0,
|
|
138
141
|
enumerable: !0,
|
|
139
|
-
value:
|
|
142
|
+
value: J,
|
|
140
143
|
writable: !0
|
|
141
144
|
};
|
|
142
145
|
Object.defineProperties(console, {
|
|
143
|
-
info:
|
|
144
|
-
log:
|
|
145
|
-
warn:
|
|
146
|
-
error:
|
|
147
|
-
group:
|
|
148
|
-
groupCollapsed:
|
|
149
|
-
groupEnd:
|
|
146
|
+
info: o,
|
|
147
|
+
log: o,
|
|
148
|
+
warn: o,
|
|
149
|
+
error: o,
|
|
150
|
+
group: o,
|
|
151
|
+
groupCollapsed: o,
|
|
152
|
+
groupEnd: o
|
|
150
153
|
});
|
|
151
154
|
}
|
|
152
|
-
|
|
155
|
+
b++;
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
|
-
function
|
|
158
|
+
function de() {
|
|
156
159
|
{
|
|
157
|
-
if (
|
|
158
|
-
var
|
|
160
|
+
if (b--, b === 0) {
|
|
161
|
+
var o = {
|
|
159
162
|
configurable: !0,
|
|
160
163
|
enumerable: !0,
|
|
161
164
|
writable: !0
|
|
162
165
|
};
|
|
163
166
|
Object.defineProperties(console, {
|
|
164
|
-
log:
|
|
165
|
-
value:
|
|
167
|
+
log: K({}, o, {
|
|
168
|
+
value: R
|
|
166
169
|
}),
|
|
167
|
-
info:
|
|
168
|
-
value:
|
|
170
|
+
info: K({}, o, {
|
|
171
|
+
value: x
|
|
169
172
|
}),
|
|
170
|
-
warn:
|
|
171
|
-
value:
|
|
173
|
+
warn: K({}, o, {
|
|
174
|
+
value: T
|
|
172
175
|
}),
|
|
173
|
-
error:
|
|
174
|
-
value:
|
|
176
|
+
error: K({}, o, {
|
|
177
|
+
value: N
|
|
175
178
|
}),
|
|
176
|
-
group:
|
|
177
|
-
value:
|
|
179
|
+
group: K({}, o, {
|
|
180
|
+
value: oe
|
|
178
181
|
}),
|
|
179
|
-
groupCollapsed:
|
|
180
|
-
value:
|
|
182
|
+
groupCollapsed: K({}, o, {
|
|
183
|
+
value: U
|
|
181
184
|
}),
|
|
182
|
-
groupEnd:
|
|
183
|
-
value:
|
|
185
|
+
groupEnd: K({}, o, {
|
|
186
|
+
value: M
|
|
184
187
|
})
|
|
185
188
|
});
|
|
186
189
|
}
|
|
187
|
-
|
|
190
|
+
b < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
191
|
}
|
|
189
192
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
193
|
+
var je = A.ReactCurrentDispatcher, xe;
|
|
194
|
+
function be(o, p, E) {
|
|
192
195
|
{
|
|
193
|
-
if (
|
|
196
|
+
if (xe === void 0)
|
|
194
197
|
try {
|
|
195
198
|
throw Error();
|
|
196
|
-
} catch (
|
|
197
|
-
var
|
|
198
|
-
|
|
199
|
+
} catch (P) {
|
|
200
|
+
var v = P.stack.trim().match(/\n( *(at )?)/);
|
|
201
|
+
xe = v && v[1] || "";
|
|
199
202
|
}
|
|
200
203
|
return `
|
|
201
|
-
` +
|
|
204
|
+
` + xe + o;
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
|
-
var
|
|
207
|
+
var ee = !1, he;
|
|
205
208
|
{
|
|
206
|
-
var
|
|
207
|
-
|
|
209
|
+
var Ue = typeof WeakMap == "function" ? WeakMap : Map;
|
|
210
|
+
he = new Ue();
|
|
208
211
|
}
|
|
209
|
-
function
|
|
210
|
-
if (!
|
|
212
|
+
function Ee(o, p) {
|
|
213
|
+
if (!o || ee)
|
|
211
214
|
return "";
|
|
212
215
|
{
|
|
213
|
-
var
|
|
214
|
-
if (
|
|
215
|
-
return
|
|
216
|
+
var E = he.get(o);
|
|
217
|
+
if (E !== void 0)
|
|
218
|
+
return E;
|
|
216
219
|
}
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
var
|
|
220
|
+
var v;
|
|
221
|
+
ee = !0;
|
|
222
|
+
var P = Error.prepareStackTrace;
|
|
220
223
|
Error.prepareStackTrace = void 0;
|
|
221
|
-
var
|
|
222
|
-
|
|
224
|
+
var F;
|
|
225
|
+
F = je.current, je.current = null, ue();
|
|
223
226
|
try {
|
|
224
|
-
if (
|
|
225
|
-
var
|
|
227
|
+
if (p) {
|
|
228
|
+
var S = function() {
|
|
226
229
|
throw Error();
|
|
227
230
|
};
|
|
228
|
-
if (Object.defineProperty(
|
|
231
|
+
if (Object.defineProperty(S.prototype, "props", {
|
|
229
232
|
set: function() {
|
|
230
233
|
throw Error();
|
|
231
234
|
}
|
|
232
235
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
236
|
try {
|
|
234
|
-
Reflect.construct(
|
|
235
|
-
} catch (
|
|
236
|
-
|
|
237
|
+
Reflect.construct(S, []);
|
|
238
|
+
} catch (Y) {
|
|
239
|
+
v = Y;
|
|
237
240
|
}
|
|
238
|
-
Reflect.construct(
|
|
241
|
+
Reflect.construct(o, [], S);
|
|
239
242
|
} else {
|
|
240
243
|
try {
|
|
241
|
-
|
|
242
|
-
} catch (
|
|
243
|
-
|
|
244
|
+
S.call();
|
|
245
|
+
} catch (Y) {
|
|
246
|
+
v = Y;
|
|
244
247
|
}
|
|
245
|
-
|
|
248
|
+
o.call(S.prototype);
|
|
246
249
|
}
|
|
247
250
|
} else {
|
|
248
251
|
try {
|
|
249
252
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
|
|
253
|
+
} catch (Y) {
|
|
254
|
+
v = Y;
|
|
252
255
|
}
|
|
253
|
-
|
|
256
|
+
o();
|
|
254
257
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var
|
|
258
|
-
`),
|
|
259
|
-
`),
|
|
260
|
-
|
|
261
|
-
for (;
|
|
262
|
-
if (
|
|
263
|
-
if (
|
|
258
|
+
} catch (Y) {
|
|
259
|
+
if (Y && v && typeof Y.stack == "string") {
|
|
260
|
+
for (var O = Y.stack.split(`
|
|
261
|
+
`), z = v.stack.split(`
|
|
262
|
+
`), I = O.length - 1, B = z.length - 1; I >= 1 && B >= 0 && O[I] !== z[B]; )
|
|
263
|
+
B--;
|
|
264
|
+
for (; I >= 1 && B >= 0; I--, B--)
|
|
265
|
+
if (O[I] !== z[B]) {
|
|
266
|
+
if (I !== 1 || B !== 1)
|
|
264
267
|
do
|
|
265
|
-
if (
|
|
266
|
-
var
|
|
267
|
-
` +
|
|
268
|
-
return
|
|
268
|
+
if (I--, B--, B < 0 || O[I] !== z[B]) {
|
|
269
|
+
var re = `
|
|
270
|
+
` + O[I].replace(" at new ", " at ");
|
|
271
|
+
return o.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", o.displayName)), typeof o == "function" && he.set(o, re), re;
|
|
269
272
|
}
|
|
270
|
-
while (
|
|
273
|
+
while (I >= 1 && B >= 0);
|
|
271
274
|
break;
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
} finally {
|
|
275
|
-
|
|
278
|
+
ee = !1, je.current = F, de(), Error.prepareStackTrace = P;
|
|
276
279
|
}
|
|
277
|
-
var
|
|
278
|
-
return typeof
|
|
280
|
+
var Re = o ? o.displayName || o.name : "", pe = Re ? be(Re) : "";
|
|
281
|
+
return typeof o == "function" && he.set(o, pe), pe;
|
|
279
282
|
}
|
|
280
|
-
function
|
|
281
|
-
return
|
|
283
|
+
function rt(o, p, E) {
|
|
284
|
+
return Ee(o, !1);
|
|
282
285
|
}
|
|
283
|
-
function
|
|
284
|
-
var
|
|
285
|
-
return !!(
|
|
286
|
+
function kr(o) {
|
|
287
|
+
var p = o.prototype;
|
|
288
|
+
return !!(p && p.isReactComponent);
|
|
286
289
|
}
|
|
287
|
-
function
|
|
288
|
-
if (
|
|
290
|
+
function Ie(o, p, E) {
|
|
291
|
+
if (o == null)
|
|
289
292
|
return "";
|
|
290
|
-
if (typeof
|
|
291
|
-
return
|
|
292
|
-
if (typeof
|
|
293
|
-
return
|
|
294
|
-
switch (
|
|
295
|
-
case
|
|
296
|
-
return
|
|
297
|
-
case
|
|
298
|
-
return
|
|
299
|
-
}
|
|
300
|
-
if (typeof
|
|
301
|
-
switch (
|
|
302
|
-
case
|
|
303
|
-
return
|
|
304
|
-
case
|
|
305
|
-
return
|
|
306
|
-
case
|
|
307
|
-
var
|
|
293
|
+
if (typeof o == "function")
|
|
294
|
+
return Ee(o, kr(o));
|
|
295
|
+
if (typeof o == "string")
|
|
296
|
+
return be(o);
|
|
297
|
+
switch (o) {
|
|
298
|
+
case d:
|
|
299
|
+
return be("Suspense");
|
|
300
|
+
case u:
|
|
301
|
+
return be("SuspenseList");
|
|
302
|
+
}
|
|
303
|
+
if (typeof o == "object")
|
|
304
|
+
switch (o.$$typeof) {
|
|
305
|
+
case f:
|
|
306
|
+
return rt(o.render);
|
|
307
|
+
case h:
|
|
308
|
+
return Ie(o.type, p, E);
|
|
309
|
+
case _: {
|
|
310
|
+
var v = o, P = v._payload, F = v._init;
|
|
308
311
|
try {
|
|
309
|
-
return
|
|
312
|
+
return Ie(F(P), p, E);
|
|
310
313
|
} catch {
|
|
311
314
|
}
|
|
312
315
|
}
|
|
313
316
|
}
|
|
314
317
|
return "";
|
|
315
318
|
}
|
|
316
|
-
var
|
|
317
|
-
function
|
|
318
|
-
if (
|
|
319
|
-
var
|
|
320
|
-
|
|
319
|
+
var Oe = Object.prototype.hasOwnProperty, vt = {}, _t = A.ReactDebugCurrentFrame;
|
|
320
|
+
function Me(o) {
|
|
321
|
+
if (o) {
|
|
322
|
+
var p = o._owner, E = Ie(o.type, o._source, p ? p.type : null);
|
|
323
|
+
_t.setExtraStackFrame(E);
|
|
321
324
|
} else
|
|
322
|
-
|
|
325
|
+
_t.setExtraStackFrame(null);
|
|
323
326
|
}
|
|
324
|
-
function
|
|
327
|
+
function Lr(o, p, E, v, P) {
|
|
325
328
|
{
|
|
326
|
-
var
|
|
327
|
-
for (var
|
|
328
|
-
if (
|
|
329
|
-
var
|
|
329
|
+
var F = Function.call.bind(Oe);
|
|
330
|
+
for (var S in o)
|
|
331
|
+
if (F(o, S)) {
|
|
332
|
+
var O = void 0;
|
|
330
333
|
try {
|
|
331
|
-
if (typeof
|
|
332
|
-
var
|
|
333
|
-
throw
|
|
334
|
+
if (typeof o[S] != "function") {
|
|
335
|
+
var z = Error((v || "React class") + ": " + E + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
336
|
+
throw z.name = "Invariant Violation", z;
|
|
334
337
|
}
|
|
335
|
-
|
|
336
|
-
} catch (
|
|
337
|
-
|
|
338
|
+
O = o[S](p, S, v, E, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
339
|
+
} catch (I) {
|
|
340
|
+
O = I;
|
|
338
341
|
}
|
|
339
|
-
|
|
342
|
+
O && !(O instanceof Error) && (Me(P), L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", v || "React class", E, S, typeof O), Me(null)), O instanceof Error && !(O.message in vt) && (vt[O.message] = !0, Me(P), L("Failed %s type: %s", E, O.message), Me(null));
|
|
340
343
|
}
|
|
341
344
|
}
|
|
342
345
|
}
|
|
343
|
-
var
|
|
344
|
-
function
|
|
345
|
-
return
|
|
346
|
+
var Dr = Array.isArray;
|
|
347
|
+
function nt(o) {
|
|
348
|
+
return Dr(o);
|
|
346
349
|
}
|
|
347
|
-
function
|
|
350
|
+
function Fr(o) {
|
|
348
351
|
{
|
|
349
|
-
var
|
|
350
|
-
return
|
|
352
|
+
var p = typeof Symbol == "function" && Symbol.toStringTag, E = p && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
353
|
+
return E;
|
|
351
354
|
}
|
|
352
355
|
}
|
|
353
|
-
function
|
|
356
|
+
function Nr(o) {
|
|
354
357
|
try {
|
|
355
|
-
return
|
|
358
|
+
return xt(o), !1;
|
|
356
359
|
} catch {
|
|
357
360
|
return !0;
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
|
-
function
|
|
361
|
-
return "" +
|
|
363
|
+
function xt(o) {
|
|
364
|
+
return "" + o;
|
|
362
365
|
}
|
|
363
|
-
function
|
|
364
|
-
if (
|
|
365
|
-
return
|
|
366
|
+
function Ot(o) {
|
|
367
|
+
if (Nr(o))
|
|
368
|
+
return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Fr(o)), xt(o);
|
|
366
369
|
}
|
|
367
|
-
var
|
|
370
|
+
var St = A.ReactCurrentOwner, jr = {
|
|
368
371
|
key: !0,
|
|
369
372
|
ref: !0,
|
|
370
373
|
__self: !0,
|
|
371
374
|
__source: !0
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
if (r && r.isReactWarning)
|
|
375
|
+
}, At, Ct;
|
|
376
|
+
function Ur(o) {
|
|
377
|
+
if (Oe.call(o, "ref")) {
|
|
378
|
+
var p = Object.getOwnPropertyDescriptor(o, "ref").get;
|
|
379
|
+
if (p && p.isReactWarning)
|
|
378
380
|
return !1;
|
|
379
381
|
}
|
|
380
|
-
return
|
|
382
|
+
return o.ref !== void 0;
|
|
381
383
|
}
|
|
382
|
-
function
|
|
383
|
-
if (
|
|
384
|
-
var
|
|
385
|
-
if (
|
|
384
|
+
function Ir(o) {
|
|
385
|
+
if (Oe.call(o, "key")) {
|
|
386
|
+
var p = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
387
|
+
if (p && p.isReactWarning)
|
|
386
388
|
return !1;
|
|
387
389
|
}
|
|
388
|
-
return
|
|
390
|
+
return o.key !== void 0;
|
|
389
391
|
}
|
|
390
|
-
function
|
|
391
|
-
|
|
392
|
-
var t = _(L.current.type);
|
|
393
|
-
X[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', _(L.current.type), e.ref), X[t] = !0);
|
|
394
|
-
}
|
|
392
|
+
function Mr(o, p) {
|
|
393
|
+
typeof o.ref == "string" && St.current;
|
|
395
394
|
}
|
|
396
|
-
function
|
|
395
|
+
function Br(o, p) {
|
|
397
396
|
{
|
|
398
|
-
var
|
|
399
|
-
|
|
397
|
+
var E = function() {
|
|
398
|
+
At || (At = !0, L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
400
399
|
};
|
|
401
|
-
|
|
402
|
-
get:
|
|
400
|
+
E.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
401
|
+
get: E,
|
|
403
402
|
configurable: !0
|
|
404
403
|
});
|
|
405
404
|
}
|
|
406
405
|
}
|
|
407
|
-
function
|
|
406
|
+
function $r(o, p) {
|
|
408
407
|
{
|
|
409
|
-
var
|
|
410
|
-
|
|
408
|
+
var E = function() {
|
|
409
|
+
Ct || (Ct = !0, L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
411
410
|
};
|
|
412
|
-
|
|
413
|
-
get:
|
|
411
|
+
E.isReactWarning = !0, Object.defineProperty(o, "ref", {
|
|
412
|
+
get: E,
|
|
414
413
|
configurable: !0
|
|
415
414
|
});
|
|
416
415
|
}
|
|
417
416
|
}
|
|
418
|
-
var
|
|
419
|
-
var
|
|
417
|
+
var qr = function(o, p, E, v, P, F, S) {
|
|
418
|
+
var O = {
|
|
420
419
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
-
$$typeof:
|
|
420
|
+
$$typeof: e,
|
|
422
421
|
// Built-in properties that belong on the element
|
|
423
|
-
type:
|
|
424
|
-
key:
|
|
425
|
-
ref:
|
|
426
|
-
props:
|
|
422
|
+
type: o,
|
|
423
|
+
key: p,
|
|
424
|
+
ref: E,
|
|
425
|
+
props: S,
|
|
427
426
|
// Record the component responsible for creating this element.
|
|
428
|
-
_owner:
|
|
427
|
+
_owner: F
|
|
429
428
|
};
|
|
430
|
-
return
|
|
429
|
+
return O._store = {}, Object.defineProperty(O._store, "validated", {
|
|
431
430
|
configurable: !1,
|
|
432
431
|
enumerable: !1,
|
|
433
432
|
writable: !0,
|
|
434
433
|
value: !1
|
|
435
|
-
}), Object.defineProperty(
|
|
434
|
+
}), Object.defineProperty(O, "_self", {
|
|
436
435
|
configurable: !1,
|
|
437
436
|
enumerable: !1,
|
|
438
437
|
writable: !1,
|
|
439
|
-
value:
|
|
440
|
-
}), Object.defineProperty(
|
|
438
|
+
value: v
|
|
439
|
+
}), Object.defineProperty(O, "_source", {
|
|
441
440
|
configurable: !1,
|
|
442
441
|
enumerable: !1,
|
|
443
442
|
writable: !1,
|
|
444
|
-
value:
|
|
445
|
-
}), Object.freeze && (Object.freeze(
|
|
443
|
+
value: P
|
|
444
|
+
}), Object.freeze && (Object.freeze(O.props), Object.freeze(O)), O;
|
|
446
445
|
};
|
|
447
|
-
function
|
|
446
|
+
function Hr(o, p, E, v, P) {
|
|
448
447
|
{
|
|
449
|
-
var
|
|
450
|
-
|
|
451
|
-
for (
|
|
452
|
-
|
|
453
|
-
if (
|
|
454
|
-
var
|
|
455
|
-
for (
|
|
456
|
-
|
|
448
|
+
var F, S = {}, O = null, z = null;
|
|
449
|
+
E !== void 0 && (Ot(E), O = "" + E), Ir(p) && (Ot(p.key), O = "" + p.key), Ur(p) && (z = p.ref, Mr(p, P));
|
|
450
|
+
for (F in p)
|
|
451
|
+
Oe.call(p, F) && !jr.hasOwnProperty(F) && (S[F] = p[F]);
|
|
452
|
+
if (o && o.defaultProps) {
|
|
453
|
+
var I = o.defaultProps;
|
|
454
|
+
for (F in I)
|
|
455
|
+
S[F] === void 0 && (S[F] = I[F]);
|
|
457
456
|
}
|
|
458
|
-
if (
|
|
459
|
-
var
|
|
460
|
-
|
|
457
|
+
if (O || z) {
|
|
458
|
+
var B = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
|
|
459
|
+
O && Br(S, B), z && $r(S, B);
|
|
461
460
|
}
|
|
462
|
-
return
|
|
461
|
+
return qr(o, O, z, P, v, St.current, S);
|
|
463
462
|
}
|
|
464
463
|
}
|
|
465
|
-
var
|
|
466
|
-
function
|
|
467
|
-
if (
|
|
468
|
-
var
|
|
469
|
-
|
|
464
|
+
var st = A.ReactCurrentOwner, Pt = A.ReactDebugCurrentFrame;
|
|
465
|
+
function we(o) {
|
|
466
|
+
if (o) {
|
|
467
|
+
var p = o._owner, E = Ie(o.type, o._source, p ? p.type : null);
|
|
468
|
+
Pt.setExtraStackFrame(E);
|
|
470
469
|
} else
|
|
471
|
-
|
|
470
|
+
Pt.setExtraStackFrame(null);
|
|
472
471
|
}
|
|
473
|
-
var
|
|
474
|
-
|
|
475
|
-
function
|
|
476
|
-
return typeof
|
|
472
|
+
var ot;
|
|
473
|
+
ot = !1;
|
|
474
|
+
function at(o) {
|
|
475
|
+
return typeof o == "object" && o !== null && o.$$typeof === e;
|
|
477
476
|
}
|
|
478
|
-
function
|
|
477
|
+
function kt() {
|
|
479
478
|
{
|
|
480
|
-
if (
|
|
481
|
-
var
|
|
482
|
-
if (
|
|
479
|
+
if (st.current) {
|
|
480
|
+
var o = H(st.current.type);
|
|
481
|
+
if (o)
|
|
483
482
|
return `
|
|
484
483
|
|
|
485
|
-
Check the render method of \`` +
|
|
484
|
+
Check the render method of \`` + o + "`.";
|
|
486
485
|
}
|
|
487
486
|
return "";
|
|
488
487
|
}
|
|
489
488
|
}
|
|
490
|
-
function
|
|
489
|
+
function Kr(o) {
|
|
491
490
|
return "";
|
|
492
491
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
492
|
+
var Lt = {};
|
|
493
|
+
function Vr(o) {
|
|
495
494
|
{
|
|
496
|
-
var
|
|
497
|
-
if (!
|
|
498
|
-
var
|
|
499
|
-
|
|
495
|
+
var p = kt();
|
|
496
|
+
if (!p) {
|
|
497
|
+
var E = typeof o == "string" ? o : o.displayName || o.name;
|
|
498
|
+
E && (p = `
|
|
500
499
|
|
|
501
|
-
Check the top-level render call using <` +
|
|
500
|
+
Check the top-level render call using <` + E + ">.");
|
|
502
501
|
}
|
|
503
|
-
return
|
|
502
|
+
return p;
|
|
504
503
|
}
|
|
505
504
|
}
|
|
506
|
-
function
|
|
505
|
+
function Dt(o, p) {
|
|
507
506
|
{
|
|
508
|
-
if (!
|
|
507
|
+
if (!o._store || o._store.validated || o.key != null)
|
|
509
508
|
return;
|
|
510
|
-
|
|
511
|
-
var
|
|
512
|
-
if (
|
|
509
|
+
o._store.validated = !0;
|
|
510
|
+
var E = Vr(p);
|
|
511
|
+
if (Lt[E])
|
|
513
512
|
return;
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
|
|
513
|
+
Lt[E] = !0;
|
|
514
|
+
var v = "";
|
|
515
|
+
o && o._owner && o._owner !== st.current && (v = " It was passed a child from " + H(o._owner.type) + "."), we(o), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', E, v), we(null);
|
|
517
516
|
}
|
|
518
517
|
}
|
|
519
|
-
function
|
|
518
|
+
function Ft(o, p) {
|
|
520
519
|
{
|
|
521
|
-
if (typeof
|
|
520
|
+
if (typeof o != "object")
|
|
522
521
|
return;
|
|
523
|
-
if (
|
|
524
|
-
for (var
|
|
525
|
-
var
|
|
526
|
-
|
|
522
|
+
if (nt(o))
|
|
523
|
+
for (var E = 0; E < o.length; E++) {
|
|
524
|
+
var v = o[E];
|
|
525
|
+
at(v) && Dt(v, p);
|
|
527
526
|
}
|
|
528
|
-
else if (
|
|
529
|
-
|
|
530
|
-
else if (
|
|
531
|
-
var
|
|
532
|
-
if (typeof
|
|
533
|
-
for (var
|
|
534
|
-
|
|
527
|
+
else if (at(o))
|
|
528
|
+
o._store && (o._store.validated = !0);
|
|
529
|
+
else if (o) {
|
|
530
|
+
var P = g(o);
|
|
531
|
+
if (typeof P == "function" && P !== o.entries)
|
|
532
|
+
for (var F = P.call(o), S; !(S = F.next()).done; )
|
|
533
|
+
at(S.value) && Dt(S.value, p);
|
|
535
534
|
}
|
|
536
535
|
}
|
|
537
536
|
}
|
|
538
|
-
function
|
|
537
|
+
function Wr(o) {
|
|
539
538
|
{
|
|
540
|
-
var
|
|
541
|
-
if (
|
|
539
|
+
var p = o.type;
|
|
540
|
+
if (p == null || typeof p == "string")
|
|
542
541
|
return;
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
|
|
546
|
-
else if (typeof
|
|
542
|
+
var E;
|
|
543
|
+
if (typeof p == "function")
|
|
544
|
+
E = p.propTypes;
|
|
545
|
+
else if (typeof p == "object" && (p.$$typeof === f || // Note: Memo only checks outer props here.
|
|
547
546
|
// Inner props are checked in the reconciler.
|
|
548
|
-
|
|
549
|
-
|
|
547
|
+
p.$$typeof === h))
|
|
548
|
+
E = p.propTypes;
|
|
550
549
|
else
|
|
551
550
|
return;
|
|
552
|
-
if (
|
|
553
|
-
var
|
|
554
|
-
|
|
555
|
-
} else if (
|
|
556
|
-
|
|
557
|
-
var
|
|
558
|
-
|
|
551
|
+
if (E) {
|
|
552
|
+
var v = H(p);
|
|
553
|
+
Lr(E, o.props, "prop", v, o);
|
|
554
|
+
} else if (p.PropTypes !== void 0 && !ot) {
|
|
555
|
+
ot = !0;
|
|
556
|
+
var P = H(p);
|
|
557
|
+
L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
|
|
559
558
|
}
|
|
560
|
-
typeof
|
|
559
|
+
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
560
|
}
|
|
562
561
|
}
|
|
563
|
-
function
|
|
562
|
+
function zr(o) {
|
|
564
563
|
{
|
|
565
|
-
for (var
|
|
566
|
-
var
|
|
567
|
-
if (
|
|
568
|
-
|
|
564
|
+
for (var p = Object.keys(o.props), E = 0; E < p.length; E++) {
|
|
565
|
+
var v = p[E];
|
|
566
|
+
if (v !== "children" && v !== "key") {
|
|
567
|
+
we(o), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), we(null);
|
|
569
568
|
break;
|
|
570
569
|
}
|
|
571
570
|
}
|
|
572
|
-
|
|
571
|
+
o.ref !== null && (we(o), L("Invalid attribute `ref` supplied to `React.Fragment`."), we(null));
|
|
573
572
|
}
|
|
574
573
|
}
|
|
575
|
-
var
|
|
576
|
-
function
|
|
574
|
+
var Nt = {};
|
|
575
|
+
function jt(o, p, E, v, P, F) {
|
|
577
576
|
{
|
|
578
|
-
var
|
|
579
|
-
if (!
|
|
580
|
-
var
|
|
581
|
-
(
|
|
582
|
-
var
|
|
583
|
-
|
|
584
|
-
var
|
|
585
|
-
|
|
577
|
+
var S = fe(o);
|
|
578
|
+
if (!S) {
|
|
579
|
+
var O = "";
|
|
580
|
+
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (O += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
581
|
+
var z = Kr();
|
|
582
|
+
z ? O += z : O += kt();
|
|
583
|
+
var I;
|
|
584
|
+
o === null ? I = "null" : nt(o) ? I = "array" : o !== void 0 && o.$$typeof === e ? (I = "<" + (H(o.type) || "Unknown") + " />", O = " Did you accidentally export a JSX literal instead of a component?") : I = typeof o, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", I, O);
|
|
586
585
|
}
|
|
587
|
-
var
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
590
|
-
if (
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
593
|
-
if (
|
|
594
|
-
if (
|
|
595
|
-
for (var
|
|
596
|
-
|
|
597
|
-
Object.freeze && Object.freeze(
|
|
586
|
+
var B = Hr(o, p, E, P, F);
|
|
587
|
+
if (B == null)
|
|
588
|
+
return B;
|
|
589
|
+
if (S) {
|
|
590
|
+
var re = p.children;
|
|
591
|
+
if (re !== void 0)
|
|
592
|
+
if (v)
|
|
593
|
+
if (nt(re)) {
|
|
594
|
+
for (var Re = 0; Re < re.length; Re++)
|
|
595
|
+
Ft(re[Re], o);
|
|
596
|
+
Object.freeze && Object.freeze(re);
|
|
598
597
|
} else
|
|
599
|
-
|
|
598
|
+
L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
599
|
else
|
|
601
|
-
|
|
600
|
+
Ft(re, o);
|
|
602
601
|
}
|
|
603
|
-
if (
|
|
604
|
-
var
|
|
605
|
-
return
|
|
606
|
-
}),
|
|
607
|
-
if (!
|
|
608
|
-
var
|
|
609
|
-
|
|
602
|
+
if (Oe.call(p, "key")) {
|
|
603
|
+
var pe = H(o), Y = Object.keys(p).filter(function(Zr) {
|
|
604
|
+
return Zr !== "key";
|
|
605
|
+
}), it = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
606
|
+
if (!Nt[pe + it]) {
|
|
607
|
+
var Qr = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
608
|
+
L(`A props object containing a "key" prop is being spread into JSX:
|
|
610
609
|
let props = %s;
|
|
611
610
|
<%s {...props} />
|
|
612
611
|
React keys must be passed directly to JSX without using spread:
|
|
613
612
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`,
|
|
613
|
+
<%s key={someKey} {...props} />`, it, pe, Qr, pe), Nt[pe + it] = !0;
|
|
615
614
|
}
|
|
616
615
|
}
|
|
617
|
-
return
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
622
|
-
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
625
|
-
}
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
}()),
|
|
629
|
-
}
|
|
630
|
-
var
|
|
631
|
-
function
|
|
632
|
-
return
|
|
633
|
-
}
|
|
634
|
-
var
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
616
|
+
return o === n ? zr(B) : Wr(B), B;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function Jr(o, p, E) {
|
|
620
|
+
return jt(o, p, E, !0);
|
|
621
|
+
}
|
|
622
|
+
function Yr(o, p, E) {
|
|
623
|
+
return jt(o, p, E, !1);
|
|
624
|
+
}
|
|
625
|
+
var Gr = Yr, Xr = Jr;
|
|
626
|
+
Ae.Fragment = n, Ae.jsx = Gr, Ae.jsxs = Xr;
|
|
627
|
+
})()), Ae;
|
|
628
|
+
}
|
|
629
|
+
var Mt;
|
|
630
|
+
function cn() {
|
|
631
|
+
return Mt || (Mt = 1, process.env.NODE_ENV === "production" ? qe.exports = an() : qe.exports = ln()), qe.exports;
|
|
632
|
+
}
|
|
633
|
+
var un = cn();
|
|
634
|
+
const ir = rn(
|
|
635
|
+
null
|
|
636
|
+
), fn = () => {
|
|
637
|
+
const t = nn(ir);
|
|
638
|
+
if (!t)
|
|
639
|
+
throw new Error(
|
|
640
|
+
"useTranslatorContext must be used within a TranslatorProvider"
|
|
641
|
+
);
|
|
642
|
+
return t;
|
|
643
|
+
};
|
|
644
|
+
class Bt extends Error {
|
|
645
|
+
constructor(r) {
|
|
646
|
+
super(r);
|
|
647
|
+
te(this, "code", "timeout");
|
|
648
|
+
this.name = "ExternalTranslationTimeoutError";
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const dn = "auto", He = (t) => typeof t == "number" && Number.isFinite(t) && t > 0, hn = (t) => {
|
|
652
|
+
const e = Object.entries(t).sort(([r], [n]) => r === n ? 0 : r < n ? -1 : 1);
|
|
653
|
+
return Object.fromEntries(e);
|
|
654
|
+
};
|
|
655
|
+
class pn {
|
|
656
|
+
constructor(e) {
|
|
657
|
+
te(this, "provider");
|
|
658
|
+
te(this, "config");
|
|
659
|
+
te(this, "cache");
|
|
660
|
+
te(this, "logger");
|
|
661
|
+
te(this, "inFlight", /* @__PURE__ */ new Map());
|
|
662
|
+
this.provider = e.provider, this.config = e.config, this.cache = e.cache, this.logger = e.logger;
|
|
663
|
+
}
|
|
664
|
+
isEnabled() {
|
|
665
|
+
return this.config.enabled;
|
|
666
|
+
}
|
|
667
|
+
async translate(e) {
|
|
668
|
+
if (!this.isEnabled()) {
|
|
669
|
+
this.debug("external_translation_disabled", {
|
|
670
|
+
key: e.key,
|
|
671
|
+
targetLanguage: e.targetLanguage
|
|
672
|
+
});
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
const r = this.normalizeRequest(e);
|
|
676
|
+
if (!await this.shouldTranslate(r.externalRequest)) {
|
|
677
|
+
this.debug("external_translation_skipped", {
|
|
678
|
+
key: r.externalRequest.key,
|
|
679
|
+
targetLanguage: r.externalRequest.targetLanguage
|
|
680
|
+
});
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
const n = this.readFromCache(r.cacheKey);
|
|
684
|
+
if (n)
|
|
685
|
+
return this.debug("external_translation_cache_hit", {
|
|
686
|
+
key: r.externalRequest.key,
|
|
687
|
+
cacheKey: r.cacheKey
|
|
688
|
+
}), n;
|
|
689
|
+
const s = this.inFlight.get(r.cacheKey);
|
|
690
|
+
if (s)
|
|
691
|
+
return this.debug("external_translation_deduped", {
|
|
692
|
+
key: r.externalRequest.key,
|
|
693
|
+
cacheKey: r.cacheKey
|
|
694
|
+
}), s;
|
|
695
|
+
const a = this.executeTranslation(r);
|
|
696
|
+
return this.inFlight.set(r.cacheKey, a), a;
|
|
697
|
+
}
|
|
698
|
+
normalizeRequest(e) {
|
|
699
|
+
const r = e.sourceLanguage ?? dn, n = {
|
|
700
|
+
text: e.text,
|
|
701
|
+
sourceLanguage: r,
|
|
702
|
+
targetLanguage: e.targetLanguage,
|
|
703
|
+
glossary: e.glossary
|
|
704
|
+
}, s = this.createCacheKey(n), a = He(e.timeoutMs) ? e.timeoutMs : this.config.timeoutMs;
|
|
705
|
+
return {
|
|
706
|
+
externalRequest: {
|
|
707
|
+
key: e.key,
|
|
708
|
+
text: e.text,
|
|
709
|
+
targetLanguage: e.targetLanguage,
|
|
710
|
+
sourceLanguage: r
|
|
711
|
+
},
|
|
712
|
+
translateRequest: n,
|
|
713
|
+
cacheKey: s,
|
|
714
|
+
timeoutMs: a,
|
|
715
|
+
signal: e.signal
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
async shouldTranslate(e) {
|
|
719
|
+
if (!this.config.shouldTranslate)
|
|
720
|
+
return !0;
|
|
721
|
+
try {
|
|
722
|
+
return this.config.shouldTranslate(e);
|
|
723
|
+
} catch (r) {
|
|
724
|
+
return this.warn("external_translation_should_translate_error", {
|
|
725
|
+
key: e.key,
|
|
726
|
+
language: e.targetLanguage,
|
|
727
|
+
error: r
|
|
728
|
+
}), !0;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
async executeTranslation(e) {
|
|
732
|
+
try {
|
|
733
|
+
if (!await this.invokeExternalTranslationHook(e.externalRequest)) {
|
|
734
|
+
this.debug("external_translation_vetoed", {
|
|
735
|
+
key: e.externalRequest.key,
|
|
736
|
+
targetLanguage: e.externalRequest.targetLanguage
|
|
737
|
+
});
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
this.debug("external_translation_started", {
|
|
741
|
+
key: e.externalRequest.key,
|
|
742
|
+
cacheKey: e.cacheKey
|
|
743
|
+
});
|
|
744
|
+
const r = await this.translateWithTimeout(
|
|
745
|
+
e.translateRequest,
|
|
746
|
+
e.timeoutMs,
|
|
747
|
+
e.signal
|
|
748
|
+
);
|
|
749
|
+
return this.writeToCache(e.cacheKey, r), this.notifyTranslationComplete(r), this.debug("external_translation_succeeded", {
|
|
750
|
+
key: e.externalRequest.key,
|
|
751
|
+
cacheKey: e.cacheKey
|
|
752
|
+
}), r;
|
|
753
|
+
} catch (r) {
|
|
754
|
+
const n = this.normalizeError(r);
|
|
755
|
+
this.handleTranslationError(e, n);
|
|
756
|
+
return;
|
|
757
|
+
} finally {
|
|
758
|
+
this.inFlight.delete(e.cacheKey);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
async invokeExternalTranslationHook(e) {
|
|
762
|
+
const r = this.config.onExternalTranslation;
|
|
763
|
+
if (!r)
|
|
764
|
+
return !0;
|
|
765
|
+
try {
|
|
766
|
+
const n = await r(e);
|
|
767
|
+
return typeof n == "boolean" ? n : !0;
|
|
768
|
+
} catch (n) {
|
|
769
|
+
return this.warn("external_translation_hook_error", {
|
|
770
|
+
key: e.key,
|
|
771
|
+
language: e.targetLanguage,
|
|
772
|
+
error: n
|
|
773
|
+
}), !0;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
async translateWithTimeout(e, r, n) {
|
|
777
|
+
if (!(typeof AbortController == "function"))
|
|
778
|
+
return this.provider.translate(e, {
|
|
779
|
+
timeoutMs: He(r) ? r : void 0,
|
|
780
|
+
signal: n
|
|
781
|
+
});
|
|
782
|
+
const a = new AbortController();
|
|
783
|
+
let i = !1, l;
|
|
784
|
+
n && (n.aborted ? a.abort() : (l = () => {
|
|
785
|
+
a.abort();
|
|
786
|
+
}, n.addEventListener("abort", l, { once: !0 })));
|
|
787
|
+
const f = He(r) && r ? setTimeout(() => {
|
|
788
|
+
i = !0, a.abort();
|
|
789
|
+
}, r) : void 0;
|
|
790
|
+
try {
|
|
791
|
+
return await this.provider.translate(e, {
|
|
792
|
+
timeoutMs: He(r) ? r : void 0,
|
|
793
|
+
signal: a.signal
|
|
794
|
+
});
|
|
795
|
+
} catch (d) {
|
|
796
|
+
throw i ? new Bt(
|
|
797
|
+
`External translation timed out after ${r}ms`
|
|
798
|
+
) : (a.signal.aborted && !i, d);
|
|
799
|
+
} finally {
|
|
800
|
+
f && clearTimeout(f), l && n && n.removeEventListener("abort", l);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
readFromCache(e) {
|
|
804
|
+
var r;
|
|
805
|
+
return (r = this.cache) == null ? void 0 : r.get(e);
|
|
806
|
+
}
|
|
807
|
+
writeToCache(e, r) {
|
|
808
|
+
var n;
|
|
809
|
+
(n = this.cache) == null || n.set(e, r);
|
|
810
|
+
}
|
|
811
|
+
handleTranslationError(e, r) {
|
|
812
|
+
const n = {
|
|
813
|
+
key: e.externalRequest.key,
|
|
814
|
+
language: e.externalRequest.targetLanguage,
|
|
815
|
+
originalText: e.externalRequest.text,
|
|
816
|
+
error: r
|
|
817
|
+
};
|
|
818
|
+
this.notifyTranslationError(n), this.warn("external_fallback_failed", {
|
|
819
|
+
provider: this.provider.type,
|
|
820
|
+
key: n.key,
|
|
821
|
+
language: n.language,
|
|
822
|
+
errorCode: r.code,
|
|
823
|
+
retryable: r.retryable,
|
|
824
|
+
message: r.message,
|
|
825
|
+
details: r.details
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
normalizeError(e) {
|
|
829
|
+
return this.provider.normalizeError ? this.provider.normalizeError(e) : e instanceof Bt ? {
|
|
830
|
+
code: "timeout",
|
|
831
|
+
message: e.message,
|
|
832
|
+
retryable: !0,
|
|
833
|
+
details: e
|
|
834
|
+
} : e instanceof Error ? {
|
|
835
|
+
code: e.name || "unknown_error",
|
|
836
|
+
message: e.message,
|
|
837
|
+
retryable: !1,
|
|
838
|
+
details: e
|
|
839
|
+
} : {
|
|
840
|
+
code: "unknown_error",
|
|
841
|
+
message: "Unknown provider error",
|
|
842
|
+
retryable: !1,
|
|
843
|
+
details: e
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
createCacheKey(e) {
|
|
847
|
+
return [
|
|
848
|
+
e.sourceLanguage,
|
|
849
|
+
e.targetLanguage,
|
|
850
|
+
this.hashText(e.text, e.glossary)
|
|
851
|
+
].join("|");
|
|
852
|
+
}
|
|
853
|
+
hashText(e, r) {
|
|
854
|
+
let n = 2166136261;
|
|
855
|
+
const s = r && Object.keys(r).length > 0 ? `${e}|${JSON.stringify(hn(r))}` : e;
|
|
856
|
+
for (let a = 0; a < s.length; a += 1)
|
|
857
|
+
n ^= s.charCodeAt(a), n += (n << 1) + (n << 4) + (n << 7) + (n << 8) + (n << 24);
|
|
858
|
+
return (n >>> 0).toString(16);
|
|
859
|
+
}
|
|
860
|
+
warn(e, r) {
|
|
861
|
+
const n = {
|
|
862
|
+
scope: "translator",
|
|
863
|
+
event: e,
|
|
864
|
+
...r
|
|
865
|
+
};
|
|
866
|
+
if (this.logger) {
|
|
867
|
+
this.logger.warn(e, n);
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
console.warn("[vbss-translator]", n);
|
|
871
|
+
}
|
|
872
|
+
debug(e, r) {
|
|
873
|
+
var s;
|
|
874
|
+
if (!this.config.debug)
|
|
875
|
+
return;
|
|
876
|
+
const n = {
|
|
877
|
+
scope: "translator",
|
|
878
|
+
event: e,
|
|
879
|
+
...r
|
|
880
|
+
};
|
|
881
|
+
if ((s = this.logger) != null && s.debug) {
|
|
882
|
+
this.logger.debug(e, n);
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
885
|
+
console.debug("[vbss-translator]", n);
|
|
886
|
+
}
|
|
887
|
+
notifyTranslationComplete(e) {
|
|
888
|
+
const r = this.config.onTranslationComplete;
|
|
889
|
+
if (r)
|
|
890
|
+
try {
|
|
891
|
+
r(e);
|
|
892
|
+
} catch (n) {
|
|
893
|
+
this.warn("external_translation_complete_callback_error", {
|
|
894
|
+
provider: this.provider.type,
|
|
895
|
+
error: n
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
notifyTranslationError(e) {
|
|
900
|
+
const r = this.config.onTranslationError;
|
|
901
|
+
if (r)
|
|
902
|
+
try {
|
|
903
|
+
r(e);
|
|
904
|
+
} catch (n) {
|
|
905
|
+
this.warn("external_translation_error_callback_error", {
|
|
906
|
+
provider: this.provider.type,
|
|
907
|
+
key: e.key,
|
|
908
|
+
language: e.language,
|
|
909
|
+
error: n
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
const ct = () => Date.now(), Ke = (t) => typeof t == "number" && Number.isFinite(t) && t > 0;
|
|
915
|
+
class gn {
|
|
916
|
+
constructor(e) {
|
|
917
|
+
te(this, "store", /* @__PURE__ */ new Map());
|
|
918
|
+
te(this, "enabled");
|
|
919
|
+
te(this, "ttlMs");
|
|
920
|
+
te(this, "maxEntries");
|
|
921
|
+
this.enabled = e.enabled, this.ttlMs = Math.max(0, e.ttlMs), this.maxEntries = e.maxEntries;
|
|
922
|
+
}
|
|
923
|
+
isEnabled() {
|
|
924
|
+
return this.enabled;
|
|
925
|
+
}
|
|
926
|
+
setEnabled(e) {
|
|
927
|
+
e || this.clear(), this.enabled = e;
|
|
928
|
+
}
|
|
929
|
+
setTtl(e) {
|
|
930
|
+
this.ttlMs = Math.max(0, e);
|
|
931
|
+
}
|
|
932
|
+
size() {
|
|
933
|
+
return this.store.size;
|
|
934
|
+
}
|
|
935
|
+
clear() {
|
|
936
|
+
this.store.clear();
|
|
937
|
+
}
|
|
938
|
+
get(e) {
|
|
939
|
+
if (!this.enabled)
|
|
940
|
+
return;
|
|
941
|
+
const r = this.store.get(e);
|
|
942
|
+
if (r) {
|
|
943
|
+
if (this.isExpired(r)) {
|
|
944
|
+
this.store.delete(e);
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
return r.value;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
set(e, r, n) {
|
|
951
|
+
if (!this.enabled)
|
|
952
|
+
return;
|
|
953
|
+
const s = Ke(n) ? n : this.ttlMs, a = Ke(s) ? ct() + s : void 0;
|
|
954
|
+
this.store.set(e, {
|
|
955
|
+
value: r,
|
|
956
|
+
expiresAt: a,
|
|
957
|
+
insertedAt: ct()
|
|
958
|
+
}), this.enforceMaxEntries();
|
|
959
|
+
}
|
|
960
|
+
delete(e) {
|
|
961
|
+
this.store.delete(e);
|
|
962
|
+
}
|
|
963
|
+
has(e) {
|
|
964
|
+
if (!this.enabled)
|
|
965
|
+
return !1;
|
|
966
|
+
const r = this.store.get(e);
|
|
967
|
+
return r ? this.isExpired(r) ? (this.store.delete(e), !1) : !0 : !1;
|
|
968
|
+
}
|
|
969
|
+
entries() {
|
|
970
|
+
const e = [];
|
|
971
|
+
for (const [r, n] of this.store.entries()) {
|
|
972
|
+
if (this.isExpired(n)) {
|
|
973
|
+
this.store.delete(r);
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
e.push({
|
|
977
|
+
key: r,
|
|
978
|
+
result: n.value,
|
|
979
|
+
expiresAt: n.expiresAt
|
|
980
|
+
});
|
|
981
|
+
}
|
|
982
|
+
return e;
|
|
983
|
+
}
|
|
984
|
+
prune() {
|
|
985
|
+
for (const [e, r] of this.store.entries())
|
|
986
|
+
this.isExpired(r) && this.store.delete(e);
|
|
987
|
+
}
|
|
988
|
+
enforceMaxEntries() {
|
|
989
|
+
if (!Ke(this.maxEntries))
|
|
990
|
+
return;
|
|
991
|
+
const e = this.maxEntries;
|
|
992
|
+
for (; this.store.size > e; ) {
|
|
993
|
+
const r = this.findOldestKey();
|
|
994
|
+
if (!r)
|
|
995
|
+
break;
|
|
996
|
+
this.store.delete(r);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
findOldestKey() {
|
|
1000
|
+
let e, r = Number.POSITIVE_INFINITY;
|
|
1001
|
+
for (const [n, s] of this.store.entries())
|
|
1002
|
+
s.insertedAt < r && (e = n, r = s.insertedAt);
|
|
1003
|
+
return e;
|
|
1004
|
+
}
|
|
1005
|
+
isExpired(e) {
|
|
1006
|
+
return Ke(e.expiresAt) ? e.expiresAt <= ct() : !1;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
function lr(t, e) {
|
|
1010
|
+
return function() {
|
|
1011
|
+
return t.apply(e, arguments);
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
const { toString: mn } = Object.prototype, { getPrototypeOf: Ge } = Object, { iterator: Xe, toStringTag: cr } = Symbol, Qe = /* @__PURE__ */ ((t) => (e) => {
|
|
1015
|
+
const r = mn.call(e);
|
|
1016
|
+
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
1017
|
+
})(/* @__PURE__ */ Object.create(null)), ae = (t) => (t = t.toLowerCase(), (e) => Qe(e) === t), Ze = (t) => (e) => typeof e === t, { isArray: _e } = Array, ve = Ze("undefined");
|
|
1018
|
+
function ke(t) {
|
|
1019
|
+
return t !== null && !ve(t) && t.constructor !== null && !ve(t.constructor) && X(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
1020
|
+
}
|
|
1021
|
+
const ur = ae("ArrayBuffer");
|
|
1022
|
+
function yn(t) {
|
|
1023
|
+
let e;
|
|
1024
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && ur(t.buffer), e;
|
|
1025
|
+
}
|
|
1026
|
+
const bn = Ze("string"), X = Ze("function"), fr = Ze("number"), Le = (t) => t !== null && typeof t == "object", En = (t) => t === !0 || t === !1, We = (t) => {
|
|
1027
|
+
if (Qe(t) !== "object")
|
|
1028
|
+
return !1;
|
|
1029
|
+
const e = Ge(t);
|
|
1030
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(cr in t) && !(Xe in t);
|
|
1031
|
+
}, wn = (t) => {
|
|
1032
|
+
if (!Le(t) || ke(t))
|
|
1033
|
+
return !1;
|
|
1034
|
+
try {
|
|
1035
|
+
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
1036
|
+
} catch {
|
|
1037
|
+
return !1;
|
|
1038
|
+
}
|
|
1039
|
+
}, Rn = ae("Date"), Tn = ae("File"), vn = (t) => !!(t && typeof t.uri < "u"), _n = (t) => t && typeof t.getParts < "u", xn = ae("Blob"), On = ae("FileList"), Sn = (t) => Le(t) && X(t.pipe);
|
|
1040
|
+
function An() {
|
|
1041
|
+
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
1042
|
+
}
|
|
1043
|
+
const $t = An(), qt = typeof $t.FormData < "u" ? $t.FormData : void 0, Cn = (t) => {
|
|
1044
|
+
if (!t) return !1;
|
|
1045
|
+
if (qt && t instanceof qt) return !0;
|
|
1046
|
+
const e = Ge(t);
|
|
1047
|
+
if (!e || e === Object.prototype || !X(t.append)) return !1;
|
|
1048
|
+
const r = Qe(t);
|
|
1049
|
+
return r === "formdata" || // detect form-data instance
|
|
1050
|
+
r === "object" && X(t.toString) && t.toString() === "[object FormData]";
|
|
1051
|
+
}, Pn = ae("URLSearchParams"), [kn, Ln, Dn, Fn] = [
|
|
1052
|
+
"ReadableStream",
|
|
1053
|
+
"Request",
|
|
1054
|
+
"Response",
|
|
1055
|
+
"Headers"
|
|
1056
|
+
].map(ae), Nn = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1057
|
+
function De(t, e, { allOwnKeys: r = !1 } = {}) {
|
|
1058
|
+
if (t === null || typeof t > "u")
|
|
1059
|
+
return;
|
|
1060
|
+
let n, s;
|
|
1061
|
+
if (typeof t != "object" && (t = [t]), _e(t))
|
|
1062
|
+
for (n = 0, s = t.length; n < s; n++)
|
|
1063
|
+
e.call(null, t[n], n, t);
|
|
1064
|
+
else {
|
|
1065
|
+
if (ke(t))
|
|
1066
|
+
return;
|
|
1067
|
+
const a = r ? Object.getOwnPropertyNames(t) : Object.keys(t), i = a.length;
|
|
1068
|
+
let l;
|
|
1069
|
+
for (n = 0; n < i; n++)
|
|
1070
|
+
l = a[n], e.call(null, t[l], l, t);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
function dr(t, e) {
|
|
1074
|
+
if (ke(t))
|
|
1075
|
+
return null;
|
|
1076
|
+
e = e.toLowerCase();
|
|
1077
|
+
const r = Object.keys(t);
|
|
1078
|
+
let n = r.length, s;
|
|
1079
|
+
for (; n-- > 0; )
|
|
1080
|
+
if (s = r[n], e === s.toLowerCase())
|
|
1081
|
+
return s;
|
|
1082
|
+
return null;
|
|
1083
|
+
}
|
|
1084
|
+
const ge = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, hr = (t) => !ve(t) && t !== ge;
|
|
1085
|
+
function gt() {
|
|
1086
|
+
const { caseless: t, skipUndefined: e } = hr(this) && this || {}, r = {}, n = (s, a) => {
|
|
1087
|
+
if (a === "__proto__" || a === "constructor" || a === "prototype")
|
|
1088
|
+
return;
|
|
1089
|
+
const i = t && dr(r, a) || a;
|
|
1090
|
+
We(r[i]) && We(s) ? r[i] = gt(r[i], s) : We(s) ? r[i] = gt({}, s) : _e(s) ? r[i] = s.slice() : (!e || !ve(s)) && (r[i] = s);
|
|
1091
|
+
};
|
|
1092
|
+
for (let s = 0, a = arguments.length; s < a; s++)
|
|
1093
|
+
arguments[s] && De(arguments[s], n);
|
|
1094
|
+
return r;
|
|
1095
|
+
}
|
|
1096
|
+
const jn = (t, e, r, { allOwnKeys: n } = {}) => (De(
|
|
1097
|
+
e,
|
|
1098
|
+
(s, a) => {
|
|
1099
|
+
r && X(s) ? Object.defineProperty(t, a, {
|
|
1100
|
+
value: lr(s, r),
|
|
1101
|
+
writable: !0,
|
|
1102
|
+
enumerable: !0,
|
|
1103
|
+
configurable: !0
|
|
1104
|
+
}) : Object.defineProperty(t, a, {
|
|
1105
|
+
value: s,
|
|
1106
|
+
writable: !0,
|
|
1107
|
+
enumerable: !0,
|
|
1108
|
+
configurable: !0
|
|
1109
|
+
});
|
|
1110
|
+
},
|
|
1111
|
+
{ allOwnKeys: n }
|
|
1112
|
+
), t), Un = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), In = (t, e, r, n) => {
|
|
1113
|
+
t.prototype = Object.create(e.prototype, n), Object.defineProperty(t.prototype, "constructor", {
|
|
1114
|
+
value: t,
|
|
1115
|
+
writable: !0,
|
|
1116
|
+
enumerable: !1,
|
|
1117
|
+
configurable: !0
|
|
1118
|
+
}), Object.defineProperty(t, "super", {
|
|
1119
|
+
value: e.prototype
|
|
1120
|
+
}), r && Object.assign(t.prototype, r);
|
|
1121
|
+
}, Mn = (t, e, r, n) => {
|
|
1122
|
+
let s, a, i;
|
|
1123
|
+
const l = {};
|
|
1124
|
+
if (e = e || {}, t == null) return e;
|
|
1125
|
+
do {
|
|
1126
|
+
for (s = Object.getOwnPropertyNames(t), a = s.length; a-- > 0; )
|
|
1127
|
+
i = s[a], (!n || n(i, t, e)) && !l[i] && (e[i] = t[i], l[i] = !0);
|
|
1128
|
+
t = r !== !1 && Ge(t);
|
|
1129
|
+
} while (t && (!r || r(t, e)) && t !== Object.prototype);
|
|
1130
|
+
return e;
|
|
1131
|
+
}, Bn = (t, e, r) => {
|
|
1132
|
+
t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
|
|
1133
|
+
const n = t.indexOf(e, r);
|
|
1134
|
+
return n !== -1 && n === r;
|
|
1135
|
+
}, $n = (t) => {
|
|
1136
|
+
if (!t) return null;
|
|
1137
|
+
if (_e(t)) return t;
|
|
1138
|
+
let e = t.length;
|
|
1139
|
+
if (!fr(e)) return null;
|
|
1140
|
+
const r = new Array(e);
|
|
1141
|
+
for (; e-- > 0; )
|
|
1142
|
+
r[e] = t[e];
|
|
1143
|
+
return r;
|
|
1144
|
+
}, qn = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && Ge(Uint8Array)), Hn = (t, e) => {
|
|
1145
|
+
const n = (t && t[Xe]).call(t);
|
|
1146
|
+
let s;
|
|
1147
|
+
for (; (s = n.next()) && !s.done; ) {
|
|
1148
|
+
const a = s.value;
|
|
1149
|
+
e.call(t, a[0], a[1]);
|
|
1150
|
+
}
|
|
1151
|
+
}, Kn = (t, e) => {
|
|
1152
|
+
let r;
|
|
1153
|
+
const n = [];
|
|
1154
|
+
for (; (r = t.exec(e)) !== null; )
|
|
1155
|
+
n.push(r);
|
|
1156
|
+
return n;
|
|
1157
|
+
}, Vn = ae("HTMLFormElement"), Wn = (t) => t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(r, n, s) {
|
|
1158
|
+
return n.toUpperCase() + s;
|
|
1159
|
+
}), Ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), zn = ae("RegExp"), pr = (t, e) => {
|
|
1160
|
+
const r = Object.getOwnPropertyDescriptors(t), n = {};
|
|
1161
|
+
De(r, (s, a) => {
|
|
1162
|
+
let i;
|
|
1163
|
+
(i = e(s, a, t)) !== !1 && (n[a] = i || s);
|
|
1164
|
+
}), Object.defineProperties(t, n);
|
|
1165
|
+
}, Jn = (t) => {
|
|
1166
|
+
pr(t, (e, r) => {
|
|
1167
|
+
if (X(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
1168
|
+
return !1;
|
|
1169
|
+
const n = t[r];
|
|
1170
|
+
if (X(n)) {
|
|
1171
|
+
if (e.enumerable = !1, "writable" in e) {
|
|
1172
|
+
e.writable = !1;
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
e.set || (e.set = () => {
|
|
1176
|
+
throw Error("Can not rewrite read-only method '" + r + "'");
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
}, Yn = (t, e) => {
|
|
1181
|
+
const r = {}, n = (s) => {
|
|
1182
|
+
s.forEach((a) => {
|
|
1183
|
+
r[a] = !0;
|
|
1184
|
+
});
|
|
1185
|
+
};
|
|
1186
|
+
return _e(t) ? n(t) : n(String(t).split(e)), r;
|
|
1187
|
+
}, Gn = () => {
|
|
1188
|
+
}, Xn = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
1189
|
+
function Qn(t) {
|
|
1190
|
+
return !!(t && X(t.append) && t[cr] === "FormData" && t[Xe]);
|
|
1191
|
+
}
|
|
1192
|
+
const Zn = (t) => {
|
|
1193
|
+
const e = new Array(10), r = (n, s) => {
|
|
1194
|
+
if (Le(n)) {
|
|
1195
|
+
if (e.indexOf(n) >= 0)
|
|
1196
|
+
return;
|
|
1197
|
+
if (ke(n))
|
|
1198
|
+
return n;
|
|
1199
|
+
if (!("toJSON" in n)) {
|
|
1200
|
+
e[s] = n;
|
|
1201
|
+
const a = _e(n) ? [] : {};
|
|
1202
|
+
return De(n, (i, l) => {
|
|
1203
|
+
const f = r(i, s + 1);
|
|
1204
|
+
!ve(f) && (a[l] = f);
|
|
1205
|
+
}), e[s] = void 0, a;
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
return n;
|
|
1209
|
+
};
|
|
1210
|
+
return r(t, 0);
|
|
1211
|
+
}, es = ae("AsyncFunction"), ts = (t) => t && (Le(t) || X(t)) && X(t.then) && X(t.catch), gr = ((t, e) => t ? setImmediate : e ? ((r, n) => (ge.addEventListener(
|
|
1212
|
+
"message",
|
|
1213
|
+
({ source: s, data: a }) => {
|
|
1214
|
+
s === ge && a === r && n.length && n.shift()();
|
|
1215
|
+
},
|
|
1216
|
+
!1
|
|
1217
|
+
), (s) => {
|
|
1218
|
+
n.push(s), ge.postMessage(r, "*");
|
|
1219
|
+
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(typeof setImmediate == "function", X(ge.postMessage)), rs = typeof queueMicrotask < "u" ? queueMicrotask.bind(ge) : typeof process < "u" && process.nextTick || gr, ns = (t) => t != null && X(t[Xe]), c = {
|
|
1220
|
+
isArray: _e,
|
|
1221
|
+
isArrayBuffer: ur,
|
|
1222
|
+
isBuffer: ke,
|
|
1223
|
+
isFormData: Cn,
|
|
1224
|
+
isArrayBufferView: yn,
|
|
1225
|
+
isString: bn,
|
|
1226
|
+
isNumber: fr,
|
|
1227
|
+
isBoolean: En,
|
|
1228
|
+
isObject: Le,
|
|
1229
|
+
isPlainObject: We,
|
|
1230
|
+
isEmptyObject: wn,
|
|
1231
|
+
isReadableStream: kn,
|
|
1232
|
+
isRequest: Ln,
|
|
1233
|
+
isResponse: Dn,
|
|
1234
|
+
isHeaders: Fn,
|
|
1235
|
+
isUndefined: ve,
|
|
1236
|
+
isDate: Rn,
|
|
1237
|
+
isFile: Tn,
|
|
1238
|
+
isReactNativeBlob: vn,
|
|
1239
|
+
isReactNative: _n,
|
|
1240
|
+
isBlob: xn,
|
|
1241
|
+
isRegExp: zn,
|
|
1242
|
+
isFunction: X,
|
|
1243
|
+
isStream: Sn,
|
|
1244
|
+
isURLSearchParams: Pn,
|
|
1245
|
+
isTypedArray: qn,
|
|
1246
|
+
isFileList: On,
|
|
1247
|
+
forEach: De,
|
|
1248
|
+
merge: gt,
|
|
1249
|
+
extend: jn,
|
|
1250
|
+
trim: Nn,
|
|
1251
|
+
stripBOM: Un,
|
|
1252
|
+
inherits: In,
|
|
1253
|
+
toFlatObject: Mn,
|
|
1254
|
+
kindOf: Qe,
|
|
1255
|
+
kindOfTest: ae,
|
|
1256
|
+
endsWith: Bn,
|
|
1257
|
+
toArray: $n,
|
|
1258
|
+
forEachEntry: Hn,
|
|
1259
|
+
matchAll: Kn,
|
|
1260
|
+
isHTMLForm: Vn,
|
|
1261
|
+
hasOwnProperty: Ht,
|
|
1262
|
+
hasOwnProp: Ht,
|
|
1263
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1264
|
+
reduceDescriptors: pr,
|
|
1265
|
+
freezeMethods: Jn,
|
|
1266
|
+
toObjectSet: Yn,
|
|
1267
|
+
toCamelCase: Wn,
|
|
1268
|
+
noop: Gn,
|
|
1269
|
+
toFiniteNumber: Xn,
|
|
1270
|
+
findKey: dr,
|
|
1271
|
+
global: ge,
|
|
1272
|
+
isContextDefined: hr,
|
|
1273
|
+
isSpecCompliantForm: Qn,
|
|
1274
|
+
toJSONObject: Zn,
|
|
1275
|
+
isAsyncFn: es,
|
|
1276
|
+
isThenable: ts,
|
|
1277
|
+
setImmediate: gr,
|
|
1278
|
+
asap: rs,
|
|
1279
|
+
isIterable: ns
|
|
1280
|
+
};
|
|
1281
|
+
let w = class mr extends Error {
|
|
1282
|
+
static from(e, r, n, s, a, i) {
|
|
1283
|
+
const l = new mr(e.message, r || e.code, n, s, a);
|
|
1284
|
+
return l.cause = e, l.name = e.name, e.status != null && l.status == null && (l.status = e.status), i && Object.assign(l, i), l;
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
1288
|
+
*
|
|
1289
|
+
* @param {string} message The error message.
|
|
1290
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
1291
|
+
* @param {Object} [config] The config.
|
|
1292
|
+
* @param {Object} [request] The request.
|
|
1293
|
+
* @param {Object} [response] The response.
|
|
1294
|
+
*
|
|
1295
|
+
* @returns {Error} The created error.
|
|
1296
|
+
*/
|
|
1297
|
+
constructor(e, r, n, s, a) {
|
|
1298
|
+
super(e), Object.defineProperty(this, "message", {
|
|
1299
|
+
value: e,
|
|
1300
|
+
enumerable: !0,
|
|
1301
|
+
writable: !0,
|
|
1302
|
+
configurable: !0
|
|
1303
|
+
}), this.name = "AxiosError", this.isAxiosError = !0, r && (this.code = r), n && (this.config = n), s && (this.request = s), a && (this.response = a, this.status = a.status);
|
|
1304
|
+
}
|
|
1305
|
+
toJSON() {
|
|
1306
|
+
return {
|
|
1307
|
+
// Standard
|
|
1308
|
+
message: this.message,
|
|
1309
|
+
name: this.name,
|
|
1310
|
+
// Microsoft
|
|
1311
|
+
description: this.description,
|
|
1312
|
+
number: this.number,
|
|
1313
|
+
// Mozilla
|
|
1314
|
+
fileName: this.fileName,
|
|
1315
|
+
lineNumber: this.lineNumber,
|
|
1316
|
+
columnNumber: this.columnNumber,
|
|
1317
|
+
stack: this.stack,
|
|
1318
|
+
// Axios
|
|
1319
|
+
config: c.toJSONObject(this.config),
|
|
1320
|
+
code: this.code,
|
|
1321
|
+
status: this.status
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1325
|
+
w.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
1326
|
+
w.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
1327
|
+
w.ECONNABORTED = "ECONNABORTED";
|
|
1328
|
+
w.ETIMEDOUT = "ETIMEDOUT";
|
|
1329
|
+
w.ERR_NETWORK = "ERR_NETWORK";
|
|
1330
|
+
w.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
1331
|
+
w.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
1332
|
+
w.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
1333
|
+
w.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
1334
|
+
w.ERR_CANCELED = "ERR_CANCELED";
|
|
1335
|
+
w.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
1336
|
+
w.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
1337
|
+
w.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED";
|
|
1338
|
+
const ss = null;
|
|
1339
|
+
function mt(t) {
|
|
1340
|
+
return c.isPlainObject(t) || c.isArray(t);
|
|
1341
|
+
}
|
|
1342
|
+
function yr(t) {
|
|
1343
|
+
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
1344
|
+
}
|
|
1345
|
+
function ut(t, e, r) {
|
|
1346
|
+
return t ? t.concat(e).map(function(s, a) {
|
|
1347
|
+
return s = yr(s), !r && a ? "[" + s + "]" : s;
|
|
1348
|
+
}).join(r ? "." : "") : e;
|
|
1349
|
+
}
|
|
1350
|
+
function os(t) {
|
|
1351
|
+
return c.isArray(t) && !t.some(mt);
|
|
1352
|
+
}
|
|
1353
|
+
const as = c.toFlatObject(c, {}, null, function(e) {
|
|
1354
|
+
return /^is[A-Z]/.test(e);
|
|
1355
|
+
});
|
|
1356
|
+
function et(t, e, r) {
|
|
1357
|
+
if (!c.isObject(t))
|
|
1358
|
+
throw new TypeError("target must be an object");
|
|
1359
|
+
e = e || new FormData(), r = c.toFlatObject(
|
|
1360
|
+
r,
|
|
1361
|
+
{
|
|
1362
|
+
metaTokens: !0,
|
|
1363
|
+
dots: !1,
|
|
1364
|
+
indexes: !1
|
|
1365
|
+
},
|
|
1366
|
+
!1,
|
|
1367
|
+
function(g, A) {
|
|
1368
|
+
return !c.isUndefined(A[g]);
|
|
1369
|
+
}
|
|
1370
|
+
);
|
|
1371
|
+
const n = r.metaTokens, s = r.visitor || h, a = r.dots, i = r.indexes, l = r.Blob || typeof Blob < "u" && Blob, f = r.maxDepth === void 0 ? 100 : r.maxDepth, d = l && c.isSpecCompliantForm(e);
|
|
1372
|
+
if (!c.isFunction(s))
|
|
1373
|
+
throw new TypeError("visitor must be a function");
|
|
1374
|
+
function u(y) {
|
|
1375
|
+
if (y === null) return "";
|
|
1376
|
+
if (c.isDate(y))
|
|
1377
|
+
return y.toISOString();
|
|
1378
|
+
if (c.isBoolean(y))
|
|
1379
|
+
return y.toString();
|
|
1380
|
+
if (!d && c.isBlob(y))
|
|
1381
|
+
throw new w("Blob is not supported. Use a Buffer instead.");
|
|
1382
|
+
return c.isArrayBuffer(y) || c.isTypedArray(y) ? d && typeof Blob == "function" ? new Blob([y]) : Buffer.from(y) : y;
|
|
1383
|
+
}
|
|
1384
|
+
function h(y, g, A) {
|
|
1385
|
+
let L = y;
|
|
1386
|
+
if (c.isReactNative(e) && c.isReactNativeBlob(y))
|
|
1387
|
+
return e.append(ut(A, g, a), u(y)), !1;
|
|
1388
|
+
if (y && !A && typeof y == "object") {
|
|
1389
|
+
if (c.endsWith(g, "{}"))
|
|
1390
|
+
g = n ? g : g.slice(0, -2), y = JSON.stringify(y);
|
|
1391
|
+
else if (c.isArray(y) && os(y) || (c.isFileList(y) || c.endsWith(g, "[]")) && (L = c.toArray(y)))
|
|
1392
|
+
return g = yr(g), L.forEach(function(C, $) {
|
|
1393
|
+
!(c.isUndefined(C) || C === null) && e.append(
|
|
1394
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1395
|
+
i === !0 ? ut([g], $, a) : i === null ? g : g + "[]",
|
|
1396
|
+
u(C)
|
|
1397
|
+
);
|
|
1398
|
+
}), !1;
|
|
1399
|
+
}
|
|
1400
|
+
return mt(y) ? !0 : (e.append(ut(A, g, a), u(y)), !1);
|
|
1401
|
+
}
|
|
1402
|
+
const _ = [], k = Object.assign(as, {
|
|
1403
|
+
defaultVisitor: h,
|
|
1404
|
+
convertValue: u,
|
|
1405
|
+
isVisitable: mt
|
|
1406
|
+
});
|
|
1407
|
+
function m(y, g, A = 0) {
|
|
1408
|
+
if (!c.isUndefined(y)) {
|
|
1409
|
+
if (A > f)
|
|
1410
|
+
throw new w(
|
|
1411
|
+
"Object is too deeply nested (" + A + " levels). Max depth: " + f,
|
|
1412
|
+
w.ERR_FORM_DATA_DEPTH_EXCEEDED
|
|
1413
|
+
);
|
|
1414
|
+
if (_.indexOf(y) !== -1)
|
|
1415
|
+
throw Error("Circular reference detected in " + g.join("."));
|
|
1416
|
+
_.push(y), c.forEach(y, function(D, C) {
|
|
1417
|
+
(!(c.isUndefined(D) || D === null) && s.call(e, D, c.isString(C) ? C.trim() : C, g, k)) === !0 && m(D, g ? g.concat(C) : [C], A + 1);
|
|
1418
|
+
}), _.pop();
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
if (!c.isObject(t))
|
|
1422
|
+
throw new TypeError("data must be an object");
|
|
1423
|
+
return m(t), e;
|
|
1424
|
+
}
|
|
1425
|
+
function Kt(t) {
|
|
1426
|
+
const e = {
|
|
1427
|
+
"!": "%21",
|
|
1428
|
+
"'": "%27",
|
|
1429
|
+
"(": "%28",
|
|
1430
|
+
")": "%29",
|
|
1431
|
+
"~": "%7E",
|
|
1432
|
+
"%20": "+"
|
|
659
1433
|
};
|
|
660
|
-
return
|
|
661
|
-
|
|
1434
|
+
return encodeURIComponent(t).replace(/[!'()~]|%20/g, function(n) {
|
|
1435
|
+
return e[n];
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
function Et(t, e) {
|
|
1439
|
+
this._pairs = [], t && et(t, this, e);
|
|
1440
|
+
}
|
|
1441
|
+
const br = Et.prototype;
|
|
1442
|
+
br.append = function(e, r) {
|
|
1443
|
+
this._pairs.push([e, r]);
|
|
1444
|
+
};
|
|
1445
|
+
br.toString = function(e) {
|
|
1446
|
+
const r = e ? function(n) {
|
|
1447
|
+
return e.call(this, n, Kt);
|
|
1448
|
+
} : Kt;
|
|
1449
|
+
return this._pairs.map(function(s) {
|
|
1450
|
+
return r(s[0]) + "=" + r(s[1]);
|
|
1451
|
+
}, "").join("&");
|
|
1452
|
+
};
|
|
1453
|
+
function is(t) {
|
|
1454
|
+
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
1455
|
+
}
|
|
1456
|
+
function Er(t, e, r) {
|
|
1457
|
+
if (!e)
|
|
1458
|
+
return t;
|
|
1459
|
+
const n = r && r.encode || is, s = c.isFunction(r) ? {
|
|
1460
|
+
serialize: r
|
|
1461
|
+
} : r, a = s && s.serialize;
|
|
1462
|
+
let i;
|
|
1463
|
+
if (a ? i = a(e, s) : i = c.isURLSearchParams(e) ? e.toString() : new Et(e, s).toString(n), i) {
|
|
1464
|
+
const l = t.indexOf("#");
|
|
1465
|
+
l !== -1 && (t = t.slice(0, l)), t += (t.indexOf("?") === -1 ? "?" : "&") + i;
|
|
1466
|
+
}
|
|
1467
|
+
return t;
|
|
1468
|
+
}
|
|
1469
|
+
class Vt {
|
|
1470
|
+
constructor() {
|
|
1471
|
+
this.handlers = [];
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* Add a new interceptor to the stack
|
|
1475
|
+
*
|
|
1476
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1477
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1478
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
1479
|
+
*
|
|
1480
|
+
* @return {Number} An ID used to remove interceptor later
|
|
1481
|
+
*/
|
|
1482
|
+
use(e, r, n) {
|
|
1483
|
+
return this.handlers.push({
|
|
1484
|
+
fulfilled: e,
|
|
1485
|
+
rejected: r,
|
|
1486
|
+
synchronous: n ? n.synchronous : !1,
|
|
1487
|
+
runWhen: n ? n.runWhen : null
|
|
1488
|
+
}), this.handlers.length - 1;
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Remove an interceptor from the stack
|
|
1492
|
+
*
|
|
1493
|
+
* @param {Number} id The ID that was returned by `use`
|
|
1494
|
+
*
|
|
1495
|
+
* @returns {void}
|
|
1496
|
+
*/
|
|
1497
|
+
eject(e) {
|
|
1498
|
+
this.handlers[e] && (this.handlers[e] = null);
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* Clear all interceptors from the stack
|
|
1502
|
+
*
|
|
1503
|
+
* @returns {void}
|
|
1504
|
+
*/
|
|
1505
|
+
clear() {
|
|
1506
|
+
this.handlers && (this.handlers = []);
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Iterate over all the registered interceptors
|
|
1510
|
+
*
|
|
1511
|
+
* This method is particularly useful for skipping over any
|
|
1512
|
+
* interceptors that may have become `null` calling `eject`.
|
|
1513
|
+
*
|
|
1514
|
+
* @param {Function} fn The function to call for each interceptor
|
|
1515
|
+
*
|
|
1516
|
+
* @returns {void}
|
|
1517
|
+
*/
|
|
1518
|
+
forEach(e) {
|
|
1519
|
+
c.forEach(this.handlers, function(n) {
|
|
1520
|
+
n !== null && e(n);
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
const wt = {
|
|
1525
|
+
silentJSONParsing: !0,
|
|
1526
|
+
forcedJSONParsing: !0,
|
|
1527
|
+
clarifyTimeoutError: !1,
|
|
1528
|
+
legacyInterceptorReqResOrdering: !0
|
|
1529
|
+
}, ls = typeof URLSearchParams < "u" ? URLSearchParams : Et, cs = typeof FormData < "u" ? FormData : null, us = typeof Blob < "u" ? Blob : null, fs = {
|
|
1530
|
+
isBrowser: !0,
|
|
1531
|
+
classes: {
|
|
1532
|
+
URLSearchParams: ls,
|
|
1533
|
+
FormData: cs,
|
|
1534
|
+
Blob: us
|
|
1535
|
+
},
|
|
1536
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
1537
|
+
}, Rt = typeof window < "u" && typeof document < "u", yt = typeof navigator == "object" && navigator || void 0, ds = Rt && (!yt || ["ReactNative", "NativeScript", "NS"].indexOf(yt.product) < 0), hs = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
1538
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", ps = Rt && window.location.href || "http://localhost", gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1539
|
+
__proto__: null,
|
|
1540
|
+
hasBrowserEnv: Rt,
|
|
1541
|
+
hasStandardBrowserEnv: ds,
|
|
1542
|
+
hasStandardBrowserWebWorkerEnv: hs,
|
|
1543
|
+
navigator: yt,
|
|
1544
|
+
origin: ps
|
|
1545
|
+
}, Symbol.toStringTag, { value: "Module" })), V = {
|
|
1546
|
+
...gs,
|
|
1547
|
+
...fs
|
|
1548
|
+
};
|
|
1549
|
+
function ms(t, e) {
|
|
1550
|
+
return et(t, new V.classes.URLSearchParams(), {
|
|
1551
|
+
visitor: function(r, n, s, a) {
|
|
1552
|
+
return V.isNode && c.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : a.defaultVisitor.apply(this, arguments);
|
|
1553
|
+
},
|
|
1554
|
+
...e
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
function ys(t) {
|
|
1558
|
+
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
1559
|
+
}
|
|
1560
|
+
function bs(t) {
|
|
1561
|
+
const e = {}, r = Object.keys(t);
|
|
1562
|
+
let n;
|
|
1563
|
+
const s = r.length;
|
|
1564
|
+
let a;
|
|
1565
|
+
for (n = 0; n < s; n++)
|
|
1566
|
+
a = r[n], e[a] = t[a];
|
|
1567
|
+
return e;
|
|
1568
|
+
}
|
|
1569
|
+
function wr(t) {
|
|
1570
|
+
function e(r, n, s, a) {
|
|
1571
|
+
let i = r[a++];
|
|
1572
|
+
if (i === "__proto__") return !0;
|
|
1573
|
+
const l = Number.isFinite(+i), f = a >= r.length;
|
|
1574
|
+
return i = !i && c.isArray(s) ? s.length : i, f ? (c.hasOwnProp(s, i) ? s[i] = c.isArray(s[i]) ? s[i].concat(n) : [s[i], n] : s[i] = n, !l) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), e(r, n, s[i], a) && c.isArray(s[i]) && (s[i] = bs(s[i])), !l);
|
|
1575
|
+
}
|
|
1576
|
+
if (c.isFormData(t) && c.isFunction(t.entries)) {
|
|
1577
|
+
const r = {};
|
|
1578
|
+
return c.forEachEntry(t, (n, s) => {
|
|
1579
|
+
e(ys(n), s, r, 0);
|
|
1580
|
+
}), r;
|
|
1581
|
+
}
|
|
1582
|
+
return null;
|
|
1583
|
+
}
|
|
1584
|
+
const Te = (t, e) => t != null && c.hasOwnProp(t, e) ? t[e] : void 0;
|
|
1585
|
+
function Es(t, e, r) {
|
|
1586
|
+
if (c.isString(t))
|
|
1587
|
+
try {
|
|
1588
|
+
return (e || JSON.parse)(t), c.trim(t);
|
|
1589
|
+
} catch (n) {
|
|
1590
|
+
if (n.name !== "SyntaxError")
|
|
1591
|
+
throw n;
|
|
1592
|
+
}
|
|
1593
|
+
return (r || JSON.stringify)(t);
|
|
1594
|
+
}
|
|
1595
|
+
const Fe = {
|
|
1596
|
+
transitional: wt,
|
|
1597
|
+
adapter: ["xhr", "http", "fetch"],
|
|
1598
|
+
transformRequest: [
|
|
1599
|
+
function(e, r) {
|
|
1600
|
+
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, a = c.isObject(e);
|
|
1601
|
+
if (a && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
|
|
1602
|
+
return s ? JSON.stringify(wr(e)) : e;
|
|
1603
|
+
if (c.isArrayBuffer(e) || c.isBuffer(e) || c.isStream(e) || c.isFile(e) || c.isBlob(e) || c.isReadableStream(e))
|
|
1604
|
+
return e;
|
|
1605
|
+
if (c.isArrayBufferView(e))
|
|
1606
|
+
return e.buffer;
|
|
1607
|
+
if (c.isURLSearchParams(e))
|
|
1608
|
+
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
1609
|
+
let l;
|
|
1610
|
+
if (a) {
|
|
1611
|
+
const f = Te(this, "formSerializer");
|
|
1612
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1613
|
+
return ms(e, f).toString();
|
|
1614
|
+
if ((l = c.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
|
|
1615
|
+
const d = Te(this, "env"), u = d && d.FormData;
|
|
1616
|
+
return et(
|
|
1617
|
+
l ? { "files[]": e } : e,
|
|
1618
|
+
u && new u(),
|
|
1619
|
+
f
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
return a || s ? (r.setContentType("application/json", !1), Es(e)) : e;
|
|
1624
|
+
}
|
|
1625
|
+
],
|
|
1626
|
+
transformResponse: [
|
|
1627
|
+
function(e) {
|
|
1628
|
+
const r = Te(this, "transitional") || Fe.transitional, n = r && r.forcedJSONParsing, s = Te(this, "responseType"), a = s === "json";
|
|
1629
|
+
if (c.isResponse(e) || c.isReadableStream(e))
|
|
1630
|
+
return e;
|
|
1631
|
+
if (e && c.isString(e) && (n && !s || a)) {
|
|
1632
|
+
const l = !(r && r.silentJSONParsing) && a;
|
|
1633
|
+
try {
|
|
1634
|
+
return JSON.parse(e, Te(this, "parseReviver"));
|
|
1635
|
+
} catch (f) {
|
|
1636
|
+
if (l)
|
|
1637
|
+
throw f.name === "SyntaxError" ? w.from(f, w.ERR_BAD_RESPONSE, this, null, Te(this, "response")) : f;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
return e;
|
|
1641
|
+
}
|
|
1642
|
+
],
|
|
1643
|
+
/**
|
|
1644
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
1645
|
+
* timeout is not created.
|
|
1646
|
+
*/
|
|
1647
|
+
timeout: 0,
|
|
1648
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
1649
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
1650
|
+
maxContentLength: -1,
|
|
1651
|
+
maxBodyLength: -1,
|
|
1652
|
+
env: {
|
|
1653
|
+
FormData: V.classes.FormData,
|
|
1654
|
+
Blob: V.classes.Blob
|
|
1655
|
+
},
|
|
1656
|
+
validateStatus: function(e) {
|
|
1657
|
+
return e >= 200 && e < 300;
|
|
1658
|
+
},
|
|
1659
|
+
headers: {
|
|
1660
|
+
common: {
|
|
1661
|
+
Accept: "application/json, text/plain, */*",
|
|
1662
|
+
"Content-Type": void 0
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
c.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
1667
|
+
Fe.headers[t] = {};
|
|
1668
|
+
});
|
|
1669
|
+
const ws = c.toObjectSet([
|
|
1670
|
+
"age",
|
|
1671
|
+
"authorization",
|
|
1672
|
+
"content-length",
|
|
1673
|
+
"content-type",
|
|
1674
|
+
"etag",
|
|
1675
|
+
"expires",
|
|
1676
|
+
"from",
|
|
1677
|
+
"host",
|
|
1678
|
+
"if-modified-since",
|
|
1679
|
+
"if-unmodified-since",
|
|
1680
|
+
"last-modified",
|
|
1681
|
+
"location",
|
|
1682
|
+
"max-forwards",
|
|
1683
|
+
"proxy-authorization",
|
|
1684
|
+
"referer",
|
|
1685
|
+
"retry-after",
|
|
1686
|
+
"user-agent"
|
|
1687
|
+
]), Rs = (t) => {
|
|
1688
|
+
const e = {};
|
|
1689
|
+
let r, n, s;
|
|
1690
|
+
return t && t.split(`
|
|
1691
|
+
`).forEach(function(i) {
|
|
1692
|
+
s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || e[r] && ws[r]) && (r === "set-cookie" ? e[r] ? e[r].push(n) : e[r] = [n] : e[r] = e[r] ? e[r] + ", " + n : n);
|
|
1693
|
+
}), e;
|
|
1694
|
+
}, Wt = Symbol("internals"), Ts = /[^\x09\x20-\x7E\x80-\xFF]/g;
|
|
1695
|
+
function vs(t) {
|
|
1696
|
+
let e = 0, r = t.length;
|
|
1697
|
+
for (; e < r; ) {
|
|
1698
|
+
const n = t.charCodeAt(e);
|
|
1699
|
+
if (n !== 9 && n !== 32)
|
|
1700
|
+
break;
|
|
1701
|
+
e += 1;
|
|
1702
|
+
}
|
|
1703
|
+
for (; r > e; ) {
|
|
1704
|
+
const n = t.charCodeAt(r - 1);
|
|
1705
|
+
if (n !== 9 && n !== 32)
|
|
1706
|
+
break;
|
|
1707
|
+
r -= 1;
|
|
1708
|
+
}
|
|
1709
|
+
return e === 0 && r === t.length ? t : t.slice(e, r);
|
|
1710
|
+
}
|
|
1711
|
+
function Ce(t) {
|
|
1712
|
+
return t && String(t).trim().toLowerCase();
|
|
1713
|
+
}
|
|
1714
|
+
function _s(t) {
|
|
1715
|
+
return vs(t.replace(Ts, ""));
|
|
1716
|
+
}
|
|
1717
|
+
function ze(t) {
|
|
1718
|
+
return t === !1 || t == null ? t : c.isArray(t) ? t.map(ze) : _s(String(t));
|
|
1719
|
+
}
|
|
1720
|
+
function xs(t) {
|
|
1721
|
+
const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
1722
|
+
let n;
|
|
1723
|
+
for (; n = r.exec(t); )
|
|
1724
|
+
e[n[1]] = n[2];
|
|
1725
|
+
return e;
|
|
1726
|
+
}
|
|
1727
|
+
const Os = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
1728
|
+
function ft(t, e, r, n, s) {
|
|
1729
|
+
if (c.isFunction(n))
|
|
1730
|
+
return n.call(this, e, r);
|
|
1731
|
+
if (s && (e = r), !!c.isString(e)) {
|
|
1732
|
+
if (c.isString(n))
|
|
1733
|
+
return e.indexOf(n) !== -1;
|
|
1734
|
+
if (c.isRegExp(n))
|
|
1735
|
+
return n.test(e);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
function Ss(t) {
|
|
1739
|
+
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, r, n) => r.toUpperCase() + n);
|
|
1740
|
+
}
|
|
1741
|
+
function As(t, e) {
|
|
1742
|
+
const r = c.toCamelCase(" " + e);
|
|
1743
|
+
["get", "set", "has"].forEach((n) => {
|
|
1744
|
+
Object.defineProperty(t, n + r, {
|
|
1745
|
+
value: function(s, a, i) {
|
|
1746
|
+
return this[n].call(this, e, s, a, i);
|
|
1747
|
+
},
|
|
1748
|
+
configurable: !0
|
|
1749
|
+
});
|
|
1750
|
+
});
|
|
1751
|
+
}
|
|
1752
|
+
let Q = class {
|
|
1753
|
+
constructor(e) {
|
|
1754
|
+
e && this.set(e);
|
|
1755
|
+
}
|
|
1756
|
+
set(e, r, n) {
|
|
1757
|
+
const s = this;
|
|
1758
|
+
function a(l, f, d) {
|
|
1759
|
+
const u = Ce(f);
|
|
1760
|
+
if (!u)
|
|
1761
|
+
throw new Error("header name must be a non-empty string");
|
|
1762
|
+
const h = c.findKey(s, u);
|
|
1763
|
+
(!h || s[h] === void 0 || d === !0 || d === void 0 && s[h] !== !1) && (s[h || f] = ze(l));
|
|
1764
|
+
}
|
|
1765
|
+
const i = (l, f) => c.forEach(l, (d, u) => a(d, u, f));
|
|
1766
|
+
if (c.isPlainObject(e) || e instanceof this.constructor)
|
|
1767
|
+
i(e, r);
|
|
1768
|
+
else if (c.isString(e) && (e = e.trim()) && !Os(e))
|
|
1769
|
+
i(Rs(e), r);
|
|
1770
|
+
else if (c.isObject(e) && c.isIterable(e)) {
|
|
1771
|
+
let l = {}, f, d;
|
|
1772
|
+
for (const u of e) {
|
|
1773
|
+
if (!c.isArray(u))
|
|
1774
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
1775
|
+
l[d = u[0]] = (f = l[d]) ? c.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
|
|
1776
|
+
}
|
|
1777
|
+
i(l, r);
|
|
1778
|
+
} else
|
|
1779
|
+
e != null && a(r, e, n);
|
|
1780
|
+
return this;
|
|
1781
|
+
}
|
|
1782
|
+
get(e, r) {
|
|
1783
|
+
if (e = Ce(e), e) {
|
|
1784
|
+
const n = c.findKey(this, e);
|
|
1785
|
+
if (n) {
|
|
1786
|
+
const s = this[n];
|
|
1787
|
+
if (!r)
|
|
1788
|
+
return s;
|
|
1789
|
+
if (r === !0)
|
|
1790
|
+
return xs(s);
|
|
1791
|
+
if (c.isFunction(r))
|
|
1792
|
+
return r.call(this, s, n);
|
|
1793
|
+
if (c.isRegExp(r))
|
|
1794
|
+
return r.exec(s);
|
|
1795
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
has(e, r) {
|
|
1800
|
+
if (e = Ce(e), e) {
|
|
1801
|
+
const n = c.findKey(this, e);
|
|
1802
|
+
return !!(n && this[n] !== void 0 && (!r || ft(this, this[n], n, r)));
|
|
1803
|
+
}
|
|
1804
|
+
return !1;
|
|
1805
|
+
}
|
|
1806
|
+
delete(e, r) {
|
|
1807
|
+
const n = this;
|
|
1808
|
+
let s = !1;
|
|
1809
|
+
function a(i) {
|
|
1810
|
+
if (i = Ce(i), i) {
|
|
1811
|
+
const l = c.findKey(n, i);
|
|
1812
|
+
l && (!r || ft(n, n[l], l, r)) && (delete n[l], s = !0);
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
return c.isArray(e) ? e.forEach(a) : a(e), s;
|
|
1816
|
+
}
|
|
1817
|
+
clear(e) {
|
|
1818
|
+
const r = Object.keys(this);
|
|
1819
|
+
let n = r.length, s = !1;
|
|
1820
|
+
for (; n--; ) {
|
|
1821
|
+
const a = r[n];
|
|
1822
|
+
(!e || ft(this, this[a], a, e, !0)) && (delete this[a], s = !0);
|
|
1823
|
+
}
|
|
1824
|
+
return s;
|
|
1825
|
+
}
|
|
1826
|
+
normalize(e) {
|
|
1827
|
+
const r = this, n = {};
|
|
1828
|
+
return c.forEach(this, (s, a) => {
|
|
1829
|
+
const i = c.findKey(n, a);
|
|
1830
|
+
if (i) {
|
|
1831
|
+
r[i] = ze(s), delete r[a];
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
const l = e ? Ss(a) : String(a).trim();
|
|
1835
|
+
l !== a && delete r[a], r[l] = ze(s), n[l] = !0;
|
|
1836
|
+
}), this;
|
|
1837
|
+
}
|
|
1838
|
+
concat(...e) {
|
|
1839
|
+
return this.constructor.concat(this, ...e);
|
|
1840
|
+
}
|
|
1841
|
+
toJSON(e) {
|
|
1842
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
1843
|
+
return c.forEach(this, (n, s) => {
|
|
1844
|
+
n != null && n !== !1 && (r[s] = e && c.isArray(n) ? n.join(", ") : n);
|
|
1845
|
+
}), r;
|
|
1846
|
+
}
|
|
1847
|
+
[Symbol.iterator]() {
|
|
1848
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
1849
|
+
}
|
|
1850
|
+
toString() {
|
|
1851
|
+
return Object.entries(this.toJSON()).map(([e, r]) => e + ": " + r).join(`
|
|
1852
|
+
`);
|
|
1853
|
+
}
|
|
1854
|
+
getSetCookie() {
|
|
1855
|
+
return this.get("set-cookie") || [];
|
|
1856
|
+
}
|
|
1857
|
+
get [Symbol.toStringTag]() {
|
|
1858
|
+
return "AxiosHeaders";
|
|
1859
|
+
}
|
|
1860
|
+
static from(e) {
|
|
1861
|
+
return e instanceof this ? e : new this(e);
|
|
1862
|
+
}
|
|
1863
|
+
static concat(e, ...r) {
|
|
1864
|
+
const n = new this(e);
|
|
1865
|
+
return r.forEach((s) => n.set(s)), n;
|
|
1866
|
+
}
|
|
1867
|
+
static accessor(e) {
|
|
1868
|
+
const n = (this[Wt] = this[Wt] = {
|
|
1869
|
+
accessors: {}
|
|
1870
|
+
}).accessors, s = this.prototype;
|
|
1871
|
+
function a(i) {
|
|
1872
|
+
const l = Ce(i);
|
|
1873
|
+
n[l] || (As(s, i), n[l] = !0);
|
|
1874
|
+
}
|
|
1875
|
+
return c.isArray(e) ? e.forEach(a) : a(e), this;
|
|
1876
|
+
}
|
|
1877
|
+
};
|
|
1878
|
+
Q.accessor([
|
|
1879
|
+
"Content-Type",
|
|
1880
|
+
"Content-Length",
|
|
1881
|
+
"Accept",
|
|
1882
|
+
"Accept-Encoding",
|
|
1883
|
+
"User-Agent",
|
|
1884
|
+
"Authorization"
|
|
1885
|
+
]);
|
|
1886
|
+
c.reduceDescriptors(Q.prototype, ({ value: t }, e) => {
|
|
1887
|
+
let r = e[0].toUpperCase() + e.slice(1);
|
|
1888
|
+
return {
|
|
1889
|
+
get: () => t,
|
|
1890
|
+
set(n) {
|
|
1891
|
+
this[r] = n;
|
|
1892
|
+
}
|
|
1893
|
+
};
|
|
1894
|
+
});
|
|
1895
|
+
c.freezeMethods(Q);
|
|
1896
|
+
function dt(t, e) {
|
|
1897
|
+
const r = this || Fe, n = e || r, s = Q.from(n.headers);
|
|
1898
|
+
let a = n.data;
|
|
1899
|
+
return c.forEach(t, function(l) {
|
|
1900
|
+
a = l.call(r, a, s.normalize(), e ? e.status : void 0);
|
|
1901
|
+
}), s.normalize(), a;
|
|
1902
|
+
}
|
|
1903
|
+
function Rr(t) {
|
|
1904
|
+
return !!(t && t.__CANCEL__);
|
|
1905
|
+
}
|
|
1906
|
+
let Ne = class extends w {
|
|
1907
|
+
/**
|
|
1908
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
1909
|
+
*
|
|
1910
|
+
* @param {string=} message The message.
|
|
1911
|
+
* @param {Object=} config The config.
|
|
1912
|
+
* @param {Object=} request The request.
|
|
1913
|
+
*
|
|
1914
|
+
* @returns {CanceledError} The created error.
|
|
1915
|
+
*/
|
|
1916
|
+
constructor(e, r, n) {
|
|
1917
|
+
super(e ?? "canceled", w.ERR_CANCELED, r, n), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
function Tr(t, e, r) {
|
|
1921
|
+
const n = r.config.validateStatus;
|
|
1922
|
+
!r.status || !n || n(r.status) ? t(r) : e(
|
|
1923
|
+
new w(
|
|
1924
|
+
"Request failed with status code " + r.status,
|
|
1925
|
+
[w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
|
|
1926
|
+
r.config,
|
|
1927
|
+
r.request,
|
|
1928
|
+
r
|
|
1929
|
+
)
|
|
1930
|
+
);
|
|
1931
|
+
}
|
|
1932
|
+
function Cs(t) {
|
|
1933
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
1934
|
+
return e && e[1] || "";
|
|
1935
|
+
}
|
|
1936
|
+
function Ps(t, e) {
|
|
1937
|
+
t = t || 10;
|
|
1938
|
+
const r = new Array(t), n = new Array(t);
|
|
1939
|
+
let s = 0, a = 0, i;
|
|
1940
|
+
return e = e !== void 0 ? e : 1e3, function(f) {
|
|
1941
|
+
const d = Date.now(), u = n[a];
|
|
1942
|
+
i || (i = d), r[s] = f, n[s] = d;
|
|
1943
|
+
let h = a, _ = 0;
|
|
1944
|
+
for (; h !== s; )
|
|
1945
|
+
_ += r[h++], h = h % t;
|
|
1946
|
+
if (s = (s + 1) % t, s === a && (a = (a + 1) % t), d - i < e)
|
|
1947
|
+
return;
|
|
1948
|
+
const k = u && d - u;
|
|
1949
|
+
return k ? Math.round(_ * 1e3 / k) : void 0;
|
|
1950
|
+
};
|
|
1951
|
+
}
|
|
1952
|
+
function ks(t, e) {
|
|
1953
|
+
let r = 0, n = 1e3 / e, s, a;
|
|
1954
|
+
const i = (d, u = Date.now()) => {
|
|
1955
|
+
r = u, s = null, a && (clearTimeout(a), a = null), t(...d);
|
|
1956
|
+
};
|
|
1957
|
+
return [(...d) => {
|
|
1958
|
+
const u = Date.now(), h = u - r;
|
|
1959
|
+
h >= n ? i(d, u) : (s = d, a || (a = setTimeout(() => {
|
|
1960
|
+
a = null, i(s);
|
|
1961
|
+
}, n - h)));
|
|
1962
|
+
}, () => s && i(s)];
|
|
1963
|
+
}
|
|
1964
|
+
const Ye = (t, e, r = 3) => {
|
|
1965
|
+
let n = 0;
|
|
1966
|
+
const s = Ps(50, 250);
|
|
1967
|
+
return ks((a) => {
|
|
1968
|
+
const i = a.loaded, l = a.lengthComputable ? a.total : void 0, f = l != null ? Math.min(i, l) : i, d = Math.max(0, f - n), u = s(d);
|
|
1969
|
+
n = Math.max(n, f);
|
|
1970
|
+
const h = {
|
|
1971
|
+
loaded: f,
|
|
1972
|
+
total: l,
|
|
1973
|
+
progress: l ? f / l : void 0,
|
|
1974
|
+
bytes: d,
|
|
1975
|
+
rate: u || void 0,
|
|
1976
|
+
estimated: u && l ? (l - f) / u : void 0,
|
|
1977
|
+
event: a,
|
|
1978
|
+
lengthComputable: l != null,
|
|
1979
|
+
[e ? "download" : "upload"]: !0
|
|
1980
|
+
};
|
|
1981
|
+
t(h);
|
|
1982
|
+
}, r);
|
|
1983
|
+
}, zt = (t, e) => {
|
|
1984
|
+
const r = t != null;
|
|
1985
|
+
return [
|
|
1986
|
+
(n) => e[0]({
|
|
1987
|
+
lengthComputable: r,
|
|
1988
|
+
total: t,
|
|
1989
|
+
loaded: n
|
|
1990
|
+
}),
|
|
1991
|
+
e[1]
|
|
1992
|
+
];
|
|
1993
|
+
}, Jt = (t) => (...e) => c.asap(() => t(...e)), Ls = V.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, V.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
|
|
1994
|
+
new URL(V.origin),
|
|
1995
|
+
V.navigator && /(msie|trident)/i.test(V.navigator.userAgent)
|
|
1996
|
+
) : () => !0, Ds = V.hasStandardBrowserEnv ? (
|
|
1997
|
+
// Standard browser envs support document.cookie
|
|
1998
|
+
{
|
|
1999
|
+
write(t, e, r, n, s, a, i) {
|
|
2000
|
+
if (typeof document > "u") return;
|
|
2001
|
+
const l = [`${t}=${encodeURIComponent(e)}`];
|
|
2002
|
+
c.isNumber(r) && l.push(`expires=${new Date(r).toUTCString()}`), c.isString(n) && l.push(`path=${n}`), c.isString(s) && l.push(`domain=${s}`), a === !0 && l.push("secure"), c.isString(i) && l.push(`SameSite=${i}`), document.cookie = l.join("; ");
|
|
2003
|
+
},
|
|
2004
|
+
read(t) {
|
|
2005
|
+
if (typeof document > "u") return null;
|
|
2006
|
+
const e = document.cookie.match(new RegExp("(?:^|; )" + t + "=([^;]*)"));
|
|
2007
|
+
return e ? decodeURIComponent(e[1]) : null;
|
|
2008
|
+
},
|
|
2009
|
+
remove(t) {
|
|
2010
|
+
this.write(t, "", Date.now() - 864e5, "/");
|
|
2011
|
+
}
|
|
2012
|
+
}
|
|
2013
|
+
) : (
|
|
2014
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2015
|
+
{
|
|
2016
|
+
write() {
|
|
2017
|
+
},
|
|
2018
|
+
read() {
|
|
2019
|
+
return null;
|
|
2020
|
+
},
|
|
2021
|
+
remove() {
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
);
|
|
2025
|
+
function Fs(t) {
|
|
2026
|
+
return typeof t != "string" ? !1 : /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
2027
|
+
}
|
|
2028
|
+
function Ns(t, e) {
|
|
2029
|
+
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
2030
|
+
}
|
|
2031
|
+
function vr(t, e, r) {
|
|
2032
|
+
let n = !Fs(e);
|
|
2033
|
+
return t && (n || r === !1) ? Ns(t, e) : e;
|
|
2034
|
+
}
|
|
2035
|
+
const Yt = (t) => t instanceof Q ? { ...t } : t;
|
|
2036
|
+
function ye(t, e) {
|
|
2037
|
+
e = e || {};
|
|
2038
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
2039
|
+
Object.defineProperty(r, "hasOwnProperty", {
|
|
2040
|
+
value: Object.prototype.hasOwnProperty,
|
|
2041
|
+
enumerable: !1,
|
|
2042
|
+
writable: !0,
|
|
2043
|
+
configurable: !0
|
|
2044
|
+
});
|
|
2045
|
+
function n(d, u, h, _) {
|
|
2046
|
+
return c.isPlainObject(d) && c.isPlainObject(u) ? c.merge.call({ caseless: _ }, d, u) : c.isPlainObject(u) ? c.merge({}, u) : c.isArray(u) ? u.slice() : u;
|
|
2047
|
+
}
|
|
2048
|
+
function s(d, u, h, _) {
|
|
2049
|
+
if (c.isUndefined(u)) {
|
|
2050
|
+
if (!c.isUndefined(d))
|
|
2051
|
+
return n(void 0, d, h, _);
|
|
2052
|
+
} else return n(d, u, h, _);
|
|
2053
|
+
}
|
|
2054
|
+
function a(d, u) {
|
|
2055
|
+
if (!c.isUndefined(u))
|
|
2056
|
+
return n(void 0, u);
|
|
2057
|
+
}
|
|
2058
|
+
function i(d, u) {
|
|
2059
|
+
if (c.isUndefined(u)) {
|
|
2060
|
+
if (!c.isUndefined(d))
|
|
2061
|
+
return n(void 0, d);
|
|
2062
|
+
} else return n(void 0, u);
|
|
2063
|
+
}
|
|
2064
|
+
function l(d, u, h) {
|
|
2065
|
+
if (c.hasOwnProp(e, h))
|
|
2066
|
+
return n(d, u);
|
|
2067
|
+
if (c.hasOwnProp(t, h))
|
|
2068
|
+
return n(void 0, d);
|
|
2069
|
+
}
|
|
2070
|
+
const f = {
|
|
2071
|
+
url: a,
|
|
2072
|
+
method: a,
|
|
2073
|
+
data: a,
|
|
2074
|
+
baseURL: i,
|
|
2075
|
+
transformRequest: i,
|
|
2076
|
+
transformResponse: i,
|
|
2077
|
+
paramsSerializer: i,
|
|
2078
|
+
timeout: i,
|
|
2079
|
+
timeoutMessage: i,
|
|
2080
|
+
withCredentials: i,
|
|
2081
|
+
withXSRFToken: i,
|
|
2082
|
+
adapter: i,
|
|
2083
|
+
responseType: i,
|
|
2084
|
+
xsrfCookieName: i,
|
|
2085
|
+
xsrfHeaderName: i,
|
|
2086
|
+
onUploadProgress: i,
|
|
2087
|
+
onDownloadProgress: i,
|
|
2088
|
+
decompress: i,
|
|
2089
|
+
maxContentLength: i,
|
|
2090
|
+
maxBodyLength: i,
|
|
2091
|
+
beforeRedirect: i,
|
|
2092
|
+
transport: i,
|
|
2093
|
+
httpAgent: i,
|
|
2094
|
+
httpsAgent: i,
|
|
2095
|
+
cancelToken: i,
|
|
2096
|
+
socketPath: i,
|
|
2097
|
+
allowedSocketPaths: i,
|
|
2098
|
+
responseEncoding: i,
|
|
2099
|
+
validateStatus: l,
|
|
2100
|
+
headers: (d, u, h) => s(Yt(d), Yt(u), h, !0)
|
|
2101
|
+
};
|
|
2102
|
+
return c.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
2103
|
+
if (u === "__proto__" || u === "constructor" || u === "prototype") return;
|
|
2104
|
+
const h = c.hasOwnProp(f, u) ? f[u] : s, _ = c.hasOwnProp(t, u) ? t[u] : void 0, k = c.hasOwnProp(e, u) ? e[u] : void 0, m = h(_, k, u);
|
|
2105
|
+
c.isUndefined(m) && h !== l || (r[u] = m);
|
|
2106
|
+
}), r;
|
|
2107
|
+
}
|
|
2108
|
+
const _r = (t) => {
|
|
2109
|
+
const e = ye({}, t), r = (_) => c.hasOwnProp(e, _) ? e[_] : void 0, n = r("data");
|
|
2110
|
+
let s = r("withXSRFToken");
|
|
2111
|
+
const a = r("xsrfHeaderName"), i = r("xsrfCookieName");
|
|
2112
|
+
let l = r("headers");
|
|
2113
|
+
const f = r("auth"), d = r("baseURL"), u = r("allowAbsoluteUrls"), h = r("url");
|
|
2114
|
+
if (e.headers = l = Q.from(l), e.url = Er(
|
|
2115
|
+
vr(d, h, u),
|
|
2116
|
+
t.params,
|
|
2117
|
+
t.paramsSerializer
|
|
2118
|
+
), f && l.set(
|
|
2119
|
+
"Authorization",
|
|
2120
|
+
"Basic " + btoa(
|
|
2121
|
+
(f.username || "") + ":" + (f.password ? unescape(encodeURIComponent(f.password)) : "")
|
|
2122
|
+
)
|
|
2123
|
+
), c.isFormData(n)) {
|
|
2124
|
+
if (V.hasStandardBrowserEnv || V.hasStandardBrowserWebWorkerEnv)
|
|
2125
|
+
l.setContentType(void 0);
|
|
2126
|
+
else if (c.isFunction(n.getHeaders)) {
|
|
2127
|
+
const _ = n.getHeaders(), k = ["content-type", "content-length"];
|
|
2128
|
+
Object.entries(_).forEach(([m, y]) => {
|
|
2129
|
+
k.includes(m.toLowerCase()) && l.set(m, y);
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
if (V.hasStandardBrowserEnv && (c.isFunction(s) && (s = s(e)), s === !0 || s == null && Ls(e.url))) {
|
|
2134
|
+
const k = a && i && Ds.read(i);
|
|
2135
|
+
k && l.set(a, k);
|
|
2136
|
+
}
|
|
2137
|
+
return e;
|
|
2138
|
+
}, js = typeof XMLHttpRequest < "u", Us = js && function(t) {
|
|
2139
|
+
return new Promise(function(r, n) {
|
|
2140
|
+
const s = _r(t);
|
|
2141
|
+
let a = s.data;
|
|
2142
|
+
const i = Q.from(s.headers).normalize();
|
|
2143
|
+
let { responseType: l, onUploadProgress: f, onDownloadProgress: d } = s, u, h, _, k, m;
|
|
2144
|
+
function y() {
|
|
2145
|
+
k && k(), m && m(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
|
|
2146
|
+
}
|
|
2147
|
+
let g = new XMLHttpRequest();
|
|
2148
|
+
g.open(s.method.toUpperCase(), s.url, !0), g.timeout = s.timeout;
|
|
2149
|
+
function A() {
|
|
2150
|
+
if (!g)
|
|
2151
|
+
return;
|
|
2152
|
+
const D = Q.from(
|
|
2153
|
+
"getAllResponseHeaders" in g && g.getAllResponseHeaders()
|
|
2154
|
+
), $ = {
|
|
2155
|
+
data: !l || l === "text" || l === "json" ? g.responseText : g.response,
|
|
2156
|
+
status: g.status,
|
|
2157
|
+
statusText: g.statusText,
|
|
2158
|
+
headers: D,
|
|
2159
|
+
config: t,
|
|
2160
|
+
request: g
|
|
2161
|
+
};
|
|
2162
|
+
Tr(
|
|
2163
|
+
function(q) {
|
|
2164
|
+
r(q), y();
|
|
2165
|
+
},
|
|
2166
|
+
function(q) {
|
|
2167
|
+
n(q), y();
|
|
2168
|
+
},
|
|
2169
|
+
$
|
|
2170
|
+
), g = null;
|
|
2171
|
+
}
|
|
2172
|
+
"onloadend" in g ? g.onloadend = A : g.onreadystatechange = function() {
|
|
2173
|
+
!g || g.readyState !== 4 || g.status === 0 && !(g.responseURL && g.responseURL.indexOf("file:") === 0) || setTimeout(A);
|
|
2174
|
+
}, g.onabort = function() {
|
|
2175
|
+
g && (n(new w("Request aborted", w.ECONNABORTED, t, g)), g = null);
|
|
2176
|
+
}, g.onerror = function(C) {
|
|
2177
|
+
const $ = C && C.message ? C.message : "Network Error", se = new w($, w.ERR_NETWORK, t, g);
|
|
2178
|
+
se.event = C || null, n(se), g = null;
|
|
2179
|
+
}, g.ontimeout = function() {
|
|
2180
|
+
let C = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
2181
|
+
const $ = s.transitional || wt;
|
|
2182
|
+
s.timeoutErrorMessage && (C = s.timeoutErrorMessage), n(
|
|
2183
|
+
new w(
|
|
2184
|
+
C,
|
|
2185
|
+
$.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
|
|
2186
|
+
t,
|
|
2187
|
+
g
|
|
2188
|
+
)
|
|
2189
|
+
), g = null;
|
|
2190
|
+
}, a === void 0 && i.setContentType(null), "setRequestHeader" in g && c.forEach(i.toJSON(), function(C, $) {
|
|
2191
|
+
g.setRequestHeader($, C);
|
|
2192
|
+
}), c.isUndefined(s.withCredentials) || (g.withCredentials = !!s.withCredentials), l && l !== "json" && (g.responseType = s.responseType), d && ([_, m] = Ye(d, !0), g.addEventListener("progress", _)), f && g.upload && ([h, k] = Ye(f), g.upload.addEventListener("progress", h), g.upload.addEventListener("loadend", k)), (s.cancelToken || s.signal) && (u = (D) => {
|
|
2193
|
+
g && (n(!D || D.type ? new Ne(null, t, g) : D), g.abort(), g = null);
|
|
2194
|
+
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
2195
|
+
const L = Cs(s.url);
|
|
2196
|
+
if (L && V.protocols.indexOf(L) === -1) {
|
|
2197
|
+
n(
|
|
2198
|
+
new w(
|
|
2199
|
+
"Unsupported protocol " + L + ":",
|
|
2200
|
+
w.ERR_BAD_REQUEST,
|
|
2201
|
+
t
|
|
2202
|
+
)
|
|
2203
|
+
);
|
|
2204
|
+
return;
|
|
2205
|
+
}
|
|
2206
|
+
g.send(a || null);
|
|
2207
|
+
});
|
|
2208
|
+
}, Is = (t, e) => {
|
|
2209
|
+
const { length: r } = t = t ? t.filter(Boolean) : [];
|
|
2210
|
+
if (e || r) {
|
|
2211
|
+
let n = new AbortController(), s;
|
|
2212
|
+
const a = function(d) {
|
|
2213
|
+
if (!s) {
|
|
2214
|
+
s = !0, l();
|
|
2215
|
+
const u = d instanceof Error ? d : this.reason;
|
|
2216
|
+
n.abort(
|
|
2217
|
+
u instanceof w ? u : new Ne(u instanceof Error ? u.message : u)
|
|
2218
|
+
);
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
let i = e && setTimeout(() => {
|
|
2222
|
+
i = null, a(new w(`timeout of ${e}ms exceeded`, w.ETIMEDOUT));
|
|
2223
|
+
}, e);
|
|
2224
|
+
const l = () => {
|
|
2225
|
+
t && (i && clearTimeout(i), i = null, t.forEach((d) => {
|
|
2226
|
+
d.unsubscribe ? d.unsubscribe(a) : d.removeEventListener("abort", a);
|
|
2227
|
+
}), t = null);
|
|
2228
|
+
};
|
|
2229
|
+
t.forEach((d) => d.addEventListener("abort", a));
|
|
2230
|
+
const { signal: f } = n;
|
|
2231
|
+
return f.unsubscribe = () => c.asap(l), f;
|
|
2232
|
+
}
|
|
2233
|
+
}, Ms = function* (t, e) {
|
|
2234
|
+
let r = t.byteLength;
|
|
2235
|
+
if (r < e) {
|
|
2236
|
+
yield t;
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
let n = 0, s;
|
|
2240
|
+
for (; n < r; )
|
|
2241
|
+
s = n + e, yield t.slice(n, s), n = s;
|
|
2242
|
+
}, Bs = async function* (t, e) {
|
|
2243
|
+
for await (const r of $s(t))
|
|
2244
|
+
yield* Ms(r, e);
|
|
2245
|
+
}, $s = async function* (t) {
|
|
2246
|
+
if (t[Symbol.asyncIterator]) {
|
|
2247
|
+
yield* t;
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
const e = t.getReader();
|
|
2251
|
+
try {
|
|
2252
|
+
for (; ; ) {
|
|
2253
|
+
const { done: r, value: n } = await e.read();
|
|
2254
|
+
if (r)
|
|
2255
|
+
break;
|
|
2256
|
+
yield n;
|
|
2257
|
+
}
|
|
2258
|
+
} finally {
|
|
2259
|
+
await e.cancel();
|
|
2260
|
+
}
|
|
2261
|
+
}, Gt = (t, e, r, n) => {
|
|
2262
|
+
const s = Bs(t, e);
|
|
2263
|
+
let a = 0, i, l = (f) => {
|
|
2264
|
+
i || (i = !0, n && n(f));
|
|
2265
|
+
};
|
|
2266
|
+
return new ReadableStream(
|
|
2267
|
+
{
|
|
2268
|
+
async pull(f) {
|
|
2269
|
+
try {
|
|
2270
|
+
const { done: d, value: u } = await s.next();
|
|
2271
|
+
if (d) {
|
|
2272
|
+
l(), f.close();
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
let h = u.byteLength;
|
|
2276
|
+
if (r) {
|
|
2277
|
+
let _ = a += h;
|
|
2278
|
+
r(_);
|
|
2279
|
+
}
|
|
2280
|
+
f.enqueue(new Uint8Array(u));
|
|
2281
|
+
} catch (d) {
|
|
2282
|
+
throw l(d), d;
|
|
2283
|
+
}
|
|
2284
|
+
},
|
|
2285
|
+
cancel(f) {
|
|
2286
|
+
return l(f), s.return();
|
|
2287
|
+
}
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
highWaterMark: 2
|
|
2291
|
+
}
|
|
2292
|
+
);
|
|
2293
|
+
}, Xt = 64 * 1024, { isFunction: Ve } = c, qs = (({ Request: t, Response: e }) => ({
|
|
2294
|
+
Request: t,
|
|
2295
|
+
Response: e
|
|
2296
|
+
}))(c.global), { ReadableStream: Qt, TextEncoder: Zt } = c.global, er = (t, ...e) => {
|
|
2297
|
+
try {
|
|
2298
|
+
return !!t(...e);
|
|
2299
|
+
} catch {
|
|
2300
|
+
return !1;
|
|
2301
|
+
}
|
|
2302
|
+
}, Hs = (t) => {
|
|
2303
|
+
t = c.merge.call(
|
|
2304
|
+
{
|
|
2305
|
+
skipUndefined: !0
|
|
2306
|
+
},
|
|
2307
|
+
qs,
|
|
2308
|
+
t
|
|
2309
|
+
);
|
|
2310
|
+
const { fetch: e, Request: r, Response: n } = t, s = e ? Ve(e) : typeof fetch == "function", a = Ve(r), i = Ve(n);
|
|
2311
|
+
if (!s)
|
|
2312
|
+
return !1;
|
|
2313
|
+
const l = s && Ve(Qt), f = s && (typeof Zt == "function" ? /* @__PURE__ */ ((m) => (y) => m.encode(y))(new Zt()) : async (m) => new Uint8Array(await new r(m).arrayBuffer())), d = a && l && er(() => {
|
|
2314
|
+
let m = !1;
|
|
2315
|
+
const y = new r(V.origin, {
|
|
2316
|
+
body: new Qt(),
|
|
2317
|
+
method: "POST",
|
|
2318
|
+
get duplex() {
|
|
2319
|
+
return m = !0, "half";
|
|
2320
|
+
}
|
|
2321
|
+
}), g = y.headers.has("Content-Type");
|
|
2322
|
+
return y.body != null && y.body.cancel(), m && !g;
|
|
2323
|
+
}), u = i && l && er(() => c.isReadableStream(new n("").body)), h = {
|
|
2324
|
+
stream: u && ((m) => m.body)
|
|
2325
|
+
};
|
|
2326
|
+
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((m) => {
|
|
2327
|
+
!h[m] && (h[m] = (y, g) => {
|
|
2328
|
+
let A = y && y[m];
|
|
2329
|
+
if (A)
|
|
2330
|
+
return A.call(y);
|
|
2331
|
+
throw new w(
|
|
2332
|
+
`Response type '${m}' is not supported`,
|
|
2333
|
+
w.ERR_NOT_SUPPORT,
|
|
2334
|
+
g
|
|
2335
|
+
);
|
|
2336
|
+
});
|
|
2337
|
+
});
|
|
2338
|
+
const _ = async (m) => {
|
|
2339
|
+
if (m == null)
|
|
2340
|
+
return 0;
|
|
2341
|
+
if (c.isBlob(m))
|
|
2342
|
+
return m.size;
|
|
2343
|
+
if (c.isSpecCompliantForm(m))
|
|
2344
|
+
return (await new r(V.origin, {
|
|
2345
|
+
method: "POST",
|
|
2346
|
+
body: m
|
|
2347
|
+
}).arrayBuffer()).byteLength;
|
|
2348
|
+
if (c.isArrayBufferView(m) || c.isArrayBuffer(m))
|
|
2349
|
+
return m.byteLength;
|
|
2350
|
+
if (c.isURLSearchParams(m) && (m = m + ""), c.isString(m))
|
|
2351
|
+
return (await f(m)).byteLength;
|
|
2352
|
+
}, k = async (m, y) => {
|
|
2353
|
+
const g = c.toFiniteNumber(m.getContentLength());
|
|
2354
|
+
return g ?? _(y);
|
|
2355
|
+
};
|
|
2356
|
+
return async (m) => {
|
|
2357
|
+
let {
|
|
2358
|
+
url: y,
|
|
2359
|
+
method: g,
|
|
2360
|
+
data: A,
|
|
2361
|
+
signal: L,
|
|
2362
|
+
cancelToken: D,
|
|
2363
|
+
timeout: C,
|
|
2364
|
+
onDownloadProgress: $,
|
|
2365
|
+
onUploadProgress: se,
|
|
2366
|
+
responseType: q,
|
|
2367
|
+
headers: W,
|
|
2368
|
+
withCredentials: Z = "same-origin",
|
|
2369
|
+
fetchOptions: fe
|
|
2370
|
+
} = _r(m), le = e || fetch;
|
|
2371
|
+
q = q ? (q + "").toLowerCase() : "text";
|
|
2372
|
+
let ie = Is(
|
|
2373
|
+
[L, D && D.toAbortSignal()],
|
|
2374
|
+
C
|
|
2375
|
+
), H = null;
|
|
2376
|
+
const K = ie && ie.unsubscribe && (() => {
|
|
2377
|
+
ie.unsubscribe();
|
|
2378
|
+
});
|
|
2379
|
+
let b;
|
|
2380
|
+
try {
|
|
2381
|
+
if (se && d && g !== "get" && g !== "head" && (b = await k(W, A)) !== 0) {
|
|
2382
|
+
let U = new r(y, {
|
|
2383
|
+
method: "POST",
|
|
2384
|
+
body: A,
|
|
2385
|
+
duplex: "half"
|
|
2386
|
+
}), M;
|
|
2387
|
+
if (c.isFormData(A) && (M = U.headers.get("content-type")) && W.setContentType(M), U.body) {
|
|
2388
|
+
const [J, ue] = zt(
|
|
2389
|
+
b,
|
|
2390
|
+
Ye(Jt(se))
|
|
2391
|
+
);
|
|
2392
|
+
A = Gt(U.body, Xt, J, ue);
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
c.isString(Z) || (Z = Z ? "include" : "omit");
|
|
2396
|
+
const R = a && "credentials" in r.prototype;
|
|
2397
|
+
if (c.isFormData(A)) {
|
|
2398
|
+
const U = W.getContentType();
|
|
2399
|
+
U && /^multipart\/form-data/i.test(U) && !/boundary=/i.test(U) && W.delete("content-type");
|
|
2400
|
+
}
|
|
2401
|
+
const x = {
|
|
2402
|
+
...fe,
|
|
2403
|
+
signal: ie,
|
|
2404
|
+
method: g.toUpperCase(),
|
|
2405
|
+
headers: W.normalize().toJSON(),
|
|
2406
|
+
body: A,
|
|
2407
|
+
duplex: "half",
|
|
2408
|
+
credentials: R ? Z : void 0
|
|
2409
|
+
};
|
|
2410
|
+
H = a && new r(y, x);
|
|
2411
|
+
let T = await (a ? le(H, fe) : le(y, x));
|
|
2412
|
+
const N = u && (q === "stream" || q === "response");
|
|
2413
|
+
if (u && ($ || N && K)) {
|
|
2414
|
+
const U = {};
|
|
2415
|
+
["status", "statusText", "headers"].forEach((de) => {
|
|
2416
|
+
U[de] = T[de];
|
|
2417
|
+
});
|
|
2418
|
+
const M = c.toFiniteNumber(T.headers.get("content-length")), [J, ue] = $ && zt(
|
|
2419
|
+
M,
|
|
2420
|
+
Ye(Jt($), !0)
|
|
2421
|
+
) || [];
|
|
2422
|
+
T = new n(
|
|
2423
|
+
Gt(T.body, Xt, J, () => {
|
|
2424
|
+
ue && ue(), K && K();
|
|
2425
|
+
}),
|
|
2426
|
+
U
|
|
2427
|
+
);
|
|
2428
|
+
}
|
|
2429
|
+
q = q || "text";
|
|
2430
|
+
let oe = await h[c.findKey(h, q) || "text"](
|
|
2431
|
+
T,
|
|
2432
|
+
m
|
|
2433
|
+
);
|
|
2434
|
+
return !N && K && K(), await new Promise((U, M) => {
|
|
2435
|
+
Tr(U, M, {
|
|
2436
|
+
data: oe,
|
|
2437
|
+
headers: Q.from(T.headers),
|
|
2438
|
+
status: T.status,
|
|
2439
|
+
statusText: T.statusText,
|
|
2440
|
+
config: m,
|
|
2441
|
+
request: H
|
|
2442
|
+
});
|
|
2443
|
+
});
|
|
2444
|
+
} catch (R) {
|
|
2445
|
+
throw K && K(), R && R.name === "TypeError" && /Load failed|fetch/i.test(R.message) ? Object.assign(
|
|
2446
|
+
new w(
|
|
2447
|
+
"Network Error",
|
|
2448
|
+
w.ERR_NETWORK,
|
|
2449
|
+
m,
|
|
2450
|
+
H,
|
|
2451
|
+
R && R.response
|
|
2452
|
+
),
|
|
2453
|
+
{
|
|
2454
|
+
cause: R.cause || R
|
|
2455
|
+
}
|
|
2456
|
+
) : w.from(R, R && R.code, m, H, R && R.response);
|
|
2457
|
+
}
|
|
2458
|
+
};
|
|
2459
|
+
}, Ks = /* @__PURE__ */ new Map(), xr = (t) => {
|
|
2460
|
+
let e = t && t.env || {};
|
|
2461
|
+
const { fetch: r, Request: n, Response: s } = e, a = [n, s, r];
|
|
2462
|
+
let i = a.length, l = i, f, d, u = Ks;
|
|
2463
|
+
for (; l--; )
|
|
2464
|
+
f = a[l], d = u.get(f), d === void 0 && u.set(f, d = l ? /* @__PURE__ */ new Map() : Hs(e)), u = d;
|
|
2465
|
+
return d;
|
|
2466
|
+
};
|
|
2467
|
+
xr();
|
|
2468
|
+
const Tt = {
|
|
2469
|
+
http: ss,
|
|
2470
|
+
xhr: Us,
|
|
2471
|
+
fetch: {
|
|
2472
|
+
get: xr
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
c.forEach(Tt, (t, e) => {
|
|
2476
|
+
if (t) {
|
|
2477
|
+
try {
|
|
2478
|
+
Object.defineProperty(t, "name", { value: e });
|
|
2479
|
+
} catch {
|
|
2480
|
+
}
|
|
2481
|
+
Object.defineProperty(t, "adapterName", { value: e });
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2484
|
+
const tr = (t) => `- ${t}`, Vs = (t) => c.isFunction(t) || t === null || t === !1;
|
|
2485
|
+
function Ws(t, e) {
|
|
2486
|
+
t = c.isArray(t) ? t : [t];
|
|
2487
|
+
const { length: r } = t;
|
|
2488
|
+
let n, s;
|
|
2489
|
+
const a = {};
|
|
2490
|
+
for (let i = 0; i < r; i++) {
|
|
2491
|
+
n = t[i];
|
|
2492
|
+
let l;
|
|
2493
|
+
if (s = n, !Vs(n) && (s = Tt[(l = String(n)).toLowerCase()], s === void 0))
|
|
2494
|
+
throw new w(`Unknown adapter '${l}'`);
|
|
2495
|
+
if (s && (c.isFunction(s) || (s = s.get(e))))
|
|
2496
|
+
break;
|
|
2497
|
+
a[l || "#" + i] = s;
|
|
2498
|
+
}
|
|
2499
|
+
if (!s) {
|
|
2500
|
+
const i = Object.entries(a).map(
|
|
2501
|
+
([f, d]) => `adapter ${f} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2502
|
+
);
|
|
2503
|
+
let l = r ? i.length > 1 ? `since :
|
|
2504
|
+
` + i.map(tr).join(`
|
|
2505
|
+
`) : " " + tr(i[0]) : "as no adapter specified";
|
|
2506
|
+
throw new w(
|
|
2507
|
+
"There is no suitable adapter to dispatch the request " + l,
|
|
2508
|
+
"ERR_NOT_SUPPORT"
|
|
2509
|
+
);
|
|
2510
|
+
}
|
|
2511
|
+
return s;
|
|
2512
|
+
}
|
|
2513
|
+
const Or = {
|
|
2514
|
+
/**
|
|
2515
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
2516
|
+
* @type {Function}
|
|
2517
|
+
*/
|
|
2518
|
+
getAdapter: Ws,
|
|
2519
|
+
/**
|
|
2520
|
+
* Exposes all known adapters
|
|
2521
|
+
* @type {Object<string, Function|Object>}
|
|
2522
|
+
*/
|
|
2523
|
+
adapters: Tt
|
|
2524
|
+
};
|
|
2525
|
+
function ht(t) {
|
|
2526
|
+
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
2527
|
+
throw new Ne(null, t);
|
|
2528
|
+
}
|
|
2529
|
+
function rr(t) {
|
|
2530
|
+
return ht(t), t.headers = Q.from(t.headers), t.data = dt.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Or.getAdapter(t.adapter || Fe.adapter, t)(t).then(
|
|
2531
|
+
function(n) {
|
|
2532
|
+
return ht(t), n.data = dt.call(t, t.transformResponse, n), n.headers = Q.from(n.headers), n;
|
|
2533
|
+
},
|
|
2534
|
+
function(n) {
|
|
2535
|
+
return Rr(n) || (ht(t), n && n.response && (n.response.data = dt.call(
|
|
2536
|
+
t,
|
|
2537
|
+
t.transformResponse,
|
|
2538
|
+
n.response
|
|
2539
|
+
), n.response.headers = Q.from(n.response.headers))), Promise.reject(n);
|
|
2540
|
+
}
|
|
2541
|
+
);
|
|
2542
|
+
}
|
|
2543
|
+
const Sr = "1.15.2", tt = {};
|
|
2544
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
2545
|
+
tt[t] = function(n) {
|
|
2546
|
+
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
2547
|
+
};
|
|
2548
|
+
});
|
|
2549
|
+
const nr = {};
|
|
2550
|
+
tt.transitional = function(e, r, n) {
|
|
2551
|
+
function s(a, i) {
|
|
2552
|
+
return "[Axios v" + Sr + "] Transitional option '" + a + "'" + i + (n ? ". " + n : "");
|
|
2553
|
+
}
|
|
2554
|
+
return (a, i, l) => {
|
|
2555
|
+
if (e === !1)
|
|
2556
|
+
throw new w(
|
|
2557
|
+
s(i, " has been removed" + (r ? " in " + r : "")),
|
|
2558
|
+
w.ERR_DEPRECATED
|
|
2559
|
+
);
|
|
2560
|
+
return r && !nr[i] && (nr[i] = !0, console.warn(
|
|
2561
|
+
s(
|
|
2562
|
+
i,
|
|
2563
|
+
" has been deprecated since v" + r + " and will be removed in the near future"
|
|
2564
|
+
)
|
|
2565
|
+
)), e ? e(a, i, l) : !0;
|
|
2566
|
+
};
|
|
2567
|
+
};
|
|
2568
|
+
tt.spelling = function(e) {
|
|
2569
|
+
return (r, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
|
|
2570
|
+
};
|
|
2571
|
+
function zs(t, e, r) {
|
|
2572
|
+
if (typeof t != "object")
|
|
2573
|
+
throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
|
|
2574
|
+
const n = Object.keys(t);
|
|
2575
|
+
let s = n.length;
|
|
2576
|
+
for (; s-- > 0; ) {
|
|
2577
|
+
const a = n[s], i = Object.prototype.hasOwnProperty.call(e, a) ? e[a] : void 0;
|
|
2578
|
+
if (i) {
|
|
2579
|
+
const l = t[a], f = l === void 0 || i(l, a, t);
|
|
2580
|
+
if (f !== !0)
|
|
2581
|
+
throw new w(
|
|
2582
|
+
"option " + a + " must be " + f,
|
|
2583
|
+
w.ERR_BAD_OPTION_VALUE
|
|
2584
|
+
);
|
|
2585
|
+
continue;
|
|
2586
|
+
}
|
|
2587
|
+
if (r !== !0)
|
|
2588
|
+
throw new w("Unknown option " + a, w.ERR_BAD_OPTION);
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
const Je = {
|
|
2592
|
+
assertOptions: zs,
|
|
2593
|
+
validators: tt
|
|
2594
|
+
}, ne = Je.validators;
|
|
2595
|
+
let me = class {
|
|
2596
|
+
constructor(e) {
|
|
2597
|
+
this.defaults = e || {}, this.interceptors = {
|
|
2598
|
+
request: new Vt(),
|
|
2599
|
+
response: new Vt()
|
|
2600
|
+
};
|
|
2601
|
+
}
|
|
2602
|
+
/**
|
|
2603
|
+
* Dispatch a request
|
|
2604
|
+
*
|
|
2605
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
2606
|
+
* @param {?Object} config
|
|
2607
|
+
*
|
|
2608
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
2609
|
+
*/
|
|
2610
|
+
async request(e, r) {
|
|
2611
|
+
try {
|
|
2612
|
+
return await this._request(e, r);
|
|
2613
|
+
} catch (n) {
|
|
2614
|
+
if (n instanceof Error) {
|
|
2615
|
+
let s = {};
|
|
2616
|
+
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
|
|
2617
|
+
const a = (() => {
|
|
2618
|
+
if (!s.stack)
|
|
2619
|
+
return "";
|
|
2620
|
+
const i = s.stack.indexOf(`
|
|
2621
|
+
`);
|
|
2622
|
+
return i === -1 ? "" : s.stack.slice(i + 1);
|
|
2623
|
+
})();
|
|
2624
|
+
try {
|
|
2625
|
+
if (!n.stack)
|
|
2626
|
+
n.stack = a;
|
|
2627
|
+
else if (a) {
|
|
2628
|
+
const i = a.indexOf(`
|
|
2629
|
+
`), l = i === -1 ? -1 : a.indexOf(`
|
|
2630
|
+
`, i + 1), f = l === -1 ? "" : a.slice(l + 1);
|
|
2631
|
+
String(n.stack).endsWith(f) || (n.stack += `
|
|
2632
|
+
` + a);
|
|
2633
|
+
}
|
|
2634
|
+
} catch {
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
throw n;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
_request(e, r) {
|
|
2641
|
+
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = ye(this.defaults, r);
|
|
2642
|
+
const { transitional: n, paramsSerializer: s, headers: a } = r;
|
|
2643
|
+
n !== void 0 && Je.assertOptions(
|
|
2644
|
+
n,
|
|
2645
|
+
{
|
|
2646
|
+
silentJSONParsing: ne.transitional(ne.boolean),
|
|
2647
|
+
forcedJSONParsing: ne.transitional(ne.boolean),
|
|
2648
|
+
clarifyTimeoutError: ne.transitional(ne.boolean),
|
|
2649
|
+
legacyInterceptorReqResOrdering: ne.transitional(ne.boolean)
|
|
2650
|
+
},
|
|
2651
|
+
!1
|
|
2652
|
+
), s != null && (c.isFunction(s) ? r.paramsSerializer = {
|
|
2653
|
+
serialize: s
|
|
2654
|
+
} : Je.assertOptions(
|
|
2655
|
+
s,
|
|
2656
|
+
{
|
|
2657
|
+
encode: ne.function,
|
|
2658
|
+
serialize: ne.function
|
|
2659
|
+
},
|
|
2660
|
+
!0
|
|
2661
|
+
)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), Je.assertOptions(
|
|
2662
|
+
r,
|
|
2663
|
+
{
|
|
2664
|
+
baseUrl: ne.spelling("baseURL"),
|
|
2665
|
+
withXsrfToken: ne.spelling("withXSRFToken")
|
|
2666
|
+
},
|
|
2667
|
+
!0
|
|
2668
|
+
), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
2669
|
+
let i = a && c.merge(a.common, a[r.method]);
|
|
2670
|
+
a && c.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (m) => {
|
|
2671
|
+
delete a[m];
|
|
2672
|
+
}), r.headers = Q.concat(i, a);
|
|
2673
|
+
const l = [];
|
|
2674
|
+
let f = !0;
|
|
2675
|
+
this.interceptors.request.forEach(function(y) {
|
|
2676
|
+
if (typeof y.runWhen == "function" && y.runWhen(r) === !1)
|
|
2677
|
+
return;
|
|
2678
|
+
f = f && y.synchronous;
|
|
2679
|
+
const g = r.transitional || wt;
|
|
2680
|
+
g && g.legacyInterceptorReqResOrdering ? l.unshift(y.fulfilled, y.rejected) : l.push(y.fulfilled, y.rejected);
|
|
2681
|
+
});
|
|
2682
|
+
const d = [];
|
|
2683
|
+
this.interceptors.response.forEach(function(y) {
|
|
2684
|
+
d.push(y.fulfilled, y.rejected);
|
|
2685
|
+
});
|
|
2686
|
+
let u, h = 0, _;
|
|
2687
|
+
if (!f) {
|
|
2688
|
+
const m = [rr.bind(this), void 0];
|
|
2689
|
+
for (m.unshift(...l), m.push(...d), _ = m.length, u = Promise.resolve(r); h < _; )
|
|
2690
|
+
u = u.then(m[h++], m[h++]);
|
|
2691
|
+
return u;
|
|
2692
|
+
}
|
|
2693
|
+
_ = l.length;
|
|
2694
|
+
let k = r;
|
|
2695
|
+
for (; h < _; ) {
|
|
2696
|
+
const m = l[h++], y = l[h++];
|
|
2697
|
+
try {
|
|
2698
|
+
k = m(k);
|
|
2699
|
+
} catch (g) {
|
|
2700
|
+
y.call(this, g);
|
|
2701
|
+
break;
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
try {
|
|
2705
|
+
u = rr.call(this, k);
|
|
2706
|
+
} catch (m) {
|
|
2707
|
+
return Promise.reject(m);
|
|
2708
|
+
}
|
|
2709
|
+
for (h = 0, _ = d.length; h < _; )
|
|
2710
|
+
u = u.then(d[h++], d[h++]);
|
|
2711
|
+
return u;
|
|
2712
|
+
}
|
|
2713
|
+
getUri(e) {
|
|
2714
|
+
e = ye(this.defaults, e);
|
|
2715
|
+
const r = vr(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
2716
|
+
return Er(r, e.params, e.paramsSerializer);
|
|
2717
|
+
}
|
|
2718
|
+
};
|
|
2719
|
+
c.forEach(["delete", "get", "head", "options"], function(e) {
|
|
2720
|
+
me.prototype[e] = function(r, n) {
|
|
2721
|
+
return this.request(
|
|
2722
|
+
ye(n || {}, {
|
|
2723
|
+
method: e,
|
|
2724
|
+
url: r,
|
|
2725
|
+
data: (n || {}).data
|
|
2726
|
+
})
|
|
2727
|
+
);
|
|
2728
|
+
};
|
|
2729
|
+
});
|
|
2730
|
+
c.forEach(["post", "put", "patch"], function(e) {
|
|
2731
|
+
function r(n) {
|
|
2732
|
+
return function(a, i, l) {
|
|
2733
|
+
return this.request(
|
|
2734
|
+
ye(l || {}, {
|
|
2735
|
+
method: e,
|
|
2736
|
+
headers: n ? {
|
|
2737
|
+
"Content-Type": "multipart/form-data"
|
|
2738
|
+
} : {},
|
|
2739
|
+
url: a,
|
|
2740
|
+
data: i
|
|
2741
|
+
})
|
|
2742
|
+
);
|
|
2743
|
+
};
|
|
2744
|
+
}
|
|
2745
|
+
me.prototype[e] = r(), me.prototype[e + "Form"] = r(!0);
|
|
2746
|
+
});
|
|
2747
|
+
let Js = class Ar {
|
|
2748
|
+
constructor(e) {
|
|
2749
|
+
if (typeof e != "function")
|
|
2750
|
+
throw new TypeError("executor must be a function.");
|
|
2751
|
+
let r;
|
|
2752
|
+
this.promise = new Promise(function(a) {
|
|
2753
|
+
r = a;
|
|
2754
|
+
});
|
|
2755
|
+
const n = this;
|
|
2756
|
+
this.promise.then((s) => {
|
|
2757
|
+
if (!n._listeners) return;
|
|
2758
|
+
let a = n._listeners.length;
|
|
2759
|
+
for (; a-- > 0; )
|
|
2760
|
+
n._listeners[a](s);
|
|
2761
|
+
n._listeners = null;
|
|
2762
|
+
}), this.promise.then = (s) => {
|
|
2763
|
+
let a;
|
|
2764
|
+
const i = new Promise((l) => {
|
|
2765
|
+
n.subscribe(l), a = l;
|
|
2766
|
+
}).then(s);
|
|
2767
|
+
return i.cancel = function() {
|
|
2768
|
+
n.unsubscribe(a);
|
|
2769
|
+
}, i;
|
|
2770
|
+
}, e(function(a, i, l) {
|
|
2771
|
+
n.reason || (n.reason = new Ne(a, i, l), r(n.reason));
|
|
2772
|
+
});
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
2776
|
+
*/
|
|
2777
|
+
throwIfRequested() {
|
|
2778
|
+
if (this.reason)
|
|
2779
|
+
throw this.reason;
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Subscribe to the cancel signal
|
|
2783
|
+
*/
|
|
2784
|
+
subscribe(e) {
|
|
2785
|
+
if (this.reason) {
|
|
2786
|
+
e(this.reason);
|
|
2787
|
+
return;
|
|
2788
|
+
}
|
|
2789
|
+
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
2790
|
+
}
|
|
2791
|
+
/**
|
|
2792
|
+
* Unsubscribe from the cancel signal
|
|
2793
|
+
*/
|
|
2794
|
+
unsubscribe(e) {
|
|
2795
|
+
if (!this._listeners)
|
|
2796
|
+
return;
|
|
2797
|
+
const r = this._listeners.indexOf(e);
|
|
2798
|
+
r !== -1 && this._listeners.splice(r, 1);
|
|
2799
|
+
}
|
|
2800
|
+
toAbortSignal() {
|
|
2801
|
+
const e = new AbortController(), r = (n) => {
|
|
2802
|
+
e.abort(n);
|
|
2803
|
+
};
|
|
2804
|
+
return this.subscribe(r), e.signal.unsubscribe = () => this.unsubscribe(r), e.signal;
|
|
2805
|
+
}
|
|
2806
|
+
/**
|
|
2807
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
2808
|
+
* cancels the `CancelToken`.
|
|
2809
|
+
*/
|
|
2810
|
+
static source() {
|
|
2811
|
+
let e;
|
|
2812
|
+
return {
|
|
2813
|
+
token: new Ar(function(s) {
|
|
2814
|
+
e = s;
|
|
2815
|
+
}),
|
|
2816
|
+
cancel: e
|
|
2817
|
+
};
|
|
2818
|
+
}
|
|
2819
|
+
};
|
|
2820
|
+
function Ys(t) {
|
|
2821
|
+
return function(r) {
|
|
2822
|
+
return t.apply(null, r);
|
|
2823
|
+
};
|
|
2824
|
+
}
|
|
2825
|
+
function Gs(t) {
|
|
2826
|
+
return c.isObject(t) && t.isAxiosError === !0;
|
|
2827
|
+
}
|
|
2828
|
+
const bt = {
|
|
2829
|
+
Continue: 100,
|
|
2830
|
+
SwitchingProtocols: 101,
|
|
2831
|
+
Processing: 102,
|
|
2832
|
+
EarlyHints: 103,
|
|
2833
|
+
Ok: 200,
|
|
2834
|
+
Created: 201,
|
|
2835
|
+
Accepted: 202,
|
|
2836
|
+
NonAuthoritativeInformation: 203,
|
|
2837
|
+
NoContent: 204,
|
|
2838
|
+
ResetContent: 205,
|
|
2839
|
+
PartialContent: 206,
|
|
2840
|
+
MultiStatus: 207,
|
|
2841
|
+
AlreadyReported: 208,
|
|
2842
|
+
ImUsed: 226,
|
|
2843
|
+
MultipleChoices: 300,
|
|
2844
|
+
MovedPermanently: 301,
|
|
2845
|
+
Found: 302,
|
|
2846
|
+
SeeOther: 303,
|
|
2847
|
+
NotModified: 304,
|
|
2848
|
+
UseProxy: 305,
|
|
2849
|
+
Unused: 306,
|
|
2850
|
+
TemporaryRedirect: 307,
|
|
2851
|
+
PermanentRedirect: 308,
|
|
2852
|
+
BadRequest: 400,
|
|
2853
|
+
Unauthorized: 401,
|
|
2854
|
+
PaymentRequired: 402,
|
|
2855
|
+
Forbidden: 403,
|
|
2856
|
+
NotFound: 404,
|
|
2857
|
+
MethodNotAllowed: 405,
|
|
2858
|
+
NotAcceptable: 406,
|
|
2859
|
+
ProxyAuthenticationRequired: 407,
|
|
2860
|
+
RequestTimeout: 408,
|
|
2861
|
+
Conflict: 409,
|
|
2862
|
+
Gone: 410,
|
|
2863
|
+
LengthRequired: 411,
|
|
2864
|
+
PreconditionFailed: 412,
|
|
2865
|
+
PayloadTooLarge: 413,
|
|
2866
|
+
UriTooLong: 414,
|
|
2867
|
+
UnsupportedMediaType: 415,
|
|
2868
|
+
RangeNotSatisfiable: 416,
|
|
2869
|
+
ExpectationFailed: 417,
|
|
2870
|
+
ImATeapot: 418,
|
|
2871
|
+
MisdirectedRequest: 421,
|
|
2872
|
+
UnprocessableEntity: 422,
|
|
2873
|
+
Locked: 423,
|
|
2874
|
+
FailedDependency: 424,
|
|
2875
|
+
TooEarly: 425,
|
|
2876
|
+
UpgradeRequired: 426,
|
|
2877
|
+
PreconditionRequired: 428,
|
|
2878
|
+
TooManyRequests: 429,
|
|
2879
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
2880
|
+
UnavailableForLegalReasons: 451,
|
|
2881
|
+
InternalServerError: 500,
|
|
2882
|
+
NotImplemented: 501,
|
|
2883
|
+
BadGateway: 502,
|
|
2884
|
+
ServiceUnavailable: 503,
|
|
2885
|
+
GatewayTimeout: 504,
|
|
2886
|
+
HttpVersionNotSupported: 505,
|
|
2887
|
+
VariantAlsoNegotiates: 506,
|
|
2888
|
+
InsufficientStorage: 507,
|
|
2889
|
+
LoopDetected: 508,
|
|
2890
|
+
NotExtended: 510,
|
|
2891
|
+
NetworkAuthenticationRequired: 511,
|
|
2892
|
+
WebServerIsDown: 521,
|
|
2893
|
+
ConnectionTimedOut: 522,
|
|
2894
|
+
OriginIsUnreachable: 523,
|
|
2895
|
+
TimeoutOccurred: 524,
|
|
2896
|
+
SslHandshakeFailed: 525,
|
|
2897
|
+
InvalidSslCertificate: 526
|
|
2898
|
+
};
|
|
2899
|
+
Object.entries(bt).forEach(([t, e]) => {
|
|
2900
|
+
bt[e] = t;
|
|
2901
|
+
});
|
|
2902
|
+
function Cr(t) {
|
|
2903
|
+
const e = new me(t), r = lr(me.prototype.request, e);
|
|
2904
|
+
return c.extend(r, me.prototype, e, { allOwnKeys: !0 }), c.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(s) {
|
|
2905
|
+
return Cr(ye(t, s));
|
|
2906
|
+
}, r;
|
|
2907
|
+
}
|
|
2908
|
+
const j = Cr(Fe);
|
|
2909
|
+
j.Axios = me;
|
|
2910
|
+
j.CanceledError = Ne;
|
|
2911
|
+
j.CancelToken = Js;
|
|
2912
|
+
j.isCancel = Rr;
|
|
2913
|
+
j.VERSION = Sr;
|
|
2914
|
+
j.toFormData = et;
|
|
2915
|
+
j.AxiosError = w;
|
|
2916
|
+
j.Cancel = j.CanceledError;
|
|
2917
|
+
j.all = function(e) {
|
|
2918
|
+
return Promise.all(e);
|
|
2919
|
+
};
|
|
2920
|
+
j.spread = Ys;
|
|
2921
|
+
j.isAxiosError = Gs;
|
|
2922
|
+
j.mergeConfig = ye;
|
|
2923
|
+
j.AxiosHeaders = Q;
|
|
2924
|
+
j.formToJSON = (t) => wr(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
2925
|
+
j.getAdapter = Or.getAdapter;
|
|
2926
|
+
j.HttpStatusCode = bt;
|
|
2927
|
+
j.default = j;
|
|
2928
|
+
const {
|
|
2929
|
+
Axios: To,
|
|
2930
|
+
AxiosError: vo,
|
|
2931
|
+
CanceledError: _o,
|
|
2932
|
+
isCancel: xo,
|
|
2933
|
+
CancelToken: Oo,
|
|
2934
|
+
VERSION: So,
|
|
2935
|
+
all: Ao,
|
|
2936
|
+
Cancel: Co,
|
|
2937
|
+
isAxiosError: Po,
|
|
2938
|
+
spread: ko,
|
|
2939
|
+
toFormData: Lo,
|
|
2940
|
+
AxiosHeaders: Do,
|
|
2941
|
+
HttpStatusCode: Fo,
|
|
2942
|
+
formToJSON: No,
|
|
2943
|
+
getAdapter: jo,
|
|
2944
|
+
mergeConfig: Uo
|
|
2945
|
+
} = j, sr = "https://translation.googleapis.com/language/translate/v2", Xs = /* @__PURE__ */ new Set([408, 425, 429, 500, 502, 503, 504]), Qs = (t) => !!t, Zs = (t) => j.isAxiosError(t);
|
|
2946
|
+
class eo {
|
|
2947
|
+
constructor(e) {
|
|
2948
|
+
te(this, "type", "google");
|
|
2949
|
+
te(this, "axios");
|
|
2950
|
+
this.config = e, this.axios = j.create({
|
|
2951
|
+
baseURL: e.endpoint ?? sr,
|
|
2952
|
+
headers: {
|
|
2953
|
+
"Content-Type": "application/json",
|
|
2954
|
+
...e.headers
|
|
2955
|
+
}
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
isAvailable() {
|
|
2959
|
+
return this.config.apiKey || Qs(this.config.headers) ? { available: !0 } : {
|
|
2960
|
+
available: !0
|
|
2961
|
+
};
|
|
2962
|
+
}
|
|
2963
|
+
async translate(e, r) {
|
|
2964
|
+
var f, d, u;
|
|
2965
|
+
const n = {
|
|
2966
|
+
q: e.text,
|
|
2967
|
+
target: e.targetLanguage,
|
|
2968
|
+
format: "text"
|
|
2969
|
+
};
|
|
2970
|
+
e.sourceLanguage && e.sourceLanguage !== "auto" && (n.source = e.sourceLanguage), e.glossary && Object.keys(e.glossary).length > 0 && (n.glossaryConfig = {
|
|
2971
|
+
glossaryData: {
|
|
2972
|
+
languagePair: {
|
|
2973
|
+
sourceLanguageCode: e.sourceLanguage ?? "auto",
|
|
2974
|
+
targetLanguageCode: e.targetLanguage
|
|
2975
|
+
},
|
|
2976
|
+
terms: Object.entries(e.glossary).map(([h, _]) => ({
|
|
2977
|
+
sourceText: h,
|
|
2978
|
+
targetText: _
|
|
2979
|
+
}))
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
const s = {
|
|
2983
|
+
...this.config.headers,
|
|
2984
|
+
...r == null ? void 0 : r.headers
|
|
2985
|
+
}, i = (u = (d = (f = (await this.axios.post(
|
|
2986
|
+
"",
|
|
2987
|
+
n,
|
|
2988
|
+
{
|
|
2989
|
+
headers: s,
|
|
2990
|
+
params: this.createQueryParams(),
|
|
2991
|
+
timeout: r == null ? void 0 : r.timeoutMs,
|
|
2992
|
+
signal: r == null ? void 0 : r.signal
|
|
2993
|
+
}
|
|
2994
|
+
)).data) == null ? void 0 : f.data) == null ? void 0 : d.translations) == null ? void 0 : u[0];
|
|
2995
|
+
if (!(i != null && i.translatedText))
|
|
2996
|
+
throw new Error(
|
|
2997
|
+
"Google Translate response did not include translatedText"
|
|
2998
|
+
);
|
|
2999
|
+
const l = {
|
|
3000
|
+
endpoint: this.config.endpoint ?? sr
|
|
3001
|
+
};
|
|
3002
|
+
return i.model && (l.model = i.model), this.config.projectId && (l.projectId = this.config.projectId), this.config.region && (l.region = this.config.region), {
|
|
3003
|
+
translatedText: i.translatedText,
|
|
3004
|
+
detectedSourceLanguage: i.detectedSourceLanguage,
|
|
3005
|
+
providerMetadata: l
|
|
3006
|
+
};
|
|
3007
|
+
}
|
|
3008
|
+
normalizeError(e) {
|
|
3009
|
+
var r, n, s, a, i;
|
|
3010
|
+
if (Zs(e)) {
|
|
3011
|
+
const l = (r = e.response) == null ? void 0 : r.status, f = ((n = e.response) == null ? void 0 : n.data) ?? {}, d = ((s = f.error) == null ? void 0 : s.message) ?? e.message ?? "Google Translate request failed";
|
|
3012
|
+
return {
|
|
3013
|
+
code: String(((a = f.error) == null ? void 0 : a.code) ?? l ?? "E_GOOGLE"),
|
|
3014
|
+
message: d,
|
|
3015
|
+
retryable: l ? Xs.has(l) : !1,
|
|
3016
|
+
details: {
|
|
3017
|
+
status: l,
|
|
3018
|
+
data: f,
|
|
3019
|
+
headers: (i = e.response) == null ? void 0 : i.headers
|
|
3020
|
+
}
|
|
3021
|
+
};
|
|
3022
|
+
}
|
|
3023
|
+
return e instanceof Error ? {
|
|
3024
|
+
code: e.name || "unknown_error",
|
|
3025
|
+
message: e.message,
|
|
3026
|
+
retryable: !1,
|
|
3027
|
+
details: e
|
|
3028
|
+
} : {
|
|
3029
|
+
code: "unknown_error",
|
|
3030
|
+
message: "Unknown provider error",
|
|
3031
|
+
retryable: !1,
|
|
3032
|
+
details: e
|
|
3033
|
+
};
|
|
3034
|
+
}
|
|
3035
|
+
createQueryParams() {
|
|
3036
|
+
if (this.config.apiKey)
|
|
3037
|
+
return {
|
|
3038
|
+
key: this.config.apiKey
|
|
3039
|
+
};
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
const pt = (t) => {
|
|
3043
|
+
if (!t)
|
|
3044
|
+
throw new Error("Provider instance is null or undefined");
|
|
3045
|
+
if (!t.type)
|
|
3046
|
+
throw new Error("Provider missing required 'type' property");
|
|
3047
|
+
if (typeof t.translate != "function")
|
|
3048
|
+
throw new Error("Provider missing required 'translate' method");
|
|
3049
|
+
if (t.isAvailable && typeof t.isAvailable != "function")
|
|
3050
|
+
throw new Error("Provider 'isAvailable' must be a function");
|
|
3051
|
+
if (t.normalizeError && typeof t.normalizeError != "function")
|
|
3052
|
+
throw new Error("Provider 'normalizeError' must be a function");
|
|
3053
|
+
}, to = (t) => {
|
|
3054
|
+
if (t.id === "google") {
|
|
3055
|
+
const e = new eo(t);
|
|
3056
|
+
return pt(e), e;
|
|
3057
|
+
}
|
|
3058
|
+
if (t.implementation)
|
|
3059
|
+
return pt(t.implementation), t.implementation;
|
|
3060
|
+
if (t.factory) {
|
|
3061
|
+
const e = t.factory();
|
|
3062
|
+
return pt(e), e;
|
|
3063
|
+
}
|
|
3064
|
+
throw new Error(
|
|
3065
|
+
"Custom provider configuration must include either 'implementation' or 'factory'"
|
|
3066
|
+
);
|
|
3067
|
+
}, ro = "translator", no = 5e3, or = 3e4, so = "::", oo = (t) => {
|
|
3068
|
+
var r, n;
|
|
3069
|
+
return ((n = (r = navigator == null ? void 0 : navigator.language) == null ? void 0 : r.split("-")) == null ? void 0 : n[0]) || t;
|
|
3070
|
+
}, ao = (t) => localStorage.getItem(t), io = (t, e) => {
|
|
3071
|
+
localStorage.setItem(t, e);
|
|
3072
|
+
}, lo = (t) => t ? t instanceof Set ? new Set(t) : new Set(t) : /* @__PURE__ */ new Set(), Pr = (t, e) => ({
|
|
3073
|
+
scope: ro,
|
|
3074
|
+
event: t,
|
|
3075
|
+
...e
|
|
3076
|
+
}), Pe = (t, e) => {
|
|
3077
|
+
console.warn("[vbss-translator]", Pr(t, e));
|
|
3078
|
+
}, G = (t, e) => {
|
|
3079
|
+
console.debug("[vbss-translator]", Pr(t, e));
|
|
3080
|
+
}, co = () => ({
|
|
3081
|
+
warn: (t, e) => {
|
|
3082
|
+
Pe(t, e ?? {});
|
|
3083
|
+
},
|
|
3084
|
+
debug: (t, e) => {
|
|
3085
|
+
G(t, e ?? {});
|
|
3086
|
+
}
|
|
3087
|
+
}), uo = (t) => {
|
|
3088
|
+
const {
|
|
3089
|
+
provider: e,
|
|
3090
|
+
cache: r,
|
|
3091
|
+
alwaysExternalKeys: n,
|
|
3092
|
+
enabled: s,
|
|
3093
|
+
timeoutMs: a,
|
|
3094
|
+
debug: i,
|
|
3095
|
+
...l
|
|
3096
|
+
} = t ?? {};
|
|
3097
|
+
return {
|
|
3098
|
+
enabled: s ?? !1,
|
|
3099
|
+
timeoutMs: a ?? no,
|
|
3100
|
+
debug: i ?? !1,
|
|
3101
|
+
provider: {
|
|
3102
|
+
...fo,
|
|
3103
|
+
...e
|
|
3104
|
+
},
|
|
3105
|
+
cache: {
|
|
3106
|
+
...ho,
|
|
3107
|
+
...r
|
|
3108
|
+
},
|
|
3109
|
+
alwaysExternalKeys: lo(n),
|
|
3110
|
+
...l
|
|
3111
|
+
};
|
|
3112
|
+
}, fo = {
|
|
3113
|
+
id: "google"
|
|
3114
|
+
}, ho = {
|
|
3115
|
+
enabled: !1,
|
|
3116
|
+
ttlMs: 36e5
|
|
3117
|
+
}, po = (t, e) => `${t}${so}${e}`, go = (t) => t ? new Map(t) : /* @__PURE__ */ new Map(), mo = (t, e) => {
|
|
3118
|
+
const r = t.toLocaleLowerCase();
|
|
3119
|
+
return e.find(
|
|
3120
|
+
(n) => Object.values(n).some(
|
|
3121
|
+
(s) => s.toLocaleLowerCase() === r
|
|
3122
|
+
)
|
|
3123
|
+
);
|
|
3124
|
+
}, Io = ({
|
|
3125
|
+
children: t,
|
|
3126
|
+
translations: e,
|
|
3127
|
+
defaultLanguage: r = "en",
|
|
3128
|
+
persist: n = !1,
|
|
3129
|
+
persistKey: s = "language",
|
|
3130
|
+
autoDetectLanguage: a = !1,
|
|
3131
|
+
externalTranslation: i
|
|
3132
|
+
}) => {
|
|
3133
|
+
const l = ce(
|
|
3134
|
+
() => uo(i),
|
|
3135
|
+
[i]
|
|
3136
|
+
), [f, d] = Be(
|
|
3137
|
+
() => new Set(l.alwaysExternalKeys)
|
|
3138
|
+
);
|
|
3139
|
+
lt(() => {
|
|
3140
|
+
d((b) => {
|
|
3141
|
+
const R = new Set(l.alwaysExternalKeys);
|
|
3142
|
+
return b.forEach((x) => R.add(x)), R;
|
|
3143
|
+
});
|
|
3144
|
+
}, [l]);
|
|
3145
|
+
const u = $e((b) => {
|
|
3146
|
+
d((R) => {
|
|
3147
|
+
if (R.has(b))
|
|
3148
|
+
return R;
|
|
3149
|
+
const x = new Set(R);
|
|
3150
|
+
return x.add(b), x;
|
|
3151
|
+
});
|
|
3152
|
+
}, []), h = ce(
|
|
3153
|
+
() => ({
|
|
3154
|
+
...l,
|
|
3155
|
+
alwaysExternalKeys: f
|
|
3156
|
+
}),
|
|
3157
|
+
[l, f]
|
|
3158
|
+
), _ = n ? ao(s) : null, k = a ? oo(r) : null, [m, y] = Be(
|
|
3159
|
+
_ ?? k ?? r
|
|
3160
|
+
);
|
|
3161
|
+
lt(() => {
|
|
3162
|
+
n && io(s, m);
|
|
3163
|
+
}, [m, n, s]);
|
|
3164
|
+
const g = ce(
|
|
3165
|
+
() => Object.keys(e[0] || {}),
|
|
3166
|
+
[e]
|
|
3167
|
+
), A = ce(() => co(), []), L = ce(
|
|
3168
|
+
() => new gn(h.cache),
|
|
3169
|
+
[h.cache]
|
|
3170
|
+
), D = ce(() => {
|
|
3171
|
+
let b;
|
|
3172
|
+
try {
|
|
3173
|
+
if (b = to(h.provider), h.debug && G("TranslatorProvider_provider_created", {
|
|
3174
|
+
providerType: b.type,
|
|
3175
|
+
providerId: h.provider.id,
|
|
3176
|
+
timestamp: Date.now()
|
|
3177
|
+
}), b.isAvailable) {
|
|
3178
|
+
const R = b.isAvailable();
|
|
3179
|
+
R.available ? h.debug && G("TranslatorProvider_provider_available", {
|
|
3180
|
+
providerType: b.type,
|
|
3181
|
+
providerId: h.provider.id,
|
|
3182
|
+
timestamp: Date.now()
|
|
3183
|
+
}) : Pe("TranslatorProvider_provider_unavailable", {
|
|
3184
|
+
providerType: b.type,
|
|
3185
|
+
providerId: h.provider.id,
|
|
3186
|
+
reason: R.reason,
|
|
3187
|
+
timestamp: Date.now()
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
} catch (R) {
|
|
3191
|
+
throw Pe("TranslatorProvider_provider_creation_failed", {
|
|
3192
|
+
providerId: h.provider.id,
|
|
3193
|
+
error: R instanceof Error ? R.message : "Unknown error",
|
|
3194
|
+
timestamp: Date.now()
|
|
3195
|
+
}), R;
|
|
3196
|
+
}
|
|
3197
|
+
return new pn({
|
|
3198
|
+
provider: b,
|
|
3199
|
+
config: h,
|
|
3200
|
+
cache: h.cache.enabled ? L : void 0,
|
|
3201
|
+
logger: A
|
|
3202
|
+
});
|
|
3203
|
+
}, [h, A, L]), [C, $] = Be(
|
|
3204
|
+
() => /* @__PURE__ */ new Map()
|
|
3205
|
+
), [se, q] = Be(0), W = sn(!0);
|
|
3206
|
+
lt(() => (h.debug && G("TranslatorProvider_mounted", {
|
|
3207
|
+
timestamp: Date.now()
|
|
3208
|
+
}), W.current = !0, () => {
|
|
3209
|
+
h.debug && G("TranslatorProvider_unmounting", {
|
|
3210
|
+
timestamp: Date.now()
|
|
3211
|
+
}), W.current = !1;
|
|
3212
|
+
}), [h]);
|
|
3213
|
+
const Z = $e(
|
|
3214
|
+
(b, R, x) => {
|
|
3215
|
+
var oe;
|
|
3216
|
+
h.debug && x && G("setExternalStateEntry_called", {
|
|
3217
|
+
targetLanguage: b,
|
|
3218
|
+
key: R,
|
|
3219
|
+
status: x.status,
|
|
3220
|
+
value: x.value,
|
|
3221
|
+
isMounted: W.current
|
|
3222
|
+
});
|
|
3223
|
+
const T = () => {
|
|
3224
|
+
$((U) => {
|
|
3225
|
+
const M = new Map(U), J = go(M.get(b));
|
|
3226
|
+
return x ? (J.set(R, x), M.set(b, J)) : (J.delete(R), J.size > 0 ? M.set(b, J) : M.delete(b)), M;
|
|
3227
|
+
}), (x == null ? void 0 : x.status) === "resolved" && (h.debug && G("forceUpdate_triggered", {
|
|
3228
|
+
targetLanguage: b,
|
|
3229
|
+
key: R
|
|
3230
|
+
}), q((U) => U + 1));
|
|
3231
|
+
};
|
|
3232
|
+
typeof process < "u" && ((oe = process.env) == null ? void 0 : oe.NODE_ENV) === "test" ? T() : on(() => {
|
|
3233
|
+
T();
|
|
3234
|
+
});
|
|
3235
|
+
},
|
|
3236
|
+
[h, q]
|
|
3237
|
+
), fe = $e(
|
|
3238
|
+
(b) => {
|
|
3239
|
+
var R;
|
|
3240
|
+
D.isEnabled() && (Z(b.targetLanguage, b.key, {
|
|
3241
|
+
status: "pending",
|
|
3242
|
+
value: b.displayValue
|
|
3243
|
+
}), D.translate({
|
|
3244
|
+
key: b.key,
|
|
3245
|
+
text: b.originalText,
|
|
3246
|
+
targetLanguage: b.targetLanguage,
|
|
3247
|
+
sourceLanguage: b.sourceLanguage,
|
|
3248
|
+
signal: (R = b.options) == null ? void 0 : R.signal
|
|
3249
|
+
}).then((x) => {
|
|
3250
|
+
if (h.debug && G("translation_promise_resolved", {
|
|
3251
|
+
key: b.key,
|
|
3252
|
+
targetLanguage: b.targetLanguage,
|
|
3253
|
+
isMounted: W.current,
|
|
3254
|
+
hasResult: !!x,
|
|
3255
|
+
hasTranslatedText: !!(x && x.translatedText),
|
|
3256
|
+
translatedText: x == null ? void 0 : x.translatedText
|
|
3257
|
+
}), x && x.translatedText) {
|
|
3258
|
+
h.debug && G("translation_applying_resolved", {
|
|
3259
|
+
key: b.key,
|
|
3260
|
+
targetLanguage: b.targetLanguage,
|
|
3261
|
+
isMounted: W.current,
|
|
3262
|
+
translatedText: x.translatedText
|
|
3263
|
+
}), Z(b.targetLanguage, b.key, {
|
|
3264
|
+
status: "resolved",
|
|
3265
|
+
value: x.translatedText
|
|
3266
|
+
});
|
|
3267
|
+
return;
|
|
3268
|
+
}
|
|
3269
|
+
h.debug && G("translation_invalid_result", {
|
|
3270
|
+
key: b.key,
|
|
3271
|
+
result: x
|
|
3272
|
+
}), Z(b.targetLanguage, b.key, {
|
|
3273
|
+
status: "error",
|
|
3274
|
+
value: b.displayValue,
|
|
3275
|
+
retryAt: Date.now() + or
|
|
3276
|
+
});
|
|
3277
|
+
}).catch((x) => {
|
|
3278
|
+
h.debug && G("translation_promise_rejected", {
|
|
3279
|
+
key: b.key,
|
|
3280
|
+
targetLanguage: b.targetLanguage,
|
|
3281
|
+
isMounted: W.current,
|
|
3282
|
+
error: (x == null ? void 0 : x.message) || String(x)
|
|
3283
|
+
}), Pe("external_translation_unexpected_rejection", {
|
|
3284
|
+
key: b.key,
|
|
3285
|
+
language: b.targetLanguage,
|
|
3286
|
+
error: x,
|
|
3287
|
+
isMounted: W.current
|
|
3288
|
+
}), Z(b.targetLanguage, b.key, {
|
|
3289
|
+
status: "error",
|
|
3290
|
+
value: b.displayValue,
|
|
3291
|
+
error: x,
|
|
3292
|
+
retryAt: Date.now() + or
|
|
3293
|
+
});
|
|
3294
|
+
}));
|
|
3295
|
+
},
|
|
3296
|
+
[h, Z, D]
|
|
3297
|
+
), le = ce(() => {
|
|
3298
|
+
const b = {};
|
|
3299
|
+
return C.forEach((R, x) => {
|
|
3300
|
+
R.forEach((T, N) => {
|
|
3301
|
+
b[po(N, x)] = T.status === "pending";
|
|
3302
|
+
});
|
|
3303
|
+
}), h.debug && G("isTranslatingRecord_recalculated", {
|
|
3304
|
+
recordSize: Object.keys(b).length,
|
|
3305
|
+
record: { ...b }
|
|
3306
|
+
}), b;
|
|
3307
|
+
}, [C, h]), ie = ce(
|
|
3308
|
+
() => Object.values(le).some(Boolean),
|
|
3309
|
+
[le]
|
|
3310
|
+
), H = $e(
|
|
3311
|
+
(b, R = {}) => {
|
|
3312
|
+
var he;
|
|
3313
|
+
const x = C.get(m), T = x == null ? void 0 : x.get(b);
|
|
3314
|
+
if (h.debug && R.preferExternal && G("t_called", {
|
|
3315
|
+
text: b,
|
|
3316
|
+
language: m,
|
|
3317
|
+
hasStateForLanguage: !!x,
|
|
3318
|
+
existingStateStatus: T == null ? void 0 : T.status,
|
|
3319
|
+
existingStateValue: T == null ? void 0 : T.value,
|
|
3320
|
+
preferExternal: R.preferExternal
|
|
3321
|
+
}), (T == null ? void 0 : T.status) === "resolved" && T.value)
|
|
3322
|
+
return h.debug && G("t_returning_resolved", {
|
|
3323
|
+
text: b,
|
|
3324
|
+
value: T.value
|
|
3325
|
+
}), T.value;
|
|
3326
|
+
const N = mo(b, e), oe = N == null ? void 0 : N[m], U = N ? Object.values(N).find((Ue) => !!Ue) : void 0, M = R.fallbackValue ?? (T == null ? void 0 : T.value) ?? oe ?? U ?? b, J = R.preferExternal === !0 || h.alwaysExternalKeys.has(b), ue = D.isEnabled(), de = typeof oe == "string";
|
|
3327
|
+
if (de || Pe("missing_translation", {
|
|
3328
|
+
key: b,
|
|
3329
|
+
language: m
|
|
3330
|
+
}), !(ue && (J || !de)))
|
|
3331
|
+
return (T == null ? void 0 : T.status) === "pending" && T.value ? T.value : oe ?? M;
|
|
3332
|
+
const xe = Date.now(), be = (T == null ? void 0 : T.status) === "error" && (!T.retryAt || T.retryAt <= xe);
|
|
3333
|
+
if (!T || be) {
|
|
3334
|
+
const Ee = R.sourceLanguage ?? (N && N[r] ? r : void 0), rt = (Ee && (N == null ? void 0 : N[Ee])) ?? (N == null ? void 0 : N[r]) ?? b;
|
|
3335
|
+
fe({
|
|
3336
|
+
key: b,
|
|
3337
|
+
targetLanguage: m,
|
|
3338
|
+
originalText: rt,
|
|
3339
|
+
displayValue: (T == null ? void 0 : T.value) ?? M,
|
|
3340
|
+
sourceLanguage: Ee,
|
|
3341
|
+
options: R
|
|
3342
|
+
});
|
|
3343
|
+
}
|
|
3344
|
+
const ee = ((he = C.get(m)) == null ? void 0 : he.get(b)) ?? T;
|
|
3345
|
+
return (ee == null ? void 0 : ee.status) === "resolved" && ee.value ? ee.value : (ee == null ? void 0 : ee.status) === "pending" ? ee.value ?? M : M;
|
|
3346
|
+
},
|
|
3347
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3348
|
+
[
|
|
3349
|
+
r,
|
|
3350
|
+
h.alwaysExternalKeys,
|
|
3351
|
+
C,
|
|
3352
|
+
m,
|
|
3353
|
+
fe,
|
|
3354
|
+
D,
|
|
3355
|
+
e
|
|
3356
|
+
]
|
|
3357
|
+
), K = ce(
|
|
3358
|
+
() => ({
|
|
3359
|
+
t: H,
|
|
3360
|
+
language: m,
|
|
3361
|
+
languages: g,
|
|
3362
|
+
setLanguage: y,
|
|
3363
|
+
isTranslating: le,
|
|
3364
|
+
isTranslatingAny: ie,
|
|
3365
|
+
registerExternalKey: u,
|
|
3366
|
+
externalConfig: h
|
|
3367
|
+
}),
|
|
3368
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3369
|
+
[
|
|
3370
|
+
H,
|
|
3371
|
+
m,
|
|
3372
|
+
g,
|
|
3373
|
+
y,
|
|
3374
|
+
le,
|
|
3375
|
+
ie,
|
|
3376
|
+
u,
|
|
3377
|
+
h,
|
|
3378
|
+
se
|
|
3379
|
+
]
|
|
3380
|
+
);
|
|
3381
|
+
return /* @__PURE__ */ un.jsx(ir.Provider, { value: K, children: t });
|
|
3382
|
+
}, Mo = () => fn();
|
|
662
3383
|
export {
|
|
663
|
-
|
|
664
|
-
|
|
3384
|
+
Io as TranslatorProvider,
|
|
3385
|
+
to as createTranslationProvider,
|
|
3386
|
+
Mo as useTranslator
|
|
665
3387
|
};
|