deep-chat-dev 9.0.2 → 9.0.3

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/dist/deepChat.js CHANGED
@@ -375,9 +375,9 @@ var ErrorMessages = {
375
375
  return t != null && t.includes("application/json") ? e.json() : t != null && t.includes("text/plain") || !t ? e : e.blob();
376
376
  }
377
377
  }, {
378
- key: "processResponseInterceptor",
378
+ key: "processRequestInterceptor",
379
379
  value: function () {
380
- var _processResponseInterceptor = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, t) {
380
+ var _processRequestInterceptor = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, t) {
381
381
  var a, n, s, o;
382
382
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
383
383
  while (1) switch (_context2.prev = _context2.next) {
@@ -406,10 +406,10 @@ var ErrorMessages = {
406
406
  }
407
407
  }, _callee2);
408
408
  }));
409
- function processResponseInterceptor(_x4, _x5) {
410
- return _processResponseInterceptor.apply(this, arguments);
409
+ function processRequestInterceptor(_x4, _x5) {
410
+ return _processRequestInterceptor.apply(this, arguments);
411
411
  }
412
- return processResponseInterceptor;
412
+ return processRequestInterceptor;
413
413
  }()
414
414
  }]);
415
415
  return D;
@@ -420,29 +420,29 @@ function getBytes(_x6, _x7) {
420
420
  return _getBytes.apply(this, arguments);
421
421
  }
422
422
  function _getBytes() {
423
- _getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(r, e) {
423
+ _getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(r, e) {
424
424
  var t, n;
425
- return _regeneratorRuntime().wrap(function _callee73$(_context73) {
426
- while (1) switch (_context73.prev = _context73.next) {
425
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
426
+ while (1) switch (_context74.prev = _context74.next) {
427
427
  case 0:
428
428
  t = r.getReader();
429
429
  case 1:
430
- _context73.next = 3;
430
+ _context74.next = 3;
431
431
  return t.read();
432
432
  case 3:
433
- if ((n = _context73.sent).done) {
434
- _context73.next = 7;
433
+ if ((n = _context74.sent).done) {
434
+ _context74.next = 7;
435
435
  break;
436
436
  }
437
437
  e(n.value);
438
438
  case 5:
439
- _context73.next = 1;
439
+ _context74.next = 1;
440
440
  break;
441
441
  case 7:
442
442
  case "end":
443
- return _context73.stop();
443
+ return _context74.stop();
444
444
  }
445
- }, _callee73);
445
+ }, _callee74);
446
446
  }));
447
447
  return _getBytes.apply(this, arguments);
448
448
  }
