idmission-web-sdk 2.2.31 → 2.2.33

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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.2.31';
214
+ var webSdkVersion = '2.2.33';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9174,7 +9174,7 @@
9174
9174
  _b = _a.requireVerticalFaceCentering,
9175
9175
  requireVerticalFaceCentering = _b === void 0 ? true : _b,
9176
9176
  _c = _a.stabilityThreshold,
9177
- stabilityThreshold = _c === void 0 ? 0.85 : _c;
9177
+ stabilityThreshold = _c === void 0 ? 0.75 : _c;
9178
9178
  var face = faces[0];
9179
9179
  var faceNotDetected = faces.length === 0;
9180
9180
  var faceNotCentered = requireVerticalFaceCentering,
@@ -9285,11 +9285,10 @@
9285
9285
  };
9286
9286
  function preloadDependency(url) {
9287
9287
  return __awaiter(this, void 0, void 0, function () {
9288
- var xhr;
9289
9288
  return __generator(this, function (_a) {
9290
- xhr = new XMLHttpRequest();
9291
- return [2 /*return*/, new Promise(function (resolve) {
9292
- xhr.addEventListener('progress', function (event) {
9289
+ return [2 /*return*/, new Promise(function (resolve, reject) {
9290
+ var req = new XMLHttpRequest();
9291
+ req.addEventListener('progress', function (event) {
9293
9292
  if (!event.lengthComputable) return;
9294
9293
  progressByUrl[url] = event;
9295
9294
  document.dispatchEvent(new CustomEvent('idmission.preloadProgress', {
@@ -9300,11 +9299,12 @@
9300
9299
  }
9301
9300
  }));
9302
9301
  });
9303
- xhr.addEventListener('loadend', function () {
9304
- resolve(xhr.readyState === 4 && xhr.status === 200);
9302
+ req.addEventListener('loadend', function () {
9303
+ resolve(req.readyState === 4 && req.status === 200);
9305
9304
  });
9306
- xhr.open('GET', url, true);
9307
- xhr.send();
9305
+ req.addEventListener('error', reject);
9306
+ req.open('GET', url, true);
9307
+ req.send();
9308
9308
  })];
9309
9309
  });
9310
9310
  });
@@ -9327,8 +9327,11 @@
9327
9327
  switch (_a.label) {
9328
9328
  case 0:
9329
9329
  if (documentDetectorPreloading) return [2 /*return*/, new Promise(function (resolve) {
9330
- setInterval(function () {
9331
- if (!documentDetectorPreloading) resolve();
9330
+ var i = setInterval(function () {
9331
+ if (!documentDetectorPreloading) {
9332
+ clearInterval(i);
9333
+ resolve();
9334
+ }
9332
9335
  }, 100);
9333
9336
  })];
9334
9337
  documentDetectorPreloading = true;
@@ -9372,8 +9375,11 @@
9372
9375
  switch (_a.label) {
9373
9376
  case 0:
9374
9377
  if (focusModelPreloading) return [2 /*return*/, new Promise(function (resolve) {
9375
- setInterval(function () {
9376
- if (!focusModelPreloading) resolve();
9378
+ var i = setInterval(function () {
9379
+ if (!focusModelPreloading) {
9380
+ clearInterval(i);
9381
+ resolve();
9382
+ }
9377
9383
  }, 100);
9378
9384
  })];
9379
9385
  focusModelPreloading = true;
@@ -9417,8 +9423,11 @@
9417
9423
  switch (_a.label) {
9418
9424
  case 0:
9419
9425
  if (faceDetectorPreloading) return [2 /*return*/, new Promise(function (resolve) {
9420
- setInterval(function () {
9421
- if (!faceDetectorPreloading) resolve();
9426
+ var i = setInterval(function () {
9427
+ if (!faceDetectorPreloading) {
9428
+ clearInterval(i);
9429
+ resolve();
9430
+ }
9422
9431
  }, 100);
9423
9432
  })];
9424
9433
  faceDetectorPreloading = true;