@tarxemo/customer_support 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CustomerSupportWidget.d.ts.map +1 -1
- package/dist/customer_support.css +1 -1
- package/dist/hooks/useLocalStorage.d.ts.map +1 -1
- package/dist/index.es.js +926 -926
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Pe = (e, t,
|
|
4
|
-
import
|
|
5
|
-
import { ExternalLink as
|
|
6
|
-
function
|
|
1
|
+
var Et = Object.defineProperty;
|
|
2
|
+
var _t = (e, t, r) => t in e ? Et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Pe = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import w, { useState as J, useEffect as xe, useRef as Ge, useCallback as ee } from "react";
|
|
5
|
+
import { ExternalLink as St, Send as Rt, X as Ot, Loader2 as Tt, MessageCircle as At } from "lucide-react";
|
|
6
|
+
function Ye(e, t) {
|
|
7
7
|
return function() {
|
|
8
8
|
return e.apply(t, arguments);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
const { toString:
|
|
12
|
-
const
|
|
13
|
-
return e[
|
|
14
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
15
|
-
function
|
|
16
|
-
return e !== null &&
|
|
11
|
+
const { toString: Ct } = Object.prototype, { getPrototypeOf: Ee } = Object, { iterator: ie, toStringTag: Qe } = Symbol, ae = /* @__PURE__ */ ((e) => (t) => {
|
|
12
|
+
const r = Ct.call(t);
|
|
13
|
+
return e[r] || (e[r] = r.slice(8, -1).toLowerCase());
|
|
14
|
+
})(/* @__PURE__ */ Object.create(null)), k = (e) => (e = e.toLowerCase(), (t) => ae(t) === e), ce = (e) => (t) => typeof t === e, { isArray: H } = Array, $ = ce("undefined");
|
|
15
|
+
function K(e) {
|
|
16
|
+
return e !== null && !$(e) && e.constructor !== null && !$(e.constructor) && A(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
17
17
|
}
|
|
18
|
-
const Ze =
|
|
19
|
-
function
|
|
18
|
+
const Ze = k("ArrayBuffer");
|
|
19
|
+
function Nt(e) {
|
|
20
20
|
let t;
|
|
21
21
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ze(e.buffer), t;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const kt = ce("string"), A = ce("function"), et = ce("number"), V = (e) => e !== null && typeof e == "object", Pt = (e) => e === !0 || e === !1, re = (e) => {
|
|
24
24
|
if (ae(e) !== "object")
|
|
25
25
|
return !1;
|
|
26
|
-
const t =
|
|
27
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(
|
|
26
|
+
const t = Ee(e);
|
|
27
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Qe in e) && !(ie in e);
|
|
28
28
|
}, Ut = (e) => {
|
|
29
|
-
if (!
|
|
29
|
+
if (!V(e) || K(e))
|
|
30
30
|
return !1;
|
|
31
31
|
try {
|
|
32
32
|
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
33
33
|
} catch {
|
|
34
34
|
return !1;
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, Dt = k("Date"), Ft = k("File"), Lt = k("Blob"), vt = k("FileList"), Bt = (e) => V(e) && A(e.pipe), It = (e) => {
|
|
37
37
|
let t;
|
|
38
|
-
return e && (typeof FormData == "function" && e instanceof FormData ||
|
|
39
|
-
t === "object" &&
|
|
40
|
-
},
|
|
41
|
-
function W(e, t, { allOwnKeys:
|
|
38
|
+
return e && (typeof FormData == "function" && e instanceof FormData || A(e.append) && ((t = ae(e)) === "formdata" || // detect form-data instance
|
|
39
|
+
t === "object" && A(e.toString) && e.toString() === "[object FormData]"));
|
|
40
|
+
}, jt = k("URLSearchParams"), [Mt, $t, Ht, qt] = ["ReadableStream", "Request", "Response", "Headers"].map(k), zt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
41
|
+
function W(e, t, { allOwnKeys: r = !1 } = {}) {
|
|
42
42
|
if (e === null || typeof e > "u")
|
|
43
43
|
return;
|
|
44
|
-
let
|
|
45
|
-
if (typeof e != "object" && (e = [e]),
|
|
46
|
-
for (
|
|
47
|
-
t.call(null, e[
|
|
44
|
+
let n, s;
|
|
45
|
+
if (typeof e != "object" && (e = [e]), H(e))
|
|
46
|
+
for (n = 0, s = e.length; n < s; n++)
|
|
47
|
+
t.call(null, e[n], n, e);
|
|
48
48
|
else {
|
|
49
|
-
if (
|
|
49
|
+
if (K(e))
|
|
50
50
|
return;
|
|
51
|
-
const o =
|
|
51
|
+
const o = r ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
|
|
52
52
|
let a;
|
|
53
|
-
for (
|
|
54
|
-
a = o[
|
|
53
|
+
for (n = 0; n < i; n++)
|
|
54
|
+
a = o[n], t.call(null, e[a], a, e);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
function tt(e, t) {
|
|
58
|
-
if (
|
|
58
|
+
if (K(e))
|
|
59
59
|
return null;
|
|
60
60
|
t = t.toLowerCase();
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
for (;
|
|
64
|
-
if (s = n
|
|
61
|
+
const r = Object.keys(e);
|
|
62
|
+
let n = r.length, s;
|
|
63
|
+
for (; n-- > 0; )
|
|
64
|
+
if (s = r[n], t === s.toLowerCase())
|
|
65
65
|
return s;
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
const { caseless: e, skipUndefined: t } =
|
|
71
|
-
const i = e && tt(
|
|
72
|
-
|
|
68
|
+
const B = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, rt = (e) => !$(e) && e !== B;
|
|
69
|
+
function ge() {
|
|
70
|
+
const { caseless: e, skipUndefined: t } = rt(this) && this || {}, r = {}, n = (s, o) => {
|
|
71
|
+
const i = e && tt(r, o) || o;
|
|
72
|
+
re(r[i]) && re(s) ? r[i] = ge(r[i], s) : re(s) ? r[i] = ge({}, s) : H(s) ? r[i] = s.slice() : (!t || !$(s)) && (r[i] = s);
|
|
73
73
|
};
|
|
74
74
|
for (let s = 0, o = arguments.length; s < o; s++)
|
|
75
|
-
arguments[s] && W(arguments[s],
|
|
76
|
-
return
|
|
75
|
+
arguments[s] && W(arguments[s], n);
|
|
76
|
+
return r;
|
|
77
77
|
}
|
|
78
|
-
const Jt = (e, t,
|
|
79
|
-
|
|
80
|
-
value:
|
|
78
|
+
const Jt = (e, t, r, { allOwnKeys: n } = {}) => (W(t, (s, o) => {
|
|
79
|
+
r && A(s) ? Object.defineProperty(e, o, {
|
|
80
|
+
value: Ye(s, r),
|
|
81
81
|
writable: !0,
|
|
82
82
|
enumerable: !0,
|
|
83
83
|
configurable: !0
|
|
@@ -87,178 +87,178 @@ const Jt = (e, t, n, { allOwnKeys: r } = {}) => (W(t, (s, o) => {
|
|
|
87
87
|
enumerable: !0,
|
|
88
88
|
configurable: !0
|
|
89
89
|
});
|
|
90
|
-
}, { allOwnKeys:
|
|
91
|
-
e.prototype = Object.create(t.prototype,
|
|
90
|
+
}, { allOwnKeys: n }), e), Kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Vt = (e, t, r, n) => {
|
|
91
|
+
e.prototype = Object.create(t.prototype, n), Object.defineProperty(e.prototype, "constructor", {
|
|
92
92
|
value: e,
|
|
93
93
|
writable: !0,
|
|
94
94
|
enumerable: !1,
|
|
95
95
|
configurable: !0
|
|
96
96
|
}), Object.defineProperty(e, "super", {
|
|
97
97
|
value: t.prototype
|
|
98
|
-
}),
|
|
99
|
-
}, Wt = (e, t,
|
|
98
|
+
}), r && Object.assign(e.prototype, r);
|
|
99
|
+
}, Wt = (e, t, r, n) => {
|
|
100
100
|
let s, o, i;
|
|
101
101
|
const a = {};
|
|
102
102
|
if (t = t || {}, e == null) return t;
|
|
103
103
|
do {
|
|
104
104
|
for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
|
|
105
|
-
i = s[o], (!
|
|
106
|
-
e =
|
|
107
|
-
} while (e && (!
|
|
105
|
+
i = s[o], (!n || n(i, e, t)) && !a[i] && (t[i] = e[i], a[i] = !0);
|
|
106
|
+
e = r !== !1 && Ee(e);
|
|
107
|
+
} while (e && (!r || r(e, t)) && e !== Object.prototype);
|
|
108
108
|
return t;
|
|
109
|
-
}, Xt = (e, t,
|
|
110
|
-
e = String(e), (
|
|
111
|
-
const
|
|
112
|
-
return
|
|
109
|
+
}, Xt = (e, t, r) => {
|
|
110
|
+
e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
|
|
111
|
+
const n = e.indexOf(t, r);
|
|
112
|
+
return n !== -1 && n === r;
|
|
113
113
|
}, Gt = (e) => {
|
|
114
114
|
if (!e) return null;
|
|
115
|
-
if (
|
|
115
|
+
if (H(e)) return e;
|
|
116
116
|
let t = e.length;
|
|
117
117
|
if (!et(t)) return null;
|
|
118
|
-
const
|
|
118
|
+
const r = new Array(t);
|
|
119
119
|
for (; t-- > 0; )
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
},
|
|
123
|
-
const
|
|
120
|
+
r[t] = e[t];
|
|
121
|
+
return r;
|
|
122
|
+
}, Yt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Ee(Uint8Array)), Qt = (e, t) => {
|
|
123
|
+
const n = (e && e[ie]).call(e);
|
|
124
124
|
let s;
|
|
125
|
-
for (; (s =
|
|
125
|
+
for (; (s = n.next()) && !s.done; ) {
|
|
126
126
|
const o = s.value;
|
|
127
127
|
t.call(e, o[0], o[1]);
|
|
128
128
|
}
|
|
129
129
|
}, Zt = (e, t) => {
|
|
130
|
-
let
|
|
131
|
-
const
|
|
132
|
-
for (; (
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
},
|
|
130
|
+
let r;
|
|
131
|
+
const n = [];
|
|
132
|
+
for (; (r = e.exec(t)) !== null; )
|
|
133
|
+
n.push(r);
|
|
134
|
+
return n;
|
|
135
|
+
}, er = k("HTMLFormElement"), tr = (e) => e.toLowerCase().replace(
|
|
136
136
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
137
|
-
function(
|
|
138
|
-
return
|
|
137
|
+
function(r, n, s) {
|
|
138
|
+
return n.toUpperCase() + s;
|
|
139
139
|
}
|
|
140
|
-
),
|
|
141
|
-
const
|
|
142
|
-
W(
|
|
140
|
+
), Ue = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), rr = k("RegExp"), nt = (e, t) => {
|
|
141
|
+
const r = Object.getOwnPropertyDescriptors(e), n = {};
|
|
142
|
+
W(r, (s, o) => {
|
|
143
143
|
let i;
|
|
144
|
-
(i = t(s, o, e)) !== !1 && (
|
|
145
|
-
}), Object.defineProperties(e,
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
if (
|
|
144
|
+
(i = t(s, o, e)) !== !1 && (n[o] = i || s);
|
|
145
|
+
}), Object.defineProperties(e, n);
|
|
146
|
+
}, nr = (e) => {
|
|
147
|
+
nt(e, (t, r) => {
|
|
148
|
+
if (A(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
149
149
|
return !1;
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
150
|
+
const n = e[r];
|
|
151
|
+
if (A(n)) {
|
|
152
152
|
if (t.enumerable = !1, "writable" in t) {
|
|
153
153
|
t.writable = !1;
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
t.set || (t.set = () => {
|
|
157
|
-
throw Error("Can not rewrite read-only method '" +
|
|
157
|
+
throw Error("Can not rewrite read-only method '" + r + "'");
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
|
-
},
|
|
162
|
-
const
|
|
161
|
+
}, sr = (e, t) => {
|
|
162
|
+
const r = {}, n = (s) => {
|
|
163
163
|
s.forEach((o) => {
|
|
164
|
-
|
|
164
|
+
r[o] = !0;
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
|
-
return
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
function
|
|
171
|
-
return !!(e &&
|
|
167
|
+
return H(e) ? n(e) : n(String(e).split(t)), r;
|
|
168
|
+
}, or = () => {
|
|
169
|
+
}, ir = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
170
|
+
function ar(e) {
|
|
171
|
+
return !!(e && A(e.append) && e[Qe] === "FormData" && e[ie]);
|
|
172
172
|
}
|
|
173
|
-
const
|
|
174
|
-
const t = new Array(10),
|
|
175
|
-
if (
|
|
176
|
-
if (t.indexOf(
|
|
173
|
+
const cr = (e) => {
|
|
174
|
+
const t = new Array(10), r = (n, s) => {
|
|
175
|
+
if (V(n)) {
|
|
176
|
+
if (t.indexOf(n) >= 0)
|
|
177
177
|
return;
|
|
178
|
-
if (
|
|
179
|
-
return
|
|
180
|
-
if (!("toJSON" in
|
|
181
|
-
t[s] =
|
|
182
|
-
const o =
|
|
183
|
-
return W(
|
|
184
|
-
const
|
|
185
|
-
|
|
178
|
+
if (K(n))
|
|
179
|
+
return n;
|
|
180
|
+
if (!("toJSON" in n)) {
|
|
181
|
+
t[s] = n;
|
|
182
|
+
const o = H(n) ? [] : {};
|
|
183
|
+
return W(n, (i, a) => {
|
|
184
|
+
const f = r(i, s + 1);
|
|
185
|
+
!$(f) && (o[a] = f);
|
|
186
186
|
}), t[s] = void 0, o;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
return
|
|
189
|
+
return n;
|
|
190
190
|
};
|
|
191
|
-
return
|
|
192
|
-
},
|
|
193
|
-
s ===
|
|
191
|
+
return r(e, 0);
|
|
192
|
+
}, lr = k("AsyncFunction"), ur = (e) => e && (V(e) || A(e)) && A(e.then) && A(e.catch), st = ((e, t) => e ? setImmediate : t ? ((r, n) => (B.addEventListener("message", ({ source: s, data: o }) => {
|
|
193
|
+
s === B && o === r && n.length && n.shift()();
|
|
194
194
|
}, !1), (s) => {
|
|
195
|
-
|
|
196
|
-
}))(`axios@${Math.random()}`, []) : (
|
|
195
|
+
n.push(s), B.postMessage(r, "*");
|
|
196
|
+
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
197
197
|
typeof setImmediate == "function",
|
|
198
|
-
|
|
199
|
-
),
|
|
200
|
-
isArray:
|
|
198
|
+
A(B.postMessage)
|
|
199
|
+
), dr = typeof queueMicrotask < "u" ? queueMicrotask.bind(B) : typeof process < "u" && process.nextTick || st, fr = (e) => e != null && A(e[ie]), c = {
|
|
200
|
+
isArray: H,
|
|
201
201
|
isArrayBuffer: Ze,
|
|
202
|
-
isBuffer:
|
|
203
|
-
isFormData:
|
|
204
|
-
isArrayBufferView:
|
|
205
|
-
isString:
|
|
202
|
+
isBuffer: K,
|
|
203
|
+
isFormData: It,
|
|
204
|
+
isArrayBufferView: Nt,
|
|
205
|
+
isString: kt,
|
|
206
206
|
isNumber: et,
|
|
207
|
-
isBoolean:
|
|
208
|
-
isObject:
|
|
209
|
-
isPlainObject:
|
|
207
|
+
isBoolean: Pt,
|
|
208
|
+
isObject: V,
|
|
209
|
+
isPlainObject: re,
|
|
210
210
|
isEmptyObject: Ut,
|
|
211
211
|
isReadableStream: Mt,
|
|
212
|
-
isRequest:
|
|
213
|
-
isResponse:
|
|
214
|
-
isHeaders:
|
|
215
|
-
isUndefined:
|
|
216
|
-
isDate:
|
|
217
|
-
isFile:
|
|
218
|
-
isBlob:
|
|
219
|
-
isRegExp:
|
|
220
|
-
isFunction:
|
|
221
|
-
isStream:
|
|
222
|
-
isURLSearchParams:
|
|
223
|
-
isTypedArray:
|
|
224
|
-
isFileList:
|
|
212
|
+
isRequest: $t,
|
|
213
|
+
isResponse: Ht,
|
|
214
|
+
isHeaders: qt,
|
|
215
|
+
isUndefined: $,
|
|
216
|
+
isDate: Dt,
|
|
217
|
+
isFile: Ft,
|
|
218
|
+
isBlob: Lt,
|
|
219
|
+
isRegExp: rr,
|
|
220
|
+
isFunction: A,
|
|
221
|
+
isStream: Bt,
|
|
222
|
+
isURLSearchParams: jt,
|
|
223
|
+
isTypedArray: Yt,
|
|
224
|
+
isFileList: vt,
|
|
225
225
|
forEach: W,
|
|
226
|
-
merge:
|
|
226
|
+
merge: ge,
|
|
227
227
|
extend: Jt,
|
|
228
|
-
trim:
|
|
229
|
-
stripBOM:
|
|
230
|
-
inherits:
|
|
228
|
+
trim: zt,
|
|
229
|
+
stripBOM: Kt,
|
|
230
|
+
inherits: Vt,
|
|
231
231
|
toFlatObject: Wt,
|
|
232
232
|
kindOf: ae,
|
|
233
|
-
kindOfTest:
|
|
233
|
+
kindOfTest: k,
|
|
234
234
|
endsWith: Xt,
|
|
235
235
|
toArray: Gt,
|
|
236
|
-
forEachEntry:
|
|
236
|
+
forEachEntry: Qt,
|
|
237
237
|
matchAll: Zt,
|
|
238
|
-
isHTMLForm:
|
|
239
|
-
hasOwnProperty:
|
|
240
|
-
hasOwnProp:
|
|
238
|
+
isHTMLForm: er,
|
|
239
|
+
hasOwnProperty: Ue,
|
|
240
|
+
hasOwnProp: Ue,
|
|
241
241
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
242
|
-
reduceDescriptors:
|
|
243
|
-
freezeMethods:
|
|
244
|
-
toObjectSet:
|
|
245
|
-
toCamelCase:
|
|
246
|
-
noop:
|
|
247
|
-
toFiniteNumber:
|
|
242
|
+
reduceDescriptors: nt,
|
|
243
|
+
freezeMethods: nr,
|
|
244
|
+
toObjectSet: sr,
|
|
245
|
+
toCamelCase: tr,
|
|
246
|
+
noop: or,
|
|
247
|
+
toFiniteNumber: ir,
|
|
248
248
|
findKey: tt,
|
|
249
|
-
global:
|
|
250
|
-
isContextDefined:
|
|
251
|
-
isSpecCompliantForm:
|
|
252
|
-
toJSONObject:
|
|
253
|
-
isAsyncFn:
|
|
254
|
-
isThenable:
|
|
249
|
+
global: B,
|
|
250
|
+
isContextDefined: rt,
|
|
251
|
+
isSpecCompliantForm: ar,
|
|
252
|
+
toJSONObject: cr,
|
|
253
|
+
isAsyncFn: lr,
|
|
254
|
+
isThenable: ur,
|
|
255
255
|
setImmediate: st,
|
|
256
|
-
asap:
|
|
257
|
-
isIterable:
|
|
256
|
+
asap: dr,
|
|
257
|
+
isIterable: fr
|
|
258
258
|
};
|
|
259
|
-
let
|
|
260
|
-
static from(t,
|
|
261
|
-
const a = new ot(t.message,
|
|
259
|
+
let g = class ot extends Error {
|
|
260
|
+
static from(t, r, n, s, o, i) {
|
|
261
|
+
const a = new ot(t.message, r || t.code, n, s, o);
|
|
262
262
|
return a.cause = t, a.name = t.name, i && Object.assign(a, i), a;
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
@@ -272,8 +272,8 @@ let w = class ot extends Error {
|
|
|
272
272
|
*
|
|
273
273
|
* @returns {Error} The created error.
|
|
274
274
|
*/
|
|
275
|
-
constructor(t,
|
|
276
|
-
super(t), this.name = "AxiosError", this.isAxiosError = !0,
|
|
275
|
+
constructor(t, r, n, s, o) {
|
|
276
|
+
super(t), this.name = "AxiosError", this.isAxiosError = !0, r && (this.code = r), n && (this.config = n), s && (this.request = s), o && (this.response = o, this.status = o.status);
|
|
277
277
|
}
|
|
278
278
|
toJSON() {
|
|
279
279
|
return {
|
|
@@ -295,98 +295,98 @@ let w = class ot extends Error {
|
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
function
|
|
298
|
+
g.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE";
|
|
299
|
+
g.ERR_BAD_OPTION = "ERR_BAD_OPTION";
|
|
300
|
+
g.ECONNABORTED = "ECONNABORTED";
|
|
301
|
+
g.ETIMEDOUT = "ETIMEDOUT";
|
|
302
|
+
g.ERR_NETWORK = "ERR_NETWORK";
|
|
303
|
+
g.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS";
|
|
304
|
+
g.ERR_DEPRECATED = "ERR_DEPRECATED";
|
|
305
|
+
g.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE";
|
|
306
|
+
g.ERR_BAD_REQUEST = "ERR_BAD_REQUEST";
|
|
307
|
+
g.ERR_CANCELED = "ERR_CANCELED";
|
|
308
|
+
g.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
309
|
+
g.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
310
|
+
const pr = null;
|
|
311
|
+
function we(e) {
|
|
312
312
|
return c.isPlainObject(e) || c.isArray(e);
|
|
313
313
|
}
|
|
314
314
|
function it(e) {
|
|
315
315
|
return c.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function De(e, t, r) {
|
|
318
318
|
return e ? e.concat(t).map(function(s, o) {
|
|
319
|
-
return s = it(s), !
|
|
320
|
-
}).join(
|
|
319
|
+
return s = it(s), !r && o ? "[" + s + "]" : s;
|
|
320
|
+
}).join(r ? "." : "") : t;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
return c.isArray(e) && !e.some(
|
|
322
|
+
function mr(e) {
|
|
323
|
+
return c.isArray(e) && !e.some(we);
|
|
324
324
|
}
|
|
325
|
-
const
|
|
325
|
+
const hr = c.toFlatObject(c, {}, null, function(t) {
|
|
326
326
|
return /^is[A-Z]/.test(t);
|
|
327
327
|
});
|
|
328
|
-
function le(e, t,
|
|
328
|
+
function le(e, t, r) {
|
|
329
329
|
if (!c.isObject(e))
|
|
330
330
|
throw new TypeError("target must be an object");
|
|
331
|
-
t = t || new FormData(),
|
|
331
|
+
t = t || new FormData(), r = c.toFlatObject(r, {
|
|
332
332
|
metaTokens: !0,
|
|
333
333
|
dots: !1,
|
|
334
334
|
indexes: !1
|
|
335
335
|
}, !1, function(h, m) {
|
|
336
336
|
return !c.isUndefined(m[h]);
|
|
337
337
|
});
|
|
338
|
-
const
|
|
338
|
+
const n = r.metaTokens, s = r.visitor || l, o = r.dots, i = r.indexes, f = (r.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(t);
|
|
339
339
|
if (!c.isFunction(s))
|
|
340
340
|
throw new TypeError("visitor must be a function");
|
|
341
|
-
function u(
|
|
342
|
-
if (
|
|
343
|
-
if (c.isDate(
|
|
344
|
-
return
|
|
345
|
-
if (c.isBoolean(
|
|
346
|
-
return
|
|
347
|
-
if (!
|
|
348
|
-
throw new
|
|
349
|
-
return c.isArrayBuffer(
|
|
350
|
-
}
|
|
351
|
-
function l(
|
|
352
|
-
let
|
|
353
|
-
if (
|
|
341
|
+
function u(d) {
|
|
342
|
+
if (d === null) return "";
|
|
343
|
+
if (c.isDate(d))
|
|
344
|
+
return d.toISOString();
|
|
345
|
+
if (c.isBoolean(d))
|
|
346
|
+
return d.toString();
|
|
347
|
+
if (!f && c.isBlob(d))
|
|
348
|
+
throw new g("Blob is not supported. Use a Buffer instead.");
|
|
349
|
+
return c.isArrayBuffer(d) || c.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
350
|
+
}
|
|
351
|
+
function l(d, h, m) {
|
|
352
|
+
let E = d;
|
|
353
|
+
if (d && !m && typeof d == "object") {
|
|
354
354
|
if (c.endsWith(h, "{}"))
|
|
355
|
-
h =
|
|
356
|
-
else if (c.isArray(
|
|
357
|
-
return h = it(h),
|
|
358
|
-
!(c.isUndefined(
|
|
355
|
+
h = n ? h : h.slice(0, -2), d = JSON.stringify(d);
|
|
356
|
+
else if (c.isArray(d) && mr(d) || (c.isFileList(d) || c.endsWith(h, "[]")) && (E = c.toArray(d)))
|
|
357
|
+
return h = it(h), E.forEach(function(x, b) {
|
|
358
|
+
!(c.isUndefined(x) || x === null) && t.append(
|
|
359
359
|
// eslint-disable-next-line no-nested-ternary
|
|
360
|
-
i === !0 ?
|
|
361
|
-
u(
|
|
360
|
+
i === !0 ? De([h], b, o) : i === null ? h : h + "[]",
|
|
361
|
+
u(x)
|
|
362
362
|
);
|
|
363
363
|
}), !1;
|
|
364
364
|
}
|
|
365
|
-
return
|
|
365
|
+
return we(d) ? !0 : (t.append(De(m, h, o), u(d)), !1);
|
|
366
366
|
}
|
|
367
|
-
const p = [],
|
|
367
|
+
const p = [], y = Object.assign(hr, {
|
|
368
368
|
defaultVisitor: l,
|
|
369
369
|
convertValue: u,
|
|
370
|
-
isVisitable:
|
|
370
|
+
isVisitable: we
|
|
371
371
|
});
|
|
372
|
-
function
|
|
373
|
-
if (!c.isUndefined(
|
|
374
|
-
if (p.indexOf(
|
|
372
|
+
function R(d, h) {
|
|
373
|
+
if (!c.isUndefined(d)) {
|
|
374
|
+
if (p.indexOf(d) !== -1)
|
|
375
375
|
throw Error("Circular reference detected in " + h.join("."));
|
|
376
|
-
p.push(
|
|
377
|
-
(!(c.isUndefined(
|
|
376
|
+
p.push(d), c.forEach(d, function(E, _) {
|
|
377
|
+
(!(c.isUndefined(E) || E === null) && s.call(
|
|
378
378
|
t,
|
|
379
|
-
|
|
380
|
-
c.isString(
|
|
379
|
+
E,
|
|
380
|
+
c.isString(_) ? _.trim() : _,
|
|
381
381
|
h,
|
|
382
|
-
|
|
383
|
-
)) === !0 &&
|
|
382
|
+
y
|
|
383
|
+
)) === !0 && R(E, h ? h.concat(_) : [_]);
|
|
384
384
|
}), p.pop();
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
if (!c.isObject(e))
|
|
388
388
|
throw new TypeError("data must be an object");
|
|
389
|
-
return
|
|
389
|
+
return R(e), t;
|
|
390
390
|
}
|
|
391
391
|
function Fe(e) {
|
|
392
392
|
const t = {
|
|
@@ -398,36 +398,36 @@ function Fe(e) {
|
|
|
398
398
|
"%20": "+",
|
|
399
399
|
"%00": "\0"
|
|
400
400
|
};
|
|
401
|
-
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(
|
|
402
|
-
return t[
|
|
401
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(n) {
|
|
402
|
+
return t[n];
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function _e(e, t) {
|
|
406
406
|
this._pairs = [], e && le(e, this, t);
|
|
407
407
|
}
|
|
408
|
-
const at =
|
|
409
|
-
at.append = function(t,
|
|
410
|
-
this._pairs.push([t,
|
|
408
|
+
const at = _e.prototype;
|
|
409
|
+
at.append = function(t, r) {
|
|
410
|
+
this._pairs.push([t, r]);
|
|
411
411
|
};
|
|
412
412
|
at.toString = function(t) {
|
|
413
|
-
const
|
|
414
|
-
return t.call(this,
|
|
413
|
+
const r = t ? function(n) {
|
|
414
|
+
return t.call(this, n, Fe);
|
|
415
415
|
} : Fe;
|
|
416
416
|
return this._pairs.map(function(s) {
|
|
417
|
-
return
|
|
417
|
+
return r(s[0]) + "=" + r(s[1]);
|
|
418
418
|
}, "").join("&");
|
|
419
419
|
};
|
|
420
|
-
function
|
|
420
|
+
function gr(e) {
|
|
421
421
|
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
422
422
|
}
|
|
423
|
-
function ct(e, t,
|
|
423
|
+
function ct(e, t, r) {
|
|
424
424
|
if (!t)
|
|
425
425
|
return e;
|
|
426
|
-
const
|
|
427
|
-
serialize:
|
|
428
|
-
} :
|
|
426
|
+
const n = r && r.encode || gr, s = c.isFunction(r) ? {
|
|
427
|
+
serialize: r
|
|
428
|
+
} : r, o = s && s.serialize;
|
|
429
429
|
let i;
|
|
430
|
-
if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new
|
|
430
|
+
if (o ? i = o(t, s) : i = c.isURLSearchParams(t) ? t.toString() : new _e(t, s).toString(n), i) {
|
|
431
431
|
const a = e.indexOf("#");
|
|
432
432
|
a !== -1 && (e = e.slice(0, a)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
433
433
|
}
|
|
@@ -446,12 +446,12 @@ class Le {
|
|
|
446
446
|
*
|
|
447
447
|
* @return {Number} An ID used to remove interceptor later
|
|
448
448
|
*/
|
|
449
|
-
use(t,
|
|
449
|
+
use(t, r, n) {
|
|
450
450
|
return this.handlers.push({
|
|
451
451
|
fulfilled: t,
|
|
452
|
-
rejected:
|
|
453
|
-
synchronous:
|
|
454
|
-
runWhen:
|
|
452
|
+
rejected: r,
|
|
453
|
+
synchronous: n ? n.synchronous : !1,
|
|
454
|
+
runWhen: n ? n.runWhen : null
|
|
455
455
|
}), this.handlers.length - 1;
|
|
456
456
|
}
|
|
457
457
|
/**
|
|
@@ -483,8 +483,8 @@ class Le {
|
|
|
483
483
|
* @returns {void}
|
|
484
484
|
*/
|
|
485
485
|
forEach(t) {
|
|
486
|
-
c.forEach(this.handlers, function(
|
|
487
|
-
|
|
486
|
+
c.forEach(this.handlers, function(n) {
|
|
487
|
+
n !== null && t(n);
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
490
|
}
|
|
@@ -492,76 +492,76 @@ const lt = {
|
|
|
492
492
|
silentJSONParsing: !0,
|
|
493
493
|
forcedJSONParsing: !0,
|
|
494
494
|
clarifyTimeoutError: !1
|
|
495
|
-
},
|
|
495
|
+
}, wr = typeof URLSearchParams < "u" ? URLSearchParams : _e, br = typeof FormData < "u" ? FormData : null, yr = typeof Blob < "u" ? Blob : null, xr = {
|
|
496
496
|
isBrowser: !0,
|
|
497
497
|
classes: {
|
|
498
|
-
URLSearchParams:
|
|
499
|
-
FormData:
|
|
500
|
-
Blob:
|
|
498
|
+
URLSearchParams: wr,
|
|
499
|
+
FormData: br,
|
|
500
|
+
Blob: yr
|
|
501
501
|
},
|
|
502
502
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
503
|
-
},
|
|
504
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
503
|
+
}, Se = typeof window < "u" && typeof document < "u", be = typeof navigator == "object" && navigator || void 0, Er = Se && (!be || ["ReactNative", "NativeScript", "NS"].indexOf(be.product) < 0), _r = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
504
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Sr = Se && window.location.href || "http://localhost", Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
505
505
|
__proto__: null,
|
|
506
|
-
hasBrowserEnv:
|
|
507
|
-
hasStandardBrowserEnv:
|
|
508
|
-
hasStandardBrowserWebWorkerEnv:
|
|
509
|
-
navigator:
|
|
510
|
-
origin:
|
|
511
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
512
|
-
...
|
|
513
|
-
...
|
|
506
|
+
hasBrowserEnv: Se,
|
|
507
|
+
hasStandardBrowserEnv: Er,
|
|
508
|
+
hasStandardBrowserWebWorkerEnv: _r,
|
|
509
|
+
navigator: be,
|
|
510
|
+
origin: Sr
|
|
511
|
+
}, Symbol.toStringTag, { value: "Module" })), T = {
|
|
512
|
+
...Rr,
|
|
513
|
+
...xr
|
|
514
514
|
};
|
|
515
|
-
function
|
|
516
|
-
return le(e, new
|
|
517
|
-
visitor: function(
|
|
518
|
-
return
|
|
515
|
+
function Or(e, t) {
|
|
516
|
+
return le(e, new T.classes.URLSearchParams(), {
|
|
517
|
+
visitor: function(r, n, s, o) {
|
|
518
|
+
return T.isNode && c.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
519
519
|
},
|
|
520
520
|
...t
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Tr(e) {
|
|
524
524
|
return c.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
const t = {},
|
|
528
|
-
let
|
|
529
|
-
const s =
|
|
526
|
+
function Ar(e) {
|
|
527
|
+
const t = {}, r = Object.keys(e);
|
|
528
|
+
let n;
|
|
529
|
+
const s = r.length;
|
|
530
530
|
let o;
|
|
531
|
-
for (
|
|
532
|
-
o = n
|
|
531
|
+
for (n = 0; n < s; n++)
|
|
532
|
+
o = r[n], t[o] = e[o];
|
|
533
533
|
return t;
|
|
534
534
|
}
|
|
535
535
|
function ut(e) {
|
|
536
|
-
function t(
|
|
537
|
-
let i =
|
|
536
|
+
function t(r, n, s, o) {
|
|
537
|
+
let i = r[o++];
|
|
538
538
|
if (i === "__proto__") return !0;
|
|
539
|
-
const a = Number.isFinite(+i),
|
|
540
|
-
return i = !i && c.isArray(s) ? s.length : i,
|
|
539
|
+
const a = Number.isFinite(+i), f = o >= r.length;
|
|
540
|
+
return i = !i && c.isArray(s) ? s.length : i, f ? (c.hasOwnProp(s, i) ? s[i] = [s[i], n] : s[i] = n, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), t(r, n, s[i], o) && c.isArray(s[i]) && (s[i] = Ar(s[i])), !a);
|
|
541
541
|
}
|
|
542
542
|
if (c.isFormData(e) && c.isFunction(e.entries)) {
|
|
543
|
-
const
|
|
544
|
-
return c.forEachEntry(e, (
|
|
545
|
-
t(
|
|
546
|
-
}),
|
|
543
|
+
const r = {};
|
|
544
|
+
return c.forEachEntry(e, (n, s) => {
|
|
545
|
+
t(Tr(n), s, r, 0);
|
|
546
|
+
}), r;
|
|
547
547
|
}
|
|
548
548
|
return null;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Cr(e, t, r) {
|
|
551
551
|
if (c.isString(e))
|
|
552
552
|
try {
|
|
553
553
|
return (t || JSON.parse)(e), c.trim(e);
|
|
554
|
-
} catch (
|
|
555
|
-
if (
|
|
556
|
-
throw
|
|
554
|
+
} catch (n) {
|
|
555
|
+
if (n.name !== "SyntaxError")
|
|
556
|
+
throw n;
|
|
557
557
|
}
|
|
558
|
-
return (
|
|
558
|
+
return (r || JSON.stringify)(e);
|
|
559
559
|
}
|
|
560
560
|
const X = {
|
|
561
561
|
transitional: lt,
|
|
562
562
|
adapter: ["xhr", "http", "fetch"],
|
|
563
|
-
transformRequest: [function(t,
|
|
564
|
-
const
|
|
563
|
+
transformRequest: [function(t, r) {
|
|
564
|
+
const n = r.getContentType() || "", s = n.indexOf("application/json") > -1, o = c.isObject(t);
|
|
565
565
|
if (o && c.isHTMLForm(t) && (t = new FormData(t)), c.isFormData(t))
|
|
566
566
|
return s ? JSON.stringify(ut(t)) : t;
|
|
567
567
|
if (c.isArrayBuffer(t) || c.isBuffer(t) || c.isStream(t) || c.isFile(t) || c.isBlob(t) || c.isReadableStream(t))
|
|
@@ -569,33 +569,33 @@ const X = {
|
|
|
569
569
|
if (c.isArrayBufferView(t))
|
|
570
570
|
return t.buffer;
|
|
571
571
|
if (c.isURLSearchParams(t))
|
|
572
|
-
return
|
|
572
|
+
return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
573
573
|
let a;
|
|
574
574
|
if (o) {
|
|
575
|
-
if (
|
|
576
|
-
return
|
|
577
|
-
if ((a = c.isFileList(t)) ||
|
|
578
|
-
const
|
|
575
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
576
|
+
return Or(t, this.formSerializer).toString();
|
|
577
|
+
if ((a = c.isFileList(t)) || n.indexOf("multipart/form-data") > -1) {
|
|
578
|
+
const f = this.env && this.env.FormData;
|
|
579
579
|
return le(
|
|
580
580
|
a ? { "files[]": t } : t,
|
|
581
|
-
|
|
581
|
+
f && new f(),
|
|
582
582
|
this.formSerializer
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
return o || s ? (
|
|
586
|
+
return o || s ? (r.setContentType("application/json", !1), Cr(t)) : t;
|
|
587
587
|
}],
|
|
588
588
|
transformResponse: [function(t) {
|
|
589
|
-
const
|
|
589
|
+
const r = this.transitional || X.transitional, n = r && r.forcedJSONParsing, s = this.responseType === "json";
|
|
590
590
|
if (c.isResponse(t) || c.isReadableStream(t))
|
|
591
591
|
return t;
|
|
592
|
-
if (t && c.isString(t) && (
|
|
593
|
-
const i = !(
|
|
592
|
+
if (t && c.isString(t) && (n && !this.responseType || s)) {
|
|
593
|
+
const i = !(r && r.silentJSONParsing) && s;
|
|
594
594
|
try {
|
|
595
595
|
return JSON.parse(t, this.parseReviver);
|
|
596
596
|
} catch (a) {
|
|
597
597
|
if (i)
|
|
598
|
-
throw a.name === "SyntaxError" ?
|
|
598
|
+
throw a.name === "SyntaxError" ? g.from(a, g.ERR_BAD_RESPONSE, this, null, this.response) : a;
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
return t;
|
|
@@ -610,8 +610,8 @@ const X = {
|
|
|
610
610
|
maxContentLength: -1,
|
|
611
611
|
maxBodyLength: -1,
|
|
612
612
|
env: {
|
|
613
|
-
FormData:
|
|
614
|
-
Blob:
|
|
613
|
+
FormData: T.classes.FormData,
|
|
614
|
+
Blob: T.classes.Blob
|
|
615
615
|
},
|
|
616
616
|
validateStatus: function(t) {
|
|
617
617
|
return t >= 200 && t < 300;
|
|
@@ -626,7 +626,7 @@ const X = {
|
|
|
626
626
|
c.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
627
627
|
X.headers[e] = {};
|
|
628
628
|
});
|
|
629
|
-
const
|
|
629
|
+
const Nr = c.toObjectSet([
|
|
630
630
|
"age",
|
|
631
631
|
"authorization",
|
|
632
632
|
"content-length",
|
|
@@ -644,152 +644,152 @@ const Pn = c.toObjectSet([
|
|
|
644
644
|
"referer",
|
|
645
645
|
"retry-after",
|
|
646
646
|
"user-agent"
|
|
647
|
-
]),
|
|
647
|
+
]), kr = (e) => {
|
|
648
648
|
const t = {};
|
|
649
|
-
let
|
|
649
|
+
let r, n, s;
|
|
650
650
|
return e && e.split(`
|
|
651
651
|
`).forEach(function(i) {
|
|
652
|
-
s = i.indexOf(":"),
|
|
652
|
+
s = i.indexOf(":"), r = i.substring(0, s).trim().toLowerCase(), n = i.substring(s + 1).trim(), !(!r || t[r] && Nr[r]) && (r === "set-cookie" ? t[r] ? t[r].push(n) : t[r] = [n] : t[r] = t[r] ? t[r] + ", " + n : n);
|
|
653
653
|
}), t;
|
|
654
|
-
},
|
|
655
|
-
function
|
|
654
|
+
}, ve = Symbol("internals");
|
|
655
|
+
function z(e) {
|
|
656
656
|
return e && String(e).trim().toLowerCase();
|
|
657
657
|
}
|
|
658
|
-
function
|
|
659
|
-
return e === !1 || e == null ? e : c.isArray(e) ? e.map(
|
|
658
|
+
function ne(e) {
|
|
659
|
+
return e === !1 || e == null ? e : c.isArray(e) ? e.map(ne) : String(e);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
662
|
-
const t = /* @__PURE__ */ Object.create(null),
|
|
663
|
-
let
|
|
664
|
-
for (;
|
|
665
|
-
t[
|
|
661
|
+
function Pr(e) {
|
|
662
|
+
const t = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
663
|
+
let n;
|
|
664
|
+
for (; n = r.exec(e); )
|
|
665
|
+
t[n[1]] = n[2];
|
|
666
666
|
return t;
|
|
667
667
|
}
|
|
668
|
-
const
|
|
669
|
-
function pe(e, t,
|
|
670
|
-
if (c.isFunction(
|
|
671
|
-
return
|
|
672
|
-
if (s && (t =
|
|
673
|
-
if (c.isString(
|
|
674
|
-
return t.indexOf(
|
|
675
|
-
if (c.isRegExp(
|
|
676
|
-
return
|
|
668
|
+
const Ur = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
669
|
+
function pe(e, t, r, n, s) {
|
|
670
|
+
if (c.isFunction(n))
|
|
671
|
+
return n.call(this, t, r);
|
|
672
|
+
if (s && (t = r), !!c.isString(t)) {
|
|
673
|
+
if (c.isString(n))
|
|
674
|
+
return t.indexOf(n) !== -1;
|
|
675
|
+
if (c.isRegExp(n))
|
|
676
|
+
return n.test(t);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t,
|
|
679
|
+
function Dr(e) {
|
|
680
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, r, n) => r.toUpperCase() + n);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
const
|
|
684
|
-
["get", "set", "has"].forEach((
|
|
685
|
-
Object.defineProperty(e,
|
|
682
|
+
function Fr(e, t) {
|
|
683
|
+
const r = c.toCamelCase(" " + t);
|
|
684
|
+
["get", "set", "has"].forEach((n) => {
|
|
685
|
+
Object.defineProperty(e, n + r, {
|
|
686
686
|
value: function(s, o, i) {
|
|
687
|
-
return this[
|
|
687
|
+
return this[n].call(this, t, s, o, i);
|
|
688
688
|
},
|
|
689
689
|
configurable: !0
|
|
690
690
|
});
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
-
let
|
|
693
|
+
let C = class {
|
|
694
694
|
constructor(t) {
|
|
695
695
|
t && this.set(t);
|
|
696
696
|
}
|
|
697
|
-
set(t,
|
|
697
|
+
set(t, r, n) {
|
|
698
698
|
const s = this;
|
|
699
|
-
function o(a,
|
|
700
|
-
const l =
|
|
699
|
+
function o(a, f, u) {
|
|
700
|
+
const l = z(f);
|
|
701
701
|
if (!l)
|
|
702
702
|
throw new Error("header name must be a non-empty string");
|
|
703
703
|
const p = c.findKey(s, l);
|
|
704
|
-
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p ||
|
|
704
|
+
(!p || s[p] === void 0 || u === !0 || u === void 0 && s[p] !== !1) && (s[p || f] = ne(a));
|
|
705
705
|
}
|
|
706
|
-
const i = (a,
|
|
706
|
+
const i = (a, f) => c.forEach(a, (u, l) => o(u, l, f));
|
|
707
707
|
if (c.isPlainObject(t) || t instanceof this.constructor)
|
|
708
|
-
i(t,
|
|
709
|
-
else if (c.isString(t) && (t = t.trim()) && !
|
|
710
|
-
i(
|
|
708
|
+
i(t, r);
|
|
709
|
+
else if (c.isString(t) && (t = t.trim()) && !Ur(t))
|
|
710
|
+
i(kr(t), r);
|
|
711
711
|
else if (c.isObject(t) && c.isIterable(t)) {
|
|
712
|
-
let a = {},
|
|
712
|
+
let a = {}, f, u;
|
|
713
713
|
for (const l of t) {
|
|
714
714
|
if (!c.isArray(l))
|
|
715
715
|
throw TypeError("Object iterator must return a key-value pair");
|
|
716
|
-
a[u = l[0]] = (
|
|
716
|
+
a[u = l[0]] = (f = a[u]) ? c.isArray(f) ? [...f, l[1]] : [f, l[1]] : l[1];
|
|
717
717
|
}
|
|
718
|
-
i(a,
|
|
718
|
+
i(a, r);
|
|
719
719
|
} else
|
|
720
|
-
t != null && o(
|
|
720
|
+
t != null && o(r, t, n);
|
|
721
721
|
return this;
|
|
722
722
|
}
|
|
723
|
-
get(t,
|
|
724
|
-
if (t =
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
727
|
-
const s = this[
|
|
728
|
-
if (!
|
|
723
|
+
get(t, r) {
|
|
724
|
+
if (t = z(t), t) {
|
|
725
|
+
const n = c.findKey(this, t);
|
|
726
|
+
if (n) {
|
|
727
|
+
const s = this[n];
|
|
728
|
+
if (!r)
|
|
729
729
|
return s;
|
|
730
|
-
if (
|
|
731
|
-
return
|
|
732
|
-
if (c.isFunction(
|
|
733
|
-
return
|
|
734
|
-
if (c.isRegExp(
|
|
735
|
-
return
|
|
730
|
+
if (r === !0)
|
|
731
|
+
return Pr(s);
|
|
732
|
+
if (c.isFunction(r))
|
|
733
|
+
return r.call(this, s, n);
|
|
734
|
+
if (c.isRegExp(r))
|
|
735
|
+
return r.exec(s);
|
|
736
736
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
739
|
}
|
|
740
|
-
has(t,
|
|
741
|
-
if (t =
|
|
742
|
-
const
|
|
743
|
-
return !!(
|
|
740
|
+
has(t, r) {
|
|
741
|
+
if (t = z(t), t) {
|
|
742
|
+
const n = c.findKey(this, t);
|
|
743
|
+
return !!(n && this[n] !== void 0 && (!r || pe(this, this[n], n, r)));
|
|
744
744
|
}
|
|
745
745
|
return !1;
|
|
746
746
|
}
|
|
747
|
-
delete(t,
|
|
748
|
-
const
|
|
747
|
+
delete(t, r) {
|
|
748
|
+
const n = this;
|
|
749
749
|
let s = !1;
|
|
750
750
|
function o(i) {
|
|
751
|
-
if (i =
|
|
752
|
-
const a = c.findKey(
|
|
753
|
-
a && (!
|
|
751
|
+
if (i = z(i), i) {
|
|
752
|
+
const a = c.findKey(n, i);
|
|
753
|
+
a && (!r || pe(n, n[a], a, r)) && (delete n[a], s = !0);
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
return c.isArray(t) ? t.forEach(o) : o(t), s;
|
|
757
757
|
}
|
|
758
758
|
clear(t) {
|
|
759
|
-
const
|
|
760
|
-
let
|
|
761
|
-
for (;
|
|
762
|
-
const o = n
|
|
759
|
+
const r = Object.keys(this);
|
|
760
|
+
let n = r.length, s = !1;
|
|
761
|
+
for (; n--; ) {
|
|
762
|
+
const o = r[n];
|
|
763
763
|
(!t || pe(this, this[o], o, t, !0)) && (delete this[o], s = !0);
|
|
764
764
|
}
|
|
765
765
|
return s;
|
|
766
766
|
}
|
|
767
767
|
normalize(t) {
|
|
768
|
-
const
|
|
768
|
+
const r = this, n = {};
|
|
769
769
|
return c.forEach(this, (s, o) => {
|
|
770
|
-
const i = c.findKey(
|
|
770
|
+
const i = c.findKey(n, o);
|
|
771
771
|
if (i) {
|
|
772
|
-
|
|
772
|
+
r[i] = ne(s), delete r[o];
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
|
-
const a = t ?
|
|
776
|
-
a !== o && delete
|
|
775
|
+
const a = t ? Dr(o) : String(o).trim();
|
|
776
|
+
a !== o && delete r[o], r[a] = ne(s), n[a] = !0;
|
|
777
777
|
}), this;
|
|
778
778
|
}
|
|
779
779
|
concat(...t) {
|
|
780
780
|
return this.constructor.concat(this, ...t);
|
|
781
781
|
}
|
|
782
782
|
toJSON(t) {
|
|
783
|
-
const
|
|
784
|
-
return c.forEach(this, (
|
|
785
|
-
|
|
786
|
-
}),
|
|
783
|
+
const r = /* @__PURE__ */ Object.create(null);
|
|
784
|
+
return c.forEach(this, (n, s) => {
|
|
785
|
+
n != null && n !== !1 && (r[s] = t && c.isArray(n) ? n.join(", ") : n);
|
|
786
|
+
}), r;
|
|
787
787
|
}
|
|
788
788
|
[Symbol.iterator]() {
|
|
789
789
|
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
790
790
|
}
|
|
791
791
|
toString() {
|
|
792
|
-
return Object.entries(this.toJSON()).map(([t,
|
|
792
|
+
return Object.entries(this.toJSON()).map(([t, r]) => t + ": " + r).join(`
|
|
793
793
|
`);
|
|
794
794
|
}
|
|
795
795
|
getSetCookie() {
|
|
@@ -801,43 +801,43 @@ let N = class {
|
|
|
801
801
|
static from(t) {
|
|
802
802
|
return t instanceof this ? t : new this(t);
|
|
803
803
|
}
|
|
804
|
-
static concat(t, ...
|
|
805
|
-
const
|
|
806
|
-
return
|
|
804
|
+
static concat(t, ...r) {
|
|
805
|
+
const n = new this(t);
|
|
806
|
+
return r.forEach((s) => n.set(s)), n;
|
|
807
807
|
}
|
|
808
808
|
static accessor(t) {
|
|
809
|
-
const
|
|
809
|
+
const n = (this[ve] = this[ve] = {
|
|
810
810
|
accessors: {}
|
|
811
811
|
}).accessors, s = this.prototype;
|
|
812
812
|
function o(i) {
|
|
813
|
-
const a =
|
|
814
|
-
|
|
813
|
+
const a = z(i);
|
|
814
|
+
n[a] || (Fr(s, i), n[a] = !0);
|
|
815
815
|
}
|
|
816
816
|
return c.isArray(t) ? t.forEach(o) : o(t), this;
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
|
-
|
|
820
|
-
c.reduceDescriptors(
|
|
821
|
-
let
|
|
819
|
+
C.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
820
|
+
c.reduceDescriptors(C.prototype, ({ value: e }, t) => {
|
|
821
|
+
let r = t[0].toUpperCase() + t.slice(1);
|
|
822
822
|
return {
|
|
823
823
|
get: () => e,
|
|
824
|
-
set(
|
|
825
|
-
this[
|
|
824
|
+
set(n) {
|
|
825
|
+
this[r] = n;
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
828
|
});
|
|
829
|
-
c.freezeMethods(
|
|
829
|
+
c.freezeMethods(C);
|
|
830
830
|
function me(e, t) {
|
|
831
|
-
const
|
|
832
|
-
let o =
|
|
831
|
+
const r = this || X, n = t || r, s = C.from(n.headers);
|
|
832
|
+
let o = n.data;
|
|
833
833
|
return c.forEach(e, function(a) {
|
|
834
|
-
o = a.call(
|
|
834
|
+
o = a.call(r, o, s.normalize(), t ? t.status : void 0);
|
|
835
835
|
}), s.normalize(), o;
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function dt(e) {
|
|
838
838
|
return !!(e && e.__CANCEL__);
|
|
839
839
|
}
|
|
840
|
-
let G = class extends
|
|
840
|
+
let G = class extends g {
|
|
841
841
|
/**
|
|
842
842
|
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
843
843
|
*
|
|
@@ -847,63 +847,63 @@ let G = class extends w {
|
|
|
847
847
|
*
|
|
848
848
|
* @returns {CanceledError} The created error.
|
|
849
849
|
*/
|
|
850
|
-
constructor(t,
|
|
851
|
-
super(t ?? "canceled",
|
|
850
|
+
constructor(t, r, n) {
|
|
851
|
+
super(t ?? "canceled", g.ERR_CANCELED, r, n), this.name = "CanceledError", this.__CANCEL__ = !0;
|
|
852
852
|
}
|
|
853
853
|
};
|
|
854
|
-
function
|
|
855
|
-
const
|
|
856
|
-
!
|
|
857
|
-
"Request failed with status code " +
|
|
858
|
-
[
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
854
|
+
function ft(e, t, r) {
|
|
855
|
+
const n = r.config.validateStatus;
|
|
856
|
+
!r.status || !n || n(r.status) ? e(r) : t(new g(
|
|
857
|
+
"Request failed with status code " + r.status,
|
|
858
|
+
[g.ERR_BAD_REQUEST, g.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
|
|
859
|
+
r.config,
|
|
860
|
+
r.request,
|
|
861
|
+
r
|
|
862
862
|
));
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Lr(e) {
|
|
865
865
|
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
866
866
|
return t && t[1] || "";
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function vr(e, t) {
|
|
869
869
|
e = e || 10;
|
|
870
|
-
const
|
|
870
|
+
const r = new Array(e), n = new Array(e);
|
|
871
871
|
let s = 0, o = 0, i;
|
|
872
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
873
|
-
const u = Date.now(), l =
|
|
874
|
-
i || (i = u),
|
|
875
|
-
let p = o,
|
|
872
|
+
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
873
|
+
const u = Date.now(), l = n[o];
|
|
874
|
+
i || (i = u), r[s] = f, n[s] = u;
|
|
875
|
+
let p = o, y = 0;
|
|
876
876
|
for (; p !== s; )
|
|
877
|
-
|
|
877
|
+
y += r[p++], p = p % e;
|
|
878
878
|
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
879
879
|
return;
|
|
880
|
-
const
|
|
881
|
-
return
|
|
880
|
+
const R = l && u - l;
|
|
881
|
+
return R ? Math.round(y * 1e3 / R) : void 0;
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
|
-
function
|
|
885
|
-
let
|
|
884
|
+
function Br(e, t) {
|
|
885
|
+
let r = 0, n = 1e3 / t, s, o;
|
|
886
886
|
const i = (u, l = Date.now()) => {
|
|
887
|
-
|
|
887
|
+
r = l, s = null, o && (clearTimeout(o), o = null), e(...u);
|
|
888
888
|
};
|
|
889
889
|
return [(...u) => {
|
|
890
|
-
const l = Date.now(), p = l -
|
|
891
|
-
p >=
|
|
890
|
+
const l = Date.now(), p = l - r;
|
|
891
|
+
p >= n ? i(u, l) : (s = u, o || (o = setTimeout(() => {
|
|
892
892
|
o = null, i(s);
|
|
893
|
-
},
|
|
893
|
+
}, n - p)));
|
|
894
894
|
}, () => s && i(s)];
|
|
895
895
|
}
|
|
896
|
-
const oe = (e, t,
|
|
897
|
-
let
|
|
898
|
-
const s =
|
|
899
|
-
return
|
|
900
|
-
const i = o.loaded, a = o.lengthComputable ? o.total : void 0,
|
|
901
|
-
|
|
896
|
+
const oe = (e, t, r = 3) => {
|
|
897
|
+
let n = 0;
|
|
898
|
+
const s = vr(50, 250);
|
|
899
|
+
return Br((o) => {
|
|
900
|
+
const i = o.loaded, a = o.lengthComputable ? o.total : void 0, f = i - n, u = s(f), l = i <= a;
|
|
901
|
+
n = i;
|
|
902
902
|
const p = {
|
|
903
903
|
loaded: i,
|
|
904
904
|
total: a,
|
|
905
905
|
progress: a ? i / a : void 0,
|
|
906
|
-
bytes:
|
|
906
|
+
bytes: f,
|
|
907
907
|
rate: u || void 0,
|
|
908
908
|
estimated: u && a && l ? (a - i) / u : void 0,
|
|
909
909
|
event: o,
|
|
@@ -911,24 +911,24 @@ const oe = (e, t, n = 3) => {
|
|
|
911
911
|
[t ? "download" : "upload"]: !0
|
|
912
912
|
};
|
|
913
913
|
e(p);
|
|
914
|
-
},
|
|
914
|
+
}, r);
|
|
915
915
|
}, Be = (e, t) => {
|
|
916
|
-
const
|
|
917
|
-
return [(
|
|
918
|
-
lengthComputable:
|
|
916
|
+
const r = e != null;
|
|
917
|
+
return [(n) => t[0]({
|
|
918
|
+
lengthComputable: r,
|
|
919
919
|
total: e,
|
|
920
|
-
loaded:
|
|
920
|
+
loaded: n
|
|
921
921
|
}), t[1]];
|
|
922
|
-
}, Ie = (e) => (...t) => c.asap(() => e(...t)),
|
|
923
|
-
new URL(
|
|
924
|
-
|
|
925
|
-
) : () => !0,
|
|
922
|
+
}, Ie = (e) => (...t) => c.asap(() => e(...t)), Ir = T.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (r) => (r = new URL(r, T.origin), e.protocol === r.protocol && e.host === r.host && (t || e.port === r.port)))(
|
|
923
|
+
new URL(T.origin),
|
|
924
|
+
T.navigator && /(msie|trident)/i.test(T.navigator.userAgent)
|
|
925
|
+
) : () => !0, jr = T.hasStandardBrowserEnv ? (
|
|
926
926
|
// Standard browser envs support document.cookie
|
|
927
927
|
{
|
|
928
|
-
write(e, t,
|
|
928
|
+
write(e, t, r, n, s, o, i) {
|
|
929
929
|
if (typeof document > "u") return;
|
|
930
930
|
const a = [`${e}=${encodeURIComponent(t)}`];
|
|
931
|
-
c.isNumber(
|
|
931
|
+
c.isNumber(r) && a.push(`expires=${new Date(r).toUTCString()}`), c.isString(n) && a.push(`path=${n}`), c.isString(s) && a.push(`domain=${s}`), o === !0 && a.push("secure"), c.isString(i) && a.push(`SameSite=${i}`), document.cookie = a.join("; ");
|
|
932
932
|
},
|
|
933
933
|
read(e) {
|
|
934
934
|
if (typeof document > "u") return null;
|
|
@@ -951,46 +951,46 @@ const oe = (e, t, n = 3) => {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
);
|
|
954
|
-
function
|
|
954
|
+
function Mr(e) {
|
|
955
955
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function $r(e, t) {
|
|
958
958
|
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
959
959
|
}
|
|
960
|
-
function pt(e, t,
|
|
961
|
-
let
|
|
962
|
-
return e && (
|
|
960
|
+
function pt(e, t, r) {
|
|
961
|
+
let n = !Mr(t);
|
|
962
|
+
return e && (n || r == !1) ? $r(e, t) : t;
|
|
963
963
|
}
|
|
964
|
-
const je = (e) => e instanceof
|
|
965
|
-
function
|
|
964
|
+
const je = (e) => e instanceof C ? { ...e } : e;
|
|
965
|
+
function j(e, t) {
|
|
966
966
|
t = t || {};
|
|
967
|
-
const
|
|
968
|
-
function
|
|
969
|
-
return c.isPlainObject(u) && c.isPlainObject(l) ? c.merge.call({ caseless:
|
|
967
|
+
const r = {};
|
|
968
|
+
function n(u, l, p, y) {
|
|
969
|
+
return c.isPlainObject(u) && c.isPlainObject(l) ? c.merge.call({ caseless: y }, u, l) : c.isPlainObject(l) ? c.merge({}, l) : c.isArray(l) ? l.slice() : l;
|
|
970
970
|
}
|
|
971
|
-
function s(u, l, p,
|
|
971
|
+
function s(u, l, p, y) {
|
|
972
972
|
if (c.isUndefined(l)) {
|
|
973
973
|
if (!c.isUndefined(u))
|
|
974
|
-
return
|
|
975
|
-
} else return
|
|
974
|
+
return n(void 0, u, p, y);
|
|
975
|
+
} else return n(u, l, p, y);
|
|
976
976
|
}
|
|
977
977
|
function o(u, l) {
|
|
978
978
|
if (!c.isUndefined(l))
|
|
979
|
-
return
|
|
979
|
+
return n(void 0, l);
|
|
980
980
|
}
|
|
981
981
|
function i(u, l) {
|
|
982
982
|
if (c.isUndefined(l)) {
|
|
983
983
|
if (!c.isUndefined(u))
|
|
984
|
-
return
|
|
985
|
-
} else return
|
|
984
|
+
return n(void 0, u);
|
|
985
|
+
} else return n(void 0, l);
|
|
986
986
|
}
|
|
987
987
|
function a(u, l, p) {
|
|
988
988
|
if (p in t)
|
|
989
|
-
return
|
|
989
|
+
return n(u, l);
|
|
990
990
|
if (p in e)
|
|
991
|
-
return
|
|
991
|
+
return n(void 0, u);
|
|
992
992
|
}
|
|
993
|
-
const
|
|
993
|
+
const f = {
|
|
994
994
|
url: o,
|
|
995
995
|
method: o,
|
|
996
996
|
data: o,
|
|
@@ -1022,102 +1022,102 @@ function $(e, t) {
|
|
|
1022
1022
|
headers: (u, l, p) => s(je(u), je(l), p, !0)
|
|
1023
1023
|
};
|
|
1024
1024
|
return c.forEach(Object.keys({ ...e, ...t }), function(l) {
|
|
1025
|
-
const p =
|
|
1026
|
-
c.isUndefined(
|
|
1027
|
-
}),
|
|
1025
|
+
const p = f[l] || s, y = p(e[l], t[l], l);
|
|
1026
|
+
c.isUndefined(y) && p !== a || (r[l] = y);
|
|
1027
|
+
}), r;
|
|
1028
1028
|
}
|
|
1029
1029
|
const mt = (e) => {
|
|
1030
|
-
const t =
|
|
1031
|
-
let { data:
|
|
1032
|
-
if (t.headers = i =
|
|
1030
|
+
const t = j({}, e);
|
|
1031
|
+
let { data: r, withXSRFToken: n, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = t;
|
|
1032
|
+
if (t.headers = i = C.from(i), t.url = ct(pt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
|
|
1033
1033
|
"Authorization",
|
|
1034
1034
|
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
1035
|
-
), c.isFormData(
|
|
1036
|
-
if (
|
|
1035
|
+
), c.isFormData(r)) {
|
|
1036
|
+
if (T.hasStandardBrowserEnv || T.hasStandardBrowserWebWorkerEnv)
|
|
1037
1037
|
i.setContentType(void 0);
|
|
1038
|
-
else if (c.isFunction(
|
|
1039
|
-
const
|
|
1040
|
-
Object.entries(
|
|
1038
|
+
else if (c.isFunction(r.getHeaders)) {
|
|
1039
|
+
const f = r.getHeaders(), u = ["content-type", "content-length"];
|
|
1040
|
+
Object.entries(f).forEach(([l, p]) => {
|
|
1041
1041
|
u.includes(l.toLowerCase()) && i.set(l, p);
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
if (
|
|
1046
|
-
const
|
|
1047
|
-
|
|
1045
|
+
if (T.hasStandardBrowserEnv && (n && c.isFunction(n) && (n = n(t)), n || n !== !1 && Ir(t.url))) {
|
|
1046
|
+
const f = s && o && jr.read(o);
|
|
1047
|
+
f && i.set(s, f);
|
|
1048
1048
|
}
|
|
1049
1049
|
return t;
|
|
1050
|
-
},
|
|
1051
|
-
return new Promise(function(
|
|
1050
|
+
}, Hr = typeof XMLHttpRequest < "u", qr = Hr && function(e) {
|
|
1051
|
+
return new Promise(function(r, n) {
|
|
1052
1052
|
const s = mt(e);
|
|
1053
1053
|
let o = s.data;
|
|
1054
|
-
const i =
|
|
1055
|
-
let { responseType: a, onUploadProgress:
|
|
1054
|
+
const i = C.from(s.headers).normalize();
|
|
1055
|
+
let { responseType: a, onUploadProgress: f, onDownloadProgress: u } = s, l, p, y, R, d;
|
|
1056
1056
|
function h() {
|
|
1057
|
-
|
|
1057
|
+
R && R(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1058
1058
|
}
|
|
1059
1059
|
let m = new XMLHttpRequest();
|
|
1060
1060
|
m.open(s.method.toUpperCase(), s.url, !0), m.timeout = s.timeout;
|
|
1061
|
-
function
|
|
1061
|
+
function E() {
|
|
1062
1062
|
if (!m)
|
|
1063
1063
|
return;
|
|
1064
|
-
const
|
|
1064
|
+
const x = C.from(
|
|
1065
1065
|
"getAllResponseHeaders" in m && m.getAllResponseHeaders()
|
|
1066
|
-
),
|
|
1066
|
+
), O = {
|
|
1067
1067
|
data: !a || a === "text" || a === "json" ? m.responseText : m.response,
|
|
1068
1068
|
status: m.status,
|
|
1069
1069
|
statusText: m.statusText,
|
|
1070
|
-
headers:
|
|
1070
|
+
headers: x,
|
|
1071
1071
|
config: e,
|
|
1072
1072
|
request: m
|
|
1073
1073
|
};
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
}, function(
|
|
1077
|
-
|
|
1078
|
-
},
|
|
1074
|
+
ft(function(N) {
|
|
1075
|
+
r(N), h();
|
|
1076
|
+
}, function(N) {
|
|
1077
|
+
n(N), h();
|
|
1078
|
+
}, O), m = null;
|
|
1079
1079
|
}
|
|
1080
|
-
"onloadend" in m ? m.onloadend =
|
|
1081
|
-
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1080
|
+
"onloadend" in m ? m.onloadend = E : m.onreadystatechange = function() {
|
|
1081
|
+
!m || m.readyState !== 4 || m.status === 0 && !(m.responseURL && m.responseURL.indexOf("file:") === 0) || setTimeout(E);
|
|
1082
1082
|
}, m.onabort = function() {
|
|
1083
|
-
m && (
|
|
1084
|
-
}, m.onerror = function(
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1083
|
+
m && (n(new g("Request aborted", g.ECONNABORTED, e, m)), m = null);
|
|
1084
|
+
}, m.onerror = function(b) {
|
|
1085
|
+
const O = b && b.message ? b.message : "Network Error", D = new g(O, g.ERR_NETWORK, e, m);
|
|
1086
|
+
D.event = b || null, n(D), m = null;
|
|
1087
1087
|
}, m.ontimeout = function() {
|
|
1088
|
-
let
|
|
1089
|
-
const
|
|
1090
|
-
s.timeoutErrorMessage && (
|
|
1091
|
-
|
|
1092
|
-
|
|
1088
|
+
let b = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1089
|
+
const O = s.transitional || lt;
|
|
1090
|
+
s.timeoutErrorMessage && (b = s.timeoutErrorMessage), n(new g(
|
|
1091
|
+
b,
|
|
1092
|
+
O.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
|
|
1093
1093
|
e,
|
|
1094
1094
|
m
|
|
1095
1095
|
)), m = null;
|
|
1096
|
-
}, o === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(
|
|
1097
|
-
m.setRequestHeader(
|
|
1098
|
-
}), c.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), a && a !== "json" && (m.responseType = s.responseType), u && ([
|
|
1099
|
-
m && (
|
|
1096
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in m && c.forEach(i.toJSON(), function(b, O) {
|
|
1097
|
+
m.setRequestHeader(O, b);
|
|
1098
|
+
}), c.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), a && a !== "json" && (m.responseType = s.responseType), u && ([y, d] = oe(u, !0), m.addEventListener("progress", y)), f && m.upload && ([p, R] = oe(f), m.upload.addEventListener("progress", p), m.upload.addEventListener("loadend", R)), (s.cancelToken || s.signal) && (l = (x) => {
|
|
1099
|
+
m && (n(!x || x.type ? new G(null, e, m) : x), m.abort(), m = null);
|
|
1100
1100
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1101
|
-
const
|
|
1102
|
-
if (
|
|
1103
|
-
|
|
1101
|
+
const _ = Lr(s.url);
|
|
1102
|
+
if (_ && T.protocols.indexOf(_) === -1) {
|
|
1103
|
+
n(new g("Unsupported protocol " + _ + ":", g.ERR_BAD_REQUEST, e));
|
|
1104
1104
|
return;
|
|
1105
1105
|
}
|
|
1106
1106
|
m.send(o || null);
|
|
1107
1107
|
});
|
|
1108
|
-
},
|
|
1109
|
-
const { length:
|
|
1110
|
-
if (t ||
|
|
1111
|
-
let
|
|
1108
|
+
}, zr = (e, t) => {
|
|
1109
|
+
const { length: r } = e = e ? e.filter(Boolean) : [];
|
|
1110
|
+
if (t || r) {
|
|
1111
|
+
let n = new AbortController(), s;
|
|
1112
1112
|
const o = function(u) {
|
|
1113
1113
|
if (!s) {
|
|
1114
1114
|
s = !0, a();
|
|
1115
1115
|
const l = u instanceof Error ? u : this.reason;
|
|
1116
|
-
|
|
1116
|
+
n.abort(l instanceof g ? l : new G(l instanceof Error ? l.message : l));
|
|
1117
1117
|
}
|
|
1118
1118
|
};
|
|
1119
1119
|
let i = t && setTimeout(() => {
|
|
1120
|
-
i = null, o(new
|
|
1120
|
+
i = null, o(new g(`timeout of ${t}ms exceeded`, g.ETIMEDOUT));
|
|
1121
1121
|
}, t);
|
|
1122
1122
|
const a = () => {
|
|
1123
1123
|
e && (i && clearTimeout(i), i = null, e.forEach((u) => {
|
|
@@ -1125,22 +1125,22 @@ const mt = (e) => {
|
|
|
1125
1125
|
}), e = null);
|
|
1126
1126
|
};
|
|
1127
1127
|
e.forEach((u) => u.addEventListener("abort", o));
|
|
1128
|
-
const { signal:
|
|
1129
|
-
return
|
|
1128
|
+
const { signal: f } = n;
|
|
1129
|
+
return f.unsubscribe = () => c.asap(a), f;
|
|
1130
1130
|
}
|
|
1131
|
-
},
|
|
1132
|
-
let
|
|
1133
|
-
if (
|
|
1131
|
+
}, Jr = function* (e, t) {
|
|
1132
|
+
let r = e.byteLength;
|
|
1133
|
+
if (r < t) {
|
|
1134
1134
|
yield e;
|
|
1135
1135
|
return;
|
|
1136
1136
|
}
|
|
1137
|
-
let
|
|
1138
|
-
for (;
|
|
1139
|
-
s =
|
|
1140
|
-
},
|
|
1141
|
-
for await (const
|
|
1142
|
-
yield*
|
|
1143
|
-
},
|
|
1137
|
+
let n = 0, s;
|
|
1138
|
+
for (; n < r; )
|
|
1139
|
+
s = n + t, yield e.slice(n, s), n = s;
|
|
1140
|
+
}, Kr = async function* (e, t) {
|
|
1141
|
+
for await (const r of Vr(e))
|
|
1142
|
+
yield* Jr(r, t);
|
|
1143
|
+
}, Vr = async function* (e) {
|
|
1144
1144
|
if (e[Symbol.asyncIterator]) {
|
|
1145
1145
|
yield* e;
|
|
1146
1146
|
return;
|
|
@@ -1148,44 +1148,44 @@ const mt = (e) => {
|
|
|
1148
1148
|
const t = e.getReader();
|
|
1149
1149
|
try {
|
|
1150
1150
|
for (; ; ) {
|
|
1151
|
-
const { done:
|
|
1152
|
-
if (
|
|
1151
|
+
const { done: r, value: n } = await t.read();
|
|
1152
|
+
if (r)
|
|
1153
1153
|
break;
|
|
1154
|
-
yield
|
|
1154
|
+
yield n;
|
|
1155
1155
|
}
|
|
1156
1156
|
} finally {
|
|
1157
1157
|
await t.cancel();
|
|
1158
1158
|
}
|
|
1159
|
-
},
|
|
1160
|
-
const s =
|
|
1161
|
-
let o = 0, i, a = (
|
|
1162
|
-
i || (i = !0,
|
|
1159
|
+
}, Me = (e, t, r, n) => {
|
|
1160
|
+
const s = Kr(e, t);
|
|
1161
|
+
let o = 0, i, a = (f) => {
|
|
1162
|
+
i || (i = !0, n && n(f));
|
|
1163
1163
|
};
|
|
1164
1164
|
return new ReadableStream({
|
|
1165
|
-
async pull(
|
|
1165
|
+
async pull(f) {
|
|
1166
1166
|
try {
|
|
1167
1167
|
const { done: u, value: l } = await s.next();
|
|
1168
1168
|
if (u) {
|
|
1169
|
-
a(),
|
|
1169
|
+
a(), f.close();
|
|
1170
1170
|
return;
|
|
1171
1171
|
}
|
|
1172
1172
|
let p = l.byteLength;
|
|
1173
|
-
if (
|
|
1174
|
-
let
|
|
1175
|
-
|
|
1173
|
+
if (r) {
|
|
1174
|
+
let y = o += p;
|
|
1175
|
+
r(y);
|
|
1176
1176
|
}
|
|
1177
|
-
|
|
1177
|
+
f.enqueue(new Uint8Array(l));
|
|
1178
1178
|
} catch (u) {
|
|
1179
1179
|
throw a(u), u;
|
|
1180
1180
|
}
|
|
1181
1181
|
},
|
|
1182
|
-
cancel(
|
|
1183
|
-
return a(
|
|
1182
|
+
cancel(f) {
|
|
1183
|
+
return a(f), s.return();
|
|
1184
1184
|
}
|
|
1185
1185
|
}, {
|
|
1186
1186
|
highWaterMark: 2
|
|
1187
1187
|
});
|
|
1188
|
-
},
|
|
1188
|
+
}, $e = 64 * 1024, { isFunction: te } = c, Wr = (({ Request: e, Response: t }) => ({
|
|
1189
1189
|
Request: e,
|
|
1190
1190
|
Response: t
|
|
1191
1191
|
}))(c.global), {
|
|
@@ -1197,159 +1197,159 @@ const mt = (e) => {
|
|
|
1197
1197
|
} catch {
|
|
1198
1198
|
return !1;
|
|
1199
1199
|
}
|
|
1200
|
-
},
|
|
1200
|
+
}, Xr = (e) => {
|
|
1201
1201
|
e = c.merge.call({
|
|
1202
1202
|
skipUndefined: !0
|
|
1203
|
-
},
|
|
1204
|
-
const { fetch: t, Request:
|
|
1203
|
+
}, Wr, e);
|
|
1204
|
+
const { fetch: t, Request: r, Response: n } = e, s = t ? te(t) : typeof fetch == "function", o = te(r), i = te(n);
|
|
1205
1205
|
if (!s)
|
|
1206
1206
|
return !1;
|
|
1207
|
-
const a = s && te(He),
|
|
1208
|
-
let
|
|
1209
|
-
const h = new
|
|
1207
|
+
const a = s && te(He), f = s && (typeof qe == "function" ? /* @__PURE__ */ ((d) => (h) => d.encode(h))(new qe()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), u = o && a && ze(() => {
|
|
1208
|
+
let d = !1;
|
|
1209
|
+
const h = new r(T.origin, {
|
|
1210
1210
|
body: new He(),
|
|
1211
1211
|
method: "POST",
|
|
1212
1212
|
get duplex() {
|
|
1213
|
-
return
|
|
1213
|
+
return d = !0, "half";
|
|
1214
1214
|
}
|
|
1215
1215
|
}).headers.has("Content-Type");
|
|
1216
|
-
return
|
|
1217
|
-
}), l = i && a && ze(() => c.isReadableStream(new
|
|
1218
|
-
stream: l && ((
|
|
1216
|
+
return d && !h;
|
|
1217
|
+
}), l = i && a && ze(() => c.isReadableStream(new n("").body)), p = {
|
|
1218
|
+
stream: l && ((d) => d.body)
|
|
1219
1219
|
};
|
|
1220
|
-
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1221
|
-
!p[
|
|
1222
|
-
let
|
|
1223
|
-
if (
|
|
1224
|
-
return
|
|
1225
|
-
throw new
|
|
1220
|
+
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1221
|
+
!p[d] && (p[d] = (h, m) => {
|
|
1222
|
+
let E = h && h[d];
|
|
1223
|
+
if (E)
|
|
1224
|
+
return E.call(h);
|
|
1225
|
+
throw new g(`Response type '${d}' is not supported`, g.ERR_NOT_SUPPORT, m);
|
|
1226
1226
|
});
|
|
1227
1227
|
});
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1228
|
+
const y = async (d) => {
|
|
1229
|
+
if (d == null)
|
|
1230
1230
|
return 0;
|
|
1231
|
-
if (c.isBlob(
|
|
1232
|
-
return
|
|
1233
|
-
if (c.isSpecCompliantForm(
|
|
1234
|
-
return (await new
|
|
1231
|
+
if (c.isBlob(d))
|
|
1232
|
+
return d.size;
|
|
1233
|
+
if (c.isSpecCompliantForm(d))
|
|
1234
|
+
return (await new r(T.origin, {
|
|
1235
1235
|
method: "POST",
|
|
1236
|
-
body:
|
|
1236
|
+
body: d
|
|
1237
1237
|
}).arrayBuffer()).byteLength;
|
|
1238
|
-
if (c.isArrayBufferView(
|
|
1239
|
-
return
|
|
1240
|
-
if (c.isURLSearchParams(
|
|
1241
|
-
return (await d
|
|
1242
|
-
},
|
|
1243
|
-
const m = c.toFiniteNumber(
|
|
1244
|
-
return m ??
|
|
1238
|
+
if (c.isArrayBufferView(d) || c.isArrayBuffer(d))
|
|
1239
|
+
return d.byteLength;
|
|
1240
|
+
if (c.isURLSearchParams(d) && (d = d + ""), c.isString(d))
|
|
1241
|
+
return (await f(d)).byteLength;
|
|
1242
|
+
}, R = async (d, h) => {
|
|
1243
|
+
const m = c.toFiniteNumber(d.getContentLength());
|
|
1244
|
+
return m ?? y(h);
|
|
1245
1245
|
};
|
|
1246
|
-
return async (
|
|
1246
|
+
return async (d) => {
|
|
1247
1247
|
let {
|
|
1248
1248
|
url: h,
|
|
1249
1249
|
method: m,
|
|
1250
|
-
data:
|
|
1251
|
-
signal:
|
|
1252
|
-
cancelToken:
|
|
1253
|
-
timeout:
|
|
1254
|
-
onDownloadProgress:
|
|
1255
|
-
onUploadProgress:
|
|
1256
|
-
responseType:
|
|
1257
|
-
headers:
|
|
1258
|
-
withCredentials:
|
|
1250
|
+
data: E,
|
|
1251
|
+
signal: _,
|
|
1252
|
+
cancelToken: x,
|
|
1253
|
+
timeout: b,
|
|
1254
|
+
onDownloadProgress: O,
|
|
1255
|
+
onUploadProgress: D,
|
|
1256
|
+
responseType: N,
|
|
1257
|
+
headers: de,
|
|
1258
|
+
withCredentials: Y = "same-origin",
|
|
1259
1259
|
fetchOptions: Oe
|
|
1260
|
-
} = mt(
|
|
1261
|
-
|
|
1262
|
-
let
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1260
|
+
} = mt(d), Te = t || fetch;
|
|
1261
|
+
N = N ? (N + "").toLowerCase() : "text";
|
|
1262
|
+
let Q = zr([_, x && x.toAbortSignal()], b), q = null;
|
|
1263
|
+
const v = Q && Q.unsubscribe && (() => {
|
|
1264
|
+
Q.unsubscribe();
|
|
1265
1265
|
});
|
|
1266
1266
|
let Ae;
|
|
1267
1267
|
try {
|
|
1268
|
-
if (
|
|
1269
|
-
let
|
|
1268
|
+
if (D && u && m !== "get" && m !== "head" && (Ae = await R(de, E)) !== 0) {
|
|
1269
|
+
let L = new r(h, {
|
|
1270
1270
|
method: "POST",
|
|
1271
|
-
body:
|
|
1271
|
+
body: E,
|
|
1272
1272
|
duplex: "half"
|
|
1273
1273
|
}), M;
|
|
1274
|
-
if (c.isFormData(
|
|
1275
|
-
const [
|
|
1274
|
+
if (c.isFormData(E) && (M = L.headers.get("content-type")) && de.setContentType(M), L.body) {
|
|
1275
|
+
const [fe, Z] = Be(
|
|
1276
1276
|
Ae,
|
|
1277
|
-
oe(Ie(
|
|
1277
|
+
oe(Ie(D))
|
|
1278
1278
|
);
|
|
1279
|
-
|
|
1279
|
+
E = Me(L.body, $e, fe, Z);
|
|
1280
1280
|
}
|
|
1281
1281
|
}
|
|
1282
|
-
c.isString(
|
|
1283
|
-
const
|
|
1282
|
+
c.isString(Y) || (Y = Y ? "include" : "omit");
|
|
1283
|
+
const P = o && "credentials" in r.prototype, Ce = {
|
|
1284
1284
|
...Oe,
|
|
1285
|
-
signal:
|
|
1285
|
+
signal: Q,
|
|
1286
1286
|
method: m.toUpperCase(),
|
|
1287
|
-
headers:
|
|
1288
|
-
body:
|
|
1287
|
+
headers: de.normalize().toJSON(),
|
|
1288
|
+
body: E,
|
|
1289
1289
|
duplex: "half",
|
|
1290
|
-
credentials:
|
|
1290
|
+
credentials: P ? Y : void 0
|
|
1291
1291
|
};
|
|
1292
|
-
|
|
1293
|
-
let
|
|
1294
|
-
const Ne = l && (
|
|
1295
|
-
if (l && (
|
|
1296
|
-
const
|
|
1297
|
-
["status", "statusText", "headers"].forEach((
|
|
1298
|
-
|
|
1292
|
+
q = o && new r(h, Ce);
|
|
1293
|
+
let F = await (o ? Te(q, Oe) : Te(h, Ce));
|
|
1294
|
+
const Ne = l && (N === "stream" || N === "response");
|
|
1295
|
+
if (l && (O || Ne && v)) {
|
|
1296
|
+
const L = {};
|
|
1297
|
+
["status", "statusText", "headers"].forEach((ke) => {
|
|
1298
|
+
L[ke] = F[ke];
|
|
1299
1299
|
});
|
|
1300
|
-
const M = c.toFiniteNumber(
|
|
1300
|
+
const M = c.toFiniteNumber(F.headers.get("content-length")), [fe, Z] = O && Be(
|
|
1301
1301
|
M,
|
|
1302
|
-
oe(Ie(
|
|
1302
|
+
oe(Ie(O), !0)
|
|
1303
1303
|
) || [];
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
Z && Z(),
|
|
1304
|
+
F = new n(
|
|
1305
|
+
Me(F.body, $e, fe, () => {
|
|
1306
|
+
Z && Z(), v && v();
|
|
1307
1307
|
}),
|
|
1308
|
-
|
|
1308
|
+
L
|
|
1309
1309
|
);
|
|
1310
1310
|
}
|
|
1311
|
-
|
|
1312
|
-
let
|
|
1313
|
-
return !Ne &&
|
|
1314
|
-
|
|
1315
|
-
data:
|
|
1316
|
-
headers:
|
|
1317
|
-
status:
|
|
1318
|
-
statusText:
|
|
1319
|
-
config:
|
|
1320
|
-
request:
|
|
1311
|
+
N = N || "text";
|
|
1312
|
+
let xt = await p[c.findKey(p, N) || "text"](F, d);
|
|
1313
|
+
return !Ne && v && v(), await new Promise((L, M) => {
|
|
1314
|
+
ft(L, M, {
|
|
1315
|
+
data: xt,
|
|
1316
|
+
headers: C.from(F.headers),
|
|
1317
|
+
status: F.status,
|
|
1318
|
+
statusText: F.statusText,
|
|
1319
|
+
config: d,
|
|
1320
|
+
request: q
|
|
1321
1321
|
});
|
|
1322
1322
|
});
|
|
1323
|
-
} catch (
|
|
1324
|
-
throw
|
|
1325
|
-
new
|
|
1323
|
+
} catch (P) {
|
|
1324
|
+
throw v && v(), P && P.name === "TypeError" && /Load failed|fetch/i.test(P.message) ? Object.assign(
|
|
1325
|
+
new g("Network Error", g.ERR_NETWORK, d, q),
|
|
1326
1326
|
{
|
|
1327
|
-
cause:
|
|
1327
|
+
cause: P.cause || P
|
|
1328
1328
|
}
|
|
1329
|
-
) :
|
|
1329
|
+
) : g.from(P, P && P.code, d, q);
|
|
1330
1330
|
}
|
|
1331
1331
|
};
|
|
1332
|
-
},
|
|
1332
|
+
}, Gr = /* @__PURE__ */ new Map(), ht = (e) => {
|
|
1333
1333
|
let t = e && e.env || {};
|
|
1334
|
-
const { fetch:
|
|
1335
|
-
|
|
1334
|
+
const { fetch: r, Request: n, Response: s } = t, o = [
|
|
1335
|
+
n,
|
|
1336
1336
|
s,
|
|
1337
|
-
|
|
1337
|
+
r
|
|
1338
1338
|
];
|
|
1339
|
-
let i = o.length, a = i,
|
|
1339
|
+
let i = o.length, a = i, f, u, l = Gr;
|
|
1340
1340
|
for (; a--; )
|
|
1341
|
-
|
|
1341
|
+
f = o[a], u = l.get(f), u === void 0 && l.set(f, u = a ? /* @__PURE__ */ new Map() : Xr(t)), l = u;
|
|
1342
1342
|
return u;
|
|
1343
1343
|
};
|
|
1344
1344
|
ht();
|
|
1345
|
-
const
|
|
1346
|
-
http:
|
|
1347
|
-
xhr:
|
|
1345
|
+
const Re = {
|
|
1346
|
+
http: pr,
|
|
1347
|
+
xhr: qr,
|
|
1348
1348
|
fetch: {
|
|
1349
1349
|
get: ht
|
|
1350
1350
|
}
|
|
1351
1351
|
};
|
|
1352
|
-
c.forEach(
|
|
1352
|
+
c.forEach(Re, (e, t) => {
|
|
1353
1353
|
if (e) {
|
|
1354
1354
|
try {
|
|
1355
1355
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1358,119 +1358,119 @@ c.forEach(_e, (e, t) => {
|
|
|
1358
1358
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1359
1359
|
}
|
|
1360
1360
|
});
|
|
1361
|
-
const
|
|
1362
|
-
function
|
|
1361
|
+
const Je = (e) => `- ${e}`, Yr = (e) => c.isFunction(e) || e === null || e === !1;
|
|
1362
|
+
function Qr(e, t) {
|
|
1363
1363
|
e = c.isArray(e) ? e : [e];
|
|
1364
|
-
const { length:
|
|
1365
|
-
let
|
|
1364
|
+
const { length: r } = e;
|
|
1365
|
+
let n, s;
|
|
1366
1366
|
const o = {};
|
|
1367
|
-
for (let i = 0; i <
|
|
1368
|
-
|
|
1367
|
+
for (let i = 0; i < r; i++) {
|
|
1368
|
+
n = e[i];
|
|
1369
1369
|
let a;
|
|
1370
|
-
if (s =
|
|
1371
|
-
throw new
|
|
1370
|
+
if (s = n, !Yr(n) && (s = Re[(a = String(n)).toLowerCase()], s === void 0))
|
|
1371
|
+
throw new g(`Unknown adapter '${a}'`);
|
|
1372
1372
|
if (s && (c.isFunction(s) || (s = s.get(t))))
|
|
1373
1373
|
break;
|
|
1374
1374
|
o[a || "#" + i] = s;
|
|
1375
1375
|
}
|
|
1376
1376
|
if (!s) {
|
|
1377
1377
|
const i = Object.entries(o).map(
|
|
1378
|
-
([
|
|
1378
|
+
([f, u]) => `adapter ${f} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1379
1379
|
);
|
|
1380
|
-
let a =
|
|
1381
|
-
` + i.map(
|
|
1382
|
-
`) : " " +
|
|
1383
|
-
throw new
|
|
1380
|
+
let a = r ? i.length > 1 ? `since :
|
|
1381
|
+
` + i.map(Je).join(`
|
|
1382
|
+
`) : " " + Je(i[0]) : "as no adapter specified";
|
|
1383
|
+
throw new g(
|
|
1384
1384
|
"There is no suitable adapter to dispatch the request " + a,
|
|
1385
1385
|
"ERR_NOT_SUPPORT"
|
|
1386
1386
|
);
|
|
1387
1387
|
}
|
|
1388
1388
|
return s;
|
|
1389
1389
|
}
|
|
1390
|
-
const
|
|
1390
|
+
const gt = {
|
|
1391
1391
|
/**
|
|
1392
1392
|
* Resolve an adapter from a list of adapter names or functions.
|
|
1393
1393
|
* @type {Function}
|
|
1394
1394
|
*/
|
|
1395
|
-
getAdapter:
|
|
1395
|
+
getAdapter: Qr,
|
|
1396
1396
|
/**
|
|
1397
1397
|
* Exposes all known adapters
|
|
1398
1398
|
* @type {Object<string, Function|Object>}
|
|
1399
1399
|
*/
|
|
1400
|
-
adapters:
|
|
1400
|
+
adapters: Re
|
|
1401
1401
|
};
|
|
1402
1402
|
function he(e) {
|
|
1403
1403
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1404
1404
|
throw new G(null, e);
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1407
|
-
return he(e), e.headers =
|
|
1406
|
+
function Ke(e) {
|
|
1407
|
+
return he(e), e.headers = C.from(e.headers), e.data = me.call(
|
|
1408
1408
|
e,
|
|
1409
1409
|
e.transformRequest
|
|
1410
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1411
|
-
return he(e),
|
|
1410
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || X.adapter, e)(e).then(function(n) {
|
|
1411
|
+
return he(e), n.data = me.call(
|
|
1412
1412
|
e,
|
|
1413
1413
|
e.transformResponse,
|
|
1414
|
-
|
|
1415
|
-
),
|
|
1416
|
-
}, function(
|
|
1417
|
-
return
|
|
1414
|
+
n
|
|
1415
|
+
), n.headers = C.from(n.headers), n;
|
|
1416
|
+
}, function(n) {
|
|
1417
|
+
return dt(n) || (he(e), n && n.response && (n.response.data = me.call(
|
|
1418
1418
|
e,
|
|
1419
1419
|
e.transformResponse,
|
|
1420
|
-
|
|
1421
|
-
),
|
|
1420
|
+
n.response
|
|
1421
|
+
), n.response.headers = C.from(n.response.headers))), Promise.reject(n);
|
|
1422
1422
|
});
|
|
1423
1423
|
}
|
|
1424
|
-
const
|
|
1424
|
+
const wt = "1.13.4", ue = {};
|
|
1425
1425
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1426
|
-
ue[e] = function(
|
|
1427
|
-
return typeof
|
|
1426
|
+
ue[e] = function(n) {
|
|
1427
|
+
return typeof n === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1428
1428
|
};
|
|
1429
1429
|
});
|
|
1430
1430
|
const Ve = {};
|
|
1431
|
-
ue.transitional = function(t,
|
|
1431
|
+
ue.transitional = function(t, r, n) {
|
|
1432
1432
|
function s(o, i) {
|
|
1433
|
-
return "[Axios v" +
|
|
1433
|
+
return "[Axios v" + wt + "] Transitional option '" + o + "'" + i + (n ? ". " + n : "");
|
|
1434
1434
|
}
|
|
1435
1435
|
return (o, i, a) => {
|
|
1436
1436
|
if (t === !1)
|
|
1437
|
-
throw new
|
|
1438
|
-
s(i, " has been removed" + (
|
|
1439
|
-
|
|
1437
|
+
throw new g(
|
|
1438
|
+
s(i, " has been removed" + (r ? " in " + r : "")),
|
|
1439
|
+
g.ERR_DEPRECATED
|
|
1440
1440
|
);
|
|
1441
|
-
return
|
|
1441
|
+
return r && !Ve[i] && (Ve[i] = !0, console.warn(
|
|
1442
1442
|
s(
|
|
1443
1443
|
i,
|
|
1444
|
-
" has been deprecated since v" +
|
|
1444
|
+
" has been deprecated since v" + r + " and will be removed in the near future"
|
|
1445
1445
|
)
|
|
1446
1446
|
)), t ? t(o, i, a) : !0;
|
|
1447
1447
|
};
|
|
1448
1448
|
};
|
|
1449
1449
|
ue.spelling = function(t) {
|
|
1450
|
-
return (
|
|
1450
|
+
return (r, n) => (console.warn(`${n} is likely a misspelling of ${t}`), !0);
|
|
1451
1451
|
};
|
|
1452
|
-
function
|
|
1452
|
+
function Zr(e, t, r) {
|
|
1453
1453
|
if (typeof e != "object")
|
|
1454
|
-
throw new
|
|
1455
|
-
const
|
|
1456
|
-
let s =
|
|
1454
|
+
throw new g("options must be an object", g.ERR_BAD_OPTION_VALUE);
|
|
1455
|
+
const n = Object.keys(e);
|
|
1456
|
+
let s = n.length;
|
|
1457
1457
|
for (; s-- > 0; ) {
|
|
1458
|
-
const o =
|
|
1458
|
+
const o = n[s], i = t[o];
|
|
1459
1459
|
if (i) {
|
|
1460
|
-
const a = e[o],
|
|
1461
|
-
if (
|
|
1462
|
-
throw new
|
|
1460
|
+
const a = e[o], f = a === void 0 || i(a, o, e);
|
|
1461
|
+
if (f !== !0)
|
|
1462
|
+
throw new g("option " + o + " must be " + f, g.ERR_BAD_OPTION_VALUE);
|
|
1463
1463
|
continue;
|
|
1464
1464
|
}
|
|
1465
|
-
if (
|
|
1466
|
-
throw new
|
|
1465
|
+
if (r !== !0)
|
|
1466
|
+
throw new g("Unknown option " + o, g.ERR_BAD_OPTION);
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
const se = {
|
|
1470
|
-
assertOptions:
|
|
1470
|
+
assertOptions: Zr,
|
|
1471
1471
|
validators: ue
|
|
1472
1472
|
}, U = se.validators;
|
|
1473
|
-
let
|
|
1473
|
+
let I = class {
|
|
1474
1474
|
constructor(t) {
|
|
1475
1475
|
this.defaults = t || {}, this.interceptors = {
|
|
1476
1476
|
request: new Le(),
|
|
@@ -1485,106 +1485,106 @@ let j = class {
|
|
|
1485
1485
|
*
|
|
1486
1486
|
* @returns {Promise} The Promise to be fulfilled
|
|
1487
1487
|
*/
|
|
1488
|
-
async request(t,
|
|
1488
|
+
async request(t, r) {
|
|
1489
1489
|
try {
|
|
1490
|
-
return await this._request(t,
|
|
1491
|
-
} catch (
|
|
1492
|
-
if (
|
|
1490
|
+
return await this._request(t, r);
|
|
1491
|
+
} catch (n) {
|
|
1492
|
+
if (n instanceof Error) {
|
|
1493
1493
|
let s = {};
|
|
1494
1494
|
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
|
|
1495
1495
|
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
|
|
1496
1496
|
try {
|
|
1497
|
-
|
|
1498
|
-
` + o) :
|
|
1497
|
+
n.stack ? o && !String(n.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (n.stack += `
|
|
1498
|
+
` + o) : n.stack = o;
|
|
1499
1499
|
} catch {
|
|
1500
1500
|
}
|
|
1501
1501
|
}
|
|
1502
|
-
throw
|
|
1502
|
+
throw n;
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
|
-
_request(t,
|
|
1506
|
-
typeof t == "string" ? (
|
|
1507
|
-
const { transitional:
|
|
1508
|
-
|
|
1505
|
+
_request(t, r) {
|
|
1506
|
+
typeof t == "string" ? (r = r || {}, r.url = t) : r = t || {}, r = j(this.defaults, r);
|
|
1507
|
+
const { transitional: n, paramsSerializer: s, headers: o } = r;
|
|
1508
|
+
n !== void 0 && se.assertOptions(n, {
|
|
1509
1509
|
silentJSONParsing: U.transitional(U.boolean),
|
|
1510
1510
|
forcedJSONParsing: U.transitional(U.boolean),
|
|
1511
1511
|
clarifyTimeoutError: U.transitional(U.boolean)
|
|
1512
|
-
}, !1), s != null && (c.isFunction(s) ?
|
|
1512
|
+
}, !1), s != null && (c.isFunction(s) ? r.paramsSerializer = {
|
|
1513
1513
|
serialize: s
|
|
1514
1514
|
} : se.assertOptions(s, {
|
|
1515
1515
|
encode: U.function,
|
|
1516
1516
|
serialize: U.function
|
|
1517
|
-
}, !0)),
|
|
1517
|
+
}, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), se.assertOptions(r, {
|
|
1518
1518
|
baseUrl: U.spelling("baseURL"),
|
|
1519
1519
|
withXsrfToken: U.spelling("withXSRFToken")
|
|
1520
|
-
}, !0),
|
|
1520
|
+
}, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
|
|
1521
1521
|
let i = o && c.merge(
|
|
1522
1522
|
o.common,
|
|
1523
|
-
o[
|
|
1523
|
+
o[r.method]
|
|
1524
1524
|
);
|
|
1525
1525
|
o && c.forEach(
|
|
1526
1526
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1527
|
-
(
|
|
1528
|
-
delete o[
|
|
1527
|
+
(d) => {
|
|
1528
|
+
delete o[d];
|
|
1529
1529
|
}
|
|
1530
|
-
),
|
|
1530
|
+
), r.headers = C.concat(i, o);
|
|
1531
1531
|
const a = [];
|
|
1532
|
-
let
|
|
1532
|
+
let f = !0;
|
|
1533
1533
|
this.interceptors.request.forEach(function(h) {
|
|
1534
|
-
typeof h.runWhen == "function" && h.runWhen(
|
|
1534
|
+
typeof h.runWhen == "function" && h.runWhen(r) === !1 || (f = f && h.synchronous, a.unshift(h.fulfilled, h.rejected));
|
|
1535
1535
|
});
|
|
1536
1536
|
const u = [];
|
|
1537
1537
|
this.interceptors.response.forEach(function(h) {
|
|
1538
1538
|
u.push(h.fulfilled, h.rejected);
|
|
1539
1539
|
});
|
|
1540
|
-
let l, p = 0,
|
|
1541
|
-
if (!
|
|
1542
|
-
const
|
|
1543
|
-
for (
|
|
1544
|
-
l = l.then(
|
|
1540
|
+
let l, p = 0, y;
|
|
1541
|
+
if (!f) {
|
|
1542
|
+
const d = [Ke.bind(this), void 0];
|
|
1543
|
+
for (d.unshift(...a), d.push(...u), y = d.length, l = Promise.resolve(r); p < y; )
|
|
1544
|
+
l = l.then(d[p++], d[p++]);
|
|
1545
1545
|
return l;
|
|
1546
1546
|
}
|
|
1547
|
-
|
|
1548
|
-
let
|
|
1549
|
-
for (; p <
|
|
1550
|
-
const
|
|
1547
|
+
y = a.length;
|
|
1548
|
+
let R = r;
|
|
1549
|
+
for (; p < y; ) {
|
|
1550
|
+
const d = a[p++], h = a[p++];
|
|
1551
1551
|
try {
|
|
1552
|
-
|
|
1552
|
+
R = d(R);
|
|
1553
1553
|
} catch (m) {
|
|
1554
1554
|
h.call(this, m);
|
|
1555
1555
|
break;
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
1558
|
try {
|
|
1559
|
-
l =
|
|
1560
|
-
} catch (
|
|
1561
|
-
return Promise.reject(
|
|
1559
|
+
l = Ke.call(this, R);
|
|
1560
|
+
} catch (d) {
|
|
1561
|
+
return Promise.reject(d);
|
|
1562
1562
|
}
|
|
1563
|
-
for (p = 0,
|
|
1563
|
+
for (p = 0, y = u.length; p < y; )
|
|
1564
1564
|
l = l.then(u[p++], u[p++]);
|
|
1565
1565
|
return l;
|
|
1566
1566
|
}
|
|
1567
1567
|
getUri(t) {
|
|
1568
|
-
t =
|
|
1569
|
-
const
|
|
1570
|
-
return ct(
|
|
1568
|
+
t = j(this.defaults, t);
|
|
1569
|
+
const r = pt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1570
|
+
return ct(r, t.params, t.paramsSerializer);
|
|
1571
1571
|
}
|
|
1572
1572
|
};
|
|
1573
1573
|
c.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1574
|
-
|
|
1575
|
-
return this.request(
|
|
1574
|
+
I.prototype[t] = function(r, n) {
|
|
1575
|
+
return this.request(j(n || {}, {
|
|
1576
1576
|
method: t,
|
|
1577
|
-
url:
|
|
1578
|
-
data: (
|
|
1577
|
+
url: r,
|
|
1578
|
+
data: (n || {}).data
|
|
1579
1579
|
}));
|
|
1580
1580
|
};
|
|
1581
1581
|
});
|
|
1582
1582
|
c.forEach(["post", "put", "patch"], function(t) {
|
|
1583
|
-
function n
|
|
1583
|
+
function r(n) {
|
|
1584
1584
|
return function(o, i, a) {
|
|
1585
|
-
return this.request(
|
|
1585
|
+
return this.request(j(a || {}, {
|
|
1586
1586
|
method: t,
|
|
1587
|
-
headers:
|
|
1587
|
+
headers: n ? {
|
|
1588
1588
|
"Content-Type": "multipart/form-data"
|
|
1589
1589
|
} : {},
|
|
1590
1590
|
url: o,
|
|
@@ -1592,33 +1592,33 @@ c.forEach(["post", "put", "patch"], function(t) {
|
|
|
1592
1592
|
}));
|
|
1593
1593
|
};
|
|
1594
1594
|
}
|
|
1595
|
-
|
|
1595
|
+
I.prototype[t] = r(), I.prototype[t + "Form"] = r(!0);
|
|
1596
1596
|
});
|
|
1597
|
-
let
|
|
1597
|
+
let en = class bt {
|
|
1598
1598
|
constructor(t) {
|
|
1599
1599
|
if (typeof t != "function")
|
|
1600
1600
|
throw new TypeError("executor must be a function.");
|
|
1601
|
-
let
|
|
1601
|
+
let r;
|
|
1602
1602
|
this.promise = new Promise(function(o) {
|
|
1603
|
-
|
|
1603
|
+
r = o;
|
|
1604
1604
|
});
|
|
1605
|
-
const
|
|
1605
|
+
const n = this;
|
|
1606
1606
|
this.promise.then((s) => {
|
|
1607
|
-
if (!
|
|
1608
|
-
let o =
|
|
1607
|
+
if (!n._listeners) return;
|
|
1608
|
+
let o = n._listeners.length;
|
|
1609
1609
|
for (; o-- > 0; )
|
|
1610
|
-
|
|
1611
|
-
|
|
1610
|
+
n._listeners[o](s);
|
|
1611
|
+
n._listeners = null;
|
|
1612
1612
|
}), this.promise.then = (s) => {
|
|
1613
1613
|
let o;
|
|
1614
1614
|
const i = new Promise((a) => {
|
|
1615
|
-
|
|
1615
|
+
n.subscribe(a), o = a;
|
|
1616
1616
|
}).then(s);
|
|
1617
1617
|
return i.cancel = function() {
|
|
1618
|
-
|
|
1618
|
+
n.unsubscribe(o);
|
|
1619
1619
|
}, i;
|
|
1620
1620
|
}, t(function(o, i, a) {
|
|
1621
|
-
|
|
1621
|
+
n.reason || (n.reason = new G(o, i, a), r(n.reason));
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
1624
|
/**
|
|
@@ -1644,14 +1644,14 @@ let tr = class Et {
|
|
|
1644
1644
|
unsubscribe(t) {
|
|
1645
1645
|
if (!this._listeners)
|
|
1646
1646
|
return;
|
|
1647
|
-
const
|
|
1648
|
-
|
|
1647
|
+
const r = this._listeners.indexOf(t);
|
|
1648
|
+
r !== -1 && this._listeners.splice(r, 1);
|
|
1649
1649
|
}
|
|
1650
1650
|
toAbortSignal() {
|
|
1651
|
-
const t = new AbortController(),
|
|
1652
|
-
t.abort(
|
|
1651
|
+
const t = new AbortController(), r = (n) => {
|
|
1652
|
+
t.abort(n);
|
|
1653
1653
|
};
|
|
1654
|
-
return this.subscribe(
|
|
1654
|
+
return this.subscribe(r), t.signal.unsubscribe = () => this.unsubscribe(r), t.signal;
|
|
1655
1655
|
}
|
|
1656
1656
|
/**
|
|
1657
1657
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
@@ -1660,22 +1660,22 @@ let tr = class Et {
|
|
|
1660
1660
|
static source() {
|
|
1661
1661
|
let t;
|
|
1662
1662
|
return {
|
|
1663
|
-
token: new
|
|
1663
|
+
token: new bt(function(s) {
|
|
1664
1664
|
t = s;
|
|
1665
1665
|
}),
|
|
1666
1666
|
cancel: t
|
|
1667
1667
|
};
|
|
1668
1668
|
}
|
|
1669
1669
|
};
|
|
1670
|
-
function
|
|
1671
|
-
return function(
|
|
1672
|
-
return e.apply(null,
|
|
1670
|
+
function tn(e) {
|
|
1671
|
+
return function(r) {
|
|
1672
|
+
return e.apply(null, r);
|
|
1673
1673
|
};
|
|
1674
1674
|
}
|
|
1675
|
-
function
|
|
1675
|
+
function rn(e) {
|
|
1676
1676
|
return c.isObject(e) && e.isAxiosError === !0;
|
|
1677
1677
|
}
|
|
1678
|
-
const
|
|
1678
|
+
const ye = {
|
|
1679
1679
|
Continue: 100,
|
|
1680
1680
|
SwitchingProtocols: 101,
|
|
1681
1681
|
Processing: 102,
|
|
@@ -1746,58 +1746,58 @@ const be = {
|
|
|
1746
1746
|
SslHandshakeFailed: 525,
|
|
1747
1747
|
InvalidSslCertificate: 526
|
|
1748
1748
|
};
|
|
1749
|
-
Object.entries(
|
|
1750
|
-
|
|
1749
|
+
Object.entries(ye).forEach(([e, t]) => {
|
|
1750
|
+
ye[t] = e;
|
|
1751
1751
|
});
|
|
1752
|
-
function
|
|
1753
|
-
const t = new
|
|
1754
|
-
return c.extend(
|
|
1755
|
-
return
|
|
1756
|
-
},
|
|
1752
|
+
function yt(e) {
|
|
1753
|
+
const t = new I(e), r = Ye(I.prototype.request, t);
|
|
1754
|
+
return c.extend(r, I.prototype, t, { allOwnKeys: !0 }), c.extend(r, t, null, { allOwnKeys: !0 }), r.create = function(s) {
|
|
1755
|
+
return yt(j(e, s));
|
|
1756
|
+
}, r;
|
|
1757
1757
|
}
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1758
|
+
const S = yt(X);
|
|
1759
|
+
S.Axios = I;
|
|
1760
|
+
S.CanceledError = G;
|
|
1761
|
+
S.CancelToken = en;
|
|
1762
|
+
S.isCancel = dt;
|
|
1763
|
+
S.VERSION = wt;
|
|
1764
|
+
S.toFormData = le;
|
|
1765
|
+
S.AxiosError = g;
|
|
1766
|
+
S.Cancel = S.CanceledError;
|
|
1767
|
+
S.all = function(t) {
|
|
1768
1768
|
return Promise.all(t);
|
|
1769
1769
|
};
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1770
|
+
S.spread = tn;
|
|
1771
|
+
S.isAxiosError = rn;
|
|
1772
|
+
S.mergeConfig = j;
|
|
1773
|
+
S.AxiosHeaders = C;
|
|
1774
|
+
S.formToJSON = (e) => ut(c.isHTMLForm(e) ? new FormData(e) : e);
|
|
1775
|
+
S.getAdapter = gt.getAdapter;
|
|
1776
|
+
S.HttpStatusCode = ye;
|
|
1777
|
+
S.default = S;
|
|
1778
1778
|
const {
|
|
1779
|
-
Axios:
|
|
1780
|
-
AxiosError:
|
|
1781
|
-
CanceledError:
|
|
1782
|
-
isCancel:
|
|
1783
|
-
CancelToken:
|
|
1784
|
-
VERSION:
|
|
1785
|
-
all:
|
|
1786
|
-
Cancel:
|
|
1787
|
-
isAxiosError:
|
|
1788
|
-
spread:
|
|
1789
|
-
toFormData:
|
|
1790
|
-
AxiosHeaders:
|
|
1791
|
-
HttpStatusCode:
|
|
1792
|
-
formToJSON:
|
|
1793
|
-
getAdapter:
|
|
1794
|
-
mergeConfig:
|
|
1795
|
-
} =
|
|
1796
|
-
class
|
|
1797
|
-
constructor(t,
|
|
1779
|
+
Axios: yn,
|
|
1780
|
+
AxiosError: xn,
|
|
1781
|
+
CanceledError: En,
|
|
1782
|
+
isCancel: _n,
|
|
1783
|
+
CancelToken: Sn,
|
|
1784
|
+
VERSION: Rn,
|
|
1785
|
+
all: On,
|
|
1786
|
+
Cancel: Tn,
|
|
1787
|
+
isAxiosError: An,
|
|
1788
|
+
spread: Cn,
|
|
1789
|
+
toFormData: Nn,
|
|
1790
|
+
AxiosHeaders: kn,
|
|
1791
|
+
HttpStatusCode: Pn,
|
|
1792
|
+
formToJSON: Un,
|
|
1793
|
+
getAdapter: Dn,
|
|
1794
|
+
mergeConfig: Fn
|
|
1795
|
+
} = S, nn = "https://customers-services.tarxemo.com/api";
|
|
1796
|
+
class sn {
|
|
1797
|
+
constructor(t, r = nn) {
|
|
1798
1798
|
Pe(this, "client");
|
|
1799
|
-
this.client =
|
|
1800
|
-
baseURL:
|
|
1799
|
+
this.client = S.create({
|
|
1800
|
+
baseURL: r,
|
|
1801
1801
|
headers: {
|
|
1802
1802
|
"Content-Type": "application/json",
|
|
1803
1803
|
"X-API-Key": t
|
|
@@ -1805,30 +1805,30 @@ class or {
|
|
|
1805
1805
|
timeout: 3e4
|
|
1806
1806
|
// 30 seconds
|
|
1807
1807
|
}), this.client.interceptors.response.use(
|
|
1808
|
-
(
|
|
1809
|
-
(
|
|
1808
|
+
(n) => n,
|
|
1809
|
+
(n) => {
|
|
1810
1810
|
var s, o;
|
|
1811
|
-
if ((s =
|
|
1812
|
-
const a = ((o =
|
|
1811
|
+
if ((s = n.response) != null && s.data) {
|
|
1812
|
+
const a = ((o = n.response.data.response) == null ? void 0 : o.message) || "An unknown error occurred";
|
|
1813
1813
|
throw new Error(a);
|
|
1814
|
-
} else throw
|
|
1814
|
+
} else throw n.request ? new Error("No response from server. Please check your connection.") : new Error(n.message || "Request failed");
|
|
1815
1815
|
}
|
|
1816
1816
|
);
|
|
1817
1817
|
}
|
|
1818
1818
|
/**
|
|
1819
1819
|
* Send a message to the customer support API
|
|
1820
1820
|
*/
|
|
1821
|
-
async sendMessage(t,
|
|
1821
|
+
async sendMessage(t, r) {
|
|
1822
1822
|
try {
|
|
1823
|
-
const
|
|
1823
|
+
const n = await this.client.post("/chat/", {
|
|
1824
1824
|
question: t,
|
|
1825
|
-
session_id:
|
|
1825
|
+
session_id: r
|
|
1826
1826
|
});
|
|
1827
|
-
if (
|
|
1828
|
-
throw new Error(
|
|
1829
|
-
return
|
|
1830
|
-
} catch (
|
|
1831
|
-
throw
|
|
1827
|
+
if (n.data.response.status !== "success")
|
|
1828
|
+
throw new Error(n.data.response.message);
|
|
1829
|
+
return n.data.data;
|
|
1830
|
+
} catch (n) {
|
|
1831
|
+
throw n instanceof Error ? n : new Error("Failed to send message");
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
1834
|
/**
|
|
@@ -1836,14 +1836,14 @@ class or {
|
|
|
1836
1836
|
*/
|
|
1837
1837
|
async getConversationHistory(t) {
|
|
1838
1838
|
try {
|
|
1839
|
-
const
|
|
1839
|
+
const r = await this.client.get(
|
|
1840
1840
|
`/chat/history/${t}/`
|
|
1841
1841
|
);
|
|
1842
|
-
if (
|
|
1843
|
-
throw new Error(
|
|
1844
|
-
return
|
|
1845
|
-
} catch (
|
|
1846
|
-
throw
|
|
1842
|
+
if (r.data.response.status !== "success")
|
|
1843
|
+
throw new Error(r.data.response.message);
|
|
1844
|
+
return r.data.data;
|
|
1845
|
+
} catch (r) {
|
|
1846
|
+
throw r instanceof Error ? r : new Error("Failed to load conversation history");
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
1849
1849
|
/**
|
|
@@ -1859,255 +1859,255 @@ class or {
|
|
|
1859
1859
|
this.client.defaults.baseURL = t;
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
|
-
function
|
|
1863
|
-
const [
|
|
1862
|
+
function We(e, t) {
|
|
1863
|
+
const [r, n] = J(() => {
|
|
1864
1864
|
try {
|
|
1865
|
-
const
|
|
1866
|
-
return
|
|
1867
|
-
} catch (
|
|
1868
|
-
return console.warn(`Error reading localStorage key "${e}":`,
|
|
1865
|
+
const s = window.localStorage.getItem(e);
|
|
1866
|
+
return s ? JSON.parse(s) : t;
|
|
1867
|
+
} catch (s) {
|
|
1868
|
+
return console.warn(`Error reading localStorage key "${e}":`, s), t;
|
|
1869
1869
|
}
|
|
1870
1870
|
});
|
|
1871
|
-
return
|
|
1871
|
+
return xe(() => {
|
|
1872
1872
|
try {
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
console.warn(`Error setting localStorage key "${e}":`, i);
|
|
1873
|
+
window.localStorage.setItem(e, JSON.stringify(r));
|
|
1874
|
+
} catch (s) {
|
|
1875
|
+
console.warn(`Error setting localStorage key "${e}":`, s);
|
|
1877
1876
|
}
|
|
1878
|
-
}];
|
|
1877
|
+
}, [e, r]), [r, n];
|
|
1879
1878
|
}
|
|
1880
|
-
function
|
|
1879
|
+
function Xe() {
|
|
1881
1880
|
return `session_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
|
|
1882
1881
|
}
|
|
1883
|
-
const
|
|
1884
|
-
function
|
|
1885
|
-
const { apiKey: t, baseUrl:
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
), [
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
}, [t,
|
|
1892
|
-
const
|
|
1882
|
+
const on = "customer_support_session_id", an = "customer_support_messages";
|
|
1883
|
+
function cn(e) {
|
|
1884
|
+
const { apiKey: t, baseUrl: r, onError: n } = e, [s, o] = We(an, []), [i, a] = We(
|
|
1885
|
+
on,
|
|
1886
|
+
Xe()
|
|
1887
|
+
), [f, u] = J(!1), [l, p] = J(null), y = Ge(null);
|
|
1888
|
+
xe(() => {
|
|
1889
|
+
y.current = new sn(t, r);
|
|
1890
|
+
}, [t, r]);
|
|
1891
|
+
const R = ee(() => {
|
|
1893
1892
|
p(null);
|
|
1894
|
-
}, []),
|
|
1895
|
-
async (
|
|
1896
|
-
if (!
|
|
1897
|
-
const
|
|
1898
|
-
p(
|
|
1893
|
+
}, []), d = ee(
|
|
1894
|
+
async (E) => {
|
|
1895
|
+
if (!y.current) {
|
|
1896
|
+
const x = new Error("API client not initialized");
|
|
1897
|
+
p(x), n == null || n(x);
|
|
1899
1898
|
return;
|
|
1900
1899
|
}
|
|
1901
|
-
if (!
|
|
1900
|
+
if (!E.trim())
|
|
1902
1901
|
return;
|
|
1903
|
-
const
|
|
1902
|
+
const _ = {
|
|
1904
1903
|
id: `user_${Date.now()}`,
|
|
1905
1904
|
role: "USER",
|
|
1906
|
-
content:
|
|
1905
|
+
content: E,
|
|
1907
1906
|
timestamp: /* @__PURE__ */ new Date()
|
|
1908
1907
|
};
|
|
1909
|
-
o((
|
|
1908
|
+
o((x) => [...x, _]), u(!0), p(null);
|
|
1910
1909
|
try {
|
|
1911
|
-
const
|
|
1910
|
+
const x = await y.current.sendMessage(E, i), b = {
|
|
1912
1911
|
id: `assistant_${Date.now()}`,
|
|
1913
1912
|
role: "ASSISTANT",
|
|
1914
|
-
content:
|
|
1913
|
+
content: x.answer,
|
|
1915
1914
|
timestamp: /* @__PURE__ */ new Date(),
|
|
1916
|
-
sources:
|
|
1915
|
+
sources: x.sources
|
|
1917
1916
|
};
|
|
1918
|
-
o((
|
|
1919
|
-
} catch (
|
|
1920
|
-
const
|
|
1921
|
-
p(
|
|
1922
|
-
const
|
|
1917
|
+
o((O) => [...O, b]), x.session_id !== i && a(x.session_id);
|
|
1918
|
+
} catch (x) {
|
|
1919
|
+
const b = x instanceof Error ? x : new Error("Failed to send message");
|
|
1920
|
+
p(b), n == null || n(b);
|
|
1921
|
+
const O = {
|
|
1923
1922
|
id: `error_${Date.now()}`,
|
|
1924
1923
|
role: "ASSISTANT",
|
|
1925
|
-
content: `Sorry, I encountered an error: ${
|
|
1924
|
+
content: `Sorry, I encountered an error: ${b.message}`,
|
|
1926
1925
|
timestamp: /* @__PURE__ */ new Date()
|
|
1927
1926
|
};
|
|
1928
|
-
o((
|
|
1927
|
+
o((D) => [...D, O]);
|
|
1929
1928
|
} finally {
|
|
1930
1929
|
u(!1);
|
|
1931
1930
|
}
|
|
1932
1931
|
},
|
|
1933
|
-
[i,
|
|
1932
|
+
[i, n, o, a]
|
|
1934
1933
|
), h = ee(async () => {
|
|
1935
|
-
if (!(!
|
|
1934
|
+
if (!(!y.current || !i)) {
|
|
1936
1935
|
u(!0), p(null);
|
|
1937
1936
|
try {
|
|
1938
|
-
const
|
|
1939
|
-
id: `${
|
|
1940
|
-
role:
|
|
1941
|
-
content:
|
|
1942
|
-
timestamp: new Date(
|
|
1937
|
+
const _ = (await y.current.getConversationHistory(i)).messages.map((x, b) => ({
|
|
1938
|
+
id: `${x.role.toLowerCase()}_${b}_${Date.now()}`,
|
|
1939
|
+
role: x.role.toUpperCase(),
|
|
1940
|
+
content: x.content,
|
|
1941
|
+
timestamp: new Date(x.created_at)
|
|
1943
1942
|
}));
|
|
1944
|
-
o(
|
|
1945
|
-
} catch (
|
|
1946
|
-
const
|
|
1947
|
-
p(
|
|
1943
|
+
o(_);
|
|
1944
|
+
} catch (E) {
|
|
1945
|
+
const _ = E instanceof Error ? E : new Error("Failed to load history");
|
|
1946
|
+
p(_), n == null || n(_);
|
|
1948
1947
|
} finally {
|
|
1949
1948
|
u(!1);
|
|
1950
1949
|
}
|
|
1951
1950
|
}
|
|
1952
|
-
}, [i,
|
|
1953
|
-
o([]), a(
|
|
1951
|
+
}, [i, n, o]), m = ee(() => {
|
|
1952
|
+
o([]), a(Xe());
|
|
1954
1953
|
}, [o, a]);
|
|
1955
1954
|
return {
|
|
1956
1955
|
messages: s,
|
|
1957
|
-
sendMessage:
|
|
1958
|
-
isLoading:
|
|
1956
|
+
sendMessage: d,
|
|
1957
|
+
isLoading: f,
|
|
1959
1958
|
error: l,
|
|
1960
|
-
clearError:
|
|
1959
|
+
clearError: R,
|
|
1961
1960
|
sessionId: i,
|
|
1962
1961
|
loadHistory: h,
|
|
1963
1962
|
clearHistory: m
|
|
1964
1963
|
};
|
|
1965
1964
|
}
|
|
1966
|
-
const
|
|
1967
|
-
const t = e.role.toUpperCase() === "USER",
|
|
1968
|
-
return /* @__PURE__ */
|
|
1965
|
+
const ln = ({ message: e }) => {
|
|
1966
|
+
const t = e.role.toUpperCase() === "USER", r = e.timestamp instanceof Date ? e.timestamp : new Date(e.timestamp);
|
|
1967
|
+
return /* @__PURE__ */ w.createElement("div", { className: `cs-message ${t ? "cs-message--user" : "cs-message--assistant"}` }, /* @__PURE__ */ w.createElement("div", { className: "cs-message__content" }, /* @__PURE__ */ w.createElement("p", { className: "cs-message__text" }, e.content), e.sources && e.sources.length > 0 && /* @__PURE__ */ w.createElement("div", { className: "cs-message__sources" }, /* @__PURE__ */ w.createElement("p", { className: "cs-message__sources-title" }, "Sources:"), /* @__PURE__ */ w.createElement("ul", { className: "cs-message__sources-list" }, e.sources.map((n, s) => /* @__PURE__ */ w.createElement("li", { key: s, className: "cs-message__source-item" }, /* @__PURE__ */ w.createElement(
|
|
1969
1968
|
"a",
|
|
1970
1969
|
{
|
|
1971
|
-
href:
|
|
1970
|
+
href: n.url,
|
|
1972
1971
|
target: "_blank",
|
|
1973
1972
|
rel: "noopener noreferrer",
|
|
1974
1973
|
className: "cs-message__source-link"
|
|
1975
1974
|
},
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
1978
|
-
), /* @__PURE__ */
|
|
1979
|
-
},
|
|
1975
|
+
/* @__PURE__ */ w.createElement(St, { size: 12 }),
|
|
1976
|
+
/* @__PURE__ */ w.createElement("span", null, n.title)
|
|
1977
|
+
), /* @__PURE__ */ w.createElement("span", { className: "cs-message__source-similarity" }, Math.round(n.similarity * 100), "% match")))))), /* @__PURE__ */ w.createElement("time", { className: "cs-message__time", dateTime: r.toISOString() }, r.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })));
|
|
1978
|
+
}, un = ({
|
|
1980
1979
|
onSendMessage: e,
|
|
1981
1980
|
isLoading: t,
|
|
1982
|
-
placeholder:
|
|
1981
|
+
placeholder: r = "Type your message..."
|
|
1983
1982
|
}) => {
|
|
1984
|
-
const [
|
|
1985
|
-
a.preventDefault(),
|
|
1983
|
+
const [n, s] = J(""), o = (a) => {
|
|
1984
|
+
a.preventDefault(), n.trim() && !t && (e(n), s(""));
|
|
1986
1985
|
}, i = (a) => {
|
|
1987
1986
|
a.key === "Enter" && !a.shiftKey && (a.preventDefault(), o(a));
|
|
1988
1987
|
};
|
|
1989
|
-
return /* @__PURE__ */
|
|
1988
|
+
return /* @__PURE__ */ w.createElement("form", { className: "cs-input", onSubmit: o }, /* @__PURE__ */ w.createElement(
|
|
1990
1989
|
"textarea",
|
|
1991
1990
|
{
|
|
1992
1991
|
className: "cs-input__textarea",
|
|
1993
|
-
value:
|
|
1992
|
+
value: n,
|
|
1994
1993
|
onChange: (a) => s(a.target.value),
|
|
1995
1994
|
onKeyDown: i,
|
|
1996
|
-
placeholder:
|
|
1995
|
+
placeholder: r,
|
|
1997
1996
|
disabled: t,
|
|
1998
1997
|
rows: 1,
|
|
1999
1998
|
"aria-label": "Message input"
|
|
2000
1999
|
}
|
|
2001
|
-
), /* @__PURE__ */
|
|
2000
|
+
), /* @__PURE__ */ w.createElement(
|
|
2002
2001
|
"button",
|
|
2003
2002
|
{
|
|
2004
2003
|
type: "submit",
|
|
2005
2004
|
className: "cs-input__button",
|
|
2006
|
-
disabled: !
|
|
2005
|
+
disabled: !n.trim() || t,
|
|
2007
2006
|
"aria-label": "Send message"
|
|
2008
2007
|
},
|
|
2009
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ w.createElement(Rt, { size: 20 })
|
|
2010
2009
|
));
|
|
2011
|
-
},
|
|
2010
|
+
}, dn = ({
|
|
2012
2011
|
messages: e,
|
|
2013
2012
|
onSendMessage: t,
|
|
2014
|
-
onClose:
|
|
2015
|
-
isLoading:
|
|
2013
|
+
onClose: r,
|
|
2014
|
+
isLoading: n,
|
|
2016
2015
|
error: s,
|
|
2017
2016
|
placeholder: o,
|
|
2018
2017
|
welcomeMessage: i = "Hi! How can I help you today?"
|
|
2019
2018
|
}) => {
|
|
2020
|
-
const a =
|
|
2021
|
-
return
|
|
2022
|
-
var
|
|
2023
|
-
(
|
|
2024
|
-
}, [e]), /* @__PURE__ */
|
|
2019
|
+
const a = Ge(null);
|
|
2020
|
+
return xe(() => {
|
|
2021
|
+
var f;
|
|
2022
|
+
(f = a.current) == null || f.scrollIntoView({ behavior: "smooth" });
|
|
2023
|
+
}, [e]), /* @__PURE__ */ w.createElement("div", { className: "cs-window" }, /* @__PURE__ */ w.createElement("div", { className: "cs-window__header" }, /* @__PURE__ */ w.createElement("div", { className: "cs-window__header-info" }, /* @__PURE__ */ w.createElement("h3", { className: "cs-window__title" }, "Customer Support"), /* @__PURE__ */ w.createElement("div", { className: "cs-window__status" }, /* @__PURE__ */ w.createElement("span", { className: "cs-window__status-dot" }), /* @__PURE__ */ w.createElement("span", null, "Online"))), /* @__PURE__ */ w.createElement(
|
|
2025
2024
|
"button",
|
|
2026
2025
|
{
|
|
2027
2026
|
className: "cs-window__close",
|
|
2028
|
-
onClick:
|
|
2027
|
+
onClick: r,
|
|
2029
2028
|
"aria-label": "Close chat"
|
|
2030
2029
|
},
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
)), /* @__PURE__ */
|
|
2033
|
-
|
|
2030
|
+
/* @__PURE__ */ w.createElement(Ot, { size: 20 })
|
|
2031
|
+
)), /* @__PURE__ */ w.createElement("div", { className: "cs-window__messages" }, e.length === 0 && !n && /* @__PURE__ */ w.createElement("div", { className: "cs-window__welcome" }, /* @__PURE__ */ w.createElement("p", null, i)), e.map((f) => /* @__PURE__ */ w.createElement(ln, { key: f.id, message: f })), n && /* @__PURE__ */ w.createElement("div", { className: "cs-window__typing" }, /* @__PURE__ */ w.createElement(Tt, { size: 20, className: "cs-window__typing-icon" }), /* @__PURE__ */ w.createElement("span", null, "Thinking...")), s && /* @__PURE__ */ w.createElement("div", { className: "cs-window__error" }, /* @__PURE__ */ w.createElement("p", null, s.message)), /* @__PURE__ */ w.createElement("div", { ref: a })), /* @__PURE__ */ w.createElement("div", { className: "cs-window__input-wrapper" }, /* @__PURE__ */ w.createElement(
|
|
2032
|
+
un,
|
|
2034
2033
|
{
|
|
2035
2034
|
onSendMessage: t,
|
|
2036
|
-
isLoading:
|
|
2035
|
+
isLoading: n,
|
|
2037
2036
|
placeholder: o
|
|
2038
2037
|
}
|
|
2039
2038
|
)));
|
|
2040
|
-
},
|
|
2039
|
+
}, fn = ':root{--cs-primary-color: inherit;--cs-secondary-color: inherit;--cs-bg-color: inherit;--cs-text-color: inherit;--cs-font-family: inherit;--cs-border-radius: 12px;--cs-button-color: var(--cs-primary-color);--cs-user-message-color: var(--cs-primary-color);--cs-assistant-message-color: rgba(0, 0, 0, .05);--cs-header-gradient: linear-gradient(135deg, var(--cs-primary-color), var(--cs-secondary-color));--cs-focus-ring: rgba(0, 0, 0, .1);--cs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--cs-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--cs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--cs-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.cs-widget{position:fixed;z-index:9999;font-family:var(--cs-font-family)}.cs-widget,.cs-widget *{box-sizing:border-box}.cs-widget--bottom-right{bottom:20px;right:20px}.cs-widget--bottom-left{bottom:20px;left:20px}.cs-widget--top-right{top:20px;right:20px}.cs-widget--top-left{top:20px;left:20px}.cs-widget__toggle{position:relative;width:60px;height:60px;border-radius:50%;background:var(--cs-header-gradient);border:none;color:#fff;cursor:pointer;box-shadow:var(--cs-shadow-xl);transition:all .3s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center}.cs-widget__toggle:hover{transform:scale(1.1);box-shadow:0 15px 25px -5px var(--cs-focus-ring)}.cs-widget__toggle:active{transform:scale(.95)}.cs-widget__toggle--open{background:#ef4444}.cs-widget__badge{position:absolute;top:-5px;right:-5px;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;box-shadow:var(--cs-shadow)}.cs-window{position:absolute;bottom:85px;right:0;width:380px;max-width:calc(100vw - 40px);height:600px;max-height:calc(100vh - 130px);background:var(--cs-bg-color);border-radius:var(--cs-border-radius);border:1px solid rgba(0,0,0,.1);box-shadow:var(--cs-shadow-xl);display:flex;flex-direction:column;overflow:visible;animation:slideUp .3s cubic-bezier(.4,0,.2,1);transform-origin:bottom right}.cs-window:after{content:"";position:absolute;bottom:-10px;right:25px;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--cs-bg-color);filter:drop-shadow(0 5px 5px rgba(0,0,0,.1))}.cs-widget--bottom-left .cs-window{transform-origin:bottom left;right:auto;left:0}.cs-widget--bottom-left .cs-window:after{right:auto;left:25px}.cs-widget--top-right .cs-window{transform-origin:top right;bottom:auto;top:85px}.cs-widget--top-right .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color)}.cs-widget--top-left .cs-window{transform-origin:top left;bottom:auto;top:85px;right:auto;left:0}.cs-widget--top-left .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color);right:auto;left:25px}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.cs-window__header{background:var(--cs-header-gradient);color:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.cs-window__header-info{display:flex;flex-direction:column;gap:2px}.cs-window__title{margin:0;font-size:16px;font-weight:600}.cs-window__status{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.9}.cs-window__status-dot{width:8px;height:8px;background:#4ade80;border-radius:50%;box-shadow:0 0 0 2px #fff3}.cs-window__close{background:#fff3;border:none;color:#fff;width:32px;height:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.cs-window__close:hover{background:#ffffff4d}.cs-window__messages{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:16px;background:var(--cs-bg-color)}.cs-window__messages::-webkit-scrollbar{width:6px}.cs-window__messages::-webkit-scrollbar-track{background:transparent}.cs-window__messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.cs-window__messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}.cs-window__welcome{text-align:center;padding:40px 20px;color:#6b7280}.cs-window__welcome p{margin:0;font-size:16px}.cs-window__typing{display:flex;align-items:center;gap:8px;padding:12px 16px;background:var(--cs-assistant-message-color);border-radius:var(--cs-border-radius);width:fit-content;color:var(--cs-text-color)}.cs-window__typing-icon{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cs-window__error{background:#fee2e2;border:1px solid #ef4444;color:#991b1b;padding:12px 16px;border-radius:var(--cs-border-radius)}.cs-window__error p{margin:0}.cs-message{display:flex;flex-direction:column;gap:6px;max-width:85%;animation:fadeIn .3s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.cs-message--user{align-self:flex-end;align-items:flex-end}.cs-message--assistant{align-self:flex-start;align-items:flex-start}.cs-message__content{background:var(--cs-assistant-message-color);padding:12px 16px;border-radius:var(--cs-border-radius);border-bottom-left-radius:4px;color:var(--cs-text-color);word-wrap:break-word;box-shadow:var(--cs-shadow-sm)}.cs-message--user .cs-message__content{background:var(--cs-user-message-color);color:#fff;border-radius:var(--cs-border-radius);border-bottom-right-radius:4px}.cs-message__text{margin:0;line-height:1.5;white-space:pre-wrap}.cs-message__time{font-size:11px;color:#9ca3af;padding:0 4px}.cs-message__sources{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}.cs-message__sources-title{margin:0 0 8px;font-size:12px;font-weight:600;color:#6b7280}.cs-message__sources-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}.cs-message__source-item{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.cs-message__source-link{display:flex;align-items:center;gap:4px;color:var(--cs-primary-color);text-decoration:none;flex:1;min-width:0}.cs-message__source-link:hover{text-decoration:underline}.cs-message__source-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cs-message__source-similarity{color:#6b7280;font-size:11px;white-space:nowrap}.cs-window__input-wrapper{padding:16px;background:var(--cs-bg-color);border-top:1px solid #e5e7eb;flex-shrink:0}.cs-input{display:flex;gap:8px;align-items:flex-end}.cs-input__textarea{flex:1;padding:12px 16px;border:1px solid #d1d5db;border-radius:var(--cs-border-radius);font-family:var(--cs-font-family);font-size:14px;resize:none;max-height:120px;min-height:44px;transition:border-color .2s}.cs-input__textarea:focus{outline:none;border-color:var(--cs-primary-color);box-shadow:0 0 0 3px var(--cs-focus-ring);background-color:var(--cs-bg-color)}.cs-input__textarea:disabled{background:#f3f4f6;cursor:not-allowed}.cs-input__button{background:var(--cs-button-color);color:#fff;border:none;width:44px;height:44px;border-radius:var(--cs-border-radius);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0}.cs-input__button:hover:not(:disabled){background:var(--cs-secondary-color);transform:scale(1.05)}.cs-input__button:active:not(:disabled){transform:scale(.95)}.cs-input__button:disabled{background:#d1d5db;cursor:not-allowed}@media(max-width:480px){.cs-widget--open{position:fixed!important;inset:auto!important;bottom:20px!important;right:20px!important;width:auto!important;height:auto!important;z-index:10000!important}.cs-window{position:fixed!important;width:88vw!important;height:60vh!important;max-width:400px!important;max-height:500px!important;bottom:90px!important;right:5%!important;left:5%!important;top:auto!important;border-radius:var(--cs-border-radius)!important;box-shadow:var(--cs-shadow-xl)!important;display:flex!important;flex-direction:column!important;animation:slideUp .3s ease-out!important;overflow:visible!important}.cs-widget--open .cs-widget__toggle{display:flex!important;opacity:.8}.cs-window__messages{padding:16px}.cs-window__header{padding:12px 16px}.cs-window__input-wrapper{padding:12px}.cs-widget__toggle{width:50px;height:50px}}', Ln = ({
|
|
2041
2040
|
apiKey: e,
|
|
2042
2041
|
baseUrl: t,
|
|
2043
|
-
theme:
|
|
2044
|
-
position:
|
|
2042
|
+
theme: r,
|
|
2043
|
+
position: n = "bottom-right",
|
|
2045
2044
|
welcomeMessage: s,
|
|
2046
2045
|
placeholder: o,
|
|
2047
2046
|
className: i = "",
|
|
2048
2047
|
onError: a,
|
|
2049
|
-
onMessageSent:
|
|
2048
|
+
onMessageSent: f,
|
|
2050
2049
|
onMessageReceived: u
|
|
2051
2050
|
}) => {
|
|
2052
2051
|
const [l, p] = J(!1), {
|
|
2053
|
-
messages:
|
|
2054
|
-
sendMessage:
|
|
2055
|
-
isLoading:
|
|
2052
|
+
messages: y,
|
|
2053
|
+
sendMessage: R,
|
|
2054
|
+
isLoading: d,
|
|
2056
2055
|
error: h,
|
|
2057
2056
|
clearError: m
|
|
2058
|
-
} =
|
|
2057
|
+
} = cn({
|
|
2059
2058
|
apiKey: e,
|
|
2060
2059
|
baseUrl: t,
|
|
2061
2060
|
onError: a
|
|
2062
|
-
}),
|
|
2063
|
-
const
|
|
2064
|
-
return
|
|
2065
|
-
}, [
|
|
2066
|
-
if (
|
|
2067
|
-
const
|
|
2068
|
-
(
|
|
2061
|
+
}), E = w.useMemo(() => {
|
|
2062
|
+
const b = {};
|
|
2063
|
+
return b["--cs-primary-color"] = (r == null ? void 0 : r.primaryColor) || "#6366f1", b["--cs-secondary-color"] = (r == null ? void 0 : r.secondaryColor) || (r == null ? void 0 : r.primaryColor) || "#8b5cf6", b["--cs-bg-color"] = (r == null ? void 0 : r.backgroundColor) || "#ffffff", b["--cs-text-color"] = (r == null ? void 0 : r.textColor) || "#1f2937", b["--cs-font-family"] = (r == null ? void 0 : r.fontFamily) || "inherit", b["--cs-border-radius"] = (r == null ? void 0 : r.borderRadius) || "12px", b["--cs-button-color"] = (r == null ? void 0 : r.buttonColor) || (r == null ? void 0 : r.primaryColor) || "#6366f1", b["--cs-user-message-color"] = (r == null ? void 0 : r.userMessageColor) || (r == null ? void 0 : r.primaryColor) || "#6366f1", b["--cs-assistant-message-color"] = (r == null ? void 0 : r.assistantMessageColor) || "rgba(0, 0, 0, 0.05)", r != null && r.primaryColor && (b["--cs-focus-ring"] = `${r.primaryColor}33`), b;
|
|
2064
|
+
}, [r]), _ = async (b) => {
|
|
2065
|
+
if (f == null || f(b), await R(b), !h) {
|
|
2066
|
+
const O = y[y.length - 1];
|
|
2067
|
+
(O == null ? void 0 : O.role) === "ASSISTANT" && (u == null || u(O.content));
|
|
2069
2068
|
}
|
|
2070
|
-
},
|
|
2069
|
+
}, x = () => {
|
|
2071
2070
|
p(!l), h && m();
|
|
2072
2071
|
};
|
|
2073
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ w.createElement(
|
|
2074
2073
|
"div",
|
|
2075
2074
|
{
|
|
2076
|
-
className: `cs-widget cs-widget--${
|
|
2077
|
-
style:
|
|
2075
|
+
className: `cs-widget cs-widget--${n} ${l ? "cs-widget--open" : ""} ${i}`,
|
|
2076
|
+
style: E
|
|
2078
2077
|
},
|
|
2079
|
-
|
|
2080
|
-
|
|
2078
|
+
/* @__PURE__ */ w.createElement("style", { dangerouslySetInnerHTML: { __html: fn } }),
|
|
2079
|
+
l && /* @__PURE__ */ w.createElement(
|
|
2080
|
+
dn,
|
|
2081
2081
|
{
|
|
2082
|
-
messages:
|
|
2083
|
-
onSendMessage:
|
|
2082
|
+
messages: y,
|
|
2083
|
+
onSendMessage: _,
|
|
2084
2084
|
onClose: () => p(!1),
|
|
2085
|
-
isLoading:
|
|
2085
|
+
isLoading: d,
|
|
2086
2086
|
error: h,
|
|
2087
2087
|
placeholder: o,
|
|
2088
2088
|
welcomeMessage: s
|
|
2089
2089
|
}
|
|
2090
2090
|
),
|
|
2091
|
-
/* @__PURE__ */
|
|
2091
|
+
/* @__PURE__ */ w.createElement(
|
|
2092
2092
|
"button",
|
|
2093
2093
|
{
|
|
2094
2094
|
className: `cs-widget__toggle ${l ? "cs-widget__toggle--open" : ""}`,
|
|
2095
|
-
onClick:
|
|
2095
|
+
onClick: x,
|
|
2096
2096
|
"aria-label": l ? "Close chat" : "Open chat",
|
|
2097
2097
|
"aria-expanded": l
|
|
2098
2098
|
},
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
!l &&
|
|
2099
|
+
/* @__PURE__ */ w.createElement(At, { size: 24 }),
|
|
2100
|
+
!l && y.length > 0 && /* @__PURE__ */ w.createElement("span", { className: "cs-widget__badge" }, y.filter((b) => b.role.toUpperCase() === "ASSISTANT").length)
|
|
2101
2101
|
)
|
|
2102
2102
|
);
|
|
2103
2103
|
};
|
|
2104
2104
|
export {
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2105
|
+
un as ChatInput,
|
|
2106
|
+
ln as ChatMessage,
|
|
2107
|
+
dn as ChatWindow,
|
|
2108
|
+
sn as CustomerSupportAPIClient,
|
|
2109
|
+
Ln as CustomerSupportWidget,
|
|
2110
|
+
cn as useCustomerSupport,
|
|
2111
|
+
We as useLocalStorage
|
|
2112
2112
|
};
|
|
2113
2113
|
//# sourceMappingURL=index.es.js.map
|