@@ -536,7 +536,7 @@ function fetchEventSource(r, e) {
536
536
  f.accept || (f.accept = EventStreamContentType);
537
537
  var b;
538
538
  function m() {
539
- b.abort(), document.hidden || I();
539
+ b.abort(), document.hidden || x();
540
540
  }
541
541
  c || document.addEventListener("visibilitychange", m);
542
542
  var g = DefaultRetryInterval,
@@ -547,34 +547,34 @@ function fetchEventSource(r, e) {
547
547
  t == null || t.addEventListener("abort", function () {
548
548
  y(), h();
549
549
  });
550
- var _ = u !== null && u !== void 0 ? u : window.fetch,
551
- S = s !== null && s !== void 0 ? s : defaultOnOpen;
552
- function I() {
553
- return _I.apply(this, arguments);
554
- }
555
- function _I() {
556
- _I = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
557
- var R, w, x;
550
+ var S = u !== null && u !== void 0 ? u : window.fetch,
551
+ E = s !== null && s !== void 0 ? s : defaultOnOpen;
552
+ function x() {
553
+ return _x8.apply(this, arguments);
554
+ }
555
+ function _x8() {
556
+ _x8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
557
+ var R, w, _;
558
558
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
559
559
  while (1) switch (_context3.prev = _context3.next) {
560
560
  case 0:
561
561
  b = new AbortController();
562
562
  _context3.prev = 1;
563
563
  _context3.next = 4;
564
- return _(r, Object.assign(Object.assign({}, d), {
564
+ return S(r, Object.assign(Object.assign({}, d), {
565
565
  headers: f,
566
566
  signal: b.signal
567
567
  }));
568
568
  case 4:
569
569
  w = _context3.sent;
570
570
  _context3.next = 7;
571
- return S(w);
571
+ return E(w);
572
572
  case 7:
573
573
  _context3.next = 9;
574
- return getBytes(w.body, getLines(getMessages(function (x) {
575
- x ? f[LastEventId] = x : delete f[LastEventId];
576
- }, function (x) {
577
- g = x;
574
+ return getBytes(w.body, getLines(getMessages(function (_) {
575
+ _ ? f[LastEventId] = _ : delete f[LastEventId];
576
+ }, function (_) {
577
+ g = _;
578
578
  }, o)));
579
579
  case 9:
580
580
  a == null || a();
@@ -586,10 +586,10 @@ function fetchEventSource(r, e) {
586
586
  _context3.prev = 14;
587
587
  _context3.t0 = _context3["catch"](1);
588
588
  if (!b.signal.aborted) try {
589
- x = (R = l == null ? void 0 : l(_context3.t0)) !== null && R !== void 0 ? R : g;
590
- window.clearTimeout(v), v = window.setTimeout(I, x);
591
- } catch (x) {
592
- y(), p(x);
589
+ _ = (R = l == null ? void 0 : l(_context3.t0)) !== null && R !== void 0 ? R : g;
590
+ window.clearTimeout(v), v = window.setTimeout(x, _);
591
+ } catch (_) {
592
+ y(), p(_);
593
593
  }
594
594
  case 17:
595
595
  case "end":
@@ -597,9 +597,9 @@ function fetchEventSource(r, e) {
597
597
  }
598
598
  }, _callee3, null, [[1, 14]]);
599
599
  }));
600
- return _I.apply(this, arguments);
600
+ return _x8.apply(this, arguments);
601
601
  }
602
- I();
602
+ x();
603
603
  });
604
604
  }
605
605
  function defaultOnOpen(r) {
@@ -607,10 +607,10 @@ function defaultOnOpen(r) {
607
607
  if (!(e != null && e.startsWith(EventStreamContentType))) throw new Error("Expected content-type to be ".concat(EventStreamContentType, ", Actual: ").concat(e));
608
608
  }
609
609
  var _Demo = /*#__PURE__*/function () {
610
- function C() {
611
- _classCallCheck(this, C);
610
+ function A() {
611
+ _classCallCheck(this, A);
612
612
  }
613
- _createClass(C, null, [{
613
+ _createClass(A, null, [{
614
614
  key: "generateResponseForOneMessage",
615
615
  value: function generateResponseForOneMessage(e) {
616
616
  if (e.file) return e.file.type === "image" ? "That is a nice image!" : e.file.type === "audio" ? "I like the sound of that!" : e.file.type === "gif" ? "That is a nice gif!" : "That is an interesting file!";
@@ -625,11 +625,11 @@ var _Demo = /*#__PURE__*/function () {
625
625
  value: function generateResponse(e) {
626
626
  var t = [];
627
627
  for (var s = e.messages.length - 1; s >= 0 && e.messages[s].role !== "ai"; s -= 1) t.push(e.messages[s]);
628
- if (t.length === 1) return C.generateResponseForOneMessage(e.messages[e.messages.length - 1]);
628
+ if (t.length === 1) return A.generateResponseForOneMessage(e.messages[e.messages.length - 1]);
629
629
  var n = e.messages.findIndex(function (s) {
630
630
  return s.text;
631
631
  });
632
- return n !== -1 && t.splice(n, 1), t.length === 1 ? C.generateResponseForOneMessage(e.messages[e.messages.length - 1]) : "Wow, very cool files!";
632
+ return n !== -1 && t.splice(n, 1), t.length === 1 ? A.generateResponseForOneMessage(e.messages[e.messages.length - 1]) : "Wow, very cool files!";
633
633
  }
634
634
  }, {
635
635
  key: "getCustomResponse",
@@ -639,15 +639,15 @@ var _Demo = /*#__PURE__*/function () {
639
639
  }, {
640
640
  key: "getResponse",
641
641
  value: function getResponse(e) {
642
- return e.customDemoResponse ? C.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
643
- text: C.generateResponse(e)
642
+ return e.customDemoResponse ? A.getCustomResponse(e.customDemoResponse, e.messages[e.messages.length - 1]) : {
643
+ text: A.generateResponse(e)
644
644
  };
645
645
  }
646
646
  // timeout is used to simulate a timeout for a response to come back
647
647
  }, {
648
648
  key: "request",
649
649
  value: function request(e, t, n) {
650
- var s = C.getResponse(e);
650
+ var s = A.getResponse(e);
651
651
  setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
652
652
  var o;
653
653
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -678,12 +678,12 @@ var _Demo = /*#__PURE__*/function () {
678
678
  value: function requestStream(e, t) {
679
679
  setTimeout(function () {
680
680
  var s;
681
- var n = (s = C.getResponse(e)) == null ? void 0 : s.text;
681
+ var n = (s = A.getResponse(e)) == null ? void 0 : s.text;
682
682
  Stream.simulate(e, t, n);
683
683
  }, 400);
684
684
  }
685
685
  }]);
686
- return C;
686
+ return A;
687
687
  }();
688
688
  _Demo.URL = "deep-chat-demo";
689
689
  var Demo = _Demo;
@@ -701,6 +701,7 @@ var Stream = /*#__PURE__*/function () {
701
701
  b,
702
702
  m,
703
703
  g,
704
+ v,
704
705
  o,
705
706
  _yield$RequestUtils$p,
706
707
  a,
@@ -721,7 +722,7 @@ var Stream = /*#__PURE__*/function () {
721
722
  headers: (f = e.requestSettings) == null ? void 0 : f.headers
722
723
  };
723
724
  _context6.next = 4;
724
- return RequestUtils.processResponseInterceptor(e.deepChat, o);
725
+ return RequestUtils.processRequestInterceptor(e.deepChat, o);
725
726
  case 4:
726
727
  _yield$RequestUtils$p = _context6.sent;
727
728
  a = _yield$RequestUtils$p.body;
@@ -737,32 +738,38 @@ var Stream = /*#__PURE__*/function () {
737
738
  }
738
739
  return _context6.abrupt("return", Stream.onInterceptorError(n, c, d));
739
740
  case 14:
740
- if (!(((b = e.requestSettings) == null ? void 0 : b.url) === Demo.URL)) {
741
+ if (!((b = e.requestSettings) != null && b.streamHandler)) {
741
742
  _context6.next = 16;
742
743
  break;
743
744
  }
744
- return _context6.abrupt("return", Demo.requestStream(n, e.streamHandlers));
745
+ return _context6.abrupt("return", CustomHandler.stream(e, a, n));
745
746
  case 16:
747
+ if (!(((m = e.requestSettings) == null ? void 0 : m.url) === Demo.URL)) {
748
+ _context6.next = 18;
749
+ break;
750
+ }
751
+ return _context6.abrupt("return", Demo.requestStream(n, e.streamHandlers));
752
+ case 18:
746
753
  p = null;
747
- fetchEventSource(((m = e.requestSettings) == null ? void 0 : m.url) || e.url || "", {
748
- method: ((g = e.requestSettings) == null ? void 0 : g.method) || "POST",
754
+ fetchEventSource(((g = e.requestSettings) == null ? void 0 : g.url) || e.url || "", {
755
+ method: ((v = e.requestSettings) == null ? void 0 : v.method) || "POST",
749
756
  headers: l,
750
757
  body: s ? JSON.stringify(a) : a,
751
758
  openWhenHidden: !0,
752
759
  // keep stream open when browser tab not open
753
- onopen: function onopen(v) {
760
+ onopen: function onopen(y) {
754
761
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
755
762
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
756
763
  while (1) switch (_context5.prev = _context5.next) {
757
764
  case 0:
758
- if (!v.ok) {
765
+ if (!y.ok) {
759
766
  _context5.next = 2;
760
767
  break;
761
768
  }
762
769
  return _context5.abrupt("return", (p = n.addNewStreamedMessage(), u()));
763
770
  case 2:
764
771
  _context5.next = 4;
765
- return RequestUtils.processResponseByType(v);
772
+ return RequestUtils.processResponseByType(y);
766
773
  case 4:
767
774
  throw _context5.sent;
768
775
  case 5:
@@ -772,39 +779,39 @@ var Stream = /*#__PURE__*/function () {
772
779
  }, _callee5);
773
780
  }))();
774
781
  },
775
- onmessage: function onmessage(v) {
776
- var y;
777
- if (JSON.stringify(v.data) !== JSON.stringify("[DONE]")) {
778
- var _ = JSON.parse(v.data);
779
- (y = e.extractResultData) == null || y.call(e, _).then(function (S) {
780
- (S == null ? void 0 : S.text) === void 0 ? console.error("Response data: ".concat(v.data, " \n ").concat(ErrorMessages.INVALID_STREAM_RESPONSE)) : p && n.updateStreamedMessage(S.text, p);
781
- })["catch"](function (S) {
782
- return RequestUtils.displayError(n, S);
782
+ onmessage: function onmessage(y) {
783
+ var S;
784
+ if (JSON.stringify(y.data) !== JSON.stringify("[DONE]")) {
785
+ var E = JSON.parse(y.data);
786
+ (S = e.extractResultData) == null || S.call(e, E).then(function (x) {
787
+ (x == null ? void 0 : x.text) === void 0 ? console.error("Response data: ".concat(y.data, " \n ").concat(ErrorMessages.INVALID_STREAM_RESPONSE)) : p && n.updateStreamedMessage(x.text, p);
788
+ })["catch"](function (x) {
789
+ return RequestUtils.displayError(n, x);
783
790
  });
784
791
  }
785
792
  },
786
- onerror: function onerror(v) {
787
- throw d(), v;
793
+ onerror: function onerror(y) {
794
+ throw d(), y;
788
795
  },
789
796
  onclose: function onclose() {
790
797
  n.finaliseStreamedMessage(), d();
791
798
  },
792
799
  signal: h.signal
793
- })["catch"](function (v) {
794
- var y;
795
- (y = e.extractResultData) == null || y.call(e, v).then(function () {
796
- RequestUtils.displayError(n, v);
797
- })["catch"](function (_) {
798
- RequestUtils.displayError(n, _);
800
+ })["catch"](function (y) {
801
+ var S;
802
+ (S = e.extractResultData) == null || S.call(e, y).then(function () {
803
+ RequestUtils.displayError(n, y);
804
+ })["catch"](function (E) {
805
+ RequestUtils.displayError(n, E);
799
806
  });
800
807
  });
801
- case 18:
808
+ case 20:
802
809
  case "end":
803
810
  return _context6.stop();
804
811
  }
805
812
  }, _callee6);
806
813
  }));
807
- function request(_x8, _x9, _x10) {
814
+ function request(_x9, _x10, _x11) {
808
815
  return _request.apply(this, arguments);
809
816
  }
810
817
  return request;
@@ -846,11 +853,11 @@ var Stream = /*#__PURE__*/function () {
846
853
  }]);
847
854
  return Stream;
848
855
  }();
849
- var CustomRequest = /*#__PURE__*/function () {
850
- function CustomRequest() {
851
- _classCallCheck(this, CustomRequest);
856
+ var CustomHandler = /*#__PURE__*/function () {
857
+ function CustomHandler() {
858
+ _classCallCheck(this, CustomHandler);
852
859
  }
853
- _createClass(CustomRequest, null, [{
860
+ _createClass(CustomHandler, null, [{
854
861
  key: "request",
855
862
  value: function () {
856
863
  var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(e, t, n) {
@@ -898,7 +905,7 @@ var CustomRequest = /*#__PURE__*/function () {
898
905
  }
899
906
  }, _callee7);
900
907
  }));
901
- return function (_x14) {
908
+ return function (_x15) {
902
909
  return _ref2.apply(this, arguments);
903
910
  };
904
911
  }())["catch"](function (a) {
@@ -910,13 +917,48 @@ var CustomRequest = /*#__PURE__*/function () {
910
917
  }
911
918
  }, _callee8);
912
919
  }));
913
- function request(_x11, _x12, _x13) {
920
+ function request(_x12, _x13, _x14) {
914
921
  return _request2.apply(this, arguments);
915
922
  }
916
923
  return request;
917
924
  }()
925
+ }, {
926
+ key: "stream",
927
+ value: function () {
928
+ var _stream = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(e, t, n) {
929
+ var d, h, s, o, a, l, c, u;
930
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
931
+ while (1) switch (_context9.prev = _context9.next) {
932
+ case 0:
933
+ s = !0, o = !1, a = null;
934
+ l = function l() {
935
+ o || !s || (a = n.addNewStreamedMessage(), e.streamHandlers.onOpen(), o = !0);
936
+ }, c = function c() {
937
+ s && (n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1);
938
+ }, u = function u(p) {
939
+ s && (p.error ? (console.error(p.error), n.finaliseStreamedMessage(), e.streamHandlers.onClose(), n.addNewErrorMessage("service", p.error), s = !1) : p.text && a && n.updateStreamedMessage(p.text, a));
940
+ };
941
+ e.streamHandlers.abortStream.abort = function () {
942
+ n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1;
943
+ }, (h = (d = e.requestSettings).streamHandler) == null || h.call(d, t, {
944
+ onOpen: l,
945
+ onResult: u,
946
+ onClose: c,
947
+ stopClicked: e.streamHandlers.stopClicked
948
+ });
949
+ case 3:
950
+ case "end":
951
+ return _context9.stop();
952
+ }
953
+ }, _callee9);
954
+ }));
955
+ function stream(_x16, _x17, _x18) {
956
+ return _stream.apply(this, arguments);
957
+ }
958
+ return stream;
959
+ }()
918
960
  }]);
919
- return CustomRequest;
961
+ return CustomHandler;
920
962
  }();
921
963
  var HTTPRequest = /*#__PURE__*/function () {
922
964
  function HTTPRequest() {
@@ -926,7 +968,7 @@ var HTTPRequest = /*#__PURE__*/function () {
926
968
  key: "request",
927
969
  value: // prettier-ignore
928
970
  function () {
929
- var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(e, t, n) {
971
+ var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e, t, n) {
930
972
  var s,
931
973
  h,
932
974
  p,
@@ -940,40 +982,40 @@ var HTTPRequest = /*#__PURE__*/function () {
940
982
  c,
941
983
  u,
942
984
  d,
943
- _args10 = arguments;
944
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
945
- while (1) switch (_context10.prev = _context10.next) {
985
+ _args11 = arguments;
986
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
987
+ while (1) switch (_context11.prev = _context11.next) {
946
988
  case 0:
947
- s = _args10.length > 3 && _args10[3] !== undefined ? _args10[3] : !0;
989
+ s = _args11.length > 3 && _args11[3] !== undefined ? _args11[3] : !0;
948
990
  o = {
949
991
  body: t,
950
992
  headers: (h = e.requestSettings) == null ? void 0 : h.headers
951
993
  };
952
- _context10.next = 4;
953
- return RequestUtils.processResponseInterceptor(e.deepChat, o);
994
+ _context11.next = 4;
995
+ return RequestUtils.processRequestInterceptor(e.deepChat, o);
954
996
  case 4:
955
- _yield$RequestUtils$p2 = _context10.sent;
997
+ _yield$RequestUtils$p2 = _context11.sent;
956
998
  a = _yield$RequestUtils$p2.body;
957
999
  l = _yield$RequestUtils$p2.headers;
958
1000
  c = _yield$RequestUtils$p2.error;
959
1001
  u = e.completionsHandlers.onFinish;
960
1002
  if (!c) {
961
- _context10.next = 11;
1003
+ _context11.next = 11;
962
1004
  break;
963
1005
  }
964
- return _context10.abrupt("return", HTTPRequest.onInterceptorError(n, c, u));
1006
+ return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, u));
965
1007
  case 11:
966
1008
  if (!((p = e.requestSettings) != null && p.handler)) {
967
- _context10.next = 13;
1009
+ _context11.next = 13;
968
1010
  break;
969
1011
  }
970
- return _context10.abrupt("return", CustomRequest.request(e, a, n));
1012
+ return _context11.abrupt("return", CustomHandler.request(e, a, n));
971
1013
  case 13:
972
1014
  if (!(((f = e.requestSettings) == null ? void 0 : f.url) === Demo.URL)) {
973
- _context10.next = 15;
1015
+ _context11.next = 15;
974
1016
  break;
975
1017
  }
976
- return _context10.abrupt("return", Demo.request(n, u, e.deepChat.responseInterceptor));
1018
+ return _context11.abrupt("return", Demo.request(n, u, e.deepChat.responseInterceptor));
977
1019
  case 15:
978
1020
  d = !0;
979
1021
  fetch(((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", {
@@ -985,40 +1027,40 @@ var HTTPRequest = /*#__PURE__*/function () {
985
1027
  }).then(function (g) {
986
1028
  return RequestUtils.processResponseByType(g);
987
1029
  }).then( /*#__PURE__*/function () {
988
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(g) {
989
- var _, S, v, y;
990
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
991
- while (1) switch (_context9.prev = _context9.next) {
1030
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(g) {
1031
+ var S, E, v, y;
1032
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1033
+ while (1) switch (_context10.prev = _context10.next) {
992
1034
  case 0:
993
1035
  if (e.extractResultData) {
994
- _context9.next = 2;
1036
+ _context10.next = 2;
995
1037
  break;
996
1038
  }
997
- return _context9.abrupt("return");
1039
+ return _context10.abrupt("return");
998
1040
  case 2:
999
- _context9.next = 4;
1000
- return (S = (_ = e.deepChat).responseInterceptor) == null ? void 0 : S.call(_, g);
1041
+ _context10.next = 4;
1042
+ return (E = (S = e.deepChat).responseInterceptor) == null ? void 0 : E.call(S, g);
1001
1043
  case 4:
1002
- _context9.t0 = _context9.sent;
1003
- if (_context9.t0) {
1004
- _context9.next = 7;
1044
+ _context10.t0 = _context10.sent;
1045
+ if (_context10.t0) {
1046
+ _context10.next = 7;
1005
1047
  break;
1006
1048
  }
1007
- _context9.t0 = g;
1049
+ _context10.t0 = g;
1008
1050
  case 7:
1009
- v = _context9.t0;
1010
- _context9.next = 10;
1051
+ v = _context10.t0;
1052
+ _context10.next = 10;
1011
1053
  return e.extractResultData(v);
1012
1054
  case 10:
1013
- y = _context9.sent;
1055
+ y = _context10.sent;
1014
1056
  if (d) {
1015
- _context9.next = 13;
1057
+ _context10.next = 13;
1016
1058
  break;
1017
1059
  }
1018
1060
  throw g;
1019
1061
  case 13:
1020
1062
  if (!(!y || _typeof(y) != "object")) {
1021
- _context9.next = 15;
1063
+ _context10.next = 15;
1022
1064
  break;
1023
1065
  }
1024
1066
  throw Error(ErrorMessages.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, v));
@@ -1026,11 +1068,11 @@ var HTTPRequest = /*#__PURE__*/function () {
1026
1068
  y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0, !0), u()));
1027
1069
  case 16:
1028
1070
  case "end":
1029
- return _context9.stop();
1071
+ return _context10.stop();
1030
1072
  }
1031
- }, _callee9);
1073
+ }, _callee10);
1032
1074
  }));
1033
- return function (_x18) {
1075
+ return function (_x22) {
1034
1076
  return _ref3.apply(this, arguments);
1035
1077
  };
1036
1078
  }())["catch"](function (g) {
@@ -1038,11 +1080,11 @@ var HTTPRequest = /*#__PURE__*/function () {
1038
1080
  });
1039
1081
  case 17:
1040
1082
  case "end":
1041
- return _context10.stop();
1083
+ return _context11.stop();
1042
1084
  }
1043
- }, _callee10);
1085
+ }, _callee11);
1044
1086
  }));
1045
- function request(_x15, _x16, _x17) {
1087
+ function request(_x19, _x20, _x21) {
1046
1088
  return _request3.apply(this, arguments);
1047
1089
  }
1048
1090
  return request;
@@ -1055,43 +1097,43 @@ var HTTPRequest = /*#__PURE__*/function () {
1055
1097
  fetch(t, n).then(function (a) {
1056
1098
  return a.json();
1057
1099
  }).then( /*#__PURE__*/function () {
1058
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(a) {
1100
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(a) {
1059
1101
  var c, u, l;
1060
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1061
- while (1) switch (_context11.prev = _context11.next) {
1102
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1103
+ while (1) switch (_context12.prev = _context12.next) {
1062
1104
  case 0:
1063
1105
  if (e.extractPollResultData) {
1064
- _context11.next = 2;
1106
+ _context12.next = 2;
1065
1107
  break;
1066
1108
  }
1067
- return _context11.abrupt("return");
1109
+ return _context12.abrupt("return");
1068
1110
  case 2:
1069
- _context11.t0 = e;
1070
- _context11.next = 5;
1111
+ _context12.t0 = e;
1112
+ _context12.next = 5;
1071
1113
  return (u = (c = e.deepChat).responseInterceptor) == null ? void 0 : u.call(c, a);
1072
1114
  case 5:
1073
- _context11.t1 = _context11.sent;
1074
- if (_context11.t1) {
1075
- _context11.next = 8;
1115
+ _context12.t1 = _context12.sent;
1116
+ if (_context12.t1) {
1117
+ _context12.next = 8;
1076
1118
  break;
1077
1119
  }
1078
- _context11.t1 = a;
1120
+ _context12.t1 = a;
1079
1121
  case 8:
1080
- _context11.t2 = _context11.t1;
1081
- _context11.next = 11;
1082
- return _context11.t0.extractPollResultData.call(_context11.t0, _context11.t2);
1122
+ _context12.t2 = _context12.t1;
1123
+ _context12.next = 11;
1124
+ return _context12.t0.extractPollResultData.call(_context12.t0, _context12.t2);
1083
1125
  case 11:
1084
- l = _context11.sent;
1126
+ l = _context12.sent;
1085
1127
  l.timeoutMS ? setTimeout(function () {
1086
1128
  HTTPRequest.executePollRequest(e, t, n, s);
1087
1129
  }, l.timeoutMS) : (console.log("finished polling"), s.addNewMessage(l, !0, !0), o());
1088
1130
  case 13:
1089
1131
  case "end":
1090
- return _context11.stop();
1132
+ return _context12.stop();
1091
1133
  }
1092
- }, _callee11);
1134
+ }, _callee12);
1093
1135
  }));
1094
- return function (_x19) {
1136
+ return function (_x23) {
1095
1137
  return _ref4.apply(this, arguments);
1096
1138
  };
1097
1139
  }())["catch"](function (a) {
@@ -1102,7 +1144,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1102
1144
  }, {
1103
1145
  key: "poll",
1104
1146
  value: function () {
1105
- var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e, t, n) {
1147
+ var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(e, t, n) {
1106
1148
  var s,
1107
1149
  f,
1108
1150
  b,
@@ -1116,27 +1158,27 @@ var HTTPRequest = /*#__PURE__*/function () {
1116
1158
  d,
1117
1159
  h,
1118
1160
  p,
1119
- _args12 = arguments;
1120
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1121
- while (1) switch (_context12.prev = _context12.next) {
1161
+ _args13 = arguments;
1162
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1163
+ while (1) switch (_context13.prev = _context13.next) {
1122
1164
  case 0:
1123
- s = _args12.length > 3 && _args12[3] !== undefined ? _args12[3] : !0;
1165
+ s = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : !0;
1124
1166
  o = {
1125
1167
  body: t,
1126
1168
  headers: (f = e.requestSettings) == null ? void 0 : f.headers
1127
1169
  };
1128
- _context12.next = 4;
1129
- return RequestUtils.processResponseInterceptor(e.deepChat, o);
1170
+ _context13.next = 4;
1171
+ return RequestUtils.processRequestInterceptor(e.deepChat, o);
1130
1172
  case 4:
1131
- _yield$RequestUtils$p3 = _context12.sent;
1173
+ _yield$RequestUtils$p3 = _context13.sent;
1132
1174
  a = _yield$RequestUtils$p3.body;
1133
1175
  l = _yield$RequestUtils$p3.headers;
1134
1176
  c = _yield$RequestUtils$p3.error;
1135
1177
  if (!c) {
1136
- _context12.next = 10;
1178
+ _context13.next = 10;
1137
1179
  break;
1138
1180
  }
1139
- return _context12.abrupt("return", HTTPRequest.onInterceptorError(n, c));
1181
+ return _context13.abrupt("return", HTTPRequest.onInterceptorError(n, c));
1140
1182
  case 10:
1141
1183
  u = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", d = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", h = s ? JSON.stringify(a) : a, p = {
1142
1184
  method: d,
@@ -1146,11 +1188,11 @@ var HTTPRequest = /*#__PURE__*/function () {
1146
1188
  HTTPRequest.executePollRequest(e, u, p, n);
1147
1189
  case 12:
1148
1190
  case "end":
1149
- return _context12.stop();
1191
+ return _context13.stop();
1150
1192
  }
1151
- }, _callee12);
1193
+ }, _callee13);
1152
1194
  }));
1153
- function poll(_x20, _x21, _x22) {
1195
+ function poll(_x24, _x25, _x26) {
1154
1196
  return _poll.apply(this, arguments);
1155
1197
  }
1156
1198
  return poll;
@@ -1191,9 +1233,9 @@ var MessageLimitUtils = /*#__PURE__*/function () {
1191
1233
  var n = 0,
1192
1234
  s = e.length - 1;
1193
1235
  for (s; s >= 0; s -= 1) {
1194
- var a = (o = e[s]) == null ? void 0 : o.text;
1195
- if (a !== void 0 && (n += a.length, n > t)) {
1196
- e[s].text = a.substring(0, a.length - (n - t));
1236
+ var _a = (o = e[s]) == null ? void 0 : o.text;
1237
+ if (_a !== void 0 && (n += _a.length, n > t)) {
1238
+ e[s].text = _a.substring(0, _a.length - (n - t));
1197
1239
  break;
1198
1240
  }
1199
1241
  }
@@ -1244,8 +1286,8 @@ var Websocket = /*#__PURE__*/function () {
1244
1286
  if (!document.body.contains(e.deepChat)) return;
1245
1287
  var n = e.requestSettings.websocket;
1246
1288
  if (n) try {
1247
- var s = typeof n != "boolean" ? n : void 0;
1248
- e.websocket = new WebSocket(e.requestSettings.url || "", s), e.websocket.onopen = function () {
1289
+ var _s = typeof n != "boolean" ? n : void 0;
1290
+ e.websocket = new WebSocket(e.requestSettings.url || "", _s), e.websocket.onopen = function () {
1249
1291
  t.removeError(), e.websocket && _typeof(e.websocket) == "object" && Websocket.assignListeners(e, e.websocket, t);
1250
1292
  }, e.websocket.onerror = function (o) {
1251
1293
  console.error(o), Websocket.retryConnection(e, t);
@@ -1265,52 +1307,52 @@ var Websocket = /*#__PURE__*/function () {
1265
1307
  key: "assignListeners",
1266
1308
  value: function assignListeners(e, t, n) {
1267
1309
  t.onmessage = /*#__PURE__*/function () {
1268
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
1310
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
1269
1311
  var o, a, l, c, u;
1270
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1271
- while (1) switch (_context13.prev = _context13.next) {
1312
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1313
+ while (1) switch (_context14.prev = _context14.next) {
1272
1314
  case 0:
1273
1315
  if (!e.extractResultData) {
1274
- _context13.next = 20;
1316
+ _context14.next = 20;
1275
1317
  break;
1276
1318
  }
1277
- _context13.prev = 1;
1319
+ _context14.prev = 1;
1278
1320
  l = JSON.parse(s.data);
1279
- _context13.next = 5;
1321
+ _context14.next = 5;
1280
1322
  return (a = (o = e.deepChat).responseInterceptor) == null ? void 0 : a.call(o, l);
1281
1323
  case 5:
1282
- _context13.t0 = _context13.sent;
1283
- if (_context13.t0) {
1284
- _context13.next = 8;
1324
+ _context14.t0 = _context14.sent;
1325
+ if (_context14.t0) {
1326
+ _context14.next = 8;
1285
1327
  break;
1286
1328
  }
1287
- _context13.t0 = l;
1329
+ _context14.t0 = l;
1288
1330
  case 8:
1289
- c = _context13.t0;
1290
- _context13.next = 11;
1331
+ c = _context14.t0;
1332
+ _context14.next = 11;
1291
1333
  return e.extractResultData(c);
1292
1334
  case 11:
1293
- u = _context13.sent;
1335
+ u = _context14.sent;
1294
1336
  if (!(!u || _typeof(u) != "object")) {
1295
- _context13.next = 14;
1337
+ _context14.next = 14;
1296
1338
  break;
1297
1339
  }
1298
1340
  throw Error(ErrorMessages.INVALID_RESPONSE(l, "server", !!e.deepChat.responseInterceptor, c));
1299
1341
  case 14:
1300
1342
  e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : n.addNewMessage(u, !0, !0);
1301
- _context13.next = 20;
1343
+ _context14.next = 20;
1302
1344
  break;
1303
1345
  case 17:
1304
- _context13.prev = 17;
1305
- _context13.t1 = _context13["catch"](1);
1306
- RequestUtils.displayError(n, _context13.t1, "Error in server message");
1346
+ _context14.prev = 17;
1347
+ _context14.t1 = _context14["catch"](1);
1348
+ RequestUtils.displayError(n, _context14.t1, "Error in server message");
1307
1349
  case 20:
1308
1350
  case "end":
1309
- return _context13.stop();
1351
+ return _context14.stop();
1310
1352
  }
1311
- }, _callee13, null, [[1, 17]]);
1353
+ }, _callee14, null, [[1, 17]]);
1312
1354
  }));
1313
- return function (_x23) {
1355
+ return function (_x27) {
1314
1356
  return _ref5.apply(this, arguments);
1315
1357
  };
1316
1358
  }(), t.onerror = function (s) {
@@ -1322,7 +1364,7 @@ var Websocket = /*#__PURE__*/function () {
1322
1364
  }, {
1323
1365
  key: "sendWebsocket",
1324
1366
  value: function () {
1325
- var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(e, t, n, s) {
1367
+ var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, n, s) {
1326
1368
  var o,
1327
1369
  d,
1328
1370
  h,
@@ -1331,42 +1373,42 @@ var Websocket = /*#__PURE__*/function () {
1331
1373
  l,
1332
1374
  c,
1333
1375
  u,
1334
- _args14 = arguments;
1335
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1336
- while (1) switch (_context14.prev = _context14.next) {
1376
+ _args15 = arguments;
1377
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1378
+ while (1) switch (_context15.prev = _context15.next) {
1337
1379
  case 0:
1338
- o = _args14.length > 4 && _args14[4] !== undefined ? _args14[4] : !0;
1380
+ o = _args15.length > 4 && _args15[4] !== undefined ? _args15[4] : !0;
1339
1381
  a = {
1340
1382
  body: n,
1341
1383
  headers: (d = t.requestSettings) == null ? void 0 : d.headers
1342
1384
  };
1343
- _context14.next = 4;
1344
- return RequestUtils.processResponseInterceptor(t.deepChat, a);
1385
+ _context15.next = 4;
1386
+ return RequestUtils.processRequestInterceptor(t.deepChat, a);
1345
1387
  case 4:
1346
- _yield$RequestUtils$p4 = _context14.sent;
1388
+ _yield$RequestUtils$p4 = _context15.sent;
1347
1389
  l = _yield$RequestUtils$p4.body;
1348
1390
  c = _yield$RequestUtils$p4.error;
1349
1391
  if (!c) {
1350
- _context14.next = 9;
1392
+ _context15.next = 9;
1351
1393
  break;
1352
1394
  }
1353
- return _context14.abrupt("return", s.addNewErrorMessage("service", c));
1395
+ return _context15.abrupt("return", s.addNewErrorMessage("service", c));
1354
1396
  case 9:
1355
1397
  u = o ? JSON.stringify(l) : l;
1356
1398
  if (!(((h = t.requestSettings) == null ? void 0 : h.url) === Demo.URL)) {
1357
- _context14.next = 12;
1399
+ _context15.next = 12;
1358
1400
  break;
1359
1401
  }
1360
- return _context14.abrupt("return", Demo.request(s, t.completionsHandlers.onFinish, t.deepChat.responseInterceptor));
1402
+ return _context15.abrupt("return", Demo.request(s, t.completionsHandlers.onFinish, t.deepChat.responseInterceptor));
1361
1403
  case 12:
1362
1404
  e.readyState === void 0 || e.readyState !== e.OPEN ? (console.error("Connection is not open"), s.isLastMessageError() || s.addNewErrorMessage("service", "Connection error")) : e.send(JSON.stringify(u));
1363
1405
  case 13:
1364
1406
  case "end":
1365
- return _context14.stop();
1407
+ return _context15.stop();
1366
1408
  }
1367
- }, _callee14);
1409
+ }, _callee15);
1368
1410
  }));
1369
- function sendWebsocket(_x24, _x25, _x26, _x27) {
1411
+ function sendWebsocket(_x28, _x29, _x30, _x31) {
1370
1412
  return _sendWebsocket.apply(this, arguments);
1371
1413
  }
1372
1414
  return sendWebsocket;
@@ -2247,12 +2289,12 @@ function list(r, e, t, n) {
2247
2289
  g,
2248
2290
  v,
2249
2291
  y,
2250
- _,
2251
2292
  S,
2252
- I,
2293
+ E,
2294
+ x,
2253
2295
  R = !0,
2254
2296
  w,
2255
- x,
2297
+ _,
2256
2298
  H,
2257
2299
  F;
2258
2300
  if ((h = skipOrderedListMarker(r, e)) >= 0) g = !0;else if ((h = skipBulletListMarker(r, e)) >= 0) g = !1;else return !1;
@@ -2261,21 +2303,21 @@ function list(r, e, t, n) {
2261
2303
  for (y = r.tokens.length, g ? (d = r.bMarks[e] + r.tShift[e], b = Number(r.src.substr(d, h - d - 1)), r.tokens.push({
2262
2304
  type: "ordered_list_open",
2263
2305
  order: b,
2264
- lines: S = [e, 0],
2306
+ lines: E = [e, 0],
2265
2307
  level: r.level++
2266
2308
  })) : r.tokens.push({
2267
2309
  type: "bullet_list_open",
2268
- lines: S = [e, 0],
2310
+ lines: E = [e, 0],
2269
2311
  level: r.level++
2270
- }), s = e, _ = !1, w = r.parser.ruler.getRules("list"); s < t && (v = r.skipSpaces(h), p = r.eMarks[s], v >= p ? f = 1 : f = v - h, f > 4 && (f = 1), f < 1 && (f = 1), o = h - r.bMarks[s] + f, r.tokens.push({
2312
+ }), s = e, S = !1, w = r.parser.ruler.getRules("list"); s < t && (v = r.skipSpaces(h), p = r.eMarks[s], v >= p ? f = 1 : f = v - h, f > 4 && (f = 1), f < 1 && (f = 1), o = h - r.bMarks[s] + f, r.tokens.push({
2271
2313
  type: "list_item_open",
2272
- lines: I = [e, 0],
2314
+ lines: x = [e, 0],
2273
2315
  level: r.level++
2274
- }), l = r.blkIndent, c = r.tight, a = r.tShift[e], u = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || _) && (R = !1), _ = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = u, r.tokens.push({
2316
+ }), l = r.blkIndent, c = r.tight, a = r.tShift[e], u = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || S) && (R = !1), S = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = u, r.tokens.push({
2275
2317
  type: "list_item_close",
2276
2318
  level: --r.level
2277
- }), s = e = r.line, I[1] = s, v = r.bMarks[e], !(s >= t || r.isEmpty(s) || r.tShift[s] < r.blkIndent));) {
2278
- for (F = !1, x = 0, H = w.length; x < H; x++) if (w[x](r, s, t, !0)) {
2319
+ }), s = e = r.line, x[1] = s, v = r.bMarks[e], !(s >= t || r.isEmpty(s) || r.tShift[s] < r.blkIndent));) {
2320
+ for (F = !1, _ = 0, H = w.length; _ < H; _++) if (w[_](r, s, t, !0)) {
2279
2321
  F = !0;
2280
2322
  break;
2281
2323
  }
@@ -2288,7 +2330,7 @@ function list(r, e, t, n) {
2288
2330
  return r.tokens.push({
2289
2331
  type: g ? "ordered_list_close" : "bullet_list_close",
2290
2332
  level: --r.level
2291
- }), S[1] = s, r.line = s, R && markTightParagraphs(r, y), !0;
2333
+ }), E[1] = s, r.line = s, R && markTightParagraphs(r, y), !0;
2292
2334
  }
2293
2335
  function footnote(r, e, t, n) {
2294
2336
  var s,
@@ -3313,10 +3355,10 @@ var SetFileTypes = /*#__PURE__*/function () {
3313
3355
  key: "processMixedFiles",
3314
3356
  value: function processMixedFiles(e, t, n) {
3315
3357
  if (n) {
3316
- var s = {
3358
+ var _s2 = {
3317
3359
  acceptedFormats: ""
3318
3360
  };
3319
- e.fileTypes.mixedFiles = SetFileTypes.parseConfig(e.requestSettings, s, t, n);
3361
+ e.fileTypes.mixedFiles = SetFileTypes.parseConfig(e.requestSettings, _s2, t, n);
3320
3362
  }
3321
3363
  }
3322
3364
  // needs to be set after audio to overwrite maxNumberOfFiles
@@ -3415,11 +3457,11 @@ var BaseServiceIO = /*#__PURE__*/function () {
3415
3457
  }, {
3416
3458
  key: "callServiceAPI",
3417
3459
  value: function () {
3418
- var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, n) {
3460
+ var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n) {
3419
3461
  var _c$headers, _u$ContentType;
3420
3462
  var l, c, u, d, s, o, a;
3421
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
3422
- while (1) switch (_context15.prev = _context15.next) {
3463
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3464
+ while (1) switch (_context16.prev = _context16.next) {
3423
3465
  case 0:
3424
3466
  s = _objectSpread({
3425
3467
  messages: t
@@ -3428,26 +3470,26 @@ var BaseServiceIO = /*#__PURE__*/function () {
3428
3470
  (l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_u$ContentType = (u = this.requestSettings.headers)["Content-Type"]) !== null && _u$ContentType !== void 0 ? _u$ContentType : u["Content-Type"] = "application/json", o = !0);
3429
3471
  a = this.deepChat.stream;
3430
3472
  if (!(a && (this.demo || _typeof(a) != "object" || !a.simulation))) {
3431
- _context15.next = 9;
3473
+ _context16.next = 9;
3432
3474
  break;
3433
3475
  }
3434
- _context15.next = 7;
3476
+ _context16.next = 7;
3435
3477
  return Stream.request(this, s, e);
3436
3478
  case 7:
3437
- _context15.next = 11;
3479
+ _context16.next = 11;
3438
3480
  break;
3439
3481
  case 9:
3440
- _context15.next = 11;
3482
+ _context16.next = 11;
3441
3483
  return HTTPRequest.request(this, s, e);
3442
3484
  case 11:
3443
3485
  o && ((d = this.requestSettings.headers) == null || delete d["Content-Type"]);
3444
3486
  case 12:
3445
3487
  case "end":
3446
- return _context15.stop();
3488
+ return _context16.stop();
3447
3489
  }
3448
- }, _callee15, this);
3490
+ }, _callee16, this);
3449
3491
  }));
3450
- function callServiceAPI(_x28, _x29, _x30) {
3492
+ function callServiceAPI(_x32, _x33, _x34) {
3451
3493
  return _callServiceAPI.apply(this, arguments);
3452
3494
  }
3453
3495
  return callServiceAPI;
@@ -3455,24 +3497,24 @@ var BaseServiceIO = /*#__PURE__*/function () {
3455
3497
  }, {
3456
3498
  key: "callApiWithFiles",
3457
3499
  value: function () {
3458
- var _callApiWithFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n, s) {
3500
+ var _callApiWithFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t, n, s) {
3459
3501
  var o, a, l;
3460
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3461
- while (1) switch (_context16.prev = _context16.next) {
3502
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
3503
+ while (1) switch (_context17.prev = _context17.next) {
3462
3504
  case 0:
3463
3505
  o = BaseServiceIO.createCustomFormDataBody(e, n, s), a = this.requestSettings, l = this.getServiceIOByType(s[0]);
3464
3506
  this.requestSettings = (l == null ? void 0 : l.request) || this.requestSettings;
3465
- _context16.next = 4;
3507
+ _context17.next = 4;
3466
3508
  return HTTPRequest.request(this, o, t, !1);
3467
3509
  case 4:
3468
3510
  this.requestSettings = a;
3469
3511
  case 5:
3470
3512
  case "end":
3471
- return _context16.stop();
3513
+ return _context17.stop();
3472
3514
  }
3473
- }, _callee16, this);
3515
+ }, _callee17, this);
3474
3516
  }));
3475
- function callApiWithFiles(_x31, _x32, _x33, _x34) {
3517
+ function callApiWithFiles(_x35, _x36, _x37, _x38) {
3476
3518
  return _callApiWithFiles.apply(this, arguments);
3477
3519
  }
3478
3520
  return callApiWithFiles;
@@ -3480,31 +3522,31 @@ var BaseServiceIO = /*#__PURE__*/function () {
3480
3522
  }, {
3481
3523
  key: "callAPI",
3482
3524
  value: function () {
3483
- var _callAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t) {
3484
- var n, s;
3485
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
3486
- while (1) switch (_context17.prev = _context17.next) {
3525
+ var _callAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e, t) {
3526
+ var n, _s3;
3527
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
3528
+ while (1) switch (_context18.prev = _context18.next) {
3487
3529
  case 0:
3488
3530
  if (this.requestSettings) {
3489
- _context17.next = 2;
3531
+ _context18.next = 2;
3490
3532
  break;
3491
3533
  }
3492
3534
  throw new Error("Request settings have not been set up");
3493
3535
  case 2:
3494
3536
  n = MessageLimitUtils.processMessages(e, t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
3495
3537
  if (this.websocket) {
3496
- s = _objectSpread({
3538
+ _s3 = _objectSpread({
3497
3539
  messages: n
3498
3540
  }, this.rawBody);
3499
- Websocket.sendWebsocket(this.websocket, this, s, t, !1);
3541
+ Websocket.sendWebsocket(this.websocket, this, _s3, t, !1);
3500
3542
  } else e.files && !this._directServiceRequiresFiles ? this.callApiWithFiles(this.rawBody, t, n, e.files) : this.callServiceAPI(t, n, e.files);
3501
3543
  case 4:
3502
3544
  case "end":
3503
- return _context17.stop();
3545
+ return _context18.stop();
3504
3546
  }
3505
- }, _callee17, this);
3547
+ }, _callee18, this);
3506
3548
  }));
3507
- function callAPI(_x35, _x36) {
3549
+ function callAPI(_x39, _x40) {
3508
3550
  return _callAPI.apply(this, arguments);
3509
3551
  }
3510
3552
  return callAPI;
@@ -3513,24 +3555,24 @@ var BaseServiceIO = /*#__PURE__*/function () {
3513
3555
  }, {
3514
3556
  key: "extractResultData",
3515
3557
  value: function () {
3516
- var _extractResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e) {
3517
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
3518
- while (1) switch (_context18.prev = _context18.next) {
3558
+ var _extractResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e) {
3559
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3560
+ while (1) switch (_context19.prev = _context19.next) {
3519
3561
  case 0:
3520
3562
  if (!e.error) {
3521
- _context18.next = 2;
3563
+ _context19.next = 2;
3522
3564
  break;
3523
3565
  }
3524
3566
  throw e.error;
3525
3567
  case 2:
3526
- return _context18.abrupt("return", e.result ? (console.error("The {result: ....} response object type is deprecated since version 1.3.0."), console.error("Please change to using the new response object: https://deepchat.dev/docs/connect#Response"), e.result) : e);
3568
+ return _context19.abrupt("return", e.result ? (console.error("The {result: ....} response object type is deprecated since version 1.3.0."), console.error("Please change to using the new response object: https://deepchat.dev/docs/connect#Response"), e.result) : e);
3527
3569
  case 3:
3528
3570
  case "end":
3529
- return _context18.stop();
3571
+ return _context19.stop();
3530
3572
  }
3531
- }, _callee18);
3573
+ }, _callee19);
3532
3574
  }));
3533
- function extractResultData(_x37) {
3575
+ function extractResultData(_x41) {
3534
3576
  return _extractResultData.apply(this, arguments);
3535
3577
  }
3536
3578
  return extractResultData;
@@ -3747,8 +3789,8 @@ var InsertKeyView = /*#__PURE__*/function () {
3747
3789
  n.id = "insert-key-help-text-contents";
3748
3790
  var s = InsertKeyView.createFailText();
3749
3791
  if (n.appendChild(s), e) {
3750
- var a = InsertKeyView.createHelpLink(e);
3751
- n.appendChild(a);
3792
+ var _a2 = InsertKeyView.createHelpLink(e);
3793
+ n.appendChild(_a2);
3752
3794
  }
3753
3795
  var o = InsertKeyView.createCautionText();
3754
3796
  return n.appendChild(o), t.appendChild(n), {
@@ -3894,13 +3936,13 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
3894
3936
  }, {
3895
3937
  key: "callServiceAPI",
3896
3938
  value: function () {
3897
- var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e, t, n) {
3939
+ var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e, t, n) {
3898
3940
  var s;
3899
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3900
- while (1) switch (_context19.prev = _context19.next) {
3941
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3942
+ while (1) switch (_context20.prev = _context20.next) {
3901
3943
  case 0:
3902
3944
  if (this.requestSettings) {
3903
- _context19.next = 2;
3945
+ _context20.next = 2;
3904
3946
  break;
3905
3947
  }
3906
3948
  throw new Error("Request settings have not been set up");
@@ -3909,11 +3951,11 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
3909
3951
  HTTPRequest.request(this, s, e);
3910
3952
  case 4:
3911
3953
  case "end":
3912
- return _context19.stop();
3954
+ return _context20.stop();
3913
3955
  }
3914
- }, _callee19, this);
3956
+ }, _callee20, this);
3915
3957
  }));
3916
- function callServiceAPI(_x38, _x39, _x40) {
3958
+ function callServiceAPI(_x42, _x43, _x44) {
3917
3959
  return _callServiceAPI2.apply(this, arguments);
3918
3960
  }
3919
3961
  return callServiceAPI;
@@ -3942,18 +3984,18 @@ var HuggingFaceFileIO = /*#__PURE__*/function (_HuggingFaceIO2) {
3942
3984
  }, {
3943
3985
  key: "callServiceAPI",
3944
3986
  value: function () {
3945
- var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e, t, n) {
3946
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3947
- while (1) switch (_context20.prev = _context20.next) {
3987
+ var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e, t, n) {
3988
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
3989
+ while (1) switch (_context21.prev = _context21.next) {
3948
3990
  case 0:
3949
3991
  if (this.requestSettings) {
3950
- _context20.next = 2;
3992
+ _context21.next = 2;
3951
3993
  break;
3952
3994
  }
3953
3995
  throw new Error("Request settings have not been set up");
3954
3996
  case 2:
3955
3997
  if (n != null && n[0]) {
3956
- _context20.next = 4;
3998
+ _context21.next = 4;
3957
3999
  break;
3958
4000
  }
3959
4001
  throw new Error("No file was added");
@@ -3961,11 +4003,11 @@ var HuggingFaceFileIO = /*#__PURE__*/function (_HuggingFaceIO2) {
3961
4003
  HTTPRequest.poll(this, n[0], e, !1);
3962
4004
  case 5:
3963
4005
  case "end":
3964
- return _context20.stop();
4006
+ return _context21.stop();
3965
4007
  }
3966
- }, _callee20, this);
4008
+ }, _callee21, this);
3967
4009
  }));
3968
- function callServiceAPI(_x41, _x42, _x43) {
4010
+ function callServiceAPI(_x45, _x46, _x47) {
3969
4011
  return _callServiceAPI3.apply(this, arguments);
3970
4012
  }
3971
4013
  return callServiceAPI;
@@ -3994,35 +4036,35 @@ var HuggingFaceAudioClassificationIO = /*#__PURE__*/function (_HuggingFaceFileIO
3994
4036
  _createClass(HuggingFaceAudioClassificationIO, [{
3995
4037
  key: "extractPollResultData",
3996
4038
  value: function () {
3997
- var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e) {
4039
+ var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e) {
3998
4040
  var t;
3999
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
4000
- while (1) switch (_context21.prev = _context21.next) {
4041
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
4042
+ while (1) switch (_context22.prev = _context22.next) {
4001
4043
  case 0:
4002
4044
  if (!e.estimated_time) {
4003
- _context21.next = 2;
4045
+ _context22.next = 2;
4004
4046
  break;
4005
4047
  }
4006
- return _context21.abrupt("return", {
4048
+ return _context22.abrupt("return", {
4007
4049
  timeoutMS: (e.estimated_time + 1) * 1e3
4008
4050
  });
4009
4051
  case 2:
4010
4052
  if (!e.error) {
4011
- _context21.next = 4;
4053
+ _context22.next = 4;
4012
4054
  break;
4013
4055
  }
4014
4056
  throw e.error;
4015
4057
  case 4:
4016
- return _context21.abrupt("return", {
4058
+ return _context22.abrupt("return", {
4017
4059
  text: ((t = e[0]) == null ? void 0 : t.label) || ""
4018
4060
  });
4019
4061
  case 5:
4020
4062
  case "end":
4021
- return _context21.stop();
4063
+ return _context22.stop();
4022
4064
  }
4023
- }, _callee21);
4065
+ }, _callee22);
4024
4066
  }));
4025
- function extractPollResultData(_x44) {
4067
+ function extractPollResultData(_x48) {
4026
4068
  return _extractPollResultData.apply(this, arguments);
4027
4069
  }
4028
4070
  return extractPollResultData;
@@ -4045,35 +4087,35 @@ var HuggingFaceImageClassificationIO = /*#__PURE__*/function (_HuggingFaceFileIO
4045
4087
  _createClass(HuggingFaceImageClassificationIO, [{
4046
4088
  key: "extractPollResultData",
4047
4089
  value: function () {
4048
- var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e) {
4090
+ var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e) {
4049
4091
  var t;
4050
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
4051
- while (1) switch (_context22.prev = _context22.next) {
4092
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
4093
+ while (1) switch (_context23.prev = _context23.next) {
4052
4094
  case 0:
4053
4095
  if (!e.estimated_time) {
4054
- _context22.next = 2;
4096
+ _context23.next = 2;
4055
4097
  break;
4056
4098
  }
4057
- return _context22.abrupt("return", {
4099
+ return _context23.abrupt("return", {
4058
4100
  timeoutMS: (e.estimated_time + 1) * 1e3
4059
4101
  });
4060
4102
  case 2:
4061
4103
  if (!e.error) {
4062
- _context22.next = 4;
4104
+ _context23.next = 4;
4063
4105
  break;
4064
4106
  }
4065
4107
  throw e.error;
4066
4108
  case 4:
4067
- return _context22.abrupt("return", {
4109
+ return _context23.abrupt("return", {
4068
4110
  text: ((t = e[0]) == null ? void 0 : t.label) || ""
4069
4111
  });
4070
4112
  case 5:
4071
4113
  case "end":
4072
- return _context22.stop();
4114
+ return _context23.stop();
4073
4115
  }
4074
- }, _callee22);
4116
+ }, _callee23);
4075
4117
  }));
4076
- function extractPollResultData(_x45) {
4118
+ function extractPollResultData(_x49) {
4077
4119
  return _extractPollResultData2.apply(this, arguments);
4078
4120
  }
4079
4121
  return extractPollResultData;
@@ -4158,19 +4200,19 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4158
4200
  }, {
4159
4201
  key: "callServiceAPI",
4160
4202
  value: function () {
4161
- var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e, t, n) {
4203
+ var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e, t, n) {
4162
4204
  var s;
4163
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
4164
- while (1) switch (_context23.prev = _context23.next) {
4205
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
4206
+ while (1) switch (_context24.prev = _context24.next) {
4165
4207
  case 0:
4166
4208
  if (this.requestSettings) {
4167
- _context23.next = 2;
4209
+ _context24.next = 2;
4168
4210
  break;
4169
4211
  }
4170
4212
  throw new Error("Request settings have not been set up");
4171
4213
  case 2:
4172
4214
  if (n) {
4173
- _context23.next = 4;
4215
+ _context24.next = 4;
4174
4216
  break;
4175
4217
  }
4176
4218
  throw new Error("Image was not found");
@@ -4179,11 +4221,11 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4179
4221
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, s, e), !1);
4180
4222
  case 6:
4181
4223
  case "end":
4182
- return _context23.stop();
4224
+ return _context24.stop();
4183
4225
  }
4184
- }, _callee23, this);
4226
+ }, _callee24, this);
4185
4227
  }));
4186
- function callServiceAPI(_x46, _x47, _x48) {
4228
+ function callServiceAPI(_x50, _x51, _x52) {
4187
4229
  return _callServiceAPI4.apply(this, arguments);
4188
4230
  }
4189
4231
  return callServiceAPI;
@@ -4191,17 +4233,17 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4191
4233
  }, {
4192
4234
  key: "extractResultData",
4193
4235
  value: function () {
4194
- var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e) {
4195
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
4196
- while (1) switch (_context24.prev = _context24.next) {
4236
+ var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e) {
4237
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
4238
+ while (1) switch (_context25.prev = _context25.next) {
4197
4239
  case 0:
4198
4240
  if (!e.message) {
4199
- _context24.next = 2;
4241
+ _context25.next = 2;
4200
4242
  break;
4201
4243
  }
4202
4244
  throw e.message;
4203
4245
  case 2:
4204
- return _context24.abrupt("return", {
4246
+ return _context25.abrupt("return", {
4205
4247
  files: e.artifacts.map(function (n) {
4206
4248
  return {
4207
4249
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4211,11 +4253,11 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4211
4253
  });
4212
4254
  case 3:
4213
4255
  case "end":
4214
- return _context24.stop();
4256
+ return _context25.stop();
4215
4257
  }
4216
- }, _callee24);
4258
+ }, _callee25);
4217
4259
  }));
4218
- function extractResultData(_x49) {
4260
+ function extractResultData(_x53) {
4219
4261
  return _extractResultData2.apply(this, arguments);
4220
4262
  }
4221
4263
  return extractResultData;
@@ -4267,19 +4309,19 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4267
4309
  }, {
4268
4310
  key: "callServiceAPI",
4269
4311
  value: function () {
4270
- var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e, t, n) {
4312
+ var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e, t, n) {
4271
4313
  var a, l, s, o;
4272
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
4273
- while (1) switch (_context25.prev = _context25.next) {
4314
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
4315
+ while (1) switch (_context26.prev = _context26.next) {
4274
4316
  case 0:
4275
4317
  if (this.requestSettings) {
4276
- _context25.next = 2;
4318
+ _context26.next = 2;
4277
4319
  break;
4278
4320
  }
4279
4321
  throw new Error("Request settings have not been set up");
4280
4322
  case 2:
4281
4323
  if (!(!n || !n[0] || !n[1])) {
4282
- _context25.next = 4;
4324
+ _context26.next = 4;
4283
4325
  break;
4284
4326
  }
4285
4327
  throw new Error("Image was not found");
@@ -4288,11 +4330,11 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4288
4330
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
4289
4331
  case 6:
4290
4332
  case "end":
4291
- return _context25.stop();
4333
+ return _context26.stop();
4292
4334
  }
4293
- }, _callee25, this);
4335
+ }, _callee26, this);
4294
4336
  }));
