idmission-web-sdk 2.0.4 → 2.1.1

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.
Files changed (32) hide show
  1. package/README.md +36 -28
  2. package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +3 -12
  3. package/dist/components/customer_flows/IdAndFaceValidation.d.ts +3 -12
  4. package/dist/components/customer_flows/IdValidation.d.ts +3 -12
  5. package/dist/components/customer_flows/VideoIdValidation.d.ts +3 -12
  6. package/dist/components/id_capture/CapturedDocuments.d.ts +2 -0
  7. package/dist/components/id_capture/FocusModelProvider.d.ts +2 -1
  8. package/dist/components/id_capture/IdCapture.d.ts +5 -14
  9. package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +7 -22
  10. package/dist/components/id_capture/IdCaptureStateProvider.d.ts +12 -38
  11. package/dist/components/id_capture/IdCaptureSuccess.d.ts +2 -3
  12. package/dist/components/id_capture/IdCaptureWizard.d.ts +3 -9
  13. package/dist/components/video_id/IdVideoCapture.d.ts +12 -7
  14. package/dist/components/video_id/IdVideoCaptureWizard.d.ts +3 -8
  15. package/dist/lib/models/DocumentDetection.d.ts +15 -12
  16. package/dist/lib/models/Focus.d.ts +6 -2
  17. package/dist/sdk2.cjs.development.js +774 -926
  18. package/dist/sdk2.cjs.development.js.map +1 -1
  19. package/dist/sdk2.cjs.production.js +1 -1
  20. package/dist/sdk2.cjs.production.js.map +1 -1
  21. package/dist/sdk2.esm.js +774 -926
  22. package/dist/sdk2.esm.js.map +1 -1
  23. package/dist/sdk2.umd.development.js +774 -926
  24. package/dist/sdk2.umd.development.js.map +1 -1
  25. package/dist/sdk2.umd.production.js +1 -1
  26. package/dist/sdk2.umd.production.js.map +1 -1
  27. package/dist/stories/Components/IdCapture/LicenseBackCapture.stories.d.ts +0 -48
  28. package/dist/stories/Components/IdCapture/LicenseFrontCapture.stories.d.ts +0 -45
  29. package/dist/stories/Components/IdCapture/PassportCapture.stories.d.ts +0 -47
  30. package/dist/stories/Components/IdCapture/Wizard.stories.d.ts +1 -77
  31. package/dist/version.d.ts +1 -1
  32. package/package.json +1 -1
@@ -140,7 +140,7 @@
140
140
  return cooked;
141
141
  }
142
142
 
143
- var webSdkVersion = '2.0.4';
143
+ var webSdkVersion = '2.1.1';
144
144
 
145
145
  function getPlatform() {
146
146
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -2185,10 +2185,6 @@
2185
2185
  }, [refCallback, size.width, size.height]);
2186
2186
  }
2187
2187
 
2188
- function supportsNativeBarcodeScanning() {
2189
- return 'BarcodeDetector' in window;
2190
- }
2191
-
2192
2188
  function getFrameDimensions(frame) {
2193
2189
  var frameWidth = frame.width,
2194
2190
  frameHeight = frame.height;
@@ -3062,10 +3058,14 @@
3062
3058
  });
3063
3059
  }
3064
3060
 
3065
- var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240523/model_float16.tflite";
3061
+ var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite";
3066
3062
  var defaultFocusModelLoadTimeoutMs = 45000;
3067
3063
  var defaultFocusThresholds = {
3068
- idCard: {
3064
+ idCardFront: {
3065
+ desktop: 0,
3066
+ mobile: 0.3
3067
+ },
3068
+ idCardBack: {
3069
3069
  desktop: 0,
3070
3070
  mobile: 0.3
3071
3071
  },
@@ -3686,14 +3686,19 @@
3686
3686
  });
3687
3687
  }
3688
3688
 
3689
- var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240611/model_fp16.tflite";
3689
+ var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240614/model_fp16.tflite";
3690
3690
  var defaultDocumentDetectionScoreThreshold = 0.1;
3691
3691
  var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
3692
3692
  var defaultDocumentDetectionThresholds = {
3693
- idCard: 0.8,
3694
- passport: 0.5,
3695
- mrz: 0.5,
3696
- pdf417: 0.15
3693
+ idCardFront: 0.8,
3694
+ idCardBack: 0.8,
3695
+ passport: 0.5
3696
+ };
3697
+ var documentTypeDisplayNames = {
3698
+ idCardFront: 'ID card front',
3699
+ idCardBack: 'ID card back',
3700
+ passport: 'Passport',
3701
+ none: 'None'
3697
3702
  };
3698
3703
  var detectors = {};
3699
3704
  function loadDocumentDetector(modelAssetPath, scoreThreshold) {
@@ -3848,34 +3853,33 @@
3848
3853
  return n > 0;
3849
3854
  });
3850
3855
  });
3851
- var bestIdCard = detectedObjects.find(function (obj) {
3856
+ var bestIdCardFront = detectedObjects.find(function (obj) {
3852
3857
  return obj.label === 'Document';
3853
3858
  });
3859
+ var bestIdCardBack = detectedObjects.find(function (obj) {
3860
+ return obj.label === 'Document back';
3861
+ });
3854
3862
  var bestPassportPage = detectedObjects.find(function (obj) {
3855
3863
  return obj.label === 'Passport page';
3856
3864
  });
3857
- var passportDetectionScore = (_a = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _a !== void 0 ? _a : 0;
3858
- var passportDetectionThresholdMet = passportDetectionScore >= ((_b = thresholds.passport) !== null && _b !== void 0 ? _b : 0);
3859
- var bestDocument = passportDetectionThresholdMet ? bestPassportPage : bestIdCard;
3860
- var detectionScore = (_c = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _c !== void 0 ? _c : 0;
3861
- var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : thresholds.idCard;
3865
+ var idCardFrontDetectionScore = (_a = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _a !== void 0 ? _a : 0;
3866
+ var idCardBackDetectionScore = (_b = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _b !== void 0 ? _b : 0;
3867
+ var passportDetectionScore = (_c = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _c !== void 0 ? _c : 0;
3868
+ var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_d = thresholds.idCardFront) !== null && _d !== void 0 ? _d : 0);
3869
+ var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_e = thresholds.idCardBack) !== null && _e !== void 0 ? _e : 0);
3870
+ var passportDetectionThresholdMet = passportDetectionScore >= ((_f = thresholds.passport) !== null && _f !== void 0 ? _f : 0);
3871
+ var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
3872
+ var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
3873
+ var detectionScore = (_g = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _g !== void 0 ? _g : 0;
3862
3874
  var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
3863
3875
  var detectedDocumentType = 'none';
3864
3876
  if (passportDetectionThresholdMet) {
3865
3877
  detectedDocumentType = 'passport';
3878
+ } else if (idCardBackDetectionThresholdMet) {
3879
+ detectedDocumentType = 'idCardBack';
3866
3880
  } else if (detectionThresholdMet) {
3867
- detectedDocumentType = 'idCard';
3881
+ detectedDocumentType = 'idCardFront';
3868
3882
  }
3869
- var bestMrz = detectedObjects.find(function (obj) {
3870
- return obj.label === 'MRZ';
3871
- });
3872
- var mrzDetectionScore = (_d = bestMrz === null || bestMrz === void 0 ? void 0 : bestMrz.score) !== null && _d !== void 0 ? _d : 0;
3873
- var mrzDetectionThresholdMet = mrzDetectionScore >= ((_e = thresholds.mrz) !== null && _e !== void 0 ? _e : 0);
3874
- var bestPdf417 = detectedObjects.find(function (obj) {
3875
- return obj.label === 'PDF417';
3876
- });
3877
- var pdf417DetectionScore = (_f = bestPdf417 === null || bestPdf417 === void 0 ? void 0 : bestPdf417.score) !== null && _f !== void 0 ? _f : 0;
3878
- var pdf417DetectionThresholdMet = pdf417DetectionScore >= ((_g = thresholds.pdf417) !== null && _g !== void 0 ? _g : 0);
3879
3883
  var documentInBounds = false;
3880
3884
  if (bestDocument) {
3881
3885
  var boundaryPx = 20;
@@ -3905,15 +3909,13 @@
3905
3909
  detectionTime: time,
3906
3910
  detectionThresholdMet: detectionThresholdMet,
3907
3911
  detectedDocumentType: detectedDocumentType,
3912
+ idCardFrontDetectionScore: idCardFrontDetectionScore,
3913
+ idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
3914
+ idCardBackDetectionScore: idCardBackDetectionScore,
3915
+ idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
3908
3916
  passportDetectionScore: passportDetectionScore,
3909
3917
  passportDetectionThresholdMet: passportDetectionThresholdMet,
3910
- mrzDetectionScore: mrzDetectionScore,
3911
- mrzDetectionThresholdMet: mrzDetectionThresholdMet,
3912
- pdf417DetectionScore: pdf417DetectionScore,
3913
- pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
3914
3918
  bestDocument: bestDocument,
3915
- bestMrz: bestMrz,
3916
- bestPdf417: bestPdf417,
3917
3919
  documentInBounds: documentInBounds,
3918
3920
  documentTooClose: documentTooClose,
3919
3921
  frameWidth: frameWidth,
@@ -4161,24 +4163,26 @@
4161
4163
  focusModelPath = _b === void 0 ? defaultFocusModelPath : _b,
4162
4164
  _c = _a.focusModelLoadTimeoutMs,
4163
4165
  focusModelLoadTimeoutMs = _c === void 0 ? defaultFocusModelLoadTimeoutMs : _c,
4164
- onFocusModelError = _a.onFocusModelError;
4166
+ onFocusModelError = _a.onFocusModelError,
4167
+ _d = _a.showCanvases,
4168
+ showCanvases = _d === void 0 ? false : _d;
4165
4169
  var cropCanvas = React.useRef(null);
4166
4170
  var rotateCanvas = React.useRef(null);
4167
- var _d = React.useState({}),
4168
- focusThresholds = _d[0],
4169
- setFocusThresholds = _d[1];
4170
- var _e = React.useState(0),
4171
- focusPredictionTime = _e[0],
4172
- setFocusPredictionTime = _e[1];
4173
- var _f = useLoadFocusModel({
4171
+ var _e = React.useState({}),
4172
+ focusThresholds = _e[0],
4173
+ setFocusThresholds = _e[1];
4174
+ var _f = React.useState(0),
4175
+ focusPredictionTime = _f[0],
4176
+ setFocusPredictionTime = _f[1];
4177
+ var _g = useLoadFocusModel({
4174
4178
  modelPath: focusModelPath,
4175
4179
  modelLoadTimeoutMs: focusModelLoadTimeoutMs,
4176
4180
  onModelError: onFocusModelError
4177
4181
  }),
4178
- model = _f.model,
4179
- ready = _f.ready,
4180
- modelDownloadProgress = _f.modelDownloadProgress,
4181
- modelError = _f.modelError;
4182
+ model = _g.model,
4183
+ ready = _g.ready,
4184
+ modelDownloadProgress = _g.modelDownloadProgress,
4185
+ modelError = _g.modelError;
4182
4186
  var makeFocusPrediction = React.useCallback(function (imageData, box) {
4183
4187
  if (!model.current) return null;
4184
4188
  var prediction = makeFocusModelPrediction(model.current, imageData, cropCanvas.current, rotateCanvas.current, box);
@@ -4199,13 +4203,23 @@
4199
4203
  return /*#__PURE__*/React__default['default'].createElement(FocusModelContext.Provider, {
4200
4204
  value: value
4201
4205
  }, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
4202
- ref: rotateCanvas
4206
+ ref: rotateCanvas,
4207
+ style: showCanvases ? {
4208
+ display: 'block'
4209
+ } : undefined
4203
4210
  }), /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
4204
- ref: cropCanvas
4211
+ ref: cropCanvas,
4212
+ style: showCanvases ? {
4213
+ display: 'block'
4214
+ } : undefined
4205
4215
  }), children);
4206
4216
  }
4207
4217
 
4208
4218
  var onMobile = isMobile();
4219
+ var defaultIdCaptureThresholds = {
4220
+ detection: defaultDocumentDetectionThresholds,
4221
+ focus: defaultFocusThresholds
4222
+ };
4209
4223
  var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
4210
4224
  ready: false,
4211
4225
  start: function start() {
@@ -4216,7 +4230,7 @@
4216
4230
  },
4217
4231
  modelDownloadProgress: 0,
4218
4232
  modelError: null,
4219
- thresholds: {},
4233
+ thresholds: defaultIdCaptureThresholds,
4220
4234
  setThresholds: function setThresholds() {
4221
4235
  return null;
4222
4236
  },
@@ -4231,6 +4245,10 @@
4231
4245
  },
4232
4246
  resetBestFrame: function resetBestFrame() {
4233
4247
  return null;
4248
+ },
4249
+ requiredDocumentType: 'none',
4250
+ setRequiredDocumentType: function setRequiredDocumentType() {
4251
+ return null;
4234
4252
  }
4235
4253
  });
4236
4254
  function IdCaptureModelsProviderInner(_a) {
@@ -4263,46 +4281,54 @@
4263
4281
  var bestPredictionCanvas = React.useRef(null);
4264
4282
  var bestFocusScore = React.useRef(0);
4265
4283
  var stopDetection = React.useRef(0);
4284
+ var _e = React.useState('none'),
4285
+ requiredDocumentType = _e[0],
4286
+ setRequiredDocumentType = _e[1];
4266
4287
  var thresholds = React.useMemo(function () {
4267
4288
  return __assign$1(__assign$1({}, documentDetectionThresholds), {
4268
4289
  focus: focusThresholds
4269
4290
  });
4270
4291
  }, [documentDetectionThresholds, focusThresholds]);
4271
4292
  var setThresholds = React.useCallback(function (thresholds) {
4272
- setDocumentDetectionThresholds(thresholds);
4273
- if (thresholds.focus) setFocusThresholds(thresholds.focus);
4293
+ if (thresholds.detection) {
4294
+ setDocumentDetectionThresholds(thresholds.detection);
4295
+ }
4296
+ if (thresholds.focus) {
4297
+ setFocusThresholds(thresholds.focus);
4298
+ }
4274
4299
  }, [setDocumentDetectionThresholds, setFocusThresholds]);
4275
4300
  React.useEffect(function handleDetections() {
4276
4301
  var _this = this;
4277
4302
  onDocumentDetected(function (prediction) {
4278
4303
  return __awaiter(_this, void 0, void 0, function () {
4279
- var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, focusPrediction, focusThresholdSet, focusThreshold;
4280
- var _a, _b, _c, _d, _e;
4281
- return __generator(this, function (_f) {
4304
+ var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
4305
+ var _a, _b, _c, _d, _e, _f;
4306
+ return __generator(this, function (_g) {
4282
4307
  if (!lastPredictionCanvas.current) return [2 /*return*/];
4283
4308
  stopDetectionAtStart = stopDetection.current;
4284
4309
  focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
4285
- if (prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
4286
- focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_a = prediction.bestDocument) === null || _a === void 0 ? void 0 : _a.box);
4310
+ isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType));
4311
+ if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
4312
+ focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_b = prediction.bestDocument) === null || _b === void 0 ? void 0 : _b.box);
4287
4313
  if (focusPrediction) {
4288
4314
  focusScore = focusPrediction.score;
4289
4315
  focusPredictionTime = focusPrediction.predictionTime;
4290
4316
  }
4291
- focusThresholdSet = (_b = thresholds.focus) === null || _b === void 0 ? void 0 : _b[prediction.detectedDocumentType];
4292
- focusThreshold = (_c = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _c !== void 0 ? _c : 0;
4317
+ focusThresholdSet = (_c = thresholds.focus) === null || _c === void 0 ? void 0 : _c[prediction.detectedDocumentType];
4318
+ focusThreshold = (_d = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _d !== void 0 ? _d : 0;
4293
4319
  focusThresholdMet = focusScore >= focusThreshold;
4294
4320
  if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
4295
4321
  bestFocusScore.current = focusScore;
4296
4322
  drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
4297
4323
  setBestFrameDetails({
4298
- boundingBox: (_d = prediction.bestDocument) === null || _d === void 0 ? void 0 : _d.box,
4324
+ boundingBox: (_e = prediction.bestDocument) === null || _e === void 0 ? void 0 : _e.box,
4299
4325
  documentType: prediction.detectedDocumentType,
4300
4326
  detectionScore: prediction.detectionScore,
4301
4327
  focusScore: focusScore
4302
4328
  });
4303
4329
  }
4304
4330
  }
4305
- (_e = onPredictionHandler.current) === null || _e === void 0 ? void 0 : _e.call(onPredictionHandler, __assign$1(__assign$1({}, prediction), {
4331
+ (_f = onPredictionHandler.current) === null || _f === void 0 ? void 0 : _f.call(onPredictionHandler, __assign$1(__assign$1({}, prediction), {
4306
4332
  focusScore: focusScore,
4307
4333
  focusPredictionTime: focusPredictionTime,
4308
4334
  focusThresholdMet: focusThresholdMet
@@ -4311,7 +4337,7 @@
4311
4337
  });
4312
4338
  });
4313
4339
  });
4314
- }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, thresholds.focus]);
4340
+ }, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
4315
4341
  var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
4316
4342
  React.useEffect(function handleModelErrors() {
4317
4343
  modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
@@ -4325,9 +4351,9 @@
4325
4351
  canvas: bestPredictionCanvas.current
4326
4352
  });
4327
4353
  }, [bestFrameDetails]);
4328
- var _e = React.useState(0),
4329
- canvasKey = _e[0],
4330
- setCanvasKey = _e[1];
4354
+ var _f = React.useState(0),
4355
+ canvasKey = _f[0],
4356
+ setCanvasKey = _f[1];
4331
4357
  var resetBestFrame = React.useCallback(function () {
4332
4358
  stopDetection.current += 1;
4333
4359
  setCanvasKey(function (n) {
@@ -4337,6 +4363,9 @@
4337
4363
  setBestFrameDetails(null);
4338
4364
  bestFocusScore.current = 0;
4339
4365
  }, [clearDocumentDetectionLastPredictionCanvas]);
4366
+ React.useEffect(function () {
4367
+ requiredDocumentType && resetBestFrame();
4368
+ }, [requiredDocumentType, resetBestFrame]);
4340
4369
  var value = React.useMemo(function () {
4341
4370
  return {
4342
4371
  ready: documentDetectionModelReady && focusModelReady,
@@ -4351,9 +4380,11 @@
4351
4380
  focusPredictionTime: focusPredictionTime,
4352
4381
  getBestFrame: getBestFrame,
4353
4382
  resetBestFrame: resetBestFrame,
4354
- bestFrameDetails: bestFrameDetails
4383
+ bestFrameDetails: bestFrameDetails,
4384
+ requiredDocumentType: requiredDocumentType,
4385
+ setRequiredDocumentType: setRequiredDocumentType
4355
4386
  };
4356
- }, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
4387
+ }, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
4357
4388
  return /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsContext.Provider, {
4358
4389
  value: value
4359
4390
  }, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
@@ -4404,28 +4435,20 @@
4404
4435
  videoHeight: 0,
4405
4436
  detectedObjects: [],
4406
4437
  bestDocument: undefined,
4407
- bestMrz: undefined,
4408
- bestPdf417: undefined,
4409
- documentType: 'none',
4438
+ detectedDocumentType: 'none',
4439
+ detectionThresholdMet: false,
4410
4440
  documentInBounds: false,
4411
4441
  documentTooClose: false,
4412
- documentDetectionScore: 0,
4413
- documentDetectionThresholdMet: false,
4414
- passportPageDetectionScore: 0,
4415
- passportPageDetectionThresholdMet: false,
4416
- mrzDetectionScore: 0,
4417
- mrzDetectionThresholdMet: false,
4418
- pdf417DetectionScore: 0,
4419
- pdf417DetectionThresholdMet: false,
4442
+ flipRequired: false,
4443
+ backDetectedFirst: false,
4444
+ idCardFrontDetectionScore: 0,
4445
+ idCardFrontDetectionThresholdMet: false,
4446
+ idCardBackDetectionScore: 0,
4447
+ idCardBackDetectionThresholdMet: false,
4448
+ passportDetectionScore: 0,
4449
+ passportDetectionThresholdMet: false,
4420
4450
  focusScore: 0,
4421
4451
  focusThresholdMet: false,
4422
- barcodeScanningEnabled: false,
4423
- barcodeResult: null,
4424
- waitingForBarcodeScan: false,
4425
- shouldScanBarcode: false,
4426
- autoCaptureBarcodeRequired: 'mobile',
4427
- barcodeScanFailedAttempts: 0,
4428
- maxBarcodeScanAttempts: 10,
4429
4452
  isGoodFrame: false,
4430
4453
  goodFramesCount: 0,
4431
4454
  goodFramesThreshold: 3,
@@ -4439,8 +4462,6 @@
4439
4462
  capturedDocuments: {},
4440
4463
  captureRequirement: 'idCardOrPassport',
4441
4464
  requestedDocumentType: 'idCardFront',
4442
- detectedDocumentType: 'none',
4443
- differentDocumentTypeDetections: 0,
4444
4465
  operationStartedAt: null,
4445
4466
  captureStartedAt: null
4446
4467
  };
@@ -4475,11 +4496,6 @@
4475
4496
  newState.operationStartedAt = new Date();
4476
4497
  return newState;
4477
4498
  }
4478
- case 'configureCapture':
4479
- return __assign$1(__assign$1(__assign$1({}, state), action.payload), {
4480
- capturing: false,
4481
- captureFailed: false
4482
- });
4483
4499
  case 'setRequiredDocumentType':
4484
4500
  return __assign$1(__assign$1({}, state), {
4485
4501
  requiredDocumentType: action.payload
@@ -4516,18 +4532,15 @@
4516
4532
  case 'objectsDetected':
4517
4533
  var _d = action.payload.prediction,
4518
4534
  detectedObjects = _d.detectedObjects,
4519
- detectionScore = _d.detectionScore,
4520
4535
  detectionThresholdMet = _d.detectionThresholdMet,
4521
4536
  detectedDocumentType = _d.detectedDocumentType,
4537
+ idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
4538
+ idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
4539
+ idCardBackDetectionScore = _d.idCardBackDetectionScore,
4540
+ idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
4522
4541
  passportDetectionScore = _d.passportDetectionScore,
4523
4542
  passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
4524
- mrzDetectionScore = _d.mrzDetectionScore,
4525
- mrzDetectionThresholdMet = _d.mrzDetectionThresholdMet,
4526
- pdf417DetectionScore = _d.pdf417DetectionScore,
4527
- pdf417DetectionThresholdMet = _d.pdf417DetectionThresholdMet,
4528
4543
  bestDocument = _d.bestDocument,
4529
- bestMrz = _d.bestMrz,
4530
- bestPdf417 = _d.bestPdf417,
4531
4544
  documentInBounds = _d.documentInBounds,
4532
4545
  documentTooClose = _d.documentTooClose,
4533
4546
  focusScore = _d.focusScore,
@@ -4543,84 +4556,50 @@
4543
4556
  goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
4544
4557
  }
4545
4558
  }
4546
- var barcodeScanRequired = state.autoCaptureBarcodeRequired === true || state.autoCaptureBarcodeRequired === 'mobile' && isMobile();
4547
- var shouldScanBarcode = state.barcodeScanningEnabled && pdf417DetectionThresholdMet && barcodeScanRequired;
4548
- var waitingForBarcodeScan = shouldScanBarcode && !state.barcodeResult;
4549
- var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && focusThresholdMet;
4559
+ var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
4560
+ var backDetectedFirst = state.requestedDocumentType.includes('idCardFront') && detectedDocumentType === 'idCardBack';
4561
+ var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet;
4550
4562
  var goodFramesCount = state.goodFramesCount;
4551
4563
  if (isGoodFrame) {
4552
4564
  goodFramesCount += 1;
4553
4565
  }
4566
+ var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
4567
+ var requestedDocumentType = state.requestedDocumentType;
4568
+ if (state.captureRequirement === 'idCardOrPassport') {
4569
+ if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
4570
+ requestedDocumentType = 'passport';
4571
+ }
4572
+ if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
4573
+ requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
4574
+ }
4575
+ }
4554
4576
  return __assign$1(__assign$1({}, state), {
4555
4577
  videoWidth: frameWidth,
4556
4578
  videoHeight: frameHeight,
4557
4579
  detectedObjects: detectedObjects,
4558
4580
  bestDocument: bestDocument,
4559
- bestMrz: bestMrz,
4560
- bestPdf417: bestPdf417,
4561
- documentType: detectedDocumentType,
4581
+ requestedDocumentType: requestedDocumentType,
4582
+ detectedDocumentType: detectedDocumentType,
4583
+ detectionThresholdMet: detectionThresholdMet,
4562
4584
  documentInBounds: documentInBounds,
4563
4585
  documentTooClose: documentTooClose,
4564
- documentDetectionScore: detectionScore,
4565
- documentDetectionThresholdMet: detectionThresholdMet,
4566
- mrzDetectionScore: mrzDetectionScore,
4567
- mrzDetectionThresholdMet: mrzDetectionThresholdMet,
4568
- pdf417DetectionScore: pdf417DetectionScore,
4569
- pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
4570
- passportPageDetectionScore: passportDetectionScore,
4571
- passportPageDetectionThresholdMet: passportDetectionThresholdMet,
4586
+ flipRequired: flipRequired,
4587
+ backDetectedFirst: backDetectedFirst,
4588
+ idCardFrontDetectionScore: idCardFrontDetectionScore,
4589
+ idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
4590
+ idCardBackDetectionScore: idCardBackDetectionScore,
4591
+ idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
4592
+ passportDetectionScore: passportDetectionScore,
4593
+ passportDetectionThresholdMet: passportDetectionThresholdMet,
4572
4594
  focusScore: focusScore,
4573
4595
  focusThresholdMet: focusThresholdMet,
4574
- shouldScanBarcode: shouldScanBarcode,
4575
- waitingForBarcodeScan: waitingForBarcodeScan,
4576
4596
  isGoodFrame: isGoodFrame,
4577
4597
  goodFramesCount: goodFramesCount,
4578
4598
  goodFramesThreshold: goodFramesThreshold,
4579
- goodFramesThresholdMet: goodFramesCount >= goodFramesThreshold,
4599
+ goodFramesThresholdMet: goodFramesThresholdMet,
4580
4600
  lastFrameCapturedAt: frameCapturedAt,
4581
4601
  frameCaptureRate: frameCaptureRate
4582
4602
  });
