deep-chat-dev 9.0.111 → 9.0.112
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/custom-elements.json +3060 -3060
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +352 -348
- package/dist/utils/HTTP/stream.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -435,7 +435,7 @@ var ln = "Make sure the events are using {text: string} or {html: string} format
|
|
435
435
|
return Gn;
|
436
436
|
}();
|
437
437
|
Hn.CODE_SNIPPET_GENERATION_JUMP = 0.5;
|
438
|
-
var
|
438
|
+
var Z = Hn;
|
439
439
|
var Vn = /*#__PURE__*/function () {
|
440
440
|
function Wn() {
|
441
441
|
_classCallCheck(this, Wn);
|
@@ -468,11 +468,11 @@ var Vn = /*#__PURE__*/function () {
|
|
468
468
|
}();
|
469
469
|
Vn.LOAD_VOICES_MS = 200;
|
470
470
|
var jt = Vn;
|
471
|
-
var
|
472
|
-
function
|
473
|
-
_classCallCheck(this,
|
471
|
+
var Ie = /*#__PURE__*/function () {
|
472
|
+
function Ie() {
|
473
|
+
_classCallCheck(this, Ie);
|
474
474
|
}
|
475
|
-
_createClass(
|
475
|
+
_createClass(Ie, null, [{
|
476
476
|
key: "checkForContainerStyles",
|
477
477
|
value: function checkForContainerStyles(e, t) {
|
478
478
|
var i = e.containerStyle;
|
@@ -510,13 +510,13 @@ var ke = /*#__PURE__*/function () {
|
|
510
510
|
(t = e.children[0]) != null && t.classList.contains("deep-chat-update-message") && (console.error('The "deep-chat-update-message" html class is deprecated since version 1.4.4.'), console.error("Please change to using {..., overwrite: true} object: https://deepchat.dev/docs/connect#Response"));
|
511
511
|
}
|
512
512
|
}]);
|
513
|
-
return
|
513
|
+
return Ie;
|
514
514
|
}();
|
515
515
|
var ii = /*#__PURE__*/function () {
|
516
|
-
function
|
517
|
-
_classCallCheck(this,
|
516
|
+
function Ee() {
|
517
|
+
_classCallCheck(this, Ee);
|
518
518
|
}
|
519
|
-
_createClass(
|
519
|
+
_createClass(Ee, null, [{
|
520
520
|
key: "getLastElementsByClass",
|
521
521
|
value: function getLastElementsByClass(e, t, i) {
|
522
522
|
var _loop = function _loop() {
|
@@ -557,8 +557,8 @@ var ii = /*#__PURE__*/function () {
|
|
557
557
|
}, {
|
558
558
|
key: "overwriteMessage",
|
559
559
|
value: function overwriteMessage(e, t, i, n, r, o) {
|
560
|
-
var a =
|
561
|
-
l =
|
560
|
+
var a = Ee.getLastElementsByClass(t, [Ee.getRoleClass(n), o], ["loading-message-text"]),
|
561
|
+
l = Ee.getLastMessage(e, n, r);
|
562
562
|
return l && (l[r] = i), a;
|
563
563
|
}
|
564
564
|
}, {
|
@@ -570,18 +570,18 @@ var ii = /*#__PURE__*/function () {
|
|
570
570
|
}, {
|
571
571
|
key: "fillEmptyMessageElement",
|
572
572
|
value: function fillEmptyMessageElement(e, t) {
|
573
|
-
t.trim().length === 0 && (e.classList.add(
|
573
|
+
t.trim().length === 0 && (e.classList.add(Ee.EMPTY_MESSAGE_CLASS), e.innerHTML = '<div style="color:#00000000">.</div>');
|
574
574
|
}
|
575
575
|
}, {
|
576
576
|
key: "unfillEmptyMessageElement",
|
577
577
|
value: function unfillEmptyMessageElement(e, t) {
|
578
|
-
e.classList.contains(
|
578
|
+
e.classList.contains(Ee.EMPTY_MESSAGE_CLASS) && t.trim().length > 0 && e.replaceChildren();
|
579
579
|
}
|
580
580
|
}, {
|
581
581
|
key: "getLastMessageBubbleElement",
|
582
582
|
value: function getLastMessageBubbleElement(e) {
|
583
583
|
var t, i, n;
|
584
|
-
return Array.from(((n = (i = (t =
|
584
|
+
return Array.from(((n = (i = (t = Ee.getLastMessageElement(e)) == null ? void 0 : t.children) == null ? void 0 : i[0]) == null ? void 0 : n.children) || []).find(function (r) {
|
585
585
|
return r.classList.contains("message-bubble");
|
586
586
|
});
|
587
587
|
}
|
@@ -591,17 +591,17 @@ var ii = /*#__PURE__*/function () {
|
|
591
591
|
return e.children[e.children.length - 1];
|
592
592
|
}
|
593
593
|
}]);
|
594
|
-
return
|
594
|
+
return Ee;
|
595
595
|
}();
|
596
596
|
ii.AI_ROLE = "ai";
|
597
597
|
ii.USER_ROLE = "user";
|
598
598
|
ii.EMPTY_MESSAGE_CLASS = "empty-message";
|
599
599
|
var v = ii;
|
600
|
-
var
|
601
|
-
function
|
602
|
-
_classCallCheck(this,
|
600
|
+
var Ce = /*#__PURE__*/function () {
|
601
|
+
function Ce() {
|
602
|
+
_classCallCheck(this, Ce);
|
603
603
|
}
|
604
|
-
_createClass(
|
604
|
+
_createClass(Ce, null, [{
|
605
605
|
key: "mouseUp",
|
606
606
|
value: function mouseUp(e, t) {
|
607
607
|
T.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
|
@@ -624,10 +624,10 @@ var Te = /*#__PURE__*/function () {
|
|
624
624
|
}, {
|
625
625
|
key: "add",
|
626
626
|
value: function add(e, t) {
|
627
|
-
e.addEventListener("mouseenter",
|
627
|
+
e.addEventListener("mouseenter", Ce.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", Ce.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", Ce.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", Ce.mouseUp.bind(this, e, t));
|
628
628
|
}
|
629
629
|
}]);
|
630
|
-
return
|
630
|
+
return Ce;
|
631
631
|
}();
|
632
632
|
var Ms = "deep-chat-temporary-message",
|
633
633
|
Ts = "deep-chat-suggestion-button",
|
@@ -732,7 +732,7 @@ var se = /*#__PURE__*/function () {
|
|
732
732
|
key: "applyStylesToElement",
|
733
733
|
value: function applyStylesToElement(e, t) {
|
734
734
|
var i = T.processStateful(t, {}, {});
|
735
|
-
|
735
|
+
Ce.add(e, i), Object.assign(e.style, i["default"]);
|
736
736
|
}
|
737
737
|
}, {
|
738
738
|
key: "applyEventsToElement",
|
@@ -787,7 +787,7 @@ var Xe = /*#__PURE__*/function () {
|
|
787
787
|
value: function overwrite(e, t, i, n) {
|
788
788
|
var r = e.messages,
|
789
789
|
o = v.overwriteMessage(r, n, t, i, "html", "html-message");
|
790
|
-
return o && (o.bubbleElement.innerHTML = t, se.apply(e, o.outerContainer),
|
790
|
+
return o && (o.bubbleElement.innerHTML = t, se.apply(e, o.outerContainer), Ie.flagHTMLUpdateClass(o.bubbleElement)), o;
|
791
791
|
}
|
792
792
|
// prettier-ignore
|
793
793
|
}, {
|
@@ -800,7 +800,7 @@ var Xe = /*#__PURE__*/function () {
|
|
800
800
|
r.status = !1;
|
801
801
|
}
|
802
802
|
var o = Xe.createElements(e, t, i);
|
803
|
-
return v.fillEmptyMessageElement(o.bubbleElement, t), se.apply(e, o.outerContainer),
|
803
|
+
return v.fillEmptyMessageElement(o.bubbleElement, t), se.apply(e, o.outerContainer), Ie.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Xe.addElement(e, o.outerContainer), o;
|
804
804
|
}
|
805
805
|
}]);
|
806
806
|
return Xe;
|
@@ -847,7 +847,7 @@ function Rs(s, e) {
|
|
847
847
|
i = Kn(e);
|
848
848
|
return e !== i ? i : e.charCodeAt(0) === 35 && Ls.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), $n(t)) ? Pi(t) : s;
|
849
849
|
}
|
850
|
-
function
|
850
|
+
function Le(s) {
|
851
851
|
return s.indexOf("&") < 0 ? s : s.replace(Is, Rs);
|
852
852
|
}
|
853
853
|
var Ns = /[&<>"]/,
|
@@ -869,10 +869,10 @@ m.blockquote_open = function () {
|
|
869
869
|
return "<blockquote>\n";
|
870
870
|
};
|
871
871
|
m.blockquote_close = function (s, e) {
|
872
|
-
return "</blockquote>" +
|
872
|
+
return "</blockquote>" + Ne(s, e);
|
873
873
|
};
|
874
874
|
m.code = function (s, e) {
|
875
|
-
return s[e].block ? "<pre><code>" + z(s[e].content) + "</code></pre>" +
|
875
|
+
return s[e].block ? "<pre><code>" + z(s[e].content) + "</code></pre>" + Ne(s, e) : "<code>" + z(s[e].content) + "</code>";
|
876
876
|
};
|
877
877
|
m.fence = function (s, e, t, i, n) {
|
878
878
|
var r = s[e],
|
@@ -884,9 +884,9 @@ m.fence = function (s, e, t, i, n) {
|
|
884
884
|
u;
|
885
885
|
if (r.params) {
|
886
886
|
if (c = r.params.split(/\s+/g), d = c.join(" "), As(n.rules.fence_custom, c[0])) return n.rules.fence_custom[c[0]](s, e, t, i, n);
|
887
|
-
l = z(
|
887
|
+
l = z(Le(gt(d))), o = ' class="' + a + l + '"';
|
888
888
|
}
|
889
|
-
return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || z(r.content) : u = z(r.content), "<pre><code" + o + ">" + u + "</code></pre>" +
|
889
|
+
return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || z(r.content) : u = z(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + Ne(s, e);
|
890
890
|
};
|
891
891
|
m.fence_custom = {};
|
892
892
|
m.heading_open = function (s, e) {
|
@@ -896,13 +896,13 @@ m.heading_close = function (s, e) {
|
|
896
896
|
return "</h" + s[e].hLevel + ">\n";
|
897
897
|
};
|
898
898
|
m.hr = function (s, e, t) {
|
899
|
-
return (t.xhtmlOut ? "<hr />" : "<hr>") +
|
899
|
+
return (t.xhtmlOut ? "<hr />" : "<hr>") + Ne(s, e);
|
900
900
|
};
|
901
901
|
m.bullet_list_open = function () {
|
902
902
|
return "<ul>\n";
|
903
903
|
};
|
904
904
|
m.bullet_list_close = function (s, e) {
|
905
|
-
return "</ul>" +
|
905
|
+
return "</ul>" + Ne(s, e);
|
906
906
|
};
|
907
907
|
m.list_item_open = function () {
|
908
908
|
return "<li>";
|
@@ -916,17 +916,17 @@ m.ordered_list_open = function (s, e) {
|
|
916
916
|
return "<ol" + i + ">\n";
|
917
917
|
};
|
918
918
|
m.ordered_list_close = function (s, e) {
|
919
|
-
return "</ol>" +
|
919
|
+
return "</ol>" + Ne(s, e);
|
920
920
|
};
|
921
921
|
m.paragraph_open = function (s, e) {
|
922
922
|
return s[e].tight ? "" : "<p>";
|
923
923
|
};
|
924
924
|
m.paragraph_close = function (s, e) {
|
925
925
|
var t = !(s[e].tight && e && s[e - 1].type === "inline" && !s[e - 1].content);
|
926
|
-
return (s[e].tight ? "" : "</p>") + (t ?
|
926
|
+
return (s[e].tight ? "" : "</p>") + (t ? Ne(s, e) : "");
|
927
927
|
};
|
928
928
|
m.link_open = function (s, e, t) {
|
929
|
-
var i = s[e].title ? ' title="' + z(
|
929
|
+
var i = s[e].title ? ' title="' + z(Le(s[e].title)) + '"' : "",
|
930
930
|
n = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
|
931
931
|
return '<a href="' + z(s[e].href) + '"' + i + n + ">";
|
932
932
|
};
|
@@ -935,8 +935,8 @@ m.link_close = function () {
|
|
935
935
|
};
|
936
936
|
m.image = function (s, e, t) {
|
937
937
|
var i = ' src="' + z(s[e].src) + '"',
|
938
|
-
n = s[e].title ? ' title="' + z(
|
939
|
-
r = ' alt="' + (s[e].alt ? z(
|
938
|
+
n = s[e].title ? ' title="' + z(Le(s[e].title)) + '"' : "",
|
939
|
+
r = ' alt="' + (s[e].alt ? z(Le(gt(s[e].alt))) : "") + '"',
|
940
940
|
o = t.xhtmlOut ? " /" : "";
|
941
941
|
return "<img" + i + r + n + o + ">";
|
942
942
|
};
|
@@ -1030,7 +1030,7 @@ m.htmltag = function (s, e) {
|
|
1030
1030
|
return s[e].content;
|
1031
1031
|
};
|
1032
1032
|
m.abbr_open = function (s, e) {
|
1033
|
-
return '<abbr title="' + z(
|
1033
|
+
return '<abbr title="' + z(Le(s[e].title)) + '">';
|
1034
1034
|
};
|
1035
1035
|
m.abbr_close = function () {
|
1036
1036
|
return "</abbr>";
|
@@ -1080,7 +1080,7 @@ m.dd_close = function () {
|
|
1080
1080
|
function Yn(s, e) {
|
1081
1081
|
return ++e >= s.length - 2 ? e : s[e].type === "paragraph_open" && s[e].tight && s[e + 1].type === "inline" && s[e + 1].content.length === 0 && s[e + 2].type === "paragraph_close" && s[e + 2].tight ? Yn(s, e + 2) : e;
|
1082
1082
|
}
|
1083
|
-
var
|
1083
|
+
var Ne = m.getBreak = function (e, t) {
|
1084
1084
|
return t = Yn(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1085
1085
|
};
|
1086
1086
|
function Vi() {
|
@@ -1094,14 +1094,14 @@ Vi.prototype.render = function (s, e, t) {
|
|
1094
1094
|
for (var i = this.rules, n = s.length, r = -1, o = ""; ++r < n;) s[r].type === "inline" ? o += this.renderInline(s[r].children, e, t) : o += i[s[r].type](s, r, e, t, this);
|
1095
1095
|
return o;
|
1096
1096
|
};
|
1097
|
-
function
|
1097
|
+
function G() {
|
1098
1098
|
this.__rules__ = [], this.__cache__ = null;
|
1099
1099
|
}
|
1100
|
-
|
1100
|
+
G.prototype.__find__ = function (s) {
|
1101
1101
|
for (var e = this.__rules__.length, t = -1; e--;) if (this.__rules__[++t].name === s) return t;
|
1102
1102
|
return -1;
|
1103
1103
|
};
|
1104
|
-
|
1104
|
+
G.prototype.__compile__ = function () {
|
1105
1105
|
var s = this,
|
1106
1106
|
e = [""];
|
1107
1107
|
s.__rules__.forEach(function (t) {
|
@@ -1114,13 +1114,13 @@ H.prototype.__compile__ = function () {
|
|
1114
1114
|
});
|
1115
1115
|
});
|
1116
1116
|
};
|
1117
|
-
|
1117
|
+
G.prototype.at = function (s, e, t) {
|
1118
1118
|
var i = this.__find__(s),
|
1119
1119
|
n = t || {};
|
1120
1120
|
if (i === -1) throw new Error("Parser rule not found: " + s);
|
1121
1121
|
this.__rules__[i].fn = e, this.__rules__[i].alt = n.alt || [], this.__cache__ = null;
|
1122
1122
|
};
|
1123
|
-
|
1123
|
+
G.prototype.before = function (s, e, t, i) {
|
1124
1124
|
var n = this.__find__(s),
|
1125
1125
|
r = i || {};
|
1126
1126
|
if (n === -1) throw new Error("Parser rule not found: " + s);
|
@@ -1131,7 +1131,7 @@ H.prototype.before = function (s, e, t, i) {
|
|
1131
1131
|
alt: r.alt || []
|
1132
1132
|
}), this.__cache__ = null;
|
1133
1133
|
};
|
1134
|
-
|
1134
|
+
G.prototype.after = function (s, e, t, i) {
|
1135
1135
|
var n = this.__find__(s),
|
1136
1136
|
r = i || {};
|
1137
1137
|
if (n === -1) throw new Error("Parser rule not found: " + s);
|
@@ -1142,7 +1142,7 @@ H.prototype.after = function (s, e, t, i) {
|
|
1142
1142
|
alt: r.alt || []
|
1143
1143
|
}), this.__cache__ = null;
|
1144
1144
|
};
|
1145
|
-
|
1145
|
+
G.prototype.push = function (s, e, t) {
|
1146
1146
|
var i = t || {};
|
1147
1147
|
this.__rules__.push({
|
1148
1148
|
name: s,
|
@@ -1151,7 +1151,7 @@ H.prototype.push = function (s, e, t) {
|
|
1151
1151
|
alt: i.alt || []
|
1152
1152
|
}), this.__cache__ = null;
|
1153
1153
|
};
|
1154
|
-
|
1154
|
+
G.prototype.enable = function (s, e) {
|
1155
1155
|
s = Array.isArray(s) ? s : [s], e && this.__rules__.forEach(function (t) {
|
1156
1156
|
t.enabled = !1;
|
1157
1157
|
}), s.forEach(function (t) {
|
@@ -1160,14 +1160,14 @@ H.prototype.enable = function (s, e) {
|
|
1160
1160
|
this.__rules__[i].enabled = !0;
|
1161
1161
|
}, this), this.__cache__ = null;
|
1162
1162
|
};
|
1163
|
-
|
1163
|
+
G.prototype.disable = function (s) {
|
1164
1164
|
s = Array.isArray(s) ? s : [s], s.forEach(function (e) {
|
1165
1165
|
var t = this.__find__(e);
|
1166
1166
|
if (t < 0) throw new Error("Rules manager: invalid rule name " + e);
|
1167
1167
|
this.__rules__[t].enabled = !1;
|
1168
1168
|
}, this), this.__cache__ = null;
|
1169
1169
|
};
|
1170
|
-
|
1170
|
+
G.prototype.getRules = function (s) {
|
1171
1171
|
return this.__cache__ === null && this.__compile__(), this.__cache__[s] || [];
|
1172
1172
|
};
|
1173
1173
|
function js(s) {
|
@@ -1179,24 +1179,24 @@ function js(s) {
|
|
1179
1179
|
children: []
|
1180
1180
|
}) : s.block.parse(s.src, s.options, s.env, s.tokens);
|
1181
1181
|
}
|
1182
|
-
function
|
1182
|
+
function Oe(s, e, t, i, n) {
|
1183
1183
|
this.src = s, this.env = i, this.options = t, this.parser = e, this.tokens = n, this.pos = 0, this.posMax = this.src.length, this.level = 0, this.pending = "", this.pendingLevel = 0, this.cache = [], this.isInLabel = !1, this.linkLevel = 0, this.linkContent = "", this.labelUnmatchedScopes = 0;
|
1184
1184
|
}
|
1185
|
-
|
1185
|
+
Oe.prototype.pushPending = function () {
|
1186
1186
|
this.tokens.push({
|
1187
1187
|
type: "text",
|
1188
1188
|
content: this.pending,
|
1189
1189
|
level: this.pendingLevel
|
1190
1190
|
}), this.pending = "";
|
1191
1191
|
};
|
1192
|
-
|
1192
|
+
Oe.prototype.push = function (s) {
|
1193
1193
|
this.pending && this.pushPending(), this.tokens.push(s), this.pendingLevel = this.level;
|
1194
1194
|
};
|
1195
|
-
|
1195
|
+
Oe.prototype.cacheSet = function (s, e) {
|
1196
1196
|
for (var t = this.cache.length; t <= s; t++) this.cache.push(0);
|
1197
1197
|
this.cache[s] = e;
|
1198
1198
|
};
|
1199
|
-
|
1199
|
+
Oe.prototype.cacheGet = function (s) {
|
1200
1200
|
return s < this.cache.length ? this.cache[s] : 0;
|
1201
1201
|
};
|
1202
1202
|
function bt(s, e) {
|
@@ -1220,7 +1220,7 @@ function bt(s, e) {
|
|
1220
1220
|
}
|
1221
1221
|
function Fs(s, e, t, i) {
|
1222
1222
|
var n, r, o, a, l, c;
|
1223
|
-
if (s.charCodeAt(0) !== 42 || s.charCodeAt(1) !== 91 || s.indexOf("]:") === -1 || (n = new
|
1223
|
+
if (s.charCodeAt(0) !== 42 || s.charCodeAt(1) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = bt(n, 1), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
|
1224
1224
|
for (a = n.posMax, o = r + 2; o < a && n.src.charCodeAt(o) !== 10; o++);
|
1225
1225
|
return l = s.slice(2, r), c = s.slice(r + 2, o).trim(), c.length === 0 ? -1 : (i.abbreviations || (i.abbreviations = {}), _typeof(i.abbreviations[":" + l]) > "u" && (i.abbreviations[":" + l] = c), o);
|
1226
1226
|
}
|
@@ -1238,7 +1238,7 @@ function Bs(s) {
|
|
1238
1238
|
}
|
1239
1239
|
}
|
1240
1240
|
function Di(s) {
|
1241
|
-
var e =
|
1241
|
+
var e = Le(s);
|
1242
1242
|
try {
|
1243
1243
|
e = decodeURI(e);
|
1244
1244
|
} catch (_unused2) {}
|
@@ -1293,7 +1293,7 @@ function Qn(s) {
|
|
1293
1293
|
}
|
1294
1294
|
function zs(s, e, t, i) {
|
1295
1295
|
var n, r, o, a, l, c, d, u, p;
|
1296
|
-
if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new
|
1296
|
+
if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = bt(n, 0), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
|
1297
1297
|
for (a = n.posMax, o = r + 2; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1298
1298
|
if (!Zn(n, o)) return -1;
|
1299
1299
|
for (d = n.linkContent, o = n.pos, c = o, o = o + 1; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
@@ -1487,14 +1487,14 @@ function Xs(s) {
|
|
1487
1487
|
}
|
1488
1488
|
var Mi = [["block", js], ["abbr", Bs], ["references", Us], ["inline", qs], ["footnote_tail", Hs], ["abbr2", Gs], ["replacements", $s], ["smartquotes", Xs]];
|
1489
1489
|
function es() {
|
1490
|
-
this.options = {}, this.ruler = new
|
1490
|
+
this.options = {}, this.ruler = new G();
|
1491
1491
|
for (var s = 0; s < Mi.length; s++) this.ruler.push(Mi[s][0], Mi[s][1]);
|
1492
1492
|
}
|
1493
1493
|
es.prototype.process = function (s) {
|
1494
1494
|
var e, t, i;
|
1495
1495
|
for (i = this.ruler.getRules(""), e = 0, t = i.length; e < t; e++) i[e](s);
|
1496
1496
|
};
|
1497
|
-
function
|
1497
|
+
function Pe(s, e, t, i, n) {
|
1498
1498
|
var r, o, a, l, c, d, u;
|
1499
1499
|
for (this.src = s, this.parser = e, this.options = t, this.env = i, this.tokens = n, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", o = this.src, d = 0, u = !1, a = l = d = 0, c = o.length; l < c; l++) {
|
1500
1500
|
if (r = o.charCodeAt(l), !u) if (r === 32) {
|
@@ -1505,27 +1505,27 @@ function Oe(s, e, t, i, n) {
|
|
1505
1505
|
}
|
1506
1506
|
this.bMarks.push(o.length), this.eMarks.push(o.length), this.tShift.push(0), this.lineMax = this.bMarks.length - 1;
|
1507
1507
|
}
|
1508
|
-
|
1508
|
+
Pe.prototype.isEmpty = function (e) {
|
1509
1509
|
return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
|
1510
1510
|
};
|
1511
|
-
|
1511
|
+
Pe.prototype.skipEmptyLines = function (e) {
|
1512
1512
|
for (var t = this.lineMax; e < t && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++);
|
1513
1513
|
return e;
|
1514
1514
|
};
|
1515
|
-
|
1515
|
+
Pe.prototype.skipSpaces = function (e) {
|
1516
1516
|
for (var t = this.src.length; e < t && this.src.charCodeAt(e) === 32; e++);
|
1517
1517
|
return e;
|
1518
1518
|
};
|
1519
|
-
|
1519
|
+
Pe.prototype.skipChars = function (e, t) {
|
1520
1520
|
for (var i = this.src.length; e < i && this.src.charCodeAt(e) === t; e++);
|
1521
1521
|
return e;
|
1522
1522
|
};
|
1523
|
-
|
1523
|
+
Pe.prototype.skipCharsBack = function (e, t, i) {
|
1524
1524
|
if (e <= i) return e;
|
1525
1525
|
for (; e > i;) if (t !== this.src.charCodeAt(--e)) return e + 1;
|
1526
1526
|
return e;
|
1527
1527
|
};
|
1528
|
-
|
1528
|
+
Pe.prototype.getLines = function (e, t, i, n) {
|
1529
1529
|
var r,
|
1530
1530
|
o,
|
1531
1531
|
a,
|
@@ -1677,36 +1677,36 @@ function sr(s, e, t, i) {
|
|
1677
1677
|
f,
|
1678
1678
|
S,
|
1679
1679
|
w,
|
1680
|
-
G,
|
1681
|
-
A,
|
1682
1680
|
V,
|
1683
|
-
|
1684
|
-
|
1681
|
+
A,
|
1682
|
+
W,
|
1685
1683
|
Q,
|
1684
|
+
oe = !0,
|
1685
|
+
q,
|
1686
1686
|
O,
|
1687
|
-
|
1687
|
+
xe,
|
1688
1688
|
Si;
|
1689
1689
|
if ((u = mn(s, e)) >= 0) S = !0;else if ((u = fn(s, e)) >= 0) S = !1;else return !1;
|
1690
1690
|
if (s.level >= s.options.maxNesting) return !1;
|
1691
1691
|
if (f = s.src.charCodeAt(u - 1), i) return !0;
|
1692
|
-
for (
|
1692
|
+
for (V = s.tokens.length, S ? (d = s.bMarks[e] + s.tShift[e], g = Number(s.src.substr(d, u - d - 1)), s.tokens.push({
|
1693
1693
|
type: "ordered_list_open",
|
1694
1694
|
order: g,
|
1695
|
-
lines:
|
1695
|
+
lines: W = [e, 0],
|
1696
1696
|
level: s.level++
|
1697
1697
|
})) : s.tokens.push({
|
1698
1698
|
type: "bullet_list_open",
|
1699
|
-
lines:
|
1699
|
+
lines: W = [e, 0],
|
1700
1700
|
level: s.level++
|
1701
|
-
}), n = e, A = !1,
|
1701
|
+
}), n = e, A = !1, q = s.parser.ruler.getRules("list"); n < t && (w = s.skipSpaces(u), p = s.eMarks[n], w >= p ? h = 1 : h = w - u, h > 4 && (h = 1), h < 1 && (h = 1), r = u - s.bMarks[n] + h, s.tokens.push({
|
1702
1702
|
type: "list_item_open",
|
1703
|
-
lines:
|
1703
|
+
lines: Q = [e, 0],
|
1704
1704
|
level: s.level++
|
1705
1705
|
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = w - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || A) && (oe = !1), A = s.line - e > 1 && s.isEmpty(s.line - 1), s.blkIndent = a, s.tShift[e] = o, s.tight = l, s.parentType = c, s.tokens.push({
|
1706
1706
|
type: "list_item_close",
|
1707
1707
|
level: --s.level
|
1708
|
-
}), n = e = s.line,
|
1709
|
-
for (Si = !1, O = 0,
|
1708
|
+
}), n = e = s.line, Q[1] = n, w = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1709
|
+
for (Si = !1, O = 0, xe = q.length; O < xe; O++) if (q[O](s, n, t, !0)) {
|
1710
1710
|
Si = !0;
|
1711
1711
|
break;
|
1712
1712
|
}
|
@@ -1719,7 +1719,7 @@ function sr(s, e, t, i) {
|
|
1719
1719
|
return s.tokens.push({
|
1720
1720
|
type: S ? "ordered_list_close" : "bullet_list_close",
|
1721
1721
|
level: --s.level
|
1722
|
-
}),
|
1722
|
+
}), W[1] = n, s.line = n, oe && nr(s, V), !0;
|
1723
1723
|
}
|
1724
1724
|
function rr(s, e, t, i) {
|
1725
1725
|
var n,
|
@@ -2001,7 +2001,7 @@ function mr(s, e) {
|
|
2001
2001
|
}
|
2002
2002
|
var Ot = [["code", Qs], ["fences", er, ["paragraph", "blockquote", "list"]], ["blockquote", tr, ["paragraph", "blockquote", "list"]], ["hr", ir, ["paragraph", "blockquote", "list"]], ["list", sr, ["paragraph", "blockquote"]], ["footnote", rr, ["paragraph"]], ["heading", or, ["paragraph", "blockquote"]], ["lheading", ar], ["htmlblock", ur, ["paragraph", "blockquote"]], ["table", hr, ["paragraph"]], ["deflist", fr, ["paragraph"]], ["paragraph", mr]];
|
2003
2003
|
function Wi() {
|
2004
|
-
this.ruler = new
|
2004
|
+
this.ruler = new G();
|
2005
2005
|
for (var s = 0; s < Ot.length; s++) this.ruler.push(Ot[s][0], Ot[s][1], {
|
2006
2006
|
alt: (Ot[s][2] || []).slice()
|
2007
2007
|
});
|
@@ -2026,7 +2026,7 @@ Wi.prototype.parse = function (s, e, t, i) {
|
|
2026
2026
|
s = s.replace(vr, " "), s = s.replace(br, "\n"), s.indexOf(" ") >= 0 && (s = s.replace(gr, function (a, l) {
|
2027
2027
|
var c;
|
2028
2028
|
return s.charCodeAt(l) === 10 ? (r = l + 1, o = 0, a) : (c = " ".slice((l - r - o) % 4), o = l - r + 1, c);
|
2029
|
-
})), n = new
|
2029
|
+
})), n = new Pe(s, this, e, t, i), this.tokenize(n, n.line, n.lineMax);
|
2030
2030
|
};
|
2031
2031
|
function yr(s) {
|
2032
2032
|
switch (s) {
|
@@ -2486,7 +2486,7 @@ function io(s, e) {
|
|
2486
2486
|
}
|
2487
2487
|
var Ci = [["text", xr], ["newline", Er], ["escape", Sr], ["backticks", wr], ["del", _r], ["ins", Mr], ["mark", Tr], ["emphasis", Cr], ["sub", kr], ["sup", Lr], ["links", Rr], ["footnote_inline", Nr], ["footnote_ref", Or], ["autolink", Fr], ["htmltag", Qr], ["entity", io]];
|
2488
2488
|
function si() {
|
2489
|
-
this.ruler = new
|
2489
|
+
this.ruler = new G();
|
2490
2490
|
for (var s = 0; s < Ci.length; s++) this.ruler.push(Ci[s][0], Ci[s][1]);
|
2491
2491
|
this.validateLink = no;
|
2492
2492
|
}
|
@@ -2518,13 +2518,13 @@ si.prototype.tokenize = function (s) {
|
|
2518
2518
|
s.pending && s.pushPending();
|
2519
2519
|
};
|
2520
2520
|
si.prototype.parse = function (s, e, t, i) {
|
2521
|
-
var n = new
|
2521
|
+
var n = new Oe(s, this, e, t, i);
|
2522
2522
|
this.tokenize(n);
|
2523
2523
|
};
|
2524
2524
|
function no(s) {
|
2525
2525
|
var e = ["vbscript", "javascript", "file", "data"],
|
2526
2526
|
t = s.trim().toLowerCase();
|
2527
|
-
return t =
|
2527
|
+
return t = Le(t), !(t.indexOf(":") !== -1 && e.indexOf(t.split(":")[0]) !== -1);
|
2528
2528
|
}
|
2529
2529
|
var so = {
|
2530
2530
|
options: {
|
@@ -2644,7 +2644,7 @@ function is(s, e, t) {
|
|
2644
2644
|
this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
|
2645
2645
|
}
|
2646
2646
|
function he(s, e) {
|
2647
|
-
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new si(), this.block = new Wi(), this.core = new es(), this.renderer = new Vi(), this.ruler = new
|
2647
|
+
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new si(), this.block = new Wi(), this.core = new es(), this.renderer = new Vi(), this.ruler = new G(), this.options = {}, this.configure(ao[s]), this.set(e || {});
|
2648
2648
|
}
|
2649
2649
|
he.prototype.set = function (s) {
|
2650
2650
|
Jn(this.options, s);
|
@@ -3011,7 +3011,7 @@ var Je = /*#__PURE__*/function () {
|
|
3011
3011
|
var _this4 = this;
|
3012
3012
|
var i = this.createNewMessageElement(e, t);
|
3013
3013
|
return this.elementRef.appendChild(i.outerContainer), setTimeout(function () {
|
3014
|
-
return
|
3014
|
+
return Z.scrollToBottom(_this4.elementRef);
|
3015
3015
|
}), i;
|
3016
3016
|
}
|
3017
3017
|
}, {
|
@@ -3125,13 +3125,13 @@ var Ji = /*#__PURE__*/function () {
|
|
3125
3125
|
if (this._hasStreamEnded) return;
|
3126
3126
|
if ((e == null ? void 0 : e.text) === void 0 && (e == null ? void 0 : e.html) === void 0) return console.error(C.INVALID_STREAM_EVENT);
|
3127
3127
|
var t = (e == null ? void 0 : e.text) || (e == null ? void 0 : e.html) || "",
|
3128
|
-
i =
|
3128
|
+
i = Z.isScrollbarAtBottomOfElement(this._messages.elementRef),
|
3129
3129
|
n = (e == null ? void 0 : e.text) !== void 0 ? "text" : "html";
|
3130
3130
|
if (!this._elements && this._streamedContent === "") this.setInitialState(n, t, e == null ? void 0 : e.role);else {
|
3131
3131
|
if (this._streamType !== n) return console.error(C.INVALID_STREAM_EVENT_MIX);
|
3132
3132
|
this.updateBasedOnType(t, n, (r = this._elements) == null ? void 0 : r.bubbleElement, e == null ? void 0 : e.overwrite);
|
3133
3133
|
}
|
3134
|
-
i &&
|
3134
|
+
i && Z.scrollToBottom(this._messages.elementRef);
|
3135
3135
|
}
|
3136
3136
|
}, {
|
3137
3137
|
key: "setInitialState",
|
@@ -3429,25 +3429,25 @@ function bo(s, e) {
|
|
3429
3429
|
h.accept || (h.accept = ji);
|
3430
3430
|
var g;
|
3431
3431
|
function f() {
|
3432
|
-
g.abort(), document.hidden ||
|
3432
|
+
g.abort(), document.hidden || Q();
|
3433
3433
|
}
|
3434
3434
|
l || document.addEventListener("visibilitychange", f);
|
3435
3435
|
var S = go,
|
3436
3436
|
w = 0;
|
3437
|
-
function
|
3437
|
+
function V() {
|
3438
3438
|
document.removeEventListener("visibilitychange", f), window.clearTimeout(w), g.abort();
|
3439
3439
|
}
|
3440
3440
|
t == null || t.addEventListener("abort", function () {
|
3441
|
-
|
3441
|
+
V(), u();
|
3442
3442
|
});
|
3443
3443
|
var A = c !== null && c !== void 0 ? c : window.fetch,
|
3444
|
-
|
3445
|
-
function
|
3446
|
-
return
|
3444
|
+
W = n !== null && n !== void 0 ? n : vo;
|
3445
|
+
function Q() {
|
3446
|
+
return _Q.apply(this, arguments);
|
3447
3447
|
}
|
3448
|
-
function
|
3449
|
-
|
3450
|
-
var oe,
|
3448
|
+
function _Q() {
|
3449
|
+
_Q = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
3450
|
+
var oe, q, O;
|
3451
3451
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
3452
3452
|
while (1) switch (_context3.prev = _context3.next) {
|
3453
3453
|
case 0:
|
@@ -3459,19 +3459,19 @@ function bo(s, e) {
|
|
3459
3459
|
signal: g.signal
|
3460
3460
|
}));
|
3461
3461
|
case 4:
|
3462
|
-
|
3462
|
+
q = _context3.sent;
|
3463
3463
|
_context3.next = 7;
|
3464
|
-
return
|
3464
|
+
return W(q);
|
3465
3465
|
case 7:
|
3466
3466
|
_context3.next = 9;
|
3467
|
-
return uo(
|
3467
|
+
return uo(q.body, ho(po(function (O) {
|
3468
3468
|
O ? h[xn] = O : delete h[xn];
|
3469
3469
|
}, function (O) {
|
3470
3470
|
S = O;
|
3471
3471
|
}, r)));
|
3472
3472
|
case 9:
|
3473
3473
|
o == null || o();
|
3474
|
-
|
3474
|
+
V();
|
3475
3475
|
u();
|
3476
3476
|
_context3.next = 17;
|
3477
3477
|
break;
|
@@ -3480,9 +3480,9 @@ function bo(s, e) {
|
|
3480
3480
|
_context3.t0 = _context3["catch"](1);
|
3481
3481
|
if (!g.signal.aborted) try {
|
3482
3482
|
O = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe : S;
|
3483
|
-
window.clearTimeout(w), w = window.setTimeout(
|
3483
|
+
window.clearTimeout(w), w = window.setTimeout(Q, O);
|
3484
3484
|
} catch (O) {
|
3485
|
-
|
3485
|
+
V(), p(O);
|
3486
3486
|
}
|
3487
3487
|
case 17:
|
3488
3488
|
case "end":
|
@@ -3490,9 +3490,9 @@ function bo(s, e) {
|
|
3490
3490
|
}
|
3491
3491
|
}, _callee3, null, [[1, 14]]);
|
3492
3492
|
}));
|
3493
|
-
return
|
3493
|
+
return _Q.apply(this, arguments);
|
3494
3494
|
}
|
3495
|
-
|
3495
|
+
Q();
|
3496
3496
|
});
|
3497
3497
|
}
|
3498
3498
|
function vo(s) {
|
@@ -3588,7 +3588,7 @@ var I = /*#__PURE__*/function () {
|
|
3588
3588
|
f,
|
3589
3589
|
S,
|
3590
3590
|
w,
|
3591
|
-
|
3591
|
+
V,
|
3592
3592
|
r,
|
3593
3593
|
_yield$E$processReque,
|
3594
3594
|
o,
|
@@ -3629,7 +3629,7 @@ var I = /*#__PURE__*/function () {
|
|
3629
3629
|
_context7.next = 16;
|
3630
3630
|
break;
|
3631
3631
|
}
|
3632
|
-
return _context7.abrupt("return",
|
3632
|
+
return _context7.abrupt("return", ke.stream(e, o, i));
|
3633
3633
|
case 16:
|
3634
3634
|
if (!(((f = e.requestSettings) == null ? void 0 : f.url) === ve.URL)) {
|
3635
3635
|
_context7.next = 18;
|
@@ -3641,7 +3641,7 @@ var I = /*#__PURE__*/function () {
|
|
3641
3641
|
bo(((S = e.requestSettings) == null ? void 0 : S.url) || e.url || "", {
|
3642
3642
|
method: ((w = e.requestSettings) == null ? void 0 : w.method) || "POST",
|
3643
3643
|
headers: a,
|
3644
|
-
credentials: (
|
3644
|
+
credentials: (V = e.requestSettings) == null ? void 0 : V.credentials,
|
3645
3645
|
body: n ? JSON.stringify(o) : o,
|
3646
3646
|
openWhenHidden: !0,
|
3647
3647
|
// keep stream open when browser tab not open
|
@@ -3669,30 +3669,34 @@ var I = /*#__PURE__*/function () {
|
|
3669
3669
|
},
|
3670
3670
|
onmessage: function onmessage(A) {
|
3671
3671
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
3672
|
-
var
|
3672
|
+
var W, Q, oe, q, O;
|
3673
3673
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3674
3674
|
while (1) switch (_context6.prev = _context6.next) {
|
3675
3675
|
case 0:
|
3676
|
-
if (!(
|
3676
|
+
if (!(JSON.stringify(A.data) !== JSON.stringify("[DONE]"))) {
|
3677
3677
|
_context6.next = 9;
|
3678
3678
|
break;
|
3679
3679
|
}
|
3680
|
-
|
3680
|
+
try {
|
3681
|
+
q = JSON.parse(A.data);
|
3682
|
+
} catch (_unused6) {
|
3683
|
+
q = {};
|
3684
|
+
}
|
3681
3685
|
_context6.next = 4;
|
3682
|
-
return (
|
3686
|
+
return (Q = (W = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(W, q);
|
3683
3687
|
case 4:
|
3684
3688
|
_context6.t0 = _context6.sent;
|
3685
3689
|
if (_context6.t0) {
|
3686
3690
|
_context6.next = 7;
|
3687
3691
|
break;
|
3688
3692
|
}
|
3689
|
-
_context6.t0 =
|
3693
|
+
_context6.t0 = q;
|
3690
3694
|
case 7:
|
3691
3695
|
O = _context6.t0;
|
3692
|
-
(oe = e.extractResultData) == null || oe.call(e, O).then(function (
|
3693
|
-
p.upsertStreamedMessage(
|
3694
|
-
})["catch"](function (
|
3695
|
-
return E.displayError(i,
|
3696
|
+
(oe = e.extractResultData) == null || oe.call(e, O).then(function (xe) {
|
3697
|
+
p.upsertStreamedMessage(xe);
|
3698
|
+
})["catch"](function (xe) {
|
3699
|
+
return E.displayError(i, xe);
|
3696
3700
|
});
|
3697
3701
|
case 9:
|
3698
3702
|
case "end":
|
@@ -3709,11 +3713,11 @@ var I = /*#__PURE__*/function () {
|
|
3709
3713
|
},
|
3710
3714
|
signal: u.signal
|
3711
3715
|
})["catch"](function (A) {
|
3712
|
-
var
|
3713
|
-
(
|
3716
|
+
var W;
|
3717
|
+
(W = e.extractResultData) == null || W.call(e, A).then(function () {
|
3714
3718
|
E.displayError(i, A);
|
3715
|
-
})["catch"](function (
|
3716
|
-
E.displayError(i,
|
3719
|
+
})["catch"](function (Q) {
|
3720
|
+
E.displayError(i, Q);
|
3717
3721
|
});
|
3718
3722
|
});
|
3719
3723
|
case 20:
|
@@ -3770,11 +3774,11 @@ var I = /*#__PURE__*/function () {
|
|
3770
3774
|
}]);
|
3771
3775
|
return I;
|
3772
3776
|
}();
|
3773
|
-
var
|
3774
|
-
function
|
3775
|
-
_classCallCheck(this,
|
3777
|
+
var ke = /*#__PURE__*/function () {
|
3778
|
+
function ke() {
|
3779
|
+
_classCallCheck(this, ke);
|
3776
3780
|
}
|
3777
|
-
_createClass(
|
3781
|
+
_createClass(ke, null, [{
|
3778
3782
|
key: "request",
|
3779
3783
|
value: function () {
|
3780
3784
|
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(e, t, i) {
|
@@ -3817,7 +3821,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3817
3821
|
return function r(_x18) {
|
3818
3822
|
return _ref2.apply(this, arguments);
|
3819
3823
|
};
|
3820
|
-
}(), o =
|
3824
|
+
}(), o = ke.generateOptionalSignals();
|
3821
3825
|
(l = (a = e.requestSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
|
3822
3826
|
onResponse: r
|
3823
3827
|
}));
|
@@ -3851,7 +3855,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3851
3855
|
e.streamHandlers.abortStream.abort = function () {
|
3852
3856
|
o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1;
|
3853
3857
|
};
|
3854
|
-
var d =
|
3858
|
+
var d = ke.generateOptionalSignals();
|
3855
3859
|
(p = (u = e.requestSettings).handler) == null || p.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
3856
3860
|
onOpen: a,
|
3857
3861
|
onResponse: c,
|
@@ -3911,7 +3915,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3911
3915
|
return _ref3.apply(this, arguments);
|
3912
3916
|
};
|
3913
3917
|
}(),
|
3914
|
-
a =
|
3918
|
+
a = ke.generateOptionalSignals();
|
3915
3919
|
(c = (l = e.requestSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
|
3916
3920
|
onOpen: n,
|
3917
3921
|
onResponse: o,
|
@@ -3934,7 +3938,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3934
3938
|
};
|
3935
3939
|
}
|
3936
3940
|
}]);
|
3937
|
-
return
|
3941
|
+
return ke;
|
3938
3942
|
}();
|
3939
3943
|
var _ = /*#__PURE__*/function () {
|
3940
3944
|
function _() {
|
@@ -3984,7 +3988,7 @@ var _ = /*#__PURE__*/function () {
|
|
3984
3988
|
_context12.next = 13;
|
3985
3989
|
break;
|
3986
3990
|
}
|
3987
|
-
return _context12.abrupt("return",
|
3991
|
+
return _context12.abrupt("return", ke.request(e, o, i));
|
3988
3992
|
case 13:
|
3989
3993
|
if (!(((g = e.requestSettings) == null ? void 0 : g.url) === ve.URL)) {
|
3990
3994
|
_context12.next = 15;
|
@@ -4000,7 +4004,7 @@ var _ = /*#__PURE__*/function () {
|
|
4000
4004
|
return E.processResponseByType(f);
|
4001
4005
|
}).then( /*#__PURE__*/function () {
|
4002
4006
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(f) {
|
4003
|
-
var
|
4007
|
+
var V, A, S, w;
|
4004
4008
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
4005
4009
|
while (1) switch (_context11.prev = _context11.next) {
|
4006
4010
|
case 0:
|
@@ -4011,7 +4015,7 @@ var _ = /*#__PURE__*/function () {
|
|
4011
4015
|
return _context11.abrupt("return");
|
4012
4016
|
case 2:
|
4013
4017
|
_context11.next = 4;
|
4014
|
-
return (A = (
|
4018
|
+
return (A = (V = e.deepChat).responseInterceptor) == null ? void 0 : A.call(V, f);
|
4015
4019
|
case 4:
|
4016
4020
|
_context11.t0 = _context11.sent;
|
4017
4021
|
if (_context11.t0) {
|
@@ -4224,11 +4228,11 @@ var et = /*#__PURE__*/function () {
|
|
4224
4228
|
}]);
|
4225
4229
|
return et;
|
4226
4230
|
}();
|
4227
|
-
var
|
4228
|
-
function
|
4229
|
-
_classCallCheck(this,
|
4231
|
+
var Y = /*#__PURE__*/function () {
|
4232
|
+
function Y() {
|
4233
|
+
_classCallCheck(this, Y);
|
4230
4234
|
}
|
4231
|
-
_createClass(
|
4235
|
+
_createClass(Y, null, [{
|
4232
4236
|
key: "setup",
|
4233
4237
|
value: function setup(e) {
|
4234
4238
|
e.requestSettings.url !== ve.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
|
@@ -4239,18 +4243,18 @@ var $ = /*#__PURE__*/function () {
|
|
4239
4243
|
if (!document.body.contains(e.deepChat)) return;
|
4240
4244
|
var i = e.requestSettings.websocket;
|
4241
4245
|
if (i) {
|
4242
|
-
if (e.requestSettings.handler) return
|
4246
|
+
if (e.requestSettings.handler) return ke.websocket(e, t);
|
4243
4247
|
try {
|
4244
4248
|
var n = typeof i != "boolean" ? i : void 0,
|
4245
4249
|
r = new WebSocket(e.requestSettings.url || "", n);
|
4246
4250
|
e.websocket = r, e.websocket.onopen = function () {
|
4247
4251
|
var o, a;
|
4248
|
-
t.removeError(), e.websocket && _typeof(e.websocket) == "object" &&
|
4252
|
+
t.removeError(), e.websocket && _typeof(e.websocket) == "object" && Y.assignListeners(e, r, t), (a = (o = e.deepChat)._validationHandler) == null || a.call(o);
|
4249
4253
|
}, e.websocket.onerror = function (o) {
|
4250
|
-
console.error(o),
|
4254
|
+
console.error(o), Y.retryConnection(e, t);
|
4251
4255
|
};
|
4252
4256
|
} catch (n) {
|
4253
|
-
console.error(n),
|
4257
|
+
console.error(n), Y.retryConnection(e, t);
|
4254
4258
|
}
|
4255
4259
|
}
|
4256
4260
|
}
|
@@ -4259,7 +4263,7 @@ var $ = /*#__PURE__*/function () {
|
|
4259
4263
|
value: function retryConnection(e, t) {
|
4260
4264
|
var i, n;
|
4261
4265
|
(n = (i = e.deepChat)._validationHandler) == null || n.call(i), document.body.contains(e.deepChat) && (e.websocket = "pending", t.isLastMessageError() || t.addNewErrorMessage("service", "Connection error"), setTimeout(function () {
|
4262
|
-
|
4266
|
+
Y.createConnection(e, t);
|
4263
4267
|
}, 5e3));
|
4264
4268
|
}
|
4265
4269
|
}, {
|
@@ -4315,7 +4319,7 @@ var $ = /*#__PURE__*/function () {
|
|
4315
4319
|
return _ref6.apply(this, arguments);
|
4316
4320
|
};
|
4317
4321
|
}(), t.onclose = function () {
|
4318
|
-
console.error("Connection closed"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error"), e.deepChat.stream && e.streamHandlers.abortStream.abort(),
|
4322
|
+
console.error("Connection closed"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error"), e.deepChat.stream && e.streamHandlers.abortStream.abort(), Y.createConnection(e, i);
|
4319
4323
|
};
|
4320
4324
|
}
|
4321
4325
|
}, {
|
@@ -4359,7 +4363,7 @@ var $ = /*#__PURE__*/function () {
|
|
4359
4363
|
}
|
4360
4364
|
return _context16.abrupt("return", i.addNewErrorMessage("service", l));
|
4361
4365
|
case 12:
|
4362
|
-
if (
|
4366
|
+
if (Y.isWebSocket(r)) {
|
4363
4367
|
_context16.next = 14;
|
4364
4368
|
break;
|
4365
4369
|
}
|
@@ -4387,7 +4391,7 @@ var $ = /*#__PURE__*/function () {
|
|
4387
4391
|
}, {
|
4388
4392
|
key: "canSendMessage",
|
4389
4393
|
value: function canSendMessage(e) {
|
4390
|
-
return e ? e === "pending" ? !1 :
|
4394
|
+
return e ? e === "pending" ? !1 : Y.isWebSocket(e) ? e.readyState !== void 0 && e.readyState === e.OPEN : e.isOpen : !0;
|
4391
4395
|
}
|
4392
4396
|
// if false then it is the internal websocket handler
|
4393
4397
|
}, {
|
@@ -4396,7 +4400,7 @@ var $ = /*#__PURE__*/function () {
|
|
4396
4400
|
return e.send !== void 0;
|
4397
4401
|
}
|
4398
4402
|
}]);
|
4399
|
-
return
|
4403
|
+
return Y;
|
4400
4404
|
}();
|
4401
4405
|
var L = /*#__PURE__*/function () {
|
4402
4406
|
function L() {
|
@@ -4506,14 +4510,14 @@ var L = /*#__PURE__*/function () {
|
|
4506
4510
|
}]);
|
4507
4511
|
return L;
|
4508
4512
|
}();
|
4509
|
-
var
|
4510
|
-
function
|
4513
|
+
var Re = /*#__PURE__*/function () {
|
4514
|
+
function Re(e, t, i) {
|
4511
4515
|
var _a$url;
|
4512
|
-
_classCallCheck(this,
|
4516
|
+
_classCallCheck(this, Re);
|
4513
4517
|
var n, r, o, a;
|
4514
|
-
this.rawBody = {}, this.validateConfigKey = !1, this.canSendMessage =
|
4518
|
+
this.rawBody = {}, this.validateConfigKey = !1, this.canSendMessage = Re.canSendMessage, this.requestSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.request) == null ? void 0 : n.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, L.set(e, this, t), e.request && (this.requestSettings = e.request), this.demo && ((_a$url = (a = this.requestSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ve.URL), this.requestSettings.websocket && Y.setup(this);
|
4515
4519
|
}
|
4516
|
-
_createClass(
|
4520
|
+
_createClass(Re, [{
|
4517
4521
|
key: "verifyKey",
|
4518
4522
|
value: function verifyKey(e, t) {}
|
4519
4523
|
}, {
|
@@ -4588,7 +4592,7 @@ var Le = /*#__PURE__*/function () {
|
|
4588
4592
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
4589
4593
|
while (1) switch (_context19.prev = _context19.next) {
|
4590
4594
|
case 0:
|
4591
|
-
n =
|
4595
|
+
n = Re.createCustomFormDataBody(this.rawBody, t, i), r = this.requestSettings, o = this.getServiceIOByType(i[0]);
|
4592
4596
|
this.requestSettings = (o == null ? void 0 : o.request) || this.requestSettings;
|
4593
4597
|
_context19.next = 4;
|
4594
4598
|
return this.request(n, e, !1);
|
@@ -4643,7 +4647,7 @@ var Le = /*#__PURE__*/function () {
|
|
4643
4647
|
n = _objectSpread({
|
4644
4648
|
messages: i
|
4645
4649
|
}, this.rawBody);
|
4646
|
-
|
4650
|
+
Y.sendWebsocket(this, n, t, !1);
|
4647
4651
|
} else this.callServiceAPI(t, i, e.files);
|
4648
4652
|
case 4:
|
4649
4653
|
case "end":
|
@@ -4673,7 +4677,7 @@ var Le = /*#__PURE__*/function () {
|
|
4673
4677
|
_context22.next = 4;
|
4674
4678
|
break;
|
4675
4679
|
}
|
4676
|
-
return _context22.abrupt("return",
|
4680
|
+
return _context22.abrupt("return", Ie.handleResponseProperty(e));
|
4677
4681
|
case 4:
|
4678
4682
|
if (!E.validateResponseFormat(e)) {
|
4679
4683
|
_context22.next = 6;
|
@@ -4723,10 +4727,10 @@ var Le = /*#__PURE__*/function () {
|
|
4723
4727
|
return o.text && (delete o.files, n.append("message".concat(r += 1), JSON.stringify(o))), n;
|
4724
4728
|
}
|
4725
4729
|
}]);
|
4726
|
-
return
|
4730
|
+
return Re;
|
4727
4731
|
}();
|
4728
|
-
var U = /*#__PURE__*/function (
|
4729
|
-
_inherits(U,
|
4732
|
+
var U = /*#__PURE__*/function (_Re) {
|
4733
|
+
_inherits(U, _Re);
|
4730
4734
|
var _super = _createSuper(U);
|
4731
4735
|
// prettier-ignore
|
4732
4736
|
function U(e, t, i, n, r) {
|
@@ -4773,7 +4777,7 @@ var U = /*#__PURE__*/function (_Le) {
|
|
4773
4777
|
}
|
4774
4778
|
}]);
|
4775
4779
|
return U;
|
4776
|
-
}(
|
4780
|
+
}(Re);
|
4777
4781
|
var zt = /*#__PURE__*/function () {
|
4778
4782
|
function zt() {
|
4779
4783
|
_classCallCheck(this, zt);
|
@@ -4845,17 +4849,17 @@ $i._attributeToProperty_ = {};
|
|
4845
4849
|
var yo = $i;
|
4846
4850
|
var xo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
|
4847
4851
|
Eo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
|
4848
|
-
var
|
4849
|
-
function
|
4850
|
-
_classCallCheck(this,
|
4852
|
+
var H = /*#__PURE__*/function () {
|
4853
|
+
function H() {
|
4854
|
+
_classCallCheck(this, H);
|
4851
4855
|
}
|
4852
|
-
_createClass(
|
4856
|
+
_createClass(H, null, [{
|
4853
4857
|
key: "createSVGElement",
|
4854
4858
|
value: function createSVGElement(e) {
|
4855
4859
|
return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
4856
4860
|
}
|
4857
4861
|
}]);
|
4858
|
-
return
|
4862
|
+
return H;
|
4859
4863
|
}();
|
4860
4864
|
var os = /*#__PURE__*/function () {
|
4861
4865
|
function Ve() {
|
@@ -4871,7 +4875,7 @@ var os = /*#__PURE__*/function () {
|
|
4871
4875
|
}, {
|
4872
4876
|
key: "createIconElement",
|
4873
4877
|
value: function createIconElement(e, t) {
|
4874
|
-
var i =
|
4878
|
+
var i = H.createSVGElement(e);
|
4875
4879
|
return i.id = t, i.classList.add("visibility-icon"), i;
|
4876
4880
|
}
|
4877
4881
|
// prettier-ignore
|
@@ -5156,8 +5160,8 @@ var Sn = {
|
|
5156
5160
|
}],
|
5157
5161
|
use_web_worker: !0
|
5158
5162
|
},
|
5159
|
-
it = /*#__PURE__*/function (
|
5160
|
-
_inherits(M,
|
5163
|
+
it = /*#__PURE__*/function (_Re2) {
|
5164
|
+
_inherits(M, _Re2);
|
5161
5165
|
var _super3 = _createSuper(M);
|
5162
5166
|
function M(e) {
|
5163
5167
|
var _this8;
|
@@ -5198,7 +5202,7 @@ var Sn = {
|
|
5198
5202
|
var t;
|
5199
5203
|
((t = this._webModel.introMessage) == null ? void 0 : t.autoScroll) !== !1 && setTimeout(function () {
|
5200
5204
|
var i, n;
|
5201
|
-
(i = _this11._messages) != null && i.elementRef &&
|
5205
|
+
(i = _this11._messages) != null && i.elementRef && Z.scrollToTop((n = _this11._messages) == null ? void 0 : n.elementRef);
|
5202
5206
|
}, e);
|
5203
5207
|
}
|
5204
5208
|
// prettier-ignore
|
@@ -5330,7 +5334,7 @@ var Sn = {
|
|
5330
5334
|
sendUpdate: !1
|
5331
5335
|
}), i && (setTimeout(function () {
|
5332
5336
|
var f;
|
5333
|
-
return
|
5337
|
+
return Z.scrollToBottom((f = _this12._messages) == null ? void 0 : f.elementRef);
|
5334
5338
|
}), i = !1);
|
5335
5339
|
};
|
5336
5340
|
M.chat.setInitProgressCallback(n);
|
@@ -5690,7 +5694,7 @@ var Sn = {
|
|
5690
5694
|
}
|
5691
5695
|
}]);
|
5692
5696
|
return M;
|
5693
|
-
}(
|
5697
|
+
}(Re);
|
5694
5698
|
it.GENERIC_ERROR = "Error, please check the [troubleshooting](https://deepchat.dev/docs/webModel#troubleshooting) section of documentation for help.";
|
5695
5699
|
it.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models";
|
5696
5700
|
it.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
|
@@ -5781,9 +5785,9 @@ var as = /*#__PURE__*/function (_U) {
|
|
5781
5785
|
return Fi;
|
5782
5786
|
}(U);
|
5783
5787
|
as.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5784
|
-
var
|
5785
|
-
var wt = /*#__PURE__*/function (
|
5786
|
-
_inherits(wt,
|
5788
|
+
var De = as;
|
5789
|
+
var wt = /*#__PURE__*/function (_De) {
|
5790
|
+
_inherits(wt, _De);
|
5787
5791
|
var _super5 = _createSuper(wt);
|
5788
5792
|
// prettier-ignore
|
5789
5793
|
function wt(e, t, i, n, r, o) {
|
@@ -5836,7 +5840,7 @@ var wt = /*#__PURE__*/function (_Pe) {
|
|
5836
5840
|
}
|
5837
5841
|
}]);
|
5838
5842
|
return wt;
|
5839
|
-
}(
|
5843
|
+
}(De);
|
5840
5844
|
var wo = /*#__PURE__*/function (_wt) {
|
5841
5845
|
_inherits(wo, _wt);
|
5842
5846
|
var _super6 = _createSuper(wo);
|
@@ -6251,8 +6255,8 @@ var Mo = /*#__PURE__*/function (_wt3) {
|
|
6251
6255
|
}]);
|
6252
6256
|
return Mo;
|
6253
6257
|
}(wt);
|
6254
|
-
var To = /*#__PURE__*/function (
|
6255
|
-
_inherits(To,
|
6258
|
+
var To = /*#__PURE__*/function (_De2) {
|
6259
|
+
_inherits(To, _De2);
|
6256
6260
|
var _super12 = _createSuper(To);
|
6257
6261
|
function To(e) {
|
6258
6262
|
_classCallCheck(this, To);
|
@@ -6290,9 +6294,9 @@ var To = /*#__PURE__*/function (_Pe2) {
|
|
6290
6294
|
}()
|
6291
6295
|
}]);
|
6292
6296
|
return To;
|
6293
|
-
}(
|
6294
|
-
var Co = /*#__PURE__*/function (
|
6295
|
-
_inherits(Co,
|
6297
|
+
}(De);
|
6298
|
+
var Co = /*#__PURE__*/function (_De3) {
|
6299
|
+
_inherits(Co, _De3);
|
6296
6300
|
var _super13 = _createSuper(Co);
|
6297
6301
|
function Co(e) {
|
6298
6302
|
var _this19;
|
@@ -6346,9 +6350,9 @@ var Co = /*#__PURE__*/function (_Pe3) {
|
|
6346
6350
|
}()
|
6347
6351
|
}]);
|
6348
6352
|
return Co;
|
6349
|
-
}(
|
6350
|
-
var Ao = /*#__PURE__*/function (
|
6351
|
-
_inherits(Ao,
|
6353
|
+
}(De);
|
6354
|
+
var Ao = /*#__PURE__*/function (_De4) {
|
6355
|
+
_inherits(Ao, _De4);
|
6352
6356
|
var _super14 = _createSuper(Ao);
|
6353
6357
|
function Ao(e) {
|
6354
6358
|
_classCallCheck(this, Ao);
|
@@ -6386,9 +6390,9 @@ var Ao = /*#__PURE__*/function (_Pe4) {
|
|
6386
6390
|
}()
|
6387
6391
|
}]);
|
6388
6392
|
return Ao;
|
6389
|
-
}(
|
6390
|
-
var ko = /*#__PURE__*/function (
|
6391
|
-
_inherits(ko,
|
6393
|
+
}(De);
|
6394
|
+
var ko = /*#__PURE__*/function (_De5) {
|
6395
|
+
_inherits(ko, _De5);
|
6392
6396
|
var _super15 = _createSuper(ko);
|
6393
6397
|
function ko(e) {
|
6394
6398
|
var _this20$maxMessages;
|
@@ -6470,7 +6474,7 @@ var ko = /*#__PURE__*/function (_Pe5) {
|
|
6470
6474
|
}()
|
6471
6475
|
}]);
|
6472
6476
|
return ko;
|
6473
|
-
}(
|
6477
|
+
}(De);
|
6474
6478
|
var Gt = /*#__PURE__*/function (_ri3) {
|
6475
6479
|
_inherits(Gt, _ri3);
|
6476
6480
|
var _super16 = _createSuper(Gt);
|
@@ -6580,8 +6584,8 @@ var Gt = /*#__PURE__*/function (_ri3) {
|
|
6580
6584
|
}]);
|
6581
6585
|
return Gt;
|
6582
6586
|
}(ri);
|
6583
|
-
var Io = /*#__PURE__*/function (
|
6584
|
-
_inherits(Io,
|
6587
|
+
var Io = /*#__PURE__*/function (_De6) {
|
6588
|
+
_inherits(Io, _De6);
|
6585
6589
|
var _super17 = _createSuper(Io);
|
6586
6590
|
function Io(e) {
|
6587
6591
|
_classCallCheck(this, Io);
|
@@ -6619,7 +6623,7 @@ var Io = /*#__PURE__*/function (_Pe6) {
|
|
6619
6623
|
}()
|
6620
6624
|
}]);
|
6621
6625
|
return Io;
|
6622
|
-
}(
|
6626
|
+
}(De);
|
6623
6627
|
var Vt = /*#__PURE__*/function (_ri4) {
|
6624
6628
|
_inherits(Vt, _ri4);
|
6625
6629
|
var _super18 = _createSuper(Vt);
|
@@ -6715,8 +6719,8 @@ var Vt = /*#__PURE__*/function (_ri4) {
|
|
6715
6719
|
}]);
|
6716
6720
|
return Vt;
|
6717
6721
|
}(ri);
|
6718
|
-
var Lo = /*#__PURE__*/function (
|
6719
|
-
_inherits(Lo,
|
6722
|
+
var Lo = /*#__PURE__*/function (_De7) {
|
6723
|
+
_inherits(Lo, _De7);
|
6720
6724
|
var _super19 = _createSuper(Lo);
|
6721
6725
|
function Lo(e) {
|
6722
6726
|
var _this23;
|
@@ -6756,7 +6760,7 @@ var Lo = /*#__PURE__*/function (_Pe7) {
|
|
6756
6760
|
}()
|
6757
6761
|
}]);
|
6758
6762
|
return Lo;
|
6759
|
-
}(
|
6763
|
+
}(De);
|
6760
6764
|
var Wt = /*#__PURE__*/function () {
|
6761
6765
|
function Wt() {
|
6762
6766
|
_classCallCheck(this, Wt);
|
@@ -7185,26 +7189,26 @@ Xi.DEFAULT_MODEL = "tts-1";
|
|
7185
7189
|
Xi.DEFAULT_VOIDE = "alloy";
|
7186
7190
|
var Oo = Xi;
|
7187
7191
|
var oi = /*#__PURE__*/function (_U5) {
|
7188
|
-
_inherits(
|
7189
|
-
var _super24 = _createSuper(
|
7190
|
-
function
|
7192
|
+
_inherits(Se, _U5);
|
7193
|
+
var _super24 = _createSuper(Se);
|
7194
|
+
function Se(e) {
|
7191
7195
|
var _o$model2;
|
7192
7196
|
var _this26;
|
7193
|
-
_classCallCheck(this,
|
7197
|
+
_classCallCheck(this, Se);
|
7194
7198
|
var r, o;
|
7195
7199
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7196
7200
|
i = t == null ? void 0 : t.openAI;
|
7197
7201
|
_this26 = _super24.call(this, e, N.buildKeyVerificationDetails(), N.buildHeaders, i, {
|
7198
7202
|
audio: {}
|
7199
|
-
}), _this26.insertKeyPlaceholderText = "OpenAI API Key", _this26.getKeyLink = "https://platform.openai.com/account/api-keys", _this26.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this26.url = "", _this26.permittedErrorPrefixes = ["Invalid"], _this26.textInputPlaceholderText = "Upload an audio file", _this26._service_url =
|
7203
|
+
}), _this26.insertKeyPlaceholderText = "OpenAI API Key", _this26.getKeyLink = "https://platform.openai.com/account/api-keys", _this26.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this26.url = "", _this26.permittedErrorPrefixes = ["Invalid"], _this26.textInputPlaceholderText = "Upload an audio file", _this26._service_url = Se.AUDIO_TRANSCRIPTIONS_URL;
|
7200
7204
|
var n = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.audio;
|
7201
|
-
_typeof(n) == "object" && (_this26.processConfig(n),
|
7205
|
+
_typeof(n) == "object" && (_this26.processConfig(n), Se.cleanConfig(n), Object.assign(_this26.rawBody, n)), (_o$model2 = (o = _this26.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = Se.DEFAULT_MODEL, _this26.rawBody.response_format = "json", _this26.canSendMessage = Se.canSendFileMessage;
|
7202
7206
|
return _this26;
|
7203
7207
|
}
|
7204
|
-
_createClass(
|
7208
|
+
_createClass(Se, [{
|
7205
7209
|
key: "processConfig",
|
7206
7210
|
value: function processConfig(e) {
|
7207
|
-
e != null && e.type && e.type === "translation" && (this._service_url =
|
7211
|
+
e != null && e.type && e.type === "translation" && (this._service_url = Se.AUDIO_TRANSLATIONS_URL, delete e.language);
|
7208
7212
|
}
|
7209
7213
|
}, {
|
7210
7214
|
key: "preprocessBody",
|
@@ -7236,7 +7240,7 @@ var oi = /*#__PURE__*/function (_U5) {
|
|
7236
7240
|
throw new Error("No file was added");
|
7237
7241
|
case 4:
|
7238
7242
|
this.url = this.requestSettings.url || this._service_url;
|
7239
|
-
n = this.preprocessBody(this.rawBody, t), r =
|
7243
|
+
n = this.preprocessBody(this.rawBody, t), r = Se.createFormDataBody(n, i[0]);
|
7240
7244
|
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
7241
7245
|
case 7:
|
7242
7246
|
case "end":
|
@@ -7295,17 +7299,17 @@ var oi = /*#__PURE__*/function (_U5) {
|
|
7295
7299
|
}), i;
|
7296
7300
|
}
|
7297
7301
|
}]);
|
7298
|
-
return
|
7302
|
+
return Se;
|
7299
7303
|
}(U);
|
7300
7304
|
oi.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
7301
7305
|
oi.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
7302
7306
|
oi.DEFAULT_MODEL = "whisper-1";
|
7303
7307
|
var Po = oi;
|
7304
|
-
var
|
7305
|
-
function
|
7306
|
-
_classCallCheck(this,
|
7308
|
+
var X = /*#__PURE__*/function () {
|
7309
|
+
function X() {
|
7310
|
+
_classCallCheck(this, X);
|
7307
7311
|
}
|
7308
|
-
_createClass(
|
7312
|
+
_createClass(X, null, [{
|
7309
7313
|
key: "buildTextToSpeechHeaders",
|
7310
7314
|
value: function buildTextToSpeechHeaders(e, t) {
|
7311
7315
|
return {
|
@@ -7339,7 +7343,7 @@ var Z = /*#__PURE__*/function () {
|
|
7339
7343
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
7340
7344
|
};
|
7341
7345
|
},
|
7342
|
-
handleVerificationResult:
|
7346
|
+
handleVerificationResult: X.handleSpeechVerificationResult
|
7343
7347
|
};
|
7344
7348
|
}
|
7345
7349
|
}, {
|
@@ -7368,7 +7372,7 @@ var Z = /*#__PURE__*/function () {
|
|
7368
7372
|
"Ocp-Apim-Subscription-Key": "".concat(t)
|
7369
7373
|
};
|
7370
7374
|
},
|
7371
|
-
handleVerificationResult:
|
7375
|
+
handleVerificationResult: X.handleLanguageVerificationResult
|
7372
7376
|
};
|
7373
7377
|
}
|
7374
7378
|
// prettier-ignore
|
@@ -7386,9 +7390,9 @@ var Z = /*#__PURE__*/function () {
|
|
7386
7390
|
url: "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=es",
|
7387
7391
|
method: "POST",
|
7388
7392
|
createHeaders: function createHeaders(t) {
|
7389
|
-
return
|
7393
|
+
return X.buildTranslationHeaders(e, t);
|
7390
7394
|
},
|
7391
|
-
handleVerificationResult:
|
7395
|
+
handleVerificationResult: X.handleTranslationVerificationResult
|
7392
7396
|
};
|
7393
7397
|
}
|
7394
7398
|
}, {
|
@@ -7401,7 +7405,7 @@ var Z = /*#__PURE__*/function () {
|
|
7401
7405
|
return e && (i["Ocp-Apim-Subscription-Region"] = e), i;
|
7402
7406
|
}
|
7403
7407
|
}]);
|
7404
|
-
return
|
7408
|
+
return X;
|
7405
7409
|
}();
|
7406
7410
|
var Do = /*#__PURE__*/function (_U6) {
|
7407
7411
|
_inherits(Do, _U6);
|
@@ -7410,7 +7414,7 @@ var Do = /*#__PURE__*/function (_U6) {
|
|
7410
7414
|
function Do(e, t, i, n, r) {
|
7411
7415
|
var _this27;
|
7412
7416
|
_classCallCheck(this, Do);
|
7413
|
-
_this27 = _super25.call(this, e,
|
7417
|
+
_this27 = _super25.call(this, e, X.buildLanguageKeyVerificationDetails(i), t, n, r), _this27.insertKeyPlaceholderText = "Azure Language Subscription Key", _this27.getKeyLink =
|
7414
7418
|
// eslint-disable-next-line max-len
|
7415
7419
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this27.permittedErrorPrefixes = ["Access"];
|
7416
7420
|
return _this27;
|
@@ -7427,7 +7431,7 @@ var jo = /*#__PURE__*/function (_Do) {
|
|
7427
7431
|
var n, r, o, a;
|
7428
7432
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.summarization,
|
7429
7433
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7430
|
-
_this28 = _super26.call(this, e,
|
7434
|
+
_this28 = _super26.call(this, e, X.buildSummarizationHeader, t.endpoint, i), _this28.url = "", _this28.textInputPlaceholderText = "Insert text to summarize", (_a$language = (a = _this28.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this28.rawBody, t), _this28.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview");
|
7431
7435
|
return _this28;
|
7432
7436
|
}
|
7433
7437
|
_createClass(jo, [{
|
@@ -7771,7 +7775,7 @@ var ls = /*#__PURE__*/function (_U8) {
|
|
7771
7775
|
function ls(e, t, i, n, r) {
|
7772
7776
|
var _this30;
|
7773
7777
|
_classCallCheck(this, ls);
|
7774
|
-
_this30 = _super28.call(this, e,
|
7778
|
+
_this30 = _super28.call(this, e, X.buildSpeechKeyVerificationDetails(i), t, n, r), _this30.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this30.getKeyLink =
|
7775
7779
|
// eslint-disable-next-line max-len
|
7776
7780
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
7777
7781
|
return _this30;
|
@@ -7789,7 +7793,7 @@ var cs = /*#__PURE__*/function (_ls) {
|
|
7789
7793
|
var n, r, o, a, l, c;
|
7790
7794
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.textToSpeech,
|
7791
7795
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7792
|
-
_this31 = _super29.call(this, e,
|
7796
|
+
_this31 = _super29.call(this, e, X.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i), _this31.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(ds.HELP_LINK, "\">here</a> for more info.\n </p>"), _this31.url = "", Object.assign(_this31.rawBody, t), (_a$lang = (a = _this31.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this31.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this31.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this31.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
|
7793
7797
|
return _this31;
|
7794
7798
|
}
|
7795
7799
|
_createClass(ds, [{
|
@@ -7877,7 +7881,7 @@ var us = /*#__PURE__*/function (_ls2) {
|
|
7877
7881
|
}
|
7878
7882
|
}
|
7879
7883
|
};
|
7880
|
-
_this32 = _super30.call(this, e,
|
7884
|
+
_this32 = _super30.call(this, e, X.buildSpeechToTextHeaders, t.region, i, n), _this32.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(zi.HELP_LINK, "\">here</a> for more info.\n </p>"), _this32.url = "", _this32.isTextInputDisabled = !0, _this32.textInputPlaceholderText = "Upload an audio file", _this32.canSendMessage = zi.canFileSendMessage;
|
7881
7885
|
var r = t.lang || "en-US";
|
7882
7886
|
_this32.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this32.recordAudio = void 0;
|
7883
7887
|
return _this32;
|
@@ -7963,7 +7967,7 @@ var zo = /*#__PURE__*/function (_U9) {
|
|
7963
7967
|
var n, r, o;
|
7964
7968
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.translation,
|
7965
7969
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7966
|
-
_this33 = _super31.call(this, e,
|
7970
|
+
_this33 = _super31.call(this, e, X.buildTranslationKeyVerificationDetails(t.region), X.buildTranslationHeaders.bind({}, t == null ? void 0 : t.region), i), _this33.insertKeyPlaceholderText = "Azure Translate Subscription Key", _this33.getKeyLink =
|
7967
7971
|
// eslint-disable-next-line max-len
|
7968
7972
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this33.url = "", _this33.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
|
7969
7973
|
return _this33;
|
@@ -8451,11 +8455,11 @@ en.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
|
8451
8455
|
en.POLLING_TIMEOUT_MS = 800;
|
8452
8456
|
var Uo = en;
|
8453
8457
|
var ai = /*#__PURE__*/function (_U11) {
|
8454
|
-
_inherits(
|
8455
|
-
var _super33 = _createSuper(
|
8456
|
-
function
|
8458
|
+
_inherits(we, _U11);
|
8459
|
+
var _super33 = _createSuper(we);
|
8460
|
+
function we(e) {
|
8457
8461
|
var _this35;
|
8458
|
-
_classCallCheck(this,
|
8462
|
+
_classCallCheck(this, we);
|
8459
8463
|
var o;
|
8460
8464
|
var t = e.directConnection,
|
8461
8465
|
i = t == null ? void 0 : t.openAI,
|
@@ -8478,10 +8482,10 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8478
8482
|
}
|
8479
8483
|
};
|
8480
8484
|
}
|
8481
|
-
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage =
|
8485
|
+
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage = we.canFileSendMessage;
|
8482
8486
|
return _this35;
|
8483
8487
|
}
|
8484
|
-
_createClass(
|
8488
|
+
_createClass(we, [{
|
8485
8489
|
key: "preprocessBody",
|
8486
8490
|
value: function preprocessBody(e, t) {
|
8487
8491
|
var i = JSON.parse(JSON.stringify(e));
|
@@ -8495,10 +8499,10 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8495
8499
|
var n;
|
8496
8500
|
var r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
|
8497
8501
|
if (i[1] || r && r !== "") {
|
8498
|
-
this.url =
|
8502
|
+
this.url = we.IMAGE_EDIT_URL;
|
8499
8503
|
var l = this.preprocessBody(this.rawBody, r);
|
8500
|
-
n =
|
8501
|
-
} else this.url =
|
8504
|
+
n = we.createFormDataBody(l, i[0], i[1]);
|
8505
|
+
} else this.url = we.IMAGE_VARIATIONS_URL, n = we.createFormDataBody(this.rawBody, i[0]);
|
8502
8506
|
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, n, e), !1);
|
8503
8507
|
}
|
8504
8508
|
}, {
|
@@ -8529,7 +8533,7 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8529
8533
|
}
|
8530
8534
|
throw new Error("Request settings have not been set up");
|
8531
8535
|
case 8:
|
8532
|
-
this.url =
|
8536
|
+
this.url = we.IMAGE_GENERATION_URL;
|
8533
8537
|
r = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
8534
8538
|
_.request(this, r, e);
|
8535
8539
|
case 11:
|
@@ -8600,7 +8604,7 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8600
8604
|
}), n;
|
8601
8605
|
}
|
8602
8606
|
}]);
|
8603
|
-
return
|
8607
|
+
return we;
|
8604
8608
|
}(U);
|
8605
8609
|
ai.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
8606
8610
|
ai.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
@@ -8926,7 +8930,7 @@ var Go = /*#__PURE__*/function () {
|
|
8926
8930
|
}
|
8927
8931
|
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Gt(e) : t.stabilityAI.imageToImageUpscale ? new qt(e) : t.stabilityAI.imageToImageMasking ? new Ht(e) : new Vt(e);
|
8928
8932
|
}
|
8929
|
-
return i ? new
|
8933
|
+
return i ? new Re(e) : new Re(e, void 0, n || !0);
|
8930
8934
|
}
|
8931
8935
|
}]);
|
8932
8936
|
return Go;
|
@@ -9116,7 +9120,7 @@ var fe = /*#__PURE__*/function () {
|
|
9116
9120
|
t.classList.add("any-file-message-contents");
|
9117
9121
|
var i = document.createElement("div");
|
9118
9122
|
i.classList.add("any-file-message-icon-container");
|
9119
|
-
var n =
|
9123
|
+
var n = H.createSVGElement(Ko);
|
9120
9124
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9121
9125
|
var r = document.createElement("div");
|
9122
9126
|
return r.classList.add("any-file-message-text"), r.textContent = e.name || ne.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), ne.processContent(t, e.src, r.textContent, !0);
|
@@ -9153,7 +9157,7 @@ var me = /*#__PURE__*/function (_Je) {
|
|
9153
9157
|
o = t.demo;
|
9154
9158
|
_this38._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this38._onClearMessages = Bt.onClearMessages.bind(_assertThisInitialized(_this38), e), _this38._onError = Bt.onError.bind(_assertThisInitialized(_this38), e), _this38._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this38._permittedErrorPrefixes = n, _this38.addSetupMessageIfNeeded(e, t) || _this38.populateIntroPanel(i, r, e.introPanelStyle), _this38.addIntroductoryMessage(e, t), e.initialMessages && _this38.populateInitialMessages(e.initialMessages), _this38._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
9155
9159
|
return JSON.parse(JSON.stringify(_this38.messages));
|
9156
|
-
}, e.clearMessages = _this38.clearMessages.bind(_assertThisInitialized(_this38), t), e.refreshMessages = _this38.refreshTextMessages.bind(_assertThisInitialized(_this38)), e.scrollToBottom =
|
9160
|
+
}, e.clearMessages = _this38.clearMessages.bind(_assertThisInitialized(_this38), t), e.refreshMessages = _this38.refreshTextMessages.bind(_assertThisInitialized(_this38)), e.scrollToBottom = Z.scrollToBottom.bind(_assertThisInitialized(_this38), _this38.elementRef), e._addMessage = function (c, d) {
|
9157
9161
|
_this38.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
|
9158
9162
|
sendUpdate: !!d
|
9159
9163
|
}), !d);
|
@@ -9201,9 +9205,9 @@ var me = /*#__PURE__*/function (_Je) {
|
|
9201
9205
|
value: function populateInitialMessages(e) {
|
9202
9206
|
var _this39 = this;
|
9203
9207
|
e.forEach(function (t) {
|
9204
|
-
|
9208
|
+
Ie.processInitialMessageFile(t), _this39.addNewMessage(t, !0);
|
9205
9209
|
}), setTimeout(function () {
|
9206
|
-
return
|
9210
|
+
return Z.scrollToBottom(_this39.elementRef);
|
9207
9211
|
}, 0);
|
9208
9212
|
}
|
9209
9213
|
// this should not be activated by streamed messages
|
@@ -9254,7 +9258,7 @@ var me = /*#__PURE__*/function (_Je) {
|
|
9254
9258
|
var o = this.getPermittedMessage(t) || ((l = this._errorMessageOverrides) == null ? void 0 : l[e]) || ((c = this._errorMessageOverrides) == null ? void 0 : c["default"]) || "Error, please try again.";
|
9255
9259
|
this.renderText(r, o);
|
9256
9260
|
var a = D.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
9257
|
-
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n),
|
9261
|
+
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), Z.scrollToBottom(this.elementRef), this.textToSpeech && jt.speak(o, this.textToSpeech), (p = this._onError) == null || p.call(this, o);
|
9258
9262
|
}
|
9259
9263
|
}, {
|
9260
9264
|
key: "getPermittedMessage",
|
@@ -9291,7 +9295,7 @@ var me = /*#__PURE__*/function (_Je) {
|
|
9291
9295
|
i = e.bubbleElement;
|
9292
9296
|
i.classList.add("loading-message-text");
|
9293
9297
|
var n = document.createElement("div");
|
9294
|
-
n.classList.add("dots-flashing"), i.appendChild(n), this.applyCustomStyles(e, v.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), tn.set(i, this.messageStyles), this.elementRef.appendChild(t),
|
9298
|
+
n.classList.add("dots-flashing"), i.appendChild(n), this.applyCustomStyles(e, v.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), tn.set(i, this.messageStyles), this.elementRef.appendChild(t), Z.scrollToBottom(this.elementRef);
|
9295
9299
|
}
|
9296
9300
|
}, {
|
9297
9301
|
key: "populateIntroPanel",
|
@@ -9366,10 +9370,10 @@ var me = /*#__PURE__*/function (_Je) {
|
|
9366
9370
|
return me;
|
9367
9371
|
}(Je);
|
9368
9372
|
var Mt = /*#__PURE__*/function () {
|
9369
|
-
function
|
9370
|
-
_classCallCheck(this,
|
9373
|
+
function K() {
|
9374
|
+
_classCallCheck(this, K);
|
9371
9375
|
}
|
9372
|
-
_createClass(
|
9376
|
+
_createClass(K, null, [{
|
9373
9377
|
key: "adjustInputPadding",
|
9374
9378
|
value: function adjustInputPadding(e, t) {
|
9375
9379
|
t["inside-left"].length > 0 && e.classList.add("text-input-inner-left-adjustment"), t["inside-right"].length > 0 && e.classList.add("text-input-inner-right-adjustment");
|
@@ -9377,7 +9381,7 @@ var Mt = /*#__PURE__*/function () {
|
|
9377
9381
|
}, {
|
9378
9382
|
key: "adjustForOutsideButton",
|
9379
9383
|
value: function adjustForOutsideButton(e, t, i) {
|
9380
|
-
i["outside-right"].length === 0 && i["outside-left"].length > 0 ? (e[0].classList.add(
|
9384
|
+
i["outside-right"].length === 0 && i["outside-left"].length > 0 ? (e[0].classList.add(K.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(K.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : i["outside-left"].length === 0 && i["outside-right"].length > 0 && (e[3].classList.add(K.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(K.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
|
9381
9385
|
}
|
9382
9386
|
// when submit is the only button
|
9383
9387
|
// when submit button is outside by itself - we increase the height for a better look
|
@@ -9385,10 +9389,10 @@ var Mt = /*#__PURE__*/function () {
|
|
9385
9389
|
key: "adjustOutsideSubmit",
|
9386
9390
|
value: function adjustOutsideSubmit(e, t, i) {
|
9387
9391
|
if (!(i["inside-left"].length > 0 || i["inside-right"].length > 0)) {
|
9388
|
-
if (i["outside-right"].length === 0 && i["outside-left"].length > 0) return e[0].classList.add(
|
9392
|
+
if (i["outside-right"].length === 0 && i["outside-left"].length > 0) return e[0].classList.add(K.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(K.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), i["outside-left"].map(function (n) {
|
9389
9393
|
return n.button.elementRef.classList.add("submit-button-enlarged");
|
9390
9394
|
});
|
9391
|
-
if (i["outside-left"].length === 0 && i["outside-right"].length > 0) return e[3].classList.add(
|
9395
|
+
if (i["outside-left"].length === 0 && i["outside-right"].length > 0) return e[3].classList.add(K.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(K.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), i["outside-right"].map(function (n) {
|
9392
9396
|
return n.button.elementRef.classList.add("submit-button-enlarged");
|
9393
9397
|
});
|
9394
9398
|
}
|
@@ -9396,10 +9400,10 @@ var Mt = /*#__PURE__*/function () {
|
|
9396
9400
|
}, {
|
9397
9401
|
key: "set",
|
9398
9402
|
value: function set(e, t, i, n) {
|
9399
|
-
!!
|
9403
|
+
!!K.adjustOutsideSubmit(t, i, n) || K.adjustForOutsideButton(t, i, n), K.adjustInputPadding(e, n);
|
9400
9404
|
}
|
9401
9405
|
}]);
|
9402
|
-
return
|
9406
|
+
return K;
|
9403
9407
|
}();
|
9404
9408
|
Mt.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
|
9405
9409
|
Mt.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
|
@@ -9454,7 +9458,7 @@ var j = /*#__PURE__*/function () {
|
|
9454
9458
|
}, {
|
9455
9459
|
key: "createElement",
|
9456
9460
|
value: function createElement(e, t) {
|
9457
|
-
return t ? j.createTextElement(e) :
|
9461
|
+
return t ? j.createTextElement(e) : H.createSVGElement(e);
|
9458
9462
|
}
|
9459
9463
|
}, {
|
9460
9464
|
key: "createCustomElement",
|
@@ -9600,14 +9604,14 @@ var yt = /*#__PURE__*/function () {
|
|
9600
9604
|
}]);
|
9601
9605
|
return yt;
|
9602
9606
|
}();
|
9603
|
-
var
|
9604
|
-
function
|
9605
|
-
_classCallCheck(this,
|
9607
|
+
var Me = /*#__PURE__*/function () {
|
9608
|
+
function Me() {
|
9609
|
+
_classCallCheck(this, Me);
|
9606
9610
|
}
|
9607
|
-
_createClass(
|
9611
|
+
_createClass(Me, null, [{
|
9608
9612
|
key: "addItemEvents",
|
9609
9613
|
value: function addItemEvents(e, t, i, n) {
|
9610
|
-
|
9614
|
+
Ce.add(t, n), t.addEventListener("click", function () {
|
9611
9615
|
i.click();
|
9612
9616
|
}), t.addEventListener("mouseenter", function (r) {
|
9613
9617
|
e.highlightedItem = r.target;
|
@@ -9631,7 +9635,7 @@ var _e = /*#__PURE__*/function () {
|
|
9631
9635
|
key: "populateItem",
|
9632
9636
|
value: function populateItem(e, t, i, n) {
|
9633
9637
|
var r = e.children[0];
|
9634
|
-
r.classList.contains("text-button") ? t.appendChild(
|
9638
|
+
r.classList.contains("text-button") ? t.appendChild(Me.createItemText(r.textContent, n == null ? void 0 : n.text)) : (t.appendChild(Me.createItemIcon(e, n == null ? void 0 : n.iconContainer)), t.appendChild(Me.createItemText(i, n == null ? void 0 : n.text)));
|
9635
9639
|
}
|
9636
9640
|
// prettier-ignore
|
9637
9641
|
}, {
|
@@ -9641,16 +9645,16 @@ var _e = /*#__PURE__*/function () {
|
|
9641
9645
|
var n = t.elementRef,
|
9642
9646
|
r = t.dropupText,
|
9643
9647
|
o = document.createElement("div");
|
9644
|
-
Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]),
|
9648
|
+
Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), Me.populateItem(n, o, r, i), o.classList.add("dropup-menu-item");
|
9645
9649
|
var a = T.processStateful((i == null ? void 0 : i.item) || {}, {
|
9646
9650
|
backgroundColor: "#f3f3f3"
|
9647
9651
|
}, {
|
9648
9652
|
backgroundColor: "#ebebeb"
|
9649
9653
|
});
|
9650
|
-
return
|
9654
|
+
return Me.addItemEvents(e, o, n, a), o;
|
9651
9655
|
}
|
9652
9656
|
}]);
|
9653
|
-
return
|
9657
|
+
return Me;
|
9654
9658
|
}();
|
9655
9659
|
var nn = /*#__PURE__*/function () {
|
9656
9660
|
function nn(e, t) {
|
@@ -9679,7 +9683,7 @@ var nn = /*#__PURE__*/function () {
|
|
9679
9683
|
}, {
|
9680
9684
|
key: "addItem",
|
9681
9685
|
value: function addItem(e) {
|
9682
|
-
var t =
|
9686
|
+
var t = Me.createItem(this, e, this._styles);
|
9683
9687
|
this.elementRef.appendChild(t);
|
9684
9688
|
}
|
9685
9689
|
// prettier-ignore
|
@@ -9763,7 +9767,7 @@ var Ye = /*#__PURE__*/function (_Tt) {
|
|
9763
9767
|
}, {
|
9764
9768
|
key: "createSVGIconElement",
|
9765
9769
|
value: function createSVGIconElement() {
|
9766
|
-
return
|
9770
|
+
return H.createSVGElement($o);
|
9767
9771
|
}
|
9768
9772
|
}, {
|
9769
9773
|
key: "createButtonContainer",
|
@@ -10019,19 +10023,19 @@ var ue = /*#__PURE__*/function () {
|
|
10019
10023
|
var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
10020
10024
|
_n = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
10021
10025
|
fs = /*#__PURE__*/function (_ue) {
|
10022
|
-
_inherits(
|
10023
|
-
var _super38 = _createSuper(
|
10026
|
+
_inherits(_e, _ue);
|
10027
|
+
var _super38 = _createSuper(_e);
|
10024
10028
|
// prettier-ignore
|
10025
|
-
function
|
10026
|
-
_classCallCheck(this,
|
10029
|
+
function _e(e, t, i, n) {
|
10030
|
+
_classCallCheck(this, _e);
|
10027
10031
|
return _super38.call(this, e, t, i, n);
|
10028
10032
|
}
|
10029
|
-
_createClass(
|
10033
|
+
_createClass(_e, [{
|
10030
10034
|
key: "createTimer",
|
10031
10035
|
value: function createTimer(e, t) {
|
10032
10036
|
var _this44 = this;
|
10033
10037
|
var i = 0;
|
10034
|
-
var n = t !== void 0 && t <
|
10038
|
+
var n = t !== void 0 && t < _e.TIMER_LIMIT_S ? t : _e.TIMER_LIMIT_S;
|
10035
10039
|
return setInterval(function () {
|
10036
10040
|
var a;
|
10037
10041
|
i += 1, i === n && ((a = _this44.stopPlaceholderCallback) == null || a.call(_this44), _this44.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
@@ -10043,12 +10047,12 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10043
10047
|
}, {
|
10044
10048
|
key: "createPlaceholderAudioAttachment",
|
10045
10049
|
value: function createPlaceholderAudioAttachment(e) {
|
10046
|
-
var t =
|
10050
|
+
var t = _e.createAudioContainer(),
|
10047
10051
|
i = document.createElement("div");
|
10048
10052
|
i.classList.add("audio-placeholder-text-3-digits");
|
10049
10053
|
var n = document.createElement("div");
|
10050
10054
|
n.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), n.appendChild(i);
|
10051
|
-
var r =
|
10055
|
+
var r = H.createSVGElement(_n);
|
10052
10056
|
return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(n), this.addPlaceholderAudioAttachmentEvents(t, r, n), t;
|
10053
10057
|
}
|
10054
10058
|
}, {
|
@@ -10080,7 +10084,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10080
10084
|
key: "completePlaceholderAttachment",
|
10081
10085
|
value: function completePlaceholderAttachment(e, t) {
|
10082
10086
|
var i = this._activePlaceholderAttachment;
|
10083
|
-
i && (i.file = e,
|
10087
|
+
i && (i.file = e, _e.addAudioElements(i.attachmentContainerElement.children[0], t), i.removeButton = this.createRemoveAttachmentButton(i), i.attachmentContainerElement.appendChild(i.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
|
10084
10088
|
}
|
10085
10089
|
}, {
|
10086
10090
|
key: "removePlaceholderAttachment",
|
@@ -10101,12 +10105,12 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10101
10105
|
}, {
|
10102
10106
|
key: "addAudioElements",
|
10103
10107
|
value: function addAudioElements(e, t) {
|
10104
|
-
var i = e.parentElement ?
|
10108
|
+
var i = e.parentElement ? Z.cloneElement(e) : e,
|
10105
10109
|
n = document.createElement("audio");
|
10106
10110
|
n.src = t;
|
10107
|
-
var r =
|
10111
|
+
var r = H.createSVGElement(ta);
|
10108
10112
|
r.classList.add("attachment-icon", "play-icon");
|
10109
|
-
var o =
|
10113
|
+
var o = H.createSVGElement(_n);
|
10110
10114
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), n.onplay = function () {
|
10111
10115
|
i.replaceChildren(o);
|
10112
10116
|
}, n.onpause = function () {
|
@@ -10120,8 +10124,8 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10120
10124
|
}, {
|
10121
10125
|
key: "createAudioAttachment",
|
10122
10126
|
value: function createAudioAttachment(e) {
|
10123
|
-
var t =
|
10124
|
-
return
|
10127
|
+
var t = _e.createAudioContainer();
|
10128
|
+
return _e.addAudioElements(t, e), t;
|
10125
10129
|
}
|
10126
10130
|
}, {
|
10127
10131
|
key: "stopAttachmentPlayback",
|
@@ -10130,7 +10134,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10130
10134
|
(n = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && n.classList.contains("stop-icon") && e.children[0].click();
|
10131
10135
|
}
|
10132
10136
|
}]);
|
10133
|
-
return
|
10137
|
+
return _e;
|
10134
10138
|
}(ue);
|
10135
10139
|
fs.TIMER_LIMIT_S = 5999;
|
10136
10140
|
var qi = fs;
|
@@ -10344,7 +10348,7 @@ var ms = /*#__PURE__*/function () {
|
|
10344
10348
|
value: function createSVGButton(e) {
|
10345
10349
|
var t = document.createElement("div");
|
10346
10350
|
t.classList.add("modal-button", "modal-svg-button");
|
10347
|
-
var i =
|
10351
|
+
var i = H.createSVGElement(e);
|
10348
10352
|
return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
|
10349
10353
|
}
|
10350
10354
|
}, {
|
@@ -10424,7 +10428,7 @@ var pt = /*#__PURE__*/function (_Tt2) {
|
|
10424
10428
|
}, {
|
10425
10429
|
key: "createSVGIconElement",
|
10426
10430
|
value: function createSVGIconElement(e, t) {
|
10427
|
-
var i =
|
10431
|
+
var i = H.createSVGElement(t);
|
10428
10432
|
return i.id = e, i;
|
10429
10433
|
}
|
10430
10434
|
}]);
|
@@ -10484,11 +10488,11 @@ var de = /*#__PURE__*/function () {
|
|
10484
10488
|
}]);
|
10485
10489
|
return de;
|
10486
10490
|
}();
|
10487
|
-
var
|
10488
|
-
function
|
10489
|
-
_classCallCheck(this,
|
10491
|
+
var Te = /*#__PURE__*/function () {
|
10492
|
+
function Te() {
|
10493
|
+
_classCallCheck(this, Te);
|
10490
10494
|
}
|
10491
|
-
_createClass(
|
10495
|
+
_createClass(Te, null, [{
|
10492
10496
|
key: "validate",
|
10493
10497
|
value:
|
10494
10498
|
// prettier-ignore
|
@@ -10512,7 +10516,7 @@ var Me = /*#__PURE__*/function () {
|
|
10512
10516
|
a = i.getAllFileData(), l = a == null ? void 0 : a.map(function (c) {
|
10513
10517
|
return c.file;
|
10514
10518
|
});
|
10515
|
-
return _context94.abrupt("return",
|
10519
|
+
return _context94.abrupt("return", Te.validate(e, n, o, l));
|
10516
10520
|
case 5:
|
10517
10521
|
case "end":
|
10518
10522
|
return _context94.stop();
|
@@ -10535,7 +10539,7 @@ var Me = /*#__PURE__*/function () {
|
|
10535
10539
|
n = (r = t.files) == null ? void 0 : r.map(function (o) {
|
10536
10540
|
return o.file;
|
10537
10541
|
});
|
10538
|
-
return _context95.abrupt("return",
|
10542
|
+
return _context95.abrupt("return", Te.validate(e, i, t.text, n, !0));
|
10539
10543
|
case 2:
|
10540
10544
|
case "end":
|
10541
10545
|
return _context95.stop();
|
@@ -10550,27 +10554,27 @@ var Me = /*#__PURE__*/function () {
|
|
10550
10554
|
}, {
|
10551
10555
|
key: "validateWebsocket",
|
10552
10556
|
value: function validateWebsocket(e, t) {
|
10553
|
-
return e.websocket &&
|
10557
|
+
return e.websocket && !Y.canSendMessage(e.websocket) ? (t.changeToDisabledIcon(), !1) : !0;
|
10554
10558
|
}
|
10555
10559
|
// prettier-ignore
|
10556
10560
|
}, {
|
10557
10561
|
key: "attach",
|
10558
10562
|
value: function attach(e, t, i, n, r) {
|
10559
|
-
var o = e.validateInput ||
|
10563
|
+
var o = e.validateInput || Ie.processValidateInput(e);
|
10560
10564
|
e._validationHandler = /*#__PURE__*/function () {
|
10561
10565
|
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(a) {
|
10562
10566
|
var l;
|
10563
10567
|
return _regeneratorRuntime().wrap(function _callee96$(_context96) {
|
10564
10568
|
while (1) switch (_context96.prev = _context96.next) {
|
10565
10569
|
case 0:
|
10566
|
-
if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !
|
10570
|
+
if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !Te.validateWebsocket(t, r))) {
|
10567
10571
|
_context96.next = 2;
|
10568
10572
|
break;
|
10569
10573
|
}
|
10570
10574
|
return _context96.abrupt("return", !1);
|
10571
10575
|
case 2:
|
10572
10576
|
l = o || t.canSendMessage;
|
10573
|
-
return _context96.abrupt("return", l ? a ?
|
10577
|
+
return _context96.abrupt("return", l ? a ? Te.useValidationFuncProgrammatic(l, a, r) : Te.useValidationFunc(l, i, n, r) : null);
|
10574
10578
|
case 4:
|
10575
10579
|
case "end":
|
10576
10580
|
return _context96.stop();
|
@@ -10583,7 +10587,7 @@ var Me = /*#__PURE__*/function () {
|
|
10583
10587
|
}();
|
10584
10588
|
}
|
10585
10589
|
}]);
|
10586
|
-
return
|
10590
|
+
return Te;
|
10587
10591
|
}();
|
10588
10592
|
var na = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\" width=\"1.4em\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t viewBox=\"0 0 490.9 490.9\" xml:space=\"preserve\">\n\t<g>\n\t\t<g>\n\t\t\t<path d=\"M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5\n\t\t\t\tC149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5\n\t\t\t\tc0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z\"/>\n\t\t\t<path d=\"M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3\n\t\t\t\ts5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8\n\t\t\t\tc0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9\n\t\t\t\tC106.6,220,101.2,214.5,94.4,214.5z\"/>\n\t\t</g>\n\t</g>\n</svg>\n";
|
10589
10593
|
var xt = /*#__PURE__*/function (_Tt3) {
|
@@ -10657,7 +10661,7 @@ var xt = /*#__PURE__*/function (_Tt3) {
|
|
10657
10661
|
}, {
|
10658
10662
|
key: "createSVGIconElement",
|
10659
10663
|
value: function createSVGIconElement() {
|
10660
|
-
var e =
|
10664
|
+
var e = H.createSVGElement(na);
|
10661
10665
|
return e.id = "microphone-icon", e;
|
10662
10666
|
}
|
10663
10667
|
}]);
|
@@ -10667,11 +10671,11 @@ var gs = {},
|
|
10667
10671
|
li = {},
|
10668
10672
|
ci = {},
|
10669
10673
|
At = {},
|
10670
|
-
|
10671
|
-
Object.defineProperty(
|
10674
|
+
je = {};
|
10675
|
+
Object.defineProperty(je, "__esModule", {
|
10672
10676
|
value: !0
|
10673
10677
|
});
|
10674
|
-
|
10678
|
+
je.Text = void 0;
|
10675
10679
|
var ye = /*#__PURE__*/function () {
|
10676
10680
|
function ye() {
|
10677
10681
|
_classCallCheck(this, ye);
|
@@ -10702,7 +10706,7 @@ var ye = /*#__PURE__*/function () {
|
|
10702
10706
|
}]);
|
10703
10707
|
return ye;
|
10704
10708
|
}();
|
10705
|
-
|
10709
|
+
je.Text = ye;
|
10706
10710
|
ye.FIRST_CHAR_REGEX = /\S/;
|
10707
10711
|
ye.DOUBLE_LINE = /\n\n/g;
|
10708
10712
|
ye.ONE_LINE = /\n/g;
|
@@ -10710,7 +10714,7 @@ Object.defineProperty(At, "__esModule", {
|
|
10710
10714
|
value: !0
|
10711
10715
|
});
|
10712
10716
|
At.Translate = void 0;
|
10713
|
-
var sa =
|
10717
|
+
var sa = je;
|
10714
10718
|
var ra = /*#__PURE__*/function () {
|
10715
10719
|
function ra() {
|
10716
10720
|
_classCallCheck(this, ra);
|
@@ -10786,11 +10790,11 @@ Object.defineProperty(di, "__esModule", {
|
|
10786
10790
|
value: !0
|
10787
10791
|
});
|
10788
10792
|
di.EventListeners = void 0;
|
10789
|
-
var
|
10790
|
-
function
|
10791
|
-
_classCallCheck(this,
|
10793
|
+
var $ = /*#__PURE__*/function () {
|
10794
|
+
function $() {
|
10795
|
+
_classCallCheck(this, $);
|
10792
10796
|
}
|
10793
|
-
_createClass(
|
10797
|
+
_createClass($, null, [{
|
10794
10798
|
key: "getElementIfFocusedOnAvailable",
|
10795
10799
|
value: function getElementIfFocusedOnAvailable(e, t) {
|
10796
10800
|
return Array.isArray(e) ? e.find(function (i) {
|
@@ -10801,14 +10805,14 @@ var J = /*#__PURE__*/function () {
|
|
10801
10805
|
key: "keyDownWindow",
|
10802
10806
|
value: function keyDownWindow(e) {
|
10803
10807
|
var _this51 = this;
|
10804
|
-
e.element &&
|
10805
|
-
|
10808
|
+
e.element && $.getElementIfFocusedOnAvailable(e.element, document.activeElement) && ($.KEY_DOWN_TIMEOUT !== null && clearTimeout($.KEY_DOWN_TIMEOUT), $.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
10809
|
+
$.KEY_DOWN_TIMEOUT = null, _this51.resetRecording(e);
|
10806
10810
|
}, 500));
|
10807
10811
|
}
|
10808
10812
|
}, {
|
10809
10813
|
key: "mouseDownWindow",
|
10810
10814
|
value: function mouseDownWindow(e, t) {
|
10811
|
-
this.mouseDownElement =
|
10815
|
+
this.mouseDownElement = $.getElementIfFocusedOnAvailable(e, t.target);
|
10812
10816
|
}
|
10813
10817
|
}, {
|
10814
10818
|
key: "mouseUpWindow",
|
@@ -10819,7 +10823,7 @@ var J = /*#__PURE__*/function () {
|
|
10819
10823
|
key: "add",
|
10820
10824
|
value: function add(e, t) {
|
10821
10825
|
var i = (t == null ? void 0 : t.insertInCursorLocation) === void 0 || (t == null ? void 0 : t.insertInCursorLocation);
|
10822
|
-
t != null && t.element && i && (e.mouseDownEvent =
|
10826
|
+
t != null && t.element && i && (e.mouseDownEvent = $.mouseDownWindow.bind(e, t.element), document.addEventListener("mousedown", e.mouseDownEvent), e.mouseUpEvent = $.mouseUpWindow.bind(e, t), document.addEventListener("mouseup", e.mouseUpEvent), e.keyDownEvent = $.keyDownWindow.bind(e, t), document.addEventListener("keydown", e.keyDownEvent));
|
10823
10827
|
}
|
10824
10828
|
}, {
|
10825
10829
|
key: "remove",
|
@@ -10827,10 +10831,10 @@ var J = /*#__PURE__*/function () {
|
|
10827
10831
|
document.removeEventListener("mousedown", e.mouseDownEvent), document.removeEventListener("mouseup", e.mouseUpEvent), document.removeEventListener("keydown", e.keyDownEvent);
|
10828
10832
|
}
|
10829
10833
|
}]);
|
10830
|
-
return
|
10834
|
+
return $;
|
10831
10835
|
}();
|
10832
|
-
di.EventListeners =
|
10833
|
-
|
10836
|
+
di.EventListeners = $;
|
10837
|
+
$.KEY_DOWN_TIMEOUT = null;
|
10834
10838
|
var ui = {};
|
10835
10839
|
Object.defineProperty(ui, "__esModule", {
|
10836
10840
|
value: !0
|
@@ -10895,11 +10899,11 @@ var sn = /*#__PURE__*/function () {
|
|
10895
10899
|
return sn;
|
10896
10900
|
}();
|
10897
10901
|
Lt.AutoScroll = sn;
|
10898
|
-
var
|
10899
|
-
Object.defineProperty(
|
10902
|
+
var Fe = {};
|
10903
|
+
Object.defineProperty(Fe, "__esModule", {
|
10900
10904
|
value: !0
|
10901
10905
|
});
|
10902
|
-
|
10906
|
+
Fe.Elements = void 0;
|
10903
10907
|
var la = /*#__PURE__*/function () {
|
10904
10908
|
function la() {
|
10905
10909
|
_classCallCheck(this, la);
|
@@ -10947,12 +10951,12 @@ var la = /*#__PURE__*/function () {
|
|
10947
10951
|
}]);
|
10948
10952
|
return la;
|
10949
10953
|
}();
|
10950
|
-
|
10951
|
-
var
|
10952
|
-
Object.defineProperty(
|
10954
|
+
Fe.Elements = la;
|
10955
|
+
var Be = {};
|
10956
|
+
Object.defineProperty(Be, "__esModule", {
|
10953
10957
|
value: !0
|
10954
10958
|
});
|
10955
|
-
|
10959
|
+
Be.Cursor = void 0;
|
10956
10960
|
var ft = /*#__PURE__*/function () {
|
10957
10961
|
function ft() {
|
10958
10962
|
_classCallCheck(this, ft);
|
@@ -11034,21 +11038,21 @@ var ft = /*#__PURE__*/function () {
|
|
11034
11038
|
}]);
|
11035
11039
|
return ft;
|
11036
11040
|
}();
|
11037
|
-
|
11041
|
+
Be.Cursor = ft;
|
11038
11042
|
Object.defineProperty(It, "__esModule", {
|
11039
11043
|
value: !0
|
11040
11044
|
});
|
11041
11045
|
It.CommandUtils = void 0;
|
11042
11046
|
var Tn = Lt,
|
11043
|
-
ca =
|
11047
|
+
ca = Fe,
|
11044
11048
|
da = nt,
|
11045
|
-
Cn =
|
11046
|
-
An =
|
11047
|
-
var
|
11048
|
-
function
|
11049
|
-
_classCallCheck(this,
|
11049
|
+
Cn = Be,
|
11050
|
+
An = je;
|
11051
|
+
var J = /*#__PURE__*/function () {
|
11052
|
+
function J() {
|
11053
|
+
_classCallCheck(this, J);
|
11050
11054
|
}
|
11051
|
-
_createClass(
|
11055
|
+
_createClass(J, null, [{
|
11052
11056
|
key: "processCommand",
|
11053
11057
|
value: function processCommand(e, t) {
|
11054
11058
|
return (!t || !t.caseSensitive) && (e = e.toLowerCase()), (t == null ? void 0 : t.substrings) === !1 ? An.Text.breakupIntoWordsArr(e) : e;
|
@@ -11059,7 +11063,7 @@ var K = /*#__PURE__*/function () {
|
|
11059
11063
|
var t;
|
11060
11064
|
return ((t = e.settings) === null || t === void 0 ? void 0 : t.caseSensitive) === !0 ? e : Object.keys(e).reduce(function (n, r) {
|
11061
11065
|
var o = e[r];
|
11062
|
-
return n[r] = typeof o == "string" ?
|
11066
|
+
return n[r] = typeof o == "string" ? J.processCommand(o, e.settings) : o, n;
|
11063
11067
|
}, {});
|
11064
11068
|
}
|
11065
11069
|
}, {
|
@@ -11077,7 +11081,7 @@ var K = /*#__PURE__*/function () {
|
|
11077
11081
|
}, {
|
11078
11082
|
key: "setText",
|
11079
11083
|
value: function setText(e, t, i, n) {
|
11080
|
-
|
11084
|
+
J.toggleCommandModeOff(e), ca.Elements.isPrimitiveElement(n) ? (n.value = i, e.isTargetInShadow || Cn.Cursor.setOffsetForPrimitive(n, i.length, !0), da.Browser.IS_SAFARI() && e.autoScroll && Tn.AutoScroll.scrollSafariPrimitiveToEnd(n)) : (n.textContent = i, e.isTargetInShadow || Cn.Cursor.focusEndOfGeneric(n), setTimeout(function () {
|
11081
11085
|
return Tn.AutoScroll.scrollGeneric(e, n);
|
11082
11086
|
})), e.resetRecording(t);
|
11083
11087
|
}
|
@@ -11107,46 +11111,46 @@ var K = /*#__PURE__*/function () {
|
|
11107
11111
|
if (!c || !n || !i) return;
|
11108
11112
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
11109
11113
|
u = An.Text.breakupIntoWordsArr(d),
|
11110
|
-
p = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ?
|
11114
|
+
p = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? J.checkIfMatchesWord : J.checkIfMatchesSubstring;
|
11111
11115
|
if (c.commandMode && p(c.commandMode, d, u)) return e.setInterimColorToFinal(), setTimeout(function () {
|
11112
|
-
return
|
11116
|
+
return J.toggleCommandModeOn(e);
|
11113
11117
|
}), {
|
11114
11118
|
doNotProcessTranscription: !1
|
11115
11119
|
};
|
11116
11120
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
11117
|
-
if (c.stop && p(c.stop, d, u)) return
|
11121
|
+
if (c.stop && p(c.stop, d, u)) return J.toggleCommandModeOff(e), setTimeout(function () {
|
11118
11122
|
return e.stop();
|
11119
11123
|
}), {
|
11120
11124
|
doNotProcessTranscription: !1
|
11121
11125
|
};
|
11122
|
-
if (c.pause && p(c.pause, d, u)) return
|
11126
|
+
if (c.pause && p(c.pause, d, u)) return J.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
11123
11127
|
var h;
|
11124
11128
|
e.isPaused = !0, (h = e.onPauseTrigger) === null || h === void 0 || h.call(e, !0);
|
11125
11129
|
}), {
|
11126
11130
|
doNotProcessTranscription: !1
|
11127
11131
|
};
|
11128
|
-
if (c.resume && p(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1),
|
11132
|
+
if (c.resume && p(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), J.toggleCommandModeOff(e), e.resetRecording(i), {
|
11129
11133
|
doNotProcessTranscription: !0
|
11130
11134
|
};
|
11131
|
-
if (c.reset && p(c.reset, d, u)) return r !== void 0 &&
|
11135
|
+
if (c.reset && p(c.reset, d, u)) return r !== void 0 && J.setText(e, i, r, n), {
|
11132
11136
|
doNotProcessTranscription: !0
|
11133
11137
|
};
|
11134
|
-
if (c.removeAllText && p(c.removeAllText, d, u)) return
|
11138
|
+
if (c.removeAllText && p(c.removeAllText, d, u)) return J.setText(e, i, "", n), {
|
11135
11139
|
doNotProcessTranscription: !0
|
11136
11140
|
};
|
11137
11141
|
}
|
11138
11142
|
}
|
11139
11143
|
}]);
|
11140
|
-
return
|
11144
|
+
return J;
|
11141
11145
|
}();
|
11142
|
-
It.CommandUtils =
|
11146
|
+
It.CommandUtils = J;
|
11143
11147
|
var hi = {};
|
11144
11148
|
Object.defineProperty(hi, "__esModule", {
|
11145
11149
|
value: !0
|
11146
11150
|
});
|
11147
11151
|
hi.Highlight = void 0;
|
11148
|
-
var ua =
|
11149
|
-
st =
|
11152
|
+
var ua = Fe,
|
11153
|
+
st = Be;
|
11150
11154
|
var Jt = /*#__PURE__*/function () {
|
11151
11155
|
function Jt() {
|
11152
11156
|
_classCallCheck(this, Jt);
|
@@ -11202,9 +11206,9 @@ Object.defineProperty(pi, "__esModule", {
|
|
11202
11206
|
value: !0
|
11203
11207
|
});
|
11204
11208
|
pi.Padding = void 0;
|
11205
|
-
var ha =
|
11206
|
-
kn =
|
11207
|
-
Ue =
|
11209
|
+
var ha = Fe,
|
11210
|
+
kn = Be,
|
11211
|
+
Ue = je;
|
11208
11212
|
var $t = /*#__PURE__*/function () {
|
11209
11213
|
function $t() {
|
11210
11214
|
_classCallCheck(this, $t);
|
@@ -11273,11 +11277,11 @@ var In = di,
|
|
11273
11277
|
Ln = It,
|
11274
11278
|
Pt = Lt,
|
11275
11279
|
Ai = hi,
|
11276
|
-
ie =
|
11280
|
+
ie = Fe,
|
11277
11281
|
ki = pi,
|
11278
11282
|
Rn = nt,
|
11279
|
-
Nn =
|
11280
|
-
Ii =
|
11283
|
+
Nn = Be,
|
11284
|
+
Ii = je;
|
11281
11285
|
var fa = /*#__PURE__*/function () {
|
11282
11286
|
function fa() {
|
11283
11287
|
_classCallCheck(this, fa);
|
@@ -12065,11 +12069,11 @@ var B = /*#__PURE__*/function () {
|
|
12065
12069
|
}]);
|
12066
12070
|
return B;
|
12067
12071
|
}();
|
12068
|
-
var
|
12069
|
-
function
|
12070
|
-
_classCallCheck(this,
|
12072
|
+
var Ae = /*#__PURE__*/function () {
|
12073
|
+
function Ae() {
|
12074
|
+
_classCallCheck(this, Ae);
|
12071
12075
|
}
|
12072
|
-
_createClass(
|
12076
|
+
_createClass(Ae, null, [{
|
12073
12077
|
key: "resetSubmit",
|
12074
12078
|
value: function resetSubmit(e, t) {
|
12075
12079
|
t ? e.unsetCustomStateStyles(["loading", "submit"]) : e.unsetCustomStateStyles(["stop", "loading", "submit"]), e.reapplyStateStyle("submit");
|
@@ -12085,16 +12089,16 @@ var Ce = /*#__PURE__*/function () {
|
|
12085
12089
|
}, {
|
12086
12090
|
key: "setUpDisabledButton",
|
12087
12091
|
value: function setUpDisabledButton(e) {
|
12088
|
-
B.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), B.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), B.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), B.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"),
|
12092
|
+
B.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), B.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), B.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), B.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"), Ae.overwriteDefaultStyleWithSubmit(e, "disabled");
|
12089
12093
|
}
|
12090
12094
|
}, {
|
12091
12095
|
key: "process",
|
12092
12096
|
value: function process(e) {
|
12093
12097
|
var t = JSON.parse(JSON.stringify(e || {}));
|
12094
|
-
return
|
12098
|
+
return Ae.overwriteDefaultStyleWithSubmit(t, "loading"), Ae.overwriteDefaultStyleWithSubmit(t, "stop"), e != null && e.alwaysEnabled || Ae.setUpDisabledButton(t), t;
|
12095
12099
|
}
|
12096
12100
|
}]);
|
12097
|
-
return
|
12101
|
+
return Ae;
|
12098
12102
|
}();
|
12099
12103
|
var Ei = /*#__PURE__*/function (_Tt4) {
|
12100
12104
|
_inherits(k, _Tt4);
|
@@ -12103,7 +12107,7 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12103
12107
|
function k(e, t, i, n, r) {
|
12104
12108
|
var _this60;
|
12105
12109
|
_classCallCheck(this, k);
|
12106
|
-
var o =
|
12110
|
+
var o = Ae.process(e.submitButtonStyles);
|
12107
12111
|
_this60 = _super45.call(this, k.createButtonContainerElement(), o == null ? void 0 : o.position, o), _this60._isSVGLoadingIconOverriden = !1, _this60.status = {
|
12108
12112
|
requestInProgress: !1,
|
12109
12113
|
loadingActive: !1
|
@@ -12207,7 +12211,7 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12207
12211
|
return _regeneratorRuntime().wrap(function _callee102$(_context102) {
|
12208
12212
|
while (1) switch (_context102.prev = _context102.next) {
|
12209
12213
|
case 0:
|
12210
|
-
typeof e == "string" && (e =
|
12214
|
+
typeof e == "string" && (e = Ie.processSubmitUserMessage(e));
|
12211
12215
|
t = {
|
12212
12216
|
text: e.text
|
12213
12217
|
};
|
@@ -12340,7 +12344,7 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12340
12344
|
}, {
|
12341
12345
|
key: "changeToSubmitIcon",
|
12342
12346
|
value: function changeToSubmitIcon() {
|
12343
|
-
this.elementRef.classList.contains(k.SUBMIT_CLASS) || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS), this.elementRef.classList.add(k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit),
|
12347
|
+
this.elementRef.classList.contains(k.SUBMIT_CLASS) || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS), this.elementRef.classList.add(k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), Ae.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = this.submitFromInput.bind(this));
|
12344
12348
|
}
|
12345
12349
|
// called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
|
12346
12350
|
}, {
|
@@ -12364,7 +12368,7 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12364
12368
|
}, {
|
12365
12369
|
key: "createSubmitIconElement",
|
12366
12370
|
value: function createSubmitIconElement() {
|
12367
|
-
var e =
|
12371
|
+
var e = H.createSVGElement(wa);
|
12368
12372
|
return e.id = "submit-icon", e;
|
12369
12373
|
}
|
12370
12374
|
}, {
|
@@ -12401,7 +12405,7 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12401
12405
|
var _this62$addButtonsAnd = _this62.addButtonsAndTheirEvents(t),
|
12402
12406
|
r = _this62$addButtonsAnd.captureButton,
|
12403
12407
|
o = _this62$addButtonsAnd.submitButton;
|
12404
|
-
_this62._captureButton = r, _this62._submitButton = o, _this62._captureIcon = _this62._captureButton.children[0], _this62._refreshIcon =
|
12408
|
+
_this62._captureButton = r, _this62._submitButton = o, _this62._captureIcon = _this62._captureButton.children[0], _this62._refreshIcon = H.createSVGElement(Ma), _this62._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this62._format = "image/jpeg"), n != null && n.dimensions && (_this62._dimensions = n.dimensions), _this62._contentRef.appendChild(_this62._canvas), _this62.extensionCloseCallback = _this62.stop;
|
12405
12409
|
return _this62;
|
12406
12410
|
}
|
12407
12411
|
_createClass(rn, [{
|
@@ -12547,7 +12551,7 @@ var ei = /*#__PURE__*/function (_Tt5) {
|
|
12547
12551
|
}, {
|
12548
12552
|
key: "createSVGIconElement",
|
12549
12553
|
value: function createSVGIconElement() {
|
12550
|
-
var e =
|
12554
|
+
var e = H.createSVGElement(ka);
|
12551
12555
|
return e.id = "camera-icon", e;
|
12552
12556
|
}
|
12553
12557
|
}]);
|
@@ -12564,7 +12568,7 @@ var mt = /*#__PURE__*/function () {
|
|
12564
12568
|
button: new Qt(e, r, t.addNewErrorMessage.bind(t))
|
12565
12569
|
});
|
12566
12570
|
var l = new _a(e, r.inputElementRef, t, i, a);
|
12567
|
-
r.submit = l.submitFromInput.bind(l),
|
12571
|
+
r.submit = l.submitFromInput.bind(l), Te.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
12568
12572
|
button: l
|
12569
12573
|
}, mt.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
|
12570
12574
|
}
|
@@ -12620,7 +12624,7 @@ var mt = /*#__PURE__*/function () {
|
|
12620
12624
|
}, {
|
12621
12625
|
key: "addElements",
|
12622
12626
|
value: function addElements(e, t, i, n, r, o) {
|
12623
|
-
|
12627
|
+
Z.addElements(e, t.elementRef);
|
12624
12628
|
var a = tt.create(),
|
12625
12629
|
l = F.addButtons(a, i, n, o);
|
12626
12630
|
Jo.set(t.inputElementRef, a, r.elementRef, l), tt.add(e, a);
|
@@ -12638,9 +12642,9 @@ var on = /*#__PURE__*/function () {
|
|
12638
12642
|
var n = document.createElement("div");
|
12639
12643
|
n.id = "chat-view";
|
12640
12644
|
var r = new me(e, t, i);
|
12641
|
-
t.websocket &&
|
12645
|
+
t.websocket && Y.createConnection(t, r);
|
12642
12646
|
var o = new mt(e, r, t, n);
|
12643
|
-
return
|
12647
|
+
return Z.addElements(n, r.elementRef, o.elementRef), n;
|
12644
12648
|
}
|
12645
12649
|
}, {
|
12646
12650
|
key: "render",
|
@@ -12689,7 +12693,7 @@ var b = /*#__PURE__*/function (_yo) {
|
|
12689
12693
|
key: "onRender",
|
12690
12694
|
value: function onRender() {
|
12691
12695
|
var _this$_childElement;
|
12692
|
-
(!this._activeService || this._activeService.demo) && (this._activeService = Go.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (wi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), wi.applyDefaultStyleToComponent(this.style, this.chatStyle),
|
12696
|
+
(!this._activeService || this._activeService.demo) && (this._activeService = Go.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (wi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), wi.applyDefaultStyleToComponent(this.style, this.chatStyle), Ie.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Ft.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof U) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], on.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof U && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Bt.onRender(this);
|
12693
12697
|
}
|
12694
12698
|
}, {
|
12695
12699
|
key: "disconnectedCallback",
|