deep-chat-dev 9.0.71 → 9.0.73

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.
@@ -1 +1 @@
1
- {"version":3,"file":"deepChat.d.ts","sourceRoot":"","sources":["../../src/deepChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AACvH,OAAO,EAAC,wBAAwB,EAAE,kBAAkB,EAAE,4BAA4B,EAAC,MAAM,4BAA4B,CAAC;AAGtH,OAAO,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAC,kBAAkB,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAC,mBAAmB,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAG/D,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAC,WAAW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AC,EAAE,iBAAiB,CAAC;IAIvC,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;;IAe3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;IAE1C,OAAO,CAAC,gBAAgB;IAMf,QAAQ;CA0BlB;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
package/dist/deepChat.js CHANGED
@@ -576,7 +576,7 @@ var $t = /*#__PURE__*/function () {
576
576
  $t.AI_ROLE = "ai";
577
577
  $t.USER_ROLE = "user";
578
578
  $t.EMPTY_MESSAGE_CLASS = "empty-message";
579
- var b = $t;
579
+ var v = $t;
580
580
  var Me = /*#__PURE__*/function () {
581
581
  function Me() {
582
582
  _classCallCheck(this, Me);
@@ -766,7 +766,7 @@ var Je = /*#__PURE__*/function () {
766
766
  key: "overwrite",
767
767
  value: function overwrite(e, t, i, s) {
768
768
  var r = e.messages,
769
- o = b.overwriteMessage(r, s, t, i, "html", "html-message");
769
+ o = v.overwriteMessage(r, s, t, i, "html", "html-message");
770
770
  return o && (o.bubbleElement.innerHTML = t, ne.apply(e, o.outerContainer), Ae.flagHTMLUpdateClass(o.bubbleElement)), o;
771
771
  }
772
772
  }, {
@@ -779,7 +779,7 @@ var Je = /*#__PURE__*/function () {
779
779
  if (l) return l;
780
780
  }
781
781
  var o = Je.createElements(e, t, i);
782
- return b.fillEmptyMessageElement(o.bubbleElement, t), ne.apply(e, o.outerContainer), Ae.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Je.addElement(e, o.outerContainer), o;
782
+ return v.fillEmptyMessageElement(o.bubbleElement, t), ne.apply(e, o.outerContainer), Ae.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Je.addElement(e, o.outerContainer), o;
783
783
  }
784
784
  }]);
785
785
  return Je;
@@ -2744,7 +2744,7 @@ var P = /*#__PURE__*/function () {
2744
2744
  }, {
2745
2745
  key: "applySideStyles",
2746
2746
  value: function applySideStyles(e, t, i, s) {
2747
- s && (P.applyCustomStylesToElements(e, i, s.shared), t === b.USER_ROLE ? P.applyCustomStylesToElements(e, i, s.user) : (P.applyCustomStylesToElements(e, i, s.ai), P.applyCustomStylesToElements(e, i, s[t])));
2747
+ s && (P.applyCustomStylesToElements(e, i, s.shared), t === v.USER_ROLE ? P.applyCustomStylesToElements(e, i, s.user) : (P.applyCustomStylesToElements(e, i, s.ai), P.applyCustomStylesToElements(e, i, s[t])));
2748
2748
  }
2749
2749
  }, {
2750
2750
  key: "isMessageSideStyles",
@@ -2793,7 +2793,7 @@ var ae = /*#__PURE__*/function () {
2793
2793
  key: "applyCustomStyles",
2794
2794
  value: function applyCustomStyles(e, t, i, s) {
2795
2795
  var r, o, a, l;
2796
- if ((r = i["default"]) != null && r.styles && ae.applyCustomStylesToElements(e, t, i["default"].styles), s === b.USER_ROLE) (o = i.user) != null && o.styles && ae.applyCustomStylesToElements(e, t, i.user.styles);else {
2796
+ if ((r = i["default"]) != null && r.styles && ae.applyCustomStylesToElements(e, t, i["default"].styles), s === v.USER_ROLE) (o = i.user) != null && o.styles && ae.applyCustomStylesToElements(e, t, i.user.styles);else {
2797
2797
  (a = i.ai) != null && a.styles && ae.applyCustomStylesToElements(e, t, i.ai.styles);
2798
2798
  var c = (l = i[s]) == null ? void 0 : l.styles;
2799
2799
  c && ae.applyCustomStylesToElements(e, t, c);
@@ -2804,7 +2804,7 @@ var ae = /*#__PURE__*/function () {
2804
2804
  value: function createAvatar(e, t) {
2805
2805
  var r, o, a, l, c;
2806
2806
  var i = document.createElement("img");
2807
- e === b.USER_ROLE ? i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || eo : i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || Qr, i.classList.add("avatar");
2807
+ e === v.USER_ROLE ? i.src = ((r = t == null ? void 0 : t.user) == null ? void 0 : r.src) || ((o = t == null ? void 0 : t["default"]) == null ? void 0 : o.src) || eo : i.src = ((a = t == null ? void 0 : t[e]) == null ? void 0 : a.src) || ((l = t == null ? void 0 : t.ai) == null ? void 0 : l.src) || ((c = t == null ? void 0 : t["default"]) == null ? void 0 : c.src) || Qr, i.classList.add("avatar");
2808
2808
  var s = document.createElement("div");
2809
2809
  return s.classList.add("avatar-container"), s.appendChild(i), t && ae.applyCustomStyles(s, i, t, e), s;
2810
2810
  }
@@ -2814,7 +2814,7 @@ var ae = /*#__PURE__*/function () {
2814
2814
  var _i2, _i3, _i4;
2815
2815
  var s, r, o, a, l, c;
2816
2816
  var i = (r = (s = t == null ? void 0 : t[e]) == null ? void 0 : s.styles) == null ? void 0 : r.position;
2817
- return e !== b.USER_ROLE && ((_i2 = i) !== null && _i2 !== void 0 ? _i2 : i = (a = (o = t == null ? void 0 : t.ai) == null ? void 0 : o.styles) == null ? void 0 : a.position), (_i3 = i) !== null && _i3 !== void 0 ? _i3 : i = (c = (l = t == null ? void 0 : t["default"]) == null ? void 0 : l.styles) == null ? void 0 : c.position, (_i4 = i) !== null && _i4 !== void 0 ? _i4 : i = e === b.USER_ROLE ? "right" : "left", i;
2817
+ return e !== v.USER_ROLE && ((_i2 = i) !== null && _i2 !== void 0 ? _i2 : i = (a = (o = t == null ? void 0 : t.ai) == null ? void 0 : o.styles) == null ? void 0 : a.position), (_i3 = i) !== null && _i3 !== void 0 ? _i3 : i = (c = (l = t == null ? void 0 : t["default"]) == null ? void 0 : l.styles) == null ? void 0 : c.position, (_i4 = i) !== null && _i4 !== void 0 ? _i4 : i = e === v.USER_ROLE ? "right" : "left", i;
2818
2818
  }
2819
2819
  }, {
2820
2820
  key: "add",
@@ -2837,19 +2837,19 @@ var He = /*#__PURE__*/function () {
2837
2837
  var _i5, _i6, _i7;
2838
2838
  var s, r, o;
2839
2839
  var i = (s = t == null ? void 0 : t[e]) == null ? void 0 : s.position;
2840
- return e !== b.USER_ROLE && ((_i5 = i) !== null && _i5 !== void 0 ? _i5 : i = (r = t == null ? void 0 : t.ai) == null ? void 0 : r.position), (_i6 = i) !== null && _i6 !== void 0 ? _i6 : i = (o = t == null ? void 0 : t["default"]) == null ? void 0 : o.position, (_i7 = i) !== null && _i7 !== void 0 ? _i7 : i = e === b.USER_ROLE ? "right" : "left", i;
2840
+ return e !== v.USER_ROLE && ((_i5 = i) !== null && _i5 !== void 0 ? _i5 : i = (r = t == null ? void 0 : t.ai) == null ? void 0 : r.position), (_i6 = i) !== null && _i6 !== void 0 ? _i6 : i = (o = t == null ? void 0 : t["default"]) == null ? void 0 : o.position, (_i7 = i) !== null && _i7 !== void 0 ? _i7 : i = e === v.USER_ROLE ? "right" : "left", i;
2841
2841
  }
2842
2842
  }, {
2843
2843
  key: "applyStyle",
2844
2844
  value: function applyStyle(e, t, i) {
2845
2845
  var s, r, o, a;
2846
- Object.assign(e.style, (s = i["default"]) == null ? void 0 : s.style), t === b.USER_ROLE ? Object.assign(e.style, (r = i.user) == null ? void 0 : r.style) : (Object.assign(e.style, (o = i.ai) == null ? void 0 : o.style), Object.assign(e.style, (a = i[t]) == null ? void 0 : a.style));
2846
+ Object.assign(e.style, (s = i["default"]) == null ? void 0 : s.style), t === v.USER_ROLE ? Object.assign(e.style, (r = i.user) == null ? void 0 : r.style) : (Object.assign(e.style, (o = i.ai) == null ? void 0 : o.style), Object.assign(e.style, (a = i[t]) == null ? void 0 : a.style));
2847
2847
  }
2848
2848
  }, {
2849
2849
  key: "getNameText",
2850
2850
  value: function getNameText(e, t) {
2851
2851
  var i, s, r, o, a, l;
2852
- return e === b.USER_ROLE ? ((i = t.user) == null ? void 0 : i.text) || ((s = t["default"]) == null ? void 0 : s.text) || "User" : e === b.AI_ROLE ? ((r = t.ai) == null ? void 0 : r.text) || ((o = t["default"]) == null ? void 0 : o.text) || "AI" : ((a = t[e]) == null ? void 0 : a.text) || ((l = t["default"]) == null ? void 0 : l.text) || e;
2852
+ return e === v.USER_ROLE ? ((i = t.user) == null ? void 0 : i.text) || ((s = t["default"]) == null ? void 0 : s.text) || "User" : e === v.AI_ROLE ? ((r = t.ai) == null ? void 0 : r.text) || ((o = t["default"]) == null ? void 0 : o.text) || "AI" : ((a = t[e]) == null ? void 0 : a.text) || ((l = t["default"]) == null ? void 0 : l.text) || e;
2853
2853
  }
2854
2854
  }, {
2855
2855
  key: "createName",
@@ -2885,15 +2885,15 @@ var Ve = /*#__PURE__*/function () {
2885
2885
  if (r) return r;
2886
2886
  }
2887
2887
  var s = this.createAndAppendNewMessageElement(e, t);
2888
- return s.bubbleElement.classList.add("text-message"), this.applyCustomStyles(s, t, !1), b.fillEmptyMessageElement(s.bubbleElement, e), this.textElementsToText.push([s, e]), s;
2888
+ return s.bubbleElement.classList.add("text-message"), this.applyCustomStyles(s, t, !1), v.fillEmptyMessageElement(s.bubbleElement, e), this.textElementsToText.push([s, e]), s;
2889
2889
  }
2890
2890
  }, {
2891
2891
  key: "overwriteText",
2892
2892
  value: function overwriteText(e, t, i) {
2893
- var s = b.overwriteMessage(this.messages, i, t, e, "text", "text-message");
2893
+ var s = v.overwriteMessage(this.messages, i, t, e, "text", "text-message");
2894
2894
  if (s) {
2895
2895
  this.renderText(s.bubbleElement, t);
2896
- var r = b.getLastTextToElement(this.textElementsToText, s);
2896
+ var r = v.getLastTextToElement(this.textElementsToText, s);
2897
2897
  r && (r[1] = t);
2898
2898
  }
2899
2899
  return s;
@@ -2929,7 +2929,7 @@ var Ve = /*#__PURE__*/function () {
2929
2929
  value:
2930
2930
  // prettier-ignore
2931
2931
  function addInnerContainerElements(e, t, i) {
2932
- return e.classList.add("message-bubble", b.getRoleClass(i), i === b.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ae.add(e, i, this._avatars), this._names && He.add(e, i, this._names), {
2932
+ return e.classList.add("message-bubble", v.getRoleClass(i), i === v.USER_ROLE ? "user-message-text" : "ai-message-text"), this.renderText(e, t), this._avatars && ae.add(e, i, this._avatars), this._names && He.add(e, i, this._names), {
2933
2933
  bubbleElement: e
2934
2934
  };
2935
2935
  }
@@ -2993,7 +2993,7 @@ var Ve = /*#__PURE__*/function () {
2993
2993
  r = e._sessionId,
2994
2994
  o = e.role,
2995
2995
  a = {
2996
- role: o || b.AI_ROLE
2996
+ role: o || v.AI_ROLE
2997
2997
  };
2998
2998
  return t && (a.text = t), i && (a.files = i), s && (a.html = s), !t && !i && !s && (a.text = ""), r && (a._sessionId = r), a;
2999
2999
  }
@@ -3025,13 +3025,13 @@ var Hi = /*#__PURE__*/function () {
3025
3025
  key: "setInitialState",
3026
3026
  value: function setInitialState(e, t, i) {
3027
3027
  var _i8;
3028
- this._streamType = e, (_i8 = i) !== null && _i8 !== void 0 ? _i8 : i = b.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : Je.add(this._messages, t, i, this._messages.messageElementRefs), this._activeMessageContent = this._messages.messages[this._messages.messages.length - 1], this._elements.bubbleElement.classList.add(it.MESSAGE_CLASS), this._streamedContent = t;
3028
+ this._streamType = e, (_i8 = i) !== null && _i8 !== void 0 ? _i8 : i = v.AI_ROLE, this._elements = e === "text" ? this._messages.addNewTextMessage(t, i) : Je.add(this._messages, t, i, this._messages.messageElementRefs), this._activeMessageContent = this._messages.messages[this._messages.messages.length - 1], this._elements.bubbleElement.classList.add(it.MESSAGE_CLASS), this._streamedContent = t;
3029
3029
  }
3030
3030
  }, {
3031
3031
  key: "updateBasedOnType",
3032
3032
  value: function updateBasedOnType(e, t, i) {
3033
3033
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
3034
- b.unfillEmptyMessageElement(i, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, i, s);
3034
+ v.unfillEmptyMessageElement(i, e), (t === "text" ? this.updateText : this.updateHTML).bind(this)(e, i, s);
3035
3035
  }
3036
3036
  }, {
3037
3037
  key: "updateText",
@@ -3053,7 +3053,7 @@ var Hi = /*#__PURE__*/function () {
3053
3053
  var _this$_messages = this._messages,
3054
3054
  e = _this$_messages.textElementsToText,
3055
3055
  t = _this$_messages.elementRef;
3056
- (i = b.getLastMessageBubbleElement(t)) != null && i.classList.contains(it.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._activeMessageContent && (this._activeMessageContent.text = this._streamedContent), this._messages.textToSpeech && Lt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === it.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((s = b.getLastMessageBubbleElement(this._messages.elementRef)) == null ? void 0 : s.innerHTML) || ""), this._elements && ne.apply(this._messages, this._elements.outerContainer), this._activeMessageContent && (this._activeMessageContent.html = this._streamedContent)), this._activeMessageContent && this._messages.sendClientUpdate(Ve.createMessageContent(this._activeMessageContent), !1), this._hasStreamEnded = !0);
3056
+ (i = v.getLastMessageBubbleElement(t)) != null && i.classList.contains(it.MESSAGE_CLASS) && (this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, this._activeMessageContent && (this._activeMessageContent.text = this._streamedContent), this._messages.textToSpeech && Lt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === it.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((s = v.getLastMessageBubbleElement(this._messages.elementRef)) == null ? void 0 : s.innerHTML) || ""), this._elements && ne.apply(this._messages, this._elements.outerContainer), this._activeMessageContent && (this._activeMessageContent.html = this._streamedContent)), this._activeMessageContent && this._messages.sendClientUpdate(Ve.createMessageContent(this._activeMessageContent), !1), this._hasStreamEnded = !0);
3057
3057
  }
3058
3058
  }]);
3059
3059
  return it;
@@ -7238,7 +7238,7 @@ var Ji = /*#__PURE__*/function (_z10) {
7238
7238
  return $e.getCharacterLimitMessages(e, i).map(function (s) {
7239
7239
  return {
7240
7240
  content: s.text || "",
7241
- role: s.role === b.USER_ROLE ? "user" : "assistant",
7241
+ role: s.role === v.USER_ROLE ? "user" : "assistant",
7242
7242
  file_ids: t
7243
7243
  };
7244
7244
  });
@@ -7693,7 +7693,7 @@ var lt = /*#__PURE__*/function (_z12) {
7693
7693
  s = $e.getCharacterLimitMessages(t, this.totalMessagesMaxCharLength ? this.totalMessagesMaxCharLength - this._systemMessage.content.length : -1).map(function (r) {
7694
7694
  return {
7695
7695
  content: lt.getContent(r),
7696
- role: r.role === b.USER_ROLE ? "user" : "assistant"
7696
+ role: r.role === v.USER_ROLE ? "user" : "assistant"
7697
7697
  };
7698
7698
  });
7699
7699
  return t.find(function (r) {
@@ -8081,7 +8081,7 @@ var mn = {
8081
8081
  s = "\n Download a web model that will run entirely on your browser.\n <br/> <button style=\"margin-top: 10px; margin-bottom: 5px; margin-left: 1px\"\n class=\"".concat(i, " deep-chat-button\">Download</button>"),
8082
8082
  r = (t == null ? void 0 : t.html) || "<div>".concat(s, "</div>");
8083
8083
  (a = this.addMessage) == null || a.call(this, {
8084
- role: b.AI_ROLE,
8084
+ role: v.AI_ROLE,
8085
8085
  html: r,
8086
8086
  sendUpdate: !1
8087
8087
  });
@@ -8654,7 +8654,7 @@ var pe = /*#__PURE__*/function () {
8654
8654
  key: "createAudioElement",
8655
8655
  value: function createAudioElement(e, t) {
8656
8656
  var i = document.createElement("audio");
8657
- return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, me.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === b.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
8657
+ return i.src = e.src, i.classList.add("audio-player"), i.controls = !0, me.IS_SAFARI && (i.classList.add("audio-player-safari"), i.classList.add(t === v.USER_ROLE ? "audio-player-safari-right" : "audio-player-safari-left")), i;
8658
8658
  }
8659
8659
  }, {
8660
8660
  key: "addNewAudioMessage",
@@ -8726,8 +8726,8 @@ var fe = /*#__PURE__*/function (_Ve) {
8726
8726
  value: function addSetupMessageIfNeeded(e, t) {
8727
8727
  var i = Bo.getText(e, t);
8728
8728
  if (i) {
8729
- var s = this.createAndAppendNewMessageElement(i, b.AI_ROLE);
8730
- this.applyCustomStyles(s, b.AI_ROLE, !1);
8729
+ var s = this.createAndAppendNewMessageElement(i, v.AI_ROLE);
8730
+ this.applyCustomStyles(s, v.AI_ROLE, !1);
8731
8731
  }
8732
8732
  }
8733
8733
  }, {
@@ -8735,11 +8735,11 @@ var fe = /*#__PURE__*/function (_Ve) {
8735
8735
  value: function addIntroductoryMessage(e) {
8736
8736
  var t, i, s, r;
8737
8737
  if (e && (this._introMessage = e), (t = this._introMessage) != null && t.text) {
8738
- var o = this.createAndAppendNewMessageElement(this._introMessage.text, b.AI_ROLE);
8739
- this.applyCustomStyles(o, b.AI_ROLE, !1, (i = this.messageStyles) == null ? void 0 : i.intro);
8738
+ var o = this.createAndAppendNewMessageElement(this._introMessage.text, v.AI_ROLE);
8739
+ this.applyCustomStyles(o, v.AI_ROLE, !1, (i = this.messageStyles) == null ? void 0 : i.intro);
8740
8740
  } else if ((s = this._introMessage) != null && s.html) {
8741
- var _o3 = Je.add(this, this._introMessage.html, b.AI_ROLE, this.messageElementRefs);
8742
- this.applyCustomStyles(_o3, b.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.intro);
8741
+ var _o3 = Je.add(this, this._introMessage.html, v.AI_ROLE, this.messageElementRefs);
8742
+ this.applyCustomStyles(_o3, v.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.intro);
8743
8743
  }
8744
8744
  }
8745
8745
  }, {
@@ -8758,7 +8758,7 @@ var fe = /*#__PURE__*/function (_Ve) {
8758
8758
  value: function addNewMessage(e) {
8759
8759
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
8760
8760
  var i = fe.createMessageContent(e);
8761
- if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, e.overwrite), !t && this.textToSpeech && i.role !== b.USER_ROLE && Lt.speak(i.text, this.textToSpeech)), i.files && Array.isArray(i.files) && pe.addMessages(this, i.files, i.role), i.html !== void 0 && i.html !== null) {
8761
+ if (!e.ignoreText && i.text !== void 0 && e.text !== null && (this.addNewTextMessage(i.text, i.role, e.overwrite), !t && this.textToSpeech && i.role !== v.USER_ROLE && Lt.speak(i.text, this.textToSpeech)), i.files && Array.isArray(i.files) && pe.addMessages(this, i.files, i.role), i.html !== void 0 && i.html !== null) {
8762
8762
  var s = Je.add(this, i.html, i.role, this.messageElementRefs, e.overwrite);
8763
8763
  ge.isElementTemporary(s) && delete i.html;
8764
8764
  }
@@ -8812,24 +8812,24 @@ var fe = /*#__PURE__*/function (_Ve) {
8812
8812
  key: "isLastMessageError",
8813
8813
  value: function isLastMessageError() {
8814
8814
  var e;
8815
- return (e = b.getLastMessageBubbleElement(this.elementRef)) == null ? void 0 : e.classList.contains("error-message-text");
8815
+ return (e = v.getLastMessageBubbleElement(this.elementRef)) == null ? void 0 : e.classList.contains("error-message-text");
8816
8816
  }
8817
8817
  }, {
8818
8818
  key: "removeError",
8819
8819
  value: function removeError() {
8820
- this.isLastMessageError() && b.getLastMessageElement(this.elementRef).remove();
8820
+ this.isLastMessageError() && v.getLastMessageElement(this.elementRef).remove();
8821
8821
  }
8822
8822
  }, {
8823
8823
  key: "addLoadingMessage",
8824
8824
  value: function addLoadingMessage() {
8825
8825
  var r;
8826
8826
  if (!this._displayLoadingMessage) return;
8827
- var e = this.createMessageElements("", b.AI_ROLE),
8827
+ var e = this.createMessageElements("", v.AI_ROLE),
8828
8828
  t = e.outerContainer,
8829
8829
  i = e.bubbleElement;
8830
8830
  i.classList.add("loading-message-text");
8831
8831
  var s = document.createElement("div");
8832
- s.classList.add("dots-flashing"), i.appendChild(s), this.applyCustomStyles(e, b.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), Yi.set(i, this.messageStyles), this.elementRef.appendChild(t), ie.scrollToBottom(this.elementRef);
8832
+ s.classList.add("dots-flashing"), i.appendChild(s), this.applyCustomStyles(e, v.AI_ROLE, !1, (r = this.messageStyles) == null ? void 0 : r.loading), Yi.set(i, this.messageStyles), this.elementRef.appendChild(t), ie.scrollToBottom(this.elementRef);
8833
8833
  }
8834
8834
  }, {
8835
8835
  key: "populateIntroPanel",
@@ -11828,7 +11828,7 @@ var mi = /*#__PURE__*/function (_xt4) {
11828
11828
  case 0:
11829
11829
  e = _ref12.text, t = _ref12.files;
11830
11830
  i = {
11831
- role: b.USER_ROLE
11831
+ role: v.USER_ROLE
11832
11832
  };
11833
11833
  e && (i.text = e);
11834
11834
  _context98.t0 = t;
@@ -12194,12 +12194,12 @@ var wa = Object.defineProperty,
12194
12194
  for (var s = i > 1 ? void 0 : i ? _a(e, t) : e, r = n.length - 1, o; r >= 0; r--) (o = n[r]) && (s = (i ? o(e, t, s) : o(s)) || s);
12195
12195
  return i && s && wa(e, t, s), s;
12196
12196
  };
12197
- var v = /*#__PURE__*/function (_co) {
12198
- _inherits(v, _co);
12199
- var _super48 = _createSuper(v);
12200
- function v() {
12197
+ var b = /*#__PURE__*/function (_co) {
12198
+ _inherits(b, _co);
12199
+ var _super48 = _createSuper(b);
12200
+ function b() {
12201
12201
  var _this66;
12202
- _classCallCheck(this, v);
12202
+ _classCallCheck(this, b);
12203
12203
  _this66 = _super48.call(this), _this66.getMessages = function () {
12204
12204
  return [];
12205
12205
  }, _this66.submitUserMessage = function () {
@@ -12215,7 +12215,7 @@ var v = /*#__PURE__*/function (_co) {
12215
12215
  }, 20);
12216
12216
  return _this66;
12217
12217
  }
12218
- _createClass(v, [{
12218
+ _createClass(b, [{
12219
12219
  key: "changeToChatView",
12220
12220
  value: function changeToChatView() {
12221
12221
  this._activeService && (this._activeService.validateConfigKey = !1), this.onRender();
@@ -12228,44 +12228,45 @@ var v = /*#__PURE__*/function (_co) {
12228
12228
  (_this$_activeService = this._activeService) !== null && _this$_activeService !== void 0 ? _this$_activeService : this._activeService = Do.create(this), this._activeService && (this.auxiliaryStyle && !this._auxiliaryStyleApplied && (bi.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), bi.applyDefaultStyleToComponent(this.style, this.chatStyle), Ae.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Ot.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], Qi.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof z && N.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Ui.onRender(this));
12229
12229
  }
12230
12230
  }]);
12231
- return v;
12231
+ return b;
12232
12232
  }(co);
12233
- x([y("object")], v.prototype, "directConnection", 2);
12234
- x([y("object")], v.prototype, "request", 2);
12235
- x([y("object")], v.prototype, "stream", 2);
12236
- x([y("object")], v.prototype, "requestBodyLimits", 2);
12237
- x([y("function")], v.prototype, "requestInterceptor", 2);
12238
- x([y("function")], v.prototype, "responseInterceptor", 2);
12239
- x([y("function")], v.prototype, "validateInput", 2);
12240
- x([y("object")], v.prototype, "chatStyle", 2);
12241
- x([y("object")], v.prototype, "attachmentContainerStyle", 2);
12242
- x([y("object")], v.prototype, "dropupStyles", 2);
12243
- x([y("object")], v.prototype, "inputAreaStyle", 2);
12244
- x([y("object")], v.prototype, "textInput", 2);
12245
- x([y("object")], v.prototype, "submitButtonStyles", 2);
12246
- x([y("string")], v.prototype, "auxiliaryStyle", 2);
12247
- x([y("array")], v.prototype, "initialMessages", 2);
12248
- x([y("object")], v.prototype, "introMessage", 2);
12249
- x([y("object")], v.prototype, "avatars", 2);
12250
- x([y("object")], v.prototype, "names", 2);
12251
- x([y("boolean")], v.prototype, "displayLoadingBubble", 2);
12252
- x([y("object")], v.prototype, "errorMessages", 2);
12253
- x([y("object")], v.prototype, "messageStyles", 2);
12254
- x([y("object")], v.prototype, "textToSpeech", 2);
12255
- x([y("object")], v.prototype, "speechToText", 2);
12256
- x([y("object")], v.prototype, "images", 2);
12257
- x([y("object")], v.prototype, "gifs", 2);
12258
- x([y("object")], v.prototype, "camera", 2);
12259
- x([y("object")], v.prototype, "audio", 2);
12260
- x([y("object")], v.prototype, "microphone", 2);
12261
- x([y("object")], v.prototype, "mixedFiles", 2);
12262
- x([y("object")], v.prototype, "dragAndDrop", 2);
12263
- x([y("object")], v.prototype, "introPanelStyle", 2);
12264
- x([y("object")], v.prototype, "htmlClassUtilities", 2);
12265
- x([y("function")], v.prototype, "onNewMessage", 2);
12266
- x([y("function")], v.prototype, "onClearMessages", 2);
12267
- x([y("function")], v.prototype, "onComponentRender", 2);
12268
- x([y("object")], v.prototype, "demo", 2);
12269
- x([y("object")], v.prototype, "_insertKeyViewStyles", 2);
12270
- customElements.define("deep-chat", v);
12271
- export { v as DeepChat };
12233
+ x([y("object")], b.prototype, "directConnection", 2);
12234
+ x([y("object")], b.prototype, "request", 2);
12235
+ x([y("object")], b.prototype, "stream", 2);
12236
+ x([y("object")], b.prototype, "requestBodyLimits", 2);
12237
+ x([y("function")], b.prototype, "requestInterceptor", 2);
12238
+ x([y("function")], b.prototype, "responseInterceptor", 2);
12239
+ x([y("function")], b.prototype, "validateInput", 2);
12240
+ x([y("object")], b.prototype, "chatStyle", 2);
12241
+ x([y("object")], b.prototype, "attachmentContainerStyle", 2);
12242
+ x([y("object")], b.prototype, "dropupStyles", 2);
12243
+ x([y("object")], b.prototype, "inputAreaStyle", 2);
12244
+ x([y("object")], b.prototype, "textInput", 2);
12245
+ x([y("object")], b.prototype, "submitButtonStyles", 2);
12246
+ x([y("string")], b.prototype, "auxiliaryStyle", 2);
12247
+ x([y("array")], b.prototype, "initialMessages", 2);
12248
+ x([y("object")], b.prototype, "introMessage", 2);
12249
+ x([y("object")], b.prototype, "avatars", 2);
12250
+ x([y("object")], b.prototype, "names", 2);
12251
+ x([y("boolean")], b.prototype, "displayLoadingBubble", 2);
12252
+ x([y("object")], b.prototype, "errorMessages", 2);
12253
+ x([y("object")], b.prototype, "messageStyles", 2);
12254
+ x([y("object")], b.prototype, "textToSpeech", 2);
12255
+ x([y("object")], b.prototype, "speechToText", 2);
12256
+ x([y("object")], b.prototype, "images", 2);
12257
+ x([y("object")], b.prototype, "gifs", 2);
12258
+ x([y("object")], b.prototype, "camera", 2);
12259
+ x([y("object")], b.prototype, "audio", 2);
12260
+ x([y("object")], b.prototype, "microphone", 2);
12261
+ x([y("object")], b.prototype, "mixedFiles", 2);
12262
+ x([y("object")], b.prototype, "dragAndDrop", 2);
12263
+ x([y("object")], b.prototype, "introPanelStyle", 2);
12264
+ x([y("object")], b.prototype, "htmlClassUtilities", 2);
12265
+ x([y("function")], b.prototype, "onNewMessage", 2);
12266
+ x([y("function")], b.prototype, "onClearMessages", 2);
12267
+ x([y("function")], b.prototype, "onComponentRender", 2);
12268
+ x([y("object")], b.prototype, "demo", 2);
12269
+ x([y("object")], b.prototype, "_webModel", 2);
12270
+ x([y("object")], b.prototype, "_insertKeyViewStyles", 2);
12271
+ customElements.define("deep-chat", b);
12272
+ export { b as DeepChat };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deep-chat-dev",
3
- "version": "9.0.71",
3
+ "version": "9.0.73",
4
4
  "description": "Customizable chat component for AI APIs",
5
5
  "main": "./dist/deepChat.js",
6
6
  "module": "./dist/deepChat.js",
@@ -71,7 +71,6 @@
71
71
  ],
72
72
  "dependencies": {
73
73
  "@microsoft/fetch-event-source": "^2.0.1",
74
- "deep-chat-web-llm": "^0.0.3",
75
74
  "remarkable": "^2.0.1",
76
75
  "speech-to-element": "^0.1.66"
77
76
  }