deep-chat-dev 9.0.277 → 9.0.278
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/README.md +7 -3
- package/custom-elements.json +14434 -13880
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +515 -487
- package/dist/services/utils/baseServiceIO.d.ts.map +1 -1
- package/dist/types/button.d.ts +6 -0
- package/dist/types/button.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/camera/cameraButton.d.ts +1 -0
- package/dist/views/chat/input/buttons/camera/cameraButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/custom/customButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/inputButton.d.ts +6 -2
- package/dist/views/chat/input/buttons/inputButton.d.ts.map +1 -1
- package/dist/views/chat/input/buttons/uploadFile/uploadFileButton.d.ts.map +1 -1
- package/dist/views/chat/messages/browserStorage/browserStorage.d.ts +1 -0
- package/dist/views/chat/messages/browserStorage/browserStorage.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -252,7 +252,7 @@ var Xe = /*#__PURE__*/function () {
|
|
252
252
|
}]);
|
253
253
|
}();
|
254
254
|
Xe.PERMITTED_KEYS = /* @__PURE__ */new Set([U.BACKSPACE, U.DELETE, U.ARROW_RIGHT, U.ARROW_LEFT, U.ARROW_DOWN, U.ARROW_UP, U.META, U.CONTROL, U.ENTER]);
|
255
|
-
var
|
255
|
+
var es = Xe;
|
256
256
|
var qn = /*#__PURE__*/function () {
|
257
257
|
function qn() {
|
258
258
|
_classCallCheck(this, qn);
|
@@ -275,7 +275,7 @@ var Ye = /*#__PURE__*/function () {
|
|
275
275
|
this._isComposing = !1;
|
276
276
|
var s = Ye.processConfig(t, e.textInput);
|
277
277
|
this.elementRef = Ye.createContainerElement((r = s == null ? void 0 : s.styles) == null ? void 0 : r.container), this._config = s, this.inputElementRef = this.createInputElement(), this.elementRef.appendChild(this.inputElementRef), e.setPlaceholderText = this.setPlaceholderText.bind(this), e.setPlaceholderText(((o = this._config.placeholder) == null ? void 0 : o.text) || "Ask me anything!"), setTimeout(function () {
|
278
|
-
|
278
|
+
es.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler), _this._onInput = t.onInput;
|
279
279
|
});
|
280
280
|
}
|
281
281
|
return _createClass(Ye, [{
|
@@ -403,21 +403,21 @@ function Ns(n) {
|
|
403
403
|
function zn(n) {
|
404
404
|
return n && JSON.stringify(n);
|
405
405
|
}
|
406
|
-
function
|
406
|
+
function Es(n, e, t, i) {
|
407
407
|
var s = "\n".concat(Ns(e), " message: ").concat(JSON.stringify(n), " \n"),
|
408
408
|
r = t ? "".concat(Ns(e), " message after interceptor: ").concat(zn(i), " \n") : "";
|
409
409
|
return s + r;
|
410
410
|
}
|
411
411
|
function Gn(n, e, t, i) {
|
412
|
-
return "".concat(
|
412
|
+
return "".concat(Es(n, e, t, i), "Make sure the ").concat(e, " message is using the Response format: https://deepchat.dev/docs/connect/#Response \nYou can also augment it using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor");
|
413
413
|
}
|
414
414
|
function Vn(n, e, t) {
|
415
415
|
var i = "response";
|
416
|
-
return "".concat(
|
416
|
+
return "".concat(Es(n, i, e, t), "Make sure the ").concat(i, " message is using the {text: string} format, e.g: {text: \"Model Response\"}");
|
417
417
|
}
|
418
418
|
function Kn(n, e) {
|
419
419
|
var t = "request";
|
420
|
-
return "".concat(
|
420
|
+
return "".concat(Es(n, t, e), "Make sure the ").concat(t, " message is using the {body: {text: string}} format, e.g: {body: {text: \"Model Response\"}}");
|
421
421
|
}
|
422
422
|
var Ds = "Make sure the events are using {text: string} or {html: string} format.\nYou can also augment them using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor",
|
423
423
|
k = {
|
@@ -432,11 +432,11 @@ var Ds = "Make sure the events are using {text: string} or {html: string} format
|
|
432
432
|
NO_VALID_STREAM_EVENTS_SENT: "No valid stream events were sent.\n".concat(Ds),
|
433
433
|
READABLE_STREAM_CONNECTION_ERROR: "Readable Stream connection error."
|
434
434
|
},
|
435
|
-
|
436
|
-
function
|
437
|
-
_classCallCheck(this,
|
435
|
+
Fi = /*#__PURE__*/function () {
|
436
|
+
function Fi() {
|
437
|
+
_classCallCheck(this, Fi);
|
438
438
|
}
|
439
|
-
return _createClass(
|
439
|
+
return _createClass(Fi, null, [{
|
440
440
|
key: "addElements",
|
441
441
|
value: function addElements(e) {
|
442
442
|
for (var _len = arguments.length, t = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
@@ -453,7 +453,7 @@ var Ds = "Make sure the events are using {text: string} or {html: string} format
|
|
453
453
|
i = e.clientHeight,
|
454
454
|
s = e.scrollTop,
|
455
455
|
r = t - i;
|
456
|
-
return s >= r -
|
456
|
+
return s >= r - Fi.CODE_SNIPPET_GENERATION_JUMP;
|
457
457
|
}
|
458
458
|
}, {
|
459
459
|
key: "cloneElement",
|
@@ -478,13 +478,13 @@ var Ds = "Make sure the events are using {text: string} or {html: string} format
|
|
478
478
|
}
|
479
479
|
}]);
|
480
480
|
}();
|
481
|
-
|
482
|
-
var V =
|
483
|
-
var
|
484
|
-
function
|
485
|
-
_classCallCheck(this,
|
481
|
+
Fi.CODE_SNIPPET_GENERATION_JUMP = 0.5;
|
482
|
+
var V = Fi;
|
483
|
+
var Ui = /*#__PURE__*/function () {
|
484
|
+
function Ui() {
|
485
|
+
_classCallCheck(this, Ui);
|
486
486
|
}
|
487
|
-
return _createClass(
|
487
|
+
return _createClass(Ui, null, [{
|
488
488
|
key: "speak",
|
489
489
|
value: function speak(e, t) {
|
490
490
|
if (window.SpeechSynthesisUtterance) {
|
@@ -505,12 +505,12 @@ var Fi = /*#__PURE__*/function () {
|
|
505
505
|
s && (i.voice = s);
|
506
506
|
}
|
507
507
|
t(i);
|
508
|
-
},
|
508
|
+
}, Ui.LOAD_VOICES_MS);
|
509
509
|
}
|
510
510
|
}]);
|
511
511
|
}();
|
512
|
-
|
513
|
-
var bt =
|
512
|
+
Ui.LOAD_VOICES_MS = 200;
|
513
|
+
var bt = Ui;
|
514
514
|
var ft = /*#__PURE__*/function () {
|
515
515
|
function ft() {
|
516
516
|
_classCallCheck(this, ft);
|
@@ -776,7 +776,7 @@ var We = /*#__PURE__*/function () {
|
|
776
776
|
}();
|
777
777
|
var Wn = "deep-chat-temporary-message",
|
778
778
|
$n = "deep-chat-suggestion-button",
|
779
|
-
|
779
|
+
ts = {
|
780
780
|
"deep-chat-button": {
|
781
781
|
styles: {
|
782
782
|
"default": {
|
@@ -797,7 +797,7 @@ var Wn = "deep-chat-temporary-message",
|
|
797
797
|
}
|
798
798
|
}
|
799
799
|
},
|
800
|
-
Bs = Object.keys(
|
800
|
+
Bs = Object.keys(ts);
|
801
801
|
var _e = /*#__PURE__*/function () {
|
802
802
|
function _e() {
|
803
803
|
_classCallCheck(this, _e);
|
@@ -830,7 +830,7 @@ var _e = /*#__PURE__*/function () {
|
|
830
830
|
}, {
|
831
831
|
key: "applyEvents",
|
832
832
|
value: function applyEvents(e, t) {
|
833
|
-
var i =
|
833
|
+
var i = ts[t].events;
|
834
834
|
Object.keys(i || []).forEach(function (s) {
|
835
835
|
e.addEventListener(s, i == null ? void 0 : i[s]);
|
836
836
|
});
|
@@ -843,7 +843,7 @@ var _e = /*#__PURE__*/function () {
|
|
843
843
|
var c = (d = e[l]) == null ? void 0 : d.styles;
|
844
844
|
return c && e[l].styles && a.push(c), a;
|
845
845
|
}, []),
|
846
|
-
r =
|
846
|
+
r = ts[i].styles;
|
847
847
|
if (r) {
|
848
848
|
var a = JSON.parse(JSON.stringify(r));
|
849
849
|
a["default"] && I.overwriteDefaultWithAlreadyApplied(a, t), s.unshift(a);
|
@@ -1024,7 +1024,7 @@ function Qt(n) {
|
|
1024
1024
|
function wn(n) {
|
1025
1025
|
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);
|
1026
1026
|
}
|
1027
|
-
function
|
1027
|
+
function is(n) {
|
1028
1028
|
if (n > 65535) {
|
1029
1029
|
n -= 65536;
|
1030
1030
|
var e = 55296 + (n >> 10),
|
@@ -1038,7 +1038,7 @@ var Zn = /&([a-z#][a-z0-9]{1,31});/gi,
|
|
1038
1038
|
function er(n, e) {
|
1039
1039
|
var t = 0,
|
1040
1040
|
i = _n(e);
|
1041
|
-
return e !== i ? i : e.charCodeAt(0) === 35 && Qn.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), wn(t)) ?
|
1041
|
+
return e !== i ? i : e.charCodeAt(0) === 35 && Qn.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), wn(t)) ? is(t) : n;
|
1042
1042
|
}
|
1043
1043
|
function nt(n) {
|
1044
1044
|
return n.indexOf("&") < 0 ? n : n.replace(Zn, er);
|
@@ -1276,14 +1276,14 @@ function An(n, e) {
|
|
1276
1276
|
var ot = v.getBreak = function (e, t) {
|
1277
1277
|
return t = An(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1278
1278
|
};
|
1279
|
-
function
|
1279
|
+
function Ss() {
|
1280
1280
|
this.rules = xn({}, v), this.getBreak = v.getBreak;
|
1281
1281
|
}
|
1282
|
-
|
1282
|
+
Ss.prototype.renderInline = function (n, e, t) {
|
1283
1283
|
for (var i = this.rules, s = n.length, r = 0, o = ""; s--;) o += i[n[r].type](n, r++, e, t, this);
|
1284
1284
|
return o;
|
1285
1285
|
};
|
1286
|
-
|
1286
|
+
Ss.prototype.render = function (n, e, t) {
|
1287
1287
|
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);
|
1288
1288
|
return o;
|
1289
1289
|
};
|
@@ -1430,7 +1430,7 @@ function ar(n) {
|
|
1430
1430
|
}
|
1431
1431
|
}
|
1432
1432
|
}
|
1433
|
-
function
|
1433
|
+
function ss(n) {
|
1434
1434
|
var e = nt(n);
|
1435
1435
|
try {
|
1436
1436
|
e = decodeURI(e);
|
@@ -1446,7 +1446,7 @@ function Tn(n, e) {
|
|
1446
1446
|
if (n.src.charCodeAt(e) === 60) {
|
1447
1447
|
for (e++; e < o;) {
|
1448
1448
|
if (t = n.src.charCodeAt(e), t === 10) return !1;
|
1449
|
-
if (t === 62) return s =
|
1449
|
+
if (t === 62) return s = ss(Qt(n.src.slice(r + 1, e))), n.parser.validateLink(s) ? (n.pos = e + 1, n.linkContent = s, !0) : !1;
|
1450
1450
|
if (t === 92 && e + 1 < o) {
|
1451
1451
|
e += 2;
|
1452
1452
|
continue;
|
@@ -1571,7 +1571,7 @@ function hr(n) {
|
|
1571
1571
|
}
|
1572
1572
|
}
|
1573
1573
|
var Fs = " \n()[]'\".,!?-";
|
1574
|
-
function
|
1574
|
+
function Xi(n) {
|
1575
1575
|
return n.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1576
1576
|
}
|
1577
1577
|
function ur(n) {
|
@@ -1589,11 +1589,11 @@ function ur(n) {
|
|
1589
1589
|
h,
|
1590
1590
|
f = n.tokens;
|
1591
1591
|
if (n.env.abbreviations) {
|
1592
|
-
for (n.env.abbrRegExp || (h = "(^|[" + Fs.split("").map(
|
1592
|
+
for (n.env.abbrRegExp || (h = "(^|[" + Fs.split("").map(Xi).join("") + "])(" + Object.keys(n.env.abbreviations).map(function (m) {
|
1593
1593
|
return m.substr(1);
|
1594
1594
|
}).sort(function (m, p) {
|
1595
1595
|
return p.length - m.length;
|
1596
|
-
}).map(
|
1596
|
+
}).map(Xi).join("|") + ")($|[" + Fs.split("").map(Xi).join("") + "])", n.env.abbrRegExp = new RegExp(h, "g")), d = n.env.abbrRegExp, t = 0, i = f.length; t < i; t++) if (f[t].type === "inline") {
|
1597
1597
|
for (s = f[t].children, e = s.length - 1; e >= 0; e--) if (r = s[e], r.type === "text") {
|
1598
1598
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1599
1599
|
type: "text",
|
@@ -1678,10 +1678,10 @@ function Er(n) {
|
|
1678
1678
|
}
|
1679
1679
|
}
|
1680
1680
|
}
|
1681
|
-
var
|
1681
|
+
var Yi = [["block", rr], ["abbr", ar], ["references", cr], ["inline", dr], ["footnote_tail", hr], ["abbr2", ur], ["replacements", br], ["smartquotes", Er]];
|
1682
1682
|
function Mn() {
|
1683
1683
|
this.options = {}, this.ruler = new oe();
|
1684
|
-
for (var n = 0; n <
|
1684
|
+
for (var n = 0; n < Yi.length; n++) this.ruler.push(Yi[n][0], Yi[n][1]);
|
1685
1685
|
}
|
1686
1686
|
Mn.prototype.process = function (n) {
|
1687
1687
|
var e, t, i;
|
@@ -1878,7 +1878,7 @@ function Tr(n, e, t, i) {
|
|
1878
1878
|
Ee,
|
1879
1879
|
ie,
|
1880
1880
|
Ps,
|
1881
|
-
|
1881
|
+
Ji;
|
1882
1882
|
if ((u = zs(n, e)) >= 0) g = !0;else if ((u = qs(n, e)) >= 0) g = !1;else return !1;
|
1883
1883
|
if (n.level >= n.options.maxNesting) return !1;
|
1884
1884
|
if (p = n.src.charCodeAt(u - 1), i) return !0;
|
@@ -1899,11 +1899,11 @@ function Tr(n, e, t, i) {
|
|
1899
1899
|
type: "list_item_close",
|
1900
1900
|
level: --n.level
|
1901
1901
|
}), s = e = n.line, ae[1] = s, b = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
|
1902
|
-
for (
|
1903
|
-
|
1902
|
+
for (Ji = !1, ie = 0, Ps = Ee.length; ie < Ps; ie++) if (Ee[ie](n, s, t, !0)) {
|
1903
|
+
Ji = !0;
|
1904
1904
|
break;
|
1905
1905
|
}
|
1906
|
-
if (
|
1906
|
+
if (Ji) break;
|
1907
1907
|
if (g) {
|
1908
1908
|
if (u = zs(n, s), u < 0) break;
|
1909
1909
|
} else if (u = qs(n, s), u < 0) break;
|
@@ -2018,14 +2018,14 @@ function Or(n, e, t, i) {
|
|
2018
2018
|
content: n.getLines(e, o, 0, !0)
|
2019
2019
|
}), !0;
|
2020
2020
|
}
|
2021
|
-
function
|
2021
|
+
function Zi(n, e) {
|
2022
2022
|
var t = n.bMarks[e] + n.blkIndent,
|
2023
2023
|
i = n.eMarks[e];
|
2024
2024
|
return n.src.substr(t, i - t);
|
2025
2025
|
}
|
2026
2026
|
function Pr(n, e, t, i) {
|
2027
2027
|
var s, r, o, a, l, c, d, u, h, f, m;
|
2028
|
-
if (e + 2 > t || (l = e + 1, n.tShift[l] < n.blkIndent) || (o = n.bMarks[l] + n.tShift[l], o >= n.eMarks[l]) || (s = n.src.charCodeAt(o), s !== 124 && s !== 45 && s !== 58) || (r =
|
2028
|
+
if (e + 2 > t || (l = e + 1, n.tShift[l] < n.blkIndent) || (o = n.bMarks[l] + n.tShift[l], o >= n.eMarks[l]) || (s = n.src.charCodeAt(o), s !== 124 && s !== 45 && s !== 58) || (r = Zi(n, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
2029
2029
|
for (u = [], a = 0; a < c.length; a++) {
|
2030
2030
|
if (h = c[a].trim(), !h) {
|
2031
2031
|
if (a === 0 || a === c.length - 1) continue;
|
@@ -2034,7 +2034,7 @@ function Pr(n, e, t, i) {
|
|
2034
2034
|
if (!/^:?-+:?$/.test(h)) return !1;
|
2035
2035
|
h.charCodeAt(h.length - 1) === 58 ? u.push(h.charCodeAt(0) === 58 ? "center" : "right") : h.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
2036
2036
|
}
|
2037
|
-
if (r =
|
2037
|
+
if (r = Zi(n, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
2038
2038
|
if (i) return !0;
|
2039
2039
|
for (n.tokens.push({
|
2040
2040
|
type: "table_open",
|
@@ -2073,7 +2073,7 @@ function Pr(n, e, t, i) {
|
|
2073
2073
|
type: "tbody_open",
|
2074
2074
|
lines: m = [e + 2, 0],
|
2075
2075
|
level: n.level++
|
2076
|
-
}), l = e + 2; l < t && !(n.tShift[l] < n.blkIndent || (r =
|
2076
|
+
}), l = e + 2; l < t && !(n.tShift[l] < n.blkIndent || (r = Zi(n, l).trim(), r.indexOf("|") === -1)); l++) {
|
2077
2077
|
for (c = r.replace(/^\||\|$/g, "").split("|"), n.tokens.push({
|
2078
2078
|
type: "tr_open",
|
2079
2079
|
level: n.level++
|
@@ -2193,13 +2193,13 @@ function Br(n, e) {
|
|
2193
2193
|
})), !0;
|
2194
2194
|
}
|
2195
2195
|
var pi = [["code", Sr], ["fences", _r, ["paragraph", "blockquote", "list"]], ["blockquote", xr, ["paragraph", "blockquote", "list"]], ["hr", wr, ["paragraph", "blockquote", "list"]], ["list", Tr, ["paragraph", "blockquote"]], ["footnote", Cr, ["paragraph"]], ["heading", Rr, ["paragraph", "blockquote"]], ["lheading", Mr], ["htmlblock", Or, ["paragraph", "blockquote"]], ["table", Pr, ["paragraph"]], ["deflist", Dr, ["paragraph"]], ["paragraph", Br]];
|
2196
|
-
function
|
2196
|
+
function _s() {
|
2197
2197
|
this.ruler = new oe();
|
2198
2198
|
for (var n = 0; n < pi.length; n++) this.ruler.push(pi[n][0], pi[n][1], {
|
2199
2199
|
alt: (pi[n][2] || []).slice()
|
2200
2200
|
});
|
2201
2201
|
}
|
2202
|
-
|
2202
|
+
_s.prototype.tokenize = function (n, e, t) {
|
2203
2203
|
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));) {
|
2204
2204
|
for (l = 0; l < s && (a = i[l](n, r, t, !1), !a); l++);
|
2205
2205
|
if (n.tight = !o, n.isEmpty(n.line - 1) && (o = !0), r = n.line, r < t && n.isEmpty(r)) {
|
@@ -2211,7 +2211,7 @@ Ss.prototype.tokenize = function (n, e, t) {
|
|
2211
2211
|
var Fr = /[\n\t]/g,
|
2212
2212
|
Ur = /\r[\n\u0085]|[\u2424\u2028\u0085]/g,
|
2213
2213
|
jr = /\u00a0/g;
|
2214
|
-
|
2214
|
+
_s.prototype.parse = function (n, e, t, i) {
|
2215
2215
|
var s,
|
2216
2216
|
r = 0,
|
2217
2217
|
o = 0;
|
@@ -2279,10 +2279,10 @@ function zr(n, e) {
|
|
2279
2279
|
for (s++; s < i && n.src.charCodeAt(s) === 32;) s++;
|
2280
2280
|
return n.pos = s, !0;
|
2281
2281
|
}
|
2282
|
-
var
|
2283
|
-
for (var Gs = 0; Gs < 256; Gs++)
|
2282
|
+
var xs = [];
|
2283
|
+
for (var Gs = 0; Gs < 256; Gs++) xs.push(0);
|
2284
2284
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function (n) {
|
2285
|
-
|
2285
|
+
xs[n.charCodeAt(0)] = 1;
|
2286
2286
|
});
|
2287
2287
|
function Gr(n, e) {
|
2288
2288
|
var t,
|
@@ -2290,7 +2290,7 @@ function Gr(n, e) {
|
|
2290
2290
|
s = n.posMax;
|
2291
2291
|
if (n.src.charCodeAt(i) !== 92) return !1;
|
2292
2292
|
if (i++, i < s) {
|
2293
|
-
if (t = n.src.charCodeAt(i), t < 256 &&
|
2293
|
+
if (t = n.src.charCodeAt(i), t < 256 && xs[t] !== 0) return e || (n.pending += n.src[i]), n.pos += 2, !0;
|
2294
2294
|
if (t === 10) {
|
2295
2295
|
for (e || n.push({
|
2296
2296
|
type: "hardbreak",
|
@@ -2601,7 +2601,7 @@ function oo(n, e) {
|
|
2601
2601
|
r,
|
2602
2602
|
o,
|
2603
2603
|
a = n.pos;
|
2604
|
-
return n.src.charCodeAt(a) !== 60 || (t = n.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(ro), i ? so.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o =
|
2604
|
+
return n.src.charCodeAt(a) !== 60 || (t = n.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(ro), i ? so.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o = ss(r), !n.parser.validateLink(r)) ? !1 : (e || (n.push({
|
2605
2605
|
type: "link_open",
|
2606
2606
|
href: o,
|
2607
2607
|
level: n.level
|
@@ -2612,7 +2612,7 @@ function oo(n, e) {
|
|
2612
2612
|
}), n.push({
|
2613
2613
|
type: "link_close",
|
2614
2614
|
level: n.level
|
2615
|
-
})), n.pos += i[0].length, !0) : (s = t.match(no), s ? (r = s[0].slice(1, -1), o =
|
2615
|
+
})), n.pos += i[0].length, !0) : (s = t.match(no), s ? (r = s[0].slice(1, -1), o = ss("mailto:" + r), n.parser.validateLink(o) ? (e || (n.push({
|
2616
2616
|
type: "link_open",
|
2617
2617
|
href: o,
|
2618
2618
|
level: n.level
|
@@ -2625,7 +2625,7 @@ function oo(n, e) {
|
|
2625
2625
|
level: n.level
|
2626
2626
|
})), n.pos += s[0].length, !0) : !1) : !1));
|
2627
2627
|
}
|
2628
|
-
function
|
2628
|
+
function qi(n, e) {
|
2629
2629
|
return n = n.source, e = e || "", function t(i, s) {
|
2630
2630
|
return i ? (s = s.source || s, n = n.replace(i, s), t) : new RegExp(n, e);
|
2631
2631
|
};
|
@@ -2634,15 +2634,15 @@ var ao = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
|
2634
2634
|
lo = /[^"'=<>`\x00-\x20]+/,
|
2635
2635
|
co = /'[^']*'/,
|
2636
2636
|
ho = /"[^"]*"/,
|
2637
|
-
uo =
|
2638
|
-
fo =
|
2639
|
-
po =
|
2637
|
+
uo = qi(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", lo)("single_quoted", co)("double_quoted", ho)(),
|
2638
|
+
fo = qi(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", ao)("attr_value", uo)(),
|
2639
|
+
po = qi(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", fo)(),
|
2640
2640
|
mo = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
2641
2641
|
go = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
2642
2642
|
bo = /<[?].*?[?]>/,
|
2643
2643
|
vo = /<![A-Z]+\s+[^>]*>/,
|
2644
2644
|
yo = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
2645
|
-
Eo =
|
2645
|
+
Eo = qi(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", po)("close_tag", mo)("comment", go)("processing", bo)("declaration", vo)("cdata", yo)();
|
2646
2646
|
function So(n) {
|
2647
2647
|
var e = n | 32;
|
2648
2648
|
return e >= 97 && e <= 122;
|
@@ -2669,7 +2669,7 @@ function Ao(n, e) {
|
|
2669
2669
|
if (n.src.charCodeAt(r) !== 38) return !1;
|
2670
2670
|
if (r + 1 < o) {
|
2671
2671
|
if (t = n.src.charCodeAt(r + 1), t === 35) {
|
2672
|
-
if (s = n.src.slice(r).match(xo), s) return e || (i = s[1][0].toLowerCase() === "x" ? parseInt(s[1].slice(1), 16) : parseInt(s[1], 10), n.pending += wn(i) ?
|
2672
|
+
if (s = n.src.slice(r).match(xo), s) return e || (i = s[1][0].toLowerCase() === "x" ? parseInt(s[1].slice(1), 16) : parseInt(s[1], 10), n.pending += wn(i) ? is(i) : is(65533)), n.pos += s[0].length, !0;
|
2673
2673
|
} else if (s = n.src.slice(r).match(wo), s) {
|
2674
2674
|
var a = _n(s[1]);
|
2675
2675
|
if (s[1] !== a) return e || (n.pending += a), n.pos += s[0].length, !0;
|
@@ -2677,13 +2677,13 @@ function Ao(n, e) {
|
|
2677
2677
|
}
|
2678
2678
|
return e || (n.pending += "&"), n.pos++, !0;
|
2679
2679
|
}
|
2680
|
-
var
|
2681
|
-
function
|
2680
|
+
var Qi = [["text", qr], ["newline", zr], ["escape", Gr], ["backticks", Vr], ["del", Kr], ["ins", Wr], ["mark", $r], ["emphasis", Jr], ["sub", Yr], ["sup", Qr], ["links", eo], ["footnote_inline", to], ["footnote_ref", io], ["autolink", oo], ["htmltag", _o], ["entity", Ao]];
|
2681
|
+
function zi() {
|
2682
2682
|
this.ruler = new oe();
|
2683
|
-
for (var n = 0; n <
|
2683
|
+
for (var n = 0; n < Qi.length; n++) this.ruler.push(Qi[n][0], Qi[n][1]);
|
2684
2684
|
this.validateLink = To;
|
2685
2685
|
}
|
2686
|
-
|
2686
|
+
zi.prototype.skipToken = function (n) {
|
2687
2687
|
var e = this.ruler.getRules(""),
|
2688
2688
|
t = e.length,
|
2689
2689
|
i = n.pos,
|
@@ -2699,7 +2699,7 @@ qi.prototype.skipToken = function (n) {
|
|
2699
2699
|
}
|
2700
2700
|
n.pos++, n.cacheSet(i, n.pos);
|
2701
2701
|
};
|
2702
|
-
|
2702
|
+
zi.prototype.tokenize = function (n) {
|
2703
2703
|
for (var e = this.ruler.getRules(""), t = e.length, i = n.posMax, s, r; n.pos < i;) {
|
2704
2704
|
for (r = 0; r < t && (s = e[r](n, !1), !s); r++);
|
2705
2705
|
if (s) {
|
@@ -2710,7 +2710,7 @@ qi.prototype.tokenize = function (n) {
|
|
2710
2710
|
}
|
2711
2711
|
n.pending && n.pushPending();
|
2712
2712
|
};
|
2713
|
-
|
2713
|
+
zi.prototype.parse = function (n, e, t, i) {
|
2714
2714
|
var s = new at(n, this, e, t, i);
|
2715
2715
|
this.tokenize(s);
|
2716
2716
|
};
|
@@ -2837,7 +2837,7 @@ function Ln(n, e, t) {
|
|
2837
2837
|
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;
|
2838
2838
|
}
|
2839
2839
|
function we(n, e) {
|
2840
|
-
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
|
2840
|
+
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 zi(), this.block = new _s(), this.core = new Mn(), this.renderer = new Ss(), this.ruler = new oe(), this.options = {}, this.configure(ko[n]), this.set(e || {});
|
2841
2841
|
}
|
2842
2842
|
we.prototype.set = function (n) {
|
2843
2843
|
xn(this.options, n);
|
@@ -2926,7 +2926,7 @@ var ti = pt;
|
|
2926
2926
|
var Lo = /*#__PURE__*/function () {
|
2927
2927
|
function Lo(e) {
|
2928
2928
|
_classCallCheck(this, Lo);
|
2929
|
-
this.storageKey = "deep-chat-storage", _typeof(e) == "object" && (e.key && (this.storageKey = e.key), e.clear = this.clear.bind(this));
|
2929
|
+
this.storageKey = "deep-chat-storage", this.maxMessages = 1e3, _typeof(e) == "object" && (e.key && (this.storageKey = e.key), e.maxMessages && (this.maxMessages = e.maxMessages), e.clear = this.clear.bind(this));
|
2930
2930
|
}
|
2931
2931
|
return _createClass(Lo, [{
|
2932
2932
|
key: "get",
|
@@ -2937,7 +2937,8 @@ var Lo = /*#__PURE__*/function () {
|
|
2937
2937
|
}, {
|
2938
2938
|
key: "addMessages",
|
2939
2939
|
value: function addMessages(e) {
|
2940
|
-
|
2940
|
+
var t = e.slice(e.length - this.maxMessages, e.length);
|
2941
|
+
localStorage.setItem(this.storageKey, JSON.stringify(t));
|
2941
2942
|
}
|
2942
2943
|
}, {
|
2943
2944
|
key: "clear",
|
@@ -3163,7 +3164,7 @@ var $t = /*#__PURE__*/function () {
|
|
3163
3164
|
$t.DEFAULT_FADE_MS = 500;
|
3164
3165
|
var Ei = $t;
|
3165
3166
|
var Ws = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
|
3166
|
-
|
3167
|
+
ns = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==";
|
3167
3168
|
var In = /*#__PURE__*/function () {
|
3168
3169
|
function In(e) {
|
3169
3170
|
_classCallCheck(this, In);
|
@@ -3208,7 +3209,7 @@ var Me = /*#__PURE__*/function (_In) {
|
|
3208
3209
|
value: function createAvatar(e, t) {
|
3209
3210
|
var r, o, a, l, c;
|
3210
3211
|
var i = document.createElement("img");
|
3211
|
-
e === y.USER_ROLE ? (i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) ||
|
3212
|
+
e === y.USER_ROLE ? (i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || ns, i.onerror = Me.errorFallback.bind(this, ns)) : (i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || Ws, i.onerror = Me.errorFallback.bind(this, Ws)), i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
|
3212
3213
|
var s = document.createElement("div");
|
3213
3214
|
return s.classList.add(this.className), s.appendChild(i), t && Me.applyCustomStyles(s, i, t, e), s;
|
3214
3215
|
}
|
@@ -4159,7 +4160,7 @@ var Do = function Do(n, e) {
|
|
4159
4160
|
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]]);
|
4160
4161
|
return t;
|
4161
4162
|
};
|
4162
|
-
var
|
4163
|
+
var rs = "text/event-stream",
|
4163
4164
|
Bo = 1e3,
|
4164
4165
|
Js = "last-event-id";
|
4165
4166
|
function Fo(n, e) {
|
@@ -4174,7 +4175,7 @@ function Fo(n, e) {
|
|
4174
4175
|
d = Do(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
4175
4176
|
return new Promise(function (u, h) {
|
4176
4177
|
var f = Object.assign({}, i);
|
4177
|
-
f.accept || (f.accept =
|
4178
|
+
f.accept || (f.accept = rs);
|
4178
4179
|
var m;
|
4179
4180
|
function p() {
|
4180
4181
|
m.abort(), document.hidden || ae();
|
@@ -4245,7 +4246,7 @@ function Fo(n, e) {
|
|
4245
4246
|
}
|
4246
4247
|
function Uo(n) {
|
4247
4248
|
var e = n.headers.get("content-type");
|
4248
|
-
if (!(e != null && e.startsWith(
|
4249
|
+
if (!(e != null && e.startsWith(rs))) throw new Error("Expected content-type to be ".concat(rs, ", Actual: ").concat(e));
|
4249
4250
|
}
|
4250
4251
|
var A = /*#__PURE__*/function () {
|
4251
4252
|
function A() {
|
@@ -5885,7 +5886,7 @@ var rt = /*#__PURE__*/function () {
|
|
5885
5886
|
key: "callAPI",
|
5886
5887
|
value: function () {
|
5887
5888
|
var _callAPI = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e, t) {
|
5888
|
-
var i,
|
5889
|
+
var s, i, r;
|
5889
5890
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
5890
5891
|
while (1) switch (_context31.prev = _context31.next) {
|
5891
5892
|
case 0:
|
@@ -5897,14 +5898,14 @@ var rt = /*#__PURE__*/function () {
|
|
5897
5898
|
case 2:
|
5898
5899
|
i = yt.processMessages(t.messageToElements.map(function (_ref15) {
|
5899
5900
|
var _ref16 = _slicedToArray(_ref15, 1),
|
5900
|
-
|
5901
|
-
return
|
5901
|
+
r = _ref16[0];
|
5902
|
+
return r;
|
5902
5903
|
}), this.maxMessages, this.totalMessagesMaxCharLength);
|
5903
5904
|
if (this.connectSettings.websocket && (!this.connectSettings.handler || this.connectSettings.url !== ye.URL)) {
|
5904
|
-
|
5905
|
+
r = _objectSpread({
|
5905
5906
|
messages: i
|
5906
5907
|
}, this.rawBody);
|
5907
|
-
q.sendWebsocket(this,
|
5908
|
+
e.files && (s = this.getServiceIOByType(e.files[0])) != null && s.connect ? this.callApiWithFiles(t, i, e.files) : q.sendWebsocket(this, r, t, !1);
|
5908
5909
|
} else this.callServiceAPI(t, i, e.files);
|
5909
5910
|
case 4:
|
5910
5911
|
case "end":
|
@@ -6095,7 +6096,7 @@ var Ie = /*#__PURE__*/function (_HTMLElement) {
|
|
6095
6096
|
}]);
|
6096
6097
|
}(/*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
6097
6098
|
Ie._attributes_ = {}, Ie._attributeToProperty_ = {};
|
6098
|
-
var
|
6099
|
+
var os = Ie;
|
6099
6100
|
var jo = "<?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",
|
6100
6101
|
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";
|
6101
6102
|
var Ue = /*#__PURE__*/function () {
|
@@ -6140,7 +6141,7 @@ var Ge = /*#__PURE__*/function () {
|
|
6140
6141
|
}]);
|
6141
6142
|
}();
|
6142
6143
|
Ge.VISIBLE_ICON_ID = "visible-icon";
|
6143
|
-
var
|
6144
|
+
var as = Ge;
|
6144
6145
|
var W = /*#__PURE__*/function () {
|
6145
6146
|
function W() {
|
6146
6147
|
_classCallCheck(this, W);
|
@@ -6244,7 +6245,7 @@ var W = /*#__PURE__*/function () {
|
|
6244
6245
|
i.id = "insert-key-contents";
|
6245
6246
|
var s = W.createInput(t.insertKeyPlaceholderText),
|
6246
6247
|
r = s.children[0],
|
6247
|
-
o =
|
6248
|
+
o = as.create(r);
|
6248
6249
|
s.appendChild(o), i.appendChild(s);
|
6249
6250
|
var a = W.createStartButton(),
|
6250
6251
|
_W$createHelpTextCont = W.createHelpTextContainer(t.keyHelpUrl, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
|
@@ -7273,18 +7274,18 @@ var Ce = /*#__PURE__*/function () {
|
|
7273
7274
|
}
|
7274
7275
|
}]);
|
7275
7276
|
}();
|
7276
|
-
var
|
7277
|
+
var Gi = /*#__PURE__*/function (_K2) {
|
7277
7278
|
// prettier-ignore
|
7278
|
-
function
|
7279
|
+
function Gi(e, t, i, s, r) {
|
7279
7280
|
var _this23;
|
7280
|
-
_classCallCheck(this,
|
7281
|
-
_this23 = _callSuper(this,
|
7281
|
+
_classCallCheck(this, Gi);
|
7282
|
+
_this23 = _callSuper(this, Gi, [e, t, i, s, r]), _this23.insertKeyPlaceholderText = "Stability AI API Key", _this23.keyHelpUrl = "https://platform.stability.ai/docs/getting-started/authentication", _this23.permittedErrorPrefixes = ["Incorrect", "invalid_"];
|
7282
7283
|
return _this23;
|
7283
7284
|
}
|
7284
|
-
_inherits(
|
7285
|
-
return _createClass(
|
7285
|
+
_inherits(Gi, _K2);
|
7286
|
+
return _createClass(Gi);
|
7286
7287
|
}(K);
|
7287
|
-
var wi = /*#__PURE__*/function (
|
7288
|
+
var wi = /*#__PURE__*/function (_Gi) {
|
7288
7289
|
function wi(e) {
|
7289
7290
|
var _this24;
|
7290
7291
|
_classCallCheck(this, wi);
|
@@ -7304,7 +7305,7 @@ var wi = /*#__PURE__*/function (_zi) {
|
|
7304
7305
|
_typeof(r) == "object" && (r.engine_id && (_this24.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), wi.cleanConfig(r), Object.assign(_this24.rawBody, r)), _this24.canSendMessage = wi.canSendFileMessage;
|
7305
7306
|
return _this24;
|
7306
7307
|
}
|
7307
|
-
_inherits(wi,
|
7308
|
+
_inherits(wi, _Gi);
|
7308
7309
|
return _createClass(wi, [{
|
7309
7310
|
key: "createFormDataBody",
|
7310
7311
|
value: function createFormDataBody(e, t) {
|
@@ -7390,8 +7391,8 @@ var wi = /*#__PURE__*/function (_zi) {
|
|
7390
7391
|
return !!(t != null && t[0]);
|
7391
7392
|
}
|
7392
7393
|
}]);
|
7393
|
-
}(
|
7394
|
-
var Ai = /*#__PURE__*/function (
|
7394
|
+
}(Gi);
|
7395
|
+
var Ai = /*#__PURE__*/function (_Gi2) {
|
7395
7396
|
function Ai(e) {
|
7396
7397
|
var _this25;
|
7397
7398
|
_classCallCheck(this, Ai);
|
@@ -7411,7 +7412,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
|
|
7411
7412
|
_typeof(r) == "object" && (r.engine_id && (_this25.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this25._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this25._maskSource = r.mask_source), Ai.cleanConfig(r), Object.assign(_this25.rawBody, r)), _this25.canSendMessage = Ai.canSendFileTextMessage;
|
7412
7413
|
return _this25;
|
7413
7414
|
}
|
7414
|
-
_inherits(Ai,
|
7415
|
+
_inherits(Ai, _Gi2);
|
7415
7416
|
return _createClass(Ai, [{
|
7416
7417
|
key: "createFormDataBody",
|
7417
7418
|
value: function createFormDataBody(e, t, i, s) {
|
@@ -7497,7 +7498,7 @@ var Ai = /*#__PURE__*/function (_zi2) {
|
|
7497
7498
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
7498
7499
|
}
|
7499
7500
|
}]);
|
7500
|
-
}(
|
7501
|
+
}(Gi);
|
7501
7502
|
var Go = /*#__PURE__*/function (_ci3) {
|
7502
7503
|
function Go(e) {
|
7503
7504
|
_classCallCheck(this, Go);
|
@@ -7760,7 +7761,7 @@ var $o = /*#__PURE__*/function (_je5) {
|
|
7760
7761
|
}()
|
7761
7762
|
}]);
|
7762
7763
|
}(je);
|
7763
|
-
var Ti = /*#__PURE__*/function (
|
7764
|
+
var Ti = /*#__PURE__*/function (_Gi3) {
|
7764
7765
|
function Ti(e) {
|
7765
7766
|
var _this28;
|
7766
7767
|
_classCallCheck(this, Ti);
|
@@ -7780,7 +7781,7 @@ var Ti = /*#__PURE__*/function (_zi3) {
|
|
7780
7781
|
_typeof(r) == "object" && (r.engine_id && (_this28.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this28._imageWeight = r.weight), Ti.cleanConfig(r), Object.assign(_this28.rawBody, r)), _this28.canSendMessage = Ti.canSendFileTextMessage;
|
7781
7782
|
return _this28;
|
7782
7783
|
}
|
7783
|
-
_inherits(Ti,
|
7784
|
+
_inherits(Ti, _Gi3);
|
7784
7785
|
return _createClass(Ti, [{
|
7785
7786
|
key: "createFormDataBody",
|
7786
7787
|
value: function createFormDataBody(e, t, i) {
|
@@ -7866,7 +7867,7 @@ var Ti = /*#__PURE__*/function (_zi3) {
|
|
7866
7867
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
7867
7868
|
}
|
7868
7869
|
}]);
|
7869
|
-
}(
|
7870
|
+
}(Gi);
|
7870
7871
|
var Jo = /*#__PURE__*/function (_je6) {
|
7871
7872
|
function Jo(e) {
|
7872
7873
|
_classCallCheck(this, Jo);
|
@@ -7906,7 +7907,7 @@ var Jo = /*#__PURE__*/function (_je6) {
|
|
7906
7907
|
}()
|
7907
7908
|
}]);
|
7908
7909
|
}(je);
|
7909
|
-
var Ci = /*#__PURE__*/function (
|
7910
|
+
var Ci = /*#__PURE__*/function (_Gi4) {
|
7910
7911
|
function Ci(e) {
|
7911
7912
|
var _this29;
|
7912
7913
|
_classCallCheck(this, Ci);
|
@@ -7918,7 +7919,7 @@ var Ci = /*#__PURE__*/function (_zi4) {
|
|
7918
7919
|
_typeof(s) == "object" && (s.engine_id && (_this29.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this29._imageWeight = s.weight), Ci.cleanConfig(s), Object.assign(_this29.rawBody, s)), _this29.canSendMessage = Ci.canSendTextMessage;
|
7919
7920
|
return _this29;
|
7920
7921
|
}
|
7921
|
-
_inherits(Ci,
|
7922
|
+
_inherits(Ci, _Gi4);
|
7922
7923
|
return _createClass(Ci, [{
|
7923
7924
|
key: "preprocessBody",
|
7924
7925
|
value: function preprocessBody(e, t) {
|
@@ -7998,7 +7999,7 @@ var Ci = /*#__PURE__*/function (_zi4) {
|
|
7998
7999
|
return !!(e && e.trim() !== "");
|
7999
8000
|
}
|
8000
8001
|
}]);
|
8001
|
-
}(
|
8002
|
+
}(Gi);
|
8002
8003
|
var Xo = /*#__PURE__*/function (_je7) {
|
8003
8004
|
function Xo(e) {
|
8004
8005
|
var _this30;
|
@@ -9074,17 +9075,17 @@ var Ve = /*#__PURE__*/function (_K3) {
|
|
9074
9075
|
}(K);
|
9075
9076
|
Ve.POLLING_TIMEOUT_MS = 500;
|
9076
9077
|
var Ri = Ve;
|
9077
|
-
var
|
9078
|
-
function
|
9078
|
+
var ws = /*#__PURE__*/function (_Ri) {
|
9079
|
+
function ws(e) {
|
9079
9080
|
var _a$headers, _l$OpenAIBeta;
|
9080
9081
|
var _this34;
|
9081
|
-
_classCallCheck(this,
|
9082
|
+
_classCallCheck(this, ws);
|
9082
9083
|
var o, a, l, c, d;
|
9083
9084
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
9084
9085
|
i = t.openAI,
|
9085
9086
|
s = (o = t.openAI) == null ? void 0 : o.assistant,
|
9086
|
-
r =
|
9087
|
-
if (_this34 = _callSuper(this,
|
9087
|
+
r = ws.buildUrlSegments(s);
|
9088
|
+
if (_this34 = _callSuper(this, ws, [e, s, r, L.buildKeyVerificationDetails(), L.buildHeaders, i]), (_a$headers = (a = _this34.connectSettings).headers) !== null && _a$headers !== void 0 ? _a$headers : a.headers = {}, (_l$OpenAIBeta = (l = _this34.connectSettings.headers)["OpenAI-Beta"]) !== null && _l$OpenAIBeta !== void 0 ? _l$OpenAIBeta : l["OpenAI-Beta"] = "assistants=v2", _this34.shouldFetchHistory && _this34.sessionId && (_this34.fetchHistory = _this34.fetchHistoryFunc.bind(_assertThisInitialized(_this34))), _typeof(s) == "object") {
|
9088
9089
|
var _ref26 = (d = (c = e.directConnection) == null ? void 0 : c.openAI) == null ? void 0 : d.assistant,
|
9089
9090
|
u = _ref26.function_handler,
|
9090
9091
|
h = _ref26.files_tool_type;
|
@@ -9092,8 +9093,8 @@ var xs = /*#__PURE__*/function (_Ri) {
|
|
9092
9093
|
}
|
9093
9094
|
return _this34;
|
9094
9095
|
}
|
9095
|
-
_inherits(
|
9096
|
-
return _createClass(
|
9096
|
+
_inherits(ws, _Ri);
|
9097
|
+
return _createClass(ws, null, [{
|
9097
9098
|
key: "buildUrlSegments",
|
9098
9099
|
value: function buildUrlSegments(e) {
|
9099
9100
|
var t = _typeof(e) == "object" && e.custom_base_url || "https://api.openai.com/v1";
|
@@ -9144,17 +9145,17 @@ var Mi = /*#__PURE__*/function () {
|
|
9144
9145
|
}
|
9145
9146
|
}]);
|
9146
9147
|
}();
|
9147
|
-
var
|
9148
|
-
function
|
9148
|
+
var As = /*#__PURE__*/function (_K4) {
|
9149
|
+
function As(e, t, i, s, r) {
|
9149
9150
|
var _this35;
|
9150
|
-
_classCallCheck(this,
|
9151
|
-
_this35 = _callSuper(this,
|
9151
|
+
_classCallCheck(this, As);
|
9152
|
+
_this35 = _callSuper(this, As, [e, Mi.buildKeyVerificationDetails(), Mi.buildHeaders, r]), _this35.insertKeyPlaceholderText = "Cohere API Key", _this35.keyHelpUrl = "https://dashboard.cohere.ai/api-keys", _this35.permittedErrorPrefixes = ["invalid"], _this35.url = t, _this35.textInputPlaceholderText = i, s && _typeof(s) == "object" && Object.assign(_this35.rawBody, s);
|
9152
9153
|
return _this35;
|
9153
9154
|
}
|
9154
|
-
_inherits(
|
9155
|
-
return _createClass(
|
9155
|
+
_inherits(As, _K4);
|
9156
|
+
return _createClass(As);
|
9156
9157
|
}(K);
|
9157
|
-
var Yo = /*#__PURE__*/function (
|
9158
|
+
var Yo = /*#__PURE__*/function (_As) {
|
9158
9159
|
function Yo(e) {
|
9159
9160
|
_classCallCheck(this, Yo);
|
9160
9161
|
var s, r, o;
|
@@ -9162,7 +9163,7 @@ var Yo = /*#__PURE__*/function (_ws) {
|
|
9162
9163
|
i = (o = e.directConnection) == null ? void 0 : o.cohere;
|
9163
9164
|
return _callSuper(this, Yo, [e, "https://api.cohere.ai/v1/generate", "Once upon a time", t, i]);
|
9164
9165
|
}
|
9165
|
-
_inherits(Yo,
|
9166
|
+
_inherits(Yo, _As);
|
9166
9167
|
return _createClass(Yo, [{
|
9167
9168
|
key: "preprocessBody",
|
9168
9169
|
value: function preprocessBody(e, t) {
|
@@ -9228,7 +9229,7 @@ var Yo = /*#__PURE__*/function (_ws) {
|
|
9228
9229
|
return extractResultData;
|
9229
9230
|
}()
|
9230
9231
|
}]);
|
9231
|
-
}(
|
9232
|
+
}(As);
|
9232
9233
|
var Is = /*#__PURE__*/function () {
|
9233
9234
|
function Is() {
|
9234
9235
|
_classCallCheck(this, Is);
|
@@ -9303,8 +9304,8 @@ var mt = /*#__PURE__*/function (_Ri2) {
|
|
9303
9304
|
return _createClass(mt);
|
9304
9305
|
}(Ri);
|
9305
9306
|
mt.THREAD_RESOURCE = "threads", mt.NEW_ASSISTANT_RESOURCE = "assistants";
|
9306
|
-
var
|
9307
|
-
var Zo = /*#__PURE__*/function (
|
9307
|
+
var ls = mt;
|
9308
|
+
var Zo = /*#__PURE__*/function (_As2) {
|
9308
9309
|
function Zo(e) {
|
9309
9310
|
_classCallCheck(this, Zo);
|
9310
9311
|
var s, r, o;
|
@@ -9312,7 +9313,7 @@ var Zo = /*#__PURE__*/function (_ws2) {
|
|
9312
9313
|
i = (o = e.directConnection) == null ? void 0 : o.cohere;
|
9313
9314
|
return _callSuper(this, Zo, [e, "https://api.cohere.ai/v1/summarize", "Insert text to summarize", t, i]);
|
9314
9315
|
}
|
9315
|
-
_inherits(Zo,
|
9316
|
+
_inherits(Zo, _As2);
|
9316
9317
|
return _createClass(Zo, [{
|
9317
9318
|
key: "preprocessBody",
|
9318
9319
|
value: function preprocessBody(e, t) {
|
@@ -9377,7 +9378,7 @@ var Zo = /*#__PURE__*/function (_ws2) {
|
|
9377
9378
|
return extractResultData;
|
9378
9379
|
}()
|
9379
9380
|
}]);
|
9380
|
-
}(
|
9381
|
+
}(As);
|
9381
9382
|
var N = /*#__PURE__*/function () {
|
9382
9383
|
function N() {
|
9383
9384
|
_classCallCheck(this, N);
|
@@ -9511,21 +9512,33 @@ var D = /*#__PURE__*/function () {
|
|
9511
9512
|
}]);
|
9512
9513
|
}();
|
9513
9514
|
var ct = /*#__PURE__*/function () {
|
9514
|
-
|
9515
|
+
// prettier-ignore
|
9516
|
+
function ct(e, t, i, s, r, o) {
|
9515
9517
|
_classCallCheck(this, ct);
|
9516
9518
|
this._mouseState = {
|
9517
9519
|
state: "default"
|
9518
|
-
}, this.isCustom = !1, N.addAttributes(e), this.elementRef = e, this.svg = Ue.createSVGElement(t), this.customStyles =
|
9520
|
+
}, this.isCustom = !1, N.addAttributes(e), this.elementRef = e, this.svg = Ue.createSVGElement(t), this.customStyles = r, this.position = i, this.tooltip = s, this.dropupText = o;
|
9519
9521
|
}
|
9520
9522
|
return _createClass(ct, [{
|
9521
9523
|
key: "buttonMouseLeave",
|
9522
9524
|
value: function buttonMouseLeave(e) {
|
9523
|
-
this._mouseState.state = "default", e && (D.unsetAllCSS(this.elementRef, e), D.setElementsCSS(this.elementRef, e, "default"));
|
9525
|
+
this._mouseState.state = "default", this.activeTooltipElement && (this.pendingTooltip && clearTimeout(this.pendingTooltip), this.activeTooltipElement instanceof HTMLElement && (this.activeTooltipElement.style.visibility = "hidden")), e && (D.unsetAllCSS(this.elementRef, e), D.setElementsCSS(this.elementRef, e, "default"));
|
9526
|
+
}
|
9527
|
+
}, {
|
9528
|
+
key: "traverseParentUntilShadowDom",
|
9529
|
+
value: function traverseParentUntilShadowDom(e) {
|
9530
|
+
var t = e;
|
9531
|
+
for (; t.parentElement;) t = t.parentElement;
|
9532
|
+
return t;
|
9524
9533
|
}
|
9525
9534
|
}, {
|
9526
9535
|
key: "buttonMouseEnter",
|
9527
9536
|
value: function buttonMouseEnter(e) {
|
9528
|
-
|
9537
|
+
var _this37 = this;
|
9538
|
+
var t;
|
9539
|
+
this._mouseState.state = "hover", this.activeTooltipElement = this.traverseParentUntilShadowDom(this.elementRef).nextSibling, this.tooltip && (this.pendingTooltip = setTimeout(function () {
|
9540
|
+
_this37.activeTooltipElement instanceof HTMLElement && (_this37.activeTooltipElement.style.visibility = "visible", _this37.activeTooltipElement.style.top = "".concat(_this37.elementRef.getBoundingClientRect().top - 30, "px"), _this37.activeTooltipElement.style.left = "".concat(_this37.elementRef.getBoundingClientRect().left - 69, "px"), console.log(_this37.activeTooltipElement.getBoundingClientRect().right));
|
9541
|
+
}, ((t = this.tooltip) == null ? void 0 : t.timeout) || 0)), e && D.setElementsCSS(this.elementRef, e, "hover");
|
9529
9542
|
}
|
9530
9543
|
}, {
|
9531
9544
|
key: "buttonMouseUp",
|
@@ -9587,17 +9600,17 @@ var ct = /*#__PURE__*/function () {
|
|
9587
9600
|
}
|
9588
9601
|
}]);
|
9589
9602
|
}();
|
9590
|
-
var
|
9591
|
-
function
|
9592
|
-
var
|
9593
|
-
_classCallCheck(this,
|
9603
|
+
var ji = /*#__PURE__*/function (_ct) {
|
9604
|
+
function ji(e) {
|
9605
|
+
var _this38;
|
9606
|
+
_classCallCheck(this, ji);
|
9594
9607
|
var i, s;
|
9595
|
-
var t = ((s = (i = e == null ? void 0 : e["default"]) == null ? void 0 : i.svg) == null ? void 0 : s.content) ||
|
9596
|
-
|
9597
|
-
return
|
9608
|
+
var t = ((s = (i = e == null ? void 0 : e["default"]) == null ? void 0 : i.svg) == null ? void 0 : s.content) || ji.EMPTY_SVG;
|
9609
|
+
_this38 = _callSuper(this, ji, [document.createElement("div"), t, void 0, void 0, e]), _this38.isActive = !1, _this38._innerElements = _this38.createInnerElementsForStates(_this38.customStyles), _this38.changeToDefault();
|
9610
|
+
return _this38;
|
9598
9611
|
}
|
9599
|
-
_inherits(
|
9600
|
-
return _createClass(
|
9612
|
+
_inherits(ji, _ct);
|
9613
|
+
return _createClass(ji, [{
|
9601
9614
|
key: "createInnerElementsForStates",
|
9602
9615
|
value: function createInnerElementsForStates(e) {
|
9603
9616
|
return {
|
@@ -9635,8 +9648,8 @@ var Ui = /*#__PURE__*/function (_ct) {
|
|
9635
9648
|
}
|
9636
9649
|
}]);
|
9637
9650
|
}(ct);
|
9638
|
-
|
9639
|
-
var ki =
|
9651
|
+
ji.EMPTY_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"></svg>';
|
9652
|
+
var ki = ji;
|
9640
9653
|
var z = /*#__PURE__*/function () {
|
9641
9654
|
function z() {
|
9642
9655
|
_classCallCheck(this, z);
|
@@ -9689,34 +9702,34 @@ var z = /*#__PURE__*/function () {
|
|
9689
9702
|
}
|
9690
9703
|
}]);
|
9691
9704
|
}();
|
9692
|
-
var
|
9693
|
-
_classCallCheck(this,
|
9705
|
+
var Hi = /*#__PURE__*/_createClass(function Hi() {
|
9706
|
+
_classCallCheck(this, Hi);
|
9694
9707
|
});
|
9695
|
-
|
9696
|
-
var Li =
|
9708
|
+
Hi.SESSION_STARTED = "sts-session-started", Hi.SESSION_STOPPED = "sts-session-stopped";
|
9709
|
+
var Li = Hi;
|
9697
9710
|
var Pn = "<?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=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
9698
|
-
|
9711
|
+
cs = "<?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=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
9699
9712
|
C = /*#__PURE__*/function (_K5) {
|
9700
9713
|
function C(e) {
|
9701
9714
|
var _l$model;
|
9702
|
-
var
|
9715
|
+
var _this39;
|
9703
9716
|
_classCallCheck(this, C);
|
9704
9717
|
var r, o, a, l;
|
9705
9718
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
9706
9719
|
i = C.getKey(e);
|
9707
|
-
|
9720
|
+
_this39 = _callSuper(this, C, [e, L.buildKeyVerificationDetails(), L.buildHeaders, {
|
9708
9721
|
key: i
|
9709
|
-
}]),
|
9722
|
+
}]), _this39.insertKeyPlaceholderText = "OpenAI API Key", _this39.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this39._microphoneButton = null, _this39._toggleButton = null, _this39._errorElement = null, _this39._loadingElement = null, _this39._pc = null, _this39._mediaStream = null, _this39._isMuted = !1;
|
9710
9723
|
var s = (r = t.openAI) == null ? void 0 : r.realtime;
|
9711
9724
|
if (_typeof(s) == "object") {
|
9712
|
-
|
9725
|
+
_this39._avatarConfig = s.avatar, _this39._ephemeralKey = s.ephemeralKey, _this39._errorConfig = s.error, _this39._loadingConfig = s.loading, Object.assign(_this39.rawBody, s.config);
|
9713
9726
|
var c = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.realtime,
|
9714
9727
|
_ref28 = c.config || {},
|
9715
9728
|
d = _ref28.function_handler;
|
9716
|
-
d && (
|
9729
|
+
d && (_this39._functionHandler = d), _this39._events = s.events, c.methods = _this39.generateMethods();
|
9717
9730
|
}
|
9718
|
-
(_l$model = (l =
|
9719
|
-
return
|
9731
|
+
(_l$model = (l = _this39.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-4o-realtime-preview-2024-12-17", _this39._avatarConfig = C.buildAvatarConfig(s), _this39._buttonsConfig = C.buildButtonsConfig(s), _this39._avatarEl = C.createAvatar(_this39._avatarConfig), _this39._containerEl = _this39.createContainer(), _this39._deepChat = e;
|
9732
|
+
return _this39;
|
9720
9733
|
}
|
9721
9734
|
_inherits(C, _K5);
|
9722
9735
|
return _createClass(C, [{
|
@@ -9877,11 +9890,11 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9877
9890
|
}, {
|
9878
9891
|
key: "generateMethods",
|
9879
9892
|
value: function generateMethods() {
|
9880
|
-
var
|
9893
|
+
var _this40 = this;
|
9881
9894
|
return {
|
9882
9895
|
updateConfig: function updateConfig(e) {
|
9883
9896
|
var t;
|
9884
|
-
(t =
|
9897
|
+
(t = _this40._dc) == null || t.send(JSON.stringify({
|
9885
9898
|
type: "session.update",
|
9886
9899
|
session: e
|
9887
9900
|
}));
|
@@ -9896,7 +9909,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9896
9909
|
text: e
|
9897
9910
|
}]
|
9898
9911
|
};
|
9899
|
-
|
9912
|
+
_this40.sendMessage(r);
|
9900
9913
|
}
|
9901
9914
|
};
|
9902
9915
|
}
|
@@ -9927,11 +9940,11 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9927
9940
|
}, {
|
9928
9941
|
key: "createMicophoneButton",
|
9929
9942
|
value: function createMicophoneButton() {
|
9930
|
-
var
|
9943
|
+
var _this41 = this;
|
9931
9944
|
var t;
|
9932
9945
|
var e = new ki((t = this._buttonsConfig) == null ? void 0 : t.microphone);
|
9933
9946
|
return e.elementRef.classList.add(C.BUTTON_DEFAULT, "deep-chat-openai-realtime-microphone"), e.elementRef.onclick = function () {
|
9934
|
-
e.isActive ? (
|
9947
|
+
e.isActive ? (_this41.toggleMicorphone(!0), e.elementRef.classList.replace(C.MICROPHONE_ACTIVE, C.BUTTON_DEFAULT), e.changeToDefault(), _this41._isMuted = !1) : (_this41.toggleMicorphone(!1), e.elementRef.classList.replace(C.BUTTON_DEFAULT, C.MICROPHONE_ACTIVE), N.removeAriaAttributes(e.elementRef), e.changeToActive(), _this41._isMuted = !0);
|
9935
9948
|
}, e;
|
9936
9949
|
}
|
9937
9950
|
}, {
|
@@ -9945,7 +9958,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9945
9958
|
}, {
|
9946
9959
|
key: "createToggleButton",
|
9947
9960
|
value: function createToggleButton() {
|
9948
|
-
var
|
9961
|
+
var _this42 = this;
|
9949
9962
|
var t;
|
9950
9963
|
var e = new ki((t = this._buttonsConfig) == null ? void 0 : t.toggle);
|
9951
9964
|
return e.elementRef.classList.add(C.BUTTON_DEFAULT, "deep-chat-openai-realtime-toggle"), e.elementRef.onclick = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91() {
|
@@ -9957,52 +9970,52 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9957
9970
|
_context91.next = 4;
|
9958
9971
|
break;
|
9959
9972
|
}
|
9960
|
-
e.changeToDefault(),
|
9973
|
+
e.changeToDefault(), _this42.stop();
|
9961
9974
|
_context91.next = 30;
|
9962
9975
|
break;
|
9963
9976
|
case 4:
|
9964
9977
|
_context91.prev = 4;
|
9965
|
-
if (!
|
9978
|
+
if (!_this42._ephemeralKey) {
|
9966
9979
|
_context91.next = 11;
|
9967
9980
|
break;
|
9968
9981
|
}
|
9969
|
-
|
9982
|
+
_this42.displayLoading();
|
9970
9983
|
_context91.next = 9;
|
9971
|
-
return
|
9984
|
+
return _this42.init(_this42._ephemeralKey);
|
9972
9985
|
case 9:
|
9973
9986
|
_context91.next = 25;
|
9974
9987
|
break;
|
9975
9988
|
case 11:
|
9976
|
-
if (!
|
9989
|
+
if (!_this42._retrievingEphemeralKey) {
|
9977
9990
|
_context91.next = 22;
|
9978
9991
|
break;
|
9979
9992
|
}
|
9980
|
-
|
9993
|
+
_this42.displayLoading();
|
9981
9994
|
_context91.next = 15;
|
9982
|
-
return
|
9995
|
+
return _this42._retrievingEphemeralKey;
|
9983
9996
|
case 15:
|
9984
9997
|
s = _context91.sent;
|
9985
|
-
_context91.t0 = (i =
|
9998
|
+
_context91.t0 = (i = _this42._toggleButton) != null && i.isActive;
|
9986
9999
|
if (!_context91.t0) {
|
9987
10000
|
_context91.next = 20;
|
9988
10001
|
break;
|
9989
10002
|
}
|
9990
10003
|
_context91.next = 20;
|
9991
|
-
return
|
10004
|
+
return _this42.init(s);
|
9992
10005
|
case 20:
|
9993
10006
|
_context91.next = 25;
|
9994
10007
|
break;
|
9995
10008
|
case 22:
|
9996
|
-
|
10009
|
+
_this42.displayLoading();
|
9997
10010
|
_context91.next = 25;
|
9998
|
-
return
|
10011
|
+
return _this42.fetchEphemeralKey(!0);
|
9999
10012
|
case 25:
|
10000
10013
|
_context91.next = 30;
|
10001
10014
|
break;
|
10002
10015
|
case 27:
|
10003
10016
|
_context91.prev = 27;
|
10004
10017
|
_context91.t1 = _context91["catch"](4);
|
10005
|
-
console.error("Failed to start conversation:", _context91.t1),
|
10018
|
+
console.error("Failed to start conversation:", _context91.t1), _this42.displayError(), _this42.hideLoading();
|
10006
10019
|
case 30:
|
10007
10020
|
case "end":
|
10008
10021
|
return _context91.stop();
|
@@ -10014,7 +10027,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10014
10027
|
key: "init",
|
10015
10028
|
value: function () {
|
10016
10029
|
var _init2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(e) {
|
10017
|
-
var
|
10030
|
+
var _this43 = this;
|
10018
10031
|
var t, i, s, r, o, a, l, c;
|
10019
10032
|
return _regeneratorRuntime().wrap(function _callee94$(_context94) {
|
10020
10033
|
while (1) switch (_context94.prev = _context94.next) {
|
@@ -10047,11 +10060,11 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10047
10060
|
return s.resume();
|
10048
10061
|
case 7:
|
10049
10062
|
l.connect(r);
|
10050
|
-
|
10063
|
+
_this43.monitorFrequencies(r, o);
|
10051
10064
|
_context92.next = 12;
|
10052
10065
|
break;
|
10053
10066
|
case 11:
|
10054
|
-
console.error("No streams found in the ontrack event."),
|
10067
|
+
console.error("No streams found in the ontrack event."), _this43.displayError();
|
10055
10068
|
case 12:
|
10056
10069
|
case "end":
|
10057
10070
|
return _context92.stop();
|
@@ -10067,9 +10080,9 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10067
10080
|
audio: !0
|
10068
10081
|
}).then(function (a) {
|
10069
10082
|
var l;
|
10070
|
-
t ===
|
10083
|
+
t === _this43._pc && (_this43._mediaStream = a, (l = _this43._pc) == null || l.addTrack(_this43._mediaStream.getTracks()[0]), _this43._isMuted && _this43.toggleMicorphone(!1));
|
10071
10084
|
})["catch"](function (a) {
|
10072
|
-
console.error("Error accessing microphone:", a),
|
10085
|
+
console.error("Error accessing microphone:", a), _this43.displayError();
|
10073
10086
|
});
|
10074
10087
|
case 10:
|
10075
10088
|
this._dc = this._pc.createDataChannel("oai-events");
|
@@ -10084,7 +10097,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10084
10097
|
_context93.next = 5;
|
10085
10098
|
break;
|
10086
10099
|
}
|
10087
|
-
|
10100
|
+
_this43.removeUnavailable(), _this43._toggleButton && (N.removeAriaAttributes(_this43._toggleButton.elementRef), _this43._toggleButton.changeToActive()), (d = (c = _this43._events) == null ? void 0 : c.started) == null || d.call(c), _this43._deepChat.dispatchEvent(new CustomEvent(Li.SESSION_STARTED)), _this43.hideLoading();
|
10088
10101
|
_context93.next = 20;
|
10089
10102
|
break;
|
10090
10103
|
case 5:
|
@@ -10100,19 +10113,19 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10100
10113
|
m = f.name, p = f.call_id;
|
10101
10114
|
_context93.prev = 9;
|
10102
10115
|
_context93.next = 12;
|
10103
|
-
return
|
10116
|
+
return _this43.handleTool(m, f.arguments, p);
|
10104
10117
|
case 12:
|
10105
10118
|
_context93.next = 17;
|
10106
10119
|
break;
|
10107
10120
|
case 14:
|
10108
10121
|
_context93.prev = 14;
|
10109
10122
|
_context93.t0 = _context93["catch"](9);
|
10110
|
-
|
10123
|
+
_this43.stopOnError(_context93.t0);
|
10111
10124
|
case 17:
|
10112
10125
|
_context93.next = 20;
|
10113
10126
|
break;
|
10114
10127
|
case 19:
|
10115
|
-
l.type === "error" ?
|
10128
|
+
l.type === "error" ? _this43.stopOnError(l.error.message) : l.type === "invalid_request_error" ? _this43.stopOnError(l.message) : l.type;
|
10116
10129
|
case 20:
|
10117
10130
|
case "end":
|
10118
10131
|
return _context93.stop();
|
@@ -10206,7 +10219,7 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10206
10219
|
}, {
|
10207
10220
|
key: "monitorFrequencies",
|
10208
10221
|
value: function monitorFrequencies(e, t) {
|
10209
|
-
var
|
10222
|
+
var _this44 = this;
|
10210
10223
|
var i = function (_i3) {
|
10211
10224
|
function i() {
|
10212
10225
|
return _i3.apply(this, arguments);
|
@@ -10224,8 +10237,8 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10224
10237
|
r = t.length * 255,
|
10225
10238
|
o = s / r * 100,
|
10226
10239
|
a = 1,
|
10227
|
-
l = a + o / 100 * (((c =
|
10228
|
-
|
10240
|
+
l = a + o / 100 * (((c = _this44._avatarConfig) == null ? void 0 : c.maxScale) - a);
|
10241
|
+
_this44._avatarEl.style.transform = "scale(".concat(l, ")"), requestAnimationFrame(i);
|
10229
10242
|
});
|
10230
10243
|
i();
|
10231
10244
|
}
|
@@ -10377,14 +10390,14 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10377
10390
|
var _t$microphone, _o$default, _a$svg, _l$content, _t$toggle, _h$default, _f$svg, _m$content, _p$active, _g$svg, _b$content;
|
10378
10391
|
var i, s, r, o, a, l, c, d, u, h, f, m, p, g, b;
|
10379
10392
|
var t = _typeof(e) == "object" && e.buttons ? JSON.parse(JSON.stringify(e.buttons)) : {};
|
10380
|
-
return (r = (s = (i = t.microphone) == null ? void 0 : i["default"]) == null ? void 0 : s.text) != null && r.content || ((_t$microphone = t.microphone) !== null && _t$microphone !== void 0 ? _t$microphone : t.microphone = {}, (_o$default = (o = t.microphone)["default"]) !== null && _o$default !== void 0 ? _o$default : o["default"] = {}, (_a$svg = (a = t.microphone["default"]).svg) !== null && _a$svg !== void 0 ? _a$svg : a.svg = {}, (_l$content = (l = t.microphone["default"].svg).content) !== null && _l$content !== void 0 ? _l$content : l.content = On), (u = (d = (c = t.toggle) == null ? void 0 : c["default"]) == null ? void 0 : d.text) != null && u.content || ((_t$toggle = t.toggle) !== null && _t$toggle !== void 0 ? _t$toggle : t.toggle = {}, (_h$default = (h = t.toggle)["default"]) !== null && _h$default !== void 0 ? _h$default : h["default"] = {}, (_f$svg = (f = t.toggle["default"]).svg) !== null && _f$svg !== void 0 ? _f$svg : f.svg = {}, (_m$content = (m = t.toggle["default"].svg).content) !== null && _m$content !== void 0 ? _m$content : m.content = Pn, (_p$active = (p = t.toggle).active) !== null && _p$active !== void 0 ? _p$active : p.active = {}, (_g$svg = (g = t.toggle.active).svg) !== null && _g$svg !== void 0 ? _g$svg : g.svg = {}, (_b$content = (b = t.toggle.active.svg).content) !== null && _b$content !== void 0 ? _b$content : b.content =
|
10393
|
+
return (r = (s = (i = t.microphone) == null ? void 0 : i["default"]) == null ? void 0 : s.text) != null && r.content || ((_t$microphone = t.microphone) !== null && _t$microphone !== void 0 ? _t$microphone : t.microphone = {}, (_o$default = (o = t.microphone)["default"]) !== null && _o$default !== void 0 ? _o$default : o["default"] = {}, (_a$svg = (a = t.microphone["default"]).svg) !== null && _a$svg !== void 0 ? _a$svg : a.svg = {}, (_l$content = (l = t.microphone["default"].svg).content) !== null && _l$content !== void 0 ? _l$content : l.content = On), (u = (d = (c = t.toggle) == null ? void 0 : c["default"]) == null ? void 0 : d.text) != null && u.content || ((_t$toggle = t.toggle) !== null && _t$toggle !== void 0 ? _t$toggle : t.toggle = {}, (_h$default = (h = t.toggle)["default"]) !== null && _h$default !== void 0 ? _h$default : h["default"] = {}, (_f$svg = (f = t.toggle["default"]).svg) !== null && _f$svg !== void 0 ? _f$svg : f.svg = {}, (_m$content = (m = t.toggle["default"].svg).content) !== null && _m$content !== void 0 ? _m$content : m.content = Pn, (_p$active = (p = t.toggle).active) !== null && _p$active !== void 0 ? _p$active : p.active = {}, (_g$svg = (g = t.toggle.active).svg) !== null && _g$svg !== void 0 ? _g$svg : g.svg = {}, (_b$content = (b = t.toggle.active.svg).content) !== null && _b$content !== void 0 ? _b$content : b.content = cs), t;
|
10381
10394
|
}
|
10382
10395
|
}, {
|
10383
10396
|
key: "createAvatar",
|
10384
10397
|
value: function createAvatar(e) {
|
10385
10398
|
var i;
|
10386
10399
|
var t = document.createElement("img");
|
10387
|
-
return t.id = "deep-chat-openai-realtime-avatar", Object.assign(t.style, (i = e == null ? void 0 : e.styles) == null ? void 0 : i.image), t.src = (e == null ? void 0 : e.src) ||
|
10400
|
+
return t.id = "deep-chat-openai-realtime-avatar", Object.assign(t.style, (i = e == null ? void 0 : e.styles) == null ? void 0 : i.image), t.src = (e == null ? void 0 : e.src) || ns, t;
|
10388
10401
|
}
|
10389
10402
|
}, {
|
10390
10403
|
key: "createButtonContainer",
|
@@ -10410,19 +10423,19 @@ var Pn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10410
10423
|
}]);
|
10411
10424
|
}(K);
|
10412
10425
|
C.BUTTON_DEFAULT = "deep-chat-openai-realtime-button-default", C.BUTTON_LOADING = "deep-chat-openai-realtime-button-loading", C.MICROPHONE_ACTIVE = "deep-chat-openai-realtime-microphone-active", C.UNAVAILABLE = "deep-chat-openai-realtime-button-unavailable";
|
10413
|
-
var
|
10426
|
+
var ds = C;
|
10414
10427
|
var gt = /*#__PURE__*/function (_K6) {
|
10415
10428
|
function gt(e) {
|
10416
10429
|
var _o$model, _a$voice;
|
10417
|
-
var
|
10430
|
+
var _this45;
|
10418
10431
|
_classCallCheck(this, gt);
|
10419
10432
|
var r, o, a;
|
10420
10433
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
10421
10434
|
i = t == null ? void 0 : t.openAI;
|
10422
|
-
|
10435
|
+
_this45 = _callSuper(this, gt, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i]), _this45.insertKeyPlaceholderText = "OpenAI API Key", _this45.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this45.url = "https://api.openai.com/v1/audio/speech", _this45.permittedErrorPrefixes = ["Invalid"], _this45.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>";
|
10423
10436
|
var s = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.textToSpeech;
|
10424
|
-
_typeof(s) == "object" && Object.assign(
|
10425
|
-
return
|
10437
|
+
_typeof(s) == "object" && Object.assign(_this45.rawBody, s), (_o$model = (o = _this45.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = gt.DEFAULT_MODEL, (_a$voice = (a = _this45.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = gt.DEFAULT_VOIDE, _this45.textInputPlaceholderText = "Insert text to generate audio", _this45.rawBody.response_format = "mp3";
|
10438
|
+
return _this45;
|
10426
10439
|
}
|
10427
10440
|
_inherits(gt, _K6);
|
10428
10441
|
return _createClass(gt, [{
|
@@ -10507,21 +10520,21 @@ var gt = /*#__PURE__*/function (_K6) {
|
|
10507
10520
|
}]);
|
10508
10521
|
}(K);
|
10509
10522
|
gt.DEFAULT_MODEL = "tts-1", gt.DEFAULT_VOIDE = "alloy";
|
10510
|
-
var
|
10523
|
+
var hs = gt;
|
10511
10524
|
var me = /*#__PURE__*/function (_K7) {
|
10512
10525
|
function me(e) {
|
10513
10526
|
var _o$model2;
|
10514
|
-
var
|
10527
|
+
var _this46;
|
10515
10528
|
_classCallCheck(this, me);
|
10516
10529
|
var r, o;
|
10517
10530
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
10518
10531
|
i = t == null ? void 0 : t.openAI;
|
10519
|
-
|
10532
|
+
_this46 = _callSuper(this, me, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i, {
|
10520
10533
|
audio: {}
|
10521
|
-
}]),
|
10534
|
+
}]), _this46.insertKeyPlaceholderText = "OpenAI API Key", _this46.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this46.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this46.url = "", _this46.permittedErrorPrefixes = ["Invalid"], _this46.textInputPlaceholderText = "Upload an audio file", _this46._service_url = me.AUDIO_TRANSCRIPTIONS_URL;
|
10522
10535
|
var s = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.audio;
|
10523
|
-
_typeof(s) == "object" && (
|
10524
|
-
return
|
10536
|
+
_typeof(s) == "object" && (_this46.processConfig(s), me.cleanConfig(s), Object.assign(_this46.rawBody, s)), (_o$model2 = (o = _this46.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = me.DEFAULT_MODEL, _this46.rawBody.response_format = "json", _this46.canSendMessage = me.canSendFileMessage;
|
10537
|
+
return _this46;
|
10525
10538
|
}
|
10526
10539
|
_inherits(me, _K7);
|
10527
10540
|
return _createClass(me, [{
|
@@ -10620,7 +10633,7 @@ var me = /*#__PURE__*/function (_K7) {
|
|
10620
10633
|
}]);
|
10621
10634
|
}(K);
|
10622
10635
|
me.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions", me.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations", me.DEFAULT_MODEL = "whisper-1";
|
10623
|
-
var
|
10636
|
+
var us = me;
|
10624
10637
|
var fe = /*#__PURE__*/function () {
|
10625
10638
|
function fe() {
|
10626
10639
|
_classCallCheck(this, fe);
|
@@ -10725,12 +10738,12 @@ var fe = /*#__PURE__*/function () {
|
|
10725
10738
|
var Qo = /*#__PURE__*/function (_K8) {
|
10726
10739
|
// prettier-ignore
|
10727
10740
|
function Qo(e, t, i, s, r) {
|
10728
|
-
var
|
10741
|
+
var _this47;
|
10729
10742
|
_classCallCheck(this, Qo);
|
10730
|
-
|
10743
|
+
_this47 = _callSuper(this, Qo, [e, fe.buildLanguageKeyVerificationDetails(i), t, s, r]), _this47.insertKeyPlaceholderText = "Azure Language Subscription Key", _this47.keyHelpUrl =
|
10731
10744
|
// eslint-disable-next-line max-len
|
10732
|
-
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal",
|
10733
|
-
return
|
10745
|
+
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this47.permittedErrorPrefixes = ["Access"];
|
10746
|
+
return _this47;
|
10734
10747
|
}
|
10735
10748
|
_inherits(Qo, _K8);
|
10736
10749
|
return _createClass(Qo);
|
@@ -10738,19 +10751,19 @@ var Qo = /*#__PURE__*/function (_K8) {
|
|
10738
10751
|
var Yt = /*#__PURE__*/function (_Qo) {
|
10739
10752
|
function Yt(e) {
|
10740
10753
|
var _a$language;
|
10741
|
-
var
|
10754
|
+
var _this48;
|
10742
10755
|
_classCallCheck(this, Yt);
|
10743
10756
|
var s, r, o, a;
|
10744
10757
|
var t = (r = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : r.summarization,
|
10745
10758
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
10746
|
-
|
10759
|
+
_this48 = _callSuper(this, Yt, [e, fe.buildSummarizationHeader, t.endpoint, i]), _this48.permittedErrorPrefixes = [Yt.ENDPOINT_ERROR_MESSAGE], _this48.url = "", _this48.textInputPlaceholderText = "Insert text to summarize", _this48.isTextInputDisabled = !1, t.endpoint ? ((_a$language = (a = _this48.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this48.rawBody, t), _this48.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview")) : (_this48.isTextInputDisabled = !0, _this48.canSendMessage = function () {
|
10747
10760
|
return !1;
|
10748
10761
|
}, setTimeout(function () {
|
10749
10762
|
e.addMessage({
|
10750
10763
|
error: Yt.ENDPOINT_ERROR_MESSAGE
|
10751
10764
|
});
|
10752
10765
|
}));
|
10753
|
-
return
|
10766
|
+
return _this48;
|
10754
10767
|
}
|
10755
10768
|
_inherits(Yt, _Qo);
|
10756
10769
|
return _createClass(Yt, [{
|
@@ -10897,7 +10910,7 @@ var Yt = /*#__PURE__*/function (_Qo) {
|
|
10897
10910
|
Yt.ENDPOINT_ERROR_MESSAGE =
|
10898
10911
|
// eslint-disable-next-line max-len
|
10899
10912
|
"Please define the azure endpoint. [More Information](https://deepchat.dev/docs/directConnection/Azure#Summarization)";
|
10900
|
-
var
|
10913
|
+
var fs = Yt;
|
10901
10914
|
var Kt = /*#__PURE__*/function () {
|
10902
10915
|
function Kt() {
|
10903
10916
|
_classCallCheck(this, Kt);
|
@@ -11003,19 +11016,19 @@ var Kt = /*#__PURE__*/function () {
|
|
11003
11016
|
}
|
11004
11017
|
}]);
|
11005
11018
|
}();
|
11006
|
-
var
|
11007
|
-
function
|
11008
|
-
var
|
11009
|
-
_classCallCheck(this,
|
11019
|
+
var Ts = /*#__PURE__*/function (_K9) {
|
11020
|
+
function Ts(e) {
|
11021
|
+
var _this49;
|
11022
|
+
_classCallCheck(this, Ts);
|
11010
11023
|
var i;
|
11011
11024
|
var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
|
11012
|
-
|
11025
|
+
_this49 = _callSuper(this, Ts, [e, Kt.buildKeyVerificationDetails(), Kt.buildHeaders, t, {
|
11013
11026
|
audio: {}
|
11014
|
-
}]),
|
11015
|
-
return
|
11027
|
+
}]), _this49.insertKeyPlaceholderText = "AssemblyAI API Key", _this49.keyHelpUrl = "https://www.assemblyai.com/app/account", _this49.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>", _this49.url = "https://api.assemblyai.com/v2/upload", _this49.isTextInputDisabled = !0, _this49.textInputPlaceholderText = "Upload an audio file", _this49.permittedErrorPrefixes = ["Authentication", "Invalid"], _this49.canSendMessage = Ts.canFileSendMessage;
|
11028
|
+
return _this49;
|
11016
11029
|
}
|
11017
|
-
_inherits(
|
11018
|
-
return _createClass(
|
11030
|
+
_inherits(Ts, _K9);
|
11031
|
+
return _createClass(Ts, [{
|
11019
11032
|
key: "callServiceAPI",
|
11020
11033
|
value: function () {
|
11021
11034
|
var _callServiceAPI13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee104(e, t, i) {
|
@@ -11090,12 +11103,12 @@ var As = /*#__PURE__*/function (_K9) {
|
|
11090
11103
|
var Nn = /*#__PURE__*/function (_K0) {
|
11091
11104
|
// prettier-ignore
|
11092
11105
|
function Nn(e, t, i, s, r) {
|
11093
|
-
var
|
11106
|
+
var _this50;
|
11094
11107
|
_classCallCheck(this, Nn);
|
11095
|
-
|
11108
|
+
_this50 = _callSuper(this, Nn, [e, fe.buildSpeechKeyVerificationDetails(i), t, s, r]), _this50.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this50.keyHelpUrl =
|
11096
11109
|
// eslint-disable-next-line max-len
|
11097
11110
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
11098
|
-
return
|
11111
|
+
return _this50;
|
11099
11112
|
}
|
11100
11113
|
_inherits(Nn, _K0);
|
11101
11114
|
return _createClass(Nn);
|
@@ -11104,19 +11117,19 @@ var Qe = /*#__PURE__*/function (_Nn) {
|
|
11104
11117
|
// prettier-ignore
|
11105
11118
|
function Qe(e) {
|
11106
11119
|
var _a$lang, _l$name, _c$gender;
|
11107
|
-
var
|
11120
|
+
var _this51;
|
11108
11121
|
_classCallCheck(this, Qe);
|
11109
11122
|
var s, r, o, a, l, c;
|
11110
11123
|
var t = (r = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : r.textToSpeech,
|
11111
11124
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
11112
|
-
|
11125
|
+
_this51 = _callSuper(this, Qe, [e, fe.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this51.permittedErrorPrefixes = [Qe.REGION_ERROR_MESSAGE], _this51.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(Qe.HELP_LINK, "\">here</a> for more info.\n </p>"), _this51.isTextInputDisabled = !1, _this51.url = "", t.region ? (Object.assign(_this51.rawBody, t), (_a$lang = (a = _this51.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this51.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this51.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this51.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1")) : (_this51.isTextInputDisabled = !0, _this51.canSendMessage = function () {
|
11113
11126
|
return !1;
|
11114
11127
|
}, setTimeout(function () {
|
11115
11128
|
e.addMessage({
|
11116
11129
|
error: Qe.REGION_ERROR_MESSAGE
|
11117
11130
|
});
|
11118
11131
|
}));
|
11119
|
-
return
|
11132
|
+
return _this51;
|
11120
11133
|
}
|
11121
11134
|
_inherits(Qe, _Nn);
|
11122
11135
|
return _createClass(Qe, [{
|
@@ -11188,10 +11201,10 @@ Qe.HELP_LINK =
|
|
11188
11201
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", Qe.REGION_ERROR_MESSAGE =
|
11189
11202
|
// eslint-disable-next-line max-len
|
11190
11203
|
"Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#TextToSpeech)";
|
11191
|
-
var
|
11204
|
+
var ps = Qe;
|
11192
11205
|
var Ke = /*#__PURE__*/function (_Nn2) {
|
11193
11206
|
function Ke(e) {
|
11194
|
-
var
|
11207
|
+
var _this52;
|
11195
11208
|
_classCallCheck(this, Ke);
|
11196
11209
|
var r, o, a;
|
11197
11210
|
var t = (o = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : o.speechToText,
|
@@ -11203,18 +11216,18 @@ var Ke = /*#__PURE__*/function (_Nn2) {
|
|
11203
11216
|
}
|
11204
11217
|
}
|
11205
11218
|
};
|
11206
|
-
if (
|
11219
|
+
if (_this52 = _callSuper(this, Ke, [e, fe.buildSpeechToTextHeaders, t.region, i, s]), _this52.permittedErrorPrefixes = [Ke.REGION_ERROR_MESSAGE], _this52.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(Ke.HELP_LINK, "\">here</a> for more info.\n </p>"), _this52.url = "", _this52.isTextInputDisabled = !0, _this52.textInputPlaceholderText = "Upload an audio file", !t.region) _this52.isTextInputDisabled = !0, _this52.canSendMessage = function () {
|
11207
11220
|
return !1;
|
11208
11221
|
}, setTimeout(function () {
|
11209
11222
|
e.addMessage({
|
11210
11223
|
error: Ke.REGION_ERROR_MESSAGE
|
11211
11224
|
});
|
11212
11225
|
});else {
|
11213
|
-
|
11226
|
+
_this52.canSendMessage = Ke.canFileSendMessage;
|
11214
11227
|
var l = t.lang || "en-US";
|
11215
|
-
|
11228
|
+
_this52.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(l, "&format=detailed"), _this52.recordAudio = void 0;
|
11216
11229
|
}
|
11217
|
-
return
|
11230
|
+
return _this52;
|
11218
11231
|
}
|
11219
11232
|
_inherits(Ke, _Nn2);
|
11220
11233
|
return _createClass(Ke, [{
|
@@ -11288,19 +11301,19 @@ Ke.HELP_LINK =
|
|
11288
11301
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", Ke.REGION_ERROR_MESSAGE =
|
11289
11302
|
// eslint-disable-next-line max-len
|
11290
11303
|
"Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#SpeechToText)";
|
11291
|
-
var
|
11304
|
+
var ms = Ke;
|
11292
11305
|
var ea = /*#__PURE__*/function (_K1) {
|
11293
11306
|
// prettier-ignore
|
11294
11307
|
function ea(e) {
|
11295
|
-
var
|
11308
|
+
var _this53;
|
11296
11309
|
_classCallCheck(this, ea);
|
11297
11310
|
var s, r, o;
|
11298
11311
|
var t = (r = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : r.translation,
|
11299
11312
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
11300
|
-
|
11313
|
+
_this53 = _callSuper(this, ea, [e, fe.buildTranslationKeyVerificationDetails(t.region), fe.buildTranslationHeaders.bind({}, t == null ? void 0 : t.region), i]), _this53.insertKeyPlaceholderText = "Azure Translate Subscription Key", _this53.keyHelpUrl =
|
11301
11314
|
// eslint-disable-next-line max-len
|
11302
|
-
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal",
|
11303
|
-
return
|
11315
|
+
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this53.url = "", _this53.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
|
11316
|
+
return _this53;
|
11304
11317
|
}
|
11305
11318
|
_inherits(ea, _K1);
|
11306
11319
|
return _createClass(ea, [{
|
@@ -11372,23 +11385,23 @@ var vt = /*#__PURE__*/function (_K10) {
|
|
11372
11385
|
// https://platform.openai.com/docs/models/gpt-4o-audio-preview
|
11373
11386
|
// prettier-ignore
|
11374
11387
|
function vt(e, t, i, s, r) {
|
11375
|
-
var
|
11376
|
-
var
|
11388
|
+
var _this54$maxMessages, _p$model;
|
11389
|
+
var _this54;
|
11377
11390
|
_classCallCheck(this, vt);
|
11378
11391
|
var u, h, f, m, p;
|
11379
11392
|
var o = JSON.parse(JSON.stringify(e.directConnection)),
|
11380
11393
|
a = t || L.buildKeyVerificationDetails(),
|
11381
11394
|
l = i || L.buildHeaders,
|
11382
11395
|
c = s || o.openAI;
|
11383
|
-
|
11396
|
+
_this54 = _callSuper(this, vt, [e, a, l, c]), _this54.insertKeyPlaceholderText = "OpenAI API Key", _this54.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this54.url = "https://api.openai.com/v1/chat/completions", _this54.permittedErrorPrefixes = ["Incorrect"], _this54.asyncCallInProgress = !1, _this54._systemMessage = vt.generateSystemMessage("You are a helpful assistant.");
|
11384
11397
|
var d = r || ((u = o.openAI) == null ? void 0 : u.chat);
|
11385
11398
|
if (_typeof(d) == "object") {
|
11386
|
-
d.system_prompt && (
|
11399
|
+
d.system_prompt && (_this54._systemMessage = vt.generateSystemMessage(d.system_prompt));
|
11387
11400
|
var g = (m = (f = (h = e.directConnection) == null ? void 0 : h.openAI) == null ? void 0 : f.chat) == null ? void 0 : m.function_handler;
|
11388
|
-
g && (
|
11401
|
+
g && (_this54._functionHandler = g), _this54.cleanConfig(d), Object.assign(_this54.rawBody, d);
|
11389
11402
|
}
|
11390
|
-
(
|
11391
|
-
return
|
11403
|
+
(_this54$maxMessages = _this54.maxMessages) !== null && _this54$maxMessages !== void 0 ? _this54$maxMessages : _this54.maxMessages = -1, (_p$model = (p = _this54.rawBody).model) !== null && _p$model !== void 0 ? _p$model : p.model = "gpt-4o";
|
11404
|
+
return _this54;
|
11392
11405
|
}
|
11393
11406
|
_inherits(vt, _K10);
|
11394
11407
|
return _createClass(vt, [{
|
@@ -11474,7 +11487,7 @@ var vt = /*#__PURE__*/function (_K10) {
|
|
11474
11487
|
key: "extractStreamResult",
|
11475
11488
|
value: function () {
|
11476
11489
|
var _extractStreamResult = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee114(e, t, i) {
|
11477
|
-
var
|
11490
|
+
var _this55 = this;
|
11478
11491
|
var s, r, o;
|
11479
11492
|
return _regeneratorRuntime().wrap(function _callee114$(_context114) {
|
11480
11493
|
while (1) switch (_context114.prev = _context114.next) {
|
@@ -11491,7 +11504,7 @@ var vt = /*#__PURE__*/function (_K10) {
|
|
11491
11504
|
return _context114.abrupt("return", (this._streamToolCalls = void 0, this.handleTools(o, t, i)));
|
11492
11505
|
case 7:
|
11493
11506
|
s != null && s.tool_calls && (this._streamToolCalls ? s.tool_calls.forEach(function (o, a) {
|
11494
|
-
|
11507
|
+
_this55._streamToolCalls && (_this55._streamToolCalls[a]["function"].arguments += o["function"].arguments);
|
11495
11508
|
}) : this._streamToolCalls = s.tool_calls);
|
11496
11509
|
case 8:
|
11497
11510
|
return _context114.abrupt("return", {
|
@@ -11663,31 +11676,31 @@ var vt = /*#__PURE__*/function (_K10) {
|
|
11663
11676
|
}
|
11664
11677
|
}]);
|
11665
11678
|
}(K);
|
11666
|
-
var
|
11667
|
-
function
|
11668
|
-
var
|
11669
|
-
_classCallCheck(this,
|
11679
|
+
var Cs = /*#__PURE__*/function (_vt) {
|
11680
|
+
function Cs(e) {
|
11681
|
+
var _this56;
|
11682
|
+
_classCallCheck(this, Cs);
|
11670
11683
|
var o, a, l, c, d, u, h;
|
11671
11684
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
11672
11685
|
i = t.azure,
|
11673
11686
|
s = ((a = (o = t.azure) == null ? void 0 : o.openAI) == null ? void 0 : a.urlDetails) || {},
|
11674
11687
|
r = (c = (l = t.azure) == null ? void 0 : l.openAI) == null ? void 0 : c.chat;
|
11675
|
-
if (
|
11688
|
+
if (_this56 = _callSuper(this, Cs, [e, ue.buildKeyVerificationDetails(s), ue.buildHeaders, i, r]), _this56.permittedErrorPrefixes = [ue.URL_DETAILS_ERROR_MESSAGE], _this56.isTextInputDisabled = !1, _typeof(r) == "object") {
|
11676
11689
|
var _ref33 = (h = (u = (d = e.directConnection) == null ? void 0 : d.azure) == null ? void 0 : u.openAI) == null ? void 0 : h.chat,
|
11677
11690
|
f = _ref33.function_handler;
|
11678
|
-
f && (
|
11691
|
+
f && (_this56._functionHandler = f);
|
11679
11692
|
}
|
11680
|
-
ue.validateURLDetails(s) ?
|
11693
|
+
ue.validateURLDetails(s) ? _this56.url = Cs.buildURL(s) : (_this56.isTextInputDisabled = !0, _this56.canSendMessage = function () {
|
11681
11694
|
return !1;
|
11682
11695
|
}, setTimeout(function () {
|
11683
11696
|
e.addMessage({
|
11684
11697
|
error: ue.URL_DETAILS_ERROR_MESSAGE
|
11685
11698
|
});
|
11686
11699
|
}));
|
11687
|
-
return
|
11700
|
+
return _this56;
|
11688
11701
|
}
|
11689
|
-
_inherits(
|
11690
|
-
return _createClass(
|
11702
|
+
_inherits(Cs, _vt);
|
11703
|
+
return _createClass(Cs, null, [{
|
11691
11704
|
key: "buildURL",
|
11692
11705
|
value: function buildURL(e) {
|
11693
11706
|
var t = e.endpoint,
|
@@ -11699,7 +11712,7 @@ var Ts = /*#__PURE__*/function (_vt) {
|
|
11699
11712
|
}(vt);
|
11700
11713
|
var ge = /*#__PURE__*/function (_K11) {
|
11701
11714
|
function ge(e) {
|
11702
|
-
var
|
11715
|
+
var _this57;
|
11703
11716
|
_classCallCheck(this, ge);
|
11704
11717
|
var o;
|
11705
11718
|
var t = e.directConnection,
|
@@ -11712,19 +11725,19 @@ var ge = /*#__PURE__*/function (_K11) {
|
|
11712
11725
|
}
|
11713
11726
|
}
|
11714
11727
|
};
|
11715
|
-
|
11728
|
+
_this57 = _callSuper(this, ge, [e, L.buildKeyVerificationDetails(), L.buildHeaders, i, s]), _this57.insertKeyPlaceholderText = "OpenAI API Key", _this57.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this57.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this57.url = "", _this57.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
|
11716
11729
|
var r = (o = t == null ? void 0 : t.openAI) == null ? void 0 : o.images;
|
11717
|
-
if (
|
11730
|
+
if (_this57.camera) {
|
11718
11731
|
var a = _typeof(r) == "object" && r.size ? Number.parseInt(r.size) : 1024;
|
11719
|
-
|
11732
|
+
_this57.camera.files = {
|
11720
11733
|
dimensions: {
|
11721
11734
|
width: a,
|
11722
11735
|
height: a
|
11723
11736
|
}
|
11724
11737
|
};
|
11725
11738
|
}
|
11726
|
-
_typeof(r) == "object" && Object.assign(
|
11727
|
-
return
|
11739
|
+
_typeof(r) == "object" && Object.assign(_this57.rawBody, r), _this57.canSendMessage = ge.canFileSendMessage;
|
11740
|
+
return _this57;
|
11728
11741
|
}
|
11729
11742
|
_inherits(ge, _K11);
|
11730
11743
|
return _createClass(ge, [{
|
@@ -11848,20 +11861,20 @@ var ge = /*#__PURE__*/function (_K11) {
|
|
11848
11861
|
}]);
|
11849
11862
|
}(K);
|
11850
11863
|
ge.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", ge.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations", ge.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
11851
|
-
var
|
11852
|
-
var ta = /*#__PURE__*/function (
|
11864
|
+
var gs = ge;
|
11865
|
+
var ta = /*#__PURE__*/function (_As3) {
|
11853
11866
|
function ta(e) {
|
11854
|
-
var
|
11855
|
-
var
|
11867
|
+
var _this58$maxMessages;
|
11868
|
+
var _this58;
|
11856
11869
|
_classCallCheck(this, ta);
|
11857
11870
|
var r;
|
11858
11871
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
11859
11872
|
i = (r = t.cohere) == null ? void 0 : r.chat,
|
11860
11873
|
s = t.cohere;
|
11861
|
-
|
11862
|
-
return
|
11874
|
+
_this58 = _callSuper(this, ta, [e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, s]), _typeof(i) == "object" && Object.assign(_this58.rawBody, i), (_this58$maxMessages = _this58.maxMessages) !== null && _this58$maxMessages !== void 0 ? _this58$maxMessages : _this58.maxMessages = -1;
|
11875
|
+
return _this58;
|
11863
11876
|
}
|
11864
|
-
_inherits(ta,
|
11877
|
+
_inherits(ta, _As3);
|
11865
11878
|
return _createClass(ta, [{
|
11866
11879
|
key: "preprocessBody",
|
11867
11880
|
value: function preprocessBody(e, t) {
|
@@ -11931,7 +11944,7 @@ var ta = /*#__PURE__*/function (_ws3) {
|
|
11931
11944
|
return extractResultData;
|
11932
11945
|
}()
|
11933
11946
|
}]);
|
11934
|
-
}(
|
11947
|
+
}(As);
|
11935
11948
|
var Ii = /*#__PURE__*/function () {
|
11936
11949
|
function Ii() {
|
11937
11950
|
_classCallCheck(this, Ii);
|
@@ -11965,13 +11978,13 @@ var Ii = /*#__PURE__*/function () {
|
|
11965
11978
|
}();
|
11966
11979
|
var ia = /*#__PURE__*/function (_K12) {
|
11967
11980
|
function ia(e) {
|
11968
|
-
var
|
11969
|
-
var
|
11981
|
+
var _this59$maxMessages, _s$model;
|
11982
|
+
var _this59;
|
11970
11983
|
_classCallCheck(this, ia);
|
11971
11984
|
var s;
|
11972
11985
|
var i = JSON.parse(JSON.stringify(e.directConnection)).mistral;
|
11973
|
-
|
11974
|
-
return
|
11986
|
+
_this59 = _callSuper(this, ia, [e, Ii.buildKeyVerificationDetails(), Ii.buildHeaders, i]), _this59.insertKeyPlaceholderText = "Mistral API Key", _this59.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this59.url = "https://api.mistral.ai/v1/chat/completions", _this59.permittedErrorPrefixes = ["invalid"], i && (_this59.cleanConfig(i), Object.assign(_this59.rawBody, i)), (_this59$maxMessages = _this59.maxMessages) !== null && _this59$maxMessages !== void 0 ? _this59$maxMessages : _this59.maxMessages = -1, (_s$model = (s = _this59.rawBody).model) !== null && _s$model !== void 0 ? _s$model : s.model = "open-mistral-7b";
|
11987
|
+
return _this59;
|
11975
11988
|
}
|
11976
11989
|
_inherits(ia, _K12);
|
11977
11990
|
return _createClass(ia, [{
|
@@ -12065,18 +12078,18 @@ var sa = /*#__PURE__*/function () {
|
|
12065
12078
|
r = e.webModel;
|
12066
12079
|
if (r) return new ni(e);
|
12067
12080
|
if (t) {
|
12068
|
-
if (t.openAI) return t.openAI.images ? new
|
12069
|
-
if (t.assemblyAI) return new
|
12081
|
+
if (t.openAI) return t.openAI.images ? new gs(e) : t.openAI.speechToText ? new us(e) : t.openAI.textToSpeech ? new hs(e) : t.openAI.assistant ? new ws(e) : t.openAI.realtime ? new ds(e) : new vt(e);
|
12082
|
+
if (t.assemblyAI) return new Ts(e);
|
12070
12083
|
if (t.cohere) return t.cohere.textGeneration ? new Yo(e) : t.cohere.summarization ? new Zo(e) : new ta(e);
|
12071
12084
|
if (t.huggingFace) return t.huggingFace.textGeneration ? new Vo(e) : t.huggingFace.summarization ? new Wo(e) : t.huggingFace.translation ? new Jo(e) : t.huggingFace.fillMask ? new Xo(e) : t.huggingFace.questionAnswer ? new Ko(e) : t.huggingFace.audioSpeechRecognition ? new Go(e) : t.huggingFace.audioClassification ? new qo(e) : t.huggingFace.imageClassification ? new zo(e) : new $o(e);
|
12072
12085
|
if (t.azure) {
|
12073
12086
|
if (t.azure.openAI) {
|
12074
|
-
if (t.azure.openAI.chat) return new
|
12075
|
-
if (t.azure.openAI.assistant) return new
|
12087
|
+
if (t.azure.openAI.chat) return new Cs(e);
|
12088
|
+
if (t.azure.openAI.assistant) return new ls(e);
|
12076
12089
|
}
|
12077
|
-
if (t.azure.speechToText) return new
|
12078
|
-
if (t.azure.textToSpeech) return new
|
12079
|
-
if (t.azure.summarization) return new
|
12090
|
+
if (t.azure.speechToText) return new ms(e);
|
12091
|
+
if (t.azure.textToSpeech) return new ps(e);
|
12092
|
+
if (t.azure.summarization) return new fs(e);
|
12080
12093
|
if (t.azure.translation) return new ea(e);
|
12081
12094
|
}
|
12082
12095
|
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Ti(e) : t.stabilityAI.imageToImageUpscale ? new wi(e) : t.stabilityAI.imageToImageMasking ? new Ai(e) : new Ci(e);
|
@@ -12109,13 +12122,13 @@ Os.attibutes = {
|
|
12109
12122
|
return new Function("return ".concat(e))();
|
12110
12123
|
}
|
12111
12124
|
};
|
12112
|
-
var
|
12125
|
+
var bs = Os;
|
12113
12126
|
function x(n) {
|
12114
12127
|
return function (e, t) {
|
12115
12128
|
Object.defineProperty(e, t, {});
|
12116
12129
|
var i = e.constructor,
|
12117
12130
|
s = t.toLocaleLowerCase();
|
12118
|
-
i._attributes_[s] =
|
12131
|
+
i._attributes_[s] = bs.attibutes[n], i._attributeToProperty_[s] = t;
|
12119
12132
|
};
|
12120
12133
|
}
|
12121
12134
|
var Oi = /*#__PURE__*/function () {
|
@@ -12360,29 +12373,29 @@ var ra = /*#__PURE__*/function () {
|
|
12360
12373
|
}();
|
12361
12374
|
var de = /*#__PURE__*/function (_he) {
|
12362
12375
|
function de(e, t, i) {
|
12363
|
-
var
|
12376
|
+
var _this60;
|
12364
12377
|
_classCallCheck(this, de);
|
12365
12378
|
var a, l;
|
12366
|
-
|
12379
|
+
_this60 = _callSuper(this, de, [e]);
|
12367
12380
|
var s = t.permittedErrorPrefixes,
|
12368
12381
|
r = t.introPanelMarkUp,
|
12369
12382
|
o = t.demo;
|
12370
|
-
|
12371
|
-
return y.deepCloneMessagesWithReferences(
|
12383
|
+
_this60._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this60._onClearMessages = ii.onClearMessages.bind(_this60, e), _this60._onError = ii.onError.bind(_this60, e), _this60._isLoadingMessageAllowed = de.getDefaultDisplayLoadingMessage(e, t), _typeof(e.displayLoadingBubble) == "object" && e.displayLoadingBubble.toggle && (e.displayLoadingBubble.toggle = _this60.setLoadingToggle.bind(_this60)), _this60._permittedErrorPrefixes = s, _this60.addSetupMessageIfNeeded(e, t) || _this60.populateIntroPanel(i, r, e.introPanelStyle), o && _this60.prepareDemo(te.processDemo(o), e.loadHistory), _this60.addIntroductoryMessages(e, t), new si(e, _this60, t), _this60._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
12384
|
+
return y.deepCloneMessagesWithReferences(_this60.messageToElements.map(function (_ref37) {
|
12372
12385
|
var _ref38 = _slicedToArray(_ref37, 1),
|
12373
12386
|
c = _ref38[0];
|
12374
12387
|
return c;
|
12375
12388
|
}));
|
12376
|
-
}, e.clearMessages =
|
12377
|
-
|
12389
|
+
}, e.clearMessages = _this60.clearMessages.bind(_this60, t), e.refreshMessages = _this60.refreshTextMessages.bind(_this60, e.remarkable), e.scrollToBottom = V.scrollToBottom.bind(_this60, _this60.elementRef), e.addMessage = function (c, d) {
|
12390
|
+
_this60.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
|
12378
12391
|
sendUpdate: !!d
|
12379
12392
|
}), !d);
|
12380
12393
|
}, e.updateMessage = function (c, d) {
|
12381
|
-
return le.update(
|
12382
|
-
}, t.isWebModel() && t.setUpMessages(
|
12383
|
-
|
12394
|
+
return le.update(_this60, c, d);
|
12395
|
+
}, t.isWebModel() && t.setUpMessages(_this60), e.textToSpeech && bt.processConfig(e.textToSpeech, function (c) {
|
12396
|
+
_this60.textToSpeech = c;
|
12384
12397
|
});
|
12385
|
-
return
|
12398
|
+
return _this60;
|
12386
12399
|
}
|
12387
12400
|
_inherits(de, _he);
|
12388
12401
|
return _createClass(de, [{
|
@@ -12417,17 +12430,17 @@ var de = /*#__PURE__*/function (_he) {
|
|
12417
12430
|
}, {
|
12418
12431
|
key: "addIntroductoryMessages",
|
12419
12432
|
value: function addIntroductoryMessages(e, t) {
|
12420
|
-
var
|
12433
|
+
var _this61 = this;
|
12421
12434
|
e != null && e.shadowRoot && (this._introMessage = e.introMessage);
|
12422
12435
|
var i = this._introMessage;
|
12423
12436
|
t != null && t.isWebModel() && (i !== null && i !== void 0 ? i : i = t.getIntroMessage(i));
|
12424
12437
|
var s = !(e != null && e.history) && !!(e != null && e.loadHistory || t != null && t.fetchHistory);
|
12425
12438
|
i && (Array.isArray(i) ? i.forEach(function (r, o) {
|
12426
12439
|
if (o !== 0) {
|
12427
|
-
var a =
|
12428
|
-
y.hideRoleElements(a,
|
12440
|
+
var a = _this61.messageElementRefs[_this61.messageElementRefs.length - 1].innerContainer;
|
12441
|
+
y.hideRoleElements(a, _this61.avatar, _this61.name);
|
12429
12442
|
}
|
12430
|
-
|
12443
|
+
_this61.addIntroductoryMessage(r, s);
|
12431
12444
|
}) : this.addIntroductoryMessage(i, s));
|
12432
12445
|
}
|
12433
12446
|
}, {
|
@@ -12518,7 +12531,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12518
12531
|
}, {
|
12519
12532
|
key: "addNewErrorMessage",
|
12520
12533
|
value: function addNewErrorMessage(e, t) {
|
12521
|
-
var
|
12534
|
+
var _this62 = this;
|
12522
12535
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
12523
12536
|
var c, d, u, h, f, m;
|
12524
12537
|
(c = this._hiddenAttachments) == null || c.readdHiddenFiles(), this.removeMessageOnError();
|
@@ -12530,7 +12543,7 @@ var de = /*#__PURE__*/function (_he) {
|
|
12530
12543
|
o.classList.add(y.ERROR_MESSAGE_TEXT_CLASS), this.renderText(o, s);
|
12531
12544
|
var l = X.extractParticularSharedStyles(["fontSize", "fontFamily"], (h = this.messageStyles) == null ? void 0 : h["default"]);
|
12532
12545
|
X.applyCustomStylesToElements(r, !1, l), X.applyCustomStylesToElements(r, !1, (f = this.messageStyles) == null ? void 0 : f.error), i || this.appendOuterContainerElemet(a), this.textToSpeech && bt.speak(s, this.textToSpeech), (m = this._onError) == null || m.call(this, s), setTimeout(function () {
|
12533
|
-
return V.scrollToBottom(
|
12546
|
+
return V.scrollToBottom(_this62.elementRef);
|
12534
12547
|
});
|
12535
12548
|
}
|
12536
12549
|
}, {
|
@@ -12699,7 +12712,7 @@ var j = /*#__PURE__*/function () {
|
|
12699
12712
|
}]);
|
12700
12713
|
}();
|
12701
12714
|
j.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment", j.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment", j.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS = "text-input-container-left-small-adjustment", j.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS = "text-input-container-right-small-adjustment";
|
12702
|
-
var
|
12715
|
+
var vs = j;
|
12703
12716
|
var Et = /*#__PURE__*/function () {
|
12704
12717
|
function Et() {
|
12705
12718
|
_classCallCheck(this, Et);
|
@@ -12794,14 +12807,15 @@ var Ys = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "micropho
|
|
12794
12807
|
Q.MENU_ITEM_CLASS = "dropup-menu-item", Q.TEXT_CLASS = "dropup-menu-item-text", Q.ICON_CLASS = "dropup-menu-item-icon";
|
12795
12808
|
var Se = Q;
|
12796
12809
|
var O = /*#__PURE__*/function (_ct2) {
|
12810
|
+
// prettier-ignore
|
12797
12811
|
function O(e, t, i, s) {
|
12798
|
-
var
|
12812
|
+
var _this63;
|
12799
12813
|
_classCallCheck(this, O);
|
12800
12814
|
var a, l, c, d, u, h;
|
12801
12815
|
var r = ((d = (c = (l = (a = e == null ? void 0 : e.styles) == null ? void 0 : a.button) == null ? void 0 : l["default"]) == null ? void 0 : c.text) == null ? void 0 : d.content) || "Custom ".concat(t),
|
12802
12816
|
o = oa;
|
12803
|
-
|
12804
|
-
return
|
12817
|
+
_this63 = _callSuper(this, O, [O.createButtonElement(), o, e == null ? void 0 : e.position, void 0, (u = e == null ? void 0 : e.styles) == null ? void 0 : u.button, r]), _this63._state = "default", _this63.isCustom = !0, _this63._innerElements = _this63.createInnerElementsForStates(_this63.customStyles), _this63._menuStyles = s, _this63._onClick = e.onClick, _this63._dropupStyles = (h = e.styles) == null ? void 0 : h.dropup, _this63.setSetState(e), _this63.addClickListener(i), _this63.changeState(e.initialState, !0);
|
12818
|
+
return _this63;
|
12805
12819
|
}
|
12806
12820
|
_inherits(O, _ct2);
|
12807
12821
|
return _createClass(O, [{
|
@@ -12818,19 +12832,19 @@ var O = /*#__PURE__*/function (_ct2) {
|
|
12818
12832
|
}, {
|
12819
12833
|
key: "setSetState",
|
12820
12834
|
value: function setSetState(e) {
|
12821
|
-
var
|
12835
|
+
var _this64 = this;
|
12822
12836
|
e.setState = function (t) {
|
12823
|
-
t === "default" &&
|
12837
|
+
t === "default" && _this64.changeToDefault(), t === "active" && _this64.changeToActive(), t === "disabled" && _this64.changeToDisabled();
|
12824
12838
|
};
|
12825
12839
|
}
|
12826
12840
|
}, {
|
12827
12841
|
key: "addClickListener",
|
12828
12842
|
value: function addClickListener(e) {
|
12829
|
-
var
|
12843
|
+
var _this65 = this;
|
12830
12844
|
this.elementRef.addEventListener("click", function () {
|
12831
12845
|
var i;
|
12832
|
-
var t = (i =
|
12833
|
-
e == null || e(), (t === "default" || t === "active" || t === "disabled") &&
|
12846
|
+
var t = (i = _this65._onClick) == null ? void 0 : i.call(_this65, _this65._state);
|
12847
|
+
e == null || e(), (t === "default" || t === "active" || t === "disabled") && _this65.changeState(t);
|
12834
12848
|
});
|
12835
12849
|
}
|
12836
12850
|
}, {
|
@@ -12962,16 +12976,16 @@ var ri = /*#__PURE__*/function () {
|
|
12962
12976
|
}
|
12963
12977
|
}]);
|
12964
12978
|
}();
|
12965
|
-
var
|
12966
|
-
function
|
12967
|
-
var
|
12968
|
-
_classCallCheck(this,
|
12979
|
+
var Rs = /*#__PURE__*/function () {
|
12980
|
+
function Rs(e, t) {
|
12981
|
+
var _this66 = this;
|
12982
|
+
_classCallCheck(this, Rs);
|
12969
12983
|
var i;
|
12970
|
-
this._isOpen = !0, this._styles = t, this.elementRef =
|
12971
|
-
return
|
12984
|
+
this._isOpen = !0, this._styles = t, this.elementRef = Rs.createElement((i = this._styles) == null ? void 0 : i.container), this.close(), setTimeout(function () {
|
12985
|
+
return _this66.addWindowEvents(e);
|
12972
12986
|
});
|
12973
12987
|
}
|
12974
|
-
return _createClass(
|
12988
|
+
return _createClass(Rs, [{
|
12975
12989
|
key: "open",
|
12976
12990
|
value: function open() {
|
12977
12991
|
this.elementRef.style.display = "block", this._isOpen = !0;
|
@@ -13021,15 +13035,15 @@ var Cs = /*#__PURE__*/function () {
|
|
13021
13035
|
}();
|
13022
13036
|
var et = /*#__PURE__*/function (_ct3) {
|
13023
13037
|
function et(e, t) {
|
13024
|
-
var
|
13038
|
+
var _this67;
|
13025
13039
|
_classCallCheck(this, et);
|
13026
13040
|
var s;
|
13027
|
-
|
13041
|
+
_this67 = _callSuper(this, et, [et.createButtonElement(), aa, void 0, void 0, {
|
13028
13042
|
styles: (s = t == null ? void 0 : t.button) == null ? void 0 : s.styles
|
13029
13043
|
}]);
|
13030
|
-
var i =
|
13031
|
-
|
13032
|
-
return
|
13044
|
+
var i = _this67.createInnerElementsForStates(_this67.customStyles);
|
13045
|
+
_this67._menu = new Rs(e, t == null ? void 0 : t.menu), _this67.addClickEvent(), _this67.buttonContainer = et.createButtonContainer(), _this67.changeElementsByState(i.styles), _this67.buttonContainer.appendChild(_this67.elementRef), _this67.elementRef.classList.add(et.BUTTON_ICON_CLASS), _this67.buttonContainer.appendChild(_this67._menu.elementRef), _this67.reapplyStateStyle("styles"), _this67.addContainerEvents(e);
|
13046
|
+
return _this67;
|
13033
13047
|
}
|
13034
13048
|
_inherits(et, _ct3);
|
13035
13049
|
return _createClass(et, [{
|
@@ -13052,10 +13066,10 @@ var et = /*#__PURE__*/function (_ct3) {
|
|
13052
13066
|
}, {
|
13053
13067
|
key: "addContainerEvents",
|
13054
13068
|
value: function addContainerEvents(e) {
|
13055
|
-
var
|
13069
|
+
var _this68 = this;
|
13056
13070
|
e.addEventListener("click", function (t) {
|
13057
13071
|
var i = t.target.classList;
|
13058
|
-
!i.contains(et.BUTTON_ICON_CLASS) && !i.contains(st.DISABLED_CONTAINER_CLASS) &&
|
13072
|
+
!i.contains(et.BUTTON_ICON_CLASS) && !i.contains(st.DISABLED_CONTAINER_CLASS) && _this68._menu.close();
|
13059
13073
|
});
|
13060
13074
|
}
|
13061
13075
|
}], [{
|
@@ -13189,15 +13203,15 @@ var la = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
|
|
13189
13203
|
dropupText: "File"
|
13190
13204
|
}
|
13191
13205
|
};
|
13192
|
-
var
|
13193
|
-
function
|
13194
|
-
var
|
13195
|
-
_classCallCheck(this,
|
13196
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"),
|
13197
|
-
return
|
13198
|
-
}
|
13199
|
-
_inherits(
|
13200
|
-
return _createClass(
|
13206
|
+
var Vi = /*#__PURE__*/function (_ct4) {
|
13207
|
+
function Vi(e) {
|
13208
|
+
var _this69;
|
13209
|
+
_classCallCheck(this, Vi);
|
13210
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this69 = _callSuper(this, Vi, [Vi.createMicrophoneElement(), On, e == null ? void 0 : e.position, void 0, e]), _this69.isActive = !1, _this69._innerElements = _this69.createInnerElementsForStates(_this69.customStyles), _this69.changeToDefault();
|
13211
|
+
return _this69;
|
13212
|
+
}
|
13213
|
+
_inherits(Vi, _ct4);
|
13214
|
+
return _createClass(Vi, [{
|
13201
13215
|
key: "createInnerElementsForStates",
|
13202
13216
|
value: function createInnerElementsForStates(e) {
|
13203
13217
|
var t = "microphone-icon";
|
@@ -13261,7 +13275,7 @@ var mi = {},
|
|
13261
13275
|
xt = {},
|
13262
13276
|
wt = {},
|
13263
13277
|
Zs;
|
13264
|
-
function
|
13278
|
+
function Ki() {
|
13265
13279
|
if (Zs) return wt;
|
13266
13280
|
Zs = 1, Object.defineProperty(wt, "__esModule", {
|
13267
13281
|
value: !0
|
@@ -13302,7 +13316,7 @@ function Dn() {
|
|
13302
13316
|
Qs = 1, Object.defineProperty(xt, "__esModule", {
|
13303
13317
|
value: !0
|
13304
13318
|
}), xt.Translate = void 0;
|
13305
|
-
var n =
|
13319
|
+
var n = Ki();
|
13306
13320
|
var e = /*#__PURE__*/function () {
|
13307
13321
|
function e() {
|
13308
13322
|
_classCallCheck(this, e);
|
@@ -13364,7 +13378,7 @@ function pa() {
|
|
13364
13378
|
}
|
13365
13379
|
var At = {},
|
13366
13380
|
tn;
|
13367
|
-
function
|
13381
|
+
function Ms() {
|
13368
13382
|
if (tn) return At;
|
13369
13383
|
tn = 1, Object.defineProperty(At, "__esModule", {
|
13370
13384
|
value: !0
|
@@ -13398,9 +13412,9 @@ function ma() {
|
|
13398
13412
|
}, {
|
13399
13413
|
key: "keyDownWindow",
|
13400
13414
|
value: function keyDownWindow(t) {
|
13401
|
-
var
|
13415
|
+
var _this70 = this;
|
13402
13416
|
t.element && n.getElementIfFocusedOnAvailable(t.element, document.activeElement) && (n.KEY_DOWN_TIMEOUT !== null && clearTimeout(n.KEY_DOWN_TIMEOUT), n.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
13403
|
-
n.KEY_DOWN_TIMEOUT = null,
|
13417
|
+
n.KEY_DOWN_TIMEOUT = null, _this70.resetRecording(t);
|
13404
13418
|
}, 500));
|
13405
13419
|
}
|
13406
13420
|
}, {
|
@@ -13498,7 +13512,7 @@ function Bn() {
|
|
13498
13512
|
}
|
13499
13513
|
var Lt = {},
|
13500
13514
|
on;
|
13501
|
-
function
|
13515
|
+
function Wi() {
|
13502
13516
|
if (on) return Lt;
|
13503
13517
|
on = 1, Object.defineProperty(Lt, "__esModule", {
|
13504
13518
|
value: !0
|
@@ -13553,7 +13567,7 @@ function Ki() {
|
|
13553
13567
|
}
|
13554
13568
|
var It = {},
|
13555
13569
|
an;
|
13556
|
-
function
|
13570
|
+
function $i() {
|
13557
13571
|
if (an) return It;
|
13558
13572
|
an = 1, Object.defineProperty(It, "__esModule", {
|
13559
13573
|
value: !0
|
@@ -13647,10 +13661,10 @@ function Fn() {
|
|
13647
13661
|
value: !0
|
13648
13662
|
}), Mt.CommandUtils = void 0;
|
13649
13663
|
var n = Bn(),
|
13650
|
-
e =
|
13651
|
-
t =
|
13652
|
-
i =
|
13653
|
-
s =
|
13664
|
+
e = Wi(),
|
13665
|
+
t = Ms(),
|
13666
|
+
i = $i(),
|
13667
|
+
s = Ki();
|
13654
13668
|
var r = /*#__PURE__*/function () {
|
13655
13669
|
function r() {
|
13656
13670
|
_classCallCheck(this, r);
|
@@ -13754,8 +13768,8 @@ function ba() {
|
|
13754
13768
|
cn = 1, Object.defineProperty(Ot, "__esModule", {
|
13755
13769
|
value: !0
|
13756
13770
|
}), Ot.Highlight = void 0;
|
13757
|
-
var n =
|
13758
|
-
e =
|
13771
|
+
var n = Wi(),
|
13772
|
+
e = $i();
|
13759
13773
|
var t = /*#__PURE__*/function () {
|
13760
13774
|
function t() {
|
13761
13775
|
_classCallCheck(this, t);
|
@@ -13813,9 +13827,9 @@ function va() {
|
|
13813
13827
|
dn = 1, Object.defineProperty(Pt, "__esModule", {
|
13814
13828
|
value: !0
|
13815
13829
|
}), Pt.Padding = void 0;
|
13816
|
-
var n =
|
13817
|
-
e =
|
13818
|
-
t =
|
13830
|
+
var n = Wi(),
|
13831
|
+
e = $i(),
|
13832
|
+
t = Ki();
|
13819
13833
|
var i = /*#__PURE__*/function () {
|
13820
13834
|
function i() {
|
13821
13835
|
_classCallCheck(this, i);
|
@@ -13886,11 +13900,11 @@ function Un() {
|
|
13886
13900
|
t = Fn(),
|
13887
13901
|
i = Bn(),
|
13888
13902
|
s = ba(),
|
13889
|
-
r =
|
13903
|
+
r = Wi(),
|
13890
13904
|
o = va(),
|
13891
|
-
a =
|
13892
|
-
l =
|
13893
|
-
c =
|
13905
|
+
a = Ms(),
|
13906
|
+
l = $i(),
|
13907
|
+
c = Ki();
|
13894
13908
|
var d = /*#__PURE__*/function () {
|
13895
13909
|
function d() {
|
13896
13910
|
_classCallCheck(this, d);
|
@@ -14008,7 +14022,7 @@ function ya() {
|
|
14008
14022
|
value: !0
|
14009
14023
|
}), St.WebSpeech = void 0;
|
14010
14024
|
var n = pa(),
|
14011
|
-
e =
|
14025
|
+
e = Ms(),
|
14012
14026
|
t = Un();
|
14013
14027
|
var i = /*#__PURE__*/function (_t$Speech) {
|
14014
14028
|
function i() {
|
@@ -14037,22 +14051,22 @@ function ya() {
|
|
14037
14051
|
}, {
|
14038
14052
|
key: "setEvents",
|
14039
14053
|
value: function setEvents() {
|
14040
|
-
var
|
14054
|
+
var _this71 = this;
|
14041
14055
|
this._service && (this._service.onstart = function () {
|
14042
|
-
|
14056
|
+
_this71.setStateOnStart();
|
14043
14057
|
}, this._service.onerror = function (r) {
|
14044
|
-
e.Browser.IS_SAFARI() && r.message === "Another request is started" || r.error === "aborted" &&
|
14058
|
+
e.Browser.IS_SAFARI() && r.message === "Another request is started" || r.error === "aborted" && _this71.isRestarting || r.error !== "no-speech" && _this71.error(r.message || r.error);
|
14045
14059
|
}, this._service.onaudioend = function () {
|
14046
|
-
|
14060
|
+
_this71.setStateOnStop();
|
14047
14061
|
}, this._service.onend = function () {
|
14048
|
-
|
14062
|
+
_this71._stopping = !1;
|
14049
14063
|
}, this._service.onresult = function (r) {
|
14050
|
-
if (_typeof(r.results) > "u" &&
|
14051
|
-
var
|
14052
|
-
o =
|
14053
|
-
a =
|
14054
|
-
l =
|
14055
|
-
|
14064
|
+
if (_typeof(r.results) > "u" && _this71._service) _this71._service.onend = null, _this71._service.stop();else if (_this71._extractText && !_this71._stopping) {
|
14065
|
+
var _this71$_extractText = _this71._extractText(r, _this71.finalTranscript, _this71._translations),
|
14066
|
+
o = _this71$_extractText.interimTranscript,
|
14067
|
+
a = _this71$_extractText.finalTranscript,
|
14068
|
+
l = _this71$_extractText.newText;
|
14069
|
+
_this71.updateElements(o, a, l);
|
14056
14070
|
}
|
14057
14071
|
});
|
14058
14072
|
}
|
@@ -14307,10 +14321,10 @@ function Ca() {
|
|
14307
14321
|
r = Un();
|
14308
14322
|
var o = /*#__PURE__*/function (_r$Speech) {
|
14309
14323
|
function o() {
|
14310
|
-
var
|
14324
|
+
var _this72;
|
14311
14325
|
_classCallCheck(this, o);
|
14312
|
-
|
14313
|
-
return
|
14326
|
+
_this72 = _callSuper(this, o, arguments), _this72._newTextPadding = "";
|
14327
|
+
return _this72;
|
14314
14328
|
}
|
14315
14329
|
_inherits(o, _r$Speech);
|
14316
14330
|
return _createClass(o, [{
|
@@ -14437,12 +14451,12 @@ function Ca() {
|
|
14437
14451
|
}, {
|
14438
14452
|
key: "retrieveTokenInterval",
|
14439
14453
|
value: function retrieveTokenInterval(l) {
|
14440
|
-
var
|
14454
|
+
var _this73 = this;
|
14441
14455
|
this._retrieveTokenInterval = setInterval(function () {
|
14442
14456
|
l == null || l().then(function (c) {
|
14443
|
-
|
14457
|
+
_this73._service && (_this73._service.authorizationToken = (c == null ? void 0 : c.trim()) || "");
|
14444
14458
|
})["catch"](function (c) {
|
14445
|
-
|
14459
|
+
_this73.error(c);
|
14446
14460
|
});
|
14447
14461
|
}, 1e4);
|
14448
14462
|
}
|
@@ -14533,10 +14547,10 @@ var ka = /*#__PURE__*/function () {
|
|
14533
14547
|
return _createClass(ka, [{
|
14534
14548
|
key: "setSilenceTimeout",
|
14535
14549
|
value: function setSilenceTimeout(e, t) {
|
14536
|
-
var
|
14550
|
+
var _this74 = this;
|
14537
14551
|
this._silenceTimeout = setTimeout(function () {
|
14538
14552
|
var i;
|
14539
|
-
(i = e.submit) == null || i.call(e), gi.stop(),
|
14553
|
+
(i = e.submit) == null || i.call(e), gi.stop(), _this74._stop || setTimeout(t, oi.MICROPHONE_RESET_TIMEOUT_MS);
|
14540
14554
|
}, this._silenceMS);
|
14541
14555
|
}
|
14542
14556
|
}, {
|
@@ -14556,26 +14570,26 @@ var ka = /*#__PURE__*/function () {
|
|
14556
14570
|
}
|
14557
14571
|
}]);
|
14558
14572
|
}();
|
14559
|
-
var Zt = /*#__PURE__*/function (
|
14573
|
+
var Zt = /*#__PURE__*/function (_Vi) {
|
14560
14574
|
function Zt(e, t, i) {
|
14561
|
-
var
|
14575
|
+
var _this75;
|
14562
14576
|
_classCallCheck(this, Zt);
|
14563
14577
|
var s = _typeof(e.speechToText) == "object" ? e.speechToText : {};
|
14564
|
-
|
14565
|
-
var
|
14566
|
-
r =
|
14567
|
-
o =
|
14568
|
-
if (
|
14578
|
+
_this75 = _callSuper(this, Zt, [s == null ? void 0 : s.button]);
|
14579
|
+
var _this75$processConfig = _this75.processConfiguration(t, e.speechToText),
|
14580
|
+
r = _this75$processConfig.serviceName,
|
14581
|
+
o = _this75$processConfig.processedConfig;
|
14582
|
+
if (_this75._addErrorMessage = i, r === "webspeech" && !gi.isWebSpeechSupported()) _this75.changeToUnsupported();else {
|
14569
14583
|
var a = !e.textInput || !e.textInput.disabled;
|
14570
|
-
|
14584
|
+
_this75.elementRef.onclick = _this75.buttonClick.bind(_this75, t, a, r, o);
|
14571
14585
|
}
|
14572
14586
|
setTimeout(function () {
|
14573
|
-
|
14587
|
+
_this75._validationHandler = e._validationHandler;
|
14574
14588
|
});
|
14575
|
-
return
|
14589
|
+
return _this75;
|
14576
14590
|
}
|
14577
14591
|
// prettier-ignore
|
14578
|
-
_inherits(Zt,
|
14592
|
+
_inherits(Zt, _Vi);
|
14579
14593
|
return _createClass(Zt, [{
|
14580
14594
|
key: "processConfiguration",
|
14581
14595
|
value: function processConfiguration(e, t) {
|
@@ -14608,26 +14622,26 @@ var Zt = /*#__PURE__*/function (_Gi) {
|
|
14608
14622
|
}, {
|
14609
14623
|
key: "buttonClick",
|
14610
14624
|
value: function buttonClick(e, t, i, s) {
|
14611
|
-
var
|
14625
|
+
var _this76 = this;
|
14612
14626
|
var r = s == null ? void 0 : s.events;
|
14613
14627
|
e.removePlaceholderStyle(), gi.toggle(i, _objectSpread({
|
14614
14628
|
insertInCursorLocation: !1,
|
14615
14629
|
element: t ? e.inputElementRef : void 0,
|
14616
14630
|
onError: function onError() {
|
14617
14631
|
var o;
|
14618
|
-
|
14632
|
+
_this76.onError(), (o = _this76._silenceSubmit) == null || o.clearSilenceTimeout();
|
14619
14633
|
},
|
14620
14634
|
onStart: function onStart() {
|
14621
14635
|
var o;
|
14622
|
-
|
14636
|
+
_this76.changeToActive(), (o = r == null ? void 0 : r.onStart) == null || o.call(r);
|
14623
14637
|
},
|
14624
14638
|
onStop: function onStop() {
|
14625
14639
|
var o, a, l;
|
14626
|
-
(o =
|
14640
|
+
(o = _this76._validationHandler) == null || o.call(_this76), (a = _this76._silenceSubmit) == null || a.clearSilenceTimeout(), _this76.changeToDefault(), (l = r == null ? void 0 : r.onStop) == null || l.call(r);
|
14627
14641
|
},
|
14628
14642
|
onPauseTrigger: function onPauseTrigger(o) {
|
14629
14643
|
var a, l;
|
14630
|
-
(a =
|
14644
|
+
(a = _this76._silenceSubmit) == null || a.onPause(o, e, _this76.elementRef.onclick), (l = r == null ? void 0 : r.onPauseTrigger) == null || l.call(r, o);
|
14631
14645
|
},
|
14632
14646
|
onPreResult: function onPreResult(o, a) {
|
14633
14647
|
var l;
|
@@ -14635,11 +14649,11 @@ var Zt = /*#__PURE__*/function (_Gi) {
|
|
14635
14649
|
},
|
14636
14650
|
onResult: function onResult(o, a) {
|
14637
14651
|
var l, c, d;
|
14638
|
-
a && ((l =
|
14652
|
+
a && ((l = _this76._validationHandler) == null || l.call(_this76)), (c = _this76._silenceSubmit) == null || c.resetSilenceTimeout(e, _this76.elementRef.onclick), (d = r == null ? void 0 : r.onResult) == null || d.call(r, o, a);
|
14639
14653
|
},
|
14640
14654
|
onCommandModeTrigger: function onCommandModeTrigger(o) {
|
14641
14655
|
var a;
|
14642
|
-
|
14656
|
+
_this76.onCommandModeTrigger(o), (a = r == null ? void 0 : r.onCommandModeTrigger) == null || a.call(r, o);
|
14643
14657
|
}
|
14644
14658
|
}, s));
|
14645
14659
|
}
|
@@ -14667,16 +14681,16 @@ var Zt = /*#__PURE__*/function (_Gi) {
|
|
14667
14681
|
}, Zt.MICROPHONE_RESET_TIMEOUT_MS);
|
14668
14682
|
}
|
14669
14683
|
}]);
|
14670
|
-
}(
|
14684
|
+
}(Vi);
|
14671
14685
|
Zt.MICROPHONE_RESET_TIMEOUT_MS = 300;
|
14672
14686
|
var oi = Zt;
|
14673
14687
|
var Ne = /*#__PURE__*/function () {
|
14674
14688
|
// prettier-ignore
|
14675
14689
|
function Ne(e, t, i, s, r) {
|
14676
|
-
var
|
14690
|
+
var _this77 = this;
|
14677
14691
|
_classCallCheck(this, Ne);
|
14678
14692
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", this._hiddenAttachments = /* @__PURE__ */new Set(), i.maxNumberOfFiles && (this._fileCountLimit = i.maxNumberOfFiles), this._toggleContainerDisplay = s, this._fileAttachmentsContainerRef = r, i.acceptedFormats && (this._acceptedFormat = i.acceptedFormats), setTimeout(function () {
|
14679
|
-
|
14693
|
+
_this77._validationHandler = e._validationHandler, _this77._onInput = t.onInput;
|
14680
14694
|
});
|
14681
14695
|
}
|
14682
14696
|
return _createClass(Ne, [{
|
@@ -14750,12 +14764,12 @@ var Ne = /*#__PURE__*/function () {
|
|
14750
14764
|
}, {
|
14751
14765
|
key: "hideAttachments",
|
14752
14766
|
value: function hideAttachments() {
|
14753
|
-
var
|
14767
|
+
var _this78 = this;
|
14754
14768
|
this._hiddenAttachments.clear(), this._attachments.forEach(function (e) {
|
14755
14769
|
setTimeout(function () {
|
14756
14770
|
var t;
|
14757
14771
|
return (t = e.removeButton) == null ? void 0 : t.click();
|
14758
|
-
}),
|
14772
|
+
}), _this78._hiddenAttachments.add(e);
|
14759
14773
|
});
|
14760
14774
|
}
|
14761
14775
|
}, {
|
@@ -14771,10 +14785,10 @@ var Ne = /*#__PURE__*/function () {
|
|
14771
14785
|
}, {
|
14772
14786
|
key: "readdAttachments",
|
14773
14787
|
value: function readdAttachments() {
|
14774
|
-
var
|
14788
|
+
var _this79 = this;
|
14775
14789
|
var e;
|
14776
14790
|
Array.from(this._hiddenAttachments).forEach(function (t) {
|
14777
|
-
|
14791
|
+
_this79._fileAttachmentsContainerRef.appendChild(t.attachmentContainerElement), _this79._attachments.push(t);
|
14778
14792
|
}), (e = this._onInput) == null || e.call(this, !1), this._hiddenAttachments.clear();
|
14779
14793
|
}
|
14780
14794
|
}], [{
|
@@ -14835,12 +14849,12 @@ var Oe = /*#__PURE__*/function (_Ne) {
|
|
14835
14849
|
return _createClass(Oe, [{
|
14836
14850
|
key: "createTimer",
|
14837
14851
|
value: function createTimer(e, t) {
|
14838
|
-
var
|
14852
|
+
var _this80 = this;
|
14839
14853
|
var i = 0;
|
14840
14854
|
var s = t !== void 0 && t < Oe.TIMER_LIMIT_S ? t : Oe.TIMER_LIMIT_S;
|
14841
14855
|
return setInterval(function () {
|
14842
14856
|
var a;
|
14843
|
-
i += 1, i === s && ((a =
|
14857
|
+
i += 1, i === s && ((a = _this80.stopPlaceholderCallback) == null || a.call(_this80), _this80.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
14844
14858
|
var r = Math.floor(i / 60),
|
14845
14859
|
o = (i % 60).toString().padStart(2, "0");
|
14846
14860
|
e.textContent = "".concat(r, ":").concat(o);
|
@@ -14854,13 +14868,13 @@ var Oe = /*#__PURE__*/function (_Ne) {
|
|
14854
14868
|
i.classList.add("audio-placeholder-text-3-digits");
|
14855
14869
|
var s = document.createElement("div");
|
14856
14870
|
s.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), s.appendChild(i);
|
14857
|
-
var r = Ue.createSVGElement(
|
14871
|
+
var r = Ue.createSVGElement(cs);
|
14858
14872
|
return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(s), this.addPlaceholderAudioAttachmentEvents(t, r, s), t;
|
14859
14873
|
}
|
14860
14874
|
}, {
|
14861
14875
|
key: "addPlaceholderAudioAttachmentEvents",
|
14862
14876
|
value: function addPlaceholderAudioAttachmentEvents(e, t, i) {
|
14863
|
-
var
|
14877
|
+
var _this81 = this;
|
14864
14878
|
var s = function s() {
|
14865
14879
|
return e.replaceChildren(t);
|
14866
14880
|
};
|
@@ -14871,7 +14885,7 @@ var Oe = /*#__PURE__*/function (_Ne) {
|
|
14871
14885
|
e.addEventListener("mouseleave", r);
|
14872
14886
|
var o = function o() {
|
14873
14887
|
var a;
|
14874
|
-
return (a =
|
14888
|
+
return (a = _this81.stopPlaceholderCallback) == null ? void 0 : a.call(_this81);
|
14875
14889
|
};
|
14876
14890
|
e.addEventListener("click", o);
|
14877
14891
|
}
|
@@ -14912,7 +14926,7 @@ var Oe = /*#__PURE__*/function (_Ne) {
|
|
14912
14926
|
s.src = t;
|
14913
14927
|
var r = Ue.createSVGElement(Pn);
|
14914
14928
|
r.classList.add("attachment-icon", "play-icon");
|
14915
|
-
var o = Ue.createSVGElement(
|
14929
|
+
var o = Ue.createSVGElement(cs);
|
14916
14930
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), s.onplay = function () {
|
14917
14931
|
i.replaceChildren(o);
|
14918
14932
|
}, s.onpause = function () {
|
@@ -15077,20 +15091,20 @@ var be = /*#__PURE__*/function () {
|
|
15077
15091
|
}, {
|
15078
15092
|
key: "addButtons",
|
15079
15093
|
value: function addButtons() {
|
15080
|
-
var
|
15094
|
+
var _this82 = this;
|
15081
15095
|
for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
15082
15096
|
e[_key2] = arguments[_key2];
|
15083
15097
|
}
|
15084
15098
|
e.forEach(function (t) {
|
15085
|
-
N.addAttributes(t),
|
15099
|
+
N.addAttributes(t), _this82._buttonPanel.appendChild(t);
|
15086
15100
|
});
|
15087
15101
|
}
|
15088
15102
|
}, {
|
15089
15103
|
key: "close",
|
15090
15104
|
value: function close() {
|
15091
|
-
var
|
15105
|
+
var _this83 = this;
|
15092
15106
|
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 () {
|
15093
|
-
|
15107
|
+
_this83._elementRef.style.display = "none", _this83._backgroundPanelRef.style.display = "none";
|
15094
15108
|
}, be.MODAL_CLOSE_TIMEOUT_MS);
|
15095
15109
|
}
|
15096
15110
|
}, {
|
@@ -15106,10 +15120,10 @@ var be = /*#__PURE__*/function () {
|
|
15106
15120
|
}, {
|
15107
15121
|
key: "addCloseButton",
|
15108
15122
|
value: function addCloseButton(e, t, i) {
|
15109
|
-
var
|
15123
|
+
var _this84 = this;
|
15110
15124
|
var s = t ? be.createSVGButton(e) : be.createTextButton(e);
|
15111
15125
|
return this.addButtons(s), s.onclick = function () {
|
15112
|
-
|
15126
|
+
_this84.close(), setTimeout(function () {
|
15113
15127
|
i == null || i();
|
15114
15128
|
}, 140);
|
15115
15129
|
}, s;
|
@@ -15180,15 +15194,15 @@ var tt = be;
|
|
15180
15194
|
var Di = /*#__PURE__*/function (_ct5) {
|
15181
15195
|
// prettier-ignore
|
15182
15196
|
function Di(e, t, i, s, r, o) {
|
15183
|
-
var
|
15197
|
+
var _this85;
|
15184
15198
|
_classCallCheck(this, Di);
|
15185
15199
|
var d, u, h, f, m, p, g, b, M;
|
15186
15200
|
var a = (d = i == null ? void 0 : i.button) == null ? void 0 : d.position,
|
15187
15201
|
l = ((f = (h = (u = i == null ? void 0 : i.button) == null ? void 0 : u.styles) == null ? void 0 : h.text) == null ? void 0 : f.content) || o;
|
15188
|
-
|
15189
|
-
var c =
|
15190
|
-
|
15191
|
-
return
|
15202
|
+
_this85 = _callSuper(this, Di, [Di.createButtonElement(), r, a, void 0, i.button, l]);
|
15203
|
+
var c = _this85.createInnerElementsForStates(s, _this85.customStyles);
|
15204
|
+
_this85._inputElement = Di.createInputElement((m = i == null ? void 0 : i.files) == null ? void 0 : m.acceptedFormats), _this85.addClickEvent(e, i), _this85.changeElementsByState(c.styles), _this85.reapplyStateStyle("styles"), _this85._fileAttachmentsType = t, _this85._openModalOnce = ((g = (p = i.files) == null ? void 0 : p.infoModal) == null ? void 0 : g.openModalOnce) === !1 || (M = (b = i.files) == null ? void 0 : b.infoModal) == null ? void 0 : M.openModalOnce;
|
15205
|
+
return _this85;
|
15192
15206
|
}
|
15193
15207
|
_inherits(Di, _ct5);
|
15194
15208
|
return _createClass(Di, [{
|
@@ -15404,15 +15418,15 @@ var jn = /*#__PURE__*/function () {
|
|
15404
15418
|
}
|
15405
15419
|
}]);
|
15406
15420
|
}();
|
15407
|
-
var Ia = /*#__PURE__*/function (
|
15421
|
+
var Ia = /*#__PURE__*/function (_Vi2) {
|
15408
15422
|
function Ia(e, t) {
|
15409
|
-
var
|
15423
|
+
var _this86;
|
15410
15424
|
_classCallCheck(this, Ia);
|
15411
15425
|
var i, s;
|
15412
|
-
|
15413
|
-
return
|
15426
|
+
_this86 = _callSuper(this, Ia, [t.button]), _this86._waitingForBrowserApproval = !1, _this86._audioType = e, _this86._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this86._maxDurationSeconds = (s = t.files) == null ? void 0 : s.maxDurationSeconds, _this86.elementRef.onclick = _this86.buttonClick.bind(_assertThisInitialized(_this86));
|
15427
|
+
return _this86;
|
15414
15428
|
}
|
15415
|
-
_inherits(Ia,
|
15429
|
+
_inherits(Ia, _Vi2);
|
15416
15430
|
return _createClass(Ia, [{
|
15417
15431
|
key: "buttonClick",
|
15418
15432
|
value: function buttonClick() {
|
@@ -15421,10 +15435,10 @@ var Ia = /*#__PURE__*/function (_Gi2) {
|
|
15421
15435
|
}, {
|
15422
15436
|
key: "stop",
|
15423
15437
|
value: function stop() {
|
15424
|
-
var
|
15438
|
+
var _this87 = this;
|
15425
15439
|
return new Promise(function (e) {
|
15426
15440
|
var t, i;
|
15427
|
-
|
15441
|
+
_this87.changeToDefault(), (t = _this87._mediaRecorder) == null || t.stop(), (i = _this87._mediaStream) == null || i.getTracks().forEach(function (s) {
|
15428
15442
|
return s.stop();
|
15429
15443
|
}), setTimeout(function () {
|
15430
15444
|
e();
|
@@ -15434,23 +15448,23 @@ var Ia = /*#__PURE__*/function (_Gi2) {
|
|
15434
15448
|
}, {
|
15435
15449
|
key: "record",
|
15436
15450
|
value: function record() {
|
15437
|
-
var
|
15451
|
+
var _this88 = this;
|
15438
15452
|
navigator.mediaDevices.getUserMedia({
|
15439
15453
|
audio: !0
|
15440
15454
|
}).then(function (e) {
|
15441
|
-
|
15442
|
-
|
15443
|
-
}),
|
15455
|
+
_this88.changeToActive(), _this88._mediaRecorder = new MediaRecorder(e), _this88._audioType.addPlaceholderAttachment(_this88.stop.bind(_this88), _this88._maxDurationSeconds), _this88._mediaStream = e, _this88._mediaRecorder.addEventListener("dataavailable", function (t) {
|
15456
|
+
_this88.createFile(t);
|
15457
|
+
}), _this88._mediaRecorder.start();
|
15444
15458
|
})["catch"](function (e) {
|
15445
|
-
console.error(e),
|
15459
|
+
console.error(e), _this88.stop();
|
15446
15460
|
})["finally"](function () {
|
15447
|
-
|
15461
|
+
_this88._waitingForBrowserApproval = !1;
|
15448
15462
|
});
|
15449
15463
|
}
|
15450
15464
|
}, {
|
15451
15465
|
key: "createFile",
|
15452
15466
|
value: function createFile(e) {
|
15453
|
-
var
|
15467
|
+
var _this89 = this;
|
15454
15468
|
var t = new Blob([e.data], {
|
15455
15469
|
type: "audio/".concat(this._extension)
|
15456
15470
|
}),
|
@@ -15460,11 +15474,11 @@ var Ia = /*#__PURE__*/function (_Gi2) {
|
|
15460
15474
|
}),
|
15461
15475
|
r = new FileReader();
|
15462
15476
|
r.readAsDataURL(s), r.onload = function (o) {
|
15463
|
-
|
15477
|
+
_this89._audioType.completePlaceholderAttachment(s, o.target.result);
|
15464
15478
|
};
|
15465
15479
|
}
|
15466
15480
|
}]);
|
15467
|
-
}(
|
15481
|
+
}(Vi);
|
15468
15482
|
var Oa = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"14\"></line>\n <polygon points=\"22 2 15 22 11 14 2 10 22 2\"></polygon>\n</svg>\n";
|
15469
15483
|
var it = /*#__PURE__*/function () {
|
15470
15484
|
function it() {
|
@@ -15499,20 +15513,20 @@ var it = /*#__PURE__*/function () {
|
|
15499
15513
|
var P = /*#__PURE__*/function (_ct6) {
|
15500
15514
|
// prettier-ignore
|
15501
15515
|
function P(e, t, i, s, r, o) {
|
15502
|
-
var
|
15516
|
+
var _this90;
|
15503
15517
|
_classCallCheck(this, P);
|
15504
15518
|
var a = it.process(e.submitButtonStyles),
|
15505
15519
|
l = Oa;
|
15506
|
-
|
15520
|
+
_this90 = _callSuper(this, P, [P.createButtonContainerElement(), l, a == null ? void 0 : a.position, void 0, a]), _this90._isSVGLoadingIconOverriden = !1, _this90.status = {
|
15507
15521
|
requestInProgress: !1,
|
15508
15522
|
loadingActive: !1
|
15509
|
-
},
|
15523
|
+
}, _this90._messages = i, _this90._textInput = t, _this90._fileAttachments = r, _this90._innerElements = _this90.createInnerElementsForStates(), _this90._abortStream = new AbortController(), _this90._stopClicked = {
|
15510
15524
|
listener: function listener() {}
|
15511
|
-
},
|
15525
|
+
}, _this90._serviceIO = s, _this90._alwaysEnabled = !!(a != null && a.alwaysEnabled), e.disableSubmitButton = _this90.disableSubmitButton.bind(_assertThisInitialized(_this90), s), _this90.attemptOverwriteLoadingStyle(e), o.microphone && _this90.setUpSpeechToText(o.microphone.button, e.speechToText), setTimeout(function () {
|
15512
15526
|
var c;
|
15513
|
-
|
15527
|
+
_this90._validationHandler = e._validationHandler, _this90.assignHandlers(_this90._validationHandler), (c = _this90._validationHandler) == null || c.call(_assertThisInitialized(_this90));
|
15514
15528
|
});
|
15515
|
-
return
|
15529
|
+
return _this90;
|
15516
15530
|
}
|
15517
15531
|
_inherits(P, _ct6);
|
15518
15532
|
return _createClass(P, [{
|
@@ -15532,7 +15546,7 @@ var P = /*#__PURE__*/function (_ct6) {
|
|
15532
15546
|
}, {
|
15533
15547
|
key: "createCustomElements",
|
15534
15548
|
value: function createCustomElements() {
|
15535
|
-
var
|
15549
|
+
var _this91 = this;
|
15536
15550
|
var e = Te.createCustomElements("submit", this.svg, this.customStyles),
|
15537
15551
|
t = {
|
15538
15552
|
loading: void 0,
|
@@ -15540,7 +15554,7 @@ var P = /*#__PURE__*/function (_ct6) {
|
|
15540
15554
|
};
|
15541
15555
|
return Object.keys(t).forEach(function (i) {
|
15542
15556
|
var s = i,
|
15543
|
-
r = Te.createCustomElements(s,
|
15557
|
+
r = Te.createCustomElements(s, _this91.svg, _this91.customStyles);
|
15544
15558
|
r && (t[s] = r);
|
15545
15559
|
}), t.submit = e || this.buildDefaultIconElement("submit-icon"), t;
|
15546
15560
|
}
|
@@ -15620,7 +15634,7 @@ var P = /*#__PURE__*/function (_ct6) {
|
|
15620
15634
|
key: "programmaticSubmit",
|
15621
15635
|
value: function () {
|
15622
15636
|
var _programmaticSubmit = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee133(e) {
|
15623
|
-
var
|
15637
|
+
var _this92 = this;
|
15624
15638
|
var t;
|
15625
15639
|
return _regeneratorRuntime().wrap(function _callee133$(_context133) {
|
15626
15640
|
while (1) switch (_context133.prev = _context133.next) {
|
@@ -15635,7 +15649,7 @@ var P = /*#__PURE__*/function (_ct6) {
|
|
15635
15649
|
type: Ne.getTypeFromBlob(i)
|
15636
15650
|
};
|
15637
15651
|
})), e.custom && (t.custom = e.custom), setTimeout(function () {
|
15638
|
-
return
|
15652
|
+
return _this92.attemptSubmit(t, !0);
|
15639
15653
|
});
|
15640
15654
|
case 3:
|
15641
15655
|
case "end":
|
@@ -15767,10 +15781,10 @@ var P = /*#__PURE__*/function (_ct6) {
|
|
15767
15781
|
}, {
|
15768
15782
|
key: "changeToSubmitIcon",
|
15769
15783
|
value: function changeToSubmitIcon() {
|
15770
|
-
var
|
15784
|
+
var _this93 = this;
|
15771
15785
|
this.elementRef.classList.contains(P.SUBMIT_CLASS) || (this.elementRef.classList.remove(P.LOADING_CLASS, P.DISABLED_CLASS), N.removeAriaAttributes(this.elementRef), this.elementRef.classList.add(P.SUBMIT_CLASS), this.changeElementsByState(this._innerElements.submit), it.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
|
15772
15786
|
var e;
|
15773
|
-
|
15787
|
+
_this93.submitFromInput(), (e = _this93._microphoneButton) != null && e.isActive && oi.toggleSpeechAfterSubmit(_this93._microphoneButton.elementRef, !!_this93._stopSTTAfterSubmit);
|
15774
15788
|
});
|
15775
15789
|
}
|
15776
15790
|
// called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
|
@@ -15807,25 +15821,25 @@ var P = /*#__PURE__*/function (_ct6) {
|
|
15807
15821
|
}]);
|
15808
15822
|
}(ct);
|
15809
15823
|
P.SUBMIT_CLASS = "submit-button", P.LOADING_CLASS = "loading-button", P.DISABLED_CLASS = "disabled-button";
|
15810
|
-
var
|
15824
|
+
var ys = P;
|
15811
15825
|
var Pa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.1 14.313V5.396L24.158 8.34c-2.33-2.325-5.033-3.503-8.11-3.503C9.902 4.837 4.901 9.847 4.899 16c.001 6.152 5.003 11.158 11.15 11.16 4.276 0 9.369-2.227 10.836-8.478l.028-.122h-3.23l-.022.068c-1.078 3.242-4.138 5.421-7.613 5.421a8 8 0 0 1-5.691-2.359A7.993 7.993 0 0 1 8 16.001c0-4.438 3.611-8.049 8.05-8.049 2.069 0 3.638.58 5.924 2.573l-3.792 3.789H27.1z\"/>\n</svg>\n",
|
15812
15826
|
Na = "<?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=\"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",
|
15813
15827
|
Da = "<?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>",
|
15814
15828
|
Ba = "<?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>";
|
15815
|
-
var
|
15829
|
+
var ks = /*#__PURE__*/function (_tt) {
|
15816
15830
|
// prettier-ignore
|
15817
|
-
function
|
15818
|
-
var
|
15819
|
-
_classCallCheck(this,
|
15820
|
-
|
15821
|
-
var
|
15822
|
-
r =
|
15823
|
-
o =
|
15824
|
-
|
15825
|
-
return
|
15826
|
-
}
|
15827
|
-
_inherits(
|
15828
|
-
return _createClass(
|
15831
|
+
function ks(e, t, i, s) {
|
15832
|
+
var _this94;
|
15833
|
+
_classCallCheck(this, ks);
|
15834
|
+
_this94 = _callSuper(this, ks, [e, ["modal-content", "modal-camera-content"], i]), _this94._stopped = !1, _this94._format = "image/png", _this94._canvas = document.createElement("canvas"), _this94._canvas.classList.add("camera-modal-canvas");
|
15835
|
+
var _this94$addButtonsAnd = _this94.addButtonsAndTheirEvents(t),
|
15836
|
+
r = _this94$addButtonsAnd.captureButton,
|
15837
|
+
o = _this94$addButtonsAnd.submitButton;
|
15838
|
+
_this94._captureButton = r, _this94._submitButton = o, _this94._captureIcon = _this94._captureButton.children[0], _this94._refreshIcon = Ue.createSVGElement(Pa), _this94._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this94._format = "image/jpeg"), s != null && s.dimensions && (_this94._dimensions = s.dimensions), _this94._contentRef.appendChild(_this94._canvas), _this94.extensionCloseCallback = _this94.stop;
|
15839
|
+
return _this94;
|
15840
|
+
}
|
15841
|
+
_inherits(ks, _tt);
|
15842
|
+
return _createClass(ks, [{
|
15829
15843
|
key: "addButtonsAndTheirEvents",
|
15830
15844
|
value: function addButtonsAndTheirEvents(e) {
|
15831
15845
|
var t = tt.createSVGButton(Na);
|
@@ -15842,38 +15856,38 @@ var Ms = /*#__PURE__*/function (_tt) {
|
|
15842
15856
|
}, {
|
15843
15857
|
key: "addButtonEvents",
|
15844
15858
|
value: function addButtonEvents(e, t, i, s) {
|
15845
|
-
var
|
15859
|
+
var _this95 = this;
|
15846
15860
|
e.onclick = function () {
|
15847
|
-
|
15861
|
+
_this95.capture();
|
15848
15862
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
15849
|
-
var r =
|
15850
|
-
r && hi.addFilesToType([r], [s]),
|
15863
|
+
var r = _this95.getFile();
|
15864
|
+
r && hi.addFilesToType([r], [s]), _this95.stop(), _this95.close();
|
15851
15865
|
};
|
15852
15866
|
}
|
15853
15867
|
}, {
|
15854
15868
|
key: "stop",
|
15855
15869
|
value: function stop() {
|
15856
|
-
var
|
15870
|
+
var _this96 = this;
|
15857
15871
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
15858
15872
|
return e.stop();
|
15859
15873
|
}), this._stopped = !0, setTimeout(function () {
|
15860
|
-
|
15861
|
-
var e =
|
15862
|
-
e == null || e.clearRect(0, 0,
|
15874
|
+
_this96._captureButton.replaceChildren(_this96._captureIcon), _this96._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
15875
|
+
var e = _this96._canvas.getContext("2d");
|
15876
|
+
e == null || e.clearRect(0, 0, _this96._canvas.width, _this96._canvas.height);
|
15863
15877
|
}, tt.MODAL_CLOSE_TIMEOUT_MS);
|
15864
15878
|
}
|
15865
15879
|
}, {
|
15866
15880
|
key: "start",
|
15867
15881
|
value: function start() {
|
15868
|
-
var
|
15882
|
+
var _this97 = this;
|
15869
15883
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
15870
15884
|
video: this._dimensions || !0
|
15871
15885
|
}).then(function (e) {
|
15872
|
-
if (
|
15886
|
+
if (_this97._mediaStream = e, !_this97.isOpen()) return _this97.stop();
|
15873
15887
|
var t = document.createElement("video");
|
15874
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
15888
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this97.updateCanvas.bind(_this97, t, _this97._canvas));
|
15875
15889
|
})["catch"](function (e) {
|
15876
|
-
console.error(e),
|
15890
|
+
console.error(e), _this97.stop(), _this97.close();
|
15877
15891
|
});
|
15878
15892
|
}
|
15879
15893
|
}, {
|
@@ -15920,26 +15934,28 @@ var Ms = /*#__PURE__*/function (_tt) {
|
|
15920
15934
|
}], [{
|
15921
15935
|
key: "createCameraModalFunc",
|
15922
15936
|
value: function createCameraModalFunc(e, t, i, s) {
|
15923
|
-
var r = new
|
15937
|
+
var r = new ks(e, t, i, s);
|
15924
15938
|
return r.openCameraModal.bind(r, r);
|
15925
15939
|
}
|
15926
15940
|
}]);
|
15927
15941
|
}(tt);
|
15928
15942
|
var Fa = "<?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>";
|
15929
|
-
var
|
15930
|
-
function
|
15931
|
-
var
|
15932
|
-
_classCallCheck(this,
|
15933
|
-
var
|
15934
|
-
var s = (
|
15935
|
-
r = ((
|
15936
|
-
|
15937
|
-
|
15938
|
-
|
15939
|
-
|
15940
|
-
|
15941
|
-
|
15942
|
-
|
15943
|
+
var Bi = /*#__PURE__*/function (_ct7) {
|
15944
|
+
function Bi(e, t, i) {
|
15945
|
+
var _this98;
|
15946
|
+
_classCallCheck(this, Bi);
|
15947
|
+
var c, d, u, h, f, m;
|
15948
|
+
var s = (c = i == null ? void 0 : i.button) == null ? void 0 : c.position,
|
15949
|
+
r = ((h = (u = (d = i == null ? void 0 : i.button) == null ? void 0 : d.styles) == null ? void 0 : u.text) == null ? void 0 : h.content) || "Photo",
|
15950
|
+
o = Bi.createTooltip((f = i == null ? void 0 : i.button) == null ? void 0 : f.tooltip),
|
15951
|
+
a = ((m = i == null ? void 0 : i.button) == null ? void 0 : m.styles) || {};
|
15952
|
+
_this98 = _callSuper(this, Bi, [Bi.createButtonElement(), Fa, s, o, a, r]);
|
15953
|
+
var l = _this98.createInnerElementsForStates(_this98.customStyles);
|
15954
|
+
i && _this98.addClickEvent(e, t, i.modalContainerStyle, i.files), _this98.changeElementsByState(l.styles), _this98.reapplyStateStyle("styles");
|
15955
|
+
return _this98;
|
15956
|
+
}
|
15957
|
+
_inherits(Bi, _ct7);
|
15958
|
+
return _createClass(Bi, [{
|
15943
15959
|
key: "createInnerElementsForStates",
|
15944
15960
|
value: function createInnerElementsForStates(e) {
|
15945
15961
|
return {
|
@@ -15951,10 +15967,22 @@ var ks = /*#__PURE__*/function (_ct7) {
|
|
15951
15967
|
value:
|
15952
15968
|
// prettier-ignore
|
15953
15969
|
function addClickEvent(e, t, i, s) {
|
15954
|
-
var r =
|
15970
|
+
var r = ks.createCameraModalFunc(e, t, i, s);
|
15955
15971
|
this.elementRef.onclick = r;
|
15956
15972
|
}
|
15957
15973
|
}], [{
|
15974
|
+
key: "createTooltip",
|
15975
|
+
value: function createTooltip(e) {
|
15976
|
+
if (e) return typeof e == "boolean" ? {
|
15977
|
+
text: "Camera",
|
15978
|
+
position: "bottom"
|
15979
|
+
} : {
|
15980
|
+
text: e.text || "Camera",
|
15981
|
+
position: e.position || "bottom",
|
15982
|
+
timeout: e.timeout || 0
|
15983
|
+
};
|
15984
|
+
}
|
15985
|
+
}, {
|
15958
15986
|
key: "createButtonElement",
|
15959
15987
|
value: function createButtonElement() {
|
15960
15988
|
var e = document.createElement("div");
|
@@ -15972,7 +16000,7 @@ var ht = /*#__PURE__*/function () {
|
|
15972
16000
|
e.speechToText && !r.microphone && (r.microphone = {
|
15973
16001
|
button: new oi(e, a, t.addNewErrorMessage.bind(t))
|
15974
16002
|
});
|
15975
|
-
var l = new
|
16003
|
+
var l = new ys(e, a, t, i, o, r);
|
15976
16004
|
a.submit = l.submitFromInput.bind(l), $e.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
|
15977
16005
|
button: l
|
15978
16006
|
}, e.customButtons && st.add(e, r), ht.addElements(this.elementRef, a, r, s, o, e.dropupStyles), ht.assignOnInput(e, i, o, a);
|
@@ -15987,7 +16015,7 @@ var ht = /*#__PURE__*/function () {
|
|
15987
16015
|
if (ht.createUploadButtons(e, t, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
|
15988
16016
|
var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t, t.camera.files, "images");
|
15989
16017
|
s.camera = {
|
15990
|
-
button: new
|
16018
|
+
button: new Bi(i, d, t.camera)
|
15991
16019
|
};
|
15992
16020
|
}
|
15993
16021
|
if ((l = t.recordAudio) != null && l.files) {
|
@@ -16032,7 +16060,7 @@ var ht = /*#__PURE__*/function () {
|
|
16032
16060
|
V.addElements(e, t.elementRef);
|
16033
16061
|
var a = Et.create(),
|
16034
16062
|
l = $.addButtons(a, i, s, o);
|
16035
|
-
|
16063
|
+
vs.set(t.inputElementRef, a, r.elementRef, l), Et.add(e, a);
|
16036
16064
|
}
|
16037
16065
|
}, {
|
16038
16066
|
key: "assignOnInput",
|
@@ -16073,32 +16101,32 @@ var Ls = /*#__PURE__*/function () {
|
|
16073
16101
|
}
|
16074
16102
|
}]);
|
16075
16103
|
}();
|
16076
|
-
var Ua = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#loading-validate-key-property{display:inline-block;width:50px;height:50px}#loading-validate-key-property:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:loading-spinner 1.4s linear infinite}#deep-chat-openai-realtime-container{height:100%;width:100%}#deep-chat-openai-realtime-avatar-container{height:60%;width:100%;display:flex;justify-content:center;align-items:center}#deep-chat-openai-realtime-avatar{border-radius:50%;height:110px;border:1px solid rgb(215,215,215);padding:8px;-webkit-user-select:none;user-select:none;margin-top:20px}#deep-chat-openai-realtime-buttons-container{height:40%;display:flex;position:relative}.deep-chat-openai-realtime-button-container{height:100%;width:50%;display:flex;justify-content:center;align-items:center}.deep-chat-openai-realtime-button{width:70px;height:70px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.deep-chat-openai-realtime-button-default{background-color:#e3e3e3}.deep-chat-openai-realtime-button-default:hover{background-color:#d4d4d4}.deep-chat-openai-realtime-button-default:active{background-color:#c5c5c5}.deep-chat-openai-realtime-button-loading{opacity:.7;pointer-events:none}.deep-chat-openai-realtime-microphone-active{background-color:#ffe7e7}.deep-chat-openai-realtime-microphone-active:hover{background-color:#ffdede}.deep-chat-openai-realtime-microphone-active:active{background-color:#ffd2d2}.deep-chat-openai-realtime-microphone>*{height:30px;width:30px}.deep-chat-openai-realtime-microphone-active>*{filter:brightness(0) saturate(100%) invert(35%) sepia(60%) saturate(1360%) hue-rotate(325deg) brightness(95%) contrast(92%)}.deep-chat-openai-realtime-toggle>*{height:32px;width:32px;padding-left:3px;filter:brightness(0) saturate(100%) invert(22%) sepia(0%) saturate(4537%) hue-rotate(208deg) brightness(105%) contrast(91%)}.deep-chat-openai-realtime-button-unavailable{opacity:.45;pointer-events:none}#deep-chat-openai-realtime-error{color:red;position:absolute;top:calc(50% + 40px);left:50%;transform:translate(-50%,-50%);font-size:17px}#deep-chat-openai-realtime-loading{position:absolute;font-size:15px;top:50%;left:50%;transform:translate(-50%,-50%)}#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-key{display:inline-block;width:16px;height:16px}#loading-key: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-spinner 1.2s linear infinite}#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}@keyframes loading-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:\"\";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child,.message-bubble>.partial-render-message>p:first-child,.stream-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.stream-wrapper>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{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}.role-hidden{display:none}.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:3}.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:2;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}.loading-submit-button{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:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{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}}.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-svg-text{padding:1px;height:1.65em;display:flex}.input-button-svg-text>svg{padding:.22rem}.input-button-svg-text>div{margin-left:2px}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.input-button:active:not(:hover){background-color:transparent}.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;width:max-content}#custom-icon{height:100%;width:1.2em}.custom-button-container-default{color:#505050}.custom-button-container-default>.dropup-menu-item-icon{color:unset}.custom-button-container-default>svg{filter:brightness(0) saturate(100%) invert(39%) sepia(1%) saturate(0%) hue-rotate(83deg) brightness(93%) contrast(90%)}.custom-button-container-default>.dropup-menu-item-icon>svg{position:absolute;left:.2em}.custom-button-container-active{background-color:#edf7ff;color:#0285ff}.custom-button-container-active:hover,.custom-button-container-active:focus-visible{background-color:#def0ff}.custom-button-container-active:active{background-color:#d2eaff}.custom-button-container-active>svg{filter:brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(4196%) hue-rotate(196deg) brightness(107%) contrast(104%)}.custom-button-container-disabled{color:#aeaeae;cursor:auto}.custom-button-container-disabled>div{pointer-events:none}.custom-button-container-disabled:hover,.custom-button-container-disabled:focus-visible{background-color:transparent}.custom-button-container-disabled:active{background-color:transparent}.custom-button-container-disabled>svg{filter:brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(818%) hue-rotate(28deg) brightness(102%) contrast(100%)}#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}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{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-button>*{pointer-events:none}#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:hover,.dropup-menu-item:focus-visible{background-color:#f3f3f3}.dropup-menu-item:active{background-color:#ebebeb}.dropup-menu-item:active:not(:hover){background-color:transparent}.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}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}#dropup-menu-item-icon-element-custom{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-left:.56em;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}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}";
|
16104
|
+
var Ua = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#loading-validate-key-property{display:inline-block;width:50px;height:50px}#loading-validate-key-property:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:loading-spinner 1.4s linear infinite}#deep-chat-openai-realtime-container{height:100%;width:100%}#deep-chat-openai-realtime-avatar-container{height:60%;width:100%;display:flex;justify-content:center;align-items:center}#deep-chat-openai-realtime-avatar{border-radius:50%;height:110px;border:1px solid rgb(215,215,215);padding:8px;-webkit-user-select:none;user-select:none;margin-top:20px}#deep-chat-openai-realtime-buttons-container{height:40%;display:flex;position:relative}.deep-chat-openai-realtime-button-container{height:100%;width:50%;display:flex;justify-content:center;align-items:center}.deep-chat-openai-realtime-button{width:70px;height:70px;border-radius:50%;display:flex;justify-content:center;align-items:center;cursor:pointer}.deep-chat-openai-realtime-button-default{background-color:#e3e3e3}.deep-chat-openai-realtime-button-default:hover{background-color:#d4d4d4}.deep-chat-openai-realtime-button-default:active{background-color:#c5c5c5}.deep-chat-openai-realtime-button-loading{opacity:.7;pointer-events:none}.deep-chat-openai-realtime-microphone-active{background-color:#ffe7e7}.deep-chat-openai-realtime-microphone-active:hover{background-color:#ffdede}.deep-chat-openai-realtime-microphone-active:active{background-color:#ffd2d2}.deep-chat-openai-realtime-microphone>*{height:30px;width:30px}.deep-chat-openai-realtime-microphone-active>*{filter:brightness(0) saturate(100%) invert(35%) sepia(60%) saturate(1360%) hue-rotate(325deg) brightness(95%) contrast(92%)}.deep-chat-openai-realtime-toggle>*{height:32px;width:32px;padding-left:3px;filter:brightness(0) saturate(100%) invert(22%) sepia(0%) saturate(4537%) hue-rotate(208deg) brightness(105%) contrast(91%)}.deep-chat-openai-realtime-button-unavailable{opacity:.45;pointer-events:none}#deep-chat-openai-realtime-error{color:red;position:absolute;top:calc(50% + 40px);left:50%;transform:translate(-50%,-50%);font-size:17px}#deep-chat-openai-realtime-loading{position:absolute;font-size:15px;top:50%;left:50%;transform:translate(-50%,-50%)}#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-key{display:inline-block;width:16px;height:16px}#loading-key: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-spinner 1.2s linear infinite}#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}@keyframes loading-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.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}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:\"\";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child,.message-bubble>.partial-render-message>p:first-child,.stream-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.stream-wrapper>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{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}.role-hidden{display:none}.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:3}.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:2;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}.loading-submit-button{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:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{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}}.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-svg-text{padding:1px;height:1.65em;display:flex}.input-button-svg-text>svg{padding:.22rem}.input-button-svg-text>div{margin-left:2px}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.input-button:active:not(:hover){background-color:transparent}.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;width:max-content}#custom-icon{height:100%;width:1.2em}.custom-button-container-default{color:#505050}.custom-button-container-default>.dropup-menu-item-icon{color:unset}.custom-button-container-default>svg{filter:brightness(0) saturate(100%) invert(39%) sepia(1%) saturate(0%) hue-rotate(83deg) brightness(93%) contrast(90%)}.custom-button-container-default>.dropup-menu-item-icon>svg{position:absolute;left:.2em}.custom-button-container-active{background-color:#edf7ff;color:#0285ff}.custom-button-container-active:hover,.custom-button-container-active:focus-visible{background-color:#def0ff}.custom-button-container-active:active{background-color:#d2eaff}.custom-button-container-active>svg{filter:brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(4196%) hue-rotate(196deg) brightness(107%) contrast(104%)}.custom-button-container-disabled{color:#aeaeae;cursor:auto}.custom-button-container-disabled>div{pointer-events:none}.custom-button-container-disabled:hover,.custom-button-container-disabled:focus-visible{background-color:transparent}.custom-button-container-disabled:active{background-color:transparent}.custom-button-container-disabled>svg{filter:brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(818%) hue-rotate(28deg) brightness(102%) contrast(100%)}#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}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{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-button>*{pointer-events:none}#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:hover,.dropup-menu-item:focus-visible{background-color:#f3f3f3}.dropup-menu-item:active{background-color:#ebebeb}.dropup-menu-item:active:not(:hover){background-color:transparent}.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}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}#dropup-menu-item-icon-element-custom{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-left:.56em;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}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}.tooltip{position:absolute;visibility:hidden}.tooltip-top{top:0;width:100px;height:20px;background-color:#333}.tooltip-text{color:#fff}";
|
16077
16105
|
var ja = Object.defineProperty,
|
16078
16106
|
w = function w(n, e, t, i) {
|
16079
16107
|
for (var s = void 0, r = n.length - 1, o; r >= 0; r--) (o = n[r]) && (s = o(e, t, s) || s);
|
16080
16108
|
return s && ja(e, t, s), s;
|
16081
16109
|
};
|
16082
|
-
var _ = /*#__PURE__*/function (
|
16110
|
+
var _ = /*#__PURE__*/function (_os) {
|
16083
16111
|
function _() {
|
16084
|
-
var
|
16112
|
+
var _this99;
|
16085
16113
|
_classCallCheck(this, _);
|
16086
|
-
|
16114
|
+
_this99 = _callSuper(this, _), _this99.getMessages = function () {
|
16087
16115
|
return [];
|
16088
|
-
},
|
16116
|
+
}, _this99.submitUserMessage = function () {
|
16089
16117
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
16090
|
-
},
|
16118
|
+
}, _this99.addMessage = function () {
|
16091
16119
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
16092
|
-
},
|
16093
|
-
return li.focusFromParentElement(
|
16094
|
-
},
|
16120
|
+
}, _this99.updateMessage = function () {}, _this99.clearMessages = function () {}, _this99.focusInput = function () {
|
16121
|
+
return li.focusFromParentElement(_this99._elementRef);
|
16122
|
+
}, _this99.refreshMessages = function () {}, _this99.scrollToBottom = function () {}, _this99.disableSubmitButton = function () {}, _this99.setPlaceholderText = function () {}, _this99._hasBeenRendered = !1, _this99._auxiliaryStyleApplied = !1, _this99._elementRef = document.createElement("div"), _this99._elementRef.id = "container", _this99.attachShadow({
|
16095
16123
|
mode: "open"
|
16096
|
-
}).appendChild(
|
16097
|
-
|
16124
|
+
}).appendChild(_this99._elementRef), zt.apply(Ua, _this99.shadowRoot), setTimeout(function () {
|
16125
|
+
_this99._hasBeenRendered || _this99.onRender();
|
16098
16126
|
}, 20);
|
16099
|
-
return
|
16127
|
+
return _this99;
|
16100
16128
|
}
|
16101
|
-
_inherits(_,
|
16129
|
+
_inherits(_, _os);
|
16102
16130
|
return _createClass(_, [{
|
16103
16131
|
key: "changeToChatView",
|
16104
16132
|
value: function changeToChatView() {
|
@@ -16117,7 +16145,7 @@ var _ = /*#__PURE__*/function (_rs) {
|
|
16117
16145
|
ni.chat = void 0;
|
16118
16146
|
}
|
16119
16147
|
}]);
|
16120
|
-
}(
|
16148
|
+
}(os);
|
16121
16149
|
w([x("object")], _.prototype, "connect");
|
16122
16150
|
w([x("object")], _.prototype, "directConnection");
|
16123
16151
|
w([x("object")], _.prototype, "webModel");
|