UNPKG

@sensetence/vue-quintable

Version:

<img alt="vue-quintable" src="https://sensetence.com/vue-quintable-demo/vue-table.png" width="265" height="222">

1,664 lines 174 kB
var is = Object.defineProperty, ns = Object.defineProperties; var rs = Object.getOwnPropertyDescriptors; var ht = Object.getOwnPropertySymbols; var ls = Object.prototype.hasOwnProperty, os = Object.prototype.propertyIsEnumerable; var X = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), as = (e) => { throw TypeError(e); }; var dt = (e, t, i) => t in e ? is(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, ne = (e, t) => { for (var i in t || (t = {})) ls.call(t, i) && dt(e, i, t[i]); if (ht) for (var i of ht(t)) os.call(t, i) && dt(e, i, t[i]); return e; }, ft = (e, t) => ns(e, rs(t)); var z = (e, t, i) => new Promise((n, r) => { var s = (g) => { try { c(i.next(g)); } catch (u) { r(u); } }, l = (g) => { try { c(i.throw(g)); } catch (u) { r(u); } }, c = (g) => g.done ? n(g.value) : Promise.resolve(g.value).then(s, l); c((i = i.apply(e, t)).next()); }), J = function(e, t) { this[0] = e, this[1] = t; }, Te = (e, t, i) => { var n = (l, c, g, u) => { try { var o = i[l](c), a = (c = o.value) instanceof J, f = o.done; Promise.resolve(a ? c[0] : c).then((b) => a ? n(l === "return" ? l : "next", c[1] ? { done: b.done, value: b.value } : b, g, u) : g({ value: b, done: f })).catch((b) => n("throw", b, g, u)); } catch (b) { u(b); } }, r = (l) => s[l] = (c) => new Promise((g, u) => n(l, c, g, u)), s = {}; return i = i.apply(e, t), s[X("asyncIterator")] = () => s, r("next"), r("throw"), r("return"), s; }, qe = (e) => { var t = e[X("asyncIterator")], i = !1, n, r = {}; return t == null ? (t = e[X("iterator")](), n = (s) => r[s] = (l) => t[s](l)) : (t = t.call(e), n = (s) => r[s] = (l) => { if (i) { if (i = !1, s === "throw") throw l; return l; } return i = !0, { done: !1, value: new J(new Promise((c) => { var g = t[s](l); g instanceof Object || as("Object expected"), c(g); }), 1) }; }), r[X("iterator")] = () => r, n("next"), "throw" in t ? n("throw") : r.throw = (s) => { throw s; }, "return" in t && n("return"), r; }, gt = (e, t, i) => (t = e[X("asyncIterator")]) ? t.call(e) : (e = e[X("iterator")](), t = {}, i = (n, r) => (r = e[n]) && (t[n] = (s) => new Promise((l, c, g) => (s = r.call(e, s), g = s.done, Promise.resolve(s.value).then((u) => l({ value: u, done: g }), c)))), i("next"), i("return"), t); import At from "floating-vue"; import { library as cs } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon as us } from "@fortawesome/vue-fontawesome"; import { faChevronUp as hs, faChevronDown as ds, faInfoCircle as fs, faAngleDoubleLeft as gs, faAngleDoubleRight as ps, faAngleLeft as ms, faAngleRight as ws, faArrowsAlt as bs, faExpand as ys, faSort as Ss, faSortAmountDown as ks, faSortAmountDownAlt as Fs, faSortAmountUp as Rs, faSortAmountUpAlt as Cs, faTimes as xs, faCheck as Ps, faSquare as vs, faCircleNotch as Os, faPlus as _s, faCaretUp as Es } from "@fortawesome/free-solid-svg-icons"; import { createElementBlock as p, openBlock as d, normalizeClass as P, createElementVNode as k, createCommentVNode as m, renderSlot as O, resolveComponent as je, resolveDirective as As, withDirectives as I, vModelText as Ts, Fragment as j, createBlock as _, withCtx as Z, vModelCheckbox as de, renderList as Y, withModifiers as $, toDisplayString as T, createVNode as L, normalizeStyle as pt, resolveDynamicComponent as Le, mergeProps as Ue, createTextVNode as mt } from "vue"; import qs from "vue-select"; import wt from "fuzzy.js"; import { v4 as js } from "uuid"; cs.add( hs, ds, fs, gs, ps, ms, ws, bs, ys, Ss, ks, Fs, Rs, Cs, xs, Ps, vs, Os, _s, Es ); function Ls(e) { e.component("QuintableFontAwesomeIcon", us); } const Je = (e, t) => { const i = e.__vccOpts || e; for (const [n, r] of t) i[n] = r; return i; }, Us = { name: "PrettyCheckbox", props: { type: { type: String, default: null }, name: { type: String, default: null }, value: { type: [String, Number, Object, Array, Boolean], default: null }, modelValue: { type: [String, Number, Object, Array, Boolean], default: void 0 }, trueValue: { type: [String, Number, Object, Array, Boolean], default: !0 }, falseValue: { type: [String, Number, Object, Array, Boolean], default: !1 }, checked: { type: [String, Boolean], default: !1 }, disabled: { type: [String, Boolean], default: !1 }, required: { type: [String, Boolean], default: !1 }, indeterminate: { type: [String, Boolean], default: !1 }, color: { type: String, default: null }, offColor: { type: String, default: null }, hoverColor: { type: String, default: null }, indeterminateColor: { type: String, default: null }, toggle: { type: [String, Boolean], default: !1 }, hover: { type: [String, Boolean], default: !1 }, focus: { type: [String, Boolean], default: !1 } }, emits: ["update:modelValue", "change", "update:indeterminate"], data() { return { m_checked: !1, default_mode: !1 }; }, computed: { shouldBeChecked() { return this.modelValue !== void 0 ? this.modelValue instanceof Array ? this.modelValue.includes(this.value) : this._trueValue ? this.modelValue === this.trueValue : typeof this.modelValue == "string" ? !0 : !!this.modelValue : this.m_checked; }, _disabled() { return typeof this.disabled == "string" ? !0 : !!this.disabled; }, _required() { return typeof this.required == "string" ? !0 : !!this.required; }, _indeterminate() { return typeof this.indeterminate == "string" ? !0 : !!this.indeterminate; }, _trueValue() { return typeof this.trueValue == "string" ? this.trueValue : !!this.trueValue; }, _falseValue() { return typeof this.falseValue == "string" ? this.falseValue : !!this.falseValue; }, _toggle() { return typeof this.toggle == "string" ? !0 : !!this.toggle; }, _hover() { return typeof this.hover == "string" ? !0 : !!this.hover; }, _focus() { return typeof this.focus == "string" ? !0 : !!this.focus; }, classes() { return { pretty: !0, "p-default": this.default_mode, "p-toggle": this._toggle, "p-has-hover": this._hover, "p-has-focus": this._focus, "p-has-indeterminate": this._indeterminate }; }, onClasses() { let e = { state: !0, "p-on": this._toggle }; return this.color && (e[`p-${this.color}`] = !0), e; }, offClasses() { let e = { state: !0, "p-off": !0 }; return this.offColor && (e[`p-${this.offColor}`] = !0), e; }, hoverClasses() { let e = { state: !0, "p-is-hover": !0 }; return this.hoverColor && (e[`p-${this.hoverColor}`] = !0), e; }, indeterminateClasses() { let e = { state: !0, "p-is-indeterminate": !0 }; return this.indeterminateColor && (e[`p-${this.indeterminateColor}`] = !0), e; } }, watch: { checked(e) { this.m_checked = typeof e == "string" ? !0 : !!e; }, indeterminate(e) { this.$refs.input && (this.$refs.input.indeterminate = e); } }, created() { this.m_checked = typeof this.checked == "string" ? !0 : !!this.checked; }, mounted() { (!this.$el.className || this.$el.className === "pretty") && (this.default_mode = !0), this._indeterminate && this.$refs.input && (this.$refs.input.indeterminate = !0), this.$el.setAttribute("p-checkbox", ""); }, methods: { updateInput(e) { this.$emit("update:indeterminate", !1); let t = e.target.checked; if (this.m_checked = t, this.modelValue instanceof Array) { let i = [...this.modelValue]; t ? i.push(this.value) : i.splice(i.indexOf(this.value), 1), this.$emit("update:modelValue", i), this.$emit("change", i); } else { const i = t ? this._trueValue ? this.trueValue : !0 : this._falseValue ? this.falseValue : !1; this.$emit("update:modelValue", i), this.$emit("change", i); } } } }, Ns = ["name", "value", "checked", "disabled", "required"]; function Vs(e, t, i, n, r, s) { return d(), p("div", { class: P(s.classes) }, [ k("input", { ref: "input", type: "checkbox", name: i.name, value: i.value, checked: s.shouldBeChecked, disabled: s._disabled, required: s._required, onChange: t[0] || (t[0] = (...l) => s.updateInput && s.updateInput(...l)) }, null, 40, Ns), k("div", { class: P(s.onClasses) }, [ O(e.$slots, "extra", {}, void 0, !0), k("label", null, [ O(e.$slots, "default", {}, void 0, !0) ]) ], 2), s._toggle ? (d(), p("div", { key: 0, class: P(s.offClasses) }, [ O(e.$slots, "off-extra", {}, void 0, !0), O(e.$slots, "off-label", {}, void 0, !0) ], 2)) : m("", !0), s._hover ? (d(), p("div", { key: 1, class: P(s.hoverClasses) }, [ O(e.$slots, "hover-extra", {}, void 0, !0), O(e.$slots, "hover-label", {}, void 0, !0) ], 2)) : m("", !0), s._indeterminate ? (d(), p("div", { key: 2, class: P(s.indeterminateClasses) }, [ O(e.$slots, "indeterminate-extra", {}, void 0, !0), O(e.$slots, "indeterminate-label", {}, void 0, !0) ], 2)) : m("", !0) ], 2); } const Bs = /* @__PURE__ */ Je(Us, [["render", Vs], ["__scopeId", "data-v-bc7c5ce1"]]), Ds = { name: "PrettyRadio", props: { name: { type: String, default: void 0 }, value: { type: [String, Number, Boolean, Object, Array], default: void 0 }, modelValue: { type: [String, Number, Boolean, Object, Array], default: void 0 }, checked: { type: [Boolean, String], default: void 0 }, disabled: { type: [Boolean, String], default: void 0 }, required: { type: [Boolean, String], default: void 0 }, color: { type: String, default: void 0 }, offColor: { type: String, default: void 0 }, hoverColor: { type: String, default: void 0 }, toggle: { type: [Boolean, String], default: void 0 }, hover: { type: [Boolean, String], default: void 0 }, focus: { type: [Boolean, String], default: void 0 } }, emits: ["update:model-value", "change"], data() { return { m_checked: void 0, default_mode: !1 }; }, computed: { shouldBeChecked() { return this.modelValue !== void 0 ? this.modelValue === this.value : this.m_checked === void 0 ? typeof this.checked == "string" ? !0 : !!this.checked : this.m_checked; }, _disabled() { return typeof this.disabled == "string" ? !0 : !!this.disabled; }, _required() { return typeof this.required == "string" ? !0 : !!this.required; }, _toggle() { return typeof this.toggle == "string" ? !0 : !!this.toggle; }, _hover() { return typeof this.hover == "string" ? !0 : !!this.hover; }, _focus() { return typeof this.focus == "string" ? !0 : !!this.focus; }, classes() { return { pretty: !0, "p-default": this.default_mode, "p-round": this.default_mode, "p-toggle": this._toggle, "p-has-hover": this._hover, "p-has-focus": this._focus }; }, onClasses() { let e = { state: !0, "p-on": this._toggle }; return this.color && (e[`p-${this.color}`] = !0), e; }, offClasses() { let e = { state: !0, "p-off": !0 }; return this.offColor && (e[`p-${this.offColor}`] = !0), e; }, hoverClasses() { let e = { state: !0, "p-is-hover": !0 }; return this.hoverColor && (e[`p-${this.hoverColor}`] = !0), e; } }, watch: { checked(e) { this.m_checked = e; } }, mounted() { (!this.$el.className || this.$el.className === "pretty") && (this.default_mode = !0), this.m_checked === void 0 && this.checked !== void 0 && (this.m_checked = typeof this.checked == "string" ? !0 : !!this.checked), this.$el.setAttribute("p-radio", ""); }, methods: { updateInput() { console.log("radio changed", this.value), this.$emit("update:model-value", this.value), this.$emit("change", this.value); } } }, Ms = ["name", "value", "checked", "disabled", "required"]; function Hs(e, t, i, n, r, s) { return d(), p("div", { class: P(s.classes) }, [ k("input", { ref: "input", type: "radio", name: i.name, value: i.value, checked: s.shouldBeChecked, disabled: s._disabled, required: s._required, onChange: t[0] || (t[0] = (...l) => s.updateInput && s.updateInput(...l)) }, null, 40, Ms), k("div", { class: P(s.onClasses) }, [ O(e.$slots, "extra"), k("label", null, [ O(e.$slots, "default") ]) ], 2), s._toggle ? (d(), p("div", { key: 0, class: P(s.offClasses) }, [ O(e.$slots, "off-extra"), O(e.$slots, "off-label") ], 2)) : m("", !0), s._hover ? (d(), p("div", { key: 1, class: P(s.hoverClasses) }, [ O(e.$slots, "hover-extra"), O(e.$slots, "hover-label") ], 2)) : m("", !0) ], 2); } const Is = /* @__PURE__ */ Je(Ds, [["render", Hs]]); function Gs(e) { e.component("QuintablePCheck", Bs), e.component("QuintablePRadio", Is), e.component("QuintableVSelect", qs); } function zs(e) { e.use(At, { themes: { tooltip: { $extend: "dropdown", // inherit default styles triggers: ["hover", "focus"], delay: { show: 200, hide: 200 }, popperOptions: { modifiers: [ { name: "offset", options: { offset: [0, 6] } } ] }, contentClass: "quintable-tooltip" } } }); } function Tt(e, t) { return function() { return e.apply(t, arguments); }; } const { toString: Js } = Object.prototype, { getPrototypeOf: Ke } = Object, { iterator: be, toStringTag: qt } = Symbol, ye = /* @__PURE__ */ ((e) => (t) => { const i = Js.call(t); return e[i] || (e[i] = i.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)), D = (e) => (e = e.toLowerCase(), (t) => ye(t) === e), Se = (e) => (t) => typeof t === e, { isArray: ee } = Array, le = Se("undefined"); function Ks(e) { return e !== null && !le(e) && e.constructor !== null && !le(e.constructor) && U(e.constructor.isBuffer) && e.constructor.isBuffer(e); } const jt = D("ArrayBuffer"); function Ws(e) { let t; return typeof ArrayBuffer != "undefined" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && jt(e.buffer), t; } const Qs = Se("string"), U = Se("function"), Lt = Se("number"), ke = (e) => e !== null && typeof e == "object", Xs = (e) => e === !0 || e === !1, fe = (e) => { if (ye(e) !== "object") return !1; const t = Ke(e); return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(qt in e) && !(be in e); }, Zs = D("Date"), Ys = D("File"), $s = D("Blob"), ei = D("FileList"), ti = (e) => ke(e) && U(e.pipe), si = (e) => { let t; return e && (typeof FormData == "function" && e instanceof FormData || U(e.append) && ((t = ye(e)) === "formdata" || // detect form-data instance t === "object" && U(e.toString) && e.toString() === "[object FormData]")); }, ii = D("URLSearchParams"), [ni, ri, li, oi] = ["ReadableStream", "Request", "Response", "Headers"].map(D), ai = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function oe(e, t, { allOwnKeys: i = !1 } = {}) { if (e === null || typeof e == "undefined") return; let n, r; if (typeof e != "object" && (e = [e]), ee(e)) for (n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e); else { const s = i ? Object.getOwnPropertyNames(e) : Object.keys(e), l = s.length; let c; for (n = 0; n < l; n++) c = s[n], t.call(null, e[c], c, e); } } function Ut(e, t) { t = t.toLowerCase(); const i = Object.keys(e); let n = i.length, r; for (; n-- > 0; ) if (r = i[n], t === r.toLowerCase()) return r; return null; } const K = typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : global, Nt = (e) => !le(e) && e !== K; function De() { const { caseless: e } = Nt(this) && this || {}, t = {}, i = (n, r) => { const s = e && Ut(t, r) || r; fe(t[s]) && fe(n) ? t[s] = De(t[s], n) : fe(n) ? t[s] = De({}, n) : ee(n) ? t[s] = n.slice() : t[s] = n; }; for (let n = 0, r = arguments.length; n < r; n++) arguments[n] && oe(arguments[n], i); return t; } const ci = (e, t, i, { allOwnKeys: n } = {}) => (oe(t, (r, s) => { i && U(r) ? e[s] = Tt(r, i) : e[s] = r; }, { allOwnKeys: n }), e), ui = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), hi = (e, t, i, n) => { e.prototype = Object.create(t.prototype, n), e.prototype.constructor = e, Object.defineProperty(e, "super", { value: t.prototype }), i && Object.assign(e.prototype, i); }, di = (e, t, i, n) => { let r, s, l; const c = {}; if (t = t || {}, e == null) return t; do { for (r = Object.getOwnPropertyNames(e), s = r.length; s-- > 0; ) l = r[s], (!n || n(l, e, t)) && !c[l] && (t[l] = e[l], c[l] = !0); e = i !== !1 && Ke(e); } while (e && (!i || i(e, t)) && e !== Object.prototype); return t; }, fi = (e, t, i) => { e = String(e), (i === void 0 || i > e.length) && (i = e.length), i -= t.length; const n = e.indexOf(t, i); return n !== -1 && n === i; }, gi = (e) => { if (!e) return null; if (ee(e)) return e; let t = e.length; if (!Lt(t)) return null; const i = new Array(t); for (; t-- > 0; ) i[t] = e[t]; return i; }, pi = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array != "undefined" && Ke(Uint8Array)), mi = (e, t) => { const n = (e && e[be]).call(e); let r; for (; (r = n.next()) && !r.done; ) { const s = r.value; t.call(e, s[0], s[1]); } }, wi = (e, t) => { let i; const n = []; for (; (i = e.exec(t)) !== null; ) n.push(i); return n; }, bi = D("HTMLFormElement"), yi = (e) => e.toLowerCase().replace( /[-_\s]([a-z\d])(\w*)/g, function(i, n, r) { return n.toUpperCase() + r; } ), bt = (({ hasOwnProperty: e }) => (t, i) => e.call(t, i))(Object.prototype), Si = D("RegExp"), Vt = (e, t) => { const i = Object.getOwnPropertyDescriptors(e), n = {}; oe(i, (r, s) => { let l; (l = t(r, s, e)) !== !1 && (n[s] = l || r); }), Object.defineProperties(e, n); }, ki = (e) => { Vt(e, (t, i) => { if (U(e) && ["arguments", "caller", "callee"].indexOf(i) !== -1) return !1; const n = e[i]; if (U(n)) { if (t.enumerable = !1, "writable" in t) { t.writable = !1; return; } t.set || (t.set = () => { throw Error("Can not rewrite read-only method '" + i + "'"); }); } }); }, Fi = (e, t) => { const i = {}, n = (r) => { r.forEach((s) => { i[s] = !0; }); }; return ee(e) ? n(e) : n(String(e).split(t)), i; }, Ri = () => { }, Ci = (e, t) => e != null && Number.isFinite(e = +e) ? e : t; function xi(e) { return !!(e && U(e.append) && e[qt] === "FormData" && e[be]); } const Pi = (e) => { const t = new Array(10), i = (n, r) => { if (ke(n)) { if (t.indexOf(n) >= 0) return; if (!("toJSON" in n)) { t[r] = n; const s = ee(n) ? [] : {}; return oe(n, (l, c) => { const g = i(l, r + 1); !le(g) && (s[c] = g); }), t[r] = void 0, s; } } return n; }; return i(e, 0); }, vi = D("AsyncFunction"), Oi = (e) => e && (ke(e) || U(e)) && U(e.then) && U(e.catch), Bt = ((e, t) => e ? setImmediate : t ? ((i, n) => (K.addEventListener("message", ({ source: r, data: s }) => { r === K && s === i && n.length && n.shift()(); }, !1), (r) => { n.push(r), K.postMessage(i, "*"); }))(`axios@${Math.random()}`, []) : (i) => setTimeout(i))( typeof setImmediate == "function", U(K.postMessage) ), _i = typeof queueMicrotask != "undefined" ? queueMicrotask.bind(K) : typeof process != "undefined" && process.nextTick || Bt, Ei = (e) => e != null && U(e[be]), h = { isArray: ee, isArrayBuffer: jt, isBuffer: Ks, isFormData: si, isArrayBufferView: Ws, isString: Qs, isNumber: Lt, isBoolean: Xs, isObject: ke, isPlainObject: fe, isReadableStream: ni, isRequest: ri, isResponse: li, isHeaders: oi, isUndefined: le, isDate: Zs, isFile: Ys, isBlob: $s, isRegExp: Si, isFunction: U, isStream: ti, isURLSearchParams: ii, isTypedArray: pi, isFileList: ei, forEach: oe, merge: De, extend: ci, trim: ai, stripBOM: ui, inherits: hi, toFlatObject: di, kindOf: ye, kindOfTest: D, endsWith: fi, toArray: gi, forEachEntry: mi, matchAll: wi, isHTMLForm: bi, hasOwnProperty: bt, hasOwnProp: bt, // an alias to avoid ESLint no-prototype-builtins detection reduceDescriptors: Vt, freezeMethods: ki, toObjectSet: Fi, toCamelCase: yi, noop: Ri, toFiniteNumber: Ci, findKey: Ut, global: K, isContextDefined: Nt, isSpecCompliantForm: xi, toJSONObject: Pi, isAsyncFn: vi, isThenable: Oi, setImmediate: Bt, asap: _i, isIterable: Ei }; function C(e, t, i, n, r) { 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), i && (this.config = i), n && (this.request = n), r && (this.response = r, this.status = r.status ? r.status : null); } h.inherits(C, 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: h.toJSONObject(this.config), code: this.code, status: this.status }; } }); const Dt = C.prototype, Mt = {}; [ "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) => { Mt[e] = { value: e }; }); Object.defineProperties(C, Mt); Object.defineProperty(Dt, "isAxiosError", { value: !0 }); C.from = (e, t, i, n, r, s) => { const l = Object.create(Dt); return h.toFlatObject(e, l, function(g) { return g !== Error.prototype; }, (c) => c !== "isAxiosError"), C.call(l, e.message, t, i, n, r), l.cause = e, l.name = e.name, s && Object.assign(l, s), l; }; const Ai = null; function Me(e) { return h.isPlainObject(e) || h.isArray(e); } function Ht(e) { return h.endsWith(e, "[]") ? e.slice(0, -2) : e; } function yt(e, t, i) { return e ? e.concat(t).map(function(r, s) { return r = Ht(r), !i && s ? "[" + r + "]" : r; }).join(i ? "." : "") : t; } function Ti(e) { return h.isArray(e) && !e.some(Me); } const qi = h.toFlatObject(h, {}, null, function(t) { return /^is[A-Z]/.test(t); }); function Fe(e, t, i) { if (!h.isObject(e)) throw new TypeError("target must be an object"); t = t || new FormData(), i = h.toFlatObject(i, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(S, w) { return !h.isUndefined(w[S]); }); const n = i.metaTokens, r = i.visitor || o, s = i.dots, l = i.indexes, g = (i.Blob || typeof Blob != "undefined" && Blob) && h.isSpecCompliantForm(t); if (!h.isFunction(r)) throw new TypeError("visitor must be a function"); function u(y) { if (y === null) return ""; if (h.isDate(y)) return y.toISOString(); if (!g && h.isBlob(y)) throw new C("Blob is not supported. Use a Buffer instead."); return h.isArrayBuffer(y) || h.isTypedArray(y) ? g && typeof Blob == "function" ? new Blob([y]) : Buffer.from(y) : y; } function o(y, S, w) { let v = y; if (y && !w && typeof y == "object") { if (h.endsWith(S, "{}")) S = n ? S : S.slice(0, -2), y = JSON.stringify(y); else if (h.isArray(y) && Ti(y) || (h.isFileList(y) || h.endsWith(S, "[]")) && (v = h.toArray(y))) return S = Ht(S), v.forEach(function(x, V) { !(h.isUndefined(x) || x === null) && t.append( // eslint-disable-next-line no-nested-ternary l === !0 ? yt([S], V, s) : l === null ? S : S + "[]", u(x) ); }), !1; } return Me(y) ? !0 : (t.append(yt(w, S, s), u(y)), !1); } const a = [], f = Object.assign(qi, { defaultVisitor: o, convertValue: u, isVisitable: Me }); function b(y, S) { if (!h.isUndefined(y)) { if (a.indexOf(y) !== -1) throw Error("Circular reference detected in " + S.join(".")); a.push(y), h.forEach(y, function(v, R) { (!(h.isUndefined(v) || v === null) && r.call( t, v, h.isString(R) ? R.trim() : R, S, f )) === !0 && b(v, S ? S.concat(R) : [R]); }), a.pop(); } } if (!h.isObject(e)) throw new TypeError("data must be an object"); return b(e), t; } function St(e) { const t = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) { return t[n]; }); } function We(e, t) { this._pairs = [], e && Fe(e, this, t); } const It = We.prototype; It.append = function(t, i) { this._pairs.push([t, i]); }; It.toString = function(t) { const i = t ? function(n) { return t.call(this, n, St); } : St; return this._pairs.map(function(r) { return i(r[0]) + "=" + i(r[1]); }, "").join("&"); }; function ji(e) { return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function Gt(e, t, i) { if (!t) return e; const n = i && i.encode || ji; h.isFunction(i) && (i = { serialize: i }); const r = i && i.serialize; let s; if (r ? s = r(t, i) : s = h.isURLSearchParams(t) ? t.toString() : new We(t, i).toString(n), s) { const l = e.indexOf("#"); l !== -1 && (e = e.slice(0, l)), e += (e.indexOf("?") === -1 ? "?" : "&") + s; } return e; } class kt { 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, i, n) { return this.handlers.push({ fulfilled: t, rejected: i, synchronous: n ? n.synchronous : !1, runWhen: n ? n.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) { h.forEach(this.handlers, function(n) { n !== null && t(n); }); } } const zt = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Li = typeof URLSearchParams != "undefined" ? URLSearchParams : We, Ui = typeof FormData != "undefined" ? FormData : null, Ni = typeof Blob != "undefined" ? Blob : null, Vi = { isBrowser: !0, classes: { URLSearchParams: Li, FormData: Ui, Blob: Ni }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Qe = typeof window != "undefined" && typeof document != "undefined", He = typeof navigator == "object" && navigator || void 0, Bi = Qe && (!He || ["ReactNative", "NativeScript", "NS"].indexOf(He.product) < 0), Di = typeof WorkerGlobalScope != "undefined" && // eslint-disable-next-line no-undef self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Mi = Qe && window.location.href || "http://localhost", Hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, hasBrowserEnv: Qe, hasStandardBrowserEnv: Bi, hasStandardBrowserWebWorkerEnv: Di, navigator: He, origin: Mi }, Symbol.toStringTag, { value: "Module" })), q = ne(ne({}, Hi), Vi); function Ii(e, t) { return Fe(e, new q.classes.URLSearchParams(), Object.assign({ visitor: function(i, n, r, s) { return q.isNode && h.isBuffer(i) ? (this.append(n, i.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments); } }, t)); } function Gi(e) { return h.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]); } function zi(e) { const t = {}, i = Object.keys(e); let n; const r = i.length; let s; for (n = 0; n < r; n++) s = i[n], t[s] = e[s]; return t; } function Jt(e) { function t(i, n, r, s) { let l = i[s++]; if (l === "__proto__") return !0; const c = Number.isFinite(+l), g = s >= i.length; return l = !l && h.isArray(r) ? r.length : l, g ? (h.hasOwnProp(r, l) ? r[l] = [r[l], n] : r[l] = n, !c) : ((!r[l] || !h.isObject(r[l])) && (r[l] = []), t(i, n, r[l], s) && h.isArray(r[l]) && (r[l] = zi(r[l])), !c); } if (h.isFormData(e) && h.isFunction(e.entries)) { const i = {}; return h.forEachEntry(e, (n, r) => { t(Gi(n), r, i, 0); }), i; } return null; } function Ji(e, t, i) { if (h.isString(e)) try { return (t || JSON.parse)(e), h.trim(e); } catch (n) { if (n.name !== "SyntaxError") throw n; } return (i || JSON.stringify)(e); } const ae = { transitional: zt, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, i) { const n = i.getContentType() || "", r = n.indexOf("application/json") > -1, s = h.isObject(t); if (s && h.isHTMLForm(t) && (t = new FormData(t)), h.isFormData(t)) return r ? JSON.stringify(Jt(t)) : t; if (h.isArrayBuffer(t) || h.isBuffer(t) || h.isStream(t) || h.isFile(t) || h.isBlob(t) || h.isReadableStream(t)) return t; if (h.isArrayBufferView(t)) return t.buffer; if (h.isURLSearchParams(t)) return i.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString(); let c; if (s) { if (n.indexOf("application/x-www-form-urlencoded") > -1) return Ii(t, this.formSerializer).toString(); if ((c = h.isFileList(t)) || n.indexOf("multipart/form-data") > -1) { const g = this.env && this.env.FormData; return Fe( c ? { "files[]": t } : t, g && new g(), this.formSerializer ); } } return s || r ? (i.setContentType("application/json", !1), Ji(t)) : t; }], transformResponse: [function(t) { const i = this.transitional || ae.transitional, n = i && i.forcedJSONParsing, r = this.responseType === "json"; if (h.isResponse(t) || h.isReadableStream(t)) return t; if (t && h.isString(t) && (n && !this.responseType || r)) { const l = !(i && i.silentJSONParsing) && r; try { return JSON.parse(t); } catch (c) { if (l) throw c.name === "SyntaxError" ? C.from(c, C.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: q.classes.FormData, Blob: q.classes.Blob }, validateStatus: function(t) { return t >= 200 && t < 300; }, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; h.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => { ae.headers[e] = {}; }); const Ki = h.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" ]), Wi = (e) => { const t = {}; let i, n, r; return e && e.split(` `).forEach(function(l) { r = l.indexOf(":"), i = l.substring(0, r).trim().toLowerCase(), n = l.substring(r + 1).trim(), !(!i || t[i] && Ki[i]) && (i === "set-cookie" ? t[i] ? t[i].push(n) : t[i] = [n] : t[i] = t[i] ? t[i] + ", " + n : n); }), t; }, Ft = Symbol("internals"); function re(e) { return e && String(e).trim().toLowerCase(); } function ge(e) { return e === !1 || e == null ? e : h.isArray(e) ? e.map(ge) : String(e); } function Qi(e) { const t = /* @__PURE__ */ Object.create(null), i = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; let n; for (; n = i.exec(e); ) t[n[1]] = n[2]; return t; } const Xi = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()); function Ne(e, t, i, n, r) { if (h.isFunction(n)) return n.call(this, t, i); if (r && (t = i), !!h.isString(t)) { if (h.isString(n)) return t.indexOf(n) !== -1; if (h.isRegExp(n)) return n.test(t); } } function Zi(e) { return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, i, n) => i.toUpperCase() + n); } function Yi(e, t) { const i = h.toCamelCase(" " + t); ["get", "set", "has"].forEach((n) => { Object.defineProperty(e, n + i, { value: function(r, s, l) { return this[n].call(this, t, r, s, l); }, configurable: !0 }); }); } let N = class { constructor(t) { t && this.set(t); } set(t, i, n) { const r = this; function s(c, g, u) { const o = re(g); if (!o) throw new Error("header name must be a non-empty string"); const a = h.findKey(r, o); (!a || r[a] === void 0 || u === !0 || u === void 0 && r[a] !== !1) && (r[a || g] = ge(c)); } const l = (c, g) => h.forEach(c, (u, o) => s(u, o, g)); if (h.isPlainObject(t) || t instanceof this.constructor) l(t, i); else if (h.isString(t) && (t = t.trim()) && !Xi(t)) l(Wi(t), i); else if (h.isObject(t) && h.isIterable(t)) { let c = {}, g, u; for (const o of t) { if (!h.isArray(o)) throw TypeError("Object iterator must return a key-value pair"); c[u = o[0]] = (g = c[u]) ? h.isArray(g) ? [...g, o[1]] : [g, o[1]] : o[1]; } l(c, i); } else t != null && s(i, t, n); return this; } get(t, i) { if (t = re(t), t) { const n = h.findKey(this, t); if (n) { const r = this[n]; if (!i) return r; if (i === !0) return Qi(r); if (h.isFunction(i)) return i.call(this, r, n); if (h.isRegExp(i)) return i.exec(r); throw new TypeError("parser must be boolean|regexp|function"); } } } has(t, i) { if (t = re(t), t) { const n = h.findKey(this, t); return !!(n && this[n] !== void 0 && (!i || Ne(this, this[n], n, i))); } return !1; } delete(t, i) { const n = this; let r = !1; function s(l) { if (l = re(l), l) { const c = h.findKey(n, l); c && (!i || Ne(n, n[c], c, i)) && (delete n[c], r = !0); } } return h.isArray(t) ? t.forEach(s) : s(t), r; } clear(t) { const i = Object.keys(this); let n = i.length, r = !1; for (; n--; ) { const s = i[n]; (!t || Ne(this, this[s], s, t, !0)) && (delete this[s], r = !0); } return r; } normalize(t) { const i = this, n = {}; return h.forEach(this, (r, s) => { const l = h.findKey(n, s); if (l) { i[l] = ge(r), delete i[s]; return; } const c = t ? Zi(s) : String(s).trim(); c !== s && delete i[s], i[c] = ge(r), n[c] = !0; }), this; } concat(...t) { return this.constructor.concat(this, ...t); } toJSON(t) { const i = /* @__PURE__ */ Object.create(null); return h.forEach(this, (n, r) => { n != null && n !== !1 && (i[r] = t && h.isArray(n) ? n.join(", ") : n); }), i; } [Symbol.iterator]() { return Object.entries(this.toJSON())[Symbol.iterator](); } toString() { return Object.entries(this.toJSON()).map(([t, i]) => t + ": " + i).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, ...i) { const n = new this(t); return i.forEach((r) => n.set(r)), n; } static accessor(t) { const n = (this[Ft] = this[Ft] = { accessors: {} }).accessors, r = this.prototype; function s(l) { const c = re(l); n[c] || (Yi(r, l), n[c] = !0); } return h.isArray(t) ? t.forEach(s) : s(t), this; } }; N.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]); h.reduceDescriptors(N.prototype, ({ value: e }, t) => { let i = t[0].toUpperCase() + t.slice(1); return { get: () => e, set(n) { this[i] = n; } }; }); h.freezeMethods(N); function Ve(e, t) { const i = this || ae, n = t || i, r = N.from(n.headers); let s = n.data; return h.forEach(e, function(c) { s = c.call(i, s, r.normalize(), t ? t.status : void 0); }), r.normalize(), s; } function Kt(e) { return !!(e && e.__CANCEL__); } function te(e, t, i) { C.call(this, e == null ? "canceled" : e, C.ERR_CANCELED, t, i), this.name = "CanceledError"; } h.inherits(te, C, { __CANCEL__: !0 }); function Wt(e, t, i) { const n = i.config.validateStatus; !i.status || !n || n(i.status) ? e(i) : t(new C( "Request failed with status code " + i.status, [C.ERR_BAD_REQUEST, C.ERR_BAD_RESPONSE][Math.floor(i.status / 100) - 4], i.config, i.request, i )); } function $i(e) { const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e); return t && t[1] || ""; } function en(e, t) { e = e || 10; const i = new Array(e), n = new Array(e); let r = 0, s = 0, l; return t = t !== void 0 ? t : 1e3, function(g) { const u = Date.now(), o = n[s]; l || (l = u), i[r] = g, n[r] = u; let a = s, f = 0; for (; a !== r; ) f += i[a++], a = a % e; if (r = (r + 1) % e, r === s && (s = (s + 1) % e), u - l < t) return; const b = o && u - o; return b ? Math.round(f * 1e3 / b) : void 0; }; } function tn(e, t) { let i = 0, n = 1e3 / t, r, s; const l = (u, o = Date.now()) => { i = o, r = null, s && (clearTimeout(s), s = null), e.apply(null, u); }; return [(...u) => { const o = Date.now(), a = o - i; a >= n ? l(u, o) : (r = u, s || (s = setTimeout(() => { s = null, l(r); }, n - a))); }, () => r && l(r)]; } const me = (e, t, i = 3) => { let n = 0; const r = en(50, 250); return tn((s) => { const l = s.loaded, c = s.lengthComputable ? s.total : void 0, g = l - n, u = r(g), o = l <= c; n = l; const a = { loaded: l, total: c, progress: c ? l / c : void 0, bytes: g, rate: u || void 0, estimated: u && c && o ? (c - l) / u : void 0, event: s, lengthComputable: c != null, [t ? "download" : "upload"]: !0 }; e(a); }, i); }, Rt = (e, t) => { const i = e != null; return [(n) => t[0]({ lengthComputable: i, total: e, loaded: n }), t[1]]; }, Ct = (e) => (...t) => h.asap(() => e(...t)), sn = q.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (i) => (i = new URL(i, q.origin), e.protocol === i.protocol && e.host === i.host && (t || e.port === i.port)))( new URL(q.origin), q.navigator && /(msie|trident)/i.test(q.navigator.userAgent) ) : () => !0, nn = q.hasStandardBrowserEnv ? ( // Standard browser envs support document.cookie { write(e, t, i, n, r, s) { const l = [e + "=" + encodeURIComponent(t)]; h.isNumber(i) && l.push("expires=" + new Date(i).toGMTString()), h.isString(n) && l.push("path=" + n), h.isString(r) && l.push("domain=" + r), s === !0 && l.push("secure"), document.cookie = l.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 rn(e) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e); } function ln(e, t) { return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e; } function Qt(e, t, i) { let n = !rn(t); return e && (n || i == !1) ? ln(e, t) : t; } const xt = (e) => e instanceof N ? ne({}, e) : e; function Q(e, t) { t = t || {}; const i = {}; function n(u, o, a, f) { return h.isPlainObject(u) && h.isPlainObject(o) ? h.merge.call({ caseless: f }, u, o) : h.isPlainObject(o) ? h.merge({}, o) : h.isArray(o) ? o.slice() : o; } function r(u, o, a, f) { if (h.isUndefined(o)) { if (!h.isUndefined(u)) return n(void 0, u, a, f); } else return n(u, o, a, f); } function s(u, o) { if (!h.isUndefined(o)) return n(void 0, o); } function l(u, o) { if (h.isUndefined(o)) { if (!h.isUndefined(u)) return n(void 0, u); } else return n(void 0, o); } function c(u, o, a) { if (a in t) return n(u, o); if (a in e) return n(void 0, u); } const g = { url: s, method: s, data: s, baseURL: l, transformRequest: l, transformResponse: l, paramsSerializer: l, timeout: l, timeoutMessage: l, withCredentials: l, withXSRFToken: l, adapter: l, responseType: l, xsrfCookieName: l, xsrfHeaderName: l, onUploadProgress: l, onDownloadProgress: l, decompress: l, maxContentLength: l, maxBodyLength: l, beforeRedirect: l, transport: l, httpAgent: l, httpsAgent: l, cancelToken: l, socketPath: l, responseEncoding: l, validateStatus: c, headers: (u, o, a) => r(xt(u), xt(o), a, !0) }; return h.forEach(Object.keys(Object.assign({}, e, t)), function(o) { const a = g[o] || r, f = a(e[o], t[o], o); h.isUndefined(f) && a !== c || (i[o] = f); }), i; } const Xt = (e) => { const t = Q({}, e); let { data: i, withXSRFToken: n, xsrfHeaderName: r, xsrfCookieName: s, headers: l, auth: c } = t; t.headers = l = N.from(l), t.url = Gt(Qt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), c && l.set( "Authorization", "Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : "")) ); let g; if (h.isFormData(i)) { if (q.hasStandardBrowserEnv || q.hasStandardBrowserWebWorkerEnv) l.setContentType(void 0); else if ((g = l.getContentType()) !== !1) { const [u, ...o] = g ? g.split(";").map((a) => a.trim()).filter(Boolean) : []; l.setContentType([u || "multipart/form-data", ...o].join("; ")); } } if (q.hasStandardBrowserEnv && (n && h.isFunction(n) && (n = n(t)), n || n !== !1 && sn(t.url))) { const u = r && s && nn.read(s); u && l.set(r, u); } return t; }, on = typeof XMLHttpRequest != "undefined", an = on && function(e) { return new Promise(function(i, n) { const r = Xt(e); let s = r.data; const l = N.from(r.headers).normalize(); let { responseType: c, onUploadProgress: g, onDownloadProgress: u } = r, o, a, f, b, y; function S() { b && b(), y && y(), r.cancelToken && r.cancelToken.unsubscribe(o), r.signal && r.signal.removeEventListener("abort", o); } let w = new XMLHttpRequest(); w.open(r.method.toUpperCase(), r.url, !0), w.timeout = r.timeout; function v() { if (!w) return; const x = N.from( "getAllResponseHeaders" in w && w.getAllResponseHeaders() ), A = { data: !c || c === "text" || c === "json" ? w.responseText : w.response, status: w.status, statusText: w.statusText, headers: x, config: e, request: w }; Wt(function(M) { i(M), S(); }, function(M) { n(M), S(); }, A), w = null; } "onloadend" in w ? w.onloadend = v : w.onreadystatechange = function() { !w || w.readyState !== 4 || w.status === 0 && !(w.responseURL && w.responseURL.indexOf("file:") === 0) || setTimeout(v); }, w.onabort = function() { w && (n(new C("Request aborted", C.ECONNABORTED, e, w)), w = null); }, w.onerror = function() { n(new C("Network Error", C.ERR_NETWORK, e, w)), w = null; }, w.ontimeout = function() { let V = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded"; const A = r.transitional || zt; r.timeoutErrorMessage && (V = r.timeoutErrorMessage), n(new C( V, A.clarifyTimeoutError ? C.ETIMEDOUT : C.ECONNABORTED, e, w )), w = null; }, s === void 0 && l.setContentType(null), "setRequestHeader" in w && h.forEach(l.toJSON(), function(V, A) { w.setRequestHeader(A, V); }), h.isUndefined(r.withCredentials) || (w.withCredentials = !!r.withCredentials), c && c !== "json" && (w.responseType = r.responseType), u && ([f, y] = me(u, !0), w.addEventListener("progress", f)), g && w.upload && ([a, b] = me(g), w.upload.addEventListener("progress", a), w.upload.addEventListener("loadend", b)), (r.cancelToken || r.signal) && (o = (x) => { w && (n(!x || x.type ? new te(null, e, w) : x), w.abort(), w = null); }, r.cancelToken && r.cancelToken.subscribe(o), r.signal && (r.signal.aborted ? o() : r.signal.addEventListener("abort", o))); const R = $i(r.url); if (R && q.protocols.indexOf(R) === -1) { n(new C("Unsupported protocol " + R + ":", C.ERR_BAD_REQUEST, e)); return; } w.send(s || null); }); }, cn = (e, t) => { const { length: i } = e = e ? e.filter(Boolean) : []; if (t || i) { let n = new AbortController(), r; const s = function(u) { if (!r) { r = !0, c(); const o = u instanceof Error ? u : this.reason; n.abort(o instanceof C ? o : new te(o instanceof Error ? o.message : o)); } }; let l = t && setTimeout(() => { l = null, s(new C(`timeout ${t} of ms exceeded`, C.ETIMEDOUT)); }, t); const c = () => { e && (l && clearTimeout(l), l = null, e.forEach((u) => { u.unsubscribe ? u.unsubscribe(s) : u.removeEventListener("abort", s); }), e = null); }; e.forEach((u) => u.addEventListener("abort", s)); const { signal: g } = n; return g.unsubscribe = () => h.asap(c), g; } }, un = function* (e, t) { let i = e.byteLength; if (i < t) { yield e; return; } let n = 0, r; for (; n < i; ) r = n + t, yield e.slice(n, r), n = r; }, hn = function(e, t) { return Te(this, null, function* () { try { for (var i = gt(dn(e)), n, r, s; n = !(r = yield new J(i.next())).done; n = !1) { const l = r.value; yield* qe(un(l, t)); } } catch (r) { s = [r]; } finally { try { n && (r = i.return) && (yield new J(r.call(i))); } finally { if (s) throw s[0]; } } }); }, dn = function(e) { return Te(this, null, function* () { if (e[Symbol.asyncIterator]) { yield* qe(e); return; } const t = e.getReader(); try { for (; ; ) { const { done: i, value: n } = yield new J(t.read()); if (i) break; yield n; } } finally { yield new J(t.cancel()); } }); }, Pt = (e, t, i, n) => { const r = hn(e, t); let s = 0, l, c = (u) => { l || (l = !0, n && n(u)); }; return new ReadableStream({ pull(u) { return z(this, null, function* () { try { const { done: o, value: a } = yield r.next(); if (o) { c(), u.close(); return; } let f = a.byteLength; if (i) { let b = s += f; i(b); } u.enqueue(new Uint8Array(a)); } catch (o) { throw c(o), o; } }); }, cancel(u) { return c(u), r.return(); } }, { highWaterMark: 2 }); }, Re = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Zt = Re && typeof ReadableStream == "function", fn = Re && (typeof TextEncoder == "function" ? /* @