deep-chat-dev 9.0.7 → 9.0.8

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
@@ -328,29 +328,29 @@ function getBytes(_x, _x2) {
328
328
  return _getBytes.apply(this, arguments);
329
329
  }
330
330
  function _getBytes() {
331
- _getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(r, e) {
331
+ _getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(r, e) {
332
332
  var t, n;
333
- return _regeneratorRuntime().wrap(function _callee75$(_context75) {
334
- while (1) switch (_context75.prev = _context75.next) {
333
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
334
+ while (1) switch (_context74.prev = _context74.next) {
335
335
  case 0:
336
336
  t = r.getReader();
337
337
  case 1:
338
- _context75.next = 3;
338
+ _context74.next = 3;
339
339
  return t.read();
340
340
  case 3:
341
- if ((n = _context75.sent).done) {
342
- _context75.next = 7;
341
+ if ((n = _context74.sent).done) {
342
+ _context74.next = 7;
343
343
  break;
344
344
  }
345
345
  e(n.value);
346
346
  case 5:
347
- _context75.next = 1;
347
+ _context74.next = 1;
348
348
  break;
349
349
  case 7:
350
350
  case "end":
351
- return _context75.stop();
351
+ return _context74.stop();
352
352
  }
353
- }, _callee75);
353
+ }, _callee74);
354
354
  }));
355
355
  return _getBytes.apply(this, arguments);
356
356
  }
@@ -878,19 +878,20 @@ var CustomHandler = /*#__PURE__*/function () {
878
878
  }
879
879
  return _context7.abrupt("return");
880
880
  case 2:
881
- _context7.next = 4;
881
+ s = !1;
882
+ _context7.next = 5;
882
883
  return (f = (h = e.deepChat).responseInterceptor) == null ? void 0 : f.call(h, u);
883
- case 4:
884
+ case 5:
884
885
  _context7.t0 = _context7.sent;
885
886
  if (_context7.t0) {
886
- _context7.next = 7;
887
+ _context7.next = 8;
887
888
  break;
888
889
  }
889
890
  _context7.t0 = u;
890
- case 7:
891
+ case 8:
891
892
  d = _context7.t0;
892
- !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()), s = !1;
893
- case 9:
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
+ case 10:
894
895
  case "end":
895
896
  return _context7.stop();
896
897
  }
@@ -916,41 +917,32 @@ var CustomHandler = /*#__PURE__*/function () {
916
917
  }() // prettier-ignore
917
918
  }, {
918
919
  key: "stream",
919
- value: function () {
920
- var _stream = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(e, t, n) {
921
- var h, f, s, o, a, l, c, u, d;
922
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
923
- while (1) switch (_context9.prev = _context9.next) {
924
- case 0:
925
- s = !0, o = !1, a = null;
926
- l = function l() {
927
- o || !s || (a = n.addNewStreamedMessage(), e.streamHandlers.onOpen(), o = !0);
928
- }, c = function c() {
929
- s && (n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1);
930
- }, u = function u(p) {
931
- 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));
932
- };
933
- e.streamHandlers.abortStream.abort = function () {
934
- n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1;
935
- };
936
- d = CustomHandler.generateOptionalSignals();
937
- (f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, d), {}, {
938
- onOpen: l,
939
- onResponse: u,
940
- onClose: c,
941
- stopClicked: e.streamHandlers.stopClicked
942
- }));
943
- case 5:
944
- case "end":
945
- return _context9.stop();
946
- }
947
- }, _callee9);
920
+ value: function stream(e, t, n) {
921
+ var h, f;
922
+ var s = !0,
923
+ o = !1,
924
+ a = null;
925
+ var l = function l() {
926
+ o || !s || (a = n.addNewStreamedMessage(), e.streamHandlers.onOpen(), o = !0);
927
+ },
928
+ c = function c() {
929
+ s && (n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1);
930
+ },
931
+ u = function u(p) {
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
+ };
934
+ e.streamHandlers.abortStream.abort = function () {
935
+ n.finaliseStreamedMessage(), e.streamHandlers.onClose(), s = !1;
936
+ };
937
+ var d = CustomHandler.generateOptionalSignals();
938
+ (f = (h = e.requestSettings).handler) == null || f.call(h, t, _objectSpread(_objectSpread({}, d), {}, {
939
+ onOpen: l,
940
+ onResponse: u,
941
+ onClose: c,
942
+ stopClicked: e.streamHandlers.stopClicked
948
943
  }));
949
- function stream(_x16, _x17, _x18) {
950
- return _stream.apply(this, arguments);
951
- }
952
- return stream;
953
- }() // prettier-ignore
944
+ }
945
+ // prettier-ignore
954
946
  }, {
955
947
  key: "websocket",
956
948
  value: function websocket(e, t) {
@@ -969,36 +961,36 @@ var CustomHandler = /*#__PURE__*/function () {
969
961
  n.isOpen = !1;
970
962
  },
971
963
  a = /*#__PURE__*/function () {
972
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(d) {
964
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(d) {
973
965
  var f, p, h;
974
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
975
- while (1) switch (_context10.prev = _context10.next) {
966
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
967
+ while (1) switch (_context9.prev = _context9.next) {
976
968
  case 0:
977
969
  if (n.isOpen) {
978
- _context10.next = 2;
970
+ _context9.next = 2;
979
971
  break;
980
972
  }
981
- return _context10.abrupt("return");
973
+ return _context9.abrupt("return");
982
974
  case 2:
983
- _context10.next = 4;
975
+ _context9.next = 4;
984
976
  return (p = (f = e.deepChat).responseInterceptor) == null ? void 0 : p.call(f, d);
985
977
  case 4:
986
- _context10.t0 = _context10.sent;
987
- if (_context10.t0) {
988
- _context10.next = 7;
978
+ _context9.t0 = _context9.sent;
979
+ if (_context9.t0) {
980
+ _context9.next = 7;
989
981
  break;
990
982
  }
991
- _context10.t0 = d;
983
+ _context9.t0 = d;
992
984
  case 7:
993
- h = _context10.t0;
985
+ h = _context9.t0;
994
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);
995
987
  case 9:
996
988
  case "end":
997
- return _context10.stop();
989
+ return _context9.stop();
998
990
  }
999
- }, _callee10);
991
+ }, _callee9);
1000
992
  }));
1001
- return function a(_x19) {
993
+ return function a(_x16) {
1002
994
  return _ref3.apply(this, arguments);
1003
995
  };
1004
996
  }(),
@@ -1035,7 +1027,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1035
1027
  key: "request",
1036
1028
  value: // prettier-ignore
1037
1029
  function () {
1038
- var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e, t, n) {
1030
+ var _request3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e, t, n) {
1039
1031
  var s,
1040
1032
  h,
1041
1033
  f,
@@ -1049,40 +1041,40 @@ var HTTPRequest = /*#__PURE__*/function () {
1049
1041
  c,
1050
1042
  u,
1051
1043
  d,
1052
- _args12 = arguments;
1053
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1054
- while (1) switch (_context12.prev = _context12.next) {
1044
+ _args11 = arguments;
1045
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1046
+ while (1) switch (_context11.prev = _context11.next) {
1055
1047
  case 0:
1056
- s = _args12.length > 3 && _args12[3] !== undefined ? _args12[3] : !0;
1048
+ s = _args11.length > 3 && _args11[3] !== undefined ? _args11[3] : !0;
1057
1049
  o = {
1058
1050
  body: t,
1059
1051
  headers: (h = e.requestSettings) == null ? void 0 : h.headers
1060
1052
  };
1061
- _context12.next = 4;
1053
+ _context11.next = 4;
1062
1054
  return RequestUtils.processRequestInterceptor(e.deepChat, o);
1063
1055
  case 4:
1064
- _yield$RequestUtils$p2 = _context12.sent;
1056
+ _yield$RequestUtils$p2 = _context11.sent;
1065
1057
  a = _yield$RequestUtils$p2.body;
1066
1058
  l = _yield$RequestUtils$p2.headers;
1067
1059
  c = _yield$RequestUtils$p2.error;
1068
1060
  u = e.completionsHandlers.onFinish;
1069
1061
  if (!c) {
1070
- _context12.next = 11;
1062
+ _context11.next = 11;
1071
1063
  break;
1072
1064
  }
1073
- return _context12.abrupt("return", HTTPRequest.onInterceptorError(n, c, u));
1065
+ return _context11.abrupt("return", HTTPRequest.onInterceptorError(n, c, u));
1074
1066
  case 11:
1075
1067
  if (!((f = e.requestSettings) != null && f.handler)) {
1076
- _context12.next = 13;
1068
+ _context11.next = 13;
1077
1069
  break;
1078
1070
  }
1079
- return _context12.abrupt("return", CustomHandler.request(e, a, n));
1071
+ return _context11.abrupt("return", CustomHandler.request(e, a, n));
1080
1072
  case 13:
1081
1073
  if (!(((p = e.requestSettings) == null ? void 0 : p.url) === Demo.URL)) {
1082
- _context12.next = 15;
1074
+ _context11.next = 15;
1083
1075
  break;
1084
1076
  }
1085
- return _context12.abrupt("return", Demo.request(n, u, e.deepChat.responseInterceptor));
1077
+ return _context11.abrupt("return", Demo.request(n, u, e.deepChat.responseInterceptor));
1086
1078
  case 15:
1087
1079
  d = !0;
1088
1080
  fetch(((b = e.requestSettings) == null ? void 0 : b.url) || e.url || "", {
@@ -1094,40 +1086,40 @@ var HTTPRequest = /*#__PURE__*/function () {
1094
1086
  }).then(function (g) {
1095
1087
  return RequestUtils.processResponseByType(g);
1096
1088
  }).then( /*#__PURE__*/function () {
1097
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(g) {
1089
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(g) {
1098
1090
  var S, E, v, y;
1099
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1100
- while (1) switch (_context11.prev = _context11.next) {
1091
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1092
+ while (1) switch (_context10.prev = _context10.next) {
1101
1093
  case 0:
1102
1094
  if (e.extractResultData) {
1103
- _context11.next = 2;
1095
+ _context10.next = 2;
1104
1096
  break;
1105
1097
  }
1106
- return _context11.abrupt("return");
1098
+ return _context10.abrupt("return");
1107
1099
  case 2:
1108
- _context11.next = 4;
1100
+ _context10.next = 4;
1109
1101
  return (E = (S = e.deepChat).responseInterceptor) == null ? void 0 : E.call(S, g);
1110
1102
  case 4:
1111
- _context11.t0 = _context11.sent;
1112
- if (_context11.t0) {
1113
- _context11.next = 7;
1103
+ _context10.t0 = _context10.sent;
1104
+ if (_context10.t0) {
1105
+ _context10.next = 7;
1114
1106
  break;
1115
1107
  }
1116
- _context11.t0 = g;
1108
+ _context10.t0 = g;
1117
1109
  case 7:
1118
- v = _context11.t0;
1119
- _context11.next = 10;
1110
+ v = _context10.t0;
1111
+ _context10.next = 10;
1120
1112
  return e.extractResultData(v);
1121
1113
  case 10:
1122
- y = _context11.sent;
1114
+ y = _context10.sent;
1123
1115
  if (d) {
1124
- _context11.next = 13;
1116
+ _context10.next = 13;
1125
1117
  break;
1126
1118
  }
1127
1119
  throw g;
1128
1120
  case 13:
1129
1121
  if (!(!y || _typeof(y) != "object")) {
1130
- _context11.next = 15;
1122
+ _context10.next = 15;
1131
1123
  break;
1132
1124
  }
1133
1125
  throw Error(ErrorMessages.INVALID_RESPONSE(g, "response", !!e.deepChat.responseInterceptor, v));
@@ -1135,11 +1127,11 @@ var HTTPRequest = /*#__PURE__*/function () {
1135
1127
  y.pollingInAnotherRequest || (e.deepChat.stream && y.text ? Stream.simulate(n, e.streamHandlers, y.text) : (n.addNewMessage(y, !0, !0), u()));
1136
1128
  case 16:
1137
1129
  case "end":
1138
- return _context11.stop();
1130
+ return _context10.stop();
1139
1131
  }
1140
- }, _callee11);
1132
+ }, _callee10);
1141
1133
  }));
1142
- return function (_x23) {
1134
+ return function (_x20) {
1143
1135
  return _ref4.apply(this, arguments);
1144
1136
  };
1145
1137
  }())["catch"](function (g) {
@@ -1147,11 +1139,11 @@ var HTTPRequest = /*#__PURE__*/function () {
1147
1139
  });
1148
1140
  case 17:
1149
1141
  case "end":
1150
- return _context12.stop();
1142
+ return _context11.stop();
1151
1143
  }
1152
- }, _callee12);
1144
+ }, _callee11);
1153
1145
  }));
