@enegelai/bot-widget 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enegelaibot.umd.js +264 -265
- package/dist/index.es.js +122 -105
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var ja = Object.defineProperty;
|
|
2
2
|
var Ha = (c, e, a) => e in c ? ja(c, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : c[e] = a;
|
|
3
3
|
var ge = (c, e, a) => Ha(c, typeof e != "symbol" ? e + "" : e, a);
|
|
4
|
-
import { css as X, LitElement as ut, html as g, svg as
|
|
4
|
+
import { css as X, LitElement as ut, html as g, svg as le } from "lit";
|
|
5
5
|
import { property as v, customElement as J, queryAll as Qt, query as ke, eventOptions as Mt } from "lit/decorators.js";
|
|
6
6
|
import { unsafeHTML as W } from "lit-html/directives/unsafe-html.js";
|
|
7
|
-
import { when as
|
|
7
|
+
import { when as ie } from "lit/directives/when.js";
|
|
8
8
|
import { registerIconLibrary as Ba } from "@shoelace-style/shoelace";
|
|
9
9
|
import "@shoelace-style/shoelace/dist/components/button/button.js";
|
|
10
10
|
import "@shoelace-style/shoelace/dist/components/avatar/avatar.js";
|
|
@@ -800,7 +800,7 @@ var dc = Object.defineProperty, O = (c, e, a, n) => {
|
|
|
800
800
|
};
|
|
801
801
|
const A = Ke.noConflict();
|
|
802
802
|
A.setLevel("info");
|
|
803
|
-
const
|
|
803
|
+
const ee = "cb_";
|
|
804
804
|
class L extends kt {
|
|
805
805
|
constructor() {
|
|
806
806
|
super(...arguments), this.actionIdCounter = 0, this.prefilledFormValues = {}, this.wsClient = null, this.replyMessage = null, this.streamingResponseInProgress = !1, this.streamingResponseLastText = null, this.streamingResponseBuffer = null, this.streamingResponseTagStartPos = 0, this.streamingResponseCurrentTag = null;
|
|
@@ -938,7 +938,7 @@ class L extends kt {
|
|
|
938
938
|
A.info("form has no fields", e);
|
|
939
939
|
return;
|
|
940
940
|
}
|
|
941
|
-
const r = `${
|
|
941
|
+
const r = `${ee}${this.setting.botId}.${this.conversationId}.form.${n}`, f = localStorage.getItem(r);
|
|
942
942
|
if (f) {
|
|
943
943
|
let w = null;
|
|
944
944
|
try {
|
|
@@ -996,7 +996,7 @@ class L extends kt {
|
|
|
996
996
|
}
|
|
997
997
|
handleWscConnecting(e) {
|
|
998
998
|
var a, n;
|
|
999
|
-
A.info(`WSC: on connecting(${e}), connected: ${(a = this.wsClient) == null ? void 0 : a.connected}`), this.connecting = e, !this.connecting && ((n = this.wsClient) != null && n.connected) && (this.context && this.wsClient.queueMessage(
|
|
999
|
+
A.info(`WSC: on connecting(${e}), connected: ${(a = this.wsClient) == null ? void 0 : a.connected}`), this.connecting = e, !this.connecting && ((n = this.wsClient) != null && n.connected) ? (this.connected = !0, this.context && typeof this.context == "object" && Object.keys(this.context).length > 0 && this.wsClient.queueMessage(
|
|
1000
1000
|
{
|
|
1001
1001
|
id: xe(),
|
|
1002
1002
|
type: "setContext",
|
|
@@ -1009,29 +1009,41 @@ class L extends kt {
|
|
|
1009
1009
|
type: "botConnected"
|
|
1010
1010
|
}
|
|
1011
1011
|
})
|
|
1012
|
-
));
|
|
1012
|
+
)) : this.connected = !1;
|
|
1013
1013
|
}
|
|
1014
1014
|
handleWscMessage(e) {
|
|
1015
1015
|
var a;
|
|
1016
1016
|
if ((e == null ? void 0 : e.type) !== "ack")
|
|
1017
1017
|
switch (this.lastConversationUpdate = Date.now(), e == null ? void 0 : e.type) {
|
|
1018
1018
|
case "message": {
|
|
1019
|
-
if (
|
|
1020
|
-
this.streamingResponseInProgress ? (this.finishStreamingResponse(e.text), this.streamingResponseInProgress = !1) : (this.replyMessage.data.text = e.text, this.updateMessage(this.replyMessage, "")), this.replyMessage = null;
|
|
1021
|
-
else {
|
|
1019
|
+
if ((e == null ? void 0 : e.author) === "user") {
|
|
1022
1020
|
const n = {
|
|
1023
1021
|
id: (e == null ? void 0 : e.id) || null,
|
|
1024
1022
|
type: "text",
|
|
1025
|
-
author: "
|
|
1023
|
+
author: "user",
|
|
1026
1024
|
data: {
|
|
1027
1025
|
text: e.text
|
|
1028
1026
|
}
|
|
1029
1027
|
};
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1028
|
+
this.replyMessage ? this.insertMessage(n, -1) : this.addMessage(n);
|
|
1029
|
+
} else {
|
|
1030
|
+
if (this.replyMessage)
|
|
1031
|
+
this.streamingResponseInProgress ? (this.finishStreamingResponse(e.text), this.streamingResponseInProgress = !1) : (this.replyMessage.data.text = e.text, this.updateMessage(this.replyMessage, "")), this.replyMessage = null;
|
|
1032
|
+
else {
|
|
1033
|
+
const n = {
|
|
1034
|
+
id: (e == null ? void 0 : e.id) || null,
|
|
1035
|
+
type: "text",
|
|
1036
|
+
author: "assistant",
|
|
1037
|
+
data: {
|
|
1038
|
+
text: e.text
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
"userName" in e && (n.data.userName = e.userName), "userAvatar" in e && (n.data.userAvatar = e.userAvatar);
|
|
1042
|
+
const s = this.formatMessage(n);
|
|
1043
|
+
this.messages = this.messages.concat([s]);
|
|
1044
|
+
}
|
|
1045
|
+
this.open || (this.unreadMessages++, this.playAudioNotification());
|
|
1033
1046
|
}
|
|
1034
|
-
this.open || (this.unreadMessages++, this.playAudioNotification());
|
|
1035
1047
|
break;
|
|
1036
1048
|
}
|
|
1037
1049
|
case "message-chunk": {
|
|
@@ -1200,6 +1212,10 @@ class L extends kt {
|
|
|
1200
1212
|
addMessage(e) {
|
|
1201
1213
|
e = this.formatMessage(e), this.messages = this.messages.concat([e]);
|
|
1202
1214
|
}
|
|
1215
|
+
// insert message
|
|
1216
|
+
insertMessage(e, a = -1) {
|
|
1217
|
+
e = this.formatMessage(e), this.messages.length === 0 ? this.messages = [e] : this.messages = [...this.messages.slice(0, -1), e, ...this.messages.slice(-1)];
|
|
1218
|
+
}
|
|
1203
1219
|
addSystemMessage(e) {
|
|
1204
1220
|
this.addMessage({
|
|
1205
1221
|
type: "text",
|
|
@@ -1228,7 +1244,7 @@ class L extends kt {
|
|
|
1228
1244
|
A.info("submitForm: No form is active - ignored");
|
|
1229
1245
|
return;
|
|
1230
1246
|
}
|
|
1231
|
-
const a = `${
|
|
1247
|
+
const a = `${ee}${this.setting.botId}.${this.conversationId}.form.${this.form.name}`;
|
|
1232
1248
|
await this.sendFormData(this.form.name, e), localStorage.setItem(a, JSON.stringify(e)), "name" in e && (this.feedbackName = e.name), "email" in e && (this.feedbackEmail = e.email), this.form = null;
|
|
1233
1249
|
}
|
|
1234
1250
|
async sendFormData(e, a) {
|
|
@@ -1333,42 +1349,42 @@ class L extends kt {
|
|
|
1333
1349
|
}
|
|
1334
1350
|
}
|
|
1335
1351
|
O([
|
|
1336
|
-
oe({ prefix:
|
|
1352
|
+
oe({ prefix: ee }),
|
|
1337
1353
|
q({ value: "en" })
|
|
1338
1354
|
], L.prototype, "language");
|
|
1339
1355
|
O([
|
|
1340
|
-
oe({ prefix:
|
|
1356
|
+
oe({ prefix: ee }),
|
|
1341
1357
|
q({ value: "light" })
|
|
1342
1358
|
], L.prototype, "theme");
|
|
1343
1359
|
O([
|
|
1344
|
-
oe({ prefix:
|
|
1360
|
+
oe({ prefix: ee }),
|
|
1345
1361
|
q({ type: Boolean, value: !1 })
|
|
1346
1362
|
], L.prototype, "open");
|
|
1347
1363
|
O([
|
|
1348
1364
|
q({ type: Boolean, value: !1 })
|
|
1349
1365
|
], L.prototype, "alwaysOpen");
|
|
1350
1366
|
O([
|
|
1351
|
-
oe({ prefix:
|
|
1367
|
+
oe({ prefix: ee }),
|
|
1352
1368
|
q({ value: "false" })
|
|
1353
1369
|
], L.prototype, "connectWs");
|
|
1354
1370
|
O([
|
|
1355
|
-
oe({ prefix:
|
|
1371
|
+
oe({ prefix: ee }),
|
|
1356
1372
|
q({ value: xe() })
|
|
1357
1373
|
], L.prototype, "conversationId");
|
|
1358
1374
|
O([
|
|
1359
|
-
oe({ prefix:
|
|
1375
|
+
oe({ prefix: ee }),
|
|
1360
1376
|
q({ value: 0 })
|
|
1361
1377
|
], L.prototype, "lastConversationUpdate");
|
|
1362
1378
|
O([
|
|
1363
|
-
oe({ prefix:
|
|
1379
|
+
oe({ prefix: ee }),
|
|
1364
1380
|
q({ type: Array, value: [] })
|
|
1365
1381
|
], L.prototype, "messages");
|
|
1366
1382
|
O([
|
|
1367
|
-
oe({ prefix:
|
|
1383
|
+
oe({ prefix: ee }),
|
|
1368
1384
|
q({ value: 0 })
|
|
1369
1385
|
], L.prototype, "unreadMessages");
|
|
1370
1386
|
O([
|
|
1371
|
-
oe({ prefix:
|
|
1387
|
+
oe({ prefix: ee }),
|
|
1372
1388
|
q({
|
|
1373
1389
|
type: Array,
|
|
1374
1390
|
value: []
|
|
@@ -1431,14 +1447,17 @@ O([
|
|
|
1431
1447
|
q({ type: Boolean, value: !1 })
|
|
1432
1448
|
], L.prototype, "connecting");
|
|
1433
1449
|
O([
|
|
1434
|
-
|
|
1450
|
+
q({ type: Boolean, value: !1 })
|
|
1451
|
+
], L.prototype, "connected");
|
|
1452
|
+
O([
|
|
1453
|
+
oe({ prefix: ee }),
|
|
1435
1454
|
q({ value: "true" })
|
|
1436
1455
|
], L.prototype, "shouldEngage");
|
|
1437
1456
|
O([
|
|
1438
1457
|
q({ type: Boolean, value: !1 })
|
|
1439
1458
|
], L.prototype, "engage");
|
|
1440
1459
|
O([
|
|
1441
|
-
oe({ prefix:
|
|
1460
|
+
oe({ prefix: ee }),
|
|
1442
1461
|
q({
|
|
1443
1462
|
type: Object,
|
|
1444
1463
|
value: {
|
|
@@ -1454,7 +1473,7 @@ O([
|
|
|
1454
1473
|
})
|
|
1455
1474
|
], L.prototype, "setting");
|
|
1456
1475
|
O([
|
|
1457
|
-
oe({ prefix:
|
|
1476
|
+
oe({ prefix: ee }),
|
|
1458
1477
|
q({ type: Object, value: null })
|
|
1459
1478
|
], L.prototype, "context");
|
|
1460
1479
|
O([
|
|
@@ -1488,11 +1507,11 @@ O([
|
|
|
1488
1507
|
q({ type: Array, value: [] })
|
|
1489
1508
|
], L.prototype, "feedbackMessages");
|
|
1490
1509
|
O([
|
|
1491
|
-
oe({ prefix:
|
|
1510
|
+
oe({ prefix: ee }),
|
|
1492
1511
|
q({ type: String, value: "" })
|
|
1493
1512
|
], L.prototype, "feedbackName");
|
|
1494
1513
|
O([
|
|
1495
|
-
oe({ prefix:
|
|
1514
|
+
oe({ prefix: ee }),
|
|
1496
1515
|
q({ type: String, value: "" })
|
|
1497
1516
|
], L.prototype, "feedbackEmail");
|
|
1498
1517
|
const p = new L(), fc = X`
|
|
@@ -1578,7 +1597,7 @@ var lc = Object.defineProperty, bc = (c, e, a, n) => {
|
|
|
1578
1597
|
Ba("system", {
|
|
1579
1598
|
resolver: (c) => ""
|
|
1580
1599
|
});
|
|
1581
|
-
class
|
|
1600
|
+
class te extends ut {
|
|
1582
1601
|
constructor() {
|
|
1583
1602
|
super(...arguments), this.lang = "en";
|
|
1584
1603
|
}
|
|
@@ -1595,14 +1614,14 @@ class ae extends ut {
|
|
|
1595
1614
|
}
|
|
1596
1615
|
bc([
|
|
1597
1616
|
v({ type: String })
|
|
1598
|
-
],
|
|
1617
|
+
], te.prototype, "lang");
|
|
1599
1618
|
var hc = Object.defineProperty, uc = Object.getOwnPropertyDescriptor, na = (c, e, a, n) => {
|
|
1600
1619
|
for (var s = n > 1 ? void 0 : n ? uc(e, a) : e, r = c.length - 1, f; r >= 0; r--)
|
|
1601
1620
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
1602
1621
|
return n && s && hc(e, a, s), s;
|
|
1603
1622
|
};
|
|
1604
1623
|
const pc = '<svg viewBox="0 0 16 16" width="16px" height="16px"><path fill="currentColor" d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"></path></svg>';
|
|
1605
|
-
let ot = class extends
|
|
1624
|
+
let ot = class extends te {
|
|
1606
1625
|
constructor() {
|
|
1607
1626
|
super(...arguments), this.title = "ChatBot";
|
|
1608
1627
|
}
|
|
@@ -1613,13 +1632,13 @@ let ot = class extends ae {
|
|
|
1613
1632
|
*/
|
|
1614
1633
|
renderExp() {
|
|
1615
1634
|
return g` <header class="cb-header" part="header">
|
|
1616
|
-
${
|
|
1635
|
+
${ie(
|
|
1617
1636
|
p.setting.logoUrl !== "",
|
|
1618
1637
|
() => g`<img class="cb-header-logo" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1619
1638
|
() => g`<div class="cb-header-logo" part="header-logo">${W(p.setting.logoSvg)}</div>`
|
|
1620
1639
|
)}
|
|
1621
1640
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1622
|
-
${
|
|
1641
|
+
${ie(
|
|
1623
1642
|
p.alwaysOpen,
|
|
1624
1643
|
() => g``,
|
|
1625
1644
|
() => g`<div class="cb-header-close" part="header-close">${W(pc)}</div>`
|
|
@@ -1628,13 +1647,13 @@ let ot = class extends ae {
|
|
|
1628
1647
|
}
|
|
1629
1648
|
render() {
|
|
1630
1649
|
return g` <header class="cb-header" part="header">
|
|
1631
|
-
${
|
|
1650
|
+
${ie(
|
|
1632
1651
|
p.setting.logoUrl !== "",
|
|
1633
1652
|
() => g`<img class="cb-header-img" part="header-logo" src="${p.setting.logoUrl}" />`,
|
|
1634
1653
|
() => g`<div class="cb-header-logo" part="header-logo">${W(p.setting.logoSvg)}</div>`
|
|
1635
1654
|
)}
|
|
1636
1655
|
<div class="cb-header-title" part="header-title">${this.title}</div>
|
|
1637
|
-
${
|
|
1656
|
+
${ie(
|
|
1638
1657
|
p.alwaysOpen,
|
|
1639
1658
|
() => g`<div></div>`,
|
|
1640
1659
|
() => g`<div @click=${this._clickCloseHandler} class="cb-header-close" part="header-close">${W(p.setting.closeSvg)}</div>`
|
|
@@ -1691,7 +1710,7 @@ var mc = Object.defineProperty, yc = Object.getOwnPropertyDescriptor, vc = (c, e
|
|
|
1691
1710
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
1692
1711
|
return n && s && mc(e, a, s), s;
|
|
1693
1712
|
};
|
|
1694
|
-
let Ct = class extends
|
|
1713
|
+
let Ct = class extends te {
|
|
1695
1714
|
constructor() {
|
|
1696
1715
|
super(...arguments), this.year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
1697
1716
|
}
|
|
@@ -2443,7 +2462,7 @@ var sa = { exports: {} };
|
|
|
2443
2462
|
typeof o == "function" && o.apply(this.el, arguments);
|
|
2444
2463
|
}
|
|
2445
2464
|
} }]);
|
|
2446
|
-
function
|
|
2465
|
+
function ae(t, i) {
|
|
2447
2466
|
var o = new Ma(t);
|
|
2448
2467
|
return o.add(i), o;
|
|
2449
2468
|
}
|
|
@@ -2451,7 +2470,7 @@ var sa = { exports: {} };
|
|
|
2451
2470
|
s(this, t), this.element = typeof i == "string" ? document.querySelector(i) : i, this.start = this.start.bind(this), this.move = this.move.bind(this), this.end = this.end.bind(this), this.cancel = this.cancel.bind(this), this.element.addEventListener("touchstart", this.start, !1), this.element.addEventListener("touchmove", this.move, !1), this.element.addEventListener("touchend", this.end, !1), this.element.addEventListener("touchcancel", this.cancel, !1), this.preV = { x: null, y: null }, this.pinchStartLen = null, this.zoom = 1, this.isDoubleTap = !1;
|
|
2452
2471
|
var d = function() {
|
|
2453
2472
|
};
|
|
2454
|
-
this.rotate =
|
|
2473
|
+
this.rotate = ae(this.element, o.rotate || d), this.touchStart = ae(this.element, o.touchStart || d), this.multipointStart = ae(this.element, o.multipointStart || d), this.multipointEnd = ae(this.element, o.multipointEnd || d), this.pinch = ae(this.element, o.pinch || d), this.swipe = ae(this.element, o.swipe || d), this.tap = ae(this.element, o.tap || d), this.doubleTap = ae(this.element, o.doubleTap || d), this.longTap = ae(this.element, o.longTap || d), this.singleTap = ae(this.element, o.singleTap || d), this.pressMove = ae(this.element, o.pressMove || d), this.twoFingerPressMove = ae(this.element, o.twoFingerPressMove || d), this.touchMove = ae(this.element, o.touchMove || d), this.touchEnd = ae(this.element, o.touchEnd || d), this.touchCancel = ae(this.element, o.touchCancel || d), this.translateContainer = this.element, this._cancelAllHandler = this.cancelAll.bind(this), window.addEventListener("scroll", this._cancelAllHandler), this.delta = null, this.last = null, this.now = null, this.tapTimeout = null, this.singleTapTimeout = null, this.longTapTimeout = null, this.swipeTimeout = null, this.x1 = this.x2 = this.y1 = this.y2 = null, this.preTapPosition = { x: null, y: null };
|
|
2455
2474
|
}, [{ key: "start", value: function(t) {
|
|
2456
2475
|
if (t.touches) if (t.target && t.target.nodeName && ["a", "button", "input"].indexOf(t.target.nodeName.toLowerCase()) >= 0) console.log("ignore drag for this touched element", t.target.nodeName.toLowerCase());
|
|
2457
2476
|
else {
|
|
@@ -2530,8 +2549,8 @@ var sa = { exports: {} };
|
|
|
2530
2549
|
}, touchMove: function(B) {
|
|
2531
2550
|
if (u && (Oe = B.targetTouches[0], !I && !U)) {
|
|
2532
2551
|
if (d && d.offsetHeight > b) {
|
|
2533
|
-
var
|
|
2534
|
-
if (Math.abs(
|
|
2552
|
+
var ce = pe.pageX - Oe.pageX;
|
|
2553
|
+
if (Math.abs(ce) <= 13) return !1;
|
|
2535
2554
|
}
|
|
2536
2555
|
k = !0;
|
|
2537
2556
|
var $e, it = B.targetTouches[0].clientX, Oa = B.targetTouches[0].clientY, Pa = Rt - it, za = Vt - Oa;
|
|
@@ -2541,8 +2560,8 @@ var sa = { exports: {} };
|
|
|
2541
2560
|
}, touchEnd: function() {
|
|
2542
2561
|
if (u) {
|
|
2543
2562
|
if (k = !1, U || I) return G = fe, void (_e = de);
|
|
2544
|
-
var B = Math.abs(parseInt(Re)),
|
|
2545
|
-
if (!(B > 29 && x)) return B < 29 &&
|
|
2563
|
+
var B = Math.abs(parseInt(Re)), ce = Math.abs(parseInt(ue));
|
|
2564
|
+
if (!(B > 29 && x)) return B < 29 && ce < 25 ? (T(ct, "greset"), ct.style.opacity = 1, yt(m)) : void 0;
|
|
2546
2565
|
t.close();
|
|
2547
2566
|
}
|
|
2548
2567
|
}, multipointEnd: function() {
|
|
@@ -2554,14 +2573,14 @@ var sa = { exports: {} };
|
|
|
2554
2573
|
}, pinch: function(B) {
|
|
2555
2574
|
if (!x || k) return !1;
|
|
2556
2575
|
I = !0, x.scaleX = x.scaleY = M * B.zoom;
|
|
2557
|
-
var
|
|
2558
|
-
if (U = !0,
|
|
2559
|
-
|
|
2576
|
+
var ce = M * B.zoom;
|
|
2577
|
+
if (U = !0, ce <= 1) return U = !1, ce = 1, _e = null, G = null, fe = null, de = null, void x.setAttribute("style", "");
|
|
2578
|
+
ce > 4.5 && (ce = 4.5), x.style.transform = "scale3d(".concat(ce, ", ").concat(ce, ", 1)"), E = ce;
|
|
2560
2579
|
}, pressMove: function(B) {
|
|
2561
2580
|
if (U && !I) {
|
|
2562
|
-
var
|
|
2563
|
-
G && (
|
|
2564
|
-
var it = "translate3d(".concat(
|
|
2581
|
+
var ce = Oe.pageX - pe.pageX, $e = Oe.pageY - pe.pageY;
|
|
2582
|
+
G && (ce += G), _e && ($e += _e), fe = ce, de = $e;
|
|
2583
|
+
var it = "translate3d(".concat(ce, "px, ").concat($e, "px, 0)");
|
|
2565
2584
|
E && (it += " scale3d(".concat(E, ", ").concat(E, ", 1)")), C(x, it);
|
|
2566
2585
|
}
|
|
2567
2586
|
}, swipe: function(B) {
|
|
@@ -2956,7 +2975,7 @@ var $c = Object.defineProperty, Mc = Object.getOwnPropertyDescriptor, oa = (c, e
|
|
|
2956
2975
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
2957
2976
|
return n && s && $c(e, a, s), s;
|
|
2958
2977
|
};
|
|
2959
|
-
let rt = class extends
|
|
2978
|
+
let rt = class extends te {
|
|
2960
2979
|
constructor() {
|
|
2961
2980
|
super(...arguments), this.files = [];
|
|
2962
2981
|
}
|
|
@@ -3091,7 +3110,7 @@ const Nt = {
|
|
|
3091
3110
|
doc: zc,
|
|
3092
3111
|
docx: jc
|
|
3093
3112
|
};
|
|
3094
|
-
let Je = class extends
|
|
3113
|
+
let Je = class extends te {
|
|
3095
3114
|
constructor() {
|
|
3096
3115
|
super(...arguments), this.filename = "", this.url = "";
|
|
3097
3116
|
}
|
|
@@ -4606,7 +4625,7 @@ var Nc = Object.defineProperty, Uc = Object.getOwnPropertyDescriptor, Ne = (c, e
|
|
|
4606
4625
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
4607
4626
|
return n && s && Nc(e, a, s), s;
|
|
4608
4627
|
};
|
|
4609
|
-
let Te = class extends
|
|
4628
|
+
let Te = class extends te {
|
|
4610
4629
|
constructor() {
|
|
4611
4630
|
super(...arguments), this.store = new pt(this, p), this.type = "assistant", this.suppressFeedback = !1, this.lightbox = kc({
|
|
4612
4631
|
touchNavigation: !0,
|
|
@@ -4689,12 +4708,12 @@ let Te = class extends ae {
|
|
|
4689
4708
|
});
|
|
4690
4709
|
}
|
|
4691
4710
|
render() {
|
|
4692
|
-
return
|
|
4711
|
+
return ie(
|
|
4693
4712
|
this.message.data || this.message.isThinking,
|
|
4694
4713
|
() => g`
|
|
4695
4714
|
<div class="cb-message-row" part="bot-message">
|
|
4696
4715
|
<!-- message -->
|
|
4697
|
-
${
|
|
4716
|
+
${ie(
|
|
4698
4717
|
this._isBot,
|
|
4699
4718
|
() => this.renderBotMessage(this.message),
|
|
4700
4719
|
() => this.renderUserMessage(this.message)
|
|
@@ -4727,12 +4746,12 @@ let Te = class extends ae {
|
|
|
4727
4746
|
`;
|
|
4728
4747
|
}
|
|
4729
4748
|
async _getMessageText(c) {
|
|
4730
|
-
return
|
|
4749
|
+
return Yt(c.data.text);
|
|
4731
4750
|
}
|
|
4732
4751
|
renderMessageContent(c) {
|
|
4733
4752
|
var e;
|
|
4734
4753
|
return c.isThinking ? g`<cb-thinking></cb-thinking>` : c.isUploading ? g`<cb-uploading .files="${c.data.files || []}"></cb-uploading>` : c.type === "text" ? g`<div class="cb-message-text">
|
|
4735
|
-
${
|
|
4754
|
+
${ie(
|
|
4736
4755
|
c.data.userName,
|
|
4737
4756
|
() => g`<div class="assistant-message-user-name">${c.data.userName}</div>`,
|
|
4738
4757
|
() => null
|
|
@@ -4768,9 +4787,9 @@ let Te = class extends ae {
|
|
|
4768
4787
|
var e;
|
|
4769
4788
|
if (c.data.userName && c.data.userName !== "") {
|
|
4770
4789
|
const a = ((e = c.data) == null ? void 0 : e.userAvatar) || "";
|
|
4771
|
-
return a !== "" ? g` <img src="${a}" style="width: 24px;height: 24px;" /> ` :
|
|
4790
|
+
return a !== "" ? g` <img src="${a}" style="width: 24px;height: 24px;" /> ` : le`${W(p.setting.agentIconSvg)}`;
|
|
4772
4791
|
}
|
|
4773
|
-
return c.author === "system" ?
|
|
4792
|
+
return c.author === "system" ? le`${W(p.setting.systemIconSvg)}` : le`${W(p.setting.botIconSvg)}`;
|
|
4774
4793
|
}
|
|
4775
4794
|
renderBotMessage(c) {
|
|
4776
4795
|
return g`
|
|
@@ -4784,8 +4803,8 @@ let Te = class extends ae {
|
|
|
4784
4803
|
renderBotMessageFeedback(c) {
|
|
4785
4804
|
return this.suppressFeedback || !p.setting.feedbackEnabled ? null : g`
|
|
4786
4805
|
<div class="cb-message-feedback-tools">
|
|
4787
|
-
<div class="cb-message-feedback-icon cb-feedback-up" @click="${() => this.startFeedback(!0, c)}">${
|
|
4788
|
-
<div class="cb-message-feedback-icon cb-feedback-down" @click="${() => this.startFeedback(!1, c)}">${
|
|
4806
|
+
<div class="cb-message-feedback-icon cb-feedback-up" @click="${() => this.startFeedback(!0, c)}">${le`${W(ra)}`}</div>
|
|
4807
|
+
<div class="cb-message-feedback-icon cb-feedback-down" @click="${() => this.startFeedback(!1, c)}">${le`${W(da)}`}</div>
|
|
4789
4808
|
</div>
|
|
4790
4809
|
`;
|
|
4791
4810
|
}
|
|
@@ -4799,7 +4818,7 @@ let Te = class extends ae {
|
|
|
4799
4818
|
<cb-icon slot="icon" svg="${Ut}" color="white"></cb-icon>
|
|
4800
4819
|
//appState.appearanceUserMessageAvatarPosition
|
|
4801
4820
|
</sl-avatar>-->
|
|
4802
|
-
${
|
|
4821
|
+
${ie(
|
|
4803
4822
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4804
4823
|
() => g`
|
|
4805
4824
|
<div class="avatar user-avatar">${W(p.setting.userIconSvg)}</div>
|
|
@@ -4822,7 +4841,7 @@ let Te = class extends ae {
|
|
|
4822
4841
|
<cb-icon slot="icon" svg="${Ut}" color="white"></cb-icon>
|
|
4823
4842
|
//appState.appearanceUserMessageAvatarPosition
|
|
4824
4843
|
</sl-avatar>-->
|
|
4825
|
-
${
|
|
4844
|
+
${ie(
|
|
4826
4845
|
p.appearanceUserMessageAvatarPosition === "left",
|
|
4827
4846
|
() => g`
|
|
4828
4847
|
<div class="avatar user-avatar">${W(p.setting.userIconSvg)}</div>
|
|
@@ -4863,7 +4882,7 @@ var Wc = Object.defineProperty, Yc = Object.getOwnPropertyDescriptor, ye = (c, e
|
|
|
4863
4882
|
};
|
|
4864
4883
|
const we = Ke.noConflict();
|
|
4865
4884
|
we.setLevel("info");
|
|
4866
|
-
let
|
|
4885
|
+
let be = class extends te {
|
|
4867
4886
|
constructor() {
|
|
4868
4887
|
super(...arguments), this.messages = [], this.actions = [], this.form = null, this.suppressFeedback = !1, this.calendlyInjected = !1, this.activeCalendlyAction = -1, this.hubspotMeetingInjected = !1, this.activeHubspotMeetingAction = -1;
|
|
4869
4888
|
}
|
|
@@ -4933,7 +4952,7 @@ let le = class extends ae {
|
|
|
4933
4952
|
return a || n[0], g`<div class="cb-form-field">
|
|
4934
4953
|
<label class="cb-form-field-label"
|
|
4935
4954
|
>${c.title}
|
|
4936
|
-
${
|
|
4955
|
+
${ie(
|
|
4937
4956
|
e,
|
|
4938
4957
|
() => g`*`,
|
|
4939
4958
|
() => g``
|
|
@@ -5141,37 +5160,37 @@ let le = class extends ae {
|
|
|
5141
5160
|
`;
|
|
5142
5161
|
}
|
|
5143
5162
|
};
|
|
5144
|
-
|
|
5163
|
+
be.styles = wc;
|
|
5145
5164
|
ye([
|
|
5146
5165
|
v({ type: Array })
|
|
5147
|
-
],
|
|
5166
|
+
], be.prototype, "messages", 2);
|
|
5148
5167
|
ye([
|
|
5149
5168
|
v({ type: Array })
|
|
5150
|
-
],
|
|
5169
|
+
], be.prototype, "actions", 2);
|
|
5151
5170
|
ye([
|
|
5152
5171
|
v({ type: Object })
|
|
5153
|
-
],
|
|
5172
|
+
], be.prototype, "form", 2);
|
|
5154
5173
|
ye([
|
|
5155
5174
|
v({ type: Boolean })
|
|
5156
|
-
],
|
|
5175
|
+
], be.prototype, "suppressFeedback", 2);
|
|
5157
5176
|
ye([
|
|
5158
5177
|
ke("#cb-message-list-bottom-anchor")
|
|
5159
|
-
],
|
|
5178
|
+
], be.prototype, "_messageListBottomAnchor", 2);
|
|
5160
5179
|
ye([
|
|
5161
5180
|
ke(".cb-input-form")
|
|
5162
|
-
],
|
|
5181
|
+
], be.prototype, "_inputForm", 2);
|
|
5163
5182
|
ye([
|
|
5164
5183
|
Mt({ capture: !1, passive: !0 })
|
|
5165
|
-
],
|
|
5184
|
+
], be.prototype, "invokeLinkAction", 1);
|
|
5166
5185
|
ye([
|
|
5167
5186
|
Mt({ capture: !1, passive: !0 })
|
|
5168
|
-
],
|
|
5187
|
+
], be.prototype, "invokeCalendlyAction", 1);
|
|
5169
5188
|
ye([
|
|
5170
5189
|
Mt({ capture: !1, passive: !0 })
|
|
5171
|
-
],
|
|
5172
|
-
|
|
5190
|
+
], be.prototype, "invokeHubspotMeetingAction", 1);
|
|
5191
|
+
be = ye([
|
|
5173
5192
|
J("cb-message-list")
|
|
5174
|
-
],
|
|
5193
|
+
], be);
|
|
5175
5194
|
const Xc = X`
|
|
5176
5195
|
${me}
|
|
5177
5196
|
|
|
@@ -5220,7 +5239,7 @@ var Jc = Object.defineProperty, Kc = Object.getOwnPropertyDescriptor, Ce = (c, e
|
|
|
5220
5239
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5221
5240
|
return n && s && Jc(e, a, s), s;
|
|
5222
5241
|
};
|
|
5223
|
-
let he = class extends
|
|
5242
|
+
let he = class extends te {
|
|
5224
5243
|
constructor() {
|
|
5225
5244
|
super(...arguments), this.placeholder = "Type a message...", this.sendButtonLabel = "Send", this.enableFileUpload = !1, this.value = "", this.loading = !1, this.disabled = !1, this.currentKey = "";
|
|
5226
5245
|
}
|
|
@@ -5265,7 +5284,7 @@ let he = class extends ae {
|
|
|
5265
5284
|
}
|
|
5266
5285
|
render() {
|
|
5267
5286
|
return g`
|
|
5268
|
-
${
|
|
5287
|
+
${ie(
|
|
5269
5288
|
this.loading,
|
|
5270
5289
|
() => g`<sl-progress-bar style="--height: 2px;" indeterminate></sl-progress-bar>`,
|
|
5271
5290
|
() => g``
|
|
@@ -5291,7 +5310,7 @@ let he = class extends ae {
|
|
|
5291
5310
|
<sl-button @click=${this._sendHandler} name="send" label="Send" size="small" class="send-button" variant="text" ?disabled=${this.value.length === 0} ?loading=${this.loading} circle>
|
|
5292
5311
|
<cb-icon svg="${Gc}"></cb-icon>
|
|
5293
5312
|
</sl-button>
|
|
5294
|
-
${
|
|
5313
|
+
${ie(
|
|
5295
5314
|
this.enableFileUpload,
|
|
5296
5315
|
() => g`
|
|
5297
5316
|
<sl-button @click=${this._sendFileHandler} name="paperclip" label="Attachment" size="small" class="paperclip-button" variant="text" circle>
|
|
@@ -5378,7 +5397,7 @@ var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, gt = (c, e
|
|
|
5378
5397
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5379
5398
|
return n && s && ei(e, a, s), s;
|
|
5380
5399
|
};
|
|
5381
|
-
let Fe = class extends
|
|
5400
|
+
let Fe = class extends te {
|
|
5382
5401
|
constructor() {
|
|
5383
5402
|
super(...arguments), this.open = !1, this.label = "Dialog", this.zindex = 100;
|
|
5384
5403
|
}
|
|
@@ -5440,7 +5459,7 @@ var ai = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, la = (c, e
|
|
|
5440
5459
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5441
5460
|
return n && s && ai(e, a, s), s;
|
|
5442
5461
|
};
|
|
5443
|
-
let dt = class extends
|
|
5462
|
+
let dt = class extends te {
|
|
5444
5463
|
constructor() {
|
|
5445
5464
|
super(...arguments), this.open = !1;
|
|
5446
5465
|
}
|
|
@@ -5553,7 +5572,7 @@ var ni = Object.defineProperty, si = Object.getOwnPropertyDescriptor, Ue = (c, e
|
|
|
5553
5572
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5554
5573
|
return n && s && ni(e, a, s), s;
|
|
5555
5574
|
};
|
|
5556
|
-
let Ee = class extends
|
|
5575
|
+
let Ee = class extends te {
|
|
5557
5576
|
constructor() {
|
|
5558
5577
|
super(...arguments), this.open = !1, this.clearMessageDialogOpen = !1, this.customRequest = !1;
|
|
5559
5578
|
}
|
|
@@ -5586,7 +5605,7 @@ let Ee = class extends ae {
|
|
|
5586
5605
|
Enable it for your own backend.
|
|
5587
5606
|
</sl-switch>
|
|
5588
5607
|
</div> -->
|
|
5589
|
-
${
|
|
5608
|
+
${ie(
|
|
5590
5609
|
this.customRequest,
|
|
5591
5610
|
() => null,
|
|
5592
5611
|
() => this.renderInternalServices()
|
|
@@ -5811,7 +5830,7 @@ var ri = Object.defineProperty, di = Object.getOwnPropertyDescriptor, ba = (c, e
|
|
|
5811
5830
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5812
5831
|
return n && s && ri(e, a, s), s;
|
|
5813
5832
|
};
|
|
5814
|
-
let ft = class extends
|
|
5833
|
+
let ft = class extends te {
|
|
5815
5834
|
constructor() {
|
|
5816
5835
|
super(...arguments), this.store = new pt(this, p), this.open = !1;
|
|
5817
5836
|
}
|
|
@@ -5842,31 +5861,29 @@ let ft = class extends ae {
|
|
|
5842
5861
|
let c = "danger";
|
|
5843
5862
|
return c = p.appearanceAnchorBadgeVariant, c;
|
|
5844
5863
|
}
|
|
5864
|
+
renderPopupLogo() {
|
|
5865
|
+
return p.setting.popupLogoUrl !== "" ? g`<img class="cb-engage-popup-img" src="${p.setting.popupLogoUrl}" />` : p.setting.popupLogoSvg !== "" ? g`<div class="cb-engage-popup-logo">${le`${W(p.setting.popupLogoSvg)}`}</div>` : p.setting.logoUrl !== "" ? g`<img class="cb-engage-popup-img" src="${p.setting.logoUrl}" />` : p.setting.logoSvg !== "" ? g`<div class="cb-engage-popup-logo">${le`${W(p.setting.logoSvg)}`}</div>` : null;
|
|
5866
|
+
}
|
|
5845
5867
|
render() {
|
|
5846
5868
|
return g`
|
|
5847
5869
|
<div class="cb-anchor ${this.open ? "open" : ""}" part="anchor" @click=${this._clickHandler.bind(this)}>
|
|
5848
5870
|
<sl-popup placement="${this.getPopupPlacement()}" distance="16" ?active="${p.engage && !p.open}">
|
|
5849
5871
|
<sl-button slot="anchor" label="Start" size="large" variant="primary" class="anchor-button" circle>
|
|
5850
|
-
${
|
|
5872
|
+
${ie(
|
|
5851
5873
|
this.open,
|
|
5852
|
-
() => g`<div class="cb-anchor-icon" part="anchor-icon">${
|
|
5853
|
-
() => g`<div class="cb-anchor-icon" part="anchor-icon">${
|
|
5874
|
+
() => g`<div class="cb-anchor-icon" part="anchor-icon">${le`${W(p.setting.anchorCloseSvg)}`}</div>`,
|
|
5875
|
+
() => g`<div class="cb-anchor-icon" part="anchor-icon">${le`${W(p.setting.anchorOpenSvg)}`}</div>`
|
|
5854
5876
|
)}
|
|
5855
|
-
${
|
|
5877
|
+
${ie(
|
|
5856
5878
|
!this.open && p.unreadMessages > 0,
|
|
5857
5879
|
() => g`<sl-badge part="anchor-badge" class="cb-anchor-badge" variant="${this.getBadgeVariant()}" pill>${p.unreadMessages}</sl-badge>`,
|
|
5858
5880
|
() => null
|
|
5859
5881
|
)}
|
|
5860
5882
|
</sl-button>
|
|
5861
5883
|
<div class="cb-engage-popup">
|
|
5862
|
-
<div class="cb-engage-popup-close" @click=${this._engageClickHandler.bind(this)}>${
|
|
5884
|
+
<div class="cb-engage-popup-close" @click=${this._engageClickHandler.bind(this)}>${le`${W(fa)}`}</div>
|
|
5863
5885
|
<div class="cb-engage-popup-content">
|
|
5864
|
-
${
|
|
5865
|
-
p.setting.logoUrl !== "",
|
|
5866
|
-
() => g`<img class="cb-engage-popup-img" src="${p.setting.logoUrl}" />`,
|
|
5867
|
-
() => g`<div class="cb-engage-popup-logo">${be`${W(p.setting.logoSvg)}`}</div>`
|
|
5868
|
-
)}
|
|
5869
|
-
<!--<cb-icon class="cb-engage-popup-logo" svg="${p.setting.logoSvg}"></cb-icon>-->
|
|
5886
|
+
${this.renderPopupLogo()}
|
|
5870
5887
|
<div>${p.setting.engageMessage}</div>
|
|
5871
5888
|
</div>
|
|
5872
5889
|
</div>
|
|
@@ -5912,7 +5929,7 @@ const Gt = {
|
|
|
5912
5929
|
icon: hi
|
|
5913
5930
|
}
|
|
5914
5931
|
};
|
|
5915
|
-
let lt = class extends
|
|
5932
|
+
let lt = class extends te {
|
|
5916
5933
|
constructor() {
|
|
5917
5934
|
super(...arguments), this.status = "info";
|
|
5918
5935
|
}
|
|
@@ -5933,7 +5950,7 @@ var gi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, yi = (c, e
|
|
|
5933
5950
|
(f = c[r]) && (s = (n ? f(e, a, s) : f(s)) || s);
|
|
5934
5951
|
return n && s && gi(e, a, s), s;
|
|
5935
5952
|
};
|
|
5936
|
-
let _t = class extends
|
|
5953
|
+
let _t = class extends te {
|
|
5937
5954
|
render() {
|
|
5938
5955
|
return g` <sl-alert variant="danger" open>
|
|
5939
5956
|
<cb-status-icon status="error" slot="icon"></cb-status-icon>
|
|
@@ -6033,7 +6050,7 @@ var wi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, We = (c, e
|
|
|
6033
6050
|
return n && s && wi(e, a, s), s;
|
|
6034
6051
|
};
|
|
6035
6052
|
const Zt = Ke.noConflict(), ki = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>';
|
|
6036
|
-
let Ae = class extends
|
|
6053
|
+
let Ae = class extends te {
|
|
6037
6054
|
constructor() {
|
|
6038
6055
|
super(...arguments), this.store = new pt(this, p), this.zindex = 100;
|
|
6039
6056
|
}
|
|
@@ -6066,7 +6083,7 @@ let Ae = class extends ae {
|
|
|
6066
6083
|
p.feedbackScore = 0;
|
|
6067
6084
|
}}"
|
|
6068
6085
|
>
|
|
6069
|
-
${
|
|
6086
|
+
${le`${W(da)}`}
|
|
6070
6087
|
</div>
|
|
6071
6088
|
<sl-rating id="cb-feedback-rating-el" class="cb-feedback-rating" @sl-change="${this._ratingChangeHandler}" label="Rating" precision="1" .value=${p.feedbackScore}></sl-rating>
|
|
6072
6089
|
<div
|
|
@@ -6075,7 +6092,7 @@ let Ae = class extends ae {
|
|
|
6075
6092
|
p.feedbackScore = 5;
|
|
6076
6093
|
}}"
|
|
6077
6094
|
>
|
|
6078
|
-
${
|
|
6095
|
+
${le`${W(ra)}`}
|
|
6079
6096
|
</div>
|
|
6080
6097
|
</div>
|
|
6081
6098
|
<div style="display: flex">
|
|
@@ -6481,7 +6498,7 @@ var Ri = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, H = (c, e,
|
|
|
6481
6498
|
};
|
|
6482
6499
|
const Me = Ke.noConflict();
|
|
6483
6500
|
Me.setLevel("info");
|
|
6484
|
-
let j = class extends
|
|
6501
|
+
let j = class extends te {
|
|
6485
6502
|
constructor() {
|
|
6486
6503
|
super(...arguments), this.store = new pt(this, p), this.displayLicense = !1, this.name = "ChatBot", this.orgId = "", this.botId = "", this.url = "ws://localhost:3070", this.logoUrl = "", this.logoSvg = `<svg width="34" height="34" viewBox="0 0 400 400" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6487
6504
|
<g clip-path="url(#clip0_830_887)">
|
|
@@ -6569,12 +6586,12 @@ let j = class extends ae {
|
|
|
6569
6586
|
return p.form || p.disabled && this.alwaysOpen ? null : g`<cb-user-input
|
|
6570
6587
|
?loading=${p.connecting}
|
|
6571
6588
|
?disabled=${p.connecting || p.form}
|
|
6572
|
-
?enable-file-upload=${p.setting.uploadImages}
|
|
6589
|
+
?enable-file-upload=${p.setting.uploadImages && p.connected}
|
|
6573
6590
|
exportparts="user-input, user-input-wrapper, user-input-base, user-input-textarea"
|
|
6574
6591
|
></cb-user-input>`;
|
|
6575
6592
|
}
|
|
6576
6593
|
connectedCallback() {
|
|
6577
|
-
super.connectedCallback(), Me.info("connectedCallback"), this.initCssVariables(), addEventListener("c7o:bot:stateEvent", this.handleStateEvent), addEventListener("message:send", this.handleAddMessage), addEventListener("chatbot:toggle", this._chatbotToggleHandler), addEventListener("form:submit", this._formSubmitHandler), addEventListener("message:send:file", this.
|
|
6594
|
+
super.connectedCallback(), Me.info("connectedCallback"), this.initCssVariables(), addEventListener("c7o:bot:stateEvent", this.handleStateEvent), addEventListener("message:send", this.handleAddMessage), addEventListener("chatbot:toggle", this._chatbotToggleHandler), addEventListener("form:submit", this._formSubmitHandler), addEventListener("message:send:file", this._uploadFileHandler);
|
|
6578
6595
|
}
|
|
6579
6596
|
extractCssVariable(c, e, a) {
|
|
6580
6597
|
let n = c.getPropertyValue(e).trim();
|
|
@@ -6603,7 +6620,7 @@ let j = class extends ae {
|
|
|
6603
6620
|
|
|
6604
6621
|
*/
|
|
6605
6622
|
disconnectedCallback() {
|
|
6606
|
-
Me.info("disconnectedCallback"), super.disconnectedCallback(), window.removeEventListener("c7o:bot:stateEvent", this.handleStateEvent), window.removeEventListener("message:send", this.handleAddMessage), window.removeEventListener("chatbot:toggle", this._chatbotToggleHandler), window.removeEventListener("form:submit", this._formSubmitHandler);
|
|
6623
|
+
Me.info("disconnectedCallback"), super.disconnectedCallback(), window.removeEventListener("c7o:bot:stateEvent", this.handleStateEvent), window.removeEventListener("message:send", this.handleAddMessage), window.removeEventListener("chatbot:toggle", this._chatbotToggleHandler), window.removeEventListener("form:submit", this._formSubmitHandler), window.removeEventListener("message:send:file", this._uploadFileHandler);
|
|
6607
6624
|
}
|
|
6608
6625
|
// This is called when component is loaded, with all the settings (props) values
|
|
6609
6626
|
// Use to initialize
|
|
@@ -6723,7 +6740,7 @@ let j = class extends ae {
|
|
|
6723
6740
|
const e = c.detail;
|
|
6724
6741
|
p.removeMessage(e.id);
|
|
6725
6742
|
}
|
|
6726
|
-
async
|
|
6743
|
+
async _uploadFileHandler(c) {
|
|
6727
6744
|
const e = c.detail;
|
|
6728
6745
|
await p.uploadFiles(e.files);
|
|
6729
6746
|
}
|