deep-chat-dev 9.0.192 → 9.0.194

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
@@ -198,14 +198,14 @@ ct.DEFAULT_COMPONENT_STYLE = {
198
198
  // this is also causing the chat to squeeze when there is no space
199
199
  overflow: "hidden"
200
200
  };
201
- var _t = ct;
202
- var P = /* @__PURE__ */function (n) {
203
- return n.ESCAPE = "Escape", n.ENTER = "Enter", n.TAB = "Tab", n.ARROW_UP = "ArrowUp", n.ARROW_DOWN = "ArrowDown", n.ARROW_RIGHT = "ArrowRight", n.ARROW_LEFT = "ArrowLeft", n.BACKSPACE = "Backspace", n.DELETE = "Delete", n.META = "Meta", n.CONTROL = "Control", n;
204
- }(P || {}),
205
- Ze;
206
- var Pt = (Ze = /*#__PURE__*/_createClass(function Ze() {
201
+ var St = ct;
202
+ var Ze;
203
+ var gt = (Ze = /*#__PURE__*/_createClass(function Ze() {
207
204
  _classCallCheck(this, Ze);
208
205
  }), Ze.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent), Ze.IS_CHROMIUM = window.chrome, Ze);
206
+ var P = /* @__PURE__ */function (n) {
207
+ return n.ESCAPE = "Escape", n.ENTER = "Enter", n.TAB = "Tab", n.ARROW_UP = "ArrowUp", n.ARROW_DOWN = "ArrowDown", n.ARROW_RIGHT = "ArrowRight", n.ARROW_LEFT = "ArrowLeft", n.BACKSPACE = "Backspace", n.DELETE = "Delete", n.META = "Meta", n.CONTROL = "Control", n;
208
+ }(P || {});
209
209
  var ze = /*#__PURE__*/function () {
210
210
  function ze() {
211
211
  _classCallCheck(this, ze);
@@ -275,7 +275,7 @@ var Ve = /*#__PURE__*/function () {
275
275
  function clear() {
276
276
  var t;
277
277
  var e = window.scrollY;
278
- this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", Vt.focusEndOfInput(this.inputElementRef)), Pt.IS_CHROMIUM && window.scrollTo({
278
+ this.inputElementRef.classList.contains("text-input-disabled") || (Object.assign(this.inputElementRef.style, (t = this._config.placeholder) == null ? void 0 : t.style), this.inputElementRef.textContent = "", Vt.focusEndOfInput(this.inputElementRef)), gt.IS_CHROMIUM && window.scrollTo({
279
279
  top: e
280
280
  });
281
281
  }
@@ -284,7 +284,7 @@ var Ve = /*#__PURE__*/function () {
284
284
  value: function createInputElement() {
285
285
  var t, i, s, r;
286
286
  var e = document.createElement("div");
287
- return e.id = Ve.TEXT_INPUT_ID, e.classList.add("text-input-styling"), Pt.IS_CHROMIUM && Ve.preventAutomaticScrollUpOnNewLine(e), typeof this._config.disabled == "boolean" && this._config.disabled === !0 ? (e.contentEditable = "false", e.classList.add("text-input-disabled")) : (e.contentEditable = "true", this.addEventListeners(e)), Object.assign(e.style, (t = this._config.styles) == null ? void 0 : t.text), Object.assign(e.style, (i = this._config.placeholder) == null ? void 0 : i.style), (r = (s = this._config.placeholder) == null ? void 0 : s.style) != null && r.color || e.setAttribute("textcolor", ""), e;
287
+ return e.id = Ve.TEXT_INPUT_ID, e.classList.add("text-input-styling"), gt.IS_CHROMIUM && Ve.preventAutomaticScrollUpOnNewLine(e), typeof this._config.disabled == "boolean" && this._config.disabled === !0 ? (e.contentEditable = "false", e.classList.add("text-input-disabled")) : (e.contentEditable = "true", this.addEventListeners(e)), Object.assign(e.style, (t = this._config.styles) == null ? void 0 : t.text), Object.assign(e.style, (i = this._config.placeholder) == null ? void 0 : i.style), (r = (s = this._config.placeholder) == null ? void 0 : s.style) != null && r.color || e.setAttribute("textcolor", ""), e;
288
288
  }
289
289
  }, {
290
290
  key: "removePlaceholderStyle",
@@ -379,7 +379,7 @@ var Vt = /*#__PURE__*/function () {
379
379
  key: "focusFromParentElement",
380
380
  value: function focusFromParentElement(e) {
381
381
  var t = e.querySelector("#".concat(oi.TEXT_INPUT_ID));
382
- t && Vt.focusEndOfInput(t);
382
+ t && (gt.IS_SAFARI && t.focus(), Vt.focusEndOfInput(t));
383
383
  }
384
384
  }]);
385
385
  }();
@@ -666,7 +666,7 @@ var Sn = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
666
666
  }]);
667
667
  }();
668
668
  Y.CONTAINER_CLASS = "avatar-container";
669
- var St = Y;
669
+ var wt = Y;
670
670
  var me = /*#__PURE__*/function () {
671
671
  function me() {
672
672
  _classCallCheck(this, me);
@@ -719,7 +719,7 @@ var me = /*#__PURE__*/function () {
719
719
  }]);
720
720
  }();
721
721
  me.NAME_CLASS = "name";