1154
- function request(_x20, _x21, _x22) {
1146
+ function request(_x17, _x18, _x19) {
1155
1147
  return _request3.apply(this, arguments);
1156
1148
  }
1157
1149
  return request;
@@ -1164,43 +1156,43 @@ var HTTPRequest = /*#__PURE__*/function () {
1164
1156
  fetch(t, n).then(function (a) {
1165
1157
  return a.json();
1166
1158
  }).then( /*#__PURE__*/function () {
1167
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(a) {
1159
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(a) {
1168
1160
  var c, u, l;
1169
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1170
- while (1) switch (_context13.prev = _context13.next) {
1161
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1162
+ while (1) switch (_context12.prev = _context12.next) {
1171
1163
  case 0:
1172
1164
  if (e.extractPollResultData) {
1173
- _context13.next = 2;
1165
+ _context12.next = 2;
1174
1166
  break;
1175
1167
  }
1176
- return _context13.abrupt("return");
1168
+ return _context12.abrupt("return");
1177
1169
  case 2:
1178
- _context13.t0 = e;
1179
- _context13.next = 5;
1170
+ _context12.t0 = e;
1171
+ _context12.next = 5;
1180
1172
  return (u = (c = e.deepChat).responseInterceptor) == null ? void 0 : u.call(c, a);
1181
1173
  case 5:
1182
- _context13.t1 = _context13.sent;
1183
- if (_context13.t1) {
1184
- _context13.next = 8;
1174
+ _context12.t1 = _context12.sent;
1175
+ if (_context12.t1) {
1176
+ _context12.next = 8;
1185
1177
  break;
1186
1178
  }
1187
- _context13.t1 = a;
1179
+ _context12.t1 = a;
1188
1180
  case 8:
1189
- _context13.t2 = _context13.t1;
1190
- _context13.next = 11;
1191
- return _context13.t0.extractPollResultData.call(_context13.t0, _context13.t2);
1181
+ _context12.t2 = _context12.t1;
1182
+ _context12.next = 11;
1183
+ return _context12.t0.extractPollResultData.call(_context12.t0, _context12.t2);
1192
1184
  case 11:
1193
- l = _context13.sent;
1185
+ l = _context12.sent;
1194
1186
  l.timeoutMS ? setTimeout(function () {
1195
1187
  HTTPRequest.executePollRequest(e, t, n, s);
1196
1188
  }, l.timeoutMS) : (console.log("finished polling"), s.addNewMessage(l, !0, !0), o());
1197
1189
  case 13:
1198
1190
  case "end":
1199
- return _context13.stop();
1191
+ return _context12.stop();
1200
1192
  }
1201
- }, _callee13);
1193
+ }, _callee12);
1202
1194
  }));
1203
- return function (_x24) {
1195
+ return function (_x21) {
1204
1196
  return _ref5.apply(this, arguments);
1205
1197
  };
1206
1198
  }())["catch"](function (a) {
@@ -1211,7 +1203,7 @@ var HTTPRequest = /*#__PURE__*/function () {
1211
1203
  }, {
1212
1204
  key: "poll",
1213
1205
  value: function () {
1214
- var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(e, t, n) {
1206
+ var _poll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(e, t, n) {
1215
1207
  var s,
1216
1208
  p,
1217
1209
  b,
@@ -1225,27 +1217,27 @@ var HTTPRequest = /*#__PURE__*/function () {
1225
1217
  d,
1226
1218
  h,
1227
1219
  f,
1228
- _args14 = arguments;
1229
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1230
- while (1) switch (_context14.prev = _context14.next) {
1220
+ _args13 = arguments;
1221
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1222
+ while (1) switch (_context13.prev = _context13.next) {
1231
1223
  case 0:
1232
- s = _args14.length > 3 && _args14[3] !== undefined ? _args14[3] : !0;
1224
+ s = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : !0;
1233
1225
  o = {
1234
1226
  body: t,
1235
1227
  headers: (p = e.requestSettings) == null ? void 0 : p.headers
1236
1228
  };
1237
- _context14.next = 4;
1229
+ _context13.next = 4;
1238
1230
  return RequestUtils.processRequestInterceptor(e.deepChat, o);
1239
1231
  case 4:
1240
- _yield$RequestUtils$p3 = _context14.sent;
1232
+ _yield$RequestUtils$p3 = _context13.sent;
1241
1233
  a = _yield$RequestUtils$p3.body;
1242
1234
  l = _yield$RequestUtils$p3.headers;
1243
1235
  c = _yield$RequestUtils$p3.error;
1244
1236
  if (!c) {
1245
- _context14.next = 10;
1237
+ _context13.next = 10;
1246
1238
  break;
1247
1239
  }
1248
- return _context14.abrupt("return", HTTPRequest.onInterceptorError(n, c));
1240
+ return _context13.abrupt("return", HTTPRequest.onInterceptorError(n, c));
1249
1241
  case 10:
1250
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 = {
1251
1243
  method: d,
@@ -1255,11 +1247,11 @@ var HTTPRequest = /*#__PURE__*/function () {
1255
1247
  HTTPRequest.executePollRequest(e, u, f, n);
1256
1248
  case 12:
1257
1249
  case "end":
1258
- return _context14.stop();
1250
+ return _context13.stop();
1259
1251
  }
1260
- }, _callee14);
1252
+ }, _callee13);
1261
1253
  }));
1262
- function poll(_x25, _x26, _x27) {
1254
+ function poll(_x22, _x23, _x24) {
1263
1255
  return _poll.apply(this, arguments);
1264
1256
  }
1265
1257
  return poll;
@@ -1300,9 +1292,9 @@ var MessageLimitUtils = /*#__PURE__*/function () {
1300
1292
  var n = 0,
1301
1293
  s = e.length - 1;
1302
1294
  for (s; s >= 0; s -= 1) {
1303
- var _a = (o = e[s]) == null ? void 0 : o.text;
1304
- if (_a !== void 0 && (n += _a.length, n > t)) {
1305
- e[s].text = _a.substring(0, _a.length - (n - t));
1295
+ var a = (o = e[s]) == null ? void 0 : o.text;
1296
+ if (a !== void 0 && (n += a.length, n > t)) {
1297
+ e[s].text = a.substring(0, a.length - (n - t));
1306
1298
  break;
1307
1299
  }
1308
1300
  }
@@ -1333,7 +1325,7 @@ var MessageLimitUtils = /*#__PURE__*/function () {
1333
1325
  }, {
1334
1326
  key: "processMessages",
1335
1327
  value: function processMessages(e, t, n, s) {
1336
- return n !== void 0 ? n > 0 && (t = MessageLimitUtils.getMaxMessages(t, n)) : t = MessageLimitUtils.getRequestMessages(e, t), s === void 0 ? t : MessageLimitUtils.getCharacterLimitMessages(t, s);
1328
+ return n !== void 0 ? n > 0 && (t = MessageLimitUtils.getMaxMessages(t, n)) : t = MessageLimitUtils.getRequestMessages(e, t), t = JSON.parse(JSON.stringify(t)), s === void 0 ? t : MessageLimitUtils.getCharacterLimitMessages(t, s);
1337
1329
  }
1338
1330
  }]);
1339
1331
  return MessageLimitUtils;
@@ -1355,10 +1347,10 @@ var Websocket = /*#__PURE__*/function () {
1355
1347
  if (n) {
1356
1348
  if (e.requestSettings.handler) return CustomHandler.websocket(e, t);
1357
1349
  try {
1358
- var _s = typeof n != "boolean" ? n : void 0,
1359
- _o = new WebSocket(e.requestSettings.url || "", _s);
1360
- e.websocket = _o, e.websocket.onopen = function () {
1361
- t.removeError(), e.websocket && _typeof(e.websocket) == "object" && Websocket.assignListeners(e, _o, t);
1350
+ var s = typeof n != "boolean" ? n : void 0,
1351
+ o = new WebSocket(e.requestSettings.url || "", s);
1352
+ e.websocket = o, e.websocket.onopen = function () {
1353
+ t.removeError(), e.websocket && _typeof(e.websocket) == "object" && Websocket.assignListeners(e, o, t);
1362
1354
  }, e.websocket.onerror = function (a) {
1363
1355
  console.error(a), Websocket.retryConnection(e, t);
1364
1356
  };
@@ -1378,52 +1370,52 @@ var Websocket = /*#__PURE__*/function () {
1378
1370
  key: "assignListeners",
1379
1371
  value: function assignListeners(e, t, n) {
1380
1372
  t.onmessage = /*#__PURE__*/function () {
1381
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(s) {
1373
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
1382
1374
  var o, a, l, c, u;
1383
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1384
- while (1) switch (_context15.prev = _context15.next) {
1375
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1376
+ while (1) switch (_context14.prev = _context14.next) {
1385
1377
  case 0:
1386
1378
  if (!e.extractResultData) {
1387
- _context15.next = 20;
1379
+ _context14.next = 20;
1388
1380
  break;
1389
1381
  }
1390
- _context15.prev = 1;
1382
+ _context14.prev = 1;
1391
1383
  l = JSON.parse(s.data);
1392
- _context15.next = 5;
1384
+ _context14.next = 5;
1393
1385
  return (a = (o = e.deepChat).responseInterceptor) == null ? void 0 : a.call(o, l);
1394
1386
  case 5:
1395
- _context15.t0 = _context15.sent;
1396
- if (_context15.t0) {
1397
- _context15.next = 8;
1387
+ _context14.t0 = _context14.sent;
1388
+ if (_context14.t0) {
1389
+ _context14.next = 8;
1398
1390
  break;
1399
1391
  }
1400
- _context15.t0 = l;
1392
+ _context14.t0 = l;
1401
1393
  case 8:
1402
- c = _context15.t0;
1403
- _context15.next = 11;
1394
+ c = _context14.t0;
1395
+ _context14.next = 11;
1404
1396
  return e.extractResultData(c);
1405
1397
  case 11:
1406
- u = _context15.sent;
1398
+ u = _context14.sent;
1407
1399
  if (!(!u || _typeof(u) != "object")) {
1408
- _context15.next = 14;
1400
+ _context14.next = 14;
1409
1401
  break;
1410
1402
  }
1411
1403
  throw Error(ErrorMessages.INVALID_RESPONSE(l, "server", !!e.deepChat.responseInterceptor, c));
1412
1404
  case 14:
1413
1405
  e.deepChat.stream && u.text ? Stream.simulate(n, e.streamHandlers, u.text) : n.addNewMessage(u, !0, !0);
1414
- _context15.next = 20;
1406
+ _context14.next = 20;
1415
1407
  break;
1416
1408
  case 17:
1417
- _context15.prev = 17;
1418
- _context15.t1 = _context15["catch"](1);
1419
- RequestUtils.displayError(n, _context15.t1, "Error in server message");
1409
+ _context14.prev = 17;
1410
+ _context14.t1 = _context14["catch"](1);
1411
+ RequestUtils.displayError(n, _context14.t1, "Error in server message");
1420
1412
  case 20:
1421
1413
  case "end":
1422
- return _context15.stop();
1414
+ return _context14.stop();
1423
1415
  }
1424
- }, _callee15, null, [[1, 17]]);
1416
+ }, _callee14, null, [[1, 17]]);
1425
1417
  }));
1426
- return function (_x28) {
1418
+ return function (_x25) {
1427
1419
  return _ref6.apply(this, arguments);
1428
1420
  };
1429
1421
  }(), t.onclose = function () {
@@ -1433,7 +1425,7 @@ var Websocket = /*#__PURE__*/function () {
1433
1425
  }, {
1434
1426
  key: "sendWebsocket",
1435
1427
  value: function () {
1436
- var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n) {
1428
+ var _sendWebsocket = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e, t, n) {
1437
1429
  var s,
1438
1430
  d,
1439
1431
  h,
@@ -1443,55 +1435,55 @@ var Websocket = /*#__PURE__*/function () {
1443
1435
  l,
1444
1436
  c,
1445
1437
  u,
1446
- _args16 = arguments;
1447
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1448
- while (1) switch (_context16.prev = _context16.next) {
1438
+ _args15 = arguments;
1439
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1440
+ while (1) switch (_context15.prev = _context15.next) {
1449
1441
  case 0:
1450
- s = _args16.length > 3 && _args16[3] !== undefined ? _args16[3] : !0;
1442
+ s = _args15.length > 3 && _args15[3] !== undefined ? _args15[3] : !0;
1451
1443
  o = e.websocket;
1452
1444
  if (!(!o || o === "pending")) {
1453
- _context16.next = 4;
1445
+ _context15.next = 4;
1454
1446
  break;
1455
1447
  }
1456
- return _context16.abrupt("return");
1448
+ return _context15.abrupt("return");
1457
1449
  case 4:
1458
1450
  a = {
1459
1451
  body: t,
1460
1452
  headers: (d = e.requestSettings) == null ? void 0 : d.headers
1461
1453
  };
1462
- _context16.next = 7;
1454
+ _context15.next = 7;
1463
1455
  return RequestUtils.processRequestInterceptor(e.deepChat, a);
1464
1456
  case 7:
1465
- _yield$RequestUtils$p4 = _context16.sent;
1457
+ _yield$RequestUtils$p4 = _context15.sent;
1466
1458
  l = _yield$RequestUtils$p4.body;
1467
1459
  c = _yield$RequestUtils$p4.error;
1468
1460
  if (!c) {
1469
- _context16.next = 12;
1461
+ _context15.next = 12;
1470
1462
  break;
1471
1463
  }
1472
- return _context16.abrupt("return", n.addNewErrorMessage("service", c));
1464
+ return _context15.abrupt("return", n.addNewErrorMessage("service", c));
1473
1465
  case 12:
1474
1466
  if (Websocket.isWebSocket(o)) {
1475
- _context16.next = 14;
1467
+ _context15.next = 14;
1476
1468
  break;
1477
1469
  }
1478
- return _context16.abrupt("return", o.newUserMessage.listener(l));
1470
+ return _context15.abrupt("return", o.newUserMessage.listener(l));
1479
1471
  case 14:
1480
1472
  u = s ? JSON.stringify(l) : l;
1481
1473
  if (!(((h = e.requestSettings) == null ? void 0 : h.url) === Demo.URL)) {
1482
- _context16.next = 17;
1474
+ _context15.next = 17;
1483
1475
  break;
1484
1476
  }
1485
- return _context16.abrupt("return", Demo.request(n, e.completionsHandlers.onFinish, e.deepChat.responseInterceptor));
1477
+ return _context15.abrupt("return", Demo.request(n, e.completionsHandlers.onFinish, e.deepChat.responseInterceptor));
1486
1478
  case 17:
1487
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));
1488
1480
  case 18:
1489
1481
  case "end":
1490
- return _context16.stop();
1482
+ return _context15.stop();
1491
1483
  }
1492
- }, _callee16);
1484
+ }, _callee15);
1493
1485
  }));
1494
- function sendWebsocket(_x29, _x30, _x31) {
1486
+ function sendWebsocket(_x26, _x27, _x28) {
1495
1487
  return _sendWebsocket.apply(this, arguments);
1496
1488
  }
1497
1489
  return sendWebsocket;
@@ -3449,10 +3441,10 @@ var SetFileTypes = /*#__PURE__*/function () {
3449
3441
  key: "processMixedFiles",
3450
3442
  value: function processMixedFiles(e, t, n) {
3451
3443
  if (n) {
3452
- var _s2 = {
3444
+ var s = {
3453
3445
  acceptedFormats: ""
3454
3446
  };
3455
- e.fileTypes.mixedFiles = SetFileTypes.parseConfig(e.requestSettings, _s2, t, n);
3447
+ e.fileTypes.mixedFiles = SetFileTypes.parseConfig(e.requestSettings, s, t, n);
3456
3448
  }
3457
3449
  }
3458
3450
  // needs to be set after audio to overwrite maxNumberOfFiles
@@ -3551,11 +3543,11 @@ var BaseServiceIO = /*#__PURE__*/function () {
3551
3543
  }, {
3552
3544
  key: "callServiceAPI",
3553
3545
  value: function () {
3554
- var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t, n) {
3546
+ var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e, t, n) {
3555
3547
  var _c$headers, _u$ContentType;
3556
3548
  var l, c, u, d, s, o, a;
3557
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
3558
- while (1) switch (_context17.prev = _context17.next) {
3549
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3550
+ while (1) switch (_context16.prev = _context16.next) {
3559
3551
  case 0:
3560
3552
  s = _objectSpread({
3561
3553
  messages: t
@@ -3564,26 +3556,26 @@ var BaseServiceIO = /*#__PURE__*/function () {
3564
3556
  (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);
3565
3557
  a = this.deepChat.stream;
3566
3558
  if (!(a && (this.demo || _typeof(a) != "object" || !a.simulation))) {
3567
- _context17.next = 9;
3559
+ _context16.next = 9;
3568
3560
  break;
3569
3561
  }
3570
- _context17.next = 7;
3562
+ _context16.next = 7;
3571
3563
  return Stream.request(this, s, e);
3572
3564
  case 7:
3573
- _context17.next = 11;
3565
+ _context16.next = 11;
3574
3566
  break;
3575
3567
  case 9:
3576
- _context17.next = 11;
3568
+ _context16.next = 11;
3577
3569
  return HTTPRequest.request(this, s, e);
3578
3570
  case 11:
3579
3571
  o && ((d = this.requestSettings.headers) == null || delete d["Content-Type"]);
3580
3572
  case 12:
3581
3573
  case "end":
3582
- return _context17.stop();
3574
+ return _context16.stop();
3583
3575
  }
3584
- }, _callee17, this);
3576
+ }, _callee16, this);
3585
3577
  }));
3586
- function callServiceAPI(_x32, _x33, _x34) {
3578
+ function callServiceAPI(_x29, _x30, _x31) {
3587
3579
  return _callServiceAPI.apply(this, arguments);
3588
3580
  }
3589
3581
  return callServiceAPI;
@@ -3591,24 +3583,24 @@ var BaseServiceIO = /*#__PURE__*/function () {
3591
3583
  }, {
3592
3584
  key: "callApiWithFiles",
3593
3585
  value: function () {
3594
- var _callApiWithFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e, t, n, s) {
3586
+ var _callApiWithFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t, n, s) {
3595
3587
  var o, a, l;
3596
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
3597
- while (1) switch (_context18.prev = _context18.next) {
3588
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
3589
+ while (1) switch (_context17.prev = _context17.next) {
3598
3590
  case 0:
3599
3591
  o = BaseServiceIO.createCustomFormDataBody(e, n, s), a = this.requestSettings, l = this.getServiceIOByType(s[0]);
3600
3592
  this.requestSettings = (l == null ? void 0 : l.request) || this.requestSettings;
3601
- _context18.next = 4;
3593
+ _context17.next = 4;
3602
3594
  return HTTPRequest.request(this, o, t, !1);
3603
3595
  case 4:
3604
3596
  this.requestSettings = a;
3605
3597
  case 5:
3606
3598
  case "end":
3607
- return _context18.stop();
3599
+ return _context17.stop();
3608
3600
  }
3609
- }, _callee18, this);
3601
+ }, _callee17, this);
3610
3602
  }));
3611
- function callApiWithFiles(_x35, _x36, _x37, _x38) {
3603
+ function callApiWithFiles(_x32, _x33, _x34, _x35) {
3612
3604
  return _callApiWithFiles.apply(this, arguments);
3613
3605
  }
3614
3606
  return callApiWithFiles;
@@ -3616,31 +3608,31 @@ var BaseServiceIO = /*#__PURE__*/function () {
3616
3608
  }, {
3617
3609
  key: "callAPI",
3618
3610
  value: function () {
3619
- var _callAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e, t) {
3620
- var n, _s3;
3621
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3622
- while (1) switch (_context19.prev = _context19.next) {
3611
+ var _callAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e, t) {
3612
+ var n, s;
3613
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
3614
+ while (1) switch (_context18.prev = _context18.next) {
3623
3615
  case 0:
3624
3616
  if (this.requestSettings) {
3625
- _context19.next = 2;
3617
+ _context18.next = 2;
3626
3618
  break;
3627
3619
  }
3628
3620
  throw new Error("Request settings have not been set up");
3629
3621
  case 2:
3630
3622
  n = MessageLimitUtils.processMessages(e, t.messages, this.maxMessages, this.totalMessagesMaxCharLength);
3631
3623
  if (this.requestSettings.websocket) {
3632
- _s3 = _objectSpread({
3624
+ s = _objectSpread({
3633
3625
  messages: n
3634
3626
  }, this.rawBody);
3635
- Websocket.sendWebsocket(this, _s3, t, !1);
3627
+ Websocket.sendWebsocket(this, s, t, !1);
3636
3628
  } else e.files && !this._directServiceRequiresFiles ? this.callApiWithFiles(this.rawBody, t, n, e.files) : this.callServiceAPI(t, n, e.files);
3637
3629
  case 4:
3638
3630
  case "end":
3639
- return _context19.stop();
3631
+ return _context18.stop();
3640
3632
  }
3641
- }, _callee19, this);
3633
+ }, _callee18, this);
3642
3634
  }));
3643
- function callAPI(_x39, _x40) {
3635
+ function callAPI(_x36, _x37) {
3644
3636
  return _callAPI.apply(this, arguments);
3645
3637
  }
3646
3638
  return callAPI;
@@ -3649,24 +3641,24 @@ var BaseServiceIO = /*#__PURE__*/function () {
3649
3641
  }, {
3650
3642
  key: "extractResultData",
3651
3643
  value: function () {
3652
- var _extractResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e) {
3653
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3654
- while (1) switch (_context20.prev = _context20.next) {
3644
+ var _extractResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e) {
3645
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3646
+ while (1) switch (_context19.prev = _context19.next) {
3655
3647
  case 0:
3656
3648
  if (!e.error) {
3657
- _context20.next = 2;
3649
+ _context19.next = 2;
3658
3650
  break;
3659
3651
  }
3660
3652
  throw e.error;
3661
3653
  case 2:
3662
- return _context20.abrupt("return", e.result ? (console.error("The {result: ....} response object type is deprecated since version 1.3.0."), console.error("Please change to using the new response object: https://deepchat.dev/docs/connect#Response"), e.result) : e);
3654
+ return _context19.abrupt("return", e.result ? (console.error("The {result: ....} response object type is deprecated since version 1.3.0."), console.error("Please change to using the new response object: https://deepchat.dev/docs/connect#Response"), e.result) : e);
3663
3655
  case 3:
3664
3656
  case "end":
3665
- return _context20.stop();
3657
+ return _context19.stop();
3666
3658
  }
3667
- }, _callee20);
3659
+ }, _callee19);
3668
3660
  }));
3669
- function extractResultData(_x41) {
3661
+ function extractResultData(_x38) {
3670
3662
  return _extractResultData.apply(this, arguments);
3671
3663
  }
3672
3664
  return extractResultData;
@@ -3883,8 +3875,8 @@ var InsertKeyView = /*#__PURE__*/function () {
3883
3875
  n.id = "insert-key-help-text-contents";
3884
3876
  var s = InsertKeyView.createFailText();
3885
3877
  if (n.appendChild(s), e) {
3886
- var _a2 = InsertKeyView.createHelpLink(e);
3887
- n.appendChild(_a2);
3878
+ var a = InsertKeyView.createHelpLink(e);
3879
+ n.appendChild(a);
3888
3880
  }
3889
3881
  var o = InsertKeyView.createCautionText();
3890
3882
  return n.appendChild(o), t.appendChild(n), {
@@ -4030,13 +4022,13 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
4030
4022
  }, {
4031
4023
  key: "callServiceAPI",
4032
4024
  value: function () {
4033
- var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e, t, n) {
4025
+ var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e, t, n) {
4034
4026
  var s;
4035
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
4036
- while (1) switch (_context21.prev = _context21.next) {
4027
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
4028
+ while (1) switch (_context20.prev = _context20.next) {
4037
4029
  case 0:
4038
4030
  if (this.requestSettings) {
4039
- _context21.next = 2;
4031
+ _context20.next = 2;
4040
4032
  break;
4041
4033
  }
4042
4034
  throw new Error("Request settings have not been set up");
@@ -4045,11 +4037,11 @@ var _HuggingFaceIO = /*#__PURE__*/function (_DirectServiceIO) {
4045
4037
  HTTPRequest.request(this, s, e);
4046
4038
  case 4:
4047
4039
  case "end":
4048
- return _context21.stop();
4040
+ return _context20.stop();
4049
4041
  }
4050
- }, _callee21, this);
4042
+ }, _callee20, this);
4051
4043
  }));
