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