eth-graph-query 2.0.1 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -90
- package/dist/.vite/manifest.json +8 -0
- package/dist/api-query.d.ts +67 -0
- package/dist/eth-graph-query.d.ts +41 -0
- package/dist/index.cjs +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2072 -0
- package/dist/query-builder.d.ts +56 -0
- package/dist/type.d.ts +149 -0
- package/package.json +35 -50
- package/dist/cjs/eth-graph-query.d.ts +0 -35
- package/dist/cjs/eth-graph-query.d.ts.map +0 -1
- package/dist/cjs/eth-graph-query.js +0 -69
- package/dist/cjs/eth-graph-query.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -4
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -22
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/normal-query.d.ts +0 -15
- package/dist/cjs/normal-query.d.ts.map +0 -1
- package/dist/cjs/normal-query.js +0 -65
- package/dist/cjs/normal-query.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/query-builder.d.ts +0 -52
- package/dist/cjs/query-builder.d.ts.map +0 -1
- package/dist/cjs/query-builder.js +0 -238
- package/dist/cjs/query-builder.js.map +0 -1
- package/dist/cjs/type.d.ts +0 -67
- package/dist/cjs/type.d.ts.map +0 -1
- package/dist/cjs/type.js +0 -25
- package/dist/cjs/type.js.map +0 -1
- package/dist/esm/eth-graph-query.d.ts +0 -35
- package/dist/esm/eth-graph-query.d.ts.map +0 -1
- package/dist/esm/eth-graph-query.js +0 -65
- package/dist/esm/eth-graph-query.js.map +0 -1
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/normal-query.d.ts +0 -15
- package/dist/esm/normal-query.d.ts.map +0 -1
- package/dist/esm/normal-query.js +0 -58
- package/dist/esm/normal-query.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/query-builder.d.ts +0 -52
- package/dist/esm/query-builder.d.ts.map +0 -1
- package/dist/esm/query-builder.js +0 -234
- package/dist/esm/query-builder.js.map +0 -1
- package/dist/esm/type.d.ts +0 -67
- package/dist/esm/type.d.ts.map +0 -1
- package/dist/esm/type.js +0 -22
- package/dist/esm/type.js.map +0 -1
- package/dist/tsconfig.prod.cjs.tsbuildinfo +0 -1
- package/dist/tsconfig.prod.esm.tsbuildinfo +0 -1
- package/src/eth-graph-query.ts +0 -61
- package/src/index.ts +0 -3
- package/src/normal-query.ts +0 -46
- package/src/query-builder.ts +0 -216
- package/src/type.ts +0 -89
package/dist/index.js
ADDED
|
@@ -0,0 +1,2072 @@
|
|
|
1
|
+
function Je(t, e) {
|
|
2
|
+
return function() {
|
|
3
|
+
return t.apply(e, arguments);
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
const { toString: mt } = Object.prototype, { getPrototypeOf: we } = Object, { iterator: se, toStringTag: ze } = Symbol, oe = /* @__PURE__ */ ((t) => (e) => {
|
|
7
|
+
const n = mt.call(e);
|
|
8
|
+
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
9
|
+
})(/* @__PURE__ */ Object.create(null)), F = (t) => (t = t.toLowerCase(), (e) => oe(e) === t), ie = (t) => (e) => typeof e === t, { isArray: I } = Array, M = ie("undefined");
|
|
10
|
+
function z(t) {
|
|
11
|
+
return t !== null && !M(t) && t.constructor !== null && !M(t.constructor) && A(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
12
|
+
}
|
|
13
|
+
const Ve = F("ArrayBuffer");
|
|
14
|
+
function yt(t) {
|
|
15
|
+
let e;
|
|
16
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Ve(t.buffer), e;
|
|
17
|
+
}
|
|
18
|
+
const bt = ie("string"), A = ie("function"), ve = ie("number"), V = (t) => t !== null && typeof t == "object", wt = (t) => t === !0 || t === !1, ee = (t) => {
|
|
19
|
+
if (oe(t) !== "object")
|
|
20
|
+
return !1;
|
|
21
|
+
const e = we(t);
|
|
22
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(ze in t) && !(se in t);
|
|
23
|
+
}, gt = (t) => {
|
|
24
|
+
if (!V(t) || z(t))
|
|
25
|
+
return !1;
|
|
26
|
+
try {
|
|
27
|
+
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
28
|
+
} catch {
|
|
29
|
+
return !1;
|
|
30
|
+
}
|
|
31
|
+
}, Et = F("Date"), St = F("File"), Rt = F("Blob"), Ot = F("FileList"), At = (t) => V(t) && A(t.pipe), Tt = (t) => {
|
|
32
|
+
let e;
|
|
33
|
+
return t && (typeof FormData == "function" && t instanceof FormData || A(t.append) && ((e = oe(t)) === "formdata" || // detect form-data instance
|
|
34
|
+
e === "object" && A(t.toString) && t.toString() === "[object FormData]"));
|
|
35
|
+
}, xt = F("URLSearchParams"), [_t, Ct, Ft, Nt] = ["ReadableStream", "Request", "Response", "Headers"].map(F), kt = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
36
|
+
function v(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
37
|
+
if (t === null || typeof t > "u")
|
|
38
|
+
return;
|
|
39
|
+
let r, s;
|
|
40
|
+
if (typeof t != "object" && (t = [t]), I(t))
|
|
41
|
+
for (r = 0, s = t.length; r < s; r++)
|
|
42
|
+
e.call(null, t[r], r, t);
|
|
43
|
+
else {
|
|
44
|
+
if (z(t))
|
|
45
|
+
return;
|
|
46
|
+
const o = n ? Object.getOwnPropertyNames(t) : Object.keys(t), i = o.length;
|
|
47
|
+
let c;
|
|
48
|
+
for (r = 0; r < i; r++)
|
|
49
|
+
c = o[r], e.call(null, t[c], c, t);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function We(t, e) {
|
|
53
|
+
if (z(t))
|
|
54
|
+
return null;
|
|
55
|
+
e = e.toLowerCase();
|
|
56
|
+
const n = Object.keys(t);
|
|
57
|
+
let r = n.length, s;
|
|
58
|
+
for (; r-- > 0; )
|
|
59
|
+
if (s = n[r], e === s.toLowerCase())
|
|
60
|
+
return s;
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const j = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ke = (t) => !M(t) && t !== j;
|
|
64
|
+
function pe() {
|
|
65
|
+
const { caseless: t, skipUndefined: e } = Ke(this) && this || {}, n = {}, r = (s, o) => {
|
|
66
|
+
const i = t && We(n, o) || o;
|
|
67
|
+
ee(n[i]) && ee(s) ? n[i] = pe(n[i], s) : ee(s) ? n[i] = pe({}, s) : I(s) ? n[i] = s.slice() : (!e || !M(s)) && (n[i] = s);
|
|
68
|
+
};
|
|
69
|
+
for (let s = 0, o = arguments.length; s < o; s++)
|
|
70
|
+
arguments[s] && v(arguments[s], r);
|
|
71
|
+
return n;
|
|
72
|
+
}
|
|
73
|
+
const Pt = (t, e, n, { allOwnKeys: r } = {}) => (v(e, (s, o) => {
|
|
74
|
+
n && A(s) ? t[o] = Je(s, n) : t[o] = s;
|
|
75
|
+
}, { allOwnKeys: r }), t), Ut = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), Lt = (t, e, n, r) => {
|
|
76
|
+
t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
77
|
+
value: e.prototype
|
|
78
|
+
}), n && Object.assign(t.prototype, n);
|
|
79
|
+
}, $t = (t, e, n, r) => {
|
|
80
|
+
let s, o, i;
|
|
81
|
+
const c = {};
|
|
82
|
+
if (e = e || {}, t == null) return e;
|
|
83
|
+
do {
|
|
84
|
+
for (s = Object.getOwnPropertyNames(t), o = s.length; o-- > 0; )
|
|
85
|
+
i = s[o], (!r || r(i, t, e)) && !c[i] && (e[i] = t[i], c[i] = !0);
|
|
86
|
+
t = n !== !1 && we(t);
|
|
87
|
+
} while (t && (!n || n(t, e)) && t !== Object.prototype);
|
|
88
|
+
return e;
|
|
89
|
+
}, jt = (t, e, n) => {
|
|
90
|
+
t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
|
|
91
|
+
const r = t.indexOf(e, n);
|
|
92
|
+
return r !== -1 && r === n;
|
|
93
|
+
}, Bt = (t) => {
|
|
94
|
+
if (!t) return null;
|
|
95
|
+
if (I(t)) return t;
|
|
96
|
+
let e = t.length;
|
|
97
|
+
if (!ve(e)) return null;
|
|
98
|
+
const n = new Array(e);
|
|
99
|
+
for (; e-- > 0; )
|
|
100
|
+
n[e] = t[e];
|
|
101
|
+
return n;
|
|
102
|
+
}, Dt = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && we(Uint8Array)), qt = (t, e) => {
|
|
103
|
+
const r = (t && t[se]).call(t);
|
|
104
|
+
let s;
|
|
105
|
+
for (; (s = r.next()) && !s.done; ) {
|
|
106
|
+
const o = s.value;
|
|
107
|
+
e.call(t, o[0], o[1]);
|
|
108
|
+
}
|
|
109
|
+
}, Mt = (t, e) => {
|
|
110
|
+
let n;
|
|
111
|
+
const r = [];
|
|
112
|
+
for (; (n = t.exec(e)) !== null; )
|
|
113
|
+
r.push(n);
|
|
114
|
+
return r;
|
|
115
|
+
}, It = F("HTMLFormElement"), Ht = (t) => t.toLowerCase().replace(
|
|
116
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
117
|
+
function(n, r, s) {
|
|
118
|
+
return r.toUpperCase() + s;
|
|
119
|
+
}
|
|
120
|
+
), Ce = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), Qt = F("RegExp"), Xe = (t, e) => {
|
|
121
|
+
const n = Object.getOwnPropertyDescriptors(t), r = {};
|
|
122
|
+
v(n, (s, o) => {
|
|
123
|
+
let i;
|
|
124
|
+
(i = e(s, o, t)) !== !1 && (r[o] = i || s);
|
|
125
|
+
}), Object.defineProperties(t, r);
|
|
126
|
+
}, Jt = (t) => {
|
|
127
|
+
Xe(t, (e, n) => {
|
|
128
|
+
if (A(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
129
|
+
return !1;
|
|
130
|
+
const r = t[n];
|
|
131
|
+
if (A(r)) {
|
|
132
|
+
if (e.enumerable = !1, "writable" in e) {
|
|
133
|
+
e.writable = !1;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
e.set || (e.set = () => {
|
|
137
|
+
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}, zt = (t, e) => {
|
|
142
|
+
const n = {}, r = (s) => {
|
|
143
|
+
s.forEach((o) => {
|
|
144
|
+
n[o] = !0;
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
return I(t) ? r(t) : r(String(t).split(e)), n;
|
|
148
|
+
}, Vt = () => {
|
|
149
|
+
}, vt = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
150
|
+
function Wt(t) {
|
|
151
|
+
return !!(t && A(t.append) && t[ze] === "FormData" && t[se]);
|
|
152
|
+
}
|
|
153
|
+
const Kt = (t) => {
|
|
154
|
+
const e = new Array(10), n = (r, s) => {
|
|
155
|
+
if (V(r)) {
|
|
156
|
+
if (e.indexOf(r) >= 0)
|
|
157
|
+
return;
|
|
158
|
+
if (z(r))
|
|
159
|
+
return r;
|
|
160
|
+
if (!("toJSON" in r)) {
|
|
161
|
+
e[s] = r;
|
|
162
|
+
const o = I(r) ? [] : {};
|
|
163
|
+
return v(r, (i, c) => {
|
|
164
|
+
const d = n(i, s + 1);
|
|
165
|
+
!M(d) && (o[c] = d);
|
|
166
|
+
}), e[s] = void 0, o;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return r;
|
|
170
|
+
};
|
|
171
|
+
return n(t, 0);
|
|
172
|
+
}, Xt = F("AsyncFunction"), Gt = (t) => t && (V(t) || A(t)) && A(t.then) && A(t.catch), Ge = ((t, e) => t ? setImmediate : e ? ((n, r) => (j.addEventListener("message", ({ source: s, data: o }) => {
|
|
173
|
+
s === j && o === n && r.length && r.shift()();
|
|
174
|
+
}, !1), (s) => {
|
|
175
|
+
r.push(s), j.postMessage(n, "*");
|
|
176
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
177
|
+
typeof setImmediate == "function",
|
|
178
|
+
A(j.postMessage)
|
|
179
|
+
), Zt = typeof queueMicrotask < "u" ? queueMicrotask.bind(j) : typeof process < "u" && process.nextTick || Ge, Yt = (t) => t != null && A(t[se]), a = {
|
|
180
|
+
isArray: I,
|
|
181
|
+
isArrayBuffer: Ve,
|
|
182
|
+
isBuffer: z,
|
|
183
|
+
isFormData: Tt,
|
|
184
|
+
isArrayBufferView: yt,
|
|
185
|
+
isString: bt,
|
|
186
|
+
isNumber: ve,
|
|
187
|
+
isBoolean: wt,
|
|
188
|
+
isObject: V,
|
|
189
|
+
isPlainObject: ee,
|
|
190
|
+
isEmptyObject: gt,
|
|
191
|
+
isReadableStream: _t,
|
|
192
|
+
isRequest: Ct,
|
|
193
|
+
isResponse: Ft,
|
|
194
|
+
isHeaders: Nt,
|
|
195
|
+
isUndefined: M,
|
|
196
|
+
isDate: Et,
|
|
197
|
+
isFile: St,
|
|
198
|
+
isBlob: Rt,
|
|
199
|
+
isRegExp: Qt,
|
|
200
|
+
isFunction: A,
|
|
201
|
+
isStream: At,
|
|
202
|
+
isURLSearchParams: xt,
|
|
203
|
+
isTypedArray: Dt,
|
|
204
|
+
isFileList: Ot,
|
|
205
|
+
forEach: v,
|
|
206
|
+
merge: pe,
|
|
207
|
+
extend: Pt,
|
|
208
|
+
trim: kt,
|
|
209
|
+
stripBOM: Ut,
|
|
210
|
+
inherits: Lt,
|
|
211
|
+
toFlatObject: $t,
|
|
212
|
+
kindOf: oe,
|
|
213
|
+
kindOfTest: F,
|
|
214
|
+
endsWith: jt,
|
|
215
|
+
toArray: Bt,
|
|
216
|
+
forEachEntry: qt,
|
|
217
|
+
matchAll: Mt,
|
|
218
|
+
isHTMLForm: It,
|
|
219
|
+
hasOwnProperty: Ce,
|
|
220
|
+
hasOwnProp: Ce,
|
|
221
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
222
|
+
reduceDescriptors: Xe,
|
|
223
|
+
freezeMethods: Jt,
|
|
224
|
+
toObjectSet: zt,
|
|
225
|
+
toCamelCase: Ht,
|
|
226
|
+
noop: Vt,
|
|
227
|
+
toFiniteNumber: vt,
|
|
228
|
+
findKey: We,
|
|
229
|
+
global: j,
|
|
230
|
+
isContextDefined: Ke,
|
|
231
|
+
isSpecCompliantForm: Wt,
|
|
232
|
+
toJSONObject: Kt,
|
|
233
|
+
isAsyncFn: Xt,
|
|
234
|
+
isThenable: Gt,
|
|
235
|
+
setImmediate: Ge,
|
|
236
|
+
asap: Zt,
|
|
237
|
+
isIterable: Yt
|
|
238
|
+
};
|
|
239
|
+
function y(t, e, n, r, s) {
|
|
240
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
241
|
+
}
|
|
242
|
+
a.inherits(y, Error, {
|
|
243
|
+
toJSON: function() {
|
|
244
|
+
return {
|
|
245
|
+
// Standard
|
|
246
|
+
message: this.message,
|
|
247
|
+
name: this.name,
|
|
248
|
+
// Microsoft
|
|
249
|
+
description: this.description,
|
|
250
|
+
number: this.number,
|
|
251
|
+
// Mozilla
|
|
252
|
+
fileName: this.fileName,
|
|
253
|
+
lineNumber: this.lineNumber,
|
|
254
|
+
columnNumber: this.columnNumber,
|
|
255
|
+
stack: this.stack,
|
|
256
|
+
// Axios
|
|
257
|
+
config: a.toJSONObject(this.config),
|
|
258
|
+
code: this.code,
|
|
259
|
+
status: this.status
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
const Ze = y.prototype, Ye = {};
|
|
264
|
+
[
|
|
265
|
+
"ERR_BAD_OPTION_VALUE",
|
|
266
|
+
"ERR_BAD_OPTION",
|
|
267
|
+
"ECONNABORTED",
|
|
268
|
+
"ETIMEDOUT",
|
|
269
|
+
"ERR_NETWORK",
|
|
270
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
271
|
+
"ERR_DEPRECATED",
|
|
272
|
+
"ERR_BAD_RESPONSE",
|
|
273
|
+
"ERR_BAD_REQUEST",
|
|
274
|
+
"ERR_CANCELED",
|
|
275
|
+
"ERR_NOT_SUPPORT",
|
|
276
|
+
"ERR_INVALID_URL"
|
|
277
|
+
// eslint-disable-next-line func-names
|
|
278
|
+
].forEach((t) => {
|
|
279
|
+
Ye[t] = { value: t };
|
|
280
|
+
});
|
|
281
|
+
Object.defineProperties(y, Ye);
|
|
282
|
+
Object.defineProperty(Ze, "isAxiosError", { value: !0 });
|
|
283
|
+
y.from = (t, e, n, r, s, o) => {
|
|
284
|
+
const i = Object.create(Ze);
|
|
285
|
+
a.toFlatObject(t, i, function(l) {
|
|
286
|
+
return l !== Error.prototype;
|
|
287
|
+
}, (u) => u !== "isAxiosError");
|
|
288
|
+
const c = t && t.message ? t.message : "Error", d = e == null && t ? t.code : e;
|
|
289
|
+
return y.call(i, c, d, n, r, s), t && i.cause == null && Object.defineProperty(i, "cause", { value: t, configurable: !0 }), i.name = t && t.name || "Error", o && Object.assign(i, o), i;
|
|
290
|
+
};
|
|
291
|
+
const en = null;
|
|
292
|
+
function me(t) {
|
|
293
|
+
return a.isPlainObject(t) || a.isArray(t);
|
|
294
|
+
}
|
|
295
|
+
function et(t) {
|
|
296
|
+
return a.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
297
|
+
}
|
|
298
|
+
function Fe(t, e, n) {
|
|
299
|
+
return t ? t.concat(e).map(function(s, o) {
|
|
300
|
+
return s = et(s), !n && o ? "[" + s + "]" : s;
|
|
301
|
+
}).join(n ? "." : "") : e;
|
|
302
|
+
}
|
|
303
|
+
function tn(t) {
|
|
304
|
+
return a.isArray(t) && !t.some(me);
|
|
305
|
+
}
|
|
306
|
+
const nn = a.toFlatObject(a, {}, null, function(e) {
|
|
307
|
+
return /^is[A-Z]/.test(e);
|
|
308
|
+
});
|
|
309
|
+
function ae(t, e, n) {
|
|
310
|
+
if (!a.isObject(t))
|
|
311
|
+
throw new TypeError("target must be an object");
|
|
312
|
+
e = e || new FormData(), n = a.toFlatObject(n, {
|
|
313
|
+
metaTokens: !0,
|
|
314
|
+
dots: !1,
|
|
315
|
+
indexes: !1
|
|
316
|
+
}, !1, function(m, h) {
|
|
317
|
+
return !a.isUndefined(h[m]);
|
|
318
|
+
});
|
|
319
|
+
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(e);
|
|
320
|
+
if (!a.isFunction(s))
|
|
321
|
+
throw new TypeError("visitor must be a function");
|
|
322
|
+
function u(f) {
|
|
323
|
+
if (f === null) return "";
|
|
324
|
+
if (a.isDate(f))
|
|
325
|
+
return f.toISOString();
|
|
326
|
+
if (a.isBoolean(f))
|
|
327
|
+
return f.toString();
|
|
328
|
+
if (!d && a.isBlob(f))
|
|
329
|
+
throw new y("Blob is not supported. Use a Buffer instead.");
|
|
330
|
+
return a.isArrayBuffer(f) || a.isTypedArray(f) ? d && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
331
|
+
}
|
|
332
|
+
function l(f, m, h) {
|
|
333
|
+
let g = f;
|
|
334
|
+
if (f && !h && typeof f == "object") {
|
|
335
|
+
if (a.endsWith(m, "{}"))
|
|
336
|
+
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
337
|
+
else if (a.isArray(f) && tn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (g = a.toArray(f)))
|
|
338
|
+
return m = et(m), g.forEach(function(E, O) {
|
|
339
|
+
!(a.isUndefined(E) || E === null) && e.append(
|
|
340
|
+
// eslint-disable-next-line no-nested-ternary
|
|
341
|
+
i === !0 ? Fe([m], O, o) : i === null ? m : m + "[]",
|
|
342
|
+
u(E)
|
|
343
|
+
);
|
|
344
|
+
}), !1;
|
|
345
|
+
}
|
|
346
|
+
return me(f) ? !0 : (e.append(Fe(h, m, o), u(f)), !1);
|
|
347
|
+
}
|
|
348
|
+
const p = [], b = Object.assign(nn, {
|
|
349
|
+
defaultVisitor: l,
|
|
350
|
+
convertValue: u,
|
|
351
|
+
isVisitable: me
|
|
352
|
+
});
|
|
353
|
+
function S(f, m) {
|
|
354
|
+
if (!a.isUndefined(f)) {
|
|
355
|
+
if (p.indexOf(f) !== -1)
|
|
356
|
+
throw Error("Circular reference detected in " + m.join("."));
|
|
357
|
+
p.push(f), a.forEach(f, function(g, x) {
|
|
358
|
+
(!(a.isUndefined(g) || g === null) && s.call(
|
|
359
|
+
e,
|
|
360
|
+
g,
|
|
361
|
+
a.isString(x) ? x.trim() : x,
|
|
362
|
+
m,
|
|
363
|
+
b
|
|
364
|
+
)) === !0 && S(g, m ? m.concat(x) : [x]);
|
|
365
|
+
}), p.pop();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
if (!a.isObject(t))
|
|
369
|
+
throw new TypeError("data must be an object");
|
|
370
|
+
return S(t), e;
|
|
371
|
+
}
|
|
372
|
+
function Ne(t) {
|
|
373
|
+
const e = {
|
|
374
|
+
"!": "%21",
|
|
375
|
+
"'": "%27",
|
|
376
|
+
"(": "%28",
|
|
377
|
+
")": "%29",
|
|
378
|
+
"~": "%7E",
|
|
379
|
+
"%20": "+",
|
|
380
|
+
"%00": "\0"
|
|
381
|
+
};
|
|
382
|
+
return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
383
|
+
return e[r];
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
function ge(t, e) {
|
|
387
|
+
this._pairs = [], t && ae(t, this, e);
|
|
388
|
+
}
|
|
389
|
+
const tt = ge.prototype;
|
|
390
|
+
tt.append = function(e, n) {
|
|
391
|
+
this._pairs.push([e, n]);
|
|
392
|
+
};
|
|
393
|
+
tt.toString = function(e) {
|
|
394
|
+
const n = e ? function(r) {
|
|
395
|
+
return e.call(this, r, Ne);
|
|
396
|
+
} : Ne;
|
|
397
|
+
return this._pairs.map(function(s) {
|
|
398
|
+
return n(s[0]) + "=" + n(s[1]);
|
|
399
|
+
}, "").join("&");
|
|
400
|
+
};
|
|
401
|
+
function rn(t) {
|
|
402
|
+
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
403
|
+
}
|
|
404
|
+
function nt(t, e, n) {
|
|
405
|
+
if (!e)
|
|
406
|
+
return t;
|
|
407
|
+
const r = n && n.encode || rn;
|
|
408
|
+
a.isFunction(n) && (n = {
|
|
409
|
+
serialize: n
|
|
410
|
+
});
|
|
411
|
+
const s = n && n.serialize;
|
|
412
|
+
let o;
|
|
413
|
+
if (s ? o = s(e, n) : o = a.isURLSearchParams(e) ? e.toString() : new ge(e, n).toString(r), o) {
|
|
414
|
+
const i = t.indexOf("#");
|
|
415
|
+
i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
|
|
416
|
+
}
|
|
417
|
+
return t;
|
|
418
|
+
}
|
|
419
|
+
class ke {
|
|
420
|
+
constructor() {
|
|
421
|
+
this.handlers = [];
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Add a new interceptor to the stack
|
|
425
|
+
*
|
|
426
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
427
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
428
|
+
*
|
|
429
|
+
* @return {Number} An ID used to remove interceptor later
|
|
430
|
+
*/
|
|
431
|
+
use(e, n, r) {
|
|
432
|
+
return this.handlers.push({
|
|
433
|
+
fulfilled: e,
|
|
434
|
+
rejected: n,
|
|
435
|
+
synchronous: r ? r.synchronous : !1,
|
|
436
|
+
runWhen: r ? r.runWhen : null
|
|
437
|
+
}), this.handlers.length - 1;
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Remove an interceptor from the stack
|
|
441
|
+
*
|
|
442
|
+
* @param {Number} id The ID that was returned by `use`
|
|
443
|
+
*
|
|
444
|
+
* @returns {void}
|
|
445
|
+
*/
|
|
446
|
+
eject(e) {
|
|
447
|
+
this.handlers[e] && (this.handlers[e] = null);
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Clear all interceptors from the stack
|
|
451
|
+
*
|
|
452
|
+
* @returns {void}
|
|
453
|
+
*/
|
|
454
|
+
clear() {
|
|
455
|
+
this.handlers && (this.handlers = []);
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Iterate over all the registered interceptors
|
|
459
|
+
*
|
|
460
|
+
* This method is particularly useful for skipping over any
|
|
461
|
+
* interceptors that may have become `null` calling `eject`.
|
|
462
|
+
*
|
|
463
|
+
* @param {Function} fn The function to call for each interceptor
|
|
464
|
+
*
|
|
465
|
+
* @returns {void}
|
|
466
|
+
*/
|
|
467
|
+
forEach(e) {
|
|
468
|
+
a.forEach(this.handlers, function(r) {
|
|
469
|
+
r !== null && e(r);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
const rt = {
|
|
474
|
+
silentJSONParsing: !0,
|
|
475
|
+
forcedJSONParsing: !0,
|
|
476
|
+
clarifyTimeoutError: !1
|
|
477
|
+
}, sn = typeof URLSearchParams < "u" ? URLSearchParams : ge, on = typeof FormData < "u" ? FormData : null, an = typeof Blob < "u" ? Blob : null, cn = {
|
|
478
|
+
isBrowser: !0,
|
|
479
|
+
classes: {
|
|
480
|
+
URLSearchParams: sn,
|
|
481
|
+
FormData: on,
|
|
482
|
+
Blob: an
|
|
483
|
+
},
|
|
484
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
485
|
+
}, Ee = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, ln = Ee && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), un = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
486
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", fn = Ee && window.location.href || "http://localhost", dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
487
|
+
__proto__: null,
|
|
488
|
+
hasBrowserEnv: Ee,
|
|
489
|
+
hasStandardBrowserEnv: ln,
|
|
490
|
+
hasStandardBrowserWebWorkerEnv: un,
|
|
491
|
+
navigator: ye,
|
|
492
|
+
origin: fn
|
|
493
|
+
}, Symbol.toStringTag, { value: "Module" })), R = {
|
|
494
|
+
...dn,
|
|
495
|
+
...cn
|
|
496
|
+
};
|
|
497
|
+
function hn(t, e) {
|
|
498
|
+
return ae(t, new R.classes.URLSearchParams(), {
|
|
499
|
+
visitor: function(n, r, s, o) {
|
|
500
|
+
return R.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
501
|
+
},
|
|
502
|
+
...e
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
function pn(t) {
|
|
506
|
+
return a.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
507
|
+
}
|
|
508
|
+
function mn(t) {
|
|
509
|
+
const e = {}, n = Object.keys(t);
|
|
510
|
+
let r;
|
|
511
|
+
const s = n.length;
|
|
512
|
+
let o;
|
|
513
|
+
for (r = 0; r < s; r++)
|
|
514
|
+
o = n[r], e[o] = t[o];
|
|
515
|
+
return e;
|
|
516
|
+
}
|
|
517
|
+
function st(t) {
|
|
518
|
+
function e(n, r, s, o) {
|
|
519
|
+
let i = n[o++];
|
|
520
|
+
if (i === "__proto__") return !0;
|
|
521
|
+
const c = Number.isFinite(+i), d = o >= n.length;
|
|
522
|
+
return i = !i && a.isArray(s) ? s.length : i, d ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), e(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = mn(s[i])), !c);
|
|
523
|
+
}
|
|
524
|
+
if (a.isFormData(t) && a.isFunction(t.entries)) {
|
|
525
|
+
const n = {};
|
|
526
|
+
return a.forEachEntry(t, (r, s) => {
|
|
527
|
+
e(pn(r), s, n, 0);
|
|
528
|
+
}), n;
|
|
529
|
+
}
|
|
530
|
+
return null;
|
|
531
|
+
}
|
|
532
|
+
function yn(t, e, n) {
|
|
533
|
+
if (a.isString(t))
|
|
534
|
+
try {
|
|
535
|
+
return (e || JSON.parse)(t), a.trim(t);
|
|
536
|
+
} catch (r) {
|
|
537
|
+
if (r.name !== "SyntaxError")
|
|
538
|
+
throw r;
|
|
539
|
+
}
|
|
540
|
+
return (n || JSON.stringify)(t);
|
|
541
|
+
}
|
|
542
|
+
const W = {
|
|
543
|
+
transitional: rt,
|
|
544
|
+
adapter: ["xhr", "http", "fetch"],
|
|
545
|
+
transformRequest: [function(e, n) {
|
|
546
|
+
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(e);
|
|
547
|
+
if (o && a.isHTMLForm(e) && (e = new FormData(e)), a.isFormData(e))
|
|
548
|
+
return s ? JSON.stringify(st(e)) : e;
|
|
549
|
+
if (a.isArrayBuffer(e) || a.isBuffer(e) || a.isStream(e) || a.isFile(e) || a.isBlob(e) || a.isReadableStream(e))
|
|
550
|
+
return e;
|
|
551
|
+
if (a.isArrayBufferView(e))
|
|
552
|
+
return e.buffer;
|
|
553
|
+
if (a.isURLSearchParams(e))
|
|
554
|
+
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
555
|
+
let c;
|
|
556
|
+
if (o) {
|
|
557
|
+
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
558
|
+
return hn(e, this.formSerializer).toString();
|
|
559
|
+
if ((c = a.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
|
|
560
|
+
const d = this.env && this.env.FormData;
|
|
561
|
+
return ae(
|
|
562
|
+
c ? { "files[]": e } : e,
|
|
563
|
+
d && new d(),
|
|
564
|
+
this.formSerializer
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return o || s ? (n.setContentType("application/json", !1), yn(e)) : e;
|
|
569
|
+
}],
|
|
570
|
+
transformResponse: [function(e) {
|
|
571
|
+
const n = this.transitional || W.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
572
|
+
if (a.isResponse(e) || a.isReadableStream(e))
|
|
573
|
+
return e;
|
|
574
|
+
if (e && a.isString(e) && (r && !this.responseType || s)) {
|
|
575
|
+
const i = !(n && n.silentJSONParsing) && s;
|
|
576
|
+
try {
|
|
577
|
+
return JSON.parse(e, this.parseReviver);
|
|
578
|
+
} catch (c) {
|
|
579
|
+
if (i)
|
|
580
|
+
throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return e;
|
|
584
|
+
}],
|
|
585
|
+
/**
|
|
586
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
587
|
+
* timeout is not created.
|
|
588
|
+
*/
|
|
589
|
+
timeout: 0,
|
|
590
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
591
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
592
|
+
maxContentLength: -1,
|
|
593
|
+
maxBodyLength: -1,
|
|
594
|
+
env: {
|
|
595
|
+
FormData: R.classes.FormData,
|
|
596
|
+
Blob: R.classes.Blob
|
|
597
|
+
},
|
|
598
|
+
validateStatus: function(e) {
|
|
599
|
+
return e >= 200 && e < 300;
|
|
600
|
+
},
|
|
601
|
+
headers: {
|
|
602
|
+
common: {
|
|
603
|
+
Accept: "application/json, text/plain, */*",
|
|
604
|
+
"Content-Type": void 0
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
a.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
609
|
+
W.headers[t] = {};
|
|
610
|
+
});
|
|
611
|
+
const bn = a.toObjectSet([
|
|
612
|
+
"age",
|
|
613
|
+
"authorization",
|
|
614
|
+
"content-length",
|
|
615
|
+
"content-type",
|
|
616
|
+
"etag",
|
|
617
|
+
"expires",
|
|
618
|
+
"from",
|
|
619
|
+
"host",
|
|
620
|
+
"if-modified-since",
|
|
621
|
+
"if-unmodified-since",
|
|
622
|
+
"last-modified",
|
|
623
|
+
"location",
|
|
624
|
+
"max-forwards",
|
|
625
|
+
"proxy-authorization",
|
|
626
|
+
"referer",
|
|
627
|
+
"retry-after",
|
|
628
|
+
"user-agent"
|
|
629
|
+
]), wn = (t) => {
|
|
630
|
+
const e = {};
|
|
631
|
+
let n, r, s;
|
|
632
|
+
return t && t.split(`
|
|
633
|
+
`).forEach(function(i) {
|
|
634
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || e[n] && bn[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r);
|
|
635
|
+
}), e;
|
|
636
|
+
}, Pe = /* @__PURE__ */ Symbol("internals");
|
|
637
|
+
function J(t) {
|
|
638
|
+
return t && String(t).trim().toLowerCase();
|
|
639
|
+
}
|
|
640
|
+
function te(t) {
|
|
641
|
+
return t === !1 || t == null ? t : a.isArray(t) ? t.map(te) : String(t);
|
|
642
|
+
}
|
|
643
|
+
function gn(t) {
|
|
644
|
+
const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
645
|
+
let r;
|
|
646
|
+
for (; r = n.exec(t); )
|
|
647
|
+
e[r[1]] = r[2];
|
|
648
|
+
return e;
|
|
649
|
+
}
|
|
650
|
+
const En = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
651
|
+
function fe(t, e, n, r, s) {
|
|
652
|
+
if (a.isFunction(r))
|
|
653
|
+
return r.call(this, e, n);
|
|
654
|
+
if (s && (e = n), !!a.isString(e)) {
|
|
655
|
+
if (a.isString(r))
|
|
656
|
+
return e.indexOf(r) !== -1;
|
|
657
|
+
if (a.isRegExp(r))
|
|
658
|
+
return r.test(e);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function Sn(t) {
|
|
662
|
+
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
|
|
663
|
+
}
|
|
664
|
+
function Rn(t, e) {
|
|
665
|
+
const n = a.toCamelCase(" " + e);
|
|
666
|
+
["get", "set", "has"].forEach((r) => {
|
|
667
|
+
Object.defineProperty(t, r + n, {
|
|
668
|
+
value: function(s, o, i) {
|
|
669
|
+
return this[r].call(this, e, s, o, i);
|
|
670
|
+
},
|
|
671
|
+
configurable: !0
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
let T = class {
|
|
676
|
+
constructor(e) {
|
|
677
|
+
e && this.set(e);
|
|
678
|
+
}
|
|
679
|
+
set(e, n, r) {
|
|
680
|
+
const s = this;
|
|
681
|
+
function o(c, d, u) {
|
|
682
|
+
const l = J(d);
|
|
683
|
+
if (!l)
|
|
684
|
+
throw new Error("header name must be a non-empty string");
|
|
685
|
+
const p = a.findKey(s, l);
|
|
686
|
+
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || d] = te(c));
|
|
687
|
+
}
|
|
688
|
+
const i = (c, d) => a.forEach(c, (u, l) => o(u, l, d));
|
|
689
|
+
if (a.isPlainObject(e) || e instanceof this.constructor)
|
|
690
|
+
i(e, n);
|
|
691
|
+
else if (a.isString(e) && (e = e.trim()) && !En(e))
|
|
692
|
+
i(wn(e), n);
|
|
693
|
+
else if (a.isObject(e) && a.isIterable(e)) {
|
|
694
|
+
let c = {}, d, u;
|
|
695
|
+
for (const l of e) {
|
|
696
|
+
if (!a.isArray(l))
|
|
697
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
698
|
+
c[u = l[0]] = (d = c[u]) ? a.isArray(d) ? [...d, l[1]] : [d, l[1]] : l[1];
|
|
699
|
+
}
|
|
700
|
+
i(c, n);
|
|
701
|
+
} else
|
|
702
|
+
e != null && o(n, e, r);
|
|
703
|
+
return this;
|
|
704
|
+
}
|
|
705
|
+
get(e, n) {
|
|
706
|
+
if (e = J(e), e) {
|
|
707
|
+
const r = a.findKey(this, e);
|
|
708
|
+
if (r) {
|
|
709
|
+
const s = this[r];
|
|
710
|
+
if (!n)
|
|
711
|
+
return s;
|
|
712
|
+
if (n === !0)
|
|
713
|
+
return gn(s);
|
|
714
|
+
if (a.isFunction(n))
|
|
715
|
+
return n.call(this, s, r);
|
|
716
|
+
if (a.isRegExp(n))
|
|
717
|
+
return n.exec(s);
|
|
718
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
has(e, n) {
|
|
723
|
+
if (e = J(e), e) {
|
|
724
|
+
const r = a.findKey(this, e);
|
|
725
|
+
return !!(r && this[r] !== void 0 && (!n || fe(this, this[r], r, n)));
|
|
726
|
+
}
|
|
727
|
+
return !1;
|
|
728
|
+
}
|
|
729
|
+
delete(e, n) {
|
|
730
|
+
const r = this;
|
|
731
|
+
let s = !1;
|
|
732
|
+
function o(i) {
|
|
733
|
+
if (i = J(i), i) {
|
|
734
|
+
const c = a.findKey(r, i);
|
|
735
|
+
c && (!n || fe(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return a.isArray(e) ? e.forEach(o) : o(e), s;
|
|
739
|
+
}
|
|
740
|
+
clear(e) {
|
|
741
|
+
const n = Object.keys(this);
|
|
742
|
+
let r = n.length, s = !1;
|
|
743
|
+
for (; r--; ) {
|
|
744
|
+
const o = n[r];
|
|
745
|
+
(!e || fe(this, this[o], o, e, !0)) && (delete this[o], s = !0);
|
|
746
|
+
}
|
|
747
|
+
return s;
|
|
748
|
+
}
|
|
749
|
+
normalize(e) {
|
|
750
|
+
const n = this, r = {};
|
|
751
|
+
return a.forEach(this, (s, o) => {
|
|
752
|
+
const i = a.findKey(r, o);
|
|
753
|
+
if (i) {
|
|
754
|
+
n[i] = te(s), delete n[o];
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
const c = e ? Sn(o) : String(o).trim();
|
|
758
|
+
c !== o && delete n[o], n[c] = te(s), r[c] = !0;
|
|
759
|
+
}), this;
|
|
760
|
+
}
|
|
761
|
+
concat(...e) {
|
|
762
|
+
return this.constructor.concat(this, ...e);
|
|
763
|
+
}
|
|
764
|
+
toJSON(e) {
|
|
765
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
766
|
+
return a.forEach(this, (r, s) => {
|
|
767
|
+
r != null && r !== !1 && (n[s] = e && a.isArray(r) ? r.join(", ") : r);
|
|
768
|
+
}), n;
|
|
769
|
+
}
|
|
770
|
+
[Symbol.iterator]() {
|
|
771
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
772
|
+
}
|
|
773
|
+
toString() {
|
|
774
|
+
return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(`
|
|
775
|
+
`);
|
|
776
|
+
}
|
|
777
|
+
getSetCookie() {
|
|
778
|
+
return this.get("set-cookie") || [];
|
|
779
|
+
}
|
|
780
|
+
get [Symbol.toStringTag]() {
|
|
781
|
+
return "AxiosHeaders";
|
|
782
|
+
}
|
|
783
|
+
static from(e) {
|
|
784
|
+
return e instanceof this ? e : new this(e);
|
|
785
|
+
}
|
|
786
|
+
static concat(e, ...n) {
|
|
787
|
+
const r = new this(e);
|
|
788
|
+
return n.forEach((s) => r.set(s)), r;
|
|
789
|
+
}
|
|
790
|
+
static accessor(e) {
|
|
791
|
+
const r = (this[Pe] = this[Pe] = {
|
|
792
|
+
accessors: {}
|
|
793
|
+
}).accessors, s = this.prototype;
|
|
794
|
+
function o(i) {
|
|
795
|
+
const c = J(i);
|
|
796
|
+
r[c] || (Rn(s, i), r[c] = !0);
|
|
797
|
+
}
|
|
798
|
+
return a.isArray(e) ? e.forEach(o) : o(e), this;
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
T.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
802
|
+
a.reduceDescriptors(T.prototype, ({ value: t }, e) => {
|
|
803
|
+
let n = e[0].toUpperCase() + e.slice(1);
|
|
804
|
+
return {
|
|
805
|
+
get: () => t,
|
|
806
|
+
set(r) {
|
|
807
|
+
this[n] = r;
|
|
808
|
+
}
|
|
809
|
+
};
|
|
810
|
+
});
|
|
811
|
+
a.freezeMethods(T);
|
|
812
|
+
function de(t, e) {
|
|
813
|
+
const n = this || W, r = e || n, s = T.from(r.headers);
|
|
814
|
+
let o = r.data;
|
|
815
|
+
return a.forEach(t, function(c) {
|
|
816
|
+
o = c.call(n, o, s.normalize(), e ? e.status : void 0);
|
|
817
|
+
}), s.normalize(), o;
|
|
818
|
+
}
|
|
819
|
+
function ot(t) {
|
|
820
|
+
return !!(t && t.__CANCEL__);
|
|
821
|
+
}
|
|
822
|
+
function H(t, e, n) {
|
|
823
|
+
y.call(this, t ?? "canceled", y.ERR_CANCELED, e, n), this.name = "CanceledError";
|
|
824
|
+
}
|
|
825
|
+
a.inherits(H, y, {
|
|
826
|
+
__CANCEL__: !0
|
|
827
|
+
});
|
|
828
|
+
function it(t, e, n) {
|
|
829
|
+
const r = n.config.validateStatus;
|
|
830
|
+
!n.status || !r || r(n.status) ? t(n) : e(new y(
|
|
831
|
+
"Request failed with status code " + n.status,
|
|
832
|
+
[y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
833
|
+
n.config,
|
|
834
|
+
n.request,
|
|
835
|
+
n
|
|
836
|
+
));
|
|
837
|
+
}
|
|
838
|
+
function On(t) {
|
|
839
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
840
|
+
return e && e[1] || "";
|
|
841
|
+
}
|
|
842
|
+
function An(t, e) {
|
|
843
|
+
t = t || 10;
|
|
844
|
+
const n = new Array(t), r = new Array(t);
|
|
845
|
+
let s = 0, o = 0, i;
|
|
846
|
+
return e = e !== void 0 ? e : 1e3, function(d) {
|
|
847
|
+
const u = Date.now(), l = r[o];
|
|
848
|
+
i || (i = u), n[s] = d, r[s] = u;
|
|
849
|
+
let p = o, b = 0;
|
|
850
|
+
for (; p !== s; )
|
|
851
|
+
b += n[p++], p = p % t;
|
|
852
|
+
if (s = (s + 1) % t, s === o && (o = (o + 1) % t), u - i < e)
|
|
853
|
+
return;
|
|
854
|
+
const S = l && u - l;
|
|
855
|
+
return S ? Math.round(b * 1e3 / S) : void 0;
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
function Tn(t, e) {
|
|
859
|
+
let n = 0, r = 1e3 / e, s, o;
|
|
860
|
+
const i = (u, l = Date.now()) => {
|
|
861
|
+
n = l, s = null, o && (clearTimeout(o), o = null), t(...u);
|
|
862
|
+
};
|
|
863
|
+
return [(...u) => {
|
|
864
|
+
const l = Date.now(), p = l - n;
|
|
865
|
+
p >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
|
|
866
|
+
o = null, i(s);
|
|
867
|
+
}, r - p)));
|
|
868
|
+
}, () => s && i(s)];
|
|
869
|
+
}
|
|
870
|
+
const re = (t, e, n = 3) => {
|
|
871
|
+
let r = 0;
|
|
872
|
+
const s = An(50, 250);
|
|
873
|
+
return Tn((o) => {
|
|
874
|
+
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, d = i - r, u = s(d), l = i <= c;
|
|
875
|
+
r = i;
|
|
876
|
+
const p = {
|
|
877
|
+
loaded: i,
|
|
878
|
+
total: c,
|
|
879
|
+
progress: c ? i / c : void 0,
|
|
880
|
+
bytes: d,
|
|
881
|
+
rate: u || void 0,
|
|
882
|
+
estimated: u && c && l ? (c - i) / u : void 0,
|
|
883
|
+
event: o,
|
|
884
|
+
lengthComputable: c != null,
|
|
885
|
+
[e ? "download" : "upload"]: !0
|
|
886
|
+
};
|
|
887
|
+
t(p);
|
|
888
|
+
}, n);
|
|
889
|
+
}, Ue = (t, e) => {
|
|
890
|
+
const n = t != null;
|
|
891
|
+
return [(r) => e[0]({
|
|
892
|
+
lengthComputable: n,
|
|
893
|
+
total: t,
|
|
894
|
+
loaded: r
|
|
895
|
+
}), e[1]];
|
|
896
|
+
}, Le = (t) => (...e) => a.asap(() => t(...e)), xn = R.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (n) => (n = new URL(n, R.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
|
|
897
|
+
new URL(R.origin),
|
|
898
|
+
R.navigator && /(msie|trident)/i.test(R.navigator.userAgent)
|
|
899
|
+
) : () => !0, _n = R.hasStandardBrowserEnv ? (
|
|
900
|
+
// Standard browser envs support document.cookie
|
|
901
|
+
{
|
|
902
|
+
write(t, e, n, r, s, o, i) {
|
|
903
|
+
if (typeof document > "u") return;
|
|
904
|
+
const c = [`${t}=${encodeURIComponent(e)}`];
|
|
905
|
+
a.isNumber(n) && c.push(`expires=${new Date(n).toUTCString()}`), a.isString(r) && c.push(`path=${r}`), a.isString(s) && c.push(`domain=${s}`), o === !0 && c.push("secure"), a.isString(i) && c.push(`SameSite=${i}`), document.cookie = c.join("; ");
|
|
906
|
+
},
|
|
907
|
+
read(t) {
|
|
908
|
+
if (typeof document > "u") return null;
|
|
909
|
+
const e = document.cookie.match(new RegExp("(?:^|; )" + t + "=([^;]*)"));
|
|
910
|
+
return e ? decodeURIComponent(e[1]) : null;
|
|
911
|
+
},
|
|
912
|
+
remove(t) {
|
|
913
|
+
this.write(t, "", Date.now() - 864e5, "/");
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
) : (
|
|
917
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
918
|
+
{
|
|
919
|
+
write() {
|
|
920
|
+
},
|
|
921
|
+
read() {
|
|
922
|
+
return null;
|
|
923
|
+
},
|
|
924
|
+
remove() {
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
);
|
|
928
|
+
function Cn(t) {
|
|
929
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
930
|
+
}
|
|
931
|
+
function Fn(t, e) {
|
|
932
|
+
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
933
|
+
}
|
|
934
|
+
function at(t, e, n) {
|
|
935
|
+
let r = !Cn(e);
|
|
936
|
+
return t && (r || n == !1) ? Fn(t, e) : e;
|
|
937
|
+
}
|
|
938
|
+
const $e = (t) => t instanceof T ? { ...t } : t;
|
|
939
|
+
function D(t, e) {
|
|
940
|
+
e = e || {};
|
|
941
|
+
const n = {};
|
|
942
|
+
function r(u, l, p, b) {
|
|
943
|
+
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: b }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
|
|
944
|
+
}
|
|
945
|
+
function s(u, l, p, b) {
|
|
946
|
+
if (a.isUndefined(l)) {
|
|
947
|
+
if (!a.isUndefined(u))
|
|
948
|
+
return r(void 0, u, p, b);
|
|
949
|
+
} else return r(u, l, p, b);
|
|
950
|
+
}
|
|
951
|
+
function o(u, l) {
|
|
952
|
+
if (!a.isUndefined(l))
|
|
953
|
+
return r(void 0, l);
|
|
954
|
+
}
|
|
955
|
+
function i(u, l) {
|
|
956
|
+
if (a.isUndefined(l)) {
|
|
957
|
+
if (!a.isUndefined(u))
|
|
958
|
+
return r(void 0, u);
|
|
959
|
+
} else return r(void 0, l);
|
|
960
|
+
}
|
|
961
|
+
function c(u, l, p) {
|
|
962
|
+
if (p in e)
|
|
963
|
+
return r(u, l);
|
|
964
|
+
if (p in t)
|
|
965
|
+
return r(void 0, u);
|
|
966
|
+
}
|
|
967
|
+
const d = {
|
|
968
|
+
url: o,
|
|
969
|
+
method: o,
|
|
970
|
+
data: o,
|
|
971
|
+
baseURL: i,
|
|
972
|
+
transformRequest: i,
|
|
973
|
+
transformResponse: i,
|
|
974
|
+
paramsSerializer: i,
|
|
975
|
+
timeout: i,
|
|
976
|
+
timeoutMessage: i,
|
|
977
|
+
withCredentials: i,
|
|
978
|
+
withXSRFToken: i,
|
|
979
|
+
adapter: i,
|
|
980
|
+
responseType: i,
|
|
981
|
+
xsrfCookieName: i,
|
|
982
|
+
xsrfHeaderName: i,
|
|
983
|
+
onUploadProgress: i,
|
|
984
|
+
onDownloadProgress: i,
|
|
985
|
+
decompress: i,
|
|
986
|
+
maxContentLength: i,
|
|
987
|
+
maxBodyLength: i,
|
|
988
|
+
beforeRedirect: i,
|
|
989
|
+
transport: i,
|
|
990
|
+
httpAgent: i,
|
|
991
|
+
httpsAgent: i,
|
|
992
|
+
cancelToken: i,
|
|
993
|
+
socketPath: i,
|
|
994
|
+
responseEncoding: i,
|
|
995
|
+
validateStatus: c,
|
|
996
|
+
headers: (u, l, p) => s($e(u), $e(l), p, !0)
|
|
997
|
+
};
|
|
998
|
+
return a.forEach(Object.keys({ ...t, ...e }), function(l) {
|
|
999
|
+
const p = d[l] || s, b = p(t[l], e[l], l);
|
|
1000
|
+
a.isUndefined(b) && p !== c || (n[l] = b);
|
|
1001
|
+
}), n;
|
|
1002
|
+
}
|
|
1003
|
+
const ct = (t) => {
|
|
1004
|
+
const e = D({}, t);
|
|
1005
|
+
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = e;
|
|
1006
|
+
if (e.headers = i = T.from(i), e.url = nt(at(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), c && i.set(
|
|
1007
|
+
"Authorization",
|
|
1008
|
+
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1009
|
+
), a.isFormData(n)) {
|
|
1010
|
+
if (R.hasStandardBrowserEnv || R.hasStandardBrowserWebWorkerEnv)
|
|
1011
|
+
i.setContentType(void 0);
|
|
1012
|
+
else if (a.isFunction(n.getHeaders)) {
|
|
1013
|
+
const d = n.getHeaders(), u = ["content-type", "content-length"];
|
|
1014
|
+
Object.entries(d).forEach(([l, p]) => {
|
|
1015
|
+
u.includes(l.toLowerCase()) && i.set(l, p);
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
if (R.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(e)), r || r !== !1 && xn(e.url))) {
|
|
1020
|
+
const d = s && o && _n.read(o);
|
|
1021
|
+
d && i.set(s, d);
|
|
1022
|
+
}
|
|
1023
|
+
return e;
|
|
1024
|
+
}, Nn = typeof XMLHttpRequest < "u", kn = Nn && function(t) {
|
|
1025
|
+
return new Promise(function(n, r) {
|
|
1026
|
+
const s = ct(t);
|
|
1027
|
+
let o = s.data;
|
|
1028
|
+
const i = T.from(s.headers).normalize();
|
|
1029
|
+
let { responseType: c, onUploadProgress: d, onDownloadProgress: u } = s, l, p, b, S, f;
|
|
1030
|
+
function m() {
|
|
1031
|
+
S && S(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1032
|
+
}
|
|
1033
|
+
let h = new XMLHttpRequest();
|
|
1034
|
+
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
|
|
1035
|
+
function g() {
|
|
1036
|
+
if (!h)
|
|
1037
|
+
return;
|
|
1038
|
+
const E = T.from(
|
|
1039
|
+
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1040
|
+
), C = {
|
|
1041
|
+
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
|
|
1042
|
+
status: h.status,
|
|
1043
|
+
statusText: h.statusText,
|
|
1044
|
+
headers: E,
|
|
1045
|
+
config: t,
|
|
1046
|
+
request: h
|
|
1047
|
+
};
|
|
1048
|
+
it(function(_) {
|
|
1049
|
+
n(_), m();
|
|
1050
|
+
}, function(_) {
|
|
1051
|
+
r(_), m();
|
|
1052
|
+
}, C), h = null;
|
|
1053
|
+
}
|
|
1054
|
+
"onloadend" in h ? h.onloadend = g : h.onreadystatechange = function() {
|
|
1055
|
+
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(g);
|
|
1056
|
+
}, h.onabort = function() {
|
|
1057
|
+
h && (r(new y("Request aborted", y.ECONNABORTED, t, h)), h = null);
|
|
1058
|
+
}, h.onerror = function(O) {
|
|
1059
|
+
const C = O && O.message ? O.message : "Network Error", L = new y(C, y.ERR_NETWORK, t, h);
|
|
1060
|
+
L.event = O || null, r(L), h = null;
|
|
1061
|
+
}, h.ontimeout = function() {
|
|
1062
|
+
let O = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1063
|
+
const C = s.transitional || rt;
|
|
1064
|
+
s.timeoutErrorMessage && (O = s.timeoutErrorMessage), r(new y(
|
|
1065
|
+
O,
|
|
1066
|
+
C.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
|
|
1067
|
+
t,
|
|
1068
|
+
h
|
|
1069
|
+
)), h = null;
|
|
1070
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && a.forEach(i.toJSON(), function(O, C) {
|
|
1071
|
+
h.setRequestHeader(C, O);
|
|
1072
|
+
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), u && ([b, f] = re(u, !0), h.addEventListener("progress", b)), d && h.upload && ([p, S] = re(d), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", S)), (s.cancelToken || s.signal) && (l = (E) => {
|
|
1073
|
+
h && (r(!E || E.type ? new H(null, t, h) : E), h.abort(), h = null);
|
|
1074
|
+
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1075
|
+
const x = On(s.url);
|
|
1076
|
+
if (x && R.protocols.indexOf(x) === -1) {
|
|
1077
|
+
r(new y("Unsupported protocol " + x + ":", y.ERR_BAD_REQUEST, t));
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
h.send(o || null);
|
|
1081
|
+
});
|
|
1082
|
+
}, Pn = (t, e) => {
|
|
1083
|
+
const { length: n } = t = t ? t.filter(Boolean) : [];
|
|
1084
|
+
if (e || n) {
|
|
1085
|
+
let r = new AbortController(), s;
|
|
1086
|
+
const o = function(u) {
|
|
1087
|
+
if (!s) {
|
|
1088
|
+
s = !0, c();
|
|
1089
|
+
const l = u instanceof Error ? u : this.reason;
|
|
1090
|
+
r.abort(l instanceof y ? l : new H(l instanceof Error ? l.message : l));
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
let i = e && setTimeout(() => {
|
|
1094
|
+
i = null, o(new y(`timeout ${e} of ms exceeded`, y.ETIMEDOUT));
|
|
1095
|
+
}, e);
|
|
1096
|
+
const c = () => {
|
|
1097
|
+
t && (i && clearTimeout(i), i = null, t.forEach((u) => {
|
|
1098
|
+
u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
|
|
1099
|
+
}), t = null);
|
|
1100
|
+
};
|
|
1101
|
+
t.forEach((u) => u.addEventListener("abort", o));
|
|
1102
|
+
const { signal: d } = r;
|
|
1103
|
+
return d.unsubscribe = () => a.asap(c), d;
|
|
1104
|
+
}
|
|
1105
|
+
}, Un = function* (t, e) {
|
|
1106
|
+
let n = t.byteLength;
|
|
1107
|
+
if (n < e) {
|
|
1108
|
+
yield t;
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
let r = 0, s;
|
|
1112
|
+
for (; r < n; )
|
|
1113
|
+
s = r + e, yield t.slice(r, s), r = s;
|
|
1114
|
+
}, Ln = async function* (t, e) {
|
|
1115
|
+
for await (const n of $n(t))
|
|
1116
|
+
yield* Un(n, e);
|
|
1117
|
+
}, $n = async function* (t) {
|
|
1118
|
+
if (t[Symbol.asyncIterator]) {
|
|
1119
|
+
yield* t;
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
const e = t.getReader();
|
|
1123
|
+
try {
|
|
1124
|
+
for (; ; ) {
|
|
1125
|
+
const { done: n, value: r } = await e.read();
|
|
1126
|
+
if (n)
|
|
1127
|
+
break;
|
|
1128
|
+
yield r;
|
|
1129
|
+
}
|
|
1130
|
+
} finally {
|
|
1131
|
+
await e.cancel();
|
|
1132
|
+
}
|
|
1133
|
+
}, je = (t, e, n, r) => {
|
|
1134
|
+
const s = Ln(t, e);
|
|
1135
|
+
let o = 0, i, c = (d) => {
|
|
1136
|
+
i || (i = !0, r && r(d));
|
|
1137
|
+
};
|
|
1138
|
+
return new ReadableStream({
|
|
1139
|
+
async pull(d) {
|
|
1140
|
+
try {
|
|
1141
|
+
const { done: u, value: l } = await s.next();
|
|
1142
|
+
if (u) {
|
|
1143
|
+
c(), d.close();
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
let p = l.byteLength;
|
|
1147
|
+
if (n) {
|
|
1148
|
+
let b = o += p;
|
|
1149
|
+
n(b);
|
|
1150
|
+
}
|
|
1151
|
+
d.enqueue(new Uint8Array(l));
|
|
1152
|
+
} catch (u) {
|
|
1153
|
+
throw c(u), u;
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
cancel(d) {
|
|
1157
|
+
return c(d), s.return();
|
|
1158
|
+
}
|
|
1159
|
+
}, {
|
|
1160
|
+
highWaterMark: 2
|
|
1161
|
+
});
|
|
1162
|
+
}, Be = 64 * 1024, { isFunction: Z } = a, jn = (({ Request: t, Response: e }) => ({
|
|
1163
|
+
Request: t,
|
|
1164
|
+
Response: e
|
|
1165
|
+
}))(a.global), {
|
|
1166
|
+
ReadableStream: De,
|
|
1167
|
+
TextEncoder: qe
|
|
1168
|
+
} = a.global, Me = (t, ...e) => {
|
|
1169
|
+
try {
|
|
1170
|
+
return !!t(...e);
|
|
1171
|
+
} catch {
|
|
1172
|
+
return !1;
|
|
1173
|
+
}
|
|
1174
|
+
}, Bn = (t) => {
|
|
1175
|
+
t = a.merge.call({
|
|
1176
|
+
skipUndefined: !0
|
|
1177
|
+
}, jn, t);
|
|
1178
|
+
const { fetch: e, Request: n, Response: r } = t, s = e ? Z(e) : typeof fetch == "function", o = Z(n), i = Z(r);
|
|
1179
|
+
if (!s)
|
|
1180
|
+
return !1;
|
|
1181
|
+
const c = s && Z(De), d = s && (typeof qe == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new qe()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = o && c && Me(() => {
|
|
1182
|
+
let f = !1;
|
|
1183
|
+
const m = new n(R.origin, {
|
|
1184
|
+
body: new De(),
|
|
1185
|
+
method: "POST",
|
|
1186
|
+
get duplex() {
|
|
1187
|
+
return f = !0, "half";
|
|
1188
|
+
}
|
|
1189
|
+
}).headers.has("Content-Type");
|
|
1190
|
+
return f && !m;
|
|
1191
|
+
}), l = i && c && Me(() => a.isReadableStream(new r("").body)), p = {
|
|
1192
|
+
stream: l && ((f) => f.body)
|
|
1193
|
+
};
|
|
1194
|
+
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1195
|
+
!p[f] && (p[f] = (m, h) => {
|
|
1196
|
+
let g = m && m[f];
|
|
1197
|
+
if (g)
|
|
1198
|
+
return g.call(m);
|
|
1199
|
+
throw new y(`Response type '${f}' is not supported`, y.ERR_NOT_SUPPORT, h);
|
|
1200
|
+
});
|
|
1201
|
+
});
|
|
1202
|
+
const b = async (f) => {
|
|
1203
|
+
if (f == null)
|
|
1204
|
+
return 0;
|
|
1205
|
+
if (a.isBlob(f))
|
|
1206
|
+
return f.size;
|
|
1207
|
+
if (a.isSpecCompliantForm(f))
|
|
1208
|
+
return (await new n(R.origin, {
|
|
1209
|
+
method: "POST",
|
|
1210
|
+
body: f
|
|
1211
|
+
}).arrayBuffer()).byteLength;
|
|
1212
|
+
if (a.isArrayBufferView(f) || a.isArrayBuffer(f))
|
|
1213
|
+
return f.byteLength;
|
|
1214
|
+
if (a.isURLSearchParams(f) && (f = f + ""), a.isString(f))
|
|
1215
|
+
return (await d(f)).byteLength;
|
|
1216
|
+
}, S = async (f, m) => {
|
|
1217
|
+
const h = a.toFiniteNumber(f.getContentLength());
|
|
1218
|
+
return h ?? b(m);
|
|
1219
|
+
};
|
|
1220
|
+
return async (f) => {
|
|
1221
|
+
let {
|
|
1222
|
+
url: m,
|
|
1223
|
+
method: h,
|
|
1224
|
+
data: g,
|
|
1225
|
+
signal: x,
|
|
1226
|
+
cancelToken: E,
|
|
1227
|
+
timeout: O,
|
|
1228
|
+
onDownloadProgress: C,
|
|
1229
|
+
onUploadProgress: L,
|
|
1230
|
+
responseType: _,
|
|
1231
|
+
headers: le,
|
|
1232
|
+
withCredentials: K = "same-origin",
|
|
1233
|
+
fetchOptions: Re
|
|
1234
|
+
} = ct(f), Oe = e || fetch;
|
|
1235
|
+
_ = _ ? (_ + "").toLowerCase() : "text";
|
|
1236
|
+
let X = Pn([x, E && E.toAbortSignal()], O), Q = null;
|
|
1237
|
+
const $ = X && X.unsubscribe && (() => {
|
|
1238
|
+
X.unsubscribe();
|
|
1239
|
+
});
|
|
1240
|
+
let Ae;
|
|
1241
|
+
try {
|
|
1242
|
+
if (L && u && h !== "get" && h !== "head" && (Ae = await S(le, g)) !== 0) {
|
|
1243
|
+
let U = new n(m, {
|
|
1244
|
+
method: "POST",
|
|
1245
|
+
body: g,
|
|
1246
|
+
duplex: "half"
|
|
1247
|
+
}), q;
|
|
1248
|
+
if (a.isFormData(g) && (q = U.headers.get("content-type")) && le.setContentType(q), U.body) {
|
|
1249
|
+
const [ue, G] = Ue(
|
|
1250
|
+
Ae,
|
|
1251
|
+
re(Le(L))
|
|
1252
|
+
);
|
|
1253
|
+
g = je(U.body, Be, ue, G);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
a.isString(K) || (K = K ? "include" : "omit");
|
|
1257
|
+
const N = o && "credentials" in n.prototype, Te = {
|
|
1258
|
+
...Re,
|
|
1259
|
+
signal: X,
|
|
1260
|
+
method: h.toUpperCase(),
|
|
1261
|
+
headers: le.normalize().toJSON(),
|
|
1262
|
+
body: g,
|
|
1263
|
+
duplex: "half",
|
|
1264
|
+
credentials: N ? K : void 0
|
|
1265
|
+
};
|
|
1266
|
+
Q = o && new n(m, Te);
|
|
1267
|
+
let P = await (o ? Oe(Q, Re) : Oe(m, Te));
|
|
1268
|
+
const xe = l && (_ === "stream" || _ === "response");
|
|
1269
|
+
if (l && (C || xe && $)) {
|
|
1270
|
+
const U = {};
|
|
1271
|
+
["status", "statusText", "headers"].forEach((_e) => {
|
|
1272
|
+
U[_e] = P[_e];
|
|
1273
|
+
});
|
|
1274
|
+
const q = a.toFiniteNumber(P.headers.get("content-length")), [ue, G] = C && Ue(
|
|
1275
|
+
q,
|
|
1276
|
+
re(Le(C), !0)
|
|
1277
|
+
) || [];
|
|
1278
|
+
P = new r(
|
|
1279
|
+
je(P.body, Be, ue, () => {
|
|
1280
|
+
G && G(), $ && $();
|
|
1281
|
+
}),
|
|
1282
|
+
U
|
|
1283
|
+
);
|
|
1284
|
+
}
|
|
1285
|
+
_ = _ || "text";
|
|
1286
|
+
let pt = await p[a.findKey(p, _) || "text"](P, f);
|
|
1287
|
+
return !xe && $ && $(), await new Promise((U, q) => {
|
|
1288
|
+
it(U, q, {
|
|
1289
|
+
data: pt,
|
|
1290
|
+
headers: T.from(P.headers),
|
|
1291
|
+
status: P.status,
|
|
1292
|
+
statusText: P.statusText,
|
|
1293
|
+
config: f,
|
|
1294
|
+
request: Q
|
|
1295
|
+
});
|
|
1296
|
+
});
|
|
1297
|
+
} catch (N) {
|
|
1298
|
+
throw $ && $(), N && N.name === "TypeError" && /Load failed|fetch/i.test(N.message) ? Object.assign(
|
|
1299
|
+
new y("Network Error", y.ERR_NETWORK, f, Q),
|
|
1300
|
+
{
|
|
1301
|
+
cause: N.cause || N
|
|
1302
|
+
}
|
|
1303
|
+
) : y.from(N, N && N.code, f, Q);
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
}, Dn = /* @__PURE__ */ new Map(), lt = (t) => {
|
|
1307
|
+
let e = t && t.env || {};
|
|
1308
|
+
const { fetch: n, Request: r, Response: s } = e, o = [
|
|
1309
|
+
r,
|
|
1310
|
+
s,
|
|
1311
|
+
n
|
|
1312
|
+
];
|
|
1313
|
+
let i = o.length, c = i, d, u, l = Dn;
|
|
1314
|
+
for (; c--; )
|
|
1315
|
+
d = o[c], u = l.get(d), u === void 0 && l.set(d, u = c ? /* @__PURE__ */ new Map() : Bn(e)), l = u;
|
|
1316
|
+
return u;
|
|
1317
|
+
};
|
|
1318
|
+
lt();
|
|
1319
|
+
const Se = {
|
|
1320
|
+
http: en,
|
|
1321
|
+
xhr: kn,
|
|
1322
|
+
fetch: {
|
|
1323
|
+
get: lt
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
a.forEach(Se, (t, e) => {
|
|
1327
|
+
if (t) {
|
|
1328
|
+
try {
|
|
1329
|
+
Object.defineProperty(t, "name", { value: e });
|
|
1330
|
+
} catch {
|
|
1331
|
+
}
|
|
1332
|
+
Object.defineProperty(t, "adapterName", { value: e });
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1335
|
+
const Ie = (t) => `- ${t}`, qn = (t) => a.isFunction(t) || t === null || t === !1;
|
|
1336
|
+
function Mn(t, e) {
|
|
1337
|
+
t = a.isArray(t) ? t : [t];
|
|
1338
|
+
const { length: n } = t;
|
|
1339
|
+
let r, s;
|
|
1340
|
+
const o = {};
|
|
1341
|
+
for (let i = 0; i < n; i++) {
|
|
1342
|
+
r = t[i];
|
|
1343
|
+
let c;
|
|
1344
|
+
if (s = r, !qn(r) && (s = Se[(c = String(r)).toLowerCase()], s === void 0))
|
|
1345
|
+
throw new y(`Unknown adapter '${c}'`);
|
|
1346
|
+
if (s && (a.isFunction(s) || (s = s.get(e))))
|
|
1347
|
+
break;
|
|
1348
|
+
o[c || "#" + i] = s;
|
|
1349
|
+
}
|
|
1350
|
+
if (!s) {
|
|
1351
|
+
const i = Object.entries(o).map(
|
|
1352
|
+
([d, u]) => `adapter ${d} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1353
|
+
);
|
|
1354
|
+
let c = n ? i.length > 1 ? `since :
|
|
1355
|
+
` + i.map(Ie).join(`
|
|
1356
|
+
`) : " " + Ie(i[0]) : "as no adapter specified";
|
|
1357
|
+
throw new y(
|
|
1358
|
+
"There is no suitable adapter to dispatch the request " + c,
|
|
1359
|
+
"ERR_NOT_SUPPORT"
|
|
1360
|
+
);
|
|
1361
|
+
}
|
|
1362
|
+
return s;
|
|
1363
|
+
}
|
|
1364
|
+
const ut = {
|
|
1365
|
+
/**
|
|
1366
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
1367
|
+
* @type {Function}
|
|
1368
|
+
*/
|
|
1369
|
+
getAdapter: Mn,
|
|
1370
|
+
/**
|
|
1371
|
+
* Exposes all known adapters
|
|
1372
|
+
* @type {Object<string, Function|Object>}
|
|
1373
|
+
*/
|
|
1374
|
+
adapters: Se
|
|
1375
|
+
};
|
|
1376
|
+
function he(t) {
|
|
1377
|
+
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1378
|
+
throw new H(null, t);
|
|
1379
|
+
}
|
|
1380
|
+
function He(t) {
|
|
1381
|
+
return he(t), t.headers = T.from(t.headers), t.data = de.call(
|
|
1382
|
+
t,
|
|
1383
|
+
t.transformRequest
|
|
1384
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), ut.getAdapter(t.adapter || W.adapter, t)(t).then(function(r) {
|
|
1385
|
+
return he(t), r.data = de.call(
|
|
1386
|
+
t,
|
|
1387
|
+
t.transformResponse,
|
|
1388
|
+
r
|
|
1389
|
+
), r.headers = T.from(r.headers), r;
|
|
1390
|
+
}, function(r) {
|
|
1391
|
+
return ot(r) || (he(t), r && r.response && (r.response.data = de.call(
|
|
1392
|
+
t,
|
|
1393
|
+
t.transformResponse,
|
|
1394
|
+
r.response
|
|
1395
|
+
), r.response.headers = T.from(r.response.headers))), Promise.reject(r);
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
const ft = "1.13.2", ce = {};
|
|
1399
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1400
|
+
ce[t] = function(r) {
|
|
1401
|
+
return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1402
|
+
};
|
|
1403
|
+
});
|
|
1404
|
+
const Qe = {};
|
|
1405
|
+
ce.transitional = function(e, n, r) {
|
|
1406
|
+
function s(o, i) {
|
|
1407
|
+
return "[Axios v" + ft + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1408
|
+
}
|
|
1409
|
+
return (o, i, c) => {
|
|
1410
|
+
if (e === !1)
|
|
1411
|
+
throw new y(
|
|
1412
|
+
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1413
|
+
y.ERR_DEPRECATED
|
|
1414
|
+
);
|
|
1415
|
+
return n && !Qe[i] && (Qe[i] = !0, console.warn(
|
|
1416
|
+
s(
|
|
1417
|
+
i,
|
|
1418
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1419
|
+
)
|
|
1420
|
+
)), e ? e(o, i, c) : !0;
|
|
1421
|
+
};
|
|
1422
|
+
};
|
|
1423
|
+
ce.spelling = function(e) {
|
|
1424
|
+
return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
|
|
1425
|
+
};
|
|
1426
|
+
function In(t, e, n) {
|
|
1427
|
+
if (typeof t != "object")
|
|
1428
|
+
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
|
|
1429
|
+
const r = Object.keys(t);
|
|
1430
|
+
let s = r.length;
|
|
1431
|
+
for (; s-- > 0; ) {
|
|
1432
|
+
const o = r[s], i = e[o];
|
|
1433
|
+
if (i) {
|
|
1434
|
+
const c = t[o], d = c === void 0 || i(c, o, t);
|
|
1435
|
+
if (d !== !0)
|
|
1436
|
+
throw new y("option " + o + " must be " + d, y.ERR_BAD_OPTION_VALUE);
|
|
1437
|
+
continue;
|
|
1438
|
+
}
|
|
1439
|
+
if (n !== !0)
|
|
1440
|
+
throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
const ne = {
|
|
1444
|
+
assertOptions: In,
|
|
1445
|
+
validators: ce
|
|
1446
|
+
}, k = ne.validators;
|
|
1447
|
+
let B = class {
|
|
1448
|
+
constructor(e) {
|
|
1449
|
+
this.defaults = e || {}, this.interceptors = {
|
|
1450
|
+
request: new ke(),
|
|
1451
|
+
response: new ke()
|
|
1452
|
+
};
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Dispatch a request
|
|
1456
|
+
*
|
|
1457
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1458
|
+
* @param {?Object} config
|
|
1459
|
+
*
|
|
1460
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1461
|
+
*/
|
|
1462
|
+
async request(e, n) {
|
|
1463
|
+
try {
|
|
1464
|
+
return await this._request(e, n);
|
|
1465
|
+
} catch (r) {
|
|
1466
|
+
if (r instanceof Error) {
|
|
1467
|
+
let s = {};
|
|
1468
|
+
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
|
|
1469
|
+
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
|
|
1470
|
+
try {
|
|
1471
|
+
r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
|
|
1472
|
+
` + o) : r.stack = o;
|
|
1473
|
+
} catch {
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
throw r;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
_request(e, n) {
|
|
1480
|
+
typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = D(this.defaults, n);
|
|
1481
|
+
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1482
|
+
r !== void 0 && ne.assertOptions(r, {
|
|
1483
|
+
silentJSONParsing: k.transitional(k.boolean),
|
|
1484
|
+
forcedJSONParsing: k.transitional(k.boolean),
|
|
1485
|
+
clarifyTimeoutError: k.transitional(k.boolean)
|
|
1486
|
+
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
|
|
1487
|
+
serialize: s
|
|
1488
|
+
} : ne.assertOptions(s, {
|
|
1489
|
+
encode: k.function,
|
|
1490
|
+
serialize: k.function
|
|
1491
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ne.assertOptions(n, {
|
|
1492
|
+
baseUrl: k.spelling("baseURL"),
|
|
1493
|
+
withXsrfToken: k.spelling("withXSRFToken")
|
|
1494
|
+
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1495
|
+
let i = o && a.merge(
|
|
1496
|
+
o.common,
|
|
1497
|
+
o[n.method]
|
|
1498
|
+
);
|
|
1499
|
+
o && a.forEach(
|
|
1500
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1501
|
+
(f) => {
|
|
1502
|
+
delete o[f];
|
|
1503
|
+
}
|
|
1504
|
+
), n.headers = T.concat(i, o);
|
|
1505
|
+
const c = [];
|
|
1506
|
+
let d = !0;
|
|
1507
|
+
this.interceptors.request.forEach(function(m) {
|
|
1508
|
+
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (d = d && m.synchronous, c.unshift(m.fulfilled, m.rejected));
|
|
1509
|
+
});
|
|
1510
|
+
const u = [];
|
|
1511
|
+
this.interceptors.response.forEach(function(m) {
|
|
1512
|
+
u.push(m.fulfilled, m.rejected);
|
|
1513
|
+
});
|
|
1514
|
+
let l, p = 0, b;
|
|
1515
|
+
if (!d) {
|
|
1516
|
+
const f = [He.bind(this), void 0];
|
|
1517
|
+
for (f.unshift(...c), f.push(...u), b = f.length, l = Promise.resolve(n); p < b; )
|
|
1518
|
+
l = l.then(f[p++], f[p++]);
|
|
1519
|
+
return l;
|
|
1520
|
+
}
|
|
1521
|
+
b = c.length;
|
|
1522
|
+
let S = n;
|
|
1523
|
+
for (; p < b; ) {
|
|
1524
|
+
const f = c[p++], m = c[p++];
|
|
1525
|
+
try {
|
|
1526
|
+
S = f(S);
|
|
1527
|
+
} catch (h) {
|
|
1528
|
+
m.call(this, h);
|
|
1529
|
+
break;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
try {
|
|
1533
|
+
l = He.call(this, S);
|
|
1534
|
+
} catch (f) {
|
|
1535
|
+
return Promise.reject(f);
|
|
1536
|
+
}
|
|
1537
|
+
for (p = 0, b = u.length; p < b; )
|
|
1538
|
+
l = l.then(u[p++], u[p++]);
|
|
1539
|
+
return l;
|
|
1540
|
+
}
|
|
1541
|
+
getUri(e) {
|
|
1542
|
+
e = D(this.defaults, e);
|
|
1543
|
+
const n = at(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1544
|
+
return nt(n, e.params, e.paramsSerializer);
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
a.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1548
|
+
B.prototype[e] = function(n, r) {
|
|
1549
|
+
return this.request(D(r || {}, {
|
|
1550
|
+
method: e,
|
|
1551
|
+
url: n,
|
|
1552
|
+
data: (r || {}).data
|
|
1553
|
+
}));
|
|
1554
|
+
};
|
|
1555
|
+
});
|
|
1556
|
+
a.forEach(["post", "put", "patch"], function(e) {
|
|
1557
|
+
function n(r) {
|
|
1558
|
+
return function(o, i, c) {
|
|
1559
|
+
return this.request(D(c || {}, {
|
|
1560
|
+
method: e,
|
|
1561
|
+
headers: r ? {
|
|
1562
|
+
"Content-Type": "multipart/form-data"
|
|
1563
|
+
} : {},
|
|
1564
|
+
url: o,
|
|
1565
|
+
data: i
|
|
1566
|
+
}));
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
B.prototype[e] = n(), B.prototype[e + "Form"] = n(!0);
|
|
1570
|
+
});
|
|
1571
|
+
let Hn = class dt {
|
|
1572
|
+
constructor(e) {
|
|
1573
|
+
if (typeof e != "function")
|
|
1574
|
+
throw new TypeError("executor must be a function.");
|
|
1575
|
+
let n;
|
|
1576
|
+
this.promise = new Promise(function(o) {
|
|
1577
|
+
n = o;
|
|
1578
|
+
});
|
|
1579
|
+
const r = this;
|
|
1580
|
+
this.promise.then((s) => {
|
|
1581
|
+
if (!r._listeners) return;
|
|
1582
|
+
let o = r._listeners.length;
|
|
1583
|
+
for (; o-- > 0; )
|
|
1584
|
+
r._listeners[o](s);
|
|
1585
|
+
r._listeners = null;
|
|
1586
|
+
}), this.promise.then = (s) => {
|
|
1587
|
+
let o;
|
|
1588
|
+
const i = new Promise((c) => {
|
|
1589
|
+
r.subscribe(c), o = c;
|
|
1590
|
+
}).then(s);
|
|
1591
|
+
return i.cancel = function() {
|
|
1592
|
+
r.unsubscribe(o);
|
|
1593
|
+
}, i;
|
|
1594
|
+
}, e(function(o, i, c) {
|
|
1595
|
+
r.reason || (r.reason = new H(o, i, c), n(r.reason));
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1600
|
+
*/
|
|
1601
|
+
throwIfRequested() {
|
|
1602
|
+
if (this.reason)
|
|
1603
|
+
throw this.reason;
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Subscribe to the cancel signal
|
|
1607
|
+
*/
|
|
1608
|
+
subscribe(e) {
|
|
1609
|
+
if (this.reason) {
|
|
1610
|
+
e(this.reason);
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Unsubscribe from the cancel signal
|
|
1617
|
+
*/
|
|
1618
|
+
unsubscribe(e) {
|
|
1619
|
+
if (!this._listeners)
|
|
1620
|
+
return;
|
|
1621
|
+
const n = this._listeners.indexOf(e);
|
|
1622
|
+
n !== -1 && this._listeners.splice(n, 1);
|
|
1623
|
+
}
|
|
1624
|
+
toAbortSignal() {
|
|
1625
|
+
const e = new AbortController(), n = (r) => {
|
|
1626
|
+
e.abort(r);
|
|
1627
|
+
};
|
|
1628
|
+
return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1632
|
+
* cancels the `CancelToken`.
|
|
1633
|
+
*/
|
|
1634
|
+
static source() {
|
|
1635
|
+
let e;
|
|
1636
|
+
return {
|
|
1637
|
+
token: new dt(function(s) {
|
|
1638
|
+
e = s;
|
|
1639
|
+
}),
|
|
1640
|
+
cancel: e
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
function Qn(t) {
|
|
1645
|
+
return function(n) {
|
|
1646
|
+
return t.apply(null, n);
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1649
|
+
function Jn(t) {
|
|
1650
|
+
return a.isObject(t) && t.isAxiosError === !0;
|
|
1651
|
+
}
|
|
1652
|
+
const be = {
|
|
1653
|
+
Continue: 100,
|
|
1654
|
+
SwitchingProtocols: 101,
|
|
1655
|
+
Processing: 102,
|
|
1656
|
+
EarlyHints: 103,
|
|
1657
|
+
Ok: 200,
|
|
1658
|
+
Created: 201,
|
|
1659
|
+
Accepted: 202,
|
|
1660
|
+
NonAuthoritativeInformation: 203,
|
|
1661
|
+
NoContent: 204,
|
|
1662
|
+
ResetContent: 205,
|
|
1663
|
+
PartialContent: 206,
|
|
1664
|
+
MultiStatus: 207,
|
|
1665
|
+
AlreadyReported: 208,
|
|
1666
|
+
ImUsed: 226,
|
|
1667
|
+
MultipleChoices: 300,
|
|
1668
|
+
MovedPermanently: 301,
|
|
1669
|
+
Found: 302,
|
|
1670
|
+
SeeOther: 303,
|
|
1671
|
+
NotModified: 304,
|
|
1672
|
+
UseProxy: 305,
|
|
1673
|
+
Unused: 306,
|
|
1674
|
+
TemporaryRedirect: 307,
|
|
1675
|
+
PermanentRedirect: 308,
|
|
1676
|
+
BadRequest: 400,
|
|
1677
|
+
Unauthorized: 401,
|
|
1678
|
+
PaymentRequired: 402,
|
|
1679
|
+
Forbidden: 403,
|
|
1680
|
+
NotFound: 404,
|
|
1681
|
+
MethodNotAllowed: 405,
|
|
1682
|
+
NotAcceptable: 406,
|
|
1683
|
+
ProxyAuthenticationRequired: 407,
|
|
1684
|
+
RequestTimeout: 408,
|
|
1685
|
+
Conflict: 409,
|
|
1686
|
+
Gone: 410,
|
|
1687
|
+
LengthRequired: 411,
|
|
1688
|
+
PreconditionFailed: 412,
|
|
1689
|
+
PayloadTooLarge: 413,
|
|
1690
|
+
UriTooLong: 414,
|
|
1691
|
+
UnsupportedMediaType: 415,
|
|
1692
|
+
RangeNotSatisfiable: 416,
|
|
1693
|
+
ExpectationFailed: 417,
|
|
1694
|
+
ImATeapot: 418,
|
|
1695
|
+
MisdirectedRequest: 421,
|
|
1696
|
+
UnprocessableEntity: 422,
|
|
1697
|
+
Locked: 423,
|
|
1698
|
+
FailedDependency: 424,
|
|
1699
|
+
TooEarly: 425,
|
|
1700
|
+
UpgradeRequired: 426,
|
|
1701
|
+
PreconditionRequired: 428,
|
|
1702
|
+
TooManyRequests: 429,
|
|
1703
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
1704
|
+
UnavailableForLegalReasons: 451,
|
|
1705
|
+
InternalServerError: 500,
|
|
1706
|
+
NotImplemented: 501,
|
|
1707
|
+
BadGateway: 502,
|
|
1708
|
+
ServiceUnavailable: 503,
|
|
1709
|
+
GatewayTimeout: 504,
|
|
1710
|
+
HttpVersionNotSupported: 505,
|
|
1711
|
+
VariantAlsoNegotiates: 506,
|
|
1712
|
+
InsufficientStorage: 507,
|
|
1713
|
+
LoopDetected: 508,
|
|
1714
|
+
NotExtended: 510,
|
|
1715
|
+
NetworkAuthenticationRequired: 511,
|
|
1716
|
+
WebServerIsDown: 521,
|
|
1717
|
+
ConnectionTimedOut: 522,
|
|
1718
|
+
OriginIsUnreachable: 523,
|
|
1719
|
+
TimeoutOccurred: 524,
|
|
1720
|
+
SslHandshakeFailed: 525,
|
|
1721
|
+
InvalidSslCertificate: 526
|
|
1722
|
+
};
|
|
1723
|
+
Object.entries(be).forEach(([t, e]) => {
|
|
1724
|
+
be[e] = t;
|
|
1725
|
+
});
|
|
1726
|
+
function ht(t) {
|
|
1727
|
+
const e = new B(t), n = Je(B.prototype.request, e);
|
|
1728
|
+
return a.extend(n, B.prototype, e, { allOwnKeys: !0 }), a.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1729
|
+
return ht(D(t, s));
|
|
1730
|
+
}, n;
|
|
1731
|
+
}
|
|
1732
|
+
const w = ht(W);
|
|
1733
|
+
w.Axios = B;
|
|
1734
|
+
w.CanceledError = H;
|
|
1735
|
+
w.CancelToken = Hn;
|
|
1736
|
+
w.isCancel = ot;
|
|
1737
|
+
w.VERSION = ft;
|
|
1738
|
+
w.toFormData = ae;
|
|
1739
|
+
w.AxiosError = y;
|
|
1740
|
+
w.Cancel = w.CanceledError;
|
|
1741
|
+
w.all = function(e) {
|
|
1742
|
+
return Promise.all(e);
|
|
1743
|
+
};
|
|
1744
|
+
w.spread = Qn;
|
|
1745
|
+
w.isAxiosError = Jn;
|
|
1746
|
+
w.mergeConfig = D;
|
|
1747
|
+
w.AxiosHeaders = T;
|
|
1748
|
+
w.formToJSON = (t) => st(a.isHTMLForm(t) ? new FormData(t) : t);
|
|
1749
|
+
w.getAdapter = ut.getAdapter;
|
|
1750
|
+
w.HttpStatusCode = be;
|
|
1751
|
+
w.default = w;
|
|
1752
|
+
const {
|
|
1753
|
+
Axios: Yn,
|
|
1754
|
+
AxiosError: er,
|
|
1755
|
+
CanceledError: tr,
|
|
1756
|
+
isCancel: nr,
|
|
1757
|
+
CancelToken: rr,
|
|
1758
|
+
VERSION: sr,
|
|
1759
|
+
all: or,
|
|
1760
|
+
Cancel: ir,
|
|
1761
|
+
isAxiosError: ar,
|
|
1762
|
+
spread: cr,
|
|
1763
|
+
toFormData: lr,
|
|
1764
|
+
AxiosHeaders: ur,
|
|
1765
|
+
HttpStatusCode: fr,
|
|
1766
|
+
formToJSON: dr,
|
|
1767
|
+
getAdapter: hr,
|
|
1768
|
+
mergeConfig: pr
|
|
1769
|
+
} = w, zn = { Accept: "application/json", "Content-Type": "application/json" };
|
|
1770
|
+
function Vn(t) {
|
|
1771
|
+
return t.data;
|
|
1772
|
+
}
|
|
1773
|
+
class vn {
|
|
1774
|
+
/** The root URL for all API requests. */
|
|
1775
|
+
root;
|
|
1776
|
+
/** Axios configuration used for all requests. */
|
|
1777
|
+
config;
|
|
1778
|
+
/**
|
|
1779
|
+
* Initializes a new instance of the ApiQuery class.
|
|
1780
|
+
* @param rootUrl - The base URL for the API.
|
|
1781
|
+
* @param config - Optional axios configuration.
|
|
1782
|
+
*/
|
|
1783
|
+
constructor(e, n = {}) {
|
|
1784
|
+
this.root = e, this.config = {
|
|
1785
|
+
...n,
|
|
1786
|
+
headers: {
|
|
1787
|
+
...zn,
|
|
1788
|
+
...n.headers || {}
|
|
1789
|
+
}
|
|
1790
|
+
};
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Performs an API request.
|
|
1794
|
+
* @template T - The expected response type.
|
|
1795
|
+
* @param method - The HTTP method to use.
|
|
1796
|
+
* @param url - The relative URL for the request.
|
|
1797
|
+
* @param data - The request payload (for POST, PUT).
|
|
1798
|
+
* @param config - Optional axios configuration to override defaults.
|
|
1799
|
+
* @returns A promise that resolves to the response data.
|
|
1800
|
+
*/
|
|
1801
|
+
async request(e, n, r, s) {
|
|
1802
|
+
const o = `${this.root}${n}`, i = { ...this.config, ...s }, c = await (e === "get" || e === "delete" ? w[e](o, i) : w[e](o, r, i));
|
|
1803
|
+
return Vn(c);
|
|
1804
|
+
}
|
|
1805
|
+
/**
|
|
1806
|
+
* Performs a GET request.
|
|
1807
|
+
* @template T - The expected response type.
|
|
1808
|
+
* @param url - The relative URL for the request.
|
|
1809
|
+
* @param config - Optional axios configuration to override defaults.
|
|
1810
|
+
* @returns A promise that resolves to the response data.
|
|
1811
|
+
*/
|
|
1812
|
+
async get(e, n) {
|
|
1813
|
+
return this.request("get", e, void 0, n);
|
|
1814
|
+
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Performs a POST request.
|
|
1817
|
+
* @template B - The request body type.
|
|
1818
|
+
* @template T - The expected response type.
|
|
1819
|
+
* @param url - The relative URL for the request.
|
|
1820
|
+
* @param data - The request payload.
|
|
1821
|
+
* @param config - Optional axios configuration to override defaults.
|
|
1822
|
+
* @returns A promise that resolves to the response data.
|
|
1823
|
+
*/
|
|
1824
|
+
async post(e, n, r) {
|
|
1825
|
+
return this.request("post", e, n, r);
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Performs a PUT request.
|
|
1829
|
+
* @template B - The request body type.
|
|
1830
|
+
* @template T - The expected response type.
|
|
1831
|
+
* @param url - The relative URL for the request.
|
|
1832
|
+
* @param data - The request payload.
|
|
1833
|
+
* @param config - Optional axios configuration to override defaults.
|
|
1834
|
+
* @returns A promise that resolves to the response data.
|
|
1835
|
+
*/
|
|
1836
|
+
async put(e, n, r) {
|
|
1837
|
+
return this.request("put", e, n, r);
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Performs a DELETE request.
|
|
1841
|
+
* @template T - The expected response type.
|
|
1842
|
+
* @param url - The relative URL for the request.
|
|
1843
|
+
* @param config - Optional axios configuration to override defaults.
|
|
1844
|
+
* @returns A promise that resolves to the response data.
|
|
1845
|
+
*/
|
|
1846
|
+
async del(e, n) {
|
|
1847
|
+
return this.request("delete", e, void 0, n);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
const Wn = [
|
|
1851
|
+
"contains",
|
|
1852
|
+
"contains_nocase",
|
|
1853
|
+
"ends_with",
|
|
1854
|
+
"end_with_nocase",
|
|
1855
|
+
"starts_with",
|
|
1856
|
+
"starts_with_nocase",
|
|
1857
|
+
"not_contains",
|
|
1858
|
+
"not_contains_nocase",
|
|
1859
|
+
"not_ends_with",
|
|
1860
|
+
"not_ends_with_nocase",
|
|
1861
|
+
"not_starts_with",
|
|
1862
|
+
"not_starts_with_nocase",
|
|
1863
|
+
"gt",
|
|
1864
|
+
"gte",
|
|
1865
|
+
"lt",
|
|
1866
|
+
"lte",
|
|
1867
|
+
"not",
|
|
1868
|
+
"in",
|
|
1869
|
+
"not_in"
|
|
1870
|
+
], Kn = 1e3, Xn = 5e3;
|
|
1871
|
+
class Y {
|
|
1872
|
+
/**
|
|
1873
|
+
* Converts a JSON query object into a GraphQL-compatible string.
|
|
1874
|
+
* Handles nested objects and operator mapping (e.g., $gt -> _gt).
|
|
1875
|
+
* @param query - The JSON filter object to build.
|
|
1876
|
+
* @returns A string representing the GraphQL 'where' or 'block' filter.
|
|
1877
|
+
*/
|
|
1878
|
+
static buildJsonQuery(e) {
|
|
1879
|
+
const n = [];
|
|
1880
|
+
for (const r in e) {
|
|
1881
|
+
const s = e[r];
|
|
1882
|
+
if (s !== void 0)
|
|
1883
|
+
if (s === null)
|
|
1884
|
+
n.push(`${r}: null`);
|
|
1885
|
+
else if (Array.isArray(s)) {
|
|
1886
|
+
const o = s;
|
|
1887
|
+
n.push(`${r}: [${o.map((i) => typeof i == "string" ? `"${i}"` : i).join(", ")}]`);
|
|
1888
|
+
} else if (typeof s == "string")
|
|
1889
|
+
n.push(`${r}: "${s}"`);
|
|
1890
|
+
else if (typeof s == "object") {
|
|
1891
|
+
const o = {}, i = {}, c = s;
|
|
1892
|
+
for (const d in c) {
|
|
1893
|
+
const u = c[d];
|
|
1894
|
+
if (d.startsWith("$")) {
|
|
1895
|
+
const l = d.slice(1);
|
|
1896
|
+
Wn.includes(l) ? i[`${r}_${l}`] = u : o[d] = u;
|
|
1897
|
+
} else
|
|
1898
|
+
o[d] = u;
|
|
1899
|
+
}
|
|
1900
|
+
Object.keys(o).length > 0 && n.push(`${r}: {${this.buildJsonQuery(o)}}`), Object.keys(i).length > 0 && n.push(this.buildJsonQuery(i));
|
|
1901
|
+
} else
|
|
1902
|
+
n.push(`${r}: ${s}`);
|
|
1903
|
+
}
|
|
1904
|
+
return n.join(", ");
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* Builds the fields/elements part of a GraphQL query from an array of strings or objects.
|
|
1908
|
+
* @param elements - An array of fields to query. Can include nested collections as GraphObject.
|
|
1909
|
+
* @returns An array of strings representing the selected fields.
|
|
1910
|
+
*/
|
|
1911
|
+
static buildElements(e) {
|
|
1912
|
+
return e.map((n) => {
|
|
1913
|
+
if (typeof n == "string")
|
|
1914
|
+
return n;
|
|
1915
|
+
const r = n;
|
|
1916
|
+
return this.buildQuery({ collection: r.collection, params: r.params });
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Builds the metadata (_meta) fragment of a GraphQL query.
|
|
1921
|
+
* @param metadata - The metadata configuration.
|
|
1922
|
+
* @returns A string representing the _meta query fragment.
|
|
1923
|
+
*/
|
|
1924
|
+
static buildMetadata(e) {
|
|
1925
|
+
let n = "";
|
|
1926
|
+
const r = [];
|
|
1927
|
+
e.blockQuery && (e.blockQuery.hash && r.push(`hash: "${e.blockQuery.hash}"`), e.blockQuery.number !== void 0 && r.push(`number: ${e.blockQuery.number}`), e.blockQuery.number_gte !== void 0 && r.push(`number_gte: ${e.blockQuery.number_gte}`));
|
|
1928
|
+
const s = r.join(", ");
|
|
1929
|
+
s.length > 0 && (n += `(block: {${s}})`);
|
|
1930
|
+
const o = [], i = [];
|
|
1931
|
+
if (e.elements) {
|
|
1932
|
+
for (const u of e.elements)
|
|
1933
|
+
u === "deployment" || u === "hasIndexingErrors" ? o.includes(u) || o.push(u) : i.includes(u) || i.push(u);
|
|
1934
|
+
const c = i.join(" ");
|
|
1935
|
+
c.length > 0 && o.push(`block{${c}}`);
|
|
1936
|
+
const d = o.join(" ");
|
|
1937
|
+
d.length > 0 && (n += `{${d}}`);
|
|
1938
|
+
}
|
|
1939
|
+
return n.length > 0 ? `_meta${n}` : "";
|
|
1940
|
+
}
|
|
1941
|
+
/**
|
|
1942
|
+
* Builds an inline fragment (... on Collection { ... }) for a query.
|
|
1943
|
+
* @param fragment - The inline fragment configuration.
|
|
1944
|
+
* @returns A string representing the inline fragment.
|
|
1945
|
+
* @private
|
|
1946
|
+
*/
|
|
1947
|
+
static _buildInlineFragment(e) {
|
|
1948
|
+
const n = e.params?.elements?.length ? this.buildElements(e.params.elements) : ["id"];
|
|
1949
|
+
return `... on ${e.collection}{${n.join(" ")}}`;
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* Builds multiple inline fragments from an array of fragment configurations.
|
|
1953
|
+
* @param fragments - An array of inline fragments.
|
|
1954
|
+
* @returns A string containing all built inline fragments.
|
|
1955
|
+
*/
|
|
1956
|
+
static buildInlineFragments(e) {
|
|
1957
|
+
return e.map((n) => this._buildInlineFragment(n)).join(" ");
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* Builds a complete GraphQL query for a single collection.
|
|
1961
|
+
* @param data - The collection and parameters for the query.
|
|
1962
|
+
* @param metadata - Optional metadata configuration.
|
|
1963
|
+
* @returns A string containing the GraphQL query for the collection.
|
|
1964
|
+
*/
|
|
1965
|
+
static buildQuery(e, n) {
|
|
1966
|
+
const { collection: r, params: s } = e, o = [];
|
|
1967
|
+
if (s?.id !== void 0 && o.push(`id: ${s.id}`), s?.orderBy && o.push(`orderBy: ${s.orderBy}`), s?.orderDirection && o.push(`orderDirection: ${s.orderDirection}`), s?.first !== void 0) {
|
|
1968
|
+
const l = Math.max(0, Math.min(s.first, Kn));
|
|
1969
|
+
o.push(`first: ${l}`);
|
|
1970
|
+
}
|
|
1971
|
+
if (s?.skip !== void 0) {
|
|
1972
|
+
const l = Math.max(0, Math.min(s.skip, Xn));
|
|
1973
|
+
o.push(`skip: ${l}`);
|
|
1974
|
+
}
|
|
1975
|
+
if (s?.where) {
|
|
1976
|
+
const l = this.buildJsonQuery(s.where);
|
|
1977
|
+
l.length > 0 && o.push(`where: {${l}}`);
|
|
1978
|
+
}
|
|
1979
|
+
if (s?.block) {
|
|
1980
|
+
const l = this.buildJsonQuery(s.block);
|
|
1981
|
+
l.length > 0 && o.push(`block: {${l}}`);
|
|
1982
|
+
}
|
|
1983
|
+
const i = o.length > 0 ? `(${o.join(", ")})` : "";
|
|
1984
|
+
let c = ["id"];
|
|
1985
|
+
s?.elements && s.elements.length > 0 && (c = this.buildElements(s.elements));
|
|
1986
|
+
let d = "";
|
|
1987
|
+
s?.inlineFragments && s.inlineFragments.length > 0 && (d = ` ${this.buildInlineFragments(s.inlineFragments)}`);
|
|
1988
|
+
const u = `${r}${i} {${c.join(" ")}${d}}`;
|
|
1989
|
+
if (n) {
|
|
1990
|
+
const l = this.buildMetadata(n);
|
|
1991
|
+
return l ? `${l} ${u}` : u;
|
|
1992
|
+
}
|
|
1993
|
+
return u;
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Builds a query that targets multiple collections simultaneously.
|
|
1997
|
+
* @param data - An array of collection queries and their parameters.
|
|
1998
|
+
* @param metadata - Optional metadata configuration that applies to the entire query.
|
|
1999
|
+
* @returns A string containing the merged GraphQL query for multiple collections.
|
|
2000
|
+
*/
|
|
2001
|
+
static buildMultipleQuery(e, n) {
|
|
2002
|
+
const s = e.map((o) => this.buildQuery({ collection: o.collection, params: o.params })).join(" ");
|
|
2003
|
+
if (n) {
|
|
2004
|
+
const o = this.buildMetadata(n);
|
|
2005
|
+
return o ? `${o} ${s}` : s;
|
|
2006
|
+
}
|
|
2007
|
+
return s;
|
|
2008
|
+
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Wraps a query fragment into a full GraphQL 'query' block.
|
|
2011
|
+
* @param query - The query fragment to wrap.
|
|
2012
|
+
* @param queryName - An optional name for the GraphQL query (defaults to 'query').
|
|
2013
|
+
* @returns The full GraphQL query string.
|
|
2014
|
+
*/
|
|
2015
|
+
static makeFullQuery(e, n = "query") {
|
|
2016
|
+
return `query ${n} {${e}}`;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
class mr extends vn {
|
|
2020
|
+
/** The name of the GraphQL query, used in makeFullQuery. */
|
|
2021
|
+
queryName;
|
|
2022
|
+
/**
|
|
2023
|
+
* Initializes a new EthGraphQuery instance.
|
|
2024
|
+
* @param rootUrl - The endpoint URL of the subgraph.
|
|
2025
|
+
* @param config - Optional axios configuration for custom headers or timeouts.
|
|
2026
|
+
*/
|
|
2027
|
+
constructor(e, n) {
|
|
2028
|
+
super(e, n), this.queryName = "query";
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* Executes a raw GraphQL query string.
|
|
2032
|
+
* @template T - The expected return type of the data.
|
|
2033
|
+
* @param data - The raw GraphQL query string.
|
|
2034
|
+
* @returns A promise resolving to the query result.
|
|
2035
|
+
* @throws Error if the response contains any GraphQL errors.
|
|
2036
|
+
*/
|
|
2037
|
+
async stringQuery(e) {
|
|
2038
|
+
const n = await this.post("", { query: e });
|
|
2039
|
+
if (n && typeof n == "object" && "errors" in n) {
|
|
2040
|
+
const s = n.errors.map((o) => o.message).join("; ");
|
|
2041
|
+
throw new Error(`GraphQL Error: ${s}`);
|
|
2042
|
+
}
|
|
2043
|
+
return n.data;
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Executes a single collection query using a JSON configuration.
|
|
2047
|
+
* @template T - The expected return type of the data.
|
|
2048
|
+
* @param data - The configuration for the collection query.
|
|
2049
|
+
* @param metadata - Optional metadata fields to include in the query.
|
|
2050
|
+
* @returns A promise resolving to the fetched data.
|
|
2051
|
+
*/
|
|
2052
|
+
async query(e, n) {
|
|
2053
|
+
const r = Y.buildQuery(e, n);
|
|
2054
|
+
return this.stringQuery(Y.makeFullQuery(r, this.queryName));
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
* Executes multiple collection queries in a single request using JSON configurations.
|
|
2058
|
+
* @template T - The expected return type of the data.
|
|
2059
|
+
* @param data - An array of query configurations.
|
|
2060
|
+
* @param metadata - Optional metadata fields to include in the query.
|
|
2061
|
+
* @returns A promise resolving to the merged results of all queries.
|
|
2062
|
+
*/
|
|
2063
|
+
async multipleQuery(e, n) {
|
|
2064
|
+
const r = Y.buildMultipleQuery(e, n);
|
|
2065
|
+
return this.stringQuery(Y.makeFullQuery(r, this.queryName));
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
export {
|
|
2069
|
+
mr as EthGraphQuery,
|
|
2070
|
+
Wn as OptionKeys,
|
|
2071
|
+
Y as QueryBuilder
|
|
2072
|
+
};
|