@dhedge/trading-widget 0.0.2 → 0.0.3
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/{BPGFTGZB-348a28e3.cjs → BPGFTGZB-2d541509.cjs} +1 -1
- package/{BPGFTGZB-3ace16f5.js → BPGFTGZB-d2a161d1.js} +1 -1
- package/index-391fb5a2.js +38864 -0
- package/index-a69f882e.cjs +217 -0
- package/index.cjs +1 -1
- package/index.js +22 -22
- package/package.json +1 -2
- package/pyth-adapter-1d7e0e82.js +4106 -0
- package/pyth-adapter-4f5ca109.cjs +11 -0
- package/index-09acee2a.js +0 -42963
- package/index-d35b75f0.cjs +0 -227
|
@@ -0,0 +1,4106 @@
|
|
|
1
|
+
var on = Object.defineProperty;
|
|
2
|
+
var sn = (e, t, i) => t in e ? on(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var I = (e, t, i) => (sn(e, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
+
import { c as fe } from "./index-391fb5a2.js";
|
|
5
|
+
import { decodeAbiParameters as at, encodeAbiParameters as Kt } from "viem";
|
|
6
|
+
import "react";
|
|
7
|
+
import "wagmi";
|
|
8
|
+
import "@tanstack/react-query";
|
|
9
|
+
var br = {}, He = {};
|
|
10
|
+
He.byteLength = un;
|
|
11
|
+
He.toByteArray = ln;
|
|
12
|
+
He.fromByteArray = dn;
|
|
13
|
+
var ee = [], K = [], an = typeof Uint8Array < "u" ? Uint8Array : Array, ct = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
14
|
+
for (var we = 0, cn = ct.length; we < cn; ++we)
|
|
15
|
+
ee[we] = ct[we], K[ct.charCodeAt(we)] = we;
|
|
16
|
+
K["-".charCodeAt(0)] = 62;
|
|
17
|
+
K["_".charCodeAt(0)] = 63;
|
|
18
|
+
function xr(e) {
|
|
19
|
+
var t = e.length;
|
|
20
|
+
if (t % 4 > 0)
|
|
21
|
+
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
22
|
+
var i = e.indexOf("=");
|
|
23
|
+
i === -1 && (i = t);
|
|
24
|
+
var o = i === t ? 0 : 4 - i % 4;
|
|
25
|
+
return [i, o];
|
|
26
|
+
}
|
|
27
|
+
function un(e) {
|
|
28
|
+
var t = xr(e), i = t[0], o = t[1];
|
|
29
|
+
return (i + o) * 3 / 4 - o;
|
|
30
|
+
}
|
|
31
|
+
function fn(e, t, i) {
|
|
32
|
+
return (t + i) * 3 / 4 - i;
|
|
33
|
+
}
|
|
34
|
+
function ln(e) {
|
|
35
|
+
var t, i = xr(e), o = i[0], c = i[1], l = new an(fn(e, o, c)), f = 0, u = c > 0 ? o - 4 : o, E;
|
|
36
|
+
for (E = 0; E < u; E += 4)
|
|
37
|
+
t = K[e.charCodeAt(E)] << 18 | K[e.charCodeAt(E + 1)] << 12 | K[e.charCodeAt(E + 2)] << 6 | K[e.charCodeAt(E + 3)], l[f++] = t >> 16 & 255, l[f++] = t >> 8 & 255, l[f++] = t & 255;
|
|
38
|
+
return c === 2 && (t = K[e.charCodeAt(E)] << 2 | K[e.charCodeAt(E + 1)] >> 4, l[f++] = t & 255), c === 1 && (t = K[e.charCodeAt(E)] << 10 | K[e.charCodeAt(E + 1)] << 4 | K[e.charCodeAt(E + 2)] >> 2, l[f++] = t >> 8 & 255, l[f++] = t & 255), l;
|
|
39
|
+
}
|
|
40
|
+
function pn(e) {
|
|
41
|
+
return ee[e >> 18 & 63] + ee[e >> 12 & 63] + ee[e >> 6 & 63] + ee[e & 63];
|
|
42
|
+
}
|
|
43
|
+
function hn(e, t, i) {
|
|
44
|
+
for (var o, c = [], l = t; l < i; l += 3)
|
|
45
|
+
o = (e[l] << 16 & 16711680) + (e[l + 1] << 8 & 65280) + (e[l + 2] & 255), c.push(pn(o));
|
|
46
|
+
return c.join("");
|
|
47
|
+
}
|
|
48
|
+
function dn(e) {
|
|
49
|
+
for (var t, i = e.length, o = i % 3, c = [], l = 16383, f = 0, u = i - o; f < u; f += l)
|
|
50
|
+
c.push(hn(e, f, f + l > u ? u : f + l));
|
|
51
|
+
return o === 1 ? (t = e[i - 1], c.push(
|
|
52
|
+
ee[t >> 2] + ee[t << 4 & 63] + "=="
|
|
53
|
+
)) : o === 2 && (t = (e[i - 2] << 8) + e[i - 1], c.push(
|
|
54
|
+
ee[t >> 10] + ee[t >> 4 & 63] + ee[t << 2 & 63] + "="
|
|
55
|
+
)), c.join("");
|
|
56
|
+
}
|
|
57
|
+
var It = {};
|
|
58
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
59
|
+
It.read = function(e, t, i, o, c) {
|
|
60
|
+
var l, f, u = c * 8 - o - 1, E = (1 << u) - 1, g = E >> 1, w = -7, d = i ? c - 1 : 0, B = i ? -1 : 1, S = e[t + d];
|
|
61
|
+
for (d += B, l = S & (1 << -w) - 1, S >>= -w, w += u; w > 0; l = l * 256 + e[t + d], d += B, w -= 8)
|
|
62
|
+
;
|
|
63
|
+
for (f = l & (1 << -w) - 1, l >>= -w, w += o; w > 0; f = f * 256 + e[t + d], d += B, w -= 8)
|
|
64
|
+
;
|
|
65
|
+
if (l === 0)
|
|
66
|
+
l = 1 - g;
|
|
67
|
+
else {
|
|
68
|
+
if (l === E)
|
|
69
|
+
return f ? NaN : (S ? -1 : 1) * (1 / 0);
|
|
70
|
+
f = f + Math.pow(2, o), l = l - g;
|
|
71
|
+
}
|
|
72
|
+
return (S ? -1 : 1) * f * Math.pow(2, l - o);
|
|
73
|
+
};
|
|
74
|
+
It.write = function(e, t, i, o, c, l) {
|
|
75
|
+
var f, u, E, g = l * 8 - c - 1, w = (1 << g) - 1, d = w >> 1, B = c === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, S = o ? 0 : l - 1, C = o ? 1 : -1, A = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
|
|
76
|
+
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (u = isNaN(t) ? 1 : 0, f = w) : (f = Math.floor(Math.log(t) / Math.LN2), t * (E = Math.pow(2, -f)) < 1 && (f--, E *= 2), f + d >= 1 ? t += B / E : t += B * Math.pow(2, 1 - d), t * E >= 2 && (f++, E /= 2), f + d >= w ? (u = 0, f = w) : f + d >= 1 ? (u = (t * E - 1) * Math.pow(2, c), f = f + d) : (u = t * Math.pow(2, d - 1) * Math.pow(2, c), f = 0)); c >= 8; e[i + S] = u & 255, S += C, u /= 256, c -= 8)
|
|
77
|
+
;
|
|
78
|
+
for (f = f << c | u, g += c; g > 0; e[i + S] = f & 255, S += C, f /= 256, g -= 8)
|
|
79
|
+
;
|
|
80
|
+
e[i + S - C] |= A * 128;
|
|
81
|
+
};
|
|
82
|
+
/*!
|
|
83
|
+
* The buffer module from node.js, for the browser.
|
|
84
|
+
*
|
|
85
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
86
|
+
* @license MIT
|
|
87
|
+
*/
|
|
88
|
+
(function(e) {
|
|
89
|
+
const t = He, i = It, o = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
90
|
+
e.Buffer = u, e.SlowBuffer = J, e.INSPECT_MAX_BYTES = 50;
|
|
91
|
+
const c = 2147483647;
|
|
92
|
+
e.kMaxLength = c, u.TYPED_ARRAY_SUPPORT = l(), !u.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
93
|
+
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
94
|
+
);
|
|
95
|
+
function l() {
|
|
96
|
+
try {
|
|
97
|
+
const s = new Uint8Array(1), r = { foo: function() {
|
|
98
|
+
return 42;
|
|
99
|
+
} };
|
|
100
|
+
return Object.setPrototypeOf(r, Uint8Array.prototype), Object.setPrototypeOf(s, r), s.foo() === 42;
|
|
101
|
+
} catch {
|
|
102
|
+
return !1;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
Object.defineProperty(u.prototype, "parent", {
|
|
106
|
+
enumerable: !0,
|
|
107
|
+
get: function() {
|
|
108
|
+
if (u.isBuffer(this))
|
|
109
|
+
return this.buffer;
|
|
110
|
+
}
|
|
111
|
+
}), Object.defineProperty(u.prototype, "offset", {
|
|
112
|
+
enumerable: !0,
|
|
113
|
+
get: function() {
|
|
114
|
+
if (u.isBuffer(this))
|
|
115
|
+
return this.byteOffset;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
function f(s) {
|
|
119
|
+
if (s > c)
|
|
120
|
+
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
121
|
+
const r = new Uint8Array(s);
|
|
122
|
+
return Object.setPrototypeOf(r, u.prototype), r;
|
|
123
|
+
}
|
|
124
|
+
function u(s, r, n) {
|
|
125
|
+
if (typeof s == "number") {
|
|
126
|
+
if (typeof r == "string")
|
|
127
|
+
throw new TypeError(
|
|
128
|
+
'The "string" argument must be of type string. Received type number'
|
|
129
|
+
);
|
|
130
|
+
return d(s);
|
|
131
|
+
}
|
|
132
|
+
return E(s, r, n);
|
|
133
|
+
}
|
|
134
|
+
u.poolSize = 8192;
|
|
135
|
+
function E(s, r, n) {
|
|
136
|
+
if (typeof s == "string")
|
|
137
|
+
return B(s, r);
|
|
138
|
+
if (ArrayBuffer.isView(s))
|
|
139
|
+
return C(s);
|
|
140
|
+
if (s == null)
|
|
141
|
+
throw new TypeError(
|
|
142
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
143
|
+
);
|
|
144
|
+
if (Q(s, ArrayBuffer) || s && Q(s.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Q(s, SharedArrayBuffer) || s && Q(s.buffer, SharedArrayBuffer)))
|
|
145
|
+
return A(s, r, n);
|
|
146
|
+
if (typeof s == "number")
|
|
147
|
+
throw new TypeError(
|
|
148
|
+
'The "value" argument must not be of type number. Received type number'
|
|
149
|
+
);
|
|
150
|
+
const a = s.valueOf && s.valueOf();
|
|
151
|
+
if (a != null && a !== s)
|
|
152
|
+
return u.from(a, r, n);
|
|
153
|
+
const p = D(s);
|
|
154
|
+
if (p)
|
|
155
|
+
return p;
|
|
156
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof s[Symbol.toPrimitive] == "function")
|
|
157
|
+
return u.from(s[Symbol.toPrimitive]("string"), r, n);
|
|
158
|
+
throw new TypeError(
|
|
159
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof s
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
u.from = function(s, r, n) {
|
|
163
|
+
return E(s, r, n);
|
|
164
|
+
}, Object.setPrototypeOf(u.prototype, Uint8Array.prototype), Object.setPrototypeOf(u, Uint8Array);
|
|
165
|
+
function g(s) {
|
|
166
|
+
if (typeof s != "number")
|
|
167
|
+
throw new TypeError('"size" argument must be of type number');
|
|
168
|
+
if (s < 0)
|
|
169
|
+
throw new RangeError('The value "' + s + '" is invalid for option "size"');
|
|
170
|
+
}
|
|
171
|
+
function w(s, r, n) {
|
|
172
|
+
return g(s), s <= 0 ? f(s) : r !== void 0 ? typeof n == "string" ? f(s).fill(r, n) : f(s).fill(r) : f(s);
|
|
173
|
+
}
|
|
174
|
+
u.alloc = function(s, r, n) {
|
|
175
|
+
return w(s, r, n);
|
|
176
|
+
};
|
|
177
|
+
function d(s) {
|
|
178
|
+
return g(s), f(s < 0 ? 0 : N(s) | 0);
|
|
179
|
+
}
|
|
180
|
+
u.allocUnsafe = function(s) {
|
|
181
|
+
return d(s);
|
|
182
|
+
}, u.allocUnsafeSlow = function(s) {
|
|
183
|
+
return d(s);
|
|
184
|
+
};
|
|
185
|
+
function B(s, r) {
|
|
186
|
+
if ((typeof r != "string" || r === "") && (r = "utf8"), !u.isEncoding(r))
|
|
187
|
+
throw new TypeError("Unknown encoding: " + r);
|
|
188
|
+
const n = L(s, r) | 0;
|
|
189
|
+
let a = f(n);
|
|
190
|
+
const p = a.write(s, r);
|
|
191
|
+
return p !== n && (a = a.slice(0, p)), a;
|
|
192
|
+
}
|
|
193
|
+
function S(s) {
|
|
194
|
+
const r = s.length < 0 ? 0 : N(s.length) | 0, n = f(r);
|
|
195
|
+
for (let a = 0; a < r; a += 1)
|
|
196
|
+
n[a] = s[a] & 255;
|
|
197
|
+
return n;
|
|
198
|
+
}
|
|
199
|
+
function C(s) {
|
|
200
|
+
if (Q(s, Uint8Array)) {
|
|
201
|
+
const r = new Uint8Array(s);
|
|
202
|
+
return A(r.buffer, r.byteOffset, r.byteLength);
|
|
203
|
+
}
|
|
204
|
+
return S(s);
|
|
205
|
+
}
|
|
206
|
+
function A(s, r, n) {
|
|
207
|
+
if (r < 0 || s.byteLength < r)
|
|
208
|
+
throw new RangeError('"offset" is outside of buffer bounds');
|
|
209
|
+
if (s.byteLength < r + (n || 0))
|
|
210
|
+
throw new RangeError('"length" is outside of buffer bounds');
|
|
211
|
+
let a;
|
|
212
|
+
return r === void 0 && n === void 0 ? a = new Uint8Array(s) : n === void 0 ? a = new Uint8Array(s, r) : a = new Uint8Array(s, r, n), Object.setPrototypeOf(a, u.prototype), a;
|
|
213
|
+
}
|
|
214
|
+
function D(s) {
|
|
215
|
+
if (u.isBuffer(s)) {
|
|
216
|
+
const r = N(s.length) | 0, n = f(r);
|
|
217
|
+
return n.length === 0 || s.copy(n, 0, 0, r), n;
|
|
218
|
+
}
|
|
219
|
+
if (s.length !== void 0)
|
|
220
|
+
return typeof s.length != "number" || st(s.length) ? f(0) : S(s);
|
|
221
|
+
if (s.type === "Buffer" && Array.isArray(s.data))
|
|
222
|
+
return S(s.data);
|
|
223
|
+
}
|
|
224
|
+
function N(s) {
|
|
225
|
+
if (s >= c)
|
|
226
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + c.toString(16) + " bytes");
|
|
227
|
+
return s | 0;
|
|
228
|
+
}
|
|
229
|
+
function J(s) {
|
|
230
|
+
return +s != s && (s = 0), u.alloc(+s);
|
|
231
|
+
}
|
|
232
|
+
u.isBuffer = function(r) {
|
|
233
|
+
return r != null && r._isBuffer === !0 && r !== u.prototype;
|
|
234
|
+
}, u.compare = function(r, n) {
|
|
235
|
+
if (Q(r, Uint8Array) && (r = u.from(r, r.offset, r.byteLength)), Q(n, Uint8Array) && (n = u.from(n, n.offset, n.byteLength)), !u.isBuffer(r) || !u.isBuffer(n))
|
|
236
|
+
throw new TypeError(
|
|
237
|
+
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
238
|
+
);
|
|
239
|
+
if (r === n)
|
|
240
|
+
return 0;
|
|
241
|
+
let a = r.length, p = n.length;
|
|
242
|
+
for (let h = 0, m = Math.min(a, p); h < m; ++h)
|
|
243
|
+
if (r[h] !== n[h]) {
|
|
244
|
+
a = r[h], p = n[h];
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
return a < p ? -1 : p < a ? 1 : 0;
|
|
248
|
+
}, u.isEncoding = function(r) {
|
|
249
|
+
switch (String(r).toLowerCase()) {
|
|
250
|
+
case "hex":
|
|
251
|
+
case "utf8":
|
|
252
|
+
case "utf-8":
|
|
253
|
+
case "ascii":
|
|
254
|
+
case "latin1":
|
|
255
|
+
case "binary":
|
|
256
|
+
case "base64":
|
|
257
|
+
case "ucs2":
|
|
258
|
+
case "ucs-2":
|
|
259
|
+
case "utf16le":
|
|
260
|
+
case "utf-16le":
|
|
261
|
+
return !0;
|
|
262
|
+
default:
|
|
263
|
+
return !1;
|
|
264
|
+
}
|
|
265
|
+
}, u.concat = function(r, n) {
|
|
266
|
+
if (!Array.isArray(r))
|
|
267
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
268
|
+
if (r.length === 0)
|
|
269
|
+
return u.alloc(0);
|
|
270
|
+
let a;
|
|
271
|
+
if (n === void 0)
|
|
272
|
+
for (n = 0, a = 0; a < r.length; ++a)
|
|
273
|
+
n += r[a].length;
|
|
274
|
+
const p = u.allocUnsafe(n);
|
|
275
|
+
let h = 0;
|
|
276
|
+
for (a = 0; a < r.length; ++a) {
|
|
277
|
+
let m = r[a];
|
|
278
|
+
if (Q(m, Uint8Array))
|
|
279
|
+
h + m.length > p.length ? (u.isBuffer(m) || (m = u.from(m)), m.copy(p, h)) : Uint8Array.prototype.set.call(
|
|
280
|
+
p,
|
|
281
|
+
m,
|
|
282
|
+
h
|
|
283
|
+
);
|
|
284
|
+
else if (u.isBuffer(m))
|
|
285
|
+
m.copy(p, h);
|
|
286
|
+
else
|
|
287
|
+
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
288
|
+
h += m.length;
|
|
289
|
+
}
|
|
290
|
+
return p;
|
|
291
|
+
};
|
|
292
|
+
function L(s, r) {
|
|
293
|
+
if (u.isBuffer(s))
|
|
294
|
+
return s.length;
|
|
295
|
+
if (ArrayBuffer.isView(s) || Q(s, ArrayBuffer))
|
|
296
|
+
return s.byteLength;
|
|
297
|
+
if (typeof s != "string")
|
|
298
|
+
throw new TypeError(
|
|
299
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof s
|
|
300
|
+
);
|
|
301
|
+
const n = s.length, a = arguments.length > 2 && arguments[2] === !0;
|
|
302
|
+
if (!a && n === 0)
|
|
303
|
+
return 0;
|
|
304
|
+
let p = !1;
|
|
305
|
+
for (; ; )
|
|
306
|
+
switch (r) {
|
|
307
|
+
case "ascii":
|
|
308
|
+
case "latin1":
|
|
309
|
+
case "binary":
|
|
310
|
+
return n;
|
|
311
|
+
case "utf8":
|
|
312
|
+
case "utf-8":
|
|
313
|
+
return ot(s).length;
|
|
314
|
+
case "ucs2":
|
|
315
|
+
case "ucs-2":
|
|
316
|
+
case "utf16le":
|
|
317
|
+
case "utf-16le":
|
|
318
|
+
return n * 2;
|
|
319
|
+
case "hex":
|
|
320
|
+
return n >>> 1;
|
|
321
|
+
case "base64":
|
|
322
|
+
return Vt(s).length;
|
|
323
|
+
default:
|
|
324
|
+
if (p)
|
|
325
|
+
return a ? -1 : ot(s).length;
|
|
326
|
+
r = ("" + r).toLowerCase(), p = !0;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
u.byteLength = L;
|
|
330
|
+
function le(s, r, n) {
|
|
331
|
+
let a = !1;
|
|
332
|
+
if ((r === void 0 || r < 0) && (r = 0), r > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, r >>>= 0, n <= r))
|
|
333
|
+
return "";
|
|
334
|
+
for (s || (s = "utf8"); ; )
|
|
335
|
+
switch (s) {
|
|
336
|
+
case "hex":
|
|
337
|
+
return _(this, r, n);
|
|
338
|
+
case "utf8":
|
|
339
|
+
case "utf-8":
|
|
340
|
+
return Be(this, r, n);
|
|
341
|
+
case "ascii":
|
|
342
|
+
return Te(this, r, n);
|
|
343
|
+
case "latin1":
|
|
344
|
+
case "binary":
|
|
345
|
+
return Se(this, r, n);
|
|
346
|
+
case "base64":
|
|
347
|
+
return it(this, r, n);
|
|
348
|
+
case "ucs2":
|
|
349
|
+
case "ucs-2":
|
|
350
|
+
case "utf16le":
|
|
351
|
+
case "utf-16le":
|
|
352
|
+
return x(this, r, n);
|
|
353
|
+
default:
|
|
354
|
+
if (a)
|
|
355
|
+
throw new TypeError("Unknown encoding: " + s);
|
|
356
|
+
s = (s + "").toLowerCase(), a = !0;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
u.prototype._isBuffer = !0;
|
|
360
|
+
function G(s, r, n) {
|
|
361
|
+
const a = s[r];
|
|
362
|
+
s[r] = s[n], s[n] = a;
|
|
363
|
+
}
|
|
364
|
+
u.prototype.swap16 = function() {
|
|
365
|
+
const r = this.length;
|
|
366
|
+
if (r % 2 !== 0)
|
|
367
|
+
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
368
|
+
for (let n = 0; n < r; n += 2)
|
|
369
|
+
G(this, n, n + 1);
|
|
370
|
+
return this;
|
|
371
|
+
}, u.prototype.swap32 = function() {
|
|
372
|
+
const r = this.length;
|
|
373
|
+
if (r % 4 !== 0)
|
|
374
|
+
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
375
|
+
for (let n = 0; n < r; n += 4)
|
|
376
|
+
G(this, n, n + 3), G(this, n + 1, n + 2);
|
|
377
|
+
return this;
|
|
378
|
+
}, u.prototype.swap64 = function() {
|
|
379
|
+
const r = this.length;
|
|
380
|
+
if (r % 8 !== 0)
|
|
381
|
+
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
382
|
+
for (let n = 0; n < r; n += 8)
|
|
383
|
+
G(this, n, n + 7), G(this, n + 1, n + 6), G(this, n + 2, n + 5), G(this, n + 3, n + 4);
|
|
384
|
+
return this;
|
|
385
|
+
}, u.prototype.toString = function() {
|
|
386
|
+
const r = this.length;
|
|
387
|
+
return r === 0 ? "" : arguments.length === 0 ? Be(this, 0, r) : le.apply(this, arguments);
|
|
388
|
+
}, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(r) {
|
|
389
|
+
if (!u.isBuffer(r))
|
|
390
|
+
throw new TypeError("Argument must be a Buffer");
|
|
391
|
+
return this === r ? !0 : u.compare(this, r) === 0;
|
|
392
|
+
}, u.prototype.inspect = function() {
|
|
393
|
+
let r = "";
|
|
394
|
+
const n = e.INSPECT_MAX_BYTES;
|
|
395
|
+
return r = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (r += " ... "), "<Buffer " + r + ">";
|
|
396
|
+
}, o && (u.prototype[o] = u.prototype.inspect), u.prototype.compare = function(r, n, a, p, h) {
|
|
397
|
+
if (Q(r, Uint8Array) && (r = u.from(r, r.offset, r.byteLength)), !u.isBuffer(r))
|
|
398
|
+
throw new TypeError(
|
|
399
|
+
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
|
|
400
|
+
);
|
|
401
|
+
if (n === void 0 && (n = 0), a === void 0 && (a = r ? r.length : 0), p === void 0 && (p = 0), h === void 0 && (h = this.length), n < 0 || a > r.length || p < 0 || h > this.length)
|
|
402
|
+
throw new RangeError("out of range index");
|
|
403
|
+
if (p >= h && n >= a)
|
|
404
|
+
return 0;
|
|
405
|
+
if (p >= h)
|
|
406
|
+
return -1;
|
|
407
|
+
if (n >= a)
|
|
408
|
+
return 1;
|
|
409
|
+
if (n >>>= 0, a >>>= 0, p >>>= 0, h >>>= 0, this === r)
|
|
410
|
+
return 0;
|
|
411
|
+
let m = h - p, O = a - n;
|
|
412
|
+
const j = Math.min(m, O), k = this.slice(p, h), M = r.slice(n, a);
|
|
413
|
+
for (let v = 0; v < j; ++v)
|
|
414
|
+
if (k[v] !== M[v]) {
|
|
415
|
+
m = k[v], O = M[v];
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
return m < O ? -1 : O < m ? 1 : 0;
|
|
419
|
+
};
|
|
420
|
+
function X(s, r, n, a, p) {
|
|
421
|
+
if (s.length === 0)
|
|
422
|
+
return -1;
|
|
423
|
+
if (typeof n == "string" ? (a = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, st(n) && (n = p ? 0 : s.length - 1), n < 0 && (n = s.length + n), n >= s.length) {
|
|
424
|
+
if (p)
|
|
425
|
+
return -1;
|
|
426
|
+
n = s.length - 1;
|
|
427
|
+
} else if (n < 0)
|
|
428
|
+
if (p)
|
|
429
|
+
n = 0;
|
|
430
|
+
else
|
|
431
|
+
return -1;
|
|
432
|
+
if (typeof r == "string" && (r = u.from(r, a)), u.isBuffer(r))
|
|
433
|
+
return r.length === 0 ? -1 : de(s, r, n, a, p);
|
|
434
|
+
if (typeof r == "number")
|
|
435
|
+
return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ? p ? Uint8Array.prototype.indexOf.call(s, r, n) : Uint8Array.prototype.lastIndexOf.call(s, r, n) : de(s, [r], n, a, p);
|
|
436
|
+
throw new TypeError("val must be string, number or Buffer");
|
|
437
|
+
}
|
|
438
|
+
function de(s, r, n, a, p) {
|
|
439
|
+
let h = 1, m = s.length, O = r.length;
|
|
440
|
+
if (a !== void 0 && (a = String(a).toLowerCase(), a === "ucs2" || a === "ucs-2" || a === "utf16le" || a === "utf-16le")) {
|
|
441
|
+
if (s.length < 2 || r.length < 2)
|
|
442
|
+
return -1;
|
|
443
|
+
h = 2, m /= 2, O /= 2, n /= 2;
|
|
444
|
+
}
|
|
445
|
+
function j(M, v) {
|
|
446
|
+
return h === 1 ? M[v] : M.readUInt16BE(v * h);
|
|
447
|
+
}
|
|
448
|
+
let k;
|
|
449
|
+
if (p) {
|
|
450
|
+
let M = -1;
|
|
451
|
+
for (k = n; k < m; k++)
|
|
452
|
+
if (j(s, k) === j(r, M === -1 ? 0 : k - M)) {
|
|
453
|
+
if (M === -1 && (M = k), k - M + 1 === O)
|
|
454
|
+
return M * h;
|
|
455
|
+
} else
|
|
456
|
+
M !== -1 && (k -= k - M), M = -1;
|
|
457
|
+
} else
|
|
458
|
+
for (n + O > m && (n = m - O), k = n; k >= 0; k--) {
|
|
459
|
+
let M = !0;
|
|
460
|
+
for (let v = 0; v < O; v++)
|
|
461
|
+
if (j(s, k + v) !== j(r, v)) {
|
|
462
|
+
M = !1;
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
if (M)
|
|
466
|
+
return k;
|
|
467
|
+
}
|
|
468
|
+
return -1;
|
|
469
|
+
}
|
|
470
|
+
u.prototype.includes = function(r, n, a) {
|
|
471
|
+
return this.indexOf(r, n, a) !== -1;
|
|
472
|
+
}, u.prototype.indexOf = function(r, n, a) {
|
|
473
|
+
return X(this, r, n, a, !0);
|
|
474
|
+
}, u.prototype.lastIndexOf = function(r, n, a) {
|
|
475
|
+
return X(this, r, n, a, !1);
|
|
476
|
+
};
|
|
477
|
+
function Ae(s, r, n, a) {
|
|
478
|
+
n = Number(n) || 0;
|
|
479
|
+
const p = s.length - n;
|
|
480
|
+
a ? (a = Number(a), a > p && (a = p)) : a = p;
|
|
481
|
+
const h = r.length;
|
|
482
|
+
a > h / 2 && (a = h / 2);
|
|
483
|
+
let m;
|
|
484
|
+
for (m = 0; m < a; ++m) {
|
|
485
|
+
const O = parseInt(r.substr(m * 2, 2), 16);
|
|
486
|
+
if (st(O))
|
|
487
|
+
return m;
|
|
488
|
+
s[n + m] = O;
|
|
489
|
+
}
|
|
490
|
+
return m;
|
|
491
|
+
}
|
|
492
|
+
function me(s, r, n, a) {
|
|
493
|
+
return je(ot(r, s.length - n), s, n, a);
|
|
494
|
+
}
|
|
495
|
+
function ae(s, r, n, a) {
|
|
496
|
+
return je(en(r), s, n, a);
|
|
497
|
+
}
|
|
498
|
+
function ke(s, r, n, a) {
|
|
499
|
+
return je(Vt(r), s, n, a);
|
|
500
|
+
}
|
|
501
|
+
function ye(s, r, n, a) {
|
|
502
|
+
return je(tn(r, s.length - n), s, n, a);
|
|
503
|
+
}
|
|
504
|
+
u.prototype.write = function(r, n, a, p) {
|
|
505
|
+
if (n === void 0)
|
|
506
|
+
p = "utf8", a = this.length, n = 0;
|
|
507
|
+
else if (a === void 0 && typeof n == "string")
|
|
508
|
+
p = n, a = this.length, n = 0;
|
|
509
|
+
else if (isFinite(n))
|
|
510
|
+
n = n >>> 0, isFinite(a) ? (a = a >>> 0, p === void 0 && (p = "utf8")) : (p = a, a = void 0);
|
|
511
|
+
else
|
|
512
|
+
throw new Error(
|
|
513
|
+
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
514
|
+
);
|
|
515
|
+
const h = this.length - n;
|
|
516
|
+
if ((a === void 0 || a > h) && (a = h), r.length > 0 && (a < 0 || n < 0) || n > this.length)
|
|
517
|
+
throw new RangeError("Attempt to write outside buffer bounds");
|
|
518
|
+
p || (p = "utf8");
|
|
519
|
+
let m = !1;
|
|
520
|
+
for (; ; )
|
|
521
|
+
switch (p) {
|
|
522
|
+
case "hex":
|
|
523
|
+
return Ae(this, r, n, a);
|
|
524
|
+
case "utf8":
|
|
525
|
+
case "utf-8":
|
|
526
|
+
return me(this, r, n, a);
|
|
527
|
+
case "ascii":
|
|
528
|
+
case "latin1":
|
|
529
|
+
case "binary":
|
|
530
|
+
return ae(this, r, n, a);
|
|
531
|
+
case "base64":
|
|
532
|
+
return ke(this, r, n, a);
|
|
533
|
+
case "ucs2":
|
|
534
|
+
case "ucs-2":
|
|
535
|
+
case "utf16le":
|
|
536
|
+
case "utf-16le":
|
|
537
|
+
return ye(this, r, n, a);
|
|
538
|
+
default:
|
|
539
|
+
if (m)
|
|
540
|
+
throw new TypeError("Unknown encoding: " + p);
|
|
541
|
+
p = ("" + p).toLowerCase(), m = !0;
|
|
542
|
+
}
|
|
543
|
+
}, u.prototype.toJSON = function() {
|
|
544
|
+
return {
|
|
545
|
+
type: "Buffer",
|
|
546
|
+
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
function it(s, r, n) {
|
|
550
|
+
return r === 0 && n === s.length ? t.fromByteArray(s) : t.fromByteArray(s.slice(r, n));
|
|
551
|
+
}
|
|
552
|
+
function Be(s, r, n) {
|
|
553
|
+
n = Math.min(s.length, n);
|
|
554
|
+
const a = [];
|
|
555
|
+
let p = r;
|
|
556
|
+
for (; p < n; ) {
|
|
557
|
+
const h = s[p];
|
|
558
|
+
let m = null, O = h > 239 ? 4 : h > 223 ? 3 : h > 191 ? 2 : 1;
|
|
559
|
+
if (p + O <= n) {
|
|
560
|
+
let j, k, M, v;
|
|
561
|
+
switch (O) {
|
|
562
|
+
case 1:
|
|
563
|
+
h < 128 && (m = h);
|
|
564
|
+
break;
|
|
565
|
+
case 2:
|
|
566
|
+
j = s[p + 1], (j & 192) === 128 && (v = (h & 31) << 6 | j & 63, v > 127 && (m = v));
|
|
567
|
+
break;
|
|
568
|
+
case 3:
|
|
569
|
+
j = s[p + 1], k = s[p + 2], (j & 192) === 128 && (k & 192) === 128 && (v = (h & 15) << 12 | (j & 63) << 6 | k & 63, v > 2047 && (v < 55296 || v > 57343) && (m = v));
|
|
570
|
+
break;
|
|
571
|
+
case 4:
|
|
572
|
+
j = s[p + 1], k = s[p + 2], M = s[p + 3], (j & 192) === 128 && (k & 192) === 128 && (M & 192) === 128 && (v = (h & 15) << 18 | (j & 63) << 12 | (k & 63) << 6 | M & 63, v > 65535 && v < 1114112 && (m = v));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
m === null ? (m = 65533, O = 1) : m > 65535 && (m -= 65536, a.push(m >>> 10 & 1023 | 55296), m = 56320 | m & 1023), a.push(m), p += O;
|
|
576
|
+
}
|
|
577
|
+
return Re(a);
|
|
578
|
+
}
|
|
579
|
+
const Le = 4096;
|
|
580
|
+
function Re(s) {
|
|
581
|
+
const r = s.length;
|
|
582
|
+
if (r <= Le)
|
|
583
|
+
return String.fromCharCode.apply(String, s);
|
|
584
|
+
let n = "", a = 0;
|
|
585
|
+
for (; a < r; )
|
|
586
|
+
n += String.fromCharCode.apply(
|
|
587
|
+
String,
|
|
588
|
+
s.slice(a, a += Le)
|
|
589
|
+
);
|
|
590
|
+
return n;
|
|
591
|
+
}
|
|
592
|
+
function Te(s, r, n) {
|
|
593
|
+
let a = "";
|
|
594
|
+
n = Math.min(s.length, n);
|
|
595
|
+
for (let p = r; p < n; ++p)
|
|
596
|
+
a += String.fromCharCode(s[p] & 127);
|
|
597
|
+
return a;
|
|
598
|
+
}
|
|
599
|
+
function Se(s, r, n) {
|
|
600
|
+
let a = "";
|
|
601
|
+
n = Math.min(s.length, n);
|
|
602
|
+
for (let p = r; p < n; ++p)
|
|
603
|
+
a += String.fromCharCode(s[p]);
|
|
604
|
+
return a;
|
|
605
|
+
}
|
|
606
|
+
function _(s, r, n) {
|
|
607
|
+
const a = s.length;
|
|
608
|
+
(!r || r < 0) && (r = 0), (!n || n < 0 || n > a) && (n = a);
|
|
609
|
+
let p = "";
|
|
610
|
+
for (let h = r; h < n; ++h)
|
|
611
|
+
p += rn[s[h]];
|
|
612
|
+
return p;
|
|
613
|
+
}
|
|
614
|
+
function x(s, r, n) {
|
|
615
|
+
const a = s.slice(r, n);
|
|
616
|
+
let p = "";
|
|
617
|
+
for (let h = 0; h < a.length - 1; h += 2)
|
|
618
|
+
p += String.fromCharCode(a[h] + a[h + 1] * 256);
|
|
619
|
+
return p;
|
|
620
|
+
}
|
|
621
|
+
u.prototype.slice = function(r, n) {
|
|
622
|
+
const a = this.length;
|
|
623
|
+
r = ~~r, n = n === void 0 ? a : ~~n, r < 0 ? (r += a, r < 0 && (r = 0)) : r > a && (r = a), n < 0 ? (n += a, n < 0 && (n = 0)) : n > a && (n = a), n < r && (n = r);
|
|
624
|
+
const p = this.subarray(r, n);
|
|
625
|
+
return Object.setPrototypeOf(p, u.prototype), p;
|
|
626
|
+
};
|
|
627
|
+
function b(s, r, n) {
|
|
628
|
+
if (s % 1 !== 0 || s < 0)
|
|
629
|
+
throw new RangeError("offset is not uint");
|
|
630
|
+
if (s + r > n)
|
|
631
|
+
throw new RangeError("Trying to access beyond buffer length");
|
|
632
|
+
}
|
|
633
|
+
u.prototype.readUintLE = u.prototype.readUIntLE = function(r, n, a) {
|
|
634
|
+
r = r >>> 0, n = n >>> 0, a || b(r, n, this.length);
|
|
635
|
+
let p = this[r], h = 1, m = 0;
|
|
636
|
+
for (; ++m < n && (h *= 256); )
|
|
637
|
+
p += this[r + m] * h;
|
|
638
|
+
return p;
|
|
639
|
+
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(r, n, a) {
|
|
640
|
+
r = r >>> 0, n = n >>> 0, a || b(r, n, this.length);
|
|
641
|
+
let p = this[r + --n], h = 1;
|
|
642
|
+
for (; n > 0 && (h *= 256); )
|
|
643
|
+
p += this[r + --n] * h;
|
|
644
|
+
return p;
|
|
645
|
+
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(r, n) {
|
|
646
|
+
return r = r >>> 0, n || b(r, 1, this.length), this[r];
|
|
647
|
+
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(r, n) {
|
|
648
|
+
return r = r >>> 0, n || b(r, 2, this.length), this[r] | this[r + 1] << 8;
|
|
649
|
+
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(r, n) {
|
|
650
|
+
return r = r >>> 0, n || b(r, 2, this.length), this[r] << 8 | this[r + 1];
|
|
651
|
+
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(r, n) {
|
|
652
|
+
return r = r >>> 0, n || b(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
|
|
653
|
+
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(r, n) {
|
|
654
|
+
return r = r >>> 0, n || b(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
|
|
655
|
+
}, u.prototype.readBigUInt64LE = ce(function(r) {
|
|
656
|
+
r = r >>> 0, Ee(r, "offset");
|
|
657
|
+
const n = this[r], a = this[r + 7];
|
|
658
|
+
(n === void 0 || a === void 0) && De(r, this.length - 8);
|
|
659
|
+
const p = n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, h = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + a * 2 ** 24;
|
|
660
|
+
return BigInt(p) + (BigInt(h) << BigInt(32));
|
|
661
|
+
}), u.prototype.readBigUInt64BE = ce(function(r) {
|
|
662
|
+
r = r >>> 0, Ee(r, "offset");
|
|
663
|
+
const n = this[r], a = this[r + 7];
|
|
664
|
+
(n === void 0 || a === void 0) && De(r, this.length - 8);
|
|
665
|
+
const p = n * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], h = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + a;
|
|
666
|
+
return (BigInt(p) << BigInt(32)) + BigInt(h);
|
|
667
|
+
}), u.prototype.readIntLE = function(r, n, a) {
|
|
668
|
+
r = r >>> 0, n = n >>> 0, a || b(r, n, this.length);
|
|
669
|
+
let p = this[r], h = 1, m = 0;
|
|
670
|
+
for (; ++m < n && (h *= 256); )
|
|
671
|
+
p += this[r + m] * h;
|
|
672
|
+
return h *= 128, p >= h && (p -= Math.pow(2, 8 * n)), p;
|
|
673
|
+
}, u.prototype.readIntBE = function(r, n, a) {
|
|
674
|
+
r = r >>> 0, n = n >>> 0, a || b(r, n, this.length);
|
|
675
|
+
let p = n, h = 1, m = this[r + --p];
|
|
676
|
+
for (; p > 0 && (h *= 256); )
|
|
677
|
+
m += this[r + --p] * h;
|
|
678
|
+
return h *= 128, m >= h && (m -= Math.pow(2, 8 * n)), m;
|
|
679
|
+
}, u.prototype.readInt8 = function(r, n) {
|
|
680
|
+
return r = r >>> 0, n || b(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
|
|
681
|
+
}, u.prototype.readInt16LE = function(r, n) {
|
|
682
|
+
r = r >>> 0, n || b(r, 2, this.length);
|
|
683
|
+
const a = this[r] | this[r + 1] << 8;
|
|
684
|
+
return a & 32768 ? a | 4294901760 : a;
|
|
685
|
+
}, u.prototype.readInt16BE = function(r, n) {
|
|
686
|
+
r = r >>> 0, n || b(r, 2, this.length);
|
|
687
|
+
const a = this[r + 1] | this[r] << 8;
|
|
688
|
+
return a & 32768 ? a | 4294901760 : a;
|
|
689
|
+
}, u.prototype.readInt32LE = function(r, n) {
|
|
690
|
+
return r = r >>> 0, n || b(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
|
|
691
|
+
}, u.prototype.readInt32BE = function(r, n) {
|
|
692
|
+
return r = r >>> 0, n || b(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
|
|
693
|
+
}, u.prototype.readBigInt64LE = ce(function(r) {
|
|
694
|
+
r = r >>> 0, Ee(r, "offset");
|
|
695
|
+
const n = this[r], a = this[r + 7];
|
|
696
|
+
(n === void 0 || a === void 0) && De(r, this.length - 8);
|
|
697
|
+
const p = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (a << 24);
|
|
698
|
+
return (BigInt(p) << BigInt(32)) + BigInt(n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
|
|
699
|
+
}), u.prototype.readBigInt64BE = ce(function(r) {
|
|
700
|
+
r = r >>> 0, Ee(r, "offset");
|
|
701
|
+
const n = this[r], a = this[r + 7];
|
|
702
|
+
(n === void 0 || a === void 0) && De(r, this.length - 8);
|
|
703
|
+
const p = (n << 24) + // Overflow
|
|
704
|
+
this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
|
|
705
|
+
return (BigInt(p) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + a);
|
|
706
|
+
}), u.prototype.readFloatLE = function(r, n) {
|
|
707
|
+
return r = r >>> 0, n || b(r, 4, this.length), i.read(this, r, !0, 23, 4);
|
|
708
|
+
}, u.prototype.readFloatBE = function(r, n) {
|
|
709
|
+
return r = r >>> 0, n || b(r, 4, this.length), i.read(this, r, !1, 23, 4);
|
|
710
|
+
}, u.prototype.readDoubleLE = function(r, n) {
|
|
711
|
+
return r = r >>> 0, n || b(r, 8, this.length), i.read(this, r, !0, 52, 8);
|
|
712
|
+
}, u.prototype.readDoubleBE = function(r, n) {
|
|
713
|
+
return r = r >>> 0, n || b(r, 8, this.length), i.read(this, r, !1, 52, 8);
|
|
714
|
+
};
|
|
715
|
+
function F(s, r, n, a, p, h) {
|
|
716
|
+
if (!u.isBuffer(s))
|
|
717
|
+
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
718
|
+
if (r > p || r < h)
|
|
719
|
+
throw new RangeError('"value" argument is out of bounds');
|
|
720
|
+
if (n + a > s.length)
|
|
721
|
+
throw new RangeError("Index out of range");
|
|
722
|
+
}
|
|
723
|
+
u.prototype.writeUintLE = u.prototype.writeUIntLE = function(r, n, a, p) {
|
|
724
|
+
if (r = +r, n = n >>> 0, a = a >>> 0, !p) {
|
|
725
|
+
const O = Math.pow(2, 8 * a) - 1;
|
|
726
|
+
F(this, r, n, a, O, 0);
|
|
727
|
+
}
|
|
728
|
+
let h = 1, m = 0;
|
|
729
|
+
for (this[n] = r & 255; ++m < a && (h *= 256); )
|
|
730
|
+
this[n + m] = r / h & 255;
|
|
731
|
+
return n + a;
|
|
732
|
+
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(r, n, a, p) {
|
|
733
|
+
if (r = +r, n = n >>> 0, a = a >>> 0, !p) {
|
|
734
|
+
const O = Math.pow(2, 8 * a) - 1;
|
|
735
|
+
F(this, r, n, a, O, 0);
|
|
736
|
+
}
|
|
737
|
+
let h = a - 1, m = 1;
|
|
738
|
+
for (this[n + h] = r & 255; --h >= 0 && (m *= 256); )
|
|
739
|
+
this[n + h] = r / m & 255;
|
|
740
|
+
return n + a;
|
|
741
|
+
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(r, n, a) {
|
|
742
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 1, 255, 0), this[n] = r & 255, n + 1;
|
|
743
|
+
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(r, n, a) {
|
|
744
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 2, 65535, 0), this[n] = r & 255, this[n + 1] = r >>> 8, n + 2;
|
|
745
|
+
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(r, n, a) {
|
|
746
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 2, 65535, 0), this[n] = r >>> 8, this[n + 1] = r & 255, n + 2;
|
|
747
|
+
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(r, n, a) {
|
|
748
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 4, 4294967295, 0), this[n + 3] = r >>> 24, this[n + 2] = r >>> 16, this[n + 1] = r >>> 8, this[n] = r & 255, n + 4;
|
|
749
|
+
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(r, n, a) {
|
|
750
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 4, 4294967295, 0), this[n] = r >>> 24, this[n + 1] = r >>> 16, this[n + 2] = r >>> 8, this[n + 3] = r & 255, n + 4;
|
|
751
|
+
};
|
|
752
|
+
function T(s, r, n, a, p) {
|
|
753
|
+
Gt(r, a, p, s, n, 7);
|
|
754
|
+
let h = Number(r & BigInt(4294967295));
|
|
755
|
+
s[n++] = h, h = h >> 8, s[n++] = h, h = h >> 8, s[n++] = h, h = h >> 8, s[n++] = h;
|
|
756
|
+
let m = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
757
|
+
return s[n++] = m, m = m >> 8, s[n++] = m, m = m >> 8, s[n++] = m, m = m >> 8, s[n++] = m, n;
|
|
758
|
+
}
|
|
759
|
+
function R(s, r, n, a, p) {
|
|
760
|
+
Gt(r, a, p, s, n, 7);
|
|
761
|
+
let h = Number(r & BigInt(4294967295));
|
|
762
|
+
s[n + 7] = h, h = h >> 8, s[n + 6] = h, h = h >> 8, s[n + 5] = h, h = h >> 8, s[n + 4] = h;
|
|
763
|
+
let m = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
764
|
+
return s[n + 3] = m, m = m >> 8, s[n + 2] = m, m = m >> 8, s[n + 1] = m, m = m >> 8, s[n] = m, n + 8;
|
|
765
|
+
}
|
|
766
|
+
u.prototype.writeBigUInt64LE = ce(function(r, n = 0) {
|
|
767
|
+
return T(this, r, n, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
768
|
+
}), u.prototype.writeBigUInt64BE = ce(function(r, n = 0) {
|
|
769
|
+
return R(this, r, n, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
770
|
+
}), u.prototype.writeIntLE = function(r, n, a, p) {
|
|
771
|
+
if (r = +r, n = n >>> 0, !p) {
|
|
772
|
+
const j = Math.pow(2, 8 * a - 1);
|
|
773
|
+
F(this, r, n, a, j - 1, -j);
|
|
774
|
+
}
|
|
775
|
+
let h = 0, m = 1, O = 0;
|
|
776
|
+
for (this[n] = r & 255; ++h < a && (m *= 256); )
|
|
777
|
+
r < 0 && O === 0 && this[n + h - 1] !== 0 && (O = 1), this[n + h] = (r / m >> 0) - O & 255;
|
|
778
|
+
return n + a;
|
|
779
|
+
}, u.prototype.writeIntBE = function(r, n, a, p) {
|
|
780
|
+
if (r = +r, n = n >>> 0, !p) {
|
|
781
|
+
const j = Math.pow(2, 8 * a - 1);
|
|
782
|
+
F(this, r, n, a, j - 1, -j);
|
|
783
|
+
}
|
|
784
|
+
let h = a - 1, m = 1, O = 0;
|
|
785
|
+
for (this[n + h] = r & 255; --h >= 0 && (m *= 256); )
|
|
786
|
+
r < 0 && O === 0 && this[n + h + 1] !== 0 && (O = 1), this[n + h] = (r / m >> 0) - O & 255;
|
|
787
|
+
return n + a;
|
|
788
|
+
}, u.prototype.writeInt8 = function(r, n, a) {
|
|
789
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[n] = r & 255, n + 1;
|
|
790
|
+
}, u.prototype.writeInt16LE = function(r, n, a) {
|
|
791
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 2, 32767, -32768), this[n] = r & 255, this[n + 1] = r >>> 8, n + 2;
|
|
792
|
+
}, u.prototype.writeInt16BE = function(r, n, a) {
|
|
793
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 2, 32767, -32768), this[n] = r >>> 8, this[n + 1] = r & 255, n + 2;
|
|
794
|
+
}, u.prototype.writeInt32LE = function(r, n, a) {
|
|
795
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 4, 2147483647, -2147483648), this[n] = r & 255, this[n + 1] = r >>> 8, this[n + 2] = r >>> 16, this[n + 3] = r >>> 24, n + 4;
|
|
796
|
+
}, u.prototype.writeInt32BE = function(r, n, a) {
|
|
797
|
+
return r = +r, n = n >>> 0, a || F(this, r, n, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[n] = r >>> 24, this[n + 1] = r >>> 16, this[n + 2] = r >>> 8, this[n + 3] = r & 255, n + 4;
|
|
798
|
+
}, u.prototype.writeBigInt64LE = ce(function(r, n = 0) {
|
|
799
|
+
return T(this, r, n, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
800
|
+
}), u.prototype.writeBigInt64BE = ce(function(r, n = 0) {
|
|
801
|
+
return R(this, r, n, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
802
|
+
});
|
|
803
|
+
function U(s, r, n, a, p, h) {
|
|
804
|
+
if (n + a > s.length)
|
|
805
|
+
throw new RangeError("Index out of range");
|
|
806
|
+
if (n < 0)
|
|
807
|
+
throw new RangeError("Index out of range");
|
|
808
|
+
}
|
|
809
|
+
function $(s, r, n, a, p) {
|
|
810
|
+
return r = +r, n = n >>> 0, p || U(s, r, n, 4), i.write(s, r, n, a, 23, 4), n + 4;
|
|
811
|
+
}
|
|
812
|
+
u.prototype.writeFloatLE = function(r, n, a) {
|
|
813
|
+
return $(this, r, n, !0, a);
|
|
814
|
+
}, u.prototype.writeFloatBE = function(r, n, a) {
|
|
815
|
+
return $(this, r, n, !1, a);
|
|
816
|
+
};
|
|
817
|
+
function W(s, r, n, a, p) {
|
|
818
|
+
return r = +r, n = n >>> 0, p || U(s, r, n, 8), i.write(s, r, n, a, 52, 8), n + 8;
|
|
819
|
+
}
|
|
820
|
+
u.prototype.writeDoubleLE = function(r, n, a) {
|
|
821
|
+
return W(this, r, n, !0, a);
|
|
822
|
+
}, u.prototype.writeDoubleBE = function(r, n, a) {
|
|
823
|
+
return W(this, r, n, !1, a);
|
|
824
|
+
}, u.prototype.copy = function(r, n, a, p) {
|
|
825
|
+
if (!u.isBuffer(r))
|
|
826
|
+
throw new TypeError("argument should be a Buffer");
|
|
827
|
+
if (a || (a = 0), !p && p !== 0 && (p = this.length), n >= r.length && (n = r.length), n || (n = 0), p > 0 && p < a && (p = a), p === a || r.length === 0 || this.length === 0)
|
|
828
|
+
return 0;
|
|
829
|
+
if (n < 0)
|
|
830
|
+
throw new RangeError("targetStart out of bounds");
|
|
831
|
+
if (a < 0 || a >= this.length)
|
|
832
|
+
throw new RangeError("Index out of range");
|
|
833
|
+
if (p < 0)
|
|
834
|
+
throw new RangeError("sourceEnd out of bounds");
|
|
835
|
+
p > this.length && (p = this.length), r.length - n < p - a && (p = r.length - n + a);
|
|
836
|
+
const h = p - a;
|
|
837
|
+
return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(n, a, p) : Uint8Array.prototype.set.call(
|
|
838
|
+
r,
|
|
839
|
+
this.subarray(a, p),
|
|
840
|
+
n
|
|
841
|
+
), h;
|
|
842
|
+
}, u.prototype.fill = function(r, n, a, p) {
|
|
843
|
+
if (typeof r == "string") {
|
|
844
|
+
if (typeof n == "string" ? (p = n, n = 0, a = this.length) : typeof a == "string" && (p = a, a = this.length), p !== void 0 && typeof p != "string")
|
|
845
|
+
throw new TypeError("encoding must be a string");
|
|
846
|
+
if (typeof p == "string" && !u.isEncoding(p))
|
|
847
|
+
throw new TypeError("Unknown encoding: " + p);
|
|
848
|
+
if (r.length === 1) {
|
|
849
|
+
const m = r.charCodeAt(0);
|
|
850
|
+
(p === "utf8" && m < 128 || p === "latin1") && (r = m);
|
|
851
|
+
}
|
|
852
|
+
} else
|
|
853
|
+
typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
|
|
854
|
+
if (n < 0 || this.length < n || this.length < a)
|
|
855
|
+
throw new RangeError("Out of range index");
|
|
856
|
+
if (a <= n)
|
|
857
|
+
return this;
|
|
858
|
+
n = n >>> 0, a = a === void 0 ? this.length : a >>> 0, r || (r = 0);
|
|
859
|
+
let h;
|
|
860
|
+
if (typeof r == "number")
|
|
861
|
+
for (h = n; h < a; ++h)
|
|
862
|
+
this[h] = r;
|
|
863
|
+
else {
|
|
864
|
+
const m = u.isBuffer(r) ? r : u.from(r, p), O = m.length;
|
|
865
|
+
if (O === 0)
|
|
866
|
+
throw new TypeError('The value "' + r + '" is invalid for argument "value"');
|
|
867
|
+
for (h = 0; h < a - n; ++h)
|
|
868
|
+
this[h + n] = m[h % O];
|
|
869
|
+
}
|
|
870
|
+
return this;
|
|
871
|
+
};
|
|
872
|
+
const H = {};
|
|
873
|
+
function V(s, r, n) {
|
|
874
|
+
H[s] = class extends n {
|
|
875
|
+
constructor() {
|
|
876
|
+
super(), Object.defineProperty(this, "message", {
|
|
877
|
+
value: r.apply(this, arguments),
|
|
878
|
+
writable: !0,
|
|
879
|
+
configurable: !0
|
|
880
|
+
}), this.name = `${this.name} [${s}]`, this.stack, delete this.name;
|
|
881
|
+
}
|
|
882
|
+
get code() {
|
|
883
|
+
return s;
|
|
884
|
+
}
|
|
885
|
+
set code(p) {
|
|
886
|
+
Object.defineProperty(this, "code", {
|
|
887
|
+
configurable: !0,
|
|
888
|
+
enumerable: !0,
|
|
889
|
+
value: p,
|
|
890
|
+
writable: !0
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
toString() {
|
|
894
|
+
return `${this.name} [${s}]: ${this.message}`;
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
V(
|
|
899
|
+
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
900
|
+
function(s) {
|
|
901
|
+
return s ? `${s} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
902
|
+
},
|
|
903
|
+
RangeError
|
|
904
|
+
), V(
|
|
905
|
+
"ERR_INVALID_ARG_TYPE",
|
|
906
|
+
function(s, r) {
|
|
907
|
+
return `The "${s}" argument must be of type number. Received type ${typeof r}`;
|
|
908
|
+
},
|
|
909
|
+
TypeError
|
|
910
|
+
), V(
|
|
911
|
+
"ERR_OUT_OF_RANGE",
|
|
912
|
+
function(s, r, n) {
|
|
913
|
+
let a = `The value of "${s}" is out of range.`, p = n;
|
|
914
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? p = Z(String(n)) : typeof n == "bigint" && (p = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (p = Z(p)), p += "n"), a += ` It must be ${r}. Received ${p}`, a;
|
|
915
|
+
},
|
|
916
|
+
RangeError
|
|
917
|
+
);
|
|
918
|
+
function Z(s) {
|
|
919
|
+
let r = "", n = s.length;
|
|
920
|
+
const a = s[0] === "-" ? 1 : 0;
|
|
921
|
+
for (; n >= a + 4; n -= 3)
|
|
922
|
+
r = `_${s.slice(n - 3, n)}${r}`;
|
|
923
|
+
return `${s.slice(0, n)}${r}`;
|
|
924
|
+
}
|
|
925
|
+
function Xr(s, r, n) {
|
|
926
|
+
Ee(r, "offset"), (s[r] === void 0 || s[r + n] === void 0) && De(r, s.length - (n + 1));
|
|
927
|
+
}
|
|
928
|
+
function Gt(s, r, n, a, p, h) {
|
|
929
|
+
if (s > n || s < r) {
|
|
930
|
+
const m = typeof r == "bigint" ? "n" : "";
|
|
931
|
+
let O;
|
|
932
|
+
throw h > 3 ? r === 0 || r === BigInt(0) ? O = `>= 0${m} and < 2${m} ** ${(h + 1) * 8}${m}` : O = `>= -(2${m} ** ${(h + 1) * 8 - 1}${m}) and < 2 ** ${(h + 1) * 8 - 1}${m}` : O = `>= ${r}${m} and <= ${n}${m}`, new H.ERR_OUT_OF_RANGE("value", O, s);
|
|
933
|
+
}
|
|
934
|
+
Xr(a, p, h);
|
|
935
|
+
}
|
|
936
|
+
function Ee(s, r) {
|
|
937
|
+
if (typeof s != "number")
|
|
938
|
+
throw new H.ERR_INVALID_ARG_TYPE(r, "number", s);
|
|
939
|
+
}
|
|
940
|
+
function De(s, r, n) {
|
|
941
|
+
throw Math.floor(s) !== s ? (Ee(s, n), new H.ERR_OUT_OF_RANGE(n || "offset", "an integer", s)) : r < 0 ? new H.ERR_BUFFER_OUT_OF_BOUNDS() : new H.ERR_OUT_OF_RANGE(
|
|
942
|
+
n || "offset",
|
|
943
|
+
`>= ${n ? 1 : 0} and <= ${r}`,
|
|
944
|
+
s
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
const Zr = /[^+/0-9A-Za-z-_]/g;
|
|
948
|
+
function Qr(s) {
|
|
949
|
+
if (s = s.split("=")[0], s = s.trim().replace(Zr, ""), s.length < 2)
|
|
950
|
+
return "";
|
|
951
|
+
for (; s.length % 4 !== 0; )
|
|
952
|
+
s = s + "=";
|
|
953
|
+
return s;
|
|
954
|
+
}
|
|
955
|
+
function ot(s, r) {
|
|
956
|
+
r = r || 1 / 0;
|
|
957
|
+
let n;
|
|
958
|
+
const a = s.length;
|
|
959
|
+
let p = null;
|
|
960
|
+
const h = [];
|
|
961
|
+
for (let m = 0; m < a; ++m) {
|
|
962
|
+
if (n = s.charCodeAt(m), n > 55295 && n < 57344) {
|
|
963
|
+
if (!p) {
|
|
964
|
+
if (n > 56319) {
|
|
965
|
+
(r -= 3) > -1 && h.push(239, 191, 189);
|
|
966
|
+
continue;
|
|
967
|
+
} else if (m + 1 === a) {
|
|
968
|
+
(r -= 3) > -1 && h.push(239, 191, 189);
|
|
969
|
+
continue;
|
|
970
|
+
}
|
|
971
|
+
p = n;
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
if (n < 56320) {
|
|
975
|
+
(r -= 3) > -1 && h.push(239, 191, 189), p = n;
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
n = (p - 55296 << 10 | n - 56320) + 65536;
|
|
979
|
+
} else
|
|
980
|
+
p && (r -= 3) > -1 && h.push(239, 191, 189);
|
|
981
|
+
if (p = null, n < 128) {
|
|
982
|
+
if ((r -= 1) < 0)
|
|
983
|
+
break;
|
|
984
|
+
h.push(n);
|
|
985
|
+
} else if (n < 2048) {
|
|
986
|
+
if ((r -= 2) < 0)
|
|
987
|
+
break;
|
|
988
|
+
h.push(
|
|
989
|
+
n >> 6 | 192,
|
|
990
|
+
n & 63 | 128
|
|
991
|
+
);
|
|
992
|
+
} else if (n < 65536) {
|
|
993
|
+
if ((r -= 3) < 0)
|
|
994
|
+
break;
|
|
995
|
+
h.push(
|
|
996
|
+
n >> 12 | 224,
|
|
997
|
+
n >> 6 & 63 | 128,
|
|
998
|
+
n & 63 | 128
|
|
999
|
+
);
|
|
1000
|
+
} else if (n < 1114112) {
|
|
1001
|
+
if ((r -= 4) < 0)
|
|
1002
|
+
break;
|
|
1003
|
+
h.push(
|
|
1004
|
+
n >> 18 | 240,
|
|
1005
|
+
n >> 12 & 63 | 128,
|
|
1006
|
+
n >> 6 & 63 | 128,
|
|
1007
|
+
n & 63 | 128
|
|
1008
|
+
);
|
|
1009
|
+
} else
|
|
1010
|
+
throw new Error("Invalid code point");
|
|
1011
|
+
}
|
|
1012
|
+
return h;
|
|
1013
|
+
}
|
|
1014
|
+
function en(s) {
|
|
1015
|
+
const r = [];
|
|
1016
|
+
for (let n = 0; n < s.length; ++n)
|
|
1017
|
+
r.push(s.charCodeAt(n) & 255);
|
|
1018
|
+
return r;
|
|
1019
|
+
}
|
|
1020
|
+
function tn(s, r) {
|
|
1021
|
+
let n, a, p;
|
|
1022
|
+
const h = [];
|
|
1023
|
+
for (let m = 0; m < s.length && !((r -= 2) < 0); ++m)
|
|
1024
|
+
n = s.charCodeAt(m), a = n >> 8, p = n % 256, h.push(p), h.push(a);
|
|
1025
|
+
return h;
|
|
1026
|
+
}
|
|
1027
|
+
function Vt(s) {
|
|
1028
|
+
return t.toByteArray(Qr(s));
|
|
1029
|
+
}
|
|
1030
|
+
function je(s, r, n, a) {
|
|
1031
|
+
let p;
|
|
1032
|
+
for (p = 0; p < a && !(p + n >= r.length || p >= s.length); ++p)
|
|
1033
|
+
r[p + n] = s[p];
|
|
1034
|
+
return p;
|
|
1035
|
+
}
|
|
1036
|
+
function Q(s, r) {
|
|
1037
|
+
return s instanceof r || s != null && s.constructor != null && s.constructor.name != null && s.constructor.name === r.name;
|
|
1038
|
+
}
|
|
1039
|
+
function st(s) {
|
|
1040
|
+
return s !== s;
|
|
1041
|
+
}
|
|
1042
|
+
const rn = function() {
|
|
1043
|
+
const s = "0123456789abcdef", r = new Array(256);
|
|
1044
|
+
for (let n = 0; n < 16; ++n) {
|
|
1045
|
+
const a = n * 16;
|
|
1046
|
+
for (let p = 0; p < 16; ++p)
|
|
1047
|
+
r[a + p] = s[n] + s[p];
|
|
1048
|
+
}
|
|
1049
|
+
return r;
|
|
1050
|
+
}();
|
|
1051
|
+
function ce(s) {
|
|
1052
|
+
return typeof BigInt > "u" ? nn : s;
|
|
1053
|
+
}
|
|
1054
|
+
function nn() {
|
|
1055
|
+
throw new Error("BigInt not supported");
|
|
1056
|
+
}
|
|
1057
|
+
})(br);
|
|
1058
|
+
var gr = {}, ze = {}, vt = {}, Ge = {}, oe = {}, Ve = {};
|
|
1059
|
+
Object.defineProperty(Ve, "__esModule", { value: !0 });
|
|
1060
|
+
Ve.Convert = void 0;
|
|
1061
|
+
class mn {
|
|
1062
|
+
static toPriceFeed(t) {
|
|
1063
|
+
return ut(t, ie("PriceFeed"));
|
|
1064
|
+
}
|
|
1065
|
+
static priceFeedToJson(t) {
|
|
1066
|
+
return ft(t, ie("PriceFeed"));
|
|
1067
|
+
}
|
|
1068
|
+
static toPrice(t) {
|
|
1069
|
+
return ut(t, ie("Price"));
|
|
1070
|
+
}
|
|
1071
|
+
static priceToJson(t) {
|
|
1072
|
+
return ft(t, ie("Price"));
|
|
1073
|
+
}
|
|
1074
|
+
static toPriceFeedMetadata(t) {
|
|
1075
|
+
return ut(t, ie("PriceFeedMetadata"));
|
|
1076
|
+
}
|
|
1077
|
+
static priceFeedMetadataToJson(t) {
|
|
1078
|
+
return ft(t, ie("PriceFeedMetadata"));
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
Ve.Convert = mn;
|
|
1082
|
+
function ne(e, t, i = "") {
|
|
1083
|
+
throw Error(i ? `Invalid value for key "${i}". Expected type ${JSON.stringify(e)} but got ${JSON.stringify(t)}` : `Invalid value ${JSON.stringify(t)} for type ${JSON.stringify(e)}`);
|
|
1084
|
+
}
|
|
1085
|
+
function yn(e) {
|
|
1086
|
+
if (e.jsonToJS === void 0) {
|
|
1087
|
+
const t = {};
|
|
1088
|
+
e.props.forEach((i) => t[i.json] = { key: i.js, typ: i.typ }), e.jsonToJS = t;
|
|
1089
|
+
}
|
|
1090
|
+
return e.jsonToJS;
|
|
1091
|
+
}
|
|
1092
|
+
function En(e) {
|
|
1093
|
+
if (e.jsToJSON === void 0) {
|
|
1094
|
+
const t = {};
|
|
1095
|
+
e.props.forEach((i) => t[i.js] = { key: i.json, typ: i.typ }), e.jsToJSON = t;
|
|
1096
|
+
}
|
|
1097
|
+
return e.jsToJSON;
|
|
1098
|
+
}
|
|
1099
|
+
function xe(e, t, i, o = "") {
|
|
1100
|
+
function c(w, d) {
|
|
1101
|
+
return typeof w == typeof d ? d : ne(w, d, o);
|
|
1102
|
+
}
|
|
1103
|
+
function l(w, d) {
|
|
1104
|
+
const B = w.length;
|
|
1105
|
+
for (let S = 0; S < B; S++) {
|
|
1106
|
+
const C = w[S];
|
|
1107
|
+
try {
|
|
1108
|
+
return xe(d, C, i);
|
|
1109
|
+
} catch {
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
return ne(w, d);
|
|
1113
|
+
}
|
|
1114
|
+
function f(w, d) {
|
|
1115
|
+
return w.indexOf(d) !== -1 ? d : ne(w, d);
|
|
1116
|
+
}
|
|
1117
|
+
function u(w, d) {
|
|
1118
|
+
return Array.isArray(d) ? d.map((B) => xe(B, w, i)) : ne("array", d);
|
|
1119
|
+
}
|
|
1120
|
+
function E(w) {
|
|
1121
|
+
if (w === null)
|
|
1122
|
+
return null;
|
|
1123
|
+
const d = new Date(w);
|
|
1124
|
+
return isNaN(d.valueOf()) ? ne("Date", w) : d;
|
|
1125
|
+
}
|
|
1126
|
+
function g(w, d, B) {
|
|
1127
|
+
if (B === null || typeof B != "object" || Array.isArray(B))
|
|
1128
|
+
return ne("object", B);
|
|
1129
|
+
const S = {};
|
|
1130
|
+
return Object.getOwnPropertyNames(w).forEach((C) => {
|
|
1131
|
+
const A = w[C], D = Object.prototype.hasOwnProperty.call(B, C) ? B[C] : void 0;
|
|
1132
|
+
S[A.key] = xe(D, A.typ, i, A.key);
|
|
1133
|
+
}), Object.getOwnPropertyNames(B).forEach((C) => {
|
|
1134
|
+
Object.prototype.hasOwnProperty.call(w, C) || (S[C] = xe(B[C], d, i, C));
|
|
1135
|
+
}), S;
|
|
1136
|
+
}
|
|
1137
|
+
if (t === "any")
|
|
1138
|
+
return e;
|
|
1139
|
+
if (t === null)
|
|
1140
|
+
return e === null ? e : ne(t, e);
|
|
1141
|
+
if (t === !1)
|
|
1142
|
+
return ne(t, e);
|
|
1143
|
+
for (; typeof t == "object" && t.ref !== void 0; )
|
|
1144
|
+
t = wn[t.ref];
|
|
1145
|
+
return Array.isArray(t) ? f(t, e) : typeof t == "object" ? t.hasOwnProperty("unionMembers") ? l(t.unionMembers, e) : t.hasOwnProperty("arrayItems") ? u(t.arrayItems, e) : t.hasOwnProperty("props") ? g(i(t), t.additional, e) : ne(t, e) : t === Date && typeof e != "number" ? E(e) : c(t, e);
|
|
1146
|
+
}
|
|
1147
|
+
function ut(e, t) {
|
|
1148
|
+
return xe(e, t, yn);
|
|
1149
|
+
}
|
|
1150
|
+
function ft(e, t) {
|
|
1151
|
+
return xe(e, t, En);
|
|
1152
|
+
}
|
|
1153
|
+
function pe(...e) {
|
|
1154
|
+
return { unionMembers: e };
|
|
1155
|
+
}
|
|
1156
|
+
function lt(e, t) {
|
|
1157
|
+
return { props: e, additional: t };
|
|
1158
|
+
}
|
|
1159
|
+
function ie(e) {
|
|
1160
|
+
return { ref: e };
|
|
1161
|
+
}
|
|
1162
|
+
const wn = {
|
|
1163
|
+
PriceFeed: lt([
|
|
1164
|
+
{ json: "ema_price", js: "ema_price", typ: ie("Price") },
|
|
1165
|
+
{ json: "id", js: "id", typ: "" },
|
|
1166
|
+
{
|
|
1167
|
+
json: "metadata",
|
|
1168
|
+
js: "metadata",
|
|
1169
|
+
typ: pe(void 0, ie("PriceFeedMetadata"))
|
|
1170
|
+
},
|
|
1171
|
+
{ json: "price", js: "price", typ: ie("Price") },
|
|
1172
|
+
{ json: "vaa", js: "vaa", typ: pe(void 0, "") }
|
|
1173
|
+
], "any"),
|
|
1174
|
+
Price: lt([
|
|
1175
|
+
{ json: "conf", js: "conf", typ: "" },
|
|
1176
|
+
{ json: "expo", js: "expo", typ: 0 },
|
|
1177
|
+
{ json: "price", js: "price", typ: "" },
|
|
1178
|
+
{ json: "publish_time", js: "publish_time", typ: 0 }
|
|
1179
|
+
], "any"),
|
|
1180
|
+
PriceFeedMetadata: lt([
|
|
1181
|
+
{
|
|
1182
|
+
json: "attestation_time",
|
|
1183
|
+
js: "attestation_time",
|
|
1184
|
+
typ: pe(void 0, 0)
|
|
1185
|
+
},
|
|
1186
|
+
{ json: "emitter_chain", js: "emitter_chain", typ: 0 },
|
|
1187
|
+
{
|
|
1188
|
+
json: "prev_publish_time",
|
|
1189
|
+
js: "prev_publish_time",
|
|
1190
|
+
typ: pe(void 0, 0)
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
json: "price_service_receive_time",
|
|
1194
|
+
js: "price_service_receive_time",
|
|
1195
|
+
typ: pe(void 0, 0)
|
|
1196
|
+
},
|
|
1197
|
+
{ json: "sequence_number", js: "sequence_number", typ: pe(void 0, 0) },
|
|
1198
|
+
{ json: "slot", js: "slot", typ: pe(void 0, 0) }
|
|
1199
|
+
], "any")
|
|
1200
|
+
};
|
|
1201
|
+
Object.defineProperty(oe, "__esModule", { value: !0 });
|
|
1202
|
+
oe.PriceFeed = oe.PriceFeedMetadata = oe.Price = void 0;
|
|
1203
|
+
const ge = Ve;
|
|
1204
|
+
class Pe {
|
|
1205
|
+
constructor(t) {
|
|
1206
|
+
I(this, "conf");
|
|
1207
|
+
I(this, "expo");
|
|
1208
|
+
I(this, "price");
|
|
1209
|
+
I(this, "publishTime");
|
|
1210
|
+
this.conf = t.conf, this.expo = t.expo, this.price = t.price, this.publishTime = t.publishTime;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Get price as number. Warning: this conversion might result in an inaccurate number.
|
|
1214
|
+
* We store price and confidence values in our Oracle at 64-bit precision, but the JavaScript
|
|
1215
|
+
* number type can only represent numbers with 52-bit precision. So if a price or confidence
|
|
1216
|
+
* is larger than 52-bits, the conversion will lose the most insignificant bits.
|
|
1217
|
+
*
|
|
1218
|
+
* @returns a floating point number representing the price
|
|
1219
|
+
*/
|
|
1220
|
+
getPriceAsNumberUnchecked() {
|
|
1221
|
+
return Number(this.price) * 10 ** this.expo;
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Get price as number. Warning: this conversion might result in an inaccurate number.
|
|
1225
|
+
* Explanation is the same as `priceAsNumberUnchecked()` documentation.
|
|
1226
|
+
*
|
|
1227
|
+
* @returns a floating point number representing the price
|
|
1228
|
+
*/
|
|
1229
|
+
getConfAsNumberUnchecked() {
|
|
1230
|
+
return Number(this.conf) * 10 ** this.expo;
|
|
1231
|
+
}
|
|
1232
|
+
static fromJson(t) {
|
|
1233
|
+
const i = ge.Convert.toPrice(t);
|
|
1234
|
+
return new Pe({
|
|
1235
|
+
conf: i.conf,
|
|
1236
|
+
expo: i.expo,
|
|
1237
|
+
price: i.price,
|
|
1238
|
+
publishTime: i.publish_time
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
toJson() {
|
|
1242
|
+
const t = {
|
|
1243
|
+
conf: this.conf,
|
|
1244
|
+
expo: this.expo,
|
|
1245
|
+
price: this.price,
|
|
1246
|
+
publish_time: this.publishTime
|
|
1247
|
+
};
|
|
1248
|
+
return ge.Convert.priceToJson(t);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
oe.Price = Pe;
|
|
1252
|
+
class Ke {
|
|
1253
|
+
constructor(t) {
|
|
1254
|
+
/**
|
|
1255
|
+
* Attestation time of the price
|
|
1256
|
+
*/
|
|
1257
|
+
I(this, "attestationTime");
|
|
1258
|
+
/**
|
|
1259
|
+
* Chain of the emitter
|
|
1260
|
+
*/
|
|
1261
|
+
I(this, "emitterChain");
|
|
1262
|
+
/**
|
|
1263
|
+
* The time that the price service received the price
|
|
1264
|
+
*/
|
|
1265
|
+
I(this, "priceServiceReceiveTime");
|
|
1266
|
+
/**
|
|
1267
|
+
* Sequence number of the price
|
|
1268
|
+
*/
|
|
1269
|
+
I(this, "sequenceNumber");
|
|
1270
|
+
/**
|
|
1271
|
+
* Pythnet slot number of the price
|
|
1272
|
+
*/
|
|
1273
|
+
I(this, "slot");
|
|
1274
|
+
/**
|
|
1275
|
+
* The time that the previous price was published
|
|
1276
|
+
*/
|
|
1277
|
+
I(this, "prevPublishTime");
|
|
1278
|
+
this.attestationTime = t.attestationTime, this.emitterChain = t.emitterChain, this.priceServiceReceiveTime = t.receiveTime, this.sequenceNumber = t.sequenceNumber, this.slot = t.slot, this.prevPublishTime = t.prevPublishTime;
|
|
1279
|
+
}
|
|
1280
|
+
static fromJson(t) {
|
|
1281
|
+
if (t === void 0)
|
|
1282
|
+
return;
|
|
1283
|
+
const i = ge.Convert.toPriceFeedMetadata(t);
|
|
1284
|
+
return new Ke({
|
|
1285
|
+
attestationTime: i.attestation_time,
|
|
1286
|
+
emitterChain: i.emitter_chain,
|
|
1287
|
+
receiveTime: i.price_service_receive_time,
|
|
1288
|
+
sequenceNumber: i.sequence_number,
|
|
1289
|
+
slot: i.slot,
|
|
1290
|
+
prevPublishTime: i.prev_publish_time
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
toJson() {
|
|
1294
|
+
const t = {
|
|
1295
|
+
attestation_time: this.attestationTime,
|
|
1296
|
+
emitter_chain: this.emitterChain,
|
|
1297
|
+
price_service_receive_time: this.priceServiceReceiveTime,
|
|
1298
|
+
sequence_number: this.sequenceNumber,
|
|
1299
|
+
slot: this.slot,
|
|
1300
|
+
prev_publish_time: this.prevPublishTime
|
|
1301
|
+
};
|
|
1302
|
+
return ge.Convert.priceFeedMetadataToJson(t);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
oe.PriceFeedMetadata = Ke;
|
|
1306
|
+
class Nt {
|
|
1307
|
+
constructor(t) {
|
|
1308
|
+
/**
|
|
1309
|
+
* Exponentially-weighted moving average Price
|
|
1310
|
+
*/
|
|
1311
|
+
I(this, "emaPrice");
|
|
1312
|
+
/**
|
|
1313
|
+
* Unique identifier for this price.
|
|
1314
|
+
*/
|
|
1315
|
+
I(this, "id");
|
|
1316
|
+
/**
|
|
1317
|
+
* Metadata of the price
|
|
1318
|
+
*/
|
|
1319
|
+
I(this, "metadata");
|
|
1320
|
+
/**
|
|
1321
|
+
* VAA of the price
|
|
1322
|
+
*/
|
|
1323
|
+
I(this, "vaa");
|
|
1324
|
+
/**
|
|
1325
|
+
* Price
|
|
1326
|
+
*/
|
|
1327
|
+
I(this, "price");
|
|
1328
|
+
this.emaPrice = t.emaPrice, this.id = t.id, this.metadata = t.metadata, this.vaa = t.vaa, this.price = t.price;
|
|
1329
|
+
}
|
|
1330
|
+
static fromJson(t) {
|
|
1331
|
+
const i = ge.Convert.toPriceFeed(t);
|
|
1332
|
+
return new Nt({
|
|
1333
|
+
emaPrice: Pe.fromJson(i.ema_price),
|
|
1334
|
+
id: i.id,
|
|
1335
|
+
metadata: Ke.fromJson(i.metadata),
|
|
1336
|
+
vaa: i.vaa,
|
|
1337
|
+
price: Pe.fromJson(i.price)
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
toJson() {
|
|
1341
|
+
var i;
|
|
1342
|
+
const t = {
|
|
1343
|
+
ema_price: this.emaPrice.toJson(),
|
|
1344
|
+
id: this.id,
|
|
1345
|
+
metadata: (i = this.metadata) == null ? void 0 : i.toJson(),
|
|
1346
|
+
price: this.price.toJson()
|
|
1347
|
+
};
|
|
1348
|
+
return ge.Convert.priceFeedToJson(t);
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Get the price and confidence interval as fixed-point numbers of the form a * 10^e.
|
|
1352
|
+
* This function returns the current best estimate of the price at the time that this `PriceFeed` was
|
|
1353
|
+
* published (`publishTime`). The returned price can be from arbitrarily far in the past; this function
|
|
1354
|
+
* makes no guarantees that the returned price is recent or useful for any particular application.
|
|
1355
|
+
*
|
|
1356
|
+
* Users of this function should check the returned `publishTime` to ensure that the returned price is
|
|
1357
|
+
* sufficiently recent for their application. If you are considering using this function, it may be
|
|
1358
|
+
* safer / easier to use `getPriceNoOlderThan` method.
|
|
1359
|
+
*
|
|
1360
|
+
* @returns a Price that contains the price and confidence interval along with
|
|
1361
|
+
* the exponent for them, and publish time of the price.
|
|
1362
|
+
*/
|
|
1363
|
+
getPriceUnchecked() {
|
|
1364
|
+
return this.price;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Get the exponentially-weighted moving average (EMA) price and confidence interval.
|
|
1368
|
+
*
|
|
1369
|
+
* This function returns the current best estimate of the price at the time that this `PriceFeed` was
|
|
1370
|
+
* published (`publishTime`). The returned price can be from arbitrarily far in the past; this function
|
|
1371
|
+
* makes no guarantees that the returned price is recent or useful for any particular application.
|
|
1372
|
+
*
|
|
1373
|
+
* Users of this function should check the returned `publishTime` to ensure that the returned price is
|
|
1374
|
+
* sufficiently recent for their application. If you are considering using this function, it may be
|
|
1375
|
+
* safer / easier to use `getEmaPriceNoOlderThan` method.
|
|
1376
|
+
*
|
|
1377
|
+
* At the moment, the confidence interval returned by this method is computed in
|
|
1378
|
+
* a somewhat questionable way, so we do not recommend using it for high-value applications.
|
|
1379
|
+
*
|
|
1380
|
+
* @returns a Price that contains the EMA price and confidence interval along with
|
|
1381
|
+
* the exponent for them, and publish time of the price.
|
|
1382
|
+
*/
|
|
1383
|
+
getEmaPriceUnchecked() {
|
|
1384
|
+
return this.emaPrice;
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Get the price if it was updated no older than `age` seconds of the current time.
|
|
1388
|
+
*
|
|
1389
|
+
* This function is a sanity-checked version of `getPriceUnchecked` which is useful in
|
|
1390
|
+
* applications that require a sufficiently-recent price. Returns `undefined` if the price
|
|
1391
|
+
* is not recent enough.
|
|
1392
|
+
*
|
|
1393
|
+
* @param age return a price as long as it has been updated within this number of seconds
|
|
1394
|
+
* @returns a Price struct containing the price, confidence interval along with the exponent for
|
|
1395
|
+
* both numbers, and its publish time, or `undefined` if no price update occurred within `age` seconds of the current time.
|
|
1396
|
+
*/
|
|
1397
|
+
getPriceNoOlderThan(t) {
|
|
1398
|
+
const i = this.getPriceUnchecked(), o = Math.floor(Date.now() / 1e3);
|
|
1399
|
+
if (!(Math.abs(o - i.publishTime) > t))
|
|
1400
|
+
return i;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* Get the exponentially-weighted moving average (EMA) price if it was updated no older than
|
|
1404
|
+
* `age` seconds of the current time.
|
|
1405
|
+
*
|
|
1406
|
+
* This function is a sanity-checked version of `getEmaPriceUnchecked` which is useful in
|
|
1407
|
+
* applications that require a sufficiently-recent price. Returns `undefined` if the price
|
|
1408
|
+
* is not recent enough.
|
|
1409
|
+
*
|
|
1410
|
+
* At the moment, the confidence interval returned by this method is computed in
|
|
1411
|
+
* a somewhat questionable way, so we do not recommend using it for high-value applications.
|
|
1412
|
+
*
|
|
1413
|
+
* @param age return a price as long as it has been updated within this number of seconds
|
|
1414
|
+
* @returns a Price struct containing the EMA price, confidence interval along with the exponent for
|
|
1415
|
+
* both numbers, and its publish time, or `undefined` if no price update occurred within `age` seconds of the current time.
|
|
1416
|
+
*/
|
|
1417
|
+
getEmaPriceNoOlderThan(t) {
|
|
1418
|
+
const i = this.getEmaPriceUnchecked(), o = Math.floor(Date.now() / 1e3);
|
|
1419
|
+
if (!(Math.abs(o - i.publishTime) > t))
|
|
1420
|
+
return i;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Get the price feed metadata.
|
|
1424
|
+
*
|
|
1425
|
+
* @returns a struct containing the attestation time, emitter chain, and the sequence number.
|
|
1426
|
+
* Returns `undefined` if metadata is currently unavailable.
|
|
1427
|
+
*/
|
|
1428
|
+
getMetadata() {
|
|
1429
|
+
return this.metadata;
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Get the price feed vaa.
|
|
1433
|
+
*
|
|
1434
|
+
* @returns vaa in base64.
|
|
1435
|
+
* Returns `undefined` if vaa is unavailable.
|
|
1436
|
+
*/
|
|
1437
|
+
getVAA() {
|
|
1438
|
+
return this.vaa;
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
oe.PriceFeed = Nt;
|
|
1442
|
+
function _r(e, t) {
|
|
1443
|
+
return function() {
|
|
1444
|
+
return e.apply(t, arguments);
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
const { toString: bn } = Object.prototype, { getPrototypeOf: Ut } = Object, Ye = ((e) => (t) => {
|
|
1448
|
+
const i = bn.call(t);
|
|
1449
|
+
return e[i] || (e[i] = i.slice(8, -1).toLowerCase());
|
|
1450
|
+
})(/* @__PURE__ */ Object.create(null)), re = (e) => (e = e.toLowerCase(), (t) => Ye(t) === e), Xe = (e) => (t) => typeof t === e, { isArray: Fe } = Array, Ie = Xe("undefined");
|
|
1451
|
+
function xn(e) {
|
|
1452
|
+
return e !== null && !Ie(e) && e.constructor !== null && !Ie(e.constructor) && Y(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
1453
|
+
}
|
|
1454
|
+
const Cr = re("ArrayBuffer");
|
|
1455
|
+
function gn(e) {
|
|
1456
|
+
let t;
|
|
1457
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Cr(e.buffer), t;
|
|
1458
|
+
}
|
|
1459
|
+
const _n = Xe("string"), Y = Xe("function"), Fr = Xe("number"), Ze = (e) => e !== null && typeof e == "object", Cn = (e) => e === !0 || e === !1, Me = (e) => {
|
|
1460
|
+
if (Ye(e) !== "object")
|
|
1461
|
+
return !1;
|
|
1462
|
+
const t = Ut(e);
|
|
1463
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
1464
|
+
}, Fn = re("Date"), An = re("File"), Bn = re("Blob"), Rn = re("FileList"), Tn = (e) => Ze(e) && Y(e.pipe), Sn = (e) => {
|
|
1465
|
+
let t;
|
|
1466
|
+
return e && (typeof FormData == "function" && e instanceof FormData || Y(e.append) && ((t = Ye(e)) === "formdata" || // detect form-data instance
|
|
1467
|
+
t === "object" && Y(e.toString) && e.toString() === "[object FormData]"));
|
|
1468
|
+
}, Dn = re("URLSearchParams"), On = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
1469
|
+
function ve(e, t, { allOwnKeys: i = !1 } = {}) {
|
|
1470
|
+
if (e === null || typeof e > "u")
|
|
1471
|
+
return;
|
|
1472
|
+
let o, c;
|
|
1473
|
+
if (typeof e != "object" && (e = [e]), Fe(e))
|
|
1474
|
+
for (o = 0, c = e.length; o < c; o++)
|
|
1475
|
+
t.call(null, e[o], o, e);
|
|
1476
|
+
else {
|
|
1477
|
+
const l = i ? Object.getOwnPropertyNames(e) : Object.keys(e), f = l.length;
|
|
1478
|
+
let u;
|
|
1479
|
+
for (o = 0; o < f; o++)
|
|
1480
|
+
u = l[o], t.call(null, e[u], u, e);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
function Ar(e, t) {
|
|
1484
|
+
t = t.toLowerCase();
|
|
1485
|
+
const i = Object.keys(e);
|
|
1486
|
+
let o = i.length, c;
|
|
1487
|
+
for (; o-- > 0; )
|
|
1488
|
+
if (c = i[o], t === c.toLowerCase())
|
|
1489
|
+
return c;
|
|
1490
|
+
return null;
|
|
1491
|
+
}
|
|
1492
|
+
const Br = (() => typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : fe)(), Rr = (e) => !Ie(e) && e !== Br;
|
|
1493
|
+
function Rt() {
|
|
1494
|
+
const { caseless: e } = Rr(this) && this || {}, t = {}, i = (o, c) => {
|
|
1495
|
+
const l = e && Ar(t, c) || c;
|
|
1496
|
+
Me(t[l]) && Me(o) ? t[l] = Rt(t[l], o) : Me(o) ? t[l] = Rt({}, o) : Fe(o) ? t[l] = o.slice() : t[l] = o;
|
|
1497
|
+
};
|
|
1498
|
+
for (let o = 0, c = arguments.length; o < c; o++)
|
|
1499
|
+
arguments[o] && ve(arguments[o], i);
|
|
1500
|
+
return t;
|
|
1501
|
+
}
|
|
1502
|
+
const Pn = (e, t, i, { allOwnKeys: o } = {}) => (ve(t, (c, l) => {
|
|
1503
|
+
i && Y(c) ? e[l] = _r(c, i) : e[l] = c;
|
|
1504
|
+
}, { allOwnKeys: o }), e), In = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), vn = (e, t, i, o) => {
|
|
1505
|
+
e.prototype = Object.create(t.prototype, o), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
1506
|
+
value: t.prototype
|
|
1507
|
+
}), i && Object.assign(e.prototype, i);
|
|
1508
|
+
}, Nn = (e, t, i, o) => {
|
|
1509
|
+
let c, l, f;
|
|
1510
|
+
const u = {};
|
|
1511
|
+
if (t = t || {}, e == null)
|
|
1512
|
+
return t;
|
|
1513
|
+
do {
|
|
1514
|
+
for (c = Object.getOwnPropertyNames(e), l = c.length; l-- > 0; )
|
|
1515
|
+
f = c[l], (!o || o(f, e, t)) && !u[f] && (t[f] = e[f], u[f] = !0);
|
|
1516
|
+
e = i !== !1 && Ut(e);
|
|
1517
|
+
} while (e && (!i || i(e, t)) && e !== Object.prototype);
|
|
1518
|
+
return t;
|
|
1519
|
+
}, Un = (e, t, i) => {
|
|
1520
|
+
e = String(e), (i === void 0 || i > e.length) && (i = e.length), i -= t.length;
|
|
1521
|
+
const o = e.indexOf(t, i);
|
|
1522
|
+
return o !== -1 && o === i;
|
|
1523
|
+
}, kn = (e) => {
|
|
1524
|
+
if (!e)
|
|
1525
|
+
return null;
|
|
1526
|
+
if (Fe(e))
|
|
1527
|
+
return e;
|
|
1528
|
+
let t = e.length;
|
|
1529
|
+
if (!Fr(t))
|
|
1530
|
+
return null;
|
|
1531
|
+
const i = new Array(t);
|
|
1532
|
+
for (; t-- > 0; )
|
|
1533
|
+
i[t] = e[t];
|
|
1534
|
+
return i;
|
|
1535
|
+
}, Ln = ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ut(Uint8Array)), jn = (e, t) => {
|
|
1536
|
+
const o = (e && e[Symbol.iterator]).call(e);
|
|
1537
|
+
let c;
|
|
1538
|
+
for (; (c = o.next()) && !c.done; ) {
|
|
1539
|
+
const l = c.value;
|
|
1540
|
+
t.call(e, l[0], l[1]);
|
|
1541
|
+
}
|
|
1542
|
+
}, Mn = (e, t) => {
|
|
1543
|
+
let i;
|
|
1544
|
+
const o = [];
|
|
1545
|
+
for (; (i = e.exec(t)) !== null; )
|
|
1546
|
+
o.push(i);
|
|
1547
|
+
return o;
|
|
1548
|
+
}, qn = re("HTMLFormElement"), $n = (e) => e.toLowerCase().replace(
|
|
1549
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
1550
|
+
function(i, o, c) {
|
|
1551
|
+
return o.toUpperCase() + c;
|
|
1552
|
+
}
|
|
1553
|
+
), Yt = (({ hasOwnProperty: e }) => (t, i) => e.call(t, i))(Object.prototype), Wn = re("RegExp"), Tr = (e, t) => {
|
|
1554
|
+
const i = Object.getOwnPropertyDescriptors(e), o = {};
|
|
1555
|
+
ve(i, (c, l) => {
|
|
1556
|
+
let f;
|
|
1557
|
+
(f = t(c, l, e)) !== !1 && (o[l] = f || c);
|
|
1558
|
+
}), Object.defineProperties(e, o);
|
|
1559
|
+
}, Jn = (e) => {
|
|
1560
|
+
Tr(e, (t, i) => {
|
|
1561
|
+
if (Y(e) && ["arguments", "caller", "callee"].indexOf(i) !== -1)
|
|
1562
|
+
return !1;
|
|
1563
|
+
const o = e[i];
|
|
1564
|
+
if (Y(o)) {
|
|
1565
|
+
if (t.enumerable = !1, "writable" in t) {
|
|
1566
|
+
t.writable = !1;
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
t.set || (t.set = () => {
|
|
1570
|
+
throw Error("Can not rewrite read-only method '" + i + "'");
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
});
|
|
1574
|
+
}, Hn = (e, t) => {
|
|
1575
|
+
const i = {}, o = (c) => {
|
|
1576
|
+
c.forEach((l) => {
|
|
1577
|
+
i[l] = !0;
|
|
1578
|
+
});
|
|
1579
|
+
};
|
|
1580
|
+
return Fe(e) ? o(e) : o(String(e).split(t)), i;
|
|
1581
|
+
}, zn = () => {
|
|
1582
|
+
}, Gn = (e, t) => (e = +e, Number.isFinite(e) ? e : t), pt = "abcdefghijklmnopqrstuvwxyz", Xt = "0123456789", Sr = {
|
|
1583
|
+
DIGIT: Xt,
|
|
1584
|
+
ALPHA: pt,
|
|
1585
|
+
ALPHA_DIGIT: pt + pt.toUpperCase() + Xt
|
|
1586
|
+
}, Vn = (e = 16, t = Sr.ALPHA_DIGIT) => {
|
|
1587
|
+
let i = "";
|
|
1588
|
+
const { length: o } = t;
|
|
1589
|
+
for (; e--; )
|
|
1590
|
+
i += t[Math.random() * o | 0];
|
|
1591
|
+
return i;
|
|
1592
|
+
};
|
|
1593
|
+
function Kn(e) {
|
|
1594
|
+
return !!(e && Y(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
|
|
1595
|
+
}
|
|
1596
|
+
const Yn = (e) => {
|
|
1597
|
+
const t = new Array(10), i = (o, c) => {
|
|
1598
|
+
if (Ze(o)) {
|
|
1599
|
+
if (t.indexOf(o) >= 0)
|
|
1600
|
+
return;
|
|
1601
|
+
if (!("toJSON" in o)) {
|
|
1602
|
+
t[c] = o;
|
|
1603
|
+
const l = Fe(o) ? [] : {};
|
|
1604
|
+
return ve(o, (f, u) => {
|
|
1605
|
+
const E = i(f, c + 1);
|
|
1606
|
+
!Ie(E) && (l[u] = E);
|
|
1607
|
+
}), t[c] = void 0, l;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
return o;
|
|
1611
|
+
};
|
|
1612
|
+
return i(e, 0);
|
|
1613
|
+
}, Xn = re("AsyncFunction"), Zn = (e) => e && (Ze(e) || Y(e)) && Y(e.then) && Y(e.catch);
|
|
1614
|
+
var y = {
|
|
1615
|
+
isArray: Fe,
|
|
1616
|
+
isArrayBuffer: Cr,
|
|
1617
|
+
isBuffer: xn,
|
|
1618
|
+
isFormData: Sn,
|
|
1619
|
+
isArrayBufferView: gn,
|
|
1620
|
+
isString: _n,
|
|
1621
|
+
isNumber: Fr,
|
|
1622
|
+
isBoolean: Cn,
|
|
1623
|
+
isObject: Ze,
|
|
1624
|
+
isPlainObject: Me,
|
|
1625
|
+
isUndefined: Ie,
|
|
1626
|
+
isDate: Fn,
|
|
1627
|
+
isFile: An,
|
|
1628
|
+
isBlob: Bn,
|
|
1629
|
+
isRegExp: Wn,
|
|
1630
|
+
isFunction: Y,
|
|
1631
|
+
isStream: Tn,
|
|
1632
|
+
isURLSearchParams: Dn,
|
|
1633
|
+
isTypedArray: Ln,
|
|
1634
|
+
isFileList: Rn,
|
|
1635
|
+
forEach: ve,
|
|
1636
|
+
merge: Rt,
|
|
1637
|
+
extend: Pn,
|
|
1638
|
+
trim: On,
|
|
1639
|
+
stripBOM: In,
|
|
1640
|
+
inherits: vn,
|
|
1641
|
+
toFlatObject: Nn,
|
|
1642
|
+
kindOf: Ye,
|
|
1643
|
+
kindOfTest: re,
|
|
1644
|
+
endsWith: Un,
|
|
1645
|
+
toArray: kn,
|
|
1646
|
+
forEachEntry: jn,
|
|
1647
|
+
matchAll: Mn,
|
|
1648
|
+
isHTMLForm: qn,
|
|
1649
|
+
hasOwnProperty: Yt,
|
|
1650
|
+
hasOwnProp: Yt,
|
|
1651
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
1652
|
+
reduceDescriptors: Tr,
|
|
1653
|
+
freezeMethods: Jn,
|
|
1654
|
+
toObjectSet: Hn,
|
|
1655
|
+
toCamelCase: $n,
|
|
1656
|
+
noop: zn,
|
|
1657
|
+
toFiniteNumber: Gn,
|
|
1658
|
+
findKey: Ar,
|
|
1659
|
+
global: Br,
|
|
1660
|
+
isContextDefined: Rr,
|
|
1661
|
+
ALPHABET: Sr,
|
|
1662
|
+
generateString: Vn,
|
|
1663
|
+
isSpecCompliantForm: Kn,
|
|
1664
|
+
toJSONObject: Yn,
|
|
1665
|
+
isAsyncFn: Xn,
|
|
1666
|
+
isThenable: Zn
|
|
1667
|
+
};
|
|
1668
|
+
function P(e, t, i, o, c) {
|
|
1669
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), i && (this.config = i), o && (this.request = o), c && (this.response = c);
|
|
1670
|
+
}
|
|
1671
|
+
y.inherits(P, Error, {
|
|
1672
|
+
toJSON: function() {
|
|
1673
|
+
return {
|
|
1674
|
+
// Standard
|
|
1675
|
+
message: this.message,
|
|
1676
|
+
name: this.name,
|
|
1677
|
+
// Microsoft
|
|
1678
|
+
description: this.description,
|
|
1679
|
+
number: this.number,
|
|
1680
|
+
// Mozilla
|
|
1681
|
+
fileName: this.fileName,
|
|
1682
|
+
lineNumber: this.lineNumber,
|
|
1683
|
+
columnNumber: this.columnNumber,
|
|
1684
|
+
stack: this.stack,
|
|
1685
|
+
// Axios
|
|
1686
|
+
config: y.toJSONObject(this.config),
|
|
1687
|
+
code: this.code,
|
|
1688
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
const Dr = P.prototype, Or = {};
|
|
1693
|
+
[
|
|
1694
|
+
"ERR_BAD_OPTION_VALUE",
|
|
1695
|
+
"ERR_BAD_OPTION",
|
|
1696
|
+
"ECONNABORTED",
|
|
1697
|
+
"ETIMEDOUT",
|
|
1698
|
+
"ERR_NETWORK",
|
|
1699
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
1700
|
+
"ERR_DEPRECATED",
|
|
1701
|
+
"ERR_BAD_RESPONSE",
|
|
1702
|
+
"ERR_BAD_REQUEST",
|
|
1703
|
+
"ERR_CANCELED",
|
|
1704
|
+
"ERR_NOT_SUPPORT",
|
|
1705
|
+
"ERR_INVALID_URL"
|
|
1706
|
+
// eslint-disable-next-line func-names
|
|
1707
|
+
].forEach((e) => {
|
|
1708
|
+
Or[e] = { value: e };
|
|
1709
|
+
});
|
|
1710
|
+
Object.defineProperties(P, Or);
|
|
1711
|
+
Object.defineProperty(Dr, "isAxiosError", { value: !0 });
|
|
1712
|
+
P.from = (e, t, i, o, c, l) => {
|
|
1713
|
+
const f = Object.create(Dr);
|
|
1714
|
+
return y.toFlatObject(e, f, function(E) {
|
|
1715
|
+
return E !== Error.prototype;
|
|
1716
|
+
}, (u) => u !== "isAxiosError"), P.call(f, e.message, t, i, o, c), f.cause = e, f.name = e.name, l && Object.assign(f, l), f;
|
|
1717
|
+
};
|
|
1718
|
+
var Qn = null;
|
|
1719
|
+
function Tt(e) {
|
|
1720
|
+
return y.isPlainObject(e) || y.isArray(e);
|
|
1721
|
+
}
|
|
1722
|
+
function Pr(e) {
|
|
1723
|
+
return y.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
1724
|
+
}
|
|
1725
|
+
function Zt(e, t, i) {
|
|
1726
|
+
return e ? e.concat(t).map(function(c, l) {
|
|
1727
|
+
return c = Pr(c), !i && l ? "[" + c + "]" : c;
|
|
1728
|
+
}).join(i ? "." : "") : t;
|
|
1729
|
+
}
|
|
1730
|
+
function ei(e) {
|
|
1731
|
+
return y.isArray(e) && !e.some(Tt);
|
|
1732
|
+
}
|
|
1733
|
+
const ti = y.toFlatObject(y, {}, null, function(t) {
|
|
1734
|
+
return /^is[A-Z]/.test(t);
|
|
1735
|
+
});
|
|
1736
|
+
function Qe(e, t, i) {
|
|
1737
|
+
if (!y.isObject(e))
|
|
1738
|
+
throw new TypeError("target must be an object");
|
|
1739
|
+
t = t || new FormData(), i = y.toFlatObject(i, {
|
|
1740
|
+
metaTokens: !0,
|
|
1741
|
+
dots: !1,
|
|
1742
|
+
indexes: !1
|
|
1743
|
+
}, !1, function(A, D) {
|
|
1744
|
+
return !y.isUndefined(D[A]);
|
|
1745
|
+
});
|
|
1746
|
+
const o = i.metaTokens, c = i.visitor || w, l = i.dots, f = i.indexes, E = (i.Blob || typeof Blob < "u" && Blob) && y.isSpecCompliantForm(t);
|
|
1747
|
+
if (!y.isFunction(c))
|
|
1748
|
+
throw new TypeError("visitor must be a function");
|
|
1749
|
+
function g(C) {
|
|
1750
|
+
if (C === null)
|
|
1751
|
+
return "";
|
|
1752
|
+
if (y.isDate(C))
|
|
1753
|
+
return C.toISOString();
|
|
1754
|
+
if (!E && y.isBlob(C))
|
|
1755
|
+
throw new P("Blob is not supported. Use a Buffer instead.");
|
|
1756
|
+
return y.isArrayBuffer(C) || y.isTypedArray(C) ? E && typeof Blob == "function" ? new Blob([C]) : Buffer.from(C) : C;
|
|
1757
|
+
}
|
|
1758
|
+
function w(C, A, D) {
|
|
1759
|
+
let N = C;
|
|
1760
|
+
if (C && !D && typeof C == "object") {
|
|
1761
|
+
if (y.endsWith(A, "{}"))
|
|
1762
|
+
A = o ? A : A.slice(0, -2), C = JSON.stringify(C);
|
|
1763
|
+
else if (y.isArray(C) && ei(C) || (y.isFileList(C) || y.endsWith(A, "[]")) && (N = y.toArray(C)))
|
|
1764
|
+
return A = Pr(A), N.forEach(function(L, le) {
|
|
1765
|
+
!(y.isUndefined(L) || L === null) && t.append(
|
|
1766
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1767
|
+
f === !0 ? Zt([A], le, l) : f === null ? A : A + "[]",
|
|
1768
|
+
g(L)
|
|
1769
|
+
);
|
|
1770
|
+
}), !1;
|
|
1771
|
+
}
|
|
1772
|
+
return Tt(C) ? !0 : (t.append(Zt(D, A, l), g(C)), !1);
|
|
1773
|
+
}
|
|
1774
|
+
const d = [], B = Object.assign(ti, {
|
|
1775
|
+
defaultVisitor: w,
|
|
1776
|
+
convertValue: g,
|
|
1777
|
+
isVisitable: Tt
|
|
1778
|
+
});
|
|
1779
|
+
function S(C, A) {
|
|
1780
|
+
if (!y.isUndefined(C)) {
|
|
1781
|
+
if (d.indexOf(C) !== -1)
|
|
1782
|
+
throw Error("Circular reference detected in " + A.join("."));
|
|
1783
|
+
d.push(C), y.forEach(C, function(N, J) {
|
|
1784
|
+
(!(y.isUndefined(N) || N === null) && c.call(
|
|
1785
|
+
t,
|
|
1786
|
+
N,
|
|
1787
|
+
y.isString(J) ? J.trim() : J,
|
|
1788
|
+
A,
|
|
1789
|
+
B
|
|
1790
|
+
)) === !0 && S(N, A ? A.concat(J) : [J]);
|
|
1791
|
+
}), d.pop();
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
if (!y.isObject(e))
|
|
1795
|
+
throw new TypeError("data must be an object");
|
|
1796
|
+
return S(e), t;
|
|
1797
|
+
}
|
|
1798
|
+
function Qt(e) {
|
|
1799
|
+
const t = {
|
|
1800
|
+
"!": "%21",
|
|
1801
|
+
"'": "%27",
|
|
1802
|
+
"(": "%28",
|
|
1803
|
+
")": "%29",
|
|
1804
|
+
"~": "%7E",
|
|
1805
|
+
"%20": "+",
|
|
1806
|
+
"%00": "\0"
|
|
1807
|
+
};
|
|
1808
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(o) {
|
|
1809
|
+
return t[o];
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
function kt(e, t) {
|
|
1813
|
+
this._pairs = [], e && Qe(e, this, t);
|
|
1814
|
+
}
|
|
1815
|
+
const Ir = kt.prototype;
|
|
1816
|
+
Ir.append = function(t, i) {
|
|
1817
|
+
this._pairs.push([t, i]);
|
|
1818
|
+
};
|
|
1819
|
+
Ir.toString = function(t) {
|
|
1820
|
+
const i = t ? function(o) {
|
|
1821
|
+
return t.call(this, o, Qt);
|
|
1822
|
+
} : Qt;
|
|
1823
|
+
return this._pairs.map(function(c) {
|
|
1824
|
+
return i(c[0]) + "=" + i(c[1]);
|
|
1825
|
+
}, "").join("&");
|
|
1826
|
+
};
|
|
1827
|
+
function ri(e) {
|
|
1828
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
1829
|
+
}
|
|
1830
|
+
function vr(e, t, i) {
|
|
1831
|
+
if (!t)
|
|
1832
|
+
return e;
|
|
1833
|
+
const o = i && i.encode || ri, c = i && i.serialize;
|
|
1834
|
+
let l;
|
|
1835
|
+
if (c ? l = c(t, i) : l = y.isURLSearchParams(t) ? t.toString() : new kt(t, i).toString(o), l) {
|
|
1836
|
+
const f = e.indexOf("#");
|
|
1837
|
+
f !== -1 && (e = e.slice(0, f)), e += (e.indexOf("?") === -1 ? "?" : "&") + l;
|
|
1838
|
+
}
|
|
1839
|
+
return e;
|
|
1840
|
+
}
|
|
1841
|
+
class ni {
|
|
1842
|
+
constructor() {
|
|
1843
|
+
this.handlers = [];
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Add a new interceptor to the stack
|
|
1847
|
+
*
|
|
1848
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
1849
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
1850
|
+
*
|
|
1851
|
+
* @return {Number} An ID used to remove interceptor later
|
|
1852
|
+
*/
|
|
1853
|
+
use(t, i, o) {
|
|
1854
|
+
return this.handlers.push({
|
|
1855
|
+
fulfilled: t,
|
|
1856
|
+
rejected: i,
|
|
1857
|
+
synchronous: o ? o.synchronous : !1,
|
|
1858
|
+
runWhen: o ? o.runWhen : null
|
|
1859
|
+
}), this.handlers.length - 1;
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* Remove an interceptor from the stack
|
|
1863
|
+
*
|
|
1864
|
+
* @param {Number} id The ID that was returned by `use`
|
|
1865
|
+
*
|
|
1866
|
+
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
|
|
1867
|
+
*/
|
|
1868
|
+
eject(t) {
|
|
1869
|
+
this.handlers[t] && (this.handlers[t] = null);
|
|
1870
|
+
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Clear all interceptors from the stack
|
|
1873
|
+
*
|
|
1874
|
+
* @returns {void}
|
|
1875
|
+
*/
|
|
1876
|
+
clear() {
|
|
1877
|
+
this.handlers && (this.handlers = []);
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* Iterate over all the registered interceptors
|
|
1881
|
+
*
|
|
1882
|
+
* This method is particularly useful for skipping over any
|
|
1883
|
+
* interceptors that may have become `null` calling `eject`.
|
|
1884
|
+
*
|
|
1885
|
+
* @param {Function} fn The function to call for each interceptor
|
|
1886
|
+
*
|
|
1887
|
+
* @returns {void}
|
|
1888
|
+
*/
|
|
1889
|
+
forEach(t) {
|
|
1890
|
+
y.forEach(this.handlers, function(o) {
|
|
1891
|
+
o !== null && t(o);
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
var er = ni, Nr = {
|
|
1896
|
+
silentJSONParsing: !0,
|
|
1897
|
+
forcedJSONParsing: !0,
|
|
1898
|
+
clarifyTimeoutError: !1
|
|
1899
|
+
}, ii = typeof URLSearchParams < "u" ? URLSearchParams : kt, oi = typeof FormData < "u" ? FormData : null, si = typeof Blob < "u" ? Blob : null, ai = {
|
|
1900
|
+
isBrowser: !0,
|
|
1901
|
+
classes: {
|
|
1902
|
+
URLSearchParams: ii,
|
|
1903
|
+
FormData: oi,
|
|
1904
|
+
Blob: si
|
|
1905
|
+
},
|
|
1906
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
1907
|
+
};
|
|
1908
|
+
const Ur = typeof window < "u" && typeof document < "u", ci = ((e) => Ur && ["ReactNative", "NativeScript", "NS"].indexOf(e) < 0)(typeof navigator < "u" && navigator.product), ui = (() => typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
1909
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function")();
|
|
1910
|
+
var fi = /* @__PURE__ */ Object.freeze({
|
|
1911
|
+
__proto__: null,
|
|
1912
|
+
hasBrowserEnv: Ur,
|
|
1913
|
+
hasStandardBrowserWebWorkerEnv: ui,
|
|
1914
|
+
hasStandardBrowserEnv: ci
|
|
1915
|
+
}), te = {
|
|
1916
|
+
...fi,
|
|
1917
|
+
...ai
|
|
1918
|
+
};
|
|
1919
|
+
function li(e, t) {
|
|
1920
|
+
return Qe(e, new te.classes.URLSearchParams(), Object.assign({
|
|
1921
|
+
visitor: function(i, o, c, l) {
|
|
1922
|
+
return te.isNode && y.isBuffer(i) ? (this.append(o, i.toString("base64")), !1) : l.defaultVisitor.apply(this, arguments);
|
|
1923
|
+
}
|
|
1924
|
+
}, t));
|
|
1925
|
+
}
|
|
1926
|
+
function pi(e) {
|
|
1927
|
+
return y.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
1928
|
+
}
|
|
1929
|
+
function hi(e) {
|
|
1930
|
+
const t = {}, i = Object.keys(e);
|
|
1931
|
+
let o;
|
|
1932
|
+
const c = i.length;
|
|
1933
|
+
let l;
|
|
1934
|
+
for (o = 0; o < c; o++)
|
|
1935
|
+
l = i[o], t[l] = e[l];
|
|
1936
|
+
return t;
|
|
1937
|
+
}
|
|
1938
|
+
function kr(e) {
|
|
1939
|
+
function t(i, o, c, l) {
|
|
1940
|
+
let f = i[l++];
|
|
1941
|
+
if (f === "__proto__")
|
|
1942
|
+
return !0;
|
|
1943
|
+
const u = Number.isFinite(+f), E = l >= i.length;
|
|
1944
|
+
return f = !f && y.isArray(c) ? c.length : f, E ? (y.hasOwnProp(c, f) ? c[f] = [c[f], o] : c[f] = o, !u) : ((!c[f] || !y.isObject(c[f])) && (c[f] = []), t(i, o, c[f], l) && y.isArray(c[f]) && (c[f] = hi(c[f])), !u);
|
|
1945
|
+
}
|
|
1946
|
+
if (y.isFormData(e) && y.isFunction(e.entries)) {
|
|
1947
|
+
const i = {};
|
|
1948
|
+
return y.forEachEntry(e, (o, c) => {
|
|
1949
|
+
t(pi(o), c, i, 0);
|
|
1950
|
+
}), i;
|
|
1951
|
+
}
|
|
1952
|
+
return null;
|
|
1953
|
+
}
|
|
1954
|
+
function di(e, t, i) {
|
|
1955
|
+
if (y.isString(e))
|
|
1956
|
+
try {
|
|
1957
|
+
return (t || JSON.parse)(e), y.trim(e);
|
|
1958
|
+
} catch (o) {
|
|
1959
|
+
if (o.name !== "SyntaxError")
|
|
1960
|
+
throw o;
|
|
1961
|
+
}
|
|
1962
|
+
return (i || JSON.stringify)(e);
|
|
1963
|
+
}
|
|
1964
|
+
const Lt = {
|
|
1965
|
+
transitional: Nr,
|
|
1966
|
+
adapter: ["xhr", "http"],
|
|
1967
|
+
transformRequest: [function(t, i) {
|
|
1968
|
+
const o = i.getContentType() || "", c = o.indexOf("application/json") > -1, l = y.isObject(t);
|
|
1969
|
+
if (l && y.isHTMLForm(t) && (t = new FormData(t)), y.isFormData(t))
|
|
1970
|
+
return c ? JSON.stringify(kr(t)) : t;
|
|
1971
|
+
if (y.isArrayBuffer(t) || y.isBuffer(t) || y.isStream(t) || y.isFile(t) || y.isBlob(t))
|
|
1972
|
+
return t;
|
|
1973
|
+
if (y.isArrayBufferView(t))
|
|
1974
|
+
return t.buffer;
|
|
1975
|
+
if (y.isURLSearchParams(t))
|
|
1976
|
+
return i.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
1977
|
+
let u;
|
|
1978
|
+
if (l) {
|
|
1979
|
+
if (o.indexOf("application/x-www-form-urlencoded") > -1)
|
|
1980
|
+
return li(t, this.formSerializer).toString();
|
|
1981
|
+
if ((u = y.isFileList(t)) || o.indexOf("multipart/form-data") > -1) {
|
|
1982
|
+
const E = this.env && this.env.FormData;
|
|
1983
|
+
return Qe(
|
|
1984
|
+
u ? { "files[]": t } : t,
|
|
1985
|
+
E && new E(),
|
|
1986
|
+
this.formSerializer
|
|
1987
|
+
);
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
return l || c ? (i.setContentType("application/json", !1), di(t)) : t;
|
|
1991
|
+
}],
|
|
1992
|
+
transformResponse: [function(t) {
|
|
1993
|
+
const i = this.transitional || Lt.transitional, o = i && i.forcedJSONParsing, c = this.responseType === "json";
|
|
1994
|
+
if (t && y.isString(t) && (o && !this.responseType || c)) {
|
|
1995
|
+
const f = !(i && i.silentJSONParsing) && c;
|
|
1996
|
+
try {
|
|
1997
|
+
return JSON.parse(t);
|
|
1998
|
+
} catch (u) {
|
|
1999
|
+
if (f)
|
|
2000
|
+
throw u.name === "SyntaxError" ? P.from(u, P.ERR_BAD_RESPONSE, this, null, this.response) : u;
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
return t;
|
|
2004
|
+
}],
|
|
2005
|
+
/**
|
|
2006
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2007
|
+
* timeout is not created.
|
|
2008
|
+
*/
|
|
2009
|
+
timeout: 0,
|
|
2010
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2011
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2012
|
+
maxContentLength: -1,
|
|
2013
|
+
maxBodyLength: -1,
|
|
2014
|
+
env: {
|
|
2015
|
+
FormData: te.classes.FormData,
|
|
2016
|
+
Blob: te.classes.Blob
|
|
2017
|
+
},
|
|
2018
|
+
validateStatus: function(t) {
|
|
2019
|
+
return t >= 200 && t < 300;
|
|
2020
|
+
},
|
|
2021
|
+
headers: {
|
|
2022
|
+
common: {
|
|
2023
|
+
Accept: "application/json, text/plain, */*",
|
|
2024
|
+
"Content-Type": void 0
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
};
|
|
2028
|
+
y.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
2029
|
+
Lt.headers[e] = {};
|
|
2030
|
+
});
|
|
2031
|
+
var jt = Lt;
|
|
2032
|
+
const mi = y.toObjectSet([
|
|
2033
|
+
"age",
|
|
2034
|
+
"authorization",
|
|
2035
|
+
"content-length",
|
|
2036
|
+
"content-type",
|
|
2037
|
+
"etag",
|
|
2038
|
+
"expires",
|
|
2039
|
+
"from",
|
|
2040
|
+
"host",
|
|
2041
|
+
"if-modified-since",
|
|
2042
|
+
"if-unmodified-since",
|
|
2043
|
+
"last-modified",
|
|
2044
|
+
"location",
|
|
2045
|
+
"max-forwards",
|
|
2046
|
+
"proxy-authorization",
|
|
2047
|
+
"referer",
|
|
2048
|
+
"retry-after",
|
|
2049
|
+
"user-agent"
|
|
2050
|
+
]);
|
|
2051
|
+
var yi = (e) => {
|
|
2052
|
+
const t = {};
|
|
2053
|
+
let i, o, c;
|
|
2054
|
+
return e && e.split(`
|
|
2055
|
+
`).forEach(function(f) {
|
|
2056
|
+
c = f.indexOf(":"), i = f.substring(0, c).trim().toLowerCase(), o = f.substring(c + 1).trim(), !(!i || t[i] && mi[i]) && (i === "set-cookie" ? t[i] ? t[i].push(o) : t[i] = [o] : t[i] = t[i] ? t[i] + ", " + o : o);
|
|
2057
|
+
}), t;
|
|
2058
|
+
};
|
|
2059
|
+
const tr = Symbol("internals");
|
|
2060
|
+
function Oe(e) {
|
|
2061
|
+
return e && String(e).trim().toLowerCase();
|
|
2062
|
+
}
|
|
2063
|
+
function qe(e) {
|
|
2064
|
+
return e === !1 || e == null ? e : y.isArray(e) ? e.map(qe) : String(e);
|
|
2065
|
+
}
|
|
2066
|
+
function Ei(e) {
|
|
2067
|
+
const t = /* @__PURE__ */ Object.create(null), i = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
2068
|
+
let o;
|
|
2069
|
+
for (; o = i.exec(e); )
|
|
2070
|
+
t[o[1]] = o[2];
|
|
2071
|
+
return t;
|
|
2072
|
+
}
|
|
2073
|
+
const wi = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
2074
|
+
function ht(e, t, i, o, c) {
|
|
2075
|
+
if (y.isFunction(o))
|
|
2076
|
+
return o.call(this, t, i);
|
|
2077
|
+
if (c && (t = i), !!y.isString(t)) {
|
|
2078
|
+
if (y.isString(o))
|
|
2079
|
+
return t.indexOf(o) !== -1;
|
|
2080
|
+
if (y.isRegExp(o))
|
|
2081
|
+
return o.test(t);
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
function bi(e) {
|
|
2085
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, i, o) => i.toUpperCase() + o);
|
|
2086
|
+
}
|
|
2087
|
+
function xi(e, t) {
|
|
2088
|
+
const i = y.toCamelCase(" " + t);
|
|
2089
|
+
["get", "set", "has"].forEach((o) => {
|
|
2090
|
+
Object.defineProperty(e, o + i, {
|
|
2091
|
+
value: function(c, l, f) {
|
|
2092
|
+
return this[o].call(this, t, c, l, f);
|
|
2093
|
+
},
|
|
2094
|
+
configurable: !0
|
|
2095
|
+
});
|
|
2096
|
+
});
|
|
2097
|
+
}
|
|
2098
|
+
class et {
|
|
2099
|
+
constructor(t) {
|
|
2100
|
+
t && this.set(t);
|
|
2101
|
+
}
|
|
2102
|
+
set(t, i, o) {
|
|
2103
|
+
const c = this;
|
|
2104
|
+
function l(u, E, g) {
|
|
2105
|
+
const w = Oe(E);
|
|
2106
|
+
if (!w)
|
|
2107
|
+
throw new Error("header name must be a non-empty string");
|
|
2108
|
+
const d = y.findKey(c, w);
|
|
2109
|
+
(!d || c[d] === void 0 || g === !0 || g === void 0 && c[d] !== !1) && (c[d || E] = qe(u));
|
|
2110
|
+
}
|
|
2111
|
+
const f = (u, E) => y.forEach(u, (g, w) => l(g, w, E));
|
|
2112
|
+
return y.isPlainObject(t) || t instanceof this.constructor ? f(t, i) : y.isString(t) && (t = t.trim()) && !wi(t) ? f(yi(t), i) : t != null && l(i, t, o), this;
|
|
2113
|
+
}
|
|
2114
|
+
get(t, i) {
|
|
2115
|
+
if (t = Oe(t), t) {
|
|
2116
|
+
const o = y.findKey(this, t);
|
|
2117
|
+
if (o) {
|
|
2118
|
+
const c = this[o];
|
|
2119
|
+
if (!i)
|
|
2120
|
+
return c;
|
|
2121
|
+
if (i === !0)
|
|
2122
|
+
return Ei(c);
|
|
2123
|
+
if (y.isFunction(i))
|
|
2124
|
+
return i.call(this, c, o);
|
|
2125
|
+
if (y.isRegExp(i))
|
|
2126
|
+
return i.exec(c);
|
|
2127
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
has(t, i) {
|
|
2132
|
+
if (t = Oe(t), t) {
|
|
2133
|
+
const o = y.findKey(this, t);
|
|
2134
|
+
return !!(o && this[o] !== void 0 && (!i || ht(this, this[o], o, i)));
|
|
2135
|
+
}
|
|
2136
|
+
return !1;
|
|
2137
|
+
}
|
|
2138
|
+
delete(t, i) {
|
|
2139
|
+
const o = this;
|
|
2140
|
+
let c = !1;
|
|
2141
|
+
function l(f) {
|
|
2142
|
+
if (f = Oe(f), f) {
|
|
2143
|
+
const u = y.findKey(o, f);
|
|
2144
|
+
u && (!i || ht(o, o[u], u, i)) && (delete o[u], c = !0);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
return y.isArray(t) ? t.forEach(l) : l(t), c;
|
|
2148
|
+
}
|
|
2149
|
+
clear(t) {
|
|
2150
|
+
const i = Object.keys(this);
|
|
2151
|
+
let o = i.length, c = !1;
|
|
2152
|
+
for (; o--; ) {
|
|
2153
|
+
const l = i[o];
|
|
2154
|
+
(!t || ht(this, this[l], l, t, !0)) && (delete this[l], c = !0);
|
|
2155
|
+
}
|
|
2156
|
+
return c;
|
|
2157
|
+
}
|
|
2158
|
+
normalize(t) {
|
|
2159
|
+
const i = this, o = {};
|
|
2160
|
+
return y.forEach(this, (c, l) => {
|
|
2161
|
+
const f = y.findKey(o, l);
|
|
2162
|
+
if (f) {
|
|
2163
|
+
i[f] = qe(c), delete i[l];
|
|
2164
|
+
return;
|
|
2165
|
+
}
|
|
2166
|
+
const u = t ? bi(l) : String(l).trim();
|
|
2167
|
+
u !== l && delete i[l], i[u] = qe(c), o[u] = !0;
|
|
2168
|
+
}), this;
|
|
2169
|
+
}
|
|
2170
|
+
concat(...t) {
|
|
2171
|
+
return this.constructor.concat(this, ...t);
|
|
2172
|
+
}
|
|
2173
|
+
toJSON(t) {
|
|
2174
|
+
const i = /* @__PURE__ */ Object.create(null);
|
|
2175
|
+
return y.forEach(this, (o, c) => {
|
|
2176
|
+
o != null && o !== !1 && (i[c] = t && y.isArray(o) ? o.join(", ") : o);
|
|
2177
|
+
}), i;
|
|
2178
|
+
}
|
|
2179
|
+
[Symbol.iterator]() {
|
|
2180
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
2181
|
+
}
|
|
2182
|
+
toString() {
|
|
2183
|
+
return Object.entries(this.toJSON()).map(([t, i]) => t + ": " + i).join(`
|
|
2184
|
+
`);
|
|
2185
|
+
}
|
|
2186
|
+
get [Symbol.toStringTag]() {
|
|
2187
|
+
return "AxiosHeaders";
|
|
2188
|
+
}
|
|
2189
|
+
static from(t) {
|
|
2190
|
+
return t instanceof this ? t : new this(t);
|
|
2191
|
+
}
|
|
2192
|
+
static concat(t, ...i) {
|
|
2193
|
+
const o = new this(t);
|
|
2194
|
+
return i.forEach((c) => o.set(c)), o;
|
|
2195
|
+
}
|
|
2196
|
+
static accessor(t) {
|
|
2197
|
+
const o = (this[tr] = this[tr] = {
|
|
2198
|
+
accessors: {}
|
|
2199
|
+
}).accessors, c = this.prototype;
|
|
2200
|
+
function l(f) {
|
|
2201
|
+
const u = Oe(f);
|
|
2202
|
+
o[u] || (xi(c, f), o[u] = !0);
|
|
2203
|
+
}
|
|
2204
|
+
return y.isArray(t) ? t.forEach(l) : l(t), this;
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
et.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
2208
|
+
y.reduceDescriptors(et.prototype, ({ value: e }, t) => {
|
|
2209
|
+
let i = t[0].toUpperCase() + t.slice(1);
|
|
2210
|
+
return {
|
|
2211
|
+
get: () => e,
|
|
2212
|
+
set(o) {
|
|
2213
|
+
this[i] = o;
|
|
2214
|
+
}
|
|
2215
|
+
};
|
|
2216
|
+
});
|
|
2217
|
+
y.freezeMethods(et);
|
|
2218
|
+
var se = et;
|
|
2219
|
+
function dt(e, t) {
|
|
2220
|
+
const i = this || jt, o = t || i, c = se.from(o.headers);
|
|
2221
|
+
let l = o.data;
|
|
2222
|
+
return y.forEach(e, function(u) {
|
|
2223
|
+
l = u.call(i, l, c.normalize(), t ? t.status : void 0);
|
|
2224
|
+
}), c.normalize(), l;
|
|
2225
|
+
}
|
|
2226
|
+
function Lr(e) {
|
|
2227
|
+
return !!(e && e.__CANCEL__);
|
|
2228
|
+
}
|
|
2229
|
+
function Ne(e, t, i) {
|
|
2230
|
+
P.call(this, e ?? "canceled", P.ERR_CANCELED, t, i), this.name = "CanceledError";
|
|
2231
|
+
}
|
|
2232
|
+
y.inherits(Ne, P, {
|
|
2233
|
+
__CANCEL__: !0
|
|
2234
|
+
});
|
|
2235
|
+
function gi(e, t, i) {
|
|
2236
|
+
const o = i.config.validateStatus;
|
|
2237
|
+
!i.status || !o || o(i.status) ? e(i) : t(new P(
|
|
2238
|
+
"Request failed with status code " + i.status,
|
|
2239
|
+
[P.ERR_BAD_REQUEST, P.ERR_BAD_RESPONSE][Math.floor(i.status / 100) - 4],
|
|
2240
|
+
i.config,
|
|
2241
|
+
i.request,
|
|
2242
|
+
i
|
|
2243
|
+
));
|
|
2244
|
+
}
|
|
2245
|
+
var _i = te.hasStandardBrowserEnv ? (
|
|
2246
|
+
// Standard browser envs support document.cookie
|
|
2247
|
+
{
|
|
2248
|
+
write(e, t, i, o, c, l) {
|
|
2249
|
+
const f = [e + "=" + encodeURIComponent(t)];
|
|
2250
|
+
y.isNumber(i) && f.push("expires=" + new Date(i).toGMTString()), y.isString(o) && f.push("path=" + o), y.isString(c) && f.push("domain=" + c), l === !0 && f.push("secure"), document.cookie = f.join("; ");
|
|
2251
|
+
},
|
|
2252
|
+
read(e) {
|
|
2253
|
+
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
|
|
2254
|
+
return t ? decodeURIComponent(t[3]) : null;
|
|
2255
|
+
},
|
|
2256
|
+
remove(e) {
|
|
2257
|
+
this.write(e, "", Date.now() - 864e5);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
) : (
|
|
2261
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
2262
|
+
{
|
|
2263
|
+
write() {
|
|
2264
|
+
},
|
|
2265
|
+
read() {
|
|
2266
|
+
return null;
|
|
2267
|
+
},
|
|
2268
|
+
remove() {
|
|
2269
|
+
}
|
|
2270
|
+
}
|
|
2271
|
+
);
|
|
2272
|
+
function Ci(e) {
|
|
2273
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
2274
|
+
}
|
|
2275
|
+
function Fi(e, t) {
|
|
2276
|
+
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
2277
|
+
}
|
|
2278
|
+
function jr(e, t) {
|
|
2279
|
+
return e && !Ci(t) ? Fi(e, t) : t;
|
|
2280
|
+
}
|
|
2281
|
+
var Ai = te.hasStandardBrowserEnv ? (
|
|
2282
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
2283
|
+
// whether the request URL is of the same origin as current location.
|
|
2284
|
+
function() {
|
|
2285
|
+
const t = /(msie|trident)/i.test(navigator.userAgent), i = document.createElement("a");
|
|
2286
|
+
let o;
|
|
2287
|
+
function c(l) {
|
|
2288
|
+
let f = l;
|
|
2289
|
+
return t && (i.setAttribute("href", f), f = i.href), i.setAttribute("href", f), {
|
|
2290
|
+
href: i.href,
|
|
2291
|
+
protocol: i.protocol ? i.protocol.replace(/:$/, "") : "",
|
|
2292
|
+
host: i.host,
|
|
2293
|
+
search: i.search ? i.search.replace(/^\?/, "") : "",
|
|
2294
|
+
hash: i.hash ? i.hash.replace(/^#/, "") : "",
|
|
2295
|
+
hostname: i.hostname,
|
|
2296
|
+
port: i.port,
|
|
2297
|
+
pathname: i.pathname.charAt(0) === "/" ? i.pathname : "/" + i.pathname
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
return o = c(window.location.href), function(f) {
|
|
2301
|
+
const u = y.isString(f) ? c(f) : f;
|
|
2302
|
+
return u.protocol === o.protocol && u.host === o.host;
|
|
2303
|
+
};
|
|
2304
|
+
}()
|
|
2305
|
+
) : (
|
|
2306
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
2307
|
+
function() {
|
|
2308
|
+
return function() {
|
|
2309
|
+
return !0;
|
|
2310
|
+
};
|
|
2311
|
+
}()
|
|
2312
|
+
);
|
|
2313
|
+
function Bi(e) {
|
|
2314
|
+
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
2315
|
+
return t && t[1] || "";
|
|
2316
|
+
}
|
|
2317
|
+
function Ri(e, t) {
|
|
2318
|
+
e = e || 10;
|
|
2319
|
+
const i = new Array(e), o = new Array(e);
|
|
2320
|
+
let c = 0, l = 0, f;
|
|
2321
|
+
return t = t !== void 0 ? t : 1e3, function(E) {
|
|
2322
|
+
const g = Date.now(), w = o[l];
|
|
2323
|
+
f || (f = g), i[c] = E, o[c] = g;
|
|
2324
|
+
let d = l, B = 0;
|
|
2325
|
+
for (; d !== c; )
|
|
2326
|
+
B += i[d++], d = d % e;
|
|
2327
|
+
if (c = (c + 1) % e, c === l && (l = (l + 1) % e), g - f < t)
|
|
2328
|
+
return;
|
|
2329
|
+
const S = w && g - w;
|
|
2330
|
+
return S ? Math.round(B * 1e3 / S) : void 0;
|
|
2331
|
+
};
|
|
2332
|
+
}
|
|
2333
|
+
function rr(e, t) {
|
|
2334
|
+
let i = 0;
|
|
2335
|
+
const o = Ri(50, 250);
|
|
2336
|
+
return (c) => {
|
|
2337
|
+
const l = c.loaded, f = c.lengthComputable ? c.total : void 0, u = l - i, E = o(u), g = l <= f;
|
|
2338
|
+
i = l;
|
|
2339
|
+
const w = {
|
|
2340
|
+
loaded: l,
|
|
2341
|
+
total: f,
|
|
2342
|
+
progress: f ? l / f : void 0,
|
|
2343
|
+
bytes: u,
|
|
2344
|
+
rate: E || void 0,
|
|
2345
|
+
estimated: E && f && g ? (f - l) / E : void 0,
|
|
2346
|
+
event: c
|
|
2347
|
+
};
|
|
2348
|
+
w[t ? "download" : "upload"] = !0, e(w);
|
|
2349
|
+
};
|
|
2350
|
+
}
|
|
2351
|
+
const Ti = typeof XMLHttpRequest < "u";
|
|
2352
|
+
var Si = Ti && function(e) {
|
|
2353
|
+
return new Promise(function(i, o) {
|
|
2354
|
+
let c = e.data;
|
|
2355
|
+
const l = se.from(e.headers).normalize();
|
|
2356
|
+
let { responseType: f, withXSRFToken: u } = e, E;
|
|
2357
|
+
function g() {
|
|
2358
|
+
e.cancelToken && e.cancelToken.unsubscribe(E), e.signal && e.signal.removeEventListener("abort", E);
|
|
2359
|
+
}
|
|
2360
|
+
let w;
|
|
2361
|
+
if (y.isFormData(c)) {
|
|
2362
|
+
if (te.hasStandardBrowserEnv || te.hasStandardBrowserWebWorkerEnv)
|
|
2363
|
+
l.setContentType(!1);
|
|
2364
|
+
else if ((w = l.getContentType()) !== !1) {
|
|
2365
|
+
const [A, ...D] = w ? w.split(";").map((N) => N.trim()).filter(Boolean) : [];
|
|
2366
|
+
l.setContentType([A || "multipart/form-data", ...D].join("; "));
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
let d = new XMLHttpRequest();
|
|
2370
|
+
if (e.auth) {
|
|
2371
|
+
const A = e.auth.username || "", D = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : "";
|
|
2372
|
+
l.set("Authorization", "Basic " + btoa(A + ":" + D));
|
|
2373
|
+
}
|
|
2374
|
+
const B = jr(e.baseURL, e.url);
|
|
2375
|
+
d.open(e.method.toUpperCase(), vr(B, e.params, e.paramsSerializer), !0), d.timeout = e.timeout;
|
|
2376
|
+
function S() {
|
|
2377
|
+
if (!d)
|
|
2378
|
+
return;
|
|
2379
|
+
const A = se.from(
|
|
2380
|
+
"getAllResponseHeaders" in d && d.getAllResponseHeaders()
|
|
2381
|
+
), N = {
|
|
2382
|
+
data: !f || f === "text" || f === "json" ? d.responseText : d.response,
|
|
2383
|
+
status: d.status,
|
|
2384
|
+
statusText: d.statusText,
|
|
2385
|
+
headers: A,
|
|
2386
|
+
config: e,
|
|
2387
|
+
request: d
|
|
2388
|
+
};
|
|
2389
|
+
gi(function(L) {
|
|
2390
|
+
i(L), g();
|
|
2391
|
+
}, function(L) {
|
|
2392
|
+
o(L), g();
|
|
2393
|
+
}, N), d = null;
|
|
2394
|
+
}
|
|
2395
|
+
if ("onloadend" in d ? d.onloadend = S : d.onreadystatechange = function() {
|
|
2396
|
+
!d || d.readyState !== 4 || d.status === 0 && !(d.responseURL && d.responseURL.indexOf("file:") === 0) || setTimeout(S);
|
|
2397
|
+
}, d.onabort = function() {
|
|
2398
|
+
d && (o(new P("Request aborted", P.ECONNABORTED, e, d)), d = null);
|
|
2399
|
+
}, d.onerror = function() {
|
|
2400
|
+
o(new P("Network Error", P.ERR_NETWORK, e, d)), d = null;
|
|
2401
|
+
}, d.ontimeout = function() {
|
|
2402
|
+
let D = e.timeout ? "timeout of " + e.timeout + "ms exceeded" : "timeout exceeded";
|
|
2403
|
+
const N = e.transitional || Nr;
|
|
2404
|
+
e.timeoutErrorMessage && (D = e.timeoutErrorMessage), o(new P(
|
|
2405
|
+
D,
|
|
2406
|
+
N.clarifyTimeoutError ? P.ETIMEDOUT : P.ECONNABORTED,
|
|
2407
|
+
e,
|
|
2408
|
+
d
|
|
2409
|
+
)), d = null;
|
|
2410
|
+
}, te.hasStandardBrowserEnv && (u && y.isFunction(u) && (u = u(e)), u || u !== !1 && Ai(B))) {
|
|
2411
|
+
const A = e.xsrfHeaderName && e.xsrfCookieName && _i.read(e.xsrfCookieName);
|
|
2412
|
+
A && l.set(e.xsrfHeaderName, A);
|
|
2413
|
+
}
|
|
2414
|
+
c === void 0 && l.setContentType(null), "setRequestHeader" in d && y.forEach(l.toJSON(), function(D, N) {
|
|
2415
|
+
d.setRequestHeader(N, D);
|
|
2416
|
+
}), y.isUndefined(e.withCredentials) || (d.withCredentials = !!e.withCredentials), f && f !== "json" && (d.responseType = e.responseType), typeof e.onDownloadProgress == "function" && d.addEventListener("progress", rr(e.onDownloadProgress, !0)), typeof e.onUploadProgress == "function" && d.upload && d.upload.addEventListener("progress", rr(e.onUploadProgress)), (e.cancelToken || e.signal) && (E = (A) => {
|
|
2417
|
+
d && (o(!A || A.type ? new Ne(null, e, d) : A), d.abort(), d = null);
|
|
2418
|
+
}, e.cancelToken && e.cancelToken.subscribe(E), e.signal && (e.signal.aborted ? E() : e.signal.addEventListener("abort", E)));
|
|
2419
|
+
const C = Bi(B);
|
|
2420
|
+
if (C && te.protocols.indexOf(C) === -1) {
|
|
2421
|
+
o(new P("Unsupported protocol " + C + ":", P.ERR_BAD_REQUEST, e));
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2424
|
+
d.send(c || null);
|
|
2425
|
+
});
|
|
2426
|
+
};
|
|
2427
|
+
const St = {
|
|
2428
|
+
http: Qn,
|
|
2429
|
+
xhr: Si
|
|
2430
|
+
};
|
|
2431
|
+
y.forEach(St, (e, t) => {
|
|
2432
|
+
if (e) {
|
|
2433
|
+
try {
|
|
2434
|
+
Object.defineProperty(e, "name", { value: t });
|
|
2435
|
+
} catch {
|
|
2436
|
+
}
|
|
2437
|
+
Object.defineProperty(e, "adapterName", { value: t });
|
|
2438
|
+
}
|
|
2439
|
+
});
|
|
2440
|
+
const nr = (e) => `- ${e}`, Di = (e) => y.isFunction(e) || e === null || e === !1;
|
|
2441
|
+
var Mr = {
|
|
2442
|
+
getAdapter: (e) => {
|
|
2443
|
+
e = y.isArray(e) ? e : [e];
|
|
2444
|
+
const { length: t } = e;
|
|
2445
|
+
let i, o;
|
|
2446
|
+
const c = {};
|
|
2447
|
+
for (let l = 0; l < t; l++) {
|
|
2448
|
+
i = e[l];
|
|
2449
|
+
let f;
|
|
2450
|
+
if (o = i, !Di(i) && (o = St[(f = String(i)).toLowerCase()], o === void 0))
|
|
2451
|
+
throw new P(`Unknown adapter '${f}'`);
|
|
2452
|
+
if (o)
|
|
2453
|
+
break;
|
|
2454
|
+
c[f || "#" + l] = o;
|
|
2455
|
+
}
|
|
2456
|
+
if (!o) {
|
|
2457
|
+
const l = Object.entries(c).map(
|
|
2458
|
+
([u, E]) => `adapter ${u} ` + (E === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
2459
|
+
);
|
|
2460
|
+
let f = t ? l.length > 1 ? `since :
|
|
2461
|
+
` + l.map(nr).join(`
|
|
2462
|
+
`) : " " + nr(l[0]) : "as no adapter specified";
|
|
2463
|
+
throw new P(
|
|
2464
|
+
"There is no suitable adapter to dispatch the request " + f,
|
|
2465
|
+
"ERR_NOT_SUPPORT"
|
|
2466
|
+
);
|
|
2467
|
+
}
|
|
2468
|
+
return o;
|
|
2469
|
+
},
|
|
2470
|
+
adapters: St
|
|
2471
|
+
};
|
|
2472
|
+
function mt(e) {
|
|
2473
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
2474
|
+
throw new Ne(null, e);
|
|
2475
|
+
}
|
|
2476
|
+
function ir(e) {
|
|
2477
|
+
return mt(e), e.headers = se.from(e.headers), e.data = dt.call(
|
|
2478
|
+
e,
|
|
2479
|
+
e.transformRequest
|
|
2480
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Mr.getAdapter(e.adapter || jt.adapter)(e).then(function(o) {
|
|
2481
|
+
return mt(e), o.data = dt.call(
|
|
2482
|
+
e,
|
|
2483
|
+
e.transformResponse,
|
|
2484
|
+
o
|
|
2485
|
+
), o.headers = se.from(o.headers), o;
|
|
2486
|
+
}, function(o) {
|
|
2487
|
+
return Lr(o) || (mt(e), o && o.response && (o.response.data = dt.call(
|
|
2488
|
+
e,
|
|
2489
|
+
e.transformResponse,
|
|
2490
|
+
o.response
|
|
2491
|
+
), o.response.headers = se.from(o.response.headers))), Promise.reject(o);
|
|
2492
|
+
});
|
|
2493
|
+
}
|
|
2494
|
+
const or = (e) => e instanceof se ? e.toJSON() : e;
|
|
2495
|
+
function _e(e, t) {
|
|
2496
|
+
t = t || {};
|
|
2497
|
+
const i = {};
|
|
2498
|
+
function o(g, w, d) {
|
|
2499
|
+
return y.isPlainObject(g) && y.isPlainObject(w) ? y.merge.call({ caseless: d }, g, w) : y.isPlainObject(w) ? y.merge({}, w) : y.isArray(w) ? w.slice() : w;
|
|
2500
|
+
}
|
|
2501
|
+
function c(g, w, d) {
|
|
2502
|
+
if (y.isUndefined(w)) {
|
|
2503
|
+
if (!y.isUndefined(g))
|
|
2504
|
+
return o(void 0, g, d);
|
|
2505
|
+
} else
|
|
2506
|
+
return o(g, w, d);
|
|
2507
|
+
}
|
|
2508
|
+
function l(g, w) {
|
|
2509
|
+
if (!y.isUndefined(w))
|
|
2510
|
+
return o(void 0, w);
|
|
2511
|
+
}
|
|
2512
|
+
function f(g, w) {
|
|
2513
|
+
if (y.isUndefined(w)) {
|
|
2514
|
+
if (!y.isUndefined(g))
|
|
2515
|
+
return o(void 0, g);
|
|
2516
|
+
} else
|
|
2517
|
+
return o(void 0, w);
|
|
2518
|
+
}
|
|
2519
|
+
function u(g, w, d) {
|
|
2520
|
+
if (d in t)
|
|
2521
|
+
return o(g, w);
|
|
2522
|
+
if (d in e)
|
|
2523
|
+
return o(void 0, g);
|
|
2524
|
+
}
|
|
2525
|
+
const E = {
|
|
2526
|
+
url: l,
|
|
2527
|
+
method: l,
|
|
2528
|
+
data: l,
|
|
2529
|
+
baseURL: f,
|
|
2530
|
+
transformRequest: f,
|
|
2531
|
+
transformResponse: f,
|
|
2532
|
+
paramsSerializer: f,
|
|
2533
|
+
timeout: f,
|
|
2534
|
+
timeoutMessage: f,
|
|
2535
|
+
withCredentials: f,
|
|
2536
|
+
withXSRFToken: f,
|
|
2537
|
+
adapter: f,
|
|
2538
|
+
responseType: f,
|
|
2539
|
+
xsrfCookieName: f,
|
|
2540
|
+
xsrfHeaderName: f,
|
|
2541
|
+
onUploadProgress: f,
|
|
2542
|
+
onDownloadProgress: f,
|
|
2543
|
+
decompress: f,
|
|
2544
|
+
maxContentLength: f,
|
|
2545
|
+
maxBodyLength: f,
|
|
2546
|
+
beforeRedirect: f,
|
|
2547
|
+
transport: f,
|
|
2548
|
+
httpAgent: f,
|
|
2549
|
+
httpsAgent: f,
|
|
2550
|
+
cancelToken: f,
|
|
2551
|
+
socketPath: f,
|
|
2552
|
+
responseEncoding: f,
|
|
2553
|
+
validateStatus: u,
|
|
2554
|
+
headers: (g, w) => c(or(g), or(w), !0)
|
|
2555
|
+
};
|
|
2556
|
+
return y.forEach(Object.keys(Object.assign({}, e, t)), function(w) {
|
|
2557
|
+
const d = E[w] || c, B = d(e[w], t[w], w);
|
|
2558
|
+
y.isUndefined(B) && d !== u || (i[w] = B);
|
|
2559
|
+
}), i;
|
|
2560
|
+
}
|
|
2561
|
+
const qr = "1.6.7", Mt = {};
|
|
2562
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
2563
|
+
Mt[e] = function(o) {
|
|
2564
|
+
return typeof o === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
2565
|
+
};
|
|
2566
|
+
});
|
|
2567
|
+
const sr = {};
|
|
2568
|
+
Mt.transitional = function(t, i, o) {
|
|
2569
|
+
function c(l, f) {
|
|
2570
|
+
return "[Axios v" + qr + "] Transitional option '" + l + "'" + f + (o ? ". " + o : "");
|
|
2571
|
+
}
|
|
2572
|
+
return (l, f, u) => {
|
|
2573
|
+
if (t === !1)
|
|
2574
|
+
throw new P(
|
|
2575
|
+
c(f, " has been removed" + (i ? " in " + i : "")),
|
|
2576
|
+
P.ERR_DEPRECATED
|
|
2577
|
+
);
|
|
2578
|
+
return i && !sr[f] && (sr[f] = !0, console.warn(
|
|
2579
|
+
c(
|
|
2580
|
+
f,
|
|
2581
|
+
" has been deprecated since v" + i + " and will be removed in the near future"
|
|
2582
|
+
)
|
|
2583
|
+
)), t ? t(l, f, u) : !0;
|
|
2584
|
+
};
|
|
2585
|
+
};
|
|
2586
|
+
function Oi(e, t, i) {
|
|
2587
|
+
if (typeof e != "object")
|
|
2588
|
+
throw new P("options must be an object", P.ERR_BAD_OPTION_VALUE);
|
|
2589
|
+
const o = Object.keys(e);
|
|
2590
|
+
let c = o.length;
|
|
2591
|
+
for (; c-- > 0; ) {
|
|
2592
|
+
const l = o[c], f = t[l];
|
|
2593
|
+
if (f) {
|
|
2594
|
+
const u = e[l], E = u === void 0 || f(u, l, e);
|
|
2595
|
+
if (E !== !0)
|
|
2596
|
+
throw new P("option " + l + " must be " + E, P.ERR_BAD_OPTION_VALUE);
|
|
2597
|
+
continue;
|
|
2598
|
+
}
|
|
2599
|
+
if (i !== !0)
|
|
2600
|
+
throw new P("Unknown option " + l, P.ERR_BAD_OPTION);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
var Dt = {
|
|
2604
|
+
assertOptions: Oi,
|
|
2605
|
+
validators: Mt
|
|
2606
|
+
};
|
|
2607
|
+
const ue = Dt.validators;
|
|
2608
|
+
class We {
|
|
2609
|
+
constructor(t) {
|
|
2610
|
+
this.defaults = t, this.interceptors = {
|
|
2611
|
+
request: new er(),
|
|
2612
|
+
response: new er()
|
|
2613
|
+
};
|
|
2614
|
+
}
|
|
2615
|
+
/**
|
|
2616
|
+
* Dispatch a request
|
|
2617
|
+
*
|
|
2618
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
2619
|
+
* @param {?Object} config
|
|
2620
|
+
*
|
|
2621
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
2622
|
+
*/
|
|
2623
|
+
async request(t, i) {
|
|
2624
|
+
try {
|
|
2625
|
+
return await this._request(t, i);
|
|
2626
|
+
} catch (o) {
|
|
2627
|
+
if (o instanceof Error) {
|
|
2628
|
+
let c;
|
|
2629
|
+
Error.captureStackTrace ? Error.captureStackTrace(c = {}) : c = new Error();
|
|
2630
|
+
const l = c.stack ? c.stack.replace(/^.+\n/, "") : "";
|
|
2631
|
+
o.stack ? l && !String(o.stack).endsWith(l.replace(/^.+\n.+\n/, "")) && (o.stack += `
|
|
2632
|
+
` + l) : o.stack = l;
|
|
2633
|
+
}
|
|
2634
|
+
throw o;
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
_request(t, i) {
|
|
2638
|
+
typeof t == "string" ? (i = i || {}, i.url = t) : i = t || {}, i = _e(this.defaults, i);
|
|
2639
|
+
const { transitional: o, paramsSerializer: c, headers: l } = i;
|
|
2640
|
+
o !== void 0 && Dt.assertOptions(o, {
|
|
2641
|
+
silentJSONParsing: ue.transitional(ue.boolean),
|
|
2642
|
+
forcedJSONParsing: ue.transitional(ue.boolean),
|
|
2643
|
+
clarifyTimeoutError: ue.transitional(ue.boolean)
|
|
2644
|
+
}, !1), c != null && (y.isFunction(c) ? i.paramsSerializer = {
|
|
2645
|
+
serialize: c
|
|
2646
|
+
} : Dt.assertOptions(c, {
|
|
2647
|
+
encode: ue.function,
|
|
2648
|
+
serialize: ue.function
|
|
2649
|
+
}, !0)), i.method = (i.method || this.defaults.method || "get").toLowerCase();
|
|
2650
|
+
let f = l && y.merge(
|
|
2651
|
+
l.common,
|
|
2652
|
+
l[i.method]
|
|
2653
|
+
);
|
|
2654
|
+
l && y.forEach(
|
|
2655
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2656
|
+
(C) => {
|
|
2657
|
+
delete l[C];
|
|
2658
|
+
}
|
|
2659
|
+
), i.headers = se.concat(f, l);
|
|
2660
|
+
const u = [];
|
|
2661
|
+
let E = !0;
|
|
2662
|
+
this.interceptors.request.forEach(function(A) {
|
|
2663
|
+
typeof A.runWhen == "function" && A.runWhen(i) === !1 || (E = E && A.synchronous, u.unshift(A.fulfilled, A.rejected));
|
|
2664
|
+
});
|
|
2665
|
+
const g = [];
|
|
2666
|
+
this.interceptors.response.forEach(function(A) {
|
|
2667
|
+
g.push(A.fulfilled, A.rejected);
|
|
2668
|
+
});
|
|
2669
|
+
let w, d = 0, B;
|
|
2670
|
+
if (!E) {
|
|
2671
|
+
const C = [ir.bind(this), void 0];
|
|
2672
|
+
for (C.unshift.apply(C, u), C.push.apply(C, g), B = C.length, w = Promise.resolve(i); d < B; )
|
|
2673
|
+
w = w.then(C[d++], C[d++]);
|
|
2674
|
+
return w;
|
|
2675
|
+
}
|
|
2676
|
+
B = u.length;
|
|
2677
|
+
let S = i;
|
|
2678
|
+
for (d = 0; d < B; ) {
|
|
2679
|
+
const C = u[d++], A = u[d++];
|
|
2680
|
+
try {
|
|
2681
|
+
S = C(S);
|
|
2682
|
+
} catch (D) {
|
|
2683
|
+
A.call(this, D);
|
|
2684
|
+
break;
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
try {
|
|
2688
|
+
w = ir.call(this, S);
|
|
2689
|
+
} catch (C) {
|
|
2690
|
+
return Promise.reject(C);
|
|
2691
|
+
}
|
|
2692
|
+
for (d = 0, B = g.length; d < B; )
|
|
2693
|
+
w = w.then(g[d++], g[d++]);
|
|
2694
|
+
return w;
|
|
2695
|
+
}
|
|
2696
|
+
getUri(t) {
|
|
2697
|
+
t = _e(this.defaults, t);
|
|
2698
|
+
const i = jr(t.baseURL, t.url);
|
|
2699
|
+
return vr(i, t.params, t.paramsSerializer);
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
y.forEach(["delete", "get", "head", "options"], function(t) {
|
|
2703
|
+
We.prototype[t] = function(i, o) {
|
|
2704
|
+
return this.request(_e(o || {}, {
|
|
2705
|
+
method: t,
|
|
2706
|
+
url: i,
|
|
2707
|
+
data: (o || {}).data
|
|
2708
|
+
}));
|
|
2709
|
+
};
|
|
2710
|
+
});
|
|
2711
|
+
y.forEach(["post", "put", "patch"], function(t) {
|
|
2712
|
+
function i(o) {
|
|
2713
|
+
return function(l, f, u) {
|
|
2714
|
+
return this.request(_e(u || {}, {
|
|
2715
|
+
method: t,
|
|
2716
|
+
headers: o ? {
|
|
2717
|
+
"Content-Type": "multipart/form-data"
|
|
2718
|
+
} : {},
|
|
2719
|
+
url: l,
|
|
2720
|
+
data: f
|
|
2721
|
+
}));
|
|
2722
|
+
};
|
|
2723
|
+
}
|
|
2724
|
+
We.prototype[t] = i(), We.prototype[t + "Form"] = i(!0);
|
|
2725
|
+
});
|
|
2726
|
+
var $e = We;
|
|
2727
|
+
class qt {
|
|
2728
|
+
constructor(t) {
|
|
2729
|
+
if (typeof t != "function")
|
|
2730
|
+
throw new TypeError("executor must be a function.");
|
|
2731
|
+
let i;
|
|
2732
|
+
this.promise = new Promise(function(l) {
|
|
2733
|
+
i = l;
|
|
2734
|
+
});
|
|
2735
|
+
const o = this;
|
|
2736
|
+
this.promise.then((c) => {
|
|
2737
|
+
if (!o._listeners)
|
|
2738
|
+
return;
|
|
2739
|
+
let l = o._listeners.length;
|
|
2740
|
+
for (; l-- > 0; )
|
|
2741
|
+
o._listeners[l](c);
|
|
2742
|
+
o._listeners = null;
|
|
2743
|
+
}), this.promise.then = (c) => {
|
|
2744
|
+
let l;
|
|
2745
|
+
const f = new Promise((u) => {
|
|
2746
|
+
o.subscribe(u), l = u;
|
|
2747
|
+
}).then(c);
|
|
2748
|
+
return f.cancel = function() {
|
|
2749
|
+
o.unsubscribe(l);
|
|
2750
|
+
}, f;
|
|
2751
|
+
}, t(function(l, f, u) {
|
|
2752
|
+
o.reason || (o.reason = new Ne(l, f, u), i(o.reason));
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
2757
|
+
*/
|
|
2758
|
+
throwIfRequested() {
|
|
2759
|
+
if (this.reason)
|
|
2760
|
+
throw this.reason;
|
|
2761
|
+
}
|
|
2762
|
+
/**
|
|
2763
|
+
* Subscribe to the cancel signal
|
|
2764
|
+
*/
|
|
2765
|
+
subscribe(t) {
|
|
2766
|
+
if (this.reason) {
|
|
2767
|
+
t(this.reason);
|
|
2768
|
+
return;
|
|
2769
|
+
}
|
|
2770
|
+
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
|
2771
|
+
}
|
|
2772
|
+
/**
|
|
2773
|
+
* Unsubscribe from the cancel signal
|
|
2774
|
+
*/
|
|
2775
|
+
unsubscribe(t) {
|
|
2776
|
+
if (!this._listeners)
|
|
2777
|
+
return;
|
|
2778
|
+
const i = this._listeners.indexOf(t);
|
|
2779
|
+
i !== -1 && this._listeners.splice(i, 1);
|
|
2780
|
+
}
|
|
2781
|
+
/**
|
|
2782
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
2783
|
+
* cancels the `CancelToken`.
|
|
2784
|
+
*/
|
|
2785
|
+
static source() {
|
|
2786
|
+
let t;
|
|
2787
|
+
return {
|
|
2788
|
+
token: new qt(function(c) {
|
|
2789
|
+
t = c;
|
|
2790
|
+
}),
|
|
2791
|
+
cancel: t
|
|
2792
|
+
};
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
var Pi = qt;
|
|
2796
|
+
function Ii(e) {
|
|
2797
|
+
return function(i) {
|
|
2798
|
+
return e.apply(null, i);
|
|
2799
|
+
};
|
|
2800
|
+
}
|
|
2801
|
+
function vi(e) {
|
|
2802
|
+
return y.isObject(e) && e.isAxiosError === !0;
|
|
2803
|
+
}
|
|
2804
|
+
const Ot = {
|
|
2805
|
+
Continue: 100,
|
|
2806
|
+
SwitchingProtocols: 101,
|
|
2807
|
+
Processing: 102,
|
|
2808
|
+
EarlyHints: 103,
|
|
2809
|
+
Ok: 200,
|
|
2810
|
+
Created: 201,
|
|
2811
|
+
Accepted: 202,
|
|
2812
|
+
NonAuthoritativeInformation: 203,
|
|
2813
|
+
NoContent: 204,
|
|
2814
|
+
ResetContent: 205,
|
|
2815
|
+
PartialContent: 206,
|
|
2816
|
+
MultiStatus: 207,
|
|
2817
|
+
AlreadyReported: 208,
|
|
2818
|
+
ImUsed: 226,
|
|
2819
|
+
MultipleChoices: 300,
|
|
2820
|
+
MovedPermanently: 301,
|
|
2821
|
+
Found: 302,
|
|
2822
|
+
SeeOther: 303,
|
|
2823
|
+
NotModified: 304,
|
|
2824
|
+
UseProxy: 305,
|
|
2825
|
+
Unused: 306,
|
|
2826
|
+
TemporaryRedirect: 307,
|
|
2827
|
+
PermanentRedirect: 308,
|
|
2828
|
+
BadRequest: 400,
|
|
2829
|
+
Unauthorized: 401,
|
|
2830
|
+
PaymentRequired: 402,
|
|
2831
|
+
Forbidden: 403,
|
|
2832
|
+
NotFound: 404,
|
|
2833
|
+
MethodNotAllowed: 405,
|
|
2834
|
+
NotAcceptable: 406,
|
|
2835
|
+
ProxyAuthenticationRequired: 407,
|
|
2836
|
+
RequestTimeout: 408,
|
|
2837
|
+
Conflict: 409,
|
|
2838
|
+
Gone: 410,
|
|
2839
|
+
LengthRequired: 411,
|
|
2840
|
+
PreconditionFailed: 412,
|
|
2841
|
+
PayloadTooLarge: 413,
|
|
2842
|
+
UriTooLong: 414,
|
|
2843
|
+
UnsupportedMediaType: 415,
|
|
2844
|
+
RangeNotSatisfiable: 416,
|
|
2845
|
+
ExpectationFailed: 417,
|
|
2846
|
+
ImATeapot: 418,
|
|
2847
|
+
MisdirectedRequest: 421,
|
|
2848
|
+
UnprocessableEntity: 422,
|
|
2849
|
+
Locked: 423,
|
|
2850
|
+
FailedDependency: 424,
|
|
2851
|
+
TooEarly: 425,
|
|
2852
|
+
UpgradeRequired: 426,
|
|
2853
|
+
PreconditionRequired: 428,
|
|
2854
|
+
TooManyRequests: 429,
|
|
2855
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
2856
|
+
UnavailableForLegalReasons: 451,
|
|
2857
|
+
InternalServerError: 500,
|
|
2858
|
+
NotImplemented: 501,
|
|
2859
|
+
BadGateway: 502,
|
|
2860
|
+
ServiceUnavailable: 503,
|
|
2861
|
+
GatewayTimeout: 504,
|
|
2862
|
+
HttpVersionNotSupported: 505,
|
|
2863
|
+
VariantAlsoNegotiates: 506,
|
|
2864
|
+
InsufficientStorage: 507,
|
|
2865
|
+
LoopDetected: 508,
|
|
2866
|
+
NotExtended: 510,
|
|
2867
|
+
NetworkAuthenticationRequired: 511
|
|
2868
|
+
};
|
|
2869
|
+
Object.entries(Ot).forEach(([e, t]) => {
|
|
2870
|
+
Ot[t] = e;
|
|
2871
|
+
});
|
|
2872
|
+
var Ni = Ot;
|
|
2873
|
+
function $r(e) {
|
|
2874
|
+
const t = new $e(e), i = _r($e.prototype.request, t);
|
|
2875
|
+
return y.extend(i, $e.prototype, t, { allOwnKeys: !0 }), y.extend(i, t, null, { allOwnKeys: !0 }), i.create = function(c) {
|
|
2876
|
+
return $r(_e(e, c));
|
|
2877
|
+
}, i;
|
|
2878
|
+
}
|
|
2879
|
+
const q = $r(jt);
|
|
2880
|
+
q.Axios = $e;
|
|
2881
|
+
q.CanceledError = Ne;
|
|
2882
|
+
q.CancelToken = Pi;
|
|
2883
|
+
q.isCancel = Lr;
|
|
2884
|
+
q.VERSION = qr;
|
|
2885
|
+
q.toFormData = Qe;
|
|
2886
|
+
q.AxiosError = P;
|
|
2887
|
+
q.Cancel = q.CanceledError;
|
|
2888
|
+
q.all = function(t) {
|
|
2889
|
+
return Promise.all(t);
|
|
2890
|
+
};
|
|
2891
|
+
q.spread = Ii;
|
|
2892
|
+
q.isAxiosError = vi;
|
|
2893
|
+
q.mergeConfig = _e;
|
|
2894
|
+
q.AxiosHeaders = se;
|
|
2895
|
+
q.formToJSON = (e) => kr(y.isHTMLForm(e) ? new FormData(e) : e);
|
|
2896
|
+
q.getAdapter = Mr.getAdapter;
|
|
2897
|
+
q.HttpStatusCode = Ni;
|
|
2898
|
+
q.default = q;
|
|
2899
|
+
var Ui = q, $t = { exports: {} }, z = {}, Wr = { exports: {} };
|
|
2900
|
+
(function(e) {
|
|
2901
|
+
function t(i) {
|
|
2902
|
+
return i && i.__esModule ? i : {
|
|
2903
|
+
default: i
|
|
2904
|
+
};
|
|
2905
|
+
}
|
|
2906
|
+
e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
2907
|
+
})(Wr);
|
|
2908
|
+
var ki = Wr.exports, yt = { exports: {} }, Et = { exports: {} }, ar;
|
|
2909
|
+
function tt() {
|
|
2910
|
+
return ar || (ar = 1, function(e) {
|
|
2911
|
+
function t(i) {
|
|
2912
|
+
"@babel/helpers - typeof";
|
|
2913
|
+
return e.exports = t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
|
|
2914
|
+
return typeof o;
|
|
2915
|
+
} : function(o) {
|
|
2916
|
+
return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
2917
|
+
}, e.exports.__esModule = !0, e.exports.default = e.exports, t(i);
|
|
2918
|
+
}
|
|
2919
|
+
e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
2920
|
+
}(Et)), Et.exports;
|
|
2921
|
+
}
|
|
2922
|
+
var cr;
|
|
2923
|
+
function Li() {
|
|
2924
|
+
return cr || (cr = 1, function(e) {
|
|
2925
|
+
var t = tt().default;
|
|
2926
|
+
function i() {
|
|
2927
|
+
e.exports = i = function() {
|
|
2928
|
+
return c;
|
|
2929
|
+
}, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
2930
|
+
var o, c = {}, l = Object.prototype, f = l.hasOwnProperty, u = Object.defineProperty || function(_, x, b) {
|
|
2931
|
+
_[x] = b.value;
|
|
2932
|
+
}, E = typeof Symbol == "function" ? Symbol : {}, g = E.iterator || "@@iterator", w = E.asyncIterator || "@@asyncIterator", d = E.toStringTag || "@@toStringTag";
|
|
2933
|
+
function B(_, x, b) {
|
|
2934
|
+
return Object.defineProperty(_, x, {
|
|
2935
|
+
value: b,
|
|
2936
|
+
enumerable: !0,
|
|
2937
|
+
configurable: !0,
|
|
2938
|
+
writable: !0
|
|
2939
|
+
}), _[x];
|
|
2940
|
+
}
|
|
2941
|
+
try {
|
|
2942
|
+
B({}, "");
|
|
2943
|
+
} catch {
|
|
2944
|
+
B = function(b, F, T) {
|
|
2945
|
+
return b[F] = T;
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
function S(_, x, b, F) {
|
|
2949
|
+
var T = x && x.prototype instanceof le ? x : le, R = Object.create(T.prototype), U = new Te(F || []);
|
|
2950
|
+
return u(R, "_invoke", {
|
|
2951
|
+
value: it(_, b, U)
|
|
2952
|
+
}), R;
|
|
2953
|
+
}
|
|
2954
|
+
function C(_, x, b) {
|
|
2955
|
+
try {
|
|
2956
|
+
return {
|
|
2957
|
+
type: "normal",
|
|
2958
|
+
arg: _.call(x, b)
|
|
2959
|
+
};
|
|
2960
|
+
} catch (F) {
|
|
2961
|
+
return {
|
|
2962
|
+
type: "throw",
|
|
2963
|
+
arg: F
|
|
2964
|
+
};
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
c.wrap = S;
|
|
2968
|
+
var A = "suspendedStart", D = "suspendedYield", N = "executing", J = "completed", L = {};
|
|
2969
|
+
function le() {
|
|
2970
|
+
}
|
|
2971
|
+
function G() {
|
|
2972
|
+
}
|
|
2973
|
+
function X() {
|
|
2974
|
+
}
|
|
2975
|
+
var de = {};
|
|
2976
|
+
B(de, g, function() {
|
|
2977
|
+
return this;
|
|
2978
|
+
});
|
|
2979
|
+
var Ae = Object.getPrototypeOf, me = Ae && Ae(Ae(Se([])));
|
|
2980
|
+
me && me !== l && f.call(me, g) && (de = me);
|
|
2981
|
+
var ae = X.prototype = le.prototype = Object.create(de);
|
|
2982
|
+
function ke(_) {
|
|
2983
|
+
["next", "throw", "return"].forEach(function(x) {
|
|
2984
|
+
B(_, x, function(b) {
|
|
2985
|
+
return this._invoke(x, b);
|
|
2986
|
+
});
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
function ye(_, x) {
|
|
2990
|
+
function b(T, R, U, $) {
|
|
2991
|
+
var W = C(_[T], _, R);
|
|
2992
|
+
if (W.type !== "throw") {
|
|
2993
|
+
var H = W.arg, V = H.value;
|
|
2994
|
+
return V && t(V) == "object" && f.call(V, "__await") ? x.resolve(V.__await).then(function(Z) {
|
|
2995
|
+
b("next", Z, U, $);
|
|
2996
|
+
}, function(Z) {
|
|
2997
|
+
b("throw", Z, U, $);
|
|
2998
|
+
}) : x.resolve(V).then(function(Z) {
|
|
2999
|
+
H.value = Z, U(H);
|
|
3000
|
+
}, function(Z) {
|
|
3001
|
+
return b("throw", Z, U, $);
|
|
3002
|
+
});
|
|
3003
|
+
}
|
|
3004
|
+
$(W.arg);
|
|
3005
|
+
}
|
|
3006
|
+
var F;
|
|
3007
|
+
u(this, "_invoke", {
|
|
3008
|
+
value: function(R, U) {
|
|
3009
|
+
function $() {
|
|
3010
|
+
return new x(function(W, H) {
|
|
3011
|
+
b(R, U, W, H);
|
|
3012
|
+
});
|
|
3013
|
+
}
|
|
3014
|
+
return F = F ? F.then($, $) : $();
|
|
3015
|
+
}
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
function it(_, x, b) {
|
|
3019
|
+
var F = A;
|
|
3020
|
+
return function(T, R) {
|
|
3021
|
+
if (F === N)
|
|
3022
|
+
throw new Error("Generator is already running");
|
|
3023
|
+
if (F === J) {
|
|
3024
|
+
if (T === "throw")
|
|
3025
|
+
throw R;
|
|
3026
|
+
return {
|
|
3027
|
+
value: o,
|
|
3028
|
+
done: !0
|
|
3029
|
+
};
|
|
3030
|
+
}
|
|
3031
|
+
for (b.method = T, b.arg = R; ; ) {
|
|
3032
|
+
var U = b.delegate;
|
|
3033
|
+
if (U) {
|
|
3034
|
+
var $ = Be(U, b);
|
|
3035
|
+
if ($) {
|
|
3036
|
+
if ($ === L)
|
|
3037
|
+
continue;
|
|
3038
|
+
return $;
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
if (b.method === "next")
|
|
3042
|
+
b.sent = b._sent = b.arg;
|
|
3043
|
+
else if (b.method === "throw") {
|
|
3044
|
+
if (F === A)
|
|
3045
|
+
throw F = J, b.arg;
|
|
3046
|
+
b.dispatchException(b.arg);
|
|
3047
|
+
} else
|
|
3048
|
+
b.method === "return" && b.abrupt("return", b.arg);
|
|
3049
|
+
F = N;
|
|
3050
|
+
var W = C(_, x, b);
|
|
3051
|
+
if (W.type === "normal") {
|
|
3052
|
+
if (F = b.done ? J : D, W.arg === L)
|
|
3053
|
+
continue;
|
|
3054
|
+
return {
|
|
3055
|
+
value: W.arg,
|
|
3056
|
+
done: b.done
|
|
3057
|
+
};
|
|
3058
|
+
}
|
|
3059
|
+
W.type === "throw" && (F = J, b.method = "throw", b.arg = W.arg);
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
3063
|
+
function Be(_, x) {
|
|
3064
|
+
var b = x.method, F = _.iterator[b];
|
|
3065
|
+
if (F === o)
|
|
3066
|
+
return x.delegate = null, b === "throw" && _.iterator.return && (x.method = "return", x.arg = o, Be(_, x), x.method === "throw") || b !== "return" && (x.method = "throw", x.arg = new TypeError("The iterator does not provide a '" + b + "' method")), L;
|
|
3067
|
+
var T = C(F, _.iterator, x.arg);
|
|
3068
|
+
if (T.type === "throw")
|
|
3069
|
+
return x.method = "throw", x.arg = T.arg, x.delegate = null, L;
|
|
3070
|
+
var R = T.arg;
|
|
3071
|
+
return R ? R.done ? (x[_.resultName] = R.value, x.next = _.nextLoc, x.method !== "return" && (x.method = "next", x.arg = o), x.delegate = null, L) : R : (x.method = "throw", x.arg = new TypeError("iterator result is not an object"), x.delegate = null, L);
|
|
3072
|
+
}
|
|
3073
|
+
function Le(_) {
|
|
3074
|
+
var x = {
|
|
3075
|
+
tryLoc: _[0]
|
|
3076
|
+
};
|
|
3077
|
+
1 in _ && (x.catchLoc = _[1]), 2 in _ && (x.finallyLoc = _[2], x.afterLoc = _[3]), this.tryEntries.push(x);
|
|
3078
|
+
}
|
|
3079
|
+
function Re(_) {
|
|
3080
|
+
var x = _.completion || {};
|
|
3081
|
+
x.type = "normal", delete x.arg, _.completion = x;
|
|
3082
|
+
}
|
|
3083
|
+
function Te(_) {
|
|
3084
|
+
this.tryEntries = [{
|
|
3085
|
+
tryLoc: "root"
|
|
3086
|
+
}], _.forEach(Le, this), this.reset(!0);
|
|
3087
|
+
}
|
|
3088
|
+
function Se(_) {
|
|
3089
|
+
if (_ || _ === "") {
|
|
3090
|
+
var x = _[g];
|
|
3091
|
+
if (x)
|
|
3092
|
+
return x.call(_);
|
|
3093
|
+
if (typeof _.next == "function")
|
|
3094
|
+
return _;
|
|
3095
|
+
if (!isNaN(_.length)) {
|
|
3096
|
+
var b = -1, F = function T() {
|
|
3097
|
+
for (; ++b < _.length; )
|
|
3098
|
+
if (f.call(_, b))
|
|
3099
|
+
return T.value = _[b], T.done = !1, T;
|
|
3100
|
+
return T.value = o, T.done = !0, T;
|
|
3101
|
+
};
|
|
3102
|
+
return F.next = F;
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
throw new TypeError(t(_) + " is not iterable");
|
|
3106
|
+
}
|
|
3107
|
+
return G.prototype = X, u(ae, "constructor", {
|
|
3108
|
+
value: X,
|
|
3109
|
+
configurable: !0
|
|
3110
|
+
}), u(X, "constructor", {
|
|
3111
|
+
value: G,
|
|
3112
|
+
configurable: !0
|
|
3113
|
+
}), G.displayName = B(X, d, "GeneratorFunction"), c.isGeneratorFunction = function(_) {
|
|
3114
|
+
var x = typeof _ == "function" && _.constructor;
|
|
3115
|
+
return !!x && (x === G || (x.displayName || x.name) === "GeneratorFunction");
|
|
3116
|
+
}, c.mark = function(_) {
|
|
3117
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(_, X) : (_.__proto__ = X, B(_, d, "GeneratorFunction")), _.prototype = Object.create(ae), _;
|
|
3118
|
+
}, c.awrap = function(_) {
|
|
3119
|
+
return {
|
|
3120
|
+
__await: _
|
|
3121
|
+
};
|
|
3122
|
+
}, ke(ye.prototype), B(ye.prototype, w, function() {
|
|
3123
|
+
return this;
|
|
3124
|
+
}), c.AsyncIterator = ye, c.async = function(_, x, b, F, T) {
|
|
3125
|
+
T === void 0 && (T = Promise);
|
|
3126
|
+
var R = new ye(S(_, x, b, F), T);
|
|
3127
|
+
return c.isGeneratorFunction(x) ? R : R.next().then(function(U) {
|
|
3128
|
+
return U.done ? U.value : R.next();
|
|
3129
|
+
});
|
|
3130
|
+
}, ke(ae), B(ae, d, "Generator"), B(ae, g, function() {
|
|
3131
|
+
return this;
|
|
3132
|
+
}), B(ae, "toString", function() {
|
|
3133
|
+
return "[object Generator]";
|
|
3134
|
+
}), c.keys = function(_) {
|
|
3135
|
+
var x = Object(_), b = [];
|
|
3136
|
+
for (var F in x)
|
|
3137
|
+
b.push(F);
|
|
3138
|
+
return b.reverse(), function T() {
|
|
3139
|
+
for (; b.length; ) {
|
|
3140
|
+
var R = b.pop();
|
|
3141
|
+
if (R in x)
|
|
3142
|
+
return T.value = R, T.done = !1, T;
|
|
3143
|
+
}
|
|
3144
|
+
return T.done = !0, T;
|
|
3145
|
+
};
|
|
3146
|
+
}, c.values = Se, Te.prototype = {
|
|
3147
|
+
constructor: Te,
|
|
3148
|
+
reset: function(x) {
|
|
3149
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = o, this.done = !1, this.delegate = null, this.method = "next", this.arg = o, this.tryEntries.forEach(Re), !x)
|
|
3150
|
+
for (var b in this)
|
|
3151
|
+
b.charAt(0) === "t" && f.call(this, b) && !isNaN(+b.slice(1)) && (this[b] = o);
|
|
3152
|
+
},
|
|
3153
|
+
stop: function() {
|
|
3154
|
+
this.done = !0;
|
|
3155
|
+
var x = this.tryEntries[0].completion;
|
|
3156
|
+
if (x.type === "throw")
|
|
3157
|
+
throw x.arg;
|
|
3158
|
+
return this.rval;
|
|
3159
|
+
},
|
|
3160
|
+
dispatchException: function(x) {
|
|
3161
|
+
if (this.done)
|
|
3162
|
+
throw x;
|
|
3163
|
+
var b = this;
|
|
3164
|
+
function F(H, V) {
|
|
3165
|
+
return U.type = "throw", U.arg = x, b.next = H, V && (b.method = "next", b.arg = o), !!V;
|
|
3166
|
+
}
|
|
3167
|
+
for (var T = this.tryEntries.length - 1; T >= 0; --T) {
|
|
3168
|
+
var R = this.tryEntries[T], U = R.completion;
|
|
3169
|
+
if (R.tryLoc === "root")
|
|
3170
|
+
return F("end");
|
|
3171
|
+
if (R.tryLoc <= this.prev) {
|
|
3172
|
+
var $ = f.call(R, "catchLoc"), W = f.call(R, "finallyLoc");
|
|
3173
|
+
if ($ && W) {
|
|
3174
|
+
if (this.prev < R.catchLoc)
|
|
3175
|
+
return F(R.catchLoc, !0);
|
|
3176
|
+
if (this.prev < R.finallyLoc)
|
|
3177
|
+
return F(R.finallyLoc);
|
|
3178
|
+
} else if ($) {
|
|
3179
|
+
if (this.prev < R.catchLoc)
|
|
3180
|
+
return F(R.catchLoc, !0);
|
|
3181
|
+
} else {
|
|
3182
|
+
if (!W)
|
|
3183
|
+
throw new Error("try statement without catch or finally");
|
|
3184
|
+
if (this.prev < R.finallyLoc)
|
|
3185
|
+
return F(R.finallyLoc);
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3189
|
+
},
|
|
3190
|
+
abrupt: function(x, b) {
|
|
3191
|
+
for (var F = this.tryEntries.length - 1; F >= 0; --F) {
|
|
3192
|
+
var T = this.tryEntries[F];
|
|
3193
|
+
if (T.tryLoc <= this.prev && f.call(T, "finallyLoc") && this.prev < T.finallyLoc) {
|
|
3194
|
+
var R = T;
|
|
3195
|
+
break;
|
|
3196
|
+
}
|
|
3197
|
+
}
|
|
3198
|
+
R && (x === "break" || x === "continue") && R.tryLoc <= b && b <= R.finallyLoc && (R = null);
|
|
3199
|
+
var U = R ? R.completion : {};
|
|
3200
|
+
return U.type = x, U.arg = b, R ? (this.method = "next", this.next = R.finallyLoc, L) : this.complete(U);
|
|
3201
|
+
},
|
|
3202
|
+
complete: function(x, b) {
|
|
3203
|
+
if (x.type === "throw")
|
|
3204
|
+
throw x.arg;
|
|
3205
|
+
return x.type === "break" || x.type === "continue" ? this.next = x.arg : x.type === "return" ? (this.rval = this.arg = x.arg, this.method = "return", this.next = "end") : x.type === "normal" && b && (this.next = b), L;
|
|
3206
|
+
},
|
|
3207
|
+
finish: function(x) {
|
|
3208
|
+
for (var b = this.tryEntries.length - 1; b >= 0; --b) {
|
|
3209
|
+
var F = this.tryEntries[b];
|
|
3210
|
+
if (F.finallyLoc === x)
|
|
3211
|
+
return this.complete(F.completion, F.afterLoc), Re(F), L;
|
|
3212
|
+
}
|
|
3213
|
+
},
|
|
3214
|
+
catch: function(x) {
|
|
3215
|
+
for (var b = this.tryEntries.length - 1; b >= 0; --b) {
|
|
3216
|
+
var F = this.tryEntries[b];
|
|
3217
|
+
if (F.tryLoc === x) {
|
|
3218
|
+
var T = F.completion;
|
|
3219
|
+
if (T.type === "throw") {
|
|
3220
|
+
var R = T.arg;
|
|
3221
|
+
Re(F);
|
|
3222
|
+
}
|
|
3223
|
+
return R;
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
throw new Error("illegal catch attempt");
|
|
3227
|
+
},
|
|
3228
|
+
delegateYield: function(x, b, F) {
|
|
3229
|
+
return this.delegate = {
|
|
3230
|
+
iterator: Se(x),
|
|
3231
|
+
resultName: b,
|
|
3232
|
+
nextLoc: F
|
|
3233
|
+
}, this.method === "next" && (this.arg = o), L;
|
|
3234
|
+
}
|
|
3235
|
+
}, c;
|
|
3236
|
+
}
|
|
3237
|
+
e.exports = i, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
3238
|
+
}(yt)), yt.exports;
|
|
3239
|
+
}
|
|
3240
|
+
var wt, ur;
|
|
3241
|
+
function ji() {
|
|
3242
|
+
if (ur)
|
|
3243
|
+
return wt;
|
|
3244
|
+
ur = 1;
|
|
3245
|
+
var e = Li()();
|
|
3246
|
+
wt = e;
|
|
3247
|
+
try {
|
|
3248
|
+
regeneratorRuntime = e;
|
|
3249
|
+
} catch {
|
|
3250
|
+
typeof globalThis == "object" ? globalThis.regeneratorRuntime = e : Function("r", "regeneratorRuntime = r")(e);
|
|
3251
|
+
}
|
|
3252
|
+
return wt;
|
|
3253
|
+
}
|
|
3254
|
+
var bt = { exports: {} }, fr;
|
|
3255
|
+
function Mi() {
|
|
3256
|
+
return fr || (fr = 1, function(e) {
|
|
3257
|
+
function t(o, c, l, f, u, E, g) {
|
|
3258
|
+
try {
|
|
3259
|
+
var w = o[E](g), d = w.value;
|
|
3260
|
+
} catch (B) {
|
|
3261
|
+
l(B);
|
|
3262
|
+
return;
|
|
3263
|
+
}
|
|
3264
|
+
w.done ? c(d) : Promise.resolve(d).then(f, u);
|
|
3265
|
+
}
|
|
3266
|
+
function i(o) {
|
|
3267
|
+
return function() {
|
|
3268
|
+
var c = this, l = arguments;
|
|
3269
|
+
return new Promise(function(f, u) {
|
|
3270
|
+
var E = o.apply(c, l);
|
|
3271
|
+
function g(d) {
|
|
3272
|
+
t(E, f, u, g, w, "next", d);
|
|
3273
|
+
}
|
|
3274
|
+
function w(d) {
|
|
3275
|
+
t(E, f, u, g, w, "throw", d);
|
|
3276
|
+
}
|
|
3277
|
+
g(void 0);
|
|
3278
|
+
});
|
|
3279
|
+
};
|
|
3280
|
+
}
|
|
3281
|
+
e.exports = i, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
3282
|
+
}(bt)), bt.exports;
|
|
3283
|
+
}
|
|
3284
|
+
var xt = { exports: {} }, gt = { exports: {} }, _t = { exports: {} }, lr;
|
|
3285
|
+
function qi() {
|
|
3286
|
+
return lr || (lr = 1, function(e) {
|
|
3287
|
+
var t = tt().default;
|
|
3288
|
+
function i(o, c) {
|
|
3289
|
+
if (t(o) != "object" || !o)
|
|
3290
|
+
return o;
|
|
3291
|
+
var l = o[Symbol.toPrimitive];
|
|
3292
|
+
if (l !== void 0) {
|
|
3293
|
+
var f = l.call(o, c || "default");
|
|
3294
|
+
if (t(f) != "object")
|
|
3295
|
+
return f;
|
|
3296
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3297
|
+
}
|
|
3298
|
+
return (c === "string" ? String : Number)(o);
|
|
3299
|
+
}
|
|
3300
|
+
e.exports = i, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
3301
|
+
}(_t)), _t.exports;
|
|
3302
|
+
}
|
|
3303
|
+
var pr;
|
|
3304
|
+
function $i() {
|
|
3305
|
+
return pr || (pr = 1, function(e) {
|
|
3306
|
+
var t = tt().default, i = qi();
|
|
3307
|
+
function o(c) {
|
|
3308
|
+
var l = i(c, "string");
|
|
3309
|
+
return t(l) == "symbol" ? l : String(l);
|
|
3310
|
+
}
|
|
3311
|
+
e.exports = o, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
3312
|
+
}(gt)), gt.exports;
|
|
3313
|
+
}
|
|
3314
|
+
var hr;
|
|
3315
|
+
function Wi() {
|
|
3316
|
+
return hr || (hr = 1, function(e) {
|
|
3317
|
+
var t = $i();
|
|
3318
|
+
function i(o, c, l) {
|
|
3319
|
+
return c = t(c), c in o ? Object.defineProperty(o, c, {
|
|
3320
|
+
value: l,
|
|
3321
|
+
enumerable: !0,
|
|
3322
|
+
configurable: !0,
|
|
3323
|
+
writable: !0
|
|
3324
|
+
}) : o[c] = l, o;
|
|
3325
|
+
}
|
|
3326
|
+
e.exports = i, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
3327
|
+
}(xt)), xt.exports;
|
|
3328
|
+
}
|
|
3329
|
+
var Ct, dr;
|
|
3330
|
+
function Ji() {
|
|
3331
|
+
if (dr)
|
|
3332
|
+
return Ct;
|
|
3333
|
+
dr = 1;
|
|
3334
|
+
const e = /* @__PURE__ */ new Set([
|
|
3335
|
+
"ENOTFOUND",
|
|
3336
|
+
"ENETUNREACH",
|
|
3337
|
+
// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
|
|
3338
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
3339
|
+
"UNABLE_TO_GET_CRL",
|
|
3340
|
+
"UNABLE_TO_DECRYPT_CERT_SIGNATURE",
|
|
3341
|
+
"UNABLE_TO_DECRYPT_CRL_SIGNATURE",
|
|
3342
|
+
"UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
|
|
3343
|
+
"CERT_SIGNATURE_FAILURE",
|
|
3344
|
+
"CRL_SIGNATURE_FAILURE",
|
|
3345
|
+
"CERT_NOT_YET_VALID",
|
|
3346
|
+
"CERT_HAS_EXPIRED",
|
|
3347
|
+
"CRL_NOT_YET_VALID",
|
|
3348
|
+
"CRL_HAS_EXPIRED",
|
|
3349
|
+
"ERROR_IN_CERT_NOT_BEFORE_FIELD",
|
|
3350
|
+
"ERROR_IN_CERT_NOT_AFTER_FIELD",
|
|
3351
|
+
"ERROR_IN_CRL_LAST_UPDATE_FIELD",
|
|
3352
|
+
"ERROR_IN_CRL_NEXT_UPDATE_FIELD",
|
|
3353
|
+
"OUT_OF_MEM",
|
|
3354
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
3355
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
3356
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
3357
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
3358
|
+
"CERT_CHAIN_TOO_LONG",
|
|
3359
|
+
"CERT_REVOKED",
|
|
3360
|
+
"INVALID_CA",
|
|
3361
|
+
"PATH_LENGTH_EXCEEDED",
|
|
3362
|
+
"INVALID_PURPOSE",
|
|
3363
|
+
"CERT_UNTRUSTED",
|
|
3364
|
+
"CERT_REJECTED",
|
|
3365
|
+
"HOSTNAME_MISMATCH"
|
|
3366
|
+
]);
|
|
3367
|
+
return Ct = (t) => !e.has(t && t.code), Ct;
|
|
3368
|
+
}
|
|
3369
|
+
var Ue = ki;
|
|
3370
|
+
Object.defineProperty(z, "__esModule", {
|
|
3371
|
+
value: !0
|
|
3372
|
+
});
|
|
3373
|
+
z.isNetworkError = Jt;
|
|
3374
|
+
z.isRetryableError = rt;
|
|
3375
|
+
z.isSafeRequestError = zr;
|
|
3376
|
+
z.isIdempotentRequestError = Ht;
|
|
3377
|
+
z.isNetworkOrIdempotentRequestError = zt;
|
|
3378
|
+
z.exponentialDelay = Gr;
|
|
3379
|
+
z.default = he;
|
|
3380
|
+
z.DEFAULT_OPTIONS = z.namespace = void 0;
|
|
3381
|
+
var Je = Ue(ji()), Hi = Ue(tt()), Jr = Ue(Mi()), zi = Ue(Wi()), Gi = Ue(Ji());
|
|
3382
|
+
function mr(e, t) {
|
|
3383
|
+
var i = Object.keys(e);
|
|
3384
|
+
if (Object.getOwnPropertySymbols) {
|
|
3385
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
3386
|
+
t && (o = o.filter(function(c) {
|
|
3387
|
+
return Object.getOwnPropertyDescriptor(e, c).enumerable;
|
|
3388
|
+
})), i.push.apply(i, o);
|
|
3389
|
+
}
|
|
3390
|
+
return i;
|
|
3391
|
+
}
|
|
3392
|
+
function Ft(e) {
|
|
3393
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
3394
|
+
var i = arguments[t] != null ? arguments[t] : {};
|
|
3395
|
+
t % 2 ? mr(Object(i), !0).forEach(function(o) {
|
|
3396
|
+
(0, zi.default)(e, o, i[o]);
|
|
3397
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(i)) : mr(Object(i)).forEach(function(o) {
|
|
3398
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(i, o));
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
return e;
|
|
3402
|
+
}
|
|
3403
|
+
var Wt = "axios-retry";
|
|
3404
|
+
z.namespace = Wt;
|
|
3405
|
+
function Jt(e) {
|
|
3406
|
+
var t = ["ERR_CANCELED", "ECONNABORTED"];
|
|
3407
|
+
return !e.response && !!e.code && // Prevents retrying cancelled requests
|
|
3408
|
+
!t.includes(e.code) && // Prevents retrying timed out & cancelled requests
|
|
3409
|
+
(0, Gi.default)(e);
|
|
3410
|
+
}
|
|
3411
|
+
var Hr = ["get", "head", "options"], Vi = Hr.concat(["put", "delete"]);
|
|
3412
|
+
function rt(e) {
|
|
3413
|
+
return e.code !== "ECONNABORTED" && (!e.response || e.response.status >= 500 && e.response.status <= 599);
|
|
3414
|
+
}
|
|
3415
|
+
function zr(e) {
|
|
3416
|
+
return e.config ? rt(e) && Hr.indexOf(e.config.method) !== -1 : !1;
|
|
3417
|
+
}
|
|
3418
|
+
function Ht(e) {
|
|
3419
|
+
return e.config ? rt(e) && Vi.indexOf(e.config.method) !== -1 : !1;
|
|
3420
|
+
}
|
|
3421
|
+
function zt(e) {
|
|
3422
|
+
return Jt(e) || Ht(e);
|
|
3423
|
+
}
|
|
3424
|
+
function Ki() {
|
|
3425
|
+
return 0;
|
|
3426
|
+
}
|
|
3427
|
+
function Gr() {
|
|
3428
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 100, i = Math.pow(2, e) * t, o = i * 0.2 * Math.random();
|
|
3429
|
+
return i + o;
|
|
3430
|
+
}
|
|
3431
|
+
var Vr = {
|
|
3432
|
+
retries: 3,
|
|
3433
|
+
retryCondition: zt,
|
|
3434
|
+
retryDelay: Ki,
|
|
3435
|
+
shouldResetTimeout: !1,
|
|
3436
|
+
onRetry: function() {
|
|
3437
|
+
}
|
|
3438
|
+
};
|
|
3439
|
+
z.DEFAULT_OPTIONS = Vr;
|
|
3440
|
+
function Yi(e, t) {
|
|
3441
|
+
return Ft(Ft(Ft({}, Vr), t), e[Wt]);
|
|
3442
|
+
}
|
|
3443
|
+
function yr(e, t) {
|
|
3444
|
+
var i = Yi(e, t);
|
|
3445
|
+
return i.retryCount = i.retryCount || 0, e[Wt] = i, i;
|
|
3446
|
+
}
|
|
3447
|
+
function Xi(e, t) {
|
|
3448
|
+
e.defaults.agent === t.agent && delete t.agent, e.defaults.httpAgent === t.httpAgent && delete t.httpAgent, e.defaults.httpsAgent === t.httpsAgent && delete t.httpsAgent;
|
|
3449
|
+
}
|
|
3450
|
+
function Zi(e, t) {
|
|
3451
|
+
return Pt.apply(this, arguments);
|
|
3452
|
+
}
|
|
3453
|
+
function Pt() {
|
|
3454
|
+
return Pt = (0, Jr.default)(/* @__PURE__ */ Je.default.mark(function e(t, i) {
|
|
3455
|
+
var o, c, l, f;
|
|
3456
|
+
return Je.default.wrap(function(E) {
|
|
3457
|
+
for (; ; )
|
|
3458
|
+
switch (E.prev = E.next) {
|
|
3459
|
+
case 0:
|
|
3460
|
+
if (o = t.retries, c = t.retryCondition, l = t.retryCount < o && c(i), (0, Hi.default)(l) !== "object") {
|
|
3461
|
+
E.next = 13;
|
|
3462
|
+
break;
|
|
3463
|
+
}
|
|
3464
|
+
return E.prev = 3, E.next = 6, l;
|
|
3465
|
+
case 6:
|
|
3466
|
+
return f = E.sent, E.abrupt("return", f !== !1);
|
|
3467
|
+
case 10:
|
|
3468
|
+
return E.prev = 10, E.t0 = E.catch(3), E.abrupt("return", !1);
|
|
3469
|
+
case 13:
|
|
3470
|
+
return E.abrupt("return", l);
|
|
3471
|
+
case 14:
|
|
3472
|
+
case "end":
|
|
3473
|
+
return E.stop();
|
|
3474
|
+
}
|
|
3475
|
+
}, e, null, [[3, 10]]);
|
|
3476
|
+
})), Pt.apply(this, arguments);
|
|
3477
|
+
}
|
|
3478
|
+
function he(e, t) {
|
|
3479
|
+
var i = e.interceptors.request.use(function(c) {
|
|
3480
|
+
var l = yr(c, t);
|
|
3481
|
+
return l.lastRequestTime = Date.now(), c;
|
|
3482
|
+
}), o = e.interceptors.response.use(null, /* @__PURE__ */ function() {
|
|
3483
|
+
var c = (0, Jr.default)(/* @__PURE__ */ Je.default.mark(function l(f) {
|
|
3484
|
+
var u, E, g, w, d, B, S, C;
|
|
3485
|
+
return Je.default.wrap(function(D) {
|
|
3486
|
+
for (; ; )
|
|
3487
|
+
switch (D.prev = D.next) {
|
|
3488
|
+
case 0:
|
|
3489
|
+
if (u = f.config, u) {
|
|
3490
|
+
D.next = 3;
|
|
3491
|
+
break;
|
|
3492
|
+
}
|
|
3493
|
+
return D.abrupt("return", Promise.reject(f));
|
|
3494
|
+
case 3:
|
|
3495
|
+
return E = yr(u, t), D.next = 6, Zi(E, f);
|
|
3496
|
+
case 6:
|
|
3497
|
+
if (!D.sent) {
|
|
3498
|
+
D.next = 21;
|
|
3499
|
+
break;
|
|
3500
|
+
}
|
|
3501
|
+
if (E.retryCount += 1, g = E.retryDelay, w = E.shouldResetTimeout, d = E.onRetry, B = g(E.retryCount, f), Xi(e, u), !(!w && u.timeout && E.lastRequestTime)) {
|
|
3502
|
+
D.next = 17;
|
|
3503
|
+
break;
|
|
3504
|
+
}
|
|
3505
|
+
if (S = Date.now() - E.lastRequestTime, C = u.timeout - S - B, !(C <= 0)) {
|
|
3506
|
+
D.next = 16;
|
|
3507
|
+
break;
|
|
3508
|
+
}
|
|
3509
|
+
return D.abrupt("return", Promise.reject(f));
|
|
3510
|
+
case 16:
|
|
3511
|
+
u.timeout = C;
|
|
3512
|
+
case 17:
|
|
3513
|
+
return u.transformRequest = [function(N) {
|
|
3514
|
+
return N;
|
|
3515
|
+
}], D.next = 20, d(E.retryCount, f, u);
|
|
3516
|
+
case 20:
|
|
3517
|
+
return D.abrupt("return", new Promise(function(N) {
|
|
3518
|
+
return setTimeout(function() {
|
|
3519
|
+
return N(e(u));
|
|
3520
|
+
}, B);
|
|
3521
|
+
}));
|
|
3522
|
+
case 21:
|
|
3523
|
+
return D.abrupt("return", Promise.reject(f));
|
|
3524
|
+
case 22:
|
|
3525
|
+
case "end":
|
|
3526
|
+
return D.stop();
|
|
3527
|
+
}
|
|
3528
|
+
}, l);
|
|
3529
|
+
}));
|
|
3530
|
+
return function(l) {
|
|
3531
|
+
return c.apply(this, arguments);
|
|
3532
|
+
};
|
|
3533
|
+
}());
|
|
3534
|
+
return {
|
|
3535
|
+
requestInterceptorId: i,
|
|
3536
|
+
responseInterceptorId: o
|
|
3537
|
+
};
|
|
3538
|
+
}
|
|
3539
|
+
he.isNetworkError = Jt;
|
|
3540
|
+
he.isSafeRequestError = zr;
|
|
3541
|
+
he.isIdempotentRequestError = Ht;
|
|
3542
|
+
he.isNetworkOrIdempotentRequestError = zt;
|
|
3543
|
+
he.exponentialDelay = Gr;
|
|
3544
|
+
he.isRetryableError = rt;
|
|
3545
|
+
const Kr = z.default;
|
|
3546
|
+
$t.exports = Kr;
|
|
3547
|
+
$t.exports.default = Kr;
|
|
3548
|
+
var Qi = $t.exports, nt = {}, be = null;
|
|
3549
|
+
typeof WebSocket < "u" ? be = WebSocket : typeof MozWebSocket < "u" ? be = MozWebSocket : typeof fe < "u" ? be = fe.WebSocket || fe.MozWebSocket : typeof window < "u" ? be = window.WebSocket || window.MozWebSocket : typeof self < "u" && (be = self.WebSocket || self.MozWebSocket);
|
|
3550
|
+
var eo = be, to = fe && fe.__importDefault || function(e) {
|
|
3551
|
+
return e && e.__esModule ? e : { default: e };
|
|
3552
|
+
};
|
|
3553
|
+
Object.defineProperty(nt, "__esModule", { value: !0 });
|
|
3554
|
+
nt.ResilientWebSocket = void 0;
|
|
3555
|
+
const ro = to(eo), no = 3e4 + 3e3;
|
|
3556
|
+
class io {
|
|
3557
|
+
constructor(t, i) {
|
|
3558
|
+
I(this, "endpoint");
|
|
3559
|
+
I(this, "wsClient");
|
|
3560
|
+
I(this, "wsUserClosed");
|
|
3561
|
+
I(this, "wsFailedAttempts");
|
|
3562
|
+
I(this, "pingTimeout");
|
|
3563
|
+
I(this, "logger");
|
|
3564
|
+
I(this, "onError");
|
|
3565
|
+
I(this, "onMessage");
|
|
3566
|
+
I(this, "onReconnect");
|
|
3567
|
+
this.endpoint = t, this.logger = i, this.wsFailedAttempts = 0, this.onError = (o) => {
|
|
3568
|
+
var c;
|
|
3569
|
+
(c = this.logger) == null || c.error(o);
|
|
3570
|
+
}, this.wsUserClosed = !0, this.onMessage = () => {
|
|
3571
|
+
}, this.onReconnect = () => {
|
|
3572
|
+
};
|
|
3573
|
+
}
|
|
3574
|
+
async send(t) {
|
|
3575
|
+
var i, o, c;
|
|
3576
|
+
(i = this.logger) == null || i.info(`Sending ${t}`), await this.waitForMaybeReadyWebSocket(), this.wsClient === void 0 ? (o = this.logger) == null || o.error("Couldn't connect to the websocket server. Error callback is called.") : (c = this.wsClient) == null || c.send(t);
|
|
3577
|
+
}
|
|
3578
|
+
async startWebSocket() {
|
|
3579
|
+
var t;
|
|
3580
|
+
this.wsClient === void 0 && ((t = this.logger) == null || t.info("Creating Web Socket client"), this.wsClient = new ro.default(this.endpoint), this.wsUserClosed = !1, this.wsClient.onopen = () => {
|
|
3581
|
+
this.wsFailedAttempts = 0, this.wsClient.on !== void 0 && this.heartbeat();
|
|
3582
|
+
}, this.wsClient.onerror = (i) => {
|
|
3583
|
+
this.onError(i.error);
|
|
3584
|
+
}, this.wsClient.onmessage = (i) => {
|
|
3585
|
+
this.onMessage(i.data);
|
|
3586
|
+
}, this.wsClient.onclose = async () => {
|
|
3587
|
+
var i, o;
|
|
3588
|
+
if (this.pingTimeout !== void 0 && clearInterval(this.pingTimeout), this.wsUserClosed === !1) {
|
|
3589
|
+
this.wsFailedAttempts += 1, this.wsClient = void 0;
|
|
3590
|
+
const c = oo(this.wsFailedAttempts);
|
|
3591
|
+
(i = this.logger) == null || i.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${c}ms.`), await Er(c), this.restartUnexpectedClosedWebsocket();
|
|
3592
|
+
} else
|
|
3593
|
+
(o = this.logger) == null || o.info("The connection has been closed successfully.");
|
|
3594
|
+
}, this.wsClient.on !== void 0 && this.wsClient.on("ping", this.heartbeat.bind(this)));
|
|
3595
|
+
}
|
|
3596
|
+
/**
|
|
3597
|
+
* Heartbeat is only enabled in node clients because they support handling
|
|
3598
|
+
* ping-pong events.
|
|
3599
|
+
*
|
|
3600
|
+
* This approach only works when server constantly pings the clients which.
|
|
3601
|
+
* Otherwise you might consider sending ping and acting on pong responses
|
|
3602
|
+
* yourself.
|
|
3603
|
+
*/
|
|
3604
|
+
heartbeat() {
|
|
3605
|
+
var t;
|
|
3606
|
+
(t = this.logger) == null || t.info("Heartbeat"), this.pingTimeout !== void 0 && clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => {
|
|
3607
|
+
var i, o;
|
|
3608
|
+
(i = this.logger) == null || i.warn("Connection timed out. Reconnecting..."), (o = this.wsClient) == null || o.terminate(), this.restartUnexpectedClosedWebsocket();
|
|
3609
|
+
}, no);
|
|
3610
|
+
}
|
|
3611
|
+
async waitForMaybeReadyWebSocket() {
|
|
3612
|
+
let t = 0;
|
|
3613
|
+
for (; this.wsClient !== void 0 && this.wsClient.readyState !== this.wsClient.OPEN; )
|
|
3614
|
+
if (t > 5e3) {
|
|
3615
|
+
this.wsClient.close();
|
|
3616
|
+
return;
|
|
3617
|
+
} else
|
|
3618
|
+
t += 10, await Er(10);
|
|
3619
|
+
}
|
|
3620
|
+
async restartUnexpectedClosedWebsocket() {
|
|
3621
|
+
var t;
|
|
3622
|
+
if (this.wsUserClosed !== !0) {
|
|
3623
|
+
if (await this.startWebSocket(), await this.waitForMaybeReadyWebSocket(), this.wsClient === void 0) {
|
|
3624
|
+
(t = this.logger) == null || t.error("Couldn't reconnect to websocket. Error callback is called.");
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
this.onReconnect();
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
closeWebSocket() {
|
|
3631
|
+
if (this.wsClient !== void 0) {
|
|
3632
|
+
const t = this.wsClient;
|
|
3633
|
+
this.wsClient = void 0, t.close();
|
|
3634
|
+
}
|
|
3635
|
+
this.wsUserClosed = !0;
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
nt.ResilientWebSocket = io;
|
|
3639
|
+
async function Er(e) {
|
|
3640
|
+
return new Promise((t) => setTimeout(t, e));
|
|
3641
|
+
}
|
|
3642
|
+
function oo(e) {
|
|
3643
|
+
return 2 ** e * 100;
|
|
3644
|
+
}
|
|
3645
|
+
var Ce = {};
|
|
3646
|
+
Object.defineProperty(Ce, "__esModule", { value: !0 });
|
|
3647
|
+
Ce.removeLeading0xIfExists = Ce.makeWebsocketUrl = void 0;
|
|
3648
|
+
function so(e) {
|
|
3649
|
+
const t = new URL("ws", e), i = t.protocol === "https:";
|
|
3650
|
+
return t.protocol = i ? "wss:" : "ws:", t.toString();
|
|
3651
|
+
}
|
|
3652
|
+
Ce.makeWebsocketUrl = so;
|
|
3653
|
+
function ao(e) {
|
|
3654
|
+
return e.startsWith("0x") ? e.substring(2) : e;
|
|
3655
|
+
}
|
|
3656
|
+
Ce.removeLeading0xIfExists = ao;
|
|
3657
|
+
var Yr = fe && fe.__importDefault || function(e) {
|
|
3658
|
+
return e && e.__esModule ? e : { default: e };
|
|
3659
|
+
};
|
|
3660
|
+
Object.defineProperty(Ge, "__esModule", { value: !0 });
|
|
3661
|
+
Ge.PriceServiceConnection = void 0;
|
|
3662
|
+
const At = oe, co = Yr(Ui), wr = Yr(Qi), uo = nt, Bt = Ce;
|
|
3663
|
+
class fo {
|
|
3664
|
+
/**
|
|
3665
|
+
* Constructs a new Connection.
|
|
3666
|
+
*
|
|
3667
|
+
* @param endpoint endpoint URL to the price service. Example: https://website/example/
|
|
3668
|
+
* @param config Optional PriceServiceConnectionConfig for custom configurations.
|
|
3669
|
+
*/
|
|
3670
|
+
constructor(t, i) {
|
|
3671
|
+
I(this, "httpClient");
|
|
3672
|
+
I(this, "priceFeedCallbacks");
|
|
3673
|
+
I(this, "wsClient");
|
|
3674
|
+
I(this, "wsEndpoint");
|
|
3675
|
+
I(this, "logger");
|
|
3676
|
+
I(this, "priceFeedRequestConfig");
|
|
3677
|
+
/**
|
|
3678
|
+
* Custom handler for web socket errors (connection and message parsing).
|
|
3679
|
+
*
|
|
3680
|
+
* Default handler only logs the errors.
|
|
3681
|
+
*/
|
|
3682
|
+
I(this, "onWsError");
|
|
3683
|
+
var o, c, l;
|
|
3684
|
+
this.httpClient = co.default.create({
|
|
3685
|
+
baseURL: t,
|
|
3686
|
+
timeout: (i == null ? void 0 : i.timeout) || 5e3
|
|
3687
|
+
}), (0, wr.default)(this.httpClient, {
|
|
3688
|
+
retries: (i == null ? void 0 : i.httpRetries) || 3,
|
|
3689
|
+
retryDelay: wr.default.exponentialDelay
|
|
3690
|
+
}), this.priceFeedRequestConfig = {
|
|
3691
|
+
binary: (o = i == null ? void 0 : i.priceFeedRequestConfig) == null ? void 0 : o.binary,
|
|
3692
|
+
verbose: ((c = i == null ? void 0 : i.priceFeedRequestConfig) == null ? void 0 : c.verbose) ?? (i == null ? void 0 : i.verbose),
|
|
3693
|
+
allowOutOfOrder: (l = i == null ? void 0 : i.priceFeedRequestConfig) == null ? void 0 : l.allowOutOfOrder
|
|
3694
|
+
}, this.priceFeedCallbacks = /* @__PURE__ */ new Map(), this.logger = (i == null ? void 0 : i.logger) || {
|
|
3695
|
+
trace: () => {
|
|
3696
|
+
},
|
|
3697
|
+
debug: () => {
|
|
3698
|
+
},
|
|
3699
|
+
info: () => {
|
|
3700
|
+
},
|
|
3701
|
+
warn: console.warn,
|
|
3702
|
+
error: console.error
|
|
3703
|
+
}, this.onWsError = (f) => {
|
|
3704
|
+
this.logger.error(f), typeof process < "u" && typeof process.exit == "function" ? (this.logger.error("Halting the process due to the websocket error"), process.exit(1)) : this.logger.error("Cannot halt process. Please handle the websocket error.");
|
|
3705
|
+
}, this.wsEndpoint = (0, Bt.makeWebsocketUrl)(t);
|
|
3706
|
+
}
|
|
3707
|
+
/**
|
|
3708
|
+
* Fetch Latest PriceFeeds of given price ids.
|
|
3709
|
+
* This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price ids)
|
|
3710
|
+
*
|
|
3711
|
+
* @param priceIds Array of hex-encoded price ids.
|
|
3712
|
+
* @returns Array of PriceFeeds
|
|
3713
|
+
*/
|
|
3714
|
+
async getLatestPriceFeeds(t) {
|
|
3715
|
+
return t.length === 0 ? [] : (await this.httpClient.get("/api/latest_price_feeds", {
|
|
3716
|
+
params: {
|
|
3717
|
+
ids: t,
|
|
3718
|
+
verbose: this.priceFeedRequestConfig.verbose,
|
|
3719
|
+
binary: this.priceFeedRequestConfig.binary
|
|
3720
|
+
}
|
|
3721
|
+
})).data.map((c) => At.PriceFeed.fromJson(c));
|
|
3722
|
+
}
|
|
3723
|
+
/**
|
|
3724
|
+
* Fetch latest VAA of given price ids.
|
|
3725
|
+
* This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price ids)
|
|
3726
|
+
*
|
|
3727
|
+
* This function is coupled to wormhole implemntation.
|
|
3728
|
+
*
|
|
3729
|
+
* @param priceIds Array of hex-encoded price ids.
|
|
3730
|
+
* @returns Array of base64 encoded VAAs.
|
|
3731
|
+
*/
|
|
3732
|
+
async getLatestVaas(t) {
|
|
3733
|
+
return (await this.httpClient.get("/api/latest_vaas", {
|
|
3734
|
+
params: {
|
|
3735
|
+
ids: t
|
|
3736
|
+
}
|
|
3737
|
+
})).data;
|
|
3738
|
+
}
|
|
3739
|
+
/**
|
|
3740
|
+
* Fetch the earliest VAA of the given price id that is published since the given publish time.
|
|
3741
|
+
* This will throw an error if the given publish time is in the future, or if the publish time
|
|
3742
|
+
* is old and the price service endpoint does not have a db backend for historical requests.
|
|
3743
|
+
* This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price id)
|
|
3744
|
+
*
|
|
3745
|
+
* This function is coupled to wormhole implemntation.
|
|
3746
|
+
*
|
|
3747
|
+
* @param priceId Hex-encoded price id.
|
|
3748
|
+
* @param publishTime Epoch timestamp in seconds.
|
|
3749
|
+
* @returns Tuple of VAA and publishTime.
|
|
3750
|
+
*/
|
|
3751
|
+
async getVaa(t, i) {
|
|
3752
|
+
const o = await this.httpClient.get("/api/get_vaa", {
|
|
3753
|
+
params: {
|
|
3754
|
+
id: t,
|
|
3755
|
+
publish_time: i
|
|
3756
|
+
}
|
|
3757
|
+
});
|
|
3758
|
+
return [o.data.vaa, o.data.publishTime];
|
|
3759
|
+
}
|
|
3760
|
+
/**
|
|
3761
|
+
* Fetch the PriceFeed of the given price id that is published since the given publish time.
|
|
3762
|
+
* This will throw an error if the given publish time is in the future, or if the publish time
|
|
3763
|
+
* is old and the price service endpoint does not have a db backend for historical requests.
|
|
3764
|
+
* This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price id)
|
|
3765
|
+
*
|
|
3766
|
+
* @param priceId Hex-encoded price id.
|
|
3767
|
+
* @param publishTime Epoch timestamp in seconds.
|
|
3768
|
+
* @returns PriceFeed
|
|
3769
|
+
*/
|
|
3770
|
+
async getPriceFeed(t, i) {
|
|
3771
|
+
const o = await this.httpClient.get("/api/get_price_feed", {
|
|
3772
|
+
params: {
|
|
3773
|
+
id: t,
|
|
3774
|
+
publish_time: i,
|
|
3775
|
+
verbose: this.priceFeedRequestConfig.verbose,
|
|
3776
|
+
binary: this.priceFeedRequestConfig.binary
|
|
3777
|
+
}
|
|
3778
|
+
});
|
|
3779
|
+
return At.PriceFeed.fromJson(o.data);
|
|
3780
|
+
}
|
|
3781
|
+
/**
|
|
3782
|
+
* Fetch the list of available price feed ids.
|
|
3783
|
+
* This will throw an axios error if there is a network problem or the price service returns a non-ok response.
|
|
3784
|
+
*
|
|
3785
|
+
* @returns Array of hex-encoded price ids.
|
|
3786
|
+
*/
|
|
3787
|
+
async getPriceFeedIds() {
|
|
3788
|
+
return (await this.httpClient.get("/api/price_feed_ids")).data;
|
|
3789
|
+
}
|
|
3790
|
+
/**
|
|
3791
|
+
* Subscribe to updates for given price ids.
|
|
3792
|
+
*
|
|
3793
|
+
* It will start a websocket connection if it's not started yet.
|
|
3794
|
+
* Also, it won't throw any exception if given price ids are invalid or connection errors. Instead,
|
|
3795
|
+
* it calls `connection.onWsError`. If you want to handle the errors you should set the
|
|
3796
|
+
* `onWsError` function to your custom error handler.
|
|
3797
|
+
*
|
|
3798
|
+
* @param priceIds Array of hex-encoded price ids.
|
|
3799
|
+
* @param cb Callback function that is called with a PriceFeed upon updates to given price ids.
|
|
3800
|
+
*/
|
|
3801
|
+
async subscribePriceFeedUpdates(t, i) {
|
|
3802
|
+
var l;
|
|
3803
|
+
this.wsClient === void 0 && await this.startWebSocket(), t = t.map((f) => (0, Bt.removeLeading0xIfExists)(f));
|
|
3804
|
+
const o = [];
|
|
3805
|
+
for (const f of t)
|
|
3806
|
+
this.priceFeedCallbacks.has(f) || (this.priceFeedCallbacks.set(f, /* @__PURE__ */ new Set()), o.push(f)), this.priceFeedCallbacks.get(f).add(i);
|
|
3807
|
+
const c = {
|
|
3808
|
+
ids: o,
|
|
3809
|
+
type: "subscribe",
|
|
3810
|
+
verbose: this.priceFeedRequestConfig.verbose,
|
|
3811
|
+
binary: this.priceFeedRequestConfig.binary,
|
|
3812
|
+
allow_out_of_order: this.priceFeedRequestConfig.allowOutOfOrder
|
|
3813
|
+
};
|
|
3814
|
+
await ((l = this.wsClient) == null ? void 0 : l.send(JSON.stringify(c)));
|
|
3815
|
+
}
|
|
3816
|
+
/**
|
|
3817
|
+
* Unsubscribe from updates for given price ids.
|
|
3818
|
+
*
|
|
3819
|
+
* It will close the websocket connection if it's not subscribed to any price feed updates anymore.
|
|
3820
|
+
* Also, it won't throw any exception if given price ids are invalid or connection errors. Instead,
|
|
3821
|
+
* it calls `connection.onWsError`. If you want to handle the errors you should set the
|
|
3822
|
+
* `onWsError` function to your custom error handler.
|
|
3823
|
+
*
|
|
3824
|
+
* @param priceIds Array of hex-encoded price ids.
|
|
3825
|
+
* @param cb Optional callback, if set it will only unsubscribe this callback from updates for given price ids.
|
|
3826
|
+
*/
|
|
3827
|
+
async unsubscribePriceFeedUpdates(t, i) {
|
|
3828
|
+
var l;
|
|
3829
|
+
this.wsClient === void 0 && await this.startWebSocket(), t = t.map((f) => (0, Bt.removeLeading0xIfExists)(f));
|
|
3830
|
+
const o = [];
|
|
3831
|
+
for (const f of t)
|
|
3832
|
+
if (this.priceFeedCallbacks.has(f)) {
|
|
3833
|
+
let u = !1;
|
|
3834
|
+
i === void 0 ? (this.priceFeedCallbacks.delete(f), u = !0) : (this.priceFeedCallbacks.get(f).delete(i), this.priceFeedCallbacks.get(f).size === 0 && (this.priceFeedCallbacks.delete(f), u = !0)), u && o.push(f);
|
|
3835
|
+
}
|
|
3836
|
+
const c = {
|
|
3837
|
+
ids: o,
|
|
3838
|
+
type: "unsubscribe"
|
|
3839
|
+
};
|
|
3840
|
+
await ((l = this.wsClient) == null ? void 0 : l.send(JSON.stringify(c))), this.priceFeedCallbacks.size === 0 && this.closeWebSocket();
|
|
3841
|
+
}
|
|
3842
|
+
/**
|
|
3843
|
+
* Starts connection websocket.
|
|
3844
|
+
*
|
|
3845
|
+
* This function is called automatically upon subscribing to price feed updates.
|
|
3846
|
+
*/
|
|
3847
|
+
async startWebSocket() {
|
|
3848
|
+
if (this.wsEndpoint === void 0)
|
|
3849
|
+
throw new Error("Websocket endpoint is undefined.");
|
|
3850
|
+
this.wsClient = new uo.ResilientWebSocket(this.wsEndpoint, this.logger), this.wsClient.onError = this.onWsError, this.wsClient.onReconnect = () => {
|
|
3851
|
+
var t;
|
|
3852
|
+
if (this.priceFeedCallbacks.size > 0) {
|
|
3853
|
+
const i = {
|
|
3854
|
+
ids: Array.from(this.priceFeedCallbacks.keys()),
|
|
3855
|
+
type: "subscribe",
|
|
3856
|
+
verbose: this.priceFeedRequestConfig.verbose,
|
|
3857
|
+
binary: this.priceFeedRequestConfig.binary,
|
|
3858
|
+
allow_out_of_order: this.priceFeedRequestConfig.allowOutOfOrder
|
|
3859
|
+
};
|
|
3860
|
+
this.logger.info("Resubscribing to existing price feeds."), (t = this.wsClient) == null || t.send(JSON.stringify(i));
|
|
3861
|
+
}
|
|
3862
|
+
}, this.wsClient.onMessage = (t) => {
|
|
3863
|
+
this.logger.info(`Received message ${t.toString()}`);
|
|
3864
|
+
let i;
|
|
3865
|
+
try {
|
|
3866
|
+
i = JSON.parse(t.toString());
|
|
3867
|
+
} catch (o) {
|
|
3868
|
+
this.logger.error(`Error parsing message ${t.toString()} as JSON.`), this.logger.error(o), this.onWsError(o);
|
|
3869
|
+
return;
|
|
3870
|
+
}
|
|
3871
|
+
if (i.type === "response")
|
|
3872
|
+
i.status === "error" && (this.logger.error(`Error response from the websocket server ${i.error}.`), this.onWsError(new Error(i.error)));
|
|
3873
|
+
else if (i.type === "price_update") {
|
|
3874
|
+
let o;
|
|
3875
|
+
try {
|
|
3876
|
+
o = At.PriceFeed.fromJson(i.price_feed);
|
|
3877
|
+
} catch (c) {
|
|
3878
|
+
this.logger.error(`Error parsing price feeds from message ${t.toString()}.`), this.logger.error(c), this.onWsError(c);
|
|
3879
|
+
return;
|
|
3880
|
+
}
|
|
3881
|
+
if (this.priceFeedCallbacks.has(o.id))
|
|
3882
|
+
for (const c of this.priceFeedCallbacks.get(o.id))
|
|
3883
|
+
c(o);
|
|
3884
|
+
} else
|
|
3885
|
+
this.logger.warn(`Ignoring unsupported server response ${t.toString()}.`);
|
|
3886
|
+
}, await this.wsClient.startWebSocket();
|
|
3887
|
+
}
|
|
3888
|
+
/**
|
|
3889
|
+
* Closes connection websocket.
|
|
3890
|
+
*
|
|
3891
|
+
* At termination, the websocket should be closed to finish the
|
|
3892
|
+
* process elegantly. It will automatically close when the connection
|
|
3893
|
+
* is subscribed to no price feeds.
|
|
3894
|
+
*/
|
|
3895
|
+
closeWebSocket() {
|
|
3896
|
+
var t;
|
|
3897
|
+
(t = this.wsClient) == null || t.closeWebSocket(), this.wsClient = void 0, this.priceFeedCallbacks.clear();
|
|
3898
|
+
}
|
|
3899
|
+
}
|
|
3900
|
+
Ge.PriceServiceConnection = fo;
|
|
3901
|
+
(function(e) {
|
|
3902
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.Price = e.PriceFeed = e.PriceFeedMetadata = e.PriceServiceConnection = void 0;
|
|
3903
|
+
var t = Ge;
|
|
3904
|
+
Object.defineProperty(e, "PriceServiceConnection", { enumerable: !0, get: function() {
|
|
3905
|
+
return t.PriceServiceConnection;
|
|
3906
|
+
} });
|
|
3907
|
+
var i = oe;
|
|
3908
|
+
Object.defineProperty(e, "PriceFeedMetadata", { enumerable: !0, get: function() {
|
|
3909
|
+
return i.PriceFeedMetadata;
|
|
3910
|
+
} }), Object.defineProperty(e, "PriceFeed", { enumerable: !0, get: function() {
|
|
3911
|
+
return i.PriceFeed;
|
|
3912
|
+
} }), Object.defineProperty(e, "Price", { enumerable: !0, get: function() {
|
|
3913
|
+
return i.Price;
|
|
3914
|
+
} });
|
|
3915
|
+
})(vt);
|
|
3916
|
+
Object.defineProperty(ze, "__esModule", { value: !0 });
|
|
3917
|
+
ze.EvmPriceServiceConnection = void 0;
|
|
3918
|
+
const lo = vt, po = br;
|
|
3919
|
+
class ho extends lo.PriceServiceConnection {
|
|
3920
|
+
/**
|
|
3921
|
+
* Gets price update data which then can be submitted to Pyth contract to update the prices.
|
|
3922
|
+
* This will throw an axios error if there is a network problem or the price service returns a non-ok response (e.g: Invalid price ids)
|
|
3923
|
+
*
|
|
3924
|
+
* @param priceIds Array of hex-encoded price ids.
|
|
3925
|
+
* @returns Array of price update data.
|
|
3926
|
+
*/
|
|
3927
|
+
async getPriceFeedsUpdateData(t) {
|
|
3928
|
+
return (await this.getLatestVaas(t)).map((o) => "0x" + po.Buffer.from(o, "base64").toString("hex"));
|
|
3929
|
+
}
|
|
3930
|
+
}
|
|
3931
|
+
ze.EvmPriceServiceConnection = ho;
|
|
3932
|
+
(function(e) {
|
|
3933
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.CONTRACT_ADDR = e.PriceFeed = e.Price = e.EvmPriceServiceConnection = void 0;
|
|
3934
|
+
var t = ze;
|
|
3935
|
+
Object.defineProperty(e, "EvmPriceServiceConnection", { enumerable: !0, get: function() {
|
|
3936
|
+
return t.EvmPriceServiceConnection;
|
|
3937
|
+
} });
|
|
3938
|
+
var i = vt;
|
|
3939
|
+
Object.defineProperty(e, "Price", { enumerable: !0, get: function() {
|
|
3940
|
+
return i.Price;
|
|
3941
|
+
} }), Object.defineProperty(e, "PriceFeed", { enumerable: !0, get: function() {
|
|
3942
|
+
return i.PriceFeed;
|
|
3943
|
+
} }), e.CONTRACT_ADDR = {
|
|
3944
|
+
// Mainnets
|
|
3945
|
+
arbitrum: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",
|
|
3946
|
+
astar_zkevm: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3947
|
+
aurora: "0xF89C7b475821EC3fDC2dC8099032c05c6c0c9AB9",
|
|
3948
|
+
avalanche: "0x4305FB66699C3B2702D4d05CF36551390A4c69C6",
|
|
3949
|
+
blast: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3950
|
+
bnb: "0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",
|
|
3951
|
+
base: "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a",
|
|
3952
|
+
boba: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
|
|
3953
|
+
bttc: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3954
|
+
canto: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
|
|
3955
|
+
celo: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",
|
|
3956
|
+
chiliz: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3957
|
+
conflux_espace: "0xe9d69CdD6Fe41e7B621B4A688C5D1a68cB5c8ADc",
|
|
3958
|
+
core_dao: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3959
|
+
cronos: "0xE0d0e68297772Dd5a1f1D99897c581E2082dbA5B",
|
|
3960
|
+
eos: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3961
|
+
evmos: "0x354bF866A4B006C9AF9d9e06d9364217A8616E12",
|
|
3962
|
+
ethereum: "0x4305FB66699C3B2702D4d05CF36551390A4c69C6",
|
|
3963
|
+
fantom: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",
|
|
3964
|
+
filecoin: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3965
|
+
gnosis: "0x2880aB155794e7179c9eE2e38200202908C17B43",
|
|
3966
|
+
hedera: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3967
|
+
horizen_eon: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3968
|
+
injective_inevm: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3969
|
+
kava: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3970
|
+
lightlink: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3971
|
+
linea: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3972
|
+
manta: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3973
|
+
mantle: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3974
|
+
merlin: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3975
|
+
meter: "0xbFe3f445653f2136b2FD1e6DdDb5676392E3AF16",
|
|
3976
|
+
mode: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3977
|
+
neon: "0x7f2dB085eFC3560AFF33865dD727225d91B4f9A5",
|
|
3978
|
+
optimism: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",
|
|
3979
|
+
polygon: "0xff1a0f4744e8582DF1aE09D5611b887B6a12925C",
|
|
3980
|
+
polygon_zkevm: "0xC5E56d6b40F3e3B5fbfa266bCd35C37426537c65",
|
|
3981
|
+
ronin: "0x2880aB155794e7179c9eE2e38200202908C17B43",
|
|
3982
|
+
scroll: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3983
|
+
shimmer: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3984
|
+
viction: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3985
|
+
wemix: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3986
|
+
zetachain: "0x2880aB155794e7179c9eE2e38200202908C17B43",
|
|
3987
|
+
zkfair: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3988
|
+
zksync_era: "0xf087c864AEccFb6A2Bf1Af6A0382B0d0f6c5D834",
|
|
3989
|
+
// Testnets (Stable sources)
|
|
3990
|
+
arbitrum_sepolia: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
|
|
3991
|
+
astar_zkevm_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933",
|
|
3992
|
+
aurora_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",
|
|
3993
|
+
bnb_testnet: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
|
|
3994
|
+
base_sepolia: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3995
|
+
berachain_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933",
|
|
3996
|
+
blast_s2_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3997
|
+
boba_goerli: "0x8D254a21b3C86D32F7179855531CE99164721933",
|
|
3998
|
+
bttc_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
3999
|
+
cant_testnet: "0x26DD80569a8B23768A1d80869Ed7339e07595E85",
|
|
4000
|
+
celo_alfajores: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",
|
|
4001
|
+
chiado: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
|
|
4002
|
+
chiliz_testnet: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
|
|
4003
|
+
conflux_espace_testnet: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",
|
|
4004
|
+
core_dao_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933",
|
|
4005
|
+
cronos_testnet: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
|
|
4006
|
+
dela_deperp_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4007
|
+
eos_testnet: "0x0708325268dF9F66270F1401206434524814508b",
|
|
4008
|
+
evmos_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",
|
|
4009
|
+
fantom_sonic_testnet: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320",
|
|
4010
|
+
fantom_testnet: "0x5744Cbf430D99456a0A8771208b674F27f8EF0Fb",
|
|
4011
|
+
filecoin_calibration: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4012
|
+
fuji: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
|
|
4013
|
+
hedera_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4014
|
+
idex_xchain_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4015
|
+
injective_inevm_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4016
|
+
kcc_testnet: "0x74f09cb3c7e2A01865f424FD14F6dc9A14E3e94E",
|
|
4017
|
+
kava_testnet: "0xfA25E653b44586dBbe27eE9d252192F0e4956683",
|
|
4018
|
+
lightlink_pegasus_testnet: "0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",
|
|
4019
|
+
linea_goerli: "0xdF21D137Aadc95588205586636710ca2890538d5",
|
|
4020
|
+
manta_testnet: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",
|
|
4021
|
+
manta_sepolia: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4022
|
+
mantle_sepolia: "0x98046Bd286715D3B0BC227Dd7a956b83D8978603",
|
|
4023
|
+
merlin_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4024
|
+
meter_testnet: "0x5a71C07a0588074443545eE0c08fb0375564c3E4",
|
|
4025
|
+
mode_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4026
|
+
movement_evm_devnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4027
|
+
mumbai: "0xFC6bd9F9f0c6481c6Af3A7Eb46b296A5B85ed379",
|
|
4028
|
+
neon_devnet: "0x0708325268dF9F66270F1401206434524814508b",
|
|
4029
|
+
optimism_goerli: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",
|
|
4030
|
+
optimism_sepolia: "0x0708325268dF9F66270F1401206434524814508b",
|
|
4031
|
+
polygon_zkevm_testnet: "0xFf255f800044225f54Af4510332Aa3D67CC77635",
|
|
4032
|
+
saigon: "0xEbe57e8045F2F230872523bbff7374986E45C486",
|
|
4033
|
+
sei_evm_devnet: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
|
|
4034
|
+
scroll_sepolia: "0x41c9e39574F40Ad34c79f1C99B66A45eFB830d4c",
|
|
4035
|
+
sepolia: "0xDd24F84d36BF92C65F92307595335bdFab5Bbd21",
|
|
4036
|
+
shimmer_testnet: "0x8D254a21b3C86D32F7179855531CE99164721933",
|
|
4037
|
+
viction_testnet: "0x5D289Ad1CE59fCC25b6892e7A303dfFf3a9f7167",
|
|
4038
|
+
wemix_testnet: "0x26DD80569a8B23768A1d80869Ed7339e07595E85",
|
|
4039
|
+
zetachain_testnet: "0x0708325268dF9F66270F1401206434524814508b",
|
|
4040
|
+
zkfair_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729",
|
|
4041
|
+
zksync_era_goerli: "0x8739d5024B5143278E2b15Bd9e7C26f6CEc658F1",
|
|
4042
|
+
zksync_era_sepolia: "0x056f829183Ec806A78c26C98961678c24faB71af",
|
|
4043
|
+
// Testnets (Beta sources)
|
|
4044
|
+
horizen_gobi_testnet: "0xA2aa501b19aff244D90cc15a4Cf739D2725B5729"
|
|
4045
|
+
};
|
|
4046
|
+
})(gr);
|
|
4047
|
+
class _o {
|
|
4048
|
+
constructor(t) {
|
|
4049
|
+
this.connection = new gr.EvmPriceServiceConnection(t);
|
|
4050
|
+
}
|
|
4051
|
+
getOracleId() {
|
|
4052
|
+
return "PYTH";
|
|
4053
|
+
}
|
|
4054
|
+
async fetchOffchainData(t, i, o) {
|
|
4055
|
+
const [c] = at(
|
|
4056
|
+
[{ name: "updateType", type: "uint8" }],
|
|
4057
|
+
o
|
|
4058
|
+
);
|
|
4059
|
+
if (c === 1) {
|
|
4060
|
+
const [l, f, u] = at(
|
|
4061
|
+
[
|
|
4062
|
+
{ name: "updateType", type: "uint8" },
|
|
4063
|
+
{ name: "stalenessTolerance", type: "uint64" },
|
|
4064
|
+
{ name: "priceIds", type: "bytes32[]" }
|
|
4065
|
+
],
|
|
4066
|
+
o
|
|
4067
|
+
), E = f, g = await this.connection.getPriceFeedsUpdateData(
|
|
4068
|
+
u
|
|
4069
|
+
);
|
|
4070
|
+
return Kt(
|
|
4071
|
+
[
|
|
4072
|
+
{ type: "uint8", name: "updateType" },
|
|
4073
|
+
{ type: "uint64", name: "stalenessTolerance" },
|
|
4074
|
+
{ type: "bytes32[]", name: "priceIds" },
|
|
4075
|
+
{ type: "bytes[]", name: "updateData" }
|
|
4076
|
+
],
|
|
4077
|
+
[l, E, u, g]
|
|
4078
|
+
);
|
|
4079
|
+
} else if (c === 2) {
|
|
4080
|
+
const [l, f, u] = at(
|
|
4081
|
+
[
|
|
4082
|
+
{ name: "updateType", type: "uint8" },
|
|
4083
|
+
{ name: "requestedTime", type: "uint64" },
|
|
4084
|
+
{ name: "priceIds", type: "bytes32" }
|
|
4085
|
+
],
|
|
4086
|
+
o
|
|
4087
|
+
), [E] = await this.connection.getVaa(
|
|
4088
|
+
u,
|
|
4089
|
+
Number(f.toString())
|
|
4090
|
+
), g = "0x" + Buffer.from(E, "base64").toString("hex");
|
|
4091
|
+
return Kt(
|
|
4092
|
+
[
|
|
4093
|
+
{ type: "uint8", name: "updateType" },
|
|
4094
|
+
{ type: "uint64", name: "timestamp" },
|
|
4095
|
+
{ type: "bytes32[]", name: "priceIds" },
|
|
4096
|
+
{ type: "bytes[]", name: "updateData" }
|
|
4097
|
+
],
|
|
4098
|
+
[l, f, [u], [g]]
|
|
4099
|
+
);
|
|
4100
|
+
} else
|
|
4101
|
+
throw new Error(`update type ${c} not supported`);
|
|
4102
|
+
}
|
|
4103
|
+
}
|
|
4104
|
+
export {
|
|
4105
|
+
_o as PythAdapter
|
|
4106
|
+
};
|