deep-chat-dev 9.0.68 → 9.0.70
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 +3793 -3815
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +392 -390
- package/dist/services/cohere/cohereChatIO.d.ts +0 -2
- package/dist/services/cohere/cohereChatIO.d.ts.map +1 -1
- package/dist/services/cohere/utils/cohereUtils.d.ts.map +1 -1
- package/dist/services/openAI/openAIAssistantIO.d.ts.map +1 -1
- package/dist/services/openAI/openAIChatIO.d.ts.map +1 -1
- package/dist/services/serviceIOFactory.d.ts.map +1 -1
- package/dist/services/stabilityAI/stabilityAIImageToImageMaskingIO.d.ts.map +1 -1
- package/dist/types/cohere.d.ts +14 -7
- package/dist/types/cohere.d.ts.map +1 -1
- package/dist/types/webModel/webModel.d.ts +1 -0
- package/dist/types/webModel/webModel.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 +2 -1
- package/dist/assets/worker-2d077c33.js +0 -1
package/dist/deepChat.js
CHANGED
@@ -337,7 +337,7 @@ var Pn = /*#__PURE__*/function () {
|
|
337
337
|
return ze;
|
338
338
|
}();
|
339
339
|
Pn.TEXT_INPUT_ID = "text-input";
|
340
|
-
var
|
340
|
+
var Bi = Pn;
|
341
341
|
var Yt = /*#__PURE__*/function () {
|
342
342
|
function Yt() {
|
343
343
|
_classCallCheck(this, Yt);
|
@@ -353,21 +353,21 @@ var Yt = /*#__PURE__*/function () {
|
|
353
353
|
}, {
|
354
354
|
key: "focusFromParentElement",
|
355
355
|
value: function focusFromParentElement(e) {
|
356
|
-
var t = e.querySelector("#".concat(
|
356
|
+
var t = e.querySelector("#".concat(Bi.TEXT_INPUT_ID));
|
357
357
|
t && Yt.focusEndOfInput(t);
|
358
358
|
}
|
359
359
|
}]);
|
360
360
|
return Yt;
|
361
361
|
}();
|
362
|
-
function
|
362
|
+
function tn(n) {
|
363
363
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
364
364
|
}
|
365
365
|
function fs(n) {
|
366
366
|
return n && JSON.stringify(n);
|
367
367
|
}
|
368
368
|
function ms(n, e, t, i) {
|
369
|
-
var s = "\n".concat(
|
370
|
-
r = t ? "".concat(
|
369
|
+
var s = "\n".concat(tn(e), " message: ").concat(JSON.stringify(n), " \n"),
|
370
|
+
r = t ? "".concat(tn(e), " message after interceptor: ").concat(fs(i), " \n") : "";
|
371
371
|
return "".concat(s + r, "Make sure the ").concat(e, " message is using the Response format: https://deepchat.dev/docs/connect/#Response \n You can also augment it using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor");
|
372
372
|
}
|
373
373
|
var I = {
|
@@ -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
|
+
Ai = {
|
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
|
-
|
635
|
+
nn = Object.keys(Ai);
|
636
636
|
var ge = /*#__PURE__*/function () {
|
637
637
|
function ge() {
|
638
638
|
_classCallCheck(this, ge);
|
@@ -658,14 +658,14 @@ var ge = /*#__PURE__*/function () {
|
|
658
658
|
}, {
|
659
659
|
key: "doesElementContainDeepChatClass",
|
660
660
|
value: function doesElementContainDeepChatClass(e) {
|
661
|
-
return
|
661
|
+
return nn.find(function (t) {
|
662
662
|
return e.classList.contains(t);
|
663
663
|
});
|
664
664
|
}
|
665
665
|
}, {
|
666
666
|
key: "applyEvents",
|
667
667
|
value: function applyEvents(e, t) {
|
668
|
-
var i =
|
668
|
+
var i = Ai[t].events;
|
669
669
|
Object.keys(i || []).forEach(function (s) {
|
670
670
|
e.addEventListener(s, i == null ? void 0 : i[s]);
|
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 = Ai[i].styles;
|
682
682
|
if (r) {
|
683
683
|
var a = JSON.parse(JSON.stringify(r));
|
684
684
|
a["default"] && M.overwriteDefaultWithAlreadyApplied(a, t), s.unshift(a);
|
@@ -689,7 +689,7 @@ var ge = /*#__PURE__*/function () {
|
|
689
689
|
}, {
|
690
690
|
key: "applyDeepChatUtilities",
|
691
691
|
value: function applyDeepChatUtilities(e, t, i) {
|
692
|
-
|
692
|
+
nn.forEach(function (r) {
|
693
693
|
var o = i.getElementsByClassName(r);
|
694
694
|
Array.from(o || []).forEach(function (a) {
|
695
695
|
var l = ge.getProcessedStyles(t, a, r);
|
@@ -810,7 +810,7 @@ function ht(n) {
|
|
810
810
|
function Un(n) {
|
811
811
|
return !(n >= 55296 && n <= 57343 || n >= 64976 && n <= 65007 || (n & 65535) === 65535 || (n & 65535) === 65534 || n >= 0 && n <= 8 || n === 11 || n >= 14 && n <= 31 || n >= 127 && n <= 159 || n > 1114111);
|
812
812
|
}
|
813
|
-
function
|
813
|
+
function ki(n) {
|
814
814
|
if (n > 65535) {
|
815
815
|
n -= 65536;
|
816
816
|
var e = 55296 + (n >> 10),
|
@@ -824,7 +824,7 @@ var Es = /&([a-z#][a-z0-9]{1,31});/gi,
|
|
824
824
|
function ws(n, 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)) ? ki(t) : n;
|
828
828
|
}
|
829
829
|
function ke(n) {
|
830
830
|
return n.indexOf("&") < 0 ? n : n.replace(Es, ws);
|
@@ -1062,14 +1062,14 @@ function Hn(n, 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 Fi() {
|
1066
1066
|
this.rules = qn({}, f), this.getBreak = f.getBreak;
|
1067
1067
|
}
|
1068
|
-
|
1068
|
+
Fi.prototype.renderInline = function (n, e, t) {
|
1069
1069
|
for (var i = this.rules, s = n.length, r = 0, o = ""; s--;) o += i[n[r].type](n, r++, e, t, this);
|
1070
1070
|
return o;
|
1071
1071
|
};
|
1072
|
-
|
1072
|
+
Fi.prototype.render = function (n, e, t) {
|
1073
1073
|
for (var i = this.rules, s = n.length, r = -1, o = ""; ++r < s;) n[r].type === "inline" ? o += this.renderInline(n[r].children, e, t) : o += i[n[r].type](n, r, e, t, this);
|
1074
1074
|
return o;
|
1075
1075
|
};
|
@@ -1216,7 +1216,7 @@ function Is(n) {
|
|
1216
1216
|
}
|
1217
1217
|
}
|
1218
1218
|
}
|
1219
|
-
function
|
1219
|
+
function Ii(n) {
|
1220
1220
|
var e = ke(n);
|
1221
1221
|
try {
|
1222
1222
|
e = decodeURI(e);
|
@@ -1232,7 +1232,7 @@ function Gn(n, e) {
|
|
1232
1232
|
if (n.src.charCodeAt(e) === 60) {
|
1233
1233
|
for (e++; e < o;) {
|
1234
1234
|
if (t = n.src.charCodeAt(e), t === 10) return !1;
|
1235
|
-
if (t === 62) return s =
|
1235
|
+
if (t === 62) return s = Ii(ht(n.src.slice(r + 1, e))), n.parser.validateLink(s) ? (n.pos = e + 1, n.linkContent = s, !0) : !1;
|
1236
1236
|
if (t === 92 && e + 1 < o) {
|
1237
1237
|
e += 2;
|
1238
1238
|
continue;
|
@@ -1356,7 +1356,7 @@ function Ns(n) {
|
|
1356
1356
|
});
|
1357
1357
|
}
|
1358
1358
|
}
|
1359
|
-
var
|
1359
|
+
var sn = " \n()[]'\".,!?-";
|
1360
1360
|
function vi(n) {
|
1361
1361
|
return n.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1362
1362
|
}
|
@@ -1375,11 +1375,11 @@ function Ps(n) {
|
|
1375
1375
|
p,
|
1376
1376
|
h = n.tokens;
|
1377
1377
|
if (n.env.abbreviations) {
|
1378
|
-
for (n.env.abbrRegExp || (p = "(^|[" +
|
1378
|
+
for (n.env.abbrRegExp || (p = "(^|[" + sn.split("").map(vi).join("") + "])(" + Object.keys(n.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(vi).join("|") + ")($|[" +
|
1382
|
+
}).map(vi).join("|") + ")($|[" + sn.split("").map(vi).join("") + "])", n.env.abbrRegExp = new RegExp(p, "g")), d = n.env.abbrRegExp, t = 0, i = h.length; t < i; t++) if (h[t].type === "inline") {
|
1383
1383
|
for (s = h[t].children, e = s.length - 1; e >= 0; e--) if (r = s[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",
|
@@ -1426,10 +1426,10 @@ function zs(n) {
|
|
1426
1426
|
}
|
1427
1427
|
}
|
1428
1428
|
var qs = /['"]/,
|
1429
|
-
|
1429
|
+
rn = /['"]/g,
|
1430
1430
|
Us = /[-\s()\[\]]/,
|
1431
|
-
|
1432
|
-
function
|
1431
|
+
on = "’";
|
1432
|
+
function an(n, e) {
|
1433
1433
|
return e < 0 || e >= n.length ? !1 : !Us.test(n[e]);
|
1434
1434
|
}
|
1435
1435
|
function Be(n, e, t) {
|
@@ -1442,9 +1442,9 @@ function Hs(n) {
|
|
1442
1442
|
for (E = n.tokens[m].children, S.length = 0, e = 0; e < E.length; e++) if (t = E[e], !(t.type !== "text" || qs.test(t.text))) {
|
1443
1443
|
for (a = E[e].level, h = S.length - 1; h >= 0 && !(S[h].level <= a); h--);
|
1444
1444
|
S.length = h + 1, i = t.content, r = 0, o = i.length;
|
1445
|
-
e: for (; r < o && (
|
1446
|
-
if (l = !
|
1447
|
-
g && (t.content = Be(t.content, s.index,
|
1445
|
+
e: for (; r < o && (rn.lastIndex = r, s = rn.exec(i), !!s);) {
|
1446
|
+
if (l = !an(i, s.index - 1), r = s.index + 1, g = s[0] === "'", c = !an(i, r), !c && !l) {
|
1447
|
+
g && (t.content = Be(t.content, s.index, on));
|
1448
1448
|
continue;
|
1449
1449
|
}
|
1450
1450
|
if (u = !c, p = !l, p) {
|
@@ -1458,7 +1458,7 @@ function Hs(n) {
|
|
1458
1458
|
pos: s.index,
|
1459
1459
|
single: g,
|
1460
1460
|
level: a
|
1461
|
-
}) : p && g && (t.content = Be(t.content, s.index,
|
1461
|
+
}) : p && g && (t.content = Be(t.content, s.index, on));
|
1462
1462
|
}
|
1463
1463
|
}
|
1464
1464
|
}
|
@@ -1617,11 +1617,11 @@ function Ks(n, e, t, i) {
|
|
1617
1617
|
level: n.level
|
1618
1618
|
})), !0);
|
1619
1619
|
}
|
1620
|
-
function
|
1620
|
+
function ln(n, e) {
|
1621
1621
|
var t, i, s;
|
1622
1622
|
return i = n.bMarks[e] + n.tShift[e], s = n.eMarks[e], i >= s || (t = n.src.charCodeAt(i++), t !== 42 && t !== 45 && t !== 43) || i < s && n.src.charCodeAt(i) !== 32 ? -1 : i;
|
1623
1623
|
}
|
1624
|
-
function
|
1624
|
+
function cn(n, e) {
|
1625
1625
|
var t,
|
1626
1626
|
i = n.bMarks[e] + n.tShift[e],
|
1627
1627
|
s = n.eMarks[e];
|
@@ -1663,9 +1663,9 @@ function Ys(n, e, t, i) {
|
|
1663
1663
|
ee = !0,
|
1664
1664
|
ue,
|
1665
1665
|
q,
|
1666
|
-
|
1666
|
+
en,
|
1667
1667
|
gi;
|
1668
|
-
if ((u =
|
1668
|
+
if ((u = cn(n, e)) >= 0) E = !0;else if ((u = ln(n, e)) >= 0) E = !1;else return !1;
|
1669
1669
|
if (n.level >= n.options.maxNesting) return !1;
|
1670
1670
|
if (m = n.src.charCodeAt(u - 1), i) return !0;
|
1671
1671
|
for (G = n.tokens.length, E ? (d = n.bMarks[e] + n.tShift[e], g = Number(n.src.substr(d, u - d - 1)), n.tokens.push({
|
@@ -1685,14 +1685,14 @@ function Ys(n, e, t, i) {
|
|
1685
1685
|
type: "list_item_close",
|
1686
1686
|
level: --n.level
|
1687
1687
|
}), s = e = n.line, Q[1] = s, S = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
|
1688
|
-
for (gi = !1, q = 0,
|
1688
|
+
for (gi = !1, q = 0, en = ue.length; q < en; q++) if (ue[q](n, s, t, !0)) {
|
1689
1689
|
gi = !0;
|
1690
1690
|
break;
|
1691
1691
|
}
|
1692
1692
|
if (gi) break;
|
1693
1693
|
if (E) {
|
1694
|
-
if (u =
|
1695
|
-
} else if (u =
|
1694
|
+
if (u = cn(n, s), u < 0) break;
|
1695
|
+
} else if (u = ln(n, s), u < 0) break;
|
1696
1696
|
if (m !== n.src.charCodeAt(u - 1)) break;
|
1697
1697
|
}
|
1698
1698
|
return n.tokens.push({
|
@@ -1979,13 +1979,13 @@ function or(n, 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 zi() {
|
1983
1983
|
this.ruler = new H();
|
1984
1984
|
for (var n = 0; n < At.length; n++) this.ruler.push(At[n][0], At[n][1], {
|
1985
1985
|
alt: (At[n][2] || []).slice()
|
1986
1986
|
});
|
1987
1987
|
}
|
1988
|
-
|
1988
|
+
zi.prototype.tokenize = function (n, e, t) {
|
1989
1989
|
for (var i = this.ruler.getRules(""), s = i.length, r = e, o = !1, a, l; r < t && (n.line = r = n.skipEmptyLines(r), !(r >= t || n.tShift[r] < n.blkIndent));) {
|
1990
1990
|
for (l = 0; l < s && (a = i[l](n, r, t, !1), !a); l++);
|
1991
1991
|
if (n.tight = !o, n.isEmpty(n.line - 1) && (o = !0), r = n.line, r < t && n.isEmpty(r)) {
|
@@ -1997,7 +1997,7 @@ qi.prototype.tokenize = function (n, 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
|
+
zi.prototype.parse = function (n, e, t, i) {
|
2001
2001
|
var s,
|
2002
2002
|
r = 0,
|
2003
2003
|
o = 0;
|
@@ -2065,10 +2065,10 @@ function hr(n, e) {
|
|
2065
2065
|
for (s++; s < i && n.src.charCodeAt(s) === 32;) s++;
|
2066
2066
|
return n.pos = s, !0;
|
2067
2067
|
}
|
2068
|
-
var
|
2069
|
-
for (var
|
2068
|
+
var qi = [];
|
2069
|
+
for (var dn = 0; dn < 256; dn++) qi.push(0);
|
2070
2070
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function (n) {
|
2071
|
-
|
2071
|
+
qi[n.charCodeAt(0)] = 1;
|
2072
2072
|
});
|
2073
2073
|
function pr(n, e) {
|
2074
2074
|
var t,
|
@@ -2076,7 +2076,7 @@ function pr(n, e) {
|
|
2076
2076
|
s = n.posMax;
|
2077
2077
|
if (n.src.charCodeAt(i) !== 92) return !1;
|
2078
2078
|
if (i++, i < s) {
|
2079
|
-
if (t = n.src.charCodeAt(i), t < 256 &&
|
2079
|
+
if (t = n.src.charCodeAt(i), t < 256 && qi[t] !== 0) return e || (n.pending += n.src[i]), n.pos += 2, !0;
|
2080
2080
|
if (t === 10) {
|
2081
2081
|
for (e || n.push({
|
2082
2082
|
type: "hardbreak",
|
@@ -2186,10 +2186,10 @@ function br(n, e) {
|
|
2186
2186
|
level: --n.level
|
2187
2187
|
})), n.pos = n.posMax + 2, n.posMax = r, !0) : (n.pos = o, !1);
|
2188
2188
|
}
|
2189
|
-
function
|
2189
|
+
function un(n) {
|
2190
2190
|
return n >= 48 && n <= 57 || n >= 65 && n <= 90 || n >= 97 && n <= 122;
|
2191
2191
|
}
|
2192
|
-
function
|
2192
|
+
function hn(n, e) {
|
2193
2193
|
var t = e,
|
2194
2194
|
i,
|
2195
2195
|
s,
|
@@ -2199,7 +2199,7 @@ function pn(n, e) {
|
|
2199
2199
|
l = n.posMax,
|
2200
2200
|
c = n.src.charCodeAt(e);
|
2201
2201
|
for (i = e > 0 ? n.src.charCodeAt(e - 1) : -1; t < l && n.src.charCodeAt(t) === c;) t++;
|
2202
|
-
return t >= l && (o = !1), r = t - e, r >= 4 ? o = a = !1 : (s = t < l ? n.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (o = !1), (i === 32 || i === 10) && (a = !1), c === 95 && (
|
2202
|
+
return t >= l && (o = !1), r = t - e, r >= 4 ? o = a = !1 : (s = t < l ? n.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (o = !1), (i === 32 || i === 10) && (a = !1), c === 95 && (un(i) && (o = !1), un(s) && (a = !1))), {
|
2203
2203
|
can_open: o,
|
2204
2204
|
can_close: a,
|
2205
2205
|
delims: r
|
@@ -2217,11 +2217,11 @@ function vr(n, e) {
|
|
2217
2217
|
d = n.pos,
|
2218
2218
|
u = n.src.charCodeAt(d);
|
2219
2219
|
if (u !== 95 && u !== 42 || e) return !1;
|
2220
|
-
if (l =
|
2220
|
+
if (l = hn(n, d), t = l.delims, !l.can_open) return n.pos += t, e || (n.pending += n.src.slice(d, n.pos)), !0;
|
2221
2221
|
if (n.level >= n.options.maxNesting) return !1;
|
2222
2222
|
for (n.pos = d + t, a = [t]; n.pos < c;) {
|
2223
2223
|
if (n.src.charCodeAt(n.pos) === u) {
|
2224
|
-
if (l =
|
2224
|
+
if (l = hn(n, n.pos), i = l.delims, l.can_close) {
|
2225
2225
|
for (r = a.pop(), o = i; r !== o;) {
|
2226
2226
|
if (o < r) {
|
2227
2227
|
a.push(r - o);
|
@@ -2387,7 +2387,7 @@ function kr(n, e) {
|
|
2387
2387
|
r,
|
2388
2388
|
o,
|
2389
2389
|
a = n.pos;
|
2390
|
-
return n.src.charCodeAt(a) !== 60 || (t = n.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 n.src.charCodeAt(a) !== 60 || (t = n.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 = Ii(r), !n.parser.validateLink(r)) ? !1 : (e || (n.push({
|
2391
2391
|
type: "link_open",
|
2392
2392
|
href: o,
|
2393
2393
|
level: n.level
|
@@ -2398,7 +2398,7 @@ function kr(n, e) {
|
|
2398
2398
|
}), n.push({
|
2399
2399
|
type: "link_close",
|
2400
2400
|
level: n.level
|
2401
|
-
})), n.pos += i[0].length, !0) : (s = t.match(Cr), s ? (r = s[0].slice(1, -1), o =
|
2401
|
+
})), n.pos += i[0].length, !0) : (s = t.match(Cr), s ? (r = s[0].slice(1, -1), o = Ii("mailto:" + r), n.parser.validateLink(o) ? (e || (n.push({
|
2402
2402
|
type: "link_open",
|
2403
2403
|
href: o,
|
2404
2404
|
level: n.level
|
@@ -2455,7 +2455,7 @@ function Kr(n, e) {
|
|
2455
2455
|
if (n.src.charCodeAt(r) !== 38) return !1;
|
2456
2456
|
if (r + 1 < o) {
|
2457
2457
|
if (t = n.src.charCodeAt(r + 1), t === 35) {
|
2458
|
-
if (s = n.src.slice(r).match(Vr), s) return e || (i = s[1][0].toLowerCase() === "x" ? parseInt(s[1].slice(1), 16) : parseInt(s[1], 10), n.pending += Un(i) ?
|
2458
|
+
if (s = n.src.slice(r).match(Vr), s) return e || (i = s[1][0].toLowerCase() === "x" ? parseInt(s[1].slice(1), 16) : parseInt(s[1], 10), n.pending += Un(i) ? ki(i) : ki(65533)), n.pos += s[0].length, !0;
|
2459
2459
|
} else if (s = n.src.slice(r).match(Wr), s) {
|
2460
2460
|
var a = zn(s[1]);
|
2461
2461
|
if (s[1] !== a) return e || (n.pending += a), n.pos += s[0].length, !0;
|
@@ -2626,7 +2626,7 @@ function Yn(n, e, t) {
|
|
2626
2626
|
this.src = e, this.env = t, this.options = n.options, this.tokens = [], this.inlineMode = !1, this.inline = n.inline, this.block = n.block, this.renderer = n.renderer, this.typographer = n.typographer;
|
2627
2627
|
}
|
2628
2628
|
function de(n, e) {
|
2629
|
-
typeof n != "string" && (e = n, n = "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 Xt(), this.block = new
|
2629
|
+
typeof n != "string" && (e = n, n = "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 Xt(), this.block = new zi(), this.core = new Kn(), this.renderer = new Fi(), this.ruler = new H(), this.options = {}, this.configure(Xr[n]), this.set(e || {});
|
2630
2630
|
}
|
2631
2631
|
de.prototype.set = function (n) {
|
2632
2632
|
qn(this.options, n);
|
@@ -2655,11 +2655,11 @@ de.prototype.parseInline = function (n, e) {
|
|
2655
2655
|
de.prototype.renderInline = function (n, e) {
|
2656
2656
|
return e = e || {}, this.renderer.render(this.parseInline(n, e), this.options, e);
|
2657
2657
|
};
|
2658
|
-
var
|
2659
|
-
function
|
2660
|
-
_classCallCheck(this,
|
2658
|
+
var Li = /*#__PURE__*/function () {
|
2659
|
+
function Li() {
|
2660
|
+
_classCallCheck(this, Li);
|
2661
2661
|
}
|
2662
|
-
_createClass(
|
2662
|
+
_createClass(Li, null, [{
|
2663
2663
|
key: "createNew",
|
2664
2664
|
value: function createNew() {
|
2665
2665
|
var e = window.hljs;
|
@@ -2698,13 +2698,13 @@ var Ri = /*#__PURE__*/function () {
|
|
2698
2698
|
});
|
2699
2699
|
}
|
2700
2700
|
}]);
|
2701
|
-
return
|
2701
|
+
return Li;
|
2702
2702
|
}();
|
2703
|
-
var
|
2704
|
-
function
|
2705
|
-
_classCallCheck(this,
|
2703
|
+
var Ui = /*#__PURE__*/function () {
|
2704
|
+
function Ui() {
|
2705
|
+
_classCallCheck(this, Ui);
|
2706
2706
|
}
|
2707
|
-
_createClass(
|
2707
|
+
_createClass(Ui, null, [{
|
2708
2708
|
key: "onNewMessage",
|
2709
2709
|
value: function onNewMessage(e, t, i) {
|
2710
2710
|
var s = JSON.parse(JSON.stringify({
|
@@ -2726,7 +2726,7 @@ var Hi = /*#__PURE__*/function () {
|
|
2726
2726
|
e.onComponentRender(), e.dispatchEvent(new CustomEvent("render"));
|
2727
2727
|
}
|
2728
2728
|
}]);
|
2729
|
-
return
|
2729
|
+
return Ui;
|
2730
2730
|
}();
|
2731
2731
|
var P = /*#__PURE__*/function () {
|
2732
2732
|
function P() {
|
@@ -2872,7 +2872,7 @@ var Ve = /*#__PURE__*/function () {
|
|
2872
2872
|
function Ve(e) {
|
2873
2873
|
var _this3 = this;
|
2874
2874
|
_classCallCheck(this, Ve);
|
2875
|
-
this.messageElementRefs = [], this.messages = [], this.htmlClassUtilities = {}, this.textElementsToText = [], this.elementRef = Ve.createContainerElement(), this.messageStyles = e.messageStyles, this._remarkable =
|
2875
|
+
this.messageElementRefs = [], this.messages = [], this.htmlClassUtilities = {}, this.textElementsToText = [], this.elementRef = Ve.createContainerElement(), this.messageStyles = e.messageStyles, this._remarkable = Li.createNew(), this._avatars = e.avatars, this._names = e.names, this._onNewMessage = Ui.onNewMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
|
2876
2876
|
_this3.submitUserMessage = e.submitUserMessage;
|
2877
2877
|
});
|
2878
2878
|
}
|
@@ -2956,7 +2956,7 @@ var Ve = /*#__PURE__*/function () {
|
|
2956
2956
|
key: "refreshTextMessages",
|
2957
2957
|
value: function refreshTextMessages() {
|
2958
2958
|
var _this5 = this;
|
2959
|
-
this._remarkable =
|
2959
|
+
this._remarkable = Li.createNew(), this.textElementsToText.forEach(function (e) {
|
2960
2960
|
_this5.renderText(e[0].bubbleElement, e[1]);
|
2961
2961
|
});
|
2962
2962
|
}
|
@@ -3000,7 +3000,7 @@ var Ve = /*#__PURE__*/function () {
|
|
3000
3000
|
}]);
|
3001
3001
|
return Ve;
|
3002
3002
|
}();
|
3003
|
-
var
|
3003
|
+
var Hi = /*#__PURE__*/function () {
|
3004
3004
|
// used for extracting at end and for isStreaming
|
3005
3005
|
function it(e) {
|
3006
3006
|
_classCallCheck(this, it);
|
@@ -3058,9 +3058,9 @@ var Gi = /*#__PURE__*/function () {
|
|
3058
3058
|
}]);
|
3059
3059
|
return it;
|
3060
3060
|
}();
|
3061
|
-
|
3062
|
-
|
3063
|
-
var Ye =
|
3061
|
+
Hi.MESSAGE_CLASS = "streamed-message";
|
3062
|
+
Hi.HTML_CONTENT_PLACEHOLDER = "htmlplaceholder";
|
3063
|
+
var Ye = Hi;
|
3064
3064
|
var $n = /*#__PURE__*/function () {
|
3065
3065
|
function nt() {
|
3066
3066
|
_classCallCheck(this, nt);
|
@@ -3245,10 +3245,10 @@ function io(n) {
|
|
3245
3245
|
};
|
3246
3246
|
}
|
3247
3247
|
function no(n, e, t) {
|
3248
|
-
var i =
|
3248
|
+
var i = pn();
|
3249
3249
|
var s = new TextDecoder();
|
3250
3250
|
return function (o, a) {
|
3251
|
-
if (o.length === 0) t == null || t(i), i =
|
3251
|
+
if (o.length === 0) t == null || t(i), i = pn();else if (a > 0) {
|
3252
3252
|
var l = s.decode(o.subarray(0, a)),
|
3253
3253
|
c = a + (o[a + 1] === 32 ? 2 : 1),
|
3254
3254
|
d = s.decode(o.subarray(c));
|
@@ -3274,7 +3274,7 @@ function so(n, e) {
|
|
3274
3274
|
var t = new Uint8Array(n.length + e.length);
|
3275
3275
|
return t.set(n), t.set(e, n.length), t;
|
3276
3276
|
}
|
3277
|
-
function
|
3277
|
+
function pn() {
|
3278
3278
|
return {
|
3279
3279
|
data: "",
|
3280
3280
|
event: "",
|
@@ -3288,9 +3288,9 @@ var ro = globalThis && globalThis.__rest || function (n, e) {
|
|
3288
3288
|
if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var s = 0, i = Object.getOwnPropertySymbols(n); s < i.length; s++) e.indexOf(i[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[s]) && (t[i[s]] = n[i[s]]);
|
3289
3289
|
return t;
|
3290
3290
|
};
|
3291
|
-
var
|
3291
|
+
var Ri = "text/event-stream",
|
3292
3292
|
oo = 1e3,
|
3293
|
-
|
3293
|
+
fn = "last-event-id";
|
3294
3294
|
function ao(n, e) {
|
3295
3295
|
var t = e.signal,
|
3296
3296
|
i = e.headers,
|
@@ -3303,7 +3303,7 @@ function ao(n, e) {
|
|
3303
3303
|
d = ro(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
3304
3304
|
return new Promise(function (u, p) {
|
3305
3305
|
var h = Object.assign({}, i);
|
3306
|
-
h.accept || (h.accept =
|
3306
|
+
h.accept || (h.accept = Ri);
|
3307
3307
|
var g;
|
3308
3308
|
function m() {
|
3309
3309
|
g.abort(), document.hidden || Q();
|
@@ -3342,7 +3342,7 @@ function ao(n, e) {
|
|
3342
3342
|
case 7:
|
3343
3343
|
_context3.next = 9;
|
3344
3344
|
return to(ue.body, io(no(function (q) {
|
3345
|
-
q ? h[
|
3345
|
+
q ? h[fn] = q : delete h[fn];
|
3346
3346
|
}, function (q) {
|
3347
3347
|
E = q;
|
3348
3348
|
}, r)));
|
@@ -3374,7 +3374,7 @@ function ao(n, e) {
|
|
3374
3374
|
}
|
3375
3375
|
function lo(n) {
|
3376
3376
|
var e = n.headers.get("content-type");
|
3377
|
-
if (!(e != null && e.startsWith(
|
3377
|
+
if (!(e != null && e.startsWith(Ri))) throw new Error("Expected content-type to be ".concat(Ri, ", Actual: ").concat(e));
|
3378
3378
|
}
|
3379
3379
|
var Zn = /*#__PURE__*/function () {
|
3380
3380
|
function st() {
|
@@ -4365,7 +4365,7 @@ var L = /*#__PURE__*/function () {
|
|
4365
4365
|
key: "set",
|
4366
4366
|
value: function set(e, t, i) {
|
4367
4367
|
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");
|
4368
|
-
var s =
|
4368
|
+
var s = Li.createNew();
|
4369
4369
|
L.processImagesConfig(t, s, e.images, i == null ? void 0 : i.images), L.processCamera(t, s, e.camera, e.images), L.processGifConfig(t, s, e.gifs, i == null ? void 0 : i.gifs), L.processAudioConfig(t, s, e.audio, i == null ? void 0 : i.audio), L.processMicrophone(t, s, e.microphone, e.audio), L.processMixedFiles(t, s, e.mixedFiles);
|
4370
4370
|
}
|
4371
4371
|
}]);
|
@@ -4648,7 +4648,7 @@ var Nt = /*#__PURE__*/function () {
|
|
4648
4648
|
}]);
|
4649
4649
|
return Nt;
|
4650
4650
|
}();
|
4651
|
-
var
|
4651
|
+
var Gi = /*#__PURE__*/function (_HTMLElement) {
|
4652
4652
|
_inherits(qe, _HTMLElement);
|
4653
4653
|
var _super2 = _createSuper(qe);
|
4654
4654
|
// If this is not working, try using propertyName directly
|
@@ -4695,9 +4695,9 @@ var Vi = /*#__PURE__*/function (_HTMLElement) {
|
|
4695
4695
|
}]);
|
4696
4696
|
return qe;
|
4697
4697
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
4698
|
-
|
4699
|
-
|
4700
|
-
var co =
|
4698
|
+
Gi._attributes_ = {};
|
4699
|
+
Gi._attributeToProperty_ = {};
|
4700
|
+
var co = Gi;
|
4701
4701
|
var uo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
|
4702
4702
|
ho = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
|
4703
4703
|
var U = /*#__PURE__*/function () {
|
@@ -4906,17 +4906,17 @@ var Pt = /*#__PURE__*/function () {
|
|
4906
4906
|
return Pt;
|
4907
4907
|
}();
|
4908
4908
|
var Qn = /*#__PURE__*/function (_z) {
|
4909
|
-
_inherits(
|
4910
|
-
var _super3 = _createSuper(
|
4909
|
+
_inherits(Oi, _z);
|
4910
|
+
var _super3 = _createSuper(Oi);
|
4911
4911
|
// prettier-ignore
|
4912
|
-
function
|
4912
|
+
function Oi(e, t, i, s, r, o) {
|
4913
4913
|
var _this8;
|
4914
|
-
_classCallCheck(this,
|
4915
|
-
_this8 = _super3.call(this, e, Pt.buildKeyVerificationDetails(), Pt.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(
|
4914
|
+
_classCallCheck(this, Oi);
|
4915
|
+
_this8 = _super3.call(this, e, Pt.buildKeyVerificationDetails(), Pt.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(Oi.URL_PREFIX).concat(i), _this8.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this8.url = "".concat(Oi.URL_PREFIX).concat(s.model)), s.options && (_this8.rawBody.options = s.options), s.parameters && (_this8.rawBody.parameters = s.parameters));
|
4916
4916
|
return _this8;
|
4917
4917
|
}
|
4918
4918
|
// prettier-ignore
|
4919
|
-
_createClass(
|
4919
|
+
_createClass(Oi, [{
|
4920
4920
|
key: "preprocessBody",
|
4921
4921
|
value: function preprocessBody(e, t, i) {
|
4922
4922
|
var _s$options;
|
@@ -4954,7 +4954,7 @@ var Qn = /*#__PURE__*/function (_z) {
|
|
4954
4954
|
return callServiceAPI;
|
4955
4955
|
}()
|
4956
4956
|
}]);
|
4957
|
-
return
|
4957
|
+
return Oi;
|
4958
4958
|
}(z);
|
4959
4959
|
Qn.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
4960
4960
|
var Ne = Qn;
|
@@ -5285,7 +5285,7 @@ var jt = /*#__PURE__*/function (_Qt2) {
|
|
5285
5285
|
}
|
5286
5286
|
}
|
5287
5287
|
};
|
5288
|
-
_this12 = _super9.call(this, e, se.buildKeyVerificationDetails(), se.buildHeaders, i, s), _this12.url = "https://api.stability.ai/v1/generation/stable-
|
5288
|
+
_this12 = _super9.call(this, e, se.buildKeyVerificationDetails(), se.buildHeaders, i, s), _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>";
|
5289
5289
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
5290
5290
|
_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), jt.cleanConfig(r), Object.assign(_this12.rawBody, r)), _this12.canSendMessage = jt.canSendFileTextMessage;
|
5291
5291
|
return _this12;
|
@@ -5664,7 +5664,7 @@ var Bt = /*#__PURE__*/function (_Qt3) {
|
|
5664
5664
|
}
|
5665
5665
|
}
|
5666
5666
|
};
|
5667
|
-
_this15 = _super15.call(this, e, se.buildKeyVerificationDetails(), se.buildHeaders, i, s), _this15.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-
|
5667
|
+
_this15 = _super15.call(this, e, se.buildKeyVerificationDetails(), se.buildHeaders, i, s), _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>";
|
5668
5668
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
5669
5669
|
_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), Bt.cleanConfig(r), Object.assign(_this15.rawBody, r)), _this15.canSendMessage = Bt.canSendFileTextMessage;
|
5670
5670
|
return _this15;
|
@@ -5805,7 +5805,7 @@ var Ft = /*#__PURE__*/function (_Qt4) {
|
|
5805
5805
|
var r;
|
5806
5806
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5807
5807
|
i = t.stabilityAI;
|
5808
|
-
_this16 = _super17.call(this, e, se.buildKeyVerificationDetails(), se.buildHeaders, i), _this16.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-
|
5808
|
+
_this16 = _super17.call(this, e, se.buildKeyVerificationDetails(), se.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>";
|
5809
5809
|
var s = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
5810
5810
|
_typeof(s) == "object" && (s.engine_id && (_this16.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this16._imageWeight = s.weight), Ft.cleanConfig(s), Object.assign(_this16.rawBody, s)), _this16.canSendMessage = Ft.canSendTextMessage;
|
5811
5811
|
return _this16;
|
@@ -5950,7 +5950,8 @@ var zt = /*#__PURE__*/function () {
|
|
5950
5950
|
}, {
|
5951
5951
|
key: "handleVerificationResult",
|
5952
5952
|
value: function handleVerificationResult(e, t, i, s) {
|
5953
|
-
|
5953
|
+
var o;
|
5954
|
+
(o = e.message) != null && o.includes("invalid request: prompt must be at least 1 token long") ? i(t) : s(I.INVALID_KEY);
|
5954
5955
|
}
|
5955
5956
|
}, {
|
5956
5957
|
key: "buildKeyVerificationDetails",
|
@@ -5967,19 +5968,19 @@ var zt = /*#__PURE__*/function () {
|
|
5967
5968
|
}]);
|
5968
5969
|
return zt;
|
5969
5970
|
}();
|
5970
|
-
var
|
5971
|
-
_inherits(
|
5972
|
-
var _super19 = _createSuper(
|
5973
|
-
function
|
5971
|
+
var Vi = /*#__PURE__*/function (_z3) {
|
5972
|
+
_inherits(Vi, _z3);
|
5973
|
+
var _super19 = _createSuper(Vi);
|
5974
|
+
function Vi(e, t, i, s, r) {
|
5974
5975
|
var _this18;
|
5975
|
-
_classCallCheck(this,
|
5976
|
+
_classCallCheck(this, Vi);
|
5976
5977
|
_this18 = _super19.call(this, e, zt.buildKeyVerificationDetails(), zt.buildHeaders, r), _this18.insertKeyPlaceholderText = "Cohere API Key", _this18.getKeyLink = "https://dashboard.cohere.ai/api-keys", _this18.permittedErrorPrefixes = ["invalid"], _this18.url = t, _this18.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this18.rawBody, s);
|
5977
5978
|
return _this18;
|
5978
5979
|
}
|
5979
|
-
return _createClass(
|
5980
|
+
return _createClass(Vi);
|
5980
5981
|
}(z);
|
5981
|
-
var wo = /*#__PURE__*/function (
|
5982
|
-
_inherits(wo,
|
5982
|
+
var wo = /*#__PURE__*/function (_Vi) {
|
5983
|
+
_inherits(wo, _Vi);
|
5983
5984
|
var _super20 = _createSuper(wo);
|
5984
5985
|
function wo(e) {
|
5985
5986
|
_classCallCheck(this, wo);
|
@@ -6054,9 +6055,9 @@ var wo = /*#__PURE__*/function (_Wi) {
|
|
6054
6055
|
}()
|
6055
6056
|
}]);
|
6056
6057
|
return wo;
|
6057
|
-
}(
|
6058
|
-
var _o = /*#__PURE__*/function (
|
6059
|
-
_inherits(_o,
|
6058
|
+
}(Vi);
|
6059
|
+
var _o = /*#__PURE__*/function (_Vi2) {
|
6060
|
+
_inherits(_o, _Vi2);
|
6060
6061
|
var _super21 = _createSuper(_o);
|
6061
6062
|
function _o(e) {
|
6062
6063
|
_classCallCheck(this, _o);
|
@@ -6130,7 +6131,7 @@ var _o = /*#__PURE__*/function (_Wi2) {
|
|
6130
6131
|
}()
|
6131
6132
|
}]);
|
6132
6133
|
return _o;
|
6133
|
-
}(
|
6134
|
+
}(Vi);
|
6134
6135
|
var O = /*#__PURE__*/function () {
|
6135
6136
|
function O() {
|
6136
6137
|
_classCallCheck(this, O);
|
@@ -6259,22 +6260,22 @@ var O = /*#__PURE__*/function () {
|
|
6259
6260
|
}]);
|
6260
6261
|
return O;
|
6261
6262
|
}();
|
6262
|
-
var
|
6263
|
-
_inherits(
|
6264
|
-
var _super22 = _createSuper(
|
6265
|
-
function
|
6263
|
+
var Wi = /*#__PURE__*/function (_z4) {
|
6264
|
+
_inherits(Ni, _z4);
|
6265
|
+
var _super22 = _createSuper(Ni);
|
6266
|
+
function Ni(e) {
|
6266
6267
|
var _o$model, _a$voice;
|
6267
6268
|
var _this19;
|
6268
|
-
_classCallCheck(this,
|
6269
|
+
_classCallCheck(this, Ni);
|
6269
6270
|
var r, o, a;
|
6270
6271
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6271
6272
|
i = t == null ? void 0 : t.openAI;
|
6272
6273
|
_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>";
|
6273
6274
|
var s = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.textToSpeech;
|
6274
|
-
_typeof(s) == "object" && Object.assign(_this19.rawBody, s), (_o$model = (o = _this19.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model =
|
6275
|
+
_typeof(s) == "object" && Object.assign(_this19.rawBody, s), (_o$model = (o = _this19.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = Ni.DEFAULT_MODEL, (_a$voice = (a = _this19.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = Ni.DEFAULT_VOIDE, _this19.textInputPlaceholderText = "Insert text to generate audio", _this19.rawBody.response_format = "mp3";
|
6275
6276
|
return _this19;
|
6276
6277
|
}
|
6277
|
-
_createClass(
|
6278
|
+
_createClass(Ni, [{
|
6278
6279
|
key: "preprocessBody",
|
6279
6280
|
value: function preprocessBody(e, t) {
|
6280
6281
|
var r, o;
|
@@ -6354,11 +6355,11 @@ var Ki = /*#__PURE__*/function (_z4) {
|
|
6354
6355
|
return extractResultData;
|
6355
6356
|
}()
|
6356
6357
|
}]);
|
6357
|
-
return
|
6358
|
+
return Ni;
|
6358
6359
|
}(z);
|
6359
|
-
|
6360
|
-
|
6361
|
-
var Mo =
|
6360
|
+
Wi.DEFAULT_MODEL = "tts-1";
|
6361
|
+
Wi.DEFAULT_VOIDE = "alloy";
|
6362
|
+
var Mo = Wi;
|
6362
6363
|
var ei = /*#__PURE__*/function (_z5) {
|
6363
6364
|
_inherits(xe, _z5);
|
6364
6365
|
var _super23 = _createSuper(xe);
|
@@ -6853,20 +6854,20 @@ var at = /*#__PURE__*/function () {
|
|
6853
6854
|
}]);
|
6854
6855
|
return at;
|
6855
6856
|
}();
|
6856
|
-
var
|
6857
|
-
_inherits(
|
6858
|
-
var _super26 = _createSuper(
|
6859
|
-
function
|
6857
|
+
var Ki = /*#__PURE__*/function (_z7) {
|
6858
|
+
_inherits(Ki, _z7);
|
6859
|
+
var _super26 = _createSuper(Ki);
|
6860
|
+
function Ki(e) {
|
6860
6861
|
var _this23;
|
6861
|
-
_classCallCheck(this,
|
6862
|
+
_classCallCheck(this, Ki);
|
6862
6863
|
var i;
|
6863
6864
|
var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
|
6864
6865
|
_this23 = _super26.call(this, e, at.buildKeyVerificationDetails(), at.buildHeaders, t, {
|
6865
6866
|
audio: {}
|
6866
|
-
}), _this23.insertKeyPlaceholderText = "AssemblyAI API Key", _this23.getKeyLink = "https://www.assemblyai.com/app/account", _this23.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this23.url = "https://api.assemblyai.com/v2/upload", _this23.isTextInputDisabled = !0, _this23.textInputPlaceholderText = "Upload an audio file", _this23.permittedErrorPrefixes = ["Authentication", "Invalid"], _this23.canSendMessage =
|
6867
|
+
}), _this23.insertKeyPlaceholderText = "AssemblyAI API Key", _this23.getKeyLink = "https://www.assemblyai.com/app/account", _this23.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this23.url = "https://api.assemblyai.com/v2/upload", _this23.isTextInputDisabled = !0, _this23.textInputPlaceholderText = "Upload an audio file", _this23.permittedErrorPrefixes = ["Authentication", "Invalid"], _this23.canSendMessage = Ki.canFileSendMessage;
|
6867
6868
|
return _this23;
|
6868
6869
|
}
|
6869
|
-
_createClass(
|
6870
|
+
_createClass(Ki, [{
|
6870
6871
|
key: "callServiceAPI",
|
6871
6872
|
value: function () {
|
6872
6873
|
var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e, t, i) {
|
@@ -6937,7 +6938,7 @@ var Ji = /*#__PURE__*/function (_z7) {
|
|
6937
6938
|
return !!(t != null && t[0]);
|
6938
6939
|
}
|
6939
6940
|
}]);
|
6940
|
-
return
|
6941
|
+
return Ki;
|
6941
6942
|
}(z);
|
6942
6943
|
var es = /*#__PURE__*/function (_z8) {
|
6943
6944
|
_inherits(es, _z8);
|
@@ -7037,11 +7038,11 @@ ts.HELP_LINK =
|
|
7037
7038
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7038
7039
|
var ko = ts;
|
7039
7040
|
var ns = /*#__PURE__*/function (_es2) {
|
7040
|
-
_inherits(
|
7041
|
-
var _super29 = _createSuper(
|
7042
|
-
function
|
7041
|
+
_inherits(Pi, _es2);
|
7042
|
+
var _super29 = _createSuper(Pi);
|
7043
|
+
function Pi(e) {
|
7043
7044
|
var _this26;
|
7044
|
-
_classCallCheck(this,
|
7045
|
+
_classCallCheck(this, Pi);
|
7045
7046
|
var o, a, l;
|
7046
7047
|
var t = (a = (o = e.directConnection) == null ? void 0 : o.azure) == null ? void 0 : a.speechToText,
|
7047
7048
|
i = (l = e.directConnection) == null ? void 0 : l.azure,
|
@@ -7052,12 +7053,12 @@ var ns = /*#__PURE__*/function (_es2) {
|
|
7052
7053
|
}
|
7053
7054
|
}
|
7054
7055
|
};
|
7055
|
-
_this26 = _super29.call(this, e, $.buildSpeechToTextHeaders, t.region, i, s), _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(
|
7056
|
+
_this26 = _super29.call(this, e, $.buildSpeechToTextHeaders, t.region, i, s), _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(Pi.HELP_LINK, "\">here</a> for more info.\n </p>"), _this26.url = "", _this26.isTextInputDisabled = !0, _this26.textInputPlaceholderText = "Upload an audio file", _this26.canSendMessage = Pi.canFileSendMessage;
|
7056
7057
|
var r = t.lang || "en-US";
|
7057
7058
|
_this26.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this26.recordAudio = void 0;
|
7058
7059
|
return _this26;
|
7059
7060
|
}
|
7060
|
-
_createClass(
|
7061
|
+
_createClass(Pi, [{
|
7061
7062
|
key: "callServiceAPI",
|
7062
7063
|
value: function () {
|
7063
7064
|
var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e, t, i) {
|
@@ -7122,7 +7123,7 @@ var ns = /*#__PURE__*/function (_es2) {
|
|
7122
7123
|
return !!(t != null && t[0]);
|
7123
7124
|
}
|
7124
7125
|
}]);
|
7125
|
-
return
|
7126
|
+
return Pi;
|
7126
7127
|
}(es);
|
7127
7128
|
ns.HELP_LINK =
|
7128
7129
|
// eslint-disable-next-line max-len
|
@@ -7209,7 +7210,7 @@ var Lo = /*#__PURE__*/function (_z9) {
|
|
7209
7210
|
}]);
|
7210
7211
|
return Lo;
|
7211
7212
|
}(z);
|
7212
|
-
var
|
7213
|
+
var Ji = /*#__PURE__*/function (_z10) {
|
7213
7214
|
_inherits(re, _z10);
|
7214
7215
|
var _super31 = _createSuper(re);
|
7215
7216
|
function re(e) {
|
@@ -7435,12 +7436,12 @@ var Yi = /*#__PURE__*/function (_z10) {
|
|
7435
7436
|
return _extractPollResultData5.apply(this, arguments);
|
7436
7437
|
}
|
7437
7438
|
return extractPollResultData;
|
7438
|
-
}()
|
7439
|
+
}() // prettier-ignore
|
7439
7440
|
}, {
|
7440
7441
|
key: "handleTools",
|
7441
7442
|
value: function () {
|
7442
7443
|
var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(e) {
|
7443
|
-
var t, s;
|
7444
|
+
var t, i, s;
|
7444
7445
|
return _regeneratorRuntime().wrap(function _callee68$(_context68) {
|
7445
7446
|
while (1) switch (_context68.prev = _context68.next) {
|
7446
7447
|
case 0:
|
@@ -7459,22 +7460,31 @@ var Yi = /*#__PURE__*/function (_z10) {
|
|
7459
7460
|
_context68.next = 5;
|
7460
7461
|
return this._functionHandler(t);
|
7461
7462
|
case 5:
|
7462
|
-
|
7463
|
+
i = _context68.sent;
|
7464
|
+
if (!(!Array.isArray(i) || i.find(function (r) {
|
7465
|
+
return typeof r != "string";
|
7466
|
+
}) || e.length !== i.length)) {
|
7467
|
+
_context68.next = 8;
|
7468
|
+
break;
|
7469
|
+
}
|
7470
|
+
throw Error("Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.");
|
7471
|
+
case 8:
|
7472
|
+
s = i.map(function (r, o) {
|
7463
7473
|
return {
|
7464
7474
|
tool_call_id: e[o].id,
|
7465
7475
|
output: r
|
7466
7476
|
};
|
7467
7477
|
});
|
7468
7478
|
this.url = "".concat(re.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
|
7469
|
-
_context68.next =
|
7479
|
+
_context68.next = 12;
|
7470
7480
|
return O.directFetch(this, {
|
7471
7481
|
tool_outputs: s
|
7472
7482
|
}, "POST");
|
7473
|
-
case
|
7483
|
+
case 12:
|
7474
7484
|
return _context68.abrupt("return", {
|
7475
7485
|
timeoutMS: re.POLLING_TIMEOUT_MS
|
7476
7486
|
});
|
7477
|
-
case
|
7487
|
+
case 13:
|
7478
7488
|
case "end":
|
7479
7489
|
return _context68.stop();
|
7480
7490
|
}
|
@@ -7488,9 +7498,9 @@ var Yi = /*#__PURE__*/function (_z10) {
|
|
7488
7498
|
}]);
|
7489
7499
|
return re;
|
7490
7500
|
}(z);
|
7491
|
-
|
7492
|
-
|
7493
|
-
var Ro =
|
7501
|
+
Ji.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
7502
|
+
Ji.POLLING_TIMEOUT_MS = 800;
|
7503
|
+
var Ro = Ji;
|
7494
7504
|
var ti = /*#__PURE__*/function (_z11) {
|
7495
7505
|
_inherits(Ee, _z11);
|
7496
7506
|
var _super32 = _createSuper(Ee);
|
@@ -7747,7 +7757,7 @@ var lt = /*#__PURE__*/function (_z12) {
|
|
7747
7757
|
return _extractResultData23.apply(this, arguments);
|
7748
7758
|
}
|
7749
7759
|
return extractResultData;
|
7750
|
-
}()
|
7760
|
+
}() // prettier-ignore
|
7751
7761
|
}, {
|
7752
7762
|
key: "handleTools",
|
7753
7763
|
value: function () {
|
@@ -7781,7 +7791,9 @@ var lt = /*#__PURE__*/function (_z12) {
|
|
7781
7791
|
text: o.text
|
7782
7792
|
});
|
7783
7793
|
case 9:
|
7784
|
-
if (!(s.messages.push(e), Array.isArray(o))
|
7794
|
+
if (!(s.messages.push(e), Array.isArray(o) && !o.find(function (l) {
|
7795
|
+
return typeof l != "string";
|
7796
|
+
}) || r.length === o.length)) {
|
7785
7797
|
_context73.next = 17;
|
7786
7798
|
break;
|
7787
7799
|
}
|
@@ -7811,7 +7823,7 @@ var lt = /*#__PURE__*/function (_z12) {
|
|
7811
7823
|
text: l.choices[0].message.content || ""
|
7812
7824
|
});
|
7813
7825
|
case 17:
|
7814
|
-
throw Error("Response object must
|
7826
|
+
throw Error("Response object must either be {response: string}[] for each individual function or {text: string} for a direct response, see https://deepchat.dev/docs/directConnection/OpenAI#FunctionHandler.");
|
7815
7827
|
case 18:
|
7816
7828
|
case "end":
|
7817
7829
|
return _context73.stop();
|
@@ -7853,8 +7865,8 @@ var lt = /*#__PURE__*/function (_z12) {
|
|
7853
7865
|
}]);
|
7854
7866
|
return lt;
|
7855
7867
|
}(z);
|
7856
|
-
var No = /*#__PURE__*/function (
|
7857
|
-
_inherits(No,
|
7868
|
+
var No = /*#__PURE__*/function (_Vi3) {
|
7869
|
+
_inherits(No, _Vi3);
|
7858
7870
|
var _super34 = _createSuper(No);
|
7859
7871
|
function No(e) {
|
7860
7872
|
var _this31$maxMessages;
|
@@ -7864,18 +7876,12 @@ var No = /*#__PURE__*/function (_Wi3) {
|
|
7864
7876
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7865
7877
|
i = (r = t.cohere) == null ? void 0 : r.chat,
|
7866
7878
|
s = t.cohere;
|
7867
|
-
_this31 = _super34.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, s),
|
7879
|
+
_this31 = _super34.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, s), _typeof(i) == "object" && Object.assign(_this31.rawBody, i), (_this31$maxMessages = _this31.maxMessages) !== null && _this31$maxMessages !== void 0 ? _this31$maxMessages : _this31.maxMessages = -1;
|
7868
7880
|
return _this31;
|
7869
7881
|
}
|
7870
7882
|
_createClass(No, [{
|
7871
|
-
key: "cleanConfig",
|
7872
|
-
value: function cleanConfig(e) {
|
7873
|
-
delete e.user_name;
|
7874
|
-
}
|
7875
|
-
}, {
|
7876
7883
|
key: "preprocessBody",
|
7877
7884
|
value: function preprocessBody(e, t) {
|
7878
|
-
var _this32 = this;
|
7879
7885
|
var i = JSON.parse(JSON.stringify(e)),
|
7880
7886
|
s = t.filter(function (r) {
|
7881
7887
|
return r.text;
|
@@ -7883,7 +7889,7 @@ var No = /*#__PURE__*/function (_Wi3) {
|
|
7883
7889
|
return i.query = s[s.length - 1].text, i.chat_history = s.slice(0, s.length - 1).map(function (r) {
|
7884
7890
|
return {
|
7885
7891
|
text: r.text,
|
7886
|
-
user_name: r.role === "ai" ? "CHATBOT" :
|
7892
|
+
user_name: r.role === "ai" ? "CHATBOT" : "USER"
|
7887
7893
|
};
|
7888
7894
|
}), i;
|
7889
7895
|
}
|
@@ -7943,8 +7949,8 @@ var No = /*#__PURE__*/function (_Wi3) {
|
|
7943
7949
|
}()
|
7944
7950
|
}]);
|
7945
7951
|
return No;
|
7946
|
-
}(
|
7947
|
-
var
|
7952
|
+
}(Vi);
|
7953
|
+
var mn = {
|
7948
7954
|
model_list: [{
|
7949
7955
|
model_url: "http://localhost:3000/files/",
|
7950
7956
|
local_id: "Llama-2-7b-chat-hf-q4f32_1"
|
@@ -8044,32 +8050,32 @@ var Si = {
|
|
8044
8050
|
_inherits(A, _Ie2);
|
8045
8051
|
var _super35 = _createSuper(A);
|
8046
8052
|
function A(e) {
|
8047
|
-
var
|
8053
|
+
var _this32;
|
8048
8054
|
_classCallCheck(this, A);
|
8049
|
-
|
8050
|
-
return
|
8055
|
+
_this32 = _super35.call(this, e), _this32._isModelLoaded = !1, _this32._isModelLoading = !1, _this32._loadOnFirstMessage = !1, _this32.permittedErrorPrefixes = [A.MULTIPLE_MODELS_ERROR, A.WEB_LLM_NOT_FOUND_ERROR, A.GENERIC_ERROR], _this32.webModel = {}, _typeof(e._webModel) == "object" && (_this32.webModel = e._webModel), e.shadowRoot && _this32.findModelInWindow(e.shadowRoot), _this32.canSendMessage = _this32.canSubmit.bind(_assertThisInitialized(_this32));
|
8056
|
+
return _this32;
|
8051
8057
|
}
|
8052
8058
|
_createClass(A, [{
|
8053
8059
|
key: "findModelInWindow",
|
8054
8060
|
value: function findModelInWindow(e) {
|
8055
|
-
var
|
8061
|
+
var _this33 = this;
|
8056
8062
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
8057
8063
|
var i;
|
8058
8064
|
window.webLLM ? setTimeout(function () {
|
8059
|
-
var s =
|
8060
|
-
|
8065
|
+
var s = _this33.addInitialMessage(e);
|
8066
|
+
_this33.configureInit(s);
|
8061
8067
|
}) : t > 5 ? ((i = this.addMessage) == null || i.call(this, {
|
8062
8068
|
error: A.WEB_LLM_NOT_FOUND_ERROR,
|
8063
8069
|
sendUpdate: !1
|
8064
8070
|
}), console.error("The WebLLM module is either not in the project or not been attached to the window object. Please see the following guide:"), console.error("Hello World")) : setTimeout(function () {
|
8065
|
-
|
8071
|
+
_this33.findModelInWindow(e, t + 1);
|
8066
8072
|
}, 1e3);
|
8067
8073
|
}
|
8068
8074
|
}, {
|
8069
8075
|
key: "addInitialMessage",
|
8070
8076
|
value: function addInitialMessage(e) {
|
8071
8077
|
var a, l;
|
8072
|
-
var t =
|
8078
|
+
var t = this.webModel.initialMessage;
|
8073
8079
|
if (!this.webModel || (t == null ? void 0 : t.displayed) === !1) return !1;
|
8074
8080
|
var i = (t == null ? void 0 : t.downloadClass) || A.DOWNLOAD_BUTTON_CLASS,
|
8075
8081
|
s = "\n Download a web model that will run entirely on your browser.\n <br/> <button style=\"margin-top: 10px; margin-bottom: 5px; margin-left: 1px\"\n class=\"".concat(i, " deep-chat-button\">Download</button>"),
|
@@ -8086,29 +8092,31 @@ var Si = {
|
|
8086
8092
|
key: "configureInit",
|
8087
8093
|
value: function () {
|
8088
8094
|
var _configureInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(e) {
|
8095
|
+
var t;
|
8089
8096
|
return _regeneratorRuntime().wrap(function _callee76$(_context76) {
|
8090
8097
|
while (1) switch (_context76.prev = _context76.next) {
|
8091
8098
|
case 0:
|
8092
|
-
|
8093
|
-
|
8099
|
+
t = this.webModel.load;
|
8100
|
+
if (!t) {
|
8101
|
+
_context76.next = 8;
|
8094
8102
|
break;
|
8095
8103
|
}
|
8096
|
-
if (!
|
8097
|
-
_context76.next =
|
8104
|
+
if (!t.onInit) {
|
8105
|
+
_context76.next = 5;
|
8098
8106
|
break;
|
8099
8107
|
}
|
8100
8108
|
this.init();
|
8101
8109
|
return _context76.abrupt("return");
|
8102
|
-
case
|
8103
|
-
if (!
|
8104
|
-
_context76.next =
|
8110
|
+
case 5:
|
8111
|
+
if (!t.onMessage) {
|
8112
|
+
_context76.next = 8;
|
8105
8113
|
break;
|
8106
8114
|
}
|
8107
8115
|
this._loadOnFirstMessage = !0;
|
8108
8116
|
return _context76.abrupt("return");
|
8109
|
-
case 7:
|
8110
|
-
e || this.init();
|
8111
8117
|
case 8:
|
8118
|
+
e || this.init();
|
8119
|
+
case 9:
|
8112
8120
|
case "end":
|
8113
8121
|
return _context76.stop();
|
8114
8122
|
}
|
@@ -8143,50 +8151,44 @@ var Si = {
|
|
8143
8151
|
}, {
|
8144
8152
|
key: "attemptToCreateChat",
|
8145
8153
|
value: function attemptToCreateChat() {
|
8146
|
-
var
|
8154
|
+
var t;
|
8147
8155
|
if (A.chat) {
|
8148
|
-
(
|
8156
|
+
(t = this.addMessage) == null || t.call(this, {
|
8149
8157
|
error: A.MULTIPLE_MODELS_ERROR,
|
8150
8158
|
sendUpdate: !1
|
8151
8159
|
}), console.error(A.MULTIPLE_MODELS_ERROR);
|
8152
8160
|
return;
|
8153
8161
|
}
|
8154
|
-
if (
|
8155
|
-
|
8156
|
-
|
8162
|
+
if (this._isModelLoaded || this._isModelLoading) return;
|
8163
|
+
var e = this.webModel.worker;
|
8164
|
+
return mn.use_web_worker && e ? new window.webLLM.ChatWorkerClient(e) : new window.webLLM.ChatModule();
|
8157
8165
|
}
|
8158
8166
|
}, {
|
8159
8167
|
key: "getConfig",
|
8160
8168
|
value: function getConfig() {
|
8161
8169
|
var e = A.DEFAULT_MODEL;
|
8162
|
-
|
8163
|
-
|
8164
|
-
|
8165
|
-
|
8166
|
-
|
8167
|
-
|
8168
|
-
|
8169
|
-
|
8170
|
-
|
8171
|
-
|
8172
|
-
|
8173
|
-
t.model_lib_map[_i9] && (t.model_lib_map[_i9] = "".concat(this.webModel.wasmUrl).concat(e, "-webgpu.wasm"));
|
8174
|
-
}
|
8175
|
-
return {
|
8176
|
-
model: e,
|
8177
|
-
pConfig: t
|
8178
|
-
};
|
8170
|
+
this.webModel.model && (e = this.webModel.model);
|
8171
|
+
var t = JSON.parse(JSON.stringify(mn));
|
8172
|
+
if (this.webModel.modelUrl) {
|
8173
|
+
var i = t.model_list.find(function (s) {
|
8174
|
+
return s.local_id = e;
|
8175
|
+
});
|
8176
|
+
i && (i.model_url = this.webModel.modelUrl);
|
8177
|
+
}
|
8178
|
+
if (this.webModel.wasmUrl) {
|
8179
|
+
var _i9 = e;
|
8180
|
+
t.model_lib_map[_i9] && (t.model_lib_map[_i9] = "".concat(this.webModel.wasmUrl).concat(e, "-webgpu.wasm"));
|
8179
8181
|
}
|
8180
8182
|
return {
|
8181
8183
|
model: e,
|
8182
|
-
pConfig:
|
8184
|
+
pConfig: t
|
8183
8185
|
};
|
8184
8186
|
}
|
8185
8187
|
}, {
|
8186
8188
|
key: "loadModel",
|
8187
8189
|
value: function () {
|
8188
8190
|
var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(e) {
|
8189
|
-
var
|
8191
|
+
var _this34 = this;
|
8190
8192
|
var i, t, _this$getConfig, s, r;
|
8191
8193
|
return _regeneratorRuntime().wrap(function _callee78$(_context78) {
|
8192
8194
|
while (1) switch (_context78.prev = _context78.next) {
|
@@ -8194,7 +8196,7 @@ var Si = {
|
|
8194
8196
|
A.chat = e, this._isModelLoading = !0;
|
8195
8197
|
t = function t(s) {
|
8196
8198
|
var r;
|
8197
|
-
(r =
|
8199
|
+
(r = _this34.addMessage) == null || r.call(_this34, {
|
8198
8200
|
html: "<div>".concat(s.text, "</div>"),
|
8199
8201
|
overwrite: !0,
|
8200
8202
|
sendUpdate: !1
|
@@ -8420,8 +8422,8 @@ var Do = /*#__PURE__*/function () {
|
|
8420
8422
|
if (r) return new Po(e);
|
8421
8423
|
if (t) {
|
8422
8424
|
if (t.openAI) return t.openAI.images ? new Oo(e) : t.openAI.speechToText ? new To(e) : t.openAI.textToSpeech ? new Mo(e) : t.openAI.assistant ? new Ro(e) : new lt(e);
|
8423
|
-
if (t.assemblyAI) return new
|
8424
|
-
if (t.cohere) return t.cohere.
|
8425
|
+
if (t.assemblyAI) return new Ki(e);
|
8426
|
+
if (t.cohere) return t.cohere.textGeneration ? new wo(e) : t.cohere.summarization ? new _o(e) : new No(e);
|
8425
8427
|
if (t.huggingFace) return t.huggingFace.textGeneration ? new bo(e) : t.huggingFace.summarization ? new yo(e) : t.huggingFace.translation ? new Eo(e) : t.huggingFace.fillMask ? new So(e) : t.huggingFace.questionAnswer ? new vo(e) : t.huggingFace.audioSpeechRecognition ? new go(e) : t.huggingFace.audioClassification ? new fo(e) : t.huggingFace.imageClassification ? new mo(e) : new xo(e);
|
8426
8428
|
if (t.azure) {
|
8427
8429
|
if (t.azure.speechToText) return new Io(e);
|
@@ -8437,22 +8439,22 @@ var Do = /*#__PURE__*/function () {
|
|
8437
8439
|
return Do;
|
8438
8440
|
}();
|
8439
8441
|
var ss = /*#__PURE__*/function () {
|
8440
|
-
function
|
8441
|
-
_classCallCheck(this,
|
8442
|
+
function Di() {
|
8443
|
+
_classCallCheck(this, Di);
|
8442
8444
|
}
|
8443
|
-
_createClass(
|
8445
|
+
_createClass(Di, null, [{
|
8444
8446
|
key: "appendStyleSheetToHead",
|
8445
8447
|
value: function appendStyleSheetToHead() {
|
8446
8448
|
var e = document.getElementsByTagName("head")[0];
|
8447
8449
|
if (!Array.from(e.getElementsByTagName("link")).some(function (i) {
|
8448
|
-
return i.getAttribute("href") ===
|
8450
|
+
return i.getAttribute("href") === Di.FONT_URL;
|
8449
8451
|
})) {
|
8450
8452
|
var i = document.createElement("link");
|
8451
|
-
i.rel = "stylesheet", i.href =
|
8453
|
+
i.rel = "stylesheet", i.href = Di.FONT_URL, e.appendChild(i);
|
8452
8454
|
}
|
8453
8455
|
}
|
8454
8456
|
}]);
|
8455
|
-
return
|
8457
|
+
return Di;
|
8456
8458
|
}();
|
8457
8459
|
ss.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
8458
8460
|
var jo = ss;
|
@@ -8487,11 +8489,11 @@ function y(n) {
|
|
8487
8489
|
i._attributes_[s] = rs.attibutes[n], i._attributeToProperty_[s] = t;
|
8488
8490
|
};
|
8489
8491
|
}
|
8490
|
-
var
|
8491
|
-
function
|
8492
|
-
_classCallCheck(this,
|
8492
|
+
var Yi = /*#__PURE__*/function () {
|
8493
|
+
function Yi() {
|
8494
|
+
_classCallCheck(this, Yi);
|
8493
8495
|
}
|
8494
|
-
_createClass(
|
8496
|
+
_createClass(Yi, null, [{
|
8495
8497
|
key: "colorToHex",
|
8496
8498
|
value: function colorToHex(e) {
|
8497
8499
|
var t = document.createElement("div");
|
@@ -8504,12 +8506,12 @@ var $i = /*#__PURE__*/function () {
|
|
8504
8506
|
value: function set(e, t) {
|
8505
8507
|
var i, s, r, o;
|
8506
8508
|
if ((s = (i = t == null ? void 0 : t.loading) == null ? void 0 : i.bubble) != null && s.color) {
|
8507
|
-
var a =
|
8509
|
+
var a = Yi.colorToHex((o = (r = t == null ? void 0 : t.loading) == null ? void 0 : r.bubble) == null ? void 0 : o.color);
|
8508
8510
|
e.style.setProperty("--message-dots-color", a), e.style.setProperty("--message-dots-color-fade", "".concat(a, "33"));
|
8509
8511
|
} else e.style.setProperty("--message-dots-color", "#848484"), e.style.setProperty("--message-dots-color-fade", "#55555533");
|
8510
8512
|
}
|
8511
8513
|
}]);
|
8512
|
-
return
|
8514
|
+
return Yi;
|
8513
8515
|
}();
|
8514
8516
|
var qt = /*#__PURE__*/function () {
|
8515
8517
|
function qt(e, t, i) {
|
@@ -8696,23 +8698,23 @@ var fe = /*#__PURE__*/function (_Ve) {
|
|
8696
8698
|
_inherits(fe, _Ve);
|
8697
8699
|
var _super36 = _createSuper(fe);
|
8698
8700
|
function fe(e, t, i) {
|
8699
|
-
var
|
8701
|
+
var _this35;
|
8700
8702
|
_classCallCheck(this, fe);
|
8701
8703
|
var a, l;
|
8702
|
-
|
8704
|
+
_this35 = _super36.call(this, e);
|
8703
8705
|
var s = t.permittedErrorPrefixes,
|
8704
8706
|
r = t.introPanelMarkUp,
|
8705
8707
|
o = t.demo;
|
8706
|
-
|
8707
|
-
return JSON.parse(JSON.stringify(
|
8708
|
-
}, e.clearMessages =
|
8709
|
-
|
8708
|
+
_this35._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this35._onClearMessages = Ui.onClearMessages.bind(_assertThisInitialized(_this35), e), _this35._displayLoadingMessage = fe.getDisplayLoadingMessage(e, t), _this35._permittedErrorPrefixes = s, _this35.addSetupMessageIfNeeded(e, t), _this35.populateIntroPanel(i, r, e.introPanelStyle), e.introMessage && _this35.addIntroductoryMessage(e.introMessage), e.initialMessages && _this35.populateInitialMessages(e.initialMessages), _this35._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
8709
|
+
return JSON.parse(JSON.stringify(_this35.messages));
|
8710
|
+
}, e.clearMessages = _this35.clearMessages.bind(_assertThisInitialized(_this35), t), e.refreshMessages = _this35.refreshTextMessages.bind(_assertThisInitialized(_this35)), e.scrollToBottom = ie.scrollToBottom.bind(_assertThisInitialized(_this35), _this35.elementRef), e.addMessage = function (c, d) {
|
8711
|
+
_this35.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
|
8710
8712
|
sendUpdate: !!d
|
8711
8713
|
}), !d);
|
8712
|
-
}, t.addMessage =
|
8713
|
-
|
8714
|
+
}, t.addMessage = _this35.addIOMessage.bind(_assertThisInitialized(_this35)), o && _this35.prepareDemo(o), e.textToSpeech && Lt.processConfig(e.textToSpeech, function (c) {
|
8715
|
+
_this35.textToSpeech = c;
|
8714
8716
|
});
|
8715
|
-
return
|
8717
|
+
return _this35;
|
8716
8718
|
}
|
8717
8719
|
_createClass(fe, [{
|
8718
8720
|
key: "prepareDemo",
|
@@ -8743,11 +8745,11 @@ var fe = /*#__PURE__*/function (_Ve) {
|
|
8743
8745
|
}, {
|
8744
8746
|
key: "populateInitialMessages",
|
8745
8747
|
value: function populateInitialMessages(e) {
|
8746
|
-
var
|
8748
|
+
var _this36 = this;
|
8747
8749
|
e.forEach(function (t) {
|
8748
|
-
Ae.processInitialMessageFile(t),
|
8750
|
+
Ae.processInitialMessageFile(t), _this36.addNewMessage(t, !0);
|
8749
8751
|
}), setTimeout(function () {
|
8750
|
-
return ie.scrollToBottom(
|
8752
|
+
return ie.scrollToBottom(_this36.elementRef);
|
8751
8753
|
});
|
8752
8754
|
}
|
8753
8755
|
// this should not be activated by streamed messages
|
@@ -8827,7 +8829,7 @@ var fe = /*#__PURE__*/function (_Ve) {
|
|
8827
8829
|
i = e.bubbleElement;
|
8828
8830
|
i.classList.add("loading-message-text");
|
8829
8831
|
var s = document.createElement("div");
|
8830
|
-
s.classList.add("dots-flashing"), i.appendChild(s), this.applyCustomStyles(e, b.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading),
|
8832
|
+
s.classList.add("dots-flashing"), i.appendChild(s), this.applyCustomStyles(e, b.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), Yi.set(i, this.messageStyles), this.elementRef.appendChild(t), ie.scrollToBottom(this.elementRef);
|
8831
8833
|
}
|
8832
8834
|
}, {
|
8833
8835
|
key: "populateIntroPanel",
|
@@ -9192,16 +9194,16 @@ var we = /*#__PURE__*/function () {
|
|
9192
9194
|
}]);
|
9193
9195
|
return we;
|
9194
9196
|
}();
|
9195
|
-
var
|
9196
|
-
function
|
9197
|
-
var
|
9198
|
-
_classCallCheck(this,
|
9197
|
+
var $i = /*#__PURE__*/function () {
|
9198
|
+
function $i(e, t) {
|
9199
|
+
var _this37 = this;
|
9200
|
+
_classCallCheck(this, $i);
|
9199
9201
|
var i;
|
9200
|
-
this._isOpen = !0, this._styles = t, this.elementRef =
|
9201
|
-
return
|
9202
|
+
this._isOpen = !0, this._styles = t, this.elementRef = $i.createElement((i = this._styles) == null ? void 0 : i.container), this.close(), setTimeout(function () {
|
9203
|
+
return _this37.addWindowEvents(e);
|
9202
9204
|
});
|
9203
9205
|
}
|
9204
|
-
_createClass(
|
9206
|
+
_createClass($i, [{
|
9205
9207
|
key: "open",
|
9206
9208
|
value: function open() {
|
9207
9209
|
this.elementRef.style.display = "block", this._isOpen = !0;
|
@@ -9226,13 +9228,13 @@ var Zi = /*#__PURE__*/function () {
|
|
9226
9228
|
}, {
|
9227
9229
|
key: "addWindowEvents",
|
9228
9230
|
value: function addWindowEvents(e) {
|
9229
|
-
var
|
9231
|
+
var _this38 = this;
|
9230
9232
|
window.addEventListener("click", function (t) {
|
9231
9233
|
var i;
|
9232
|
-
e.parentElement !== ((i = t.target.shadowRoot) == null ? void 0 : i.children[0]) &&
|
9234
|
+
e.parentElement !== ((i = t.target.shadowRoot) == null ? void 0 : i.children[0]) && _this38.close();
|
9233
9235
|
}), window.addEventListener("keydown", function (t) {
|
9234
9236
|
var i, s, r;
|
9235
|
-
|
9237
|
+
_this38._isOpen && (t.key === R.ESCAPE ? (_this38.close(), (i = _this38.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ENTER ? ((s = _this38.highlightedItem) == null || s.click(), (r = _this38.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ARROW_DOWN ? ft.focusSiblingItem(_this38.highlightedItem || _this38.elementRef.children[_this38.elementRef.children.length - 1], _this38.elementRef, !0) : t.key === R.ARROW_UP && ft.focusSiblingItem(_this38.highlightedItem || _this38.elementRef.children[0], _this38.elementRef, !1));
|
9236
9238
|
});
|
9237
9239
|
}
|
9238
9240
|
}], [{
|
@@ -9242,21 +9244,21 @@ var Zi = /*#__PURE__*/function () {
|
|
9242
9244
|
return t.id = "dropup-menu", Object.assign(t.style, e), t;
|
9243
9245
|
}
|
9244
9246
|
}]);
|
9245
|
-
return
|
9247
|
+
return $i;
|
9246
9248
|
}();
|
9247
9249
|
var We = /*#__PURE__*/function (_xt) {
|
9248
9250
|
_inherits(We, _xt);
|
9249
9251
|
var _super37 = _createSuper(We);
|
9250
9252
|
function We(e, t) {
|
9251
|
-
var
|
9253
|
+
var _this39;
|
9252
9254
|
_classCallCheck(this, We);
|
9253
9255
|
var s;
|
9254
|
-
|
9256
|
+
_this39 = _super37.call(this, We.createButtonElement(), void 0, {
|
9255
9257
|
styles: (s = t == null ? void 0 : t.button) == null ? void 0 : s.styles
|
9256
9258
|
});
|
9257
|
-
var i =
|
9258
|
-
|
9259
|
-
return
|
9259
|
+
var i = _this39.createInnerElements(_this39._customStyles);
|
9260
|
+
_this39._menu = new $i(e, t == null ? void 0 : t.menu), _this39.addClickEvent(), _this39.buttonContainer = We.createButtonContainer(), _this39.elementRef.appendChild(i.styles), _this39.buttonContainer.appendChild(_this39.elementRef), _this39.elementRef.classList.add("dropup-icon", "upload-file-button"), _this39.buttonContainer.appendChild(_this39._menu.elementRef), _this39.reapplyStateStyle("styles"), _this39.addContainerEvents(e);
|
9261
|
+
return _this39;
|
9260
9262
|
}
|
9261
9263
|
_createClass(We, [{
|
9262
9264
|
key: "createInnerElements",
|
@@ -9283,9 +9285,9 @@ var We = /*#__PURE__*/function (_xt) {
|
|
9283
9285
|
}, {
|
9284
9286
|
key: "addContainerEvents",
|
9285
9287
|
value: function addContainerEvents(e) {
|
9286
|
-
var
|
9288
|
+
var _this40 = this;
|
9287
9289
|
e.addEventListener("click", function (t) {
|
9288
|
-
t.target.classList.contains("dropup-icon") ||
|
9290
|
+
t.target.classList.contains("dropup-icon") || _this40._menu.close();
|
9289
9291
|
});
|
9290
9292
|
}
|
9291
9293
|
}], [{
|
@@ -9420,10 +9422,10 @@ var Uo = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
|
|
9420
9422
|
var ce = /*#__PURE__*/function () {
|
9421
9423
|
// prettier-ignore
|
9422
9424
|
function ce(e, t, i, s) {
|
9423
|
-
var
|
9425
|
+
var _this41 = this;
|
9424
9426
|
_classCallCheck(this, ce);
|
9425
9427
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = s, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
9426
|
-
|
9428
|
+
_this41._validationHandler = e._validationHandler;
|
9427
9429
|
});
|
9428
9430
|
}
|
9429
9431
|
_createClass(ce, [{
|
@@ -9439,7 +9441,7 @@ var ce = /*#__PURE__*/function () {
|
|
9439
9441
|
var r = ce.createImageAttachment(t);
|
9440
9442
|
this.addFileAttachment(e, "image", r, i);
|
9441
9443
|
} else if (s === "audio") {
|
9442
|
-
var _r2 =
|
9444
|
+
var _r2 = ji.createAudioAttachment(t);
|
9443
9445
|
this.addFileAttachment(e, "audio", _r2, i);
|
9444
9446
|
} else {
|
9445
9447
|
var _r3 = ce.createAnyFileAttachment(e.name);
|
@@ -9480,7 +9482,7 @@ var ce = /*#__PURE__*/function () {
|
|
9480
9482
|
return r === e;
|
9481
9483
|
}),
|
9482
9484
|
i = this._attachments[t].attachmentContainerElement;
|
9483
|
-
this._attachments.splice(t, 1),
|
9485
|
+
this._attachments.splice(t, 1), ji.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (s = this._validationHandler) == null || s.call(this);
|
9484
9486
|
}
|
9485
9487
|
}, {
|
9486
9488
|
key: "getFiles",
|
@@ -9564,12 +9566,12 @@ var Ko = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9564
9566
|
_createClass(Se, [{
|
9565
9567
|
key: "createTimer",
|
9566
9568
|
value: function createTimer(e, t) {
|
9567
|
-
var
|
9569
|
+
var _this42 = this;
|
9568
9570
|
var i = 0;
|
9569
9571
|
var s = t !== void 0 && t < Se.TIMER_LIMIT_S ? t : Se.TIMER_LIMIT_S;
|
9570
9572
|
return setInterval(function () {
|
9571
9573
|
var a;
|
9572
|
-
i += 1, i === s && ((a =
|
9574
|
+
i += 1, i === s && ((a = _this42.stopPlaceholderCallback) == null || a.call(_this42), _this42.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
9573
9575
|
var r = Math.floor(i / 60),
|
9574
9576
|
o = (i % 60).toString().padStart(2, "0");
|
9575
9577
|
e.textContent = "".concat(r, ":").concat(o);
|
@@ -9589,7 +9591,7 @@ var Ko = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9589
9591
|
}, {
|
9590
9592
|
key: "addPlaceholderAudioAttachmentEvents",
|
9591
9593
|
value: function addPlaceholderAudioAttachmentEvents(e, t, i) {
|
9592
|
-
var
|
9594
|
+
var _this43 = this;
|
9593
9595
|
var s = function s() {
|
9594
9596
|
return e.replaceChildren(t);
|
9595
9597
|
};
|
@@ -9600,7 +9602,7 @@ var Ko = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9600
9602
|
e.addEventListener("mouseleave", r);
|
9601
9603
|
var o = function o() {
|
9602
9604
|
var a;
|
9603
|
-
return (a =
|
9605
|
+
return (a = _this43.stopPlaceholderCallback) == null ? void 0 : a.call(_this43);
|
9604
9606
|
};
|
9605
9607
|
e.addEventListener("click", o);
|
9606
9608
|
}
|
@@ -9668,7 +9670,7 @@ var Ko = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9668
9670
|
return Se;
|
9669
9671
|
}(ce);
|
9670
9672
|
as.TIMER_LIMIT_S = 5999;
|
9671
|
-
var
|
9673
|
+
var ji = as;
|
9672
9674
|
var Jo = /*#__PURE__*/function () {
|
9673
9675
|
function Jo() {
|
9674
9676
|
_classCallCheck(this, Jo);
|
@@ -9678,7 +9680,7 @@ var Jo = /*#__PURE__*/function () {
|
|
9678
9680
|
value:
|
9679
9681
|
// prettier-ignore
|
9680
9682
|
function create(e, t, i, s, r) {
|
9681
|
-
return r === "audio" ? new
|
9683
|
+
return r === "audio" ? new ji(e, t, i, s) : new ce(e, t, i, s);
|
9682
9684
|
}
|
9683
9685
|
}]);
|
9684
9686
|
return Jo;
|
@@ -9795,20 +9797,20 @@ var ls = /*#__PURE__*/function () {
|
|
9795
9797
|
}, {
|
9796
9798
|
key: "addButtons",
|
9797
9799
|
value: function addButtons() {
|
9798
|
-
var
|
9800
|
+
var _this44 = this;
|
9799
9801
|
for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
9800
9802
|
e[_key2] = arguments[_key2];
|
9801
9803
|
}
|
9802
9804
|
e.forEach(function (t) {
|
9803
|
-
return
|
9805
|
+
return _this44._buttonPanel.appendChild(t);
|
9804
9806
|
});
|
9805
9807
|
}
|
9806
9808
|
}, {
|
9807
9809
|
key: "close",
|
9808
9810
|
value: function close() {
|
9809
|
-
var
|
9811
|
+
var _this45 = this;
|
9810
9812
|
this._elementRef.classList.remove("show-modal"), this._elementRef.classList.add("hide-modal"), this._backgroundPanelRef.classList.remove("show-modal-background"), this._backgroundPanelRef.classList.add("hide-modal-background"), this._isOpen = !1, setTimeout(function () {
|
9811
|
-
|
9813
|
+
_this45._elementRef.style.display = "none", _this45._backgroundPanelRef.style.display = "none";
|
9812
9814
|
}, oe.MODAL_CLOSE_TIMEOUT_MS);
|
9813
9815
|
}
|
9814
9816
|
}, {
|
@@ -9824,10 +9826,10 @@ var ls = /*#__PURE__*/function () {
|
|
9824
9826
|
}, {
|
9825
9827
|
key: "addCloseButton",
|
9826
9828
|
value: function addCloseButton(e, t, i) {
|
9827
|
-
var
|
9829
|
+
var _this46 = this;
|
9828
9830
|
var s = t ? oe.createSVGButton(e) : oe.createTextButton(e);
|
9829
9831
|
return this.addButtons(s), s.onclick = function () {
|
9830
|
-
|
9832
|
+
_this46.close(), setTimeout(function () {
|
9831
9833
|
i == null || i();
|
9832
9834
|
}, 140);
|
9833
9835
|
}, s;
|
@@ -9835,10 +9837,10 @@ var ls = /*#__PURE__*/function () {
|
|
9835
9837
|
}, {
|
9836
9838
|
key: "addWindowEvents",
|
9837
9839
|
value: function addWindowEvents() {
|
9838
|
-
var
|
9840
|
+
var _this47 = this;
|
9839
9841
|
window.addEventListener("keydown", function (e) {
|
9840
9842
|
var t, i;
|
9841
|
-
|
9843
|
+
_this47._isOpen && (e.key === R.ESCAPE ? (_this47.close(), (t = _this47.extensionCloseCallback) == null || t.call(_this47)) : e.key === R.ENTER && (_this47.close(), (i = _this47.extensionCloseCallback) == null || i.call(_this47)));
|
9842
9844
|
});
|
9843
9845
|
}
|
9844
9846
|
}], [{
|
@@ -9899,13 +9901,13 @@ var ct = /*#__PURE__*/function (_xt2) {
|
|
9899
9901
|
var _super39 = _createSuper(ct);
|
9900
9902
|
// prettier-ignore
|
9901
9903
|
function ct(e, t, i, s, r, o) {
|
9902
|
-
var
|
9904
|
+
var _this48;
|
9903
9905
|
_classCallCheck(this, ct);
|
9904
9906
|
var l, c, d, u, p, h;
|
9905
|
-
|
9906
|
-
var a =
|
9907
|
-
|
9908
|
-
return
|
9907
|
+
_this48 = _super39.call(this, ct.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
|
9908
|
+
var a = _this48.createInnerElements(s, r, _this48._customStyles);
|
9909
|
+
_this48._inputElement = ct.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this48.addClickEvent(e, i), _this48.elementRef.replaceChildren(a.styles), _this48.reapplyStateStyle("styles"), _this48._fileAttachmentsType = t, _this48._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (h = (p = i.files) == null ? void 0 : p.infoModal) == null ? void 0 : h.openModalOnce;
|
9910
|
+
return _this48;
|
9909
9911
|
}
|
9910
9912
|
_createClass(ct, [{
|
9911
9913
|
key: "createInnerElements",
|
@@ -10123,10 +10125,10 @@ var mt = /*#__PURE__*/function (_xt3) {
|
|
10123
10125
|
_inherits(mt, _xt3);
|
10124
10126
|
var _super40 = _createSuper(mt);
|
10125
10127
|
function mt(e) {
|
10126
|
-
var
|
10128
|
+
var _this49;
|
10127
10129
|
_classCallCheck(this, mt);
|
10128
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"),
|
10129
|
-
return
|
10130
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this49 = _super40.call(this, mt.createMicrophoneElement(), e == null ? void 0 : e.position, e), _this49.isActive = !1, _this49._innerElements = _this49.createInnerElements(_this49._customStyles), _this49.changeToDefault();
|
10131
|
+
return _this49;
|
10130
10132
|
}
|
10131
10133
|
_createClass(mt, [{
|
10132
10134
|
key: "createInnerElements",
|
@@ -10333,9 +10335,9 @@ var J = /*#__PURE__*/function () {
|
|
10333
10335
|
}, {
|
10334
10336
|
key: "keyDownWindow",
|
10335
10337
|
value: function keyDownWindow(e) {
|
10336
|
-
var
|
10338
|
+
var _this50 = this;
|
10337
10339
|
e.element && J.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (J.KEY_DOWN_TIMEOUT !== null && clearTimeout(J.KEY_DOWN_TIMEOUT), J.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
10338
|
-
J.KEY_DOWN_TIMEOUT = null,
|
10340
|
+
J.KEY_DOWN_TIMEOUT = null, _this50.resetRecording(e);
|
10339
10341
|
}, 500));
|
10340
10342
|
}
|
10341
10343
|
}, {
|
@@ -10391,11 +10393,11 @@ Object.defineProperty(Mt, "__esModule", {
|
|
10391
10393
|
value: !0
|
10392
10394
|
});
|
10393
10395
|
Mt.AutoScroll = void 0;
|
10394
|
-
var
|
10395
|
-
function
|
10396
|
-
_classCallCheck(this,
|
10396
|
+
var Zi = /*#__PURE__*/function () {
|
10397
|
+
function Zi() {
|
10398
|
+
_classCallCheck(this, Zi);
|
10397
10399
|
}
|
10398
|
-
_createClass(
|
10400
|
+
_createClass(Zi, null, [{
|
10399
10401
|
key: "changeStateIfNeeded",
|
10400
10402
|
value: function changeStateIfNeeded(e, t) {
|
10401
10403
|
t && !e.isCursorAtEnd && (e.endPadding = "", e.scrollingSpan.innerHTML = " ");
|
@@ -10422,12 +10424,12 @@ var Xi = /*#__PURE__*/function () {
|
|
10422
10424
|
}, {
|
10423
10425
|
key: "isRequired",
|
10424
10426
|
value: function isRequired(e, t) {
|
10425
|
-
return e &&
|
10427
|
+
return e && Zi.isElementOverflown(t);
|
10426
10428
|
}
|
10427
10429
|
}]);
|
10428
|
-
return
|
10430
|
+
return Zi;
|
10429
10431
|
}();
|
10430
|
-
Mt.AutoScroll =
|
10432
|
+
Mt.AutoScroll = Zi;
|
10431
10433
|
var De = {};
|
10432
10434
|
Object.defineProperty(De, "__esModule", {
|
10433
10435
|
value: !0
|
@@ -10805,12 +10807,12 @@ var wn = si,
|
|
10805
10807
|
ra = ri,
|
10806
10808
|
_n = _t,
|
10807
10809
|
kt = Mt,
|
10808
|
-
|
10810
|
+
Si = oi,
|
10809
10811
|
te = De,
|
10810
|
-
|
10812
|
+
wi = ai,
|
10811
10813
|
Mn = Qe,
|
10812
10814
|
Tn = je,
|
10813
|
-
|
10815
|
+
_i = Pe;
|
10814
10816
|
var oa = /*#__PURE__*/function () {
|
10815
10817
|
function oa() {
|
10816
10818
|
_classCallCheck(this, oa);
|
@@ -10832,7 +10834,7 @@ var oa = /*#__PURE__*/function () {
|
|
10832
10834
|
}, {
|
10833
10835
|
key: "prepare",
|
10834
10836
|
value: function prepare(e) {
|
10835
|
-
|
10837
|
+
wi.Padding.setState(this, e), Si.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);
|
10836
10838
|
}
|
10837
10839
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
10838
10840
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -10847,7 +10849,7 @@ var oa = /*#__PURE__*/function () {
|
|
10847
10849
|
key: "updateElements",
|
10848
10850
|
value: function updateElements(e, t, i) {
|
10849
10851
|
var s;
|
10850
|
-
var r =
|
10852
|
+
var r = _i.Text.capitalize(t);
|
10851
10853
|
if (this.finalTranscript === r && e === "") return;
|
10852
10854
|
ra.PreResultUtils.process(this, i, e === "", this._onPreResult, this._options) && (e = "", i = "");
|
10853
10855
|
var o = this.commands && _n.CommandUtils.execCommand(this, i, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
@@ -10865,7 +10867,7 @@ var oa = /*#__PURE__*/function () {
|
|
10865
10867
|
}, {
|
10866
10868
|
key: "updatePrimitiveElement",
|
10867
10869
|
value: function updatePrimitiveElement(e, t, i) {
|
10868
|
-
this.isHighlighted &&
|
10870
|
+
this.isHighlighted && Si.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || wi.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), i && wi.Padding.adjustSateForNoTextPrimitiveElement(this);
|
10869
10871
|
var s = this.startPadding + this.finalTranscript + t;
|
10870
10872
|
if (e.value = s + this.endPadding, !this.isTargetInShadow) {
|
10871
10873
|
var r = s.length + this.numberOfSpacesAfterNewText;
|
@@ -10876,12 +10878,12 @@ var oa = /*#__PURE__*/function () {
|
|
10876
10878
|
}, {
|
10877
10879
|
key: "updateGenericElement",
|
10878
10880
|
value: function updateGenericElement(e, t, i) {
|
10879
|
-
this.isHighlighted &&
|
10880
|
-
var s = (i ? "" : this.startPadding) +
|
10881
|
+
this.isHighlighted && Si.Highlight.removeForGeneric(this, e), this.spansPopulated || te.Elements.appendSpans(this, e);
|
10882
|
+
var s = (i ? "" : this.startPadding) + _i.Text.lineBreak(this.finalTranscript);
|
10881
10883
|
this.finalSpan.innerHTML = s;
|
10882
10884
|
var r = kt.AutoScroll.isRequired(this.autoScroll, e);
|
10883
10885
|
kt.AutoScroll.changeStateIfNeeded(this, r);
|
10884
|
-
var o =
|
10886
|
+
var o = _i.Text.lineBreak(t) + (i ? "" : this.endPadding);
|
10885
10887
|
this.interimSpan.innerHTML = o, Mn.Browser.IS_SAFARI() && this.insertInCursorLocation && Tn.Cursor.setOffsetForSafariGeneric(e, s.length + o.length), r && kt.AutoScroll.scrollGeneric(this, e), i && (this.scrollingSpan.innerHTML = "");
|
10886
10888
|
}
|
10887
10889
|
}, {
|
@@ -10956,22 +10958,22 @@ var Gt = /*#__PURE__*/function (_aa$Speech) {
|
|
10956
10958
|
}, {
|
10957
10959
|
key: "setEvents",
|
10958
10960
|
value: function setEvents() {
|
10959
|
-
var
|
10961
|
+
var _this51 = this;
|
10960
10962
|
this._service && (this._service.onstart = function () {
|
10961
|
-
|
10963
|
+
_this51.setStateOnStart();
|
10962
10964
|
}, this._service.onerror = function (e) {
|
10963
|
-
An.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" &&
|
10965
|
+
An.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" && _this51.isRestarting || e.error !== "no-speech" && _this51.error(e.message || e.error);
|
10964
10966
|
}, this._service.onaudioend = function () {
|
10965
|
-
|
10967
|
+
_this51.setStateOnStop();
|
10966
10968
|
}, this._service.onend = function () {
|
10967
|
-
|
10969
|
+
_this51._stopping = !1;
|
10968
10970
|
}, this._service.onresult = function (e) {
|
10969
|
-
if (_typeof(e.results) > "u" &&
|
10970
|
-
var
|
10971
|
-
t =
|
10972
|
-
i =
|
10973
|
-
s =
|
10974
|
-
|
10971
|
+
if (_typeof(e.results) > "u" && _this51._service) _this51._service.onend = null, _this51._service.stop();else if (_this51._extractText && !_this51._stopping) {
|
10972
|
+
var _this51$_extractText = _this51._extractText(e, _this51.finalTranscript, _this51._translations),
|
10973
|
+
t = _this51$_extractText.interimTranscript,
|
10974
|
+
i = _this51$_extractText.finalTranscript,
|
10975
|
+
s = _this51$_extractText.newText;
|
10976
|
+
_this51.updateElements(t, i, s);
|
10975
10977
|
}
|
10976
10978
|
});
|
10977
10979
|
}
|
@@ -11053,7 +11055,7 @@ Object.defineProperty(ui, "__esModule", {
|
|
11053
11055
|
value: !0
|
11054
11056
|
});
|
11055
11057
|
ui.AzureSpeechConfig = void 0;
|
11056
|
-
var
|
11058
|
+
var Mi = hi;
|
11057
11059
|
var Vt = /*#__PURE__*/function () {
|
11058
11060
|
function Vt() {
|
11059
11061
|
_classCallCheck(this, Vt);
|
@@ -11061,7 +11063,7 @@ var Vt = /*#__PURE__*/function () {
|
|
11061
11063
|
_createClass(Vt, null, [{
|
11062
11064
|
key: "validateOptions",
|
11063
11065
|
value: function validateOptions(e, t) {
|
11064
|
-
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(
|
11066
|
+
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(Mi.README_URL)), !1) : t.region ? !0 : (e("Please define a 'region' property - more info: ".concat(Mi.README_URL)), !1) : (e("Please provide subscription details - more info: ".concat(Mi.README_URL)), !1);
|
11065
11067
|
}
|
11066
11068
|
}, {
|
11067
11069
|
key: "getNewSpeechConfig",
|
@@ -11184,22 +11186,22 @@ Object.defineProperty(ci, "__esModule", {
|
|
11184
11186
|
ci.Azure = void 0;
|
11185
11187
|
var kn = di,
|
11186
11188
|
In = ui,
|
11187
|
-
|
11189
|
+
Ti = pi,
|
11188
11190
|
Ln = fi,
|
11189
11191
|
ua = wt;
|
11190
11192
|
var Wt = /*#__PURE__*/function (_ua$Speech) {
|
11191
11193
|
_inherits(Wt, _ua$Speech);
|
11192
11194
|
var _super42 = _createSuper(Wt);
|
11193
11195
|
function Wt() {
|
11194
|
-
var
|
11196
|
+
var _this52;
|
11195
11197
|
_classCallCheck(this, Wt);
|
11196
|
-
|
11197
|
-
return
|
11198
|
+
_this52 = _super42.apply(this, arguments), _this52._newTextPadding = "";
|
11199
|
+
return _this52;
|
11198
11200
|
}
|
11199
11201
|
_createClass(Wt, [{
|
11200
11202
|
key: "start",
|
11201
11203
|
value: function start(e, t) {
|
11202
|
-
this._newTextPadding = "", this.stopTimeout === void 0 &&
|
11204
|
+
this._newTextPadding = "", this.stopTimeout === void 0 && Ti.StopTimeout.reset(this, e == null ? void 0 : e.stopAfterSilenceMs), this.prepareBeforeStart(e), this.startAsync(e), t || kn.PreventConnectionStop.applyPrevention(this);
|
11203
11205
|
}
|
11204
11206
|
}, {
|
11205
11207
|
key: "startAsync",
|
@@ -11278,7 +11280,7 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11278
11280
|
i = _Ln$AzureTranscript$e.interimTranscript,
|
11279
11281
|
s = _Ln$AzureTranscript$e.finalTranscript,
|
11280
11282
|
r = _Ln$AzureTranscript$e.newText;
|
11281
|
-
|
11283
|
+
Ti.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, s, r);
|
11282
11284
|
}
|
11283
11285
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
11284
11286
|
// function onRecognized(sender, recognitionEventArgs) {
|
@@ -11299,7 +11301,7 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11299
11301
|
s = _Ln$AzureTranscript$e2.interimTranscript,
|
11300
11302
|
r = _Ln$AzureTranscript$e2.finalTranscript,
|
11301
11303
|
o = _Ln$AzureTranscript$e2.newText;
|
11302
|
-
|
11304
|
+
Ti.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(s, r, o), r !== "" && (this._newTextPadding = " ");
|
11303
11305
|
}
|
11304
11306
|
break;
|
11305
11307
|
}
|
@@ -11322,12 +11324,12 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
|
|
11322
11324
|
}, {
|
11323
11325
|
key: "retrieveTokenInterval",
|
11324
11326
|
value: function retrieveTokenInterval(e) {
|
11325
|
-
var
|
11327
|
+
var _this53 = this;
|
11326
11328
|
this._retrieveTokenInterval = setInterval(function () {
|
11327
11329
|
e == null || e().then(function (t) {
|
11328
|
-
|
11330
|
+
_this53._service && (_this53._service.authorizationToken = (t == null ? void 0 : t.trim()) || "");
|
11329
11331
|
})["catch"](function (t) {
|
11330
|
-
|
11332
|
+
_this53.error(t);
|
11331
11333
|
});
|
11332
11334
|
}, 1e4);
|
11333
11335
|
}
|
@@ -11404,29 +11406,29 @@ var Ge = /*#__PURE__*/function () {
|
|
11404
11406
|
}]);
|
11405
11407
|
return Ge;
|
11406
11408
|
}();
|
11407
|
-
var
|
11409
|
+
var Ci = cs["default"] = Ge;
|
11408
11410
|
var Kt = /*#__PURE__*/function (_mt) {
|
11409
11411
|
_inherits(Kt, _mt);
|
11410
11412
|
var _super43 = _createSuper(Kt);
|
11411
11413
|
function Kt(e, t, i) {
|
11412
|
-
var
|
11414
|
+
var _this54;
|
11413
11415
|
_classCallCheck(this, Kt);
|
11414
11416
|
var o;
|
11415
|
-
|
11417
|
+
_this54 = _super43.call(this, _typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {});
|
11416
11418
|
var _Kt$processConfigurat = Kt.processConfiguration(t, e.speechToText),
|
11417
11419
|
s = _Kt$processConfigurat.serviceName,
|
11418
11420
|
r = _Kt$processConfigurat.processedConfig;
|
11419
|
-
if (
|
11421
|
+
if (_this54._addErrorMessage = i, s === "webspeech" && !Ci.isWebSpeechSupported()) _this54.changeToUnsupported();else {
|
11420
11422
|
var a = !e.textInput || !e.textInput.disabled;
|
11421
|
-
|
11423
|
+
_this54.elementRef.onclick = _this54.buttonClick.bind(_assertThisInitialized(_this54), t, a, s, r);
|
11422
11424
|
}
|
11423
|
-
return
|
11425
|
+
return _this54;
|
11424
11426
|
}
|
11425
11427
|
// prettier-ignore
|
11426
11428
|
_createClass(Kt, [{
|
11427
11429
|
key: "buttonClick",
|
11428
11430
|
value: function buttonClick(e, t, i, s) {
|
11429
|
-
e.removeTextIfPlaceholder(),
|
11431
|
+
e.removeTextIfPlaceholder(), Ci.toggle(i, _objectSpread({
|
11430
11432
|
insertInCursorLocation: !1,
|
11431
11433
|
element: t ? e.inputElementRef : void 0,
|
11432
11434
|
onError: this.onError.bind(this),
|
@@ -11464,7 +11466,7 @@ var Kt = /*#__PURE__*/function (_mt) {
|
|
11464
11466
|
return d.toLowerCase().includes(a) ? (setTimeout(function () {
|
11465
11467
|
var u;
|
11466
11468
|
return (u = e.submit) == null ? void 0 : u.call(e);
|
11467
|
-
}),
|
11469
|
+
}), Ci.endCommandMode(), {
|
11468
11470
|
restart: !0,
|
11469
11471
|
removeNewText: !0
|
11470
11472
|
}) : null;
|
@@ -11501,11 +11503,11 @@ var fa = /*#__PURE__*/function (_mt2) {
|
|
11501
11503
|
_inherits(fa, _mt2);
|
11502
11504
|
var _super44 = _createSuper(fa);
|
11503
11505
|
function fa(e, t) {
|
11504
|
-
var
|
11506
|
+
var _this55;
|
11505
11507
|
_classCallCheck(this, fa);
|
11506
11508
|
var i, s;
|
11507
|
-
|
11508
|
-
return
|
11509
|
+
_this55 = _super44.call(this, t.button), _this55._waitingForBrowserApproval = !1, _this55._audioType = e, _this55._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this55._maxDurationSeconds = (s = t.files) == null ? void 0 : s.maxDurationSeconds, _this55.elementRef.onclick = _this55.buttonClick.bind(_assertThisInitialized(_this55));
|
11510
|
+
return _this55;
|
11509
11511
|
}
|
11510
11512
|
_createClass(fa, [{
|
11511
11513
|
key: "buttonClick",
|
@@ -11515,10 +11517,10 @@ var fa = /*#__PURE__*/function (_mt2) {
|
|
11515
11517
|
}, {
|
11516
11518
|
key: "stop",
|
11517
11519
|
value: function stop() {
|
11518
|
-
var
|
11520
|
+
var _this56 = this;
|
11519
11521
|
return new Promise(function (e) {
|
11520
11522
|
var t, i;
|
11521
|
-
|
11523
|
+
_this56.changeToDefault(), (t = _this56._mediaRecorder) == null || t.stop(), (i = _this56._mediaStream) == null || i.getTracks().forEach(function (s) {
|
11522
11524
|
return s.stop();
|
11523
11525
|
}), setTimeout(function () {
|
11524
11526
|
e();
|
@@ -11528,23 +11530,23 @@ var fa = /*#__PURE__*/function (_mt2) {
|
|
11528
11530
|
}, {
|
11529
11531
|
key: "record",
|
11530
11532
|
value: function record() {
|
11531
|
-
var
|
11533
|
+
var _this57 = this;
|
11532
11534
|
navigator.mediaDevices.getUserMedia({
|
11533
11535
|
audio: !0
|
11534
11536
|
}).then(function (e) {
|
11535
|
-
|
11536
|
-
|
11537
|
-
}),
|
11537
|
+
_this57.changeToActive(), _this57._mediaRecorder = new MediaRecorder(e), _this57._audioType.addPlaceholderAttachment(_this57.stop.bind(_this57), _this57._maxDurationSeconds), _this57._mediaStream = e, _this57._mediaRecorder.addEventListener("dataavailable", function (t) {
|
11538
|
+
_this57.createFile(t);
|
11539
|
+
}), _this57._mediaRecorder.start();
|
11538
11540
|
})["catch"](function (e) {
|
11539
|
-
console.error(e),
|
11541
|
+
console.error(e), _this57.stop();
|
11540
11542
|
})["finally"](function () {
|
11541
|
-
|
11543
|
+
_this57._waitingForBrowserApproval = !1;
|
11542
11544
|
});
|
11543
11545
|
}
|
11544
11546
|
}, {
|
11545
11547
|
key: "createFile",
|
11546
11548
|
value: function createFile(e) {
|
11547
|
-
var
|
11549
|
+
var _this58 = this;
|
11548
11550
|
var t = new Blob([e.data], {
|
11549
11551
|
type: "audio/".concat(this._extension)
|
11550
11552
|
}),
|
@@ -11554,7 +11556,7 @@ var fa = /*#__PURE__*/function (_mt2) {
|
|
11554
11556
|
}),
|
11555
11557
|
r = new FileReader();
|
11556
11558
|
r.readAsDataURL(s), r.onload = function (o) {
|
11557
|
-
|
11559
|
+
_this58._audioType.completePlaceholderAttachment(s, o.target.result);
|
11558
11560
|
};
|
11559
11561
|
}
|
11560
11562
|
}]);
|
@@ -11634,19 +11636,19 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11634
11636
|
var _super45 = _createSuper(k);
|
11635
11637
|
// prettier-ignore
|
11636
11638
|
function k(e, t, i, s, r) {
|
11637
|
-
var
|
11639
|
+
var _this59;
|
11638
11640
|
_classCallCheck(this, k);
|
11639
11641
|
var o = Te.process(e.submitButtonStyles);
|
11640
|
-
|
11642
|
+
_this59 = _super45.call(this, k.createButtonContainerElement(), o == null ? void 0 : o.position, o), _this59._isSVGLoadingIconOverriden = !1, _this59.status = {
|
11641
11643
|
requestInProgress: !1,
|
11642
11644
|
loadingActive: !1
|
11643
|
-
},
|
11645
|
+
}, _this59._messages = i, _this59._inputElementRef = t, _this59._fileAttachments = r, _this59._innerElements = _this59.createInnerElements(), _this59._abortStream = new AbortController(), _this59._stopClicked = {
|
11644
11646
|
listener: function listener() {}
|
11645
|
-
},
|
11647
|
+
}, _this59._serviceIO = s, _this59._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.disableSubmitButton = _this59.disableSubmitButton.bind(_assertThisInitialized(_this59), s), _this59.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
11646
11648
|
var a;
|
11647
|
-
|
11649
|
+
_this59._validationHandler = e._validationHandler, _this59.assignHandlers(_this59._validationHandler), (a = _this59._validationHandler) == null || a.call(_assertThisInitialized(_this59));
|
11648
11650
|
});
|
11649
|
-
return
|
11651
|
+
return _this59;
|
11650
11652
|
}
|
11651
11653
|
// prettier-ignore
|
11652
11654
|
_createClass(k, [{
|
@@ -11735,7 +11737,7 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11735
11737
|
key: "programmaticSubmit",
|
11736
11738
|
value: function () {
|
11737
11739
|
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e) {
|
11738
|
-
var
|
11740
|
+
var _this60 = this;
|
11739
11741
|
var t;
|
11740
11742
|
return _regeneratorRuntime().wrap(function _callee96$(_context96) {
|
11741
11743
|
while (1) switch (_context96.prev = _context96.next) {
|
@@ -11750,7 +11752,7 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11750
11752
|
type: ce.getTypeFromBlob(i)
|
11751
11753
|
};
|
11752
11754
|
})), setTimeout(function () {
|
11753
|
-
return
|
11755
|
+
return _this60.attemptSubmit(t, !0);
|
11754
11756
|
});
|
11755
11757
|
case 3:
|
11756
11758
|
case "end":
|
@@ -11794,7 +11796,7 @@ var mi = /*#__PURE__*/function (_xt4) {
|
|
11794
11796
|
return this.addNewMessage(e);
|
11795
11797
|
case 10:
|
11796
11798
|
this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
|
11797
|
-
|
11799
|
+
Bi.clear(this._inputElementRef);
|
11798
11800
|
i = (o = e.files) == null ? void 0 : o.map(function (l) {
|
11799
11801
|
return l.file;
|
11800
11802
|
}), s = {
|
@@ -11923,21 +11925,21 @@ var ba = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
11923
11925
|
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",
|
11924
11926
|
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>",
|
11925
11927
|
xa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
|
11926
|
-
var
|
11927
|
-
_inherits(
|
11928
|
-
var _super46 = _createSuper(
|
11928
|
+
var Xi = /*#__PURE__*/function (_rt) {
|
11929
|
+
_inherits(Xi, _rt);
|
11930
|
+
var _super46 = _createSuper(Xi);
|
11929
11931
|
// prettier-ignore
|
11930
|
-
function
|
11931
|
-
var
|
11932
|
-
_classCallCheck(this,
|
11933
|
-
|
11934
|
-
var
|
11935
|
-
r =
|
11936
|
-
o =
|
11937
|
-
|
11938
|
-
return
|
11939
|
-
}
|
11940
|
-
_createClass(
|
11932
|
+
function Xi(e, t, i, s) {
|
11933
|
+
var _this61;
|
11934
|
+
_classCallCheck(this, Xi);
|
11935
|
+
_this61 = _super46.call(this, e, ["modal-content", "modal-camera-content"], i), _this61._stopped = !1, _this61._format = "image/png", _this61._canvas = document.createElement("canvas"), _this61._canvas.classList.add("camera-modal-canvas");
|
11936
|
+
var _this61$addButtonsAnd = _this61.addButtonsAndTheirEvents(t),
|
11937
|
+
r = _this61$addButtonsAnd.captureButton,
|
11938
|
+
o = _this61$addButtonsAnd.submitButton;
|
11939
|
+
_this61._captureButton = r, _this61._submitButton = o, _this61._captureIcon = _this61._captureButton.children[0], _this61._refreshIcon = U.createSVGElement(ba), _this61._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this61._format = "image/jpeg"), s != null && s.dimensions && (_this61._dimensions = s.dimensions), _this61._contentRef.appendChild(_this61._canvas), _this61.extensionCloseCallback = _this61.stop;
|
11940
|
+
return _this61;
|
11941
|
+
}
|
11942
|
+
_createClass(Xi, [{
|
11941
11943
|
key: "addButtonsAndTheirEvents",
|
11942
11944
|
value: function addButtonsAndTheirEvents(e) {
|
11943
11945
|
var t = rt.createSVGButton(va);
|
@@ -11954,38 +11956,38 @@ var Qi = /*#__PURE__*/function (_rt) {
|
|
11954
11956
|
}, {
|
11955
11957
|
key: "addButtonEvents",
|
11956
11958
|
value: function addButtonEvents(e, t, i, s) {
|
11957
|
-
var
|
11959
|
+
var _this62 = this;
|
11958
11960
|
e.onclick = function () {
|
11959
|
-
|
11961
|
+
_this62.capture();
|
11960
11962
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
11961
|
-
var r =
|
11962
|
-
r && Et.addFilesToType([r], [s]),
|
11963
|
+
var r = _this62.getFile();
|
11964
|
+
r && Et.addFilesToType([r], [s]), _this62.stop(), _this62.close();
|
11963
11965
|
};
|
11964
11966
|
}
|
11965
11967
|
}, {
|
11966
11968
|
key: "stop",
|
11967
11969
|
value: function stop() {
|
11968
|
-
var
|
11970
|
+
var _this63 = this;
|
11969
11971
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
11970
11972
|
return e.stop();
|
11971
11973
|
}), this._stopped = !0, setTimeout(function () {
|
11972
|
-
|
11973
|
-
var e =
|
11974
|
-
e == null || e.clearRect(0, 0,
|
11974
|
+
_this63._captureButton.replaceChildren(_this63._captureIcon), _this63._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
11975
|
+
var e = _this63._canvas.getContext("2d");
|
11976
|
+
e == null || e.clearRect(0, 0, _this63._canvas.width, _this63._canvas.height);
|
11975
11977
|
}, rt.MODAL_CLOSE_TIMEOUT_MS);
|
11976
11978
|
}
|
11977
11979
|
}, {
|
11978
11980
|
key: "start",
|
11979
11981
|
value: function start() {
|
11980
|
-
var
|
11982
|
+
var _this64 = this;
|
11981
11983
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
11982
11984
|
video: this._dimensions || !0
|
11983
11985
|
}).then(function (e) {
|
11984
|
-
if (
|
11986
|
+
if (_this64._mediaStream = e, !_this64.isOpen()) return _this64.stop();
|
11985
11987
|
var t = document.createElement("video");
|
11986
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
11988
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this64.updateCanvas.bind(_this64, t, _this64._canvas));
|
11987
11989
|
})["catch"](function (e) {
|
11988
|
-
console.error(e),
|
11990
|
+
console.error(e), _this64.stop(), _this64.close();
|
11989
11991
|
});
|
11990
11992
|
}
|
11991
11993
|
}, {
|
@@ -12032,24 +12034,24 @@ var Qi = /*#__PURE__*/function (_rt) {
|
|
12032
12034
|
}], [{
|
12033
12035
|
key: "createCameraModalFunc",
|
12034
12036
|
value: function createCameraModalFunc(e, t, i, s) {
|
12035
|
-
var r = new
|
12037
|
+
var r = new Xi(e, t, i, s);
|
12036
12038
|
return r.openCameraModal.bind(r, r);
|
12037
12039
|
}
|
12038
12040
|
}]);
|
12039
|
-
return
|
12041
|
+
return Xi;
|
12040
12042
|
}(rt);
|
12041
12043
|
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>";
|
12042
12044
|
var Jt = /*#__PURE__*/function (_xt5) {
|
12043
12045
|
_inherits(Jt, _xt5);
|
12044
12046
|
var _super47 = _createSuper(Jt);
|
12045
12047
|
function Jt(e, t, i) {
|
12046
|
-
var
|
12048
|
+
var _this65;
|
12047
12049
|
_classCallCheck(this, Jt);
|
12048
12050
|
var r;
|
12049
|
-
|
12050
|
-
var s =
|
12051
|
-
i &&
|
12052
|
-
return
|
12051
|
+
_this65 = _super47.call(this, Jt.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo");
|
12052
|
+
var s = _this65.createInnerElements(_this65._customStyles);
|
12053
|
+
i && _this65.addClickEvent(e, t, i.modalContainerStyle, i.files), _this65.elementRef.classList.add("upload-file-button"), _this65.elementRef.appendChild(s.styles), _this65.reapplyStateStyle("styles");
|
12054
|
+
return _this65;
|
12053
12055
|
}
|
12054
12056
|
_createClass(Jt, [{
|
12055
12057
|
key: "createInnerElements",
|
@@ -12068,7 +12070,7 @@ var Jt = /*#__PURE__*/function (_xt5) {
|
|
12068
12070
|
value:
|
12069
12071
|
// prettier-ignore
|
12070
12072
|
function addClickEvent(e, t, i, s) {
|
12071
|
-
var r =
|
12073
|
+
var r = Xi.createCameraModalFunc(e, t, i, s);
|
12072
12074
|
this.elementRef.onclick = r;
|
12073
12075
|
}
|
12074
12076
|
}], [{
|
@@ -12091,7 +12093,7 @@ var ut = /*#__PURE__*/function () {
|
|
12091
12093
|
function ut(e, t, i, s) {
|
12092
12094
|
_classCallCheck(this, ut);
|
12093
12095
|
this.elementRef = ut.createPanelElement(e.inputAreaStyle);
|
12094
|
-
var r = new
|
12096
|
+
var r = new Bi(e, i),
|
12095
12097
|
o = {},
|
12096
12098
|
a = this.createFileUploadComponents(e, i, s, o);
|
12097
12099
|
e.speechToText && !o.microphone && (o.microphone = {
|
@@ -12162,11 +12164,11 @@ var ut = /*#__PURE__*/function () {
|
|
12162
12164
|
}]);
|
12163
12165
|
return ut;
|
12164
12166
|
}();
|
12165
|
-
var
|
12166
|
-
function
|
12167
|
-
_classCallCheck(this,
|
12167
|
+
var Qi = /*#__PURE__*/function () {
|
12168
|
+
function Qi() {
|
12169
|
+
_classCallCheck(this, Qi);
|
12168
12170
|
}
|
12169
|
-
_createClass(
|
12171
|
+
_createClass(Qi, null, [{
|
12170
12172
|
key: "createElements",
|
12171
12173
|
value: function createElements(e, t, i) {
|
12172
12174
|
var s = document.createElement("div");
|
@@ -12179,11 +12181,11 @@ var en = /*#__PURE__*/function () {
|
|
12179
12181
|
}, {
|
12180
12182
|
key: "render",
|
12181
12183
|
value: function render(e, t, i, s) {
|
12182
|
-
var r =
|
12184
|
+
var r = Qi.createElements(e, i, s);
|
12183
12185
|
t.replaceChildren(r);
|
12184
12186
|
}
|
12185
12187
|
}]);
|
12186
|
-
return
|
12188
|
+
return Qi;
|
12187
12189
|
}();
|
12188
12190
|
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";
|
12189
12191
|
var wa = Object.defineProperty,
|
@@ -12196,22 +12198,22 @@ var v = /*#__PURE__*/function (_co) {
|
|
12196
12198
|
_inherits(v, _co);
|
12197
12199
|
var _super48 = _createSuper(v);
|
12198
12200
|
function v() {
|
12199
|
-
var
|
12201
|
+
var _this66;
|
12200
12202
|
_classCallCheck(this, v);
|
12201
|
-
|
12203
|
+
_this66 = _super48.call(this), _this66.getMessages = function () {
|
12202
12204
|
return [];
|
12203
|
-
},
|
12205
|
+
}, _this66.submitUserMessage = function () {
|
12204
12206
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
12205
|
-
},
|
12207
|
+
}, _this66.addMessage = function () {
|
12206
12208
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
12207
|
-
},
|
12208
|
-
return Yt.focusFromParentElement(
|
12209
|
-
},
|
12209
|
+
}, _this66.focusInput = function () {
|
12210
|
+
return Yt.focusFromParentElement(_this66._elementRef);
|
12211
|
+
}, _this66.refreshMessages = function () {}, _this66.clearMessages = function () {}, _this66.scrollToBottom = function () {}, _this66.disableSubmitButton = function () {}, _this66.onNewMessage = function () {}, _this66.onClearMessages = function () {}, _this66.onComponentRender = function () {}, _this66._webModel = !1, _this66._hasBeenRendered = !1, _this66._auxiliaryStyleApplied = !1, jo.appendStyleSheetToHead(), _this66._elementRef = document.createElement("div"), _this66._elementRef.id = "container", _this66.attachShadow({
|
12210
12212
|
mode: "open"
|
12211
|
-
}).appendChild(
|
12212
|
-
|
12213
|
+
}).appendChild(_this66._elementRef), bi.apply(Sa, _this66.shadowRoot), setTimeout(function () {
|
12214
|
+
_this66._hasBeenRendered || _this66.onRender();
|
12213
12215
|
}, 20);
|
12214
|
-
return
|
12216
|
+
return _this66;
|
12215
12217
|
}
|
12216
12218
|
_createClass(v, [{
|
12217
12219
|
key: "changeToChatView",
|
@@ -12223,7 +12225,7 @@ var v = /*#__PURE__*/function (_co) {
|
|
12223
12225
|
key: "onRender",
|
12224
12226
|
value: function onRender() {
|
12225
12227
|
var _this$_activeService, _this$_childElement;
|
12226
|
-
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = Do.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (bi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), bi.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],
|
12228
|
+
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = Do.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (bi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), bi.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, Ui.onRender(this));
|
12227
12229
|
}
|
12228
12230
|
}]);
|
12229
12231
|
return v;
|