4052
- function callServiceAPI(_x42, _x43, _x44) {
4044
+ function callServiceAPI(_x39, _x40, _x41) {
4053
4045
  return _callServiceAPI2.apply(this, arguments);
4054
4046
  }
4055
4047
  return callServiceAPI;
@@ -4078,18 +4070,18 @@ var HuggingFaceFileIO = /*#__PURE__*/function (_HuggingFaceIO2) {
4078
4070
  }, {
4079
4071
  key: "callServiceAPI",
4080
4072
  value: function () {
4081
- var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e, t, n) {
4082
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
4083
- while (1) switch (_context22.prev = _context22.next) {
4073
+ var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e, t, n) {
4074
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
4075
+ while (1) switch (_context21.prev = _context21.next) {
4084
4076
  case 0:
4085
4077
  if (this.requestSettings) {
4086
- _context22.next = 2;
4078
+ _context21.next = 2;
4087
4079
  break;
4088
4080
  }
4089
4081
  throw new Error("Request settings have not been set up");
4090
4082
  case 2:
4091
4083
  if (n != null && n[0]) {
4092
- _context22.next = 4;
4084
+ _context21.next = 4;
4093
4085
  break;
4094
4086
  }
4095
4087
  throw new Error("No file was added");
@@ -4097,11 +4089,11 @@ var HuggingFaceFileIO = /*#__PURE__*/function (_HuggingFaceIO2) {
4097
4089
  HTTPRequest.poll(this, n[0], e, !1);
4098
4090
  case 5:
4099
4091
  case "end":
4100
- return _context22.stop();
4092
+ return _context21.stop();
4101
4093
  }
4102
- }, _callee22, this);
4094
+ }, _callee21, this);
4103
4095
  }));
4104
- function callServiceAPI(_x45, _x46, _x47) {
4096
+ function callServiceAPI(_x42, _x43, _x44) {
4105
4097
  return _callServiceAPI3.apply(this, arguments);
4106
4098
  }
4107
4099
  return callServiceAPI;
@@ -4130,35 +4122,35 @@ var HuggingFaceAudioClassificationIO = /*#__PURE__*/function (_HuggingFaceFileIO
4130
4122
  _createClass(HuggingFaceAudioClassificationIO, [{
4131
4123
  key: "extractPollResultData",
4132
4124
  value: function () {
4133
- var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e) {
4125
+ var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e) {
4134
4126
  var t;
4135
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
4136
- while (1) switch (_context23.prev = _context23.next) {
4127
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
4128
+ while (1) switch (_context22.prev = _context22.next) {
4137
4129
  case 0:
4138
4130
  if (!e.estimated_time) {
4139
- _context23.next = 2;
4131
+ _context22.next = 2;
4140
4132
  break;
4141
4133
  }
4142
- return _context23.abrupt("return", {
4134
+ return _context22.abrupt("return", {
4143
4135
  timeoutMS: (e.estimated_time + 1) * 1e3
4144
4136
  });
4145
4137
  case 2:
4146
4138
  if (!e.error) {
4147
- _context23.next = 4;
4139
+ _context22.next = 4;
4148
4140
  break;
4149
4141
  }
4150
4142
  throw e.error;
4151
4143
  case 4:
4152
- return _context23.abrupt("return", {
4144
+ return _context22.abrupt("return", {
4153
4145
  text: ((t = e[0]) == null ? void 0 : t.label) || ""
4154
4146
  });
4155
4147
  case 5:
4156
4148
  case "end":
4157
- return _context23.stop();
4149
+ return _context22.stop();
4158
4150
  }
4159
- }, _callee23);
4151
+ }, _callee22);
4160
4152
  }));
4161
- function extractPollResultData(_x48) {
4153
+ function extractPollResultData(_x45) {
4162
4154
  return _extractPollResultData.apply(this, arguments);
4163
4155
  }
4164
4156
  return extractPollResultData;
@@ -4181,35 +4173,35 @@ var HuggingFaceImageClassificationIO = /*#__PURE__*/function (_HuggingFaceFileIO
4181
4173
  _createClass(HuggingFaceImageClassificationIO, [{
4182
4174
  key: "extractPollResultData",
4183
4175
  value: function () {
4184
- var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e) {
4176
+ var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e) {
4185
4177
  var t;
4186
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
4187
- while (1) switch (_context24.prev = _context24.next) {
4178
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
4179
+ while (1) switch (_context23.prev = _context23.next) {
4188
4180
  case 0:
4189
4181
  if (!e.estimated_time) {
4190
- _context24.next = 2;
4182
+ _context23.next = 2;
4191
4183
  break;
4192
4184
  }
4193
- return _context24.abrupt("return", {
4185
+ return _context23.abrupt("return", {
4194
4186
  timeoutMS: (e.estimated_time + 1) * 1e3
4195
4187
  });
4196
4188
  case 2:
4197
4189
  if (!e.error) {
4198
- _context24.next = 4;
4190
+ _context23.next = 4;
4199
4191
  break;
4200
4192
  }
4201
4193
  throw e.error;
4202
4194
  case 4:
4203
- return _context24.abrupt("return", {
4195
+ return _context23.abrupt("return", {
4204
4196
  text: ((t = e[0]) == null ? void 0 : t.label) || ""
4205
4197
  });
4206
4198
  case 5:
4207
4199
  case "end":
4208
- return _context24.stop();
4200
+ return _context23.stop();
4209
4201
  }
4210
- }, _callee24);
4202
+ }, _callee23);
4211
4203
  }));
4212
- function extractPollResultData(_x49) {
4204
+ function extractPollResultData(_x46) {
4213
4205
  return _extractPollResultData2.apply(this, arguments);
4214
4206
  }
4215
4207
  return extractPollResultData;
@@ -4294,19 +4286,19 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4294
4286
  }, {
4295
4287
  key: "callServiceAPI",
4296
4288
  value: function () {
4297
- var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e, t, n) {
4289
+ var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e, t, n) {
4298
4290
  var s;
4299
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
4300
- while (1) switch (_context25.prev = _context25.next) {
4291
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
4292
+ while (1) switch (_context24.prev = _context24.next) {
4301
4293
  case 0:
4302
4294
  if (this.requestSettings) {
4303
- _context25.next = 2;
4295
+ _context24.next = 2;
4304
4296
  break;
4305
4297
  }
4306
4298
  throw new Error("Request settings have not been set up");
4307
4299
  case 2:
4308
4300
  if (n) {
4309
- _context25.next = 4;
4301
+ _context24.next = 4;
4310
4302
  break;
4311
4303
  }
4312
4304
  throw new Error("Image was not found");
@@ -4315,11 +4307,11 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4315
4307
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, s, e), !1);
4316
4308
  case 6:
4317
4309
  case "end":
4318
- return _context25.stop();
4310
+ return _context24.stop();
4319
4311
  }
4320
- }, _callee25, this);
4312
+ }, _callee24, this);
4321
4313
  }));
4322
- function callServiceAPI(_x50, _x51, _x52) {
4314
+ function callServiceAPI(_x47, _x48, _x49) {
4323
4315
  return _callServiceAPI4.apply(this, arguments);
4324
4316
  }
4325
4317
  return callServiceAPI;
@@ -4327,17 +4319,17 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4327
4319
  }, {
4328
4320
  key: "extractResultData",
4329
4321
  value: function () {
4330
- var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e) {
4331
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
4332
- while (1) switch (_context26.prev = _context26.next) {
4322
+ var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e) {
4323
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
4324
+ while (1) switch (_context25.prev = _context25.next) {
4333
4325
  case 0:
4334
4326
  if (!e.message) {
4335
- _context26.next = 2;
4327
+ _context25.next = 2;
4336
4328
  break;
4337
4329
  }
4338
4330
  throw e.message;
4339
4331
  case 2:
4340
- return _context26.abrupt("return", {
4332
+ return _context25.abrupt("return", {
4341
4333
  files: e.artifacts.map(function (n) {
4342
4334
  return {
4343
4335
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4347,11 +4339,11 @@ var StabilityAIImageToImageUpscaleIO = /*#__PURE__*/function (_StabilityAIIO) {
4347
4339
  });
4348
4340
  case 3:
4349
4341
  case "end":
4350
- return _context26.stop();
4342
+ return _context25.stop();
4351
4343
  }
4352
- }, _callee26);
4344
+ }, _callee25);
4353
4345
  }));
4354
- function extractResultData(_x53) {
4346
+ function extractResultData(_x50) {
4355
4347
  return _extractResultData2.apply(this, arguments);
4356
4348
  }
4357
4349
  return extractResultData;
@@ -4403,19 +4395,19 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4403
4395
  }, {
4404
4396
  key: "callServiceAPI",
4405
4397
  value: function () {
4406
- var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(e, t, n) {
4398
+ var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e, t, n) {
4407
4399
  var a, l, s, o;
4408
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
4409
- while (1) switch (_context27.prev = _context27.next) {
4400
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
4401
+ while (1) switch (_context26.prev = _context26.next) {
4410
4402
  case 0:
4411
4403
  if (this.requestSettings) {
4412
- _context27.next = 2;
4404
+ _context26.next = 2;
4413
4405
  break;
4414
4406
  }
4415
4407
  throw new Error("Request settings have not been set up");
4416
4408
  case 2:
4417
4409
  if (!(!n || !n[0] || !n[1])) {
4418
- _context27.next = 4;
4410
+ _context26.next = 4;
4419
4411
  break;
4420
4412
  }
4421
4413
  throw new Error("Image was not found");
@@ -4424,11 +4416,11 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4424
4416
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
4425
4417
  case 6:
4426
4418
  case "end":
4427
- return _context27.stop();
4419
+ return _context26.stop();
4428
4420
  }
4429
- }, _callee27, this);
4421
+ }, _callee26, this);
4430
4422
  }));
4431
- function callServiceAPI(_x54, _x55, _x56) {
4423
+ function callServiceAPI(_x51, _x52, _x53) {
4432
4424
  return _callServiceAPI5.apply(this, arguments);
4433
4425
  }
4434
4426
  return callServiceAPI;
@@ -4436,17 +4428,17 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4436
4428
  }, {
4437
4429
  key: "extractResultData",
4438
4430
  value: function () {
4439
- var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e) {
4440
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
4441
- while (1) switch (_context28.prev = _context28.next) {
4431
+ var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(e) {
4432
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
4433
+ while (1) switch (_context27.prev = _context27.next) {
4442
4434
  case 0:
4443
4435
  if (!e.message) {
4444
- _context28.next = 2;
4436
+ _context27.next = 2;
4445
4437
  break;
4446
4438
  }
4447
4439
  throw e.message;
4448
4440
  case 2:
4449
- return _context28.abrupt("return", {
4441
+ return _context27.abrupt("return", {
4450
4442
  files: e.artifacts.map(function (n) {
4451
4443
  return {
4452
4444
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4456,11 +4448,11 @@ var StabilityAIImageToImageMaskingIO = /*#__PURE__*/function (_StabilityAIIO2) {
4456
4448
  });
4457
4449
  case 3:
4458
4450
  case "end":
4459
- return _context28.stop();
4451
+ return _context27.stop();
4460
4452
  }
4461
- }, _callee28);
4453
+ }, _callee27);
4462
4454
  }));
4463
- function extractResultData(_x57) {
4455
+ function extractResultData(_x54) {
4464
4456
  return _extractResultData3.apply(this, arguments);
4465
4457
  }
4466
4458
  return extractResultData;
@@ -4493,34 +4485,34 @@ var HuggingFaceAudioRecognitionIO = /*#__PURE__*/function (_HuggingFaceFileIO3)
4493
4485
  _createClass(HuggingFaceAudioRecognitionIO, [{
4494
4486
  key: "extractPollResultData",
4495
4487
  value: function () {
4496
- var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e) {
4497
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
4498
- while (1) switch (_context29.prev = _context29.next) {
4488
+ var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e) {
4489
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
4490
+ while (1) switch (_context28.prev = _context28.next) {
4499
4491
  case 0:
4500
4492
  if (!e.estimated_time) {
4501
- _context29.next = 2;
4493
+ _context28.next = 2;
4502
4494
  break;
4503
4495
  }
4504
- return _context29.abrupt("return", {
4496
+ return _context28.abrupt("return", {
4505
4497
  timeoutMS: (e.estimated_time + 1) * 1e3
4506
4498
  });
4507
4499
  case 2:
4508
4500
  if (!e.error) {
4509
- _context29.next = 4;
4501
+ _context28.next = 4;
4510
4502
  break;
4511
4503
  }
4512
4504
  throw e.error;
4513
4505
  case 4:
4514
- return _context29.abrupt("return", {
4506
+ return _context28.abrupt("return", {
4515
4507
  text: e.text || ""
4516
4508
  });
4517
4509
  case 5:
4518
4510
  case "end":
4519
- return _context29.stop();
4511
+ return _context28.stop();
4520
4512
  }
4521
- }, _callee29);
4513
+ }, _callee28);
4522
4514
  }));
4523
- function extractPollResultData(_x58) {
4515
+ function extractPollResultData(_x55) {
4524
4516
  return _extractPollResultData3.apply(this, arguments);
4525
4517
  }
4526
4518
  return extractPollResultData;
@@ -4541,26 +4533,26 @@ var HuggingFaceTextGenerationIO = /*#__PURE__*/function (_HuggingFaceIO3) {
4541
4533
  _createClass(HuggingFaceTextGenerationIO, [{
4542
4534
  key: "extractResultData",
4543
4535
  value: function () {
4544
- var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e) {
4545
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
4546
- while (1) switch (_context30.prev = _context30.next) {
4536
+ var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e) {
4537
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
4538
+ while (1) switch (_context29.prev = _context29.next) {
4547
4539
  case 0:
4548
4540
  if (!e.error) {
4549
- _context30.next = 2;
4541
+ _context29.next = 2;
4550
4542
  break;
4551
4543
  }
4552
4544
  throw e.error;
4553
4545
  case 2:
4554
- return _context30.abrupt("return", {
4546
+ return _context29.abrupt("return", {
4555
4547
  text: e[0].generated_text || ""
4556
4548
  });
4557
4549
  case 3:
4558
4550
  case "end":
4559
- return _context30.stop();
4551
+ return _context29.stop();
4560
4552
  }
4561
- }, _callee30);
4553
+ }, _callee29);
4562
4554
  }));
4563
- function extractResultData(_x59) {
4555
+ function extractResultData(_x56) {
4564
4556
  return _extractResultData4.apply(this, arguments);
4565
4557
  }
4566
4558
  return extractResultData;
@@ -4597,26 +4589,26 @@ var HuggingFaceQuestionAnswerIO = /*#__PURE__*/function (_HuggingFaceIO4) {
4597
4589
  }, {
4598
4590
  key: "extractResultData",
4599
4591
  value: function () {
4600
- var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e) {
4601
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
4602
- while (1) switch (_context31.prev = _context31.next) {
4592
+ var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e) {
4593
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
4594
+ while (1) switch (_context30.prev = _context30.next) {
4603
4595
  case 0:
4604
4596
  if (!e.error) {
4605
- _context31.next = 2;
4597
+ _context30.next = 2;
4606
4598
  break;
4607
4599
  }
4608
4600
  throw e.error;
4609
4601
  case 2:
4610
- return _context31.abrupt("return", {
4602
+ return _context30.abrupt("return", {
4611
4603
  text: e.answer || ""
4612
4604
  });
4613
4605
  case 3:
4614
4606
  case "end":
4615
- return _context31.stop();
4607
+ return _context30.stop();
4616
4608
  }
4617
- }, _callee31);
4609
+ }, _callee30);
4618
4610
  }));
4619
- function extractResultData(_x60) {
4611
+ function extractResultData(_x57) {
4620
4612
  return _extractResultData5.apply(this, arguments);
4621
4613
  }
4622
4614
  return extractResultData;
@@ -4637,26 +4629,26 @@ var HuggingFaceSummarizationIO = /*#__PURE__*/function (_HuggingFaceIO5) {
4637
4629
  _createClass(HuggingFaceSummarizationIO, [{
4638
4630
  key: "extractResultData",
4639
4631
  value: function () {
4640
- var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e) {
4641
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
4642
- while (1) switch (_context32.prev = _context32.next) {
4632
+ var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e) {
4633
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
4634
+ while (1) switch (_context31.prev = _context31.next) {
4643
4635
  case 0:
4644
4636
  if (!e.error) {
4645
- _context32.next = 2;
4637
+ _context31.next = 2;
4646
4638
  break;
4647
4639
  }
4648
4640
  throw e.error;
4649
4641
  case 2:
4650
- return _context32.abrupt("return", {
4642
+ return _context31.abrupt("return", {
4651
4643
  text: e[0].summary_text || ""
4652
4644
  });
4653
4645
  case 3:
4654
4646
  case "end":
4655
- return _context32.stop();
4647
+ return _context31.stop();
4656
4648
  }
4657
- }, _callee32);
4649
+ }, _callee31);
4658
4650
  }));
4659
- function extractResultData(_x61) {
4651
+ function extractResultData(_x58) {
4660
4652
  return _extractResultData6.apply(this, arguments);
4661
4653
  }
4662
4654
  return extractResultData;
@@ -4717,26 +4709,26 @@ var HuggingFaceConversationIO = /*#__PURE__*/function (_HuggingFaceIO6) {
4717
4709
  }, {
4718
4710
  key: "extractResultData",
4719
4711
  value: function () {
4720
- var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e) {
4721
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
4722
- while (1) switch (_context33.prev = _context33.next) {
4712
+ var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e) {
4713
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
4714
+ while (1) switch (_context32.prev = _context32.next) {
4723
4715
  case 0:
4724
4716
  if (!e.error) {
4725
- _context33.next = 2;
4717
+ _context32.next = 2;
4726
4718
  break;
4727
4719
  }
4728
4720
  throw e.error;
4729
4721
  case 2:
4730
- return _context33.abrupt("return", {
4722
+ return _context32.abrupt("return", {
4731
4723
  text: e.generated_text || ""
4732
4724
  });
4733
4725
  case 3:
4734
4726
  case "end":
4735
- return _context33.stop();
4727
+ return _context32.stop();
4736
4728
  }
4737
- }, _callee33);
4729
+ }, _callee32);
4738
4730
  }));
4739
- function extractResultData(_x62) {
4731
+ function extractResultData(_x59) {
4740
4732
  return _extractResultData7.apply(this, arguments);
4741
4733
  }
4742
4734
  return extractResultData;
@@ -4778,19 +4770,19 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4778
4770
  }, {
4779
4771
  key: "callServiceAPI",
4780
4772
  value: function () {
4781
- var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e, t, n) {
4773
+ var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e, t, n) {
4782
4774
  var a, l, s, o;
4783
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
4784
- while (1) switch (_context34.prev = _context34.next) {
4775
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
4776
+ while (1) switch (_context33.prev = _context33.next) {
4785
4777
  case 0:
4786
4778
  if (this.requestSettings) {
4787
- _context34.next = 2;
4779
+ _context33.next = 2;
4788
4780
  break;
4789
4781
  }
4790
4782
  throw new Error("Request settings have not been set up");
4791
4783
  case 2:
4792
4784
  if (n) {
4793
- _context34.next = 4;
4785
+ _context33.next = 4;
4794
4786
  break;
4795
4787
  }
4796
4788
  throw new Error("Image was not found");
@@ -4799,11 +4791,11 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4799
4791
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
4800
4792
  case 6:
4801
4793
  case "end":
4802
- return _context34.stop();
4794
+ return _context33.stop();
4803
4795
  }
4804
- }, _callee34, this);
4796
+ }, _callee33, this);
4805
4797
  }));
4806
- function callServiceAPI(_x63, _x64, _x65) {
4798
+ function callServiceAPI(_x60, _x61, _x62) {
4807
4799
  return _callServiceAPI6.apply(this, arguments);
4808
4800
  }
4809
4801
  return callServiceAPI;
@@ -4811,17 +4803,17 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4811
4803
  }, {
4812
4804
  key: "extractResultData",
4813
4805
  value: function () {
4814
- var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e) {
4815
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
4816
- while (1) switch (_context35.prev = _context35.next) {
4806
+ var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e) {
4807
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
4808
+ while (1) switch (_context34.prev = _context34.next) {
4817
4809
  case 0:
4818
4810
  if (!e.message) {
4819
- _context35.next = 2;
4811
+ _context34.next = 2;
4820
4812
  break;
4821
4813
  }
4822
4814
  throw e.message;
4823
4815
  case 2:
4824
- return _context35.abrupt("return", {
4816
+ return _context34.abrupt("return", {
4825
4817
  files: e.artifacts.map(function (n) {
4826
4818
  return {
4827
4819
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4831,11 +4823,11 @@ var StabilityAIImageToImageIO = /*#__PURE__*/function (_StabilityAIIO3) {
4831
4823
  });
4832
4824
  case 3:
4833
4825
  case "end":
4834
- return _context35.stop();
4826
+ return _context34.stop();
4835
4827
  }
4836
- }, _callee35);
4828
+ }, _callee34);
4837
4829
  }));
4838
- function extractResultData(_x66) {
4830
+ function extractResultData(_x63) {
4839
4831
  return _extractResultData8.apply(this, arguments);
4840
4832
  }
4841
4833
  return extractResultData;
@@ -4866,26 +4858,26 @@ var HuggingFaceTranslationIO = /*#__PURE__*/function (_HuggingFaceIO7) {
4866
4858
  _createClass(HuggingFaceTranslationIO, [{
4867
4859
  key: "extractResultData",
4868
4860
  value: function () {
4869
- var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
4870
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
4871
- while (1) switch (_context36.prev = _context36.next) {
4861
+ var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e) {
4862
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
4863
+ while (1) switch (_context35.prev = _context35.next) {
4872
4864
  case 0:
4873
4865
  if (!e.error) {
4874
- _context36.next = 2;
4866
+ _context35.next = 2;
4875
4867
  break;
4876
4868
  }
4877
4869
  throw e.error;
4878
4870
  case 2:
4879
- return _context36.abrupt("return", {
4871
+ return _context35.abrupt("return", {
4880
4872
  text: e[0].translation_text || ""
4881
4873
  });
4882
4874
  case 3:
4883
4875
  case "end":
4884
- return _context36.stop();
4876
+ return _context35.stop();
4885
4877
  }
4886
- }, _callee36);
4878
+ }, _callee35);
4887
4879
  }));
4888
- function extractResultData(_x67) {
4880
+ function extractResultData(_x64) {
4889
4881
  return _extractResultData9.apply(this, arguments);
4890
4882
  }
4891
4883
  return extractResultData;
@@ -4919,13 +4911,13 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4919
4911
  }, {
4920
4912
  key: "callServiceAPI",
4921
4913
  value: function () {
4922
- var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e, t) {
4914
+ var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e, t) {
4923
4915
  var n;
4924
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
4925
- while (1) switch (_context37.prev = _context37.next) {
4916
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
4917
+ while (1) switch (_context36.prev = _context36.next) {
4926
4918
  case 0:
4927
4919
  if (this.requestSettings) {
4928
- _context37.next = 2;
4920
+ _context36.next = 2;
4929
4921
  break;
4930
4922
  }
4931
4923
  throw new Error("Request settings have not been set up");
@@ -4934,11 +4926,11 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4934
4926
  HTTPRequest.request(this, n, e);
4935
4927
  case 4:
4936
4928
  case "end":
4937
- return _context37.stop();
4929
+ return _context36.stop();
4938
4930
  }
4939
- }, _callee37, this);
4931
+ }, _callee36, this);
4940
4932
  }));
4941
- function callServiceAPI(_x68, _x69) {
4933
+ function callServiceAPI(_x65, _x66) {
4942
4934
  return _callServiceAPI7.apply(this, arguments);
4943
4935
  }
4944
4936
  return callServiceAPI;
@@ -4946,17 +4938,17 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4946
4938
  }, {
4947
4939
  key: "extractResultData",
4948
4940
  value: function () {
4949
- var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e) {
4950
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
4951
- while (1) switch (_context38.prev = _context38.next) {
4941
+ var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
4942
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
4943
+ while (1) switch (_context37.prev = _context37.next) {
4952
4944
  case 0:
4953
4945
  if (!e.message) {
4954
- _context38.next = 2;
4946
+ _context37.next = 2;
4955
4947
  break;
4956
4948
  }
4957
4949
  throw e.message;
4958
4950
  case 2:
4959
- return _context38.abrupt("return", {
4951
+ return _context37.abrupt("return", {
4960
4952
  files: e.artifacts.map(function (n) {
4961
4953
  return {
4962
4954
  src: "".concat(BASE_64_PREFIX).concat(n.base64),
@@ -4966,11 +4958,11 @@ var StabilityAITextToImageIO = /*#__PURE__*/function (_StabilityAIIO4) {
4966
4958
  });
4967
4959
  case 3:
4968
4960
  case "end":
4969
- return _context38.stop();
4961
+ return _context37.stop();
4970
4962
  }
4971
- }, _callee38);
4963
+ }, _callee37);
4972
4964
  }));
4973
- function extractResultData(_x70) {
4965
+ function extractResultData(_x67) {
4974
4966
  return _extractResultData10.apply(this, arguments);
4975
4967
  }
4976
4968
  return extractResultData;
@@ -5003,26 +4995,26 @@ var HuggingFaceFillMaskIO = /*#__PURE__*/function (_HuggingFaceIO8) {
5003
4995
  _createClass(HuggingFaceFillMaskIO, [{
5004
4996
  key: "extractResultData",
5005
4997
  value: function () {
5006
- var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e) {
5007
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
5008
- while (1) switch (_context39.prev = _context39.next) {
4998
+ var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e) {
4999
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
5000
+ while (1) switch (_context38.prev = _context38.next) {
5009
5001
  case 0:
5010
5002
  if (!e.error) {
5011
- _context39.next = 2;
5003
+ _context38.next = 2;
5012
5004
  break;
5013
5005
  }
5014
5006
  throw e.error;
5015
5007
  case 2:
5016
- return _context39.abrupt("return", {
5008
+ return _context38.abrupt("return", {
5017
5009
  text: e[0].sequence || ""
5018
5010
  });
5019
5011
  case 3:
5020
5012
  case "end":
5021
- return _context39.stop();
5013
+ return _context38.stop();
5022
5014
  }
5023
- }, _callee39);
5015
+ }, _callee38);
5024
5016
  }));
5025
- function extractResultData(_x71) {
5017
+ function extractResultData(_x68) {
5026
5018
  return _extractResultData11.apply(this, arguments);
5027
5019
  }
5028
5020
  return extractResultData;
@@ -5097,13 +5089,13 @@ var CohereTextGenerationIO = /*#__PURE__*/function (_CohereIO) {
5097
5089
  }, {
5098
5090
  key: "callServiceAPI",
5099
5091
  value: function () {
5100
- var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e, t) {
5092
+ var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e, t) {
5101
5093
  var n;
5102
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
5103
- while (1) switch (_context40.prev = _context40.next) {
5094
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
5095
+ while (1) switch (_context39.prev = _context39.next) {
5104
5096
  case 0:
5105
5097
  if (this.requestSettings) {
5106
- _context40.next = 2;
5098
+ _context39.next = 2;
5107
5099
  break;
5108
5100
  }
5109
5101
  throw new Error("Request settings have not been set up");
@@ -5112,11 +5104,11 @@ var CohereTextGenerationIO = /*#__PURE__*/function (_CohereIO) {
5112
5104
  HTTPRequest.request(this, n, e);
5113
5105
  case 4:
5114
5106
  case "end":
5115
- return _context40.stop();
5107
+ return _context39.stop();
5116
5108
  }
5117
- }, _callee40, this);
5109
+ }, _callee39, this);
5118
5110
  }));
5119
- function callServiceAPI(_x72, _x73) {
5111
+ function callServiceAPI(_x69, _x70) {
5120
5112
  return _callServiceAPI8.apply(this, arguments);
5121
5113
  }
5122
5114
  return callServiceAPI;
@@ -5124,27 +5116,27 @@ var CohereTextGenerationIO = /*#__PURE__*/function (_CohereIO) {
5124
5116
  }, {
5125
5117
  key: "extractResultData",
5126
5118
  value: function () {
5127
- var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e) {
5119
+ var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e) {
5128
5120
  var t;
5129
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
5130
- while (1) switch (_context41.prev = _context41.next) {
5121
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
5122
+ while (1) switch (_context40.prev = _context40.next) {
5131
5123
  case 0:
5132
5124
  if (!e.message) {
5133
- _context41.next = 2;
5125
+ _context40.next = 2;
5134
5126
  break;
5135
5127
  }
5136
5128
  throw e.message;
5137
5129
  case 2:
5138
- return _context41.abrupt("return", {
5130
+ return _context40.abrupt("return", {
5139
5131
  text: ((t = e.generations) == null ? void 0 : t[0].text) || ""
5140
5132
  });
5141
5133
  case 3:
5142
5134
  case "end":
5143
- return _context41.stop();
5135
+ return _context40.stop();
5144
5136
  }
5145
- }, _callee41);
5137
+ }, _callee40);
5146
5138
  }));
5147
- function extractResultData(_x74) {
5139
+ function extractResultData(_x71) {
5148
5140
  return _extractResultData12.apply(this, arguments);
5149
5141
  }
5150
5142
  return extractResultData;
@@ -5174,13 +5166,13 @@ var CohereSummarizationIO = /*#__PURE__*/function (_CohereIO2) {
5174
5166
  }, {
5175
5167
  key: "callServiceAPI",
5176
5168
  value: function () {
5177
- var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e, t) {
5169
+ var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e, t) {
5178
5170
  var n;
5179
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
5180
- while (1) switch (_context42.prev = _context42.next) {
5171
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
5172
+ while (1) switch (_context41.prev = _context41.next) {
5181
5173
  case 0:
5182
5174
  if (this.requestSettings) {
5183
- _context42.next = 2;
5175
+ _context41.next = 2;
5184
5176
  break;
5185
5177
  }
5186
5178
  throw new Error("Request settings have not been set up");
@@ -5189,11 +5181,11 @@ var CohereSummarizationIO = /*#__PURE__*/function (_CohereIO2) {
5189
5181
  HTTPRequest.request(this, n, e);
5190
5182
  case 4:
5191
5183
  case "end":
5192
- return _context42.stop();
5184
+ return _context41.stop();
5193
5185
  }
5194
- }, _callee42, this);
5186
+ }, _callee41, this);
5195
5187
  }));
5196
- function callServiceAPI(_x75, _x76) {
5188
+ function callServiceAPI(_x72, _x73) {
5197
5189
  return _callServiceAPI9.apply(this, arguments);
5198
5190
  }
5199
5191
  return callServiceAPI;
@@ -5201,26 +5193,26 @@ var CohereSummarizationIO = /*#__PURE__*/function (_CohereIO2) {
5201
5193
  }, {
5202
5194
  key: "extractResultData",
5203
5195
  value: function () {
5204
- var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e) {
5205
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
5206
- while (1) switch (_context43.prev = _context43.next) {
5196
+ var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e) {
5197
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
5198
+ while (1) switch (_context42.prev = _context42.next) {
5207
5199
  case 0:
5208
5200
  if (!e.message) {
5209
- _context43.next = 2;
5201
+ _context42.next = 2;
5210
5202
  break;
5211
5203
  }
5212
5204
  throw e.message;
5213
5205
  case 2:
5214
- return _context43.abrupt("return", {
5206
+ return _context42.abrupt("return", {
5215
5207
  text: e.summary || ""
5216
5208
  });
5217
5209
  case 3:
5218
5210
  case "end":
5219
- return _context43.stop();
5211
+ return _context42.stop();
5220
5212
  }
5221
- }, _callee43);
5213
+ }, _callee42);
5222
5214
  }));
5223
- function extractResultData(_x77) {
5215
+ function extractResultData(_x74) {
5224
5216
  return _extractResultData13.apply(this, arguments);
5225
5217
  }
5226
5218
  return extractResultData;
@@ -5377,13 +5369,13 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5377
5369
  }, {
5378
5370
  key: "callServiceAPI",
5379
5371
  value: function () {
5380
- var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(e, t) {
5372
+ var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e, t) {
5381
5373
  var n;
5382
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
5383
- while (1) switch (_context44.prev = _context44.next) {
5374
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
5375
+ while (1) switch (_context43.prev = _context43.next) {
5384
5376
  case 0:
5385
5377
  if (this.requestSettings) {
5386
- _context44.next = 2;
5378
+ _context43.next = 2;
5387
5379
  break;
5388
5380
  }
5389
5381
  throw new Error("Request settings have not been set up");
@@ -5392,11 +5384,11 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5392
5384
  HTTPRequest.request(this, n, e), this.messages = e;
5393
5385
  case 4:
5394
5386
  case "end":
5395
- return _context44.stop();
5387
+ return _context43.stop();
5396
5388
  }
5397
- }, _callee44, this);
5389
+ }, _callee43, this);
5398
5390
  }));
