react-aichatbot-widget 2.0.6 → 2.0.8
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/index.cjs +6 -1
- package/dist/index.js +2005 -226
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Minus as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as k, jsx as w, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useRef as Rt, useEffect as le } from "react";
|
|
3
|
+
import { Minus as Ct, MessageCircle as Qe, Loader as Ot, Send as Tt, Minimize2 as At, Maximize2 as kt, X as Nt } from "lucide-react";
|
|
4
|
+
const Ft = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
5
|
+
const o = r.position === "left", i = o ? "32px" : "auto", s = o ? "auto" : "32px", l = localStorage.getItem("clone67ChatSessionId"), f = {
|
|
6
6
|
position: "fixed",
|
|
7
7
|
bottom: "32px",
|
|
8
|
-
left:
|
|
9
|
-
right:
|
|
10
|
-
background: `linear-gradient(135deg, ${
|
|
11
|
-
color:
|
|
8
|
+
left: i,
|
|
9
|
+
right: s,
|
|
10
|
+
background: `linear-gradient(135deg, ${n.primaryColor}, ${n.secondaryColor})`,
|
|
11
|
+
color: n.fontColor,
|
|
12
12
|
width: "64px",
|
|
13
13
|
height: "64px",
|
|
14
14
|
borderRadius: "50%",
|
|
@@ -22,14 +22,14 @@ const V = ({ onMinimise: e, isOpen: t, theme: s, chatBotData: i }) => {
|
|
|
22
22
|
transition: "all 300ms ease",
|
|
23
23
|
outline: "none"
|
|
24
24
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ k(
|
|
26
26
|
"button",
|
|
27
27
|
{
|
|
28
28
|
onClick: e,
|
|
29
|
-
style:
|
|
29
|
+
style: f,
|
|
30
30
|
children: [
|
|
31
|
-
t ? /* @__PURE__ */
|
|
32
|
-
!t &&
|
|
31
|
+
t ? /* @__PURE__ */ w(Ct, { size: 20, strokeWidth: 2.5 }) : /* @__PURE__ */ w(Qe, { size: 20, strokeWidth: 2.5 }),
|
|
32
|
+
!t && l && /* @__PURE__ */ w("span", { style: {
|
|
33
33
|
position: "absolute",
|
|
34
34
|
top: "-4px",
|
|
35
35
|
right: "-4px",
|
|
@@ -43,48 +43,48 @@ const V = ({ onMinimise: e, isOpen: t, theme: s, chatBotData: i }) => {
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
|
-
},
|
|
46
|
+
}, A = [];
|
|
47
47
|
for (let e = 0; e < 256; ++e)
|
|
48
|
-
|
|
49
|
-
function
|
|
50
|
-
return (
|
|
51
|
-
}
|
|
52
|
-
let
|
|
53
|
-
const
|
|
54
|
-
function
|
|
55
|
-
if (!
|
|
48
|
+
A.push((e + 256).toString(16).slice(1));
|
|
49
|
+
function Pt(e, t = 0) {
|
|
50
|
+
return (A[e[t + 0]] + A[e[t + 1]] + A[e[t + 2]] + A[e[t + 3]] + "-" + A[e[t + 4]] + A[e[t + 5]] + "-" + A[e[t + 6]] + A[e[t + 7]] + "-" + A[e[t + 8]] + A[e[t + 9]] + "-" + A[e[t + 10]] + A[e[t + 11]] + A[e[t + 12]] + A[e[t + 13]] + A[e[t + 14]] + A[e[t + 15]]).toLowerCase();
|
|
51
|
+
}
|
|
52
|
+
let ye;
|
|
53
|
+
const _t = new Uint8Array(16);
|
|
54
|
+
function Ut() {
|
|
55
|
+
if (!ye) {
|
|
56
56
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
57
57
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
58
|
-
|
|
58
|
+
ye = crypto.getRandomValues.bind(crypto);
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return ye(_t);
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
function
|
|
62
|
+
const It = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ie = { randomUUID: It };
|
|
63
|
+
function Lt(e, t, n) {
|
|
64
64
|
e = e || {};
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
65
|
+
const r = e.random ?? e.rng?.() ?? Ut();
|
|
66
|
+
if (r.length < 16)
|
|
67
67
|
throw new Error("Random bytes length must be >= 16");
|
|
68
|
-
return
|
|
68
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Pt(r);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
function Dt(e, t, n) {
|
|
71
|
+
return Ie.randomUUID && !e ? Ie.randomUUID() : Lt(e);
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
const [
|
|
75
|
-
if (
|
|
73
|
+
const Bt = ({ messages: e, chatBotData: t, theme: n, isExpand: r }) => {
|
|
74
|
+
const [o, i] = j([]), s = Rt(null), l = (c) => {
|
|
75
|
+
if (c === "") return null;
|
|
76
76
|
try {
|
|
77
|
-
return JSON.parse(
|
|
78
|
-
} catch (
|
|
79
|
-
return console.error("Error parsing message string to JSON:",
|
|
77
|
+
return JSON.parse(c);
|
|
78
|
+
} catch (m) {
|
|
79
|
+
return console.error("Error parsing message string to JSON:", m), null;
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, f = (c) => new Date(c).toLocaleString(void 0, {
|
|
82
82
|
hour: "2-digit",
|
|
83
83
|
minute: "2-digit",
|
|
84
84
|
hour12: !0
|
|
85
85
|
});
|
|
86
|
-
|
|
87
|
-
e === "" &&
|
|
86
|
+
le(() => {
|
|
87
|
+
e === "" && i([
|
|
88
88
|
{
|
|
89
89
|
created_at: Date.now(),
|
|
90
90
|
sender_type: "bot",
|
|
@@ -92,55 +92,55 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
92
92
|
suggested_prompt: []
|
|
93
93
|
}
|
|
94
94
|
]);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
}, [e]),
|
|
98
|
-
|
|
99
|
-
}, [
|
|
100
|
-
const
|
|
101
|
-
height:
|
|
95
|
+
const c = l(e);
|
|
96
|
+
c && i((m) => [...m, c]);
|
|
97
|
+
}, [e]), le(() => {
|
|
98
|
+
s.current?.scrollIntoView({ behavior: "smooth" });
|
|
99
|
+
}, [o]);
|
|
100
|
+
const d = o.flat(), u = {
|
|
101
|
+
height: r ? "500px" : "400px",
|
|
102
102
|
overflowY: "auto",
|
|
103
103
|
padding: "10px",
|
|
104
|
-
background:
|
|
105
|
-
color:
|
|
104
|
+
background: n.backgroundColor,
|
|
105
|
+
color: n.fontColor,
|
|
106
106
|
borderTop: "1px solid rgba(255, 255, 255, 0.2)",
|
|
107
107
|
display: "flex",
|
|
108
108
|
flexDirection: "column"
|
|
109
|
-
},
|
|
109
|
+
}, h = (c) => ({
|
|
110
110
|
display: "flex",
|
|
111
|
-
justifyContent:
|
|
111
|
+
justifyContent: c === "user" ? "flex-end" : "flex-start",
|
|
112
112
|
width: "100%"
|
|
113
|
-
}),
|
|
113
|
+
}), g = {
|
|
114
114
|
display: "flex",
|
|
115
115
|
flexDirection: "column",
|
|
116
116
|
maxWidth: "80%"
|
|
117
|
-
},
|
|
117
|
+
}, S = (c) => ({
|
|
118
118
|
padding: "10px",
|
|
119
|
-
borderRadius:
|
|
119
|
+
borderRadius: c === "user" ? "12px 0 12px 12px" : "0 12px 12px 12px",
|
|
120
120
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
121
121
|
fontSize: "14px",
|
|
122
122
|
lineHeight: "1.5",
|
|
123
|
-
background:
|
|
124
|
-
color:
|
|
123
|
+
background: c === "user" ? n.primaryColor : "#f5f5f5",
|
|
124
|
+
color: n.fontColor,
|
|
125
125
|
wordWrap: "break-word"
|
|
126
126
|
});
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ k("div", { style: u, children: [
|
|
128
|
+
d.map((c, m) => /* @__PURE__ */ w("div", { style: h(c.sender_type), children: /* @__PURE__ */ k("div", { style: g, children: [
|
|
129
|
+
/* @__PURE__ */ w("div", { style: c.sender_type === "user" ? S("user") : S("ai"), children: c.message }),
|
|
130
|
+
/* @__PURE__ */ w("div", { style: {
|
|
131
131
|
display: "flex",
|
|
132
132
|
alignItems: "center",
|
|
133
133
|
marginLeft: "4px",
|
|
134
|
-
justifyContent:
|
|
135
|
-
}, children: /* @__PURE__ */
|
|
136
|
-
|
|
134
|
+
justifyContent: c.sender_type === "user" ? "flex-end" : "flex-start"
|
|
135
|
+
}, children: /* @__PURE__ */ k("span", { style: { fontSize: "10px", opacity: 0.55, color: n.fontColor }, children: [
|
|
136
|
+
c.sender_type === "user" ? "You" : `${t.name}`,
|
|
137
137
|
" • ",
|
|
138
|
-
|
|
138
|
+
f(c.created_at)
|
|
139
139
|
] }) })
|
|
140
|
-
] }) },
|
|
141
|
-
/* @__PURE__ */
|
|
140
|
+
] }) }, m)),
|
|
141
|
+
/* @__PURE__ */ w("div", { ref: s })
|
|
142
142
|
] });
|
|
143
|
-
},
|
|
143
|
+
}, jt = ({ theme: e }) => {
|
|
144
144
|
const t = {
|
|
145
145
|
height: "100%",
|
|
146
146
|
background: e.backgroundColor,
|
|
@@ -148,7 +148,7 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
148
148
|
display: "flex",
|
|
149
149
|
alignItems: "center",
|
|
150
150
|
justifyContent: "center"
|
|
151
|
-
},
|
|
151
|
+
}, n = {
|
|
152
152
|
padding: "24px 32px",
|
|
153
153
|
background: e.backgroundColor,
|
|
154
154
|
display: "flex",
|
|
@@ -156,64 +156,1843 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
156
156
|
alignItems: "center",
|
|
157
157
|
gap: "10px"
|
|
158
158
|
};
|
|
159
|
-
return /* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ w("div", { style: t, children: /* @__PURE__ */ k("div", { style: n, children: [
|
|
160
|
+
/* @__PURE__ */ w(Ot, { size: 26 }),
|
|
161
|
+
/* @__PURE__ */ w("p", { style: {
|
|
162
162
|
fontSize: "14px",
|
|
163
163
|
opacity: 0.85
|
|
164
164
|
}, children: "Exiting chat… please wait" })
|
|
165
165
|
] }) });
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
166
|
+
}, vt = (e, t) => ({ socket: new WebSocket(`wss://handle-chat-session.clone67.com?chatbotNamespace=${t}&sessionId=${e}`) });
|
|
167
|
+
function Ye(e, t) {
|
|
168
|
+
return function() {
|
|
169
|
+
return e.apply(t, arguments);
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
const { toString: $t } = Object.prototype, { getPrototypeOf: Oe } = Object, { iterator: ue, toStringTag: Ze } = Symbol, de = /* @__PURE__ */ ((e) => (t) => {
|
|
173
|
+
const n = $t.call(t);
|
|
174
|
+
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
175
|
+
})(/* @__PURE__ */ Object.create(null)), L = (e) => (e = e.toLowerCase(), (t) => de(t) === e), fe = (e) => (t) => typeof t === e, { isArray: K } = Array, V = fe("undefined");
|
|
176
|
+
function Y(e) {
|
|
177
|
+
return e !== null && !V(e) && e.constructor !== null && !V(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
178
|
+
}
|
|
179
|
+
const et = L("ArrayBuffer");
|
|
180
|
+
function Ht(e) {
|
|
181
|
+
let t;
|
|
182
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && et(e.buffer), t;
|
|
183
|
+
}
|
|
184
|
+
const zt = fe("string"), P = fe("function"), tt = fe("number"), Z = (e) => e !== null && typeof e == "object", Mt = (e) => e === !0 || e === !1, se = (e) => {
|
|
185
|
+
if (de(e) !== "object")
|
|
186
|
+
return !1;
|
|
187
|
+
const t = Oe(e);
|
|
188
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Ze in e) && !(ue in e);
|
|
189
|
+
}, qt = (e) => {
|
|
190
|
+
if (!Z(e) || Y(e))
|
|
191
|
+
return !1;
|
|
192
|
+
try {
|
|
193
|
+
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
194
|
+
} catch {
|
|
195
|
+
return !1;
|
|
196
|
+
}
|
|
197
|
+
}, Wt = L("Date"), Jt = L("File"), Vt = L("Blob"), Kt = L("FileList"), Xt = (e) => Z(e) && P(e.pipe), Gt = (e) => {
|
|
198
|
+
let t;
|
|
199
|
+
return e && (typeof FormData == "function" && e instanceof FormData || P(e.append) && ((t = de(e)) === "formdata" || // detect form-data instance
|
|
200
|
+
t === "object" && P(e.toString) && e.toString() === "[object FormData]"));
|
|
201
|
+
}, Qt = L("URLSearchParams"), [Yt, Zt, en, tn] = ["ReadableStream", "Request", "Response", "Headers"].map(L), nn = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
202
|
+
function ee(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
203
|
+
if (e === null || typeof e > "u")
|
|
204
|
+
return;
|
|
205
|
+
let r, o;
|
|
206
|
+
if (typeof e != "object" && (e = [e]), K(e))
|
|
207
|
+
for (r = 0, o = e.length; r < o; r++)
|
|
208
|
+
t.call(null, e[r], r, e);
|
|
209
|
+
else {
|
|
210
|
+
if (Y(e))
|
|
211
|
+
return;
|
|
212
|
+
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = i.length;
|
|
213
|
+
let l;
|
|
214
|
+
for (r = 0; r < s; r++)
|
|
215
|
+
l = i[r], t.call(null, e[l], l, e);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function nt(e, t) {
|
|
219
|
+
if (Y(e))
|
|
220
|
+
return null;
|
|
221
|
+
t = t.toLowerCase();
|
|
222
|
+
const n = Object.keys(e);
|
|
223
|
+
let r = n.length, o;
|
|
224
|
+
for (; r-- > 0; )
|
|
225
|
+
if (o = n[r], t === o.toLowerCase())
|
|
226
|
+
return o;
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const z = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, rt = (e) => !V(e) && e !== z;
|
|
230
|
+
function xe() {
|
|
231
|
+
const { caseless: e, skipUndefined: t } = rt(this) && this || {}, n = {}, r = (o, i) => {
|
|
232
|
+
const s = e && nt(n, i) || i;
|
|
233
|
+
se(n[s]) && se(o) ? n[s] = xe(n[s], o) : se(o) ? n[s] = xe({}, o) : K(o) ? n[s] = o.slice() : (!t || !V(o)) && (n[s] = o);
|
|
234
|
+
};
|
|
235
|
+
for (let o = 0, i = arguments.length; o < i; o++)
|
|
236
|
+
arguments[o] && ee(arguments[o], r);
|
|
237
|
+
return n;
|
|
238
|
+
}
|
|
239
|
+
const rn = (e, t, n, { allOwnKeys: r } = {}) => (ee(t, (o, i) => {
|
|
240
|
+
n && P(o) ? e[i] = Ye(o, n) : e[i] = o;
|
|
241
|
+
}, { allOwnKeys: r }), e), on = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), sn = (e, t, n, r) => {
|
|
242
|
+
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
243
|
+
value: t.prototype
|
|
244
|
+
}), n && Object.assign(e.prototype, n);
|
|
245
|
+
}, an = (e, t, n, r) => {
|
|
246
|
+
let o, i, s;
|
|
247
|
+
const l = {};
|
|
248
|
+
if (t = t || {}, e == null) return t;
|
|
249
|
+
do {
|
|
250
|
+
for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
|
|
251
|
+
s = o[i], (!r || r(s, e, t)) && !l[s] && (t[s] = e[s], l[s] = !0);
|
|
252
|
+
e = n !== !1 && Oe(e);
|
|
253
|
+
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
254
|
+
return t;
|
|
255
|
+
}, ln = (e, t, n) => {
|
|
256
|
+
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
257
|
+
const r = e.indexOf(t, n);
|
|
258
|
+
return r !== -1 && r === n;
|
|
259
|
+
}, cn = (e) => {
|
|
260
|
+
if (!e) return null;
|
|
261
|
+
if (K(e)) return e;
|
|
262
|
+
let t = e.length;
|
|
263
|
+
if (!tt(t)) return null;
|
|
264
|
+
const n = new Array(t);
|
|
265
|
+
for (; t-- > 0; )
|
|
266
|
+
n[t] = e[t];
|
|
267
|
+
return n;
|
|
268
|
+
}, un = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Oe(Uint8Array)), dn = (e, t) => {
|
|
269
|
+
const r = (e && e[ue]).call(e);
|
|
270
|
+
let o;
|
|
271
|
+
for (; (o = r.next()) && !o.done; ) {
|
|
272
|
+
const i = o.value;
|
|
273
|
+
t.call(e, i[0], i[1]);
|
|
274
|
+
}
|
|
275
|
+
}, fn = (e, t) => {
|
|
276
|
+
let n;
|
|
277
|
+
const r = [];
|
|
278
|
+
for (; (n = e.exec(t)) !== null; )
|
|
279
|
+
r.push(n);
|
|
280
|
+
return r;
|
|
281
|
+
}, pn = L("HTMLFormElement"), hn = (e) => e.toLowerCase().replace(
|
|
282
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
283
|
+
function(n, r, o) {
|
|
284
|
+
return r.toUpperCase() + o;
|
|
285
|
+
}
|
|
286
|
+
), Le = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), mn = L("RegExp"), ot = (e, t) => {
|
|
287
|
+
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
288
|
+
ee(n, (o, i) => {
|
|
289
|
+
let s;
|
|
290
|
+
(s = t(o, i, e)) !== !1 && (r[i] = s || o);
|
|
291
|
+
}), Object.defineProperties(e, r);
|
|
292
|
+
}, yn = (e) => {
|
|
293
|
+
ot(e, (t, n) => {
|
|
294
|
+
if (P(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
295
|
+
return !1;
|
|
296
|
+
const r = e[n];
|
|
297
|
+
if (P(r)) {
|
|
298
|
+
if (t.enumerable = !1, "writable" in t) {
|
|
299
|
+
t.writable = !1;
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
t.set || (t.set = () => {
|
|
303
|
+
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}, bn = (e, t) => {
|
|
308
|
+
const n = {}, r = (o) => {
|
|
309
|
+
o.forEach((i) => {
|
|
310
|
+
n[i] = !0;
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
return K(e) ? r(e) : r(String(e).split(t)), n;
|
|
314
|
+
}, gn = () => {
|
|
315
|
+
}, wn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
316
|
+
function Sn(e) {
|
|
317
|
+
return !!(e && P(e.append) && e[Ze] === "FormData" && e[ue]);
|
|
318
|
+
}
|
|
319
|
+
const xn = (e) => {
|
|
320
|
+
const t = new Array(10), n = (r, o) => {
|
|
321
|
+
if (Z(r)) {
|
|
322
|
+
if (t.indexOf(r) >= 0)
|
|
323
|
+
return;
|
|
324
|
+
if (Y(r))
|
|
325
|
+
return r;
|
|
326
|
+
if (!("toJSON" in r)) {
|
|
327
|
+
t[o] = r;
|
|
328
|
+
const i = K(r) ? [] : {};
|
|
329
|
+
return ee(r, (s, l) => {
|
|
330
|
+
const f = n(s, o + 1);
|
|
331
|
+
!V(f) && (i[l] = f);
|
|
332
|
+
}), t[o] = void 0, i;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return r;
|
|
336
|
+
};
|
|
337
|
+
return n(e, 0);
|
|
338
|
+
}, En = L("AsyncFunction"), Rn = (e) => e && (Z(e) || P(e)) && P(e.then) && P(e.catch), st = ((e, t) => e ? setImmediate : t ? ((n, r) => (z.addEventListener("message", ({ source: o, data: i }) => {
|
|
339
|
+
o === z && i === n && r.length && r.shift()();
|
|
340
|
+
}, !1), (o) => {
|
|
341
|
+
r.push(o), z.postMessage(n, "*");
|
|
342
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
343
|
+
typeof setImmediate == "function",
|
|
344
|
+
P(z.postMessage)
|
|
345
|
+
), Cn = typeof queueMicrotask < "u" ? queueMicrotask.bind(z) : typeof process < "u" && process.nextTick || st, On = (e) => e != null && P(e[ue]), a = {
|
|
346
|
+
isArray: K,
|
|
347
|
+
isArrayBuffer: et,
|
|
348
|
+
isBuffer: Y,
|
|
349
|
+
isFormData: Gt,
|
|
350
|
+
isArrayBufferView: Ht,
|
|
351
|
+
isString: zt,
|
|
352
|
+
isNumber: tt,
|
|
353
|
+
isBoolean: Mt,
|
|
354
|
+
isObject: Z,
|
|
355
|
+
isPlainObject: se,
|
|
356
|
+
isEmptyObject: qt,
|
|
357
|
+
isReadableStream: Yt,
|
|
358
|
+
isRequest: Zt,
|
|
359
|
+
isResponse: en,
|
|
360
|
+
isHeaders: tn,
|
|
361
|
+
isUndefined: V,
|
|
362
|
+
isDate: Wt,
|
|
363
|
+
isFile: Jt,
|
|
364
|
+
isBlob: Vt,
|
|
365
|
+
isRegExp: mn,
|
|
366
|
+
isFunction: P,
|
|
367
|
+
isStream: Xt,
|
|
368
|
+
isURLSearchParams: Qt,
|
|
369
|
+
isTypedArray: un,
|
|
370
|
+
isFileList: Kt,
|
|
371
|
+
forEach: ee,
|
|
372
|
+
merge: xe,
|
|
373
|
+
extend: rn,
|
|
374
|
+
trim: nn,
|
|
375
|
+
stripBOM: on,
|
|
376
|
+
inherits: sn,
|
|
377
|
+
toFlatObject: an,
|
|
378
|
+
kindOf: de,
|
|
379
|
+
kindOfTest: L,
|
|
380
|
+
endsWith: ln,
|
|
381
|
+
toArray: cn,
|
|
382
|
+
forEachEntry: dn,
|
|
383
|
+
matchAll: fn,
|
|
384
|
+
isHTMLForm: pn,
|
|
385
|
+
hasOwnProperty: Le,
|
|
386
|
+
hasOwnProp: Le,
|
|
387
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
388
|
+
reduceDescriptors: ot,
|
|
389
|
+
freezeMethods: yn,
|
|
390
|
+
toObjectSet: bn,
|
|
391
|
+
toCamelCase: hn,
|
|
392
|
+
noop: gn,
|
|
393
|
+
toFiniteNumber: wn,
|
|
394
|
+
findKey: nt,
|
|
395
|
+
global: z,
|
|
396
|
+
isContextDefined: rt,
|
|
397
|
+
isSpecCompliantForm: Sn,
|
|
398
|
+
toJSONObject: xn,
|
|
399
|
+
isAsyncFn: En,
|
|
400
|
+
isThenable: Rn,
|
|
401
|
+
setImmediate: st,
|
|
402
|
+
asap: Cn,
|
|
403
|
+
isIterable: On
|
|
404
|
+
};
|
|
405
|
+
function b(e, t, n, r, o) {
|
|
406
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
|
|
407
|
+
}
|
|
408
|
+
a.inherits(b, Error, {
|
|
409
|
+
toJSON: function() {
|
|
410
|
+
return {
|
|
411
|
+
// Standard
|
|
412
|
+
message: this.message,
|
|
413
|
+
name: this.name,
|
|
414
|
+
// Microsoft
|
|
415
|
+
description: this.description,
|
|
416
|
+
number: this.number,
|
|
417
|
+
// Mozilla
|
|
418
|
+
fileName: this.fileName,
|
|
419
|
+
lineNumber: this.lineNumber,
|
|
420
|
+
columnNumber: this.columnNumber,
|
|
421
|
+
stack: this.stack,
|
|
422
|
+
// Axios
|
|
423
|
+
config: a.toJSONObject(this.config),
|
|
424
|
+
code: this.code,
|
|
425
|
+
status: this.status
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
const it = b.prototype, at = {};
|
|
430
|
+
[
|
|
431
|
+
"ERR_BAD_OPTION_VALUE",
|
|
432
|
+
"ERR_BAD_OPTION",
|
|
433
|
+
"ECONNABORTED",
|
|
434
|
+
"ETIMEDOUT",
|
|
435
|
+
"ERR_NETWORK",
|
|
436
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
437
|
+
"ERR_DEPRECATED",
|
|
438
|
+
"ERR_BAD_RESPONSE",
|
|
439
|
+
"ERR_BAD_REQUEST",
|
|
440
|
+
"ERR_CANCELED",
|
|
441
|
+
"ERR_NOT_SUPPORT",
|
|
442
|
+
"ERR_INVALID_URL"
|
|
443
|
+
// eslint-disable-next-line func-names
|
|
444
|
+
].forEach((e) => {
|
|
445
|
+
at[e] = { value: e };
|
|
446
|
+
});
|
|
447
|
+
Object.defineProperties(b, at);
|
|
448
|
+
Object.defineProperty(it, "isAxiosError", { value: !0 });
|
|
449
|
+
b.from = (e, t, n, r, o, i) => {
|
|
450
|
+
const s = Object.create(it);
|
|
451
|
+
a.toFlatObject(e, s, function(u) {
|
|
452
|
+
return u !== Error.prototype;
|
|
453
|
+
}, (d) => d !== "isAxiosError");
|
|
454
|
+
const l = e && e.message ? e.message : "Error", f = t == null && e ? e.code : t;
|
|
455
|
+
return b.call(s, l, f, n, r, o), e && s.cause == null && Object.defineProperty(s, "cause", { value: e, configurable: !0 }), s.name = e && e.name || "Error", i && Object.assign(s, i), s;
|
|
456
|
+
};
|
|
457
|
+
const Tn = null;
|
|
458
|
+
function Ee(e) {
|
|
459
|
+
return a.isPlainObject(e) || a.isArray(e);
|
|
460
|
+
}
|
|
461
|
+
function lt(e) {
|
|
462
|
+
return a.endsWith(e, "[]") ? e.slice(0, -2) : e;
|
|
463
|
+
}
|
|
464
|
+
function De(e, t, n) {
|
|
465
|
+
return e ? e.concat(t).map(function(o, i) {
|
|
466
|
+
return o = lt(o), !n && i ? "[" + o + "]" : o;
|
|
467
|
+
}).join(n ? "." : "") : t;
|
|
468
|
+
}
|
|
469
|
+
function An(e) {
|
|
470
|
+
return a.isArray(e) && !e.some(Ee);
|
|
471
|
+
}
|
|
472
|
+
const kn = a.toFlatObject(a, {}, null, function(t) {
|
|
473
|
+
return /^is[A-Z]/.test(t);
|
|
474
|
+
});
|
|
475
|
+
function pe(e, t, n) {
|
|
476
|
+
if (!a.isObject(e))
|
|
477
|
+
throw new TypeError("target must be an object");
|
|
478
|
+
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
479
|
+
metaTokens: !0,
|
|
480
|
+
dots: !1,
|
|
481
|
+
indexes: !1
|
|
482
|
+
}, !1, function(m, p) {
|
|
483
|
+
return !a.isUndefined(p[m]);
|
|
484
|
+
});
|
|
485
|
+
const r = n.metaTokens, o = n.visitor || u, i = n.dots, s = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
486
|
+
if (!a.isFunction(o))
|
|
487
|
+
throw new TypeError("visitor must be a function");
|
|
488
|
+
function d(c) {
|
|
489
|
+
if (c === null) return "";
|
|
490
|
+
if (a.isDate(c))
|
|
491
|
+
return c.toISOString();
|
|
492
|
+
if (a.isBoolean(c))
|
|
493
|
+
return c.toString();
|
|
494
|
+
if (!f && a.isBlob(c))
|
|
495
|
+
throw new b("Blob is not supported. Use a Buffer instead.");
|
|
496
|
+
return a.isArrayBuffer(c) || a.isTypedArray(c) ? f && typeof Blob == "function" ? new Blob([c]) : Buffer.from(c) : c;
|
|
497
|
+
}
|
|
498
|
+
function u(c, m, p) {
|
|
499
|
+
let x = c;
|
|
500
|
+
if (c && !p && typeof c == "object") {
|
|
501
|
+
if (a.endsWith(m, "{}"))
|
|
502
|
+
m = r ? m : m.slice(0, -2), c = JSON.stringify(c);
|
|
503
|
+
else if (a.isArray(c) && An(c) || (a.isFileList(c) || a.endsWith(m, "[]")) && (x = a.toArray(c)))
|
|
504
|
+
return m = lt(m), x.forEach(function(E, C) {
|
|
505
|
+
!(a.isUndefined(E) || E === null) && t.append(
|
|
506
|
+
// eslint-disable-next-line no-nested-ternary
|
|
507
|
+
s === !0 ? De([m], C, i) : s === null ? m : m + "[]",
|
|
508
|
+
d(E)
|
|
509
|
+
);
|
|
510
|
+
}), !1;
|
|
511
|
+
}
|
|
512
|
+
return Ee(c) ? !0 : (t.append(De(p, m, i), d(c)), !1);
|
|
513
|
+
}
|
|
514
|
+
const h = [], g = Object.assign(kn, {
|
|
515
|
+
defaultVisitor: u,
|
|
516
|
+
convertValue: d,
|
|
517
|
+
isVisitable: Ee
|
|
518
|
+
});
|
|
519
|
+
function S(c, m) {
|
|
520
|
+
if (!a.isUndefined(c)) {
|
|
521
|
+
if (h.indexOf(c) !== -1)
|
|
522
|
+
throw Error("Circular reference detected in " + m.join("."));
|
|
523
|
+
h.push(c), a.forEach(c, function(x, T) {
|
|
524
|
+
(!(a.isUndefined(x) || x === null) && o.call(
|
|
525
|
+
t,
|
|
526
|
+
x,
|
|
527
|
+
a.isString(T) ? T.trim() : T,
|
|
528
|
+
m,
|
|
529
|
+
g
|
|
530
|
+
)) === !0 && S(x, m ? m.concat(T) : [T]);
|
|
531
|
+
}), h.pop();
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
if (!a.isObject(e))
|
|
535
|
+
throw new TypeError("data must be an object");
|
|
536
|
+
return S(e), t;
|
|
537
|
+
}
|
|
538
|
+
function Be(e) {
|
|
539
|
+
const t = {
|
|
540
|
+
"!": "%21",
|
|
541
|
+
"'": "%27",
|
|
542
|
+
"(": "%28",
|
|
543
|
+
")": "%29",
|
|
544
|
+
"~": "%7E",
|
|
545
|
+
"%20": "+",
|
|
546
|
+
"%00": "\0"
|
|
547
|
+
};
|
|
548
|
+
return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
549
|
+
return t[r];
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
function Te(e, t) {
|
|
553
|
+
this._pairs = [], e && pe(e, this, t);
|
|
554
|
+
}
|
|
555
|
+
const ct = Te.prototype;
|
|
556
|
+
ct.append = function(t, n) {
|
|
557
|
+
this._pairs.push([t, n]);
|
|
558
|
+
};
|
|
559
|
+
ct.toString = function(t) {
|
|
560
|
+
const n = t ? function(r) {
|
|
561
|
+
return t.call(this, r, Be);
|
|
562
|
+
} : Be;
|
|
563
|
+
return this._pairs.map(function(o) {
|
|
564
|
+
return n(o[0]) + "=" + n(o[1]);
|
|
565
|
+
}, "").join("&");
|
|
566
|
+
};
|
|
567
|
+
function Nn(e) {
|
|
568
|
+
return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
569
|
+
}
|
|
570
|
+
function ut(e, t, n) {
|
|
571
|
+
if (!t)
|
|
572
|
+
return e;
|
|
573
|
+
const r = n && n.encode || Nn;
|
|
574
|
+
a.isFunction(n) && (n = {
|
|
575
|
+
serialize: n
|
|
576
|
+
});
|
|
577
|
+
const o = n && n.serialize;
|
|
578
|
+
let i;
|
|
579
|
+
if (o ? i = o(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new Te(t, n).toString(r), i) {
|
|
580
|
+
const s = e.indexOf("#");
|
|
581
|
+
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
582
|
+
}
|
|
583
|
+
return e;
|
|
584
|
+
}
|
|
585
|
+
class je {
|
|
586
|
+
constructor() {
|
|
587
|
+
this.handlers = [];
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Add a new interceptor to the stack
|
|
591
|
+
*
|
|
592
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
593
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
594
|
+
*
|
|
595
|
+
* @return {Number} An ID used to remove interceptor later
|
|
596
|
+
*/
|
|
597
|
+
use(t, n, r) {
|
|
598
|
+
return this.handlers.push({
|
|
599
|
+
fulfilled: t,
|
|
600
|
+
rejected: n,
|
|
601
|
+
synchronous: r ? r.synchronous : !1,
|
|
602
|
+
runWhen: r ? r.runWhen : null
|
|
603
|
+
}), this.handlers.length - 1;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Remove an interceptor from the stack
|
|
607
|
+
*
|
|
608
|
+
* @param {Number} id The ID that was returned by `use`
|
|
609
|
+
*
|
|
610
|
+
* @returns {void}
|
|
611
|
+
*/
|
|
612
|
+
eject(t) {
|
|
613
|
+
this.handlers[t] && (this.handlers[t] = null);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Clear all interceptors from the stack
|
|
617
|
+
*
|
|
618
|
+
* @returns {void}
|
|
619
|
+
*/
|
|
620
|
+
clear() {
|
|
621
|
+
this.handlers && (this.handlers = []);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Iterate over all the registered interceptors
|
|
625
|
+
*
|
|
626
|
+
* This method is particularly useful for skipping over any
|
|
627
|
+
* interceptors that may have become `null` calling `eject`.
|
|
628
|
+
*
|
|
629
|
+
* @param {Function} fn The function to call for each interceptor
|
|
630
|
+
*
|
|
631
|
+
* @returns {void}
|
|
632
|
+
*/
|
|
633
|
+
forEach(t) {
|
|
634
|
+
a.forEach(this.handlers, function(r) {
|
|
635
|
+
r !== null && t(r);
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
const dt = {
|
|
640
|
+
silentJSONParsing: !0,
|
|
641
|
+
forcedJSONParsing: !0,
|
|
642
|
+
clarifyTimeoutError: !1
|
|
643
|
+
}, Fn = typeof URLSearchParams < "u" ? URLSearchParams : Te, Pn = typeof FormData < "u" ? FormData : null, _n = typeof Blob < "u" ? Blob : null, Un = {
|
|
644
|
+
isBrowser: !0,
|
|
645
|
+
classes: {
|
|
646
|
+
URLSearchParams: Fn,
|
|
647
|
+
FormData: Pn,
|
|
648
|
+
Blob: _n
|
|
649
|
+
},
|
|
650
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
651
|
+
}, Ae = typeof window < "u" && typeof document < "u", Re = typeof navigator == "object" && navigator || void 0, In = Ae && (!Re || ["ReactNative", "NativeScript", "NS"].indexOf(Re.product) < 0), Ln = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
652
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Dn = Ae && window.location.href || "http://localhost", Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
653
|
+
__proto__: null,
|
|
654
|
+
hasBrowserEnv: Ae,
|
|
655
|
+
hasStandardBrowserEnv: In,
|
|
656
|
+
hasStandardBrowserWebWorkerEnv: Ln,
|
|
657
|
+
navigator: Re,
|
|
658
|
+
origin: Dn
|
|
659
|
+
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
660
|
+
...Bn,
|
|
661
|
+
...Un
|
|
662
|
+
};
|
|
663
|
+
function jn(e, t) {
|
|
664
|
+
return pe(e, new N.classes.URLSearchParams(), {
|
|
665
|
+
visitor: function(n, r, o, i) {
|
|
666
|
+
return N.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
667
|
+
},
|
|
668
|
+
...t
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
function vn(e) {
|
|
672
|
+
return a.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
|
|
673
|
+
}
|
|
674
|
+
function $n(e) {
|
|
675
|
+
const t = {}, n = Object.keys(e);
|
|
676
|
+
let r;
|
|
677
|
+
const o = n.length;
|
|
678
|
+
let i;
|
|
679
|
+
for (r = 0; r < o; r++)
|
|
680
|
+
i = n[r], t[i] = e[i];
|
|
681
|
+
return t;
|
|
682
|
+
}
|
|
683
|
+
function ft(e) {
|
|
684
|
+
function t(n, r, o, i) {
|
|
685
|
+
let s = n[i++];
|
|
686
|
+
if (s === "__proto__") return !0;
|
|
687
|
+
const l = Number.isFinite(+s), f = i >= n.length;
|
|
688
|
+
return s = !s && a.isArray(o) ? o.length : s, f ? (a.hasOwnProp(o, s) ? o[s] = [o[s], r] : o[s] = r, !l) : ((!o[s] || !a.isObject(o[s])) && (o[s] = []), t(n, r, o[s], i) && a.isArray(o[s]) && (o[s] = $n(o[s])), !l);
|
|
689
|
+
}
|
|
690
|
+
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
691
|
+
const n = {};
|
|
692
|
+
return a.forEachEntry(e, (r, o) => {
|
|
693
|
+
t(vn(r), o, n, 0);
|
|
694
|
+
}), n;
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
}
|
|
698
|
+
function Hn(e, t, n) {
|
|
699
|
+
if (a.isString(e))
|
|
700
|
+
try {
|
|
701
|
+
return (t || JSON.parse)(e), a.trim(e);
|
|
702
|
+
} catch (r) {
|
|
703
|
+
if (r.name !== "SyntaxError")
|
|
704
|
+
throw r;
|
|
705
|
+
}
|
|
706
|
+
return (n || JSON.stringify)(e);
|
|
707
|
+
}
|
|
708
|
+
const te = {
|
|
709
|
+
transitional: dt,
|
|
710
|
+
adapter: ["xhr", "http", "fetch"],
|
|
711
|
+
transformRequest: [function(t, n) {
|
|
712
|
+
const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, i = a.isObject(t);
|
|
713
|
+
if (i && a.isHTMLForm(t) && (t = new FormData(t)), a.isFormData(t))
|
|
714
|
+
return o ? JSON.stringify(ft(t)) : t;
|
|
715
|
+
if (a.isArrayBuffer(t) || a.isBuffer(t) || a.isStream(t) || a.isFile(t) || a.isBlob(t) || a.isReadableStream(t))
|
|
716
|
+
return t;
|
|
717
|
+
if (a.isArrayBufferView(t))
|
|
718
|
+
return t.buffer;
|
|
719
|
+
if (a.isURLSearchParams(t))
|
|
720
|
+
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
|
|
721
|
+
let l;
|
|
722
|
+
if (i) {
|
|
723
|
+
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
724
|
+
return jn(t, this.formSerializer).toString();
|
|
725
|
+
if ((l = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
726
|
+
const f = this.env && this.env.FormData;
|
|
727
|
+
return pe(
|
|
728
|
+
l ? { "files[]": t } : t,
|
|
729
|
+
f && new f(),
|
|
730
|
+
this.formSerializer
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
return i || o ? (n.setContentType("application/json", !1), Hn(t)) : t;
|
|
735
|
+
}],
|
|
736
|
+
transformResponse: [function(t) {
|
|
737
|
+
const n = this.transitional || te.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
|
|
738
|
+
if (a.isResponse(t) || a.isReadableStream(t))
|
|
739
|
+
return t;
|
|
740
|
+
if (t && a.isString(t) && (r && !this.responseType || o)) {
|
|
741
|
+
const s = !(n && n.silentJSONParsing) && o;
|
|
177
742
|
try {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
743
|
+
return JSON.parse(t, this.parseReviver);
|
|
744
|
+
} catch (l) {
|
|
745
|
+
if (s)
|
|
746
|
+
throw l.name === "SyntaxError" ? b.from(l, b.ERR_BAD_RESPONSE, this, null, this.response) : l;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
return t;
|
|
750
|
+
}],
|
|
751
|
+
/**
|
|
752
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
753
|
+
* timeout is not created.
|
|
754
|
+
*/
|
|
755
|
+
timeout: 0,
|
|
756
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
757
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
758
|
+
maxContentLength: -1,
|
|
759
|
+
maxBodyLength: -1,
|
|
760
|
+
env: {
|
|
761
|
+
FormData: N.classes.FormData,
|
|
762
|
+
Blob: N.classes.Blob
|
|
763
|
+
},
|
|
764
|
+
validateStatus: function(t) {
|
|
765
|
+
return t >= 200 && t < 300;
|
|
766
|
+
},
|
|
767
|
+
headers: {
|
|
768
|
+
common: {
|
|
769
|
+
Accept: "application/json, text/plain, */*",
|
|
770
|
+
"Content-Type": void 0
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
775
|
+
te.headers[e] = {};
|
|
776
|
+
});
|
|
777
|
+
const zn = a.toObjectSet([
|
|
778
|
+
"age",
|
|
779
|
+
"authorization",
|
|
780
|
+
"content-length",
|
|
781
|
+
"content-type",
|
|
782
|
+
"etag",
|
|
783
|
+
"expires",
|
|
784
|
+
"from",
|
|
785
|
+
"host",
|
|
786
|
+
"if-modified-since",
|
|
787
|
+
"if-unmodified-since",
|
|
788
|
+
"last-modified",
|
|
789
|
+
"location",
|
|
790
|
+
"max-forwards",
|
|
791
|
+
"proxy-authorization",
|
|
792
|
+
"referer",
|
|
793
|
+
"retry-after",
|
|
794
|
+
"user-agent"
|
|
795
|
+
]), Mn = (e) => {
|
|
796
|
+
const t = {};
|
|
797
|
+
let n, r, o;
|
|
798
|
+
return e && e.split(`
|
|
799
|
+
`).forEach(function(s) {
|
|
800
|
+
o = s.indexOf(":"), n = s.substring(0, o).trim().toLowerCase(), r = s.substring(o + 1).trim(), !(!n || t[n] && zn[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
801
|
+
}), t;
|
|
802
|
+
}, ve = /* @__PURE__ */ Symbol("internals");
|
|
803
|
+
function Q(e) {
|
|
804
|
+
return e && String(e).trim().toLowerCase();
|
|
805
|
+
}
|
|
806
|
+
function ie(e) {
|
|
807
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(ie) : String(e);
|
|
808
|
+
}
|
|
809
|
+
function qn(e) {
|
|
810
|
+
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
811
|
+
let r;
|
|
812
|
+
for (; r = n.exec(e); )
|
|
813
|
+
t[r[1]] = r[2];
|
|
814
|
+
return t;
|
|
815
|
+
}
|
|
816
|
+
const Wn = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
817
|
+
function be(e, t, n, r, o) {
|
|
818
|
+
if (a.isFunction(r))
|
|
819
|
+
return r.call(this, t, n);
|
|
820
|
+
if (o && (t = n), !!a.isString(t)) {
|
|
821
|
+
if (a.isString(r))
|
|
822
|
+
return t.indexOf(r) !== -1;
|
|
823
|
+
if (a.isRegExp(r))
|
|
824
|
+
return r.test(t);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
function Jn(e) {
|
|
828
|
+
return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
|
|
829
|
+
}
|
|
830
|
+
function Vn(e, t) {
|
|
831
|
+
const n = a.toCamelCase(" " + t);
|
|
832
|
+
["get", "set", "has"].forEach((r) => {
|
|
833
|
+
Object.defineProperty(e, r + n, {
|
|
834
|
+
value: function(o, i, s) {
|
|
835
|
+
return this[r].call(this, t, o, i, s);
|
|
836
|
+
},
|
|
837
|
+
configurable: !0
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
let _ = class {
|
|
842
|
+
constructor(t) {
|
|
843
|
+
t && this.set(t);
|
|
844
|
+
}
|
|
845
|
+
set(t, n, r) {
|
|
846
|
+
const o = this;
|
|
847
|
+
function i(l, f, d) {
|
|
848
|
+
const u = Q(f);
|
|
849
|
+
if (!u)
|
|
850
|
+
throw new Error("header name must be a non-empty string");
|
|
851
|
+
const h = a.findKey(o, u);
|
|
852
|
+
(!h || o[h] === void 0 || d === !0 || d === void 0 && o[h] !== !1) && (o[h || f] = ie(l));
|
|
853
|
+
}
|
|
854
|
+
const s = (l, f) => a.forEach(l, (d, u) => i(d, u, f));
|
|
855
|
+
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
856
|
+
s(t, n);
|
|
857
|
+
else if (a.isString(t) && (t = t.trim()) && !Wn(t))
|
|
858
|
+
s(Mn(t), n);
|
|
859
|
+
else if (a.isObject(t) && a.isIterable(t)) {
|
|
860
|
+
let l = {}, f, d;
|
|
861
|
+
for (const u of t) {
|
|
862
|
+
if (!a.isArray(u))
|
|
863
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
864
|
+
l[d = u[0]] = (f = l[d]) ? a.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
|
|
865
|
+
}
|
|
866
|
+
s(l, n);
|
|
867
|
+
} else
|
|
868
|
+
t != null && i(n, t, r);
|
|
869
|
+
return this;
|
|
870
|
+
}
|
|
871
|
+
get(t, n) {
|
|
872
|
+
if (t = Q(t), t) {
|
|
873
|
+
const r = a.findKey(this, t);
|
|
874
|
+
if (r) {
|
|
875
|
+
const o = this[r];
|
|
876
|
+
if (!n)
|
|
877
|
+
return o;
|
|
878
|
+
if (n === !0)
|
|
879
|
+
return qn(o);
|
|
880
|
+
if (a.isFunction(n))
|
|
881
|
+
return n.call(this, o, r);
|
|
882
|
+
if (a.isRegExp(n))
|
|
883
|
+
return n.exec(o);
|
|
884
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
has(t, n) {
|
|
889
|
+
if (t = Q(t), t) {
|
|
890
|
+
const r = a.findKey(this, t);
|
|
891
|
+
return !!(r && this[r] !== void 0 && (!n || be(this, this[r], r, n)));
|
|
892
|
+
}
|
|
893
|
+
return !1;
|
|
894
|
+
}
|
|
895
|
+
delete(t, n) {
|
|
896
|
+
const r = this;
|
|
897
|
+
let o = !1;
|
|
898
|
+
function i(s) {
|
|
899
|
+
if (s = Q(s), s) {
|
|
900
|
+
const l = a.findKey(r, s);
|
|
901
|
+
l && (!n || be(r, r[l], l, n)) && (delete r[l], o = !0);
|
|
182
902
|
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
903
|
+
}
|
|
904
|
+
return a.isArray(t) ? t.forEach(i) : i(t), o;
|
|
905
|
+
}
|
|
906
|
+
clear(t) {
|
|
907
|
+
const n = Object.keys(this);
|
|
908
|
+
let r = n.length, o = !1;
|
|
909
|
+
for (; r--; ) {
|
|
910
|
+
const i = n[r];
|
|
911
|
+
(!t || be(this, this[i], i, t, !0)) && (delete this[i], o = !0);
|
|
912
|
+
}
|
|
913
|
+
return o;
|
|
914
|
+
}
|
|
915
|
+
normalize(t) {
|
|
916
|
+
const n = this, r = {};
|
|
917
|
+
return a.forEach(this, (o, i) => {
|
|
918
|
+
const s = a.findKey(r, i);
|
|
919
|
+
if (s) {
|
|
920
|
+
n[s] = ie(o), delete n[i];
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
const l = t ? Jn(i) : String(i).trim();
|
|
924
|
+
l !== i && delete n[i], n[l] = ie(o), r[l] = !0;
|
|
925
|
+
}), this;
|
|
926
|
+
}
|
|
927
|
+
concat(...t) {
|
|
928
|
+
return this.constructor.concat(this, ...t);
|
|
929
|
+
}
|
|
930
|
+
toJSON(t) {
|
|
931
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
932
|
+
return a.forEach(this, (r, o) => {
|
|
933
|
+
r != null && r !== !1 && (n[o] = t && a.isArray(r) ? r.join(", ") : r);
|
|
934
|
+
}), n;
|
|
935
|
+
}
|
|
936
|
+
[Symbol.iterator]() {
|
|
937
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
938
|
+
}
|
|
939
|
+
toString() {
|
|
940
|
+
return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
|
|
941
|
+
`);
|
|
942
|
+
}
|
|
943
|
+
getSetCookie() {
|
|
944
|
+
return this.get("set-cookie") || [];
|
|
945
|
+
}
|
|
946
|
+
get [Symbol.toStringTag]() {
|
|
947
|
+
return "AxiosHeaders";
|
|
948
|
+
}
|
|
949
|
+
static from(t) {
|
|
950
|
+
return t instanceof this ? t : new this(t);
|
|
951
|
+
}
|
|
952
|
+
static concat(t, ...n) {
|
|
953
|
+
const r = new this(t);
|
|
954
|
+
return n.forEach((o) => r.set(o)), r;
|
|
955
|
+
}
|
|
956
|
+
static accessor(t) {
|
|
957
|
+
const r = (this[ve] = this[ve] = {
|
|
958
|
+
accessors: {}
|
|
959
|
+
}).accessors, o = this.prototype;
|
|
960
|
+
function i(s) {
|
|
961
|
+
const l = Q(s);
|
|
962
|
+
r[l] || (Vn(o, s), r[l] = !0);
|
|
963
|
+
}
|
|
964
|
+
return a.isArray(t) ? t.forEach(i) : i(t), this;
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
_.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
968
|
+
a.reduceDescriptors(_.prototype, ({ value: e }, t) => {
|
|
969
|
+
let n = t[0].toUpperCase() + t.slice(1);
|
|
970
|
+
return {
|
|
971
|
+
get: () => e,
|
|
972
|
+
set(r) {
|
|
973
|
+
this[n] = r;
|
|
974
|
+
}
|
|
975
|
+
};
|
|
976
|
+
});
|
|
977
|
+
a.freezeMethods(_);
|
|
978
|
+
function ge(e, t) {
|
|
979
|
+
const n = this || te, r = t || n, o = _.from(r.headers);
|
|
980
|
+
let i = r.data;
|
|
981
|
+
return a.forEach(e, function(l) {
|
|
982
|
+
i = l.call(n, i, o.normalize(), t ? t.status : void 0);
|
|
983
|
+
}), o.normalize(), i;
|
|
984
|
+
}
|
|
985
|
+
function pt(e) {
|
|
986
|
+
return !!(e && e.__CANCEL__);
|
|
987
|
+
}
|
|
988
|
+
function X(e, t, n) {
|
|
989
|
+
b.call(this, e ?? "canceled", b.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
990
|
+
}
|
|
991
|
+
a.inherits(X, b, {
|
|
992
|
+
__CANCEL__: !0
|
|
993
|
+
});
|
|
994
|
+
function ht(e, t, n) {
|
|
995
|
+
const r = n.config.validateStatus;
|
|
996
|
+
!n.status || !r || r(n.status) ? e(n) : t(new b(
|
|
997
|
+
"Request failed with status code " + n.status,
|
|
998
|
+
[b.ERR_BAD_REQUEST, b.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
999
|
+
n.config,
|
|
1000
|
+
n.request,
|
|
1001
|
+
n
|
|
1002
|
+
));
|
|
1003
|
+
}
|
|
1004
|
+
function Kn(e) {
|
|
1005
|
+
const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
|
|
1006
|
+
return t && t[1] || "";
|
|
1007
|
+
}
|
|
1008
|
+
function Xn(e, t) {
|
|
1009
|
+
e = e || 10;
|
|
1010
|
+
const n = new Array(e), r = new Array(e);
|
|
1011
|
+
let o = 0, i = 0, s;
|
|
1012
|
+
return t = t !== void 0 ? t : 1e3, function(f) {
|
|
1013
|
+
const d = Date.now(), u = r[i];
|
|
1014
|
+
s || (s = d), n[o] = f, r[o] = d;
|
|
1015
|
+
let h = i, g = 0;
|
|
1016
|
+
for (; h !== o; )
|
|
1017
|
+
g += n[h++], h = h % e;
|
|
1018
|
+
if (o = (o + 1) % e, o === i && (i = (i + 1) % e), d - s < t)
|
|
1019
|
+
return;
|
|
1020
|
+
const S = u && d - u;
|
|
1021
|
+
return S ? Math.round(g * 1e3 / S) : void 0;
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
function Gn(e, t) {
|
|
1025
|
+
let n = 0, r = 1e3 / t, o, i;
|
|
1026
|
+
const s = (d, u = Date.now()) => {
|
|
1027
|
+
n = u, o = null, i && (clearTimeout(i), i = null), e(...d);
|
|
1028
|
+
};
|
|
1029
|
+
return [(...d) => {
|
|
1030
|
+
const u = Date.now(), h = u - n;
|
|
1031
|
+
h >= r ? s(d, u) : (o = d, i || (i = setTimeout(() => {
|
|
1032
|
+
i = null, s(o);
|
|
1033
|
+
}, r - h)));
|
|
1034
|
+
}, () => o && s(o)];
|
|
1035
|
+
}
|
|
1036
|
+
const ce = (e, t, n = 3) => {
|
|
1037
|
+
let r = 0;
|
|
1038
|
+
const o = Xn(50, 250);
|
|
1039
|
+
return Gn((i) => {
|
|
1040
|
+
const s = i.loaded, l = i.lengthComputable ? i.total : void 0, f = s - r, d = o(f), u = s <= l;
|
|
1041
|
+
r = s;
|
|
1042
|
+
const h = {
|
|
1043
|
+
loaded: s,
|
|
1044
|
+
total: l,
|
|
1045
|
+
progress: l ? s / l : void 0,
|
|
1046
|
+
bytes: f,
|
|
1047
|
+
rate: d || void 0,
|
|
1048
|
+
estimated: d && l && u ? (l - s) / d : void 0,
|
|
1049
|
+
event: i,
|
|
1050
|
+
lengthComputable: l != null,
|
|
1051
|
+
[t ? "download" : "upload"]: !0
|
|
187
1052
|
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
1053
|
+
e(h);
|
|
1054
|
+
}, n);
|
|
1055
|
+
}, $e = (e, t) => {
|
|
1056
|
+
const n = e != null;
|
|
1057
|
+
return [(r) => t[0]({
|
|
1058
|
+
lengthComputable: n,
|
|
1059
|
+
total: e,
|
|
1060
|
+
loaded: r
|
|
1061
|
+
}), t[1]];
|
|
1062
|
+
}, He = (e) => (...t) => a.asap(() => e(...t)), Qn = N.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, N.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
|
|
1063
|
+
new URL(N.origin),
|
|
1064
|
+
N.navigator && /(msie|trident)/i.test(N.navigator.userAgent)
|
|
1065
|
+
) : () => !0, Yn = N.hasStandardBrowserEnv ? (
|
|
1066
|
+
// Standard browser envs support document.cookie
|
|
1067
|
+
{
|
|
1068
|
+
write(e, t, n, r, o, i, s) {
|
|
1069
|
+
if (typeof document > "u") return;
|
|
1070
|
+
const l = [`${e}=${encodeURIComponent(t)}`];
|
|
1071
|
+
a.isNumber(n) && l.push(`expires=${new Date(n).toUTCString()}`), a.isString(r) && l.push(`path=${r}`), a.isString(o) && l.push(`domain=${o}`), i === !0 && l.push("secure"), a.isString(s) && l.push(`SameSite=${s}`), document.cookie = l.join("; ");
|
|
1072
|
+
},
|
|
1073
|
+
read(e) {
|
|
1074
|
+
if (typeof document > "u") return null;
|
|
1075
|
+
const t = document.cookie.match(new RegExp("(?:^|; )" + e + "=([^;]*)"));
|
|
1076
|
+
return t ? decodeURIComponent(t[1]) : null;
|
|
1077
|
+
},
|
|
1078
|
+
remove(e) {
|
|
1079
|
+
this.write(e, "", Date.now() - 864e5, "/");
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
) : (
|
|
1083
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1084
|
+
{
|
|
1085
|
+
write() {
|
|
1086
|
+
},
|
|
1087
|
+
read() {
|
|
1088
|
+
return null;
|
|
1089
|
+
},
|
|
1090
|
+
remove() {
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
);
|
|
1094
|
+
function Zn(e) {
|
|
1095
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
1096
|
+
}
|
|
1097
|
+
function er(e, t) {
|
|
1098
|
+
return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
|
|
1099
|
+
}
|
|
1100
|
+
function mt(e, t, n) {
|
|
1101
|
+
let r = !Zn(t);
|
|
1102
|
+
return e && (r || n == !1) ? er(e, t) : t;
|
|
1103
|
+
}
|
|
1104
|
+
const ze = (e) => e instanceof _ ? { ...e } : e;
|
|
1105
|
+
function q(e, t) {
|
|
1106
|
+
t = t || {};
|
|
1107
|
+
const n = {};
|
|
1108
|
+
function r(d, u, h, g) {
|
|
1109
|
+
return a.isPlainObject(d) && a.isPlainObject(u) ? a.merge.call({ caseless: g }, d, u) : a.isPlainObject(u) ? a.merge({}, u) : a.isArray(u) ? u.slice() : u;
|
|
1110
|
+
}
|
|
1111
|
+
function o(d, u, h, g) {
|
|
1112
|
+
if (a.isUndefined(u)) {
|
|
1113
|
+
if (!a.isUndefined(d))
|
|
1114
|
+
return r(void 0, d, h, g);
|
|
1115
|
+
} else return r(d, u, h, g);
|
|
1116
|
+
}
|
|
1117
|
+
function i(d, u) {
|
|
1118
|
+
if (!a.isUndefined(u))
|
|
1119
|
+
return r(void 0, u);
|
|
1120
|
+
}
|
|
1121
|
+
function s(d, u) {
|
|
1122
|
+
if (a.isUndefined(u)) {
|
|
1123
|
+
if (!a.isUndefined(d))
|
|
1124
|
+
return r(void 0, d);
|
|
1125
|
+
} else return r(void 0, u);
|
|
1126
|
+
}
|
|
1127
|
+
function l(d, u, h) {
|
|
1128
|
+
if (h in t)
|
|
1129
|
+
return r(d, u);
|
|
1130
|
+
if (h in e)
|
|
1131
|
+
return r(void 0, d);
|
|
1132
|
+
}
|
|
1133
|
+
const f = {
|
|
1134
|
+
url: i,
|
|
1135
|
+
method: i,
|
|
1136
|
+
data: i,
|
|
1137
|
+
baseURL: s,
|
|
1138
|
+
transformRequest: s,
|
|
1139
|
+
transformResponse: s,
|
|
1140
|
+
paramsSerializer: s,
|
|
1141
|
+
timeout: s,
|
|
1142
|
+
timeoutMessage: s,
|
|
1143
|
+
withCredentials: s,
|
|
1144
|
+
withXSRFToken: s,
|
|
1145
|
+
adapter: s,
|
|
1146
|
+
responseType: s,
|
|
1147
|
+
xsrfCookieName: s,
|
|
1148
|
+
xsrfHeaderName: s,
|
|
1149
|
+
onUploadProgress: s,
|
|
1150
|
+
onDownloadProgress: s,
|
|
1151
|
+
decompress: s,
|
|
1152
|
+
maxContentLength: s,
|
|
1153
|
+
maxBodyLength: s,
|
|
1154
|
+
beforeRedirect: s,
|
|
1155
|
+
transport: s,
|
|
1156
|
+
httpAgent: s,
|
|
1157
|
+
httpsAgent: s,
|
|
1158
|
+
cancelToken: s,
|
|
1159
|
+
socketPath: s,
|
|
1160
|
+
responseEncoding: s,
|
|
1161
|
+
validateStatus: l,
|
|
1162
|
+
headers: (d, u, h) => o(ze(d), ze(u), h, !0)
|
|
1163
|
+
};
|
|
1164
|
+
return a.forEach(Object.keys({ ...e, ...t }), function(u) {
|
|
1165
|
+
const h = f[u] || o, g = h(e[u], t[u], u);
|
|
1166
|
+
a.isUndefined(g) && h !== l || (n[u] = g);
|
|
1167
|
+
}), n;
|
|
1168
|
+
}
|
|
1169
|
+
const yt = (e) => {
|
|
1170
|
+
const t = q({}, e);
|
|
1171
|
+
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: l } = t;
|
|
1172
|
+
if (t.headers = s = _.from(s), t.url = ut(mt(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && s.set(
|
|
1173
|
+
"Authorization",
|
|
1174
|
+
"Basic " + btoa((l.username || "") + ":" + (l.password ? unescape(encodeURIComponent(l.password)) : ""))
|
|
1175
|
+
), a.isFormData(n)) {
|
|
1176
|
+
if (N.hasStandardBrowserEnv || N.hasStandardBrowserWebWorkerEnv)
|
|
1177
|
+
s.setContentType(void 0);
|
|
1178
|
+
else if (a.isFunction(n.getHeaders)) {
|
|
1179
|
+
const f = n.getHeaders(), d = ["content-type", "content-length"];
|
|
1180
|
+
Object.entries(f).forEach(([u, h]) => {
|
|
1181
|
+
d.includes(u.toLowerCase()) && s.set(u, h);
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
if (N.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && Qn(t.url))) {
|
|
1186
|
+
const f = o && i && Yn.read(i);
|
|
1187
|
+
f && s.set(o, f);
|
|
1188
|
+
}
|
|
1189
|
+
return t;
|
|
1190
|
+
}, tr = typeof XMLHttpRequest < "u", nr = tr && function(e) {
|
|
1191
|
+
return new Promise(function(n, r) {
|
|
1192
|
+
const o = yt(e);
|
|
1193
|
+
let i = o.data;
|
|
1194
|
+
const s = _.from(o.headers).normalize();
|
|
1195
|
+
let { responseType: l, onUploadProgress: f, onDownloadProgress: d } = o, u, h, g, S, c;
|
|
1196
|
+
function m() {
|
|
1197
|
+
S && S(), c && c(), o.cancelToken && o.cancelToken.unsubscribe(u), o.signal && o.signal.removeEventListener("abort", u);
|
|
1198
|
+
}
|
|
1199
|
+
let p = new XMLHttpRequest();
|
|
1200
|
+
p.open(o.method.toUpperCase(), o.url, !0), p.timeout = o.timeout;
|
|
1201
|
+
function x() {
|
|
1202
|
+
if (!p)
|
|
1203
|
+
return;
|
|
1204
|
+
const E = _.from(
|
|
1205
|
+
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1206
|
+
), O = {
|
|
1207
|
+
data: !l || l === "text" || l === "json" ? p.responseText : p.response,
|
|
1208
|
+
status: p.status,
|
|
1209
|
+
statusText: p.statusText,
|
|
1210
|
+
headers: E,
|
|
1211
|
+
config: e,
|
|
1212
|
+
request: p
|
|
192
1213
|
};
|
|
193
|
-
|
|
1214
|
+
ht(function(y) {
|
|
1215
|
+
n(y), m();
|
|
1216
|
+
}, function(y) {
|
|
1217
|
+
r(y), m();
|
|
1218
|
+
}, O), p = null;
|
|
1219
|
+
}
|
|
1220
|
+
"onloadend" in p ? p.onloadend = x : p.onreadystatechange = function() {
|
|
1221
|
+
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(x);
|
|
1222
|
+
}, p.onabort = function() {
|
|
1223
|
+
p && (r(new b("Request aborted", b.ECONNABORTED, e, p)), p = null);
|
|
1224
|
+
}, p.onerror = function(C) {
|
|
1225
|
+
const O = C && C.message ? C.message : "Network Error", I = new b(O, b.ERR_NETWORK, e, p);
|
|
1226
|
+
I.event = C || null, r(I), p = null;
|
|
1227
|
+
}, p.ontimeout = function() {
|
|
1228
|
+
let C = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1229
|
+
const O = o.transitional || dt;
|
|
1230
|
+
o.timeoutErrorMessage && (C = o.timeoutErrorMessage), r(new b(
|
|
1231
|
+
C,
|
|
1232
|
+
O.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
|
|
1233
|
+
e,
|
|
1234
|
+
p
|
|
1235
|
+
)), p = null;
|
|
1236
|
+
}, i === void 0 && s.setContentType(null), "setRequestHeader" in p && a.forEach(s.toJSON(), function(C, O) {
|
|
1237
|
+
p.setRequestHeader(O, C);
|
|
1238
|
+
}), a.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), l && l !== "json" && (p.responseType = o.responseType), d && ([g, c] = ce(d, !0), p.addEventListener("progress", g)), f && p.upload && ([h, S] = ce(f), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (E) => {
|
|
1239
|
+
p && (r(!E || E.type ? new X(null, e, p) : E), p.abort(), p = null);
|
|
1240
|
+
}, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
|
|
1241
|
+
const T = Kn(o.url);
|
|
1242
|
+
if (T && N.protocols.indexOf(T) === -1) {
|
|
1243
|
+
r(new b("Unsupported protocol " + T + ":", b.ERR_BAD_REQUEST, e));
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
p.send(i || null);
|
|
1247
|
+
});
|
|
1248
|
+
}, rr = (e, t) => {
|
|
1249
|
+
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1250
|
+
if (t || n) {
|
|
1251
|
+
let r = new AbortController(), o;
|
|
1252
|
+
const i = function(d) {
|
|
1253
|
+
if (!o) {
|
|
1254
|
+
o = !0, l();
|
|
1255
|
+
const u = d instanceof Error ? d : this.reason;
|
|
1256
|
+
r.abort(u instanceof b ? u : new X(u instanceof Error ? u.message : u));
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
let s = t && setTimeout(() => {
|
|
1260
|
+
s = null, i(new b(`timeout ${t} of ms exceeded`, b.ETIMEDOUT));
|
|
1261
|
+
}, t);
|
|
1262
|
+
const l = () => {
|
|
1263
|
+
e && (s && clearTimeout(s), s = null, e.forEach((d) => {
|
|
1264
|
+
d.unsubscribe ? d.unsubscribe(i) : d.removeEventListener("abort", i);
|
|
1265
|
+
}), e = null);
|
|
1266
|
+
};
|
|
1267
|
+
e.forEach((d) => d.addEventListener("abort", i));
|
|
1268
|
+
const { signal: f } = r;
|
|
1269
|
+
return f.unsubscribe = () => a.asap(l), f;
|
|
1270
|
+
}
|
|
1271
|
+
}, or = function* (e, t) {
|
|
1272
|
+
let n = e.byteLength;
|
|
1273
|
+
if (n < t) {
|
|
1274
|
+
yield e;
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
let r = 0, o;
|
|
1278
|
+
for (; r < n; )
|
|
1279
|
+
o = r + t, yield e.slice(r, o), r = o;
|
|
1280
|
+
}, sr = async function* (e, t) {
|
|
1281
|
+
for await (const n of ir(e))
|
|
1282
|
+
yield* or(n, t);
|
|
1283
|
+
}, ir = async function* (e) {
|
|
1284
|
+
if (e[Symbol.asyncIterator]) {
|
|
1285
|
+
yield* e;
|
|
1286
|
+
return;
|
|
1287
|
+
}
|
|
1288
|
+
const t = e.getReader();
|
|
1289
|
+
try {
|
|
1290
|
+
for (; ; ) {
|
|
1291
|
+
const { done: n, value: r } = await t.read();
|
|
1292
|
+
if (n)
|
|
1293
|
+
break;
|
|
1294
|
+
yield r;
|
|
1295
|
+
}
|
|
1296
|
+
} finally {
|
|
1297
|
+
await t.cancel();
|
|
1298
|
+
}
|
|
1299
|
+
}, Me = (e, t, n, r) => {
|
|
1300
|
+
const o = sr(e, t);
|
|
1301
|
+
let i = 0, s, l = (f) => {
|
|
1302
|
+
s || (s = !0, r && r(f));
|
|
1303
|
+
};
|
|
1304
|
+
return new ReadableStream({
|
|
1305
|
+
async pull(f) {
|
|
1306
|
+
try {
|
|
1307
|
+
const { done: d, value: u } = await o.next();
|
|
1308
|
+
if (d) {
|
|
1309
|
+
l(), f.close();
|
|
1310
|
+
return;
|
|
1311
|
+
}
|
|
1312
|
+
let h = u.byteLength;
|
|
1313
|
+
if (n) {
|
|
1314
|
+
let g = i += h;
|
|
1315
|
+
n(g);
|
|
1316
|
+
}
|
|
1317
|
+
f.enqueue(new Uint8Array(u));
|
|
1318
|
+
} catch (d) {
|
|
1319
|
+
throw l(d), d;
|
|
1320
|
+
}
|
|
1321
|
+
},
|
|
1322
|
+
cancel(f) {
|
|
1323
|
+
return l(f), o.return();
|
|
1324
|
+
}
|
|
1325
|
+
}, {
|
|
1326
|
+
highWaterMark: 2
|
|
1327
|
+
});
|
|
1328
|
+
}, qe = 64 * 1024, { isFunction: oe } = a, ar = (({ Request: e, Response: t }) => ({
|
|
1329
|
+
Request: e,
|
|
1330
|
+
Response: t
|
|
1331
|
+
}))(a.global), {
|
|
1332
|
+
ReadableStream: We,
|
|
1333
|
+
TextEncoder: Je
|
|
1334
|
+
} = a.global, Ve = (e, ...t) => {
|
|
1335
|
+
try {
|
|
1336
|
+
return !!e(...t);
|
|
1337
|
+
} catch {
|
|
1338
|
+
return !1;
|
|
1339
|
+
}
|
|
1340
|
+
}, lr = (e) => {
|
|
1341
|
+
e = a.merge.call({
|
|
1342
|
+
skipUndefined: !0
|
|
1343
|
+
}, ar, e);
|
|
1344
|
+
const { fetch: t, Request: n, Response: r } = e, o = t ? oe(t) : typeof fetch == "function", i = oe(n), s = oe(r);
|
|
1345
|
+
if (!o)
|
|
1346
|
+
return !1;
|
|
1347
|
+
const l = o && oe(We), f = o && (typeof Je == "function" ? /* @__PURE__ */ ((c) => (m) => c.encode(m))(new Je()) : async (c) => new Uint8Array(await new n(c).arrayBuffer())), d = i && l && Ve(() => {
|
|
1348
|
+
let c = !1;
|
|
1349
|
+
const m = new n(N.origin, {
|
|
1350
|
+
body: new We(),
|
|
1351
|
+
method: "POST",
|
|
1352
|
+
get duplex() {
|
|
1353
|
+
return c = !0, "half";
|
|
1354
|
+
}
|
|
1355
|
+
}).headers.has("Content-Type");
|
|
1356
|
+
return c && !m;
|
|
1357
|
+
}), u = s && l && Ve(() => a.isReadableStream(new r("").body)), h = {
|
|
1358
|
+
stream: u && ((c) => c.body)
|
|
1359
|
+
};
|
|
1360
|
+
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((c) => {
|
|
1361
|
+
!h[c] && (h[c] = (m, p) => {
|
|
1362
|
+
let x = m && m[c];
|
|
1363
|
+
if (x)
|
|
1364
|
+
return x.call(m);
|
|
1365
|
+
throw new b(`Response type '${c}' is not supported`, b.ERR_NOT_SUPPORT, p);
|
|
1366
|
+
});
|
|
1367
|
+
});
|
|
1368
|
+
const g = async (c) => {
|
|
1369
|
+
if (c == null)
|
|
1370
|
+
return 0;
|
|
1371
|
+
if (a.isBlob(c))
|
|
1372
|
+
return c.size;
|
|
1373
|
+
if (a.isSpecCompliantForm(c))
|
|
1374
|
+
return (await new n(N.origin, {
|
|
1375
|
+
method: "POST",
|
|
1376
|
+
body: c
|
|
1377
|
+
}).arrayBuffer()).byteLength;
|
|
1378
|
+
if (a.isArrayBufferView(c) || a.isArrayBuffer(c))
|
|
1379
|
+
return c.byteLength;
|
|
1380
|
+
if (a.isURLSearchParams(c) && (c = c + ""), a.isString(c))
|
|
1381
|
+
return (await f(c)).byteLength;
|
|
1382
|
+
}, S = async (c, m) => {
|
|
1383
|
+
const p = a.toFiniteNumber(c.getContentLength());
|
|
1384
|
+
return p ?? g(m);
|
|
1385
|
+
};
|
|
1386
|
+
return async (c) => {
|
|
1387
|
+
let {
|
|
1388
|
+
url: m,
|
|
1389
|
+
method: p,
|
|
1390
|
+
data: x,
|
|
1391
|
+
signal: T,
|
|
1392
|
+
cancelToken: E,
|
|
1393
|
+
timeout: C,
|
|
1394
|
+
onDownloadProgress: O,
|
|
1395
|
+
onUploadProgress: I,
|
|
1396
|
+
responseType: y,
|
|
1397
|
+
headers: F,
|
|
1398
|
+
withCredentials: U = "same-origin",
|
|
1399
|
+
fetchOptions: W
|
|
1400
|
+
} = yt(c), Ne = t || fetch;
|
|
1401
|
+
y = y ? (y + "").toLowerCase() : "text";
|
|
1402
|
+
let ne = rr([T, E && E.toAbortSignal()], C), G = null;
|
|
1403
|
+
const H = ne && ne.unsubscribe && (() => {
|
|
1404
|
+
ne.unsubscribe();
|
|
1405
|
+
});
|
|
1406
|
+
let Fe;
|
|
1407
|
+
try {
|
|
1408
|
+
if (I && d && p !== "get" && p !== "head" && (Fe = await S(F, x)) !== 0) {
|
|
1409
|
+
let $ = new n(m, {
|
|
1410
|
+
method: "POST",
|
|
1411
|
+
body: x,
|
|
1412
|
+
duplex: "half"
|
|
1413
|
+
}), J;
|
|
1414
|
+
if (a.isFormData(x) && (J = $.headers.get("content-type")) && F.setContentType(J), $.body) {
|
|
1415
|
+
const [me, re] = $e(
|
|
1416
|
+
Fe,
|
|
1417
|
+
ce(He(I))
|
|
1418
|
+
);
|
|
1419
|
+
x = Me($.body, qe, me, re);
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
a.isString(U) || (U = U ? "include" : "omit");
|
|
1423
|
+
const D = i && "credentials" in n.prototype, Pe = {
|
|
1424
|
+
...W,
|
|
1425
|
+
signal: ne,
|
|
1426
|
+
method: p.toUpperCase(),
|
|
1427
|
+
headers: F.normalize().toJSON(),
|
|
1428
|
+
body: x,
|
|
1429
|
+
duplex: "half",
|
|
1430
|
+
credentials: D ? U : void 0
|
|
1431
|
+
};
|
|
1432
|
+
G = i && new n(m, Pe);
|
|
1433
|
+
let v = await (i ? Ne(G, W) : Ne(m, Pe));
|
|
1434
|
+
const _e = u && (y === "stream" || y === "response");
|
|
1435
|
+
if (u && (O || _e && H)) {
|
|
1436
|
+
const $ = {};
|
|
1437
|
+
["status", "statusText", "headers"].forEach((Ue) => {
|
|
1438
|
+
$[Ue] = v[Ue];
|
|
1439
|
+
});
|
|
1440
|
+
const J = a.toFiniteNumber(v.headers.get("content-length")), [me, re] = O && $e(
|
|
1441
|
+
J,
|
|
1442
|
+
ce(He(O), !0)
|
|
1443
|
+
) || [];
|
|
1444
|
+
v = new r(
|
|
1445
|
+
Me(v.body, qe, me, () => {
|
|
1446
|
+
re && re(), H && H();
|
|
1447
|
+
}),
|
|
1448
|
+
$
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
y = y || "text";
|
|
1452
|
+
let Et = await h[a.findKey(h, y) || "text"](v, c);
|
|
1453
|
+
return !_e && H && H(), await new Promise(($, J) => {
|
|
1454
|
+
ht($, J, {
|
|
1455
|
+
data: Et,
|
|
1456
|
+
headers: _.from(v.headers),
|
|
1457
|
+
status: v.status,
|
|
1458
|
+
statusText: v.statusText,
|
|
1459
|
+
config: c,
|
|
1460
|
+
request: G
|
|
1461
|
+
});
|
|
1462
|
+
});
|
|
1463
|
+
} catch (D) {
|
|
1464
|
+
throw H && H(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
|
|
1465
|
+
new b("Network Error", b.ERR_NETWORK, c, G),
|
|
1466
|
+
{
|
|
1467
|
+
cause: D.cause || D
|
|
1468
|
+
}
|
|
1469
|
+
) : b.from(D, D && D.code, c, G);
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
}, cr = /* @__PURE__ */ new Map(), bt = (e) => {
|
|
1473
|
+
let t = e && e.env || {};
|
|
1474
|
+
const { fetch: n, Request: r, Response: o } = t, i = [
|
|
1475
|
+
r,
|
|
1476
|
+
o,
|
|
1477
|
+
n
|
|
1478
|
+
];
|
|
1479
|
+
let s = i.length, l = s, f, d, u = cr;
|
|
1480
|
+
for (; l--; )
|
|
1481
|
+
f = i[l], d = u.get(f), d === void 0 && u.set(f, d = l ? /* @__PURE__ */ new Map() : lr(t)), u = d;
|
|
1482
|
+
return d;
|
|
1483
|
+
};
|
|
1484
|
+
bt();
|
|
1485
|
+
const ke = {
|
|
1486
|
+
http: Tn,
|
|
1487
|
+
xhr: nr,
|
|
1488
|
+
fetch: {
|
|
1489
|
+
get: bt
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
a.forEach(ke, (e, t) => {
|
|
1493
|
+
if (e) {
|
|
1494
|
+
try {
|
|
1495
|
+
Object.defineProperty(e, "name", { value: t });
|
|
1496
|
+
} catch {
|
|
1497
|
+
}
|
|
1498
|
+
Object.defineProperty(e, "adapterName", { value: t });
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
const Ke = (e) => `- ${e}`, ur = (e) => a.isFunction(e) || e === null || e === !1;
|
|
1502
|
+
function dr(e, t) {
|
|
1503
|
+
e = a.isArray(e) ? e : [e];
|
|
1504
|
+
const { length: n } = e;
|
|
1505
|
+
let r, o;
|
|
1506
|
+
const i = {};
|
|
1507
|
+
for (let s = 0; s < n; s++) {
|
|
1508
|
+
r = e[s];
|
|
1509
|
+
let l;
|
|
1510
|
+
if (o = r, !ur(r) && (o = ke[(l = String(r)).toLowerCase()], o === void 0))
|
|
1511
|
+
throw new b(`Unknown adapter '${l}'`);
|
|
1512
|
+
if (o && (a.isFunction(o) || (o = o.get(t))))
|
|
1513
|
+
break;
|
|
1514
|
+
i[l || "#" + s] = o;
|
|
1515
|
+
}
|
|
1516
|
+
if (!o) {
|
|
1517
|
+
const s = Object.entries(i).map(
|
|
1518
|
+
([f, d]) => `adapter ${f} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1519
|
+
);
|
|
1520
|
+
let l = n ? s.length > 1 ? `since :
|
|
1521
|
+
` + s.map(Ke).join(`
|
|
1522
|
+
`) : " " + Ke(s[0]) : "as no adapter specified";
|
|
1523
|
+
throw new b(
|
|
1524
|
+
"There is no suitable adapter to dispatch the request " + l,
|
|
1525
|
+
"ERR_NOT_SUPPORT"
|
|
1526
|
+
);
|
|
1527
|
+
}
|
|
1528
|
+
return o;
|
|
1529
|
+
}
|
|
1530
|
+
const gt = {
|
|
1531
|
+
/**
|
|
1532
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
1533
|
+
* @type {Function}
|
|
1534
|
+
*/
|
|
1535
|
+
getAdapter: dr,
|
|
1536
|
+
/**
|
|
1537
|
+
* Exposes all known adapters
|
|
1538
|
+
* @type {Object<string, Function|Object>}
|
|
1539
|
+
*/
|
|
1540
|
+
adapters: ke
|
|
1541
|
+
};
|
|
1542
|
+
function we(e) {
|
|
1543
|
+
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1544
|
+
throw new X(null, e);
|
|
1545
|
+
}
|
|
1546
|
+
function Xe(e) {
|
|
1547
|
+
return we(e), e.headers = _.from(e.headers), e.data = ge.call(
|
|
1548
|
+
e,
|
|
1549
|
+
e.transformRequest
|
|
1550
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || te.adapter, e)(e).then(function(r) {
|
|
1551
|
+
return we(e), r.data = ge.call(
|
|
1552
|
+
e,
|
|
1553
|
+
e.transformResponse,
|
|
1554
|
+
r
|
|
1555
|
+
), r.headers = _.from(r.headers), r;
|
|
1556
|
+
}, function(r) {
|
|
1557
|
+
return pt(r) || (we(e), r && r.response && (r.response.data = ge.call(
|
|
1558
|
+
e,
|
|
1559
|
+
e.transformResponse,
|
|
1560
|
+
r.response
|
|
1561
|
+
), r.response.headers = _.from(r.response.headers))), Promise.reject(r);
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
const wt = "1.13.2", he = {};
|
|
1565
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1566
|
+
he[e] = function(r) {
|
|
1567
|
+
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1568
|
+
};
|
|
1569
|
+
});
|
|
1570
|
+
const Ge = {};
|
|
1571
|
+
he.transitional = function(t, n, r) {
|
|
1572
|
+
function o(i, s) {
|
|
1573
|
+
return "[Axios v" + wt + "] Transitional option '" + i + "'" + s + (r ? ". " + r : "");
|
|
1574
|
+
}
|
|
1575
|
+
return (i, s, l) => {
|
|
1576
|
+
if (t === !1)
|
|
1577
|
+
throw new b(
|
|
1578
|
+
o(s, " has been removed" + (n ? " in " + n : "")),
|
|
1579
|
+
b.ERR_DEPRECATED
|
|
1580
|
+
);
|
|
1581
|
+
return n && !Ge[s] && (Ge[s] = !0, console.warn(
|
|
1582
|
+
o(
|
|
1583
|
+
s,
|
|
1584
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1585
|
+
)
|
|
1586
|
+
)), t ? t(i, s, l) : !0;
|
|
1587
|
+
};
|
|
1588
|
+
};
|
|
1589
|
+
he.spelling = function(t) {
|
|
1590
|
+
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
1591
|
+
};
|
|
1592
|
+
function fr(e, t, n) {
|
|
1593
|
+
if (typeof e != "object")
|
|
1594
|
+
throw new b("options must be an object", b.ERR_BAD_OPTION_VALUE);
|
|
1595
|
+
const r = Object.keys(e);
|
|
1596
|
+
let o = r.length;
|
|
1597
|
+
for (; o-- > 0; ) {
|
|
1598
|
+
const i = r[o], s = t[i];
|
|
1599
|
+
if (s) {
|
|
1600
|
+
const l = e[i], f = l === void 0 || s(l, i, e);
|
|
1601
|
+
if (f !== !0)
|
|
1602
|
+
throw new b("option " + i + " must be " + f, b.ERR_BAD_OPTION_VALUE);
|
|
1603
|
+
continue;
|
|
1604
|
+
}
|
|
1605
|
+
if (n !== !0)
|
|
1606
|
+
throw new b("Unknown option " + i, b.ERR_BAD_OPTION);
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
const ae = {
|
|
1610
|
+
assertOptions: fr,
|
|
1611
|
+
validators: he
|
|
1612
|
+
}, B = ae.validators;
|
|
1613
|
+
let M = class {
|
|
1614
|
+
constructor(t) {
|
|
1615
|
+
this.defaults = t || {}, this.interceptors = {
|
|
1616
|
+
request: new je(),
|
|
1617
|
+
response: new je()
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Dispatch a request
|
|
1622
|
+
*
|
|
1623
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1624
|
+
* @param {?Object} config
|
|
1625
|
+
*
|
|
1626
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1627
|
+
*/
|
|
1628
|
+
async request(t, n) {
|
|
1629
|
+
try {
|
|
1630
|
+
return await this._request(t, n);
|
|
1631
|
+
} catch (r) {
|
|
1632
|
+
if (r instanceof Error) {
|
|
1633
|
+
let o = {};
|
|
1634
|
+
Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
|
|
1635
|
+
const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
|
|
1636
|
+
try {
|
|
1637
|
+
r.stack ? i && !String(r.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (r.stack += `
|
|
1638
|
+
` + i) : r.stack = i;
|
|
1639
|
+
} catch {
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
throw r;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
_request(t, n) {
|
|
1646
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = q(this.defaults, n);
|
|
1647
|
+
const { transitional: r, paramsSerializer: o, headers: i } = n;
|
|
1648
|
+
r !== void 0 && ae.assertOptions(r, {
|
|
1649
|
+
silentJSONParsing: B.transitional(B.boolean),
|
|
1650
|
+
forcedJSONParsing: B.transitional(B.boolean),
|
|
1651
|
+
clarifyTimeoutError: B.transitional(B.boolean)
|
|
1652
|
+
}, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
|
|
1653
|
+
serialize: o
|
|
1654
|
+
} : ae.assertOptions(o, {
|
|
1655
|
+
encode: B.function,
|
|
1656
|
+
serialize: B.function
|
|
1657
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ae.assertOptions(n, {
|
|
1658
|
+
baseUrl: B.spelling("baseURL"),
|
|
1659
|
+
withXsrfToken: B.spelling("withXSRFToken")
|
|
1660
|
+
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1661
|
+
let s = i && a.merge(
|
|
1662
|
+
i.common,
|
|
1663
|
+
i[n.method]
|
|
1664
|
+
);
|
|
1665
|
+
i && a.forEach(
|
|
1666
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1667
|
+
(c) => {
|
|
1668
|
+
delete i[c];
|
|
1669
|
+
}
|
|
1670
|
+
), n.headers = _.concat(s, i);
|
|
1671
|
+
const l = [];
|
|
1672
|
+
let f = !0;
|
|
1673
|
+
this.interceptors.request.forEach(function(m) {
|
|
1674
|
+
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (f = f && m.synchronous, l.unshift(m.fulfilled, m.rejected));
|
|
1675
|
+
});
|
|
1676
|
+
const d = [];
|
|
1677
|
+
this.interceptors.response.forEach(function(m) {
|
|
1678
|
+
d.push(m.fulfilled, m.rejected);
|
|
1679
|
+
});
|
|
1680
|
+
let u, h = 0, g;
|
|
1681
|
+
if (!f) {
|
|
1682
|
+
const c = [Xe.bind(this), void 0];
|
|
1683
|
+
for (c.unshift(...l), c.push(...d), g = c.length, u = Promise.resolve(n); h < g; )
|
|
1684
|
+
u = u.then(c[h++], c[h++]);
|
|
1685
|
+
return u;
|
|
1686
|
+
}
|
|
1687
|
+
g = l.length;
|
|
1688
|
+
let S = n;
|
|
1689
|
+
for (; h < g; ) {
|
|
1690
|
+
const c = l[h++], m = l[h++];
|
|
1691
|
+
try {
|
|
1692
|
+
S = c(S);
|
|
1693
|
+
} catch (p) {
|
|
1694
|
+
m.call(this, p);
|
|
1695
|
+
break;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
try {
|
|
1699
|
+
u = Xe.call(this, S);
|
|
1700
|
+
} catch (c) {
|
|
1701
|
+
return Promise.reject(c);
|
|
194
1702
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1703
|
+
for (h = 0, g = d.length; h < g; )
|
|
1704
|
+
u = u.then(d[h++], d[h++]);
|
|
1705
|
+
return u;
|
|
1706
|
+
}
|
|
1707
|
+
getUri(t) {
|
|
1708
|
+
t = q(this.defaults, t);
|
|
1709
|
+
const n = mt(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1710
|
+
return ut(n, t.params, t.paramsSerializer);
|
|
1711
|
+
}
|
|
1712
|
+
};
|
|
1713
|
+
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1714
|
+
M.prototype[t] = function(n, r) {
|
|
1715
|
+
return this.request(q(r || {}, {
|
|
1716
|
+
method: t,
|
|
1717
|
+
url: n,
|
|
1718
|
+
data: (r || {}).data
|
|
1719
|
+
}));
|
|
1720
|
+
};
|
|
1721
|
+
});
|
|
1722
|
+
a.forEach(["post", "put", "patch"], function(t) {
|
|
1723
|
+
function n(r) {
|
|
1724
|
+
return function(i, s, l) {
|
|
1725
|
+
return this.request(q(l || {}, {
|
|
1726
|
+
method: t,
|
|
1727
|
+
headers: r ? {
|
|
1728
|
+
"Content-Type": "multipart/form-data"
|
|
1729
|
+
} : {},
|
|
1730
|
+
url: i,
|
|
1731
|
+
data: s
|
|
1732
|
+
}));
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1735
|
+
M.prototype[t] = n(), M.prototype[t + "Form"] = n(!0);
|
|
1736
|
+
});
|
|
1737
|
+
let pr = class St {
|
|
1738
|
+
constructor(t) {
|
|
1739
|
+
if (typeof t != "function")
|
|
1740
|
+
throw new TypeError("executor must be a function.");
|
|
1741
|
+
let n;
|
|
1742
|
+
this.promise = new Promise(function(i) {
|
|
1743
|
+
n = i;
|
|
1744
|
+
});
|
|
1745
|
+
const r = this;
|
|
1746
|
+
this.promise.then((o) => {
|
|
1747
|
+
if (!r._listeners) return;
|
|
1748
|
+
let i = r._listeners.length;
|
|
1749
|
+
for (; i-- > 0; )
|
|
1750
|
+
r._listeners[i](o);
|
|
1751
|
+
r._listeners = null;
|
|
1752
|
+
}), this.promise.then = (o) => {
|
|
1753
|
+
let i;
|
|
1754
|
+
const s = new Promise((l) => {
|
|
1755
|
+
r.subscribe(l), i = l;
|
|
1756
|
+
}).then(o);
|
|
1757
|
+
return s.cancel = function() {
|
|
1758
|
+
r.unsubscribe(i);
|
|
1759
|
+
}, s;
|
|
1760
|
+
}, t(function(i, s, l) {
|
|
1761
|
+
r.reason || (r.reason = new X(i, s, l), n(r.reason));
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1766
|
+
*/
|
|
1767
|
+
throwIfRequested() {
|
|
1768
|
+
if (this.reason)
|
|
1769
|
+
throw this.reason;
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Subscribe to the cancel signal
|
|
1773
|
+
*/
|
|
1774
|
+
subscribe(t) {
|
|
1775
|
+
if (this.reason) {
|
|
1776
|
+
t(this.reason);
|
|
1777
|
+
return;
|
|
1778
|
+
}
|
|
1779
|
+
this._listeners ? this._listeners.push(t) : this._listeners = [t];
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Unsubscribe from the cancel signal
|
|
1783
|
+
*/
|
|
1784
|
+
unsubscribe(t) {
|
|
1785
|
+
if (!this._listeners)
|
|
1786
|
+
return;
|
|
1787
|
+
const n = this._listeners.indexOf(t);
|
|
1788
|
+
n !== -1 && this._listeners.splice(n, 1);
|
|
1789
|
+
}
|
|
1790
|
+
toAbortSignal() {
|
|
1791
|
+
const t = new AbortController(), n = (r) => {
|
|
1792
|
+
t.abort(r);
|
|
1793
|
+
};
|
|
1794
|
+
return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1798
|
+
* cancels the `CancelToken`.
|
|
1799
|
+
*/
|
|
1800
|
+
static source() {
|
|
1801
|
+
let t;
|
|
1802
|
+
return {
|
|
1803
|
+
token: new St(function(o) {
|
|
1804
|
+
t = o;
|
|
1805
|
+
}),
|
|
1806
|
+
cancel: t
|
|
1807
|
+
};
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
function hr(e) {
|
|
1811
|
+
return function(n) {
|
|
1812
|
+
return e.apply(null, n);
|
|
1813
|
+
};
|
|
1814
|
+
}
|
|
1815
|
+
function mr(e) {
|
|
1816
|
+
return a.isObject(e) && e.isAxiosError === !0;
|
|
1817
|
+
}
|
|
1818
|
+
const Ce = {
|
|
1819
|
+
Continue: 100,
|
|
1820
|
+
SwitchingProtocols: 101,
|
|
1821
|
+
Processing: 102,
|
|
1822
|
+
EarlyHints: 103,
|
|
1823
|
+
Ok: 200,
|
|
1824
|
+
Created: 201,
|
|
1825
|
+
Accepted: 202,
|
|
1826
|
+
NonAuthoritativeInformation: 203,
|
|
1827
|
+
NoContent: 204,
|
|
1828
|
+
ResetContent: 205,
|
|
1829
|
+
PartialContent: 206,
|
|
1830
|
+
MultiStatus: 207,
|
|
1831
|
+
AlreadyReported: 208,
|
|
1832
|
+
ImUsed: 226,
|
|
1833
|
+
MultipleChoices: 300,
|
|
1834
|
+
MovedPermanently: 301,
|
|
1835
|
+
Found: 302,
|
|
1836
|
+
SeeOther: 303,
|
|
1837
|
+
NotModified: 304,
|
|
1838
|
+
UseProxy: 305,
|
|
1839
|
+
Unused: 306,
|
|
1840
|
+
TemporaryRedirect: 307,
|
|
1841
|
+
PermanentRedirect: 308,
|
|
1842
|
+
BadRequest: 400,
|
|
1843
|
+
Unauthorized: 401,
|
|
1844
|
+
PaymentRequired: 402,
|
|
1845
|
+
Forbidden: 403,
|
|
1846
|
+
NotFound: 404,
|
|
1847
|
+
MethodNotAllowed: 405,
|
|
1848
|
+
NotAcceptable: 406,
|
|
1849
|
+
ProxyAuthenticationRequired: 407,
|
|
1850
|
+
RequestTimeout: 408,
|
|
1851
|
+
Conflict: 409,
|
|
1852
|
+
Gone: 410,
|
|
1853
|
+
LengthRequired: 411,
|
|
1854
|
+
PreconditionFailed: 412,
|
|
1855
|
+
PayloadTooLarge: 413,
|
|
1856
|
+
UriTooLong: 414,
|
|
1857
|
+
UnsupportedMediaType: 415,
|
|
1858
|
+
RangeNotSatisfiable: 416,
|
|
1859
|
+
ExpectationFailed: 417,
|
|
1860
|
+
ImATeapot: 418,
|
|
1861
|
+
MisdirectedRequest: 421,
|
|
1862
|
+
UnprocessableEntity: 422,
|
|
1863
|
+
Locked: 423,
|
|
1864
|
+
FailedDependency: 424,
|
|
1865
|
+
TooEarly: 425,
|
|
1866
|
+
UpgradeRequired: 426,
|
|
1867
|
+
PreconditionRequired: 428,
|
|
1868
|
+
TooManyRequests: 429,
|
|
1869
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
1870
|
+
UnavailableForLegalReasons: 451,
|
|
1871
|
+
InternalServerError: 500,
|
|
1872
|
+
NotImplemented: 501,
|
|
1873
|
+
BadGateway: 502,
|
|
1874
|
+
ServiceUnavailable: 503,
|
|
1875
|
+
GatewayTimeout: 504,
|
|
1876
|
+
HttpVersionNotSupported: 505,
|
|
1877
|
+
VariantAlsoNegotiates: 506,
|
|
1878
|
+
InsufficientStorage: 507,
|
|
1879
|
+
LoopDetected: 508,
|
|
1880
|
+
NotExtended: 510,
|
|
1881
|
+
NetworkAuthenticationRequired: 511,
|
|
1882
|
+
WebServerIsDown: 521,
|
|
1883
|
+
ConnectionTimedOut: 522,
|
|
1884
|
+
OriginIsUnreachable: 523,
|
|
1885
|
+
TimeoutOccurred: 524,
|
|
1886
|
+
SslHandshakeFailed: 525,
|
|
1887
|
+
InvalidSslCertificate: 526
|
|
1888
|
+
};
|
|
1889
|
+
Object.entries(Ce).forEach(([e, t]) => {
|
|
1890
|
+
Ce[t] = e;
|
|
1891
|
+
});
|
|
1892
|
+
function xt(e) {
|
|
1893
|
+
const t = new M(e), n = Ye(M.prototype.request, t);
|
|
1894
|
+
return a.extend(n, M.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
1895
|
+
return xt(q(e, o));
|
|
1896
|
+
}, n;
|
|
1897
|
+
}
|
|
1898
|
+
const R = xt(te);
|
|
1899
|
+
R.Axios = M;
|
|
1900
|
+
R.CanceledError = X;
|
|
1901
|
+
R.CancelToken = pr;
|
|
1902
|
+
R.isCancel = pt;
|
|
1903
|
+
R.VERSION = wt;
|
|
1904
|
+
R.toFormData = pe;
|
|
1905
|
+
R.AxiosError = b;
|
|
1906
|
+
R.Cancel = R.CanceledError;
|
|
1907
|
+
R.all = function(t) {
|
|
1908
|
+
return Promise.all(t);
|
|
1909
|
+
};
|
|
1910
|
+
R.spread = hr;
|
|
1911
|
+
R.isAxiosError = mr;
|
|
1912
|
+
R.mergeConfig = q;
|
|
1913
|
+
R.AxiosHeaders = _;
|
|
1914
|
+
R.formToJSON = (e) => ft(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1915
|
+
R.getAdapter = gt.getAdapter;
|
|
1916
|
+
R.HttpStatusCode = Ce;
|
|
1917
|
+
R.default = R;
|
|
1918
|
+
const {
|
|
1919
|
+
Axios: Cr,
|
|
1920
|
+
AxiosError: Or,
|
|
1921
|
+
CanceledError: Tr,
|
|
1922
|
+
isCancel: Ar,
|
|
1923
|
+
CancelToken: kr,
|
|
1924
|
+
VERSION: Nr,
|
|
1925
|
+
all: Fr,
|
|
1926
|
+
Cancel: Pr,
|
|
1927
|
+
isAxiosError: _r,
|
|
1928
|
+
spread: Ur,
|
|
1929
|
+
toFormData: Ir,
|
|
1930
|
+
AxiosHeaders: Lr,
|
|
1931
|
+
HttpStatusCode: Dr,
|
|
1932
|
+
formToJSON: Br,
|
|
1933
|
+
getAdapter: jr,
|
|
1934
|
+
mergeConfig: vr
|
|
1935
|
+
} = R, yr = async (e) => {
|
|
1936
|
+
try {
|
|
1937
|
+
await R.get(`https://n8n.clone67.com/webhook/end-chat-session?sessionId=${e}`);
|
|
1938
|
+
} catch {
|
|
1939
|
+
throw new Error();
|
|
1940
|
+
}
|
|
1941
|
+
}, br = ({ chatBotData: e, theme: t, onlineStatus: n, isExpand: r, endSession: o }) => {
|
|
1942
|
+
const [i, s] = j(null), [l, f] = j(""), [d, u] = j("Connecting to server..."), [h, g] = j(""), [S, c] = j(!1);
|
|
1943
|
+
le(() => {
|
|
1944
|
+
var y = localStorage.getItem("clone67ChatSessionId");
|
|
1945
|
+
y === null && (y = Dt(), localStorage.setItem("clone67ChatSessionId", y));
|
|
1946
|
+
const { socket: F } = vt(y, e.pineconeNamespace);
|
|
1947
|
+
s(F), F.onopen = () => {
|
|
1948
|
+
u("Server connected"), setTimeout(() => {
|
|
1949
|
+
u("");
|
|
1950
|
+
}, 2e3), n("online");
|
|
1951
|
+
}, F.onmessage = async (U) => {
|
|
1952
|
+
try {
|
|
1953
|
+
const W = await U.data;
|
|
1954
|
+
g(W), c(!1);
|
|
1955
|
+
} catch (W) {
|
|
1956
|
+
console.error("Error handling server message:", W);
|
|
1957
|
+
}
|
|
1958
|
+
}, F.onerror = (U) => {
|
|
1959
|
+
u("Server error occurred"), console.error("WebSocket error:", U), n("offline");
|
|
1960
|
+
}, F.onclose = () => {
|
|
1961
|
+
u("Server disconnected"), n("offline");
|
|
1962
|
+
};
|
|
1963
|
+
}, []), le(() => {
|
|
1964
|
+
(async () => {
|
|
1965
|
+
if (!o) return;
|
|
1966
|
+
const F = localStorage.getItem("clone67ChatSessionId");
|
|
1967
|
+
if (console.log("messagese are:", h), i && i.readyState === WebSocket.OPEN)
|
|
1968
|
+
try {
|
|
1969
|
+
h && await yr(F), i.send(JSON.stringify({ type: "end_session" })), i.close(), localStorage.removeItem("clone67ChatSessionId");
|
|
1970
|
+
} catch (U) {
|
|
1971
|
+
console.log("Error while saving messages", U);
|
|
1972
|
+
}
|
|
1973
|
+
})();
|
|
1974
|
+
}, [o]);
|
|
1975
|
+
const m = async (y) => {
|
|
1976
|
+
if (y.preventDefault(), i && i.readyState === WebSocket.OPEN) {
|
|
1977
|
+
const U = {
|
|
199
1978
|
type: "chat",
|
|
200
|
-
userInput:
|
|
1979
|
+
userInput: l
|
|
201
1980
|
};
|
|
202
|
-
|
|
1981
|
+
i.send(JSON.stringify(U));
|
|
203
1982
|
}
|
|
204
|
-
|
|
205
|
-
const
|
|
1983
|
+
c(!0);
|
|
1984
|
+
const F = {
|
|
206
1985
|
created_at: Date.now(),
|
|
207
1986
|
sender_type: "user",
|
|
208
|
-
message:
|
|
1987
|
+
message: l
|
|
209
1988
|
};
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
},
|
|
1989
|
+
g(JSON.stringify(F)), f("");
|
|
1990
|
+
}, p = (y) => {
|
|
1991
|
+
y.key === "Enter" && !y.shiftKey && (y.preventDefault(), m(y));
|
|
1992
|
+
}, x = {
|
|
214
1993
|
flex: 1,
|
|
215
1994
|
padding: "12px 16px",
|
|
216
|
-
background: `${
|
|
1995
|
+
background: `${S ? `${t.primaryColor}33` : t.backgroundColor}`,
|
|
217
1996
|
color: t.fontColor,
|
|
218
1997
|
border: `1px solid ${t.primaryColor}`,
|
|
219
1998
|
borderRadius: "12px",
|
|
@@ -221,11 +2000,11 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
221
2000
|
outline: "none",
|
|
222
2001
|
transition: "all 0.2s ease",
|
|
223
2002
|
boxShadow: "none",
|
|
224
|
-
cursor:
|
|
225
|
-
},
|
|
2003
|
+
cursor: S ? "not-allowed" : "auto"
|
|
2004
|
+
}, T = {
|
|
226
2005
|
padding: "12px 20px",
|
|
227
2006
|
borderRadius: "12px",
|
|
228
|
-
background:
|
|
2007
|
+
background: S ? `${t.primaryColor}33` : `linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,
|
|
229
2008
|
color: t.fontColor,
|
|
230
2009
|
border: "none",
|
|
231
2010
|
display: "flex",
|
|
@@ -236,74 +2015,74 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
236
2015
|
fontSize: "14px",
|
|
237
2016
|
transition: "all 0.2s ease",
|
|
238
2017
|
minWidth: "48px",
|
|
239
|
-
cursor:
|
|
240
|
-
},
|
|
2018
|
+
cursor: S ? "not-allowed" : "pointer"
|
|
2019
|
+
}, E = {
|
|
241
2020
|
padding: "10px",
|
|
242
2021
|
borderColor: t.fontColor,
|
|
243
2022
|
background: t.backgroundColor,
|
|
244
2023
|
flexShrink: 0
|
|
245
|
-
},
|
|
2024
|
+
}, C = {
|
|
246
2025
|
display: "flex",
|
|
247
2026
|
gap: "12px",
|
|
248
2027
|
alignItems: "center"
|
|
249
|
-
},
|
|
2028
|
+
}, O = {
|
|
250
2029
|
textAlign: "center",
|
|
251
2030
|
padding: "2px",
|
|
252
|
-
backgroundColor:
|
|
2031
|
+
backgroundColor: d === "Server connected" || d === "online" ? "#09BA00" : d === "Connecting to server..." ? "#DED000" : "#FF3408",
|
|
253
2032
|
color: "#ffffff",
|
|
254
2033
|
fontSize: "10px"
|
|
255
|
-
},
|
|
2034
|
+
}, I = {
|
|
256
2035
|
padding: "8px",
|
|
257
2036
|
animation: "fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",
|
|
258
2037
|
animationDelay: "0s, 0.3s",
|
|
259
2038
|
fontSize: "10px",
|
|
260
2039
|
color: t.fontColor
|
|
261
2040
|
};
|
|
262
|
-
return /* @__PURE__ */
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
2041
|
+
return /* @__PURE__ */ k(Se, { children: [
|
|
2042
|
+
d && /* @__PURE__ */ w("p", { style: O, children: d }),
|
|
2043
|
+
o ? /* @__PURE__ */ w(jt, { theme: t }) : /* @__PURE__ */ k(Se, { children: [
|
|
2044
|
+
/* @__PURE__ */ w(Bt, { messages: h, chatBotData: e, theme: t, isExpand: r }),
|
|
2045
|
+
S && /* @__PURE__ */ w("div", { style: I, children: `${e.name} is typing...` }),
|
|
2046
|
+
/* @__PURE__ */ w("div", { style: E, children: /* @__PURE__ */ k("form", { onSubmit: m, style: C, children: [
|
|
2047
|
+
/* @__PURE__ */ w(
|
|
269
2048
|
"input",
|
|
270
2049
|
{
|
|
271
2050
|
type: "text",
|
|
272
2051
|
placeholder: "Type a message...",
|
|
273
|
-
value:
|
|
274
|
-
onChange: (
|
|
275
|
-
disabled:
|
|
276
|
-
onKeyDown:
|
|
277
|
-
style:
|
|
278
|
-
onFocus: (
|
|
279
|
-
|
|
2052
|
+
value: l,
|
|
2053
|
+
onChange: (y) => f(y.target.value),
|
|
2054
|
+
disabled: S,
|
|
2055
|
+
onKeyDown: p,
|
|
2056
|
+
style: x,
|
|
2057
|
+
onFocus: (y) => {
|
|
2058
|
+
y.target.style.boxShadow = `0 0 0 1px ${t.primaryColor}`, y.target.style.borderColor = t.primaryColor;
|
|
280
2059
|
},
|
|
281
|
-
onBlur: (
|
|
282
|
-
|
|
2060
|
+
onBlur: (y) => {
|
|
2061
|
+
y.target.style.boxShadow = "none", y.target.style.borderColor = t.primaryColor;
|
|
283
2062
|
}
|
|
284
2063
|
}
|
|
285
2064
|
),
|
|
286
|
-
/* @__PURE__ */
|
|
2065
|
+
/* @__PURE__ */ w(
|
|
287
2066
|
"button",
|
|
288
2067
|
{
|
|
289
|
-
onClick:
|
|
290
|
-
style:
|
|
291
|
-
disabled:
|
|
2068
|
+
onClick: m,
|
|
2069
|
+
style: T,
|
|
2070
|
+
disabled: S,
|
|
292
2071
|
"aria-label": "Send message",
|
|
293
|
-
children: /* @__PURE__ */
|
|
2072
|
+
children: /* @__PURE__ */ w(Tt, { size: 18 })
|
|
294
2073
|
}
|
|
295
2074
|
)
|
|
296
2075
|
] }) })
|
|
297
2076
|
] })
|
|
298
2077
|
] });
|
|
299
|
-
},
|
|
300
|
-
const [
|
|
2078
|
+
}, gr = ({ theme: e, chatBotData: t, onClose: n }) => {
|
|
2079
|
+
const [r, o] = j(!1), [i, s] = j(!1), [l, f] = j(!1), u = {
|
|
301
2080
|
position: "fixed",
|
|
302
2081
|
bottom: "112px",
|
|
303
2082
|
[t.position === "left" ? "left" : "right"]: "32px",
|
|
304
2083
|
zIndex: 50,
|
|
305
|
-
width:
|
|
306
|
-
height:
|
|
2084
|
+
width: r ? "684px" : "384px",
|
|
2085
|
+
height: r ? "620px" : "520px",
|
|
307
2086
|
background: `${e.backgroundColor}cc`,
|
|
308
2087
|
backdropFilter: "blur(16px)",
|
|
309
2088
|
WebkitBackdropFilter: "blur(16px)",
|
|
@@ -314,7 +2093,7 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
314
2093
|
overflow: "hidden",
|
|
315
2094
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
316
2095
|
boxShadow: "0 10px 25px -3px rgba(0,0,0,0.1)"
|
|
317
|
-
},
|
|
2096
|
+
}, h = {
|
|
318
2097
|
padding: "16px 20px",
|
|
319
2098
|
background: `linear-gradient(135deg, ${e.primaryColor}, ${e.secondaryColor})`,
|
|
320
2099
|
color: e.fontColor,
|
|
@@ -323,9 +2102,9 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
323
2102
|
alignItems: "center",
|
|
324
2103
|
justifyContent: "space-between",
|
|
325
2104
|
boxShadow: "0 4px 6px -1px rgba(0,0,0,0.1)"
|
|
326
|
-
},
|
|
2105
|
+
}, g = {
|
|
327
2106
|
position: "relative"
|
|
328
|
-
},
|
|
2107
|
+
}, S = {
|
|
329
2108
|
width: "44px",
|
|
330
2109
|
height: "44px",
|
|
331
2110
|
borderRadius: "50%",
|
|
@@ -333,158 +2112,158 @@ const q = ({ messages: e, chatBotData: t, theme: s, isExpand: i }) => {
|
|
|
333
2112
|
display: "flex",
|
|
334
2113
|
alignItems: "center",
|
|
335
2114
|
justifyContent: "center"
|
|
336
|
-
},
|
|
2115
|
+
}, c = {
|
|
337
2116
|
position: "absolute",
|
|
338
2117
|
bottom: 0,
|
|
339
2118
|
right: 0,
|
|
340
2119
|
width: "14px",
|
|
341
2120
|
height: "14px",
|
|
342
|
-
backgroundColor:
|
|
2121
|
+
backgroundColor: i ? "#00BF49" : "#F54927",
|
|
343
2122
|
borderRadius: "50%",
|
|
344
2123
|
border: "3px solid white"
|
|
345
|
-
},
|
|
2124
|
+
}, m = {
|
|
346
2125
|
fontSize: "18px",
|
|
347
2126
|
fontWeight: "600",
|
|
348
2127
|
margin: 0,
|
|
349
2128
|
lineHeight: "1.2"
|
|
350
|
-
},
|
|
2129
|
+
}, p = {
|
|
351
2130
|
fontSize: "12px",
|
|
352
2131
|
opacity: 0.9,
|
|
353
2132
|
margin: 0,
|
|
354
2133
|
lineHeight: "1.3"
|
|
355
|
-
},
|
|
2134
|
+
}, x = {
|
|
356
2135
|
padding: "8px",
|
|
357
2136
|
borderRadius: "50%",
|
|
358
2137
|
background: "transparent",
|
|
359
2138
|
border: "none",
|
|
360
2139
|
cursor: "pointer",
|
|
361
2140
|
transition: "background 0.2s"
|
|
362
|
-
},
|
|
2141
|
+
}, T = {
|
|
363
2142
|
padding: "10px",
|
|
364
2143
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
365
2144
|
background: e.backgroundColor,
|
|
366
2145
|
textAlign: "center"
|
|
367
|
-
},
|
|
2146
|
+
}, E = {
|
|
368
2147
|
fontSize: "11px",
|
|
369
2148
|
color: e.fontColor,
|
|
370
2149
|
letterSpacing: "0.5px"
|
|
371
|
-
},
|
|
2150
|
+
}, C = {
|
|
372
2151
|
fontWeight: "600"
|
|
373
|
-
},
|
|
374
|
-
|
|
375
|
-
},
|
|
376
|
-
y
|
|
2152
|
+
}, O = (y, F) => {
|
|
2153
|
+
y.currentTarget.style.background = F ? "rgba(255,255,255,0.2)" : "transparent";
|
|
2154
|
+
}, I = (y) => {
|
|
2155
|
+
s(y === "online");
|
|
377
2156
|
};
|
|
378
|
-
return /* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
/* @__PURE__ */
|
|
2157
|
+
return /* @__PURE__ */ k("div", { style: u, children: [
|
|
2158
|
+
/* @__PURE__ */ k("div", { style: h, children: [
|
|
2159
|
+
/* @__PURE__ */ k("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
2160
|
+
/* @__PURE__ */ k("div", { style: g, children: [
|
|
2161
|
+
/* @__PURE__ */ w("div", { style: S, children: /* @__PURE__ */ w(Qe, { size: 22 }) }),
|
|
2162
|
+
/* @__PURE__ */ w("span", { style: c })
|
|
384
2163
|
] }),
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ k("div", { children: [
|
|
2165
|
+
/* @__PURE__ */ w("h3", { style: m, children: t.name }),
|
|
2166
|
+
/* @__PURE__ */ w("p", { style: p, children: t.subTitle })
|
|
388
2167
|
] })
|
|
389
2168
|
] }),
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ k("div", { style: { display: "flex", alignItems: "left" }, children: [
|
|
2170
|
+
/* @__PURE__ */ w(
|
|
392
2171
|
"button",
|
|
393
2172
|
{
|
|
394
|
-
onClick: () =>
|
|
2173
|
+
onClick: () => o((y) => !y),
|
|
395
2174
|
"aria-label": "expand chat",
|
|
396
|
-
style:
|
|
397
|
-
onMouseEnter: (
|
|
398
|
-
onMouseLeave: (
|
|
399
|
-
children:
|
|
2175
|
+
style: x,
|
|
2176
|
+
onMouseEnter: (y) => O(y, !0),
|
|
2177
|
+
onMouseLeave: (y) => O(y, !1),
|
|
2178
|
+
children: r ? /* @__PURE__ */ w(At, { size: 20 }) : /* @__PURE__ */ w(kt, { size: 20 })
|
|
400
2179
|
}
|
|
401
2180
|
),
|
|
402
|
-
/* @__PURE__ */
|
|
2181
|
+
/* @__PURE__ */ w(
|
|
403
2182
|
"button",
|
|
404
2183
|
{
|
|
405
2184
|
onClick: () => {
|
|
406
|
-
|
|
407
|
-
|
|
2185
|
+
f(!0), setTimeout(() => {
|
|
2186
|
+
n();
|
|
408
2187
|
}, 2e3);
|
|
409
2188
|
},
|
|
410
|
-
style:
|
|
411
|
-
onMouseEnter: (
|
|
412
|
-
onMouseLeave: (
|
|
413
|
-
children: /* @__PURE__ */
|
|
2189
|
+
style: x,
|
|
2190
|
+
onMouseEnter: (y) => O(y, !0),
|
|
2191
|
+
onMouseLeave: (y) => O(y, !1),
|
|
2192
|
+
children: /* @__PURE__ */ w(Nt, { size: 20 })
|
|
414
2193
|
}
|
|
415
2194
|
)
|
|
416
2195
|
] })
|
|
417
2196
|
] }),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
/* @__PURE__ */
|
|
2197
|
+
/* @__PURE__ */ w(br, { chatBotData: t, theme: e, onlineStatus: I, isExpand: r, endSession: l }),
|
|
2198
|
+
/* @__PURE__ */ w("div", { style: T, children: /* @__PURE__ */ k("p", { style: E, children: [
|
|
420
2199
|
"powered by ",
|
|
421
|
-
/* @__PURE__ */
|
|
2200
|
+
/* @__PURE__ */ w("span", { style: C, children: "clone67.com" })
|
|
422
2201
|
] }) })
|
|
423
2202
|
] });
|
|
424
|
-
},
|
|
2203
|
+
}, $r = ({
|
|
425
2204
|
pineconeNamespace: e,
|
|
426
2205
|
primaryColor: t = "#3b82f6",
|
|
427
|
-
secondaryColor:
|
|
428
|
-
backgroundColor:
|
|
429
|
-
fontColor:
|
|
430
|
-
placeholderColor:
|
|
431
|
-
position:
|
|
432
|
-
name:
|
|
433
|
-
subTitle:
|
|
434
|
-
welcomeText:
|
|
435
|
-
aiInitialMessage:
|
|
2206
|
+
secondaryColor: n = "#8b5cf6",
|
|
2207
|
+
backgroundColor: r = "#ffffff",
|
|
2208
|
+
fontColor: o = "#1f2937",
|
|
2209
|
+
placeholderColor: i = "#9ca3af",
|
|
2210
|
+
position: s = "right",
|
|
2211
|
+
name: l = "AI Assistant",
|
|
2212
|
+
subTitle: f = "AI powered assistant",
|
|
2213
|
+
welcomeText: d = "Hi! How can I help you today?",
|
|
2214
|
+
aiInitialMessage: u = ""
|
|
436
2215
|
}) => {
|
|
437
|
-
const [
|
|
438
|
-
|
|
439
|
-
},
|
|
2216
|
+
const [h, g] = j(!1), S = () => g((O) => !O), c = () => {
|
|
2217
|
+
g(!1);
|
|
2218
|
+
}, m = {
|
|
440
2219
|
primaryColor: t,
|
|
441
|
-
secondaryColor:
|
|
442
|
-
backgroundColor:
|
|
443
|
-
fontColor:
|
|
444
|
-
placeholderColor:
|
|
445
|
-
inputBackgroundColor:
|
|
446
|
-
},
|
|
447
|
-
name:
|
|
448
|
-
subTitle:
|
|
449
|
-
welcomeText:
|
|
2220
|
+
secondaryColor: n,
|
|
2221
|
+
backgroundColor: r,
|
|
2222
|
+
fontColor: o,
|
|
2223
|
+
placeholderColor: i,
|
|
2224
|
+
inputBackgroundColor: r
|
|
2225
|
+
}, p = {
|
|
2226
|
+
name: l,
|
|
2227
|
+
subTitle: f,
|
|
2228
|
+
welcomeText: d,
|
|
450
2229
|
pineconeNamespace: e,
|
|
451
|
-
position:
|
|
452
|
-
aiInitialMessage:
|
|
2230
|
+
position: s,
|
|
2231
|
+
aiInitialMessage: u
|
|
453
2232
|
};
|
|
454
|
-
|
|
455
|
-
const
|
|
2233
|
+
u === "" && (p.aiInitialMessage = `Hello! I'm ${p.name}, your AI assistant. How can I help you today?`);
|
|
2234
|
+
const x = s === "left", T = "32px", E = {
|
|
456
2235
|
position: "fixed",
|
|
457
2236
|
bottom: "104px",
|
|
458
|
-
[
|
|
2237
|
+
[x ? "left" : "right"]: T,
|
|
459
2238
|
zIndex: 9999,
|
|
460
2239
|
pointerEvents: "auto"
|
|
461
|
-
},
|
|
2240
|
+
}, C = {
|
|
462
2241
|
position: "fixed",
|
|
463
2242
|
bottom: "32px",
|
|
464
|
-
[
|
|
2243
|
+
[x ? "left" : "right"]: T,
|
|
465
2244
|
zIndex: 1e4,
|
|
466
2245
|
pointerEvents: "auto"
|
|
467
2246
|
};
|
|
468
|
-
return /* @__PURE__ */
|
|
469
|
-
|
|
470
|
-
|
|
2247
|
+
return /* @__PURE__ */ k(Se, { children: [
|
|
2248
|
+
h && /* @__PURE__ */ w("div", { style: E, children: /* @__PURE__ */ w(
|
|
2249
|
+
gr,
|
|
471
2250
|
{
|
|
472
|
-
onClose:
|
|
473
|
-
theme:
|
|
474
|
-
chatBotData:
|
|
2251
|
+
onClose: c,
|
|
2252
|
+
theme: m,
|
|
2253
|
+
chatBotData: p
|
|
475
2254
|
}
|
|
476
2255
|
) }),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
2256
|
+
/* @__PURE__ */ w("div", { style: C, children: /* @__PURE__ */ w(
|
|
2257
|
+
Ft,
|
|
479
2258
|
{
|
|
480
|
-
onMinimise:
|
|
481
|
-
isOpen:
|
|
482
|
-
theme:
|
|
483
|
-
chatBotData:
|
|
2259
|
+
onMinimise: S,
|
|
2260
|
+
isOpen: h,
|
|
2261
|
+
theme: m,
|
|
2262
|
+
chatBotData: p
|
|
484
2263
|
}
|
|
485
2264
|
) })
|
|
486
2265
|
] });
|
|
487
2266
|
};
|
|
488
2267
|
export {
|
|
489
|
-
|
|
2268
|
+
$r as default
|
|
490
2269
|
};
|