4583
- case 'predictionMade':
4584
- {
4585
- var _e = action.payload,
4586
- detectedDocumentType_1 = _e.detectedDocumentType,
4587
- passportDetectionScore_1 = _e.passportDetectionScore;
4588
- var requestedDocumentType = state.requestedDocumentType;
4589
- var newState = __assign$1(__assign$1({}, state), {
4590
- detectedDocumentType: detectedDocumentType_1
4591
- });
4592
- if (state.captureRequirement === 'idCardOrPassport') {
4593
- var predictionIsRequestedType = requestedDocumentType.startsWith(detectedDocumentType_1);
4594
- if (predictionIsRequestedType) {
4595
- newState.differentDocumentTypeDetections = 0;
4596
- }
4597
- if (detectedDocumentType_1 === 'passport' && requestedDocumentType !== 'passport') {
4598
- newState.requestedDocumentType = 'passport';
4599
- }
4600
- if (requestedDocumentType === 'passport' && passportDetectionScore_1 < 0.3) {
4601
- newState.requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
4602
- }
4603
- }
4604
- return newState;
4605
- }
4606
- case 'barcodeScanned':
4607
- return __assign$1(__assign$1({}, state), {
4608
- barcodeResult: action.payload.result,
4609
- waitingForBarcodeScan: false,
4610
- autoCaptureBarcodeRequired: false
4611
- });
4612
- case 'barcodeScanFailed':
4613
- {
4614
- var newState = __assign$1(__assign$1({}, state), {
4615
- barcodeScanFailedAttempts: state.barcodeScanFailedAttempts + 1
4616
- });
4617
- if (newState.barcodeScanFailedAttempts >= newState.maxBarcodeScanAttempts) {
4618
- newState.autoCaptureBarcodeRequired = false;
4619
- newState.shouldScanBarcode = false;
4620
- newState.waitingForBarcodeScan = false;
4621
- }
4622
- return newState;
4623
- }
4624
4603
  case 'captureStarted':
4625
4604
  return __assign$1(__assign$1({}, state), {
4626
4605
  captureStartedAt: new Date(),
@@ -4672,8 +4651,9 @@
4672
4651
  newState_1.requestedDocumentType = remainingRequirements[0];
4673
4652
  if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
4674
4653
  newState_1.captureState = 'requestingFlip';
4675
- newState_1.documentDetectionThresholdMet = false;
4676
- newState_1.passportPageDetectionThresholdMet = false;
4654
+ newState_1.idCardFrontDetectionThresholdMet = false;
4655
+ newState_1.idCardBackDetectionThresholdMet = false;
4656
+ newState_1.passportDetectionThresholdMet = false;
4677
4657
  }
4678
4658
  }
4679
4659
  return newState_1;
@@ -4704,8 +4684,9 @@
4704
4684
  newState_2.requestedDocumentType = remainingRequirements[0];
4705
4685
  if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
4706
4686
  newState_2.captureState = 'requestingFlip';
4707
- newState_2.documentDetectionThresholdMet = false;
4708
- newState_2.passportPageDetectionThresholdMet = false;
4687
+ newState_2.idCardFrontDetectionThresholdMet = false;
4688
+ newState_2.idCardBackDetectionThresholdMet = false;
4689
+ newState_2.passportDetectionThresholdMet = false;
4709
4690
  }
4710
4691
  }
4711
4692
  return newState_2;
@@ -7835,85 +7816,42 @@
7835
7816
  var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
7836
7817
 
7837
7818
  var IdCapture = function IdCapture(_a) {
7838
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
7819
+ var _b, _c, _d, _e, _f, _g, _h, _j;
7839
7820
  var requiredDocumentType = _a.requiredDocumentType,
7840
- _m = _a.autoCaptureEnabled,
7841
- autoCaptureEnabled = _m === void 0 ? true : _m,
7842
- _o = _a.autoCaptureBarcodeRequired,
7843
- autoCaptureBarcodeRequired = _o === void 0 ? 'mobile' : _o,
7844
- _p = _a.idCardDetectionThreshold,
7845
- idCardDetectionThreshold = _p === void 0 ? defaultDocumentDetectionThresholds.idCard : _p,
7846
- _q = _a.passportDetectionThreshold,
7847
- passportDetectionThreshold = _q === void 0 ? defaultDocumentDetectionThresholds.passport : _q,
7848
- _r = _a.mrzDetectionScoreThreshold,
7849
- mrzDetectionScoreThreshold = _r === void 0 ? defaultDocumentDetectionThresholds.mrz : _r,
7850
- _s = _a.pdf417DetectionThreshold,
7851
- pdf417DetectionThreshold = _s === void 0 ? defaultDocumentDetectionThresholds.pdf417 : _s,
7852
- _t = _a.idCardFocusScoreThreshold,
7853
- idCardFocusScoreThreshold = _t === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _t,
7854
- _u = _a.passportFocusScoreThreshold,
7855
- passportFocusScoreThreshold = _u === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _u,
7856
- _v = _a.barcodeScanningEnabled,
7857
- barcodeScanningEnabled = _v === void 0 ? true : _v,
7858
- _w = _a.maxBarcodeScanAttempts,
7859
- maxBarcodeScanAttempts = _w === void 0 ? 10 : _w,
7821
+ _k = _a.thresholds,
7822
+ thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
7860
7823
  guidanceMessage = _a.guidanceMessage,
7861
7824
  guidanceSatisfied = _a.guidanceSatisfied,
7862
- onPrediction = _a.onPrediction,
7863
7825
  onCapture = _a.onCapture,
7864
- _x = _a.assets,
7865
- assets = _x === void 0 ? {} : _x,
7866
- _y = _a.classNames,
7867
- classNames = _y === void 0 ? {} : _y,
7868
- _z = _a.colors,
7869
- colors = _z === void 0 ? {} : _z,
7870
- _0 = _a.verbiage,
7871
- rawVerbiage = _0 === void 0 ? {} : _0,
7872
- _1 = _a.debugMode,
7873
- debugMode = _1 === void 0 ? false : _1;
7874
- var _2 = useResizeObserver(),
7875
- ref = _2.ref,
7876
- _3 = _2.width,
7877
- width = _3 === void 0 ? 1 : _3,
7878
- _4 = _2.height,
7879
- height = _4 === void 0 ? 1 : _4;
7880
- var _5 = useIdCaptureState(),
7881
- state = _5[0],
7882
- dispatch = _5[1];
7826
+ _l = _a.assets,
7827
+ assets = _l === void 0 ? {} : _l,
7828
+ _m = _a.classNames,
7829
+ classNames = _m === void 0 ? {} : _m,
7830
+ _o = _a.colors,
7831
+ colors = _o === void 0 ? {} : _o,
7832
+ _p = _a.verbiage,
7833
+ rawVerbiage = _p === void 0 ? {} : _p,
7834
+ _q = _a.debugMode,
7835
+ debugMode = _q === void 0 ? false : _q;
7836
+ var _r = useResizeObserver(),
7837
+ ref = _r.ref,
7838
+ _s = _r.width,
7839
+ width = _s === void 0 ? 1 : _s,
7840
+ _t = _r.height,
7841
+ height = _t === void 0 ? 1 : _t;
7842
+ var _u = useIdCaptureState(),
7843
+ state = _u[0],
7844
+ dispatch = _u[1];
7883
7845
  var cameraRef = React.useContext(CameraStateContext).cameraRef;
7884
- var _6 = React.useContext(IdCaptureModelsContext),
7885
- modelsReady = _6.ready,
7886
- setThresholds = _6.setThresholds,
7887
- onPredictionMade = _6.onPredictionMade,
7888
- detectionTime = _6.detectionTime,
7889
- focusPredictionTime = _6.focusPredictionTime,
7890
- getBestFrame = _6.getBestFrame;
7846
+ var _v = React.useContext(IdCaptureModelsContext),
7847
+ modelsReady = _v.ready,
7848
+ setThresholds = _v.setThresholds,
7849
+ detectionTime = _v.detectionTime,
7850
+ focusPredictionTime = _v.focusPredictionTime,
7851
+ getBestFrame = _v.getBestFrame;
7891
7852
  React.useEffect(function () {
7892
- dispatch({
7893
- type: 'configureCapture',
7894
- payload: {
7895
- autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
7896
- barcodeScanningEnabled: barcodeScanningEnabled,
7897
- maxBarcodeScanAttempts: maxBarcodeScanAttempts
7898
- }
7899
- });
7900
- }, [autoCaptureBarcodeRequired, barcodeScanningEnabled, dispatch, maxBarcodeScanAttempts]);
7901
- React.useEffect(function () {
7902
- setThresholds({
7903
- idCard: idCardDetectionThreshold,
7904
- passport: passportDetectionThreshold,
7905
- mrz: mrzDetectionScoreThreshold,
7906
- pdf417: pdf417DetectionThreshold,
7907
- focus: {
7908
- idCard: {
7909
- mobile: idCardFocusScoreThreshold
7910
- },
7911
- passport: {
7912
- mobile: passportFocusScoreThreshold
7913
- }
7914
- }
7915
- });
7916
- }, [idCardDetectionThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportDetectionThreshold, passportFocusScoreThreshold, pdf417DetectionThreshold, setThresholds]);
7853
+ setThresholds(thresholds);
7854
+ }, [thresholds, setThresholds]);
7917
7855
  React.useEffect(function () {
7918
7856
  if (!requiredDocumentType) return;
7919
7857
  dispatch({
@@ -7930,18 +7868,7 @@
7930
7868
  }
7931
7869
  });
7932
7870
  }, [dispatch, height, width]);
