deep-chat-dev 9.0.105 → 9.0.107
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 +12 -0
- package/custom-elements.json +2078 -1932
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.js +753 -789
- package/dist/services/openAI/openAIAssistantIO.d.ts.map +1 -1
- package/dist/services/serviceIO.d.ts.map +1 -1
- package/dist/types/openAIResult.d.ts +4 -1
- package/dist/types/openAIResult.d.ts.map +1 -1
- package/dist/types/submitButton.d.ts +1 -1
- package/dist/types/submitButton.d.ts.map +1 -1
- package/dist/types/webModel/webModel.d.ts +1 -0
- package/dist/types/webModel/webModel.d.ts.map +1 -1
- package/dist/views/chat/input/dropup/dropupMenu.d.ts +4 -0
- package/dist/views/chat/input/dropup/dropupMenu.d.ts.map +1 -1
- package/dist/views/chat/input/fileAttachments/modal/modal.d.ts +2 -0
- package/dist/views/chat/input/fileAttachments/modal/modal.d.ts.map +1 -1
- package/dist/views/chat/input/input.d.ts.map +1 -1
- package/dist/views/chat/input/validation/validationHandler.d.ts +0 -1
- package/dist/views/chat/input/validation/validationHandler.d.ts.map +1 -1
- package/dist/views/chat/messages/messages.d.ts.map +1 -1
- package/dist/webModel/webModel.d.ts.map +1 -1
- package/dist/webModel/webModelConfig.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -240,29 +240,29 @@ var ys = /*#__PURE__*/function () {
|
|
240
240
|
}]);
|
241
241
|
return ys;
|
242
242
|
}();
|
243
|
-
var
|
244
|
-
function
|
243
|
+
var Un = /*#__PURE__*/function () {
|
244
|
+
function qe(e, t) {
|
245
245
|
var _this = this;
|
246
|
-
_classCallCheck(this,
|
246
|
+
_classCallCheck(this, qe);
|
247
247
|
var n;
|
248
|
-
var i =
|
249
|
-
this.elementRef =
|
248
|
+
var i = qe.processConfig(t, e.textInput);
|
249
|
+
this.elementRef = qe.createContainerElement((n = i == null ? void 0 : i.styles) == null ? void 0 : n.container), this.inputElementRef = this.createInputElement(i), this._config = i, this.elementRef.appendChild(this.inputElementRef), setTimeout(function () {
|
250
250
|
var r;
|
251
251
|
vs.add(_this.inputElementRef, (r = e.textInput) == null ? void 0 : r.characterLimit, e._validationHandler);
|
252
252
|
});
|
253
253
|
}
|
254
|
-
_createClass(
|
254
|
+
_createClass(qe, [{
|
255
255
|
key: "createInputElement",
|
256
256
|
value: function createInputElement(e) {
|
257
257
|
var i, n, r;
|
258
258
|
var t = document.createElement("div");
|
259
|
-
return t.id =
|
259
|
+
return t.id = qe.TEXT_INPUT_ID, t.classList.add("text-input-styling", "text-input-placeholder"), t.innerText = ((i = e == null ? void 0 : e.placeholder) == null ? void 0 : i.text) || "Ask me anything!", ge.IS_CHROMIUM && qe.preventAutomaticScrollUpOnNewLine(t), typeof (e == null ? void 0 : e.disabled) == "boolean" && e.disabled === !0 ? (t.contentEditable = "false", t.classList.add("text-input-disabled")) : (t.contentEditable = "true", this.addEventListeners(t, e)), Object.assign(t.style, (n = e == null ? void 0 : e.styles) == null ? void 0 : n.text), Object.assign(t.style, (r = e == null ? void 0 : e.placeholder) == null ? void 0 : r.style), t;
|
260
260
|
}
|
261
261
|
}, {
|
262
262
|
key: "removeTextIfPlaceholder",
|
263
263
|
value: function removeTextIfPlaceholder() {
|
264
264
|
var e, t, i, n;
|
265
|
-
this.inputElementRef.classList.contains("text-input-placeholder") && !this.inputElementRef.classList.contains("text-input-disabled") && ((e = this._config.placeholder) != null && e.style && (T.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (n = (i = this._config) == null ? void 0 : i.styles) == null ? void 0 : n.text)),
|
265
|
+
this.inputElementRef.classList.contains("text-input-placeholder") && !this.inputElementRef.classList.contains("text-input-disabled") && ((e = this._config.placeholder) != null && e.style && (T.unsetStyle(this.inputElementRef, (t = this._config.placeholder) == null ? void 0 : t.style), Object.assign(this.inputElementRef.style, (n = (i = this._config) == null ? void 0 : i.styles) == null ? void 0 : n.text)), qe.clear(this.inputElementRef), this.inputElementRef.classList.remove("text-input-placeholder"));
|
266
266
|
}
|
267
267
|
}, {
|
268
268
|
key: "addEventListeners",
|
@@ -334,10 +334,10 @@ var qn = /*#__PURE__*/function () {
|
|
334
334
|
return t.id = "text-input-container", Object.assign(t.style, e), t;
|
335
335
|
}
|
336
336
|
}]);
|
337
|
-
return
|
337
|
+
return qe;
|
338
338
|
}();
|
339
|
-
|
340
|
-
var
|
339
|
+
Un.TEXT_INPUT_ID = "text-input";
|
340
|
+
var qi = Un;
|
341
341
|
var Qt = /*#__PURE__*/function () {
|
342
342
|
function Qt() {
|
343
343
|
_classCallCheck(this, Qt);
|
@@ -353,7 +353,7 @@ var Qt = /*#__PURE__*/function () {
|
|
353
353
|
}, {
|
354
354
|
key: "focusFromParentElement",
|
355
355
|
value: function focusFromParentElement(e) {
|
356
|
-
var t = e.querySelector("#".concat(
|
356
|
+
var t = e.querySelector("#".concat(qi.TEXT_INPUT_ID));
|
357
357
|
t && Qt.focusEndOfInput(t);
|
358
358
|
}
|
359
359
|
}]);
|
@@ -373,11 +373,11 @@ function Hi(s, e, t, i) {
|
|
373
373
|
function Es(s, e, t, i) {
|
374
374
|
return "".concat(Hi(s, 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");
|
375
375
|
}
|
376
|
-
function
|
376
|
+
function Ss(s, e, t) {
|
377
377
|
var i = "response";
|
378
378
|
return "".concat(Hi(s, i, e, t), "Make sure the ").concat(i, " message is using the {text: string} format, e.g: {text: \"Model Response\"}");
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function ws(s, e) {
|
381
381
|
var t = "request";
|
382
382
|
return "".concat(Hi(s, t, e), "Make sure the ").concat(t, " message is using the {body: {text: string}} format, e.g: {body: {text: \"Model Response\"}}");
|
383
383
|
}
|
@@ -386,13 +386,13 @@ var an = "Make sure the events are using {text: string} or {html: string} format
|
|
386
386
|
INVALID_KEY: "Invalid API Key",
|
387
387
|
CONNECTION_FAILED: "Failed to connect",
|
388
388
|
INVALID_RESPONSE: Es,
|
389
|
-
INVALID_MODEL_REQUEST:
|
390
|
-
INVALID_MODEL_RESPONSE:
|
389
|
+
INVALID_MODEL_REQUEST: ws,
|
390
|
+
INVALID_MODEL_RESPONSE: Ss,
|
391
391
|
INVALID_STREAM_EVENT: an,
|
392
392
|
INVALID_STREAM_EVENT_MIX: "Cannot mix {text: string} and {html: string} responses.",
|
393
393
|
NO_VALID_STREAM_EVENTS_SENT: "No valid stream events were sent.\n".concat(an)
|
394
394
|
},
|
395
|
-
|
395
|
+
qn = /*#__PURE__*/function () {
|
396
396
|
function Hn() {
|
397
397
|
_classCallCheck(this, Hn);
|
398
398
|
}
|
@@ -434,13 +434,13 @@ var an = "Make sure the events are using {text: string} or {html: string} format
|
|
434
434
|
}]);
|
435
435
|
return Hn;
|
436
436
|
}();
|
437
|
-
|
438
|
-
var Y =
|
439
|
-
var
|
440
|
-
function
|
441
|
-
_classCallCheck(this,
|
437
|
+
qn.CODE_SNIPPET_GENERATION_JUMP = 0.5;
|
438
|
+
var Y = qn;
|
439
|
+
var Gn = /*#__PURE__*/function () {
|
440
|
+
function Vn() {
|
441
|
+
_classCallCheck(this, Vn);
|
442
442
|
}
|
443
|
-
_createClass(
|
443
|
+
_createClass(Vn, null, [{
|
444
444
|
key: "speak",
|
445
445
|
value: function speak(e, t) {
|
446
446
|
if (window.SpeechSynthesisUtterance) {
|
@@ -461,13 +461,13 @@ var Vn = /*#__PURE__*/function () {
|
|
461
461
|
n && (i.voice = n);
|
462
462
|
}
|
463
463
|
t(i);
|
464
|
-
},
|
464
|
+
}, Vn.LOAD_VOICES_MS);
|
465
465
|
}
|
466
466
|
}]);
|
467
|
-
return
|
467
|
+
return Vn;
|
468
468
|
}();
|
469
|
-
|
470
|
-
var Nt =
|
469
|
+
Gn.LOAD_VOICES_MS = 200;
|
470
|
+
var Nt = Gn;
|
471
471
|
var ke = /*#__PURE__*/function () {
|
472
472
|
function ke() {
|
473
473
|
_classCallCheck(this, ke);
|
@@ -629,7 +629,7 @@ var Te = /*#__PURE__*/function () {
|
|
629
629
|
}]);
|
630
630
|
return Te;
|
631
631
|
}();
|
632
|
-
var
|
632
|
+
var _s = "deep-chat-temporary-message",
|
633
633
|
Ms = "deep-chat-suggestion-button",
|
634
634
|
Ri = {
|
635
635
|
"deep-chat-button": {
|
@@ -673,7 +673,7 @@ var be = /*#__PURE__*/function () {
|
|
673
673
|
key: "isElementTemporary",
|
674
674
|
value: function isElementTemporary(e) {
|
675
675
|
var t;
|
676
|
-
return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains(
|
676
|
+
return e ? (t = e.bubbleElement.children[0]) == null ? void 0 : t.classList.contains(_s) : !1;
|
677
677
|
}
|
678
678
|
}, {
|
679
679
|
key: "doesElementContainDeepChatClass",
|
@@ -864,17 +864,17 @@ function Ps(s) {
|
|
864
864
|
function z(s) {
|
865
865
|
return Rs.test(s) ? s.replace(Os, Ps) : s;
|
866
866
|
}
|
867
|
-
var
|
868
|
-
|
867
|
+
var m = {};
|
868
|
+
m.blockquote_open = function () {
|
869
869
|
return "<blockquote>\n";
|
870
870
|
};
|
871
|
-
|
871
|
+
m.blockquote_close = function (s, e) {
|
872
872
|
return "</blockquote>" + Re(s, e);
|
873
873
|
};
|
874
|
-
|
874
|
+
m.code = function (s, e) {
|
875
875
|
return s[e].block ? "<pre><code>" + z(s[e].content) + "</code></pre>" + Re(s, e) : "<code>" + z(s[e].content) + "</code>";
|
876
876
|
};
|
877
|
-
|
877
|
+
m.fence = function (s, e, t, i, n) {
|
878
878
|
var r = s[e],
|
879
879
|
o = "",
|
880
880
|
a = t.langPrefix,
|
@@ -888,209 +888,209 @@ f.fence = function (s, e, t, i, n) {
|
|
888
888
|
}
|
889
889
|
return t.highlight ? u = t.highlight.apply(t.highlight, [r.content].concat(c)) || z(r.content) : u = z(r.content), "<pre><code" + o + ">" + u + "</code></pre>" + Re(s, e);
|
890
890
|
};
|
891
|
-
|
892
|
-
|
891
|
+
m.fence_custom = {};
|
892
|
+
m.heading_open = function (s, e) {
|
893
893
|
return "<h" + s[e].hLevel + ">";
|
894
894
|
};
|
895
|
-
|
895
|
+
m.heading_close = function (s, e) {
|
896
896
|
return "</h" + s[e].hLevel + ">\n";
|
897
897
|
};
|
898
|
-
|
898
|
+
m.hr = function (s, e, t) {
|
899
899
|
return (t.xhtmlOut ? "<hr />" : "<hr>") + Re(s, e);
|
900
900
|
};
|
901
|
-
|
901
|
+
m.bullet_list_open = function () {
|
902
902
|
return "<ul>\n";
|
903
903
|
};
|
904
|
-
|
904
|
+
m.bullet_list_close = function (s, e) {
|
905
905
|
return "</ul>" + Re(s, e);
|
906
906
|
};
|
907
|
-
|
907
|
+
m.list_item_open = function () {
|
908
908
|
return "<li>";
|
909
909
|
};
|
910
|
-
|
910
|
+
m.list_item_close = function () {
|
911
911
|
return "</li>\n";
|
912
912
|
};
|
913
|
-
|
913
|
+
m.ordered_list_open = function (s, e) {
|
914
914
|
var t = s[e],
|
915
915
|
i = t.order > 1 ? ' start="' + t.order + '"' : "";
|
916
916
|
return "<ol" + i + ">\n";
|
917
917
|
};
|
918
|
-
|
918
|
+
m.ordered_list_close = function (s, e) {
|
919
919
|
return "</ol>" + Re(s, e);
|
920
920
|
};
|
921
|
-
|
921
|
+
m.paragraph_open = function (s, e) {
|
922
922
|
return s[e].tight ? "" : "<p>";
|
923
923
|
};
|
924
|
-
|
924
|
+
m.paragraph_close = function (s, e) {
|
925
925
|
var t = !(s[e].tight && e && s[e - 1].type === "inline" && !s[e - 1].content);
|
926
926
|
return (s[e].tight ? "" : "</p>") + (t ? Re(s, e) : "");
|
927
927
|
};
|
928
|
-
|
928
|
+
m.link_open = function (s, e, t) {
|
929
929
|
var i = s[e].title ? ' title="' + z(Ie(s[e].title)) + '"' : "",
|
930
930
|
n = t.linkTarget ? ' target="' + t.linkTarget + '"' : "";
|
931
931
|
return '<a href="' + z(s[e].href) + '"' + i + n + ">";
|
932
932
|
};
|
933
|
-
|
933
|
+
m.link_close = function () {
|
934
934
|
return "</a>";
|
935
935
|
};
|
936
|
-
|
936
|
+
m.image = function (s, e, t) {
|
937
937
|
var i = ' src="' + z(s[e].src) + '"',
|
938
938
|
n = s[e].title ? ' title="' + z(Ie(s[e].title)) + '"' : "",
|
939
939
|
r = ' alt="' + (s[e].alt ? z(Ie(ft(s[e].alt))) : "") + '"',
|
940
940
|
o = t.xhtmlOut ? " /" : "";
|
941
941
|
return "<img" + i + r + n + o + ">";
|
942
942
|
};
|
943
|
-
|
943
|
+
m.table_open = function () {
|
944
944
|
return "<table>\n";
|
945
945
|
};
|
946
|
-
|
946
|
+
m.table_close = function () {
|
947
947
|
return "</table>\n";
|
948
948
|
};
|
949
|
-
|
949
|
+
m.thead_open = function () {
|
950
950
|
return "<thead>\n";
|
951
951
|
};
|
952
|
-
|
952
|
+
m.thead_close = function () {
|
953
953
|
return "</thead>\n";
|
954
954
|
};
|
955
|
-
|
955
|
+
m.tbody_open = function () {
|
956
956
|
return "<tbody>\n";
|
957
957
|
};
|
958
|
-
|
958
|
+
m.tbody_close = function () {
|
959
959
|
return "</tbody>\n";
|
960
960
|
};
|
961
|
-
|
961
|
+
m.tr_open = function () {
|
962
962
|
return "<tr>";
|
963
963
|
};
|
964
|
-
|
964
|
+
m.tr_close = function () {
|
965
965
|
return "</tr>\n";
|
966
966
|
};
|
967
|
-
|
967
|
+
m.th_open = function (s, e) {
|
968
968
|
var t = s[e];
|
969
969
|
return "<th" + (t.align ? ' style="text-align:' + t.align + '"' : "") + ">";
|
970
970
|
};
|
971
|
-
|
971
|
+
m.th_close = function () {
|
972
972
|
return "</th>";
|
973
973
|
};
|
974
|
-
|
974
|
+
m.td_open = function (s, e) {
|
975
975
|
var t = s[e];
|
976
976
|
return "<td" + (t.align ? ' style="text-align:' + t.align + '"' : "") + ">";
|
977
977
|
};
|
978
|
-
|
978
|
+
m.td_close = function () {
|
979
979
|
return "</td>";
|
980
980
|
};
|
981
|
-
|
981
|
+
m.strong_open = function () {
|
982
982
|
return "<strong>";
|
983
983
|
};
|
984
|
-
|
984
|
+
m.strong_close = function () {
|
985
985
|
return "</strong>";
|
986
986
|
};
|
987
|
-
|
987
|
+
m.em_open = function () {
|
988
988
|
return "<em>";
|
989
989
|
};
|
990
|
-
|
990
|
+
m.em_close = function () {
|
991
991
|
return "</em>";
|
992
992
|
};
|
993
|
-
|
993
|
+
m.del_open = function () {
|
994
994
|
return "<del>";
|
995
995
|
};
|
996
|
-
|
996
|
+
m.del_close = function () {
|
997
997
|
return "</del>";
|
998
998
|
};
|
999
|
-
|
999
|
+
m.ins_open = function () {
|
1000
1000
|
return "<ins>";
|
1001
1001
|
};
|
1002
|
-
|
1002
|
+
m.ins_close = function () {
|
1003
1003
|
return "</ins>";
|
1004
1004
|
};
|
1005
|
-
|
1005
|
+
m.mark_open = function () {
|
1006
1006
|
return "<mark>";
|
1007
1007
|
};
|
1008
|
-
|
1008
|
+
m.mark_close = function () {
|
1009
1009
|
return "</mark>";
|
1010
1010
|
};
|
1011
|
-
|
1011
|
+
m.sub = function (s, e) {
|
1012
1012
|
return "<sub>" + z(s[e].content) + "</sub>";
|
1013
1013
|
};
|
1014
|
-
|
1014
|
+
m.sup = function (s, e) {
|
1015
1015
|
return "<sup>" + z(s[e].content) + "</sup>";
|
1016
1016
|
};
|
1017
|
-
|
1017
|
+
m.hardbreak = function (s, e, t) {
|
1018
1018
|
return t.xhtmlOut ? "<br />\n" : "<br>\n";
|
1019
1019
|
};
|
1020
|
-
|
1020
|
+
m.softbreak = function (s, e, t) {
|
1021
1021
|
return t.breaks ? t.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
|
1022
1022
|
};
|
1023
|
-
|
1023
|
+
m.text = function (s, e) {
|
1024
1024
|
return z(s[e].content);
|
1025
1025
|
};
|
1026
|
-
|
1026
|
+
m.htmlblock = function (s, e) {
|
1027
1027
|
return s[e].content;
|
1028
1028
|
};
|
1029
|
-
|
1029
|
+
m.htmltag = function (s, e) {
|
1030
1030
|
return s[e].content;
|
1031
1031
|
};
|
1032
|
-
|
1032
|
+
m.abbr_open = function (s, e) {
|
1033
1033
|
return '<abbr title="' + z(Ie(s[e].title)) + '">';
|
1034
1034
|
};
|
1035
|
-
|
1035
|
+
m.abbr_close = function () {
|
1036
1036
|
return "</abbr>";
|
1037
1037
|
};
|
1038
|
-
|
1038
|
+
m.footnote_ref = function (s, e) {
|
1039
1039
|
var t = Number(s[e].id + 1).toString(),
|
1040
1040
|
i = "fnref" + t;
|
1041
1041
|
return s[e].subId > 0 && (i += ":" + s[e].subId), '<sup class="footnote-ref"><a href="#fn' + t + '" id="' + i + '">[' + t + "]</a></sup>";
|
1042
1042
|
};
|
1043
|
-
|
1043
|
+
m.footnote_block_open = function (s, e, t) {
|
1044
1044
|
var i = t.xhtmlOut ? "<hr class=\"footnotes-sep\" />\n" : "<hr class=\"footnotes-sep\">\n";
|
1045
1045
|
return i + "<section class=\"footnotes\">\n<ol class=\"footnotes-list\">\n";
|
1046
1046
|
};
|
1047
|
-
|
1047
|
+
m.footnote_block_close = function () {
|
1048
1048
|
return "</ol>\n</section>\n";
|
1049
1049
|
};
|
1050
|
-
|
1050
|
+
m.footnote_open = function (s, e) {
|
1051
1051
|
var t = Number(s[e].id + 1).toString();
|
1052
1052
|
return '<li id="fn' + t + '" class="footnote-item">';
|
1053
1053
|
};
|
1054
|
-
|
1054
|
+
m.footnote_close = function () {
|
1055
1055
|
return "</li>\n";
|
1056
1056
|
};
|
1057
|
-
|
1057
|
+
m.footnote_anchor = function (s, e) {
|
1058
1058
|
var t = Number(s[e].id + 1).toString(),
|
1059
1059
|
i = "fnref" + t;
|
1060
1060
|
return s[e].subId > 0 && (i += ":" + s[e].subId), ' <a href="#' + i + '" class="footnote-backref">↩</a>';
|
1061
1061
|
};
|
1062
|
-
|
1062
|
+
m.dl_open = function () {
|
1063
1063
|
return "<dl>\n";
|
1064
1064
|
};
|
1065
|
-
|
1065
|
+
m.dt_open = function () {
|
1066
1066
|
return "<dt>";
|
1067
1067
|
};
|
1068
|
-
|
1068
|
+
m.dd_open = function () {
|
1069
1069
|
return "<dd>";
|
1070
1070
|
};
|
1071
|
-
|
1071
|
+
m.dl_close = function () {
|
1072
1072
|
return "</dl>\n";
|
1073
1073
|
};
|
1074
|
-
|
1074
|
+
m.dt_close = function () {
|
1075
1075
|
return "</dt>\n";
|
1076
1076
|
};
|
1077
|
-
|
1077
|
+
m.dd_close = function () {
|
1078
1078
|
return "</dd>\n";
|
1079
1079
|
};
|
1080
1080
|
function $n(s, e) {
|
1081
1081
|
return ++e >= s.length - 2 ? e : s[e].type === "paragraph_open" && s[e].tight && s[e + 1].type === "inline" && s[e + 1].content.length === 0 && s[e + 2].type === "paragraph_close" && s[e + 2].tight ? $n(s, e + 2) : e;
|
1082
1082
|
}
|
1083
|
-
var Re =
|
1083
|
+
var Re = m.getBreak = function (e, t) {
|
1084
1084
|
return t = $n(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1085
1085
|
};
|
1086
|
-
function
|
1087
|
-
this.rules = Kn({},
|
1086
|
+
function Gi() {
|
1087
|
+
this.rules = Kn({}, m), this.getBreak = m.getBreak;
|
1088
1088
|
}
|
1089
|
-
|
1089
|
+
Gi.prototype.renderInline = function (s, e, t) {
|
1090
1090
|
for (var i = this.rules, n = s.length, r = 0, o = ""; n--;) o += i[s[r].type](s, r++, e, t, this);
|
1091
1091
|
return o;
|
1092
1092
|
};
|
1093
|
-
|
1093
|
+
Gi.prototype.render = function (s, e, t) {
|
1094
1094
|
for (var i = this.rules, n = s.length, r = -1, o = ""; ++r < n;) s[r].type === "inline" ? o += this.renderInline(s[r].children, e, t) : o += i[s[r].type](s, r, e, t, this);
|
1095
1095
|
return o;
|
1096
1096
|
};
|
@@ -1292,13 +1292,13 @@ function Xn(s) {
|
|
1292
1292
|
return s.trim().replace(/\s+/g, " ").toUpperCase();
|
1293
1293
|
}
|
1294
1294
|
function Bs(s, e, t, i) {
|
1295
|
-
var n, r, o, a, l, c, d, u,
|
1295
|
+
var n, r, o, a, l, c, d, u, p;
|
1296
1296
|
if (s.charCodeAt(0) !== 91 || s.indexOf("]:") === -1 || (n = new Oe(s, e, t, i, []), r = mt(n, 0), r < 0 || s.charCodeAt(r + 1) !== 58)) return -1;
|
1297
1297
|
for (a = n.posMax, o = r + 2; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1298
1298
|
if (!Yn(n, o)) return -1;
|
1299
1299
|
for (d = n.linkContent, o = n.pos, c = o, o = o + 1; o < a && (l = n.src.charCodeAt(o), !(l !== 32 && l !== 10)); o++);
|
1300
1300
|
for (o < a && c !== o && Zn(n, o) ? (u = n.linkContent, o = n.pos) : (u = "", o = c); o < a && n.src.charCodeAt(o) === 32;) o++;
|
1301
|
-
return o < a && n.src.charCodeAt(o) !== 10 ? -1 : (
|
1301
|
+
return o < a && n.src.charCodeAt(o) !== 10 ? -1 : (p = Xn(s.slice(1, r)), _typeof(i.references[p]) > "u" && (i.references[p] = {
|
1302
1302
|
title: u,
|
1303
1303
|
href: d
|
1304
1304
|
}), o);
|
@@ -1316,14 +1316,14 @@ function zs(s) {
|
|
1316
1316
|
}
|
1317
1317
|
}
|
1318
1318
|
}
|
1319
|
-
function
|
1319
|
+
function Us(s) {
|
1320
1320
|
var e = s.tokens,
|
1321
1321
|
t,
|
1322
1322
|
i,
|
1323
1323
|
n;
|
1324
1324
|
for (i = 0, n = e.length; i < n; i++) t = e[i], t.type === "inline" && s.inline.parse(t.content, s.options, s.env, t.children);
|
1325
1325
|
}
|
1326
|
-
function
|
1326
|
+
function qs(s) {
|
1327
1327
|
var e,
|
1328
1328
|
t,
|
1329
1329
|
i,
|
@@ -1335,9 +1335,9 @@ function Us(s) {
|
|
1335
1335
|
c,
|
1336
1336
|
d = 0,
|
1337
1337
|
u = !1,
|
1338
|
-
|
1339
|
-
if (s.env.footnotes && (s.tokens = s.tokens.filter(function (
|
1340
|
-
return
|
1338
|
+
p = {};
|
1339
|
+
if (s.env.footnotes && (s.tokens = s.tokens.filter(function (h) {
|
1340
|
+
return h.type === "footnote_reference_open" ? (u = !0, l = [], c = h.label, !1) : h.type === "footnote_reference_close" ? (u = !1, p[":" + c] = l, !1) : (u && l.push(h), !u);
|
1341
1341
|
}), !!s.env.footnotes.list)) {
|
1342
1342
|
for (o = s.env.footnotes.list, s.tokens.push({
|
1343
1343
|
type: "footnote_block_open",
|
@@ -1360,7 +1360,7 @@ function Us(s) {
|
|
1360
1360
|
type: "paragraph_close",
|
1361
1361
|
tight: !1,
|
1362
1362
|
level: --d
|
1363
|
-
})) : o[e].label && (a =
|
1363
|
+
})) : o[e].label && (a = p[":" + o[e].label]), s.tokens = s.tokens.concat(a), s.tokens[s.tokens.length - 1].type === "paragraph_close" ? r = s.tokens.pop() : r = null, n = o[e].count > 0 ? o[e].count : 1, i = 0; i < n; i++) s.tokens.push({
|
1364
1364
|
type: "footnote_anchor",
|
1365
1365
|
id: e,
|
1366
1366
|
subId: i,
|
@@ -1378,7 +1378,7 @@ function Us(s) {
|
|
1378
1378
|
}
|
1379
1379
|
}
|
1380
1380
|
var cn = " \n()[]'\".,!?-";
|
1381
|
-
function
|
1381
|
+
function Si(s) {
|
1382
1382
|
return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1383
1383
|
}
|
1384
1384
|
function Hs(s) {
|
@@ -1393,15 +1393,15 @@ function Hs(s) {
|
|
1393
1393
|
c,
|
1394
1394
|
d,
|
1395
1395
|
u,
|
1396
|
-
|
1397
|
-
|
1396
|
+
p,
|
1397
|
+
h = s.tokens;
|
1398
1398
|
if (s.env.abbreviations) {
|
1399
|
-
for (s.env.abbrRegExp || (
|
1399
|
+
for (s.env.abbrRegExp || (p = "(^|[" + cn.split("").map(Si).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (g) {
|
1400
1400
|
return g.substr(1);
|
1401
|
-
}).sort(function (g,
|
1402
|
-
return
|
1403
|
-
}).map(
|
1404
|
-
for (n =
|
1401
|
+
}).sort(function (g, f) {
|
1402
|
+
return f.length - g.length;
|
1403
|
+
}).map(Si).join("|") + ")($|[" + cn.split("").map(Si).join("") + "])", s.env.abbrRegExp = new RegExp(p, "g")), d = s.env.abbrRegExp, t = 0, i = h.length; t < i; t++) if (h[t].type === "inline") {
|
1404
|
+
for (n = h[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1405
1405
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1406
1406
|
type: "text",
|
1407
1407
|
content: o.slice(l, u.index + u[1].length),
|
@@ -1422,13 +1422,13 @@ function Hs(s) {
|
|
1422
1422
|
type: "text",
|
1423
1423
|
content: o.slice(l),
|
1424
1424
|
level: c
|
1425
|
-
}),
|
1425
|
+
}), h[t].children = n = [].concat(n.slice(0, e), a, n.slice(e + 1)));
|
1426
1426
|
}
|
1427
1427
|
}
|
1428
1428
|
}
|
1429
1429
|
}
|
1430
|
-
var
|
1431
|
-
|
1430
|
+
var Gs = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/,
|
1431
|
+
Vs = /\((c|tm|r|p)\)/ig,
|
1432
1432
|
Ws = {
|
1433
1433
|
c: "©",
|
1434
1434
|
r: "®",
|
@@ -1436,14 +1436,14 @@ var Vs = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/,
|
|
1436
1436
|
tm: "™"
|
1437
1437
|
};
|
1438
1438
|
function Ks(s) {
|
1439
|
-
return s.indexOf("(") < 0 ? s : s.replace(
|
1439
|
+
return s.indexOf("(") < 0 ? s : s.replace(Vs, function (e, t) {
|
1440
1440
|
return Ws[t.toLowerCase()];
|
1441
1441
|
});
|
1442
1442
|
}
|
1443
1443
|
function Js(s) {
|
1444
1444
|
var e, t, i, n, r;
|
1445
1445
|
if (s.options.typographer) {
|
1446
|
-
for (r = s.tokens.length - 1; r >= 0; r--) if (s.tokens[r].type === "inline") for (n = s.tokens[r].children, e = n.length - 1; e >= 0; e--) t = n[e], t.type === "text" && (i = t.content, i = Ks(i),
|
1446
|
+
for (r = s.tokens.length - 1; r >= 0; r--) if (s.tokens[r].type === "inline") for (n = s.tokens[r].children, e = n.length - 1; e >= 0; e--) t = n[e], t.type === "text" && (i = t.content, i = Ks(i), Gs.test(i) && (i = i.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---([^-]|$)/mg, "$1—$2").replace(/(^|\s)--(\s|$)/mg, "$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/mg, "$1–$2")), t.content = i);
|
1447
1447
|
}
|
1448
1448
|
}
|
1449
1449
|
var $s = /['"]/,
|
@@ -1457,38 +1457,38 @@ function ze(s, e, t) {
|
|
1457
1457
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1458
1458
|
}
|
1459
1459
|
function Zs(s) {
|
1460
|
-
var e, t, i, n, r, o, a, l, c, d, u,
|
1460
|
+
var e, t, i, n, r, o, a, l, c, d, u, p, h, g, f, S, w;
|
1461
1461
|
if (s.options.typographer) {
|
1462
|
-
for (
|
1463
|
-
for (
|
1464
|
-
for (a =
|
1465
|
-
|
1462
|
+
for (w = [], f = s.tokens.length - 1; f >= 0; f--) if (s.tokens[f].type === "inline") {
|
1463
|
+
for (S = s.tokens[f].children, w.length = 0, e = 0; e < S.length; e++) if (t = S[e], !(t.type !== "text" || $s.test(t.text))) {
|
1464
|
+
for (a = S[e].level, h = w.length - 1; h >= 0 && !(w[h].level <= a); h--);
|
1465
|
+
w.length = h + 1, i = t.content, r = 0, o = i.length;
|
1466
1466
|
e: for (; r < o && (dn.lastIndex = r, n = dn.exec(i), !!n);) {
|
1467
1467
|
if (l = !hn(i, n.index - 1), r = n.index + 1, g = n[0] === "'", c = !hn(i, r), !c && !l) {
|
1468
1468
|
g && (t.content = ze(t.content, n.index, un));
|
1469
1469
|
continue;
|
1470
1470
|
}
|
1471
|
-
if (u = !c,
|
1472
|
-
for (
|
1473
|
-
d =
|
1471
|
+
if (u = !c, p = !l, p) {
|
1472
|
+
for (h = w.length - 1; h >= 0 && (d = w[h], !(w[h].level < a)); h--) if (d.single === g && w[h].level === a) {
|
1473
|
+
d = w[h], g ? (S[d.token].content = ze(S[d.token].content, d.pos, s.options.quotes[2]), t.content = ze(t.content, n.index, s.options.quotes[3])) : (S[d.token].content = ze(S[d.token].content, d.pos, s.options.quotes[0]), t.content = ze(t.content, n.index, s.options.quotes[1])), w.length = h;
|
1474
1474
|
continue e;
|
1475
1475
|
}
|
1476
1476
|
}
|
1477
|
-
u ?
|
1477
|
+
u ? w.push({
|
1478
1478
|
token: e,
|
1479
1479
|
pos: n.index,
|
1480
1480
|
single: g,
|
1481
1481
|
level: a
|
1482
|
-
}) :
|
1482
|
+
}) : p && g && (t.content = ze(t.content, n.index, un));
|
1483
1483
|
}
|
1484
1484
|
}
|
1485
1485
|
}
|
1486
1486
|
}
|
1487
1487
|
}
|
1488
|
-
var
|
1488
|
+
var wi = [["block", Ds], ["abbr", Fs], ["references", zs], ["inline", Us], ["footnote_tail", qs], ["abbr2", Hs], ["replacements", Js], ["smartquotes", Zs]];
|
1489
1489
|
function Qn() {
|
1490
1490
|
this.options = {}, this.ruler = new H();
|
1491
|
-
for (var s = 0; s <
|
1491
|
+
for (var s = 0; s < wi.length; s++) this.ruler.push(wi[s][0], wi[s][1]);
|
1492
1492
|
}
|
1493
1493
|
Qn.prototype.process = function (s) {
|
1494
1494
|
var e, t, i;
|
@@ -1591,20 +1591,20 @@ function er(s, e, t, i) {
|
|
1591
1591
|
c,
|
1592
1592
|
d,
|
1593
1593
|
u,
|
1594
|
-
h,
|
1595
1594
|
p,
|
1595
|
+
h,
|
1596
1596
|
g,
|
1597
|
-
|
1598
|
-
|
1599
|
-
if (
|
1597
|
+
f = s.bMarks[e] + s.tShift[e],
|
1598
|
+
S = s.eMarks[e];
|
1599
|
+
if (f > S || s.src.charCodeAt(f++) !== 62 || s.level >= s.options.maxNesting) return !1;
|
1600
1600
|
if (i) return !0;
|
1601
|
-
for (s.src.charCodeAt(
|
1602
|
-
if (s.src.charCodeAt(
|
1603
|
-
s.src.charCodeAt(
|
1601
|
+
for (s.src.charCodeAt(f) === 32 && f++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = f, f = f < S ? s.skipSpaces(f) : f, r = f >= S, o = [s.tShift[e]], s.tShift[e] = f - s.bMarks[e], u = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (f = s.bMarks[n] + s.tShift[n], S = s.eMarks[n], !(f >= S)); n++) {
|
1602
|
+
if (s.src.charCodeAt(f++) === 62) {
|
1603
|
+
s.src.charCodeAt(f) === 32 && f++, a.push(s.bMarks[n]), s.bMarks[n] = f, f = f < S ? s.skipSpaces(f) : f, r = f >= S, o.push(s.tShift[n]), s.tShift[n] = f - s.bMarks[n];
|
1604
1604
|
continue;
|
1605
1605
|
}
|
1606
1606
|
if (r) break;
|
1607
|
-
for (g = !1,
|
1607
|
+
for (g = !1, p = 0, h = u.length; p < h; p++) if (u[p](s, n, t, !0)) {
|
1608
1608
|
g = !0;
|
1609
1609
|
break;
|
1610
1610
|
}
|
@@ -1618,7 +1618,7 @@ function er(s, e, t, i) {
|
|
1618
1618
|
}), s.parser.tokenize(s, e, n), s.tokens.push({
|
1619
1619
|
type: "blockquote_close",
|
1620
1620
|
level: --s.level
|
1621
|
-
}), s.parentType = c, d[1] = s.line,
|
1621
|
+
}), s.parentType = c, d[1] = s.line, p = 0; p < o.length; p++) s.bMarks[p + e] = a[p], s.tShift[p + e] = o[p];
|
1622
1622
|
return s.blkIndent = l, !0;
|
1623
1623
|
}
|
1624
1624
|
function tr(s, e, t, i) {
|
@@ -1671,55 +1671,55 @@ function nr(s, e, t, i) {
|
|
1671
1671
|
c,
|
1672
1672
|
d,
|
1673
1673
|
u,
|
1674
|
-
h,
|
1675
1674
|
p,
|
1675
|
+
h,
|
1676
1676
|
g,
|
1677
|
-
|
1678
|
-
_,
|
1677
|
+
f,
|
1679
1678
|
S,
|
1680
|
-
|
1681
|
-
A,
|
1679
|
+
w,
|
1682
1680
|
G,
|
1681
|
+
A,
|
1682
|
+
V,
|
1683
1683
|
X,
|
1684
1684
|
oe = !0,
|
1685
1685
|
Q,
|
1686
1686
|
N,
|
1687
1687
|
Be,
|
1688
1688
|
xi;
|
1689
|
-
if ((u = fn(s, e)) >= 0)
|
1689
|
+
if ((u = fn(s, e)) >= 0) S = !0;else if ((u = pn(s, e)) >= 0) S = !1;else return !1;
|
1690
1690
|
if (s.level >= s.options.maxNesting) return !1;
|
1691
|
-
if (
|
1692
|
-
for (
|
1691
|
+
if (f = s.src.charCodeAt(u - 1), i) return !0;
|
1692
|
+
for (G = s.tokens.length, S ? (d = s.bMarks[e] + s.tShift[e], g = Number(s.src.substr(d, u - d - 1)), s.tokens.push({
|
1693
1693
|
type: "ordered_list_open",
|
1694
1694
|
order: g,
|
1695
|
-
lines:
|
1695
|
+
lines: V = [e, 0],
|
1696
1696
|
level: s.level++
|
1697
1697
|
})) : s.tokens.push({
|
1698
1698
|
type: "bullet_list_open",
|
1699
|
-
lines:
|
1699
|
+
lines: V = [e, 0],
|
1700
1700
|
level: s.level++
|
1701
|
-
}), n = e, A = !1, Q = s.parser.ruler.getRules("list"); n < t && (
|
1701
|
+
}), n = e, A = !1, Q = s.parser.ruler.getRules("list"); n < t && (w = s.skipSpaces(u), p = s.eMarks[n], w >= p ? h = 1 : h = w - u, h > 4 && (h = 1), h < 1 && (h = 1), r = u - s.bMarks[n] + h, s.tokens.push({
|
1702
1702
|
type: "list_item_open",
|
1703
1703
|
lines: X = [e, 0],
|
1704
1704
|
level: s.level++
|
1705
|
-
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] =
|
1705
|
+
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = w - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || A) && (oe = !1), A = s.line - e > 1 && s.isEmpty(s.line - 1), s.blkIndent = a, s.tShift[e] = o, s.tight = l, s.parentType = c, s.tokens.push({
|
1706
1706
|
type: "list_item_close",
|
1707
1707
|
level: --s.level
|
1708
|
-
}), n = e = s.line, X[1] = n,
|
1708
|
+
}), n = e = s.line, X[1] = n, w = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1709
1709
|
for (xi = !1, N = 0, Be = Q.length; N < Be; N++) if (Q[N](s, n, t, !0)) {
|
1710
1710
|
xi = !0;
|
1711
1711
|
break;
|
1712
1712
|
}
|
1713
1713
|
if (xi) break;
|
1714
|
-
if (
|
1714
|
+
if (S) {
|
1715
1715
|
if (u = fn(s, n), u < 0) break;
|
1716
1716
|
} else if (u = pn(s, n), u < 0) break;
|
1717
|
-
if (
|
1717
|
+
if (f !== s.src.charCodeAt(u - 1)) break;
|
1718
1718
|
}
|
1719
1719
|
return s.tokens.push({
|
1720
|
-
type:
|
1720
|
+
type: S ? "ordered_list_close" : "bullet_list_close",
|
1721
1721
|
level: --s.level
|
1722
|
-
}),
|
1722
|
+
}), V[1] = n, s.line = n, oe && ir(s, G), !0;
|
1723
1723
|
}
|
1724
1724
|
function sr(s, e, t, i) {
|
1725
1725
|
var n,
|
@@ -1825,27 +1825,27 @@ function dr(s, e, t, i) {
|
|
1825
1825
|
content: s.getLines(e, o, 0, !0)
|
1826
1826
|
}), !0;
|
1827
1827
|
}
|
1828
|
-
function
|
1828
|
+
function _i(s, e) {
|
1829
1829
|
var t = s.bMarks[e] + s.blkIndent,
|
1830
1830
|
i = s.eMarks[e];
|
1831
1831
|
return s.src.substr(t, i - t);
|
1832
1832
|
}
|
1833
1833
|
function ur(s, e, t, i) {
|
1834
|
-
var n, r, o, a, l, c, d, u,
|
1835
|
-
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r =
|
1834
|
+
var n, r, o, a, l, c, d, u, p, h, g;
|
1835
|
+
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r = _i(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
1836
1836
|
for (u = [], a = 0; a < c.length; a++) {
|
1837
|
-
if (
|
1837
|
+
if (p = c[a].trim(), !p) {
|
1838
1838
|
if (a === 0 || a === c.length - 1) continue;
|
1839
1839
|
return !1;
|
1840
1840
|
}
|
1841
|
-
if (!/^:?-+:?$/.test(
|
1842
|
-
|
1841
|
+
if (!/^:?-+:?$/.test(p)) return !1;
|
1842
|
+
p.charCodeAt(p.length - 1) === 58 ? u.push(p.charCodeAt(0) === 58 ? "center" : "right") : p.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1843
1843
|
}
|
1844
|
-
if (r =
|
1844
|
+
if (r = _i(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1845
1845
|
if (i) return !0;
|
1846
1846
|
for (s.tokens.push({
|
1847
1847
|
type: "table_open",
|
1848
|
-
lines:
|
1848
|
+
lines: h = [e, 0],
|
1849
1849
|
level: s.level++
|
1850
1850
|
}), s.tokens.push({
|
1851
1851
|
type: "thead_open",
|
@@ -1880,7 +1880,7 @@ function ur(s, e, t, i) {
|
|
1880
1880
|
type: "tbody_open",
|
1881
1881
|
lines: g = [e + 2, 0],
|
1882
1882
|
level: s.level++
|
1883
|
-
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r =
|
1883
|
+
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r = _i(s, l).trim(), r.indexOf("|") === -1)); l++) {
|
1884
1884
|
for (c = r.replace(/^\||\|$/g, "").split("|"), s.tokens.push({
|
1885
1885
|
type: "tr_open",
|
1886
1886
|
level: s.level++
|
@@ -1908,7 +1908,7 @@ function ur(s, e, t, i) {
|
|
1908
1908
|
}), s.tokens.push({
|
1909
1909
|
type: "table_close",
|
1910
1910
|
level: --s.level
|
1911
|
-
}),
|
1911
|
+
}), h[1] = g[1] = l, s.line = l, !0;
|
1912
1912
|
}
|
1913
1913
|
function It(s, e) {
|
1914
1914
|
var t,
|
@@ -1924,7 +1924,7 @@ function hr(s, e) {
|
|
1924
1924
|
for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
|
1925
1925
|
}
|
1926
1926
|
function pr(s, e, t, i) {
|
1927
|
-
var n, r, o, a, l, c, d, u,
|
1927
|
+
var n, r, o, a, l, c, d, u, p, h, g, f, S, w;
|
1928
1928
|
if (i) return s.ddIndent < 0 ? !1 : It(s, e) >= 0;
|
1929
1929
|
if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = It(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
|
1930
1930
|
c = s.tokens.length, s.tokens.push({
|
@@ -1933,7 +1933,7 @@ function pr(s, e, t, i) {
|
|
1933
1933
|
level: s.level++
|
1934
1934
|
}), o = e, r = d;
|
1935
1935
|
e: for (;;) {
|
1936
|
-
for (
|
1936
|
+
for (w = !0, S = !1, s.tokens.push({
|
1937
1937
|
type: "dt_open",
|
1938
1938
|
lines: [o, o],
|
1939
1939
|
level: s.level++
|
@@ -1951,7 +1951,7 @@ function pr(s, e, t, i) {
|
|
1951
1951
|
type: "dd_open",
|
1952
1952
|
lines: a = [d, 0],
|
1953
1953
|
level: s.level++
|
1954
|
-
}),
|
1954
|
+
}), f = s.tight, p = s.ddIndent, u = s.blkIndent, g = s.tShift[r], h = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || S) && (w = !1), S = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = g, s.tight = f, s.parentType = h, s.blkIndent = u, s.ddIndent = p, s.tokens.push({
|
1955
1955
|
type: "dd_close",
|
1956
1956
|
level: --s.level
|
1957
1957
|
}), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
|
@@ -1963,7 +1963,7 @@ function pr(s, e, t, i) {
|
|
1963
1963
|
return s.tokens.push({
|
1964
1964
|
type: "dl_close",
|
1965
1965
|
level: --s.level
|
1966
|
-
}), l[1] = d, s.line = d,
|
1966
|
+
}), l[1] = d, s.line = d, w && hr(s, c), !0;
|
1967
1967
|
}
|
1968
1968
|
function fr(s, e) {
|
1969
1969
|
var t,
|
@@ -2000,13 +2000,13 @@ function fr(s, e) {
|
|
2000
2000
|
})), !0;
|
2001
2001
|
}
|
2002
2002
|
var Lt = [["code", Xs], ["fences", Qs, ["paragraph", "blockquote", "list"]], ["blockquote", er, ["paragraph", "blockquote", "list"]], ["hr", tr, ["paragraph", "blockquote", "list"]], ["list", nr, ["paragraph", "blockquote"]], ["footnote", sr, ["paragraph"]], ["heading", rr, ["paragraph", "blockquote"]], ["lheading", or], ["htmlblock", dr, ["paragraph", "blockquote"]], ["table", ur, ["paragraph"]], ["deflist", pr, ["paragraph"]], ["paragraph", fr]];
|
2003
|
-
function
|
2003
|
+
function Vi() {
|
2004
2004
|
this.ruler = new H();
|
2005
2005
|
for (var s = 0; s < Lt.length; s++) this.ruler.push(Lt[s][0], Lt[s][1], {
|
2006
2006
|
alt: (Lt[s][2] || []).slice()
|
2007
2007
|
});
|
2008
2008
|
}
|
2009
|
-
|
2009
|
+
Vi.prototype.tokenize = function (s, e, t) {
|
2010
2010
|
for (var i = this.ruler.getRules(""), n = i.length, r = e, o = !1, a, l; r < t && (s.line = r = s.skipEmptyLines(r), !(r >= t || s.tShift[r] < s.blkIndent));) {
|
2011
2011
|
for (l = 0; l < n && (a = i[l](s, r, t, !1), !a); l++);
|
2012
2012
|
if (s.tight = !o, s.isEmpty(s.line - 1) && (o = !0), r = s.line, r < t && s.isEmpty(r)) {
|
@@ -2018,7 +2018,7 @@ Gi.prototype.tokenize = function (s, e, t) {
|
|
2018
2018
|
var mr = /[\n\t]/g,
|
2019
2019
|
gr = /\r[\n\u0085]|[\u2424\u2028\u0085]/g,
|
2020
2020
|
br = /\u00a0/g;
|
2021
|
-
|
2021
|
+
Vi.prototype.parse = function (s, e, t, i) {
|
2022
2022
|
var n,
|
2023
2023
|
r = 0,
|
2024
2024
|
o = 0;
|
@@ -2108,7 +2108,7 @@ function Er(s, e) {
|
|
2108
2108
|
}
|
2109
2109
|
return e || (s.pending += "\\"), s.pos++, !0;
|
2110
2110
|
}
|
2111
|
-
function
|
2111
|
+
function Sr(s, e) {
|
2112
2112
|
var t,
|
2113
2113
|
i,
|
2114
2114
|
n,
|
@@ -2129,7 +2129,7 @@ function _r(s, e) {
|
|
2129
2129
|
}
|
2130
2130
|
return e || (s.pending += n), s.pos += n.length, !0;
|
2131
2131
|
}
|
2132
|
-
function
|
2132
|
+
function wr(s, e) {
|
2133
2133
|
var t,
|
2134
2134
|
i,
|
2135
2135
|
n,
|
@@ -2155,7 +2155,7 @@ function Sr(s, e) {
|
|
2155
2155
|
level: --s.level
|
2156
2156
|
})), s.pos = s.posMax + 2, s.posMax = r, !0) : (s.pos = o, !1);
|
2157
2157
|
}
|
2158
|
-
function
|
2158
|
+
function _r(s, e) {
|
2159
2159
|
var t,
|
2160
2160
|
i,
|
2161
2161
|
n,
|
@@ -2328,21 +2328,21 @@ function Lr(s, e) {
|
|
2328
2328
|
c,
|
2329
2329
|
d = !1,
|
2330
2330
|
u = s.pos,
|
2331
|
-
|
2332
|
-
|
2333
|
-
g = s.src.charCodeAt(
|
2334
|
-
if (g === 33 && (d = !0, g = s.src.charCodeAt(++
|
2335
|
-
if (a = i + 1, a <
|
2336
|
-
for (a++; a <
|
2337
|
-
if (a >=
|
2338
|
-
for (
|
2339
|
-
if (a <
|
2340
|
-
if (a >=
|
2331
|
+
p = s.posMax,
|
2332
|
+
h = s.pos,
|
2333
|
+
g = s.src.charCodeAt(h);
|
2334
|
+
if (g === 33 && (d = !0, g = s.src.charCodeAt(++h)), g !== 91 || s.level >= s.options.maxNesting || (t = h + 1, i = mt(s, h), i < 0)) return !1;
|
2335
|
+
if (a = i + 1, a < p && s.src.charCodeAt(a) === 40) {
|
2336
|
+
for (a++; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2337
|
+
if (a >= p) return !1;
|
2338
|
+
for (h = a, Yn(s, a) ? (r = s.linkContent, a = s.pos) : r = "", h = a; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2339
|
+
if (a < p && h !== a && Zn(s, a)) for (o = s.linkContent, a = s.pos; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);else o = "";
|
2340
|
+
if (a >= p || s.src.charCodeAt(a) !== 41) return s.pos = u, !1;
|
2341
2341
|
a++;
|
2342
2342
|
} else {
|
2343
2343
|
if (s.linkLevel > 0) return !1;
|
2344
|
-
for (; a <
|
2345
|
-
if (a <
|
2344
|
+
for (; a < p && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
|
2345
|
+
if (a < p && s.src.charCodeAt(a) === 91 && (h = a + 1, a = mt(s, a), a >= 0 ? n = s.src.slice(h, a++) : a = h - 1), n || (_typeof(n) > "u" && (a = i + 1), n = s.src.slice(t, i)), l = s.env.references[Xn(n)], !l) return s.pos = u, !1;
|
2346
2346
|
r = l.href, o = l.title;
|
2347
2347
|
}
|
2348
2348
|
return e || (s.pos = t, s.posMax = i, d ? s.push({
|
@@ -2359,7 +2359,7 @@ function Lr(s, e) {
|
|
2359
2359
|
}), s.linkLevel++, s.parser.tokenize(s), s.linkLevel--, s.push({
|
2360
2360
|
type: "link_close",
|
2361
2361
|
level: --s.level
|
2362
|
-
}))), s.pos = a, s.posMax =
|
2362
|
+
}))), s.pos = a, s.posMax = p, !0;
|
2363
2363
|
}
|
2364
2364
|
function Rr(s, e) {
|
2365
2365
|
var t,
|
@@ -2440,16 +2440,16 @@ function ti(s, e) {
|
|
2440
2440
|
var Fr = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
2441
2441
|
Br = /[^"'=<>`\x00-\x20]+/,
|
2442
2442
|
zr = /'[^']*'/,
|
2443
|
-
|
2444
|
-
|
2445
|
-
Hr = ti(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Fr)("attr_value",
|
2446
|
-
|
2447
|
-
|
2443
|
+
Ur = /"[^"]*"/,
|
2444
|
+
qr = ti(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", Br)("single_quoted", zr)("double_quoted", Ur)(),
|
2445
|
+
Hr = ti(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Fr)("attr_value", qr)(),
|
2446
|
+
Gr = ti(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", Hr)(),
|
2447
|
+
Vr = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
2448
2448
|
Wr = /<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,
|
2449
2449
|
Kr = /<[?].*?[?]>/,
|
2450
2450
|
Jr = /<![A-Z]+\s+[^>]*>/,
|
2451
2451
|
$r = /<!\[CDATA\[[\s\S]*?\]\]>/,
|
2452
|
-
Yr = ti(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",
|
2452
|
+
Yr = ti(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag", Gr)("close_tag", Vr)("comment", Wr)("processing", Kr)("declaration", Jr)("cdata", $r)();
|
2453
2453
|
function Zr(s) {
|
2454
2454
|
var e = s | 32;
|
2455
2455
|
return e >= 97 && e <= 122;
|
@@ -2484,7 +2484,7 @@ function to(s, e) {
|
|
2484
2484
|
}
|
2485
2485
|
return e || (s.pending += "&"), s.pos++, !0;
|
2486
2486
|
}
|
2487
|
-
var Mi = [["text", yr], ["newline", xr], ["escape", Er], ["backticks",
|
2487
|
+
var Mi = [["text", yr], ["newline", xr], ["escape", Er], ["backticks", Sr], ["del", wr], ["ins", _r], ["mark", Mr], ["emphasis", Tr], ["sub", Ar], ["sup", Ir], ["links", Lr], ["footnote_inline", Rr], ["footnote_ref", Or], ["autolink", jr], ["htmltag", Xr], ["entity", to]];
|
2488
2488
|
function ii() {
|
2489
2489
|
this.ruler = new H();
|
2490
2490
|
for (var s = 0; s < Mi.length; s++) this.ruler.push(Mi[s][0], Mi[s][1]);
|
@@ -2644,7 +2644,7 @@ function ts(s, e, t) {
|
|
2644
2644
|
this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
|
2645
2645
|
}
|
2646
2646
|
function he(s, e) {
|
2647
|
-
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new ii(), this.block = new
|
2647
|
+
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new ii(), this.block = new Vi(), this.core = new Qn(), this.renderer = new Gi(), this.ruler = new H(), this.options = {}, this.configure(oo[s]), this.set(e || {});
|
2648
2648
|
}
|
2649
2649
|
he.prototype.set = function (s) {
|
2650
2650
|
Kn(this.options, s);
|
@@ -2921,11 +2921,11 @@ var ce = /*#__PURE__*/function () {
|
|
2921
2921
|
}]);
|
2922
2922
|
return ce;
|
2923
2923
|
}();
|
2924
|
-
var
|
2925
|
-
function
|
2926
|
-
_classCallCheck(this,
|
2924
|
+
var Ve = /*#__PURE__*/function () {
|
2925
|
+
function Ve() {
|
2926
|
+
_classCallCheck(this, Ve);
|
2927
2927
|
}
|
2928
|
-
_createClass(
|
2928
|
+
_createClass(Ve, null, [{
|
2929
2929
|
key: "getPosition",
|
2930
2930
|
value: function getPosition(e, t) {
|
2931
2931
|
var _i5, _i6, _i7;
|
@@ -2949,18 +2949,18 @@ var Ge = /*#__PURE__*/function () {
|
|
2949
2949
|
key: "createName",
|
2950
2950
|
value: function createName(e, t) {
|
2951
2951
|
var i = document.createElement("div");
|
2952
|
-
return i.classList.add("name"), i.textContent =
|
2952
|
+
return i.classList.add("name"), i.textContent = Ve.getNameText(e, t), Ve.applyStyle(i, e, t), i;
|
2953
2953
|
}
|
2954
2954
|
}, {
|
2955
2955
|
key: "add",
|
2956
2956
|
value: function add(e, t, i) {
|
2957
2957
|
var n = typeof i == "boolean" ? {} : i,
|
2958
|
-
r =
|
2959
|
-
o =
|
2958
|
+
r = Ve.createName(t, n),
|
2959
|
+
o = Ve.getPosition(t, n);
|
2960
2960
|
r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
|
2961
2961
|
}
|
2962
2962
|
}]);
|
2963
|
-
return
|
2963
|
+
return Ve;
|
2964
2964
|
}();
|
2965
2965
|
var Ke = /*#__PURE__*/function () {
|
2966
2966
|
function Ke(e) {
|
@@ -3023,7 +3023,7 @@ var Ke = /*#__PURE__*/function () {
|
|
3023
3023
|
value:
|
3024
3024
|
// prettier-ignore
|
3025
3025
|
function addInnerContainerElements(e, t, i) {
|
3026
|
-
return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ce.add(e, i, this._avatars), this._names &&
|
3026
|
+
return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ce.add(e, i, this._avatars), this._names && Ve.add(e, i, this._names), {
|
3027
3027
|
bubbleElement: e
|
3028
3028
|
};
|
3029
3029
|
}
|
@@ -3411,24 +3411,24 @@ function go(s, e) {
|
|
3411
3411
|
l = e.openWhenHidden,
|
3412
3412
|
c = e.fetch,
|
3413
3413
|
d = fo(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
3414
|
-
return new Promise(function (u,
|
3415
|
-
var
|
3416
|
-
|
3414
|
+
return new Promise(function (u, p) {
|
3415
|
+
var h = Object.assign({}, i);
|
3416
|
+
h.accept || (h.accept = Di);
|
3417
3417
|
var g;
|
3418
|
-
function
|
3418
|
+
function f() {
|
3419
3419
|
g.abort(), document.hidden || X();
|
3420
3420
|
}
|
3421
|
-
l || document.addEventListener("visibilitychange",
|
3422
|
-
var
|
3423
|
-
|
3424
|
-
function
|
3425
|
-
document.removeEventListener("visibilitychange",
|
3421
|
+
l || document.addEventListener("visibilitychange", f);
|
3422
|
+
var S = mo,
|
3423
|
+
w = 0;
|
3424
|
+
function G() {
|
3425
|
+
document.removeEventListener("visibilitychange", f), window.clearTimeout(w), g.abort();
|
3426
3426
|
}
|
3427
3427
|
t == null || t.addEventListener("abort", function () {
|
3428
|
-
|
3428
|
+
G(), u();
|
3429
3429
|
});
|
3430
3430
|
var A = c !== null && c !== void 0 ? c : window.fetch,
|
3431
|
-
|
3431
|
+
V = n !== null && n !== void 0 ? n : bo;
|
3432
3432
|
function X() {
|
3433
3433
|
return _X.apply(this, arguments);
|
3434
3434
|
}
|
@@ -3442,23 +3442,23 @@ function go(s, e) {
|
|
3442
3442
|
_context3.prev = 1;
|
3443
3443
|
_context3.next = 4;
|
3444
3444
|
return A(s, Object.assign(Object.assign({}, d), {
|
3445
|
-
headers:
|
3445
|
+
headers: h,
|
3446
3446
|
signal: g.signal
|
3447
3447
|
}));
|
3448
3448
|
case 4:
|
3449
3449
|
Q = _context3.sent;
|
3450
3450
|
_context3.next = 7;
|
3451
|
-
return
|
3451
|
+
return V(Q);
|
3452
3452
|
case 7:
|
3453
3453
|
_context3.next = 9;
|
3454
3454
|
return co(Q.body, uo(ho(function (N) {
|
3455
|
-
N ?
|
3455
|
+
N ? h[yn] = N : delete h[yn];
|
3456
3456
|
}, function (N) {
|
3457
|
-
|
3457
|
+
S = N;
|
3458
3458
|
}, r)));
|
3459
3459
|
case 9:
|
3460
3460
|
o == null || o();
|
3461
|
-
|
3461
|
+
G();
|
3462
3462
|
u();
|
3463
3463
|
_context3.next = 17;
|
3464
3464
|
break;
|
@@ -3466,10 +3466,10 @@ function go(s, e) {
|
|
3466
3466
|
_context3.prev = 14;
|
3467
3467
|
_context3.t0 = _context3["catch"](1);
|
3468
3468
|
if (!g.signal.aborted) try {
|
3469
|
-
N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe :
|
3470
|
-
window.clearTimeout(
|
3469
|
+
N = (oe = a == null ? void 0 : a(_context3.t0)) !== null && oe !== void 0 ? oe : S;
|
3470
|
+
window.clearTimeout(w), w = window.setTimeout(X, N);
|
3471
3471
|
} catch (N) {
|
3472
|
-
|
3472
|
+
G(), p(N);
|
3473
3473
|
}
|
3474
3474
|
case 17:
|
3475
3475
|
case "end":
|
@@ -3570,12 +3570,12 @@ var I = /*#__PURE__*/function () {
|
|
3570
3570
|
function () {
|
3571
3571
|
var _request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(e, t, i) {
|
3572
3572
|
var n,
|
3573
|
-
|
3573
|
+
h,
|
3574
3574
|
g,
|
3575
|
-
|
3576
|
-
_,
|
3575
|
+
f,
|
3577
3576
|
S,
|
3578
|
-
|
3577
|
+
w,
|
3578
|
+
G,
|
3579
3579
|
r,
|
3580
3580
|
_yield$E$processReque,
|
3581
3581
|
o,
|
@@ -3585,7 +3585,7 @@ var I = /*#__PURE__*/function () {
|
|
3585
3585
|
c,
|
3586
3586
|
d,
|
3587
3587
|
u,
|
3588
|
-
|
3588
|
+
p,
|
3589
3589
|
_args7 = arguments;
|
3590
3590
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
3591
3591
|
while (1) switch (_context7.prev = _context7.next) {
|
@@ -3593,7 +3593,7 @@ var I = /*#__PURE__*/function () {
|
|
3593
3593
|
n = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : !0;
|
3594
3594
|
r = {
|
3595
3595
|
body: t,
|
3596
|
-
headers: (
|
3596
|
+
headers: (h = e.requestSettings) == null ? void 0 : h.headers
|
3597
3597
|
};
|
3598
3598
|
_context7.next = 4;
|
3599
3599
|
return E.processRequestInterceptor(e.deepChat, r);
|
@@ -3618,17 +3618,17 @@ var I = /*#__PURE__*/function () {
|
|
3618
3618
|
}
|
3619
3619
|
return _context7.abrupt("return", Ae.stream(e, o, i));
|
3620
3620
|
case 16:
|
3621
|
-
if (!(((
|
3621
|
+
if (!(((f = e.requestSettings) == null ? void 0 : f.url) === ve.URL)) {
|
3622
3622
|
_context7.next = 18;
|
3623
3623
|
break;
|
3624
3624
|
}
|
3625
3625
|
return _context7.abrupt("return", ve.requestStream(i, e.streamHandlers));
|
3626
3626
|
case 18:
|
3627
|
-
|
3628
|
-
go(((
|
3629
|
-
method: ((
|
3627
|
+
p = new Ze(i);
|
3628
|
+
go(((S = e.requestSettings) == null ? void 0 : S.url) || e.url || "", {
|
3629
|
+
method: ((w = e.requestSettings) == null ? void 0 : w.method) || "POST",
|
3630
3630
|
headers: a,
|
3631
|
-
credentials: (
|
3631
|
+
credentials: (G = e.requestSettings) == null ? void 0 : G.credentials,
|
3632
3632
|
body: n ? JSON.stringify(o) : o,
|
3633
3633
|
openWhenHidden: !0,
|
3634
3634
|
// keep stream open when browser tab not open
|
@@ -3656,7 +3656,7 @@ var I = /*#__PURE__*/function () {
|
|
3656
3656
|
},
|
3657
3657
|
onmessage: function onmessage(A) {
|
3658
3658
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
3659
|
-
var
|
3659
|
+
var V, X, oe, Q, N;
|
3660
3660
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3661
3661
|
while (1) switch (_context6.prev = _context6.next) {
|
3662
3662
|
case 0:
|
@@ -3666,7 +3666,7 @@ var I = /*#__PURE__*/function () {
|
|
3666
3666
|
}
|
3667
3667
|
Q = JSON.parse(A.data);
|
3668
3668
|
_context6.next = 4;
|
3669
|
-
return (X = (
|
3669
|
+
return (X = (V = e.deepChat).responseInterceptor) == null ? void 0 : X.call(V, Q);
|
3670
3670
|
case 4:
|
3671
3671
|
_context6.t0 = _context6.sent;
|
3672
3672
|
if (_context6.t0) {
|
@@ -3677,7 +3677,7 @@ var I = /*#__PURE__*/function () {
|
|
3677
3677
|
case 7:
|
3678
3678
|
N = _context6.t0;
|
3679
3679
|
(oe = e.extractResultData) == null || oe.call(e, N).then(function (Be) {
|
3680
|
-
|
3680
|
+
p.upsertStreamedMessage(Be);
|
3681
3681
|
})["catch"](function (Be) {
|
3682
3682
|
return E.displayError(i, Be);
|
3683
3683
|
});
|
@@ -3692,12 +3692,12 @@ var I = /*#__PURE__*/function () {
|
|
3692
3692
|
throw d(), A;
|
3693
3693
|
},
|
3694
3694
|
onclose: function onclose() {
|
3695
|
-
|
3695
|
+
p.finaliseStreamedMessage(), d();
|
3696
3696
|
},
|
3697
3697
|
signal: u.signal
|
3698
3698
|
})["catch"](function (A) {
|
3699
|
-
var
|
3700
|
-
(
|
3699
|
+
var V;
|
3700
|
+
(V = e.extractResultData) == null || V.call(e, A).then(function () {
|
3701
3701
|
E.displayError(i, A);
|
3702
3702
|
})["catch"](function (X) {
|
3703
3703
|
E.displayError(i, X);
|
@@ -3772,7 +3772,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3772
3772
|
n = !0;
|
3773
3773
|
r = /*#__PURE__*/function () {
|
3774
3774
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(c) {
|
3775
|
-
var u,
|
3775
|
+
var u, p, d;
|
3776
3776
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
3777
3777
|
while (1) switch (_context8.prev = _context8.next) {
|
3778
3778
|
case 0:
|
@@ -3784,7 +3784,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3784
3784
|
case 2:
|
3785
3785
|
n = !1;
|
3786
3786
|
_context8.next = 5;
|
3787
|
-
return (
|
3787
|
+
return (p = (u = e.deepChat).responseInterceptor) == null ? void 0 : p.call(u, c);
|
3788
3788
|
case 5:
|
3789
3789
|
_context8.t0 = _context8.sent;
|
3790
3790
|
if (_context8.t0) {
|
@@ -3822,7 +3822,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3822
3822
|
}, {
|
3823
3823
|
key: "stream",
|
3824
3824
|
value: function stream(e, t, i) {
|
3825
|
-
var u,
|
3825
|
+
var u, p;
|
3826
3826
|
var n = !0,
|
3827
3827
|
r = !1;
|
3828
3828
|
var o = new Ze(i),
|
@@ -3832,14 +3832,14 @@ var Ae = /*#__PURE__*/function () {
|
|
3832
3832
|
l = function l() {
|
3833
3833
|
n && (o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1);
|
3834
3834
|
},
|
3835
|
-
c = function c(
|
3836
|
-
n && (!
|
3835
|
+
c = function c(h) {
|
3836
|
+
n && (!h || _typeof(h) != "object" || typeof h.error != "string" && typeof h.html != "string" && typeof h.text != "string" ? console.error(C.INVALID_RESPONSE(h, "server", !1)) : h.error ? (console.error(h.error), o.finaliseStreamedMessage(), e.streamHandlers.onClose(), i.addNewErrorMessage("service", h.error), n = !1) : o.upsertStreamedMessage(h));
|
3837
3837
|
};
|
3838
3838
|
e.streamHandlers.abortStream.abort = function () {
|
3839
3839
|
o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1;
|
3840
3840
|
};
|
3841
3841
|
var d = Ae.generateOptionalSignals();
|
3842
|
-
(
|
3842
|
+
(p = (u = e.requestSettings).handler) == null || p.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
3843
3843
|
onOpen: a,
|
3844
3844
|
onResponse: c,
|
3845
3845
|
onClose: l,
|
@@ -3866,7 +3866,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3866
3866
|
},
|
3867
3867
|
o = /*#__PURE__*/function () {
|
3868
3868
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(d) {
|
3869
|
-
var
|
3869
|
+
var p, h, u;
|
3870
3870
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
3871
3871
|
while (1) switch (_context10.prev = _context10.next) {
|
3872
3872
|
case 0:
|
@@ -3877,7 +3877,7 @@ var Ae = /*#__PURE__*/function () {
|
|
3877
3877
|
return _context10.abrupt("return");
|
3878
3878
|
case 2:
|
3879
3879
|
_context10.next = 4;
|
3880
|
-
return (
|
3880
|
+
return (h = (p = e.deepChat).responseInterceptor) == null ? void 0 : h.call(p, d);
|
3881
3881
|
case 4:
|
3882
3882
|
_context10.t0 = _context10.sent;
|
3883
3883
|
if (_context10.t0) {
|
@@ -3923,18 +3923,18 @@ var Ae = /*#__PURE__*/function () {
|
|
3923
3923
|
}]);
|
3924
3924
|
return Ae;
|
3925
3925
|
}();
|
3926
|
-
var
|
3927
|
-
function
|
3928
|
-
_classCallCheck(this,
|
3926
|
+
var _ = /*#__PURE__*/function () {
|
3927
|
+
function _() {
|
3928
|
+
_classCallCheck(this, _);
|
3929
3929
|
}
|
3930
|
-
_createClass(
|
3930
|
+
_createClass(_, null, [{
|
3931
3931
|
key: "request",
|
3932
3932
|
value: // prettier-ignore
|
3933
3933
|
function () {
|
3934
3934
|
var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e, t, i) {
|
3935
3935
|
var n,
|
3936
|
-
h,
|
3937
3936
|
p,
|
3937
|
+
h,
|
3938
3938
|
g,
|
3939
3939
|
r,
|
3940
3940
|
_yield$E$processReque2,
|
@@ -3951,7 +3951,7 @@ var w = /*#__PURE__*/function () {
|
|
3951
3951
|
n = _args12.length > 3 && _args12[3] !== undefined ? _args12[3] : !0;
|
3952
3952
|
r = {
|
3953
3953
|
body: t,
|
3954
|
-
headers: (
|
3954
|
+
headers: (p = e.requestSettings) == null ? void 0 : p.headers
|
3955
3955
|
};
|
3956
3956
|
_context12.next = 4;
|
3957
3957
|
return E.processRequestInterceptor(e.deepChat, r);
|
@@ -3967,7 +3967,7 @@ var w = /*#__PURE__*/function () {
|
|
3967
3967
|
}
|
3968
3968
|
return _context12.abrupt("return", E.onInterceptorError(i, l, c));
|
3969
3969
|
case 11:
|
3970
|
-
if (!((
|
3970
|
+
if (!((h = e.requestSettings) != null && h.handler)) {
|
3971
3971
|
_context12.next = 13;
|
3972
3972
|
break;
|
3973
3973
|
}
|
@@ -3981,13 +3981,13 @@ var w = /*#__PURE__*/function () {
|
|
3981
3981
|
case 15:
|
3982
3982
|
d = !0;
|
3983
3983
|
u = E.fetch.bind(this, e, a, n);
|
3984
|
-
u(o).then(function (
|
3985
|
-
return d = !!
|
3986
|
-
}).then(function (
|
3987
|
-
return E.processResponseByType(
|
3984
|
+
u(o).then(function (f) {
|
3985
|
+
return d = !!f.ok, f;
|
3986
|
+
}).then(function (f) {
|
3987
|
+
return E.processResponseByType(f);
|
3988
3988
|
}).then( /*#__PURE__*/function () {
|
3989
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(
|
3990
|
-
var
|
3989
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(f) {
|
3990
|
+
var G, A, S, w;
|
3991
3991
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
3992
3992
|
while (1) switch (_context11.prev = _context11.next) {
|
3993
3993
|
case 0:
|
@@ -3998,33 +3998,33 @@ var w = /*#__PURE__*/function () {
|
|
3998
3998
|
return _context11.abrupt("return");
|
3999
3999
|
case 2:
|
4000
4000
|
_context11.next = 4;
|
4001
|
-
return (A = (
|
4001
|
+
return (A = (G = e.deepChat).responseInterceptor) == null ? void 0 : A.call(G, f);
|
4002
4002
|
case 4:
|
4003
4003
|
_context11.t0 = _context11.sent;
|
4004
4004
|
if (_context11.t0) {
|
4005
4005
|
_context11.next = 7;
|
4006
4006
|
break;
|
4007
4007
|
}
|
4008
|
-
_context11.t0 =
|
4008
|
+
_context11.t0 = f;
|
4009
4009
|
case 7:
|
4010
|
-
|
4010
|
+
S = _context11.t0;
|
4011
4011
|
_context11.next = 10;
|
4012
|
-
return e.extractResultData(
|
4012
|
+
return e.extractResultData(S, u, o);
|
4013
4013
|
case 10:
|
4014
|
-
|
4014
|
+
w = _context11.sent;
|
4015
4015
|
if (d) {
|
4016
4016
|
_context11.next = 13;
|
4017
4017
|
break;
|
4018
4018
|
}
|
4019
|
-
throw
|
4019
|
+
throw f;
|
4020
4020
|
case 13:
|
4021
|
-
if (!(!
|
4021
|
+
if (!(!w || _typeof(w) != "object")) {
|
4022
4022
|
_context11.next = 15;
|
4023
4023
|
break;
|
4024
4024
|
}
|
4025
|
-
throw Error(C.INVALID_RESPONSE(
|
4025
|
+
throw Error(C.INVALID_RESPONSE(f, "response", !!e.deepChat.responseInterceptor, S));
|
4026
4026
|
case 15:
|
4027
|
-
|
4027
|
+
w.makingAnotherRequest || (I.isSimulation(e.deepChat.stream) ? I.simulate(i, e.streamHandlers, w) : (i.addNewMessage(w), c()));
|
4028
4028
|
case 16:
|
4029
4029
|
case "end":
|
4030
4030
|
return _context11.stop();
|
@@ -4034,8 +4034,8 @@ var w = /*#__PURE__*/function () {
|
|
4034
4034
|
return function (_x23) {
|
4035
4035
|
return _ref4.apply(this, arguments);
|
4036
4036
|
};
|
4037
|
-
}())["catch"](function (
|
4038
|
-
E.displayError(i,
|
4037
|
+
}())["catch"](function (f) {
|
4038
|
+
E.displayError(i, f), c();
|
4039
4039
|
});
|
4040
4040
|
case 18:
|
4041
4041
|
case "end":
|
@@ -4083,7 +4083,7 @@ var w = /*#__PURE__*/function () {
|
|
4083
4083
|
case 11:
|
4084
4084
|
a = _context13.sent;
|
4085
4085
|
a.timeoutMS ? setTimeout(function () {
|
4086
|
-
|
4086
|
+
_.executePollRequest(e, t, i, n);
|
4087
4087
|
}, a.timeoutMS) : I.isSimulation(e.deepChat.stream) ? I.simulate(n, e.streamHandlers, a) : (n.addNewMessage(a), r());
|
4088
4088
|
case 13:
|
4089
4089
|
case "end":
|
@@ -4104,9 +4104,9 @@ var w = /*#__PURE__*/function () {
|
|
4104
4104
|
value: function () {
|
4105
4105
|
var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(e, t, i) {
|
4106
4106
|
var n,
|
4107
|
-
|
4107
|
+
h,
|
4108
4108
|
g,
|
4109
|
-
|
4109
|
+
f,
|
4110
4110
|
r,
|
4111
4111
|
_yield$E$processReque3,
|
4112
4112
|
o,
|
@@ -4115,7 +4115,7 @@ var w = /*#__PURE__*/function () {
|
|
4115
4115
|
c,
|
4116
4116
|
d,
|
4117
4117
|
u,
|
4118
|
-
|
4118
|
+
p,
|
4119
4119
|
_args14 = arguments;
|
4120
4120
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
4121
4121
|
while (1) switch (_context14.prev = _context14.next) {
|
@@ -4123,7 +4123,7 @@ var w = /*#__PURE__*/function () {
|
|
4123
4123
|
n = _args14.length > 3 && _args14[3] !== undefined ? _args14[3] : !0;
|
4124
4124
|
r = {
|
4125
4125
|
body: t,
|
4126
|
-
headers: (
|
4126
|
+
headers: (h = e.requestSettings) == null ? void 0 : h.headers
|
4127
4127
|
};
|
4128
4128
|
_context14.next = 4;
|
4129
4129
|
return E.processRequestInterceptor(e.deepChat, r);
|
@@ -4138,12 +4138,12 @@ var w = /*#__PURE__*/function () {
|
|
4138
4138
|
}
|
4139
4139
|
return _context14.abrupt("return", E.onInterceptorError(i, l));
|
4140
4140
|
case 10:
|
4141
|
-
c = ((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", d = ((
|
4141
|
+
c = ((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", d = ((f = e.requestSettings) == null ? void 0 : f.method) || "POST", u = n ? JSON.stringify(o) : o, p = {
|
4142
4142
|
method: d,
|
4143
4143
|
body: u,
|
4144
4144
|
headers: a
|
4145
4145
|
};
|
4146
|
-
e.requestSettings.credentials && (
|
4146
|
+
e.requestSettings.credentials && (p.credentials = e.requestSettings.credentials), _.executePollRequest(e, c, p, i);
|
4147
4147
|
case 12:
|
4148
4148
|
case "end":
|
4149
4149
|
return _context14.stop();
|
@@ -4172,7 +4172,7 @@ var w = /*#__PURE__*/function () {
|
|
4172
4172
|
});
|
4173
4173
|
}
|
4174
4174
|
}]);
|
4175
|
-
return
|
4175
|
+
return _;
|
4176
4176
|
}();
|
4177
4177
|
var Xe = /*#__PURE__*/function () {
|
4178
4178
|
function Xe() {
|
@@ -4426,12 +4426,12 @@ var L = /*#__PURE__*/function () {
|
|
4426
4426
|
}, {
|
4427
4427
|
key: "processMicrophone",
|
4428
4428
|
value: function processMicrophone(e, t, i, n) {
|
4429
|
-
var _l$files,
|
4430
|
-
var a, l, c, d, u,
|
4429
|
+
var _l$files, _p$maxNumberOfFiles;
|
4430
|
+
var a, l, c, d, u, p;
|
4431
4431
|
var o = _objectSpread({
|
4432
4432
|
acceptedFormats: "audio/*"
|
4433
4433
|
}, ((a = e.fileTypes.audio) == null ? void 0 : a.files) || {});
|
4434
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((
|
4434
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = L.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((_p$maxNumberOfFiles = (p = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _p$maxNumberOfFiles !== void 0 ? _p$maxNumberOfFiles : p.maxNumberOfFiles = i.files.maxNumberOfFiles))) : n || (e.fileTypes.audio = L.parseConfig(e.requestSettings, o, t, i)));
|
4435
4435
|
}
|
4436
4436
|
// prettier-ignore
|
4437
4437
|
}, {
|
@@ -4526,7 +4526,7 @@ var Le = /*#__PURE__*/function () {
|
|
4526
4526
|
case 0:
|
4527
4527
|
i = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : !0;
|
4528
4528
|
n = this.deepChat.stream;
|
4529
|
-
return _context17.abrupt("return", n && !I.isSimulation(n) ? I.request(this, e, t) :
|
4529
|
+
return _context17.abrupt("return", n && !I.isSimulation(n) ? I.request(this, e, t) : _.request(this, e, t, i));
|
4530
4530
|
case 3:
|
4531
4531
|
case "end":
|
4532
4532
|
return _context17.stop();
|
@@ -4712,18 +4712,18 @@ var Le = /*#__PURE__*/function () {
|
|
4712
4712
|
}]);
|
4713
4713
|
return Le;
|
4714
4714
|
}();
|
4715
|
-
var
|
4716
|
-
_inherits(
|
4717
|
-
var _super = _createSuper(
|
4715
|
+
var U = /*#__PURE__*/function (_Le) {
|
4716
|
+
_inherits(U, _Le);
|
4717
|
+
var _super = _createSuper(U);
|
4718
4718
|
// prettier-ignore
|
4719
|
-
function
|
4719
|
+
function U(e, t, i, n, r) {
|
4720
4720
|
var _this6;
|
4721
|
-
_classCallCheck(this,
|
4721
|
+
_classCallCheck(this, U);
|
4722
4722
|
var o;
|
4723
4723
|
_this6 = _super.call(this, e, r), _this6.insertKeyPlaceholderText = "API Key", _this6.getKeyLink = "", Object.assign(_this6.rawBody, (o = e.request) == null ? void 0 : o.additionalBodyProps), _this6.keyVerificationDetails = t, _this6.buildHeadersFunc = i, n && _this6.setApiKeyProperties(n), _this6.requestSettings = _this6.buildRequestSettings(_this6.key || "", e.request);
|
4724
4724
|
return _this6;
|
4725
4725
|
}
|
4726
|
-
_createClass(
|
4726
|
+
_createClass(U, [{
|
4727
4727
|
key: "setApiKeyProperties",
|
4728
4728
|
value: function setApiKeyProperties(e) {
|
4729
4729
|
this.key = e.key, e.validateKeyProperty && (this.validateConfigKey = e.validateKeyProperty);
|
@@ -4751,7 +4751,7 @@ var q = /*#__PURE__*/function (_Le) {
|
|
4751
4751
|
o = _this$keyVerification.createHeaders,
|
4752
4752
|
a = _this$keyVerification.body,
|
4753
4753
|
l = (o == null ? void 0 : o(e)) || this.buildHeadersFunc(e);
|
4754
|
-
|
4754
|
+
_.verifyKey(e, i, l, n, this.keyAuthenticated.bind(this, t.onSuccess), t.onFail, t.onLoad, r, a);
|
4755
4755
|
}
|
4756
4756
|
}, {
|
4757
4757
|
key: "isDirectConnection",
|
@@ -4759,7 +4759,7 @@ var q = /*#__PURE__*/function (_Le) {
|
|
4759
4759
|
return !0;
|
4760
4760
|
}
|
4761
4761
|
}]);
|
4762
|
-
return
|
4762
|
+
return U;
|
4763
4763
|
}(Le);
|
4764
4764
|
var Ft = /*#__PURE__*/function () {
|
4765
4765
|
function Ft() {
|
@@ -4832,33 +4832,33 @@ Ji._attributeToProperty_ = {};
|
|
4832
4832
|
var vo = Ji;
|
4833
4833
|
var yo = "<?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",
|
4834
4834
|
xo = "<?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";
|
4835
|
-
var
|
4836
|
-
function
|
4837
|
-
_classCallCheck(this,
|
4835
|
+
var q = /*#__PURE__*/function () {
|
4836
|
+
function q() {
|
4837
|
+
_classCallCheck(this, q);
|
4838
4838
|
}
|
4839
|
-
_createClass(
|
4839
|
+
_createClass(q, null, [{
|
4840
4840
|
key: "createSVGElement",
|
4841
4841
|
value: function createSVGElement(e) {
|
4842
4842
|
return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
|
4843
4843
|
}
|
4844
4844
|
}]);
|
4845
|
-
return
|
4845
|
+
return q;
|
4846
4846
|
}();
|
4847
4847
|
var rs = /*#__PURE__*/function () {
|
4848
|
-
function
|
4849
|
-
_classCallCheck(this,
|
4848
|
+
function Ge() {
|
4849
|
+
_classCallCheck(this, Ge);
|
4850
4850
|
}
|
4851
|
-
_createClass(
|
4851
|
+
_createClass(Ge, null, [{
|
4852
4852
|
key: "changeVisibility",
|
4853
4853
|
value:
|
4854
4854
|
// prettier-ignore
|
4855
4855
|
function changeVisibility(e, t, i, n) {
|
4856
|
-
n.target.id ===
|
4856
|
+
n.target.id === Ge.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
|
4857
4857
|
}
|
4858
4858
|
}, {
|
4859
4859
|
key: "createIconElement",
|
4860
4860
|
value: function createIconElement(e, t) {
|
4861
|
-
var i =
|
4861
|
+
var i = q.createSVGElement(e);
|
4862
4862
|
return i.id = t, i.classList.add("visibility-icon"), i;
|
4863
4863
|
}
|
4864
4864
|
// prettier-ignore
|
@@ -4867,13 +4867,13 @@ var rs = /*#__PURE__*/function () {
|
|
4867
4867
|
value: function create(e) {
|
4868
4868
|
var t = document.createElement("div");
|
4869
4869
|
t.id = "visibility-icon-container";
|
4870
|
-
var i =
|
4870
|
+
var i = Ge.createIconElement(xo, Ge.VISIBLE_ICON_ID);
|
4871
4871
|
i.style.display = "none", t.appendChild(i);
|
4872
|
-
var n =
|
4873
|
-
return t.appendChild(n), t.onclick =
|
4872
|
+
var n = Ge.createIconElement(yo, "not-visible-icon");
|
4873
|
+
return t.appendChild(n), t.onclick = Ge.changeVisibility.bind(this, e, i, n), t;
|
4874
4874
|
}
|
4875
4875
|
}]);
|
4876
|
-
return
|
4876
|
+
return Ge;
|
4877
4877
|
}();
|
4878
4878
|
rs.VISIBLE_ICON_ID = "visible-icon";
|
4879
4879
|
var Eo = rs;
|
@@ -5077,113 +5077,69 @@ yt.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
|
|
5077
5077
|
var xn = yt;
|
5078
5078
|
var En = {
|
5079
5079
|
model_list: [{
|
5080
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5080
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f32_1-MLC/resolve/main/",
|
5081
5081
|
local_id: "Llama-2-7b-chat-hf-q4f32_1",
|
5082
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f32_1-webgpu.wasm"
|
5082
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f32_1-ctx4k_cs1k-webgpu.wasm"
|
5083
5083
|
}, {
|
5084
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5085
|
-
local_id: "Llama-2-13b-chat-hf-q4f32_1",
|
5086
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf-q4f32_1-webgpu.wasm"
|
5087
|
-
}, {
|
5088
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-Llama-2-7b-chat-hf-q4f16_1/resolve/main/",
|
5084
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5089
5085
|
local_id: "Llama-2-7b-chat-hf-q4f16_1",
|
5090
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f16_1-webgpu.wasm",
|
5086
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5091
5087
|
required_features: ["shader-f16"]
|
5092
5088
|
}, {
|
5093
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5089
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-13b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5094
5090
|
local_id: "Llama-2-13b-chat-hf-q4f16_1",
|
5095
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf-q4f16_1-webgpu.wasm",
|
5091
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf/Llama-2-13b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5096
5092
|
required_features: ["shader-f16"]
|
5097
5093
|
}, {
|
5098
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5094
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-70b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5099
5095
|
local_id: "Llama-2-70b-chat-hf-q4f16_1",
|
5100
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-70b-chat-hf-q4f16_1-webgpu.wasm",
|
5096
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-70b-chat-hf/Llama-2-70b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5101
5097
|
required_features: ["shader-f16"]
|
5102
5098
|
}, {
|
5103
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5099
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC/resolve/main/",
|
5104
5100
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f16_1",
|
5105
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f16_1-webgpu.wasm",
|
5101
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f16_1-ctx2k-webgpu.wasm",
|
5106
5102
|
required_features: ["shader-f16"]
|
5107
5103
|
}, {
|
5108
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5104
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC/resolve/main/",
|
5109
5105
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f32_1",
|
5110
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f32_1-webgpu.wasm"
|
5111
|
-
}, {
|
5112
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardCoder-15B-V1.0-q4f16_1/resolve/main/",
|
5113
|
-
local_id: "WizardCoder-15B-V1.0-q4f16_1",
|
5114
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/WizardCoder-15B-V1.0-q4f16_1-webgpu.wasm",
|
5115
|
-
required_features: ["shader-f16"]
|
5116
|
-
}, {
|
5117
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardCoder-15B-V1.0-q4f32_1/resolve/main/",
|
5118
|
-
local_id: "WizardCoder-15B-V1.0-q4f32_1",
|
5119
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/WizardCoder-15B-V1.0-q4f32_1-webgpu.wasm"
|
5120
|
-
}, {
|
5121
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardMath-7B-V1.0-q4f16_1/resolve/main/",
|
5122
|
-
local_id: "WizardMath-7B-V1.0-q4f16_1",
|
5123
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f16_1-webgpu.wasm",
|
5124
|
-
required_features: ["shader-f16"]
|
5106
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx2k-webgpu.wasm"
|
5125
5107
|
}, {
|
5126
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5127
|
-
local_id: "WizardMath-7B-V1.0-q4f32_1",
|
5128
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f32_1-webgpu.wasm"
|
5129
|
-
}, {
|
5130
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardMath-7B-V1.1-q4f16_1/resolve/main/",
|
5108
|
+
model_url: "https://huggingface.co/mlc-ai/WizardMath-7B-V1.1-q4f16_1-MLC/resolve/main/",
|
5131
5109
|
local_id: "WizardMath-7B-V1.1-q4f16_1",
|
5132
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.
|
5133
|
-
required_features: ["shader-f16"]
|
5134
|
-
}, {
|
5135
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-WizardMath-13B-V1.0-q4f16_1/resolve/main/",
|
5136
|
-
local_id: "WizardMath-13B-V1.0-q4f16_1",
|
5137
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf-q4f16_1-webgpu.wasm",
|
5110
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5138
5111
|
required_features: ["shader-f16"]
|
5139
5112
|
}, {
|
5140
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5141
|
-
local_id: "
|
5142
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/
|
5113
|
+
model_url: "https://huggingface.co/mlc-ai/Mistral-7B-Instruct-v0.2-q4f16_1-MLC/resolve/main/",
|
5114
|
+
local_id: "Mistral-7B-Instruct-v0.2-q4f16_1",
|
5115
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5143
5116
|
required_features: ["shader-f16"]
|
5144
5117
|
}, {
|
5145
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5146
|
-
local_id: "Mistral-7B-Instruct-v0.1-q4f16_1",
|
5147
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5148
|
-
required_features: ["shader-f16"]
|
5149
|
-
}, {
|
5150
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-Mistral-7B-Instruct-v0.1-q4f32_1/resolve/main/",
|
5151
|
-
local_id: "Mistral-7B-Instruct-v0.1-q4f32_1",
|
5152
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f32_1-sw4k_cs1k-webgpu.wasm"
|
5153
|
-
}, {
|
5154
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-OpenHermes-2.5-Mistral-7B-q4f16_1/resolve/main/",
|
5118
|
+
model_url: "https://huggingface.co/mlc-ai/OpenHermes-2.5-Mistral-7B-q4f16_1-MLC/resolve/main/",
|
5155
5119
|
local_id: "OpenHermes-2.5-Mistral-7B-q4f16_1",
|
5156
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.
|
5120
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5157
5121
|
required_features: ["shader-f16"]
|
5158
5122
|
}, {
|
5159
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5160
|
-
local_id: "OpenHermes-2.5-Mistral-7B-q4f32_1",
|
5161
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f32_1-sw4k_cs1k-webgpu.wasm"
|
5162
|
-
}, {
|
5163
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-NeuralHermes-2.5-Mistral-7B-q4f16_1/resolve/main/",
|
5123
|
+
model_url: "https://huggingface.co/mlc-ai/NeuralHermes-2.5-Mistral-7B-q4f16_1-MLC/resolve/main/",
|
5164
5124
|
local_id: "NeuralHermes-2.5-Mistral-7B-q4f16_1",
|
5165
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.
|
5125
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5166
5126
|
required_features: ["shader-f16"]
|
5167
|
-
}, {
|
5168
|
-
model_url: "https://huggingface.co/mlc-ai/mlc-chat-NeuralHermes-2.5-Mistral-7B-q4f32_1/resolve/main/",
|
5169
|
-
local_id: "NeuralHermes-2.5-Mistral-7B-q4f32_1",
|
5170
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.1-q4f32_1-sw4k_cs1k-webgpu.wasm"
|
5171
5127
|
},
|
5172
5128
|
// Models below fit for 128MB buffer limit (e.g. webgpu on Android)
|
5173
5129
|
{
|
5174
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5130
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5175
5131
|
local_id: "Llama-2-7b-chat-hf-q4f16_1-1k",
|
5176
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf-q4f16_1-
|
5132
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f16_1-ctx1k-webgpu.wasm",
|
5177
5133
|
required_features: ["shader-f16"]
|
5178
5134
|
}, {
|
5179
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5135
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC/resolve/main/",
|
5180
5136
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f16_1-1k",
|
5181
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f16_1-
|
5137
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f16_1-ctx1k-webgpu.wasm",
|
5182
5138
|
required_features: ["shader-f16"]
|
5183
5139
|
}, {
|
5184
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5140
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC/resolve/main/",
|
5185
5141
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f32_1-1k",
|
5186
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1-q4f32_1-
|
5142
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx1k-webgpu.wasm"
|
5187
5143
|
}],
|
5188
5144
|
use_web_worker: !0
|
5189
5145
|
},
|
@@ -5347,56 +5303,55 @@ var En = {
|
|
5347
5303
|
value: function () {
|
5348
5304
|
var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e, t) {
|
5349
5305
|
var _this12 = this;
|
5350
|
-
var o, a, l, c, d, i, n, r, _this$getConfig,
|
5306
|
+
var o, a, l, c, d, u, p, i, n, r, _this$getConfig, h, g, f, _h;
|
5351
5307
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
5352
5308
|
while (1) switch (_context25.prev = _context25.next) {
|
5353
5309
|
case 0:
|
5354
5310
|
this.scrollToTop(), M.chat = e, this._isModelLoading = !0;
|
5355
5311
|
i = ((o = this._webModel.introMessage) == null ? void 0 : o.displayed) === !1;
|
5356
|
-
n = function n(
|
5357
|
-
var
|
5358
|
-
(
|
5359
|
-
html: "<div>".concat(
|
5312
|
+
n = function n(h) {
|
5313
|
+
var g;
|
5314
|
+
(g = _this12._messages) == null || g.addNewMessage({
|
5315
|
+
html: "<div>".concat(h.text, "</div>"),
|
5360
5316
|
overwrite: !0,
|
5361
5317
|
sendUpdate: !1
|
5362
5318
|
}), i && (setTimeout(function () {
|
5363
|
-
var
|
5364
|
-
return Y.scrollToBottom((
|
5319
|
+
var f;
|
5320
|
+
return Y.scrollToBottom((f = _this12._messages) == null ? void 0 : f.elementRef);
|
5365
5321
|
}), i = !1);
|
5366
5322
|
};
|
5367
5323
|
M.chat.setInitProgressCallback(n);
|
5368
5324
|
_context25.prev = 4;
|
5369
|
-
_this$getConfig = this.getConfig(),
|
5370
|
-
|
5371
|
-
|
5372
|
-
|
5373
|
-
|
5374
|
-
|
5375
|
-
|
5376
|
-
|
5377
|
-
case 9:
|
5325
|
+
_this$getConfig = this.getConfig(), h = _this$getConfig.model, g = _this$getConfig.appConfig, f = {};
|
5326
|
+
this._webModel.instruction && (f.conv_config = {
|
5327
|
+
system: this._webModel.instruction
|
5328
|
+
});
|
5329
|
+
this._conversationHistory.length > 0 && (f.conversation_history = this._conversationHistory);
|
5330
|
+
_context25.next = 10;
|
5331
|
+
return M.chat.reload(h, f, g, t);
|
5332
|
+
case 10:
|
5378
5333
|
r = _context25.sent;
|
5379
|
-
_context25.next =
|
5334
|
+
_context25.next = 16;
|
5380
5335
|
break;
|
5381
|
-
case
|
5382
|
-
_context25.prev =
|
5336
|
+
case 13:
|
5337
|
+
_context25.prev = 13;
|
5383
5338
|
_context25.t0 = _context25["catch"](4);
|
5384
5339
|
return _context25.abrupt("return", this.unloadChat(_context25.t0));
|
5385
|
-
case
|
5386
|
-
if ((a = this._webModel.introMessage) != null &&
|
5387
|
-
|
5388
|
-
(
|
5389
|
-
html:
|
5340
|
+
case 16:
|
5341
|
+
if ((l = (a = this.deepChat)._validationHandler) == null || l.call(a), (c = this._webModel.introMessage) != null && c.removeAfterLoad) this._webModel.introMessage.displayed === !1 ? (u = this._messages) == null || u.removeLastMessage() : (p = this._removeIntro) == null || p.call(this);else {
|
5342
|
+
_h = xn.setUpAfterLoad(r, this._webModel.introMessage, this._chatEl, !!this._webModel.worker);
|
5343
|
+
(d = this._messages) == null || d.addNewMessage({
|
5344
|
+
html: _h,
|
5390
5345
|
overwrite: !0,
|
5391
5346
|
sendUpdate: !1
|
5392
5347
|
});
|
5393
5348
|
}
|
5394
5349
|
this._isModelLoaded = !0, this._isModelLoading = !1;
|
5395
|
-
case
|
5350
|
+
case 18:
|
5396
5351
|
case "end":
|
5397
5352
|
return _context25.stop();
|
5398
5353
|
}
|
5399
|
-
}, _callee25, this, [[4,
|
5354
|
+
}, _callee25, this, [[4, 13]]);
|
5400
5355
|
}));
|
5401
5356
|
function loadModel(_x47, _x48) {
|
5402
5357
|
return _loadModel.apply(this, arguments);
|
@@ -5587,7 +5542,7 @@ var En = {
|
|
5587
5542
|
console.error(l);
|
5588
5543
|
c = a ? this.streamHandlers.onClose : this.completionsHandlers.onFinish;
|
5589
5544
|
E.onInterceptorError(e, l, c);
|
5590
|
-
} else this.generateRespByType(e, r, !!this.deepChat.stream, i);
|
5545
|
+
} else this.generateRespByType(e, r.text, !!this.deepChat.stream, i);
|
5591
5546
|
} catch (l) {
|
5592
5547
|
this.unloadChat(l);
|
5593
5548
|
}
|
@@ -5761,8 +5716,8 @@ var Bt = /*#__PURE__*/function () {
|
|
5761
5716
|
}]);
|
5762
5717
|
return Bt;
|
5763
5718
|
}();
|
5764
|
-
var os = /*#__PURE__*/function (
|
5765
|
-
_inherits(ji,
|
5719
|
+
var os = /*#__PURE__*/function (_U) {
|
5720
|
+
_inherits(ji, _U);
|
5766
5721
|
var _super4 = _createSuper(ji);
|
5767
5722
|
// prettier-ignore
|
5768
5723
|
function ji(e, t, i, n, r, o) {
|
@@ -5797,7 +5752,7 @@ var os = /*#__PURE__*/function (_q) {
|
|
5797
5752
|
throw new Error("Request settings have not been set up");
|
5798
5753
|
case 2:
|
5799
5754
|
n = this.preprocessBody(this.rawBody, t, i);
|
5800
|
-
|
5755
|
+
_.request(this, n, e);
|
5801
5756
|
case 4:
|
5802
5757
|
case "end":
|
5803
5758
|
return _context34.stop();
|
@@ -5811,7 +5766,7 @@ var os = /*#__PURE__*/function (_q) {
|
|
5811
5766
|
}()
|
5812
5767
|
}]);
|
5813
5768
|
return ji;
|
5814
|
-
}(
|
5769
|
+
}(U);
|
5815
5770
|
os.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5816
5771
|
var Pe = os;
|
5817
5772
|
var xt = /*#__PURE__*/function (_Pe) {
|
@@ -5849,7 +5804,7 @@ var xt = /*#__PURE__*/function (_Pe) {
|
|
5849
5804
|
}
|
5850
5805
|
throw new Error("No file was added");
|
5851
5806
|
case 4:
|
5852
|
-
|
5807
|
+
_.poll(this, i[0], e, !1);
|
5853
5808
|
case 5:
|
5854
5809
|
case "end":
|
5855
5810
|
return _context35.stop();
|
@@ -5869,12 +5824,12 @@ var xt = /*#__PURE__*/function (_Pe) {
|
|
5869
5824
|
}]);
|
5870
5825
|
return xt;
|
5871
5826
|
}(Pe);
|
5872
|
-
var
|
5873
|
-
_inherits(
|
5874
|
-
var _super6 = _createSuper(
|
5827
|
+
var So = /*#__PURE__*/function (_xt) {
|
5828
|
+
_inherits(So, _xt);
|
5829
|
+
var _super6 = _createSuper(So);
|
5875
5830
|
// prettier-ignore
|
5876
|
-
function
|
5877
|
-
_classCallCheck(this,
|
5831
|
+
function So(e) {
|
5832
|
+
_classCallCheck(this, So);
|
5878
5833
|
var n, r, o;
|
5879
5834
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.audioClassification,
|
5880
5835
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
@@ -5882,7 +5837,7 @@ var _o = /*#__PURE__*/function (_xt) {
|
|
5882
5837
|
audio: {}
|
5883
5838
|
});
|
5884
5839
|
}
|
5885
|
-
_createClass(
|
5840
|
+
_createClass(So, [{
|
5886
5841
|
key: "extractPollResultData",
|
5887
5842
|
value: function () {
|
5888
5843
|
var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
|
@@ -5919,13 +5874,13 @@ var _o = /*#__PURE__*/function (_xt) {
|
|
5919
5874
|
return extractPollResultData;
|
5920
5875
|
}()
|
5921
5876
|
}]);
|
5922
|
-
return
|
5877
|
+
return So;
|
5923
5878
|
}(xt);
|
5924
|
-
var
|
5925
|
-
_inherits(
|
5926
|
-
var _super7 = _createSuper(
|
5927
|
-
function
|
5928
|
-
_classCallCheck(this,
|
5879
|
+
var wo = /*#__PURE__*/function (_xt2) {
|
5880
|
+
_inherits(wo, _xt2);
|
5881
|
+
var _super7 = _createSuper(wo);
|
5882
|
+
function wo(e) {
|
5883
|
+
_classCallCheck(this, wo);
|
5929
5884
|
var n, r, o;
|
5930
5885
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.imageClassification,
|
5931
5886
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
@@ -5933,7 +5888,7 @@ var So = /*#__PURE__*/function (_xt2) {
|
|
5933
5888
|
images: {}
|
5934
5889
|
});
|
5935
5890
|
}
|
5936
|
-
_createClass(
|
5891
|
+
_createClass(wo, [{
|
5937
5892
|
key: "extractPollResultData",
|
5938
5893
|
value: function () {
|
5939
5894
|
var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
|
@@ -5970,7 +5925,7 @@ var So = /*#__PURE__*/function (_xt2) {
|
|
5970
5925
|
return extractPollResultData;
|
5971
5926
|
}()
|
5972
5927
|
}]);
|
5973
|
-
return
|
5928
|
+
return wo;
|
5974
5929
|
}(xt);
|
5975
5930
|
var Et = "data:image/png;base64,";
|
5976
5931
|
var re = /*#__PURE__*/function () {
|
@@ -6003,8 +5958,8 @@ var re = /*#__PURE__*/function () {
|
|
6003
5958
|
}]);
|
6004
5959
|
return re;
|
6005
5960
|
}();
|
6006
|
-
var ni = /*#__PURE__*/function (
|
6007
|
-
_inherits(ni,
|
5961
|
+
var ni = /*#__PURE__*/function (_U2) {
|
5962
|
+
_inherits(ni, _U2);
|
6008
5963
|
var _super8 = _createSuper(ni);
|
6009
5964
|
// prettier-ignore
|
6010
5965
|
function ni(e, t, i, n, r) {
|
@@ -6014,7 +5969,7 @@ var ni = /*#__PURE__*/function (_q2) {
|
|
6014
5969
|
return _this16;
|
6015
5970
|
}
|
6016
5971
|
return _createClass(ni);
|
6017
|
-
}(
|
5972
|
+
}(U);
|
6018
5973
|
var zt = /*#__PURE__*/function (_ni) {
|
6019
5974
|
_inherits(zt, _ni);
|
6020
5975
|
var _super9 = _createSuper(zt);
|
@@ -6067,7 +6022,7 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6067
6022
|
throw new Error("Image was not found");
|
6068
6023
|
case 4:
|
6069
6024
|
n = this.createFormDataBody(this.rawBody, i[0]);
|
6070
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6025
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, n, e), !1);
|
6071
6026
|
case 6:
|
6072
6027
|
case "end":
|
6073
6028
|
return _context38.stop();
|
@@ -6124,12 +6079,12 @@ var zt = /*#__PURE__*/function (_ni) {
|
|
6124
6079
|
}]);
|
6125
6080
|
return zt;
|
6126
6081
|
}(ni);
|
6127
|
-
var
|
6128
|
-
_inherits(
|
6129
|
-
var _super10 = _createSuper(
|
6130
|
-
function
|
6082
|
+
var Ut = /*#__PURE__*/function (_ni2) {
|
6083
|
+
_inherits(Ut, _ni2);
|
6084
|
+
var _super10 = _createSuper(Ut);
|
6085
|
+
function Ut(e) {
|
6131
6086
|
var _this18;
|
6132
|
-
_classCallCheck(this,
|
6087
|
+
_classCallCheck(this, Ut);
|
6133
6088
|
var o;
|
6134
6089
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6135
6090
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6143,10 +6098,10 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6143
6098
|
};
|
6144
6099
|
_this18 = _super10.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this18.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this18._maskSource = "MASK_IMAGE_WHITE", _this18.textInputPlaceholderText = "Describe image changes", _this18.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6145
6100
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6146
|
-
_typeof(r) == "object" && (r.engine_id && (_this18.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this18._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this18._maskSource = r.mask_source),
|
6101
|
+
_typeof(r) == "object" && (r.engine_id && (_this18.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this18._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this18._maskSource = r.mask_source), Ut.cleanConfig(r), Object.assign(_this18.rawBody, r)), _this18.canSendMessage = Ut.canSendFileTextMessage;
|
6147
6102
|
return _this18;
|
6148
6103
|
}
|
6149
|
-
_createClass(
|
6104
|
+
_createClass(Ut, [{
|
6150
6105
|
key: "createFormDataBody",
|
6151
6106
|
value: function createFormDataBody(e, t, i, n) {
|
6152
6107
|
var r = new FormData();
|
@@ -6176,7 +6131,7 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6176
6131
|
throw new Error("Image was not found");
|
6177
6132
|
case 4:
|
6178
6133
|
n = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), r = this.createFormDataBody(this.rawBody, i[0], i[1], n);
|
6179
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6134
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
6180
6135
|
case 6:
|
6181
6136
|
case "end":
|
6182
6137
|
return _context40.stop();
|
@@ -6231,13 +6186,13 @@ var qt = /*#__PURE__*/function (_ni2) {
|
|
6231
6186
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6232
6187
|
}
|
6233
6188
|
}]);
|
6234
|
-
return
|
6189
|
+
return Ut;
|
6235
6190
|
}(ni);
|
6236
|
-
var
|
6237
|
-
_inherits(
|
6238
|
-
var _super11 = _createSuper(
|
6239
|
-
function
|
6240
|
-
_classCallCheck(this,
|
6191
|
+
var _o = /*#__PURE__*/function (_xt3) {
|
6192
|
+
_inherits(_o, _xt3);
|
6193
|
+
var _super11 = _createSuper(_o);
|
6194
|
+
function _o(e) {
|
6195
|
+
_classCallCheck(this, _o);
|
6241
6196
|
var n, r, o;
|
6242
6197
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.audioSpeechRecognition,
|
6243
6198
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
@@ -6245,7 +6200,7 @@ var wo = /*#__PURE__*/function (_xt3) {
|
|
6245
6200
|
audio: {}
|
6246
6201
|
});
|
6247
6202
|
}
|
6248
|
-
_createClass(
|
6203
|
+
_createClass(_o, [{
|
6249
6204
|
key: "extractPollResultData",
|
6250
6205
|
value: function () {
|
6251
6206
|
var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e) {
|
@@ -6281,7 +6236,7 @@ var wo = /*#__PURE__*/function (_xt3) {
|
|
6281
6236
|
return extractPollResultData;
|
6282
6237
|
}()
|
6283
6238
|
}]);
|
6284
|
-
return
|
6239
|
+
return _o;
|
6285
6240
|
}(xt);
|
6286
6241
|
var Mo = /*#__PURE__*/function (_Pe2) {
|
6287
6242
|
_inherits(Mo, _Pe2);
|
@@ -6503,12 +6458,12 @@ var Ao = /*#__PURE__*/function (_Pe5) {
|
|
6503
6458
|
}]);
|
6504
6459
|
return Ao;
|
6505
6460
|
}(Pe);
|
6506
|
-
var
|
6507
|
-
_inherits(
|
6508
|
-
var _super16 = _createSuper(
|
6509
|
-
function
|
6461
|
+
var qt = /*#__PURE__*/function (_ni3) {
|
6462
|
+
_inherits(qt, _ni3);
|
6463
|
+
var _super16 = _createSuper(qt);
|
6464
|
+
function qt(e) {
|
6510
6465
|
var _this21;
|
6511
|
-
_classCallCheck(this,
|
6466
|
+
_classCallCheck(this, qt);
|
6512
6467
|
var o;
|
6513
6468
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6514
6469
|
i = t.stabilityAI,
|
@@ -6522,10 +6477,10 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6522
6477
|
};
|
6523
6478
|
_this21 = _super16.call(this, e, re.buildKeyVerificationDetails(), re.buildHeaders, i, n), _this21.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this21.textInputPlaceholderText = "Describe image changes", _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6524
6479
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
6525
|
-
_typeof(r) == "object" && (r.engine_id && (_this21.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this21._imageWeight = r.weight),
|
6480
|
+
_typeof(r) == "object" && (r.engine_id && (_this21.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this21._imageWeight = r.weight), qt.cleanConfig(r), Object.assign(_this21.rawBody, r)), _this21.canSendMessage = qt.canSendFileTextMessage;
|
6526
6481
|
return _this21;
|
6527
6482
|
}
|
6528
|
-
_createClass(
|
6483
|
+
_createClass(qt, [{
|
6529
6484
|
key: "createFormDataBody",
|
6530
6485
|
value: function createFormDataBody(e, t, i) {
|
6531
6486
|
var n = new FormData();
|
@@ -6555,7 +6510,7 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6555
6510
|
throw new Error("Image was not found");
|
6556
6511
|
case 4:
|
6557
6512
|
n = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), r = this.createFormDataBody(this.rawBody, i[0], n);
|
6558
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6513
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
6559
6514
|
case 6:
|
6560
6515
|
case "end":
|
6561
6516
|
return _context47.stop();
|
@@ -6610,7 +6565,7 @@ var Ut = /*#__PURE__*/function (_ni3) {
|
|
6610
6565
|
return !!(t != null && t[0]) && !!(e && e.trim() !== "");
|
6611
6566
|
}
|
6612
6567
|
}]);
|
6613
|
-
return
|
6568
|
+
return qt;
|
6614
6569
|
}(ni);
|
6615
6570
|
var ko = /*#__PURE__*/function (_Pe6) {
|
6616
6571
|
_inherits(ko, _Pe6);
|
@@ -6690,7 +6645,7 @@ var Ht = /*#__PURE__*/function (_ni4) {
|
|
6690
6645
|
throw new Error("Request settings have not been set up");
|
6691
6646
|
case 2:
|
6692
6647
|
i = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
6693
|
-
|
6648
|
+
_.request(this, i, e);
|
6694
6649
|
case 4:
|
6695
6650
|
case "end":
|
6696
6651
|
return _context50.stop();
|
@@ -6789,11 +6744,11 @@ var Io = /*#__PURE__*/function (_Pe7) {
|
|
6789
6744
|
}]);
|
6790
6745
|
return Io;
|
6791
6746
|
}(Pe);
|
6792
|
-
var
|
6793
|
-
function
|
6794
|
-
_classCallCheck(this,
|
6747
|
+
var Gt = /*#__PURE__*/function () {
|
6748
|
+
function Gt() {
|
6749
|
+
_classCallCheck(this, Gt);
|
6795
6750
|
}
|
6796
|
-
_createClass(
|
6751
|
+
_createClass(Gt, null, [{
|
6797
6752
|
key: "buildHeaders",
|
6798
6753
|
value: function buildHeaders(e) {
|
6799
6754
|
return {
|
@@ -6815,26 +6770,26 @@ var Vt = /*#__PURE__*/function () {
|
|
6815
6770
|
return {
|
6816
6771
|
url: "https://api.cohere.ai/v1/generate",
|
6817
6772
|
method: "POST",
|
6818
|
-
handleVerificationResult:
|
6773
|
+
handleVerificationResult: Gt.handleVerificationResult,
|
6819
6774
|
body: JSON.stringify({
|
6820
6775
|
prompt: ""
|
6821
6776
|
})
|
6822
6777
|
};
|
6823
6778
|
}
|
6824
6779
|
}]);
|
6825
|
-
return
|
6780
|
+
return Gt;
|
6826
6781
|
}();
|
6827
|
-
var Yi = /*#__PURE__*/function (
|
6828
|
-
_inherits(Yi,
|
6782
|
+
var Yi = /*#__PURE__*/function (_U3) {
|
6783
|
+
_inherits(Yi, _U3);
|
6829
6784
|
var _super20 = _createSuper(Yi);
|
6830
6785
|
function Yi(e, t, i, n, r) {
|
6831
6786
|
var _this24;
|
6832
6787
|
_classCallCheck(this, Yi);
|
6833
|
-
_this24 = _super20.call(this, e,
|
6788
|
+
_this24 = _super20.call(this, e, Gt.buildKeyVerificationDetails(), Gt.buildHeaders, r), _this24.insertKeyPlaceholderText = "Cohere API Key", _this24.getKeyLink = "https://dashboard.cohere.ai/api-keys", _this24.permittedErrorPrefixes = ["invalid"], _this24.url = t, _this24.textInputPlaceholderText = i, n && _typeof(n) == "object" && Object.assign(_this24.rawBody, n);
|
6834
6789
|
return _this24;
|
6835
6790
|
}
|
6836
6791
|
return _createClass(Yi);
|
6837
|
-
}(
|
6792
|
+
}(U);
|
6838
6793
|
var Lo = /*#__PURE__*/function (_Yi) {
|
6839
6794
|
_inherits(Lo, _Yi);
|
6840
6795
|
var _super21 = _createSuper(Lo);
|
@@ -6869,7 +6824,7 @@ var Lo = /*#__PURE__*/function (_Yi) {
|
|
6869
6824
|
throw new Error("Request settings have not been set up");
|
6870
6825
|
case 2:
|
6871
6826
|
i = this.preprocessBody(this.rawBody, t);
|
6872
|
-
|
6827
|
+
_.request(this, i, e);
|
6873
6828
|
case 4:
|
6874
6829
|
case "end":
|
6875
6830
|
return _context53.stop();
|
@@ -6946,7 +6901,7 @@ var Ro = /*#__PURE__*/function (_Yi2) {
|
|
6946
6901
|
throw new Error("Request settings have not been set up");
|
6947
6902
|
case 2:
|
6948
6903
|
i = this.preprocessBody(this.rawBody, t);
|
6949
|
-
|
6904
|
+
_.request(this, i, e);
|
6950
6905
|
case 4:
|
6951
6906
|
case "end":
|
6952
6907
|
return _context55.stop();
|
@@ -7116,8 +7071,8 @@ var O = /*#__PURE__*/function () {
|
|
7116
7071
|
}]);
|
7117
7072
|
return O;
|
7118
7073
|
}();
|
7119
|
-
var Zi = /*#__PURE__*/function (
|
7120
|
-
_inherits(Fi,
|
7074
|
+
var Zi = /*#__PURE__*/function (_U4) {
|
7075
|
+
_inherits(Fi, _U4);
|
7121
7076
|
var _super23 = _createSuper(Fi);
|
7122
7077
|
function Fi(e) {
|
7123
7078
|
var _o$model, _a$voice;
|
@@ -7155,7 +7110,7 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7155
7110
|
case 2:
|
7156
7111
|
this.url = this.requestSettings.url || this.url;
|
7157
7112
|
i = this.preprocessBody(this.rawBody, t);
|
7158
|
-
|
7113
|
+
_.request(this, i, e);
|
7159
7114
|
case 5:
|
7160
7115
|
case "end":
|
7161
7116
|
return _context60.stop();
|
@@ -7212,12 +7167,12 @@ var Zi = /*#__PURE__*/function (_q4) {
|
|
7212
7167
|
}()
|
7213
7168
|
}]);
|
7214
7169
|
return Fi;
|
7215
|
-
}(
|
7170
|
+
}(U);
|
7216
7171
|
Zi.DEFAULT_MODEL = "tts-1";
|
7217
7172
|
Zi.DEFAULT_VOIDE = "alloy";
|
7218
7173
|
var Oo = Zi;
|
7219
|
-
var si = /*#__PURE__*/function (
|
7220
|
-
_inherits(Ee,
|
7174
|
+
var si = /*#__PURE__*/function (_U5) {
|
7175
|
+
_inherits(Ee, _U5);
|
7221
7176
|
var _super24 = _createSuper(Ee);
|
7222
7177
|
function Ee(e) {
|
7223
7178
|
var _o$model2;
|
@@ -7269,7 +7224,7 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7269
7224
|
case 4:
|
7270
7225
|
this.url = this.requestSettings.url || this._service_url;
|
7271
7226
|
n = this.preprocessBody(this.rawBody, t), r = Ee.createFormDataBody(n, i[0]);
|
7272
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
7227
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, r, e), !1);
|
7273
7228
|
case 7:
|
7274
7229
|
case "end":
|
7275
7230
|
return _context62.stop();
|
@@ -7328,7 +7283,7 @@ var si = /*#__PURE__*/function (_q5) {
|
|
7328
7283
|
}
|
7329
7284
|
}]);
|
7330
7285
|
return Ee;
|
7331
|
-
}(
|
7286
|
+
}(U);
|
7332
7287
|
si.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
7333
7288
|
si.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
7334
7289
|
si.DEFAULT_MODEL = "whisper-1";
|
@@ -7435,8 +7390,8 @@ var Z = /*#__PURE__*/function () {
|
|
7435
7390
|
}]);
|
7436
7391
|
return Z;
|
7437
7392
|
}();
|
7438
|
-
var Po = /*#__PURE__*/function (
|
7439
|
-
_inherits(Po,
|
7393
|
+
var Po = /*#__PURE__*/function (_U6) {
|
7394
|
+
_inherits(Po, _U6);
|
7440
7395
|
var _super25 = _createSuper(Po);
|
7441
7396
|
// prettier-ignore
|
7442
7397
|
function Po(e, t, i, n, r) {
|
@@ -7448,7 +7403,7 @@ var Po = /*#__PURE__*/function (_q6) {
|
|
7448
7403
|
return _this27;
|
7449
7404
|
}
|
7450
7405
|
return _createClass(Po);
|
7451
|
-
}(
|
7406
|
+
}(U);
|
7452
7407
|
var Do = /*#__PURE__*/function (_Po) {
|
7453
7408
|
_inherits(Do, _Po);
|
7454
7409
|
var _super26 = _createSuper(Do);
|
@@ -7494,7 +7449,7 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7494
7449
|
throw new Error("Request settings have not been set up");
|
7495
7450
|
case 2:
|
7496
7451
|
i = this.preprocessBody(this.rawBody, t);
|
7497
|
-
|
7452
|
+
_.request(this, i, e), this.messages = e;
|
7498
7453
|
case 4:
|
7499
7454
|
case "end":
|
7500
7455
|
return _context64.stop();
|
@@ -7525,7 +7480,7 @@ var Do = /*#__PURE__*/function (_Po) {
|
|
7525
7480
|
method: "GET",
|
7526
7481
|
headers: (t = this.requestSettings) == null ? void 0 : t.headers
|
7527
7482
|
};
|
7528
|
-
|
7483
|
+
_.executePollRequest(this, _i9, n, this.messages);
|
7529
7484
|
}
|
7530
7485
|
return _context65.abrupt("return", {
|
7531
7486
|
makingAnotherRequest: !0
|
@@ -7710,8 +7665,8 @@ var ct = /*#__PURE__*/function () {
|
|
7710
7665
|
}]);
|
7711
7666
|
return ct;
|
7712
7667
|
}();
|
7713
|
-
var Xi = /*#__PURE__*/function (
|
7714
|
-
_inherits(Xi,
|
7668
|
+
var Xi = /*#__PURE__*/function (_U7) {
|
7669
|
+
_inherits(Xi, _U7);
|
7715
7670
|
var _super27 = _createSuper(Xi);
|
7716
7671
|
function Xi(e) {
|
7717
7672
|
var _this29;
|
@@ -7743,7 +7698,7 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7743
7698
|
}
|
7744
7699
|
throw new Error("No file was added");
|
7745
7700
|
case 4:
|
7746
|
-
|
7701
|
+
_.request(this, i[0], e, !1);
|
7747
7702
|
case 5:
|
7748
7703
|
case "end":
|
7749
7704
|
return _context68.stop();
|
@@ -7795,9 +7750,9 @@ var Xi = /*#__PURE__*/function (_q7) {
|
|
7795
7750
|
}
|
7796
7751
|
}]);
|
7797
7752
|
return Xi;
|
7798
|
-
}(
|
7799
|
-
var as = /*#__PURE__*/function (
|
7800
|
-
_inherits(as,
|
7753
|
+
}(U);
|
7754
|
+
var as = /*#__PURE__*/function (_U8) {
|
7755
|
+
_inherits(as, _U8);
|
7801
7756
|
var _super28 = _createSuper(as);
|
7802
7757
|
// prettier-ignore
|
7803
7758
|
function as(e, t, i, n, r) {
|
@@ -7809,7 +7764,7 @@ var as = /*#__PURE__*/function (_q8) {
|
|
7809
7764
|
return _this30;
|
7810
7765
|
}
|
7811
7766
|
return _createClass(as);
|
7812
|
-
}(
|
7767
|
+
}(U);
|
7813
7768
|
var ls = /*#__PURE__*/function (_as) {
|
7814
7769
|
_inherits(cs, _as);
|
7815
7770
|
var _super29 = _createSuper(cs);
|
@@ -7845,7 +7800,7 @@ var ls = /*#__PURE__*/function (_as) {
|
|
7845
7800
|
throw new Error("Request settings have not been set up");
|
7846
7801
|
case 2:
|
7847
7802
|
i = this.preprocessBody(this.rawBody, t);
|
7848
|
-
|
7803
|
+
_.request(this, i, e, !1);
|
7849
7804
|
case 4:
|
7850
7805
|
case "end":
|
7851
7806
|
return _context70.stop();
|
@@ -7934,7 +7889,7 @@ var ds = /*#__PURE__*/function (_as2) {
|
|
7934
7889
|
}
|
7935
7890
|
throw new Error("No file was added");
|
7936
7891
|
case 4:
|
7937
|
-
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"),
|
7892
|
+
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), _.request(this, i[0], e, !1);
|
7938
7893
|
case 5:
|
7939
7894
|
case "end":
|
7940
7895
|
return _context72.stop();
|
@@ -7985,8 +7940,8 @@ ds.HELP_LINK =
|
|
7985
7940
|
// eslint-disable-next-line max-len
|
7986
7941
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7987
7942
|
var Fo = ds;
|
7988
|
-
var Bo = /*#__PURE__*/function (
|
7989
|
-
_inherits(Bo,
|
7943
|
+
var Bo = /*#__PURE__*/function (_U9) {
|
7944
|
+
_inherits(Bo, _U9);
|
7990
7945
|
var _super31 = _createSuper(Bo);
|
7991
7946
|
// prettier-ignore
|
7992
7947
|
function Bo(e) {
|
@@ -8023,7 +7978,7 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
8023
7978
|
throw new Error("Request settings have not been set up");
|
8024
7979
|
case 2:
|
8025
7980
|
i = this.preprocessBody(t);
|
8026
|
-
|
7981
|
+
_.request(this, i, e);
|
8027
7982
|
case 4:
|
8028
7983
|
case "end":
|
8029
7984
|
return _context74.stop();
|
@@ -8065,9 +8020,9 @@ var Bo = /*#__PURE__*/function (_q9) {
|
|
8065
8020
|
}()
|
8066
8021
|
}]);
|
8067
8022
|
return Bo;
|
8068
|
-
}(
|
8069
|
-
var Qi = /*#__PURE__*/function (
|
8070
|
-
_inherits(ae,
|
8023
|
+
}(U);
|
8024
|
+
var Qi = /*#__PURE__*/function (_U10) {
|
8025
|
+
_inherits(ae, _U10);
|
8071
8026
|
var _super32 = _createSuper(ae);
|
8072
8027
|
function ae(e) {
|
8073
8028
|
var _l$headers, _c$OpenAIBeta;
|
@@ -8112,11 +8067,11 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8112
8067
|
if (this.sessionId) {
|
8113
8068
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
|
8114
8069
|
var n = this.processMessage(t, i);
|
8115
|
-
|
8070
|
+
_.request(this, n, e);
|
8116
8071
|
} else {
|
8117
8072
|
this.url = "".concat(ae.THREAD_PREFIX, "/runs");
|
8118
8073
|
var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
|
8119
|
-
|
8074
|
+
_.request(this, _n2, e);
|
8120
8075
|
}
|
8121
8076
|
this.messages = e;
|
8122
8077
|
}
|
@@ -8190,7 +8145,7 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8190
8145
|
method: "GET",
|
8191
8146
|
headers: (n = this.requestSettings) == null ? void 0 : n.headers
|
8192
8147
|
};
|
8193
|
-
return _context77.abrupt("return", (
|
8148
|
+
return _context77.abrupt("return", (_.executePollRequest(this, t, i, this.messages), {
|
8194
8149
|
makingAnotherRequest: !0
|
8195
8150
|
}));
|
8196
8151
|
case 6:
|
@@ -8241,7 +8196,7 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8241
8196
|
key: "extractPollResultData",
|
8242
8197
|
value: function () {
|
8243
8198
|
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(e) {
|
8244
|
-
var r, t, i, n;
|
8199
|
+
var r, o, t, i, c, n;
|
8245
8200
|
return _regeneratorRuntime().wrap(function _callee79$(_context79) {
|
8246
8201
|
while (1) switch (_context79.prev = _context79.next) {
|
8247
8202
|
case 0:
|
@@ -8255,32 +8210,33 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8255
8210
|
});
|
8256
8211
|
case 3:
|
8257
8212
|
if (!(t === "completed" && this.messages)) {
|
8258
|
-
_context79.next =
|
8213
|
+
_context79.next = 9;
|
8259
8214
|
break;
|
8260
8215
|
}
|
8261
8216
|
this.url = "".concat(ae.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
|
8262
8217
|
_context79.next = 7;
|
8263
8218
|
return O.directFetch(this, {}, "GET");
|
8264
8219
|
case 7:
|
8265
|
-
|
8266
|
-
|
8220
|
+
c = _context79.sent.data[0].content.find(function (d) {
|
8221
|
+
return !!d.text;
|
8222
|
+
});
|
8267
8223
|
return _context79.abrupt("return", {
|
8268
|
-
text:
|
8269
|
-
_sessionId:
|
8224
|
+
text: ((r = c == null ? void 0 : c.text) == null ? void 0 : r.value) || "",
|
8225
|
+
_sessionId: this.sessionId
|
8270
8226
|
});
|
8271
|
-
case
|
8272
|
-
n = (
|
8227
|
+
case 9:
|
8228
|
+
n = (o = i == null ? void 0 : i.submit_tool_outputs) == null ? void 0 : o.tool_calls;
|
8273
8229
|
if (!(t === "requires_action" && n)) {
|
8274
|
-
_context79.next =
|
8230
|
+
_context79.next = 14;
|
8275
8231
|
break;
|
8276
8232
|
}
|
8277
|
-
_context79.next =
|
8233
|
+
_context79.next = 13;
|
8278
8234
|
return this.handleTools(n);
|
8279
|
-
case
|
8235
|
+
case 13:
|
8280
8236
|
return _context79.abrupt("return", _context79.sent);
|
8281
|
-
case
|
8237
|
+
case 14:
|
8282
8238
|
throw Error("Thread run status: ".concat(t));
|
8283
|
-
case
|
8239
|
+
case 15:
|
8284
8240
|
case "end":
|
8285
8241
|
return _context79.stop();
|
8286
8242
|
}
|
@@ -8351,16 +8307,16 @@ var Qi = /*#__PURE__*/function (_q10) {
|
|
8351
8307
|
}()
|
8352
8308
|
}]);
|
8353
8309
|
return ae;
|
8354
|
-
}(
|
8310
|
+
}(U);
|
8355
8311
|
Qi.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
8356
8312
|
Qi.POLLING_TIMEOUT_MS = 800;
|
8357
8313
|
var zo = Qi;
|
8358
|
-
var ri = /*#__PURE__*/function (
|
8359
|
-
_inherits(
|
8360
|
-
var _super33 = _createSuper(
|
8361
|
-
function
|
8314
|
+
var ri = /*#__PURE__*/function (_U11) {
|
8315
|
+
_inherits(Se, _U11);
|
8316
|
+
var _super33 = _createSuper(Se);
|
8317
|
+
function Se(e) {
|
8362
8318
|
var _this35;
|
8363
|
-
_classCallCheck(this,
|
8319
|
+
_classCallCheck(this, Se);
|
8364
8320
|
var o;
|
8365
8321
|
var t = e.directConnection,
|
8366
8322
|
i = t == null ? void 0 : t.openAI,
|
@@ -8383,10 +8339,10 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8383
8339
|
}
|
8384
8340
|
};
|
8385
8341
|
}
|
8386
|
-
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage =
|
8342
|
+
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage = Se.canFileSendMessage;
|
8387
8343
|
return _this35;
|
8388
8344
|
}
|
8389
|
-
_createClass(
|
8345
|
+
_createClass(Se, [{
|
8390
8346
|
key: "preprocessBody",
|
8391
8347
|
value: function preprocessBody(e, t) {
|
8392
8348
|
var i = JSON.parse(JSON.stringify(e));
|
@@ -8400,11 +8356,11 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8400
8356
|
var n;
|
8401
8357
|
var r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
|
8402
8358
|
if (i[1] || r && r !== "") {
|
8403
|
-
this.url =
|
8359
|
+
this.url = Se.IMAGE_EDIT_URL;
|
8404
8360
|
var l = this.preprocessBody(this.rawBody, r);
|
8405
|
-
n =
|
8406
|
-
} else this.url =
|
8407
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
8361
|
+
n = Se.createFormDataBody(l, i[0], i[1]);
|
8362
|
+
} else this.url = Se.IMAGE_VARIATIONS_URL, n = Se.createFormDataBody(this.rawBody, i[0]);
|
8363
|
+
E.tempRemoveContentHeader(this.requestSettings, _.request.bind(this, this, n, e), !1);
|
8408
8364
|
}
|
8409
8365
|
}, {
|
8410
8366
|
key: "callServiceAPI",
|
@@ -8434,9 +8390,9 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8434
8390
|
}
|
8435
8391
|
throw new Error("Request settings have not been set up");
|
8436
8392
|
case 8:
|
8437
|
-
this.url =
|
8393
|
+
this.url = Se.IMAGE_GENERATION_URL;
|
8438
8394
|
r = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
8439
|
-
|
8395
|
+
_.request(this, r, e);
|
8440
8396
|
case 11:
|
8441
8397
|
case "end":
|
8442
8398
|
return _context81.stop();
|
@@ -8505,14 +8461,14 @@ var ri = /*#__PURE__*/function (_q11) {
|
|
8505
8461
|
}), n;
|
8506
8462
|
}
|
8507
8463
|
}]);
|
8508
|
-
return
|
8509
|
-
}(
|
8464
|
+
return Se;
|
8465
|
+
}(U);
|
8510
8466
|
ri.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
8511
8467
|
ri.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
8512
8468
|
ri.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
8513
|
-
var
|
8514
|
-
var dt = /*#__PURE__*/function (
|
8515
|
-
_inherits(dt,
|
8469
|
+
var Uo = ri;
|
8470
|
+
var dt = /*#__PURE__*/function (_U12) {
|
8471
|
+
_inherits(dt, _U12);
|
8516
8472
|
var _super34 = _createSuper(dt);
|
8517
8473
|
function dt(e) {
|
8518
8474
|
var _this36$maxMessages, _l$model;
|
@@ -8569,7 +8525,7 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8569
8525
|
throw new Error("Request settings have not been set up");
|
8570
8526
|
case 2:
|
8571
8527
|
i = this.preprocessBody(this.rawBody, t), n = this.deepChat.stream;
|
8572
|
-
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, I.request(this, i, e)) :
|
8528
|
+
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, I.request(this, i, e)) : _.request(this, i, e);
|
8573
8529
|
case 4:
|
8574
8530
|
case "end":
|
8575
8531
|
return _context83.stop();
|
@@ -8652,8 +8608,8 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8652
8608
|
break;
|
8653
8609
|
}
|
8654
8610
|
o.forEach(function (c, d) {
|
8655
|
-
var
|
8656
|
-
var u = (
|
8611
|
+
var p;
|
8612
|
+
var u = (p = e.tool_calls) == null ? void 0 : p[d];
|
8657
8613
|
n == null || n.messages.push({
|
8658
8614
|
role: "tool",
|
8659
8615
|
tool_call_id: u == null ? void 0 : u.id,
|
@@ -8718,14 +8674,14 @@ var dt = /*#__PURE__*/function (_q12) {
|
|
8718
8674
|
}
|
8719
8675
|
}]);
|
8720
8676
|
return dt;
|
8721
|
-
}(
|
8722
|
-
var
|
8723
|
-
_inherits(
|
8724
|
-
var _super35 = _createSuper(
|
8725
|
-
function
|
8677
|
+
}(U);
|
8678
|
+
var qo = /*#__PURE__*/function (_Yi3) {
|
8679
|
+
_inherits(qo, _Yi3);
|
8680
|
+
var _super35 = _createSuper(qo);
|
8681
|
+
function qo(e) {
|
8726
8682
|
var _this37$maxMessages;
|
8727
8683
|
var _this37;
|
8728
|
-
_classCallCheck(this,
|
8684
|
+
_classCallCheck(this, qo);
|
8729
8685
|
var r;
|
8730
8686
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8731
8687
|
i = (r = t.cohere) == null ? void 0 : r.chat,
|
@@ -8733,7 +8689,7 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8733
8689
|
_this37 = _super35.call(this, e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, n), _typeof(i) == "object" && Object.assign(_this37.rawBody, i), (_this37$maxMessages = _this37.maxMessages) !== null && _this37$maxMessages !== void 0 ? _this37$maxMessages : _this37.maxMessages = -1;
|
8734
8690
|
return _this37;
|
8735
8691
|
}
|
8736
|
-
_createClass(
|
8692
|
+
_createClass(qo, [{
|
8737
8693
|
key: "preprocessBody",
|
8738
8694
|
value: function preprocessBody(e, t) {
|
8739
8695
|
var i = JSON.parse(JSON.stringify(e)),
|
@@ -8762,7 +8718,7 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8762
8718
|
throw new Error("Request settings have not been set up");
|
8763
8719
|
case 2:
|
8764
8720
|
i = this.preprocessBody(this.rawBody, t);
|
8765
|
-
|
8721
|
+
_.request(this, i, e);
|
8766
8722
|
case 4:
|
8767
8723
|
case "end":
|
8768
8724
|
return _context86.stop();
|
@@ -8802,7 +8758,7 @@ var Uo = /*#__PURE__*/function (_Yi3) {
|
|
8802
8758
|
return extractResultData;
|
8803
8759
|
}()
|
8804
8760
|
}]);
|
8805
|
-
return
|
8761
|
+
return qo;
|
8806
8762
|
}(Yi);
|
8807
8763
|
var Ho = /*#__PURE__*/function () {
|
8808
8764
|
function Ho() {
|
@@ -8819,17 +8775,17 @@ var Ho = /*#__PURE__*/function () {
|
|
8819
8775
|
r = e.webModel;
|
8820
8776
|
if (r) return new $i(e);
|
8821
8777
|
if (t) {
|
8822
|
-
if (t.openAI) return t.openAI.images ? new
|
8778
|
+
if (t.openAI) return t.openAI.images ? new Uo(e) : t.openAI.speechToText ? new No(e) : t.openAI.textToSpeech ? new Oo(e) : t.openAI.assistant ? new zo(e) : new dt(e);
|
8823
8779
|
if (t.assemblyAI) return new Xi(e);
|
8824
|
-
if (t.cohere) return t.cohere.textGeneration ? new Lo(e) : t.cohere.summarization ? new Ro(e) : new
|
8825
|
-
if (t.huggingFace) return t.huggingFace.textGeneration ? new Mo(e) : t.huggingFace.summarization ? new Co(e) : t.huggingFace.translation ? new ko(e) : t.huggingFace.fillMask ? new Io(e) : t.huggingFace.questionAnswer ? new To(e) : t.huggingFace.audioSpeechRecognition ? new
|
8780
|
+
if (t.cohere) return t.cohere.textGeneration ? new Lo(e) : t.cohere.summarization ? new Ro(e) : new qo(e);
|
8781
|
+
if (t.huggingFace) return t.huggingFace.textGeneration ? new Mo(e) : t.huggingFace.summarization ? new Co(e) : t.huggingFace.translation ? new ko(e) : t.huggingFace.fillMask ? new Io(e) : t.huggingFace.questionAnswer ? new To(e) : t.huggingFace.audioSpeechRecognition ? new _o(e) : t.huggingFace.audioClassification ? new So(e) : t.huggingFace.imageClassification ? new wo(e) : new Ao(e);
|
8826
8782
|
if (t.azure) {
|
8827
8783
|
if (t.azure.speechToText) return new Fo(e);
|
8828
8784
|
if (t.azure.textToSpeech) return new jo(e);
|
8829
8785
|
if (t.azure.summarization) return new Do(e);
|
8830
8786
|
if (t.azure.translation) return new Bo(e);
|
8831
8787
|
}
|
8832
|
-
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new
|
8788
|
+
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new qt(e) : t.stabilityAI.imageToImageUpscale ? new zt(e) : t.stabilityAI.imageToImageMasking ? new Ut(e) : new Ht(e);
|
8833
8789
|
}
|
8834
8790
|
return i ? new Le(e) : new Le(e, void 0, n || !0);
|
8835
8791
|
}
|
@@ -8855,7 +8811,7 @@ var us = /*#__PURE__*/function () {
|
|
8855
8811
|
return zi;
|
8856
8812
|
}();
|
8857
8813
|
us.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
|
8858
|
-
var
|
8814
|
+
var Go = us;
|
8859
8815
|
var hs = /*#__PURE__*/_createClass(function hs() {
|
8860
8816
|
_classCallCheck(this, hs);
|
8861
8817
|
});
|
@@ -8911,21 +8867,21 @@ var en = /*#__PURE__*/function () {
|
|
8911
8867
|
}]);
|
8912
8868
|
return en;
|
8913
8869
|
}();
|
8914
|
-
var
|
8915
|
-
function
|
8916
|
-
_classCallCheck(this,
|
8870
|
+
var Vt = /*#__PURE__*/function () {
|
8871
|
+
function Vt(e, t, i) {
|
8872
|
+
_classCallCheck(this, Vt);
|
8917
8873
|
this._isDisplayed = !1, e ? (this._elementRef = this.createIntroPanelWithChild(e, i), this._isDisplayed = !0) : t && (this._elementRef = this.createInternalIntroPanel(t, i), this._isDisplayed = !0);
|
8918
8874
|
}
|
8919
|
-
_createClass(
|
8875
|
+
_createClass(Vt, [{
|
8920
8876
|
key: "createIntroPanelWithChild",
|
8921
8877
|
value: function createIntroPanelWithChild(e, t) {
|
8922
|
-
var i =
|
8878
|
+
var i = Vt.createIntroPanel(t);
|
8923
8879
|
return e.style.display === "none" && (e.style.display = "block"), i.appendChild(e), i;
|
8924
8880
|
}
|
8925
8881
|
}, {
|
8926
8882
|
key: "createInternalIntroPanel",
|
8927
8883
|
value: function createInternalIntroPanel(e, t) {
|
8928
|
-
var i =
|
8884
|
+
var i = Vt.createIntroPanel(t);
|
8929
8885
|
return i.id = "internal-intro-panel", i.innerHTML = e, i;
|
8930
8886
|
}
|
8931
8887
|
}, {
|
@@ -8945,17 +8901,17 @@ var Gt = /*#__PURE__*/function () {
|
|
8945
8901
|
return t.classList.add("intro-panel"), Object.assign(t.style, e), t;
|
8946
8902
|
}
|
8947
8903
|
}]);
|
8948
|
-
return
|
8904
|
+
return Vt;
|
8949
8905
|
}();
|
8950
|
-
var
|
8951
|
-
function
|
8952
|
-
_classCallCheck(this,
|
8906
|
+
var Vo = /*#__PURE__*/function () {
|
8907
|
+
function Vo() {
|
8908
|
+
_classCallCheck(this, Vo);
|
8953
8909
|
}
|
8954
|
-
_createClass(
|
8910
|
+
_createClass(Vo, null, [{
|
8955
8911
|
key: "getText",
|
8956
8912
|
value: function getText(e, t) {
|
8957
8913
|
var i, n;
|
8958
|
-
if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](
|
8914
|
+
if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](WORK).\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
|
8959
8915
|
if (e.directConnection) {
|
8960
8916
|
if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
|
8961
8917
|
var r = (i = e.directConnection.openAI) == null ? void 0 : i.chat;
|
@@ -8966,7 +8922,7 @@ var Go = /*#__PURE__*/function () {
|
|
8966
8922
|
return null;
|
8967
8923
|
}
|
8968
8924
|
}]);
|
8969
|
-
return
|
8925
|
+
return Vo;
|
8970
8926
|
}();
|
8971
8927
|
var Wo = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \n\t viewBox=\"50 30 420 450\" xml:space=\"preserve\">\n<g filter=\"brightness(0) saturate(100%) invert(16%) sepia(0%) saturate(1942%) hue-rotate(215deg) brightness(99%) contrast(93%)\">\n\t<g>\n\t\t<path d=\"M447.933,103.629c-0.034-3.076-1.224-6.09-3.485-8.352L352.683,3.511c-0.004-0.004-0.007-0.005-0.011-0.008\n\t\t\tC350.505,1.338,347.511,0,344.206,0H89.278C75.361,0,64.04,11.32,64.04,25.237v461.525c0,13.916,11.32,25.237,25.237,25.237\n\t\t\th333.444c13.916,0,25.237-11.32,25.237-25.237V103.753C447.96,103.709,447.937,103.672,447.933,103.629z M356.194,40.931\n\t\t\tl50.834,50.834h-49.572c-0.695,0-1.262-0.567-1.262-1.262V40.931z M423.983,486.763c0,0.695-0.566,1.261-1.261,1.261H89.278\n\t\t\tc-0.695,0-1.261-0.566-1.261-1.261V25.237c0-0.695,0.566-1.261,1.261-1.261h242.94v66.527c0,13.916,11.322,25.239,25.239,25.239\n\t\t\th66.527V486.763z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,164.014H149.912c-6.62,0-11.988,5.367-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.368,11.988-11.988C374.076,169.381,368.707,164.014,362.088,164.014z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,236.353H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.62,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.368,11.988-11.988C374.076,241.721,368.707,236.353,362.088,236.353z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M362.088,308.691H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988h212.175\n\t\t\tc6.62,0,11.988-5.367,11.988-11.988C374.076,314.06,368.707,308.691,362.088,308.691z\"/>\n\t</g>\n</g>\n<g>\n\t<g>\n\t\t<path d=\"M256,381.031H149.912c-6.62,0-11.988,5.368-11.988,11.988c0,6.621,5.368,11.988,11.988,11.988H256\n\t\t\tc6.62,0,11.988-5.367,11.988-11.988C267.988,386.398,262.62,381.031,256,381.031z\"/>\n\t</g>\n</g>\n</svg>";
|
8972
8928
|
var fe = /*#__PURE__*/function () {
|
@@ -9022,7 +8978,7 @@ var fe = /*#__PURE__*/function () {
|
|
9022
8978
|
t.classList.add("any-file-message-contents");
|
9023
8979
|
var i = document.createElement("div");
|
9024
8980
|
i.classList.add("any-file-message-icon-container");
|
9025
|
-
var n =
|
8981
|
+
var n = q.createSVGElement(Wo);
|
9026
8982
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9027
8983
|
var r = document.createElement("div");
|
9028
8984
|
return r.classList.add("any-file-message-text"), r.textContent = e.name || ne.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), ne.processContent(t, e.src);
|
@@ -9057,7 +9013,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9057
9013
|
var n = t.permittedErrorPrefixes,
|
9058
9014
|
r = t.introPanelMarkUp,
|
9059
9015
|
o = t.demo;
|
9060
|
-
_this38._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this38._onClearMessages = jt.onClearMessages.bind(_assertThisInitialized(_this38), e), _this38._onError = jt.onError.bind(_assertThisInitialized(_this38), e), _this38._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this38._permittedErrorPrefixes = n, _this38.addSetupMessageIfNeeded(e, t)
|
9016
|
+
_this38._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this38._onClearMessages = jt.onClearMessages.bind(_assertThisInitialized(_this38), e), _this38._onError = jt.onError.bind(_assertThisInitialized(_this38), e), _this38._displayLoadingMessage = me.getDisplayLoadingMessage(e, t), _this38._permittedErrorPrefixes = n, _this38.addSetupMessageIfNeeded(e, t) || _this38.populateIntroPanel(i, r, e.introPanelStyle), _this38.addIntroductoryMessage(e, t), e.initialMessages && _this38.populateInitialMessages(e.initialMessages), _this38._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
|
9061
9017
|
return JSON.parse(JSON.stringify(_this38.messages));
|
9062
9018
|
}, e.clearMessages = _this38.clearMessages.bind(_assertThisInitialized(_this38), t), e.refreshMessages = _this38.refreshTextMessages.bind(_assertThisInitialized(_this38)), e.scrollToBottom = Y.scrollToBottom.bind(_assertThisInitialized(_this38), _this38.elementRef), e._addMessage = function (c, d) {
|
9063
9019
|
_this38.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
|
@@ -9076,11 +9032,12 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9076
9032
|
}, {
|
9077
9033
|
key: "addSetupMessageIfNeeded",
|
9078
9034
|
value: function addSetupMessageIfNeeded(e, t) {
|
9079
|
-
var i =
|
9035
|
+
var i = Vo.getText(e, t);
|
9080
9036
|
if (i) {
|
9081
9037
|
var n = this.createAndAppendNewMessageElement(i, v.AI_ROLE);
|
9082
9038
|
this.applyCustomStyles(n, v.AI_ROLE, !1);
|
9083
9039
|
}
|
9040
|
+
return !!i;
|
9084
9041
|
}
|
9085
9042
|
// WORK - const file for deep chat classes
|
9086
9043
|
}, {
|
@@ -9109,7 +9066,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9109
9066
|
ke.processInitialMessageFile(t), _this39.addNewMessage(t, !0);
|
9110
9067
|
}), setTimeout(function () {
|
9111
9068
|
return Y.scrollToBottom(_this39.elementRef);
|
9112
|
-
});
|
9069
|
+
}, 0);
|
9113
9070
|
}
|
9114
9071
|
// this should not be activated by streamed messages
|
9115
9072
|
}, {
|
@@ -9150,7 +9107,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9150
9107
|
}, {
|
9151
9108
|
key: "addNewErrorMessage",
|
9152
9109
|
value: function addNewErrorMessage(e, t) {
|
9153
|
-
var l, c, d, u,
|
9110
|
+
var l, c, d, u, p;
|
9154
9111
|
this.removeMessageOnError();
|
9155
9112
|
var i = me.createBaseElements(),
|
9156
9113
|
n = i.outerContainer,
|
@@ -9159,7 +9116,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9159
9116
|
var o = this.getPermittedMessage(t) || ((l = this._errorMessageOverrides) == null ? void 0 : l[e]) || ((c = this._errorMessageOverrides) == null ? void 0 : c["default"]) || "Error, please try again.";
|
9160
9117
|
this.renderText(r, o);
|
9161
9118
|
var a = D.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
|
9162
|
-
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), Y.scrollToBottom(this.elementRef), this.textToSpeech && Nt.speak(o, this.textToSpeech), (
|
9119
|
+
D.applyCustomStylesToElements(i, !1, a), D.applyCustomStylesToElements(i, !1, (u = this.messageStyles) == null ? void 0 : u.error), this.elementRef.appendChild(n), Y.scrollToBottom(this.elementRef), this.textToSpeech && Nt.speak(o, this.textToSpeech), (p = this._onError) == null || p.call(this, o);
|
9163
9120
|
}
|
9164
9121
|
}, {
|
9165
9122
|
key: "getPermittedMessage",
|
@@ -9201,7 +9158,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9201
9158
|
}, {
|
9202
9159
|
key: "populateIntroPanel",
|
9203
9160
|
value: function populateIntroPanel(e, t, i) {
|
9204
|
-
(e || t) && (this._introPanel = new
|
9161
|
+
(e || t) && (this._introPanel = new Vt(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
9205
9162
|
}
|
9206
9163
|
}, {
|
9207
9164
|
key: "addMultipleFiles",
|
@@ -9270,7 +9227,7 @@ var me = /*#__PURE__*/function (_Ke) {
|
|
9270
9227
|
}]);
|
9271
9228
|
return me;
|
9272
9229
|
}(Ke);
|
9273
|
-
var
|
9230
|
+
var St = /*#__PURE__*/function () {
|
9274
9231
|
function W() {
|
9275
9232
|
_classCallCheck(this, W);
|
9276
9233
|
}
|
@@ -9306,11 +9263,11 @@ var _t = /*#__PURE__*/function () {
|
|
9306
9263
|
}]);
|
9307
9264
|
return W;
|
9308
9265
|
}();
|
9309
|
-
|
9310
|
-
|
9311
|
-
|
9312
|
-
|
9313
|
-
var Ko =
|
9266
|
+
St.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
|
9267
|
+
St.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
|
9268
|
+
St.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS = "text-input-container-left-small-adjustment";
|
9269
|
+
St.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS = "text-input-container-right-small-adjustment";
|
9270
|
+
var Ko = St;
|
9314
9271
|
var Qe = /*#__PURE__*/function () {
|
9315
9272
|
function Qe() {
|
9316
9273
|
_classCallCheck(this, Qe);
|
@@ -9345,7 +9302,7 @@ var Qe = /*#__PURE__*/function () {
|
|
9345
9302
|
}]);
|
9346
9303
|
return Qe;
|
9347
9304
|
}();
|
9348
|
-
var
|
9305
|
+
var Sn = ["camera", "gifs", "images", "audio", "mixedFiles", "submit", "microphone"];
|
9349
9306
|
var j = /*#__PURE__*/function () {
|
9350
9307
|
function j() {
|
9351
9308
|
_classCallCheck(this, j);
|
@@ -9359,7 +9316,7 @@ var j = /*#__PURE__*/function () {
|
|
9359
9316
|
}, {
|
9360
9317
|
key: "createElement",
|
9361
9318
|
value: function createElement(e, t) {
|
9362
|
-
return t ? j.createTextElement(e) :
|
9319
|
+
return t ? j.createTextElement(e) : q.createSVGElement(e);
|
9363
9320
|
}
|
9364
9321
|
}, {
|
9365
9322
|
key: "createCustomElement",
|
@@ -9430,14 +9387,14 @@ var te = /*#__PURE__*/function () {
|
|
9430
9387
|
}]);
|
9431
9388
|
return te;
|
9432
9389
|
}();
|
9433
|
-
var
|
9434
|
-
function
|
9435
|
-
_classCallCheck(this,
|
9390
|
+
var wt = /*#__PURE__*/function () {
|
9391
|
+
function wt(e, t, i, n) {
|
9392
|
+
_classCallCheck(this, wt);
|
9436
9393
|
this._mouseState = {
|
9437
9394
|
state: "default"
|
9438
9395
|
}, this.elementRef = e, this._customStyles = i, this.position = t, this.dropupText = n;
|
9439
9396
|
}
|
9440
|
-
_createClass(
|
9397
|
+
_createClass(wt, [{
|
9441
9398
|
key: "buttonMouseLeave",
|
9442
9399
|
value: function buttonMouseLeave(e) {
|
9443
9400
|
this._mouseState.state = "default", e && (te.unsetAllCSS(this.elementRef, e), te.setElementsCSS(this.elementRef, e, "default"));
|
@@ -9481,7 +9438,7 @@ var St = /*#__PURE__*/function () {
|
|
9481
9438
|
i && te.setElementCssUpToState(this.elementRef, i, this._mouseState.state), this.setEvents(i);
|
9482
9439
|
}
|
9483
9440
|
}]);
|
9484
|
-
return
|
9441
|
+
return wt;
|
9485
9442
|
}();
|
9486
9443
|
var gt = /*#__PURE__*/function () {
|
9487
9444
|
function gt() {
|
@@ -9505,11 +9462,11 @@ var gt = /*#__PURE__*/function () {
|
|
9505
9462
|
}]);
|
9506
9463
|
return gt;
|
9507
9464
|
}();
|
9508
|
-
var
|
9509
|
-
function
|
9510
|
-
_classCallCheck(this,
|
9465
|
+
var _e = /*#__PURE__*/function () {
|
9466
|
+
function _e() {
|
9467
|
+
_classCallCheck(this, _e);
|
9511
9468
|
}
|
9512
|
-
_createClass(
|
9469
|
+
_createClass(_e, null, [{
|
9513
9470
|
key: "addItemEvents",
|
9514
9471
|
value: function addItemEvents(e, t, i, n) {
|
9515
9472
|
Te.add(t, n), t.addEventListener("click", function () {
|
@@ -9536,7 +9493,7 @@ var we = /*#__PURE__*/function () {
|
|
9536
9493
|
key: "populateItem",
|
9537
9494
|
value: function populateItem(e, t, i, n) {
|
9538
9495
|
var r = e.children[0];
|
9539
|
-
r.classList.contains("text-button") ? t.appendChild(
|
9496
|
+
r.classList.contains("text-button") ? t.appendChild(_e.createItemText(r.textContent, n == null ? void 0 : n.text)) : (t.appendChild(_e.createItemIcon(e, n == null ? void 0 : n.iconContainer)), t.appendChild(_e.createItemText(i, n == null ? void 0 : n.text)));
|
9540
9497
|
}
|
9541
9498
|
// prettier-ignore
|
9542
9499
|
}, {
|
@@ -9546,16 +9503,16 @@ var we = /*#__PURE__*/function () {
|
|
9546
9503
|
var n = t.elementRef,
|
9547
9504
|
r = t.dropupText,
|
9548
9505
|
o = document.createElement("div");
|
9549
|
-
Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]),
|
9506
|
+
Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), _e.populateItem(n, o, r, i), o.classList.add("dropup-menu-item");
|
9550
9507
|
var a = T.processStateful((i == null ? void 0 : i.item) || {}, {
|
9551
9508
|
backgroundColor: "#f3f3f3"
|
9552
9509
|
}, {
|
9553
9510
|
backgroundColor: "#ebebeb"
|
9554
9511
|
});
|
9555
|
-
return
|
9512
|
+
return _e.addItemEvents(e, o, n, a), o;
|
9556
9513
|
}
|
9557
9514
|
}]);
|
9558
|
-
return
|
9515
|
+
return _e;
|
9559
9516
|
}();
|
9560
9517
|
var tn = /*#__PURE__*/function () {
|
9561
9518
|
function tn(e, t) {
|
@@ -9584,21 +9541,27 @@ var tn = /*#__PURE__*/function () {
|
|
9584
9541
|
}, {
|
9585
9542
|
key: "addItem",
|
9586
9543
|
value: function addItem(e) {
|
9587
|
-
var t =
|
9544
|
+
var t = _e.createItem(this, e, this._styles);
|
9588
9545
|
this.elementRef.appendChild(t);
|
9589
9546
|
}
|
9590
9547
|
// prettier-ignore
|
9591
9548
|
}, {
|
9592
9549
|
key: "addWindowEvents",
|
9593
9550
|
value: function addWindowEvents(e) {
|
9594
|
-
|
9595
|
-
|
9596
|
-
|
9597
|
-
|
9598
|
-
|
9599
|
-
|
9600
|
-
|
9601
|
-
|
9551
|
+
this.clickEvent = this.windowClick.bind(this, e), window.addEventListener("click", this.clickEvent), this.keyDownEvent = this.windowKeyDown.bind(this, e), window.addEventListener("keydown", this.keyDownEvent);
|
9552
|
+
}
|
9553
|
+
}, {
|
9554
|
+
key: "windowClick",
|
9555
|
+
value: function windowClick(e, t) {
|
9556
|
+
var i;
|
9557
|
+
!e.isConnected && this.clickEvent ? window.removeEventListener("click", this.clickEvent) : e.parentElement !== ((i = t.target.shadowRoot) == null ? void 0 : i.children[0]) && this.close();
|
9558
|
+
}
|
9559
|
+
// prettier-ignore
|
9560
|
+
}, {
|
9561
|
+
key: "windowKeyDown",
|
9562
|
+
value: function windowKeyDown(e, t) {
|
9563
|
+
var i, n, r;
|
9564
|
+
!e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === R.ESCAPE ? (this.close(), (i = this.highlightedItem) == null || i.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ENTER ? ((n = this.highlightedItem) == null || n.click(), (r = this.highlightedItem) == null || r.dispatchEvent(new MouseEvent("mouseleave"))) : t.key === R.ARROW_DOWN ? gt.focusSiblingItem(this.highlightedItem || this.elementRef.children[this.elementRef.children.length - 1], this.elementRef, !0) : t.key === R.ARROW_UP && gt.focusSiblingItem(this.highlightedItem || this.elementRef.children[0], this.elementRef, !1));
|
9602
9565
|
}
|
9603
9566
|
}], [{
|
9604
9567
|
key: "createElement",
|
@@ -9609,19 +9572,19 @@ var tn = /*#__PURE__*/function () {
|
|
9609
9572
|
}]);
|
9610
9573
|
return tn;
|
9611
9574
|
}();
|
9612
|
-
var Je = /*#__PURE__*/function (
|
9613
|
-
_inherits(Je,
|
9575
|
+
var Je = /*#__PURE__*/function (_wt) {
|
9576
|
+
_inherits(Je, _wt);
|
9614
9577
|
var _super37 = _createSuper(Je);
|
9615
9578
|
function Je(e, t) {
|
9616
|
-
var
|
9579
|
+
var _this41;
|
9617
9580
|
_classCallCheck(this, Je);
|
9618
9581
|
var n;
|
9619
|
-
|
9582
|
+
_this41 = _super37.call(this, Je.createButtonElement(), void 0, {
|
9620
9583
|
styles: (n = t == null ? void 0 : t.button) == null ? void 0 : n.styles
|
9621
9584
|
});
|
9622
|
-
var i =
|
9623
|
-
|
9624
|
-
return
|
9585
|
+
var i = _this41.createInnerElements(_this41._customStyles);
|
9586
|
+
_this41._menu = new tn(e, t == null ? void 0 : t.menu), _this41.addClickEvent(), _this41.buttonContainer = Je.createButtonContainer(), _this41.elementRef.appendChild(i.styles), _this41.buttonContainer.appendChild(_this41.elementRef), _this41.elementRef.classList.add("dropup-icon", "upload-file-button"), _this41.buttonContainer.appendChild(_this41._menu.elementRef), _this41.reapplyStateStyle("styles"), _this41.addContainerEvents(e);
|
9587
|
+
return _this41;
|
9625
9588
|
}
|
9626
9589
|
_createClass(Je, [{
|
9627
9590
|
key: "createInnerElements",
|
@@ -9648,9 +9611,9 @@ var Je = /*#__PURE__*/function (_St) {
|
|
9648
9611
|
}, {
|
9649
9612
|
key: "addContainerEvents",
|
9650
9613
|
value: function addContainerEvents(e) {
|
9651
|
-
var
|
9614
|
+
var _this42 = this;
|
9652
9615
|
e.addEventListener("click", function (t) {
|
9653
|
-
t.target.classList.contains("dropup-icon") ||
|
9616
|
+
t.target.classList.contains("dropup-icon") || _this42._menu.close();
|
9654
9617
|
});
|
9655
9618
|
}
|
9656
9619
|
}], [{
|
@@ -9662,7 +9625,7 @@ var Je = /*#__PURE__*/function (_St) {
|
|
9662
9625
|
}, {
|
9663
9626
|
key: "createSVGIconElement",
|
9664
9627
|
value: function createSVGIconElement() {
|
9665
|
-
var e =
|
9628
|
+
var e = q.createSVGElement(Jo);
|
9666
9629
|
return e.id = "dropup-icon", e;
|
9667
9630
|
}
|
9668
9631
|
}, {
|
@@ -9679,7 +9642,7 @@ var Je = /*#__PURE__*/function (_St) {
|
|
9679
9642
|
}
|
9680
9643
|
}]);
|
9681
9644
|
return Je;
|
9682
|
-
}(
|
9645
|
+
}(wt);
|
9683
9646
|
var F = /*#__PURE__*/function () {
|
9684
9647
|
function F() {
|
9685
9648
|
_classCallCheck(this, F);
|
@@ -9690,7 +9653,7 @@ var F = /*#__PURE__*/function () {
|
|
9690
9653
|
// prettier-ignore
|
9691
9654
|
function addToDropup(e, t, i, n) {
|
9692
9655
|
var r = new Je(i, n);
|
9693
|
-
|
9656
|
+
Sn.forEach(function (a) {
|
9694
9657
|
var l = t["dropup-menu"].findIndex(function (d) {
|
9695
9658
|
return d.buttonType === a;
|
9696
9659
|
}),
|
@@ -9740,7 +9703,7 @@ var F = /*#__PURE__*/function () {
|
|
9740
9703
|
r && F.setPosition(e, n, t[r]);
|
9741
9704
|
}), t["inside-right"].length === 0 && e.submit && F.setPosition(e, "submit", t["inside-right"]), t["outside-right"].length === 0 && (e.submit ? F.setPosition(e, "submit", t["outside-right"]) : e.microphone ? F.setPosition(e, "microphone", t["outside-right"]) : e.camera && F.setPosition(e, "camera", t["outside-right"])), e.submit && F.setPosition(e, "submit", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]), e.microphone && F.setPosition(e, "microphone", t["outside-left"].length === 0 ? t["outside-left"] : t["inside-right"]);
|
9742
9705
|
var i = Object.keys(e);
|
9743
|
-
return i.length > 1 || t["dropup-menu"].length > 0 ?
|
9706
|
+
return i.length > 1 || t["dropup-menu"].length > 0 ? Sn.forEach(function (n) {
|
9744
9707
|
e[n] && t["dropup-menu"].push(_objectSpread(_objectSpread({}, e[n]), {}, {
|
9745
9708
|
buttonType: n
|
9746
9709
|
}));
|
@@ -9785,10 +9748,10 @@ var $o = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
|
|
9785
9748
|
var ue = /*#__PURE__*/function () {
|
9786
9749
|
// prettier-ignore
|
9787
9750
|
function ue(e, t, i, n) {
|
9788
|
-
var
|
9751
|
+
var _this43 = this;
|
9789
9752
|
_classCallCheck(this, ue);
|
9790
9753
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = n, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
9791
|
-
|
9754
|
+
_this43._validationHandler = e._validationHandler;
|
9792
9755
|
});
|
9793
9756
|
}
|
9794
9757
|
_createClass(ue, [{
|
@@ -9804,7 +9767,7 @@ var ue = /*#__PURE__*/function () {
|
|
9804
9767
|
var r = ue.createImageAttachment(t);
|
9805
9768
|
this.addFileAttachment(e, "image", r, i);
|
9806
9769
|
} else if (n === "audio") {
|
9807
|
-
var _r2 =
|
9770
|
+
var _r2 = Ui.createAudioAttachment(t);
|
9808
9771
|
this.addFileAttachment(e, "audio", _r2, i);
|
9809
9772
|
} else {
|
9810
9773
|
var _r3 = ue.createAnyFileAttachment(e.name);
|
@@ -9845,7 +9808,7 @@ var ue = /*#__PURE__*/function () {
|
|
9845
9808
|
return r === e;
|
9846
9809
|
}),
|
9847
9810
|
i = this._attachments[t].attachmentContainerElement;
|
9848
|
-
this._attachments.splice(t, 1),
|
9811
|
+
this._attachments.splice(t, 1), Ui.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (n = this._validationHandler) == null || n.call(this);
|
9849
9812
|
}
|
9850
9813
|
}, {
|
9851
9814
|
key: "getFiles",
|
@@ -9917,24 +9880,24 @@ var ue = /*#__PURE__*/function () {
|
|
9917
9880
|
return ue;
|
9918
9881
|
}();
|
9919
9882
|
var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\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>",
|
9920
|
-
|
9883
|
+
wn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\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>",
|
9921
9884
|
ps = /*#__PURE__*/function (_ue) {
|
9922
|
-
_inherits(
|
9923
|
-
var _super38 = _createSuper(
|
9885
|
+
_inherits(we, _ue);
|
9886
|
+
var _super38 = _createSuper(we);
|
9924
9887
|
// prettier-ignore
|
9925
|
-
function
|
9926
|
-
_classCallCheck(this,
|
9888
|
+
function we(e, t, i, n) {
|
9889
|
+
_classCallCheck(this, we);
|
9927
9890
|
return _super38.call(this, e, t, i, n);
|
9928
9891
|
}
|
9929
|
-
_createClass(
|
9892
|
+
_createClass(we, [{
|
9930
9893
|
key: "createTimer",
|
9931
9894
|
value: function createTimer(e, t) {
|
9932
|
-
var
|
9895
|
+
var _this44 = this;
|
9933
9896
|
var i = 0;
|
9934
|
-
var n = t !== void 0 && t <
|
9897
|
+
var n = t !== void 0 && t < we.TIMER_LIMIT_S ? t : we.TIMER_LIMIT_S;
|
9935
9898
|
return setInterval(function () {
|
9936
9899
|
var a;
|
9937
|
-
i += 1, i === n && ((a =
|
9900
|
+
i += 1, i === n && ((a = _this44.stopPlaceholderCallback) == null || a.call(_this44), _this44.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
9938
9901
|
var r = Math.floor(i / 60),
|
9939
9902
|
o = (i % 60).toString().padStart(2, "0");
|
9940
9903
|
e.textContent = "".concat(r, ":").concat(o);
|
@@ -9943,18 +9906,18 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9943
9906
|
}, {
|
9944
9907
|
key: "createPlaceholderAudioAttachment",
|
9945
9908
|
value: function createPlaceholderAudioAttachment(e) {
|
9946
|
-
var t =
|
9909
|
+
var t = we.createAudioContainer(),
|
9947
9910
|
i = document.createElement("div");
|
9948
9911
|
i.classList.add("audio-placeholder-text-3-digits");
|
9949
9912
|
var n = document.createElement("div");
|
9950
9913
|
n.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), n.appendChild(i);
|
9951
|
-
var r =
|
9914
|
+
var r = q.createSVGElement(wn);
|
9952
9915
|
return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(n), this.addPlaceholderAudioAttachmentEvents(t, r, n), t;
|
9953
9916
|
}
|
9954
9917
|
}, {
|
9955
9918
|
key: "addPlaceholderAudioAttachmentEvents",
|
9956
9919
|
value: function addPlaceholderAudioAttachmentEvents(e, t, i) {
|
9957
|
-
var
|
9920
|
+
var _this45 = this;
|
9958
9921
|
var n = function n() {
|
9959
9922
|
return e.replaceChildren(t);
|
9960
9923
|
};
|
@@ -9965,7 +9928,7 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9965
9928
|
e.addEventListener("mouseleave", r);
|
9966
9929
|
var o = function o() {
|
9967
9930
|
var a;
|
9968
|
-
return (a =
|
9931
|
+
return (a = _this45.stopPlaceholderCallback) == null ? void 0 : a.call(_this45);
|
9969
9932
|
};
|
9970
9933
|
e.addEventListener("click", o);
|
9971
9934
|
}
|
@@ -9980,7 +9943,7 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
9980
9943
|
key: "completePlaceholderAttachment",
|
9981
9944
|
value: function completePlaceholderAttachment(e, t) {
|
9982
9945
|
var i = this._activePlaceholderAttachment;
|
9983
|
-
i && (i.file = e,
|
9946
|
+
i && (i.file = e, we.addAudioElements(i.attachmentContainerElement.children[0], t), i.removeButton = this.createRemoveAttachmentButton(i), i.attachmentContainerElement.appendChild(i.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
|
9984
9947
|
}
|
9985
9948
|
}, {
|
9986
9949
|
key: "removePlaceholderAttachment",
|
@@ -10004,9 +9967,9 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10004
9967
|
var i = e.parentElement ? Y.cloneElement(e) : e,
|
10005
9968
|
n = document.createElement("audio");
|
10006
9969
|
n.src = t;
|
10007
|
-
var r =
|
9970
|
+
var r = q.createSVGElement(ea);
|
10008
9971
|
r.classList.add("attachment-icon", "play-icon");
|
10009
|
-
var o =
|
9972
|
+
var o = q.createSVGElement(wn);
|
10010
9973
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), n.onplay = function () {
|
10011
9974
|
i.replaceChildren(o);
|
10012
9975
|
}, n.onpause = function () {
|
@@ -10020,8 +9983,8 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10020
9983
|
}, {
|
10021
9984
|
key: "createAudioAttachment",
|
10022
9985
|
value: function createAudioAttachment(e) {
|
10023
|
-
var t =
|
10024
|
-
return
|
9986
|
+
var t = we.createAudioContainer();
|
9987
|
+
return we.addAudioElements(t, e), t;
|
10025
9988
|
}
|
10026
9989
|
}, {
|
10027
9990
|
key: "stopAttachmentPlayback",
|
@@ -10030,10 +9993,10 @@ var ea = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10030
9993
|
(n = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && n.classList.contains("stop-icon") && e.children[0].click();
|
10031
9994
|
}
|
10032
9995
|
}]);
|
10033
|
-
return
|
9996
|
+
return we;
|
10034
9997
|
}(ue);
|
10035
9998
|
ps.TIMER_LIMIT_S = 5999;
|
10036
|
-
var
|
9999
|
+
var Ui = ps;
|
10037
10000
|
var ta = /*#__PURE__*/function () {
|
10038
10001
|
function ta() {
|
10039
10002
|
_classCallCheck(this, ta);
|
@@ -10043,20 +10006,20 @@ var ta = /*#__PURE__*/function () {
|
|
10043
10006
|
value:
|
10044
10007
|
// prettier-ignore
|
10045
10008
|
function create(e, t, i, n, r) {
|
10046
|
-
return r === "audio" ? new
|
10009
|
+
return r === "audio" ? new Ui(e, t, i, n) : new ue(e, t, i, n);
|
10047
10010
|
}
|
10048
10011
|
}]);
|
10049
10012
|
return ta;
|
10050
10013
|
}();
|
10051
|
-
var
|
10052
|
-
function
|
10053
|
-
_classCallCheck(this,
|
10014
|
+
var _t = /*#__PURE__*/function () {
|
10015
|
+
function _t(e, t, i) {
|
10016
|
+
_classCallCheck(this, _t);
|
10054
10017
|
this._fileAttachmentsTypes = [], this.elementRef = this.createAttachmentContainer();
|
10055
10018
|
var n = _typeof(i) == "object" && !!i.displayFileAttachmentContainer;
|
10056
10019
|
this.toggleContainerDisplay(n), e.appendChild(this.elementRef), t && Object.assign(this.elementRef.style, t);
|
10057
10020
|
}
|
10058
10021
|
// prettier-ignore
|
10059
|
-
_createClass(
|
10022
|
+
_createClass(_t, [{
|
10060
10023
|
key: "addType",
|
10061
10024
|
value: function addType(e, t, i) {
|
10062
10025
|
var n = ta.create(e, t, this.toggleContainerDisplay.bind(this), this.elementRef, i);
|
@@ -10120,7 +10083,7 @@ var wt = /*#__PURE__*/function () {
|
|
10120
10083
|
}, {
|
10121
10084
|
key: "addFilesToAnyType",
|
10122
10085
|
value: function addFilesToAnyType(e) {
|
10123
|
-
|
10086
|
+
_t.addFilesToType(e, this._fileAttachmentsTypes);
|
10124
10087
|
}
|
10125
10088
|
}, {
|
10126
10089
|
key: "removeAllFiles",
|
@@ -10145,12 +10108,12 @@ var wt = /*#__PURE__*/function () {
|
|
10145
10108
|
});
|
10146
10109
|
}
|
10147
10110
|
}]);
|
10148
|
-
return
|
10111
|
+
return _t;
|
10149
10112
|
}();
|
10150
10113
|
var fs = /*#__PURE__*/function () {
|
10151
10114
|
function le(e, t, i) {
|
10152
10115
|
_classCallCheck(this, le);
|
10153
|
-
this._isOpen = !1, this._contentRef = le.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = le.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = le.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = le.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
|
10116
|
+
this._isOpen = !1, this._contentRef = le.createModalContent(t, i == null ? void 0 : i.backgroundColor), this._buttonPanel = le.createButtonPanel(i == null ? void 0 : i.backgroundColor), this._elementRef = le.createContainer(this._contentRef, i), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = le.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents(e);
|
10154
10117
|
}
|
10155
10118
|
_createClass(le, [{
|
10156
10119
|
key: "isOpen",
|
@@ -10160,20 +10123,20 @@ var fs = /*#__PURE__*/function () {
|
|
10160
10123
|
}, {
|
10161
10124
|
key: "addButtons",
|
10162
10125
|
value: function addButtons() {
|
10163
|
-
var
|
10126
|
+
var _this46 = this;
|
10164
10127
|
for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
10165
10128
|
e[_key2] = arguments[_key2];
|
10166
10129
|
}
|
10167
10130
|
e.forEach(function (t) {
|
10168
|
-
return
|
10131
|
+
return _this46._buttonPanel.appendChild(t);
|
10169
10132
|
});
|
10170
10133
|
}
|
10171
10134
|
}, {
|
10172
10135
|
key: "close",
|
10173
10136
|
value: function close() {
|
10174
|
-
var
|
10137
|
+
var _this47 = this;
|
10175
10138
|
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 () {
|
10176
|
-
|
10139
|
+
_this47._elementRef.style.display = "none", _this47._backgroundPanelRef.style.display = "none";
|
10177
10140
|
}, le.MODAL_CLOSE_TIMEOUT_MS);
|
10178
10141
|
}
|
10179
10142
|
}, {
|
@@ -10189,22 +10152,24 @@ var fs = /*#__PURE__*/function () {
|
|
10189
10152
|
}, {
|
10190
10153
|
key: "addCloseButton",
|
10191
10154
|
value: function addCloseButton(e, t, i) {
|
10192
|
-
var
|
10155
|
+
var _this48 = this;
|
10193
10156
|
var n = t ? le.createSVGButton(e) : le.createTextButton(e);
|
10194
10157
|
return this.addButtons(n), n.onclick = function () {
|
10195
|
-
|
10158
|
+
_this48.close(), setTimeout(function () {
|
10196
10159
|
i == null || i();
|
10197
10160
|
}, 140);
|
10198
10161
|
}, n;
|
10199
10162
|
}
|
10200
10163
|
}, {
|
10201
10164
|
key: "addWindowEvents",
|
10202
|
-
value: function addWindowEvents() {
|
10203
|
-
|
10204
|
-
|
10205
|
-
|
10206
|
-
|
10207
|
-
|
10165
|
+
value: function addWindowEvents(e) {
|
10166
|
+
this.keyDownEvent = this.windowKeyDown.bind(this, e), window.addEventListener("keydown", this.keyDownEvent);
|
10167
|
+
}
|
10168
|
+
}, {
|
10169
|
+
key: "windowKeyDown",
|
10170
|
+
value: function windowKeyDown(e, t) {
|
10171
|
+
var i, n;
|
10172
|
+
!e.isConnected && this.keyDownEvent ? window.removeEventListener("keydown", this.keyDownEvent) : this._isOpen && (t.key === R.ESCAPE ? (this.close(), (i = this.extensionCloseCallback) == null || i.call(this)) : t.key === R.ENTER && (this.close(), (n = this.extensionCloseCallback) == null || n.call(this)));
|
10208
10173
|
}
|
10209
10174
|
}], [{
|
10210
10175
|
key: "createContainer",
|
@@ -10242,7 +10207,7 @@ var fs = /*#__PURE__*/function () {
|
|
10242
10207
|
value: function createSVGButton(e) {
|
10243
10208
|
var t = document.createElement("div");
|
10244
10209
|
t.classList.add("modal-button", "modal-svg-button");
|
10245
|
-
var i =
|
10210
|
+
var i = q.createSVGElement(e);
|
10246
10211
|
return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
|
10247
10212
|
}
|
10248
10213
|
}, {
|
@@ -10259,18 +10224,18 @@ var fs = /*#__PURE__*/function () {
|
|
10259
10224
|
}();
|
10260
10225
|
fs.MODAL_CLOSE_TIMEOUT_MS = 190;
|
10261
10226
|
var at = fs;
|
10262
|
-
var ut = /*#__PURE__*/function (
|
10263
|
-
_inherits(ut,
|
10227
|
+
var ut = /*#__PURE__*/function (_wt2) {
|
10228
|
+
_inherits(ut, _wt2);
|
10264
10229
|
var _super39 = _createSuper(ut);
|
10265
10230
|
// prettier-ignore
|
10266
10231
|
function ut(e, t, i, n, r, o) {
|
10267
|
-
var
|
10232
|
+
var _this49;
|
10268
10233
|
_classCallCheck(this, ut);
|
10269
|
-
var l, c, d, u,
|
10270
|
-
|
10271
|
-
var a =
|
10272
|
-
|
10273
|
-
return
|
10234
|
+
var l, c, d, u, p, h;
|
10235
|
+
_this49 = _super39.call(this, ut.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o);
|
10236
|
+
var a = _this49.createInnerElements(n, r, _this49._customStyles);
|
10237
|
+
_this49._inputElement = ut.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this49.addClickEvent(e, i), _this49.elementRef.replaceChildren(a.styles), _this49.reapplyStateStyle("styles"), _this49._fileAttachmentsType = t, _this49._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (h = (p = i.files) == null ? void 0 : p.infoModal) == null ? void 0 : h.openModalOnce;
|
10238
|
+
return _this49;
|
10274
10239
|
}
|
10275
10240
|
_createClass(ut, [{
|
10276
10241
|
key: "createInnerElements",
|
@@ -10288,7 +10253,7 @@ var ut = /*#__PURE__*/function (_St2) {
|
|
10288
10253
|
}, {
|
10289
10254
|
key: "import",
|
10290
10255
|
value: function _import(e) {
|
10291
|
-
|
10256
|
+
_t.addFilesToType(Array.from(e.files || []), [this._fileAttachmentsType]), e.value = "";
|
10292
10257
|
}
|
10293
10258
|
}, {
|
10294
10259
|
key: "createInnerElement",
|
@@ -10322,12 +10287,12 @@ var ut = /*#__PURE__*/function (_St2) {
|
|
10322
10287
|
}, {
|
10323
10288
|
key: "createSVGIconElement",
|
10324
10289
|
value: function createSVGIconElement(e, t) {
|
10325
|
-
var i =
|
10290
|
+
var i = q.createSVGElement(t);
|
10326
10291
|
return i.id = e, i;
|
10327
10292
|
}
|
10328
10293
|
}]);
|
10329
10294
|
return ut;
|
10330
|
-
}(
|
10295
|
+
}(wt);
|
10331
10296
|
var de = /*#__PURE__*/function () {
|
10332
10297
|
function de() {
|
10333
10298
|
_classCallCheck(this, de);
|
@@ -10484,14 +10449,14 @@ var Me = /*#__PURE__*/function () {
|
|
10484
10449
|
return Me;
|
10485
10450
|
}();
|
10486
10451
|
var ia = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\" width=\"1.4em\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t viewBox=\"0 0 490.9 490.9\" xml:space=\"preserve\">\n\t<g>\n\t\t<g>\n\t\t\t<path d=\"M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5\n\t\t\t\tC149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5\n\t\t\t\tc0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z\"/>\n\t\t\t<path d=\"M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3\n\t\t\t\ts5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8\n\t\t\t\tc0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9\n\t\t\t\tC106.6,220,101.2,214.5,94.4,214.5z\"/>\n\t\t</g>\n\t</g>\n</svg>\n";
|
10487
|
-
var bt = /*#__PURE__*/function (
|
10488
|
-
_inherits(bt,
|
10452
|
+
var bt = /*#__PURE__*/function (_wt3) {
|
10453
|
+
_inherits(bt, _wt3);
|
10489
10454
|
var _super40 = _createSuper(bt);
|
10490
10455
|
function bt(e) {
|
10491
|
-
var
|
10456
|
+
var _this50;
|
10492
10457
|
_classCallCheck(this, bt);
|
10493
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"),
|
10494
|
-
return
|
10458
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this50 = _super40.call(this, bt.createMicrophoneElement(), e == null ? void 0 : e.position, e), _this50.isActive = !1, _this50._innerElements = _this50.createInnerElements(_this50._customStyles), _this50.changeToDefault();
|
10459
|
+
return _this50;
|
10495
10460
|
}
|
10496
10461
|
_createClass(bt, [{
|
10497
10462
|
key: "createInnerElements",
|
@@ -10555,12 +10520,12 @@ var bt = /*#__PURE__*/function (_St3) {
|
|
10555
10520
|
}, {
|
10556
10521
|
key: "createSVGIconElement",
|
10557
10522
|
value: function createSVGIconElement() {
|
10558
|
-
var e =
|
10523
|
+
var e = q.createSVGElement(ia);
|
10559
10524
|
return e.id = "microphone-icon", e;
|
10560
10525
|
}
|
10561
10526
|
}]);
|
10562
10527
|
return bt;
|
10563
|
-
}(
|
10528
|
+
}(wt);
|
10564
10529
|
var ms = {},
|
10565
10530
|
oi = {},
|
10566
10531
|
ai = {},
|
@@ -10628,7 +10593,7 @@ Object.defineProperty(ai, "__esModule", {
|
|
10628
10593
|
value: !0
|
10629
10594
|
});
|
10630
10595
|
ai.WebSpeechTranscript = void 0;
|
10631
|
-
var
|
10596
|
+
var _n = Mt;
|
10632
10597
|
var ra = /*#__PURE__*/function () {
|
10633
10598
|
function ra() {
|
10634
10599
|
_classCallCheck(this, ra);
|
@@ -10639,7 +10604,7 @@ var ra = /*#__PURE__*/function () {
|
|
10639
10604
|
var n = "";
|
10640
10605
|
for (var r = e.resultIndex; r < e.results.length; ++r) {
|
10641
10606
|
var o = e.results[r][0].transcript;
|
10642
|
-
i && (o =
|
10607
|
+
i && (o = _n.Translate.translate(o, i)), e.results[r].isFinal ? t += o : n += o;
|
10643
10608
|
}
|
10644
10609
|
return {
|
10645
10610
|
interimTranscript: n,
|
@@ -10654,7 +10619,7 @@ var ra = /*#__PURE__*/function () {
|
|
10654
10619
|
var r = "";
|
10655
10620
|
for (var o = e.resultIndex; o < e.results.length; ++o) {
|
10656
10621
|
var a = e.results[o][0].transcript;
|
10657
|
-
i && (a =
|
10622
|
+
i && (a = _n.Translate.translate(a, i)), n += a;
|
10658
10623
|
}
|
10659
10624
|
return {
|
10660
10625
|
interimTranscript: r,
|
@@ -10698,9 +10663,9 @@ var J = /*#__PURE__*/function () {
|
|
10698
10663
|
}, {
|
10699
10664
|
key: "keyDownWindow",
|
10700
10665
|
value: function keyDownWindow(e) {
|
10701
|
-
var
|
10666
|
+
var _this51 = this;
|
10702
10667
|
e.element && J.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (J.KEY_DOWN_TIMEOUT !== null && clearTimeout(J.KEY_DOWN_TIMEOUT), J.KEY_DOWN_TIMEOUT = setTimeout(function () {
|
10703
|
-
J.KEY_DOWN_TIMEOUT = null,
|
10668
|
+
J.KEY_DOWN_TIMEOUT = null, _this51.resetRecording(e);
|
10704
10669
|
}, 500));
|
10705
10670
|
}
|
10706
10671
|
}, {
|
@@ -11005,31 +10970,31 @@ var K = /*#__PURE__*/function () {
|
|
11005
10970
|
if (!c || !n || !i) return;
|
11006
10971
|
var d = ((o = c.settings) === null || o === void 0 ? void 0 : o.caseSensitive) === !0 ? t : t.toLowerCase(),
|
11007
10972
|
u = Cn.Text.breakupIntoWordsArr(d),
|
11008
|
-
|
11009
|
-
if (c.commandMode &&
|
10973
|
+
p = ((a = c.settings) === null || a === void 0 ? void 0 : a.substrings) === !1 ? K.checkIfMatchesWord : K.checkIfMatchesSubstring;
|
10974
|
+
if (c.commandMode && p(c.commandMode, d, u)) return e.setInterimColorToFinal(), setTimeout(function () {
|
11010
10975
|
return K.toggleCommandModeOn(e);
|
11011
10976
|
}), {
|
11012
10977
|
doNotProcessTranscription: !1
|
11013
10978
|
};
|
11014
10979
|
if (!(c.commandMode && !e.isWaitingForCommand)) {
|
11015
|
-
if (c.stop &&
|
10980
|
+
if (c.stop && p(c.stop, d, u)) return K.toggleCommandModeOff(e), setTimeout(function () {
|
11016
10981
|
return e.stop();
|
11017
10982
|
}), {
|
11018
10983
|
doNotProcessTranscription: !1
|
11019
10984
|
};
|
11020
|
-
if (c.pause &&
|
11021
|
-
var
|
11022
|
-
e.isPaused = !0, (
|
10985
|
+
if (c.pause && p(c.pause, d, u)) return K.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
|
10986
|
+
var h;
|
10987
|
+
e.isPaused = !0, (h = e.onPauseTrigger) === null || h === void 0 || h.call(e, !0);
|
11023
10988
|
}), {
|
11024
10989
|
doNotProcessTranscription: !1
|
11025
10990
|
};
|
11026
|
-
if (c.resume &&
|
10991
|
+
if (c.resume && p(c.resume, d, u)) return e.isPaused = !1, (l = e.onPauseTrigger) === null || l === void 0 || l.call(e, !1), K.toggleCommandModeOff(e), e.resetRecording(i), {
|
11027
10992
|
doNotProcessTranscription: !0
|
11028
10993
|
};
|
11029
|
-
if (c.reset &&
|
10994
|
+
if (c.reset && p(c.reset, d, u)) return r !== void 0 && K.setText(e, i, r, n), {
|
11030
10995
|
doNotProcessTranscription: !0
|
11031
10996
|
};
|
11032
|
-
if (c.removeAllText &&
|
10997
|
+
if (c.removeAllText && p(c.removeAllText, d, u)) return K.setText(e, i, "", n), {
|
11033
10998
|
doNotProcessTranscription: !0
|
11034
10999
|
};
|
11035
11000
|
}
|
@@ -11102,7 +11067,7 @@ Object.defineProperty(ui, "__esModule", {
|
|
11102
11067
|
ui.Padding = void 0;
|
11103
11068
|
var ua = je,
|
11104
11069
|
An = Fe,
|
11105
|
-
|
11070
|
+
Ue = De;
|
11106
11071
|
var Kt = /*#__PURE__*/function () {
|
11107
11072
|
function Kt() {
|
11108
11073
|
_classCallCheck(this, Kt);
|
@@ -11115,11 +11080,11 @@ var Kt = /*#__PURE__*/function () {
|
|
11115
11080
|
r = t.value[n - 1],
|
11116
11081
|
o = t.selectionEnd === null ? n : t.selectionEnd,
|
11117
11082
|
a = t.value[o];
|
11118
|
-
|
11083
|
+
Ue.Text.isCharDefined(r) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), Ue.Text.isCharDefined(a) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === o;
|
11119
11084
|
return;
|
11120
11085
|
}
|
11121
11086
|
var i = t.value[t.value.length - 1];
|
11122
|
-
|
11087
|
+
Ue.Text.isCharDefined(i) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), e.isCursorAtEnd = !0;
|
11123
11088
|
}
|
11124
11089
|
}, {
|
11125
11090
|
key: "setStateForGenericElement",
|
@@ -11132,12 +11097,12 @@ var Kt = /*#__PURE__*/function () {
|
|
11132
11097
|
c = (i = t.textContent) === null || i === void 0 ? void 0 : i[l - 1],
|
11133
11098
|
d = An.Cursor.getGenericElementCursorOffset(t, a, !1),
|
11134
11099
|
u = (n = t.textContent) === null || n === void 0 ? void 0 : n[d];
|
11135
|
-
|
11100
|
+
Ue.Text.isCharDefined(c) && (e.startPadding = " "), Ue.Text.isCharDefined(u) && (e.endPadding = " "), e.isCursorAtEnd = ((r = t.textContent) === null || r === void 0 ? void 0 : r.length) === d;
|
11136
11101
|
return;
|
11137
11102
|
}
|
11138
11103
|
}
|
11139
11104
|
var o = t.innerText.charAt(t.innerText.length - 1);
|
11140
|
-
|
11105
|
+
Ue.Text.isCharDefined(o) && (e.startPadding = " "), e.isCursorAtEnd = !0;
|
11141
11106
|
}
|
11142
11107
|
}, {
|
11143
11108
|
key: "setState",
|
@@ -11321,22 +11286,22 @@ var Jt = /*#__PURE__*/function (_fa$Speech) {
|
|
11321
11286
|
}, {
|
11322
11287
|
key: "setEvents",
|
11323
11288
|
value: function setEvents() {
|
11324
|
-
var
|
11289
|
+
var _this52 = this;
|
11325
11290
|
this._service && (this._service.onstart = function () {
|
11326
|
-
|
11291
|
+
_this52.setStateOnStart();
|
11327
11292
|
}, this._service.onerror = function (e) {
|
11328
|
-
Nn.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" &&
|
11293
|
+
Nn.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" && _this52.isRestarting || e.error !== "no-speech" && _this52.error(e.message || e.error);
|
11329
11294
|
}, this._service.onaudioend = function () {
|
11330
|
-
|
11295
|
+
_this52.setStateOnStop();
|
11331
11296
|
}, this._service.onend = function () {
|
11332
|
-
|
11297
|
+
_this52._stopping = !1;
|
11333
11298
|
}, this._service.onresult = function (e) {
|
11334
|
-
if (_typeof(e.results) > "u" &&
|
11335
|
-
var
|
11336
|
-
t =
|
11337
|
-
_i17 =
|
11338
|
-
n =
|
11339
|
-
|
11299
|
+
if (_typeof(e.results) > "u" && _this52._service) _this52._service.onend = null, _this52._service.stop();else if (_this52._extractText && !_this52._stopping) {
|
11300
|
+
var _this52$_extractText = _this52._extractText(e, _this52.finalTranscript, _this52._translations),
|
11301
|
+
t = _this52$_extractText.interimTranscript,
|
11302
|
+
_i17 = _this52$_extractText.finalTranscript,
|
11303
|
+
n = _this52$_extractText.newText;
|
11304
|
+
_this52.updateElements(t, _i17, n);
|
11340
11305
|
}
|
11341
11306
|
});
|
11342
11307
|
}
|
@@ -11556,10 +11521,10 @@ var Yt = /*#__PURE__*/function (_va$Speech) {
|
|
11556
11521
|
_inherits(Yt, _va$Speech);
|
11557
11522
|
var _super42 = _createSuper(Yt);
|
11558
11523
|
function Yt() {
|
11559
|
-
var
|
11524
|
+
var _this53;
|
11560
11525
|
_classCallCheck(this, Yt);
|
11561
|
-
|
11562
|
-
return
|
11526
|
+
_this53 = _super42.apply(this, arguments), _this53._newTextPadding = "";
|
11527
|
+
return _this53;
|
11563
11528
|
}
|
11564
11529
|
_createClass(Yt, [{
|
11565
11530
|
key: "start",
|
@@ -11687,12 +11652,12 @@ var Yt = /*#__PURE__*/function (_va$Speech) {
|
|
11687
11652
|
}, {
|
11688
11653
|
key: "retrieveTokenInterval",
|
11689
11654
|
value: function retrieveTokenInterval(e) {
|
11690
|
-
var
|
11655
|
+
var _this54 = this;
|
11691
11656
|
this._retrieveTokenInterval = setInterval(function () {
|
11692
11657
|
e == null || e().then(function (t) {
|
11693
|
-
|
11658
|
+
_this54._service && (_this54._service.authorizationToken = (t == null ? void 0 : t.trim()) || "");
|
11694
11659
|
})["catch"](function (t) {
|
11695
|
-
|
11660
|
+
_this54.error(t);
|
11696
11661
|
});
|
11697
11662
|
}, 1e4);
|
11698
11663
|
}
|
@@ -11774,18 +11739,18 @@ var Zt = /*#__PURE__*/function (_bt) {
|
|
11774
11739
|
_inherits(Zt, _bt);
|
11775
11740
|
var _super43 = _createSuper(Zt);
|
11776
11741
|
function Zt(e, t, i) {
|
11777
|
-
var
|
11742
|
+
var _this55;
|
11778
11743
|
_classCallCheck(this, Zt);
|
11779
11744
|
var o;
|
11780
|
-
|
11745
|
+
_this55 = _super43.call(this, _typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {});
|
11781
11746
|
var _Zt$processConfigurat = Zt.processConfiguration(t, e.speechToText),
|
11782
11747
|
n = _Zt$processConfigurat.serviceName,
|
11783
11748
|
r = _Zt$processConfigurat.processedConfig;
|
11784
|
-
if (
|
11749
|
+
if (_this55._addErrorMessage = i, n === "webspeech" && !Li.isWebSpeechSupported()) _this55.changeToUnsupported();else {
|
11785
11750
|
var a = !e.textInput || !e.textInput.disabled;
|
11786
|
-
|
11751
|
+
_this55.elementRef.onclick = _this55.buttonClick.bind(_assertThisInitialized(_this55), t, a, n, r);
|
11787
11752
|
}
|
11788
|
-
return
|
11753
|
+
return _this55;
|
11789
11754
|
}
|
11790
11755
|
// prettier-ignore
|
11791
11756
|
_createClass(Zt, [{
|
@@ -11866,11 +11831,11 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11866
11831
|
_inherits(Ea, _bt2);
|
11867
11832
|
var _super44 = _createSuper(Ea);
|
11868
11833
|
function Ea(e, t) {
|
11869
|
-
var
|
11834
|
+
var _this56;
|
11870
11835
|
_classCallCheck(this, Ea);
|
11871
11836
|
var i, n;
|
11872
|
-
|
11873
|
-
return
|
11837
|
+
_this56 = _super44.call(this, t.button), _this56._waitingForBrowserApproval = !1, _this56._audioType = e, _this56._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this56._maxDurationSeconds = (n = t.files) == null ? void 0 : n.maxDurationSeconds, _this56.elementRef.onclick = _this56.buttonClick.bind(_assertThisInitialized(_this56));
|
11838
|
+
return _this56;
|
11874
11839
|
}
|
11875
11840
|
_createClass(Ea, [{
|
11876
11841
|
key: "buttonClick",
|
@@ -11880,10 +11845,10 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11880
11845
|
}, {
|
11881
11846
|
key: "stop",
|
11882
11847
|
value: function stop() {
|
11883
|
-
var
|
11848
|
+
var _this57 = this;
|
11884
11849
|
return new Promise(function (e) {
|
11885
11850
|
var t, i;
|
11886
|
-
|
11851
|
+
_this57.changeToDefault(), (t = _this57._mediaRecorder) == null || t.stop(), (i = _this57._mediaStream) == null || i.getTracks().forEach(function (n) {
|
11887
11852
|
return n.stop();
|
11888
11853
|
}), setTimeout(function () {
|
11889
11854
|
e();
|
@@ -11893,23 +11858,23 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11893
11858
|
}, {
|
11894
11859
|
key: "record",
|
11895
11860
|
value: function record() {
|
11896
|
-
var
|
11861
|
+
var _this58 = this;
|
11897
11862
|
navigator.mediaDevices.getUserMedia({
|
11898
11863
|
audio: !0
|
11899
11864
|
}).then(function (e) {
|
11900
|
-
|
11901
|
-
|
11902
|
-
}),
|
11865
|
+
_this58.changeToActive(), _this58._mediaRecorder = new MediaRecorder(e), _this58._audioType.addPlaceholderAttachment(_this58.stop.bind(_this58), _this58._maxDurationSeconds), _this58._mediaStream = e, _this58._mediaRecorder.addEventListener("dataavailable", function (t) {
|
11866
|
+
_this58.createFile(t);
|
11867
|
+
}), _this58._mediaRecorder.start();
|
11903
11868
|
})["catch"](function (e) {
|
11904
|
-
console.error(e),
|
11869
|
+
console.error(e), _this58.stop();
|
11905
11870
|
})["finally"](function () {
|
11906
|
-
|
11871
|
+
_this58._waitingForBrowserApproval = !1;
|
11907
11872
|
});
|
11908
11873
|
}
|
11909
11874
|
}, {
|
11910
11875
|
key: "createFile",
|
11911
11876
|
value: function createFile(e) {
|
11912
|
-
var
|
11877
|
+
var _this59 = this;
|
11913
11878
|
var t = new Blob([e.data], {
|
11914
11879
|
type: "audio/".concat(this._extension)
|
11915
11880
|
}),
|
@@ -11919,13 +11884,13 @@ var Ea = /*#__PURE__*/function (_bt2) {
|
|
11919
11884
|
}),
|
11920
11885
|
r = new FileReader();
|
11921
11886
|
r.readAsDataURL(n), r.onload = function (o) {
|
11922
|
-
|
11887
|
+
_this59._audioType.completePlaceholderAttachment(n, o.target.result);
|
11923
11888
|
};
|
11924
11889
|
}
|
11925
11890
|
}]);
|
11926
11891
|
return Ea;
|
11927
11892
|
}(bt);
|
11928
|
-
var
|
11893
|
+
var Sa = "<?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";
|
11929
11894
|
var B = /*#__PURE__*/function () {
|
11930
11895
|
function B() {
|
11931
11896
|
_classCallCheck(this, B);
|
@@ -11994,24 +11959,24 @@ var Ce = /*#__PURE__*/function () {
|
|
11994
11959
|
}]);
|
11995
11960
|
return Ce;
|
11996
11961
|
}();
|
11997
|
-
var yi = /*#__PURE__*/function (
|
11998
|
-
_inherits(k,
|
11962
|
+
var yi = /*#__PURE__*/function (_wt4) {
|
11963
|
+
_inherits(k, _wt4);
|
11999
11964
|
var _super45 = _createSuper(k);
|
12000
11965
|
// prettier-ignore
|
12001
11966
|
function k(e, t, i, n, r) {
|
12002
|
-
var
|
11967
|
+
var _this60;
|
12003
11968
|
_classCallCheck(this, k);
|
12004
11969
|
var o = Ce.process(e.submitButtonStyles);
|
12005
|
-
|
11970
|
+
_this60 = _super45.call(this, k.createButtonContainerElement(), o == null ? void 0 : o.position, o), _this60._isSVGLoadingIconOverriden = !1, _this60.status = {
|
12006
11971
|
requestInProgress: !1,
|
12007
11972
|
loadingActive: !1
|
12008
|
-
},
|
11973
|
+
}, _this60._messages = i, _this60._inputElementRef = t, _this60._fileAttachments = r, _this60._innerElements = _this60.createInnerElements(), _this60._abortStream = new AbortController(), _this60._stopClicked = {
|
12009
11974
|
listener: function listener() {}
|
12010
|
-
},
|
11975
|
+
}, _this60._serviceIO = n, _this60._alwaysEnabled = !!(o != null && o.alwaysEnabled), e.disableSubmitButton = _this60.disableSubmitButton.bind(_assertThisInitialized(_this60), n), _this60.attemptOverwriteLoadingStyle(e), setTimeout(function () {
|
12011
11976
|
var a;
|
12012
|
-
|
11977
|
+
_this60._validationHandler = e._validationHandler, _this60.assignHandlers(_this60._validationHandler), (a = _this60._validationHandler) == null || a.call(_assertThisInitialized(_this60));
|
12013
11978
|
});
|
12014
|
-
return
|
11979
|
+
return _this60;
|
12015
11980
|
}
|
12016
11981
|
// prettier-ignore
|
12017
11982
|
_createClass(k, [{
|
@@ -12100,7 +12065,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12100
12065
|
key: "programmaticSubmit",
|
12101
12066
|
value: function () {
|
12102
12067
|
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee100(e) {
|
12103
|
-
var
|
12068
|
+
var _this61 = this;
|
12104
12069
|
var t;
|
12105
12070
|
return _regeneratorRuntime().wrap(function _callee100$(_context100) {
|
12106
12071
|
while (1) switch (_context100.prev = _context100.next) {
|
@@ -12115,7 +12080,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12115
12080
|
type: ue.getTypeFromBlob(i)
|
12116
12081
|
};
|
12117
12082
|
})), setTimeout(function () {
|
12118
|
-
return
|
12083
|
+
return _this61.attemptSubmit(t, !0);
|
12119
12084
|
});
|
12120
12085
|
case 3:
|
12121
12086
|
case "end":
|
@@ -12159,7 +12124,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12159
12124
|
return this.addNewMessage(e);
|
12160
12125
|
case 10:
|
12161
12126
|
this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
|
12162
|
-
|
12127
|
+
qi.clear(this._inputElementRef);
|
12163
12128
|
i = (o = e.files) == null ? void 0 : o.map(function (l) {
|
12164
12129
|
return l.file;
|
12165
12130
|
}), n = {
|
@@ -12262,7 +12227,7 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12262
12227
|
}, {
|
12263
12228
|
key: "createSubmitIconElement",
|
12264
12229
|
value: function createSubmitIconElement() {
|
12265
|
-
var e =
|
12230
|
+
var e = q.createSVGElement(Sa);
|
12266
12231
|
return e.id = "submit-icon", e;
|
12267
12232
|
}
|
12268
12233
|
}, {
|
@@ -12279,12 +12244,12 @@ var yi = /*#__PURE__*/function (_St4) {
|
|
12279
12244
|
}
|
12280
12245
|
}]);
|
12281
12246
|
return k;
|
12282
|
-
}(
|
12247
|
+
}(wt);
|
12283
12248
|
yi.SUBMIT_CLASS = "submit-button";
|
12284
12249
|
yi.LOADING_CLASS = "loading-button";
|
12285
12250
|
yi.DISABLED_CLASS = "disabled-button";
|
12286
|
-
var
|
12287
|
-
var
|
12251
|
+
var wa = yi;
|
12252
|
+
var _a = "<?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",
|
12288
12253
|
Ma = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
|
12289
12254
|
Ta = "<?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>",
|
12290
12255
|
Ca = "<?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>";
|
@@ -12293,14 +12258,14 @@ var sn = /*#__PURE__*/function (_at) {
|
|
12293
12258
|
var _super46 = _createSuper(sn);
|
12294
12259
|
// prettier-ignore
|
12295
12260
|
function sn(e, t, i, n) {
|
12296
|
-
var
|
12261
|
+
var _this62;
|
12297
12262
|
_classCallCheck(this, sn);
|
12298
|
-
|
12299
|
-
var
|
12300
|
-
r =
|
12301
|
-
o =
|
12302
|
-
|
12303
|
-
return
|
12263
|
+
_this62 = _super46.call(this, e, ["modal-content", "modal-camera-content"], i), _this62._stopped = !1, _this62._format = "image/png", _this62._canvas = document.createElement("canvas"), _this62._canvas.classList.add("camera-modal-canvas");
|
12264
|
+
var _this62$addButtonsAnd = _this62.addButtonsAndTheirEvents(t),
|
12265
|
+
r = _this62$addButtonsAnd.captureButton,
|
12266
|
+
o = _this62$addButtonsAnd.submitButton;
|
12267
|
+
_this62._captureButton = r, _this62._submitButton = o, _this62._captureIcon = _this62._captureButton.children[0], _this62._refreshIcon = q.createSVGElement(_a), _this62._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this62._format = "image/jpeg"), n != null && n.dimensions && (_this62._dimensions = n.dimensions), _this62._contentRef.appendChild(_this62._canvas), _this62.extensionCloseCallback = _this62.stop;
|
12268
|
+
return _this62;
|
12304
12269
|
}
|
12305
12270
|
_createClass(sn, [{
|
12306
12271
|
key: "addButtonsAndTheirEvents",
|
@@ -12319,38 +12284,38 @@ var sn = /*#__PURE__*/function (_at) {
|
|
12319
12284
|
}, {
|
12320
12285
|
key: "addButtonEvents",
|
12321
12286
|
value: function addButtonEvents(e, t, i, n) {
|
12322
|
-
var
|
12287
|
+
var _this63 = this;
|
12323
12288
|
e.onclick = function () {
|
12324
|
-
|
12289
|
+
_this63.capture();
|
12325
12290
|
}, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
|
12326
|
-
var r =
|
12327
|
-
r &&
|
12291
|
+
var r = _this63.getFile();
|
12292
|
+
r && _t.addFilesToType([r], [n]), _this63.stop(), _this63.close();
|
12328
12293
|
};
|
12329
12294
|
}
|
12330
12295
|
}, {
|
12331
12296
|
key: "stop",
|
12332
12297
|
value: function stop() {
|
12333
|
-
var
|
12298
|
+
var _this64 = this;
|
12334
12299
|
this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
|
12335
12300
|
return e.stop();
|
12336
12301
|
}), this._stopped = !0, setTimeout(function () {
|
12337
|
-
|
12338
|
-
var e =
|
12339
|
-
e == null || e.clearRect(0, 0,
|
12302
|
+
_this64._captureButton.replaceChildren(_this64._captureIcon), _this64._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
|
12303
|
+
var e = _this64._canvas.getContext("2d");
|
12304
|
+
e == null || e.clearRect(0, 0, _this64._canvas.width, _this64._canvas.height);
|
12340
12305
|
}, at.MODAL_CLOSE_TIMEOUT_MS);
|
12341
12306
|
}
|
12342
12307
|
}, {
|
12343
12308
|
key: "start",
|
12344
12309
|
value: function start() {
|
12345
|
-
var
|
12310
|
+
var _this65 = this;
|
12346
12311
|
this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
|
12347
12312
|
video: this._dimensions || !0
|
12348
12313
|
}).then(function (e) {
|
12349
|
-
if (
|
12314
|
+
if (_this65._mediaStream = e, !_this65.isOpen()) return _this65.stop();
|
12350
12315
|
var t = document.createElement("video");
|
12351
|
-
t.srcObject = e, t.play(), requestAnimationFrame(
|
12316
|
+
t.srcObject = e, t.play(), requestAnimationFrame(_this65.updateCanvas.bind(_this65, t, _this65._canvas));
|
12352
12317
|
})["catch"](function (e) {
|
12353
|
-
console.error(e),
|
12318
|
+
console.error(e), _this65.stop(), _this65.close();
|
12354
12319
|
});
|
12355
12320
|
}
|
12356
12321
|
}, {
|
@@ -12404,17 +12369,17 @@ var sn = /*#__PURE__*/function (_at) {
|
|
12404
12369
|
return sn;
|
12405
12370
|
}(at);
|
12406
12371
|
var Aa = "<?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>";
|
12407
|
-
var Xt = /*#__PURE__*/function (
|
12408
|
-
_inherits(Xt,
|
12372
|
+
var Xt = /*#__PURE__*/function (_wt5) {
|
12373
|
+
_inherits(Xt, _wt5);
|
12409
12374
|
var _super47 = _createSuper(Xt);
|
12410
12375
|
function Xt(e, t, i) {
|
12411
|
-
var
|
12376
|
+
var _this66;
|
12412
12377
|
_classCallCheck(this, Xt);
|
12413
12378
|
var r;
|
12414
|
-
|
12415
|
-
var n =
|
12416
|
-
i &&
|
12417
|
-
return
|
12379
|
+
_this66 = _super47.call(this, Xt.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo");
|
12380
|
+
var n = _this66.createInnerElements(_this66._customStyles);
|
12381
|
+
i && _this66.addClickEvent(e, t, i.modalContainerStyle, i.files), _this66.elementRef.classList.add("upload-file-button"), _this66.elementRef.appendChild(n.styles), _this66.reapplyStateStyle("styles");
|
12382
|
+
return _this66;
|
12418
12383
|
}
|
12419
12384
|
_createClass(Xt, [{
|
12420
12385
|
key: "createInnerElements",
|
@@ -12445,24 +12410,23 @@ var Xt = /*#__PURE__*/function (_St5) {
|
|
12445
12410
|
}, {
|
12446
12411
|
key: "createSVGIconElement",
|
12447
12412
|
value: function createSVGIconElement() {
|
12448
|
-
var e =
|
12413
|
+
var e = q.createSVGElement(Aa);
|
12449
12414
|
return e.id = "camera-icon", e;
|
12450
12415
|
}
|
12451
12416
|
}]);
|
12452
12417
|
return Xt;
|
12453
|
-
}(
|
12418
|
+
}(wt);
|
12454
12419
|
var pt = /*#__PURE__*/function () {
|
12455
|
-
// prettier-ignore
|
12456
12420
|
function pt(e, t, i, n) {
|
12457
12421
|
_classCallCheck(this, pt);
|
12458
12422
|
this.elementRef = pt.createPanelElement(e.inputAreaStyle);
|
12459
|
-
var r = new
|
12423
|
+
var r = new qi(e, i),
|
12460
12424
|
o = {},
|
12461
12425
|
a = this.createFileUploadComponents(e, i, n, o);
|
12462
12426
|
e.speechToText && !o.microphone && (o.microphone = {
|
12463
12427
|
button: new Zt(e, r, t.addNewErrorMessage.bind(t))
|
12464
12428
|
});
|
12465
|
-
var l = new
|
12429
|
+
var l = new wa(e, r.inputElementRef, t, i, a);
|
12466
12430
|
r.submit = l.submitFromInput.bind(l), Me.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
12467
12431
|
button: l
|
12468
12432
|
}, pt.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
|
@@ -12473,7 +12437,7 @@ var pt = /*#__PURE__*/function () {
|
|
12473
12437
|
// prettier-ignore
|
12474
12438
|
function createFileUploadComponents(e, t, i, n) {
|
12475
12439
|
var o, a, l, c;
|
12476
|
-
var r = new
|
12440
|
+
var r = new _t(this.elementRef, e.attachmentContainerStyle, t.demo);
|
12477
12441
|
if (pt.createUploadButtons(e, t.fileTypes || {}, r, i, n), (o = t.camera) != null && o.files) {
|
12478
12442
|
var d = ((a = n.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
|
12479
12443
|
n.camera = {
|
@@ -12506,10 +12470,10 @@ var pt = /*#__PURE__*/function () {
|
|
12506
12470
|
_Qo$a = Qo[a],
|
12507
12471
|
d = _Qo$a.id,
|
12508
12472
|
u = _Qo$a.svgString,
|
12509
|
-
|
12510
|
-
|
12473
|
+
p = _Qo$a.dropupText,
|
12474
|
+
h = new ut(n, c, l, d, u, p);
|
12511
12475
|
r[a] = {
|
12512
|
-
button:
|
12476
|
+
button: h,
|
12513
12477
|
fileType: c
|
12514
12478
|
};
|
12515
12479
|
}
|
@@ -12561,22 +12525,22 @@ var b = /*#__PURE__*/function (_vo) {
|
|
12561
12525
|
_inherits(b, _vo);
|
12562
12526
|
var _super48 = _createSuper(b);
|
12563
12527
|
function b() {
|
12564
|
-
var
|
12528
|
+
var _this67;
|
12565
12529
|
_classCallCheck(this, b);
|
12566
|
-
|
12530
|
+
_this67 = _super48.call(this), _this67.getMessages = function () {
|
12567
12531
|
return [];
|
12568
|
-
},
|
12532
|
+
}, _this67.submitUserMessage = function () {
|
12569
12533
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
12570
|
-
},
|
12571
|
-
return Qt.focusFromParentElement(
|
12572
|
-
},
|
12534
|
+
}, _this67.focusInput = function () {
|
12535
|
+
return Qt.focusFromParentElement(_this67._elementRef);
|
12536
|
+
}, _this67.refreshMessages = function () {}, _this67.clearMessages = function () {}, _this67.scrollToBottom = function () {}, _this67.disableSubmitButton = function () {}, _this67._hasBeenRendered = !1, _this67._auxiliaryStyleApplied = !1, _this67._addMessage = function () {
|
12573
12537
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
12574
|
-
},
|
12538
|
+
}, Go.appendStyleSheetToHead(), _this67._elementRef = document.createElement("div"), _this67._elementRef.id = "container", _this67.attachShadow({
|
12575
12539
|
mode: "open"
|
12576
|
-
}).appendChild(
|
12577
|
-
|
12540
|
+
}).appendChild(_this67._elementRef), Ei.apply(ka, _this67.shadowRoot), setTimeout(function () {
|
12541
|
+
_this67._hasBeenRendered || _this67.onRender();
|
12578
12542
|
}, 20);
|
12579
|
-
return
|
12543
|
+
return _this67;
|
12580
12544
|
}
|
12581
12545
|
_createClass(b, [{
|
12582
12546
|
key: "changeToChatView",
|
@@ -12588,7 +12552,7 @@ var b = /*#__PURE__*/function (_vo) {
|
|
12588
12552
|
key: "onRender",
|
12589
12553
|
value: function onRender() {
|
12590
12554
|
var _this$_childElement;
|
12591
|
-
(!this._activeService || this._activeService.demo) && (this._activeService = Ho.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Ei.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Ei.applyDefaultStyleToComponent(this.style, this.chatStyle), ke.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Dt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof
|
12555
|
+
(!this._activeService || this._activeService.demo) && (this._activeService = Ho.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Ei.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Ei.applyDefaultStyleToComponent(this.style, this.chatStyle), ke.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Dt.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof U) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], rn.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof U && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, jt.onRender(this);
|
12592
12556
|
}
|
12593
12557
|
}, {
|
12594
12558
|
key: "disconnectedCallback",
|