4295
- function callServiceAPI(_x50, _x51, _x52) {
4337
+ function callServiceAPI(_x54, _x55, _x56) {
4296
4338
  return _callServiceAPI5.apply(this, arguments);
4297
4339
  }
4298
4340
  return callServiceAPI;
@@ -4300,17 +4342,17 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4300
4342
  }, {
4301
4343
  key: "extractResultData",
4302
4344
  value: function () {
4303
- var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e) {
4304
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
4305
- while (1) switch (_context26.prev = _context26.next) {
4345
+ var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(e) {
4346
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
4347
+ while (1) switch (_context27.prev = _context27.next) {
4306
4348
  case 0:
4307
4349
  if (!e.message) {
4308
- _context26.next = 2;
4350
+ _context27.next = 2;
4309
4351
  break;
4310
4352
  }
4311
4353
  throw e.message;
4312
4354
  case 2:
4313
- return _context26.abrupt("return", {
4355
+ return _context27.abrupt("return", {
4314
4356
  files: e.artifacts.map(function (n) {
4315
4357
  return {
4316
4358
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4320,11 +4362,11 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4320
4362
  });
4321
4363
  case 3:
4322
4364
  case "end":
4323
- return _context26.stop();
4365
+ return _context27.stop();
4324
4366
  }
4325
- }, _callee26);
4367
+ }, _callee27);
4326
4368
  }));
4327
- function extractResultData(_x53) {
4369
+ function extractResultData(_x57) {
4328
4370
  return _extractResultData3.apply(this, arguments);
4329
4371
  }
4330
4372
  return extractResultData;
@@ -4357,34 +4399,34 @@ var HuggingFaceAudioRecognitionIO = /*#__PURE__*/function (_HuggingFaceFileIO3)
4357
4399
  _createClass(HuggingFaceAudioRecognitionIO, [{
4358
4400
  key: "extractPollResultData",
4359
4401
  value: function () {
4360
- var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(e) {
4361
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
4362
- while (1) switch (_context27.prev = _context27.next) {
4402
+ var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e) {
4403
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
4404
+ while (1) switch (_context28.prev = _context28.next) {
4363
4405
  case 0:
4364
4406
  if (!e.estimated_time) {
4365
- _context27.next = 2;
4407
+ _context28.next = 2;
4366
4408
  break;
4367
4409
  }
4368
- return _context27.abrupt("return", {
4410
+ return _context28.abrupt("return", {
4369
4411
  timeoutMS: (e.estimated_time + 1) * 1e3
4370
4412
  });
4371
4413
  case 2:
4372
4414
  if (!e.error) {
4373
- _context27.next = 4;
4415
+ _context28.next = 4;
4374
4416
  break;
4375
4417
  }
4376
4418
  throw e.error;
4377
4419
  case 4:
4378
- return _context27.abrupt("return", {
4420
+ return _context28.abrupt("return", {
4379
4421
  text: e.text || ""
4380
4422
  });
4381
4423
  case 5:
4382
4424
  case "end":
4383
- return _context27.stop();
4425
+ return _context28.stop();
4384
4426
  }
4385
- }, _callee27);
4427
+ }, _callee28);
4386
4428
  }));
4387
- function extractPollResultData(_x54) {
4429
+ function extractPollResultData(_x58) {
4388
4430
  return _extractPollResultData3.apply(this, arguments);
4389
4431
  }
4390
4432
  return extractPollResultData;
@@ -4405,26 +4447,26 @@ var HuggingFaceTextGenerationIO = /*#__PURE__*/function (_HuggingFaceIO3) {
4405
4447
  _createClass(HuggingFaceTextGenerationIO, [{
4406
4448
  key: "extractResultData",
4407
4449
  value: function () {
4408
- var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e) {
4409
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
4410
- while (1) switch (_context28.prev = _context28.next) {
4450
+ var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e) {
4451
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
4452
+ while (1) switch (_context29.prev = _context29.next) {
4411
4453
  case 0:
4412
4454
  if (!e.error) {
4413
- _context28.next = 2;
4455
+ _context29.next = 2;
4414
4456
  break;
4415
4457
  }
4416
4458
  throw e.error;
4417
4459
  case 2:
4418
- return _context28.abrupt("return", {
4460
+ return _context29.abrupt("return", {
4419
4461
  text: e[0].generated_text || ""
4420
4462
  });
4421
4463
  case 3:
4422
4464
  case "end":
4423
- return _context28.stop();
4465
+ return _context29.stop();
4424
4466
  }
4425
- }, _callee28);
4467
+ }, _callee29);
4426
4468
  }));
4427
- function extractResultData(_x55) {
4469
+ function extractResultData(_x59) {
4428
4470
  return _extractResultData4.apply(this, arguments);
4429
4471
  }
4430
4472
  return extractResultData;
@@ -4461,26 +4503,26 @@ var HuggingFaceQuestionAnswerIO = /*#__PURE__*/function (_HuggingFaceIO4) {
4461
4503
  }, {
4462
4504
  key: "extractResultData",
4463
4505
  value: function () {
4464
- var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e) {
4465
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
4466
- while (1) switch (_context29.prev = _context29.next) {
4506
+ var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e) {
4507
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
4508
+ while (1) switch (_context30.prev = _context30.next) {
4467
4509
  case 0:
4468
4510
  if (!e.error) {
4469
- _context29.next = 2;
4511
+ _context30.next = 2;
4470
4512
  break;
4471
4513
  }
4472
4514
  throw e.error;
4473
4515
  case 2:
4474
- return _context29.abrupt("return", {
4516
+ return _context30.abrupt("return", {
4475
4517
  text: e.answer || ""
4476
4518
  });
4477
4519
  case 3:
4478
4520
  case "end":
4479
- return _context29.stop();
4521
+ return _context30.stop();
4480
4522
  }
4481
- }, _callee29);
4523
+ }, _callee30);
4482
4524
  }));
4483
- function extractResultData(_x56) {
4525
+ function extractResultData(_x60) {
4484
4526
  return _extractResultData5.apply(this, arguments);
4485
4527
  }
4486
4528
  return extractResultData;
@@ -4501,26 +4543,26 @@ var HuggingFaceSummarizationIO = /*#__PURE__*/function (_HuggingFaceIO5) {
4501
4543
  _createClass(HuggingFaceSummarizationIO, [{
4502
4544
  key: "extractResultData",
4503
4545
  value: function () {
4504
- var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e) {
4505
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
4506
- while (1) switch (_context30.prev = _context30.next) {
4546
+ var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e) {
4547
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
4548
+ while (1) switch (_context31.prev = _context31.next) {
4507
4549
  case 0:
4508
4550
  if (!e.error) {
4509
- _context30.next = 2;
4551
+ _context31.next = 2;
4510
4552
  break;
4511
4553
  }
4512
4554
  throw e.error;
4513
4555
  case 2:
4514
- return _context30.abrupt("return", {
4556
+ return _context31.abrupt("return", {
4515
4557
  text: e[0].summary_text || ""
4516
4558
  });
4517
4559
  case 3:
4518
4560
  case "end":
4519
- return _context30.stop();
4561
+ return _context31.stop();
4520
4562
  }
4521
- }, _callee30);
4563
+ }, _callee31);
4522
4564
  }));
4523
- function extractResultData(_x57) {
4565
+ function extractResultData(_x61) {
4524
4566
  return _extractResultData6.apply(this, arguments);
4525
4567
  }
4526
4568
  return extractResultData;
@@ -4581,26 +4623,26 @@ var HuggingFaceConversationIO = /*#__PURE__*/function (_HuggingFaceIO6) {
4581
4623
  }, {
4582
4624
  key: "extractResultData",
4583
4625
  value: function () {
4584
- var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e) {
4585
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
4586
- while (1) switch (_context31.prev = _context31.next) {
4626
+ var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e) {
4627
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
4628
+ while (1) switch (_context32.prev = _context32.next) {
4587
4629
  case 0:
4588
4630
  if (!e.error) {
4589
- _context31.next = 2;
4631
+ _context32.next = 2;
4590
4632
  break;
4591
4633
  }
4592
4634
  throw e.error;
4593
4635
  case 2:
4594
- return _context31.abrupt("return", {
4636
+ return _context32.abrupt("return", {
4595
4637
  text: e.generated_text || ""
4596
4638
  });
4597
4639
  case 3:
4598
4640
  case "end":
4599
- return _context31.stop();
4641
+ return _context32.stop();
4600
4642
  }
4601
- }, _callee31);
4643
+ }, _callee32);
4602
4644
  }));
4603
- function extractResultData(_x58) {
4645
+ function extractResultData(_x62) {
4604
4646
  return _extractResultData7.apply(this, arguments);
4605
4647
  }
4606
4648
  return extractResultData;
@@ -4642,19 +4684,19 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4642
4684
  }, {
4643
4685
  key: "callServiceAPI",
4644
4686
  value: function () {
4645
- var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e, t, n) {
4687
+ var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e, t, n) {
4646
4688
  var a, l, s, o;
4647
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
4648
- while (1) switch (_context32.prev = _context32.next) {
4689
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
4690
+ while (1) switch (_context33.prev = _context33.next) {
4649
4691
  case 0:
4650
4692
  if (this.requestSettings) {
4651
- _context32.next = 2;
4693
+ _context33.next = 2;
4652
4694
  break;
4653
4695
  }
4654
4696
  throw new Error("Request settings have not been set up");
4655
4697
  case 2:
4656
4698
  if (n) {
4657
- _context32.next = 4;
4699
+ _context33.next = 4;
4658
4700
  break;
4659
4701
  }
4660
4702
  throw new Error("Image was not found");
@@ -4663,11 +4705,11 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4663
4705
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
4664
4706
  case 6:
4665
4707
  case "end":
4666
- return _context32.stop();
4708
+ return _context33.stop();
4667
4709
  }
4668
- }, _callee32, this);
4710
+ }, _callee33, this);
4669
4711
  }));
4670
- function callServiceAPI(_x59, _x60, _x61) {
4712
+ function callServiceAPI(_x63, _x64, _x65) {
4671
4713
  return _callServiceAPI6.apply(this, arguments);
4672
4714
  }
4673
4715
  return callServiceAPI;
@@ -4675,17 +4717,17 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4675
4717
  }, {
4676
4718
  key: "extractResultData",
4677
4719
  value: function () {
4678
- var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e) {
4679
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
4680
- while (1) switch (_context33.prev = _context33.next) {
4720
+ var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e) {
4721
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
4722
+ while (1) switch (_context34.prev = _context34.next) {
4681
4723
  case 0:
4682
4724
  if (!e.message) {
4683
- _context33.next = 2;
4725
+ _context34.next = 2;
4684
4726
  break;
4685
4727
  }
4686
4728
  throw e.message;
4687
4729
  case 2:
4688
- return _context33.abrupt("return", {
4730
+ return _context34.abrupt("return", {
4689
4731
  files: e.artifacts.map(function (n) {
4690
4732
  return {
4691
4733
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4695,11 +4737,11 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4695
4737
  });
4696
4738
  case 3:
4697
4739
  case "end":
4698
- return _context33.stop();
4740
+ return _context34.stop();
4699
4741
  }
4700
- }, _callee33);
4742
+ }, _callee34);
4701
4743
  }));
4702
- function extractResultData(_x62) {
4744
+ function extractResultData(_x66) {
4703
4745
  return _extractResultData8.apply(this, arguments);
4704
4746
  }
4705
4747
  return extractResultData;
@@ -4730,26 +4772,26 @@ var HuggingFaceTranslationIO = /*#__PURE__*/function (_HuggingFaceIO7) {
4730
4772
  _createClass(HuggingFaceTranslationIO, [{
4731
4773
  key: "extractResultData",
4732
4774
  value: function () {
4733
- var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e) {
4734
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
4735
- while (1) switch (_context34.prev = _context34.next) {
4775
+ var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e) {
4776
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
4777
+ while (1) switch (_context35.prev = _context35.next) {
4736
4778
  case 0:
4737
4779
  if (!e.error) {
4738
- _context34.next = 2;
4780
+ _context35.next = 2;
4739
4781
  break;
4740
4782
  }
4741
4783
  throw e.error;
4742
4784
  case 2:
4743
- return _context34.abrupt("return", {
4785
+ return _context35.abrupt("return", {
4744
4786
  text: e[0].translation_text || ""
4745
4787
  });
4746
4788
  case 3:
4747
4789
  case "end":
4748
- return _context34.stop();
4790
+ return _context35.stop();
4749
4791
  }
4750
- }, _callee34);
4792
+ }, _callee35);
4751
4793
  }));
4752
- function extractResultData(_x63) {
4794
+ function extractResultData(_x67) {
4753
4795
  return _extractResultData9.apply(this, arguments);
4754
4796
  }
4755
4797
  return extractResultData;
@@ -4783,13 +4825,13 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4783
4825
  }, {
4784
4826
  key: "callServiceAPI",
4785
4827
  value: function () {
4786
- var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e, t) {
4828
+ var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e, t) {
4787
4829
  var n;
4788
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
4789
- while (1) switch (_context35.prev = _context35.next) {
4830
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
4831
+ while (1) switch (_context36.prev = _context36.next) {
4790
4832
  case 0:
4791
4833
  if (this.requestSettings) {
4792
- _context35.next = 2;
4834
+ _context36.next = 2;
4793
4835
  break;
4794
4836
  }
4795
4837
  throw new Error("Request settings have not been set up");
@@ -4798,11 +4840,11 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4798
4840
  HTTPRequest.request(this, n, e);
4799
4841
  case 4:
4800
4842
  case "end":
4801
- return _context35.stop();
4843
+ return _context36.stop();
4802
4844
  }
4803
- }, _callee35, this);
4845
+ }, _callee36, this);
4804
4846
  }));
4805
- function callServiceAPI(_x64, _x65) {
4847
+ function callServiceAPI(_x68, _x69) {
4806
4848
  return _callServiceAPI7.apply(this, arguments);
4807
4849
  }
4808
4850
  return callServiceAPI;
@@ -4810,17 +4852,17 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4810
4852
  }, {
4811
4853
  key: "extractResultData",
4812
4854
  value: function () {
4813
- var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
4814
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
4815
- while (1) switch (_context36.prev = _context36.next) {
4855
+ var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
4856
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
4857
+ while (1) switch (_context37.prev = _context37.next) {
4816
4858
  case 0:
4817
4859
  if (!e.message) {
4818
- _context36.next = 2;
4860
+ _context37.next = 2;
4819
4861
  break;
4820
4862
  }
4821
4863
  throw e.message;
4822
4864
  case 2:
4823
- return _context36.abrupt("return", {
4865
+ return _context37.abrupt("return", {
4824
4866
  files: e.artifacts.map(function (n) {
4825
4867
  return {
4826
4868
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4830,11 +4872,11 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4830
4872
  });
4831
4873
  case 3:
4832
4874
  case "end":
4833
- return _context36.stop();
4875
+ return _context37.stop();
4834
4876
  }
4835
- }, _callee36);
4877
+ }, _callee37);
4836
4878
  }));
4837
- function extractResultData(_x66) {
4879
+ function extractResultData(_x70) {
4838
4880
  return _extractResultData10.apply(this, arguments);
4839
4881
  }
4840
4882
  return extractResultData;
@@ -4867,26 +4909,26 @@ var HuggingFaceFillMaskIO = /*#__PURE__*/function (_HuggingFaceIO8) {
4867
4909
  _createClass(HuggingFaceFillMaskIO, [{
4868
4910
  key: "extractResultData",
4869
4911
  value: function () {
4870
- var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
4871
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
4872
- while (1) switch (_context37.prev = _context37.next) {
4912
+ var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e) {
4913
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
4914
+ while (1) switch (_context38.prev = _context38.next) {
4873
4915
  case 0:
4874
4916
  if (!e.error) {
4875
- _context37.next = 2;
4917
+ _context38.next = 2;
4876
4918
  break;
4877
4919
  }
4878
4920
  throw e.error;
4879
4921
  case 2:
4880
- return _context37.abrupt("return", {
4922
+ return _context38.abrupt("return", {
4881
4923
  text: e[0].sequence || ""
4882
4924
  });
4883
4925
  case 3:
4884
4926
  case "end":
4885
- return _context37.stop();
4927
+ return _context38.stop();
4886
4928
  }
4887
- }, _callee37);
4929
+ }, _callee38);
4888
4930
  }));
4889
- function extractResultData(_x67) {
4931
+ function extractResultData(_x71) {
4890
4932
  return _extractResultData11.apply(this, arguments);
4891
4933
  }
4892
4934
  return extractResultData;
@@ -4961,13 +5003,13 @@ var CohereTextGenerationIO = /*#__PURE__*/function (_CohereIO) {
4961
5003
  }, {
4962
5004
  key: "callServiceAPI",
4963
5005
  value: function () {
4964
- var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e, t) {
5006
+ var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e, t) {
4965
5007
  var n;
4966
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
4967
- while (1) switch (_context38.prev = _context38.next) {
5008
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
5009
+ while (1) switch (_context39.prev = _context39.next) {
4968
5010
  case 0:
4969
5011
  if (this.requestSettings) {
4970
- _context38.next = 2;
5012
+ _context39.next = 2;
4971
5013
  break;
4972
5014
  }
4973
5015
  throw new Error("Request settings have not been set up");
@@ -4976,11 +5018,11 @@ var CohereTextGenerationIO = /*#__PURE__*/function (_CohereIO) {
4976
5018
  HTTPRequest.request(this, n, e);
4977
5019
  case 4:
4978
5020
  case "end":
4979
- return _context38.stop();
5021
+ return _context39.stop();
4980
5022
  }
4981
- }, _callee38, this);
5023
+ }, _callee39, this);
4982
5024
  }));
4983
- function callServiceAPI(_x68, _x69) {
5025
+ function callServiceAPI(_x72, _x73) {
4984
5026
  return _callServiceAPI8.apply(this, arguments);
4985
5027
  }
4986
5028
  return callServiceAPI;
@@ -4988,27 +5030,27 @@ var CohereTextGenerationIO = /*#__PURE__*/function (_CohereIO) {
4988
5030
  }, {
4989
5031
  key: "extractResultData",
4990
5032
  value: function () {
4991
- var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e) {
5033
+ var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e) {
4992
5034
  var t;
4993
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
4994
- while (1) switch (_context39.prev = _context39.next) {
5035
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
5036
+ while (1) switch (_context40.prev = _context40.next) {
4995
5037
  case 0:
4996
5038
  if (!e.message) {
4997
- _context39.next = 2;
5039
+ _context40.next = 2;
4998
5040
  break;
4999
5041
  }
5000
5042
  throw e.message;
5001
5043
  case 2:
5002
- return _context39.abrupt("return", {
5044
+ return _context40.abrupt("return", {
5003
5045
  text: ((t = e.generations) == null ? void 0 : t[0].text) || ""
5004
5046
  });
5005
5047
  case 3:
5006
5048
  case "end":
5007
- return _context39.stop();
5049
+ return _context40.stop();
5008
5050
  }
5009
- }, _callee39);
5051
+ }, _callee40);
5010
5052
  }));
5011
- function extractResultData(_x70) {
5053
+ function extractResultData(_x74) {
5012
5054
  return _extractResultData12.apply(this, arguments);
5013
5055
  }
5014
5056
  return extractResultData;
@@ -5038,13 +5080,13 @@ var CohereSummarizationIO = /*#__PURE__*/function (_CohereIO2) {
5038
5080
  }, {
5039
5081
  key: "callServiceAPI",
5040
5082
  value: function () {
5041
- var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e, t) {
5083
+ var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e, t) {
5042
5084
  var n;
5043
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
5044
- while (1) switch (_context40.prev = _context40.next) {
5085
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
5086
+ while (1) switch (_context41.prev = _context41.next) {
5045
5087
  case 0:
5046
5088
  if (this.requestSettings) {
5047
- _context40.next = 2;
5089
+ _context41.next = 2;
5048
5090
  break;
5049
5091
  }
5050
5092
  throw new Error("Request settings have not been set up");
@@ -5053,11 +5095,11 @@ var CohereSummarizationIO = /*#__PURE__*/function (_CohereIO2) {
5053
5095
  HTTPRequest.request(this, n, e);
5054
5096
  case 4:
5055
5097
  case "end":
5056
- return _context40.stop();
5098
+ return _context41.stop();
5057
5099
  }
5058
- }, _callee40, this);
5100
+ }, _callee41, this);
5059
5101
  }));
5060
- function callServiceAPI(_x71, _x72) {
5102
+ function callServiceAPI(_x75, _x76) {
5061
5103
  return _callServiceAPI9.apply(this, arguments);
5062
5104
  }
5063
5105
  return callServiceAPI;
@@ -5065,26 +5107,26 @@ var CohereSummarizationIO = /*#__PURE__*/function (_CohereIO2) {
5065
5107
  }, {
5066
5108
  key: "extractResultData",
5067
5109
  value: function () {
5068
- var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e) {
5069
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
5070
- while (1) switch (_context41.prev = _context41.next) {
5110
+ var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e) {
5111
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
5112
+ while (1) switch (_context42.prev = _context42.next) {
5071
5113
  case 0:
5072
5114
  if (!e.message) {
5073
- _context41.next = 2;
5115
+ _context42.next = 2;
5074
5116
  break;
5075
5117
  }
5076
5118
  throw e.message;
5077
5119
  case 2:
5078
- return _context41.abrupt("return", {
5120
+ return _context42.abrupt("return", {
5079
5121
  text: e.summary || ""
5080
5122
  });
5081
5123
  case 3:
5082
5124
  case "end":
5083
- return _context41.stop();
5125
+ return _context42.stop();
5084
5126
  }
5085
- }, _callee41);
5127
+ }, _callee42);
5086
5128
  }));
