deep-chat-dev 9.0.67 → 9.0.68

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
@@ -531,7 +531,7 @@ var $t = /*#__PURE__*/function () {
531
531
  value: function getLastTextToElement(e, t) {
532
532
  for (var i = e.length - 1; i >= 0; i -= 1) if (e[i][0] === t) return e[i];
533
533
  }
534
- // IMPORTANT: If the overwrite message does not contain a role property it will be look for the last 'ai' role message
534
+ // IMPORTANT: If the overwrite message does not contain a role property it will look for the last 'ai' role message
535
535
  // and if messages have custom roles, it will still look to update the last 'ai' role message
536
536
  // prettier-ignore
537
537
  }, {
@@ -3190,29 +3190,29 @@ function to(_x10, _x11) {
3190
3190
  return _to.apply(this, arguments);
3191
3191
  }
3192
3192
  function _to() {
3193
- _to = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee98(n, e) {
3193
+ _to = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee99(n, e) {
3194
3194
  var t, i;
3195
- return _regeneratorRuntime().wrap(function _callee98$(_context98) {
3196
- while (1) switch (_context98.prev = _context98.next) {
3195
+ return _regeneratorRuntime().wrap(function _callee99$(_context99) {
3196
+ while (1) switch (_context99.prev = _context99.next) {
3197
3197
  case 0:
3198
3198
  t = n.getReader();
3199
3199
  case 1:
3200
- _context98.next = 3;
3200
+ _context99.next = 3;
3201
3201
  return t.read();
3202
3202
  case 3:
3203
- if ((i = _context98.sent).done) {
3204
- _context98.next = 7;
3203
+ if ((i = _context99.sent).done) {
3204
+ _context99.next = 7;
3205
3205
  break;
3206
3206
  }
3207
3207
  e(i.value);
3208
3208
  case 5:
3209
- _context98.next = 1;
3209
+ _context99.next = 1;
3210
3210
  break;
3211
3211
  case 7:
3212
3212
  case "end":
3213
- return _context98.stop();
3213
+ return _context99.stop();
3214
3214
  }
3215
- }, _callee98);
3215
+ }, _callee99);
3216
3216
  }));
3217
3217
  return _to.apply(this, arguments);
3218
3218
  }
@@ -4417,69 +4417,88 @@ var Ie = /*#__PURE__*/function () {
4417
4417
  return request;
4418
4418
  }()
4419
4419
  }, {
4420
- key: "callServiceAPI",
4420
+ key: "callAPIWithText",
4421
4421
  value: function () {
4422
- var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t, i) {
4423
- var _a$headers, _l$ContentType;
4424
- var o, a, l, c, s, r;
4422
+ var _callAPIWithText = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e, t) {
4423
+ var _o$headers, _a$ContentType;
4424
+ var r, o, a, l, i, s;
4425
4425
  return _regeneratorRuntime().wrap(function _callee17$(_context17) {
4426
4426
  while (1) switch (_context17.prev = _context17.next) {
4427
4427
  case 0:
4428
- s = _objectSpread({
4428
+ i = _objectSpread({
4429
4429
  messages: t
4430
4430
  }, this.rawBody);
4431
- r = !1;
4432
- (o = this.requestSettings.headers) != null && o["Content-Type"] || ((_a$headers = (a = this.requestSettings).headers) !== null && _a$headers !== void 0 ? _a$headers : a.headers = {}, (_l$ContentType = (l = this.requestSettings.headers)["Content-Type"]) !== null && _l$ContentType !== void 0 ? _l$ContentType : l["Content-Type"] = "application/json", r = !0);
4431
+ s = !1;
4432
+ (r = this.requestSettings.headers) != null && r["Content-Type"] || ((_o$headers = (o = this.requestSettings).headers) !== null && _o$headers !== void 0 ? _o$headers : o.headers = {}, (_a$ContentType = (a = this.requestSettings.headers)["Content-Type"]) !== null && _a$ContentType !== void 0 ? _a$ContentType : a["Content-Type"] = "application/json", s = !0);
4433
4433
  _context17.next = 5;
4434
- return this.request(s, e);
4434
+ return this.request(i, e);
4435
4435
  case 5:
4436
- r && ((c = this.requestSettings.headers) == null || delete c["Content-Type"]);
4436
+ s && ((l = this.requestSettings.headers) == null || delete l["Content-Type"]);
4437
4437
  case 6:
4438
4438
  case "end":
4439
4439
  return _context17.stop();
4440
4440
  }
4441
4441
  }, _callee17, this);
4442
4442
  }));
4443
- function callServiceAPI(_x34, _x35, _x36) {
4444
- return _callServiceAPI.apply(this, arguments);
4443
+ function callAPIWithText(_x34, _x35) {
4444
+ return _callAPIWithText.apply(this, arguments);
4445
4445
  }
4446
- return callServiceAPI;
4446
+ return callAPIWithText;
4447
4447
  }()
4448
4448
  }, {
4449
4449
  key: "callApiWithFiles",
4450
4450
  value: function () {
4451
- var _callApiWithFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e, t, i, s) {
4452
- var r, o, a;
4451
+ var _callApiWithFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e, t, i) {
4452
+ var s, r, o;
4453
4453
  return _regeneratorRuntime().wrap(function _callee18$(_context18) {
4454
4454
  while (1) switch (_context18.prev = _context18.next) {
4455
4455
  case 0:
4456
- r = Ie.createCustomFormDataBody(e, i, s), o = this.requestSettings, a = this.getServiceIOByType(s[0]);
4457
- this.requestSettings = (a == null ? void 0 : a.request) || this.requestSettings;
4456
+ s = Ie.createCustomFormDataBody(this.rawBody, t, i), r = this.requestSettings, o = this.getServiceIOByType(i[0]);
4457
+ this.requestSettings = (o == null ? void 0 : o.request) || this.requestSettings;
4458
4458
  _context18.next = 4;
4459
- return this.request(r, t, !1);
4459
+ return this.request(s, e, !1);
4460
4460
  case 4:
4461
- this.requestSettings = o;
4461
+ this.requestSettings = r;
4462
4462
  case 5:
4463
4463
  case "end":
4464
4464
  return _context18.stop();
4465
4465
  }
4466
4466
  }, _callee18, this);
4467
4467
  }));
4468
- function callApiWithFiles(_x37, _x38, _x39, _x40) {
4468
+ function callApiWithFiles(_x36, _x37, _x38) {
4469
4469
  return _callApiWithFiles.apply(this, arguments);
4470
4470
  }
4471
4471
  return callApiWithFiles;
4472
+ }()
4473
+ }, {
4474
+ key: "callServiceAPI",
4475
+ value: function () {
4476
+ var _callServiceAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e, t, i) {
4477
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
4478
+ while (1) switch (_context19.prev = _context19.next) {
4479
+ case 0:
4480
+ i ? this.callApiWithFiles(e, t, i) : this.callAPIWithText(e, t);
4481
+ case 1:
4482
+ case "end":
4483
+ return _context19.stop();
4484
+ }
4485
+ }, _callee19, this);
4486
+ }));
4487
+ function callServiceAPI(_x39, _x40, _x41) {
4488
+ return _callServiceAPI.apply(this, arguments);
4489
+ }
4490
+ return callServiceAPI;
4472
4491
  }() // prettier-ignore
4473
4492
  }, {
4474
4493
  key: "callAPI",
4475
4494
  value: function () {
4476
- var _callAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e, t) {
4495
+ var _callAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e, t) {
4477
4496
  var i, s;
4478
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
4479
- while (1) switch (_context19.prev = _context19.next) {
4497
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
4498
+ while (1) switch (_context20.prev = _context20.next) {
4480
4499
  case 0:
4481
4500
  if (this.requestSettings) {
4482
- _context19.next = 2;
4501
+ _context20.next = 2;
4483
4502
  break;
4484
4503
  }
4485
4504
  throw new Error("Request settings have not been set up");
@@ -4490,14 +4509,14 @@ var Ie = /*#__PURE__*/function () {
4490
4509
  messages: i
4491
4510
  }, this.rawBody);
4492
4511
  Y.sendWebsocket(this, s, t, !1);
4493
- } else e.files && !this.isDirectConnection() ? this.callApiWithFiles(this.rawBody, t, i, e.files) : this.callServiceAPI(t, i, e.files);
4512
+ } else this.callServiceAPI(t, i, e.files);
4494
4513
  case 4:
4495
4514
  case "end":
4496
- return _context19.stop();
4515
+ return _context20.stop();
4497
4516
  }
4498
- }, _callee19, this);
4517
+ }, _callee20, this);
4499
4518
  }));
4500
- function callAPI(_x41, _x42) {
4519
+ function callAPI(_x42, _x43) {
4501
4520
  return _callAPI.apply(this, arguments);
4502
4521
  }
4503
4522
  return callAPI;
@@ -4506,24 +4525,24 @@ var Ie = /*#__PURE__*/function () {
4506
4525
  }, {
4507
4526
  key: "extractResultData",
4508
4527
  value: function () {
4509
- var _extractResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e) {
4510
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
4511
- while (1) switch (_context20.prev = _context20.next) {
4528
+ var _extractResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e) {
4529
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
4530
+ while (1) switch (_context21.prev = _context21.next) {
4512
4531
  case 0:
4513
4532
  if (!e.error) {
4514
- _context20.next = 2;
4533
+ _context21.next = 2;
4515
4534
  break;
4516
4535
  }
4517
4536
  throw e.error;
4518
4537
  case 2:
4519
- return _context20.abrupt("return", e.result ? Ae.handleResponseProperty(e) : e);
4538
+ return _context21.abrupt("return", e.result ? Ae.handleResponseProperty(e) : e);
4520
4539
  case 3:
4521
4540
  case "end":
4522
- return _context20.stop();
4541
+ return _context21.stop();
4523
4542
  }
4524
- }, _callee20);
4543
+ }, _callee21);
4525
4544
  }));
4526
- function extractResultData(_x43) {
4545
+ function extractResultData(_x44) {
4527
4546
  return _extractResultData.apply(this, arguments);
4528
4547
  }
4529
4548
  return extractResultData;
@@ -4910,13 +4929,13 @@ var Qn = /*#__PURE__*/function (_z) {
4910
4929
  }, {
4911
4930
  key: "callServiceAPI",
4912
4931
  value: function () {
4913
- var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e, t, i) {
4932
+ var _callServiceAPI2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e, t, i) {
4914
4933
  var s;
4915
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
4916
- while (1) switch (_context21.prev = _context21.next) {
4934
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
4935
+ while (1) switch (_context22.prev = _context22.next) {
4917
4936
  case 0:
4918
4937
  if (this.requestSettings) {
4919
- _context21.next = 2;
4938
+ _context22.next = 2;
4920
4939
  break;
4921
4940
  }
4922
4941
  throw new Error("Request settings have not been set up");
@@ -4925,11 +4944,11 @@ var Qn = /*#__PURE__*/function (_z) {
4925
4944
  w.request(this, s, e);
4926
4945
  case 4:
4927
4946
  case "end":
4928
- return _context21.stop();
4947
+ return _context22.stop();
4929
4948
  }
4930
- }, _callee21, this);
4949
+ }, _callee22, this);
4931
4950
  }));
4932
- function callServiceAPI(_x44, _x45, _x46) {
4951
+ function callServiceAPI(_x45, _x46, _x47) {
4933
4952
  return _callServiceAPI2.apply(this, arguments);
4934
4953
  }
4935
4954
  return callServiceAPI;
@@ -4958,18 +4977,18 @@ var bt = /*#__PURE__*/function (_Ne) {
4958
4977
  }, {
4959
4978
  key: "callServiceAPI",
4960
4979
  value: function () {
4961
- var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e, t, i) {
4962
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
4963
- while (1) switch (_context22.prev = _context22.next) {
4980
+ var _callServiceAPI3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e, t, i) {
4981
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
4982
+ while (1) switch (_context23.prev = _context23.next) {
4964
4983
  case 0:
4965
4984
  if (this.requestSettings) {
4966
- _context22.next = 2;
4985
+ _context23.next = 2;
4967
4986
  break;
4968
4987
  }
4969
4988
  throw new Error("Request settings have not been set up");
4970
4989
  case 2:
4971
4990
  if (i != null && i[0]) {
4972
- _context22.next = 4;
4991
+ _context23.next = 4;
4973
4992
  break;
4974
4993
  }
4975
4994
  throw new Error("No file was added");
@@ -4977,11 +4996,11 @@ var bt = /*#__PURE__*/function (_Ne) {
4977
4996
  w.poll(this, i[0], e, !1);
4978
4997
  case 5:
4979
4998
  case "end":
4980
- return _context22.stop();
4999
+ return _context23.stop();
4981
5000
  }
4982
- }, _callee22, this);
5001
+ }, _callee23, this);
4983
5002
  }));
