deep-chat-dev 9.0.216 → 9.0.217

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
@@ -136,26 +136,26 @@ var R = /*#__PURE__*/function () {
136
136
  }
137
137
  }]);
138
138
  }();
139
- var $e = /*#__PURE__*/function () {
140
- function $e() {
141
- _classCallCheck(this, $e);
139
+ var We = /*#__PURE__*/function () {
140
+ function We() {
141
+ _classCallCheck(this, We);
142
142
  }
143
- return _createClass($e, null, [{
143
+ return _createClass(We, null, [{
144
144
  key: "attemptAppendStyleSheetToHead",
145
145
  value: function attemptAppendStyleSheetToHead(e) {
146
- if (e.fontFamily && e.fontFamily !== $e.DEFAULT_FONT_FAMILY) return;
146
+ if (e.fontFamily && e.fontFamily !== We.DEFAULT_FONT_FAMILY) return;
147
147
  var t = document.getElementsByTagName("head")[0];
148
148
  if (!Array.from(t.getElementsByTagName("link")).some(function (s) {
149
- return s.getAttribute("href") === $e.FONT_URL;
149
+ return s.getAttribute("href") === We.FONT_URL;
150
150
  })) {
151
151
  var s = document.createElement("link");
152
- s.rel = "stylesheet", s.href = $e.FONT_URL, t.appendChild(s);
152
+ s.rel = "stylesheet", s.href = We.FONT_URL, t.appendChild(s);
153
153
  }
154
154
  }
155
155
  }]);
156
156
  }();
157
- $e.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", $e.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
158
- var fi = $e;
157
+ We.FONT_URL = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap", We.DEFAULT_FONT_FAMILY = "'Inter', sans-serif, Avenir, Helvetica, Arial";
158
+ var fi = We;
159
159
  var pt = /*#__PURE__*/function () {
160
160
  function pt() {
161
161
  _classCallCheck(this, pt);
@@ -213,16 +213,16 @@ var Ct = (it = /*#__PURE__*/_createClass(function it() {
213
213
  var N = /* @__PURE__ */function (n) {
214
214
  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;
215
215
  }(N || {});
216
- var We = /*#__PURE__*/function () {
217
- function We() {
218
- _classCallCheck(this, We);
216
+ var Ke = /*#__PURE__*/function () {
217
+ function Ke() {
218
+ _classCallCheck(this, Ke);
219
219
  }
220
- return _createClass(We, null, [{
220
+ return _createClass(Ke, null, [{
221
221
  key: "add",
222
222
  value:
223
223
  // prettier-ignore
224
224
  function add(e, t, i, s) {
225
- i !== void 0 && e.addEventListener("keydown", We.onKeyDown.bind(this, i)), e.oninput = We.onInput.bind(this, i, s), e.addEventListener("paste", function (r) {
225
+ i !== void 0 && e.addEventListener("keydown", Ke.onKeyDown.bind(this, i)), e.oninput = Ke.onInput.bind(this, i, s), e.addEventListener("paste", function (r) {
226
226
  var o;
227
227
  r.preventDefault(), (o = r.clipboardData) != null && o.files.length && t.addFilesToAnyType(Array.from(r.clipboardData.files));
228
228
  });
@@ -233,7 +233,7 @@ var We = /*#__PURE__*/function () {
233
233
  key: "onKeyDown",
234
234
  value: function onKeyDown(e, t) {
235
235
  var s = t.target.textContent;
236
- s && s.length >= e && !We.PERMITTED_KEYS.has(t.key) && !We.isKeyCombinationPermitted(t) && t.preventDefault();
236
+ s && s.length >= e && !Ke.PERMITTED_KEYS.has(t.key) && !Ke.isKeyCombinationPermitted(t) && t.preventDefault();
237
237
  }
238
238
  }, {
239
239
  key: "isKeyCombinationPermitted",
@@ -249,8 +249,8 @@ var We = /*#__PURE__*/function () {
249
249
  }
250
250
  }]);
251
251
  }();
252
- We.PERMITTED_KEYS = /* @__PURE__ */new Set([N.BACKSPACE, N.DELETE, N.ARROW_RIGHT, N.ARROW_LEFT, N.ARROW_DOWN, N.ARROW_UP, N.META, N.CONTROL, N.ENTER]);
253
- var ls = We;
252
+ Ke.PERMITTED_KEYS = /* @__PURE__ */new Set([N.BACKSPACE, N.DELETE, N.ARROW_RIGHT, N.ARROW_LEFT, N.ARROW_DOWN, N.ARROW_UP, N.META, N.CONTROL, N.ENTER]);
253
+ var ls = Ke;
254
254
  var Ln = /*#__PURE__*/function () {
255
255
  function Ln() {
256
256
  _classCallCheck(this, Ln);
@@ -265,17 +265,17 @@ var Ln = /*#__PURE__*/function () {
265
265
  }
266
266
  }]);
267
267
  }();
268
- var Ke = /*#__PURE__*/function () {
269
- function Ke(e, t, i) {
268
+ var Je = /*#__PURE__*/function () {
269
+ function Je(e, t, i) {
270
270
  var _this = this;
271
- _classCallCheck(this, Ke);
271
+ _classCallCheck(this, Je);
272
272
  var r, o;
273
- var s = Ke.processConfig(t, e.textInput);
274
- this.elementRef = Ke.createContainerElement((r = s == null ? void 0 : s.styles) == null ? void 0 : r.container), this._config = s, this.inputElementRef = this.createInputElement(), this.elementRef.appendChild(this.inputElementRef), e.setPlaceholderText = this.setPlaceholderText.bind(this), e.setPlaceholderText(((o = this._config.placeholder) == null ? void 0 : o.text) || "Ask me anything!"), setTimeout(function () {
273
+ var s = Je.processConfig(t, e.textInput);
274
+ this.elementRef = Je.createContainerElement((r = s == null ? void 0 : s.styles) == null ? void 0 : r.container), this._config = s, this.inputElementRef = this.createInputElement(), this.elementRef.appendChild(this.inputElementRef), e.setPlaceholderText = this.setPlaceholderText.bind(this), e.setPlaceholderText(((o = this._config.placeholder) == null ? void 0 : o.text) || "Ask me anything!"), setTimeout(function () {
275
275
  ls.add(_this.inputElementRef, i, _this._config.characterLimit, e._validationHandler);
276
276
  });
277
277
  }
278
- return _createClass(Ke, [{
278
+ return _createClass(Je, [{
279
279
  key: "clear",
280
280
  value:
281
281
  // this also similarly prevents scroll up
@@ -291,7 +291,7 @@ var Ke = /*#__PURE__*/function () {
291
291
  value: function createInputElement() {
292
292
  var t, i, s, r;
293
293
  var e = document.createElement("div");
294
- return e.id = Ke.TEXT_INPUT_ID, e.classList.add("text-input-styling"), Ct.IS_CHROMIUM && Ke.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;
294
+ return e.id = Je.TEXT_INPUT_ID, e.classList.add("text-input-styling"), Ct.IS_CHROMIUM && Je.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;
295
295
  }
296
296
  }, {
297
297
  key: "removePlaceholderStyle",
@@ -368,8 +368,8 @@ var Ke = /*#__PURE__*/function () {
368
368
  }
369
369
  }]);
370
370
  }();
371
- Ke.TEXT_INPUT_ID = "text-input";
372
- var pi = Ke;
371
+ Je.TEXT_INPUT_ID = "text-input";
372
+ var pi = Je;
373
373
  var Yt = /*#__PURE__*/function () {
374
374
  function Yt() {
375
375
  _classCallCheck(this, Yt);
@@ -634,11 +634,11 @@ var le = /*#__PURE__*/function () {
634
634
  }();
635
635
  le.DEFAULT_FILE_NAME = "file", le.FILE_BUBBLE_CLASS = "file-message";
636
636
  var j = le;
637
- var ne = /*#__PURE__*/function () {
638
- function ne() {
639
- _classCallCheck(this, ne);
637
+ var X = /*#__PURE__*/function () {
638
+ function X() {
639
+ _classCallCheck(this, X);
640
640
  }
641
- return _createClass(ne, null, [{
641
+ return _createClass(X, null, [{
642
642
  key: "checkForContainerStyles",
643
643
  value: function checkForContainerStyles(e, t) {
644
644
  var i = e.containerStyle;
@@ -714,19 +714,28 @@ var ne = /*#__PURE__*/function () {
714
714
  if (!e) return;
715
715
  var t = structuredClone(e),
716
716
  i = t.loading;
717
- return i && (i.outerContainer || i.innerContainer || i.bubble || i.media) && (console.error("The loading message styles are defined using LoadingMessageStyles interface since version 2.0.2."), console.error("Check it out here: https://deepchat.dev/docs/messages/styles#LoadingMessageStyles"), t.loading = {
717
+ return i && (i.outerContainer || i.innerContainer || i.bubble || i.media) && (console.error("The loading message styles are defined using LoadingMessageStyles interface since version 2.1.0."), console.error("Check it out here: https://deepchat.dev/docs/messages/styles#LoadingMessageStyles"), t.loading = {
718
718
  message: {
719
719
  styles: i
720
720
  }
721
721
  }), t;
722
722
  }
723
+ }, {
724
+ key: "processDemo",
725
+ value: function processDemo(e) {
726
+ if (typeof e == "boolean") return e;
727
+ var t = structuredClone(e);
728
+ return t.displayLoadingBubble && (console.error("The demo displayLoadingBubble property is deprecated since version 2.1.0."), console.error("Please use displayLoading instead: https://deepchat.dev/docs/messages/styles#LoadingMessageStyles"), t.displayLoading = {
729
+ message: !0
730
+ }), t;
731
+ }
723
732
  }]);
724
733
  }();
725
- var Ye = /*#__PURE__*/function () {
726
- function Ye() {
727
- _classCallCheck(this, Ye);
734
+ var Qe = /*#__PURE__*/function () {
735
+ function Qe() {
736
+ _classCallCheck(this, Qe);
728
737
  }
729
- return _createClass(Ye, null, [{
738
+ return _createClass(Qe, null, [{
730
739
  key: "mouseUp",
731
740
  value: function mouseUp(e, t) {
732
741
  R.unsetAllCSSMouseStates(e, t), Object.assign(e.style, t["default"]), Object.assign(e.style, t.hover);
@@ -749,7 +758,7 @@ var Ye = /*#__PURE__*/function () {
749
758
  }, {
750
759
  key: "add",
751
760
  value: function add(e, t) {
752
- e.addEventListener("mouseenter", Ye.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", Ye.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", Ye.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", Ye.mouseUp.bind(this, e, t));
761
+ e.addEventListener("mouseenter", Qe.mouseEnter.bind(this, e, t)), e.addEventListener("mouseleave", Qe.mouseLeave.bind(this, e, t)), e.addEventListener("mousedown", Qe.mouseDown.bind(this, e, t)), e.addEventListener("mouseup", Qe.mouseUp.bind(this, e, t));
753
762
  }
754
763
  }]);
755
764
  }();
@@ -837,7 +846,7 @@ var Oe = /*#__PURE__*/function () {
837
846
  var o = i.getElementsByClassName(r);
838
847
  Array.from(o || []).forEach(function (a) {
839
848
  var l = Oe.getProcessedStyles(t, a, r);
840
- ie.applyStylesToElement(a, l), Oe.applyEvents(a, r);
849
+ se.applyStylesToElement(a, l), Oe.applyEvents(a, r);
841
850
  });
842
851
  });
843
852
  var s = i.getElementsByClassName(Fn);
@@ -847,15 +856,15 @@ var Oe = /*#__PURE__*/function () {
847
856
  }
848
857
  }]);
849
858
  }();
850
- var ie = /*#__PURE__*/function () {
851
- function ie() {
852
- _classCallCheck(this, ie);
859
+ var se = /*#__PURE__*/function () {
860
+ function se() {
861
+ _classCallCheck(this, se);
853
862
  }
854
- return _createClass(ie, null, [{
863
+ return _createClass(se, null, [{
855
864
  key: "applyStylesToElement",
856
865
  value: function applyStylesToElement(e, t) {
857
866
  var i = R.processStateful(t, {}, {});
858
- Ye.add(e, i), Object.assign(e.style, i["default"]);
867
+ Qe.add(e, i), Object.assign(e.style, i["default"]);
859
868
  }
860
869
  }, {
861
870
  key: "applyEventsToElement",
@@ -870,7 +879,7 @@ var ie = /*#__PURE__*/function () {
870
879
  value: function applyClassUtilitiesToElement(e, t) {
871
880
  var i = t.events,
872
881
  s = t.styles;
873
- i && ie.applyEventsToElement(e, i), s && !Oe.doesElementContainDeepChatClass(e) && ie.applyStylesToElement(e, s);
882
+ i && se.applyEventsToElement(e, i), s && !Oe.doesElementContainDeepChatClass(e) && se.applyStylesToElement(e, s);
874
883
  }
875
884
  }, {
876
885
  key: "applyCustomClassUtilities",
@@ -878,20 +887,20 @@ var ie = /*#__PURE__*/function () {
878
887
  Object.keys(e).forEach(function (i) {
879
888
  var s = t.getElementsByClassName(i);
880
889
  Array.from(s).forEach(function (r) {
881
- e[i] && ie.applyClassUtilitiesToElement(r, e[i]);
890
+ e[i] && se.applyClassUtilitiesToElement(r, e[i]);
882
891
  });
883
892
  });
884
893
  }
885
894
  }, {
886
895
  key: "apply",
887
896
  value: function apply(e, t) {
888
- Oe.applyDeepChatUtilities(e, e.htmlClassUtilities, t), ie.applyCustomClassUtilities(e.htmlClassUtilities, t);
897
+ Oe.applyDeepChatUtilities(e, e.htmlClassUtilities, t), se.applyCustomClassUtilities(e.htmlClassUtilities, t);
889
898
  }
890
899
  }, {
891
900
  key: "traverseNodes",
892
901
  value: function traverseNodes(e, t) {
893
902
  e.nodeType === Node.ELEMENT_NODE && t.push(e.outerHTML), e.childNodes.forEach(function (i) {
894
- ie.traverseNodes(i, t);
903
+ se.traverseNodes(i, t);
895
904
  });
896
905
  }
897
906
  }, {
@@ -900,7 +909,7 @@ var ie = /*#__PURE__*/function () {
900
909
  var i = new DOMParser().parseFromString(e, "text/html"),
901
910
  s = [];
902
911
  return i.body.childNodes.forEach(function (r) {
903
- ie.traverseNodes(r, s);
912
+ se.traverseNodes(r, s);
904
913
  }), s;
905
914
  }
906
915
  }]);
@@ -923,7 +932,7 @@ var Ae = /*#__PURE__*/function () {
923
932
  }, {
924
933
  key: "overwriteElements",
925
934
  value: function overwriteElements(e, t, i) {
926
- i.bubbleElement.innerHTML = t, ie.apply(e, i.outerContainer), ne.flagHTMLUpdateClass(i.bubbleElement);
935
+ i.bubbleElement.innerHTML = t, se.apply(e, i.outerContainer), X.flagHTMLUpdateClass(i.bubbleElement);
927
936
  }
928
937
  // prettier-ignore
929
938
  }, {
@@ -939,7 +948,7 @@ var Ae = /*#__PURE__*/function () {
939
948
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
940
949
  var o;
941
950
  var r = Ae.createElements(e, t, i, s);
942
- return b.fillEmptyMessageElement(r.bubbleElement, t), ie.apply(e, r.outerContainer), ne.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
951
+ return b.fillEmptyMessageElement(r.bubbleElement, t), se.apply(e, r.outerContainer), X.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
943
952
  }
944
953
  // prettier-ignore
945
954
  }, {
@@ -1832,12 +1841,12 @@ function gr(n, e, t, i) {
1832
1841
  y,
1833
1842
  P,
1834
1843
  V,
1835
- Be,
1844
+ Fe,
1836
1845
  I,
1837
- X = !0,
1838
- Y,
1846
+ Y = !0,
1847
+ Q,
1839
1848
  B,
1840
- qe,
1849
+ ze,
1841
1850
  Mt;
1842
1851
  if ((h = Ws(n, e)) >= 0) v = !0;else if ((h = $s(n, e)) >= 0) v = !1;else return !1;
1843
1852
  if (n.level >= n.options.maxNesting) return !1;
@@ -1845,21 +1854,21 @@ function gr(n, e, t, i) {
1845
1854
  for (P = n.tokens.length, v ? (d = n.bMarks[e] + n.tShift[e], m = Number(n.src.substr(d, h - d - 1)), n.tokens.push({
1846
1855
  type: "ordered_list_open",
1847
1856
  order: m,
1848
- lines: Be = [e, 0],
1857
+ lines: Fe = [e, 0],
1849
1858
  level: n.level++
1850
1859
  })) : n.tokens.push({
1851
1860
  type: "bullet_list_open",
1852
- lines: Be = [e, 0],
1861
+ lines: Fe = [e, 0],
1853
1862
  level: n.level++
1854
- }), s = e, V = !1, Y = n.parser.ruler.getRules("list"); s < t && (y = n.skipSpaces(h), u = n.eMarks[s], y >= u ? f = 1 : f = y - h, f > 4 && (f = 1), f < 1 && (f = 1), r = h - n.bMarks[s] + f, n.tokens.push({
1863
+ }), s = e, V = !1, Q = n.parser.ruler.getRules("list"); s < t && (y = n.skipSpaces(h), u = n.eMarks[s], y >= u ? f = 1 : f = y - h, f > 4 && (f = 1), f < 1 && (f = 1), r = h - n.bMarks[s] + f, n.tokens.push({
1855
1864
  type: "list_item_open",
1856
1865
  lines: I = [e, 0],
1857
1866
  level: n.level++
1858
- }), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = y - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || V) && (X = !1), V = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
1867
+ }), a = n.blkIndent, l = n.tight, o = n.tShift[e], c = n.parentType, n.tShift[e] = y - n.bMarks[e], n.blkIndent = r, n.tight = !0, n.parentType = "list", n.parser.tokenize(n, e, t, !0), (!n.tight || V) && (Y = !1), V = n.line - e > 1 && n.isEmpty(n.line - 1), n.blkIndent = a, n.tShift[e] = o, n.tight = l, n.parentType = c, n.tokens.push({
1859
1868
  type: "list_item_close",
1860
1869
  level: --n.level
1861
1870
  }), s = e = n.line, I[1] = s, y = n.bMarks[e], !(s >= t || n.isEmpty(s) || n.tShift[s] < n.blkIndent));) {
1862
- for (Mt = !1, B = 0, qe = Y.length; B < qe; B++) if (Y[B](n, s, t, !0)) {
1871
+ for (Mt = !1, B = 0, ze = Q.length; B < ze; B++) if (Q[B](n, s, t, !0)) {
1863
1872
  Mt = !0;
1864
1873
  break;
1865
1874
  }
@@ -1872,7 +1881,7 @@ function gr(n, e, t, i) {
1872
1881
  return n.tokens.push({
1873
1882
  type: v ? "ordered_list_close" : "bullet_list_close",
1874
1883
  level: --n.level
1875
- }), Be[1] = s, n.line = s, X && mr(n, P), !0;
1884
+ }), Fe[1] = s, n.line = s, Y && mr(n, P), !0;
1876
1885
  }
1877
1886
  function br(n, e, t, i) {
1878
1887
  var s,
@@ -2945,7 +2954,7 @@ var mi = /*#__PURE__*/function () {
2945
2954
  }));
2946
2955
  j.reAddFileRefToObject(t, s), (r = e.onMessage) == null || r.call(e, s), e.dispatchEvent(new CustomEvent("message", {
2947
2956
  detail: s
2948
- })), ne.fireOnNewMessage(e, s);
2957
+ })), X.fireOnNewMessage(e, s);
2949
2958
  }
2950
2959
  }, {
2951
2960
  key: "onClearMessages",
@@ -3029,12 +3038,12 @@ var F = /*#__PURE__*/function () {
3029
3038
  }]);
3030
3039
  }();
3031
3040
  F.CLASS = "loading-history-message", F.FULL_VIEW_CLASS = "loading-history-message-full-view", F.SMALL_CLASS = "loading-history-message-small";
3032
- var tt = F;
3041
+ var Ne = F;
3033
3042
  var pe = /*#__PURE__*/function () {
3034
3043
  function pe(e) {
3035
3044
  var _this3 = this;
3036
3045
  _classCallCheck(this, pe);
3037
- this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = pe.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = Gt.createNew(e.remarkable), this._avatars = e.avatars, this._names = e.names, this._onMessage = mi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
3046
+ this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = pe.createContainerElement(), this.messageStyles = X.processMessageStyles(e.messageStyles), this._remarkable = Gt.createNew(e.remarkable), this._avatars = e.avatars, this._names = e.names, this._onMessage = mi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
3038
3047
  _this3.submitUserMessage = e.submitUserMessage;
3039
3048
  });
3040
3049
  }
@@ -3090,7 +3099,7 @@ var pe = /*#__PURE__*/function () {
3090
3099
  var r;
3091
3100
  (r = this._introPanel) == null || r.hide();
3092
3101
  var s = this.messageElementRefs[this.messageElementRefs.length - 1];
3093
- return tt.changeFullViewToSmall(this, s), pe.isTemporaryElement(s) && (this.revealRoleElementsIfTempRemoved(s, t), s.outerContainer.remove(), this.messageElementRefs.pop()), this.createMessageElements(e, t, i);
3102
+ return Ne.changeFullViewToSmall(this, s), pe.isTemporaryElement(s) && (this.revealRoleElementsIfTempRemoved(s, t), s.outerContainer.remove(), this.messageElementRefs.pop()), this.createMessageElements(e, t, i);
3094
3103
  }
3095
3104
  // this can be tested by having an ai message, then a temp ai message with html that submits new user message:
3096
3105
  // https://github.com/OvidijusParsiunas/deep-chat/issues/258
@@ -3135,6 +3144,7 @@ var pe = /*#__PURE__*/function () {
3135
3144
  value: function applyCustomStyles(e, t, i, s) {
3136
3145
  e && this.messageStyles && z.applyCustomStyles(this.messageStyles, e, t, i, s);
3137
3146
  }
3147
+ // WORK - add a customProps to allow devs to add custom properties
3138
3148
  }, {
3139
3149
  key: "removeMessage",
3140
3150
  value: function removeMessage(e) {
@@ -3221,23 +3231,23 @@ var pe = /*#__PURE__*/function () {
3221
3231
  }]);
3222
3232
  }();
3223
3233
  pe.TEXT_BUBBLE_CLASS = "text-message", pe.INTRO_CLASS = "deep-chat-intro";
3224
- var Ne = pe;
3234
+ var De = pe;
3225
3235
  var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
3226
3236
  xo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADNQTFRF////9vX18vLy/Pz86enp4+Li2tnZ1tbWzczM+fn57Ozs4N/f09LS0M/P5uXl7+/v3dzcwtncCAAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAZNSURBVHja7d3bdtsqEABQYABZSLH9/3+ZpnUsIcF5iOM6PfElNoMHMfPQdq3GmL0GkLhEUqLaUExnOtOZznSmM53pTGc605nOdKYznelMZzrTmV4LXSqllKyJDkob26xWq8Zae/iH0QoWTm9d1xur4WuypQJtTd+5dqn0VjcxzNO5/57mEBvdLo8Oron6aseWOjYOFkVvjQs3DmgyONMuht52EfztP+4hdu0i6LCO808/M8c1lE/fuPGej41uUzgdtoO/75N+2ELJ9I3b3//hPXbiMenm3pR/Jt4USgcLBIp4Bh10gqKVhvLo0klCxeSky96nKcj3siw6pJIL4XsoiQ7apyvMY/V3HHrSRioLopvEhSpTCn2TPEuwKYMOIX0tAxRBf/Hpa+lfSqBv9gi1FPsNfTrMAiVmIE/vJhz61FGnQxRIEYE4vfNYdN8Rp6MlHaHotHTn8ejekaZPAjEmyvQWdZFTtYTpXqCGJ0zvcek9Yfoel76nS0ffv1NMp1ca+pkgyfRCGind4L7OWWc605l+cxjsyhqy9AGbPpClc1/nvl5VX0c/3Alk6RU3+Am7shNZ+h6bvidLr7jBB+zKBrL0irOOudmIUDzTmf5gIP+iEuXtRuTVaEmY/oZLfyNMrzjryPc0gerMTdpVg0tvjJUU6bLPcGOoUv46SLL6Wi8yhLf06C7TUyekI0efRaaYqdFltkeNpPumRPSMDxgBYvSM035FrKAmH72hRW99PrpvSdEHkTEGUvSsK3yKVDkuJ92RohcZaehzzirPpOg+J92Tolfc4Cumx5xVXpGiZ34+ICX6W84qv5GiR5NPbiIpOv6BCoSvSkTX+eiaGP092zINvBOj4x8mSf9FqejvNo/cvpOji19ZbmviL0GPLsYMFzgzCor0+Bv/ePDvSJKOb9dJ5UlnbnEHiHgzv6cdTpJOWuc/u3FEucLDOL75xGtBiefrcwgoC9NDSH/jkH6pAuXmBqPQ9HSUPVdZBH1GGOrMXAQdYxcKZfxAoK+KKBKFLosoEoX+u4giUehz8jlcnAuhp78I46yDYNAd+QLR6K+pr+yvxdBTHyVDubQh0UfSxaHSd0lbvNkVRE87JGOtc+PQd2QLQ6fHhJkKsSh6yg13tO08JPprsgrrXWH0dJd2vH1MLPprot4eXoujpzrdhngiD40ek2y92lggPcnWa8qN1Yz0BFuvZhRl0uOfR0v4Ewuli/Bg4Qr3lArqGdndQ3UPO1EunXYwnelMZzrTmc50pjOd6UxnOtOZznSmM53pTGf6kuj6oedFKV0s3fX6sX1S3bsi6a4PD7+/YAqYeBw6pIB/4qEgOqxdSPbGiim4NRRCbzs3Jj0L4UfXtQXQVRfn5IdA/Bw7RZzurEV6EtdsLeGXkIPuA+K1UoVeA0l62zmN/LqfSSft9KkepmoRuvi3nd5uKNFB9zbbXEANqdr941XO0NJx2v2jdJenpf+/3bvn0ts16ph+sd6hX7dPo2+2cZzE02Ia43bzDHqr+2Evnhz74ZHU30ffbKOeng1/NPV30Ns1gYQnSP2P6e65Pfxc6h02XZqXQCjhJ6kPL6bFo4NrGvAU4UII4SE2P1vQuZkuOxckVfehisF1MjUddN/MZBN+kvq5uf0O/xa66gyNS9ktMWlz44rO1Z8C19i5FPdHzPamXn+F3hryPfxMr78+4F+kq22kO6Rf6fUQt+puuustyWv4rbG3l/duztFB96GYoe1cTBdXMr+nw9qVM6ZfxOvzezff0nXi/ZOndvrR6Zvpm0c3h6nhdb+5iS7tsIim/qXZD9+97/Jf+rpZ5BET1ayv0GUzLhEuhBBjIy/RdVPgndutIRt9nt7p5cKFEEJ3Z+jQFDZL+XnMDXxHB73gxn5s9Kc3d3/pFciFkN/QTSXHJpX5l66gDrkQoP6hL3xsPw39la4qOiV8tH78XeSbue6N9mvWa6J/ybpc1CT1Wnh5Qq9meP8IOKH3ddH7E/ri1iYux/SXDrXR4UiPdck/wUpU+FtPf6/orja6O9KL3l56LOvVxe5Ib2qjN0d6Vbex4ghWlU3bPqI90If66MNng680FNpbJijH6kCvaF3uMzQ3+IrpFerV4Y9dffQdN3im10ivbuImhD3Qq5u4HdZkua8znelMZ/pS4z9CPVKkxowNxgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0wMy0yN1QxNTo0NToxNSswMDowMN1xSg4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDMtMjdUMTU6NDU6MTUrMDA6MDCsLPKyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==",
3227
- Q = /*#__PURE__*/function () {
3228
- function Q() {
3229
- _classCallCheck(this, Q);
3237
+ ee = /*#__PURE__*/function () {
3238
+ function ee() {
3239
+ _classCallCheck(this, ee);
3230
3240
  }
3231
- return _createClass(Q, null, [{
3241
+ return _createClass(ee, null, [{
3232
3242
  key: "hide",
3233
3243
  value: function hide(e) {
3234
3244
  var t;
3235
- (t = e.getElementsByClassName(Q.CONTAINER_CLASS)[0].style).visibility || (t.visibility = "hidden");
3245
+ (t = e.getElementsByClassName(ee.CONTAINER_CLASS)[0].style).visibility || (t.visibility = "hidden");
3236
3246
  }
3237
3247
  }, {
3238
3248
  key: "reveal",
3239
3249
  value: function reveal(e) {
3240
- e.getElementsByClassName(Q.CONTAINER_CLASS)[0].style.visibility = "";
3250
+ e.getElementsByClassName(ee.CONTAINER_CLASS)[0].style.visibility = "";
3241
3251
  }
3242
3252
  }, {
3243
3253
  key: "applyCustomStylesToElements",
@@ -3248,10 +3258,10 @@ var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
3248
3258
  key: "applyCustomStyles",
3249
3259
  value: function applyCustomStyles(e, t, i, s) {
3250
3260
  var r, o, a, l;
3251
- if ((r = i["default"]) != null && r.styles && Q.applyCustomStylesToElements(e, t, i["default"].styles), s === b.USER_ROLE) (o = i.user) != null && o.styles && Q.applyCustomStylesToElements(e, t, i.user.styles);else {
3252
- (a = i.ai) != null && a.styles && Q.applyCustomStylesToElements(e, t, i.ai.styles);
3261
+ if ((r = i["default"]) != null && r.styles && ee.applyCustomStylesToElements(e, t, i["default"].styles), s === b.USER_ROLE) (o = i.user) != null && o.styles && ee.applyCustomStylesToElements(e, t, i.user.styles);else {
3262
+ (a = i.ai) != null && a.styles && ee.applyCustomStylesToElements(e, t, i.ai.styles);
3253
3263
  var c = (l = i[s]) == null ? void 0 : l.styles;
3254
- c && Q.applyCustomStylesToElements(e, t, c);
3264
+ c && ee.applyCustomStylesToElements(e, t, c);
3255
3265
  }
3256
3266
  }
3257
3267
  }, {
@@ -3261,7 +3271,7 @@ var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
3261
3271
  var i = document.createElement("img");
3262
3272
  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) || xo : 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) || So, i.classList.add("avatar"), i.alt = "".concat(e, " avatar");
3263
3273
  var s = document.createElement("div");
3264
- return s.classList.add(Q.CONTAINER_CLASS), s.appendChild(i), t && Q.applyCustomStyles(s, i, t, e), s;
3274
+ return s.classList.add(ee.CONTAINER_CLASS), s.appendChild(i), t && ee.applyCustomStyles(s, i, t, e), s;
3265
3275
  }
3266
3276
  }, {
3267
3277
  key: "getPosition",
@@ -3275,14 +3285,14 @@ var So = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e
3275
3285
  key: "add",
3276
3286
  value: function add(e, t, i) {
3277
3287
  var s = typeof i == "boolean" ? void 0 : i,
3278
- r = Q.createAvatar(t, s),
3279
- o = Q.getPosition(t, s);
3288
+ r = ee.createAvatar(t, s),
3289
+ o = ee.getPosition(t, s);
3280
3290
  r.classList.add(o === "left" ? "left-item-position" : "right-item-position"), e.insertAdjacentElement(o === "left" ? "beforebegin" : "afterend", r);
3281
3291
  }
3282
3292
  }]);
3283
3293
  }();
3284
- Q.CONTAINER_CLASS = "avatar-container";
3285
- var Pt = Q;
3294
+ ee.CONTAINER_CLASS = "avatar-container";
3295
+ var Pt = ee;
3286
3296
  var Ee = /*#__PURE__*/function () {
3287
3297
  function Ee() {
3288
3298
  _classCallCheck(this, Ee);
@@ -3470,7 +3480,7 @@ var w = /*#__PURE__*/function () {
3470
3480
  key: "generateMessageBodyElements",
3471
3481
  value: function generateMessageBodyElements(e, t) {
3472
3482
  var i = {};
3473
- return e.text && (i.text = w.findMessageElements(t, Ne.TEXT_BUBBLE_CLASS)), e.html && (i.html = w.findMessageElements(t, Se.HTML_BUBBLE_CLASS)), e.files && (i.files = w.filterdMessageElements(t, j.FILE_BUBBLE_CLASS)), i;
3483
+ return e.text && (i.text = w.findMessageElements(t, De.TEXT_BUBBLE_CLASS)), e.html && (i.html = w.findMessageElements(t, Se.HTML_BUBBLE_CLASS)), e.files && (i.files = w.filterdMessageElements(t, j.FILE_BUBBLE_CLASS)), i;
3474
3484
  }
3475
3485
  }, {
3476
3486
  key: "generateMessageBody",
@@ -3549,7 +3559,7 @@ var bt = /*#__PURE__*/function () {
3549
3559
  var e;
3550
3560
  if (!(this._endStreamAfterOperation || !this._message) && !(this._fileAdded && !this._elements)) {
3551
3561
  if (!this._elements) throw Error(M.NO_VALID_STREAM_EVENTS_SENT);
3552
- (e = this._elements.bubbleElement) != null && e.classList.contains(bt.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && St.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && ie.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(bt.MESSAGE_CLASS), this._message && this._messages.sendClientUpdate(Ne.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
3562
+ (e = this._elements.bubbleElement) != null && e.classList.contains(bt.MESSAGE_CLASS) && (this._streamType === "text" ? this._messages.textToSpeech && St.speak(this._message.text || "", this._messages.textToSpeech) : this._streamType === "html" && this._elements && se.apply(this._messages, this._elements.outerContainer), this._elements.bubbleElement.classList.remove(bt.MESSAGE_CLASS), this._message && this._messages.sendClientUpdate(De.createMessageContent(this._message), !1), this._hasStreamEnded = !0);
3553
3563
  }
3554
3564
  }
3555
3565
  }, {
@@ -3596,11 +3606,11 @@ var bt = /*#__PURE__*/function () {
3596
3606
  }();
3597
3607
  bt.MESSAGE_CLASS = "streamed-message";
3598
3608
  var _e = bt;
3599
- var Je = /*#__PURE__*/function () {
3600
- function Je() {
3601
- _classCallCheck(this, Je);
3609
+ var Ze = /*#__PURE__*/function () {
3610
+ function Ze() {
3611
+ _classCallCheck(this, Ze);
3602
3612
  }
3603
- return _createClass(Je, null, [{
3613
+ return _createClass(Ze, null, [{
3604
3614
  key: "tempRemoveContentHeader",
3605
3615
  value: // need to pass stringifyBody boolean separately as binding is throwing an error for some reason
3606
3616
  // prettier-ignore
@@ -3616,8 +3626,8 @@ var Je = /*#__PURE__*/function () {
3616
3626
  }
3617
3627
  throw new Error("Request settings have not been set up");
3618
3628
  case 2:
3619
- s = e.headers[Je.CONTENT_TYPE];
3620
- delete e.headers[Je.CONTENT_TYPE];
3629
+ s = e.headers[Ze.CONTENT_TYPE];
3630
+ delete e.headers[Ze.CONTENT_TYPE];
3621
3631
  _context2.prev = 4;
3622
3632
  _context2.next = 7;
3623
3633
  return t(i);
@@ -3628,9 +3638,9 @@ var Je = /*#__PURE__*/function () {
3628
3638
  case 10:
3629
3639
  _context2.prev = 10;
3630
3640
  _context2.t0 = _context2["catch"](4);
3631
- throw e.headers[Je.CONTENT_TYPE] = s, _context2.t0;
3641
+ throw e.headers[Ze.CONTENT_TYPE] = s, _context2.t0;
3632
3642
  case 13:
3633
- return _context2.abrupt("return", (e.headers[Je.CONTENT_TYPE] = s, r));
3643
+ return _context2.abrupt("return", (e.headers[Ze.CONTENT_TYPE] = s, r));
3634
3644
  case 14:
3635
3645
  case "end":
3636
3646
  return _context2.stop();
@@ -3723,8 +3733,8 @@ var Je = /*#__PURE__*/function () {
3723
3733
  }
3724
3734
  }]);
3725
3735
  }();
3726
- Je.CONTENT_TYPE = "Content-Type";
3727
- var E = Je;
3736
+ Ze.CONTENT_TYPE = "Content-Type";
3737
+ var E = Ze;
3728
3738
  function _o(_x12, _x13) {
3729
3739
  return _o2.apply(this, arguments);
3730
3740
  }
@@ -3857,13 +3867,13 @@ function Mo(n, e) {
3857
3867
  P(), h();
3858
3868
  });
3859
3869
  var V = c !== null && c !== void 0 ? c : window.fetch,
3860
- Be = s !== null && s !== void 0 ? s : Ro;
3870
+ Fe = s !== null && s !== void 0 ? s : Ro;
3861
3871
  function I() {
3862
3872
  return _I.apply(this, arguments);
3863
3873
  }
3864
3874
  function _I() {
3865
3875
  _I = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3866
- var X, Y, B;
3876
+ var Y, Q, B;
3867
3877
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3868
3878
  while (1) switch (_context4.prev = _context4.next) {
3869
3879
  case 0:
@@ -3875,12 +3885,12 @@ function Mo(n, e) {
3875
3885
  signal: m.signal
3876
3886
  }));
3877
3887
  case 4:
3878
- Y = _context4.sent;
3888
+ Q = _context4.sent;
3879
3889
  _context4.next = 7;
3880
- return Be(Y);
3890
+ return Fe(Q);
3881
3891
  case 7:
3882
3892
  _context4.next = 9;
3883
- return _o(Y.body, wo(Co(function (B) {
3893
+ return _o(Q.body, wo(Co(function (B) {
3884
3894
  B ? f[Ys] = B : delete f[Ys];
3885
3895
  }, function (B) {
3886
3896
  v = B;
@@ -3895,7 +3905,7 @@ function Mo(n, e) {
3895
3905
  _context4.prev = 14;
3896
3906
  _context4.t0 = _context4["catch"](1);
3897
3907
  if (!m.signal.aborted) try {
3898
- B = (X = a == null ? void 0 : a(_context4.t0)) !== null && X !== void 0 ? X : v;
3908
+ B = (Y = a == null ? void 0 : a(_context4.t0)) !== null && Y !== void 0 ? Y : v;
3899
3909
  window.clearTimeout(y), y = window.setTimeout(I, B);
3900
3910
  } catch (B) {
3901
3911
  P(), u(B);
@@ -3931,7 +3941,7 @@ var A = /*#__PURE__*/function () {
3931
3941
  y,
3932
3942
  P,
3933
3943
  V,
3934
- Be,
3944
+ Fe,
3935
3945
  o,
3936
3946
  _yield$E$processReque,
3937
3947
  a,
@@ -3986,7 +3996,7 @@ var A = /*#__PURE__*/function () {
3986
3996
  return _context7.abrupt("return", (Mo(((P = e.connectSettings) == null ? void 0 : P.url) || e.url || "", {
3987
3997
  method: ((V = e.connectSettings) == null ? void 0 : V.method) || "POST",
3988
3998
  headers: l,
3989
- credentials: (Be = e.connectSettings) == null ? void 0 : Be.credentials,
3999
+ credentials: (Fe = e.connectSettings) == null ? void 0 : Fe.credentials,
3990
4000
  body: s ? JSON.stringify(a) : a,
3991
4001
  openWhenHidden: !0,
3992
4002
  // keep stream open when browser tab not open
@@ -4014,7 +4024,7 @@ var A = /*#__PURE__*/function () {
4014
4024
  },
4015
4025
  onmessage: function onmessage(I) {
4016
4026
  return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
4017
- var X, Y, B, qe, Mt;
4027
+ var Y, Q, B, ze, Mt;
4018
4028
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
4019
4029
  while (1) switch (_context6.prev = _context6.next) {
4020
4030
  case 0:
@@ -4023,25 +4033,25 @@ var A = /*#__PURE__*/function () {
4023
4033
  break;
4024
4034
  }
4025
4035
  try {
4026
- qe = JSON.parse(I.data);
4036
+ ze = JSON.parse(I.data);
4027
4037
  } catch (_unused6) {
4028
- qe = {};
4038
+ ze = {};
4029
4039
  }
4030
4040
  _context6.next = 4;
4031
- return (Y = (X = e.deepChat).responseInterceptor) == null ? void 0 : Y.call(X, qe);
4041
+ return (Q = (Y = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(Y, ze);
4032
4042
  case 4:
4033
4043
  _context6.t0 = _context6.sent;
4034
4044
  if (_context6.t0) {
4035
4045
  _context6.next = 7;
4036
4046
  break;
4037
4047
  }
4038
- _context6.t0 = qe;
4048
+ _context6.t0 = ze;
4039
4049
  case 7:
4040
4050
  Mt = _context6.t0;
4041
- (B = e.extractResultData) == null || B.call(e, Mt, m, a).then(function (ze) {
4042
- e.asyncCallInProgress && ze && ze.text !== "" ? (A.simulate(i, e.streamHandlers, ze), h(), e.asyncCallInProgress = !1) : A.upsertWFiles(i, f.upsertStreamedMessage.bind(f), f, ze);
4043
- })["catch"](function (ze) {
4044
- return E.displayError(i, ze);
4051
+ (B = e.extractResultData) == null || B.call(e, Mt, m, a).then(function (Ge) {
4052
+ e.asyncCallInProgress && Ge && Ge.text !== "" ? (A.simulate(i, e.streamHandlers, Ge), h(), e.asyncCallInProgress = !1) : A.upsertWFiles(i, f.upsertStreamedMessage.bind(f), f, Ge);
4053
+ })["catch"](function (Ge) {
4054
+ return E.displayError(i, Ge);
4045
4055
  });
4046
4056
  case 9:
4047
4057
  case "end":
@@ -4062,11 +4072,11 @@ var A = /*#__PURE__*/function () {
4062
4072
  },
4063
4073
  signal: u.signal
4064
4074
  })["catch"](function (I) {
4065
- var X;
4066
- i.isLastMessageError() || (X = e.extractResultData) == null || X.call(e, I).then(function () {
4075
+ var Y;
4076
+ i.isLastMessageError() || (Y = e.extractResultData) == null || Y.call(e, I).then(function () {
4067
4077
  E.displayError(i, I);
4068
- })["catch"](function (Y) {
4069
- E.displayError(i, Y);
4078
+ })["catch"](function (Q) {
4079
+ E.displayError(i, Q);
4070
4080
  });
4071
4081
  }), f));
4072
4082
  case 21:
@@ -4094,7 +4104,7 @@ var A = /*#__PURE__*/function () {
4094
4104
  }
4095
4105
  if (i.html) {
4096
4106
  t.onOpen();
4097
- var _r2 = ie.splitHTML(i.html);
4107
+ var _r2 = se.splitHTML(i.html);
4098
4108
  _r2.length === 0 && (_r2 = i.html.split("")), A.populateMessages(_r2, new _e(e), s, "html");
4099
4109
  }
4100
4110
  }
@@ -4143,11 +4153,11 @@ var A = /*#__PURE__*/function () {
4143
4153
  }
4144
4154
  }]);
4145
4155
  }();
4146
- var Ze = /*#__PURE__*/function () {
4147
- function Ze() {
4148
- _classCallCheck(this, Ze);
4156
+ var Xe = /*#__PURE__*/function () {
4157
+ function Xe() {
4158
+ _classCallCheck(this, Xe);
4149
4159
  }
4150
- return _createClass(Ze, null, [{
4160
+ return _createClass(Xe, null, [{
4151
4161
  key: "generateResponse",
4152
4162
  value: function generateResponse(e) {
4153
4163
  var t = e[e.length - 1][0];
@@ -4172,15 +4182,15 @@ var Ze = /*#__PURE__*/function () {
4172
4182
  value: function getResponse(_ref3) {
4173
4183
  var e = _ref3.customDemoResponse,
4174
4184
  t = _ref3.messageToElements;
4175
- return e ? Ze.getCustomResponse(e, t[t.length - 1][0]) : {
4176
- text: Ze.generateResponse(t)
4185
+ return e ? Xe.getCustomResponse(e, t[t.length - 1][0]) : {
4186
+ text: Xe.generateResponse(t)
4177
4187
  };
4178
4188
  }
4179
4189
  // timeout is used to simulate a timeout for a response to come back
4180
4190
  }, {
4181
4191
  key: "request",
4182
4192
  value: function request(e, t) {
4183
- var i = Ze.getResponse(t);
4193
+ var i = Xe.getResponse(t);
4184
4194
  setTimeout(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
4185
4195
  var r, o, s;
4186
4196
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -4210,14 +4220,14 @@ var Ze = /*#__PURE__*/function () {
4210
4220
  key: "requestStream",
4211
4221
  value: function requestStream(e, t) {
4212
4222
  setTimeout(function () {
4213
- var i = Ze.getResponse(e);
4223
+ var i = Xe.getResponse(e);
4214
4224
  A.simulate(e, t, i);
4215
4225
  }, 400);
4216
4226
  }
4217
4227
  }]);
4218
4228
  }();
4219
- Ze.URL = "deep-chat-demo";
4220
- var we = Ze;
4229
+ Xe.URL = "deep-chat-demo";
4230
+ var we = Xe;
4221
4231
  var U = /*#__PURE__*/function () {
4222
4232
  function U() {
4223
4233
  _classCallCheck(this, U);
@@ -4482,7 +4492,7 @@ var Ie = /*#__PURE__*/function () {
4482
4492
  value: function attemptToFinaliseStream(e, t) {
4483
4493
  try {
4484
4494
  var i = t.messageElementRefs[t.messageElementRefs.length - 1];
4485
- Ne.isLoadingMessage(i) ? t.removeLastMessage() : e.finaliseStreamedMessage();
4495
+ De.isLoadingMessage(i) ? t.removeLastMessage() : e.finaliseStreamedMessage();
4486
4496
  } catch (i) {
4487
4497
  console.error(i), t.addNewErrorMessage("service", i);
4488
4498
  }
@@ -4891,7 +4901,7 @@ var vt = /*#__PURE__*/function () {
4891
4901
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
4892
4902
  while (1) switch (_context19.prev = _context19.next) {
4893
4903
  case 0:
4894
- t = tt.addMessage(this._messages);
4904
+ t = Ne.addMessage(this._messages);
4895
4905
  _context19.next = 3;
4896
4906
  return e();
4897
4907
  case 3:
@@ -4922,7 +4932,7 @@ var vt = /*#__PURE__*/function () {
4922
4932
  i = _this$_messages.messageToElements,
4923
4933
  s = _this$_messages.elementRef,
4924
4934
  r = (a = t.find(function (l) {
4925
- return !l.outerContainer.classList.contains(Ne.INTRO_CLASS);
4935
+ return !l.outerContainer.classList.contains(De.INTRO_CLASS);
4926
4936
  })) == null ? void 0 : a.outerContainer,
4927
4937
  o = s.scrollTop;
4928
4938
  e == null || e.reverse().map(function (l) {
@@ -4969,7 +4979,7 @@ var vt = /*#__PURE__*/function () {
4969
4979
  break;
4970
4980
  }
4971
4981
  _this10._isLoading = !0;
4972
- t = tt.addMessage(_this10._messages, !1);
4982
+ t = Ne.addMessage(_this10._messages, !1);
4973
4983
  _context20.prev = 3;
4974
4984
  _context20.next = 6;
4975
4985
  return e(_this10._index++);
@@ -5004,7 +5014,7 @@ var vt = /*#__PURE__*/function () {
5004
5014
  value: function populateInitialHistory(e) {
5005
5015
  var _this11 = this;
5006
5016
  e.forEach(function (t) {
5007
- ne.processHistoryFile(t), _this11._messages.addNewMessage(t, !0);
5017
+ X.processHistoryFile(t), _this11._messages.addNewMessage(t, !0);
5008
5018
  });
5009
5019
  }
5010
5020
  }, {
@@ -5017,7 +5027,7 @@ var vt = /*#__PURE__*/function () {
5017
5027
  while (1) switch (_context22.prev = _context22.next) {
5018
5028
  case 0:
5019
5029
  this._isLoading = !0;
5020
- t = tt.addMessage(this._messages);
5030
+ t = Ne.addMessage(this._messages);
5021
5031
  _context22.prev = 2;
5022
5032
  _context22.next = 5;
5023
5033
  return e(this._index++);
@@ -5055,7 +5065,7 @@ var vt = /*#__PURE__*/function () {
5055
5065
  while (1) switch (_context23.prev = _context23.next) {
5056
5066
  case 0:
5057
5067
  e.loadHistory && this.loadInitialHistory(e.loadHistory);
5058
- t = e.history || ne.processHistory(e);
5068
+ t = e.history || X.processHistory(e);
5059
5069
  t && (this.populateInitialHistory(t), this._index += 1);
5060
5070
  case 3:
5061
5071
  case "end":
@@ -5127,7 +5137,7 @@ var O = /*#__PURE__*/function () {
5127
5137
  files: t
5128
5138
  };
5129
5139
  if (_typeof(s) == "object") {
5130
- ne.processFileConfigConnect(s);
5140
+ X.processFileConfigConnect(s);
5131
5141
  var a = s.files,
5132
5142
  l = s.connect,
5133
5143
  c = s.button;
@@ -5226,7 +5236,7 @@ var nt = /*#__PURE__*/function () {
5226
5236
  var _a$url;
5227
5237
  _classCallCheck(this, nt);
5228
5238
  var s, r, o, a, l;
5229
- this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = nt.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, O.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = we.URL), this.connectSettings.websocket && U.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || ne.checkForStream(this.deepChat), e.loadHistory && Vt.addErrorPrefix(this);
5239
+ this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = nt.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, O.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = we.URL), this.connectSettings.websocket && U.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || X.checkForStream(this.deepChat), e.loadHistory && Vt.addErrorPrefix(this);
5230
5240
  }
5231
5241
  return _createClass(nt, [{
5232
5242
  key: "verifyKey",
@@ -5390,7 +5400,7 @@ var nt = /*#__PURE__*/function () {
5390
5400
  _context29.next = 4;
5391
5401
  break;
5392
5402
  }
5393
- return _context29.abrupt("return", ne.handleResponseProperty(e));
5403
+ return _context29.abrupt("return", X.handleResponseProperty(e));
5394
5404
  case 4:
5395
5405
  if (!E.validateResponseFormat(e)) {
5396
5406
  _context29.next = 6;
@@ -5555,32 +5565,32 @@ ke._attributes_ = {}, ke._attributeToProperty_ = {};
5555
5565
  var fs = ke;
5556
5566
  var Io = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
5557
5567
  Lo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
5558
- var se = /*#__PURE__*/function () {
5559
- function se() {
5560
- _classCallCheck(this, se);
5568
+ var ne = /*#__PURE__*/function () {
5569
+ function ne() {
5570
+ _classCallCheck(this, ne);
5561
5571
  }
5562
- return _createClass(se, null, [{
5572
+ return _createClass(ne, null, [{
5563
5573
  key: "createSVGElement",
5564
5574
  value: function createSVGElement(e) {
5565
5575
  return new DOMParser().parseFromString(e, "image/svg+xml").documentElement;
5566
5576
  }
5567
5577
  }]);
5568
5578
  }();
5569
- var Fe = /*#__PURE__*/function () {
5570
- function Fe() {
5571
- _classCallCheck(this, Fe);
5579
+ var Ue = /*#__PURE__*/function () {
5580
+ function Ue() {
5581
+ _classCallCheck(this, Ue);
5572
5582
  }
5573
- return _createClass(Fe, null, [{
5583
+ return _createClass(Ue, null, [{
5574
5584
  key: "changeVisibility",
5575
5585
  value:
5576
5586
  // prettier-ignore
5577
5587
  function changeVisibility(e, t, i, s) {
5578
- s.target.id === Fe.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
5588
+ s.target.id === Ue.VISIBLE_ICON_ID ? (t.style.display = "none", i.style.display = "block", e.type = "password") : (t.style.display = "block", i.style.display = "none", e.type = "text");
5579
5589
  }
5580
5590
  }, {
5581
5591
  key: "createIconElement",
5582
5592
  value: function createIconElement(e, t) {
5583
- var i = se.createSVGElement(e);
5593
+ var i = ne.createSVGElement(e);
5584
5594
  return i.id = t, i.classList.add("visibility-icon"), i;
5585
5595
  }
5586
5596
  // prettier-ignore
@@ -5589,15 +5599,15 @@ var Fe = /*#__PURE__*/function () {
5589
5599
  value: function create(e) {
5590
5600
  var t = document.createElement("div");
5591
5601
  t.id = "visibility-icon-container";
5592
- var i = Fe.createIconElement(Lo, Fe.VISIBLE_ICON_ID);
5602
+ var i = Ue.createIconElement(Lo, Ue.VISIBLE_ICON_ID);
5593
5603
  i.style.display = "none", t.appendChild(i);
5594
- var s = Fe.createIconElement(Io, "not-visible-icon");
5595
- return t.appendChild(s), t.onclick = Fe.changeVisibility.bind(this, e, i, s), t;
5604
+ var s = Ue.createIconElement(Io, "not-visible-icon");
5605
+ return t.appendChild(s), t.onclick = Ue.changeVisibility.bind(this, e, i, s), t;
5596
5606
  }
5597
5607
  }]);
5598
5608
  }();
5599
- Fe.VISIBLE_ICON_ID = "visible-icon";
5600
- var ps = Fe;
5609
+ Ue.VISIBLE_ICON_ID = "visible-icon";
5610
+ var ps = Ue;
5601
5611
  var H = /*#__PURE__*/function () {
5602
5612
  function H() {
5603
5613
  _classCallCheck(this, H);
@@ -5725,25 +5735,25 @@ var H = /*#__PURE__*/function () {
5725
5735
  }
5726
5736
  }]);
5727
5737
  }();
5728
- var ee = /*#__PURE__*/function () {
5729
- function ee() {
5730
- _classCallCheck(this, ee);
5738
+ var te = /*#__PURE__*/function () {
5739
+ function te() {
5740
+ _classCallCheck(this, te);
5731
5741
  }
5732
- return _createClass(ee, null, [{
5742
+ return _createClass(te, null, [{
5733
5743
  key: "enableButtons",
5734
5744
  value: function enableButtons(e, t) {
5735
5745
  var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
5736
5746
  window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < $t.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
5737
- return ee.enableButtons(e, t, i + 1);
5747
+ return te.enableButtons(e, t, i + 1);
5738
5748
  }, 250);
5739
5749
  }
5740
5750
  // prettier-ignore
5741
5751
  }, {
5742
5752
  key: "setUpInitial",
5743
5753
  value: function setUpInitial(e, t, i, s) {
5744
- var r = (t == null ? void 0 : t.downloadClass) || ee.DOWNLOAD_BUTTON_CLASS,
5745
- o = (t == null ? void 0 : t.uploadClass) || ee.UPLOAD_BUTTON_CLASS,
5746
- a = (t == null ? void 0 : t.fileInputClass) || ee.FILE_INPUT_CLASS;
5754
+ var r = (t == null ? void 0 : t.downloadClass) || te.DOWNLOAD_BUTTON_CLASS,
5755
+ o = (t == null ? void 0 : t.uploadClass) || te.UPLOAD_BUTTON_CLASS,
5756
+ a = (t == null ? void 0 : t.fileInputClass) || te.FILE_INPUT_CLASS;
5747
5757
  return setTimeout(function () {
5748
5758
  var l = i == null ? void 0 : i.getElementsByClassName(r)[0],
5749
5759
  c = i == null ? void 0 : i.getElementsByClassName(a)[0],
@@ -5754,7 +5764,7 @@ var ee = /*#__PURE__*/function () {
5754
5764
  c.files && c.files.length > 0 && e(c.files);
5755
5765
  }), d && (d.onclick = function () {
5756
5766
  return c.click();
5757
- }), (l || d) && ee.enableButtons(l, d);
5767
+ }), (l || d) && te.enableButtons(l, d);
5758
5768
  }), (t == null ? void 0 : t.initialHtml) || "<div>\n Download or upload a web model that will run entirely on your browser: <br/> \n <button disabled class=\"".concat(r, " deep-chat-button deep-chat-web-model-button\">Download</button>\n ").concat(s ? "" : "<input type=\"file\" class=\"".concat(a, "\" hidden multiple />\n <button disabled class=\"").concat(o, " deep-chat-button deep-chat-web-model-button\">Upload</button>"), "\n </div>");
5759
5769
  }
5760
5770
  }, {
@@ -5779,18 +5789,18 @@ var ee = /*#__PURE__*/function () {
5779
5789
  }, {
5780
5790
  key: "setUpAfterLoad",
5781
5791
  value: function setUpAfterLoad(e, t, i, s) {
5782
- var r = (t == null ? void 0 : t.exportFilesClass) || ee.EXPORT_BUTTON_CLASS;
5792
+ var r = (t == null ? void 0 : t.exportFilesClass) || te.EXPORT_BUTTON_CLASS;
5783
5793
  return setTimeout(function () {
5784
5794
  var o = i == null ? void 0 : i.getElementsByClassName(r)[0];
5785
5795
  o && (o.onclick = function () {
5786
- return ee.exportFile(e);
5796
+ return te.exportFile(e);
5787
5797
  });
5788
5798
  }), (t == null ? void 0 : t.afterLoadHtml) || "<div>\n Model loaded successfully and has been cached for future requests.\n ".concat(s ? "" : "<br/> <button style=\"margin-top: 5px\" class=\"".concat(r, " deep-chat-button\">Export</button>"), "\n </div>");
5789
5799
  }
5790
5800
  }]);
5791
5801
  }();
5792
- ee.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button", ee.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button", ee.FILE_INPUT_CLASS = "deep-chat-file-input", ee.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
5793
- var bi = ee;
5802
+ te.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button", te.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button", te.FILE_INPUT_CLASS = "deep-chat-file-input", te.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
5803
+ var bi = te;
5794
5804
  var Qs = {
5795
5805
  model_list: [
5796
5806
  // Llama-2
@@ -6533,8 +6543,8 @@ var Ut = /*#__PURE__*/function (_G) {
6533
6543
  }]);
6534
6544
  }(G);
6535
6545
  Ut.URL_PREFIX = "https://api-inference.huggingface.co/models/";
6536
- var De = Ut;
6537
- var Qt = /*#__PURE__*/function (_De) {
6546
+ var Be = Ut;
6547
+ var Qt = /*#__PURE__*/function (_Be) {
6538
6548
  // prettier-ignore
6539
6549
  function Qt(e, t, i, s, r, o) {
6540
6550
  var _this22;
@@ -6542,7 +6552,7 @@ var Qt = /*#__PURE__*/function (_De) {
6542
6552
  _this22 = _callSuper(this, Qt, [e, t, i, s, r, o]), _this22.isTextInputDisabled = !0, _this22.canSendMessage = Qt.canSendFile;
6543
6553
  return _this22;
6544
6554
  }
6545
- _inherits(Qt, _De);
6555
+ _inherits(Qt, _Be);
6546
6556
  return _createClass(Qt, [{
6547
6557
  key: "preprocessBody",
6548
6558
  value: function preprocessBody(e, t, i) {
@@ -6586,7 +6596,7 @@ var Qt = /*#__PURE__*/function (_De) {
6586
6596
  return !!(t != null && t[0]);
6587
6597
  }
6588
6598
  }]);
6589
- }(De);
6599
+ }(Be);
6590
6600
  var Po = /*#__PURE__*/function (_Qt) {
6591
6601
  // prettier-ignore
6592
6602
  function Po(e) {
@@ -6989,7 +6999,7 @@ var No = /*#__PURE__*/function (_Qt3) {
6989
6999
  }()
6990
7000
  }]);
6991
7001
  }(Qt);
6992
- var Do = /*#__PURE__*/function (_De2) {
7002
+ var Do = /*#__PURE__*/function (_Be2) {
6993
7003
  function Do(e) {
6994
7004
  _classCallCheck(this, Do);
6995
7005
  var s, r, o;
@@ -6997,7 +7007,7 @@ var Do = /*#__PURE__*/function (_De2) {
6997
7007
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
6998
7008
  return _callSuper(this, Do, [e, "Once upon a time", "gpt2", t, i]);
6999
7009
  }
7000
- _inherits(Do, _De2);
7010
+ _inherits(Do, _Be2);
7001
7011
  return _createClass(Do, [{
7002
7012
  key: "extractResultData",
7003
7013
  value: function () {
@@ -7027,8 +7037,8 @@ var Do = /*#__PURE__*/function (_De2) {
7027
7037
  return extractResultData;
7028
7038
  }()
7029
7039
  }]);
7030
- }(De);
7031
- var Bo = /*#__PURE__*/function (_De3) {
7040
+ }(Be);
7041
+ var Bo = /*#__PURE__*/function (_Be3) {
7032
7042
  function Bo(e) {
7033
7043
  var _this26;
7034
7044
  _classCallCheck(this, Bo);
@@ -7038,7 +7048,7 @@ var Bo = /*#__PURE__*/function (_De3) {
7038
7048
  _this26 = _callSuper(this, Bo, [e, "Ask a question", "bert-large-uncased-whole-word-masking-finetuned-squad", t, i]), _this26.permittedErrorPrefixes = ["Authorization header", "Error in"], _this26.context = t.context;
7039
7049
  return _this26;
7040
7050
  }
7041
- _inherits(Bo, _De3);
7051
+ _inherits(Bo, _Be3);
7042
7052
  return _createClass(Bo, [{
7043
7053
  key: "preprocessBody",
7044
7054
  value: function preprocessBody(e, t) {
@@ -7081,8 +7091,8 @@ var Bo = /*#__PURE__*/function (_De3) {
7081
7091
  return extractResultData;
7082
7092
  }()
7083
7093
  }]);
7084
- }(De);
7085
- var Fo = /*#__PURE__*/function (_De4) {
7094
+ }(Be);
7095
+ var Fo = /*#__PURE__*/function (_Be4) {
7086
7096
  function Fo(e) {
7087
7097
  _classCallCheck(this, Fo);
7088
7098
  var s, r, o;
@@ -7090,7 +7100,7 @@ var Fo = /*#__PURE__*/function (_De4) {
7090
7100
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7091
7101
  return _callSuper(this, Fo, [e, "Insert text to summarize", "facebook/bart-large-cnn", t, i]);
7092
7102
  }
7093
- _inherits(Fo, _De4);
7103
+ _inherits(Fo, _Be4);
7094
7104
  return _createClass(Fo, [{
7095
7105
  key: "extractResultData",
7096
7106
  value: function () {
@@ -7120,8 +7130,8 @@ var Fo = /*#__PURE__*/function (_De4) {
7120
7130
  return extractResultData;
7121
7131
  }()
7122
7132
  }]);
7123
- }(De);
7124
- var Uo = /*#__PURE__*/function (_De5) {
7133
+ }(Be);
7134
+ var Uo = /*#__PURE__*/function (_Be5) {
7125
7135
  function Uo(e) {
7126
7136
  var _this27$maxMessages;
7127
7137
  var _this27;
@@ -7133,7 +7143,7 @@ var Uo = /*#__PURE__*/function (_De5) {
7133
7143
  return _this27;
7134
7144
  }
7135
7145
  // prettier-ignore
7136
- _inherits(Uo, _De5);
7146
+ _inherits(Uo, _Be5);
7137
7147
  return _createClass(Uo, [{
7138
7148
  key: "processMessages",
7139
7149
  value: function processMessages(e) {
@@ -7202,7 +7212,7 @@ var Uo = /*#__PURE__*/function (_De5) {
7202
7212
  return extractResultData;
7203
7213
  }()
7204
7214
  }]);
7205
- }(De);
7215
+ }(Be);
7206
7216
  var Si = /*#__PURE__*/function (_Ui3) {
7207
7217
  function Si(e) {
7208
7218
  var _this28;
@@ -7310,7 +7320,7 @@ var Si = /*#__PURE__*/function (_Ui3) {
7310
7320
  }
7311
7321
  }]);
7312
7322
  }(Ui);
7313
- var jo = /*#__PURE__*/function (_De6) {
7323
+ var jo = /*#__PURE__*/function (_Be6) {
7314
7324
  function jo(e) {
7315
7325
  _classCallCheck(this, jo);
7316
7326
  var s, r, o;
@@ -7318,7 +7328,7 @@ var jo = /*#__PURE__*/function (_De6) {
7318
7328
  i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
7319
7329
  return _callSuper(this, jo, [e, "Insert text to translate", "Helsinki-NLP/opus-tatoeba-en-ja", t, i]);
7320
7330
  }
7321
- _inherits(jo, _De6);
7331
+ _inherits(jo, _Be6);
7322
7332
  return _createClass(jo, [{
7323
7333
  key: "extractResultData",
7324
7334
  value: function () {
@@ -7348,7 +7358,7 @@ var jo = /*#__PURE__*/function (_De6) {
7348
7358
  return extractResultData;
7349
7359
  }()
7350
7360
  }]);
7351
- }(De);
7361
+ }(Be);
7352
7362
  var xi = /*#__PURE__*/function (_Ui4) {
7353
7363
  function xi(e) {
7354
7364
  var _this29;
@@ -7442,7 +7452,7 @@ var xi = /*#__PURE__*/function (_Ui4) {
7442
7452
  }
7443
7453
  }]);
7444
7454
  }(Ui);
7445
- var Ho = /*#__PURE__*/function (_De7) {
7455
+ var Ho = /*#__PURE__*/function (_Be7) {
7446
7456
  function Ho(e) {
7447
7457
  var _this30;
7448
7458
  _classCallCheck(this, Ho);
@@ -7452,7 +7462,7 @@ var Ho = /*#__PURE__*/function (_De7) {
7452
7462
  _this30 = _callSuper(this, Ho, [e, "The goal of life is [MASK].", "bert-base-uncased", t, i]), _this30.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>Insert a sentence with the word [MASK] and the model will try to fill it for you. E.g. I want [MASK].</p>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this30.permittedErrorPrefixes = ["Authorization header", "No mask_token"];
7453
7463
  return _this30;
7454
7464
  }
7455
- _inherits(Ho, _De7);
7465
+ _inherits(Ho, _Be7);
7456
7466
  return _createClass(Ho, [{
7457
7467
  key: "extractResultData",
7458
7468
  value: function () {
@@ -7482,7 +7492,7 @@ var Ho = /*#__PURE__*/function (_De7) {
7482
7492
  return extractResultData;
7483
7493
  }()
7484
7494
  }]);
7485
- }(De);
7495
+ }(Be);
7486
7496
  var L = /*#__PURE__*/function () {
7487
7497
  function L() {
7488
7498
  _classCallCheck(this, L);
@@ -7550,11 +7560,11 @@ var L = /*#__PURE__*/function () {
7550
7560
  }()
7551
7561
  }]);
7552
7562
  }();
7553
- var te = /*#__PURE__*/function () {
7554
- function te() {
7555
- _classCallCheck(this, te);
7563
+ var ie = /*#__PURE__*/function () {
7564
+ function ie() {
7565
+ _classCallCheck(this, ie);
7556
7566
  }
7557
- return _createClass(te, null, [{
7567
+ return _createClass(ie, null, [{
7558
7568
  key: "storeFiles",
7559
7569
  value: function () {
7560
7570
  var _storeFiles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e, t, i, s) {
@@ -7648,7 +7658,7 @@ var te = /*#__PURE__*/function () {
7648
7658
  d({
7649
7659
  src: u.target.result,
7650
7660
  name: t[c].name,
7651
- type: te.getType(t, c)
7661
+ type: ie.getType(t, c)
7652
7662
  });
7653
7663
  };
7654
7664
  });
@@ -7690,7 +7700,7 @@ var te = /*#__PURE__*/function () {
7690
7700
  break;
7691
7701
  }
7692
7702
  _context64.next = 5;
7693
- return te.getFiles(e, t, a, l);
7703
+ return ie.getFiles(e, t, a, l);
7694
7704
  case 5:
7695
7705
  o = _context64.sent;
7696
7706
  (c = r == null ? void 0 : r.text) != null && c.value && o.forEach(function (h, u) {
@@ -7734,7 +7744,7 @@ var te = /*#__PURE__*/function () {
7734
7744
  l.text && l.text.startsWith("sandbox:") && (c = l.file_path) != null && c.file_id && i.push({
7735
7745
  path: l.text,
7736
7746
  fileId: l.file_path.file_id,
7737
- name: te.getFileName(l.text)
7747
+ name: ie.getFileName(l.text)
7738
7748
  });
7739
7749
  });
7740
7750
  }), t != null && t.image_file && i.push({
@@ -7750,9 +7760,9 @@ var te = /*#__PURE__*/function () {
7750
7760
  return _regeneratorRuntime().wrap(function _callee65$(_context65) {
7751
7761
  while (1) switch (_context65.prev = _context65.next) {
7752
7762
  case 0:
7753
- r = te.getFileDetails(t, s);
7763
+ r = ie.getFileDetails(t, s);
7754
7764
  _context65.next = 3;
7755
- return te.getFilesAndNewText(e, r, i, t.role, s);
7765
+ return ie.getFilesAndNewText(e, r, i, t.role, s);
7756
7766
  case 3:
7757
7767
  return _context65.abrupt("return", _context65.sent);
7758
7768
  case 4:
@@ -7796,7 +7806,7 @@ var te = /*#__PURE__*/function () {
7796
7806
  return _regeneratorRuntime().wrap(function _callee66$(_context66) {
7797
7807
  while (1) switch (_context66.prev = _context66.next) {
7798
7808
  case 0:
7799
- s.push(te.getFilesAndText(e, r, i, o));
7809
+ s.push(ie.getFilesAndText(e, r, i, o));
7800
7810
  case 1:
7801
7811
  case "end":
7802
7812
  return _context66.stop();
@@ -7825,7 +7835,7 @@ var te = /*#__PURE__*/function () {
7825
7835
  return _regeneratorRuntime().wrap(function _callee68$(_context68) {
7826
7836
  while (1) switch (_context68.prev = _context68.next) {
7827
7837
  case 0:
7828
- return _context68.abrupt("return", te.parseMessages(e, [{
7838
+ return _context68.abrupt("return", ie.parseMessages(e, [{
7829
7839
  content: t,
7830
7840
  role: "assistant"
7831
7841
  }], i));
@@ -7848,8 +7858,8 @@ var te = /*#__PURE__*/function () {
7848
7858
  return _regeneratorRuntime().wrap(function _callee69$(_context69) {
7849
7859
  while (1) switch (_context69.prev = _context69.next) {
7850
7860
  case 0:
7851
- r = te.parseResult(t, i);
7852
- return _context69.abrupt("return", te.parseMessages(e, r, s));
7861
+ r = ie.parseResult(t, i);
7862
+ return _context69.abrupt("return", ie.parseMessages(e, r, s));
7853
7863
  case 2:
7854
7864
  case "end":
7855
7865
  return _context69.stop();
@@ -7863,14 +7873,14 @@ var te = /*#__PURE__*/function () {
7863
7873
  }()
7864
7874
  }]);
7865
7875
  }();
7866
- te.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", te.FUNCTION_TOOL_RESP_ERROR = "Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.";
7867
- var Te = te;
7868
- var Ue = /*#__PURE__*/function (_G3) {
7876
+ ie.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", ie.FUNCTION_TOOL_RESP_ERROR = "Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.";
7877
+ var Te = ie;
7878
+ var je = /*#__PURE__*/function (_G3) {
7869
7879
  // prettier-ignore
7870
- function Ue(e, t, i, s, r, o) {
7880
+ function je(e, t, i, s, r, o) {
7871
7881
  var _this31;
7872
- _classCallCheck(this, Ue);
7873
- if (_this31 = _callSuper(this, Ue, [e, s, r, o]), _this31.insertKeyPlaceholderText = "OpenAI API Key", _this31.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this31.url = "", _this31.permittedErrorPrefixes = ["Incorrect", "Please send text", Vt.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31.searchedForThreadId = !1, _this31.config = {}, _this31.newAssistantDetails = {
7882
+ _classCallCheck(this, je);
7883
+ if (_this31 = _callSuper(this, je, [e, s, r, o]), _this31.insertKeyPlaceholderText = "OpenAI API Key", _this31.keyHelpUrl = "https://platform.openai.com/account/api-keys", _this31.url = "", _this31.permittedErrorPrefixes = ["Incorrect", "Please send text", Vt.FAILED_ERROR_MESSAGE], _this31.shouldFetchHistory = !1, _this31.searchedForThreadId = !1, _this31.config = {}, _this31.newAssistantDetails = {
7874
7884
  model: "gpt-4"
7875
7885
  }, _this31.waitingForStreamResponse = !1, _this31.isSSEStream = !1, _this31.urlSegments = i, _typeof(t) == "object") {
7876
7886
  _this31.config = t;
@@ -7883,8 +7893,8 @@ var Ue = /*#__PURE__*/function (_G3) {
7883
7893
  _this31.maxMessages = 1, _this31.isSSEStream = !!(_this31.stream && (_typeof(_this31.stream) != "object" || !_this31.stream.simulation));
7884
7894
  return _assertThisInitialized(_this31);
7885
7895
  }
7886
- _inherits(Ue, _G3);
7887
- return _createClass(Ue, [{
7896
+ _inherits(je, _G3);
7897
+ return _createClass(je, [{
7888
7898
  key: "fetchHistoryFunc",
7889
7899
  value: function () {
7890
7900
  var _fetchHistoryFunc = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee70() {
@@ -7933,13 +7943,13 @@ var Ue = /*#__PURE__*/function (_G3) {
7933
7943
  }));
7934
7944
  a === "code_interpreter" || a === "file_search" || a === "images" ? r = a : (console.error("Tool type \"".concat(a, "\" is not valid")), console.error('Expected "code_interpreter" or "file_search" or "images". Going to default to "images"'));
7935
7945
  }
7936
- if (r === "file_search") return Ue.processAttachmentsMessage(s, t, "file_search");
7937
- if (r === "code_interpreter") return Ue.processAttachmentsMessage(s, t, "code_interpreter");
7946
+ if (r === "file_search") return je.processAttachmentsMessage(s, t, "file_search");
7947
+ if (r === "code_interpreter") return je.processAttachmentsMessage(s, t, "code_interpreter");
7938
7948
  if (t.find(function (_ref20) {
7939
7949
  var a = _ref20.name;
7940
7950
  return !j.isImageFileExtension(a);
7941
7951
  })) console.error("The uploaded files contained a non-image file"), console.error('Make sure only images can be uploaded or define a "code_interpreter" or "file_search" value in the "files_tool_type" property'), console.warn('Make sure your existing assistant supports these "tools" or specify them in the "new_assistant" property');else {
7942
- var _a2 = Ue.processImageMessage(s, t);
7952
+ var _a2 = je.processImageMessage(s, t);
7943
7953
  if (_a2) return _a2;
7944
7954
  }
7945
7955
  }
@@ -8205,7 +8215,7 @@ var Ue = /*#__PURE__*/function (_G3) {
8205
8215
  break;
8206
8216
  }
8207
8217
  return _context76.abrupt("return", {
8208
- timeoutMS: Ue.POLLING_TIMEOUT_MS
8218
+ timeoutMS: je.POLLING_TIMEOUT_MS
8209
8219
  });
8210
8220
  case 3:
8211
8221
  if (!(t === "completed" && this.messages)) {
@@ -8318,7 +8328,7 @@ var Ue = /*#__PURE__*/function (_G3) {
8318
8328
  }, "POST");
8319
8329
  case 22:
8320
8330
  return _context77.abrupt("return", {
8321
- timeoutMS: Ue.POLLING_TIMEOUT_MS
8331
+ timeoutMS: je.POLLING_TIMEOUT_MS
8322
8332
  });
8323
8333
  case 23:
8324
8334
  case "end":
@@ -8513,8 +8523,8 @@ var Ue = /*#__PURE__*/function (_G3) {
8513
8523
  }
8514
8524
  }]);
8515
8525
  }(G);
8516
- Ue.POLLING_TIMEOUT_MS = 800;
8517
- var _i = Ue;
8526
+ je.POLLING_TIMEOUT_MS = 800;
8527
+ var _i = je;
8518
8528
  var Di = /*#__PURE__*/function (_i10) {
8519
8529
  function Di(e) {
8520
8530
  var _o$headers2, _a$OpenAIBeta;
@@ -9503,26 +9513,26 @@ var kn = /*#__PURE__*/function (_G9) {
9503
9513
  _inherits(kn, _G9);
9504
9514
  return _createClass(kn);
9505
9515
  }(G);
9506
- var Xe = /*#__PURE__*/function (_kn) {
9516
+ var Ye = /*#__PURE__*/function (_kn) {
9507
9517
  // prettier-ignore
9508
- function Xe(e) {
9518
+ function Ye(e) {
9509
9519
  var _a$lang, _l$name, _c$gender;
9510
9520
  var _this43;
9511
- _classCallCheck(this, Xe);
9521
+ _classCallCheck(this, Ye);
9512
9522
  var s, r, o, a, l, c;
9513
9523
  var t = (r = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : r.textToSpeech,
9514
9524
  i = (o = e.directConnection) == null ? void 0 : o.azure;
9515
- _this43 = _callSuper(this, Xe, [e, ue.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this43.permittedErrorPrefixes = [Xe.REGION_ERROR_MESSAGE], _this43.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(Xe.HELP_LINK, "\">here</a> for more info.\n </p>"), _this43.isTextInputDisabled = !1, _this43.url = "", t.region ? (Object.assign(_this43.rawBody, t), (_a$lang = (a = _this43.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this43.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this43.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this43.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1")) : (_this43.isTextInputDisabled = !0, _this43.canSendMessage = function () {
9525
+ _this43 = _callSuper(this, Ye, [e, ue.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this43.permittedErrorPrefixes = [Ye.REGION_ERROR_MESSAGE], _this43.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(Ye.HELP_LINK, "\">here</a> for more info.\n </p>"), _this43.isTextInputDisabled = !1, _this43.url = "", t.region ? (Object.assign(_this43.rawBody, t), (_a$lang = (a = _this43.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this43.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this43.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this43.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1")) : (_this43.isTextInputDisabled = !0, _this43.canSendMessage = function () {
9516
9526
  return !1;
9517
9527
  }, setTimeout(function () {
9518
9528
  e.addMessage({
9519
- error: Xe.REGION_ERROR_MESSAGE
9529
+ error: Ye.REGION_ERROR_MESSAGE
9520
9530
  });
9521
9531
  }));
9522
9532
  return _this43;
9523
9533
  }
9524
- _inherits(Xe, _kn);
9525
- return _createClass(Xe, [{
9534
+ _inherits(Ye, _kn);
9535
+ return _createClass(Ye, [{
9526
9536
  key: "preprocessBody",
9527
9537
  value: function preprocessBody(e, t) {
9528
9538
  var i = t[t.length - 1].text;
@@ -9586,16 +9596,16 @@ var Xe = /*#__PURE__*/function (_kn) {
9586
9596
  }()
9587
9597
  }]);
9588
9598
  }(kn);
9589
- Xe.HELP_LINK =
9599
+ Ye.HELP_LINK =
9590
9600
  // eslint-disable-next-line max-len
9591
- "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", Xe.REGION_ERROR_MESSAGE =
9601
+ "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", Ye.REGION_ERROR_MESSAGE =
9592
9602
  // eslint-disable-next-line max-len
9593
9603
  "Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#TextToSpeech)";
9594
- var Es = Xe;
9595
- var je = /*#__PURE__*/function (_kn2) {
9596
- function je(e) {
9604
+ var Es = Ye;
9605
+ var He = /*#__PURE__*/function (_kn2) {
9606
+ function He(e) {
9597
9607
  var _this44;
9598
- _classCallCheck(this, je);
9608
+ _classCallCheck(this, He);
9599
9609
  var r, o, a;
9600
9610
  var t = (o = (r = e.directConnection) == null ? void 0 : r.azure) == null ? void 0 : o.speechToText,
9601
9611
  i = (a = e.directConnection) == null ? void 0 : a.azure,
@@ -9606,21 +9616,21 @@ var je = /*#__PURE__*/function (_kn2) {
9606
9616
  }
9607
9617
  }
9608
9618
  };
9609
- if (_this44 = _callSuper(this, je, [e, ue.buildSpeechToTextHeaders, t.region, i, s]), _this44.permittedErrorPrefixes = [je.REGION_ERROR_MESSAGE], _this44.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(je.HELP_LINK, "\">here</a> for more info.\n </p>"), _this44.url = "", _this44.isTextInputDisabled = !0, _this44.textInputPlaceholderText = "Upload an audio file", !t.region) _this44.isTextInputDisabled = !0, _this44.canSendMessage = function () {
9619
+ if (_this44 = _callSuper(this, He, [e, ue.buildSpeechToTextHeaders, t.region, i, s]), _this44.permittedErrorPrefixes = [He.REGION_ERROR_MESSAGE], _this44.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(He.HELP_LINK, "\">here</a> for more info.\n </p>"), _this44.url = "", _this44.isTextInputDisabled = !0, _this44.textInputPlaceholderText = "Upload an audio file", !t.region) _this44.isTextInputDisabled = !0, _this44.canSendMessage = function () {
9610
9620
  return !1;
9611
9621
  }, setTimeout(function () {
9612
9622
  e.addMessage({
9613
- error: je.REGION_ERROR_MESSAGE
9623
+ error: He.REGION_ERROR_MESSAGE
9614
9624
  });
9615
9625
  });else {
9616
- _this44.canSendMessage = je.canFileSendMessage;
9626
+ _this44.canSendMessage = He.canFileSendMessage;
9617
9627
  var l = t.lang || "en-US";
9618
9628
  _this44.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(l, "&format=detailed"), _this44.recordAudio = void 0;
9619
9629
  }
9620
9630
  return _assertThisInitialized(_this44);
9621
9631
  }
9622
- _inherits(je, _kn2);
9623
- return _createClass(je, [{
9632
+ _inherits(He, _kn2);
9633
+ return _createClass(He, [{
9624
9634
  key: "callServiceAPI",
9625
9635
  value: function () {
9626
9636
  var _callServiceAPI17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e, t, i) {
@@ -9686,12 +9696,12 @@ var je = /*#__PURE__*/function (_kn2) {
9686
9696
  }
9687
9697
  }]);
9688
9698
  }(kn);
9689
- je.HELP_LINK =
9699
+ He.HELP_LINK =
9690
9700
  // eslint-disable-next-line max-len
9691
- "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", je.REGION_ERROR_MESSAGE =
9701
+ "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest", He.REGION_ERROR_MESSAGE =
9692
9702
  // eslint-disable-next-line max-len
9693
9703
  "Please define a region config property. [More Information](https://deepchat.dev/docs/directConnection/Azure#SpeechToText)";
9694
- var Ss = je;
9704
+ var Ss = He;
9695
9705
  var Vo = /*#__PURE__*/function (_G10) {
9696
9706
  // prettier-ignore
9697
9707
  function Vo(e) {
@@ -10585,7 +10595,7 @@ var Jo = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg version=\"1.1\"
10585
10595
  t.classList.add("any-file-message-contents");
10586
10596
  var i = document.createElement("div");
10587
10597
  i.classList.add("any-file-message-icon-container");
10588
- var s = se.createSVGElement(Jo);
10598
+ var s = ne.createSVGElement(Jo);
10589
10599
  s.classList.add("any-file-message-icon"), i.appendChild(s);
10590
10600
  var r = document.createElement("div");
10591
10601
  return r.classList.add("any-file-message-text"), r.textContent = e.name || j.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), j.processContent("any", t, e.src, r.textContent);
@@ -10740,7 +10750,7 @@ var Zo = /*#__PURE__*/function () {
10740
10750
  }
10741
10751
  }]);
10742
10752
  }();
10743
- var de = /*#__PURE__*/function (_Ne) {
10753
+ var de = /*#__PURE__*/function (_De) {
10744
10754
  function de(e, t, i) {
10745
10755
  var _this52;
10746
10756
  _classCallCheck(this, de);
@@ -10761,16 +10771,16 @@ var de = /*#__PURE__*/function (_Ne) {
10761
10771
  }), !d);
10762
10772
  }, e.updateMessage = function (c, d) {
10763
10773
  return oe.update(_this52, c, d);
10764
- }, t.isWebModel() && t.setUpMessages(_this52), o && _this52.prepareDemo(o), e.textToSpeech && St.processConfig(e.textToSpeech, function (c) {
10774
+ }, t.isWebModel() && t.setUpMessages(_this52), o && _this52.prepareDemo(X.processDemo(o)), e.textToSpeech && St.processConfig(e.textToSpeech, function (c) {
10765
10775
  _this52.textToSpeech = c;
10766
10776
  });
10767
10777
  return _this52;
10768
10778
  }
10769
- _inherits(de, _Ne);
10779
+ _inherits(de, _De);
10770
10780
  return _createClass(de, [{
10771
10781
  key: "prepareDemo",
10772
10782
  value: function prepareDemo(e) {
10773
- _typeof(e) == "object" && (e.response && (this.customDemoResponse = e.response), e.displayErrors && (e.displayErrors["default"] && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")), e.displayLoadingBubble && this.addLoadingMessage());
10783
+ _typeof(e) == "object" && (e.response && (this.customDemoResponse = e.response), e.displayLoading && (e.displayLoading.history && (e.displayLoading.history.full && Ne.addMessage(this), e.displayLoading.history.small && Ne.addMessage(this, !1)), e.displayLoading.message && this.addLoadingMessage()), e.displayErrors && (e.displayErrors["default"] && this.addNewErrorMessage("", ""), e.displayErrors.service && this.addNewErrorMessage("service", ""), e.displayErrors.speechToText && this.addNewErrorMessage("speechToText", "")));
10774
10784
  }
10775
10785
  }, {
10776
10786
  key: "addSetupMessageIfNeeded",
@@ -10799,13 +10809,13 @@ var de = /*#__PURE__*/function (_Ne) {
10799
10809
  value: function addIntroductoryMessage(e) {
10800
10810
  var i;
10801
10811
  var t;
10802
- e != null && e.text ? t = this.createAndAppendNewMessageElement(e.text, b.AI_ROLE) : e != null && e.html && (t = Se.add(this, e.html, b.AI_ROLE, this.messageElementRefs)), t && (this.applyCustomStyles(t, b.AI_ROLE, !1, (i = this.messageStyles) == null ? void 0 : i.intro), t.outerContainer.classList.add(Ne.INTRO_CLASS));
10812
+ e != null && e.text ? t = this.createAndAppendNewMessageElement(e.text, b.AI_ROLE) : e != null && e.html && (t = Se.add(this, e.html, b.AI_ROLE, this.messageElementRefs)), t && (this.applyCustomStyles(t, b.AI_ROLE, !1, (i = this.messageStyles) == null ? void 0 : i.intro), t.outerContainer.classList.add(De.INTRO_CLASS));
10803
10813
  }
10804
10814
  }, {
10805
10815
  key: "removeIntroductoryMessage",
10806
10816
  value: function removeIntroductoryMessage() {
10807
10817
  var e = this.messageElementRefs[0];
10808
- e.outerContainer.classList.contains(Ne.INTRO_CLASS) && (e.outerContainer.remove(), this.messageElementRefs.shift());
10818
+ e.outerContainer.classList.contains(De.INTRO_CLASS) && (e.outerContainer.remove(), this.messageElementRefs.shift());
10809
10819
  }
10810
10820
  }, {
10811
10821
  key: "addAnyMessage",
@@ -10913,7 +10923,7 @@ var de = /*#__PURE__*/function (_Ne) {
10913
10923
  }, {
10914
10924
  key: "populateIntroPanel",
10915
10925
  value: function populateIntroPanel(e, t, i) {
10916
- (e || t) && (this._introPanel = new Ti(e, t, i), this._introPanel._elementRef && (ie.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
10926
+ (e || t) && (this._introPanel = new Ti(e, t, i), this._introPanel._elementRef && (se.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
10917
10927
  }
10918
10928
  }, {
10919
10929
  key: "addMultipleFiles",
@@ -10993,10 +11003,10 @@ var de = /*#__PURE__*/function (_Ne) {
10993
11003
  }, {
10994
11004
  key: "isActiveElement",
10995
11005
  value: function isActiveElement(e) {
10996
- return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(tt.CLASS) || e.contains(_e.MESSAGE_CLASS) : !1;
11006
+ return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(Ne.CLASS) || e.contains(_e.MESSAGE_CLASS) : !1;
10997
11007
  }
10998
11008
  }]);
10999
- }(Ne);
11009
+ }(De);
11000
11010
  var D = /*#__PURE__*/function () {
11001
11011
  function D() {
11002
11012
  _classCallCheck(this, D);
@@ -11081,7 +11091,7 @@ var K = /*#__PURE__*/function () {
11081
11091
  }, {
11082
11092
  key: "createElement",
11083
11093
  value: function createElement(e, t) {
11084
- return t ? K.createTextElement(e) : se.createSVGElement(e);
11094
+ return t ? K.createTextElement(e) : ne.createSVGElement(e);
11085
11095
  }
11086
11096
  }, {
11087
11097
  key: "createCustomElement",
@@ -11219,14 +11229,14 @@ var Wt = /*#__PURE__*/function () {
11219
11229
  }
11220
11230
  }]);
11221
11231
  }();
11222
- var Ge = /*#__PURE__*/function () {
11223
- function Ge() {
11224
- _classCallCheck(this, Ge);
11232
+ var Ve = /*#__PURE__*/function () {
11233
+ function Ve() {
11234
+ _classCallCheck(this, Ve);
11225
11235
  }
11226
- return _createClass(Ge, null, [{
11236
+ return _createClass(Ve, null, [{
11227
11237
  key: "addItemEvents",
11228
11238
  value: function addItemEvents(e, t, i, s) {
11229
- Ye.add(t, s), t.addEventListener("click", function () {
11239
+ Qe.add(t, s), t.addEventListener("click", function () {
11230
11240
  i.click();
11231
11241
  }), t.addEventListener("mouseenter", function (r) {
11232
11242
  e.highlightedItem = r.target;
@@ -11250,7 +11260,7 @@ var Ge = /*#__PURE__*/function () {
11250
11260
  key: "populateItem",
11251
11261
  value: function populateItem(e, t, i, s) {
11252
11262
  var r = e.children[0];
11253
- r.classList.contains("text-button") ? t.appendChild(Ge.createItemText(r.textContent, s == null ? void 0 : s.text)) : (t.appendChild(Ge.createItemIcon(e, s == null ? void 0 : s.iconContainer)), t.appendChild(Ge.createItemText(i, s == null ? void 0 : s.text)));
11263
+ r.classList.contains("text-button") ? t.appendChild(Ve.createItemText(r.textContent, s == null ? void 0 : s.text)) : (t.appendChild(Ve.createItemIcon(e, s == null ? void 0 : s.iconContainer)), t.appendChild(Ve.createItemText(i, s == null ? void 0 : s.text)));
11254
11264
  }
11255
11265
  // prettier-ignore
11256
11266
  }, {
@@ -11260,13 +11270,13 @@ var Ge = /*#__PURE__*/function () {
11260
11270
  var s = t.elementRef,
11261
11271
  r = t.dropupText,
11262
11272
  o = document.createElement("div");
11263
- Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), Ge.populateItem(s, o, r, i), o.classList.add("dropup-menu-item");
11273
+ Object.assign(o.style, (l = i == null ? void 0 : i.item) == null ? void 0 : l["default"]), Ve.populateItem(s, o, r, i), o.classList.add("dropup-menu-item");
11264
11274
  var a = R.processStateful((i == null ? void 0 : i.item) || {}, {
11265
11275
  backgroundColor: "#f3f3f3"
11266
11276
  }, {
11267
11277
  backgroundColor: "#ebebeb"
11268
11278
  });
11269
- return Ge.addItemEvents(e, o, s, a), o;
11279
+ return Ve.addItemEvents(e, o, s, a), o;
11270
11280
  }
11271
11281
  }]);
11272
11282
  }();
@@ -11297,7 +11307,7 @@ var Ps = /*#__PURE__*/function () {
11297
11307
  }, {
11298
11308
  key: "addItem",
11299
11309
  value: function addItem(e) {
11300
- var t = Ge.createItem(this, e, this._styles);
11310
+ var t = Ve.createItem(this, e, this._styles);
11301
11311
  this.elementRef.appendChild(t);
11302
11312
  }
11303
11313
  // prettier-ignore
@@ -11379,7 +11389,7 @@ var _t = /*#__PURE__*/function (_ti) {
11379
11389
  }, {
11380
11390
  key: "createSVGIconElement",
11381
11391
  value: function createSVGIconElement() {
11382
- return se.createSVGElement(Xo);
11392
+ return ne.createSVGElement(Xo);
11383
11393
  }
11384
11394
  }, {
11385
11395
  key: "createButtonContainer",
@@ -11567,7 +11577,7 @@ var Kt = /*#__PURE__*/function (_ti2) {
11567
11577
  }, {
11568
11578
  key: "createSVGIconElement",
11569
11579
  value: function createSVGIconElement() {
11570
- var e = se.createSVGElement(sa);
11580
+ var e = ne.createSVGElement(sa);
11571
11581
  return e.id = "microphone-icon", e;
11572
11582
  }
11573
11583
  }]);
@@ -11581,21 +11591,21 @@ Object.defineProperty(lt, "__esModule", {
11581
11591
  value: !0
11582
11592
  });
11583
11593
  lt.Text = void 0;
11584
- var He = /*#__PURE__*/function () {
11585
- function He() {
11586
- _classCallCheck(this, He);
11594
+ var qe = /*#__PURE__*/function () {
11595
+ function qe() {
11596
+ _classCallCheck(this, qe);
11587
11597
  }
11588
- return _createClass(He, null, [{
11598
+ return _createClass(qe, null, [{
11589
11599
  key: "capitalize",
11590
11600
  value: function capitalize(e) {
11591
- return e.replace(He.FIRST_CHAR_REGEX, function (t) {
11601
+ return e.replace(qe.FIRST_CHAR_REGEX, function (t) {
11592
11602
  return t.toUpperCase();
11593
11603
  });
11594
11604
  }
11595
11605
  }, {
11596
11606
  key: "lineBreak",
11597
11607
  value: function lineBreak(e) {
11598
- return e.replace(He.DOUBLE_LINE, "<p></p>").replace(He.ONE_LINE, "<br>");
11608
+ return e.replace(qe.DOUBLE_LINE, "<p></p>").replace(qe.ONE_LINE, "<br>");
11599
11609
  }
11600
11610
  }, {
11601
11611
  key: "isCharDefined",
@@ -11610,10 +11620,10 @@ var He = /*#__PURE__*/function () {
11610
11620
  }
11611
11621
  }]);
11612
11622
  }();
11613
- lt.Text = He;
11614
- He.FIRST_CHAR_REGEX = /\S/;
11615
- He.DOUBLE_LINE = /\n\n/g;
11616
- He.ONE_LINE = /\n/g;
11623
+ lt.Text = qe;
11624
+ qe.FIRST_CHAR_REGEX = /\S/;
11625
+ qe.DOUBLE_LINE = /\n\n/g;
11626
+ qe.ONE_LINE = /\n/g;
11617
11627
  Object.defineProperty(ii, "__esModule", {
11618
11628
  value: !0
11619
11629
  });
@@ -13068,7 +13078,7 @@ var _a = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
13068
13078
  i.classList.add("audio-placeholder-text-3-digits");
13069
13079
  var s = document.createElement("div");
13070
13080
  s.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), s.appendChild(i);
13071
- var r = se.createSVGElement(bn);
13081
+ var r = ne.createSVGElement(bn);
13072
13082
  return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(s), this.addPlaceholderAudioAttachmentEvents(t, r, s), t;
13073
13083
  }
13074
13084
  }, {
@@ -13124,9 +13134,9 @@ var _a = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
13124
13134
  var i = e.parentElement ? Z.cloneElement(e) : e,
13125
13135
  s = document.createElement("audio");
13126
13136
  s.src = t;
13127
- var r = se.createSVGElement(_a);
13137
+ var r = ne.createSVGElement(_a);
13128
13138
  r.classList.add("attachment-icon", "play-icon");
13129
- var o = se.createSVGElement(bn);
13139
+ var o = ne.createSVGElement(bn);
13130
13140
  o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), s.onplay = function () {
13131
13141
  i.replaceChildren(o);
13132
13142
  }, s.onpause = function () {
@@ -13361,7 +13371,7 @@ var be = /*#__PURE__*/function () {
13361
13371
  value: function createSVGButton(e) {
13362
13372
  var t = document.createElement("div");
13363
13373
  t.classList.add("modal-button", "modal-svg-button");
13364
- var i = se.createSVGElement(e);
13374
+ var i = ne.createSVGElement(e);
13365
13375
  return i.classList.add("modal-svg-button-icon"), t.appendChild(i), t;
13366
13376
  }
13367
13377
  }, {
@@ -13376,7 +13386,7 @@ var be = /*#__PURE__*/function () {
13376
13386
  }]);
13377
13387
  }();
13378
13388
  be.MODAL_CLOSE_TIMEOUT_MS = 190;
13379
- var Qe = be;
13389
+ var et = be;
13380
13390
  var Bt = /*#__PURE__*/function (_ti3) {
13381
13391
  // prettier-ignore
13382
13392
  function Bt(e, t, i, s, r, o) {
@@ -13415,7 +13425,7 @@ var Bt = /*#__PURE__*/function (_ti3) {
13415
13425
  key: "addClickEvent",
13416
13426
  value: function addClickEvent(e, t) {
13417
13427
  var i = this.triggerImportPrompt.bind(this, this._inputElement),
13418
- s = Qe.createTextModalFunc(e, t, i);
13428
+ s = et.createTextModalFunc(e, t, i);
13419
13429
  this.elementRef.onclick = this.click.bind(this, s);
13420
13430
  }
13421
13431
  }, {
@@ -13438,7 +13448,7 @@ var Bt = /*#__PURE__*/function (_ti3) {
13438
13448
  }, {
13439
13449
  key: "createSVGIconElement",
13440
13450
  value: function createSVGIconElement(e, t) {
13441
- var i = se.createSVGElement(t);
13451
+ var i = ne.createSVGElement(t);
13442
13452
  return i.id = e, i;
13443
13453
  }
13444
13454
  }]);
@@ -13496,11 +13506,11 @@ var Re = /*#__PURE__*/function () {
13496
13506
  }
13497
13507
  }]);
13498
13508
  }();
13499
- var Ve = /*#__PURE__*/function () {
13500
- function Ve() {
13501
- _classCallCheck(this, Ve);
13509
+ var $e = /*#__PURE__*/function () {
13510
+ function $e() {
13511
+ _classCallCheck(this, $e);
13502
13512
  }
13503
- return _createClass(Ve, null, [{
13513
+ return _createClass($e, null, [{
13504
13514
  key: "validate",
13505
13515
  value:
13506
13516
  // prettier-ignore
@@ -13524,7 +13534,7 @@ var Ve = /*#__PURE__*/function () {
13524
13534
  o = i.getAllFileData(), a = o == null ? void 0 : o.map(function (l) {
13525
13535
  return l.file;
13526
13536
  });
13527
- return _context118.abrupt("return", Ve.validate(e, s, r, a));
13537
+ return _context118.abrupt("return", $e.validate(e, s, r, a));
13528
13538
  case 5:
13529
13539
  case "end":
13530
13540
  return _context118.stop();
@@ -13547,7 +13557,7 @@ var Ve = /*#__PURE__*/function () {
13547
13557
  s = (r = t.files) == null ? void 0 : r.map(function (o) {
13548
13558
  return o.file;
13549
13559
  });
13550
- return _context119.abrupt("return", Ve.validate(e, i, t.text, s, !0));
13560
+ return _context119.abrupt("return", $e.validate(e, i, t.text, s, !0));
13551
13561
  case 2:
13552
13562
  case "end":
13553
13563
  return _context119.stop();
@@ -13568,21 +13578,21 @@ var Ve = /*#__PURE__*/function () {
13568
13578
  }, {
13569
13579
  key: "attach",
13570
13580
  value: function attach(e, t, i, s, r) {
13571
- var o = e.validateInput || ne.processValidateInput(e);
13581
+ var o = e.validateInput || X.processValidateInput(e);
13572
13582
  e._validationHandler = /*#__PURE__*/function () {
13573
13583
  var _ref33 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee120(a) {
13574
13584
  var l;
13575
13585
  return _regeneratorRuntime().wrap(function _callee120$(_context120) {
13576
13586
  while (1) switch (_context120.prev = _context120.next) {
13577
13587
  case 0:
13578
- if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !Ve.validateWebsocket(t, r))) {
13588
+ if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !$e.validateWebsocket(t, r))) {
13579
13589
  _context120.next = 2;
13580
13590
  break;
13581
13591
  }
13582
13592
  return _context120.abrupt("return", !1);
13583
13593
  case 2:
13584
13594
  l = o || t.canSendMessage;
13585
- return _context120.abrupt("return", l ? a ? Ve.useValidationFuncProgrammatic(l, a, r) : Ve.useValidationFunc(l, i, s, r) : null);
13595
+ return _context120.abrupt("return", l ? a ? $e.useValidationFuncProgrammatic(l, a, r) : $e.useValidationFunc(l, i, s, r) : null);
13586
13596
  case 4:
13587
13597
  case "end":
13588
13598
  return _context120.stop();
@@ -13709,11 +13719,11 @@ var W = /*#__PURE__*/function () {
13709
13719
  }
13710
13720
  }]);
13711
13721
  }();
13712
- var et = /*#__PURE__*/function () {
13713
- function et() {
13714
- _classCallCheck(this, et);
13722
+ var tt = /*#__PURE__*/function () {
13723
+ function tt() {
13724
+ _classCallCheck(this, tt);
13715
13725
  }
13716
- return _createClass(et, null, [{
13726
+ return _createClass(tt, null, [{
13717
13727
  key: "resetSubmit",
13718
13728
  value: function resetSubmit(e, t) {
13719
13729
  t ? e.unsetCustomStateStyles(["loading", "submit"]) : e.unsetCustomStateStyles(["stop", "loading", "submit"]), e.reapplyStateStyle("submit");
@@ -13729,13 +13739,13 @@ var et = /*#__PURE__*/function () {
13729
13739
  }, {
13730
13740
  key: "setUpDisabledButton",
13731
13741
  value: function setUpDisabledButton(e) {
13732
- W.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), W.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), W.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), W.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"), et.overwriteDefaultStyleWithSubmit(e, "disabled");
13742
+ W.setPropertyValueIfDoesNotExist(e, ["submit", "container", "default", "backgroundColor"], ""), W.setPropertyValueIfDoesNotExist(e, ["disabled", "container", "default", "backgroundColor"], "unset"), W.setPropertyValueIfDoesNotExist(e.submit, ["svg", "styles", "default", "filter"], ""), W.setPropertyValueIfDoesNotExist(e.disabled, ["svg", "styles", "default", "filter"], "brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(5564%) hue-rotate(207deg) brightness(100%) contrast(97%)"), tt.overwriteDefaultStyleWithSubmit(e, "disabled");
13733
13743
  }
13734
13744
  }, {
13735
13745
  key: "process",
13736
13746
  value: function process(e) {
13737
13747
  var t = JSON.parse(JSON.stringify(e || {}));
13738
- return et.overwriteDefaultStyleWithSubmit(t, "loading"), et.overwriteDefaultStyleWithSubmit(t, "stop"), e != null && e.alwaysEnabled || et.setUpDisabledButton(t), t;
13748
+ return tt.overwriteDefaultStyleWithSubmit(t, "loading"), tt.overwriteDefaultStyleWithSubmit(t, "stop"), e != null && e.alwaysEnabled || tt.setUpDisabledButton(t), t;
13739
13749
  }
13740
13750
  }]);
13741
13751
  }();
@@ -13744,7 +13754,7 @@ var k = /*#__PURE__*/function (_ti4) {
13744
13754
  function k(e, t, i, s, r, o) {
13745
13755
  var _this76;
13746
13756
  _classCallCheck(this, k);
13747
- var a = et.process(e.submitButtonStyles);
13757
+ var a = tt.process(e.submitButtonStyles);
13748
13758
  _this76 = _callSuper(this, k, [k.createButtonContainerElement(), a == null ? void 0 : a.position, a]), _this76._isSVGLoadingIconOverriden = !1, _this76.status = {
13749
13759
  requestInProgress: !1,
13750
13760
  loadingActive: !1
@@ -13868,7 +13878,7 @@ var k = /*#__PURE__*/function (_ti4) {
13868
13878
  return _regeneratorRuntime().wrap(function _callee122$(_context122) {
13869
13879
  while (1) switch (_context122.prev = _context122.next) {
13870
13880
  case 0:
13871
- typeof e == "string" && (e = ne.processSubmitUserMessage(e));
13881
+ typeof e == "string" && (e = X.processSubmitUserMessage(e));
13872
13882
  t = {
13873
13883
  text: e.text
13874
13884
  };
@@ -14001,7 +14011,7 @@ var k = /*#__PURE__*/function (_ti4) {
14001
14011
  key: "changeToSubmitIcon",
14002
14012
  value: function changeToSubmitIcon() {
14003
14013
  var _this79 = this;
14004
- 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), et.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
14014
+ 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), tt.resetSubmit(this, this.status.loadingActive), this.elementRef.onclick = function () {
14005
14015
  var e;
14006
14016
  _this79.submitFromInput(), (e = _this79._microphoneButton) != null && e.isActive && Zt.toggleSpeechAfterSubmit(_this79._microphoneButton.elementRef, !!_this79._stopSTTAfterSubmit);
14007
14017
  });
@@ -14028,7 +14038,7 @@ var k = /*#__PURE__*/function (_ti4) {
14028
14038
  }, {
14029
14039
  key: "createSubmitIconElement",
14030
14040
  value: function createSubmitIconElement() {
14031
- var e = se.createSVGElement(Ta);
14041
+ var e = ne.createSVGElement(Ta);
14032
14042
  return e.id = "submit-icon", e;
14033
14043
  }
14034
14044
  }, {
@@ -14051,7 +14061,7 @@ var Aa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
14051
14061
  ka = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
14052
14062
  Ma = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
14053
14063
  Ra = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
14054
- var Ns = /*#__PURE__*/function (_Qe) {
14064
+ var Ns = /*#__PURE__*/function (_et) {
14055
14065
  // prettier-ignore
14056
14066
  function Ns(e, t, i, s) {
14057
14067
  var _this80;
@@ -14060,18 +14070,18 @@ var Ns = /*#__PURE__*/function (_Qe) {
14060
14070
  var _this80$addButtonsAnd = _this80.addButtonsAndTheirEvents(t),
14061
14071
  r = _this80$addButtonsAnd.captureButton,
14062
14072
  o = _this80$addButtonsAnd.submitButton;
14063
- _this80._captureButton = r, _this80._submitButton = o, _this80._captureIcon = _this80._captureButton.children[0], _this80._refreshIcon = se.createSVGElement(Aa), _this80._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this80._format = "image/jpeg"), s != null && s.dimensions && (_this80._dimensions = s.dimensions), _this80._contentRef.appendChild(_this80._canvas), _this80.extensionCloseCallback = _this80.stop;
14073
+ _this80._captureButton = r, _this80._submitButton = o, _this80._captureIcon = _this80._captureButton.children[0], _this80._refreshIcon = ne.createSVGElement(Aa), _this80._refreshIcon.classList.add("modal-svg-button-icon", "modal-svg-refresh-icon"), (s == null ? void 0 : s.format) === "jpeg" && (_this80._format = "image/jpeg"), s != null && s.dimensions && (_this80._dimensions = s.dimensions), _this80._contentRef.appendChild(_this80._canvas), _this80.extensionCloseCallback = _this80.stop;
14064
14074
  return _this80;
14065
14075
  }
14066
- _inherits(Ns, _Qe);
14076
+ _inherits(Ns, _et);
14067
14077
  return _createClass(Ns, [{
14068
14078
  key: "addButtonsAndTheirEvents",
14069
14079
  value: function addButtonsAndTheirEvents(e) {
14070
- var t = Qe.createSVGButton(ka);
14080
+ var t = et.createSVGButton(ka);
14071
14081
  t.classList.add("modal-svg-camera-button"), t.children[0].classList.add("modal-svg-camera-icon");
14072
14082
  var i = this.addCloseButton(Ma, !0);
14073
14083
  i.classList.add("modal-svg-close-button"), i.children[0].classList.add("modal-svg-close-icon");
14074
- var s = Qe.createSVGButton(Ra);
14084
+ var s = et.createSVGButton(Ra);
14075
14085
  return s.classList.add("modal-svg-submit-button"), this.addButtons(t, s), this.addButtonEvents(t, i, s, e), {
14076
14086
  captureButton: t,
14077
14087
  submitButton: s
@@ -14099,7 +14109,7 @@ var Ns = /*#__PURE__*/function (_Qe) {
14099
14109
  _this82._captureButton.replaceChildren(_this82._captureIcon), _this82._captureButton.classList.replace("modal-svg-refresh-button", "modal-svg-camera-button");
14100
14110
  var e = _this82._canvas.getContext("2d");
14101
14111
  e == null || e.clearRect(0, 0, _this82._canvas.width, _this82._canvas.height);
14102
- }, Qe.MODAL_CLOSE_TIMEOUT_MS);
14112
+ }, et.MODAL_CLOSE_TIMEOUT_MS);
14103
14113
  }
14104
14114
  }, {
14105
14115
  key: "start",
@@ -14163,7 +14173,7 @@ var Ns = /*#__PURE__*/function (_Qe) {
14163
14173
  return r.openCameraModal.bind(r, r);
14164
14174
  }
14165
14175
  }]);
14166
- }(Qe);
14176
+ }(et);
14167
14177
  var Ia = "<?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>";
14168
14178
  var Pi = /*#__PURE__*/function (_ti5) {
14169
14179
  function Pi(e, t, i) {
@@ -14204,7 +14214,7 @@ var Pi = /*#__PURE__*/function (_ti5) {
14204
14214
  }, {
14205
14215
  key: "createSVGIconElement",
14206
14216
  value: function createSVGIconElement() {
14207
- var e = se.createSVGElement(Ia);
14217
+ var e = ne.createSVGElement(Ia);
14208
14218
  return e.id = "camera-icon", e;
14209
14219
  }
14210
14220
  }]);
@@ -14220,7 +14230,7 @@ var Ft = /*#__PURE__*/function () {
14220
14230
  button: new Zt(e, a, t.addNewErrorMessage.bind(t))
14221
14231
  });
14222
14232
  var l = new Cs(e, a, t, i, o, r);
14223
- a.submit = l.submitFromInput.bind(l), Ve.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
14233
+ a.submit = l.submitFromInput.bind(l), $e.attach(e, i, a, o, l), e.submitUserMessage = l.programmaticSubmit.bind(l), r.submit = {
14224
14234
  button: l
14225
14235
  }, Ft.addElements(this.elementRef, a, r, s, o, e.dropupStyles);
14226
14236
  }
@@ -14341,7 +14351,7 @@ var S = /*#__PURE__*/function (_fs) {
14341
14351
  key: "onRender",
14342
14352
  value: function onRender() {
14343
14353
  var _this$_childElement;
14344
- fi.attemptAppendStyleSheetToHead(this.style), ne.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = Ko.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Lt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Lt.applyDefaultStyleToComponent(this.style, this.chatStyle), ne.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? ui.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof G) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ds.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof G && H.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, mi.onRender(this);
14354
+ fi.attemptAppendStyleSheetToHead(this.style), X.processConnect(this), (!this._activeService || this._activeService.demo) && (this._activeService = Ko.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Lt.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Lt.applyDefaultStyleToComponent(this.style, this.chatStyle), X.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateKeyProperty ? ui.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof G) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], Ds.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof G && H.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, mi.onRender(this);
14345
14355
  }
14346
14356
  }, {
14347
14357
  key: "disconnectedCallback",