5399
- function callServiceAPI(_x78, _x79) {
5391
+ function callServiceAPI(_x75, _x76) {
5400
5392
  return _callServiceAPI10.apply(this, arguments);
5401
5393
  }
5402
5394
  return callServiceAPI;
@@ -5404,34 +5396,34 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5404
5396
  }, {
5405
5397
  key: "extractResultData",
5406
5398
  value: function () {
5407
- var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e) {
5408
- var t, n, _s4;
5409
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
5410
- while (1) switch (_context45.prev = _context45.next) {
5399
+ var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(e) {
5400
+ var t, n, s;
5401
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
5402
+ while (1) switch (_context44.prev = _context44.next) {
5411
5403
  case 0:
5412
5404
  if (!e.error) {
5413
- _context45.next = 2;
5405
+ _context44.next = 2;
5414
5406
  break;
5415
5407
  }
5416
5408
  throw e.error.message;
5417
5409
  case 2:
5418
5410
  if (this.messages && this.completionsHandlers) {
5419
- n = e.headers.get("operation-location"), _s4 = {
5411
+ n = e.headers.get("operation-location"), s = {
5420
5412
  method: "GET",
5421
5413
  headers: (t = this.requestSettings) == null ? void 0 : t.headers
5422
5414
  };
5423
- HTTPRequest.executePollRequest(this, n, _s4, this.messages);
5415
+ HTTPRequest.executePollRequest(this, n, s, this.messages);
5424
5416
  }
5425
- return _context45.abrupt("return", {
5417
+ return _context44.abrupt("return", {
5426
5418
  pollingInAnotherRequest: !0
5427
5419
  });
5428
5420
  case 4:
5429
5421
  case "end":
5430
- return _context45.stop();
5422
+ return _context44.stop();
5431
5423
  }
5432
- }, _callee45, this);
5424
+ }, _callee44, this);
5433
5425
  }));