5087
- function extractResultData(_x73) {
5129
+ function extractResultData(_x77) {
5088
5130
  return _extractResultData13.apply(this, arguments);
5089
5131
  }
5090
5132
  return extractResultData;
@@ -5241,13 +5283,13 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5241
5283
  }, {
5242
5284
  key: "callServiceAPI",
5243
5285
  value: function () {
5244
- var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e, t) {
5286
+ var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e, t) {
5245
5287
  var n;
5246
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
5247
- while (1) switch (_context42.prev = _context42.next) {
5288
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
5289
+ while (1) switch (_context43.prev = _context43.next) {
5248
5290
  case 0:
5249
5291
  if (this.requestSettings) {
5250
- _context42.next = 2;
5292
+ _context43.next = 2;
5251
5293
  break;
5252
5294
  }
5253
5295
  throw new Error("Request settings have not been set up");
@@ -5256,11 +5298,11 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5256
5298
  HTTPRequest.request(this, n, e), this.messages = e;
5257
5299
  case 4:
5258
5300
  case "end":
5259
- return _context42.stop();
5301
+ return _context43.stop();
5260
5302
  }
5261
- }, _callee42, this);
5303
+ }, _callee43, this);
5262
5304
  }));
5263
- function callServiceAPI(_x74, _x75) {
5305
+ function callServiceAPI(_x78, _x79) {
5264
5306
  return _callServiceAPI10.apply(this, arguments);
5265
5307
  }
5266
5308
  return callServiceAPI;
@@ -5268,34 +5310,34 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5268
5310
  }, {
5269
5311
  key: "extractResultData",
5270
5312
  value: function () {
5271
- var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e) {
5272
- var t, n, s;
5273
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
5274
- while (1) switch (_context43.prev = _context43.next) {
5313
+ var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(e) {
5314
+ var t, n, _s4;
5315
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
5316
+ while (1) switch (_context44.prev = _context44.next) {
5275
5317
  case 0:
5276
5318
  if (!e.error) {
5277
- _context43.next = 2;
5319
+ _context44.next = 2;
5278
5320
  break;
5279
5321
  }
5280
5322
  throw e.error.message;
5281
5323
  case 2:
5282
5324
  if (this.messages && this.completionsHandlers) {
5283
- n = e.headers.get("operation-location"), s = {
5325
+ n = e.headers.get("operation-location"), _s4 = {
5284
5326
  method: "GET",
5285
5327
  headers: (t = this.requestSettings) == null ? void 0 : t.headers
5286
5328
  };
5287
- HTTPRequest.executePollRequest(this, n, s, this.messages);
5329
+ HTTPRequest.executePollRequest(this, n, _s4, this.messages);
5288
5330
  }
5289
- return _context43.abrupt("return", {
5331
+ return _context44.abrupt("return", {
5290
5332
  pollingInAnotherRequest: !0
5291
5333
  });
5292
5334
  case 4:
5293
5335
  case "end":
5294
- return _context43.stop();
5336
+ return _context44.stop();
5295
5337
  }
5296
- }, _callee43, this);
5338
+ }, _callee44, this);
5297
5339
  }));
5298
- function extractResultData(_x76) {
5340
+ function extractResultData(_x80) {
5299
5341
  return _extractResultData14.apply(this, arguments);
5300
5342
  }
5301
5343
  return extractResultData;
@@ -5303,33 +5345,33 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5303
5345
  }, {
5304
5346
  key: "extractPollResultData",
5305
5347
  value: function () {
5306
- var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(e) {
5348
+ var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e) {
5307
5349
  var t, _iterator, _step, n;
5308
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
5309
- while (1) switch (_context44.prev = _context44.next) {
5350
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
5351
+ while (1) switch (_context45.prev = _context45.next) {
5310
5352
  case 0:
5311
5353
  if (!e.error) {
5312
- _context44.next = 2;
5354
+ _context45.next = 2;
5313
5355
  break;
5314
5356
  }
5315
5357
  throw e.error;
5316
5358
  case 2:
5317
5359
  if (!(e.status === "running")) {
5318
- _context44.next = 4;
5360
+ _context45.next = 4;
5319
5361
  break;
5320
5362
  }
5321
- return _context44.abrupt("return", {
5363
+ return _context45.abrupt("return", {
5322
5364
  timeoutMS: 2e3
5323
5365
  });
5324
5366
  case 4:
5325
5367
  if (!(e.errors.length > 0)) {
5326
- _context44.next = 6;
5368
+ _context45.next = 6;
5327
5369
  break;
5328
5370
  }
5329
5371
  throw e.errors[0];
5330
5372
  case 6:
5331
5373
  if (!(e.tasks.items[0].results.errors.length > 0)) {
5332
- _context44.next = 8;
5374
+ _context45.next = 8;
5333
5375
  break;
5334
5376
  }
5335
5377
  throw e.tasks.items[0].results.errors[0];
@@ -5346,16 +5388,16 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5346
5388
  } finally {
5347
5389
  _iterator.f();
5348
5390
  }
5349
- return _context44.abrupt("return", {
5391
+ return _context45.abrupt("return", {
5350
5392
  text: t || ""
5351
5393
  });
5352
5394
  case 12:
5353
5395
  case "end":
5354
- return _context44.stop();
5396
+ return _context45.stop();
5355
5397
  }
5356
- }, _callee44);
5398
+ }, _callee45);
5357
5399
  }));
5358
- function extractPollResultData(_x77) {
5400
+ function extractPollResultData(_x81) {
5359
5401
  return _extractPollResultData4.apply(this, arguments);
5360
5402
  }
5361
5403
  return extractPollResultData;
@@ -5454,13 +5496,13 @@ var OpenAICompletionsIO = /*#__PURE__*/function (_DirectServiceIO5) {
5454
5496
  }, {
5455
5497
  key: "callServiceAPI",
5456
5498
  value: function () {
5457
- var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e, t) {
5499
+ var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e, t) {
5458
5500
  var n;
5459
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
5460
- while (1) switch (_context45.prev = _context45.next) {
5501
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
5502
+ while (1) switch (_context46.prev = _context46.next) {
5461
5503
  case 0:
5462
5504
  if (this.requestSettings) {
5463
- _context45.next = 2;
5505
+ _context46.next = 2;
5464
5506
  break;
5465
5507
  }
5466
5508
  throw new Error("Request settings have not been set up");
@@ -5469,11 +5511,11 @@ var OpenAICompletionsIO = /*#__PURE__*/function (_DirectServiceIO5) {
5469
5511
  this.deepChat.stream || n.stream ? (n.stream = !0, Stream.request(this, n, e)) : HTTPRequest.request(this, n, e);
5470
5512
  case 4:
5471
5513
  case "end":
5472
- return _context45.stop();
5514
+ return _context46.stop();
5473
5515
  }
5474
- }, _callee45, this);
5516
+ }, _callee46, this);
5475
5517
  }));
