idmission-web-sdk 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -28
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +3 -12
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +3 -12
- package/dist/components/customer_flows/IdValidation.d.ts +3 -12
- package/dist/components/customer_flows/VideoIdValidation.d.ts +3 -12
- package/dist/components/id_capture/CapturedDocuments.d.ts +2 -0
- package/dist/components/id_capture/FocusModelProvider.d.ts +2 -1
- package/dist/components/id_capture/IdCapture.d.ts +4 -14
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +7 -22
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +11 -38
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +2 -3
- package/dist/components/id_capture/IdCaptureWizard.d.ts +3 -9
- package/dist/components/video_id/IdVideoCapture.d.ts +12 -7
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +3 -8
- package/dist/lib/models/DocumentDetection.d.ts +15 -12
- package/dist/lib/models/Focus.d.ts +6 -2
- package/dist/sdk2.cjs.development.js +754 -920
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +754 -920
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +754 -920
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/stories/Components/IdCapture/LicenseBackCapture.stories.d.ts +0 -48
- package/dist/stories/Components/IdCapture/LicenseFrontCapture.stories.d.ts +0 -45
- package/dist/stories/Components/IdCapture/PassportCapture.stories.d.ts +0 -47
- package/dist/stories/Components/IdCapture/Wizard.stories.d.ts +1 -77
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -49,7 +49,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
49
49
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
50
50
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
51
51
|
|
|
52
|
-
var webSdkVersion = '2.0
|
|
52
|
+
var webSdkVersion = '2.1.0';
|
|
53
53
|
|
|
54
54
|
function getPlatform() {
|
|
55
55
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1634,10 +1634,6 @@ function convertBase64ToBlob(base64Image) {
|
|
|
1634
1634
|
});
|
|
1635
1635
|
}
|
|
1636
1636
|
|
|
1637
|
-
function supportsNativeBarcodeScanning() {
|
|
1638
|
-
return 'BarcodeDetector' in window;
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
1637
|
function getFrameDimensions(frame) {
|
|
1642
1638
|
var frameWidth = frame.width,
|
|
1643
1639
|
frameHeight = frame.height;
|
|
@@ -2509,10 +2505,14 @@ function waitForVideoReady(videoRef, checkEveryMs) {
|
|
|
2509
2505
|
});
|
|
2510
2506
|
}
|
|
2511
2507
|
|
|
2512
|
-
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
2508
|
+
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite";
|
|
2513
2509
|
var defaultFocusModelLoadTimeoutMs = 45000;
|
|
2514
2510
|
var defaultFocusThresholds = {
|
|
2515
|
-
|
|
2511
|
+
idCardFront: {
|
|
2512
|
+
desktop: 0,
|
|
2513
|
+
mobile: 0.3
|
|
2514
|
+
},
|
|
2515
|
+
idCardBack: {
|
|
2516
2516
|
desktop: 0,
|
|
2517
2517
|
mobile: 0.3
|
|
2518
2518
|
},
|
|
@@ -3135,14 +3135,19 @@ function sumUpProgressForDependencies(dependencies) {
|
|
|
3135
3135
|
});
|
|
3136
3136
|
}
|
|
3137
3137
|
|
|
3138
|
-
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
3138
|
+
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240614/model_fp16.tflite";
|
|
3139
3139
|
var defaultDocumentDetectionScoreThreshold = 0.1;
|
|
3140
3140
|
var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
|
|
3141
3141
|
var defaultDocumentDetectionThresholds = {
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3142
|
+
idCardFront: 0.8,
|
|
3143
|
+
idCardBack: 0.8,
|
|
3144
|
+
passport: 0.5
|
|
3145
|
+
};
|
|
3146
|
+
var documentTypeDisplayNames = {
|
|
3147
|
+
idCardFront: 'ID card front',
|
|
3148
|
+
idCardBack: 'ID card back',
|
|
3149
|
+
passport: 'Passport',
|
|
3150
|
+
none: 'None'
|
|
3146
3151
|
};
|
|
3147
3152
|
var detectors = {};
|
|
3148
3153
|
function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
@@ -3297,34 +3302,33 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
3297
3302
|
return n > 0;
|
|
3298
3303
|
});
|
|
3299
3304
|
});
|
|
3300
|
-
var
|
|
3305
|
+
var bestIdCardFront = detectedObjects.find(function (obj) {
|
|
3301
3306
|
return obj.label === 'Document';
|
|
3302
3307
|
});
|
|
3308
|
+
var bestIdCardBack = detectedObjects.find(function (obj) {
|
|
3309
|
+
return obj.label === 'Document back';
|
|
3310
|
+
});
|
|
3303
3311
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
3304
3312
|
return obj.label === 'Passport page';
|
|
3305
3313
|
});
|
|
3306
|
-
var
|
|
3307
|
-
var
|
|
3308
|
-
var
|
|
3309
|
-
var
|
|
3310
|
-
var
|
|
3314
|
+
var idCardFrontDetectionScore = (_a = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _a !== void 0 ? _a : 0;
|
|
3315
|
+
var idCardBackDetectionScore = (_b = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _b !== void 0 ? _b : 0;
|
|
3316
|
+
var passportDetectionScore = (_c = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _c !== void 0 ? _c : 0;
|
|
3317
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_d = thresholds.idCardFront) !== null && _d !== void 0 ? _d : 0);
|
|
3318
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_e = thresholds.idCardBack) !== null && _e !== void 0 ? _e : 0);
|
|
3319
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_f = thresholds.passport) !== null && _f !== void 0 ? _f : 0);
|
|
3320
|
+
var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
3321
|
+
var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
3322
|
+
var detectionScore = (_g = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _g !== void 0 ? _g : 0;
|
|
3311
3323
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
3312
3324
|
var detectedDocumentType = 'none';
|
|
3313
3325
|
if (passportDetectionThresholdMet) {
|
|
3314
3326
|
detectedDocumentType = 'passport';
|
|
3327
|
+
} else if (idCardBackDetectionThresholdMet) {
|
|
3328
|
+
detectedDocumentType = 'idCardBack';
|
|
3315
3329
|
} else if (detectionThresholdMet) {
|
|
3316
|
-
detectedDocumentType = '
|
|
3330
|
+
detectedDocumentType = 'idCardFront';
|
|
3317
3331
|
}
|
|
3318
|
-
var bestMrz = detectedObjects.find(function (obj) {
|
|
3319
|
-
return obj.label === 'MRZ';
|
|
3320
|
-
});
|
|
3321
|
-
var mrzDetectionScore = (_d = bestMrz === null || bestMrz === void 0 ? void 0 : bestMrz.score) !== null && _d !== void 0 ? _d : 0;
|
|
3322
|
-
var mrzDetectionThresholdMet = mrzDetectionScore >= ((_e = thresholds.mrz) !== null && _e !== void 0 ? _e : 0);
|
|
3323
|
-
var bestPdf417 = detectedObjects.find(function (obj) {
|
|
3324
|
-
return obj.label === 'PDF417';
|
|
3325
|
-
});
|
|
3326
|
-
var pdf417DetectionScore = (_f = bestPdf417 === null || bestPdf417 === void 0 ? void 0 : bestPdf417.score) !== null && _f !== void 0 ? _f : 0;
|
|
3327
|
-
var pdf417DetectionThresholdMet = pdf417DetectionScore >= ((_g = thresholds.pdf417) !== null && _g !== void 0 ? _g : 0);
|
|
3328
3332
|
var documentInBounds = false;
|
|
3329
3333
|
if (bestDocument) {
|
|
3330
3334
|
var boundaryPx = 20;
|
|
@@ -3354,15 +3358,13 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
3354
3358
|
detectionTime: time,
|
|
3355
3359
|
detectionThresholdMet: detectionThresholdMet,
|
|
3356
3360
|
detectedDocumentType: detectedDocumentType,
|
|
3361
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
3362
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
3363
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
3364
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
3357
3365
|
passportDetectionScore: passportDetectionScore,
|
|
3358
3366
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3359
|
-
mrzDetectionScore: mrzDetectionScore,
|
|
3360
|
-
mrzDetectionThresholdMet: mrzDetectionThresholdMet,
|
|
3361
|
-
pdf417DetectionScore: pdf417DetectionScore,
|
|
3362
|
-
pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
|
|
3363
3367
|
bestDocument: bestDocument,
|
|
3364
|
-
bestMrz: bestMrz,
|
|
3365
|
-
bestPdf417: bestPdf417,
|
|
3366
3368
|
documentInBounds: documentInBounds,
|
|
3367
3369
|
documentTooClose: documentTooClose,
|
|
3368
3370
|
frameWidth: frameWidth,
|
|
@@ -3610,24 +3612,26 @@ function FocusModelProvider(_a) {
|
|
|
3610
3612
|
focusModelPath = _b === void 0 ? defaultFocusModelPath : _b,
|
|
3611
3613
|
_c = _a.focusModelLoadTimeoutMs,
|
|
3612
3614
|
focusModelLoadTimeoutMs = _c === void 0 ? defaultFocusModelLoadTimeoutMs : _c,
|
|
3613
|
-
onFocusModelError = _a.onFocusModelError
|
|
3615
|
+
onFocusModelError = _a.onFocusModelError,
|
|
3616
|
+
_d = _a.showCanvases,
|
|
3617
|
+
showCanvases = _d === void 0 ? false : _d;
|
|
3614
3618
|
var cropCanvas = React.useRef(null);
|
|
3615
3619
|
var rotateCanvas = React.useRef(null);
|
|
3616
|
-
var
|
|
3617
|
-
focusThresholds =
|
|
3618
|
-
setFocusThresholds =
|
|
3619
|
-
var
|
|
3620
|
-
focusPredictionTime =
|
|
3621
|
-
setFocusPredictionTime =
|
|
3622
|
-
var
|
|
3620
|
+
var _e = React.useState({}),
|
|
3621
|
+
focusThresholds = _e[0],
|
|
3622
|
+
setFocusThresholds = _e[1];
|
|
3623
|
+
var _f = React.useState(0),
|
|
3624
|
+
focusPredictionTime = _f[0],
|
|
3625
|
+
setFocusPredictionTime = _f[1];
|
|
3626
|
+
var _g = useLoadFocusModel({
|
|
3623
3627
|
modelPath: focusModelPath,
|
|
3624
3628
|
modelLoadTimeoutMs: focusModelLoadTimeoutMs,
|
|
3625
3629
|
onModelError: onFocusModelError
|
|
3626
3630
|
}),
|
|
3627
|
-
model =
|
|
3628
|
-
ready =
|
|
3629
|
-
modelDownloadProgress =
|
|
3630
|
-
modelError =
|
|
3631
|
+
model = _g.model,
|
|
3632
|
+
ready = _g.ready,
|
|
3633
|
+
modelDownloadProgress = _g.modelDownloadProgress,
|
|
3634
|
+
modelError = _g.modelError;
|
|
3631
3635
|
var makeFocusPrediction = React.useCallback(function (imageData, box) {
|
|
3632
3636
|
if (!model.current) return null;
|
|
3633
3637
|
var prediction = makeFocusModelPrediction(model.current, imageData, cropCanvas.current, rotateCanvas.current, box);
|
|
@@ -3648,13 +3652,23 @@ function FocusModelProvider(_a) {
|
|
|
3648
3652
|
return /*#__PURE__*/React__default['default'].createElement(FocusModelContext.Provider, {
|
|
3649
3653
|
value: value
|
|
3650
3654
|
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
3651
|
-
ref: rotateCanvas
|
|
3655
|
+
ref: rotateCanvas,
|
|
3656
|
+
style: showCanvases ? {
|
|
3657
|
+
display: 'block'
|
|
3658
|
+
} : undefined
|
|
3652
3659
|
}), /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
3653
|
-
ref: cropCanvas
|
|
3660
|
+
ref: cropCanvas,
|
|
3661
|
+
style: showCanvases ? {
|
|
3662
|
+
display: 'block'
|
|
3663
|
+
} : undefined
|
|
3654
3664
|
}), children);
|
|
3655
3665
|
}
|
|
3656
3666
|
|
|
3657
3667
|
var onMobile = isMobile();
|
|
3668
|
+
var defaultIdCaptureThresholds = {
|
|
3669
|
+
detection: defaultDocumentDetectionThresholds,
|
|
3670
|
+
focus: defaultFocusThresholds
|
|
3671
|
+
};
|
|
3658
3672
|
var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
3659
3673
|
ready: false,
|
|
3660
3674
|
start: function start() {
|
|
@@ -3665,7 +3679,7 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
3665
3679
|
},
|
|
3666
3680
|
modelDownloadProgress: 0,
|
|
3667
3681
|
modelError: null,
|
|
3668
|
-
thresholds:
|
|
3682
|
+
thresholds: defaultIdCaptureThresholds,
|
|
3669
3683
|
setThresholds: function setThresholds() {
|
|
3670
3684
|
return null;
|
|
3671
3685
|
},
|
|
@@ -3680,6 +3694,10 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
3680
3694
|
},
|
|
3681
3695
|
resetBestFrame: function resetBestFrame() {
|
|
3682
3696
|
return null;
|
|
3697
|
+
},
|
|
3698
|
+
requiredDocumentType: 'none',
|
|
3699
|
+
setRequiredDocumentType: function setRequiredDocumentType() {
|
|
3700
|
+
return null;
|
|
3683
3701
|
}
|
|
3684
3702
|
});
|
|
3685
3703
|
function IdCaptureModelsProviderInner(_a) {
|
|
@@ -3712,26 +3730,34 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3712
3730
|
var bestPredictionCanvas = React.useRef(null);
|
|
3713
3731
|
var bestFocusScore = React.useRef(0);
|
|
3714
3732
|
var stopDetection = React.useRef(0);
|
|
3733
|
+
var _e = React.useState('none'),
|
|
3734
|
+
requiredDocumentType = _e[0],
|
|
3735
|
+
setRequiredDocumentType = _e[1];
|
|
3715
3736
|
var thresholds = React.useMemo(function () {
|
|
3716
3737
|
return tslib.__assign(tslib.__assign({}, documentDetectionThresholds), {
|
|
3717
3738
|
focus: focusThresholds
|
|
3718
3739
|
});
|
|
3719
3740
|
}, [documentDetectionThresholds, focusThresholds]);
|
|
3720
3741
|
var setThresholds = React.useCallback(function (thresholds) {
|
|
3721
|
-
|
|
3722
|
-
|
|
3742
|
+
if (thresholds.detection) {
|
|
3743
|
+
setDocumentDetectionThresholds(thresholds.detection);
|
|
3744
|
+
}
|
|
3745
|
+
if (thresholds.focus) {
|
|
3746
|
+
setFocusThresholds(thresholds.focus);
|
|
3747
|
+
}
|
|
3723
3748
|
}, [setDocumentDetectionThresholds, setFocusThresholds]);
|
|
3724
3749
|
React.useEffect(function handleDetections() {
|
|
3725
3750
|
var _this = this;
|
|
3726
3751
|
onDocumentDetected(function (prediction) {
|
|
3727
3752
|
return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
3728
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, focusPrediction, focusThresholdSet, focusThreshold;
|
|
3753
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
3729
3754
|
var _a, _b, _c, _d, _e;
|
|
3730
3755
|
return tslib.__generator(this, function (_f) {
|
|
3731
3756
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
3732
3757
|
stopDetectionAtStart = stopDetection.current;
|
|
3733
3758
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
3734
|
-
|
|
3759
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType;
|
|
3760
|
+
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
|
|
3735
3761
|
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_a = prediction.bestDocument) === null || _a === void 0 ? void 0 : _a.box);
|
|
3736
3762
|
if (focusPrediction) {
|
|
3737
3763
|
focusScore = focusPrediction.score;
|
|
@@ -3760,7 +3786,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3760
3786
|
});
|
|
3761
3787
|
});
|
|
3762
3788
|
});
|
|
3763
|
-
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, thresholds.focus]);
|
|
3789
|
+
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
3764
3790
|
var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
|
|
3765
3791
|
React.useEffect(function handleModelErrors() {
|
|
3766
3792
|
modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
|
|
@@ -3774,9 +3800,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3774
3800
|
canvas: bestPredictionCanvas.current
|
|
3775
3801
|
});
|
|
3776
3802
|
}, [bestFrameDetails]);
|
|
3777
|
-
var
|
|
3778
|
-
canvasKey =
|
|
3779
|
-
setCanvasKey =
|
|
3803
|
+
var _f = React.useState(0),
|
|
3804
|
+
canvasKey = _f[0],
|
|
3805
|
+
setCanvasKey = _f[1];
|
|
3780
3806
|
var resetBestFrame = React.useCallback(function () {
|
|
3781
3807
|
stopDetection.current += 1;
|
|
3782
3808
|
setCanvasKey(function (n) {
|
|
@@ -3786,6 +3812,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3786
3812
|
setBestFrameDetails(null);
|
|
3787
3813
|
bestFocusScore.current = 0;
|
|
3788
3814
|
}, [clearDocumentDetectionLastPredictionCanvas]);
|
|
3815
|
+
React.useEffect(function () {
|
|
3816
|
+
requiredDocumentType && resetBestFrame();
|
|
3817
|
+
}, [requiredDocumentType, resetBestFrame]);
|
|
3789
3818
|
var value = React.useMemo(function () {
|
|
3790
3819
|
return {
|
|
3791
3820
|
ready: documentDetectionModelReady && focusModelReady,
|
|
@@ -3800,9 +3829,11 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3800
3829
|
focusPredictionTime: focusPredictionTime,
|
|
3801
3830
|
getBestFrame: getBestFrame,
|
|
3802
3831
|
resetBestFrame: resetBestFrame,
|
|
3803
|
-
bestFrameDetails: bestFrameDetails
|
|
3832
|
+
bestFrameDetails: bestFrameDetails,
|
|
3833
|
+
requiredDocumentType: requiredDocumentType,
|
|
3834
|
+
setRequiredDocumentType: setRequiredDocumentType
|
|
3804
3835
|
};
|
|
3805
|
-
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
3836
|
+
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
3806
3837
|
return /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsContext.Provider, {
|
|
3807
3838
|
value: value
|
|
3808
3839
|
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
@@ -3851,28 +3882,19 @@ var initialState$4 = {
|
|
|
3851
3882
|
videoHeight: 0,
|
|
3852
3883
|
detectedObjects: [],
|
|
3853
3884
|
bestDocument: undefined,
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
documentType: 'none',
|
|
3885
|
+
detectedDocumentType: 'none',
|
|
3886
|
+
detectionThresholdMet: false,
|
|
3857
3887
|
documentInBounds: false,
|
|
3858
3888
|
documentTooClose: false,
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
pdf417DetectionThresholdMet: false,
|
|
3889
|
+
flipRequired: false,
|
|
3890
|
+
idCardFrontDetectionScore: 0,
|
|
3891
|
+
idCardFrontDetectionThresholdMet: false,
|
|
3892
|
+
idCardBackDetectionScore: 0,
|
|
3893
|
+
idCardBackDetectionThresholdMet: false,
|
|
3894
|
+
passportDetectionScore: 0,
|
|
3895
|
+
passportDetectionThresholdMet: false,
|
|
3867
3896
|
focusScore: 0,
|
|
3868
3897
|
focusThresholdMet: false,
|
|
3869
|
-
barcodeScanningEnabled: false,
|
|
3870
|
-
barcodeResult: null,
|
|
3871
|
-
waitingForBarcodeScan: false,
|
|
3872
|
-
shouldScanBarcode: false,
|
|
3873
|
-
autoCaptureBarcodeRequired: 'mobile',
|
|
3874
|
-
barcodeScanFailedAttempts: 0,
|
|
3875
|
-
maxBarcodeScanAttempts: 10,
|
|
3876
3898
|
isGoodFrame: false,
|
|
3877
3899
|
goodFramesCount: 0,
|
|
3878
3900
|
goodFramesThreshold: 3,
|
|
@@ -3886,8 +3908,6 @@ var initialState$4 = {
|
|
|
3886
3908
|
capturedDocuments: {},
|
|
3887
3909
|
captureRequirement: 'idCardOrPassport',
|
|
3888
3910
|
requestedDocumentType: 'idCardFront',
|
|
3889
|
-
detectedDocumentType: 'none',
|
|
3890
|
-
differentDocumentTypeDetections: 0,
|
|
3891
3911
|
operationStartedAt: null,
|
|
3892
3912
|
captureStartedAt: null
|
|
3893
3913
|
};
|
|
@@ -3922,11 +3942,6 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3922
3942
|
newState.operationStartedAt = new Date();
|
|
3923
3943
|
return newState;
|
|
3924
3944
|
}
|
|
3925
|
-
case 'configureCapture':
|
|
3926
|
-
return tslib.__assign(tslib.__assign(tslib.__assign({}, state), action.payload), {
|
|
3927
|
-
capturing: false,
|
|
3928
|
-
captureFailed: false
|
|
3929
|
-
});
|
|
3930
3945
|
case 'setRequiredDocumentType':
|
|
3931
3946
|
return tslib.__assign(tslib.__assign({}, state), {
|
|
3932
3947
|
requiredDocumentType: action.payload
|
|
@@ -3963,18 +3978,15 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3963
3978
|
case 'objectsDetected':
|
|
3964
3979
|
var _d = action.payload.prediction,
|
|
3965
3980
|
detectedObjects = _d.detectedObjects,
|
|
3966
|
-
detectionScore = _d.detectionScore,
|
|
3967
3981
|
detectionThresholdMet = _d.detectionThresholdMet,
|
|
3968
3982
|
detectedDocumentType = _d.detectedDocumentType,
|
|
3983
|
+
idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
|
|
3984
|
+
idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
|
|
3985
|
+
idCardBackDetectionScore = _d.idCardBackDetectionScore,
|
|
3986
|
+
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
3969
3987
|
passportDetectionScore = _d.passportDetectionScore,
|
|
3970
3988
|
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
3971
|
-
mrzDetectionScore = _d.mrzDetectionScore,
|
|
3972
|
-
mrzDetectionThresholdMet = _d.mrzDetectionThresholdMet,
|
|
3973
|
-
pdf417DetectionScore = _d.pdf417DetectionScore,
|
|
3974
|
-
pdf417DetectionThresholdMet = _d.pdf417DetectionThresholdMet,
|
|
3975
3989
|
bestDocument = _d.bestDocument,
|
|
3976
|
-
bestMrz = _d.bestMrz,
|
|
3977
|
-
bestPdf417 = _d.bestPdf417,
|
|
3978
3990
|
documentInBounds = _d.documentInBounds,
|
|
3979
3991
|
documentTooClose = _d.documentTooClose,
|
|
3980
3992
|
focusScore = _d.focusScore,
|
|
@@ -3990,84 +4002,48 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3990
4002
|
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
3991
4003
|
}
|
|
3992
4004
|
}
|
|
3993
|
-
var
|
|
3994
|
-
var
|
|
3995
|
-
var waitingForBarcodeScan = shouldScanBarcode && !state.barcodeResult;
|
|
3996
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && focusThresholdMet;
|
|
4005
|
+
var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
|
|
4006
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && focusThresholdMet;
|
|
3997
4007
|
var goodFramesCount = state.goodFramesCount;
|
|
3998
4008
|
if (isGoodFrame) {
|
|
3999
4009
|
goodFramesCount += 1;
|
|
4000
4010
|
}
|
|
4011
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
4012
|
+
var requestedDocumentType = state.requestedDocumentType;
|
|
4013
|
+
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4014
|
+
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
4015
|
+
requestedDocumentType = 'passport';
|
|
4016
|
+
}
|
|
4017
|
+
if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
|
|
4018
|
+
requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4019
|
+
}
|
|
4020
|
+
}
|
|
4001
4021
|
return tslib.__assign(tslib.__assign({}, state), {
|
|
4002
4022
|
videoWidth: frameWidth,
|
|
4003
4023
|
videoHeight: frameHeight,
|
|
4004
4024
|
detectedObjects: detectedObjects,
|
|
4005
4025
|
bestDocument: bestDocument,
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4026
|
+
requestedDocumentType: requestedDocumentType,
|
|
4027
|
+
detectedDocumentType: detectedDocumentType,
|
|
4028
|
+
detectionThresholdMet: detectionThresholdMet,
|
|
4009
4029
|
documentInBounds: documentInBounds,
|
|
4010
4030
|
documentTooClose: documentTooClose,
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
passportPageDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4031
|
+
flipRequired: flipRequired,
|
|
4032
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
4033
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
4034
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
4035
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4036
|
+
passportDetectionScore: passportDetectionScore,
|
|
4037
|
+
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4019
4038
|
focusScore: focusScore,
|
|
4020
4039
|
focusThresholdMet: focusThresholdMet,
|
|
4021
|
-
shouldScanBarcode: shouldScanBarcode,
|
|
4022
|
-
waitingForBarcodeScan: waitingForBarcodeScan,
|
|
4023
4040
|
isGoodFrame: isGoodFrame,
|
|
4024
4041
|
goodFramesCount: goodFramesCount,
|
|
4025
4042
|
goodFramesThreshold: goodFramesThreshold,
|
|
4026
|
-
goodFramesThresholdMet:
|
|
4043
|
+
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
4027
4044
|
lastFrameCapturedAt: frameCapturedAt,
|
|
4028
4045
|
frameCaptureRate: frameCaptureRate
|
|
4029
4046
|
});
|
|
4030
|
-
case 'predictionMade':
|
|
4031
|
-
{
|
|
4032
|
-
var _e = action.payload,
|
|
4033
|
-
detectedDocumentType_1 = _e.detectedDocumentType,
|
|
4034
|
-
passportDetectionScore_1 = _e.passportDetectionScore;
|
|
4035
|
-
var requestedDocumentType = state.requestedDocumentType;
|
|
4036
|
-
var newState = tslib.__assign(tslib.__assign({}, state), {
|
|
4037
|
-
detectedDocumentType: detectedDocumentType_1
|
|
4038
|
-
});
|
|
4039
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4040
|
-
var predictionIsRequestedType = requestedDocumentType.startsWith(detectedDocumentType_1);
|
|
4041
|
-
if (predictionIsRequestedType) {
|
|
4042
|
-
newState.differentDocumentTypeDetections = 0;
|
|
4043
|
-
}
|
|
4044
|
-
if (detectedDocumentType_1 === 'passport' && requestedDocumentType !== 'passport') {
|
|
4045
|
-
newState.requestedDocumentType = 'passport';
|
|
4046
|
-
}
|
|
4047
|
-
if (requestedDocumentType === 'passport' && passportDetectionScore_1 < 0.3) {
|
|
4048
|
-
newState.requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4049
|
-
}
|
|
4050
|
-
}
|
|
4051
|
-
return newState;
|
|
4052
|
-
}
|
|
4053
|
-
case 'barcodeScanned':
|
|
4054
|
-
return tslib.__assign(tslib.__assign({}, state), {
|
|
4055
|
-
barcodeResult: action.payload.result,
|
|
4056
|
-
waitingForBarcodeScan: false,
|
|
4057
|
-
autoCaptureBarcodeRequired: false
|
|
4058
|
-
});
|
|
4059
|
-
case 'barcodeScanFailed':
|
|
4060
|
-
{
|
|
4061
|
-
var newState = tslib.__assign(tslib.__assign({}, state), {
|
|
4062
|
-
barcodeScanFailedAttempts: state.barcodeScanFailedAttempts + 1
|
|
4063
|
-
});
|
|
4064
|
-
if (newState.barcodeScanFailedAttempts >= newState.maxBarcodeScanAttempts) {
|
|
4065
|
-
newState.autoCaptureBarcodeRequired = false;
|
|
4066
|
-
newState.shouldScanBarcode = false;
|
|
4067
|
-
newState.waitingForBarcodeScan = false;
|
|
4068
|
-
}
|
|
4069
|
-
return newState;
|
|
4070
|
-
}
|
|
4071
4047
|
case 'captureStarted':
|
|
4072
4048
|
return tslib.__assign(tslib.__assign({}, state), {
|
|
4073
4049
|
captureStartedAt: new Date(),
|
|
@@ -4119,8 +4095,9 @@ var reducer$4 = function reducer(state, action) {
|
|
|
4119
4095
|
newState_1.requestedDocumentType = remainingRequirements[0];
|
|
4120
4096
|
if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
|
|
4121
4097
|
newState_1.captureState = 'requestingFlip';
|
|
4122
|
-
newState_1.
|
|
4123
|
-
newState_1.
|
|
4098
|
+
newState_1.idCardFrontDetectionThresholdMet = false;
|
|
4099
|
+
newState_1.idCardBackDetectionThresholdMet = false;
|
|
4100
|
+
newState_1.passportDetectionThresholdMet = false;
|
|
4124
4101
|
}
|
|
4125
4102
|
}
|
|
4126
4103
|
return newState_1;
|
|
@@ -4151,8 +4128,9 @@ var reducer$4 = function reducer(state, action) {
|
|
|
4151
4128
|
newState_2.requestedDocumentType = remainingRequirements[0];
|
|
4152
4129
|
if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
|
|
4153
4130
|
newState_2.captureState = 'requestingFlip';
|
|
4154
|
-
newState_2.
|
|
4155
|
-
newState_2.
|
|
4131
|
+
newState_2.idCardFrontDetectionThresholdMet = false;
|
|
4132
|
+
newState_2.idCardBackDetectionThresholdMet = false;
|
|
4133
|
+
newState_2.passportDetectionThresholdMet = false;
|
|
4156
4134
|
}
|
|
4157
4135
|
}
|
|
4158
4136
|
return newState_2;
|
|
@@ -4597,85 +4575,42 @@ var templateObject_1$A, templateObject_2$p;
|
|
|
4597
4575
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
4598
4576
|
|
|
4599
4577
|
var IdCapture = function IdCapture(_a) {
|
|
4600
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
|
4578
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4601
4579
|
var requiredDocumentType = _a.requiredDocumentType,
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
_o = _a.autoCaptureBarcodeRequired,
|
|
4605
|
-
autoCaptureBarcodeRequired = _o === void 0 ? 'mobile' : _o,
|
|
4606
|
-
_p = _a.idCardDetectionThreshold,
|
|
4607
|
-
idCardDetectionThreshold = _p === void 0 ? defaultDocumentDetectionThresholds.idCard : _p,
|
|
4608
|
-
_q = _a.passportDetectionThreshold,
|
|
4609
|
-
passportDetectionThreshold = _q === void 0 ? defaultDocumentDetectionThresholds.passport : _q,
|
|
4610
|
-
_r = _a.mrzDetectionScoreThreshold,
|
|
4611
|
-
mrzDetectionScoreThreshold = _r === void 0 ? defaultDocumentDetectionThresholds.mrz : _r,
|
|
4612
|
-
_s = _a.pdf417DetectionThreshold,
|
|
4613
|
-
pdf417DetectionThreshold = _s === void 0 ? defaultDocumentDetectionThresholds.pdf417 : _s,
|
|
4614
|
-
_t = _a.idCardFocusScoreThreshold,
|
|
4615
|
-
idCardFocusScoreThreshold = _t === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _t,
|
|
4616
|
-
_u = _a.passportFocusScoreThreshold,
|
|
4617
|
-
passportFocusScoreThreshold = _u === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _u,
|
|
4618
|
-
_v = _a.barcodeScanningEnabled,
|
|
4619
|
-
barcodeScanningEnabled = _v === void 0 ? true : _v,
|
|
4620
|
-
_w = _a.maxBarcodeScanAttempts,
|
|
4621
|
-
maxBarcodeScanAttempts = _w === void 0 ? 10 : _w,
|
|
4580
|
+
_k = _a.thresholds,
|
|
4581
|
+
thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
|
|
4622
4582
|
guidanceMessage = _a.guidanceMessage,
|
|
4623
4583
|
guidanceSatisfied = _a.guidanceSatisfied,
|
|
4624
|
-
onPrediction = _a.onPrediction,
|
|
4625
4584
|
onCapture = _a.onCapture,
|
|
4626
|
-
|
|
4627
|
-
assets =
|
|
4628
|
-
|
|
4629
|
-
classNames =
|
|
4630
|
-
|
|
4631
|
-
colors =
|
|
4632
|
-
|
|
4633
|
-
rawVerbiage =
|
|
4634
|
-
|
|
4635
|
-
debugMode =
|
|
4636
|
-
var
|
|
4637
|
-
ref =
|
|
4638
|
-
|
|
4639
|
-
width =
|
|
4640
|
-
|
|
4641
|
-
height =
|
|
4642
|
-
var
|
|
4643
|
-
state =
|
|
4644
|
-
dispatch =
|
|
4585
|
+
_l = _a.assets,
|
|
4586
|
+
assets = _l === void 0 ? {} : _l,
|
|
4587
|
+
_m = _a.classNames,
|
|
4588
|
+
classNames = _m === void 0 ? {} : _m,
|
|
4589
|
+
_o = _a.colors,
|
|
4590
|
+
colors = _o === void 0 ? {} : _o,
|
|
4591
|
+
_p = _a.verbiage,
|
|
4592
|
+
rawVerbiage = _p === void 0 ? {} : _p,
|
|
4593
|
+
_q = _a.debugMode,
|
|
4594
|
+
debugMode = _q === void 0 ? false : _q;
|
|
4595
|
+
var _r = useResizeObserver__default['default'](),
|
|
4596
|
+
ref = _r.ref,
|
|
4597
|
+
_s = _r.width,
|
|
4598
|
+
width = _s === void 0 ? 1 : _s,
|
|
4599
|
+
_t = _r.height,
|
|
4600
|
+
height = _t === void 0 ? 1 : _t;
|
|
4601
|
+
var _u = useIdCaptureState(),
|
|
4602
|
+
state = _u[0],
|
|
4603
|
+
dispatch = _u[1];
|
|
4645
4604
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
4646
|
-
var
|
|
4647
|
-
modelsReady =
|
|
4648
|
-
setThresholds =
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
getBestFrame = _6.getBestFrame;
|
|
4605
|
+
var _v = React.useContext(IdCaptureModelsContext),
|
|
4606
|
+
modelsReady = _v.ready,
|
|
4607
|
+
setThresholds = _v.setThresholds,
|
|
4608
|
+
detectionTime = _v.detectionTime,
|
|
4609
|
+
focusPredictionTime = _v.focusPredictionTime,
|
|
4610
|
+
getBestFrame = _v.getBestFrame;
|
|
4653
4611
|
React.useEffect(function () {
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
payload: {
|
|
4657
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
4658
|
-
barcodeScanningEnabled: barcodeScanningEnabled,
|
|
4659
|
-
maxBarcodeScanAttempts: maxBarcodeScanAttempts
|
|
4660
|
-
}
|
|
4661
|
-
});
|
|
4662
|
-
}, [autoCaptureBarcodeRequired, barcodeScanningEnabled, dispatch, maxBarcodeScanAttempts]);
|
|
4663
|
-
React.useEffect(function () {
|
|
4664
|
-
setThresholds({
|
|
4665
|
-
idCard: idCardDetectionThreshold,
|
|
4666
|
-
passport: passportDetectionThreshold,
|
|
4667
|
-
mrz: mrzDetectionScoreThreshold,
|
|
4668
|
-
pdf417: pdf417DetectionThreshold,
|
|
4669
|
-
focus: {
|
|
4670
|
-
idCard: {
|
|
4671
|
-
mobile: idCardFocusScoreThreshold
|
|
4672
|
-
},
|
|
4673
|
-
passport: {
|
|
4674
|
-
mobile: passportFocusScoreThreshold
|
|
4675
|
-
}
|
|
4676
|
-
}
|
|
4677
|
-
});
|
|
4678
|
-
}, [idCardDetectionThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportDetectionThreshold, passportFocusScoreThreshold, pdf417DetectionThreshold, setThresholds]);
|
|
4612
|
+
setThresholds(thresholds);
|
|
4613
|
+
}, [thresholds, setThresholds]);
|
|
4679
4614
|
React.useEffect(function () {
|
|
4680
4615
|
if (!requiredDocumentType) return;
|
|
4681
4616
|
dispatch({
|
|
@@ -4692,18 +4627,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4692
4627
|
}
|
|
4693
4628
|
});
|
|
4694
4629
|
}, [dispatch, height, width]);
|
|
4695
|
-
|
|
4696
|
-
onPredictionMade(function (prediction) {
|
|
4697
|
-
dispatch({
|
|
4698
|
-
type: 'objectsDetected',
|
|
4699
|
-
payload: {
|
|
4700
|
-
prediction: prediction
|
|
4701
|
-
}
|
|
4702
|
-
});
|
|
4703
|
-
onPrediction === null || onPrediction === void 0 ? void 0 : onPrediction(prediction);
|
|
4704
|
-
});
|
|
4705
|
-
}, [dispatch, onPrediction, onPredictionMade]);
|
|
4706
|
-
var shouldCapture = autoCaptureEnabled && state.goodFramesThresholdMet && !state.capturing && !state.waitingForBarcodeScan && timeSince(state.captureStartedAt) >= 3000;
|
|
4630
|
+
var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
|
|
4707
4631
|
React.useEffect(function () {
|
|
4708
4632
|
if (!shouldCapture) return;
|
|
4709
4633
|
dispatch({
|
|
@@ -4717,29 +4641,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4717
4641
|
});
|
|
4718
4642
|
return;
|
|
4719
4643
|
}
|
|
4720
|
-
var
|
|
4644
|
+
var canvas = bestFrame.canvas,
|
|
4721
4645
|
documentType = bestFrame.documentType,
|
|
4722
4646
|
boundingBox = bestFrame.boundingBox,
|
|
4723
4647
|
detectionScore = bestFrame.detectionScore,
|
|
4724
4648
|
focusScore = bestFrame.focusScore;
|
|
4725
|
-
var width =
|
|
4726
|
-
height =
|
|
4727
|
-
var canvas = originalCanvas;
|
|
4728
|
-
// resize image to 2k max if barcode is read
|
|
4729
|
-
var isGreaterThan2k = width > 1920 && height > 1080 || width > 1080 && height > 1920;
|
|
4730
|
-
if (isGreaterThan2k && !!state.barcodeResult) {
|
|
4731
|
-
canvas = document.createElement('canvas');
|
|
4732
|
-
if (width > height) {
|
|
4733
|
-
canvas.width = 1920;
|
|
4734
|
-
canvas.height = height * (1920 / width);
|
|
4735
|
-
} else {
|
|
4736
|
-
canvas.height = 1920;
|
|
4737
|
-
canvas.width = width * (1920 / height);
|
|
4738
|
-
}
|
|
4739
|
-
var ctx2d = canvas.getContext('2d');
|
|
4740
|
-
if (!ctx2d) return;
|
|
4741
|
-
ctx2d.drawImage(originalCanvas, 0, 0, canvas.width, canvas.height);
|
|
4742
|
-
}
|
|
4649
|
+
var width = canvas.width,
|
|
4650
|
+
height = canvas.height;
|
|
4743
4651
|
var imageUrl = canvas.toDataURL('image/jpeg', 0.95);
|
|
4744
4652
|
dispatch({
|
|
4745
4653
|
type: 'frameCaptured',
|
|
@@ -4763,18 +4671,17 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4763
4671
|
type: 'captured'
|
|
4764
4672
|
});
|
|
4765
4673
|
}, 0);
|
|
4766
|
-
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.
|
|
4674
|
+
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.captureStartedAt, state.requestedDocumentType]);
|
|
4767
4675
|
assets.portraitGuidesImageUrl || (assets.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
4768
4676
|
assets.landscapeGuidesImageUrl || (assets.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
4769
4677
|
var theme = styled.useTheme();
|
|
4770
|
-
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (
|
|
4771
|
-
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (
|
|
4678
|
+
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');
|
|
4679
|
+
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');
|
|
4772
4680
|
var verbiage = useTranslations(rawVerbiage, {
|
|
4773
4681
|
instructionText: 'Scan the front of ID',
|
|
4774
4682
|
processingIdCardText: 'ID card front captured.',
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
4683
|
+
guidanceSatisfiedText: "".concat(documentTypeDisplayNames[state.detectedDocumentType], " detected, hold still..."),
|
|
4684
|
+
guidancePleaseFlipText: 'ID card front detected - please flip your ID card',
|
|
4778
4685
|
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
4779
4686
|
guidanceNotCenteredText: 'Document is not centered',
|
|
4780
4687
|
guidanceTooCloseText: 'Document too close, please back up',
|
|
@@ -4789,10 +4696,10 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4789
4696
|
});
|
|
4790
4697
|
var satisfied = state.isGoodFrame;
|
|
4791
4698
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
4792
|
-
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.
|
|
4699
|
+
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.flipRequired ? verbiage.guidancePleaseFlipText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
|
|
4793
4700
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
4794
4701
|
ref: ref,
|
|
4795
|
-
className: "flex ".concat((
|
|
4702
|
+
className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
|
|
4796
4703
|
}, guidanceMessage !== '' && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, {
|
|
4797
4704
|
"$top": "",
|
|
4798
4705
|
"$bottom": "12.5dvh",
|
|
@@ -4801,7 +4708,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4801
4708
|
"$variant": satisfied ? 'positive' : 'default',
|
|
4802
4709
|
className: classNames.guidanceMessage
|
|
4803
4710
|
}, guidanceMessage))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugBoundingBoxOverlay, {
|
|
4804
|
-
"$flipX": !((
|
|
4711
|
+
"$flipX": !((_j = cameraRef.current) === null || _j === void 0 ? void 0 : _j.isRearFacing),
|
|
4805
4712
|
scaling: debugScalingDetails
|
|
4806
4713
|
}, state.detectedObjects.map(function (obj, i) {
|
|
4807
4714
|
var _a;
|
|
@@ -4811,7 +4718,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4811
4718
|
scaling: debugScalingDetails,
|
|
4812
4719
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
4813
4720
|
});
|
|
4814
|
-
}))), 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.
|
|
4721
|
+
}))), 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")))));
|
|
4815
4722
|
};
|
|
4816
4723
|
var timeSince = function timeSince(t) {
|
|
4817
4724
|
if (!t) return 0;
|
|
@@ -5745,11 +5652,7 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
|
|
|
5745
5652
|
setUrl(cropToDetectedObjectBox(imgRef.current, bbox).toDataURL('image/jpeg', 0.95));
|
|
5746
5653
|
}, 100);
|
|
5747
5654
|
}
|
|
5748
|
-
return /*#__PURE__*/React__default['default'].createElement("
|
|
5749
|
-
style: {
|
|
5750
|
-
position: 'relative'
|
|
5751
|
-
}
|
|
5752
|
-
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5655
|
+
return /*#__PURE__*/React__default['default'].createElement("img", {
|
|
5753
5656
|
ref: imgRef,
|
|
5754
5657
|
alt: alt,
|
|
5755
5658
|
className: className,
|
|
@@ -5769,13 +5672,12 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
|
|
|
5769
5672
|
(_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(link);
|
|
5770
5673
|
});
|
|
5771
5674
|
}
|
|
5772
|
-
})
|
|
5675
|
+
});
|
|
5773
5676
|
};
|
|
5774
5677
|
|
|
5775
5678
|
var OverlayInstruction = styled__default['default'].p(templateObject_1$u || (templateObject_1$u = tslib.__makeTemplateObject(["\n font-size: 18px;\n margin: 30px 0;\n"], ["\n font-size: 18px;\n margin: 30px 0;\n"])));
|
|
5776
5679
|
var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
5777
5680
|
var capturedDocuments = _a.capturedDocuments,
|
|
5778
|
-
// barcodeResult,
|
|
5779
5681
|
onSubmitClick = _a.onSubmitClick,
|
|
5780
5682
|
onRetryClick = _a.onRetryClick,
|
|
5781
5683
|
_b = _a.classNames,
|
|
@@ -5783,7 +5685,9 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5783
5685
|
_c = _a.colors,
|
|
5784
5686
|
colors = _c === void 0 ? {} : _c,
|
|
5785
5687
|
_d = _a.verbiage,
|
|
5786
|
-
rawVerbiage = _d === void 0 ? {} : _d
|
|
5688
|
+
rawVerbiage = _d === void 0 ? {} : _d,
|
|
5689
|
+
_e = _a.debugMode,
|
|
5690
|
+
debugMode = _e === void 0 ? false : _e;
|
|
5787
5691
|
var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
|
|
5788
5692
|
var idCardFront = capturedDocuments.idCardFront,
|
|
5789
5693
|
idCardBack = capturedDocuments.idCardBack,
|
|
@@ -5818,7 +5722,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5818
5722
|
image: idCardFront,
|
|
5819
5723
|
className: classNames.image,
|
|
5820
5724
|
alt: verbiage.idCardFrontText
|
|
5821
|
-
})))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
5725
|
+
})), 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, {
|
|
5822
5726
|
className: classNames.imageCol
|
|
5823
5727
|
}, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
|
|
5824
5728
|
className: classNames.imageHeading
|
|
@@ -5828,7 +5732,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5828
5732
|
image: idCardBack,
|
|
5829
5733
|
className: classNames.image,
|
|
5830
5734
|
alt: verbiage.idCardBackText
|
|
5831
|
-
})))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
5735
|
+
})), 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, {
|
|
5832
5736
|
className: classNames.imageCol
|
|
5833
5737
|
}, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
|
|
5834
5738
|
className: classNames.imageHeading
|
|
@@ -5838,7 +5742,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5838
5742
|
image: passport,
|
|
5839
5743
|
className: classNames.image,
|
|
5840
5744
|
alt: verbiage.passportText
|
|
5841
|
-
})))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
|
|
5745
|
+
})), 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, {
|
|
5842
5746
|
className: classNames.instruction
|
|
5843
5747
|
}, verbiage.instructionText), /*#__PURE__*/React__default['default'].createElement(ButtonsRow, {
|
|
5844
5748
|
className: classNames.buttonsRow
|
|
@@ -6440,13 +6344,8 @@ function IdCaptureGuides(_a) {
|
|
|
6440
6344
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
6441
6345
|
var verbiage = useTranslations(rawVerbiage, {
|
|
6442
6346
|
instructionText: 'Scan the front of ID',
|
|
6443
|
-
processingIdCardText: 'ID card front captured.',
|
|
6444
6347
|
capturingText: 'Capturing...',
|
|
6445
|
-
captureFailedText: 'Capture failed!'
|
|
6446
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
6447
|
-
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
6448
|
-
guidanceNotCenteredText: 'Document is not centered',
|
|
6449
|
-
guidanceNotDetectedText: 'Document not detected'
|
|
6348
|
+
captureFailedText: 'Capture failed!'
|
|
6450
6349
|
});
|
|
6451
6350
|
var isMobile = window.innerWidth < window.innerHeight;
|
|
6452
6351
|
var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
|
|
@@ -6460,7 +6359,7 @@ function IdCaptureGuides(_a) {
|
|
|
6460
6359
|
landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
|
|
6461
6360
|
isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
|
|
6462
6361
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
6463
|
-
imageVisible: requestingFlip || !state.
|
|
6362
|
+
imageVisible: requestingFlip || !state.idCardFrontDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
|
|
6464
6363
|
})), guideType === 'fit' && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureFitGuide, {
|
|
6465
6364
|
classNames: classNames,
|
|
6466
6365
|
requestingFlip: requestingFlip,
|
|
@@ -6470,7 +6369,7 @@ function IdCaptureGuides(_a) {
|
|
|
6470
6369
|
backImageUrl: backImageUrl,
|
|
6471
6370
|
isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
|
|
6472
6371
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
6473
|
-
imageVisible: requestingFlip || !state.
|
|
6372
|
+
imageVisible: requestingFlip || !state.detectionThresholdMet || !state.documentInBounds || state.documentTooClose || state.flipRequired
|
|
6474
6373
|
})));
|
|
6475
6374
|
}
|
|
6476
6375
|
|
|
@@ -7365,78 +7264,66 @@ var StyledButtonsRow$8 = styled__default['default'](ButtonsRow)(templateObject_6
|
|
|
7365
7264
|
var templateObject_1$l, templateObject_2$f, templateObject_3$d, templateObject_4$8, templateObject_5$4, templateObject_6$3;
|
|
7366
7265
|
|
|
7367
7266
|
var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
7368
|
-
var _b, _c, _d, _e, _f, _g
|
|
7369
|
-
var _k, _l, _m, _o, _p, _q, _r, _s
|
|
7267
|
+
var _b, _c, _d, _e, _f, _g;
|
|
7268
|
+
var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
7370
7269
|
var onSuccess = _a.onSuccess,
|
|
7371
7270
|
onExitCapture = _a.onExitCapture,
|
|
7372
7271
|
onUserCancel = _a.onUserCancel,
|
|
7373
|
-
|
|
7374
|
-
loadingOverlayMode =
|
|
7272
|
+
_t = _a.loadingOverlayMode,
|
|
7273
|
+
loadingOverlayMode = _t === void 0 ? 'default' : _t,
|
|
7375
7274
|
precapturedDocuments = _a.precapturedDocuments,
|
|
7376
|
-
|
|
7377
|
-
captureRequirement =
|
|
7378
|
-
|
|
7379
|
-
separateIdCardCaptureSequence =
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
_0 = _a.barcodeScanningEnabled,
|
|
7385
|
-
barcodeScanningEnabled = _0 === void 0 ? false : _0,
|
|
7386
|
-
_1 = _a.idCardAutoCaptureScoreThreshold,
|
|
7387
|
-
idCardAutoCaptureScoreThreshold = _1 === void 0 ? defaultDocumentDetectionThresholds.idCard : _1,
|
|
7388
|
-
_2 = _a.passportAutoCaptureScoreThreshold,
|
|
7389
|
-
passportAutoCaptureScoreThreshold = _2 === void 0 ? defaultDocumentDetectionThresholds.passport : _2,
|
|
7390
|
-
_3 = _a.mrzDetectionScoreThreshold,
|
|
7391
|
-
mrzDetectionScoreThreshold = _3 === void 0 ? defaultDocumentDetectionThresholds.mrz : _3,
|
|
7392
|
-
_4 = _a.idCardFocusScoreThreshold,
|
|
7393
|
-
idCardFocusScoreThreshold = _4 === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _4,
|
|
7394
|
-
_5 = _a.passportFocusScoreThreshold,
|
|
7395
|
-
passportFocusScoreThreshold = _5 === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _5,
|
|
7396
|
-
_6 = _a.skipSuccessScreen,
|
|
7397
|
-
skipSuccessScreen = _6 === void 0 ? false : _6,
|
|
7275
|
+
_u = _a.captureRequirement,
|
|
7276
|
+
captureRequirement = _u === void 0 ? 'idCardOrPassport' : _u,
|
|
7277
|
+
_v = _a.separateIdCardCaptureSequence,
|
|
7278
|
+
separateIdCardCaptureSequence = _v === void 0 ? false : _v,
|
|
7279
|
+
_w = _a.thresholds,
|
|
7280
|
+
thresholds = _w === void 0 ? defaultIdCaptureThresholds : _w,
|
|
7281
|
+
_x = _a.skipSuccessScreen,
|
|
7282
|
+
skipSuccessScreen = _x === void 0 ? false : _x,
|
|
7398
7283
|
instructions = _a.instructions,
|
|
7399
|
-
|
|
7400
|
-
releaseCameraAccessOnExit =
|
|
7401
|
-
|
|
7402
|
-
guideType =
|
|
7403
|
-
|
|
7404
|
-
portraitGuidesOnMobile =
|
|
7405
|
-
|
|
7406
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
7407
|
-
|
|
7408
|
-
silentFallback =
|
|
7409
|
-
|
|
7410
|
-
assets =
|
|
7411
|
-
|
|
7412
|
-
classNames =
|
|
7413
|
-
|
|
7414
|
-
colors =
|
|
7415
|
-
|
|
7416
|
-
verbiage =
|
|
7417
|
-
|
|
7418
|
-
debugMode =
|
|
7419
|
-
var
|
|
7420
|
-
state =
|
|
7421
|
-
dispatch =
|
|
7422
|
-
var
|
|
7423
|
-
cameraAccessDenied =
|
|
7424
|
-
releaseCameraAccess =
|
|
7425
|
-
var
|
|
7426
|
-
overlayDismissed =
|
|
7427
|
-
setOverlayDismissed =
|
|
7428
|
-
var
|
|
7429
|
-
submissionStatus =
|
|
7430
|
-
setIdFrontImage =
|
|
7431
|
-
setIdBackImage =
|
|
7432
|
-
setPassportImage =
|
|
7433
|
-
logIdFrontCaptureAttempt =
|
|
7434
|
-
logIdBackCaptureAttempt =
|
|
7435
|
-
var
|
|
7436
|
-
start =
|
|
7437
|
-
stop =
|
|
7438
|
-
|
|
7439
|
-
|
|
7284
|
+
_y = _a.releaseCameraAccessOnExit,
|
|
7285
|
+
releaseCameraAccessOnExit = _y === void 0 ? true : _y,
|
|
7286
|
+
_z = _a.guideType,
|
|
7287
|
+
guideType = _z === void 0 ? 'fit' : _z,
|
|
7288
|
+
_0 = _a.portraitGuidesOnMobile,
|
|
7289
|
+
portraitGuidesOnMobile = _0 === void 0 ? false : _0,
|
|
7290
|
+
_1 = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
7291
|
+
rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
|
|
7292
|
+
_2 = _a.silentFallback,
|
|
7293
|
+
silentFallback = _2 === void 0 ? false : _2,
|
|
7294
|
+
_3 = _a.assets,
|
|
7295
|
+
assets = _3 === void 0 ? {} : _3,
|
|
7296
|
+
_4 = _a.classNames,
|
|
7297
|
+
classNames = _4 === void 0 ? {} : _4,
|
|
7298
|
+
_5 = _a.colors,
|
|
7299
|
+
colors = _5 === void 0 ? {} : _5,
|
|
7300
|
+
_6 = _a.verbiage,
|
|
7301
|
+
verbiage = _6 === void 0 ? {} : _6,
|
|
7302
|
+
_7 = _a.debugMode,
|
|
7303
|
+
debugMode = _7 === void 0 ? false : _7;
|
|
7304
|
+
var _8 = useIdCaptureState(),
|
|
7305
|
+
state = _8[0],
|
|
7306
|
+
dispatch = _8[1];
|
|
7307
|
+
var _9 = React.useContext(CameraStateContext),
|
|
7308
|
+
cameraAccessDenied = _9.cameraAccessDenied,
|
|
7309
|
+
releaseCameraAccess = _9.releaseCameraAccess;
|
|
7310
|
+
var _10 = React.useState(false),
|
|
7311
|
+
overlayDismissed = _10[0],
|
|
7312
|
+
setOverlayDismissed = _10[1];
|
|
7313
|
+
var _11 = React.useContext(SubmissionContext),
|
|
7314
|
+
submissionStatus = _11.submissionStatus,
|
|
7315
|
+
setIdFrontImage = _11.setIdFrontImage,
|
|
7316
|
+
setIdBackImage = _11.setIdBackImage,
|
|
7317
|
+
setPassportImage = _11.setPassportImage,
|
|
7318
|
+
logIdFrontCaptureAttempt = _11.logIdFrontCaptureAttempt,
|
|
7319
|
+
logIdBackCaptureAttempt = _11.logIdBackCaptureAttempt;
|
|
7320
|
+
var _12 = React.useContext(IdCaptureModelsContext),
|
|
7321
|
+
start = _12.start,
|
|
7322
|
+
stop = _12.stop,
|
|
7323
|
+
onPredictionMade = _12.onPredictionMade,
|
|
7324
|
+
setRequiredDocumentType = _12.setRequiredDocumentType,
|
|
7325
|
+
modelError = _12.modelError,
|
|
7326
|
+
resetBestFrame = _12.resetBestFrame;
|
|
7440
7327
|
React.useEffect(function () {
|
|
7441
7328
|
dispatch({
|
|
7442
7329
|
type: 'configureWizard',
|
|
@@ -7461,16 +7348,29 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7461
7348
|
type: 'captureStarted'
|
|
7462
7349
|
});
|
|
7463
7350
|
start();
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7351
|
+
}, [dispatch, overlayDismissed, start, state.captureState]);
|
|
7352
|
+
React.useEffect(function () {
|
|
7353
|
+
onPredictionMade(function (prediction) {
|
|
7354
|
+
if (state.captureState === 'capturing') {
|
|
7355
|
+
dispatch({
|
|
7356
|
+
type: 'objectsDetected',
|
|
7357
|
+
payload: {
|
|
7358
|
+
prediction: prediction
|
|
7359
|
+
}
|
|
7360
|
+
});
|
|
7361
|
+
} else if (state.captureState === 'requestingFlip') {
|
|
7362
|
+
if (prediction.idCardBackDetectionThresholdMet) {
|
|
7363
|
+
resetBestFrame();
|
|
7364
|
+
dispatch({
|
|
7365
|
+
type: 'flipRequestCompleted'
|
|
7366
|
+
});
|
|
7367
|
+
}
|
|
7368
|
+
}
|
|
7472
7369
|
});
|
|
7473
|
-
}, [dispatch]);
|
|
7370
|
+
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
|
|
7371
|
+
React.useEffect(function () {
|
|
7372
|
+
if (state.captureState === 'complete') stop();
|
|
7373
|
+
}, [state.captureState, stop]);
|
|
7474
7374
|
var onCapture = React.useCallback(function (imageData, width, height, documentType, metadata) {
|
|
7475
7375
|
logCaptureMetadata(metadata);
|
|
7476
7376
|
dispatch({
|
|
@@ -7480,7 +7380,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7480
7380
|
width: width,
|
|
7481
7381
|
height: height,
|
|
7482
7382
|
documentType: documentType,
|
|
7483
|
-
boundingBox: metadata.boundingBox
|
|
7383
|
+
boundingBox: metadata.boundingBox,
|
|
7384
|
+
detectionScore: metadata.bestDetectionScore,
|
|
7385
|
+
focusScore: metadata.bestFocusScore
|
|
7484
7386
|
}
|
|
7485
7387
|
});
|
|
7486
7388
|
}, [dispatch, logCaptureMetadata]);
|
|
@@ -7510,9 +7412,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7510
7412
|
type: 'resetWizard'
|
|
7511
7413
|
});
|
|
7512
7414
|
}, [dispatch]);
|
|
7513
|
-
var
|
|
7514
|
-
attempt =
|
|
7515
|
-
setAttempt =
|
|
7415
|
+
var _13 = React.useState(0),
|
|
7416
|
+
attempt = _13[0],
|
|
7417
|
+
setAttempt = _13[1];
|
|
7516
7418
|
var onExit = React.useCallback(function () {
|
|
7517
7419
|
setOverlayDismissed(false);
|
|
7518
7420
|
setAttempt(function (n) {
|
|
@@ -7537,19 +7439,19 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7537
7439
|
}
|
|
7538
7440
|
}, [cameraAccessDenied]);
|
|
7539
7441
|
assets.idCardFront || (assets.idCardFront = {});
|
|
7540
|
-
(
|
|
7541
|
-
(
|
|
7442
|
+
(_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
7443
|
+
(_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
7542
7444
|
assets.idCardBack || (assets.idCardBack = {});
|
|
7543
|
-
(
|
|
7544
|
-
(
|
|
7445
|
+
(_k = assets.idCardBack).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
|
|
7446
|
+
(_l = assets.idCardBack).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
7545
7447
|
assets.passport || (assets.passport = {});
|
|
7546
|
-
(
|
|
7547
|
-
(
|
|
7448
|
+
(_m = assets.passport).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
|
|
7449
|
+
(_o = assets.passport).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
|
|
7548
7450
|
assets.flipIdPrompt || (assets.flipIdPrompt = {});
|
|
7549
|
-
(
|
|
7550
|
-
(
|
|
7551
|
-
(
|
|
7552
|
-
(
|
|
7451
|
+
(_p = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_p.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
|
|
7452
|
+
(_q = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_q.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
|
|
7453
|
+
(_r = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_r.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
|
|
7454
|
+
(_s = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_s.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
|
|
7553
7455
|
var idCaptureVerbiages = {
|
|
7554
7456
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
7555
7457
|
instructionText: 'Scan the front of ID',
|
|
@@ -7563,24 +7465,35 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7563
7465
|
})
|
|
7564
7466
|
};
|
|
7565
7467
|
var theme = styled.useTheme();
|
|
7566
|
-
var
|
|
7567
|
-
guideRectX =
|
|
7568
|
-
guideRectY =
|
|
7569
|
-
guideRectWidth =
|
|
7570
|
-
guideRectHeight =
|
|
7571
|
-
imageUrl =
|
|
7468
|
+
var _14 = useIdCaptureState()[0],
|
|
7469
|
+
guideRectX = _14.guideRectX,
|
|
7470
|
+
guideRectY = _14.guideRectY,
|
|
7471
|
+
guideRectWidth = _14.guideRectWidth,
|
|
7472
|
+
guideRectHeight = _14.guideRectHeight,
|
|
7473
|
+
imageUrl = _14.imageUrl;
|
|
7572
7474
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
7573
7475
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
7574
7476
|
React.useEffect(function () {
|
|
7575
7477
|
if (separateIdCardCaptureSequence) return;
|
|
7576
|
-
if (state.captureState
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
}
|
|
7478
|
+
if (state.captureState !== 'requestingFlip') return;
|
|
7479
|
+
var t = setTimeout(function () {
|
|
7480
|
+
resetBestFrame();
|
|
7481
|
+
dispatch({
|
|
7482
|
+
type: 'flipRequestCompleted'
|
|
7483
|
+
});
|
|
7484
|
+
}, 6000);
|
|
7485
|
+
return function () {
|
|
7486
|
+
clearTimeout(t);
|
|
7487
|
+
};
|
|
7488
|
+
}, [dispatch, resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
|
|
7489
|
+
React.useEffect(function () {
|
|
7490
|
+
if (state.requestedDocumentType === 'idCardBack') {
|
|
7491
|
+
setRequiredDocumentType('idCardBack');
|
|
7582
7492
|
}
|
|
7583
|
-
|
|
7493
|
+
return function () {
|
|
7494
|
+
setRequiredDocumentType('none');
|
|
7495
|
+
};
|
|
7496
|
+
}, [setRequiredDocumentType, state.requestedDocumentType]);
|
|
7584
7497
|
var handleCapture = React.useCallback(function (imageData) {
|
|
7585
7498
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
7586
7499
|
var base64ImageData;
|
|
@@ -7614,7 +7527,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7614
7527
|
});
|
|
7615
7528
|
}
|
|
7616
7529
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
7617
|
-
className: "flex ".concat((
|
|
7530
|
+
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
7618
7531
|
}, state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement(CameraFeedWrapper, {
|
|
7619
7532
|
"$x": guideRectX,
|
|
7620
7533
|
"$y": guideRectY,
|
|
@@ -7625,15 +7538,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7625
7538
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
|
|
7626
7539
|
}))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__default['default'].createElement(IdCapture, {
|
|
7627
7540
|
requiredDocumentType: state.requestedDocumentType,
|
|
7628
|
-
|
|
7629
|
-
idCardDetectionThreshold: idCardAutoCaptureScoreThreshold,
|
|
7630
|
-
passportDetectionThreshold: passportAutoCaptureScoreThreshold,
|
|
7631
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
7632
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
7633
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
7634
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
7635
|
-
barcodeScanningEnabled: barcodeScanningEnabled && state.requestedDocumentType === 'idCardBack',
|
|
7636
|
-
onPrediction: onPrediction,
|
|
7541
|
+
thresholds: thresholds,
|
|
7637
7542
|
onCapture: onCapture,
|
|
7638
7543
|
assets: idCaptureAssets,
|
|
7639
7544
|
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.capture,
|
|
@@ -7649,15 +7554,15 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7649
7554
|
assets: idCaptureAssets,
|
|
7650
7555
|
colors: colors,
|
|
7651
7556
|
verbiage: idCaptureVerbiage
|
|
7652
|
-
}), !((
|
|
7653
|
-
classNames: (
|
|
7654
|
-
text: (
|
|
7557
|
+
}), !((_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, {
|
|
7558
|
+
classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
|
|
7559
|
+
text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
|
|
7655
7560
|
imageUrl: imageUrl
|
|
7656
7561
|
})), state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7657
7562
|
id: "idmission-above-guides-content"
|
|
7658
7563
|
})), /*#__PURE__*/React__default['default'].createElement(ExitCaptureButton, {
|
|
7659
7564
|
onClick: onExit,
|
|
7660
|
-
className: (
|
|
7565
|
+
className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.exitCaptureBtn
|
|
7661
7566
|
}), !overlayDismissed && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureLoadingOverlay, {
|
|
7662
7567
|
key: attempt,
|
|
7663
7568
|
mode: loadingOverlayMode,
|
|
@@ -7684,12 +7589,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7684
7589
|
verbiage: verbiage.success
|
|
7685
7590
|
})), state.captureState === 'complete' && showSuccessScreen && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureSuccess, {
|
|
7686
7591
|
capturedDocuments: state.capturedDocuments,
|
|
7687
|
-
barcodeResult: state.barcodeResult,
|
|
7688
7592
|
classNames: classNames.success,
|
|
7689
7593
|
onSubmitClick: onSubmitClick,
|
|
7690
7594
|
onRetryClick: onRetryClick,
|
|
7691
7595
|
colors: colors.success,
|
|
7692
|
-
verbiage: verbiage.success
|
|
7596
|
+
verbiage: verbiage.success,
|
|
7597
|
+
debugMode: debugMode
|
|
7693
7598
|
})));
|
|
7694
7599
|
};
|
|
7695
7600
|
|
|
@@ -9758,7 +9663,7 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream, mergeAVStr
|
|
|
9758
9663
|
var processAudio = React.useCallback(function () {
|
|
9759
9664
|
var _a;
|
|
9760
9665
|
var audioBlob = new Blob(audioChunks.current, {
|
|
9761
|
-
type: 'audio/
|
|
9666
|
+
type: 'audio/mp4'
|
|
9762
9667
|
});
|
|
9763
9668
|
audioChunks.current = [];
|
|
9764
9669
|
setAudioUrl(URL.createObjectURL(audioBlob));
|
|
@@ -10549,6 +10454,31 @@ var DoneButton = styled__default['default'](LoaderButton)(templateObject_6 || (t
|
|
|
10549
10454
|
var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4$1, templateObject_5, templateObject_6;
|
|
10550
10455
|
|
|
10551
10456
|
var edgeBoundary = 0.05;
|
|
10457
|
+
var defaultVideoIdCaptureThresholds = {
|
|
10458
|
+
detection: {
|
|
10459
|
+
idCardFront: 0.6,
|
|
10460
|
+
idCardBack: 0.6,
|
|
10461
|
+
passport: 1
|
|
10462
|
+
},
|
|
10463
|
+
focus: {
|
|
10464
|
+
idCardFront: {
|
|
10465
|
+
desktop: 0,
|
|
10466
|
+
mobile: 0
|
|
10467
|
+
},
|
|
10468
|
+
idCardBack: {
|
|
10469
|
+
desktop: 0,
|
|
10470
|
+
mobile: 0
|
|
10471
|
+
},
|
|
10472
|
+
passport: {
|
|
10473
|
+
desktop: 0,
|
|
10474
|
+
mobile: 0
|
|
10475
|
+
}
|
|
10476
|
+
},
|
|
10477
|
+
goodFrames: {
|
|
10478
|
+
idCardFront: 1,
|
|
10479
|
+
idCardBack: 1
|
|
10480
|
+
}
|
|
10481
|
+
};
|
|
10552
10482
|
var IdVideoCapture = function IdVideoCapture(_a) {
|
|
10553
10483
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
10554
10484
|
var onComplete = _a.onComplete,
|
|
@@ -10560,96 +10490,85 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10560
10490
|
idCaptureModelsEnabled = _w === void 0 ? true : _w,
|
|
10561
10491
|
_x = _a.idCardFrontDelay,
|
|
10562
10492
|
idCardFrontDelay = _x === void 0 ? 1000 : _x,
|
|
10563
|
-
_y = _a.
|
|
10564
|
-
|
|
10565
|
-
_z = _a.
|
|
10566
|
-
|
|
10567
|
-
_0 = _a.
|
|
10568
|
-
|
|
10569
|
-
_1 = _a.idCardBackDetectionThreshold,
|
|
10570
|
-
idCardBackDetectionThreshold = _1 === void 0 ? 0.6 : _1,
|
|
10571
|
-
_2 = _a.idCardBackFocusThreshold,
|
|
10572
|
-
idCardBackFocusThreshold = _2 === void 0 ? 0 : _2,
|
|
10573
|
-
_3 = _a.goodIdCardBackFramesThreshold,
|
|
10574
|
-
goodIdCardBackFramesThreshold = _3 === void 0 ? 1 : _3,
|
|
10575
|
-
_4 = _a.skipShowIdCardBack,
|
|
10576
|
-
skipShowIdCardBack = _4 === void 0 ? false : _4,
|
|
10577
|
-
_5 = _a.captureCountdownSeconds,
|
|
10578
|
-
captureCountdownSeconds = _5 === void 0 ? 3 : _5,
|
|
10493
|
+
_y = _a.videoIdCaptureThresholds,
|
|
10494
|
+
videoIdCaptureThresholds = _y === void 0 ? defaultVideoIdCaptureThresholds : _y,
|
|
10495
|
+
_z = _a.skipShowIdCardBack,
|
|
10496
|
+
skipShowIdCardBack = _z === void 0 ? false : _z,
|
|
10497
|
+
_0 = _a.captureCountdownSeconds,
|
|
10498
|
+
captureCountdownSeconds = _0 === void 0 ? 3 : _0,
|
|
10579
10499
|
readTextPrompt = _a.readTextPrompt,
|
|
10580
|
-
|
|
10581
|
-
readTextTimeoutDurationMs =
|
|
10582
|
-
|
|
10583
|
-
readTextMinReadingMs =
|
|
10584
|
-
|
|
10585
|
-
disableFaceDetectionWhileAudioCapture =
|
|
10586
|
-
|
|
10587
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
10588
|
-
|
|
10589
|
-
mergeAVStreams =
|
|
10590
|
-
|
|
10591
|
-
assets =
|
|
10592
|
-
|
|
10593
|
-
classNames =
|
|
10594
|
-
|
|
10595
|
-
colors =
|
|
10596
|
-
|
|
10597
|
-
rawVerbiage =
|
|
10598
|
-
|
|
10599
|
-
debugMode =
|
|
10600
|
-
var
|
|
10601
|
-
ref =
|
|
10602
|
-
|
|
10603
|
-
width =
|
|
10604
|
-
|
|
10605
|
-
height =
|
|
10606
|
-
var
|
|
10607
|
-
cameraRef =
|
|
10608
|
-
videoRef =
|
|
10609
|
-
videoLoaded =
|
|
10610
|
-
cameraReady =
|
|
10611
|
-
microphoneReady =
|
|
10612
|
-
audioStream =
|
|
10613
|
-
setVideoLoaded =
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
audioUrl = _26.audioUrl;
|
|
10500
|
+
_1 = _a.readTextTimeoutDurationMs,
|
|
10501
|
+
readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
|
|
10502
|
+
_2 = _a.readTextMinReadingMs,
|
|
10503
|
+
readTextMinReadingMs = _2 === void 0 ? 10000 : _2,
|
|
10504
|
+
_3 = _a.disableFaceDetectionWhileAudioCapture,
|
|
10505
|
+
disableFaceDetectionWhileAudioCapture = _3 === void 0 ? false : _3,
|
|
10506
|
+
_4 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
10507
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _4 === void 0 ? 2000 : _4,
|
|
10508
|
+
_5 = _a.mergeAVStreams,
|
|
10509
|
+
mergeAVStreams = _5 === void 0 ? false : _5,
|
|
10510
|
+
_6 = _a.assets,
|
|
10511
|
+
assets = _6 === void 0 ? {} : _6,
|
|
10512
|
+
_7 = _a.classNames,
|
|
10513
|
+
classNames = _7 === void 0 ? {} : _7,
|
|
10514
|
+
_8 = _a.colors,
|
|
10515
|
+
colors = _8 === void 0 ? {} : _8,
|
|
10516
|
+
_9 = _a.verbiage,
|
|
10517
|
+
rawVerbiage = _9 === void 0 ? {} : _9,
|
|
10518
|
+
_10 = _a.debugMode,
|
|
10519
|
+
debugMode = _10 === void 0 ? false : _10;
|
|
10520
|
+
var _11 = useResizeObserver__default['default'](),
|
|
10521
|
+
ref = _11.ref,
|
|
10522
|
+
_12 = _11.width,
|
|
10523
|
+
width = _12 === void 0 ? 1 : _12,
|
|
10524
|
+
_13 = _11.height,
|
|
10525
|
+
height = _13 === void 0 ? 1 : _13;
|
|
10526
|
+
var _14 = React.useContext(CameraStateContext),
|
|
10527
|
+
cameraRef = _14.cameraRef,
|
|
10528
|
+
videoRef = _14.videoRef,
|
|
10529
|
+
videoLoaded = _14.videoLoaded,
|
|
10530
|
+
cameraReady = _14.cameraReady,
|
|
10531
|
+
microphoneReady = _14.microphoneReady,
|
|
10532
|
+
audioStream = _14.audioStream,
|
|
10533
|
+
setVideoLoaded = _14.setVideoLoaded;
|
|
10534
|
+
var _15 = React.useState([]),
|
|
10535
|
+
detectedObjects = _15[0],
|
|
10536
|
+
setDetectedObjects = _15[1];
|
|
10537
|
+
var _16 = React.useState([]),
|
|
10538
|
+
faces = _16[0],
|
|
10539
|
+
setFaces = _16[1];
|
|
10540
|
+
var _17 = React.useContext(IdCaptureModelsContext),
|
|
10541
|
+
idModelsReady = _17.ready,
|
|
10542
|
+
startIdModels = _17.start,
|
|
10543
|
+
stopIdModels = _17.stop,
|
|
10544
|
+
onIdPredictionMade = _17.onPredictionMade,
|
|
10545
|
+
setThresholds = _17.setThresholds,
|
|
10546
|
+
bestFrameDetails = _17.bestFrameDetails,
|
|
10547
|
+
resetBestFrame = _17.resetBestFrame,
|
|
10548
|
+
idModelError = _17.modelError;
|
|
10549
|
+
var _18 = React.useState(null),
|
|
10550
|
+
videoStartsAt = _18[0],
|
|
10551
|
+
setVideoStartsAt = _18[1];
|
|
10552
|
+
var _19 = React.useContext(SubmissionContext),
|
|
10553
|
+
setIdCaptureVideoAudioStartsAt = _19.setIdCaptureVideoAudioStartsAt,
|
|
10554
|
+
setExpectedAudioText = _19.setExpectedAudioText;
|
|
10555
|
+
var _20 = React.useContext(SelfieGuidanceModelsContext),
|
|
10556
|
+
onSelfiePredictionMade = _20.onPredictionMade,
|
|
10557
|
+
selfieModelError = _20.error;
|
|
10558
|
+
var _21 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
|
|
10559
|
+
isRecordingVideo = _21.isRecordingVideo,
|
|
10560
|
+
startRecordingVideo = _21.startRecordingVideo,
|
|
10561
|
+
startRecordingAudio = _21.startRecordingAudio,
|
|
10562
|
+
stopRecordingVideo = _21.stopRecordingVideo,
|
|
10563
|
+
stopRecordingAudio = _21.stopRecordingAudio,
|
|
10564
|
+
videoRecordingUnintentionallyStopped = _21.videoRecordingUnintentionallyStopped,
|
|
10565
|
+
audioRecordingUnintentionallyStopped = _21.audioRecordingUnintentionallyStopped,
|
|
10566
|
+
videoUrl = _21.videoUrl,
|
|
10567
|
+
audioUrl = _21.audioUrl;
|
|
10649
10568
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
10650
|
-
var
|
|
10651
|
-
countdownRemaining =
|
|
10652
|
-
setCountdownRemaining =
|
|
10569
|
+
var _22 = React.useState(-1),
|
|
10570
|
+
countdownRemaining = _22[0],
|
|
10571
|
+
setCountdownRemaining = _22[1];
|
|
10653
10572
|
React.useEffect(function () {
|
|
10654
10573
|
if (!isRecordingVideo && !videoUrl) {
|
|
10655
10574
|
startRecordingVideo();
|
|
@@ -10669,41 +10588,30 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10669
10588
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
10670
10589
|
}
|
|
10671
10590
|
}, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
|
|
10672
|
-
var
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
var _28 = React.useState('SHOW_ID_FRONT'),
|
|
10677
|
-
requestedAction = _28[0],
|
|
10678
|
-
setRequestedAction = _28[1];
|
|
10591
|
+
var _23 = React.useState('SHOW_ID_FRONT'),
|
|
10592
|
+
requestedAction = _23[0],
|
|
10593
|
+
setRequestedAction = _23[1];
|
|
10594
|
+
var shouldRunIdModels = idCaptureModelsEnabled && videoLoaded && cameraReady && idModelsReady && !idModelError && requestedAction !== 'READ_TEXT' && (!readTextPrompt || microphoneReady);
|
|
10679
10595
|
React.useEffect(function startModelsWhenCapturing() {
|
|
10680
|
-
if (!
|
|
10596
|
+
if (!shouldRunIdModels) return;
|
|
10681
10597
|
startIdModels();
|
|
10682
10598
|
return function () {
|
|
10683
10599
|
stopIdModels();
|
|
10684
10600
|
};
|
|
10685
|
-
}, [
|
|
10601
|
+
}, [shouldRunIdModels, startIdModels, stopIdModels]);
|
|
10686
10602
|
React.useEffect(function () {
|
|
10687
|
-
setThresholds(
|
|
10688
|
-
|
|
10689
|
-
|
|
10690
|
-
|
|
10691
|
-
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
setCurrentDetectionScore = _29[1];
|
|
10700
|
-
var _30 = React.useState(0),
|
|
10701
|
-
currentFocusScore = _30[0],
|
|
10702
|
-
setCurrentFocusScore = _30[1];
|
|
10703
|
-
var _31 = React.useState(0),
|
|
10704
|
-
goodFramesCount = _31[0],
|
|
10705
|
-
setGoodFramesCount = _31[1];
|
|
10706
|
-
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
10603
|
+
setThresholds(videoIdCaptureThresholds);
|
|
10604
|
+
}, [requestedAction, setThresholds, videoIdCaptureThresholds]);
|
|
10605
|
+
var _24 = React.useState(0),
|
|
10606
|
+
currentDetectionScore = _24[0],
|
|
10607
|
+
setCurrentDetectionScore = _24[1];
|
|
10608
|
+
var _25 = React.useState(0),
|
|
10609
|
+
currentFocusScore = _25[0],
|
|
10610
|
+
setCurrentFocusScore = _25[1];
|
|
10611
|
+
var _26 = React.useState(0),
|
|
10612
|
+
goodFramesCount = _26[0],
|
|
10613
|
+
setGoodFramesCount = _26[1];
|
|
10614
|
+
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
|
|
10707
10615
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10708
10616
|
React.useEffect(function () {
|
|
10709
10617
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
@@ -10711,18 +10619,19 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10711
10619
|
setDetectedObjects(prediction.detectedObjects);
|
|
10712
10620
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
10713
10621
|
setCurrentFocusScore(prediction.focusScore);
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
} else {
|
|
10719
|
-
setGoodFramesCount(0);
|
|
10622
|
+
var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
|
|
10623
|
+
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
10624
|
+
if (requestedAction === 'FLIP_ID' && isGoodFrame) {
|
|
10625
|
+
return setRequestedAction('SHOW_ID_BACK');
|
|
10720
10626
|
}
|
|
10627
|
+
setGoodFramesCount(isGoodFrame ? function (n) {
|
|
10628
|
+
return n + 1;
|
|
10629
|
+
} : 0);
|
|
10721
10630
|
});
|
|
10722
|
-
}, [idCaptureModelsEnabled,
|
|
10723
|
-
var
|
|
10724
|
-
idFrontCaptureStartedAt =
|
|
10725
|
-
setFirstGoodFrameTime =
|
|
10631
|
+
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
|
|
10632
|
+
var _27 = React.useState(null),
|
|
10633
|
+
idFrontCaptureStartedAt = _27[0],
|
|
10634
|
+
setFirstGoodFrameTime = _27[1];
|
|
10726
10635
|
React.useEffect(function () {
|
|
10727
10636
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
10728
10637
|
}, [goodFramesCount]);
|
|
@@ -10743,73 +10652,56 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10743
10652
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
10744
10653
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
10745
10654
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
10746
|
-
var
|
|
10747
|
-
countdownStartedAt =
|
|
10748
|
-
setCountdownStartedAt =
|
|
10655
|
+
var _28 = React.useState(),
|
|
10656
|
+
countdownStartedAt = _28[0],
|
|
10657
|
+
setCountdownStartedAt = _28[1];
|
|
10658
|
+
var photoCanvas = React.useRef(null);
|
|
10749
10659
|
var frameLock = React.useRef(false);
|
|
10750
10660
|
var captureFrame = React.useCallback(function () {
|
|
10751
10661
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
10752
|
-
var
|
|
10753
|
-
return tslib.__generator(this, function (
|
|
10754
|
-
switch (
|
|
10662
|
+
var frameBase64;
|
|
10663
|
+
return tslib.__generator(this, function (_a) {
|
|
10664
|
+
switch (_a.label) {
|
|
10755
10665
|
case 0:
|
|
10756
10666
|
if (frameLock.current) return [2 /*return*/];
|
|
10757
10667
|
frameLock.current = true;
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
if (!frame) {
|
|
10668
|
+
drawToCanvas(photoCanvas.current, videoRef.current);
|
|
10669
|
+
frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
|
|
10670
|
+
if (!frameBase64) {
|
|
10762
10671
|
frameLock.current = false;
|
|
10763
10672
|
return [2 /*return*/];
|
|
10764
10673
|
}
|
|
10765
|
-
|
|
10766
|
-
case
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
if (!_a) return [3 /*break*/, 4];
|
|
10770
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
10771
|
-
var reader = new FileReader();
|
|
10772
|
-
reader.onloadend = function () {
|
|
10773
|
-
return resolve(reader.result);
|
|
10774
|
-
};
|
|
10775
|
-
reader.readAsDataURL(frame);
|
|
10776
|
-
})];
|
|
10777
|
-
case 3:
|
|
10778
|
-
_a = _b.sent();
|
|
10779
|
-
_b.label = 4;
|
|
10780
|
-
case 4:
|
|
10781
|
-
frameBase64 = _a;
|
|
10782
|
-
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
|
|
10674
|
+
_a.label = 1;
|
|
10675
|
+
case 1:
|
|
10676
|
+
_a.trys.push([1,, 7, 8]);
|
|
10677
|
+
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
|
|
10783
10678
|
if (onIdFrontImageCaptured) {
|
|
10784
|
-
|
|
10679
|
+
onIdFrontImageCaptured(frameBase64);
|
|
10785
10680
|
}
|
|
10786
|
-
if (!skipShowIdCardBack) return [3 /*break*/,
|
|
10787
|
-
if (!(skipShowIdCardBack === true)) return [3 /*break*/,
|
|
10681
|
+
if (!skipShowIdCardBack) return [3 /*break*/, 4];
|
|
10682
|
+
if (!(skipShowIdCardBack === true)) return [3 /*break*/, 2];
|
|
10788
10683
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
10789
|
-
case
|
|
10684
|
+
case 2:
|
|
10790
10685
|
return [4 /*yield*/, skipShowIdCardBack()];
|
|
10791
|
-
case
|
|
10792
|
-
if (
|
|
10686
|
+
case 3:
|
|
10687
|
+
if (_a.sent()) {
|
|
10793
10688
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
10794
10689
|
}
|
|
10795
|
-
|
|
10796
|
-
case
|
|
10690
|
+
_a.label = 4;
|
|
10691
|
+
case 4:
|
|
10797
10692
|
setRequestedAction('FLIP_ID');
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
}, 6000);
|
|
10801
|
-
return [3 /*break*/, 9];
|
|
10802
|
-
case 8:
|
|
10693
|
+
return [3 /*break*/, 6];
|
|
10694
|
+
case 5:
|
|
10803
10695
|
if (requestedAction == 'SHOW_ID_BACK') {
|
|
10804
10696
|
if (onIdBackImageCaptured) {
|
|
10805
|
-
|
|
10697
|
+
onIdBackImageCaptured(frameBase64);
|
|
10806
10698
|
}
|
|
10807
10699
|
onIdBackCaptureComplete();
|
|
10808
10700
|
}
|
|
10809
|
-
|
|
10810
|
-
case
|
|
10811
|
-
return [3 /*break*/,
|
|
10812
|
-
case
|
|
10701
|
+
_a.label = 6;
|
|
10702
|
+
case 6:
|
|
10703
|
+
return [3 /*break*/, 8];
|
|
10704
|
+
case 7:
|
|
10813
10705
|
setDetectedObjects([]);
|
|
10814
10706
|
setCurrentDetectionScore(0);
|
|
10815
10707
|
setCurrentFocusScore(0);
|
|
@@ -10821,17 +10713,27 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10821
10713
|
clearTimeout(countdownTimeoutRef.current);
|
|
10822
10714
|
}
|
|
10823
10715
|
return [7 /*endfinally*/];
|
|
10824
|
-
case
|
|
10716
|
+
case 8:
|
|
10825
10717
|
return [2 /*return*/];
|
|
10826
10718
|
}
|
|
10827
10719
|
});
|
|
10828
10720
|
});
|
|
10829
|
-
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack,
|
|
10721
|
+
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
|
|
10722
|
+
var isFlipping = requestedAction === 'FLIP_ID';
|
|
10723
|
+
React.useEffect(function () {
|
|
10724
|
+
if (!isFlipping) return;
|
|
10725
|
+
var t = setTimeout(function () {
|
|
10726
|
+
setRequestedAction('SHOW_ID_BACK');
|
|
10727
|
+
}, 6000);
|
|
10728
|
+
return function () {
|
|
10729
|
+
clearTimeout(t);
|
|
10730
|
+
};
|
|
10731
|
+
}, [isFlipping]);
|
|
10830
10732
|
var stopRecording = React.useCallback(function () {
|
|
10831
10733
|
stopRecordingVideo();
|
|
10832
10734
|
stopRecordingAudio();
|
|
10833
10735
|
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
10834
|
-
var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
10736
|
+
var satisfied = !isFlipping && goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
10835
10737
|
React.useEffect(function () {
|
|
10836
10738
|
if (satisfied && !countdownStartedAt) {
|
|
10837
10739
|
setCountdownStartedAt(new Date());
|
|
@@ -10851,10 +10753,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10851
10753
|
}, 1000);
|
|
10852
10754
|
return;
|
|
10853
10755
|
}
|
|
10854
|
-
|
|
10855
|
-
captureFrame();
|
|
10856
|
-
}
|
|
10857
|
-
}, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
|
|
10756
|
+
}, [countdownTimeoutRef]);
|
|
10858
10757
|
React.useEffect(function () {
|
|
10859
10758
|
if (!countdownStartedAt) return;
|
|
10860
10759
|
setCountdownRemaining(captureCountdownSeconds);
|
|
@@ -10864,11 +10763,17 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10864
10763
|
return function () {
|
|
10865
10764
|
clearTimeout(countdownTimeoutRef.current);
|
|
10866
10765
|
};
|
|
10867
|
-
}, [captureCountdownSeconds,
|
|
10766
|
+
}, [captureCountdownSeconds, countdownStartedAt, manualCountdown]);
|
|
10767
|
+
React.useEffect(function () {
|
|
10768
|
+
if (countdownRemaining === 0) {
|
|
10769
|
+
setCountdownRemaining(-1);
|
|
10770
|
+
captureFrame().then();
|
|
10771
|
+
}
|
|
10772
|
+
}, [captureFrame, countdownRemaining]);
|
|
10868
10773
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
10869
|
-
var
|
|
10870
|
-
numFramesWithoutFaces =
|
|
10871
|
-
setNumFramesWithoutFaces =
|
|
10774
|
+
var _29 = React.useState(0),
|
|
10775
|
+
numFramesWithoutFaces = _29[0],
|
|
10776
|
+
setNumFramesWithoutFaces = _29[1];
|
|
10872
10777
|
React.useEffect(function () {
|
|
10873
10778
|
if (!selfieModelError) {
|
|
10874
10779
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -10886,14 +10791,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10886
10791
|
}
|
|
10887
10792
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
10888
10793
|
var theme = styled.useTheme();
|
|
10889
|
-
var
|
|
10794
|
+
var _30 = useTranslations(rawVerbiage, {
|
|
10890
10795
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
10891
10796
|
searchingForIdCardText: 'Searching for ID card...',
|
|
10892
10797
|
captureBtnText: 'Capture'
|
|
10893
10798
|
}),
|
|
10894
|
-
captureBtnText =
|
|
10895
|
-
faceNotCenteredText =
|
|
10896
|
-
searchingForIdCardText =
|
|
10799
|
+
captureBtnText = _30.captureBtnText,
|
|
10800
|
+
faceNotCenteredText = _30.faceNotCenteredText,
|
|
10801
|
+
searchingForIdCardText = _30.searchingForIdCardText;
|
|
10897
10802
|
var debugScalingDetails = useDebugScalingDetails({
|
|
10898
10803
|
enabled: debugMode,
|
|
10899
10804
|
pageWidth: width,
|
|
@@ -10907,7 +10812,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10907
10812
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
10908
10813
|
ref: ref,
|
|
10909
10814
|
className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
|
|
10910
|
-
},
|
|
10815
|
+
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
10816
|
+
ref: photoCanvas
|
|
10817
|
+
}), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default['default'].createElement(ReadTextPrompt, {
|
|
10911
10818
|
text: readTextPrompt,
|
|
10912
10819
|
startedAt: timeoutStartedAt || undefined,
|
|
10913
10820
|
durationMs: readTextTimeoutDurationMs,
|
|
@@ -10946,7 +10853,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10946
10853
|
className: classNames.guidanceMessage,
|
|
10947
10854
|
"$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',
|
|
10948
10855
|
"$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'
|
|
10949
|
-
}, 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)),
|
|
10856
|
+
}, 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, {
|
|
10950
10857
|
className: classNames.countdownContainer
|
|
10951
10858
|
}, /*#__PURE__*/React__default['default'].createElement(Countdown, {
|
|
10952
10859
|
className: classNames.countdown
|
|
@@ -11101,64 +11008,60 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11101
11008
|
faceLivenessProps = _h === void 0 ? {} : _h,
|
|
11102
11009
|
_j = _a.idCaptureModelsEnabled,
|
|
11103
11010
|
idCaptureModelsEnabled = _j === void 0 ? true : _j,
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
|
|
11107
|
-
idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
|
|
11108
|
-
goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
|
|
11109
|
-
goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
|
|
11011
|
+
_k = _a.videoIdCaptureThresholds,
|
|
11012
|
+
videoIdCaptureThresholds = _k === void 0 ? defaultVideoIdCaptureThresholds : _k,
|
|
11110
11013
|
readTextPrompt = _a.readTextPrompt,
|
|
11111
11014
|
readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
|
|
11112
11015
|
readTextMinReadingMs = _a.readTextMinReadingMs,
|
|
11113
|
-
|
|
11114
|
-
skipIdCapture =
|
|
11115
|
-
|
|
11116
|
-
skipShowIdCardBack =
|
|
11117
|
-
|
|
11118
|
-
skipSuccessScreen =
|
|
11119
|
-
|
|
11120
|
-
idCaptureLoadingOverlayMode =
|
|
11121
|
-
|
|
11122
|
-
idCaptureGuideType =
|
|
11123
|
-
|
|
11124
|
-
idCapturePortraitGuidesOnMobile =
|
|
11125
|
-
|
|
11126
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
11127
|
-
|
|
11128
|
-
idCaptureModelLoadTimeoutMs =
|
|
11129
|
-
|
|
11130
|
-
faceLivenessLoadingOverlayMode =
|
|
11131
|
-
|
|
11132
|
-
disableFaceDetectionWhileAudioCapture =
|
|
11133
|
-
|
|
11134
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
11135
|
-
|
|
11136
|
-
silentFallback =
|
|
11137
|
-
|
|
11138
|
-
mergeAVStreams =
|
|
11139
|
-
|
|
11140
|
-
assets =
|
|
11141
|
-
|
|
11142
|
-
classNames =
|
|
11143
|
-
|
|
11144
|
-
colors =
|
|
11145
|
-
|
|
11146
|
-
verbiage =
|
|
11147
|
-
|
|
11148
|
-
debugMode =
|
|
11149
|
-
var
|
|
11150
|
-
submissionStatus =
|
|
11151
|
-
idCaptureVideoUrl =
|
|
11152
|
-
idCaptureVideoAudioUrl =
|
|
11153
|
-
idCaptureVideoIdFrontImage =
|
|
11154
|
-
idCaptureVideoIdBackImage =
|
|
11155
|
-
setIdCaptureVideoUrl =
|
|
11156
|
-
setIdCaptureVideoIdFrontImage =
|
|
11157
|
-
setIdCaptureVideoIdBackImage =
|
|
11158
|
-
setIdCaptureVideoAudioUrl =
|
|
11159
|
-
var
|
|
11160
|
-
captureState =
|
|
11161
|
-
setCaptureState =
|
|
11016
|
+
_l = _a.skipIdCapture,
|
|
11017
|
+
skipIdCapture = _l === void 0 ? false : _l,
|
|
11018
|
+
_m = _a.skipShowIdCardBack,
|
|
11019
|
+
skipShowIdCardBack = _m === void 0 ? false : _m,
|
|
11020
|
+
_o = _a.skipSuccessScreen,
|
|
11021
|
+
skipSuccessScreen = _o === void 0 ? false : _o,
|
|
11022
|
+
_p = _a.idCaptureLoadingOverlayMode,
|
|
11023
|
+
idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
11024
|
+
_q = _a.idCaptureGuideType,
|
|
11025
|
+
idCaptureGuideType = _q === void 0 ? 'fit' : _q,
|
|
11026
|
+
_r = _a.idCapturePortraitGuidesOnMobile,
|
|
11027
|
+
idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
|
|
11028
|
+
_s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
11029
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
|
|
11030
|
+
_t = _a.idCaptureModelLoadTimeoutMs,
|
|
11031
|
+
idCaptureModelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
|
|
11032
|
+
_u = _a.faceLivenessLoadingOverlayMode,
|
|
11033
|
+
faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
|
|
11034
|
+
_v = _a.disableFaceDetectionWhileAudioCapture,
|
|
11035
|
+
disableFaceDetectionWhileAudioCapture = _v === void 0 ? true : _v,
|
|
11036
|
+
_w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
11037
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
11038
|
+
_x = _a.silentFallback,
|
|
11039
|
+
silentFallback = _x === void 0 ? false : _x,
|
|
11040
|
+
_y = _a.mergeAVStreams,
|
|
11041
|
+
mergeAVStreams = _y === void 0 ? false : _y,
|
|
11042
|
+
_z = _a.assets,
|
|
11043
|
+
assets = _z === void 0 ? {} : _z,
|
|
11044
|
+
_0 = _a.classNames,
|
|
11045
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
11046
|
+
_1 = _a.colors,
|
|
11047
|
+
colors = _1 === void 0 ? {} : _1,
|
|
11048
|
+
_2 = _a.verbiage,
|
|
11049
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
11050
|
+
_3 = _a.debugMode,
|
|
11051
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
11052
|
+
var _4 = React.useContext(SubmissionContext),
|
|
11053
|
+
submissionStatus = _4.submissionStatus,
|
|
11054
|
+
idCaptureVideoUrl = _4.idCaptureVideoUrl,
|
|
11055
|
+
idCaptureVideoAudioUrl = _4.idCaptureVideoAudioUrl,
|
|
11056
|
+
idCaptureVideoIdFrontImage = _4.idCaptureVideoIdFrontImage,
|
|
11057
|
+
idCaptureVideoIdBackImage = _4.idCaptureVideoIdBackImage,
|
|
11058
|
+
setIdCaptureVideoUrl = _4.setIdCaptureVideoUrl,
|
|
11059
|
+
setIdCaptureVideoIdFrontImage = _4.setIdCaptureVideoIdFrontImage,
|
|
11060
|
+
setIdCaptureVideoIdBackImage = _4.setIdCaptureVideoIdBackImage,
|
|
11061
|
+
setIdCaptureVideoAudioUrl = _4.setIdCaptureVideoAudioUrl;
|
|
11062
|
+
var _5 = React.useState('CAPTURING_ID'),
|
|
11063
|
+
captureState = _5[0],
|
|
11064
|
+
setCaptureState = _5[1];
|
|
11162
11065
|
React.useEffect(function () {
|
|
11163
11066
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
11164
11067
|
}, [captureState, skipIdCapture]);
|
|
@@ -11189,9 +11092,9 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11189
11092
|
var onVideoCaptureFaceNotDetected = React.useCallback(function () {
|
|
11190
11093
|
setCaptureState('CHECKING_LIVENESS');
|
|
11191
11094
|
}, []);
|
|
11192
|
-
var
|
|
11193
|
-
attempt =
|
|
11194
|
-
setAttempt =
|
|
11095
|
+
var _6 = React.useState(0),
|
|
11096
|
+
attempt = _6[0],
|
|
11097
|
+
setAttempt = _6[1];
|
|
11195
11098
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
11196
11099
|
var onFaceCaptureExitAfterFailure = React.useCallback(function (resp, req) {
|
|
11197
11100
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|
|
@@ -11295,12 +11198,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11295
11198
|
onFaceNotDetected: onVideoCaptureFaceNotDetected,
|
|
11296
11199
|
onRecordingFailed: onRecordingFailed,
|
|
11297
11200
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
11298
|
-
|
|
11299
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
11300
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
11301
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
11302
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
11303
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
11201
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
11304
11202
|
skipShowIdCardBack: skipShowIdCardBack,
|
|
11305
11203
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
11306
11204
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
@@ -11761,9 +11659,8 @@ var ThemeProvider = function ThemeProvider(_a) {
|
|
|
11761
11659
|
* Render a fullscreen ID capture component that instructs the user to photograph both sides of their ID card, or full page of their passport.
|
|
11762
11660
|
*/
|
|
11763
11661
|
var IdValidation = function IdValidation(_a) {
|
|
11764
|
-
var _b,
|
|
11765
|
-
|
|
11766
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
11662
|
+
var _b = _a.lang,
|
|
11663
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
11767
11664
|
sessionId = _a.sessionId,
|
|
11768
11665
|
clientRequestID = _a.clientRequestID,
|
|
11769
11666
|
submissionUrl = _a.submissionUrl,
|
|
@@ -11786,35 +11683,25 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11786
11683
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
11787
11684
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
11788
11685
|
precapturedDocuments = _a.precapturedDocuments,
|
|
11789
|
-
|
|
11790
|
-
loadingOverlayMode =
|
|
11791
|
-
|
|
11792
|
-
idCaptureRequirement =
|
|
11793
|
-
|
|
11794
|
-
separateIdCardCaptureSequence =
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
_k = _a.passportAutoCaptureScoreThreshold,
|
|
11800
|
-
passportAutoCaptureScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.passport : _k,
|
|
11801
|
-
_l = _a.mrzDetectionScoreThreshold,
|
|
11802
|
-
mrzDetectionScoreThreshold = _l === void 0 ? defaultDocumentDetectionThresholds.mrz : _l,
|
|
11803
|
-
_m = _a.idCardFocusScoreThreshold,
|
|
11804
|
-
idCardFocusScoreThreshold = _m === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _m,
|
|
11805
|
-
_o = _a.passportFocusScoreThreshold,
|
|
11806
|
-
passportFocusScoreThreshold = _o === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _o,
|
|
11807
|
-
_p = _a.skipSuccessScreen,
|
|
11808
|
-
skipSuccessScreen = _p === void 0 ? false : _p,
|
|
11686
|
+
_c = _a.loadingOverlayMode,
|
|
11687
|
+
loadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
11688
|
+
_d = _a.idCaptureRequirement,
|
|
11689
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
11690
|
+
_e = _a.separateIdCardCaptureSequence,
|
|
11691
|
+
separateIdCardCaptureSequence = _e === void 0 ? false : _e,
|
|
11692
|
+
_f = _a.idCaptureThresholds,
|
|
11693
|
+
idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
|
|
11694
|
+
_g = _a.skipSuccessScreen,
|
|
11695
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
11809
11696
|
instructions = _a.instructions,
|
|
11810
|
-
|
|
11811
|
-
guideType =
|
|
11812
|
-
|
|
11813
|
-
portraitGuidesOnMobile =
|
|
11814
|
-
|
|
11815
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
11816
|
-
|
|
11817
|
-
modelLoadTimeoutMs =
|
|
11697
|
+
_h = _a.guideType,
|
|
11698
|
+
guideType = _h === void 0 ? 'fit' : _h,
|
|
11699
|
+
_j = _a.portraitGuidesOnMobile,
|
|
11700
|
+
portraitGuidesOnMobile = _j === void 0 ? false : _j,
|
|
11701
|
+
_k = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
11702
|
+
rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
|
|
11703
|
+
_l = _a.modelLoadTimeoutMs,
|
|
11704
|
+
modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
|
|
11818
11705
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
11819
11706
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
11820
11707
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -11828,28 +11715,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11828
11715
|
onUserCancel = _a.onUserCancel,
|
|
11829
11716
|
onModelError = _a.onModelError,
|
|
11830
11717
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
11831
|
-
|
|
11832
|
-
theme =
|
|
11833
|
-
|
|
11834
|
-
assets =
|
|
11835
|
-
|
|
11836
|
-
classNames =
|
|
11837
|
-
|
|
11838
|
-
colors =
|
|
11839
|
-
|
|
11840
|
-
verbiage =
|
|
11841
|
-
|
|
11842
|
-
captureSignature =
|
|
11843
|
-
|
|
11844
|
-
captureSignatureVideo =
|
|
11845
|
-
|
|
11846
|
-
captureAdditionalDocuments =
|
|
11847
|
-
|
|
11848
|
-
geolocationEnabled =
|
|
11849
|
-
|
|
11850
|
-
geolocationRequired =
|
|
11851
|
-
|
|
11852
|
-
debugMode =
|
|
11718
|
+
_m = _a.theme,
|
|
11719
|
+
theme = _m === void 0 ? 'default' : _m,
|
|
11720
|
+
_o = _a.assets,
|
|
11721
|
+
assets = _o === void 0 ? {} : _o,
|
|
11722
|
+
_p = _a.classNames,
|
|
11723
|
+
classNames = _p === void 0 ? {} : _p,
|
|
11724
|
+
_q = _a.colors,
|
|
11725
|
+
colors = _q === void 0 ? {} : _q,
|
|
11726
|
+
_r = _a.verbiage,
|
|
11727
|
+
verbiage = _r === void 0 ? {} : _r,
|
|
11728
|
+
_s = _a.captureSignature,
|
|
11729
|
+
captureSignature = _s === void 0 ? false : _s,
|
|
11730
|
+
_t = _a.captureSignatureVideo,
|
|
11731
|
+
captureSignatureVideo = _t === void 0 ? false : _t,
|
|
11732
|
+
_u = _a.captureAdditionalDocuments,
|
|
11733
|
+
captureAdditionalDocuments = _u === void 0 ? [] : _u,
|
|
11734
|
+
_v = _a.geolocationEnabled,
|
|
11735
|
+
geolocationEnabled = _v === void 0 ? true : _v,
|
|
11736
|
+
_w = _a.geolocationRequired,
|
|
11737
|
+
geolocationRequired = _w === void 0 ? false : _w,
|
|
11738
|
+
_x = _a.debugMode,
|
|
11739
|
+
debugMode = _x === void 0 ? false : _x;
|
|
11853
11740
|
useLanguage(lang);
|
|
11854
11741
|
useDebugLogging(debugMode);
|
|
11855
11742
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -11860,13 +11747,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11860
11747
|
precapturedDocuments: precapturedDocuments,
|
|
11861
11748
|
captureRequirement: idCaptureRequirement,
|
|
11862
11749
|
separateIdCardCaptureSequence: separateIdCardCaptureSequence,
|
|
11863
|
-
|
|
11864
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
11865
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
11866
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
11867
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
11868
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
11869
|
-
barcodeScanningEnabled: false,
|
|
11750
|
+
thresholds: idCaptureThresholds,
|
|
11870
11751
|
skipSuccessScreen: skipSuccessScreen,
|
|
11871
11752
|
loadingOverlayMode: loadingOverlayMode,
|
|
11872
11753
|
instructions: instructions,
|
|
@@ -11880,7 +11761,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11880
11761
|
verbiage: verbiage,
|
|
11881
11762
|
debugMode: debugMode
|
|
11882
11763
|
};
|
|
11883
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence,
|
|
11764
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
|
|
11884
11765
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
11885
11766
|
return {
|
|
11886
11767
|
documents: captureAdditionalDocuments,
|
|
@@ -12074,9 +11955,8 @@ var FaceValidation = function FaceValidation(_a) {
|
|
|
12074
11955
|
* Render a fullscreen capture component that performs `IDValidation` and `FaceValidation` sequentially.
|
|
12075
11956
|
* */
|
|
12076
11957
|
var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
12077
|
-
var _b,
|
|
12078
|
-
|
|
12079
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
11958
|
+
var _b = _a.lang,
|
|
11959
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
12080
11960
|
sessionId = _a.sessionId,
|
|
12081
11961
|
authUrl = _a.authUrl,
|
|
12082
11962
|
submissionUrl = _a.submissionUrl,
|
|
@@ -12098,39 +11978,29 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12098
11978
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
12099
11979
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
12100
11980
|
precapturedDocuments = _a.precapturedDocuments,
|
|
12101
|
-
|
|
12102
|
-
idCaptureLoadingOverlayMode =
|
|
12103
|
-
|
|
12104
|
-
idCaptureRequirement =
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12108
|
-
|
|
12109
|
-
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
12114
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
12115
|
-
_m = _a.passportFocusScoreThreshold,
|
|
12116
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
12117
|
-
_o = _a.faceLivenessLoadingOverlayMode,
|
|
12118
|
-
faceLivenessLoadingOverlayMode = _o === void 0 ? 'default' : _o,
|
|
12119
|
-
_p = _a.faceLivenessTimeoutDurationMs,
|
|
12120
|
-
faceLivenessTimeoutDurationMs = _p === void 0 ? 15000 : _p,
|
|
12121
|
-
_q = _a.skipSuccessScreen,
|
|
12122
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
11981
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
11982
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
11983
|
+
_d = _a.idCaptureRequirement,
|
|
11984
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
11985
|
+
_e = _a.idCaptureThresholds,
|
|
11986
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
11987
|
+
_f = _a.faceLivenessLoadingOverlayMode,
|
|
11988
|
+
faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
|
|
11989
|
+
_g = _a.faceLivenessTimeoutDurationMs,
|
|
11990
|
+
faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
11991
|
+
_h = _a.skipSuccessScreen,
|
|
11992
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
12123
11993
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
12124
|
-
|
|
12125
|
-
idCaptureGuideType =
|
|
12126
|
-
|
|
12127
|
-
idCapturePortraitGuidesOnMobile =
|
|
12128
|
-
|
|
12129
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
12130
|
-
|
|
12131
|
-
idCaptureModelLoadTimeoutMs =
|
|
12132
|
-
|
|
12133
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
11994
|
+
_j = _a.idCaptureGuideType,
|
|
11995
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
11996
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
11997
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
11998
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
11999
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
12000
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
12001
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
12002
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
12003
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
12134
12004
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
12135
12005
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
12136
12006
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -12147,28 +12017,28 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12147
12017
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
12148
12018
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
12149
12019
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
12150
|
-
|
|
12151
|
-
captureSignature =
|
|
12152
|
-
|
|
12153
|
-
captureSignatureVideo =
|
|
12154
|
-
|
|
12155
|
-
captureAdditionalDocuments =
|
|
12156
|
-
|
|
12157
|
-
theme =
|
|
12158
|
-
|
|
12159
|
-
assets =
|
|
12160
|
-
|
|
12161
|
-
classNames =
|
|
12162
|
-
|
|
12163
|
-
colors =
|
|
12164
|
-
|
|
12165
|
-
verbiage =
|
|
12166
|
-
|
|
12167
|
-
geolocationEnabled =
|
|
12168
|
-
|
|
12169
|
-
geolocationRequired =
|
|
12170
|
-
|
|
12171
|
-
debugMode =
|
|
12020
|
+
_p = _a.captureSignature,
|
|
12021
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
12022
|
+
_q = _a.captureSignatureVideo,
|
|
12023
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
12024
|
+
_r = _a.captureAdditionalDocuments,
|
|
12025
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
12026
|
+
_s = _a.theme,
|
|
12027
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
12028
|
+
_t = _a.assets,
|
|
12029
|
+
assets = _t === void 0 ? {} : _t,
|
|
12030
|
+
_u = _a.classNames,
|
|
12031
|
+
classNames = _u === void 0 ? {} : _u,
|
|
12032
|
+
_v = _a.colors,
|
|
12033
|
+
colors = _v === void 0 ? {} : _v,
|
|
12034
|
+
_w = _a.verbiage,
|
|
12035
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
12036
|
+
_x = _a.geolocationEnabled,
|
|
12037
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
12038
|
+
_y = _a.geolocationRequired,
|
|
12039
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
12040
|
+
_z = _a.debugMode,
|
|
12041
|
+
debugMode = _z === void 0 ? false : _z;
|
|
12172
12042
|
useLanguage(lang);
|
|
12173
12043
|
useDebugLogging(debugMode);
|
|
12174
12044
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -12182,12 +12052,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12182
12052
|
verbiage: verbiage.idCapture,
|
|
12183
12053
|
precapturedDocuments: precapturedDocuments,
|
|
12184
12054
|
captureRequirement: idCaptureRequirement,
|
|
12185
|
-
|
|
12186
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
12187
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
12188
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
12189
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
12190
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
12055
|
+
thresholds: idCaptureThresholds,
|
|
12191
12056
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
12192
12057
|
instructions: idCaptureInstructions,
|
|
12193
12058
|
guideType: idCaptureGuideType,
|
|
@@ -12197,7 +12062,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12197
12062
|
skipSuccessScreen: skipSuccessScreen,
|
|
12198
12063
|
debugMode: debugMode
|
|
12199
12064
|
};
|
|
12200
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
12065
|
+
}, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, skipSuccessScreen, debugMode]);
|
|
12201
12066
|
var faceLivenessProps = React.useMemo(function () {
|
|
12202
12067
|
return {
|
|
12203
12068
|
loadingOverlayMode: faceLivenessLoadingOverlayMode,
|
|
@@ -12305,10 +12170,9 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12305
12170
|
* 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.
|
|
12306
12171
|
*/
|
|
12307
12172
|
var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollment(_a) {
|
|
12308
|
-
var _b, _c;
|
|
12309
12173
|
var enrollmentId = _a.enrollmentId,
|
|
12310
|
-
|
|
12311
|
-
lang =
|
|
12174
|
+
_b = _a.lang,
|
|
12175
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
12312
12176
|
sessionId = _a.sessionId,
|
|
12313
12177
|
authUrl = _a.authUrl,
|
|
12314
12178
|
submissionUrl = _a.submissionUrl,
|
|
@@ -12332,39 +12196,29 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12332
12196
|
webhooksSendProcessedImages = _a.webhooksSendProcessedImages,
|
|
12333
12197
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
12334
12198
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
12335
|
-
|
|
12336
|
-
idCaptureLoadingOverlayMode =
|
|
12337
|
-
|
|
12338
|
-
idCaptureRequirement =
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
12344
|
-
|
|
12345
|
-
|
|
12346
|
-
|
|
12347
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
12348
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
12349
|
-
_m = _a.passportFocusScoreThreshold,
|
|
12350
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
12351
|
-
_o = _a.faceLivenessTimeoutDurationMs,
|
|
12352
|
-
faceLivenessTimeoutDurationMs = _o === void 0 ? 15000 : _o,
|
|
12353
|
-
_p = _a.faceLivenessLoadingOverlayMode,
|
|
12354
|
-
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
12355
|
-
_q = _a.skipSuccessScreen,
|
|
12356
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
12199
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
12200
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
12201
|
+
_d = _a.idCaptureRequirement,
|
|
12202
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
12203
|
+
_e = _a.idCaptureThresholds,
|
|
12204
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
12205
|
+
_f = _a.faceLivenessTimeoutDurationMs,
|
|
12206
|
+
faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
|
|
12207
|
+
_g = _a.faceLivenessLoadingOverlayMode,
|
|
12208
|
+
faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
|
|
12209
|
+
_h = _a.skipSuccessScreen,
|
|
12210
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
12357
12211
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
12358
|
-
|
|
12359
|
-
idCaptureGuideType =
|
|
12360
|
-
|
|
12361
|
-
idCapturePortraitGuidesOnMobile =
|
|
12362
|
-
|
|
12363
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
12364
|
-
|
|
12365
|
-
idCaptureModelLoadTimeoutMs =
|
|
12366
|
-
|
|
12367
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
12212
|
+
_j = _a.idCaptureGuideType,
|
|
12213
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
12214
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
12215
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
12216
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
12217
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
12218
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
12219
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
12220
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
12221
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
12368
12222
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
12369
12223
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
12370
12224
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
@@ -12380,28 +12234,28 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12380
12234
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
12381
12235
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
12382
12236
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
12383
|
-
|
|
12384
|
-
captureSignature =
|
|
12385
|
-
|
|
12386
|
-
captureSignatureVideo =
|
|
12387
|
-
|
|
12388
|
-
captureAdditionalDocuments =
|
|
12389
|
-
|
|
12390
|
-
theme =
|
|
12391
|
-
|
|
12392
|
-
assets =
|
|
12393
|
-
|
|
12394
|
-
classNames =
|
|
12395
|
-
|
|
12396
|
-
colors =
|
|
12397
|
-
|
|
12398
|
-
verbiage =
|
|
12399
|
-
|
|
12400
|
-
geolocationEnabled =
|
|
12401
|
-
|
|
12402
|
-
geolocationRequired =
|
|
12403
|
-
|
|
12404
|
-
debugMode =
|
|
12237
|
+
_p = _a.captureSignature,
|
|
12238
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
12239
|
+
_q = _a.captureSignatureVideo,
|
|
12240
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
12241
|
+
_r = _a.captureAdditionalDocuments,
|
|
12242
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
12243
|
+
_s = _a.theme,
|
|
12244
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
12245
|
+
_t = _a.assets,
|
|
12246
|
+
assets = _t === void 0 ? {} : _t,
|
|
12247
|
+
_u = _a.classNames,
|
|
12248
|
+
classNames = _u === void 0 ? {} : _u,
|
|
12249
|
+
_v = _a.colors,
|
|
12250
|
+
colors = _v === void 0 ? {} : _v,
|
|
12251
|
+
_w = _a.verbiage,
|
|
12252
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
12253
|
+
_x = _a.geolocationEnabled,
|
|
12254
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
12255
|
+
_y = _a.geolocationRequired,
|
|
12256
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
12257
|
+
_z = _a.debugMode,
|
|
12258
|
+
debugMode = _z === void 0 ? false : _z;
|
|
12405
12259
|
useLanguage(lang);
|
|
12406
12260
|
useDebugLogging(debugMode);
|
|
12407
12261
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -12411,12 +12265,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12411
12265
|
colors: colors.idCapture,
|
|
12412
12266
|
verbiage: verbiage.idCapture,
|
|
12413
12267
|
captureRequirement: idCaptureRequirement,
|
|
12414
|
-
|
|
12415
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
12416
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
12417
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
12418
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
12419
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
12268
|
+
thresholds: idCaptureThresholds,
|
|
12420
12269
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
12421
12270
|
instructions: idCaptureInstructions,
|
|
12422
12271
|
guideType: idCaptureGuideType,
|
|
@@ -12429,7 +12278,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12429
12278
|
skipSuccessScreen: skipSuccessScreen,
|
|
12430
12279
|
debugMode: debugMode
|
|
12431
12280
|
};
|
|
12432
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
12281
|
+
}, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
|
|
12433
12282
|
var faceLivenessProps = React.useMemo(function () {
|
|
12434
12283
|
return {
|
|
12435
12284
|
onExitCapture: onExitCapture,
|
|
@@ -13767,70 +13616,60 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13767
13616
|
faceLivenessProps = _a.faceLivenessProps,
|
|
13768
13617
|
_c = _a.idCaptureModelsEnabled,
|
|
13769
13618
|
idCaptureModelsEnabled = _c === void 0 ? true : _c,
|
|
13770
|
-
_d = _a.
|
|
13771
|
-
|
|
13772
|
-
_e = _a.idCardFrontFocusThreshold,
|
|
13773
|
-
idCardFrontFocusThreshold = _e === void 0 ? 0 : _e,
|
|
13774
|
-
_f = _a.goodIdCardFrontFramesThreshold,
|
|
13775
|
-
goodIdCardFrontFramesThreshold = _f === void 0 ? 1 : _f,
|
|
13776
|
-
_g = _a.idCardBackDetectionThreshold,
|
|
13777
|
-
idCardBackDetectionThreshold = _g === void 0 ? 0.6 : _g,
|
|
13778
|
-
_h = _a.idCardBackFocusThreshold,
|
|
13779
|
-
idCardBackFocusThreshold = _h === void 0 ? 0 : _h,
|
|
13780
|
-
_j = _a.goodIdCardBackFramesThreshold,
|
|
13781
|
-
goodIdCardBackFramesThreshold = _j === void 0 ? 1 : _j,
|
|
13619
|
+
_d = _a.videoIdCaptureThresholds,
|
|
13620
|
+
videoIdCaptureThresholds = _d === void 0 ? defaultVideoIdCaptureThresholds : _d,
|
|
13782
13621
|
readTextPrompt = _a.readTextPrompt,
|
|
13783
|
-
|
|
13784
|
-
readTextTimeoutDurationMs =
|
|
13785
|
-
|
|
13786
|
-
readTextMinReadingMs =
|
|
13787
|
-
|
|
13788
|
-
skipSuccessScreen =
|
|
13789
|
-
|
|
13790
|
-
skipIdCapture =
|
|
13791
|
-
|
|
13792
|
-
skipShowIdCardBack =
|
|
13793
|
-
|
|
13794
|
-
idCaptureLoadingOverlayMode =
|
|
13795
|
-
|
|
13796
|
-
idCaptureGuideType =
|
|
13797
|
-
|
|
13798
|
-
idCapturePortraitGuidesOnMobile =
|
|
13799
|
-
|
|
13800
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
13622
|
+
_e = _a.readTextTimeoutDurationMs,
|
|
13623
|
+
readTextTimeoutDurationMs = _e === void 0 ? 15000 : _e,
|
|
13624
|
+
_f = _a.readTextMinReadingMs,
|
|
13625
|
+
readTextMinReadingMs = _f === void 0 ? 10000 : _f,
|
|
13626
|
+
_g = _a.skipSuccessScreen,
|
|
13627
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
13628
|
+
_h = _a.skipIdCapture,
|
|
13629
|
+
skipIdCapture = _h === void 0 ? false : _h,
|
|
13630
|
+
_j = _a.skipShowIdCardBack,
|
|
13631
|
+
skipShowIdCardBack = _j === void 0 ? false : _j,
|
|
13632
|
+
_k = _a.idCaptureLoadingOverlayMode,
|
|
13633
|
+
idCaptureLoadingOverlayMode = _k === void 0 ? 'default' : _k,
|
|
13634
|
+
_l = _a.idCaptureGuideType,
|
|
13635
|
+
idCaptureGuideType = _l === void 0 ? 'fit' : _l,
|
|
13636
|
+
_m = _a.idCapturePortraitGuidesOnMobile,
|
|
13637
|
+
idCapturePortraitGuidesOnMobile = _m === void 0 ? false : _m,
|
|
13638
|
+
_o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
13639
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
|
|
13801
13640
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
13802
|
-
|
|
13803
|
-
faceLivenessLoadingOverlayMode =
|
|
13804
|
-
|
|
13805
|
-
disableFaceDetectionWhileAudioCapture =
|
|
13806
|
-
|
|
13807
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
13808
|
-
|
|
13809
|
-
silentFallback =
|
|
13810
|
-
|
|
13811
|
-
mergeAVStreams =
|
|
13812
|
-
|
|
13813
|
-
theme =
|
|
13814
|
-
|
|
13815
|
-
assets =
|
|
13816
|
-
|
|
13817
|
-
classNames =
|
|
13818
|
-
|
|
13819
|
-
colors =
|
|
13820
|
-
|
|
13821
|
-
verbiage =
|
|
13822
|
-
|
|
13823
|
-
captureSignature =
|
|
13824
|
-
|
|
13825
|
-
captureSignatureVideo =
|
|
13826
|
-
|
|
13827
|
-
captureAdditionalDocuments =
|
|
13828
|
-
|
|
13829
|
-
geolocationEnabled =
|
|
13830
|
-
|
|
13831
|
-
geolocationRequired =
|
|
13832
|
-
|
|
13833
|
-
debugMode =
|
|
13641
|
+
_p = _a.faceLivenessLoadingOverlayMode,
|
|
13642
|
+
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
13643
|
+
_q = _a.disableFaceDetectionWhileAudioCapture,
|
|
13644
|
+
disableFaceDetectionWhileAudioCapture = _q === void 0 ? false : _q,
|
|
13645
|
+
_r = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
13646
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _r === void 0 ? 2000 : _r,
|
|
13647
|
+
_s = _a.silentFallback,
|
|
13648
|
+
silentFallback = _s === void 0 ? false : _s,
|
|
13649
|
+
_t = _a.mergeAVStreams,
|
|
13650
|
+
mergeAVStreams = _t === void 0 ? false : _t,
|
|
13651
|
+
_u = _a.theme,
|
|
13652
|
+
theme = _u === void 0 ? 'default' : _u,
|
|
13653
|
+
_v = _a.assets,
|
|
13654
|
+
assets = _v === void 0 ? {} : _v,
|
|
13655
|
+
_w = _a.classNames,
|
|
13656
|
+
classNames = _w === void 0 ? {} : _w,
|
|
13657
|
+
_x = _a.colors,
|
|
13658
|
+
colors = _x === void 0 ? {} : _x,
|
|
13659
|
+
_y = _a.verbiage,
|
|
13660
|
+
verbiage = _y === void 0 ? {} : _y,
|
|
13661
|
+
_z = _a.captureSignature,
|
|
13662
|
+
captureSignature = _z === void 0 ? false : _z,
|
|
13663
|
+
_0 = _a.captureSignatureVideo,
|
|
13664
|
+
captureSignatureVideo = _0 === void 0 ? false : _0,
|
|
13665
|
+
_1 = _a.captureAdditionalDocuments,
|
|
13666
|
+
captureAdditionalDocuments = _1 === void 0 ? [] : _1,
|
|
13667
|
+
_2 = _a.geolocationEnabled,
|
|
13668
|
+
geolocationEnabled = _2 === void 0 ? true : _2,
|
|
13669
|
+
_3 = _a.geolocationRequired,
|
|
13670
|
+
geolocationRequired = _3 === void 0 ? false : _3,
|
|
13671
|
+
_4 = _a.debugMode,
|
|
13672
|
+
debugMode = _4 === void 0 ? false : _4;
|
|
13834
13673
|
useLanguage(lang);
|
|
13835
13674
|
useDebugLogging(debugMode);
|
|
13836
13675
|
var videoIdCaptureProps = React.useMemo(function () {
|
|
@@ -13838,12 +13677,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13838
13677
|
idCaptureProps: idCaptureProps,
|
|
13839
13678
|
faceLivenessProps: faceLivenessProps,
|
|
13840
13679
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
13841
|
-
|
|
13842
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
13843
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
13844
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
13845
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
13846
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
13680
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
13847
13681
|
readTextPrompt: readTextPrompt,
|
|
13848
13682
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
13849
13683
|
readTextMinReadingMs: readTextMinReadingMs,
|
|
@@ -13868,7 +13702,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13868
13702
|
verbiage: verbiage,
|
|
13869
13703
|
debugMode: debugMode
|
|
13870
13704
|
};
|
|
13871
|
-
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled,
|
|
13705
|
+
}, [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]);
|
|
13872
13706
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
13873
13707
|
return {
|
|
13874
13708
|
documents: captureAdditionalDocuments,
|