deep-chat-dev 9.0.249 → 9.0.250
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 +12199 -12192
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +371 -371
- package/dist/utils/browser/browser.d.ts +1 -0
- package/dist/utils/browser/browser.d.ts.map +1 -1
- package/dist/views/chat/input/textInput/textInput.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -43,11 +43,11 @@ var Un = /*#__PURE__*/function () {
|
|
43
43
|
}
|
44
44
|
}]);
|
45
45
|
}();
|
46
|
-
var
|
47
|
-
function
|
48
|
-
_classCallCheck(this,
|
46
|
+
var gi = /*#__PURE__*/function () {
|
47
|
+
function gi() {
|
48
|
+
_classCallCheck(this, gi);
|
49
49
|
}
|
50
|
-
return _createClass(
|
50
|
+
return _createClass(gi, null, [{
|
51
51
|
key: "onLoad",
|
52
52
|
value: function onLoad(e) {
|
53
53
|
e.innerHTML = '<div id="loading-validate-key-property"></div>';
|
@@ -61,11 +61,11 @@ var mi = /*#__PURE__*/function () {
|
|
61
61
|
}, {
|
62
62
|
key: "render",
|
63
63
|
value: function render(e, t, i) {
|
64
|
-
var s =
|
64
|
+
var s = gi.createElements(),
|
65
65
|
r = {
|
66
66
|
onSuccess: t,
|
67
67
|
onFail: Un.render.bind(this, e, "Your 'key' has failed authentication"),
|
68
|
-
onLoad:
|
68
|
+
onLoad: gi.onLoad.bind(this, s)
|
69
69
|
};
|
70
70
|
i.key && i.verifyKey(i.key, r), e.replaceChildren(s);
|
71
71
|
}
|
@@ -156,7 +156,7 @@ var We = /*#__PURE__*/function () {
|
|
156
156
|
}]);
|
157
157
|
}();
|
158
158
|
We.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", We.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
|
159
|
-
var
|
159
|
+
var bi = We;
|
160
160
|
var lt = /*#__PURE__*/function () {
|
161
161
|
function lt() {
|
162
162
|
_classCallCheck(this, lt);
|
@@ -196,7 +196,7 @@ lt.DEFAULT_COMPONENT_STYLE = {
|
|
196
196
|
borderRight: "1px solid #cacaca",
|
197
197
|
borderLeft: "1px solid #cacaca",
|
198
198
|
borderBottom: "1px solid #cacaca",
|
199
|
-
fontFamily:
|
199
|
+
fontFamily: bi.DEFAULT_FONT_FAMILY,
|
200
200
|
fontSize: "0.9rem",
|
201
201
|
backgroundColor: "white",
|
202
202
|
position: "relative",
|
@@ -207,11 +207,11 @@ lt.DEFAULT_COMPONENT_STYLE = {
|
|
207
207
|
overflow: "hidden"
|
208
208
|
};
|
209
209
|
var qt = lt;
|
210
|
-
var
|
211
|
-
_classCallCheck(this,
|
210
|
+
var Kt = /*#__PURE__*/_createClass(function Kt() {
|
211
|
+
_classCallCheck(this, Kt);
|
212
212
|
});
|
213
|
-
|
214
|
-
var
|
213
|
+
Kt.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), Kt.IS_CHROMIUM = window.chrome, Kt.IS_MOBILE = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
214
|
+
var Ne = Kt;
|
215
215
|
var F = /* @__PURE__ */function (n) {
|
216
216
|
return n.ESCAPE = "Escape", n.ENTER = "Enter", n.TAB = "Tab", n.ARROW_UP = "ArrowUp", n.ARROW_DOWN = "ArrowDown", n.ARROW_RIGHT = "ArrowRight", n.ARROW_LEFT = "ArrowLeft", n.BACKSPACE = "Backspace", n.DELETE = "Delete", n.META = "Meta", n.CONTROL = "Control", n;
|
217
217
|
}(F || {});
|
@@ -247,7 +247,7 @@ var Je = /*#__PURE__*/function () {
|
|
247
247
|
value: function onInput(e, t, i) {
|
248
248
|
var s = i.target,
|
249
249
|
r = s.textContent || "";
|
250
|
-
e !== void 0 && r.length > e && (s.textContent = r.substring(0, e),
|
250
|
+
e !== void 0 && r.length > e && (s.textContent = r.substring(0, e), ai.focusEndOfInput(s)), t == null || t();
|
251
251
|
}
|
252
252
|
}]);
|
253
253
|
}();
|
@@ -284,7 +284,7 @@ var Xe = /*#__PURE__*/function () {
|
|
284
284
|
function clear() {
|
285
285
|
var t;
|
286
286
|
var e = window.scrollY;
|
287
|
-
this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "",
|
287
|
+
this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", ai.focusEndOfInput(this.inputElementRef)), Ne.IS_CHROMIUM && window.scrollTo({
|
288
288
|
top: e
|
289
289
|
});
|
290
290
|
}
|
@@ -293,7 +293,7 @@ var Xe = /*#__PURE__*/function () {
|
|
293
293
|
value: function createInputElement() {
|
294
294
|
var t, i, s, r;
|
295
295
|
var e = document.createElement("div");
|
296
|
-
return e.id = Xe.TEXT_INPUT_ID, e.classList.add("text-input-styling"), e.role = "textbox",
|
296
|
+
return e.id = Xe.TEXT_INPUT_ID, e.classList.add("text-input-styling"), e.role = "textbox", Ne.IS_CHROMIUM && Xe.preventAutomaticScrollUpOnNewLine(e), typeof this._config.disabled == "boolean" && this._config.disabled === !0 ? (e.contentEditable = "false", e.classList.add("text-input-disabled"), e.setAttribute("aria-disabled", "true")) : (e.contentEditable = "true", e.removeAttribute("aria-disabled"), this.addEventListeners(e)), Object.assign(e.style, (t = this._config.styles) == null ? void 0 : t.text), Object.assign(e.style, (i = this._config.placeholder) == null ? void 0 : i.style), (r = (s = this._config.placeholder) == null ? void 0 : s.style) != null && r.color || e.setAttribute("textcolor", ""), e;
|
297
297
|
}
|
298
298
|
}, {
|
299
299
|
key: "removePlaceholderStyle",
|
@@ -320,7 +320,7 @@ var Xe = /*#__PURE__*/function () {
|
|
320
320
|
key: "onKeydown",
|
321
321
|
value: function onKeydown(e) {
|
322
322
|
var t;
|
323
|
-
e.key === F.ENTER && !e.ctrlKey && !e.shiftKey && (e.preventDefault(), (t = this.submit) == null || t.call(this));
|
323
|
+
e.key === F.ENTER && !e.ctrlKey && !e.shiftKey && !Ne.IS_MOBILE && (e.preventDefault(), (t = this.submit) == null || t.call(this));
|
324
324
|
}
|
325
325
|
}, {
|
326
326
|
key: "onInput",
|
@@ -371,12 +371,12 @@ var Xe = /*#__PURE__*/function () {
|
|
371
371
|
}]);
|
372
372
|
}();
|
373
373
|
Xe.TEXT_INPUT_ID = "text-input";
|
374
|
-
var
|
375
|
-
var
|
376
|
-
function
|
377
|
-
_classCallCheck(this,
|
374
|
+
var vi = Xe;
|
375
|
+
var ai = /*#__PURE__*/function () {
|
376
|
+
function ai() {
|
377
|
+
_classCallCheck(this, ai);
|
378
378
|
}
|
379
|
-
return _createClass(
|
379
|
+
return _createClass(ai, null, [{
|
380
380
|
key: "focusEndOfInput",
|
381
381
|
value: function focusEndOfInput(e) {
|
382
382
|
var t = document.createRange();
|
@@ -387,8 +387,8 @@ var oi = /*#__PURE__*/function () {
|
|
387
387
|
}, {
|
388
388
|
key: "focusFromParentElement",
|
389
389
|
value: function focusFromParentElement(e) {
|
390
|
-
var t = e.querySelector("#".concat(
|
391
|
-
t && (
|
390
|
+
var t = e.querySelector("#".concat(vi.TEXT_INPUT_ID));
|
391
|
+
t && (Ne.IS_SAFARI && t.focus(), ai.focusEndOfInput(t));
|
392
392
|
}
|
393
393
|
}]);
|
394
394
|
}();
|
@@ -738,11 +738,11 @@ var te = /*#__PURE__*/function () {
|
|
738
738
|
}
|
739
739
|
}]);
|
740
740
|
}();
|
741
|
-
var
|
742
|
-
function
|
743
|
-
_classCallCheck(this,
|
741
|
+
var Ve = /*#__PURE__*/function () {
|
742
|
+
function Ve() {
|
743
|
+
_classCallCheck(this, Ve);
|
744
744
|
}
|
745
|
-
return _createClass(
|
745
|
+
return _createClass(Ve, null, [{
|
746
746
|
key: "mouseUp",
|
747
747
|
value: function mouseUp(e, t) {
|
748
748
|
O.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
|
@@ -765,7 +765,7 @@ var Ge = /*#__PURE__*/function () {
|
|
765
765
|
}, {
|
766
766
|
key: "add",
|
767
767
|
value: function add(e, t) {
|
768
|
-
e.addEventListener("mouseenter",
|
768
|
+
e.addEventListener("mouseenter", Ve.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", Ve.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", Ve.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", Ve.mouseUp.bind(this, e, t));
|
769
769
|
}
|
770
770
|
}]);
|
771
771
|
}();
|
@@ -871,7 +871,7 @@ var Y = /*#__PURE__*/function () {
|
|
871
871
|
key: "applyStylesToElement",
|
872
872
|
value: function applyStylesToElement(e, t) {
|
873
873
|
var i = O.processStateful(t);
|
874
|
-
|
874
|
+
Ve.add(e, i), Object.assign(e.style, i["default"]);
|
875
875
|
}
|
876
876
|
}, {
|
877
877
|
key: "applyEventsToElement",
|
@@ -993,9 +993,9 @@ var Me = /*#__PURE__*/function () {
|
|
993
993
|
}();
|
994
994
|
Me.HTML_BUBBLE_CLASS = "html-message";
|
995
995
|
var _e = Me;
|
996
|
-
var
|
996
|
+
var hi;
|
997
997
|
function yn(n) {
|
998
|
-
return
|
998
|
+
return hi = hi || document.createElement("textarea"), hi.innerHTML = "&" + n + ";", hi.value;
|
999
999
|
}
|
1000
1000
|
var $n = Object.prototype.hasOwnProperty;
|
1001
1001
|
function Wn(n, e) {
|
@@ -1013,7 +1013,7 @@ function En(n) {
|
|
1013
1013
|
}), n;
|
1014
1014
|
}
|
1015
1015
|
var Jn = /\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
|
1016
|
-
function
|
1016
|
+
function Zt(n) {
|
1017
1017
|
return n.indexOf("\\") < 0 ? n : n.replace(Jn, "$1");
|
1018
1018
|
}
|
1019
1019
|
function Sn(n) {
|
@@ -1072,7 +1072,7 @@ b.fence = function (n, e, t, i, s) {
|
|
1072
1072
|
u;
|
1073
1073
|
if (r.params) {
|
1074
1074
|
if (c = r.params.split(/\s+/g), d = c.join(" "), Wn(s.rules.fence_custom, c[0])) return s.rules.fence_custom[c[0]](n, e, t, i, s);
|
1075
|
-
l = ee(tt(
|
1075
|
+
l = ee(tt(Zt(d))), o = ' class="' + a + l + '"';
|
1076
1076
|
}
|
1077
1077
|
return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || ee(r.content) : u = ee(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + st(n, e);
|
1078
1078
|
};
|
@@ -1124,7 +1124,7 @@ b.link_close = function () {
|
|
1124
1124
|
b.image = function (n, e, t) {
|
1125
1125
|
var i = ' src="' + ee(n[e].src) + '"',
|
1126
1126
|
s = n[e].title ? ' title="' + ee(tt(n[e].title)) + '"' : "",
|
1127
|
-
r = ' alt="' + (n[e].alt ? ee(tt(
|
1127
|
+
r = ' alt="' + (n[e].alt ? ee(tt(Zt(n[e].alt))) : "") + '"',
|
1128
1128
|
o = t.xhtmlOut ? " /" : "";
|
1129
1129
|
return "<img" + i + r + s + o + ">";
|
1130
1130
|
};
|
@@ -1387,7 +1387,7 @@ nt.prototype.cacheSet = function (n, e) {
|
|
1387
1387
|
nt.prototype.cacheGet = function (n) {
|
1388
1388
|
return n < this.cache.length ? this.cache[n] : 0;
|
1389
1389
|
};
|
1390
|
-
function
|
1390
|
+
function Qt(n, e) {
|
1391
1391
|
var t,
|
1392
1392
|
i,
|
1393
1393
|
s,
|
@@ -1408,7 +1408,7 @@ function Zt(n, e) {
|
|
1408
1408
|
}
|
1409
1409
|
function nr(n, e, t, i) {
|
1410
1410
|
var s, r, o, a, l, c;
|
1411
|
-
if (n.charCodeAt(0) !== 42 || n.charCodeAt(1) !== 91 || n.indexOf("]:") === -1 || (s = new nt(n, e, t, i, []), r =
|
1411
|
+
if (n.charCodeAt(0) !== 42 || n.charCodeAt(1) !== 91 || n.indexOf("]:") === -1 || (s = new nt(n, e, t, i, []), r = Qt(s, 1), r < 0 || n.charCodeAt(r + 1) !== 58)) return -1;
|
1412
1412
|
for (a = s.posMax, o = r + 2; o < a && s.src.charCodeAt(o) !== 10; o++);
|
1413
1413
|
return l = n.slice(2, r), c = n.slice(r + 2, o).trim(), c.length === 0 ? -1 : (i.abbreviations || (i.abbreviations = {}), _typeof(i.abbreviations[":" + l]) > "u" && (i.abbreviations[":" + l] = c), o);
|
1414
1414
|
}
|
@@ -1441,7 +1441,7 @@ function xn(n, e) {
|
|
1441
1441
|
if (n.src.charCodeAt(e) === 60) {
|
1442
1442
|
for (e++; e < o;) {
|
1443
1443
|
if (t = n.src.charCodeAt(e), t === 10) return !1;
|
1444
|
-
if (t === 62) return s = Qi(
|
1444
|
+
if (t === 62) return s = Qi(Zt(n.src.slice(r + 1, e))), n.parser.validateLink(s) ? (n.pos = e + 1, n.linkContent = s, !0) : !1;
|
1445
1445
|
if (t === 92 && e + 1 < o) {
|
1446
1446
|
e += 2;
|
1447
1447
|
continue;
|
@@ -1458,7 +1458,7 @@ function xn(n, e) {
|
|
1458
1458
|
if (t === 40 && (i++, i > 1) || t === 41 && (i--, i < 0)) break;
|
1459
1459
|
e++;
|
1460
1460
|
}
|
1461
|
-
return r === e || (s =
|
1461
|
+
return r === e || (s = Zt(n.src.slice(r, e)), !n.parser.validateLink(s)) ? !1 : (n.linkContent = s, n.pos = e, !0);
|
1462
1462
|
}
|
1463
1463
|
function wn(n, e) {
|
1464
1464
|
var t,
|
@@ -1467,7 +1467,7 @@ function wn(n, e) {
|
|
1467
1467
|
r = n.src.charCodeAt(e);
|
1468
1468
|
if (r !== 34 && r !== 39 && r !== 40) return !1;
|
1469
1469
|
for (e++, r === 40 && (r = 41); e < s;) {
|
1470
|
-
if (t = n.src.charCodeAt(e), t === r) return n.pos = e + 1, n.linkContent =
|
1470
|
+
if (t = n.src.charCodeAt(e), t === r) return n.pos = e + 1, n.linkContent = Zt(n.src.slice(i + 1, e)), !0;
|
1471
1471
|
if (t === 92 && e + 1 < s) {
|
1472
1472
|
e += 2;
|
1473
1473
|
continue;
|
@@ -1481,7 +1481,7 @@ function An(n) {
|
|
1481
1481
|
}
|
1482
1482
|
function or(n, e, t, i) {
|
1483
1483
|
var s, r, o, a, l, c, d, u, h;
|
1484
|
-
if (n.charCodeAt(0) !== 91 || n.indexOf("]:") === -1 || (s = new nt(n, e, t, i, []), r =
|
1484
|
+
if (n.charCodeAt(0) !== 91 || n.indexOf("]:") === -1 || (s = new nt(n, e, t, i, []), r = Qt(s, 0), r < 0 || n.charCodeAt(r + 1) !== 58)) return -1;
|
1485
1485
|
for (a = s.posMax, o = r + 2; o < a && (l = s.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1486
1486
|
if (!xn(s, o)) return -1;
|
1487
1487
|
for (d = s.linkContent, o = s.pos, c = o, o = o + 1; o < a && (l = s.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
@@ -1867,7 +1867,7 @@ function wr(n, e, t, i) {
|
|
1867
1867
|
v,
|
1868
1868
|
M,
|
1869
1869
|
j,
|
1870
|
-
|
1870
|
+
Fe,
|
1871
1871
|
ae,
|
1872
1872
|
Ce = !0,
|
1873
1873
|
Ee,
|
@@ -1880,11 +1880,11 @@ function wr(n, e, t, i) {
|
|
1880
1880
|
for (M = n.tokens.length, g ? (d = n.bMarks[e] + n.tShift[e], m = Number(n.src.substr(d, u - d - 1)), n.tokens.push({
|
1881
1881
|
type: "ordered_list_open",
|
1882
1882
|
order: m,
|
1883
|
-
lines:
|
1883
|
+
lines: Fe = [e, 0],
|
1884
1884
|
level: n.level++
|
1885
1885
|
})) : n.tokens.push({
|
1886
1886
|
type: "bullet_list_open",
|
1887
|
-
lines:
|
1887
|
+
lines: Fe = [e, 0],
|
1888
1888
|
level: n.level++
|
1889
1889
|
}), s = e, j = !1, Ee = n.parser.ruler.getRules("list"); s < t && (v = n.skipSpaces(u), h = n.eMarks[s], v >= h ? f = 1 : f = v - u, f > 4 && (f = 1), f < 1 && (f = 1), r = u - n.bMarks[s] + f, n.tokens.push({
|
1890
1890
|
type: "list_item_open",
|
@@ -1907,7 +1907,7 @@ function wr(n, e, t, i) {
|
|
1907
1907
|
return n.tokens.push({
|
1908
1908
|
type: g ? "ordered_list_close" : "bullet_list_close",
|
1909
1909
|
level: --n.level
|
1910
|
-
}),
|
1910
|
+
}), Fe[1] = s, n.line = s, Ce && xr(n, M), !0;
|
1911
1911
|
}
|
1912
1912
|
function Ar(n, e, t, i) {
|
1913
1913
|
var s,
|
@@ -2098,7 +2098,7 @@ function Ir(n, e, t, i) {
|
|
2098
2098
|
level: --n.level
|
2099
2099
|
}), f[1] = m[1] = l, n.line = l, !0;
|
2100
2100
|
}
|
2101
|
-
function
|
2101
|
+
function ui(n, e) {
|
2102
2102
|
var t,
|
2103
2103
|
i,
|
2104
2104
|
s = n.bMarks[e] + n.tShift[e],
|
@@ -2113,8 +2113,8 @@ function Or(n, e) {
|
|
2113
2113
|
}
|
2114
2114
|
function Pr(n, e, t, i) {
|
2115
2115
|
var s, r, o, a, l, c, d, u, h, f, m, p, g, v;
|
2116
|
-
if (i) return n.ddIndent < 0 ? !1 :
|
2117
|
-
if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s =
|
2116
|
+
if (i) return n.ddIndent < 0 ? !1 : ui(n, e) >= 0;
|
2117
|
+
if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (s = ui(n, d), s < 0) || n.level >= n.options.maxNesting) return !1;
|
2118
2118
|
c = n.tokens.length, n.tokens.push({
|
2119
2119
|
type: "dl_open",
|
2120
2120
|
lines: l = [e, 0],
|
@@ -2143,10 +2143,10 @@ function Pr(n, e, t, i) {
|
|
2143
2143
|
type: "dd_close",
|
2144
2144
|
level: --n.level
|
2145
2145
|
}), a[1] = d = n.line, d >= t || n.tShift[d] < n.blkIndent) break e;
|
2146
|
-
if (s =
|
2146
|
+
if (s = ui(n, d), s < 0) break;
|
2147
2147
|
r = d;
|
2148
2148
|
}
|
2149
|
-
if (d >= t || (o = d, n.isEmpty(o)) || n.tShift[o] < n.blkIndent || (r = o + 1, r >= t) || (n.isEmpty(r) && r++, r >= t) || n.tShift[r] < n.blkIndent || (s =
|
2149
|
+
if (d >= t || (o = d, n.isEmpty(o)) || n.tShift[o] < n.blkIndent || (r = o + 1, r >= t) || (n.isEmpty(r) && r++, r >= t) || n.tShift[r] < n.blkIndent || (s = ui(n, r), s < 0)) break;
|
2150
2150
|
}
|
2151
2151
|
return n.tokens.push({
|
2152
2152
|
type: "dl_close",
|
@@ -2187,11 +2187,11 @@ function Nr(n, e) {
|
|
2187
2187
|
level: n.level
|
2188
2188
|
})), !0;
|
2189
2189
|
}
|
2190
|
-
var
|
2190
|
+
var fi = [["code", yr], ["fences", Er, ["paragraph", "blockquote", "list"]], ["blockquote", Sr, ["paragraph", "blockquote", "list"]], ["hr", _r, ["paragraph", "blockquote", "list"]], ["list", wr, ["paragraph", "blockquote"]], ["footnote", Ar, ["paragraph"]], ["heading", Cr, ["paragraph", "blockquote"]], ["lheading", Tr], ["htmlblock", Lr, ["paragraph", "blockquote"]], ["table", Ir, ["paragraph"]], ["deflist", Pr, ["paragraph"]], ["paragraph", Nr]];
|
2191
2191
|
function vs() {
|
2192
2192
|
this.ruler = new oe();
|
2193
|
-
for (var n = 0; n <
|
2194
|
-
alt: (
|
2193
|
+
for (var n = 0; n < fi.length; n++) this.ruler.push(fi[n][0], fi[n][1], {
|
2194
|
+
alt: (fi[n][2] || []).slice()
|
2195
2195
|
});
|
2196
2196
|
}
|
2197
2197
|
vs.prototype.tokenize = function (n, e, t) {
|
@@ -2519,7 +2519,7 @@ function Zr(n, e) {
|
|
2519
2519
|
h = n.posMax,
|
2520
2520
|
f = n.pos,
|
2521
2521
|
m = n.src.charCodeAt(f);
|
2522
|
-
if (m === 33 && (d = !0, m = n.src.charCodeAt(++f)), m !== 91 || n.level >= n.options.maxNesting || (t = f + 1, i =
|
2522
|
+
if (m === 33 && (d = !0, m = n.src.charCodeAt(++f)), m !== 91 || n.level >= n.options.maxNesting || (t = f + 1, i = Qt(n, f), i < 0)) return !1;
|
2523
2523
|
if (a = i + 1, a < h && n.src.charCodeAt(a) === 40) {
|
2524
2524
|
for (a++; a < h && (c = n.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2525
2525
|
if (a >= h) return !1;
|
@@ -2530,7 +2530,7 @@ function Zr(n, e) {
|
|
2530
2530
|
} else {
|
2531
2531
|
if (n.linkLevel > 0) return !1;
|
2532
2532
|
for (; a < h && (c = n.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2533
|
-
if (a < h && n.src.charCodeAt(a) === 91 && (f = a + 1, a =
|
2533
|
+
if (a < h && n.src.charCodeAt(a) === 91 && (f = a + 1, a = Qt(n, a), a >= 0 ? s = n.src.slice(f, a++) : a = f - 1), s || (_typeof(s) > "u" && (a = i + 1), s = n.src.slice(t, i)), l = n.env.references[An(s)], !l) return n.pos = u, !1;
|
2534
2534
|
r = l.href, o = l.title;
|
2535
2535
|
}
|
2536
2536
|
return e || (n.pos = t, n.posMax = i, d ? n.push({
|
@@ -2556,7 +2556,7 @@ function Qr(n, e) {
|
|
2556
2556
|
r,
|
2557
2557
|
o = n.posMax,
|
2558
2558
|
a = n.pos;
|
2559
|
-
return a + 2 >= o || n.src.charCodeAt(a) !== 94 || n.src.charCodeAt(a + 1) !== 91 || n.level >= n.options.maxNesting || (t = a + 2, i =
|
2559
|
+
return a + 2 >= o || n.src.charCodeAt(a) !== 94 || n.src.charCodeAt(a + 1) !== 91 || n.level >= n.options.maxNesting || (t = a + 2, i = Qt(n, a + 1), i < 0) ? !1 : (e || (n.env.footnotes || (n.env.footnotes = {}), n.env.footnotes.list || (n.env.footnotes.list = []), s = n.env.footnotes.list.length, n.pos = t, n.posMax = i, n.push({
|
2560
2560
|
type: "footnote_ref",
|
2561
2561
|
id: s,
|
2562
2562
|
level: n.level
|
@@ -2917,7 +2917,7 @@ dt.DEFAULT_PROPERTIES = {
|
|
2917
2917
|
linkTarget: "_blank"
|
2918
2918
|
// set target to open in a new tab
|
2919
2919
|
};
|
2920
|
-
var
|
2920
|
+
var ei = dt;
|
2921
2921
|
var X = /*#__PURE__*/function () {
|
2922
2922
|
function X() {
|
2923
2923
|
_classCallCheck(this, X);
|
@@ -2967,11 +2967,11 @@ var X = /*#__PURE__*/function () {
|
|
2967
2967
|
}
|
2968
2968
|
}]);
|
2969
2969
|
}();
|
2970
|
-
var
|
2971
|
-
function
|
2972
|
-
_classCallCheck(this,
|
2970
|
+
var yi = /*#__PURE__*/function () {
|
2971
|
+
function yi() {
|
2972
|
+
_classCallCheck(this, yi);
|
2973
2973
|
}
|
2974
|
-
return _createClass(
|
2974
|
+
return _createClass(yi, null, [{
|
2975
2975
|
key: "onMessage",
|
2976
2976
|
value: function onMessage(e, t, i) {
|
2977
2977
|
var r;
|
@@ -3073,15 +3073,15 @@ var B = /*#__PURE__*/function () {
|
|
3073
3073
|
}]);
|
3074
3074
|
}();
|
3075
3075
|
B.CLASS = "loading-history-message", B.FULL_VIEW_CLASS = "loading-history-message-full-view", B.SMALL_CLASS = "loading-history-message-small";
|
3076
|
-
var
|
3077
|
-
var
|
3078
|
-
function
|
3079
|
-
_classCallCheck(this,
|
3076
|
+
var De = B;
|
3077
|
+
var $t = /*#__PURE__*/function () {
|
3078
|
+
function $t() {
|
3079
|
+
_classCallCheck(this, $t);
|
3080
3080
|
}
|
3081
|
-
return _createClass(
|
3081
|
+
return _createClass($t, null, [{
|
3082
3082
|
key: "setFade",
|
3083
3083
|
value: function setFade(e, t) {
|
3084
|
-
e.style.transitionDuration = typeof t == "number" ? "".concat(t, "ms") : "".concat(
|
3084
|
+
e.style.transitionDuration = typeof t == "number" ? "".concat(t, "ms") : "".concat($t.DEFAULT_FADE_MS, "ms");
|
3085
3085
|
}
|
3086
3086
|
}, {
|
3087
3087
|
key: "fadeAnimation",
|
@@ -3092,7 +3092,7 @@ var Kt = /*#__PURE__*/function () {
|
|
3092
3092
|
while (1) switch (_context.prev = _context.next) {
|
3093
3093
|
case 0:
|
3094
3094
|
e.style.opacity = "0";
|
3095
|
-
i = typeof t == "number" ? t :
|
3095
|
+
i = typeof t == "number" ? t : $t.DEFAULT_FADE_MS;
|
3096
3096
|
_context.next = 4;
|
3097
3097
|
return new Promise(function (s) {
|
3098
3098
|
setTimeout(function () {
|
@@ -3114,8 +3114,8 @@ var Kt = /*#__PURE__*/function () {
|
|
3114
3114
|
}()
|
3115
3115
|
}]);
|
3116
3116
|
}();
|
3117
|
-
|
3118
|
-
var
|
3117
|
+
$t.DEFAULT_FADE_MS = 500;
|
3118
|
+
var Ei = $t;
|
3119
3119
|
var Gs = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
|
3120
3120
|
es = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
|
3121
3121
|
var Mn = /*#__PURE__*/function () {
|
@@ -3244,7 +3244,7 @@ var Q = /*#__PURE__*/function () {
|
|
3244
3244
|
var _this5 = this;
|
3245
3245
|
_classCallCheck(this, Q);
|
3246
3246
|
var t;
|
3247
|
-
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Q.createContainerElement(), this.messageStyles = te.processMessageStyles(e.messageStyles), this._remarkable =
|
3247
|
+
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Q.createContainerElement(), this.messageStyles = te.processMessageStyles(e.messageStyles), this._remarkable = ei.createNew(e.remarkable), e.avatars && (this.avatar = new Te(e.avatars)), e.names && (this.name = new Ht(e.names)), this._onMessage = yi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), this.focusMode = e.focusMode, this.focusMode || (this._lastGroupMessagesElement = document.createElement("div")), typeof this.focusMode != "boolean" && (t = this.focusMode) != null && t.fade && Ei.setFade(this.elementRef, this.focusMode.fade), setTimeout(function () {
|
3248
3248
|
_this5.submitUserMessage = e.submitUserMessage;
|
3249
3249
|
});
|
3250
3250
|
}
|
@@ -3336,7 +3336,7 @@ var Q = /*#__PURE__*/function () {
|
|
3336
3336
|
var o;
|
3337
3337
|
s || (o = this._introPanel) == null || o.hide();
|
3338
3338
|
var r = this.messageElementRefs[this.messageElementRefs.length - 1];
|
3339
|
-
return
|
3339
|
+
return De.changeFullViewToSmall(this), !i && Q.isTemporaryElement(r) && (this.revealRoleElementsIfTempRemoved(r, t), this.removeLastMessage()), this.createMessageElements(e, t, i);
|
3340
3340
|
}
|
3341
3341
|
// this can be tested by having an ai message, then a temp ai message with html that submits new user message:
|
3342
3342
|
// https://github.com/OvidijusParsiunas/deep-chat/issues/258
|
@@ -3418,7 +3418,7 @@ var Q = /*#__PURE__*/function () {
|
|
3418
3418
|
key: "refreshTextMessages",
|
3419
3419
|
value: function refreshTextMessages(e) {
|
3420
3420
|
var _this8 = this;
|
3421
|
-
this._remarkable =
|
3421
|
+
this._remarkable = ei.createNew(e), this.messageToElements.forEach(function (t) {
|
3422
3422
|
t[1].text && t[0].text && _this8.renderText(t[1].text.bubbleElement, t[0].text);
|
3423
3423
|
});
|
3424
3424
|
}
|
@@ -3758,11 +3758,11 @@ var ht = /*#__PURE__*/function () {
|
|
3758
3758
|
}();
|
3759
3759
|
ht.MESSAGE_CLASS = "streamed-message";
|
3760
3760
|
var we = ht;
|
3761
|
-
var
|
3762
|
-
function
|
3763
|
-
_classCallCheck(this,
|
3761
|
+
var Ue = /*#__PURE__*/function () {
|
3762
|
+
function Ue() {
|
3763
|
+
_classCallCheck(this, Ue);
|
3764
3764
|
}
|
3765
|
-
return _createClass(
|
3765
|
+
return _createClass(Ue, null, [{
|
3766
3766
|
key: "tempRemoveContentHeader",
|
3767
3767
|
value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
|
3768
3768
|
// prettier-ignore
|
@@ -3778,8 +3778,8 @@ var Fe = /*#__PURE__*/function () {
|
|
3778
3778
|
}
|
3779
3779
|
throw new Error("Request settings have not been set up");
|
3780
3780
|
case 2:
|
3781
|
-
s = e.headers[
|
3782
|
-
delete e.headers[
|
3781
|
+
s = e.headers[Ue.CONTENT_TYPE];
|
3782
|
+
delete e.headers[Ue.CONTENT_TYPE];
|
3783
3783
|
_context3.prev = 4;
|
3784
3784
|
_context3.next = 7;
|
3785
3785
|
return t(i);
|
@@ -3790,9 +3790,9 @@ var Fe = /*#__PURE__*/function () {
|
|
3790
3790
|
case 10:
|
3791
3791
|
_context3.prev = 10;
|
3792
3792
|
_context3.t0 = _context3["catch"](4);
|
3793
|
-
throw e.headers[
|
3793
|
+
throw e.headers[Ue.CONTENT_TYPE] = s, _context3.t0;
|
3794
3794
|
case 13:
|
3795
|
-
return _context3.abrupt("return", (e.headers[
|
3795
|
+
return _context3.abrupt("return", (e.headers[Ue.CONTENT_TYPE] = s, r));
|
3796
3796
|
case 14:
|
3797
3797
|
case "end":
|
3798
3798
|
return _context3.stop();
|
@@ -3936,7 +3936,7 @@ var Fe = /*#__PURE__*/function () {
|
|
3936
3936
|
}
|
3937
3937
|
if (r) {
|
3938
3938
|
d = k.INVALID_RESPONSE(t, "response", !!a, l);
|
3939
|
-
|
3939
|
+
Ue.displayError(e, d);
|
3940
3940
|
}
|
3941
3941
|
return _context5.abrupt("return");
|
3942
3942
|
case 17:
|
@@ -3954,8 +3954,8 @@ var Fe = /*#__PURE__*/function () {
|
|
3954
3954
|
}()
|
3955
3955
|
}]);
|
3956
3956
|
}();
|
3957
|
-
|
3958
|
-
var E =
|
3957
|
+
Ue.CONTENT_TYPE = "Content-Type";
|
3958
|
+
var E = Ue;
|
3959
3959
|
function Mo(_x16, _x17) {
|
3960
3960
|
return _Mo.apply(this, arguments);
|
3961
3961
|
}
|
@@ -4088,7 +4088,7 @@ function No(n, e) {
|
|
4088
4088
|
M(), u();
|
4089
4089
|
});
|
4090
4090
|
var j = c !== null && c !== void 0 ? c : window.fetch,
|
4091
|
-
|
4091
|
+
Fe = s !== null && s !== void 0 ? s : Do;
|
4092
4092
|
function ae() {
|
4093
4093
|
return _ae.apply(this, arguments);
|
4094
4094
|
}
|
@@ -4108,7 +4108,7 @@ function No(n, e) {
|
|
4108
4108
|
case 4:
|
4109
4109
|
Ee = _context6.sent;
|
4110
4110
|
_context6.next = 7;
|
4111
|
-
return
|
4111
|
+
return Fe(Ee);
|
4112
4112
|
case 7:
|
4113
4113
|
_context6.next = 9;
|
4114
4114
|
return Mo(Ee.body, ko(Lo(function (ie) {
|
@@ -4234,7 +4234,7 @@ var A = /*#__PURE__*/function () {
|
|
4234
4234
|
var u = !1;
|
4235
4235
|
fetch(((h = e.connectSettings) == null ? void 0 : h.url) || e.url || "", s).then(/*#__PURE__*/function () {
|
4236
4236
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(f) {
|
4237
|
-
var v, M, m, p, g, _yield$m$read, j,
|
4237
|
+
var v, M, m, p, g, _yield$m$read, j, Fe, ae, Ce, Ee;
|
4238
4238
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
4239
4239
|
while (1) switch (_context8.prev = _context8.next) {
|
4240
4240
|
case 0:
|
@@ -4257,8 +4257,8 @@ var A = /*#__PURE__*/function () {
|
|
4257
4257
|
case 8:
|
4258
4258
|
_yield$m$read = _context8.sent;
|
4259
4259
|
j = _yield$m$read.value;
|
4260
|
-
|
4261
|
-
if (!(g =
|
4260
|
+
Fe = _yield$m$read.done;
|
4261
|
+
if (!(g = Fe, g)) {
|
4262
4262
|
_context8.next = 15;
|
4263
4263
|
break;
|
4264
4264
|
}
|
@@ -5288,12 +5288,12 @@ var R = /*#__PURE__*/function () {
|
|
5288
5288
|
}
|
5289
5289
|
}]);
|
5290
5290
|
}();
|
5291
|
-
var
|
5292
|
-
function
|
5293
|
-
_classCallCheck(this,
|
5291
|
+
var je = /*#__PURE__*/function () {
|
5292
|
+
function je(e, t, i) {
|
5293
|
+
_classCallCheck(this, je);
|
5294
5294
|
this._isLoading = !1, this._isPaginationComplete = !1, this._index = 0, this._messages = t, i.fetchHistory && this.fetchHistory(i.fetchHistory), e.loadHistory && this.setupLoadHistoryOnScroll(e.loadHistory), this.setupInitialHistory(e);
|
5295
5295
|
}
|
5296
|
-
return _createClass(
|
5296
|
+
return _createClass(je, [{
|
5297
5297
|
key: "fetchHistory",
|
5298
5298
|
value: function () {
|
5299
5299
|
var _fetchHistory = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e) {
|
@@ -5302,12 +5302,12 @@ var Ue = /*#__PURE__*/function () {
|
|
5302
5302
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
5303
5303
|
while (1) switch (_context24.prev = _context24.next) {
|
5304
5304
|
case 0:
|
5305
|
-
t =
|
5305
|
+
t = De.addMessage(this._messages);
|
5306
5306
|
_context24.next = 3;
|
5307
5307
|
return e();
|
5308
5308
|
case 3:
|
5309
5309
|
i = _context24.sent;
|
5310
|
-
this._messages.removeMessage(t),
|
5310
|
+
this._messages.removeMessage(t), je.displayIntroMessages(this._messages.messageElementRefs), i.forEach(function (s) {
|
5311
5311
|
return _this11._messages.addAnyMessage(s, !0);
|
5312
5312
|
}), setTimeout(function () {
|
5313
5313
|
return Z.scrollToBottom(_this11._messages.elementRef);
|
@@ -5385,7 +5385,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5385
5385
|
break;
|
5386
5386
|
}
|
5387
5387
|
_this13._isLoading = !0;
|
5388
|
-
t =
|
5388
|
+
t = De.addMessage(_this13._messages, !1);
|
5389
5389
|
_context25.prev = 3;
|
5390
5390
|
_context25.next = 6;
|
5391
5391
|
return e(_this13._index++);
|
@@ -5397,7 +5397,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5397
5397
|
case 10:
|
5398
5398
|
_context25.prev = 10;
|
5399
5399
|
_context25.t0 = _context25["catch"](3);
|
5400
|
-
_this13._messages.removeMessage(t), _this13._isPaginationComplete = !0, _this13._messages.addNewErrorMessage("service",
|
5400
|
+
_this13._messages.removeMessage(t), _this13._isPaginationComplete = !0, _this13._messages.addNewErrorMessage("service", je.FAILED_ERROR_MESSAGE, !0), console.error(_context25.t0);
|
5401
5401
|
case 13:
|
5402
5402
|
case "end":
|
5403
5403
|
return _context25.stop();
|
@@ -5433,7 +5433,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5433
5433
|
while (1) switch (_context27.prev = _context27.next) {
|
5434
5434
|
case 0:
|
5435
5435
|
this._isLoading = !0;
|
5436
|
-
t =
|
5436
|
+
t = De.addMessage(this._messages);
|
5437
5437
|
_context27.prev = 2;
|
5438
5438
|
_context27.next = 5;
|
5439
5439
|
return e(this._index++);
|
@@ -5448,9 +5448,9 @@ var Ue = /*#__PURE__*/function () {
|
|
5448
5448
|
case 10:
|
5449
5449
|
_context27.prev = 10;
|
5450
5450
|
_context27.t0 = _context27["catch"](2);
|
5451
|
-
this._messages.removeMessage(t), this._isPaginationComplete = !0, this._messages.addNewErrorMessage("service",
|
5451
|
+
this._messages.removeMessage(t), this._isPaginationComplete = !0, this._messages.addNewErrorMessage("service", je.FAILED_ERROR_MESSAGE, !0), console.error(_context27.t0);
|
5452
5452
|
case 13:
|
5453
|
-
|
5453
|
+
je.displayIntroMessages(this._messages.messageElementRefs), this._isLoading = !1;
|
5454
5454
|
case 14:
|
5455
5455
|
case "end":
|
5456
5456
|
return _context27.stop();
|
@@ -5488,7 +5488,7 @@ var Ue = /*#__PURE__*/function () {
|
|
5488
5488
|
key: "addErrorPrefix",
|
5489
5489
|
value: function addErrorPrefix(e) {
|
5490
5490
|
var _e$permittedErrorPref;
|
5491
|
-
(_e$permittedErrorPref = e.permittedErrorPrefixes) !== null && _e$permittedErrorPref !== void 0 ? _e$permittedErrorPref : e.permittedErrorPrefixes = [], e.permittedErrorPrefixes.push(
|
5491
|
+
(_e$permittedErrorPref = e.permittedErrorPrefixes) !== null && _e$permittedErrorPref !== void 0 ? _e$permittedErrorPref : e.permittedErrorPrefixes = [], e.permittedErrorPrefixes.push(je.FAILED_ERROR_MESSAGE);
|
5492
5492
|
}
|
5493
5493
|
}, {
|
5494
5494
|
key: "displayIntroMessages",
|
@@ -5500,8 +5500,8 @@ var Ue = /*#__PURE__*/function () {
|
|
5500
5500
|
}
|
5501
5501
|
}]);
|
5502
5502
|
}();
|
5503
|
-
|
5504
|
-
var
|
5503
|
+
je.FAILED_ERROR_MESSAGE = "Failed to load history";
|
5504
|
+
var ti = je;
|
5505
5505
|
var bt = /*#__PURE__*/function () {
|
5506
5506
|
function bt() {
|
5507
5507
|
_classCallCheck(this, bt);
|
@@ -5640,7 +5640,7 @@ var D = /*#__PURE__*/function () {
|
|
5640
5640
|
key: "set",
|
5641
5641
|
value: function set(e, t, i) {
|
5642
5642
|
D.populateDefaultFileIO(i == null ? void 0 : i.audio, ".4a,.mp3,.webm,.mp4,.mpga,.wav,.mpeg,.m4a"), D.populateDefaultFileIO(i == null ? void 0 : i.images, ".png,.jpg");
|
5643
|
-
var s =
|
5643
|
+
var s = ei.createNew(e.remarkable);
|
5644
5644
|
D.processImagesConfig(t, s, e.images, i == null ? void 0 : i.images), D.processCamera(t, s, e.camera, e.images), D.processGifConfig(t, s, e.gifs, i == null ? void 0 : i.gifs), D.processAudioConfig(t, s, e.audio, i == null ? void 0 : i.audio), D.processMicrophone(t, s, e.microphone, e.audio), D.processMixedFiles(t, s, e.mixedFiles);
|
5645
5645
|
}
|
5646
5646
|
}]);
|
@@ -5650,7 +5650,7 @@ var it = /*#__PURE__*/function () {
|
|
5650
5650
|
var _a$url;
|
5651
5651
|
_classCallCheck(this, it);
|
5652
5652
|
var s, r, o, a, l;
|
5653
|
-
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = it.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.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, D.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ye.URL), this.connectSettings.websocket && H.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || te.checkForStream(this.deepChat), e.loadHistory &&
|
5653
|
+
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = it.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.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, D.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ye.URL), this.connectSettings.websocket && H.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || te.checkForStream(this.deepChat), e.loadHistory && ti.addErrorPrefix(this);
|
5654
5654
|
}
|
5655
5655
|
return _createClass(it, [{
|
5656
5656
|
key: "verifyKey",
|
@@ -5917,21 +5917,21 @@ var K = /*#__PURE__*/function (_it) {
|
|
5917
5917
|
}
|
5918
5918
|
}]);
|
5919
5919
|
}(it);
|
5920
|
-
var
|
5921
|
-
function
|
5922
|
-
_classCallCheck(this,
|
5920
|
+
var Si = /*#__PURE__*/function () {
|
5921
|
+
function Si() {
|
5922
|
+
_classCallCheck(this, Si);
|
5923
5923
|
}
|
5924
|
-
return _createClass(
|
5924
|
+
return _createClass(Si, null, [{
|
5925
5925
|
key: "waitForPropertiesToBeUpdatedBeforeRender",
|
5926
5926
|
value: function waitForPropertiesToBeUpdatedBeforeRender(e) {
|
5927
5927
|
e._propUpdated_ = !1, setTimeout(function () {
|
5928
|
-
e._propUpdated_ ?
|
5928
|
+
e._propUpdated_ ? Si.waitForPropertiesToBeUpdatedBeforeRender(e) : (e._waitingToRender_ = !1, e.onRender());
|
5929
5929
|
});
|
5930
5930
|
}
|
5931
5931
|
}, {
|
5932
5932
|
key: "attemptRender",
|
5933
5933
|
value: function attemptRender(e) {
|
5934
|
-
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0,
|
5934
|
+
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0, Si.waitForPropertiesToBeUpdatedBeforeRender(e));
|
5935
5935
|
}
|
5936
5936
|
}]);
|
5937
5937
|
}();
|
@@ -5958,7 +5958,7 @@ var ke = /*#__PURE__*/function (_HTMLElement) {
|
|
5958
5958
|
return i;
|
5959
5959
|
},
|
5960
5960
|
set: function set(o) {
|
5961
|
-
i = o, t ? this[e] = o :
|
5961
|
+
i = o, t ? this[e] = o : Si.attemptRender(this);
|
5962
5962
|
}
|
5963
5963
|
});
|
5964
5964
|
}
|
@@ -5995,16 +5995,16 @@ var V = /*#__PURE__*/function () {
|
|
5995
5995
|
}
|
5996
5996
|
}]);
|
5997
5997
|
}();
|
5998
|
-
var
|
5999
|
-
function
|
6000
|
-
_classCallCheck(this,
|
5998
|
+
var qe = /*#__PURE__*/function () {
|
5999
|
+
function qe() {
|
6000
|
+
_classCallCheck(this, qe);
|
6001
6001
|
}
|
6002
|
-
return _createClass(
|
6002
|
+
return _createClass(qe, null, [{
|
6003
6003
|
key: "changeVisibility",
|
6004
6004
|
value:
|
6005
6005
|
// prettier-ignore
|
6006
6006
|
function changeVisibility(e, t, i, s) {
|
6007
|
-
s.target.id ===
|
6007
|
+
s.target.id === qe.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
|
6008
6008
|
}
|
6009
6009
|
}, {
|
6010
6010
|
key: "createIconElement",
|
@@ -6018,15 +6018,15 @@ var je = /*#__PURE__*/function () {
|
|
6018
6018
|
value: function create(e) {
|
6019
6019
|
var t = document.createElement("div");
|
6020
6020
|
t.id = "visibility-icon-container";
|
6021
|
-
var i =
|
6021
|
+
var i = qe.createIconElement(Fo, qe.VISIBLE_ICON_ID);
|
6022
6022
|
i.style.display = "none", t.appendChild(i);
|
6023
|
-
var s =
|
6024
|
-
return t.appendChild(s), t.onclick =
|
6023
|
+
var s = qe.createIconElement(Bo, "not-visible-icon");
|
6024
|
+
return t.appendChild(s), t.onclick = qe.changeVisibility.bind(this, e, i, s), t;
|
6025
6025
|
}
|
6026
6026
|
}]);
|
6027
6027
|
}();
|
6028
|
-
|
6029
|
-
var ss =
|
6028
|
+
qe.VISIBLE_ICON_ID = "visible-icon";
|
6029
|
+
var ss = qe;
|
6030
6030
|
var $ = /*#__PURE__*/function () {
|
6031
6031
|
function $() {
|
6032
6032
|
_classCallCheck(this, $);
|
@@ -6162,7 +6162,7 @@ var se = /*#__PURE__*/function () {
|
|
6162
6162
|
key: "enableButtons",
|
6163
6163
|
value: function enableButtons(e, t) {
|
6164
6164
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
6165
|
-
window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i <
|
6165
|
+
window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < ii.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
|
6166
6166
|
return se.enableButtons(e, t, i + 1);
|
6167
6167
|
}, 250);
|
6168
6168
|
}
|
@@ -6219,7 +6219,7 @@ var se = /*#__PURE__*/function () {
|
|
6219
6219
|
}]);
|
6220
6220
|
}();
|
6221
6221
|
se.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button", se.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button", se.FILE_INPUT_CLASS = "deep-chat-file-input", se.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
|
6222
|
-
var
|
6222
|
+
var _i = se;
|
6223
6223
|
var $s = {
|
6224
6224
|
model_list: [
|
6225
6225
|
// Llama-2
|
@@ -6395,7 +6395,7 @@ var $s = {
|
|
6395
6395
|
key: "getIntroMessage",
|
6396
6396
|
value: function getIntroMessage(e) {
|
6397
6397
|
if (!this.shouldAddIntroMessage(e) || !this._chatEl) return;
|
6398
|
-
var t =
|
6398
|
+
var t = _i.setUpInitial(this.init.bind(this), this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
6399
6399
|
return this.scrollToTop(1), {
|
6400
6400
|
role: y.AI_ROLE,
|
6401
6401
|
html: t,
|
@@ -6541,7 +6541,7 @@ var $s = {
|
|
6541
6541
|
return _context37.abrupt("return", this.unloadChat(_context37.t0));
|
6542
6542
|
case 16:
|
6543
6543
|
if ((l = (a = this.deepChat)._validationHandler) == null || l.call(a), (c = this._webModel.introMessage) != null && c.removeAfterLoad) this._webModel.introMessage.displayed === !1 ? (u = this._messages) == null || u.removeLastMessage() : (h = this._removeIntro) == null || h.call(this);else {
|
6544
|
-
_f =
|
6544
|
+
_f = _i.setUpAfterLoad(r, this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
6545
6545
|
(d = this._messages) == null || d.addNewMessage({
|
6546
6546
|
html: _f,
|
6547
6547
|
overwrite: !0,
|
@@ -6894,12 +6894,12 @@ var $s = {
|
|
6894
6894
|
}]);
|
6895
6895
|
}(it);
|
6896
6896
|
C.GENERIC_ERROR = "Error, please check the [troubleshooting](https://deepchat.dev/docs/webModel#troubleshooting) section of documentation for help.", C.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models", C.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found", C.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1", C.MODULE_SEARCH_LIMIT_S = 5;
|
6897
|
-
var
|
6898
|
-
var
|
6899
|
-
function
|
6900
|
-
_classCallCheck(this,
|
6897
|
+
var ii = C;
|
6898
|
+
var xi = /*#__PURE__*/function () {
|
6899
|
+
function xi() {
|
6900
|
+
_classCallCheck(this, xi);
|
6901
6901
|
}
|
6902
|
-
return _createClass(
|
6902
|
+
return _createClass(xi, null, [{
|
6903
6903
|
key: "buildHeaders",
|
6904
6904
|
value: function buildHeaders(e) {
|
6905
6905
|
return {
|
@@ -6921,22 +6921,22 @@ var _i = /*#__PURE__*/function () {
|
|
6921
6921
|
return {
|
6922
6922
|
url: "https://api-inference.huggingface.co/models/gpt2",
|
6923
6923
|
method: "POST",
|
6924
|
-
handleVerificationResult:
|
6924
|
+
handleVerificationResult: xi.handleVerificationResult
|
6925
6925
|
};
|
6926
6926
|
}
|
6927
6927
|
}]);
|
6928
6928
|
}();
|
6929
|
-
var
|
6929
|
+
var Wt = /*#__PURE__*/function (_K) {
|
6930
6930
|
// prettier-ignore
|
6931
|
-
function
|
6931
|
+
function Wt(e, t, i, s, r, o) {
|
6932
6932
|
var _this24;
|
6933
|
-
_classCallCheck(this,
|
6934
|
-
_this24 = _callSuper(this,
|
6933
|
+
_classCallCheck(this, Wt);
|
6934
|
+
_this24 = _callSuper(this, Wt, [e, xi.buildKeyVerificationDetails(), xi.buildHeaders, r, o]), _this24.insertKeyPlaceholderText = "Hugging Face Token", _this24.keyHelpUrl = "https://huggingface.co/settings/tokens", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this24.permittedErrorPrefixes = ["Authorization header"], _this24.url = "".concat(Wt.URL_PREFIX).concat(i), _this24.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this24.url = "".concat(Wt.URL_PREFIX).concat(s.model)), s.options && (_this24.rawBody.options = s.options), s.parameters && (_this24.rawBody.parameters = s.parameters));
|
6935
6935
|
return _this24;
|
6936
6936
|
}
|
6937
6937
|
// prettier-ignore
|
6938
|
-
_inherits(
|
6939
|
-
return _createClass(
|
6938
|
+
_inherits(Wt, _K);
|
6939
|
+
return _createClass(Wt, [{
|
6940
6940
|
key: "preprocessBody",
|
6941
6941
|
value: function preprocessBody(e, t, i) {
|
6942
6942
|
var _s$options;
|
@@ -6975,18 +6975,18 @@ var $t = /*#__PURE__*/function (_K) {
|
|
6975
6975
|
}()
|
6976
6976
|
}]);
|
6977
6977
|
}(K);
|
6978
|
-
|
6979
|
-
var
|
6980
|
-
var
|
6978
|
+
Wt.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
6979
|
+
var Be = Wt;
|
6980
|
+
var li = /*#__PURE__*/function (_Be) {
|
6981
6981
|
// prettier-ignore
|
6982
|
-
function
|
6982
|
+
function li(e, t, i, s, r, o) {
|
6983
6983
|
var _this25;
|
6984
|
-
_classCallCheck(this,
|
6985
|
-
_this25 = _callSuper(this,
|
6984
|
+
_classCallCheck(this, li);
|
6985
|
+
_this25 = _callSuper(this, li, [e, t, i, s, r, o]), _this25.isTextInputDisabled = !0, _this25.canSendMessage = li.canSendFile;
|
6986
6986
|
return _this25;
|
6987
6987
|
}
|
6988
|
-
_inherits(
|
6989
|
-
return _createClass(
|
6988
|
+
_inherits(li, _Be);
|
6989
|
+
return _createClass(li, [{
|
6990
6990
|
key: "preprocessBody",
|
6991
6991
|
value: function preprocessBody(e, t, i) {
|
6992
6992
|
return i[0];
|
@@ -7029,8 +7029,8 @@ var ai = /*#__PURE__*/function (_De) {
|
|
7029
7029
|
return !!(t != null && t[0]);
|
7030
7030
|
}
|
7031
7031
|
}]);
|
7032
|
-
}(
|
7033
|
-
var Uo = /*#__PURE__*/function (
|
7032
|
+
}(Be);
|
7033
|
+
var Uo = /*#__PURE__*/function (_li) {
|
7034
7034
|
// prettier-ignore
|
7035
7035
|
function Uo(e) {
|
7036
7036
|
_classCallCheck(this, Uo);
|
@@ -7041,7 +7041,7 @@ var Uo = /*#__PURE__*/function (_ai) {
|
|
7041
7041
|
audio: {}
|
7042
7042
|
}]);
|
7043
7043
|
}
|
7044
|
-
_inherits(Uo,
|
7044
|
+
_inherits(Uo, _li);
|
7045
7045
|
return _createClass(Uo, [{
|
7046
7046
|
key: "extractPollResultData",
|
7047
7047
|
value: function () {
|
@@ -7079,8 +7079,8 @@ var Uo = /*#__PURE__*/function (_ai) {
|
|
7079
7079
|
return extractPollResultData;
|
7080
7080
|
}()
|
7081
7081
|
}]);
|
7082
|
-
}(
|
7083
|
-
var jo = /*#__PURE__*/function (
|
7082
|
+
}(li);
|
7083
|
+
var jo = /*#__PURE__*/function (_li2) {
|
7084
7084
|
function jo(e) {
|
7085
7085
|
_classCallCheck(this, jo);
|
7086
7086
|
var s, r, o;
|
@@ -7090,7 +7090,7 @@ var jo = /*#__PURE__*/function (_ai2) {
|
|
7090
7090
|
images: {}
|
7091
7091
|
}]);
|
7092
7092
|
}
|
7093
|
-
_inherits(jo,
|
7093
|
+
_inherits(jo, _li2);
|
7094
7094
|
return _createClass(jo, [{
|
7095
7095
|
key: "extractPollResultData",
|
7096
7096
|
value: function () {
|
@@ -7128,8 +7128,8 @@ var jo = /*#__PURE__*/function (_ai2) {
|
|
7128
7128
|
return extractPollResultData;
|
7129
7129
|
}()
|
7130
7130
|
}]);
|
7131
|
-
}(
|
7132
|
-
var
|
7131
|
+
}(li);
|
7132
|
+
var ci = "data:image/png;base64,";
|
7133
7133
|
var Ae = /*#__PURE__*/function () {
|
7134
7134
|
function Ae() {
|
7135
7135
|
_classCallCheck(this, Ae);
|
@@ -7170,10 +7170,10 @@ var qi = /*#__PURE__*/function (_K2) {
|
|
7170
7170
|
_inherits(qi, _K2);
|
7171
7171
|
return _createClass(qi);
|
7172
7172
|
}(K);
|
7173
|
-
var
|
7174
|
-
function
|
7173
|
+
var wi = /*#__PURE__*/function (_qi) {
|
7174
|
+
function wi(e) {
|
7175
7175
|
var _this27;
|
7176
|
-
_classCallCheck(this,
|
7176
|
+
_classCallCheck(this, wi);
|
7177
7177
|
var o;
|
7178
7178
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7179
7179
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -7185,13 +7185,13 @@ var xi = /*#__PURE__*/function (_qi) {
|
|
7185
7185
|
}
|
7186
7186
|
}
|
7187
7187
|
};
|
7188
|
-
_this27 = _callSuper(this,
|
7188
|
+
_this27 = _callSuper(this, wi, [e, Ae.buildKeyVerificationDetails(), Ae.buildHeaders, i, s]), _this27.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this27.textInputPlaceholderText = "Describe image changes", _this27.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
7189
7189
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
7190
|
-
_typeof(r) == "object" && (r.engine_id && (_this27.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")),
|
7190
|
+
_typeof(r) == "object" && (r.engine_id && (_this27.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), wi.cleanConfig(r), Object.assign(_this27.rawBody, r)), _this27.canSendMessage = wi.canSendFileMessage;
|
7191
7191
|
return _this27;
|
7192
7192
|
}
|
7193
|
-
_inherits(
|
7194
|
-
return _createClass(
|
7193
|
+
_inherits(wi, _qi);
|
7194
|
+
return _createClass(wi, [{
|
7195
7195
|
key: "createFormDataBody",
|
7196
7196
|
value: function createFormDataBody(e, t) {
|
7197
7197
|
var i = new FormData();
|
@@ -7249,7 +7249,7 @@ var xi = /*#__PURE__*/function (_qi) {
|
|
7249
7249
|
return _context51.abrupt("return", {
|
7250
7250
|
files: e.artifacts.map(function (i) {
|
7251
7251
|
return {
|
7252
|
-
src: "".concat(
|
7252
|
+
src: "".concat(ci).concat(i.base64),
|
7253
7253
|
type: "image"
|
7254
7254
|
};
|
7255
7255
|
})
|
@@ -7277,10 +7277,10 @@ var xi = /*#__PURE__*/function (_qi) {
|
|
7277
7277
|
}
|
7278
7278
|
}]);
|
7279
7279
|
}(qi);
|
7280
|
-
var
|
7281
|
-
function
|
7280
|
+
var Ai = /*#__PURE__*/function (_qi2) {
|
7281
|
+
function Ai(e) {
|
7282
7282
|
var _this28;
|
7283
|
-
_classCallCheck(this,
|
7283
|
+
_classCallCheck(this, Ai);
|
7284
7284
|
var o;
|
7285
7285
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7286
7286
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -7292,13 +7292,13 @@ var wi = /*#__PURE__*/function (_qi2) {
|
|
7292
7292
|
}
|
7293
7293
|
}
|
7294
7294
|
};
|
7295
|
-
_this28 = _callSuper(this,
|
7295
|
+
_this28 = _callSuper(this, Ai, [e, Ae.buildKeyVerificationDetails(), Ae.buildHeaders, i, s]), _this28.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this28._maskSource = "MASK_IMAGE_WHITE", _this28.textInputPlaceholderText = "Describe image changes", _this28.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
7296
7296
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
7297
|
-
_typeof(r) == "object" && (r.engine_id && (_this28.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this28._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this28._maskSource = r.mask_source),
|
7297
|
+
_typeof(r) == "object" && (r.engine_id && (_this28.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this28._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this28._maskSource = r.mask_source), Ai.cleanConfig(r), Object.assign(_this28.rawBody, r)), _this28.canSendMessage = Ai.canSendFileTextMessage;
|
7298
7298
|
return _this28;
|
7299
7299
|
}
|
7300
|
-
_inherits(
|
7301
|
-
return _createClass(
|
7300
|
+
_inherits(Ai, _qi2);
|
7301
|
+
return _createClass(Ai, [{
|
7302
7302
|
key: "createFormDataBody",
|
7303
7303
|
value: function createFormDataBody(e, t, i, s) {
|
7304
7304
|
var r = new FormData();
|
@@ -7356,7 +7356,7 @@ var wi = /*#__PURE__*/function (_qi2) {
|
|
7356
7356
|
return _context53.abrupt("return", {
|
7357
7357
|
files: e.artifacts.map(function (i) {
|
7358
7358
|
return {
|
7359
|
-
src: "".concat(
|
7359
|
+
src: "".concat(ci).concat(i.base64),
|
7360
7360
|
type: "image"
|
7361
7361
|
};
|
7362
7362
|
})
|
@@ -7384,7 +7384,7 @@ var wi = /*#__PURE__*/function (_qi2) {
|
|
7384
7384
|
}
|
7385
7385
|
}]);
|
7386
7386
|
}(qi);
|
7387
|
-
var qo = /*#__PURE__*/function (
|
7387
|
+
var qo = /*#__PURE__*/function (_li3) {
|
7388
7388
|
function qo(e) {
|
7389
7389
|
_classCallCheck(this, qo);
|
7390
7390
|
var s, r, o;
|
@@ -7394,7 +7394,7 @@ var qo = /*#__PURE__*/function (_ai3) {
|
|
7394
7394
|
audio: {}
|
7395
7395
|
}]);
|
7396
7396
|
}
|
7397
|
-
_inherits(qo,
|
7397
|
+
_inherits(qo, _li3);
|
7398
7398
|
return _createClass(qo, [{
|
7399
7399
|
key: "extractPollResultData",
|
7400
7400
|
value: function () {
|
@@ -7431,8 +7431,8 @@ var qo = /*#__PURE__*/function (_ai3) {
|
|
7431
7431
|
return extractPollResultData;
|
7432
7432
|
}()
|
7433
7433
|
}]);
|
7434
|
-
}(
|
7435
|
-
var Ho = /*#__PURE__*/function (
|
7434
|
+
}(li);
|
7435
|
+
var Ho = /*#__PURE__*/function (_Be2) {
|
7436
7436
|
function Ho(e) {
|
7437
7437
|
_classCallCheck(this, Ho);
|
7438
7438
|
var s, r, o;
|
@@ -7440,7 +7440,7 @@ var Ho = /*#__PURE__*/function (_De2) {
|
|
7440
7440
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
7441
7441
|
return _callSuper(this, Ho, [e, "Once upon a time", "gpt2", t, i]);
|
7442
7442
|
}
|
7443
|
-
_inherits(Ho,
|
7443
|
+
_inherits(Ho, _Be2);
|
7444
7444
|
return _createClass(Ho, [{
|
7445
7445
|
key: "extractResultData",
|
7446
7446
|
value: function () {
|
@@ -7470,8 +7470,8 @@ var Ho = /*#__PURE__*/function (_De2) {
|
|
7470
7470
|
return extractResultData;
|
7471
7471
|
}()
|
7472
7472
|
}]);
|
7473
|
-
}(
|
7474
|
-
var zo = /*#__PURE__*/function (
|
7473
|
+
}(Be);
|
7474
|
+
var zo = /*#__PURE__*/function (_Be3) {
|
7475
7475
|
function zo(e) {
|
7476
7476
|
var _this29;
|
7477
7477
|
_classCallCheck(this, zo);
|
@@ -7481,7 +7481,7 @@ var zo = /*#__PURE__*/function (_De3) {
|
|
7481
7481
|
_this29 = _callSuper(this, zo, [e, "Ask a question", "bert-large-uncased-whole-word-masking-finetuned-squad", t, i]), _this29.permittedErrorPrefixes = ["Authorization header", "Error in"], _this29.context = t.context;
|
7482
7482
|
return _this29;
|
7483
7483
|
}
|
7484
|
-
_inherits(zo,
|
7484
|
+
_inherits(zo, _Be3);
|
7485
7485
|
return _createClass(zo, [{
|
7486
7486
|
key: "preprocessBody",
|
7487
7487
|
value: function preprocessBody(e, t) {
|
@@ -7524,8 +7524,8 @@ var zo = /*#__PURE__*/function (_De3) {
|
|
7524
7524
|
return extractResultData;
|
7525
7525
|
}()
|
7526
7526
|
}]);
|
7527
|
-
}(
|
7528
|
-
var Go = /*#__PURE__*/function (
|
7527
|
+
}(Be);
|
7528
|
+
var Go = /*#__PURE__*/function (_Be4) {
|
7529
7529
|
function Go(e) {
|
7530
7530
|
_classCallCheck(this, Go);
|
7531
7531
|
var s, r, o;
|
@@ -7533,7 +7533,7 @@ var Go = /*#__PURE__*/function (_De4) {
|
|
7533
7533
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
7534
7534
|
return _callSuper(this, Go, [e, "Insert text to summarize", "facebook/bart-large-cnn", t, i]);
|
7535
7535
|
}
|
7536
|
-
_inherits(Go,
|
7536
|
+
_inherits(Go, _Be4);
|
7537
7537
|
return _createClass(Go, [{
|
7538
7538
|
key: "extractResultData",
|
7539
7539
|
value: function () {
|
@@ -7563,8 +7563,8 @@ var Go = /*#__PURE__*/function (_De4) {
|
|
7563
7563
|
return extractResultData;
|
7564
7564
|
}()
|
7565
7565
|
}]);
|
7566
|
-
}(
|
7567
|
-
var Vo = /*#__PURE__*/function (
|
7566
|
+
}(Be);
|
7567
|
+
var Vo = /*#__PURE__*/function (_Be5) {
|
7568
7568
|
function Vo(e) {
|
7569
7569
|
var _this30$maxMessages;
|
7570
7570
|
var _this30;
|
@@ -7576,7 +7576,7 @@ var Vo = /*#__PURE__*/function (_De5) {
|
|
7576
7576
|
return _this30;
|
7577
7577
|
}
|
7578
7578
|
// prettier-ignore
|
7579
|
-
_inherits(Vo,
|
7579
|
+
_inherits(Vo, _Be5);
|
7580
7580
|
return _createClass(Vo, [{
|
7581
7581
|
key: "processMessages",
|
7582
7582
|
value: function processMessages(e) {
|
@@ -7645,11 +7645,11 @@ var Vo = /*#__PURE__*/function (_De5) {
|
|
7645
7645
|
return extractResultData;
|
7646
7646
|
}()
|
7647
7647
|
}]);
|
7648
|
-
}(
|
7649
|
-
var
|
7650
|
-
function
|
7648
|
+
}(Be);
|
7649
|
+
var Ci = /*#__PURE__*/function (_qi3) {
|
7650
|
+
function Ci(e) {
|
7651
7651
|
var _this31;
|
7652
|
-
_classCallCheck(this,
|
7652
|
+
_classCallCheck(this, Ci);
|
7653
7653
|
var o;
|
7654
7654
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7655
7655
|
i = t.stabilityAI,
|
@@ -7661,13 +7661,13 @@ var Ai = /*#__PURE__*/function (_qi3) {
|
|
7661
7661
|
}
|
7662
7662
|
}
|
7663
7663
|
};
|
7664
|
-
_this31 = _callSuper(this,
|
7664
|
+
_this31 = _callSuper(this, Ci, [e, Ae.buildKeyVerificationDetails(), Ae.buildHeaders, i, s]), _this31.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this31.textInputPlaceholderText = "Describe image changes", _this31.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
7665
7665
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
7666
|
-
_typeof(r) == "object" && (r.engine_id && (_this31.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this31._imageWeight = r.weight),
|
7666
|
+
_typeof(r) == "object" && (r.engine_id && (_this31.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this31._imageWeight = r.weight), Ci.cleanConfig(r), Object.assign(_this31.rawBody, r)), _this31.canSendMessage = Ci.canSendFileTextMessage;
|
7667
7667
|
return _this31;
|
7668
7668
|
}
|
7669
|
-
_inherits(
|
7670
|
-
return _createClass(
|
7669
|
+
_inherits(Ci, _qi3);
|
7670
|
+
return _createClass(Ci, [{
|
7671
7671
|
key: "createFormDataBody",
|
7672
7672
|
value: function createFormDataBody(e, t, i) {
|
7673
7673
|
var s = new FormData();
|
@@ -7725,7 +7725,7 @@ var Ai = /*#__PURE__*/function (_qi3) {
|
|
7725
7725
|
return _context60.abrupt("return", {
|
7726
7726
|
files: e.artifacts.map(function (i) {
|
7727
7727
|
return {
|
7728
|
-
src: "".concat(
|
7728
|
+
src: "".concat(ci).concat(i.base64),
|
7729
7729
|
type: "image"
|
7730
7730
|
};
|
7731
7731
|
})
|
@@ -7753,7 +7753,7 @@ var Ai = /*#__PURE__*/function (_qi3) {
|
|
7753
7753
|
}
|
7754
7754
|
}]);
|
7755
7755
|
}(qi);
|
7756
|
-
var Ko = /*#__PURE__*/function (
|
7756
|
+
var Ko = /*#__PURE__*/function (_Be6) {
|
7757
7757
|
function Ko(e) {
|
7758
7758
|
_classCallCheck(this, Ko);
|
7759
7759
|
var s, r, o;
|
@@ -7761,7 +7761,7 @@ var Ko = /*#__PURE__*/function (_De6) {
|
|
7761
7761
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
7762
7762
|
return _callSuper(this, Ko, [e, "Insert text to translate", "Helsinki-NLP/opus-tatoeba-en-ja", t, i]);
|
7763
7763
|
}
|
7764
|
-
_inherits(Ko,
|
7764
|
+
_inherits(Ko, _Be6);
|
7765
7765
|
return _createClass(Ko, [{
|
7766
7766
|
key: "extractResultData",
|
7767
7767
|
value: function () {
|
@@ -7791,21 +7791,21 @@ var Ko = /*#__PURE__*/function (_De6) {
|
|
7791
7791
|
return extractResultData;
|
7792
7792
|
}()
|
7793
7793
|
}]);
|
7794
|
-
}(
|
7795
|
-
var
|
7796
|
-
function
|
7794
|
+
}(Be);
|
7795
|
+
var Ti = /*#__PURE__*/function (_qi4) {
|
7796
|
+
function Ti(e) {
|
7797
7797
|
var _this32;
|
7798
|
-
_classCallCheck(this,
|
7798
|
+
_classCallCheck(this, Ti);
|
7799
7799
|
var r;
|
7800
7800
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7801
7801
|
i = t.stabilityAI;
|
7802
|
-
_this32 = _callSuper(this,
|
7802
|
+
_this32 = _callSuper(this, Ti, [e, Ae.buildKeyVerificationDetails(), Ae.buildHeaders, i]), _this32.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this32.textInputPlaceholderText = "Describe an image", _this32.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
7803
7803
|
var s = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
7804
|
-
_typeof(s) == "object" && (s.engine_id && (_this32.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this32._imageWeight = s.weight),
|
7804
|
+
_typeof(s) == "object" && (s.engine_id && (_this32.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this32._imageWeight = s.weight), Ti.cleanConfig(s), Object.assign(_this32.rawBody, s)), _this32.canSendMessage = Ti.canSendTextMessage;
|
7805
7805
|
return _this32;
|
7806
7806
|
}
|
7807
|
-
_inherits(
|
7808
|
-
return _createClass(
|
7807
|
+
_inherits(Ti, _qi4);
|
7808
|
+
return _createClass(Ti, [{
|
7809
7809
|
key: "preprocessBody",
|
7810
7810
|
value: function preprocessBody(e, t) {
|
7811
7811
|
var i = JSON.parse(JSON.stringify(e)),
|
@@ -7857,7 +7857,7 @@ var Ci = /*#__PURE__*/function (_qi4) {
|
|
7857
7857
|
return _context63.abrupt("return", {
|
7858
7858
|
files: e.artifacts.map(function (i) {
|
7859
7859
|
return {
|
7860
|
-
src: "".concat(
|
7860
|
+
src: "".concat(ci).concat(i.base64),
|
7861
7861
|
type: "image"
|
7862
7862
|
};
|
7863
7863
|
})
|
@@ -7885,7 +7885,7 @@ var Ci = /*#__PURE__*/function (_qi4) {
|
|
7885
7885
|
}
|
7886
7886
|
}]);
|
7887
7887
|
}(qi);
|
7888
|
-
var $o = /*#__PURE__*/function (
|
7888
|
+
var $o = /*#__PURE__*/function (_Be7) {
|
7889
7889
|
function $o(e) {
|
7890
7890
|
var _this33;
|
7891
7891
|
_classCallCheck(this, $o);
|
@@ -7895,7 +7895,7 @@ var $o = /*#__PURE__*/function (_De7) {
|
|
7895
7895
|
_this33 = _callSuper(this, $o, [e, "The goal of life is [MASK].", "bert-base-uncased", t, i]), _this33.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>Insert a sentence with the word [MASK] and the model will try to fill it for you. E.g. I want [MASK].</p>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this33.permittedErrorPrefixes = ["Authorization header", "No mask_token"];
|
7896
7896
|
return _this33;
|
7897
7897
|
}
|
7898
|
-
_inherits($o,
|
7898
|
+
_inherits($o, _Be7);
|
7899
7899
|
return _createClass($o, [{
|
7900
7900
|
key: "extractResultData",
|
7901
7901
|
value: function () {
|
@@ -7925,12 +7925,12 @@ var $o = /*#__PURE__*/function (_De7) {
|
|
7925
7925
|
return extractResultData;
|
7926
7926
|
}()
|
7927
7927
|
}]);
|
7928
|
-
}(
|
7929
|
-
var
|
7930
|
-
function
|
7931
|
-
_classCallCheck(this,
|
7928
|
+
}(Be);
|
7929
|
+
var Jt = /*#__PURE__*/function () {
|
7930
|
+
function Jt() {
|
7931
|
+
_classCallCheck(this, Jt);
|
7932
7932
|
}
|
7933
|
-
return _createClass(
|
7933
|
+
return _createClass(Jt, null, [{
|
7934
7934
|
key: "buildHeaders",
|
7935
7935
|
value: function buildHeaders(e) {
|
7936
7936
|
return {
|
@@ -7951,7 +7951,7 @@ var Wt = /*#__PURE__*/function () {
|
|
7951
7951
|
return {
|
7952
7952
|
url: "https://api.openai.com/v1/models",
|
7953
7953
|
method: "GET",
|
7954
|
-
handleVerificationResult:
|
7954
|
+
handleVerificationResult: Jt.handleVerificationResult
|
7955
7955
|
};
|
7956
7956
|
}
|
7957
7957
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
@@ -7993,8 +7993,8 @@ var Wt = /*#__PURE__*/function () {
|
|
7993
7993
|
}()
|
7994
7994
|
}]);
|
7995
7995
|
}();
|
7996
|
-
|
7997
|
-
var L =
|
7996
|
+
Jt.FUNCTION_TOOL_RESP_ERROR = "Response object must either be {response: string}[] for each individual function or {text: string} for a direct response, see https://deepchat.dev/docs/directConnection/OpenAI#FunctionHandler.", Jt.FUNCTION_TOOL_RESP_ARR_ERROR = "Arrays are not accepted in handler responses";
|
7997
|
+
var L = Jt;
|
7998
7998
|
var ne = /*#__PURE__*/function () {
|
7999
7999
|
function ne() {
|
8000
8000
|
_classCallCheck(this, ne);
|
@@ -8310,12 +8310,12 @@ var ne = /*#__PURE__*/function () {
|
|
8310
8310
|
}();
|
8311
8311
|
ne.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", ne.FUNCTION_TOOL_RESP_ERROR = "Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.";
|
8312
8312
|
var Re = ne;
|
8313
|
-
var
|
8313
|
+
var He = /*#__PURE__*/function (_K3) {
|
8314
8314
|
// prettier-ignore
|
8315
|
-
function
|
8315
|
+
function He(e, t, i, s, r, o) {
|
8316
8316
|
var _this34;
|
8317
|
-
_classCallCheck(this,
|
8318
|
-
if (_this34 = _callSuper(this,
|
8317
|
+
_classCallCheck(this, He);
|
8318
|
+
if (_this34 = _callSuper(this, He, [e, s, r, o]), _this34.insertKeyPlaceholderText = "OpenAI API Key", _this34.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this34.url = "", _this34.permittedErrorPrefixes = ["Incorrect", "Please send text", ti.FAILED_ERROR_MESSAGE], _this34.shouldFetchHistory = !1, _this34.searchedForThreadId = !1, _this34.config = {}, _this34.newAssistantDetails = {
|
8319
8319
|
model: "gpt-4"
|
8320
8320
|
}, _this34.waitingForStreamResponse = !1, _this34.isSSEStream = !1, _this34.urlSegments = i, _typeof(t) == "object") {
|
8321
8321
|
_this34.config = t;
|
@@ -8328,8 +8328,8 @@ var qe = /*#__PURE__*/function (_K3) {
|
|
8328
8328
|
_this34.maxMessages = 1, _this34.isSSEStream = !!(_this34.stream && (_typeof(_this34.stream) != "object" || !_this34.stream.simulation));
|
8329
8329
|
return _this34;
|
8330
8330
|
}
|
8331
|
-
_inherits(
|
8332
|
-
return _createClass(
|
8331
|
+
_inherits(He, _K3);
|
8332
|
+
return _createClass(He, [{
|
8333
8333
|
key: "fetchHistoryFunc",
|
8334
8334
|
value: function () {
|
8335
8335
|
var _fetchHistoryFunc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee75() {
|
@@ -8378,13 +8378,13 @@ var qe = /*#__PURE__*/function (_K3) {
|
|
8378
8378
|
}));
|
8379
8379
|
a === "code_interpreter" || a === "file_search" || a === "images" ? r = a : (console.error("Tool type \"".concat(a, "\" is not valid")), console.error('Expected "code_interpreter" or "file_search" or "images". Going to default to "images"'));
|
8380
8380
|
}
|
8381
|
-
if (r === "file_search") return
|
8382
|
-
if (r === "code_interpreter") return
|
8381
|
+
if (r === "file_search") return He.processAttachmentsMessage(s, t, "file_search");
|
8382
|
+
if (r === "code_interpreter") return He.processAttachmentsMessage(s, t, "code_interpreter");
|
8383
8383
|
if (t.find(function (_ref21) {
|
8384
8384
|
var a = _ref21.name;
|
8385
8385
|
return !z.isImageFileExtension(a);
|
8386
8386
|
})) console.error("The uploaded files contained a non-image file"), console.error('Make sure only images can be uploaded or define a "code_interpreter" or "file_search" value in the "files_tool_type" property'), console.warn('Make sure your existing assistant supports these "tools" or specify them in the "new_assistant" property');else {
|
8387
|
-
var _a2 =
|
8387
|
+
var _a2 = He.processImageMessage(s, t);
|
8388
8388
|
if (_a2) return _a2;
|
8389
8389
|
}
|
8390
8390
|
}
|
@@ -8650,7 +8650,7 @@ var qe = /*#__PURE__*/function (_K3) {
|
|
8650
8650
|
break;
|
8651
8651
|
}
|
8652
8652
|
return _context81.abrupt("return", {
|
8653
|
-
timeoutMS:
|
8653
|
+
timeoutMS: He.POLLING_TIMEOUT_MS
|
8654
8654
|
});
|
8655
8655
|
case 3:
|
8656
8656
|
if (!(t === "completed" && this.messages)) {
|
@@ -8763,7 +8763,7 @@ var qe = /*#__PURE__*/function (_K3) {
|
|
8763
8763
|
}, "POST");
|
8764
8764
|
case 22:
|
8765
8765
|
return _context82.abrupt("return", {
|
8766
|
-
timeoutMS:
|
8766
|
+
timeoutMS: He.POLLING_TIMEOUT_MS
|
8767
8767
|
});
|
8768
8768
|
case 23:
|
8769
8769
|
case "end":
|
@@ -8958,9 +8958,9 @@ var qe = /*#__PURE__*/function (_K3) {
|
|
8958
8958
|
}
|
8959
8959
|
}]);
|
8960
8960
|
}(K);
|
8961
|
-
|
8962
|
-
var
|
8963
|
-
var Es = /*#__PURE__*/function (
|
8961
|
+
He.POLLING_TIMEOUT_MS = 500;
|
8962
|
+
var Ri = He;
|
8963
|
+
var Es = /*#__PURE__*/function (_Ri) {
|
8964
8964
|
function Es(e) {
|
8965
8965
|
var _a$headers, _l$OpenAIBeta;
|
8966
8966
|
var _this37;
|
@@ -8978,7 +8978,7 @@ var Es = /*#__PURE__*/function (_Ti) {
|
|
8978
8978
|
}
|
8979
8979
|
return _this37;
|
8980
8980
|
}
|
8981
|
-
_inherits(Es,
|
8981
|
+
_inherits(Es, _Ri);
|
8982
8982
|
return _createClass(Es, null, [{
|
8983
8983
|
key: "buildUrlSegments",
|
8984
8984
|
value: function buildUrlSegments(e) {
|
@@ -8995,12 +8995,12 @@ var Es = /*#__PURE__*/function (_Ti) {
|
|
8995
8995
|
};
|
8996
8996
|
}
|
8997
8997
|
}]);
|
8998
|
-
}(
|
8999
|
-
var
|
9000
|
-
function
|
9001
|
-
_classCallCheck(this,
|
8998
|
+
}(Ri);
|
8999
|
+
var Mi = /*#__PURE__*/function () {
|
9000
|
+
function Mi() {
|
9001
|
+
_classCallCheck(this, Mi);
|
9002
9002
|
}
|
9003
|
-
return _createClass(
|
9003
|
+
return _createClass(Mi, null, [{
|
9004
9004
|
key: "buildHeaders",
|
9005
9005
|
value: function buildHeaders(e) {
|
9006
9006
|
return {
|
@@ -9022,7 +9022,7 @@ var Ri = /*#__PURE__*/function () {
|
|
9022
9022
|
return {
|
9023
9023
|
url: "https://api.cohere.ai/v1/generate",
|
9024
9024
|
method: "POST",
|
9025
|
-
handleVerificationResult:
|
9025
|
+
handleVerificationResult: Mi.handleVerificationResult,
|
9026
9026
|
body: JSON.stringify({
|
9027
9027
|
prompt: ""
|
9028
9028
|
})
|
@@ -9034,7 +9034,7 @@ var Ss = /*#__PURE__*/function (_K4) {
|
|
9034
9034
|
function Ss(e, t, i, s, r) {
|
9035
9035
|
var _this38;
|
9036
9036
|
_classCallCheck(this, Ss);
|
9037
|
-
_this38 = _callSuper(this, Ss, [e,
|
9037
|
+
_this38 = _callSuper(this, Ss, [e, Mi.buildKeyVerificationDetails(), Mi.buildHeaders, r]), _this38.insertKeyPlaceholderText = "Cohere API Key", _this38.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this38.permittedErrorPrefixes = ["invalid"], _this38.url = t, _this38.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this38.rawBody, s);
|
9038
9038
|
return _this38;
|
9039
9039
|
}
|
9040
9040
|
_inherits(Ss, _K4);
|
@@ -9148,7 +9148,7 @@ var Ms = /*#__PURE__*/function () {
|
|
9148
9148
|
}();
|
9149
9149
|
Ms.URL_DETAILS_ERROR_MESSAGE = "Please define the Azure URL Details. [More Information](https://deepchat.dev/docs/directConnection/Azure)";
|
9150
9150
|
var ue = Ms;
|
9151
|
-
var ut = /*#__PURE__*/function (
|
9151
|
+
var ut = /*#__PURE__*/function (_Ri2) {
|
9152
9152
|
function ut(e) {
|
9153
9153
|
var _g$headers;
|
9154
9154
|
var _this39;
|
@@ -9185,9 +9185,9 @@ var ut = /*#__PURE__*/function (_Ti2) {
|
|
9185
9185
|
}));
|
9186
9186
|
return _this39;
|
9187
9187
|
}
|
9188
|
-
_inherits(ut,
|
9188
|
+
_inherits(ut, _Ri2);
|
9189
9189
|
return _createClass(ut);
|
9190
|
-
}(
|
9190
|
+
}(Ri);
|
9191
9191
|
ut.THREAD_RESOURCE = "threads", ut.NEW_ASSISTANT_RESOURCE = "assistants";
|
9192
9192
|
var ns = ut;
|
9193
9193
|
var Jo = /*#__PURE__*/function (_Ss2) {
|
@@ -9474,7 +9474,7 @@ var Fi = /*#__PURE__*/function (_ot) {
|
|
9474
9474
|
}]);
|
9475
9475
|
}(ot);
|
9476
9476
|
Fi.EMPTY_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"></svg>';
|
9477
|
-
var
|
9477
|
+
var ki = Fi;
|
9478
9478
|
var U = /*#__PURE__*/function () {
|
9479
9479
|
function U() {
|
9480
9480
|
_classCallCheck(this, U);
|
@@ -9735,7 +9735,7 @@ var Ln = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9735
9735
|
value: function createMuteButton() {
|
9736
9736
|
var _this42 = this;
|
9737
9737
|
var t;
|
9738
|
-
var e = new
|
9738
|
+
var e = new ki((t = this._buttonsConfig) == null ? void 0 : t.microphone);
|
9739
9739
|
return e.elementRef.classList.replace("input-button-svg", "deep-chat-openai-realtime-button"), e.elementRef.classList.add(T.BUTTON_DEFAULT, "deep-chat-openai-realtime-mute"), e.elementRef.onclick = function () {
|
9740
9740
|
e.isActive ? (_this42.toggleMute(!0), e.elementRef.classList.replace(T.MUTE_ACTIVE, T.BUTTON_DEFAULT), e.changeToDefault(), _this42._isMuted = !1) : (_this42.toggleMute(!1), e.elementRef.classList.replace(T.BUTTON_DEFAULT, T.MUTE_ACTIVE), P.removeAriaAttributes(e.elementRef), e.changeToActive(), _this42._isMuted = !0);
|
9741
9741
|
}, e;
|
@@ -9753,7 +9753,7 @@ var Ln = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9753
9753
|
value: function createToggleButton() {
|
9754
9754
|
var _this43 = this;
|
9755
9755
|
var t;
|
9756
|
-
var e = new
|
9756
|
+
var e = new ki((t = this._buttonsConfig) == null ? void 0 : t.toggle);
|
9757
9757
|
return e.elementRef.classList.replace("input-button-svg", "deep-chat-openai-realtime-button"), e.elementRef.classList.add(T.BUTTON_DEFAULT, "deep-chat-openai-realtime-toggle"), e.elementRef.onclick = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93() {
|
9758
9758
|
var i, s;
|
9759
9759
|
return _regeneratorRuntime().wrap(function _callee93$(_context93) {
|
@@ -10536,25 +10536,25 @@ var Xo = /*#__PURE__*/function (_K8) {
|
|
10536
10536
|
_inherits(Xo, _K8);
|
10537
10537
|
return _createClass(Xo);
|
10538
10538
|
}(K);
|
10539
|
-
var
|
10540
|
-
function
|
10539
|
+
var Xt = /*#__PURE__*/function (_Xo) {
|
10540
|
+
function Xt(e) {
|
10541
10541
|
var _a$language;
|
10542
10542
|
var _this49;
|
10543
|
-
_classCallCheck(this,
|
10543
|
+
_classCallCheck(this, Xt);
|
10544
10544
|
var s, r, o, a;
|
10545
10545
|
var t = (r = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : r.summarization,
|
10546
10546
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
10547
|
-
_this49 = _callSuper(this,
|
10547
|
+
_this49 = _callSuper(this, Xt, [e, fe.buildSummarizationHeader, t.endpoint, i]), _this49.permittedErrorPrefixes = [Xt.ENDPOINT_ERROR_MESSAGE], _this49.url = "", _this49.textInputPlaceholderText = "Insert text to summarize", _this49.isTextInputDisabled = !1, t.endpoint ? ((_a$language = (a = _this49.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this49.rawBody, t), _this49.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview")) : (_this49.isTextInputDisabled = !0, _this49.canSendMessage = function () {
|
10548
10548
|
return !1;
|
10549
10549
|
}, setTimeout(function () {
|
10550
10550
|
e.addMessage({
|
10551
|
-
error:
|
10551
|
+
error: Xt.ENDPOINT_ERROR_MESSAGE
|
10552
10552
|
});
|
10553
10553
|
}));
|
10554
10554
|
return _this49;
|
10555
10555
|
}
|
10556
|
-
_inherits(
|
10557
|
-
return _createClass(
|
10556
|
+
_inherits(Xt, _Xo);
|
10557
|
+
return _createClass(Xt, [{
|
10558
10558
|
key: "preprocessBody",
|
10559
10559
|
value: function preprocessBody(e, t) {
|
10560
10560
|
var i = t[t.length - 1].text;
|
@@ -10695,10 +10695,10 @@ var Jt = /*#__PURE__*/function (_Xo) {
|
|
10695
10695
|
}()
|
10696
10696
|
}]);
|
10697
10697
|
}(Xo);
|
10698
|
-
|
10698
|
+
Xt.ENDPOINT_ERROR_MESSAGE =
|
10699
10699
|
// eslint-disable-next-line max-len
|
10700
10700
|
"Please define the azure endpoint. [More Information](https://deepchat.dev/docs/directConnection/Azure#Summarization)";
|
10701
|
-
var cs =
|
10701
|
+
var cs = Xt;
|
10702
10702
|
var zt = /*#__PURE__*/function () {
|
10703
10703
|
function zt() {
|
10704
10704
|
_classCallCheck(this, zt);
|
@@ -10990,10 +10990,10 @@ Ze.HELP_LINK =
|
|
10990
10990
|
// eslint-disable-next-line max-len
|
10991
10991
|
"Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#TextToSpeech)";
|
10992
10992
|
var ds = Ze;
|
10993
|
-
var
|
10994
|
-
function
|
10993
|
+
var ze = /*#__PURE__*/function (_In2) {
|
10994
|
+
function ze(e) {
|
10995
10995
|
var _this53;
|
10996
|
-
_classCallCheck(this,
|
10996
|
+
_classCallCheck(this, ze);
|
10997
10997
|
var r, o, a;
|
10998
10998
|
var t = (o = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : o.speechToText,
|
10999
10999
|
i = (a = e.directConnection) == null ? void 0 : a.azure,
|
@@ -11004,21 +11004,21 @@ var He = /*#__PURE__*/function (_In2) {
|
|
11004
11004
|
}
|
11005
11005
|
}
|
11006
11006
|
};
|
11007
|
-
if (_this53 = _callSuper(this,
|
11007
|
+
if (_this53 = _callSuper(this, ze, [e, fe.buildSpeechToTextHeaders, t.region, i, s]), _this53.permittedErrorPrefixes = [ze.REGION_ERROR_MESSAGE], _this53.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(ze.HELP_LINK, "\">here</a> for more info.\n </p>"), _this53.url = "", _this53.isTextInputDisabled = !0, _this53.textInputPlaceholderText = "Upload an audio file", !t.region) _this53.isTextInputDisabled = !0, _this53.canSendMessage = function () {
|
11008
11008
|
return !1;
|
11009
11009
|
}, setTimeout(function () {
|
11010
11010
|
e.addMessage({
|
11011
|
-
error:
|
11011
|
+
error: ze.REGION_ERROR_MESSAGE
|
11012
11012
|
});
|
11013
11013
|
});else {
|
11014
|
-
_this53.canSendMessage =
|
11014
|
+
_this53.canSendMessage = ze.canFileSendMessage;
|
11015
11015
|
var l = t.lang || "en-US";
|
11016
11016
|
_this53.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(l, "&format=detailed"), _this53.recordAudio = void 0;
|
11017
11017
|
}
|
11018
11018
|
return _this53;
|
11019
11019
|
}
|
11020
|
-
_inherits(
|
11021
|
-
return _createClass(
|
11020
|
+
_inherits(ze, _In2);
|
11021
|
+
return _createClass(ze, [{
|
11022
11022
|
key: "callServiceAPI",
|
11023
11023
|
value: function () {
|
11024
11024
|
var _callServiceAPI17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee110(e, t, i) {
|
@@ -11084,12 +11084,12 @@ var He = /*#__PURE__*/function (_In2) {
|
|
11084
11084
|
}
|
11085
11085
|
}]);
|
11086
11086
|
}(In);
|
11087
|
-
|
11087
|
+
ze.HELP_LINK =
|
11088
11088
|
// eslint-disable-next-line max-len
|
11089
|
-
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest",
|
11089
|
+
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", ze.REGION_ERROR_MESSAGE =
|
11090
11090
|
// eslint-disable-next-line max-len
|
11091
11091
|
"Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#SpeechToText)";
|
11092
|
-
var hs =
|
11092
|
+
var hs = ze;
|
11093
11093
|
var Yo = /*#__PURE__*/function (_K11) {
|
11094
11094
|
// prettier-ignore
|
11095
11095
|
function Yo(e) {
|
@@ -11608,7 +11608,7 @@ var me = /*#__PURE__*/function (_K13) {
|
|
11608
11608
|
src: i.url,
|
11609
11609
|
type: "image"
|
11610
11610
|
} : {
|
11611
|
-
src: "".concat(
|
11611
|
+
src: "".concat(ci).concat(i.b64_json),
|
11612
11612
|
type: "image"
|
11613
11613
|
};
|
11614
11614
|
})
|
@@ -11732,11 +11732,11 @@ var Zo = /*#__PURE__*/function (_Ss3) {
|
|
11732
11732
|
}()
|
11733
11733
|
}]);
|
11734
11734
|
}(Ss);
|
11735
|
-
var
|
11736
|
-
function
|
11737
|
-
_classCallCheck(this,
|
11735
|
+
var Li = /*#__PURE__*/function () {
|
11736
|
+
function Li() {
|
11737
|
+
_classCallCheck(this, Li);
|
11738
11738
|
}
|
11739
|
-
return _createClass(
|
11739
|
+
return _createClass(Li, null, [{
|
11740
11740
|
key: "buildHeaders",
|
11741
11741
|
value: function buildHeaders(e) {
|
11742
11742
|
return {
|
@@ -11758,7 +11758,7 @@ var ki = /*#__PURE__*/function () {
|
|
11758
11758
|
return {
|
11759
11759
|
url: "https://api.mistral.ai/v1/models",
|
11760
11760
|
method: "GET",
|
11761
|
-
handleVerificationResult:
|
11761
|
+
handleVerificationResult: Li.handleVerificationResult
|
11762
11762
|
};
|
11763
11763
|
}
|
11764
11764
|
}]);
|
@@ -11770,7 +11770,7 @@ var Qo = /*#__PURE__*/function (_K14) {
|
|
11770
11770
|
_classCallCheck(this, Qo);
|
11771
11771
|
var s;
|
11772
11772
|
var i = JSON.parse(JSON.stringify(e.directConnection)).mistral;
|
11773
|
-
_this60 = _callSuper(this, Qo, [e,
|
11773
|
+
_this60 = _callSuper(this, Qo, [e, Li.buildKeyVerificationDetails(), Li.buildHeaders, i]), _this60.insertKeyPlaceholderText = "Mistral API Key", _this60.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this60.url = "https://api.mistral.ai/v1/chat/completions", _this60.permittedErrorPrefixes = ["invalid"], i && (_this60.cleanConfig(i), Object.assign(_this60.rawBody, i)), (_this60$maxMessages = _this60.maxMessages) !== null && _this60$maxMessages !== void 0 ? _this60$maxMessages : _this60.maxMessages = -1, (_s$model = (s = _this60.rawBody).model) !== null && _s$model !== void 0 ? _s$model : s.model = "open-mistral-7b";
|
11774
11774
|
return _this60;
|
11775
11775
|
}
|
11776
11776
|
_inherits(Qo, _K14);
|
@@ -11863,7 +11863,7 @@ var ea = /*#__PURE__*/function () {
|
|
11863
11863
|
i = e.connect,
|
11864
11864
|
s = e.demo,
|
11865
11865
|
r = e.webModel;
|
11866
|
-
if (r) return new
|
11866
|
+
if (r) return new ii(e);
|
11867
11867
|
if (t) {
|
11868
11868
|
if (t.openAI) return t.openAI.images ? new us(e) : t.openAI.speechToText ? new ls(e) : t.openAI.textToSpeech ? new as(e) : t.openAI.assistant ? new Es(e) : t.openAI.realtime ? new os(e) : new gt(e);
|
11869
11869
|
if (t.assemblyAI) return new _s(e);
|
@@ -11879,7 +11879,7 @@ var ea = /*#__PURE__*/function () {
|
|
11879
11879
|
if (t.azure.summarization) return new cs(e);
|
11880
11880
|
if (t.azure.translation) return new Yo(e);
|
11881
11881
|
}
|
11882
|
-
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new
|
11882
|
+
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Ci(e) : t.stabilityAI.imageToImageUpscale ? new wi(e) : t.stabilityAI.imageToImageMasking ? new Ai(e) : new Ti(e);
|
11883
11883
|
if (t.mistral) return new Qo(e);
|
11884
11884
|
}
|
11885
11885
|
return i && Object.keys(i).length > 0 && !s ? new it(e) : new it(e, void 0, s || !0);
|
@@ -11918,21 +11918,21 @@ function x(n) {
|
|
11918
11918
|
i._attributes_[s] = fs.attibutes[n], i._attributeToProperty_[s] = t;
|
11919
11919
|
};
|
11920
11920
|
}
|
11921
|
-
var
|
11922
|
-
function
|
11923
|
-
_classCallCheck(this,
|
11921
|
+
var Ii = /*#__PURE__*/function () {
|
11922
|
+
function Ii(e, t, i) {
|
11923
|
+
_classCallCheck(this, Ii);
|
11924
11924
|
this._isDisplayed = !1, e ? (this._elementRef = this.createIntroPanelWithChild(e, i), this._isDisplayed = !0) : t && (this._elementRef = this.createInternalIntroPanel(t, i), this._isDisplayed = !0);
|
11925
11925
|
}
|
11926
|
-
return _createClass(
|
11926
|
+
return _createClass(Ii, [{
|
11927
11927
|
key: "createIntroPanelWithChild",
|
11928
11928
|
value: function createIntroPanelWithChild(e, t) {
|
11929
|
-
var i =
|
11929
|
+
var i = Ii.createIntroPanel(t);
|
11930
11930
|
return e.style.display === "none" && (e.style.display = "block"), i.appendChild(e), i;
|
11931
11931
|
}
|
11932
11932
|
}, {
|
11933
11933
|
key: "createInternalIntroPanel",
|
11934
11934
|
value: function createInternalIntroPanel(e, t) {
|
11935
|
-
var i =
|
11935
|
+
var i = Ii.createIntroPanel(t);
|
11936
11936
|
return i.id = "internal-intro-panel", i.innerHTML = e, i;
|
11937
11937
|
}
|
11938
11938
|
}, {
|
@@ -11979,7 +11979,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
|
|
11979
11979
|
key: "createAudioElement",
|
11980
11980
|
value: function createAudioElement(e, t) {
|
11981
11981
|
var i = document.createElement("audio");
|
11982
|
-
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0,
|
11982
|
+
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, Ne.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === y.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
|
11983
11983
|
}
|
11984
11984
|
}, {
|
11985
11985
|
key: "createNewAudioMessage",
|
@@ -12034,7 +12034,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
|
|
12034
12034
|
}]);
|
12035
12035
|
}();
|
12036
12036
|
J.IMAGE_BUBBLE_CLASS = "image-message", J.AUDIO_BUBBLE_CLASS = "audio-message", J.ANY_FILE_BUBBLE_CLASS = "any-file-message";
|
12037
|
-
var
|
12037
|
+
var Oi = J;
|
12038
12038
|
var le = /*#__PURE__*/function () {
|
12039
12039
|
function le() {
|
12040
12040
|
_classCallCheck(this, le);
|
@@ -12084,7 +12084,7 @@ var le = /*#__PURE__*/function () {
|
|
12084
12084
|
value: function updateFileMessages(e, t, i) {
|
12085
12085
|
var u, h;
|
12086
12086
|
var s = t[0].role,
|
12087
|
-
r =
|
12087
|
+
r = Oi.createMessages(e, i, s),
|
12088
12088
|
o = t[1].html,
|
12089
12089
|
a = ((h = t[1].files) == null ? void 0 : h[((u = t[1].files) == null ? void 0 : u.length) - 1]) || t[1].text,
|
12090
12090
|
l = o || a;
|
@@ -12167,7 +12167,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12167
12167
|
var s = t.permittedErrorPrefixes,
|
12168
12168
|
r = t.introPanelMarkUp,
|
12169
12169
|
o = t.demo;
|
12170
|
-
_this61._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this61._onClearMessages =
|
12170
|
+
_this61._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this61._onClearMessages = yi.onClearMessages.bind(_this61, e), _this61._onError = yi.onError.bind(_this61, e), _this61._isLoadingMessageAllowed = de.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this61.setLoadingToggle.bind(_this61)), _this61._permittedErrorPrefixes = s, _this61.addSetupMessageIfNeeded(e, t) || _this61.populateIntroPanel(i, r, e.introPanelStyle), o && _this61.prepareDemo(te.processDemo(o), e.loadHistory), _this61.addIntroductoryMessages(e, t), new ti(e, _this61, t), _this61._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
12171
12171
|
return JSON.parse(JSON.stringify(_this61.messageToElements.map(function (_ref35) {
|
12172
12172
|
var _ref36 = _slicedToArray(_ref35, 1),
|
12173
12173
|
c = _ref36[0];
|
@@ -12198,7 +12198,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12198
12198
|
if (_typeof(e) == "object") {
|
12199
12199
|
if (!t && e.displayLoading) {
|
12200
12200
|
var s = e.displayLoading.history;
|
12201
|
-
s != null && s.small &&
|
12201
|
+
s != null && s.small && De.addMessage(this, !1), s != null && s.full && De.addMessage(this);
|
12202
12202
|
}
|
12203
12203
|
e.displayErrors && (e.displayErrors["default"] && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")), (i = e.displayLoading) != null && i.message && this.addLoadingMessage(), e.response && (this.customDemoResponse = e.response);
|
12204
12204
|
}
|
@@ -12261,7 +12261,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12261
12261
|
key: "tryAddFileMessages",
|
12262
12262
|
value: function tryAddFileMessages(e) {
|
12263
12263
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
12264
|
-
e.files && Array.isArray(e.files) &&
|
12264
|
+
e.files && Array.isArray(e.files) && Oi.addMessages(this, e.files, e.role, t);
|
12265
12265
|
}
|
12266
12266
|
}, {
|
12267
12267
|
key: "tryAddHTMLMessage",
|
@@ -12369,7 +12369,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12369
12369
|
}, {
|
12370
12370
|
key: "populateIntroPanel",
|
12371
12371
|
value: function populateIntroPanel(e, t, i) {
|
12372
|
-
(e || t) && (this._introPanel = new
|
12372
|
+
(e || t) && (this._introPanel = new Ii(e, t, i), this._introPanel._elementRef && (Y.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
12373
12373
|
}
|
12374
12374
|
}, {
|
12375
12375
|
key: "addMultipleFiles",
|
@@ -12449,7 +12449,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12449
12449
|
}, {
|
12450
12450
|
key: "isActiveElement",
|
12451
12451
|
value: function isActiveElement(e) {
|
12452
|
-
return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(
|
12452
|
+
return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(De.CLASS) || e.contains(we.MESSAGE_CLASS) : !1;
|
12453
12453
|
}
|
12454
12454
|
}]);
|
12455
12455
|
}(he);
|
@@ -12569,7 +12569,7 @@ var ge = /*#__PURE__*/function () {
|
|
12569
12569
|
return _createClass(ge, null, [{
|
12570
12570
|
key: "addItemEvents",
|
12571
12571
|
value: function addItemEvents(e, t, i, s) {
|
12572
|
-
|
12572
|
+
Ve.add(t, s), t.addEventListener("click", function () {
|
12573
12573
|
i.click();
|
12574
12574
|
}), t.addEventListener("mouseenter", function (r) {
|
12575
12575
|
e.highlightedItem = r.target;
|
@@ -12602,7 +12602,7 @@ var ge = /*#__PURE__*/function () {
|
|
12602
12602
|
var s = t.elementRef,
|
12603
12603
|
r = t.dropupText,
|
12604
12604
|
o = document.createElement("div");
|
12605
|
-
if (Object.assign(o.style, (a = i == null ? void 0 : i.item) == null ? void 0 : a["default"]), ge.populateItem(s, o, r, i), o.classList.add(ge.MENU_ITEM_CLASS), s.classList.contains(
|
12605
|
+
if (Object.assign(o.style, (a = i == null ? void 0 : i.item) == null ? void 0 : a["default"]), ge.populateItem(s, o, r, i), o.classList.add(ge.MENU_ITEM_CLASS), s.classList.contains(Ke.BUTTON_CLASS)) t.setDropupItem(o);else {
|
12606
12606
|
var l = O.processStateful((i == null ? void 0 : i.item) || {});
|
12607
12607
|
ge.addItemEvents(e, o, s, l);
|
12608
12608
|
}
|
@@ -12678,7 +12678,7 @@ var pt = /*#__PURE__*/function (_ot2) {
|
|
12678
12678
|
var s;
|
12679
12679
|
this.elementRef.parentElement && this._originalElementRef && (this.elementRef = Y.replaceElementWithNewClone(this.elementRef, this._originalElementRef)), Object.assign(this.elementRef.style, (s = e == null ? void 0 : e.item) == null ? void 0 : s["default"]);
|
12680
12680
|
var t = O.processStateful((e == null ? void 0 : e.item) || {});
|
12681
|
-
|
12681
|
+
Ve.add(this.elementRef, t), this.addClickListener();
|
12682
12682
|
var i = this.elementRef.children[0];
|
12683
12683
|
i.classList.contains("text-button") || Object.assign(i.style, e == null ? void 0 : e.iconContainer);
|
12684
12684
|
}
|
@@ -12713,17 +12713,17 @@ var pt = /*#__PURE__*/function (_ot2) {
|
|
12713
12713
|
}]);
|
12714
12714
|
}(ot);
|
12715
12715
|
pt.INDICATOR_PREFIX = "custom", pt.BUTTON_CLASS = "custom-button";
|
12716
|
-
var
|
12716
|
+
var Ke = pt;
|
12717
12717
|
var sa = "<?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 <path d=\"M16 0c-8.836 0-16 7.163-16 16s7.163 16 16 16c8.837 0 16-7.163 16-16s-7.163-16-16-16zM16 30.032c-7.72 0-14-6.312-14-14.032s6.28-14 14-14 14 6.28 14 14-6.28 14.032-14 14.032zM23 15h-6v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1v6h-6c-0.552 0-1 0.448-1 1s0.448 1 1 1h6v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6h6c0.552 0 1-0.448 1-1s-0.448-1-1-1z\"></path>\n</svg>";
|
12718
|
-
var
|
12719
|
-
function
|
12720
|
-
_classCallCheck(this,
|
12718
|
+
var si = /*#__PURE__*/function () {
|
12719
|
+
function si() {
|
12720
|
+
_classCallCheck(this, si);
|
12721
12721
|
}
|
12722
|
-
return _createClass(
|
12722
|
+
return _createClass(si, null, [{
|
12723
12723
|
key: "focusItemWhenOnEdge",
|
12724
12724
|
value: function focusItemWhenOnEdge(e, t) {
|
12725
12725
|
var i = t ? e.children[0] : e.children[e.children.length - 1];
|
12726
|
-
|
12726
|
+
si.focusSiblingItem(i, e, t, !0);
|
12727
12727
|
}
|
12728
12728
|
// isEdgeItem means is it a start or end item
|
12729
12729
|
// prettier-ignore
|
@@ -12732,7 +12732,7 @@ var ii = /*#__PURE__*/function () {
|
|
12732
12732
|
value: function focusSiblingItem(e, t, i) {
|
12733
12733
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
12734
12734
|
var r = s ? e : e[i ? "nextSibling" : "previousSibling"];
|
12735
|
-
r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")),
|
12735
|
+
r ? (e.dispatchEvent(new MouseEvent("mouseleave")), r.dispatchEvent(new MouseEvent("mouseenter"))) : (e.dispatchEvent(new MouseEvent("mouseleave")), si.focusItemWhenOnEdge(t, i));
|
12736
12736
|
}
|
12737
12737
|
}]);
|
12738
12738
|
}();
|
@@ -12783,7 +12783,7 @@ var As = /*#__PURE__*/function () {
|
|
12783
12783
|
key: "windowKeyDown",
|
12784
12784
|
value: function windowKeyDown(e, t) {
|
12785
12785
|
var i, s, r;
|
12786
|
-
!e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === F.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === F.ENTER ? ((s = this.highlightedItem) == null || s.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === F.ARROW_DOWN ?
|
12786
|
+
!e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === F.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === F.ENTER ? ((s = this.highlightedItem) == null || s.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === F.ARROW_DOWN ? si.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === F.ARROW_UP && si.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
|
12787
12787
|
}
|
12788
12788
|
}], [{
|
12789
12789
|
key: "createElement",
|
@@ -12793,24 +12793,24 @@ var As = /*#__PURE__*/function () {
|
|
12793
12793
|
}
|
12794
12794
|
}]);
|
12795
12795
|
}();
|
12796
|
-
var
|
12797
|
-
function
|
12796
|
+
var Ge = /*#__PURE__*/function (_ot3) {
|
12797
|
+
function Ge(e, t) {
|
12798
12798
|
var _this67;
|
12799
|
-
_classCallCheck(this,
|
12799
|
+
_classCallCheck(this, Ge);
|
12800
12800
|
var s;
|
12801
|
-
_this67 = _callSuper(this,
|
12801
|
+
_this67 = _callSuper(this, Ge, [Ge.createButtonElement(), void 0, {
|
12802
12802
|
styles: (s = t == null ? void 0 : t.button) == null ? void 0 : s.styles
|
12803
12803
|
}]);
|
12804
12804
|
var i = _this67.createInnerElements(_this67._customStyles);
|
12805
|
-
_this67._menu = new As(e, t == null ? void 0 : t.menu), _this67.addClickEvent(), _this67.buttonContainer =
|
12805
|
+
_this67._menu = new As(e, t == null ? void 0 : t.menu), _this67.addClickEvent(), _this67.buttonContainer = Ge.createButtonContainer(), _this67.elementRef.appendChild(i.styles), _this67.buttonContainer.appendChild(_this67.elementRef), _this67.elementRef.classList.add(Ge.BUTTON_ICON_CLASS, "upload-file-button"), _this67.elementRef.children[0].id = "dropup-icon", _this67.buttonContainer.appendChild(_this67._menu.elementRef), _this67.reapplyStateStyle("styles"), _this67.addContainerEvents(e);
|
12806
12806
|
return _this67;
|
12807
12807
|
}
|
12808
|
-
_inherits(
|
12809
|
-
return _createClass(
|
12808
|
+
_inherits(Ge, _ot3);
|
12809
|
+
return _createClass(Ge, [{
|
12810
12810
|
key: "createInnerElements",
|
12811
12811
|
value: function createInnerElements(e) {
|
12812
12812
|
return {
|
12813
|
-
styles: this.createInnerElement(
|
12813
|
+
styles: this.createInnerElement(Ge.createSVGIconElement(), "styles", e)
|
12814
12814
|
};
|
12815
12815
|
}
|
12816
12816
|
}, {
|
@@ -12834,7 +12834,7 @@ var ze = /*#__PURE__*/function (_ot3) {
|
|
12834
12834
|
var _this68 = this;
|
12835
12835
|
e.addEventListener("click", function (t) {
|
12836
12836
|
var i = t.target.classList;
|
12837
|
-
!i.contains(
|
12837
|
+
!i.contains(Ge.BUTTON_ICON_CLASS) && !i.contains(re.DISABLED_ITEM_CLASS) && _this68._menu.close();
|
12838
12838
|
});
|
12839
12839
|
}
|
12840
12840
|
}], [{
|
@@ -12862,8 +12862,8 @@ var ze = /*#__PURE__*/function (_ot3) {
|
|
12862
12862
|
}
|
12863
12863
|
}]);
|
12864
12864
|
}(ot);
|
12865
|
-
|
12866
|
-
var
|
12865
|
+
Ge.BUTTON_ICON_CLASS = "dropup-icon";
|
12866
|
+
var Pi = Ge;
|
12867
12867
|
var W = /*#__PURE__*/function () {
|
12868
12868
|
function W() {
|
12869
12869
|
_classCallCheck(this, W);
|
@@ -12873,7 +12873,7 @@ var W = /*#__PURE__*/function () {
|
|
12873
12873
|
value:
|
12874
12874
|
// prettier-ignore
|
12875
12875
|
function addToDropup(e, t, i, s) {
|
12876
|
-
var r = new
|
12876
|
+
var r = new Pi(i, s);
|
12877
12877
|
Ws.forEach(function (a) {
|
12878
12878
|
var l = t["dropup-menu"].findIndex(function (d) {
|
12879
12879
|
return d.buttonType === a;
|
@@ -12884,7 +12884,7 @@ var W = /*#__PURE__*/function () {
|
|
12884
12884
|
var a = _ref38.button;
|
12885
12885
|
return r.addItem(a);
|
12886
12886
|
});
|
12887
|
-
var o =
|
12887
|
+
var o = Pi.getPosition(t, s);
|
12888
12888
|
vt.addButton(e, r.buttonContainer, o), t[o].push({});
|
12889
12889
|
}
|
12890
12890
|
}, {
|
@@ -12925,7 +12925,7 @@ var W = /*#__PURE__*/function () {
|
|
12925
12925
|
var o;
|
12926
12926
|
var r = (o = e[s]) == null ? void 0 : o.button.position;
|
12927
12927
|
r && W.setPosition(e, s, t[r]);
|
12928
|
-
}), t["inside-right"].length === 0 && e.submit && W.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? W.setPosition(e, "submit", t["outside-right"]) : e.microphone ? W.setPosition(e, "microphone", t["outside-right"]) : e.camera ? W.setPosition(e, "camera", t["outside-right"]) : e["".concat(
|
12928
|
+
}), t["inside-right"].length === 0 && e.submit && W.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? W.setPosition(e, "submit", t["outside-right"]) : e.microphone ? W.setPosition(e, "microphone", t["outside-right"]) : e.camera ? W.setPosition(e, "camera", t["outside-right"]) : e["".concat(Ke.INDICATOR_PREFIX, "1")] && W.setPosition(e, "".concat(Ke.INDICATOR_PREFIX, "1"), t["outside-right"])), e.submit && W.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && W.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
|
12929
12929
|
var i = Object.keys(e);
|
12930
12930
|
return i.length > 1 || t["dropup-menu"].length > 0 ? (Ws.forEach(function (s) {
|
12931
12931
|
e[s] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[s]), {}, {
|
@@ -12933,7 +12933,7 @@ var W = /*#__PURE__*/function () {
|
|
12933
12933
|
}));
|
12934
12934
|
}), i.forEach(function (s) {
|
12935
12935
|
var r = s;
|
12936
|
-
r.startsWith(
|
12936
|
+
r.startsWith(Ke.INDICATOR_PREFIX) && e[r] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[r]), {}, {
|
12937
12937
|
customType: r
|
12938
12938
|
}));
|
12939
12939
|
})) : i.length === 1 && W.setPosition(e, i[0], t["outside-right"].length === 0 ? t["outside-right"] : t["outside-left"]), t;
|
@@ -12973,18 +12973,18 @@ var na = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
|
|
12973
12973
|
dropupText: "File"
|
12974
12974
|
}
|
12975
12975
|
};
|
12976
|
-
var
|
12977
|
-
function
|
12976
|
+
var ni = /*#__PURE__*/function (_ot4) {
|
12977
|
+
function ni(e) {
|
12978
12978
|
var _this69;
|
12979
|
-
_classCallCheck(this,
|
12980
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this69 = _callSuper(this,
|
12979
|
+
_classCallCheck(this, ni);
|
12980
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this69 = _callSuper(this, ni, [ni.createMicrophoneElement(), e == null ? void 0 : e.position, e]), _this69.isActive = !1, _this69._innerElements = _this69.createInnerElements(_this69._customStyles), _this69.changeToDefault();
|
12981
12981
|
return _this69;
|
12982
12982
|
}
|
12983
|
-
_inherits(
|
12984
|
-
return _createClass(
|
12983
|
+
_inherits(ni, _ot4);
|
12984
|
+
return _createClass(ni, [{
|
12985
12985
|
key: "createInnerElements",
|
12986
12986
|
value: function createInnerElements(e) {
|
12987
|
-
var t =
|
12987
|
+
var t = ni.createSVGIconElement();
|
12988
12988
|
return {
|
12989
12989
|
"default": this.createInnerElement(t, "default", e),
|
12990
12990
|
active: this.createInnerElement(t, "active", e),
|
@@ -13051,7 +13051,7 @@ var si = /*#__PURE__*/function (_ot4) {
|
|
13051
13051
|
function ca(n) {
|
13052
13052
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n["default"] : n;
|
13053
13053
|
}
|
13054
|
-
var
|
13054
|
+
var pi = {},
|
13055
13055
|
yt = {},
|
13056
13056
|
Et = {},
|
13057
13057
|
St = {},
|
@@ -14269,8 +14269,8 @@ function xa() {
|
|
14269
14269
|
}
|
14270
14270
|
var vn;
|
14271
14271
|
function wa() {
|
14272
|
-
if (vn) return
|
14273
|
-
vn = 1, Object.defineProperty(
|
14272
|
+
if (vn) return pi;
|
14273
|
+
vn = 1, Object.defineProperty(pi, "__esModule", {
|
14274
14274
|
value: !0
|
14275
14275
|
});
|
14276
14276
|
var n = ma(),
|
@@ -14317,10 +14317,10 @@ function wa() {
|
|
14317
14317
|
}
|
14318
14318
|
}]);
|
14319
14319
|
}();
|
14320
|
-
return
|
14320
|
+
return pi["default"] = s, pi;
|
14321
14321
|
}
|
14322
14322
|
var Aa = wa();
|
14323
|
-
var
|
14323
|
+
var mi = /* @__PURE__ */ca(Aa);
|
14324
14324
|
var Ca = /*#__PURE__*/function () {
|
14325
14325
|
function Ca(e, t) {
|
14326
14326
|
_classCallCheck(this, Ca);
|
@@ -14332,7 +14332,7 @@ var Ca = /*#__PURE__*/function () {
|
|
14332
14332
|
var _this74 = this;
|
14333
14333
|
this._silenceTimeout = setTimeout(function () {
|
14334
14334
|
var i;
|
14335
|
-
(i = e.submit) == null || i.call(e),
|
14335
|
+
(i = e.submit) == null || i.call(e), mi.stop(), _this74.stop || setTimeout(t, ri.MICROPHONE_RESET_TIMEOUT_MS);
|
14336
14336
|
}, this.silenceMS);
|
14337
14337
|
}
|
14338
14338
|
}, {
|
@@ -14352,16 +14352,16 @@ var Ca = /*#__PURE__*/function () {
|
|
14352
14352
|
}
|
14353
14353
|
}]);
|
14354
14354
|
}();
|
14355
|
-
var
|
14356
|
-
function
|
14355
|
+
var Yt = /*#__PURE__*/function (_ni) {
|
14356
|
+
function Yt(e, t, i) {
|
14357
14357
|
var _this75;
|
14358
|
-
_classCallCheck(this,
|
14358
|
+
_classCallCheck(this, Yt);
|
14359
14359
|
var s = _typeof(e.speechToText) == "object" ? e.speechToText : {};
|
14360
|
-
_this75 = _callSuper(this,
|
14360
|
+
_this75 = _callSuper(this, Yt, [s == null ? void 0 : s.button]);
|
14361
14361
|
var _this75$processConfig = _this75.processConfiguration(t, e.speechToText),
|
14362
14362
|
r = _this75$processConfig.serviceName,
|
14363
14363
|
o = _this75$processConfig.processedConfig;
|
14364
|
-
if (_this75._addErrorMessage = i, r === "webspeech" && !
|
14364
|
+
if (_this75._addErrorMessage = i, r === "webspeech" && !mi.isWebSpeechSupported()) _this75.changeToUnsupported();else {
|
14365
14365
|
var a = !e.textInput || !e.textInput.disabled;
|
14366
14366
|
_this75.elementRef.onclick = _this75.buttonClick.bind(_this75, t, a, r, o);
|
14367
14367
|
}
|
@@ -14371,8 +14371,8 @@ var Xt = /*#__PURE__*/function (_si) {
|
|
14371
14371
|
return _this75;
|
14372
14372
|
}
|
14373
14373
|
// prettier-ignore
|
14374
|
-
_inherits(
|
14375
|
-
return _createClass(
|
14374
|
+
_inherits(Yt, _ni);
|
14375
|
+
return _createClass(Yt, [{
|
14376
14376
|
key: "processConfiguration",
|
14377
14377
|
value: function processConfiguration(e, t) {
|
14378
14378
|
var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands, _i$events;
|
@@ -14392,12 +14392,12 @@ var Xt = /*#__PURE__*/function (_si) {
|
|
14392
14392
|
return d.toLowerCase().includes(a) ? (setTimeout(function () {
|
14393
14393
|
var u;
|
14394
14394
|
return (u = e.submit) == null ? void 0 : u.call(e);
|
14395
|
-
}),
|
14395
|
+
}), mi.endCommandMode(), {
|
14396
14396
|
restart: !0,
|
14397
14397
|
removeNewText: !0
|
14398
14398
|
}) : null;
|
14399
14399
|
}), i.submitAfterSilence && (this._silenceSubmit = new Ca(i.submitAfterSilence, i.stopAfterSubmit)), {
|
14400
|
-
serviceName:
|
14400
|
+
serviceName: Yt.getServiceName(i),
|
14401
14401
|
processedConfig: o
|
14402
14402
|
};
|
14403
14403
|
}
|
@@ -14406,7 +14406,7 @@ var Xt = /*#__PURE__*/function (_si) {
|
|
14406
14406
|
value: function buttonClick(e, t, i, s) {
|
14407
14407
|
var _this76 = this;
|
14408
14408
|
var r = s == null ? void 0 : s.events;
|
14409
|
-
e.removePlaceholderStyle(),
|
14409
|
+
e.removePlaceholderStyle(), mi.toggle(i, _objectSpread({
|
14410
14410
|
insertInCursorLocation: !1,
|
14411
14411
|
element: t ? e.inputElementRef : void 0,
|
14412
14412
|
onError: function onError() {
|
@@ -14460,12 +14460,12 @@ var Xt = /*#__PURE__*/function (_si) {
|
|
14460
14460
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
14461
14461
|
e.click(), t || setTimeout(function () {
|
14462
14462
|
return e.click();
|
14463
|
-
},
|
14463
|
+
}, Yt.MICROPHONE_RESET_TIMEOUT_MS);
|
14464
14464
|
}
|
14465
14465
|
}]);
|
14466
|
-
}(
|
14467
|
-
|
14468
|
-
var
|
14466
|
+
}(ni);
|
14467
|
+
Yt.MICROPHONE_RESET_TIMEOUT_MS = 300;
|
14468
|
+
var ri = Yt;
|
14469
14469
|
var Oe = /*#__PURE__*/function () {
|
14470
14470
|
// prettier-ignore
|
14471
14471
|
function Oe(e, t, i, s) {
|
@@ -14488,7 +14488,7 @@ var Oe = /*#__PURE__*/function () {
|
|
14488
14488
|
var r = Oe.createImageAttachment(t);
|
14489
14489
|
this.addFileAttachment(e, "image", r, i);
|
14490
14490
|
} else if (s === "audio") {
|
14491
|
-
var _r2 =
|
14491
|
+
var _r2 = oi.createAudioAttachment(t);
|
14492
14492
|
this.addFileAttachment(e, "audio", _r2, i);
|
14493
14493
|
} else {
|
14494
14494
|
var _r3 = Oe.createAnyFileAttachment(e.name);
|
@@ -14529,7 +14529,7 @@ var Oe = /*#__PURE__*/function () {
|
|
14529
14529
|
return r === e;
|
14530
14530
|
}),
|
14531
14531
|
i = this._attachments[t].attachmentContainerElement;
|
14532
|
-
this._attachments.splice(t, 1),
|
14532
|
+
this._attachments.splice(t, 1), oi.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (s = this._validationHandler) == null || s.call(this);
|
14533
14533
|
}
|
14534
14534
|
}, {
|
14535
14535
|
key: "getFiles",
|
@@ -14585,7 +14585,7 @@ var Oe = /*#__PURE__*/function () {
|
|
14585
14585
|
key: "createAnyFileAttachment",
|
14586
14586
|
value: function createAnyFileAttachment(e) {
|
14587
14587
|
var t = document.createElement("div");
|
14588
|
-
t.classList.add("border-bound-attachment"),
|
14588
|
+
t.classList.add("border-bound-attachment"), Ne.IS_SAFARI && t.classList.add("border-bound-attachment-safari");
|
14589
14589
|
var i = document.createElement("div");
|
14590
14590
|
i.classList.add("any-file-attachment-text");
|
14591
14591
|
var s = document.createElement("div");
|
@@ -14676,7 +14676,7 @@ var Le = /*#__PURE__*/function (_Oe) {
|
|
14676
14676
|
key: "createAudioContainer",
|
14677
14677
|
value: function createAudioContainer() {
|
14678
14678
|
var e = document.createElement("div");
|
14679
|
-
return e.classList.add("border-bound-attachment", "audio-attachment-icon-container"),
|
14679
|
+
return e.classList.add("border-bound-attachment", "audio-attachment-icon-container"), Ne.IS_SAFARI && e.classList.add("border-bound-attachment-safari"), e;
|
14680
14680
|
}
|
14681
14681
|
}, {
|
14682
14682
|
key: "addAudioElements",
|
@@ -14712,7 +14712,7 @@ var Le = /*#__PURE__*/function (_Oe) {
|
|
14712
14712
|
}]);
|
14713
14713
|
}(Oe);
|
14714
14714
|
Le.TIMER_LIMIT_S = 5999;
|
14715
|
-
var
|
14715
|
+
var oi = Le;
|
14716
14716
|
var Ta = /*#__PURE__*/function () {
|
14717
14717
|
function Ta() {
|
14718
14718
|
_classCallCheck(this, Ta);
|
@@ -14722,19 +14722,19 @@ var Ta = /*#__PURE__*/function () {
|
|
14722
14722
|
value:
|
14723
14723
|
// prettier-ignore
|
14724
14724
|
function create(e, t, i, s, r) {
|
14725
|
-
return r === "audio" ? new
|
14725
|
+
return r === "audio" ? new oi(e, t, i, s) : new Oe(e, t, i, s);
|
14726
14726
|
}
|
14727
14727
|
}]);
|
14728
14728
|
}();
|
14729
|
-
var
|
14730
|
-
function
|
14731
|
-
_classCallCheck(this,
|
14729
|
+
var di = /*#__PURE__*/function () {
|
14730
|
+
function di(e, t, i) {
|
14731
|
+
_classCallCheck(this, di);
|
14732
14732
|
this._fileAttachmentsTypes = [], this.elementRef = this.createAttachmentContainer();
|
14733
14733
|
var s = _typeof(i) == "object" && !!i.displayFileAttachmentContainer;
|
14734
14734
|
this.toggleContainerDisplay(s), e.appendChild(this.elementRef), t && Object.assign(this.elementRef.style, t);
|
14735
14735
|
}
|
14736
14736
|
// prettier-ignore
|
14737
|
-
return _createClass(
|
14737
|
+
return _createClass(di, [{
|
14738
14738
|
key: "addType",
|
14739
14739
|
value: function addType(e, t, i) {
|
14740
14740
|
var s = Ta.create(e, t, this.toggleContainerDisplay.bind(this), this.elementRef, i);
|
@@ -14798,7 +14798,7 @@ var ci = /*#__PURE__*/function () {
|
|
14798
14798
|
}, {
|
14799
14799
|
key: "addFilesToAnyType",
|
14800
14800
|
value: function addFilesToAnyType(e) {
|
14801
|
-
|
14801
|
+
di.addFilesToType(e, this._fileAttachmentsTypes);
|
14802
14802
|
}
|
14803
14803
|
}, {
|
14804
14804
|
key: "removeAllFiles",
|
@@ -14969,7 +14969,7 @@ var Gt = /*#__PURE__*/function (_ot5) {
|
|
14969
14969
|
}, {
|
14970
14970
|
key: "import",
|
14971
14971
|
value: function _import(e) {
|
14972
|
-
|
14972
|
+
di.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
|
14973
14973
|
}
|
14974
14974
|
}, {
|
14975
14975
|
key: "addClickEvent",
|
@@ -15173,7 +15173,7 @@ var Fn = /*#__PURE__*/function () {
|
|
15173
15173
|
}
|
15174
15174
|
}]);
|
15175
15175
|
}();
|
15176
|
-
var Ra = /*#__PURE__*/function (
|
15176
|
+
var Ra = /*#__PURE__*/function (_ni2) {
|
15177
15177
|
function Ra(e, t) {
|
15178
15178
|
var _this84;
|
15179
15179
|
_classCallCheck(this, Ra);
|
@@ -15181,7 +15181,7 @@ var Ra = /*#__PURE__*/function (_si2) {
|
|
15181
15181
|
_this84 = _callSuper(this, Ra, [t.button]), _this84._waitingForBrowserApproval = !1, _this84._audioType = e, _this84._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this84._maxDurationSeconds = (s = t.files) == null ? void 0 : s.maxDurationSeconds, _this84.elementRef.onclick = _this84.buttonClick.bind(_assertThisInitialized(_this84));
|
15182
15182
|
return _this84;
|
15183
15183
|
}
|
15184
|
-
_inherits(Ra,
|
15184
|
+
_inherits(Ra, _ni2);
|
15185
15185
|
return _createClass(Ra, [{
|
15186
15186
|
key: "buttonClick",
|
15187
15187
|
value: function buttonClick() {
|
@@ -15233,7 +15233,7 @@ var Ra = /*#__PURE__*/function (_si2) {
|
|
15233
15233
|
};
|
15234
15234
|
}
|
15235
15235
|
}]);
|
15236
|
-
}(
|
15236
|
+
}(ni);
|
15237
15237
|
var et = /*#__PURE__*/function () {
|
15238
15238
|
function et() {
|
15239
15239
|
_classCallCheck(this, et);
|
@@ -15451,7 +15451,7 @@ var I = /*#__PURE__*/function (_ot6) {
|
|
15451
15451
|
break;
|
15452
15452
|
}
|
15453
15453
|
_context136.next = 13;
|
15454
|
-
return
|
15454
|
+
return Ei.fadeAnimation(this._messages.elementRef, this._messages.focusMode.fade);
|
15455
15455
|
case 13:
|
15456
15456
|
_context136.next = 15;
|
15457
15457
|
return this.addNewMessage(e);
|
@@ -15537,7 +15537,7 @@ var I = /*#__PURE__*/function (_ot6) {
|
|
15537
15537
|
var _this91 = this;
|
15538
15538
|
this.elementRef.classList.contains(I.SUBMIT_CLASS) || (this.elementRef.classList.remove(I.LOADING_CLASS, I.DISABLED_CLASS), P.removeAriaAttributes(this.elementRef), this.elementRef.classList.add(I.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), et.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
|
15539
15539
|
var e;
|
15540
|
-
_this91.submitFromInput(), (e = _this91._microphoneButton) != null && e.isActive &&
|
15540
|
+
_this91.submitFromInput(), (e = _this91._microphoneButton) != null && e.isActive && ri.toggleSpeechAfterSubmit(_this91._microphoneButton.elementRef, !!_this91._stopSTTAfterSubmit);
|
15541
15541
|
});
|
15542
15542
|
}
|
15543
15543
|
// called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
|
@@ -15620,7 +15620,7 @@ var Ts = /*#__PURE__*/function (_Qe) {
|
|
15620
15620
|
_this93.capture();
|
15621
15621
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
15622
15622
|
var r = _this93.getFile();
|
15623
|
-
r &&
|
15623
|
+
r && di.addFilesToType([r], [s]), _this93.stop(), _this93.close();
|
15624
15624
|
};
|
15625
15625
|
}
|
15626
15626
|
}, {
|
@@ -15699,26 +15699,26 @@ var Ts = /*#__PURE__*/function (_Qe) {
|
|
15699
15699
|
}]);
|
15700
15700
|
}(Qe);
|
15701
15701
|
var Oa = "<?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 <path d=\"M29 7h-4.599l-2.401-4h-12l-2.4 4h-4.6c-1 0-3 1-3 2.969v16.031c0 1.657 1.5 3 2.792 3h26.271c1.313 0 2.938-1.406 2.938-2.968v-16.032c0-1-1-3-3-3zM30 26.032c0 0.395-0.639 0.947-0.937 0.969h-26.265c-0.232-0.019-0.797-0.47-0.797-1v-16.031c0-0.634 0.851-0.953 1-0.969h5.732l2.4-4h9.802l1.785 3.030 0.55 0.97h5.731c0.705 0 0.99 0.921 1 1v16.032zM16 10c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zM16 22c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z\"></path>\n</svg>";
|
15702
|
-
var
|
15703
|
-
function
|
15702
|
+
var Ni = /*#__PURE__*/function (_ot7) {
|
15703
|
+
function Ni(e, t, i) {
|
15704
15704
|
var _this96;
|
15705
|
-
_classCallCheck(this,
|
15705
|
+
_classCallCheck(this, Ni);
|
15706
15706
|
var a, l, c, d;
|
15707
15707
|
var s = (a = i == null ? void 0 : i.button) == null ? void 0 : a.position,
|
15708
15708
|
r = ((d = (c = (l = i == null ? void 0 : i.button) == null ? void 0 : l.styles) == null ? void 0 : c.text) == null ? void 0 : d.content) || "Photo";
|
15709
|
-
_this96 = _callSuper(this,
|
15709
|
+
_this96 = _callSuper(this, Ni, [Ni.createButtonElement(), s, (i == null ? void 0 : i.button) || {}, r]);
|
15710
15710
|
var o = _this96.createInnerElements(_this96._customStyles, s === "dropup-menu");
|
15711
15711
|
i && _this96.addClickEvent(e, t, i.modalContainerStyle, i.files), _this96.elementRef.classList.add("upload-file-button"), _this96.elementRef.appendChild(o.styles), _this96.reapplyStateStyle("styles");
|
15712
15712
|
return _this96;
|
15713
15713
|
}
|
15714
15714
|
// prettier-ignore
|
15715
|
-
_inherits(
|
15716
|
-
return _createClass(
|
15715
|
+
_inherits(Ni, _ot7);
|
15716
|
+
return _createClass(Ni, [{
|
15717
15717
|
key: "createInnerElements",
|
15718
15718
|
value: function createInnerElements(e) {
|
15719
15719
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
15720
15720
|
return {
|
15721
|
-
styles: G.createInnerElement(this.elementRef,
|
15721
|
+
styles: G.createInnerElement(this.elementRef, Ni.createSVGIconElement(), "styles", e, t)
|
15722
15722
|
};
|
15723
15723
|
}
|
15724
15724
|
}, {
|
@@ -15750,16 +15750,16 @@ var Vt = /*#__PURE__*/function () {
|
|
15750
15750
|
this.elementRef = Vt.createPanelElement(e.inputAreaStyle);
|
15751
15751
|
var r = {},
|
15752
15752
|
o = this.createFileUploadComponents(e, i, s, r),
|
15753
|
-
a = new
|
15753
|
+
a = new vi(e, i, o);
|
15754
15754
|
e.speechToText && !r.microphone && (r.microphone = {
|
15755
|
-
button: new
|
15755
|
+
button: new ri(e, a, t.addNewErrorMessage.bind(t))
|
15756
15756
|
});
|
15757
15757
|
var l = new ms(e, a, t, i, o, r);
|
15758
15758
|
a.submit = l.submitFromInput.bind(l), $e.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
|
15759
15759
|
button: l
|
15760
15760
|
}, (c = e.customButtons) == null || c.forEach(function (d, u) {
|
15761
|
-
r["".concat(
|
15762
|
-
button: new
|
15761
|
+
r["".concat(Ke.INDICATOR_PREFIX).concat(u + 1)] = {
|
15762
|
+
button: new Ke(d, u)
|
15763
15763
|
};
|
15764
15764
|
}), Vt.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
|
15765
15765
|
}
|
@@ -15769,11 +15769,11 @@ var Vt = /*#__PURE__*/function () {
|
|
15769
15769
|
// prettier-ignore
|
15770
15770
|
function createFileUploadComponents(e, t, i, s) {
|
15771
15771
|
var o, a, l, c;
|
15772
|
-
var r = new
|
15772
|
+
var r = new di(this.elementRef, e.attachmentContainerStyle, t.demo);
|
15773
15773
|
if (Vt.createUploadButtons(e, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
|
15774
15774
|
var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
|
15775
15775
|
s.camera = {
|
15776
|
-
button: new
|
15776
|
+
button: new Ni(i, d, t.camera)
|
15777
15777
|
};
|
15778
15778
|
}
|
15779
15779
|
if ((l = t.recordAudio) != null && l.files) {
|
@@ -15861,7 +15861,7 @@ var S = /*#__PURE__*/function (_is) {
|
|
15861
15861
|
}, _this97.addMessage = function () {
|
15862
15862
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
15863
15863
|
}, _this97.updateMessage = function () {}, _this97.clearMessages = function () {}, _this97.focusInput = function () {
|
15864
|
-
return
|
15864
|
+
return ai.focusFromParentElement(_this97._elementRef);
|
15865
15865
|
}, _this97.refreshMessages = function () {}, _this97.scrollToBottom = function () {}, _this97.disableSubmitButton = function () {}, _this97.setPlaceholderText = function () {}, _this97._hasBeenRendered = !1, _this97._auxiliaryStyleApplied = !1, _this97._elementRef = document.createElement("div"), _this97._elementRef.id = "container", _this97.attachShadow({
|
15866
15866
|
mode: "open"
|
15867
15867
|
}).appendChild(_this97._elementRef), qt.apply(Pa, _this97.shadowRoot), setTimeout(function () {
|
@@ -15880,12 +15880,12 @@ var S = /*#__PURE__*/function (_is) {
|
|
15880
15880
|
key: "onRender",
|
15881
15881
|
value: function onRender() {
|
15882
15882
|
var _this$_childElement;
|
15883
|
-
|
15883
|
+
bi.attemptAppendStyleSheetToHead(this.style), te.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = ea.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (qt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), qt.applyDefaultStyleToComponent(this.style, this.chatStyle), te.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? gi.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof K) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Rs.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof K && $.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered || yi.onRender(this), this._hasBeenRendered = !0;
|
15884
15884
|
}
|
15885
15885
|
}, {
|
15886
15886
|
key: "disconnectedCallback",
|
15887
15887
|
value: function disconnectedCallback() {
|
15888
|
-
|
15888
|
+
ii.chat = void 0;
|
15889
15889
|
}
|
15890
15890
|
}]);
|
15891
15891
|
}(is);
|