7933
- React.useEffect(function () {
7934
- onPredictionMade(function (prediction) {
7935
- dispatch({
7936
- type: 'objectsDetected',
7937
- payload: {
7938
- prediction: prediction
7939
- }
7940
- });
7941
- onPrediction === null || onPrediction === void 0 ? void 0 : onPrediction(prediction);
7942
- });
7943
- }, [dispatch, onPrediction, onPredictionMade]);
7944
- var shouldCapture = autoCaptureEnabled && state.goodFramesThresholdMet && !state.capturing && !state.waitingForBarcodeScan && timeSince(state.captureStartedAt) >= 3000;
7871
+ var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
7945
7872
  React.useEffect(function () {
7946
7873
  if (!shouldCapture) return;
7947
7874
  dispatch({
@@ -7955,29 +7882,13 @@
7955
7882
  });
7956
7883
  return;
7957
7884
  }
7958
- var originalCanvas = bestFrame.canvas,
7885
+ var canvas = bestFrame.canvas,
7959
7886
  documentType = bestFrame.documentType,
7960
7887
  boundingBox = bestFrame.boundingBox,
7961
7888
  detectionScore = bestFrame.detectionScore,
7962
7889
  focusScore = bestFrame.focusScore;
7963
- var width = originalCanvas.width,
7964
- height = originalCanvas.height;
7965
- var canvas = originalCanvas;
7966
- // resize image to 2k max if barcode is read
7967
- var isGreaterThan2k = width > 1920 && height > 1080 || width > 1080 && height > 1920;
7968
- if (isGreaterThan2k && !!state.barcodeResult) {
7969
- canvas = document.createElement('canvas');
7970
- if (width > height) {
7971
- canvas.width = 1920;
7972
- canvas.height = height * (1920 / width);
7973
- } else {
7974
- canvas.height = 1920;
7975
- canvas.width = width * (1920 / height);
7976
- }
7977
- var ctx2d = canvas.getContext('2d');
7978
- if (!ctx2d) return;
7979
- ctx2d.drawImage(originalCanvas, 0, 0, canvas.width, canvas.height);
7980
- }
7890
+ var width = canvas.width,
7891
+ height = canvas.height;
7981
7892
  var imageUrl = canvas.toDataURL('image/jpeg', 0.95);
7982
7893
  dispatch({
7983
7894
  type: 'frameCaptured',
@@ -8001,18 +7912,18 @@
8001
7912
  type: 'captured'
8002
7913
  });
8003
7914
  }, 0);
8004
- }, [dispatch, getBestFrame, onCapture, shouldCapture, state.barcodeResult, state.captureStartedAt, state.requestedDocumentType]);
7915
+ }, [dispatch, getBestFrame, onCapture, shouldCapture, state.captureStartedAt, state.requestedDocumentType]);
8005
7916
  assets.portraitGuidesImageUrl || (assets.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
8006
7917
  assets.landscapeGuidesImageUrl || (assets.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
8007
7918
  var theme = styled.useTheme();
8008
- colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (_f = (_e = (_d = theme.idCapture) === null || _d === void 0 ? void 0 : _d.guideBox) === null || _e === void 0 ? void 0 : _e.unsatisfiedColor) !== null && _f !== void 0 ? _f : 'white');
8009
- colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (_j = (_h = (_g = theme.idCapture) === null || _g === void 0 ? void 0 : _g.guideBox) === null || _h === void 0 ? void 0 : _h.satisfiedColor) !== null && _j !== void 0 ? _j : 'green');
7919
+ colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.unsatisfiedColor) !== null && _d !== void 0 ? _d : 'white');
7920
+ colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.satisfiedColor) !== null && _g !== void 0 ? _g : 'green');
8010
7921
  var verbiage = useTranslations(rawVerbiage, {
8011
7922
  instructionText: 'Scan the front of ID',
8012
7923
  processingIdCardText: 'ID card front captured.',
8013
- capturingText: 'Capturing...',
8014
- captureFailedText: 'Capture failed!',
8015
- guidanceSatisfiedText: 'Document detected, hold still...',
7924
+ guidanceSatisfiedText: "".concat(documentTypeDisplayNames[state.detectedDocumentType], " detected, hold still..."),
7925
+ guidancePleaseFlipText: 'ID card front detected - please flip your ID card',
7926
+ guidanceBackDetectedFirstText: 'ID card back detected - please flip your ID card',
8016
7927
  guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
8017
7928
  guidanceNotCenteredText: 'Document is not centered',
8018
7929
  guidanceTooCloseText: 'Document too close, please back up',
@@ -8027,10 +7938,10 @@
8027
7938
  });
8028
7939
  var satisfied = state.isGoodFrame;
8029
7940
  if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
8030
- guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.documentDetectionThresholdMet ? verbiage.guidanceNotDetectedText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
7941
+ guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
8031
7942
  return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
8032
7943
  ref: ref,
8033
- className: "flex ".concat((_k = classNames.container) !== null && _k !== void 0 ? _k : '')
7944
+ className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
8034
7945
  }, guidanceMessage !== '' && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, {
8035
7946
  "$top": "",
8036
7947
  "$bottom": "12.5dvh",
@@ -8039,7 +7950,7 @@
8039
7950
  "$variant": satisfied ? 'positive' : 'default',
8040
7951
  className: classNames.guidanceMessage
8041
7952
  }, guidanceMessage))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugBoundingBoxOverlay, {
8042
- "$flipX": !((_l = cameraRef.current) === null || _l === void 0 ? void 0 : _l.isRearFacing),
7953
+ "$flipX": !((_j = cameraRef.current) === null || _j === void 0 ? void 0 : _j.isRearFacing),
8043
7954
  scaling: debugScalingDetails
8044
7955
  }, state.detectedObjects.map(function (obj, i) {
8045
7956
  var _a;
@@ -8049,7 +7960,7 @@
8049
7960
  scaling: debugScalingDetails,
8050
7961
  flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
8051
7962
  });
8052
- }))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__default['default'].createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, state.documentDetectionThresholdMet ? '✅' : '❌', " Document Score: ", state.documentDetectionScore.toFixed(3), " (", state.documentType, ")", /*#__PURE__*/React__default['default'].createElement("br", null), state.passportPageDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportPageDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default['default'].createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold, barcodeScanningEnabled && state.autoCaptureBarcodeRequired ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("br", null), state.barcodeResult ? '✅' : '❌', " Barcode Scanned (", supportsNativeBarcodeScanning() ? 'Native' : 'ZXing', ",", ' ', state.barcodeScanFailedAttempts, "/", state.maxBarcodeScanAttempts, " failed attempts)")) : null)) : ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u274C Models not ready")))));
7963
+ }))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__default['default'].createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default['default'].createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.documentInBounds ? '' : '❌', " Document In Bounds", /*#__PURE__*/React__default['default'].createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u274C Models not ready")))));
8053
7964
  };
8054
7965
  var timeSince = function timeSince(t) {
8055
7966
  if (!t) return 0;
@@ -8983,11 +8894,7 @@
8983
8894
  setUrl(cropToDetectedObjectBox(imgRef.current, bbox).toDataURL('image/jpeg', 0.95));
8984
8895
  }, 100);
8985
8896
  }
8986
- return /*#__PURE__*/React__default['default'].createElement("div", {
8987
- style: {
8988
- position: 'relative'
8989
- }
8990
- }, /*#__PURE__*/React__default['default'].createElement("img", {
8897
+ return /*#__PURE__*/React__default['default'].createElement("img", {
8991
8898
  ref: imgRef,
8992
8899
  alt: alt,
8993
8900
  className: className,
@@ -9007,13 +8914,12 @@
9007
8914
  (_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(link);
9008
8915
  });
9009
8916
  }
9010
- }));
8917
+ });
9011
8918
  };
9012
8919
 
9013
8920
  var OverlayInstruction = styled__default['default'].p(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n font-size: 18px;\n margin: 30px 0;\n"], ["\n font-size: 18px;\n margin: 30px 0;\n"])));
9014
8921
  var IdCaptureSuccess = function IdCaptureSuccess(_a) {
9015
8922
  var capturedDocuments = _a.capturedDocuments,
9016
- // barcodeResult,
9017
8923
  onSubmitClick = _a.onSubmitClick,
9018
8924
  onRetryClick = _a.onRetryClick,
9019
8925
  _b = _a.classNames,
@@ -9021,7 +8927,9 @@
9021
8927
  _c = _a.colors,
9022
8928
  colors = _c === void 0 ? {} : _c,
9023
8929
  _d = _a.verbiage,
9024
- rawVerbiage = _d === void 0 ? {} : _d;
8930
+ rawVerbiage = _d === void 0 ? {} : _d,
8931
+ _e = _a.debugMode,
8932
+ debugMode = _e === void 0 ? false : _e;
9025
8933
  var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
9026
8934
  var idCardFront = capturedDocuments.idCardFront,
9027
8935
  idCardBack = capturedDocuments.idCardBack,
@@ -9056,7 +8964,7 @@
9056
8964
  image: idCardFront,
9057
8965
  className: classNames.image,
9058
8966
  alt: verbiage.idCardFrontText
9059
- })))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
8967
+ })), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(idCardFront.detectionScore, "\nFocus Score: ").concat(idCardFront.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardFront.boundingBox)))))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
9060
8968
  className: classNames.imageCol
9061
8969
  }, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
9062
8970
  className: classNames.imageHeading
@@ -9066,7 +8974,7 @@
9066
8974
  image: idCardBack,
9067
8975
  className: classNames.image,
9068
8976
  alt: verbiage.idCardBackText
9069
- })))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
8977
+ })), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
9070
8978
  className: classNames.imageCol
9071
8979
  }, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
9072
8980
  className: classNames.imageHeading
@@ -9076,7 +8984,7 @@
9076
8984
  image: passport,
9077
8985
  className: classNames.image,
9078
8986
  alt: verbiage.passportText
9079
- })))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
8987
+ })), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
9080
8988
  className: classNames.instruction
9081
8989
  }, verbiage.instructionText), /*#__PURE__*/React__default['default'].createElement(ButtonsRow, {
9082
8990
  className: classNames.buttonsRow
@@ -9678,13 +9586,8 @@
9678
9586
  var cameraRef = React.useContext(CameraStateContext).cameraRef;
9679
9587
  var verbiage = useTranslations(rawVerbiage, {
9680
9588
  instructionText: 'Scan the front of ID',
9681
- processingIdCardText: 'ID card front captured.',
9682
9589
  capturingText: 'Capturing...',
9683
- captureFailedText: 'Capture failed!',
9684
- guidanceSatisfiedText: 'Document detected, hold still...',
9685
- guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
9686
- guidanceNotCenteredText: 'Document is not centered',
9687
- guidanceNotDetectedText: 'Document not detected'
9590
+ captureFailedText: 'Capture failed!'
9688
9591
  });
9689
9592
  var isMobile = window.innerWidth < window.innerHeight;
9690
9593
  var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
@@ -9698,7 +9601,7 @@
9698
9601
  landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
9699
9602
  isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
9700
9603
  borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
9701
- imageVisible: requestingFlip || !state.documentDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
9604
+ imageVisible: requestingFlip || !state.idCardFrontDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
9702
9605
  })), guideType === 'fit' && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureFitGuide, {
9703
9606
  classNames: classNames,
9704
9607
  requestingFlip: requestingFlip,
@@ -9708,7 +9611,7 @@
9708
9611
  backImageUrl: backImageUrl,
9709
9612
  isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
9710
9613
  borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
9711
- imageVisible: requestingFlip || !state.documentDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
9614
+ imageVisible: requestingFlip || !state.detectionThresholdMet || !state.documentInBounds || state.documentTooClose || state.flipRequired
9712
9615
  })));
9713
9616
  }
9714
9617
 
@@ -10603,78 +10506,66 @@
10603
10506
  var templateObject_1$l, templateObject_2$f, templateObject_3$d, templateObject_4$8, templateObject_5$4, templateObject_6$3;
10604
10507
 
