@regulaforensics/document-reader-webclient
Version:
Regula Document Reader js client for the browser and node.js based on axios
1,692 lines • 277 kB
JavaScript
function fS(_, S) {
return function() {
return _.apply(S, arguments);
};
}
const { toString: LI } = Object.prototype, { getPrototypeOf: UE } = Object, { iterator: X_, toStringTag: BS } = Symbol, j_ = /* @__PURE__ */ ((_) => (S) => {
const E = LI.call(S);
return _[E] || (_[E] = E.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), Q = (_) => (_ = _.toLowerCase(), (S) => j_(S) === _), z_ = (_) => (S) => typeof S === _, { isArray: C_ } = Array, N_ = z_("undefined");
function h_(_) {
return _ !== null && !N_(_) && _.constructor !== null && !N_(_.constructor) && K(_.constructor.isBuffer) && _.constructor.isBuffer(_);
}
const hS = Q("ArrayBuffer");
function NI(_) {
let S;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? S = ArrayBuffer.isView(_) : S = _ && _.buffer && hS(_.buffer), S;
}
const CI = z_("string"), K = z_("function"), uS = z_("number"), u_ = (_) => _ !== null && typeof _ == "object", sI = (_) => _ === !0 || _ === !1, w_ = (_) => {
if (j_(_) !== "object")
return !1;
const S = UE(_);
return (S === null || S === Object.prototype || Object.getPrototypeOf(S) === null) && !(BS in _) && !(X_ in _);
}, aI = (_) => {
if (!u_(_) || h_(_))
return !1;
try {
return Object.keys(_).length === 0 && Object.getPrototypeOf(_) === Object.prototype;
} catch {
return !1;
}
}, cI = Q("Date"), MI = Q("File"), UI = Q("Blob"), fI = Q("FileList"), BI = (_) => u_(_) && K(_.pipe), hI = (_) => {
let S;
return _ && (typeof FormData == "function" && _ instanceof FormData || K(_.append) && ((S = j_(_)) === "formdata" || // detect form-data instance
S === "object" && K(_.toString) && _.toString() === "[object FormData]"));
}, uI = Q("URLSearchParams"), [HI, VI, oI, GI] = ["ReadableStream", "Request", "Response", "Headers"].map(Q), PI = (_) => _.trim ? _.trim() : _.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function H_(_, S, { allOwnKeys: E = !1 } = {}) {
if (_ === null || typeof _ > "u")
return;
let I, A;
if (typeof _ != "object" && (_ = [_]), C_(_))
for (I = 0, A = _.length; I < A; I++)
S.call(null, _[I], I, _);
else {
if (h_(_))
return;
const t = E ? Object.getOwnPropertyNames(_) : Object.keys(_), R = t.length;
let r;
for (I = 0; I < R; I++)
r = t[I], S.call(null, _[r], r, _);
}
}
function HS(_, S) {
if (h_(_))
return null;
S = S.toLowerCase();
const E = Object.keys(_);
let I = E.length, A;
for (; I-- > 0; )
if (A = E[I], S === A.toLowerCase())
return A;
return null;
}
const I_ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, VS = (_) => !N_(_) && _ !== I_;
function RE() {
const { caseless: _, skipUndefined: S } = VS(this) && this || {}, E = {}, I = (A, t) => {
const R = _ && HS(E, t) || t;
w_(E[R]) && w_(A) ? E[R] = RE(E[R], A) : w_(A) ? E[R] = RE({}, A) : C_(A) ? E[R] = A.slice() : (!S || !N_(A)) && (E[R] = A);
};
for (let A = 0, t = arguments.length; A < t; A++)
arguments[A] && H_(arguments[A], I);
return E;
}
const lI = (_, S, E, { allOwnKeys: I } = {}) => (H_(S, (A, t) => {
E && K(A) ? _[t] = fS(A, E) : _[t] = A;
}, { allOwnKeys: I }), _), mI = (_) => (_.charCodeAt(0) === 65279 && (_ = _.slice(1)), _), eI = (_, S, E, I) => {
_.prototype = Object.create(S.prototype, I), _.prototype.constructor = _, Object.defineProperty(_, "super", {
value: S.prototype
}), E && Object.assign(_.prototype, E);
}, bI = (_, S, E, I) => {
let A, t, R;
const r = {};
if (S = S || {}, _ == null) return S;
do {
for (A = Object.getOwnPropertyNames(_), t = A.length; t-- > 0; )
R = A[t], (!I || I(R, _, S)) && !r[R] && (S[R] = _[R], r[R] = !0);
_ = E !== !1 && UE(_);
} while (_ && (!E || E(_, S)) && _ !== Object.prototype);
return S;
}, YI = (_, S, E) => {
_ = String(_), (E === void 0 || E > _.length) && (E = _.length), E -= S.length;
const I = _.indexOf(S, E);
return I !== -1 && I === E;
}, wI = (_) => {
if (!_) return null;
if (C_(_)) return _;
let S = _.length;
if (!uS(S)) return null;
const E = new Array(S);
for (; S-- > 0; )
E[S] = _[S];
return E;
}, KI = /* @__PURE__ */ ((_) => (S) => _ && S instanceof _)(typeof Uint8Array < "u" && UE(Uint8Array)), TI = (_, S) => {
const I = (_ && _[X_]).call(_);
let A;
for (; (A = I.next()) && !A.done; ) {
const t = A.value;
S.call(_, t[0], t[1]);
}
}, vI = (_, S) => {
let E;
const I = [];
for (; (E = _.exec(S)) !== null; )
I.push(E);
return I;
}, WI = Q("HTMLFormElement"), ZI = (_) => _.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(E, I, A) {
return I.toUpperCase() + A;
}
), oE = (({ hasOwnProperty: _ }) => (S, E) => _.call(S, E))(Object.prototype), XI = Q("RegExp"), oS = (_, S) => {
const E = Object.getOwnPropertyDescriptors(_), I = {};
H_(E, (A, t) => {
let R;
(R = S(A, t, _)) !== !1 && (I[t] = R || A);
}), Object.defineProperties(_, I);
}, jI = (_) => {
oS(_, (S, E) => {
if (K(_) && ["arguments", "caller", "callee"].indexOf(E) !== -1)
return !1;
const I = _[E];
if (K(I)) {
if (S.enumerable = !1, "writable" in S) {
S.writable = !1;
return;
}
S.set || (S.set = () => {
throw Error("Can not rewrite read-only method '" + E + "'");
});
}
});
}, zI = (_, S) => {
const E = {}, I = (A) => {
A.forEach((t) => {
E[t] = !0;
});
};
return C_(_) ? I(_) : I(String(_).split(S)), E;
}, JI = () => {
}, qI = (_, S) => _ != null && Number.isFinite(_ = +_) ? _ : S;
function $I(_) {
return !!(_ && K(_.append) && _[BS] === "FormData" && _[X_]);
}
const kI = (_) => {
const S = new Array(10), E = (I, A) => {
if (u_(I)) {
if (S.indexOf(I) >= 0)
return;
if (h_(I))
return I;
if (!("toJSON" in I)) {
S[A] = I;
const t = C_(I) ? [] : {};
return H_(I, (R, r) => {
const D = E(R, A + 1);
!N_(D) && (t[r] = D);
}), S[A] = void 0, t;
}
}
return I;
};
return E(_, 0);
}, QI = Q("AsyncFunction"), iI = (_) => _ && (u_(_) || K(_)) && K(_.then) && K(_.catch), GS = ((_, S) => _ ? setImmediate : S ? ((E, I) => (I_.addEventListener("message", ({ source: A, data: t }) => {
A === I_ && t === E && I.length && I.shift()();
}, !1), (A) => {
I.push(A), I_.postMessage(E, "*");
}))(`axios@${Math.random()}`, []) : (E) => setTimeout(E))(
typeof setImmediate == "function",
K(I_.postMessage)
), gI = typeof queueMicrotask < "u" ? queueMicrotask.bind(I_) : typeof process < "u" && process.nextTick || GS, FI = (_) => _ != null && K(_[X_]), L = {
isArray: C_,
isArrayBuffer: hS,
isBuffer: h_,
isFormData: hI,
isArrayBufferView: NI,
isString: CI,
isNumber: uS,
isBoolean: sI,
isObject: u_,
isPlainObject: w_,
isEmptyObject: aI,
isReadableStream: HI,
isRequest: VI,
isResponse: oI,
isHeaders: GI,
isUndefined: N_,
isDate: cI,
isFile: MI,
isBlob: UI,
isRegExp: XI,
isFunction: K,
isStream: BI,
isURLSearchParams: uI,
isTypedArray: KI,
isFileList: fI,
forEach: H_,
merge: RE,
extend: lI,
trim: PI,
stripBOM: mI,
inherits: eI,
toFlatObject: bI,
kindOf: j_,
kindOfTest: Q,
endsWith: YI,
toArray: wI,
forEachEntry: TI,
matchAll: vI,
isHTMLForm: WI,
hasOwnProperty: oE,
hasOwnProp: oE,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: oS,
freezeMethods: jI,
toObjectSet: zI,
toCamelCase: ZI,
noop: JI,
toFiniteNumber: qI,
findKey: HS,
global: I_,
isContextDefined: VS,
isSpecCompliantForm: $I,
toJSONObject: kI,
isAsyncFn: QI,
isThenable: iI,
setImmediate: GS,
asap: gI,
isIterable: FI
};
function o(_, S, E, I, A) {
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = _, this.name = "AxiosError", S && (this.code = S), E && (this.config = E), I && (this.request = I), A && (this.response = A, this.status = A.status ? A.status : null);
}
L.inherits(o, 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: L.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const PS = o.prototype, lS = {};
[
"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((_) => {
lS[_] = { value: _ };
});
Object.defineProperties(o, lS);
Object.defineProperty(PS, "isAxiosError", { value: !0 });
o.from = (_, S, E, I, A, t) => {
const R = Object.create(PS);
L.toFlatObject(_, R, function(n) {
return n !== Error.prototype;
}, (O) => O !== "isAxiosError");
const r = _ && _.message ? _.message : "Error", D = S == null && _ ? _.code : S;
return o.call(R, r, D, E, I, A), _ && R.cause == null && Object.defineProperty(R, "cause", { value: _, configurable: !0 }), R.name = _ && _.name || "Error", t && Object.assign(R, t), R;
};
const xI = null;
function OE(_) {
return L.isPlainObject(_) || L.isArray(_);
}
function mS(_) {
return L.endsWith(_, "[]") ? _.slice(0, -2) : _;
}
function GE(_, S, E) {
return _ ? _.concat(S).map(function(A, t) {
return A = mS(A), !E && t ? "[" + A + "]" : A;
}).join(E ? "." : "") : S;
}
function dI(_) {
return L.isArray(_) && !_.some(OE);
}
const pI = L.toFlatObject(L, {}, null, function(S) {
return /^is[A-Z]/.test(S);
});
function J_(_, S, E) {
if (!L.isObject(_))
throw new TypeError("target must be an object");
S = S || new FormData(), E = L.toFlatObject(E, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(U, s) {
return !L.isUndefined(s[U]);
});
const I = E.metaTokens, A = E.visitor || n, t = E.dots, R = E.indexes, D = (E.Blob || typeof Blob < "u" && Blob) && L.isSpecCompliantForm(S);
if (!L.isFunction(A))
throw new TypeError("visitor must be a function");
function O(N) {
if (N === null) return "";
if (L.isDate(N))
return N.toISOString();
if (L.isBoolean(N))
return N.toString();
if (!D && L.isBlob(N))
throw new o("Blob is not supported. Use a Buffer instead.");
return L.isArrayBuffer(N) || L.isTypedArray(N) ? D && typeof Blob == "function" ? new Blob([N]) : Buffer.from(N) : N;
}
function n(N, U, s) {
let B = N;
if (N && !s && typeof N == "object") {
if (L.endsWith(U, "{}"))
U = I ? U : U.slice(0, -2), N = JSON.stringify(N);
else if (L.isArray(N) && dI(N) || (L.isFileList(N) || L.endsWith(U, "[]")) && (B = L.toArray(N)))
return U = mS(U), B.forEach(function(h, a) {
!(L.isUndefined(h) || h === null) && S.append(
// eslint-disable-next-line no-nested-ternary
R === !0 ? GE([U], a, t) : R === null ? U : U + "[]",
O(h)
);
}), !1;
}
return OE(N) ? !0 : (S.append(GE(s, U, t), O(N)), !1);
}
const c = [], M = Object.assign(pI, {
defaultVisitor: n,
convertValue: O,
isVisitable: OE
});
function C(N, U) {
if (!L.isUndefined(N)) {
if (c.indexOf(N) !== -1)
throw Error("Circular reference detected in " + U.join("."));
c.push(N), L.forEach(N, function(B, H) {
(!(L.isUndefined(B) || B === null) && A.call(
S,
B,
L.isString(H) ? H.trim() : H,
U,
M
)) === !0 && C(B, U ? U.concat(H) : [H]);
}), c.pop();
}
}
if (!L.isObject(_))
throw new TypeError("data must be an object");
return C(_), S;
}
function PE(_) {
const S = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(_).replace(/[!'()~]|%20|%00/g, function(I) {
return S[I];
});
}
function fE(_, S) {
this._pairs = [], _ && J_(_, this, S);
}
const eS = fE.prototype;
eS.append = function(S, E) {
this._pairs.push([S, E]);
};
eS.toString = function(S) {
const E = S ? function(I) {
return S.call(this, I, PE);
} : PE;
return this._pairs.map(function(A) {
return E(A[0]) + "=" + E(A[1]);
}, "").join("&");
};
function yI(_) {
return encodeURIComponent(_).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function bS(_, S, E) {
if (!S)
return _;
const I = E && E.encode || yI;
L.isFunction(E) && (E = {
serialize: E
});
const A = E && E.serialize;
let t;
if (A ? t = A(S, E) : t = L.isURLSearchParams(S) ? S.toString() : new fE(S, E).toString(I), t) {
const R = _.indexOf("#");
R !== -1 && (_ = _.slice(0, R)), _ += (_.indexOf("?") === -1 ? "?" : "&") + t;
}
return _;
}
class lE {
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(S, E, I) {
return this.handlers.push({
fulfilled: S,
rejected: E,
synchronous: I ? I.synchronous : !1,
runWhen: I ? I.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(S) {
this.handlers[S] && (this.handlers[S] = 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(S) {
L.forEach(this.handlers, function(I) {
I !== null && S(I);
});
}
}
const YS = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, _A = typeof URLSearchParams < "u" ? URLSearchParams : fE, EA = typeof FormData < "u" ? FormData : null, SA = typeof Blob < "u" ? Blob : null, IA = {
isBrowser: !0,
classes: {
URLSearchParams: _A,
FormData: EA,
Blob: SA
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, BE = typeof window < "u" && typeof document < "u", rE = typeof navigator == "object" && navigator || void 0, AA = BE && (!rE || ["ReactNative", "NativeScript", "NS"].indexOf(rE.product) < 0), tA = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", RA = BE && window.location.href || "http://localhost", OA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: BE,
hasStandardBrowserEnv: AA,
hasStandardBrowserWebWorkerEnv: tA,
navigator: rE,
origin: RA
}, Symbol.toStringTag, { value: "Module" })), w = {
...OA,
...IA
};
function rA(_, S) {
return J_(_, new w.classes.URLSearchParams(), {
visitor: function(E, I, A, t) {
return w.isNode && L.isBuffer(E) ? (this.append(I, E.toString("base64")), !1) : t.defaultVisitor.apply(this, arguments);
},
...S
});
}
function nA(_) {
return L.matchAll(/\w+|\[(\w*)]/g, _).map((S) => S[0] === "[]" ? "" : S[1] || S[0]);
}
function DA(_) {
const S = {}, E = Object.keys(_);
let I;
const A = E.length;
let t;
for (I = 0; I < A; I++)
t = E[I], S[t] = _[t];
return S;
}
function wS(_) {
function S(E, I, A, t) {
let R = E[t++];
if (R === "__proto__") return !0;
const r = Number.isFinite(+R), D = t >= E.length;
return R = !R && L.isArray(A) ? A.length : R, D ? (L.hasOwnProp(A, R) ? A[R] = [A[R], I] : A[R] = I, !r) : ((!A[R] || !L.isObject(A[R])) && (A[R] = []), S(E, I, A[R], t) && L.isArray(A[R]) && (A[R] = DA(A[R])), !r);
}
if (L.isFormData(_) && L.isFunction(_.entries)) {
const E = {};
return L.forEachEntry(_, (I, A) => {
S(nA(I), A, E, 0);
}), E;
}
return null;
}
function LA(_, S, E) {
if (L.isString(_))
try {
return (S || JSON.parse)(_), L.trim(_);
} catch (I) {
if (I.name !== "SyntaxError")
throw I;
}
return (E || JSON.stringify)(_);
}
const V_ = {
transitional: YS,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(S, E) {
const I = E.getContentType() || "", A = I.indexOf("application/json") > -1, t = L.isObject(S);
if (t && L.isHTMLForm(S) && (S = new FormData(S)), L.isFormData(S))
return A ? JSON.stringify(wS(S)) : S;
if (L.isArrayBuffer(S) || L.isBuffer(S) || L.isStream(S) || L.isFile(S) || L.isBlob(S) || L.isReadableStream(S))
return S;
if (L.isArrayBufferView(S))
return S.buffer;
if (L.isURLSearchParams(S))
return E.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), S.toString();
let r;
if (t) {
if (I.indexOf("application/x-www-form-urlencoded") > -1)
return rA(S, this.formSerializer).toString();
if ((r = L.isFileList(S)) || I.indexOf("multipart/form-data") > -1) {
const D = this.env && this.env.FormData;
return J_(
r ? { "files[]": S } : S,
D && new D(),
this.formSerializer
);
}
}
return t || A ? (E.setContentType("application/json", !1), LA(S)) : S;
}],
transformResponse: [function(S) {
const E = this.transitional || V_.transitional, I = E && E.forcedJSONParsing, A = this.responseType === "json";
if (L.isResponse(S) || L.isReadableStream(S))
return S;
if (S && L.isString(S) && (I && !this.responseType || A)) {
const R = !(E && E.silentJSONParsing) && A;
try {
return JSON.parse(S, this.parseReviver);
} catch (r) {
if (R)
throw r.name === "SyntaxError" ? o.from(r, o.ERR_BAD_RESPONSE, this, null, this.response) : r;
}
}
return S;
}],
/**
* 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: w.classes.FormData,
Blob: w.classes.Blob
},
validateStatus: function(S) {
return S >= 200 && S < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
L.forEach(["delete", "get", "head", "post", "put", "patch"], (_) => {
V_.headers[_] = {};
});
const NA = L.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"
]), CA = (_) => {
const S = {};
let E, I, A;
return _ && _.split(`
`).forEach(function(R) {
A = R.indexOf(":"), E = R.substring(0, A).trim().toLowerCase(), I = R.substring(A + 1).trim(), !(!E || S[E] && NA[E]) && (E === "set-cookie" ? S[E] ? S[E].push(I) : S[E] = [I] : S[E] = S[E] ? S[E] + ", " + I : I);
}), S;
}, mE = Symbol("internals");
function c_(_) {
return _ && String(_).trim().toLowerCase();
}
function K_(_) {
return _ === !1 || _ == null ? _ : L.isArray(_) ? _.map(K_) : String(_);
}
function sA(_) {
const S = /* @__PURE__ */ Object.create(null), E = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let I;
for (; I = E.exec(_); )
S[I[1]] = I[2];
return S;
}
const aA = (_) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_.trim());
function g_(_, S, E, I, A) {
if (L.isFunction(I))
return I.call(this, S, E);
if (A && (S = E), !!L.isString(S)) {
if (L.isString(I))
return S.indexOf(I) !== -1;
if (L.isRegExp(I))
return I.test(S);
}
}
function cA(_) {
return _.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (S, E, I) => E.toUpperCase() + I);
}
function MA(_, S) {
const E = L.toCamelCase(" " + S);
["get", "set", "has"].forEach((I) => {
Object.defineProperty(_, I + E, {
value: function(A, t, R) {
return this[I].call(this, S, A, t, R);
},
configurable: !0
});
});
}
let T = class {
constructor(S) {
S && this.set(S);
}
set(S, E, I) {
const A = this;
function t(r, D, O) {
const n = c_(D);
if (!n)
throw new Error("header name must be a non-empty string");
const c = L.findKey(A, n);
(!c || A[c] === void 0 || O === !0 || O === void 0 && A[c] !== !1) && (A[c || D] = K_(r));
}
const R = (r, D) => L.forEach(r, (O, n) => t(O, n, D));
if (L.isPlainObject(S) || S instanceof this.constructor)
R(S, E);
else if (L.isString(S) && (S = S.trim()) && !aA(S))
R(CA(S), E);
else if (L.isObject(S) && L.isIterable(S)) {
let r = {}, D, O;
for (const n of S) {
if (!L.isArray(n))
throw TypeError("Object iterator must return a key-value pair");
r[O = n[0]] = (D = r[O]) ? L.isArray(D) ? [...D, n[1]] : [D, n[1]] : n[1];
}
R(r, E);
} else
S != null && t(E, S, I);
return this;
}
get(S, E) {
if (S = c_(S), S) {
const I = L.findKey(this, S);
if (I) {
const A = this[I];
if (!E)
return A;
if (E === !0)
return sA(A);
if (L.isFunction(E))
return E.call(this, A, I);
if (L.isRegExp(E))
return E.exec(A);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(S, E) {
if (S = c_(S), S) {
const I = L.findKey(this, S);
return !!(I && this[I] !== void 0 && (!E || g_(this, this[I], I, E)));
}
return !1;
}
delete(S, E) {
const I = this;
let A = !1;
function t(R) {
if (R = c_(R), R) {
const r = L.findKey(I, R);
r && (!E || g_(I, I[r], r, E)) && (delete I[r], A = !0);
}
}
return L.isArray(S) ? S.forEach(t) : t(S), A;
}
clear(S) {
const E = Object.keys(this);
let I = E.length, A = !1;
for (; I--; ) {
const t = E[I];
(!S || g_(this, this[t], t, S, !0)) && (delete this[t], A = !0);
}
return A;
}
normalize(S) {
const E = this, I = {};
return L.forEach(this, (A, t) => {
const R = L.findKey(I, t);
if (R) {
E[R] = K_(A), delete E[t];
return;
}
const r = S ? cA(t) : String(t).trim();
r !== t && delete E[t], E[r] = K_(A), I[r] = !0;
}), this;
}
concat(...S) {
return this.constructor.concat(this, ...S);
}
toJSON(S) {
const E = /* @__PURE__ */ Object.create(null);
return L.forEach(this, (I, A) => {
I != null && I !== !1 && (E[A] = S && L.isArray(I) ? I.join(", ") : I);
}), E;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([S, E]) => S + ": " + E).join(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() {
return "AxiosHeaders";
}
static from(S) {
return S instanceof this ? S : new this(S);
}
static concat(S, ...E) {
const I = new this(S);
return E.forEach((A) => I.set(A)), I;
}
static accessor(S) {
const I = (this[mE] = this[mE] = {
accessors: {}
}).accessors, A = this.prototype;
function t(R) {
const r = c_(R);
I[r] || (MA(A, R), I[r] = !0);
}
return L.isArray(S) ? S.forEach(t) : t(S), this;
}
};
T.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
L.reduceDescriptors(T.prototype, ({ value: _ }, S) => {
let E = S[0].toUpperCase() + S.slice(1);
return {
get: () => _,
set(I) {
this[E] = I;
}
};
});
L.freezeMethods(T);
function F_(_, S) {
const E = this || V_, I = S || E, A = T.from(I.headers);
let t = I.data;
return L.forEach(_, function(r) {
t = r.call(E, t, A.normalize(), S ? S.status : void 0);
}), A.normalize(), t;
}
function KS(_) {
return !!(_ && _.__CANCEL__);
}
function s_(_, S, E) {
o.call(this, _ ?? "canceled", o.ERR_CANCELED, S, E), this.name = "CanceledError";
}
L.inherits(s_, o, {
__CANCEL__: !0
});
function TS(_, S, E) {
const I = E.config.validateStatus;
!E.status || !I || I(E.status) ? _(E) : S(new o(
"Request failed with status code " + E.status,
[o.ERR_BAD_REQUEST, o.ERR_BAD_RESPONSE][Math.floor(E.status / 100) - 4],
E.config,
E.request,
E
));
}
function UA(_) {
const S = /^([-+\w]{1,25})(:?\/\/|:)/.exec(_);
return S && S[1] || "";
}
function fA(_, S) {
_ = _ || 10;
const E = new Array(_), I = new Array(_);
let A = 0, t = 0, R;
return S = S !== void 0 ? S : 1e3, function(D) {
const O = Date.now(), n = I[t];
R || (R = O), E[A] = D, I[A] = O;
let c = t, M = 0;
for (; c !== A; )
M += E[c++], c = c % _;
if (A = (A + 1) % _, A === t && (t = (t + 1) % _), O - R < S)
return;
const C = n && O - n;
return C ? Math.round(M * 1e3 / C) : void 0;
};
}
function BA(_, S) {
let E = 0, I = 1e3 / S, A, t;
const R = (O, n = Date.now()) => {
E = n, A = null, t && (clearTimeout(t), t = null), _(...O);
};
return [(...O) => {
const n = Date.now(), c = n - E;
c >= I ? R(O, n) : (A = O, t || (t = setTimeout(() => {
t = null, R(A);
}, I - c)));
}, () => A && R(A)];
}
const W_ = (_, S, E = 3) => {
let I = 0;
const A = fA(50, 250);
return BA((t) => {
const R = t.loaded, r = t.lengthComputable ? t.total : void 0, D = R - I, O = A(D), n = R <= r;
I = R;
const c = {
loaded: R,
total: r,
progress: r ? R / r : void 0,
bytes: D,
rate: O || void 0,
estimated: O && r && n ? (r - R) / O : void 0,
event: t,
lengthComputable: r != null,
[S ? "download" : "upload"]: !0
};
_(c);
}, E);
}, eE = (_, S) => {
const E = _ != null;
return [(I) => S[0]({
lengthComputable: E,
total: _,
loaded: I
}), S[1]];
}, bE = (_) => (...S) => L.asap(() => _(...S)), hA = w.hasStandardBrowserEnv ? /* @__PURE__ */ ((_, S) => (E) => (E = new URL(E, w.origin), _.protocol === E.protocol && _.host === E.host && (S || _.port === E.port)))(
new URL(w.origin),
w.navigator && /(msie|trident)/i.test(w.navigator.userAgent)
) : () => !0, uA = w.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(_, S, E, I, A, t) {
const R = [_ + "=" + encodeURIComponent(S)];
L.isNumber(E) && R.push("expires=" + new Date(E).toGMTString()), L.isString(I) && R.push("path=" + I), L.isString(A) && R.push("domain=" + A), t === !0 && R.push("secure"), document.cookie = R.join("; ");
},
read(_) {
const S = document.cookie.match(new RegExp("(^|;\\s*)(" + _ + ")=([^;]*)"));
return S ? decodeURIComponent(S[3]) : null;
},
remove(_) {
this.write(_, "", Date.now() - 864e5);
}
}
) : (
// Non-standard browser env (web workers, react-native) lack needed support.
{
write() {
},
read() {
return null;
},
remove() {
}
}
);
function HA(_) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(_);
}
function VA(_, S) {
return S ? _.replace(/\/?\/$/, "") + "/" + S.replace(/^\/+/, "") : _;
}
function vS(_, S, E) {
let I = !HA(S);
return _ && (I || E == !1) ? VA(_, S) : S;
}
const YE = (_) => _ instanceof T ? { ..._ } : _;
function t_(_, S) {
S = S || {};
const E = {};
function I(O, n, c, M) {
return L.isPlainObject(O) && L.isPlainObject(n) ? L.merge.call({ caseless: M }, O, n) : L.isPlainObject(n) ? L.merge({}, n) : L.isArray(n) ? n.slice() : n;
}
function A(O, n, c, M) {
if (L.isUndefined(n)) {
if (!L.isUndefined(O))
return I(void 0, O, c, M);
} else return I(O, n, c, M);
}
function t(O, n) {
if (!L.isUndefined(n))
return I(void 0, n);
}
function R(O, n) {
if (L.isUndefined(n)) {
if (!L.isUndefined(O))
return I(void 0, O);
} else return I(void 0, n);
}
function r(O, n, c) {
if (c in S)
return I(O, n);
if (c in _)
return I(void 0, O);
}
const D = {
url: t,
method: t,
data: t,
baseURL: R,
transformRequest: R,
transformResponse: R,
paramsSerializer: R,
timeout: R,
timeoutMessage: R,
withCredentials: R,
withXSRFToken: R,
adapter: R,
responseType: R,
xsrfCookieName: R,
xsrfHeaderName: R,
onUploadProgress: R,
onDownloadProgress: R,
decompress: R,
maxContentLength: R,
maxBodyLength: R,
beforeRedirect: R,
transport: R,
httpAgent: R,
httpsAgent: R,
cancelToken: R,
socketPath: R,
responseEncoding: R,
validateStatus: r,
headers: (O, n, c) => A(YE(O), YE(n), c, !0)
};
return L.forEach(Object.keys({ ..._, ...S }), function(n) {
const c = D[n] || A, M = c(_[n], S[n], n);
L.isUndefined(M) && c !== r || (E[n] = M);
}), E;
}
const WS = (_) => {
const S = t_({}, _);
let { data: E, withXSRFToken: I, xsrfHeaderName: A, xsrfCookieName: t, headers: R, auth: r } = S;
if (S.headers = R = T.from(R), S.url = bS(vS(S.baseURL, S.url, S.allowAbsoluteUrls), _.params, _.paramsSerializer), r && R.set(
"Authorization",
"Basic " + btoa((r.username || "") + ":" + (r.password ? unescape(encodeURIComponent(r.password)) : ""))
), L.isFormData(E)) {
if (w.hasStandardBrowserEnv || w.hasStandardBrowserWebWorkerEnv)
R.setContentType(void 0);
else if (L.isFunction(E.getHeaders)) {
const D = E.getHeaders(), O = ["content-type", "content-length"];
Object.entries(D).forEach(([n, c]) => {
O.includes(n.toLowerCase()) && R.set(n, c);
});
}
}
if (w.hasStandardBrowserEnv && (I && L.isFunction(I) && (I = I(S)), I || I !== !1 && hA(S.url))) {
const D = A && t && uA.read(t);
D && R.set(A, D);
}
return S;
}, oA = typeof XMLHttpRequest < "u", GA = oA && function(_) {
return new Promise(function(E, I) {
const A = WS(_);
let t = A.data;
const R = T.from(A.headers).normalize();
let { responseType: r, onUploadProgress: D, onDownloadProgress: O } = A, n, c, M, C, N;
function U() {
C && C(), N && N(), A.cancelToken && A.cancelToken.unsubscribe(n), A.signal && A.signal.removeEventListener("abort", n);
}
let s = new XMLHttpRequest();
s.open(A.method.toUpperCase(), A.url, !0), s.timeout = A.timeout;
function B() {
if (!s)
return;
const h = T.from(
"getAllResponseHeaders" in s && s.getAllResponseHeaders()
), V = {
data: !r || r === "text" || r === "json" ? s.responseText : s.response,
status: s.status,
statusText: s.statusText,
headers: h,
config: _,
request: s
};
TS(function(f) {
E(f), U();
}, function(f) {
I(f), U();
}, V), s = null;
}
"onloadend" in s ? s.onloadend = B : s.onreadystatechange = function() {
!s || s.readyState !== 4 || s.status === 0 && !(s.responseURL && s.responseURL.indexOf("file:") === 0) || setTimeout(B);
}, s.onabort = function() {
s && (I(new o("Request aborted", o.ECONNABORTED, _, s)), s = null);
}, s.onerror = function(a) {
const V = a && a.message ? a.message : "Network Error", e = new o(V, o.ERR_NETWORK, _, s);
e.event = a || null, I(e), s = null;
}, s.ontimeout = function() {
let a = A.timeout ? "timeout of " + A.timeout + "ms exceeded" : "timeout exceeded";
const V = A.transitional || YS;
A.timeoutErrorMessage && (a = A.timeoutErrorMessage), I(new o(
a,
V.clarifyTimeoutError ? o.ETIMEDOUT : o.ECONNABORTED,
_,
s
)), s = null;
}, t === void 0 && R.setContentType(null), "setRequestHeader" in s && L.forEach(R.toJSON(), function(a, V) {
s.setRequestHeader(V, a);
}), L.isUndefined(A.withCredentials) || (s.withCredentials = !!A.withCredentials), r && r !== "json" && (s.responseType = A.responseType), O && ([M, N] = W_(O, !0), s.addEventListener("progress", M)), D && s.upload && ([c, C] = W_(D), s.upload.addEventListener("progress", c), s.upload.addEventListener("loadend", C)), (A.cancelToken || A.signal) && (n = (h) => {
s && (I(!h || h.type ? new s_(null, _, s) : h), s.abort(), s = null);
}, A.cancelToken && A.cancelToken.subscribe(n), A.signal && (A.signal.aborted ? n() : A.signal.addEventListener("abort", n)));
const H = UA(A.url);
if (H && w.protocols.indexOf(H) === -1) {
I(new o("Unsupported protocol " + H + ":", o.ERR_BAD_REQUEST, _));
return;
}
s.send(t || null);
});
}, PA = (_, S) => {
const { length: E } = _ = _ ? _.filter(Boolean) : [];
if (S || E) {
let I = new AbortController(), A;
const t = function(O) {
if (!A) {
A = !0, r();
const n = O instanceof Error ? O : this.reason;
I.abort(n instanceof o ? n : new s_(n instanceof Error ? n.message : n));
}
};
let R = S && setTimeout(() => {
R = null, t(new o(`timeout ${S} of ms exceeded`, o.ETIMEDOUT));
}, S);
const r = () => {
_ && (R && clearTimeout(R), R = null, _.forEach((O) => {
O.unsubscribe ? O.unsubscribe(t) : O.removeEventListener("abort", t);
}), _ = null);
};
_.forEach((O) => O.addEventListener("abort", t));
const { signal: D } = I;
return D.unsubscribe = () => L.asap(r), D;
}
}, lA = function* (_, S) {
let E = _.byteLength;
if (E < S) {
yield _;
return;
}
let I = 0, A;
for (; I < E; )
A = I + S, yield _.slice(I, A), I = A;
}, mA = async function* (_, S) {
for await (const E of eA(_))
yield* lA(E, S);
}, eA = async function* (_) {
if (_[Symbol.asyncIterator]) {
yield* _;
return;
}
const S = _.getReader();
try {
for (; ; ) {
const { done: E, value: I } = await S.read();
if (E)
break;
yield I;
}
} finally {
await S.cancel();
}
}, wE = (_, S, E, I) => {
const A = mA(_, S);
let t = 0, R, r = (D) => {
R || (R = !0, I && I(D));
};
return new ReadableStream({
async pull(D) {
try {
const { done: O, value: n } = await A.next();
if (O) {
r(), D.close();
return;
}
let c = n.byteLength;
if (E) {
let M = t += c;
E(M);
}
D.enqueue(new Uint8Array(n));
} catch (O) {
throw r(O), O;
}
},
cancel(D) {
return r(D), A.return();
}
}, {
highWaterMark: 2
});
}, KE = 64 * 1024, { isFunction: G_ } = L, bA = (({ Request: _, Response: S }) => ({
Request: _,
Response: S
}))(L.global), {
ReadableStream: TE,
TextEncoder: vE
} = L.global, WE = (_, ...S) => {
try {
return !!_(...S);
} catch {
return !1;
}
}, YA = (_) => {
_ = L.merge.call({
skipUndefined: !0
}, bA, _);
const { fetch: S, Request: E, Response: I } = _, A = S ? G_(S) : typeof fetch == "function", t = G_(E), R = G_(I);
if (!A)
return !1;
const r = A && G_(TE), D = A && (typeof vE == "function" ? /* @__PURE__ */ ((N) => (U) => N.encode(U))(new vE()) : async (N) => new Uint8Array(await new E(N).arrayBuffer())), O = t && r && WE(() => {
let N = !1;
const U = new E(w.origin, {
body: new TE(),
method: "POST",
get duplex() {
return N = !0, "half";
}
}).headers.has("Content-Type");
return N && !U;
}), n = R && r && WE(() => L.isReadableStream(new I("").body)), c = {
stream: n && ((N) => N.body)
};
A && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((N) => {
!c[N] && (c[N] = (U, s) => {
let B = U && U[N];
if (B)
return B.call(U);
throw new o(`Response type '${N}' is not supported`, o.ERR_NOT_SUPPORT, s);
});
});
const M = async (N) => {
if (N == null)
return 0;
if (L.isBlob(N))
return N.size;
if (L.isSpecCompliantForm(N))
return (await new E(w.origin, {
method: "POST",
body: N
}).arrayBuffer()).byteLength;
if (L.isArrayBufferView(N) || L.isArrayBuffer(N))
return N.byteLength;
if (L.isURLSearchParams(N) && (N = N + ""), L.isString(N))
return (await D(N)).byteLength;
}, C = async (N, U) => {
const s = L.toFiniteNumber(N.getContentLength());
return s ?? M(U);
};
return async (N) => {
let {
url: U,
method: s,
data: B,
signal: H,
cancelToken: h,
timeout: a,
onDownloadProgress: V,
onUploadProgress: e,
responseType: f,
headers: m,
withCredentials: G = "same-origin",
fetchOptions: u
} = WS(N), P = S || fetch;
f = f ? (f + "").toLowerCase() : "text";
let W = PA([H, h && h.toAbortSignal()], a), y = null;
const Z = W && W.unsubscribe && (() => {
W.unsubscribe();
});
let S_;
try {
if (e && O && s !== "get" && s !== "head" && (S_ = await C(m, B)) !== 0) {
let E_ = new E(U, {
method: "POST",
body: B,
duplex: "half"
}), r_;
if (L.isFormData(B) && (r_ = E_.headers.get("content-type")) && m.setContentType(r_), E_.body) {
const [i_, o_] = eE(
S_,
W_(bE(e))
);
B = wE(E_.body, KE, i_, o_);
}
}
L.isString(G) || (G = G ? "include" : "omit");
const i = t && "credentials" in E.prototype, uE = {
...u,
signal: W,
method: s.toUpperCase(),
headers: m.normalize().toJSON(),
body: B,
duplex: "half",
credentials: i ? G : void 0
};
y = t && new E(U, uE);
let __ = await (t ? P(y, u) : P(U, uE));
const HE = n && (f === "stream" || f === "response");
if (n && (V || HE && Z)) {
const E_ = {};
["status", "statusText", "headers"].forEach((VE) => {
E_[VE] = __[VE];
});
const r_ = L.toFiniteNumber(__.headers.get("content-length")), [i_, o_] = V && eE(
r_,
W_(bE(V), !0)
) || [];
__ = new I(
wE(__.body, KE, i_, () => {
o_ && o_(), Z && Z();
}),
E_
);
}
f = f || "text";
let DI = await c[L.findKey(c, f) || "text"](__, N);
return !HE && Z && Z(), await new Promise((E_, r_) => {
TS(E_, r_, {
data: DI,
headers: T.from(__.headers),
status: __.status,
statusText: __.statusText,
config: N,
request: y
});
});
} catch (i) {
throw Z && Z(), i && i.name === "TypeError" && /Load failed|fetch/i.test(i.message) ? Object.assign(
new o("Network Error", o.ERR_NETWORK, N, y),
{
cause: i.cause || i
}
) : o.from(i, i && i.code, N, y);
}
};
}, wA = /* @__PURE__ */ new Map(), ZS = (_) => {
let S = _ ? _.env : {};
const { fetch: E, Request: I, Response: A } = S, t = [
I,
A,
E
];
let R = t.length, r = R, D, O, n = wA;
for (; r--; )
D = t[r], O = n.get(D), O === void 0 && n.set(D, O = r ? /* @__PURE__ */ new Map() : YA(S)), n = O;
return O;
};
ZS();
const nE = {
http: xI,
xhr: GA,
fetch: {
get: ZS
}
};
L.forEach(nE, (_, S) => {
if (_) {
try {
Object.defineProperty(_, "name", { value: S });
} catch {
}
Object.defineProperty(_, "adapterName", { value: S });
}
});
const ZE = (_) => `- ${_}`, KA = (_) => L.isFunction(_) || _ === null || _ === !1, XS = {
getAdapter: (_, S) => {
_ = L.isArray(_) ? _ : [_];
const { length: E } = _;
let I, A;
const t = {};
for (let R = 0; R < E; R++) {
I = _[R];
let r;
if (A = I, !KA(I) && (A = nE[(r = String(I)).toLowerCase()], A === void 0))
throw new o(`Unknown adapter '${r}'`);
if (A && (L.isFunction(A) || (A = A.get(S))))
break;
t[r || "#" + R] = A;
}
if (!A) {
const R = Object.entries(t).map(
([D, O]) => `adapter ${D} ` + (O === !1 ? "is not supported by the environment" : "is not available in the build")
);
let r = E ? R.length > 1 ? `since :
` + R.map(ZE).join(`
`) : " " + ZE(R[0]) : "as no adapter specified";
throw new o(
"There is no suitable adapter to dispatch the request " + r,
"ERR_NOT_SUPPORT"
);
}
return A;
},
adapters: nE
};
function x_(_) {
if (_.cancelToken && _.cancelToken.throwIfRequested(), _.signal && _.signal.aborted)
throw new s_(null, _);
}
function XE(_) {
return x_(_), _.headers = T.from(_.headers), _.data = F_.call(
_,
_.transformRequest
), ["post", "put", "patch"].indexOf(_.method) !== -1 && _.headers.setContentType("application/x-www-form-urlencoded", !1), XS.getAdapter(_.adapter || V_.adapter, _)(_).then(function(I) {
return x_(_), I.data = F_.call(
_,
_.transformResponse,
I
), I.headers = T.from(I.headers), I;
}, function(I) {
return KS(I) || (x_(_), I && I.response && (I.response.data = F_.call(
_,
_.transformResponse,
I.response
), I.response.headers = T.from(I.response.headers))), Promise.reject(I);
});
}
const jS = "1.12.2", q_ = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((_, S) => {
q_[_] = function(I) {
return typeof I === _ || "a" + (S < 1 ? "n " : " ") + _;
};
});
const jE = {};
q_.transitional = function(S, E, I) {
function A(t, R) {
return "[Axios v" + jS + "] Transitional option '" + t + "'" + R + (I ? ". " + I : "");
}
return (t, R, r) => {
if (S === !1)
throw new o(
A(R, " has been removed" + (E ? " in " + E : "")),
o.ERR_DEPRECATED
);
return E && !jE[R] && (jE[R] = !0, console.warn(
A(
R,
" has been deprecated since v" + E + " and will be removed in the near future"
)
)), S ? S(t, R, r) : !0;
};
};
q_.spelling = function(S) {
return (E, I) => (console.warn(`${I} is likely a misspelling of ${S}`), !0);
};
function TA(_, S, E) {
if (typeof _ != "object")
throw new o("options must be an object", o.ERR_BAD_OPTION_VALUE);
const I = Object.keys(_);
let A = I.length;
for (; A-- > 0; ) {
const t = I[A], R = S[t];
if (R) {
const r = _[t], D = r === void 0 || R(r, t, _);
if (D !== !0)
throw new o("option " + t + " must be " + D, o.ERR_BAD_OPTION_VALUE);
continue;
}
if (E !== !0)
throw new o("Unknown option " + t, o.ERR_BAD_OPTION);
}
}
const T_ = {
assertOptions: TA,
validators: q_
}, g = T_.validators;
let A_ = class {
constructor(S) {
this.defaults = S || {}, this.interceptors = {
request: new lE(),
response: new lE()
};
}
/**
* 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(S, E) {
try {
return await this._request(S, E);
} catch (I) {
if (I instanceof Error) {
let A = {};
Error.captureStackTrace ? Error.captureStackTrace(A) : A = new Error();
const t = A.stack ? A.stack.replace(/^.+\n/, "") : "";
try {
I.stack ? t && !String(I.stack).endsWith(t.replace(/^.+\n.+\n/, "")) && (I.stack += `
` + t) : I.stack = t;
} catch {
}
}
throw I;
}
}
_request(S, E) {
typeof S == "string" ? (E = E || {}, E.url = S) : E = S || {}, E = t_(this.defaults, E);
const { transitional: I, paramsSerializer: A, headers: t } = E;
I !== void 0 && T_.assertOptions(I, {
silentJSONParsing: g.transitional(g.boolean),
forcedJSONParsing: g.transitional(g.boolean),
clarifyTimeoutError: g.transitional(g.boolean)
}, !1), A != null && (L.isFunction(A) ? E.paramsSerializer = {
serialize: A
} : T_.assertOptions(A, {
encode: g.function,
serialize: g.function
}, !0)), E.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? E.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : E.allowAbsoluteUrls = !0), T_.assertOptions(E, {
baseUrl: g.spelling("baseURL"),
withXsrfToken: g.spelling("withXSRFToken")
}, !0), E.method = (E.method || this.defaults.method || "get").toLowerCase();
let R = t && L.merge(
t.common,
t[E.method]
);
t && L.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(N) => {
delete t[N];
}
), E.headers = T.concat(R, t);
const r = [];
let D = !0;
this.interceptors.request.forEach(function(U) {
typeof U.runWhen == "function" && U.runWhen(E) === !1 || (D = D && U.synchronous, r.unshift(U.fulfilled, U.rejected));
});
const O = [];
this.interceptors.response.forEach(function(U) {
O.push(U.fulfilled, U.rejected);
});
let n, c = 0, M;
if (!D) {
const N = [XE.bind(this), void 0];
for (N.unshift(...r), N.push(...O), M = N.length, n = Promise.resolve(E); c < M; )
n = n.then(N[c++], N[c++]);
return n;
}
M = r.length;
let C = E;
for (; c < M; ) {
const N = r[c++], U = r[c++];
try {
C = N(C);
} catch (s) {
U.call(this, s);
break;
}
}
try {
n = XE.call(this, C);
} catch (N) {
return Promise.reject(N);
}
for (c = 0, M = O.length; c < M; )
n = n.then(O[c++], O[c++]);
return n;
}
getUri(S) {
S = t_(this.defaults, S);
const E = vS(S.baseURL, S.url, S.allowAbsoluteUrls);
return bS(E, S.params, S.paramsSerializer);
}
};
L.forEach(["delete", "get", "head", "options"], function(S) {
A_.prototype[S] = function(E, I) {
return this.request(t_(I || {}, {
method: S,
url: E,
data: (I || {}).data
}));
};
});
L.forEach(["post", "put", "patch"], function(S) {
function E(I) {
return function(t, R, r) {
return this.request(t_(r || {}, {
method: S,
headers: I ? {
"Content-Type": "multipart/form-data"
} : {},
url: t,
data: R
}));
};
}
A_.prototype[S] = E(), A_.prototype[S + "Form"] = E(!0);
});
let vA = class zS {
constructor(S) {
if (typeof S != "function")
throw new TypeError("executor must be a function.");
let E;
this.promise = new Promise(function(t) {
E = t;
});
const I = this;
this.promise.then((A) => {
if (!I._listeners) return;
let t = I._listeners.length;
for (; t-- > 0; )
I._listeners[t](A);
I._listeners = null;
}), this.promise.then = (A) => {
let t;
const R = new Promise((r) => {
I.subscribe(r), t = r;
}).then(A);
return R.cancel = function() {
I.unsubscribe(t);
}, R;
}, S(function(t, R, r) {
I.reason || (I.reason = new s_(t, R, r), E(I.reason));
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason)
throw this.reason;
}
/**
* Subscribe to the cancel signal
*/
subscribe(S) {
if (this.reason) {
S(this.reason);
return;
}
this._listeners ? this._listeners.push(S) : this._listeners = [S];
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(S) {
if (!this._listeners)
return;
const E = this._listeners.indexOf(S);
E !== -1 && this._listeners.splice(E, 1);
}
toAbortSignal() {
const S = new AbortController(), E = (I) => {
S.abort(I);
};
return this.subscribe(E), S.signal.unsubscribe = () => this.unsubscribe(E), S.signal;
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let S;
return {
token: new zS(function(A) {
S = A;
}),
cancel: S
};
}
};
function WA(_) {
return function(E) {
return _.apply(null, E);
};
}
function ZA(_) {
return L.isObject(_) && _.isAxiosError === !0;
}
const DE = {
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,
Unava