dev-classes
Version:
<h3 align="center">SocketApi</h3>
1,707 lines (1,706 loc) • 56.3 kB
JavaScript
var ut = Object.defineProperty;
var lt = (e, t, n) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var x = (e, t, n) => (lt(e, typeof t != "symbol" ? t + "" : t, n), n);
import { ErrorsHandler as ft } from "./ErrorsHandler/ErrorsHandler.js";
import { SaveRequest as Re } from "./SaveRequest/SaveRequest.js";
import { Utils as Oe } from "../../../Utils/Utils.js";
function Ie(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: dt } = Object.prototype, { getPrototypeOf: me } = Object, X = /* @__PURE__ */ ((e) => (t) => {
const n = dt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), U = (e) => (e = e.toLowerCase(), (t) => X(t) === e), Q = (e) => (t) => typeof t === e, { isArray: _ } = Array, v = Q("undefined");
function pt(e) {
return e !== null && !v(e) && e.constructor !== null && !v(e.constructor) && N(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const He = U("ArrayBuffer");
function ht(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && He(e.buffer), t;
}
const mt = Q("string"), N = Q("function"), ve = Q("number"), Z = (e) => e !== null && typeof e == "object", yt = (e) => e === !0 || e === !1, J = (e) => {
if (X(e) !== "object")
return !1;
const t = me(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
}, wt = U("Date"), gt = U("File"), bt = U("Blob"), Et = U("FileList"), St = (e) => Z(e) && N(e.pipe), Rt = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || N(e.append) && ((t = X(e)) === "formdata" || // detect form-data instance
t === "object" && N(e.toString) && e.toString() === "[object FormData]"));
}, Ot = U("URLSearchParams"), [Tt, At, Ct, xt] = ["ReadableStream", "Request", "Response", "Headers"].map(U), Nt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function M(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, s;
if (typeof e != "object" && (e = [e]), _(e))
for (r = 0, s = e.length; r < s; r++)
t.call(null, e[r], r, e);
else {
const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
let c;
for (r = 0; r < i; r++)
c = o[r], t.call(null, e[c], c, e);
}
}
function Me(e, t) {
t = t.toLowerCase();
const n = Object.keys(e);
let r = n.length, s;
for (; r-- > 0; )
if (s = n[r], t === s.toLowerCase())
return s;
return null;
}
const B = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, ze = (e) => !v(e) && e !== B;
function ae() {
const { caseless: e } = ze(this) && this || {}, t = {}, n = (r, s) => {
const o = e && Me(t, s) || s;
J(t[o]) && J(r) ? t[o] = ae(t[o], r) : J(r) ? t[o] = ae({}, r) : _(r) ? t[o] = r.slice() : t[o] = r;
};
for (let r = 0, s = arguments.length; r < s; r++)
arguments[r] && M(arguments[r], n);
return t;
}
const Pt = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
n && N(s) ? e[o] = Ie(s, n) : e[o] = s;
}, { allOwnKeys: r }), e), kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Ft = (e, t, n, r) => {
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, Ut = (e, t, n, r) => {
let s, o, i;
const c = {};
if (t = t || {}, e == null)
return t;
do {
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
i = s[o], (!r || r(i, e, t)) && !c[i] && (t[i] = e[i], c[i] = !0);
e = n !== !1 && me(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, Dt = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const r = e.indexOf(t, n);
return r !== -1 && r === n;
}, Lt = (e) => {
if (!e)
return null;
if (_(e))
return e;
let t = e.length;
if (!ve(t))
return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, Bt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && me(Uint8Array)), jt = (e, t) => {
const r = (e && e[Symbol.iterator]).call(e);
let s;
for (; (s = r.next()) && !s.done; ) {
const o = s.value;
t.call(e, o[0], o[1]);
}
}, _t = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, qt = U("HTMLFormElement"), It = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, r, s) {
return r.toUpperCase() + s;
}
), Te = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Ht = U("RegExp"), Je = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
M(n, (s, o) => {
let i;
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
}), Object.defineProperties(e, r);
}, vt = (e) => {
Je(e, (t, n) => {
if (N(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (N(r)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, Mt = (e, t) => {
const n = {}, r = (s) => {
s.forEach((o) => {
n[o] = !0;
});
};
return _(e) ? r(e) : r(String(e).split(t)), n;
}, zt = () => {
}, Jt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t, ne = "abcdefghijklmnopqrstuvwxyz", Ae = "0123456789", $e = {
DIGIT: Ae,
ALPHA: ne,
ALPHA_DIGIT: ne + ne.toUpperCase() + Ae
}, $t = (e = 16, t = $e.ALPHA_DIGIT) => {
let n = "";
const { length: r } = t;
for (; e--; )
n += t[Math.random() * r | 0];
return n;
};
function Vt(e) {
return !!(e && N(e.append) && e[Symbol.toStringTag] === "FormData" && e[Symbol.iterator]);
}
const Wt = (e) => {
const t = new Array(10), n = (r, s) => {
if (Z(r)) {
if (t.indexOf(r) >= 0)
return;
if (!("toJSON" in r)) {
t[s] = r;
const o = _(r) ? [] : {};
return M(r, (i, c) => {
const f = n(i, s + 1);
!v(f) && (o[c] = f);
}), t[s] = void 0, o;
}
}
return r;
};
return n(e, 0);
}, Kt = U("AsyncFunction"), Gt = (e) => e && (Z(e) || N(e)) && N(e.then) && N(e.catch), Ve = ((e, t) => e ? setImmediate : t ? ((n, r) => (B.addEventListener("message", ({ source: s, data: o }) => {
s === B && o === n && r.length && r.shift()();
}, !1), (s) => {
r.push(s), B.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
N(B.postMessage)
), Xt = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || Ve, a = {
isArray: _,
isArrayBuffer: He,
isBuffer: pt,
isFormData: Rt,
isArrayBufferView: ht,
isString: mt,
isNumber: ve,
isBoolean: yt,
isObject: Z,
isPlainObject: J,
isReadableStream: Tt,
isRequest: At,
isResponse: Ct,
isHeaders: xt,
isUndefined: v,
isDate: wt,
isFile: gt,
isBlob: bt,
isRegExp: Ht,
isFunction: N,
isStream: St,
isURLSearchParams: Ot,
isTypedArray: Bt,
isFileList: Et,
forEach: M,
merge: ae,
extend: Pt,
trim: Nt,
stripBOM: kt,
inherits: Ft,
toFlatObject: Ut,
kindOf: X,
kindOfTest: U,
endsWith: Dt,
toArray: Lt,
forEachEntry: jt,
matchAll: _t,
isHTMLForm: qt,
hasOwnProperty: Te,
hasOwnProp: Te,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Je,
freezeMethods: vt,
toObjectSet: Mt,
toCamelCase: It,
noop: zt,
toFiniteNumber: Jt,
findKey: Me,
global: B,
isContextDefined: ze,
ALPHABET: $e,
generateString: $t,
isSpecCompliantForm: Vt,
toJSONObject: Wt,
isAsyncFn: Kt,
isThenable: Gt,
setImmediate: Ve,
asap: Xt
};
function y(e, t, n, r, s) {
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), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
}
a.inherits(y, Error, {
toJSON: function() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: a.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const We = y.prototype, Ke = {};
[
"ERR_BAD_OPTION_VALUE",
"ERR_BAD_OPTION",
"ECONNABORTED",
"ETIMEDOUT",
"ERR_NETWORK",
"ERR_FR_TOO_MANY_REDIRECTS",
"ERR_DEPRECATED",
"ERR_BAD_RESPONSE",
"ERR_BAD_REQUEST",
"ERR_CANCELED",
"ERR_NOT_SUPPORT",
"ERR_INVALID_URL"
// eslint-disable-next-line func-names
].forEach((e) => {
Ke[e] = { value: e };
});
Object.defineProperties(y, Ke);
Object.defineProperty(We, "isAxiosError", { value: !0 });
y.from = (e, t, n, r, s, o) => {
const i = Object.create(We);
return a.toFlatObject(e, i, function(f) {
return f !== Error.prototype;
}, (c) => c !== "isAxiosError"), y.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
};
const Qt = null;
function ce(e) {
return a.isPlainObject(e) || a.isArray(e);
}
function Ge(e) {
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Ce(e, t, n) {
return e ? e.concat(t).map(function(s, o) {
return s = Ge(s), !n && o ? "[" + s + "]" : s;
}).join(n ? "." : "") : t;
}
function Zt(e) {
return a.isArray(e) && !e.some(ce);
}
const Yt = a.toFlatObject(a, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function Y(e, t, n) {
if (!a.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = a.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(m, p) {
return !a.isUndefined(p[m]);
});
const r = n.metaTokens, s = n.visitor || l, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
if (!a.isFunction(s))
throw new TypeError("visitor must be a function");
function u(d) {
if (d === null)
return "";
if (a.isDate(d))
return d.toISOString();
if (!f && a.isBlob(d))
throw new y("Blob is not supported. Use a Buffer instead.");
return a.isArrayBuffer(d) || a.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
}
function l(d, m, p) {
let g = d;
if (d && !p && typeof d == "object") {
if (a.endsWith(m, "{}"))
m = r ? m : m.slice(0, -2), d = JSON.stringify(d);
else if (a.isArray(d) && Zt(d) || (a.isFileList(d) || a.endsWith(m, "[]")) && (g = a.toArray(d)))
return m = Ge(m), g.forEach(function(O, E) {
!(a.isUndefined(O) || O === null) && t.append(
// eslint-disable-next-line no-nested-ternary
i === !0 ? Ce([m], E, o) : i === null ? m : m + "[]",
u(O)
);
}), !1;
}
return ce(d) ? !0 : (t.append(Ce(p, m, o), u(d)), !1);
}
const h = [], S = Object.assign(Yt, {
defaultVisitor: l,
convertValue: u,
isVisitable: ce
});
function R(d, m) {
if (!a.isUndefined(d)) {
if (h.indexOf(d) !== -1)
throw Error("Circular reference detected in " + m.join("."));
h.push(d), a.forEach(d, function(g, b) {
(!(a.isUndefined(g) || g === null) && s.call(
t,
g,
a.isString(b) ? b.trim() : b,
m,
S
)) === !0 && R(g, m ? m.concat(b) : [b]);
}), h.pop();
}
}
if (!a.isObject(e))
throw new TypeError("data must be an object");
return R(e), t;
}
function xe(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function ye(e, t) {
this._pairs = [], e && Y(e, this, t);
}
const Xe = ye.prototype;
Xe.append = function(t, n) {
this._pairs.push([t, n]);
};
Xe.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, xe);
} : xe;
return this._pairs.map(function(s) {
return n(s[0]) + "=" + n(s[1]);
}, "").join("&");
};
function en(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function Qe(e, t, n) {
if (!t)
return e;
const r = n && n.encode || en, s = n && n.serialize;
let o;
if (s ? o = s(t, n) : o = a.isURLSearchParams(t) ? t.toString() : new ye(t, n).toString(r), o) {
const i = e.indexOf("#");
i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o;
}
return e;
}
class Ne {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(t, n, r) {
return this.handlers.push({
fulfilled: t,
rejected: n,
synchronous: r ? r.synchronous : !1,
runWhen: r ? r.runWhen : null
}), this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
*/
eject(t) {
this.handlers[t] && (this.handlers[t] = null);
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
this.handlers && (this.handlers = []);
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(t) {
a.forEach(this.handlers, function(r) {
r !== null && t(r);
});
}
}
const Ze = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, tn = typeof URLSearchParams < "u" ? URLSearchParams : ye, nn = typeof FormData < "u" ? FormData : null, rn = typeof Blob < "u" ? Blob : null, sn = {
isBrowser: !0,
classes: {
URLSearchParams: tn,
FormData: nn,
Blob: rn
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, we = typeof window < "u" && typeof document < "u", ue = typeof navigator == "object" && navigator || void 0, on = we && (!ue || ["ReactNative", "NativeScript", "NS"].indexOf(ue.product) < 0), an = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", cn = we && window.location.href || "http://localhost", un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: we,
hasStandardBrowserEnv: on,
hasStandardBrowserWebWorkerEnv: an,
navigator: ue,
origin: cn
}, Symbol.toStringTag, { value: "Module" })), C = {
...un,
...sn
};
function ln(e, t) {
return Y(e, new C.classes.URLSearchParams(), Object.assign({
visitor: function(n, r, s, o) {
return C.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
}
}, t));
}
function fn(e) {
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function dn(e) {
const t = {}, n = Object.keys(e);
let r;
const s = n.length;
let o;
for (r = 0; r < s; r++)
o = n[r], t[o] = e[o];
return t;
}
function Ye(e) {
function t(n, r, s, o) {
let i = n[o++];
if (i === "__proto__")
return !0;
const c = Number.isFinite(+i), f = o >= n.length;
return i = !i && a.isArray(s) ? s.length : i, f ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = dn(s[i])), !c);
}
if (a.isFormData(e) && a.isFunction(e.entries)) {
const n = {};
return a.forEachEntry(e, (r, s) => {
t(fn(r), s, n, 0);
}), n;
}
return null;
}
function pn(e, t, n) {
if (a.isString(e))
try {
return (t || JSON.parse)(e), a.trim(e);
} catch (r) {
if (r.name !== "SyntaxError")
throw r;
}
return (n || JSON.stringify)(e);
}
const ge = {
transitional: Ze,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = a.isObject(t);
if (o && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
return s ? JSON.stringify(Ye(t)) : t;
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
return t;
if (a.isArrayBufferView(t))
return t.buffer;
if (a.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let c;
if (o) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return ln(t, this.formSerializer).toString();
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const f = this.env && this.env.FormData;
return Y(
c ? { "files[]": t } : t,
f && new f(),
this.formSerializer
);
}
}
return o || s ? (n.setContentType("application/json", !1), pn(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || ge.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
if (a.isResponse(t) || a.isReadableStream(t))
return t;
if (t && a.isString(t) && (r && !this.responseType || s)) {
const i = !(n && n.silentJSONParsing) && s;
try {
return JSON.parse(t);
} catch (c) {
if (i)
throw c.name === "SyntaxError" ? y.from(c, y.ERR_BAD_RESPONSE, this, null, this.response) : c;
}
}
return t;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: "XSRF-TOKEN",
xsrfHeaderName: "X-XSRF-TOKEN",
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: C.classes.FormData,
Blob: C.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
ge.headers[e] = {};
});
const be = ge, hn = a.toObjectSet([
"age",
"authorization",
"content-length",
"content-type",
"etag",
"expires",
"from",
"host",
"if-modified-since",
"if-unmodified-since",
"last-modified",
"location",
"max-forwards",
"proxy-authorization",
"referer",
"retry-after",
"user-agent"
]), mn = (e) => {
const t = {};
let n, r, s;
return e && e.split(`
`).forEach(function(i) {
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && hn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, Pe = Symbol("internals");
function H(e) {
return e && String(e).trim().toLowerCase();
}
function $(e) {
return e === !1 || e == null ? e : a.isArray(e) ? e.map($) : String(e);
}
function yn(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let r;
for (; r = n.exec(e); )
t[r[1]] = r[2];
return t;
}
const wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function re(e, t, n, r, s) {
if (a.isFunction(r))
return r.call(this, t, n);
if (s && (t = n), !!a.isString(t)) {
if (a.isString(r))
return t.indexOf(r) !== -1;
if (a.isRegExp(r))
return r.test(t);
}
}
function gn(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function bn(e, t) {
const n = a.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(s, o, i) {
return this[r].call(this, t, s, o, i);
},
configurable: !0
});
});
}
class ee {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const s = this;
function o(c, f, u) {
const l = H(f);
if (!l)
throw new Error("header name must be a non-empty string");
const h = a.findKey(s, l);
(!h || s[h] === void 0 || u === !0 || u === void 0 && s[h] !== !1) && (s[h || f] = $(c));
}
const i = (c, f) => a.forEach(c, (u, l) => o(u, l, f));
if (a.isPlainObject(t) || t instanceof this.constructor)
i(t, n);
else if (a.isString(t) && (t = t.trim()) && !wn(t))
i(mn(t), n);
else if (a.isHeaders(t))
for (const [c, f] of t.entries())
o(f, c, r);
else
t != null && o(n, t, r);
return this;
}
get(t, n) {
if (t = H(t), t) {
const r = a.findKey(this, t);
if (r) {
const s = this[r];
if (!n)
return s;
if (n === !0)
return yn(s);
if (a.isFunction(n))
return n.call(this, s, r);
if (a.isRegExp(n))
return n.exec(s);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = H(t), t) {
const r = a.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || re(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let s = !1;
function o(i) {
if (i = H(i), i) {
const c = a.findKey(r, i);
c && (!n || re(r, r[c], c, n)) && (delete r[c], s = !0);
}
}
return a.isArray(t) ? t.forEach(o) : o(t), s;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, s = !1;
for (; r--; ) {
const o = n[r];
(!t || re(this, this[o], o, t, !0)) && (delete this[o], s = !0);
}
return s;
}
normalize(t) {
const n = this, r = {};
return a.forEach(this, (s, o) => {
const i = a.findKey(r, o);
if (i) {
n[i] = $(s), delete n[o];
return;
}
const c = t ? gn(o) : String(o).trim();
c !== o && delete n[o], n[c] = $(s), r[c] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return a.forEach(this, (r, s) => {
r != null && r !== !1 && (n[s] = t && a.isArray(r) ? r.join(", ") : r);
}), n;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(t) {
return t instanceof this ? t : new this(t);
}
static concat(t, ...n) {
const r = new this(t);
return n.forEach((s) => r.set(s)), r;
}
static accessor(t) {
const r = (this[Pe] = this[Pe] = {
accessors: {}
}).accessors, s = this.prototype;
function o(i) {
const c = H(i);
r[c] || (bn(s, i), r[c] = !0);
}
return a.isArray(t) ? t.forEach(o) : o(t), this;
}
}
ee.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
a.reduceDescriptors(ee.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
a.freezeMethods(ee);
const F = ee;
function se(e, t) {
const n = this || be, r = t || n, s = F.from(r.headers);
let o = r.data;
return a.forEach(e, function(c) {
o = c.call(n, o, s.normalize(), t ? t.status : void 0);
}), s.normalize(), o;
}
function et(e) {
return !!(e && e.__CANCEL__);
}
function q(e, t, n) {
y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
}
a.inherits(q, y, {
__CANCEL__: !0
});
function tt(e, t, n) {
const r = n.config.validateStatus;
!n.status || !r || r(n.status) ? e(n) : t(new y(
"Request failed with status code " + n.status,
[y.ERR_BAD_REQUEST, y.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function En(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Sn(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let s = 0, o = 0, i;
return t = t !== void 0 ? t : 1e3, function(f) {
const u = Date.now(), l = r[o];
i || (i = u), n[s] = f, r[s] = u;
let h = o, S = 0;
for (; h !== s; )
S += n[h++], h = h % e;
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
return;
const R = l && u - l;
return R ? Math.round(S * 1e3 / R) : void 0;
};
}
function Rn(e, t) {
let n = 0, r = 1e3 / t, s, o;
const i = (u, l = Date.now()) => {
n = l, s = null, o && (clearTimeout(o), o = null), e.apply(null, u);
};
return [(...u) => {
const l = Date.now(), h = l - n;
h >= r ? i(u, l) : (s = u, o || (o = setTimeout(() => {
o = null, i(s);
}, r - h)));
}, () => s && i(s)];
}
const W = (e, t, n = 3) => {
let r = 0;
const s = Sn(50, 250);
return Rn((o) => {
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, f = i - r, u = s(f), l = i <= c;
r = i;
const h = {
loaded: i,
total: c,
progress: c ? i / c : void 0,
bytes: f,
rate: u || void 0,
estimated: u && c && l ? (c - i) / u : void 0,
event: o,
lengthComputable: c != null,
[t ? "download" : "upload"]: !0
};
e(h);
}, n);
}, ke = (e, t) => {
const n = e != null;
return [(r) => t[0]({
lengthComputable: n,
total: e,
loaded: r
}), t[1]];
}, Fe = (e) => (...t) => a.asap(() => e(...t)), On = C.hasStandardBrowserEnv ? (
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
function() {
const t = C.navigator && /(msie|trident)/i.test(C.navigator.userAgent), n = document.createElement("a");
let r;
function s(o) {
let i = o;
return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
href: n.href,
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
host: n.host,
search: n.search ? n.search.replace(/^\?/, "") : "",
hash: n.hash ? n.hash.replace(/^#/, "") : "",
hostname: n.hostname,
port: n.port,
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
};
}
return r = s(window.location.href), function(i) {
const c = a.isString(i) ? s(i) : i;
return c.protocol === r.protocol && c.host === r.host;
};
}()
) : (
// Non standard browser envs (web workers, react-native) lack needed support.
/* @__PURE__ */ function() {
return function() {
return !0;
};
}()
), Tn = C.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, s, o) {
const i = [e + "=" + encodeURIComponent(t)];
a.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), a.isString(r) && i.push("path=" + r), a.isString(s) && i.push("domain=" + s), o === !0 && i.push("secure"), document.cookie = i.join("; ");
},
read(e) {
const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
return t ? decodeURIComponent(t[3]) : null;
},
remove(e) {
this.write(e, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function An(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Cn(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function nt(e, t) {
return e && !An(t) ? Cn(e, t) : t;
}
const Ue = (e) => e instanceof F ? { ...e } : e;
function j(e, t) {
t = t || {};
const n = {};
function r(u, l, h) {
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: h }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
}
function s(u, l, h) {
if (a.isUndefined(l)) {
if (!a.isUndefined(u))
return r(void 0, u, h);
} else
return r(u, l, h);
}
function o(u, l) {
if (!a.isUndefined(l))
return r(void 0, l);
}
function i(u, l) {
if (a.isUndefined(l)) {
if (!a.isUndefined(u))
return r(void 0, u);
} else
return r(void 0, l);
}
function c(u, l, h) {
if (h in t)
return r(u, l);
if (h in e)
return r(void 0, u);
}
const f = {
url: o,
method: o,
data: o,
baseURL: i,
transformRequest: i,
transformResponse: i,
paramsSerializer: i,
timeout: i,
timeoutMessage: i,
withCredentials: i,
withXSRFToken: i,
adapter: i,
responseType: i,
xsrfCookieName: i,
xsrfHeaderName: i,
onUploadProgress: i,
onDownloadProgress: i,
decompress: i,
maxContentLength: i,
maxBodyLength: i,
beforeRedirect: i,
transport: i,
httpAgent: i,
httpsAgent: i,
cancelToken: i,
socketPath: i,
responseEncoding: i,
validateStatus: c,
headers: (u, l) => s(Ue(u), Ue(l), !0)
};
return a.forEach(Object.keys(Object.assign({}, e, t)), function(l) {
const h = f[l] || s, S = h(e[l], t[l], l);
a.isUndefined(S) && h !== c || (n[l] = S);
}), n;
}
const rt = (e) => {
const t = j({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: c } = t;
t.headers = i = F.from(i), t.url = Qe(nt(t.baseURL, t.url), e.params, e.paramsSerializer), c && i.set(
"Authorization",
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
);
let f;
if (a.isFormData(n)) {
if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
i.setContentType(void 0);
else if ((f = i.getContentType()) !== !1) {
const [u, ...l] = f ? f.split(";").map((h) => h.trim()).filter(Boolean) : [];
i.setContentType([u || "multipart/form-data", ...l].join("; "));
}
}
if (C.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && On(t.url))) {
const u = s && o && Tn.read(o);
u && i.set(s, u);
}
return t;
}, xn = typeof XMLHttpRequest < "u", Nn = xn && function(e) {
return new Promise(function(n, r) {
const s = rt(e);
let o = s.data;
const i = F.from(s.headers).normalize();
let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, h, S, R, d;
function m() {
R && R(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
}
let p = new XMLHttpRequest();
p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
function g() {
if (!p)
return;
const O = F.from(
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
), A = {
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
status: p.status,
statusText: p.statusText,
headers: O,
config: e,
request: p
};
tt(function(k) {
n(k), m();
}, function(k) {
r(k), m();
}, A), p = null;
}
"onloadend" in p ? p.onloadend = g : p.onreadystatechange = function() {
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(g);
}, p.onabort = function() {
p && (r(new y("Request aborted", y.ECONNABORTED, e, p)), p = null);
}, p.onerror = function() {
r(new y("Network Error", y.ERR_NETWORK, e, p)), p = null;
}, p.ontimeout = function() {
let E = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const A = s.transitional || Ze;
s.timeoutErrorMessage && (E = s.timeoutErrorMessage), r(new y(
E,
A.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
e,
p
)), p = null;
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(E, A) {
p.setRequestHeader(A, E);
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([S, d] = W(u, !0), p.addEventListener("progress", S)), f && p.upload && ([h, R] = W(f), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", R)), (s.cancelToken || s.signal) && (l = (O) => {
p && (r(!O || O.type ? new q(null, e, p) : O), p.abort(), p = null);
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
const b = En(s.url);
if (b && C.protocols.indexOf(b) === -1) {
r(new y("Unsupported protocol " + b + ":", y.ERR_BAD_REQUEST, e));
return;
}
p.send(o || null);
});
}, Pn = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];
if (t || n) {
let r = new AbortController(), s;
const o = function(u) {
if (!s) {
s = !0, c();
const l = u instanceof Error ? u : this.reason;
r.abort(l instanceof y ? l : new q(l instanceof Error ? l.message : l));
}
};
let i = t && setTimeout(() => {
i = null, o(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
}, t);
const c = () => {
e && (i && clearTimeout(i), i = null, e.forEach((u) => {
u.unsubscribe ? u.unsubscribe(o) : u.removeEventListener("abort", o);
}), e = null);
};
e.forEach((u) => u.addEventListener("abort", o));
const { signal: f } = r;
return f.unsubscribe = () => a.asap(c), f;
}
}, kn = Pn, Fn = function* (e, t) {
let n = e.byteLength;
if (!t || n < t) {
yield e;
return;
}
let r = 0, s;
for (; r < n; )
s = r + t, yield e.slice(r, s), r = s;
}, Un = async function* (e, t) {
for await (const n of Dn(e))
yield* Fn(n, t);
}, Dn = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: n, value: r } = await t.read();
if (n)
break;
yield r;
}
} finally {
await t.cancel();
}
}, De = (e, t, n, r) => {
const s = Un(e, t);
let o = 0, i, c = (f) => {
i || (i = !0, r && r(f));
};
return new ReadableStream({
async pull(f) {
try {
const { done: u, value: l } = await s.next();
if (u) {
c(), f.close();
return;
}
let h = l.byteLength;
if (n) {
let S = o += h;
n(S);
}
f.enqueue(new Uint8Array(l));
} catch (u) {
throw c(u), u;
}
},
cancel(f) {
return c(f), s.return();
}
}, {
highWaterMark: 2
});
}, te = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", st = te && typeof ReadableStream == "function", Ln = te && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), ot = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, Bn = st && ot(() => {
let e = !1;
const t = new Request(C.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return e = !0, "half";
}
}).headers.has("Content-Type");
return e && !t;
}), Le = 64 * 1024, le = st && ot(() => a.isReadableStream(new Response("").body)), K = {
stream: le && ((e) => e.body)
};
te && ((e) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
!K[t] && (K[t] = a.isFunction(e[t]) ? (n) => n[t]() : (n, r) => {
throw new y(`Response type '${t}' is not supported`, y.ERR_NOT_SUPPORT, r);
});
});
})(new Response());
const jn = async (e) => {
if (e == null)
return 0;
if (a.isBlob(e))
return e.size;
if (a.isSpecCompliantForm(e))
return (await new Request(C.origin, {
method: "POST",
body: e
}).arrayBuffer()).byteLength;
if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
return e.byteLength;
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
return (await Ln(e)).byteLength;
}, _n = async (e, t) => {
const n = a.toFiniteNumber(e.getContentLength());
return n ?? jn(t);
}, qn = te && (async (e) => {
let {
url: t,
method: n,
data: r,
signal: s,
cancelToken: o,
timeout: i,
onDownloadProgress: c,
onUploadProgress: f,
responseType: u,
headers: l,
withCredentials: h = "same-origin",
fetchOptions: S
} = rt(e);
u = u ? (u + "").toLowerCase() : "text";
let R = kn([s, o && o.toAbortSignal()], i), d;
const m = R && R.unsubscribe && (() => {
R.unsubscribe();
});
let p;
try {
if (f && Bn && n !== "get" && n !== "head" && (p = await _n(l, r)) !== 0) {
let A = new Request(t, {
method: "POST",
body: r,
duplex: "half"
}), P;
if (a.isFormData(r) && (P = A.headers.get("content-type")) && l.setContentType(P), A.body) {
const [k, L] = ke(
p,
W(Fe(f))
);
r = De(A.body, Le, k, L);
}
}
a.isString(h) || (h = h ? "include" : "omit");
const g = "credentials" in Request.prototype;
d = new Request(t, {
...S,
signal: R,
method: n.toUpperCase(),
headers: l.normalize().toJSON(),
body: r,
duplex: "half",
credentials: g ? h : void 0
});
let b = await fetch(d);
const O = le && (u === "stream" || u === "response");
if (le && (c || O && m)) {
const A = {};
["status", "statusText", "headers"].forEach((I) => {
A[I] = b[I];
});
const P = a.toFiniteNumber(b.headers.get("content-length")), [k, L] = c && ke(
P,
W(Fe(c), !0)
) || [];
b = new Response(
De(b.body, Le, k, () => {
L && L(), m && m();
}),
A
);
}
u = u || "text";
let E = await K[a.findKey(K, u) || "text"](b, e);
return !O && m && m(), await new Promise((A, P) => {
tt(A, P, {
data: E,
headers: F.from(b.headers),
status: b.status,
statusText: b.statusText,
config: e,
request: d
});
});
} catch (g) {
throw m && m(), g && g.name === "TypeError" && /fetch/i.test(g.message) ? Object.assign(
new y("Network Error", y.ERR_NETWORK, e, d),
{
cause: g.cause || g
}
) : y.from(g, g && g.code, e, d);
}
}), fe = {
http: Qt,
xhr: Nn,
fetch: qn
};
a.forEach(fe, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const Be = (e) => `- ${e}`, In = (e) => a.isFunction(e) || e === null || e === !1, it = {
getAdapter: (e) => {
e = a.isArray(e) ? e : [e];
const { length: t } = e;
let n, r;
const s = {};
for (let o = 0; o < t; o++) {
n = e[o];
let i;
if (r = n, !In(n) && (r = fe[(i = String(n)).toLowerCase()], r === void 0))
throw new y(`Unknown adapter '${i}'`);
if (r)
break;
s[i || "#" + o] = r;
}
if (!r) {
const o = Object.entries(s).map(
([c, f]) => `adapter ${c} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
);
let i = t ? o.length > 1 ? `since :
` + o.map(Be).join(`
`) : " " + Be(o[0]) : "as no adapter specified";
throw new y(
"There is no suitable adapter to dispatch the request " + i,
"ERR_NOT_SUPPORT"
);
}
return r;
},
adapters: fe
};
function oe(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new q(null, e);
}
function je(e) {
return oe(e), e.headers = F.from(e.headers), e.data = se.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), it.getAdapter(e.adapter || be.adapter)(e).then(function(r) {
return oe(e), r.data = se.call(
e,
e.transformResponse,
r
), r.headers = F.from(r.headers), r;
}, function(r) {
return et(r) || (oe(e), r && r.response && (r.response.data = se.call(
e,
e.transformResponse,
r.response
), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
});
}
const at = "1.7.7", Ee = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
Ee[e] = function(r) {
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const _e = {};
Ee.transitional = function(t, n, r) {
function s(o, i) {
return "[Axios v" + at + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
}
return (o, i, c) => {
if (t === !1)
throw new y(
s(i, " has been removed" + (n ? " in " + n : "")),
y.ERR_DEPRECATED
);
return n && !_e[i] && (_e[i] = !0, console.warn(
s(
i,
" has been deprecated since v" + n + " and will be removed in the near future"
)
)), t ? t(o, i, c) : !0;
};
};
function Hn(e, t, n) {
if (typeof e != "object")
throw new y("options must be an object", y.ERR_BAD_OPTION_VALUE);
const r = Object.keys(e);
let s = r.length;
for (; s-- > 0; ) {
const o = r[s], i = t[o];
if (i) {
const c = e[o], f = c === void 0 || i(c, o, e);
if (f !== !0)
throw new y("option " + o + " must be " + f, y.ERR_BAD_OPTION_VALUE);
continue;
}
if (n !== !0)
throw new y("Unknown option " + o, y.ERR_BAD_OPTION);
}
}
const de = {
assertOptions: Hn,
validators: Ee
}, D = de.validators;
class G {
constructor(t) {
this.defaults = t, this.interceptors = {
request: new Ne(),
response: new Ne()
};
}
/**
* Dispatch a request
*
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
* @param {?Object} config
*
* @returns {Promise} The Promise to be fulfilled
*/
async request(t, n) {
try {
return await this._request(t, n);
} catch (r) {
if (r instanceof Error) {
let s;
Error.captureStackTrace ? Error.captureStackTrace(s = {}) : s = new Error();
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
try {
r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + o) : r.stack = o;
} catch {
}
}
throw r;
}
}
_request(t, n) {
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = j(this.defaults, n);
const { transitional: r, paramsSerializer: s, headers: o } = n;
r !== void 0 && de.assertOptions(r, {
silentJSONParsing: D.transitional(D.boolean),
forcedJSONParsing: D.transitional(D.boolean),
clarifyTimeoutError: D.transitional(D.boolean)
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
serialize: s
} : de.assertOptions(s, {
encode: D.function,
serialize: D.function
}, !0)), n.method = (n.method || this.defaults.method || "get").toLowerCase();
let i = o && a.merge(
o.common,
o[n.method]
);
o && a.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(d) => {
delete o[d];
}
), n.headers = F.concat(i, o);
const c = [];
let f = !0;
this.interceptors.request.forEach(function(m) {
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, c.unshift(m.fulfilled, m.rejected));
});
const u = [];
this.interceptors.response.forEach(function(m) {
u.push(m.fulfilled, m.rejected);
});
let l, h = 0, S;
if (!f) {
const d = [je.bind(this), void 0];
for (d.unshift.apply(d, c), d.push.apply(d, u), S = d.length, l = Promise.resolve(n); h < S; )
l = l.then(d[h++], d[h++]);
return l;
}
S = c.length;
let R = n;
for (h = 0; h < S; ) {
const d = c[h++], m = c[h++];
try {
R = d(R);
} catch (p) {
m.call(this, p);
break;
}
}
try {
l = je.call(this, R);
} catch (d) {
return Promise.reject(d);
}
for (h = 0, S = u.length; h < S; )
l = l.then(u[h++], u[h++]);
return l;
}
getUri(t) {
t = j(this.defaults, t);
const n = nt(t.baseURL, t.url);
return Qe(n, t.params, t.paramsSerializer);
}
}
a.forEach(["delete", "get", "head", "options"], function(t) {
G.prototype[t] = function(n, r) {
return this.request(j(r || {}, {
method: t,
url: n,
data: (r || {}).data
}));
};
});
a.forEach(["post", "put", "patch"], function(t) {
function n(r) {
return function(o, i, c) {
return this.request(j(c || {}, {
method: t,
headers: r ? {
"Content-Type": "multipart/form-data"
} : {},
url: o,
data: i
}));
};
}
G.prototype[t] = n(), G.prototype[t + "Form"] = n(!0);
});
const V = G;
class Se {
constructor(t) {
if (typeof t != "function")
throw new TypeError("executor must be a function.");
let n;
this.promise = new Promise(function(o) {
n = o;
});
const r = this;
this.promise.then((s) => {
if (!r._listeners)
return;
let o = r._listeners.length;
for (; o-- > 0; )
r._listeners[o](s);
r._listeners = null;
}), this.promise.then = (s) => {
let o;
const i = new Promise((c) => {
r.subscribe(c), o = c;
}).then(s);
return i.cancel = function() {
r.unsubscribe(o);
}, i;
}, t(function(o, i, c) {
r.reason || (r.reason = new q(o, i, c), n(r.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(t) {
if (this.reason) {
t(this.reason);
return;
}
this._listeners ? this._listeners.push(t) : this._listeners = [t];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(t) {
if (!this._listeners)
return;
const n = this._listeners.indexOf(t);
n !== -1 && this._listeners.splice(n, 1);
}
toAbortSignal() {
const t = new AbortController(), n = (r) => {
t.abort(r);
};
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let t;
return {
token: new Se(function(s) {
t = s;
}),
cancel: t
};
}
}
const vn = Se;
function Mn(e) {
return function(n) {
return e.apply(null, n);
};
}
function zn(e) {
return a.isObject(e) && e.isAxiosError === !0;
}
const pe = {
Continue: 100,
SwitchingProtocols: 101,
Processing: 102,
EarlyHints: 103,
Ok: 200,
Created: 201,
Accepted: 202,
NonAuthoritativeInformation: 203,
NoContent: 204,
ResetContent: 205,
PartialContent: 206,
MultiStatus: 207,
AlreadyReported: 208,
ImUsed: 226,
MultipleChoices: 300,
MovedPermanently: 301,
Found: 302,
SeeOther: 303,
NotModified: 304,
UseProxy: 305,
Unused: 306,
TemporaryRedirect: 307,
PermanentRedirect: 308,
BadRequest: 400,
Unauthorized: 401,
PaymentRequired: 402,
Forbidden: 403,
NotFound: 404,
MethodNotAllowed: 405,
NotAcceptable: 406,
ProxyAuthenticationRequired: 407,
RequestTimeout: 408,
Conflict: 409,
Gone: 410,
LengthRequired: 411,
PreconditionFailed: 412,
PayloadTooLarge: 413,
UriTooLong: 414,
UnsupportedMediaType: 415,
RangeNotSatisfiable: 416,
ExpectationFailed: 417,
ImATeapot: 418,
MisdirectedRequest: 421,
UnprocessableEntity: 422,
Locked: 423,
FailedDependency: 424,
TooEarly: 425,
UpgradeRequired: 426,
PreconditionRequired: 428,
TooManyRequests: 429,
RequestHeaderFieldsTooLarge: 431,
UnavailableForLegalReasons: 451,
InternalServerError: 500,
NotImplemented: 501,
BadGateway: 502,
ServiceUnavailable: 503,
GatewayTimeout: 504,
HttpVersionNotSupported: 505,
VariantAlsoNegotiates: 506,
InsufficientStorage: 507,
LoopDetected: 508,
NotExtended: 510,
NetworkAuthenticationRequired: 511
};
Object.entries(pe).forEach(([e, t]) => {
pe[t] = e;
});
const Jn = pe;
function ct(e) {
const t = new V(e), n = Ie(V.prototype.request, t);
return a.extend(n, V.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(s) {
return ct(j(e, s));
}, n;
}
const T = ct(be);
T.Axios = V;
T.CanceledError = q;
T.CancelToken = vn;
T.isCancel = et;
T.VERSION = at;