10605
10508
  var IdCaptureWizard = function IdCaptureWizard(_a) {
10606
- var _b, _c, _d, _e, _f, _g, _h, _j;
10607
- var _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
10509
+ var _b, _c, _d, _e, _f, _g;
10510
+ var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
10608
10511
  var onSuccess = _a.onSuccess,
10609
10512
  onExitCapture = _a.onExitCapture,
10610
10513
  onUserCancel = _a.onUserCancel,
10611
- _v = _a.loadingOverlayMode,
10612
- loadingOverlayMode = _v === void 0 ? 'default' : _v,
10514
+ _t = _a.loadingOverlayMode,
10515
+ loadingOverlayMode = _t === void 0 ? 'default' : _t,
10613
10516
  precapturedDocuments = _a.precapturedDocuments,
10614
- _w = _a.captureRequirement,
10615
- captureRequirement = _w === void 0 ? 'idCardOrPassport' : _w,
10616
- _x = _a.separateIdCardCaptureSequence,
10617
- separateIdCardCaptureSequence = _x === void 0 ? false : _x,
10618
- _y = _a.autoCaptureEnabled,
10619
- autoCaptureEnabled = _y === void 0 ? true : _y,
10620
- _z = _a.autoCaptureBarcodeRequired,
10621
- autoCaptureBarcodeRequired = _z === void 0 ? 'mobile' : _z,
10622
- _0 = _a.barcodeScanningEnabled,
10623
- barcodeScanningEnabled = _0 === void 0 ? false : _0,
10624
- _1 = _a.idCardAutoCaptureScoreThreshold,
10625
- idCardAutoCaptureScoreThreshold = _1 === void 0 ? defaultDocumentDetectionThresholds.idCard : _1,
10626
- _2 = _a.passportAutoCaptureScoreThreshold,
10627
- passportAutoCaptureScoreThreshold = _2 === void 0 ? defaultDocumentDetectionThresholds.passport : _2,
10628
- _3 = _a.mrzDetectionScoreThreshold,
10629
- mrzDetectionScoreThreshold = _3 === void 0 ? defaultDocumentDetectionThresholds.mrz : _3,
10630
- _4 = _a.idCardFocusScoreThreshold,
10631
- idCardFocusScoreThreshold = _4 === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _4,
10632
- _5 = _a.passportFocusScoreThreshold,
10633
- passportFocusScoreThreshold = _5 === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _5,
10634
- _6 = _a.skipSuccessScreen,
10635
- skipSuccessScreen = _6 === void 0 ? false : _6,
10517
+ _u = _a.captureRequirement,
10518
+ captureRequirement = _u === void 0 ? 'idCardOrPassport' : _u,
10519
+ _v = _a.separateIdCardCaptureSequence,
10520
+ separateIdCardCaptureSequence = _v === void 0 ? false : _v,
10521
+ _w = _a.thresholds,
10522
+ thresholds = _w === void 0 ? defaultIdCaptureThresholds : _w,
10523
+ _x = _a.skipSuccessScreen,
10524
+ skipSuccessScreen = _x === void 0 ? false : _x,
10636
10525
  instructions = _a.instructions,
10637
- _7 = _a.releaseCameraAccessOnExit,
10638
- releaseCameraAccessOnExit = _7 === void 0 ? true : _7,
10639
- _8 = _a.guideType,
10640
- guideType = _8 === void 0 ? 'fit' : _8,
10641
- _9 = _a.portraitGuidesOnMobile,
10642
- portraitGuidesOnMobile = _9 === void 0 ? false : _9,
10643
- _10 = _a.rotateLoadingOverlayImageWhenPortrait,
10644
- rotateLoadingOverlayImageWhenPortrait = _10 === void 0 ? true : _10,
10645
- _11 = _a.silentFallback,
10646
- silentFallback = _11 === void 0 ? false : _11,
10647
- _12 = _a.assets,
10648
- assets = _12 === void 0 ? {} : _12,
10649
- _13 = _a.classNames,
10650
- classNames = _13 === void 0 ? {} : _13,
10651
- _14 = _a.colors,
10652
- colors = _14 === void 0 ? {} : _14,
10653
- _15 = _a.verbiage,
10654
- verbiage = _15 === void 0 ? {} : _15,
10655
- _16 = _a.debugMode,
10656
- debugMode = _16 === void 0 ? false : _16;
10657
- var _17 = useIdCaptureState(),
10658
- state = _17[0],
10659
- dispatch = _17[1];
10660
- var _18 = React.useContext(CameraStateContext),
10661
- cameraAccessDenied = _18.cameraAccessDenied,
10662
- releaseCameraAccess = _18.releaseCameraAccess;
10663
- var _19 = React.useState(false),
10664
- overlayDismissed = _19[0],
10665
- setOverlayDismissed = _19[1];
10666
- var _20 = React.useContext(SubmissionContext),
10667
- submissionStatus = _20.submissionStatus,
10668
- setIdFrontImage = _20.setIdFrontImage,
10669
- setIdBackImage = _20.setIdBackImage,
10670
- setPassportImage = _20.setPassportImage,
10671
- logIdFrontCaptureAttempt = _20.logIdFrontCaptureAttempt,
10672
- logIdBackCaptureAttempt = _20.logIdBackCaptureAttempt;
10673
- var _21 = React.useContext(IdCaptureModelsContext),
10674
- start = _21.start,
10675
- stop = _21.stop,
10676
- modelError = _21.modelError,
10677
- resetBestFrame = _21.resetBestFrame;
10526
+ _y = _a.releaseCameraAccessOnExit,
10527
+ releaseCameraAccessOnExit = _y === void 0 ? true : _y,
10528
+ _z = _a.guideType,
10529
+ guideType = _z === void 0 ? 'fit' : _z,
10530
+ _0 = _a.portraitGuidesOnMobile,
10531
+ portraitGuidesOnMobile = _0 === void 0 ? false : _0,
10532
+ _1 = _a.rotateLoadingOverlayImageWhenPortrait,
10533
+ rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
10534
+ _2 = _a.silentFallback,
10535
+ silentFallback = _2 === void 0 ? false : _2,
10536
+ _3 = _a.assets,
10537
+ assets = _3 === void 0 ? {} : _3,
10538
+ _4 = _a.classNames,
10539
+ classNames = _4 === void 0 ? {} : _4,
10540
+ _5 = _a.colors,
10541
+ colors = _5 === void 0 ? {} : _5,
10542
+ _6 = _a.verbiage,
10543
+ verbiage = _6 === void 0 ? {} : _6,
10544
+ _7 = _a.debugMode,
10545
+ debugMode = _7 === void 0 ? false : _7;
10546
+ var _8 = useIdCaptureState(),
10547
+ state = _8[0],
10548
+ dispatch = _8[1];
10549
+ var _9 = React.useContext(CameraStateContext),
10550
+ cameraAccessDenied = _9.cameraAccessDenied,
10551
+ releaseCameraAccess = _9.releaseCameraAccess;
10552
+ var _10 = React.useState(false),
10553
+ overlayDismissed = _10[0],
10554
+ setOverlayDismissed = _10[1];
10555
+ var _11 = React.useContext(SubmissionContext),
10556
+ submissionStatus = _11.submissionStatus,
10557
+ setIdFrontImage = _11.setIdFrontImage,
10558
+ setIdBackImage = _11.setIdBackImage,
10559
+ setPassportImage = _11.setPassportImage,
10560
+ logIdFrontCaptureAttempt = _11.logIdFrontCaptureAttempt,
10561
+ logIdBackCaptureAttempt = _11.logIdBackCaptureAttempt;
10562
+ var _12 = React.useContext(IdCaptureModelsContext),
10563
+ start = _12.start,
10564
+ stop = _12.stop,
10565
+ onPredictionMade = _12.onPredictionMade,
10566
+ setRequiredDocumentType = _12.setRequiredDocumentType,
10567
+ modelError = _12.modelError,
10568
+ resetBestFrame = _12.resetBestFrame;
10678
10569
  React.useEffect(function () {
10679
10570
  dispatch({
10680
10571
  type: 'configureWizard',
@@ -10699,16 +10590,29 @@
10699
10590
  type: 'captureStarted'
10700
10591
  });
10701
10592
  start();
10702
- return function () {
10703
- stop();
10704
- };
10705
- }, [dispatch, overlayDismissed, start, state.captureState, stop]);
10706
- var onPrediction = React.useCallback(function (prediction) {
10707
- dispatch({
10708
- type: 'predictionMade',
10709
- payload: prediction
10593
+ }, [dispatch, overlayDismissed, start, state.captureState]);
10594
+ React.useEffect(function () {
10595
+ onPredictionMade(function (prediction) {
10596
+ if (state.captureState === 'capturing') {
10597
+ dispatch({
10598
+ type: 'objectsDetected',
10599
+ payload: {
10600
+ prediction: prediction
10601
+ }
10602
+ });
10603
+ } else if (state.captureState === 'requestingFlip') {
10604
+ if (prediction.idCardBackDetectionThresholdMet) {
10605
+ resetBestFrame();
10606
+ dispatch({
10607
+ type: 'flipRequestCompleted'
10608
+ });
10609
+ }
10610
+ }
10710
10611
  });
10711
- }, [dispatch]);
10612
+ }, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
10613
+ React.useEffect(function () {
10614
+ if (state.captureState === 'complete') stop();
10615
+ }, [state.captureState, stop]);
10712
10616
  var onCapture = React.useCallback(function (imageData, width, height, documentType, metadata) {
10713
10617
  logCaptureMetadata(metadata);
10714
10618
  dispatch({
@@ -10718,7 +10622,9 @@
10718
10622
  width: width,
10719
10623
  height: height,
10720
10624
  documentType: documentType,
10721
- boundingBox: metadata.boundingBox
10625
+ boundingBox: metadata.boundingBox,
10626
+ detectionScore: metadata.bestDetectionScore,
10627
+ focusScore: metadata.bestFocusScore
10722
10628
  }
10723
10629
  });
10724
10630
  }, [dispatch, logCaptureMetadata]);
@@ -10748,9 +10654,9 @@
10748
10654
  type: 'resetWizard'
10749
10655
  });
10750
10656
  }, [dispatch]);
