deep-chat-dev 9.0.11 → 9.0.12

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
@@ -123,8 +123,8 @@ var StyleUtils = /*#__PURE__*/function () {
123
123
  StyleUtils.unsetActivityCSSMouseStates(e, t), t["default"] && StyleUtils.unsetStyle(e, t["default"]);
124
124
  }
125
125
  }, {
126
- key: "generateStateful",
127
- value: function generateStateful(e, t, n) {
126
+ key: "processStateful",
127
+ value: function processStateful(e, t, n) {
128
128
  var s = e["default"] || {},
129
129
  o = Object.assign(JSON.parse(JSON.stringify(_objectSpread(_objectSpread({}, s), t))), e == null ? void 0 : e.hover),
130
130
  a = Object.assign(JSON.parse(JSON.stringify(_objectSpread(_objectSpread({}, o), n))), e == null ? void 0 : e.click);
@@ -365,19 +365,19 @@ function getLines(r) {
365
365
  var c = 0;
366
366
  for (; t < l;) {
367
367
  s && (e[t] === 10 && (c = ++t), s = !1);
368
- var d = -1;
369
- for (; t < l && d === -1; ++t) switch (e[t]) {
368
+ var u = -1;
369
+ for (; t < l && u === -1; ++t) switch (e[t]) {
370
370
  case 58:
371
371
  n === -1 && (n = t - c);
372
372
  break;
373
373
  case 13:
374
374
  s = !0;
375
375
  case 10:
376
- d = t;
376
+ u = t;
377
377
  break;
378
378
  }
379
- if (d === -1) break;
380
- r(e.subarray(c, d), n), c = t, n = -1;
379
+ if (u === -1) break;
380
+ r(e.subarray(c, u), n), c = t, n = -1;
381
381
  }
382
382
  c === l ? e = void 0 : c !== 0 && (e = e.subarray(c), t -= c);
383
383
  };
@@ -388,20 +388,20 @@ function getMessages(r, e, t) {
388
388
  return function (a, l) {
389
389
  if (a.length === 0) t == null || t(n), n = newMessage();else if (l > 0) {
390
390
  var c = s.decode(a.subarray(0, l)),
391
- d = l + (a[l + 1] === 32 ? 2 : 1),
392
- u = s.decode(a.subarray(d));
391
+ u = l + (a[l + 1] === 32 ? 2 : 1),
392
+ d = s.decode(a.subarray(u));
393
393
  switch (c) {
394
394
  case "data":
395
- n.data = n.data ? n.data + "\n" + u : u;
395
+ n.data = n.data ? n.data + "\n" + d : d;
396
396
  break;
397
397
  case "event":
398
- n.event = u;
398
+ n.event = d;
399
399
  break;
400
400
  case "id":
401
- r(n.id = u);
401
+ r(n.id = d);
402
402
  break;
403
403
  case "retry":
404
- var h = parseInt(u, 10);
404
+ var h = parseInt(d, 10);
405
405
  isNaN(h) || e(n.retry = h);
406
406
  break;
407
407
  }
@@ -437,8 +437,8 @@ function fetchEventSource(r, e) {
437
437
  a = e.onclose,
438
438
  l = e.onerror,
439
439
  c = e.openWhenHidden,
440
- d = e.fetch,
441
- u = __rest(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
440
+ u = e.fetch,
441
+ d = __rest(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
442
442
  return new Promise(function (h, f) {
443
443
  var p = Object.assign({}, n);
444
444
  p.accept || (p.accept = EventStreamContentType);
@@ -455,7 +455,7 @@ function fetchEventSource(r, e) {
455
455
  t == null || t.addEventListener("abort", function () {
456
456
  y(), h();
457
457
  });
458
- var S = d !== null && d !== void 0 ? d : window.fetch,
458
+ var S = u !== null && u !== void 0 ? u : window.fetch,
459
459
  E = s !== null && s !== void 0 ? s : defaultOnOpen;
460
460
  function x() {
461
461
  return _x3.apply(this, arguments);
@@ -469,7 +469,7 @@ function fetchEventSource(r, e) {
469
469
  b = new AbortController();
470
470
  _context.prev = 1;
471
471
  _context.next = 4;
472
- return S(r, Object.assign(Object.assign({}, u), {
472
+ return S(r, Object.assign(Object.assign({}, d), {
473
473
  headers: p,
474
474
  signal: b.signal
475
475
  }));
@@ -708,8 +708,8 @@ var Stream = /*#__PURE__*/function () {
708
708
  l,
709
709
  c,
710
710
  _e$streamHandlers,
711
- d,
712
711
  u,
712
+ d,
713
713
  h,
714
714
  f,
715
715
  _args6 = arguments;
@@ -729,14 +729,14 @@ var Stream = /*#__PURE__*/function () {
729
729
  l = _yield$RequestUtils$p.headers;
730
730
  c = _yield$RequestUtils$p.error;
731
731
  _e$streamHandlers = e.streamHandlers;
732
- d = _e$streamHandlers.onOpen;
733
- u = _e$streamHandlers.onClose;
732
+ u = _e$streamHandlers.onOpen;
733
+ d = _e$streamHandlers.onClose;
734
734
  h = _e$streamHandlers.abortStream;
735
735
  if (!c) {
736
736
  _context6.next = 14;
737
737
  break;
738
738
  }
739
- return _context6.abrupt("return", Stream.onInterceptorError(n, c, u));
739
+ return _context6.abrupt("return", Stream.onInterceptorError(n, c, d));
740
740
  case 14:
741
741
  if (!((b = e.requestSettings) != null && b.handler)) {
742
742
  _context6.next = 16;
@@ -766,7 +766,7 @@ var Stream = /*#__PURE__*/function () {
766
766
  _context5.next = 2;
767
767
  break;
768
768
  }
769
- return _context5.abrupt("return", (f = n.addNewStreamedMessage(), d()));
769
+ return _context5.abrupt("return", (f = n.addNewStreamedMessage(), u()));
770
770
  case 2:
771
771
  _context5.next = 4;
772
772
  return RequestUtils.processResponseByType(y);
@@ -791,10 +791,10 @@ var Stream = /*#__PURE__*/function () {
791
791
  }
792
792
  },
793
793
  onerror: function onerror(y) {
794
- throw u(), y;
794
+ throw d(), y;
795
795
  },
796
796
  onclose: function onclose() {
797
- n.finaliseStreamedMessage(), u();
797
+ n.finaliseStreamedMessage(), d();
798
798
  },
799
799
  signal: h.signal
800
800
  })["catch"](function (y) {
@@ -867,8 +867,8 @@ var CustomHandler = /*#__PURE__*/function () {
867
867
  case 0:
868
868
  s = !0;
869
869
  o = /*#__PURE__*/function () {
870
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(d) {
871
- var h, f, u;
870
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(u) {
871
+ var h, f, d;
872
872
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
873
873
  while (1) switch (_context7.prev = _context7.next) {
874
874
  case 0:
@@ -880,17 +880,17 @@ var CustomHandler = /*#__PURE__*/function () {
880
880
  case 2:
881
881
  s = !1;
882
882
  _context7.next = 5;
883
- return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, d);
883
+ return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, u);
884
884
  case 5:
885
885
  _context7.t0 = _context7.sent;
886
886
  if (_context7.t0) {
887
887
  _context7.next = 8;
888
888
  break;
889
889
  }
890
- _context7.t0 = d;
890
+ _context7.t0 = u;
891
891
  case 8:
892
- u = _context7.t0;
893
- !u || _typeof(u) != "object" || typeof u.error != "string" && typeof u.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, u)), n.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish()) : typeof u.error == "string" ? (console.error(u.error), n.addNewErrorMessage("service", u.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : (n.addNewMessage(u, !0, !0), e.completionsHandlers.onFinish());
892
+ d = _context7.t0;
893
+ !d || _typeof(d) != "object" || typeof d.error != "string" && typeof d.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(u, "server", !!e.deepChat.responseInterceptor, d)), n.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish()) : typeof d.error == "string" ? (console.error(d.error), n.addNewErrorMessage("service", d.error), e.completionsHandlers.onFinish()) : e.deepChat.stream && d.text ? Stream.simulate(n, e.streamHandlers, d.text) : (n.addNewMessage(d, !0, !0), e.completionsHandlers.onFinish());
894
894
  case 10:
895
895
  case "end":
896
896
  return _context7.stop();
@@ -928,16 +928,16 @@ var CustomHandler = /*#__PURE__*/function () {
928
928
  c = function c() {
929
929
  s && (n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1);
930
930
  },
931
- d = function d(p) {
931
+ u = function u(p) {
932
932
  s && (!p || _typeof(p) != "object" || typeof p.error != "string" && typeof p.text != "string" ? console.error(ErrorMessages.INVALID_RESPONSE(p, "server", !1)) : p.error ? (console.error(p.error), n.finaliseStreamedMessage(), e.streamHandlers.onClose(), n.addNewErrorMessage("service", p.error), s = !1) : p.text && a && n.updateStreamedMessage(p.text, a));
933
933
  };
934
934
  e.streamHandlers.abortStream.abort = function () {
935
935
  n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1;
936
936
  };
937
- var u = CustomHandler.generateOptionalSignals();
938
- (f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, u), {}, {
937
+ var d = CustomHandler.generateOptionalSignals();
938
+ (f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, d), {}, {
939
939
  onOpen: l,
940
- onResponse: d,
940
+ onResponse: u,
941
941
  onClose: c,
942
942
  stopClicked: e.streamHandlers.stopClicked
943
943
  }));
@@ -946,7 +946,7 @@ var CustomHandler = /*#__PURE__*/function () {
946
946
  }, {
947
947
  key: "websocket",
948
948
  value: function websocket(e, t) {
949
- var c, d;
949
+ var c, u;
950
950
  var n = {
951
951
  isOpen: !1,
952
952
  newUserMessage: {
@@ -961,7 +961,7 @@ var CustomHandler = /*#__PURE__*/function () {
961
961
  n.isOpen = !1;
962
962
  },
963
963
  a = /*#__PURE__*/function () {
964
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(u) {
964
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(d) {
965
965
  var f, p, h;
966
966
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
967
967
  while (1) switch (_context9.prev = _context9.next) {
@@ -973,17 +973,17 @@ var CustomHandler = /*#__PURE__*/function () {
973
973
  return _context9.abrupt("return");
974
974
  case 2:
975
975
  _context9.next = 4;
976
- return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f, u);
976
+ return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f, d);
977
977
  case 4:
978
978
  _context9.t0 = _context9.sent;
979
979
  if (_context9.t0) {
980
980
  _context9.next = 7;
981
981
  break;
982
982
  }
983
- _context9.t0 = u;
983
+ _context9.t0 = d;
984
984
  case 7:
985
985
  h = _context9.t0;
986
- !h || _typeof(h) != "object" || typeof h.error != "string" && typeof h.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(u, "server", !!e.deepChat.responseInterceptor, h)), t.addNewErrorMessage("service", "Error in server message")) : typeof h.error == "string" ? (console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error)) : e.deepChat.stream ? Stream.simulate(t, e.streamHandlers, h.text) : t.addNewMessage(h, !0, !0);
986
+ !h || _typeof(h) != "object" || typeof h.error != "string" && typeof h.text != "string" ? (console.error(ErrorMessages.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, h)), t.addNewErrorMessage("service", "Error in server message")) : typeof h.error == "string" ? (console.error(h.error), t.isLastMessageError() || t.addNewErrorMessage("service", h.error)) : e.deepChat.stream ? Stream.simulate(t, e.streamHandlers, h.text) : t.addNewMessage(h, !0, !0);
987
987
  case 9:
988
988
  case "end":
989
989
  return _context9.stop();
@@ -995,7 +995,7 @@ var CustomHandler = /*#__PURE__*/function () {
995
995
  };
996
996
  }(),
997
997
  l = CustomHandler.generateOptionalSignals();
998
- (d = (c = e.requestSettings).handler) == null || d.call(c, void 0, _objectSpread(_objectSpread({}, l), {}, {
998
+ (u = (c = e.requestSettings).handler) == null || u.call(c, void 0, _objectSpread(_objectSpread({}, l), {}, {
999
999
  onOpen: s,
1000
1000
  onResponse: a,
1001
1001
  onClose: o,
@@ -1039,8 +1039,8 @@ var HTTPRequest = /*#__PURE__*/function () {
1039
1039
  a,
1040
1040
  l,
1041
1041
  c,
1042
- d,
1043
1042
  u,
1043
+ d,
1044
1044
  _args11 = arguments;
1045
1045
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1046
1046
  while (1) switch (_context11.prev = _context11.next) {
@@ -1057,12 +1057,12 @@ var HTTPRequest = /*#__PURE__*/function () {
1057
1057
  a = _yield$RequestUtils$p2.body;
1058
1058
  l = _yield$RequestUtils$p2.headers;
1059
1059
  c = _yield$RequestUtils$p2.error;
1060
- d = e.completionsHandlers.onFinish;
1060
+ u = e.completionsHandlers.onFinish;
1061
1061
  if (!c) {
1062
1062
  _context11.next = 11;
1063
1063
  break;
1064
1064
  }
1065
- return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, d));
1065
+ return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, u));
1066
1066
  case 11:
1067
1067
  if (!((f = e.requestSettings) != null && f.handler)) {
1068
1068
  _context11.next = 13;
@@ -1074,15 +1074,15 @@ var HTTPRequest = /*#__PURE__*/function () {
1074
1074
  _context11.next = 15;
1075
1075
  break;
1076
1076
  }
1077
- return _context11.abrupt("return", Demo.request(n, d, e.deepChat.responseInterceptor));
1077
+ return _context11.abrupt("return", Demo.request(n, u, e.deepChat.responseInterceptor));
1078
1078
  case 15:
1079
- u = !0;
1079
+ d = !0;
1080
1080
  fetch(((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", {
1081
1081
  method: ((m = e.requestSettings) == null ? void 0 : m.method) || "POST",
1082
1082
  headers: l,
1083
1083
  body: s ? JSON.stringify(a) : a
1084
1084
  }).then(function (g) {
1085
- return u = !!g.ok, g;
1085
+ return d = !!g.ok, g;
1086
1086
  }).then(function (g) {
1087
1087
  return RequestUtils.processResponseByType(g);
1088
1088
  }).then( /*#__PURE__*/function () {
@@ -1112,7 +1112,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1112
1112
  return e.extractResultData(v);
1113
1113
  case 10:
1114
1114
  y = _context10.sent;
1115
- if (u) {
1115
+ if (d) {
1116
1116
  _context10.next = 13;
1117
1117
  break;
1118
1118
  }
@@ -1124,7 +1124,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1124
1124
  }
1125
1125
  throw Error(ErrorMessages.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, v));
1126
1126
  case 15:
1127
- y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0, !0), d()));
1127
+ y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0, !0), u()));
1128
1128
  case 16:
1129
1129
  case "end":
1130
1130
  return _context10.stop();
@@ -1135,7 +1135,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1135
1135
  return _ref4.apply(this, arguments);
1136
1136
  };
1137
1137
  }())["catch"](function (g) {
1138
- RequestUtils.displayError(n, g), d();
1138
+ RequestUtils.displayError(n, g), u();
1139
1139
  });
1140
1140
  case 17:
1141
1141
  case "end":
@@ -1157,7 +1157,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1157
1157
  return a.json();
1158
1158
  }).then( /*#__PURE__*/function () {
1159
1159
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(a) {
1160
- var c, d, l;
1160
+ var c, u, l;
1161
1161
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1162
1162
  while (1) switch (_context12.prev = _context12.next) {
1163
1163
  case 0:
@@ -1169,7 +1169,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1169
1169
  case 2:
1170
1170
  _context12.t0 = e;
1171
1171
  _context12.next = 5;
1172
- return (d = (c = e.deepChat).responseInterceptor) == null ? void 0 : d.call(c, a);
1172
+ return (u = (c = e.deepChat).responseInterceptor) == null ? void 0 : u.call(c, a);
1173
1173
  case 5:
1174
1174
  _context12.t1 = _context12.sent;
1175
1175
  if (_context12.t1) {
@@ -1213,8 +1213,8 @@ var HTTPRequest = /*#__PURE__*/function () {
1213
1213
  a,
1214
1214
  l,
1215
1215
  c,
1216
- d,
1217
1216
  u,
1217
+ d,
1218
1218
  h,
1219
1219
  f,
1220
1220
  _args13 = arguments;
@@ -1239,12 +1239,12 @@ var HTTPRequest = /*#__PURE__*/function () {
1239
1239
  }
1240
1240
  return _context13.abrupt("return", HTTPRequest.onInterceptorError(n, c));
1241
1241
  case 10:
1242
- d = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", u = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", h = s ? JSON.stringify(a) : a, f = {
1243
- method: u,
1242
+ u = ((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", d = ((m = e.requestSettings) == null ? void 0 : m.method) || "POST", h = s ? JSON.stringify(a) : a, f = {
1243
+ method: d,
1244
1244
  body: h,
1245
1245
  headers: l
1246
1246
  };
1247
- HTTPRequest.executePollRequest(e, d, f, n);
1247
+ HTTPRequest.executePollRequest(e, u, f, n);
1248
1248
  case 12:
1249
1249
  case "end":
1250
1250
  return _context13.stop();
@@ -1264,18 +1264,18 @@ var HTTPRequest = /*#__PURE__*/function () {
1264
1264
  // prettier-ignore
1265
1265
  }, {
1266
1266
  key: "verifyKey",
1267
- value: function verifyKey(e, t, n, s, o, a, l, c, d) {
1267
+ value: function verifyKey(e, t, n, s, o, a, l, c, u) {
1268
1268
  if (e === "") return a(ErrorMessages.INVALID_KEY);
1269
1269
  l(), fetch(t, {
1270
1270
  method: s,
1271
1271
  headers: n,
1272
- body: d || null
1273
- }).then(function (u) {
1274
- return RequestUtils.processResponseByType(u);
1275
- }).then(function (u) {
1276
- c(u, e, o, a);
1277
- })["catch"](function (u) {
1278
- a(ErrorMessages.CONNECTION_FAILED), console.error(u);
1272
+ body: u || null
1273
+ }).then(function (d) {
1274
+ return RequestUtils.processResponseByType(d);
1275
+ }).then(function (d) {
1276
+ c(d, e, o, a);
1277
+ })["catch"](function (d) {
1278
+ a(ErrorMessages.CONNECTION_FAILED), console.error(d);
1279
1279
  });
1280
1280
  }
1281
1281
  }]);
@@ -1371,7 +1371,7 @@ var Websocket = /*#__PURE__*/function () {
1371
1371
  value: function assignListeners(e, t, n) {
1372
1372
  t.onmessage = /*#__PURE__*/function () {
1373
1373
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
1374
- var o, a, l, c, d;
1374
+ var o, a, l, c, u;
1375
1375
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1376
1376
  while (1) switch (_context14.prev = _context14.next) {
1377
1377
  case 0:
@@ -1395,14 +1395,14 @@ var Websocket = /*#__PURE__*/function () {
1395
1395
  _context14.next = 11;
1396
1396
  return e.extractResultData(c);
1397
1397
  case 11:
1398
- d = _context14.sent;
1399
- if (!(!d || _typeof(d) != "object")) {
1398
+ u = _context14.sent;
1399
+ if (!(!u || _typeof(u) != "object")) {
1400
1400
  _context14.next = 14;
1401
1401
  break;
1402
1402
  }
1403
1403
  throw Error(ErrorMessages.INVALID_RESPONSE(l, "server", !!e.deepChat.responseInterceptor, c));
1404
1404
  case 14:
1405
- e.deepChat.stream && d.text ? Stream.simulate(n, e.streamHandlers, d.text) : n.addNewMessage(d, !0, !0);
1405
+ e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : n.addNewMessage(u, !0, !0);
1406
1406
  _context14.next = 20;
1407
1407
  break;
1408
1408
  case 17:
@@ -1427,14 +1427,14 @@ var Websocket = /*#__PURE__*/function () {
1427
1427
  value: function () {
1428
1428
  var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, n) {
1429
1429
  var s,
1430
- u,
1430
+ d,
1431
1431
  h,
1432
1432
  o,
1433
1433
  a,
1434
1434
  _yield$RequestUtils$p4,
1435
1435
  l,
1436
1436
  c,
1437
- d,
1437
+ u,
1438
1438
  _args15 = arguments;
1439
1439
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1440
1440
  while (1) switch (_context15.prev = _context15.next) {
@@ -1449,7 +1449,7 @@ var Websocket = /*#__PURE__*/function () {
1449
1449
  case 4:
1450
1450
  a = {
1451
1451
  body: t,
1452
- headers: (u = e.requestSettings) == null ? void 0 : u.headers
1452
+ headers: (d = e.requestSettings) == null ? void 0 : d.headers
1453
1453
  };
1454
1454
  _context15.next = 7;
1455
1455
  return RequestUtils.processRequestInterceptor(e.deepChat, a);
@@ -1469,14 +1469,14 @@ var Websocket = /*#__PURE__*/function () {
1469
1469
  }
1470
1470
  return _context15.abrupt("return", o.newUserMessage.listener(l));
1471
1471
  case 14:
1472
- d = s ? JSON.stringify(l) : l;
1472
+ u = s ? JSON.stringify(l) : l;
1473
1473
  if (!(((h = e.requestSettings) == null ? void 0 : h.url) === Demo.URL)) {
1474
1474
  _context15.next = 17;
1475
1475
  break;
1476
1476
  }
1477
1477
  return _context15.abrupt("return", Demo.request(n, e.completionsHandlers.onFinish, e.deepChat.responseInterceptor));
1478
1478
  case 17:
1479
- o.readyState === void 0 || o.readyState !== o.OPEN ? (console.error("Connection is not open"), n.isLastMessageError() || n.addNewErrorMessage("service", "Connection error")) : o.send(JSON.stringify(d));
1479
+ o.readyState === void 0 || o.readyState !== o.OPEN ? (console.error("Connection is not open"), n.isLastMessageError() || n.addNewErrorMessage("service", "Connection error")) : o.send(JSON.stringify(u));
1480
1480
  case 18:
1481
1481
  case "end":
1482
1482
  return _context15.stop();
@@ -1576,14 +1576,14 @@ rules.fence = function (r, e, t, n, s) {
1576
1576
  a = "",
1577
1577
  l = t.langPrefix,
1578
1578
  c = "",
1579
- d,
1580
1579
  u,
1580
+ d,
1581
1581
  h;
1582
1582
  if (o.params) {
1583
- if (d = o.params.split(/\s+/g), u = d.join(" "), has(s.rules.fence_custom, d[0])) return s.rules.fence_custom[d[0]](r, e, t, n, s);
1584
- c = escapeHtml(replaceEntities(unescapeMd(u))), a = ' class="' + l + c + '"';
1583
+ if (u = o.params.split(/\s+/g), d = u.join(" "), has(s.rules.fence_custom, u[0])) return s.rules.fence_custom[u[0]](r, e, t, n, s);
1584
+ c = escapeHtml(replaceEntities(unescapeMd(d))), a = ' class="' + l + c + '"';
1585
1585
  }
1586
- return t.highlight ? h = t.highlight.apply(t.highlight, [o.content].concat(d)) || escapeHtml(o.content) : h = escapeHtml(o.content), "<pre><code" + a + ">" + h + "</code></pre>" + getBreak(r, e);
1586
+ return t.highlight ? h = t.highlight.apply(t.highlight, [o.content].concat(u)) || escapeHtml(o.content) : h = escapeHtml(o.content), "<pre><code" + a + ">" + h + "</code></pre>" + getBreak(r, e);
1587
1587
  };
1588
1588
  rules.fence_custom = {};
1589
1589
  rules.heading_open = function (r, e) {
@@ -1916,10 +1916,10 @@ function parseLinkLabel(r, e) {
1916
1916
  return n ? (o = r.pos, r.labelUnmatchedScopes = 0) : r.labelUnmatchedScopes = t - 1, r.pos = l, r.isInLabel = c, o;
1917
1917
  }
1918
1918
  function parseAbbr(r, e, t, n) {
1919
- var s, o, a, l, c, d;
1919
+ var s, o, a, l, c, u;
1920
1920
  if (r.charCodeAt(0) !== 42 || r.charCodeAt(1) !== 91 || r.indexOf("]:") === -1 || (s = new StateInline(r, e, t, n, []), o = parseLinkLabel(s, 1), o < 0 || r.charCodeAt(o + 1) !== 58)) return -1;
1921
1921
  for (l = s.posMax, a = o + 2; a < l && s.src.charCodeAt(a) !== 10; a++);
1922
- return c = r.slice(2, o), d = r.slice(o + 2, a).trim(), d.length === 0 ? -1 : (n.abbreviations || (n.abbreviations = {}), _typeof(n.abbreviations[":" + c]) > "u" && (n.abbreviations[":" + c] = d), a);
1922
+ return c = r.slice(2, o), u = r.slice(o + 2, a).trim(), u.length === 0 ? -1 : (n.abbreviations || (n.abbreviations = {}), _typeof(n.abbreviations[":" + c]) > "u" && (n.abbreviations[":" + c] = u), a);
1923
1923
  }
1924
1924
  function abbr(r) {
1925
1925
  var e = r.tokens,
@@ -1989,15 +1989,15 @@ function normalizeReference(r) {
1989
1989
  return r.trim().replace(/\s+/g, " ").toUpperCase();
1990
1990
  }
1991
1991
  function parseReference(r, e, t, n) {
1992
- var s, o, a, l, c, d, u, h, f;
1992
+ var s, o, a, l, c, u, d, h, f;
1993
1993
  if (r.charCodeAt(0) !== 91 || r.indexOf("]:") === -1 || (s = new StateInline(r, e, t, n, []), o = parseLinkLabel(s, 0), o < 0 || r.charCodeAt(o + 1) !== 58)) return -1;
1994
1994
  for (l = s.posMax, a = o + 2; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
1995
1995
  if (!parseLinkDestination(s, a)) return -1;
1996
- for (u = s.linkContent, a = s.pos, d = a, a = a + 1; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
1997
- for (a < l && d !== a && parseLinkTitle(s, a) ? (h = s.linkContent, a = s.pos) : (h = "", a = d); a < l && s.src.charCodeAt(a) === 32;) a++;
1996
+ for (d = s.linkContent, a = s.pos, u = a, a = a + 1; a < l && (c = s.src.charCodeAt(a), !(c !== 32 && c !== 10)); a++);
1997
+ for (a < l && u !== a && parseLinkTitle(s, a) ? (h = s.linkContent, a = s.pos) : (h = "", a = u); a < l && s.src.charCodeAt(a) === 32;) a++;
1998
1998
  return a < l && s.src.charCodeAt(a) !== 10 ? -1 : (f = normalizeReference(r.slice(1, o)), _typeof(n.references[f]) > "u" && (n.references[f] = {
1999
1999
  title: h,
2000
- href: u
2000
+ href: d
2001
2001
  }), a);
2002
2002
  }
2003
2003
  function references(r) {
@@ -2029,48 +2029,48 @@ function footnote_block(r) {
2029
2029
  a,
2030
2030
  l,
2031
2031
  c,
2032
- d,
2033
- u = 0,
2032
+ u,
2033
+ d = 0,
2034
2034
  h = !1,
2035
2035
  f = {};
2036
2036
  if (r.env.footnotes && (r.tokens = r.tokens.filter(function (p) {
2037
- return p.type === "footnote_reference_open" ? (h = !0, c = [], d = p.label, !1) : p.type === "footnote_reference_close" ? (h = !1, f[":" + d] = c, !1) : (h && c.push(p), !h);
2037
+ return p.type === "footnote_reference_open" ? (h = !0, c = [], u = p.label, !1) : p.type === "footnote_reference_close" ? (h = !1, f[":" + u] = c, !1) : (h && c.push(p), !h);
2038
2038
  }), !!r.env.footnotes.list)) {
2039
2039
  for (a = r.env.footnotes.list, r.tokens.push({
2040
2040
  type: "footnote_block_open",
2041
- level: u++
2041
+ level: d++
2042
2042
  }), e = 0, t = a.length; e < t; e++) {
2043
2043
  for (r.tokens.push({
2044
2044
  type: "footnote_open",
2045
2045
  id: e,
2046
- level: u++
2046
+ level: d++
2047
2047
  }), a[e].tokens ? (l = [], l.push({
2048
2048
  type: "paragraph_open",
2049
2049
  tight: !1,
2050
- level: u++
2050
+ level: d++
2051
2051
  }), l.push({
2052
2052
  type: "inline",
2053
2053
  content: "",
2054
- level: u,
2054
+ level: d,
2055
2055
  children: a[e].tokens
2056
2056
  }), l.push({
2057
2057
  type: "paragraph_close",
2058
2058
  tight: !1,
2059
- level: --u
2059
+ level: --d
2060
2060
  })) : a[e].label && (l = f[":" + a[e].label]), r.tokens = r.tokens.concat(l), r.tokens[r.tokens.length - 1].type === "paragraph_close" ? o = r.tokens.pop() : o = null, s = a[e].count > 0 ? a[e].count : 1, n = 0; n < s; n++) r.tokens.push({
2061
2061
  type: "footnote_anchor",
2062
2062
  id: e,
2063
2063
  subId: n,
2064
- level: u
2064
+ level: d
2065
2065
  });
2066
2066
  o && r.tokens.push(o), r.tokens.push({
2067
2067
  type: "footnote_close",
2068
- level: --u
2068
+ level: --d
2069
2069
  });
2070
2070
  }
2071
2071
  r.tokens.push({
2072
2072
  type: "footnote_block_close",
2073
- level: --u
2073
+ level: --d
2074
2074
  });
2075
2075
  }
2076
2076
  }
@@ -2087,8 +2087,8 @@ function abbr2(r) {
2087
2087
  a,
2088
2088
  l,
2089
2089
  c,
2090
- d,
2091
2090
  u,
2091
+ d,
2092
2092
  h,
2093
2093
  f,
2094
2094
  p = r.tokens;
@@ -2097,28 +2097,28 @@ function abbr2(r) {
2097
2097
  return b.substr(1);
2098
2098
  }).sort(function (b, m) {
2099
2099
  return m.length - b.length;
2100
- }).map(regEscape).join("|") + ")($|[" + PUNCT_CHARS.split("").map(regEscape).join("") + "])", r.env.abbrRegExp = new RegExp(f, "g")), u = r.env.abbrRegExp, t = 0, n = p.length; t < n; t++) if (p[t].type === "inline") {
2100
+ }).map(regEscape).join("|") + ")($|[" + PUNCT_CHARS.split("").map(regEscape).join("") + "])", r.env.abbrRegExp = new RegExp(f, "g")), d = r.env.abbrRegExp, t = 0, n = p.length; t < n; t++) if (p[t].type === "inline") {
2101
2101
  for (s = p[t].children, e = s.length - 1; e >= 0; e--) if (o = s[e], o.type === "text") {
2102
- for (c = 0, a = o.content, u.lastIndex = 0, d = o.level, l = []; h = u.exec(a);) u.lastIndex > c && l.push({
2102
+ for (c = 0, a = o.content, d.lastIndex = 0, u = o.level, l = []; h = d.exec(a);) d.lastIndex > c && l.push({
2103
2103
  type: "text",
2104
2104
  content: a.slice(c, h.index + h[1].length),
2105
- level: d
2105
+ level: u
2106
2106
  }), l.push({
2107
2107
  type: "abbr_open",
2108
2108
  title: r.env.abbreviations[":" + h[2]],
2109
- level: d++
2109
+ level: u++
2110
2110
  }), l.push({
2111
2111
  type: "text",
2112
2112
  content: h[2],
2113
- level: d
2113
+ level: u
2114
2114
  }), l.push({
2115
2115
  type: "abbr_close",
2116
- level: --d
2117
- }), c = u.lastIndex - h[3].length;
2116
+ level: --u
2117
+ }), c = d.lastIndex - h[3].length;
2118
2118
  l.length && (c < a.length && l.push({
2119
2119
  type: "text",
2120
2120
  content: a.slice(c),
2121
- level: d
2121
+ level: u
2122
2122
  }), p[t].children = s = [].concat(s.slice(0, e), l, s.slice(e + 1)));
2123
2123
  }
2124
2124
  }
@@ -2154,20 +2154,20 @@ function replaceAt(r, e, t) {
2154
2154
  return r.substr(0, e) + t + r.substr(e + 1);
2155
2155
  }
2156
2156
  function smartquotes(r) {
2157
- var e, t, n, s, o, a, l, c, d, u, h, f, p, b, m, g, v;
2157
+ var e, t, n, s, o, a, l, c, u, d, h, f, p, b, m, g, v;
2158
2158
  if (r.options.typographer) {
2159
2159
  for (v = [], m = r.tokens.length - 1; m >= 0; m--) if (r.tokens[m].type === "inline") {
2160
2160
  for (g = r.tokens[m].children, v.length = 0, e = 0; e < g.length; e++) if (t = g[e], !(t.type !== "text" || QUOTE_TEST_RE.test(t.text))) {
2161
2161
  for (l = g[e].level, p = v.length - 1; p >= 0 && !(v[p].level <= l); p--);
2162
2162
  v.length = p + 1, n = t.content, o = 0, a = n.length;
2163
2163
  e: for (; o < a && (QUOTE_RE.lastIndex = o, s = QUOTE_RE.exec(n), !!s);) {
2164
- if (c = !isLetter(n, s.index - 1), o = s.index + 1, b = s[0] === "'", d = !isLetter(n, o), !d && !c) {
2164
+ if (c = !isLetter(n, s.index - 1), o = s.index + 1, b = s[0] === "'", u = !isLetter(n, o), !u && !c) {
2165
2165
  b && (t.content = replaceAt(t.content, s.index, APOSTROPHE));
2166
2166
  continue;
2167
2167
  }
2168
- if (h = !d, f = !c, f) {
2169
- for (p = v.length - 1; p >= 0 && (u = v[p], !(v[p].level < l)); p--) if (u.single === b && v[p].level === l) {
2170
- u = v[p], b ? (g[u.token].content = replaceAt(g[u.token].content, u.pos, r.options.quotes[2]), t.content = replaceAt(t.content, s.index, r.options.quotes[3])) : (g[u.token].content = replaceAt(g[u.token].content, u.pos, r.options.quotes[0]), t.content = replaceAt(t.content, s.index, r.options.quotes[1])), v.length = p;
2168
+ if (h = !u, f = !c, f) {
2169
+ for (p = v.length - 1; p >= 0 && (d = v[p], !(v[p].level < l)); p--) if (d.single === b && v[p].level === l) {
2170
+ d = v[p], b ? (g[d.token].content = replaceAt(g[d.token].content, d.pos, r.options.quotes[2]), t.content = replaceAt(t.content, s.index, r.options.quotes[3])) : (g[d.token].content = replaceAt(g[d.token].content, d.pos, r.options.quotes[0]), t.content = replaceAt(t.content, s.index, r.options.quotes[1])), v.length = p;
2171
2171
  continue e;
2172
2172
  }
2173
2173
  }
@@ -2192,13 +2192,13 @@ Core.prototype.process = function (r) {
2192
2192
  for (n = this.ruler.getRules(""), e = 0, t = n.length; e < t; e++) n[e](r);
2193
2193
  };
2194
2194
  function StateBlock(r, e, t, n, s) {
2195
- var o, a, l, c, d, u, h;
2196
- for (this.src = r, this.parser = e, this.options = t, this.env = n, this.tokens = s, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", a = this.src, u = 0, h = !1, l = c = u = 0, d = a.length; c < d; c++) {
2195
+ var o, a, l, c, u, d, h;
2196
+ for (this.src = r, this.parser = e, this.options = t, this.env = n, this.tokens = s, this.bMarks = [], this.eMarks = [], this.tShift = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.parentType = "root", this.ddIndent = -1, this.level = 0, this.result = "", a = this.src, d = 0, h = !1, l = c = d = 0, u = a.length; c < u; c++) {
2197
2197
  if (o = a.charCodeAt(c), !h) if (o === 32) {
2198
- u++;
2198
+ d++;
2199
2199
  continue;
2200
2200
  } else h = !0;
2201
- (o === 10 || c === d - 1) && (o !== 10 && c++, this.bMarks.push(l), this.eMarks.push(c), this.tShift.push(u), h = !1, u = 0, l = c + 1);
2201
+ (o === 10 || c === u - 1) && (o !== 10 && c++, this.bMarks.push(l), this.eMarks.push(c), this.tShift.push(d), h = !1, d = 0, l = c + 1);
2202
2202
  }
2203
2203
  this.bMarks.push(a.length), this.eMarks.push(a.length), this.tShift.push(0), this.lineMax = this.bMarks.length - 1;
2204
2204
  }
@@ -2227,11 +2227,11 @@ StateBlock.prototype.getLines = function (e, t, n, s) {
2227
2227
  a,
2228
2228
  l,
2229
2229
  c,
2230
- d,
2231
- u = e;
2230
+ u,
2231
+ d = e;
2232
2232
  if (e >= t) return "";
2233
- if (u + 1 === t) return a = this.bMarks[u] + Math.min(this.tShift[u], n), l = s ? this.eMarks[u] + 1 : this.eMarks[u], this.src.slice(a, l);
2234
- for (c = new Array(t - e), o = 0; u < t; u++, o++) d = this.tShift[u], d > n && (d = n), d < 0 && (d = 0), a = this.bMarks[u] + d, u + 1 < t || s ? l = this.eMarks[u] + 1 : l = this.eMarks[u], c[o] = this.src.slice(a, l);
2233
+ if (d + 1 === t) return a = this.bMarks[d] + Math.min(this.tShift[d], n), l = s ? this.eMarks[d] + 1 : this.eMarks[d], this.src.slice(a, l);
2234
+ for (c = new Array(t - e), o = 0; d < t; d++, o++) u = this.tShift[d], u > n && (u = n), u < 0 && (u = 0), a = this.bMarks[d] + u, d + 1 < t || s ? l = this.eMarks[d] + 1 : l = this.eMarks[d], c[o] = this.src.slice(a, l);
2235
2235
  return c.join("");
2236
2236
  };
2237
2237
  function code(r, e, t) {
@@ -2262,16 +2262,16 @@ function fences(r, e, t, n) {
2262
2262
  a,
2263
2263
  l,
2264
2264
  c,
2265
- d = !1,
2266
- u = r.bMarks[e] + r.tShift[e],
2265
+ u = !1,
2266
+ d = r.bMarks[e] + r.tShift[e],
2267
2267
  h = r.eMarks[e];
2268
- if (u + 3 > h || (s = r.src.charCodeAt(u), s !== 126 && s !== 96) || (c = u, u = r.skipChars(u, s), o = u - c, o < 3) || (a = r.src.slice(u, h).trim(), a.indexOf("`") >= 0)) return !1;
2268
+ if (d + 3 > h || (s = r.src.charCodeAt(d), s !== 126 && s !== 96) || (c = d, d = r.skipChars(d, s), o = d - c, o < 3) || (a = r.src.slice(d, h).trim(), a.indexOf("`") >= 0)) return !1;
2269
2269
  if (n) return !0;
2270
- for (l = e; l++, !(l >= t || (u = c = r.bMarks[l] + r.tShift[l], h = r.eMarks[l], u < h && r.tShift[l] < r.blkIndent));) if (r.src.charCodeAt(u) === s && !(r.tShift[l] - r.blkIndent >= 4) && (u = r.skipChars(u, s), !(u - c < o) && (u = r.skipSpaces(u), !(u < h)))) {
2271
- d = !0;
2270
+ for (l = e; l++, !(l >= t || (d = c = r.bMarks[l] + r.tShift[l], h = r.eMarks[l], d < h && r.tShift[l] < r.blkIndent));) if (r.src.charCodeAt(d) === s && !(r.tShift[l] - r.blkIndent >= 4) && (d = r.skipChars(d, s), !(d - c < o) && (d = r.skipSpaces(d), !(d < h)))) {
2271
+ u = !0;
2272
2272
  break;
2273
2273
  }
2274
- return o = r.tShift[e], r.line = l + (d ? 1 : 0), r.tokens.push({
2274
+ return o = r.tShift[e], r.line = l + (u ? 1 : 0), r.tokens.push({
2275
2275
  type: "fence",
2276
2276
  params: a,
2277
2277
  content: r.getLines(e + 1, l, o, !0),
@@ -2285,8 +2285,8 @@ function blockquote(r, e, t, n) {
2285
2285
  a,
2286
2286
  l,
2287
2287
  c,
2288
- d,
2289
2288
  u,
2289
+ d,
2290
2290
  h,
2291
2291
  f,
2292
2292
  p,
@@ -2308,14 +2308,14 @@ function blockquote(r, e, t, n) {
2308
2308
  if (b) break;
2309
2309
  l.push(r.bMarks[s]), a.push(r.tShift[s]), r.tShift[s] = -1337;
2310
2310
  }
2311
- for (d = r.parentType, r.parentType = "blockquote", r.tokens.push({
2311
+ for (u = r.parentType, r.parentType = "blockquote", r.tokens.push({
2312
2312
  type: "blockquote_open",
2313
- lines: u = [e, 0],
2313
+ lines: d = [e, 0],
2314
2314
  level: r.level++
2315
2315
  }), r.parser.tokenize(r, e, s), r.tokens.push({
2316
2316
  type: "blockquote_close",
2317
2317
  level: --r.level
2318
- }), r.parentType = d, u[1] = r.line, f = 0; f < a.length; f++) r.bMarks[f + e] = l[f], r.tShift[f + e] = a[f];
2318
+ }), r.parentType = u, d[1] = r.line, f = 0; f < a.length; f++) r.bMarks[f + e] = l[f], r.tShift[f + e] = a[f];
2319
2319
  return r.blkIndent = c, !0;
2320
2320
  }
2321
2321
  function hr(r, e, t, n) {
@@ -2365,8 +2365,8 @@ function list(r, e, t, n) {
2365
2365
  a,
2366
2366
  l,
2367
2367
  c,
2368
- d,
2369
2368
  u,
2369
+ d,
2370
2370
  h,
2371
2371
  f,
2372
2372
  p,
@@ -2386,7 +2386,7 @@ function list(r, e, t, n) {
2386
2386
  if ((h = skipOrderedListMarker(r, e)) >= 0) g = !0;else if ((h = skipBulletListMarker(r, e)) >= 0) g = !1;else return !1;
2387
2387
  if (r.level >= r.options.maxNesting) return !1;
2388
2388
  if (m = r.src.charCodeAt(h - 1), n) return !0;
2389
- for (y = r.tokens.length, g ? (u = r.bMarks[e] + r.tShift[e], b = Number(r.src.substr(u, h - u - 1)), r.tokens.push({
2389
+ for (y = r.tokens.length, g ? (d = r.bMarks[e] + r.tShift[e], b = Number(r.src.substr(d, h - d - 1)), r.tokens.push({
2390
2390
  type: "ordered_list_open",
2391
2391
  order: b,
2392
2392
  lines: E = [e, 0],
@@ -2399,7 +2399,7 @@ function list(r, e, t, n) {
2399
2399
  type: "list_item_open",
2400
2400
  lines: x = [e, 0],
2401
2401
  level: r.level++
2402
- }), l = r.blkIndent, c = r.tight, a = r.tShift[e], d = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || S) && (R = !1), S = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = d, r.tokens.push({
2402
+ }), l = r.blkIndent, c = r.tight, a = r.tShift[e], u = r.parentType, r.tShift[e] = v - r.bMarks[e], r.blkIndent = o, r.tight = !0, r.parentType = "list", r.parser.tokenize(r, e, t, !0), (!r.tight || S) && (R = !1), S = r.line - e > 1 && r.isEmpty(r.line - 1), r.blkIndent = l, r.tShift[e] = a, r.tight = c, r.parentType = u, r.tokens.push({
2403
2403
  type: "list_item_close",
2404
2404
  level: --r.level
2405
2405
  }), s = e = r.line, x[1] = s, v = r.bMarks[e], !(s >= t || r.isEmpty(s) || r.tShift[s] < r.blkIndent));) {
@@ -2424,14 +2424,14 @@ function footnote(r, e, t, n) {
2424
2424
  a,
2425
2425
  l,
2426
2426
  c,
2427
- d = r.bMarks[e] + r.tShift[e],
2428
- u = r.eMarks[e];
2429
- if (d + 4 > u || r.src.charCodeAt(d) !== 91 || r.src.charCodeAt(d + 1) !== 94 || r.level >= r.options.maxNesting) return !1;
2430
- for (l = d + 2; l < u; l++) {
2427
+ u = r.bMarks[e] + r.tShift[e],
2428
+ d = r.eMarks[e];
2429
+ if (u + 4 > d || r.src.charCodeAt(u) !== 91 || r.src.charCodeAt(u + 1) !== 94 || r.level >= r.options.maxNesting) return !1;
2430
+ for (l = u + 2; l < d; l++) {
2431
2431
  if (r.src.charCodeAt(l) === 32) return !1;
2432
2432
  if (r.src.charCodeAt(l) === 93) break;
2433
2433
  }
2434
- return l === d + 2 || l + 1 >= u || r.src.charCodeAt(++l) !== 58 ? !1 : (n || (l++, r.env.footnotes || (r.env.footnotes = {}), r.env.footnotes.refs || (r.env.footnotes.refs = {}), c = r.src.slice(d + 2, l - 2), r.env.footnotes.refs[":" + c] = -1, r.tokens.push({
2434
+ return l === u + 2 || l + 1 >= d || r.src.charCodeAt(++l) !== 58 ? !1 : (n || (l++, r.env.footnotes || (r.env.footnotes = {}), r.env.footnotes.refs || (r.env.footnotes.refs = {}), c = r.src.slice(u + 2, l - 2), r.env.footnotes.refs[":" + c] = -1, r.tokens.push({
2435
2435
  type: "footnote_reference_open",
2436
2436
  label: c,
2437
2437
  level: r.level++
@@ -2503,8 +2503,8 @@ function htmlblock(r, e, t, n) {
2503
2503
  a,
2504
2504
  l = r.bMarks[e],
2505
2505
  c = r.eMarks[e],
2506
- d = r.tShift[e];
2507
- if (l += d, !r.options.html || d > 3 || l + 2 >= c || r.src.charCodeAt(l) !== 60) return !1;
2506
+ u = r.tShift[e];
2507
+ if (l += u, !r.options.html || u > 3 || l + 2 >= c || r.src.charCodeAt(l) !== 60) return !1;
2508
2508
  if (s = r.src.charCodeAt(l + 1), s === 33 || s === 63) {
2509
2509
  if (n) return !0;
2510
2510
  } else if (s === 47 || isLetter$1(s)) {
@@ -2528,17 +2528,17 @@ function getLine(r, e) {
2528
2528
  return r.src.substr(t, n - t);
2529
2529
  }
2530
2530
  function table(r, e, t, n) {
2531
- var s, o, a, l, c, d, u, h, f, p, b;
2532
- if (e + 2 > t || (c = e + 1, r.tShift[c] < r.blkIndent) || (a = r.bMarks[c] + r.tShift[c], a >= r.eMarks[c]) || (s = r.src.charCodeAt(a), s !== 124 && s !== 45 && s !== 58) || (o = getLine(r, e + 1), !/^[-:| ]+$/.test(o)) || (d = o.split("|"), d <= 2)) return !1;
2533
- for (h = [], l = 0; l < d.length; l++) {
2534
- if (f = d[l].trim(), !f) {
2535
- if (l === 0 || l === d.length - 1) continue;
2531
+ var s, o, a, l, c, u, d, h, f, p, b;
2532
+ if (e + 2 > t || (c = e + 1, r.tShift[c] < r.blkIndent) || (a = r.bMarks[c] + r.tShift[c], a >= r.eMarks[c]) || (s = r.src.charCodeAt(a), s !== 124 && s !== 45 && s !== 58) || (o = getLine(r, e + 1), !/^[-:| ]+$/.test(o)) || (u = o.split("|"), u <= 2)) return !1;
2533
+ for (h = [], l = 0; l < u.length; l++) {
2534
+ if (f = u[l].trim(), !f) {
2535
+ if (l === 0 || l === u.length - 1) continue;
2536
2536
  return !1;
2537
2537
  }
2538
2538
  if (!/^:?-+:?$/.test(f)) return !1;
2539
2539
  f.charCodeAt(f.length - 1) === 58 ? h.push(f.charCodeAt(0) === 58 ? "center" : "right") : f.charCodeAt(0) === 58 ? h.push("left") : h.push("");
2540
2540
  }
2541
- if (o = getLine(r, e).trim(), o.indexOf("|") === -1 || (d = o.replace(/^\||\|$/g, "").split("|"), h.length !== d.length)) return !1;
2541
+ if (o = getLine(r, e).trim(), o.indexOf("|") === -1 || (u = o.replace(/^\||\|$/g, "").split("|"), h.length !== u.length)) return !1;
2542
2542
  if (n) return !0;
2543
2543
  for (r.tokens.push({
2544
2544
  type: "table_open",
@@ -2552,14 +2552,14 @@ function table(r, e, t, n) {
2552
2552
  type: "tr_open",
2553
2553
  lines: [e, e + 1],
2554
2554
  level: r.level++
2555
- }), l = 0; l < d.length; l++) r.tokens.push({
2555
+ }), l = 0; l < u.length; l++) r.tokens.push({
2556
2556
  type: "th_open",
2557
2557
  align: h[l],
2558
2558
  lines: [e, e + 1],
2559
2559
  level: r.level++
2560
2560
  }), r.tokens.push({
2561
2561
  type: "inline",
2562
- content: d[l].trim(),
2562
+ content: u[l].trim(),
2563
2563
  lines: [e, e + 1],
2564
2564
  level: r.level,
2565
2565
  children: []
@@ -2578,16 +2578,16 @@ function table(r, e, t, n) {
2578
2578
  lines: b = [e + 2, 0],
2579
2579
  level: r.level++
2580
2580
  }), c = e + 2; c < t && !(r.tShift[c] < r.blkIndent || (o = getLine(r, c).trim(), o.indexOf("|") === -1)); c++) {
2581
- for (d = o.replace(/^\||\|$/g, "").split("|"), r.tokens.push({
2581
+ for (u = o.replace(/^\||\|$/g, "").split("|"), r.tokens.push({
2582
2582
  type: "tr_open",
2583
2583
  level: r.level++
2584
- }), l = 0; l < d.length; l++) r.tokens.push({
2584
+ }), l = 0; l < u.length; l++) r.tokens.push({
2585
2585
  type: "td_open",
2586
2586
  align: h[l],
2587
2587
  level: r.level++
2588
- }), u = d[l].substring(d[l].charCodeAt(0) === 124 ? 1 : 0, d[l].charCodeAt(d[l].length - 1) === 124 ? d[l].length - 1 : d[l].length).trim(), r.tokens.push({
2588
+ }), d = u[l].substring(u[l].charCodeAt(0) === 124 ? 1 : 0, u[l].charCodeAt(u[l].length - 1) === 124 ? u[l].length - 1 : u[l].length).trim(), r.tokens.push({
2589
2589
  type: "inline",
2590
- content: u,
2590
+ content: d,
2591
2591
  level: r.level,
2592
2592
  children: []
2593
2593
  }), r.tokens.push({
@@ -2621,14 +2621,14 @@ function markTightParagraphs$1(r, e) {
2621
2621
  for (t = e + 2, n = r.tokens.length - 2; t < n; t++) r.tokens[t].level === s && r.tokens[t].type === "paragraph_open" && (r.tokens[t + 2].tight = !0, r.tokens[t].tight = !0, t += 2);
2622
2622
  }
2623
2623
  function deflist(r, e, t, n) {
2624
- var s, o, a, l, c, d, u, h, f, p, b, m, g, v;
2624
+ var s, o, a, l, c, u, d, h, f, p, b, m, g, v;
2625
2625
  if (n) return r.ddIndent < 0 ? !1 : skipMarker(r, e) >= 0;
2626
- if (u = e + 1, r.isEmpty(u) && ++u > t || r.tShift[u] < r.blkIndent || (s = skipMarker(r, u), s < 0) || r.level >= r.options.maxNesting) return !1;
2627
- d = r.tokens.length, r.tokens.push({
2626
+ if (d = e + 1, r.isEmpty(d) && ++d > t || r.tShift[d] < r.blkIndent || (s = skipMarker(r, d), s < 0) || r.level >= r.options.maxNesting) return !1;
2627
+ u = r.tokens.length, r.tokens.push({
2628
2628
  type: "dl_open",
2629
2629
  lines: c = [e, 0],
2630
2630
  level: r.level++
2631
- }), a = e, o = u;
2631
+ }), a = e, o = d;
2632
2632
  e: for (;;) {
2633
2633
  for (v = !0, g = !1, r.tokens.push({
2634
2634
  type: "dt_open",
@@ -2646,21 +2646,21 @@ function deflist(r, e, t, n) {
2646
2646
  });;) {
2647
2647
  if (r.tokens.push({
2648
2648
  type: "dd_open",
2649
- lines: l = [u, 0],
2649
+ lines: l = [d, 0],
2650
2650
  level: r.level++
2651
2651
  }), m = r.tight, f = r.ddIndent, h = r.blkIndent, b = r.tShift[o], p = r.parentType, r.blkIndent = r.ddIndent = r.tShift[o] + 2, r.tShift[o] = s - r.bMarks[o], r.tight = !0, r.parentType = "deflist", r.parser.tokenize(r, o, t, !0), (!r.tight || g) && (v = !1), g = r.line - o > 1 && r.isEmpty(r.line - 1), r.tShift[o] = b, r.tight = m, r.parentType = p, r.blkIndent = h, r.ddIndent = f, r.tokens.push({
2652
2652
  type: "dd_close",
2653
2653
  level: --r.level
2654
- }), l[1] = u = r.line, u >= t || r.tShift[u] < r.blkIndent) break e;
2655
- if (s = skipMarker(r, u), s < 0) break;
2656
- o = u;
2654
+ }), l[1] = d = r.line, d >= t || r.tShift[d] < r.blkIndent) break e;
2655
+ if (s = skipMarker(r, d), s < 0) break;
2656
+ o = d;
2657
2657
  }
2658
- if (u >= t || (a = u, r.isEmpty(a)) || r.tShift[a] < r.blkIndent || (o = a + 1, o >= t) || (r.isEmpty(o) && o++, o >= t) || r.tShift[o] < r.blkIndent || (s = skipMarker(r, o), s < 0)) break;
2658
+ if (d >= t || (a = d, r.isEmpty(a)) || r.tShift[a] < r.blkIndent || (o = a + 1, o >= t) || (r.isEmpty(o) && o++, o >= t) || r.tShift[o] < r.blkIndent || (s = skipMarker(r, o), s < 0)) break;
2659
2659
  }
2660
2660
  return r.tokens.push({
2661
2661
  type: "dl_close",
2662
2662
  level: --r.level
2663
- }), c[1] = u, r.line = u, v && markTightParagraphs$1(r, d), !0;
2663
+ }), c[1] = d, r.line = d, v && markTightParagraphs$1(r, u), !0;
2664
2664
  }
2665
2665
  function paragraph(r, e) {
2666
2666
  var t,
@@ -2721,8 +2721,8 @@ ParserBlock.prototype.parse = function (r, e, t, n) {
2721
2721
  a = 0;
2722
2722
  if (!r) return [];
2723
2723
  r = r.replace(SPACES_RE, " "), r = r.replace(NEWLINES_RE, "\n"), r.indexOf(" ") >= 0 && (r = r.replace(TABS_SCAN_RE, function (l, c) {
2724
- var d;
2725
- return r.charCodeAt(c) === 10 ? (o = c + 1, a = 0, l) : (d = " ".slice((c - o - a) % 4), a = c - o + 1, d);
2724
+ var u;
2725
+ return r.charCodeAt(c) === 10 ? (o = c + 1, a = 0, l) : (u = " ".slice((c - o - a) % 4), a = c - o + 1, u);
2726
2726
  })), s = new StateBlock(r, this, e, t, n), this.tokenize(s, s.line, s.lineMax);
2727
2727
  };
2728
2728
  function isTerminatorChar(r) {
@@ -2915,9 +2915,9 @@ function scanDelims(r, e) {
2915
2915
  a = !0,
2916
2916
  l = !0,
2917
2917
  c = r.posMax,
2918
- d = r.src.charCodeAt(e);
2919
- for (n = e > 0 ? r.src.charCodeAt(e - 1) : -1; t < c && r.src.charCodeAt(t) === d;) t++;
2920
- return t >= c && (a = !1), o = t - e, o >= 4 ? a = l = !1 : (s = t < c ? r.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (a = !1), (n === 32 || n === 10) && (l = !1), d === 95 && (isAlphaNum(n) && (a = !1), isAlphaNum(s) && (l = !1))), {
2918
+ u = r.src.charCodeAt(e);
2919
+ for (n = e > 0 ? r.src.charCodeAt(e - 1) : -1; t < c && r.src.charCodeAt(t) === u;) t++;
2920
+ return t >= c && (a = !1), o = t - e, o >= 4 ? a = l = !1 : (s = t < c ? r.src.charCodeAt(t) : -1, (s === 32 || s === 10) && (a = !1), (n === 32 || n === 10) && (l = !1), u === 95 && (isAlphaNum(n) && (a = !1), isAlphaNum(s) && (l = !1))), {
2921
2921
  can_open: a,
2922
2922
  can_close: l,
2923
2923
  delims: o
@@ -2931,13 +2931,13 @@ function emphasis(r, e) {
2931
2931
  a,
2932
2932
  l,
2933
2933
  c,
2934
- d = r.posMax,
2935
- u = r.pos,
2936
- h = r.src.charCodeAt(u);
2934
+ u = r.posMax,
2935
+ d = r.pos,
2936
+ h = r.src.charCodeAt(d);
2937
2937
  if (h !== 95 && h !== 42 || e) return !1;
2938
- if (c = scanDelims(r, u), t = c.delims, !c.can_open) return r.pos += t, e || (r.pending += r.src.slice(u, r.pos)), !0;
2938
+ if (c = scanDelims(r, d), t = c.delims, !c.can_open) return r.pos += t, e || (r.pending += r.src.slice(d, r.pos)), !0;
2939
2939
  if (r.level >= r.options.maxNesting) return !1;
2940
- for (r.pos = u + t, l = [t]; r.pos < d;) {
2940
+ for (r.pos = d + t, l = [t]; r.pos < u;) {
2941
2941
  if (r.src.charCodeAt(r.pos) === h) {
2942
2942
  if (c = scanDelims(r, r.pos), n = c.delims, c.can_close) {
2943
2943
  for (o = l.pop(), a = n; o !== a;) {
@@ -2960,7 +2960,7 @@ function emphasis(r, e) {
2960
2960
  }
2961
2961
  r.parser.skipToken(r);
2962
2962
  }
2963
- return s ? (r.posMax = r.pos, r.pos = u + t, e || ((t === 2 || t === 3) && r.push({
2963
+ return s ? (r.posMax = r.pos, r.pos = d + t, e || ((t === 2 || t === 3) && r.push({
2964
2964
  type: "strong_open",
2965
2965
  level: r.level++
2966
2966
  }), (t === 1 || t === 3) && r.push({
@@ -2972,7 +2972,7 @@ function emphasis(r, e) {
2972
2972
  }), (t === 2 || t === 3) && r.push({
2973
2973
  type: "strong_close",
2974
2974
  level: --r.level
2975
- })), r.pos = r.posMax + t, r.posMax = d, !0) : (r.pos = u, !1);
2975
+ })), r.pos = r.posMax + t, r.posMax = u, !0) : (r.pos = d, !1);
2976
2976
  }
2977
2977
  var UNESCAPE_RE = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
2978
2978
  function sub(r, e) {
@@ -3022,27 +3022,27 @@ function links(r, e) {
3022
3022
  a,
3023
3023
  l,
3024
3024
  c,
3025
- d,
3026
- u = !1,
3025
+ u,
3026
+ d = !1,
3027
3027
  h = r.pos,
3028
3028
  f = r.posMax,
3029
3029
  p = r.pos,
3030
3030
  b = r.src.charCodeAt(p);
3031
- if (b === 33 && (u = !0, b = r.src.charCodeAt(++p)), b !== 91 || r.level >= r.options.maxNesting || (t = p + 1, n = parseLinkLabel(r, p), n < 0)) return !1;
3031
+ if (b === 33 && (d = !0, b = r.src.charCodeAt(++p)), b !== 91 || r.level >= r.options.maxNesting || (t = p + 1, n = parseLinkLabel(r, p), n < 0)) return !1;
3032
3032
  if (l = n + 1, l < f && r.src.charCodeAt(l) === 40) {
3033
- for (l++; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
3033
+ for (l++; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);
3034
3034
  if (l >= f) return !1;
3035
- for (p = l, parseLinkDestination(r, l) ? (o = r.linkContent, l = r.pos) : o = "", p = l; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
3036
- if (l < f && p !== l && parseLinkTitle(r, l)) for (a = r.linkContent, l = r.pos; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);else a = "";
3035
+ for (p = l, parseLinkDestination(r, l) ? (o = r.linkContent, l = r.pos) : o = "", p = l; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);
3036
+ if (l < f && p !== l && parseLinkTitle(r, l)) for (a = r.linkContent, l = r.pos; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);else a = "";
3037
3037
  if (l >= f || r.src.charCodeAt(l) !== 41) return r.pos = h, !1;
3038
3038
  l++;
3039
3039
  } else {
3040
3040
  if (r.linkLevel > 0) return !1;
3041
- for (; l < f && (d = r.src.charCodeAt(l), !(d !== 32 && d !== 10)); l++);
3041
+ for (; l < f && (u = r.src.charCodeAt(l), !(u !== 32 && u !== 10)); l++);
3042
3042
  if (l < f && r.src.charCodeAt(l) === 91 && (p = l + 1, l = parseLinkLabel(r, l), l >= 0 ? s = r.src.slice(p, l++) : l = p - 1), s || (_typeof(s) > "u" && (l = n + 1), s = r.src.slice(t, n)), c = r.env.references[normalizeReference(s)], !c) return r.pos = h, !1;
3043
3043
  o = c.href, a = c.title;
3044
3044
  }
3045
- return e || (r.pos = t, r.posMax = n, u ? r.push({
3045
+ return e || (r.pos = t, r.posMax = n, d ? r.push({
3046
3046
  type: "image",
3047
3047
  src: o,
3048
3048
  title: a,
@@ -3434,8 +3434,8 @@ var SetFileTypes = /*#__PURE__*/function () {
3434
3434
  if (_typeof(s) == "object") {
3435
3435
  var l = s.files,
3436
3436
  c = s.request,
3437
- d = s.button;
3438
- l && (l.infoModal && (o.files.infoModal = l.infoModal, (a = l.infoModal) != null && a.textMarkDown && (o.infoModalTextMarkUp = n.render(l.infoModal.textMarkDown))), l.acceptedFormats && (o.files.acceptedFormats = l.acceptedFormats), l.maxNumberOfFiles && (o.files.maxNumberOfFiles = l.maxNumberOfFiles)), o.button = d, c && (c.headers || c.method || c.url || e.headers || e.method || e.url) && (o.request = {
3437
+ u = s.button;
3438
+ l && (l.infoModal && (o.files.infoModal = l.infoModal, (a = l.infoModal) != null && a.textMarkDown && (o.infoModalTextMarkUp = n.render(l.infoModal.textMarkDown))), l.acceptedFormats && (o.files.acceptedFormats = l.acceptedFormats), l.maxNumberOfFiles && (o.files.maxNumberOfFiles = l.maxNumberOfFiles)), o.button = u, c && (c.headers || c.method || c.url || e.headers || e.method || e.url) && (o.request = {
3439
3439
  headers: (c == null ? void 0 : c.headers) || e.headers,
3440
3440
  method: (c == null ? void 0 : c.method) || e.method,
3441
3441
  url: (c == null ? void 0 : c.url) || e.url
@@ -3459,11 +3459,11 @@ var SetFileTypes = /*#__PURE__*/function () {
3459
3459
  key: "processMicrophone",
3460
3460
  value: function processMicrophone(e, t, n, s) {
3461
3461
  var _c$files, _f$maxNumberOfFiles;
3462
- var l, c, d, u, h, f;
3462
+ var l, c, u, d, h, f;
3463
3463
  var a = _objectSpread({
3464
3464
  acceptedFormats: "audio/*"
3465
3465
  }, ((l = e.fileTypes.audio) == null ? void 0 : l.files) || {});
3466
- n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && n.files && ((_c$files = (c = e.recordAudio).files) !== null && _c$files !== void 0 ? _c$files : c.files = {}, e.recordAudio.files.format = (d = n.files) == null ? void 0 : d.format, e.recordAudio.files.maxDurationSeconds = (u = n.files) == null ? void 0 : u.maxDurationSeconds, (h = e.fileTypes.audio) != null && h.files && ((_f$maxNumberOfFiles = (f = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _f$maxNumberOfFiles !== void 0 ? _f$maxNumberOfFiles : f.maxNumberOfFiles = n.files.maxNumberOfFiles))) : s || (e.fileTypes.audio = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3466
+ n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && n.files && ((_c$files = (c = e.recordAudio).files) !== null && _c$files !== void 0 ? _c$files : c.files = {}, e.recordAudio.files.format = (u = n.files) == null ? void 0 : u.format, e.recordAudio.files.maxDurationSeconds = (d = n.files) == null ? void 0 : d.maxDurationSeconds, (h = e.fileTypes.audio) != null && h.files && ((_f$maxNumberOfFiles = (f = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _f$maxNumberOfFiles !== void 0 ? _f$maxNumberOfFiles : f.maxNumberOfFiles = n.files.maxNumberOfFiles))) : s || (e.fileTypes.audio = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3467
3467
  }
3468
3468
  // prettier-ignore
3469
3469
  }, {
@@ -3491,11 +3491,11 @@ var SetFileTypes = /*#__PURE__*/function () {
3491
3491
  key: "processCamera",
3492
3492
  value: function processCamera(e, t, n, s) {
3493
3493
  var _c$files2;
3494
- var l, c, d, u;
3494
+ var l, c, u, d;
3495
3495
  var a = _objectSpread({
3496
3496
  acceptedFormats: "image/*"
3497
3497
  }, ((l = e.fileTypes.images) == null ? void 0 : l.files) || {});
3498
- n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && (e.camera.modalContainerStyle = n.modalContainerStyle, n.files && ((_c$files2 = (c = e.camera).files) !== null && _c$files2 !== void 0 ? _c$files2 : c.files = {}, e.camera.files.format = (d = n.files) == null ? void 0 : d.format, e.camera.files.dimensions = (u = n.files) == null ? void 0 : u.dimensions))) : s || (e.fileTypes.images = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3498
+ n && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = SetFileTypes.parseConfig(e.requestSettings, a, t, n), _typeof(n) == "object" && (e.camera.modalContainerStyle = n.modalContainerStyle, n.files && ((_c$files2 = (c = e.camera).files) !== null && _c$files2 !== void 0 ? _c$files2 : c.files = {}, e.camera.files.format = (u = n.files) == null ? void 0 : u.format, e.camera.files.dimensions = (d = n.files) == null ? void 0 : d.dimensions))) : s || (e.fileTypes.images = SetFileTypes.parseConfig(e.requestSettings, a, t, n)));
3499
3499
  }
3500
3500
  // prettier-ignore
3501
3501
  }, {
@@ -3550,8 +3550,8 @@ var BaseServiceIO = /*#__PURE__*/function () {
3550
3550
  key: "callServiceAPI",
3551
3551
  value: function () {
3552
3552
  var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n) {
3553
- var _c$headers, _d$ContentType;
3554
- var l, c, d, u, s, o, a;
3553
+ var _c$headers, _u$ContentType;
3554
+ var l, c, u, d, s, o, a;
3555
3555
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3556
3556
  while (1) switch (_context16.prev = _context16.next) {
3557
3557
  case 0:
@@ -3559,7 +3559,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
3559
3559
  messages: t
3560
3560
  }, this.rawBody);
3561
3561
  o = !1;
3562
- (l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_d$ContentType = (d = this.requestSettings.headers)["Content-Type"]) !== null && _d$ContentType !== void 0 ? _d$ContentType : d["Content-Type"] = "application/json", o = !0);
3562
+ (l = this.requestSettings.headers) != null && l["Content-Type"] || ((_c$headers = (c = this.requestSettings).headers) !== null && _c$headers !== void 0 ? _c$headers : c.headers = {}, (_u$ContentType = (u = this.requestSettings.headers)["Content-Type"]) !== null && _u$ContentType !== void 0 ? _u$ContentType : u["Content-Type"] = "application/json", o = !0);
3563
3563
  a = this.deepChat.stream;
3564
3564
  if (!(a && (this.demo || _typeof(a) != "object" || !a.simulation))) {
3565
3565
  _context16.next = 9;
@@ -3574,7 +3574,7 @@ var BaseServiceIO = /*#__PURE__*/function () {
3574
3574
  _context16.next = 11;
3575
3575
  return HTTPRequest.request(this, s, e);
3576
3576
  case 11:
3577
- o && ((u = this.requestSettings.headers) == null || delete u["Content-Type"]);
3577
+ o && ((d = this.requestSettings.headers) == null || delete d["Content-Type"]);
3578
3578
  case 12:
3579
3579
  case "end":
3580
3580
  return _context16.stop();
@@ -3962,8 +3962,8 @@ var InsertKeyView = /*#__PURE__*/function () {
3962
3962
  var l = InsertKeyView.createStartButton(),
3963
3963
  _InsertKeyView$create = InsertKeyView.createHelpTextContainer(t.getKeyLink),
3964
3964
  c = _InsertKeyView$create.helpTextContainerElement,
3965
- d = _InsertKeyView$create.failTextElement;
3966
- return n.appendChild(l), n.appendChild(c), InsertKeyView.addVerificationEvents(o, l, d, e, t), n;
3965
+ u = _InsertKeyView$create.failTextElement;
3966
+ return n.appendChild(l), n.appendChild(c), InsertKeyView.addVerificationEvents(o, l, u, e, t), n;
3967
3967
  }
3968
3968
  }, {
3969
3969
  key: "createElements",
@@ -4015,17 +4015,17 @@ var HuggingFaceUtils = /*#__PURE__*/function () {
4015
4015
  return HuggingFaceUtils;
4016
4016
  }();
4017
4017
  var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
4018
- _inherits(j, _DirectServiceIO);
4019
- var _super3 = _createSuper(j);
4018
+ _inherits(U, _DirectServiceIO);
4019
+ var _super3 = _createSuper(U);
4020
4020
  // prettier-ignore
4021
- function j(e, t, n, s, o, a) {
4021
+ function U(e, t, n, s, o, a) {
4022
4022
  var _this4;
4023
- _classCallCheck(this, j);
4024
- _this4 = _super3.call(this, e, HuggingFaceUtils.buildKeyVerificationDetails(), HuggingFaceUtils.buildHeaders, o, a), _this4.insertKeyPlaceholderText = "Hugging Face Token", _this4.getKeyLink = "https://huggingface.co/settings/tokens", _this4.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this4.permittedErrorPrefixes = ["Authorization header"], _this4.url = "".concat(j.URL_PREFIX).concat(n), _this4.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this4.url = "".concat(j.URL_PREFIX).concat(s.model)), s.options && (_this4.rawBody.options = s.options), s.parameters && (_this4.rawBody.parameters = s.parameters));
4023
+ _classCallCheck(this, U);
4024
+ _this4 = _super3.call(this, e, HuggingFaceUtils.buildKeyVerificationDetails(), HuggingFaceUtils.buildHeaders, o, a), _this4.insertKeyPlaceholderText = "Hugging Face Token", _this4.getKeyLink = "https://huggingface.co/settings/tokens", _this4.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this4.permittedErrorPrefixes = ["Authorization header"], _this4.url = "".concat(U.URL_PREFIX).concat(n), _this4.textInputPlaceholderText = t, _typeof(s) == "object" && (s.model && (_this4.url = "".concat(U.URL_PREFIX).concat(s.model)), s.options && (_this4.rawBody.options = s.options), s.parameters && (_this4.rawBody.parameters = s.parameters));
4025
4025
  return _this4;
4026
4026
  }
4027
4027
  // prettier-ignore
4028
- _createClass(j, [{
4028
+ _createClass(U, [{
4029
4029
  key: "preprocessBody",
4030
4030
  value: function preprocessBody(e, t, n) {
4031
4031
  var _s$options;
@@ -4063,7 +4063,7 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
4063
4063
  return callServiceAPI;
4064
4064
  }()
4065
4065
  }]);
4066
- return j;
4066
+ return U;
4067
4067
  }(DirectServiceIO);
4068
4068
  _HuggingFaceIO.URL_PREFIX = "https://api-inference.huggingface.co/models/";
4069
4069
  var HuggingFaceIO = _HuggingFaceIO;
@@ -5661,7 +5661,7 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5661
5661
  key: "poll",
5662
5662
  value: function () {
5663
5663
  var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t) {
5664
- var n, l, c, u;
5664
+ var n, l, c, d;
5665
5665
  return _regeneratorRuntime().wrap(function _callee48$(_context48) {
5666
5666
  while (1) switch (_context48.prev = _context48.next) {
5667
5667
  case 0:
@@ -5697,20 +5697,20 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5697
5697
  _context48.next = 13;
5698
5698
  return _context48.sent.json();
5699
5699
  case 13:
5700
- u = _context48.sent;
5701
- if (!(u.status === "completed")) {
5700
+ d = _context48.sent;
5701
+ if (!(d.status === "completed")) {
5702
5702
  _context48.next = 18;
5703
5703
  break;
5704
5704
  }
5705
- c = u;
5705
+ c = d;
5706
5706
  _context48.next = 22;
5707
5707
  break;
5708
5708
  case 18:
5709
- if (!(u.status === "error")) {
5709
+ if (!(d.status === "error")) {
5710
5710
  _context48.next = 20;
5711
5711
  break;
5712
5712
  }
5713
- throw new Error("Transcription failed: ".concat(u.error));
5713
+ throw new Error("Transcription failed: ".concat(d.error));
5714
5714
  case 20:
5715
5715
  _context48.next = 22;
5716
5716
  return new Promise(function (h) {
@@ -5864,13 +5864,13 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5864
5864
  var _super27 = _createSuper(V);
5865
5865
  // prettier-ignore
5866
5866
  function V(e) {
5867
- var _l$lang, _c$name, _d$gender;
5867
+ var _l$lang, _c$name, _u$gender;
5868
5868
  var _this20;
5869
5869
  _classCallCheck(this, V);
5870
- var s, o, a, l, c, d;
5870
+ var s, o, a, l, c, u;
5871
5871
  var t = (o = (s = e.directConnection) == null ? void 0 : s.azure) == null ? void 0 : o.textToSpeech,
5872
5872
  n = (a = e.directConnection) == null ? void 0 : a.azure;
5873
- _this20 = _super27.call(this, e, AzureUtils.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, n), _this20.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(V.HELP_LINK, "\">here</a> for more info.\n </p>"), _this20.url = "", Object.assign(_this20.rawBody, t), (_l$lang = (l = _this20.rawBody).lang) !== null && _l$lang !== void 0 ? _l$lang : l.lang = "en-US", (_c$name = (c = _this20.rawBody).name) !== null && _c$name !== void 0 ? _c$name : c.name = "en-US-JennyNeural", (_d$gender = (d = _this20.rawBody).gender) !== null && _d$gender !== void 0 ? _d$gender : d.gender = "Female", _this20.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
5873
+ _this20 = _super27.call(this, e, AzureUtils.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, n), _this20.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(V.HELP_LINK, "\">here</a> for more info.\n </p>"), _this20.url = "", Object.assign(_this20.rawBody, t), (_l$lang = (l = _this20.rawBody).lang) !== null && _l$lang !== void 0 ? _l$lang : l.lang = "en-US", (_c$name = (c = _this20.rawBody).name) !== null && _c$name !== void 0 ? _c$name : c.name = "en-US-JennyNeural", (_u$gender = (u = _this20.rawBody).gender) !== null && _u$gender !== void 0 ? _u$gender : u.gender = "Female", _this20.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
5874
5874
  return _this20;
5875
5875
  }
5876
5876
  _createClass(V, [{
@@ -5943,11 +5943,11 @@ _AzureTextToSpeechIO.HELP_LINK =
5943
5943
  "https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
5944
5944
  var AzureTextToSpeechIO = _AzureTextToSpeechIO;
5945
5945
  var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5946
- _inherits(U, _AzureSpeechIO2);
5947
- var _super28 = _createSuper(U);
5948
- function U(e) {
5946
+ _inherits(j, _AzureSpeechIO2);
5947
+ var _super28 = _createSuper(j);
5948
+ function j(e) {
5949
5949
  var _this21;
5950
- _classCallCheck(this, U);
5950
+ _classCallCheck(this, j);
5951
5951
  var a, l, c;
5952
5952
  var t = (l = (a = e.directConnection) == null ? void 0 : a.azure) == null ? void 0 : l.speechToText,
5953
5953
  n = (c = e.directConnection) == null ? void 0 : c.azure,
@@ -5958,12 +5958,12 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5958
5958
  }
5959
5959
  }
5960
5960
  };
5961
- _this21 = _super28.call(this, e, AzureUtils.buildSpeechToTextHeaders, t.region, n, s), _this21.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(U.HELP_LINK, "\">here</a> for more info.\n </p>"), _this21.url = "", _this21.isTextInputDisabled = !0, _this21.textInputPlaceholderText = "Upload an audio file", _this21.canSendMessage = U.canFileSendMessage;
5961
+ _this21 = _super28.call(this, e, AzureUtils.buildSpeechToTextHeaders, t.region, n, s), _this21.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(j.HELP_LINK, "\">here</a> for more info.\n </p>"), _this21.url = "", _this21.isTextInputDisabled = !0, _this21.textInputPlaceholderText = "Upload an audio file", _this21.canSendMessage = j.canFileSendMessage;
5962
5962
  var o = t.lang || "en-US";
5963
5963
  _this21.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(o, "&format=detailed"), _this21.recordAudio = void 0;
5964
5964
  return _this21;
5965
5965
  }
5966
- _createClass(U, [{
5966
+ _createClass(j, [{
5967
5967
  key: "callServiceAPI",
5968
5968
  value: function () {
5969
5969
  var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e, t, n) {
@@ -6028,7 +6028,7 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
6028
6028
  return !!(t != null && t[0]);
6029
6029
  }
6030
6030
  }]);
6031
- return U;
6031
+ return j;
6032
6032
  }(AzureSpeechIO);
6033
6033
  _AzureSpeechToTextIO.HELP_LINK =
6034
6034
  // eslint-disable-next-line max-len
@@ -6828,8 +6828,8 @@ var MessageStyleUtils = /*#__PURE__*/function () {
6828
6828
  media: {}
6829
6829
  };
6830
6830
  return e.forEach(function (o) {
6831
- var a, l, c, d;
6832
- s.outerContainer[o] = ((a = n.outerContainer) == null ? void 0 : a[o]) || "", s.innerContainer[o] = ((l = n.innerContainer) == null ? void 0 : l[o]) || "", s.bubble[o] = ((c = n.bubble) == null ? void 0 : c[o]) || "", s.media[o] = ((d = n.media) == null ? void 0 : d[o]) || "";
6831
+ var a, l, c, u;
6832
+ s.outerContainer[o] = ((a = n.outerContainer) == null ? void 0 : a[o]) || "", s.innerContainer[o] = ((l = n.innerContainer) == null ? void 0 : l[o]) || "", s.bubble[o] = ((c = n.bubble) == null ? void 0 : c[o]) || "", s.media[o] = ((u = n.media) == null ? void 0 : u[o]) || "";
6833
6833
  }), s;
6834
6834
  }
6835
6835
  }]);
@@ -6883,7 +6883,9 @@ var _FileMessageUtils = /*#__PURE__*/function () {
6883
6883
  var a = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : !1;
6884
6884
  var c;
6885
6885
  e.applyCustomStyles(t, o, !0, (c = e.messageStyles) == null ? void 0 : c[s]), e.elementRef.scrollTop = e.elementRef.scrollHeight;
6886
- var l = Messages.createMessageContent(o, void 0, n);
6886
+ var l = Messages.createMessageContent(o, {
6887
+ file: n
6888
+ });
6887
6889
  e.messages.push(l), e.sendClientUpdate(l, a);
6888
6890
  }
6889
6891
  }, {
@@ -6922,6 +6924,76 @@ var _FileMessageUtils = /*#__PURE__*/function () {
6922
6924
  }();
6923
6925
  _FileMessageUtils.DEFAULT_FILE_NAME = "file";
6924
6926
  var FileMessageUtils = _FileMessageUtils;
6927
+ var StatefulEvents = /*#__PURE__*/function () {
6928
+ function StatefulEvents() {
6929
+ _classCallCheck(this, StatefulEvents);
6930
+ }
6931
+ _createClass(StatefulEvents, null, [{
6932
+ key: "mouseUp",
6933
+ value: function mouseUp(e, t) {
6934
+ var n = t.target;
6935
+ StyleUtils.unsetAllCSSMouseStates(n, e), Object.assign(n.style, e["default"]), Object.assign(n.style, e.hover);
6936
+ }
6937
+ }, {
6938
+ key: "mouseDown",
6939
+ value: function mouseDown(e, t) {
6940
+ var n = t.target;
6941
+ Object.assign(n.style, e.click);
6942
+ }
6943
+ }, {
6944
+ key: "mouseLeave",
6945
+ value: function mouseLeave(e, t) {
6946
+ var n = t.target;
6947
+ StyleUtils.unsetAllCSSMouseStates(n, e), Object.assign(n.style, e["default"]);
6948
+ }
6949
+ }, {
6950
+ key: "mouseEnter",
6951
+ value: function mouseEnter(e, t) {
6952
+ var n = t.target;
6953
+ Object.assign(n.style, e.hover);
6954
+ }
6955
+ // note that children elements can not be selectable
6956
+ }, {
6957
+ key: "add",
6958
+ value: function add(e, t) {
6959
+ e.addEventListener("mouseenter", StatefulEvents.mouseEnter.bind(this, t)), e.addEventListener("mouseleave", StatefulEvents.mouseLeave.bind(this, t)), e.addEventListener("mousedown", StatefulEvents.mouseDown.bind(this, t)), e.addEventListener("mouseup", StatefulEvents.mouseUp.bind(this, t));
6960
+ }
6961
+ }]);
6962
+ return StatefulEvents;
6963
+ }();
6964
+ var HTMLMessageUtils = /*#__PURE__*/function () {
6965
+ function HTMLMessageUtils() {
6966
+ _classCallCheck(this, HTMLMessageUtils);
6967
+ }
6968
+ _createClass(HTMLMessageUtils, null, [{
6969
+ key: "addNewHTMLMessage",
6970
+ value: function addNewHTMLMessage(e, t, n, s) {
6971
+ var o = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
6972
+ var a = e.createNewMessageElement("", n);
6973
+ a.bubbleElement.style.maxWidth = "unset", a.bubbleElement.innerHTML = t, e.elementRef.appendChild(a.outerContainer), e.elementRef.scrollTop = e.elementRef.scrollHeight;
6974
+ var l = Messages.createMessageContent(n, {
6975
+ html: t
6976
+ });
6977
+ return o || e.messages.push(l), s && e.sendClientUpdate(l, o), Object.keys(e._htmlClassUtilities).forEach(function (c) {
6978
+ var u = a.outerContainer.getElementsByClassName(c);
6979
+ Array.from(u).forEach(function (d) {
6980
+ var p, b;
6981
+ var h = (p = e._htmlClassUtilities[c]) == null ? void 0 : p.events;
6982
+ h && Object.keys(h).forEach(function (m) {
6983
+ var g = h[m];
6984
+ g && d.addEventListener(m, g);
6985
+ });
6986
+ var f = (b = e._htmlClassUtilities[c]) == null ? void 0 : b.styles;
6987
+ if (f) {
6988
+ var m = StyleUtils.processStateful(f, {}, {});
6989
+ StatefulEvents.add(d, m), Object.assign(d.style, m["default"]);
6990
+ }
6991
+ });
6992
+ }), a;
6993
+ }
6994
+ }]);
6995
+ return HTMLMessageUtils;
6996
+ }();
6925
6997
  var SetupMessages = /*#__PURE__*/function () {
6926
6998
  function SetupMessages() {
6927
6999
  _classCallCheck(this, SetupMessages);
@@ -7045,9 +7117,9 @@ var AvatarEl = /*#__PURE__*/function () {
7045
7117
  key: "getPosition",
7046
7118
  value: function getPosition(e, t) {
7047
7119
  var _n, _n2;
7048
- var s, o, a, l, c, d;
7120
+ var s, o, a, l, c, u;
7049
7121
  var n = e ? (o = (s = t == null ? void 0 : t.ai) == null ? void 0 : s.styles) == null ? void 0 : o.position : (l = (a = t == null ? void 0 : t.user) == null ? void 0 : a.styles) == null ? void 0 : l.position;
7050
- return (_n = n) !== null && _n !== void 0 ? _n : n = (d = (c = t == null ? void 0 : t["default"]) == null ? void 0 : c.styles) == null ? void 0 : d.position, (_n2 = n) !== null && _n2 !== void 0 ? _n2 : n = e ? "left" : "right", n;
7122
+ return (_n = n) !== null && _n !== void 0 ? _n : n = (u = (c = t == null ? void 0 : t["default"]) == null ? void 0 : c.styles) == null ? void 0 : u.position, (_n2 = n) !== null && _n2 !== void 0 ? _n2 : n = e ? "left" : "right", n;
7051
7123
  }
7052
7124
  }, {
7053
7125
  key: "add",
@@ -7105,14 +7177,14 @@ var Messages = /*#__PURE__*/function () {
7105
7177
  var _this28 = this;
7106
7178
  _classCallCheck(this, Messages);
7107
7179
  var l, c;
7108
- this._messageElementRefs = [], this._streamedText = "", this.messages = [];
7180
+ this._messageElementRefs = [], this._streamedText = "", this._htmlClassUtilities = {}, this.messages = [];
7109
7181
  var s = t.permittedErrorPrefixes,
7110
7182
  o = t.introPanelMarkUp,
7111
7183
  a = t.demo;
7112
- this._remarkable = RemarkableConfig.createNew(), this.elementRef = Messages.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (l = e.errorMessages) == null ? void 0 : l.overrides, this._onNewMessage = FireEvents.onNewMessage.bind(this, e), this._onClearMessages = FireEvents.onClearMessages.bind(this, e), this._displayLoadingMessage = Messages.getDisplayLoadingMessage(e, t), this._permittedErrorPrefixes = s, this.addSetupMessageIfNeeded(e, t), this.populateIntroPanel(n, o, e.introPanelStyle), e.introMessage && this.addIntroductoryMessage(e.introMessage), e.initialMessages && this.populateInitialMessages(e.initialMessages), this.displayServiceErrorMessages = (c = e.errorMessages) == null ? void 0 : c.displayServiceErrorMessages, e.getMessages = function () {
7184
+ this._remarkable = RemarkableConfig.createNew(), this.elementRef = Messages.createContainerElement(), this.messageStyles = e.messageStyles, this._avatars = e.avatars, this._names = e.names, this._errorMessageOverrides = (l = e.errorMessages) == null ? void 0 : l.overrides, e.htmlClassUtilities && (this._htmlClassUtilities = e.htmlClassUtilities), this._onNewMessage = FireEvents.onNewMessage.bind(this, e), this._onClearMessages = FireEvents.onClearMessages.bind(this, e), this._displayLoadingMessage = Messages.getDisplayLoadingMessage(e, t), this._permittedErrorPrefixes = s, this.addSetupMessageIfNeeded(e, t), this.populateIntroPanel(n, o, e.introPanelStyle), e.introMessage && this.addIntroductoryMessage(e.introMessage), e.initialMessages && this.populateInitialMessages(e.initialMessages), this.displayServiceErrorMessages = (c = e.errorMessages) == null ? void 0 : c.displayServiceErrorMessages, e.getMessages = function () {
7113
7185
  return JSON.parse(JSON.stringify(_this28.messages));
7114
- }, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), a && this.prepareDemo(a), e.textToSpeech && TextToSpeech.processConfig(e.textToSpeech, function (d) {
7115
- _this28._textToSpeech = d;
7186
+ }, e.clearMessages = this.clearMessages.bind(this), e.refreshMessages = this.refreshTextMessages.bind(this), a && this.prepareDemo(a), e.textToSpeech && TextToSpeech.processConfig(e.textToSpeech, function (u) {
7187
+ _this28._textToSpeech = u;
7116
7188
  });
7117
7189
  }
7118
7190
  _createClass(Messages, [{
@@ -7132,10 +7204,13 @@ var Messages = /*#__PURE__*/function () {
7132
7204
  }, {
7133
7205
  key: "addIntroductoryMessage",
7134
7206
  value: function addIntroductoryMessage(e) {
7135
- var t;
7136
- if (e && (this._introMessage = e), this._introMessage) {
7137
- var n = this.createAndAppendNewMessageElement(this._introMessage, !0);
7138
- this.applyCustomStyles(n, !0, !1, (t = this.messageStyles) == null ? void 0 : t.intro);
7207
+ var t, n, s, o, a;
7208
+ if (e && (this._introMessage = e), (t = this._introMessage) != null && t.text) {
7209
+ var l = this.createAndAppendNewMessageElement(this._introMessage.text, !0);
7210
+ this.applyCustomStyles(l, !0, !1, (n = this.messageStyles) == null ? void 0 : n.intro);
7211
+ } else if ((s = this._introMessage) != null && s.html) {
7212
+ var _l = HTMLMessageUtils.addNewHTMLMessage(this, this._introMessage.html, !0, !1, !0);
7213
+ this.applyCustomStyles(_l, !0, !1, (o = this.messageStyles) == null ? void 0 : o.html), this.applyCustomStyles(_l, !0, !1, (a = this.messageStyles) == null ? void 0 : a.intro);
7139
7214
  }
7140
7215
  }
7141
7216
  }, {
@@ -7143,11 +7218,7 @@ var Messages = /*#__PURE__*/function () {
7143
7218
  value: function populateInitialMessages(e) {
7144
7219
  var _this29 = this;
7145
7220
  e.forEach(function (t) {
7146
- t.text ? _this29.addNewMessage({
7147
- text: t.text
7148
- }, t.role === "ai", !0, !0) : t.file && _this29.addNewMessage({
7149
- files: [t.file]
7150
- }, t.role === "ai", !0, !0);
7221
+ _this29.addNewMessage(t, t.role === "ai", !0, !0);
7151
7222
  }), setTimeout(function () {
7152
7223
  return _this29.elementRef.scrollTop = _this29.elementRef.scrollHeight;
7153
7224
  });
@@ -7188,13 +7259,16 @@ var Messages = /*#__PURE__*/function () {
7188
7259
  var n = this.createNewMessageElement(e, t);
7189
7260
  return this.elementRef.appendChild(n.outerContainer), this.elementRef.scrollTop = this.elementRef.scrollHeight, n;
7190
7261
  }
7262
+ // makes sure the bubble has dimensions when there is no text
7191
7263
  }, {
7192
7264
  key: "addNewTextMessage",
7193
7265
  value: function addNewTextMessage(e, t, n) {
7194
7266
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
7195
7267
  var o = this.createAndAppendNewMessageElement(e, t);
7196
7268
  this.applyCustomStyles(o, t, !1);
7197
- var a = Messages.createMessageContent(t, e);
7269
+ var a = Messages.createMessageContent(t, {
7270
+ text: e
7271
+ });
7198
7272
  return e.trim().length === 0 && Messages.editEmptyMessageElement(o.bubbleElement), this.messages.push(a), n && this.sendClientUpdate(a, s), o;
7199
7273
  }
7200
7274
  }, {
@@ -7202,10 +7276,14 @@ var Messages = /*#__PURE__*/function () {
7202
7276
  value: function addNewMessage(e, t, n) {
7203
7277
  var _this30 = this;
7204
7278
  var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
7205
- e.text !== void 0 && e.text !== null ? (this.addNewTextMessage(e.text, t, n, s), !s && this._textToSpeech && t && TextToSpeech.speak(e.text, this._textToSpeech)) : e.files && e.files.forEach(function (o) {
7206
- var a, l;
7207
- o.type === "audio" || (a = o.src) != null && a.startsWith("data:audio") ? FileMessages.addNewAudioMessage(_this30, o, t, s) : o.type === "image" || o.type === "gif" || (l = o.src) != null && l.startsWith("data:image") ? FileMessages.addNewImageMessage(_this30, o, t, s) : FileMessages.addNewAnyFileMessage(_this30, o, t, s);
7208
- });
7279
+ var o;
7280
+ if (e.text !== void 0 && e.text !== null) this.addNewTextMessage(e.text, t, n, s), !s && this._textToSpeech && t && TextToSpeech.speak(e.text, this._textToSpeech);else if (e.files) e.files.forEach(function (a) {
7281
+ var l, c;
7282
+ a.type === "audio" || (l = a.src) != null && l.startsWith("data:audio") ? FileMessages.addNewAudioMessage(_this30, a, t, s) : a.type === "image" || a.type === "gif" || (c = a.src) != null && c.startsWith("data:image") ? FileMessages.addNewImageMessage(_this30, a, t, s) : FileMessages.addNewAnyFileMessage(_this30, a, t, s);
7283
+ });else if (e.html) {
7284
+ var a = HTMLMessageUtils.addNewHTMLMessage(this, e.html, t, n, s);
7285
+ this.applyCustomStyles(a, t, !1, (o = this.messageStyles) == null ? void 0 : o.html);
7286
+ }
7209
7287
  }
7210
7288
  }, {
7211
7289
  key: "sendClientUpdate",
@@ -7226,15 +7304,15 @@ var Messages = /*#__PURE__*/function () {
7226
7304
  }, {
7227
7305
  key: "addNewErrorMessage",
7228
7306
  value: function addNewErrorMessage(e, t) {
7229
- var c, d, u, h;
7307
+ var c, u, d, h;
7230
7308
  this.removeMessageOnError();
7231
7309
  var n = Messages.createBaseElements(),
7232
7310
  s = n.outerContainer,
7233
7311
  o = n.bubbleElement;
7234
7312
  o.classList.add("error-message-text");
7235
- var a = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((d = this._errorMessageOverrides) == null ? void 0 : d["default"]) || "Error, please try again.";
7313
+ var a = this.getPermittedMessage(t) || ((c = this._errorMessageOverrides) == null ? void 0 : c[e]) || ((u = this._errorMessageOverrides) == null ? void 0 : u["default"]) || "Error, please try again.";
7236
7314
  o.innerHTML = a;
7237
- var l = MessageStyleUtils.extractParticularSharedStyles(["fontSize", "fontFamily"], (u = this.messageStyles) == null ? void 0 : u["default"]);
7315
+ var l = MessageStyleUtils.extractParticularSharedStyles(["fontSize", "fontFamily"], (d = this.messageStyles) == null ? void 0 : d["default"]);
7238
7316
  MessageStyleUtils.applyCustomStylesToElements(n, !1, l), MessageStyleUtils.applyCustomStylesToElements(n, !1, (h = this.messageStyles) == null ? void 0 : h.error), this.elementRef.appendChild(s), this.elementRef.scrollTop = this.elementRef.scrollHeight, this._textToSpeech && TextToSpeech.speak(a, this._textToSpeech), this._streamedText = "";
7239
7317
  }
7240
7318
  }, {
@@ -7251,6 +7329,7 @@ var Messages = /*#__PURE__*/function () {
7251
7329
  }
7252
7330
  }
7253
7331
  }
7332
+ // WORK - check if this works correctly
7254
7333
  }, {
7255
7334
  key: "getLastMessageElement",
7256
7335
  value: function getLastMessageElement() {
@@ -7300,8 +7379,8 @@ var Messages = /*#__PURE__*/function () {
7300
7379
  var s, o, a, l, c;
7301
7380
  var n = ElementUtils.isScrollbarAtBottomOfElement(this.elementRef);
7302
7381
  if (e.trim().length !== 0) {
7303
- var d = (s = this.messageStyles) == null ? void 0 : s["default"];
7304
- t.style.color = ((a = (o = d == null ? void 0 : d.ai) == null ? void 0 : o.bubble) == null ? void 0 : a.color) || ((c = (l = d == null ? void 0 : d.shared) == null ? void 0 : l.bubble) == null ? void 0 : c.color) || "";
7382
+ var u = (s = this.messageStyles) == null ? void 0 : s["default"];
7383
+ t.style.color = ((a = (o = u == null ? void 0 : u.ai) == null ? void 0 : o.bubble) == null ? void 0 : a.color) || ((c = (l = u == null ? void 0 : u.shared) == null ? void 0 : l.bubble) == null ? void 0 : c.color) || "";
7305
7384
  }
7306
7385
  this._streamedText += e, t.innerHTML = this._remarkable.render(this._streamedText), n && (this.elementRef.scrollTop = this.elementRef.scrollHeight);
7307
7386
  }
@@ -7309,7 +7388,9 @@ var Messages = /*#__PURE__*/function () {
7309
7388
  key: "finaliseStreamedMessage",
7310
7389
  value: function finaliseStreamedMessage() {
7311
7390
  var e;
7312
- (e = this.getLastMessageBubbleElement()) != null && e.classList.contains("streamed-message") && (this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, this._streamedText), !1), this._textToSpeech && TextToSpeech.speak(this._streamedText, this._textToSpeech), this._streamedText = "");
7391
+ (e = this.getLastMessageBubbleElement()) != null && e.classList.contains("streamed-message") && (this.messages[this.messages.length - 1].text = this._streamedText, this.sendClientUpdate(Messages.createMessageContent(!0, {
7392
+ text: this._streamedText
7393
+ }), !1), this._textToSpeech && TextToSpeech.speak(this._streamedText, this._textToSpeech), this._streamedText = "");
7313
7394
  }
7314
7395
  }, {
7315
7396
  key: "populateIntroPanel",
@@ -7395,13 +7476,20 @@ var Messages = /*#__PURE__*/function () {
7395
7476
  }
7396
7477
  }, {
7397
7478
  key: "createMessageContent",
7398
- value: function createMessageContent(e, t, n) {
7399
- return n ? {
7400
- role: e ? "ai" : "user",
7401
- file: n
7479
+ value: function createMessageContent(e, t) {
7480
+ var n = e ? "ai" : "user",
7481
+ s = t.text,
7482
+ o = t.file,
7483
+ a = t.html;
7484
+ return o ? {
7485
+ role: n,
7486
+ file: o
7487
+ } : a ? {
7488
+ role: n,
7489
+ html: a
7402
7490
  } : {
7403
- role: e ? "ai" : "user",
7404
- text: t || ""
7491
+ role: n,
7492
+ text: s || ""
7405
7493
  };
7406
7494
  }
7407
7495
  }, {
@@ -7665,43 +7753,6 @@ var DropupItemNavigation = /*#__PURE__*/function () {
7665
7753
  }]);
7666
7754
  return DropupItemNavigation;
7667
7755
  }();
7668
- var StatefulEvents = /*#__PURE__*/function () {
7669
- function StatefulEvents() {
7670
- _classCallCheck(this, StatefulEvents);
7671
- }
7672
- _createClass(StatefulEvents, null, [{
7673
- key: "mouseUp",
7674
- value: function mouseUp(e, t) {
7675
- var n = t.target;
7676
- StyleUtils.unsetAllCSSMouseStates(n, e), Object.assign(n.style, e["default"]), Object.assign(n.style, e.hover);
7677
- }
7678
- }, {
7679
- key: "mouseDown",
7680
- value: function mouseDown(e, t) {
7681
- var n = t.target;
7682
- Object.assign(n.style, e.click);
7683
- }
7684
- }, {
7685
- key: "mouseLeave",
7686
- value: function mouseLeave(e, t) {
7687
- var n = t.target;
7688
- StyleUtils.unsetAllCSSMouseStates(n, e), Object.assign(n.style, e["default"]);
7689
- }
7690
- }, {
7691
- key: "mouseEnter",
7692
- value: function mouseEnter(e, t) {
7693
- var n = t.target;
7694
- Object.assign(n.style, e.hover);
7695
- }
7696
- // note that children elements can not be selectable
7697
- }, {
7698
- key: "add",
7699
- value: function add(e, t) {
7700
- e.addEventListener("mouseenter", StatefulEvents.mouseEnter.bind(this, t)), e.addEventListener("mouseleave", StatefulEvents.mouseLeave.bind(this, t)), e.addEventListener("mousedown", StatefulEvents.mouseDown.bind(this, t)), e.addEventListener("mouseup", StatefulEvents.mouseUp.bind(this, t));
7701
- }
7702
- }]);
7703
- return StatefulEvents;
7704
- }();
7705
7756
  var DropupItem = /*#__PURE__*/function () {
7706
7757
  function DropupItem() {
7707
7758
  _classCallCheck(this, DropupItem);
@@ -7744,7 +7795,7 @@ var DropupItem = /*#__PURE__*/function () {
7744
7795
  o = t.dropupText,
7745
7796
  a = document.createElement("div");
7746
7797
  Object.assign(a.style, (c = n == null ? void 0 : n.item) == null ? void 0 : c["default"]), DropupItem.populateItem(s, a, o, n), a.classList.add("dropup-menu-item");
7747
- var l = StyleUtils.generateStateful((n == null ? void 0 : n.item) || {}, {
7798
+ var l = StyleUtils.processStateful((n == null ? void 0 : n.item) || {}, {
7748
7799
  backgroundColor: "#f3f3f3"
7749
7800
  }, {
7750
7801
  backgroundColor: "#ebebeb"
@@ -7888,11 +7939,11 @@ var InputButtonPositions = /*#__PURE__*/function () {
7888
7939
  function addToDropup(e, t, n, s) {
7889
7940
  var o = new Dropup(n, s);
7890
7941
  BUTTON_ORDER.forEach(function (l) {
7891
- var c = t["dropup-menu"].findIndex(function (u) {
7892
- return u.buttonType === l;
7942
+ var c = t["dropup-menu"].findIndex(function (d) {
7943
+ return d.buttonType === l;
7893
7944
  }),
7894
- d = t["dropup-menu"][c];
7895
- d && (o.addItem(d.button), t["dropup-menu"].splice(c, 1));
7945
+ u = t["dropup-menu"][c];
7946
+ u && (o.addItem(u.button), t["dropup-menu"].splice(c, 1));
7896
7947
  });
7897
7948
  var a = Dropup.getPosition(t, s);
7898
7949
  ButtonContainers.addButton(e, o.buttonContainer, a), t[a].push({});
@@ -8449,10 +8500,10 @@ var UploadFileButton = /*#__PURE__*/function (_InputButton2) {
8449
8500
  function UploadFileButton(e, t, n, s, o, a) {
8450
8501
  var _this43;
8451
8502
  _classCallCheck(this, UploadFileButton);
8452
- var c, d, u, h, f, p;
8503
+ var c, u, d, h, f, p;
8453
8504
  _this43 = _super36.call(this, UploadFileButton.createButtonElement(), (c = n.button) == null ? void 0 : c.position, n.button, a);
8454
8505
  var l = _this43.createInnerElements(s, o, _this43._customStyles);
8455
- _this43._inputElement = UploadFileButton.createInputElement((d = n == null ? void 0 : n.files) == null ? void 0 : d.acceptedFormats), _this43.addClickEvent(e, n), _this43.elementRef.replaceChildren(l.styles), _this43.reapplyStateStyle("styles"), _this43._fileAttachmentsType = t, _this43._openModalOnce = ((h = (u = n.files) == null ? void 0 : u.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (p = (f = n.files) == null ? void 0 : f.infoModal) == null ? void 0 : p.openModalOnce;
8506
+ _this43._inputElement = UploadFileButton.createInputElement((u = n == null ? void 0 : n.files) == null ? void 0 : u.acceptedFormats), _this43.addClickEvent(e, n), _this43.elementRef.replaceChildren(l.styles), _this43.reapplyStateStyle("styles"), _this43._fileAttachmentsType = t, _this43._openModalOnce = ((h = (d = n.files) == null ? void 0 : d.infoModal) == null ? void 0 : h.openModalOnce) === !1 || (p = (f = n.files) == null ? void 0 : f.infoModal) == null ? void 0 : p.openModalOnce;
8456
8507
  return _this43;
8457
8508
  }
8458
8509
  _createClass(UploadFileButton, [{
@@ -8950,10 +9001,10 @@ var Cursor = /*#__PURE__*/function () {
8950
9001
  n += l;
8951
9002
  } else if (a.textContent !== null) {
8952
9003
  if (n + a.textContent.length > t) {
8953
- var _l = document.createRange();
8954
- _l.setStart(a, t - n), _l.collapse(!0);
9004
+ var _l2 = document.createRange();
9005
+ _l2.setStart(a, t - n), _l2.collapse(!0);
8955
9006
  var c = window.getSelection();
8956
- return c == null || c.removeAllRanges(), c == null || c.addRange(_l), e.focus(), -1;
9007
+ return c == null || c.removeAllRanges(), c == null || c.addRange(_l2), e.focus(), -1;
8957
9008
  }
8958
9009
  n += a.textContent.length, s += a.textContent.length;
8959
9010
  }
@@ -9083,35 +9134,35 @@ var CommandUtils = /*#__PURE__*/function () {
9083
9134
  key: "execCommand",
9084
9135
  value: function execCommand(e, t, n, s, o) {
9085
9136
  var a, l, c;
9086
- var d = e.commands;
9087
- if (!d || !s || !n) return;
9088
- var u = ((a = d.settings) === null || a === void 0 ? void 0 : a.caseSensitive) === !0 ? t : t.toLowerCase(),
9089
- h = text_1$2.Text.breakupIntoWordsArr(u),
9090
- f = ((l = d.settings) === null || l === void 0 ? void 0 : l.substrings) === !1 ? CommandUtils.checkIfMatchesWord : CommandUtils.checkIfMatchesSubstring;
9091
- if (d.commandMode && f(d.commandMode, u, h)) return e.setInterimColorToFinal(), setTimeout(function () {
9137
+ var u = e.commands;
9138
+ if (!u || !s || !n) return;
9139
+ var d = ((a = u.settings) === null || a === void 0 ? void 0 : a.caseSensitive) === !0 ? t : t.toLowerCase(),
9140
+ h = text_1$2.Text.breakupIntoWordsArr(d),
9141
+ f = ((l = u.settings) === null || l === void 0 ? void 0 : l.substrings) === !1 ? CommandUtils.checkIfMatchesWord : CommandUtils.checkIfMatchesSubstring;
9142
+ if (u.commandMode && f(u.commandMode, d, h)) return e.setInterimColorToFinal(), setTimeout(function () {
9092
9143
  return CommandUtils.toggleCommandModeOn(e);
9093
9144
  }), {
9094
9145
  doNotProcessTranscription: !1
9095
9146
  };
9096
- if (!(d.commandMode && !e.isWaitingForCommand)) {
9097
- if (d.stop && f(d.stop, u, h)) return CommandUtils.toggleCommandModeOff(e), setTimeout(function () {
9147
+ if (!(u.commandMode && !e.isWaitingForCommand)) {
9148
+ if (u.stop && f(u.stop, d, h)) return CommandUtils.toggleCommandModeOff(e), setTimeout(function () {
9098
9149
  return e.stop();
9099
9150
  }), {
9100
9151
  doNotProcessTranscription: !1
9101
9152
  };
9102
- if (d.pause && f(d.pause, u, h)) return CommandUtils.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
9153
+ if (u.pause && f(u.pause, d, h)) return CommandUtils.toggleCommandModeOff(e), e.setInterimColorToFinal(), setTimeout(function () {
9103
9154
  var p;
9104
9155
  e.isPaused = !0, (p = e.onPauseTrigger) === null || p === void 0 || p.call(e, !0);
9105
9156
  }), {
9106
9157
  doNotProcessTranscription: !1
9107
9158
  };
9108
- if (d.resume && f(d.resume, u, h)) return e.isPaused = !1, (c = e.onPauseTrigger) === null || c === void 0 || c.call(e, !1), CommandUtils.toggleCommandModeOff(e), e.resetRecording(n), {
9159
+ if (u.resume && f(u.resume, d, h)) return e.isPaused = !1, (c = e.onPauseTrigger) === null || c === void 0 || c.call(e, !1), CommandUtils.toggleCommandModeOff(e), e.resetRecording(n), {
9109
9160
  doNotProcessTranscription: !0
9110
9161
  };
9111
- if (d.reset && f(d.reset, u, h)) return o !== void 0 && CommandUtils.setText(e, n, o, s), {
9162
+ if (u.reset && f(u.reset, d, h)) return o !== void 0 && CommandUtils.setText(e, n, o, s), {
9112
9163
  doNotProcessTranscription: !0
9113
9164
  };
9114
- if (d.removeAllText && f(d.removeAllText, u, h)) return CommandUtils.setText(e, n, "", s), {
9165
+ if (u.removeAllText && f(u.removeAllText, d, h)) return CommandUtils.setText(e, n, "", s), {
9115
9166
  doNotProcessTranscription: !0
9116
9167
  };
9117
9168
  }
@@ -9211,10 +9262,10 @@ var Padding = /*#__PURE__*/function () {
9211
9262
  var l = window.getSelection();
9212
9263
  if (l != null && l.focusNode) {
9213
9264
  var c = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !0),
9214
- d = (n = t.textContent) === null || n === void 0 ? void 0 : n[c - 1],
9215
- u = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !1),
9216
- h = (s = t.textContent) === null || s === void 0 ? void 0 : s[u];
9217
- text_1$1.Text.isCharDefined(d) && (e.startPadding = " "), text_1$1.Text.isCharDefined(h) && (e.endPadding = " "), e.isCursorAtEnd = ((o = t.textContent) === null || o === void 0 ? void 0 : o.length) === u;
9265
+ u = (n = t.textContent) === null || n === void 0 ? void 0 : n[c - 1],
9266
+ d = cursor_1$1.Cursor.getGenericElementCursorOffset(t, l, !1),
9267
+ h = (s = t.textContent) === null || s === void 0 ? void 0 : s[d];
9268
+ text_1$1.Text.isCharDefined(u) && (e.startPadding = " "), text_1$1.Text.isCharDefined(h) && (e.endPadding = " "), e.isCursorAtEnd = ((o = t.textContent) === null || o === void 0 ? void 0 : o.length) === d;
9218
9269
  return;
9219
9270
  }
9220
9271
  }
@@ -9896,7 +9947,7 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
9896
9947
  key: "processConfiguration",
9897
9948
  value: function processConfiguration(e, t) {
9898
9949
  var _n$displayInterimResu, _n$textColor, _n$translations, _n$commands;
9899
- var d;
9950
+ var u;
9900
9951
  var n = _typeof(t) == "object" ? t : {},
9901
9952
  s = _typeof(n.webSpeech) == "object" ? n.webSpeech : {},
9902
9953
  o = n.azure || {},
@@ -9906,9 +9957,9 @@ var SpeechToText = /*#__PURE__*/function (_MicrophoneButton) {
9906
9957
  translations: (_n$translations = n.translations) !== null && _n$translations !== void 0 ? _n$translations : void 0,
9907
9958
  commands: (_n$commands = n.commands) !== null && _n$commands !== void 0 ? _n$commands : void 0
9908
9959
  }, s), o),
9909
- l = (d = n.commands) == null ? void 0 : d.submit;
9910
- return l && (a.onPreResult = function (u) {
9911
- return u.toLowerCase().includes(l) ? (setTimeout(function () {
9960
+ l = (u = n.commands) == null ? void 0 : u.submit;
9961
+ return l && (a.onPreResult = function (d) {
9962
+ return d.toLowerCase().includes(l) ? (setTimeout(function () {
9912
9963
  var h;
9913
9964
  return (h = e.submit) == null ? void 0 : h.call(e);
9914
9965
  }), _default.endCommandMode(), {
@@ -10052,10 +10103,10 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10052
10103
  value:
10053
10104
  // prettier-ignore
10054
10105
  function attemptOverwriteLoadingStyle(e) {
10055
- var t, n, s, o, a, l, c, d, u;
10056
- if (!((n = (t = this._customStyles) == null ? void 0 : t.submit) != null && n.svg || (a = (o = (s = this._customStyles) == null ? void 0 : s.loading) == null ? void 0 : o.svg) != null && a.content || (d = (c = (l = this._customStyles) == null ? void 0 : l.loading) == null ? void 0 : c.text) != null && d.content) && (e.displayLoadingBubble === void 0 || e.displayLoadingBubble === !0)) {
10106
+ var t, n, s, o, a, l, c, u, d;
10107
+ if (!((n = (t = this._customStyles) == null ? void 0 : t.submit) != null && n.svg || (a = (o = (s = this._customStyles) == null ? void 0 : s.loading) == null ? void 0 : o.svg) != null && a.content || (u = (c = (l = this._customStyles) == null ? void 0 : l.loading) == null ? void 0 : c.text) != null && u.content) && (e.displayLoadingBubble === void 0 || e.displayLoadingBubble === !0)) {
10057
10108
  var h = document.createElement("style");
10058
- h.textContent = "\n .loading-button > * {\n filter: brightness(0) saturate(100%) invert(72%) sepia(0%) saturate(3044%) hue-rotate(322deg) brightness(100%)\n contrast(96%) !important;\n }", (u = e.shadowRoot) == null || u.appendChild(h), this._isSVGLoadingIconOverriden = !0;
10109
+ h.textContent = "\n .loading-button > * {\n filter: brightness(0) saturate(100%) invert(72%) sepia(0%) saturate(3044%) hue-rotate(322deg) brightness(100%)\n contrast(96%) !important;\n }", (d = e.shadowRoot) == null || d.appendChild(h), this._isSVGLoadingIconOverriden = !0;
10059
10110
  }
10060
10111
  }
10061
10112
  }, {
@@ -10102,8 +10153,8 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10102
10153
  return this._fileAttachments.completePlaceholders();
10103
10154
  case 4:
10104
10155
  n = this._fileAttachments.getAllFileData();
10105
- s = n == null ? void 0 : n.map(function (d) {
10106
- return d.file;
10156
+ s = n == null ? void 0 : n.map(function (u) {
10157
+ return u.file;
10107
10158
  });
10108
10159
  case 6:
10109
10160
  o = t === "" ? void 0 : t;
@@ -10402,18 +10453,18 @@ var Input = /*#__PURE__*/function () {
10402
10453
  value:
10403
10454
  // prettier-ignore
10404
10455
  function createFileUploadComponents(e, t, n, s) {
10405
- var a, l, c, d;
10456
+ var a, l, c, u;
10406
10457
  var o = new FileAttachments(this.elementRef, e.attachmentContainerStyle, t.demo);
10407
10458
  if (Input.createUploadButtons(t.fileTypes || {}, o, n, s), (a = t.camera) != null && a.files) {
10408
- var u = ((l = s.images) == null ? void 0 : l.fileType) || o.addType(t.camera.files, "images");
10459
+ var d = ((l = s.images) == null ? void 0 : l.fileType) || o.addType(t.camera.files, "images");
10409
10460
  s.camera = {
10410
- button: new CameraButton(n, u, t.camera)
10461
+ button: new CameraButton(n, d, t.camera)
10411
10462
  };
10412
10463
  }
10413
10464
  if ((c = t.recordAudio) != null && c.files) {
10414
- var _u = ((d = s.audio) == null ? void 0 : d.fileType) || o.addType(t.recordAudio.files, "audio");
10465
+ var _d = ((u = s.audio) == null ? void 0 : u.fileType) || o.addType(t.recordAudio.files, "audio");
10415
10466
  s.microphone = {
10416
- button: new RecordAudio(_u, t.recordAudio)
10467
+ button: new RecordAudio(_d, t.recordAudio)
10417
10468
  };
10418
10469
  }
10419
10470
  return DragAndDrop.isEnabled(o, e.dragAndDrop) && DragAndDrop.create(n, o, e.dragAndDrop), o;
@@ -10434,10 +10485,10 @@ var Input = /*#__PURE__*/function () {
10434
10485
  if (l.files) {
10435
10486
  var c = t.addType(l.files, a),
10436
10487
  _FILE_TYPE_BUTTON_ICO = FILE_TYPE_BUTTON_ICONS[a],
10437
- d = _FILE_TYPE_BUTTON_ICO.id,
10438
- u = _FILE_TYPE_BUTTON_ICO.svgString,
10488
+ u = _FILE_TYPE_BUTTON_ICO.id,
10489
+ d = _FILE_TYPE_BUTTON_ICO.svgString,
10439
10490
  h = _FILE_TYPE_BUTTON_ICO.dropupText,
10440
- f = new UploadFileButton(n, c, l, d, u, h);
10491
+ f = new UploadFileButton(n, c, l, u, d, h);
10441
10492
  s[a] = {
10442
10493
  button: f,
10443
10494
  fileType: c
@@ -10537,7 +10588,7 @@ __decorateClass([Property("object")], DeepChat.prototype, "textInput", 2);
10537
10588
  __decorateClass([Property("object")], DeepChat.prototype, "submitButtonStyles", 2);
10538
10589
  __decorateClass([Property("string")], DeepChat.prototype, "auxiliaryStyle", 2);
10539
10590
  __decorateClass([Property("array")], DeepChat.prototype, "initialMessages", 2);
10540
- __decorateClass([Property("string")], DeepChat.prototype, "introMessage", 2);
10591
+ __decorateClass([Property("object")], DeepChat.prototype, "introMessage", 2);
10541
10592
  __decorateClass([Property("object")], DeepChat.prototype, "avatars", 2);
10542
10593
  __decorateClass([Property("object")], DeepChat.prototype, "names", 2);
10543
10594
  __decorateClass([Property("boolean")], DeepChat.prototype, "displayLoadingBubble", 2);
@@ -10553,6 +10604,7 @@ __decorateClass([Property("object")], DeepChat.prototype, "microphone", 2);
10553
10604
  __decorateClass([Property("object")], DeepChat.prototype, "mixedFiles", 2);
10554
10605
  __decorateClass([Property("object")], DeepChat.prototype, "dragAndDrop", 2);
10555
10606
  __decorateClass([Property("object")], DeepChat.prototype, "introPanelStyle", 2);
10607
+ __decorateClass([Property("object")], DeepChat.prototype, "htmlClassUtilities", 2);
10556
10608
  __decorateClass([Property("function")], DeepChat.prototype, "onNewMessage", 2);
10557
10609
  __decorateClass([Property("function")], DeepChat.prototype, "onClearMessages", 2);
10558
10610
  __decorateClass([Property("function")], DeepChat.prototype, "onComponentRender", 2);