react-aichatbot-widget 1.5.4 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +339 -339
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as F, jsx as y, Fragment as Z } from "react/jsx-runtime";
|
|
2
2
|
import { useState as I, useRef as Et, useEffect as Ke } from "react";
|
|
3
3
|
import { Minus as Ct, MessageCircle as Xe, Send as Ge, Bot as Ne, Minimize2 as Rt, Maximize2 as Tt, X as Ot } from "lucide-react";
|
|
4
4
|
const At = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
@@ -22,7 +22,7 @@ const At = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
22
22
|
transition: "all 300ms ease",
|
|
23
23
|
outline: "none"
|
|
24
24
|
};
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ F(
|
|
26
26
|
"button",
|
|
27
27
|
{
|
|
28
28
|
onClick: e,
|
|
@@ -88,7 +88,7 @@ const At = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
88
88
|
transition: "all 0.2s ease",
|
|
89
89
|
minWidth: "48px"
|
|
90
90
|
};
|
|
91
|
-
return /* @__PURE__ */ y("div", { style: l, children: /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ y("div", { style: l, children: /* @__PURE__ */ F("div", { style: p, children: [
|
|
92
92
|
/* @__PURE__ */ y(
|
|
93
93
|
"input",
|
|
94
94
|
{
|
|
@@ -174,9 +174,9 @@ const At = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
174
174
|
animation: "fadeIn 0.3s ease-in-out, pulse 1.5s ease-in-out infinite",
|
|
175
175
|
animationDelay: "0s, 0.3s"
|
|
176
176
|
};
|
|
177
|
-
return /* @__PURE__ */
|
|
178
|
-
e.map((d, b) => /* @__PURE__ */ y("div", { style: l(d.sender_type), children: /* @__PURE__ */
|
|
179
|
-
d.sender_type === "bot" && d.created_at && /* @__PURE__ */
|
|
177
|
+
return /* @__PURE__ */ F("div", { style: s, children: [
|
|
178
|
+
e.map((d, b) => /* @__PURE__ */ y("div", { style: l(d.sender_type), children: /* @__PURE__ */ F("div", { style: p, children: [
|
|
179
|
+
d.sender_type === "bot" && d.created_at && /* @__PURE__ */ F("div", { style: { display: "flex", alignItems: "center", gap: "4px", justifyContent: "flex-start", marginLeft: "4px", marginBottom: "2px" }, children: [
|
|
180
180
|
/* @__PURE__ */ y(Ne, { size: 14, color: n.fontColor }),
|
|
181
181
|
/* @__PURE__ */ y(
|
|
182
182
|
"span",
|
|
@@ -203,7 +203,7 @@ const At = ({ onMinimise: e, isOpen: t, theme: n, chatBotData: r }) => {
|
|
|
203
203
|
) }),
|
|
204
204
|
/* @__PURE__ */ y("div", { style: u(d.sender_type), children: d.message })
|
|
205
205
|
] }) }, b)),
|
|
206
|
-
t && /* @__PURE__ */ y("div", { style: l("bot"), children: /* @__PURE__ */
|
|
206
|
+
t && /* @__PURE__ */ y("div", { style: l("bot"), children: /* @__PURE__ */ F("div", { style: {
|
|
207
207
|
...c,
|
|
208
208
|
display: "flex",
|
|
209
209
|
alignItems: "center",
|
|
@@ -220,11 +220,11 @@ function Ye(e, t) {
|
|
|
220
220
|
return e.apply(t, arguments);
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
-
const { toString: Pt } = Object.prototype, { getPrototypeOf:
|
|
223
|
+
const { toString: Pt } = Object.prototype, { getPrototypeOf: Te } = Object, { iterator: fe, toStringTag: Qe } = Symbol, pe = /* @__PURE__ */ ((e) => (t) => {
|
|
224
224
|
const n = Pt.call(t);
|
|
225
225
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
226
|
-
})(/* @__PURE__ */ Object.create(null)), L = (e) => (e = e.toLowerCase(), (t) =>
|
|
227
|
-
function
|
|
226
|
+
})(/* @__PURE__ */ Object.create(null)), L = (e) => (e = e.toLowerCase(), (t) => pe(t) === e), he = (e) => (t) => typeof t === e, { isArray: X } = Array, K = he("undefined");
|
|
227
|
+
function ee(e) {
|
|
228
228
|
return e !== null && !K(e) && e.constructor !== null && !K(e.constructor) && _(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
229
229
|
}
|
|
230
230
|
const Ze = L("ArrayBuffer");
|
|
@@ -232,25 +232,25 @@ function Nt(e) {
|
|
|
232
232
|
let t;
|
|
233
233
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && Ze(e.buffer), t;
|
|
234
234
|
}
|
|
235
|
-
const _t =
|
|
236
|
-
if (
|
|
235
|
+
const _t = he("string"), _ = he("function"), et = he("number"), te = (e) => e !== null && typeof e == "object", Ut = (e) => e === !0 || e === !1, le = (e) => {
|
|
236
|
+
if (pe(e) !== "object")
|
|
237
237
|
return !1;
|
|
238
|
-
const t =
|
|
239
|
-
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Qe in e) && !(
|
|
238
|
+
const t = Te(e);
|
|
239
|
+
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Qe in e) && !(fe in e);
|
|
240
240
|
}, It = (e) => {
|
|
241
|
-
if (!
|
|
241
|
+
if (!te(e) || ee(e))
|
|
242
242
|
return !1;
|
|
243
243
|
try {
|
|
244
244
|
return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
|
|
245
245
|
} catch {
|
|
246
246
|
return !1;
|
|
247
247
|
}
|
|
248
|
-
}, Lt = L("Date"), Dt = L("File"), Bt = L("Blob"), jt = L("FileList"), vt = (e) =>
|
|
248
|
+
}, Lt = L("Date"), Dt = L("File"), Bt = L("Blob"), jt = L("FileList"), vt = (e) => te(e) && _(e.pipe), zt = (e) => {
|
|
249
249
|
let t;
|
|
250
|
-
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t =
|
|
250
|
+
return e && (typeof FormData == "function" && e instanceof FormData || _(e.append) && ((t = pe(e)) === "formdata" || // detect form-data instance
|
|
251
251
|
t === "object" && _(e.toString) && e.toString() === "[object FormData]"));
|
|
252
252
|
}, Ht = L("URLSearchParams"), [Mt, qt, $t, Wt] = ["ReadableStream", "Request", "Response", "Headers"].map(L), Jt = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
253
|
-
function
|
|
253
|
+
function ne(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
254
254
|
if (e === null || typeof e > "u")
|
|
255
255
|
return;
|
|
256
256
|
let r, o;
|
|
@@ -258,7 +258,7 @@ function te(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
258
258
|
for (r = 0, o = e.length; r < o; r++)
|
|
259
259
|
t.call(null, e[r], r, e);
|
|
260
260
|
else {
|
|
261
|
-
if (
|
|
261
|
+
if (ee(e))
|
|
262
262
|
return;
|
|
263
263
|
const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), s = i.length;
|
|
264
264
|
let l;
|
|
@@ -267,7 +267,7 @@ function te(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
function tt(e, t) {
|
|
270
|
-
if (
|
|
270
|
+
if (ee(e))
|
|
271
271
|
return null;
|
|
272
272
|
t = t.toLowerCase();
|
|
273
273
|
const n = Object.keys(e);
|
|
@@ -277,17 +277,17 @@ function tt(e, t) {
|
|
|
277
277
|
return o;
|
|
278
278
|
return null;
|
|
279
279
|
}
|
|
280
|
-
const
|
|
281
|
-
function
|
|
280
|
+
const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, nt = (e) => !K(e) && e !== M;
|
|
281
|
+
function Se() {
|
|
282
282
|
const { caseless: e, skipUndefined: t } = nt(this) && this || {}, n = {}, r = (o, i) => {
|
|
283
283
|
const s = e && tt(n, i) || i;
|
|
284
|
-
|
|
284
|
+
le(n[s]) && le(o) ? n[s] = Se(n[s], o) : le(o) ? n[s] = Se({}, o) : X(o) ? n[s] = o.slice() : (!t || !K(o)) && (n[s] = o);
|
|
285
285
|
};
|
|
286
286
|
for (let o = 0, i = arguments.length; o < i; o++)
|
|
287
|
-
arguments[o] &&
|
|
287
|
+
arguments[o] && ne(arguments[o], r);
|
|
288
288
|
return n;
|
|
289
289
|
}
|
|
290
|
-
const Vt = (e, t, n, { allOwnKeys: r } = {}) => (
|
|
290
|
+
const Vt = (e, t, n, { allOwnKeys: r } = {}) => (ne(t, (o, i) => {
|
|
291
291
|
n && _(o) ? e[i] = Ye(o, n) : e[i] = o;
|
|
292
292
|
}, { allOwnKeys: r }), e), Kt = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Xt = (e, t, n, r) => {
|
|
293
293
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
@@ -300,7 +300,7 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
|
|
|
300
300
|
do {
|
|
301
301
|
for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
|
|
302
302
|
s = o[i], (!r || r(s, e, t)) && !l[s] && (t[s] = e[s], l[s] = !0);
|
|
303
|
-
e = n !== !1 &&
|
|
303
|
+
e = n !== !1 && Te(e);
|
|
304
304
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
305
305
|
return t;
|
|
306
306
|
}, Yt = (e, t, n) => {
|
|
@@ -316,8 +316,8 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
|
|
|
316
316
|
for (; t-- > 0; )
|
|
317
317
|
n[t] = e[t];
|
|
318
318
|
return n;
|
|
319
|
-
}, Zt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" &&
|
|
320
|
-
const r = (e && e[
|
|
319
|
+
}, Zt = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && Te(Uint8Array)), en = (e, t) => {
|
|
320
|
+
const r = (e && e[fe]).call(e);
|
|
321
321
|
let o;
|
|
322
322
|
for (; (o = r.next()) && !o.done; ) {
|
|
323
323
|
const i = o.value;
|
|
@@ -336,7 +336,7 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
|
|
|
336
336
|
}
|
|
337
337
|
), _e = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), on = L("RegExp"), rt = (e, t) => {
|
|
338
338
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
339
|
-
|
|
339
|
+
ne(n, (o, i) => {
|
|
340
340
|
let s;
|
|
341
341
|
(s = t(o, i, e)) !== !1 && (r[i] = s || o);
|
|
342
342
|
}), Object.defineProperties(e, r);
|
|
@@ -365,19 +365,19 @@ const Vt = (e, t, n, { allOwnKeys: r } = {}) => (te(t, (o, i) => {
|
|
|
365
365
|
}, ln = () => {
|
|
366
366
|
}, cn = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
|
|
367
367
|
function un(e) {
|
|
368
|
-
return !!(e && _(e.append) && e[Qe] === "FormData" && e[
|
|
368
|
+
return !!(e && _(e.append) && e[Qe] === "FormData" && e[fe]);
|
|
369
369
|
}
|
|
370
370
|
const dn = (e) => {
|
|
371
371
|
const t = new Array(10), n = (r, o) => {
|
|
372
|
-
if (
|
|
372
|
+
if (te(r)) {
|
|
373
373
|
if (t.indexOf(r) >= 0)
|
|
374
374
|
return;
|
|
375
|
-
if (
|
|
375
|
+
if (ee(r))
|
|
376
376
|
return r;
|
|
377
377
|
if (!("toJSON" in r)) {
|
|
378
378
|
t[o] = r;
|
|
379
379
|
const i = X(r) ? [] : {};
|
|
380
|
-
return
|
|
380
|
+
return ne(r, (s, l) => {
|
|
381
381
|
const p = n(s, o + 1);
|
|
382
382
|
!K(p) && (i[l] = p);
|
|
383
383
|
}), t[o] = void 0, i;
|
|
@@ -386,24 +386,24 @@ const dn = (e) => {
|
|
|
386
386
|
return r;
|
|
387
387
|
};
|
|
388
388
|
return n(e, 0);
|
|
389
|
-
}, fn = L("AsyncFunction"), pn = (e) => e && (
|
|
390
|
-
o ===
|
|
389
|
+
}, fn = L("AsyncFunction"), pn = (e) => e && (te(e) || _(e)) && _(e.then) && _(e.catch), ot = ((e, t) => e ? setImmediate : t ? ((n, r) => (M.addEventListener("message", ({ source: o, data: i }) => {
|
|
390
|
+
o === M && i === n && r.length && r.shift()();
|
|
391
391
|
}, !1), (o) => {
|
|
392
|
-
r.push(o),
|
|
392
|
+
r.push(o), M.postMessage(n, "*");
|
|
393
393
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
394
394
|
typeof setImmediate == "function",
|
|
395
|
-
_(
|
|
396
|
-
), hn = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
395
|
+
_(M.postMessage)
|
|
396
|
+
), hn = typeof queueMicrotask < "u" ? queueMicrotask.bind(M) : typeof process < "u" && process.nextTick || ot, mn = (e) => e != null && _(e[fe]), a = {
|
|
397
397
|
isArray: X,
|
|
398
398
|
isArrayBuffer: Ze,
|
|
399
|
-
isBuffer:
|
|
399
|
+
isBuffer: ee,
|
|
400
400
|
isFormData: zt,
|
|
401
401
|
isArrayBufferView: Nt,
|
|
402
402
|
isString: _t,
|
|
403
403
|
isNumber: et,
|
|
404
404
|
isBoolean: Ut,
|
|
405
|
-
isObject:
|
|
406
|
-
isPlainObject:
|
|
405
|
+
isObject: te,
|
|
406
|
+
isPlainObject: le,
|
|
407
407
|
isEmptyObject: It,
|
|
408
408
|
isReadableStream: Mt,
|
|
409
409
|
isRequest: qt,
|
|
@@ -419,14 +419,14 @@ const dn = (e) => {
|
|
|
419
419
|
isURLSearchParams: Ht,
|
|
420
420
|
isTypedArray: Zt,
|
|
421
421
|
isFileList: jt,
|
|
422
|
-
forEach:
|
|
423
|
-
merge:
|
|
422
|
+
forEach: ne,
|
|
423
|
+
merge: Se,
|
|
424
424
|
extend: Vt,
|
|
425
425
|
trim: Jt,
|
|
426
426
|
stripBOM: Kt,
|
|
427
427
|
inherits: Xt,
|
|
428
428
|
toFlatObject: Gt,
|
|
429
|
-
kindOf:
|
|
429
|
+
kindOf: pe,
|
|
430
430
|
kindOfTest: L,
|
|
431
431
|
endsWith: Yt,
|
|
432
432
|
toArray: Qt,
|
|
@@ -443,7 +443,7 @@ const dn = (e) => {
|
|
|
443
443
|
noop: ln,
|
|
444
444
|
toFiniteNumber: cn,
|
|
445
445
|
findKey: tt,
|
|
446
|
-
global:
|
|
446
|
+
global: M,
|
|
447
447
|
isContextDefined: nt,
|
|
448
448
|
isSpecCompliantForm: un,
|
|
449
449
|
toJSONObject: dn,
|
|
@@ -506,7 +506,7 @@ g.from = (e, t, n, r, o, i) => {
|
|
|
506
506
|
return g.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;
|
|
507
507
|
};
|
|
508
508
|
const yn = null;
|
|
509
|
-
function
|
|
509
|
+
function Ee(e) {
|
|
510
510
|
return a.isPlainObject(e) || a.isArray(e);
|
|
511
511
|
}
|
|
512
512
|
function at(e) {
|
|
@@ -518,12 +518,12 @@ function Ue(e, t, n) {
|
|
|
518
518
|
}).join(n ? "." : "") : t;
|
|
519
519
|
}
|
|
520
520
|
function gn(e) {
|
|
521
|
-
return a.isArray(e) && !e.some(
|
|
521
|
+
return a.isArray(e) && !e.some(Ee);
|
|
522
522
|
}
|
|
523
523
|
const bn = a.toFlatObject(a, {}, null, function(t) {
|
|
524
524
|
return /^is[A-Z]/.test(t);
|
|
525
525
|
});
|
|
526
|
-
function
|
|
526
|
+
function me(e, t, n) {
|
|
527
527
|
if (!a.isObject(e))
|
|
528
528
|
throw new TypeError("target must be an object");
|
|
529
529
|
t = t || new FormData(), n = a.toFlatObject(n, {
|
|
@@ -547,38 +547,38 @@ function he(e, t, n) {
|
|
|
547
547
|
return a.isArrayBuffer(f) || a.isTypedArray(f) ? p && typeof Blob == "function" ? new Blob([f]) : Buffer.from(f) : f;
|
|
548
548
|
}
|
|
549
549
|
function c(f, m, h) {
|
|
550
|
-
let
|
|
550
|
+
let w = f;
|
|
551
551
|
if (f && !h && typeof f == "object") {
|
|
552
552
|
if (a.endsWith(m, "{}"))
|
|
553
553
|
m = r ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
554
|
-
else if (a.isArray(f) && gn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (
|
|
555
|
-
return m = at(m),
|
|
556
|
-
!(a.isUndefined(
|
|
554
|
+
else if (a.isArray(f) && gn(f) || (a.isFileList(f) || a.endsWith(m, "[]")) && (w = a.toArray(f)))
|
|
555
|
+
return m = at(m), w.forEach(function(x, k) {
|
|
556
|
+
!(a.isUndefined(x) || x === null) && t.append(
|
|
557
557
|
// eslint-disable-next-line no-nested-ternary
|
|
558
|
-
s === !0 ? Ue([m],
|
|
559
|
-
u(
|
|
558
|
+
s === !0 ? Ue([m], k, i) : s === null ? m : m + "[]",
|
|
559
|
+
u(x)
|
|
560
560
|
);
|
|
561
561
|
}), !1;
|
|
562
562
|
}
|
|
563
|
-
return
|
|
563
|
+
return Ee(f) ? !0 : (t.append(Ue(h, m, i), u(f)), !1);
|
|
564
564
|
}
|
|
565
565
|
const d = [], b = Object.assign(bn, {
|
|
566
566
|
defaultVisitor: c,
|
|
567
567
|
convertValue: u,
|
|
568
|
-
isVisitable:
|
|
568
|
+
isVisitable: Ee
|
|
569
569
|
});
|
|
570
570
|
function C(f, m) {
|
|
571
571
|
if (!a.isUndefined(f)) {
|
|
572
572
|
if (d.indexOf(f) !== -1)
|
|
573
573
|
throw Error("Circular reference detected in " + m.join("."));
|
|
574
|
-
d.push(f), a.forEach(f, function(
|
|
575
|
-
(!(a.isUndefined(
|
|
574
|
+
d.push(f), a.forEach(f, function(w, A) {
|
|
575
|
+
(!(a.isUndefined(w) || w === null) && o.call(
|
|
576
576
|
t,
|
|
577
|
-
|
|
578
|
-
a.isString(
|
|
577
|
+
w,
|
|
578
|
+
a.isString(A) ? A.trim() : A,
|
|
579
579
|
m,
|
|
580
580
|
b
|
|
581
|
-
)) === !0 && C(
|
|
581
|
+
)) === !0 && C(w, m ? m.concat(A) : [A]);
|
|
582
582
|
}), d.pop();
|
|
583
583
|
}
|
|
584
584
|
}
|
|
@@ -600,10 +600,10 @@ function Ie(e) {
|
|
|
600
600
|
return t[r];
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
|
-
function
|
|
604
|
-
this._pairs = [], e &&
|
|
603
|
+
function Oe(e, t) {
|
|
604
|
+
this._pairs = [], e && me(e, this, t);
|
|
605
605
|
}
|
|
606
|
-
const lt =
|
|
606
|
+
const lt = Oe.prototype;
|
|
607
607
|
lt.append = function(t, n) {
|
|
608
608
|
this._pairs.push([t, n]);
|
|
609
609
|
};
|
|
@@ -627,7 +627,7 @@ function ct(e, t, n) {
|
|
|
627
627
|
});
|
|
628
628
|
const o = n && n.serialize;
|
|
629
629
|
let i;
|
|
630
|
-
if (o ? i = o(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new
|
|
630
|
+
if (o ? i = o(t, n) : i = a.isURLSearchParams(t) ? t.toString() : new Oe(t, n).toString(r), i) {
|
|
631
631
|
const s = e.indexOf("#");
|
|
632
632
|
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
633
633
|
}
|
|
@@ -691,7 +691,7 @@ const ut = {
|
|
|
691
691
|
silentJSONParsing: !0,
|
|
692
692
|
forcedJSONParsing: !0,
|
|
693
693
|
clarifyTimeoutError: !1
|
|
694
|
-
}, wn = typeof URLSearchParams < "u" ? URLSearchParams :
|
|
694
|
+
}, wn = typeof URLSearchParams < "u" ? URLSearchParams : Oe, Sn = typeof FormData < "u" ? FormData : null, En = typeof Blob < "u" ? Blob : null, Cn = {
|
|
695
695
|
isBrowser: !0,
|
|
696
696
|
classes: {
|
|
697
697
|
URLSearchParams: wn,
|
|
@@ -699,20 +699,20 @@ const ut = {
|
|
|
699
699
|
Blob: En
|
|
700
700
|
},
|
|
701
701
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
702
|
-
},
|
|
703
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", On =
|
|
702
|
+
}, Ae = typeof window < "u" && typeof document < "u", Ce = typeof navigator == "object" && navigator || void 0, Rn = Ae && (!Ce || ["ReactNative", "NativeScript", "NS"].indexOf(Ce.product) < 0), Tn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
703
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", On = Ae && window.location.href || "http://localhost", An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
704
704
|
__proto__: null,
|
|
705
|
-
hasBrowserEnv:
|
|
705
|
+
hasBrowserEnv: Ae,
|
|
706
706
|
hasStandardBrowserEnv: Rn,
|
|
707
707
|
hasStandardBrowserWebWorkerEnv: Tn,
|
|
708
|
-
navigator:
|
|
708
|
+
navigator: Ce,
|
|
709
709
|
origin: On
|
|
710
710
|
}, Symbol.toStringTag, { value: "Module" })), N = {
|
|
711
711
|
...An,
|
|
712
712
|
...Cn
|
|
713
713
|
};
|
|
714
714
|
function kn(e, t) {
|
|
715
|
-
return
|
|
715
|
+
return me(e, new N.classes.URLSearchParams(), {
|
|
716
716
|
visitor: function(n, r, o, i) {
|
|
717
717
|
return N.isNode && a.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
718
718
|
},
|
|
@@ -756,7 +756,7 @@ function Nn(e, t, n) {
|
|
|
756
756
|
}
|
|
757
757
|
return (n || JSON.stringify)(e);
|
|
758
758
|
}
|
|
759
|
-
const
|
|
759
|
+
const re = {
|
|
760
760
|
transitional: ut,
|
|
761
761
|
adapter: ["xhr", "http", "fetch"],
|
|
762
762
|
transformRequest: [function(t, n) {
|
|
@@ -775,7 +775,7 @@ const ne = {
|
|
|
775
775
|
return kn(t, this.formSerializer).toString();
|
|
776
776
|
if ((l = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
777
777
|
const p = this.env && this.env.FormData;
|
|
778
|
-
return
|
|
778
|
+
return me(
|
|
779
779
|
l ? { "files[]": t } : t,
|
|
780
780
|
p && new p(),
|
|
781
781
|
this.formSerializer
|
|
@@ -785,7 +785,7 @@ const ne = {
|
|
|
785
785
|
return i || o ? (n.setContentType("application/json", !1), Nn(t)) : t;
|
|
786
786
|
}],
|
|
787
787
|
transformResponse: [function(t) {
|
|
788
|
-
const n = this.transitional ||
|
|
788
|
+
const n = this.transitional || re.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
|
|
789
789
|
if (a.isResponse(t) || a.isReadableStream(t))
|
|
790
790
|
return t;
|
|
791
791
|
if (t && a.isString(t) && (r && !this.responseType || o)) {
|
|
@@ -823,7 +823,7 @@ const ne = {
|
|
|
823
823
|
}
|
|
824
824
|
};
|
|
825
825
|
a.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
826
|
-
|
|
826
|
+
re.headers[e] = {};
|
|
827
827
|
});
|
|
828
828
|
const _n = a.toObjectSet([
|
|
829
829
|
"age",
|
|
@@ -850,12 +850,12 @@ const _n = a.toObjectSet([
|
|
|
850
850
|
`).forEach(function(s) {
|
|
851
851
|
o = s.indexOf(":"), n = s.substring(0, o).trim().toLowerCase(), r = s.substring(o + 1).trim(), !(!n || t[n] && _n[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
852
852
|
}), t;
|
|
853
|
-
}, De = Symbol("internals");
|
|
853
|
+
}, De = /* @__PURE__ */ Symbol("internals");
|
|
854
854
|
function Q(e) {
|
|
855
855
|
return e && String(e).trim().toLowerCase();
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return e === !1 || e == null ? e : a.isArray(e) ? e.map(
|
|
857
|
+
function ce(e) {
|
|
858
|
+
return e === !1 || e == null ? e : a.isArray(e) ? e.map(ce) : String(e);
|
|
859
859
|
}
|
|
860
860
|
function In(e) {
|
|
861
861
|
const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -865,7 +865,7 @@ function In(e) {
|
|
|
865
865
|
return t;
|
|
866
866
|
}
|
|
867
867
|
const Ln = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
|
|
868
|
-
function
|
|
868
|
+
function be(e, t, n, r, o) {
|
|
869
869
|
if (a.isFunction(r))
|
|
870
870
|
return r.call(this, t, n);
|
|
871
871
|
if (o && (t = n), !!a.isString(t)) {
|
|
@@ -900,7 +900,7 @@ let U = class {
|
|
|
900
900
|
if (!c)
|
|
901
901
|
throw new Error("header name must be a non-empty string");
|
|
902
902
|
const d = a.findKey(o, c);
|
|
903
|
-
(!d || o[d] === void 0 || u === !0 || u === void 0 && o[d] !== !1) && (o[d || p] =
|
|
903
|
+
(!d || o[d] === void 0 || u === !0 || u === void 0 && o[d] !== !1) && (o[d || p] = ce(l));
|
|
904
904
|
}
|
|
905
905
|
const s = (l, p) => a.forEach(l, (u, c) => i(u, c, p));
|
|
906
906
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
@@ -939,7 +939,7 @@ let U = class {
|
|
|
939
939
|
has(t, n) {
|
|
940
940
|
if (t = Q(t), t) {
|
|
941
941
|
const r = a.findKey(this, t);
|
|
942
|
-
return !!(r && this[r] !== void 0 && (!n ||
|
|
942
|
+
return !!(r && this[r] !== void 0 && (!n || be(this, this[r], r, n)));
|
|
943
943
|
}
|
|
944
944
|
return !1;
|
|
945
945
|
}
|
|
@@ -949,7 +949,7 @@ let U = class {
|
|
|
949
949
|
function i(s) {
|
|
950
950
|
if (s = Q(s), s) {
|
|
951
951
|
const l = a.findKey(r, s);
|
|
952
|
-
l && (!n ||
|
|
952
|
+
l && (!n || be(r, r[l], l, n)) && (delete r[l], o = !0);
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
return a.isArray(t) ? t.forEach(i) : i(t), o;
|
|
@@ -959,7 +959,7 @@ let U = class {
|
|
|
959
959
|
let r = n.length, o = !1;
|
|
960
960
|
for (; r--; ) {
|
|
961
961
|
const i = n[r];
|
|
962
|
-
(!t ||
|
|
962
|
+
(!t || be(this, this[i], i, t, !0)) && (delete this[i], o = !0);
|
|
963
963
|
}
|
|
964
964
|
return o;
|
|
965
965
|
}
|
|
@@ -968,11 +968,11 @@ let U = class {
|
|
|
968
968
|
return a.forEach(this, (o, i) => {
|
|
969
969
|
const s = a.findKey(r, i);
|
|
970
970
|
if (s) {
|
|
971
|
-
n[s] =
|
|
971
|
+
n[s] = ce(o), delete n[i];
|
|
972
972
|
return;
|
|
973
973
|
}
|
|
974
974
|
const l = t ? Dn(i) : String(i).trim();
|
|
975
|
-
l !== i && delete n[i], n[l] =
|
|
975
|
+
l !== i && delete n[i], n[l] = ce(o), r[l] = !0;
|
|
976
976
|
}), this;
|
|
977
977
|
}
|
|
978
978
|
concat(...t) {
|
|
@@ -1026,8 +1026,8 @@ a.reduceDescriptors(U.prototype, ({ value: e }, t) => {
|
|
|
1026
1026
|
};
|
|
1027
1027
|
});
|
|
1028
1028
|
a.freezeMethods(U);
|
|
1029
|
-
function
|
|
1030
|
-
const n = this ||
|
|
1029
|
+
function xe(e, t) {
|
|
1030
|
+
const n = this || re, r = t || n, o = U.from(r.headers);
|
|
1031
1031
|
let i = r.data;
|
|
1032
1032
|
return a.forEach(e, function(l) {
|
|
1033
1033
|
i = l.call(n, i, o.normalize(), t ? t.status : void 0);
|
|
@@ -1084,7 +1084,7 @@ function zn(e, t) {
|
|
|
1084
1084
|
}, r - d)));
|
|
1085
1085
|
}, () => o && s(o)];
|
|
1086
1086
|
}
|
|
1087
|
-
const
|
|
1087
|
+
const de = (e, t, n = 3) => {
|
|
1088
1088
|
let r = 0;
|
|
1089
1089
|
const o = vn(50, 250);
|
|
1090
1090
|
return zn((i) => {
|
|
@@ -1153,7 +1153,7 @@ function ht(e, t, n) {
|
|
|
1153
1153
|
return e && (r || n == !1) ? $n(e, t) : t;
|
|
1154
1154
|
}
|
|
1155
1155
|
const ve = (e) => e instanceof U ? { ...e } : e;
|
|
1156
|
-
function
|
|
1156
|
+
function $(e, t) {
|
|
1157
1157
|
t = t || {};
|
|
1158
1158
|
const n = {};
|
|
1159
1159
|
function r(u, c, d, b) {
|
|
@@ -1218,7 +1218,7 @@ function q(e, t) {
|
|
|
1218
1218
|
}), n;
|
|
1219
1219
|
}
|
|
1220
1220
|
const mt = (e) => {
|
|
1221
|
-
const t =
|
|
1221
|
+
const t = $({}, e);
|
|
1222
1222
|
let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: i, headers: s, auth: l } = t;
|
|
1223
1223
|
if (t.headers = s = U.from(s), t.url = ct(ht(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), l && s.set(
|
|
1224
1224
|
"Authorization",
|
|
@@ -1249,49 +1249,49 @@ const mt = (e) => {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
let h = new XMLHttpRequest();
|
|
1251
1251
|
h.open(o.method.toUpperCase(), o.url, !0), h.timeout = o.timeout;
|
|
1252
|
-
function
|
|
1252
|
+
function w() {
|
|
1253
1253
|
if (!h)
|
|
1254
1254
|
return;
|
|
1255
|
-
const
|
|
1255
|
+
const x = U.from(
|
|
1256
1256
|
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1257
1257
|
), P = {
|
|
1258
1258
|
data: !l || l === "text" || l === "json" ? h.responseText : h.response,
|
|
1259
1259
|
status: h.status,
|
|
1260
1260
|
statusText: h.statusText,
|
|
1261
|
-
headers:
|
|
1261
|
+
headers: x,
|
|
1262
1262
|
config: e,
|
|
1263
1263
|
request: h
|
|
1264
1264
|
};
|
|
1265
|
-
pt(function(
|
|
1266
|
-
n(
|
|
1267
|
-
}, function(
|
|
1268
|
-
r(
|
|
1265
|
+
pt(function(T) {
|
|
1266
|
+
n(T), m();
|
|
1267
|
+
}, function(T) {
|
|
1268
|
+
r(T), m();
|
|
1269
1269
|
}, P), h = null;
|
|
1270
1270
|
}
|
|
1271
|
-
"onloadend" in h ? h.onloadend =
|
|
1272
|
-
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1271
|
+
"onloadend" in h ? h.onloadend = w : h.onreadystatechange = function() {
|
|
1272
|
+
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(w);
|
|
1273
1273
|
}, h.onabort = function() {
|
|
1274
1274
|
h && (r(new g("Request aborted", g.ECONNABORTED, e, h)), h = null);
|
|
1275
|
-
}, h.onerror = function(
|
|
1276
|
-
const P =
|
|
1277
|
-
|
|
1275
|
+
}, h.onerror = function(k) {
|
|
1276
|
+
const P = k && k.message ? k.message : "Network Error", S = new g(P, g.ERR_NETWORK, e, h);
|
|
1277
|
+
S.event = k || null, r(S), h = null;
|
|
1278
1278
|
}, h.ontimeout = function() {
|
|
1279
|
-
let
|
|
1279
|
+
let k = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
|
|
1280
1280
|
const P = o.transitional || ut;
|
|
1281
|
-
o.timeoutErrorMessage && (
|
|
1282
|
-
|
|
1281
|
+
o.timeoutErrorMessage && (k = o.timeoutErrorMessage), r(new g(
|
|
1282
|
+
k,
|
|
1283
1283
|
P.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
|
|
1284
1284
|
e,
|
|
1285
1285
|
h
|
|
1286
1286
|
)), h = null;
|
|
1287
|
-
}, i === void 0 && s.setContentType(null), "setRequestHeader" in h && a.forEach(s.toJSON(), function(
|
|
1288
|
-
h.setRequestHeader(P,
|
|
1289
|
-
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType), u && ([b, f] =
|
|
1290
|
-
h && (r(!
|
|
1287
|
+
}, i === void 0 && s.setContentType(null), "setRequestHeader" in h && a.forEach(s.toJSON(), function(k, P) {
|
|
1288
|
+
h.setRequestHeader(P, k);
|
|
1289
|
+
}), a.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), l && l !== "json" && (h.responseType = o.responseType), u && ([b, f] = de(u, !0), h.addEventListener("progress", b)), p && h.upload && ([d, C] = de(p), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", C)), (o.cancelToken || o.signal) && (c = (x) => {
|
|
1290
|
+
h && (r(!x || x.type ? new G(null, e, h) : x), h.abort(), h = null);
|
|
1291
1291
|
}, o.cancelToken && o.cancelToken.subscribe(c), o.signal && (o.signal.aborted ? c() : o.signal.addEventListener("abort", c)));
|
|
1292
|
-
const
|
|
1293
|
-
if (
|
|
1294
|
-
r(new g("Unsupported protocol " +
|
|
1292
|
+
const A = jn(o.url);
|
|
1293
|
+
if (A && N.protocols.indexOf(A) === -1) {
|
|
1294
|
+
r(new g("Unsupported protocol " + A + ":", g.ERR_BAD_REQUEST, e));
|
|
1295
1295
|
return;
|
|
1296
1296
|
}
|
|
1297
1297
|
h.send(i || null);
|
|
@@ -1376,7 +1376,7 @@ const mt = (e) => {
|
|
|
1376
1376
|
}, {
|
|
1377
1377
|
highWaterMark: 2
|
|
1378
1378
|
});
|
|
1379
|
-
}, He = 64 * 1024, { isFunction:
|
|
1379
|
+
}, He = 64 * 1024, { isFunction: ae } = a, Yn = (({ Request: e, Response: t }) => ({
|
|
1380
1380
|
Request: e,
|
|
1381
1381
|
Response: t
|
|
1382
1382
|
}))(a.global), {
|
|
@@ -1392,10 +1392,10 @@ const mt = (e) => {
|
|
|
1392
1392
|
e = a.merge.call({
|
|
1393
1393
|
skipUndefined: !0
|
|
1394
1394
|
}, Yn, e);
|
|
1395
|
-
const { fetch: t, Request: n, Response: r } = e, o = t ?
|
|
1395
|
+
const { fetch: t, Request: n, Response: r } = e, o = t ? ae(t) : typeof fetch == "function", i = ae(n), s = ae(r);
|
|
1396
1396
|
if (!o)
|
|
1397
1397
|
return !1;
|
|
1398
|
-
const l = o &&
|
|
1398
|
+
const l = o && ae(Me), p = o && (typeof qe == "function" ? /* @__PURE__ */ ((f) => (m) => f.encode(m))(new qe()) : async (f) => new Uint8Array(await new n(f).arrayBuffer())), u = i && l && $e(() => {
|
|
1399
1399
|
let f = !1;
|
|
1400
1400
|
const m = new n(N.origin, {
|
|
1401
1401
|
body: new Me(),
|
|
@@ -1410,9 +1410,9 @@ const mt = (e) => {
|
|
|
1410
1410
|
};
|
|
1411
1411
|
o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((f) => {
|
|
1412
1412
|
!d[f] && (d[f] = (m, h) => {
|
|
1413
|
-
let
|
|
1414
|
-
if (
|
|
1415
|
-
return
|
|
1413
|
+
let w = m && m[f];
|
|
1414
|
+
if (w)
|
|
1415
|
+
return w.call(m);
|
|
1416
1416
|
throw new g(`Response type '${f}' is not supported`, g.ERR_NOT_SUPPORT, h);
|
|
1417
1417
|
});
|
|
1418
1418
|
});
|
|
@@ -1438,86 +1438,86 @@ const mt = (e) => {
|
|
|
1438
1438
|
let {
|
|
1439
1439
|
url: m,
|
|
1440
1440
|
method: h,
|
|
1441
|
-
data:
|
|
1442
|
-
signal:
|
|
1443
|
-
cancelToken:
|
|
1444
|
-
timeout:
|
|
1441
|
+
data: w,
|
|
1442
|
+
signal: A,
|
|
1443
|
+
cancelToken: x,
|
|
1444
|
+
timeout: k,
|
|
1445
1445
|
onDownloadProgress: P,
|
|
1446
|
-
onUploadProgress:
|
|
1447
|
-
responseType:
|
|
1446
|
+
onUploadProgress: S,
|
|
1447
|
+
responseType: T,
|
|
1448
1448
|
headers: Y,
|
|
1449
|
-
withCredentials:
|
|
1450
|
-
fetchOptions:
|
|
1451
|
-
} = mt(f),
|
|
1452
|
-
|
|
1453
|
-
let W = Vn([
|
|
1454
|
-
const
|
|
1449
|
+
withCredentials: H = "same-origin",
|
|
1450
|
+
fetchOptions: oe
|
|
1451
|
+
} = mt(f), se = t || fetch;
|
|
1452
|
+
T = T ? (T + "").toLowerCase() : "text";
|
|
1453
|
+
let W = Vn([A, x && x.toAbortSignal()], k), D = null;
|
|
1454
|
+
const B = W && W.unsubscribe && (() => {
|
|
1455
1455
|
W.unsubscribe();
|
|
1456
1456
|
});
|
|
1457
|
-
let
|
|
1457
|
+
let E;
|
|
1458
1458
|
try {
|
|
1459
|
-
if (
|
|
1460
|
-
let
|
|
1459
|
+
if (S && u && h !== "get" && h !== "head" && (E = await C(Y, w)) !== 0) {
|
|
1460
|
+
let z = new n(m, {
|
|
1461
1461
|
method: "POST",
|
|
1462
|
-
body:
|
|
1462
|
+
body: w,
|
|
1463
1463
|
duplex: "half"
|
|
1464
1464
|
}), V;
|
|
1465
|
-
if (a.isFormData(
|
|
1466
|
-
const [
|
|
1467
|
-
|
|
1468
|
-
|
|
1465
|
+
if (a.isFormData(w) && (V = z.headers.get("content-type")) && Y.setContentType(V), z.body) {
|
|
1466
|
+
const [ge, ie] = Be(
|
|
1467
|
+
E,
|
|
1468
|
+
de(je(S))
|
|
1469
1469
|
);
|
|
1470
|
-
|
|
1470
|
+
w = ze(z.body, He, ge, ie);
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
a.isString(
|
|
1474
|
-
const
|
|
1475
|
-
...
|
|
1473
|
+
a.isString(H) || (H = H ? "include" : "omit");
|
|
1474
|
+
const O = i && "credentials" in n.prototype, J = {
|
|
1475
|
+
...oe,
|
|
1476
1476
|
signal: W,
|
|
1477
1477
|
method: h.toUpperCase(),
|
|
1478
1478
|
headers: Y.normalize().toJSON(),
|
|
1479
|
-
body:
|
|
1479
|
+
body: w,
|
|
1480
1480
|
duplex: "half",
|
|
1481
|
-
credentials:
|
|
1481
|
+
credentials: O ? H : void 0
|
|
1482
1482
|
};
|
|
1483
|
-
|
|
1484
|
-
let
|
|
1485
|
-
const Fe = c && (
|
|
1486
|
-
if (c && (P || Fe &&
|
|
1487
|
-
const
|
|
1483
|
+
D = i && new n(m, J);
|
|
1484
|
+
let v = await (i ? se(D, oe) : se(m, J));
|
|
1485
|
+
const Fe = c && (T === "stream" || T === "response");
|
|
1486
|
+
if (c && (P || Fe && B)) {
|
|
1487
|
+
const z = {};
|
|
1488
1488
|
["status", "statusText", "headers"].forEach((Pe) => {
|
|
1489
|
-
|
|
1489
|
+
z[Pe] = v[Pe];
|
|
1490
1490
|
});
|
|
1491
|
-
const V = a.toFiniteNumber(
|
|
1491
|
+
const V = a.toFiniteNumber(v.headers.get("content-length")), [ge, ie] = P && Be(
|
|
1492
1492
|
V,
|
|
1493
|
-
|
|
1493
|
+
de(je(P), !0)
|
|
1494
1494
|
) || [];
|
|
1495
|
-
|
|
1496
|
-
ze(
|
|
1497
|
-
|
|
1495
|
+
v = new r(
|
|
1496
|
+
ze(v.body, He, ge, () => {
|
|
1497
|
+
ie && ie(), B && B();
|
|
1498
1498
|
}),
|
|
1499
|
-
|
|
1499
|
+
z
|
|
1500
1500
|
);
|
|
1501
1501
|
}
|
|
1502
|
-
|
|
1503
|
-
let St = await d[a.findKey(d,
|
|
1504
|
-
return !Fe &&
|
|
1505
|
-
pt(
|
|
1502
|
+
T = T || "text";
|
|
1503
|
+
let St = await d[a.findKey(d, T) || "text"](v, f);
|
|
1504
|
+
return !Fe && B && B(), await new Promise((z, V) => {
|
|
1505
|
+
pt(z, V, {
|
|
1506
1506
|
data: St,
|
|
1507
|
-
headers: U.from(
|
|
1508
|
-
status:
|
|
1509
|
-
statusText:
|
|
1507
|
+
headers: U.from(v.headers),
|
|
1508
|
+
status: v.status,
|
|
1509
|
+
statusText: v.statusText,
|
|
1510
1510
|
config: f,
|
|
1511
|
-
request:
|
|
1511
|
+
request: D
|
|
1512
1512
|
});
|
|
1513
1513
|
});
|
|
1514
|
-
} catch (
|
|
1515
|
-
throw
|
|
1516
|
-
new g("Network Error", g.ERR_NETWORK, f,
|
|
1514
|
+
} catch (O) {
|
|
1515
|
+
throw B && B(), O && O.name === "TypeError" && /Load failed|fetch/i.test(O.message) ? Object.assign(
|
|
1516
|
+
new g("Network Error", g.ERR_NETWORK, f, D),
|
|
1517
1517
|
{
|
|
1518
|
-
cause:
|
|
1518
|
+
cause: O.cause || O
|
|
1519
1519
|
}
|
|
1520
|
-
) : g.from(
|
|
1520
|
+
) : g.from(O, O && O.code, f, D);
|
|
1521
1521
|
}
|
|
1522
1522
|
};
|
|
1523
1523
|
}, Zn = /* @__PURE__ */ new Map(), yt = (e) => {
|
|
@@ -1533,14 +1533,14 @@ const mt = (e) => {
|
|
|
1533
1533
|
return u;
|
|
1534
1534
|
};
|
|
1535
1535
|
yt();
|
|
1536
|
-
const
|
|
1536
|
+
const ke = {
|
|
1537
1537
|
http: yn,
|
|
1538
1538
|
xhr: Jn,
|
|
1539
1539
|
fetch: {
|
|
1540
1540
|
get: yt
|
|
1541
1541
|
}
|
|
1542
1542
|
};
|
|
1543
|
-
a.forEach(
|
|
1543
|
+
a.forEach(ke, (e, t) => {
|
|
1544
1544
|
if (e) {
|
|
1545
1545
|
try {
|
|
1546
1546
|
Object.defineProperty(e, "name", { value: t });
|
|
@@ -1558,7 +1558,7 @@ function tr(e, t) {
|
|
|
1558
1558
|
for (let s = 0; s < n; s++) {
|
|
1559
1559
|
r = e[s];
|
|
1560
1560
|
let l;
|
|
1561
|
-
if (o = r, !er(r) && (o =
|
|
1561
|
+
if (o = r, !er(r) && (o = ke[(l = String(r)).toLowerCase()], o === void 0))
|
|
1562
1562
|
throw new g(`Unknown adapter '${l}'`);
|
|
1563
1563
|
if (o && (a.isFunction(o) || (o = o.get(t))))
|
|
1564
1564
|
break;
|
|
@@ -1588,38 +1588,38 @@ const gt = {
|
|
|
1588
1588
|
* Exposes all known adapters
|
|
1589
1589
|
* @type {Object<string, Function|Object>}
|
|
1590
1590
|
*/
|
|
1591
|
-
adapters:
|
|
1591
|
+
adapters: ke
|
|
1592
1592
|
};
|
|
1593
|
-
function
|
|
1593
|
+
function we(e) {
|
|
1594
1594
|
if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
|
|
1595
1595
|
throw new G(null, e);
|
|
1596
1596
|
}
|
|
1597
1597
|
function Je(e) {
|
|
1598
|
-
return
|
|
1598
|
+
return we(e), e.headers = U.from(e.headers), e.data = xe.call(
|
|
1599
1599
|
e,
|
|
1600
1600
|
e.transformRequest
|
|
1601
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter ||
|
|
1602
|
-
return
|
|
1601
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), gt.getAdapter(e.adapter || re.adapter, e)(e).then(function(r) {
|
|
1602
|
+
return we(e), r.data = xe.call(
|
|
1603
1603
|
e,
|
|
1604
1604
|
e.transformResponse,
|
|
1605
1605
|
r
|
|
1606
1606
|
), r.headers = U.from(r.headers), r;
|
|
1607
1607
|
}, function(r) {
|
|
1608
|
-
return ft(r) || (
|
|
1608
|
+
return ft(r) || (we(e), r && r.response && (r.response.data = xe.call(
|
|
1609
1609
|
e,
|
|
1610
1610
|
e.transformResponse,
|
|
1611
1611
|
r.response
|
|
1612
1612
|
), r.response.headers = U.from(r.response.headers))), Promise.reject(r);
|
|
1613
1613
|
});
|
|
1614
1614
|
}
|
|
1615
|
-
const bt = "1.13.2",
|
|
1615
|
+
const bt = "1.13.2", ye = {};
|
|
1616
1616
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1617
|
-
|
|
1617
|
+
ye[e] = function(r) {
|
|
1618
1618
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1619
1619
|
};
|
|
1620
1620
|
});
|
|
1621
1621
|
const Ve = {};
|
|
1622
|
-
|
|
1622
|
+
ye.transitional = function(t, n, r) {
|
|
1623
1623
|
function o(i, s) {
|
|
1624
1624
|
return "[Axios v" + bt + "] Transitional option '" + i + "'" + s + (r ? ". " + r : "");
|
|
1625
1625
|
}
|
|
@@ -1637,7 +1637,7 @@ me.transitional = function(t, n, r) {
|
|
|
1637
1637
|
)), t ? t(i, s, l) : !0;
|
|
1638
1638
|
};
|
|
1639
1639
|
};
|
|
1640
|
-
|
|
1640
|
+
ye.spelling = function(t) {
|
|
1641
1641
|
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
1642
1642
|
};
|
|
1643
1643
|
function nr(e, t, n) {
|
|
@@ -1657,11 +1657,11 @@ function nr(e, t, n) {
|
|
|
1657
1657
|
throw new g("Unknown option " + i, g.ERR_BAD_OPTION);
|
|
1658
1658
|
}
|
|
1659
1659
|
}
|
|
1660
|
-
const
|
|
1660
|
+
const ue = {
|
|
1661
1661
|
assertOptions: nr,
|
|
1662
|
-
validators:
|
|
1663
|
-
},
|
|
1664
|
-
let
|
|
1662
|
+
validators: ye
|
|
1663
|
+
}, j = ue.validators;
|
|
1664
|
+
let q = class {
|
|
1665
1665
|
constructor(t) {
|
|
1666
1666
|
this.defaults = t || {}, this.interceptors = {
|
|
1667
1667
|
request: new Le(),
|
|
@@ -1694,20 +1694,20 @@ let M = class {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
}
|
|
1696
1696
|
_request(t, n) {
|
|
1697
|
-
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n =
|
|
1697
|
+
typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = $(this.defaults, n);
|
|
1698
1698
|
const { transitional: r, paramsSerializer: o, headers: i } = n;
|
|
1699
|
-
r !== void 0 &&
|
|
1700
|
-
silentJSONParsing:
|
|
1701
|
-
forcedJSONParsing:
|
|
1702
|
-
clarifyTimeoutError:
|
|
1699
|
+
r !== void 0 && ue.assertOptions(r, {
|
|
1700
|
+
silentJSONParsing: j.transitional(j.boolean),
|
|
1701
|
+
forcedJSONParsing: j.transitional(j.boolean),
|
|
1702
|
+
clarifyTimeoutError: j.transitional(j.boolean)
|
|
1703
1703
|
}, !1), o != null && (a.isFunction(o) ? n.paramsSerializer = {
|
|
1704
1704
|
serialize: o
|
|
1705
|
-
} :
|
|
1706
|
-
encode:
|
|
1707
|
-
serialize:
|
|
1708
|
-
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0),
|
|
1709
|
-
baseUrl:
|
|
1710
|
-
withXsrfToken:
|
|
1705
|
+
} : ue.assertOptions(o, {
|
|
1706
|
+
encode: j.function,
|
|
1707
|
+
serialize: j.function
|
|
1708
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ue.assertOptions(n, {
|
|
1709
|
+
baseUrl: j.spelling("baseURL"),
|
|
1710
|
+
withXsrfToken: j.spelling("withXSRFToken")
|
|
1711
1711
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1712
1712
|
let s = i && a.merge(
|
|
1713
1713
|
i.common,
|
|
@@ -1756,14 +1756,14 @@ let M = class {
|
|
|
1756
1756
|
return c;
|
|
1757
1757
|
}
|
|
1758
1758
|
getUri(t) {
|
|
1759
|
-
t =
|
|
1759
|
+
t = $(this.defaults, t);
|
|
1760
1760
|
const n = ht(t.baseURL, t.url, t.allowAbsoluteUrls);
|
|
1761
1761
|
return ct(n, t.params, t.paramsSerializer);
|
|
1762
1762
|
}
|
|
1763
1763
|
};
|
|
1764
1764
|
a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
1765
|
-
|
|
1766
|
-
return this.request(
|
|
1765
|
+
q.prototype[t] = function(n, r) {
|
|
1766
|
+
return this.request($(r || {}, {
|
|
1767
1767
|
method: t,
|
|
1768
1768
|
url: n,
|
|
1769
1769
|
data: (r || {}).data
|
|
@@ -1773,7 +1773,7 @@ a.forEach(["delete", "get", "head", "options"], function(t) {
|
|
|
1773
1773
|
a.forEach(["post", "put", "patch"], function(t) {
|
|
1774
1774
|
function n(r) {
|
|
1775
1775
|
return function(i, s, l) {
|
|
1776
|
-
return this.request(
|
|
1776
|
+
return this.request($(l || {}, {
|
|
1777
1777
|
method: t,
|
|
1778
1778
|
headers: r ? {
|
|
1779
1779
|
"Content-Type": "multipart/form-data"
|
|
@@ -1783,7 +1783,7 @@ a.forEach(["post", "put", "patch"], function(t) {
|
|
|
1783
1783
|
}));
|
|
1784
1784
|
};
|
|
1785
1785
|
}
|
|
1786
|
-
|
|
1786
|
+
q.prototype[t] = n(), q.prototype[t + "Form"] = n(!0);
|
|
1787
1787
|
});
|
|
1788
1788
|
let rr = class xt {
|
|
1789
1789
|
constructor(t) {
|
|
@@ -1866,7 +1866,7 @@ function or(e) {
|
|
|
1866
1866
|
function sr(e) {
|
|
1867
1867
|
return a.isObject(e) && e.isAxiosError === !0;
|
|
1868
1868
|
}
|
|
1869
|
-
const
|
|
1869
|
+
const Re = {
|
|
1870
1870
|
Continue: 100,
|
|
1871
1871
|
SwitchingProtocols: 101,
|
|
1872
1872
|
Processing: 102,
|
|
@@ -1937,35 +1937,35 @@ const Ce = {
|
|
|
1937
1937
|
SslHandshakeFailed: 525,
|
|
1938
1938
|
InvalidSslCertificate: 526
|
|
1939
1939
|
};
|
|
1940
|
-
Object.entries(
|
|
1941
|
-
|
|
1940
|
+
Object.entries(Re).forEach(([e, t]) => {
|
|
1941
|
+
Re[t] = e;
|
|
1942
1942
|
});
|
|
1943
1943
|
function wt(e) {
|
|
1944
|
-
const t = new
|
|
1945
|
-
return a.extend(n,
|
|
1946
|
-
return wt(
|
|
1944
|
+
const t = new q(e), n = Ye(q.prototype.request, t);
|
|
1945
|
+
return a.extend(n, q.prototype, t, { allOwnKeys: !0 }), a.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
|
|
1946
|
+
return wt($(e, o));
|
|
1947
1947
|
}, n;
|
|
1948
1948
|
}
|
|
1949
|
-
const
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1949
|
+
const R = wt(re);
|
|
1950
|
+
R.Axios = q;
|
|
1951
|
+
R.CanceledError = G;
|
|
1952
|
+
R.CancelToken = rr;
|
|
1953
|
+
R.isCancel = ft;
|
|
1954
|
+
R.VERSION = bt;
|
|
1955
|
+
R.toFormData = me;
|
|
1956
|
+
R.AxiosError = g;
|
|
1957
|
+
R.Cancel = R.CanceledError;
|
|
1958
|
+
R.all = function(t) {
|
|
1959
1959
|
return Promise.all(t);
|
|
1960
1960
|
};
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1961
|
+
R.spread = or;
|
|
1962
|
+
R.isAxiosError = sr;
|
|
1963
|
+
R.mergeConfig = $;
|
|
1964
|
+
R.AxiosHeaders = U;
|
|
1965
|
+
R.formToJSON = (e) => dt(a.isHTMLForm(e) ? new FormData(e) : e);
|
|
1966
|
+
R.getAdapter = gt.getAdapter;
|
|
1967
|
+
R.HttpStatusCode = Re;
|
|
1968
|
+
R.default = R;
|
|
1969
1969
|
const {
|
|
1970
1970
|
Axios: yr,
|
|
1971
1971
|
AxiosError: gr,
|
|
@@ -1983,7 +1983,7 @@ const {
|
|
|
1983
1983
|
formToJSON: Fr,
|
|
1984
1984
|
getAdapter: Pr,
|
|
1985
1985
|
mergeConfig: Nr
|
|
1986
|
-
} =
|
|
1986
|
+
} = R, ir = async (e, t, n, r, o) => {
|
|
1987
1987
|
const i = {
|
|
1988
1988
|
chatInput: e,
|
|
1989
1989
|
metadata: {
|
|
@@ -1993,7 +1993,7 @@ const {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
};
|
|
1995
1995
|
try {
|
|
1996
|
-
return (await
|
|
1996
|
+
return (await R.post(
|
|
1997
1997
|
n,
|
|
1998
1998
|
i,
|
|
1999
1999
|
{
|
|
@@ -2014,7 +2014,7 @@ const {
|
|
|
2014
2014
|
sessionId: r
|
|
2015
2015
|
};
|
|
2016
2016
|
try {
|
|
2017
|
-
return (await
|
|
2017
|
+
return (await R.post(
|
|
2018
2018
|
n,
|
|
2019
2019
|
o,
|
|
2020
2020
|
{
|
|
@@ -2031,7 +2031,7 @@ const {
|
|
|
2031
2031
|
sessionId: e
|
|
2032
2032
|
};
|
|
2033
2033
|
try {
|
|
2034
|
-
const r = await
|
|
2034
|
+
const r = await R.post(
|
|
2035
2035
|
t,
|
|
2036
2036
|
n,
|
|
2037
2037
|
{
|
|
@@ -2040,27 +2040,27 @@ const {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
}
|
|
2042
2042
|
);
|
|
2043
|
-
return
|
|
2043
|
+
return console.log("Fetch chat history response:", r), r.data.n8n;
|
|
2044
2044
|
} catch (r) {
|
|
2045
2045
|
throw console.error("Error fetching with chat API:", r), r;
|
|
2046
2046
|
}
|
|
2047
2047
|
}, cr = ({ theme: e, chatBotData: t, trackFormSubmission: n }) => {
|
|
2048
|
-
const [r, o] = I(""), [i, s] = I(""), [l, p] = I(""), [u, c] = I(""), [d, b] = I(!1), C = async (
|
|
2049
|
-
if (
|
|
2048
|
+
const [r, o] = I(""), [i, s] = I(""), [l, p] = I(""), [u, c] = I(""), [d, b] = I(!1), C = async (S) => {
|
|
2049
|
+
if (S.preventDefault(), b(!0), c(""), !r.trim() || !i.trim()) {
|
|
2050
2050
|
c("Name and email are required"), b(!1);
|
|
2051
2051
|
return;
|
|
2052
2052
|
}
|
|
2053
2053
|
try {
|
|
2054
|
-
const
|
|
2054
|
+
const T = await ir(
|
|
2055
2055
|
l,
|
|
2056
2056
|
t.pineconeNamespace,
|
|
2057
2057
|
t.initiateChatUrl,
|
|
2058
2058
|
r,
|
|
2059
2059
|
i
|
|
2060
2060
|
);
|
|
2061
|
-
localStorage.setItem("clone67ChatSessionId",
|
|
2062
|
-
} catch (
|
|
2063
|
-
console.log("error sending user details",
|
|
2061
|
+
localStorage.setItem("clone67ChatSessionId", T.n8n.session_id), n(!0);
|
|
2062
|
+
} catch (T) {
|
|
2063
|
+
console.log("error sending user details", T), c("Failed to submit. Please try again.");
|
|
2064
2064
|
} finally {
|
|
2065
2065
|
b(!1);
|
|
2066
2066
|
}
|
|
@@ -2080,15 +2080,15 @@ const {
|
|
|
2080
2080
|
color: e.fontColor,
|
|
2081
2081
|
margin: 0,
|
|
2082
2082
|
lineHeight: "1.4"
|
|
2083
|
-
},
|
|
2083
|
+
}, w = {
|
|
2084
2084
|
display: "flex",
|
|
2085
2085
|
flexDirection: "column",
|
|
2086
2086
|
gap: "20px"
|
|
2087
|
-
},
|
|
2087
|
+
}, A = {
|
|
2088
2088
|
fontSize: "14px",
|
|
2089
2089
|
color: e.fontColor,
|
|
2090
2090
|
fontWeight: "500"
|
|
2091
|
-
},
|
|
2091
|
+
}, x = {
|
|
2092
2092
|
width: "100%",
|
|
2093
2093
|
padding: "12px 16px",
|
|
2094
2094
|
background: e.backgroundColor,
|
|
@@ -2098,7 +2098,7 @@ const {
|
|
|
2098
2098
|
fontSize: "15px",
|
|
2099
2099
|
outline: "none",
|
|
2100
2100
|
boxSizing: "border-box"
|
|
2101
|
-
},
|
|
2101
|
+
}, k = {
|
|
2102
2102
|
padding: "12px 20px",
|
|
2103
2103
|
borderRadius: "12px",
|
|
2104
2104
|
fontWeight: "600",
|
|
@@ -2114,7 +2114,7 @@ const {
|
|
|
2114
2114
|
gap: "8px",
|
|
2115
2115
|
transition: "all 0.2s ease"
|
|
2116
2116
|
};
|
|
2117
|
-
return /* @__PURE__ */ y("div", { style: f, children: /* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ y("div", { style: f, children: /* @__PURE__ */ F("form", { onSubmit: C, style: m, children: [
|
|
2118
2118
|
u && /* @__PURE__ */ y("div", { style: {
|
|
2119
2119
|
backgroundColor: "#fee2e2",
|
|
2120
2120
|
color: "#713f12",
|
|
@@ -2125,51 +2125,51 @@ const {
|
|
|
2125
2125
|
fontWeight: "500"
|
|
2126
2126
|
}, role: "alert", children: u }),
|
|
2127
2127
|
/* @__PURE__ */ y("p", { style: h, children: t.welcomeText }),
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */ y("label", { style:
|
|
2128
|
+
/* @__PURE__ */ F("div", { style: w, children: [
|
|
2129
|
+
/* @__PURE__ */ F("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2130
|
+
/* @__PURE__ */ y("label", { style: A, children: "Full Name" }),
|
|
2131
2131
|
/* @__PURE__ */ y(
|
|
2132
2132
|
"input",
|
|
2133
2133
|
{
|
|
2134
2134
|
type: "text",
|
|
2135
2135
|
placeholder: "Enter your full name",
|
|
2136
2136
|
value: r,
|
|
2137
|
-
onChange: (
|
|
2138
|
-
o(
|
|
2137
|
+
onChange: (S) => {
|
|
2138
|
+
o(S.target.value), c("");
|
|
2139
2139
|
},
|
|
2140
|
-
style:
|
|
2140
|
+
style: x,
|
|
2141
2141
|
required: !0
|
|
2142
2142
|
}
|
|
2143
2143
|
)
|
|
2144
2144
|
] }),
|
|
2145
|
-
/* @__PURE__ */
|
|
2146
|
-
/* @__PURE__ */ y("label", { style:
|
|
2145
|
+
/* @__PURE__ */ F("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2146
|
+
/* @__PURE__ */ y("label", { style: A, children: "Email Address" }),
|
|
2147
2147
|
/* @__PURE__ */ y(
|
|
2148
2148
|
"input",
|
|
2149
2149
|
{
|
|
2150
2150
|
type: "email",
|
|
2151
2151
|
placeholder: "Enter your email",
|
|
2152
2152
|
value: i,
|
|
2153
|
-
onChange: (
|
|
2154
|
-
s(
|
|
2153
|
+
onChange: (S) => {
|
|
2154
|
+
s(S.target.value), c("");
|
|
2155
2155
|
},
|
|
2156
|
-
style:
|
|
2156
|
+
style: x,
|
|
2157
2157
|
required: !0
|
|
2158
2158
|
}
|
|
2159
2159
|
)
|
|
2160
2160
|
] }),
|
|
2161
|
-
/* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */ y("label", { style:
|
|
2161
|
+
/* @__PURE__ */ F("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
2162
|
+
/* @__PURE__ */ y("label", { style: A, children: "Message" }),
|
|
2163
2163
|
/* @__PURE__ */ y(
|
|
2164
2164
|
"textarea",
|
|
2165
2165
|
{
|
|
2166
2166
|
placeholder: "Enter your message",
|
|
2167
2167
|
value: l,
|
|
2168
|
-
onChange: (
|
|
2169
|
-
p(
|
|
2168
|
+
onChange: (S) => {
|
|
2169
|
+
p(S.target.value), c("");
|
|
2170
2170
|
},
|
|
2171
2171
|
style: {
|
|
2172
|
-
...
|
|
2172
|
+
...x,
|
|
2173
2173
|
minHeight: "60px",
|
|
2174
2174
|
maxHeight: "80px",
|
|
2175
2175
|
resize: "vertical"
|
|
@@ -2184,14 +2184,14 @@ const {
|
|
|
2184
2184
|
{
|
|
2185
2185
|
type: "submit",
|
|
2186
2186
|
disabled: !r.trim() || !i.trim() || d,
|
|
2187
|
-
style:
|
|
2188
|
-
onMouseEnter: (
|
|
2189
|
-
r.trim() && i.trim() && !d && (
|
|
2187
|
+
style: k,
|
|
2188
|
+
onMouseEnter: (S) => {
|
|
2189
|
+
r.trim() && i.trim() && !d && (S.currentTarget.style.transform = "translateY(-2px)", S.currentTarget.style.boxShadow = "0 10px 20px rgba(0,0,0,0.15)");
|
|
2190
2190
|
},
|
|
2191
|
-
onMouseLeave: (
|
|
2192
|
-
|
|
2191
|
+
onMouseLeave: (S) => {
|
|
2192
|
+
S.currentTarget.style.transform = "translateY(0)", S.currentTarget.style.boxShadow = "none";
|
|
2193
2193
|
},
|
|
2194
|
-
children: d ? "Submitting..." : /* @__PURE__ */
|
|
2194
|
+
children: d ? "Submitting..." : /* @__PURE__ */ F(Z, { children: [
|
|
2195
2195
|
/* @__PURE__ */ y(Ge, { size: 18 }),
|
|
2196
2196
|
"Submit"
|
|
2197
2197
|
] })
|
|
@@ -2199,50 +2199,50 @@ const {
|
|
|
2199
2199
|
)
|
|
2200
2200
|
] }) });
|
|
2201
2201
|
}, ur = ({ onClose: e, theme: t, chatBotData: n }) => {
|
|
2202
|
-
const [r, o] = I([]), [i, s] = I(!1), [l, p] = I(!1), [u, c] = I(!1), d = n.position === "left",
|
|
2203
|
-
c(
|
|
2204
|
-
},
|
|
2205
|
-
if (
|
|
2202
|
+
const [r, o] = I([]), [i, s] = I(!1), [l, p] = I(!1), [u, c] = I(!1), [d, b] = I(null), C = n.position === "left", f = localStorage.getItem("clone67ChatSessionId"), m = (E) => {
|
|
2203
|
+
c(E);
|
|
2204
|
+
}, h = async () => {
|
|
2205
|
+
if (f) {
|
|
2206
2206
|
s(!0);
|
|
2207
2207
|
try {
|
|
2208
|
-
const
|
|
2209
|
-
|
|
2208
|
+
const E = await lr(
|
|
2209
|
+
f,
|
|
2210
2210
|
n.fetchChatHistoryUrl
|
|
2211
|
-
);
|
|
2212
|
-
|
|
2213
|
-
} catch (
|
|
2214
|
-
console.log("Error fetching chat history",
|
|
2211
|
+
), O = E.data.messages;
|
|
2212
|
+
E.data.status ? (o(O), b(null)) : b("something went wrong, please try again later.");
|
|
2213
|
+
} catch (E) {
|
|
2214
|
+
console.log("Error fetching chat history", E);
|
|
2215
2215
|
} finally {
|
|
2216
2216
|
s(!1);
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
2219
|
};
|
|
2220
2220
|
Ke(() => {
|
|
2221
|
-
|
|
2222
|
-
}, [u,
|
|
2223
|
-
const
|
|
2224
|
-
s(!0), o((
|
|
2225
|
-
...
|
|
2226
|
-
{ sender_type: "user", message:
|
|
2221
|
+
h();
|
|
2222
|
+
}, [u, f]);
|
|
2223
|
+
const w = async (E) => {
|
|
2224
|
+
s(!0), o((O) => [
|
|
2225
|
+
...O,
|
|
2226
|
+
{ sender_type: "user", message: E }
|
|
2227
2227
|
]);
|
|
2228
2228
|
try {
|
|
2229
|
-
const
|
|
2230
|
-
|
|
2229
|
+
const O = await ar(
|
|
2230
|
+
E,
|
|
2231
2231
|
n.pineconeNamespace,
|
|
2232
2232
|
n.onGoingChatUrl,
|
|
2233
|
-
|
|
2233
|
+
f
|
|
2234
2234
|
);
|
|
2235
2235
|
o((J) => [
|
|
2236
2236
|
...J,
|
|
2237
2237
|
{
|
|
2238
2238
|
sender_type: "bot",
|
|
2239
|
-
message:
|
|
2240
|
-
created_at:
|
|
2241
|
-
suggested_prompts:
|
|
2239
|
+
message: O.n8n.message,
|
|
2240
|
+
created_at: O.n8n.created_at,
|
|
2241
|
+
suggested_prompts: O.n8n.suggested_prompts
|
|
2242
2242
|
}
|
|
2243
2243
|
]);
|
|
2244
|
-
} catch (
|
|
2245
|
-
console.error("Chat error:",
|
|
2244
|
+
} catch (O) {
|
|
2245
|
+
console.error("Chat error:", O), o((J) => [
|
|
2246
2246
|
...J,
|
|
2247
2247
|
{
|
|
2248
2248
|
sender_type: "bot",
|
|
@@ -2254,10 +2254,10 @@ const {
|
|
|
2254
2254
|
} finally {
|
|
2255
2255
|
s(!1);
|
|
2256
2256
|
}
|
|
2257
|
-
},
|
|
2257
|
+
}, A = {
|
|
2258
2258
|
position: "fixed",
|
|
2259
2259
|
bottom: "112px",
|
|
2260
|
-
[
|
|
2260
|
+
[C ? "left" : "right"]: "32px",
|
|
2261
2261
|
zIndex: 50,
|
|
2262
2262
|
width: l ? "684px" : "384px",
|
|
2263
2263
|
height: l ? "620px" : "520px",
|
|
@@ -2271,7 +2271,7 @@ const {
|
|
|
2271
2271
|
overflow: "hidden",
|
|
2272
2272
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
2273
2273
|
boxShadow: "0 10px 25px -3px rgba(0,0,0,0.1)"
|
|
2274
|
-
},
|
|
2274
|
+
}, x = {
|
|
2275
2275
|
padding: "16px 20px",
|
|
2276
2276
|
background: `linear-gradient(135deg, ${t.primaryColor}, ${t.secondaryColor})`,
|
|
2277
2277
|
color: t.fontColor,
|
|
@@ -2280,9 +2280,9 @@ const {
|
|
|
2280
2280
|
alignItems: "center",
|
|
2281
2281
|
justifyContent: "space-between",
|
|
2282
2282
|
boxShadow: "0 4px 6px -1px rgba(0,0,0,0.1)"
|
|
2283
|
-
},
|
|
2283
|
+
}, k = {
|
|
2284
2284
|
position: "relative"
|
|
2285
|
-
},
|
|
2285
|
+
}, P = {
|
|
2286
2286
|
width: "44px",
|
|
2287
2287
|
height: "44px",
|
|
2288
2288
|
borderRadius: "50%",
|
|
@@ -2290,7 +2290,7 @@ const {
|
|
|
2290
2290
|
display: "flex",
|
|
2291
2291
|
alignItems: "center",
|
|
2292
2292
|
justifyContent: "center"
|
|
2293
|
-
},
|
|
2293
|
+
}, S = {
|
|
2294
2294
|
position: "absolute",
|
|
2295
2295
|
bottom: 0,
|
|
2296
2296
|
right: 0,
|
|
@@ -2299,37 +2299,37 @@ const {
|
|
|
2299
2299
|
backgroundColor: "#34d399",
|
|
2300
2300
|
borderRadius: "50%",
|
|
2301
2301
|
border: "3px solid white"
|
|
2302
|
-
},
|
|
2302
|
+
}, T = {
|
|
2303
2303
|
fontSize: "18px",
|
|
2304
2304
|
fontWeight: "600",
|
|
2305
2305
|
margin: 0,
|
|
2306
2306
|
lineHeight: "1.2"
|
|
2307
|
-
},
|
|
2307
|
+
}, Y = {
|
|
2308
2308
|
fontSize: "12px",
|
|
2309
2309
|
opacity: 0.9,
|
|
2310
2310
|
margin: 0,
|
|
2311
2311
|
lineHeight: "1.3"
|
|
2312
|
-
},
|
|
2312
|
+
}, H = {
|
|
2313
2313
|
padding: "8px",
|
|
2314
2314
|
borderRadius: "50%",
|
|
2315
2315
|
background: "transparent",
|
|
2316
2316
|
border: "none",
|
|
2317
2317
|
cursor: "pointer",
|
|
2318
2318
|
transition: "background 0.2s"
|
|
2319
|
-
},
|
|
2319
|
+
}, oe = {
|
|
2320
2320
|
padding: "12px 20px",
|
|
2321
2321
|
borderTop: "1px solid rgba(255,255,255,0.2)",
|
|
2322
2322
|
background: t.backgroundColor,
|
|
2323
2323
|
textAlign: "center"
|
|
2324
|
-
},
|
|
2324
|
+
}, se = {
|
|
2325
2325
|
fontSize: "11px",
|
|
2326
2326
|
color: t.fontColor,
|
|
2327
2327
|
letterSpacing: "0.5px"
|
|
2328
|
-
}, re = {
|
|
2329
|
-
fontWeight: "600"
|
|
2330
|
-
}, z = (x, F) => {
|
|
2331
|
-
x.currentTarget.style.background = F ? "rgba(255,255,255,0.2)" : "transparent";
|
|
2332
2328
|
}, W = {
|
|
2329
|
+
fontWeight: "600"
|
|
2330
|
+
}, D = (E, O) => {
|
|
2331
|
+
E.currentTarget.style.background = O ? "rgba(255,255,255,0.2)" : "transparent";
|
|
2332
|
+
}, B = {
|
|
2333
2333
|
flex: 1,
|
|
2334
2334
|
display: "flex",
|
|
2335
2335
|
alignItems: "center",
|
|
@@ -2339,27 +2339,27 @@ const {
|
|
|
2339
2339
|
opacity: 0.9,
|
|
2340
2340
|
fontSize: "14px"
|
|
2341
2341
|
};
|
|
2342
|
-
return /* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
2344
|
-
/* @__PURE__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */ y("div", { style:
|
|
2347
|
-
/* @__PURE__ */ y("span", { style:
|
|
2342
|
+
return /* @__PURE__ */ F("div", { style: A, children: [
|
|
2343
|
+
/* @__PURE__ */ F("div", { style: x, children: [
|
|
2344
|
+
/* @__PURE__ */ F("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
2345
|
+
/* @__PURE__ */ F("div", { style: k, children: [
|
|
2346
|
+
/* @__PURE__ */ y("div", { style: P, children: /* @__PURE__ */ y(Xe, { size: 22 }) }),
|
|
2347
|
+
/* @__PURE__ */ y("span", { style: S })
|
|
2348
2348
|
] }),
|
|
2349
|
-
/* @__PURE__ */
|
|
2350
|
-
/* @__PURE__ */ y("h3", { style:
|
|
2351
|
-
/* @__PURE__ */ y("p", { style:
|
|
2349
|
+
/* @__PURE__ */ F("div", { children: [
|
|
2350
|
+
/* @__PURE__ */ y("h3", { style: T, children: n.name }),
|
|
2351
|
+
/* @__PURE__ */ y("p", { style: Y, children: n.subTitle })
|
|
2352
2352
|
] })
|
|
2353
2353
|
] }),
|
|
2354
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ F("div", { style: { display: "flex", alignItems: "left" }, children: [
|
|
2355
2355
|
/* @__PURE__ */ y(
|
|
2356
2356
|
"button",
|
|
2357
2357
|
{
|
|
2358
|
-
onClick: () => p((
|
|
2358
|
+
onClick: () => p((E) => !E),
|
|
2359
2359
|
"aria-label": "expand chat",
|
|
2360
|
-
style:
|
|
2361
|
-
onMouseEnter: (
|
|
2362
|
-
onMouseLeave: (
|
|
2360
|
+
style: H,
|
|
2361
|
+
onMouseEnter: (E) => D(E, !0),
|
|
2362
|
+
onMouseLeave: (E) => D(E, !1),
|
|
2363
2363
|
children: l ? /* @__PURE__ */ y(Rt, { size: 20 }) : /* @__PURE__ */ y(Tt, { size: 20 })
|
|
2364
2364
|
}
|
|
2365
2365
|
),
|
|
@@ -2368,28 +2368,28 @@ const {
|
|
|
2368
2368
|
{
|
|
2369
2369
|
onClick: e,
|
|
2370
2370
|
"aria-label": "close chat",
|
|
2371
|
-
style:
|
|
2372
|
-
onMouseEnter: (
|
|
2373
|
-
onMouseLeave: (
|
|
2371
|
+
style: H,
|
|
2372
|
+
onMouseEnter: (E) => D(E, !0),
|
|
2373
|
+
onMouseLeave: (E) => D(E, !1),
|
|
2374
2374
|
children: /* @__PURE__ */ y(Ot, { size: 20 })
|
|
2375
2375
|
}
|
|
2376
2376
|
)
|
|
2377
2377
|
] })
|
|
2378
2378
|
] }),
|
|
2379
|
-
|
|
2379
|
+
f ? /* @__PURE__ */ y(Z, { children: i && r.length === 0 ? /* @__PURE__ */ y("div", { style: B, children: /* @__PURE__ */ y("span", { children: "connecting server...." }) }) : /* @__PURE__ */ y(Z, { children: d ? /* @__PURE__ */ y("div", { style: B, children: /* @__PURE__ */ y("span", { children: d }) }) : /* @__PURE__ */ F(Z, { children: [
|
|
2380
2380
|
/* @__PURE__ */ y(Ft, { messages: r, isLoading: i, theme: t }),
|
|
2381
|
-
/* @__PURE__ */ y(kt, { onSendMessage:
|
|
2382
|
-
] }) }) : /* @__PURE__ */ y(
|
|
2381
|
+
/* @__PURE__ */ y(kt, { onSendMessage: w, isLoading: i, theme: t })
|
|
2382
|
+
] }) }) }) : /* @__PURE__ */ y(
|
|
2383
2383
|
cr,
|
|
2384
2384
|
{
|
|
2385
2385
|
theme: t,
|
|
2386
2386
|
chatBotData: n,
|
|
2387
|
-
trackFormSubmission:
|
|
2387
|
+
trackFormSubmission: m
|
|
2388
2388
|
}
|
|
2389
2389
|
),
|
|
2390
|
-
/* @__PURE__ */ y("div", { style:
|
|
2390
|
+
/* @__PURE__ */ y("div", { style: oe, children: /* @__PURE__ */ F("p", { style: se, children: [
|
|
2391
2391
|
"powered by ",
|
|
2392
|
-
/* @__PURE__ */ y("span", { style:
|
|
2392
|
+
/* @__PURE__ */ y("span", { style: W, children: "clone67.com" })
|
|
2393
2393
|
] }) })
|
|
2394
2394
|
] });
|
|
2395
2395
|
}, _r = ({
|
|
@@ -2408,15 +2408,15 @@ const {
|
|
|
2408
2408
|
welcomeText: b = "Hi! How can I help you today?"
|
|
2409
2409
|
}) => {
|
|
2410
2410
|
const [C, f] = I(!1), m = () => {
|
|
2411
|
-
f((
|
|
2412
|
-
}, h = () => f((
|
|
2411
|
+
f((T) => !T), localStorage.removeItem("clone67ChatSessionId");
|
|
2412
|
+
}, h = () => f((T) => !T), w = {
|
|
2413
2413
|
primaryColor: o,
|
|
2414
2414
|
secondaryColor: i,
|
|
2415
2415
|
backgroundColor: s,
|
|
2416
2416
|
fontColor: l,
|
|
2417
2417
|
placeholderColor: p,
|
|
2418
2418
|
inputBackgroundColor: s
|
|
2419
|
-
},
|
|
2419
|
+
}, A = {
|
|
2420
2420
|
name: c,
|
|
2421
2421
|
subTitle: d,
|
|
2422
2422
|
welcomeText: b,
|
|
@@ -2425,35 +2425,35 @@ const {
|
|
|
2425
2425
|
initiateChatUrl: n,
|
|
2426
2426
|
pineconeNamespace: e,
|
|
2427
2427
|
position: u
|
|
2428
|
-
},
|
|
2428
|
+
}, x = u === "left", k = "32px", P = {
|
|
2429
2429
|
position: "fixed",
|
|
2430
2430
|
bottom: "104px",
|
|
2431
|
-
[
|
|
2431
|
+
[x ? "left" : "right"]: k,
|
|
2432
2432
|
zIndex: 9999,
|
|
2433
2433
|
pointerEvents: "auto"
|
|
2434
|
-
},
|
|
2434
|
+
}, S = {
|
|
2435
2435
|
position: "fixed",
|
|
2436
2436
|
bottom: "32px",
|
|
2437
|
-
[
|
|
2437
|
+
[x ? "left" : "right"]: k,
|
|
2438
2438
|
zIndex: 1e4,
|
|
2439
2439
|
pointerEvents: "auto"
|
|
2440
2440
|
};
|
|
2441
|
-
return /* @__PURE__ */
|
|
2441
|
+
return /* @__PURE__ */ F(Z, { children: [
|
|
2442
2442
|
C && /* @__PURE__ */ y("div", { style: P, children: /* @__PURE__ */ y(
|
|
2443
2443
|
ur,
|
|
2444
2444
|
{
|
|
2445
2445
|
onClose: m,
|
|
2446
|
-
theme:
|
|
2447
|
-
chatBotData:
|
|
2446
|
+
theme: w,
|
|
2447
|
+
chatBotData: A
|
|
2448
2448
|
}
|
|
2449
2449
|
) }),
|
|
2450
|
-
/* @__PURE__ */ y("div", { style:
|
|
2450
|
+
/* @__PURE__ */ y("div", { style: S, children: /* @__PURE__ */ y(
|
|
2451
2451
|
At,
|
|
2452
2452
|
{
|
|
2453
2453
|
onMinimise: h,
|
|
2454
2454
|
isOpen: C,
|
|
2455
|
-
theme:
|
|
2456
|
-
chatBotData:
|
|
2455
|
+
theme: w,
|
|
2456
|
+
chatBotData: A
|
|
2457
2457
|
}
|
|
2458
2458
|
) })
|
|
2459
2459
|
] });
|