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