vue-dadata
Version:
Vue component for hinting addresses using dadata.ru
1,755 lines • 70.7 kB
JavaScript
import { defineComponent as $e, h as v, Comment as Et, computed as U, ref as M, watch as gt, resolveComponent as mt, createElementBlock as le, openBlock as X, normalizeClass as G, createElementVNode as Be, createCommentVNode as yt, withDirectives as bt, withKeys as Y, vModelText as At, renderSlot as Ft, Fragment as Ct, renderList as St, createBlock as wt, mergeProps as Dt } from "vue";
function Bt(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var $ = {}, Te;
function Tt() {
if (Te) return $;
Te = 1, $.remove = u;
for (var e = [
{
base: " ",
chars: " "
},
{
base: "0",
chars: "߀"
},
{
base: "A",
chars: "ⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"
},
{
base: "AA",
chars: "Ꜳ"
},
{
base: "AE",
chars: "ÆǼǢ"
},
{
base: "AO",
chars: "Ꜵ"
},
{
base: "AU",
chars: "Ꜷ"
},
{
base: "AV",
chars: "ꜸꜺ"
},
{
base: "AY",
chars: "Ꜽ"
},
{
base: "B",
chars: "ⒷBḂḄḆɃƁ"
},
{
base: "C",
chars: "ⒸCꜾḈĆCĈĊČÇƇȻ"
},
{
base: "D",
chars: "ⒹDḊĎḌḐḒḎĐƊƉᴅꝹ"
},
{
base: "Dh",
chars: "Ð"
},
{
base: "DZ",
chars: "DZDŽ"
},
{
base: "Dz",
chars: "DzDž"
},
{
base: "E",
chars: "ɛⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎᴇ"
},
{
base: "F",
chars: "ꝼⒻFḞƑꝻ"
},
{
base: "G",
chars: "ⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾɢ"
},
{
base: "H",
chars: "ⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"
},
{
base: "I",
chars: "ⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"
},
{
base: "J",
chars: "ⒿJĴɈȷ"
},
{
base: "K",
chars: "ⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"
},
{
base: "L",
chars: "ⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"
},
{
base: "LJ",
chars: "LJ"
},
{
base: "Lj",
chars: "Lj"
},
{
base: "M",
chars: "ⓂMḾṀṂⱮƜϻ"
},
{
base: "N",
chars: "ꞤȠⓃNǸŃÑṄŇṆŅṊṈƝꞐᴎ"
},
{
base: "NJ",
chars: "NJ"
},
{
base: "Nj",
chars: "Nj"
},
{
base: "O",
chars: "ⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"
},
{
base: "OE",
chars: "Œ"
},
{
base: "OI",
chars: "Ƣ"
},
{
base: "OO",
chars: "Ꝏ"
},
{
base: "OU",
chars: "Ȣ"
},
{
base: "P",
chars: "ⓅPṔṖƤⱣꝐꝒꝔ"
},
{
base: "Q",
chars: "ⓆQꝖꝘɊ"
},
{
base: "R",
chars: "ⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"
},
{
base: "S",
chars: "ⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"
},
{
base: "T",
chars: "ⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"
},
{
base: "Th",
chars: "Þ"
},
{
base: "TZ",
chars: "Ꜩ"
},
{
base: "U",
chars: "ⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"
},
{
base: "V",
chars: "ⓋVṼṾƲꝞɅ"
},
{
base: "VY",
chars: "Ꝡ"
},
{
base: "W",
chars: "ⓌWẀẂŴẆẄẈⱲ"
},
{
base: "X",
chars: "ⓍXẊẌ"
},
{
base: "Y",
chars: "ⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"
},
{
base: "Z",
chars: "ⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"
},
{
base: "a",
chars: "ⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐɑ"
},
{
base: "aa",
chars: "ꜳ"
},
{
base: "ae",
chars: "æǽǣ"
},
{
base: "ao",
chars: "ꜵ"
},
{
base: "au",
chars: "ꜷ"
},
{
base: "av",
chars: "ꜹꜻ"
},
{
base: "ay",
chars: "ꜽ"
},
{
base: "b",
chars: "ⓑbḃḅḇƀƃɓƂ"
},
{
base: "c",
chars: "cⓒćĉċčçḉƈȼꜿↄ"
},
{
base: "d",
chars: "ⓓdḋďḍḑḓḏđƌɖɗƋᏧԁꞪ"
},
{
base: "dh",
chars: "ð"
},
{
base: "dz",
chars: "dzdž"
},
{
base: "e",
chars: "ⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇǝ"
},
{
base: "f",
chars: "ⓕfḟƒ"
},
{
base: "ff",
chars: "ff"
},
{
base: "fi",
chars: "fi"
},
{
base: "fl",
chars: "fl"
},
{
base: "ffi",
chars: "ffi"
},
{
base: "ffl",
chars: "ffl"
},
{
base: "g",
chars: "ⓖgǵĝḡğġǧģǥɠꞡꝿᵹ"
},
{
base: "h",
chars: "ⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"
},
{
base: "hv",
chars: "ƕ"
},
{
base: "i",
chars: "ⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"
},
{
base: "j",
chars: "ⓙjĵǰɉ"
},
{
base: "k",
chars: "ⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"
},
{
base: "l",
chars: "ⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇɭ"
},
{
base: "lj",
chars: "lj"
},
{
base: "m",
chars: "ⓜmḿṁṃɱɯ"
},
{
base: "n",
chars: "ⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥлԉ"
},
{
base: "nj",
chars: "nj"
},
{
base: "o",
chars: "ⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿꝋꝍɵɔᴑ"
},
{
base: "oe",
chars: "œ"
},
{
base: "oi",
chars: "ƣ"
},
{
base: "oo",
chars: "ꝏ"
},
{
base: "ou",
chars: "ȣ"
},
{
base: "p",
chars: "ⓟpṕṗƥᵽꝑꝓꝕρ"
},
{
base: "q",
chars: "ⓠqɋꝗꝙ"
},
{
base: "r",
chars: "ⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"
},
{
base: "s",
chars: "ⓢsśṥŝṡšṧṣṩșşȿꞩꞅẛʂ"
},
{
base: "ss",
chars: "ß"
},
{
base: "t",
chars: "ⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"
},
{
base: "th",
chars: "þ"
},
{
base: "tz",
chars: "ꜩ"
},
{
base: "u",
chars: "ⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"
},
{
base: "v",
chars: "ⓥvṽṿʋꝟʌ"
},
{
base: "vy",
chars: "ꝡ"
},
{
base: "w",
chars: "ⓦwẁẃŵẇẅẘẉⱳ"
},
{
base: "x",
chars: "ⓧxẋẍ"
},
{
base: "y",
chars: "ⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"
},
{
base: "z",
chars: "ⓩzźẑżžẓẕƶȥɀⱬꝣ"
}
], t = {}, n = 0; n < e.length; n += 1)
for (var s = e[n].chars, r = 0; r < s.length; r += 1)
t[s[r]] = e[n].base;
function u(o) {
return o.replace(/[^\u0000-\u007e]/g, function(a) {
return t[a] || a;
});
}
return $.replacementList = e, $.diacriticsMap = t, $;
}
var Rt = Tt();
const fe = /* @__PURE__ */ Bt(Rt), Re = (e) => e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), Ot = (e) => {
let t;
if (e.query instanceof RegExp) return new RegExp(String.raw`(${e.query.source})`, "g" + (e.caseSensitive ? "" : "i"));
const n = ((s) => {
if (s === "partial") return (r) => Re(r);
{
const r = String.raw`[\s/(\[{<'"|(『「\u3000]`, u = String.raw`[.,\s/)\]}>:;'"!?|)』」。、\u3000]`;
return (o) => String.raw`(?<=^|${r})${Re(o)}(?=$|${u})`;
}
})(e.matchMode);
if (e.splitBySpace) {
const s = e.query.trim().replace(/\s+/g, " ");
t = String.raw`(${s.split(/\s/).map(n).join("|")})`;
} else t = String.raw`(${n(e.query)})`;
return new RegExp(String.raw`${t}`, "g" + (e.caseSensitive ? "" : "i"));
}, de = (e, t, n = !1) => {
if (!t.query || t.query instanceof String && !t.query.trim()) return e;
let s = e, r = t.query, u = !1;
t.diacriticsSensitive || (s = fe.remove(s), r = t.query instanceof RegExp ? new RegExp(fe.remove(t.query.source)) : fe.remove(t.query), u = s !== e);
const o = Ot({ query: r, splitBySpace: t.splitBySpace, caseSensitive: t.caseSensitive, matchMode: t.matchMode }), a = s.split(o), f = u ? ((l, c) => {
const d = [];
return c.forEach((m) => {
const b = d.join("").length, h = b + m.length;
d.push(l.slice(b, h));
}), d;
})(e, a) : a;
return n ? a.map((l, c) => {
if (o.test(l)) {
const d = t.highlightClass ? ` class="${t.highlightClass}"` : "", m = t.highlightStyle ? ` style="${t.highlightStyle}"` : "";
return `<${t.highlightTag}${d}${m}>${f[c]}</${t.highlightTag}>`;
}
return f[c];
}).join("") : a.map((l, c) => o.test(l) ? v(t.highlightTag, { class: t.highlightClass, style: t.highlightStyle }, f[c]) : f[c]);
}, Oe = (e) => typeof e == "string" ? [] : e.filter((t) => typeof t != "string").map((t) => typeof t == "string" ? t : t.children);
var xt = $e({ name: "VueWordHighlighter", props: { query: { type: [String, RegExp], required: !0, default: "" }, caseSensitive: { type: Boolean, default: !1 }, diacriticsSensitive: { type: Boolean, default: !1 }, splitBySpace: { type: Boolean, default: !1 }, matchMode: { type: String, default: "partial" }, highlightClass: { type: [Object, String, Array], default: "" }, highlightStyle: { type: [Object, String, Array], default: "" }, highlightTag: { type: String, default: "mark" }, wrapperTag: { type: String, default: "span" }, wrapperClass: { type: [Object, String, Array], default: "" }, textToHighlight: { type: String, default: "" }, htmlToHighlight: { type: String, default: "" } }, emits: ["matches"], setup: (e, t) => () => {
if (e.htmlToHighlight) {
const n = `(<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>)`, s = e.htmlToHighlight.split(new RegExp(n, "gs")), r = s.map((u, o) => new RegExp(n).test(u) || o > 0 && s[o - 1].startsWith("<script") ? u : de(u, { query: e.query, splitBySpace: e.splitBySpace, caseSensitive: e.caseSensitive, diacriticsSensitive: e.diacriticsSensitive, matchMode: e.matchMode, highlightTag: e.highlightTag, highlightClass: e.highlightClass, highlightStyle: e.highlightStyle }, !0)).join("");
return v(e.wrapperTag, { class: e.wrapperClass, innerHTML: r });
}
if (e.textToHighlight) {
const n = de(e.textToHighlight, { query: e.query, splitBySpace: e.splitBySpace, caseSensitive: e.caseSensitive, diacriticsSensitive: e.diacriticsSensitive, matchMode: e.matchMode, highlightTag: e.highlightTag, highlightClass: e.highlightClass, highlightStyle: e.highlightStyle });
return t.emit("matches", Oe(n)), v(e.wrapperTag, { class: e.wrapperClass }, n);
}
if (t.slots && t.slots.default) {
const n = (r) => {
if (r.type === Et) return r;
if (typeof r.children == "string") {
const u = de(r.children, { query: e.query, splitBySpace: e.splitBySpace, caseSensitive: e.caseSensitive, diacriticsSensitive: e.diacriticsSensitive, matchMode: e.matchMode, highlightTag: e.highlightTag, highlightClass: e.highlightClass, highlightStyle: e.highlightStyle }), o = Oe(u);
return t.emit("matches", o), o.length === 0 ? r : typeof r.type == "string" ? v(r.type, { ...r.props }, [v(e.wrapperTag, { class: e.wrapperClass }, u)]) : v(e.wrapperTag, { class: e.wrapperClass }, u);
}
return v(r.type, { ...r.props }, Array.isArray(r.children) ? r.children.map((u) => n(u)) : []);
}, s = t.slots.default();
return Array.isArray(s) ? s.map((r) => n(r)) : s;
}
} }), I = /* @__PURE__ */ ((e) => (e.Enter = "enter", e.Esc = "esc", e.Up = "up", e.Down = "down", e))(I || {});
const Fs = {
COUNTRY: "country",
REGION: "region",
AREA: "area",
CITY: "city",
SETTLEMENT: "settlement",
STREET: "street",
HOUSE: "house",
FLAT: "flat"
}, L = {
container: "vue-dadata",
search: "vue-dadata__search",
input: "vue-dadata__input",
suggestions: "vue-dadata__suggestions",
suggestionItem: "vue-dadata__suggestions-item",
suggestionCurrentItem: "vue-dadata__suggestions-item_current"
}, P = {
caseSensitive: !1,
splitBySpace: !1,
highlightTag: "mark",
highlightClass: "vue-dadata__suggestion-item-text_highlight",
highlightStyle: "",
wrapperTag: "span",
wrapperClass: ""
}, Nt = (e) => U(() => ({
container: e?.container ?? L.container,
search: e?.search ?? L.search,
input: e?.input ?? L.input,
suggestions: e?.suggestions ?? L.suggestions,
suggestionItem: e?.suggestionItem ?? L.suggestionItem,
suggestionCurrentItem: e?.suggestionCurrentItem ?? L.suggestionCurrentItem
})), Pt = (e) => U(() => ({
caseSensitive: e?.caseSensitive ?? P.caseSensitive,
splitBySpace: e?.splitBySpace ?? P.splitBySpace,
highlightTag: e?.highlightTag ?? P.highlightTag,
highlightClass: e?.highlightClass ?? P.highlightClass,
highlightStyle: e?.highlightStyle ?? P.highlightStyle,
wrapperTag: e?.wrapperTag ?? P.wrapperTag,
wrapperClass: e?.wrapperClass ?? P.wrapperClass
}));
function vt(e) {
const [t, n = "ms"] = String(e).split(/(ms|s)/i), s = {
ms: 1,
s: 1e3
};
return Number(t) * s[n];
}
function Lt(e, t) {
let n = null;
const s = typeof t == "number" ? t : vt(t), r = function(...u) {
const o = () => {
n = null, e.apply(this, u);
};
clearTimeout(n), n = setTimeout(o, s), n || e.apply(this, u);
};
return r.cancel = () => {
clearTimeout(n), n = null;
}, r;
}
function Ve(e, t) {
return function() {
return e.apply(t, arguments);
};
}
const { toString: Ut } = Object.prototype, { getPrototypeOf: Ce } = Object, { iterator: se, toStringTag: ze } = Symbol, re = /* @__PURE__ */ ((e) => (t) => {
const n = Ut.call(t);
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), R = (e) => (e = e.toLowerCase(), (t) => re(t) === e), ue = (e) => (t) => typeof t === e, { isArray: _ } = Array, z = ue("undefined");
function qt(e) {
return e !== null && !z(e) && e.constructor !== null && !z(e.constructor) && B(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const Je = R("ArrayBuffer");
function kt(e) {
let t;
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Je(e.buffer), t;
}
const jt = ue("string"), B = ue("function"), Ke = ue("number"), oe = (e) => e !== null && typeof e == "object", It = (e) => e === !0 || e === !1, Z = (e) => {
if (re(e) !== "object")
return !1;
const t = Ce(e);
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(ze in e) && !(se in e);
}, _t = R("Date"), Ht = R("File"), Mt = R("Blob"), $t = R("FileList"), Vt = (e) => oe(e) && B(e.pipe), zt = (e) => {
let t;
return e && (typeof FormData == "function" && e instanceof FormData || B(e.append) && ((t = re(e)) === "formdata" || // detect form-data instance
t === "object" && B(e.toString) && e.toString() === "[object FormData]"));
}, Jt = R("URLSearchParams"), [Kt, Wt, Xt, Gt] = ["ReadableStream", "Request", "Response", "Headers"].map(R), Yt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function J(e, t, { allOwnKeys: n = !1 } = {}) {
if (e === null || typeof e > "u")
return;
let s, r;
if (typeof e != "object" && (e = [e]), _(e))
for (s = 0, r = e.length; s < r; s++)
t.call(null, e[s], s, e);
else {
const u = n ? Object.getOwnPropertyNames(e) : Object.keys(e), o = u.length;
let a;
for (s = 0; s < o; s++)
a = u[s], t.call(null, e[a], a, e);
}
}
function We(e, t) {
t = t.toLowerCase();
const n = Object.keys(e);
let s = n.length, r;
for (; s-- > 0; )
if (r = n[s], t === r.toLowerCase())
return r;
return null;
}
const q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Xe = (e) => !z(e) && e !== q;
function ge() {
const { caseless: e } = Xe(this) && this || {}, t = {}, n = (s, r) => {
const u = e && We(t, r) || r;
Z(t[u]) && Z(s) ? t[u] = ge(t[u], s) : Z(s) ? t[u] = ge({}, s) : _(s) ? t[u] = s.slice() : t[u] = s;
};
for (let s = 0, r = arguments.length; s < r; s++)
arguments[s] && J(arguments[s], n);
return t;
}
const Zt = (e, t, n, { allOwnKeys: s } = {}) => (J(t, (r, u) => {
n && B(r) ? e[u] = Ve(r, n) : e[u] = r;
}, { allOwnKeys: s }), e), Qt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), en = (e, t, n, s) => {
e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
value: t.prototype
}), n && Object.assign(e.prototype, n);
}, tn = (e, t, n, s) => {
let r, u, o;
const a = {};
if (t = t || {}, e == null) return t;
do {
for (r = Object.getOwnPropertyNames(e), u = r.length; u-- > 0; )
o = r[u], (!s || s(o, e, t)) && !a[o] && (t[o] = e[o], a[o] = !0);
e = n !== !1 && Ce(e);
} while (e && (!n || n(e, t)) && e !== Object.prototype);
return t;
}, nn = (e, t, n) => {
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
const s = e.indexOf(t, n);
return s !== -1 && s === n;
}, sn = (e) => {
if (!e) return null;
if (_(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;
}, rn = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ce(Uint8Array)), un = (e, t) => {
const s = (e && e[se]).call(e);
let r;
for (; (r = s.next()) && !r.done; ) {
const u = r.value;
t.call(e, u[0], u[1]);
}
}, on = (e, t) => {
let n;
const s = [];
for (; (n = e.exec(t)) !== null; )
s.push(n);
return s;
}, an = R("HTMLFormElement"), cn = (e) => e.toLowerCase().replace(
/[-_\s]([a-z\d])(\w*)/g,
function(n, s, r) {
return s.toUpperCase() + r;
}
), xe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ln = R("RegExp"), Ge = (e, t) => {
const n = Object.getOwnPropertyDescriptors(e), s = {};
J(n, (r, u) => {
let o;
(o = t(r, u, e)) !== !1 && (s[u] = o || r);
}), Object.defineProperties(e, s);
}, fn = (e) => {
Ge(e, (t, n) => {
if (B(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
return !1;
const s = e[n];
if (B(s)) {
if (t.enumerable = !1, "writable" in t) {
t.writable = !1;
return;
}
t.set || (t.set = () => {
throw Error("Can not rewrite read-only method '" + n + "'");
});
}
});
}, dn = (e, t) => {
const n = {}, s = (r) => {
r.forEach((u) => {
n[u] = !0;
});
};
return _(e) ? s(e) : s(String(e).split(t)), n;
}, hn = () => {
}, pn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function En(e) {
return !!(e && B(e.append) && e[ze] === "FormData" && e[se]);
}
const gn = (e) => {
const t = new Array(10), n = (s, r) => {
if (oe(s)) {
if (t.indexOf(s) >= 0)
return;
if (!("toJSON" in s)) {
t[r] = s;
const u = _(s) ? [] : {};
return J(s, (o, a) => {
const f = n(o, r + 1);
!z(f) && (u[a] = f);
}), t[r] = void 0, u;
}
}
return s;
};
return n(e, 0);
}, mn = R("AsyncFunction"), yn = (e) => e && (oe(e) || B(e)) && B(e.then) && B(e.catch), Ye = ((e, t) => e ? setImmediate : t ? ((n, s) => (q.addEventListener("message", ({ source: r, data: u }) => {
r === q && u === n && s.length && s.shift()();
}, !1), (r) => {
s.push(r), q.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
typeof setImmediate == "function",
B(q.postMessage)
), bn = typeof queueMicrotask < "u" ? queueMicrotask.bind(q) : typeof process < "u" && process.nextTick || Ye, An = (e) => e != null && B(e[se]), i = {
isArray: _,
isArrayBuffer: Je,
isBuffer: qt,
isFormData: zt,
isArrayBufferView: kt,
isString: jt,
isNumber: Ke,
isBoolean: It,
isObject: oe,
isPlainObject: Z,
isReadableStream: Kt,
isRequest: Wt,
isResponse: Xt,
isHeaders: Gt,
isUndefined: z,
isDate: _t,
isFile: Ht,
isBlob: Mt,
isRegExp: ln,
isFunction: B,
isStream: Vt,
isURLSearchParams: Jt,
isTypedArray: rn,
isFileList: $t,
forEach: J,
merge: ge,
extend: Zt,
trim: Yt,
stripBOM: Qt,
inherits: en,
toFlatObject: tn,
kindOf: re,
kindOfTest: R,
endsWith: nn,
toArray: sn,
forEachEntry: un,
matchAll: on,
isHTMLForm: an,
hasOwnProperty: xe,
hasOwnProp: xe,
// an alias to avoid ESLint no-prototype-builtins detection
reduceDescriptors: Ge,
freezeMethods: fn,
toObjectSet: dn,
toCamelCase: cn,
noop: hn,
toFiniteNumber: pn,
findKey: We,
global: q,
isContextDefined: Xe,
isSpecCompliantForm: En,
toJSONObject: gn,
isAsyncFn: mn,
isThenable: yn,
setImmediate: Ye,
asap: bn,
isIterable: An
};
function g(e, t, n, s, 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), n && (this.config = n), s && (this.request = s), r && (this.response = r, this.status = r.status ? r.status : null);
}
i.inherits(g, 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: i.toJSONObject(this.config),
code: this.code,
status: this.status
};
}
});
const Ze = g.prototype, Qe = {};
[
"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) => {
Qe[e] = { value: e };
});
Object.defineProperties(g, Qe);
Object.defineProperty(Ze, "isAxiosError", { value: !0 });
g.from = (e, t, n, s, r, u) => {
const o = Object.create(Ze);
return i.toFlatObject(e, o, function(f) {
return f !== Error.prototype;
}, (a) => a !== "isAxiosError"), g.call(o, e.message, t, n, s, r), o.cause = e, o.name = e.name, u && Object.assign(o, u), o;
};
const Fn = null;
function me(e) {
return i.isPlainObject(e) || i.isArray(e);
}
function et(e) {
return i.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function Ne(e, t, n) {
return e ? e.concat(t).map(function(r, u) {
return r = et(r), !n && u ? "[" + r + "]" : r;
}).join(n ? "." : "") : t;
}
function Cn(e) {
return i.isArray(e) && !e.some(me);
}
const Sn = i.toFlatObject(i, {}, null, function(t) {
return /^is[A-Z]/.test(t);
});
function ie(e, t, n) {
if (!i.isObject(e))
throw new TypeError("target must be an object");
t = t || new FormData(), n = i.toFlatObject(n, {
metaTokens: !0,
dots: !1,
indexes: !1
}, !1, function(E, p) {
return !i.isUndefined(p[E]);
});
const s = n.metaTokens, r = n.visitor || c, u = n.dots, o = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && i.isSpecCompliantForm(t);
if (!i.isFunction(r))
throw new TypeError("visitor must be a function");
function l(h) {
if (h === null) return "";
if (i.isDate(h))
return h.toISOString();
if (i.isBoolean(h))
return h.toString();
if (!f && i.isBlob(h))
throw new g("Blob is not supported. Use a Buffer instead.");
return i.isArrayBuffer(h) || i.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
}
function c(h, E, p) {
let A = h;
if (h && !p && typeof h == "object") {
if (i.endsWith(E, "{}"))
E = s ? E : E.slice(0, -2), h = JSON.stringify(h);
else if (i.isArray(h) && Cn(h) || (i.isFileList(h) || i.endsWith(E, "[]")) && (A = i.toArray(h)))
return E = et(E), A.forEach(function(S, O) {
!(i.isUndefined(S) || S === null) && t.append(
// eslint-disable-next-line no-nested-ternary
o === !0 ? Ne([E], O, u) : o === null ? E : E + "[]",
l(S)
);
}), !1;
}
return me(h) ? !0 : (t.append(Ne(p, E, u), l(h)), !1);
}
const d = [], m = Object.assign(Sn, {
defaultVisitor: c,
convertValue: l,
isVisitable: me
});
function b(h, E) {
if (!i.isUndefined(h)) {
if (d.indexOf(h) !== -1)
throw Error("Circular reference detected in " + E.join("."));
d.push(h), i.forEach(h, function(A, C) {
(!(i.isUndefined(A) || A === null) && r.call(
t,
A,
i.isString(C) ? C.trim() : C,
E,
m
)) === !0 && b(A, E ? E.concat(C) : [C]);
}), d.pop();
}
}
if (!i.isObject(e))
throw new TypeError("data must be an object");
return b(e), t;
}
function Pe(e) {
const t = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+",
"%00": "\0"
};
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
return t[s];
});
}
function Se(e, t) {
this._pairs = [], e && ie(e, this, t);
}
const tt = Se.prototype;
tt.append = function(t, n) {
this._pairs.push([t, n]);
};
tt.toString = function(t) {
const n = t ? function(s) {
return t.call(this, s, Pe);
} : Pe;
return this._pairs.map(function(r) {
return n(r[0]) + "=" + n(r[1]);
}, "").join("&");
};
function wn(e) {
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function nt(e, t, n) {
if (!t)
return e;
const s = n && n.encode || wn;
i.isFunction(n) && (n = {
serialize: n
});
const r = n && n.serialize;
let u;
if (r ? u = r(t, n) : u = i.isURLSearchParams(t) ? t.toString() : new Se(t, n).toString(s), u) {
const o = e.indexOf("#");
o !== -1 && (e = e.slice(0, o)), e += (e.indexOf("?") === -1 ? "?" : "&") + u;
}
return e;
}
class ve {
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, s) {
return this.handlers.push({
fulfilled: t,
rejected: n,
synchronous: s ? s.synchronous : !1,
runWhen: s ? s.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) {
i.forEach(this.handlers, function(s) {
s !== null && t(s);
});
}
}
const st = {
silentJSONParsing: !0,
forcedJSONParsing: !0,
clarifyTimeoutError: !1
}, Dn = typeof URLSearchParams < "u" ? URLSearchParams : Se, Bn = typeof FormData < "u" ? FormData : null, Tn = typeof Blob < "u" ? Blob : null, Rn = {
isBrowser: !0,
classes: {
URLSearchParams: Dn,
FormData: Bn,
Blob: Tn
},
protocols: ["http", "https", "file", "blob", "url", "data"]
}, we = typeof window < "u" && typeof document < "u", ye = typeof navigator == "object" && navigator || void 0, On = we && (!ye || ["ReactNative", "NativeScript", "NS"].indexOf(ye.product) < 0), xn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Nn = we && window.location.href || "http://localhost", Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
hasBrowserEnv: we,
hasStandardBrowserEnv: On,
hasStandardBrowserWebWorkerEnv: xn,
navigator: ye,
origin: Nn
}, Symbol.toStringTag, { value: "Module" })), D = {
...Pn,
...Rn
};
function vn(e, t) {
return ie(e, new D.classes.URLSearchParams(), Object.assign({
visitor: function(n, s, r, u) {
return D.isNode && i.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : u.defaultVisitor.apply(this, arguments);
}
}, t));
}
function Ln(e) {
return i.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function Un(e) {
const t = {}, n = Object.keys(e);
let s;
const r = n.length;
let u;
for (s = 0; s < r; s++)
u = n[s], t[u] = e[u];
return t;
}
function rt(e) {
function t(n, s, r, u) {
let o = n[u++];
if (o === "__proto__") return !0;
const a = Number.isFinite(+o), f = u >= n.length;
return o = !o && i.isArray(r) ? r.length : o, f ? (i.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !a) : ((!r[o] || !i.isObject(r[o])) && (r[o] = []), t(n, s, r[o], u) && i.isArray(r[o]) && (r[o] = Un(r[o])), !a);
}
if (i.isFormData(e) && i.isFunction(e.entries)) {
const n = {};
return i.forEachEntry(e, (s, r) => {
t(Ln(s), r, n, 0);
}), n;
}
return null;
}
function qn(e, t, n) {
if (i.isString(e))
try {
return (t || JSON.parse)(e), i.trim(e);
} catch (s) {
if (s.name !== "SyntaxError")
throw s;
}
return (n || JSON.stringify)(e);
}
const K = {
transitional: st,
adapter: ["xhr", "http", "fetch"],
transformRequest: [function(t, n) {
const s = n.getContentType() || "", r = s.indexOf("application/json") > -1, u = i.isObject(t);
if (u && i.isHTMLForm(t) && (t = new FormData(t)), i.isFormData(t))
return r ? JSON.stringify(rt(t)) : t;
if (i.isArrayBuffer(t) || i.isBuffer(t) || i.isStream(t) || i.isFile(t) || i.isBlob(t) || i.isReadableStream(t))
return t;
if (i.isArrayBufferView(t))
return t.buffer;
if (i.isURLSearchParams(t))
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
let a;
if (u) {
if (s.indexOf("application/x-www-form-urlencoded") > -1)
return vn(t, this.formSerializer).toString();
if ((a = i.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
const f = this.env && this.env.FormData;
return ie(
a ? { "files[]": t } : t,
f && new f(),
this.formSerializer
);
}
}
return u || r ? (n.setContentType("application/json", !1), qn(t)) : t;
}],
transformResponse: [function(t) {
const n = this.transitional || K.transitional, s = n && n.forcedJSONParsing, r = this.responseType === "json";
if (i.isResponse(t) || i.isReadableStream(t))
return t;
if (t && i.isString(t) && (s && !this.responseType || r)) {
const o = !(n && n.silentJSONParsing) && r;
try {
return JSON.parse(t);
} catch (a) {
if (o)
throw a.name === "SyntaxError" ? g.from(a, g.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: D.classes.FormData,
Blob: D.classes.Blob
},
validateStatus: function(t) {
return t >= 200 && t < 300;
},
headers: {
common: {
Accept: "application/json, text/plain, */*",
"Content-Type": void 0
}
}
};
i.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
K.headers[e] = {};
});
const kn = i.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"
]), jn = (e) => {
const t = {};
let n, s, r;
return e && e.split(`
`).forEach(function(o) {
r = o.indexOf(":"), n = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!n || t[n] && kn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(s) : t[n] = [s] : t[n] = t[n] ? t[n] + ", " + s : s);
}), t;
}, Le = Symbol("internals");
function V(e) {
return e && String(e).trim().toLowerCase();
}
function Q(e) {
return e === !1 || e == null ? e : i.isArray(e) ? e.map(Q) : String(e);
}
function In(e) {
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let s;
for (; s = n.exec(e); )
t[s[1]] = s[2];
return t;
}
const _n = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function he(e, t, n, s, r) {
if (i.isFunction(s))
return s.call(this, t, n);
if (r && (t = n), !!i.isString(t)) {
if (i.isString(s))
return t.indexOf(s) !== -1;
if (i.isRegExp(s))
return s.test(t);
}
}
function Hn(e) {
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, s) => n.toUpperCase() + s);
}
function Mn(e, t) {
const n = i.toCamelCase(" " + t);
["get", "set", "has"].forEach((s) => {
Object.defineProperty(e, s + n, {
value: function(r, u, o) {
return this[s].call(this, t, r, u, o);
},
configurable: !0
});
});
}
let T = class {
constructor(t) {
t && this.set(t);
}
set(t, n, s) {
const r = this;
function u(a, f, l) {
const c = V(f);
if (!c)
throw new Error("header name must be a non-empty string");
const d = i.findKey(r, c);
(!d || r[d] === void 0 || l === !0 || l === void 0 && r[d] !== !1) && (r[d || f] = Q(a));
}
const o = (a, f) => i.forEach(a, (l, c) => u(l, c, f));
if (i.isPlainObject(t) || t instanceof this.constructor)
o(t, n);
else if (i.isString(t) && (t = t.trim()) && !_n(t))
o(jn(t), n);
else if (i.isObject(t) && i.isIterable(t)) {
let a = {}, f, l;
for (const c of t) {
if (!i.isArray(c))
throw TypeError("Object iterator must return a key-value pair");
a[l = c[0]] = (f = a[l]) ? i.isArray(f) ? [...f, c[1]] : [f, c[1]] : c[1];
}
o(a, n);
} else
t != null && u(n, t, s);
return this;
}
get(t, n) {
if (t = V(t), t) {
const s = i.findKey(this, t);
if (s) {
const r = this[s];
if (!n)
return r;
if (n === !0)
return In(r);
if (i.isFunction(n))
return n.call(this, r, s);
if (i.isRegExp(n))
return n.exec(r);
throw new TypeError("parser must be boolean|regexp|function");
}
}
}
has(t, n) {
if (t = V(t), t) {
const s = i.findKey(this, t);
return !!(s && this[s] !== void 0 && (!n || he(this, this[s], s, n)));
}
return !1;
}
delete(t, n) {
const s = this;
let r = !1;
function u(o) {
if (o = V(o), o) {
const a = i.findKey(s, o);
a && (!n || he(s, s[a], a, n)) && (delete s[a], r = !0);
}
}
return i.isArray(t) ? t.forEach(u) : u(t), r;
}
clear(t) {
const n = Object.keys(this);
let s = n.length, r = !1;
for (; s--; ) {
const u = n[s];
(!t || he(this, this[u], u, t, !0)) && (delete this[u], r = !0);
}
return r;
}
normalize(t) {
const n = this, s = {};
return i.forEach(this, (r, u) => {
const o = i.findKey(s, u);
if (o) {
n[o] = Q(r), delete n[u];
return;
}
const a = t ? Hn(u) : String(u).trim();
a !== u && delete n[u], n[a] = Q(r), s[a] = !0;
}), this;
}
concat(...t) {
return this.constructor.concat(this, ...t);
}
toJSON(t) {
const n = /* @__PURE__ */ Object.create(null);
return i.forEach(this, (s, r) => {
s != null && s !== !1 && (n[r] = t && i.isArray(s) ? s.join(", ") : s);
}), 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 s = new this(t);
return n.forEach((r) => s.set(r)), s;
}
static accessor(t) {
const s = (this[Le] = this[Le] = {
accessors: {}
}).accessors, r = this.prototype;
function u(o) {
const a = V(o);
s[a] || (Mn(r, o), s[a] = !0);
}
return i.isArray(t) ? t.forEach(u) : u(t), this;
}
};
T.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
i.reduceDescriptors(T.prototype, ({ value: e }, t) => {
let n = t[0].toUpperCase() + t.slice(1);
return {
get: () => e,
set(s) {
this[n] = s;
}
};
});
i.freezeMethods(T);
function pe(e, t) {
const n = this || K, s = t || n, r = T.from(s.headers);
let u = s.data;
return i.forEach(e, function(a) {
u = a.call(n, u, r.normalize(), t ? t.status : void 0);
}), r.normalize(), u;
}
function ut(e) {
return !!(e && e.__CANCEL__);
}
function H(e, t, n) {
g.call(this, e ?? "canceled", g.ERR_CANCELED, t, n), this.name = "CanceledError";
}
i.inherits(H, g, {
__CANCEL__: !0
});
function ot(e, t, n) {
const s = n.config.validateStatus;
!n.status || !s || s(n.status) ? e(n) : t(new g(
"Request failed with status code " + n.status,
[g.ERR_BAD_REQUEST, g.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
n.config,
n.request,
n
));
}
function $n(e) {
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
return t && t[1] || "";
}
function Vn(e, t) {
e = e || 10;
const n = new Array(e), s = new Array(e);
let r = 0, u = 0, o;
return t = t !== void 0 ? t : 1e3, function(f) {
const l = Date.now(), c = s[u];
o || (o = l), n[r] = f, s[r] = l;
let d = u, m = 0;
for (; d !== r; )
m += n[d++], d = d % e;
if (r = (r + 1) % e, r === u && (u = (u + 1) % e), l - o < t)
return;
const b = c && l - c;
return b ? Math.round(m * 1e3 / b) : void 0;
};
}
function zn(e, t) {
let n = 0, s = 1e3 / t, r, u;
const o = (l, c = Date.now()) => {
n = c, r = null, u && (clearTimeout(u), u = null), e.apply(null, l);
};
return [(...l) => {
const c = Date.now(), d = c - n;
d >= s ? o(l, c) : (r = l, u || (u = setTimeout(() => {
u = null, o(r);
}, s - d)));
}, () => r && o(r)];
}
const te = (e, t, n = 3) => {
let s = 0;
const r = Vn(50, 250);
return zn((u) => {
const o = u.loaded, a = u.lengthComputable ? u.total : void 0, f = o - s, l = r(f), c = o <= a;
s = o;
const d = {
loaded: o,
total: a,
progress: a ? o / a : void 0,
bytes: f,
rate: l || void 0,
estimated: l && a && c ? (a - o) / l : void 0,
event: u,
lengthComputable: a != null,
[t ? "download" : "upload"]: !0
};
e(d);
}, n);
}, Ue = (e, t) => {
const n = e != null;
return [(s) => t[0]({
lengthComputable: n,
total: e,
loaded: s
}), t[1]];
}, qe = (e) => (...t) => i.asap(() => e(...t)), Jn = D.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, D.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
new URL(D.origin),
D.navigator && /(msie|trident)/i.test(D.navigator.userAgent)
) : () => !0, Kn = D.hasStandardBrowserEnv ? (
// Standard browser envs support document.cookie
{
write(e, t, n, s, r, u) {
const o = [e + "=" + encodeURIComponent(t)];
i.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), i.isString(s) && o.push("path=" + s), i.isString(r) && o.push("domain=" + r), u === !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 Wn(e) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function Xn(e, t) {
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function it(e, t, n) {
let s = !Wn(t);
return e && (s || n == !1) ? Xn(e, t) : t;
}
const ke = (e) => e instanceof T ? { ...e } : e;
function j(e, t) {
t = t || {};
const n = {};
function s(l, c, d, m) {
return i.isPlainObject(l) && i.isPlainObject(c) ? i.merge.call({ caseless: m }, l, c) : i.isPlainObject(c) ? i.merge({}, c) : i.isArray(c) ? c.slice() : c;
}
function r(l, c, d, m) {
if (i.isUndefined(c)) {
if (!i.isUndefined(l))
return s(void 0, l, d, m);
} else return s(l, c, d, m);
}
function u(l, c) {
if (!i.isUndefined(c))
return s(void 0, c);
}
function o(l, c) {
if (i.isUndefined(c)) {
if (!i.isUndefined(l))
return s(void 0, l);
} else return s(void 0, c);
}
function a(l, c, d) {
if (d in t)
return s(l, c);
if (d in e)
return s(void 0, l);
}
const f = {
url: u,
method: u,
data: u,
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: a,
headers: (l, c, d) => r(ke(l), ke(c), d, !0)
};
return i.forEach(Object.keys(Object.assign({}, e, t)), function(c) {
const d = f[c] || r, m = d(e[c], t[c], c);
i.isUndefined(m) && d !== a || (n[c] = m);
}), n;
}
const at = (e) => {
const t = j({}, e);
let { data: n, withXSRFToken: s, xsrfHeaderName: r, xsrfCookieName: u, headers: o, auth: a } = t;
t.headers = o = T.from(o), t.url = nt(it(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && o.set(
"Authorization",
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
);
let f;
if (i.isFormData(n)) {
if (D.hasStandardBrowserEnv || D.hasStandardBrowserWebWorkerEnv)
o.setContentType(void 0);
else if ((f = o.getContentType()) !== !1) {
const [l, ...c] = f ? f.split(";").map((d) => d.trim()).filter(Boolean) : [];
o.setContentType([l || "multipart/form-data", ...c].join("; "));
}
}
if (D.hasStandardBrowserEnv && (s && i.isFunction(s) && (s = s(t)), s || s !== !1 && Jn(t.url))) {
const l = r && u && Kn.read(u);
l && o.set(r, l);
}
return t;
}, Gn = typeof XMLHttpRequest < "u", Yn = Gn && function(e) {
return new Promise(function(n, s) {
const r = at(e);
let u = r.data;
const o = T.from(r.headers).normalize();
let { responseType: a, onUploadProgress: f, onDownloadProgress: l } = r, c, d, m, b, h;
function E() {
b && b(), h && h(), r.cancelToken && r.cancelToken.unsubscribe(c), r.signal && r.signal.removeEventListener("abort", c);
}
let p = new XMLHttpRequest();
p.open(r.method.toUpperCase(), r.url, !0), p.timeout = r.timeout;
function A() {
if (!p)
return;
const S = T.from(
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
), y = {
data: !a || a === "text" || a === "json" ? p.responseText : p.response,
status: p.status,
statusText: p.statusText,
headers: S,
config: e,
request: p
};
ot(function(N) {
n(N), E();
}, function(N) {
s(N), E();
}, y), p = null;
}
"onloadend" in p ? p.onloadend = A : p.onreadystatechange = function() {
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(A);
}, p.onabort = function() {
p && (s(new g("Request aborted", g.ECONNABORTED, e, p)), p = null);
}, p.onerror = function() {
s(new g("Network Error", g.ERR_NETWORK, e, p)), p = null;
}, p.ontimeout = function() {
let O = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
const y = r.transitional || st;
r.timeoutErrorMessage && (O = r.timeoutErrorMessage), s(new g(
O,
y.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
e,
p
)), p = null;
}, u === void 0 && o.setContentType(null), "setRequestHeader" in p && i.forEach(o.toJSON(), function(O, y) {
p.setRequestHeader(y, O);
}), i.isUndefined(r.withCredentials) || (p.withCredentials = !!r.withCredentials), a && a !== "json" && (p.responseType = r.responseType), l && ([m, h] = te(l, !0), p.addEventListener("progress", m)), f && p.upload && ([d, b] = te(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", b)), (r.cancelToken || r.signal) && (c = (S) => {
p && (s(!S || S.type ? new H(null, e, p) : S), p.abort(), p = null);
}, r.cancelToken && r.cancelToken.subscribe(c), r.signal && (r.signal.aborted ? c() : r.signal.addEventListener("abort", c)));
const C = $n(r.url);
if (C && D.protocols.indexOf(C) === -1) {
s(new g("Unsupported protocol " + C + ":", g.ERR_BAD_REQUEST, e));
return;
}
p.send(u || null);
});
}, Zn = (e, t) => {
const { length: n } = e = e ? e.filter(Boolean) : [];
if (t || n) {
let s = new AbortController(), r;
const u = function(l) {
if (!r) {
r = !0, a();
const c = l instanceof Error ? l : this.reason;
s.abort(c instanceof g ? c : new H(c instanceof Error ? c.message : c));
}
};
let o = t && setTimeout(() => {
o = null, u(new g(`timeout ${t} of ms exceeded`, g.ETIMEDOUT));
}, t);
const a = () => {
e && (o && clearTimeout(o), o = null, e.forEach((l) => {
l.unsubscribe ? l.unsubscribe(u) : l.removeEventListener("abort", u);
}), e = null);
};
e.forEach((l) => l.addEventListener("abort", u));
const { signal: f } = s;
return f.unsubscribe = () => i.asap(a), f;
}
}, Qn = function* (e, t) {
let n = e.byteLength;
if (n < t) {
yield e;
return;
}
let s = 0, r;
for (; s < n; )
r = s + t, yield e.slice(s, r), s = r;
}, es = async function* (e, t) {
for await (const n of ts(e))
yield* Qn(n, t);
}, ts = async function* (e) {
if (e[Symbol.asyncIterator]) {
yield* e;
return;
}
const t = e.getReader();
try {
for (; ; ) {
const { done: n, value: s } = await t.read();
if (n)
break;
yield s;
}
} finally {
await t.cancel();
}
}, je = (e, t, n, s) => {
const r = es(e, t);
let u = 0, o, a = (f) => {
o || (o = !0, s && s(f));
};
return new ReadableStream({
async pull(f) {
try {
const { done: l, value: c } = await r.next();
if (l) {
a(), f.close();
return;
}
let d = c.byteLength;
if (n) {
let m = u += d;
n(m);
}
f.enqueue(new Uint8Array(c));
} catch (l) {
throw a(l), l;
}
},
cancel(f) {
return a(f), r.return();
}
}, {
highWaterMark: 2
});
}, ae = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", ct = ae && typeof ReadableStream == "function", ns = ae && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), lt = (e, ...t) => {
try {
return !!e(...t);
} catch {
return !1;
}
}, ss = ct && lt(() => {
let e = !1;
const t = new Request(D.origin, {
body: new ReadableStream(),
method: "POST",
get duplex() {
return e = !0, "half";
}
}).headers.has("Content-Type");
return e && !t;
}), Ie = 64 * 1024, be = ct && lt(() => i.isReadableStream(new Response("").body)), ne = {
stream: be && ((e) => e.body)
};
ae && ((e) => {
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
!ne[t] && (ne[t] = i.isFunction(e[t]) ? (n) => n[t]() : (n, s) => {
throw new g(`Response type '${t}' is not supported`, g.ERR_NOT_SUPPORT, s);
});
});
})(new Response());
const rs = async (e) => {
if (e == null)
return 0;
if (i.isBlob(e))
return e.size;
if (i.isSpecCompliantForm(e))
return (await new Request(D.origin, {
method: "POST",
body: e
}).arrayBuffer()).byteLength;
if (i.isArrayBufferView(e) || i.isArrayBuffer(e))
return e.byteLength;
if (i.isURLSearchParams(e) && (e = e + ""), i.isString(e))
return (await ns(e)).byteLength;
}, us = async (e, t) => {
const n = i.toFiniteNumber(e.getContentLength());
return n ?? rs(t);
}, os = ae && (async (e) => {
let {
url: t,
method: n,
data: s,
signal: r,
cancelToken: u,
timeout: o,
onDownloadProgress: a,
onUploadProgress: f,
responseType: l,
headers: c,
withCredentials: d = "same-origin",
fetchOptions: m
} = at(e);
l = l ? (l + "").toLowerCase() : "text";
let b = Zn([r, u && u.toAbortSignal()], o), h;
const E = b && b.unsubscribe && (() => {
b.unsubscribe();
});
let p;
try {
if (f && ss && n !== "get" && n !== "head" && (p = await us(c, s)) !== 0) {
let y = new Request(t, {
method: "POST",
body: s,
duplex: "half"
}), w;
if (i.isFormData(s) && (w = y.headers.get("content-type")) && c.setContentType(w), y.body) {
const [N, W] = Ue(
p,
te(qe(f))
);
s = je(y.body, Ie, N, W);
}
}
i.isString(d) || (d = d ? "include" : "omit");
const A = "credentials" in Request.prototype;
h = new Request(t, {
...m,
signal: b,
method: n.toUpperCase(),
headers: c.normalize().toJSON(),
body: s,
duplex: "half",
credentials: A ? d : v