@ea-lab/reactive-json
Version:
A REACT-based lib that transforms JSON (or YAML) into interactive HTML markup.
1,688 lines • 55.8 kB
JavaScript
import { evaluateTemplateValue as mt, dataLocationToPath as yt } from "./engine/TemplateSystem.js";
import { alterData as Ne } from "./engine/utility/alterData.js";
import { applyDataMapping as bt } from "./engine/utility/dataMappingSystem.js";
import "./js-yaml-CFDLc3Ha.js";
function Ve(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: wt } = Object.prototype, { getPrototypeOf: Ae } = Object, { iterator: fe, toStringTag: We } = Symbol, de = /* @__PURE__ */ ((e) => (t) => {
const n = wt.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), U = (e) => (e = e.toLowerCase(), (t) => de(t) === e), he = (e) => (t) => typeof t === e, { isArray: K } = Array, v = he("undefined");
function ne(e) {
return e !== null && !v(e) && e.constructor !== null && !v(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const ve = U("ArrayBuffer");
function gt(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && ve(e.buffer), t;
}
const Et = he("string"), P = he("function"), Ke = he("number"), re = (e) => e !== null && typeof e == "object", St = (e) => e === !0 || e === !1, ae = (e) => {
if (de(e) !== "object")
return !1;
const t = Ae(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(We in e) && !(fe in e);
}, Rt = (e) => {
if (!re(e) || ne(e))
return !1;
try {
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
} catch {
return !1;
}
}, Ot = U("Date"), At = U("File"), Tt = U("Blob"), xt = U("FileList"), Ct = (e) => re(e) && P(e.pipe), Nt = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = de(e)) === "formdata" || // detect form-data instance
t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
}, Pt = U("URLSearchParams"), [Ft, _t, Dt, Bt] = ["ReadableStream", "Request", "Response", "Headers"].map(U), Lt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function se(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let r, s;
if (typeof e != "object" && (e = [e]), K(e))
for (r = 0, s = e.length; r < s; r++)
t.call(null, e[r], r, e);
else {
if (ne(e))
return;
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = i.length;
let c;
for (r = 0; r < o; r++)
c = i[r], t.call(null, e[c], c, e);
}
}
function Xe(e, t) {
if (ne(e))
return null;
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 z = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ge = (e) => !v(e) && e !== z;
function ge() {
const { caseless: e, skipUndefined: t } = Ge(this) && this || {}, n = {}, r = (s, i) => {
const o = e && Xe(n, i) || i;
ae(n[o]) && ae(s) ? n[o] = ge(n[o], s) : ae(s) ? n[o] = ge({}, s) : K(s) ? n[o] = s.slice() : (!t || !v(s)) && (n[o] = s);
};
for (let s = 0, i = arguments.length; s < i; s++)
arguments[s] && se(arguments[s], r);
return n;
}
const Ut = (e, t, n, { allOwnKeys: r } = {}) => (se(t, (s, i) => {
n && P(s) ? e[i] = Ve(s, n) : e[i] = s;
}, { allOwnKeys: r }), e), kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), jt = (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);
}, qt = (e, t, n, r) => {
let s, i, o;
const c = {};
if (t = t || {}, e == null) return t;
do {
for (s = Object.getOwnPropertyNames(e), i = s.length; i-- > 0; )
o = s[i], (!r || r(o, e, t)) && !c[o] && (t[o] = e[o], c[o] = !0);
e = n !== !1 && Ae(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, It = (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;
}, Ht = (e) => {
if (!e) return null;
if (K(e)) return e;
let t = e.length;
if (!Ke(t)) return null;
const n = new Array(t);
for (; t-- > 0; )
n[t] = e[t];
return n;
}, Mt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ae(Uint8Array)), $t = (e, t) => {
const r = (e && e[fe]).call(e);
let s;
for (; (s = r.next()) && !s.done; ) {
const i = s.value;
t.call(e, i[0], i[1]);
}
}, zt = (e, t) => {
let n;
const r = [];
for (; (n = e.exec(t)) !== null; )
r.push(n);
return r;
}, Jt = U("HTMLFormElement"), Vt = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, r, s) {
return r.toUpperCase() + s;
}
), Pe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Wt = U("RegExp"), Qe = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), r = {};
se(n, (s, i) => {
let o;
(o = t(s, i, e)) !== !1 && (r[i] = o || s);
}), Object.defineProperties(e, r);
}, vt = (e) => {
Qe(e, (t, n) => {
if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const r = e[n];
if (P(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 + "'");
});
}
});
}, Kt = (e, t) => {
const n = {}, r = (s) => {
s.forEach((i) => {
n[i] = !0;
});
};
return K(e) ? r(e) : r(String(e).split(t)), n;
}, Xt = () => {
}, Gt = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function Qt(e) {
return !!(e && P(e.append) && e[We] === "FormData" && e[fe]);
}
const Zt = (e) => {
const t = new Array(10), n = (r, s) => {
if (re(r)) {
if (t.indexOf(r) >= 0)
return;
if (ne(r))
return r;
if (!("toJSON" in r)) {
t[s] = r;
const i = K(r) ? [] : {};
return se(r, (o, c) => {
const d = n(o, s + 1);
!v(d) && (i[c] = d);
}), t[s] = void 0, i;
}
}
return r;
};
return n(e, 0);
}, Yt = U("AsyncFunction"), en = (e) => e && (re(e) || P(e)) && P(e.then) && P(e.catch), Ze = ((e, t) => e ? setImmediate : t ? ((n, r) => (z.addEventListener("message", ({ source: s, data: i }) => {
s === z && i === n && r.length && r.shift()();
}, !1), (s) => {
r.push(s), z.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
P(z.postMessage)
), tn = typeof queueMicrotask < "u" ? queueMicrotask.bind(z) : typeof process < "u" && process.nextTick || Ze, nn = (e) => e != null && P(e[fe]), a = {
isArray: K,
isArrayBuffer: ve,
isBuffer: ne,
isFormData: Nt,
isArrayBufferView: gt,
isString: Et,
isNumber: Ke,
isBoolean: St,
isObject: re,
isPlainObject: ae,
isEmptyObject: Rt,
isReadableStream: Ft,
isRequest: _t,
isResponse: Dt,
isHeaders: Bt,
isUndefined: v,
isDate: Ot,
isFile: At,
isBlob: Tt,
isRegExp: Wt,
isFunction: P,
isStream: Ct,
isURLSearchParams: Pt,
isTypedArray: Mt,
isFileList: xt,
forEach: se,
merge: ge,
extend: Ut,
trim: Lt,
stripBOM: kt,
inherits: jt,
toFlatObject: qt,
kindOf: de,
kindOfTest: U,
endsWith: It,
toArray: Ht,
forEachEntry: $t,
matchAll: zt,
isHTMLForm: Jt,
hasOwnProperty: Pe,
hasOwnProp: Pe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Qe,
freezeMethods: vt,
toObjectSet: Kt,
toCamelCase: Vt,
noop: Xt,
toFiniteNumber: Gt,
findKey: Xe,
global: z,
isContextDefined: Ge,
isSpecCompliantForm: Qt,
toJSONObject: Zt,
isAsyncFn: Yt,
isThenable: en,
setImmediate: Ze,
asap: tn,
isIterable: nn
};
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 Ye = y.prototype, et = {};
[
"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) => {
et[e] = { value: e };
});
Object.defineProperties(y, et);
Object.defineProperty(Ye, "isAxiosError", { value: !0 });
y.from = (e, t, n, r, s, i) => {
const o = Object.create(Ye);
a.toFlatObject(e, o, function(l) {
return l !== Error.prototype;
}, (u) => u !== "isAxiosError");
const c = e && e.message ? e.message : "Error", d = t == null && e ? e.code : t;
return y.call(o, c, d, n, r, s), e && o.cause == null && Object.defineProperty(o, "cause", { value: e, configurable: !0 }), o.name = e && e.name || "Error", i && Object.assign(o, i), o;
};
const rn = null;
function Ee(e) {
return a.isPlainObject(e) || a.isArray(e);
}
function tt(e) {
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Fe(e, t, n) {
return e ? e.concat(t).map(function(s, i) {
return s = tt(s), !n && i ? "[" + s + "]" : s;
}).join(n ? "." : "") : t;
}
function sn(e) {
return a.isArray(e) && !e.some(Ee);
}
const on = a.toFlatObject(a, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function pe(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, h) {
return !a.isUndefined(h[m]);
});
const r = n.metaTokens, s = n.visitor || l, i = n.dots, o = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
if (!a.isFunction(s))
throw new TypeError("visitor must be a function");
function u(f) {
if (f === null) return "";
if (a.isDate(f))
return f.toISOString();
if (a.isBoolean(f))
return f.toString();
if (!d && a.isBlob(f))
throw new y("Blob is not supported. Use a Buffer instead.");
return a.isArrayBuffer(f) || a.isTypedArray(f) ? d && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
}
function l(f, m, h) {
let g = f;
if (f && !h && typeof f == "object") {
if (a.endsWith(m, "{}"))
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
else if (a.isArray(f) && sn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (g = a.toArray(f)))
return m = tt(m), g.forEach(function(R, T) {
!(a.isUndefined(R) || R === null) && t.append(
// eslint-disable-next-line no-nested-ternary
o === !0 ? Fe([m], T, i) : o === null ? m : m + "[]",
u(R)
);
}), !1;
}
return Ee(f) ? !0 : (t.append(Fe(h, m, i), u(f)), !1);
}
const p = [], b = Object.assign(on, {
defaultVisitor: l,
convertValue: u,
isVisitable: Ee
});
function O(f, m) {
if (!a.isUndefined(f)) {
if (p.indexOf(f) !== -1)
throw Error("Circular reference detected in " + m.join("."));
p.push(f), a.forEach(f, function(g, N) {
(!(a.isUndefined(g) || g === null) && s.call(
t,
g,
a.isString(N) ? N.trim() : N,
m,
b
)) === !0 && O(g, m ? m.concat(N) : [N]);
}), p.pop();
}
}
if (!a.isObject(e))
throw new TypeError("data must be an object");
return O(e), t;
}
function _e(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
return t[r];
});
}
function Te(e, t) {
this._pairs = [], e && pe(e, this, t);
}
const nt = Te.prototype;
nt.append = function(t, n) {
this._pairs.push([t, n]);
};
nt.toString = function(t) {
const n = t ? function(r) {
return t.call(this, r, _e);
} : _e;
return this._pairs.map(function(s) {
return n(s[0]) + "=" + n(s[1]);
}, "").join("&");
};
function an(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
}
function rt(e, t, n) {
if (!t)
return e;
const r = n && n.encode || an;
a.isFunction(n) && (n = {
serialize: n
});
const s = n && n.serialize;
let i;
if (s ? i = s(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new Te(t, n).toString(r), i) {
const o = e.indexOf("#");
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
}
return e;
}
class De {
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 st = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, cn = typeof URLSearchParams < "u" ? URLSearchParams : Te, ln = typeof FormData < "u" ? FormData : null, un = typeof Blob < "u" ? Blob : null, fn = {
isBrowser: !0,
classes: {
URLSearchParams: cn,
FormData: ln,
Blob: un
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, xe = typeof window < "u" && typeof document < "u", Se = typeof navigator == "object" && navigator || void 0, dn = xe && (!Se || ["ReactNative", "NativeScript", "NS"].indexOf(Se.product) < 0), hn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", pn = xe && window.location.href || "http://localhost", mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: xe,
hasStandardBrowserEnv: dn,
hasStandardBrowserWebWorkerEnv: hn,
navigator: Se,
origin: pn
}, Symbol.toStringTag, { value: "Module" })), C = {
...mn,
...fn
};
function yn(e, t) {
return pe(e, new C.classes.URLSearchParams(), {
visitor: function(n, r, s, i) {
return C.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
},
...t
});
}
function bn(e) {
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function wn(e) {
const t = {}, n = Object.keys(e);
let r;
const s = n.length;
let i;
for (r = 0; r < s; r++)
i = n[r], t[i] = e[i];
return t;
}
function ot(e) {
function t(n, r, s, i) {
let o = n[i++];
if (o === "__proto__") return !0;
const c = Number.isFinite(+o), d = i >= n.length;
return o = !o && a.isArray(s) ? s.length : o, d ? (a.hasOwnProp(s, o) ? s[o] = [s[o], r] : s[o] = r, !c) : ((!s[o] || !a.isObject(s[o])) && (s[o] = []), t(n, r, s[o], i) && a.isArray(s[o]) && (s[o] = wn(s[o])), !c);
}
if (a.isFormData(e) && a.isFunction(e.entries)) {
const n = {};
return a.forEachEntry(e, (r, s) => {
t(bn(r), s, n, 0);
}), n;
}
return null;
}
function gn(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 oe = {
transitional: st,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, i = a.isObject(t);
if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
return s ? JSON.stringify(ot(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 (i) {
if (r.indexOf("application/x-www-form-urlencoded") > -1)
return yn(t, this.formSerializer).toString();
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
const d = this.env && this.env.FormData;
return pe(
c ? { "files[]": t } : t,
d && new d(),
this.formSerializer
);
}
}
return i || s ? (n.setContentType("application/json", !1), gn(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || oe.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 o = !(n && n.silentJSONParsing) && s;
try {
return JSON.parse(t, this.parseReviver);
} catch (c) {
if (o)
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) => {
oe.headers[e] = {};
});
const En = 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"
]), Sn = (e) => {
const t = {};
let n, r, s;
return e && e.split(`
`).forEach(function(o) {
s = o.indexOf(":"), n = o.substring(0, s).trim().toLowerCase(), r = o.substring(s + 1).trim(), !(!n || t[n] && En[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
}), t;
}, Be = Symbol("internals");
function te(e) {
return e && String(e).trim().toLowerCase();
}
function ce(e) {
return e === !1 || e == null ? e : a.isArray(e) ? e.map(ce) : String(e);
}
function Rn(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 On = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function ye(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 An(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
}
function Tn(e, t) {
const n = a.toCamelCase(" " + t);
["get", "set", "has"].forEach((r) => {
Object.defineProperty(e, r + n, {
value: function(s, i, o) {
return this[r].call(this, t, s, i, o);
},
configurable: !0
});
});
}
let F = class {
constructor(t) {
t && this.set(t);
}
set(t, n, r) {
const s = this;
function i(c, d, u) {
const l = te(d);
if (!l)
throw new Error("header name must be a non-empty string");
const p = a.findKey(s, l);
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || d] = ce(c));
}
const o = (c, d) => a.forEach(c, (u, l) => i(u, l, d));
if (a.isPlainObject(t) || t instanceof this.constructor)
o(t, n);
else if (a.isString(t) && (t = t.trim()) && !On(t))
o(Sn(t), n);
else if (a.isObject(t) && a.isIterable(t)) {
let c = {}, d, u;
for (const l of t) {
if (!a.isArray(l))
throw TypeError("Object iterator must return a key-value pair");
c[u = l[0]] = (d = c[u]) ? a.isArray(d) ? [...d, l[1]] : [d, l[1]] : l[1];
}
o(c, n);
} else
t != null && i(n, t, r);
return this;
}
get(t, n) {
if (t = te(t), t) {
const r = a.findKey(this, t);
if (r) {
const s = this[r];
if (!n)
return s;
if (n === !0)
return Rn(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 = te(t), t) {
const r = a.findKey(this, t);
return !!(r && this[r] !== void 0 && (!n || ye(this, this[r], r, n)));
}
return !1;
}
delete(t, n) {
const r = this;
let s = !1;
function i(o) {
if (o = te(o), o) {
const c = a.findKey(r, o);
c && (!n || ye(r, r[c], c, n)) && (delete r[c], s = !0);
}
}
return a.isArray(t) ? t.forEach(i) : i(t), s;
}
clear(t) {
const n = Object.keys(this);
let r = n.length, s = !1;
for (; r--; ) {
const i = n[r];
(!t || ye(this, this[i], i, t, !0)) && (delete this[i], s = !0);
}
return s;
}
normalize(t) {
const n = this, r = {};
return a.forEach(this, (s, i) => {
const o = a.findKey(r, i);
if (o) {
n[o] = ce(s), delete n[i];
return;
}
const c = t ? An(i) : String(i).trim();
c !== i && delete n[i], n[c] = ce(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(`
`);
}
getSetCookie() {
return this.get("set-cookie") || [];
}
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[Be] = this[Be] = {
accessors: {}
}).accessors, s = this.prototype;
function i(o) {
const c = te(o);
r[c] || (Tn(s, o), r[c] = !0);
}
return a.isArray(t) ? t.forEach(i) : i(t), this;
}
};
F.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
a.reduceDescriptors(F.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(r) {
this[n] = r;
}
};
});
a.freezeMethods(F);
function be(e, t) {
const n = this || oe, r = t || n, s = F.from(r.headers);
let i = r.data;
return a.forEach(e, function(c) {
i = c.call(n, i, s.normalize(), t ? t.status : void 0);
}), s.normalize(), i;
}
function it(e) {
return !!(e && e.__CANCEL__);
}
function X(e, t, n) {
y.call(this, e ?? "canceled", y.ERR_CANCELED, t, n), this.name = "CanceledError";
}
a.inherits(X, y, {
__CANCEL__: !0
});
function at(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 xn(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Cn(e, t) {
e = e || 10;
const n = new Array(e), r = new Array(e);
let s = 0, i = 0, o;
return t = t !== void 0 ? t : 1e3, function(d) {
const u = Date.now(), l = r[i];
o || (o = u), n[s] = d, r[s] = u;
let p = i, b = 0;
for (; p !== s; )
b += n[p++], p = p % e;
if (s = (s + 1) % e, s === i && (i = (i + 1) % e), u - o < t)
return;
const O = l && u - l;
return O ? Math.round(b * 1e3 / O) : void 0;
};
}
function Nn(e, t) {
let n = 0, r = 1e3 / t, s, i;
const o = (u, l = Date.now()) => {
n = l, s = null, i && (clearTimeout(i), i = null), e(...u);
};
return [(...u) => {
const l = Date.now(), p = l - n;
p >= r ? o(u, l) : (s = u, i || (i = setTimeout(() => {
i = null, o(s);
}, r - p)));
}, () => s && o(s)];
}
const ue = (e, t, n = 3) => {
let r = 0;
const s = Cn(50, 250);
return Nn((i) => {
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, d = o - r, u = s(d), l = o <= c;
r = o;
const p = {
loaded: o,
total: c,
progress: c ? o / c : void 0,
bytes: d,
rate: u || void 0,
estimated: u && c && l ? (c - o) / u : void 0,
event: i,
lengthComputable: c != null,
[t ? "download" : "upload"]: !0
};
e(p);
}, n);
}, Le = (e, t) => {
const n = e != null;
return [(r) => t[0]({
lengthComputable: n,
total: e,
loaded: r
}), t[1]];
}, Ue = (e) => (...t) => a.asap(() => e(...t)), Pn = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, C.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
new URL(C.origin),
C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
) : () => !0, Fn = C.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, r, s, i) {
const o = [e + "=" + encodeURIComponent(t)];
a.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), a.isString(r) && o.push("path=" + r), a.isString(s) && o.push("domain=" + s), i === !0 && o.push("secure"), document.cookie = o.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 _n(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Dn(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function ct(e, t, n) {
let r = !_n(t);
return e && (r || n == !1) ? Dn(e, t) : t;
}
const ke = (e) => e instanceof F ? { ...e } : e;
function V(e, t) {
t = t || {};
const n = {};
function r(u, l, p, b) {
return a.isPlainObject(u) && a.isPlainObject(l) ? a.merge.call({ caseless: b }, u, l) : a.isPlainObject(l) ? a.merge({}, l) : a.isArray(l) ? l.slice() : l;
}
function s(u, l, p, b) {
if (a.isUndefined(l)) {
if (!a.isUndefined(u))
return r(void 0, u, p, b);
} else return r(u, l, p, b);
}
function i(u, l) {
if (!a.isUndefined(l))
return r(void 0, l);
}
function o(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, p) {
if (p in t)
return r(u, l);
if (p in e)
return r(void 0, u);
}
const d = {
url: i,
method: i,
data: i,
baseURL: o,
transformRequest: o,
transformResponse: o,
paramsSerializer: o,
timeout: o,
timeoutMessage: o,
withCredentials: o,
withXSRFToken: o,
adapter: o,
responseType: o,
xsrfCookieName: o,
xsrfHeaderName: o,
onUploadProgress: o,
onDownloadProgress: o,
decompress: o,
maxContentLength: o,
maxBodyLength: o,
beforeRedirect: o,
transport: o,
httpAgent: o,
httpsAgent: o,
cancelToken: o,
socketPath: o,
responseEncoding: o,
validateStatus: c,
headers: (u, l, p) => s(ke(u), ke(l), p, !0)
};
return a.forEach(Object.keys({ ...e, ...t }), function(l) {
const p = d[l] || s, b = p(e[l], t[l], l);
a.isUndefined(b) && p !== c || (n[l] = b);
}), n;
}
const lt = (e) => {
const t = V({}, e);
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: i, headers: o, auth: c } = t;
if (t.headers = o = F.from(o), t.url = rt(ct(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && o.set(
"Authorization",
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
), a.isFormData(n)) {
if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
o.setContentType(void 0);
else if (a.isFunction(n.getHeaders)) {
const d = n.getHeaders(), u = ["content-type", "content-length"];
Object.entries(d).forEach(([l, p]) => {
u.includes(l.toLowerCase()) && o.set(l, p);
});
}
}
if (C.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Pn(t.url))) {
const d = s && i && Fn.read(i);
d && o.set(s, d);
}
return t;
}, Bn = typeof XMLHttpRequest < "u", Ln = Bn && function(e) {
return new Promise(function(n, r) {
const s = lt(e);
let i = s.data;
const o = F.from(s.headers).normalize();
let { responseType: c, onUploadProgress: d, onDownloadProgress: u } = s, l, p, b, O, f;
function m() {
O && O(), f && f(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
}
let h = new XMLHttpRequest();
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
function g() {
if (!h)
return;
const R = F.from(
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
), A = {
data: !c || c === "text" || c === "json" ? h.responseText : h.response,
status: h.status,
statusText: h.statusText,
headers: R,
config: e,
request: h
};
at(function(x) {
n(x), m();
}, function(x) {
r(x), m();
}, A), h = null;
}
"onloadend" in h ? h.onloadend = g : h.onreadystatechange = function() {
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(g);
}, h.onabort = function() {
h && (r(new y("Request aborted", y.ECONNABORTED, e, h)), h = null);
}, h.onerror = function(T) {
const A = T && T.message ? T.message : "Network Error", k = new y(A, y.ERR_NETWORK, e, h);
k.event = T || null, r(k), h = null;
}, h.ontimeout = function() {
let T = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
const A = s.transitional || st;
s.timeoutErrorMessage && (T = s.timeoutErrorMessage), r(new y(
T,
A.clarifyTimeoutError ? y.ETIMEDOUT : y.ECONNABORTED,
e,
h
)), h = null;
}, i === void 0 && o.setContentType(null), "setRequestHeader" in h && a.forEach(o.toJSON(), function(T, A) {
h.setRequestHeader(A, T);
}), a.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), c && c !== "json" && (h.responseType = s.responseType), u && ([b, f] = ue(u, !0), h.addEventListener("progress", b)), d && h.upload && ([p, O] = ue(d), h.upload.addEventListener("progress", p), h.upload.addEventListener("loadend", O)), (s.cancelToken || s.signal) && (l = (R) => {
h && (r(!R || R.type ? new X(null, e, h) : R), h.abort(), h = null);
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
const N = xn(s.url);
if (N && C.protocols.indexOf(N) === -1) {
r(new y("Unsupported protocol " + N + ":", y.ERR_BAD_REQUEST, e));
return;
}
h.send(i || null);
});
}, Un = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];
if (t || n) {
let r = new AbortController(), s;
const i = function(u) {
if (!s) {
s = !0, c();
const l = u instanceof Error ? u : this.reason;
r.abort(l instanceof y ? l : new X(l instanceof Error ? l.message : l));
}
};
let o = t && setTimeout(() => {
o = null, i(new y(`timeout ${t} of ms exceeded`, y.ETIMEDOUT));
}, t);
const c = () => {
e && (o && clearTimeout(o), o = null, e.forEach((u) => {
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
}), e = null);
};
e.forEach((u) => u.addEventListener("abort", i));
const { signal: d } = r;
return d.unsubscribe = () => a.asap(c), d;
}
}, kn = function* (e, t) {
let n = e.byteLength;
if (n < t) {
yield e;
return;
}
let r = 0, s;
for (; r < n; )
s = r + t, yield e.slice(r, s), r = s;
}, jn = async function* (e, t) {
for await (const n of qn(e))
yield* kn(n, t);
}, qn = 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();
}
}, je = (e, t, n, r) => {
const s = jn(e, t);
let i = 0, o, c = (d) => {
o || (o = !0, r && r(d));
};
return new ReadableStream({
async pull(d) {
try {
const { done: u, value: l } = await s.next();
if (u) {
c(), d.close();
return;
}
let p = l.byteLength;
if (n) {
let b = i += p;
n(b);
}
d.enqueue(new Uint8Array(l));
} catch (u) {
throw c(u), u;
}
},
cancel(d) {
return c(d), s.return();
}
}, {
highWaterMark: 2
});
}, qe = 64 * 1024, { isFunction: ie } = a, In = (({ Request: e, Response: t }) => ({
Request: e,
Response: t
}))(a.global), {
ReadableStream: Ie,
TextEncoder: He
} = a.global, Me = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, Hn = (e) => {
e = a.merge.call({
skipUndefined: !0
}, In, e);
const { fetch: t, Request: n, Response: r } = e, s = t ? ie(t) : typeof fetch == "function", i = ie(n), o = ie(r);
if (!s)
return !1;
const c = s && ie(Ie), d = s && (typeof He == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new He()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = i && c && Me(() => {
let f = !1;
const m = new n(C.origin, {
body: new Ie(),
method: "POST",
get duplex() {
return f = !0, "half";
}
}).headers.has("Content-Type");
return f && !m;
}), l = o && c && Me(() => a.isReadableStream(new r("").body)), p = {
stream: l && ((f) => f.body)
};
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
!p[f] && (p[f] = (m, h) => {
let g = m && m[f];
if (g)
return g.call(m);
throw new y(`Response type '${f}' is not supported`, y.ERR_NOT_SUPPORT, h);
});
});
const b = async (f) => {
if (f == null)
return 0;
if (a.isBlob(f))
return f.size;
if (a.isSpecCompliantForm(f))
return (await new n(C.origin, {
method: "POST",
body: f
}).arrayBuffer()).byteLength;
if (a.isArrayBufferView(f) || a.isArrayBuffer(f))
return f.byteLength;
if (a.isURLSearchParams(f) && (f = f + ""), a.isString(f))
return (await d(f)).byteLength;
}, O = async (f, m) => {
const h = a.toFiniteNumber(f.getContentLength());
return h ?? b(m);
};
return async (f) => {
let {
url: m,
method: h,
data: g,
signal: N,
cancelToken: R,
timeout: T,
onDownloadProgress: A,
onUploadProgress: k,
responseType: x,
headers: I,
withCredentials: _ = "same-origin",
fetchOptions: G
} = lt(f), Q = t || fetch;
x = x ? (x + "").toLowerCase() : "text";
let M = Un([N, R && R.toAbortSignal()], T), H = null;
const j = M && M.unsubscribe && (() => {
M.unsubscribe();
});
let Z;
try {
if (k && u && h !== "get" && h !== "head" && (Z = await O(I, g)) !== 0) {
let E = new n(m, {
method: "POST",
body: g,
duplex: "half"
}), B;
if (a.isFormData(g) && (B = E.headers.get("content-type")) && I.setContentType(B), E.body) {
const [W, $] = Le(
Z,
ue(Ue(k))
);
g = je(E.body, qe, W, $);
}
}
a.isString(_) || (_ = _ ? "include" : "omit");
const D = i && "credentials" in n.prototype, Y = {
...G,
signal: M,
method: h.toUpperCase(),
headers: I.normalize().toJSON(),
body: g,
duplex: "half",
credentials: D ? _ : void 0
};
H = i && new n(m, Y);
let L = await (i ? Q(H, G) : Q(m, Y));
const ee = l && (x === "stream" || x === "response");
if (l && (A || ee && j)) {
const E = {};
["status", "statusText", "headers"].forEach((Ce) => {
E[Ce] = L[Ce];
});
const B = a.toFiniteNumber(L.headers.get("content-length")), [W, $] = A && Le(
B,
ue(Ue(A), !0)
) || [];
L = new r(
je(L.body, qe, W, () => {
$ && $(), j && j();
}),
E
);
}
x = x || "text";
let w = await p[a.findKey(p, x) || "text"](L, f);
return !ee && j && j(), await new Promise((E, B) => {
at(E, B, {
data: w,
headers: F.from(L.headers),
status: L.status,
statusText: L.statusText,
config: f,
request: H
});
});
} catch (D) {
throw j && j(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
new y("Network Error", y.ERR_NETWORK, f, H),
{
cause: D.cause || D
}
) : y.from(D, D && D.code, f, H);
}
};
}, Mn = /* @__PURE__ */ new Map(), ut = (e) => {
let t = e ? e.env : {};
const { fetch: n, Request: r, Response: s } = t, i = [
r,
s,
n
];
let o = i.length, c = o, d, u, l = Mn;
for (; c--; )
d = i[c], u = l.get(d), u === void 0 && l.set(d, u = c ? /* @__PURE__ */ new Map() : Hn(t)), l = u;
return u;
};
ut();
const Re = {
http: rn,
xhr: Ln,
fetch: {
get: ut
}
};
a.forEach(Re, (e, t) => {
if (e) {
try {
Object.defineProperty(e, "name", { value: t });
} catch {
}
Object.defineProperty(e, "adapterName", { value: t });
}
});
const $e = (e) => `- ${e}`, $n = (e) => a.isFunction(e) || e === null || e === !1, ft = {
getAdapter: (e, t) => {
e = a.isArray(e) ? e : [e];
const { length: n } = e;
let r, s;
const i = {};
for (let o = 0; o < n; o++) {
r = e[o];
let c;
if (s = r, !$n(r) && (s = Re[(c = String(r)).toLowerCase()], s === void 0))
throw new y(`Unknown adapter '${c}'`);
if (s && (a.isFunction(s) || (s = s.get(t))))
break;
i[c || "#" + o] = s;
}
if (!s) {
const o = Object.entries(i).map(
([d, u]) => `adapter ${d} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
);
let c = n ? o.length > 1 ? `since :
` + o.map($e).join(`
`) : " " + $e(o[0]) : "as no adapter specified";
throw new y(
"There is no suitable adapter to dispatch the request " + c,
"ERR_NOT_SUPPORT"
);
}
return s;
},
adapters: Re
};
function we(e) {
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
throw new X(null, e);
}
function ze(e) {
return we(e), e.headers = F.from(e.headers), e.data = be.call(
e,
e.transformRequest
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ft.getAdapter(e.adapter || oe.adapter, e)(e).then(function(r) {
return we(e), r.data = be.call(
e,
e.transformResponse,
r
), r.headers = F.from(r.headers), r;
}, function(r) {
return it(r) || (we(e), r && r.response && (r.response.data = be.call(
e,
e.transformResponse,
r.response
), r.response.headers = F.from(r.response.headers))), Promise.reject(r);
});
}
const dt = "1.12.2", me = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
me[e] = function(r) {
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
};
});
const Je = {};
me.transitional = function(t, n, r) {
function s(i, o) {
return "[Axios v" + dt + "] Transitional option '" + i + "'" + o + (r ? ". " + r : "");
}
return (i, o, c) => {
if (t === !1)
throw new y(
s(o, " has been removed" + (n ? " in " + n : "")),
y.ERR_DEPRECATED
);
return n && !Je[o] && (Je[o] = !0, console.warn(
s(
o,
" has been deprecated since v" + n + " and will be removed in the near future"
)
)), t ? t(i, o, c) : !0;
};
};
me.spelling = function(t) {
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
};
function zn(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 i = r[s], o = t[i];
if (o) {
const c = e[i], d = c === void 0 || o(c, i, e);
if (d !== !0)
throw new y("option " + i + " must be " + d, y.ERR_BAD_OPTION_VALUE);
continue;
}
if (n !== !0)
throw new y("Unknown option " + i, y.ERR_BAD_OPTION);
}
}
const le = {
assertOptions: zn,
validators: me
}, q = le.validators;
let J = class {
constructor(t) {
this.defaults = t || {}, this.interceptors = {
request: new De(),
response: new De()
};
}
/**
* 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 i = s.stack ? s.stack.replace(/^.+\n/, "") : "";
try {
r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
` + i) : r.stack = i;
} catch {
}
}
throw r;
}
}
_request(t, n) {
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = V(this.defaults, n);
const { transitional: r, paramsSerializer: s, headers: i } = n;
r !== void 0 && le.assertOptions(r, {
silentJSONParsing: q.transitional(q.boolean),
forcedJSONParsing: q.transitional(q.boolean),
clarifyTimeoutError: q.transitional(q.boolean)
}, !1), s != null && (a.isFunction(s) ? n.paramsSerializer = {
serialize: s
} : le.assertOptions(s, {
encode: q.function,
serialize: q.function
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), le.assertOptions(n, {
baseUrl: q.spelling("baseURL"),
withXsrfToken: q.spelling("withXSRFToken")
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
let o = i && a.merge(
i.common,
i[n.method]
);
i && a.forEach(
["delete", "get", "head", "post", "put", "patch", "common"],
(f) => {
delete i[f];
}
), n.headers = F.concat(o, i);
const c = [];
let d = !0;
this.interceptors.request.forEach(function(m) {
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (d = d && m.synchronous, c.unshift(m.fulfilled, m.rejected));
});
const u = [];
this.interceptors.response.forEach(function(m) {
u.push(m.fulfilled, m.rejected);
});
let l, p = 0, b;
if (!d) {
const f = [ze.bind(this), void 0];
for (f.unshift(...c), f.push(...u), b = f.length, l = Promise.resolve(n); p < b; )
l = l.then(f[p++], f[p++]);
return l;
}
b = c.length;
let O = n;
for (; p < b; ) {
const f = c[p++], m = c[p++];
try {
O = f(O);
} catch (h) {
m.call(this, h);
break;
}
}
try {
l = ze.call(this, O);
} catch (f) {
return Promise.reject(f);
}
for (p = 0, b = u.length; p < b; )
l = l.then(u[p++], u[p++]);
return l;
}
getUri(t) {
t = V(this.defaults, t);
const n = ct(t.baseURL, t.url, t.allowAbsoluteUrls);
return rt(n, t.params, t.paramsSerializer);
}
};
a.forEach(["delete", "get", "head", "options"], function(t) {
J.prototype[t] = function(n, r) {
return this.request(V(r || {}, {
method: t,
url: n,
data: (r || {}).data
}));
};
});
a.forEach(["post", "put", "patch"], function(t) {
function n(r) {
return function(i, o, c) {
return this.request(V(c || {}, {
method: t,
headers: r ? {
"Content-Type": "multipart/form-data"
} : {},
url: i,
data: o
}));
};
}
J.prototype[t] = n(), J.prototype[t + "Form"] = n(!0);
});
let Jn = class ht {
constructor(t) {
if (typeof t != "function")
throw new TypeError("executor must be a function.");
let n;
this.promise = new Promise(function(i) {
n = i;
});
const r = this;
this.promise.then((s) => {
if (!r._listeners) return;
let i = r._listeners.length;
for (; i-- > 0; )
r._listeners[i](s);
r._listeners = null;
}), this.promise.then = (s) => {
let i;
const o = new Promise((c) => {
r.subscribe(c), i = c;
}).then(s);
return o.cancel = function() {
r.unsubscribe(i);
}, o;
}, t(function(i, o, c) {
r.reason || (r.reason = new X(i, o, 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 ht(function(s) {
t = s;
}),
cancel: t
};
}
};
function Vn(e) {
return function(n) {
return e.apply(null, n);
};
}
function Wn(e) {
return a.isObject(e) && e.isAxiosError === !0;
}
const Oe = {
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,
Unproc