4984
- function callServiceAPI(_x47, _x48, _x49) {
5003
+ function callServiceAPI(_x48, _x49, _x50) {
4985
5004
  return _callServiceAPI3.apply(this, arguments);
4986
5005
  }
4987
5006
  return callServiceAPI;
@@ -5010,35 +5029,35 @@ var fo = /*#__PURE__*/function (_bt) {
5010
5029
  _createClass(fo, [{
5011
5030
  key: "extractPollResultData",
5012
5031
  value: function () {
5013
- var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e) {
5032
+ var _extractPollResultData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e) {
5014
5033
  var t;
5015
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
5016
- while (1) switch (_context23.prev = _context23.next) {
5034
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
5035
+ while (1) switch (_context24.prev = _context24.next) {
5017
5036
  case 0:
5018
5037
  if (!e.estimated_time) {
5019
- _context23.next = 2;
5038
+ _context24.next = 2;
5020
5039
  break;
5021
5040
  }
5022
- return _context23.abrupt("return", {
5041
+ return _context24.abrupt("return", {
5023
5042
  timeoutMS: (e.estimated_time + 1) * 1e3
5024
5043
  });
5025
5044
  case 2:
5026
5045
  if (!e.error) {
5027
- _context23.next = 4;
5046
+ _context24.next = 4;
5028
5047
  break;
5029
5048
  }
5030
5049
  throw e.error;
5031
5050
  case 4:
5032
- return _context23.abrupt("return", {
5051
+ return _context24.abrupt("return", {
5033
5052
  text: ((t = e[0]) == null ? void 0 : t.label) || ""
5034
5053
  });
5035
5054
  case 5:
5036
5055
  case "end":
5037
- return _context23.stop();
5056
+ return _context24.stop();
5038
5057
  }
5039
- }, _callee23);
5058
+ }, _callee24);
5040
5059
  }));
5041
- function extractPollResultData(_x50) {
5060
+ function extractPollResultData(_x51) {
5042
5061
  return _extractPollResultData.apply(this, arguments);
5043
5062
  }
5044
5063
  return extractPollResultData;
@@ -5061,35 +5080,35 @@ var mo = /*#__PURE__*/function (_bt2) {
5061
5080
  _createClass(mo, [{
5062
5081
  key: "extractPollResultData",
5063
5082
  value: function () {
5064
- var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(e) {
5083
+ var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e) {
5065
5084
  var t;
5066
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
5067
- while (1) switch (_context24.prev = _context24.next) {
5085
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
5086
+ while (1) switch (_context25.prev = _context25.next) {
5068
5087
  case 0:
5069
5088
  if (!e.estimated_time) {
5070
- _context24.next = 2;
5089
+ _context25.next = 2;
5071
5090
  break;
5072
5091
  }
5073
- return _context24.abrupt("return", {
5092
+ return _context25.abrupt("return", {
5074
5093
  timeoutMS: (e.estimated_time + 1) * 1e3
5075
5094
  });
5076
5095
  case 2:
5077
5096
  if (!e.error) {
5078
- _context24.next = 4;
5097
+ _context25.next = 4;
5079
5098
  break;
5080
5099
  }
5081
5100
  throw e.error;
5082
5101
  case 4:
5083
- return _context24.abrupt("return", {
5102
+ return _context25.abrupt("return", {
5084
5103
  text: ((t = e[0]) == null ? void 0 : t.label) || ""
5085
5104
  });
5086
5105
  case 5:
5087
5106
  case "end":
5088
- return _context24.stop();
5107
+ return _context25.stop();
5089
5108
  }
5090
- }, _callee24);
5109
+ }, _callee25);
5091
5110
  }));
5092
- function extractPollResultData(_x51) {
5111
+ function extractPollResultData(_x52) {
5093
5112
  return _extractPollResultData2.apply(this, arguments);
5094
5113
  }
5095
5114
  return extractPollResultData;
@@ -5174,19 +5193,19 @@ var Dt = /*#__PURE__*/function (_Qt) {
5174
5193
  }, {
5175
5194
  key: "callServiceAPI",
5176
5195
  value: function () {
5177
- var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e, t, i) {
5196
+ var _callServiceAPI4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e, t, i) {
5178
5197
  var s;
5179
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
5180
- while (1) switch (_context25.prev = _context25.next) {
5198
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
5199
+ while (1) switch (_context26.prev = _context26.next) {
5181
5200
  case 0:
5182
5201
  if (this.requestSettings) {
5183
- _context25.next = 2;
5202
+ _context26.next = 2;
5184
5203
  break;
5185
5204
  }
5186
5205
  throw new Error("Request settings have not been set up");
5187
5206
  case 2:
5188
5207
  if (i) {
5189
- _context25.next = 4;
5208
+ _context26.next = 4;
5190
5209
  break;
5191
5210
  }
5192
5211
  throw new Error("Image was not found");
@@ -5195,11 +5214,11 @@ var Dt = /*#__PURE__*/function (_Qt) {
5195
5214
  _.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, s, e), !1);
5196
5215
  case 6:
5197
5216
  case "end":
5198
- return _context25.stop();
5217
+ return _context26.stop();
5199
5218
  }
5200
- }, _callee25, this);
5219
+ }, _callee26, this);
5201
5220
  }));
5202
- function callServiceAPI(_x52, _x53, _x54) {
5221
+ function callServiceAPI(_x53, _x54, _x55) {
5203
5222
  return _callServiceAPI4.apply(this, arguments);
5204
5223
  }
5205
5224
  return callServiceAPI;
@@ -5207,17 +5226,17 @@ var Dt = /*#__PURE__*/function (_Qt) {
5207
5226
  }, {
5208
5227
  key: "extractResultData",
5209
5228
  value: function () {
5210
- var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e) {
5211
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
5212
- while (1) switch (_context26.prev = _context26.next) {
5229
+ var _extractResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(e) {
5230
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
5231
+ while (1) switch (_context27.prev = _context27.next) {
5213
5232
  case 0:
5214
5233
  if (!e.message) {
5215
- _context26.next = 2;
5234
+ _context27.next = 2;
5216
5235
  break;
5217
5236
  }
5218
5237
  throw e.message;
5219
5238
  case 2:
5220
- return _context26.abrupt("return", {
5239
+ return _context27.abrupt("return", {
5221
5240
  files: e.artifacts.map(function (i) {
5222
5241
  return {
5223
5242
  src: "".concat(vt).concat(i.base64),
@@ -5227,11 +5246,11 @@ var Dt = /*#__PURE__*/function (_Qt) {
5227
5246
  });
5228
5247
  case 3:
5229
5248
  case "end":
5230
- return _context26.stop();
5249
+ return _context27.stop();
5231
5250
  }
5232
- }, _callee26);
5251
+ }, _callee27);
5233
5252
  }));
5234
- function extractResultData(_x55) {
5253
+ function extractResultData(_x56) {
5235
5254
  return _extractResultData2.apply(this, arguments);
5236
5255
  }
5237
5256
  return extractResultData;
@@ -5283,19 +5302,19 @@ var jt = /*#__PURE__*/function (_Qt2) {
5283
5302
  }, {
5284
5303
  key: "callServiceAPI",
5285
5304
  value: function () {
5286
- var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(e, t, i) {
5305
+ var _callServiceAPI5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e, t, i) {
5287
5306
  var o, a, s, r;
5288
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
5289
- while (1) switch (_context27.prev = _context27.next) {
5307
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
5308
+ while (1) switch (_context28.prev = _context28.next) {
5290
5309
  case 0:
5291
5310
  if (this.requestSettings) {
5292
- _context27.next = 2;
5311
+ _context28.next = 2;
5293
5312
  break;
5294
5313
  }
5295
5314
  throw new Error("Request settings have not been set up");
5296
5315
  case 2:
5297
5316
  if (!(!i || !i[0] || !i[1])) {
5298
- _context27.next = 4;
5317
+ _context28.next = 4;
5299
5318
  break;
5300
5319
  }
5301
5320
  throw new Error("Image was not found");
@@ -5304,11 +5323,11 @@ var jt = /*#__PURE__*/function (_Qt2) {
5304
5323
  _.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, r, e), !1);
5305
5324
  case 6:
5306
5325
  case "end":
5307
- return _context27.stop();
5326
+ return _context28.stop();
5308
5327
  }
5309
- }, _callee27, this);
5328
+ }, _callee28, this);
5310
5329
  }));
5311
- function callServiceAPI(_x56, _x57, _x58) {
5330
+ function callServiceAPI(_x57, _x58, _x59) {
5312
5331
  return _callServiceAPI5.apply(this, arguments);
5313
5332
  }
5314
5333
  return callServiceAPI;
@@ -5316,17 +5335,17 @@ var jt = /*#__PURE__*/function (_Qt2) {
5316
5335
  }, {
5317
5336
  key: "extractResultData",
5318
5337
  value: function () {
5319
- var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e) {
5320
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
5321
- while (1) switch (_context28.prev = _context28.next) {
5338
+ var _extractResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e) {
5339
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
5340
+ while (1) switch (_context29.prev = _context29.next) {
5322
5341
  case 0:
5323
5342
  if (!e.message) {
5324
- _context28.next = 2;
5343
+ _context29.next = 2;
5325
5344
  break;
5326
5345
  }
5327
5346
  throw e.message;
5328
5347
  case 2:
5329
- return _context28.abrupt("return", {
5348
+ return _context29.abrupt("return", {
5330
5349
  files: e.artifacts.map(function (i) {
5331
5350
  return {
5332
5351
  src: "".concat(vt).concat(i.base64),
@@ -5336,11 +5355,11 @@ var jt = /*#__PURE__*/function (_Qt2) {
5336
5355
  });
5337
5356
  case 3:
5338
5357
  case "end":
5339
- return _context28.stop();
5358
+ return _context29.stop();
5340
5359
  }
5341
- }, _callee28);
5360
+ }, _callee29);
5342
5361
  }));
5343
- function extractResultData(_x59) {
5362
+ function extractResultData(_x60) {
5344
5363
  return _extractResultData3.apply(this, arguments);
5345
5364
  }
5346
5365
  return extractResultData;
@@ -5373,34 +5392,34 @@ var go = /*#__PURE__*/function (_bt3) {
5373
5392
  _createClass(go, [{
5374
5393
  key: "extractPollResultData",
5375
5394
  value: function () {
5376
- var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e) {
5377
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
5378
- while (1) switch (_context29.prev = _context29.next) {
5395
+ var _extractPollResultData3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e) {
5396
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
5397
+ while (1) switch (_context30.prev = _context30.next) {
5379
5398
  case 0:
5380
5399
  if (!e.estimated_time) {
5381
- _context29.next = 2;
5400
+ _context30.next = 2;
5382
5401
  break;
5383
5402
  }
5384
- return _context29.abrupt("return", {
5403
+ return _context30.abrupt("return", {
5385
5404
  timeoutMS: (e.estimated_time + 1) * 1e3
5386
5405
  });
5387
5406
  case 2:
5388
5407
  if (!e.error) {
5389
- _context29.next = 4;
5408
+ _context30.next = 4;
5390
5409
  break;
5391
5410
  }
5392
5411
  throw e.error;
5393
5412
  case 4:
5394
- return _context29.abrupt("return", {
5413
+ return _context30.abrupt("return", {
5395
5414
  text: e.text || ""
5396
5415
  });
5397
5416
  case 5:
5398
5417
  case "end":
5399
- return _context29.stop();
5418
+ return _context30.stop();
5400
5419
  }
5401
- }, _callee29);
5420
+ }, _callee30);
5402
5421
  }));
5403
- function extractPollResultData(_x60) {
5422
+ function extractPollResultData(_x61) {
5404
5423
  return _extractPollResultData3.apply(this, arguments);
5405
5424
  }
5406
5425
  return extractPollResultData;
@@ -5421,26 +5440,26 @@ var bo = /*#__PURE__*/function (_Ne2) {
5421
5440
  _createClass(bo, [{
5422
5441
  key: "extractResultData",
5423
5442
  value: function () {
5424
- var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e) {
5425
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
5426
- while (1) switch (_context30.prev = _context30.next) {
5443
+ var _extractResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e) {
5444
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
5445
+ while (1) switch (_context31.prev = _context31.next) {
5427
5446
  case 0:
5428
5447
  if (!e.error) {
5429
- _context30.next = 2;
5448
+ _context31.next = 2;
5430
5449
  break;
5431
5450
  }
5432
5451
  throw e.error;
5433
5452
  case 2:
5434
- return _context30.abrupt("return", {
5453
+ return _context31.abrupt("return", {
5435
5454
  text: e[0].generated_text || ""
5436
5455
  });
5437
5456
  case 3:
5438
5457
  case "end":
5439
- return _context30.stop();
5458
+ return _context31.stop();
5440
5459
  }
5441
- }, _callee30);
5460
+ }, _callee31);
5442
5461
  }));
5443
- function extractResultData(_x61) {
5462
+ function extractResultData(_x62) {
5444
5463
  return _extractResultData4.apply(this, arguments);
5445
5464
  }
5446
5465
  return extractResultData;
@@ -5477,26 +5496,26 @@ var vo = /*#__PURE__*/function (_Ne3) {
5477
5496
  }, {
5478
5497
  key: "extractResultData",
5479
5498
  value: function () {
5480
- var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(e) {
5481
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
5482
- while (1) switch (_context31.prev = _context31.next) {
5499
+ var _extractResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e) {
5500
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
5501
+ while (1) switch (_context32.prev = _context32.next) {
5483
5502
  case 0:
5484
5503
  if (!e.error) {
5485
- _context31.next = 2;
5504
+ _context32.next = 2;
5486
5505
  break;
5487
5506
  }
5488
5507
  throw e.error;
5489
5508
  case 2:
5490
- return _context31.abrupt("return", {
5509
+ return _context32.abrupt("return", {
5491
5510
  text: e.answer || ""
5492
5511
  });
5493
5512
  case 3:
5494
5513
  case "end":
5495
- return _context31.stop();
5514
+ return _context32.stop();
5496
5515
  }
5497
- }, _callee31);
5516
+ }, _callee32);
5498
5517
  }));
5499
- function extractResultData(_x62) {
5518
+ function extractResultData(_x63) {
5500
5519
  return _extractResultData5.apply(this, arguments);
5501
5520
  }
5502
5521
  return extractResultData;
@@ -5517,26 +5536,26 @@ var yo = /*#__PURE__*/function (_Ne4) {
5517
5536
  _createClass(yo, [{
5518
5537
  key: "extractResultData",
5519
5538
  value: function () {
5520
- var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e) {
5521
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
5522
- while (1) switch (_context32.prev = _context32.next) {
5539
+ var _extractResultData6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e) {
5540
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
5541
+ while (1) switch (_context33.prev = _context33.next) {
5523
5542
  case 0:
5524
5543
  if (!e.error) {
5525
- _context32.next = 2;
5544
+ _context33.next = 2;
5526
5545
  break;
5527
5546
  }
5528
5547
  throw e.error;
5529
5548
  case 2:
5530
- return _context32.abrupt("return", {
5549
+ return _context33.abrupt("return", {
5531
5550
  text: e[0].summary_text || ""
5532
5551
  });
5533
5552
  case 3:
5534
5553
  case "end":
5535
- return _context32.stop();
5554
+ return _context33.stop();
5536
5555
  }
5537
- }, _callee32);
5556
+ }, _callee33);
5538
5557
  }));
5539
- function extractResultData(_x63) {
5558
+ function extractResultData(_x64) {
5540
5559
  return _extractResultData6.apply(this, arguments);
5541
5560
  }
5542
5561
  return extractResultData;
@@ -5601,26 +5620,26 @@ var xo = /*#__PURE__*/function (_Ne5) {
5601
5620
  }, {
5602
5621
  key: "extractResultData",
5603
5622
  value: function () {
5604
- var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e) {
5605
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
5606
- while (1) switch (_context33.prev = _context33.next) {
5623
+ var _extractResultData7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e) {
5624
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
5625
+ while (1) switch (_context34.prev = _context34.next) {
5607
5626
  case 0:
5608
5627
  if (!e.error) {
5609
- _context33.next = 2;
5628
+ _context34.next = 2;
5610
5629
  break;
5611
5630
  }
5612
5631
  throw e.error;
5613
5632
  case 2:
5614
- return _context33.abrupt("return", {
5633
+ return _context34.abrupt("return", {
5615
5634
  text: e.generated_text || ""
5616
5635
  });
5617
5636
  case 3:
5618
5637
  case "end":
5619
- return _context33.stop();
5638
+ return _context34.stop();
5620
5639
  }
5621
- }, _callee33);
5640
+ }, _callee34);
5622
5641
  }));
5623
- function extractResultData(_x64) {
5642
+ function extractResultData(_x65) {
5624
5643
  return _extractResultData7.apply(this, arguments);
5625
5644
  }
5626
5645
  return extractResultData;
@@ -5662,19 +5681,19 @@ var Bt = /*#__PURE__*/function (_Qt3) {
5662
5681
  }, {
5663
5682
  key: "callServiceAPI",
5664
5683
  value: function () {
5665
- var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e, t, i) {
5684
+ var _callServiceAPI6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e, t, i) {
5666
5685
  var o, a, s, r;
5667
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
5668
- while (1) switch (_context34.prev = _context34.next) {
5686
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
5687
+ while (1) switch (_context35.prev = _context35.next) {
5669
5688
  case 0:
5670
5689
  if (this.requestSettings) {
5671
- _context34.next = 2;
5690
+ _context35.next = 2;
5672
5691
  break;
5673
5692
  }
5674
5693
  throw new Error("Request settings have not been set up");
5675
5694
  case 2:
5676
5695
  if (i) {
5677
- _context34.next = 4;
5696
+ _context35.next = 4;
5678
5697
  break;
5679
5698
  }
5680
5699
  throw new Error("Image was not found");
@@ -5683,11 +5702,11 @@ var Bt = /*#__PURE__*/function (_Qt3) {
5683
5702
  _.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, r, e), !1);
5684
5703
  case 6:
5685
5704
  case "end":
5686
- return _context34.stop();
5705
+ return _context35.stop();
5687
5706
  }
5688
- }, _callee34, this);
5707
+ }, _callee35, this);
5689
5708
  }));
5690
- function callServiceAPI(_x65, _x66, _x67) {
5709
+ function callServiceAPI(_x66, _x67, _x68) {
5691
5710
  return _callServiceAPI6.apply(this, arguments);
5692
5711
  }
5693
5712
  return callServiceAPI;
@@ -5695,17 +5714,17 @@ var Bt = /*#__PURE__*/function (_Qt3) {
5695
5714
  }, {
5696
5715
  key: "extractResultData",
5697
5716
  value: function () {
5698
- var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e) {
5699
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
5700
- while (1) switch (_context35.prev = _context35.next) {
5717
+ var _extractResultData8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
5718
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
5719
+ while (1) switch (_context36.prev = _context36.next) {
5701
5720
  case 0:
5702
5721
  if (!e.message) {
5703
- _context35.next = 2;
5722
+ _context36.next = 2;
5704
5723
  break;
5705
5724
  }
5706
5725
  throw e.message;
5707
5726
  case 2:
5708
- return _context35.abrupt("return", {
5727
+ return _context36.abrupt("return", {
5709
5728
  files: e.artifacts.map(function (i) {
5710
5729
  return {
5711
5730
  src: "".concat(vt).concat(i.base64),
@@ -5715,11 +5734,11 @@ var Bt = /*#__PURE__*/function (_Qt3) {
5715
5734
  });
5716
5735
  case 3:
5717
5736
  case "end":
5718
- return _context35.stop();
5737
+ return _context36.stop();
5719
5738
  }
5720
- }, _callee35);
5739
+ }, _callee36);
5721
5740
  }));
5722
- function extractResultData(_x68) {
5741
+ function extractResultData(_x69) {
5723
5742
  return _extractResultData8.apply(this, arguments);
5724
5743
  }
5725
5744
  return extractResultData;
@@ -5750,26 +5769,26 @@ var Eo = /*#__PURE__*/function (_Ne6) {
5750
5769
  _createClass(Eo, [{
5751
5770
  key: "extractResultData",
5752
5771
  value: function () {
5753
- var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e) {
5754
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
5755
- while (1) switch (_context36.prev = _context36.next) {
5772
+ var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
5773
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
5774
+ while (1) switch (_context37.prev = _context37.next) {
5756
5775
  case 0:
5757
5776
  if (!e.error) {
5758
- _context36.next = 2;
5777
+ _context37.next = 2;
5759
5778
  break;
5760
5779
  }
5761
5780
  throw e.error;
5762
5781
  case 2:
5763
- return _context36.abrupt("return", {
5782
+ return _context37.abrupt("return", {
5764
5783
  text: e[0].translation_text || ""
5765
5784
  });
5766
5785
  case 3:
5767
5786
  case "end":
5768
- return _context36.stop();
5787
+ return _context37.stop();
5769
5788
  }
5770
- }, _callee36);
5789
+ }, _callee37);
5771
5790
  }));
5772
- function extractResultData(_x69) {
5791
+ function extractResultData(_x70) {
5773
5792
  return _extractResultData9.apply(this, arguments);
5774
5793
  }
5775
5794
  return extractResultData;
@@ -5803,13 +5822,13 @@ var Ft = /*#__PURE__*/function (_Qt4) {
5803
5822
  }, {
5804
5823
  key: "callServiceAPI",
5805
5824
  value: function () {
5806
- var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e, t) {
5825
+ var _callServiceAPI7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e, t) {
5807
5826
  var i;
5808
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
5809
- while (1) switch (_context37.prev = _context37.next) {
5827
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
5828
+ while (1) switch (_context38.prev = _context38.next) {
5810
5829
  case 0:
5811
5830
  if (this.requestSettings) {
5812
- _context37.next = 2;
5831
+ _context38.next = 2;
5813
5832
  break;
5814
5833
  }
5815
5834
  throw new Error("Request settings have not been set up");
@@ -5818,11 +5837,11 @@ var Ft = /*#__PURE__*/function (_Qt4) {
5818
5837
  w.request(this, i, e);
5819
5838
  case 4:
5820
5839
  case "end":
5821
- return _context37.stop();
5840
+ return _context38.stop();
5822
5841
  }
5823
- }, _callee37, this);
5842
+ }, _callee38, this);
5824
5843
  }));
5825
- function callServiceAPI(_x70, _x71) {
5844
+ function callServiceAPI(_x71, _x72) {
5826
5845
  return _callServiceAPI7.apply(this, arguments);
5827
5846
  }
5828
5847
  return callServiceAPI;
@@ -5830,17 +5849,17 @@ var Ft = /*#__PURE__*/function (_Qt4) {
5830
5849
  }, {
5831
5850
  key: "extractResultData",
5832
5851
  value: function () {
5833
- var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e) {
5834
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
5835
- while (1) switch (_context38.prev = _context38.next) {
5852
+ var _extractResultData10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e) {
5853
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
5854
+ while (1) switch (_context39.prev = _context39.next) {
5836
5855
  case 0:
5837
5856
  if (!e.message) {
5838
- _context38.next = 2;
5857
+ _context39.next = 2;
5839
5858
  break;
5840
5859
  }
5841
5860
  throw e.message;
5842
5861
  case 2:
5843
- return _context38.abrupt("return", {
5862
+ return _context39.abrupt("return", {
5844
5863
  files: e.artifacts.map(function (i) {
5845
5864
  return {
5846
5865
  src: "".concat(vt).concat(i.base64),
@@ -5850,11 +5869,11 @@ var Ft = /*#__PURE__*/function (_Qt4) {
5850
5869
  });
5851
5870
  case 3:
5852
5871
  case "end":
5853
- return _context38.stop();
5872
+ return _context39.stop();
5854
5873
  }
5855
- }, _callee38);
5874
+ }, _callee39);
5856
5875
  }));
5857
- function extractResultData(_x72) {
5876
+ function extractResultData(_x73) {
5858
5877
  return _extractResultData10.apply(this, arguments);
5859
5878
  }
5860
5879
  return extractResultData;
@@ -5887,26 +5906,26 @@ var So = /*#__PURE__*/function (_Ne7) {
5887
5906
  _createClass(So, [{
5888
5907
  key: "extractResultData",
5889
5908
  value: function () {
5890
- var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(e) {
5891
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
5892
- while (1) switch (_context39.prev = _context39.next) {
5909
+ var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e) {
5910
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
5911
+ while (1) switch (_context40.prev = _context40.next) {
5893
5912
  case 0:
5894
5913
  if (!e.error) {
5895
- _context39.next = 2;
5914
+ _context40.next = 2;
5896
5915
  break;
5897
5916
  }
5898
5917
  throw e.error;
5899
5918
  case 2:
5900
- return _context39.abrupt("return", {
5919
+ return _context40.abrupt("return", {
5901
5920
  text: e[0].sequence || ""
5902
5921
  });
5903
5922
  case 3:
5904
5923
  case "end":
5905
- return _context39.stop();
5924
+ return _context40.stop();
5906
5925
  }
5907
- }, _callee39);
5926
+ }, _callee40);
5908
5927
  }));
5909
- function extractResultData(_x73) {
5928
+ function extractResultData(_x74) {
5910
5929
  return _extractResultData11.apply(this, arguments);
5911
5930
  }
5912
5931
  return extractResultData;
@@ -5981,13 +6000,13 @@ var wo = /*#__PURE__*/function (_Wi) {
5981
6000
  }, {
5982
6001
  key: "callServiceAPI",
5983
6002
  value: function () {
5984
- var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(e, t) {
6003
+ var _callServiceAPI8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e, t) {
5985
6004
  var i;
5986
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
5987
- while (1) switch (_context40.prev = _context40.next) {
6005
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
6006
+ while (1) switch (_context41.prev = _context41.next) {
5988
6007
  case 0:
5989
6008
  if (this.requestSettings) {
5990
- _context40.next = 2;
6009
+ _context41.next = 2;
5991
6010
  break;
5992
6011
  }
5993
6012
  throw new Error("Request settings have not been set up");
@@ -5996,11 +6015,11 @@ var wo = /*#__PURE__*/function (_Wi) {
5996
6015
  w.request(this, i, e);
5997
6016
  case 4:
5998
6017
  case "end":
5999
- return _context40.stop();
6018
+ return _context41.stop();
6000
6019
  }
6001
- }, _callee40, this);
6020
+ }, _callee41, this);
6002
6021
  }));
6003
- function callServiceAPI(_x74, _x75) {
6022
+ function callServiceAPI(_x75, _x76) {
6004
6023
  return _callServiceAPI8.apply(this, arguments);
6005
6024
  }
6006
6025
  return callServiceAPI;
@@ -6008,27 +6027,27 @@ var wo = /*#__PURE__*/function (_Wi) {
6008
6027
  }, {
6009
6028
  key: "extractResultData",
6010
6029
  value: function () {
6011
- var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(e) {
6030
+ var _extractResultData12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e) {
6012
6031
  var t;
6013
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
6014
- while (1) switch (_context41.prev = _context41.next) {
6032
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
6033
+ while (1) switch (_context42.prev = _context42.next) {
6015
6034
  case 0:
6016
6035
  if (!e.message) {
6017
- _context41.next = 2;
6036
+ _context42.next = 2;
6018
6037
  break;
6019
6038
  }
6020
6039
  throw e.message;
6021
6040
  case 2:
6022
- return _context41.abrupt("return", {
6041
+ return _context42.abrupt("return", {
6023
6042
  text: ((t = e.generations) == null ? void 0 : t[0].text) || ""
6024
6043
  });
6025
6044
  case 3:
6026
6045
  case "end":
6027
- return _context41.stop();
6046
+ return _context42.stop();
6028
6047
  }
6029
- }, _callee41);
6048
+ }, _callee42);
6030
6049
  }));
6031
- function extractResultData(_x76) {
6050
+ function extractResultData(_x77) {
6032
6051
  return _extractResultData12.apply(this, arguments);
6033
6052
  }
6034
6053
  return extractResultData;
@@ -6058,13 +6077,13 @@ var _o = /*#__PURE__*/function (_Wi2) {
6058
6077
  }, {
6059
6078
  key: "callServiceAPI",
6060
6079
  value: function () {
6061
- var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e, t) {
6080
+ var _callServiceAPI9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e, t) {
6062
6081
  var i;
6063
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
6064
- while (1) switch (_context42.prev = _context42.next) {
6082
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
6083
+ while (1) switch (_context43.prev = _context43.next) {
6065
6084
  case 0:
6066
6085
  if (this.requestSettings) {
6067
- _context42.next = 2;
6086
+ _context43.next = 2;
6068
6087
  break;
6069
6088
  }
6070
6089
  throw new Error("Request settings have not been set up");
@@ -6073,11 +6092,11 @@ var _o = /*#__PURE__*/function (_Wi2) {
6073
6092
  w.request(this, i, e);
6074
6093
  case 4:
6075
6094
  case "end":
6076
- return _context42.stop();
6095
+ return _context43.stop();
6077
6096
  }
6078
- }, _callee42, this);
6097
+ }, _callee43, this);
6079
6098
  }));
6080
- function callServiceAPI(_x77, _x78) {
6099
+ function callServiceAPI(_x78, _x79) {
6081
6100
  return _callServiceAPI9.apply(this, arguments);
6082
6101
  }
6083
6102
  return callServiceAPI;
@@ -6085,26 +6104,26 @@ var _o = /*#__PURE__*/function (_Wi2) {
6085
6104
  }, {
6086
6105
  key: "extractResultData",
6087
6106
  value: function () {
6088
- var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(e) {
6089
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
6090
- while (1) switch (_context43.prev = _context43.next) {
6107
+ var _extractResultData13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(e) {
6108
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
6109
+ while (1) switch (_context44.prev = _context44.next) {
6091
6110
  case 0:
6092
6111
  if (!e.message) {
6093
- _context43.next = 2;
6112
+ _context44.next = 2;
6094
6113
  break;
6095
6114
  }
6096
6115
  throw e.message;
6097
6116
  case 2:
6098
- return _context43.abrupt("return", {
6117
+ return _context44.abrupt("return", {
6099
6118
  text: e.summary || ""
6100
6119
  });
6101
6120
  case 3:
6102
6121
  case "end":
6103
- return _context43.stop();
6122
+ return _context44.stop();
6104
6123
  }
6105
- }, _callee43);
6124
+ }, _callee44);
6106
6125
  }));
6107
- function extractResultData(_x79) {
6126
+ function extractResultData(_x80) {
6108
6127
  return _extractResultData13.apply(this, arguments);
6109
6128
  }
6110
6129
  return extractResultData;
@@ -6143,60 +6162,60 @@ var O = /*#__PURE__*/function () {
6143
6162
  }, {
6144
6163
  key: "storeFiles",
6145
6164
  value: function () {
6146
- var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e, t, i) {
6165
+ var _storeFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e, t, i) {
6147
6166
  var s, r, o, a;
6148
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
6149
- while (1) switch (_context45.prev = _context45.next) {
6167
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
6168
+ while (1) switch (_context46.prev = _context46.next) {
6150
6169
  case 0:
6151
6170
  s = e.requestSettings.headers;
6152
6171
  if (s) {
6153
- _context45.next = 3;
6172
+ _context46.next = 3;
6154
6173
  break;
6155
6174
  }
6156
- return _context45.abrupt("return");
6175
+ return _context46.abrupt("return");
6157
6176
  case 3:
6158
6177
  e.url = "https://api.openai.com/v1/files";
6159
6178
  r = s[_.CONTENT_TYPE];
6160
6179
  delete s[_.CONTENT_TYPE];
6161
6180
  o = i.map( /*#__PURE__*/function () {
6162
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(a) {
6181
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(a) {
6163
6182
  var l;
6164
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
6165
- while (1) switch (_context44.prev = _context44.next) {
6183
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
6184
+ while (1) switch (_context45.prev = _context45.next) {
6166
6185
  case 0:
6167
6186
  l = new FormData();
6168
- return _context44.abrupt("return", (l.append("purpose", "assistants"), l.append("file", a), new Promise(function (c) {
6187
+ return _context45.abrupt("return", (l.append("purpose", "assistants"), l.append("file", a), new Promise(function (c) {
6169
6188
  c(O.directFetch(e, l, "POST", !1));
6170
6189
  })));
6171
6190
  case 2:
6172
6191
  case "end":
6173
- return _context44.stop();
6192
+ return _context45.stop();
6174
6193
  }
6175
- }, _callee44);
6194
+ }, _callee45);
6176
6195
  }));
6177
- return function (_x83) {
6196
+ return function (_x84) {
6178
6197
  return _ref7.apply(this, arguments);
6179
6198
  };
6180
6199
  }());
6181
- _context45.prev = 7;
6182
- _context45.next = 10;
6200
+ _context46.prev = 7;
6201
+ _context46.next = 10;
6183
6202
  return Promise.all(o);
6184
6203
  case 10:
6185
- a = _context45.sent.map(function (l) {
6204
+ a = _context46.sent.map(function (l) {
6186
6205
  return l.id;
6187
6206
  });
6188
- return _context45.abrupt("return", (s[_.CONTENT_TYPE] = r, a));
6207
+ return _context46.abrupt("return", (s[_.CONTENT_TYPE] = r, a));
6189
6208
  case 14:
6190
- _context45.prev = 14;
6191
- _context45.t0 = _context45["catch"](7);
6192
- throw s[_.CONTENT_TYPE] = r, _.displayError(t, _context45.t0), e.completionsHandlers.onFinish(), _context45.t0;
6209
+ _context46.prev = 14;
6210
+ _context46.t0 = _context46["catch"](7);
6211
+ throw s[_.CONTENT_TYPE] = r, _.displayError(t, _context46.t0), e.completionsHandlers.onFinish(), _context46.t0;
6193
6212
  case 17:
6194
6213
  case "end":
6195
- return _context45.stop();
6214
+ return _context46.stop();
6196
6215
  }
6197
- }, _callee45, null, [[7, 14]]);
6216
+ }, _callee46, null, [[7, 14]]);
6198
6217
  }));
6199
- function storeFiles(_x80, _x81, _x82) {
6218
+ function storeFiles(_x81, _x82, _x83) {
6200
6219
  return _storeFiles.apply(this, arguments);
6201
6220
  }
6202
6221
  return storeFiles;
@@ -6204,35 +6223,35 @@ var O = /*#__PURE__*/function () {
6204
6223
  }, {
6205
6224
  key: "directFetch",
6206
6225
  value: function () {
6207
- var _directFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e, t, i) {
6226
+ var _directFetch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e, t, i) {
6208
6227
  var s,
6209
6228
  r,
6210
- _args46 = arguments;
6211
- return _regeneratorRuntime().wrap(function _callee46$(_context46) {
6212
- while (1) switch (_context46.prev = _context46.next) {
6229
+ _args47 = arguments;
6230
+ return _regeneratorRuntime().wrap(function _callee47$(_context47) {
6231
+ while (1) switch (_context47.prev = _context47.next) {
6213
6232
  case 0:
6214
- s = _args46.length > 3 && _args46[3] !== undefined ? _args46[3] : !0;
6233
+ s = _args47.length > 3 && _args47[3] !== undefined ? _args47[3] : !0;
6215
6234
  e.requestSettings.method = i;
6216
- _context46.next = 4;
6235
+ _context47.next = 4;
6217
6236
  return _.fetch(e, e.requestSettings.headers, s, t).then(function (o) {
6218
6237
  return _.processResponseByType(o);
6219
6238
  });
6220
6239
  case 4:
6221
- r = _context46.sent;
6240
+ r = _context47.sent;
6222
6241
  if (!r.error) {
6223
- _context46.next = 7;
6242
+ _context47.next = 7;
6224
6243
  break;
6225
6244
  }
6226
6245
  throw r.error.message;
6227
6246
  case 7:
6228
- return _context46.abrupt("return", r);
6247
+ return _context47.abrupt("return", r);
6229
6248
  case 8:
6230
6249
  case "end":
6231
- return _context46.stop();
6250
+ return _context47.stop();
6232
6251
  }
6233
- }, _callee46);
6252
+ }, _callee47);
6234
6253
  }));
6235
- function directFetch(_x84, _x85, _x86) {
6254
+ function directFetch(_x85, _x86, _x87) {
6236
6255
  return _directFetch.apply(this, arguments);
6237
6256
  }
6238
6257
  return directFetch;
@@ -6266,13 +6285,13 @@ var Ki = /*#__PURE__*/function (_z4) {
6266
6285
  }, {
6267
6286
  key: "callServiceAPI",
6268
6287
  value: function () {
6269
- var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e, t) {
6288
+ var _callServiceAPI10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e, t) {
6270
6289
  var s, i;
6271
- return _regeneratorRuntime().wrap(function _callee47$(_context47) {
6272
- while (1) switch (_context47.prev = _context47.next) {
6290
+ return _regeneratorRuntime().wrap(function _callee48$(_context48) {
6291
+ while (1) switch (_context48.prev = _context48.next) {
6273
6292
  case 0:
6274
6293
  if ((s = this.requestSettings) != null && s.headers) {
6275
- _context47.next = 2;
6294
+ _context48.next = 2;
6276
6295
  break;
6277
6296
  }
6278
6297
  throw new Error("Request settings have not been set up");
@@ -6282,11 +6301,11 @@ var Ki = /*#__PURE__*/function (_z4) {
6282
6301
  w.request(this, i, e);
6283
6302
  case 5:
6284
6303
  case "end":
6285
- return _context47.stop();
6304
+ return _context48.stop();
6286
6305
  }
6287
- }, _callee47, this);
6306
+ }, _callee48, this);
6288
6307
  }));
6289
- function callServiceAPI(_x87, _x88) {
6308
+ function callServiceAPI(_x88, _x89) {
6290
6309
  return _callServiceAPI10.apply(this, arguments);
6291
6310
  }
6292
6311
  return callServiceAPI;
@@ -6294,15 +6313,15 @@ var Ki = /*#__PURE__*/function (_z4) {
6294
6313
  }, {
6295
6314
  key: "extractResultData",
6296
6315
  value: function () {
6297
- var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e) {
6298
- return _regeneratorRuntime().wrap(function _callee48$(_context48) {
6299
- while (1) switch (_context48.prev = _context48.next) {
6316
+ var _extractResultData14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e) {
6317
+ return _regeneratorRuntime().wrap(function _callee49$(_context49) {
6318
+ while (1) switch (_context49.prev = _context49.next) {
6300
6319
  case 0:
6301
6320
  if (!(e instanceof Blob)) {
6302
- _context48.next = 2;
6321
+ _context49.next = 2;
6303
6322
  break;
6304
6323
  }
6305
- return _context48.abrupt("return", new Promise(function (t) {
6324
+ return _context49.abrupt("return", new Promise(function (t) {
6306
6325
  var i = new FileReader();
6307
6326
  i.readAsDataURL(e), i.onload = function (s) {
6308
6327
  t({
@@ -6315,21 +6334,21 @@ var Ki = /*#__PURE__*/function (_z4) {
6315
6334
  }));
6316
6335
  case 2:
6317
6336
  if (!e.error) {
6318
- _context48.next = 4;
6337
+ _context49.next = 4;
6319
6338
  break;
6320
6339
  }
6321
6340
  throw e.error.message;
6322
6341
  case 4:
6323
- return _context48.abrupt("return", {
6342
+ return _context49.abrupt("return", {
6324
6343
  error: "error"
6325
6344
  });
6326
6345
  case 5:
6327
6346
  case "end":
6328
- return _context48.stop();
6347
+ return _context49.stop();
6329
6348
  }
6330
- }, _callee48);
6349
+ }, _callee49);
6331
6350
  }));
6332
- function extractResultData(_x89) {
6351
+ function extractResultData(_x90) {
6333
6352
  return _extractResultData14.apply(this, arguments);
6334
6353
  }
6335
6354
  return extractResultData;
@@ -6374,19 +6393,19 @@ var ei = /*#__PURE__*/function (_z5) {
6374
6393
  }, {
6375
6394
  key: "callServiceAPI",
6376
6395
  value: function () {
6377
- var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e, t, i) {
6396
+ var _callServiceAPI11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e, t, i) {
6378
6397
  var o, s, r;
6379
- return _regeneratorRuntime().wrap(function _callee49$(_context49) {
6380
- while (1) switch (_context49.prev = _context49.next) {
6398
+ return _regeneratorRuntime().wrap(function _callee50$(_context50) {
6399
+ while (1) switch (_context50.prev = _context50.next) {
6381
6400
  case 0:
6382
6401
  if ((o = this.requestSettings) != null && o.headers) {
6383
- _context49.next = 2;
6402
+ _context50.next = 2;
6384
6403
  break;
6385
6404
  }
6386
6405
  throw new Error("Request settings have not been set up");
6387
6406
  case 2:
6388
6407
  if (i != null && i[0]) {
6389
- _context49.next = 4;
6408
+ _context50.next = 4;
6390
6409
  break;
6391
6410
  }
6392
6411
  throw new Error("No file was added");
@@ -6396,11 +6415,11 @@ var ei = /*#__PURE__*/function (_z5) {
6396
6415
  _.tempRemoveContentHeader(this.requestSettings, w.request.bind(this, this, r, e), !1);
6397
6416
  case 7:
6398
6417
  case "end":
6399
- return _context49.stop();
6418
+ return _context50.stop();
6400
6419
  }
6401
- }, _callee49, this);
6420
+ }, _callee50, this);
6402
6421
  }));
6403
- function callServiceAPI(_x90, _x91, _x92) {
6422
+ function callServiceAPI(_x91, _x92, _x93) {
6404
6423
  return _callServiceAPI11.apply(this, arguments);
6405
6424
  }
6406
6425
  return callServiceAPI;
@@ -6408,26 +6427,26 @@ var ei = /*#__PURE__*/function (_z5) {
6408
6427
  }, {
6409
6428
  key: "extractResultData",
6410
6429
  value: function () {
6411
- var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(e) {
6412
- return _regeneratorRuntime().wrap(function _callee50$(_context50) {
6413
- while (1) switch (_context50.prev = _context50.next) {
6430
+ var _extractResultData15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e) {
6431
+ return _regeneratorRuntime().wrap(function _callee51$(_context51) {
6432
+ while (1) switch (_context51.prev = _context51.next) {
6414
6433
  case 0:
6415
6434
  if (!e.error) {
6416
- _context50.next = 2;
6435
+ _context51.next = 2;
6417
6436
  break;
6418
6437
  }
6419
6438
  throw e.error.message;
6420
6439
  case 2:
6421
- return _context50.abrupt("return", {
6440
+ return _context51.abrupt("return", {
6422
6441
  text: e.text
6423
6442
  });
6424
6443
  case 3:
6425
6444
  case "end":
6426
- return _context50.stop();
6445
+ return _context51.stop();
6427
6446
  }
6428
- }, _callee50);
6447
+ }, _callee51);
6429
6448
  }));
6430
- function extractResultData(_x93) {
6449
+ function extractResultData(_x94) {
6431
6450
  return _extractResultData15.apply(this, arguments);
6432
6451
  }
6433
6452
  return extractResultData;
@@ -6606,13 +6625,13 @@ var Ao = /*#__PURE__*/function (_Co) {
6606
6625
  }, {
6607
6626
  key: "callServiceAPI",
6608
6627
  value: function () {
6609
- var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(e, t) {
6628
+ var _callServiceAPI12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e, t) {
6610
6629
  var i;
6611
- return _regeneratorRuntime().wrap(function _callee51$(_context51) {
6612
- while (1) switch (_context51.prev = _context51.next) {
6630
+ return _regeneratorRuntime().wrap(function _callee52$(_context52) {
6631
+ while (1) switch (_context52.prev = _context52.next) {
6613
6632
  case 0:
6614
6633
  if (this.requestSettings) {
6615
- _context51.next = 2;
6634
+ _context52.next = 2;
6616
6635
  break;
6617
6636
  }
6618
6637
  throw new Error("Request settings have not been set up");
@@ -6621,11 +6640,11 @@ var Ao = /*#__PURE__*/function (_Co) {
6621
6640
  w.request(this, i, e), this.messages = e;
6622
6641
  case 4:
6623
6642
  case "end":
6624
- return _context51.stop();
6643
+ return _context52.stop();
6625
6644
  }
6626
- }, _callee51, this);
6645
+ }, _callee52, this);
6627
6646
  }));
6628
- function callServiceAPI(_x94, _x95) {
6647
+ function callServiceAPI(_x95, _x96) {
6629
6648
  return _callServiceAPI12.apply(this, arguments);
6630
6649
  }
6631
6650
  return callServiceAPI;
@@ -6633,13 +6652,13 @@ var Ao = /*#__PURE__*/function (_Co) {
6633
6652
  }, {
6634
6653
  key: "extractResultData",
6635
6654
  value: function () {
6636
- var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e) {
6655
+ var _extractResultData16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e) {
6637
6656
  var t, i, s;
6638
- return _regeneratorRuntime().wrap(function _callee52$(_context52) {
6639
- while (1) switch (_context52.prev = _context52.next) {
6657
+ return _regeneratorRuntime().wrap(function _callee53$(_context53) {
6658
+ while (1) switch (_context53.prev = _context53.next) {
6640
6659
  case 0:
6641
6660
  if (!e.error) {
6642
- _context52.next = 2;
6661
+ _context53.next = 2;
6643
6662
  break;
6644
6663
  }
6645
6664
  throw e.error.message;
@@ -6651,16 +6670,16 @@ var Ao = /*#__PURE__*/function (_Co) {
6651
6670
  };
6652
6671
  w.executePollRequest(this, i, s, this.messages);
6653
6672
  }
6654
- return _context52.abrupt("return", {
6673
+ return _context53.abrupt("return", {
6655
6674
  makingAnotherRequest: !0
6656
6675
  });
6657
6676
  case 4:
6658
6677
  case "end":
6659
- return _context52.stop();
6678
+ return _context53.stop();
6660
6679
  }
6661
- }, _callee52, this);
6680
+ }, _callee53, this);
6662
6681
  }));
6663
- function extractResultData(_x96) {
6682
+ function extractResultData(_x97) {
6664
6683
  return _extractResultData16.apply(this, arguments);
6665
6684
  }
6666
6685
  return extractResultData;
@@ -6668,33 +6687,33 @@ var Ao = /*#__PURE__*/function (_Co) {
6668
6687
  }, {
6669
6688
  key: "extractPollResultData",
6670
6689
  value: function () {
6671
- var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(e) {
6690
+ var _extractPollResultData4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e) {
6672
6691
  var t, _iterator, _step, i;
6673
- return _regeneratorRuntime().wrap(function _callee53$(_context53) {
6674
- while (1) switch (_context53.prev = _context53.next) {
6692
+ return _regeneratorRuntime().wrap(function _callee54$(_context54) {
6693
+ while (1) switch (_context54.prev = _context54.next) {
6675
6694
  case 0:
6676
6695
  if (!e.error) {
6677
- _context53.next = 2;
6696
+ _context54.next = 2;
6678
6697
  break;
6679
6698
  }
6680
6699
  throw e.error;
6681
6700
  case 2:
6682
6701
  if (!(e.status === "running")) {
6683
- _context53.next = 4;
6702
+ _context54.next = 4;
6684
6703
  break;
6685
6704
  }
6686
- return _context53.abrupt("return", {
6705
+ return _context54.abrupt("return", {
6687
6706
  timeoutMS: 2e3
6688
6707
  });
6689
6708
  case 4:
6690
6709
  if (!(e.errors.length > 0)) {
6691
- _context53.next = 6;
6710
+ _context54.next = 6;
6692
6711
  break;
6693
6712
  }
6694
6713
  throw e.errors[0];
6695
6714
  case 6:
6696
6715
  if (!(e.tasks.items[0].results.errors.length > 0)) {
6697
- _context53.next = 8;
6716
+ _context54.next = 8;
6698
6717
  break;
6699
6718
  }
6700
6719
  throw e.tasks.items[0].results.errors[0];
@@ -6711,16 +6730,16 @@ var Ao = /*#__PURE__*/function (_Co) {
6711
6730
  } finally {
6712
6731
  _iterator.f();
6713
6732
  }
6714
- return _context53.abrupt("return", {
6733
+ return _context54.abrupt("return", {
6715
6734
  text: t || ""
6716
6735
  });
6717
6736
  case 12:
6718
6737
  case "end":
6719
- return _context53.stop();
6738
+ return _context54.stop();
6720
6739
  }
6721
- }, _callee53);
6740
+ }, _callee54);
6722
6741
  }));
6723
- function extractPollResultData(_x97) {
6742
+ function extractPollResultData(_x98) {
6724
6743
  return _extractPollResultData4.apply(this, arguments);
6725
6744
  }
6726
6745
  return extractPollResultData;
@@ -6735,17 +6754,17 @@ var at = /*#__PURE__*/function () {
6735
6754
  _createClass(at, null, [{
6736
6755
  key: "poll",
6737
6756
  value: function () {
6738
- var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e, t) {
6757
+ var _poll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e, t) {
6739
6758
  var i, a, l, d;
6740
- return _regeneratorRuntime().wrap(function _callee54$(_context54) {
6741
- while (1) switch (_context54.prev = _context54.next) {
6759
+ return _regeneratorRuntime().wrap(function _callee55$(_context55) {
6760
+ while (1) switch (_context55.prev = _context55.next) {
6742
6761
  case 0:
6743
6762
  i = {
6744
6763
  authorization: e,
6745
6764
  "content-type": "application/json"
6746
6765
  };
6747
- _context54.t0 = "https://api.assemblyai.com/v2/transcript/";
6748
- _context54.next = 4;
6766
+ _context55.t0 = "https://api.assemblyai.com/v2/transcript/";
6767
+ _context55.next = 4;
6749
6768
  return fetch("https://api.assemblyai.com/v2/transcript", {
6750
6769
  method: "POST",
6751
6770
  body: JSON.stringify({
@@ -6754,55 +6773,55 @@ var at = /*#__PURE__*/function () {
6754
6773
  headers: i
6755
6774
  });
6756
6775
  case 4:
6757
- _context54.next = 6;
6758
- return _context54.sent.json();
6776
+ _context55.next = 6;
6777
+ return _context55.sent.json();
6759
6778
  case 6:
6760
- _context54.t1 = _context54.sent.id;
6761
- a = _context54.t0.concat.call(_context54.t0, _context54.t1);
6779
+ _context55.t1 = _context55.sent.id;
6780
+ a = _context55.t0.concat.call(_context55.t0, _context55.t1);
6762
6781
  case 8:
6763
6782
  if (l) {
6764
- _context54.next = 24;
6783
+ _context55.next = 24;
6765
6784
  break;
6766
6785
  }
6767
- _context54.next = 11;
6786
+ _context55.next = 11;
6768
6787
  return fetch(a, {
6769
6788
  headers: i
6770
6789
  });
6771
6790
  case 11:
6772
- _context54.next = 13;
6773
- return _context54.sent.json();
6791
+ _context55.next = 13;
6792
+ return _context55.sent.json();
6774
6793
  case 13:
6775
- d = _context54.sent;
6794
+ d = _context55.sent;
6776
6795
  if (!(d.status === "completed")) {
6777
- _context54.next = 18;
6796
+ _context55.next = 18;
6778
6797
  break;
6779
6798
  }
6780
6799
  l = d;
6781
- _context54.next = 22;
6800
+ _context55.next = 22;
6782
6801
  break;
6783
6802
  case 18:
6784
6803
  if (!(d.status === "error")) {
6785
- _context54.next = 20;
6804
+ _context55.next = 20;
6786
6805
  break;
6787
6806
  }
6788
6807
  throw new Error("Transcription failed: ".concat(d.error));
6789
6808
  case 20:
6790
- _context54.next = 22;
6809
+ _context55.next = 22;
6791
6810
  return new Promise(function (u) {
6792
6811
  return setTimeout(u, 3e3);
6793
6812
  });
6794
6813
  case 22:
6795
- _context54.next = 8;
6814
+ _context55.next = 8;
6796
6815
  break;
6797
6816
  case 24:
6798
- return _context54.abrupt("return", l);
6817
+ return _context55.abrupt("return", l);
6799
6818
  case 25:
6800
6819
  case "end":
6801
- return _context54.stop();
6820
+ return _context55.stop();
6802
6821
  }
6803
- }, _callee54);
6822
+ }, _callee55);
6804
6823
  }));
6805
- function poll(_x98, _x99) {
6824
+ function poll(_x99, _x100) {
6806
6825
  return _poll2.apply(this, arguments);
6807
6826
  }
6808
6827
  return poll;
@@ -6850,19 +6869,19 @@ var Ji = /*#__PURE__*/function (_z7) {
6850
6869
  _createClass(Ji, [{
6851
6870
  key: "callServiceAPI",
6852
6871
  value: function () {
6853
- var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e, t, i) {
6872
+ var _callServiceAPI13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e, t, i) {
6854
6873
  var s;
6855
- return _regeneratorRuntime().wrap(function _callee55$(_context55) {
6856
- while (1) switch (_context55.prev = _context55.next) {
6874
+ return _regeneratorRuntime().wrap(function _callee56$(_context56) {
6875
+ while (1) switch (_context56.prev = _context56.next) {
6857
6876
  case 0:
6858
6877
  if ((s = this.requestSettings) != null && s.headers) {
6859
- _context55.next = 2;
6878
+ _context56.next = 2;
6860
6879
  break;
6861
6880
  }
6862
6881
  throw new Error("Request settings have not been set up");
6863
6882
  case 2:
6864
6883
  if (i != null && i[0]) {
6865
- _context55.next = 4;
6884
+ _context56.next = 4;
6866
6885
  break;
6867
6886
  }
6868
6887
  throw new Error("No file was added");
@@ -6870,11 +6889,11 @@ var Ji = /*#__PURE__*/function (_z7) {
6870
6889
  w.request(this, i[0], e, !1);
6871
6890
  case 5:
6872
6891
  case "end":
6873
- return _context55.stop();
6892
+ return _context56.stop();
6874
6893
  }
6875
- }, _callee55, this);
6894
+ }, _callee56, this);
6876
6895
  }));
6877
- function callServiceAPI(_x100, _x101, _x102) {
6896
+ function callServiceAPI(_x101, _x102, _x103) {
6878
6897
  return _callServiceAPI13.apply(this, arguments);
6879
6898
  }
6880
6899
  return callServiceAPI;
@@ -6882,32 +6901,32 @@ var Ji = /*#__PURE__*/function (_z7) {
6882
6901
  }, {
6883
6902
  key: "extractResultData",
6884
6903
  value: function () {
6885
- var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee56(e) {
6904
+ var _extractResultData17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(e) {
6886
6905
  var s, r, t;
6887
- return _regeneratorRuntime().wrap(function _callee56$(_context56) {
6888
- while (1) switch (_context56.prev = _context56.next) {
6906
+ return _regeneratorRuntime().wrap(function _callee57$(_context57) {
6907
+ while (1) switch (_context57.prev = _context57.next) {
6889
6908
  case 0:
6890
6909
  if (!e.error) {
6891
- _context56.next = 2;
6910
+ _context57.next = 2;
6892
6911
  break;
6893
6912
  }
6894
6913
  throw e.error;
6895
6914
  case 2:
6896
6915
  t = (r = (s = this.requestSettings) == null ? void 0 : s.headers) == null ? void 0 : r.Authorization;
6897
- _context56.next = 5;
6916
+ _context57.next = 5;
6898
6917
  return at.poll(t, e.upload_url);
6899
6918
  case 5:
6900
- _context56.t0 = _context56.sent.text;
6901
- return _context56.abrupt("return", {
6902
- text: _context56.t0
6919
+ _context57.t0 = _context57.sent.text;
6920
+ return _context57.abrupt("return", {
6921
+ text: _context57.t0
6903
6922
  });
6904
6923
  case 7:
6905
6924
  case "end":
6906
- return _context56.stop();
6925
+ return _context57.stop();
6907
6926
  }
6908
- }, _callee56, this);
6927
+ }, _callee57, this);
6909
6928
  }));
6910
- function extractResultData(_x103) {
6929
+ function extractResultData(_x104) {
6911
6930
  return _extractResultData17.apply(this, arguments);
6912
6931
  }
6913
6932
  return extractResultData;
@@ -6957,13 +6976,13 @@ var ts = /*#__PURE__*/function (_es) {
6957
6976
  }, {
6958
6977
  key: "callServiceAPI",
6959
6978
  value: function () {
6960
- var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(e, t) {
6979
+ var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e, t) {
6961
6980
  var i;
6962
- return _regeneratorRuntime().wrap(function _callee57$(_context57) {
6963
- while (1) switch (_context57.prev = _context57.next) {
6981
+ return _regeneratorRuntime().wrap(function _callee58$(_context58) {
6982
+ while (1) switch (_context58.prev = _context58.next) {
6964
6983
  case 0:
6965
6984
  if (this.requestSettings) {
6966
- _context57.next = 2;
6985
+ _context58.next = 2;
6967
6986
  break;
6968
6987
  }
6969
6988
  throw new Error("Request settings have not been set up");
@@ -6972,11 +6991,11 @@ var ts = /*#__PURE__*/function (_es) {
6972
6991
  w.request(this, i, e, !1);
6973
6992
  case 4:
6974
6993
  case "end":
6975
- return _context57.stop();
6994
+ return _context58.stop();
6976
6995
  }
6977
- }, _callee57, this);
6996
+ }, _callee58, this);
6978
6997
  }));
6979
- function callServiceAPI(_x104, _x105) {
6998
+ function callServiceAPI(_x105, _x106) {
6980
6999
  return _callServiceAPI14.apply(this, arguments);
6981
7000
  }
6982
7001
  return callServiceAPI;
@@ -6984,11 +7003,11 @@ var ts = /*#__PURE__*/function (_es) {
6984
7003
  }, {
6985
7004
  key: "extractResultData",
6986
7005
  value: function () {
6987
- var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e) {
6988
- return _regeneratorRuntime().wrap(function _callee58$(_context58) {
6989
- while (1) switch (_context58.prev = _context58.next) {
7006
+ var _extractResultData18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e) {
7007
+ return _regeneratorRuntime().wrap(function _callee59$(_context59) {
7008
+ while (1) switch (_context59.prev = _context59.next) {
6990
7009
  case 0:
6991
- return _context58.abrupt("return", new Promise(function (t) {
7010
+ return _context59.abrupt("return", new Promise(function (t) {
6992
7011
  var i = new FileReader();
6993
7012
  i.readAsDataURL(e), i.onload = function (s) {
6994
7013
  t({
@@ -7001,11 +7020,11 @@ var ts = /*#__PURE__*/function (_es) {
7001
7020
  }));
7002
7021
  case 1:
7003
7022
  case "end":
7004
- return _context58.stop();
7023
+ return _context59.stop();
7005
7024
  }
7006
- }, _callee58);
7025
+ }, _callee59);
7007
7026
  }));
7008
- function extractResultData(_x106) {
7027
+ function extractResultData(_x107) {
7009
7028
  return _extractResultData18.apply(this, arguments);
7010
7029
  }
7011
7030
  return extractResultData;
@@ -7041,19 +7060,19 @@ var ns = /*#__PURE__*/function (_es2) {
7041
7060
  _createClass(Di, [{
7042
7061
  key: "callServiceAPI",
7043
7062
  value: function () {
7044
- var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(e, t, i) {
7063
+ var _callServiceAPI15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e, t, i) {
7045
7064
  var s, r;
7046
- return _regeneratorRuntime().wrap(function _callee59$(_context59) {
7047
- while (1) switch (_context59.prev = _context59.next) {
7065
+ return _regeneratorRuntime().wrap(function _callee60$(_context60) {
7066
+ while (1) switch (_context60.prev = _context60.next) {
7048
7067
  case 0:
7049
7068
  if ((s = this.requestSettings) != null && s.headers) {
7050
- _context59.next = 2;
7069
+ _context60.next = 2;
7051
7070
  break;
7052
7071
  }
7053
7072
  throw new Error("Request settings have not been set up");
7054
7073
  case 2:
7055
7074
  if (i != null && i[0]) {
7056
- _context59.next = 4;
7075
+ _context60.next = 4;
7057
7076
  break;
7058
7077
  }
7059
7078
  throw new Error("No file was added");
@@ -7061,11 +7080,11 @@ var ns = /*#__PURE__*/function (_es2) {
7061
7080
  (r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), w.request(this, i[0], e, !1);
7062
7081
  case 5:
7063
7082
  case "end":
7064
- return _context59.stop();
7083
+ return _context60.stop();
7065
7084
  }
7066
- }, _callee59, this);
7085
+ }, _callee60, this);
7067
7086
  }));
7068
- function callServiceAPI(_x107, _x108, _x109) {
7087
+ function callServiceAPI(_x108, _x109, _x110) {
7069
7088
  return _callServiceAPI15.apply(this, arguments);
7070
7089
  }
7071
7090
  return callServiceAPI;
@@ -7073,26 +7092,26 @@ var ns = /*#__PURE__*/function (_es2) {
7073
7092
  }, {
7074
7093
  key: "extractResultData",
7075
7094
  value: function () {
7076
- var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(e) {
7077
- return _regeneratorRuntime().wrap(function _callee60$(_context60) {
7078
- while (1) switch (_context60.prev = _context60.next) {
7095
+ var _extractResultData19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e) {
7096
+ return _regeneratorRuntime().wrap(function _callee61$(_context61) {
7097
+ while (1) switch (_context61.prev = _context61.next) {
7079
7098
  case 0:
7080
7099
  if (!e.error) {
7081
- _context60.next = 2;
7100
+ _context61.next = 2;
7082
7101
  break;
7083
7102
  }
7084
7103
  throw e.error;
7085
7104
  case 2:
7086
- return _context60.abrupt("return", {
7105
+ return _context61.abrupt("return", {
7087
7106
  text: e.DisplayText || ""
7088
7107
  });
7089
7108
  case 3:
7090
7109
  case "end":
7091
- return _context60.stop();
7110
+ return _context61.stop();
7092
7111
  }
7093
- }, _callee60);
7112
+ }, _callee61);
7094
7113
  }));
7095
- function extractResultData(_x110) {
7114
+ function extractResultData(_x111) {
7096
7115
  return _extractResultData19.apply(this, arguments);
7097
7116
  }
7098
7117
  return extractResultData;
@@ -7135,13 +7154,13 @@ var Lo = /*#__PURE__*/function (_z9) {
7135
7154
  }, {
7136
7155
  key: "callServiceAPI",
7137
7156
  value: function () {
7138
- var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(e, t) {
7157
+ var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e, t) {
7139
7158
  var i;
7140
- return _regeneratorRuntime().wrap(function _callee61$(_context61) {
7141
- while (1) switch (_context61.prev = _context61.next) {
7159
+ return _regeneratorRuntime().wrap(function _callee62$(_context62) {
7160
+ while (1) switch (_context62.prev = _context62.next) {
7142
7161
  case 0:
7143
7162
  if (this.requestSettings) {
7144
- _context61.next = 2;
7163
+ _context62.next = 2;
7145
7164
  break;
7146
7165
  }
7147
7166
  throw new Error("Request settings have not been set up");
@@ -7150,11 +7169,11 @@ var Lo = /*#__PURE__*/function (_z9) {
7150
7169
  w.request(this, i, e);
7151
7170
  case 4:
7152
7171
  case "end":
7153
- return _context61.stop();
7172
+ return _context62.stop();
7154
7173
  }
7155
- }, _callee61, this);
7174
+ }, _callee62, this);
7156
7175
  }));
7157
- function callServiceAPI(_x111, _x112) {
7176
+ function callServiceAPI(_x112, _x113) {
7158
7177
  return _callServiceAPI16.apply(this, arguments);
7159
7178
  }
7160
7179
  return callServiceAPI;
@@ -7162,27 +7181,27 @@ var Lo = /*#__PURE__*/function (_z9) {
7162
7181
  }, {
7163
7182
  key: "extractResultData",
7164
7183
  value: function () {
7165
- var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62(e) {
7184
+ var _extractResultData20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e) {
7166
7185
  var t;
7167
- return _regeneratorRuntime().wrap(function _callee62$(_context62) {
7168
- while (1) switch (_context62.prev = _context62.next) {
7186
+ return _regeneratorRuntime().wrap(function _callee63$(_context63) {
7187
+ while (1) switch (_context63.prev = _context63.next) {
7169
7188
  case 0:
7170
7189
  if (!Array.isArray(e)) {
7171
- _context62.next = 2;
7190
+ _context63.next = 2;
7172
7191
  break;
7173
7192
  }
7174
- return _context62.abrupt("return", {
7193
+ return _context63.abrupt("return", {
7175
7194
  text: ((t = e[0].translations) == null ? void 0 : t[0].text) || ""
7176
7195
  });
7177
7196
  case 2:
7178
7197
  throw e.error;
7179
7198
  case 3:
7180
7199
  case "end":
7181
- return _context62.stop();
7200
+ return _context63.stop();
7182
7201
  }
7183
- }, _callee62);
7202
+ }, _callee63);
7184
7203
  }));
7185
- function extractResultData(_x113) {
7204
+ function extractResultData(_x114) {
7186
7205
  return _extractResultData20.apply(this, arguments);
7187
7206
  }
7188
7207
  return extractResultData;
@@ -7249,40 +7268,40 @@ var Yi = /*#__PURE__*/function (_z10) {
7249
7268
  }, {
7250
7269
  key: "callServiceAPI",
7251
7270
  value: function () {
7252
- var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(e, t, i) {
7271
+ var _callServiceAPI17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e, t, i) {
7253
7272
  var s;
7254
- return _regeneratorRuntime().wrap(function _callee63$(_context63) {
7255
- while (1) switch (_context63.prev = _context63.next) {
7273
+ return _regeneratorRuntime().wrap(function _callee64$(_context64) {
7274
+ while (1) switch (_context64.prev = _context64.next) {
7256
7275
  case 0:
7257
7276
  if (this.requestSettings) {
7258
- _context63.next = 2;
7277
+ _context64.next = 2;
7259
7278
  break;
7260
7279
  }
7261
7280
  throw new Error("Request settings have not been set up");
7262
7281
  case 2:
7263
7282
  this.searchedForThreadId || this.searchPreviousMessagesForThreadId(e.messages);
7264
7283
  if (!i) {
7265
- _context63.next = 9;
7284
+ _context64.next = 9;
7266
7285
  break;
7267
7286
  }
7268
- _context63.next = 6;
7287
+ _context64.next = 6;
7269
7288
  return O.storeFiles(this, e, i);
7270
7289
  case 6:
7271
- _context63.t0 = _context63.sent;
7272
- _context63.next = 10;
7290
+ _context64.t0 = _context64.sent;
7291
+ _context64.next = 10;
7273
7292
  break;
7274
7293
  case 9:
7275
- _context63.t0 = void 0;
7294
+ _context64.t0 = void 0;
7276
7295
  case 10:
7277
- s = _context63.t0;
7296
+ s = _context64.t0;
7278
7297
  this.requestSettings.method = "POST", this.callService(e, t, s);
7279
7298
  case 12:
7280
7299
  case "end":
7281
- return _context63.stop();
7300
+ return _context64.stop();
7282
7301
  }
7283
- }, _callee63, this);
7302
+ }, _callee64, this);
7284
7303
  }));
7285
- function callServiceAPI(_x114, _x115, _x116) {
7304
+ function callServiceAPI(_x115, _x116, _x117) {
7286
7305
  return _callServiceAPI17.apply(this, arguments);
7287
7306
  }
7288
7307
  return callServiceAPI;
@@ -7298,34 +7317,34 @@ var Yi = /*#__PURE__*/function (_z10) {
7298
7317
  }, {
7299
7318
  key: "extractResultData",
7300
7319
  value: function () {
7301
- var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(e) {
7320
+ var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e) {
7302
7321
  var s, t, i;
7303
- return _regeneratorRuntime().wrap(function _callee64$(_context64) {
7304
- while (1) switch (_context64.prev = _context64.next) {
7322
+ return _regeneratorRuntime().wrap(function _callee65$(_context65) {
7323
+ while (1) switch (_context65.prev = _context65.next) {
7305
7324
  case 0:
7306
7325
  if (!e.error) {
7307
- _context64.next = 2;
7326
+ _context65.next = 2;
7308
7327
  break;
7309
7328
  }
7310
7329
  throw e.error.message;
7311
7330
  case 2:
7312
- _context64.next = 4;
7331
+ _context65.next = 4;
7313
7332
  return this.assignThreadAndRun(e);
7314
7333
  case 4:
7315
7334
  t = "".concat(re.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
7316
7335
  method: "GET",
7317
7336
  headers: (s = this.requestSettings) == null ? void 0 : s.headers
7318
7337
  };
7319
- return _context64.abrupt("return", (w.executePollRequest(this, t, i, this.messages), {
7338
+ return _context65.abrupt("return", (w.executePollRequest(this, t, i, this.messages), {
7320
7339
  makingAnotherRequest: !0
7321
7340
  }));
7322
7341
  case 6:
7323
7342
  case "end":
7324
- return _context64.stop();
7343
+ return _context65.stop();
7325
7344
  }
7326
- }, _callee64, this);
7345
+ }, _callee65, this);
7327
7346
  }));
7328
- function extractResultData(_x117) {
7347
+ function extractResultData(_x118) {
7329
7348
  return _extractResultData21.apply(this, arguments);
7330
7349
  }
7331
7350
  return extractResultData;
@@ -7333,32 +7352,32 @@ var Yi = /*#__PURE__*/function (_z10) {
7333
7352
  }, {
7334
7353
  key: "assignThreadAndRun",
7335
7354
  value: function () {
7336
- var _assignThreadAndRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(e) {
7355
+ var _assignThreadAndRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
7337
7356
  var t;
7338
- return _regeneratorRuntime().wrap(function _callee65$(_context65) {
7339
- while (1) switch (_context65.prev = _context65.next) {
7357
+ return _regeneratorRuntime().wrap(function _callee66$(_context66) {
7358
+ while (1) switch (_context66.prev = _context66.next) {
7340
7359
  case 0:
7341
7360
  if (!this.sessionId) {
7342
- _context65.next = 8;
7361
+ _context66.next = 8;
7343
7362
  break;
7344
7363
  }
7345
7364
  this.url = "".concat(re.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
7346
- _context65.next = 4;
7365
+ _context66.next = 4;
7347
7366
  return O.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
7348
7367
  case 4:
7349
- t = _context65.sent;
7368
+ t = _context66.sent;
7350
7369
  this.run_id = t.id;
7351
- _context65.next = 9;
7370
+ _context66.next = 9;
7352
7371
  break;
7353
7372
  case 8:
7354
7373
  this.sessionId = e.thread_id, this.run_id = e.id, this.messages && (this.messages.messages[this.messages.messages.length - 1]._sessionId = this.sessionId);
7355
7374
  case 9:
7356
7375
  case "end":
7357
- return _context65.stop();
7376
+ return _context66.stop();
7358
7377
  }
7359
- }, _callee65, this);
7378
+ }, _callee66, this);
7360
7379
  }));
7361
- function assignThreadAndRun(_x118) {
7380
+ function assignThreadAndRun(_x119) {
7362
7381
  return _assignThreadAndRun.apply(this, arguments);
7363
7382
  }
7364
7383
  return assignThreadAndRun;
@@ -7366,53 +7385,53 @@ var Yi = /*#__PURE__*/function (_z10) {
7366
7385
  }, {
7367
7386
  key: "extractPollResultData",
7368
7387
  value: function () {
7369
- var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e) {
7388
+ var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(e) {
7370
7389
  var r, t, i, s;
7371
- return _regeneratorRuntime().wrap(function _callee66$(_context66) {
7372
- while (1) switch (_context66.prev = _context66.next) {
7390
+ return _regeneratorRuntime().wrap(function _callee67$(_context67) {
7391
+ while (1) switch (_context67.prev = _context67.next) {
7373
7392
  case 0:
7374
7393
  t = e.status, i = e.required_action;
7375
7394
  if (!(t === "queued" || t === "in_progress")) {
7376
- _context66.next = 3;
7395
+ _context67.next = 3;
7377
7396
  break;
7378
7397
  }
7379
- return _context66.abrupt("return", {
7398
+ return _context67.abrupt("return", {
7380
7399
  timeoutMS: re.POLLING_TIMEOUT_MS
7381
7400
  });
7382
7401
  case 3:
7383
7402
  if (!(t === "completed" && this.messages)) {
7384
- _context66.next = 10;
7403
+ _context67.next = 10;
7385
7404
  break;
7386
7405
  }
7387
7406
  this.url = "".concat(re.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
7388
- _context66.next = 7;
7407
+ _context67.next = 7;
7389
7408
  return O.directFetch(this, {}, "GET");
7390
7409
  case 7:
7391
- _context66.t0 = _context66.sent.data[0].content[0].text.value;
7392
- _context66.t1 = this.sessionId;
7393
- return _context66.abrupt("return", {
7394
- text: _context66.t0,
7395
- _sessionId: _context66.t1
7410
+ _context67.t0 = _context67.sent.data[0].content[0].text.value;
7411
+ _context67.t1 = this.sessionId;
7412
+ return _context67.abrupt("return", {
7413
+ text: _context67.t0,
7414
+ _sessionId: _context67.t1
7396
7415
  });
7397
7416
  case 10:
7398
7417
  s = (r = i == null ? void 0 : i.submit_tool_outputs) == null ? void 0 : r.tool_calls;
7399
7418
  if (!(t === "requires_action" && s)) {
7400
- _context66.next = 15;
7419
+ _context67.next = 15;
7401
7420
  break;
7402
7421
  }
7403
- _context66.next = 14;
7422
+ _context67.next = 14;
7404
7423
  return this.handleTools(s);
7405
7424
  case 14:
7406
- return _context66.abrupt("return", _context66.sent);
7425
+ return _context67.abrupt("return", _context67.sent);
7407
7426
  case 15:
7408
7427
  throw Error("Thread run status: ".concat(t));
7409
7428
  case 16:
7410
7429
  case "end":
7411
- return _context66.stop();
7430
+ return _context67.stop();
7412
7431
  }
7413
- }, _callee66, this);
7432
+ }, _callee67, this);
7414
7433
  }));
7415
- function extractPollResultData(_x119) {
7434
+ function extractPollResultData(_x120) {
7416
7435
  return _extractPollResultData5.apply(this, arguments);
7417
7436
  }
7418
7437
  return extractPollResultData;
@@ -7420,13 +7439,13 @@ var Yi = /*#__PURE__*/function (_z10) {
7420
7439
  }, {
7421
7440
  key: "handleTools",
7422
7441
  value: function () {
7423
- var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee67(e) {
7442
+ var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(e) {
7424
7443
  var t, s;
7425
- return _regeneratorRuntime().wrap(function _callee67$(_context67) {
7426
- while (1) switch (_context67.prev = _context67.next) {
7444
+ return _regeneratorRuntime().wrap(function _callee68$(_context68) {
7445
+ while (1) switch (_context68.prev = _context68.next) {
7427
7446
  case 0:
7428
7447
  if (this._functionHandler) {
7429
- _context67.next = 2;
7448
+ _context68.next = 2;
7430
7449
  break;
7431
7450
  }
7432
7451
  throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Assistant) object.");
@@ -7437,31 +7456,31 @@ var Yi = /*#__PURE__*/function (_z10) {
7437
7456
  arguments: r["function"].arguments
7438
7457
  };
7439
7458
  });
7440
- _context67.next = 5;
7459
+ _context68.next = 5;
7441
7460
  return this._functionHandler(t);
7442
7461
  case 5:
7443
- s = _context67.sent.map(function (r, o) {
7462
+ s = _context68.sent.map(function (r, o) {
7444
7463
  return {
7445
7464
  tool_call_id: e[o].id,
7446
7465
  output: r
7447
7466
  };
7448
7467
  });
7449
7468
  this.url = "".concat(re.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
7450
- _context67.next = 9;
7469
+ _context68.next = 9;
7451
7470
  return O.directFetch(this, {
7452
7471
  tool_outputs: s
7453
7472
  }, "POST");
7454
7473
  case 9:
7455
- return _context67.abrupt("return", {
7474
+ return _context68.abrupt("return", {
7456
7475
  timeoutMS: re.POLLING_TIMEOUT_MS
7457
7476
  });
7458
7477
  case 10:
7459
7478
  case "end":
7460
- return _context67.stop();
7479
+ return _context68.stop();
7461
7480
  }
7462
- }, _callee67, this);
7481
+ }, _callee68, this);
7463
7482
  }));
7464
- function handleTools(_x120) {
7483
+ function handleTools(_x121) {
7465
7484
  return _handleTools.apply(this, arguments);
7466
7485
  }
7467
7486
  return handleTools;
@@ -7526,27 +7545,27 @@ var ti = /*#__PURE__*/function (_z11) {
7526
7545
  }, {
7527
7546
  key: "callServiceAPI",
7528
7547
  value: function () {
7529
- var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(e, t, i) {
7548
+ var _callServiceAPI18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(e, t, i) {
7530
7549
  var s, r;
7531
- return _regeneratorRuntime().wrap(function _callee68$(_context68) {
7532
- while (1) switch (_context68.prev = _context68.next) {
7550
+ return _regeneratorRuntime().wrap(function _callee69$(_context69) {
7551
+ while (1) switch (_context69.prev = _context69.next) {
7533
7552
  case 0:
7534
7553
  if ((s = this.requestSettings) != null && s.headers) {
7535
- _context68.next = 2;
7554
+ _context69.next = 2;
7536
7555
  break;
7537
7556
  }
7538
7557
  throw new Error("Request settings have not been set up");
7539
7558
  case 2:
7540
7559
  if (!(i != null && i[0])) {
7541
- _context68.next = 6;
7560
+ _context69.next = 6;
7542
7561
  break;
7543
7562
  }
7544
7563
  this.callApiWithImage(e, t, i);
7545
- _context68.next = 11;
7564
+ _context69.next = 11;
7546
7565
  break;
7547
7566
  case 6:
7548
7567
  if (this.requestSettings) {
7549
- _context68.next = 8;
7568
+ _context69.next = 8;
7550
7569
  break;
7551
7570
  }
7552
7571
  throw new Error("Request settings have not been set up");
@@ -7556,11 +7575,11 @@ var ti = /*#__PURE__*/function (_z11) {
7556
7575
  w.request(this, r, e);
7557
7576
  case 11:
7558
7577
  case "end":
7559
- return _context68.stop();
7578
+ return _context69.stop();
7560
7579
  }
7561
- }, _callee68, this);
7580
+ }, _callee69, this);
7562
7581
  }));
7563
- function callServiceAPI(_x121, _x122, _x123) {
7582
+ function callServiceAPI(_x122, _x123, _x124) {
7564
7583
  return _callServiceAPI18.apply(this, arguments);
7565
7584
  }
7566
7585
  return callServiceAPI;
@@ -7568,17 +7587,17 @@ var ti = /*#__PURE__*/function (_z11) {
7568
7587
  }, {
7569
7588
  key: "extractResultData",
7570
7589
  value: function () {
7571
- var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(e) {
7572
- return _regeneratorRuntime().wrap(function _callee69$(_context69) {
7573
- while (1) switch (_context69.prev = _context69.next) {
7590
+ var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e) {
7591
+ return _regeneratorRuntime().wrap(function _callee70$(_context70) {
7592
+ while (1) switch (_context70.prev = _context70.next) {
7574
7593
  case 0:
7575
7594
  if (!e.error) {
7576
- _context69.next = 2;
7595
+ _context70.next = 2;
7577
7596
  break;
7578
7597
  }
7579
7598
  throw e.error.message;
7580
7599
  case 2:
7581
- return _context69.abrupt("return", {
7600
+ return _context70.abrupt("return", {
7582
7601
  files: e.data.map(function (i) {
7583
7602
  return i.url ? {
7584
7603
  src: i.url,
@@ -7591,11 +7610,11 @@ var ti = /*#__PURE__*/function (_z11) {
7591
7610
  });
7592
7611
  case 3:
7593
7612
  case "end":
7594
- return _context69.stop();
7613
+ return _context70.stop();
7595
7614
  }
7596
- }, _callee69);
7615
+ }, _callee70);
7597
7616
  }));
7598
- function extractResultData(_x124) {
7617
+ function extractResultData(_x125) {
7599
7618
  return _extractResultData22.apply(this, arguments);
7600
7619
  }
7601
7620
  return extractResultData;
@@ -7674,13 +7693,13 @@ var lt = /*#__PURE__*/function (_z12) {
7674
7693
  }, {
7675
7694
  key: "callServiceAPI",
7676
7695
  value: function () {
7677
- var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e, t) {
7696
+ var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e, t) {
7678
7697
  var i, s;
7679
- return _regeneratorRuntime().wrap(function _callee70$(_context70) {
7680
- while (1) switch (_context70.prev = _context70.next) {
7698
+ return _regeneratorRuntime().wrap(function _callee71$(_context71) {
7699
+ while (1) switch (_context71.prev = _context71.next) {
7681
7700
  case 0:
7682
7701
  if (this.requestSettings) {
7683
- _context70.next = 2;
7702
+ _context71.next = 2;
7684
7703
  break;
7685
7704
  }
7686
7705
  throw new Error("Request settings have not been set up");
@@ -7689,11 +7708,11 @@ var lt = /*#__PURE__*/function (_z12) {
7689
7708
  s && (_typeof(s) != "object" || !s.simulation) || i.stream ? (i.stream = !0, T.request(this, i, e)) : w.request(this, i, e);
7690
7709
  case 4:
7691
7710
  case "end":
7692
- return _context70.stop();
7711
+ return _context71.stop();
7693
7712
  }
7694
- }, _callee70, this);
7713
+ }, _callee71, this);
7695
7714
  }));
7696
- function callServiceAPI(_x125, _x126) {
7715
+ function callServiceAPI(_x126, _x127) {
7697
7716
  return _callServiceAPI19.apply(this, arguments);
7698
7717
  }
7699
7718
  return callServiceAPI;
@@ -7701,17 +7720,17 @@ var lt = /*#__PURE__*/function (_z12) {
7701
7720
  }, {
7702
7721
  key: "extractResultData",
7703
7722
  value: function () {
7704
- var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(e, t, i) {
7705
- return _regeneratorRuntime().wrap(function _callee71$(_context71) {
7706
- while (1) switch (_context71.prev = _context71.next) {
7723
+ var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e, t, i) {
7724
+ return _regeneratorRuntime().wrap(function _callee72$(_context72) {
7725
+ while (1) switch (_context72.prev = _context72.next) {
7707
7726
  case 0:
7708
7727
  if (!e.error) {
7709
- _context71.next = 2;
7728
+ _context72.next = 2;
7710
7729
  break;
7711
7730
  }
7712
7731
  throw e.error.message;
7713
7732
  case 2:
7714
- return _context71.abrupt("return", e.choices[0].delta ? {
7733
+ return _context72.abrupt("return", e.choices[0].delta ? {
7715
7734
  text: e.choices[0].delta.content || ""
7716
7735
  } : e.choices[0].message ? e.choices[0].message.tool_calls ? this.handleTools(e.choices[0].message, t, i) : {
7717
7736
  text: e.choices[0].message.content
@@ -7720,11 +7739,11 @@ var lt = /*#__PURE__*/function (_z12) {
7720
7739
  });
7721
7740
  case 3:
7722
7741
  case "end":
7723
- return _context71.stop();
7742
+ return _context72.stop();
7724
7743
  }
7725
- }, _callee71, this);
7744
+ }, _callee72, this);
7726
7745
  }));
7727
- function extractResultData(_x127, _x128, _x129) {
7746
+ function extractResultData(_x128, _x129, _x130) {
7728
7747
  return _extractResultData23.apply(this, arguments);
7729
7748
  }
7730
7749
  return extractResultData;
@@ -7732,13 +7751,13 @@ var lt = /*#__PURE__*/function (_z12) {
7732
7751
  }, {
7733
7752
  key: "handleTools",
7734
7753
  value: function () {
7735
- var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee72(e, t, i) {
7754
+ var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e, t, i) {
7736
7755
  var a, s, r, o, l;
7737
- return _regeneratorRuntime().wrap(function _callee72$(_context72) {
7738
- while (1) switch (_context72.prev = _context72.next) {
7756
+ return _regeneratorRuntime().wrap(function _callee73$(_context73) {
7757
+ while (1) switch (_context73.prev = _context73.next) {
7739
7758
  case 0:
7740
7759
  if (!(!e.tool_calls || !t || !i || !this._functionHandler)) {
7741
- _context72.next = 2;
7760
+ _context73.next = 2;
7742
7761
  break;
7743
7762
  }
7744
7763
  throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Chat) object.");
@@ -7750,20 +7769,20 @@ var lt = /*#__PURE__*/function (_z12) {
7750
7769
  arguments: l["function"].arguments
7751
7770
  };
7752
7771
  });
7753
- _context72.next = 6;
7772
+ _context73.next = 6;
7754
7773
  return (a = this._functionHandler) == null ? void 0 : a.call(this, r);
7755
7774
  case 6:
7756
- o = _context72.sent;
7775
+ o = _context73.sent;
7757
7776
  if (!o.text) {
7758
- _context72.next = 9;
7777
+ _context73.next = 9;
7759
7778
  break;
7760
7779
  }
7761
- return _context72.abrupt("return", {
7780
+ return _context73.abrupt("return", {
7762
7781
  text: o.text
7763
7782
  });
7764
7783
  case 9:
7765
7784
  if (!(s.messages.push(e), Array.isArray(o))) {
7766
- _context72.next = 17;
7785
+ _context73.next = 17;
7767
7786
  break;
7768
7787
  }
7769
7788
  o.forEach(function (c, d) {
@@ -7776,30 +7795,30 @@ var lt = /*#__PURE__*/function (_z12) {
7776
7795
  content: c.response
7777
7796
  });
7778
7797
  }), delete s.tools, delete s.tool_choice;
7779
- _context72.next = 13;
7798
+ _context73.next = 13;
7780
7799
  return t == null ? void 0 : t(s).then(function (c) {
7781
7800
  return _.processResponseByType(c);
7782
7801
  });
7783
7802
  case 13:
7784
- l = _context72.sent;
7803
+ l = _context73.sent;
7785
7804
  if (!l.error) {
7786
- _context72.next = 16;
7805
+ _context73.next = 16;
7787
7806
  break;
7788
7807
  }
7789
7808
  throw l.error.message;
7790
7809
  case 16:
7791
- return _context72.abrupt("return", {
7810
+ return _context73.abrupt("return", {
7792
7811
  text: l.choices[0].message.content || ""
7793
7812
  });
7794
7813
  case 17:
7795
7814
  throw Error("Response object must contain a FunctionHandlerResponse object");
7796
7815
  case 18:
7797
7816
  case "end":
7798
- return _context72.stop();
7817
+ return _context73.stop();
7799
7818
  }
7800
- }, _callee72, this);
7819
+ }, _callee73, this);
7801
7820
  }));
7802
- function handleTools(_x130, _x131, _x132) {
7821
+ function handleTools(_x131, _x132, _x133) {
7803
7822
  return _handleTools2.apply(this, arguments);
7804
7823
  }
7805
7824
  return handleTools;
@@ -7871,13 +7890,13 @@ var No = /*#__PURE__*/function (_Wi3) {
7871
7890
  }, {
7872
7891
  key: "callServiceAPI",
7873
7892
  value: function () {
7874
- var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee73(e, t) {
7893
+ var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(e, t) {
7875
7894
  var i;
7876
- return _regeneratorRuntime().wrap(function _callee73$(_context73) {
7877
- while (1) switch (_context73.prev = _context73.next) {
7895
+ return _regeneratorRuntime().wrap(function _callee74$(_context74) {
7896
+ while (1) switch (_context74.prev = _context74.next) {
7878
7897
  case 0:
7879
7898
  if (this.requestSettings) {
7880
- _context73.next = 2;
7899
+ _context74.next = 2;
7881
7900
  break;
7882
7901
  }
7883
7902
  throw new Error("Request settings have not been set up");
@@ -7886,11 +7905,11 @@ var No = /*#__PURE__*/function (_Wi3) {
7886
7905
  w.request(this, i, e);
7887
7906
  case 4:
7888
7907
  case "end":
7889
- return _context73.stop();
7908
+ return _context74.stop();
7890
7909
  }
7891
- }, _callee73, this);
7910
+ }, _callee74, this);
7892
7911
  }));
7893
- function callServiceAPI(_x133, _x134) {
7912
+ function callServiceAPI(_x134, _x135) {
7894
7913
  return _callServiceAPI20.apply(this, arguments);
7895
7914
  }
7896
7915
  return callServiceAPI;
@@ -7898,26 +7917,26 @@ var No = /*#__PURE__*/function (_Wi3) {
7898
7917
  }, {
7899
7918
  key: "extractResultData",
7900
7919
  value: function () {
7901
- var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee74(e) {
7902
- return _regeneratorRuntime().wrap(function _callee74$(_context74) {
7903
- while (1) switch (_context74.prev = _context74.next) {
7920
+ var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(e) {
7921
+ return _regeneratorRuntime().wrap(function _callee75$(_context75) {
7922
+ while (1) switch (_context75.prev = _context75.next) {
7904
7923
  case 0:
7905
7924
  if (!e.message) {
7906
- _context74.next = 2;
7925
+ _context75.next = 2;
7907
7926
  break;
7908
7927
  }
7909
7928
  throw e.message;
7910
7929
  case 2:
7911
- return _context74.abrupt("return", {
7930
+ return _context75.abrupt("return", {
7912
7931
  text: e.text
7913
7932
  });
7914
7933
  case 3:
7915
7934
  case "end":
7916
- return _context74.stop();
7935
+ return _context75.stop();
7917
7936
  }
7918
- }, _callee74);
7937
+ }, _callee75);
7919
7938
  }));
7920
- function extractResultData(_x135) {
7939
+ function extractResultData(_x136) {
7921
7940
  return _extractResultData24.apply(this, arguments);
7922
7941
  }
7923
7942
  return extractResultData;
@@ -8066,36 +8085,36 @@ var Si = {
8066
8085
  }, {
8067
8086
  key: "configureInit",
8068
8087
  value: function () {
8069
- var _configureInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(e) {
8070
- return _regeneratorRuntime().wrap(function _callee75$(_context75) {
8071
- while (1) switch (_context75.prev = _context75.next) {
8088
+ var _configureInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76(e) {
8089
+ return _regeneratorRuntime().wrap(function _callee76$(_context76) {
8090
+ while (1) switch (_context76.prev = _context76.next) {
8072
8091
  case 0:
8073
8092
  if (!(this.webModel && typeof this.webModel != "boolean" && this.webModel.load)) {
8074
- _context75.next = 7;
8093
+ _context76.next = 7;
8075
8094
  break;
8076
8095
  }
8077
8096
  if (!this.webModel.load.onInit) {
8078
- _context75.next = 4;
8097
+ _context76.next = 4;
8079
8098
  break;
8080
8099
  }
8081
8100
  this.init();
8082
- return _context75.abrupt("return");
8101
+ return _context76.abrupt("return");
8083
8102
  case 4:
8084
8103
  if (!this.webModel.load.onMessage) {
8085
- _context75.next = 7;
8104
+ _context76.next = 7;
8086
8105
  break;
8087
8106
  }
8088
8107
  this._loadOnFirstMessage = !0;
8089
- return _context75.abrupt("return");
8108
+ return _context76.abrupt("return");
8090
8109
  case 7:
8091
8110
  e || this.init();
8092
8111
  case 8:
8093
8112
  case "end":
8094
- return _context75.stop();
8113
+ return _context76.stop();
8095
8114
  }
8096
- }, _callee75, this);
8115
+ }, _callee76, this);
8097
8116
  }));
8098
- function configureInit(_x136) {
8117
+ function configureInit(_x137) {
8099
8118
  return _configureInit.apply(this, arguments);
8100
8119
  }
8101
8120
  return configureInit;
@@ -8103,18 +8122,18 @@ var Si = {
8103
8122
  }, {
8104
8123
  key: "init",
8105
8124
  value: function () {
8106
- var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee76() {
8125
+ var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77() {
8107
8126
  var e;
8108
- return _regeneratorRuntime().wrap(function _callee76$(_context76) {
8109
- while (1) switch (_context76.prev = _context76.next) {
8127
+ return _regeneratorRuntime().wrap(function _callee77$(_context77) {
8128
+ while (1) switch (_context77.prev = _context77.next) {
8110
8129
  case 0:
8111
8130
  e = this.attemptToCreateChat();
8112
8131
  e && this.loadModel(e);
8113
8132
  case 2:
8114
8133
  case "end":
8115
- return _context76.stop();
8134
+ return _context77.stop();
8116
8135
  }
8117
- }, _callee76, this);
8136
+ }, _callee77, this);
8118
8137
  }));
8119
8138
  function init() {
8120
8139
  return _init.apply(this, arguments);
@@ -8166,11 +8185,11 @@ var Si = {
8166
8185
  }, {
8167
8186
  key: "loadModel",
8168
8187
  value: function () {
8169
- var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee77(e) {
8188
+ var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(e) {
8170
8189
  var _this35 = this;
8171
8190
  var i, t, _this$getConfig, s, r;
8172
- return _regeneratorRuntime().wrap(function _callee77$(_context77) {
8173
- while (1) switch (_context77.prev = _context77.next) {
8191
+ return _regeneratorRuntime().wrap(function _callee78$(_context78) {
8192
+ while (1) switch (_context78.prev = _context78.next) {
8174
8193
  case 0:
8175
8194
  A.chat = e, this._isModelLoading = !0;
8176
8195
  t = function t(s) {
@@ -8182,21 +8201,21 @@ var Si = {
8182
8201
  });
8183
8202
  };
8184
8203
  A.chat.setInitProgressCallback(t);
8185
- _context77.prev = 3;
8204
+ _context78.prev = 3;
8186
8205
  _this$getConfig = this.getConfig(), s = _this$getConfig.model, r = _this$getConfig.pConfig;
8187
- _context77.next = 7;
8206
+ _context78.next = 7;
8188
8207
  return A.chat.reload(s, {
8189
8208
  conv_config: {
8190
8209
  system: "keep responses to one sentence"
8191
8210
  }
8192
8211
  }, r);
8193
8212
  case 7:
8194
- _context77.next = 12;
8213
+ _context78.next = 12;
8195
8214
  break;
8196
8215
  case 9:
8197
- _context77.prev = 9;
8198
- _context77.t0 = _context77["catch"](3);
8199
- return _context77.abrupt("return", this.unloadChat(_context77.t0));
8216
+ _context78.prev = 9;
8217
+ _context78.t0 = _context78["catch"](3);
8218
+ return _context78.abrupt("return", this.unloadChat(_context78.t0));
8200
8219
  case 12:
8201
8220
  (i = this.addMessage) == null || i.call(this, {
8202
8221
  html: "<div>Model loaded</div>",
@@ -8205,11 +8224,11 @@ var Si = {
8205
8224
  }), this._isModelLoaded = !0, this._isModelLoading = !1;
8206
8225
  case 13:
8207
8226
  case "end":
8208
- return _context77.stop();
8227
+ return _context78.stop();
8209
8228
  }
8210
- }, _callee77, this, [[3, 9]]);
8229
+ }, _callee78, this, [[3, 9]]);
8211
8230
  }));
8212
- function loadModel(_x137) {
8231
+ function loadModel(_x138) {
8213
8232
  return _loadModel.apply(this, arguments);
8214
8233
  }
8215
8234
  return loadModel;
@@ -8217,10 +8236,10 @@ var Si = {
8217
8236
  }, {
8218
8237
  key: "generateResp",
8219
8238
  value: function () {
8220
- var _generateResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee78(e, t, i) {
8239
+ var _generateResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(e, t, i) {
8221
8240
  var s;
8222
- return _regeneratorRuntime().wrap(function _callee78$(_context78) {
8223
- while (1) switch (_context78.prev = _context78.next) {
8241
+ return _regeneratorRuntime().wrap(function _callee79$(_context79) {
8242
+ while (1) switch (_context79.prev = _context79.next) {
8224
8243
  case 0:
8225
8244
  s = t[t.length - 1].text;
8226
8245
  try {
@@ -8230,11 +8249,11 @@ var Si = {
8230
8249
  }
8231
8250
  case 2:
8232
8251
  case "end":
8233
- return _context78.stop();
8252
+ return _context79.stop();
8234
8253
  }
8235
- }, _callee78, this);
8254
+ }, _callee79, this);
8236
8255
  }));
8237
- function generateResp(_x138, _x139, _x140) {
8256
+ function generateResp(_x139, _x140, _x141) {
8238
8257
  return _generateResp.apply(this, arguments);
8239
8258
  }
8240
8259
  return generateResp;
@@ -8242,25 +8261,25 @@ var Si = {
8242
8261
  }, {
8243
8262
  key: "immediateResp",
8244
8263
  value: function () {
8245
- var _immediateResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee79(e, t, i) {
8264
+ var _immediateResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(e, t, i) {
8246
8265
  var s;
8247
- return _regeneratorRuntime().wrap(function _callee79$(_context79) {
8248
- while (1) switch (_context79.prev = _context79.next) {
8266
+ return _regeneratorRuntime().wrap(function _callee80$(_context80) {
8267
+ while (1) switch (_context80.prev = _context80.next) {
8249
8268
  case 0:
8250
- _context79.next = 2;
8269
+ _context80.next = 2;
8251
8270
  return i.generate(t, void 0, 0);
8252
8271
  case 2:
8253
- s = _context79.sent;
8272
+ s = _context80.sent;
8254
8273
  e.addNewMessage({
8255
8274
  text: s
8256
8275
  }), this.completionsHandlers.onFinish();
8257
8276
  case 4:
8258
8277
  case "end":
8259
- return _context79.stop();
8278
+ return _context80.stop();
8260
8279
  }
8261
- }, _callee79, this);
8280
+ }, _callee80, this);
8262
8281
  }));
8263
- function immediateResp(_x141, _x142, _x143) {
8282
+ function immediateResp(_x142, _x143, _x144) {
8264
8283
  return _immediateResp.apply(this, arguments);
8265
8284
  }
8266
8285
  return immediateResp;
@@ -8268,16 +8287,16 @@ var Si = {
8268
8287
  }, {
8269
8288
  key: "streamResp",
8270
8289
  value: function () {
8271
- var _streamResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80(e, t, i) {
8290
+ var _streamResp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e, t, i) {
8272
8291
  var s;
8273
- return _regeneratorRuntime().wrap(function _callee80$(_context80) {
8274
- while (1) switch (_context80.prev = _context80.next) {
8292
+ return _regeneratorRuntime().wrap(function _callee81$(_context81) {
8293
+ while (1) switch (_context81.prev = _context81.next) {
8275
8294
  case 0:
8276
8295
  this.streamHandlers.abortStream.abort = function () {
8277
8296
  i.interruptGenerate();
8278
8297
  }, this.streamHandlers.onOpen();
8279
8298
  s = new Ye(e);
8280
- _context80.next = 4;
8299
+ _context81.next = 4;
8281
8300
  return i.generate(t, function (r, o) {
8282
8301
  s.upsertStreamedMessage({
8283
8302
  text: o,
@@ -8289,11 +8308,11 @@ var Si = {
8289
8308
  this.streamHandlers.onClose();
8290
8309
  case 6:
8291
8310
  case "end":
8292
- return _context80.stop();
8311
+ return _context81.stop();
8293
8312
  }
8294
- }, _callee80, this);
8313
+ }, _callee81, this);
8295
8314
  }));
8296
- function streamResp(_x144, _x145, _x146) {
8315
+ function streamResp(_x145, _x146, _x147) {
8297
8316
  return _streamResp.apply(this, arguments);
8298
8317
  }
8299
8318
  return streamResp;
@@ -8306,34 +8325,34 @@ var Si = {
8306
8325
  }, {
8307
8326
  key: "callServiceAPI",
8308
8327
  value: function () {
8309
- var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e, t) {
8310
- return _regeneratorRuntime().wrap(function _callee81$(_context81) {
8311
- while (1) switch (_context81.prev = _context81.next) {
8328
+ var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e, t) {
8329
+ return _regeneratorRuntime().wrap(function _callee82$(_context82) {
8330
+ while (1) switch (_context82.prev = _context82.next) {
8312
8331
  case 0:
8313
8332
  if (this._isModelLoaded) {
8314
- _context81.next = 7;
8333
+ _context82.next = 7;
8315
8334
  break;
8316
8335
  }
8317
8336
  if (!this._loadOnFirstMessage) {
8318
- _context81.next = 6;
8337
+ _context82.next = 6;
8319
8338
  break;
8320
8339
  }
8321
- _context81.next = 4;
8340
+ _context82.next = 4;
8322
8341
  return this.init();
8323
8342
  case 4:
8324
- _context81.next = 7;
8343
+ _context82.next = 7;
8325
8344
  break;
8326
8345
  case 6:
8327
- return _context81.abrupt("return");
8346
+ return _context82.abrupt("return");
8328
8347
  case 7:
8329
8348
  !A.chat || this._isModelLoading || (e.addLoadingMessage(), this.generateResp(e, t, A.chat));
8330
8349
  case 8:
8331
8350
  case "end":
8332
- return _context81.stop();
8351
+ return _context82.stop();
8333
8352
  }
8334
- }, _callee81, this);
8353
+ }, _callee82, this);
8335
8354
  }));
8336
- function callServiceAPI(_x147, _x148) {
8355
+ function callServiceAPI(_x148, _x149) {
8337
8356
  return _callServiceAPI21.apply(this, arguments);
8338
8357
  }
8339
8358
  return callServiceAPI;
@@ -8341,10 +8360,10 @@ var Si = {
8341
8360
  }, {
8342
8361
  key: "unloadChat",
8343
8362
  value: function () {
8344
- var _unloadChat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e) {
8363
+ var _unloadChat = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee83(e) {
8345
8364
  var t;
8346
- return _regeneratorRuntime().wrap(function _callee82$(_context82) {
8347
- while (1) switch (_context82.prev = _context82.next) {
8365
+ return _regeneratorRuntime().wrap(function _callee83$(_context83) {
8366
+ while (1) switch (_context83.prev = _context83.next) {
8348
8367
  case 0:
8349
8368
  (t = this.addMessage) == null || t.call(this, {
8350
8369
  error: A.GENERIC_ERROR,
@@ -8353,22 +8372,22 @@ var Si = {
8353
8372
  console.error(e);
8354
8373
  this._isModelLoaded = !1;
8355
8374
  this._isModelLoading = !1;
8356
- _context82.t0 = A.chat;
8357
- if (!_context82.t0) {
8358
- _context82.next = 9;
8375
+ _context83.t0 = A.chat;
8376
+ if (!_context83.t0) {
8377
+ _context83.next = 9;
8359
8378
  break;
8360
8379
  }
8361
- _context82.next = 8;
8380
+ _context83.next = 8;
8362
8381
  return A.chat.unload();
8363
8382
  case 8:
8364
8383
  A.chat = void 0;
8365
8384
  case 9:
8366
8385
  case "end":
8367
- return _context82.stop();
8386
+ return _context83.stop();
8368
8387
  }
8369
- }, _callee82, this);
8388
+ }, _callee83, this);
8370
8389
  }));
8371
- function unloadChat(_x149) {
8390
+ function unloadChat(_x150) {
8372
8391
  return _unloadChat.apply(this, arguments);
8373
8392
  }
8374
8393
  return unloadChat;
@@ -8611,20 +8630,20 @@ var pe = /*#__PURE__*/function () {
8611
8630
  }, {
8612
8631
  key: "addNewImageMessage",
8613
8632
  value: function () {
8614
- var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee83(e, t, i) {
8633
+ var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee84(e, t, i) {
8615
8634
  var s, r;
8616
- return _regeneratorRuntime().wrap(function _callee83$(_context83) {
8617
- while (1) switch (_context83.prev = _context83.next) {
8635
+ return _regeneratorRuntime().wrap(function _callee84$(_context84) {
8636
+ while (1) switch (_context84.prev = _context84.next) {
8618
8637
  case 0:
8619
8638
  s = pe.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
8620
8639
  r.bubbleElement.appendChild(s), r.bubbleElement.classList.add("image-message"), he.addMessage(e, r, "image", i);
8621
8640
  case 2:
8622
8641
  case "end":
8623
- return _context83.stop();
8642
+ return _context84.stop();
8624
8643
  }
8625
- }, _callee83);
8644
+ }, _callee84);
8626
8645
  }));
8627
- function addNewImageMessage(_x150, _x151, _x152) {
8646
+ function addNewImageMessage(_x151, _x152, _x153) {
8628
8647
  return _addNewImageMessage.apply(this, arguments);
8629
8648
  }
8630
8649
  return addNewImageMessage;
@@ -8686,10 +8705,9 @@ var fe = /*#__PURE__*/function (_Ve) {
8686
8705
  o = t.demo;
8687
8706
  _this36._errorMessageOverrides = (a = e.errorMessages) == null ? void 0 : a.overrides, _this36._onClearMessages = Hi.onClearMessages.bind(_assertThisInitialized(_this36), e), _this36._displayLoadingMessage = fe.getDisplayLoadingMessage(e, t), _this36._permittedErrorPrefixes = s, _this36.addSetupMessageIfNeeded(e, t), _this36.populateIntroPanel(i, r, e.introPanelStyle), e.introMessage && _this36.addIntroductoryMessage(e.introMessage), e.initialMessages && _this36.populateInitialMessages(e.initialMessages), _this36._displayServiceErrorMessages = (l = e.errorMessages) == null ? void 0 : l.displayServiceErrorMessages, e.getMessages = function () {
8688
8707
  return JSON.parse(JSON.stringify(_this36.messages));
8689
- }, e.clearMessages = _this36.clearMessages.bind(_assertThisInitialized(_this36), t), e.refreshMessages = _this36.refreshTextMessages.bind(_assertThisInitialized(_this36)), e.scrollToBottom = ie.scrollToBottom.bind(_assertThisInitialized(_this36), _this36.elementRef), e.addMessage = function (c) {
8690
- var d = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
8708
+ }, e.clearMessages = _this36.clearMessages.bind(_assertThisInitialized(_this36), t), e.refreshMessages = _this36.refreshTextMessages.bind(_assertThisInitialized(_this36)), e.scrollToBottom = ie.scrollToBottom.bind(_assertThisInitialized(_this36), _this36.elementRef), e.addMessage = function (c, d) {
8691
8709
  _this36.addNewMessage(_objectSpread(_objectSpread({}, c), {}, {
8692
- sendUpdate: d
8710
+ sendUpdate: !!d
8693
8711
  }), !d);
8694
8712
  }, t.addMessage = _this36.addIOMessage.bind(_assertThisInitialized(_this36)), o && _this36.prepareDemo(o), e.textToSpeech && Lt.processConfig(e.textToSpeech, function (c) {
8695
8713
  _this36.textToSpeech = c;
@@ -8819,11 +8837,11 @@ var fe = /*#__PURE__*/function (_Ve) {
8819
8837
  }, {
8820
8838
  key: "addMultipleFiles",
8821
8839
  value: function () {
8822
- var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee84(e) {
8823
- return _regeneratorRuntime().wrap(function _callee84$(_context84) {
8824
- while (1) switch (_context84.prev = _context84.next) {
8840
+ var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85(e) {
8841
+ return _regeneratorRuntime().wrap(function _callee85$(_context85) {
8842
+ while (1) switch (_context85.prev = _context85.next) {
8825
8843
  case 0:
8826
- return _context84.abrupt("return", Promise.all((e || []).map(function (t) {
8844
+ return _context85.abrupt("return", Promise.all((e || []).map(function (t) {
8827
8845
  return new Promise(function (i) {
8828
8846
  if (!t.type || t.type === "any") {
8829
8847
  var s = t.file.name || he.DEFAULT_FILE_NAME;
@@ -8844,11 +8862,11 @@ var fe = /*#__PURE__*/function (_Ve) {
8844
8862
  })));
8845
8863
  case 1:
8846
8864
  case "end":
8847
- return _context84.stop();
8865
+ return _context85.stop();
8848
8866
  }
8849
- }, _callee84);
8867
+ }, _callee85);
8850
8868
  }));
8851
- function addMultipleFiles(_x153) {
8869
+ function addMultipleFiles(_x154) {
8852
8870
  return _addMultipleFiles.apply(this, arguments);
8853
8871
  }
8854
8872
  return addMultipleFiles;
@@ -9701,33 +9719,33 @@ var Et = /*#__PURE__*/function () {
9701
9719
  }, {
9702
9720
  key: "completePlaceholders",
9703
9721
  value: function () {
9704
- var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee86() {
9705
- return _regeneratorRuntime().wrap(function _callee86$(_context86) {
9706
- while (1) switch (_context86.prev = _context86.next) {
9722
+ var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee87() {
9723
+ return _regeneratorRuntime().wrap(function _callee87$(_context87) {
9724
+ while (1) switch (_context87.prev = _context87.next) {
9707
9725
  case 0:
9708
- _context86.next = 2;
9726
+ _context87.next = 2;
9709
9727
  return Promise.all(this._fileAttachmentsTypes.map( /*#__PURE__*/function () {
9710
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85(e) {
9728
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee86(e) {
9711
9729
  var t;
9712
- return _regeneratorRuntime().wrap(function _callee85$(_context85) {
9713
- while (1) switch (_context85.prev = _context85.next) {
9730
+ return _regeneratorRuntime().wrap(function _callee86$(_context86) {
9731
+ while (1) switch (_context86.prev = _context86.next) {
9714
9732
  case 0:
9715
- return _context85.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
9733
+ return _context86.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
9716
9734
  case 1:
9717
9735
  case "end":
9718
- return _context85.stop();
9736
+ return _context86.stop();
9719
9737
  }
9720
- }, _callee85);
9738
+ }, _callee86);
9721
9739
  }));
9722
- return function (_x154) {
9740
+ return function (_x155) {
9723
9741
  return _ref10.apply(this, arguments);
9724
9742
  };
9725
9743
  }()));
9726
9744
  case 2:
9727
9745
  case "end":
9728
- return _context86.stop();
9746
+ return _context87.stop();
9729
9747
  }
9730
- }, _callee86, this);
9748
+ }, _callee87, this);
9731
9749
  }));
9732
9750
  function completePlaceholders() {
9733
9751
  return _completePlaceholders.apply(this, arguments);
@@ -10015,26 +10033,26 @@ var _e = /*#__PURE__*/function () {
10015
10033
  }, {
10016
10034
  key: "useValidationFunc",
10017
10035
  value: function () {
10018
- var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee87(e, t, i, s) {
10036
+ var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee88(e, t, i, s) {
10019
10037
  var r, o, a, l;
10020
- return _regeneratorRuntime().wrap(function _callee87$(_context87) {
10021
- while (1) switch (_context87.prev = _context87.next) {
10038
+ return _regeneratorRuntime().wrap(function _callee88$(_context88) {
10039
+ while (1) switch (_context88.prev = _context88.next) {
10022
10040
  case 0:
10023
10041
  r = t.inputElementRef, o = r.classList.contains("text-input-placeholder") ? "" : r.textContent;
10024
- _context87.next = 3;
10042
+ _context88.next = 3;
10025
10043
  return i.completePlaceholders();
10026
10044
  case 3:
10027
10045
  a = i.getAllFileData(), l = a == null ? void 0 : a.map(function (c) {
10028
10046
  return c.file;
10029
10047
  });
10030
- return _context87.abrupt("return", _e.validate(e, s, o, l));
10048
+ return _context88.abrupt("return", _e.validate(e, s, o, l));
10031
10049
  case 5:
10032
10050
  case "end":
10033
- return _context87.stop();
10051
+ return _context88.stop();
10034
10052
  }
10035
- }, _callee87);
10053
+ }, _callee88);
10036
10054
  }));
10037
- function useValidationFunc(_x155, _x156, _x157, _x158) {
10055
+ function useValidationFunc(_x156, _x157, _x158, _x159) {
10038
10056
  return _useValidationFunc.apply(this, arguments);
10039
10057
  }
10040
10058
  return useValidationFunc;
@@ -10042,22 +10060,22 @@ var _e = /*#__PURE__*/function () {
10042
10060
  }, {
10043
10061
  key: "useValidationFuncProgrammatic",
10044
10062
  value: function () {
10045
- var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee88(e, t, i) {
10063
+ var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee89(e, t, i) {
10046
10064
  var r, s;
10047
- return _regeneratorRuntime().wrap(function _callee88$(_context88) {
10048
- while (1) switch (_context88.prev = _context88.next) {
10065
+ return _regeneratorRuntime().wrap(function _callee89$(_context89) {
10066
+ while (1) switch (_context89.prev = _context89.next) {
10049
10067
  case 0:
10050
10068
  s = (r = t.files) == null ? void 0 : r.map(function (o) {
10051
10069
  return o.file;
10052
10070
  });
10053
- return _context88.abrupt("return", _e.validate(e, i, t.text, s, !0));
10071
+ return _context89.abrupt("return", _e.validate(e, i, t.text, s, !0));
10054
10072
  case 2:
10055
10073
  case "end":
10056
- return _context88.stop();
10074
+ return _context89.stop();
10057
10075
  }
10058
- }, _callee88);
10076
+ }, _callee89);
10059
10077
  }));
10060
- function useValidationFuncProgrammatic(_x159, _x160, _x161) {
10078
+ function useValidationFuncProgrammatic(_x160, _x161, _x162) {
10061
10079
  return _useValidationFuncProgrammatic.apply(this, arguments);
10062
10080
  }
10063
10081
  return useValidationFuncProgrammatic;
@@ -10073,26 +10091,26 @@ var _e = /*#__PURE__*/function () {
10073
10091
  value: function attach(e, t, i, s, r) {
10074
10092
  var o = e.validateInput || Ae.processValidateInput(e);
10075
10093
  e._validationHandler = /*#__PURE__*/function () {
10076
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee89(a) {
10094
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee90(a) {
10077
10095
  var l;
10078
- return _regeneratorRuntime().wrap(function _callee89$(_context89) {
10079
- while (1) switch (_context89.prev = _context89.next) {
10096
+ return _regeneratorRuntime().wrap(function _callee90$(_context90) {
10097
+ while (1) switch (_context90.prev = _context90.next) {
10080
10098
  case 0:
10081
10099
  if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !_e.validateWebsocket(t, r))) {
10082
- _context89.next = 2;
10100
+ _context90.next = 2;
10083
10101
  break;
10084
10102
  }
10085
- return _context89.abrupt("return", !1);
10103
+ return _context90.abrupt("return", !1);
10086
10104
  case 2:
10087
10105
  l = o || t.canSendMessage;
10088
- return _context89.abrupt("return", l ? a ? _e.useValidationFuncProgrammatic(l, a, r) : _e.useValidationFunc(l, i, s, r) : null);
10106
+ return _context90.abrupt("return", l ? a ? _e.useValidationFuncProgrammatic(l, a, r) : _e.useValidationFunc(l, i, s, r) : null);
10089
10107
  case 4:
10090
10108
  case "end":
10091
- return _context89.stop();
10109
+ return _context90.stop();
10092
10110
  }
10093
- }, _callee89);
10111
+ }, _callee90);
10094
10112
  }));
10095
- return function (_x162) {
10113
+ return function (_x163) {
10096
10114
  return _ref11.apply(this, arguments);
10097
10115
  };
10098
10116
  }();
@@ -11048,26 +11066,26 @@ var Vt = /*#__PURE__*/function () {
11048
11066
  }, {
11049
11067
  key: "getNewSpeechConfig",
11050
11068
  value: function () {
11051
- var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee90(e, t) {
11052
- return _regeneratorRuntime().wrap(function _callee90$(_context90) {
11053
- while (1) switch (_context90.prev = _context90.next) {
11069
+ var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91(e, t) {
11070
+ return _regeneratorRuntime().wrap(function _callee91$(_context91) {
11071
+ while (1) switch (_context91.prev = _context91.next) {
11054
11072
  case 0:
11055
11073
  if (!t.region) {
11056
- _context90.next = 2;
11074
+ _context91.next = 2;
11057
11075
  break;
11058
11076
  }
11059
- return _context90.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 (i) {
11077
+ return _context91.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 (i) {
11060
11078
  return t.region ? e.fromAuthorizationToken((i == null ? void 0 : i.trim()) || "", t.region.trim()) : null;
11061
11079
  })["catch"](function (i) {
11062
11080
  return console.error(i), null;
11063
11081
  }) : null);
11064
11082
  case 2:
11065
11083
  case "end":
11066
- return _context90.stop();
11084
+ return _context91.stop();
11067
11085
  }
11068
- }, _callee90);
11086
+ }, _callee91);
11069
11087
  }));
11070
- function getNewSpeechConfig(_x163, _x164) {
11088
+ function getNewSpeechConfig(_x164, _x165) {
11071
11089
  return _getNewSpeechConfig.apply(this, arguments);
11072
11090
  }
11073
11091
  return getNewSpeechConfig;
@@ -11080,23 +11098,23 @@ var Vt = /*#__PURE__*/function () {
11080
11098
  }, {
11081
11099
  key: "get",
11082
11100
  value: function () {
11083
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91(e, t) {
11101
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee92(e, t) {
11084
11102
  var i;
11085
- return _regeneratorRuntime().wrap(function _callee91$(_context91) {
11086
- while (1) switch (_context91.prev = _context91.next) {
11103
+ return _regeneratorRuntime().wrap(function _callee92$(_context92) {
11104
+ while (1) switch (_context92.prev = _context92.next) {
11087
11105
  case 0:
11088
- _context91.next = 2;
11106
+ _context92.next = 2;
11089
11107
  return Vt.getNewSpeechConfig(e, t);
11090
11108
  case 2:
11091
- i = _context91.sent;
11092
- return _context91.abrupt("return", (i && Vt.process(i, t), i));
11109
+ i = _context92.sent;
11110
+ return _context92.abrupt("return", (i && Vt.process(i, t), i));
11093
11111
  case 4:
11094
11112
  case "end":
11095
- return _context91.stop();
11113
+ return _context92.stop();
11096
11114
  }
11097
- }, _callee91);
11115
+ }, _callee92);
11098
11116
  }));
11099
- function get(_x165, _x166) {
11117
+ function get(_x166, _x167) {
11100
11118
  return _get.apply(this, arguments);
11101
11119
  }
11102
11120
  return get;
@@ -11186,28 +11204,28 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
11186
11204
  }, {
11187
11205
  key: "startAsync",
11188
11206
  value: function () {
11189
- var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee92(e) {
11207
+ var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee93(e) {
11190
11208
  var t;
11191
- return _regeneratorRuntime().wrap(function _callee92$(_context92) {
11192
- while (1) switch (_context92.prev = _context92.next) {
11209
+ return _regeneratorRuntime().wrap(function _callee93$(_context93) {
11210
+ while (1) switch (_context93.prev = _context93.next) {
11193
11211
  case 0:
11194
- _context92.t0 = this.validate(e);
11195
- if (!_context92.t0) {
11196
- _context92.next = 6;
11212
+ _context93.t0 = this.validate(e);
11213
+ if (!_context93.t0) {
11214
+ _context93.next = 6;
11197
11215
  break;
11198
11216
  }
11199
- _context92.next = 4;
11217
+ _context93.next = 4;
11200
11218
  return this.instantiateService(e);
11201
11219
  case 4:
11202
11220
  this._translations = e == null ? void 0 : e.translations;
11203
11221
  (t = this._service) === null || t === void 0 || t.startContinuousRecognitionAsync(function () {}, this.error);
11204
11222
  case 6:
11205
11223
  case "end":
11206
- return _context92.stop();
11224
+ return _context93.stop();
11207
11225
  }
11208
- }, _callee92, this);
11226
+ }, _callee93, this);
11209
11227
  }));
11210
- function startAsync(_x167) {
11228
+ function startAsync(_x168) {
11211
11229
  return _startAsync.apply(this, arguments);
11212
11230
  }
11213
11231
  return startAsync;
@@ -11220,28 +11238,28 @@ var Wt = /*#__PURE__*/function (_ua$Speech) {
11220
11238
  }, {
11221
11239
  key: "instantiateService",
11222
11240
  value: function () {
11223
- var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee93(e) {
11241
+ var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee94(e) {
11224
11242
  var t, i, s, r;
11225
- return _regeneratorRuntime().wrap(function _callee93$(_context93) {
11226
- while (1) switch (_context93.prev = _context93.next) {
11243
+ return _regeneratorRuntime().wrap(function _callee94$(_context94) {
11244
+ while (1) switch (_context94.prev = _context94.next) {
11227
11245
  case 0:
11228
11246
  t = Wt.getAPI();
11229
11247
  i = t.AudioConfig.fromDefaultMicrophoneInput();
11230
- _context93.next = 4;
11248
+ _context94.next = 4;
11231
11249
  return In.AzureSpeechConfig.get(t.SpeechConfig, e);
11232
11250
  case 4:
11233
- s = _context93.sent;
11251
+ s = _context94.sent;
11234
11252
  if (s) {
11235
11253
  r = new t.SpeechRecognizer(s, i);
11236
11254
  this.setEvents(r), this._service = r, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
11237
11255
  } else this.error("Unable to contact Azure server");
11238
11256
  case 6:
11239
11257
  case "end":
11240
- return _context93.stop();
11258
+ return _context94.stop();
11241
11259
  }
11242
- }, _callee93, this);
11260
+ }, _callee94, this);
11243
11261
  }));
11244
- function instantiateService(_x168) {
11262
+ function instantiateService(_x169) {
11245
11263
  return _instantiateService.apply(this, arguments);
11246
11264
  }
11247
11265
  return instantiateService;
@@ -11683,12 +11701,12 @@ var mi = /*#__PURE__*/function (_xt4) {
11683
11701
  }, {
11684
11702
  key: "submitFromInput",
11685
11703
  value: function () {
11686
- var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee94() {
11704
+ var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee95() {
11687
11705
  var t, e, i;
11688
- return _regeneratorRuntime().wrap(function _callee94$(_context94) {
11689
- while (1) switch (_context94.prev = _context94.next) {
11706
+ return _regeneratorRuntime().wrap(function _callee95$(_context95) {
11707
+ while (1) switch (_context95.prev = _context95.next) {
11690
11708
  case 0:
11691
- _context94.next = 2;
11709
+ _context95.next = 2;
11692
11710
  return this._fileAttachments.completePlaceholders();
11693
11711
  case 2:
11694
11712
  e = this._fileAttachments.getAllFileData();
@@ -11704,9 +11722,9 @@ var mi = /*#__PURE__*/function (_xt4) {
11704
11722
  }
11705
11723
  case 4:
11706
11724
  case "end":
11707
- return _context94.stop();
11725
+ return _context95.stop();
11708
11726
  }
11709
- }, _callee94, this);
11727
+ }, _callee95, this);
11710
11728
  }));
11711
11729
  function submitFromInput() {
11712
11730
  return _submitFromInput.apply(this, arguments);
@@ -11716,11 +11734,11 @@ var mi = /*#__PURE__*/function (_xt4) {
11716
11734
  }, {
11717
11735
  key: "programmaticSubmit",
11718
11736
  value: function () {
11719
- var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee95(e) {
11737
+ var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e) {
11720
11738
  var _this61 = this;
11721
11739
  var t;
11722
- return _regeneratorRuntime().wrap(function _callee95$(_context95) {
11723
- while (1) switch (_context95.prev = _context95.next) {
11740
+ return _regeneratorRuntime().wrap(function _callee96$(_context96) {
11741
+ while (1) switch (_context96.prev = _context96.next) {
11724
11742
  case 0:
11725
11743
  typeof e == "string" && (e = Ae.processSubmitUserMessage(e));
11726
11744
  t = {
@@ -11736,11 +11754,11 @@ var mi = /*#__PURE__*/function (_xt4) {
11736
11754
  });
11737
11755
  case 3:
11738
11756
  case "end":
11739
- return _context95.stop();
11757
+ return _context96.stop();
11740
11758
  }
11741
- }, _callee95);
11759
+ }, _callee96);
11742
11760
  }));
11743
- function programmaticSubmit(_x169) {
11761
+ function programmaticSubmit(_x170) {
11744
11762
  return _programmaticSubmit.apply(this, arguments);
11745
11763
  }
11746
11764
  return programmaticSubmit;
@@ -11748,31 +11766,31 @@ var mi = /*#__PURE__*/function (_xt4) {
11748
11766
  }, {
11749
11767
  key: "attemptSubmit",
11750
11768
  value: function () {
11751
- var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e) {
11769
+ var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e) {
11752
11770
  var t,
11753
11771
  r,
11754
11772
  o,
11755
11773
  a,
11756
11774
  i,
11757
11775
  s,
11758
- _args96 = arguments;
11759
- return _regeneratorRuntime().wrap(function _callee96$(_context96) {
11760
- while (1) switch (_context96.prev = _context96.next) {
11776
+ _args97 = arguments;
11777
+ return _regeneratorRuntime().wrap(function _callee97$(_context97) {
11778
+ while (1) switch (_context97.prev = _context97.next) {
11761
11779
  case 0:
11762
- t = _args96.length > 1 && _args96[1] !== undefined ? _args96[1] : !1;
11763
- _context96.next = 3;
11780
+ t = _args97.length > 1 && _args97[1] !== undefined ? _args97[1] : !1;
11781
+ _context97.next = 3;
11764
11782
  return (r = this._validationHandler) == null ? void 0 : r.call(this, t ? e : void 0);
11765
11783
  case 3:
11766
- _context96.t0 = _context96.sent;
11767
- _context96.t1 = !1;
11768
- if (!(_context96.t0 === _context96.t1)) {
11769
- _context96.next = 7;
11784
+ _context97.t0 = _context97.sent;
11785
+ _context97.t1 = !1;
11786
+ if (!(_context97.t0 === _context97.t1)) {
11787
+ _context97.next = 7;
11770
11788
  break;
11771
11789
  }
11772
- return _context96.abrupt("return");
11790
+ return _context97.abrupt("return");
11773
11791
  case 7:
11774
11792
  this.changeToLoadingIcon();
11775
- _context96.next = 10;
11793
+ _context97.next = 10;
11776
11794
  return this.addNewMessage(e);
11777
11795
  case 10:
11778
11796
  this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
@@ -11783,17 +11801,17 @@ var mi = /*#__PURE__*/function (_xt4) {
11783
11801
  text: e.text === "" ? void 0 : e.text,
11784
11802
  files: i
11785
11803
  };
11786
- _context96.next = 15;
11804
+ _context97.next = 15;
11787
11805
  return this._serviceIO.callAPI(s, this._messages);
11788
11806
  case 15:
11789
11807
  (a = this._fileAttachments) == null || a.removeAllFiles();
11790
11808
  case 16:
11791
11809
  case "end":
11792
- return _context96.stop();
11810
+ return _context97.stop();
11793
11811
  }
11794
- }, _callee96, this);
11812
+ }, _callee97, this);
11795
11813
  }));
11796
- function attemptSubmit(_x170) {
11814
+ function attemptSubmit(_x171) {
11797
11815
  return _attemptSubmit.apply(this, arguments);
11798
11816
  }
11799
11817
  return attemptSubmit;
@@ -11801,35 +11819,35 @@ var mi = /*#__PURE__*/function (_xt4) {
11801
11819
  }, {
11802
11820
  key: "addNewMessage",
11803
11821
  value: function () {
11804
- var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee97(_ref12) {
11822
+ var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee98(_ref12) {
11805
11823
  var e, t, i;
11806
- return _regeneratorRuntime().wrap(function _callee97$(_context97) {
11807
- while (1) switch (_context97.prev = _context97.next) {
11824
+ return _regeneratorRuntime().wrap(function _callee98$(_context98) {
11825
+ while (1) switch (_context98.prev = _context98.next) {
11808
11826
  case 0:
11809
11827
  e = _ref12.text, t = _ref12.files;
11810
11828
  i = {
11811
11829
  role: b.USER_ROLE
11812
11830
  };
11813
11831
  e && (i.text = e);
11814
- _context97.t0 = t;
11815
- if (!_context97.t0) {
11816
- _context97.next = 8;
11832
+ _context98.t0 = t;
11833
+ if (!_context98.t0) {
11834
+ _context98.next = 8;
11817
11835
  break;
11818
11836
  }
11819
- _context97.next = 7;
11837
+ _context98.next = 7;
11820
11838
  return this._messages.addMultipleFiles(t);
11821
11839
  case 7:
11822
- i.files = _context97.sent;
11840
+ i.files = _context98.sent;
11823
11841
  case 8:
11824
11842
  this._serviceIO.sessionId && (i._sessionId = this._serviceIO.sessionId);
11825
11843
  Object.keys(i).length > 0 && this._messages.addNewMessage(i);
11826
11844
  case 10:
11827
11845
  case "end":
11828
- return _context97.stop();
11846
+ return _context98.stop();
11829
11847
  }
11830
- }, _callee97, this);
11848
+ }, _callee98, this);
11831
11849
  }));
11832
- function addNewMessage(_x171) {
11850
+ function addNewMessage(_x172) {
11833
11851
  return _addNewMessage.apply(this, arguments);
11834
11852
  }
11835
11853
  return addNewMessage;
@@ -11843,7 +11861,7 @@ var mi = /*#__PURE__*/function (_xt4) {
11843
11861
  }, {
11844
11862
  key: "changeToStopIcon",
11845
11863
  value: function changeToStopIcon() {
11846
- this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS, k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.stop), this.reapplyStateStyle("stop", ["loading", "submit"]), this.elementRef.onclick = this.stopStream.bind(this), this.status.loadingActive = !1;
11864
+ this._serviceIO.websocket || (this.elementRef.classList.remove(k.LOADING_CLASS, k.DISABLED_CLASS, k.SUBMIT_CLASS), this.elementRef.replaceChildren(this._innerElements.stop), this.reapplyStateStyle("stop", ["loading", "submit"]), this.elementRef.onclick = this.stopStream.bind(this), this.status.loadingActive = !1);
11847
11865
  }
11848
11866
  // WORK - animation needs to be lowered
11849
11867
  }, {