722
- var wt = me;
722
+ var Ct = me;
723
723
  var ce = /*#__PURE__*/function () {
724
724
  function ce() {
725
725
  _classCallCheck(this, ce);
@@ -801,18 +801,18 @@ var ce = /*#__PURE__*/function () {
801
801
  }, {
802
802
  key: "addRoleElements",
803
803
  value: function addRoleElements(e, t, i, s) {
804
- i && St.add(e, t, i), s && wt.add(e, t, s);
804
+ i && wt.add(e, t, i), s && Ct.add(e, t, s);
805
805
  }
806
806
  }, {
807
807
  key: "hideRoleElements",
808
808
  value: function hideRoleElements(e, t, i) {
809
809
  var s = e[e.length - 1].innerContainer;
810
- t && St.hide(s), i && wt.hide(s);
810
+ t && wt.hide(s), i && Ct.hide(s);
811
811
  }
812
812
  }, {
813
813
  key: "revealRoleElements",
814
814
  value: function revealRoleElements(e, t, i) {
815
- t && St.reveal(e), i && wt.reveal(e);
815
+ t && wt.reveal(e), i && Ct.reveal(e);
816
816
  }
817
817
  }, {
818
818
  key: "updateRefArr",
@@ -1924,7 +1924,7 @@ function nr(n, e, t, i) {
1924
1924
  Z,
1925
1925
  D,
1926
1926
  Be,
1927
- yt;
1927
+ Et;
1928
1928
  if ((h = Ps(n, e)) >= 0) y = !0;else if ((h = Ls(n, e)) >= 0) y = !1;else return !1;
1929
1929
  if (n.level >= n.options.maxNesting) return !1;
1930
1930
  if (p = n.src.charCodeAt(h - 1), i) return !0;
@@ -1945,11 +1945,11 @@ function nr(n, e, t, i) {
1945
1945
  type: "list_item_close",
1946
1946
  level: --n.level
1947
1947
  }), s = e = n.line, R[1] = s, x = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
1948
- for (yt = !1, D = 0, Be = Z.length; D < Be; D++) if (Z[D](n, s, t, !0)) {
1949
- yt = !0;
1948
+ for (Et = !1, D = 0, Be = Z.length; D < Be; D++) if (Z[D](n, s, t, !0)) {
1949
+ Et = !0;
1950
1950
  break;
1951
1951
  }
1952
- if (yt) break;
1952
+ if (Et) break;
1953
1953
  if (y) {
1954
1954
  if (h = Ps(n, s), h < 0) break;
1955
1955
  } else if (h = Ls(n, s), h < 0) break;
@@ -3912,7 +3912,7 @@ var T = /*#__PURE__*/function () {
3912
3912
  },
3913
3913
  onmessage: function onmessage(R) {
3914
3914
  return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3915
- var X, Z, D, Be, yt;
3915
+ var X, Z, D, Be, Et;
3916
3916
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3917
3917
  while (1) switch (_context6.prev = _context6.next) {
3918
3918
  case 0:
@@ -3935,8 +3935,8 @@ var T = /*#__PURE__*/function () {
3935
3935
  }
3936
3936
  _context6.t0 = Be;
3937
3937
  case 7:
3938
- yt = _context6.t0;
3939
- (D = e.extractResultData) == null || D.call(e, yt, m, a).then(function (Ue) {
3938
+ Et = _context6.t0;
3939
+ (D = e.extractResultData) == null || D.call(e, Et, m, a).then(function (Ue) {
3940
3940
  e.asyncCallInProgress && Ue && Ue.text !== "" ? (T.simulate(i, e.streamHandlers, Ue), h(), e.asyncCallInProgress = !1) : T.upsertWFiles(i, f.upsertStreamedMessage.bind(f), f, Ue);
3941
3941
  })["catch"](function (Ue) {
3942
3942
  return v.displayError(i, Ue);
@@ -4961,11 +4961,11 @@ var ht = /*#__PURE__*/function () {
4961
4961
  }();
4962
4962
  ht.FAILED_ERROR_MESSAGE = "Failed to load history";
4963
4963
  var Ft = ht;
4964
- var gt = /*#__PURE__*/function () {
4965
- function gt() {
4966
- _classCallCheck(this, gt);
4964
+ var bt = /*#__PURE__*/function () {
4965
+ function bt() {
4966
+ _classCallCheck(this, bt);
4967
4967
  }
4968
- return _createClass(gt, null, [{
4968
+ return _createClass(bt, null, [{
4969
4969
  key: "getCharacterLimitMessages",
4970
4970
  value: function getCharacterLimitMessages(e, t) {
4971
4971
  var r;
@@ -4993,7 +4993,7 @@ var gt = /*#__PURE__*/function () {
4993
4993
  }, {
4994
4994
  key: "processMessages",
4995
4995
  value: function processMessages(e, t, i) {
4996
- return t !== void 0 ? t > 0 && (e = gt.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), i === void 0 ? e : gt.getCharacterLimitMessages(e, i);
4996
+ return t !== void 0 ? t > 0 && (e = bt.getMaxMessages(e, t)) : e = [e[e.length - 1]], e = JSON.parse(JSON.stringify(e)), i === void 0 ? e : bt.getCharacterLimitMessages(e, i);
4997
4997
  }
4998
4998
  }]);
4999
4999
  }();
@@ -5235,7 +5235,7 @@ var Qe = /*#__PURE__*/function () {
5235
5235
  }
5236
5236
  throw new Error("Request settings have not been set up");
5237
5237
  case 2:
5238
- i = gt.processMessages(t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
5238
+ i = bt.processMessages(t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
5239
5239
  if (this.connectSettings.websocket) {
5240
5240
  s = _objectSpread({
5241
5241
  messages: i
@@ -6363,17 +6363,17 @@ var di = /*#__PURE__*/function () {
6363
6363
  }
6364
6364
  }]);
6365
6365
  }();
6366
- var Rt = /*#__PURE__*/function (_z) {
6366
+ var It = /*#__PURE__*/function (_z) {
6367
6367
  // prettier-ignore
6368
- function Rt(e, t, i, s, r, o) {
6368
+ function It(e, t, i, s, r, o) {
6369
6369
  var _this21;
6370
- _classCallCheck(this, Rt);
6371
- _this21 = _callSuper(this, Rt, [e, di.buildKeyVerificationDetails(), di.buildHeaders, r, o]), _this21.insertKeyPlaceholderText = "Hugging Face Token", _this21.keyHelpUrl = "https://huggingface.co/settings/tokens", _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this21.permittedErrorPrefixes = ["Authorization header"], _this21.url = "".concat(Rt.URL_PREFIX).concat(i), _this21.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this21.url = "".concat(Rt.URL_PREFIX).concat(s.model)), s.options && (_this21.rawBody.options = s.options), s.parameters && (_this21.rawBody.parameters = s.parameters));
6370
+ _classCallCheck(this, It);
6371
+ _this21 = _callSuper(this, It, [e, di.buildKeyVerificationDetails(), di.buildHeaders, r, o]), _this21.insertKeyPlaceholderText = "Hugging Face Token", _this21.keyHelpUrl = "https://huggingface.co/settings/tokens", _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this21.permittedErrorPrefixes = ["Authorization header"], _this21.url = "".concat(It.URL_PREFIX).concat(i), _this21.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this21.url = "".concat(It.URL_PREFIX).concat(s.model)), s.options && (_this21.rawBody.options = s.options), s.parameters && (_this21.rawBody.parameters = s.parameters));
6372
6372
  return _this21;
6373
6373
  }
6374
6374
  // prettier-ignore
6375
- _inherits(Rt, _z);
6376
- return _createClass(Rt, [{
6375
+ _inherits(It, _z);
6376
+ return _createClass(It, [{
6377
6377
  key: "preprocessBody",
6378
6378
  value: function preprocessBody(e, t, i) {
6379
6379
  var _s$options;
@@ -6412,8 +6412,8 @@ var Rt = /*#__PURE__*/function (_z) {
6412
6412
  }()
6413
6413
  }]);
6414
6414
  }(z);
6415
- Rt.URL_PREFIX = "https://api-inference.huggingface.co/models/";
6416
- var Ie = Rt;
6415
+ It.URL_PREFIX = "https://api-inference.huggingface.co/models/";
6416
+ var Ie = It;
6417
6417
  var Gt = /*#__PURE__*/function (_Ie) {
6418
6418
  // prettier-ignore
6419
6419
  function Gt(e, t, i, s, r, o) {
@@ -8100,11 +8100,11 @@ var Io = /*#__PURE__*/function (_Ro) {
8100
8100
  }()
8101
8101
  }]);
8102
8102
  }(Ro);
8103
- var Ct = /*#__PURE__*/function () {
8104
- function Ct() {
8105
- _classCallCheck(this, Ct);
8103
+ var Tt = /*#__PURE__*/function () {
8104
+ function Tt() {
8105
+ _classCallCheck(this, Tt);
8106
8106
  }
8107
- return _createClass(Ct, null, [{
8107
+ return _createClass(Tt, null, [{
8108
8108
  key: "poll",
8109
8109
  value: function () {
8110
8110
  var _poll2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e, t) {
@@ -8200,7 +8200,7 @@ var Ct = /*#__PURE__*/function () {
8200
8200
  return {
8201
8201
  url: "https://api.assemblyai.com/v2/upload",
8202
8202
  method: "POST",
8203
- handleVerificationResult: Ct.handleVerificationResult
8203
+ handleVerificationResult: Tt.handleVerificationResult
8204
8204
  };
8205
8205
  }
8206
8206
  }]);
@@ -8211,7 +8211,7 @@ var ys = /*#__PURE__*/function (_z7) {
8211
8211
  _classCallCheck(this, ys);
8212
8212
  var i;
8213
8213
  var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
8214
- _this36 = _callSuper(this, ys, [e, Ct.buildKeyVerificationDetails(), Ct.buildHeaders, t, {
8214
+ _this36 = _callSuper(this, ys, [e, Tt.buildKeyVerificationDetails(), Tt.buildHeaders, t, {
8215
8215
  audio: {}
8216
8216
  }]), _this36.insertKeyPlaceholderText = "AssemblyAI API Key", _this36.keyHelpUrl = "https://www.assemblyai.com/app/account", _this36.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this36.url = "https://api.assemblyai.com/v2/upload", _this36.isTextInputDisabled = !0, _this36.textInputPlaceholderText = "Upload an audio file", _this36.permittedErrorPrefixes = ["Authentication", "Invalid"], _this36.canSendMessage = ys.canFileSendMessage;
8217
8217
  return _this36;
@@ -8265,7 +8265,7 @@ var ys = /*#__PURE__*/function (_z7) {
8265
8265
  case 2:
8266
8266
  t = (r = (s = this.connectSettings) == null ? void 0 : s.headers) == null ? void 0 : r.Authorization;
8267
8267
  _context74.next = 5;
8268
- return Ct.poll(t, e.upload_url);
8268
+ return Tt.poll(t, e.upload_url);
8269
8269
  case 5:
8270
8270
  _context74.t0 = _context74.sent.text;
8271
8271
  return _context74.abrupt("return", {
@@ -8383,10 +8383,10 @@ Ti.HELP_LINK =
8383
8383
  // eslint-disable-next-line max-len
8384
8384
  "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
8385
8385
  var as = Ti;
8386
- var It = /*#__PURE__*/function (_pn2) {
8387
- function It(e) {
8386
+ var Lt = /*#__PURE__*/function (_pn2) {
8387
+ function Lt(e) {
8388
8388
  var _this39;
8389
- _classCallCheck(this, It);
8389
+ _classCallCheck(this, Lt);
8390
8390
  var o, a, l;
8391
8391
  var t = (a = (o = e.directConnection) == null ? void 0 : o.azure) == null ? void 0 : a.speechToText,
8392
8392
  i = (l = e.directConnection) == null ? void 0 : l.azure,
@@ -8397,13 +8397,13 @@ var It = /*#__PURE__*/function (_pn2) {
8397
8397
  }
8398
8398
  }
8399
8399
  };
8400
- _this39 = _callSuper(this, It, [e, oe.buildSpeechToTextHeaders, t.region, i, s]), _this39.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(It.HELP_LINK, "\">here</a> for more info.\n </p>"), _this39.url = "", _this39.isTextInputDisabled = !0, _this39.textInputPlaceholderText = "Upload an audio file", _this39.canSendMessage = It.canFileSendMessage;
8400
+ _this39 = _callSuper(this, Lt, [e, oe.buildSpeechToTextHeaders, t.region, i, s]), _this39.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(Lt.HELP_LINK, "\">here</a> for more info.\n </p>"), _this39.url = "", _this39.isTextInputDisabled = !0, _this39.textInputPlaceholderText = "Upload an audio file", _this39.canSendMessage = Lt.canFileSendMessage;
8401
8401
  var r = t.lang || "en-US";
8402
8402
  _this39.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this39.recordAudio = void 0;
8403
8403
  return _this39;
8404
8404
  }
8405
- _inherits(It, _pn2);
8406
- return _createClass(It, [{
8405
+ _inherits(Lt, _pn2);
8406
+ return _createClass(Lt, [{
8407
8407
  key: "callServiceAPI",
8408
8408
  value: function () {
8409
8409
  var _callServiceAPI16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee77(e, t, i) {
@@ -8469,10 +8469,10 @@ var It = /*#__PURE__*/function (_pn2) {
8469
8469
  }
8470
8470
  }]);
8471
8471
  }(pn);
8472
- It.HELP_LINK =
8472
+ Lt.HELP_LINK =
8473
8473
  // eslint-disable-next-line max-len
8474
8474
  "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
8475
- var ls = It;
8475
+ var ls = Lt;
8476
8476
  var Lo = /*#__PURE__*/function (_z9) {
8477
8477
  // prettier-ignore
8478
8478
  function Lo(e) {
@@ -8931,7 +8931,7 @@ var L = /*#__PURE__*/function (_z10) {
8931
8931
  key: "processMessage",
8932
8932
  value: function processMessage(e, t) {
8933
8933
  var i = this.totalMessagesMaxCharLength || -1,
8934
- s = gt.getCharacterLimitMessages(e, i)[0];
8934
+ s = bt.getCharacterLimitMessages(e, i)[0];
8935
8935
  if (t && t.length > 0) {
8936
8936
  var r = this.filesToolType;
8937
8937
  if (typeof this.filesToolType == "function") {
@@ -9276,25 +9276,29 @@ var L = /*#__PURE__*/function (_z10) {
9276
9276
  name: o["function"].name,
9277
9277
  arguments: o["function"].arguments
9278
9278
  };
9279
- }), i = this._functionHandler(t);
9279
+ });
9280
+ _context97.next = 5;
9281
+ return this._functionHandler(t);
9282
+ case 5:
9283
+ i = _context97.sent;
9280
9284
  if (!(!Array.isArray(i) || e.length !== i.length)) {
9281
- _context97.next = 5;
9285
+ _context97.next = 8;
9282
9286
  break;
9283
9287
  }
9284
9288
  throw Error(ye.FUNCTION_TOOL_RESP_ERROR);
9285
- case 5:
9286
- _context97.next = 7;
9289
+ case 8:
9290
+ _context97.next = 10;
9287
9291
  return Promise.all(i);
9288
- case 7:
9292
+ case 10:
9289
9293
  s = _context97.sent;
9290
9294
  if (!s.find(function (o) {
9291
9295
  return typeof o != "string";
9292
9296
  })) {
9293
- _context97.next = 10;
9297
+ _context97.next = 13;
9294
9298
  break;
9295
9299
  }
9296
9300
  throw Error(ye.FUNCTION_TOOL_RESP_ERROR);
9297
- case 10:
9301
+ case 13:
9298
9302
  r = s.map(function (o, a) {
9299
9303
  return {
9300
9304
  tool_call_id: e[a].id,
@@ -9303,26 +9307,26 @@ var L = /*#__PURE__*/function (_z10) {
9303
9307
  });
9304
9308
  this.url = "".concat(L.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
9305
9309
  if (!this.isSSEStream) {
9306
- _context97.next = 17;
9310
+ _context97.next = 20;
9307
9311
  break;
9308
9312
  }
9309
- _context97.next = 15;
9313
+ _context97.next = 18;
9310
9314
  return this.createStreamRun({
9311
9315
  tool_outputs: r
9312
9316
  });
9313
- case 15:
9314
- _context97.next = 19;
9317
+ case 18:
9318
+ _context97.next = 22;
9315
9319
  break;
9316
- case 17:
9317
- _context97.next = 19;
9320
+ case 20:
9321
+ _context97.next = 22;
9318
9322
  return O.directFetch(this, {
9319
9323
  tool_outputs: r
9320
9324
  }, "POST");
9321
- case 19:
9325
+ case 22:
9322
9326
  return _context97.abrupt("return", {
9323
9327
  timeoutMS: L.POLLING_TIMEOUT_MS
9324
9328
  });
9325
- case 20:
9329
+ case 23:
9326
9330
  case "end":
9327
9331
  return _context97.stop();
9328
9332
  }
@@ -9669,18 +9673,18 @@ var he = /*#__PURE__*/function (_z11) {
9669
9673
  }(z);
9670
9674
  he.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations", he.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations", he.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
9671
9675
  var ds = he;
9672
- var Tt = /*#__PURE__*/function (_z12) {
9673
- function Tt(e) {
9676
+ var At = /*#__PURE__*/function (_z12) {
9677
+ function At(e) {
9674
9678
  var _this45$maxMessages, _l$model;
9675
9679
  var _this45;
9676
- _classCallCheck(this, Tt);
9680
+ _classCallCheck(this, At);
9677
9681
  var r, o, a, l;
9678
9682
  var t = JSON.parse(JSON.stringify(e.directConnection)),
9679
9683
  i = t.openAI;
9680
- _this45 = _callSuper(this, Tt, [e, O.buildKeyVerificationDetails(), O.buildHeaders, i]), _this45.insertKeyPlaceholderText = "OpenAI API Key", _this45.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this45.url = "https://api.openai.com/v1/chat/completions", _this45.permittedErrorPrefixes = ["Incorrect"], _this45.asyncCallInProgress = !1, _this45._systemMessage = Tt.generateSystemMessage("You are a helpful assistant.");
9684
+ _this45 = _callSuper(this, At, [e, O.buildKeyVerificationDetails(), O.buildHeaders, i]), _this45.insertKeyPlaceholderText = "OpenAI API Key", _this45.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this45.url = "https://api.openai.com/v1/chat/completions", _this45.permittedErrorPrefixes = ["Incorrect"], _this45.asyncCallInProgress = !1, _this45._systemMessage = At.generateSystemMessage("You are a helpful assistant.");
9681
9685
  var s = (r = t.openAI) == null ? void 0 : r.chat;
9682
9686
  if (_typeof(s) == "object") {
9683
- s.system_prompt && (_this45._systemMessage = Tt.generateSystemMessage(s.system_prompt));
9687
+ s.system_prompt && (_this45._systemMessage = At.generateSystemMessage(s.system_prompt));
9684
9688
  var _ref18 = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.chat,
9685
9689
  c = _ref18.function_handler;
9686
9690
  c && (_this45._functionHandler = c), _this45.cleanConfig(s), Object.assign(_this45.rawBody, s);
@@ -9688,8 +9692,8 @@ var Tt = /*#__PURE__*/function (_z12) {
9688
9692
  (_this45$maxMessages = _this45.maxMessages) !== null && _this45$maxMessages !== void 0 ? _this45$maxMessages : _this45.maxMessages = -1, (_l$model = (l = _this45.rawBody).model) !== null && _l$model !== void 0 ? _l$model : l.model = "gpt-4o";
9689
9693
  return _this45;
9690
9694
  }
9691
- _inherits(Tt, _z12);
9692
- return _createClass(Tt, [{
9695
+ _inherits(At, _z12);
9696
+ return _createClass(At, [{
9693
9697
  key: "cleanConfig",
9694
9698
  value: function cleanConfig(e) {
9695
9699
  delete e.system_prompt, delete e.function_handler;
@@ -9701,9 +9705,9 @@ var Tt = /*#__PURE__*/function (_z12) {
9701
9705
  function preprocessBody(e, t) {
9702
9706
  var _i$max_tokens;
9703
9707
  var i = JSON.parse(JSON.stringify(e)),
9704
- s = gt.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
9708
+ s = bt.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
9705
9709
  return {
9706
- content: Tt.getContent(r),
9710
+ content: At.getContent(r),
9707
9711
  role: r.role === b.USER_ROLE ? "user" : "assistant"
9708
9712
  };
9709
9713
  });
@@ -10159,7 +10163,7 @@ var No = /*#__PURE__*/function () {
10159
10163
  r = e.webModel;
10160
10164
  if (r) return new Bt(e);
10161
10165
  if (t) {
10162
- if (t.openAI) return t.openAI.images ? new ds(e) : t.openAI.speechToText ? new os(e) : t.openAI.textToSpeech ? new rs(e) : t.openAI.assistant ? new cs(e) : new Tt(e);
10166
+ if (t.openAI) return t.openAI.images ? new ds(e) : t.openAI.speechToText ? new os(e) : t.openAI.textToSpeech ? new rs(e) : t.openAI.assistant ? new cs(e) : new At(e);
10163
10167
  if (t.assemblyAI) return new ys(e);
10164
10168
  if (t.cohere) return t.cohere.textGeneration ? new ko(e) : t.cohere.summarization ? new Mo(e) : new Po(e);
10165
10169
  if (t.huggingFace) return t.huggingFace.textGeneration ? new _o(e) : t.huggingFace.summarization ? new wo(e) : t.huggingFace.translation ? new To(e) : t.huggingFace.fillMask ? new Ao(e) : t.huggingFace.questionAnswer ? new So(e) : t.huggingFace.audioSpeechRecognition ? new xo(e) : t.huggingFace.audioClassification ? new yo(e) : t.huggingFace.imageClassification ? new Eo(e) : new Co(e);
@@ -10298,7 +10302,7 @@ var Pe = /*#__PURE__*/function () {
10298
10302
  key: "createAudioElement",
10299
10303
  value: function createAudioElement(e, t) {
10300
10304
  var i = document.createElement("audio");
10301
- return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, Pt.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === b.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
10305
+ return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, gt.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === b.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
10302
10306
  }
10303
10307
  }, {
10304
10308
  key: "addNewAudioMessage",
@@ -10620,11 +10624,11 @@ var N = /*#__PURE__*/function () {
10620
10624
  }();
10621
10625
  N.INPUT_OUTSIDE_LEFT_ADJUSTMENT_CLASS = "text-input-container-left-adjustment", N.INPUT_OUTSIDE_RIGHT_ADJUSTMENT_CLASS = "text-input-container-right-adjustment", N.INPUT_OUTSIDE_LEFT_SMALL_ADJUSTMENT_CLASS = "text-input-container-left-small-adjustment", N.INPUT_OUTSIDE_RIGHT_SMALL_ADJUSTMENT_CLASS = "text-input-container-right-small-adjustment";
10622
10626
  var us = N;
10623
- var bt = /*#__PURE__*/function () {
10624
- function bt() {
10625
- _classCallCheck(this, bt);
10627
+ var vt = /*#__PURE__*/function () {
10628
+ function vt() {
10629
+ _classCallCheck(this, vt);
10626
10630
  }
10627
- return _createClass(bt, null, [{
10631
+ return _createClass(vt, null, [{
10628
10632
  key: "create",
10629
10633
  value: function create() {
10630
10634
  return Array.from({
@@ -10648,7 +10652,7 @@ var bt = /*#__PURE__*/function () {
10648
10652
  key: "addButton",
10649
10653
  value: function addButton(e, t, i) {
10650
10654
  t.classList.add(i);
10651
- var s = bt.getContainerIndex(i);
10655
+ var s = vt.getContainerIndex(i);
10652
10656
  e[s].appendChild(t), s === 3 && t.classList.add("outside-right");
10653
10657
  }
10654
10658
  }]);
@@ -10999,7 +11003,7 @@ var G = /*#__PURE__*/function () {
10999
11003
  c && (r.addItem(c.button), t["dropup-menu"].splice(l, 1));
11000
11004
  });
11001
11005
  var o = pt.getPosition(t, s);
11002
- bt.addButton(e, r.buttonContainer, o), t[o].push({});
11006
+ vt.addButton(e, r.buttonContainer, o), t[o].push({});
11003
11007
  }
11004
11008
  }, {
11005
11009
  key: "addToSideContainer",
@@ -11007,7 +11011,7 @@ var G = /*#__PURE__*/function () {
11007
11011
  ["inside-left", "inside-right", "outside-left", "outside-right"].forEach(function (s) {
11008
11012
  var r = s;
11009
11013
  t[r].forEach(function (o) {
11010
- bt.addButton(e, o.button.elementRef, r);
11014
+ vt.addButton(e, o.button.elementRef, r);
11011
11015
  });
11012
11016
  });
11013
11017
  }
@@ -11260,17 +11264,17 @@ var $o = /*#__PURE__*/function () {
11260
11264
  }]);
11261
11265
  }();
11262
11266
  Ii.WebSpeechTranscript = $o;
11263
- var vt = {};
11264
- Object.defineProperty(vt, "__esModule", {
11267
+ var yt = {};
11268
+ Object.defineProperty(yt, "__esModule", {
11265
11269
  value: !0
11266
11270
  });
11267
- vt.Browser = void 0;
11268
- var xt = /*#__PURE__*/_createClass(function xt() {
11269
- _classCallCheck(this, xt);
11271
+ yt.Browser = void 0;
11272
+ var _t = /*#__PURE__*/_createClass(function _t() {
11273
+ _classCallCheck(this, _t);
11270
11274
  });
11271
- vt.Browser = xt;
11272
- xt.IS_SAFARI = function () {
11273
- return xt._IS_SAFARI === void 0 && (xt._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), xt._IS_SAFARI;
11275
+ yt.Browser = _t;
11276
+ _t.IS_SAFARI = function () {
11277
+ return _t._IS_SAFARI === void 0 && (_t._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), _t._IS_SAFARI;
11274
11278
  };
11275
11279
  var Jt = {},
11276
11280
  Li = {};
@@ -11441,11 +11445,11 @@ Object.defineProperty(rt, "__esModule", {
11441
11445
  value: !0
11442
11446
  });
11443
11447
  rt.Cursor = void 0;
11444
- var At = /*#__PURE__*/function () {
11445
- function At() {
11446
- _classCallCheck(this, At);
11448
+ var kt = /*#__PURE__*/function () {
11449
+ function kt() {
11450
+ _classCallCheck(this, kt);
11447
11451
  }
11448
- return _createClass(At, null, [{
11452
+ return _createClass(kt, null, [{
11449
11453
  key: "setOffsetForGeneric",
11450
11454
  value: function setOffsetForGeneric(e, t) {
11451
11455
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
@@ -11453,7 +11457,7 @@ var At = /*#__PURE__*/function () {
11453
11457
  for (var r = 0; r < e.childNodes.length; r += 1) {
11454
11458
  var o = e.childNodes[r];
11455
11459
  if (o.childNodes.length > 0) {
11456
- var a = At.setOffsetForGeneric(o, t, i);
11460
+ var a = kt.setOffsetForGeneric(o, t, i);
11457
11461
  if (a === -1) return -1;
11458
11462
  i += a;
11459
11463
  } else if (o.textContent !== null) {
@@ -11481,8 +11485,8 @@ var At = /*#__PURE__*/function () {
11481
11485
  value: function setOffsetForSafariGeneric(e, t) {
11482
11486
  var i = window.getSelection();
11483
11487
  if (i) {
11484
- var s = At.getGenericElementCursorOffset(e, i, !0);
11485
- console.log(s), setTimeout(function () {}, 100), At.setOffsetForGeneric(e, s + t);
11488
+ var s = kt.getGenericElementCursorOffset(e, i, !0);
11489
+ console.log(s), setTimeout(function () {}, 100), kt.setOffsetForGeneric(e, s + t);
11486
11490
  }
11487
11491
  }
11488
11492
  // set to automatically scroll to cursor (scroll does not work in Safari)
@@ -11521,14 +11525,14 @@ var At = /*#__PURE__*/function () {
11521
11525
  }
11522
11526
  }]);
11523
11527
  }();
11524
- rt.Cursor = At;
11528
+ rt.Cursor = kt;
11525
11529
  Object.defineProperty(Xt, "__esModule", {
11526
11530
  value: !0
11527
11531
  });
11528
11532
  Xt.CommandUtils = void 0;
11529
11533
  var qs = Zt,
11530
11534
  Xo = nt,
11531
- Zo = vt,
11535
+ Zo = yt,
11532
11536
  zs = rt,
11533
11537
  Vs = st;
11534
11538
  var ne = /*#__PURE__*/function () {
@@ -11632,7 +11636,7 @@ Object.defineProperty(Oi, "__esModule", {
11632
11636
  });
11633
11637
  Oi.Highlight = void 0;
11634
11638
  var Yo = nt,
11635
- Et = rt;
11639
+ xt = rt;
11636
11640
  var vi = /*#__PURE__*/function () {
11637
11641
  function vi() {
11638
11642
  _classCallCheck(this, vi);
@@ -11648,8 +11652,8 @@ var vi = /*#__PURE__*/function () {
11648
11652
  value: function setStateForGeneric(e, t) {
11649
11653
  var i = window.getSelection();
11650
11654
  if (i != null && i.focusNode) {
11651
- var s = Et.Cursor.getGenericElementCursorOffset(t, i, !0),
11652
- r = Et.Cursor.getGenericElementCursorOffset(t, i, !1);
11655
+ var s = xt.Cursor.getGenericElementCursorOffset(t, i, !0),
11656
+ r = xt.Cursor.getGenericElementCursorOffset(t, i, !1);
11653
11657
  e.isHighlighted = s !== r;
11654
11658
  }
11655
11659
  }
@@ -11663,8 +11667,8 @@ var vi = /*#__PURE__*/function () {
11663
11667
  value: function removeForGeneric(e, t) {
11664
11668
  var i = window.getSelection();
11665
11669
  if (i) {
11666
- var s = Et.Cursor.getGenericElementCursorOffset(t, i, !0);
11667
- i.deleteFromDocument(), Et.Cursor.setOffsetForGeneric(t, s), e.isHighlighted = !1;
11670
+ var s = xt.Cursor.getGenericElementCursorOffset(t, i, !0);
11671
+ i.deleteFromDocument(), xt.Cursor.setOffsetForGeneric(t, s), e.isHighlighted = !1;
11668
11672
  }
11669
11673
  }
11670
11674
  }, {
@@ -11675,7 +11679,7 @@ var vi = /*#__PURE__*/function () {
11675
11679
  r = t.value;
11676
11680
  if (i && s) {
11677
11681
  var o = r.substring(0, i) + r.substring(s);
11678
- t.value = o, Et.Cursor.setOffsetForPrimitive(t, i, e.autoScroll);
11682
+ t.value = o, xt.Cursor.setOffsetForPrimitive(t, i, e.autoScroll);
11679
11683
  }
11680
11684
  e.isHighlighted = !1;
11681
11685
  }
@@ -11759,7 +11763,7 @@ var Ws = Li,
11759
11763
  $i = Oi,
11760
11764
  pe = nt,
11761
11765
  Ki = Ni,
11762
- Ks = vt,
11766
+ Ks = yt,
11763
11767
  Js = rt,
11764
11768
  Ji = st;
11765
11769
  var ta = /*#__PURE__*/function () {
@@ -11876,7 +11880,7 @@ Object.defineProperty(Ri, "__esModule", {
11876
11880
  });
11877
11881
  Ri.WebSpeech = void 0;
11878
11882
  var Xs = Ii,
11879
- Zs = vt,
11883
+ Zs = yt,
11880
11884
  ia = Jt;
11881
11885
  var Ei = /*#__PURE__*/function (_ia$Speech) {
11882
11886
  function Ei() {
@@ -12376,12 +12380,12 @@ var ca = /*#__PURE__*/function () {
12376
12380
  }
12377
12381
  }]);
12378
12382
  }();
12379
- var Lt = /*#__PURE__*/function (_jt) {
12380
- function Lt(e, t, i) {
12383
+ var Pt = /*#__PURE__*/function (_jt) {
12384
+ function Pt(e, t, i) {
12381
12385
  var _this60;
12382
- _classCallCheck(this, Lt);
12386
+ _classCallCheck(this, Pt);
12383
12387
  var s = _typeof(e.speechToText) == "object" ? e.speechToText : {};
12384
- _this60 = _callSuper(this, Lt, [s == null ? void 0 : s.button]);
12388
+ _this60 = _callSuper(this, Pt, [s == null ? void 0 : s.button]);
12385
12389
  var _this60$processConfig = _this60.processConfiguration(t, e.speechToText),
12386
12390
  r = _this60$processConfig.serviceName,
12387
12391
  o = _this60$processConfig.processedConfig;
@@ -12395,8 +12399,8 @@ var Lt = /*#__PURE__*/function (_jt) {
12395
12399
  return _this60;
12396
12400
  }
12397
12401
  // prettier-ignore
12398
- _inherits(Lt, _jt);
12399
- return _createClass(Lt, [{
12402
+ _inherits(Pt, _jt);
12403
+ return _createClass(Pt, [{
12400
12404
  key: "processConfiguration",
12401
12405
  value: function processConfiguration(e, t) {
12402
12406
  var _i$displayInterimResu, _i$textColor, _i$translations, _i$commands, _i$events;
@@ -12421,7 +12425,7 @@ var Lt = /*#__PURE__*/function (_jt) {
12421
12425
  removeNewText: !0
12422
12426
  }) : null;
12423
12427
  }), i.submitAfterSilence && (this._silenceSubmit = new ca(i.submitAfterSilence, i.stopAfterSubmit)), {
12424
- serviceName: Lt.getServiceName(i),
12428
+ serviceName: Pt.getServiceName(i),
12425
12429
  processedConfig: o
12426
12430
  };
12427
12431
  }
@@ -12484,12 +12488,12 @@ var Lt = /*#__PURE__*/function (_jt) {
12484
12488
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
12485
12489
  e.click(), t || setTimeout(function () {
12486
12490
  return e.click();
12487
- }, Lt.MICROPHONE_RESET_TIMEOUT_MS);
12491
+ }, Pt.MICROPHONE_RESET_TIMEOUT_MS);
12488
12492
  }
12489
12493
  }]);
12490
12494
  }(jt);
12491
- Lt.MICROPHONE_RESET_TIMEOUT_MS = 300;
12492
- var qt = Lt;
12495
+ Pt.MICROPHONE_RESET_TIMEOUT_MS = 300;
12496
+ var qt = Pt;
12493
12497
  var Ae = /*#__PURE__*/function () {
12494
12498
  // prettier-ignore
12495
12499
  function Ae(e, t, i, s) {
@@ -12609,7 +12613,7 @@ var Ae = /*#__PURE__*/function () {
12609
12613
  key: "createAnyFileAttachment",
12610
12614
  value: function createAnyFileAttachment(e) {
12611
12615
  var t = document.createElement("div");
12612
- t.classList.add("border-bound-attachment"), Pt.IS_SAFARI && t.classList.add("border-bound-attachment-safari");
12616
+ t.classList.add("border-bound-attachment"), gt.IS_SAFARI && t.classList.add("border-bound-attachment-safari");
12613
12617
  var i = document.createElement("div");
12614
12618
  i.classList.add("any-file-attachment-text");
12615
12619
  var s = document.createElement("div");
@@ -12702,7 +12706,7 @@ var da = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
12702
12706
  key: "createAudioContainer",
12703
12707
  value: function createAudioContainer() {
12704
12708
  var e = document.createElement("div");
12705
- return e.classList.add("border-bound-attachment", "audio-attachment-icon-container"), Pt.IS_SAFARI && e.classList.add("border-bound-attachment-safari"), e;
12709
+ return e.classList.add("border-bound-attachment", "audio-attachment-icon-container"), gt.IS_SAFARI && e.classList.add("border-bound-attachment-safari"), e;
12706
12710
  }
12707
12711
  }, {
12708
12712
  key: "addAudioElements",
@@ -12963,26 +12967,26 @@ var ue = /*#__PURE__*/function () {
12963
12967
  }();
12964
12968
  ue.MODAL_CLOSE_TIMEOUT_MS = 190;
12965
12969
  var Ke = ue;
12966
- var kt = /*#__PURE__*/function (_$t3) {
12970
+ var Mt = /*#__PURE__*/function (_$t3) {
12967
12971
  // prettier-ignore
12968
- function kt(e, t, i, s, r, o) {
12972
+ function Mt(e, t, i, s, r, o) {
12969
12973
  var _this68;
12970
- _classCallCheck(this, kt);
12974
+ _classCallCheck(this, Mt);
12971
12975
  var h, u, f, m, p, y, x, j, V;
12972
12976
  var a = (h = i == null ? void 0 : i.button) == null ? void 0 : h.position,
12973
12977
  l = ((m = (f = (u = i == null ? void 0 : i.button) == null ? void 0 : u.styles) == null ? void 0 : f.text) == null ? void 0 : m.content) || o;
12974
- _this68 = _callSuper(this, kt, [kt.createButtonElement(), a, i.button, l]);
12978
+ _this68 = _callSuper(this, Mt, [Mt.createButtonElement(), a, i.button, l]);
12975
12979
  var c = a === "dropup-menu",
12976
12980
  d = _this68.createInnerElements(s, r, _this68._customStyles, c);
12977
- _this68._inputElement = kt.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this68.addClickEvent(e, i), _this68.elementRef.replaceChildren(d.styles), _this68.reapplyStateStyle("styles"), _this68._fileAttachmentsType = t, _this68._openModalOnce = ((x = (y = i.files) == null ? void 0 : y.infoModal) == null ? void 0 : x.openModalOnce) === !1 || (V = (j = i.files) == null ? void 0 : j.infoModal) == null ? void 0 : V.openModalOnce;
12981
+ _this68._inputElement = Mt.createInputElement((p = i == null ? void 0 : i.files) == null ? void 0 : p.acceptedFormats), _this68.addClickEvent(e, i), _this68.elementRef.replaceChildren(d.styles), _this68.reapplyStateStyle("styles"), _this68._fileAttachmentsType = t, _this68._openModalOnce = ((x = (y = i.files) == null ? void 0 : y.infoModal) == null ? void 0 : x.openModalOnce) === !1 || (V = (j = i.files) == null ? void 0 : j.infoModal) == null ? void 0 : V.openModalOnce;
12978
12982
  return _this68;
12979
12983
  }
12980
- _inherits(kt, _$t3);
12981
- return _createClass(kt, [{
12984
+ _inherits(Mt, _$t3);
12985
+ return _createClass(Mt, [{
12982
12986
  key: "createInnerElements",
12983
12987
  value: function createInnerElements(e, t, i) {
12984
12988
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
12985
- var r = kt.createSVGIconElement(e, t);
12989
+ var r = Mt.createSVGIconElement(e, t);
12986
12990
  return {
12987
12991
  styles: $.createInnerElement(this.elementRef, r, "styles", i, s)
12988
12992
  };
@@ -13795,10 +13799,10 @@ var Si = /*#__PURE__*/function (_$t5) {
13795
13799
  }
13796
13800
  }]);
13797
13801
  }($t);
13798
- var Mt = /*#__PURE__*/function () {
13799
- function Mt(e, t, i, s) {
13800
- _classCallCheck(this, Mt);
13801
- this.elementRef = Mt.createPanelElement(e.inputAreaStyle);
13802
+ var Rt = /*#__PURE__*/function () {
13803
+ function Rt(e, t, i, s) {
13804
+ _classCallCheck(this, Rt);
13805
+ this.elementRef = Rt.createPanelElement(e.inputAreaStyle);
13802
13806
  var r = {},
13803
13807
  o = this.createFileUploadComponents(e, i, s, r),
13804
13808
  a = new oi(e, i, o);
@@ -13808,16 +13812,16 @@ var Mt = /*#__PURE__*/function () {
13808
13812
  var l = new fs(e, a, t, i, o, r);
13809
13813
  a.submit = l.submitFromInput.bind(l), He.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
13810
13814
  button: l
13811
- }, Mt.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
13815
+ }, Rt.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
13812
13816
  }
13813
- return _createClass(Mt, [{
13817
+ return _createClass(Rt, [{
13814
13818
  key: "createFileUploadComponents",
13815
13819
  value:
13816
13820
  // prettier-ignore
13817
13821
  function createFileUploadComponents(e, t, i, s) {
13818
13822
  var o, a, l, c;
13819
13823
  var r = new Yt(this.elementRef, e.attachmentContainerStyle, t.demo);
13820
- if (Mt.createUploadButtons(e, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
13824
+ if (Rt.createUploadButtons(e, t.fileTypes || {}, r, i, s), (o = t.camera) != null && o.files) {
13821
13825
  var d = ((a = s.images) == null ? void 0 : a.fileType) || r.addType(e, t.camera.files, "images");
13822
13826
  s.camera = {
13823
13827
  button: new Si(i, d, t.camera)
@@ -13850,7 +13854,7 @@ var Mt = /*#__PURE__*/function () {
13850
13854
  d = _zo$a.id,
13851
13855
  h = _zo$a.svgString,
13852
13856
  u = _zo$a.dropupText,
13853
- f = new kt(s, c, l, d, h, u);
13857
+ f = new Mt(s, c, l, d, h, u);
13854
13858
  r[a] = {
13855
13859
  button: f,
13856
13860
  fileType: c
@@ -13863,9 +13867,9 @@ var Mt = /*#__PURE__*/function () {
13863
13867
  key: "addElements",
13864
13868
  value: function addElements(e, t, i, s, r, o) {
13865
13869
  J.addElements(e, t.elementRef);
13866
- var a = bt.create(),
13870
+ var a = vt.create(),
13867
13871
  l = G.addButtons(a, i, s, o);
13868
- us.set(t.inputElementRef, a, r.elementRef, l), bt.add(e, a);
13872
+ us.set(t.inputElementRef, a, r.elementRef, l), vt.add(e, a);
13869
13873
  }
13870
13874
  }]);
13871
13875
  }();
@@ -13880,7 +13884,7 @@ var Ss = /*#__PURE__*/function () {
13880
13884
  s.id = "chat-view";
13881
13885
  var r = new Ee(e, t, i);
13882
13886
  t.websocket && U.createConnection(t, r);
13883
- var o = new Mt(e, r, t, s);
13887
+ var o = new Rt(e, r, t, s);
13884
13888
  return J.addElements(s, r.elementRef, o.elementRef), s;
13885
13889
  }
13886
13890
  }, {
@@ -13911,7 +13915,7 @@ var E = /*#__PURE__*/function (_ss) {
13911
13915
  return Vt.focusFromParentElement(_this82._elementRef);
13912
13916
  }, _this82.refreshMessages = function () {}, _this82.clearMessages = function () {}, _this82.scrollToBottom = function () {}, _this82.disableSubmitButton = function () {}, _this82.setPlaceholderText = function () {}, _this82._hasBeenRendered = !1, _this82._auxiliaryStyleApplied = !1, _this82._elementRef = document.createElement("div"), _this82._elementRef.id = "container", _this82.attachShadow({
13913
13917
  mode: "open"
13914
- }).appendChild(_this82._elementRef), _t.apply(ya, _this82.shadowRoot), setTimeout(function () {
13918
+ }).appendChild(_this82._elementRef), St.apply(ya, _this82.shadowRoot), setTimeout(function () {
13915
13919
  _this82._hasBeenRendered || _this82.onRender();
13916
13920
  }, 20);
13917
13921
  return _this82;
@@ -13927,7 +13931,7 @@ var E = /*#__PURE__*/function (_ss) {
13927
13931
  key: "onRender",
13928
13932
  value: function onRender() {
13929
13933
  var _this$_childElement;
13930
- ri.attemptAppendStyleSheetToHead(this.style), ae.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = No.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (_t.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), _t.applyDefaultStyleToComponent(this.style, this.chatStyle), ae.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? ni.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof z) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ss.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof z && H.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, ai.onRender(this);
13934
+ ri.attemptAppendStyleSheetToHead(this.style), ae.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = No.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (St.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), St.applyDefaultStyleToComponent(this.style, this.chatStyle), ae.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? ni.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof z) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ss.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof z && H.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, ai.onRender(this);
13931
13935
  }
13932
13936
  }, {
13933
13937
  key: "disconnectedCallback",