10751
- var _22 = React.useState(0),
10752
- attempt = _22[0],
10753
- setAttempt = _22[1];
10657
+ var _13 = React.useState(0),
10658
+ attempt = _13[0],
10659
+ setAttempt = _13[1];
10754
10660
  var onExit = React.useCallback(function () {
10755
10661
  setOverlayDismissed(false);
10756
10662
  setAttempt(function (n) {
@@ -10775,19 +10681,19 @@
10775
10681
  }
10776
10682
  }, [cameraAccessDenied]);
10777
10683
  assets.idCardFront || (assets.idCardFront = {});
10778
- (_k = assets.idCardFront).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
10779
- (_l = assets.idCardFront).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
10684
+ (_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
10685
+ (_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
10780
10686
  assets.idCardBack || (assets.idCardBack = {});
10781
- (_m = assets.idCardBack).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
10782
- (_o = assets.idCardBack).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
10687
+ (_k = assets.idCardBack).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
10688
+ (_l = assets.idCardBack).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
10783
10689
  assets.passport || (assets.passport = {});
10784
- (_p = assets.passport).portraitGuidesImageUrl || (_p.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
10785
- (_q = assets.passport).landscapeGuidesImageUrl || (_q.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
10690
+ (_m = assets.passport).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
10691
+ (_o = assets.passport).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
10786
10692
  assets.flipIdPrompt || (assets.flipIdPrompt = {});
10787
- (_r = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_r.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
10788
- (_s = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_s.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
10789
- (_t = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_t.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
10790
- (_u = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_u.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
10693
+ (_p = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_p.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
10694
+ (_q = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_q.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
10695
+ (_r = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_r.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
10696
+ (_s = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_s.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
10791
10697
  var idCaptureVerbiages = {
10792
10698
  idCardFront: useTranslations(verbiage.idCardFront, {
10793
10699
  instructionText: 'Scan the front of ID',
@@ -10801,24 +10707,45 @@
10801
10707
  })
10802
10708
  };
10803
10709
  var theme = styled.useTheme();
10804
- var _23 = useIdCaptureState()[0],
10805
- guideRectX = _23.guideRectX,
10806
- guideRectY = _23.guideRectY,
10807
- guideRectWidth = _23.guideRectWidth,
10808
- guideRectHeight = _23.guideRectHeight,
10809
- imageUrl = _23.imageUrl;
10710
+ var _14 = useIdCaptureState()[0],
10711
+ guideRectX = _14.guideRectX,
10712
+ guideRectY = _14.guideRectY,
10713
+ guideRectWidth = _14.guideRectWidth,
10714
+ guideRectHeight = _14.guideRectHeight,
10715
+ imageUrl = _14.imageUrl;
10810
10716
  var idCaptureAssets = assets[state.requestedDocumentType];
10811
10717
  var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
10812
10718
  React.useEffect(function () {
10813
10719
  if (separateIdCardCaptureSequence) return;
10814
- if (state.captureState === 'requestingFlip') {
10815
- setTimeout(function () {
10816
- dispatch({
10817
- type: 'flipRequestCompleted'
10818
- });
10819
- }, 6000);
10720
+ if (state.captureState !== 'requestingFlip') return;
10721
+ var t = setTimeout(function () {
10722
+ resetBestFrame();
10723
+ dispatch({
10724
+ type: 'flipRequestCompleted'
10725
+ });
10726
+ }, 6000);
10727
+ return function () {
10728
+ clearTimeout(t);
10729
+ };
10730
+ }, [dispatch, resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
10731
+ React.useEffect(function () {
10732
+ if (state.requestedDocumentType === 'idCardFront') {
10733
+ if (captureRequirement === 'idCardOrPassport') {
10734
+ setRequiredDocumentType(['idCardFront', 'passport']);
10735
+ } else {
10736
+ setRequiredDocumentType('idCardFront');
10737
+ }
10820
10738
  }
10821
- }, [dispatch, separateIdCardCaptureSequence, state.captureState]);
10739
+ if (state.requestedDocumentType === 'idCardBack') {
10740
+ setRequiredDocumentType('idCardBack');
10741
+ }
10742
+ if (state.requestedDocumentType === 'passport') {
10743
+ setRequiredDocumentType('passport');
10744
+ }
10745
+ return function () {
10746
+ setRequiredDocumentType('none');
10747
+ };
10748
+ }, [captureRequirement, setRequiredDocumentType, state.requestedDocumentType]);
10822
10749
  var handleCapture = React.useCallback(function (imageData) {
10823
10750
  return __awaiter(void 0, void 0, void 0, function () {
10824
10751
  var base64ImageData;
@@ -10852,7 +10779,7 @@
10852
10779
  });
10853
10780
  }
10854
10781
  return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
10855
- className: "flex ".concat((_d = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _d !== void 0 ? _d : '')
10782
+ className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
10856
10783
  }, state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement(CameraFeedWrapper, {
10857
10784
  "$x": guideRectX,
10858
10785
  "$y": guideRectY,
@@ -10863,15 +10790,7 @@
10863
10790
  className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
10864
10791
  }))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__default['default'].createElement(IdCapture, {
10865
10792
  requiredDocumentType: state.requestedDocumentType,
10866
- autoCaptureEnabled: autoCaptureEnabled,
10867
- idCardDetectionThreshold: idCardAutoCaptureScoreThreshold,
10868
- passportDetectionThreshold: passportAutoCaptureScoreThreshold,
10869
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
10870
- passportFocusScoreThreshold: passportFocusScoreThreshold,
10871
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
10872
- autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
10873
- barcodeScanningEnabled: barcodeScanningEnabled && state.requestedDocumentType === 'idCardBack',
10874
- onPrediction: onPrediction,
10793
+ thresholds: thresholds,
10875
10794
  onCapture: onCapture,
10876
10795
  assets: idCaptureAssets,
10877
10796
  classNames: classNames === null || classNames === void 0 ? void 0 : classNames.capture,
@@ -10887,15 +10806,15 @@
10887
10806
  assets: idCaptureAssets,
10888
10807
  colors: colors,
10889
10808
  verbiage: idCaptureVerbiage
10890
- }), !((_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.capturePreview) === null || _f === void 0 ? void 0 : _f.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureImagePreview, {
10891
- classNames: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.imagePreview,
10892
- text: (_h = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _h === void 0 ? void 0 : _h.processingIdCardText,
10809
+ }), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureImagePreview, {
10810
+ classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
10811
+ text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
10893
10812
  imageUrl: imageUrl
10894
10813
  })), state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement("div", {
10895
10814
  id: "idmission-above-guides-content"
10896
10815
  })), /*#__PURE__*/React__default['default'].createElement(ExitCaptureButton, {
10897
10816
  onClick: onExit,
10898
- className: (_j = classNames.capture) === null || _j === void 0 ? void 0 : _j.exitCaptureBtn
10817
+ className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.exitCaptureBtn
10899
10818
  }), !overlayDismissed && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureLoadingOverlay, {
10900
10819
  key: attempt,
10901
10820
  mode: loadingOverlayMode,
@@ -10922,12 +10841,12 @@
10922
10841
  verbiage: verbiage.success
10923
10842
  })), state.captureState === 'complete' && showSuccessScreen && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureSuccess, {
10924
10843
  capturedDocuments: state.capturedDocuments,
10925
- barcodeResult: state.barcodeResult,
10926
10844
  classNames: classNames.success,
10927
10845
  onSubmitClick: onSubmitClick,
10928
10846
  onRetryClick: onRetryClick,
10929
10847
  colors: colors.success,
10930
- verbiage: verbiage.success
10848
+ verbiage: verbiage.success,
10849
+ debugMode: debugMode
10931
10850
  })));
10932
10851
  };
10933
10852
 
@@ -14408,6 +14327,31 @@
14408
14327
  var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4$1, templateObject_5, templateObject_6;
14409
14328
 
14410
14329
  var edgeBoundary = 0.05;
14330
+ var defaultVideoIdCaptureThresholds = {
14331
+ detection: {
14332
+ idCardFront: 0.6,
14333
+ idCardBack: 0.6,
14334
+ passport: 1
14335
+ },
14336
+ focus: {
14337
+ idCardFront: {
14338
+ desktop: 0,
14339
+ mobile: 0
14340
+ },
14341
+ idCardBack: {
14342
+ desktop: 0,
14343
+ mobile: 0
14344
+ },
14345
+ passport: {
14346
+ desktop: 0,
14347
+ mobile: 0
14348
+ }
14349
+ },
14350
+ goodFrames: {
14351
+ idCardFront: 1,
14352
+ idCardBack: 1
14353
+ }
14354
+ };
14411
14355
  var IdVideoCapture = function IdVideoCapture(_a) {
14412
14356
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
14413
14357
  var onComplete = _a.onComplete,
@@ -14419,96 +14363,85 @@
14419
14363
  idCaptureModelsEnabled = _w === void 0 ? true : _w,
14420
14364
  _x = _a.idCardFrontDelay,
14421
14365
  idCardFrontDelay = _x === void 0 ? 1000 : _x,
14422
- _y = _a.idCardFrontDetectionThreshold,
14423
- idCardFrontDetectionThreshold = _y === void 0 ? 0.6 : _y,
14424
- _z = _a.idCardFrontFocusThreshold,
14425
- idCardFrontFocusThreshold = _z === void 0 ? 0 : _z,
14426
- _0 = _a.goodIdCardFrontFramesThreshold,
14427
- goodIdCardFrontFramesThreshold = _0 === void 0 ? 1 : _0,
14428
- _1 = _a.idCardBackDetectionThreshold,
14429
- idCardBackDetectionThreshold = _1 === void 0 ? 0.6 : _1,
14430
- _2 = _a.idCardBackFocusThreshold,
14431
- idCardBackFocusThreshold = _2 === void 0 ? 0 : _2,
14432
- _3 = _a.goodIdCardBackFramesThreshold,
14433
- goodIdCardBackFramesThreshold = _3 === void 0 ? 1 : _3,
14434
- _4 = _a.skipShowIdCardBack,
14435
- skipShowIdCardBack = _4 === void 0 ? false : _4,
14436
- _5 = _a.captureCountdownSeconds,
14437
- captureCountdownSeconds = _5 === void 0 ? 3 : _5,
14366
+ _y = _a.videoIdCaptureThresholds,
14367
+ videoIdCaptureThresholds = _y === void 0 ? defaultVideoIdCaptureThresholds : _y,
14368
+ _z = _a.skipShowIdCardBack,
14369
+ skipShowIdCardBack = _z === void 0 ? false : _z,
14370
+ _0 = _a.captureCountdownSeconds,
14371
+ captureCountdownSeconds = _0 === void 0 ? 3 : _0,
14438
14372
  readTextPrompt = _a.readTextPrompt,
14439
- _6 = _a.readTextTimeoutDurationMs,
14440
- readTextTimeoutDurationMs = _6 === void 0 ? 15000 : _6,
14441
- _7 = _a.readTextMinReadingMs,
14442
- readTextMinReadingMs = _7 === void 0 ? 10000 : _7,
14443
- _8 = _a.disableFaceDetectionWhileAudioCapture,
14444
- disableFaceDetectionWhileAudioCapture = _8 === void 0 ? false : _8,
14445
- _9 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
14446
- disableFaceDetectionWhileAudioCaptureMsDelay = _9 === void 0 ? 2000 : _9,
14447
- _10 = _a.mergeAVStreams,
14448
- mergeAVStreams = _10 === void 0 ? false : _10,
14449
- _11 = _a.assets,
14450
- assets = _11 === void 0 ? {} : _11,
14451
- _12 = _a.classNames,
14452
- classNames = _12 === void 0 ? {} : _12,
14453
- _13 = _a.colors,
14454
- colors = _13 === void 0 ? {} : _13,
14455
- _14 = _a.verbiage,
14456
- rawVerbiage = _14 === void 0 ? {} : _14,
14457
- _15 = _a.debugMode,
14458
- debugMode = _15 === void 0 ? false : _15;
14459
- var _16 = useResizeObserver(),
14460
- ref = _16.ref,
14461
- _17 = _16.width,
14462
- width = _17 === void 0 ? 1 : _17,
14463
- _18 = _16.height,
14464
- height = _18 === void 0 ? 1 : _18;
14465
- var _19 = React.useContext(CameraStateContext),
14466
- cameraRef = _19.cameraRef,
14467
- videoRef = _19.videoRef,
14468
- videoLoaded = _19.videoLoaded,
14469
- cameraReady = _19.cameraReady,
14470
- microphoneReady = _19.microphoneReady,
14471
- audioStream = _19.audioStream,
14472
- setVideoLoaded = _19.setVideoLoaded,
14473
- takePhoto = _19.takePhoto;
14474
- var _20 = React.useState([]),
14475
- detectedObjects = _20[0],
14476
- setDetectedObjects = _20[1];
14477
- var _21 = React.useState([]),
14478
- faces = _21[0],
14479
- setFaces = _21[1];
14480
- var _22 = React.useContext(IdCaptureModelsContext),
14481
- idModelsReady = _22.ready,
14482
- startIdModels = _22.start,
14483
- stopIdModels = _22.stop,
14484
- onIdPredictionMade = _22.onPredictionMade,
14485
- setThresholds = _22.setThresholds,
14486
- bestFrameDetails = _22.bestFrameDetails,
14487
- resetBestFrame = _22.resetBestFrame,
14488
- idModelError = _22.modelError;
14489
- var _23 = React.useState(null),
14490
- videoStartsAt = _23[0],
14491
- setVideoStartsAt = _23[1];
14492
- var _24 = React.useContext(SubmissionContext),
14493
- setIdCaptureVideoAudioStartsAt = _24.setIdCaptureVideoAudioStartsAt,
14494
- setExpectedAudioText = _24.setExpectedAudioText;
14495
- var _25 = React.useContext(SelfieGuidanceModelsContext),
14496
- onSelfiePredictionMade = _25.onPredictionMade,
14497
- selfieModelError = _25.error;
14498
- var _26 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
14499
- isRecordingVideo = _26.isRecordingVideo,
14500
- startRecordingVideo = _26.startRecordingVideo,
14501
- startRecordingAudio = _26.startRecordingAudio,
14502
- stopRecordingVideo = _26.stopRecordingVideo,
14503
- stopRecordingAudio = _26.stopRecordingAudio,
14504
- videoRecordingUnintentionallyStopped = _26.videoRecordingUnintentionallyStopped,
14505
- audioRecordingUnintentionallyStopped = _26.audioRecordingUnintentionallyStopped,
14506
- videoUrl = _26.videoUrl,
14507
- audioUrl = _26.audioUrl;
14373
+ _1 = _a.readTextTimeoutDurationMs,
14374
+ readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
14375
+ _2 = _a.readTextMinReadingMs,
14376
+ readTextMinReadingMs = _2 === void 0 ? 10000 : _2,
14377
+ _3 = _a.disableFaceDetectionWhileAudioCapture,
14378
+ disableFaceDetectionWhileAudioCapture = _3 === void 0 ? false : _3,
14379
+ _4 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
14380
+ disableFaceDetectionWhileAudioCaptureMsDelay = _4 === void 0 ? 2000 : _4,
14381
+ _5 = _a.mergeAVStreams,
14382
+ mergeAVStreams = _5 === void 0 ? false : _5,
14383
+ _6 = _a.assets,
14384
+ assets = _6 === void 0 ? {} : _6,
14385
+ _7 = _a.classNames,
14386
+ classNames = _7 === void 0 ? {} : _7,
14387
+ _8 = _a.colors,
14388
+ colors = _8 === void 0 ? {} : _8,
14389
+ _9 = _a.verbiage,
14390
+ rawVerbiage = _9 === void 0 ? {} : _9,
14391
+ _10 = _a.debugMode,
14392
+ debugMode = _10 === void 0 ? false : _10;
14393
+ var _11 = useResizeObserver(),
14394
+ ref = _11.ref,
14395
+ _12 = _11.width,
14396
+ width = _12 === void 0 ? 1 : _12,
14397
+ _13 = _11.height,
14398
+ height = _13 === void 0 ? 1 : _13;
14399
+ var _14 = React.useContext(CameraStateContext),
14400
+ cameraRef = _14.cameraRef,
14401
+ videoRef = _14.videoRef,
14402
+ videoLoaded = _14.videoLoaded,
14403
+ cameraReady = _14.cameraReady,
14404
+ microphoneReady = _14.microphoneReady,
14405
+ audioStream = _14.audioStream,
14406
+ setVideoLoaded = _14.setVideoLoaded;
14407
+ var _15 = React.useState([]),
14408
+ detectedObjects = _15[0],
14409
+ setDetectedObjects = _15[1];
14410
+ var _16 = React.useState([]),
14411
+ faces = _16[0],
14412
+ setFaces = _16[1];
14413
+ var _17 = React.useContext(IdCaptureModelsContext),
14414
+ idModelsReady = _17.ready,
14415
+ startIdModels = _17.start,
14416
+ stopIdModels = _17.stop,
14417
+ onIdPredictionMade = _17.onPredictionMade,
14418
+ setThresholds = _17.setThresholds,
14419
+ bestFrameDetails = _17.bestFrameDetails,
14420
+ resetBestFrame = _17.resetBestFrame,
14421
+ idModelError = _17.modelError;
14422
+ var _18 = React.useState(null),
14423
+ videoStartsAt = _18[0],
14424
+ setVideoStartsAt = _18[1];
14425
+ var _19 = React.useContext(SubmissionContext),
14426
+ setIdCaptureVideoAudioStartsAt = _19.setIdCaptureVideoAudioStartsAt,
14427
+ setExpectedAudioText = _19.setExpectedAudioText;
14428
+ var _20 = React.useContext(SelfieGuidanceModelsContext),
14429
+ onSelfiePredictionMade = _20.onPredictionMade,
14430
+ selfieModelError = _20.error;
14431
+ var _21 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
14432
+ isRecordingVideo = _21.isRecordingVideo,
14433
+ startRecordingVideo = _21.startRecordingVideo,
14434
+ startRecordingAudio = _21.startRecordingAudio,
14435
+ stopRecordingVideo = _21.stopRecordingVideo,
14436
+ stopRecordingAudio = _21.stopRecordingAudio,
14437
+ videoRecordingUnintentionallyStopped = _21.videoRecordingUnintentionallyStopped,
14438
+ audioRecordingUnintentionallyStopped = _21.audioRecordingUnintentionallyStopped,
14439
+ videoUrl = _21.videoUrl,
14440
+ audioUrl = _21.audioUrl;
14508
14441
  var countdownTimeoutRef = React.useRef(undefined);
14509
- var _27 = React.useState(0),
14510
- countdownRemaining = _27[0],
14511
- setCountdownRemaining = _27[1];
14442
+ var _22 = React.useState(-1),
14443
+ countdownRemaining = _22[0],
14444
+ setCountdownRemaining = _22[1];
14512
14445
  React.useEffect(function () {
14513
14446
  if (!isRecordingVideo && !videoUrl) {
14514
14447
  startRecordingVideo();
@@ -14528,41 +14461,30 @@
14528
14461
  onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
14529
14462
  }
14530
14463
  }, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
14531
- var shouldCaptureFrames = React.useRef(false);
14532
- React.useEffect(function () {
14533
- shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady && !idModelError && (!readTextPrompt || microphoneReady);
14534
- }, [cameraReady, idModelError, idModelsReady, microphoneReady, readTextPrompt, videoLoaded]);
14535
- var _28 = React.useState('SHOW_ID_FRONT'),
14536
- requestedAction = _28[0],
14537
- setRequestedAction = _28[1];
14464
+ var _23 = React.useState('SHOW_ID_FRONT'),
14465
+ requestedAction = _23[0],
14466
+ setRequestedAction = _23[1];
14467
+ var shouldRunIdModels = idCaptureModelsEnabled && videoLoaded && cameraReady && idModelsReady && !idModelError && requestedAction !== 'READ_TEXT' && (!readTextPrompt || microphoneReady);
14538
14468
  React.useEffect(function startModelsWhenCapturing() {
14539
- if (!shouldCaptureFrames.current && requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
14469
+ if (!shouldRunIdModels) return;
14540
14470
  startIdModels();
14541
14471
  return function () {
14542
14472
  stopIdModels();
14543
14473
  };
14544
- }, [requestedAction, startIdModels, stopIdModels]);
14474
+ }, [shouldRunIdModels, startIdModels, stopIdModels]);
14545
14475
  React.useEffect(function () {
14546
- setThresholds({
14547
- idCard: requestedAction === 'SHOW_ID_FRONT' ? idCardFrontDetectionThreshold : requestedAction === 'SHOW_ID_BACK' ? idCardBackDetectionThreshold : 1,
14548
- passport: 1,
14549
- focus: {
14550
- idCard: {
14551
- mobile: requestedAction === 'SHOW_ID_FRONT' ? idCardFrontFocusThreshold : requestedAction === 'SHOW_ID_BACK' ? idCardBackFocusThreshold : 0
14552
- }
14553
- }
14554
- });
14555
- }, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
14556
- var _29 = React.useState(0),
14557
- currentDetectionScore = _29[0],
14558
- setCurrentDetectionScore = _29[1];
14559
- var _30 = React.useState(0),
14560
- currentFocusScore = _30[0],
14561
- setCurrentFocusScore = _30[1];
14562
- var _31 = React.useState(0),
14563
- goodFramesCount = _31[0],
14564
- setGoodFramesCount = _31[1];
14565
- var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
14476
+ setThresholds(videoIdCaptureThresholds);
14477
+ }, [requestedAction, setThresholds, videoIdCaptureThresholds]);
14478
+ var _24 = React.useState(0),
14479
+ currentDetectionScore = _24[0],
14480
+ setCurrentDetectionScore = _24[1];
14481
+ var _25 = React.useState(0),
14482
+ currentFocusScore = _25[0],
14483
+ setCurrentFocusScore = _25[1];
14484
+ var _26 = React.useState(0),
14485
+ goodFramesCount = _26[0],
14486
+ setGoodFramesCount = _26[1];
14487
+ var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
14566
14488
  var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
14567
14489
  React.useEffect(function () {
14568
14490
  if (!idCaptureModelsEnabled || idModelError) return;
@@ -14570,18 +14492,19 @@
14570
14492
  setDetectedObjects(prediction.detectedObjects);
14571
14493
  setCurrentDetectionScore(prediction.detectionScore);
14572
14494
  setCurrentFocusScore(prediction.focusScore);
14573
- if (prediction.detectionThresholdMet && prediction.focusThresholdMet) {
14574
- setGoodFramesCount(function (n) {
14575
- return n + 1;
14576
- });
14577
- } else {
14578
- setGoodFramesCount(0);
14495
+ var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
14496
+ var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
14497
+ if (requestedAction === 'FLIP_ID' && isGoodFrame) {
14498
+ return setRequestedAction('SHOW_ID_BACK');
14579
14499
  }
14500
+ setGoodFramesCount(isGoodFrame ? function (n) {
14501
+ return n + 1;
14502
+ } : 0);
14580
14503
  });
14581
- }, [idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError]);
14582
- var _32 = React.useState(null),
14583
- idFrontCaptureStartedAt = _32[0],
14584
- setFirstGoodFrameTime = _32[1];
14504
+ }, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
14505
+ var _27 = React.useState(null),
14506
+ idFrontCaptureStartedAt = _27[0],
14507
+ setFirstGoodFrameTime = _27[1];
14585
14508
  React.useEffect(function () {
14586
14509
  if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
14587
14510
  }, [goodFramesCount]);
@@ -14602,73 +14525,56 @@
14602
14525
  var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
14603
14526
  var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
14604
14527
  var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
14605
- var _33 = React.useState(),
14606
- countdownStartedAt = _33[0],
14607
- setCountdownStartedAt = _33[1];
14528
+ var _28 = React.useState(),
14529
+ countdownStartedAt = _28[0],
14530
+ setCountdownStartedAt = _28[1];
14531
+ var photoCanvas = React.useRef(null);
14608
14532
  var frameLock = React.useRef(false);
14609
14533
  var captureFrame = React.useCallback(function () {
14610
14534
  return __awaiter(void 0, void 0, void 0, function () {
14611
- var frame, frameBase64, _a;
14612
- return __generator(this, function (_b) {
14613
- switch (_b.label) {
14535
+ var frameBase64;
14536
+ return __generator(this, function (_a) {
14537
+ switch (_a.label) {
14614
14538
  case 0:
14615
14539
  if (frameLock.current) return [2 /*return*/];
14616
14540
  frameLock.current = true;
14617
- return [4 /*yield*/, takePhoto()];
14618
- case 1:
14619
- frame = _b.sent();
14620
- if (!frame) {
14541
+ drawToCanvas(photoCanvas.current, videoRef.current);
14542
+ frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
14543
+ if (!frameBase64) {
14621
14544
  frameLock.current = false;
14622
14545
  return [2 /*return*/];
14623
14546
  }
14624
- _b.label = 2;
14625
- case 2:
14626
- _b.trys.push([2,, 10, 11]);
14627
- _a = frame;
14628
- if (!_a) return [3 /*break*/, 4];
14629
- return [4 /*yield*/, new Promise(function (resolve) {
14630
- var reader = new FileReader();
14631
- reader.onloadend = function () {
14632
- return resolve(reader.result);
14633
- };
14634
- reader.readAsDataURL(frame);
14635
- })];
14636
- case 3:
14637
- _a = _b.sent();
14638
- _b.label = 4;
14639
- case 4:
14640
- frameBase64 = _a;
14641
- if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
14547
+ _a.label = 1;
14548
+ case 1:
14549
+ _a.trys.push([1,, 7, 8]);
14550
+ if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
14642
14551
  if (onIdFrontImageCaptured) {
14643
- frameBase64 && onIdFrontImageCaptured(frameBase64);
14552
+ onIdFrontImageCaptured(frameBase64);
14644
14553
  }
14645
- if (!skipShowIdCardBack) return [3 /*break*/, 7];
14646
- if (!(skipShowIdCardBack === true)) return [3 /*break*/, 5];
14554
+ if (!skipShowIdCardBack) return [3 /*break*/, 4];
14555
+ if (!(skipShowIdCardBack === true)) return [3 /*break*/, 2];
14647
14556
  return [2 /*return*/, onIdBackCaptureComplete()];
14648
- case 5:
14557
+ case 2:
14649
14558
  return [4 /*yield*/, skipShowIdCardBack()];
14650
- case 6:
14651
- if (_b.sent()) {
14559
+ case 3:
14560
+ if (_a.sent()) {
14652
14561
  return [2 /*return*/, onIdBackCaptureComplete()];
14653
14562
  }
14654
- _b.label = 7;
14655
- case 7:
14563
+ _a.label = 4;
14564
+ case 4:
14656
14565
  setRequestedAction('FLIP_ID');
14657
- setTimeout(function () {
14658
- setRequestedAction('SHOW_ID_BACK');
14659
- }, 6000);
14660
- return [3 /*break*/, 9];
14661
- case 8:
14566
+ return [3 /*break*/, 6];
14567
+ case 5:
14662
14568
  if (requestedAction == 'SHOW_ID_BACK') {
14663
14569
  if (onIdBackImageCaptured) {
14664
- frameBase64 && onIdBackImageCaptured(frameBase64);
14570
+ onIdBackImageCaptured(frameBase64);
14665
14571
  }
14666
14572
  onIdBackCaptureComplete();
14667
14573
  }
14668
- _b.label = 9;
14669
- case 9:
14670
- return [3 /*break*/, 11];
14671
- case 10:
14574
+ _a.label = 6;
14575
+ case 6:
14576
+ return [3 /*break*/, 8];
14577
+ case 7:
14672
14578
  setDetectedObjects([]);
14673
14579
  setCurrentDetectionScore(0);
14674
14580
  setCurrentFocusScore(0);
@@ -14680,17 +14586,27 @@
14680
14586
  clearTimeout(countdownTimeoutRef.current);
14681
14587
  }
14682
14588
  return [7 /*endfinally*/];
14683
- case 11:
14589
+ case 8:
14684
14590
  return [2 /*return*/];
14685
14591
  }
14686
14592
  });
14687
14593
  });
14688
- }, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, takePhoto]);
14594
+ }, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
14595
+ var isFlipping = requestedAction === 'FLIP_ID';
14596
+ React.useEffect(function () {
14597
+ if (!isFlipping) return;
14598
+ var t = setTimeout(function () {
14599
+ setRequestedAction('SHOW_ID_BACK');
14600
+ }, 6000);
14601
+ return function () {
14602
+ clearTimeout(t);
14603
+ };
14604
+ }, [isFlipping]);
14689
14605
  var stopRecording = React.useCallback(function () {
14690
14606
  stopRecordingVideo();
14691
14607
  stopRecordingAudio();
14692
14608
  }, [stopRecordingAudio, stopRecordingVideo]);
14693
- var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
14609
+ var satisfied = !isFlipping && goodFramesThresholdMet && faceCentered && delaySatisfied;
14694
14610
  React.useEffect(function () {
14695
14611
  if (satisfied && !countdownStartedAt) {
14696
14612
  setCountdownStartedAt(new Date());
@@ -14710,10 +14626,7 @@
14710
14626
  }, 1000);
14711
14627
  return;
14712
14628
  }
14713
- if (countdownStartedAt) {
14714
- captureFrame();
14715
- }
14716
- }, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
14629
+ }, [countdownTimeoutRef]);
14717
14630
  React.useEffect(function () {
14718
14631
  if (!countdownStartedAt) return;
14719
14632
  setCountdownRemaining(captureCountdownSeconds);
@@ -14723,11 +14636,17 @@
14723
14636
  return function () {
14724
14637
  clearTimeout(countdownTimeoutRef.current);
14725
14638
  };
14726
- }, [captureCountdownSeconds, captureFrame, countdownStartedAt, manualCountdown]);
14639
+ }, [captureCountdownSeconds, countdownStartedAt, manualCountdown]);
14640
+ React.useEffect(function () {
14641
+ if (countdownRemaining === 0) {
14642
+ setCountdownRemaining(-1);
14643
+ captureFrame().then();
14644
+ }
14645
+ }, [captureFrame, countdownRemaining]);
14727
14646
  var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
14728
- var _34 = React.useState(0),
14729
- numFramesWithoutFaces = _34[0],
14730
- setNumFramesWithoutFaces = _34[1];
14647
+ var _29 = React.useState(0),
14648
+ numFramesWithoutFaces = _29[0],
14649
+ setNumFramesWithoutFaces = _29[1];
14731
14650
  React.useEffect(function () {
14732
14651
  if (!selfieModelError) {
14733
14652
  onSelfiePredictionMade(function (faces) {
@@ -14745,14 +14664,14 @@
14745
14664
  }
14746
14665
  }, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
14747
14666
  var theme = styled.useTheme();
14748
- var _35 = useTranslations(rawVerbiage, {
14667
+ var _30 = useTranslations(rawVerbiage, {
14749
14668
  faceNotCenteredText: 'Please move your face to the center...',
14750
14669
  searchingForIdCardText: 'Searching for ID card...',
14751
14670
  captureBtnText: 'Capture'
14752
14671
  }),
14753
- captureBtnText = _35.captureBtnText,
14754
- faceNotCenteredText = _35.faceNotCenteredText,
14755
- searchingForIdCardText = _35.searchingForIdCardText;
14672
+ captureBtnText = _30.captureBtnText,
14673
+ faceNotCenteredText = _30.faceNotCenteredText,
14674
+ searchingForIdCardText = _30.searchingForIdCardText;
14756
14675
  var debugScalingDetails = useDebugScalingDetails({
14757
14676
  enabled: debugMode,
14758
14677
  pageWidth: width,
@@ -14766,7 +14685,9 @@
14766
14685
  return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
14767
14686
  ref: ref,
14768
14687
  className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
14769
- }, requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default['default'].createElement(ReadTextPrompt, {
14688
+ }, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
14689
+ ref: photoCanvas
14690
+ }), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default['default'].createElement(ReadTextPrompt, {
14770
14691
  text: readTextPrompt,
14771
14692
  startedAt: timeoutStartedAt || undefined,
14772
14693
  durationMs: readTextTimeoutDurationMs,
@@ -14805,7 +14726,7 @@
14805
14726
  className: classNames.guidanceMessage,
14806
14727
  "$background": (_q = (_p = (_o = theme.guidanceMessages) === null || _o === void 0 ? void 0 : _o.negative) === null || _p === void 0 ? void 0 : _p.backgroundColor) !== null && _q !== void 0 ? _q : 'red',
14807
14728
  "$textColor": (_t = (_s = (_r = theme.guidanceMessages) === null || _r === void 0 ? void 0 : _r.negative) === null || _s === void 0 ? void 0 : _s.textColor) !== null && _t !== void 0 ? _t : 'white'
14808
- }, guidanceText))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)), !!countdownRemaining && capturingId && ( /*#__PURE__*/React__default['default'].createElement(CountdownContainer, {
14729
+ }, guidanceText))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React__default['default'].createElement(CountdownContainer, {
14809
14730
  className: classNames.countdownContainer
14810
14731
  }, /*#__PURE__*/React__default['default'].createElement(Countdown, {
14811
14732
  className: classNames.countdown
@@ -14960,64 +14881,60 @@
14960
14881
  faceLivenessProps = _h === void 0 ? {} : _h,
14961
14882
  _j = _a.idCaptureModelsEnabled,
14962
14883
  idCaptureModelsEnabled = _j === void 0 ? true : _j,
14963
- idCardFrontDetectionThreshold = _a.idCardFrontDetectionThreshold,
14964
- idCardBackDetectionThreshold = _a.idCardBackDetectionThreshold,
14965
- idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
14966
- idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
14967
- goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
14968
- goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
14884
+ _k = _a.videoIdCaptureThresholds,
14885
+ videoIdCaptureThresholds = _k === void 0 ? defaultVideoIdCaptureThresholds : _k,
14969
14886
  readTextPrompt = _a.readTextPrompt,
14970
14887
  readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
14971
14888
  readTextMinReadingMs = _a.readTextMinReadingMs,
14972
- _k = _a.skipIdCapture,
14973
- skipIdCapture = _k === void 0 ? false : _k,
14974
- _l = _a.skipShowIdCardBack,
14975
- skipShowIdCardBack = _l === void 0 ? false : _l,
14976
- _m = _a.skipSuccessScreen,
14977
- skipSuccessScreen = _m === void 0 ? false : _m,
14978
- _o = _a.idCaptureLoadingOverlayMode,
14979
- idCaptureLoadingOverlayMode = _o === void 0 ? 'default' : _o,
14980
- _p = _a.idCaptureGuideType,
14981
- idCaptureGuideType = _p === void 0 ? 'fit' : _p,
14982
- _q = _a.idCapturePortraitGuidesOnMobile,
14983
- idCapturePortraitGuidesOnMobile = _q === void 0 ? false : _q,
14984
- _r = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
14985
- idCaptureRotateLoadingOverlayImageWhenPortrait = _r === void 0 ? true : _r,
14986
- _s = _a.idCaptureModelLoadTimeoutMs,
14987
- idCaptureModelLoadTimeoutMs = _s === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _s,
14988
- _t = _a.faceLivenessLoadingOverlayMode,
14989
- faceLivenessLoadingOverlayMode = _t === void 0 ? 'default' : _t,
14990
- _u = _a.disableFaceDetectionWhileAudioCapture,
14991
- disableFaceDetectionWhileAudioCapture = _u === void 0 ? true : _u,
14992
- _v = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
14993
- disableFaceDetectionWhileAudioCaptureMsDelay = _v === void 0 ? 2000 : _v,
14994
- _w = _a.silentFallback,
14995
- silentFallback = _w === void 0 ? false : _w,
14996
- _x = _a.mergeAVStreams,
14997
- mergeAVStreams = _x === void 0 ? false : _x,
14998
- _y = _a.assets,
14999
- assets = _y === void 0 ? {} : _y,
15000
- _z = _a.classNames,
15001
- classNames = _z === void 0 ? {} : _z,
15002
- _0 = _a.colors,
15003
- colors = _0 === void 0 ? {} : _0,
15004
- _1 = _a.verbiage,
15005
- verbiage = _1 === void 0 ? {} : _1,
15006
- _2 = _a.debugMode,
15007
- debugMode = _2 === void 0 ? false : _2;
15008
- var _3 = React.useContext(SubmissionContext),
15009
- submissionStatus = _3.submissionStatus,
15010
- idCaptureVideoUrl = _3.idCaptureVideoUrl,
15011
- idCaptureVideoAudioUrl = _3.idCaptureVideoAudioUrl,
15012
- idCaptureVideoIdFrontImage = _3.idCaptureVideoIdFrontImage,
15013
- idCaptureVideoIdBackImage = _3.idCaptureVideoIdBackImage,
15014
- setIdCaptureVideoUrl = _3.setIdCaptureVideoUrl,
15015
- setIdCaptureVideoIdFrontImage = _3.setIdCaptureVideoIdFrontImage,
15016
- setIdCaptureVideoIdBackImage = _3.setIdCaptureVideoIdBackImage,
15017
- setIdCaptureVideoAudioUrl = _3.setIdCaptureVideoAudioUrl;
15018
- var _4 = React.useState('CAPTURING_ID'),
15019
- captureState = _4[0],
15020
- setCaptureState = _4[1];
14889
+ _l = _a.skipIdCapture,
14890
+ skipIdCapture = _l === void 0 ? false : _l,
14891
+ _m = _a.skipShowIdCardBack,
14892
+ skipShowIdCardBack = _m === void 0 ? false : _m,
14893
+ _o = _a.skipSuccessScreen,
14894
+ skipSuccessScreen = _o === void 0 ? false : _o,
14895
+ _p = _a.idCaptureLoadingOverlayMode,
14896
+ idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
14897
+ _q = _a.idCaptureGuideType,
14898
+ idCaptureGuideType = _q === void 0 ? 'fit' : _q,
14899
+ _r = _a.idCapturePortraitGuidesOnMobile,
14900
+ idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
14901
+ _s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
14902
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
14903
+ _t = _a.idCaptureModelLoadTimeoutMs,
14904
+ idCaptureModelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
14905
+ _u = _a.faceLivenessLoadingOverlayMode,
14906
+ faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
14907
+ _v = _a.disableFaceDetectionWhileAudioCapture,
14908
+ disableFaceDetectionWhileAudioCapture = _v === void 0 ? true : _v,
14909
+ _w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
14910
+ disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
14911
+ _x = _a.silentFallback,
14912
+ silentFallback = _x === void 0 ? false : _x,
14913
+ _y = _a.mergeAVStreams,
14914
+ mergeAVStreams = _y === void 0 ? false : _y,
14915
+ _z = _a.assets,
14916
+ assets = _z === void 0 ? {} : _z,
14917
+ _0 = _a.classNames,
14918
+ classNames = _0 === void 0 ? {} : _0,
14919
+ _1 = _a.colors,
14920
+ colors = _1 === void 0 ? {} : _1,
14921
+ _2 = _a.verbiage,
14922
+ verbiage = _2 === void 0 ? {} : _2,
14923
+ _3 = _a.debugMode,
14924
+ debugMode = _3 === void 0 ? false : _3;
14925
+ var _4 = React.useContext(SubmissionContext),
14926
+ submissionStatus = _4.submissionStatus,
14927
+ idCaptureVideoUrl = _4.idCaptureVideoUrl,
14928
+ idCaptureVideoAudioUrl = _4.idCaptureVideoAudioUrl,
14929
+ idCaptureVideoIdFrontImage = _4.idCaptureVideoIdFrontImage,
14930
+ idCaptureVideoIdBackImage = _4.idCaptureVideoIdBackImage,
14931
+ setIdCaptureVideoUrl = _4.setIdCaptureVideoUrl,
14932
+ setIdCaptureVideoIdFrontImage = _4.setIdCaptureVideoIdFrontImage,
14933
+ setIdCaptureVideoIdBackImage = _4.setIdCaptureVideoIdBackImage,
14934
+ setIdCaptureVideoAudioUrl = _4.setIdCaptureVideoAudioUrl;
14935
+ var _5 = React.useState('CAPTURING_ID'),
14936
+ captureState = _5[0],
14937
+ setCaptureState = _5[1];
15021
14938
  React.useEffect(function () {
15022
14939
  if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
15023
14940
  }, [captureState, skipIdCapture]);
@@ -15048,9 +14965,9 @@
15048
14965
  var onVideoCaptureFaceNotDetected = React.useCallback(function () {
15049
14966
  setCaptureState('CHECKING_LIVENESS');
15050
14967
  }, []);
15051
- var _5 = React.useState(0),
15052
- attempt = _5[0],
15053
- setAttempt = _5[1];
14968
+ var _6 = React.useState(0),
14969
+ attempt = _6[0],
14970
+ setAttempt = _6[1];
15054
14971
  var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
15055
14972
  var onFaceCaptureExitAfterFailure = React.useCallback(function (resp, req) {
15056
14973
  userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
@@ -15154,12 +15071,7 @@
15154
15071
  onFaceNotDetected: onVideoCaptureFaceNotDetected,
15155
15072
  onRecordingFailed: onRecordingFailed,
15156
15073
  idCaptureModelsEnabled: idCaptureModelsEnabled,
15157
- idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
15158
- idCardBackDetectionThreshold: idCardBackDetectionThreshold,
15159
- idCardFrontFocusThreshold: idCardFrontFocusThreshold,
15160
- idCardBackFocusThreshold: idCardBackFocusThreshold,
15161
- goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
15162
- goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
15074
+ videoIdCaptureThresholds: videoIdCaptureThresholds,
15163
15075
  skipShowIdCardBack: skipShowIdCardBack,
15164
15076
  disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
15165
15077
  disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
@@ -15620,9 +15532,8 @@
15620
15532
  * Render a fullscreen ID capture component that instructs the user to photograph both sides of their ID card, or full page of their passport.
15621
15533
  */
15622
15534
  var IdValidation = function IdValidation(_a) {
15623
- var _b, _c;
15624
- var _d = _a.lang,
15625
- lang = _d === void 0 ? 'auto' : _d,
15535
+ var _b = _a.lang,
15536
+ lang = _b === void 0 ? 'auto' : _b,
15626
15537
  sessionId = _a.sessionId,
15627
15538
  clientRequestID = _a.clientRequestID,
15628
15539
  submissionUrl = _a.submissionUrl,
@@ -15645,35 +15556,25 @@
15645
15556
  webhooksFireOnReview = _a.webhooksFireOnReview,
15646
15557
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
15647
15558
  precapturedDocuments = _a.precapturedDocuments,
15648
- _e = _a.loadingOverlayMode,
15649
- loadingOverlayMode = _e === void 0 ? 'default' : _e,
15650
- _f = _a.idCaptureRequirement,
15651
- idCaptureRequirement = _f === void 0 ? 'idCardOrPassport' : _f,
15652
- _g = _a.separateIdCardCaptureSequence,
15653
- separateIdCardCaptureSequence = _g === void 0 ? false : _g,
15654
- _h = _a.idAutoCaptureEnabled,
15655
- idAutoCaptureEnabled = _h === void 0 ? true : _h,
15656
- _j = _a.idCardAutoCaptureScoreThreshold,
15657
- idCardAutoCaptureScoreThreshold = _j === void 0 ? defaultDocumentDetectionThresholds.idCard : _j,
15658
- _k = _a.passportAutoCaptureScoreThreshold,
15659
- passportAutoCaptureScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.passport : _k,
15660
- _l = _a.mrzDetectionScoreThreshold,
15661
- mrzDetectionScoreThreshold = _l === void 0 ? defaultDocumentDetectionThresholds.mrz : _l,
15662
- _m = _a.idCardFocusScoreThreshold,
15663
- idCardFocusScoreThreshold = _m === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _m,
15664
- _o = _a.passportFocusScoreThreshold,
15665
- passportFocusScoreThreshold = _o === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _o,
15666
- _p = _a.skipSuccessScreen,
15667
- skipSuccessScreen = _p === void 0 ? false : _p,
15559
+ _c = _a.loadingOverlayMode,
15560
+ loadingOverlayMode = _c === void 0 ? 'default' : _c,
15561
+ _d = _a.idCaptureRequirement,
15562
+ idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
15563
+ _e = _a.separateIdCardCaptureSequence,
15564
+ separateIdCardCaptureSequence = _e === void 0 ? false : _e,
15565
+ _f = _a.idCaptureThresholds,
15566
+ idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
15567
+ _g = _a.skipSuccessScreen,
15568
+ skipSuccessScreen = _g === void 0 ? false : _g,
15668
15569
  instructions = _a.instructions,
15669
- _q = _a.guideType,
15670
- guideType = _q === void 0 ? 'fit' : _q,
15671
- _r = _a.portraitGuidesOnMobile,
15672
- portraitGuidesOnMobile = _r === void 0 ? false : _r,
15673
- _s = _a.rotateLoadingOverlayImageWhenPortrait,
15674
- rotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
15675
- _t = _a.modelLoadTimeoutMs,
15676
- modelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
15570
+ _h = _a.guideType,
15571
+ guideType = _h === void 0 ? 'fit' : _h,
15572
+ _j = _a.portraitGuidesOnMobile,
15573
+ portraitGuidesOnMobile = _j === void 0 ? false : _j,
15574
+ _k = _a.rotateLoadingOverlayImageWhenPortrait,
15575
+ rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
15576
+ _l = _a.modelLoadTimeoutMs,
15577
+ modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
15677
15578
  onBeforeSubmit = _a.onBeforeSubmit,
15678
15579
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
15679
15580
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -15687,28 +15588,28 @@
15687
15588
  onUserCancel = _a.onUserCancel,
15688
15589
  onModelError = _a.onModelError,
15689
15590
  onCameraAccessDenied = _a.onCameraAccessDenied,
15690
- _u = _a.theme,
15691
- theme = _u === void 0 ? 'default' : _u,
15692
- _v = _a.assets,
15693
- assets = _v === void 0 ? {} : _v,
15694
- _w = _a.classNames,
15695
- classNames = _w === void 0 ? {} : _w,
15696
- _x = _a.colors,
15697
- colors = _x === void 0 ? {} : _x,
15698
- _y = _a.verbiage,
15699
- verbiage = _y === void 0 ? {} : _y,
15700
- _z = _a.captureSignature,
15701
- captureSignature = _z === void 0 ? false : _z,
15702
- _0 = _a.captureSignatureVideo,
15703
- captureSignatureVideo = _0 === void 0 ? false : _0,
15704
- _1 = _a.captureAdditionalDocuments,
15705
- captureAdditionalDocuments = _1 === void 0 ? [] : _1,
15706
- _2 = _a.geolocationEnabled,
15707
- geolocationEnabled = _2 === void 0 ? true : _2,
15708
- _3 = _a.geolocationRequired,
15709
- geolocationRequired = _3 === void 0 ? false : _3,
15710
- _4 = _a.debugMode,
15711
- debugMode = _4 === void 0 ? false : _4;
15591
+ _m = _a.theme,
15592
+ theme = _m === void 0 ? 'default' : _m,
15593
+ _o = _a.assets,
15594
+ assets = _o === void 0 ? {} : _o,
15595
+ _p = _a.classNames,
15596
+ classNames = _p === void 0 ? {} : _p,
15597
+ _q = _a.colors,
15598
+ colors = _q === void 0 ? {} : _q,
15599
+ _r = _a.verbiage,
15600
+ verbiage = _r === void 0 ? {} : _r,
15601
+ _s = _a.captureSignature,
15602
+ captureSignature = _s === void 0 ? false : _s,
15603
+ _t = _a.captureSignatureVideo,
15604
+ captureSignatureVideo = _t === void 0 ? false : _t,
15605
+ _u = _a.captureAdditionalDocuments,
15606
+ captureAdditionalDocuments = _u === void 0 ? [] : _u,
15607
+ _v = _a.geolocationEnabled,
15608
+ geolocationEnabled = _v === void 0 ? true : _v,
15609
+ _w = _a.geolocationRequired,
15610
+ geolocationRequired = _w === void 0 ? false : _w,
15611
+ _x = _a.debugMode,
15612
+ debugMode = _x === void 0 ? false : _x;
15712
15613
  useLanguage(lang);
15713
15614
  useDebugLogging(debugMode);
15714
15615
  var idCaptureProps = React.useMemo(function () {
@@ -15719,13 +15620,7 @@
15719
15620
  precapturedDocuments: precapturedDocuments,
15720
15621
  captureRequirement: idCaptureRequirement,
15721
15622
  separateIdCardCaptureSequence: separateIdCardCaptureSequence,
15722
- autoCaptureEnabled: idAutoCaptureEnabled,
15723
- idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
15724
- passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
15725
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
15726
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
15727
- passportFocusScoreThreshold: passportFocusScoreThreshold,
15728
- barcodeScanningEnabled: false,
15623
+ thresholds: idCaptureThresholds,
15729
15624
  skipSuccessScreen: skipSuccessScreen,
15730
15625
  loadingOverlayMode: loadingOverlayMode,
15731
15626
  instructions: instructions,
@@ -15739,7 +15634,7 @@
15739
15634
  verbiage: verbiage,
15740
15635
  debugMode: debugMode
15741
15636
  };
15742
- }, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, passportAutoCaptureScoreThreshold, mrzDetectionScoreThreshold, idCardFocusScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
15637
+ }, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
15743
15638
  var additionalDocumentCaptureProps = React.useMemo(function () {
15744
15639
  return {
15745
15640
  documents: captureAdditionalDocuments,
@@ -15933,9 +15828,8 @@
15933
15828
  * Render a fullscreen capture component that performs `IDValidation` and `FaceValidation` sequentially.
15934
15829
  * */
15935
15830
  var IdAndFaceValidation = function IdAndFaceValidation(_a) {
15936
- var _b, _c;
15937
- var _d = _a.lang,
15938
- lang = _d === void 0 ? 'auto' : _d,
15831
+ var _b = _a.lang,
15832
+ lang = _b === void 0 ? 'auto' : _b,
15939
15833
  sessionId = _a.sessionId,
15940
15834
  authUrl = _a.authUrl,
15941
15835
  submissionUrl = _a.submissionUrl,
@@ -15957,39 +15851,29 @@
15957
15851
  webhooksFireOnReview = _a.webhooksFireOnReview,
15958
15852
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
15959
15853
  precapturedDocuments = _a.precapturedDocuments,
15960
- _e = _a.idCaptureLoadingOverlayMode,
15961
- idCaptureLoadingOverlayMode = _e === void 0 ? 'default' : _e,
15962
- _f = _a.idCaptureRequirement,
15963
- idCaptureRequirement = _f === void 0 ? 'idCardOrPassport' : _f,
15964
- _g = _a.idAutoCaptureEnabled,
15965
- idAutoCaptureEnabled = _g === void 0 ? true : _g,
15966
- _h = _a.idCardAutoCaptureScoreThreshold,
15967
- idCardAutoCaptureScoreThreshold = _h === void 0 ? defaultDocumentDetectionThresholds.idCard : _h,
15968
- _j = _a.passportAutoCaptureScoreThreshold,
15969
- passportAutoCaptureScoreThreshold = _j === void 0 ? defaultDocumentDetectionThresholds.passport : _j,
15970
- _k = _a.mrzDetectionScoreThreshold,
15971
- mrzDetectionScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.mrz : _k,
15972
- _l = _a.idCardFocusScoreThreshold,
15973
- idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
15974
- _m = _a.passportFocusScoreThreshold,
15975
- passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
15976
- _o = _a.faceLivenessLoadingOverlayMode,
15977
- faceLivenessLoadingOverlayMode = _o === void 0 ? 'default' : _o,
15978
- _p = _a.faceLivenessTimeoutDurationMs,
15979
- faceLivenessTimeoutDurationMs = _p === void 0 ? 15000 : _p,
15980
- _q = _a.skipSuccessScreen,
15981
- skipSuccessScreen = _q === void 0 ? false : _q,
15854
+ _c = _a.idCaptureLoadingOverlayMode,
15855
+ idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
15856
+ _d = _a.idCaptureRequirement,
15857
+ idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
15858
+ _e = _a.idCaptureThresholds,
15859
+ idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
15860
+ _f = _a.faceLivenessLoadingOverlayMode,
15861
+ faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
15862
+ _g = _a.faceLivenessTimeoutDurationMs,
15863
+ faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
15864
+ _h = _a.skipSuccessScreen,
15865
+ skipSuccessScreen = _h === void 0 ? false : _h,
15982
15866
  idCaptureInstructions = _a.idCaptureInstructions,
15983
- _r = _a.idCaptureGuideType,
15984
- idCaptureGuideType = _r === void 0 ? 'fit' : _r,
15985
- _s = _a.idCapturePortraitGuidesOnMobile,
15986
- idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
15987
- _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
15988
- idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
15989
- _u = _a.idCaptureModelLoadTimeoutMs,
15990
- idCaptureModelLoadTimeoutMs = _u === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _u,
15991
- _v = _a.selfieCaptureModelLoadTimeoutMs,
15992
- selfieCaptureModelLoadTimeoutMs = _v === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _v,
15867
+ _j = _a.idCaptureGuideType,
15868
+ idCaptureGuideType = _j === void 0 ? 'fit' : _j,
15869
+ _k = _a.idCapturePortraitGuidesOnMobile,
15870
+ idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
15871
+ _l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
15872
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
15873
+ _m = _a.idCaptureModelLoadTimeoutMs,
15874
+ idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
15875
+ _o = _a.selfieCaptureModelLoadTimeoutMs,
15876
+ selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
15993
15877
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
15994
15878
  onDocumentUploaded = _a.onDocumentUploaded,
15995
15879
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
@@ -16006,28 +15890,28 @@
16006
15890
  onIdCaptureModelError = _a.onIdCaptureModelError,
16007
15891
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
16008
15892
  onCameraAccessDenied = _a.onCameraAccessDenied,
16009
- _w = _a.captureSignature,
16010
- captureSignature = _w === void 0 ? false : _w,
16011
- _x = _a.captureSignatureVideo,
16012
- captureSignatureVideo = _x === void 0 ? false : _x,
16013
- _y = _a.captureAdditionalDocuments,
16014
- captureAdditionalDocuments = _y === void 0 ? [] : _y,
16015
- _z = _a.theme,
16016
- theme = _z === void 0 ? 'default' : _z,
16017
- _0 = _a.assets,
16018
- assets = _0 === void 0 ? {} : _0,
16019
- _1 = _a.classNames,
16020
- classNames = _1 === void 0 ? {} : _1,
16021
- _2 = _a.colors,
16022
- colors = _2 === void 0 ? {} : _2,
16023
- _3 = _a.verbiage,
16024
- verbiage = _3 === void 0 ? {} : _3,
16025
- _4 = _a.geolocationEnabled,
16026
- geolocationEnabled = _4 === void 0 ? true : _4,
16027
- _5 = _a.geolocationRequired,
16028
- geolocationRequired = _5 === void 0 ? false : _5,
16029
- _6 = _a.debugMode,
16030
- debugMode = _6 === void 0 ? false : _6;
15893
+ _p = _a.captureSignature,
15894
+ captureSignature = _p === void 0 ? false : _p,
15895
+ _q = _a.captureSignatureVideo,
15896
+ captureSignatureVideo = _q === void 0 ? false : _q,
15897
+ _r = _a.captureAdditionalDocuments,
15898
+ captureAdditionalDocuments = _r === void 0 ? [] : _r,
15899
+ _s = _a.theme,
15900
+ theme = _s === void 0 ? 'default' : _s,
15901
+ _t = _a.assets,
15902
+ assets = _t === void 0 ? {} : _t,
15903
+ _u = _a.classNames,
15904
+ classNames = _u === void 0 ? {} : _u,
15905
+ _v = _a.colors,
15906
+ colors = _v === void 0 ? {} : _v,
15907
+ _w = _a.verbiage,
15908
+ verbiage = _w === void 0 ? {} : _w,
15909
+ _x = _a.geolocationEnabled,
15910
+ geolocationEnabled = _x === void 0 ? true : _x,
15911
+ _y = _a.geolocationRequired,
15912
+ geolocationRequired = _y === void 0 ? false : _y,
15913
+ _z = _a.debugMode,
15914
+ debugMode = _z === void 0 ? false : _z;
16031
15915
  useLanguage(lang);
16032
15916
  useDebugLogging(debugMode);
16033
15917
  var idCaptureProps = React.useMemo(function () {
@@ -16041,12 +15925,7 @@
16041
15925
  verbiage: verbiage.idCapture,
16042
15926
  precapturedDocuments: precapturedDocuments,
16043
15927
  captureRequirement: idCaptureRequirement,
16044
- autoCaptureEnabled: idAutoCaptureEnabled,
16045
- idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
16046
- passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
16047
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
16048
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
16049
- passportFocusScoreThreshold: passportFocusScoreThreshold,
15928
+ thresholds: idCaptureThresholds,
16050
15929
  loadingOverlayMode: idCaptureLoadingOverlayMode,
16051
15930
  instructions: idCaptureInstructions,
16052
15931
  guideType: idCaptureGuideType,
@@ -16056,7 +15935,7 @@
16056
15935
  skipSuccessScreen: skipSuccessScreen,
16057
15936
  debugMode: debugMode
16058
15937
  };
16059
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureGuideType, idCaptureInstructions, idCaptureLoadingOverlayMode, idCaptureModelLoadTimeoutMs, idCapturePortraitGuidesOnMobile, idCaptureRequirement, idCaptureRotateLoadingOverlayImageWhenPortrait, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onIdCaptureModelError, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, precapturedDocuments, skipSuccessScreen, verbiage.idCapture]);
15938
+ }, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, skipSuccessScreen, debugMode]);
16060
15939
  var faceLivenessProps = React.useMemo(function () {
16061
15940
  return {
16062
15941
  loadingOverlayMode: faceLivenessLoadingOverlayMode,
@@ -16164,10 +16043,9 @@
16164
16043
  * Render a fullscreen capture component that performs IDValidation and FaceValidation sequentially, and then stores the results in IDmission's customer database using the supplied `enrollmentId` for later verification or 1:N matching.
16165
16044
  */
16166
16045
  var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollment(_a) {
16167
- var _b, _c;
16168
16046
  var enrollmentId = _a.enrollmentId,
16169
- _d = _a.lang,
16170
- lang = _d === void 0 ? 'auto' : _d,
16047
+ _b = _a.lang,
16048
+ lang = _b === void 0 ? 'auto' : _b,
16171
16049
  sessionId = _a.sessionId,
16172
16050
  authUrl = _a.authUrl,
16173
16051
  submissionUrl = _a.submissionUrl,
@@ -16191,39 +16069,29 @@
16191
16069
  webhooksSendProcessedImages = _a.webhooksSendProcessedImages,
16192
16070
  webhooksFireOnReview = _a.webhooksFireOnReview,
16193
16071
  sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
16194
- _e = _a.idCaptureLoadingOverlayMode,
16195
- idCaptureLoadingOverlayMode = _e === void 0 ? 'default' : _e,
16196
- _f = _a.idCaptureRequirement,
16197
- idCaptureRequirement = _f === void 0 ? 'idCardOrPassport' : _f,
16198
- _g = _a.idAutoCaptureEnabled,
16199
- idAutoCaptureEnabled = _g === void 0 ? true : _g,
16200
- _h = _a.idCardAutoCaptureScoreThreshold,
16201
- idCardAutoCaptureScoreThreshold = _h === void 0 ? defaultDocumentDetectionThresholds.idCard : _h,
16202
- _j = _a.passportAutoCaptureScoreThreshold,
16203
- passportAutoCaptureScoreThreshold = _j === void 0 ? defaultDocumentDetectionThresholds.passport : _j,
16204
- _k = _a.mrzDetectionScoreThreshold,
16205
- mrzDetectionScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.mrz : _k,
16206
- _l = _a.idCardFocusScoreThreshold,
16207
- idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
16208
- _m = _a.passportFocusScoreThreshold,
16209
- passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
16210
- _o = _a.faceLivenessTimeoutDurationMs,
16211
- faceLivenessTimeoutDurationMs = _o === void 0 ? 15000 : _o,
16212
- _p = _a.faceLivenessLoadingOverlayMode,
16213
- faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
16214
- _q = _a.skipSuccessScreen,
16215
- skipSuccessScreen = _q === void 0 ? false : _q,
16072
+ _c = _a.idCaptureLoadingOverlayMode,
16073
+ idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
16074
+ _d = _a.idCaptureRequirement,
16075
+ idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
16076
+ _e = _a.idCaptureThresholds,
16077
+ idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
16078
+ _f = _a.faceLivenessTimeoutDurationMs,
16079
+ faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
16080
+ _g = _a.faceLivenessLoadingOverlayMode,
16081
+ faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
16082
+ _h = _a.skipSuccessScreen,
16083
+ skipSuccessScreen = _h === void 0 ? false : _h,
16216
16084
  idCaptureInstructions = _a.idCaptureInstructions,
16217
- _r = _a.idCaptureGuideType,
16218
- idCaptureGuideType = _r === void 0 ? 'fit' : _r,
16219
- _s = _a.idCapturePortraitGuidesOnMobile,
16220
- idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
16221
- _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
16222
- idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
16223
- _u = _a.idCaptureModelLoadTimeoutMs,
16224
- idCaptureModelLoadTimeoutMs = _u === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _u,
16225
- _v = _a.selfieCaptureModelLoadTimeoutMs,
16226
- selfieCaptureModelLoadTimeoutMs = _v === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _v,
16085
+ _j = _a.idCaptureGuideType,
16086
+ idCaptureGuideType = _j === void 0 ? 'fit' : _j,
16087
+ _k = _a.idCapturePortraitGuidesOnMobile,
16088
+ idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
16089
+ _l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
16090
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
16091
+ _m = _a.idCaptureModelLoadTimeoutMs,
16092
+ idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
16093
+ _o = _a.selfieCaptureModelLoadTimeoutMs,
16094
+ selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
16227
16095
  onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
16228
16096
  onDocumentUploadProgress = _a.onDocumentUploadProgress,
16229
16097
  onDocumentUploaded = _a.onDocumentUploaded,
@@ -16239,28 +16107,28 @@
16239
16107
  onIdCaptureModelError = _a.onIdCaptureModelError,
16240
16108
  onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
16241
16109
  onCameraAccessDenied = _a.onCameraAccessDenied,
16242
- _w = _a.captureSignature,
16243
- captureSignature = _w === void 0 ? false : _w,
16244
- _x = _a.captureSignatureVideo,
16245
- captureSignatureVideo = _x === void 0 ? false : _x,
16246
- _y = _a.captureAdditionalDocuments,
16247
- captureAdditionalDocuments = _y === void 0 ? [] : _y,
16248
- _z = _a.theme,
16249
- theme = _z === void 0 ? 'default' : _z,
16250
- _0 = _a.assets,
16251
- assets = _0 === void 0 ? {} : _0,
16252
- _1 = _a.classNames,
16253
- classNames = _1 === void 0 ? {} : _1,
16254
- _2 = _a.colors,
16255
- colors = _2 === void 0 ? {} : _2,
16256
- _3 = _a.verbiage,
16257
- verbiage = _3 === void 0 ? {} : _3,
16258
- _4 = _a.geolocationEnabled,
16259
- geolocationEnabled = _4 === void 0 ? true : _4,
16260
- _5 = _a.geolocationRequired,
16261
- geolocationRequired = _5 === void 0 ? false : _5,
16262
- _6 = _a.debugMode,
16263
- debugMode = _6 === void 0 ? false : _6;
16110
+ _p = _a.captureSignature,
16111
+ captureSignature = _p === void 0 ? false : _p,
16112
+ _q = _a.captureSignatureVideo,
16113
+ captureSignatureVideo = _q === void 0 ? false : _q,
16114
+ _r = _a.captureAdditionalDocuments,
16115
+ captureAdditionalDocuments = _r === void 0 ? [] : _r,
16116
+ _s = _a.theme,
16117
+ theme = _s === void 0 ? 'default' : _s,
16118
+ _t = _a.assets,
16119
+ assets = _t === void 0 ? {} : _t,
16120
+ _u = _a.classNames,
16121
+ classNames = _u === void 0 ? {} : _u,
16122
+ _v = _a.colors,
16123
+ colors = _v === void 0 ? {} : _v,
16124
+ _w = _a.verbiage,
16125
+ verbiage = _w === void 0 ? {} : _w,
16126
+ _x = _a.geolocationEnabled,
16127
+ geolocationEnabled = _x === void 0 ? true : _x,
16128
+ _y = _a.geolocationRequired,
16129
+ geolocationRequired = _y === void 0 ? false : _y,
16130
+ _z = _a.debugMode,
16131
+ debugMode = _z === void 0 ? false : _z;
16264
16132
  useLanguage(lang);
16265
16133
  useDebugLogging(debugMode);
16266
16134
  var idCaptureProps = React.useMemo(function () {
@@ -16270,12 +16138,7 @@
16270
16138
  colors: colors.idCapture,
16271
16139
  verbiage: verbiage.idCapture,
16272
16140
  captureRequirement: idCaptureRequirement,
16273
- autoCaptureEnabled: idAutoCaptureEnabled,
16274
- idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
16275
- passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
16276
- mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
16277
- idCardFocusScoreThreshold: idCardFocusScoreThreshold,
16278
- passportFocusScoreThreshold: passportFocusScoreThreshold,
16141
+ thresholds: idCaptureThresholds,
16279
16142
  loadingOverlayMode: idCaptureLoadingOverlayMode,
16280
16143
  instructions: idCaptureInstructions,
16281
16144
  guideType: idCaptureGuideType,
@@ -16288,7 +16151,7 @@
16288
16151
  skipSuccessScreen: skipSuccessScreen,
16289
16152
  debugMode: debugMode
16290
16153
  };
16291
- }, [assets.idCapture, classNames.idCapture, colors.idCapture, debugMode, idAutoCaptureEnabled, idCaptureGuideType, idCaptureInstructions, idCaptureLoadingOverlayMode, idCaptureModelLoadTimeoutMs, idCapturePortraitGuidesOnMobile, idCaptureRequirement, idCaptureRotateLoadingOverlayImageWhenPortrait, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, onExitCapture, onIdCaptureModelError, onUserCancel, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, skipSuccessScreen, verbiage.idCapture]);
16154
+ }, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
16292
16155
  var faceLivenessProps = React.useMemo(function () {
16293
16156
  return {
16294
16157
  onExitCapture: onExitCapture,
@@ -17626,70 +17489,60 @@
17626
17489
  faceLivenessProps = _a.faceLivenessProps,
17627
17490
  _c = _a.idCaptureModelsEnabled,
17628
17491
  idCaptureModelsEnabled = _c === void 0 ? true : _c,
17629
- _d = _a.idCardFrontDetectionThreshold,
17630
- idCardFrontDetectionThreshold = _d === void 0 ? 0.6 : _d,
17631
- _e = _a.idCardFrontFocusThreshold,
17632
- idCardFrontFocusThreshold = _e === void 0 ? 0 : _e,
17633
- _f = _a.goodIdCardFrontFramesThreshold,
17634
- goodIdCardFrontFramesThreshold = _f === void 0 ? 1 : _f,
17635
- _g = _a.idCardBackDetectionThreshold,
17636
- idCardBackDetectionThreshold = _g === void 0 ? 0.6 : _g,
17637
- _h = _a.idCardBackFocusThreshold,
17638
- idCardBackFocusThreshold = _h === void 0 ? 0 : _h,
17639
- _j = _a.goodIdCardBackFramesThreshold,
17640
- goodIdCardBackFramesThreshold = _j === void 0 ? 1 : _j,
17492
+ _d = _a.videoIdCaptureThresholds,
17493
+ videoIdCaptureThresholds = _d === void 0 ? defaultVideoIdCaptureThresholds : _d,
17641
17494
  readTextPrompt = _a.readTextPrompt,
17642
- _k = _a.readTextTimeoutDurationMs,
17643
- readTextTimeoutDurationMs = _k === void 0 ? 15000 : _k,
17644
- _l = _a.readTextMinReadingMs,
17645
- readTextMinReadingMs = _l === void 0 ? 10000 : _l,
17646
- _m = _a.skipSuccessScreen,
17647
- skipSuccessScreen = _m === void 0 ? false : _m,
17648
- _o = _a.skipIdCapture,
17649
- skipIdCapture = _o === void 0 ? false : _o,
17650
- _p = _a.skipShowIdCardBack,
17651
- skipShowIdCardBack = _p === void 0 ? false : _p,
17652
- _q = _a.idCaptureLoadingOverlayMode,
17653
- idCaptureLoadingOverlayMode = _q === void 0 ? 'default' : _q,
17654
- _r = _a.idCaptureGuideType,
17655
- idCaptureGuideType = _r === void 0 ? 'fit' : _r,
17656
- _s = _a.idCapturePortraitGuidesOnMobile,
17657
- idCapturePortraitGuidesOnMobile = _s === void 0 ? false : _s,
17658
- _t = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
17659
- idCaptureRotateLoadingOverlayImageWhenPortrait = _t === void 0 ? true : _t,
17495
+ _e = _a.readTextTimeoutDurationMs,
17496
+ readTextTimeoutDurationMs = _e === void 0 ? 15000 : _e,
17497
+ _f = _a.readTextMinReadingMs,
17498
+ readTextMinReadingMs = _f === void 0 ? 10000 : _f,
17499
+ _g = _a.skipSuccessScreen,
17500
+ skipSuccessScreen = _g === void 0 ? false : _g,
17501
+ _h = _a.skipIdCapture,
17502
+ skipIdCapture = _h === void 0 ? false : _h,
17503
+ _j = _a.skipShowIdCardBack,
17504
+ skipShowIdCardBack = _j === void 0 ? false : _j,
17505
+ _k = _a.idCaptureLoadingOverlayMode,
17506
+ idCaptureLoadingOverlayMode = _k === void 0 ? 'default' : _k,
17507
+ _l = _a.idCaptureGuideType,
17508
+ idCaptureGuideType = _l === void 0 ? 'fit' : _l,
17509
+ _m = _a.idCapturePortraitGuidesOnMobile,
17510
+ idCapturePortraitGuidesOnMobile = _m === void 0 ? false : _m,
17511
+ _o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
17512
+ idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
17660
17513
  idCardForFaceMatch = _a.idCardForFaceMatch,
17661
- _u = _a.faceLivenessLoadingOverlayMode,
17662
- faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
17663
- _v = _a.disableFaceDetectionWhileAudioCapture,
17664
- disableFaceDetectionWhileAudioCapture = _v === void 0 ? false : _v,
17665
- _w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
17666
- disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
17667
- _x = _a.silentFallback,
17668
- silentFallback = _x === void 0 ? false : _x,
17669
- _y = _a.mergeAVStreams,
17670
- mergeAVStreams = _y === void 0 ? false : _y,
17671
- _z = _a.theme,
17672
- theme = _z === void 0 ? 'default' : _z,
17673
- _0 = _a.assets,
17674
- assets = _0 === void 0 ? {} : _0,
17675
- _1 = _a.classNames,
17676
- classNames = _1 === void 0 ? {} : _1,
17677
- _2 = _a.colors,
17678
- colors = _2 === void 0 ? {} : _2,
17679
- _3 = _a.verbiage,
17680
- verbiage = _3 === void 0 ? {} : _3,
17681
- _4 = _a.captureSignature,
17682
- captureSignature = _4 === void 0 ? false : _4,
17683
- _5 = _a.captureSignatureVideo,
17684
- captureSignatureVideo = _5 === void 0 ? false : _5,
17685
- _6 = _a.captureAdditionalDocuments,
17686
- captureAdditionalDocuments = _6 === void 0 ? [] : _6,
17687
- _7 = _a.geolocationEnabled,
17688
- geolocationEnabled = _7 === void 0 ? true : _7,
17689
- _8 = _a.geolocationRequired,
17690
- geolocationRequired = _8 === void 0 ? false : _8,
17691
- _9 = _a.debugMode,
17692
- debugMode = _9 === void 0 ? false : _9;
17514
+ _p = _a.faceLivenessLoadingOverlayMode,
17515
+ faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
17516
+ _q = _a.disableFaceDetectionWhileAudioCapture,
17517
+ disableFaceDetectionWhileAudioCapture = _q === void 0 ? false : _q,
17518
+ _r = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
17519
+ disableFaceDetectionWhileAudioCaptureMsDelay = _r === void 0 ? 2000 : _r,
17520
+ _s = _a.silentFallback,
17521
+ silentFallback = _s === void 0 ? false : _s,
17522
+ _t = _a.mergeAVStreams,
17523
+ mergeAVStreams = _t === void 0 ? false : _t,
17524
+ _u = _a.theme,
17525
+ theme = _u === void 0 ? 'default' : _u,
17526
+ _v = _a.assets,
17527
+ assets = _v === void 0 ? {} : _v,
17528
+ _w = _a.classNames,
17529
+ classNames = _w === void 0 ? {} : _w,
17530
+ _x = _a.colors,
17531
+ colors = _x === void 0 ? {} : _x,
17532
+ _y = _a.verbiage,
17533
+ verbiage = _y === void 0 ? {} : _y,
17534
+ _z = _a.captureSignature,
17535
+ captureSignature = _z === void 0 ? false : _z,
17536
+ _0 = _a.captureSignatureVideo,
17537
+ captureSignatureVideo = _0 === void 0 ? false : _0,
17538
+ _1 = _a.captureAdditionalDocuments,
17539
+ captureAdditionalDocuments = _1 === void 0 ? [] : _1,
17540
+ _2 = _a.geolocationEnabled,
17541
+ geolocationEnabled = _2 === void 0 ? true : _2,
17542
+ _3 = _a.geolocationRequired,
17543
+ geolocationRequired = _3 === void 0 ? false : _3,
17544
+ _4 = _a.debugMode,
17545
+ debugMode = _4 === void 0 ? false : _4;
17693
17546
  useLanguage(lang);
17694
17547
  useDebugLogging(debugMode);
17695
17548
  var videoIdCaptureProps = React.useMemo(function () {
@@ -17697,12 +17550,7 @@
17697
17550
  idCaptureProps: idCaptureProps,
17698
17551
  faceLivenessProps: faceLivenessProps,
17699
17552
  idCaptureModelsEnabled: idCaptureModelsEnabled,
17700
- idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
17701
- idCardFrontFocusThreshold: idCardFrontFocusThreshold,
17702
- goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
17703
- idCardBackDetectionThreshold: idCardBackDetectionThreshold,
17704
- idCardBackFocusThreshold: idCardBackFocusThreshold,
17705
- goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
17553
+ videoIdCaptureThresholds: videoIdCaptureThresholds,
17706
17554
  readTextPrompt: readTextPrompt,
17707
17555
  readTextTimeoutDurationMs: readTextTimeoutDurationMs,
17708
17556
  readTextMinReadingMs: readTextMinReadingMs,
@@ -17727,7 +17575,7 @@
17727
17575
  verbiage: verbiage,
17728
17576
  debugMode: debugMode
17729
17577
  };
17730
- }, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
17578
+ }, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, videoIdCaptureThresholds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
17731
17579
  var additionalDocumentCaptureProps = React.useMemo(function () {
17732
17580
  return {
17733
17581
  documents: captureAdditionalDocuments,