deep-chat-dev 9.0.90 → 9.0.91
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 +11853 -11812
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +3 -1
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +516 -509
- package/dist/types/demo.d.ts +2 -1
- package/dist/types/demo.d.ts.map +1 -1
- package/dist/types/error.d.ts +11 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/messages.d.ts +0 -9
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/utils/events/fireEvents.d.ts +1 -0
- package/dist/utils/events/fireEvents.d.ts.map +1 -1
- package/dist/views/chat/messages/messages.d.ts +2 -1
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/webModel/webModel.d.ts +1 -1
- package/dist/webModel/webModel.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -182,7 +182,7 @@ On.DEFAULT_COMPONENT_STYLE = {
|
|
182
182
|
// this is also causing the chat to squeeze when there is no space
|
183
183
|
overflow: "hidden"
|
184
184
|
};
|
185
|
-
var
|
185
|
+
var vi = On;
|
186
186
|
var R = /* @__PURE__ */function (s) {
|
187
187
|
return s.ESCAPE = "Escape", s.ENTER = "Enter", s.TAB = "Tab", s.ARROW_UP = "ArrowUp", s.ARROW_DOWN = "ArrowDown", s.ARROW_RIGHT = "ArrowRight", s.ARROW_LEFT = "ArrowLeft", s.BACKSPACE = "Backspace", s.DELETE = "Delete", s.META = "Meta", s.CONTROL = "Control", s;
|
188
188
|
}(R || {});
|
@@ -218,7 +218,7 @@ var Nn = /*#__PURE__*/function () {
|
|
218
218
|
value: function onInput(e, t, i) {
|
219
219
|
var n = i.target,
|
220
220
|
r = n.textContent || "";
|
221
|
-
e !== void 0 && r.length > e && (n.textContent = r.substring(0, e),
|
221
|
+
e !== void 0 && r.length > e && (n.textContent = r.substring(0, e), $t.focusEndOfInput(n)), t == null || t();
|
222
222
|
}
|
223
223
|
}]);
|
224
224
|
return tt;
|
@@ -337,12 +337,12 @@ var Pn = /*#__PURE__*/function () {
|
|
337
337
|
return qe;
|
338
338
|
}();
|
339
339
|
Pn.TEXT_INPUT_ID = "text-input";
|
340
|
-
var
|
341
|
-
var
|
342
|
-
function
|
343
|
-
_classCallCheck(this,
|
340
|
+
var Fi = Pn;
|
341
|
+
var $t = /*#__PURE__*/function () {
|
342
|
+
function $t() {
|
343
|
+
_classCallCheck(this, $t);
|
344
344
|
}
|
345
|
-
_createClass(
|
345
|
+
_createClass($t, null, [{
|
346
346
|
key: "focusEndOfInput",
|
347
347
|
value: function focusEndOfInput(e) {
|
348
348
|
var t = document.createRange();
|
@@ -353,11 +353,11 @@ var Yt = /*#__PURE__*/function () {
|
|
353
353
|
}, {
|
354
354
|
key: "focusFromParentElement",
|
355
355
|
value: function focusFromParentElement(e) {
|
356
|
-
var t = e.querySelector("#".concat(
|
357
|
-
t &&
|
356
|
+
var t = e.querySelector("#".concat(Fi.TEXT_INPUT_ID));
|
357
|
+
t && $t.focusEndOfInput(t);
|
358
358
|
}
|
359
359
|
}]);
|
360
|
-
return
|
360
|
+
return $t;
|
361
361
|
}();
|
362
362
|
function tn(s) {
|
363
363
|
return s.charAt(0).toUpperCase() + s.slice(1);
|
@@ -492,7 +492,7 @@ var Ae = /*#__PURE__*/function () {
|
|
492
492
|
}]);
|
493
493
|
return Ae;
|
494
494
|
}();
|
495
|
-
var
|
495
|
+
var Zt = /*#__PURE__*/function () {
|
496
496
|
function ye() {
|
497
497
|
_classCallCheck(this, ye);
|
498
498
|
}
|
@@ -573,10 +573,10 @@ var $t = /*#__PURE__*/function () {
|
|
573
573
|
}]);
|
574
574
|
return ye;
|
575
575
|
}();
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
var
|
576
|
+
Zt.AI_ROLE = "ai";
|
577
|
+
Zt.USER_ROLE = "user";
|
578
|
+
Zt.EMPTY_MESSAGE_CLASS = "empty-message";
|
579
|
+
var x = Zt;
|
580
580
|
var Me = /*#__PURE__*/function () {
|
581
581
|
function Me() {
|
582
582
|
_classCallCheck(this, Me);
|
@@ -611,7 +611,7 @@ var Me = /*#__PURE__*/function () {
|
|
611
611
|
}();
|
612
612
|
var gs = "deep-chat-temporary-message",
|
613
613
|
bs = "deep-chat-suggestion-button",
|
614
|
-
|
614
|
+
ki = {
|
615
615
|
"deep-chat-button": {
|
616
616
|
styles: {
|
617
617
|
"default": {
|
@@ -632,7 +632,7 @@ var gs = "deep-chat-temporary-message",
|
|
632
632
|
}
|
633
633
|
}
|
634
634
|
},
|
635
|
-
nn = Object.keys(
|
635
|
+
nn = Object.keys(ki);
|
636
636
|
var ge = /*#__PURE__*/function () {
|
637
637
|
function ge() {
|
638
638
|
_classCallCheck(this, ge);
|
@@ -665,7 +665,7 @@ var ge = /*#__PURE__*/function () {
|
|
665
665
|
}, {
|
666
666
|
key: "applyEvents",
|
667
667
|
value: function applyEvents(e, t) {
|
668
|
-
var i =
|
668
|
+
var i = ki[t].events;
|
669
669
|
Object.keys(i || []).forEach(function (n) {
|
670
670
|
e.addEventListener(n, i == null ? void 0 : i[n]);
|
671
671
|
});
|
@@ -678,7 +678,7 @@ var ge = /*#__PURE__*/function () {
|
|
678
678
|
var c = (d = e[l]) == null ? void 0 : d.styles;
|
679
679
|
return c && e[l].styles && a.push(c), a;
|
680
680
|
}, []),
|
681
|
-
r =
|
681
|
+
r = ki[i].styles;
|
682
682
|
if (r) {
|
683
683
|
var a = JSON.parse(JSON.stringify(r));
|
684
684
|
a["default"] && M.overwriteDefaultWithAlreadyApplied(a, t), n.unshift(a);
|
@@ -766,7 +766,7 @@ var Ye = /*#__PURE__*/function () {
|
|
766
766
|
key: "overwrite",
|
767
767
|
value: function overwrite(e, t, i, n) {
|
768
768
|
var r = e.messages,
|
769
|
-
o =
|
769
|
+
o = x.overwriteMessage(r, n, t, i, "html", "html-message");
|
770
770
|
return o && (o.bubbleElement.innerHTML = t, se.apply(e, o.outerContainer), Ae.flagHTMLUpdateClass(o.bubbleElement)), o;
|
771
771
|
}
|
772
772
|
}, {
|
@@ -779,7 +779,7 @@ var Ye = /*#__PURE__*/function () {
|
|
779
779
|
if (l) return l;
|
780
780
|
}
|
781
781
|
var o = Ye.createElements(e, t, i);
|
782
|
-
return
|
782
|
+
return x.fillEmptyMessageElement(o.bubbleElement, t), se.apply(e, o.outerContainer), Ae.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Ye.addElement(e, o.outerContainer), o;
|
783
783
|
}
|
784
784
|
}]);
|
785
785
|
return Ye;
|
@@ -810,7 +810,7 @@ function ht(s) {
|
|
810
810
|
function Un(s) {
|
811
811
|
return !(s >= 55296 && s <= 57343 || s >= 64976 && s <= 65007 || (s & 65535) === 65535 || (s & 65535) === 65534 || s >= 0 && s <= 8 || s === 11 || s >= 14 && s <= 31 || s >= 127 && s <= 159 || s > 1114111);
|
812
812
|
}
|
813
|
-
function
|
813
|
+
function Ii(s) {
|
814
814
|
if (s > 65535) {
|
815
815
|
s -= 65536;
|
816
816
|
var e = 55296 + (s >> 10),
|
@@ -824,7 +824,7 @@ var Es = /&([a-z#][a-z0-9]{1,31});/gi,
|
|
824
824
|
function ws(s, e) {
|
825
825
|
var t = 0,
|
826
826
|
i = zn(e);
|
827
|
-
return e !== i ? i : e.charCodeAt(0) === 35 && Ss.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), Un(t)) ?
|
827
|
+
return e !== i ? i : e.charCodeAt(0) === 35 && Ss.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), Un(t)) ? Ii(t) : s;
|
828
828
|
}
|
829
829
|
function ke(s) {
|
830
830
|
return s.indexOf("&") < 0 ? s : s.replace(Es, ws);
|
@@ -1062,14 +1062,14 @@ function Hn(s, e) {
|
|
1062
1062
|
var Le = f.getBreak = function (e, t) {
|
1063
1063
|
return t = Hn(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1064
1064
|
};
|
1065
|
-
function
|
1065
|
+
function zi() {
|
1066
1066
|
this.rules = qn({}, f), this.getBreak = f.getBreak;
|
1067
1067
|
}
|
1068
|
-
|
1068
|
+
zi.prototype.renderInline = function (s, e, t) {
|
1069
1069
|
for (var i = this.rules, n = s.length, r = 0, o = ""; n--;) o += i[s[r].type](s, r++, e, t, this);
|
1070
1070
|
return o;
|
1071
1071
|
};
|
1072
|
-
|
1072
|
+
zi.prototype.render = function (s, e, t) {
|
1073
1073
|
for (var i = this.rules, n = s.length, r = -1, o = ""; ++r < n;) s[r].type === "inline" ? o += this.renderInline(s[r].children, e, t) : o += i[s[r].type](s, r, e, t, this);
|
1074
1074
|
return o;
|
1075
1075
|
};
|
@@ -1216,7 +1216,7 @@ function Is(s) {
|
|
1216
1216
|
}
|
1217
1217
|
}
|
1218
1218
|
}
|
1219
|
-
function
|
1219
|
+
function Li(s) {
|
1220
1220
|
var e = ke(s);
|
1221
1221
|
try {
|
1222
1222
|
e = decodeURI(e);
|
@@ -1232,7 +1232,7 @@ function Gn(s, e) {
|
|
1232
1232
|
if (s.src.charCodeAt(e) === 60) {
|
1233
1233
|
for (e++; e < o;) {
|
1234
1234
|
if (t = s.src.charCodeAt(e), t === 10) return !1;
|
1235
|
-
if (t === 62) return n =
|
1235
|
+
if (t === 62) return n = Li(ht(s.src.slice(r + 1, e))), s.parser.validateLink(n) ? (s.pos = e + 1, s.linkContent = n, !0) : !1;
|
1236
1236
|
if (t === 92 && e + 1 < o) {
|
1237
1237
|
e += 2;
|
1238
1238
|
continue;
|
@@ -1271,13 +1271,13 @@ function Wn(s) {
|
|
1271
1271
|
return s.trim().replace(/\s+/g, " ").toUpperCase();
|
1272
1272
|
}
|
1273
1273
|
function Ls(s, e, t, i) {
|
1274
|
-
var n, r, o, a, l, c, d, u,
|
1274
|
+
var n, r, o, a, l, c, d, u, h;
|
1275
1275
|
if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new Re(s, e, t, i, []), r = pt(n, 0), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
|
1276
1276
|
for (a = n.posMax, o = r + 2; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1277
1277
|
if (!Gn(n, o)) return -1;
|
1278
1278
|
for (d = n.linkContent, o = n.pos, c = o, o = o + 1; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1279
1279
|
for (o < a && c !== o && Vn(n, o) ? (u = n.linkContent, o = n.pos) : (u = "", o = c); o < a && n.src.charCodeAt(o) === 32;) o++;
|
1280
|
-
return o < a && n.src.charCodeAt(o) !== 10 ? -1 : (
|
1280
|
+
return o < a && n.src.charCodeAt(o) !== 10 ? -1 : (h = Wn(s.slice(1, r)), _typeof(i.references[h]) > "u" && (i.references[h] = {
|
1281
1281
|
title: u,
|
1282
1282
|
href: d
|
1283
1283
|
}), o);
|
@@ -1314,9 +1314,9 @@ function Ns(s) {
|
|
1314
1314
|
c,
|
1315
1315
|
d = 0,
|
1316
1316
|
u = !1,
|
1317
|
-
|
1318
|
-
if (s.env.footnotes && (s.tokens = s.tokens.filter(function (
|
1319
|
-
return
|
1317
|
+
h = {};
|
1318
|
+
if (s.env.footnotes && (s.tokens = s.tokens.filter(function (p) {
|
1319
|
+
return p.type === "footnote_reference_open" ? (u = !0, l = [], c = p.label, !1) : p.type === "footnote_reference_close" ? (u = !1, h[":" + c] = l, !1) : (u && l.push(p), !u);
|
1320
1320
|
}), !!s.env.footnotes.list)) {
|
1321
1321
|
for (o = s.env.footnotes.list, s.tokens.push({
|
1322
1322
|
type: "footnote_block_open",
|
@@ -1339,7 +1339,7 @@ function Ns(s) {
|
|
1339
1339
|
type: "paragraph_close",
|
1340
1340
|
tight: !1,
|
1341
1341
|
level: --d
|
1342
|
-
})) : o[e].label && (a =
|
1342
|
+
})) : o[e].label && (a = h[":" + o[e].label]), s.tokens = s.tokens.concat(a), s.tokens[s.tokens.length - 1].type === "paragraph_close" ? r = s.tokens.pop() : r = null, n = o[e].count > 0 ? o[e].count : 1, i = 0; i < n; i++) s.tokens.push({
|
1343
1343
|
type: "footnote_anchor",
|
1344
1344
|
id: e,
|
1345
1345
|
subId: i,
|
@@ -1357,7 +1357,7 @@ function Ns(s) {
|
|
1357
1357
|
}
|
1358
1358
|
}
|
1359
1359
|
var sn = " \n()[]'\".,!?-";
|
1360
|
-
function
|
1360
|
+
function yi(s) {
|
1361
1361
|
return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1362
1362
|
}
|
1363
1363
|
function Ps(s) {
|
@@ -1372,15 +1372,15 @@ function Ps(s) {
|
|
1372
1372
|
c,
|
1373
1373
|
d,
|
1374
1374
|
u,
|
1375
|
-
|
1376
|
-
|
1375
|
+
h,
|
1376
|
+
p = s.tokens;
|
1377
1377
|
if (s.env.abbreviations) {
|
1378
|
-
for (s.env.abbrRegExp || (
|
1378
|
+
for (s.env.abbrRegExp || (h = "(^|[" + sn.split("").map(yi).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (g) {
|
1379
1379
|
return g.substr(1);
|
1380
1380
|
}).sort(function (g, m) {
|
1381
1381
|
return m.length - g.length;
|
1382
|
-
}).map(
|
1383
|
-
for (n =
|
1382
|
+
}).map(yi).join("|") + ")($|[" + sn.split("").map(yi).join("") + "])", s.env.abbrRegExp = new RegExp(h, "g")), d = s.env.abbrRegExp, t = 0, i = p.length; t < i; t++) if (p[t].type === "inline") {
|
1383
|
+
for (n = p[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1384
1384
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1385
1385
|
type: "text",
|
1386
1386
|
content: o.slice(l, u.index + u[1].length),
|
@@ -1401,7 +1401,7 @@ function Ps(s) {
|
|
1401
1401
|
type: "text",
|
1402
1402
|
content: o.slice(l),
|
1403
1403
|
level: c
|
1404
|
-
}),
|
1404
|
+
}), p[t].children = n = [].concat(n.slice(0, e), a, n.slice(e + 1)));
|
1405
1405
|
}
|
1406
1406
|
}
|
1407
1407
|
}
|
@@ -1436,20 +1436,20 @@ function Fe(s, e, t) {
|
|
1436
1436
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1437
1437
|
}
|
1438
1438
|
function Hs(s) {
|
1439
|
-
var e, t, i, n, r, o, a, l, c, d, u,
|
1439
|
+
var e, t, i, n, r, o, a, l, c, d, u, h, p, g, m, E, S;
|
1440
1440
|
if (s.options.typographer) {
|
1441
1441
|
for (S = [], m = s.tokens.length - 1; m >= 0; m--) if (s.tokens[m].type === "inline") {
|
1442
1442
|
for (E = s.tokens[m].children, S.length = 0, e = 0; e < E.length; e++) if (t = E[e], !(t.type !== "text" || qs.test(t.text))) {
|
1443
|
-
for (a = E[e].level,
|
1444
|
-
S.length =
|
1443
|
+
for (a = E[e].level, p = S.length - 1; p >= 0 && !(S[p].level <= a); p--);
|
1444
|
+
S.length = p + 1, i = t.content, r = 0, o = i.length;
|
1445
1445
|
e: for (; r < o && (rn.lastIndex = r, n = rn.exec(i), !!n);) {
|
1446
1446
|
if (l = !an(i, n.index - 1), r = n.index + 1, g = n[0] === "'", c = !an(i, r), !c && !l) {
|
1447
1447
|
g && (t.content = Fe(t.content, n.index, on));
|
1448
1448
|
continue;
|
1449
1449
|
}
|
1450
|
-
if (u = !c,
|
1451
|
-
for (
|
1452
|
-
d = S[
|
1450
|
+
if (u = !c, h = !l, h) {
|
1451
|
+
for (p = S.length - 1; p >= 0 && (d = S[p], !(S[p].level < a)); p--) if (d.single === g && S[p].level === a) {
|
1452
|
+
d = S[p], g ? (E[d.token].content = Fe(E[d.token].content, d.pos, s.options.quotes[2]), t.content = Fe(t.content, n.index, s.options.quotes[3])) : (E[d.token].content = Fe(E[d.token].content, d.pos, s.options.quotes[0]), t.content = Fe(t.content, n.index, s.options.quotes[1])), S.length = p;
|
1453
1453
|
continue e;
|
1454
1454
|
}
|
1455
1455
|
}
|
@@ -1458,16 +1458,16 @@ function Hs(s) {
|
|
1458
1458
|
pos: n.index,
|
1459
1459
|
single: g,
|
1460
1460
|
level: a
|
1461
|
-
}) :
|
1461
|
+
}) : h && g && (t.content = Fe(t.content, n.index, on));
|
1462
1462
|
}
|
1463
1463
|
}
|
1464
1464
|
}
|
1465
1465
|
}
|
1466
1466
|
}
|
1467
|
-
var
|
1467
|
+
var xi = [["block", As], ["abbr", Is], ["references", Rs], ["inline", Os], ["footnote_tail", Ns], ["abbr2", Ps], ["replacements", zs], ["smartquotes", Hs]];
|
1468
1468
|
function Kn() {
|
1469
1469
|
this.options = {}, this.ruler = new H();
|
1470
|
-
for (var s = 0; s <
|
1470
|
+
for (var s = 0; s < xi.length; s++) this.ruler.push(xi[s][0], xi[s][1]);
|
1471
1471
|
}
|
1472
1472
|
Kn.prototype.process = function (s) {
|
1473
1473
|
var e, t, i;
|
@@ -1570,8 +1570,8 @@ function Ws(s, e, t, i) {
|
|
1570
1570
|
c,
|
1571
1571
|
d,
|
1572
1572
|
u,
|
1573
|
-
p,
|
1574
1573
|
h,
|
1574
|
+
p,
|
1575
1575
|
g,
|
1576
1576
|
m = s.bMarks[e] + s.tShift[e],
|
1577
1577
|
E = s.eMarks[e];
|
@@ -1583,7 +1583,7 @@ function Ws(s, e, t, i) {
|
|
1583
1583
|
continue;
|
1584
1584
|
}
|
1585
1585
|
if (r) break;
|
1586
|
-
for (g = !1,
|
1586
|
+
for (g = !1, h = 0, p = u.length; h < p; h++) if (u[h](s, n, t, !0)) {
|
1587
1587
|
g = !0;
|
1588
1588
|
break;
|
1589
1589
|
}
|
@@ -1597,7 +1597,7 @@ function Ws(s, e, t, i) {
|
|
1597
1597
|
}), s.parser.tokenize(s, e, n), s.tokens.push({
|
1598
1598
|
type: "blockquote_close",
|
1599
1599
|
level: --s.level
|
1600
|
-
}), s.parentType = c, d[1] = s.line,
|
1600
|
+
}), s.parentType = c, d[1] = s.line, h = 0; h < o.length; h++) s.bMarks[h + e] = a[h], s.tShift[h + e] = o[h];
|
1601
1601
|
return s.blkIndent = l, !0;
|
1602
1602
|
}
|
1603
1603
|
function Ks(s, e, t, i) {
|
@@ -1650,8 +1650,8 @@ function Ys(s, e, t, i) {
|
|
1650
1650
|
c,
|
1651
1651
|
d,
|
1652
1652
|
u,
|
1653
|
-
p,
|
1654
1653
|
h,
|
1654
|
+
p,
|
1655
1655
|
g,
|
1656
1656
|
m,
|
1657
1657
|
E,
|
@@ -1664,7 +1664,7 @@ function Ys(s, e, t, i) {
|
|
1664
1664
|
he,
|
1665
1665
|
q,
|
1666
1666
|
en,
|
1667
|
-
|
1667
|
+
bi;
|
1668
1668
|
if ((u = cn(s, e)) >= 0) E = !0;else if ((u = ln(s, e)) >= 0) E = !1;else return !1;
|
1669
1669
|
if (s.level >= s.options.maxNesting) return !1;
|
1670
1670
|
if (m = s.src.charCodeAt(u - 1), i) return !0;
|
@@ -1677,7 +1677,7 @@ function Ys(s, e, t, i) {
|
|
1677
1677
|
type: "bullet_list_open",
|
1678
1678
|
lines: V = [e, 0],
|
1679
1679
|
level: s.level++
|
1680
|
-
}), n = e, A = !1, he = s.parser.ruler.getRules("list"); n < t && (S = s.skipSpaces(u),
|
1680
|
+
}), n = e, A = !1, he = s.parser.ruler.getRules("list"); n < t && (S = s.skipSpaces(u), h = s.eMarks[n], S >= h ? p = 1 : p = S - u, p > 4 && (p = 1), p < 1 && (p = 1), r = u - s.bMarks[n] + p, s.tokens.push({
|
1681
1681
|
type: "list_item_open",
|
1682
1682
|
lines: Q = [e, 0],
|
1683
1683
|
level: s.level++
|
@@ -1685,11 +1685,11 @@ function Ys(s, e, t, i) {
|
|
1685
1685
|
type: "list_item_close",
|
1686
1686
|
level: --s.level
|
1687
1687
|
}), n = e = s.line, Q[1] = n, S = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1688
|
-
for (
|
1689
|
-
|
1688
|
+
for (bi = !1, q = 0, en = he.length; q < en; q++) if (he[q](s, n, t, !0)) {
|
1689
|
+
bi = !0;
|
1690
1690
|
break;
|
1691
1691
|
}
|
1692
|
-
if (
|
1692
|
+
if (bi) break;
|
1693
1693
|
if (E) {
|
1694
1694
|
if (u = cn(s, n), u < 0) break;
|
1695
1695
|
} else if (u = ln(s, n), u < 0) break;
|
@@ -1804,27 +1804,27 @@ function ir(s, e, t, i) {
|
|
1804
1804
|
content: s.getLines(e, o, 0, !0)
|
1805
1805
|
}), !0;
|
1806
1806
|
}
|
1807
|
-
function
|
1807
|
+
function Ei(s, e) {
|
1808
1808
|
var t = s.bMarks[e] + s.blkIndent,
|
1809
1809
|
i = s.eMarks[e];
|
1810
1810
|
return s.src.substr(t, i - t);
|
1811
1811
|
}
|
1812
1812
|
function nr(s, e, t, i) {
|
1813
|
-
var n, r, o, a, l, c, d, u,
|
1814
|
-
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r =
|
1813
|
+
var n, r, o, a, l, c, d, u, h, p, g;
|
1814
|
+
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r = Ei(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
1815
1815
|
for (u = [], a = 0; a < c.length; a++) {
|
1816
|
-
if (
|
1816
|
+
if (h = c[a].trim(), !h) {
|
1817
1817
|
if (a === 0 || a === c.length - 1) continue;
|
1818
1818
|
return !1;
|
1819
1819
|
}
|
1820
|
-
if (!/^:?-+:?$/.test(
|
1821
|
-
|
1820
|
+
if (!/^:?-+:?$/.test(h)) return !1;
|
1821
|
+
h.charCodeAt(h.length - 1) === 58 ? u.push(h.charCodeAt(0) === 58 ? "center" : "right") : h.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1822
1822
|
}
|
1823
|
-
if (r =
|
1823
|
+
if (r = Ei(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1824
1824
|
if (i) return !0;
|
1825
1825
|
for (s.tokens.push({
|
1826
1826
|
type: "table_open",
|
1827
|
-
lines:
|
1827
|
+
lines: p = [e, 0],
|
1828
1828
|
level: s.level++
|
1829
1829
|
}), s.tokens.push({
|
1830
1830
|
type: "thead_open",
|
@@ -1859,7 +1859,7 @@ function nr(s, e, t, i) {
|
|
1859
1859
|
type: "tbody_open",
|
1860
1860
|
lines: g = [e + 2, 0],
|
1861
1861
|
level: s.level++
|
1862
|
-
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r =
|
1862
|
+
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r = Ei(s, l).trim(), r.indexOf("|") === -1)); l++) {
|
1863
1863
|
for (c = r.replace(/^\||\|$/g, "").split("|"), s.tokens.push({
|
1864
1864
|
type: "tr_open",
|
1865
1865
|
level: s.level++
|
@@ -1887,7 +1887,7 @@ function nr(s, e, t, i) {
|
|
1887
1887
|
}), s.tokens.push({
|
1888
1888
|
type: "table_close",
|
1889
1889
|
level: --s.level
|
1890
|
-
}),
|
1890
|
+
}), p[1] = g[1] = l, s.line = l, !0;
|
1891
1891
|
}
|
1892
1892
|
function Ct(s, e) {
|
1893
1893
|
var t,
|
@@ -1903,7 +1903,7 @@ function sr(s, e) {
|
|
1903
1903
|
for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
|
1904
1904
|
}
|
1905
1905
|
function rr(s, e, t, i) {
|
1906
|
-
var n, r, o, a, l, c, d, u,
|
1906
|
+
var n, r, o, a, l, c, d, u, h, p, g, m, E, S;
|
1907
1907
|
if (i) return s.ddIndent < 0 ? !1 : Ct(s, e) >= 0;
|
1908
1908
|
if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = Ct(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
|
1909
1909
|
c = s.tokens.length, s.tokens.push({
|
@@ -1930,7 +1930,7 @@ function rr(s, e, t, i) {
|
|
1930
1930
|
type: "dd_open",
|
1931
1931
|
lines: a = [d, 0],
|
1932
1932
|
level: s.level++
|
1933
|
-
}), m = s.tight,
|
1933
|
+
}), m = s.tight, h = s.ddIndent, u = s.blkIndent, g = s.tShift[r], p = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || E) && (S = !1), E = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = g, s.tight = m, s.parentType = p, s.blkIndent = u, s.ddIndent = h, s.tokens.push({
|
1934
1934
|
type: "dd_close",
|
1935
1935
|
level: --s.level
|
1936
1936
|
}), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
|
@@ -1979,13 +1979,13 @@ function or(s, e) {
|
|
1979
1979
|
})), !0;
|
1980
1980
|
}
|
1981
1981
|
var At = [["code", Gs], ["fences", Vs, ["paragraph", "blockquote", "list"]], ["blockquote", Ws, ["paragraph", "blockquote", "list"]], ["hr", Ks, ["paragraph", "blockquote", "list"]], ["list", Ys, ["paragraph", "blockquote"]], ["footnote", $s, ["paragraph"]], ["heading", Zs, ["paragraph", "blockquote"]], ["lheading", Xs], ["htmlblock", ir, ["paragraph", "blockquote"]], ["table", nr, ["paragraph"]], ["deflist", rr, ["paragraph"]], ["paragraph", or]];
|
1982
|
-
function
|
1982
|
+
function qi() {
|
1983
1983
|
this.ruler = new H();
|
1984
1984
|
for (var s = 0; s < At.length; s++) this.ruler.push(At[s][0], At[s][1], {
|
1985
1985
|
alt: (At[s][2] || []).slice()
|
1986
1986
|
});
|
1987
1987
|
}
|
1988
|
-
|
1988
|
+
qi.prototype.tokenize = function (s, e, t) {
|
1989
1989
|
for (var i = this.ruler.getRules(""), n = i.length, r = e, o = !1, a, l; r < t && (s.line = r = s.skipEmptyLines(r), !(r >= t || s.tShift[r] < s.blkIndent));) {
|
1990
1990
|
for (l = 0; l < n && (a = i[l](s, r, t, !1), !a); l++);
|
1991
1991
|
if (s.tight = !o, s.isEmpty(s.line - 1) && (o = !0), r = s.line, r < t && s.isEmpty(r)) {
|
@@ -1997,7 +1997,7 @@ zi.prototype.tokenize = function (s, e, t) {
|
|
1997
1997
|
var ar = /[\n\t]/g,
|
1998
1998
|
lr = /\r[\n\u0085]|[\u2424\u2028\u0085]/g,
|
1999
1999
|
cr = /\u00a0/g;
|
2000
|
-
|
2000
|
+
qi.prototype.parse = function (s, e, t, i) {
|
2001
2001
|
var n,
|
2002
2002
|
r = 0,
|
2003
2003
|
o = 0;
|
@@ -2065,10 +2065,10 @@ function hr(s, e) {
|
|
2065
2065
|
for (n++; n < i && s.src.charCodeAt(n) === 32;) n++;
|
2066
2066
|
return s.pos = n, !0;
|
2067
2067
|
}
|
2068
|
-
var
|
2069
|
-
for (var dn = 0; dn < 256; dn++)
|
2068
|
+
var Ui = [];
|
2069
|
+
for (var dn = 0; dn < 256; dn++) Ui.push(0);
|
2070
2070
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function (s) {
|
2071
|
-
|
2071
|
+
Ui[s.charCodeAt(0)] = 1;
|
2072
2072
|
});
|
2073
2073
|
function pr(s, e) {
|
2074
2074
|
var t,
|
@@ -2076,7 +2076,7 @@ function pr(s, e) {
|
|
2076
2076
|
n = s.posMax;
|
2077
2077
|
if (s.src.charCodeAt(i) !== 92) return !1;
|
2078
2078
|
if (i++, i < n) {
|
2079
|
-
if (t = s.src.charCodeAt(i), t < 256 &&
|
2079
|
+
if (t = s.src.charCodeAt(i), t < 256 && Ui[t] !== 0) return e || (s.pending += s.src[i]), s.pos += 2, !0;
|
2080
2080
|
if (t === 10) {
|
2081
2081
|
for (e || s.push({
|
2082
2082
|
type: "hardbreak",
|
@@ -2307,21 +2307,21 @@ function wr(s, e) {
|
|
2307
2307
|
c,
|
2308
2308
|
d = !1,
|
2309
2309
|
u = s.pos,
|
2310
|
-
|
2311
|
-
|
2312
|
-
g = s.src.charCodeAt(
|
2313
|
-
if (g === 33 && (d = !0, g = s.src.charCodeAt(++
|
2314
|
-
if (a = i + 1, a <
|
2315
|
-
for (a++; a <
|
2316
|
-
if (a >=
|
2317
|
-
for (
|
2318
|
-
if (a <
|
2319
|
-
if (a >=
|
2310
|
+
h = s.posMax,
|
2311
|
+
p = s.pos,
|
2312
|
+
g = s.src.charCodeAt(p);
|
2313
|
+
if (g === 33 && (d = !0, g = s.src.charCodeAt(++p)), g !== 91 || s.level >= s.options.maxNesting || (t = p + 1, i = pt(s, p), i < 0)) return !1;
|
2314
|
+
if (a = i + 1, a < h && s.src.charCodeAt(a) === 40) {
|
2315
|
+
for (a++; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2316
|
+
if (a >= h) return !1;
|
2317
|
+
for (p = a, Gn(s, a) ? (r = s.linkContent, a = s.pos) : r = "", p = a; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2318
|
+
if (a < h && p !== a && Vn(s, a)) for (o = s.linkContent, a = s.pos; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);else o = "";
|
2319
|
+
if (a >= h || s.src.charCodeAt(a) !== 41) return s.pos = u, !1;
|
2320
2320
|
a++;
|
2321
2321
|
} else {
|
2322
2322
|
if (s.linkLevel > 0) return !1;
|
2323
|
-
for (; a <
|
2324
|
-
if (a <
|
2323
|
+
for (; a < h && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2324
|
+
if (a < h && s.src.charCodeAt(a) === 91 && (p = a + 1, a = pt(s, a), a >= 0 ? n = s.src.slice(p, a++) : a = p - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[Wn(n)], !l) return s.pos = u, !1;
|
2325
2325
|
r = l.href, o = l.title;
|
2326
2326
|
}
|
2327
2327
|
return e || (s.pos = t, s.posMax = i, d ? s.push({
|
@@ -2338,7 +2338,7 @@ function wr(s, e) {
|
|
2338
2338
|
}), s.linkLevel++, s.parser.tokenize(s), s.linkLevel--, s.push({
|
2339
2339
|
type: "link_close",
|
2340
2340
|
level: --s.level
|
2341
|
-
}))), s.pos = a, s.posMax =
|
2341
|
+
}))), s.pos = a, s.posMax = h, !0;
|
2342
2342
|
}
|
2343
2343
|
function _r(s, e) {
|
2344
2344
|
var t,
|
@@ -2387,7 +2387,7 @@ function kr(s, e) {
|
|
2387
2387
|
r,
|
2388
2388
|
o,
|
2389
2389
|
a = s.pos;
|
2390
|
-
return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(Ar), i ? Tr.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o =
|
2390
|
+
return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(Ar), i ? Tr.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o = Li(r), !s.parser.validateLink(r)) ? !1 : (e || (s.push({
|
2391
2391
|
type: "link_open",
|
2392
2392
|
href: o,
|
2393
2393
|
level: s.level
|
@@ -2398,7 +2398,7 @@ function kr(s, e) {
|
|
2398
2398
|
}), s.push({
|
2399
2399
|
type: "link_close",
|
2400
2400
|
level: s.level
|
2401
|
-
})), s.pos += i[0].length, !0) : (n = t.match(Cr), n ? (r = n[0].slice(1, -1), o =
|
2401
|
+
})), s.pos += i[0].length, !0) : (n = t.match(Cr), n ? (r = n[0].slice(1, -1), o = Li("mailto:" + r), s.parser.validateLink(o) ? (e || (s.push({
|
2402
2402
|
type: "link_open",
|
2403
2403
|
href: o,
|
2404
2404
|
level: s.level
|
@@ -2411,7 +2411,7 @@ function kr(s, e) {
|
|
2411
2411
|
level: s.level
|
2412
2412
|
})), s.pos += n[0].length, !0) : !1) : !1));
|
2413
2413
|
}
|
2414
|
-
function
|
2414
|
+
function Xt(s, e) {
|
2415
2415
|
return s = s.source, e = e || "", function t(i, n) {
|
2416
2416
|
return i ? (n = n.source || n, s = s.replace(i, n), t) : new RegExp(s, e);
|
2417
2417
|
};
|
@@ -2420,15 +2420,15 @@ var Ir = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
|
2420
2420
|
Lr = /[^"'=<>`\x00-\x20]+/,
|
2421
2421
|
Rr = /'[^']*'/,
|
2422
2422
|
Or = /"[^"]*"/,
|
2423
|
-
Nr =
|
2424
|
-
Pr =
|
2425
|
-
Dr =
|
2423
|
+
Nr = Xt(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", Lr)("single_quoted", Rr)("double_quoted", Or)(),
|
2424
|
+
Pr = Xt(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Ir)("attr_value", Nr)(),
|
2425
|
+
Dr = Xt(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", Pr)(),
|
2426
2426
|
jr = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
2427
2427
|
Br = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
2428
2428
|
Fr = /<[?].*?[?]>/,
|
2429
2429
|
zr = /<![A-Z]+\s+[^>]*>/,
|
2430
2430
|
qr = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
2431
|
-
Ur =
|
2431
|
+
Ur = Xt(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", Dr)("close_tag", jr)("comment", Br)("processing", Fr)("declaration", zr)("cdata", qr)();
|
2432
2432
|
function Hr(s) {
|
2433
2433
|
var e = s | 32;
|
2434
2434
|
return e >= 97 && e <= 122;
|
@@ -2455,7 +2455,7 @@ function Kr(s, e) {
|
|
2455
2455
|
if (s.src.charCodeAt(r) !== 38) return !1;
|
2456
2456
|
if (r + 1 < o) {
|
2457
2457
|
if (t = s.src.charCodeAt(r + 1), t === 35) {
|
2458
|
-
if (n = s.src.slice(r).match(Vr), n) return e || (i = n[1][0].toLowerCase() === "x" ? parseInt(n[1].slice(1), 16) : parseInt(n[1], 10), s.pending += Un(i) ?
|
2458
|
+
if (n = s.src.slice(r).match(Vr), n) return e || (i = n[1][0].toLowerCase() === "x" ? parseInt(n[1].slice(1), 16) : parseInt(n[1], 10), s.pending += Un(i) ? Ii(i) : Ii(65533)), s.pos += n[0].length, !0;
|
2459
2459
|
} else if (n = s.src.slice(r).match(Wr), n) {
|
2460
2460
|
var a = zn(n[1]);
|
2461
2461
|
if (n[1] !== a) return e || (s.pending += a), s.pos += n[0].length, !0;
|
@@ -2463,13 +2463,13 @@ function Kr(s, e) {
|
|
2463
2463
|
}
|
2464
2464
|
return e || (s.pending += "&"), s.pos++, !0;
|
2465
2465
|
}
|
2466
|
-
var
|
2467
|
-
function
|
2466
|
+
var Si = [["text", ur], ["newline", hr], ["escape", pr], ["backticks", fr], ["del", mr], ["ins", gr], ["mark", br], ["emphasis", vr], ["sub", xr], ["sup", Sr], ["links", wr], ["footnote_inline", _r], ["footnote_ref", Mr], ["autolink", kr], ["htmltag", Gr], ["entity", Kr]];
|
2467
|
+
function Qt() {
|
2468
2468
|
this.ruler = new H();
|
2469
|
-
for (var s = 0; s <
|
2469
|
+
for (var s = 0; s < Si.length; s++) this.ruler.push(Si[s][0], Si[s][1]);
|
2470
2470
|
this.validateLink = Jr;
|
2471
2471
|
}
|
2472
|
-
|
2472
|
+
Qt.prototype.skipToken = function (s) {
|
2473
2473
|
var e = this.ruler.getRules(""),
|
2474
2474
|
t = e.length,
|
2475
2475
|
i = s.pos,
|
@@ -2485,7 +2485,7 @@ Xt.prototype.skipToken = function (s) {
|
|
2485
2485
|
}
|
2486
2486
|
s.pos++, s.cacheSet(i, s.pos);
|
2487
2487
|
};
|
2488
|
-
|
2488
|
+
Qt.prototype.tokenize = function (s) {
|
2489
2489
|
for (var e = this.ruler.getRules(""), t = e.length, i = s.posMax, n, r; s.pos < i;) {
|
2490
2490
|
for (r = 0; r < t && (n = e[r](s, !1), !n); r++);
|
2491
2491
|
if (n) {
|
@@ -2496,7 +2496,7 @@ Xt.prototype.tokenize = function (s) {
|
|
2496
2496
|
}
|
2497
2497
|
s.pending && s.pushPending();
|
2498
2498
|
};
|
2499
|
-
|
2499
|
+
Qt.prototype.parse = function (s, e, t, i) {
|
2500
2500
|
var n = new Re(s, this, e, t, i);
|
2501
2501
|
this.tokenize(n);
|
2502
2502
|
};
|
@@ -2626,7 +2626,7 @@ function Yn(s, e, t) {
|
|
2626
2626
|
this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
|
2627
2627
|
}
|
2628
2628
|
function ue(s, e) {
|
2629
|
-
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new
|
2629
|
+
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new Qt(), this.block = new qi(), this.core = new Kn(), this.renderer = new zi(), this.ruler = new H(), this.options = {}, this.configure(Xr[s]), this.set(e || {});
|
2630
2630
|
}
|
2631
2631
|
ue.prototype.set = function (s) {
|
2632
2632
|
qn(this.options, s);
|
@@ -2655,11 +2655,11 @@ ue.prototype.parseInline = function (s, e) {
|
|
2655
2655
|
ue.prototype.renderInline = function (s, e) {
|
2656
2656
|
return e = e || {}, this.renderer.render(this.parseInline(s, e), this.options, e);
|
2657
2657
|
};
|
2658
|
-
var
|
2659
|
-
function
|
2660
|
-
_classCallCheck(this,
|
2658
|
+
var Ri = /*#__PURE__*/function () {
|
2659
|
+
function Ri() {
|
2660
|
+
_classCallCheck(this, Ri);
|
2661
2661
|
}
|
2662
|
-
_createClass(
|
2662
|
+
_createClass(Ri, null, [{
|
2663
2663
|
key: "createNew",
|
2664
2664
|
value: function createNew() {
|
2665
2665
|
var e = window.hljs;
|
@@ -2698,7 +2698,7 @@ var Li = /*#__PURE__*/function () {
|
|
2698
2698
|
});
|
2699
2699
|
}
|
2700
2700
|
}]);
|
2701
|
-
return
|
2701
|
+
return Ri;
|
2702
2702
|
}();
|
2703
2703
|
var $n = /*#__PURE__*/function () {
|
2704
2704
|
function Rt() {
|
@@ -2765,11 +2765,11 @@ var $n = /*#__PURE__*/function () {
|
|
2765
2765
|
}();
|
2766
2766
|
$n.DEFAULT_FILE_NAME = "file";
|
2767
2767
|
var ie = $n;
|
2768
|
-
var
|
2769
|
-
function
|
2770
|
-
_classCallCheck(this,
|
2768
|
+
var Nt = /*#__PURE__*/function () {
|
2769
|
+
function Nt() {
|
2770
|
+
_classCallCheck(this, Nt);
|
2771
2771
|
}
|
2772
|
-
_createClass(
|
2772
|
+
_createClass(Nt, null, [{
|
2773
2773
|
key: "onNewMessage",
|
2774
2774
|
value: function onNewMessage(e, t, i) {
|
2775
2775
|
var n = JSON.parse(JSON.stringify({
|
@@ -2790,8 +2790,15 @@ var Ui = /*#__PURE__*/function () {
|
|
2790
2790
|
value: function onRender(e) {
|
2791
2791
|
e.onComponentRender(), e.dispatchEvent(new CustomEvent("render"));
|
2792
2792
|
}
|
2793
|
+
}, {
|
2794
|
+
key: "onError",
|
2795
|
+
value: function onError(e, t) {
|
2796
|
+
e.onError(t), e.dispatchEvent(new CustomEvent("error", {
|
2797
|
+
detail: t
|
2798
|
+
}));
|
2799
|
+
}
|
2793
2800
|
}]);
|
2794
|
-
return
|
2801
|
+
return Nt;
|
2795
2802
|
}();
|
2796
2803
|
var P = /*#__PURE__*/function () {
|
2797
2804
|
function P() {
|
@@ -2809,7 +2816,7 @@ var P = /*#__PURE__*/function () {
|
|
2809
2816
|
}, {
|
2810
2817
|
key: "applySideStyles",
|
2811
2818
|
value: function applySideStyles(e, t, i, n) {
|
2812
|
-
n && (P.applyCustomStylesToElements(e, i, n.shared), t ===
|
2819
|
+
n && (P.applyCustomStylesToElements(e, i, n.shared), t === x.USER_ROLE ? P.applyCustomStylesToElements(e, i, n.user) : (P.applyCustomStylesToElements(e, i, n.ai), P.applyCustomStylesToElements(e, i, n[t])));
|
2813
2820
|
}
|
2814
2821
|
}, {
|
2815
2822
|
key: "isMessageSideStyles",
|
@@ -2858,7 +2865,7 @@ var le = /*#__PURE__*/function () {
|
|
2858
2865
|
key: "applyCustomStyles",
|
2859
2866
|
value: function applyCustomStyles(e, t, i, n) {
|
2860
2867
|
var r, o, a, l;
|
2861
|
-
if ((r = i["default"]) != null && r.styles && le.applyCustomStylesToElements(e, t, i["default"].styles), n ===
|
2868
|
+
if ((r = i["default"]) != null && r.styles && le.applyCustomStylesToElements(e, t, i["default"].styles), n === x.USER_ROLE) (o = i.user) != null && o.styles && le.applyCustomStylesToElements(e, t, i.user.styles);else {
|
2862
2869
|
(a = i.ai) != null && a.styles && le.applyCustomStylesToElements(e, t, i.ai.styles);
|
2863
2870
|
var c = (l = i[n]) == null ? void 0 : l.styles;
|
2864
2871
|
c && le.applyCustomStylesToElements(e, t, c);
|
@@ -2869,7 +2876,7 @@ var le = /*#__PURE__*/function () {
|
|
2869
2876
|
value: function createAvatar(e, t) {
|
2870
2877
|
var r, o, a, l, c;
|
2871
2878
|
var i = document.createElement("img");
|
2872
|
-
e ===
|
2879
|
+
e === x.USER_ROLE ? i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || eo : i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || Qr, i.classList.add("avatar");
|
2873
2880
|
var n = document.createElement("div");
|
2874
2881
|
return n.classList.add("avatar-container"), n.appendChild(i), t && le.applyCustomStyles(n, i, t, e), n;
|
2875
2882
|
}
|
@@ -2879,7 +2886,7 @@ var le = /*#__PURE__*/function () {
|
|
2879
2886
|
var _i2, _i3, _i4;
|
2880
2887
|
var n, r, o, a, l, c;
|
2881
2888
|
var i = (r = (n = t == null ? void 0 : t[e]) == null ? void 0 : n.styles) == null ? void 0 : r.position;
|
2882
|
-
return e !==
|
2889
|
+
return e !== x.USER_ROLE && ((_i2 = i) !== null && _i2 !== void 0 ? _i2 : i = (a = (o = t == null ? void 0 : t.ai) == null ? void 0 : o.styles) == null ? void 0 : a.position), (_i3 = i) !== null && _i3 !== void 0 ? _i3 : i = (c = (l = t == null ? void 0 : t["default"]) == null ? void 0 : l.styles) == null ? void 0 : c.position, (_i4 = i) !== null && _i4 !== void 0 ? _i4 : i = e === x.USER_ROLE ? "right" : "left", i;
|
2883
2890
|
}
|
2884
2891
|
}, {
|
2885
2892
|
key: "add",
|
@@ -2902,19 +2909,19 @@ var Ge = /*#__PURE__*/function () {
|
|
2902
2909
|
var _i5, _i6, _i7;
|
2903
2910
|
var n, r, o;
|
2904
2911
|
var i = (n = t == null ? void 0 : t[e]) == null ? void 0 : n.position;
|
2905
|
-
return e !==
|
2912
|
+
return e !== x.USER_ROLE && ((_i5 = i) !== null && _i5 !== void 0 ? _i5 : i = (r = t == null ? void 0 : t.ai) == null ? void 0 : r.position), (_i6 = i) !== null && _i6 !== void 0 ? _i6 : i = (o = t == null ? void 0 : t["default"]) == null ? void 0 : o.position, (_i7 = i) !== null && _i7 !== void 0 ? _i7 : i = e === x.USER_ROLE ? "right" : "left", i;
|
2906
2913
|
}
|
2907
2914
|
}, {
|
2908
2915
|
key: "applyStyle",
|
2909
2916
|
value: function applyStyle(e, t, i) {
|
2910
2917
|
var n, r, o, a;
|
2911
|
-
Object.assign(e.style, (n = i["default"]) == null ? void 0 : n.style), t ===
|
2918
|
+
Object.assign(e.style, (n = i["default"]) == null ? void 0 : n.style), t === x.USER_ROLE ? Object.assign(e.style, (r = i.user) == null ? void 0 : r.style) : (Object.assign(e.style, (o = i.ai) == null ? void 0 : o.style), Object.assign(e.style, (a = i[t]) == null ? void 0 : a.style));
|
2912
2919
|
}
|
2913
2920
|
}, {
|
2914
2921
|
key: "getNameText",
|
2915
2922
|
value: function getNameText(e, t) {
|
2916
2923
|
var i, n, r, o, a, l;
|
2917
|
-
return e ===
|
2924
|
+
return e === x.USER_ROLE ? ((i = t.user) == null ? void 0 : i.text) || ((n = t["default"]) == null ? void 0 : n.text) || "User" : e === x.AI_ROLE ? ((r = t.ai) == null ? void 0 : r.text) || ((o = t["default"]) == null ? void 0 : o.text) || "AI" : ((a = t[e]) == null ? void 0 : a.text) || ((l = t["default"]) == null ? void 0 : l.text) || e;
|
2918
2925
|
}
|
2919
2926
|
}, {
|
2920
2927
|
key: "createName",
|
@@ -2937,7 +2944,7 @@ var We = /*#__PURE__*/function () {
|
|
2937
2944
|
function We(e) {
|
2938
2945
|
var _this3 = this;
|
2939
2946
|
_classCallCheck(this, We);
|
2940
|
-
this.messageElementRefs = [], this.messages = [], this.htmlClassUtilities = {}, this.textElementsToText = [], this.elementRef = We.createContainerElement(), this.messageStyles = e.messageStyles, this._remarkable =
|
2947
|
+
this.messageElementRefs = [], this.messages = [], this.htmlClassUtilities = {}, this.textElementsToText = [], this.elementRef = We.createContainerElement(), this.messageStyles = e.messageStyles, this._remarkable = Ri.createNew(), this._avatars = e.avatars, this._names = e.names, this._onNewMessage = Nt.onNewMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
|
2941
2948
|
_this3.submitUserMessage = e.submitUserMessage;
|
2942
2949
|
});
|
2943
2950
|
}
|
@@ -2950,15 +2957,15 @@ var We = /*#__PURE__*/function () {
|
|
2950
2957
|
if (r) return r;
|
2951
2958
|
}
|
2952
2959
|
var n = this.createAndAppendNewMessageElement(e, t);
|
2953
|
-
return n.bubbleElement.classList.add("text-message"), this.applyCustomStyles(n, t, !1),
|
2960
|
+
return n.bubbleElement.classList.add("text-message"), this.applyCustomStyles(n, t, !1), x.fillEmptyMessageElement(n.bubbleElement, e), this.textElementsToText.push([n, e]), n;
|
2954
2961
|
}
|
2955
2962
|
}, {
|
2956
2963
|
key: "overwriteText",
|
2957
2964
|
value: function overwriteText(e, t, i) {
|
2958
|
-
var n =
|
2965
|
+
var n = x.overwriteMessage(this.messages, i, t, e, "text", "text-message");
|
2959
2966
|
if (n) {
|
2960
2967
|
this.renderText(n.bubbleElement, t);
|
2961
|
-
var r =
|
2968
|
+
var r = x.getLastTextToElement(this.textElementsToText, n);
|
2962
2969
|
r && (r[1] = t);
|
2963
2970
|
}
|
2964
2971
|
return n;
|
@@ -2994,7 +3001,7 @@ var We = /*#__PURE__*/function () {
|
|
2994
3001
|
value:
|
2995
3002
|
// prettier-ignore
|
2996
3003
|
function addInnerContainerElements(e, t, i) {
|
2997
|
-
return e.classList.add("message-bubble",
|
3004
|
+
return e.classList.add("message-bubble", x.getRoleClass(i), i === x.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && le.add(e, i, this._avatars), this._names && Ge.add(e, i, this._names), {
|
2998
3005
|
bubbleElement: e
|
2999
3006
|
};
|
3000
3007
|
}
|
@@ -3021,7 +3028,7 @@ var We = /*#__PURE__*/function () {
|
|
3021
3028
|
key: "refreshTextMessages",
|
3022
3029
|
value: function refreshTextMessages() {
|
3023
3030
|
var _this5 = this;
|
3024
|
-
this._remarkable =
|
3031
|
+
this._remarkable = Ri.createNew(), this.textElementsToText.forEach(function (e) {
|
3025
3032
|
_this5.renderText(e[0].bubbleElement, e[1]);
|
3026
3033
|
});
|
3027
3034
|
}
|
@@ -3058,7 +3065,7 @@ var We = /*#__PURE__*/function () {
|
|
3058
3065
|
r = e._sessionId,
|
3059
3066
|
o = e.role,
|
3060
3067
|
a = {
|
3061
|
-
role: o ||
|
3068
|
+
role: o || x.AI_ROLE
|
3062
3069
|
};
|
3063
3070
|
return t && (a.text = t), i && (a.files = i), n && (a.html = n), !t && !i && !n && (a.text = ""), r && (a._sessionId = r), a;
|
3064
3071
|
}
|
@@ -3090,13 +3097,13 @@ var Hi = /*#__PURE__*/function () {
|
|
3090
3097
|
key: "setInitialState",
|
3091
3098
|
value: function setInitialState(e, t, i) {
|
3092
3099
|
var _i8;
|
3093
|
-
this._streamType = e, (_i8 = i) !== null && _i8 !== void 0 ? _i8 : i =
|
3100
|
+
this._streamType = e, (_i8 = i) !== null && _i8 !== void 0 ? _i8 : i = x.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : Ye.add(this._messages, t, i, this._messages.messageElementRefs), this._activeMessageContent = this._messages.messages[this._messages.messages.length - 1], this._elements.bubbleElement.classList.add(it.MESSAGE_CLASS), this._streamedContent = t;
|
3094
3101
|
}
|
3095
3102
|
}, {
|
3096
3103
|
key: "updateBasedOnType",
|
3097
3104
|
value: function updateBasedOnType(e, t, i) {
|
3098
3105
|
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
3099
|
-
|
3106
|
+
x.unfillEmptyMessageElement(i, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, i, n);
|
3100
3107
|
}
|
3101
3108
|
}, {
|
3102
3109
|
key: "updateText",
|
@@ -3118,7 +3125,7 @@ var Hi = /*#__PURE__*/function () {
|
|
3118
3125
|
var _this$_messages = this._messages,
|
3119
3126
|
e = _this$_messages.textElementsToText,
|
3120
3127
|
t = _this$_messages.elementRef;
|
3121
|
-
(i =
|
3128
|
+
(i = x.getLastMessageBubbleElement(t)) != null && i.classList.contains(it.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._activeMessageContent && (this._activeMessageContent.text = this._streamedContent), this._messages.textToSpeech && Lt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === it.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((n = x.getLastMessageBubbleElement(this._messages.elementRef)) == null ? void 0 : n.innerHTML) || ""), this._elements && se.apply(this._messages, this._elements.outerContainer), this._activeMessageContent && (this._activeMessageContent.html = this._streamedContent)), this._activeMessageContent && this._messages.sendClientUpdate(We.createMessageContent(this._activeMessageContent), !1), this._hasStreamEnded = !0);
|
3122
3129
|
}
|
3123
3130
|
}]);
|
3124
3131
|
return it;
|
@@ -3353,7 +3360,7 @@ var ro = globalThis && globalThis.__rest || function (s, e) {
|
|
3353
3360
|
if (s != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, i = Object.getOwnPropertySymbols(s); n < i.length; n++) e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(s, i[n]) && (t[i[n]] = s[i[n]]);
|
3354
3361
|
return t;
|
3355
3362
|
};
|
3356
|
-
var
|
3363
|
+
var Oi = "text/event-stream",
|
3357
3364
|
oo = 1e3,
|
3358
3365
|
fn = "last-event-id";
|
3359
3366
|
function ao(s, e) {
|
@@ -3366,9 +3373,9 @@ function ao(s, e) {
|
|
3366
3373
|
l = e.openWhenHidden,
|
3367
3374
|
c = e.fetch,
|
3368
3375
|
d = ro(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
3369
|
-
return new Promise(function (u,
|
3370
|
-
var
|
3371
|
-
|
3376
|
+
return new Promise(function (u, h) {
|
3377
|
+
var p = Object.assign({}, i);
|
3378
|
+
p.accept || (p.accept = Oi);
|
3372
3379
|
var g;
|
3373
3380
|
function m() {
|
3374
3381
|
g.abort(), document.hidden || Q();
|
@@ -3397,7 +3404,7 @@ function ao(s, e) {
|
|
3397
3404
|
_context3.prev = 1;
|
3398
3405
|
_context3.next = 4;
|
3399
3406
|
return A(s, Object.assign(Object.assign({}, d), {
|
3400
|
-
headers:
|
3407
|
+
headers: p,
|
3401
3408
|
signal: g.signal
|
3402
3409
|
}));
|
3403
3410
|
case 4:
|
@@ -3407,7 +3414,7 @@ function ao(s, e) {
|
|
3407
3414
|
case 7:
|
3408
3415
|
_context3.next = 9;
|
3409
3416
|
return to(he.body, io(no(function (q) {
|
3410
|
-
q ?
|
3417
|
+
q ? p[fn] = q : delete p[fn];
|
3411
3418
|
}, function (q) {
|
3412
3419
|
E = q;
|
3413
3420
|
}, r)));
|
@@ -3424,7 +3431,7 @@ function ao(s, e) {
|
|
3424
3431
|
q = (ee = a == null ? void 0 : a(_context3.t0)) !== null && ee !== void 0 ? ee : E;
|
3425
3432
|
window.clearTimeout(S), S = window.setTimeout(Q, q);
|
3426
3433
|
} catch (q) {
|
3427
|
-
G(),
|
3434
|
+
G(), h(q);
|
3428
3435
|
}
|
3429
3436
|
case 17:
|
3430
3437
|
case "end":
|
@@ -3439,7 +3446,7 @@ function ao(s, e) {
|
|
3439
3446
|
}
|
3440
3447
|
function lo(s) {
|
3441
3448
|
var e = s.headers.get("content-type");
|
3442
|
-
if (!(e != null && e.startsWith(
|
3449
|
+
if (!(e != null && e.startsWith(Oi))) throw new Error("Expected content-type to be ".concat(Oi, ", Actual: ").concat(e));
|
3443
3450
|
}
|
3444
3451
|
var Xn = /*#__PURE__*/function () {
|
3445
3452
|
function st() {
|
@@ -3525,7 +3532,7 @@ var C = /*#__PURE__*/function () {
|
|
3525
3532
|
function () {
|
3526
3533
|
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(e, t, i) {
|
3527
3534
|
var n,
|
3528
|
-
|
3535
|
+
p,
|
3529
3536
|
g,
|
3530
3537
|
m,
|
3531
3538
|
E,
|
@@ -3540,7 +3547,7 @@ var C = /*#__PURE__*/function () {
|
|
3540
3547
|
c,
|
3541
3548
|
d,
|
3542
3549
|
u,
|
3543
|
-
|
3550
|
+
h,
|
3544
3551
|
_args6 = arguments;
|
3545
3552
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3546
3553
|
while (1) switch (_context6.prev = _context6.next) {
|
@@ -3548,7 +3555,7 @@ var C = /*#__PURE__*/function () {
|
|
3548
3555
|
n = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : !0;
|
3549
3556
|
r = {
|
3550
3557
|
body: t,
|
3551
|
-
headers: (
|
3558
|
+
headers: (p = e.requestSettings) == null ? void 0 : p.headers
|
3552
3559
|
};
|
3553
3560
|
_context6.next = 4;
|
3554
3561
|
return _.processRequestInterceptor(e.deepChat, r);
|
@@ -3579,7 +3586,7 @@ var C = /*#__PURE__*/function () {
|
|
3579
3586
|
}
|
3580
3587
|
return _context6.abrupt("return", be.requestStream(i, e.streamHandlers));
|
3581
3588
|
case 18:
|
3582
|
-
|
3589
|
+
h = new $e(i);
|
3583
3590
|
ao(((E = e.requestSettings) == null ? void 0 : E.url) || e.url || "", {
|
3584
3591
|
method: ((S = e.requestSettings) == null ? void 0 : S.method) || "POST",
|
3585
3592
|
headers: a,
|
@@ -3614,7 +3621,7 @@ var C = /*#__PURE__*/function () {
|
|
3614
3621
|
if (JSON.stringify(A.data) !== JSON.stringify("[DONE]")) {
|
3615
3622
|
var Q = JSON.parse(A.data);
|
3616
3623
|
(V = e.extractResultData) == null || V.call(e, Q).then(function (ee) {
|
3617
|
-
|
3624
|
+
h.upsertStreamedMessage(ee);
|
3618
3625
|
})["catch"](function (ee) {
|
3619
3626
|
return _.displayError(i, ee);
|
3620
3627
|
});
|
@@ -3624,7 +3631,7 @@ var C = /*#__PURE__*/function () {
|
|
3624
3631
|
throw d(), A;
|
3625
3632
|
},
|
3626
3633
|
onclose: function onclose() {
|
3627
|
-
|
3634
|
+
h.finaliseStreamedMessage(), d();
|
3628
3635
|
},
|
3629
3636
|
signal: u.signal
|
3630
3637
|
})["catch"](function (A) {
|
@@ -3709,7 +3716,7 @@ var Ce = /*#__PURE__*/function () {
|
|
3709
3716
|
n = !0;
|
3710
3717
|
r = /*#__PURE__*/function () {
|
3711
3718
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(c) {
|
3712
|
-
var u,
|
3719
|
+
var u, h, d;
|
3713
3720
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
3714
3721
|
while (1) switch (_context7.prev = _context7.next) {
|
3715
3722
|
case 0:
|
@@ -3721,7 +3728,7 @@ var Ce = /*#__PURE__*/function () {
|
|
3721
3728
|
case 2:
|
3722
3729
|
n = !1;
|
3723
3730
|
_context7.next = 5;
|
3724
|
-
return (
|
3731
|
+
return (h = (u = e.deepChat).responseInterceptor) == null ? void 0 : h.call(u, c);
|
3725
3732
|
case 5:
|
3726
3733
|
_context7.t0 = _context7.sent;
|
3727
3734
|
if (_context7.t0) {
|
@@ -3759,7 +3766,7 @@ var Ce = /*#__PURE__*/function () {
|
|
3759
3766
|
}, {
|
3760
3767
|
key: "stream",
|
3761
3768
|
value: function stream(e, t, i) {
|
3762
|
-
var u,
|
3769
|
+
var u, h;
|
3763
3770
|
var n = !0,
|
3764
3771
|
r = !1;
|
3765
3772
|
var o = new $e(i),
|
@@ -3769,14 +3776,14 @@ var Ce = /*#__PURE__*/function () {
|
|
3769
3776
|
l = function l() {
|
3770
3777
|
n && (o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1);
|
3771
3778
|
},
|
3772
|
-
c = function c(
|
3773
|
-
n && (!
|
3779
|
+
c = function c(p) {
|
3780
|
+
n && (!p || _typeof(p) != "object" || typeof p.error != "string" && typeof p.html != "string" && typeof p.text != "string" ? console.error(I.INVALID_RESPONSE(p, "server", !1)) : p.error ? (console.error(p.error), o.finaliseStreamedMessage(), e.streamHandlers.onClose(), i.addNewErrorMessage("service", p.error), n = !1) : o.upsertStreamedMessage(p));
|
3774
3781
|
};
|
3775
3782
|
e.streamHandlers.abortStream.abort = function () {
|
3776
3783
|
o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1;
|
3777
3784
|
};
|
3778
3785
|
var d = Ce.generateOptionalSignals();
|
3779
|
-
(
|
3786
|
+
(h = (u = e.requestSettings).handler) == null || h.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
3780
3787
|
onOpen: a,
|
3781
3788
|
onResponse: c,
|
3782
3789
|
onClose: l,
|
@@ -3803,7 +3810,7 @@ var Ce = /*#__PURE__*/function () {
|
|
3803
3810
|
},
|
3804
3811
|
o = /*#__PURE__*/function () {
|
3805
3812
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(d) {
|
3806
|
-
var
|
3813
|
+
var h, p, u;
|
3807
3814
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
3808
3815
|
while (1) switch (_context9.prev = _context9.next) {
|
3809
3816
|
case 0:
|
@@ -3814,7 +3821,7 @@ var Ce = /*#__PURE__*/function () {
|
|
3814
3821
|
return _context9.abrupt("return");
|
3815
3822
|
case 2:
|
3816
3823
|
_context9.next = 4;
|
3817
|
-
return (
|
3824
|
+
return (p = (h = e.deepChat).responseInterceptor) == null ? void 0 : p.call(h, d);
|
3818
3825
|
case 4:
|
3819
3826
|
_context9.t0 = _context9.sent;
|
3820
3827
|
if (_context9.t0) {
|
@@ -3870,8 +3877,8 @@ var w = /*#__PURE__*/function () {
|
|
3870
3877
|
function () {
|
3871
3878
|
var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e, t, i) {
|
3872
3879
|
var n,
|
3873
|
-
p,
|
3874
3880
|
h,
|
3881
|
+
p,
|
3875
3882
|
g,
|
3876
3883
|
r,
|
3877
3884
|
_yield$_$processReque2,
|
@@ -3888,7 +3895,7 @@ var w = /*#__PURE__*/function () {
|
|
3888
3895
|
n = _args11.length > 3 && _args11[3] !== undefined ? _args11[3] : !0;
|
3889
3896
|
r = {
|
3890
3897
|
body: t,
|
3891
|
-
headers: (
|
3898
|
+
headers: (h = e.requestSettings) == null ? void 0 : h.headers
|
3892
3899
|
};
|
3893
3900
|
_context11.next = 4;
|
3894
3901
|
return _.processRequestInterceptor(e.deepChat, r);
|
@@ -3904,7 +3911,7 @@ var w = /*#__PURE__*/function () {
|
|
3904
3911
|
}
|
3905
3912
|
return _context11.abrupt("return", w.onInterceptorError(i, l, c));
|
3906
3913
|
case 11:
|
3907
|
-
if (!((
|
3914
|
+
if (!((p = e.requestSettings) != null && p.handler)) {
|
3908
3915
|
_context11.next = 13;
|
3909
3916
|
break;
|
3910
3917
|
}
|
@@ -4041,7 +4048,7 @@ var w = /*#__PURE__*/function () {
|
|
4041
4048
|
value: function () {
|
4042
4049
|
var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(e, t, i) {
|
4043
4050
|
var n,
|
4044
|
-
|
4051
|
+
p,
|
4045
4052
|
g,
|
4046
4053
|
m,
|
4047
4054
|
r,
|
@@ -4052,7 +4059,7 @@ var w = /*#__PURE__*/function () {
|
|
4052
4059
|
c,
|
4053
4060
|
d,
|
4054
4061
|
u,
|
4055
|
-
|
4062
|
+
h,
|
4056
4063
|
_args13 = arguments;
|
4057
4064
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
4058
4065
|
while (1) switch (_context13.prev = _context13.next) {
|
@@ -4060,7 +4067,7 @@ var w = /*#__PURE__*/function () {
|
|
4060
4067
|
n = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : !0;
|
4061
4068
|
r = {
|
4062
4069
|
body: t,
|
4063
|
-
headers: (
|
4070
|
+
headers: (p = e.requestSettings) == null ? void 0 : p.headers
|
4064
4071
|
};
|
4065
4072
|
_context13.next = 4;
|
4066
4073
|
return _.processRequestInterceptor(e.deepChat, r);
|
@@ -4075,12 +4082,12 @@ var w = /*#__PURE__*/function () {
|
|
4075
4082
|
}
|
4076
4083
|
return _context13.abrupt("return", w.onInterceptorError(i, l));
|
4077
4084
|
case 10:
|
4078
|
-
c = ((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", d = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", u = n ? JSON.stringify(o) : o,
|
4085
|
+
c = ((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", d = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", u = n ? JSON.stringify(o) : o, h = {
|
4079
4086
|
method: d,
|
4080
4087
|
body: u,
|
4081
4088
|
headers: a
|
4082
4089
|
};
|
4083
|
-
e.requestSettings.credentials && (
|
4090
|
+
e.requestSettings.credentials && (h.credentials = e.requestSettings.credentials), w.executePollRequest(e, c, h, i);
|
4084
4091
|
case 12:
|
4085
4092
|
case "end":
|
4086
4093
|
return _context13.stop();
|
@@ -4369,12 +4376,12 @@ var L = /*#__PURE__*/function () {
|
|
4369
4376
|
}, {
|
4370
4377
|
key: "processMicrophone",
|
4371
4378
|
value: function processMicrophone(e, t, i, n) {
|
4372
|
-
var _l$files,
|
4373
|
-
var a, l, c, d, u,
|
4379
|
+
var _l$files, _h$maxNumberOfFiles;
|
4380
|
+
var a, l, c, d, u, h;
|
4374
4381
|
var o = _objectSpread({
|
4375
4382
|
acceptedFormats: "audio/*"
|
4376
4383
|
}, ((a = e.fileTypes.audio) == null ? void 0 : a.files) || {});
|
4377
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((
|
4384
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((_h$maxNumberOfFiles = (h = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _h$maxNumberOfFiles !== void 0 ? _h$maxNumberOfFiles : h.maxNumberOfFiles = i.files.maxNumberOfFiles))) : n || (e.fileTypes.audio = L.parseConfig(e.requestSettings, o, t, i)));
|
4378
4385
|
}
|
4379
4386
|
// prettier-ignore
|
4380
4387
|
}, {
|
@@ -4430,7 +4437,7 @@ var L = /*#__PURE__*/function () {
|
|
4430
4437
|
key: "set",
|
4431
4438
|
value: function set(e, t, i) {
|
4432
4439
|
L.populateDefaultFileIO(i == null ? void 0 : i.audio, ".4a,.mp3,.webm,.mp4,.mpga,.wav,.mpeg,.m4a"), L.populateDefaultFileIO(i == null ? void 0 : i.images, ".png,.jpg");
|
4433
|
-
var n =
|
4440
|
+
var n = Ri.createNew();
|
4434
4441
|
L.processImagesConfig(t, n, e.images, i == null ? void 0 : i.images), L.processCamera(t, n, e.camera, e.images), L.processGifConfig(t, n, e.gifs, i == null ? void 0 : i.gifs), L.processAudioConfig(t, n, e.audio, i == null ? void 0 : i.audio), L.processMicrophone(t, n, e.microphone, e.audio), L.processMixedFiles(t, n, e.mixedFiles);
|
4435
4442
|
}
|
4436
4443
|
}]);
|
@@ -4694,24 +4701,24 @@ var z = /*#__PURE__*/function (_Ie) {
|
|
4694
4701
|
}]);
|
4695
4702
|
return z;
|
4696
4703
|
}(Ie);
|
4697
|
-
var
|
4698
|
-
function
|
4699
|
-
_classCallCheck(this,
|
4704
|
+
var Pt = /*#__PURE__*/function () {
|
4705
|
+
function Pt() {
|
4706
|
+
_classCallCheck(this, Pt);
|
4700
4707
|
}
|
4701
|
-
_createClass(
|
4708
|
+
_createClass(Pt, null, [{
|
4702
4709
|
key: "waitForPropertiesToBeUpdatedBeforeRender",
|
4703
4710
|
value: function waitForPropertiesToBeUpdatedBeforeRender(e) {
|
4704
4711
|
e._propUpdated_ = !1, setTimeout(function () {
|
4705
|
-
e._propUpdated_ ?
|
4712
|
+
e._propUpdated_ ? Pt.waitForPropertiesToBeUpdatedBeforeRender(e) : (e._waitingToRender_ = !1, e.onRender());
|
4706
4713
|
});
|
4707
4714
|
}
|
4708
4715
|
}, {
|
4709
4716
|
key: "attemptRender",
|
4710
4717
|
value: function attemptRender(e) {
|
4711
|
-
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0,
|
4718
|
+
e._propUpdated_ = !0, e._waitingToRender_ || (e._waitingToRender_ = !0, Pt.waitForPropertiesToBeUpdatedBeforeRender(e));
|
4712
4719
|
}
|
4713
4720
|
}]);
|
4714
|
-
return
|
4721
|
+
return Pt;
|
4715
4722
|
}();
|
4716
4723
|
var Gi = /*#__PURE__*/function (_HTMLElement) {
|
4717
4724
|
_inherits(Ue, _HTMLElement);
|
@@ -4737,7 +4744,7 @@ var Gi = /*#__PURE__*/function (_HTMLElement) {
|
|
4737
4744
|
return i;
|
4738
4745
|
},
|
4739
4746
|
set: function set(o) {
|
4740
|
-
i = o, t ? this[e] = o :
|
4747
|
+
i = o, t ? this[e] = o : Pt.attemptRender(this);
|
4741
4748
|
}
|
4742
4749
|
});
|
4743
4750
|
}
|
@@ -4938,11 +4945,11 @@ var N = /*#__PURE__*/function () {
|
|
4938
4945
|
}]);
|
4939
4946
|
return N;
|
4940
4947
|
}();
|
4941
|
-
var
|
4942
|
-
function
|
4943
|
-
_classCallCheck(this,
|
4948
|
+
var Dt = /*#__PURE__*/function () {
|
4949
|
+
function Dt() {
|
4950
|
+
_classCallCheck(this, Dt);
|
4944
4951
|
}
|
4945
|
-
_createClass(
|
4952
|
+
_createClass(Dt, null, [{
|
4946
4953
|
key: "buildHeaders",
|
4947
4954
|
value: function buildHeaders(e) {
|
4948
4955
|
return {
|
@@ -4964,24 +4971,24 @@ var Pt = /*#__PURE__*/function () {
|
|
4964
4971
|
return {
|
4965
4972
|
url: "https://api-inference.huggingface.co/models/gpt2",
|
4966
4973
|
method: "POST",
|
4967
|
-
handleVerificationResult:
|
4974
|
+
handleVerificationResult: Dt.handleVerificationResult
|
4968
4975
|
};
|
4969
4976
|
}
|
4970
4977
|
}]);
|
4971
|
-
return
|
4978
|
+
return Dt;
|
4972
4979
|
}();
|
4973
4980
|
var es = /*#__PURE__*/function (_z) {
|
4974
|
-
_inherits(
|
4975
|
-
var _super3 = _createSuper(
|
4981
|
+
_inherits(Ni, _z);
|
4982
|
+
var _super3 = _createSuper(Ni);
|
4976
4983
|
// prettier-ignore
|
4977
|
-
function
|
4984
|
+
function Ni(e, t, i, n, r, o) {
|
4978
4985
|
var _this8;
|
4979
|
-
_classCallCheck(this,
|
4980
|
-
_this8 = _super3.call(this, e,
|
4986
|
+
_classCallCheck(this, Ni);
|
4987
|
+
_this8 = _super3.call(this, e, Dt.buildKeyVerificationDetails(), Dt.buildHeaders, r, o), _this8.insertKeyPlaceholderText = "Hugging Face Token", _this8.getKeyLink = "https://huggingface.co/settings/tokens", _this8.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>", _this8.permittedErrorPrefixes = ["Authorization header"], _this8.url = "".concat(Ni.URL_PREFIX).concat(i), _this8.textInputPlaceholderText = t, _typeof(n) == "object" && (n.model && (_this8.url = "".concat(Ni.URL_PREFIX).concat(n.model)), n.options && (_this8.rawBody.options = n.options), n.parameters && (_this8.rawBody.parameters = n.parameters));
|
4981
4988
|
return _this8;
|
4982
4989
|
}
|
4983
4990
|
// prettier-ignore
|
4984
|
-
_createClass(
|
4991
|
+
_createClass(Ni, [{
|
4985
4992
|
key: "preprocessBody",
|
4986
4993
|
value: function preprocessBody(e, t, i) {
|
4987
4994
|
var _n$options;
|
@@ -5019,7 +5026,7 @@ var es = /*#__PURE__*/function (_z) {
|
|
5019
5026
|
return callServiceAPI;
|
5020
5027
|
}()
|
5021
5028
|
}]);
|
5022
|
-
return
|
5029
|
+
return Ni;
|
5023
5030
|
}(z);
|
5024
5031
|
es.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5025
5032
|
var Ne = es;
|
@@ -5212,24 +5219,24 @@ var re = /*#__PURE__*/function () {
|
|
5212
5219
|
}]);
|
5213
5220
|
return re;
|
5214
5221
|
}();
|
5215
|
-
var
|
5216
|
-
_inherits(
|
5217
|
-
var _super7 = _createSuper(
|
5222
|
+
var ei = /*#__PURE__*/function (_z2) {
|
5223
|
+
_inherits(ei, _z2);
|
5224
|
+
var _super7 = _createSuper(ei);
|
5218
5225
|
// prettier-ignore
|
5219
|
-
function
|
5226
|
+
function ei(e, t, i, n, r) {
|
5220
5227
|
var _this10;
|
5221
|
-
_classCallCheck(this,
|
5228
|
+
_classCallCheck(this, ei);
|
5222
5229
|
_this10 = _super7.call(this, e, t, i, n, r), _this10.insertKeyPlaceholderText = "Stability AI API Key", _this10.getKeyLink = "https://platform.stability.ai/docs/getting-started/authentication", _this10.permittedErrorPrefixes = ["Incorrect", "invalid_"];
|
5223
5230
|
return _this10;
|
5224
5231
|
}
|
5225
|
-
return _createClass(
|
5232
|
+
return _createClass(ei);
|
5226
5233
|
}(z);
|
5227
|
-
var
|
5228
|
-
_inherits(
|
5229
|
-
var _super8 = _createSuper(
|
5230
|
-
function
|
5234
|
+
var jt = /*#__PURE__*/function (_ei) {
|
5235
|
+
_inherits(jt, _ei);
|
5236
|
+
var _super8 = _createSuper(jt);
|
5237
|
+
function jt(e) {
|
5231
5238
|
var _this11;
|
5232
|
-
_classCallCheck(this,
|
5239
|
+
_classCallCheck(this, jt);
|
5233
5240
|
var o;
|
5234
5241
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5235
5242
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -5243,10 +5250,10 @@ var Dt = /*#__PURE__*/function (_Qt) {
|
|
5243
5250
|
};
|
5244
5251
|
_this11 = _super8.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this11.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this11.textInputPlaceholderText = "Describe image changes", _this11.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>";
|
5245
5252
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
5246
|
-
_typeof(r) == "object" && (r.engine_id && (_this11.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")),
|
5253
|
+
_typeof(r) == "object" && (r.engine_id && (_this11.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), jt.cleanConfig(r), Object.assign(_this11.rawBody, r)), _this11.canSendMessage = jt.canSendFileMessage;
|
5247
5254
|
return _this11;
|
5248
5255
|
}
|
5249
|
-
_createClass(
|
5256
|
+
_createClass(jt, [{
|
5250
5257
|
key: "createFormDataBody",
|
5251
5258
|
value: function createFormDataBody(e, t) {
|
5252
5259
|
var i = new FormData();
|
@@ -5331,14 +5338,14 @@ var Dt = /*#__PURE__*/function (_Qt) {
|
|
5331
5338
|
return !!(t != null && t[0]);
|
5332
5339
|
}
|
5333
5340
|
}]);
|
5334
|
-
return
|
5335
|
-
}(
|
5336
|
-
var
|
5337
|
-
_inherits(
|
5338
|
-
var _super9 = _createSuper(
|
5339
|
-
function
|
5341
|
+
return jt;
|
5342
|
+
}(ei);
|
5343
|
+
var Bt = /*#__PURE__*/function (_ei2) {
|
5344
|
+
_inherits(Bt, _ei2);
|
5345
|
+
var _super9 = _createSuper(Bt);
|
5346
|
+
function Bt(e) {
|
5340
5347
|
var _this12;
|
5341
|
-
_classCallCheck(this,
|
5348
|
+
_classCallCheck(this, Bt);
|
5342
5349
|
var o;
|
5343
5350
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5344
5351
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -5352,10 +5359,10 @@ var jt = /*#__PURE__*/function (_Qt2) {
|
|
5352
5359
|
};
|
5353
5360
|
_this12 = _super9.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this12.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this12._maskSource = "MASK_IMAGE_WHITE", _this12.textInputPlaceholderText = "Describe image changes", _this12.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>";
|
5354
5361
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
5355
|
-
_typeof(r) == "object" && (r.engine_id && (_this12.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this12._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this12._maskSource = r.mask_source),
|
5362
|
+
_typeof(r) == "object" && (r.engine_id && (_this12.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this12._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this12._maskSource = r.mask_source), Bt.cleanConfig(r), Object.assign(_this12.rawBody, r)), _this12.canSendMessage = Bt.canSendFileTextMessage;
|
5356
5363
|
return _this12;
|
5357
5364
|
}
|
5358
|
-
_createClass(
|
5365
|
+
_createClass(Bt, [{
|
5359
5366
|
key: "createFormDataBody",
|
5360
5367
|
value: function createFormDataBody(e, t, i, n) {
|
5361
5368
|
var r = new FormData();
|
@@ -5440,8 +5447,8 @@ var jt = /*#__PURE__*/function (_Qt2) {
|
|
5440
5447
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
5441
5448
|
}
|
5442
5449
|
}]);
|
5443
|
-
return
|
5444
|
-
}(
|
5450
|
+
return Bt;
|
5451
|
+
}(ei);
|
5445
5452
|
var go = /*#__PURE__*/function (_bt3) {
|
5446
5453
|
_inherits(go, _bt3);
|
5447
5454
|
var _super10 = _createSuper(go);
|
@@ -5712,12 +5719,12 @@ var xo = /*#__PURE__*/function (_Ne5) {
|
|
5712
5719
|
}]);
|
5713
5720
|
return xo;
|
5714
5721
|
}(Ne);
|
5715
|
-
var
|
5716
|
-
_inherits(
|
5717
|
-
var _super15 = _createSuper(
|
5718
|
-
function
|
5722
|
+
var Ft = /*#__PURE__*/function (_ei3) {
|
5723
|
+
_inherits(Ft, _ei3);
|
5724
|
+
var _super15 = _createSuper(Ft);
|
5725
|
+
function Ft(e) {
|
5719
5726
|
var _this15;
|
5720
|
-
_classCallCheck(this,
|
5727
|
+
_classCallCheck(this, Ft);
|
5721
5728
|
var o;
|
5722
5729
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5723
5730
|
i = t.stabilityAI,
|
@@ -5731,10 +5738,10 @@ var Bt = /*#__PURE__*/function (_Qt3) {
|
|
5731
5738
|
};
|
5732
5739
|
_this15 = _super15.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this15.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this15.textInputPlaceholderText = "Describe image changes", _this15.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>";
|
5733
5740
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
5734
|
-
_typeof(r) == "object" && (r.engine_id && (_this15.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this15._imageWeight = r.weight),
|
5741
|
+
_typeof(r) == "object" && (r.engine_id && (_this15.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this15._imageWeight = r.weight), Ft.cleanConfig(r), Object.assign(_this15.rawBody, r)), _this15.canSendMessage = Ft.canSendFileTextMessage;
|
5735
5742
|
return _this15;
|
5736
5743
|
}
|
5737
|
-
_createClass(
|
5744
|
+
_createClass(Ft, [{
|
5738
5745
|
key: "createFormDataBody",
|
5739
5746
|
value: function createFormDataBody(e, t, i) {
|
5740
5747
|
var n = new FormData();
|
@@ -5819,8 +5826,8 @@ var Bt = /*#__PURE__*/function (_Qt3) {
|
|
5819
5826
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
5820
5827
|
}
|
5821
5828
|
}]);
|
5822
|
-
return
|
5823
|
-
}(
|
5829
|
+
return Ft;
|
5830
|
+
}(ei);
|
5824
5831
|
var Eo = /*#__PURE__*/function (_Ne6) {
|
5825
5832
|
_inherits(Eo, _Ne6);
|
5826
5833
|
var _super16 = _createSuper(Eo);
|
@@ -5861,21 +5868,21 @@ var Eo = /*#__PURE__*/function (_Ne6) {
|
|
5861
5868
|
}]);
|
5862
5869
|
return Eo;
|
5863
5870
|
}(Ne);
|
5864
|
-
var
|
5865
|
-
_inherits(
|
5866
|
-
var _super17 = _createSuper(
|
5867
|
-
function
|
5871
|
+
var zt = /*#__PURE__*/function (_ei4) {
|
5872
|
+
_inherits(zt, _ei4);
|
5873
|
+
var _super17 = _createSuper(zt);
|
5874
|
+
function zt(e) {
|
5868
5875
|
var _this16;
|
5869
|
-
_classCallCheck(this,
|
5876
|
+
_classCallCheck(this, zt);
|
5870
5877
|
var r;
|
5871
5878
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5872
5879
|
i = t.stabilityAI;
|
5873
5880
|
_this16 = _super17.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i), _this16.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this16.textInputPlaceholderText = "Describe an image", _this16.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>";
|
5874
5881
|
var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
5875
|
-
_typeof(n) == "object" && (n.engine_id && (_this16.url = "https://api.stability.ai/v1/generation/".concat(n.engine_id, "/text-to-image")), n.weight !== void 0 && n.weight !== null && (_this16._imageWeight = n.weight),
|
5882
|
+
_typeof(n) == "object" && (n.engine_id && (_this16.url = "https://api.stability.ai/v1/generation/".concat(n.engine_id, "/text-to-image")), n.weight !== void 0 && n.weight !== null && (_this16._imageWeight = n.weight), zt.cleanConfig(n), Object.assign(_this16.rawBody, n)), _this16.canSendMessage = zt.canSendTextMessage;
|
5876
5883
|
return _this16;
|
5877
5884
|
}
|
5878
|
-
_createClass(
|
5885
|
+
_createClass(zt, [{
|
5879
5886
|
key: "preprocessBody",
|
5880
5887
|
value: function preprocessBody(e, t) {
|
5881
5888
|
var i = JSON.parse(JSON.stringify(e)),
|
@@ -5954,8 +5961,8 @@ var Ft = /*#__PURE__*/function (_Qt4) {
|
|
5954
5961
|
return !!(e && e.trim() !== "");
|
5955
5962
|
}
|
5956
5963
|
}]);
|
5957
|
-
return
|
5958
|
-
}(
|
5964
|
+
return zt;
|
5965
|
+
}(ei);
|
5959
5966
|
var So = /*#__PURE__*/function (_Ne7) {
|
5960
5967
|
_inherits(So, _Ne7);
|
5961
5968
|
var _super18 = _createSuper(So);
|
@@ -5998,11 +6005,11 @@ var So = /*#__PURE__*/function (_Ne7) {
|
|
5998
6005
|
}]);
|
5999
6006
|
return So;
|
6000
6007
|
}(Ne);
|
6001
|
-
var
|
6002
|
-
function
|
6003
|
-
_classCallCheck(this,
|
6008
|
+
var qt = /*#__PURE__*/function () {
|
6009
|
+
function qt() {
|
6010
|
+
_classCallCheck(this, qt);
|
6004
6011
|
}
|
6005
|
-
_createClass(
|
6012
|
+
_createClass(qt, null, [{
|
6006
6013
|
key: "buildHeaders",
|
6007
6014
|
value: function buildHeaders(e) {
|
6008
6015
|
return {
|
@@ -6024,14 +6031,14 @@ var zt = /*#__PURE__*/function () {
|
|
6024
6031
|
return {
|
6025
6032
|
url: "https://api.cohere.ai/v1/generate",
|
6026
6033
|
method: "POST",
|
6027
|
-
handleVerificationResult:
|
6034
|
+
handleVerificationResult: qt.handleVerificationResult,
|
6028
6035
|
body: JSON.stringify({
|
6029
6036
|
prompt: ""
|
6030
6037
|
})
|
6031
6038
|
};
|
6032
6039
|
}
|
6033
6040
|
}]);
|
6034
|
-
return
|
6041
|
+
return qt;
|
6035
6042
|
}();
|
6036
6043
|
var Vi = /*#__PURE__*/function (_z3) {
|
6037
6044
|
_inherits(Vi, _z3);
|
@@ -6039,7 +6046,7 @@ var Vi = /*#__PURE__*/function (_z3) {
|
|
6039
6046
|
function Vi(e, t, i, n, r) {
|
6040
6047
|
var _this18;
|
6041
6048
|
_classCallCheck(this, Vi);
|
6042
|
-
_this18 = _super19.call(this, e,
|
6049
|
+
_this18 = _super19.call(this, e, qt.buildKeyVerificationDetails(), qt.buildHeaders, r), _this18.insertKeyPlaceholderText = "Cohere API Key", _this18.getKeyLink = "https://dashboard.cohere.ai/api-keys", _this18.permittedErrorPrefixes = ["invalid"], _this18.url = t, _this18.textInputPlaceholderText = i, n && _typeof(n) == "object" && Object.assign(_this18.rawBody, n);
|
6043
6050
|
return _this18;
|
6044
6051
|
}
|
6045
6052
|
return _createClass(Vi);
|
@@ -6326,21 +6333,21 @@ var O = /*#__PURE__*/function () {
|
|
6326
6333
|
return O;
|
6327
6334
|
}();
|
6328
6335
|
var Wi = /*#__PURE__*/function (_z4) {
|
6329
|
-
_inherits(
|
6330
|
-
var _super22 = _createSuper(
|
6331
|
-
function
|
6336
|
+
_inherits(Pi, _z4);
|
6337
|
+
var _super22 = _createSuper(Pi);
|
6338
|
+
function Pi(e) {
|
6332
6339
|
var _o$model, _a$voice;
|
6333
6340
|
var _this19;
|
6334
|
-
_classCallCheck(this,
|
6341
|
+
_classCallCheck(this, Pi);
|
6335
6342
|
var r, o, a;
|
6336
6343
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6337
6344
|
i = t == null ? void 0 : t.openAI;
|
6338
6345
|
_this19 = _super22.call(this, e, O.buildKeyVerificationDetails(), O.buildHeaders, i), _this19.insertKeyPlaceholderText = "OpenAI API Key", _this19.getKeyLink = "https://platform.openai.com/account/api-keys", _this19.url = "https://api.openai.com/v1/audio/speech", _this19.permittedErrorPrefixes = ["Invalid"], _this19.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Text To Speech</b></div>\n <p>Generate an audio file based on your text input.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/text-to-speech\">here</a> for more information.</p>";
|
6339
6346
|
var n = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.textToSpeech;
|
6340
|
-
_typeof(n) == "object" && Object.assign(_this19.rawBody, n), (_o$model = (o = _this19.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model =
|
6347
|
+
_typeof(n) == "object" && Object.assign(_this19.rawBody, n), (_o$model = (o = _this19.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = Pi.DEFAULT_MODEL, (_a$voice = (a = _this19.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = Pi.DEFAULT_VOIDE, _this19.textInputPlaceholderText = "Insert text to generate audio", _this19.rawBody.response_format = "mp3";
|
6341
6348
|
return _this19;
|
6342
6349
|
}
|
6343
|
-
_createClass(
|
6350
|
+
_createClass(Pi, [{
|
6344
6351
|
key: "preprocessBody",
|
6345
6352
|
value: function preprocessBody(e, t) {
|
6346
6353
|
var r, o;
|
@@ -6420,12 +6427,12 @@ var Wi = /*#__PURE__*/function (_z4) {
|
|
6420
6427
|
return extractResultData;
|
6421
6428
|
}()
|
6422
6429
|
}]);
|
6423
|
-
return
|
6430
|
+
return Pi;
|
6424
6431
|
}(z);
|
6425
6432
|
Wi.DEFAULT_MODEL = "tts-1";
|
6426
6433
|
Wi.DEFAULT_VOIDE = "alloy";
|
6427
6434
|
var Mo = Wi;
|
6428
|
-
var
|
6435
|
+
var ti = /*#__PURE__*/function (_z5) {
|
6429
6436
|
_inherits(xe, _z5);
|
6430
6437
|
var _super23 = _createSuper(xe);
|
6431
6438
|
function xe(e) {
|
@@ -6538,10 +6545,10 @@ var ei = /*#__PURE__*/function (_z5) {
|
|
6538
6545
|
}]);
|
6539
6546
|
return xe;
|
6540
6547
|
}(z);
|
6541
|
-
|
6542
|
-
|
6543
|
-
|
6544
|
-
var To =
|
6548
|
+
ti.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
6549
|
+
ti.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
6550
|
+
ti.DEFAULT_MODEL = "whisper-1";
|
6551
|
+
var To = ti;
|
6545
6552
|
var $ = /*#__PURE__*/function () {
|
6546
6553
|
function $() {
|
6547
6554
|
_classCallCheck(this, $);
|
@@ -7103,11 +7110,11 @@ is.HELP_LINK =
|
|
7103
7110
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7104
7111
|
var ko = is;
|
7105
7112
|
var ss = /*#__PURE__*/function (_ts2) {
|
7106
|
-
_inherits(
|
7107
|
-
var _super29 = _createSuper(
|
7108
|
-
function
|
7113
|
+
_inherits(Di, _ts2);
|
7114
|
+
var _super29 = _createSuper(Di);
|
7115
|
+
function Di(e) {
|
7109
7116
|
var _this26;
|
7110
|
-
_classCallCheck(this,
|
7117
|
+
_classCallCheck(this, Di);
|
7111
7118
|
var o, a, l;
|
7112
7119
|
var t = (a = (o = e.directConnection) == null ? void 0 : o.azure) == null ? void 0 : a.speechToText,
|
7113
7120
|
i = (l = e.directConnection) == null ? void 0 : l.azure,
|
@@ -7118,12 +7125,12 @@ var ss = /*#__PURE__*/function (_ts2) {
|
|
7118
7125
|
}
|
7119
7126
|
}
|
7120
7127
|
};
|
7121
|
-
_this26 = _super29.call(this, e, $.buildSpeechToTextHeaders, t.region, i, n), _this26.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(
|
7128
|
+
_this26 = _super29.call(this, e, $.buildSpeechToTextHeaders, t.region, i, n), _this26.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(Di.HELP_LINK, "\">here</a> for more info.\n </p>"), _this26.url = "", _this26.isTextInputDisabled = !0, _this26.textInputPlaceholderText = "Upload an audio file", _this26.canSendMessage = Di.canFileSendMessage;
|
7122
7129
|
var r = t.lang || "en-US";
|
7123
7130
|
_this26.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this26.recordAudio = void 0;
|
7124
7131
|
return _this26;
|
7125
7132
|
}
|
7126
|
-
_createClass(
|
7133
|
+
_createClass(Di, [{
|
7127
7134
|
key: "callServiceAPI",
|
7128
7135
|
value: function () {
|
7129
7136
|
var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e, t, i) {
|
@@ -7188,7 +7195,7 @@ var ss = /*#__PURE__*/function (_ts2) {
|
|
7188
7195
|
return !!(t != null && t[0]);
|
7189
7196
|
}
|
7190
7197
|
}]);
|
7191
|
-
return
|
7198
|
+
return Di;
|
7192
7199
|
}(ts);
|
7193
7200
|
ss.HELP_LINK =
|
7194
7201
|
// eslint-disable-next-line max-len
|
@@ -7303,7 +7310,7 @@ var Ji = /*#__PURE__*/function (_z10) {
|
|
7303
7310
|
return Ze.getCharacterLimitMessages(e, i).map(function (n) {
|
7304
7311
|
return {
|
7305
7312
|
content: n.text || "",
|
7306
|
-
role: n.role ===
|
7313
|
+
role: n.role === x.USER_ROLE ? "user" : "assistant",
|
7307
7314
|
file_ids: t
|
7308
7315
|
};
|
7309
7316
|
});
|
@@ -7566,7 +7573,7 @@ var Ji = /*#__PURE__*/function (_z10) {
|
|
7566
7573
|
Ji.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
7567
7574
|
Ji.POLLING_TIMEOUT_MS = 800;
|
7568
7575
|
var Ro = Ji;
|
7569
|
-
var
|
7576
|
+
var ii = /*#__PURE__*/function (_z11) {
|
7570
7577
|
_inherits(Ee, _z11);
|
7571
7578
|
var _super32 = _createSuper(Ee);
|
7572
7579
|
function Ee(e) {
|
@@ -7718,10 +7725,10 @@ var ti = /*#__PURE__*/function (_z11) {
|
|
7718
7725
|
}]);
|
7719
7726
|
return Ee;
|
7720
7727
|
}(z);
|
7721
|
-
|
7722
|
-
|
7723
|
-
|
7724
|
-
var Oo =
|
7728
|
+
ii.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
7729
|
+
ii.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
7730
|
+
ii.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
7731
|
+
var Oo = ii;
|
7725
7732
|
var lt = /*#__PURE__*/function (_z12) {
|
7726
7733
|
_inherits(lt, _z12);
|
7727
7734
|
var _super33 = _createSuper(lt);
|
@@ -7758,7 +7765,7 @@ var lt = /*#__PURE__*/function (_z12) {
|
|
7758
7765
|
n = Ze.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
|
7759
7766
|
return {
|
7760
7767
|
content: lt.getContent(r),
|
7761
|
-
role: r.role ===
|
7768
|
+
role: r.role === x.USER_ROLE ? "user" : "assistant"
|
7762
7769
|
};
|
7763
7770
|
});
|
7764
7771
|
return t.find(function (r) {
|
@@ -7863,8 +7870,8 @@ var lt = /*#__PURE__*/function (_z12) {
|
|
7863
7870
|
break;
|
7864
7871
|
}
|
7865
7872
|
o.forEach(function (c, d) {
|
7866
|
-
var
|
7867
|
-
var u = (
|
7873
|
+
var h;
|
7874
|
+
var u = (h = e.tool_calls) == null ? void 0 : h[d];
|
7868
7875
|
n == null || n.messages.push({
|
7869
7876
|
role: "tool",
|
7870
7877
|
tool_call_id: u == null ? void 0 : u.id,
|
@@ -8152,20 +8159,20 @@ var mn = {
|
|
8152
8159
|
o = (i == null ? void 0 : i.html) || "<div>".concat(r, "</div>");
|
8153
8160
|
return setTimeout(function () {
|
8154
8161
|
var a;
|
8155
|
-
_this34._downloadButton = (a = e.children[0]) == null ? void 0 : a.getElementsByClassName(n)[0], _this34._downloadButton && (_this34._downloadButton.onclick = _this34.init.bind(_this34), _this34.
|
8162
|
+
_this34._downloadButton = (a = e.children[0]) == null ? void 0 : a.getElementsByClassName(n)[0], _this34._downloadButton && (_this34._downloadButton.onclick = _this34.init.bind(_this34), _this34.enableButton(_this34._downloadButton));
|
8156
8163
|
}), {
|
8157
|
-
role:
|
8164
|
+
role: x.AI_ROLE,
|
8158
8165
|
html: o,
|
8159
8166
|
sendUpdate: !1
|
8160
8167
|
};
|
8161
8168
|
}
|
8162
8169
|
}, {
|
8163
|
-
key: "
|
8164
|
-
value: function
|
8170
|
+
key: "enableButton",
|
8171
|
+
value: function enableButton(e) {
|
8165
8172
|
var _this35 = this;
|
8166
8173
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
8167
8174
|
window.webLLM ? e.disabled = !1 : t < T.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
|
8168
|
-
return _this35.
|
8175
|
+
return _this35.enableButton(e, t + 1);
|
8169
8176
|
}, 250);
|
8170
8177
|
}
|
8171
8178
|
}, {
|
@@ -8512,7 +8519,7 @@ var Do = /*#__PURE__*/function () {
|
|
8512
8519
|
if (t.azure.summarization) return new Ao(e);
|
8513
8520
|
if (t.azure.translation) return new Lo(e);
|
8514
8521
|
}
|
8515
|
-
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new
|
8522
|
+
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Ft(e) : t.stabilityAI.imageToImageUpscale ? new jt(e) : t.stabilityAI.imageToImageMasking ? new Bt(e) : new zt(e);
|
8516
8523
|
}
|
8517
8524
|
return i ? new Ie(e) : new Ie(e, void 0, n || !0);
|
8518
8525
|
}
|
@@ -8520,22 +8527,22 @@ var Do = /*#__PURE__*/function () {
|
|
8520
8527
|
return Do;
|
8521
8528
|
}();
|
8522
8529
|
var rs = /*#__PURE__*/function () {
|
8523
|
-
function
|
8524
|
-
_classCallCheck(this,
|
8530
|
+
function ji() {
|
8531
|
+
_classCallCheck(this, ji);
|
8525
8532
|
}
|
8526
|
-
_createClass(
|
8533
|
+
_createClass(ji, null, [{
|
8527
8534
|
key: "appendStyleSheetToHead",
|
8528
8535
|
value: function appendStyleSheetToHead() {
|
8529
8536
|
var e = document.getElementsByTagName("head")[0];
|
8530
8537
|
if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
|
8531
|
-
return i.getAttribute("href") ===
|
8538
|
+
return i.getAttribute("href") === ji.FONT_URL;
|
8532
8539
|
})) {
|
8533
8540
|
var i = document.createElement("link");
|
8534
|
-
i.rel = "stylesheet", i.href =
|
8541
|
+
i.rel = "stylesheet", i.href = ji.FONT_URL, e.appendChild(i);
|
8535
8542
|
}
|
8536
8543
|
}
|
8537
8544
|
}]);
|
8538
|
-
return
|
8545
|
+
return ji;
|
8539
8546
|
}();
|
8540
8547
|
rs.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
8541
8548
|
var jo = rs;
|
@@ -8562,7 +8569,7 @@ os.attibutes = {
|
|
8562
8569
|
return new Function("return ".concat(s))();
|
8563
8570
|
}
|
8564
8571
|
};
|
8565
|
-
function
|
8572
|
+
function v(s) {
|
8566
8573
|
return function (e, t) {
|
8567
8574
|
Object.defineProperty(e, t, {});
|
8568
8575
|
var i = e.constructor,
|
@@ -8594,21 +8601,21 @@ var Yi = /*#__PURE__*/function () {
|
|
8594
8601
|
}]);
|
8595
8602
|
return Yi;
|
8596
8603
|
}();
|
8597
|
-
var
|
8598
|
-
function
|
8599
|
-
_classCallCheck(this,
|
8604
|
+
var Ut = /*#__PURE__*/function () {
|
8605
|
+
function Ut(e, t, i) {
|
8606
|
+
_classCallCheck(this, Ut);
|
8600
8607
|
this._isDisplayed = !1, e ? (this._elementRef = this.createIntroPanelWithChild(e, i), this._isDisplayed = !0) : t && (this._elementRef = this.createInternalIntroPanel(t, i), this._isDisplayed = !0);
|
8601
8608
|
}
|
8602
|
-
_createClass(
|
8609
|
+
_createClass(Ut, [{
|
8603
8610
|
key: "createIntroPanelWithChild",
|
8604
8611
|
value: function createIntroPanelWithChild(e, t) {
|
8605
|
-
var i =
|
8612
|
+
var i = Ut.createIntroPanel(t);
|
8606
8613
|
return e.style.display === "none" && (e.style.display = "block"), i.appendChild(e), i;
|
8607
8614
|
}
|
8608
8615
|
}, {
|
8609
8616
|
key: "createInternalIntroPanel",
|
8610
8617
|
value: function createInternalIntroPanel(e, t) {
|
8611
|
-
var i =
|
8618
|
+
var i = Ut.createIntroPanel(t);
|
8612
8619
|
return i.id = "internal-intro-panel", i.innerHTML = e, i;
|
8613
8620
|
}
|
8614
8621
|
}, {
|
@@ -8628,7 +8635,7 @@ var qt = /*#__PURE__*/function () {
|
|
8628
8635
|
return t.classList.add("intro-panel"), Object.assign(t.style, e), t;
|
8629
8636
|
}
|
8630
8637
|
}]);
|
8631
|
-
return
|
8638
|
+
return Ut;
|
8632
8639
|
}();
|
8633
8640
|
var Bo = /*#__PURE__*/function () {
|
8634
8641
|
function Bo() {
|
@@ -8689,7 +8696,7 @@ var pe = /*#__PURE__*/function () {
|
|
8689
8696
|
key: "createAudioElement",
|
8690
8697
|
value: function createAudioElement(e, t) {
|
8691
8698
|
var i = document.createElement("audio");
|
8692
|
-
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, me.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t ===
|
8699
|
+
return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, me.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === x.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
|
8693
8700
|
}
|
8694
8701
|
}, {
|
8695
8702
|
key: "addNewAudioMessage",
|
@@ -8740,7 +8747,7 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8740
8747
|
var n = t.permittedErrorPrefixes,
|
8741
8748
|
r = t.introPanelMarkUp,
|
8742
8749
|
o = t.demo;
|
8743
|
-
_this37._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this37._onClearMessages =
|
8750
|
+
_this37._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this37._onClearMessages = Nt.onClearMessages.bind(_assertThisInitialized(_this37), e), _this37._onError = Nt.onError.bind(_assertThisInitialized(_this37), e), _this37._displayLoadingMessage = fe.getDisplayLoadingMessage(e, t), _this37._permittedErrorPrefixes = n, _this37.addSetupMessageIfNeeded(e, t), _this37.populateIntroPanel(i, r, e.introPanelStyle), _this37.addIntroductoryMessage(e, t), e.initialMessages && _this37.populateInitialMessages(e.initialMessages), _this37._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
8744
8751
|
return JSON.parse(JSON.stringify(_this37.messages));
|
8745
8752
|
}, e.clearMessages = _this37.clearMessages.bind(_assertThisInitialized(_this37), t), e.refreshMessages = _this37.refreshTextMessages.bind(_assertThisInitialized(_this37)), e.scrollToBottom = ne.scrollToBottom.bind(_assertThisInitialized(_this37), _this37.elementRef), e.addMessage = function (c, d) {
|
8746
8753
|
_this37.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
|
@@ -8761,8 +8768,8 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8761
8768
|
value: function addSetupMessageIfNeeded(e, t) {
|
8762
8769
|
var i = Bo.getText(e, t);
|
8763
8770
|
if (i) {
|
8764
|
-
var n = this.createAndAppendNewMessageElement(i,
|
8765
|
-
this.applyCustomStyles(n,
|
8771
|
+
var n = this.createAndAppendNewMessageElement(i, x.AI_ROLE);
|
8772
|
+
this.applyCustomStyles(n, x.AI_ROLE, !1);
|
8766
8773
|
}
|
8767
8774
|
}
|
8768
8775
|
}, {
|
@@ -8774,11 +8781,11 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8774
8781
|
var i = this._introMessage;
|
8775
8782
|
if (e && t != null && t.isWebModel() && ((_i10 = i) !== null && _i10 !== void 0 ? _i10 : i = t.getIntroMessage(e)), i) {
|
8776
8783
|
if (i != null && i.text) {
|
8777
|
-
var o = this.createAndAppendNewMessageElement(i.text,
|
8778
|
-
this.applyCustomStyles(o,
|
8784
|
+
var o = this.createAndAppendNewMessageElement(i.text, x.AI_ROLE);
|
8785
|
+
this.applyCustomStyles(o, x.AI_ROLE, !1, (n = this.messageStyles) == null ? void 0 : n.intro);
|
8779
8786
|
} else if (i != null && i.html) {
|
8780
|
-
var _o3 = Ye.add(this, i.html,
|
8781
|
-
this.applyCustomStyles(_o3,
|
8787
|
+
var _o3 = Ye.add(this, i.html, x.AI_ROLE, this.messageElementRefs);
|
8788
|
+
this.applyCustomStyles(_o3, x.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.intro);
|
8782
8789
|
}
|
8783
8790
|
}
|
8784
8791
|
}
|
@@ -8798,7 +8805,7 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8798
8805
|
value: function addNewMessage(e) {
|
8799
8806
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
8800
8807
|
var i = fe.createMessageContent(e);
|
8801
|
-
if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, e.overwrite), !t && this.textToSpeech && i.role !==
|
8808
|
+
if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, e.overwrite), !t && this.textToSpeech && i.role !== x.USER_ROLE && Lt.speak(i.text, this.textToSpeech)), i.files && Array.isArray(i.files) && pe.addMessages(this, i.files, i.role), i.html !== void 0 && i.html !== null) {
|
8802
8809
|
var n = Ye.add(this, i.html, i.role, this.messageElementRefs, e.overwrite);
|
8803
8810
|
ge.isElementTemporary(n) && delete i.html;
|
8804
8811
|
}
|
@@ -8823,7 +8830,7 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8823
8830
|
}, {
|
8824
8831
|
key: "addNewErrorMessage",
|
8825
8832
|
value: function addNewErrorMessage(e, t) {
|
8826
|
-
var l, c, d, u;
|
8833
|
+
var l, c, d, u, h;
|
8827
8834
|
this.removeMessageOnError();
|
8828
8835
|
var i = fe.createBaseElements(),
|
8829
8836
|
n = i.outerContainer,
|
@@ -8832,7 +8839,7 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8832
8839
|
var o = this.getPermittedMessage(t) || ((l = this._errorMessageOverrides) == null ? void 0 : l[e]) || ((c = this._errorMessageOverrides) == null ? void 0 : c["default"]) || "Error, please try again.";
|
8833
8840
|
this.renderText(r, o);
|
8834
8841
|
var a = P.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
8835
|
-
P.applyCustomStylesToElements(i, !1, a), P.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), ne.scrollToBottom(this.elementRef), this.textToSpeech && Lt.speak(o, this.textToSpeech);
|
8842
|
+
P.applyCustomStylesToElements(i, !1, a), P.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), ne.scrollToBottom(this.elementRef), this.textToSpeech && Lt.speak(o, this.textToSpeech), (h = this._onError) == null || h.call(this, o);
|
8836
8843
|
}
|
8837
8844
|
}, {
|
8838
8845
|
key: "getPermittedMessage",
|
@@ -8852,29 +8859,29 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8852
8859
|
key: "isLastMessageError",
|
8853
8860
|
value: function isLastMessageError() {
|
8854
8861
|
var e;
|
8855
|
-
return (e =
|
8862
|
+
return (e = x.getLastMessageBubbleElement(this.elementRef)) == null ? void 0 : e.classList.contains("error-message-text");
|
8856
8863
|
}
|
8857
8864
|
}, {
|
8858
8865
|
key: "removeError",
|
8859
8866
|
value: function removeError() {
|
8860
|
-
this.isLastMessageError() &&
|
8867
|
+
this.isLastMessageError() && x.getLastMessageElement(this.elementRef).remove();
|
8861
8868
|
}
|
8862
8869
|
}, {
|
8863
8870
|
key: "addLoadingMessage",
|
8864
8871
|
value: function addLoadingMessage() {
|
8865
8872
|
var r;
|
8866
8873
|
if (!this._displayLoadingMessage) return;
|
8867
|
-
var e = this.createMessageElements("",
|
8874
|
+
var e = this.createMessageElements("", x.AI_ROLE),
|
8868
8875
|
t = e.outerContainer,
|
8869
8876
|
i = e.bubbleElement;
|
8870
8877
|
i.classList.add("loading-message-text");
|
8871
8878
|
var n = document.createElement("div");
|
8872
|
-
n.classList.add("dots-flashing"), i.appendChild(n), this.applyCustomStyles(e,
|
8879
|
+
n.classList.add("dots-flashing"), i.appendChild(n), this.applyCustomStyles(e, x.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), Yi.set(i, this.messageStyles), this.elementRef.appendChild(t), ne.scrollToBottom(this.elementRef);
|
8873
8880
|
}
|
8874
8881
|
}, {
|
8875
8882
|
key: "populateIntroPanel",
|
8876
8883
|
value: function populateIntroPanel(e, t, i) {
|
8877
|
-
(e || t) && (this._introPanel = new
|
8884
|
+
(e || t) && (this._introPanel = new Ut(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
8878
8885
|
}
|
8879
8886
|
}, {
|
8880
8887
|
key: "addMultipleFiles",
|
@@ -8925,7 +8932,6 @@ var fe = /*#__PURE__*/function (_We) {
|
|
8925
8932
|
key: "clearMessages",
|
8926
8933
|
value: function clearMessages(e, t) {
|
8927
8934
|
var n, r;
|
8928
|
-
console.log("messages cleared");
|
8929
8935
|
var i = [];
|
8930
8936
|
this.messageElementRefs.forEach(function (o) {
|
8931
8937
|
var a = o.bubbleElement.classList;
|
@@ -9484,7 +9490,7 @@ var de = /*#__PURE__*/function () {
|
|
9484
9490
|
var r = de.createImageAttachment(t);
|
9485
9491
|
this.addFileAttachment(e, "image", r, i);
|
9486
9492
|
} else if (n === "audio") {
|
9487
|
-
var _r2 =
|
9493
|
+
var _r2 = Bi.createAudioAttachment(t);
|
9488
9494
|
this.addFileAttachment(e, "audio", _r2, i);
|
9489
9495
|
} else {
|
9490
9496
|
var _r3 = de.createAnyFileAttachment(e.name);
|
@@ -9525,7 +9531,7 @@ var de = /*#__PURE__*/function () {
|
|
9525
9531
|
return r === e;
|
9526
9532
|
}),
|
9527
9533
|
i = this._attachments[t].attachmentContainerElement;
|
9528
|
-
this._attachments.splice(t, 1),
|
9534
|
+
this._attachments.splice(t, 1), Bi.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (n = this._validationHandler) == null || n.call(this);
|
9529
9535
|
}
|
9530
9536
|
}, {
|
9531
9537
|
key: "getFiles",
|
@@ -9713,7 +9719,7 @@ var Ko = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9713
9719
|
return Se;
|
9714
9720
|
}(de);
|
9715
9721
|
as.TIMER_LIMIT_S = 5999;
|
9716
|
-
var
|
9722
|
+
var Bi = as;
|
9717
9723
|
var Jo = /*#__PURE__*/function () {
|
9718
9724
|
function Jo() {
|
9719
9725
|
_classCallCheck(this, Jo);
|
@@ -9723,7 +9729,7 @@ var Jo = /*#__PURE__*/function () {
|
|
9723
9729
|
value:
|
9724
9730
|
// prettier-ignore
|
9725
9731
|
function create(e, t, i, n, r) {
|
9726
|
-
return r === "audio" ? new
|
9732
|
+
return r === "audio" ? new Bi(e, t, i, n) : new de(e, t, i, n);
|
9727
9733
|
}
|
9728
9734
|
}]);
|
9729
9735
|
return Jo;
|
@@ -9946,10 +9952,10 @@ var ct = /*#__PURE__*/function (_xt2) {
|
|
9946
9952
|
function ct(e, t, i, n, r, o) {
|
9947
9953
|
var _this50;
|
9948
9954
|
_classCallCheck(this, ct);
|
9949
|
-
var l, c, d, u,
|
9955
|
+
var l, c, d, u, h, p;
|
9950
9956
|
_this50 = _super39.call(this, ct.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
|
9951
9957
|
var a = _this50.createInnerElements(n, r, _this50._customStyles);
|
9952
|
-
_this50._inputElement = ct.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this50.addClickEvent(e, i), _this50.elementRef.replaceChildren(a.styles), _this50.reapplyStateStyle("styles"), _this50._fileAttachmentsType = t, _this50._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (
|
9958
|
+
_this50._inputElement = ct.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this50.addClickEvent(e, i), _this50.elementRef.replaceChildren(a.styles), _this50.reapplyStateStyle("styles"), _this50._fileAttachmentsType = t, _this50._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (p = (h = i.files) == null ? void 0 : h.infoModal) == null ? void 0 : p.openModalOnce;
|
9953
9959
|
return _this50;
|
9954
9960
|
}
|
9955
9961
|
_createClass(ct, [{
|
@@ -10242,8 +10248,8 @@ var mt = /*#__PURE__*/function (_xt3) {
|
|
10242
10248
|
return mt;
|
10243
10249
|
}(xt);
|
10244
10250
|
var cs = {},
|
10245
|
-
ii = {},
|
10246
10251
|
ni = {},
|
10252
|
+
si = {},
|
10247
10253
|
St = {},
|
10248
10254
|
De = {};
|
10249
10255
|
Object.defineProperty(De, "__esModule", {
|
@@ -10304,10 +10310,10 @@ var Zo = /*#__PURE__*/function () {
|
|
10304
10310
|
return Zo;
|
10305
10311
|
}();
|
10306
10312
|
St.Translate = Zo;
|
10307
|
-
Object.defineProperty(
|
10313
|
+
Object.defineProperty(si, "__esModule", {
|
10308
10314
|
value: !0
|
10309
10315
|
});
|
10310
|
-
|
10316
|
+
si.WebSpeechTranscript = void 0;
|
10311
10317
|
var vn = St;
|
10312
10318
|
var Xo = /*#__PURE__*/function () {
|
10313
10319
|
function Xo() {
|
@@ -10345,7 +10351,7 @@ var Xo = /*#__PURE__*/function () {
|
|
10345
10351
|
}]);
|
10346
10352
|
return Xo;
|
10347
10353
|
}();
|
10348
|
-
|
10354
|
+
si.WebSpeechTranscript = Xo;
|
10349
10355
|
var Qe = {};
|
10350
10356
|
Object.defineProperty(Qe, "__esModule", {
|
10351
10357
|
value: !0
|
@@ -10359,11 +10365,11 @@ ot.IS_SAFARI = function () {
|
|
10359
10365
|
return ot._IS_SAFARI === void 0 && (ot._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), ot._IS_SAFARI;
|
10360
10366
|
};
|
10361
10367
|
var wt = {},
|
10362
|
-
|
10363
|
-
Object.defineProperty(
|
10368
|
+
ri = {};
|
10369
|
+
Object.defineProperty(ri, "__esModule", {
|
10364
10370
|
value: !0
|
10365
10371
|
});
|
10366
|
-
|
10372
|
+
ri.EventListeners = void 0;
|
10367
10373
|
var J = /*#__PURE__*/function () {
|
10368
10374
|
function J() {
|
10369
10375
|
_classCallCheck(this, J);
|
@@ -10407,13 +10413,13 @@ var J = /*#__PURE__*/function () {
|
|
10407
10413
|
}]);
|
10408
10414
|
return J;
|
10409
10415
|
}();
|
10410
|
-
|
10416
|
+
ri.EventListeners = J;
|
10411
10417
|
J.KEY_DOWN_TIMEOUT = null;
|
10412
|
-
var
|
10413
|
-
Object.defineProperty(
|
10418
|
+
var oi = {};
|
10419
|
+
Object.defineProperty(oi, "__esModule", {
|
10414
10420
|
value: !0
|
10415
10421
|
});
|
10416
|
-
|
10422
|
+
oi.PreResultUtils = void 0;
|
10417
10423
|
var Qo = /*#__PURE__*/function () {
|
10418
10424
|
function Qo() {
|
10419
10425
|
_classCallCheck(this, Qo);
|
@@ -10429,7 +10435,7 @@ var Qo = /*#__PURE__*/function () {
|
|
10429
10435
|
}]);
|
10430
10436
|
return Qo;
|
10431
10437
|
}();
|
10432
|
-
|
10438
|
+
oi.PreResultUtils = Qo;
|
10433
10439
|
var _t = {},
|
10434
10440
|
Mt = {};
|
10435
10441
|
Object.defineProperty(Mt, "__esModule", {
|
@@ -10685,31 +10691,31 @@ var K = /*#__PURE__*/function () {
|
|
10685
10691
|
if (!c || !n || !i) return;
|
10686
10692
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
10687
10693
|
u = En.Text.breakupIntoWordsArr(d),
|
10688
|
-
|
10689
|
-
if (c.commandMode &&
|
10694
|
+
h = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? K.checkIfMatchesWord : K.checkIfMatchesSubstring;
|
10695
|
+
if (c.commandMode && h(c.commandMode, d, u)) return e.setInterimColorToFinal(), setTimeout(function () {
|
10690
10696
|
return K.toggleCommandModeOn(e);
|
10691
10697
|
}), {
|
10692
10698
|
doNotProcessTranscription: !1
|
10693
10699
|
};
|
10694
10700
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
10695
|
-
if (c.stop &&
|
10701
|
+
if (c.stop && h(c.stop, d, u)) return K.toggleCommandModeOff(e), setTimeout(function () {
|
10696
10702
|
return e.stop();
|
10697
10703
|
}), {
|
10698
10704
|
doNotProcessTranscription: !1
|
10699
10705
|
};
|
10700
|
-
if (c.pause &&
|
10701
|
-
var
|
10702
|
-
e.isPaused = !0, (
|
10706
|
+
if (c.pause && h(c.pause, d, u)) return K.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
10707
|
+
var p;
|
10708
|
+
e.isPaused = !0, (p = e.onPauseTrigger) === null || p === void 0 || p.call(e, !0);
|
10703
10709
|
}), {
|
10704
10710
|
doNotProcessTranscription: !1
|
10705
10711
|
};
|
10706
|
-
if (c.resume &&
|
10712
|
+
if (c.resume && h(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), K.toggleCommandModeOff(e), e.resetRecording(i), {
|
10707
10713
|
doNotProcessTranscription: !0
|
10708
10714
|
};
|
10709
|
-
if (c.reset &&
|
10715
|
+
if (c.reset && h(c.reset, d, u)) return r !== void 0 && K.setText(e, i, r, n), {
|
10710
10716
|
doNotProcessTranscription: !0
|
10711
10717
|
};
|
10712
|
-
if (c.removeAllText &&
|
10718
|
+
if (c.removeAllText && h(c.removeAllText, d, u)) return K.setText(e, i, "", n), {
|
10713
10719
|
doNotProcessTranscription: !0
|
10714
10720
|
};
|
10715
10721
|
}
|
@@ -10718,18 +10724,18 @@ var K = /*#__PURE__*/function () {
|
|
10718
10724
|
return K;
|
10719
10725
|
}();
|
10720
10726
|
_t.CommandUtils = K;
|
10721
|
-
var
|
10722
|
-
Object.defineProperty(
|
10727
|
+
var ai = {};
|
10728
|
+
Object.defineProperty(ai, "__esModule", {
|
10723
10729
|
value: !0
|
10724
10730
|
});
|
10725
|
-
|
10731
|
+
ai.Highlight = void 0;
|
10726
10732
|
var na = je,
|
10727
10733
|
et = Be;
|
10728
|
-
var
|
10729
|
-
function
|
10730
|
-
_classCallCheck(this,
|
10734
|
+
var Ht = /*#__PURE__*/function () {
|
10735
|
+
function Ht() {
|
10736
|
+
_classCallCheck(this, Ht);
|
10731
10737
|
}
|
10732
|
-
_createClass(
|
10738
|
+
_createClass(Ht, null, [{
|
10733
10739
|
key: "setStateForPrimitive",
|
10734
10740
|
value: function setStateForPrimitive(e, t) {
|
10735
10741
|
var i, n;
|
@@ -10748,7 +10754,7 @@ var Ut = /*#__PURE__*/function () {
|
|
10748
10754
|
}, {
|
10749
10755
|
key: "setState",
|
10750
10756
|
value: function setState(e, t) {
|
10751
|
-
document.activeElement === t && (na.Elements.isPrimitiveElement(t) ?
|
10757
|
+
document.activeElement === t && (na.Elements.isPrimitiveElement(t) ? Ht.setStateForPrimitive(e, t) : Ht.setStateForGeneric(e, t));
|
10752
10758
|
}
|
10753
10759
|
}, {
|
10754
10760
|
key: "removeForGeneric",
|
@@ -10772,22 +10778,22 @@ var Ut = /*#__PURE__*/function () {
|
|
10772
10778
|
e.isHighlighted = !1;
|
10773
10779
|
}
|
10774
10780
|
}]);
|
10775
|
-
return
|
10781
|
+
return Ht;
|
10776
10782
|
}();
|
10777
|
-
|
10778
|
-
var
|
10779
|
-
Object.defineProperty(
|
10783
|
+
ai.Highlight = Ht;
|
10784
|
+
var li = {};
|
10785
|
+
Object.defineProperty(li, "__esModule", {
|
10780
10786
|
value: !0
|
10781
10787
|
});
|
10782
|
-
|
10788
|
+
li.Padding = void 0;
|
10783
10789
|
var sa = je,
|
10784
10790
|
Sn = Be,
|
10785
10791
|
ze = De;
|
10786
|
-
var
|
10787
|
-
function
|
10788
|
-
_classCallCheck(this,
|
10792
|
+
var Gt = /*#__PURE__*/function () {
|
10793
|
+
function Gt() {
|
10794
|
+
_classCallCheck(this, Gt);
|
10789
10795
|
}
|
10790
|
-
_createClass(
|
10796
|
+
_createClass(Gt, null, [{
|
10791
10797
|
key: "setStateForPrimitiveElement",
|
10792
10798
|
value: function setStateForPrimitiveElement(e, t) {
|
10793
10799
|
if (document.activeElement === t && t.selectionStart !== null) {
|
@@ -10822,7 +10828,7 @@ var Ht = /*#__PURE__*/function () {
|
|
10822
10828
|
}, {
|
10823
10829
|
key: "setState",
|
10824
10830
|
value: function setState(e, t) {
|
10825
|
-
sa.Elements.isPrimitiveElement(t) ?
|
10831
|
+
sa.Elements.isPrimitiveElement(t) ? Gt.setStateForPrimitiveElement(e, t) : Gt.setStateForGenericElement(e, t);
|
10826
10832
|
}
|
10827
10833
|
}, {
|
10828
10834
|
key: "adjustStateAfterRecodingPrimitiveElement",
|
@@ -10839,23 +10845,23 @@ var Ht = /*#__PURE__*/function () {
|
|
10839
10845
|
e.numberOfSpacesBeforeNewText === 1 && (e.startPadding = e.startPadding.substring(0, e.startPadding.length - 1), e.numberOfSpacesBeforeNewText = 0), e.numberOfSpacesAfterNewText === 1 && (e.endPadding = e.endPadding.substring(1), e.numberOfSpacesAfterNewText = 0);
|
10840
10846
|
}
|
10841
10847
|
}]);
|
10842
|
-
return
|
10848
|
+
return Gt;
|
10843
10849
|
}();
|
10844
|
-
|
10850
|
+
li.Padding = Gt;
|
10845
10851
|
Object.defineProperty(wt, "__esModule", {
|
10846
10852
|
value: !0
|
10847
10853
|
});
|
10848
10854
|
wt.Speech = void 0;
|
10849
|
-
var wn =
|
10850
|
-
ra =
|
10855
|
+
var wn = ri,
|
10856
|
+
ra = oi,
|
10851
10857
|
_n = _t,
|
10852
10858
|
kt = Mt,
|
10853
|
-
Si = oi,
|
10854
|
-
te = je,
|
10855
10859
|
wi = ai,
|
10860
|
+
te = je,
|
10861
|
+
_i = li,
|
10856
10862
|
Mn = Qe,
|
10857
10863
|
Tn = Be,
|
10858
|
-
|
10864
|
+
Mi = De;
|
10859
10865
|
var oa = /*#__PURE__*/function () {
|
10860
10866
|
function oa() {
|
10861
10867
|
_classCallCheck(this, oa);
|
@@ -10877,7 +10883,7 @@ var oa = /*#__PURE__*/function () {
|
|
10877
10883
|
}, {
|
10878
10884
|
key: "prepare",
|
10879
10885
|
value: function prepare(e) {
|
10880
|
-
|
10886
|
+
_i.Padding.setState(this, e), wi.Highlight.setState(this, e), this.isTargetInShadow = te.Elements.isInsideShadowDOM(e), te.Elements.isPrimitiveElement(e) ? (this._primitiveElement = e, this._originalText = this._primitiveElement.value) : (this._genericElement = e, this._originalText = this._genericElement.textContent);
|
10881
10887
|
}
|
10882
10888
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
10883
10889
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -10892,7 +10898,7 @@ var oa = /*#__PURE__*/function () {
|
|
10892
10898
|
key: "updateElements",
|
10893
10899
|
value: function updateElements(e, t, i) {
|
10894
10900
|
var n;
|
10895
|
-
var r =
|
10901
|
+
var r = Mi.Text.capitalize(t);
|
10896
10902
|
if (this.finalTranscript === r && e === "") return;
|
10897
10903
|
ra.PreResultUtils.process(this, i, e === "", this._onPreResult, this._options) && (e = "", i = "");
|
10898
10904
|
var o = this.commands && _n.CommandUtils.execCommand(this, i, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
@@ -10910,7 +10916,7 @@ var oa = /*#__PURE__*/function () {
|
|
10910
10916
|
}, {
|
10911
10917
|
key: "updatePrimitiveElement",
|
10912
10918
|
value: function updatePrimitiveElement(e, t, i) {
|
10913
|
-
this.isHighlighted &&
|
10919
|
+
this.isHighlighted && wi.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || _i.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), i && _i.Padding.adjustSateForNoTextPrimitiveElement(this);
|
10914
10920
|
var n = this.startPadding + this.finalTranscript + t;
|
10915
10921
|
if (e.value = n + this.endPadding, !this.isTargetInShadow) {
|
10916
10922
|
var r = n.length + this.numberOfSpacesAfterNewText;
|
@@ -10921,12 +10927,12 @@ var oa = /*#__PURE__*/function () {
|
|
10921
10927
|
}, {
|
10922
10928
|
key: "updateGenericElement",
|
10923
10929
|
value: function updateGenericElement(e, t, i) {
|
10924
|
-
this.isHighlighted &&
|
10925
|
-
var n = (i ? "" : this.startPadding) +
|
10930
|
+
this.isHighlighted && wi.Highlight.removeForGeneric(this, e), this.spansPopulated || te.Elements.appendSpans(this, e);
|
10931
|
+
var n = (i ? "" : this.startPadding) + Mi.Text.lineBreak(this.finalTranscript);
|
10926
10932
|
this.finalSpan.innerHTML = n;
|
10927
10933
|
var r = kt.AutoScroll.isRequired(this.autoScroll, e);
|
10928
10934
|
kt.AutoScroll.changeStateIfNeeded(this, r);
|
10929
|
-
var o =
|
10935
|
+
var o = Mi.Text.lineBreak(t) + (i ? "" : this.endPadding);
|
10930
10936
|
this.interimSpan.innerHTML = o, Mn.Browser.IS_SAFARI() && this.insertInCursorLocation && Tn.Cursor.setOffsetForSafariGeneric(e, n.length + o.length), r && kt.AutoScroll.scrollGeneric(this, e), i && (this.scrollingSpan.innerHTML = "");
|
10931
10937
|
}
|
10932
10938
|
}, {
|
@@ -10966,21 +10972,21 @@ var oa = /*#__PURE__*/function () {
|
|
10966
10972
|
return oa;
|
10967
10973
|
}();
|
10968
10974
|
wt.Speech = oa;
|
10969
|
-
Object.defineProperty(
|
10975
|
+
Object.defineProperty(ni, "__esModule", {
|
10970
10976
|
value: !0
|
10971
10977
|
});
|
10972
|
-
|
10973
|
-
var Cn =
|
10978
|
+
ni.WebSpeech = void 0;
|
10979
|
+
var Cn = si,
|
10974
10980
|
An = Qe,
|
10975
10981
|
aa = wt;
|
10976
|
-
var
|
10977
|
-
_inherits(
|
10978
|
-
var _super41 = _createSuper(
|
10979
|
-
function
|
10980
|
-
_classCallCheck(this,
|
10982
|
+
var Vt = /*#__PURE__*/function (_aa$Speech) {
|
10983
|
+
_inherits(Vt, _aa$Speech);
|
10984
|
+
var _super41 = _createSuper(Vt);
|
10985
|
+
function Vt() {
|
10986
|
+
_classCallCheck(this, Vt);
|
10981
10987
|
return _super41.call(this);
|
10982
10988
|
}
|
10983
|
-
_createClass(
|
10989
|
+
_createClass(Vt, [{
|
10984
10990
|
key: "start",
|
10985
10991
|
value: function start(e) {
|
10986
10992
|
var t;
|
@@ -10989,13 +10995,13 @@ var Gt = /*#__PURE__*/function (_aa$Speech) {
|
|
10989
10995
|
}, {
|
10990
10996
|
key: "validate",
|
10991
10997
|
value: function validate() {
|
10992
|
-
return
|
10998
|
+
return Vt.getAPI() ? !0 : (this.error("Speech Recognition is unsupported"), !1);
|
10993
10999
|
}
|
10994
11000
|
}, {
|
10995
11001
|
key: "instantiateService",
|
10996
11002
|
value: function instantiateService(e) {
|
10997
11003
|
var t, i;
|
10998
|
-
var n =
|
11004
|
+
var n = Vt.getAPI();
|
10999
11005
|
this._service = new n(), this._service.continuous = !0, this._service.interimResults = (t = e == null ? void 0 : e.displayInterimResults) !== null && t !== void 0 ? t : !0, this._service.lang = ((i = e == null ? void 0 : e.language) === null || i === void 0 ? void 0 : i.trim()) || "en-US", this.setEvents();
|
11000
11006
|
}
|
11001
11007
|
}, {
|
@@ -11037,14 +11043,14 @@ var Gt = /*#__PURE__*/function (_aa$Speech) {
|
|
11037
11043
|
return window.webkitSpeechRecognition || window.SpeechRecognition;
|
11038
11044
|
}
|
11039
11045
|
}]);
|
11040
|
-
return
|
11046
|
+
return Vt;
|
11041
11047
|
}(aa.Speech);
|
11042
|
-
|
11043
|
-
var
|
11044
|
-
Object.defineProperty(
|
11048
|
+
ni.WebSpeech = Vt;
|
11049
|
+
var ci = {};
|
11050
|
+
Object.defineProperty(ci, "__esModule", {
|
11045
11051
|
value: !0
|
11046
11052
|
});
|
11047
|
-
|
11053
|
+
ci.GlobalState = void 0;
|
11048
11054
|
var Je = /*#__PURE__*/function () {
|
11049
11055
|
function Je() {
|
11050
11056
|
_classCallCheck(this, Je);
|
@@ -11059,14 +11065,14 @@ var Je = /*#__PURE__*/function () {
|
|
11059
11065
|
}]);
|
11060
11066
|
return Je;
|
11061
11067
|
}();
|
11062
|
-
|
11068
|
+
ci.GlobalState = Je;
|
11063
11069
|
Je.doubleClickPending = !1;
|
11064
|
-
var
|
11065
|
-
|
11066
|
-
Object.defineProperty(
|
11070
|
+
var di = {},
|
11071
|
+
ui = {};
|
11072
|
+
Object.defineProperty(ui, "__esModule", {
|
11067
11073
|
value: !0
|
11068
11074
|
});
|
11069
|
-
|
11075
|
+
ui.PreventConnectionStop = void 0;
|
11070
11076
|
var la = /*#__PURE__*/function () {
|
11071
11077
|
function la() {
|
11072
11078
|
_classCallCheck(this, la);
|
@@ -11086,27 +11092,27 @@ var la = /*#__PURE__*/function () {
|
|
11086
11092
|
}]);
|
11087
11093
|
return la;
|
11088
11094
|
}();
|
11089
|
-
|
11090
|
-
var
|
11091
|
-
|
11092
|
-
Object.defineProperty(
|
11095
|
+
ui.PreventConnectionStop = la;
|
11096
|
+
var hi = {},
|
11097
|
+
pi = {};
|
11098
|
+
Object.defineProperty(pi, "__esModule", {
|
11093
11099
|
value: !0
|
11094
11100
|
});
|
11095
|
-
|
11096
|
-
|
11097
|
-
Object.defineProperty(
|
11101
|
+
pi.README_URL = void 0;
|
11102
|
+
pi.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element";
|
11103
|
+
Object.defineProperty(hi, "__esModule", {
|
11098
11104
|
value: !0
|
11099
11105
|
});
|
11100
|
-
|
11101
|
-
var
|
11102
|
-
var
|
11103
|
-
function
|
11104
|
-
_classCallCheck(this,
|
11106
|
+
hi.AzureSpeechConfig = void 0;
|
11107
|
+
var Ti = pi;
|
11108
|
+
var Wt = /*#__PURE__*/function () {
|
11109
|
+
function Wt() {
|
11110
|
+
_classCallCheck(this, Wt);
|
11105
11111
|
}
|
11106
|
-
_createClass(
|
11112
|
+
_createClass(Wt, null, [{
|
11107
11113
|
key: "validateOptions",
|
11108
11114
|
value: function validateOptions(e, t) {
|
11109
|
-
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(
|
11115
|
+
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(Ti.README_URL)), !1) : t.region ? !0 : (e("Please define a 'region' property - more info: ".concat(Ti.README_URL)), !1) : (e("Please provide subscription details - more info: ".concat(Ti.README_URL)), !1);
|
11110
11116
|
}
|
11111
11117
|
}, {
|
11112
11118
|
key: "getNewSpeechConfig",
|
@@ -11149,10 +11155,10 @@ var Vt = /*#__PURE__*/function () {
|
|
11149
11155
|
while (1) switch (_context92.prev = _context92.next) {
|
11150
11156
|
case 0:
|
11151
11157
|
_context92.next = 2;
|
11152
|
-
return
|
11158
|
+
return Wt.getNewSpeechConfig(e, t);
|
11153
11159
|
case 2:
|
11154
11160
|
i = _context92.sent;
|
11155
|
-
return _context92.abrupt("return", (i &&
|
11161
|
+
return _context92.abrupt("return", (i && Wt.process(i, t), i));
|
11156
11162
|
case 4:
|
11157
11163
|
case "end":
|
11158
11164
|
return _context92.stop();
|
@@ -11165,14 +11171,14 @@ var Vt = /*#__PURE__*/function () {
|
|
11165
11171
|
return get;
|
11166
11172
|
}()
|
11167
11173
|
}]);
|
11168
|
-
return
|
11174
|
+
return Wt;
|
11169
11175
|
}();
|
11170
|
-
|
11171
|
-
var
|
11172
|
-
Object.defineProperty(
|
11176
|
+
hi.AzureSpeechConfig = Wt;
|
11177
|
+
var fi = {};
|
11178
|
+
Object.defineProperty(fi, "__esModule", {
|
11173
11179
|
value: !0
|
11174
11180
|
});
|
11175
|
-
|
11181
|
+
fi.StopTimeout = void 0;
|
11176
11182
|
var gt = /*#__PURE__*/function () {
|
11177
11183
|
function gt() {
|
11178
11184
|
_classCallCheck(this, gt);
|
@@ -11192,13 +11198,13 @@ var gt = /*#__PURE__*/function () {
|
|
11192
11198
|
}]);
|
11193
11199
|
return gt;
|
11194
11200
|
}();
|
11195
|
-
|
11201
|
+
fi.StopTimeout = gt;
|
11196
11202
|
gt.DEFAULT_MS = 2e4;
|
11197
|
-
var
|
11198
|
-
Object.defineProperty(
|
11203
|
+
var mi = {};
|
11204
|
+
Object.defineProperty(mi, "__esModule", {
|
11199
11205
|
value: !0
|
11200
11206
|
});
|
11201
|
-
|
11207
|
+
mi.AzureTranscript = void 0;
|
11202
11208
|
var ca = St;
|
11203
11209
|
var da = /*#__PURE__*/function () {
|
11204
11210
|
function da() {
|
@@ -11222,29 +11228,29 @@ var da = /*#__PURE__*/function () {
|
|
11222
11228
|
}]);
|
11223
11229
|
return da;
|
11224
11230
|
}();
|
11225
|
-
|
11226
|
-
Object.defineProperty(
|
11231
|
+
mi.AzureTranscript = da;
|
11232
|
+
Object.defineProperty(di, "__esModule", {
|
11227
11233
|
value: !0
|
11228
11234
|
});
|
11229
|
-
|
11230
|
-
var kn =
|
11231
|
-
In =
|
11232
|
-
|
11233
|
-
Ln =
|
11235
|
+
di.Azure = void 0;
|
11236
|
+
var kn = ui,
|
11237
|
+
In = hi,
|
11238
|
+
Ci = fi,
|
11239
|
+
Ln = mi,
|
11234
11240
|
ua = wt;
|
11235
|
-
var
|
11236
|
-
_inherits(
|
11237
|
-
var _super42 = _createSuper(
|
11238
|
-
function
|
11241
|
+
var Kt = /*#__PURE__*/function (_ua$Speech) {
|
11242
|
+
_inherits(Kt, _ua$Speech);
|
11243
|
+
var _super42 = _createSuper(Kt);
|
11244
|
+
function Kt() {
|
11239
11245
|
var _this54;
|
11240
|
-
_classCallCheck(this,
|
11246
|
+
_classCallCheck(this, Kt);
|
11241
11247
|
_this54 = _super42.apply(this, arguments), _this54._newTextPadding = "";
|
11242
11248
|
return _this54;
|
11243
11249
|
}
|
11244
|
-
_createClass(
|
11250
|
+
_createClass(Kt, [{
|
11245
11251
|
key: "start",
|
11246
11252
|
value: function start(e, t) {
|
11247
|
-
this._newTextPadding = "", this.stopTimeout === void 0 &&
|
11253
|
+
this._newTextPadding = "", this.stopTimeout === void 0 && Ci.StopTimeout.reset(this, e == null ? void 0 : e.stopAfterSilenceMs), this.prepareBeforeStart(e), this.startAsync(e), t || kn.PreventConnectionStop.applyPrevention(this);
|
11248
11254
|
}
|
11249
11255
|
}, {
|
11250
11256
|
key: "startAsync",
|
@@ -11278,7 +11284,7 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11278
11284
|
}, {
|
11279
11285
|
key: "validate",
|
11280
11286
|
value: function validate(e) {
|
11281
|
-
return
|
11287
|
+
return Kt.getAPI() ? In.AzureSpeechConfig.validateOptions(this.error.bind(this), e) : (this.moduleNotFound(), !1);
|
11282
11288
|
}
|
11283
11289
|
}, {
|
11284
11290
|
key: "instantiateService",
|
@@ -11288,7 +11294,7 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11288
11294
|
return _regeneratorRuntime().wrap(function _callee94$(_context94) {
|
11289
11295
|
while (1) switch (_context94.prev = _context94.next) {
|
11290
11296
|
case 0:
|
11291
|
-
t =
|
11297
|
+
t = Kt.getAPI();
|
11292
11298
|
i = t.AudioConfig.fromDefaultMicrophoneInput();
|
11293
11299
|
_context94.next = 4;
|
11294
11300
|
return In.AzureSpeechConfig.get(t.SpeechConfig, e);
|
@@ -11323,7 +11329,7 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11323
11329
|
i = _Ln$AzureTranscript$e.interimTranscript,
|
11324
11330
|
n = _Ln$AzureTranscript$e.finalTranscript,
|
11325
11331
|
r = _Ln$AzureTranscript$e.newText;
|
11326
|
-
|
11332
|
+
Ci.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, n, r);
|
11327
11333
|
}
|
11328
11334
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
11329
11335
|
// function onRecognized(sender, recognitionEventArgs) {
|
@@ -11344,7 +11350,7 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11344
11350
|
n = _Ln$AzureTranscript$e2.interimTranscript,
|
11345
11351
|
r = _Ln$AzureTranscript$e2.finalTranscript,
|
11346
11352
|
o = _Ln$AzureTranscript$e2.newText;
|
11347
|
-
|
11353
|
+
Ci.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(n, r, o), r !== "" && (this._newTextPadding = " ");
|
11348
11354
|
}
|
11349
11355
|
break;
|
11350
11356
|
}
|
@@ -11398,16 +11404,16 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11398
11404
|
return window.SpeechSDK;
|
11399
11405
|
}
|
11400
11406
|
}]);
|
11401
|
-
return
|
11407
|
+
return Kt;
|
11402
11408
|
}(ua.Speech);
|
11403
|
-
|
11409
|
+
di.Azure = Kt;
|
11404
11410
|
Object.defineProperty(cs, "__esModule", {
|
11405
11411
|
value: !0
|
11406
11412
|
});
|
11407
|
-
var Rn =
|
11413
|
+
var Rn = ni,
|
11408
11414
|
ha = _t,
|
11409
|
-
Z =
|
11410
|
-
pa =
|
11415
|
+
Z = ci,
|
11416
|
+
pa = di;
|
11411
11417
|
var Ve = /*#__PURE__*/function () {
|
11412
11418
|
function Ve() {
|
11413
11419
|
_classCallCheck(this, Ve);
|
@@ -11449,29 +11455,29 @@ var Ve = /*#__PURE__*/function () {
|
|
11449
11455
|
}]);
|
11450
11456
|
return Ve;
|
11451
11457
|
}();
|
11452
|
-
var
|
11453
|
-
var
|
11454
|
-
_inherits(
|
11455
|
-
var _super43 = _createSuper(
|
11456
|
-
function
|
11458
|
+
var Ai = cs["default"] = Ve;
|
11459
|
+
var Jt = /*#__PURE__*/function (_mt) {
|
11460
|
+
_inherits(Jt, _mt);
|
11461
|
+
var _super43 = _createSuper(Jt);
|
11462
|
+
function Jt(e, t, i) {
|
11457
11463
|
var _this56;
|
11458
|
-
_classCallCheck(this,
|
11464
|
+
_classCallCheck(this, Jt);
|
11459
11465
|
var o;
|
11460
11466
|
_this56 = _super43.call(this, _typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {});
|
11461
|
-
var
|
11462
|
-
n =
|
11463
|
-
r =
|
11464
|
-
if (_this56._addErrorMessage = i, n === "webspeech" && !
|
11467
|
+
var _Jt$processConfigurat = Jt.processConfiguration(t, e.speechToText),
|
11468
|
+
n = _Jt$processConfigurat.serviceName,
|
11469
|
+
r = _Jt$processConfigurat.processedConfig;
|
11470
|
+
if (_this56._addErrorMessage = i, n === "webspeech" && !Ai.isWebSpeechSupported()) _this56.changeToUnsupported();else {
|
11465
11471
|
var a = !e.textInput || !e.textInput.disabled;
|
11466
11472
|
_this56.elementRef.onclick = _this56.buttonClick.bind(_assertThisInitialized(_this56), t, a, n, r);
|
11467
11473
|
}
|
11468
11474
|
return _this56;
|
11469
11475
|
}
|
11470
11476
|
// prettier-ignore
|
11471
|
-
_createClass(
|
11477
|
+
_createClass(Jt, [{
|
11472
11478
|
key: "buttonClick",
|
11473
11479
|
value: function buttonClick(e, t, i, n) {
|
11474
|
-
e.removeTextIfPlaceholder(),
|
11480
|
+
e.removeTextIfPlaceholder(), Ai.toggle(i, _objectSpread({
|
11475
11481
|
insertInCursorLocation: !1,
|
11476
11482
|
element: t ? e.inputElementRef : void 0,
|
11477
11483
|
onError: this.onError.bind(this),
|
@@ -11509,12 +11515,12 @@ var Kt = /*#__PURE__*/function (_mt) {
|
|
11509
11515
|
return d.toLowerCase().includes(a) ? (setTimeout(function () {
|
11510
11516
|
var u;
|
11511
11517
|
return (u = e.submit) == null ? void 0 : u.call(e);
|
11512
|
-
}),
|
11518
|
+
}), Ai.endCommandMode(), {
|
11513
11519
|
restart: !0,
|
11514
11520
|
removeNewText: !0
|
11515
11521
|
}) : null;
|
11516
11522
|
}), {
|
11517
|
-
serviceName:
|
11523
|
+
serviceName: Jt.getServiceName(i),
|
11518
11524
|
processedConfig: o
|
11519
11525
|
};
|
11520
11526
|
}
|
@@ -11524,7 +11530,7 @@ var Kt = /*#__PURE__*/function (_mt) {
|
|
11524
11530
|
return e.webSpeech ? "webspeech" : e.azure ? "azure" : "webspeech";
|
11525
11531
|
}
|
11526
11532
|
}]);
|
11527
|
-
return
|
11533
|
+
return Jt;
|
11528
11534
|
}(mt);
|
11529
11535
|
var ds = /*#__PURE__*/function () {
|
11530
11536
|
function ds() {
|
@@ -11674,7 +11680,7 @@ var Te = /*#__PURE__*/function () {
|
|
11674
11680
|
}]);
|
11675
11681
|
return Te;
|
11676
11682
|
}();
|
11677
|
-
var
|
11683
|
+
var gi = /*#__PURE__*/function (_xt4) {
|
11678
11684
|
_inherits(k, _xt4);
|
11679
11685
|
var _super45 = _createSuper(k);
|
11680
11686
|
// prettier-ignore
|
@@ -11839,7 +11845,7 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11839
11845
|
return this.addNewMessage(e);
|
11840
11846
|
case 10:
|
11841
11847
|
this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
|
11842
|
-
|
11848
|
+
Fi.clear(this._inputElementRef);
|
11843
11849
|
i = (o = e.files) == null ? void 0 : o.map(function (l) {
|
11844
11850
|
return l.file;
|
11845
11851
|
}), n = {
|
@@ -11871,7 +11877,7 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11871
11877
|
case 0:
|
11872
11878
|
e = _ref13.text, t = _ref13.files;
|
11873
11879
|
i = {
|
11874
|
-
role:
|
11880
|
+
role: x.USER_ROLE
|
11875
11881
|
};
|
11876
11882
|
e && (i.text = e);
|
11877
11883
|
_context98.t0 = t;
|
@@ -11960,10 +11966,10 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11960
11966
|
}]);
|
11961
11967
|
return k;
|
11962
11968
|
}(xt);
|
11963
|
-
|
11964
|
-
|
11965
|
-
|
11966
|
-
var ga =
|
11969
|
+
gi.SUBMIT_CLASS = "submit-button";
|
11970
|
+
gi.LOADING_CLASS = "loading-button";
|
11971
|
+
gi.DISABLED_CLASS = "disabled-button";
|
11972
|
+
var ga = gi;
|
11967
11973
|
var ba = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.1 14.313V5.396L24.158 8.34c-2.33-2.325-5.033-3.503-8.11-3.503C9.902 4.837 4.901 9.847 4.899 16c.001 6.152 5.003 11.158 11.15 11.16 4.276 0 9.369-2.227 10.836-8.478l.028-.122h-3.23l-.022.068c-1.078 3.242-4.138 5.421-7.613 5.421a8 8 0 0 1-5.691-2.359A7.993 7.993 0 0 1 8 16.001c0-4.438 3.611-8.049 8.05-8.049 2.069 0 3.638.58 5.924 2.573l-3.792 3.789H27.1z\"/>\n</svg>\n",
|
11968
11974
|
va = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
|
11969
11975
|
ya = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
|
@@ -12084,23 +12090,23 @@ var Xi = /*#__PURE__*/function (_rt) {
|
|
12084
12090
|
return Xi;
|
12085
12091
|
}(rt);
|
12086
12092
|
var Ea = "<?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>";
|
12087
|
-
var
|
12088
|
-
_inherits(
|
12089
|
-
var _super47 = _createSuper(
|
12090
|
-
function
|
12093
|
+
var Yt = /*#__PURE__*/function (_xt5) {
|
12094
|
+
_inherits(Yt, _xt5);
|
12095
|
+
var _super47 = _createSuper(Yt);
|
12096
|
+
function Yt(e, t, i) {
|
12091
12097
|
var _this67;
|
12092
|
-
_classCallCheck(this,
|
12098
|
+
_classCallCheck(this, Yt);
|
12093
12099
|
var r;
|
12094
|
-
_this67 = _super47.call(this,
|
12100
|
+
_this67 = _super47.call(this, Yt.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo");
|
12095
12101
|
var n = _this67.createInnerElements(_this67._customStyles);
|
12096
12102
|
i && _this67.addClickEvent(e, t, i.modalContainerStyle, i.files), _this67.elementRef.classList.add("upload-file-button"), _this67.elementRef.appendChild(n.styles), _this67.reapplyStateStyle("styles");
|
12097
12103
|
return _this67;
|
12098
12104
|
}
|
12099
|
-
_createClass(
|
12105
|
+
_createClass(Yt, [{
|
12100
12106
|
key: "createInnerElements",
|
12101
12107
|
value: function createInnerElements(e) {
|
12102
12108
|
return {
|
12103
|
-
styles: this.createInnerElement(
|
12109
|
+
styles: this.createInnerElement(Yt.createSVGIconElement(), "styles", e)
|
12104
12110
|
};
|
12105
12111
|
}
|
12106
12112
|
}, {
|
@@ -12129,18 +12135,18 @@ var Jt = /*#__PURE__*/function (_xt5) {
|
|
12129
12135
|
return e.id = "camera-icon", e;
|
12130
12136
|
}
|
12131
12137
|
}]);
|
12132
|
-
return
|
12138
|
+
return Yt;
|
12133
12139
|
}(xt);
|
12134
12140
|
var ut = /*#__PURE__*/function () {
|
12135
12141
|
// prettier-ignore
|
12136
12142
|
function ut(e, t, i, n) {
|
12137
12143
|
_classCallCheck(this, ut);
|
12138
12144
|
this.elementRef = ut.createPanelElement(e.inputAreaStyle);
|
12139
|
-
var r = new
|
12145
|
+
var r = new Fi(e, i),
|
12140
12146
|
o = {},
|
12141
12147
|
a = this.createFileUploadComponents(e, i, n, o);
|
12142
12148
|
e.speechToText && !o.microphone && (o.microphone = {
|
12143
|
-
button: new
|
12149
|
+
button: new Jt(e, r, t.addNewErrorMessage.bind(t))
|
12144
12150
|
});
|
12145
12151
|
var l = new ga(e, r.inputElementRef, t, i, a);
|
12146
12152
|
r.submit = l.submitFromInput.bind(l), _e.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
@@ -12157,7 +12163,7 @@ var ut = /*#__PURE__*/function () {
|
|
12157
12163
|
if (ut.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
|
12158
12164
|
var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
|
12159
12165
|
n.camera = {
|
12160
|
-
button: new
|
12166
|
+
button: new Yt(i, d, t.camera)
|
12161
12167
|
};
|
12162
12168
|
}
|
12163
12169
|
if ((l = t.recordAudio) != null && l.files) {
|
@@ -12186,10 +12192,10 @@ var ut = /*#__PURE__*/function () {
|
|
12186
12192
|
_Wo$a = Wo[a],
|
12187
12193
|
d = _Wo$a.id,
|
12188
12194
|
u = _Wo$a.svgString,
|
12189
|
-
|
12190
|
-
|
12195
|
+
h = _Wo$a.dropupText,
|
12196
|
+
p = new ct(n, c, l, d, u, h);
|
12191
12197
|
r[a] = {
|
12192
|
-
button:
|
12198
|
+
button: p,
|
12193
12199
|
fileType: c
|
12194
12200
|
};
|
12195
12201
|
}
|
@@ -12233,7 +12239,7 @@ var Qi = /*#__PURE__*/function () {
|
|
12233
12239
|
var Sa = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}\n";
|
12234
12240
|
var wa = Object.defineProperty,
|
12235
12241
|
_a = Object.getOwnPropertyDescriptor,
|
12236
|
-
|
12242
|
+
y = function y(s, e, t, i) {
|
12237
12243
|
for (var n = i > 1 ? void 0 : i ? _a(e, t) : e, r = s.length - 1, o; r >= 0; r--) (o = s[r]) && (n = (i ? o(e, t, n) : o(n)) || n);
|
12238
12244
|
return i && n && wa(e, t, n), n;
|
12239
12245
|
};
|
@@ -12250,10 +12256,10 @@ var b = /*#__PURE__*/function (_co) {
|
|
12250
12256
|
}, _this68.addMessage = function () {
|
12251
12257
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
12252
12258
|
}, _this68.focusInput = function () {
|
12253
|
-
return
|
12254
|
-
}, _this68.refreshMessages = function () {}, _this68.clearMessages = function () {}, _this68.scrollToBottom = function () {}, _this68.disableSubmitButton = function () {}, _this68.onNewMessage = function () {}, _this68.onClearMessages = function () {}, _this68.onComponentRender = function () {}, _this68._hasBeenRendered = !1, _this68._auxiliaryStyleApplied = !1, jo.appendStyleSheetToHead(), _this68._elementRef = document.createElement("div"), _this68._elementRef.id = "container", _this68.attachShadow({
|
12259
|
+
return $t.focusFromParentElement(_this68._elementRef);
|
12260
|
+
}, _this68.refreshMessages = function () {}, _this68.clearMessages = function () {}, _this68.scrollToBottom = function () {}, _this68.disableSubmitButton = function () {}, _this68.onNewMessage = function () {}, _this68.onClearMessages = function () {}, _this68.onComponentRender = function () {}, _this68.onError = function () {}, _this68._hasBeenRendered = !1, _this68._auxiliaryStyleApplied = !1, jo.appendStyleSheetToHead(), _this68._elementRef = document.createElement("div"), _this68._elementRef.id = "container", _this68.attachShadow({
|
12255
12261
|
mode: "open"
|
12256
|
-
}).appendChild(_this68._elementRef),
|
12262
|
+
}).appendChild(_this68._elementRef), vi.apply(Sa, _this68.shadowRoot), setTimeout(function () {
|
12257
12263
|
_this68._hasBeenRendered || _this68.onRender();
|
12258
12264
|
}, 20);
|
12259
12265
|
return _this68;
|
@@ -12268,48 +12274,49 @@ var b = /*#__PURE__*/function (_co) {
|
|
12268
12274
|
key: "onRender",
|
12269
12275
|
value: function onRender() {
|
12270
12276
|
var _this$_activeService, _this$_childElement;
|
12271
|
-
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = Do.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (
|
12277
|
+
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = Do.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (vi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), vi.applyDefaultStyleToComponent(this.style, this.chatStyle), Ae.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Ot.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof z) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Qi.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof z && N.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Nt.onRender(this));
|
12272
12278
|
}
|
12273
12279
|
}]);
|
12274
12280
|
return b;
|
12275
12281
|
}(co);
|
12276
|
-
|
12277
|
-
|
12278
|
-
|
12279
|
-
|
12280
|
-
|
12281
|
-
|
12282
|
-
|
12283
|
-
|
12284
|
-
|
12285
|
-
|
12286
|
-
|
12287
|
-
|
12288
|
-
|
12289
|
-
|
12290
|
-
|
12291
|
-
|
12292
|
-
|
12293
|
-
|
12294
|
-
|
12295
|
-
|
12296
|
-
|
12297
|
-
|
12298
|
-
|
12299
|
-
|
12300
|
-
|
12301
|
-
|
12302
|
-
|
12303
|
-
|
12304
|
-
|
12305
|
-
|
12306
|
-
|
12307
|
-
|
12308
|
-
|
12309
|
-
|
12310
|
-
|
12311
|
-
|
12312
|
-
|
12313
|
-
|
12282
|
+
y([v("object")], b.prototype, "directConnection", 2);
|
12283
|
+
y([v("object")], b.prototype, "request", 2);
|
12284
|
+
y([v("object")], b.prototype, "webModel", 2);
|
12285
|
+
y([v("object")], b.prototype, "stream", 2);
|
12286
|
+
y([v("object")], b.prototype, "requestBodyLimits", 2);
|
12287
|
+
y([v("function")], b.prototype, "requestInterceptor", 2);
|
12288
|
+
y([v("function")], b.prototype, "responseInterceptor", 2);
|
12289
|
+
y([v("function")], b.prototype, "validateInput", 2);
|
12290
|
+
y([v("object")], b.prototype, "chatStyle", 2);
|
12291
|
+
y([v("object")], b.prototype, "attachmentContainerStyle", 2);
|
12292
|
+
y([v("object")], b.prototype, "dropupStyles", 2);
|
12293
|
+
y([v("object")], b.prototype, "inputAreaStyle", 2);
|
12294
|
+
y([v("object")], b.prototype, "textInput", 2);
|
12295
|
+
y([v("object")], b.prototype, "submitButtonStyles", 2);
|
12296
|
+
y([v("string")], b.prototype, "auxiliaryStyle", 2);
|
12297
|
+
y([v("array")], b.prototype, "initialMessages", 2);
|
12298
|
+
y([v("object")], b.prototype, "introMessage", 2);
|
12299
|
+
y([v("object")], b.prototype, "avatars", 2);
|
12300
|
+
y([v("object")], b.prototype, "names", 2);
|
12301
|
+
y([v("boolean")], b.prototype, "displayLoadingBubble", 2);
|
12302
|
+
y([v("object")], b.prototype, "errorMessages", 2);
|
12303
|
+
y([v("object")], b.prototype, "messageStyles", 2);
|
12304
|
+
y([v("object")], b.prototype, "textToSpeech", 2);
|
12305
|
+
y([v("object")], b.prototype, "speechToText", 2);
|
12306
|
+
y([v("object")], b.prototype, "images", 2);
|
12307
|
+
y([v("object")], b.prototype, "gifs", 2);
|
12308
|
+
y([v("object")], b.prototype, "camera", 2);
|
12309
|
+
y([v("object")], b.prototype, "audio", 2);
|
12310
|
+
y([v("object")], b.prototype, "microphone", 2);
|
12311
|
+
y([v("object")], b.prototype, "mixedFiles", 2);
|
12312
|
+
y([v("object")], b.prototype, "dragAndDrop", 2);
|
12313
|
+
y([v("object")], b.prototype, "introPanelStyle", 2);
|
12314
|
+
y([v("object")], b.prototype, "htmlClassUtilities", 2);
|
12315
|
+
y([v("function")], b.prototype, "onNewMessage", 2);
|
12316
|
+
y([v("function")], b.prototype, "onClearMessages", 2);
|
12317
|
+
y([v("function")], b.prototype, "onComponentRender", 2);
|
12318
|
+
y([v("function")], b.prototype, "onError", 2);
|
12319
|
+
y([v("object")], b.prototype, "demo", 2);
|
12320
|
+
y([v("object")], b.prototype, "_insertKeyViewStyles", 2);
|
12314
12321
|
customElements.define("deep-chat", b);
|
12315
12322
|
export { b as DeepChat };
|