UNPKG

@vtj/utils

Version:

VTJ 是一款基于 Vue3 + Typescript 的低代码页面可视化设计器。内置低代码引擎、渲染器和代码生成器,面向前端开发者,开箱即用。 无缝嵌入本地开发工程,不改变前端开发流程和编码习惯。

1,720 lines (1,719 loc) 85.5 kB
var cn = Object.defineProperty; var ln = (e, t, n) => t in e ? cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var j = (e, t, n) => ln(e, typeof t != "symbol" ? t + "" : t, n); import { omit as Te, merge as G, debounce as un, throttle as fn, isUrl as dn, pathToRegexpCompile as hn, uuid as pn, rURL as mn, template as gn } from "@vtj/base"; export * from "@vtj/base"; (function() { if (typeof window > "u" || typeof EventTarget > "u") return; const e = EventTarget.prototype.addEventListener; EventTarget.prototype.addEventListener = function(t, n, r) { typeof r != "boolean" && (r = r || {}, r.passive = !1), e.call(this, t, n, r); }; })(); /**! * Copyright (c) 2025, VTJ.PRO All rights reserved. * @name @vtj/utils * @author CHC chenhuachun1549@dingtalk.com * @version 0.13.13 * @license <a href="https://vtj.pro/license.html">MIT License</a> */ const Qs = "0.13.13"; /** * @vue/shared v3.5.19 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/ /*! #__NO_SIDE_EFFECTS__ */ // @__NO_SIDE_EFFECTS__ function wn(e) { const t = /* @__PURE__ */ Object.create(null); for (const n of e.split(",")) t[n] = 1; return (n) => n in t; } const yn = Object.assign, bn = Object.prototype.hasOwnProperty, Ue = (e, t) => bn.call(e, t), J = Array.isArray, ue = (e) => Rt(e) === "[object Map]", Rn = (e) => typeof e == "string", re = (e) => typeof e == "symbol", we = (e) => e !== null && typeof e == "object", En = Object.prototype.toString, Rt = (e) => En.call(e), Sn = (e) => Rt(e).slice(8, -1), Ke = (e) => Rn(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, Z = (e, t) => !Object.is(e, t); var _n = { ENV_TYPE: "local", NODE_ENV: "production" }; let On, Et = 0, Ae; function Ve() { Et++; } function Xe() { if (--Et > 0) return; let e; for (; Ae; ) { let t = Ae; for (Ae = void 0; t; ) { const n = t.next; if (t.next = void 0, t.flags &= -9, t.flags & 1) try { t.trigger(); } catch (r) { e || (e = r); } t = n; } } if (e) throw e; } let pe = !0; const St = []; function Tn() { St.push(pe), pe = !1; } function An() { const e = St.pop(); pe = e === void 0 ? !0 : e; } class _t { // TODO isolatedDeclarations "__v_skip" constructor(t) { this.computed = t, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0; } track(t) { } trigger(t) { this.version++, this.notify(t); } notify(t) { Ve(); try { _n.NODE_ENV; for (let n = this.subs; n; n = n.prevSub) n.sub.notify() && n.sub.dep.notify(); } finally { Xe(); } } } const Fe = /* @__PURE__ */ new WeakMap(), k = Symbol( "" ), De = Symbol( "" ), ee = Symbol( "" ); function x(e, t, n) { if (pe && On) { let r = Fe.get(e); r || Fe.set(e, r = /* @__PURE__ */ new Map()); let s = r.get(n); s || (r.set(n, s = new _t()), s.map = r, s.key = n), s.track(); } } function D(e, t, n, r, s, o) { const i = Fe.get(e); if (!i) return; const a = (u) => { u && u.trigger(); }; if (Ve(), t === "clear") i.forEach(a); else { const u = J(e), c = u && Ke(n); if (u && n === "length") { const f = Number(r); i.forEach((d, m) => { (m === "length" || m === ee || !re(m) && m >= f) && a(d); }); } else switch ((n !== void 0 || i.has(void 0)) && a(i.get(n)), c && a(i.get(ee)), t) { case "add": u ? c && a(i.get("length")) : (a(i.get(k)), ue(e) && a(i.get(De))); break; case "delete": u || (a(i.get(k)), ue(e) && a(i.get(De))); break; case "set": ue(e) && a(i.get(k)); break; } } Xe(); } function $(e) { const t = R(e); return t === e ? t : (x(t, "iterate", ee), B(e) ? t : t.map(A)); } function Ye(e) { return x(e = R(e), "iterate", ee), e; } const xn = { __proto__: null, [Symbol.iterator]() { return xe(this, Symbol.iterator, A); }, concat(...e) { return $(this).concat( ...e.map((t) => J(t) ? $(t) : t) ); }, entries() { return xe(this, "entries", (e) => (e[1] = A(e[1]), e)); }, every(e, t) { return U(this, "every", e, t, void 0, arguments); }, filter(e, t) { return U(this, "filter", e, t, (n) => n.map(A), arguments); }, find(e, t) { return U(this, "find", e, t, A, arguments); }, findIndex(e, t) { return U(this, "findIndex", e, t, void 0, arguments); }, findLast(e, t) { return U(this, "findLast", e, t, A, arguments); }, findLastIndex(e, t) { return U(this, "findLastIndex", e, t, void 0, arguments); }, // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement forEach(e, t) { return U(this, "forEach", e, t, void 0, arguments); }, includes(...e) { return Ce(this, "includes", e); }, indexOf(...e) { return Ce(this, "indexOf", e); }, join(e) { return $(this).join(e); }, // keys() iterator only reads `length`, no optimisation required lastIndexOf(...e) { return Ce(this, "lastIndexOf", e); }, map(e, t) { return U(this, "map", e, t, void 0, arguments); }, pop() { return X(this, "pop"); }, push(...e) { return X(this, "push", e); }, reduce(e, ...t) { return nt(this, "reduce", e, t); }, reduceRight(e, ...t) { return nt(this, "reduceRight", e, t); }, shift() { return X(this, "shift"); }, // slice could use ARRAY_ITERATE but also seems to beg for range tracking some(e, t) { return U(this, "some", e, t, void 0, arguments); }, splice(...e) { return X(this, "splice", e); }, toReversed() { return $(this).toReversed(); }, toSorted(e) { return $(this).toSorted(e); }, toSpliced(...e) { return $(this).toSpliced(...e); }, unshift(...e) { return X(this, "unshift", e); }, values() { return xe(this, "values", A); } }; function xe(e, t, n) { const r = Ye(e), s = r[t](); return r !== e && !B(e) && (s._next = s.next, s.next = () => { const o = s._next(); return o.value && (o.value = n(o.value)), o; }), s; } const Cn = Array.prototype; function U(e, t, n, r, s, o) { const i = Ye(e), a = i !== e && !B(e), u = i[t]; if (u !== Cn[t]) { const d = u.apply(e, o); return a ? A(d) : d; } let c = n; i !== e && (a ? c = function(d, m) { return n.call(this, A(d), m, e); } : n.length > 2 && (c = function(d, m) { return n.call(this, d, m, e); })); const f = u.call(i, c, r); return a && s ? s(f) : f; } function nt(e, t, n, r) { const s = Ye(e); let o = n; return s !== e && (B(e) ? n.length > 3 && (o = function(i, a, u) { return n.call(this, i, a, u, e); }) : o = function(i, a, u) { return n.call(this, i, A(a), u, e); }), s[t](o, ...r); } function Ce(e, t, n) { const r = R(e); x(r, "iterate", ee); const s = r[t](...n); return (s === -1 || s === !1) && $n(n[0]) ? (n[0] = R(n[0]), r[t](...n)) : s; } function X(e, t, n = []) { Tn(), Ve(); const r = R(e)[t].apply(e, n); return Xe(), An(), r; } const Pn = /* @__PURE__ */ wn("__proto__,__v_isRef,__isVue"), Ot = new Set( /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(re) ); function jn(e) { re(e) || (e = String(e)); const t = R(this); return x(t, "has", e), t.hasOwnProperty(e); } class Tt { constructor(t = !1, n = !1) { this._isReadonly = t, this._isShallow = n; } get(t, n, r) { if (n === "__v_skip") return t.__v_skip; const s = this._isReadonly, o = this._isShallow; if (n === "__v_isReactive") return !s; if (n === "__v_isReadonly") return s; if (n === "__v_isShallow") return o; if (n === "__v_raw") return r === (s ? o ? kn : Ct : o ? In : xt).get(t) || // receiver is not the reactive proxy, but has the same prototype // this means the receiver is a user proxy of the reactive proxy Object.getPrototypeOf(t) === Object.getPrototypeOf(r) ? t : void 0; const i = J(t); if (!s) { let u; if (i && (u = xn[n])) return u; if (n === "hasOwnProperty") return jn; } const a = Reflect.get( t, n, // if this is a proxy wrapping a ref, return methods using the raw ref // as receiver so that we don't have to call `toRaw` on the ref in all // its class methods W(t) ? t : r ); return (re(n) ? Ot.has(n) : Pn(n)) || (s || x(t, "get", n), o) ? a : W(a) ? i && Ke(n) ? a : a.value : we(a) ? s ? jt(a) : Pt(a) : a; } } class vn extends Tt { constructor(t = !1) { super(!1, t); } set(t, n, r, s) { let o = t[n]; if (!this._isShallow) { const u = z(o); if (!B(r) && !z(r) && (o = R(o), r = R(r)), !J(t) && W(o) && !W(r)) return u || (o.value = r), !0; } const i = J(t) && Ke(n) ? Number(n) < t.length : Ue(t, n), a = Reflect.set( t, n, r, W(t) ? t : s ); return t === R(s) && (i ? Z(r, o) && D(t, "set", n, r) : D(t, "add", n, r)), a; } deleteProperty(t, n) { const r = Ue(t, n); t[n]; const s = Reflect.deleteProperty(t, n); return s && r && D(t, "delete", n, void 0), s; } has(t, n) { const r = Reflect.has(t, n); return (!re(n) || !Ot.has(n)) && x(t, "has", n), r; } ownKeys(t) { return x( t, "iterate", J(t) ? "length" : k ), Reflect.ownKeys(t); } } class Ln extends Tt { constructor(t = !1) { super(!0, t); } set(t, n) { return !0; } deleteProperty(t, n) { return !0; } } const Nn = /* @__PURE__ */ new vn(), Un = /* @__PURE__ */ new Ln(), Be = (e) => e, ae = (e) => Reflect.getPrototypeOf(e); function Fn(e, t, n) { return function(...r) { const s = this.__v_raw, o = R(s), i = ue(o), a = e === "entries" || e === Symbol.iterator && i, u = e === "keys" && i, c = s[e](...r), f = n ? Be : t ? Me : A; return !t && x( o, "iterate", u ? De : k ), { // iterator protocol next() { const { value: d, done: m } = c.next(); return m ? { value: d, done: m } : { value: a ? [f(d[0]), f(d[1])] : f(d), done: m }; }, // iterable protocol [Symbol.iterator]() { return this; } }; }; } function ce(e) { return function(...t) { return e === "delete" ? !1 : e === "clear" ? void 0 : this; }; } function Dn(e, t) { const n = { get(s) { const o = this.__v_raw, i = R(o), a = R(s); e || (Z(s, a) && x(i, "get", s), x(i, "get", a)); const { has: u } = ae(i), c = t ? Be : e ? Me : A; if (u.call(i, s)) return c(o.get(s)); if (u.call(i, a)) return c(o.get(a)); o !== i && o.get(s); }, get size() { const s = this.__v_raw; return !e && x(R(s), "iterate", k), Reflect.get(s, "size", s); }, has(s) { const o = this.__v_raw, i = R(o), a = R(s); return e || (Z(s, a) && x(i, "has", s), x(i, "has", a)), s === a ? o.has(s) : o.has(s) || o.has(a); }, forEach(s, o) { const i = this, a = i.__v_raw, u = R(a), c = t ? Be : e ? Me : A; return !e && x(u, "iterate", k), a.forEach((f, d) => s.call(o, c(f), c(d), i)); } }; return yn( n, e ? { add: ce("add"), set: ce("set"), delete: ce("delete"), clear: ce("clear") } : { add(s) { !t && !B(s) && !z(s) && (s = R(s)); const o = R(this); return ae(o).has.call(o, s) || (o.add(s), D(o, "add", s, s)), this; }, set(s, o) { !t && !B(o) && !z(o) && (o = R(o)); const i = R(this), { has: a, get: u } = ae(i); let c = a.call(i, s); c || (s = R(s), c = a.call(i, s)); const f = u.call(i, s); return i.set(s, o), c ? Z(o, f) && D(i, "set", s, o) : D(i, "add", s, o), this; }, delete(s) { const o = R(this), { has: i, get: a } = ae(o); let u = i.call(o, s); u || (s = R(s), u = i.call(o, s)), a && a.call(o, s); const c = o.delete(s); return u && D(o, "delete", s, void 0), c; }, clear() { const s = R(this), o = s.size !== 0, i = s.clear(); return o && D( s, "clear", void 0, void 0 ), i; } } ), [ "keys", "values", "entries", Symbol.iterator ].forEach((s) => { n[s] = Fn(s, e, t); }), n; } function At(e, t) { const n = Dn(e, t); return (r, s, o) => s === "__v_isReactive" ? !e : s === "__v_isReadonly" ? e : s === "__v_raw" ? r : Reflect.get( Ue(n, s) && s in r ? n : r, s, o ); } const Bn = { get: /* @__PURE__ */ At(!1, !1) }, Mn = { get: /* @__PURE__ */ At(!0, !1) }, xt = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), Ct = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(); function qn(e) { switch (e) { case "Object": case "Array": return 1; case "Map": case "Set": case "WeakMap": case "WeakSet": return 2; default: return 0; } } function Hn(e) { return e.__v_skip || !Object.isExtensible(e) ? 0 : qn(Sn(e)); } function Pt(e) { return z(e) ? e : vt( e, !1, Nn, Bn, xt ); } function jt(e) { return vt( e, !0, Un, Mn, Ct ); } function vt(e, t, n, r, s) { if (!we(e) || e.__v_raw && !(t && e.__v_isReactive)) return e; const o = Hn(e); if (o === 0) return e; const i = s.get(e); if (i) return i; const a = new Proxy( e, o === 2 ? r : n ); return s.set(e, a), a; } function z(e) { return !!(e && e.__v_isReadonly); } function B(e) { return !!(e && e.__v_isShallow); } function $n(e) { return e ? !!e.__v_raw : !1; } function R(e) { const t = e && e.__v_raw; return t ? R(t) : e; } const A = (e) => we(e) ? Pt(e) : e, Me = (e) => we(e) ? jt(e) : e; function W(e) { return e ? e.__v_isRef === !0 : !1; } function Pe(e) { return Jn(e, !1); } function Jn(e, t) { return W(e) ? e : new Wn(e, t); } class Wn { constructor(t, n) { this.dep = new _t(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = n ? t : R(t), this._value = n ? t : A(t), this.__v_isShallow = n; } get value() { return this.dep.track(), this._value; } set value(t) { const n = this._rawValue, r = this.__v_isShallow || B(t) || z(t); t = r ? t : R(t), Z(t, n) && (this._rawValue = t, this._value = r ? t : A(t), this.dep.trigger()); } } function Lt(e, t) { return function() { return e.apply(t, arguments); }; } const { toString: zn } = Object.prototype, { getPrototypeOf: Ge } = Object, { iterator: ye, toStringTag: Nt } = Symbol, be = /* @__PURE__ */ ((e) => (t) => { const n = zn.call(t); return e[n] || (e[n] = n.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)), L = (e) => (e = e.toLowerCase(), (t) => be(t) === e), Re = (e) => (t) => typeof t === e, { isArray: K } = Array, te = Re("undefined"); function Kn(e) { return e !== null && !te(e) && e.constructor !== null && !te(e.constructor) && C(e.constructor.isBuffer) && e.constructor.isBuffer(e); } const Ut = L("ArrayBuffer"); function Vn(e) { let t; return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ut(e.buffer), t; } const Xn = Re("string"), C = Re("function"), Ft = Re("number"), Ee = (e) => e !== null && typeof e == "object", Yn = (e) => e === !0 || e === !1, fe = (e) => { if (be(e) !== "object") return !1; const t = Ge(e); return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Nt in e) && !(ye in e); }, Gn = L("Date"), Qn = L("File"), Zn = L("Blob"), er = L("FileList"), tr = (e) => Ee(e) && C(e.pipe), nr = (e) => { let t; return e && (typeof FormData == "function" && e instanceof FormData || C(e.append) && ((t = be(e)) === "formdata" || // detect form-data instance t === "object" && C(e.toString) && e.toString() === "[object FormData]")); }, rr = L("URLSearchParams"), [sr, or, ir, ar] = ["ReadableStream", "Request", "Response", "Headers"].map(L), cr = (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 { const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length; let a; for (r = 0; r < i; r++) a = o[r], t.call(null, e[a], a, e); } } function Dt(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 I = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Bt = (e) => !te(e) && e !== I; function Ie() { const { caseless: e } = Bt(this) && this || {}, t = {}, n = (r, s) => { const o = e && Dt(t, s) || s; fe(t[o]) && fe(r) ? t[o] = Ie(t[o], r) : fe(r) ? t[o] = Ie({}, r) : K(r) ? t[o] = r.slice() : t[o] = r; }; for (let r = 0, s = arguments.length; r < s; r++) arguments[r] && se(arguments[r], n); return t; } const lr = (e, t, n, { allOwnKeys: r } = {}) => (se(t, (s, o) => { n && C(s) ? e[o] = Lt(s, n) : e[o] = s; }, { allOwnKeys: r }), e), ur = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), fr = (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); }, dr = (e, t, n, r) => { let s, o, i; const a = {}; 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)) && !a[i] && (t[i] = e[i], a[i] = !0); e = n !== !1 && Ge(e); } while (e && (!n || n(e, t)) && e !== Object.prototype); return t; }, hr = (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; }, pr = (e) => { if (!e) return null; if (K(e)) return e; let t = e.length; if (!Ft(t)) return null; const n = new Array(t); for (; t-- > 0; ) n[t] = e[t]; return n; }, mr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ge(Uint8Array)), gr = (e, t) => { const r = (e && e[ye]).call(e); let s; for (; (s = r.next()) && !s.done; ) { const o = s.value; t.call(e, o[0], o[1]); } }, wr = (e, t) => { let n; const r = []; for (; (n = e.exec(t)) !== null; ) r.push(n); return r; }, yr = L("HTMLFormElement"), br = (e) => e.toLowerCase().replace( /[-_\s]([a-z\d])(\w*)/g, function(n, r, s) { return r.toUpperCase() + s; } ), rt = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Rr = L("RegExp"), Mt = (e, t) => { const n = Object.getOwnPropertyDescriptors(e), r = {}; se(n, (s, o) => { let i; (i = t(s, o, e)) !== !1 && (r[o] = i || s); }), Object.defineProperties(e, r); }, Er = (e) => { Mt(e, (t, n) => { if (C(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1) return !1; const r = e[n]; if (C(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 + "'"); }); } }); }, Sr = (e, t) => { const n = {}, r = (s) => { s.forEach((o) => { n[o] = !0; }); }; return K(e) ? r(e) : r(String(e).split(t)), n; }, _r = () => { }, Or = (e, t) => e != null && Number.isFinite(e = +e) ? e : t; function Tr(e) { return !!(e && C(e.append) && e[Nt] === "FormData" && e[ye]); } const Ar = (e) => { const t = new Array(10), n = (r, s) => { if (Ee(r)) { if (t.indexOf(r) >= 0) return; if (!("toJSON" in r)) { t[s] = r; const o = K(r) ? [] : {}; return se(r, (i, a) => { const u = n(i, s + 1); !te(u) && (o[a] = u); }), t[s] = void 0, o; } } return r; }; return n(e, 0); }, xr = L("AsyncFunction"), Cr = (e) => e && (Ee(e) || C(e)) && C(e.then) && C(e.catch), It = ((e, t) => e ? setImmediate : t ? ((n, r) => (I.addEventListener("message", ({ source: s, data: o }) => { s === I && o === n && r.length && r.shift()(); }, !1), (s) => { r.push(s), I.postMessage(n, "*"); }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))( typeof setImmediate == "function", C(I.postMessage) ), Pr = typeof queueMicrotask < "u" ? queueMicrotask.bind(I) : typeof process < "u" && process.nextTick || It, jr = (e) => e != null && C(e[ye]), l = { isArray: K, isArrayBuffer: Ut, isBuffer: Kn, isFormData: nr, isArrayBufferView: Vn, isString: Xn, isNumber: Ft, isBoolean: Yn, isObject: Ee, isPlainObject: fe, isReadableStream: sr, isRequest: or, isResponse: ir, isHeaders: ar, isUndefined: te, isDate: Gn, isFile: Qn, isBlob: Zn, isRegExp: Rr, isFunction: C, isStream: tr, isURLSearchParams: rr, isTypedArray: mr, isFileList: er, forEach: se, merge: Ie, extend: lr, trim: cr, stripBOM: ur, inherits: fr, toFlatObject: dr, kindOf: be, kindOfTest: L, endsWith: hr, toArray: pr, forEachEntry: gr, matchAll: wr, isHTMLForm: yr, hasOwnProperty: rt, hasOwnProp: rt, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: Mt, freezeMethods: Er, toObjectSet: Sr, toCamelCase: br, noop: _r, toFiniteNumber: Or, findKey: Dt, global: I, isContextDefined: Bt, isSpecCompliantForm: Tr, toJSONObject: Ar, isAsyncFn: xr, isThenable: Cr, setImmediate: It, asap: Pr, isIterable: jr }; function w(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); } l.inherits(w, 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 kt = w.prototype, qt = {}; [ "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) => { qt[e] = { value: e }; }); Object.defineProperties(w, qt); Object.defineProperty(kt, "isAxiosError", { value: !0 }); w.from = (e, t, n, r, s, o) => { const i = Object.create(kt); return l.toFlatObject(e, i, function(u) { return u !== Error.prototype; }, (a) => a !== "isAxiosError"), w.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i; }; const vr = null; function ke(e) { return l.isPlainObject(e) || l.isArray(e); } function Ht(e) { return l.endsWith(e, "[]") ? e.slice(0, -2) : e; } function st(e, t, n) { return e ? e.concat(t).map(function(s, o) { return s = Ht(s), !n && o ? "[" + s + "]" : s; }).join(n ? "." : "") : t; } function Lr(e) { return l.isArray(e) && !e.some(ke); } const Nr = l.toFlatObject(l, {}, null, function(t) { return /^is[A-Z]/.test(t); }); function Se(e, t, n) { if (!l.isObject(e)) throw new TypeError("target must be an object"); t = t || new FormData(), n = l.toFlatObject(n, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(g, p) { return !l.isUndefined(p[g]); }); const r = n.metaTokens, s = n.visitor || f, o = n.dots, i = n.indexes, u = (n.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(t); if (!l.isFunction(s)) throw new TypeError("visitor must be a function"); function c(h) { if (h === null) return ""; if (l.isDate(h)) return h.toISOString(); if (l.isBoolean(h)) return h.toString(); if (!u && l.isBlob(h)) throw new w("Blob is not supported. Use a Buffer instead."); return l.isArrayBuffer(h) || l.isTypedArray(h) ? u && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h; } function f(h, g, p) { let y = h; if (h && !p && typeof h == "object") { if (l.endsWith(g, "{}")) g = r ? g : g.slice(0, -2), h = JSON.stringify(h); else if (l.isArray(h) && Lr(h) || (l.isFileList(h) || l.endsWith(g, "[]")) && (y = l.toArray(h))) return g = Ht(g), y.forEach(function(b, v) { !(l.isUndefined(b) || b === null) && t.append( // eslint-disable-next-line no-nested-ternary i === !0 ? st([g], v, o) : i === null ? g : g + "[]", c(b) ); }), !1; } return ke(h) ? !0 : (t.append(st(p, g, o), c(h)), !1); } const d = [], m = Object.assign(Nr, { defaultVisitor: f, convertValue: c, isVisitable: ke }); function E(h, g) { if (!l.isUndefined(h)) { if (d.indexOf(h) !== -1) throw Error("Circular reference detected in " + g.join(".")); d.push(h), l.forEach(h, function(y, S) { (!(l.isUndefined(y) || y === null) && s.call( t, y, l.isString(S) ? S.trim() : S, g, m )) === !0 && E(y, g ? g.concat(S) : [S]); }), d.pop(); } } if (!l.isObject(e)) throw new TypeError("data must be an object"); return E(e), t; } function ot(e) { const t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) { return t[r]; }); } function Qe(e, t) { this._pairs = [], e && Se(e, this, t); } const $t = Qe.prototype; $t.append = function(t, n) { this._pairs.push([t, n]); }; $t.toString = function(t) { const n = t ? function(r) { return t.call(this, r, ot); } : ot; return this._pairs.map(function(s) { return n(s[0]) + "=" + n(s[1]); }, "").join("&"); }; function Ur(e) { return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function Jt(e, t, n) { if (!t) return e; const r = n && n.encode || Ur; l.isFunction(n) && (n = { serialize: n }); const s = n && n.serialize; let o; if (s ? o = s(t, n) : o = l.isURLSearchParams(t) ? t.toString() : new Qe(t, n).toString(r), o) { const i = e.indexOf("#"); i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + o; } return e; } class it { 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) { l.forEach(this.handlers, function(r) { r !== null && t(r); }); } } const Wt = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Fr = typeof URLSearchParams < "u" ? URLSearchParams : Qe, Dr = typeof FormData < "u" ? FormData : null, Br = typeof Blob < "u" ? Blob : null, Mr = { isBrowser: !0, classes: { URLSearchParams: Fr, FormData: Dr, Blob: Br }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Ze = typeof window < "u" && typeof document < "u", qe = typeof navigator == "object" && navigator || void 0, Ir = Ze && (!qe || ["ReactNative", "NativeScript", "NS"].indexOf(qe.product) < 0), kr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts == "function", qr = Ze && window.location.href || "http://localhost", Hr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv: Ze, hasStandardBrowserEnv: Ir, hasStandardBrowserWebWorkerEnv: kr, navigator: qe, origin: qr }, Symbol.toStringTag, { value: "Module" })), O = { ...Hr, ...Mr }; function $r(e, t) { return Se(e, new O.classes.URLSearchParams(), Object.assign({ visitor: function(n, r, s, o) { return O.isNode && l.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments); } }, t)); } function Jr(e) { return l.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]); } function Wr(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 zt(e) { function t(n, r, s, o) { let i = n[o++]; if (i === "__proto__") return !0; const a = Number.isFinite(+i), u = o >= n.length; return i = !i && l.isArray(s) ? s.length : i, u ? (l.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !l.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && l.isArray(s[i]) && (s[i] = Wr(s[i])), !a); } if (l.isFormData(e) && l.isFunction(e.entries)) { const n = {}; return l.forEachEntry(e, (r, s) => { t(Jr(r), s, n, 0); }), n; } return null; } function zr(e, t, n) { if (l.isString(e)) try { return (t || JSON.parse)(e), l.trim(e); } catch (r) { if (r.name !== "SyntaxError") throw r; } return (n || JSON.stringify)(e); } const oe = { transitional: Wt, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, n) { const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = l.isObject(t); if (o && l.isHTMLForm(t) && (t = new FormData(t)), l.isFormData(t)) return s ? JSON.stringify(zt(t)) : t; if (l.isArrayBuffer(t) || l.isBuffer(t) || l.isStream(t) || l.isFile(t) || l.isBlob(t) || l.isReadableStream(t)) return t; if (l.isArrayBufferView(t)) return t.buffer; if (l.isURLSearchParams(t)) return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString(); let a; if (o) { if (r.indexOf("application/x-www-form-urlencoded") > -1) return $r(t, this.formSerializer).toString(); if ((a = l.isFileList(t)) || r.indexOf("multipart/form-data") > -1) { const u = this.env && this.env.FormData; return Se( a ? { "files[]": t } : t, u && new u(), this.formSerializer ); } } return o || s ? (n.setContentType("application/json", !1), zr(t)) : t; }], transformResponse: [function(t) { const n = this.transitional || oe.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json"; if (l.isResponse(t) || l.isReadableStream(t)) return t; if (t && l.isString(t) && (r && !this.responseType || s)) { const i = !(n && n.silentJSONParsing) && s; try { return JSON.parse(t); } catch (a) { if (i) throw a.name === "SyntaxError" ? w.from(a, w.ERR_BAD_RESPONSE, this, null, this.response) : a; } } 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: O.classes.FormData, Blob: O.classes.Blob }, validateStatus: function(t) { return t >= 200 && t < 300; }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; l.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => { oe.headers[e] = {}; }); const Kr = 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" ]), Vr = (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] && Kr[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r); }), t; }, at = Symbol("internals"); function Y(e) { return e && String(e).trim().toLowerCase(); } function de(e) { return e === !1 || e == null ? e : l.isArray(e) ? e.map(de) : String(e); } function Xr(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 Yr = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()); function je(e, t, n, r, s) { if (l.isFunction(r)) return r.call(this, t, n); if (s && (t = n), !!l.isString(t)) { if (l.isString(r)) return t.indexOf(r) !== -1; if (l.isRegExp(r)) return r.test(t); } } function Gr(e) { return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r); } function Qr(e, t) { const n = l.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 }); }); } let P = class { constructor(t) { t && this.set(t); } set(t, n, r) { const s = this; function o(a, u, c) { const f = Y(u); if (!f) throw new Error("header name must be a non-empty string"); const d = l.findKey(s, f); (!d || s[d] === void 0 || c === !0 || c === void 0 && s[d] !== !1) && (s[d || u] = de(a)); } const i = (a, u) => l.forEach(a, (c, f) => o(c, f, u)); if (l.isPlainObject(t) || t instanceof this.constructor) i(t, n); else if (l.isString(t) && (t = t.trim()) && !Yr(t)) i(Vr(t), n); else if (l.isObject(t) && l.isIterable(t)) { let a = {}, u, c; for (const f of t) { if (!l.isArray(f)) throw TypeError("Object iterator must return a key-value pair"); a[c = f[0]] = (u = a[c]) ? l.isArray(u) ? [...u, f[1]] : [u, f[1]] : f[1]; } i(a, n); } else t != null && o(n, t, r); return this; } get(t, n) { if (t = Y(t), t) { const r = l.findKey(this, t); if (r) { const s = this[r]; if (!n) return s; if (n === !0) return Xr(s); if (l.isFunction(n)) return n.call(this, s, r); if (l.isRegExp(n)) return n.exec(s); throw new TypeError("parser must be boolean|regexp|function"); } } } has(t, n) { if (t = Y(t), t) { const r = l.findKey(this, t); return !!(r && this[r] !== void 0 && (!n || je(this, this[r], r, n))); } return !1; } delete(t, n) { const r = this; let s = !1; function o(i) { if (i = Y(i), i) { const a = l.findKey(r, i); a && (!n || je(r, r[a], a, n)) && (delete r[a], s = !0); } } return l.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 || je(this, this[o], o, t, !0)) && (delete this[o], s = !0); } return s; } normalize(t) { const n = this, r = {}; return l.forEach(this, (s, o) => { const i = l.findKey(r, o); if (i) { n[i] = de(s), delete n[o]; return; } const a = t ? Gr(o) : String(o).trim(); a !== o && delete n[o], n[a] = de(s), r[a] = !0; }), this; } concat(...t) { return this.constructor.concat(this, ...t); } toJSON(t) { const n = /* @__PURE__ */ Object.create(null); return l.forEach(this, (r, s) => { r != null && r !== !1 && (n[s] = t && l.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[at] = this[at] = { accessors: {} }).accessors, s = this.prototype; function o(i) { const a = Y(i); r[a] || (Qr(s, i), r[a] = !0); } return l.isArray(t) ? t.forEach(o) : o(t), this; } }; P.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); l.reduceDescriptors(P.prototype, ({ value: e }, t) => { let n = t[0].toUpperCase() + t.slice(1); return { get: () => e, set(r) { this[n] = r; } }; }); l.freezeMethods(P); function ve(e, t) { const n = this || oe, r = t || n, s = P.from(r.headers); let o = r.data; return l.forEach(e, function(a) { o = a.call(n, o, s.normalize(), t ? t.status : void 0); }), s.normalize(), o; } function Kt(e) { return !!(e && e.__CANCEL__); } function V(e, t, n) { w.call(this, e ?? "canceled", w.ERR_CANCELED, t, n), this.name = "CanceledError"; } l.inherits(V, w, { __CANCEL__: !0 }); function Vt(e, t, n) { const r = n.config.validateStatus; !n.status || !r || r(n.status) ? e(n) : t(new w( "Request failed with status code " + n.status, [w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4], n.config, n.request, n )); } function Zr(e) { const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e); return t && t[1] || ""; } function es(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(u) { const c = Date.now(), f = r[o]; i || (i = c), n[s] = u, r[s] = c; let d = o, m = 0; for (; d !== s; ) m += n[d++], d = d % e; if (s = (s + 1) % e, s === o && (o = (o + 1) % e), c - i < t) return; const E = f && c - f; return E ? Math.round(m * 1e3 / E) : void 0; }; } function ts(e, t) { let n = 0, r = 1e3 / t, s, o; const i = (c, f = Date.now()) => { n = f, s = null, o && (clearTimeout(o), o = null), e.apply(null, c); }; return [(...c) => { const f = Date.now(), d = f - n; d >= r ? i(c, f) : (s = c, o || (o = setTimeout(() => { o = null, i(s); }, r - d))); }, () => s && i(s)]; } const me = (e, t, n = 3) => { let r = 0; const s = es(50, 250); return ts((o) => { const i = o.loaded, a = o.lengthComputable ? o.total : void 0, u = i - r, c = s(u), f = i <= a; r = i; const d = { loaded: i, total: a, progress: a ? i / a : void 0, bytes: u, rate: c || void 0, estimated: c && a && f ? (a - i) / c : void 0, event: o, lengthComputable: a != null, [t ? "download" : "upload"]: !0 }; e(d); }, n); }, ct = (e, t) => { const n = e != null; return [(r) => t[0]({ lengthComputable: n, total: e, loaded: r }), t[1]]; }, lt = (e) => (...t) => l.asap(() => e(...t)), ns = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, O.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))( new URL(O.origin), O.navigator && /(msie|trident)/i.test(O.navigator.userAgent) ) : () => !0, rs = O.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(e, t, n, r, s, o) { const i = [e + "=" + encodeURIComponent(t)]; l.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), l.isString(r) && i.push("path=" + r), l.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 ss(e) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e); } function os(e, t) { return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e; } function Xt(e, t, n) { let r = !ss(t); return e && (r || n == !1) ? os(e, t) : t; } const ut = (e) => e instanceof P ? { ...e } : e; function H(e, t) { t = t || {}; const n = {}; function r(c, f, d, m) { return l.isPlainObject(c) && l.isPlainObject(f) ? l.merge.call({ caseless: m }, c, f) : l.isPlainObject(f) ? l.merge({}, f) : l.isArray(f) ? f.slice() : f; } function s(c, f, d, m) { if (l.isUndefined(f)) { if (!l.isUndefined(c)) return r(void 0, c, d, m); } else return r(c, f, d, m); } function o(c, f) { if (!l.isUndefined(f)) return r(void 0, f); } function i(c, f) { if (l.isUndefined(f)) { if (!l.isUndefined(c)) return r(void 0, c); } else return r(void 0, f); } function a(c, f, d) { if (d in t) return r(c, f); if (d in e) return r(void 0, c); } const u = { 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: a, headers: (c, f, d) => s(ut(c), ut(f), d, !0) }; return l.forEach(Object.keys(Object.assign({}, e, t)), function(f) { const d = u[f] || s, m = d(e[f], t[f], f); l.isUndefined(m) && d !== a || (n[f] = m); }), n; } const Yt = (e) => { const t = H({}, e); let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t; t.headers = i = P.from(i), t.url = Jt(Xt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set( "Authorization", "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : "")) ); let u; if (l.isFormData(n)) { if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv) i.setContentType(void 0); else if ((u = i.getContentType()) !== !1) { const [c, ...f] = u ? u.split(";").map((d) => d.trim()).filter(Boolean) : []; i.setContentType([c || "multipart/form-data", ...f].join("; ")); } } if (O.hasStandardBrowserEnv && (r && l.isFunction(r) && (r = r(t)), r || r !== !1 && ns(t.url))) { const c = s && o && rs.read(o); c && i.set(s, c); } return t; }, is = typeof XMLHttpRequest < "u", as = is && function(e) { return new Promise(function(n, r) { const s = Yt(e); let o = s.data; const i = P.from(s.headers).normalize(); let { responseType: a, onUploadProgress: u, onDownloadProgress: c } = s, f, d, m, E, h; function g() { E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(f), s.signal && s.signal.removeEventListener("abort", f); } let p = new XMLHttpRequest(); p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout; function y() { if (!p) return; const b = P.from( "getAllResponseHeaders" in p && p.getAllResponseHeaders() ), T = { data: !a || a === "text" || a === "json" ? p.responseText : p.response, status: p.status, statusText: p.statusText, headers: b, config: e, request: p }; Vt(function(M) { n(M), g(); }, function(M) { r(M), g(); }, T), p = null; } "onloadend" in p ? p.onloadend = y : p.onreadystatechange = function() { !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(y); }, p.onabort = function() { p && (r(new w("Request aborted", w.ECONNABORTED, e, p)), p = null); }, p.onerror = function() { r(new w("Network Error", w.ERR_NETWORK, e, p)), p = null; }, p.ontimeout = function() { let v = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded"; const T = s.transitional || Wt; s.timeoutErrorMessage && (v = s.timeoutErrorMessage), r(new w( v, T.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED, e, p )), p = null; }, o === void 0 && i.setContentType(null), "setRequestHeader" in p && l.forEach(i.toJSON(), function(v, T) { p.setRequestHeader(T, v); }), l.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), a && a !== "json" && (p.responseType = s.responseType), c && ([m, h] = me(c, !0), p.addEventListener("progress", m)), u && p.upload && ([d, E] = me(u), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (f = (b) => { p && (r(!b || b.type ? new V(null, e, p) : b), p.abort(), p = null); }, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f))); const S = Zr(s.url); if (S && O.protocols.indexOf(S) === -1) { r(new w("Unsupported protocol " + S + ":", w.ERR_BAD_REQUEST, e)); return; } p.send(o || null); }); }, cs = (e, t) => { const { length: n } = e = e ? e.filter(Boolean) : []; if (t || n) { let r = new AbortController(), s; const o = function(c) { if (!s) { s = !0, a(); const f = c instanceof Error ? c : this.reason; r.abort(f instanceof w ? f : new V(f instanceof Error ? f.message : f)); } }; let i = t && setTimeout(() => { i = null, o(new w(`timeout ${t} of ms exceeded`, w.ETIMEDOUT)); }, t); const a = () => { e && (i && clearTimeout(i), i = null, e.forEach((c) => { c.unsubscribe ? c.unsubscribe(o) : c.removeEventListener("abort", o); }), e = null); }; e.forEach((c) => c.addEventListener("abort", o)); const { signal: u } = r; return u.unsubscribe = () => l.asap(a), u; } }, ls = 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; }, us = async function* (e, t) { for await (const n of fs(e)) yield* ls(n, t); }, fs = 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(); } }, ft = (e, t, n, r) => { const s = us(e, t); let o = 0, i, a = (u) => { i || (i = !0, r && r(u)); }; return new ReadableStream({ async pull(u) { try { const { done: c, value: f } = await s.next(); if (c) { a(), u.close(); return; } let d = f.byteLength; if (n) { let m = o += d; n(m); } u.enqueue(new Uint8Array(f)); } catch (c) { throw a(c), c; } }, cancel(u) { return a(u), s.return(); } }, { highWaterMark: 2 }); }, _e = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Gt = _e && typeof ReadableStream == "function", ds = _e && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Qt = (e, ...t) => { try { return !!e(...t); } catch { return !1; } }, hs = Gt && Qt(() => { let e = !1; const t = new Request(O.origin, { body: new ReadableStream(), method: "POST", get duplex() { return e = !0, "half"; } }).headers.has("Content-Type");