deep-chat-dev 9.0.58 → 9.0.59
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 +1443 -1442
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +2 -2
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +120 -119
- package/dist/types/submitButton.d.ts +1 -1
- package/dist/types/submitButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts +1 -1
- package/dist/views/chat/input/buttons/submit/submitButton.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -40,11 +40,11 @@ var sr = /*#__PURE__*/function () {
|
|
40
40
|
}]);
|
41
41
|
return sr;
|
42
42
|
}();
|
43
|
-
var
|
44
|
-
function
|
45
|
-
_classCallCheck(this,
|
43
|
+
var St = /*#__PURE__*/function () {
|
44
|
+
function St() {
|
45
|
+
_classCallCheck(this, St);
|
46
46
|
}
|
47
|
-
_createClass(
|
47
|
+
_createClass(St, null, [{
|
48
48
|
key: "onLoad",
|
49
49
|
value: function onLoad(e) {
|
50
50
|
e.innerHTML = '<div id="large-loading-ring"></div>';
|
@@ -58,16 +58,16 @@ var Et = /*#__PURE__*/function () {
|
|
58
58
|
}, {
|
59
59
|
key: "render",
|
60
60
|
value: function render(e, t, i) {
|
61
|
-
var r =
|
61
|
+
var r = St.createElements(),
|
62
62
|
s = {
|
63
63
|
onSuccess: t,
|
64
64
|
onFail: sr.render.bind(this, e, "Your 'key' has failed authentication"),
|
65
|
-
onLoad:
|
65
|
+
onLoad: St.onLoad.bind(this, r)
|
66
66
|
};
|
67
67
|
i.key && i.verifyKey(i.key, s), e.replaceChildren(r);
|
68
68
|
}
|
69
69
|
}]);
|
70
|
-
return
|
70
|
+
return St;
|
71
71
|
}();
|
72
72
|
var _ = /*#__PURE__*/function () {
|
73
73
|
function _() {
|
@@ -574,7 +574,7 @@ var fr = globalThis && globalThis.__rest || function (n, e) {
|
|
574
574
|
if (n != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, i = Object.getOwnPropertySymbols(n); r < i.length; r++) e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
575
575
|
return t;
|
576
576
|
};
|
577
|
-
var
|
577
|
+
var Ei = "text/event-stream",
|
578
578
|
mr = 1e3,
|
579
579
|
Yi = "last-event-id";
|
580
580
|
function gr(n, e) {
|
@@ -589,16 +589,16 @@ function gr(n, e) {
|
|
589
589
|
d = fr(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
590
590
|
return new Promise(function (u, p) {
|
591
591
|
var h = Object.assign({}, i);
|
592
|
-
h.accept || (h.accept =
|
592
|
+
h.accept || (h.accept = Ei);
|
593
593
|
var b;
|
594
594
|
function m() {
|
595
595
|
b.abort(), document.hidden || z();
|
596
596
|
}
|
597
597
|
l || document.addEventListener("visibilitychange", m);
|
598
598
|
var g = mr,
|
599
|
-
|
599
|
+
E = 0;
|
600
600
|
function w() {
|
601
|
-
document.removeEventListener("visibilitychange", m), window.clearTimeout(
|
601
|
+
document.removeEventListener("visibilitychange", m), window.clearTimeout(E), b.abort();
|
602
602
|
}
|
603
603
|
t == null || t.addEventListener("abort", function () {
|
604
604
|
w(), u();
|
@@ -643,7 +643,7 @@ function gr(n, e) {
|
|
643
643
|
_context3.t0 = _context3["catch"](1);
|
644
644
|
if (!b.signal.aborted) try {
|
645
645
|
F = (Ae = a == null ? void 0 : a(_context3.t0)) !== null && Ae !== void 0 ? Ae : g;
|
646
|
-
window.clearTimeout(
|
646
|
+
window.clearTimeout(E), E = window.setTimeout(z, F);
|
647
647
|
} catch (F) {
|
648
648
|
w(), p(F);
|
649
649
|
}
|
@@ -660,7 +660,7 @@ function gr(n, e) {
|
|
660
660
|
}
|
661
661
|
function br(n) {
|
662
662
|
var e = n.headers.get("content-type");
|
663
|
-
if (!(e != null && e.startsWith(
|
663
|
+
if (!(e != null && e.startsWith(Ei))) throw new Error("Expected content-type to be ".concat(Ei, ", Actual: ").concat(e));
|
664
664
|
}
|
665
665
|
var Tn = /*#__PURE__*/function () {
|
666
666
|
function Ve() {
|
@@ -751,7 +751,7 @@ var B = /*#__PURE__*/function () {
|
|
751
751
|
b,
|
752
752
|
m,
|
753
753
|
g,
|
754
|
-
|
754
|
+
E,
|
755
755
|
s,
|
756
756
|
_yield$M$processReque,
|
757
757
|
o,
|
@@ -802,7 +802,7 @@ var B = /*#__PURE__*/function () {
|
|
802
802
|
case 18:
|
803
803
|
p = null;
|
804
804
|
gr(((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", {
|
805
|
-
method: ((
|
805
|
+
method: ((E = e.requestSettings) == null ? void 0 : E.method) || "POST",
|
806
806
|
headers: a,
|
807
807
|
body: r ? JSON.stringify(o) : o,
|
808
808
|
openWhenHidden: !0,
|
@@ -1069,11 +1069,11 @@ var xe = /*#__PURE__*/function () {
|
|
1069
1069
|
}]);
|
1070
1070
|
return xe;
|
1071
1071
|
}();
|
1072
|
-
var
|
1073
|
-
function
|
1074
|
-
_classCallCheck(this,
|
1072
|
+
var S = /*#__PURE__*/function () {
|
1073
|
+
function S() {
|
1074
|
+
_classCallCheck(this, S);
|
1075
1075
|
}
|
1076
|
-
_createClass(
|
1076
|
+
_createClass(S, null, [{
|
1077
1077
|
key: "request",
|
1078
1078
|
value: // prettier-ignore
|
1079
1079
|
function () {
|
@@ -1112,7 +1112,7 @@ var E = /*#__PURE__*/function () {
|
|
1112
1112
|
_context11.next = 11;
|
1113
1113
|
break;
|
1114
1114
|
}
|
1115
|
-
return _context11.abrupt("return",
|
1115
|
+
return _context11.abrupt("return", S.onInterceptorError(i, l, c));
|
1116
1116
|
case 11:
|
1117
1117
|
if (!((p = e.requestSettings) != null && p.handler)) {
|
1118
1118
|
_context11.next = 13;
|
@@ -1137,7 +1137,7 @@ var E = /*#__PURE__*/function () {
|
|
1137
1137
|
return M.processResponseByType(g);
|
1138
1138
|
}).then( /*#__PURE__*/function () {
|
1139
1139
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(g) {
|
1140
|
-
var I, G,
|
1140
|
+
var I, G, E, w;
|
1141
1141
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
1142
1142
|
while (1) switch (_context10.prev = _context10.next) {
|
1143
1143
|
case 0:
|
@@ -1157,9 +1157,9 @@ var E = /*#__PURE__*/function () {
|
|
1157
1157
|
}
|
1158
1158
|
_context10.t0 = g;
|
1159
1159
|
case 7:
|
1160
|
-
|
1160
|
+
E = _context10.t0;
|
1161
1161
|
_context10.next = 10;
|
1162
|
-
return e.extractResultData(
|
1162
|
+
return e.extractResultData(E);
|
1163
1163
|
case 10:
|
1164
1164
|
w = _context10.sent;
|
1165
1165
|
if (d) {
|
@@ -1172,7 +1172,7 @@ var E = /*#__PURE__*/function () {
|
|
1172
1172
|
_context10.next = 15;
|
1173
1173
|
break;
|
1174
1174
|
}
|
1175
|
-
throw Error(T.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor,
|
1175
|
+
throw Error(T.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, E));
|
1176
1176
|
case 15:
|
1177
1177
|
w.pollingInAnotherRequest || (e.deepChat.stream && w.text ? B.simulate(i, e.streamHandlers, w.text) : (i.addNewMessage(w, !0), c()));
|
1178
1178
|
case 16:
|
@@ -1234,7 +1234,7 @@ var E = /*#__PURE__*/function () {
|
|
1234
1234
|
case 11:
|
1235
1235
|
a = _context12.sent;
|
1236
1236
|
a.timeoutMS ? setTimeout(function () {
|
1237
|
-
|
1237
|
+
S.executePollRequest(e, t, i, r);
|
1238
1238
|
}, a.timeoutMS) : (console.log("finished polling"), r.addNewMessage(a, !0), s());
|
1239
1239
|
case 13:
|
1240
1240
|
case "end":
|
@@ -1287,14 +1287,14 @@ var E = /*#__PURE__*/function () {
|
|
1287
1287
|
_context13.next = 10;
|
1288
1288
|
break;
|
1289
1289
|
}
|
1290
|
-
return _context13.abrupt("return",
|
1290
|
+
return _context13.abrupt("return", S.onInterceptorError(i, l));
|
1291
1291
|
case 10:
|
1292
1292
|
c = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", d = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", u = r ? JSON.stringify(o) : o, p = {
|
1293
1293
|
method: d,
|
1294
1294
|
body: u,
|
1295
1295
|
headers: a
|
1296
1296
|
};
|
1297
|
-
|
1297
|
+
S.executePollRequest(e, c, p, i);
|
1298
1298
|
case 12:
|
1299
1299
|
case "end":
|
1300
1300
|
return _context13.stop();
|
@@ -1329,7 +1329,7 @@ var E = /*#__PURE__*/function () {
|
|
1329
1329
|
});
|
1330
1330
|
}
|
1331
1331
|
}]);
|
1332
|
-
return
|
1332
|
+
return S;
|
1333
1333
|
}();
|
1334
1334
|
var Qe = /*#__PURE__*/function () {
|
1335
1335
|
function Qe() {
|
@@ -1598,7 +1598,7 @@ function Xe(n) {
|
|
1598
1598
|
function Ln(n) {
|
1599
1599
|
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);
|
1600
1600
|
}
|
1601
|
-
function
|
1601
|
+
function Si(n) {
|
1602
1602
|
if (n > 65535) {
|
1603
1603
|
n -= 65536;
|
1604
1604
|
var e = 55296 + (n >> 10),
|
@@ -1607,15 +1607,15 @@ function Ei(n) {
|
|
1607
1607
|
}
|
1608
1608
|
return String.fromCharCode(n);
|
1609
1609
|
}
|
1610
|
-
var
|
1611
|
-
|
1610
|
+
var Er = /&([a-z#][a-z0-9]{1,31});/gi,
|
1611
|
+
Sr = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
|
1612
1612
|
function wr(n, e) {
|
1613
1613
|
var t = 0,
|
1614
1614
|
i = An(e);
|
1615
|
-
return e !== i ? i : e.charCodeAt(0) === 35 &&
|
1615
|
+
return e !== i ? i : e.charCodeAt(0) === 35 && Sr.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), Ln(t)) ? Si(t) : n;
|
1616
1616
|
}
|
1617
|
-
function
|
1618
|
-
return n.indexOf("&") < 0 ? n : n.replace(
|
1617
|
+
function Ee(n) {
|
1618
|
+
return n.indexOf("&") < 0 ? n : n.replace(Er, wr);
|
1619
1619
|
}
|
1620
1620
|
var _r = /[&<>"]/,
|
1621
1621
|
Mr = /[&<>"]/g,
|
@@ -1636,10 +1636,10 @@ f.blockquote_open = function () {
|
|
1636
1636
|
return "<blockquote>\n";
|
1637
1637
|
};
|
1638
1638
|
f.blockquote_close = function (n, e) {
|
1639
|
-
return "</blockquote>" +
|
1639
|
+
return "</blockquote>" + Se(n, e);
|
1640
1640
|
};
|
1641
1641
|
f.code = function (n, e) {
|
1642
|
-
return n[e].block ? "<pre><code>" + j(n[e].content) + "</code></pre>" +
|
1642
|
+
return n[e].block ? "<pre><code>" + j(n[e].content) + "</code></pre>" + Se(n, e) : "<code>" + j(n[e].content) + "</code>";
|
1643
1643
|
};
|
1644
1644
|
f.fence = function (n, e, t, i, r) {
|
1645
1645
|
var s = n[e],
|
@@ -1651,9 +1651,9 @@ f.fence = function (n, e, t, i, r) {
|
|
1651
1651
|
u;
|
1652
1652
|
if (s.params) {
|
1653
1653
|
if (c = s.params.split(/\s+/g), d = c.join(" "), yr(r.rules.fence_custom, c[0])) return r.rules.fence_custom[c[0]](n, e, t, i, r);
|
1654
|
-
l = j(
|
1654
|
+
l = j(Ee(Xe(d))), o = ' class="' + a + l + '"';
|
1655
1655
|
}
|
1656
|
-
return t.highlight ? u = t.highlight.apply(t.highlight, [s.content].concat(c)) || j(s.content) : u = j(s.content), "<pre><code" + o + ">" + u + "</code></pre>" +
|
1656
|
+
return t.highlight ? u = t.highlight.apply(t.highlight, [s.content].concat(c)) || j(s.content) : u = j(s.content), "<pre><code" + o + ">" + u + "</code></pre>" + Se(n, e);
|
1657
1657
|
};
|
1658
1658
|
f.fence_custom = {};
|
1659
1659
|
f.heading_open = function (n, e) {
|
@@ -1663,13 +1663,13 @@ f.heading_close = function (n, e) {
|
|
1663
1663
|
return "</h" + n[e].hLevel + ">\n";
|
1664
1664
|
};
|
1665
1665
|
f.hr = function (n, e, t) {
|
1666
|
-
return (t.xhtmlOut ? "<hr />" : "<hr>") +
|
1666
|
+
return (t.xhtmlOut ? "<hr />" : "<hr>") + Se(n, e);
|
1667
1667
|
};
|
1668
1668
|
f.bullet_list_open = function () {
|
1669
1669
|
return "<ul>\n";
|
1670
1670
|
};
|
1671
1671
|
f.bullet_list_close = function (n, e) {
|
1672
|
-
return "</ul>" +
|
1672
|
+
return "</ul>" + Se(n, e);
|
1673
1673
|
};
|
1674
1674
|
f.list_item_open = function () {
|
1675
1675
|
return "<li>";
|
@@ -1683,17 +1683,17 @@ f.ordered_list_open = function (n, e) {
|
|
1683
1683
|
return "<ol" + i + ">\n";
|
1684
1684
|
};
|
1685
1685
|
f.ordered_list_close = function (n, e) {
|
1686
|
-
return "</ol>" +
|
1686
|
+
return "</ol>" + Se(n, e);
|
1687
1687
|
};
|
1688
1688
|
f.paragraph_open = function (n, e) {
|
1689
1689
|
return n[e].tight ? "" : "<p>";
|
1690
1690
|
};
|
1691
1691
|
f.paragraph_close = function (n, e) {
|
1692
1692
|
var t = !(n[e].tight && e && n[e - 1].type === "inline" && !n[e - 1].content);
|
1693
|
-
return (n[e].tight ? "" : "</p>") + (t ?
|
1693
|
+
return (n[e].tight ? "" : "</p>") + (t ? Se(n, e) : "");
|
1694
1694
|
};
|
1695
1695
|
f.link_open = function (n, e, t) {
|
1696
|
-
var i = n[e].title ? ' title="' + j(
|
1696
|
+
var i = n[e].title ? ' title="' + j(Ee(n[e].title)) + '"' : "",
|
1697
1697
|
r = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
|
1698
1698
|
return '<a href="' + j(n[e].href) + '"' + i + r + ">";
|
1699
1699
|
};
|
@@ -1702,8 +1702,8 @@ f.link_close = function () {
|
|
1702
1702
|
};
|
1703
1703
|
f.image = function (n, e, t) {
|
1704
1704
|
var i = ' src="' + j(n[e].src) + '"',
|
1705
|
-
r = n[e].title ? ' title="' + j(
|
1706
|
-
s = ' alt="' + (n[e].alt ? j(
|
1705
|
+
r = n[e].title ? ' title="' + j(Ee(n[e].title)) + '"' : "",
|
1706
|
+
s = ' alt="' + (n[e].alt ? j(Ee(Xe(n[e].alt))) : "") + '"',
|
1707
1707
|
o = t.xhtmlOut ? " /" : "";
|
1708
1708
|
return "<img" + i + s + r + o + ">";
|
1709
1709
|
};
|
@@ -1797,7 +1797,7 @@ f.htmltag = function (n, e) {
|
|
1797
1797
|
return n[e].content;
|
1798
1798
|
};
|
1799
1799
|
f.abbr_open = function (n, e) {
|
1800
|
-
return '<abbr title="' + j(
|
1800
|
+
return '<abbr title="' + j(Ee(n[e].title)) + '">';
|
1801
1801
|
};
|
1802
1802
|
f.abbr_close = function () {
|
1803
1803
|
return "</abbr>";
|
@@ -1847,7 +1847,7 @@ f.dd_close = function () {
|
|
1847
1847
|
function Rn(n, e) {
|
1848
1848
|
return ++e >= n.length - 2 ? e : n[e].type === "paragraph_open" && n[e].tight && n[e + 1].type === "inline" && n[e + 1].content.length === 0 && n[e + 2].type === "paragraph_close" && n[e + 2].tight ? Rn(n, e + 2) : e;
|
1849
1849
|
}
|
1850
|
-
var
|
1850
|
+
var Se = f.getBreak = function (e, t) {
|
1851
1851
|
return t = Rn(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1852
1852
|
};
|
1853
1853
|
function Ri() {
|
@@ -2005,7 +2005,7 @@ function Ir(n) {
|
|
2005
2005
|
}
|
2006
2006
|
}
|
2007
2007
|
function wi(n) {
|
2008
|
-
var e =
|
2008
|
+
var e = Ee(n);
|
2009
2009
|
try {
|
2010
2010
|
e = decodeURI(e);
|
2011
2011
|
} catch (_unused2) {}
|
@@ -2224,24 +2224,24 @@ function Ie(n, e, t) {
|
|
2224
2224
|
return n.substr(0, e) + t + n.substr(e + 1);
|
2225
2225
|
}
|
2226
2226
|
function Hr(n) {
|
2227
|
-
var e, t, i, r, s, o, a, l, c, d, u, p, h, b, m, g,
|
2227
|
+
var e, t, i, r, s, o, a, l, c, d, u, p, h, b, m, g, E;
|
2228
2228
|
if (n.options.typographer) {
|
2229
|
-
for (
|
2230
|
-
for (g = n.tokens[m].children,
|
2231
|
-
for (a = g[e].level, h =
|
2232
|
-
|
2229
|
+
for (E = [], m = n.tokens.length - 1; m >= 0; m--) if (n.tokens[m].type === "inline") {
|
2230
|
+
for (g = n.tokens[m].children, E.length = 0, e = 0; e < g.length; e++) if (t = g[e], !(t.type !== "text" || Ur.test(t.text))) {
|
2231
|
+
for (a = g[e].level, h = E.length - 1; h >= 0 && !(E[h].level <= a); h--);
|
2232
|
+
E.length = h + 1, i = t.content, s = 0, o = i.length;
|
2233
2233
|
e: for (; s < o && (Zi.lastIndex = s, r = Zi.exec(i), !!r);) {
|
2234
2234
|
if (l = !Xi(i, r.index - 1), s = r.index + 1, b = r[0] === "'", c = !Xi(i, s), !c && !l) {
|
2235
2235
|
b && (t.content = Ie(t.content, r.index, Qi));
|
2236
2236
|
continue;
|
2237
2237
|
}
|
2238
2238
|
if (u = !c, p = !l, p) {
|
2239
|
-
for (h =
|
2240
|
-
d =
|
2239
|
+
for (h = E.length - 1; h >= 0 && (d = E[h], !(E[h].level < a)); h--) if (d.single === b && E[h].level === a) {
|
2240
|
+
d = E[h], b ? (g[d.token].content = Ie(g[d.token].content, d.pos, n.options.quotes[2]), t.content = Ie(t.content, r.index, n.options.quotes[3])) : (g[d.token].content = Ie(g[d.token].content, d.pos, n.options.quotes[0]), t.content = Ie(t.content, r.index, n.options.quotes[1])), E.length = h;
|
2241
2241
|
continue e;
|
2242
2242
|
}
|
2243
2243
|
}
|
2244
|
-
u ?
|
2244
|
+
u ? E.push({
|
2245
2245
|
token: e,
|
2246
2246
|
pos: r.index,
|
2247
2247
|
single: b,
|
@@ -2443,7 +2443,7 @@ function Yr(n, e, t, i) {
|
|
2443
2443
|
b,
|
2444
2444
|
m,
|
2445
2445
|
g,
|
2446
|
-
|
2446
|
+
E,
|
2447
2447
|
w,
|
2448
2448
|
I,
|
2449
2449
|
G,
|
@@ -2465,14 +2465,14 @@ function Yr(n, e, t, i) {
|
|
2465
2465
|
type: "bullet_list_open",
|
2466
2466
|
lines: G = [e, 0],
|
2467
2467
|
level: n.level++
|
2468
|
-
}), r = e, I = !1, se = n.parser.ruler.getRules("list"); r < t && (
|
2468
|
+
}), r = e, I = !1, se = n.parser.ruler.getRules("list"); r < t && (E = n.skipSpaces(u), p = n.eMarks[r], E >= p ? h = 1 : h = E - u, h > 4 && (h = 1), h < 1 && (h = 1), s = u - n.bMarks[r] + h, n.tokens.push({
|
2469
2469
|
type: "list_item_open",
|
2470
2470
|
lines: z = [e, 0],
|
2471
2471
|
level: n.level++
|
2472
|
-
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] =
|
2472
|
+
}), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = E - n.bMarks[e], n.blkIndent = s, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || I) && (Ae = !1), I = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
|
2473
2473
|
type: "list_item_close",
|
2474
2474
|
level: --n.level
|
2475
|
-
}), r = e = n.line, z[1] = r,
|
2475
|
+
}), r = e = n.line, z[1] = r, E = n.bMarks[e], !(r >= t || n.isEmpty(r) || n.tShift[r] < n.blkIndent));) {
|
2476
2476
|
for (ci = !1, F = 0, Wi = se.length; F < Wi; F++) if (se[F](n, r, t, !0)) {
|
2477
2477
|
ci = !0;
|
2478
2478
|
break;
|
@@ -2691,7 +2691,7 @@ function rs(n, e) {
|
|
2691
2691
|
for (t = e + 2, i = n.tokens.length - 2; t < i; t++) n.tokens[t].level === r && n.tokens[t].type === "paragraph_open" && (n.tokens[t + 2].tight = !0, n.tokens[t].tight = !0, t += 2);
|
2692
2692
|
}
|
2693
2693
|
function ss(n, e, t, i) {
|
2694
|
-
var r, s, o, a, l, c, d, u, p, h, b, m, g,
|
2694
|
+
var r, s, o, a, l, c, d, u, p, h, b, m, g, E;
|
2695
2695
|
if (i) return n.ddIndent < 0 ? !1 : ft(n, e) >= 0;
|
2696
2696
|
if (d = e + 1, n.isEmpty(d) && ++d > t || n.tShift[d] < n.blkIndent || (r = ft(n, d), r < 0) || n.level >= n.options.maxNesting) return !1;
|
2697
2697
|
c = n.tokens.length, n.tokens.push({
|
@@ -2700,7 +2700,7 @@ function ss(n, e, t, i) {
|
|
2700
2700
|
level: n.level++
|
2701
2701
|
}), o = e, s = d;
|
2702
2702
|
e: for (;;) {
|
2703
|
-
for (
|
2703
|
+
for (E = !0, g = !1, n.tokens.push({
|
2704
2704
|
type: "dt_open",
|
2705
2705
|
lines: [o, o],
|
2706
2706
|
level: n.level++
|
@@ -2718,7 +2718,7 @@ function ss(n, e, t, i) {
|
|
2718
2718
|
type: "dd_open",
|
2719
2719
|
lines: a = [d, 0],
|
2720
2720
|
level: n.level++
|
2721
|
-
}), m = n.tight, p = n.ddIndent, u = n.blkIndent, b = n.tShift[s], h = n.parentType, n.blkIndent = n.ddIndent = n.tShift[s] + 2, n.tShift[s] = r - n.bMarks[s], n.tight = !0, n.parentType = "deflist", n.parser.tokenize(n, s, t, !0), (!n.tight || g) && (
|
2721
|
+
}), m = n.tight, p = n.ddIndent, u = n.blkIndent, b = n.tShift[s], h = n.parentType, n.blkIndent = n.ddIndent = n.tShift[s] + 2, n.tShift[s] = r - n.bMarks[s], n.tight = !0, n.parentType = "deflist", n.parser.tokenize(n, s, t, !0), (!n.tight || g) && (E = !1), g = n.line - s > 1 && n.isEmpty(n.line - 1), n.tShift[s] = b, n.tight = m, n.parentType = h, n.blkIndent = u, n.ddIndent = p, n.tokens.push({
|
2722
2722
|
type: "dd_close",
|
2723
2723
|
level: --n.level
|
2724
2724
|
}), a[1] = d = n.line, d >= t || n.tShift[d] < n.blkIndent) break e;
|
@@ -2730,7 +2730,7 @@ function ss(n, e, t, i) {
|
|
2730
2730
|
return n.tokens.push({
|
2731
2731
|
type: "dl_close",
|
2732
2732
|
level: --n.level
|
2733
|
-
}), l[1] = d, n.line = d,
|
2733
|
+
}), l[1] = d, n.line = d, E && rs(n, c), !0;
|
2734
2734
|
}
|
2735
2735
|
function os(n, e) {
|
2736
2736
|
var t,
|
@@ -3064,8 +3064,8 @@ function xs(n, e) {
|
|
3064
3064
|
content: i.replace(ys, "$1")
|
3065
3065
|
}), n.pos = n.posMax + 1, n.posMax = r, !0);
|
3066
3066
|
}
|
3067
|
-
var
|
3068
|
-
function
|
3067
|
+
var Es = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
|
3068
|
+
function Ss(n, e) {
|
3069
3069
|
var t,
|
3070
3070
|
i,
|
3071
3071
|
r = n.posMax,
|
@@ -3081,7 +3081,7 @@ function Es(n, e) {
|
|
3081
3081
|
return !t || s + 1 === n.pos || (i = n.src.slice(s + 1, n.pos), i.match(/(^|[^\\])(\\\\)*\s/)) ? (n.pos = s, !1) : (n.posMax = n.pos, n.pos = s + 1, e || n.push({
|
3082
3082
|
type: "sup",
|
3083
3083
|
level: n.level,
|
3084
|
-
content: i.replace(
|
3084
|
+
content: i.replace(Es, "$1")
|
3085
3085
|
}), n.pos = n.posMax + 1, n.posMax = r, !0);
|
3086
3086
|
}
|
3087
3087
|
function ws(n, e) {
|
@@ -3243,7 +3243,7 @@ function Ks(n, e) {
|
|
3243
3243
|
if (n.src.charCodeAt(s) !== 38) return !1;
|
3244
3244
|
if (s + 1 < o) {
|
3245
3245
|
if (t = n.src.charCodeAt(s + 1), t === 35) {
|
3246
|
-
if (r = n.src.slice(s).match(Vs), r) return e || (i = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), n.pending += Ln(i) ?
|
3246
|
+
if (r = n.src.slice(s).match(Vs), r) return e || (i = r[1][0].toLowerCase() === "x" ? parseInt(r[1].slice(1), 16) : parseInt(r[1], 10), n.pending += Ln(i) ? Si(i) : Si(65533)), n.pos += r[0].length, !0;
|
3247
3247
|
} else if (r = n.src.slice(s).match(Ws), r) {
|
3248
3248
|
var a = An(r[1]);
|
3249
3249
|
if (r[1] !== a) return e || (n.pending += a), n.pos += r[0].length, !0;
|
@@ -3251,7 +3251,7 @@ function Ks(n, e) {
|
|
3251
3251
|
}
|
3252
3252
|
return e || (n.pending += "&"), n.pos++, !0;
|
3253
3253
|
}
|
3254
|
-
var fi = [["text", us], ["newline", hs], ["escape", ps], ["backticks", fs], ["del", ms], ["ins", gs], ["mark", bs], ["emphasis", vs], ["sub", xs], ["sup",
|
3254
|
+
var fi = [["text", us], ["newline", hs], ["escape", ps], ["backticks", fs], ["del", ms], ["ins", gs], ["mark", bs], ["emphasis", vs], ["sub", xs], ["sup", Ss], ["links", ws], ["footnote_inline", _s], ["footnote_ref", Ms], ["autolink", As], ["htmltag", Gs], ["entity", Ks]];
|
3255
3255
|
function Gt() {
|
3256
3256
|
this.ruler = new H();
|
3257
3257
|
for (var n = 0; n < fi.length; n++) this.ruler.push(fi[n][0], fi[n][1]);
|
@@ -3291,7 +3291,7 @@ Gt.prototype.parse = function (n, e, t, i) {
|
|
3291
3291
|
function Js(n) {
|
3292
3292
|
var e = ["vbscript", "javascript", "file", "data"],
|
3293
3293
|
t = n.trim().toLowerCase();
|
3294
|
-
return t =
|
3294
|
+
return t = Ee(t), !(t.indexOf(":") !== -1 && e.indexOf(t.split(":")[0]) !== -1);
|
3295
3295
|
}
|
3296
3296
|
var Ys = {
|
3297
3297
|
options: {
|
@@ -3628,7 +3628,7 @@ var Be = /*#__PURE__*/function () {
|
|
3628
3628
|
case 0:
|
3629
3629
|
i = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : !0;
|
3630
3630
|
r = this.deepChat.stream;
|
3631
|
-
return _context16.abrupt("return", r && (this.demo || _typeof(r) != "object" || !r.simulation) ? B.request(this, e, t) :
|
3631
|
+
return _context16.abrupt("return", r && (this.demo || _typeof(r) != "object" || !r.simulation) ? B.request(this, e, t) : S.request(this, e, t, i));
|
3632
3632
|
case 3:
|
3633
3633
|
case "end":
|
3634
3634
|
return _context16.stop();
|
@@ -3819,7 +3819,7 @@ var q = /*#__PURE__*/function (_Be) {
|
|
3819
3819
|
o = _this$keyVerification.createHeaders,
|
3820
3820
|
a = _this$keyVerification.body,
|
3821
3821
|
l = (o == null ? void 0 : o(e)) || this.buildHeadersFunc(e);
|
3822
|
-
|
3822
|
+
S.verifyKey(e, i, l, r, this.keyAuthenticated.bind(this, t.onSuccess), t.onFail, t.onLoad, s, a);
|
3823
3823
|
}
|
3824
3824
|
}, {
|
3825
3825
|
key: "isDirectConnection",
|
@@ -4141,7 +4141,7 @@ var Bn = /*#__PURE__*/function (_q) {
|
|
4141
4141
|
throw new Error("Request settings have not been set up");
|
4142
4142
|
case 2:
|
4143
4143
|
r = this.preprocessBody(this.rawBody, t, i);
|
4144
|
-
|
4144
|
+
S.request(this, r, e);
|
4145
4145
|
case 4:
|
4146
4146
|
case "end":
|
4147
4147
|
return _context21.stop();
|
@@ -4193,7 +4193,7 @@ var rt = /*#__PURE__*/function (_Me) {
|
|
4193
4193
|
}
|
4194
4194
|
throw new Error("No file was added");
|
4195
4195
|
case 4:
|
4196
|
-
|
4196
|
+
S.poll(this, i[0], e, !1);
|
4197
4197
|
case 5:
|
4198
4198
|
case "end":
|
4199
4199
|
return _context22.stop();
|
@@ -4411,7 +4411,7 @@ var Mt = /*#__PURE__*/function (_Vt) {
|
|
4411
4411
|
throw new Error("Image was not found");
|
4412
4412
|
case 4:
|
4413
4413
|
r = this.createFormDataBody(this.rawBody, i[0]);
|
4414
|
-
M.temporarilyRemoveHeader(this.requestSettings,
|
4414
|
+
M.temporarilyRemoveHeader(this.requestSettings, S.request.bind(this, this, r, e), !1);
|
4415
4415
|
case 6:
|
4416
4416
|
case "end":
|
4417
4417
|
return _context25.stop();
|
@@ -4520,7 +4520,7 @@ var kt = /*#__PURE__*/function (_Vt2) {
|
|
4520
4520
|
throw new Error("Image was not found");
|
4521
4521
|
case 4:
|
4522
4522
|
r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), s = this.createFormDataBody(this.rawBody, i[0], i[1], r);
|
4523
|
-
M.temporarilyRemoveHeader(this.requestSettings,
|
4523
|
+
M.temporarilyRemoveHeader(this.requestSettings, S.request.bind(this, this, s, e), !1);
|
4524
4524
|
case 6:
|
4525
4525
|
case "end":
|
4526
4526
|
return _context27.stop();
|
@@ -4899,7 +4899,7 @@ var Ct = /*#__PURE__*/function (_Vt3) {
|
|
4899
4899
|
throw new Error("Image was not found");
|
4900
4900
|
case 4:
|
4901
4901
|
r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), s = this.createFormDataBody(this.rawBody, i[0], r);
|
4902
|
-
M.temporarilyRemoveHeader(this.requestSettings,
|
4902
|
+
M.temporarilyRemoveHeader(this.requestSettings, S.request.bind(this, this, s, e), !1);
|
4903
4903
|
case 6:
|
4904
4904
|
case "end":
|
4905
4905
|
return _context34.stop();
|
@@ -5034,7 +5034,7 @@ var Tt = /*#__PURE__*/function (_Vt4) {
|
|
5034
5034
|
throw new Error("Request settings have not been set up");
|
5035
5035
|
case 2:
|
5036
5036
|
i = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
5037
|
-
|
5037
|
+
S.request(this, i, e);
|
5038
5038
|
case 4:
|
5039
5039
|
case "end":
|
5040
5040
|
return _context37.stop();
|
@@ -5212,7 +5212,7 @@ var po = /*#__PURE__*/function (_Di) {
|
|
5212
5212
|
throw new Error("Request settings have not been set up");
|
5213
5213
|
case 2:
|
5214
5214
|
i = this.preprocessBody(this.rawBody, t);
|
5215
|
-
|
5215
|
+
S.request(this, i, e);
|
5216
5216
|
case 4:
|
5217
5217
|
case "end":
|
5218
5218
|
return _context40.stop();
|
@@ -5289,7 +5289,7 @@ var fo = /*#__PURE__*/function (_Di2) {
|
|
5289
5289
|
throw new Error("Request settings have not been set up");
|
5290
5290
|
case 2:
|
5291
5291
|
i = this.preprocessBody(this.rawBody, t);
|
5292
|
-
|
5292
|
+
S.request(this, i, e);
|
5293
5293
|
case 4:
|
5294
5294
|
case "end":
|
5295
5295
|
return _context42.stop();
|
@@ -5492,7 +5492,7 @@ var go = /*#__PURE__*/function (_mo) {
|
|
5492
5492
|
throw new Error("Request settings have not been set up");
|
5493
5493
|
case 2:
|
5494
5494
|
i = this.preprocessBody(this.rawBody, t);
|
5495
|
-
|
5495
|
+
S.request(this, i, e), this.messages = e;
|
5496
5496
|
case 4:
|
5497
5497
|
case "end":
|
5498
5498
|
return _context44.stop();
|
@@ -5523,7 +5523,7 @@ var go = /*#__PURE__*/function (_mo) {
|
|
5523
5523
|
method: "GET",
|
5524
5524
|
headers: (t = this.requestSettings) == null ? void 0 : t.headers
|
5525
5525
|
};
|
5526
|
-
|
5526
|
+
S.executePollRequest(this, i, r, this.messages);
|
5527
5527
|
}
|
5528
5528
|
return _context45.abrupt("return", {
|
5529
5529
|
pollingInAnotherRequest: !0
|
@@ -5708,7 +5708,7 @@ var bo = /*#__PURE__*/function (_q5) {
|
|
5708
5708
|
throw new Error("Request settings have not been set up");
|
5709
5709
|
case 2:
|
5710
5710
|
i = this.preprocessBody(this.rawBody, t);
|
5711
|
-
this.deepChat.stream || i.stream ? (i.stream = !0, B.request(this, i, e)) :
|
5711
|
+
this.deepChat.stream || i.stream ? (i.stream = !0, B.request(this, i, e)) : S.request(this, i, e);
|
5712
5712
|
case 4:
|
5713
5713
|
case "end":
|
5714
5714
|
return _context47.stop();
|
@@ -5890,7 +5890,7 @@ var Fi = /*#__PURE__*/function (_q6) {
|
|
5890
5890
|
}
|
5891
5891
|
throw new Error("No file was added");
|
5892
5892
|
case 4:
|
5893
|
-
|
5893
|
+
S.request(this, i[0], e, !1);
|
5894
5894
|
case 5:
|
5895
5895
|
case "end":
|
5896
5896
|
return _context50.stop();
|
@@ -5992,7 +5992,7 @@ var Vn = /*#__PURE__*/function (_Gn) {
|
|
5992
5992
|
throw new Error("Request settings have not been set up");
|
5993
5993
|
case 2:
|
5994
5994
|
i = this.preprocessBody(this.rawBody, t);
|
5995
|
-
|
5995
|
+
S.request(this, i, e, !1);
|
5996
5996
|
case 4:
|
5997
5997
|
case "end":
|
5998
5998
|
return _context52.stop();
|
@@ -6081,7 +6081,7 @@ var Kn = /*#__PURE__*/function (_Gn2) {
|
|
6081
6081
|
}
|
6082
6082
|
throw new Error("No file was added");
|
6083
6083
|
case 4:
|
6084
|
-
(s = this.requestSettings) != null && s.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"),
|
6084
|
+
(s = this.requestSettings) != null && s.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), S.request(this, i[0], e, !1);
|
6085
6085
|
case 5:
|
6086
6086
|
case "end":
|
6087
6087
|
return _context54.stop();
|
@@ -6170,7 +6170,7 @@ var xo = /*#__PURE__*/function (_q8) {
|
|
6170
6170
|
throw new Error("Request settings have not been set up");
|
6171
6171
|
case 2:
|
6172
6172
|
i = this.preprocessBody(t);
|
6173
|
-
|
6173
|
+
S.request(this, i, e);
|
6174
6174
|
case 4:
|
6175
6175
|
case "end":
|
6176
6176
|
return _context56.stop();
|
@@ -6267,7 +6267,7 @@ var Wt = /*#__PURE__*/function (_q9) {
|
|
6267
6267
|
var l = this.preprocessBody(this.rawBody, s);
|
6268
6268
|
r = pe.createFormDataBody(l, i[0], i[1]);
|
6269
6269
|
} else this.url = pe.IMAGE_VARIATIONS_URL, r = pe.createFormDataBody(this.rawBody, i[0]);
|
6270
|
-
M.temporarilyRemoveHeader(this.requestSettings,
|
6270
|
+
M.temporarilyRemoveHeader(this.requestSettings, S.request.bind(this, this, r, e), !1);
|
6271
6271
|
}
|
6272
6272
|
}, {
|
6273
6273
|
key: "callServiceAPI",
|
@@ -6299,7 +6299,7 @@ var Wt = /*#__PURE__*/function (_q9) {
|
|
6299
6299
|
case 8:
|
6300
6300
|
this.url = pe.IMAGE_GENERATION_URL;
|
6301
6301
|
s = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
6302
|
-
|
6302
|
+
S.request(this, s, e);
|
6303
6303
|
case 11:
|
6304
6304
|
case "end":
|
6305
6305
|
return _context58.stop();
|
@@ -6373,7 +6373,7 @@ var Wt = /*#__PURE__*/function (_q9) {
|
|
6373
6373
|
Wt.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
6374
6374
|
Wt.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
6375
6375
|
Wt.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
6376
|
-
var
|
6376
|
+
var Eo = Wt;
|
6377
6377
|
var Kt = /*#__PURE__*/function (_q10) {
|
6378
6378
|
_inherits(fe, _q10);
|
6379
6379
|
var _super31 = _createSuper(fe);
|
@@ -6432,7 +6432,7 @@ var Kt = /*#__PURE__*/function (_q10) {
|
|
6432
6432
|
case 4:
|
6433
6433
|
this.url = this.requestSettings.url || this._service_url;
|
6434
6434
|
r = this.preprocessBody(this.rawBody, t), s = fe.createFormDataBody(r, i[0]);
|
6435
|
-
M.temporarilyRemoveHeader(this.requestSettings,
|
6435
|
+
M.temporarilyRemoveHeader(this.requestSettings, S.request.bind(this, this, s, e), !1);
|
6436
6436
|
case 7:
|
6437
6437
|
case "end":
|
6438
6438
|
return _context60.stop();
|
@@ -6495,7 +6495,7 @@ var Kt = /*#__PURE__*/function (_q10) {
|
|
6495
6495
|
Kt.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
6496
6496
|
Kt.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
6497
6497
|
Kt.DEFAULT_MODEL = "whisper-1";
|
6498
|
-
var
|
6498
|
+
var So = Kt;
|
6499
6499
|
var It = /*#__PURE__*/function (_q11) {
|
6500
6500
|
_inherits(It, _q11);
|
6501
6501
|
var _super32 = _createSuper(It);
|
@@ -6548,7 +6548,7 @@ var It = /*#__PURE__*/function (_q11) {
|
|
6548
6548
|
throw new Error("Request settings have not been set up");
|
6549
6549
|
case 2:
|
6550
6550
|
i = this.preprocessBody(this.rawBody, t);
|
6551
|
-
this.deepChat.stream || i.stream ? (i.stream = !0, B.request(this, i, e)) :
|
6551
|
+
this.deepChat.stream || i.stream ? (i.stream = !0, B.request(this, i, e)) : S.request(this, i, e);
|
6552
6552
|
case 4:
|
6553
6553
|
case "end":
|
6554
6554
|
return _context62.stop();
|
@@ -6651,7 +6651,7 @@ var wo = /*#__PURE__*/function (_Di3) {
|
|
6651
6651
|
throw new Error("Request settings have not been set up");
|
6652
6652
|
case 2:
|
6653
6653
|
i = this.preprocessBody(this.rawBody, t);
|
6654
|
-
|
6654
|
+
S.request(this, i, e);
|
6655
6655
|
case 4:
|
6656
6656
|
case "end":
|
6657
6657
|
return _context64.stop();
|
@@ -6704,7 +6704,7 @@ var _o = /*#__PURE__*/function () {
|
|
6704
6704
|
i = e.request,
|
6705
6705
|
r = e.demo;
|
6706
6706
|
if (t) {
|
6707
|
-
if (t.openAI) return t.openAI.images ? new
|
6707
|
+
if (t.openAI) return t.openAI.images ? new Eo(e) : t.openAI.audio ? new So(e) : t.openAI.completions ? new bo(e) : new It(e);
|
6708
6708
|
if (t.assemblyAI) return new Fi(e);
|
6709
6709
|
if (t.cohere) return t.cohere.chat ? new wo(e) : t.cohere.summarization ? new fo(e) : new po(e);
|
6710
6710
|
if (t.huggingFace) return t.huggingFace.textGeneration ? new oo(e) : t.huggingFace.summarization ? new lo(e) : t.huggingFace.translation ? new uo(e) : t.huggingFace.fillMask ? new ho(e) : t.huggingFace.questionAnswer ? new ao(e) : t.huggingFace.audioSpeechRecognition ? new so(e) : t.huggingFace.audioClassification ? new no(e) : t.huggingFace.imageClassification ? new ro(e) : new co(e);
|
@@ -7199,13 +7199,13 @@ var er = /*#__PURE__*/function () {
|
|
7199
7199
|
er.DEFAULT_FILE_NAME = "file";
|
7200
7200
|
var oe = er;
|
7201
7201
|
var Ui = /*#__PURE__*/function () {
|
7202
|
-
function
|
7203
|
-
_classCallCheck(this,
|
7202
|
+
function Et() {
|
7203
|
+
_classCallCheck(this, Et);
|
7204
7204
|
}
|
7205
|
-
_createClass(
|
7205
|
+
_createClass(Et, null, [{
|
7206
7206
|
key: "getRole",
|
7207
7207
|
value: function getRole(e) {
|
7208
|
-
return e ?
|
7208
|
+
return e ? Et.AI_ROLE : Et.USER_ROLE;
|
7209
7209
|
}
|
7210
7210
|
}, {
|
7211
7211
|
key: "getLastElementsByClass",
|
@@ -7233,13 +7233,13 @@ var Ui = /*#__PURE__*/function () {
|
|
7233
7233
|
}, {
|
7234
7234
|
key: "getLastMessage",
|
7235
7235
|
value: function getLastMessage(e, t, i) {
|
7236
|
-
var r =
|
7236
|
+
var r = Et.getRole(t);
|
7237
7237
|
for (var s = e.length - 1; s >= 0; s -= 1) if (e[s].role === r) if (i) {
|
7238
7238
|
if (e[s][i]) return e[s];
|
7239
7239
|
} else return e[s];
|
7240
7240
|
}
|
7241
7241
|
}]);
|
7242
|
-
return
|
7242
|
+
return Et;
|
7243
7243
|
}();
|
7244
7244
|
Ui.AI_ROLE = "ai";
|
7245
7245
|
Ui.USER_ROLE = "user";
|
@@ -10047,9 +10047,9 @@ Object.defineProperty(ii, "__esModule", {
|
|
10047
10047
|
});
|
10048
10048
|
ii.Azure = void 0;
|
10049
10049
|
var xn = ni,
|
10050
|
-
|
10050
|
+
En = ri,
|
10051
10051
|
yi = oi,
|
10052
|
-
|
10052
|
+
Sn = ai,
|
10053
10053
|
ra = dt;
|
10054
10054
|
var zt = /*#__PURE__*/function (_ra$Speech) {
|
10055
10055
|
_inherits(zt, _ra$Speech);
|
@@ -10097,7 +10097,7 @@ var zt = /*#__PURE__*/function (_ra$Speech) {
|
|
10097
10097
|
}, {
|
10098
10098
|
key: "validate",
|
10099
10099
|
value: function validate(e) {
|
10100
|
-
return zt.getAPI() ?
|
10100
|
+
return zt.getAPI() ? En.AzureSpeechConfig.validateOptions(this.error.bind(this), e) : (this.moduleNotFound(), !1);
|
10101
10101
|
}
|
10102
10102
|
}, {
|
10103
10103
|
key: "instantiateService",
|
@@ -10110,7 +10110,7 @@ var zt = /*#__PURE__*/function (_ra$Speech) {
|
|
10110
10110
|
t = zt.getAPI();
|
10111
10111
|
i = t.AudioConfig.fromDefaultMicrophoneInput();
|
10112
10112
|
_context75.next = 4;
|
10113
|
-
return
|
10113
|
+
return En.AzureSpeechConfig.get(t.SpeechConfig, e);
|
10114
10114
|
case 4:
|
10115
10115
|
r = _context75.sent;
|
10116
10116
|
if (r) {
|
@@ -10138,10 +10138,10 @@ var zt = /*#__PURE__*/function (_ra$Speech) {
|
|
10138
10138
|
key: "onRecognizing",
|
10139
10139
|
value: function onRecognizing(e, t) {
|
10140
10140
|
if (this._stopping) return;
|
10141
|
-
var
|
10142
|
-
i =
|
10143
|
-
r =
|
10144
|
-
s =
|
10141
|
+
var _Sn$AzureTranscript$e = Sn.AzureTranscript.extract(this._newTextPadding + t.result.text, this.finalTranscript, !1, this._translations),
|
10142
|
+
i = _Sn$AzureTranscript$e.interimTranscript,
|
10143
|
+
r = _Sn$AzureTranscript$e.finalTranscript,
|
10144
|
+
s = _Sn$AzureTranscript$e.newText;
|
10145
10145
|
yi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, r, s);
|
10146
10146
|
}
|
10147
10147
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
@@ -10159,10 +10159,10 @@ var zt = /*#__PURE__*/function (_ra$Speech) {
|
|
10159
10159
|
break;
|
10160
10160
|
case window.SpeechSDK.ResultReason.RecognizedSpeech:
|
10161
10161
|
if (i.text && !this._stopping) {
|
10162
|
-
var
|
10163
|
-
r =
|
10164
|
-
s =
|
10165
|
-
o =
|
10162
|
+
var _Sn$AzureTranscript$e2 = Sn.AzureTranscript.extract(this._newTextPadding + i.text, this.finalTranscript, !0, this._translations),
|
10163
|
+
r = _Sn$AzureTranscript$e2.interimTranscript,
|
10164
|
+
s = _Sn$AzureTranscript$e2.finalTranscript,
|
10165
|
+
o = _Sn$AzureTranscript$e2.newText;
|
10166
10166
|
yi.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(r, s, o), s !== "" && (this._newTextPadding = " ");
|
10167
10167
|
}
|
10168
10168
|
break;
|
@@ -10506,7 +10506,7 @@ var li = /*#__PURE__*/function (_at4) {
|
|
10506
10506
|
loadingActive: !1
|
10507
10507
|
}, _this54._messages = i, _this54._inputElementRef = t, _this54._fileAttachments = s, _this54._innerElements = _this54.createInnerElements(), _this54._abortStream = new AbortController(), _this54._stopClicked = {
|
10508
10508
|
listener: function listener() {}
|
10509
|
-
}, _this54._serviceIO = r, _this54._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.
|
10509
|
+
}, _this54._serviceIO = r, _this54._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.disableSubmitButton = _this54.disableSubmitButton.bind(_assertThisInitialized(_this54), r), _this54.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
10510
10510
|
var a;
|
10511
10511
|
_this54._validationHandler = e._validationHandler, _this54.assignHandlers(_this54._validationHandler), (a = _this54._validationHandler) == null || a.call(_assertThisInitialized(_this54));
|
10512
10512
|
});
|
@@ -10693,9 +10693,10 @@ var li = /*#__PURE__*/function (_at4) {
|
|
10693
10693
|
this._alwaysEnabled && !e ? this.changeToSubmitIcon() : this.elementRef.classList.contains(A.DISABLED_CLASS) || (this.elementRef.classList.remove(A.LOADING_CLASS, A.SUBMIT_CLASS), this.elementRef.classList.add(A.DISABLED_CLASS), this.elementRef.replaceChildren(this._innerElements.disabled), this.reapplyStateStyle("disabled", ["submit"]), this.elementRef.onclick = function () {});
|
10694
10694
|
}
|
10695
10695
|
}, {
|
10696
|
-
key: "
|
10697
|
-
value: function
|
10698
|
-
|
10696
|
+
key: "disableSubmitButton",
|
10697
|
+
value: function disableSubmitButton(e, t) {
|
10698
|
+
var i;
|
10699
|
+
e.isSubmitProgrammaticallyDisabled = t !== !1, !(this.status.requestInProgress || this.status.loadingActive) && (t === !1 ? (i = this._validationHandler) == null || i.call(this) : this.changeToDisabledIcon(!0));
|
10699
10700
|
}
|
10700
10701
|
}], [{
|
10701
10702
|
key: "createButtonContainerElement",
|
@@ -11013,7 +11014,7 @@ var v = /*#__PURE__*/function (_Xs) {
|
|
11013
11014
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
11014
11015
|
}, _this60.focusInput = function () {
|
11015
11016
|
return Ut.focusFromParentElement(_this60._elementRef);
|
11016
|
-
}, _this60.refreshMessages = function () {}, _this60.clearMessages = function () {}, _this60.scrollToBottom = function () {}, _this60.
|
11017
|
+
}, _this60.refreshMessages = function () {}, _this60.clearMessages = function () {}, _this60.scrollToBottom = function () {}, _this60.disableSubmitButton = function () {}, _this60.onNewMessage = function () {}, _this60.onClearMessages = function () {}, _this60.onComponentRender = function () {}, _this60._hasBeenRendered = !1, _this60._auxiliaryStyleApplied = !1, Mo.appendStyleSheetToHead(), _this60._elementRef = document.createElement("div"), _this60._elementRef.id = "container", _this60.attachShadow({
|
11017
11018
|
mode: "open"
|
11018
11019
|
}).appendChild(_this60._elementRef), di.apply(ma, _this60.shadowRoot), setTimeout(function () {
|
11019
11020
|
_this60._hasBeenRendered || _this60.onRender();
|
@@ -11030,7 +11031,7 @@ var v = /*#__PURE__*/function (_Xs) {
|
|
11030
11031
|
key: "onRender",
|
11031
11032
|
value: function onRender() {
|
11032
11033
|
var _this$_activeService, _this$_childElement;
|
11033
|
-
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = _o.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (di.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), di.applyDefaultStyleToComponent(this.style), qt.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ?
|
11034
|
+
(_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = _o.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (di.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), di.applyDefaultStyleToComponent(this.style), qt.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? St.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof q) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Vi.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof q && L.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Ti.onRender(this));
|
11034
11035
|
}
|
11035
11036
|
}]);
|
11036
11037
|
return v;
|