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.
package/dist/sdk2.esm.js CHANGED
@@ -201,7 +201,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
201
201
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
202
202
  };
203
203
 
204
- var webSdkVersion = '2.2.31';
204
+ var webSdkVersion = '2.2.33';
205
205
 
206
206
  function getPlatform() {
207
207
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3099,7 +3099,7 @@ function processFaceDetectorPrediction(_a) {
3099
3099
  _b = _a.requireVerticalFaceCentering,
3100
3100
  requireVerticalFaceCentering = _b === void 0 ? true : _b,
3101
3101
  _c = _a.stabilityThreshold,
3102
- stabilityThreshold = _c === void 0 ? 0.85 : _c;
3102
+ stabilityThreshold = _c === void 0 ? 0.75 : _c;
3103
3103
  var face = faces[0];
3104
3104
  var faceNotDetected = faces.length === 0;
3105
3105
  var faceNotCentered = requireVerticalFaceCentering,
@@ -3210,11 +3210,10 @@ var progressByUseCase = {
3210
3210
  };
3211
3211
  function preloadDependency(url) {
3212
3212
  return __awaiter(this, void 0, void 0, function () {
3213
- var xhr;
3214
3213
  return __generator(this, function (_a) {
3215
- xhr = new XMLHttpRequest();
3216
- return [2 /*return*/, new Promise(function (resolve) {
3217
- xhr.addEventListener('progress', function (event) {
3214
+ return [2 /*return*/, new Promise(function (resolve, reject) {
3215
+ var req = new XMLHttpRequest();
3216
+ req.addEventListener('progress', function (event) {
3218
3217
  if (!event.lengthComputable) return;
3219
3218
  progressByUrl[url] = event;
3220
3219
  document.dispatchEvent(new CustomEvent('idmission.preloadProgress', {
@@ -3225,11 +3224,12 @@ function preloadDependency(url) {
3225
3224
  }
3226
3225
  }));
3227
3226
  });
3228
- xhr.addEventListener('loadend', function () {
3229
- resolve(xhr.readyState === 4 && xhr.status === 200);
3227
+ req.addEventListener('loadend', function () {
3228
+ resolve(req.readyState === 4 && req.status === 200);
3230
3229
  });
3231
- xhr.open('GET', url, true);
3232
- xhr.send();
3230
+ req.addEventListener('error', reject);
3231
+ req.open('GET', url, true);
3232
+ req.send();
3233
3233
  })];
3234
3234
  });
3235
3235
  });
@@ -3252,8 +3252,11 @@ function preloadDocumentDetectorDependencies() {
3252
3252
  switch (_a.label) {
3253
3253
  case 0:
3254
3254
  if (documentDetectorPreloading) return [2 /*return*/, new Promise(function (resolve) {
3255
- setInterval(function () {
3256
- if (!documentDetectorPreloading) resolve();
3255
+ var i = setInterval(function () {
3256
+ if (!documentDetectorPreloading) {
3257
+ clearInterval(i);
3258
+ resolve();
3259
+ }
3257
3260
  }, 100);
3258
3261
  })];
3259
3262
  documentDetectorPreloading = true;
@@ -3297,8 +3300,11 @@ function preloadFocusModelDependencies() {
3297
3300
  switch (_a.label) {
3298
3301
  case 0:
3299
3302
  if (focusModelPreloading) return [2 /*return*/, new Promise(function (resolve) {
3300
- setInterval(function () {
3301
- if (!focusModelPreloading) resolve();
3303
+ var i = setInterval(function () {
3304
+ if (!focusModelPreloading) {
3305
+ clearInterval(i);
3306
+ resolve();
3307
+ }
3302
3308
  }, 100);
3303
3309
  })];
3304
3310
  focusModelPreloading = true;
@@ -3342,8 +3348,11 @@ function preloadFaceDetectorDependencies() {
3342
3348
  switch (_a.label) {
3343
3349
  case 0:
3344
3350
  if (faceDetectorPreloading) return [2 /*return*/, new Promise(function (resolve) {
3345
- setInterval(function () {
3346
- if (!faceDetectorPreloading) resolve();
3351
+ var i = setInterval(function () {
3352
+ if (!faceDetectorPreloading) {
3353
+ clearInterval(i);
3354
+ resolve();
3355
+ }
3347
3356
  }, 100);
3348
3357
  })];
3349
3358
  faceDetectorPreloading = true;