deep-chat-dev 9.0.157 → 9.0.158

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
@@ -3383,29 +3383,29 @@ function io(_x10, _x11) {
3383
3383
  return _io.apply(this, arguments);
3384
3384
  }
3385
3385
  function _io() {
3386
- _io = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee118(s, e) {
3386
+ _io = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee117(s, e) {
3387
3387
  var t, i;
3388
- return _regeneratorRuntime().wrap(function _callee118$(_context118) {
3389
- while (1) switch (_context118.prev = _context118.next) {
3388
+ return _regeneratorRuntime().wrap(function _callee117$(_context117) {
3389
+ while (1) switch (_context117.prev = _context117.next) {
3390
3390
  case 0:
3391
3391
  t = s.getReader();
3392
3392
  case 1:
3393
- _context118.next = 3;
3393
+ _context117.next = 3;
3394
3394
  return t.read();
3395
3395
  case 3:
3396
- if ((i = _context118.sent).done) {
3397
- _context118.next = 7;
3396
+ if ((i = _context117.sent).done) {
3397
+ _context117.next = 7;
3398
3398
  break;
3399
3399
  }
3400
3400
  e(i.value);
3401
3401
  case 5:
3402
- _context118.next = 1;
3402
+ _context117.next = 1;
3403
3403
  break;
3404
3404
  case 7:
3405
3405
  case "end":
3406
- return _context118.stop();
3406
+ return _context117.stop();
3407
3407
  }
3408
- }, _callee118);
3408
+ }, _callee117);
3409
3409
  }));
3410
3410
  return _io.apply(this, arguments);
3411
3411
  }
@@ -8595,9 +8595,6 @@ var F = /*#__PURE__*/function (_U10) {
8595
8595
  o,
8596
8596
  a,
8597
8597
  i,
8598
- n,
8599
- l,
8600
- c,
8601
8598
  r,
8602
8599
  _args86 = arguments;
8603
8600
  return _regeneratorRuntime().wrap(function _callee86$(_context86) {
@@ -8619,38 +8616,7 @@ var F = /*#__PURE__*/function (_U10) {
8619
8616
  case 9:
8620
8617
  i = _context86.sent;
8621
8618
  case 10:
8622
- n = [];
8623
- if (!t) {
8624
- _context86.next = 15;
8625
- break;
8626
- }
8627
- n = i.data;
8628
- _context86.next = 27;
8629
- break;
8630
- case 15:
8631
- console.log(i.data);
8632
- l = 0;
8633
- case 17:
8634
- if (!(l < i.data.length)) {
8635
- _context86.next = 27;
8636
- break;
8637
- }
8638
- c = i.data[l];
8639
- if (!(c.role === "assistant")) {
8640
- _context86.next = 23;
8641
- break;
8642
- }
8643
- n.push(c);
8644
- _context86.next = 24;
8645
- break;
8646
- case 23:
8647
- return _context86.abrupt("break", 27);
8648
- case 24:
8649
- l += 1;
8650
- _context86.next = 17;
8651
- break;
8652
- case 27:
8653
- r = n.map( /*#__PURE__*/function () {
8619
+ r = (t ? i.data : [i.data[0]]).map( /*#__PURE__*/function () {
8654
8620
  var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85(l) {
8655
8621
  var c;
8656
8622
  return _regeneratorRuntime().wrap(function _callee85$(_context85) {
@@ -8674,7 +8640,7 @@ var F = /*#__PURE__*/function (_U10) {
8674
8640
  };
8675
8641
  }());
8676
8642
  return _context86.abrupt("return", Promise.all(r));
8677
- case 29:
8643
+ case 12:
8678
8644
  case "end":
8679
8645
  return _context86.stop();
8680
8646
  }
@@ -8689,8 +8655,7 @@ var F = /*#__PURE__*/function (_U10) {
8689
8655
  key: "extractPollResultData",
8690
8656
  value: function () {
8691
8657
  var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee87(e) {
8692
- var _this39 = this;
8693
- var r, t, i, o, _o$pop, a, l, n;
8658
+ var r, t, i, o, _o$, a, l, n;
8694
8659
  return _regeneratorRuntime().wrap(function _callee87$(_context87) {
8695
8660
  while (1) switch (_context87.prev = _context87.next) {
8696
8661
  case 0:
@@ -8704,37 +8669,34 @@ var F = /*#__PURE__*/function (_U10) {
8704
8669
  });
8705
8670
  case 3:
8706
8671
  if (!(t === "completed" && this.messages)) {
8707
- _context87.next = 10;
8672
+ _context87.next = 11;
8708
8673
  break;
8709
8674
  }
8710
8675
  _context87.next = 6;
8711
8676
  return this.getThreadMessages(e.thread_id);
8712
8677
  case 6:
8713
8678
  o = _context87.sent;
8714
- console.log(o);
8715
- _o$pop = o.pop(), a = _o$pop.text, l = _o$pop.files;
8716
- return _context87.abrupt("return", (setTimeout(function () {
8717
- o.forEach(function (c) {
8718
- return _this39.deepChat.addMessage(c);
8719
- });
8720
- }), {
8679
+ _o$ = o[0];
8680
+ a = _o$.text;
8681
+ l = _o$.files;
8682
+ return _context87.abrupt("return", {
8721
8683
  text: a,
8722
8684
  _sessionId: this.sessionId,
8723
8685
  files: l
8724
- }));
8725
- case 10:
8686
+ });
8687
+ case 11:
8726
8688
  n = (r = i == null ? void 0 : i.submit_tool_outputs) == null ? void 0 : r.tool_calls;
8727
8689
  if (!(t === "requires_action" && n)) {
8728
- _context87.next = 15;
8690
+ _context87.next = 16;
8729
8691
  break;
8730
8692
  }
8731
- _context87.next = 14;
8693
+ _context87.next = 15;
8732
8694
  return this.handleTools(n);
8733
- case 14:
8734
- return _context87.abrupt("return", _context87.sent);
8735
8695
  case 15:
8736
- throw Error("Thread run status: ".concat(t));
8696
+ return _context87.abrupt("return", _context87.sent);
8737
8697
  case 16:
8698
+ throw Error("Thread run status: ".concat(t));
8699
+ case 17:
8738
8700
  case "end":
8739
8701
  return _context87.stop();
8740
8702
  }
@@ -8861,47 +8823,34 @@ var F = /*#__PURE__*/function (_U10) {
8861
8823
  }()
8862
8824
  }, {
8863
8825
  key: "parseStreamResult",
8864
- value: function () {
8865
- var _parseStreamResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee90(e) {
8866
- var t;
8867
- return _regeneratorRuntime().wrap(function _callee90$(_context90) {
8868
- while (1) switch (_context90.prev = _context90.next) {
8869
- case 0:
8870
- return _context90.abrupt("return", (console.log(e), (t = e.delta) != null && t.content ? {
8871
- text: e.delta.content[0].text.value
8872
- } : (!this.sessionId && e.thread_id && (this.sessionId = e.thread_id), e.file_ids, {
8873
- makingAnotherRequest: !0
8874
- })));
8875
- case 1:
8876
- case "end":
8877
- return _context90.stop();
8878
- }
8879
- }, _callee90, this);
8880
- }));
8881
- function parseStreamResult(_x160) {
8882
- return _parseStreamResult.apply(this, arguments);
8883
- }
8884
- return parseStreamResult;
8885
- }() // https://platform.openai.com/docs/api-reference/assistants-streaming
8826
+ value: function parseStreamResult(e) {
8827
+ var t;
8828
+ return (t = e.delta) != null && t.content ? {
8829
+ text: e.delta.content[0].text.value
8830
+ } : (!this.sessionId && e.thread_id && (this.sessionId = e.thread_id), {
8831
+ makingAnotherRequest: !0
8832
+ });
8833
+ }
8834
+ // https://platform.openai.com/docs/api-reference/assistants-streaming
8886
8835
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
8887
8836
  }, {
8888
8837
  key: "createStreamRun",
8889
8838
  value: function () {
8890
- var _createStreamRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91(e) {
8891
- return _regeneratorRuntime().wrap(function _callee91$(_context91) {
8892
- while (1) switch (_context91.prev = _context91.next) {
8839
+ var _createStreamRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee90(e) {
8840
+ return _regeneratorRuntime().wrap(function _callee90$(_context90) {
8841
+ while (1) switch (_context90.prev = _context90.next) {
8893
8842
  case 0:
8894
8843
  e.stream = !0;
8895
8844
  this.waitingForStreamResponse = !0;
8896
- _context91.next = 4;
8845
+ _context90.next = 4;
8897
8846
  return C.request(this, e, this.messages, !0, !0);
8898
8847
  case 4:
8899
8848
  case "end":
8900
- return _context91.stop();
8849
+ return _context90.stop();
8901
8850
  }
8902
- }, _callee91, this);
8851
+ }, _callee90, this);
8903
8852
  }));
8904
- function createStreamRun(_x161) {
8853
+ function createStreamRun(_x160) {
8905
8854
  return _createStreamRun.apply(this, arguments);
8906
8855
  }
8907
8856
  return createStreamRun;
@@ -8912,7 +8861,7 @@ F.THREAD_PREFIX = "https://api.openai.com/v1/threads", F.NEW_ASSISTANT_URL = "ht
8912
8861
  var nn = F;
8913
8862
  var ae = /*#__PURE__*/function (_U11) {
8914
8863
  function ae(e) {
8915
- var _this40;
8864
+ var _this39;
8916
8865
  _classCallCheck(this, ae);
8917
8866
  var o;
8918
8867
  var t = e.directConnection,
@@ -8925,19 +8874,19 @@ var ae = /*#__PURE__*/function (_U11) {
8925
8874
  }
8926
8875
  }
8927
8876
  };
8928
- _this40 = _callSuper(this, ae, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i, n]), _this40.insertKeyPlaceholderText = "OpenAI API Key", _this40.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this40.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this40.url = "", _this40.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
8877
+ _this39 = _callSuper(this, ae, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i, n]), _this39.insertKeyPlaceholderText = "OpenAI API Key", _this39.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this39.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this39.url = "", _this39.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
8929
8878
  var r = (o = t == null ? void 0 : t.openAI) == null ? void 0 : o.images;
8930
- if (_this40.camera) {
8879
+ if (_this39.camera) {
8931
8880
  var a = _typeof(r) == "object" && r.size ? Number.parseInt(r.size) : 1024;
8932
- _this40.camera.files = {
8881
+ _this39.camera.files = {
8933
8882
  dimensions: {
8934
8883
  width: a,
8935
8884
  height: a
8936
8885
  }
8937
8886
  };
8938
8887
  }
8939
- _typeof(r) == "object" && Object.assign(_this40.rawBody, r), _this40.canSendMessage = ae.canFileSendMessage;
8940
- return _this40;
8888
+ _typeof(r) == "object" && Object.assign(_this39.rawBody, r), _this39.canSendMessage = ae.canFileSendMessage;
8889
+ return _this39;
8941
8890
  }
8942
8891
  _inherits(ae, _U11);
8943
8892
  return _createClass(ae, [{
@@ -8963,27 +8912,27 @@ var ae = /*#__PURE__*/function (_U11) {
8963
8912
  }, {
8964
8913
  key: "callServiceAPI",
8965
8914
  value: function () {
8966
- var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee92(e, t, i) {
8915
+ var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91(e, t, i) {
8967
8916
  var n, r;
8968
- return _regeneratorRuntime().wrap(function _callee92$(_context92) {
8969
- while (1) switch (_context92.prev = _context92.next) {
8917
+ return _regeneratorRuntime().wrap(function _callee91$(_context91) {
8918
+ while (1) switch (_context91.prev = _context91.next) {
8970
8919
  case 0:
8971
8920
  if ((n = this.connectSettings) != null && n.headers) {
8972
- _context92.next = 2;
8921
+ _context91.next = 2;
8973
8922
  break;
8974
8923
  }
8975
8924
  throw new Error("Request settings have not been set up");
8976
8925
  case 2:
8977
8926
  if (!(i != null && i[0])) {
8978
- _context92.next = 6;
8927
+ _context91.next = 6;
8979
8928
  break;
8980
8929
  }
8981
8930
  this.callApiWithImage(e, t, i);
8982
- _context92.next = 11;
8931
+ _context91.next = 11;
8983
8932
  break;
8984
8933
  case 6:
8985
8934
  if (this.connectSettings) {
8986
- _context92.next = 8;
8935
+ _context91.next = 8;
8987
8936
  break;
8988
8937
  }
8989
8938
  throw new Error("Request settings have not been set up");
@@ -8993,11 +8942,11 @@ var ae = /*#__PURE__*/function (_U11) {
8993
8942
  T.request(this, r, e);
8994
8943
  case 11:
8995
8944
  case "end":
8996
- return _context92.stop();
8945
+ return _context91.stop();
8997
8946
  }
8998
- }, _callee92, this);
8947
+ }, _callee91, this);
8999
8948
  }));
9000
- function callServiceAPI(_x162, _x163, _x164) {
8949
+ function callServiceAPI(_x161, _x162, _x163) {
9001
8950
  return _callServiceAPI19.apply(this, arguments);
9002
8951
  }
9003
8952
  return callServiceAPI;
@@ -9005,17 +8954,17 @@ var ae = /*#__PURE__*/function (_U11) {
9005
8954
  }, {
9006
8955
  key: "extractResultData",
9007
8956
  value: function () {
9008
- var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee93(e) {
9009
- return _regeneratorRuntime().wrap(function _callee93$(_context93) {
9010
- while (1) switch (_context93.prev = _context93.next) {
8957
+ var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee92(e) {
8958
+ return _regeneratorRuntime().wrap(function _callee92$(_context92) {
8959
+ while (1) switch (_context92.prev = _context92.next) {
9011
8960
  case 0:
9012
8961
  if (!e.error) {
9013
- _context93.next = 2;
8962
+ _context92.next = 2;
9014
8963
  break;
9015
8964
  }
9016
8965
  throw e.error.message;
9017
8966
  case 2:
9018
- return _context93.abrupt("return", {
8967
+ return _context92.abrupt("return", {
9019
8968
  files: e.data.map(function (i) {
9020
8969
  return i.url ? {
9021
8970
  src: i.url,
@@ -9028,11 +8977,11 @@ var ae = /*#__PURE__*/function (_U11) {
9028
8977
  });
9029
8978
  case 3:
9030
8979
  case "end":
9031
- return _context93.stop();
8980
+ return _context92.stop();
9032
8981
  }
9033
- }, _callee93);
8982
+ }, _callee92);
9034
8983
  }));
9035
- function extractResultData(_x165) {
8984
+ function extractResultData(_x164) {
9036
8985
  return _extractResultData22.apply(this, arguments);
9037
8986
  }
9038
8987
  return extractResultData;
@@ -9064,22 +9013,22 @@ ae.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", ae.IMA
9064
9013
  var sn = ae;
9065
9014
  var yt = /*#__PURE__*/function (_U12) {
9066
9015
  function yt(e) {
9067
- var _this41$maxMessages, _l$model;
9068
- var _this41;
9016
+ var _this40$maxMessages, _l$model;
9017
+ var _this40;
9069
9018
  _classCallCheck(this, yt);
9070
9019
  var r, o, a, l;
9071
9020
  var t = JSON.parse(JSON.stringify(e.directConnection)),
9072
9021
  i = t.openAI;
9073
- _this41 = _callSuper(this, yt, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i]), _this41.insertKeyPlaceholderText = "OpenAI API Key", _this41.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this41.url = "https://api.openai.com/v1/chat/completions", _this41.permittedErrorPrefixes = ["Incorrect"], _this41.asyncCallInProgress = !1, _this41._systemMessage = yt.generateSystemMessage("You are a helpful assistant.");
9022
+ _this40 = _callSuper(this, yt, [e, P.buildKeyVerificationDetails(), P.buildHeaders, i]), _this40.insertKeyPlaceholderText = "OpenAI API Key", _this40.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this40.url = "https://api.openai.com/v1/chat/completions", _this40.permittedErrorPrefixes = ["Incorrect"], _this40.asyncCallInProgress = !1, _this40._systemMessage = yt.generateSystemMessage("You are a helpful assistant.");
9074
9023
  var n = (r = t.openAI) == null ? void 0 : r.chat;
9075
9024
  if (_typeof(n) == "object") {
9076
- n.system_prompt && (_this41._systemMessage = yt.generateSystemMessage(n.system_prompt));
9025
+ n.system_prompt && (_this40._systemMessage = yt.generateSystemMessage(n.system_prompt));
9077
9026
  var _ref13 = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.chat,
9078
9027
  c = _ref13.function_handler;
9079
- c && (_this41._functionHandler = c), _this41.cleanConfig(n), Object.assign(_this41.rawBody, n);
9028
+ c && (_this40._functionHandler = c), _this40.cleanConfig(n), Object.assign(_this40.rawBody, n);
9080
9029
  }
9081
- (_this41$maxMessages = _this41.maxMessages) !== null && _this41$maxMessages !== void 0 ? _this41$maxMessages : _this41.maxMessages = -1, (_l$model = (l = _this41.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-3.5-turbo";
9082
- return _this41;
9030
+ (_this40$maxMessages = _this40.maxMessages) !== null && _this40$maxMessages !== void 0 ? _this40$maxMessages : _this40.maxMessages = -1, (_l$model = (l = _this40.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-3.5-turbo";
9031
+ return _this40;
9083
9032
  }
9084
9033
  _inherits(yt, _U12);
9085
9034
  return _createClass(yt, [{
@@ -9107,13 +9056,13 @@ var yt = /*#__PURE__*/function (_U12) {
9107
9056
  }, {
9108
9057
  key: "callServiceAPI",
9109
9058
  value: function () {
9110
- var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee94(e, t) {
9059
+ var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee93(e, t) {
9111
9060
  var i, n;
9112
- return _regeneratorRuntime().wrap(function _callee94$(_context94) {
9113
- while (1) switch (_context94.prev = _context94.next) {
9061
+ return _regeneratorRuntime().wrap(function _callee93$(_context93) {
9062
+ while (1) switch (_context93.prev = _context93.next) {
9114
9063
  case 0:
9115
9064
  if (this.connectSettings) {
9116
- _context94.next = 2;
9065
+ _context93.next = 2;
9117
9066
  break;
9118
9067
  }
9119
9068
  throw new Error("Request settings have not been set up");
@@ -9122,11 +9071,11 @@ var yt = /*#__PURE__*/function (_U12) {
9122
9071
  n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, C.request(this, i, e)) : T.request(this, i, e);
9123
9072
  case 4:
9124
9073
  case "end":
9125
- return _context94.stop();
9074
+ return _context93.stop();
9126
9075
  }
9127
- }, _callee94, this);
9076
+ }, _callee93, this);
9128
9077
  }));
9129
- function callServiceAPI(_x166, _x167) {
9078
+ function callServiceAPI(_x165, _x166) {
9130
9079
  return _callServiceAPI20.apply(this, arguments);
9131
9080
  }
9132
9081
  return callServiceAPI;
@@ -9134,29 +9083,29 @@ var yt = /*#__PURE__*/function (_U12) {
9134
9083
  }, {
9135
9084
  key: "extractResultData",
9136
9085
  value: function () {
9137
- var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee95(e, t, i) {
9086
+ var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee94(e, t, i) {
9138
9087
  var n, r, o, a;
9139
- return _regeneratorRuntime().wrap(function _callee95$(_context95) {
9140
- while (1) switch (_context95.prev = _context95.next) {
9088
+ return _regeneratorRuntime().wrap(function _callee94$(_context94) {
9089
+ while (1) switch (_context94.prev = _context94.next) {
9141
9090
  case 0:
9142
9091
  if (!e.error) {
9143
- _context95.next = 2;
9092
+ _context94.next = 2;
9144
9093
  break;
9145
9094
  }
9146
9095
  throw e.error.message;
9147
9096
  case 2:
9148
- return _context95.abrupt("return", (r = (n = e.choices) == null ? void 0 : n[0]) != null && r.delta ? this.extractStreamResult(e.choices[0], t, i) : (a = (o = e.choices) == null ? void 0 : o[0]) != null && a.message ? e.choices[0].message.tool_calls ? this.handleTools(e.choices[0].message, t, i) : {
9097
+ return _context94.abrupt("return", (r = (n = e.choices) == null ? void 0 : n[0]) != null && r.delta ? this.extractStreamResult(e.choices[0], t, i) : (a = (o = e.choices) == null ? void 0 : o[0]) != null && a.message ? e.choices[0].message.tool_calls ? this.handleTools(e.choices[0].message, t, i) : {
9149
9098
  text: e.choices[0].message.content
9150
9099
  } : {
9151
9100
  text: ""
9152
9101
  });
9153
9102
  case 3:
9154
9103
  case "end":
9155
- return _context95.stop();
9104
+ return _context94.stop();
9156
9105
  }
9157
- }, _callee95, this);
9106
+ }, _callee94, this);
9158
9107
  }));
9159
- function extractResultData(_x168, _x169, _x170) {
9108
+ function extractResultData(_x167, _x168, _x169) {
9160
9109
  return _extractResultData23.apply(this, arguments);
9161
9110
  }
9162
9111
  return extractResultData;
@@ -9164,37 +9113,37 @@ var yt = /*#__PURE__*/function (_U12) {
9164
9113
  }, {
9165
9114
  key: "extractStreamResult",
9166
9115
  value: function () {
9167
- var _extractStreamResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e, t, i) {
9168
- var _this42 = this;
9116
+ var _extractStreamResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee95(e, t, i) {
9117
+ var _this41 = this;
9169
9118
  var n, r, o;
9170
- return _regeneratorRuntime().wrap(function _callee96$(_context96) {
9171
- while (1) switch (_context96.prev = _context96.next) {
9119
+ return _regeneratorRuntime().wrap(function _callee95$(_context95) {
9120
+ while (1) switch (_context95.prev = _context95.next) {
9172
9121
  case 0:
9173
9122
  n = e.delta, r = e.finish_reason;
9174
9123
  if (!(r === "tool_calls")) {
9175
- _context96.next = 7;
9124
+ _context95.next = 7;
9176
9125
  break;
9177
9126
  }
9178
9127
  this.asyncCallInProgress = !0;
9179
9128
  o = {
9180
9129
  tool_calls: this._streamToolCalls
9181
9130
  };
9182
- return _context96.abrupt("return", (this._streamToolCalls = void 0, this.handleTools(o, t, i)));
9131
+ return _context95.abrupt("return", (this._streamToolCalls = void 0, this.handleTools(o, t, i)));
9183
9132
  case 7:
9184
9133
  n != null && n.tool_calls && (this._streamToolCalls ? n.tool_calls.forEach(function (o, a) {
9185
- _this42._streamToolCalls && (_this42._streamToolCalls[a]["function"].arguments += o["function"].arguments);
9134
+ _this41._streamToolCalls && (_this41._streamToolCalls[a]["function"].arguments += o["function"].arguments);
9186
9135
  }) : this._streamToolCalls = n.tool_calls);
9187
9136
  case 8:
9188
- return _context96.abrupt("return", {
9137
+ return _context95.abrupt("return", {
9189
9138
  text: (n == null ? void 0 : n.content) || ""
9190
9139
  });
9191
9140
  case 9:
9192
9141
  case "end":
9193
- return _context96.stop();
9142
+ return _context95.stop();
9194
9143
  }
9195
- }, _callee96, this);
9144
+ }, _callee95, this);
9196
9145
  }));
9197
- function extractStreamResult(_x171, _x172, _x173) {
9146
+ function extractStreamResult(_x170, _x171, _x172) {
9198
9147
  return _extractStreamResult.apply(this, arguments);
9199
9148
  }
9200
9149
  return extractStreamResult;
@@ -9202,13 +9151,13 @@ var yt = /*#__PURE__*/function (_U12) {
9202
9151
  }, {
9203
9152
  key: "handleTools",
9204
9153
  value: function () {
9205
- var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e, t, i) {
9154
+ var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e, t, i) {
9206
9155
  var a, l, c, d, h, n, r, o, u, _u;
9207
- return _regeneratorRuntime().wrap(function _callee97$(_context97) {
9208
- while (1) switch (_context97.prev = _context97.next) {
9156
+ return _regeneratorRuntime().wrap(function _callee96$(_context96) {
9157
+ while (1) switch (_context96.prev = _context96.next) {
9209
9158
  case 0:
9210
9159
  if (!(!e.tool_calls || !t || !i || !this._functionHandler)) {
9211
- _context97.next = 2;
9160
+ _context96.next = 2;
9212
9161
  break;
9213
9162
  }
9214
9163
  throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Chat) object.");
@@ -9220,28 +9169,28 @@ var yt = /*#__PURE__*/function (_U12) {
9220
9169
  arguments: u["function"].arguments
9221
9170
  };
9222
9171
  });
9223
- _context97.next = 6;
9172
+ _context96.next = 6;
9224
9173
  return (a = this._functionHandler) == null ? void 0 : a.call(this, r);
9225
9174
  case 6:
9226
- o = _context97.sent;
9175
+ o = _context96.sent;
9227
9176
  if (!o.text) {
9228
- _context97.next = 15;
9177
+ _context96.next = 15;
9229
9178
  break;
9230
9179
  }
9231
9180
  u = {
9232
9181
  text: o.text
9233
9182
  };
9234
- _context97.next = 11;
9183
+ _context96.next = 11;
9235
9184
  return (c = (l = this.deepChat).responseInterceptor) == null ? void 0 : c.call(l, u);
9236
9185
  case 11:
9237
- _context97.t0 = _context97.sent;
9238
- if (_context97.t0) {
9239
- _context97.next = 14;
9186
+ _context96.t0 = _context96.sent;
9187
+ if (_context96.t0) {
9188
+ _context96.next = 14;
9240
9189
  break;
9241
9190
  }
9242
- _context97.t0 = u;
9191
+ _context96.t0 = u;
9243
9192
  case 14:
9244
- return _context97.abrupt("return", _context97.t0);
9193
+ return _context96.abrupt("return", _context96.t0);
9245
9194
  case 15:
9246
9195
  if (!(n.messages.push({
9247
9196
  tool_calls: e.tool_calls,
@@ -9250,7 +9199,7 @@ var yt = /*#__PURE__*/function (_U12) {
9250
9199
  }), Array.isArray(o) && !o.find(function (u) {
9251
9200
  return typeof u != "string";
9252
9201
  }) || r.length === o.length)) {
9253
- _context97.next = 35;
9202
+ _context96.next = 35;
9254
9203
  break;
9255
9204
  }
9256
9205
  o.forEach(function (u, f) {
@@ -9263,46 +9212,46 @@ var yt = /*#__PURE__*/function (_U12) {
9263
9212
  content: u.response
9264
9213
  });
9265
9214
  }), delete n.tools, delete n.tool_choice, delete n.stream;
9266
- _context97.prev = 17;
9267
- _context97.next = 20;
9215
+ _context96.prev = 17;
9216
+ _context96.next = 20;
9268
9217
  return t == null ? void 0 : t(n).then(function (f) {
9269
9218
  return v.processResponseByType(f);
9270
9219
  });
9271
9220
  case 20:
9272
- _u = _context97.sent;
9273
- _context97.next = 23;
9221
+ _u = _context96.sent;
9222
+ _context96.next = 23;
9274
9223
  return (h = (d = this.deepChat).responseInterceptor) == null ? void 0 : h.call(d, _u);
9275
9224
  case 23:
9276
- _context97.t1 = _context97.sent;
9277
- if (_context97.t1) {
9278
- _context97.next = 26;
9225
+ _context96.t1 = _context96.sent;
9226
+ if (_context96.t1) {
9227
+ _context96.next = 26;
9279
9228
  break;
9280
9229
  }
9281
- _context97.t1 = _u;
9230
+ _context96.t1 = _u;
9282
9231
  case 26:
9283
- _u = _context97.t1;
9232
+ _u = _context96.t1;
9284
9233
  if (!_u.error) {
9285
- _context97.next = 29;
9234
+ _context96.next = 29;
9286
9235
  break;
9287
9236
  }
9288
9237
  throw _u.error.message;
9289
9238
  case 29:
9290
- return _context97.abrupt("return", {
9239
+ return _context96.abrupt("return", {
9291
9240
  text: _u.choices[0].message.content || ""
9292
9241
  });
9293
9242
  case 32:
9294
- _context97.prev = 32;
9295
- _context97.t2 = _context97["catch"](17);
9296
- throw this.asyncCallInProgress = !1, _context97.t2;
9243
+ _context96.prev = 32;
9244
+ _context96.t2 = _context96["catch"](17);
9245
+ throw this.asyncCallInProgress = !1, _context96.t2;
9297
9246
  case 35:
9298
9247
  throw Error("Response object must either be {response: string}[] for each individual function or {text: string} for a direct response, see https://deepchat.dev/docs/directConnection/OpenAI#FunctionHandler.");
9299
9248
  case 36:
9300
9249
  case "end":
9301
- return _context97.stop();
9250
+ return _context96.stop();
9302
9251
  }
9303
- }, _callee97, this, [[17, 32]]);
9252
+ }, _callee96, this, [[17, 32]]);
9304
9253
  }));
9305
- function handleTools(_x174, _x175, _x176) {
9254
+ function handleTools(_x173, _x174, _x175) {
9306
9255
  return _handleTools2.apply(this, arguments);
9307
9256
  }
9308
9257
  return handleTools;
@@ -9338,15 +9287,15 @@ var yt = /*#__PURE__*/function (_U12) {
9338
9287
  }(U);
9339
9288
  var ko = /*#__PURE__*/function (_un3) {
9340
9289
  function ko(e) {
9341
- var _this43$maxMessages;
9342
- var _this43;
9290
+ var _this42$maxMessages;
9291
+ var _this42;
9343
9292
  _classCallCheck(this, ko);
9344
9293
  var r;
9345
9294
  var t = JSON.parse(JSON.stringify(e.directConnection)),
9346
9295
  i = (r = t.cohere) == null ? void 0 : r.chat,
9347
9296
  n = t.cohere;
9348
- _this43 = _callSuper(this, ko, [e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, n]), _typeof(i) == "object" && Object.assign(_this43.rawBody, i), (_this43$maxMessages = _this43.maxMessages) !== null && _this43$maxMessages !== void 0 ? _this43$maxMessages : _this43.maxMessages = -1;
9349
- return _this43;
9297
+ _this42 = _callSuper(this, ko, [e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, n]), _typeof(i) == "object" && Object.assign(_this42.rawBody, i), (_this42$maxMessages = _this42.maxMessages) !== null && _this42$maxMessages !== void 0 ? _this42$maxMessages : _this42.maxMessages = -1;
9298
+ return _this42;
9350
9299
  }
9351
9300
  _inherits(ko, _un3);
9352
9301
  return _createClass(ko, [{
@@ -9366,13 +9315,13 @@ var ko = /*#__PURE__*/function (_un3) {
9366
9315
  }, {
9367
9316
  key: "callServiceAPI",
9368
9317
  value: function () {
9369
- var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee98(e, t) {
9318
+ var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e, t) {
9370
9319
  var i;
9371
- return _regeneratorRuntime().wrap(function _callee98$(_context98) {
9372
- while (1) switch (_context98.prev = _context98.next) {
9320
+ return _regeneratorRuntime().wrap(function _callee97$(_context97) {
9321
+ while (1) switch (_context97.prev = _context97.next) {
9373
9322
  case 0:
9374
9323
  if (this.connectSettings) {
9375
- _context98.next = 2;
9324
+ _context97.next = 2;
9376
9325
  break;
9377
9326
  }
9378
9327
  throw new Error("Request settings have not been set up");
@@ -9381,11 +9330,11 @@ var ko = /*#__PURE__*/function (_un3) {
9381
9330
  T.request(this, i, e);
9382
9331
  case 4:
9383
9332
  case "end":
9384
- return _context98.stop();
9333
+ return _context97.stop();
9385
9334
  }
9386
- }, _callee98, this);
9335
+ }, _callee97, this);
9387
9336
  }));
9388
- function callServiceAPI(_x177, _x178) {
9337
+ function callServiceAPI(_x176, _x177) {
9389
9338
  return _callServiceAPI21.apply(this, arguments);
9390
9339
  }
9391
9340
  return callServiceAPI;
@@ -9393,26 +9342,26 @@ var ko = /*#__PURE__*/function (_un3) {
9393
9342
  }, {
9394
9343
  key: "extractResultData",
9395
9344
  value: function () {
9396
- var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee99(e) {
9397
- return _regeneratorRuntime().wrap(function _callee99$(_context99) {
9398
- while (1) switch (_context99.prev = _context99.next) {
9345
+ var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee98(e) {
9346
+ return _regeneratorRuntime().wrap(function _callee98$(_context98) {
9347
+ while (1) switch (_context98.prev = _context98.next) {
9399
9348
  case 0:
9400
9349
  if (!e.message) {
9401
- _context99.next = 2;
9350
+ _context98.next = 2;
9402
9351
  break;
9403
9352
  }
9404
9353
  throw e.message;
9405
9354
  case 2:
9406
- return _context99.abrupt("return", {
9355
+ return _context98.abrupt("return", {
9407
9356
  text: e.text
9408
9357
  });
9409
9358
  case 3:
9410
9359
  case "end":
9411
- return _context99.stop();
9360
+ return _context98.stop();
9412
9361
  }
9413
- }, _callee99);
9362
+ }, _callee98);
9414
9363
  }));
9415
- function extractResultData(_x179) {
9364
+ function extractResultData(_x178) {
9416
9365
  return _extractResultData24.apply(this, arguments);
9417
9366
  }
9418
9367
  return extractResultData;
@@ -9452,13 +9401,13 @@ var li = /*#__PURE__*/function () {
9452
9401
  }();
9453
9402
  var Ao = /*#__PURE__*/function (_U13) {
9454
9403
  function Ao(e) {
9455
- var _this44$maxMessages, _n$model;
9456
- var _this44;
9404
+ var _this43$maxMessages, _n$model;
9405
+ var _this43;
9457
9406
  _classCallCheck(this, Ao);
9458
9407
  var n;
9459
9408
  var i = JSON.parse(JSON.stringify(e.directConnection)).mistral;
9460
- _this44 = _callSuper(this, Ao, [e, li.buildKeyVerificationDetails(), li.buildHeaders, i]), _this44.insertKeyPlaceholderText = "Mistral API Key", _this44.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this44.url = "https://api.mistral.ai/v1/chat/completions", _this44.permittedErrorPrefixes = ["invalid"], i && (_this44.cleanConfig(i), Object.assign(_this44.rawBody, i)), (_this44$maxMessages = _this44.maxMessages) !== null && _this44$maxMessages !== void 0 ? _this44$maxMessages : _this44.maxMessages = -1, (_n$model = (n = _this44.rawBody).model) !== null && _n$model !== void 0 ? _n$model : n.model = "open-mistral-7b";
9461
- return _this44;
9409
+ _this43 = _callSuper(this, Ao, [e, li.buildKeyVerificationDetails(), li.buildHeaders, i]), _this43.insertKeyPlaceholderText = "Mistral API Key", _this43.keyHelpUrl = "https://console.mistral.ai/api-keys/", _this43.url = "https://api.mistral.ai/v1/chat/completions", _this43.permittedErrorPrefixes = ["invalid"], i && (_this43.cleanConfig(i), Object.assign(_this43.rawBody, i)), (_this43$maxMessages = _this43.maxMessages) !== null && _this43$maxMessages !== void 0 ? _this43$maxMessages : _this43.maxMessages = -1, (_n$model = (n = _this43.rawBody).model) !== null && _n$model !== void 0 ? _n$model : n.model = "open-mistral-7b";
9410
+ return _this43;
9462
9411
  }
9463
9412
  _inherits(Ao, _U13);
9464
9413
  return _createClass(Ao, [{
@@ -9484,13 +9433,13 @@ var Ao = /*#__PURE__*/function (_U13) {
9484
9433
  }, {
9485
9434
  key: "callServiceAPI",
9486
9435
  value: function () {
9487
- var _callServiceAPI22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee100(e, t) {
9436
+ var _callServiceAPI22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee99(e, t) {
9488
9437
  var i;
9489
- return _regeneratorRuntime().wrap(function _callee100$(_context100) {
9490
- while (1) switch (_context100.prev = _context100.next) {
9438
+ return _regeneratorRuntime().wrap(function _callee99$(_context99) {
9439
+ while (1) switch (_context99.prev = _context99.next) {
9491
9440
  case 0:
9492
9441
  if (this.connectSettings) {
9493
- _context100.next = 2;
9442
+ _context99.next = 2;
9494
9443
  break;
9495
9444
  }
9496
9445
  throw new Error("Request settings have not been set up");
@@ -9499,11 +9448,11 @@ var Ao = /*#__PURE__*/function (_U13) {
9499
9448
  T.request(this, i, e);
9500
9449
  case 4:
9501
9450
  case "end":
9502
- return _context100.stop();
9451
+ return _context99.stop();
9503
9452
  }
9504
- }, _callee100, this);
9453
+ }, _callee99, this);
9505
9454
  }));
9506
- function callServiceAPI(_x180, _x181) {
9455
+ function callServiceAPI(_x179, _x180) {
9507
9456
  return _callServiceAPI22.apply(this, arguments);
9508
9457
  }
9509
9458
  return callServiceAPI;
@@ -9511,26 +9460,26 @@ var Ao = /*#__PURE__*/function (_U13) {
9511
9460
  }, {
9512
9461
  key: "extractResultData",
9513
9462
  value: function () {
9514
- var _extractResultData25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee101(e) {
9515
- return _regeneratorRuntime().wrap(function _callee101$(_context101) {
9516
- while (1) switch (_context101.prev = _context101.next) {
9463
+ var _extractResultData25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee100(e) {
9464
+ return _regeneratorRuntime().wrap(function _callee100$(_context100) {
9465
+ while (1) switch (_context100.prev = _context100.next) {
9517
9466
  case 0:
9518
9467
  if (!e.message) {
9519
- _context101.next = 2;
9468
+ _context100.next = 2;
9520
9469
  break;
9521
9470
  }
9522
9471
  throw e.message;
9523
9472
  case 2:
9524
- return _context101.abrupt("return", {
9473
+ return _context100.abrupt("return", {
9525
9474
  text: e.text
9526
9475
  });
9527
9476
  case 3:
9528
9477
  case "end":
9529
- return _context101.stop();
9478
+ return _context100.stop();
9530
9479
  }
9531
- }, _callee101);
9480
+ }, _callee100);
9532
9481
  }));
9533
- function extractResultData(_x182) {
9482
+ function extractResultData(_x181) {
9534
9483
  return _extractResultData25.apply(this, arguments);
9535
9484
  }
9536
9485
  return extractResultData;
@@ -9692,20 +9641,20 @@ var Te = /*#__PURE__*/function () {
9692
9641
  }, {
9693
9642
  key: "addNewImageMessage",
9694
9643
  value: function () {
9695
- var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee102(e, t, i) {
9644
+ var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee101(e, t, i) {
9696
9645
  var n, r;
9697
- return _regeneratorRuntime().wrap(function _callee102$(_context102) {
9698
- while (1) switch (_context102.prev = _context102.next) {
9646
+ return _regeneratorRuntime().wrap(function _callee101$(_context101) {
9647
+ while (1) switch (_context101.prev = _context101.next) {
9699
9648
  case 0:
9700
9649
  n = Te.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
9701
9650
  r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), q.addMessage(e, r, "image", i);
9702
9651
  case 2:
9703
9652
  case "end":
9704
- return _context102.stop();
9653
+ return _context101.stop();
9705
9654
  }
9706
- }, _callee102);
9655
+ }, _callee101);
9707
9656
  }));
9708
- function addNewImageMessage(_x183, _x184, _x185) {
9657
+ function addNewImageMessage(_x182, _x183, _x184) {
9709
9658
  return _addNewImageMessage.apply(this, arguments);
9710
9659
  }
9711
9660
  return addNewImageMessage;
@@ -9754,23 +9703,23 @@ var Te = /*#__PURE__*/function () {
9754
9703
  }();
9755
9704
  var Ce = /*#__PURE__*/function (_ot) {
9756
9705
  function Ce(e, t, i) {
9757
- var _this45;
9706
+ var _this44;
9758
9707
  _classCallCheck(this, Ce);
9759
9708
  var a, l;
9760
- _this45 = _callSuper(this, Ce, [e]);
9709
+ _this44 = _callSuper(this, Ce, [e]);
9761
9710
  var n = t.permittedErrorPrefixes,
9762
9711
  r = t.introPanelMarkUp,
9763
9712
  o = t.demo;
9764
- _this45._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this45._onClearMessages = Qt.onClearMessages.bind(_this45, e), _this45._onError = Qt.onError.bind(_this45, e), _this45._displayLoadingMessage = Ce.getDisplayLoadingMessage(e, t), _this45._permittedErrorPrefixes = n, _this45.addSetupMessageIfNeeded(e, t) || _this45.populateIntroPanel(i, r, e.introPanelStyle), _this45.addIntroductoryMessage(e, t), _this45.populateHistory(e), _this45._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
9765
- return JSON.parse(JSON.stringify(_this45.messages));
9766
- }, e.clearMessages = _this45.clearMessages.bind(_this45, t), e.refreshMessages = _this45.refreshTextMessages.bind(_this45), e.scrollToBottom = j.scrollToBottom.bind(_this45, _this45.elementRef), e.addMessage = function (c, d) {
9767
- _this45.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
9713
+ _this44._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this44._onClearMessages = Qt.onClearMessages.bind(_this44, e), _this44._onError = Qt.onError.bind(_this44, e), _this44._displayLoadingMessage = Ce.getDisplayLoadingMessage(e, t), _this44._permittedErrorPrefixes = n, _this44.addSetupMessageIfNeeded(e, t) || _this44.populateIntroPanel(i, r, e.introPanelStyle), _this44.addIntroductoryMessage(e, t), _this44.populateHistory(e), _this44._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
9714
+ return JSON.parse(JSON.stringify(_this44.messages));
9715
+ }, e.clearMessages = _this44.clearMessages.bind(_this44, t), e.refreshMessages = _this44.refreshTextMessages.bind(_this44), e.scrollToBottom = j.scrollToBottom.bind(_this44, _this44.elementRef), e.addMessage = function (c, d) {
9716
+ _this44.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
9768
9717
  sendUpdate: !!d
9769
9718
  }), !d);
9770
- }, t.isWebModel() && t.setUpMessages(_this45), o && _this45.prepareDemo(o), e.textToSpeech && rt.processConfig(e.textToSpeech, function (c) {
9771
- _this45.textToSpeech = c;
9772
- }), t.fetchHistory && _this45.fetchHistory(t.fetchHistory);
9773
- return _this45;
9719
+ }, t.isWebModel() && t.setUpMessages(_this44), o && _this44.prepareDemo(o), e.textToSpeech && rt.processConfig(e.textToSpeech, function (c) {
9720
+ _this44.textToSpeech = c;
9721
+ }), t.fetchHistory && _this44.fetchHistory(t.fetchHistory);
9722
+ return _this44;
9774
9723
  }
9775
9724
  _inherits(Ce, _ot);
9776
9725
  return _createClass(Ce, [{
@@ -9810,38 +9759,38 @@ var Ce = /*#__PURE__*/function (_ot) {
9810
9759
  }, {
9811
9760
  key: "populateHistory",
9812
9761
  value: function populateHistory(e) {
9813
- var _this46 = this;
9762
+ var _this45 = this;
9814
9763
  var t = e.history || de.processHistory(e);
9815
9764
  t && (t.forEach(function (i) {
9816
- de.processHistoryFile(i), _this46.addNewMessage(i, !0);
9765
+ de.processHistoryFile(i), _this45.addNewMessage(i, !0);
9817
9766
  }), setTimeout(function () {
9818
- return j.scrollToBottom(_this46.elementRef);
9767
+ return j.scrollToBottom(_this45.elementRef);
9819
9768
  }, 0));
9820
9769
  }
9821
9770
  }, {
9822
9771
  key: "fetchHistory",
9823
9772
  value: function () {
9824
- var _fetchHistory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee103(e) {
9825
- var _this47 = this;
9826
- return _regeneratorRuntime().wrap(function _callee103$(_context103) {
9827
- while (1) switch (_context103.prev = _context103.next) {
9773
+ var _fetchHistory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee102(e) {
9774
+ var _this46 = this;
9775
+ return _regeneratorRuntime().wrap(function _callee102$(_context102) {
9776
+ while (1) switch (_context102.prev = _context102.next) {
9828
9777
  case 0:
9829
- _context103.next = 2;
9778
+ _context102.next = 2;
9830
9779
  return e();
9831
9780
  case 2:
9832
- _context103.sent.forEach(function (i) {
9833
- return _this47.addAnyMessage(i, !0);
9781
+ _context102.sent.forEach(function (i) {
9782
+ return _this46.addAnyMessage(i, !0);
9834
9783
  });
9835
9784
  setTimeout(function () {
9836
- return j.scrollToBottom(_this47.elementRef);
9785
+ return j.scrollToBottom(_this46.elementRef);
9837
9786
  }, 0);
9838
9787
  case 4:
9839
9788
  case "end":
9840
- return _context103.stop();
9789
+ return _context102.stop();
9841
9790
  }
9842
- }, _callee103);
9791
+ }, _callee102);
9843
9792
  }));
9844
- function fetchHistory(_x186) {
9793
+ function fetchHistory(_x185) {
9845
9794
  return _fetchHistory.apply(this, arguments);
9846
9795
  }
9847
9796
  return fetchHistory;
@@ -9941,11 +9890,11 @@ var Ce = /*#__PURE__*/function (_ot) {
9941
9890
  }, {
9942
9891
  key: "addMultipleFiles",
9943
9892
  value: function () {
9944
- var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee104(e) {
9945
- return _regeneratorRuntime().wrap(function _callee104$(_context104) {
9946
- while (1) switch (_context104.prev = _context104.next) {
9893
+ var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee103(e) {
9894
+ return _regeneratorRuntime().wrap(function _callee103$(_context103) {
9895
+ while (1) switch (_context103.prev = _context103.next) {
9947
9896
  case 0:
9948
- return _context104.abrupt("return", Promise.all((e || []).map(function (t) {
9897
+ return _context103.abrupt("return", Promise.all((e || []).map(function (t) {
9949
9898
  return new Promise(function (i) {
9950
9899
  if (!t.type || t.type === "any") {
9951
9900
  var n = t.file.name || q.DEFAULT_FILE_NAME;
@@ -9968,11 +9917,11 @@ var Ce = /*#__PURE__*/function (_ot) {
9968
9917
  })));
9969
9918
  case 1:
9970
9919
  case "end":
9971
- return _context104.stop();
9920
+ return _context103.stop();
9972
9921
  }
9973
- }, _callee104);
9922
+ }, _callee103);
9974
9923
  }));
9975
- function addMultipleFiles(_x187) {
9924
+ function addMultipleFiles(_x186) {
9976
9925
  return _addMultipleFiles.apply(this, arguments);
9977
9926
  }
9978
9927
  return addMultipleFiles;
@@ -10269,11 +10218,11 @@ var De = /*#__PURE__*/function () {
10269
10218
  }();
10270
10219
  var mn = /*#__PURE__*/function () {
10271
10220
  function mn(e, t) {
10272
- var _this48 = this;
10221
+ var _this47 = this;
10273
10222
  _classCallCheck(this, mn);
10274
10223
  var i;
10275
10224
  this._isOpen = !0, this._styles = t, this.elementRef = mn.createElement((i = this._styles) == null ? void 0 : i.container), this.close(), setTimeout(function () {
10276
- return _this48.addWindowEvents(e);
10225
+ return _this47.addWindowEvents(e);
10277
10226
  });
10278
10227
  }
10279
10228
  return _createClass(mn, [{
@@ -10326,15 +10275,15 @@ var mn = /*#__PURE__*/function () {
10326
10275
  }();
10327
10276
  var at = /*#__PURE__*/function (_Bt) {
10328
10277
  function at(e, t) {
10329
- var _this49;
10278
+ var _this48;
10330
10279
  _classCallCheck(this, at);
10331
10280
  var n;
10332
- _this49 = _callSuper(this, at, [at.createButtonElement(), void 0, {
10281
+ _this48 = _callSuper(this, at, [at.createButtonElement(), void 0, {
10333
10282
  styles: (n = t == null ? void 0 : t.button) == null ? void 0 : n.styles
10334
10283
  }]);
10335
- var i = _this49.createInnerElements(_this49._customStyles);
10336
- _this49._menu = new mn(e, t == null ? void 0 : t.menu), _this49.addClickEvent(), _this49.buttonContainer = at.createButtonContainer(), _this49.elementRef.appendChild(i.styles), _this49.buttonContainer.appendChild(_this49.elementRef), _this49.elementRef.classList.add("dropup-icon", "upload-file-button"), _this49.elementRef.children[0].id = "dropup-icon", _this49.buttonContainer.appendChild(_this49._menu.elementRef), _this49.reapplyStateStyle("styles"), _this49.addContainerEvents(e);
10337
- return _this49;
10284
+ var i = _this48.createInnerElements(_this48._customStyles);
10285
+ _this48._menu = new mn(e, t == null ? void 0 : t.menu), _this48.addClickEvent(), _this48.buttonContainer = at.createButtonContainer(), _this48.elementRef.appendChild(i.styles), _this48.buttonContainer.appendChild(_this48.elementRef), _this48.elementRef.classList.add("dropup-icon", "upload-file-button"), _this48.elementRef.children[0].id = "dropup-icon", _this48.buttonContainer.appendChild(_this48._menu.elementRef), _this48.reapplyStateStyle("styles"), _this48.addContainerEvents(e);
10286
+ return _this48;
10338
10287
  }
10339
10288
  _inherits(at, _Bt);
10340
10289
  return _createClass(at, [{
@@ -10362,9 +10311,9 @@ var at = /*#__PURE__*/function (_Bt) {
10362
10311
  }, {
10363
10312
  key: "addContainerEvents",
10364
10313
  value: function addContainerEvents(e) {
10365
- var _this50 = this;
10314
+ var _this49 = this;
10366
10315
  e.addEventListener("click", function (t) {
10367
- t.target.classList.contains("dropup-icon") || _this50._menu.close();
10316
+ t.target.classList.contains("dropup-icon") || _this49._menu.close();
10368
10317
  });
10369
10318
  }
10370
10319
  }], [{
@@ -10496,10 +10445,10 @@ var Po = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\"
10496
10445
  Bo = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\" width=\"1.4em\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t viewBox=\"0 0 490.9 490.9\" xml:space=\"preserve\">\n\t<g>\n\t\t<g>\n\t\t\t<path d=\"M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5\n\t\t\t\tC149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5\n\t\t\t\tc0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z\"/>\n\t\t\t<path d=\"M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3\n\t\t\t\ts5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8\n\t\t\t\tc0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9\n\t\t\t\tC106.6,220,101.2,214.5,94.4,214.5z\"/>\n\t\t</g>\n\t</g>\n</svg>\n";
10497
10446
  var Lt = /*#__PURE__*/function (_Bt2) {
10498
10447
  function Lt(e) {
10499
- var _this51;
10448
+ var _this50;
10500
10449
  _classCallCheck(this, Lt);
10501
- (e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this51 = _callSuper(this, Lt, [Lt.createMicrophoneElement(), e == null ? void 0 : e.position, e]), _this51.isActive = !1, _this51._innerElements = _this51.createInnerElements(_this51._customStyles), _this51.changeToDefault();
10502
- return _this51;
10450
+ (e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this50 = _callSuper(this, Lt, [Lt.createMicrophoneElement(), e == null ? void 0 : e.position, e]), _this50.isActive = !1, _this50._innerElements = _this50.createInnerElements(_this50._customStyles), _this50.changeToDefault();
10451
+ return _this50;
10503
10452
  }
10504
10453
  _inherits(Lt, _Bt2);
10505
10454
  return _createClass(Lt, [{
@@ -10703,9 +10652,9 @@ var te = /*#__PURE__*/function () {
10703
10652
  }, {
10704
10653
  key: "keyDownWindow",
10705
10654
  value: function keyDownWindow(e) {
10706
- var _this52 = this;
10655
+ var _this51 = this;
10707
10656
  e.element && te.getElementIfFocusedOnAvailable(e.element, document.activeElement) && (te.KEY_DOWN_TIMEOUT !== null && clearTimeout(te.KEY_DOWN_TIMEOUT), te.KEY_DOWN_TIMEOUT = setTimeout(function () {
10708
- te.KEY_DOWN_TIMEOUT = null, _this52.resetRecording(e);
10657
+ te.KEY_DOWN_TIMEOUT = null, _this51.resetRecording(e);
10709
10658
  }, 500));
10710
10659
  }
10711
10660
  }, {
@@ -11316,22 +11265,22 @@ var ui = /*#__PURE__*/function (_Xo$Speech) {
11316
11265
  }, {
11317
11266
  key: "setEvents",
11318
11267
  value: function setEvents() {
11319
- var _this53 = this;
11268
+ var _this52 = this;
11320
11269
  this._service && (this._service.onstart = function () {
11321
- _this53.setStateOnStart();
11270
+ _this52.setStateOnStart();
11322
11271
  }, this._service.onerror = function (e) {
11323
- Wn.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" && _this53.isRestarting || e.error !== "no-speech" && _this53.error(e.message || e.error);
11272
+ Wn.Browser.IS_SAFARI() && e.message === "Another request is started" || e.error === "aborted" && _this52.isRestarting || e.error !== "no-speech" && _this52.error(e.message || e.error);
11324
11273
  }, this._service.onaudioend = function () {
11325
- _this53.setStateOnStop();
11274
+ _this52.setStateOnStop();
11326
11275
  }, this._service.onend = function () {
11327
- _this53._stopping = !1;
11276
+ _this52._stopping = !1;
11328
11277
  }, this._service.onresult = function (e) {
11329
- if (_typeof(e.results) > "u" && _this53._service) _this53._service.onend = null, _this53._service.stop();else if (_this53._extractText && !_this53._stopping) {
11330
- var _this53$_extractText = _this53._extractText(e, _this53.finalTranscript, _this53._translations),
11331
- t = _this53$_extractText.interimTranscript,
11332
- _i21 = _this53$_extractText.finalTranscript,
11333
- n = _this53$_extractText.newText;
11334
- _this53.updateElements(t, _i21, n);
11278
+ if (_typeof(e.results) > "u" && _this52._service) _this52._service.onend = null, _this52._service.stop();else if (_this52._extractText && !_this52._stopping) {
11279
+ var _this52$_extractText = _this52._extractText(e, _this52.finalTranscript, _this52._translations),
11280
+ t = _this52$_extractText.interimTranscript,
11281
+ _i21 = _this52$_extractText.finalTranscript,
11282
+ n = _this52$_extractText.newText;
11283
+ _this52.updateElements(t, _i21, n);
11335
11284
  }
11336
11285
  });
11337
11286
  }
@@ -11423,26 +11372,26 @@ var fi = /*#__PURE__*/function () {
11423
11372
  }, {
11424
11373
  key: "getNewSpeechConfig",
11425
11374
  value: function () {
11426
- var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee105(e, t) {
11427
- return _regeneratorRuntime().wrap(function _callee105$(_context105) {
11428
- while (1) switch (_context105.prev = _context105.next) {
11375
+ var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee104(e, t) {
11376
+ return _regeneratorRuntime().wrap(function _callee104$(_context104) {
11377
+ while (1) switch (_context104.prev = _context104.next) {
11429
11378
  case 0:
11430
11379
  if (!t.region) {
11431
- _context105.next = 2;
11380
+ _context104.next = 2;
11432
11381
  break;
11433
11382
  }
11434
- return _context105.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 (i) {
11383
+ return _context104.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 (i) {
11435
11384
  return t.region ? e.fromAuthorizationToken((i == null ? void 0 : i.trim()) || "", t.region.trim()) : null;
11436
11385
  })["catch"](function (i) {
11437
11386
  return console.error(i), null;
11438
11387
  }) : null);
11439
11388
  case 2:
11440
11389
  case "end":
11441
- return _context105.stop();
11390
+ return _context104.stop();
11442
11391
  }
11443
- }, _callee105);
11392
+ }, _callee104);
11444
11393
  }));
11445
- function getNewSpeechConfig(_x188, _x189) {
11394
+ function getNewSpeechConfig(_x187, _x188) {
11446
11395
  return _getNewSpeechConfig.apply(this, arguments);
11447
11396
  }
11448
11397
  return getNewSpeechConfig;
@@ -11455,23 +11404,23 @@ var fi = /*#__PURE__*/function () {
11455
11404
  }, {
11456
11405
  key: "get",
11457
11406
  value: function () {
11458
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee106(e, t) {
11407
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee105(e, t) {
11459
11408
  var i;
11460
- return _regeneratorRuntime().wrap(function _callee106$(_context106) {
11461
- while (1) switch (_context106.prev = _context106.next) {
11409
+ return _regeneratorRuntime().wrap(function _callee105$(_context105) {
11410
+ while (1) switch (_context105.prev = _context105.next) {
11462
11411
  case 0:
11463
- _context106.next = 2;
11412
+ _context105.next = 2;
11464
11413
  return fi.getNewSpeechConfig(e, t);
11465
11414
  case 2:
11466
- i = _context106.sent;
11467
- return _context106.abrupt("return", (i && fi.process(i, t), i));
11415
+ i = _context105.sent;
11416
+ return _context105.abrupt("return", (i && fi.process(i, t), i));
11468
11417
  case 4:
11469
11418
  case "end":
11470
- return _context106.stop();
11419
+ return _context105.stop();
11471
11420
  }
11472
- }, _callee106);
11421
+ }, _callee105);
11473
11422
  }));
11474
- function get(_x190, _x191) {
11423
+ function get(_x189, _x190) {
11475
11424
  return _get.apply(this, arguments);
11476
11425
  }
11477
11426
  return get;
@@ -11543,10 +11492,10 @@ var $n = Ii,
11543
11492
  ea = Ut;
11544
11493
  var pi = /*#__PURE__*/function (_ea$Speech) {
11545
11494
  function pi() {
11546
- var _this54;
11495
+ var _this53;
11547
11496
  _classCallCheck(this, pi);
11548
- _this54 = _callSuper(this, pi, arguments), _this54._newTextPadding = "";
11549
- return _this54;
11497
+ _this53 = _callSuper(this, pi, arguments), _this53._newTextPadding = "";
11498
+ return _this53;
11550
11499
  }
11551
11500
  _inherits(pi, _ea$Speech);
11552
11501
  return _createClass(pi, [{
@@ -11557,28 +11506,28 @@ var pi = /*#__PURE__*/function (_ea$Speech) {
11557
11506
  }, {
11558
11507
  key: "startAsync",
11559
11508
  value: function () {
11560
- var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee107(e) {
11509
+ var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee106(e) {
11561
11510
  var t;
11562
- return _regeneratorRuntime().wrap(function _callee107$(_context107) {
11563
- while (1) switch (_context107.prev = _context107.next) {
11511
+ return _regeneratorRuntime().wrap(function _callee106$(_context106) {
11512
+ while (1) switch (_context106.prev = _context106.next) {
11564
11513
  case 0:
11565
- _context107.t0 = this.validate(e);
11566
- if (!_context107.t0) {
11567
- _context107.next = 6;
11514
+ _context106.t0 = this.validate(e);
11515
+ if (!_context106.t0) {
11516
+ _context106.next = 6;
11568
11517
  break;
11569
11518
  }
11570
- _context107.next = 4;
11519
+ _context106.next = 4;
11571
11520
  return this.instantiateService(e);
11572
11521
  case 4:
11573
11522
  this._translations = e == null ? void 0 : e.translations;
11574
11523
  (t = this._service) === null || t === void 0 || t.startContinuousRecognitionAsync(function () {}, this.error);
11575
11524
  case 6:
11576
11525
  case "end":
11577
- return _context107.stop();
11526
+ return _context106.stop();
11578
11527
  }
11579
- }, _callee107, this);
11528
+ }, _callee106, this);
11580
11529
  }));
11581
- function startAsync(_x192) {
11530
+ function startAsync(_x191) {
11582
11531
  return _startAsync.apply(this, arguments);
11583
11532
  }
11584
11533
  return startAsync;
@@ -11591,28 +11540,28 @@ var pi = /*#__PURE__*/function (_ea$Speech) {
11591
11540
  }, {
11592
11541
  key: "instantiateService",
11593
11542
  value: function () {
11594
- var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee108(e) {
11543
+ var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee107(e) {
11595
11544
  var t, i, n, r;
11596
- return _regeneratorRuntime().wrap(function _callee108$(_context108) {
11597
- while (1) switch (_context108.prev = _context108.next) {
11545
+ return _regeneratorRuntime().wrap(function _callee107$(_context107) {
11546
+ while (1) switch (_context107.prev = _context107.next) {
11598
11547
  case 0:
11599
11548
  t = pi.getAPI();
11600
11549
  i = t.AudioConfig.fromDefaultMicrophoneInput();
11601
- _context108.next = 4;
11550
+ _context107.next = 4;
11602
11551
  return Kn.AzureSpeechConfig.get(t.SpeechConfig, e);
11603
11552
  case 4:
11604
- n = _context108.sent;
11553
+ n = _context107.sent;
11605
11554
  if (n) {
11606
11555
  r = new t.SpeechRecognizer(n, i);
11607
11556
  this.setEvents(r), this._service = r, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
11608
11557
  } else this.error("Unable to contact Azure server");
11609
11558
  case 6:
11610
11559
  case "end":
11611
- return _context108.stop();
11560
+ return _context107.stop();
11612
11561
  }
11613
- }, _callee108, this);
11562
+ }, _callee107, this);
11614
11563
  }));
11615
- function instantiateService(_x193) {
11564
+ function instantiateService(_x192) {
11616
11565
  return _instantiateService.apply(this, arguments);
11617
11566
  }
11618
11567
  return instantiateService;
@@ -11675,12 +11624,12 @@ var pi = /*#__PURE__*/function (_ea$Speech) {
11675
11624
  }, {
11676
11625
  key: "retrieveTokenInterval",
11677
11626
  value: function retrieveTokenInterval(e) {
11678
- var _this55 = this;
11627
+ var _this54 = this;
11679
11628
  this._retrieveTokenInterval = setInterval(function () {
11680
11629
  e == null || e().then(function (t) {
11681
- _this55._service && (_this55._service.authorizationToken = (t == null ? void 0 : t.trim()) || "");
11630
+ _this54._service && (_this54._service.authorizationToken = (t == null ? void 0 : t.trim()) || "");
11682
11631
  })["catch"](function (t) {
11683
- _this55.error(t);
11632
+ _this54.error(t);
11684
11633
  });
11685
11634
  }, 1e4);
11686
11635
  }
@@ -11764,10 +11713,10 @@ var na = /*#__PURE__*/function () {
11764
11713
  return _createClass(na, [{
11765
11714
  key: "setSilenceTimeout",
11766
11715
  value: function setSilenceTimeout(e, t) {
11767
- var _this56 = this;
11716
+ var _this55 = this;
11768
11717
  this._silenceTimeout = setTimeout(function () {
11769
11718
  var i;
11770
- (i = e.submit) == null || i.call(e), Kt.stop(), _this56.stop || setTimeout(t, Ot.MICROPHONE_RESET_TIMEOUT_MS);
11719
+ (i = e.submit) == null || i.call(e), Kt.stop(), _this55.stop || setTimeout(t, Ot.MICROPHONE_RESET_TIMEOUT_MS);
11771
11720
  }, this.silenceMS);
11772
11721
  }
11773
11722
  }, {
@@ -11789,21 +11738,21 @@ var na = /*#__PURE__*/function () {
11789
11738
  }();
11790
11739
  var Tt = /*#__PURE__*/function (_Lt) {
11791
11740
  function Tt(e, t, i) {
11792
- var _this57;
11741
+ var _this56;
11793
11742
  _classCallCheck(this, Tt);
11794
11743
  var o;
11795
- _this57 = _callSuper(this, Tt, [_typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {}]);
11796
- var _this57$processConfig = _this57.processConfiguration(t, e.speechToText),
11797
- n = _this57$processConfig.serviceName,
11798
- r = _this57$processConfig.processedConfig;
11799
- if (_this57._addErrorMessage = i, n === "webspeech" && !Kt.isWebSpeechSupported()) _this57.changeToUnsupported();else {
11744
+ _this56 = _callSuper(this, Tt, [_typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {}]);
11745
+ var _this56$processConfig = _this56.processConfiguration(t, e.speechToText),
11746
+ n = _this56$processConfig.serviceName,
11747
+ r = _this56$processConfig.processedConfig;
11748
+ if (_this56._addErrorMessage = i, n === "webspeech" && !Kt.isWebSpeechSupported()) _this56.changeToUnsupported();else {
11800
11749
  var a = !e.textInput || !e.textInput.disabled;
11801
- _this57.elementRef.onclick = _this57.buttonClick.bind(_this57, t, a, n, r);
11750
+ _this56.elementRef.onclick = _this56.buttonClick.bind(_this56, t, a, n, r);
11802
11751
  }
11803
11752
  setTimeout(function () {
11804
- _this57._validationHandler = e._validationHandler;
11753
+ _this56._validationHandler = e._validationHandler;
11805
11754
  });
11806
- return _this57;
11755
+ return _this56;
11807
11756
  }
11808
11757
  // prettier-ignore
11809
11758
  _inherits(Tt, _Lt);
@@ -11838,26 +11787,26 @@ var Tt = /*#__PURE__*/function (_Lt) {
11838
11787
  }, {
11839
11788
  key: "buttonClick",
11840
11789
  value: function buttonClick(e, t, i, n) {
11841
- var _this58 = this;
11790
+ var _this57 = this;
11842
11791
  e.removeTextIfPlaceholder(), Kt.toggle(i, _objectSpread({
11843
11792
  insertInCursorLocation: !1,
11844
11793
  element: t ? e.inputElementRef : void 0,
11845
11794
  onError: function onError() {
11846
11795
  var r;
11847
- _this58.onError(), (r = _this58._silenceSubmit) == null || r.clearSilenceTimeout();
11796
+ _this57.onError(), (r = _this57._silenceSubmit) == null || r.clearSilenceTimeout();
11848
11797
  },
11849
11798
  onStart: this.changeToActive.bind(this),
11850
11799
  onStop: function onStop() {
11851
11800
  var r, o;
11852
- (r = _this58._validationHandler) == null || r.call(_this58), (o = _this58._silenceSubmit) == null || o.clearSilenceTimeout(), _this58.changeToDefault();
11801
+ (r = _this57._validationHandler) == null || r.call(_this57), (o = _this57._silenceSubmit) == null || o.clearSilenceTimeout(), _this57.changeToDefault();
11853
11802
  },
11854
11803
  onPauseTrigger: function onPauseTrigger(r) {
11855
11804
  var o;
11856
- (o = _this58._silenceSubmit) == null || o.onPause(r, e, _this58.elementRef.onclick);
11805
+ (o = _this57._silenceSubmit) == null || o.onPause(r, e, _this57.elementRef.onclick);
11857
11806
  },
11858
11807
  onResult: function onResult(r, o) {
11859
11808
  var a, l;
11860
- o && ((a = _this58._validationHandler) == null || a.call(_this58)), (l = _this58._silenceSubmit) == null || l.resetSilenceTimeout(e, _this58.elementRef.onclick);
11809
+ o && ((a = _this57._validationHandler) == null || a.call(_this57)), (l = _this57._silenceSubmit) == null || l.resetSilenceTimeout(e, _this57.elementRef.onclick);
11861
11810
  },
11862
11811
  onCommandModeTrigger: this.onCommandModeTrigger.bind(this)
11863
11812
  }, n));
@@ -11892,10 +11841,10 @@ var Ot = Tt;
11892
11841
  var Ee = /*#__PURE__*/function () {
11893
11842
  // prettier-ignore
11894
11843
  function Ee(e, t, i, n) {
11895
- var _this59 = this;
11844
+ var _this58 = this;
11896
11845
  _classCallCheck(this, Ee);
11897
11846
  this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = n, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
11898
- _this59._validationHandler = e._validationHandler;
11847
+ _this58._validationHandler = e._validationHandler;
11899
11848
  });
11900
11849
  }
11901
11850
  return _createClass(Ee, [{
@@ -12034,12 +11983,12 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
12034
11983
  return _createClass(be, [{
12035
11984
  key: "createTimer",
12036
11985
  value: function createTimer(e, t) {
12037
- var _this60 = this;
11986
+ var _this59 = this;
12038
11987
  var i = 0;
12039
11988
  var n = t !== void 0 && t < be.TIMER_LIMIT_S ? t : be.TIMER_LIMIT_S;
12040
11989
  return setInterval(function () {
12041
11990
  var a;
12042
- i += 1, i === n && ((a = _this60.stopPlaceholderCallback) == null || a.call(_this60), _this60.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
11991
+ i += 1, i === n && ((a = _this59.stopPlaceholderCallback) == null || a.call(_this59), _this59.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
12043
11992
  var r = Math.floor(i / 60),
12044
11993
  o = (i % 60).toString().padStart(2, "0");
12045
11994
  e.textContent = "".concat(r, ":").concat(o);
@@ -12059,7 +12008,7 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
12059
12008
  }, {
12060
12009
  key: "addPlaceholderAudioAttachmentEvents",
12061
12010
  value: function addPlaceholderAudioAttachmentEvents(e, t, i) {
12062
- var _this61 = this;
12011
+ var _this60 = this;
12063
12012
  var n = function n() {
12064
12013
  return e.replaceChildren(t);
12065
12014
  };
@@ -12070,7 +12019,7 @@ var sa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
12070
12019
  e.addEventListener("mouseleave", r);
12071
12020
  var o = function o() {
12072
12021
  var a;
12073
- return (a = _this61.stopPlaceholderCallback) == null ? void 0 : a.call(_this61);
12022
+ return (a = _this60.stopPlaceholderCallback) == null ? void 0 : a.call(_this60);
12074
12023
  };
12075
12024
  e.addEventListener("click", o);
12076
12025
  }
@@ -12187,33 +12136,33 @@ var zt = /*#__PURE__*/function () {
12187
12136
  }, {
12188
12137
  key: "completePlaceholders",
12189
12138
  value: function () {
12190
- var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee110() {
12191
- return _regeneratorRuntime().wrap(function _callee110$(_context110) {
12192
- while (1) switch (_context110.prev = _context110.next) {
12139
+ var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee109() {
12140
+ return _regeneratorRuntime().wrap(function _callee109$(_context109) {
12141
+ while (1) switch (_context109.prev = _context109.next) {
12193
12142
  case 0:
12194
- _context110.next = 2;
12143
+ _context109.next = 2;
12195
12144
  return Promise.all(this._fileAttachmentsTypes.map( /*#__PURE__*/function () {
12196
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee109(e) {
12145
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee108(e) {
12197
12146
  var t;
12198
- return _regeneratorRuntime().wrap(function _callee109$(_context109) {
12199
- while (1) switch (_context109.prev = _context109.next) {
12147
+ return _regeneratorRuntime().wrap(function _callee108$(_context108) {
12148
+ while (1) switch (_context108.prev = _context108.next) {
12200
12149
  case 0:
12201
- return _context109.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
12150
+ return _context108.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
12202
12151
  case 1:
12203
12152
  case "end":
12204
- return _context109.stop();
12153
+ return _context108.stop();
12205
12154
  }
12206
- }, _callee109);
12155
+ }, _callee108);
12207
12156
  }));
12208
- return function (_x194) {
12157
+ return function (_x193) {
12209
12158
  return _ref14.apply(this, arguments);
12210
12159
  };
12211
12160
  }()));
12212
12161
  case 2:
12213
12162
  case "end":
12214
- return _context110.stop();
12163
+ return _context109.stop();
12215
12164
  }
12216
- }, _callee110, this);
12165
+ }, _callee109, this);
12217
12166
  }));
12218
12167
  function completePlaceholders() {
12219
12168
  return _completePlaceholders.apply(this, arguments);
@@ -12262,20 +12211,20 @@ var le = /*#__PURE__*/function () {
12262
12211
  }, {
12263
12212
  key: "addButtons",
12264
12213
  value: function addButtons() {
12265
- var _this62 = this;
12214
+ var _this61 = this;
12266
12215
  for (var _len2 = arguments.length, e = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
12267
12216
  e[_key2] = arguments[_key2];
12268
12217
  }
12269
12218
  e.forEach(function (t) {
12270
- return _this62._buttonPanel.appendChild(t);
12219
+ return _this61._buttonPanel.appendChild(t);
12271
12220
  });
12272
12221
  }
12273
12222
  }, {
12274
12223
  key: "close",
12275
12224
  value: function close() {
12276
- var _this63 = this;
12225
+ var _this62 = this;
12277
12226
  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 () {
12278
- _this63._elementRef.style.display = "none", _this63._backgroundPanelRef.style.display = "none";
12227
+ _this62._elementRef.style.display = "none", _this62._backgroundPanelRef.style.display = "none";
12279
12228
  }, le.MODAL_CLOSE_TIMEOUT_MS);
12280
12229
  }
12281
12230
  }, {
@@ -12291,10 +12240,10 @@ var le = /*#__PURE__*/function () {
12291
12240
  }, {
12292
12241
  key: "addCloseButton",
12293
12242
  value: function addCloseButton(e, t, i) {
12294
- var _this64 = this;
12243
+ var _this63 = this;
12295
12244
  var n = t ? le.createSVGButton(e) : le.createTextButton(e);
12296
12245
  return this.addButtons(n), n.onclick = function () {
12297
- _this64.close(), setTimeout(function () {
12246
+ _this63.close(), setTimeout(function () {
12298
12247
  i == null || i();
12299
12248
  }, 140);
12300
12249
  }, n;
@@ -12365,13 +12314,13 @@ var ze = le;
12365
12314
  var xt = /*#__PURE__*/function (_Bt3) {
12366
12315
  // prettier-ignore
12367
12316
  function xt(e, t, i, n, r, o) {
12368
- var _this65;
12317
+ var _this64;
12369
12318
  _classCallCheck(this, xt);
12370
12319
  var l, c, d, h, u, f;
12371
- _this65 = _callSuper(this, xt, [xt.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o]);
12372
- var a = _this65.createInnerElements(n, r, _this65._customStyles);
12373
- _this65._inputElement = xt.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this65.addClickEvent(e, i), _this65.elementRef.replaceChildren(a.styles), _this65.reapplyStateStyle("styles"), _this65._fileAttachmentsType = t, _this65._openModalOnce = ((h = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (f = (u = i.files) == null ? void 0 : u.infoModal) == null ? void 0 : f.openModalOnce;
12374
- return _this65;
12320
+ _this64 = _callSuper(this, xt, [xt.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o]);
12321
+ var a = _this64.createInnerElements(n, r, _this64._customStyles);
12322
+ _this64._inputElement = xt.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this64.addClickEvent(e, i), _this64.elementRef.replaceChildren(a.styles), _this64.reapplyStateStyle("styles"), _this64._fileAttachmentsType = t, _this64._openModalOnce = ((h = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (f = (u = i.files) == null ? void 0 : u.infoModal) == null ? void 0 : f.openModalOnce;
12323
+ return _this64;
12375
12324
  }
12376
12325
  _inherits(xt, _Bt3);
12377
12326
  return _createClass(xt, [{
@@ -12498,26 +12447,26 @@ var Fe = /*#__PURE__*/function () {
12498
12447
  }, {
12499
12448
  key: "useValidationFunc",
12500
12449
  value: function () {
12501
- var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee111(e, t, i, n) {
12450
+ var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee110(e, t, i, n) {
12502
12451
  var r, o, a, l;
12503
- return _regeneratorRuntime().wrap(function _callee111$(_context111) {
12504
- while (1) switch (_context111.prev = _context111.next) {
12452
+ return _regeneratorRuntime().wrap(function _callee110$(_context110) {
12453
+ while (1) switch (_context110.prev = _context110.next) {
12505
12454
  case 0:
12506
12455
  r = t.inputElementRef, o = r.classList.contains("text-input-placeholder") ? "" : r.textContent;
12507
- _context111.next = 3;
12456
+ _context110.next = 3;
12508
12457
  return i.completePlaceholders();
12509
12458
  case 3:
12510
12459
  a = i.getAllFileData(), l = a == null ? void 0 : a.map(function (c) {
12511
12460
  return c.file;
12512
12461
  });
12513
- return _context111.abrupt("return", Fe.validate(e, n, o, l));
12462
+ return _context110.abrupt("return", Fe.validate(e, n, o, l));
12514
12463
  case 5:
12515
12464
  case "end":
12516
- return _context111.stop();
12465
+ return _context110.stop();
12517
12466
  }
12518
- }, _callee111);
12467
+ }, _callee110);
12519
12468
  }));
12520
- function useValidationFunc(_x195, _x196, _x197, _x198) {
12469
+ function useValidationFunc(_x194, _x195, _x196, _x197) {
12521
12470
  return _useValidationFunc.apply(this, arguments);
12522
12471
  }
12523
12472
  return useValidationFunc;
@@ -12525,22 +12474,22 @@ var Fe = /*#__PURE__*/function () {
12525
12474
  }, {
12526
12475
  key: "useValidationFuncProgrammatic",
12527
12476
  value: function () {
12528
- var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee112(e, t, i) {
12477
+ var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee111(e, t, i) {
12529
12478
  var r, n;
12530
- return _regeneratorRuntime().wrap(function _callee112$(_context112) {
12531
- while (1) switch (_context112.prev = _context112.next) {
12479
+ return _regeneratorRuntime().wrap(function _callee111$(_context111) {
12480
+ while (1) switch (_context111.prev = _context111.next) {
12532
12481
  case 0:
12533
12482
  n = (r = t.files) == null ? void 0 : r.map(function (o) {
12534
12483
  return o.file;
12535
12484
  });
12536
- return _context112.abrupt("return", Fe.validate(e, i, t.text, n, !0));
12485
+ return _context111.abrupt("return", Fe.validate(e, i, t.text, n, !0));
12537
12486
  case 2:
12538
12487
  case "end":
12539
- return _context112.stop();
12488
+ return _context111.stop();
12540
12489
  }
12541
- }, _callee112);
12490
+ }, _callee111);
12542
12491
  }));
12543
- function useValidationFuncProgrammatic(_x199, _x200, _x201) {
12492
+ function useValidationFuncProgrammatic(_x198, _x199, _x200) {
12544
12493
  return _useValidationFuncProgrammatic.apply(this, arguments);
12545
12494
  }
12546
12495
  return useValidationFuncProgrammatic;
@@ -12556,26 +12505,26 @@ var Fe = /*#__PURE__*/function () {
12556
12505
  value: function attach(e, t, i, n, r) {
12557
12506
  var o = e.validateInput || de.processValidateInput(e);
12558
12507
  e._validationHandler = /*#__PURE__*/function () {
12559
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee113(a) {
12508
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee112(a) {
12560
12509
  var l;
12561
- return _regeneratorRuntime().wrap(function _callee113$(_context113) {
12562
- while (1) switch (_context113.prev = _context113.next) {
12510
+ return _regeneratorRuntime().wrap(function _callee112$(_context112) {
12511
+ while (1) switch (_context112.prev = _context112.next) {
12563
12512
  case 0:
12564
12513
  if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !Fe.validateWebsocket(t, r))) {
12565
- _context113.next = 2;
12514
+ _context112.next = 2;
12566
12515
  break;
12567
12516
  }
12568
- return _context113.abrupt("return", !1);
12517
+ return _context112.abrupt("return", !1);
12569
12518
  case 2:
12570
12519
  l = o || t.canSendMessage;
12571
- return _context113.abrupt("return", l ? a ? Fe.useValidationFuncProgrammatic(l, a, r) : Fe.useValidationFunc(l, i, n, r) : null);
12520
+ return _context112.abrupt("return", l ? a ? Fe.useValidationFuncProgrammatic(l, a, r) : Fe.useValidationFunc(l, i, n, r) : null);
12572
12521
  case 4:
12573
12522
  case "end":
12574
- return _context113.stop();
12523
+ return _context112.stop();
12575
12524
  }
12576
- }, _callee113);
12525
+ }, _callee112);
12577
12526
  }));
12578
- return function (_x202) {
12527
+ return function (_x201) {
12579
12528
  return _ref15.apply(this, arguments);
12580
12529
  };
12581
12530
  }();
@@ -12599,11 +12548,11 @@ var ds = /*#__PURE__*/function () {
12599
12548
  }();
12600
12549
  var oa = /*#__PURE__*/function (_Lt2) {
12601
12550
  function oa(e, t) {
12602
- var _this66;
12551
+ var _this65;
12603
12552
  _classCallCheck(this, oa);
12604
12553
  var i, n;
12605
- _this66 = _callSuper(this, oa, [t.button]), _this66._waitingForBrowserApproval = !1, _this66._audioType = e, _this66._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this66._maxDurationSeconds = (n = t.files) == null ? void 0 : n.maxDurationSeconds, _this66.elementRef.onclick = _this66.buttonClick.bind(_assertThisInitialized(_this66));
12606
- return _this66;
12554
+ _this65 = _callSuper(this, oa, [t.button]), _this65._waitingForBrowserApproval = !1, _this65._audioType = e, _this65._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this65._maxDurationSeconds = (n = t.files) == null ? void 0 : n.maxDurationSeconds, _this65.elementRef.onclick = _this65.buttonClick.bind(_assertThisInitialized(_this65));
12555
+ return _this65;
12607
12556
  }
12608
12557
  _inherits(oa, _Lt2);
12609
12558
  return _createClass(oa, [{
@@ -12614,10 +12563,10 @@ var oa = /*#__PURE__*/function (_Lt2) {
12614
12563
  }, {
12615
12564
  key: "stop",
12616
12565
  value: function stop() {
12617
- var _this67 = this;
12566
+ var _this66 = this;
12618
12567
  return new Promise(function (e) {
12619
12568
  var t, i;
12620
- _this67.changeToDefault(), (t = _this67._mediaRecorder) == null || t.stop(), (i = _this67._mediaStream) == null || i.getTracks().forEach(function (n) {
12569
+ _this66.changeToDefault(), (t = _this66._mediaRecorder) == null || t.stop(), (i = _this66._mediaStream) == null || i.getTracks().forEach(function (n) {
12621
12570
  return n.stop();
12622
12571
  }), setTimeout(function () {
12623
12572
  e();
@@ -12627,23 +12576,23 @@ var oa = /*#__PURE__*/function (_Lt2) {
12627
12576
  }, {
12628
12577
  key: "record",
12629
12578
  value: function record() {
12630
- var _this68 = this;
12579
+ var _this67 = this;
12631
12580
  navigator.mediaDevices.getUserMedia({
12632
12581
  audio: !0
12633
12582
  }).then(function (e) {
12634
- _this68.changeToActive(), _this68._mediaRecorder = new MediaRecorder(e), _this68._audioType.addPlaceholderAttachment(_this68.stop.bind(_this68), _this68._maxDurationSeconds), _this68._mediaStream = e, _this68._mediaRecorder.addEventListener("dataavailable", function (t) {
12635
- _this68.createFile(t);
12636
- }), _this68._mediaRecorder.start();
12583
+ _this67.changeToActive(), _this67._mediaRecorder = new MediaRecorder(e), _this67._audioType.addPlaceholderAttachment(_this67.stop.bind(_this67), _this67._maxDurationSeconds), _this67._mediaStream = e, _this67._mediaRecorder.addEventListener("dataavailable", function (t) {
12584
+ _this67.createFile(t);
12585
+ }), _this67._mediaRecorder.start();
12637
12586
  })["catch"](function (e) {
12638
- console.error(e), _this68.stop();
12587
+ console.error(e), _this67.stop();
12639
12588
  })["finally"](function () {
12640
- _this68._waitingForBrowserApproval = !1;
12589
+ _this67._waitingForBrowserApproval = !1;
12641
12590
  });
12642
12591
  }
12643
12592
  }, {
12644
12593
  key: "createFile",
12645
12594
  value: function createFile(e) {
12646
- var _this69 = this;
12595
+ var _this68 = this;
12647
12596
  var t = new Blob([e.data], {
12648
12597
  type: "audio/".concat(this._extension)
12649
12598
  }),
@@ -12653,7 +12602,7 @@ var oa = /*#__PURE__*/function (_Lt2) {
12653
12602
  }),
12654
12603
  r = new FileReader();
12655
12604
  r.readAsDataURL(n), r.onload = function (o) {
12656
- _this69._audioType.completePlaceholderAttachment(n, o.target.result);
12605
+ _this68._audioType.completePlaceholderAttachment(n, o.target.result);
12657
12606
  };
12658
12607
  }
12659
12608
  }]);
@@ -12728,19 +12677,19 @@ var Ve = /*#__PURE__*/function () {
12728
12677
  var k = /*#__PURE__*/function (_Bt4) {
12729
12678
  // prettier-ignore
12730
12679
  function k(e, t, i, n, r, o) {
12731
- var _this70;
12680
+ var _this69;
12732
12681
  _classCallCheck(this, k);
12733
12682
  var a = Ve.process(e.submitButtonStyles);
12734
- _this70 = _callSuper(this, k, [k.createButtonContainerElement(), a == null ? void 0 : a.position, a]), _this70._isSVGLoadingIconOverriden = !1, _this70.status = {
12683
+ _this69 = _callSuper(this, k, [k.createButtonContainerElement(), a == null ? void 0 : a.position, a]), _this69._isSVGLoadingIconOverriden = !1, _this69.status = {
12735
12684
  requestInProgress: !1,
12736
12685
  loadingActive: !1
12737
- }, _this70._messages = i, _this70._inputElementRef = t, _this70._fileAttachments = r, _this70._innerElements = _this70.createInnerElements(), _this70._abortStream = new AbortController(), _this70._stopClicked = {
12686
+ }, _this69._messages = i, _this69._inputElementRef = t, _this69._fileAttachments = r, _this69._innerElements = _this69.createInnerElements(), _this69._abortStream = new AbortController(), _this69._stopClicked = {
12738
12687
  listener: function listener() {}
12739
- }, _this70._serviceIO = n, _this70._alwaysEnabled = !!(a != null && a.alwaysEnabled), e.disableSubmitButton = _this70.disableSubmitButton.bind(_assertThisInitialized(_this70), n), _this70.attemptOverwriteLoadingStyle(e), o.microphone && _this70.setUpSpeechToText(o.microphone.button, e.speechToText), setTimeout(function () {
12688
+ }, _this69._serviceIO = n, _this69._alwaysEnabled = !!(a != null && a.alwaysEnabled), e.disableSubmitButton = _this69.disableSubmitButton.bind(_assertThisInitialized(_this69), n), _this69.attemptOverwriteLoadingStyle(e), o.microphone && _this69.setUpSpeechToText(o.microphone.button, e.speechToText), setTimeout(function () {
12740
12689
  var l;
12741
- _this70._validationHandler = e._validationHandler, _this70.assignHandlers(_this70._validationHandler), (l = _this70._validationHandler) == null || l.call(_assertThisInitialized(_this70));
12690
+ _this69._validationHandler = e._validationHandler, _this69.assignHandlers(_this69._validationHandler), (l = _this69._validationHandler) == null || l.call(_assertThisInitialized(_this69));
12742
12691
  });
12743
- return _this70;
12692
+ return _this69;
12744
12693
  }
12745
12694
  _inherits(k, _Bt4);
12746
12695
  return _createClass(k, [{
@@ -12761,7 +12710,7 @@ var k = /*#__PURE__*/function (_Bt4) {
12761
12710
  }, {
12762
12711
  key: "createCustomElements",
12763
12712
  value: function createCustomElements() {
12764
- var _this71 = this;
12713
+ var _this70 = this;
12765
12714
  var e = J.createSpecificStateElement(this.elementRef, "submit", this._customStyles),
12766
12715
  t = {
12767
12716
  loading: void 0,
@@ -12769,7 +12718,7 @@ var k = /*#__PURE__*/function (_Bt4) {
12769
12718
  };
12770
12719
  return Object.keys(t).forEach(function (i) {
12771
12720
  var n = i,
12772
- r = J.createCustomElement(n, _this71._customStyles);
12721
+ r = J.createCustomElement(n, _this70._customStyles);
12773
12722
  r && (t[n] = r);
12774
12723
  }), t.submit = e, t;
12775
12724
  }
@@ -12815,12 +12764,12 @@ var k = /*#__PURE__*/function (_Bt4) {
12815
12764
  }, {
12816
12765
  key: "submitFromInput",
12817
12766
  value: function () {
12818
- var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee114() {
12767
+ var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee113() {
12819
12768
  var t, e, _i22;
12820
- return _regeneratorRuntime().wrap(function _callee114$(_context114) {
12821
- while (1) switch (_context114.prev = _context114.next) {
12769
+ return _regeneratorRuntime().wrap(function _callee113$(_context113) {
12770
+ while (1) switch (_context113.prev = _context113.next) {
12822
12771
  case 0:
12823
- _context114.next = 2;
12772
+ _context113.next = 2;
12824
12773
  return this._fileAttachments.completePlaceholders();
12825
12774
  case 2:
12826
12775
  e = this._fileAttachments.getAllFileData();
@@ -12836,9 +12785,9 @@ var k = /*#__PURE__*/function (_Bt4) {
12836
12785
  }
12837
12786
  case 4:
12838
12787
  case "end":
12839
- return _context114.stop();
12788
+ return _context113.stop();
12840
12789
  }
12841
- }, _callee114, this);
12790
+ }, _callee113, this);
12842
12791
  }));
12843
12792
  function submitFromInput() {
12844
12793
  return _submitFromInput.apply(this, arguments);
@@ -12848,11 +12797,11 @@ var k = /*#__PURE__*/function (_Bt4) {
12848
12797
  }, {
12849
12798
  key: "programmaticSubmit",
12850
12799
  value: function () {
12851
- var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee115(e) {
12852
- var _this72 = this;
12800
+ var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee114(e) {
12801
+ var _this71 = this;
12853
12802
  var t;
12854
- return _regeneratorRuntime().wrap(function _callee115$(_context115) {
12855
- while (1) switch (_context115.prev = _context115.next) {
12803
+ return _regeneratorRuntime().wrap(function _callee114$(_context114) {
12804
+ while (1) switch (_context114.prev = _context114.next) {
12856
12805
  case 0:
12857
12806
  typeof e == "string" && (e = de.processSubmitUserMessage(e));
12858
12807
  t = {
@@ -12864,15 +12813,15 @@ var k = /*#__PURE__*/function (_Bt4) {
12864
12813
  type: Ee.getTypeFromBlob(i)
12865
12814
  };
12866
12815
  })), setTimeout(function () {
12867
- return _this72.attemptSubmit(t, !0);
12816
+ return _this71.attemptSubmit(t, !0);
12868
12817
  });
12869
12818
  case 3:
12870
12819
  case "end":
12871
- return _context115.stop();
12820
+ return _context114.stop();
12872
12821
  }
12873
- }, _callee115);
12822
+ }, _callee114);
12874
12823
  }));
12875
- function programmaticSubmit(_x203) {
12824
+ function programmaticSubmit(_x202) {
12876
12825
  return _programmaticSubmit.apply(this, arguments);
12877
12826
  }
12878
12827
  return programmaticSubmit;
@@ -12880,31 +12829,31 @@ var k = /*#__PURE__*/function (_Bt4) {
12880
12829
  }, {
12881
12830
  key: "attemptSubmit",
12882
12831
  value: function () {
12883
- var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee116(e) {
12832
+ var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee115(e) {
12884
12833
  var t,
12885
12834
  r,
12886
12835
  o,
12887
12836
  a,
12888
12837
  i,
12889
12838
  n,
12890
- _args116 = arguments;
12891
- return _regeneratorRuntime().wrap(function _callee116$(_context116) {
12892
- while (1) switch (_context116.prev = _context116.next) {
12839
+ _args115 = arguments;
12840
+ return _regeneratorRuntime().wrap(function _callee115$(_context115) {
12841
+ while (1) switch (_context115.prev = _context115.next) {
12893
12842
  case 0:
12894
- t = _args116.length > 1 && _args116[1] !== undefined ? _args116[1] : !1;
12895
- _context116.next = 3;
12843
+ t = _args115.length > 1 && _args115[1] !== undefined ? _args115[1] : !1;
12844
+ _context115.next = 3;
12896
12845
  return (r = this._validationHandler) == null ? void 0 : r.call(this, t ? e : void 0);
12897
12846
  case 3:
12898
- _context116.t0 = _context116.sent;
12899
- _context116.t1 = !1;
12900
- if (!(_context116.t0 === _context116.t1)) {
12901
- _context116.next = 7;
12847
+ _context115.t0 = _context115.sent;
12848
+ _context115.t1 = !1;
12849
+ if (!(_context115.t0 === _context115.t1)) {
12850
+ _context115.next = 7;
12902
12851
  break;
12903
12852
  }
12904
- return _context116.abrupt("return");
12853
+ return _context115.abrupt("return");
12905
12854
  case 7:
12906
12855
  this.changeToLoadingIcon();
12907
- _context116.next = 10;
12856
+ _context115.next = 10;
12908
12857
  return this.addNewMessage(e);
12909
12858
  case 10:
12910
12859
  this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
@@ -12915,17 +12864,17 @@ var k = /*#__PURE__*/function (_Bt4) {
12915
12864
  text: e.text === "" ? void 0 : e.text,
12916
12865
  files: i
12917
12866
  };
12918
- _context116.next = 15;
12867
+ _context115.next = 15;
12919
12868
  return this._serviceIO.callAPI(n, this._messages);
12920
12869
  case 15:
12921
12870
  (a = this._fileAttachments) == null || a.removeAllFiles();
12922
12871
  case 16:
12923
12872
  case "end":
12924
- return _context116.stop();
12873
+ return _context115.stop();
12925
12874
  }
12926
- }, _callee116, this);
12875
+ }, _callee115, this);
12927
12876
  }));
12928
- function attemptSubmit(_x204) {
12877
+ function attemptSubmit(_x203) {
12929
12878
  return _attemptSubmit.apply(this, arguments);
12930
12879
  }
12931
12880
  return attemptSubmit;
@@ -12933,35 +12882,35 @@ var k = /*#__PURE__*/function (_Bt4) {
12933
12882
  }, {
12934
12883
  key: "addNewMessage",
12935
12884
  value: function () {
12936
- var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee117(_ref16) {
12885
+ var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee116(_ref16) {
12937
12886
  var e, t, i;
12938
- return _regeneratorRuntime().wrap(function _callee117$(_context117) {
12939
- while (1) switch (_context117.prev = _context117.next) {
12887
+ return _regeneratorRuntime().wrap(function _callee116$(_context116) {
12888
+ while (1) switch (_context116.prev = _context116.next) {
12940
12889
  case 0:
12941
12890
  e = _ref16.text, t = _ref16.files;
12942
12891
  i = {
12943
12892
  role: b.USER_ROLE
12944
12893
  };
12945
12894
  e && (i.text = e);
12946
- _context117.t0 = t;
12947
- if (!_context117.t0) {
12948
- _context117.next = 8;
12895
+ _context116.t0 = t;
12896
+ if (!_context116.t0) {
12897
+ _context116.next = 8;
12949
12898
  break;
12950
12899
  }
12951
- _context117.next = 7;
12900
+ _context116.next = 7;
12952
12901
  return this._messages.addMultipleFiles(t);
12953
12902
  case 7:
12954
- i.files = _context117.sent;
12903
+ i.files = _context116.sent;
12955
12904
  case 8:
12956
12905
  this._serviceIO.sessionId && (i._sessionId = this._serviceIO.sessionId);
12957
12906
  Object.keys(i).length > 0 && this._messages.addNewMessage(i);
12958
12907
  case 10:
12959
12908
  case "end":
12960
- return _context117.stop();
12909
+ return _context116.stop();
12961
12910
  }
12962
- }, _callee117, this);
12911
+ }, _callee116, this);
12963
12912
  }));
12964
- function addNewMessage(_x205) {
12913
+ function addNewMessage(_x204) {
12965
12914
  return _addNewMessage.apply(this, arguments);
12966
12915
  }
12967
12916
  return addNewMessage;
@@ -12986,10 +12935,10 @@ var k = /*#__PURE__*/function (_Bt4) {
12986
12935
  }, {
12987
12936
  key: "changeToSubmitIcon",
12988
12937
  value: function changeToSubmitIcon() {
12989
- var _this73 = this;
12938
+ var _this72 = this;
12990
12939
  this.elementRef.classList.contains(k.SUBMIT_CLASS) || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS), this.elementRef.classList.add(k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.submit), Ve.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
12991
12940
  var e;
12992
- _this73.submitFromInput(), (e = _this73._microphoneButton) != null && e.isActive && Ot.toggleSpeechAfterSubmit(_this73._microphoneButton.elementRef, !!_this73._stopSTTAfterSubmit);
12941
+ _this72.submitFromInput(), (e = _this72._microphoneButton) != null && e.isActive && Ot.toggleSpeechAfterSubmit(_this72._microphoneButton.elementRef, !!_this72._stopSTTAfterSubmit);
12993
12942
  });
12994
12943
  }
12995
12944
  // called every time when user triggers an input via ValidationHandler - hence use class to check if not already present
@@ -13040,14 +12989,14 @@ var la = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
13040
12989
  var bn = /*#__PURE__*/function (_ze) {
13041
12990
  // prettier-ignore
13042
12991
  function bn(e, t, i, n) {
13043
- var _this74;
12992
+ var _this73;
13044
12993
  _classCallCheck(this, bn);
13045
- _this74 = _callSuper(this, bn, [e, ["modal-content", "modal-camera-content"], i]), _this74._stopped = !1, _this74._format = "image/png", _this74._canvas = document.createElement("canvas"), _this74._canvas.classList.add("camera-modal-canvas");
13046
- var _this74$addButtonsAnd = _this74.addButtonsAndTheirEvents(t),
13047
- r = _this74$addButtonsAnd.captureButton,
13048
- o = _this74$addButtonsAnd.submitButton;
13049
- _this74._captureButton = r, _this74._submitButton = o, _this74._captureIcon = _this74._captureButton.children[0], _this74._refreshIcon = X.createSVGElement(la), _this74._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this74._format = "image/jpeg"), n != null && n.dimensions && (_this74._dimensions = n.dimensions), _this74._contentRef.appendChild(_this74._canvas), _this74.extensionCloseCallback = _this74.stop;
13050
- return _this74;
12994
+ _this73 = _callSuper(this, bn, [e, ["modal-content", "modal-camera-content"], i]), _this73._stopped = !1, _this73._format = "image/png", _this73._canvas = document.createElement("canvas"), _this73._canvas.classList.add("camera-modal-canvas");
12995
+ var _this73$addButtonsAnd = _this73.addButtonsAndTheirEvents(t),
12996
+ r = _this73$addButtonsAnd.captureButton,
12997
+ o = _this73$addButtonsAnd.submitButton;
12998
+ _this73._captureButton = r, _this73._submitButton = o, _this73._captureIcon = _this73._captureButton.children[0], _this73._refreshIcon = X.createSVGElement(la), _this73._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (n == null ? void 0 : n.format) === "jpeg" && (_this73._format = "image/jpeg"), n != null && n.dimensions && (_this73._dimensions = n.dimensions), _this73._contentRef.appendChild(_this73._canvas), _this73.extensionCloseCallback = _this73.stop;
12999
+ return _this73;
13051
13000
  }
13052
13001
  _inherits(bn, _ze);
13053
13002
  return _createClass(bn, [{
@@ -13067,38 +13016,38 @@ var bn = /*#__PURE__*/function (_ze) {
13067
13016
  }, {
13068
13017
  key: "addButtonEvents",
13069
13018
  value: function addButtonEvents(e, t, i, n) {
13070
- var _this75 = this;
13019
+ var _this74 = this;
13071
13020
  e.onclick = function () {
13072
- _this75.capture();
13021
+ _this74.capture();
13073
13022
  }, t.addEventListener("click", this.stop.bind(this)), i.onclick = function () {
13074
- var r = _this75.getFile();
13075
- r && zt.addFilesToType([r], [n]), _this75.stop(), _this75.close();
13023
+ var r = _this74.getFile();
13024
+ r && zt.addFilesToType([r], [n]), _this74.stop(), _this74.close();
13076
13025
  };
13077
13026
  }
13078
13027
  }, {
13079
13028
  key: "stop",
13080
13029
  value: function stop() {
13081
- var _this76 = this;
13030
+ var _this75 = this;
13082
13031
  this._mediaStream && this._mediaStream.getTracks().forEach(function (e) {
13083
13032
  return e.stop();
13084
13033
  }), this._stopped = !0, setTimeout(function () {
13085
- _this76._captureButton.replaceChildren(_this76._captureIcon), _this76._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
13086
- var e = _this76._canvas.getContext("2d");
13087
- e == null || e.clearRect(0, 0, _this76._canvas.width, _this76._canvas.height);
13034
+ _this75._captureButton.replaceChildren(_this75._captureIcon), _this75._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
13035
+ var e = _this75._canvas.getContext("2d");
13036
+ e == null || e.clearRect(0, 0, _this75._canvas.width, _this75._canvas.height);
13088
13037
  }, ze.MODAL_CLOSE_TIMEOUT_MS);
13089
13038
  }
13090
13039
  }, {
13091
13040
  key: "start",
13092
13041
  value: function start() {
13093
- var _this77 = this;
13042
+ var _this76 = this;
13094
13043
  this._dataURL = void 0, this._submitButton.classList.add("modal-svg-submit-disabled"), this._stopped = !1, navigator.mediaDevices.getUserMedia({
13095
13044
  video: this._dimensions || !0
13096
13045
  }).then(function (e) {
13097
- if (_this77._mediaStream = e, !_this77.isOpen()) return _this77.stop();
13046
+ if (_this76._mediaStream = e, !_this76.isOpen()) return _this76.stop();
13098
13047
  var t = document.createElement("video");
13099
- t.srcObject = e, t.play(), requestAnimationFrame(_this77.updateCanvas.bind(_this77, t, _this77._canvas));
13048
+ t.srcObject = e, t.play(), requestAnimationFrame(_this76.updateCanvas.bind(_this76, t, _this76._canvas));
13100
13049
  })["catch"](function (e) {
13101
- console.error(e), _this77.stop(), _this77.close();
13050
+ console.error(e), _this76.stop(), _this76.close();
13102
13051
  });
13103
13052
  }
13104
13053
  }, {
@@ -13153,13 +13102,13 @@ var bn = /*#__PURE__*/function (_ze) {
13153
13102
  var ua = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M29 7h-4.599l-2.401-4h-12l-2.4 4h-4.6c-1 0-3 1-3 2.969v16.031c0 1.657 1.5 3 2.792 3h26.271c1.313 0 2.938-1.406 2.938-2.968v-16.032c0-1-1-3-3-3zM30 26.032c0 0.395-0.639 0.947-0.937 0.969h-26.265c-0.232-0.019-0.797-0.47-0.797-1v-16.031c0-0.634 0.851-0.953 1-0.969h5.732l2.4-4h9.802l1.785 3.030 0.55 0.97h5.731c0.705 0 0.99 0.921 1 1v16.032zM16 10c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zM16 22c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z\"></path>\n</svg>";
13154
13103
  var mi = /*#__PURE__*/function (_Bt5) {
13155
13104
  function mi(e, t, i) {
13156
- var _this78;
13105
+ var _this77;
13157
13106
  _classCallCheck(this, mi);
13158
13107
  var r;
13159
- _this78 = _callSuper(this, mi, [mi.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo"]);
13160
- var n = _this78.createInnerElements(_this78._customStyles);
13161
- i && _this78.addClickEvent(e, t, i.modalContainerStyle, i.files), _this78.elementRef.classList.add("upload-file-button"), _this78.elementRef.appendChild(n.styles), _this78.reapplyStateStyle("styles");
13162
- return _this78;
13108
+ _this77 = _callSuper(this, mi, [mi.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo"]);
13109
+ var n = _this77.createInnerElements(_this77._customStyles);
13110
+ i && _this77.addClickEvent(e, t, i.modalContainerStyle, i.files), _this77.elementRef.classList.add("upload-file-button"), _this77.elementRef.appendChild(n.styles), _this77.reapplyStateStyle("styles");
13111
+ return _this77;
13163
13112
  }
13164
13113
  _inherits(mi, _Bt5);
13165
13114
  return _createClass(mi, [{
@@ -13301,22 +13250,22 @@ var pa = Object.defineProperty,
13301
13250
  };
13302
13251
  var y = /*#__PURE__*/function (_Xi) {
13303
13252
  function y() {
13304
- var _this79;
13253
+ var _this78;
13305
13254
  _classCallCheck(this, y);
13306
- _this79 = _callSuper(this, y), _this79.getMessages = function () {
13255
+ _this78 = _callSuper(this, y), _this78.getMessages = function () {
13307
13256
  return [];
13308
- }, _this79.submitUserMessage = function () {
13257
+ }, _this78.submitUserMessage = function () {
13309
13258
  return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
13310
- }, _this79.addMessage = function () {
13259
+ }, _this78.addMessage = function () {
13311
13260
  return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
13312
- }, _this79.focusInput = function () {
13313
- return yi.focusFromParentElement(_this79._elementRef);
13314
- }, _this79.refreshMessages = function () {}, _this79.clearMessages = function () {}, _this79.scrollToBottom = function () {}, _this79.disableSubmitButton = function () {}, _this79._hasBeenRendered = !1, _this79._auxiliaryStyleApplied = !1, _this79._elementRef = document.createElement("div"), _this79._elementRef.id = "container", _this79.attachShadow({
13261
+ }, _this78.focusInput = function () {
13262
+ return yi.focusFromParentElement(_this78._elementRef);
13263
+ }, _this78.refreshMessages = function () {}, _this78.clearMessages = function () {}, _this78.scrollToBottom = function () {}, _this78.disableSubmitButton = function () {}, _this78._hasBeenRendered = !1, _this78._auxiliaryStyleApplied = !1, _this78._elementRef = document.createElement("div"), _this78._elementRef.id = "container", _this78.attachShadow({
13315
13264
  mode: "open"
13316
- }).appendChild(_this79._elementRef), bt.apply(fa, _this79.shadowRoot), setTimeout(function () {
13317
- _this79._hasBeenRendered || _this79.onRender();
13265
+ }).appendChild(_this78._elementRef), bt.apply(fa, _this78.shadowRoot), setTimeout(function () {
13266
+ _this78._hasBeenRendered || _this78.onRender();
13318
13267
  }, 20);
13319
- return _this79;
13268
+ return _this78;
13320
13269
  }
13321
13270
  _inherits(y, _Xi);
13322
13271
  return _createClass(y, [{