idmission-web-sdk 2.3.64 → 2.3.66

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.3.64';
214
+ var webSdkVersion = '2.3.66';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -8351,7 +8351,7 @@
8351
8351
 
8352
8352
  var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
8353
8353
 
8354
- var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20250111_090328.tflite");
8354
+ var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20250815_115859.tflite");
8355
8355
 
8356
8356
  var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
8357
8357
 
@@ -9175,6 +9175,9 @@
9175
9175
  setModelLoadState('warming');
9176
9176
  setModelWarmingStartedAt(new Date().getTime());
9177
9177
  clearTimeout(modelLoadTimeout);
9178
+ return [4 /*yield*/, testDocumentDetectionAgainstKnownImage(model)];
9179
+ case 1:
9180
+ _b.sent();
9178
9181
  _a = waitForVideoReady(videoRef), videoReady = _a[0], cancel = _a[1];
9179
9182
  cancelled = false;
9180
9183
  cancelVideoReady = function cancelVideoReady() {
@@ -9182,7 +9185,7 @@
9182
9185
  cancel();
9183
9186
  };
9184
9187
  return [4 /*yield*/, videoReady];
9185
- case 1:
9188
+ case 2:
9186
9189
  _b.sent();
9187
9190
  setTimeout(function () {
9188
9191
  if (cancelled) return;
@@ -9421,6 +9424,26 @@
9421
9424
  return !!obj;
9422
9425
  });
9423
9426
  }
9427
+ function testDocumentDetectionAgainstKnownImage(detector) {
9428
+ return new Promise(function (resolve, reject) {
9429
+ var img = new Image();
9430
+ img.crossOrigin = 'anonymous';
9431
+ img.onload = function () {
9432
+ var prediction = detector.detectForVideo(img, performance.now());
9433
+ if (prediction.detections.length > 0) {
9434
+ debug('document detection test result', prediction.detections);
9435
+ resolve(void 0);
9436
+ } else {
9437
+ warn('document detection test failed');
9438
+ reject(new Error('testDocumentDetectionAgainstKnownImage failed to predict'));
9439
+ }
9440
+ };
9441
+ img.onerror = function () {
9442
+ return reject(new Error('testDocumentDetectionAgainstKnownImage failed to load image'));
9443
+ };
9444
+ img.src = "".concat(DEFAULT_CDN_URL, "/id-card-test.jpg");
9445
+ });
9446
+ }
9424
9447
 
9425
9448
  function useFrameLoop(fn, options) {
9426
9449
  if (options === void 0) {
@@ -25519,7 +25542,7 @@
25519
25542
  verbiage = _7 === void 0 ? {} : _7,
25520
25543
  _8 = _a.debugMode,
25521
25544
  debugMode = _8 === void 0 ? false : _8;
25522
- var _9 = React.useContext(SubmissionContext),
25545
+ var _9 = useSubmissionContext(),
25523
25546
  passportImage = _9.passportImage,
25524
25547
  submissionStatus = _9.submissionStatus,
25525
25548
  idCaptureVideoUrl = _9.idCaptureVideoUrl,