react-aichatbot-widget 1.4.3 → 1.4.5
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 +20 -20
- package/README.md +71 -71
- package/dist/index.cjs +6 -6
- package/dist/index.js +244 -235
- package/package.json +41 -41
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as O, jsx as y, Fragment as Ee } from "react/jsx-runtime";
|
|
2
2
|
import { useState as L, useRef as Rt, useEffect as Ke } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Minus as Ct, MessageCircle as Xe, Send as Ye, Bot as Pe, Minimize2 as Tt, Maximize2 as Ot, X as At } from "lucide-react";
|
|
4
4
|
import { v4 as kt } from "uuid";
|
|
5
|
-
const Ft = ({
|
|
5
|
+
const Ft = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
6
6
|
const o = r.position === "left", l = {
|
|
7
7
|
position: "fixed",
|
|
8
8
|
bottom: "32px",
|
|
@@ -32,11 +32,11 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
32
32
|
onClick: e,
|
|
33
33
|
style: l,
|
|
34
34
|
onMouseEnter: (c) => Object.assign(c.currentTarget.style, p),
|
|
35
|
-
onMouseLeave: (c) => Object.keys(p).forEach((
|
|
35
|
+
onMouseLeave: (c) => Object.keys(p).forEach((u) => c.currentTarget.style[u] = l[u] || ""),
|
|
36
36
|
onFocus: (c) => Object.assign(c.currentTarget.style, p),
|
|
37
|
-
onBlur: (c) => Object.keys(p).forEach((
|
|
37
|
+
onBlur: (c) => Object.keys(p).forEach((u) => c.currentTarget.style[u] = l[u] || ""),
|
|
38
38
|
children: [
|
|
39
|
-
t ? /* @__PURE__ */ y(Ct, { size:
|
|
39
|
+
t ? /* @__PURE__ */ y(Ct, { size: 20, strokeWidth: 2.5 }) : /* @__PURE__ */ y(Xe, { size: 20, strokeWidth: 2.5 }),
|
|
40
40
|
!t && /* @__PURE__ */ y("span", { style: {
|
|
41
41
|
position: "absolute",
|
|
42
42
|
top: "-4px",
|
|
@@ -67,8 +67,8 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
67
67
|
}, Nt = ({ onSendMessage: e, isLoading: t, theme: n }) => {
|
|
68
68
|
const [r, o] = L(""), i = () => {
|
|
69
69
|
!r.trim() || t || (e(r.trim()), o(""));
|
|
70
|
-
}, s = (
|
|
71
|
-
|
|
70
|
+
}, s = (u) => {
|
|
71
|
+
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), i());
|
|
72
72
|
}, l = {
|
|
73
73
|
padding: "16px",
|
|
74
74
|
borderTop: "1px solid rgba(255, 255, 255, 0.2)",
|
|
@@ -79,7 +79,7 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
79
79
|
display: "flex",
|
|
80
80
|
gap: "12px",
|
|
81
81
|
alignItems: "center"
|
|
82
|
-
},
|
|
82
|
+
}, d = {
|
|
83
83
|
flex: 1,
|
|
84
84
|
padding: "12px 16px",
|
|
85
85
|
background: n.inputBackgroundColor || n.backgroundColor,
|
|
@@ -116,15 +116,15 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
116
116
|
type: "text",
|
|
117
117
|
placeholder: "Type a message...",
|
|
118
118
|
value: r,
|
|
119
|
-
onChange: (
|
|
119
|
+
onChange: (u) => o(u.target.value),
|
|
120
120
|
onKeyDown: s,
|
|
121
121
|
disabled: t,
|
|
122
|
-
style:
|
|
123
|
-
onFocus: (
|
|
124
|
-
|
|
122
|
+
style: d,
|
|
123
|
+
onFocus: (u) => {
|
|
124
|
+
u.target.style.boxShadow = "0 0 0 3px rgba(100, 150, 255, 0.3)", u.target.style.borderColor = "#60a5fa";
|
|
125
125
|
},
|
|
126
|
-
onBlur: (
|
|
127
|
-
|
|
126
|
+
onBlur: (u) => {
|
|
127
|
+
u.target.style.boxShadow = "none", u.target.style.borderColor = n.fontColor;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
),
|
|
@@ -135,11 +135,11 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
135
135
|
disabled: t || !r.trim(),
|
|
136
136
|
style: c,
|
|
137
137
|
"aria-label": "Send message",
|
|
138
|
-
onMouseEnter: (
|
|
139
|
-
!t && r.trim() && (
|
|
138
|
+
onMouseEnter: (u) => {
|
|
139
|
+
!t && r.trim() && (u.currentTarget.style.transform = "translateY(-2px)", u.currentTarget.style.boxShadow = "0 8px 16px rgba(0,0,0,0.15)");
|
|
140
140
|
},
|
|
141
|
-
onMouseLeave: (
|
|
142
|
-
|
|
141
|
+
onMouseLeave: (u) => {
|
|
142
|
+
u.currentTarget.style.transform = "translateY(0)", u.currentTarget.style.boxShadow = "none";
|
|
143
143
|
},
|
|
144
144
|
children: /* @__PURE__ */ y(Ye, { size: 18 })
|
|
145
145
|
}
|
|
@@ -149,10 +149,19 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
149
149
|
const r = Rt(null), o = () => {
|
|
150
150
|
r.current?.scrollIntoView({ behavior: "smooth" });
|
|
151
151
|
};
|
|
152
|
+
function i(u) {
|
|
153
|
+
return new Date(u).toLocaleString("en-AU", {
|
|
154
|
+
day: "numeric",
|
|
155
|
+
month: "short",
|
|
156
|
+
year: "numeric",
|
|
157
|
+
hour: "2-digit",
|
|
158
|
+
minute: "2-digit"
|
|
159
|
+
});
|
|
160
|
+
}
|
|
152
161
|
Ke(() => {
|
|
153
162
|
o();
|
|
154
163
|
}, [e, t]);
|
|
155
|
-
const
|
|
164
|
+
const s = {
|
|
156
165
|
flex: 1,
|
|
157
166
|
overflowY: "auto",
|
|
158
167
|
padding: "20px",
|
|
@@ -162,32 +171,32 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
162
171
|
display: "flex",
|
|
163
172
|
flexDirection: "column",
|
|
164
173
|
gap: "16px"
|
|
165
|
-
},
|
|
174
|
+
}, l = (u) => ({
|
|
166
175
|
display: "flex",
|
|
167
|
-
justifyContent:
|
|
176
|
+
justifyContent: u === "user" ? "flex-end" : "flex-start",
|
|
168
177
|
width: "100%"
|
|
169
|
-
}),
|
|
178
|
+
}), p = {
|
|
170
179
|
display: "flex",
|
|
171
180
|
flexDirection: "column",
|
|
172
181
|
maxWidth: "80%"
|
|
173
|
-
},
|
|
182
|
+
}, d = (u) => ({
|
|
174
183
|
padding: "12px 16px",
|
|
175
184
|
borderRadius: "16px",
|
|
176
185
|
boxShadow: "0 1px 3px rgba(0, 0, 0, 0.1)",
|
|
177
186
|
border: "1px solid #e4e4e7",
|
|
178
187
|
fontSize: "14px",
|
|
179
188
|
lineHeight: "1.5",
|
|
180
|
-
background:
|
|
189
|
+
background: u === "user" ? n.primaryColor : n.backgroundColor,
|
|
181
190
|
color: n.fontColor,
|
|
182
191
|
wordWrap: "break-word"
|
|
183
|
-
}),
|
|
184
|
-
...
|
|
192
|
+
}), c = {
|
|
193
|
+
...d("bot"),
|
|
185
194
|
animation: "fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",
|
|
186
195
|
animationDelay: "0s, 0.3s"
|
|
187
196
|
};
|
|
188
|
-
return /* @__PURE__ */ O("div", { style:
|
|
189
|
-
e.map((
|
|
190
|
-
|
|
197
|
+
return /* @__PURE__ */ O("div", { style: s, children: [
|
|
198
|
+
e.map((u, g) => /* @__PURE__ */ y("div", { style: l(u.type), children: /* @__PURE__ */ O("div", { style: p, children: [
|
|
199
|
+
u.type === "bot" && /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-start", marginLeft: "4px", marginBottom: "2px" }, children: [
|
|
191
200
|
/* @__PURE__ */ y(Pe, { size: 14, color: n.fontColor }),
|
|
192
201
|
/* @__PURE__ */ y(
|
|
193
202
|
"span",
|
|
@@ -197,11 +206,11 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
197
206
|
opacity: 0.55,
|
|
198
207
|
color: n.fontColor
|
|
199
208
|
},
|
|
200
|
-
children:
|
|
209
|
+
children: i(u.response_timestamp)
|
|
201
210
|
}
|
|
202
211
|
)
|
|
203
212
|
] }),
|
|
204
|
-
|
|
213
|
+
u.type === "user" && /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-end", marginRight: "4px", marginBottom: "2px" }, children: /* @__PURE__ */ y(
|
|
205
214
|
"span",
|
|
206
215
|
{
|
|
207
216
|
style: {
|
|
@@ -212,10 +221,10 @@ const Ft = ({ onClick: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
212
221
|
children: "You"
|
|
213
222
|
}
|
|
214
223
|
) }),
|
|
215
|
-
/* @__PURE__ */ y("div", { style:
|
|
216
|
-
] }) },
|
|
217
|
-
t && /* @__PURE__ */ y("div", { style:
|
|
218
|
-
typingBubbleStyle:
|
|
224
|
+
/* @__PURE__ */ y("div", { style: d(u.type), children: u.text })
|
|
225
|
+
] }) }, g)),
|
|
226
|
+
t && /* @__PURE__ */ y("div", { style: l("bot"), children: /* @__PURE__ */ O("div", { style: {
|
|
227
|
+
typingBubbleStyle: c,
|
|
219
228
|
display: "flex",
|
|
220
229
|
alignItems: "center",
|
|
221
230
|
gap: "8px"
|
|
@@ -234,9 +243,9 @@ function Ge(e, t) {
|
|
|
234
243
|
const { toString: _t } = Object.prototype, { getPrototypeOf: Re } = Object, { iterator: ce, toStringTag: Qe } = Symbol, ue = /* @__PURE__ */ ((e) => (t) => {
|
|
235
244
|
const n = _t.call(t);
|
|
236
245
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
237
|
-
})(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => ue(t) === e), de = (e) => (t) => typeof t === e, { isArray:
|
|
246
|
+
})(/* @__PURE__ */ Object.create(null)), B = (e) => (e = e.toLowerCase(), (t) => ue(t) === e), de = (e) => (t) => typeof t === e, { isArray: K } = Array, V = de("undefined");
|
|
238
247
|
function Z(e) {
|
|
239
|
-
return e !== null && !
|
|
248
|
+
return e !== null && !V(e) && e.constructor !== null && !V(e.constructor) && P(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
240
249
|
}
|
|
241
250
|
const Ze = B("ArrayBuffer");
|
|
242
251
|
function Ut(e) {
|
|
@@ -265,7 +274,7 @@ function te(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
265
274
|
if (e === null || typeof e > "u")
|
|
266
275
|
return;
|
|
267
276
|
let r, o;
|
|
268
|
-
if (typeof e != "object" && (e = [e]),
|
|
277
|
+
if (typeof e != "object" && (e = [e]), K(e))
|
|
269
278
|
for (r = 0, o = e.length; r < o; r++)
|
|
270
279
|
t.call(null, e[r], r, e);
|
|
271
280
|
else {
|
|
@@ -288,11 +297,11 @@ function tt(e, t) {
|
|
|
288
297
|
return o;
|
|
289
298
|
return null;
|
|
290
299
|
}
|
|
291
|
-
const
|
|
300
|
+
const q = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, nt = (e) => !V(e) && e !== q;
|
|
292
301
|
function ge() {
|
|
293
302
|
const { caseless: e, skipUndefined: t } = nt(this) && this || {}, n = {}, r = (o, i) => {
|
|
294
303
|
const s = e && tt(n, i) || i;
|
|
295
|
-
se(n[s]) && se(o) ? n[s] = ge(n[s], o) : se(o) ? n[s] = ge({}, o) :
|
|
304
|
+
se(n[s]) && se(o) ? n[s] = ge(n[s], o) : se(o) ? n[s] = ge({}, o) : K(o) ? n[s] = o.slice() : (!t || !V(o)) && (n[s] = o);
|
|
296
305
|
};
|
|
297
306
|
for (let o = 0, i = arguments.length; o < i; o++)
|
|
298
307
|
arguments[o] && te(arguments[o], r);
|
|
@@ -320,7 +329,7 @@ const Xt = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
|
|
|
320
329
|
return r !== -1 && r === n;
|
|
321
330
|
}, en = (e) => {
|
|
322
331
|
if (!e) return null;
|
|
323
|
-
if (
|
|
332
|
+
if (K(e)) return e;
|
|
324
333
|
let t = e.length;
|
|
325
334
|
if (!et(t)) return null;
|
|
326
335
|
const n = new Array(t);
|
|
@@ -372,7 +381,7 @@ const Xt = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
|
|
|
372
381
|
n[i] = !0;
|
|
373
382
|
});
|
|
374
383
|
};
|
|
375
|
-
return
|
|
384
|
+
return K(e) ? r(e) : r(String(e).split(t)), n;
|
|
376
385
|
}, un = () => {
|
|
377
386
|
}, dn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
378
387
|
function fn(e) {
|
|
@@ -387,25 +396,25 @@ const pn = (e) => {
|
|
|
387
396
|
return r;
|
|
388
397
|
if (!("toJSON" in r)) {
|
|
389
398
|
t[o] = r;
|
|
390
|
-
const i =
|
|
399
|
+
const i = K(r) ? [] : {};
|
|
391
400
|
return te(r, (s, l) => {
|
|
392
401
|
const p = n(s, o + 1);
|
|
393
|
-
!
|
|
402
|
+
!V(p) && (i[l] = p);
|
|
394
403
|
}), t[o] = void 0, i;
|
|
395
404
|
}
|
|
396
405
|
}
|
|
397
406
|
return r;
|
|
398
407
|
};
|
|
399
408
|
return n(e, 0);
|
|
400
|
-
}, hn = B("AsyncFunction"), mn = (e) => e && (ee(e) || P(e)) && P(e.then) && P(e.catch), ot = ((e, t) => e ? setImmediate : t ? ((n, r) => (
|
|
401
|
-
o ===
|
|
409
|
+
}, hn = B("AsyncFunction"), mn = (e) => e && (ee(e) || P(e)) && P(e.then) && P(e.catch), ot = ((e, t) => e ? setImmediate : t ? ((n, r) => (q.addEventListener("message", ({ source: o, data: i }) => {
|
|
410
|
+
o === q && i === n && r.length && r.shift()();
|
|
402
411
|
}, !1), (o) => {
|
|
403
|
-
r.push(o),
|
|
412
|
+
r.push(o), q.postMessage(n, "*");
|
|
404
413
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
405
414
|
typeof setImmediate == "function",
|
|
406
|
-
P(
|
|
407
|
-
), yn = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
408
|
-
isArray:
|
|
415
|
+
P(q.postMessage)
|
|
416
|
+
), yn = typeof queueMicrotask < "u" ? queueMicrotask.bind(q) : typeof process < "u" && process.nextTick || ot, bn = (e) => e != null && P(e[ce]), a = {
|
|
417
|
+
isArray: K,
|
|
409
418
|
isArrayBuffer: Ze,
|
|
410
419
|
isBuffer: Z,
|
|
411
420
|
isFormData: qt,
|
|
@@ -420,7 +429,7 @@ const pn = (e) => {
|
|
|
420
429
|
isRequest: Wt,
|
|
421
430
|
isResponse: Jt,
|
|
422
431
|
isHeaders: Vt,
|
|
423
|
-
isUndefined:
|
|
432
|
+
isUndefined: V,
|
|
424
433
|
isDate: jt,
|
|
425
434
|
isFile: It,
|
|
426
435
|
isBlob: vt,
|
|
@@ -454,7 +463,7 @@ const pn = (e) => {
|
|
|
454
463
|
noop: un,
|
|
455
464
|
toFiniteNumber: dn,
|
|
456
465
|
findKey: tt,
|
|
457
|
-
global:
|
|
466
|
+
global: q,
|
|
458
467
|
isContextDefined: nt,
|
|
459
468
|
isSpecCompliantForm: fn,
|
|
460
469
|
toJSONObject: pn,
|
|
@@ -512,7 +521,7 @@ b.from = (e, t, n, r, o, i) => {
|
|
|
512
521
|
const s = Object.create(st);
|
|
513
522
|
a.toFlatObject(e, s, function(c) {
|
|
514
523
|
return c !== Error.prototype;
|
|
515
|
-
}, (
|
|
524
|
+
}, (d) => d !== "isAxiosError");
|
|
516
525
|
const l = e && e.message ? e.message : "Error", p = t == null && e ? e.code : t;
|
|
517
526
|
return b.call(s, l, p, 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;
|
|
518
527
|
};
|
|
@@ -547,7 +556,7 @@ function fe(e, t, n) {
|
|
|
547
556
|
const r = n.metaTokens, o = n.visitor || c, i = n.dots, s = n.indexes, p = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
548
557
|
if (!a.isFunction(o))
|
|
549
558
|
throw new TypeError("visitor must be a function");
|
|
550
|
-
function
|
|
559
|
+
function d(f) {
|
|
551
560
|
if (f === null) return "";
|
|
552
561
|
if (a.isDate(f))
|
|
553
562
|
return f.toISOString();
|
|
@@ -567,22 +576,22 @@ function fe(e, t, n) {
|
|
|
567
576
|
!(a.isUndefined(x) || x === null) && t.append(
|
|
568
577
|
// eslint-disable-next-line no-nested-ternary
|
|
569
578
|
s === !0 ? Ue([m], T, i) : s === null ? m : m + "[]",
|
|
570
|
-
|
|
579
|
+
d(x)
|
|
571
580
|
);
|
|
572
581
|
}), !1;
|
|
573
582
|
}
|
|
574
|
-
return xe(f) ? !0 : (t.append(Ue(h, m, i),
|
|
583
|
+
return xe(f) ? !0 : (t.append(Ue(h, m, i), d(f)), !1);
|
|
575
584
|
}
|
|
576
|
-
const
|
|
585
|
+
const u = [], g = Object.assign(wn, {
|
|
577
586
|
defaultVisitor: c,
|
|
578
|
-
convertValue:
|
|
587
|
+
convertValue: d,
|
|
579
588
|
isVisitable: xe
|
|
580
589
|
});
|
|
581
590
|
function R(f, m) {
|
|
582
591
|
if (!a.isUndefined(f)) {
|
|
583
|
-
if (
|
|
592
|
+
if (u.indexOf(f) !== -1)
|
|
584
593
|
throw Error("Circular reference detected in " + m.join("."));
|
|
585
|
-
|
|
594
|
+
u.push(f), a.forEach(f, function(w, C) {
|
|
586
595
|
(!(a.isUndefined(w) || w === null) && o.call(
|
|
587
596
|
t,
|
|
588
597
|
w,
|
|
@@ -590,7 +599,7 @@ function fe(e, t, n) {
|
|
|
590
599
|
m,
|
|
591
600
|
g
|
|
592
601
|
)) === !0 && R(w, m ? m.concat(C) : [C]);
|
|
593
|
-
}),
|
|
602
|
+
}), u.pop();
|
|
594
603
|
}
|
|
595
604
|
}
|
|
596
605
|
if (!a.isObject(e))
|
|
@@ -906,24 +915,24 @@ let _ = class {
|
|
|
906
915
|
}
|
|
907
916
|
set(t, n, r) {
|
|
908
917
|
const o = this;
|
|
909
|
-
function i(l, p,
|
|
918
|
+
function i(l, p, d) {
|
|
910
919
|
const c = Q(p);
|
|
911
920
|
if (!c)
|
|
912
921
|
throw new Error("header name must be a non-empty string");
|
|
913
|
-
const
|
|
914
|
-
(!
|
|
922
|
+
const u = a.findKey(o, c);
|
|
923
|
+
(!u || o[u] === void 0 || d === !0 || d === void 0 && o[u] !== !1) && (o[u || p] = ie(l));
|
|
915
924
|
}
|
|
916
|
-
const s = (l, p) => a.forEach(l, (
|
|
925
|
+
const s = (l, p) => a.forEach(l, (d, c) => i(d, c, p));
|
|
917
926
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
918
927
|
s(t, n);
|
|
919
928
|
else if (a.isString(t) && (t = t.trim()) && !jn(t))
|
|
920
929
|
s(Bn(t), n);
|
|
921
930
|
else if (a.isObject(t) && a.isIterable(t)) {
|
|
922
|
-
let l = {}, p,
|
|
931
|
+
let l = {}, p, d;
|
|
923
932
|
for (const c of t) {
|
|
924
933
|
if (!a.isArray(c))
|
|
925
934
|
throw TypeError("Object iterator must return a key-value pair");
|
|
926
|
-
l[
|
|
935
|
+
l[d = c[0]] = (p = l[d]) ? a.isArray(p) ? [...p, c[1]] : [p, c[1]] : c[1];
|
|
927
936
|
}
|
|
928
937
|
s(l, n);
|
|
929
938
|
} else
|
|
@@ -1047,10 +1056,10 @@ function ye(e, t) {
|
|
|
1047
1056
|
function ft(e) {
|
|
1048
1057
|
return !!(e && e.__CANCEL__);
|
|
1049
1058
|
}
|
|
1050
|
-
function
|
|
1059
|
+
function X(e, t, n) {
|
|
1051
1060
|
b.call(this, e ?? "canceled", b.ERR_CANCELED, t, n), this.name = "CanceledError";
|
|
1052
1061
|
}
|
|
1053
|
-
a.inherits(
|
|
1062
|
+
a.inherits(X, b, {
|
|
1054
1063
|
__CANCEL__: !0
|
|
1055
1064
|
});
|
|
1056
1065
|
function pt(e, t, n) {
|
|
@@ -1072,47 +1081,47 @@ function zn(e, t) {
|
|
|
1072
1081
|
const n = new Array(e), r = new Array(e);
|
|
1073
1082
|
let o = 0, i = 0, s;
|
|
1074
1083
|
return t = t !== void 0 ? t : 1e3, function(p) {
|
|
1075
|
-
const
|
|
1076
|
-
s || (s =
|
|
1077
|
-
let
|
|
1078
|
-
for (;
|
|
1079
|
-
g += n[
|
|
1080
|
-
if (o = (o + 1) % e, o === i && (i = (i + 1) % e),
|
|
1084
|
+
const d = Date.now(), c = r[i];
|
|
1085
|
+
s || (s = d), n[o] = p, r[o] = d;
|
|
1086
|
+
let u = i, g = 0;
|
|
1087
|
+
for (; u !== o; )
|
|
1088
|
+
g += n[u++], u = u % e;
|
|
1089
|
+
if (o = (o + 1) % e, o === i && (i = (i + 1) % e), d - s < t)
|
|
1081
1090
|
return;
|
|
1082
|
-
const R = c &&
|
|
1091
|
+
const R = c && d - c;
|
|
1083
1092
|
return R ? Math.round(g * 1e3 / R) : void 0;
|
|
1084
1093
|
};
|
|
1085
1094
|
}
|
|
1086
1095
|
function qn(e, t) {
|
|
1087
1096
|
let n = 0, r = 1e3 / t, o, i;
|
|
1088
|
-
const s = (
|
|
1089
|
-
n = c, o = null, i && (clearTimeout(i), i = null), e(...
|
|
1097
|
+
const s = (d, c = Date.now()) => {
|
|
1098
|
+
n = c, o = null, i && (clearTimeout(i), i = null), e(...d);
|
|
1090
1099
|
};
|
|
1091
|
-
return [(...
|
|
1092
|
-
const c = Date.now(),
|
|
1093
|
-
|
|
1100
|
+
return [(...d) => {
|
|
1101
|
+
const c = Date.now(), u = c - n;
|
|
1102
|
+
u >= r ? s(d, c) : (o = d, i || (i = setTimeout(() => {
|
|
1094
1103
|
i = null, s(o);
|
|
1095
|
-
}, r -
|
|
1104
|
+
}, r - u)));
|
|
1096
1105
|
}, () => o && s(o)];
|
|
1097
1106
|
}
|
|
1098
1107
|
const le = (e, t, n = 3) => {
|
|
1099
1108
|
let r = 0;
|
|
1100
1109
|
const o = zn(50, 250);
|
|
1101
1110
|
return qn((i) => {
|
|
1102
|
-
const s = i.loaded, l = i.lengthComputable ? i.total : void 0, p = s - r,
|
|
1111
|
+
const s = i.loaded, l = i.lengthComputable ? i.total : void 0, p = s - r, d = o(p), c = s <= l;
|
|
1103
1112
|
r = s;
|
|
1104
|
-
const
|
|
1113
|
+
const u = {
|
|
1105
1114
|
loaded: s,
|
|
1106
1115
|
total: l,
|
|
1107
1116
|
progress: l ? s / l : void 0,
|
|
1108
1117
|
bytes: p,
|
|
1109
|
-
rate:
|
|
1110
|
-
estimated:
|
|
1118
|
+
rate: d || void 0,
|
|
1119
|
+
estimated: d && l && c ? (l - s) / d : void 0,
|
|
1111
1120
|
event: i,
|
|
1112
1121
|
lengthComputable: l != null,
|
|
1113
1122
|
[t ? "download" : "upload"]: !0
|
|
1114
1123
|
};
|
|
1115
|
-
e(
|
|
1124
|
+
e(u);
|
|
1116
1125
|
}, n);
|
|
1117
1126
|
}, je = (e, t) => {
|
|
1118
1127
|
const n = e != null;
|
|
@@ -1164,33 +1173,33 @@ function ht(e, t, n) {
|
|
|
1164
1173
|
return e && (r || n == !1) ? Jn(e, t) : t;
|
|
1165
1174
|
}
|
|
1166
1175
|
const ve = (e) => e instanceof _ ? { ...e } : e;
|
|
1167
|
-
function
|
|
1176
|
+
function $(e, t) {
|
|
1168
1177
|
t = t || {};
|
|
1169
1178
|
const n = {};
|
|
1170
|
-
function r(
|
|
1171
|
-
return a.isPlainObject(
|
|
1179
|
+
function r(d, c, u, g) {
|
|
1180
|
+
return a.isPlainObject(d) && a.isPlainObject(c) ? a.merge.call({ caseless: g }, d, c) : a.isPlainObject(c) ? a.merge({}, c) : a.isArray(c) ? c.slice() : c;
|
|
1172
1181
|
}
|
|
1173
|
-
function o(
|
|
1182
|
+
function o(d, c, u, g) {
|
|
1174
1183
|
if (a.isUndefined(c)) {
|
|
1175
|
-
if (!a.isUndefined(
|
|
1176
|
-
return r(void 0,
|
|
1177
|
-
} else return r(
|
|
1184
|
+
if (!a.isUndefined(d))
|
|
1185
|
+
return r(void 0, d, u, g);
|
|
1186
|
+
} else return r(d, c, u, g);
|
|
1178
1187
|
}
|
|
1179
|
-
function i(
|
|
1188
|
+
function i(d, c) {
|
|
1180
1189
|
if (!a.isUndefined(c))
|
|
1181
1190
|
return r(void 0, c);
|
|
1182
1191
|
}
|
|
1183
|
-
function s(
|
|
1192
|
+
function s(d, c) {
|
|
1184
1193
|
if (a.isUndefined(c)) {
|
|
1185
|
-
if (!a.isUndefined(
|
|
1186
|
-
return r(void 0,
|
|
1194
|
+
if (!a.isUndefined(d))
|
|
1195
|
+
return r(void 0, d);
|
|
1187
1196
|
} else return r(void 0, c);
|
|
1188
1197
|
}
|
|
1189
|
-
function l(
|
|
1190
|
-
if (
|
|
1191
|
-
return r(
|
|
1192
|
-
if (
|
|
1193
|
-
return r(void 0,
|
|
1198
|
+
function l(d, c, u) {
|
|
1199
|
+
if (u in t)
|
|
1200
|
+
return r(d, c);
|
|
1201
|
+
if (u in e)
|
|
1202
|
+
return r(void 0, d);
|
|
1194
1203
|
}
|
|
1195
1204
|
const p = {
|
|
1196
1205
|
url: i,
|
|
@@ -1221,15 +1230,15 @@ function W(e, t) {
|
|
|
1221
1230
|
socketPath: s,
|
|
1222
1231
|
responseEncoding: s,
|
|
1223
1232
|
validateStatus: l,
|
|
1224
|
-
headers: (
|
|
1233
|
+
headers: (d, c, u) => o(ve(d), ve(c), u, !0)
|
|
1225
1234
|
};
|
|
1226
1235
|
return a.forEach(Object.keys({ ...e, ...t }), function(c) {
|
|
1227
|
-
const
|
|
1228
|
-
a.isUndefined(g) &&
|
|
1236
|
+
const u = p[c] || o, g = u(e[c], t[c], c);
|
|
1237
|
+
a.isUndefined(g) && u !== l || (n[c] = g);
|
|
1229
1238
|
}), n;
|
|
1230
1239
|
}
|
|
1231
1240
|
const mt = (e) => {
|
|
1232
|
-
const t =
|
|
1241
|
+
const t = $({}, e);
|
|
1233
1242
|
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: l } = t;
|
|
1234
1243
|
if (t.headers = s = _.from(s), t.url = ct(ht(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && s.set(
|
|
1235
1244
|
"Authorization",
|
|
@@ -1238,9 +1247,9 @@ const mt = (e) => {
|
|
|
1238
1247
|
if (N.hasStandardBrowserEnv || N.hasStandardBrowserWebWorkerEnv)
|
|
1239
1248
|
s.setContentType(void 0);
|
|
1240
1249
|
else if (a.isFunction(n.getHeaders)) {
|
|
1241
|
-
const p = n.getHeaders(),
|
|
1242
|
-
Object.entries(p).forEach(([c,
|
|
1243
|
-
|
|
1250
|
+
const p = n.getHeaders(), d = ["content-type", "content-length"];
|
|
1251
|
+
Object.entries(p).forEach(([c, u]) => {
|
|
1252
|
+
d.includes(c.toLowerCase()) && s.set(c, u);
|
|
1244
1253
|
});
|
|
1245
1254
|
}
|
|
1246
1255
|
}
|
|
@@ -1254,7 +1263,7 @@ const mt = (e) => {
|
|
|
1254
1263
|
const o = mt(e);
|
|
1255
1264
|
let i = o.data;
|
|
1256
1265
|
const s = _.from(o.headers).normalize();
|
|
1257
|
-
let { responseType: l, onUploadProgress: p, onDownloadProgress:
|
|
1266
|
+
let { responseType: l, onUploadProgress: p, onDownloadProgress: d } = o, c, u, g, R, f;
|
|
1258
1267
|
function m() {
|
|
1259
1268
|
R && R(), f && f(), o.cancelToken && o.cancelToken.unsubscribe(c), o.signal && o.signal.removeEventListener("abort", c);
|
|
1260
1269
|
}
|
|
@@ -1273,10 +1282,10 @@ const mt = (e) => {
|
|
|
1273
1282
|
config: e,
|
|
1274
1283
|
request: h
|
|
1275
1284
|
};
|
|
1276
|
-
pt(function(
|
|
1277
|
-
n(
|
|
1278
|
-
}, function(
|
|
1279
|
-
r(
|
|
1285
|
+
pt(function(S) {
|
|
1286
|
+
n(S), m();
|
|
1287
|
+
}, function(S) {
|
|
1288
|
+
r(S), m();
|
|
1280
1289
|
}, F), h = null;
|
|
1281
1290
|
}
|
|
1282
1291
|
"onloadend" in h ? h.onloadend = w : h.onreadystatechange = function() {
|
|
@@ -1284,8 +1293,8 @@ const mt = (e) => {
|
|
|
1284
1293
|
}, h.onabort = function() {
|
|
1285
1294
|
h && (r(new b("Request aborted", b.ECONNABORTED, e, h)), h = null);
|
|
1286
1295
|
}, h.onerror = function(T) {
|
|
1287
|
-
const F = T && T.message ? T.message : "Network Error",
|
|
1288
|
-
|
|
1296
|
+
const F = T && T.message ? T.message : "Network Error", E = new b(F, b.ERR_NETWORK, e, h);
|
|
1297
|
+
E.event = T || null, r(E), h = null;
|
|
1289
1298
|
}, h.ontimeout = function() {
|
|
1290
1299
|
let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1291
1300
|
const F = o.transitional || ut;
|
|
@@ -1297,8 +1306,8 @@ const mt = (e) => {
|
|
|
1297
1306
|
)), h = null;
|
|
1298
1307
|
}, i === void 0 && s.setContentType(null), "setRequestHeader" in h && a.forEach(s.toJSON(), function(T, F) {
|
|
1299
1308
|
h.setRequestHeader(F, T);
|
|
1300
|
-
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType),
|
|
1301
|
-
h && (r(!x || x.type ? new
|
|
1309
|
+
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType), d && ([g, f] = le(d, !0), h.addEventListener("progress", g)), p && h.upload && ([u, R] = le(p), h.upload.addEventListener("progress", u), h.upload.addEventListener("loadend", R)), (o.cancelToken || o.signal) && (c = (x) => {
|
|
1310
|
+
h && (r(!x || x.type ? new X(null, e, h) : x), h.abort(), h = null);
|
|
1302
1311
|
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
|
|
1303
1312
|
const C = Mn(o.url);
|
|
1304
1313
|
if (C && N.protocols.indexOf(C) === -1) {
|
|
@@ -1311,22 +1320,22 @@ const mt = (e) => {
|
|
|
1311
1320
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1312
1321
|
if (t || n) {
|
|
1313
1322
|
let r = new AbortController(), o;
|
|
1314
|
-
const i = function(
|
|
1323
|
+
const i = function(d) {
|
|
1315
1324
|
if (!o) {
|
|
1316
1325
|
o = !0, l();
|
|
1317
|
-
const c =
|
|
1318
|
-
r.abort(c instanceof b ? c : new
|
|
1326
|
+
const c = d instanceof Error ? d : this.reason;
|
|
1327
|
+
r.abort(c instanceof b ? c : new X(c instanceof Error ? c.message : c));
|
|
1319
1328
|
}
|
|
1320
1329
|
};
|
|
1321
1330
|
let s = t && setTimeout(() => {
|
|
1322
1331
|
s = null, i(new b(`timeout ${t} of ms exceeded`, b.ETIMEDOUT));
|
|
1323
1332
|
}, t);
|
|
1324
1333
|
const l = () => {
|
|
1325
|
-
e && (s && clearTimeout(s), s = null, e.forEach((
|
|
1326
|
-
|
|
1334
|
+
e && (s && clearTimeout(s), s = null, e.forEach((d) => {
|
|
1335
|
+
d.unsubscribe ? d.unsubscribe(i) : d.removeEventListener("abort", i);
|
|
1327
1336
|
}), e = null);
|
|
1328
1337
|
};
|
|
1329
|
-
e.forEach((
|
|
1338
|
+
e.forEach((d) => d.addEventListener("abort", i));
|
|
1330
1339
|
const { signal: p } = r;
|
|
1331
1340
|
return p.unsubscribe = () => a.asap(l), p;
|
|
1332
1341
|
}
|
|
@@ -1366,19 +1375,19 @@ const mt = (e) => {
|
|
|
1366
1375
|
return new ReadableStream({
|
|
1367
1376
|
async pull(p) {
|
|
1368
1377
|
try {
|
|
1369
|
-
const { done:
|
|
1370
|
-
if (
|
|
1378
|
+
const { done: d, value: c } = await o.next();
|
|
1379
|
+
if (d) {
|
|
1371
1380
|
l(), p.close();
|
|
1372
1381
|
return;
|
|
1373
1382
|
}
|
|
1374
|
-
let
|
|
1383
|
+
let u = c.byteLength;
|
|
1375
1384
|
if (n) {
|
|
1376
|
-
let g = i +=
|
|
1385
|
+
let g = i += u;
|
|
1377
1386
|
n(g);
|
|
1378
1387
|
}
|
|
1379
1388
|
p.enqueue(new Uint8Array(c));
|
|
1380
|
-
} catch (
|
|
1381
|
-
throw l(
|
|
1389
|
+
} catch (d) {
|
|
1390
|
+
throw l(d), d;
|
|
1382
1391
|
}
|
|
1383
1392
|
},
|
|
1384
1393
|
cancel(p) {
|
|
@@ -1406,7 +1415,7 @@ const mt = (e) => {
|
|
|
1406
1415
|
const { fetch: t, Request: n, Response: r } = e, o = t ? oe(t) : typeof fetch == "function", i = oe(n), s = oe(r);
|
|
1407
1416
|
if (!o)
|
|
1408
1417
|
return !1;
|
|
1409
|
-
const l = o && oe(qe), p = o && (typeof He == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new He()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())),
|
|
1418
|
+
const l = o && oe(qe), p = o && (typeof He == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new He()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), d = i && l && $e(() => {
|
|
1410
1419
|
let f = !1;
|
|
1411
1420
|
const m = new n(N.origin, {
|
|
1412
1421
|
body: new qe(),
|
|
@@ -1416,11 +1425,11 @@ const mt = (e) => {
|
|
|
1416
1425
|
}
|
|
1417
1426
|
}).headers.has("Content-Type");
|
|
1418
1427
|
return f && !m;
|
|
1419
|
-
}), c = s && l && $e(() => a.isReadableStream(new r("").body)),
|
|
1428
|
+
}), c = s && l && $e(() => a.isReadableStream(new r("").body)), u = {
|
|
1420
1429
|
stream: c && ((f) => f.body)
|
|
1421
1430
|
};
|
|
1422
1431
|
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1423
|
-
!
|
|
1432
|
+
!u[f] && (u[f] = (m, h) => {
|
|
1424
1433
|
let w = m && m[f];
|
|
1425
1434
|
if (w)
|
|
1426
1435
|
return w.call(m);
|
|
@@ -1454,66 +1463,66 @@ const mt = (e) => {
|
|
|
1454
1463
|
cancelToken: x,
|
|
1455
1464
|
timeout: T,
|
|
1456
1465
|
onDownloadProgress: F,
|
|
1457
|
-
onUploadProgress:
|
|
1458
|
-
responseType:
|
|
1459
|
-
headers:
|
|
1460
|
-
withCredentials:
|
|
1466
|
+
onUploadProgress: E,
|
|
1467
|
+
responseType: S,
|
|
1468
|
+
headers: Y,
|
|
1469
|
+
withCredentials: W = "same-origin",
|
|
1461
1470
|
fetchOptions: k
|
|
1462
1471
|
} = mt(f), U = t || fetch;
|
|
1463
|
-
|
|
1472
|
+
S = S ? (S + "").toLowerCase() : "text";
|
|
1464
1473
|
let I = Xn([C, x && x.toAbortSignal()], T), G = null;
|
|
1465
|
-
const
|
|
1474
|
+
const z = I && I.unsubscribe && (() => {
|
|
1466
1475
|
I.unsubscribe();
|
|
1467
1476
|
});
|
|
1468
1477
|
let Ae;
|
|
1469
1478
|
try {
|
|
1470
|
-
if (
|
|
1479
|
+
if (E && d && h !== "get" && h !== "head" && (Ae = await R(Y, w)) !== 0) {
|
|
1471
1480
|
let M = new n(m, {
|
|
1472
1481
|
method: "POST",
|
|
1473
1482
|
body: w,
|
|
1474
1483
|
duplex: "half"
|
|
1475
|
-
}),
|
|
1476
|
-
if (a.isFormData(w) && (
|
|
1484
|
+
}), J;
|
|
1485
|
+
if (a.isFormData(w) && (J = M.headers.get("content-type")) && Y.setContentType(J), M.body) {
|
|
1477
1486
|
const [he, re] = je(
|
|
1478
1487
|
Ae,
|
|
1479
|
-
le(Ie(
|
|
1488
|
+
le(Ie(E))
|
|
1480
1489
|
);
|
|
1481
1490
|
w = Me(M.body, ze, he, re);
|
|
1482
1491
|
}
|
|
1483
1492
|
}
|
|
1484
|
-
a.isString(
|
|
1493
|
+
a.isString(W) || (W = W ? "include" : "omit");
|
|
1485
1494
|
const D = i && "credentials" in n.prototype, ke = {
|
|
1486
1495
|
...k,
|
|
1487
1496
|
signal: I,
|
|
1488
1497
|
method: h.toUpperCase(),
|
|
1489
|
-
headers:
|
|
1498
|
+
headers: Y.normalize().toJSON(),
|
|
1490
1499
|
body: w,
|
|
1491
1500
|
duplex: "half",
|
|
1492
|
-
credentials: D ?
|
|
1501
|
+
credentials: D ? W : void 0
|
|
1493
1502
|
};
|
|
1494
1503
|
G = i && new n(m, ke);
|
|
1495
1504
|
let v = await (i ? U(G, k) : U(m, ke));
|
|
1496
|
-
const Fe = c && (
|
|
1497
|
-
if (c && (F || Fe &&
|
|
1505
|
+
const Fe = c && (S === "stream" || S === "response");
|
|
1506
|
+
if (c && (F || Fe && z)) {
|
|
1498
1507
|
const M = {};
|
|
1499
1508
|
["status", "statusText", "headers"].forEach((Ne) => {
|
|
1500
1509
|
M[Ne] = v[Ne];
|
|
1501
1510
|
});
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1511
|
+
const J = a.toFiniteNumber(v.headers.get("content-length")), [he, re] = F && je(
|
|
1512
|
+
J,
|
|
1504
1513
|
le(Ie(F), !0)
|
|
1505
1514
|
) || [];
|
|
1506
1515
|
v = new r(
|
|
1507
1516
|
Me(v.body, ze, he, () => {
|
|
1508
|
-
re && re(),
|
|
1517
|
+
re && re(), z && z();
|
|
1509
1518
|
}),
|
|
1510
1519
|
M
|
|
1511
1520
|
);
|
|
1512
1521
|
}
|
|
1513
|
-
|
|
1514
|
-
let Et = await
|
|
1515
|
-
return !Fe &&
|
|
1516
|
-
pt(M,
|
|
1522
|
+
S = S || "text";
|
|
1523
|
+
let Et = await u[a.findKey(u, S) || "text"](v, f);
|
|
1524
|
+
return !Fe && z && z(), await new Promise((M, J) => {
|
|
1525
|
+
pt(M, J, {
|
|
1517
1526
|
data: Et,
|
|
1518
1527
|
headers: _.from(v.headers),
|
|
1519
1528
|
status: v.status,
|
|
@@ -1523,7 +1532,7 @@ const mt = (e) => {
|
|
|
1523
1532
|
});
|
|
1524
1533
|
});
|
|
1525
1534
|
} catch (D) {
|
|
1526
|
-
throw
|
|
1535
|
+
throw z && z(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
|
|
1527
1536
|
new b("Network Error", b.ERR_NETWORK, f, G),
|
|
1528
1537
|
{
|
|
1529
1538
|
cause: D.cause || D
|
|
@@ -1538,10 +1547,10 @@ const mt = (e) => {
|
|
|
1538
1547
|
o,
|
|
1539
1548
|
n
|
|
1540
1549
|
];
|
|
1541
|
-
let s = i.length, l = s, p,
|
|
1550
|
+
let s = i.length, l = s, p, d, c = tr;
|
|
1542
1551
|
for (; l--; )
|
|
1543
|
-
p = i[l],
|
|
1544
|
-
return
|
|
1552
|
+
p = i[l], d = c.get(p), d === void 0 && c.set(p, d = l ? /* @__PURE__ */ new Map() : er(t)), c = d;
|
|
1553
|
+
return d;
|
|
1545
1554
|
};
|
|
1546
1555
|
yt();
|
|
1547
1556
|
const Oe = {
|
|
@@ -1577,7 +1586,7 @@ function rr(e, t) {
|
|
|
1577
1586
|
}
|
|
1578
1587
|
if (!o) {
|
|
1579
1588
|
const s = Object.entries(i).map(
|
|
1580
|
-
([p,
|
|
1589
|
+
([p, d]) => `adapter ${p} ` + (d === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1581
1590
|
);
|
|
1582
1591
|
let l = n ? s.length > 1 ? `since :
|
|
1583
1592
|
` + s.map(We).join(`
|
|
@@ -1603,7 +1612,7 @@ const bt = {
|
|
|
1603
1612
|
};
|
|
1604
1613
|
function be(e) {
|
|
1605
1614
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1606
|
-
throw new
|
|
1615
|
+
throw new X(null, e);
|
|
1607
1616
|
}
|
|
1608
1617
|
function Je(e) {
|
|
1609
1618
|
return be(e), e.headers = _.from(e.headers), e.data = ye.call(
|
|
@@ -1672,7 +1681,7 @@ const ae = {
|
|
|
1672
1681
|
assertOptions: or,
|
|
1673
1682
|
validators: pe
|
|
1674
1683
|
}, j = ae.validators;
|
|
1675
|
-
let
|
|
1684
|
+
let H = class {
|
|
1676
1685
|
constructor(t) {
|
|
1677
1686
|
this.defaults = t || {}, this.interceptors = {
|
|
1678
1687
|
request: new Be(),
|
|
@@ -1705,7 +1714,7 @@ let $ = class {
|
|
|
1705
1714
|
}
|
|
1706
1715
|
}
|
|
1707
1716
|
_request(t, n) {
|
|
1708
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1717
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = $(this.defaults, n);
|
|
1709
1718
|
const { transitional: r, paramsSerializer: o, headers: i } = n;
|
|
1710
1719
|
r !== void 0 && ae.assertOptions(r, {
|
|
1711
1720
|
silentJSONParsing: j.transitional(j.boolean),
|
|
@@ -1735,21 +1744,21 @@ let $ = class {
|
|
|
1735
1744
|
this.interceptors.request.forEach(function(m) {
|
|
1736
1745
|
typeof m.runWhen == "function" && m.runWhen(n) === !1 || (p = p && m.synchronous, l.unshift(m.fulfilled, m.rejected));
|
|
1737
1746
|
});
|
|
1738
|
-
const
|
|
1747
|
+
const d = [];
|
|
1739
1748
|
this.interceptors.response.forEach(function(m) {
|
|
1740
|
-
|
|
1749
|
+
d.push(m.fulfilled, m.rejected);
|
|
1741
1750
|
});
|
|
1742
|
-
let c,
|
|
1751
|
+
let c, u = 0, g;
|
|
1743
1752
|
if (!p) {
|
|
1744
1753
|
const f = [Je.bind(this), void 0];
|
|
1745
|
-
for (f.unshift(...l), f.push(...
|
|
1746
|
-
c = c.then(f[
|
|
1754
|
+
for (f.unshift(...l), f.push(...d), g = f.length, c = Promise.resolve(n); u < g; )
|
|
1755
|
+
c = c.then(f[u++], f[u++]);
|
|
1747
1756
|
return c;
|
|
1748
1757
|
}
|
|
1749
1758
|
g = l.length;
|
|
1750
1759
|
let R = n;
|
|
1751
|
-
for (;
|
|
1752
|
-
const f = l[
|
|
1760
|
+
for (; u < g; ) {
|
|
1761
|
+
const f = l[u++], m = l[u++];
|
|
1753
1762
|
try {
|
|
1754
1763
|
R = f(R);
|
|
1755
1764
|
} catch (h) {
|
|
@@ -1762,19 +1771,19 @@ let $ = class {
|
|
|
1762
1771
|
} catch (f) {
|
|
1763
1772
|
return Promise.reject(f);
|
|
1764
1773
|
}
|
|
1765
|
-
for (
|
|
1766
|
-
c = c.then(u
|
|
1774
|
+
for (u = 0, g = d.length; u < g; )
|
|
1775
|
+
c = c.then(d[u++], d[u++]);
|
|
1767
1776
|
return c;
|
|
1768
1777
|
}
|
|
1769
1778
|
getUri(t) {
|
|
1770
|
-
t =
|
|
1779
|
+
t = $(this.defaults, t);
|
|
1771
1780
|
const n = ht(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1772
1781
|
return ct(n, t.params, t.paramsSerializer);
|
|
1773
1782
|
}
|
|
1774
1783
|
};
|
|
1775
1784
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1776
|
-
|
|
1777
|
-
return this.request(
|
|
1785
|
+
H.prototype[t] = function(n, r) {
|
|
1786
|
+
return this.request($(r || {}, {
|
|
1778
1787
|
method: t,
|
|
1779
1788
|
url: n,
|
|
1780
1789
|
data: (r || {}).data
|
|
@@ -1784,7 +1793,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1784
1793
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1785
1794
|
function n(r) {
|
|
1786
1795
|
return function(i, s, l) {
|
|
1787
|
-
return this.request(
|
|
1796
|
+
return this.request($(l || {}, {
|
|
1788
1797
|
method: t,
|
|
1789
1798
|
headers: r ? {
|
|
1790
1799
|
"Content-Type": "multipart/form-data"
|
|
@@ -1794,7 +1803,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1794
1803
|
}));
|
|
1795
1804
|
};
|
|
1796
1805
|
}
|
|
1797
|
-
|
|
1806
|
+
H.prototype[t] = n(), H.prototype[t + "Form"] = n(!0);
|
|
1798
1807
|
});
|
|
1799
1808
|
let sr = class xt {
|
|
1800
1809
|
constructor(t) {
|
|
@@ -1820,7 +1829,7 @@ let sr = class xt {
|
|
|
1820
1829
|
r.unsubscribe(i);
|
|
1821
1830
|
}, s;
|
|
1822
1831
|
}, t(function(i, s, l) {
|
|
1823
|
-
r.reason || (r.reason = new
|
|
1832
|
+
r.reason || (r.reason = new X(i, s, l), n(r.reason));
|
|
1824
1833
|
});
|
|
1825
1834
|
}
|
|
1826
1835
|
/**
|
|
@@ -1952,14 +1961,14 @@ Object.entries(Se).forEach(([e, t]) => {
|
|
|
1952
1961
|
Se[t] = e;
|
|
1953
1962
|
});
|
|
1954
1963
|
function wt(e) {
|
|
1955
|
-
const t = new
|
|
1956
|
-
return a.extend(n,
|
|
1957
|
-
return wt(
|
|
1964
|
+
const t = new H(e), n = Ge(H.prototype.request, t);
|
|
1965
|
+
return a.extend(n, H.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
1966
|
+
return wt($(e, o));
|
|
1958
1967
|
}, n;
|
|
1959
1968
|
}
|
|
1960
1969
|
const A = wt(ne);
|
|
1961
|
-
A.Axios =
|
|
1962
|
-
A.CanceledError =
|
|
1970
|
+
A.Axios = H;
|
|
1971
|
+
A.CanceledError = X;
|
|
1963
1972
|
A.CancelToken = sr;
|
|
1964
1973
|
A.isCancel = ft;
|
|
1965
1974
|
A.VERSION = gt;
|
|
@@ -1971,7 +1980,7 @@ A.all = function(t) {
|
|
|
1971
1980
|
};
|
|
1972
1981
|
A.spread = ir;
|
|
1973
1982
|
A.isAxiosError = ar;
|
|
1974
|
-
A.mergeConfig =
|
|
1983
|
+
A.mergeConfig = $;
|
|
1975
1984
|
A.AxiosHeaders = _;
|
|
1976
1985
|
A.formToJSON = (e) => dt(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1977
1986
|
A.getAdapter = bt.getAdapter;
|
|
@@ -2018,26 +2027,26 @@ const {
|
|
|
2018
2027
|
throw console.error("Error communicating with chat API:", l), l;
|
|
2019
2028
|
}
|
|
2020
2029
|
}, lr = ({ handleMessageFromForm: e, theme: t, chatBotData: n }) => {
|
|
2021
|
-
const [r, o] = L(""), [i, s] = L(""), [l, p] = L(""), [
|
|
2022
|
-
if (
|
|
2030
|
+
const [r, o] = L(""), [i, s] = L(""), [l, p] = L(""), [d, c] = L(""), [u, g] = L(!1), R = async (E) => {
|
|
2031
|
+
if (E.preventDefault(), g(!0), c(""), !r.trim() || !i.trim()) {
|
|
2023
2032
|
c("Name and email are required"), g(!1);
|
|
2024
2033
|
return;
|
|
2025
2034
|
}
|
|
2026
2035
|
try {
|
|
2027
|
-
const
|
|
2036
|
+
const S = await St(
|
|
2028
2037
|
l,
|
|
2029
2038
|
n.sessionId,
|
|
2030
2039
|
n.pineconeNamespace,
|
|
2031
2040
|
n.url,
|
|
2032
2041
|
r,
|
|
2033
2042
|
i
|
|
2034
|
-
)
|
|
2043
|
+
);
|
|
2035
2044
|
e([
|
|
2036
2045
|
{ type: "user", text: l },
|
|
2037
|
-
{ type: "bot", text:
|
|
2046
|
+
{ type: "bot", text: S.response, response_timestamp: S.response_timestamp }
|
|
2038
2047
|
]);
|
|
2039
|
-
} catch (
|
|
2040
|
-
console.log("error sending user details",
|
|
2048
|
+
} catch (S) {
|
|
2049
|
+
console.log("error sending user details", S), c("Failed to submit. Please try again.");
|
|
2041
2050
|
} finally {
|
|
2042
2051
|
g(!1);
|
|
2043
2052
|
}
|
|
@@ -2081,8 +2090,8 @@ const {
|
|
|
2081
2090
|
fontWeight: "600",
|
|
2082
2091
|
fontSize: "15px",
|
|
2083
2092
|
border: "none",
|
|
2084
|
-
cursor: r.trim() && i.trim() && !
|
|
2085
|
-
opacity: r.trim() && i.trim() && !
|
|
2093
|
+
cursor: r.trim() && i.trim() && !u ? "pointer" : "not-allowed",
|
|
2094
|
+
opacity: r.trim() && i.trim() && !u ? 1 : 0.5,
|
|
2086
2095
|
background: `linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,
|
|
2087
2096
|
color: t.fontColor,
|
|
2088
2097
|
display: "flex",
|
|
@@ -2092,7 +2101,7 @@ const {
|
|
|
2092
2101
|
transition: "all 0.2s ease"
|
|
2093
2102
|
};
|
|
2094
2103
|
return /* @__PURE__ */ y("div", { style: f, children: /* @__PURE__ */ O("form", { onSubmit: R, style: m, children: [
|
|
2095
|
-
|
|
2104
|
+
d && /* @__PURE__ */ y("div", { style: {
|
|
2096
2105
|
backgroundColor: "#fee2e2",
|
|
2097
2106
|
color: "#713f12",
|
|
2098
2107
|
padding: "8px 12px",
|
|
@@ -2100,7 +2109,7 @@ const {
|
|
|
2100
2109
|
fontSize: "13px",
|
|
2101
2110
|
textAlign: "center",
|
|
2102
2111
|
fontWeight: "500"
|
|
2103
|
-
}, role: "alert", children:
|
|
2112
|
+
}, role: "alert", children: d }),
|
|
2104
2113
|
/* @__PURE__ */ y("p", { style: h, children: n.welcomeText }),
|
|
2105
2114
|
/* @__PURE__ */ O("div", { style: w, children: [
|
|
2106
2115
|
/* @__PURE__ */ O("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
@@ -2111,8 +2120,8 @@ const {
|
|
|
2111
2120
|
type: "text",
|
|
2112
2121
|
placeholder: "Enter your full name",
|
|
2113
2122
|
value: r,
|
|
2114
|
-
onChange: (
|
|
2115
|
-
o(
|
|
2123
|
+
onChange: (E) => {
|
|
2124
|
+
o(E.target.value), c("");
|
|
2116
2125
|
},
|
|
2117
2126
|
style: x,
|
|
2118
2127
|
required: !0
|
|
@@ -2127,8 +2136,8 @@ const {
|
|
|
2127
2136
|
type: "email",
|
|
2128
2137
|
placeholder: "Enter your email",
|
|
2129
2138
|
value: i,
|
|
2130
|
-
onChange: (
|
|
2131
|
-
s(
|
|
2139
|
+
onChange: (E) => {
|
|
2140
|
+
s(E.target.value), c("");
|
|
2132
2141
|
},
|
|
2133
2142
|
style: x,
|
|
2134
2143
|
required: !0
|
|
@@ -2142,8 +2151,8 @@ const {
|
|
|
2142
2151
|
{
|
|
2143
2152
|
placeholder: "Enter your message",
|
|
2144
2153
|
value: l,
|
|
2145
|
-
onChange: (
|
|
2146
|
-
p(
|
|
2154
|
+
onChange: (E) => {
|
|
2155
|
+
p(E.target.value), c("");
|
|
2147
2156
|
},
|
|
2148
2157
|
style: {
|
|
2149
2158
|
...x,
|
|
@@ -2159,29 +2168,29 @@ const {
|
|
|
2159
2168
|
"button",
|
|
2160
2169
|
{
|
|
2161
2170
|
type: "submit",
|
|
2162
|
-
disabled: !r.trim() || !i.trim() ||
|
|
2171
|
+
disabled: !r.trim() || !i.trim() || u,
|
|
2163
2172
|
style: T,
|
|
2164
|
-
onMouseEnter: (
|
|
2165
|
-
r.trim() && i.trim() && !
|
|
2173
|
+
onMouseEnter: (E) => {
|
|
2174
|
+
r.trim() && i.trim() && !u && (E.currentTarget.style.transform = "translateY(-2px)", E.currentTarget.style.boxShadow = "0 10px 20px rgba(0,0,0,0.15)");
|
|
2166
2175
|
},
|
|
2167
|
-
onMouseLeave: (
|
|
2168
|
-
|
|
2176
|
+
onMouseLeave: (E) => {
|
|
2177
|
+
E.currentTarget.style.transform = "translateY(0)", E.currentTarget.style.boxShadow = "none";
|
|
2169
2178
|
},
|
|
2170
|
-
children:
|
|
2179
|
+
children: u ? "Submitting..." : /* @__PURE__ */ O(Ee, { children: [
|
|
2171
2180
|
/* @__PURE__ */ y(Ye, { size: 18 }),
|
|
2172
2181
|
"Submit"
|
|
2173
2182
|
] })
|
|
2174
2183
|
}
|
|
2175
2184
|
)
|
|
2176
2185
|
] }) });
|
|
2177
|
-
}, cr = ({
|
|
2178
|
-
const [r, o] = L([]), [i, s] = L(!1), [l, p] = L(!1), [
|
|
2186
|
+
}, cr = ({ onClose: e, theme: t, chatBotData: n }) => {
|
|
2187
|
+
const [r, o] = L([]), [i, s] = L(!1), [l, p] = L(!1), [d, c] = L(!1), g = {
|
|
2179
2188
|
position: "fixed",
|
|
2180
2189
|
bottom: "112px",
|
|
2181
2190
|
[n.position === "left" ? "left" : "right"]: "32px",
|
|
2182
2191
|
zIndex: 50,
|
|
2183
|
-
width:
|
|
2184
|
-
height:
|
|
2192
|
+
width: d ? "684px" : "384px",
|
|
2193
|
+
height: d ? "620px" : "520px",
|
|
2185
2194
|
background: `${t.backgroundColor}cc`,
|
|
2186
2195
|
backdropFilter: "blur(16px)",
|
|
2187
2196
|
WebkitBackdropFilter: "blur(16px)",
|
|
@@ -2246,13 +2255,13 @@ const {
|
|
|
2246
2255
|
fontSize: "11px",
|
|
2247
2256
|
color: t.fontColor,
|
|
2248
2257
|
letterSpacing: "0.5px"
|
|
2249
|
-
},
|
|
2258
|
+
}, E = {
|
|
2250
2259
|
fontWeight: "600"
|
|
2251
|
-
},
|
|
2260
|
+
}, S = (k, U) => {
|
|
2252
2261
|
k.currentTarget.style.background = U ? "rgba(255,255,255,0.2)" : "transparent";
|
|
2253
|
-
},
|
|
2262
|
+
}, Y = (k) => {
|
|
2254
2263
|
o(k), p(!0);
|
|
2255
|
-
},
|
|
2264
|
+
}, W = async (k) => {
|
|
2256
2265
|
s(!0), o((U) => [...U, { type: "user", text: k }]);
|
|
2257
2266
|
try {
|
|
2258
2267
|
const U = await St(
|
|
@@ -2290,19 +2299,19 @@ const {
|
|
|
2290
2299
|
onClick: () => c((k) => !k),
|
|
2291
2300
|
"aria-label": "expand chat",
|
|
2292
2301
|
style: x,
|
|
2293
|
-
onMouseEnter: (k) =>
|
|
2294
|
-
onMouseLeave: (k) =>
|
|
2295
|
-
children:
|
|
2302
|
+
onMouseEnter: (k) => S(k, !0),
|
|
2303
|
+
onMouseLeave: (k) => S(k, !1),
|
|
2304
|
+
children: d ? /* @__PURE__ */ y(Tt, { size: 20 }) : /* @__PURE__ */ y(Ot, { size: 20 })
|
|
2296
2305
|
}
|
|
2297
2306
|
),
|
|
2298
2307
|
/* @__PURE__ */ y(
|
|
2299
2308
|
"button",
|
|
2300
2309
|
{
|
|
2301
2310
|
onClick: e,
|
|
2302
|
-
"aria-label": "
|
|
2311
|
+
"aria-label": "close chat",
|
|
2303
2312
|
style: x,
|
|
2304
|
-
onMouseEnter: (k) =>
|
|
2305
|
-
onMouseLeave: (k) =>
|
|
2313
|
+
onMouseEnter: (k) => S(k, !0),
|
|
2314
|
+
onMouseLeave: (k) => S(k, !1),
|
|
2306
2315
|
children: /* @__PURE__ */ y(At, { size: 20 })
|
|
2307
2316
|
}
|
|
2308
2317
|
)
|
|
@@ -2310,11 +2319,11 @@ const {
|
|
|
2310
2319
|
] }),
|
|
2311
2320
|
l ? /* @__PURE__ */ O(Ee, { children: [
|
|
2312
2321
|
/* @__PURE__ */ y(Pt, { messages: r, isLoading: i, theme: t }),
|
|
2313
|
-
/* @__PURE__ */ y(Nt, { onSendMessage:
|
|
2322
|
+
/* @__PURE__ */ y(Nt, { onSendMessage: W, isLoading: i, theme: t, messages: r })
|
|
2314
2323
|
] }) : /* @__PURE__ */ y(
|
|
2315
2324
|
lr,
|
|
2316
2325
|
{
|
|
2317
|
-
handleMessageFromForm:
|
|
2326
|
+
handleMessageFromForm: Y,
|
|
2318
2327
|
theme: t,
|
|
2319
2328
|
chatBotData: n
|
|
2320
2329
|
}
|
|
@@ -2322,7 +2331,7 @@ const {
|
|
|
2322
2331
|
/* @__PURE__ */ y("div", { style: T, children: /* @__PURE__ */ O("p", { style: F, children: [
|
|
2323
2332
|
"powered by",
|
|
2324
2333
|
" ",
|
|
2325
|
-
/* @__PURE__ */ y("span", { style:
|
|
2334
|
+
/* @__PURE__ */ y("span", { style: E, children: "clone67.com" })
|
|
2326
2335
|
] }) })
|
|
2327
2336
|
] });
|
|
2328
2337
|
}, _r = ({
|
|
@@ -2335,14 +2344,14 @@ const {
|
|
|
2335
2344
|
placeholderColor: s = "#9ca3af",
|
|
2336
2345
|
position: l = "right",
|
|
2337
2346
|
name: p = "Assistant",
|
|
2338
|
-
subTitle:
|
|
2347
|
+
subTitle: d = "Typically replies instantly",
|
|
2339
2348
|
welcomeText: c = "Hi! How can I help you today?"
|
|
2340
2349
|
}) => {
|
|
2341
|
-
const [
|
|
2350
|
+
const [u, g] = L(!1), [R, f] = L("");
|
|
2342
2351
|
Ke(() => {
|
|
2343
2352
|
f(kt());
|
|
2344
2353
|
}, []);
|
|
2345
|
-
const m = () => g((
|
|
2354
|
+
const m = () => g((S) => !S), h = () => g((S) => !S), w = {
|
|
2346
2355
|
primaryColor: n,
|
|
2347
2356
|
secondaryColor: r,
|
|
2348
2357
|
backgroundColor: o,
|
|
@@ -2352,7 +2361,7 @@ const {
|
|
|
2352
2361
|
// fallback if not provided
|
|
2353
2362
|
}, C = {
|
|
2354
2363
|
name: p,
|
|
2355
|
-
subTitle:
|
|
2364
|
+
subTitle: d,
|
|
2356
2365
|
welcomeText: c,
|
|
2357
2366
|
url: t,
|
|
2358
2367
|
pineconeNamespace: e,
|
|
@@ -2365,7 +2374,7 @@ const {
|
|
|
2365
2374
|
[x ? "left" : "right"]: T,
|
|
2366
2375
|
zIndex: 9999,
|
|
2367
2376
|
pointerEvents: "auto"
|
|
2368
|
-
},
|
|
2377
|
+
}, E = {
|
|
2369
2378
|
position: "fixed",
|
|
2370
2379
|
bottom: "32px",
|
|
2371
2380
|
[x ? "left" : "right"]: T,
|
|
@@ -2373,19 +2382,19 @@ const {
|
|
|
2373
2382
|
pointerEvents: "auto"
|
|
2374
2383
|
};
|
|
2375
2384
|
return /* @__PURE__ */ O(Ee, { children: [
|
|
2376
|
-
|
|
2385
|
+
u && /* @__PURE__ */ y("div", { style: F, children: /* @__PURE__ */ y(
|
|
2377
2386
|
cr,
|
|
2378
2387
|
{
|
|
2379
|
-
|
|
2388
|
+
onClose: m,
|
|
2380
2389
|
theme: w,
|
|
2381
2390
|
chatBotData: C
|
|
2382
2391
|
}
|
|
2383
2392
|
) }),
|
|
2384
|
-
/* @__PURE__ */ y("div", { style:
|
|
2393
|
+
/* @__PURE__ */ y("div", { style: E, children: /* @__PURE__ */ y(
|
|
2385
2394
|
Ft,
|
|
2386
2395
|
{
|
|
2387
|
-
|
|
2388
|
-
isOpen:
|
|
2396
|
+
onMinimise: h,
|
|
2397
|
+
isOpen: u,
|
|
2389
2398
|
theme: w,
|
|
2390
2399
|
chatBotData: C
|
|
2391
2400
|
}
|