5476
- function callServiceAPI(_x78, _x79) {
5518
+ function callServiceAPI(_x82, _x83) {
5477
5519
  return _callServiceAPI11.apply(this, arguments);
5478
5520
  }
5479
5521
  return callServiceAPI;
@@ -5481,27 +5523,27 @@ var OpenAICompletionsIO = /*#__PURE__*/function (_DirectServiceIO5) {
5481
5523
  }, {
5482
5524
  key: "extractResultData",
5483
5525
  value: function () {
5484
- var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e) {
5526
+ var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e) {
5485
5527
  var t;
5486
- return _regeneratorRuntime().wrap(function _callee46$(_context46) {
5487
- while (1) switch (_context46.prev = _context46.next) {
5528
+ return _regeneratorRuntime().wrap(function _callee47$(_context47) {
5529
+ while (1) switch (_context47.prev = _context47.next) {
5488
5530
  case 0:
5489
5531
  if (!e.error) {
5490
- _context46.next = 2;
5532
+ _context47.next = 2;
5491
5533
  break;
5492
5534
  }
5493
5535
  throw e.error.message;
5494
5536
  case 2:
5495
- return _context46.abrupt("return", {
5537
+ return _context47.abrupt("return", {
5496
5538
  text: ((t = e.choices[0]) == null ? void 0 : t.text) || ""
5497
5539
  });
5498
5540
  case 3:
5499
5541
  case "end":
5500
- return _context46.stop();
5542
+ return _context47.stop();
5501
5543
  }
5502
- }, _callee46);
5544
+ }, _callee47);
5503
5545
  }));
5504
- function extractResultData(_x80) {
5546
+ function extractResultData(_x84) {
5505
5547
  return _extractResultData15.apply(this, arguments);
5506
5548
  }
5507
5549
  return extractResultData;
@@ -5516,17 +5558,17 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5516
5558
  _createClass(AssemblyAIUtils, null, [{
5517
5559
  key: "poll",
5518
5560
  value: function () {
5519
- var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e, t) {
5561
+ var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t) {
5520
5562
  var n, l, c, d;
5521
- return _regeneratorRuntime().wrap(function _callee47$(_context47) {
5522
- while (1) switch (_context47.prev = _context47.next) {
5563
+ return _regeneratorRuntime().wrap(function _callee48$(_context48) {
5564
+ while (1) switch (_context48.prev = _context48.next) {
5523
5565
  case 0:
5524
5566
  n = {
5525
5567
  authorization: e,
5526
5568
  "content-type": "application/json"
5527
5569
  };
5528
- _context47.t0 = "https://api.assemblyai.com/v2/transcript/";
5529
- _context47.next = 4;
5570
+ _context48.t0 = "https://api.assemblyai.com/v2/transcript/";
5571
+ _context48.next = 4;
5530
5572
  return fetch("https://api.assemblyai.com/v2/transcript", {
5531
5573
  method: "POST",
5532
5574
  body: JSON.stringify({
@@ -5535,55 +5577,55 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5535
5577
  headers: n
5536
5578
  });
5537
5579
  case 4:
5538
- _context47.next = 6;
5539
- return _context47.sent.json();
5580
+ _context48.next = 6;
5581
+ return _context48.sent.json();
5540
5582
  case 6:
5541
- _context47.t1 = _context47.sent.id;
5542
- l = _context47.t0.concat.call(_context47.t0, _context47.t1);
5583
+ _context48.t1 = _context48.sent.id;
5584
+ l = _context48.t0.concat.call(_context48.t0, _context48.t1);
5543
5585
  case 8:
5544
5586
  if (c) {
5545
- _context47.next = 24;
5587
+ _context48.next = 24;
5546
5588
  break;
5547
5589
  }
5548
- _context47.next = 11;
5590
+ _context48.next = 11;
5549
5591
  return fetch(l, {
5550
5592
  headers: n
5551
5593
  });
5552
5594
  case 11:
5553
- _context47.next = 13;
5554
- return _context47.sent.json();
5595
+ _context48.next = 13;
5596
+ return _context48.sent.json();
5555
5597
  case 13:
5556
- d = _context47.sent;
5598
+ d = _context48.sent;
5557
5599
  if (!(d.status === "completed")) {
5558
- _context47.next = 18;
5600
+ _context48.next = 18;
5559
5601
  break;
5560
5602
  }
5561
5603
  c = d;
5562
- _context47.next = 22;
5604
+ _context48.next = 22;
5563
5605
  break;
5564
5606
  case 18:
5565
5607
  if (!(d.status === "error")) {
5566
- _context47.next = 20;
5608
+ _context48.next = 20;
5567
5609
  break;
5568
5610
  }
5569
5611
  throw new Error("Transcription failed: ".concat(d.error));
5570
5612
  case 20:
5571
- _context47.next = 22;
5613
+ _context48.next = 22;
5572
5614
  return new Promise(function (h) {
5573
5615
  return setTimeout(h, 3e3);
5574
5616
  });
5575
5617
  case 22:
5576
- _context47.next = 8;
5618
+ _context48.next = 8;
5577
5619
  break;
5578
5620
  case 24:
5579
- return _context47.abrupt("return", c);
5621
+ return _context48.abrupt("return", c);
5580
5622
  case 25:
5581
5623
  case "end":
5582
- return _context47.stop();
5624
+ return _context48.stop();
5583
5625
  }
5584
- }, _callee47);
5626
+ }, _callee48);
5585
5627
  }));
5586
- function poll(_x81, _x82) {
5628
+ function poll(_x85, _x86) {
5587
5629
  return _poll2.apply(this, arguments);
5588
5630
  }
5589
5631
  return poll;
@@ -5631,19 +5673,19 @@ var AssemblyAIAudioIO = /*#__PURE__*/function (_DirectServiceIO6) {
5631
5673
  _createClass(AssemblyAIAudioIO, [{
5632
5674
  key: "callServiceAPI",
5633
5675
  value: function () {
5634
- var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t, n) {
5676
+ var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e, t, n) {
5635
5677
  var s;
5636
- return _regeneratorRuntime().wrap(function _callee48$(_context48) {
5637
- while (1) switch (_context48.prev = _context48.next) {
5678
+ return _regeneratorRuntime().wrap(function _callee49$(_context49) {
5679
+ while (1) switch (_context49.prev = _context49.next) {
5638
5680
  case 0:
5639
5681
  if ((s = this.requestSettings) != null && s.headers) {
5640
- _context48.next = 2;
5682
+ _context49.next = 2;
5641
5683
  break;
5642
5684
  }
5643
5685
  throw new Error("Request settings have not been set up");
5644
5686
  case 2:
5645
5687
  if (n != null && n[0]) {
5646
- _context48.next = 4;
5688
+ _context49.next = 4;
5647
5689
  break;
5648
5690
  }
5649
5691
  throw new Error("No file was added");
@@ -5651,11 +5693,11 @@ var AssemblyAIAudioIO = /*#__PURE__*/function (_DirectServiceIO6) {
5651
5693
  HTTPRequest.request(this, n[0], e, !1);
5652
5694
  case 5:
5653
5695
  case "end":
5654
- return _context48.stop();
5696
+ return _context49.stop();
5655
5697
  }
5656
- }, _callee48, this);
5698
+ }, _callee49, this);
5657
5699
  }));
5658
- function callServiceAPI(_x83, _x84, _x85) {
5700
+ function callServiceAPI(_x87, _x88, _x89) {
5659
5701
  return _callServiceAPI12.apply(this, arguments);
5660
5702
  }
5661
5703
  return callServiceAPI;
@@ -5663,32 +5705,32 @@ var AssemblyAIAudioIO = /*#__PURE__*/function (_DirectServiceIO6) {
5663
5705
  }, {
5664
5706
  key: "extractResultData",
5665
5707
  value: function () {
5666
- var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e) {
5708
+ var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e) {
5667
5709
  var s, o, t;
5668
- return _regeneratorRuntime().wrap(function _callee49$(_context49) {
5669
- while (1) switch (_context49.prev = _context49.next) {
5710
+ return _regeneratorRuntime().wrap(function _callee50$(_context50) {
5711
+ while (1) switch (_context50.prev = _context50.next) {
5670
5712
  case 0:
5671
5713
  if (!e.error) {
5672
- _context49.next = 2;
5714
+ _context50.next = 2;
5673
5715
  break;
5674
5716
  }
5675
5717
  throw e.error;
5676
5718
  case 2:
5677
5719
  t = (o = (s = this.requestSettings) == null ? void 0 : s.headers) == null ? void 0 : o.Authorization;
5678
- _context49.next = 5;
5720
+ _context50.next = 5;
5679
5721
  return AssemblyAIUtils.poll(t, e.upload_url);
5680
5722
  case 5:
5681
- _context49.t0 = _context49.sent.text;
5682
- return _context49.abrupt("return", {
5683
- text: _context49.t0
5723
+ _context50.t0 = _context50.sent.text;
5724
+ return _context50.abrupt("return", {
5725
+ text: _context50.t0
5684
5726
  });
5685
5727
  case 7:
5686
5728
  case "end":
5687
- return _context49.stop();
5729
+ return _context50.stop();
5688
5730
  }
5689
- }, _callee49, this);
5731
+ }, _callee50, this);
5690
5732
  }));
5691
- function extractResultData(_x86) {
5733
+ function extractResultData(_x90) {
5692
5734
  return _extractResultData16.apply(this, arguments);
5693
5735
  }
5694
5736
  return extractResultData;
@@ -5738,13 +5780,13 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5738
5780
  }, {
5739
5781
  key: "callServiceAPI",
5740
5782
  value: function () {
5741
- var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e, t) {
5783
+ var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e, t) {
5742
5784
  var n;
5743
- return _regeneratorRuntime().wrap(function _callee50$(_context50) {
5744
- while (1) switch (_context50.prev = _context50.next) {
5785
+ return _regeneratorRuntime().wrap(function _callee51$(_context51) {
5786
+ while (1) switch (_context51.prev = _context51.next) {
5745
5787
  case 0:
5746
5788
  if (this.requestSettings) {
5747
- _context50.next = 2;
5789
+ _context51.next = 2;
5748
5790
  break;
5749
5791
  }
5750
5792
  throw new Error("Request settings have not been set up");
@@ -5753,11 +5795,11 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5753
5795
  HTTPRequest.request(this, n, e, !1);
5754
5796
  case 4:
5755
5797
  case "end":
5756
- return _context50.stop();
5798
+ return _context51.stop();
5757
5799
  }
5758
- }, _callee50, this);
5800
+ }, _callee51, this);
5759
5801
  }));
5760
- function callServiceAPI(_x87, _x88) {
5802
+ function callServiceAPI(_x91, _x92) {
5761
5803
  return _callServiceAPI13.apply(this, arguments);
5762
5804
  }
5763
5805
  return callServiceAPI;
@@ -5765,11 +5807,11 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5765
5807
  }, {
5766
5808
  key: "extractResultData",
5767
5809
  value: function () {
5768
- var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e) {
5769
- return _regeneratorRuntime().wrap(function _callee51$(_context51) {
5770
- while (1) switch (_context51.prev = _context51.next) {
5810
+ var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e) {
5811
+ return _regeneratorRuntime().wrap(function _callee52$(_context52) {
5812
+ while (1) switch (_context52.prev = _context52.next) {
5771
5813
  case 0:
5772
- return _context51.abrupt("return", new Promise(function (t) {
5814
+ return _context52.abrupt("return", new Promise(function (t) {
5773
5815
  var n = new FileReader();
5774
5816
  n.readAsDataURL(e), n.onload = function (s) {
5775
5817
  t({
@@ -5782,11 +5824,11 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5782
5824
  }));
5783
5825
  case 1:
5784
5826
  case "end":
5785
- return _context51.stop();
5827
+ return _context52.stop();
5786
5828
  }
5787
- }, _callee51);
5829
+ }, _callee52);
5788
5830
  }));
5789
- function extractResultData(_x89) {
5831
+ function extractResultData(_x93) {
5790
5832
  return _extractResultData17.apply(this, arguments);
5791
5833
  }
5792
5834
  return extractResultData;
@@ -5822,19 +5864,19 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5822
5864
  _createClass(U, [{
5823
5865
  key: "callServiceAPI",
5824
5866
  value: function () {
5825
- var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e, t, n) {
5867
+ var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e, t, n) {
5826
5868
  var s, o;
5827
- return _regeneratorRuntime().wrap(function _callee52$(_context52) {
5828
- while (1) switch (_context52.prev = _context52.next) {
5869
+ return _regeneratorRuntime().wrap(function _callee53$(_context53) {
5870
+ while (1) switch (_context53.prev = _context53.next) {
5829
5871
  case 0:
5830
5872
  if ((s = this.requestSettings) != null && s.headers) {
5831
- _context52.next = 2;
5873
+ _context53.next = 2;
5832
5874
  break;
5833
5875
  }
5834
5876
  throw new Error("Request settings have not been set up");
5835
5877
  case 2:
5836
5878
  if (n != null && n[0]) {
5837
- _context52.next = 4;
5879
+ _context53.next = 4;
5838
5880
  break;
5839
5881
  }
5840
5882
  throw new Error("No file was added");
@@ -5842,11 +5884,11 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5842
5884
  (o = this.requestSettings) != null && o.headers && (this.requestSettings.headers["Content-Type"] = n[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), HTTPRequest.request(this, n[0], e, !1);
5843
5885
  case 5:
5844
5886
  case "end":
5845
- return _context52.stop();
5887
+ return _context53.stop();
5846
5888
  }
5847
- }, _callee52, this);
5889
+ }, _callee53, this);
5848
5890
  }));
5849
- function callServiceAPI(_x90, _x91, _x92) {
5891
+ function callServiceAPI(_x94, _x95, _x96) {
5850
5892
  return _callServiceAPI14.apply(this, arguments);
5851
5893
  }
5852
5894
  return callServiceAPI;
@@ -5854,26 +5896,26 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5854
5896
  }, {
5855
5897
  key: "extractResultData",
5856
5898
  value: function () {
5857
- var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e) {
5858
- return _regeneratorRuntime().wrap(function _callee53$(_context53) {
5859
- while (1) switch (_context53.prev = _context53.next) {
5899
+ var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e) {
5900
+ return _regeneratorRuntime().wrap(function _callee54$(_context54) {
5901
+ while (1) switch (_context54.prev = _context54.next) {
5860
5902
  case 0:
5861
5903
  if (!e.error) {
5862
- _context53.next = 2;
5904
+ _context54.next = 2;
5863
5905
  break;
5864
5906
  }
5865
5907
  throw e.error;
5866
5908
  case 2:
5867
- return _context53.abrupt("return", {
5909
+ return _context54.abrupt("return", {
5868
5910
  text: e.DisplayText || ""
5869
5911
  });
5870
5912
  case 3:
5871
5913
  case "end":
5872
- return _context53.stop();
5914
+ return _context54.stop();
5873
5915
  }
5874
- }, _callee53);
5916
+ }, _callee54);
5875
5917
  }));
5876
- function extractResultData(_x93) {
5918
+ function extractResultData(_x97) {
5877
5919
  return _extractResultData18.apply(this, arguments);
5878
5920
  }
5879
5921
  return extractResultData;
@@ -5916,13 +5958,13 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
5916
5958
  }, {
5917
5959
  key: "callServiceAPI",
5918
5960
  value: function () {
5919
- var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e, t) {
5961
+ var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e, t) {
5920
5962
  var n;
5921
- return _regeneratorRuntime().wrap(function _callee54$(_context54) {
5922
- while (1) switch (_context54.prev = _context54.next) {
5963
+ return _regeneratorRuntime().wrap(function _callee55$(_context55) {
5964
+ while (1) switch (_context55.prev = _context55.next) {
5923
5965
  case 0:
5924
5966
  if (this.requestSettings) {
5925
- _context54.next = 2;
5967
+ _context55.next = 2;
5926
5968
  break;
5927
5969
  }
5928
5970
  throw new Error("Request settings have not been set up");
@@ -5931,11 +5973,11 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
5931
5973
  HTTPRequest.request(this, n, e);
5932
5974
  case 4:
5933
5975
  case "end":
5934
- return _context54.stop();
5976
+ return _context55.stop();
5935
5977
  }
5936
- }, _callee54, this);
5978
+ }, _callee55, this);
5937
5979
  }));
5938
- function callServiceAPI(_x94, _x95) {
5980
+ function callServiceAPI(_x98, _x99) {
5939
5981
  return _callServiceAPI15.apply(this, arguments);
5940
5982
  }
5941
5983
  return callServiceAPI;
@@ -5943,27 +5985,27 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
5943
5985
  }, {
5944
5986
  key: "extractResultData",
5945
5987
  value: function () {
5946
- var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e) {
5988
+ var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e) {
5947
5989
  var t;
5948
- return _regeneratorRuntime().wrap(function _callee55$(_context55) {
5949
- while (1) switch (_context55.prev = _context55.next) {
5990
+ return _regeneratorRuntime().wrap(function _callee56$(_context56) {
5991
+ while (1) switch (_context56.prev = _context56.next) {
5950
5992
  case 0:
5951
5993
  if (!Array.isArray(e)) {
5952
- _context55.next = 2;
5994
+ _context56.next = 2;
5953
5995
  break;
5954
5996
  }
5955
- return _context55.abrupt("return", {
5997
+ return _context56.abrupt("return", {
5956
5998
  text: ((t = e[0].translations) == null ? void 0 : t[0].text) || ""
5957
5999
  });
5958
6000
  case 2:
5959
6001
  throw e.error;
5960
6002
  case 3:
5961
6003
  case "end":
5962
- return _context55.stop();
6004
+ return _context56.stop();
5963
6005
  }
5964
- }, _callee55);
6006
+ }, _callee56);
5965
6007
  }));
5966
- function extractResultData(_x96) {
6008
+ function extractResultData(_x100) {
5967
6009
  return _extractResultData19.apply(this, arguments);
5968
6010
  }
5969
6011
  return extractResultData;
@@ -5972,11 +6014,11 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
5972
6014
  return AzureTranslationIO;
5973
6015
  }(DirectServiceIO);
5974
6016
  var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
5975
- _inherits(A, _DirectServiceIO9);
5976
- var _super30 = _createSuper(A);
5977
- function A(e) {
6017
+ _inherits(M, _DirectServiceIO9);
6018
+ var _super30 = _createSuper(M);
6019
+ function M(e) {
5978
6020
  var _this23;
5979
- _classCallCheck(this, A);
6021
+ _classCallCheck(this, M);
5980
6022
  var l;
5981
6023
  var t = e.directConnection,
5982
6024
  n = e.textInput,
@@ -6000,16 +6042,16 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6000
6042
  }
6001
6043
  };
6002
6044
  }
6003
- _typeof(a) == "object" && Object.assign(_this23.rawBody, a), _this23.canSendMessage = A.canFileSendMessage;
6045
+ _typeof(a) == "object" && Object.assign(_this23.rawBody, a), _this23.canSendMessage = M.canFileSendMessage;
6004
6046
  return _this23;
6005
6047
  }
6006
- _createClass(A, [{
6048
+ _createClass(M, [{
6007
6049
  key: "preprocessBody",
6008
6050
  value: function preprocessBody(e, t) {
6009
6051
  var n = JSON.parse(JSON.stringify(e));
6010
6052
  if (t && t !== "") {
6011
- var s = t.substring(0, this._maxCharLength);
6012
- n.prompt = s;
6053
+ var _s5 = t.substring(0, this._maxCharLength);
6054
+ n.prompt = _s5;
6013
6055
  }
6014
6056
  return n;
6015
6057
  }
@@ -6021,50 +6063,50 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6021
6063
  var s;
6022
6064
  var o = (l = (a = t[t.length - 1]) == null ? void 0 : a.text) == null ? void 0 : l.trim();
6023
6065
  if (n[1] || o && o !== "") {
6024
- this.url = A.IMAGE_EDIT_URL;
6066
+ this.url = M.IMAGE_EDIT_URL;
6025
6067
  var c = this.preprocessBody(this.rawBody, o);
6026
- s = A.createFormDataBody(c, n[0], n[1]);
6027
- } else this.url = A.IMAGE_VARIATIONS_URL, s = A.createFormDataBody(this.rawBody, n[0]);
6068
+ s = M.createFormDataBody(c, n[0], n[1]);
6069
+ } else this.url = M.IMAGE_VARIATIONS_URL, s = M.createFormDataBody(this.rawBody, n[0]);
6028
6070
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, s, e), !1);
6029
6071
  }
6030
6072
  }, {
6031
6073
  key: "callServiceAPI",
6032
6074
  value: function () {
6033
- var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e, t, n) {
6034
- var s, o;
6035
- return _regeneratorRuntime().wrap(function _callee56$(_context56) {
6036
- while (1) switch (_context56.prev = _context56.next) {
6075
+ var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(e, t, n) {
6076
+ var s, _o;
6077
+ return _regeneratorRuntime().wrap(function _callee57$(_context57) {
6078
+ while (1) switch (_context57.prev = _context57.next) {
6037
6079
  case 0:
6038
6080
  if ((s = this.requestSettings) != null && s.headers) {
6039
- _context56.next = 2;
6081
+ _context57.next = 2;
6040
6082
  break;
6041
6083
  }
6042
6084
  throw new Error("Request settings have not been set up");
6043
6085
  case 2:
6044
6086
  if (!(n != null && n[0])) {
6045
- _context56.next = 6;
6087
+ _context57.next = 6;
6046
6088
  break;
6047
6089
  }
6048
6090
  this.callApiWithImage(e, t, n);
6049
- _context56.next = 11;
6091
+ _context57.next = 11;
6050
6092
  break;
6051
6093
  case 6:
6052
6094
  if (this.requestSettings) {
6053
- _context56.next = 8;
6095
+ _context57.next = 8;
6054
6096
  break;
6055
6097
  }
6056
6098
  throw new Error("Request settings have not been set up");
6057
6099
  case 8:
6058
- this.url = A.IMAGE_GENERATION_URL;
6059
- o = this.preprocessBody(this.rawBody, t[t.length - 1].text);
6060
- HTTPRequest.request(this, o, e);
6100
+ this.url = M.IMAGE_GENERATION_URL;
6101
+ _o = this.preprocessBody(this.rawBody, t[t.length - 1].text);
6102
+ HTTPRequest.request(this, _o, e);
6061
6103
  case 11:
6062
6104
  case "end":
6063
- return _context56.stop();
6105
+ return _context57.stop();
6064
6106
  }
6065
- }, _callee56, this);
6107
+ }, _callee57, this);
6066
6108
  }));
6067
- function callServiceAPI(_x97, _x98, _x99) {
6109
+ function callServiceAPI(_x101, _x102, _x103) {
6068
6110
  return _callServiceAPI16.apply(this, arguments);
6069
6111
  }
6070
6112
  return callServiceAPI;
@@ -6072,17 +6114,17 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6072
6114
  }, {
6073
6115
  key: "extractResultData",
6074
6116
  value: function () {
6075
- var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(e) {
6076
- return _regeneratorRuntime().wrap(function _callee57$(_context57) {
6077
- while (1) switch (_context57.prev = _context57.next) {
6117
+ var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e) {
6118
+ return _regeneratorRuntime().wrap(function _callee58$(_context58) {
6119
+ while (1) switch (_context58.prev = _context58.next) {
6078
6120
  case 0:
6079
6121
  if (!e.error) {
6080
- _context57.next = 2;
6122
+ _context58.next = 2;
6081
6123
  break;
6082
6124
  }
6083
6125
  throw e.error.message;
6084
6126
  case 2:
6085
- return _context57.abrupt("return", {
6127
+ return _context58.abrupt("return", {
6086
6128
  files: e.data.map(function (n) {
6087
6129
  return n.url ? {
6088
6130
  src: n.url,
@@ -6095,11 +6137,11 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6095
6137
  });
6096
6138
  case 3:
6097
6139
  case "end":
6098
- return _context57.stop();
6140
+ return _context58.stop();
6099
6141
  }
6100
- }, _callee57);
6142
+ }, _callee58);
6101
6143
  }));
6102
- function extractResultData(_x100) {
6144
+ function extractResultData(_x104) {
6103
6145
  return _extractResultData20.apply(this, arguments);
6104
6146
  }
6105
6147
  return extractResultData;
@@ -6126,34 +6168,34 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6126
6168
  }), s;
6127
6169
  }
6128
6170
  }]);
6129
- return A;
6171
+ return M;
6130
6172
  }(DirectServiceIO);
6131
6173
  _OpenAIImagesIO.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
6132
6174
  _OpenAIImagesIO.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
6133
6175
  _OpenAIImagesIO.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
6134
6176
  var OpenAIImagesIO = _OpenAIImagesIO;
6135
6177
  var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6136
- _inherits(M, _DirectServiceIO10);
6137
- var _super31 = _createSuper(M);
6138
- function M(e) {
6178
+ _inherits(k, _DirectServiceIO10);
6179
+ var _super31 = _createSuper(k);
6180
+ function k(e) {
6139
6181
  var _l$model2;
6140
6182
  var _this24;
6141
- _classCallCheck(this, M);
6183
+ _classCallCheck(this, k);
6142
6184
  var a, l;
6143
6185
  var t = e.directConnection,
6144
6186
  n = e.textInput,
6145
6187
  s = t == null ? void 0 : t.openAI;
6146
6188
  _this24 = _super31.call(this, e, OpenAIUtils.buildKeyVerificationDetails(), OpenAIUtils.buildHeaders, s, {
6147
6189
  audio: {}
6148
- }), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Invalid"], _this24._maxCharLength = OpenAIUtils.FILE_MAX_CHAR_LENGTH, _this24._service_url = M.AUDIO_TRANSCRIPTIONS_URL, n != null && n.characterLimit && (_this24._maxCharLength = n.characterLimit);
6190
+ }), _this24.insertKeyPlaceholderText = "OpenAI API Key", _this24.getKeyLink = "https://platform.openai.com/account/api-keys", _this24.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI Whisper</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/api-reference/audio/create\">here</a> for more info.</p>", _this24.url = "", _this24.permittedErrorPrefixes = ["Invalid"], _this24._maxCharLength = OpenAIUtils.FILE_MAX_CHAR_LENGTH, _this24._service_url = k.AUDIO_TRANSCRIPTIONS_URL, n != null && n.characterLimit && (_this24._maxCharLength = n.characterLimit);
6149
6191
  var o = (a = t == null ? void 0 : t.openAI) == null ? void 0 : a.audio;
6150
- _typeof(o) == "object" && (_this24.processConfig(o), M.cleanConfig(o), Object.assign(_this24.rawBody, o)), (_l$model2 = (l = _this24.rawBody).model) !== null && _l$model2 !== void 0 ? _l$model2 : l.model = M.DEFAULT_MODEL, _this24.rawBody.response_format = "json", _this24.canSendMessage = M.canSendFileMessage;
6192
+ _typeof(o) == "object" && (_this24.processConfig(o), k.cleanConfig(o), Object.assign(_this24.rawBody, o)), (_l$model2 = (l = _this24.rawBody).model) !== null && _l$model2 !== void 0 ? _l$model2 : l.model = k.DEFAULT_MODEL, _this24.rawBody.response_format = "json", _this24.canSendMessage = k.canSendFileMessage;
6151
6193
  return _this24;
6152
6194
  }
6153
- _createClass(M, [{
6195
+ _createClass(k, [{
6154
6196
  key: "processConfig",
6155
6197
  value: function processConfig(e) {
6156
- e != null && e.type && e.type === "translation" && (this._service_url = M.AUDIO_TRANSLATIONS_URL, delete e.language);
6198
+ e != null && e.type && e.type === "translation" && (this._service_url = k.AUDIO_TRANSLATIONS_URL, delete e.language);
6157
6199
  }
6158
6200
  }, {
6159
6201
  key: "preprocessBody",
@@ -6171,33 +6213,33 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6171
6213
  }, {
6172
6214
  key: "callServiceAPI",
6173
6215
  value: function () {
6174
- var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e, t, n) {
6216
+ var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e, t, n) {
6175
6217
  var a, s, o;
6176
- return _regeneratorRuntime().wrap(function _callee58$(_context58) {
6177
- while (1) switch (_context58.prev = _context58.next) {
6218
+ return _regeneratorRuntime().wrap(function _callee59$(_context59) {
6219
+ while (1) switch (_context59.prev = _context59.next) {
6178
6220
  case 0:
6179
6221
  if ((a = this.requestSettings) != null && a.headers) {
6180
- _context58.next = 2;
6222
+ _context59.next = 2;
6181
6223
  break;
6182
6224
  }
6183
6225
  throw new Error("Request settings have not been set up");
6184
6226
  case 2:
6185
6227
  if (n != null && n[0]) {
6186
- _context58.next = 4;
6228
+ _context59.next = 4;
6187
6229
  break;
6188
6230
  }
6189
6231
  throw new Error("No file was added");
6190
6232
  case 4:
6191
6233
  this.url = this.requestSettings.url || this._service_url;
6192
- s = this.preprocessBody(this.rawBody, t, n), o = M.createFormDataBody(s, n[0]);
6234
+ s = this.preprocessBody(this.rawBody, t, n), o = k.createFormDataBody(s, n[0]);
6193
6235
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
6194
6236
  case 7:
6195
6237
  case "end":
6196
- return _context58.stop();
6238
+ return _context59.stop();
6197
6239
  }
6198
- }, _callee58, this);
6240
+ }, _callee59, this);
6199
6241
  }));
6200
- function callServiceAPI(_x101, _x102, _x103) {
6242
+ function callServiceAPI(_x105, _x106, _x107) {
6201
6243
  return _callServiceAPI17.apply(this, arguments);
6202
6244
  }
6203
6245
  return callServiceAPI;
@@ -6205,26 +6247,26 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6205
6247
  }, {
6206
6248
  key: "extractResultData",
6207
6249
  value: function () {
6208
- var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e) {
6209
- return _regeneratorRuntime().wrap(function _callee59$(_context59) {
6210
- while (1) switch (_context59.prev = _context59.next) {
6250
+ var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e) {
6251
+ return _regeneratorRuntime().wrap(function _callee60$(_context60) {
6252
+ while (1) switch (_context60.prev = _context60.next) {
6211
6253
  case 0:
6212
6254
  if (!e.error) {
6213
- _context59.next = 2;
6255
+ _context60.next = 2;
6214
6256
  break;
6215
6257
  }
6216
6258
  throw e.error.message;
6217
6259
  case 2:
6218
- return _context59.abrupt("return", {
6260
+ return _context60.abrupt("return", {
6219
6261
  text: e.text
6220
6262
  });
6221
6263
  case 3:
6222
6264
  case "end":
6223
- return _context59.stop();
6265
+ return _context60.stop();
6224
6266
  }
6225
- }, _callee59);
6267
+ }, _callee60);
6226
6268
  }));
6227
- function extractResultData(_x104) {
6269
+ function extractResultData(_x108) {
6228
6270
  return _extractResultData21.apply(this, arguments);
6229
6271
  }
6230
6272
  return extractResultData;
@@ -6248,7 +6290,7 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6248
6290
  }), n;
6249
6291
  }
6250
6292
  }]);
6251
- return M;
6293
+ return k;
6252
6294
  }(DirectServiceIO);
6253
6295
  _OpenAIAudioIO.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
6254
6296
  _OpenAIAudioIO.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
@@ -6290,13 +6332,13 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6290
6332
  }, {
6291
6333
  key: "callServiceAPI",
6292
6334
  value: function () {
6293
- var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e, t) {
6335
+ var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e, t) {
6294
6336
  var n;
6295
- return _regeneratorRuntime().wrap(function _callee60$(_context60) {
6296
- while (1) switch (_context60.prev = _context60.next) {
6337
+ return _regeneratorRuntime().wrap(function _callee61$(_context61) {
6338
+ while (1) switch (_context61.prev = _context61.next) {
6297
6339
  case 0:
6298
6340
  if (this.requestSettings) {
6299
- _context60.next = 2;
6341
+ _context61.next = 2;
6300
6342
  break;
6301
6343
  }
6302
6344
  throw new Error("Request settings have not been set up");
@@ -6305,11 +6347,11 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6305
6347
  this.deepChat.stream || n.stream ? (n.stream = !0, Stream.request(this, n, e)) : HTTPRequest.request(this, n, e);
6306
6348
  case 4:
6307
6349
  case "end":
6308
- return _context60.stop();
6350
+ return _context61.stop();
6309
6351
  }
6310
- }, _callee60, this);
6352
+ }, _callee61, this);
6311
6353
  }));
6312
- function callServiceAPI(_x105, _x106) {
6354
+ function callServiceAPI(_x109, _x110) {
6313
6355
  return _callServiceAPI18.apply(this, arguments);
6314
6356
  }
6315
6357
  return callServiceAPI;
@@ -6317,17 +6359,17 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6317
6359
  }, {
6318
6360
  key: "extractResultData",
6319
6361
  value: function () {
6320
- var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e) {
6321
- return _regeneratorRuntime().wrap(function _callee61$(_context61) {
6322
- while (1) switch (_context61.prev = _context61.next) {
6362
+ var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e) {
6363
+ return _regeneratorRuntime().wrap(function _callee62$(_context62) {
6364
+ while (1) switch (_context62.prev = _context62.next) {
6323
6365
  case 0:
6324
6366
  if (!e.error) {
6325
- _context61.next = 2;
6367
+ _context62.next = 2;
6326
6368
  break;
6327
6369
  }
6328
6370
  throw e.error.message;
6329
6371
  case 2:
6330
- return _context61.abrupt("return", e.choices[0].delta ? {
6372
+ return _context62.abrupt("return", e.choices[0].delta ? {
6331
6373
  text: e.choices[0].delta.content || ""
6332
6374
  } : e.choices[0].message ? {
6333
6375
  text: e.choices[0].message.content
@@ -6336,11 +6378,11 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6336
6378
  });
6337
6379
  case 3:
6338
6380
  case "end":
6339
- return _context61.stop();
6381
+ return _context62.stop();
6340
6382
  }
6341
- }, _callee61);
6383
+ }, _callee62);
6342
6384
  }));
6343
- function extractResultData(_x107) {
6385
+ function extractResultData(_x111) {
6344
6386
  return _extractResultData22.apply(this, arguments);
6345
6387
  }
6346
6388
  return extractResultData;
@@ -6388,13 +6430,13 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6388
6430
  }, {
6389
6431
  key: "callServiceAPI",
6390
6432
  value: function () {
6391
- var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e, t) {
6433
+ var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e, t) {
6392
6434
  var n;
6393
- return _regeneratorRuntime().wrap(function _callee62$(_context62) {
6394
- while (1) switch (_context62.prev = _context62.next) {
6435
+ return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6436
+ while (1) switch (_context63.prev = _context63.next) {
6395
6437
  case 0:
6396
6438
  if (this.requestSettings) {
6397
- _context62.next = 2;
6439
+ _context63.next = 2;
6398
6440
  break;
6399
6441
  }
6400
6442
  throw new Error("Request settings have not been set up");
@@ -6403,11 +6445,11 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6403
6445
  HTTPRequest.request(this, n, e);
6404
6446
  case 4:
6405
6447
  case "end":
6406
- return _context62.stop();
6448
+ return _context63.stop();
6407
6449
  }
6408
- }, _callee62, this);
6450
+ }, _callee63, this);
6409
6451
  }));
6410
- function callServiceAPI(_x108, _x109) {
6452
+ function callServiceAPI(_x112, _x113) {
6411
6453
  return _callServiceAPI19.apply(this, arguments);
6412
6454
  }
6413
6455
  return callServiceAPI;
@@ -6415,26 +6457,26 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6415
6457
  }, {
6416
6458
  key: "extractResultData",
6417
6459
  value: function () {
6418
- var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e) {
6419
- return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6420
- while (1) switch (_context63.prev = _context63.next) {
6460
+ var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e) {
6461
+ return _regeneratorRuntime().wrap(function _callee64$(_context64) {
6462
+ while (1) switch (_context64.prev = _context64.next) {
6421
6463
  case 0:
6422
6464
  if (!e.message) {
6423
- _context63.next = 2;
6465
+ _context64.next = 2;
6424
6466
  break;
6425
6467
  }
6426
6468
  throw e.message;
6427
6469
  case 2:
6428
- return _context63.abrupt("return", {
6470
+ return _context64.abrupt("return", {
6429
6471
  text: e.text
6430
6472
  });
6431
6473
  case 3:
6432
6474
  case "end":
6433
- return _context63.stop();
6475
+ return _context64.stop();
6434
6476
  }
6435
- }, _callee63);
6477
+ }, _callee64);
6436
6478
  }));
6437
- function extractResultData(_x110) {
6479
+ function extractResultData(_x114) {
6438
6480
  return _extractResultData23.apply(this, arguments);
6439
6481
  }
6440
6482
  return extractResultData;
@@ -6601,11 +6643,11 @@ var _TextToSpeech = /*#__PURE__*/function () {
6601
6643
  var n = {};
6602
6644
  setTimeout(function () {
6603
6645
  if (_typeof(e) == "object" && (e.lang && (n.lang = e.lang), e.pitch && (n.pitch = e.pitch), e.rate && (n.rate = e.rate), e.volume && (n.volume = e.volume), e.voiceName)) {
6604
- var s = window.speechSynthesis.getVoices().find(function (o) {
6646
+ var _s6 = window.speechSynthesis.getVoices().find(function (o) {
6605
6647
  var a;
6606
6648
  return o.name.toLocaleLowerCase() === ((a = e.voiceName) == null ? void 0 : a.toLocaleLowerCase());
6607
6649
  });
6608
- s && (n.voice = s);
6650
+ _s6 && (n.voice = _s6);
6609
6651
  }
6610
6652
  t(n);
6611
6653
  }, $.LOAD_VOICES_MS);
@@ -6647,9 +6689,9 @@ var MessageStyleUtils = /*#__PURE__*/function () {
6647
6689
  key: "applyCustomStylesToElements",
6648
6690
  value: function applyCustomStylesToElements(e, t, n) {
6649
6691
  if (n && (Object.assign(e.outerContainer.style, n.outerContainer), Object.assign(e.innerContainer.style, n.innerContainer), Object.assign(e.bubbleElement.style, n.bubble), t)) {
6650
- var s = e.bubbleElement.children[0],
6651
- o = s.tagName.toLocaleLowerCase() !== "a" ? s : s.children[0];
6652
- Object.assign(o.style, n.media);
6692
+ var _s7 = e.bubbleElement.children[0],
6693
+ _o2 = _s7.tagName.toLocaleLowerCase() !== "a" ? _s7 : _s7.children[0];
6694
+ Object.assign(_o2.style, n.media);
6653
6695
  }
6654
6696
  }
6655
6697
  }, {
@@ -6792,24 +6834,24 @@ var FileMessages = /*#__PURE__*/function () {
6792
6834
  }, {
6793
6835
  key: "addNewImageMessage",
6794
6836
  value: function () {
6795
- var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e, t, n) {
6837
+ var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e, t, n) {
6796
6838
  var s,
6797
6839
  o,
6798
6840
  a,
6799
- _args64 = arguments;
6800
- return _regeneratorRuntime().wrap(function _callee64$(_context64) {
6801
- while (1) switch (_context64.prev = _context64.next) {
6841
+ _args65 = arguments;
6842
+ return _regeneratorRuntime().wrap(function _callee65$(_context65) {
6843
+ while (1) switch (_context65.prev = _context65.next) {
6802
6844
  case 0:
6803
- s = _args64.length > 3 && _args64[3] !== undefined ? _args64[3] : !1;
6845
+ s = _args65.length > 3 && _args65[3] !== undefined ? _args65[3] : !1;
6804
6846
  o = FileMessages.createImage(t, e.elementRef), a = e.createNewMessageElement("", n);
6805
6847
  a.bubbleElement.appendChild(o), a.bubbleElement.classList.add("image-message"), e.elementRef.appendChild(a.outerContainer), FileMessageUtils.updateMessages(e, a, t, "image", n, s);
6806
6848
  case 3:
6807
6849
  case "end":
6808
- return _context64.stop();
6850
+ return _context65.stop();
6809
6851
  }
6810
- }, _callee64);
6852
+ }, _callee65);
6811
6853
  }));
6812
- function addNewImageMessage(_x111, _x112, _x113) {
6854
+ function addNewImageMessage(_x115, _x116, _x117) {
6813
6855
  return _addNewImageMessage.apply(this, arguments);
6814
6856
  }
6815
6857
  return addNewImageMessage;
@@ -7080,16 +7122,27 @@ var Messages = /*#__PURE__*/function () {
7080
7122
  }
7081
7123
  }
7082
7124
  }
7125
+ }, {
7126
+ key: "getLastMessageElement",
7127
+ value: function getLastMessageElement() {
7128
+ return this.elementRef.children[this.elementRef.children.length - 1];
7129
+ }
7130
+ }, {
7131
+ key: "getLastMessageBubbleElement",
7132
+ value: function getLastMessageBubbleElement() {
7133
+ var e, t, n, s;
7134
+ return (s = (n = (t = (e = this.getLastMessageElement()) == null ? void 0 : e.children) == null ? void 0 : t[0]) == null ? void 0 : n.children) == null ? void 0 : s[0];
7135
+ }
7083
7136
  }, {
7084
7137
  key: "isLastMessageError",
7085
7138
  value: function isLastMessageError() {
7086
- var e, t, n, s, o;
7087
- return (o = (s = (n = (t = (e = this.elementRef.children[this.elementRef.children.length - 1]) == null ? void 0 : e.children) == null ? void 0 : t[0]) == null ? void 0 : n.children) == null ? void 0 : s[0]) == null ? void 0 : o.classList.contains("error-message-text");
7139
+ var e;
7140
+ return (e = this.getLastMessageBubbleElement()) == null ? void 0 : e.classList.contains("error-message-text");
7088
7141
  }
7089
7142
  }, {
7090
7143
  key: "removeError",
7091
7144
  value: function removeError() {
7092
- this.isLastMessageError() && this.elementRef.children[this.elementRef.children.length - 1].remove();
7145
+ this.isLastMessageError() && this.getLastMessageElement().remove();
7093
7146
  }
7094
7147
  }, {
7095
7148
  key: "addLoadingMessage",
@@ -7124,7 +7177,7 @@ var Messages = /*#__PURE__*/function () {
7124
7177
  }, {
7125
7178
  key: "finaliseStreamedMessage",
7126
7179
  value: function finaliseStreamedMessage() {
7127
- this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, this._streamedText), !1), this._textToSpeech && TextToSpeech.speak(this._streamedText, this._textToSpeech), this._streamedText = "";
7180
+ this.getLastMessageBubbleElement().classList.contains("streamed-message") && (this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, this._streamedText), !1), this._textToSpeech && TextToSpeech.speak(this._streamedText, this._textToSpeech), this._streamedText = "");
7128
7181
  }
7129
7182
  }, {
7130
7183
  key: "populateIntroPanel",
@@ -7134,27 +7187,27 @@ var Messages = /*#__PURE__*/function () {
7134
7187
  }, {
7135
7188
  key: "addMultipleFiles",
7136
7189
  value: function () {
7137
- var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e) {
7190
+ var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
7138
7191
  var _this31 = this;
7139
- return _regeneratorRuntime().wrap(function _callee65$(_context65) {
7140
- while (1) switch (_context65.prev = _context65.next) {
7192
+ return _regeneratorRuntime().wrap(function _callee66$(_context66) {
7193
+ while (1) switch (_context66.prev = _context66.next) {
7141
7194
  case 0:
7142
- return _context65.abrupt("return", Promise.all((e || []).map(function (t) {
7195
+ return _context66.abrupt("return", Promise.all((e || []).map(function (t) {
7143
7196
  return new Promise(function (n) {
7144
7197
  if (!t.type || t.type === "any") {
7145
- var s = t.file.name || FileMessageUtils.DEFAULT_FILE_NAME;
7198
+ var _s8 = t.file.name || FileMessageUtils.DEFAULT_FILE_NAME;
7146
7199
  _this31.addNewMessage({
7147
7200
  files: [{
7148
- name: s,
7201
+ name: _s8,
7149
7202
  type: "any"
7150
7203
  }]
7151
7204
  }, !1, !0), n(!0);
7152
7205
  } else {
7153
- var _s = new FileReader();
7154
- _s.readAsDataURL(t.file), _s.onload = function () {
7206
+ var _s9 = new FileReader();
7207
+ _s9.readAsDataURL(t.file), _s9.onload = function () {
7155
7208
  _this31.addNewMessage({
7156
7209
  files: [{
7157
- src: _s.result,
7210
+ src: _s9.result,
7158
7211
  type: t.type
7159
7212
  }]
7160
7213
  }, !1, !0), n(!0);
@@ -7164,11 +7217,11 @@ var Messages = /*#__PURE__*/function () {
7164
7217
  })));
7165
7218
  case 1:
7166
7219
  case "end":
7167
- return _context65.stop();
7220
+ return _context66.stop();
7168
7221
  }
7169
- }, _callee65);
7222
+ }, _callee66);
7170
7223
  }));
7171
- function addMultipleFiles(_x114) {
7224
+ function addMultipleFiles(_x118) {
7172
7225
  return _addMultipleFiles.apply(this, arguments);
7173
7226
  }
7174
7227
  return addMultipleFiles;
@@ -7242,10 +7295,10 @@ var Messages = /*#__PURE__*/function () {
7242
7295
  return Messages;
7243
7296
  }();
7244
7297
  var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7245
- function E() {
7246
- _classCallCheck(this, E);
7298
+ function T() {
7299
+ _classCallCheck(this, T);
7247
7300
  }
7248
- _createClass(E, null, [{
7301
+ _createClass(T, null, [{
7249
7302
  key: "adjustInputPadding",
7250
7303
  value: function adjustInputPadding(e, t) {
7251
7304
  t["inside-left"].length > 0 && e.classList.add("text-input-inner-left-adjustment"), t["inside-right"].length > 0 && e.classList.add("text-input-inner-right-adjustment");
@@ -7253,7 +7306,7 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7253
7306
  }, {
7254
7307
  key: "adjustForOutsideButton",
7255
7308
  value: function adjustForOutsideButton(e, t, n) {
7256
- n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(E.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(E.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : n["outside-left"].length === 0 && n["outside-right"].length > 0 && (e[3].classList.add(E.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(E.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
7309
+ n["outside-right"].length === 0 && n["outside-left"].length > 0 ? (e[0].classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS)) : n["outside-left"].length === 0 && n["outside-right"].length > 0 && (e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS));
7257
7310
  }
7258
7311
  // when submit is the only button
7259
7312
  // when submit button is outside by itself - we increase the height for a better look
@@ -7261,10 +7314,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7261
7314
  key: "adjustOutsideSubmit",
7262
7315
  value: function adjustOutsideSubmit(e, t, n) {
7263
7316
  if (!(n["inside-left"].length > 0 || n["inside-right"].length > 0)) {
7264
- if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(E.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(E.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), n["outside-left"].map(function (s) {
7317
+ if (n["outside-right"].length === 0 && n["outside-left"].length > 0) return e[0].classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS), n["outside-left"].map(function (s) {
7265
7318
  return s.button.elementRef.classList.add("submit-button-enlarged");
7266
7319
  });
7267
- if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(E.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(E.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), n["outside-right"].map(function (s) {
7320
+ if (n["outside-left"].length === 0 && n["outside-right"].length > 0) return e[3].classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), t.classList.add(T.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS), n["outside-right"].map(function (s) {
7268
7321
  return s.button.elementRef.classList.add("submit-button-enlarged");
7269
7322
  });
7270
7323
  }
@@ -7272,10 +7325,10 @@ var _InputButtonStyleAdjustments = /*#__PURE__*/function () {
7272
7325
  }, {
7273
7326
  key: "set",
7274
7327
  value: function set(e, t, n, s) {
7275
- !!E.adjustOutsideSubmit(t, n, s) || E.adjustForOutsideButton(t, n, s), E.adjustInputPadding(e, s);
7328
+ !!T.adjustOutsideSubmit(t, n, s) || T.adjustForOutsideButton(t, n, s), T.adjustInputPadding(e, s);
7276
7329
  }
7277
7330
  }]);
7278
- return E;
7331
+ return T;
7279
7332
  }();
7280
7333
  _InputButtonStyleAdjustments.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment";
7281
7334
  _InputButtonStyleAdjustments.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment";
@@ -7439,8 +7492,8 @@ var InputButton = /*#__PURE__*/function () {
7439
7492
  value: function unsetCustomStateStyles(e) {
7440
7493
  if (this._customStyles) for (var t = 0; t < e.length; t += 1) {
7441
7494
  var n = e[t],
7442
- s = n && this._customStyles[n];
7443
- s && ButtonCSS.unsetActionCSS(this.elementRef, s);
7495
+ _s10 = n && this._customStyles[n];
7496
+ _s10 && ButtonCSS.unsetActionCSS(this.elementRef, _s10);
7444
7497
  }
7445
7498
  }
7446
7499
  }, {
@@ -7804,14 +7857,14 @@ var FileAttachmentsType = /*#__PURE__*/function () {
7804
7857
  key: "addAttachmentBasedOnType",
7805
7858
  value: function addAttachmentBasedOnType(e, t, n) {
7806
7859
  if (e.type.startsWith("image")) {
7807
- var s = FileAttachmentsType.createImageAttachment(t);
7808
- this.addFileAttachment(e, "image", s, n);
7860
+ var _s11 = FileAttachmentsType.createImageAttachment(t);
7861
+ this.addFileAttachment(e, "image", _s11, n);
7809
7862
  } else if (e.type.startsWith("audio")) {
7810
- var _s2 = AudioFileAttachmentType.createAudioAttachment(t);
7811
- this.addFileAttachment(e, "audio", _s2, n);
7863
+ var _s12 = AudioFileAttachmentType.createAudioAttachment(t);
7864
+ this.addFileAttachment(e, "audio", _s12, n);
7812
7865
  } else {
7813
- var _s3 = FileAttachmentsType.createAnyFileAttachment(e.name);
7814
- this.addFileAttachment(e, "any", _s3, n);
7866
+ var _s13 = FileAttachmentsType.createAnyFileAttachment(e.name);
7867
+ this.addFileAttachment(e, "any", _s13, n);
7815
7868
  }
7816
7869
  }
7817
7870
  }, {
@@ -7873,15 +7926,15 @@ var FileAttachmentsType = /*#__PURE__*/function () {
7873
7926
  value: function isFileTypeValid(e, t) {
7874
7927
  if (t === "") return !0;
7875
7928
  var n = t.split(",");
7876
- for (var s = 0; s < n.length; s++) {
7877
- var o = n[s].trim();
7878
- if (e.type === o) return !0;
7879
- if (o.startsWith(".")) {
7880
- var a = o.slice(1);
7881
- if (e.name.endsWith(a)) return !0;
7929
+ for (var _s14 = 0; _s14 < n.length; _s14++) {
7930
+ var _o3 = n[_s14].trim();
7931
+ if (e.type === _o3) return !0;
7932
+ if (_o3.startsWith(".")) {
7933
+ var _a3 = _o3.slice(1);
7934
+ if (e.name.endsWith(_a3)) return !0;
7882
7935
  } else {
7883
- if (e.name.endsWith(o)) return !0;
7884
- if (o.endsWith("/*") && e.type.startsWith(o.slice(0, -2))) return !0;
7936
+ if (e.name.endsWith(_o3)) return !0;
7937
+ if (_o3.endsWith("/*") && e.type.startsWith(_o3.slice(0, -2))) return !0;
7885
7938
  }
7886
7939
  }
7887
7940
  return !1;
@@ -7914,18 +7967,18 @@ var FileAttachmentsType = /*#__PURE__*/function () {
7914
7967
  var PLAY_ICON_STRING = "<?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>",
7915
7968
  STOP_ICON_STRING = "<?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>",
7916
7969
  _AudioFileAttachmentType = /*#__PURE__*/function (_FileAttachmentsType) {
7917
- _inherits(k, _FileAttachmentsType);
7918
- var _super35 = _createSuper(k);
7919
- function k(e, t, n) {
7920
- _classCallCheck(this, k);
7970
+ _inherits(I, _FileAttachmentsType);
7971
+ var _super35 = _createSuper(I);
7972
+ function I(e, t, n) {
7973
+ _classCallCheck(this, I);
7921
7974
  return _super35.call(this, e, t, n);
7922
7975
  }
7923
- _createClass(k, [{
7976
+ _createClass(I, [{
7924
7977
  key: "createTimer",
7925
7978
  value: function createTimer(e, t) {
7926
7979
  var _this37 = this;
7927
7980
  var n = 0;
7928
- var s = t !== void 0 && t < k.TIMER_LIMIT_S ? t : k.TIMER_LIMIT_S;
7981
+ var s = t !== void 0 && t < I.TIMER_LIMIT_S ? t : I.TIMER_LIMIT_S;
7929
7982
  return setInterval(function () {
7930
7983
  var l;
7931
7984
  n += 1, n === s && ((l = _this37.stopPlaceholderCallback) == null || l.call(_this37), _this37.clearTimer()), n === 600 && e.classList.add("audio-placeholder-text-4-digits");
@@ -7937,7 +7990,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
7937
7990
  }, {
7938
7991
  key: "createPlaceholderAudioAttachment",
7939
7992
  value: function createPlaceholderAudioAttachment(e) {
7940
- var t = k.createAudioContainer(),
7993
+ var t = I.createAudioContainer(),
7941
7994
  n = document.createElement("div");
7942
7995
  n.classList.add("audio-placeholder-text-3-digits");
7943
7996
  var s = document.createElement("div");
@@ -7974,7 +8027,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
7974
8027
  key: "completePlaceholderAttachment",
7975
8028
  value: function completePlaceholderAttachment(e, t) {
7976
8029
  var n = this._activePlaceholderAttachment;
7977
- n && (n.file = e, k.addAudioElements(n.attachmentContainerElement.children[0], t), n.removeButton = this.createRemoveAttachmentButton(n), n.attachmentContainerElement.appendChild(n.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
8030
+ n && (n.file = e, I.addAudioElements(n.attachmentContainerElement.children[0], t), n.removeButton = this.createRemoveAttachmentButton(n), n.attachmentContainerElement.appendChild(n.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
7978
8031
  }
7979
8032
  }, {
7980
8033
  key: "removePlaceholderAttachment",
@@ -8014,8 +8067,8 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
8014
8067
  }, {
8015
8068
  key: "createAudioAttachment",
8016
8069
  value: function createAudioAttachment(e) {
8017
- var t = k.createAudioContainer();
8018
- return k.addAudioElements(t, e), t;
8070
+ var t = I.createAudioContainer();
8071
+ return I.addAudioElements(t, e), t;
8019
8072
  }
8020
8073
  }, {
8021
8074
  key: "stopAttachmentPlayback",
@@ -8024,7 +8077,7 @@ var PLAY_ICON_STRING = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox
8024
8077
  (s = (n = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : n[0]) != null && s.classList.contains("stop-icon") && e.children[0].click();
8025
8078
  }
8026
8079
  }]);
8027
- return k;
8080
+ return I;
8028
8081
  }(FileAttachmentsType);
8029
8082
  _AudioFileAttachmentType.TIMER_LIMIT_S = 5999;
8030
8083
  var AudioFileAttachmentType = _AudioFileAttachmentType;
@@ -8078,33 +8131,33 @@ var FileAttachments = /*#__PURE__*/function () {
8078
8131
  }, {
8079
8132
  key: "completePlaceholders",
8080
8133
  value: function () {
8081
- var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67() {
8082
- return _regeneratorRuntime().wrap(function _callee67$(_context67) {
8083
- while (1) switch (_context67.prev = _context67.next) {
8134
+ var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68() {
8135
+ return _regeneratorRuntime().wrap(function _callee68$(_context68) {
8136
+ while (1) switch (_context68.prev = _context68.next) {
8084
8137
  case 0:
8085
- _context67.next = 2;
8138
+ _context68.next = 2;
8086
8139
  return Promise.all(this._fileAttachmentsTypes.map( /*#__PURE__*/function () {
8087
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
8140
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(e) {
8088
8141
  var t;
8089
- return _regeneratorRuntime().wrap(function _callee66$(_context66) {
8090
- while (1) switch (_context66.prev = _context66.next) {
8142
+ return _regeneratorRuntime().wrap(function _callee67$(_context67) {
8143
+ while (1) switch (_context67.prev = _context67.next) {
8091
8144
  case 0:
8092
- return _context66.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
8145
+ return _context67.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
8093
8146
  case 1:
8094
8147
  case "end":
8095
- return _context66.stop();
8148
+ return _context67.stop();
8096
8149
  }
8097
- }, _callee66);
8150
+ }, _callee67);
8098
8151
  }));
8099
- return function (_x115) {
8152
+ return function (_x119) {
8100
8153
  return _ref6.apply(this, arguments);
8101
8154
  };
8102
8155
  }()));
8103
8156
  case 2:
8104
8157
  case "end":
8105
- return _context67.stop();
8158
+ return _context68.stop();
8106
8159
  }
8107
- }, _callee67, this);
8160
+ }, _callee68, this);
8108
8161
  }));
8109
8162
  function completePlaceholders() {
8110
8163
  return _completePlaceholders.apply(this, arguments);
@@ -8134,7 +8187,7 @@ var FileAttachments = /*#__PURE__*/function () {
8134
8187
  e.forEach(function (n) {
8135
8188
  var s = new FileReader();
8136
8189
  s.readAsDataURL(n), s.onload = function (o) {
8137
- for (var a = 0; a < t.length && !t[a].attemptAddFile(n, o.target.result); a += 1);
8190
+ for (var _a4 = 0; _a4 < t.length && !t[_a4].attemptAddFile(n, o.target.result); _a4 += 1);
8138
8191
  };
8139
8192
  });
8140
8193
  }
@@ -8142,11 +8195,11 @@ var FileAttachments = /*#__PURE__*/function () {
8142
8195
  return FileAttachments;
8143
8196
  }();
8144
8197
  var _Modal = /*#__PURE__*/function () {
8145
- function T(e, t, n) {
8146
- _classCallCheck(this, T);
8147
- this._isOpen = !1, this._contentRef = T.createModalContent(t, n == null ? void 0 : n.backgroundColor), this._buttonPanel = T.createButtonPanel(n == null ? void 0 : n.backgroundColor), this._elementRef = T.createContainer(this._contentRef, n), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = T.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
8198
+ function C(e, t, n) {
8199
+ _classCallCheck(this, C);
8200
+ this._isOpen = !1, this._contentRef = C.createModalContent(t, n == null ? void 0 : n.backgroundColor), this._buttonPanel = C.createButtonPanel(n == null ? void 0 : n.backgroundColor), this._elementRef = C.createContainer(this._contentRef, n), this._elementRef.appendChild(this._buttonPanel), e.appendChild(this._elementRef), this._backgroundPanelRef = C.createDarkBackgroundPanel(), e.appendChild(this._backgroundPanelRef), this.addWindowEvents();
8148
8201
  }
8149
- _createClass(T, [{
8202
+ _createClass(C, [{
8150
8203
  key: "isOpen",
8151
8204
  value: function isOpen() {
8152
8205
  return this._isOpen;
@@ -8168,7 +8221,7 @@ var _Modal = /*#__PURE__*/function () {
8168
8221
  var _this40 = this;
8169
8222
  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 () {
8170
8223
  _this40._elementRef.style.display = "none", _this40._backgroundPanelRef.style.display = "none";
8171
- }, T.MODAL_CLOSE_TIMEOUT_MS);
8224
+ }, C.MODAL_CLOSE_TIMEOUT_MS);
8172
8225
  }
8173
8226
  }, {
8174
8227
  key: "displayModalElements",
@@ -8184,7 +8237,7 @@ var _Modal = /*#__PURE__*/function () {
8184
8237
  key: "addCloseButton",
8185
8238
  value: function addCloseButton(e, t, n) {
8186
8239
  var _this41 = this;
8187
- var s = t ? T.createSVGButton(e) : T.createTextButton(e);
8240
+ var s = t ? C.createSVGButton(e) : C.createTextButton(e);
8188
8241
  return this.addButtons(s), s.onclick = function () {
8189
8242
  _this41.close(), setTimeout(function () {
8190
8243
  n == null || n();
@@ -8244,12 +8297,12 @@ var _Modal = /*#__PURE__*/function () {
8244
8297
  value: function createTextModalFunc(e, t, n) {
8245
8298
  var s;
8246
8299
  if (_typeof(t) == "object" && (s = t.files) != null && s.infoModal) {
8247
- var o = new T(e, ["modal-content"], t.files.infoModal.containerStyle);
8248
- return o.addCloseButton("OK", !1, n), o.openTextModal.bind(o, t.infoModalTextMarkUp || "");
8300
+ var _o4 = new C(e, ["modal-content"], t.files.infoModal.containerStyle);
8301
+ return _o4.addCloseButton("OK", !1, n), _o4.openTextModal.bind(_o4, t.infoModalTextMarkUp || "");
8249
8302
  }
8250
8303
  }
8251
8304
  }]);
8252
- return T;
8305
+ return C;
8253
8306
  }();
8254
8307
  _Modal.MODAL_CLOSE_TIMEOUT_MS = 190;
8255
8308
  var Modal = _Modal;
@@ -8510,7 +8563,7 @@ var Translate = /*#__PURE__*/function () {
8510
8563
  key: "translate",
8511
8564
  value: function translate(e, t) {
8512
8565
  var n = text_1$3.Text.breakupIntoWordsArr(e);
8513
- for (var s = 0; s < n.length; s += 1) t[n[s]] && (n[s] = t[n[s]]);
8566
+ for (var _s15 = 0; _s15 < n.length; _s15 += 1) t[n[_s15]] && (n[_s15] = t[n[_s15]]);
8514
8567
  return n.join("");
8515
8568
  }
8516
8569
  }]);
@@ -8530,9 +8583,9 @@ var WebSpeechTranscript = /*#__PURE__*/function () {
8530
8583
  key: "extract",
8531
8584
  value: function extract(e, t, n) {
8532
8585
  var s = "";
8533
- for (var o = e.resultIndex; o < e.results.length; ++o) {
8534
- var a = e.results[o][0].transcript;
8535
- n && (a = translate_1$1.Translate.translate(a, n)), e.results[o].isFinal ? t += a : s += a;
8586
+ for (var _o5 = e.resultIndex; _o5 < e.results.length; ++_o5) {
8587
+ var _a5 = e.results[_o5][0].transcript;
8588
+ n && (_a5 = translate_1$1.Translate.translate(_a5, n)), e.results[_o5].isFinal ? t += _a5 : s += _a5;
8536
8589
  }
8537
8590
  return {
8538
8591
  interimTranscript: s,
@@ -8545,8 +8598,8 @@ var WebSpeechTranscript = /*#__PURE__*/function () {
8545
8598
  value: function extractSafari(e, t, n) {
8546
8599
  var s = "";
8547
8600
  var o = "";
8548
- for (var a = e.resultIndex; a < e.results.length; ++a) {
8549
- var l = e.results[a][0].transcript;
8601
+ for (var _a6 = e.resultIndex; _a6 < e.results.length; ++_a6) {
8602
+ var l = e.results[_a6][0].transcript;
8550
8603
  n && (l = translate_1$1.Translate.translate(l, n)), s += l;
8551
8604
  }
8552
8605
  return {
@@ -8718,8 +8771,8 @@ var Elements = /*#__PURE__*/function () {
8718
8771
  if (e.spansPopulated = !0, e.insertInCursorLocation && document.activeElement === t) {
8719
8772
  var n = window.getSelection();
8720
8773
  if (n != null && n.focusNode) {
8721
- var s = n.getRangeAt(0);
8722
- s.insertNode(e.scrollingSpan), s.insertNode(e.interimSpan), s.insertNode(e.finalSpan), s.collapse(!1), n.removeAllRanges(), n.addRange(s);
8774
+ var _s16 = n.getRangeAt(0);
8775
+ _s16.insertNode(e.scrollingSpan), _s16.insertNode(e.interimSpan), _s16.insertNode(e.finalSpan), _s16.collapse(!1), n.removeAllRanges(), n.addRange(_s16);
8723
8776
  return;
8724
8777
  }
8725
8778
  }
@@ -8753,20 +8806,20 @@ var Cursor = /*#__PURE__*/function () {
8753
8806
  value: function setOffsetForGeneric(e, t) {
8754
8807
  var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
8755
8808
  var s = 0;
8756
- for (var o = 0; o < e.childNodes.length; o += 1) {
8757
- var a = e.childNodes[o];
8758
- if (a.childNodes.length > 0) {
8759
- var l = Cursor.setOffsetForGeneric(a, t, n);
8809
+ for (var _o6 = 0; _o6 < e.childNodes.length; _o6 += 1) {
8810
+ var _a7 = e.childNodes[_o6];
8811
+ if (_a7.childNodes.length > 0) {
8812
+ var l = Cursor.setOffsetForGeneric(_a7, t, n);
8760
8813
  if (l === -1) return -1;
8761
8814
  n += l;
8762
- } else if (a.textContent !== null) {
8763
- if (n + a.textContent.length > t) {
8815
+ } else if (_a7.textContent !== null) {
8816
+ if (n + _a7.textContent.length > t) {
8764
8817
  var _l = document.createRange();
8765
- _l.setStart(a, t - n), _l.collapse(!0);
8818
+ _l.setStart(_a7, t - n), _l.collapse(!0);
8766
8819
  var c = window.getSelection();
8767
8820
  return c == null || c.removeAllRanges(), c == null || c.addRange(_l), e.focus(), -1;
8768
8821
  }
8769
- n += a.textContent.length, s += a.textContent.length;
8822
+ n += _a7.textContent.length, s += _a7.textContent.length;
8770
8823
  }
8771
8824
  }
8772
8825
  return s;
@@ -8784,8 +8837,8 @@ var Cursor = /*#__PURE__*/function () {
8784
8837
  value: function setOffsetForSafariGeneric(e, t) {
8785
8838
  var n = window.getSelection();
8786
8839
  if (n) {
8787
- var s = Cursor.getGenericElementCursorOffset(e, n, !0);
8788
- console.log(s), setTimeout(function () {}, 100), Cursor.setOffsetForGeneric(e, s + t);
8840
+ var _s17 = Cursor.getGenericElementCursorOffset(e, n, !0);
8841
+ console.log(_s17), setTimeout(function () {}, 100), Cursor.setOffsetForGeneric(e, _s17 + t);
8789
8842
  }
8790
8843
  }
8791
8844
  // set to automatically scroll to cursor (scroll does not work in Safari)
@@ -8816,9 +8869,9 @@ var Cursor = /*#__PURE__*/function () {
8816
8869
  value: function getGenericElementCursorOffset(e, t, n) {
8817
8870
  var s = 0;
8818
8871
  if (t.rangeCount > 0) {
8819
- var o = t.getRangeAt(0),
8820
- a = o.cloneRange();
8821
- a.selectNodeContents(e), n ? a.setEnd(o.startContainer, o.startOffset) : a.setEnd(o.endContainer, o.endOffset), s = a.toString().length;
8872
+ var _o7 = t.getRangeAt(0),
8873
+ _a8 = _o7.cloneRange();
8874
+ _a8.selectNodeContents(e), n ? _a8.setEnd(_o7.startContainer, _o7.startOffset) : _a8.setEnd(_o7.endContainer, _o7.endOffset), s = _a8.toString().length;
8822
8875
  }
8823
8876
  return s;
8824
8877
  }
@@ -8881,10 +8934,10 @@ var CommandUtils = /*#__PURE__*/function () {
8881
8934
  key: "checkIfMatchesWord",
8882
8935
  value: function checkIfMatchesWord(e, t, n) {
8883
8936
  var s = e;
8884
- for (var o = n.length - 1; o >= 0; o -= 1) {
8885
- var a = o,
8937
+ for (var _o8 = n.length - 1; _o8 >= 0; _o8 -= 1) {
8938
+ var _a9 = _o8,
8886
8939
  l = s.length - 1;
8887
- for (; n[a] === s[l] && l >= 0;) a -= 1, l -= 1;
8940
+ for (; n[_a9] === s[l] && l >= 0;) _a9 -= 1, l -= 1;
8888
8941
  if (l < 0) return !0;
8889
8942
  }
8890
8943
  return !1;
@@ -8953,9 +9006,9 @@ var Highlight = /*#__PURE__*/function () {
8953
9006
  value: function setStateForGeneric(e, t) {
8954
9007
  var n = window.getSelection();
8955
9008
  if (n != null && n.focusNode) {
8956
- var s = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0),
8957
- o = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !1);
8958
- e.isHighlighted = s !== o;
9009
+ var _s18 = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0),
9010
+ _o9 = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !1);
9011
+ e.isHighlighted = _s18 !== _o9;
8959
9012
  }
8960
9013
  }
8961
9014
  }, {
@@ -8968,8 +9021,8 @@ var Highlight = /*#__PURE__*/function () {
8968
9021
  value: function removeForGeneric(e, t) {
8969
9022
  var n = window.getSelection();
8970
9023
  if (n) {
8971
- var s = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0);
8972
- n.deleteFromDocument(), cursor_1$2.Cursor.setOffsetForGeneric(t, s), e.isHighlighted = !1;
9024
+ var _s19 = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0);
9025
+ n.deleteFromDocument(), cursor_1$2.Cursor.setOffsetForGeneric(t, _s19), e.isHighlighted = !1;
8973
9026
  }
8974
9027
  }
8975
9028
  }, {
@@ -8979,8 +9032,8 @@ var Highlight = /*#__PURE__*/function () {
8979
9032
  s = t.selectionEnd,
8980
9033
  o = t.value;
8981
9034
  if (n && s) {
8982
- var a = o.substring(0, n) + o.substring(s);
8983
- t.value = a, cursor_1$2.Cursor.setOffsetForPrimitive(t, n, e.autoScroll);
9035
+ var _a10 = o.substring(0, n) + o.substring(s);
9036
+ t.value = _a10, cursor_1$2.Cursor.setOffsetForPrimitive(t, n, e.autoScroll);
8984
9037
  }
8985
9038
  e.isHighlighted = !1;
8986
9039
  }
@@ -9004,11 +9057,11 @@ var Padding = /*#__PURE__*/function () {
9004
9057
  key: "setStateForPrimitiveElement",
9005
9058
  value: function setStateForPrimitiveElement(e, t) {
9006
9059
  if (document.activeElement === t && t.selectionStart !== null) {
9007
- var s = t.selectionStart,
9008
- o = t.value[s - 1],
9009
- a = t.selectionEnd === null ? s : t.selectionEnd,
9010
- l = t.value[a];
9011
- text_1$1.Text.isCharDefined(o) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), text_1$1.Text.isCharDefined(l) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === a;
9060
+ var _s20 = t.selectionStart,
9061
+ _o10 = t.value[_s20 - 1],
9062
+ _a11 = t.selectionEnd === null ? _s20 : t.selectionEnd,
9063
+ l = t.value[_a11];
9064
+ text_1$1.Text.isCharDefined(_o10) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), text_1$1.Text.isCharDefined(l) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === _a11;
9012
9065
  return;
9013
9066
  }
9014
9067
  var n = t.value[t.value.length - 1];
@@ -9079,11 +9132,11 @@ var Speech = /*#__PURE__*/function () {
9079
9132
  value: function prepareBeforeStart(e) {
9080
9133
  var t, n;
9081
9134
  if (e != null && e.element) if (eventListeners_1.EventListeners.add(this, e), Array.isArray(e.element)) {
9082
- var o = e.element.find(function (a) {
9135
+ var _o11 = e.element.find(function (a) {
9083
9136
  return a === document.activeElement;
9084
9137
  }) || e.element[0];
9085
- if (!o) return;
9086
- this.prepare(o);
9138
+ if (!_o11) return;
9139
+ this.prepare(_o11);
9087
9140
  } else this.prepare(e.element);
9088
9141
  (e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"], elements_1.Elements.applyCustomColors(this, e.textColor)), (e == null ? void 0 : e.insertInCursorLocation) !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), (e == null ? void 0 : e.autoScroll) !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e == null ? void 0 : e.onResult, this._onPreResult = e == null ? void 0 : e.onPreResult, this._onStart = e == null ? void 0 : e.onStart, this._onStop = e == null ? void 0 : e.onStop, this._onError = e == null ? void 0 : e.onError, this.onCommandModeTrigger = e == null ? void 0 : e.onCommandModeTrigger, this.onPauseTrigger = e == null ? void 0 : e.onPauseTrigger, this._options = e, !((n = this._options) === null || n === void 0) && n.commands && (this.commands = commandUtils_1$1.CommandUtils.process(this._options.commands));
9089
9142
  }
@@ -9126,8 +9179,8 @@ var Speech = /*#__PURE__*/function () {
9126
9179
  this.isHighlighted && highlight_1.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || padding_1.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), n && padding_1.Padding.adjustSateForNoTextPrimitiveElement(this);
9127
9180
  var s = this.startPadding + this.finalTranscript + t;
9128
9181
  if (e.value = s + this.endPadding, !this.isTargetInShadow) {
9129
- var o = s.length + this.numberOfSpacesAfterNewText;
9130
- cursor_1.Cursor.setOffsetForPrimitive(e, o, this.autoScroll);
9182
+ var _o12 = s.length + this.numberOfSpacesAfterNewText;
9183
+ cursor_1.Cursor.setOffsetForPrimitive(e, _o12, this.autoScroll);
9131
9184
  }
9132
9185
  this.autoScroll && browser_1$1.Browser.IS_SAFARI() && this.isCursorAtEnd && autoScroll_1.AutoScroll.scrollSafariPrimitiveToEnd(e);
9133
9186
  }
@@ -9228,8 +9281,8 @@ var WebSpeech = /*#__PURE__*/function (_speech_1$1$Speech) {
9228
9281
  var _this46$_extractText = _this46._extractText(e, _this46.finalTranscript, _this46._translations),
9229
9282
  t = _this46$_extractText.interimTranscript,
9230
9283
  n = _this46$_extractText.finalTranscript,
9231
- s = _this46$_extractText.newText;
9232
- _this46.updateElements(t, n, s);
9284
+ _s21 = _this46$_extractText.newText;
9285
+ _this46.updateElements(t, n, _s21);
9233
9286
  }
9234
9287
  });
9235
9288
  }
@@ -9324,26 +9377,26 @@ var AzureSpeechConfig = /*#__PURE__*/function () {
9324
9377
  }, {
9325
9378
  key: "getNewSpeechConfig",
9326
9379
  value: function () {
9327
- var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(e, t) {
9328
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
9329
- while (1) switch (_context68.prev = _context68.next) {
9380
+ var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(e, t) {
9381
+ return _regeneratorRuntime().wrap(function _callee69$(_context69) {
9382
+ while (1) switch (_context69.prev = _context69.next) {
9330
9383
  case 0:
9331
9384
  if (!t.region) {
9332
- _context68.next = 2;
9385
+ _context69.next = 2;
9333
9386
  break;
9334
9387
  }
9335
- return _context68.abrupt("return", t.subscriptionKey ? e.fromSubscription(t.subscriptionKey.trim(), t.region.trim()) : t.token ? e.fromAuthorizationToken(t.token.trim(), t.region.trim()) : t.retrieveToken ? t.retrieveToken().then(function (n) {
9388
+ return _context69.abrupt("return", t.subscriptionKey ? e.fromSubscription(t.subscriptionKey.trim(), t.region.trim()) : t.token ? e.fromAuthorizationToken(t.token.trim(), t.region.trim()) : t.retrieveToken ? t.retrieveToken().then(function (n) {
9336
9389
  return t.region ? e.fromAuthorizationToken((n == null ? void 0 : n.trim()) || "", t.region.trim()) : null;
9337
9390
  })["catch"](function (n) {
9338
9391
  return console.error(n), null;
9339
9392
  }) : null);
9340
9393
  case 2:
9341
9394
  case "end":
9342
- return _context68.stop();
9395
+ return _context69.stop();
9343
9396
  }
9344
- }, _callee68);
9397
+ }, _callee69);
9345
9398
  }));
9346
- function getNewSpeechConfig(_x116, _x117) {
9399
+ function getNewSpeechConfig(_x120, _x121) {
9347
9400
  return _getNewSpeechConfig.apply(this, arguments);
9348
9401
  }
9349
9402
  return getNewSpeechConfig;
@@ -9356,23 +9409,23 @@ var AzureSpeechConfig = /*#__PURE__*/function () {
9356
9409
  }, {
9357
9410
  key: "get",
9358
9411
  value: function () {
9359
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(e, t) {
9412
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e, t) {
9360
9413
  var n;
9361
- return _regeneratorRuntime().wrap(function _callee69$(_context69) {
9362
- while (1) switch (_context69.prev = _context69.next) {
9414
+ return _regeneratorRuntime().wrap(function _callee70$(_context70) {
9415
+ while (1) switch (_context70.prev = _context70.next) {
9363
9416
  case 0:
9364
- _context69.next = 2;
9417
+ _context70.next = 2;
9365
9418
  return AzureSpeechConfig.getNewSpeechConfig(e, t);
9366
9419
  case 2:
9367
- n = _context69.sent;
9368
- return _context69.abrupt("return", (n && AzureSpeechConfig.process(n, t), n));
9420
+ n = _context70.sent;
9421
+ return _context70.abrupt("return", (n && AzureSpeechConfig.process(n, t), n));
9369
9422
  case 4:
9370
9423
  case "end":
9371
- return _context69.stop();
9424
+ return _context70.stop();
9372
9425
  }
9373
- }, _callee69);
9426
+ }, _callee70);
9374
9427
  }));
9375
- function get(_x118, _x119) {
9428
+ function get(_x122, _x123) {
9376
9429
  return _get.apply(this, arguments);
9377
9430
  }
9378
9431
  return get;
@@ -9462,28 +9515,28 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
9462
9515
  }, {
9463
9516
  key: "startAsync",
9464
9517
  value: function () {
9465
- var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e) {
9518
+ var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e) {
9466
9519
  var t;
9467
- return _regeneratorRuntime().wrap(function _callee70$(_context70) {
9468
- while (1) switch (_context70.prev = _context70.next) {
9520
+ return _regeneratorRuntime().wrap(function _callee71$(_context71) {
9521
+ while (1) switch (_context71.prev = _context71.next) {
9469
9522
  case 0:
9470
- _context70.t0 = this.validate(e);
9471
- if (!_context70.t0) {
9472
- _context70.next = 6;
9523
+ _context71.t0 = this.validate(e);
9524
+ if (!_context71.t0) {
9525
+ _context71.next = 6;
9473
9526
  break;
9474
9527
  }
9475
- _context70.next = 4;
9528
+ _context71.next = 4;
9476
9529
  return this.instantiateService(e);
9477
9530
  case 4:
9478
9531
  this._translations = e == null ? void 0 : e.translations;
9479
9532
  (t = this._service) === null || t === void 0 || t.startContinuousRecognitionAsync(function () {}, this.error);
9480
9533
  case 6:
9481
9534
  case "end":
9482
- return _context70.stop();
9535
+ return _context71.stop();
9483
9536
  }
9484
- }, _callee70, this);
9537
+ }, _callee71, this);
9485
9538
  }));
9486
- function startAsync(_x120) {
9539
+ function startAsync(_x124) {
9487
9540
  return _startAsync.apply(this, arguments);
9488
9541
  }
9489
9542
  return startAsync;
@@ -9496,28 +9549,28 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
9496
9549
  }, {
9497
9550
  key: "instantiateService",
9498
9551
  value: function () {
9499
- var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e) {
9500
- var t, n, s, o;
9501
- return _regeneratorRuntime().wrap(function _callee71$(_context71) {
9502
- while (1) switch (_context71.prev = _context71.next) {
9552
+ var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e) {
9553
+ var t, n, s, _o13;
9554
+ return _regeneratorRuntime().wrap(function _callee72$(_context72) {
9555
+ while (1) switch (_context72.prev = _context72.next) {
9503
9556
  case 0:
9504
9557
  t = Azure.getAPI();
9505
9558
  n = t.AudioConfig.fromDefaultMicrophoneInput();
9506
- _context71.next = 4;
9559
+ _context72.next = 4;
9507
9560
  return azureSpeechConfig_1.AzureSpeechConfig.get(t.SpeechConfig, e);
9508
9561
  case 4:
9509
- s = _context71.sent;
9562
+ s = _context72.sent;
9510
9563
  if (s) {
9511
- o = new t.SpeechRecognizer(s, n);
9512
- this.setEvents(o), this._service = o, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
9564
+ _o13 = new t.SpeechRecognizer(s, n);
9565
+ this.setEvents(_o13), this._service = _o13, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
9513
9566
  } else this.error("Unable to contact Azure server");
9514
9567
  case 6:
9515
9568
  case "end":
9516
- return _context71.stop();
9569
+ return _context72.stop();
9517
9570
  }
9518
- }, _callee71, this);
9571
+ }, _callee72, this);
9519
9572
  }));
9520
- function instantiateService(_x121) {
9573
+ function instantiateService(_x125) {
9521
9574
  return _instantiateService.apply(this, arguments);
9522
9575
  }
9523
9576
  return instantiateService;
@@ -9554,10 +9607,10 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
9554
9607
  case window.SpeechSDK.ResultReason.RecognizedSpeech:
9555
9608
  if (n.text && !this._stopping) {
9556
9609
  var _azureTranscript_1$Az2 = azureTranscript_1.AzureTranscript.extract(this._newTextPadding + n.text, this.finalTranscript, !0, this._translations),
9557
- s = _azureTranscript_1$Az2.interimTranscript,
9558
- o = _azureTranscript_1$Az2.finalTranscript,
9559
- a = _azureTranscript_1$Az2.newText;
9560
- stopTimeout_1.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(s, o, a), o !== "" && (this._newTextPadding = " ");
9610
+ _s22 = _azureTranscript_1$Az2.interimTranscript,
9611
+ _o14 = _azureTranscript_1$Az2.finalTranscript,
9612
+ _a12 = _azureTranscript_1$Az2.newText;
9613
+ stopTimeout_1.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(_s22, _o14, _a12), _o14 !== "" && (this._newTextPadding = " ");
9561
9614
  }
9562
9615
  break;
9563
9616
  }
@@ -9839,7 +9892,9 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
9839
9892
  var _this54;
9840
9893
  _classCallCheck(this, SubmitButton);
9841
9894
  var a;
9842
- _this54 = _super42.call(this, SubmitButton.createButtonContainerElement(), (a = e.submitButtonStyles) == null ? void 0 : a.position, e.submitButtonStyles), _this54._isRequestInProgress = !1, _this54._isLoadingActive = !1, _this54._isSVGLoadingIconOverriden = !1, _this54._messages = n, _this54._inputElementRef = t, _this54._fileAttachments = o, _this54._innerElements = _this54.createInnerElements(), _this54._abortStream = new AbortController(), _this54._serviceIO = s, _this54.attemptOverwriteLoadingStyle(e), _this54.changeToSubmitIcon(), _this54.assignHandlers();
9895
+ _this54 = _super42.call(this, SubmitButton.createButtonContainerElement(), (a = e.submitButtonStyles) == null ? void 0 : a.position, e.submitButtonStyles), _this54._isRequestInProgress = !1, _this54._isLoadingActive = !1, _this54._isSVGLoadingIconOverriden = !1, _this54._messages = n, _this54._inputElementRef = t, _this54._fileAttachments = o, _this54._innerElements = _this54.createInnerElements(), _this54._abortStream = new AbortController(), _this54._stopClicked = {
9896
+ listener: function listener() {}
9897
+ }, _this54._serviceIO = s, _this54.attemptOverwriteLoadingStyle(e), _this54.changeToSubmitIcon(), _this54.assignHandlers();
9843
9898
  return _this54;
9844
9899
  }
9845
9900
  // prettier-ignore
@@ -9875,7 +9930,8 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
9875
9930
  }, this._serviceIO.streamHandlers = {
9876
9931
  onOpen: this.changeToStopIcon.bind(this),
9877
9932
  onClose: this.changeToSubmitIcon.bind(this),
9878
- abortStream: this._abortStream
9933
+ abortStream: this._abortStream,
9934
+ stopClicked: this._stopClicked
9879
9935
  };
9880
9936
  var e = this._serviceIO.deepChat.stream;
9881
9937
  _typeof(e) == "object" && typeof e.simulation == "number" && (this._serviceIO.streamHandlers.simulationInterim = e.simulation);
@@ -9896,17 +9952,17 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
9896
9952
  }, {
9897
9953
  key: "submit",
9898
9954
  value: function () {
9899
- var _submit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e, t) {
9955
+ var _submit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e, t) {
9900
9956
  var c, u, n, s, o, a, l;
9901
- return _regeneratorRuntime().wrap(function _callee72$(_context72) {
9902
- while (1) switch (_context72.prev = _context72.next) {
9957
+ return _regeneratorRuntime().wrap(function _callee73$(_context73) {
9958
+ while (1) switch (_context73.prev = _context73.next) {
9903
9959
  case 0:
9904
- _context72.t0 = e;
9905
- if (_context72.t0) {
9906
- _context72.next = 6;
9960
+ _context73.t0 = e;
9961
+ if (_context73.t0) {
9962
+ _context73.next = 6;
9907
9963
  break;
9908
9964
  }
9909
- _context72.next = 4;
9965
+ _context73.next = 4;
9910
9966
  return this._fileAttachments.completePlaceholders();
9911
9967
  case 4:
9912
9968
  n = this._fileAttachments.getAllFileData();
@@ -9916,47 +9972,47 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
9916
9972
  case 6:
9917
9973
  o = t === "" ? void 0 : t;
9918
9974
  if (!this._isRequestInProgress) {
9919
- _context72.next = 9;
9975
+ _context73.next = 9;
9920
9976
  break;
9921
9977
  }
9922
- return _context72.abrupt("return");
9978
+ return _context73.abrupt("return");
9923
9979
  case 9:
9924
9980
  a = this._serviceIO.websocket;
9925
9981
  if (!(a && (a === "pending" || a.readyState === void 0 || a.readyState !== a.OPEN))) {
9926
- _context72.next = 12;
9982
+ _context73.next = 12;
9927
9983
  break;
9928
9984
  }
9929
- return _context72.abrupt("return");
9985
+ return _context73.abrupt("return");
9930
9986
  case 12:
9931
9987
  if (!((c = this._serviceIO.deepChat) != null && c.validateMessageBeforeSending)) {
9932
- _context72.next = 17;
9988
+ _context73.next = 17;
9933
9989
  break;
9934
9990
  }
9935
9991
  if (this._serviceIO.deepChat.validateMessageBeforeSending(o, s)) {
9936
- _context72.next = 15;
9992
+ _context73.next = 15;
9937
9993
  break;
9938
9994
  }
9939
- return _context72.abrupt("return");
9995
+ return _context73.abrupt("return");
9940
9996
  case 15:
9941
- _context72.next = 19;
9997
+ _context73.next = 19;
9942
9998
  break;
9943
9999
  case 17:
9944
10000
  if (this._serviceIO.canSendMessage(o, s)) {
9945
- _context72.next = 19;
10001
+ _context73.next = 19;
9946
10002
  break;
9947
10003
  }
9948
- return _context72.abrupt("return");
10004
+ return _context73.abrupt("return");
9949
10005
  case 19:
9950
10006
  this.changeToLoadingIcon();
9951
10007
  t !== "" && this._messages.addNewMessage({
9952
10008
  text: t
9953
10009
  }, !1, !0);
9954
- _context72.t1 = n;
9955
- if (!_context72.t1) {
9956
- _context72.next = 25;
10010
+ _context73.t1 = n;
10011
+ if (!_context73.t1) {
10012
+ _context73.next = 25;
9957
10013
  break;
9958
10014
  }
9959
- _context72.next = 25;
10015
+ _context73.next = 25;
9960
10016
  return this._messages.addMultipleFiles(n);
9961
10017
  case 25:
9962
10018
  this._messages.addLoadingMessage();
@@ -9965,25 +10021,25 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
9965
10021
  text: o,
9966
10022
  files: s
9967
10023
  };
9968
- _context72.next = 30;
10024
+ _context73.next = 30;
9969
10025
  return this._serviceIO.callAPI(l, this._messages);
9970
10026
  case 30:
9971
10027
  e || (u = this._fileAttachments) == null || u.removeAllFiles();
9972
10028
  case 31:
9973
10029
  case "end":
9974
- return _context72.stop();
10030
+ return _context73.stop();
9975
10031
  }
9976
- }, _callee72, this);
10032
+ }, _callee73, this);
9977
10033
  }));
9978
- function submit(_x122, _x123) {
10034
+ function submit(_x126, _x127) {
9979
10035
  return _submit.apply(this, arguments);
9980
10036
  }
9981
10037
  return submit;
9982
- }() // This will not stop the stream on the server side
10038
+ }()
9983
10039
  }, {
9984
10040
  key: "stopStream",
9985
10041
  value: function stopStream() {
9986
- this._abortStream.abort(), this.changeToSubmitIcon();
10042
+ this._abortStream.abort(), this._stopClicked.listener(), this.changeToSubmitIcon();
9987
10043
  }
9988
10044
  }, {
9989
10045
  key: "changeToStopIcon",
@@ -10109,13 +10165,13 @@ var CameraModal = /*#__PURE__*/function (_Modal2) {
10109
10165
  t = new Array(e.length);
10110
10166
  for (var l = 0; l < e.length; l++) t[l] = e.charCodeAt(l);
10111
10167
  var n = new Uint8Array(t),
10112
- s = new Blob([n], {
10168
+ _s23 = new Blob([n], {
10113
10169
  type: this._format
10114
10170
  }),
10115
- o = this._format === "image/jpeg" ? "jpeg" : "png",
10116
- a = NewFileName.getFileName(this._newFilePrefix || "photo", o);
10117
- return new File([s], a, {
10118
- type: s.type
10171
+ _o15 = this._format === "image/jpeg" ? "jpeg" : "png",
10172
+ _a13 = NewFileName.getFileName(this._newFilePrefix || "photo", _o15);
10173
+ return new File([_s23], _a13, {
10174
+ type: _s23.type
10119
10175
  });
10120
10176
  }
10121
10177
  }