5434
- function extractResultData(_x80) {
5426
+ function extractResultData(_x77) {
5435
5427
  return _extractResultData14.apply(this, arguments);
5436
5428
  }
5437
5429
  return extractResultData;
@@ -5439,33 +5431,33 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5439
5431
  }, {
5440
5432
  key: "extractPollResultData",
5441
5433
  value: function () {
5442
- var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e) {
5434
+ var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e) {
5443
5435
  var t, _iterator, _step, n;
5444
- return _regeneratorRuntime().wrap(function _callee46$(_context46) {
5445
- while (1) switch (_context46.prev = _context46.next) {
5436
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
5437
+ while (1) switch (_context45.prev = _context45.next) {
5446
5438
  case 0:
5447
5439
  if (!e.error) {
5448
- _context46.next = 2;
5440
+ _context45.next = 2;
5449
5441
  break;
5450
5442
  }
5451
5443
  throw e.error;
5452
5444
  case 2:
5453
5445
  if (!(e.status === "running")) {
5454
- _context46.next = 4;
5446
+ _context45.next = 4;
5455
5447
  break;
5456
5448
  }
5457
- return _context46.abrupt("return", {
5449
+ return _context45.abrupt("return", {
5458
5450
  timeoutMS: 2e3
5459
5451
  });
5460
5452
  case 4:
5461
5453
  if (!(e.errors.length > 0)) {
5462
- _context46.next = 6;
5454
+ _context45.next = 6;
5463
5455
  break;
5464
5456
  }
5465
5457
  throw e.errors[0];
5466
5458
  case 6:
5467
5459
  if (!(e.tasks.items[0].results.errors.length > 0)) {
5468
- _context46.next = 8;
5460
+ _context45.next = 8;
5469
5461
  break;
5470
5462
  }
5471
5463
  throw e.tasks.items[0].results.errors[0];
@@ -5482,16 +5474,16 @@ var AzureSummarizationIO = /*#__PURE__*/function (_AzureLanguageIO) {
5482
5474
  } finally {
5483
5475
  _iterator.f();
5484
5476
  }
5485
- return _context46.abrupt("return", {
5477
+ return _context45.abrupt("return", {
5486
5478
  text: t || ""
5487
5479
  });
5488
5480
  case 12:
5489
5481
  case "end":
5490
- return _context46.stop();
5482
+ return _context45.stop();
5491
5483
  }
5492
- }, _callee46);
5484
+ }, _callee45);
5493
5485
  }));
5494
- function extractPollResultData(_x81) {
5486
+ function extractPollResultData(_x78) {
5495
5487
  return _extractPollResultData4.apply(this, arguments);
5496
5488
  }
5497
5489
  return extractPollResultData;
@@ -5590,13 +5582,13 @@ var OpenAICompletionsIO = /*#__PURE__*/function (_DirectServiceIO5) {
5590
5582
  }, {
5591
5583
  key: "callServiceAPI",
5592
5584
  value: function () {
5593
- var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e, t) {
5585
+ var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e, t) {
5594
5586
  var n;
5595
- return _regeneratorRuntime().wrap(function _callee47$(_context47) {
5596
- while (1) switch (_context47.prev = _context47.next) {
5587
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
5588
+ while (1) switch (_context46.prev = _context46.next) {
5597
5589
  case 0:
5598
5590
  if (this.requestSettings) {
5599
- _context47.next = 2;
5591
+ _context46.next = 2;
5600
5592
  break;
5601
5593
  }
5602
5594
  throw new Error("Request settings have not been set up");
@@ -5605,11 +5597,11 @@ var OpenAICompletionsIO = /*#__PURE__*/function (_DirectServiceIO5) {
5605
5597
  this.deepChat.stream || n.stream ? (n.stream = !0, Stream.request(this, n, e)) : HTTPRequest.request(this, n, e);
5606
5598
  case 4:
5607
5599
  case "end":
5608
- return _context47.stop();
5600
+ return _context46.stop();
5609
5601
  }
5610
- }, _callee47, this);
5602
+ }, _callee46, this);
5611
5603
  }));
5612
- function callServiceAPI(_x82, _x83) {
5604
+ function callServiceAPI(_x79, _x80) {
5613
5605
  return _callServiceAPI11.apply(this, arguments);
5614
5606
  }
5615
5607
  return callServiceAPI;
@@ -5617,27 +5609,27 @@ var OpenAICompletionsIO = /*#__PURE__*/function (_DirectServiceIO5) {
5617
5609
  }, {
5618
5610
  key: "extractResultData",
5619
5611
  value: function () {
5620
- var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e) {
5612
+ var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e) {
5621
5613
  var t;
5622
- return _regeneratorRuntime().wrap(function _callee48$(_context48) {
5623
- while (1) switch (_context48.prev = _context48.next) {
5614
+ return _regeneratorRuntime().wrap(function _callee47$(_context47) {
5615
+ while (1) switch (_context47.prev = _context47.next) {
5624
5616
  case 0:
5625
5617
  if (!e.error) {
5626
- _context48.next = 2;
5618
+ _context47.next = 2;
5627
5619
  break;
5628
5620
  }
5629
5621
  throw e.error.message;
5630
5622
  case 2:
5631
- return _context48.abrupt("return", {
5623
+ return _context47.abrupt("return", {
5632
5624
  text: ((t = e.choices[0]) == null ? void 0 : t.text) || ""
5633
5625
  });
5634
5626
  case 3:
5635
5627
  case "end":
5636
- return _context48.stop();
5628
+ return _context47.stop();
5637
5629
  }
5638
- }, _callee48);
5630
+ }, _callee47);
5639
5631
  }));
5640
- function extractResultData(_x84) {
5632
+ function extractResultData(_x81) {
5641
5633
  return _extractResultData15.apply(this, arguments);
5642
5634
  }
5643
5635
  return extractResultData;
@@ -5652,17 +5644,17 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5652
5644
  _createClass(AssemblyAIUtils, null, [{
5653
5645
  key: "poll",
5654
5646
  value: function () {
5655
- var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e, t) {
5647
+ var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t) {
5656
5648
  var n, l, c, d;
5657
- return _regeneratorRuntime().wrap(function _callee49$(_context49) {
5658
- while (1) switch (_context49.prev = _context49.next) {
5649
+ return _regeneratorRuntime().wrap(function _callee48$(_context48) {
5650
+ while (1) switch (_context48.prev = _context48.next) {
5659
5651
  case 0:
5660
5652
  n = {
5661
5653
  authorization: e,
5662
5654
  "content-type": "application/json"
5663
5655
  };
5664
- _context49.t0 = "https://api.assemblyai.com/v2/transcript/";
5665
- _context49.next = 4;
5656
+ _context48.t0 = "https://api.assemblyai.com/v2/transcript/";
5657
+ _context48.next = 4;
5666
5658
  return fetch("https://api.assemblyai.com/v2/transcript", {
5667
5659
  method: "POST",
5668
5660
  body: JSON.stringify({
@@ -5671,55 +5663,55 @@ var AssemblyAIUtils = /*#__PURE__*/function () {
5671
5663
  headers: n
5672
5664
  });
5673
5665
  case 4:
5674
- _context49.next = 6;
5675
- return _context49.sent.json();
5666
+ _context48.next = 6;
5667
+ return _context48.sent.json();
5676
5668
  case 6:
5677
- _context49.t1 = _context49.sent.id;
5678
- l = _context49.t0.concat.call(_context49.t0, _context49.t1);
5669
+ _context48.t1 = _context48.sent.id;
5670
+ l = _context48.t0.concat.call(_context48.t0, _context48.t1);
5679
5671
  case 8:
5680
5672
  if (c) {
5681
- _context49.next = 24;
5673
+ _context48.next = 24;
5682
5674
  break;
5683
5675
  }
5684
- _context49.next = 11;
5676
+ _context48.next = 11;
5685
5677
  return fetch(l, {
5686
5678
  headers: n
5687
5679
  });
5688
5680
  case 11:
5689
- _context49.next = 13;
5690
- return _context49.sent.json();
5681
+ _context48.next = 13;
5682
+ return _context48.sent.json();
5691
5683
  case 13:
5692
- d = _context49.sent;
5684
+ d = _context48.sent;
5693
5685
  if (!(d.status === "completed")) {
5694
- _context49.next = 18;
5686
+ _context48.next = 18;
5695
5687
  break;
5696
5688
  }
5697
5689
  c = d;
5698
- _context49.next = 22;
5690
+ _context48.next = 22;
5699
5691
  break;
5700
5692
  case 18:
5701
5693
  if (!(d.status === "error")) {
5702
- _context49.next = 20;
5694
+ _context48.next = 20;
5703
5695
  break;
5704
5696
  }
5705
5697
  throw new Error("Transcription failed: ".concat(d.error));
5706
5698
  case 20:
5707
- _context49.next = 22;
5699
+ _context48.next = 22;
5708
5700
  return new Promise(function (h) {
5709
5701
  return setTimeout(h, 3e3);
5710
5702
  });
5711
5703
  case 22:
5712
- _context49.next = 8;
5704
+ _context48.next = 8;
5713
5705
  break;
5714
5706
  case 24:
5715
- return _context49.abrupt("return", c);
5707
+ return _context48.abrupt("return", c);
5716
5708
  case 25:
5717
5709
  case "end":
5718
- return _context49.stop();
5710
+ return _context48.stop();
5719
5711
  }
5720
- }, _callee49);
5712
+ }, _callee48);
5721
5713
  }));
5722
- function poll(_x85, _x86) {
5714
+ function poll(_x82, _x83) {
5723
5715
  return _poll2.apply(this, arguments);
5724
5716
  }
5725
5717
  return poll;
@@ -5767,19 +5759,19 @@ var AssemblyAIAudioIO = /*#__PURE__*/function (_DirectServiceIO6) {
5767
5759
  _createClass(AssemblyAIAudioIO, [{
5768
5760
  key: "callServiceAPI",
5769
5761
  value: function () {
5770
- var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e, t, n) {
5762
+ var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e, t, n) {
5771
5763
  var s;
5772
- return _regeneratorRuntime().wrap(function _callee50$(_context50) {
5773
- while (1) switch (_context50.prev = _context50.next) {
5764
+ return _regeneratorRuntime().wrap(function _callee49$(_context49) {
5765
+ while (1) switch (_context49.prev = _context49.next) {
5774
5766
  case 0:
5775
5767
  if ((s = this.requestSettings) != null && s.headers) {
5776
- _context50.next = 2;
5768
+ _context49.next = 2;
5777
5769
  break;
5778
5770
  }
5779
5771
  throw new Error("Request settings have not been set up");
5780
5772
  case 2:
5781
5773
  if (n != null && n[0]) {
5782
- _context50.next = 4;
5774
+ _context49.next = 4;
5783
5775
  break;
5784
5776
  }
5785
5777
  throw new Error("No file was added");
@@ -5787,11 +5779,11 @@ var AssemblyAIAudioIO = /*#__PURE__*/function (_DirectServiceIO6) {
5787
5779
  HTTPRequest.request(this, n[0], e, !1);
5788
5780
  case 5:
5789
5781
  case "end":
5790
- return _context50.stop();
5782
+ return _context49.stop();
5791
5783
  }
5792
- }, _callee50, this);
5784
+ }, _callee49, this);
5793
5785
  }));
5794
- function callServiceAPI(_x87, _x88, _x89) {
5786
+ function callServiceAPI(_x84, _x85, _x86) {
5795
5787
  return _callServiceAPI12.apply(this, arguments);
5796
5788
  }
5797
5789
  return callServiceAPI;
@@ -5799,32 +5791,32 @@ var AssemblyAIAudioIO = /*#__PURE__*/function (_DirectServiceIO6) {
5799
5791
  }, {
5800
5792
  key: "extractResultData",
5801
5793
  value: function () {
5802
- var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e) {
5794
+ var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e) {
5803
5795
  var s, o, t;
5804
- return _regeneratorRuntime().wrap(function _callee51$(_context51) {
5805
- while (1) switch (_context51.prev = _context51.next) {
5796
+ return _regeneratorRuntime().wrap(function _callee50$(_context50) {
5797
+ while (1) switch (_context50.prev = _context50.next) {
5806
5798
  case 0:
5807
5799
  if (!e.error) {
5808
- _context51.next = 2;
5800
+ _context50.next = 2;
5809
5801
  break;
5810
5802
  }
5811
5803
  throw e.error;
5812
5804
  case 2:
5813
5805
  t = (o = (s = this.requestSettings) == null ? void 0 : s.headers) == null ? void 0 : o.Authorization;
5814
- _context51.next = 5;
5806
+ _context50.next = 5;
5815
5807
  return AssemblyAIUtils.poll(t, e.upload_url);
5816
5808
  case 5:
5817
- _context51.t0 = _context51.sent.text;
5818
- return _context51.abrupt("return", {
5819
- text: _context51.t0
5809
+ _context50.t0 = _context50.sent.text;
5810
+ return _context50.abrupt("return", {
5811
+ text: _context50.t0
5820
5812
  });
5821
5813
  case 7:
5822
5814
  case "end":
5823
- return _context51.stop();
5815
+ return _context50.stop();
5824
5816
  }
5825
- }, _callee51, this);
5817
+ }, _callee50, this);
5826
5818
  }));
5827
- function extractResultData(_x90) {
5819
+ function extractResultData(_x87) {
5828
5820
  return _extractResultData16.apply(this, arguments);
5829
5821
  }
5830
5822
  return extractResultData;
@@ -5874,13 +5866,13 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5874
5866
  }, {
5875
5867
  key: "callServiceAPI",
5876
5868
  value: function () {
5877
- var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e, t) {
5869
+ var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e, t) {
5878
5870
  var n;
5879
- return _regeneratorRuntime().wrap(function _callee52$(_context52) {
5880
- while (1) switch (_context52.prev = _context52.next) {
5871
+ return _regeneratorRuntime().wrap(function _callee51$(_context51) {
5872
+ while (1) switch (_context51.prev = _context51.next) {
5881
5873
  case 0:
5882
5874
  if (this.requestSettings) {
5883
- _context52.next = 2;
5875
+ _context51.next = 2;
5884
5876
  break;
5885
5877
  }
5886
5878
  throw new Error("Request settings have not been set up");
@@ -5889,11 +5881,11 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5889
5881
  HTTPRequest.request(this, n, e, !1);
5890
5882
  case 4:
5891
5883
  case "end":
5892
- return _context52.stop();
5884
+ return _context51.stop();
5893
5885
  }
5894
- }, _callee52, this);
5886
+ }, _callee51, this);
5895
5887
  }));
5896
- function callServiceAPI(_x91, _x92) {
5888
+ function callServiceAPI(_x88, _x89) {
5897
5889
  return _callServiceAPI13.apply(this, arguments);
5898
5890
  }
5899
5891
  return callServiceAPI;
@@ -5901,11 +5893,11 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5901
5893
  }, {
5902
5894
  key: "extractResultData",
5903
5895
  value: function () {
5904
- var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e) {
5905
- return _regeneratorRuntime().wrap(function _callee53$(_context53) {
5906
- while (1) switch (_context53.prev = _context53.next) {
5896
+ var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e) {
5897
+ return _regeneratorRuntime().wrap(function _callee52$(_context52) {
5898
+ while (1) switch (_context52.prev = _context52.next) {
5907
5899
  case 0:
5908
- return _context53.abrupt("return", new Promise(function (t) {
5900
+ return _context52.abrupt("return", new Promise(function (t) {
5909
5901
  var n = new FileReader();
5910
5902
  n.readAsDataURL(e), n.onload = function (s) {
5911
5903
  t({
@@ -5918,11 +5910,11 @@ var _AzureTextToSpeechIO = /*#__PURE__*/function (_AzureSpeechIO) {
5918
5910
  }));
5919
5911
  case 1:
5920
5912
  case "end":
5921
- return _context53.stop();
5913
+ return _context52.stop();
5922
5914
  }
5923
- }, _callee53);
5915
+ }, _callee52);
5924
5916
  }));
5925
- function extractResultData(_x93) {
5917
+ function extractResultData(_x90) {
5926
5918
  return _extractResultData17.apply(this, arguments);
5927
5919
  }
5928
5920
  return extractResultData;
@@ -5958,19 +5950,19 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5958
5950
  _createClass(j, [{
5959
5951
  key: "callServiceAPI",
5960
5952
  value: function () {
5961
- var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e, t, n) {
5953
+ var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e, t, n) {
5962
5954
  var s, o;
5963
- return _regeneratorRuntime().wrap(function _callee54$(_context54) {
5964
- while (1) switch (_context54.prev = _context54.next) {
5955
+ return _regeneratorRuntime().wrap(function _callee53$(_context53) {
5956
+ while (1) switch (_context53.prev = _context53.next) {
5965
5957
  case 0:
5966
5958
  if ((s = this.requestSettings) != null && s.headers) {
5967
- _context54.next = 2;
5959
+ _context53.next = 2;
5968
5960
  break;
5969
5961
  }
5970
5962
  throw new Error("Request settings have not been set up");
5971
5963
  case 2:
5972
5964
  if (n != null && n[0]) {
5973
- _context54.next = 4;
5965
+ _context53.next = 4;
5974
5966
  break;
5975
5967
  }
5976
5968
  throw new Error("No file was added");
@@ -5978,11 +5970,11 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5978
5970
  (o = this.requestSettings) != null && o.headers && (this.requestSettings.headers["Content-Type"] = n[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), HTTPRequest.request(this, n[0], e, !1);
5979
5971
  case 5:
5980
5972
  case "end":
5981
- return _context54.stop();
5973
+ return _context53.stop();
5982
5974
  }
5983
- }, _callee54, this);
5975
+ }, _callee53, this);
5984
5976
  }));
5985
- function callServiceAPI(_x94, _x95, _x96) {
5977
+ function callServiceAPI(_x91, _x92, _x93) {
5986
5978
  return _callServiceAPI14.apply(this, arguments);
5987
5979
  }
5988
5980
  return callServiceAPI;
@@ -5990,26 +5982,26 @@ var _AzureSpeechToTextIO = /*#__PURE__*/function (_AzureSpeechIO2) {
5990
5982
  }, {
5991
5983
  key: "extractResultData",
5992
5984
  value: function () {
5993
- var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e) {
5994
- return _regeneratorRuntime().wrap(function _callee55$(_context55) {
5995
- while (1) switch (_context55.prev = _context55.next) {
5985
+ var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e) {
5986
+ return _regeneratorRuntime().wrap(function _callee54$(_context54) {
5987
+ while (1) switch (_context54.prev = _context54.next) {
5996
5988
  case 0:
5997
5989
  if (!e.error) {
5998
- _context55.next = 2;
5990
+ _context54.next = 2;
5999
5991
  break;
6000
5992
  }
6001
5993
  throw e.error;
6002
5994
  case 2:
6003
- return _context55.abrupt("return", {
5995
+ return _context54.abrupt("return", {
6004
5996
  text: e.DisplayText || ""
6005
5997
  });
6006
5998
  case 3:
6007
5999
  case "end":
6008
- return _context55.stop();
6000
+ return _context54.stop();
6009
6001
  }
6010
- }, _callee55);
6002
+ }, _callee54);
6011
6003
  }));
6012
- function extractResultData(_x97) {
6004
+ function extractResultData(_x94) {
6013
6005
  return _extractResultData18.apply(this, arguments);
6014
6006
  }
6015
6007
  return extractResultData;
@@ -6052,13 +6044,13 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
6052
6044
  }, {
6053
6045
  key: "callServiceAPI",
6054
6046
  value: function () {
6055
- var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e, t) {
6047
+ var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e, t) {
6056
6048
  var n;
6057
- return _regeneratorRuntime().wrap(function _callee56$(_context56) {
6058
- while (1) switch (_context56.prev = _context56.next) {
6049
+ return _regeneratorRuntime().wrap(function _callee55$(_context55) {
6050
+ while (1) switch (_context55.prev = _context55.next) {
6059
6051
  case 0:
6060
6052
  if (this.requestSettings) {
6061
- _context56.next = 2;
6053
+ _context55.next = 2;
6062
6054
  break;
6063
6055
  }
6064
6056
  throw new Error("Request settings have not been set up");
@@ -6067,11 +6059,11 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
6067
6059
  HTTPRequest.request(this, n, e);
6068
6060
  case 4:
6069
6061
  case "end":
6070
- return _context56.stop();
6062
+ return _context55.stop();
6071
6063
  }
6072
- }, _callee56, this);
6064
+ }, _callee55, this);
6073
6065
  }));
6074
- function callServiceAPI(_x98, _x99) {
6066
+ function callServiceAPI(_x95, _x96) {
6075
6067
  return _callServiceAPI15.apply(this, arguments);
6076
6068
  }
6077
6069
  return callServiceAPI;
@@ -6079,27 +6071,27 @@ var AzureTranslationIO = /*#__PURE__*/function (_DirectServiceIO8) {
6079
6071
  }, {
6080
6072
  key: "extractResultData",
6081
6073
  value: function () {
6082
- var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(e) {
6074
+ var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e) {
6083
6075
  var t;
6084
- return _regeneratorRuntime().wrap(function _callee57$(_context57) {
6085
- while (1) switch (_context57.prev = _context57.next) {
6076
+ return _regeneratorRuntime().wrap(function _callee56$(_context56) {
6077
+ while (1) switch (_context56.prev = _context56.next) {
6086
6078
  case 0:
6087
6079
  if (!Array.isArray(e)) {
6088
- _context57.next = 2;
6080
+ _context56.next = 2;
6089
6081
  break;
6090
6082
  }
6091
- return _context57.abrupt("return", {
6083
+ return _context56.abrupt("return", {
6092
6084
  text: ((t = e[0].translations) == null ? void 0 : t[0].text) || ""
6093
6085
  });
6094
6086
  case 2:
6095
6087
  throw e.error;
6096
6088
  case 3:
6097
6089
  case "end":
6098
- return _context57.stop();
6090
+ return _context56.stop();
6099
6091
  }
6100
- }, _callee57);
6092
+ }, _callee56);
6101
6093
  }));
6102
- function extractResultData(_x100) {
6094
+ function extractResultData(_x97) {
6103
6095
  return _extractResultData19.apply(this, arguments);
6104
6096
  }
6105
6097
  return extractResultData;
@@ -6144,8 +6136,8 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6144
6136
  value: function preprocessBody(e, t) {
6145
6137
  var n = JSON.parse(JSON.stringify(e));
6146
6138
  if (t && t !== "") {
6147
- var _s5 = t.substring(0, this._maxCharLength);
6148
- n.prompt = _s5;
6139
+ var s = t.substring(0, this._maxCharLength);
6140
+ n.prompt = s;
6149
6141
  }
6150
6142
  return n;
6151
6143
  }
@@ -6166,41 +6158,41 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6166
6158
  }, {
6167
6159
  key: "callServiceAPI",
6168
6160
  value: function () {
6169
- var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e, t, n) {
6170
- var s, _o2;
6171
- return _regeneratorRuntime().wrap(function _callee58$(_context58) {
6172
- while (1) switch (_context58.prev = _context58.next) {
6161
+ var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(e, t, n) {
6162
+ var s, o;
6163
+ return _regeneratorRuntime().wrap(function _callee57$(_context57) {
6164
+ while (1) switch (_context57.prev = _context57.next) {
6173
6165
  case 0:
6174
6166
  if ((s = this.requestSettings) != null && s.headers) {
6175
- _context58.next = 2;
6167
+ _context57.next = 2;
6176
6168
  break;
6177
6169
  }
6178
6170
  throw new Error("Request settings have not been set up");
6179
6171
  case 2:
6180
6172
  if (!(n != null && n[0])) {
6181
- _context58.next = 6;
6173
+ _context57.next = 6;
6182
6174
  break;
6183
6175
  }
6184
6176
  this.callApiWithImage(e, t, n);
6185
- _context58.next = 11;
6177
+ _context57.next = 11;
6186
6178
  break;
6187
6179
  case 6:
6188
6180
  if (this.requestSettings) {
6189
- _context58.next = 8;
6181
+ _context57.next = 8;
6190
6182
  break;
6191
6183
  }
6192
6184
  throw new Error("Request settings have not been set up");
6193
6185
  case 8:
6194
6186
  this.url = M.IMAGE_GENERATION_URL;
6195
- _o2 = this.preprocessBody(this.rawBody, t[t.length - 1].text);
6196
- HTTPRequest.request(this, _o2, e);
6187
+ o = this.preprocessBody(this.rawBody, t[t.length - 1].text);
6188
+ HTTPRequest.request(this, o, e);
6197
6189
  case 11:
6198
6190
  case "end":
6199
- return _context58.stop();
6191
+ return _context57.stop();
6200
6192
  }
6201
- }, _callee58, this);
6193
+ }, _callee57, this);
6202
6194
  }));
6203
- function callServiceAPI(_x101, _x102, _x103) {
6195
+ function callServiceAPI(_x98, _x99, _x100) {
6204
6196
  return _callServiceAPI16.apply(this, arguments);
6205
6197
  }
6206
6198
  return callServiceAPI;
@@ -6208,17 +6200,17 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6208
6200
  }, {
6209
6201
  key: "extractResultData",
6210
6202
  value: function () {
6211
- var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e) {
6212
- return _regeneratorRuntime().wrap(function _callee59$(_context59) {
6213
- while (1) switch (_context59.prev = _context59.next) {
6203
+ var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e) {
6204
+ return _regeneratorRuntime().wrap(function _callee58$(_context58) {
6205
+ while (1) switch (_context58.prev = _context58.next) {
6214
6206
  case 0:
6215
6207
  if (!e.error) {
6216
- _context59.next = 2;
6208
+ _context58.next = 2;
6217
6209
  break;
6218
6210
  }
6219
6211
  throw e.error.message;
6220
6212
  case 2:
6221
- return _context59.abrupt("return", {
6213
+ return _context58.abrupt("return", {
6222
6214
  files: e.data.map(function (n) {
6223
6215
  return n.url ? {
6224
6216
  src: n.url,
@@ -6231,11 +6223,11 @@ var _OpenAIImagesIO = /*#__PURE__*/function (_DirectServiceIO9) {
6231
6223
  });
6232
6224
  case 3:
6233
6225
  case "end":
6234
- return _context59.stop();
6226
+ return _context58.stop();
6235
6227
  }
6236
- }, _callee59);
6228
+ }, _callee58);
6237
6229
  }));
6238
- function extractResultData(_x104) {
6230
+ function extractResultData(_x101) {
6239
6231
  return _extractResultData20.apply(this, arguments);
6240
6232
  }
6241
6233
  return extractResultData;
@@ -6307,19 +6299,19 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6307
6299
  }, {
6308
6300
  key: "callServiceAPI",
6309
6301
  value: function () {
6310
- var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e, t, n) {
6302
+ var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e, t, n) {
6311
6303
  var a, s, o;
6312
- return _regeneratorRuntime().wrap(function _callee60$(_context60) {
6313
- while (1) switch (_context60.prev = _context60.next) {
6304
+ return _regeneratorRuntime().wrap(function _callee59$(_context59) {
6305
+ while (1) switch (_context59.prev = _context59.next) {
6314
6306
  case 0:
6315
6307
  if ((a = this.requestSettings) != null && a.headers) {
6316
- _context60.next = 2;
6308
+ _context59.next = 2;
6317
6309
  break;
6318
6310
  }
6319
6311
  throw new Error("Request settings have not been set up");
6320
6312
  case 2:
6321
6313
  if (n != null && n[0]) {
6322
- _context60.next = 4;
6314
+ _context59.next = 4;
6323
6315
  break;
6324
6316
  }
6325
6317
  throw new Error("No file was added");
@@ -6329,11 +6321,11 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6329
6321
  RequestUtils.temporarilyRemoveHeader(this.requestSettings, HTTPRequest.request.bind(this, this, o, e), !1);
6330
6322
  case 7:
6331
6323
  case "end":
6332
- return _context60.stop();
6324
+ return _context59.stop();
6333
6325
  }
6334
- }, _callee60, this);
6326
+ }, _callee59, this);
6335
6327
  }));
6336
- function callServiceAPI(_x105, _x106, _x107) {
6328
+ function callServiceAPI(_x102, _x103, _x104) {
6337
6329
  return _callServiceAPI17.apply(this, arguments);
6338
6330
  }
6339
6331
  return callServiceAPI;
@@ -6341,26 +6333,26 @@ var _OpenAIAudioIO = /*#__PURE__*/function (_DirectServiceIO10) {
6341
6333
  }, {
6342
6334
  key: "extractResultData",
6343
6335
  value: function () {
6344
- var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e) {
6345
- return _regeneratorRuntime().wrap(function _callee61$(_context61) {
6346
- while (1) switch (_context61.prev = _context61.next) {
6336
+ var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e) {
6337
+ return _regeneratorRuntime().wrap(function _callee60$(_context60) {
6338
+ while (1) switch (_context60.prev = _context60.next) {
6347
6339
  case 0:
6348
6340
  if (!e.error) {
6349
- _context61.next = 2;
6341
+ _context60.next = 2;
6350
6342
  break;
6351
6343
  }
6352
6344
  throw e.error.message;
6353
6345
  case 2:
6354
- return _context61.abrupt("return", {
6346
+ return _context60.abrupt("return", {
6355
6347
  text: e.text
6356
6348
  });
6357
6349
  case 3:
6358
6350
  case "end":
6359
- return _context61.stop();
6351
+ return _context60.stop();
6360
6352
  }
6361
- }, _callee61);
6353
+ }, _callee60);
6362
6354
  }));
6363
- function extractResultData(_x108) {
6355
+ function extractResultData(_x105) {
6364
6356
  return _extractResultData21.apply(this, arguments);
6365
6357
  }
6366
6358
  return extractResultData;
@@ -6426,13 +6418,13 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6426
6418
  }, {
6427
6419
  key: "callServiceAPI",
6428
6420
  value: function () {
6429
- var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e, t) {
6421
+ var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e, t) {
6430
6422
  var n;
6431
- return _regeneratorRuntime().wrap(function _callee62$(_context62) {
6432
- while (1) switch (_context62.prev = _context62.next) {
6423
+ return _regeneratorRuntime().wrap(function _callee61$(_context61) {
6424
+ while (1) switch (_context61.prev = _context61.next) {
6433
6425
  case 0:
6434
6426
  if (this.requestSettings) {
6435
- _context62.next = 2;
6427
+ _context61.next = 2;
6436
6428
  break;
6437
6429
  }
6438
6430
  throw new Error("Request settings have not been set up");
@@ -6441,11 +6433,11 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6441
6433
  this.deepChat.stream || n.stream ? (n.stream = !0, Stream.request(this, n, e)) : HTTPRequest.request(this, n, e);
6442
6434
  case 4:
6443
6435
  case "end":
6444
- return _context62.stop();
6436
+ return _context61.stop();
6445
6437
  }
6446
- }, _callee62, this);
6438
+ }, _callee61, this);
6447
6439
  }));
6448
- function callServiceAPI(_x109, _x110) {
6440
+ function callServiceAPI(_x106, _x107) {
6449
6441
  return _callServiceAPI18.apply(this, arguments);
6450
6442
  }
6451
6443
  return callServiceAPI;
@@ -6453,17 +6445,17 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6453
6445
  }, {
6454
6446
  key: "extractResultData",
6455
6447
  value: function () {
6456
- var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e) {
6457
- return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6458
- while (1) switch (_context63.prev = _context63.next) {
6448
+ var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e) {
6449
+ return _regeneratorRuntime().wrap(function _callee62$(_context62) {
6450
+ while (1) switch (_context62.prev = _context62.next) {
6459
6451
  case 0:
6460
6452
  if (!e.error) {
6461
- _context63.next = 2;
6453
+ _context62.next = 2;
6462
6454
  break;
6463
6455
  }
6464
6456
  throw e.error.message;
6465
6457
  case 2:
6466
- return _context63.abrupt("return", e.choices[0].delta ? {
6458
+ return _context62.abrupt("return", e.choices[0].delta ? {
6467
6459
  text: e.choices[0].delta.content || ""
6468
6460
  } : e.choices[0].message ? {
6469
6461
  text: e.choices[0].message.content
@@ -6472,11 +6464,11 @@ var OpenAIChatIO = /*#__PURE__*/function (_DirectServiceIO11) {
6472
6464
  });
6473
6465
  case 3:
6474
6466
  case "end":
6475
- return _context63.stop();
6467
+ return _context62.stop();
6476
6468
  }
6477
- }, _callee63);
6469
+ }, _callee62);
6478
6470
  }));
6479
- function extractResultData(_x111) {
6471
+ function extractResultData(_x108) {
6480
6472
  return _extractResultData22.apply(this, arguments);
6481
6473
  }
6482
6474
  return extractResultData;
@@ -6524,13 +6516,13 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6524
6516
  }, {
6525
6517
  key: "callServiceAPI",
6526
6518
  value: function () {
6527
- var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e, t) {
6519
+ var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e, t) {
6528
6520
  var n;
6529
- return _regeneratorRuntime().wrap(function _callee64$(_context64) {
6530
- while (1) switch (_context64.prev = _context64.next) {
6521
+ return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6522
+ while (1) switch (_context63.prev = _context63.next) {
6531
6523
  case 0:
6532
6524
  if (this.requestSettings) {
6533
- _context64.next = 2;
6525
+ _context63.next = 2;
6534
6526
  break;
6535
6527
  }
6536
6528
  throw new Error("Request settings have not been set up");
@@ -6539,11 +6531,11 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6539
6531
  HTTPRequest.request(this, n, e);
6540
6532
  case 4:
6541
6533
  case "end":
6542
- return _context64.stop();
6534
+ return _context63.stop();
6543
6535
  }
6544
- }, _callee64, this);
6536
+ }, _callee63, this);
6545
6537
  }));
6546
- function callServiceAPI(_x112, _x113) {
6538
+ function callServiceAPI(_x109, _x110) {
6547
6539
  return _callServiceAPI19.apply(this, arguments);
6548
6540
  }
6549
6541
  return callServiceAPI;
@@ -6551,26 +6543,26 @@ var CohereChatIO = /*#__PURE__*/function (_CohereIO3) {
6551
6543
  }, {
6552
6544
  key: "extractResultData",
6553
6545
  value: function () {
6554
- var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e) {
6555
- return _regeneratorRuntime().wrap(function _callee65$(_context65) {
6556
- while (1) switch (_context65.prev = _context65.next) {
6546
+ var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e) {
6547
+ return _regeneratorRuntime().wrap(function _callee64$(_context64) {
6548
+ while (1) switch (_context64.prev = _context64.next) {
6557
6549
  case 0:
6558
6550
  if (!e.message) {
6559
- _context65.next = 2;
6551
+ _context64.next = 2;
6560
6552
  break;
6561
6553
  }
6562
6554
  throw e.message;
6563
6555
  case 2:
6564
- return _context65.abrupt("return", {
6556
+ return _context64.abrupt("return", {
6565
6557
  text: e.text
6566
6558
  });
6567
6559
  case 3:
6568
6560
  case "end":
6569
- return _context65.stop();
6561
+ return _context64.stop();
6570
6562
  }
6571
- }, _callee65);
6563
+ }, _callee64);
6572
6564
  }));
6573
- function extractResultData(_x114) {
6565
+ function extractResultData(_x111) {
6574
6566
  return _extractResultData23.apply(this, arguments);
6575
6567
  }
6576
6568
  return extractResultData;
@@ -6737,11 +6729,11 @@ var _TextToSpeech = /*#__PURE__*/function () {
6737
6729
  var n = {};
6738
6730
  setTimeout(function () {
6739
6731
  if (_typeof(e) == "object" && (e.lang && (n.lang = e.lang), e.pitch && (n.pitch = e.pitch), e.rate && (n.rate = e.rate), e.volume && (n.volume = e.volume), e.voiceName)) {
6740
- var _s6 = window.speechSynthesis.getVoices().find(function (o) {
6732
+ var s = window.speechSynthesis.getVoices().find(function (o) {
6741
6733
  var a;
6742
6734
  return o.name.toLocaleLowerCase() === ((a = e.voiceName) == null ? void 0 : a.toLocaleLowerCase());
6743
6735
  });
6744
- _s6 && (n.voice = _s6);
6736
+ s && (n.voice = s);
6745
6737
  }
6746
6738
  t(n);
6747
6739
  }, $.LOAD_VOICES_MS);
@@ -6783,9 +6775,9 @@ var MessageStyleUtils = /*#__PURE__*/function () {
6783
6775
  key: "applyCustomStylesToElements",
6784
6776
  value: function applyCustomStylesToElements(e, t, n) {
6785
6777
  if (n && (Object.assign(e.outerContainer.style, n.outerContainer), Object.assign(e.innerContainer.style, n.innerContainer), Object.assign(e.bubbleElement.style, n.bubble), t)) {
6786
- var _s7 = e.bubbleElement.children[0],
6787
- _o3 = _s7.tagName.toLocaleLowerCase() !== "a" ? _s7 : _s7.children[0];
6788
- Object.assign(_o3.style, n.media);
6778
+ var s = e.bubbleElement.children[0],
6779
+ o = s.tagName.toLocaleLowerCase() !== "a" ? s : s.children[0];
6780
+ Object.assign(o.style, n.media);
6789
6781
  }
6790
6782
  }
6791
6783
  }, {
@@ -6928,24 +6920,24 @@ var FileMessages = /*#__PURE__*/function () {
6928
6920
  }, {
6929
6921
  key: "addNewImageMessage",
6930
6922
  value: function () {
6931
- var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e, t, n) {
6923
+ var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e, t, n) {
6932
6924
  var s,
6933
6925
  o,
6934
6926
  a,
6935
- _args66 = arguments;
6936
- return _regeneratorRuntime().wrap(function _callee66$(_context66) {
6937
- while (1) switch (_context66.prev = _context66.next) {
6927
+ _args65 = arguments;
6928
+ return _regeneratorRuntime().wrap(function _callee65$(_context65) {
6929
+ while (1) switch (_context65.prev = _context65.next) {
6938
6930
  case 0:
6939
- s = _args66.length > 3 && _args66[3] !== undefined ? _args66[3] : !1;
6931
+ s = _args65.length > 3 && _args65[3] !== undefined ? _args65[3] : !1;
6940
6932
  o = FileMessages.createImage(t, e.elementRef), a = e.createNewMessageElement("", n);
6941
6933
  a.bubbleElement.appendChild(o), a.bubbleElement.classList.add("image-message"), e.elementRef.appendChild(a.outerContainer), FileMessageUtils.updateMessages(e, a, t, "image", n, s);
6942
6934
  case 3:
6943
6935
  case "end":
6944
- return _context66.stop();
6936
+ return _context65.stop();
6945
6937
  }
6946
- }, _callee66);
6938
+ }, _callee65);
6947
6939
  }));
6948
- function addNewImageMessage(_x115, _x116, _x117) {
6940
+ function addNewImageMessage(_x112, _x113, _x114) {
6949
6941
  return _addNewImageMessage.apply(this, arguments);
6950
6942
  }
6951
6943
  return addNewImageMessage;
@@ -7177,7 +7169,7 @@ var Messages = /*#__PURE__*/function () {
7177
7169
  value: function sendClientUpdate(e) {
7178
7170
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
7179
7171
  var n;
7180
- (n = this._onNewMessage) == null || n.call(this, e, t);
7172
+ (n = this._onNewMessage) == null || n.call(this, JSON.parse(JSON.stringify(e)), t);
7181
7173
  }
7182
7174
  // prettier-ignore
7183
7175
  }, {
@@ -7281,27 +7273,27 @@ var Messages = /*#__PURE__*/function () {
7281
7273
  }, {
7282
7274
  key: "addMultipleFiles",
7283
7275
  value: function () {
7284
- var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(e) {
7276
+ var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
7285
7277
  var _this31 = this;
7286
- return _regeneratorRuntime().wrap(function _callee67$(_context67) {
7287
- while (1) switch (_context67.prev = _context67.next) {
7278
+ return _regeneratorRuntime().wrap(function _callee66$(_context66) {
7279
+ while (1) switch (_context66.prev = _context66.next) {
7288
7280
  case 0:
7289
- return _context67.abrupt("return", Promise.all((e || []).map(function (t) {
7281
+ return _context66.abrupt("return", Promise.all((e || []).map(function (t) {
7290
7282
  return new Promise(function (n) {
7291
7283
  if (!t.type || t.type === "any") {
7292
- var _s8 = t.file.name || FileMessageUtils.DEFAULT_FILE_NAME;
7284
+ var s = t.file.name || FileMessageUtils.DEFAULT_FILE_NAME;
7293
7285
  _this31.addNewMessage({
7294
7286
  files: [{
7295
- name: _s8,
7287
+ name: s,
7296
7288
  type: "any"
7297
7289
  }]
7298
7290
  }, !1, !0), n(!0);
7299
7291
  } else {
7300
- var _s9 = new FileReader();
7301
- _s9.readAsDataURL(t.file), _s9.onload = function () {
7292
+ var _s = new FileReader();
7293
+ _s.readAsDataURL(t.file), _s.onload = function () {
7302
7294
  _this31.addNewMessage({
7303
7295
  files: [{
7304
- src: _s9.result,
7296
+ src: _s.result,
7305
7297
  type: t.type
7306
7298
  }]
7307
7299
  }, !1, !0), n(!0);
@@ -7311,11 +7303,11 @@ var Messages = /*#__PURE__*/function () {
7311
7303
  })));
7312
7304
  case 1:
7313
7305
  case "end":
7314
- return _context67.stop();
7306
+ return _context66.stop();
7315
7307
  }
7316
- }, _callee67);
7308
+ }, _callee66);
7317
7309
  }));
7318
- function addMultipleFiles(_x118) {
7310
+ function addMultipleFiles(_x115) {
7319
7311
  return _addMultipleFiles.apply(this, arguments);
7320
7312
  }
7321
7313
  return addMultipleFiles;
@@ -7586,8 +7578,8 @@ var InputButton = /*#__PURE__*/function () {
7586
7578
  value: function unsetCustomStateStyles(e) {
7587
7579
  if (this._customStyles) for (var t = 0; t < e.length; t += 1) {
7588
7580
  var n = e[t],
7589
- _s10 = n && this._customStyles[n];
7590
- _s10 && ButtonCSS.unsetActionCSS(this.elementRef, _s10);
7581
+ s = n && this._customStyles[n];
7582
+ s && ButtonCSS.unsetActionCSS(this.elementRef, s);
7591
7583
  }
7592
7584
  }
7593
7585
  }, {
@@ -7951,14 +7943,14 @@ var FileAttachmentsType = /*#__PURE__*/function () {
7951
7943
  key: "addAttachmentBasedOnType",
7952
7944
  value: function addAttachmentBasedOnType(e, t, n) {
7953
7945
  if (e.type.startsWith("image")) {
7954
- var _s11 = FileAttachmentsType.createImageAttachment(t);
7955
- this.addFileAttachment(e, "image", _s11, n);
7946
+ var s = FileAttachmentsType.createImageAttachment(t);
7947
+ this.addFileAttachment(e, "image", s, n);
7956
7948
  } else if (e.type.startsWith("audio")) {
7957
- var _s12 = AudioFileAttachmentType.createAudioAttachment(t);
7958
- this.addFileAttachment(e, "audio", _s12, n);
7949
+ var _s2 = AudioFileAttachmentType.createAudioAttachment(t);
7950
+ this.addFileAttachment(e, "audio", _s2, n);
7959
7951
  } else {
7960
- var _s13 = FileAttachmentsType.createAnyFileAttachment(e.name);
7961
- this.addFileAttachment(e, "any", _s13, n);
7952
+ var _s3 = FileAttachmentsType.createAnyFileAttachment(e.name);
7953
+ this.addFileAttachment(e, "any", _s3, n);
7962
7954
  }
7963
7955
  }
7964
7956
  }, {
@@ -8020,15 +8012,15 @@ var FileAttachmentsType = /*#__PURE__*/function () {
8020
8012
  value: function isFileTypeValid(e, t) {
8021
8013
  if (t === "") return !0;
8022
8014
  var n = t.split(",");
8023
- for (var _s14 = 0; _s14 < n.length; _s14++) {
8024
- var _o4 = n[_s14].trim();
8025
- if (e.type === _o4) return !0;
8026
- if (_o4.startsWith(".")) {
8027
- var _a3 = _o4.slice(1);
8028
- if (e.name.endsWith(_a3)) return !0;
8015
+ for (var s = 0; s < n.length; s++) {
8016
+ var o = n[s].trim();
8017
+ if (e.type === o) return !0;
8018
+ if (o.startsWith(".")) {
8019
+ var a = o.slice(1);
8020
+ if (e.name.endsWith(a)) return !0;
8029
8021
  } else {
8030
- if (e.name.endsWith(_o4)) return !0;
8031
- if (_o4.endsWith("/*") && e.type.startsWith(_o4.slice(0, -2))) return !0;
8022
+ if (e.name.endsWith(o)) return !0;
8023
+ if (o.endsWith("/*") && e.type.startsWith(o.slice(0, -2))) return !0;
8032
8024
  }
8033
8025
  }
8034
8026
  return !1;
@@ -8225,33 +8217,33 @@ var FileAttachments = /*#__PURE__*/function () {
8225
8217
  }, {
8226
8218
  key: "completePlaceholders",
8227
8219
  value: function () {
8228
- var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69() {
8229
- return _regeneratorRuntime().wrap(function _callee69$(_context69) {
8230
- while (1) switch (_context69.prev = _context69.next) {
8220
+ var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68() {
8221
+ return _regeneratorRuntime().wrap(function _callee68$(_context68) {
8222
+ while (1) switch (_context68.prev = _context68.next) {
8231
8223
  case 0:
8232
- _context69.next = 2;
8224
+ _context68.next = 2;
8233
8225
  return Promise.all(this._fileAttachmentsTypes.map( /*#__PURE__*/function () {
8234
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(e) {
8226
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(e) {
8235
8227
  var t;
8236
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
8237
- while (1) switch (_context68.prev = _context68.next) {
8228
+ return _regeneratorRuntime().wrap(function _callee67$(_context67) {
8229
+ while (1) switch (_context67.prev = _context67.next) {
8238
8230
  case 0:
8239
- return _context68.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
8231
+ return _context67.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
8240
8232
  case 1:
8241
8233
  case "end":
8242
- return _context68.stop();
8234
+ return _context67.stop();
8243
8235
  }
8244
- }, _callee68);
8236
+ }, _callee67);
8245
8237
  }));
8246
- return function (_x119) {
8238
+ return function (_x116) {
8247
8239
  return _ref7.apply(this, arguments);
8248
8240
  };
8249
8241
  }()));
8250
8242
  case 2:
8251
8243
  case "end":
8252
- return _context69.stop();
8244
+ return _context68.stop();
8253
8245
  }
8254
- }, _callee69, this);
8246
+ }, _callee68, this);
8255
8247
  }));
8256
8248
  function completePlaceholders() {
8257
8249
  return _completePlaceholders.apply(this, arguments);
@@ -8281,7 +8273,7 @@ var FileAttachments = /*#__PURE__*/function () {
8281
8273
  e.forEach(function (n) {
8282
8274
  var s = new FileReader();
8283
8275
  s.readAsDataURL(n), s.onload = function (o) {
8284
- for (var _a4 = 0; _a4 < t.length && !t[_a4].attemptAddFile(n, o.target.result); _a4 += 1);
8276
+ for (var a = 0; a < t.length && !t[a].attemptAddFile(n, o.target.result); a += 1);
8285
8277
  };
8286
8278
  });
8287
8279
  }
@@ -8391,8 +8383,8 @@ var _Modal = /*#__PURE__*/function () {
8391
8383
  value: function createTextModalFunc(e, t, n) {
8392
8384
  var s;
8393
8385
  if (_typeof(t) == "object" && (s = t.files) != null && s.infoModal) {
8394
- var _o5 = new T(e, ["modal-content"], t.files.infoModal.containerStyle);
8395
- return _o5.addCloseButton("OK", !1, n), _o5.openTextModal.bind(_o5, t.infoModalTextMarkUp || "");
8386
+ var o = new T(e, ["modal-content"], t.files.infoModal.containerStyle);
8387
+ return o.addCloseButton("OK", !1, n), o.openTextModal.bind(o, t.infoModalTextMarkUp || "");
8396
8388
  }
8397
8389
  }
8398
8390
  }]);
@@ -8657,7 +8649,7 @@ var Translate = /*#__PURE__*/function () {
8657
8649
  key: "translate",
8658
8650
  value: function translate(e, t) {
8659
8651
  var n = text_1$3.Text.breakupIntoWordsArr(e);
8660
- for (var _s15 = 0; _s15 < n.length; _s15 += 1) t[n[_s15]] && (n[_s15] = t[n[_s15]]);
8652
+ for (var s = 0; s < n.length; s += 1) t[n[s]] && (n[s] = t[n[s]]);
8661
8653
  return n.join("");
8662
8654
  }
8663
8655
  }]);
@@ -8677,9 +8669,9 @@ var WebSpeechTranscript = /*#__PURE__*/function () {
8677
8669
  key: "extract",
8678
8670
  value: function extract(e, t, n) {
8679
8671
  var s = "";
8680
- for (var _o6 = e.resultIndex; _o6 < e.results.length; ++_o6) {
8681
- var _a5 = e.results[_o6][0].transcript;
8682
- n && (_a5 = translate_1$1.Translate.translate(_a5, n)), e.results[_o6].isFinal ? t += _a5 : s += _a5;
8672
+ for (var o = e.resultIndex; o < e.results.length; ++o) {
8673
+ var a = e.results[o][0].transcript;
8674
+ n && (a = translate_1$1.Translate.translate(a, n)), e.results[o].isFinal ? t += a : s += a;
8683
8675
  }
8684
8676
  return {
8685
8677
  interimTranscript: s,
@@ -8692,8 +8684,8 @@ var WebSpeechTranscript = /*#__PURE__*/function () {
8692
8684
  value: function extractSafari(e, t, n) {
8693
8685
  var s = "";
8694
8686
  var o = "";
8695
- for (var _a6 = e.resultIndex; _a6 < e.results.length; ++_a6) {
8696
- var l = e.results[_a6][0].transcript;
8687
+ for (var a = e.resultIndex; a < e.results.length; ++a) {
8688
+ var l = e.results[a][0].transcript;
8697
8689
  n && (l = translate_1$1.Translate.translate(l, n)), s += l;
8698
8690
  }
8699
8691
  return {
@@ -8865,8 +8857,8 @@ var Elements = /*#__PURE__*/function () {
8865
8857
  if (e.spansPopulated = !0, e.insertInCursorLocation && document.activeElement === t) {
8866
8858
  var n = window.getSelection();
8867
8859
  if (n != null && n.focusNode) {
8868
- var _s16 = n.getRangeAt(0);
8869
- _s16.insertNode(e.scrollingSpan), _s16.insertNode(e.interimSpan), _s16.insertNode(e.finalSpan), _s16.collapse(!1), n.removeAllRanges(), n.addRange(_s16);
8860
+ var s = n.getRangeAt(0);
8861
+ s.insertNode(e.scrollingSpan), s.insertNode(e.interimSpan), s.insertNode(e.finalSpan), s.collapse(!1), n.removeAllRanges(), n.addRange(s);
8870
8862
  return;
8871
8863
  }
8872
8864
  }
@@ -8900,20 +8892,20 @@ var Cursor = /*#__PURE__*/function () {
8900
8892
  value: function setOffsetForGeneric(e, t) {
8901
8893
  var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
8902
8894
  var s = 0;
8903
- for (var _o7 = 0; _o7 < e.childNodes.length; _o7 += 1) {
8904
- var _a7 = e.childNodes[_o7];
8905
- if (_a7.childNodes.length > 0) {
8906
- var l = Cursor.setOffsetForGeneric(_a7, t, n);
8895
+ for (var o = 0; o < e.childNodes.length; o += 1) {
8896
+ var a = e.childNodes[o];
8897
+ if (a.childNodes.length > 0) {
8898
+ var l = Cursor.setOffsetForGeneric(a, t, n);
8907
8899
  if (l === -1) return -1;
8908
8900
  n += l;
8909
- } else if (_a7.textContent !== null) {
8910
- if (n + _a7.textContent.length > t) {
8901
+ } else if (a.textContent !== null) {
8902
+ if (n + a.textContent.length > t) {
8911
8903
  var _l = document.createRange();
8912
- _l.setStart(_a7, t - n), _l.collapse(!0);
8904
+ _l.setStart(a, t - n), _l.collapse(!0);
8913
8905
  var c = window.getSelection();
8914
8906
  return c == null || c.removeAllRanges(), c == null || c.addRange(_l), e.focus(), -1;
8915
8907
  }
8916
- n += _a7.textContent.length, s += _a7.textContent.length;
8908
+ n += a.textContent.length, s += a.textContent.length;
8917
8909
  }
8918
8910
  }
8919
8911
  return s;
@@ -8931,8 +8923,8 @@ var Cursor = /*#__PURE__*/function () {
8931
8923
  value: function setOffsetForSafariGeneric(e, t) {
8932
8924
  var n = window.getSelection();
8933
8925
  if (n) {
8934
- var _s17 = Cursor.getGenericElementCursorOffset(e, n, !0);
8935
- console.log(_s17), setTimeout(function () {}, 100), Cursor.setOffsetForGeneric(e, _s17 + t);
8926
+ var s = Cursor.getGenericElementCursorOffset(e, n, !0);
8927
+ console.log(s), setTimeout(function () {}, 100), Cursor.setOffsetForGeneric(e, s + t);
8936
8928
  }
8937
8929
  }
8938
8930
  // set to automatically scroll to cursor (scroll does not work in Safari)
@@ -8963,9 +8955,9 @@ var Cursor = /*#__PURE__*/function () {
8963
8955
  value: function getGenericElementCursorOffset(e, t, n) {
8964
8956
  var s = 0;
8965
8957
  if (t.rangeCount > 0) {
8966
- var _o8 = t.getRangeAt(0),
8967
- _a8 = _o8.cloneRange();
8968
- _a8.selectNodeContents(e), n ? _a8.setEnd(_o8.startContainer, _o8.startOffset) : _a8.setEnd(_o8.endContainer, _o8.endOffset), s = _a8.toString().length;
8958
+ var o = t.getRangeAt(0),
8959
+ a = o.cloneRange();
8960
+ a.selectNodeContents(e), n ? a.setEnd(o.startContainer, o.startOffset) : a.setEnd(o.endContainer, o.endOffset), s = a.toString().length;
8969
8961
  }
8970
8962
  return s;
8971
8963
  }
@@ -9028,10 +9020,10 @@ var CommandUtils = /*#__PURE__*/function () {
9028
9020
  key: "checkIfMatchesWord",
9029
9021
  value: function checkIfMatchesWord(e, t, n) {
9030
9022
  var s = e;
9031
- for (var _o9 = n.length - 1; _o9 >= 0; _o9 -= 1) {
9032
- var _a9 = _o9,
9023
+ for (var o = n.length - 1; o >= 0; o -= 1) {
9024
+ var a = o,
9033
9025
  l = s.length - 1;
9034
- for (; n[_a9] === s[l] && l >= 0;) _a9 -= 1, l -= 1;
9026
+ for (; n[a] === s[l] && l >= 0;) a -= 1, l -= 1;
9035
9027
  if (l < 0) return !0;
9036
9028
  }
9037
9029
  return !1;
@@ -9100,9 +9092,9 @@ var Highlight = /*#__PURE__*/function () {
9100
9092
  value: function setStateForGeneric(e, t) {
9101
9093
  var n = window.getSelection();
9102
9094
  if (n != null && n.focusNode) {
9103
- var _s18 = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0),
9104
- _o10 = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !1);
9105
- e.isHighlighted = _s18 !== _o10;
9095
+ var s = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0),
9096
+ o = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !1);
9097
+ e.isHighlighted = s !== o;
9106
9098
  }
9107
9099
  }
9108
9100
  }, {
@@ -9115,8 +9107,8 @@ var Highlight = /*#__PURE__*/function () {
9115
9107
  value: function removeForGeneric(e, t) {
9116
9108
  var n = window.getSelection();
9117
9109
  if (n) {
9118
- var _s19 = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0);
9119
- n.deleteFromDocument(), cursor_1$2.Cursor.setOffsetForGeneric(t, _s19), e.isHighlighted = !1;
9110
+ var s = cursor_1$2.Cursor.getGenericElementCursorOffset(t, n, !0);
9111
+ n.deleteFromDocument(), cursor_1$2.Cursor.setOffsetForGeneric(t, s), e.isHighlighted = !1;
9120
9112
  }
9121
9113
  }
9122
9114
  }, {
@@ -9126,8 +9118,8 @@ var Highlight = /*#__PURE__*/function () {
9126
9118
  s = t.selectionEnd,
9127
9119
  o = t.value;
9128
9120
  if (n && s) {
9129
- var _a10 = o.substring(0, n) + o.substring(s);
9130
- t.value = _a10, cursor_1$2.Cursor.setOffsetForPrimitive(t, n, e.autoScroll);
9121
+ var a = o.substring(0, n) + o.substring(s);
9122
+ t.value = a, cursor_1$2.Cursor.setOffsetForPrimitive(t, n, e.autoScroll);
9131
9123
  }
9132
9124
  e.isHighlighted = !1;
9133
9125
  }
@@ -9151,11 +9143,11 @@ var Padding = /*#__PURE__*/function () {
9151
9143
  key: "setStateForPrimitiveElement",
9152
9144
  value: function setStateForPrimitiveElement(e, t) {
9153
9145
  if (document.activeElement === t && t.selectionStart !== null) {
9154
- var _s20 = t.selectionStart,
9155
- _o11 = t.value[_s20 - 1],
9156
- _a11 = t.selectionEnd === null ? _s20 : t.selectionEnd,
9157
- l = t.value[_a11];
9158
- text_1$1.Text.isCharDefined(_o11) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), text_1$1.Text.isCharDefined(l) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === _a11;
9146
+ var s = t.selectionStart,
9147
+ o = t.value[s - 1],
9148
+ a = t.selectionEnd === null ? s : t.selectionEnd,
9149
+ l = t.value[a];
9150
+ text_1$1.Text.isCharDefined(o) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), text_1$1.Text.isCharDefined(l) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === a;
9159
9151
  return;
9160
9152
  }
9161
9153
  var n = t.value[t.value.length - 1];
@@ -9226,11 +9218,11 @@ var Speech = /*#__PURE__*/function () {
9226
9218
  value: function prepareBeforeStart(e) {
9227
9219
  var t, n;
9228
9220
  if (e != null && e.element) if (eventListeners_1.EventListeners.add(this, e), Array.isArray(e.element)) {
9229
- var _o12 = e.element.find(function (a) {
9221
+ var o = e.element.find(function (a) {
9230
9222
  return a === document.activeElement;
9231
9223
  }) || e.element[0];
9232
- if (!_o12) return;
9233
- this.prepare(_o12);
9224
+ if (!o) return;
9225
+ this.prepare(o);
9234
9226
  } else this.prepare(e.element);
9235
9227
  (e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"], elements_1.Elements.applyCustomColors(this, e.textColor)), (e == null ? void 0 : e.insertInCursorLocation) !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), (e == null ? void 0 : e.autoScroll) !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e == null ? void 0 : e.onResult, this._onPreResult = e == null ? void 0 : e.onPreResult, this._onStart = e == null ? void 0 : e.onStart, this._onStop = e == null ? void 0 : e.onStop, this._onError = e == null ? void 0 : e.onError, this.onCommandModeTrigger = e == null ? void 0 : e.onCommandModeTrigger, this.onPauseTrigger = e == null ? void 0 : e.onPauseTrigger, this._options = e, !((n = this._options) === null || n === void 0) && n.commands && (this.commands = commandUtils_1$1.CommandUtils.process(this._options.commands));
9236
9228
  }
@@ -9273,8 +9265,8 @@ var Speech = /*#__PURE__*/function () {
9273
9265
  this.isHighlighted && highlight_1.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || padding_1.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), n && padding_1.Padding.adjustSateForNoTextPrimitiveElement(this);
9274
9266
  var s = this.startPadding + this.finalTranscript + t;
9275
9267
  if (e.value = s + this.endPadding, !this.isTargetInShadow) {
9276
- var _o13 = s.length + this.numberOfSpacesAfterNewText;
9277
- cursor_1.Cursor.setOffsetForPrimitive(e, _o13, this.autoScroll);
9268
+ var o = s.length + this.numberOfSpacesAfterNewText;
9269
+ cursor_1.Cursor.setOffsetForPrimitive(e, o, this.autoScroll);
9278
9270
  }
9279
9271
  this.autoScroll && browser_1$1.Browser.IS_SAFARI() && this.isCursorAtEnd && autoScroll_1.AutoScroll.scrollSafariPrimitiveToEnd(e);
9280
9272
  }
@@ -9375,8 +9367,8 @@ var WebSpeech = /*#__PURE__*/function (_speech_1$1$Speech) {
9375
9367
  var _this46$_extractText = _this46._extractText(e, _this46.finalTranscript, _this46._translations),
9376
9368
  t = _this46$_extractText.interimTranscript,
9377
9369
  n = _this46$_extractText.finalTranscript,
9378
- _s21 = _this46$_extractText.newText;
9379
- _this46.updateElements(t, n, _s21);
9370
+ s = _this46$_extractText.newText;
9371
+ _this46.updateElements(t, n, s);
9380
9372
  }
9381
9373
  });
9382
9374
  }
@@ -9471,26 +9463,26 @@ var AzureSpeechConfig = /*#__PURE__*/function () {
9471
9463
  }, {
9472
9464
  key: "getNewSpeechConfig",
9473
9465
  value: function () {
9474
- var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e, t) {
9475
- return _regeneratorRuntime().wrap(function _callee70$(_context70) {
9476
- while (1) switch (_context70.prev = _context70.next) {
9466
+ var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(e, t) {
9467
+ return _regeneratorRuntime().wrap(function _callee69$(_context69) {
9468
+ while (1) switch (_context69.prev = _context69.next) {
9477
9469
  case 0:
9478
9470
  if (!t.region) {
9479
- _context70.next = 2;
9471
+ _context69.next = 2;
9480
9472
  break;
9481
9473
  }
9482
- return _context70.abrupt("return", t.subscriptionKey ? e.fromSubscription(t.subscriptionKey.trim(), t.region.trim()) : t.token ? e.fromAuthorizationToken(t.token.trim(), t.region.trim()) : t.retrieveToken ? t.retrieveToken().then(function (n) {
9474
+ return _context69.abrupt("return", t.subscriptionKey ? e.fromSubscription(t.subscriptionKey.trim(), t.region.trim()) : t.token ? e.fromAuthorizationToken(t.token.trim(), t.region.trim()) : t.retrieveToken ? t.retrieveToken().then(function (n) {
9483
9475
  return t.region ? e.fromAuthorizationToken((n == null ? void 0 : n.trim()) || "", t.region.trim()) : null;
9484
9476
  })["catch"](function (n) {
9485
9477
  return console.error(n), null;
9486
9478
  }) : null);
9487
9479
  case 2:
9488
9480
  case "end":
9489
- return _context70.stop();
9481
+ return _context69.stop();
9490
9482
  }
9491
- }, _callee70);
9483
+ }, _callee69);
9492
9484
  }));
9493
- function getNewSpeechConfig(_x120, _x121) {
9485
+ function getNewSpeechConfig(_x117, _x118) {
9494
9486
  return _getNewSpeechConfig.apply(this, arguments);
9495
9487
  }
9496
9488
  return getNewSpeechConfig;
@@ -9503,23 +9495,23 @@ var AzureSpeechConfig = /*#__PURE__*/function () {
9503
9495
  }, {
9504
9496
  key: "get",
9505
9497
  value: function () {
9506
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e, t) {
9498
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e, t) {
9507
9499
  var n;
9508
- return _regeneratorRuntime().wrap(function _callee71$(_context71) {
9509
- while (1) switch (_context71.prev = _context71.next) {
9500
+ return _regeneratorRuntime().wrap(function _callee70$(_context70) {
9501
+ while (1) switch (_context70.prev = _context70.next) {
9510
9502
  case 0:
9511
- _context71.next = 2;
9503
+ _context70.next = 2;
9512
9504
  return AzureSpeechConfig.getNewSpeechConfig(e, t);
9513
9505
  case 2:
9514
- n = _context71.sent;
9515
- return _context71.abrupt("return", (n && AzureSpeechConfig.process(n, t), n));
9506
+ n = _context70.sent;
9507
+ return _context70.abrupt("return", (n && AzureSpeechConfig.process(n, t), n));
9516
9508
  case 4:
9517
9509
  case "end":
9518
- return _context71.stop();
9510
+ return _context70.stop();
9519
9511
  }
9520
- }, _callee71);
9512
+ }, _callee70);
9521
9513
  }));
9522
- function get(_x122, _x123) {
9514
+ function get(_x119, _x120) {
9523
9515
  return _get.apply(this, arguments);
9524
9516
  }
9525
9517
  return get;
@@ -9609,28 +9601,28 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
9609
9601
  }, {
9610
9602
  key: "startAsync",
9611
9603
  value: function () {
9612
- var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e) {
9604
+ var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e) {
9613
9605
  var t;
9614
- return _regeneratorRuntime().wrap(function _callee72$(_context72) {
9615
- while (1) switch (_context72.prev = _context72.next) {
9606
+ return _regeneratorRuntime().wrap(function _callee71$(_context71) {
9607
+ while (1) switch (_context71.prev = _context71.next) {
9616
9608
  case 0:
9617
- _context72.t0 = this.validate(e);
9618
- if (!_context72.t0) {
9619
- _context72.next = 6;
9609
+ _context71.t0 = this.validate(e);
9610
+ if (!_context71.t0) {
9611
+ _context71.next = 6;
9620
9612
  break;
9621
9613
  }
9622
- _context72.next = 4;
9614
+ _context71.next = 4;
9623
9615
  return this.instantiateService(e);
9624
9616
  case 4:
9625
9617
  this._translations = e == null ? void 0 : e.translations;
9626
9618
  (t = this._service) === null || t === void 0 || t.startContinuousRecognitionAsync(function () {}, this.error);
9627
9619
  case 6:
9628
9620
  case "end":
9629
- return _context72.stop();
9621
+ return _context71.stop();
9630
9622
  }
9631
- }, _callee72, this);
9623
+ }, _callee71, this);
9632
9624
  }));
9633
- function startAsync(_x124) {
9625
+ function startAsync(_x121) {
9634
9626
  return _startAsync.apply(this, arguments);
9635
9627
  }
9636
9628
  return startAsync;
@@ -9643,28 +9635,28 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
9643
9635
  }, {
9644
9636
  key: "instantiateService",
9645
9637
  value: function () {
9646
- var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e) {
9647
- var t, n, s, _o14;
9648
- return _regeneratorRuntime().wrap(function _callee73$(_context73) {
9649
- while (1) switch (_context73.prev = _context73.next) {
9638
+ var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e) {
9639
+ var t, n, s, o;
9640
+ return _regeneratorRuntime().wrap(function _callee72$(_context72) {
9641
+ while (1) switch (_context72.prev = _context72.next) {
9650
9642
  case 0:
9651
9643
  t = Azure.getAPI();
9652
9644
  n = t.AudioConfig.fromDefaultMicrophoneInput();
9653
- _context73.next = 4;
9645
+ _context72.next = 4;
9654
9646
  return azureSpeechConfig_1.AzureSpeechConfig.get(t.SpeechConfig, e);
9655
9647
  case 4:
9656
- s = _context73.sent;
9648
+ s = _context72.sent;
9657
9649
  if (s) {
9658
- _o14 = new t.SpeechRecognizer(s, n);
9659
- this.setEvents(_o14), this._service = _o14, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
9650
+ o = new t.SpeechRecognizer(s, n);
9651
+ this.setEvents(o), this._service = o, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
9660
9652
  } else this.error("Unable to contact Azure server");
9661
9653
  case 6:
9662
9654
  case "end":
9663
- return _context73.stop();
9655
+ return _context72.stop();
9664
9656
  }
9665
- }, _callee73, this);
9657
+ }, _callee72, this);
9666
9658
  }));
9667
- function instantiateService(_x125) {
9659
+ function instantiateService(_x122) {
9668
9660
  return _instantiateService.apply(this, arguments);
9669
9661
  }
9670
9662
  return instantiateService;
@@ -9701,10 +9693,10 @@ var Azure = /*#__PURE__*/function (_speech_1$Speech) {
9701
9693
  case window.SpeechSDK.ResultReason.RecognizedSpeech:
9702
9694
  if (n.text && !this._stopping) {
9703
9695
  var _azureTranscript_1$Az2 = azureTranscript_1.AzureTranscript.extract(this._newTextPadding + n.text, this.finalTranscript, !0, this._translations),
9704
- _s22 = _azureTranscript_1$Az2.interimTranscript,
9705
- _o15 = _azureTranscript_1$Az2.finalTranscript,
9706
- _a12 = _azureTranscript_1$Az2.newText;
9707
- stopTimeout_1.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(_s22, _o15, _a12), _o15 !== "" && (this._newTextPadding = " ");
9696
+ s = _azureTranscript_1$Az2.interimTranscript,
9697
+ o = _azureTranscript_1$Az2.finalTranscript,
9698
+ a = _azureTranscript_1$Az2.newText;
9699
+ stopTimeout_1.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(s, o, a), o !== "" && (this._newTextPadding = " ");
9708
9700
  }
9709
9701
  break;
9710
9702
  }
@@ -10046,17 +10038,17 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10046
10038
  }, {
10047
10039
  key: "submit",
10048
10040
  value: function () {
10049
- var _submit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(e, t) {
10041
+ var _submit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e, t) {
10050
10042
  var l, c, n, s, o, a;
10051
- return _regeneratorRuntime().wrap(function _callee74$(_context74) {
10052
- while (1) switch (_context74.prev = _context74.next) {
10043
+ return _regeneratorRuntime().wrap(function _callee73$(_context73) {
10044
+ while (1) switch (_context73.prev = _context73.next) {
10053
10045
  case 0:
10054
- _context74.t0 = e;
10055
- if (_context74.t0) {
10056
- _context74.next = 6;
10046
+ _context73.t0 = e;
10047
+ if (_context73.t0) {
10048
+ _context73.next = 6;
10057
10049
  break;
10058
10050
  }
10059
- _context74.next = 4;
10051
+ _context73.next = 4;
10060
10052
  return this._fileAttachments.completePlaceholders();
10061
10053
  case 4:
10062
10054
  n = this._fileAttachments.getAllFileData();
@@ -10066,40 +10058,40 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10066
10058
  case 6:
10067
10059
  o = t === "" ? void 0 : t;
10068
10060
  if (!(this._isRequestInProgress || !Websocket.canSendMessage(this._serviceIO.websocket))) {
10069
- _context74.next = 9;
10061
+ _context73.next = 9;
10070
10062
  break;
10071
10063
  }
10072
- return _context74.abrupt("return");
10064
+ return _context73.abrupt("return");
10073
10065
  case 9:
10074
10066
  if (!((l = this._serviceIO.deepChat) != null && l.validateMessageBeforeSending)) {
10075
- _context74.next = 14;
10067
+ _context73.next = 14;
10076
10068
  break;
10077
10069
  }
10078
10070
  if (this._serviceIO.deepChat.validateMessageBeforeSending(o, s)) {
10079
- _context74.next = 12;
10071
+ _context73.next = 12;
10080
10072
  break;
10081
10073
  }
10082
- return _context74.abrupt("return");
10074
+ return _context73.abrupt("return");
10083
10075
  case 12:
10084
- _context74.next = 16;
10076
+ _context73.next = 16;
10085
10077
  break;
10086
10078
  case 14:
10087
10079
  if (this._serviceIO.canSendMessage(o, s)) {
10088
- _context74.next = 16;
10080
+ _context73.next = 16;
10089
10081
  break;
10090
10082
  }
10091
- return _context74.abrupt("return");
10083
+ return _context73.abrupt("return");
10092
10084
  case 16:
10093
10085
  this.changeToLoadingIcon();
10094
10086
  t !== "" && this._messages.addNewMessage({
10095
10087
  text: t
10096
10088
  }, !1, !0);
10097
- _context74.t1 = n;
10098
- if (!_context74.t1) {
10099
- _context74.next = 22;
10089
+ _context73.t1 = n;
10090
+ if (!_context73.t1) {
10091
+ _context73.next = 22;
10100
10092
  break;
10101
10093
  }
10102
- _context74.next = 22;
10094
+ _context73.next = 22;
10103
10095
  return this._messages.addMultipleFiles(n);
10104
10096
  case 22:
10105
10097
  this._messages.addLoadingMessage();
@@ -10108,17 +10100,17 @@ var SubmitButton = /*#__PURE__*/function (_InputButton4) {
10108
10100
  text: o,
10109
10101
  files: s
10110
10102
  };
10111
- _context74.next = 27;
10103
+ _context73.next = 27;
10112
10104
  return this._serviceIO.callAPI(a, this._messages);
10113
10105
  case 27:
10114
10106
  e || (c = this._fileAttachments) == null || c.removeAllFiles();
10115
10107
  case 28:
10116
10108
  case "end":
10117
- return _context74.stop();
10109
+ return _context73.stop();
10118
10110
  }
10119
- }, _callee74, this);
10111
+ }, _callee73, this);
10120
10112
  }));
10121
- function submit(_x126, _x127) {
10113
+ function submit(_x123, _x124) {
10122
10114
  return _submit.apply(this, arguments);
10123
10115
  }
10124
10116
  return submit;
@@ -10253,13 +10245,13 @@ var CameraModal = /*#__PURE__*/function (_Modal2) {
10253
10245
  t = new Array(e.length);
10254
10246
  for (var l = 0; l < e.length; l++) t[l] = e.charCodeAt(l);
10255
10247
  var n = new Uint8Array(t),
10256
- _s23 = new Blob([n], {
10248
+ s = new Blob([n], {
10257
10249
  type: this._format
10258
10250
  }),
10259
- _o16 = this._format === "image/jpeg" ? "jpeg" : "png",
10260
- _a13 = NewFileName.getFileName(this._newFilePrefix || "photo", _o16);
10261
- return new File([_s23], _a13, {
10262
- type: _s23.type
10251
+ o = this._format === "image/jpeg" ? "jpeg" : "png",
10252
+ a = NewFileName.getFileName(this._newFilePrefix || "photo", o);
10253
+ return new File([s], a, {
10254
+ type: s.type
10263
10255
  });
10264
10256
  }
10265
10257
  }