idmission-web-sdk 1.0.340 → 1.0.342

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.
@@ -50,7 +50,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
50
50
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
51
51
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
52
52
 
53
- var webSdkVersion = '1.0.340';
53
+ var webSdkVersion = '1.0.342';
54
54
 
55
55
  function getPlatform() {
56
56
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -11863,6 +11863,7 @@ var CameraVideoTag = function CameraVideoTag(_a) {
11863
11863
  var onLoadedData = React.useCallback(function () {
11864
11864
  setVideoLoaded(true);
11865
11865
  }, [setVideoLoaded]);
11866
+ console.log('WUDebug - rendering full screen video');
11866
11867
  return /*#__PURE__*/React__default['default'].createElement(FullscreenVideoTag, {
11867
11868
  className: className,
11868
11869
  autoPlay: true,
@@ -13665,9 +13666,23 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
13665
13666
  doneBtnText: 'Done',
13666
13667
  doneBtnLoadingText: 'Verifying...'
13667
13668
  });
13668
- function onFileSelected(e) {
13669
+ React.useEffect(function () {
13670
+ var fallbackTimeout;
13671
+ if (useFallback) {
13672
+ fallbackTimeout = setTimeout(function () {
13673
+ var _a;
13674
+ (_a = fileInput.current) === null || _a === void 0 ? void 0 : _a.click();
13675
+ }, 250);
13676
+ }
13677
+ return function () {
13678
+ clearTimeout(fallbackTimeout);
13679
+ };
13680
+ }, [useFallback]);
13681
+ var onFileSelected = function onFileSelected(e) {
13669
13682
  var _a;
13683
+ console.log('WUDebug - file selected');
13670
13684
  var file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
13685
+ console.log('WUDebug - file: ', file);
13671
13686
  if (!file) return;
13672
13687
  var reader = new FileReader();
13673
13688
  reader.addEventListener('load', function (e) {
@@ -13677,8 +13692,8 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
13677
13692
  onCapture === null || onCapture === void 0 ? void 0 : onCapture(imageData);
13678
13693
  });
13679
13694
  reader.readAsDataURL(file);
13680
- }
13681
- if (usingDocumentCapture || useFallback) {
13695
+ };
13696
+ if (usingDocumentCapture) {
13682
13697
  return /*#__PURE__*/React__default['default'].createElement(DocumentCaptureWizard, {
13683
13698
  documents: [{
13684
13699
  title: verbiage.descriptionText
@@ -13692,15 +13707,31 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
13692
13707
  }
13693
13708
  });
13694
13709
  }
13710
+ if (useFallback && !image) {
13711
+ console.log('WUDebug - in fallback render', image);
13712
+ return /*#__PURE__*/React__default['default'].createElement(OverlayContainer, {
13713
+ className: classNames.container
13714
+ }, /*#__PURE__*/React__default['default'].createElement(StyledOverlayInner, {
13715
+ className: classNames.inner
13716
+ }, /*#__PURE__*/React__default['default'].createElement("input", {
13717
+ ref: fileInput,
13718
+ type: "file",
13719
+ accept: "image/*",
13720
+ capture: "user",
13721
+ onChange: onFileSelected,
13722
+ hidden: true
13723
+ })));
13724
+ }
13725
+ console.log('WUDebug - main render');
13695
13726
  return /*#__PURE__*/React__default['default'].createElement(OverlayContainer, {
13696
13727
  className: classNames.container
13697
13728
  }, /*#__PURE__*/React__default['default'].createElement(StyledOverlayInner, {
13698
13729
  className: classNames.inner
13699
- }, /*#__PURE__*/React__default['default'].createElement(Heading$6, {
13730
+ }, !useFallback && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Heading$6, {
13700
13731
  className: classNames.heading
13701
13732
  }, verbiage.headingText), /*#__PURE__*/React__default['default'].createElement(Description$1, {
13702
13733
  className: classNames.description
13703
- }, verbiage.descriptionText), image && ( /*#__PURE__*/React__default['default'].createElement(ImageContainer$5, {
13734
+ }, verbiage.descriptionText))), image && ( /*#__PURE__*/React__default['default'].createElement(ImageContainer$5, {
13704
13735
  className: classNames.imageContainer
13705
13736
  }, /*#__PURE__*/React__default['default'].createElement("img", {
13706
13737
  src: image,
@@ -14955,6 +14986,7 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
14955
14986
  }, 0);
14956
14987
  }, [logCaptureMetadata, onComplete, releaseCameraAccess, releaseCameraAccessOnExit, livenessCheckRequest, submissionResponse]);
14957
14988
  var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onDoneCallback);
14989
+ console.log('WUDebug - renderCameraFeed', renderCameraFeed);
14958
14990
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
14959
14991
  className: "flex ".concat((_c = (_b = classNames.capture) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : '')
14960
14992
  }, renderCameraFeed && ( /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
@@ -16171,8 +16203,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16171
16203
  requestedAction = _24[0],
16172
16204
  setRequestedAction = _24[1];
16173
16205
  React.useEffect(function () {
16206
+ console.log('WUDebug - idCaptureModelsEnabled, idModelsReady, cameraReady, videoLoaded, idModelError', idCaptureModelsEnabled, idModelsReady, cameraReady, videoLoaded, idModelError);
16174
16207
  if (requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
16175
16208
  if (!idCaptureModelsEnabled || !idModelsReady || !cameraReady || !videoLoaded || idModelError) return;
16209
+ console.log('WUDebug - SHOULD NOT BE HIT');
16176
16210
  animationFrame.current = requestAnimationFrame(function runFrame() {
16177
16211
  return tslib.__awaiter(this, void 0, void 0, function () {
16178
16212
  return tslib.__generator(this, function (_a) {
@@ -16210,6 +16244,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16210
16244
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
16211
16245
  React.useEffect(function () {
16212
16246
  if (!idCaptureModelsEnabled || idModelError) return;
16247
+ console.log('WUDebug - should not get here - onIdPredictionMade', idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError);
16213
16248
  onIdPredictionMade(function (prediction) {
16214
16249
  setDetectedObjects(prediction.detectedObjects);
16215
16250
  setCurrentDetectionScore(prediction.detectionScore);
@@ -16255,12 +16290,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16255
16290
  return tslib.__generator(this, function (_b) {
16256
16291
  switch (_b.label) {
16257
16292
  case 0:
16293
+ console.log('WUDebug - captureFrame');
16258
16294
  if (frameLock.current) return [2 /*return*/];
16259
16295
  frameLock.current = true;
16260
16296
  return [4 /*yield*/, takePhoto()];
16261
16297
  case 1:
16262
16298
  frame = _b.sent();
16299
+ console.log('WUDebug - frame captured');
16263
16300
  if (!frame) {
16301
+ console.log('WUDebug - frame capture FAILED');
16264
16302
  frameLock.current = false;
16265
16303
  return [2 /*return*/];
16266
16304
  }
@@ -16281,10 +16319,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16281
16319
  _b.label = 4;
16282
16320
  case 4:
16283
16321
  frameBase64 = _a;
16322
+ console.log('WUDebug - converted to base64');
16284
16323
  if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
16285
16324
  if (onIdFrontImageCaptured) {
16325
+ console.log('WUDebug - onIdFrontImageCaptured exists');
16286
16326
  frameBase64 && onIdFrontImageCaptured(frameBase64);
16327
+ console.log('WUDebug - onIdFrontImageCaptured completed');
16287
16328
  }
16329
+ console.log('WUDebug - skipShowIdCardBack, onIdBackCaptureComplete', skipShowIdCardBack, onIdBackCaptureComplete);
16288
16330
  if (!skipShowIdCardBack) return [3 /*break*/, 7];
16289
16331
  if (!(skipShowIdCardBack === true)) return [3 /*break*/, 5];
16290
16332
  return [2 /*return*/, onIdBackCaptureComplete()];
@@ -16298,15 +16340,21 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16298
16340
  case 7:
16299
16341
  setRequestedAction('FLIP_ID');
16300
16342
  setTimeout(function () {
16343
+ console.log('WUDebug - requesting to show back');
16301
16344
  setRequestedAction('SHOW_ID_BACK');
16302
16345
  }, 6000);
16303
16346
  return [3 /*break*/, 9];
16304
16347
  case 8:
16305
16348
  if (requestedAction == 'SHOW_ID_BACK') {
16349
+ console.log('WUDebug - capturing the back');
16306
16350
  if (onIdBackImageCaptured) {
16351
+ console.log('WUDebug - onIdBackImageCaptured exists');
16307
16352
  frameBase64 && onIdBackImageCaptured(frameBase64);
16353
+ console.log('WUDebug - onIdBackImageCaptured completed');
16308
16354
  }
16355
+ console.log('WUDebug - onIdBackCaptureComplete exists');
16309
16356
  onIdBackCaptureComplete();
16357
+ console.log('WUDebug - onIdBackCaptureComplete completed');
16310
16358
  }
16311
16359
  _b.label = 9;
16312
16360
  case 9:
@@ -16319,6 +16367,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16319
16367
  setCountdownStartedAt(undefined);
16320
16368
  resetBestFrame();
16321
16369
  frameLock.current = false;
16370
+ if (countdownTimeoutRef.current) {
16371
+ clearTimeout(countdownTimeoutRef.current);
16372
+ }
16322
16373
  return [7 /*endfinally*/];
16323
16374
  case 11:
16324
16375
  return [2 /*return*/];
@@ -16328,6 +16379,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16328
16379
  }, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, takePhoto]);
16329
16380
  var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
16330
16381
  React.useEffect(function () {
16382
+ console.log('WUDebug - [countdownStartedAt, satisfied]', satisfied, countdownStartedAt);
16331
16383
  if (satisfied && !countdownStartedAt) {
16332
16384
  setCountdownStartedAt(new Date());
16333
16385
  }
@@ -16338,8 +16390,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16338
16390
  };
16339
16391
  }, []);
16340
16392
  var manualCountdown = React.useCallback(function (remainingTime) {
16393
+ console.log('WUDebug - [captureFrame, countdownStartedAt, countdownTimeoutRef]', captureFrame, countdownStartedAt, countdownTimeoutRef);
16394
+ console.log('WUDebug - remainingTime', remainingTime);
16341
16395
  if (remainingTime > 0) {
16342
16396
  var nextCycle_1 = remainingTime - 1;
16397
+ console.log('WUDebug - decrementing countdown', nextCycle_1);
16343
16398
  setCountdownRemaining(nextCycle_1);
16344
16399
  countdownTimeoutRef.current = setTimeout(function () {
16345
16400
  return manualCountdown(nextCycle_1);
@@ -16347,6 +16402,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16347
16402
  return;
16348
16403
  }
16349
16404
  if (countdownStartedAt) {
16405
+ console.log('WUDebug - calling captureFrame');
16350
16406
  captureFrame();
16351
16407
  }
16352
16408
  }, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
@@ -16449,7 +16505,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
16449
16505
  }, /*#__PURE__*/React__default['default'].createElement(CaptureButton, {
16450
16506
  finished: true,
16451
16507
  onClick: function onClick() {
16452
- return setCountdownStartedAt(new Date());
16508
+ console.log('WUDebug - capture button clicked');
16509
+ setCountdownStartedAt(new Date());
16453
16510
  },
16454
16511
  disabled: !!countdownStartedAt || frameLock.current,
16455
16512
  className: classNames.captureBtn
@@ -16684,6 +16741,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
16684
16741
  className: "flex"
16685
16742
  }, /*#__PURE__*/React__default['default'].createElement(Spinner, null));
16686
16743
  }
16744
+ console.log('WUDebug - captureState', captureState);
16687
16745
  return /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsProvider, {
16688
16746
  documentDetectionModelUrl: (_c = (_b = idCaptureProps.assets) === null || _b === void 0 ? void 0 : _b.documentDetectionModelUrl) !== null && _c !== void 0 ? _c : '',
16689
16747
  focusModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.focusModelUrl) !== null && _e !== void 0 ? _e : '',