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