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
package/dist/sdk2.esm.js
CHANGED
|
@@ -14,7 +14,7 @@ import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
14
14
|
import i18n from 'i18next';
|
|
15
15
|
import SignatureCanvas from 'react-signature-canvas';
|
|
16
16
|
|
|
17
|
-
var webSdkVersion = '2.0
|
|
17
|
+
var webSdkVersion = '2.1.0';
|
|
18
18
|
|
|
19
19
|
function getPlatform() {
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1599,10 +1599,6 @@ function convertBase64ToBlob(base64Image) {
|
|
|
1599
1599
|
});
|
|
1600
1600
|
}
|
|
1601
1601
|
|
|
1602
|
-
function supportsNativeBarcodeScanning() {
|
|
1603
|
-
return 'BarcodeDetector' in window;
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
1602
|
function getFrameDimensions(frame) {
|
|
1607
1603
|
var frameWidth = frame.width,
|
|
1608
1604
|
frameHeight = frame.height;
|
|
@@ -2474,10 +2470,14 @@ function waitForVideoReady(videoRef, checkEveryMs) {
|
|
|
2474
2470
|
});
|
|
2475
2471
|
}
|
|
2476
2472
|
|
|
2477
|
-
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
2473
|
+
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite";
|
|
2478
2474
|
var defaultFocusModelLoadTimeoutMs = 45000;
|
|
2479
2475
|
var defaultFocusThresholds = {
|
|
2480
|
-
|
|
2476
|
+
idCardFront: {
|
|
2477
|
+
desktop: 0,
|
|
2478
|
+
mobile: 0.3
|
|
2479
|
+
},
|
|
2480
|
+
idCardBack: {
|
|
2481
2481
|
desktop: 0,
|
|
2482
2482
|
mobile: 0.3
|
|
2483
2483
|
},
|
|
@@ -3100,14 +3100,19 @@ function sumUpProgressForDependencies(dependencies) {
|
|
|
3100
3100
|
});
|
|
3101
3101
|
}
|
|
3102
3102
|
|
|
3103
|
-
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
3103
|
+
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240614/model_fp16.tflite";
|
|
3104
3104
|
var defaultDocumentDetectionScoreThreshold = 0.1;
|
|
3105
3105
|
var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
|
|
3106
3106
|
var defaultDocumentDetectionThresholds = {
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3107
|
+
idCardFront: 0.8,
|
|
3108
|
+
idCardBack: 0.8,
|
|
3109
|
+
passport: 0.5
|
|
3110
|
+
};
|
|
3111
|
+
var documentTypeDisplayNames = {
|
|
3112
|
+
idCardFront: 'ID card front',
|
|
3113
|
+
idCardBack: 'ID card back',
|
|
3114
|
+
passport: 'Passport',
|
|
3115
|
+
none: 'None'
|
|
3111
3116
|
};
|
|
3112
3117
|
var detectors = {};
|
|
3113
3118
|
function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
@@ -3262,34 +3267,33 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
3262
3267
|
return n > 0;
|
|
3263
3268
|
});
|
|
3264
3269
|
});
|
|
3265
|
-
var
|
|
3270
|
+
var bestIdCardFront = detectedObjects.find(function (obj) {
|
|
3266
3271
|
return obj.label === 'Document';
|
|
3267
3272
|
});
|
|
3273
|
+
var bestIdCardBack = detectedObjects.find(function (obj) {
|
|
3274
|
+
return obj.label === 'Document back';
|
|
3275
|
+
});
|
|
3268
3276
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
3269
3277
|
return obj.label === 'Passport page';
|
|
3270
3278
|
});
|
|
3271
|
-
var
|
|
3272
|
-
var
|
|
3273
|
-
var
|
|
3274
|
-
var
|
|
3275
|
-
var
|
|
3279
|
+
var idCardFrontDetectionScore = (_a = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _a !== void 0 ? _a : 0;
|
|
3280
|
+
var idCardBackDetectionScore = (_b = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _b !== void 0 ? _b : 0;
|
|
3281
|
+
var passportDetectionScore = (_c = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _c !== void 0 ? _c : 0;
|
|
3282
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_d = thresholds.idCardFront) !== null && _d !== void 0 ? _d : 0);
|
|
3283
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_e = thresholds.idCardBack) !== null && _e !== void 0 ? _e : 0);
|
|
3284
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_f = thresholds.passport) !== null && _f !== void 0 ? _f : 0);
|
|
3285
|
+
var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
3286
|
+
var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
3287
|
+
var detectionScore = (_g = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _g !== void 0 ? _g : 0;
|
|
3276
3288
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
3277
3289
|
var detectedDocumentType = 'none';
|
|
3278
3290
|
if (passportDetectionThresholdMet) {
|
|
3279
3291
|
detectedDocumentType = 'passport';
|
|
3292
|
+
} else if (idCardBackDetectionThresholdMet) {
|
|
3293
|
+
detectedDocumentType = 'idCardBack';
|
|
3280
3294
|
} else if (detectionThresholdMet) {
|
|
3281
|
-
detectedDocumentType = '
|
|
3295
|
+
detectedDocumentType = 'idCardFront';
|
|
3282
3296
|
}
|
|
3283
|
-
var bestMrz = detectedObjects.find(function (obj) {
|
|
3284
|
-
return obj.label === 'MRZ';
|
|
3285
|
-
});
|
|
3286
|
-
var mrzDetectionScore = (_d = bestMrz === null || bestMrz === void 0 ? void 0 : bestMrz.score) !== null && _d !== void 0 ? _d : 0;
|
|
3287
|
-
var mrzDetectionThresholdMet = mrzDetectionScore >= ((_e = thresholds.mrz) !== null && _e !== void 0 ? _e : 0);
|
|
3288
|
-
var bestPdf417 = detectedObjects.find(function (obj) {
|
|
3289
|
-
return obj.label === 'PDF417';
|
|
3290
|
-
});
|
|
3291
|
-
var pdf417DetectionScore = (_f = bestPdf417 === null || bestPdf417 === void 0 ? void 0 : bestPdf417.score) !== null && _f !== void 0 ? _f : 0;
|
|
3292
|
-
var pdf417DetectionThresholdMet = pdf417DetectionScore >= ((_g = thresholds.pdf417) !== null && _g !== void 0 ? _g : 0);
|
|
3293
3297
|
var documentInBounds = false;
|
|
3294
3298
|
if (bestDocument) {
|
|
3295
3299
|
var boundaryPx = 20;
|
|
@@ -3319,15 +3323,13 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
3319
3323
|
detectionTime: time,
|
|
3320
3324
|
detectionThresholdMet: detectionThresholdMet,
|
|
3321
3325
|
detectedDocumentType: detectedDocumentType,
|
|
3326
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
3327
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
3328
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
3329
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
3322
3330
|
passportDetectionScore: passportDetectionScore,
|
|
3323
3331
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3324
|
-
mrzDetectionScore: mrzDetectionScore,
|
|
3325
|
-
mrzDetectionThresholdMet: mrzDetectionThresholdMet,
|
|
3326
|
-
pdf417DetectionScore: pdf417DetectionScore,
|
|
3327
|
-
pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
|
|
3328
3332
|
bestDocument: bestDocument,
|
|
3329
|
-
bestMrz: bestMrz,
|
|
3330
|
-
bestPdf417: bestPdf417,
|
|
3331
3333
|
documentInBounds: documentInBounds,
|
|
3332
3334
|
documentTooClose: documentTooClose,
|
|
3333
3335
|
frameWidth: frameWidth,
|
|
@@ -3575,24 +3577,26 @@ function FocusModelProvider(_a) {
|
|
|
3575
3577
|
focusModelPath = _b === void 0 ? defaultFocusModelPath : _b,
|
|
3576
3578
|
_c = _a.focusModelLoadTimeoutMs,
|
|
3577
3579
|
focusModelLoadTimeoutMs = _c === void 0 ? defaultFocusModelLoadTimeoutMs : _c,
|
|
3578
|
-
onFocusModelError = _a.onFocusModelError
|
|
3580
|
+
onFocusModelError = _a.onFocusModelError,
|
|
3581
|
+
_d = _a.showCanvases,
|
|
3582
|
+
showCanvases = _d === void 0 ? false : _d;
|
|
3579
3583
|
var cropCanvas = useRef(null);
|
|
3580
3584
|
var rotateCanvas = useRef(null);
|
|
3581
|
-
var
|
|
3582
|
-
focusThresholds =
|
|
3583
|
-
setFocusThresholds =
|
|
3584
|
-
var
|
|
3585
|
-
focusPredictionTime =
|
|
3586
|
-
setFocusPredictionTime =
|
|
3587
|
-
var
|
|
3585
|
+
var _e = useState({}),
|
|
3586
|
+
focusThresholds = _e[0],
|
|
3587
|
+
setFocusThresholds = _e[1];
|
|
3588
|
+
var _f = useState(0),
|
|
3589
|
+
focusPredictionTime = _f[0],
|
|
3590
|
+
setFocusPredictionTime = _f[1];
|
|
3591
|
+
var _g = useLoadFocusModel({
|
|
3588
3592
|
modelPath: focusModelPath,
|
|
3589
3593
|
modelLoadTimeoutMs: focusModelLoadTimeoutMs,
|
|
3590
3594
|
onModelError: onFocusModelError
|
|
3591
3595
|
}),
|
|
3592
|
-
model =
|
|
3593
|
-
ready =
|
|
3594
|
-
modelDownloadProgress =
|
|
3595
|
-
modelError =
|
|
3596
|
+
model = _g.model,
|
|
3597
|
+
ready = _g.ready,
|
|
3598
|
+
modelDownloadProgress = _g.modelDownloadProgress,
|
|
3599
|
+
modelError = _g.modelError;
|
|
3596
3600
|
var makeFocusPrediction = useCallback(function (imageData, box) {
|
|
3597
3601
|
if (!model.current) return null;
|
|
3598
3602
|
var prediction = makeFocusModelPrediction(model.current, imageData, cropCanvas.current, rotateCanvas.current, box);
|
|
@@ -3613,13 +3617,23 @@ function FocusModelProvider(_a) {
|
|
|
3613
3617
|
return /*#__PURE__*/React__default.createElement(FocusModelContext.Provider, {
|
|
3614
3618
|
value: value
|
|
3615
3619
|
}, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
3616
|
-
ref: rotateCanvas
|
|
3620
|
+
ref: rotateCanvas,
|
|
3621
|
+
style: showCanvases ? {
|
|
3622
|
+
display: 'block'
|
|
3623
|
+
} : undefined
|
|
3617
3624
|
}), /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
3618
|
-
ref: cropCanvas
|
|
3625
|
+
ref: cropCanvas,
|
|
3626
|
+
style: showCanvases ? {
|
|
3627
|
+
display: 'block'
|
|
3628
|
+
} : undefined
|
|
3619
3629
|
}), children);
|
|
3620
3630
|
}
|
|
3621
3631
|
|
|
3622
3632
|
var onMobile = isMobile();
|
|
3633
|
+
var defaultIdCaptureThresholds = {
|
|
3634
|
+
detection: defaultDocumentDetectionThresholds,
|
|
3635
|
+
focus: defaultFocusThresholds
|
|
3636
|
+
};
|
|
3623
3637
|
var IdCaptureModelsContext = /*#__PURE__*/createContext({
|
|
3624
3638
|
ready: false,
|
|
3625
3639
|
start: function start() {
|
|
@@ -3630,7 +3644,7 @@ var IdCaptureModelsContext = /*#__PURE__*/createContext({
|
|
|
3630
3644
|
},
|
|
3631
3645
|
modelDownloadProgress: 0,
|
|
3632
3646
|
modelError: null,
|
|
3633
|
-
thresholds:
|
|
3647
|
+
thresholds: defaultIdCaptureThresholds,
|
|
3634
3648
|
setThresholds: function setThresholds() {
|
|
3635
3649
|
return null;
|
|
3636
3650
|
},
|
|
@@ -3645,6 +3659,10 @@ var IdCaptureModelsContext = /*#__PURE__*/createContext({
|
|
|
3645
3659
|
},
|
|
3646
3660
|
resetBestFrame: function resetBestFrame() {
|
|
3647
3661
|
return null;
|
|
3662
|
+
},
|
|
3663
|
+
requiredDocumentType: 'none',
|
|
3664
|
+
setRequiredDocumentType: function setRequiredDocumentType() {
|
|
3665
|
+
return null;
|
|
3648
3666
|
}
|
|
3649
3667
|
});
|
|
3650
3668
|
function IdCaptureModelsProviderInner(_a) {
|
|
@@ -3677,26 +3695,34 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3677
3695
|
var bestPredictionCanvas = useRef(null);
|
|
3678
3696
|
var bestFocusScore = useRef(0);
|
|
3679
3697
|
var stopDetection = useRef(0);
|
|
3698
|
+
var _e = useState('none'),
|
|
3699
|
+
requiredDocumentType = _e[0],
|
|
3700
|
+
setRequiredDocumentType = _e[1];
|
|
3680
3701
|
var thresholds = useMemo(function () {
|
|
3681
3702
|
return __assign(__assign({}, documentDetectionThresholds), {
|
|
3682
3703
|
focus: focusThresholds
|
|
3683
3704
|
});
|
|
3684
3705
|
}, [documentDetectionThresholds, focusThresholds]);
|
|
3685
3706
|
var setThresholds = useCallback(function (thresholds) {
|
|
3686
|
-
|
|
3687
|
-
|
|
3707
|
+
if (thresholds.detection) {
|
|
3708
|
+
setDocumentDetectionThresholds(thresholds.detection);
|
|
3709
|
+
}
|
|
3710
|
+
if (thresholds.focus) {
|
|
3711
|
+
setFocusThresholds(thresholds.focus);
|
|
3712
|
+
}
|
|
3688
3713
|
}, [setDocumentDetectionThresholds, setFocusThresholds]);
|
|
3689
3714
|
useEffect(function handleDetections() {
|
|
3690
3715
|
var _this = this;
|
|
3691
3716
|
onDocumentDetected(function (prediction) {
|
|
3692
3717
|
return __awaiter(_this, void 0, void 0, function () {
|
|
3693
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, focusPrediction, focusThresholdSet, focusThreshold;
|
|
3718
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
3694
3719
|
var _a, _b, _c, _d, _e;
|
|
3695
3720
|
return __generator(this, function (_f) {
|
|
3696
3721
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
3697
3722
|
stopDetectionAtStart = stopDetection.current;
|
|
3698
3723
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
3699
|
-
|
|
3724
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType;
|
|
3725
|
+
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
|
|
3700
3726
|
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_a = prediction.bestDocument) === null || _a === void 0 ? void 0 : _a.box);
|
|
3701
3727
|
if (focusPrediction) {
|
|
3702
3728
|
focusScore = focusPrediction.score;
|
|
@@ -3725,7 +3751,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3725
3751
|
});
|
|
3726
3752
|
});
|
|
3727
3753
|
});
|
|
3728
|
-
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, thresholds.focus]);
|
|
3754
|
+
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
3729
3755
|
var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
|
|
3730
3756
|
useEffect(function handleModelErrors() {
|
|
3731
3757
|
modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
|
|
@@ -3739,9 +3765,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3739
3765
|
canvas: bestPredictionCanvas.current
|
|
3740
3766
|
});
|
|
3741
3767
|
}, [bestFrameDetails]);
|
|
3742
|
-
var
|
|
3743
|
-
canvasKey =
|
|
3744
|
-
setCanvasKey =
|
|
3768
|
+
var _f = useState(0),
|
|
3769
|
+
canvasKey = _f[0],
|
|
3770
|
+
setCanvasKey = _f[1];
|
|
3745
3771
|
var resetBestFrame = useCallback(function () {
|
|
3746
3772
|
stopDetection.current += 1;
|
|
3747
3773
|
setCanvasKey(function (n) {
|
|
@@ -3751,6 +3777,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3751
3777
|
setBestFrameDetails(null);
|
|
3752
3778
|
bestFocusScore.current = 0;
|
|
3753
3779
|
}, [clearDocumentDetectionLastPredictionCanvas]);
|
|
3780
|
+
useEffect(function () {
|
|
3781
|
+
requiredDocumentType && resetBestFrame();
|
|
3782
|
+
}, [requiredDocumentType, resetBestFrame]);
|
|
3754
3783
|
var value = useMemo(function () {
|
|
3755
3784
|
return {
|
|
3756
3785
|
ready: documentDetectionModelReady && focusModelReady,
|
|
@@ -3765,9 +3794,11 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
3765
3794
|
focusPredictionTime: focusPredictionTime,
|
|
3766
3795
|
getBestFrame: getBestFrame,
|
|
3767
3796
|
resetBestFrame: resetBestFrame,
|
|
3768
|
-
bestFrameDetails: bestFrameDetails
|
|
3797
|
+
bestFrameDetails: bestFrameDetails,
|
|
3798
|
+
requiredDocumentType: requiredDocumentType,
|
|
3799
|
+
setRequiredDocumentType: setRequiredDocumentType
|
|
3769
3800
|
};
|
|
3770
|
-
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
3801
|
+
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
3771
3802
|
return /*#__PURE__*/React__default.createElement(IdCaptureModelsContext.Provider, {
|
|
3772
3803
|
value: value
|
|
3773
3804
|
}, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
@@ -3816,28 +3847,19 @@ var initialState$4 = {
|
|
|
3816
3847
|
videoHeight: 0,
|
|
3817
3848
|
detectedObjects: [],
|
|
3818
3849
|
bestDocument: undefined,
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
documentType: 'none',
|
|
3850
|
+
detectedDocumentType: 'none',
|
|
3851
|
+
detectionThresholdMet: false,
|
|
3822
3852
|
documentInBounds: false,
|
|
3823
3853
|
documentTooClose: false,
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
pdf417DetectionThresholdMet: false,
|
|
3854
|
+
flipRequired: false,
|
|
3855
|
+
idCardFrontDetectionScore: 0,
|
|
3856
|
+
idCardFrontDetectionThresholdMet: false,
|
|
3857
|
+
idCardBackDetectionScore: 0,
|
|
3858
|
+
idCardBackDetectionThresholdMet: false,
|
|
3859
|
+
passportDetectionScore: 0,
|
|
3860
|
+
passportDetectionThresholdMet: false,
|
|
3832
3861
|
focusScore: 0,
|
|
3833
3862
|
focusThresholdMet: false,
|
|
3834
|
-
barcodeScanningEnabled: false,
|
|
3835
|
-
barcodeResult: null,
|
|
3836
|
-
waitingForBarcodeScan: false,
|
|
3837
|
-
shouldScanBarcode: false,
|
|
3838
|
-
autoCaptureBarcodeRequired: 'mobile',
|
|
3839
|
-
barcodeScanFailedAttempts: 0,
|
|
3840
|
-
maxBarcodeScanAttempts: 10,
|
|
3841
3863
|
isGoodFrame: false,
|
|
3842
3864
|
goodFramesCount: 0,
|
|
3843
3865
|
goodFramesThreshold: 3,
|
|
@@ -3851,8 +3873,6 @@ var initialState$4 = {
|
|
|
3851
3873
|
capturedDocuments: {},
|
|
3852
3874
|
captureRequirement: 'idCardOrPassport',
|
|
3853
3875
|
requestedDocumentType: 'idCardFront',
|
|
3854
|
-
detectedDocumentType: 'none',
|
|
3855
|
-
differentDocumentTypeDetections: 0,
|
|
3856
3876
|
operationStartedAt: null,
|
|
3857
3877
|
captureStartedAt: null
|
|
3858
3878
|
};
|
|
@@ -3887,11 +3907,6 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3887
3907
|
newState.operationStartedAt = new Date();
|
|
3888
3908
|
return newState;
|
|
3889
3909
|
}
|
|
3890
|
-
case 'configureCapture':
|
|
3891
|
-
return __assign(__assign(__assign({}, state), action.payload), {
|
|
3892
|
-
capturing: false,
|
|
3893
|
-
captureFailed: false
|
|
3894
|
-
});
|
|
3895
3910
|
case 'setRequiredDocumentType':
|
|
3896
3911
|
return __assign(__assign({}, state), {
|
|
3897
3912
|
requiredDocumentType: action.payload
|
|
@@ -3928,18 +3943,15 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3928
3943
|
case 'objectsDetected':
|
|
3929
3944
|
var _d = action.payload.prediction,
|
|
3930
3945
|
detectedObjects = _d.detectedObjects,
|
|
3931
|
-
detectionScore = _d.detectionScore,
|
|
3932
3946
|
detectionThresholdMet = _d.detectionThresholdMet,
|
|
3933
3947
|
detectedDocumentType = _d.detectedDocumentType,
|
|
3948
|
+
idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
|
|
3949
|
+
idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
|
|
3950
|
+
idCardBackDetectionScore = _d.idCardBackDetectionScore,
|
|
3951
|
+
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
3934
3952
|
passportDetectionScore = _d.passportDetectionScore,
|
|
3935
3953
|
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
3936
|
-
mrzDetectionScore = _d.mrzDetectionScore,
|
|
3937
|
-
mrzDetectionThresholdMet = _d.mrzDetectionThresholdMet,
|
|
3938
|
-
pdf417DetectionScore = _d.pdf417DetectionScore,
|
|
3939
|
-
pdf417DetectionThresholdMet = _d.pdf417DetectionThresholdMet,
|
|
3940
3954
|
bestDocument = _d.bestDocument,
|
|
3941
|
-
bestMrz = _d.bestMrz,
|
|
3942
|
-
bestPdf417 = _d.bestPdf417,
|
|
3943
3955
|
documentInBounds = _d.documentInBounds,
|
|
3944
3956
|
documentTooClose = _d.documentTooClose,
|
|
3945
3957
|
focusScore = _d.focusScore,
|
|
@@ -3955,84 +3967,48 @@ var reducer$4 = function reducer(state, action) {
|
|
|
3955
3967
|
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
3956
3968
|
}
|
|
3957
3969
|
}
|
|
3958
|
-
var
|
|
3959
|
-
var
|
|
3960
|
-
var waitingForBarcodeScan = shouldScanBarcode && !state.barcodeResult;
|
|
3961
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && focusThresholdMet;
|
|
3970
|
+
var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
|
|
3971
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && focusThresholdMet;
|
|
3962
3972
|
var goodFramesCount = state.goodFramesCount;
|
|
3963
3973
|
if (isGoodFrame) {
|
|
3964
3974
|
goodFramesCount += 1;
|
|
3965
3975
|
}
|
|
3976
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
3977
|
+
var requestedDocumentType = state.requestedDocumentType;
|
|
3978
|
+
if (state.captureRequirement === 'idCardOrPassport') {
|
|
3979
|
+
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
3980
|
+
requestedDocumentType = 'passport';
|
|
3981
|
+
}
|
|
3982
|
+
if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
|
|
3983
|
+
requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3966
3986
|
return __assign(__assign({}, state), {
|
|
3967
3987
|
videoWidth: frameWidth,
|
|
3968
3988
|
videoHeight: frameHeight,
|
|
3969
3989
|
detectedObjects: detectedObjects,
|
|
3970
3990
|
bestDocument: bestDocument,
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3991
|
+
requestedDocumentType: requestedDocumentType,
|
|
3992
|
+
detectedDocumentType: detectedDocumentType,
|
|
3993
|
+
detectionThresholdMet: detectionThresholdMet,
|
|
3974
3994
|
documentInBounds: documentInBounds,
|
|
3975
3995
|
documentTooClose: documentTooClose,
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
passportPageDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3996
|
+
flipRequired: flipRequired,
|
|
3997
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
3998
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
3999
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
4000
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4001
|
+
passportDetectionScore: passportDetectionScore,
|
|
4002
|
+
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3984
4003
|
focusScore: focusScore,
|
|
3985
4004
|
focusThresholdMet: focusThresholdMet,
|
|
3986
|
-
shouldScanBarcode: shouldScanBarcode,
|
|
3987
|
-
waitingForBarcodeScan: waitingForBarcodeScan,
|
|
3988
4005
|
isGoodFrame: isGoodFrame,
|
|
3989
4006
|
goodFramesCount: goodFramesCount,
|
|
3990
4007
|
goodFramesThreshold: goodFramesThreshold,
|
|
3991
|
-
goodFramesThresholdMet:
|
|
4008
|
+
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
3992
4009
|
lastFrameCapturedAt: frameCapturedAt,
|
|
3993
4010
|
frameCaptureRate: frameCaptureRate
|
|
3994
4011
|
});
|
|
3995
|
-
case 'predictionMade':
|
|
3996
|
-
{
|
|
3997
|
-
var _e = action.payload,
|
|
3998
|
-
detectedDocumentType_1 = _e.detectedDocumentType,
|
|
3999
|
-
passportDetectionScore_1 = _e.passportDetectionScore;
|
|
4000
|
-
var requestedDocumentType = state.requestedDocumentType;
|
|
4001
|
-
var newState = __assign(__assign({}, state), {
|
|
4002
|
-
detectedDocumentType: detectedDocumentType_1
|
|
4003
|
-
});
|
|
4004
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4005
|
-
var predictionIsRequestedType = requestedDocumentType.startsWith(detectedDocumentType_1);
|
|
4006
|
-
if (predictionIsRequestedType) {
|
|
4007
|
-
newState.differentDocumentTypeDetections = 0;
|
|
4008
|
-
}
|
|
4009
|
-
if (detectedDocumentType_1 === 'passport' && requestedDocumentType !== 'passport') {
|
|
4010
|
-
newState.requestedDocumentType = 'passport';
|
|
4011
|
-
}
|
|
4012
|
-
if (requestedDocumentType === 'passport' && passportDetectionScore_1 < 0.3) {
|
|
4013
|
-
newState.requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4014
|
-
}
|
|
4015
|
-
}
|
|
4016
|
-
return newState;
|
|
4017
|
-
}
|
|
4018
|
-
case 'barcodeScanned':
|
|
4019
|
-
return __assign(__assign({}, state), {
|
|
4020
|
-
barcodeResult: action.payload.result,
|
|
4021
|
-
waitingForBarcodeScan: false,
|
|
4022
|
-
autoCaptureBarcodeRequired: false
|
|
4023
|
-
});
|
|
4024
|
-
case 'barcodeScanFailed':
|
|
4025
|
-
{
|
|
4026
|
-
var newState = __assign(__assign({}, state), {
|
|
4027
|
-
barcodeScanFailedAttempts: state.barcodeScanFailedAttempts + 1
|
|
4028
|
-
});
|
|
4029
|
-
if (newState.barcodeScanFailedAttempts >= newState.maxBarcodeScanAttempts) {
|
|
4030
|
-
newState.autoCaptureBarcodeRequired = false;
|
|
4031
|
-
newState.shouldScanBarcode = false;
|
|
4032
|
-
newState.waitingForBarcodeScan = false;
|
|
4033
|
-
}
|
|
4034
|
-
return newState;
|
|
4035
|
-
}
|
|
4036
4012
|
case 'captureStarted':
|
|
4037
4013
|
return __assign(__assign({}, state), {
|
|
4038
4014
|
captureStartedAt: new Date(),
|
|
@@ -4084,8 +4060,9 @@ var reducer$4 = function reducer(state, action) {
|
|
|
4084
4060
|
newState_1.requestedDocumentType = remainingRequirements[0];
|
|
4085
4061
|
if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
|
|
4086
4062
|
newState_1.captureState = 'requestingFlip';
|
|
4087
|
-
newState_1.
|
|
4088
|
-
newState_1.
|
|
4063
|
+
newState_1.idCardFrontDetectionThresholdMet = false;
|
|
4064
|
+
newState_1.idCardBackDetectionThresholdMet = false;
|
|
4065
|
+
newState_1.passportDetectionThresholdMet = false;
|
|
4089
4066
|
}
|
|
4090
4067
|
}
|
|
4091
4068
|
return newState_1;
|
|
@@ -4116,8 +4093,9 @@ var reducer$4 = function reducer(state, action) {
|
|
|
4116
4093
|
newState_2.requestedDocumentType = remainingRequirements[0];
|
|
4117
4094
|
if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
|
|
4118
4095
|
newState_2.captureState = 'requestingFlip';
|
|
4119
|
-
newState_2.
|
|
4120
|
-
newState_2.
|
|
4096
|
+
newState_2.idCardFrontDetectionThresholdMet = false;
|
|
4097
|
+
newState_2.idCardBackDetectionThresholdMet = false;
|
|
4098
|
+
newState_2.passportDetectionThresholdMet = false;
|
|
4121
4099
|
}
|
|
4122
4100
|
}
|
|
4123
4101
|
return newState_2;
|
|
@@ -4562,85 +4540,42 @@ var templateObject_1$A, templateObject_2$p;
|
|
|
4562
4540
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
4563
4541
|
|
|
4564
4542
|
var IdCapture = function IdCapture(_a) {
|
|
4565
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
|
4543
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
4566
4544
|
var requiredDocumentType = _a.requiredDocumentType,
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
_o = _a.autoCaptureBarcodeRequired,
|
|
4570
|
-
autoCaptureBarcodeRequired = _o === void 0 ? 'mobile' : _o,
|
|
4571
|
-
_p = _a.idCardDetectionThreshold,
|
|
4572
|
-
idCardDetectionThreshold = _p === void 0 ? defaultDocumentDetectionThresholds.idCard : _p,
|
|
4573
|
-
_q = _a.passportDetectionThreshold,
|
|
4574
|
-
passportDetectionThreshold = _q === void 0 ? defaultDocumentDetectionThresholds.passport : _q,
|
|
4575
|
-
_r = _a.mrzDetectionScoreThreshold,
|
|
4576
|
-
mrzDetectionScoreThreshold = _r === void 0 ? defaultDocumentDetectionThresholds.mrz : _r,
|
|
4577
|
-
_s = _a.pdf417DetectionThreshold,
|
|
4578
|
-
pdf417DetectionThreshold = _s === void 0 ? defaultDocumentDetectionThresholds.pdf417 : _s,
|
|
4579
|
-
_t = _a.idCardFocusScoreThreshold,
|
|
4580
|
-
idCardFocusScoreThreshold = _t === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _t,
|
|
4581
|
-
_u = _a.passportFocusScoreThreshold,
|
|
4582
|
-
passportFocusScoreThreshold = _u === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _u,
|
|
4583
|
-
_v = _a.barcodeScanningEnabled,
|
|
4584
|
-
barcodeScanningEnabled = _v === void 0 ? true : _v,
|
|
4585
|
-
_w = _a.maxBarcodeScanAttempts,
|
|
4586
|
-
maxBarcodeScanAttempts = _w === void 0 ? 10 : _w,
|
|
4545
|
+
_k = _a.thresholds,
|
|
4546
|
+
thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
|
|
4587
4547
|
guidanceMessage = _a.guidanceMessage,
|
|
4588
4548
|
guidanceSatisfied = _a.guidanceSatisfied,
|
|
4589
|
-
onPrediction = _a.onPrediction,
|
|
4590
4549
|
onCapture = _a.onCapture,
|
|
4591
|
-
|
|
4592
|
-
assets =
|
|
4593
|
-
|
|
4594
|
-
classNames =
|
|
4595
|
-
|
|
4596
|
-
colors =
|
|
4597
|
-
|
|
4598
|
-
rawVerbiage =
|
|
4599
|
-
|
|
4600
|
-
debugMode =
|
|
4601
|
-
var
|
|
4602
|
-
ref =
|
|
4603
|
-
|
|
4604
|
-
width =
|
|
4605
|
-
|
|
4606
|
-
height =
|
|
4607
|
-
var
|
|
4608
|
-
state =
|
|
4609
|
-
dispatch =
|
|
4550
|
+
_l = _a.assets,
|
|
4551
|
+
assets = _l === void 0 ? {} : _l,
|
|
4552
|
+
_m = _a.classNames,
|
|
4553
|
+
classNames = _m === void 0 ? {} : _m,
|
|
4554
|
+
_o = _a.colors,
|
|
4555
|
+
colors = _o === void 0 ? {} : _o,
|
|
4556
|
+
_p = _a.verbiage,
|
|
4557
|
+
rawVerbiage = _p === void 0 ? {} : _p,
|
|
4558
|
+
_q = _a.debugMode,
|
|
4559
|
+
debugMode = _q === void 0 ? false : _q;
|
|
4560
|
+
var _r = useResizeObserver(),
|
|
4561
|
+
ref = _r.ref,
|
|
4562
|
+
_s = _r.width,
|
|
4563
|
+
width = _s === void 0 ? 1 : _s,
|
|
4564
|
+
_t = _r.height,
|
|
4565
|
+
height = _t === void 0 ? 1 : _t;
|
|
4566
|
+
var _u = useIdCaptureState(),
|
|
4567
|
+
state = _u[0],
|
|
4568
|
+
dispatch = _u[1];
|
|
4610
4569
|
var cameraRef = useContext(CameraStateContext).cameraRef;
|
|
4611
|
-
var
|
|
4612
|
-
modelsReady =
|
|
4613
|
-
setThresholds =
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
getBestFrame = _6.getBestFrame;
|
|
4570
|
+
var _v = useContext(IdCaptureModelsContext),
|
|
4571
|
+
modelsReady = _v.ready,
|
|
4572
|
+
setThresholds = _v.setThresholds,
|
|
4573
|
+
detectionTime = _v.detectionTime,
|
|
4574
|
+
focusPredictionTime = _v.focusPredictionTime,
|
|
4575
|
+
getBestFrame = _v.getBestFrame;
|
|
4618
4576
|
useEffect(function () {
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
payload: {
|
|
4622
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
4623
|
-
barcodeScanningEnabled: barcodeScanningEnabled,
|
|
4624
|
-
maxBarcodeScanAttempts: maxBarcodeScanAttempts
|
|
4625
|
-
}
|
|
4626
|
-
});
|
|
4627
|
-
}, [autoCaptureBarcodeRequired, barcodeScanningEnabled, dispatch, maxBarcodeScanAttempts]);
|
|
4628
|
-
useEffect(function () {
|
|
4629
|
-
setThresholds({
|
|
4630
|
-
idCard: idCardDetectionThreshold,
|
|
4631
|
-
passport: passportDetectionThreshold,
|
|
4632
|
-
mrz: mrzDetectionScoreThreshold,
|
|
4633
|
-
pdf417: pdf417DetectionThreshold,
|
|
4634
|
-
focus: {
|
|
4635
|
-
idCard: {
|
|
4636
|
-
mobile: idCardFocusScoreThreshold
|
|
4637
|
-
},
|
|
4638
|
-
passport: {
|
|
4639
|
-
mobile: passportFocusScoreThreshold
|
|
4640
|
-
}
|
|
4641
|
-
}
|
|
4642
|
-
});
|
|
4643
|
-
}, [idCardDetectionThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportDetectionThreshold, passportFocusScoreThreshold, pdf417DetectionThreshold, setThresholds]);
|
|
4577
|
+
setThresholds(thresholds);
|
|
4578
|
+
}, [thresholds, setThresholds]);
|
|
4644
4579
|
useEffect(function () {
|
|
4645
4580
|
if (!requiredDocumentType) return;
|
|
4646
4581
|
dispatch({
|
|
@@ -4657,18 +4592,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4657
4592
|
}
|
|
4658
4593
|
});
|
|
4659
4594
|
}, [dispatch, height, width]);
|
|
4660
|
-
|
|
4661
|
-
onPredictionMade(function (prediction) {
|
|
4662
|
-
dispatch({
|
|
4663
|
-
type: 'objectsDetected',
|
|
4664
|
-
payload: {
|
|
4665
|
-
prediction: prediction
|
|
4666
|
-
}
|
|
4667
|
-
});
|
|
4668
|
-
onPrediction === null || onPrediction === void 0 ? void 0 : onPrediction(prediction);
|
|
4669
|
-
});
|
|
4670
|
-
}, [dispatch, onPrediction, onPredictionMade]);
|
|
4671
|
-
var shouldCapture = autoCaptureEnabled && state.goodFramesThresholdMet && !state.capturing && !state.waitingForBarcodeScan && timeSince(state.captureStartedAt) >= 3000;
|
|
4595
|
+
var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
|
|
4672
4596
|
useEffect(function () {
|
|
4673
4597
|
if (!shouldCapture) return;
|
|
4674
4598
|
dispatch({
|
|
@@ -4682,29 +4606,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4682
4606
|
});
|
|
4683
4607
|
return;
|
|
4684
4608
|
}
|
|
4685
|
-
var
|
|
4609
|
+
var canvas = bestFrame.canvas,
|
|
4686
4610
|
documentType = bestFrame.documentType,
|
|
4687
4611
|
boundingBox = bestFrame.boundingBox,
|
|
4688
4612
|
detectionScore = bestFrame.detectionScore,
|
|
4689
4613
|
focusScore = bestFrame.focusScore;
|
|
4690
|
-
var width =
|
|
4691
|
-
height =
|
|
4692
|
-
var canvas = originalCanvas;
|
|
4693
|
-
// resize image to 2k max if barcode is read
|
|
4694
|
-
var isGreaterThan2k = width > 1920 && height > 1080 || width > 1080 && height > 1920;
|
|
4695
|
-
if (isGreaterThan2k && !!state.barcodeResult) {
|
|
4696
|
-
canvas = document.createElement('canvas');
|
|
4697
|
-
if (width > height) {
|
|
4698
|
-
canvas.width = 1920;
|
|
4699
|
-
canvas.height = height * (1920 / width);
|
|
4700
|
-
} else {
|
|
4701
|
-
canvas.height = 1920;
|
|
4702
|
-
canvas.width = width * (1920 / height);
|
|
4703
|
-
}
|
|
4704
|
-
var ctx2d = canvas.getContext('2d');
|
|
4705
|
-
if (!ctx2d) return;
|
|
4706
|
-
ctx2d.drawImage(originalCanvas, 0, 0, canvas.width, canvas.height);
|
|
4707
|
-
}
|
|
4614
|
+
var width = canvas.width,
|
|
4615
|
+
height = canvas.height;
|
|
4708
4616
|
var imageUrl = canvas.toDataURL('image/jpeg', 0.95);
|
|
4709
4617
|
dispatch({
|
|
4710
4618
|
type: 'frameCaptured',
|
|
@@ -4728,18 +4636,17 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4728
4636
|
type: 'captured'
|
|
4729
4637
|
});
|
|
4730
4638
|
}, 0);
|
|
4731
|
-
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.
|
|
4639
|
+
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.captureStartedAt, state.requestedDocumentType]);
|
|
4732
4640
|
assets.portraitGuidesImageUrl || (assets.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
4733
4641
|
assets.landscapeGuidesImageUrl || (assets.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
4734
4642
|
var theme = useTheme();
|
|
4735
|
-
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (
|
|
4736
|
-
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (
|
|
4643
|
+
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');
|
|
4644
|
+
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');
|
|
4737
4645
|
var verbiage = useTranslations(rawVerbiage, {
|
|
4738
4646
|
instructionText: 'Scan the front of ID',
|
|
4739
4647
|
processingIdCardText: 'ID card front captured.',
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
4648
|
+
guidanceSatisfiedText: "".concat(documentTypeDisplayNames[state.detectedDocumentType], " detected, hold still..."),
|
|
4649
|
+
guidancePleaseFlipText: 'ID card front detected - please flip your ID card',
|
|
4743
4650
|
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
4744
4651
|
guidanceNotCenteredText: 'Document is not centered',
|
|
4745
4652
|
guidanceTooCloseText: 'Document too close, please back up',
|
|
@@ -4754,10 +4661,10 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4754
4661
|
});
|
|
4755
4662
|
var satisfied = state.isGoodFrame;
|
|
4756
4663
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
4757
|
-
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.
|
|
4664
|
+
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 : '');
|
|
4758
4665
|
return /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
4759
4666
|
ref: ref,
|
|
4760
|
-
className: "flex ".concat((
|
|
4667
|
+
className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
|
|
4761
4668
|
}, guidanceMessage !== '' && ( /*#__PURE__*/React__default.createElement(GuidanceMessageContainer, {
|
|
4762
4669
|
"$top": "",
|
|
4763
4670
|
"$bottom": "12.5dvh",
|
|
@@ -4766,7 +4673,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4766
4673
|
"$variant": satisfied ? 'positive' : 'default',
|
|
4767
4674
|
className: classNames.guidanceMessage
|
|
4768
4675
|
}, guidanceMessage))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugBoundingBoxOverlay, {
|
|
4769
|
-
"$flipX": !((
|
|
4676
|
+
"$flipX": !((_j = cameraRef.current) === null || _j === void 0 ? void 0 : _j.isRearFacing),
|
|
4770
4677
|
scaling: debugScalingDetails
|
|
4771
4678
|
}, state.detectedObjects.map(function (obj, i) {
|
|
4772
4679
|
var _a;
|
|
@@ -4776,7 +4683,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
4776
4683
|
scaling: debugScalingDetails,
|
|
4777
4684
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
4778
4685
|
});
|
|
4779
|
-
}))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__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.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.
|
|
4686
|
+
}))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__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.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u274C Models not ready")))));
|
|
4780
4687
|
};
|
|
4781
4688
|
var timeSince = function timeSince(t) {
|
|
4782
4689
|
if (!t) return 0;
|
|
@@ -5710,11 +5617,7 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
|
|
|
5710
5617
|
setUrl(cropToDetectedObjectBox(imgRef.current, bbox).toDataURL('image/jpeg', 0.95));
|
|
5711
5618
|
}, 100);
|
|
5712
5619
|
}
|
|
5713
|
-
return /*#__PURE__*/React__default.createElement("
|
|
5714
|
-
style: {
|
|
5715
|
-
position: 'relative'
|
|
5716
|
-
}
|
|
5717
|
-
}, /*#__PURE__*/React__default.createElement("img", {
|
|
5620
|
+
return /*#__PURE__*/React__default.createElement("img", {
|
|
5718
5621
|
ref: imgRef,
|
|
5719
5622
|
alt: alt,
|
|
5720
5623
|
className: className,
|
|
@@ -5734,13 +5637,12 @@ var CapturedDocumentImg = function CapturedDocumentImg(_a) {
|
|
|
5734
5637
|
(_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(link);
|
|
5735
5638
|
});
|
|
5736
5639
|
}
|
|
5737
|
-
})
|
|
5640
|
+
});
|
|
5738
5641
|
};
|
|
5739
5642
|
|
|
5740
5643
|
var OverlayInstruction = styled.p(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n font-size: 18px;\n margin: 30px 0;\n"], ["\n font-size: 18px;\n margin: 30px 0;\n"])));
|
|
5741
5644
|
var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
5742
5645
|
var capturedDocuments = _a.capturedDocuments,
|
|
5743
|
-
// barcodeResult,
|
|
5744
5646
|
onSubmitClick = _a.onSubmitClick,
|
|
5745
5647
|
onRetryClick = _a.onRetryClick,
|
|
5746
5648
|
_b = _a.classNames,
|
|
@@ -5748,7 +5650,9 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5748
5650
|
_c = _a.colors,
|
|
5749
5651
|
colors = _c === void 0 ? {} : _c,
|
|
5750
5652
|
_d = _a.verbiage,
|
|
5751
|
-
rawVerbiage = _d === void 0 ? {} : _d
|
|
5653
|
+
rawVerbiage = _d === void 0 ? {} : _d,
|
|
5654
|
+
_e = _a.debugMode,
|
|
5655
|
+
debugMode = _e === void 0 ? false : _e;
|
|
5752
5656
|
var submissionStatus = useContext(SubmissionContext).submissionStatus;
|
|
5753
5657
|
var idCardFront = capturedDocuments.idCardFront,
|
|
5754
5658
|
idCardBack = capturedDocuments.idCardBack,
|
|
@@ -5783,7 +5687,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5783
5687
|
image: idCardFront,
|
|
5784
5688
|
className: classNames.image,
|
|
5785
5689
|
alt: verbiage.idCardFrontText
|
|
5786
|
-
})))), idCardBack && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
|
|
5690
|
+
})), debugMode && ( /*#__PURE__*/React__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.createElement(ImageCol$1, {
|
|
5787
5691
|
className: classNames.imageCol
|
|
5788
5692
|
}, /*#__PURE__*/React__default.createElement(ImageHeading, {
|
|
5789
5693
|
className: classNames.imageHeading
|
|
@@ -5793,7 +5697,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5793
5697
|
image: idCardBack,
|
|
5794
5698
|
className: classNames.image,
|
|
5795
5699
|
alt: verbiage.idCardBackText
|
|
5796
|
-
})))), passport && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
|
|
5700
|
+
})), debugMode && ( /*#__PURE__*/React__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.createElement(ImageCol$1, {
|
|
5797
5701
|
className: classNames.imageCol
|
|
5798
5702
|
}, /*#__PURE__*/React__default.createElement(ImageHeading, {
|
|
5799
5703
|
className: classNames.imageHeading
|
|
@@ -5803,7 +5707,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
5803
5707
|
image: passport,
|
|
5804
5708
|
className: classNames.image,
|
|
5805
5709
|
alt: verbiage.passportText
|
|
5806
|
-
})))))), /*#__PURE__*/React__default.createElement(OverlayInstruction, {
|
|
5710
|
+
})), debugMode && ( /*#__PURE__*/React__default.createElement("pre", null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__default.createElement(OverlayInstruction, {
|
|
5807
5711
|
className: classNames.instruction
|
|
5808
5712
|
}, verbiage.instructionText), /*#__PURE__*/React__default.createElement(ButtonsRow, {
|
|
5809
5713
|
className: classNames.buttonsRow
|
|
@@ -6405,13 +6309,8 @@ function IdCaptureGuides(_a) {
|
|
|
6405
6309
|
var cameraRef = useContext(CameraStateContext).cameraRef;
|
|
6406
6310
|
var verbiage = useTranslations(rawVerbiage, {
|
|
6407
6311
|
instructionText: 'Scan the front of ID',
|
|
6408
|
-
processingIdCardText: 'ID card front captured.',
|
|
6409
6312
|
capturingText: 'Capturing...',
|
|
6410
|
-
captureFailedText: 'Capture failed!'
|
|
6411
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
6412
|
-
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
6413
|
-
guidanceNotCenteredText: 'Document is not centered',
|
|
6414
|
-
guidanceNotDetectedText: 'Document not detected'
|
|
6313
|
+
captureFailedText: 'Capture failed!'
|
|
6415
6314
|
});
|
|
6416
6315
|
var isMobile = window.innerWidth < window.innerHeight;
|
|
6417
6316
|
var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
|
|
@@ -6425,7 +6324,7 @@ function IdCaptureGuides(_a) {
|
|
|
6425
6324
|
landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
|
|
6426
6325
|
isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
|
|
6427
6326
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
6428
|
-
imageVisible: requestingFlip || !state.
|
|
6327
|
+
imageVisible: requestingFlip || !state.idCardFrontDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
|
|
6429
6328
|
})), guideType === 'fit' && ( /*#__PURE__*/React__default.createElement(IdCaptureFitGuide, {
|
|
6430
6329
|
classNames: classNames,
|
|
6431
6330
|
requestingFlip: requestingFlip,
|
|
@@ -6435,7 +6334,7 @@ function IdCaptureGuides(_a) {
|
|
|
6435
6334
|
backImageUrl: backImageUrl,
|
|
6436
6335
|
isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
|
|
6437
6336
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
6438
|
-
imageVisible: requestingFlip || !state.
|
|
6337
|
+
imageVisible: requestingFlip || !state.detectionThresholdMet || !state.documentInBounds || state.documentTooClose || state.flipRequired
|
|
6439
6338
|
})));
|
|
6440
6339
|
}
|
|
6441
6340
|
|
|
@@ -7330,78 +7229,66 @@ var StyledButtonsRow$8 = styled(ButtonsRow)(templateObject_6$3 || (templateObjec
|
|
|
7330
7229
|
var templateObject_1$l, templateObject_2$f, templateObject_3$d, templateObject_4$8, templateObject_5$4, templateObject_6$3;
|
|
7331
7230
|
|
|
7332
7231
|
var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
7333
|
-
var _b, _c, _d, _e, _f, _g
|
|
7334
|
-
var _k, _l, _m, _o, _p, _q, _r, _s
|
|
7232
|
+
var _b, _c, _d, _e, _f, _g;
|
|
7233
|
+
var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
7335
7234
|
var onSuccess = _a.onSuccess,
|
|
7336
7235
|
onExitCapture = _a.onExitCapture,
|
|
7337
7236
|
onUserCancel = _a.onUserCancel,
|
|
7338
|
-
|
|
7339
|
-
loadingOverlayMode =
|
|
7237
|
+
_t = _a.loadingOverlayMode,
|
|
7238
|
+
loadingOverlayMode = _t === void 0 ? 'default' : _t,
|
|
7340
7239
|
precapturedDocuments = _a.precapturedDocuments,
|
|
7341
|
-
|
|
7342
|
-
captureRequirement =
|
|
7343
|
-
|
|
7344
|
-
separateIdCardCaptureSequence =
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
_0 = _a.barcodeScanningEnabled,
|
|
7350
|
-
barcodeScanningEnabled = _0 === void 0 ? false : _0,
|
|
7351
|
-
_1 = _a.idCardAutoCaptureScoreThreshold,
|
|
7352
|
-
idCardAutoCaptureScoreThreshold = _1 === void 0 ? defaultDocumentDetectionThresholds.idCard : _1,
|
|
7353
|
-
_2 = _a.passportAutoCaptureScoreThreshold,
|
|
7354
|
-
passportAutoCaptureScoreThreshold = _2 === void 0 ? defaultDocumentDetectionThresholds.passport : _2,
|
|
7355
|
-
_3 = _a.mrzDetectionScoreThreshold,
|
|
7356
|
-
mrzDetectionScoreThreshold = _3 === void 0 ? defaultDocumentDetectionThresholds.mrz : _3,
|
|
7357
|
-
_4 = _a.idCardFocusScoreThreshold,
|
|
7358
|
-
idCardFocusScoreThreshold = _4 === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _4,
|
|
7359
|
-
_5 = _a.passportFocusScoreThreshold,
|
|
7360
|
-
passportFocusScoreThreshold = _5 === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _5,
|
|
7361
|
-
_6 = _a.skipSuccessScreen,
|
|
7362
|
-
skipSuccessScreen = _6 === void 0 ? false : _6,
|
|
7240
|
+
_u = _a.captureRequirement,
|
|
7241
|
+
captureRequirement = _u === void 0 ? 'idCardOrPassport' : _u,
|
|
7242
|
+
_v = _a.separateIdCardCaptureSequence,
|
|
7243
|
+
separateIdCardCaptureSequence = _v === void 0 ? false : _v,
|
|
7244
|
+
_w = _a.thresholds,
|
|
7245
|
+
thresholds = _w === void 0 ? defaultIdCaptureThresholds : _w,
|
|
7246
|
+
_x = _a.skipSuccessScreen,
|
|
7247
|
+
skipSuccessScreen = _x === void 0 ? false : _x,
|
|
7363
7248
|
instructions = _a.instructions,
|
|
7364
|
-
|
|
7365
|
-
releaseCameraAccessOnExit =
|
|
7366
|
-
|
|
7367
|
-
guideType =
|
|
7368
|
-
|
|
7369
|
-
portraitGuidesOnMobile =
|
|
7370
|
-
|
|
7371
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
7372
|
-
|
|
7373
|
-
silentFallback =
|
|
7374
|
-
|
|
7375
|
-
assets =
|
|
7376
|
-
|
|
7377
|
-
classNames =
|
|
7378
|
-
|
|
7379
|
-
colors =
|
|
7380
|
-
|
|
7381
|
-
verbiage =
|
|
7382
|
-
|
|
7383
|
-
debugMode =
|
|
7384
|
-
var
|
|
7385
|
-
state =
|
|
7386
|
-
dispatch =
|
|
7387
|
-
var
|
|
7388
|
-
cameraAccessDenied =
|
|
7389
|
-
releaseCameraAccess =
|
|
7390
|
-
var
|
|
7391
|
-
overlayDismissed =
|
|
7392
|
-
setOverlayDismissed =
|
|
7393
|
-
var
|
|
7394
|
-
submissionStatus =
|
|
7395
|
-
setIdFrontImage =
|
|
7396
|
-
setIdBackImage =
|
|
7397
|
-
setPassportImage =
|
|
7398
|
-
logIdFrontCaptureAttempt =
|
|
7399
|
-
logIdBackCaptureAttempt =
|
|
7400
|
-
var
|
|
7401
|
-
start =
|
|
7402
|
-
stop =
|
|
7403
|
-
|
|
7404
|
-
|
|
7249
|
+
_y = _a.releaseCameraAccessOnExit,
|
|
7250
|
+
releaseCameraAccessOnExit = _y === void 0 ? true : _y,
|
|
7251
|
+
_z = _a.guideType,
|
|
7252
|
+
guideType = _z === void 0 ? 'fit' : _z,
|
|
7253
|
+
_0 = _a.portraitGuidesOnMobile,
|
|
7254
|
+
portraitGuidesOnMobile = _0 === void 0 ? false : _0,
|
|
7255
|
+
_1 = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
7256
|
+
rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
|
|
7257
|
+
_2 = _a.silentFallback,
|
|
7258
|
+
silentFallback = _2 === void 0 ? false : _2,
|
|
7259
|
+
_3 = _a.assets,
|
|
7260
|
+
assets = _3 === void 0 ? {} : _3,
|
|
7261
|
+
_4 = _a.classNames,
|
|
7262
|
+
classNames = _4 === void 0 ? {} : _4,
|
|
7263
|
+
_5 = _a.colors,
|
|
7264
|
+
colors = _5 === void 0 ? {} : _5,
|
|
7265
|
+
_6 = _a.verbiage,
|
|
7266
|
+
verbiage = _6 === void 0 ? {} : _6,
|
|
7267
|
+
_7 = _a.debugMode,
|
|
7268
|
+
debugMode = _7 === void 0 ? false : _7;
|
|
7269
|
+
var _8 = useIdCaptureState(),
|
|
7270
|
+
state = _8[0],
|
|
7271
|
+
dispatch = _8[1];
|
|
7272
|
+
var _9 = useContext(CameraStateContext),
|
|
7273
|
+
cameraAccessDenied = _9.cameraAccessDenied,
|
|
7274
|
+
releaseCameraAccess = _9.releaseCameraAccess;
|
|
7275
|
+
var _10 = useState(false),
|
|
7276
|
+
overlayDismissed = _10[0],
|
|
7277
|
+
setOverlayDismissed = _10[1];
|
|
7278
|
+
var _11 = useContext(SubmissionContext),
|
|
7279
|
+
submissionStatus = _11.submissionStatus,
|
|
7280
|
+
setIdFrontImage = _11.setIdFrontImage,
|
|
7281
|
+
setIdBackImage = _11.setIdBackImage,
|
|
7282
|
+
setPassportImage = _11.setPassportImage,
|
|
7283
|
+
logIdFrontCaptureAttempt = _11.logIdFrontCaptureAttempt,
|
|
7284
|
+
logIdBackCaptureAttempt = _11.logIdBackCaptureAttempt;
|
|
7285
|
+
var _12 = useContext(IdCaptureModelsContext),
|
|
7286
|
+
start = _12.start,
|
|
7287
|
+
stop = _12.stop,
|
|
7288
|
+
onPredictionMade = _12.onPredictionMade,
|
|
7289
|
+
setRequiredDocumentType = _12.setRequiredDocumentType,
|
|
7290
|
+
modelError = _12.modelError,
|
|
7291
|
+
resetBestFrame = _12.resetBestFrame;
|
|
7405
7292
|
useEffect(function () {
|
|
7406
7293
|
dispatch({
|
|
7407
7294
|
type: 'configureWizard',
|
|
@@ -7426,16 +7313,29 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7426
7313
|
type: 'captureStarted'
|
|
7427
7314
|
});
|
|
7428
7315
|
start();
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7316
|
+
}, [dispatch, overlayDismissed, start, state.captureState]);
|
|
7317
|
+
useEffect(function () {
|
|
7318
|
+
onPredictionMade(function (prediction) {
|
|
7319
|
+
if (state.captureState === 'capturing') {
|
|
7320
|
+
dispatch({
|
|
7321
|
+
type: 'objectsDetected',
|
|
7322
|
+
payload: {
|
|
7323
|
+
prediction: prediction
|
|
7324
|
+
}
|
|
7325
|
+
});
|
|
7326
|
+
} else if (state.captureState === 'requestingFlip') {
|
|
7327
|
+
if (prediction.idCardBackDetectionThresholdMet) {
|
|
7328
|
+
resetBestFrame();
|
|
7329
|
+
dispatch({
|
|
7330
|
+
type: 'flipRequestCompleted'
|
|
7331
|
+
});
|
|
7332
|
+
}
|
|
7333
|
+
}
|
|
7437
7334
|
});
|
|
7438
|
-
}, [dispatch]);
|
|
7335
|
+
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
|
|
7336
|
+
useEffect(function () {
|
|
7337
|
+
if (state.captureState === 'complete') stop();
|
|
7338
|
+
}, [state.captureState, stop]);
|
|
7439
7339
|
var onCapture = useCallback(function (imageData, width, height, documentType, metadata) {
|
|
7440
7340
|
logCaptureMetadata(metadata);
|
|
7441
7341
|
dispatch({
|
|
@@ -7445,7 +7345,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7445
7345
|
width: width,
|
|
7446
7346
|
height: height,
|
|
7447
7347
|
documentType: documentType,
|
|
7448
|
-
boundingBox: metadata.boundingBox
|
|
7348
|
+
boundingBox: metadata.boundingBox,
|
|
7349
|
+
detectionScore: metadata.bestDetectionScore,
|
|
7350
|
+
focusScore: metadata.bestFocusScore
|
|
7449
7351
|
}
|
|
7450
7352
|
});
|
|
7451
7353
|
}, [dispatch, logCaptureMetadata]);
|
|
@@ -7475,9 +7377,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7475
7377
|
type: 'resetWizard'
|
|
7476
7378
|
});
|
|
7477
7379
|
}, [dispatch]);
|
|
7478
|
-
var
|
|
7479
|
-
attempt =
|
|
7480
|
-
setAttempt =
|
|
7380
|
+
var _13 = useState(0),
|
|
7381
|
+
attempt = _13[0],
|
|
7382
|
+
setAttempt = _13[1];
|
|
7481
7383
|
var onExit = useCallback(function () {
|
|
7482
7384
|
setOverlayDismissed(false);
|
|
7483
7385
|
setAttempt(function (n) {
|
|
@@ -7502,19 +7404,19 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7502
7404
|
}
|
|
7503
7405
|
}, [cameraAccessDenied]);
|
|
7504
7406
|
assets.idCardFront || (assets.idCardFront = {});
|
|
7505
|
-
(
|
|
7506
|
-
(
|
|
7407
|
+
(_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
7408
|
+
(_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
7507
7409
|
assets.idCardBack || (assets.idCardBack = {});
|
|
7508
|
-
(
|
|
7509
|
-
(
|
|
7410
|
+
(_k = assets.idCardBack).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
|
|
7411
|
+
(_l = assets.idCardBack).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
7510
7412
|
assets.passport || (assets.passport = {});
|
|
7511
|
-
(
|
|
7512
|
-
(
|
|
7413
|
+
(_m = assets.passport).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
|
|
7414
|
+
(_o = assets.passport).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
|
|
7513
7415
|
assets.flipIdPrompt || (assets.flipIdPrompt = {});
|
|
7514
|
-
(
|
|
7515
|
-
(
|
|
7516
|
-
(
|
|
7517
|
-
(
|
|
7416
|
+
(_p = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_p.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
|
|
7417
|
+
(_q = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_q.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
|
|
7418
|
+
(_r = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_r.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
|
|
7419
|
+
(_s = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_s.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
|
|
7518
7420
|
var idCaptureVerbiages = {
|
|
7519
7421
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
7520
7422
|
instructionText: 'Scan the front of ID',
|
|
@@ -7528,24 +7430,35 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7528
7430
|
})
|
|
7529
7431
|
};
|
|
7530
7432
|
var theme = useTheme();
|
|
7531
|
-
var
|
|
7532
|
-
guideRectX =
|
|
7533
|
-
guideRectY =
|
|
7534
|
-
guideRectWidth =
|
|
7535
|
-
guideRectHeight =
|
|
7536
|
-
imageUrl =
|
|
7433
|
+
var _14 = useIdCaptureState()[0],
|
|
7434
|
+
guideRectX = _14.guideRectX,
|
|
7435
|
+
guideRectY = _14.guideRectY,
|
|
7436
|
+
guideRectWidth = _14.guideRectWidth,
|
|
7437
|
+
guideRectHeight = _14.guideRectHeight,
|
|
7438
|
+
imageUrl = _14.imageUrl;
|
|
7537
7439
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
7538
7440
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
7539
7441
|
useEffect(function () {
|
|
7540
7442
|
if (separateIdCardCaptureSequence) return;
|
|
7541
|
-
if (state.captureState
|
|
7542
|
-
|
|
7543
|
-
|
|
7544
|
-
|
|
7545
|
-
|
|
7546
|
-
}
|
|
7443
|
+
if (state.captureState !== 'requestingFlip') return;
|
|
7444
|
+
var t = setTimeout(function () {
|
|
7445
|
+
resetBestFrame();
|
|
7446
|
+
dispatch({
|
|
7447
|
+
type: 'flipRequestCompleted'
|
|
7448
|
+
});
|
|
7449
|
+
}, 6000);
|
|
7450
|
+
return function () {
|
|
7451
|
+
clearTimeout(t);
|
|
7452
|
+
};
|
|
7453
|
+
}, [dispatch, resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
|
|
7454
|
+
useEffect(function () {
|
|
7455
|
+
if (state.requestedDocumentType === 'idCardBack') {
|
|
7456
|
+
setRequiredDocumentType('idCardBack');
|
|
7547
7457
|
}
|
|
7548
|
-
|
|
7458
|
+
return function () {
|
|
7459
|
+
setRequiredDocumentType('none');
|
|
7460
|
+
};
|
|
7461
|
+
}, [setRequiredDocumentType, state.requestedDocumentType]);
|
|
7549
7462
|
var handleCapture = useCallback(function (imageData) {
|
|
7550
7463
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
7551
7464
|
var base64ImageData;
|
|
@@ -7579,7 +7492,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7579
7492
|
});
|
|
7580
7493
|
}
|
|
7581
7494
|
return /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
7582
|
-
className: "flex ".concat((
|
|
7495
|
+
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
7583
7496
|
}, state.captureState !== 'complete' && ( /*#__PURE__*/React__default.createElement(CameraFeedWrapper, {
|
|
7584
7497
|
"$x": guideRectX,
|
|
7585
7498
|
"$y": guideRectY,
|
|
@@ -7590,15 +7503,7 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7590
7503
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
|
|
7591
7504
|
}))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__default.createElement(IdCapture, {
|
|
7592
7505
|
requiredDocumentType: state.requestedDocumentType,
|
|
7593
|
-
|
|
7594
|
-
idCardDetectionThreshold: idCardAutoCaptureScoreThreshold,
|
|
7595
|
-
passportDetectionThreshold: passportAutoCaptureScoreThreshold,
|
|
7596
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
7597
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
7598
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
7599
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
7600
|
-
barcodeScanningEnabled: barcodeScanningEnabled && state.requestedDocumentType === 'idCardBack',
|
|
7601
|
-
onPrediction: onPrediction,
|
|
7506
|
+
thresholds: thresholds,
|
|
7602
7507
|
onCapture: onCapture,
|
|
7603
7508
|
assets: idCaptureAssets,
|
|
7604
7509
|
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.capture,
|
|
@@ -7614,15 +7519,15 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7614
7519
|
assets: idCaptureAssets,
|
|
7615
7520
|
colors: colors,
|
|
7616
7521
|
verbiage: idCaptureVerbiage
|
|
7617
|
-
}), !((
|
|
7618
|
-
classNames: (
|
|
7619
|
-
text: (
|
|
7522
|
+
}), !((_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.createElement(IdCaptureImagePreview, {
|
|
7523
|
+
classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
|
|
7524
|
+
text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
|
|
7620
7525
|
imageUrl: imageUrl
|
|
7621
7526
|
})), state.captureState !== 'complete' && ( /*#__PURE__*/React__default.createElement("div", {
|
|
7622
7527
|
id: "idmission-above-guides-content"
|
|
7623
7528
|
})), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
|
|
7624
7529
|
onClick: onExit,
|
|
7625
|
-
className: (
|
|
7530
|
+
className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.exitCaptureBtn
|
|
7626
7531
|
}), !overlayDismissed && ( /*#__PURE__*/React__default.createElement(IdCaptureLoadingOverlay, {
|
|
7627
7532
|
key: attempt,
|
|
7628
7533
|
mode: loadingOverlayMode,
|
|
@@ -7649,12 +7554,12 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
7649
7554
|
verbiage: verbiage.success
|
|
7650
7555
|
})), state.captureState === 'complete' && showSuccessScreen && ( /*#__PURE__*/React__default.createElement(IdCaptureSuccess, {
|
|
7651
7556
|
capturedDocuments: state.capturedDocuments,
|
|
7652
|
-
barcodeResult: state.barcodeResult,
|
|
7653
7557
|
classNames: classNames.success,
|
|
7654
7558
|
onSubmitClick: onSubmitClick,
|
|
7655
7559
|
onRetryClick: onRetryClick,
|
|
7656
7560
|
colors: colors.success,
|
|
7657
|
-
verbiage: verbiage.success
|
|
7561
|
+
verbiage: verbiage.success,
|
|
7562
|
+
debugMode: debugMode
|
|
7658
7563
|
})));
|
|
7659
7564
|
};
|
|
7660
7565
|
|
|
@@ -9723,7 +9628,7 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream, mergeAVStr
|
|
|
9723
9628
|
var processAudio = useCallback(function () {
|
|
9724
9629
|
var _a;
|
|
9725
9630
|
var audioBlob = new Blob(audioChunks.current, {
|
|
9726
|
-
type: 'audio/
|
|
9631
|
+
type: 'audio/mp4'
|
|
9727
9632
|
});
|
|
9728
9633
|
audioChunks.current = [];
|
|
9729
9634
|
setAudioUrl(URL.createObjectURL(audioBlob));
|
|
@@ -10514,6 +10419,31 @@ var DoneButton = styled(LoaderButton)(templateObject_6 || (templateObject_6 = __
|
|
|
10514
10419
|
var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4$1, templateObject_5, templateObject_6;
|
|
10515
10420
|
|
|
10516
10421
|
var edgeBoundary = 0.05;
|
|
10422
|
+
var defaultVideoIdCaptureThresholds = {
|
|
10423
|
+
detection: {
|
|
10424
|
+
idCardFront: 0.6,
|
|
10425
|
+
idCardBack: 0.6,
|
|
10426
|
+
passport: 1
|
|
10427
|
+
},
|
|
10428
|
+
focus: {
|
|
10429
|
+
idCardFront: {
|
|
10430
|
+
desktop: 0,
|
|
10431
|
+
mobile: 0
|
|
10432
|
+
},
|
|
10433
|
+
idCardBack: {
|
|
10434
|
+
desktop: 0,
|
|
10435
|
+
mobile: 0
|
|
10436
|
+
},
|
|
10437
|
+
passport: {
|
|
10438
|
+
desktop: 0,
|
|
10439
|
+
mobile: 0
|
|
10440
|
+
}
|
|
10441
|
+
},
|
|
10442
|
+
goodFrames: {
|
|
10443
|
+
idCardFront: 1,
|
|
10444
|
+
idCardBack: 1
|
|
10445
|
+
}
|
|
10446
|
+
};
|
|
10517
10447
|
var IdVideoCapture = function IdVideoCapture(_a) {
|
|
10518
10448
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
10519
10449
|
var onComplete = _a.onComplete,
|
|
@@ -10525,96 +10455,85 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10525
10455
|
idCaptureModelsEnabled = _w === void 0 ? true : _w,
|
|
10526
10456
|
_x = _a.idCardFrontDelay,
|
|
10527
10457
|
idCardFrontDelay = _x === void 0 ? 1000 : _x,
|
|
10528
|
-
_y = _a.
|
|
10529
|
-
|
|
10530
|
-
_z = _a.
|
|
10531
|
-
|
|
10532
|
-
_0 = _a.
|
|
10533
|
-
|
|
10534
|
-
_1 = _a.idCardBackDetectionThreshold,
|
|
10535
|
-
idCardBackDetectionThreshold = _1 === void 0 ? 0.6 : _1,
|
|
10536
|
-
_2 = _a.idCardBackFocusThreshold,
|
|
10537
|
-
idCardBackFocusThreshold = _2 === void 0 ? 0 : _2,
|
|
10538
|
-
_3 = _a.goodIdCardBackFramesThreshold,
|
|
10539
|
-
goodIdCardBackFramesThreshold = _3 === void 0 ? 1 : _3,
|
|
10540
|
-
_4 = _a.skipShowIdCardBack,
|
|
10541
|
-
skipShowIdCardBack = _4 === void 0 ? false : _4,
|
|
10542
|
-
_5 = _a.captureCountdownSeconds,
|
|
10543
|
-
captureCountdownSeconds = _5 === void 0 ? 3 : _5,
|
|
10458
|
+
_y = _a.videoIdCaptureThresholds,
|
|
10459
|
+
videoIdCaptureThresholds = _y === void 0 ? defaultVideoIdCaptureThresholds : _y,
|
|
10460
|
+
_z = _a.skipShowIdCardBack,
|
|
10461
|
+
skipShowIdCardBack = _z === void 0 ? false : _z,
|
|
10462
|
+
_0 = _a.captureCountdownSeconds,
|
|
10463
|
+
captureCountdownSeconds = _0 === void 0 ? 3 : _0,
|
|
10544
10464
|
readTextPrompt = _a.readTextPrompt,
|
|
10545
|
-
|
|
10546
|
-
readTextTimeoutDurationMs =
|
|
10547
|
-
|
|
10548
|
-
readTextMinReadingMs =
|
|
10549
|
-
|
|
10550
|
-
disableFaceDetectionWhileAudioCapture =
|
|
10551
|
-
|
|
10552
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
10553
|
-
|
|
10554
|
-
mergeAVStreams =
|
|
10555
|
-
|
|
10556
|
-
assets =
|
|
10557
|
-
|
|
10558
|
-
classNames =
|
|
10559
|
-
|
|
10560
|
-
colors =
|
|
10561
|
-
|
|
10562
|
-
rawVerbiage =
|
|
10563
|
-
|
|
10564
|
-
debugMode =
|
|
10565
|
-
var
|
|
10566
|
-
ref =
|
|
10567
|
-
|
|
10568
|
-
width =
|
|
10569
|
-
|
|
10570
|
-
height =
|
|
10571
|
-
var
|
|
10572
|
-
cameraRef =
|
|
10573
|
-
videoRef =
|
|
10574
|
-
videoLoaded =
|
|
10575
|
-
cameraReady =
|
|
10576
|
-
microphoneReady =
|
|
10577
|
-
audioStream =
|
|
10578
|
-
setVideoLoaded =
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
audioUrl = _26.audioUrl;
|
|
10465
|
+
_1 = _a.readTextTimeoutDurationMs,
|
|
10466
|
+
readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
|
|
10467
|
+
_2 = _a.readTextMinReadingMs,
|
|
10468
|
+
readTextMinReadingMs = _2 === void 0 ? 10000 : _2,
|
|
10469
|
+
_3 = _a.disableFaceDetectionWhileAudioCapture,
|
|
10470
|
+
disableFaceDetectionWhileAudioCapture = _3 === void 0 ? false : _3,
|
|
10471
|
+
_4 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
10472
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _4 === void 0 ? 2000 : _4,
|
|
10473
|
+
_5 = _a.mergeAVStreams,
|
|
10474
|
+
mergeAVStreams = _5 === void 0 ? false : _5,
|
|
10475
|
+
_6 = _a.assets,
|
|
10476
|
+
assets = _6 === void 0 ? {} : _6,
|
|
10477
|
+
_7 = _a.classNames,
|
|
10478
|
+
classNames = _7 === void 0 ? {} : _7,
|
|
10479
|
+
_8 = _a.colors,
|
|
10480
|
+
colors = _8 === void 0 ? {} : _8,
|
|
10481
|
+
_9 = _a.verbiage,
|
|
10482
|
+
rawVerbiage = _9 === void 0 ? {} : _9,
|
|
10483
|
+
_10 = _a.debugMode,
|
|
10484
|
+
debugMode = _10 === void 0 ? false : _10;
|
|
10485
|
+
var _11 = useResizeObserver(),
|
|
10486
|
+
ref = _11.ref,
|
|
10487
|
+
_12 = _11.width,
|
|
10488
|
+
width = _12 === void 0 ? 1 : _12,
|
|
10489
|
+
_13 = _11.height,
|
|
10490
|
+
height = _13 === void 0 ? 1 : _13;
|
|
10491
|
+
var _14 = useContext(CameraStateContext),
|
|
10492
|
+
cameraRef = _14.cameraRef,
|
|
10493
|
+
videoRef = _14.videoRef,
|
|
10494
|
+
videoLoaded = _14.videoLoaded,
|
|
10495
|
+
cameraReady = _14.cameraReady,
|
|
10496
|
+
microphoneReady = _14.microphoneReady,
|
|
10497
|
+
audioStream = _14.audioStream,
|
|
10498
|
+
setVideoLoaded = _14.setVideoLoaded;
|
|
10499
|
+
var _15 = useState([]),
|
|
10500
|
+
detectedObjects = _15[0],
|
|
10501
|
+
setDetectedObjects = _15[1];
|
|
10502
|
+
var _16 = useState([]),
|
|
10503
|
+
faces = _16[0],
|
|
10504
|
+
setFaces = _16[1];
|
|
10505
|
+
var _17 = useContext(IdCaptureModelsContext),
|
|
10506
|
+
idModelsReady = _17.ready,
|
|
10507
|
+
startIdModels = _17.start,
|
|
10508
|
+
stopIdModels = _17.stop,
|
|
10509
|
+
onIdPredictionMade = _17.onPredictionMade,
|
|
10510
|
+
setThresholds = _17.setThresholds,
|
|
10511
|
+
bestFrameDetails = _17.bestFrameDetails,
|
|
10512
|
+
resetBestFrame = _17.resetBestFrame,
|
|
10513
|
+
idModelError = _17.modelError;
|
|
10514
|
+
var _18 = useState(null),
|
|
10515
|
+
videoStartsAt = _18[0],
|
|
10516
|
+
setVideoStartsAt = _18[1];
|
|
10517
|
+
var _19 = useContext(SubmissionContext),
|
|
10518
|
+
setIdCaptureVideoAudioStartsAt = _19.setIdCaptureVideoAudioStartsAt,
|
|
10519
|
+
setExpectedAudioText = _19.setExpectedAudioText;
|
|
10520
|
+
var _20 = useContext(SelfieGuidanceModelsContext),
|
|
10521
|
+
onSelfiePredictionMade = _20.onPredictionMade,
|
|
10522
|
+
selfieModelError = _20.error;
|
|
10523
|
+
var _21 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
|
|
10524
|
+
isRecordingVideo = _21.isRecordingVideo,
|
|
10525
|
+
startRecordingVideo = _21.startRecordingVideo,
|
|
10526
|
+
startRecordingAudio = _21.startRecordingAudio,
|
|
10527
|
+
stopRecordingVideo = _21.stopRecordingVideo,
|
|
10528
|
+
stopRecordingAudio = _21.stopRecordingAudio,
|
|
10529
|
+
videoRecordingUnintentionallyStopped = _21.videoRecordingUnintentionallyStopped,
|
|
10530
|
+
audioRecordingUnintentionallyStopped = _21.audioRecordingUnintentionallyStopped,
|
|
10531
|
+
videoUrl = _21.videoUrl,
|
|
10532
|
+
audioUrl = _21.audioUrl;
|
|
10614
10533
|
var countdownTimeoutRef = useRef(undefined);
|
|
10615
|
-
var
|
|
10616
|
-
countdownRemaining =
|
|
10617
|
-
setCountdownRemaining =
|
|
10534
|
+
var _22 = useState(-1),
|
|
10535
|
+
countdownRemaining = _22[0],
|
|
10536
|
+
setCountdownRemaining = _22[1];
|
|
10618
10537
|
useEffect(function () {
|
|
10619
10538
|
if (!isRecordingVideo && !videoUrl) {
|
|
10620
10539
|
startRecordingVideo();
|
|
@@ -10634,41 +10553,30 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10634
10553
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
10635
10554
|
}
|
|
10636
10555
|
}, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
|
|
10637
|
-
var
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
var _28 = useState('SHOW_ID_FRONT'),
|
|
10642
|
-
requestedAction = _28[0],
|
|
10643
|
-
setRequestedAction = _28[1];
|
|
10556
|
+
var _23 = useState('SHOW_ID_FRONT'),
|
|
10557
|
+
requestedAction = _23[0],
|
|
10558
|
+
setRequestedAction = _23[1];
|
|
10559
|
+
var shouldRunIdModels = idCaptureModelsEnabled && videoLoaded && cameraReady && idModelsReady && !idModelError && requestedAction !== 'READ_TEXT' && (!readTextPrompt || microphoneReady);
|
|
10644
10560
|
useEffect(function startModelsWhenCapturing() {
|
|
10645
|
-
if (!
|
|
10561
|
+
if (!shouldRunIdModels) return;
|
|
10646
10562
|
startIdModels();
|
|
10647
10563
|
return function () {
|
|
10648
10564
|
stopIdModels();
|
|
10649
10565
|
};
|
|
10650
|
-
}, [
|
|
10566
|
+
}, [shouldRunIdModels, startIdModels, stopIdModels]);
|
|
10651
10567
|
useEffect(function () {
|
|
10652
|
-
setThresholds(
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
setCurrentDetectionScore = _29[1];
|
|
10665
|
-
var _30 = useState(0),
|
|
10666
|
-
currentFocusScore = _30[0],
|
|
10667
|
-
setCurrentFocusScore = _30[1];
|
|
10668
|
-
var _31 = useState(0),
|
|
10669
|
-
goodFramesCount = _31[0],
|
|
10670
|
-
setGoodFramesCount = _31[1];
|
|
10671
|
-
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
10568
|
+
setThresholds(videoIdCaptureThresholds);
|
|
10569
|
+
}, [requestedAction, setThresholds, videoIdCaptureThresholds]);
|
|
10570
|
+
var _24 = useState(0),
|
|
10571
|
+
currentDetectionScore = _24[0],
|
|
10572
|
+
setCurrentDetectionScore = _24[1];
|
|
10573
|
+
var _25 = useState(0),
|
|
10574
|
+
currentFocusScore = _25[0],
|
|
10575
|
+
setCurrentFocusScore = _25[1];
|
|
10576
|
+
var _26 = useState(0),
|
|
10577
|
+
goodFramesCount = _26[0],
|
|
10578
|
+
setGoodFramesCount = _26[1];
|
|
10579
|
+
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
|
|
10672
10580
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10673
10581
|
useEffect(function () {
|
|
10674
10582
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
@@ -10676,18 +10584,19 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10676
10584
|
setDetectedObjects(prediction.detectedObjects);
|
|
10677
10585
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
10678
10586
|
setCurrentFocusScore(prediction.focusScore);
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
} else {
|
|
10684
|
-
setGoodFramesCount(0);
|
|
10587
|
+
var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
|
|
10588
|
+
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
10589
|
+
if (requestedAction === 'FLIP_ID' && isGoodFrame) {
|
|
10590
|
+
return setRequestedAction('SHOW_ID_BACK');
|
|
10685
10591
|
}
|
|
10592
|
+
setGoodFramesCount(isGoodFrame ? function (n) {
|
|
10593
|
+
return n + 1;
|
|
10594
|
+
} : 0);
|
|
10686
10595
|
});
|
|
10687
|
-
}, [idCaptureModelsEnabled,
|
|
10688
|
-
var
|
|
10689
|
-
idFrontCaptureStartedAt =
|
|
10690
|
-
setFirstGoodFrameTime =
|
|
10596
|
+
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
|
|
10597
|
+
var _27 = useState(null),
|
|
10598
|
+
idFrontCaptureStartedAt = _27[0],
|
|
10599
|
+
setFirstGoodFrameTime = _27[1];
|
|
10691
10600
|
useEffect(function () {
|
|
10692
10601
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
10693
10602
|
}, [goodFramesCount]);
|
|
@@ -10708,73 +10617,56 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10708
10617
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
10709
10618
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
10710
10619
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
10711
|
-
var
|
|
10712
|
-
countdownStartedAt =
|
|
10713
|
-
setCountdownStartedAt =
|
|
10620
|
+
var _28 = useState(),
|
|
10621
|
+
countdownStartedAt = _28[0],
|
|
10622
|
+
setCountdownStartedAt = _28[1];
|
|
10623
|
+
var photoCanvas = useRef(null);
|
|
10714
10624
|
var frameLock = useRef(false);
|
|
10715
10625
|
var captureFrame = useCallback(function () {
|
|
10716
10626
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
10717
|
-
var
|
|
10718
|
-
return __generator(this, function (
|
|
10719
|
-
switch (
|
|
10627
|
+
var frameBase64;
|
|
10628
|
+
return __generator(this, function (_a) {
|
|
10629
|
+
switch (_a.label) {
|
|
10720
10630
|
case 0:
|
|
10721
10631
|
if (frameLock.current) return [2 /*return*/];
|
|
10722
10632
|
frameLock.current = true;
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
if (!frame) {
|
|
10633
|
+
drawToCanvas(photoCanvas.current, videoRef.current);
|
|
10634
|
+
frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
|
|
10635
|
+
if (!frameBase64) {
|
|
10727
10636
|
frameLock.current = false;
|
|
10728
10637
|
return [2 /*return*/];
|
|
10729
10638
|
}
|
|
10730
|
-
|
|
10731
|
-
case
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
if (!_a) return [3 /*break*/, 4];
|
|
10735
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
10736
|
-
var reader = new FileReader();
|
|
10737
|
-
reader.onloadend = function () {
|
|
10738
|
-
return resolve(reader.result);
|
|
10739
|
-
};
|
|
10740
|
-
reader.readAsDataURL(frame);
|
|
10741
|
-
})];
|
|
10742
|
-
case 3:
|
|
10743
|
-
_a = _b.sent();
|
|
10744
|
-
_b.label = 4;
|
|
10745
|
-
case 4:
|
|
10746
|
-
frameBase64 = _a;
|
|
10747
|
-
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
|
|
10639
|
+
_a.label = 1;
|
|
10640
|
+
case 1:
|
|
10641
|
+
_a.trys.push([1,, 7, 8]);
|
|
10642
|
+
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
|
|
10748
10643
|
if (onIdFrontImageCaptured) {
|
|
10749
|
-
|
|
10644
|
+
onIdFrontImageCaptured(frameBase64);
|
|
10750
10645
|
}
|
|
10751
|
-
if (!skipShowIdCardBack) return [3 /*break*/,
|
|
10752
|
-
if (!(skipShowIdCardBack === true)) return [3 /*break*/,
|
|
10646
|
+
if (!skipShowIdCardBack) return [3 /*break*/, 4];
|
|
10647
|
+
if (!(skipShowIdCardBack === true)) return [3 /*break*/, 2];
|
|
10753
10648
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
10754
|
-
case
|
|
10649
|
+
case 2:
|
|
10755
10650
|
return [4 /*yield*/, skipShowIdCardBack()];
|
|
10756
|
-
case
|
|
10757
|
-
if (
|
|
10651
|
+
case 3:
|
|
10652
|
+
if (_a.sent()) {
|
|
10758
10653
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
10759
10654
|
}
|
|
10760
|
-
|
|
10761
|
-
case
|
|
10655
|
+
_a.label = 4;
|
|
10656
|
+
case 4:
|
|
10762
10657
|
setRequestedAction('FLIP_ID');
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
}, 6000);
|
|
10766
|
-
return [3 /*break*/, 9];
|
|
10767
|
-
case 8:
|
|
10658
|
+
return [3 /*break*/, 6];
|
|
10659
|
+
case 5:
|
|
10768
10660
|
if (requestedAction == 'SHOW_ID_BACK') {
|
|
10769
10661
|
if (onIdBackImageCaptured) {
|
|
10770
|
-
|
|
10662
|
+
onIdBackImageCaptured(frameBase64);
|
|
10771
10663
|
}
|
|
10772
10664
|
onIdBackCaptureComplete();
|
|
10773
10665
|
}
|
|
10774
|
-
|
|
10775
|
-
case
|
|
10776
|
-
return [3 /*break*/,
|
|
10777
|
-
case
|
|
10666
|
+
_a.label = 6;
|
|
10667
|
+
case 6:
|
|
10668
|
+
return [3 /*break*/, 8];
|
|
10669
|
+
case 7:
|
|
10778
10670
|
setDetectedObjects([]);
|
|
10779
10671
|
setCurrentDetectionScore(0);
|
|
10780
10672
|
setCurrentFocusScore(0);
|
|
@@ -10786,17 +10678,27 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10786
10678
|
clearTimeout(countdownTimeoutRef.current);
|
|
10787
10679
|
}
|
|
10788
10680
|
return [7 /*endfinally*/];
|
|
10789
|
-
case
|
|
10681
|
+
case 8:
|
|
10790
10682
|
return [2 /*return*/];
|
|
10791
10683
|
}
|
|
10792
10684
|
});
|
|
10793
10685
|
});
|
|
10794
|
-
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack,
|
|
10686
|
+
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
|
|
10687
|
+
var isFlipping = requestedAction === 'FLIP_ID';
|
|
10688
|
+
useEffect(function () {
|
|
10689
|
+
if (!isFlipping) return;
|
|
10690
|
+
var t = setTimeout(function () {
|
|
10691
|
+
setRequestedAction('SHOW_ID_BACK');
|
|
10692
|
+
}, 6000);
|
|
10693
|
+
return function () {
|
|
10694
|
+
clearTimeout(t);
|
|
10695
|
+
};
|
|
10696
|
+
}, [isFlipping]);
|
|
10795
10697
|
var stopRecording = useCallback(function () {
|
|
10796
10698
|
stopRecordingVideo();
|
|
10797
10699
|
stopRecordingAudio();
|
|
10798
10700
|
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
10799
|
-
var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
10701
|
+
var satisfied = !isFlipping && goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
10800
10702
|
useEffect(function () {
|
|
10801
10703
|
if (satisfied && !countdownStartedAt) {
|
|
10802
10704
|
setCountdownStartedAt(new Date());
|
|
@@ -10816,10 +10718,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10816
10718
|
}, 1000);
|
|
10817
10719
|
return;
|
|
10818
10720
|
}
|
|
10819
|
-
|
|
10820
|
-
captureFrame();
|
|
10821
|
-
}
|
|
10822
|
-
}, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
|
|
10721
|
+
}, [countdownTimeoutRef]);
|
|
10823
10722
|
useEffect(function () {
|
|
10824
10723
|
if (!countdownStartedAt) return;
|
|
10825
10724
|
setCountdownRemaining(captureCountdownSeconds);
|
|
@@ -10829,11 +10728,17 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10829
10728
|
return function () {
|
|
10830
10729
|
clearTimeout(countdownTimeoutRef.current);
|
|
10831
10730
|
};
|
|
10832
|
-
}, [captureCountdownSeconds,
|
|
10731
|
+
}, [captureCountdownSeconds, countdownStartedAt, manualCountdown]);
|
|
10732
|
+
useEffect(function () {
|
|
10733
|
+
if (countdownRemaining === 0) {
|
|
10734
|
+
setCountdownRemaining(-1);
|
|
10735
|
+
captureFrame().then();
|
|
10736
|
+
}
|
|
10737
|
+
}, [captureFrame, countdownRemaining]);
|
|
10833
10738
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
10834
|
-
var
|
|
10835
|
-
numFramesWithoutFaces =
|
|
10836
|
-
setNumFramesWithoutFaces =
|
|
10739
|
+
var _29 = useState(0),
|
|
10740
|
+
numFramesWithoutFaces = _29[0],
|
|
10741
|
+
setNumFramesWithoutFaces = _29[1];
|
|
10837
10742
|
useEffect(function () {
|
|
10838
10743
|
if (!selfieModelError) {
|
|
10839
10744
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -10851,14 +10756,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10851
10756
|
}
|
|
10852
10757
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
10853
10758
|
var theme = useTheme();
|
|
10854
|
-
var
|
|
10759
|
+
var _30 = useTranslations(rawVerbiage, {
|
|
10855
10760
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
10856
10761
|
searchingForIdCardText: 'Searching for ID card...',
|
|
10857
10762
|
captureBtnText: 'Capture'
|
|
10858
10763
|
}),
|
|
10859
|
-
captureBtnText =
|
|
10860
|
-
faceNotCenteredText =
|
|
10861
|
-
searchingForIdCardText =
|
|
10764
|
+
captureBtnText = _30.captureBtnText,
|
|
10765
|
+
faceNotCenteredText = _30.faceNotCenteredText,
|
|
10766
|
+
searchingForIdCardText = _30.searchingForIdCardText;
|
|
10862
10767
|
var debugScalingDetails = useDebugScalingDetails({
|
|
10863
10768
|
enabled: debugMode,
|
|
10864
10769
|
pageWidth: width,
|
|
@@ -10872,7 +10777,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10872
10777
|
return /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
10873
10778
|
ref: ref,
|
|
10874
10779
|
className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
|
|
10875
|
-
},
|
|
10780
|
+
}, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
10781
|
+
ref: photoCanvas
|
|
10782
|
+
}), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default.createElement(ReadTextPrompt, {
|
|
10876
10783
|
text: readTextPrompt,
|
|
10877
10784
|
startedAt: timeoutStartedAt || undefined,
|
|
10878
10785
|
durationMs: readTextTimeoutDurationMs,
|
|
@@ -10911,7 +10818,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10911
10818
|
className: classNames.guidanceMessage,
|
|
10912
10819
|
"$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',
|
|
10913
10820
|
"$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'
|
|
10914
|
-
}, guidanceText))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__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.createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)),
|
|
10821
|
+
}, guidanceText))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default.createElement("br", null), isRecordingVideo ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default.createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default.createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default.createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__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.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.createElement(CountdownContainer, {
|
|
10915
10822
|
className: classNames.countdownContainer
|
|
10916
10823
|
}, /*#__PURE__*/React__default.createElement(Countdown, {
|
|
10917
10824
|
className: classNames.countdown
|
|
@@ -11066,64 +10973,60 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11066
10973
|
faceLivenessProps = _h === void 0 ? {} : _h,
|
|
11067
10974
|
_j = _a.idCaptureModelsEnabled,
|
|
11068
10975
|
idCaptureModelsEnabled = _j === void 0 ? true : _j,
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
|
|
11072
|
-
idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
|
|
11073
|
-
goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
|
|
11074
|
-
goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
|
|
10976
|
+
_k = _a.videoIdCaptureThresholds,
|
|
10977
|
+
videoIdCaptureThresholds = _k === void 0 ? defaultVideoIdCaptureThresholds : _k,
|
|
11075
10978
|
readTextPrompt = _a.readTextPrompt,
|
|
11076
10979
|
readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
|
|
11077
10980
|
readTextMinReadingMs = _a.readTextMinReadingMs,
|
|
11078
|
-
|
|
11079
|
-
skipIdCapture =
|
|
11080
|
-
|
|
11081
|
-
skipShowIdCardBack =
|
|
11082
|
-
|
|
11083
|
-
skipSuccessScreen =
|
|
11084
|
-
|
|
11085
|
-
idCaptureLoadingOverlayMode =
|
|
11086
|
-
|
|
11087
|
-
idCaptureGuideType =
|
|
11088
|
-
|
|
11089
|
-
idCapturePortraitGuidesOnMobile =
|
|
11090
|
-
|
|
11091
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
11092
|
-
|
|
11093
|
-
idCaptureModelLoadTimeoutMs =
|
|
11094
|
-
|
|
11095
|
-
faceLivenessLoadingOverlayMode =
|
|
11096
|
-
|
|
11097
|
-
disableFaceDetectionWhileAudioCapture =
|
|
11098
|
-
|
|
11099
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
11100
|
-
|
|
11101
|
-
silentFallback =
|
|
11102
|
-
|
|
11103
|
-
mergeAVStreams =
|
|
11104
|
-
|
|
11105
|
-
assets =
|
|
11106
|
-
|
|
11107
|
-
classNames =
|
|
11108
|
-
|
|
11109
|
-
colors =
|
|
11110
|
-
|
|
11111
|
-
verbiage =
|
|
11112
|
-
|
|
11113
|
-
debugMode =
|
|
11114
|
-
var
|
|
11115
|
-
submissionStatus =
|
|
11116
|
-
idCaptureVideoUrl =
|
|
11117
|
-
idCaptureVideoAudioUrl =
|
|
11118
|
-
idCaptureVideoIdFrontImage =
|
|
11119
|
-
idCaptureVideoIdBackImage =
|
|
11120
|
-
setIdCaptureVideoUrl =
|
|
11121
|
-
setIdCaptureVideoIdFrontImage =
|
|
11122
|
-
setIdCaptureVideoIdBackImage =
|
|
11123
|
-
setIdCaptureVideoAudioUrl =
|
|
11124
|
-
var
|
|
11125
|
-
captureState =
|
|
11126
|
-
setCaptureState =
|
|
10981
|
+
_l = _a.skipIdCapture,
|
|
10982
|
+
skipIdCapture = _l === void 0 ? false : _l,
|
|
10983
|
+
_m = _a.skipShowIdCardBack,
|
|
10984
|
+
skipShowIdCardBack = _m === void 0 ? false : _m,
|
|
10985
|
+
_o = _a.skipSuccessScreen,
|
|
10986
|
+
skipSuccessScreen = _o === void 0 ? false : _o,
|
|
10987
|
+
_p = _a.idCaptureLoadingOverlayMode,
|
|
10988
|
+
idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
10989
|
+
_q = _a.idCaptureGuideType,
|
|
10990
|
+
idCaptureGuideType = _q === void 0 ? 'fit' : _q,
|
|
10991
|
+
_r = _a.idCapturePortraitGuidesOnMobile,
|
|
10992
|
+
idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
|
|
10993
|
+
_s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
10994
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
|
|
10995
|
+
_t = _a.idCaptureModelLoadTimeoutMs,
|
|
10996
|
+
idCaptureModelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
|
|
10997
|
+
_u = _a.faceLivenessLoadingOverlayMode,
|
|
10998
|
+
faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
|
|
10999
|
+
_v = _a.disableFaceDetectionWhileAudioCapture,
|
|
11000
|
+
disableFaceDetectionWhileAudioCapture = _v === void 0 ? true : _v,
|
|
11001
|
+
_w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
11002
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
11003
|
+
_x = _a.silentFallback,
|
|
11004
|
+
silentFallback = _x === void 0 ? false : _x,
|
|
11005
|
+
_y = _a.mergeAVStreams,
|
|
11006
|
+
mergeAVStreams = _y === void 0 ? false : _y,
|
|
11007
|
+
_z = _a.assets,
|
|
11008
|
+
assets = _z === void 0 ? {} : _z,
|
|
11009
|
+
_0 = _a.classNames,
|
|
11010
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
11011
|
+
_1 = _a.colors,
|
|
11012
|
+
colors = _1 === void 0 ? {} : _1,
|
|
11013
|
+
_2 = _a.verbiage,
|
|
11014
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
11015
|
+
_3 = _a.debugMode,
|
|
11016
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
11017
|
+
var _4 = useContext(SubmissionContext),
|
|
11018
|
+
submissionStatus = _4.submissionStatus,
|
|
11019
|
+
idCaptureVideoUrl = _4.idCaptureVideoUrl,
|
|
11020
|
+
idCaptureVideoAudioUrl = _4.idCaptureVideoAudioUrl,
|
|
11021
|
+
idCaptureVideoIdFrontImage = _4.idCaptureVideoIdFrontImage,
|
|
11022
|
+
idCaptureVideoIdBackImage = _4.idCaptureVideoIdBackImage,
|
|
11023
|
+
setIdCaptureVideoUrl = _4.setIdCaptureVideoUrl,
|
|
11024
|
+
setIdCaptureVideoIdFrontImage = _4.setIdCaptureVideoIdFrontImage,
|
|
11025
|
+
setIdCaptureVideoIdBackImage = _4.setIdCaptureVideoIdBackImage,
|
|
11026
|
+
setIdCaptureVideoAudioUrl = _4.setIdCaptureVideoAudioUrl;
|
|
11027
|
+
var _5 = useState('CAPTURING_ID'),
|
|
11028
|
+
captureState = _5[0],
|
|
11029
|
+
setCaptureState = _5[1];
|
|
11127
11030
|
useEffect(function () {
|
|
11128
11031
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
11129
11032
|
}, [captureState, skipIdCapture]);
|
|
@@ -11154,9 +11057,9 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11154
11057
|
var onVideoCaptureFaceNotDetected = useCallback(function () {
|
|
11155
11058
|
setCaptureState('CHECKING_LIVENESS');
|
|
11156
11059
|
}, []);
|
|
11157
|
-
var
|
|
11158
|
-
attempt =
|
|
11159
|
-
setAttempt =
|
|
11060
|
+
var _6 = useState(0),
|
|
11061
|
+
attempt = _6[0],
|
|
11062
|
+
setAttempt = _6[1];
|
|
11160
11063
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
11161
11064
|
var onFaceCaptureExitAfterFailure = useCallback(function (resp, req) {
|
|
11162
11065
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|
|
@@ -11260,12 +11163,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11260
11163
|
onFaceNotDetected: onVideoCaptureFaceNotDetected,
|
|
11261
11164
|
onRecordingFailed: onRecordingFailed,
|
|
11262
11165
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
11263
|
-
|
|
11264
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
11265
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
11266
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
11267
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
11268
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
11166
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
11269
11167
|
skipShowIdCardBack: skipShowIdCardBack,
|
|
11270
11168
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
11271
11169
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
@@ -11726,9 +11624,8 @@ var ThemeProvider = function ThemeProvider(_a) {
|
|
|
11726
11624
|
* Render a fullscreen ID capture component that instructs the user to photograph both sides of their ID card, or full page of their passport.
|
|
11727
11625
|
*/
|
|
11728
11626
|
var IdValidation = function IdValidation(_a) {
|
|
11729
|
-
var _b,
|
|
11730
|
-
|
|
11731
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
11627
|
+
var _b = _a.lang,
|
|
11628
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
11732
11629
|
sessionId = _a.sessionId,
|
|
11733
11630
|
clientRequestID = _a.clientRequestID,
|
|
11734
11631
|
submissionUrl = _a.submissionUrl,
|
|
@@ -11751,35 +11648,25 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11751
11648
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
11752
11649
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
11753
11650
|
precapturedDocuments = _a.precapturedDocuments,
|
|
11754
|
-
|
|
11755
|
-
loadingOverlayMode =
|
|
11756
|
-
|
|
11757
|
-
idCaptureRequirement =
|
|
11758
|
-
|
|
11759
|
-
separateIdCardCaptureSequence =
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
11763
|
-
|
|
11764
|
-
_k = _a.passportAutoCaptureScoreThreshold,
|
|
11765
|
-
passportAutoCaptureScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.passport : _k,
|
|
11766
|
-
_l = _a.mrzDetectionScoreThreshold,
|
|
11767
|
-
mrzDetectionScoreThreshold = _l === void 0 ? defaultDocumentDetectionThresholds.mrz : _l,
|
|
11768
|
-
_m = _a.idCardFocusScoreThreshold,
|
|
11769
|
-
idCardFocusScoreThreshold = _m === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _m,
|
|
11770
|
-
_o = _a.passportFocusScoreThreshold,
|
|
11771
|
-
passportFocusScoreThreshold = _o === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _o,
|
|
11772
|
-
_p = _a.skipSuccessScreen,
|
|
11773
|
-
skipSuccessScreen = _p === void 0 ? false : _p,
|
|
11651
|
+
_c = _a.loadingOverlayMode,
|
|
11652
|
+
loadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
11653
|
+
_d = _a.idCaptureRequirement,
|
|
11654
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
11655
|
+
_e = _a.separateIdCardCaptureSequence,
|
|
11656
|
+
separateIdCardCaptureSequence = _e === void 0 ? false : _e,
|
|
11657
|
+
_f = _a.idCaptureThresholds,
|
|
11658
|
+
idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
|
|
11659
|
+
_g = _a.skipSuccessScreen,
|
|
11660
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
11774
11661
|
instructions = _a.instructions,
|
|
11775
|
-
|
|
11776
|
-
guideType =
|
|
11777
|
-
|
|
11778
|
-
portraitGuidesOnMobile =
|
|
11779
|
-
|
|
11780
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
11781
|
-
|
|
11782
|
-
modelLoadTimeoutMs =
|
|
11662
|
+
_h = _a.guideType,
|
|
11663
|
+
guideType = _h === void 0 ? 'fit' : _h,
|
|
11664
|
+
_j = _a.portraitGuidesOnMobile,
|
|
11665
|
+
portraitGuidesOnMobile = _j === void 0 ? false : _j,
|
|
11666
|
+
_k = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
11667
|
+
rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
|
|
11668
|
+
_l = _a.modelLoadTimeoutMs,
|
|
11669
|
+
modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
|
|
11783
11670
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
11784
11671
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
11785
11672
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -11793,28 +11680,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11793
11680
|
onUserCancel = _a.onUserCancel,
|
|
11794
11681
|
onModelError = _a.onModelError,
|
|
11795
11682
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
11796
|
-
|
|
11797
|
-
theme =
|
|
11798
|
-
|
|
11799
|
-
assets =
|
|
11800
|
-
|
|
11801
|
-
classNames =
|
|
11802
|
-
|
|
11803
|
-
colors =
|
|
11804
|
-
|
|
11805
|
-
verbiage =
|
|
11806
|
-
|
|
11807
|
-
captureSignature =
|
|
11808
|
-
|
|
11809
|
-
captureSignatureVideo =
|
|
11810
|
-
|
|
11811
|
-
captureAdditionalDocuments =
|
|
11812
|
-
|
|
11813
|
-
geolocationEnabled =
|
|
11814
|
-
|
|
11815
|
-
geolocationRequired =
|
|
11816
|
-
|
|
11817
|
-
debugMode =
|
|
11683
|
+
_m = _a.theme,
|
|
11684
|
+
theme = _m === void 0 ? 'default' : _m,
|
|
11685
|
+
_o = _a.assets,
|
|
11686
|
+
assets = _o === void 0 ? {} : _o,
|
|
11687
|
+
_p = _a.classNames,
|
|
11688
|
+
classNames = _p === void 0 ? {} : _p,
|
|
11689
|
+
_q = _a.colors,
|
|
11690
|
+
colors = _q === void 0 ? {} : _q,
|
|
11691
|
+
_r = _a.verbiage,
|
|
11692
|
+
verbiage = _r === void 0 ? {} : _r,
|
|
11693
|
+
_s = _a.captureSignature,
|
|
11694
|
+
captureSignature = _s === void 0 ? false : _s,
|
|
11695
|
+
_t = _a.captureSignatureVideo,
|
|
11696
|
+
captureSignatureVideo = _t === void 0 ? false : _t,
|
|
11697
|
+
_u = _a.captureAdditionalDocuments,
|
|
11698
|
+
captureAdditionalDocuments = _u === void 0 ? [] : _u,
|
|
11699
|
+
_v = _a.geolocationEnabled,
|
|
11700
|
+
geolocationEnabled = _v === void 0 ? true : _v,
|
|
11701
|
+
_w = _a.geolocationRequired,
|
|
11702
|
+
geolocationRequired = _w === void 0 ? false : _w,
|
|
11703
|
+
_x = _a.debugMode,
|
|
11704
|
+
debugMode = _x === void 0 ? false : _x;
|
|
11818
11705
|
useLanguage(lang);
|
|
11819
11706
|
useDebugLogging(debugMode);
|
|
11820
11707
|
var idCaptureProps = useMemo(function () {
|
|
@@ -11825,13 +11712,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11825
11712
|
precapturedDocuments: precapturedDocuments,
|
|
11826
11713
|
captureRequirement: idCaptureRequirement,
|
|
11827
11714
|
separateIdCardCaptureSequence: separateIdCardCaptureSequence,
|
|
11828
|
-
|
|
11829
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
11830
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
11831
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
11832
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
11833
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
11834
|
-
barcodeScanningEnabled: false,
|
|
11715
|
+
thresholds: idCaptureThresholds,
|
|
11835
11716
|
skipSuccessScreen: skipSuccessScreen,
|
|
11836
11717
|
loadingOverlayMode: loadingOverlayMode,
|
|
11837
11718
|
instructions: instructions,
|
|
@@ -11845,7 +11726,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
11845
11726
|
verbiage: verbiage,
|
|
11846
11727
|
debugMode: debugMode
|
|
11847
11728
|
};
|
|
11848
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence,
|
|
11729
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
|
|
11849
11730
|
var additionalDocumentCaptureProps = useMemo(function () {
|
|
11850
11731
|
return {
|
|
11851
11732
|
documents: captureAdditionalDocuments,
|
|
@@ -12039,9 +11920,8 @@ var FaceValidation = function FaceValidation(_a) {
|
|
|
12039
11920
|
* Render a fullscreen capture component that performs `IDValidation` and `FaceValidation` sequentially.
|
|
12040
11921
|
* */
|
|
12041
11922
|
var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
12042
|
-
var _b,
|
|
12043
|
-
|
|
12044
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
11923
|
+
var _b = _a.lang,
|
|
11924
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
12045
11925
|
sessionId = _a.sessionId,
|
|
12046
11926
|
authUrl = _a.authUrl,
|
|
12047
11927
|
submissionUrl = _a.submissionUrl,
|
|
@@ -12063,39 +11943,29 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12063
11943
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
12064
11944
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
12065
11945
|
precapturedDocuments = _a.precapturedDocuments,
|
|
12066
|
-
|
|
12067
|
-
idCaptureLoadingOverlayMode =
|
|
12068
|
-
|
|
12069
|
-
idCaptureRequirement =
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
12079
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
12080
|
-
_m = _a.passportFocusScoreThreshold,
|
|
12081
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
12082
|
-
_o = _a.faceLivenessLoadingOverlayMode,
|
|
12083
|
-
faceLivenessLoadingOverlayMode = _o === void 0 ? 'default' : _o,
|
|
12084
|
-
_p = _a.faceLivenessTimeoutDurationMs,
|
|
12085
|
-
faceLivenessTimeoutDurationMs = _p === void 0 ? 15000 : _p,
|
|
12086
|
-
_q = _a.skipSuccessScreen,
|
|
12087
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
11946
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
11947
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
11948
|
+
_d = _a.idCaptureRequirement,
|
|
11949
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
11950
|
+
_e = _a.idCaptureThresholds,
|
|
11951
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
11952
|
+
_f = _a.faceLivenessLoadingOverlayMode,
|
|
11953
|
+
faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
|
|
11954
|
+
_g = _a.faceLivenessTimeoutDurationMs,
|
|
11955
|
+
faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
11956
|
+
_h = _a.skipSuccessScreen,
|
|
11957
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
12088
11958
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
12089
|
-
|
|
12090
|
-
idCaptureGuideType =
|
|
12091
|
-
|
|
12092
|
-
idCapturePortraitGuidesOnMobile =
|
|
12093
|
-
|
|
12094
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
12095
|
-
|
|
12096
|
-
idCaptureModelLoadTimeoutMs =
|
|
12097
|
-
|
|
12098
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
11959
|
+
_j = _a.idCaptureGuideType,
|
|
11960
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
11961
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
11962
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
11963
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
11964
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
11965
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
11966
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
11967
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
11968
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
12099
11969
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
12100
11970
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
12101
11971
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -12112,28 +11982,28 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12112
11982
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
12113
11983
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
12114
11984
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
12115
|
-
|
|
12116
|
-
captureSignature =
|
|
12117
|
-
|
|
12118
|
-
captureSignatureVideo =
|
|
12119
|
-
|
|
12120
|
-
captureAdditionalDocuments =
|
|
12121
|
-
|
|
12122
|
-
theme =
|
|
12123
|
-
|
|
12124
|
-
assets =
|
|
12125
|
-
|
|
12126
|
-
classNames =
|
|
12127
|
-
|
|
12128
|
-
colors =
|
|
12129
|
-
|
|
12130
|
-
verbiage =
|
|
12131
|
-
|
|
12132
|
-
geolocationEnabled =
|
|
12133
|
-
|
|
12134
|
-
geolocationRequired =
|
|
12135
|
-
|
|
12136
|
-
debugMode =
|
|
11985
|
+
_p = _a.captureSignature,
|
|
11986
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
11987
|
+
_q = _a.captureSignatureVideo,
|
|
11988
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
11989
|
+
_r = _a.captureAdditionalDocuments,
|
|
11990
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
11991
|
+
_s = _a.theme,
|
|
11992
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
11993
|
+
_t = _a.assets,
|
|
11994
|
+
assets = _t === void 0 ? {} : _t,
|
|
11995
|
+
_u = _a.classNames,
|
|
11996
|
+
classNames = _u === void 0 ? {} : _u,
|
|
11997
|
+
_v = _a.colors,
|
|
11998
|
+
colors = _v === void 0 ? {} : _v,
|
|
11999
|
+
_w = _a.verbiage,
|
|
12000
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
12001
|
+
_x = _a.geolocationEnabled,
|
|
12002
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
12003
|
+
_y = _a.geolocationRequired,
|
|
12004
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
12005
|
+
_z = _a.debugMode,
|
|
12006
|
+
debugMode = _z === void 0 ? false : _z;
|
|
12137
12007
|
useLanguage(lang);
|
|
12138
12008
|
useDebugLogging(debugMode);
|
|
12139
12009
|
var idCaptureProps = useMemo(function () {
|
|
@@ -12147,12 +12017,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12147
12017
|
verbiage: verbiage.idCapture,
|
|
12148
12018
|
precapturedDocuments: precapturedDocuments,
|
|
12149
12019
|
captureRequirement: idCaptureRequirement,
|
|
12150
|
-
|
|
12151
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
12152
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
12153
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
12154
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
12155
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
12020
|
+
thresholds: idCaptureThresholds,
|
|
12156
12021
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
12157
12022
|
instructions: idCaptureInstructions,
|
|
12158
12023
|
guideType: idCaptureGuideType,
|
|
@@ -12162,7 +12027,7 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12162
12027
|
skipSuccessScreen: skipSuccessScreen,
|
|
12163
12028
|
debugMode: debugMode
|
|
12164
12029
|
};
|
|
12165
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
12030
|
+
}, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, skipSuccessScreen, debugMode]);
|
|
12166
12031
|
var faceLivenessProps = useMemo(function () {
|
|
12167
12032
|
return {
|
|
12168
12033
|
loadingOverlayMode: faceLivenessLoadingOverlayMode,
|
|
@@ -12270,10 +12135,9 @@ var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
|
12270
12135
|
* 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.
|
|
12271
12136
|
*/
|
|
12272
12137
|
var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollment(_a) {
|
|
12273
|
-
var _b, _c;
|
|
12274
12138
|
var enrollmentId = _a.enrollmentId,
|
|
12275
|
-
|
|
12276
|
-
lang =
|
|
12139
|
+
_b = _a.lang,
|
|
12140
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
12277
12141
|
sessionId = _a.sessionId,
|
|
12278
12142
|
authUrl = _a.authUrl,
|
|
12279
12143
|
submissionUrl = _a.submissionUrl,
|
|
@@ -12297,39 +12161,29 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12297
12161
|
webhooksSendProcessedImages = _a.webhooksSendProcessedImages,
|
|
12298
12162
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
12299
12163
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
12300
|
-
|
|
12301
|
-
idCaptureLoadingOverlayMode =
|
|
12302
|
-
|
|
12303
|
-
idCaptureRequirement =
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
12313
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
12314
|
-
_m = _a.passportFocusScoreThreshold,
|
|
12315
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
12316
|
-
_o = _a.faceLivenessTimeoutDurationMs,
|
|
12317
|
-
faceLivenessTimeoutDurationMs = _o === void 0 ? 15000 : _o,
|
|
12318
|
-
_p = _a.faceLivenessLoadingOverlayMode,
|
|
12319
|
-
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
12320
|
-
_q = _a.skipSuccessScreen,
|
|
12321
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
12164
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
12165
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
12166
|
+
_d = _a.idCaptureRequirement,
|
|
12167
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
12168
|
+
_e = _a.idCaptureThresholds,
|
|
12169
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
12170
|
+
_f = _a.faceLivenessTimeoutDurationMs,
|
|
12171
|
+
faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
|
|
12172
|
+
_g = _a.faceLivenessLoadingOverlayMode,
|
|
12173
|
+
faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
|
|
12174
|
+
_h = _a.skipSuccessScreen,
|
|
12175
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
12322
12176
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
12323
|
-
|
|
12324
|
-
idCaptureGuideType =
|
|
12325
|
-
|
|
12326
|
-
idCapturePortraitGuidesOnMobile =
|
|
12327
|
-
|
|
12328
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
12329
|
-
|
|
12330
|
-
idCaptureModelLoadTimeoutMs =
|
|
12331
|
-
|
|
12332
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
12177
|
+
_j = _a.idCaptureGuideType,
|
|
12178
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
12179
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
12180
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
12181
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
12182
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
12183
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
12184
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
12185
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
12186
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
12333
12187
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
12334
12188
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
12335
12189
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
@@ -12345,28 +12199,28 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12345
12199
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
12346
12200
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
12347
12201
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
12348
|
-
|
|
12349
|
-
captureSignature =
|
|
12350
|
-
|
|
12351
|
-
captureSignatureVideo =
|
|
12352
|
-
|
|
12353
|
-
captureAdditionalDocuments =
|
|
12354
|
-
|
|
12355
|
-
theme =
|
|
12356
|
-
|
|
12357
|
-
assets =
|
|
12358
|
-
|
|
12359
|
-
classNames =
|
|
12360
|
-
|
|
12361
|
-
colors =
|
|
12362
|
-
|
|
12363
|
-
verbiage =
|
|
12364
|
-
|
|
12365
|
-
geolocationEnabled =
|
|
12366
|
-
|
|
12367
|
-
geolocationRequired =
|
|
12368
|
-
|
|
12369
|
-
debugMode =
|
|
12202
|
+
_p = _a.captureSignature,
|
|
12203
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
12204
|
+
_q = _a.captureSignatureVideo,
|
|
12205
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
12206
|
+
_r = _a.captureAdditionalDocuments,
|
|
12207
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
12208
|
+
_s = _a.theme,
|
|
12209
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
12210
|
+
_t = _a.assets,
|
|
12211
|
+
assets = _t === void 0 ? {} : _t,
|
|
12212
|
+
_u = _a.classNames,
|
|
12213
|
+
classNames = _u === void 0 ? {} : _u,
|
|
12214
|
+
_v = _a.colors,
|
|
12215
|
+
colors = _v === void 0 ? {} : _v,
|
|
12216
|
+
_w = _a.verbiage,
|
|
12217
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
12218
|
+
_x = _a.geolocationEnabled,
|
|
12219
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
12220
|
+
_y = _a.geolocationRequired,
|
|
12221
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
12222
|
+
_z = _a.debugMode,
|
|
12223
|
+
debugMode = _z === void 0 ? false : _z;
|
|
12370
12224
|
useLanguage(lang);
|
|
12371
12225
|
useDebugLogging(debugMode);
|
|
12372
12226
|
var idCaptureProps = useMemo(function () {
|
|
@@ -12376,12 +12230,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12376
12230
|
colors: colors.idCapture,
|
|
12377
12231
|
verbiage: verbiage.idCapture,
|
|
12378
12232
|
captureRequirement: idCaptureRequirement,
|
|
12379
|
-
|
|
12380
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
12381
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
12382
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
12383
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
12384
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
12233
|
+
thresholds: idCaptureThresholds,
|
|
12385
12234
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
12386
12235
|
instructions: idCaptureInstructions,
|
|
12387
12236
|
guideType: idCaptureGuideType,
|
|
@@ -12394,7 +12243,7 @@ var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollme
|
|
|
12394
12243
|
skipSuccessScreen: skipSuccessScreen,
|
|
12395
12244
|
debugMode: debugMode
|
|
12396
12245
|
};
|
|
12397
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
12246
|
+
}, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
|
|
12398
12247
|
var faceLivenessProps = useMemo(function () {
|
|
12399
12248
|
return {
|
|
12400
12249
|
onExitCapture: onExitCapture,
|
|
@@ -13732,70 +13581,60 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13732
13581
|
faceLivenessProps = _a.faceLivenessProps,
|
|
13733
13582
|
_c = _a.idCaptureModelsEnabled,
|
|
13734
13583
|
idCaptureModelsEnabled = _c === void 0 ? true : _c,
|
|
13735
|
-
_d = _a.
|
|
13736
|
-
|
|
13737
|
-
_e = _a.idCardFrontFocusThreshold,
|
|
13738
|
-
idCardFrontFocusThreshold = _e === void 0 ? 0 : _e,
|
|
13739
|
-
_f = _a.goodIdCardFrontFramesThreshold,
|
|
13740
|
-
goodIdCardFrontFramesThreshold = _f === void 0 ? 1 : _f,
|
|
13741
|
-
_g = _a.idCardBackDetectionThreshold,
|
|
13742
|
-
idCardBackDetectionThreshold = _g === void 0 ? 0.6 : _g,
|
|
13743
|
-
_h = _a.idCardBackFocusThreshold,
|
|
13744
|
-
idCardBackFocusThreshold = _h === void 0 ? 0 : _h,
|
|
13745
|
-
_j = _a.goodIdCardBackFramesThreshold,
|
|
13746
|
-
goodIdCardBackFramesThreshold = _j === void 0 ? 1 : _j,
|
|
13584
|
+
_d = _a.videoIdCaptureThresholds,
|
|
13585
|
+
videoIdCaptureThresholds = _d === void 0 ? defaultVideoIdCaptureThresholds : _d,
|
|
13747
13586
|
readTextPrompt = _a.readTextPrompt,
|
|
13748
|
-
|
|
13749
|
-
readTextTimeoutDurationMs =
|
|
13750
|
-
|
|
13751
|
-
readTextMinReadingMs =
|
|
13752
|
-
|
|
13753
|
-
skipSuccessScreen =
|
|
13754
|
-
|
|
13755
|
-
skipIdCapture =
|
|
13756
|
-
|
|
13757
|
-
skipShowIdCardBack =
|
|
13758
|
-
|
|
13759
|
-
idCaptureLoadingOverlayMode =
|
|
13760
|
-
|
|
13761
|
-
idCaptureGuideType =
|
|
13762
|
-
|
|
13763
|
-
idCapturePortraitGuidesOnMobile =
|
|
13764
|
-
|
|
13765
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
13587
|
+
_e = _a.readTextTimeoutDurationMs,
|
|
13588
|
+
readTextTimeoutDurationMs = _e === void 0 ? 15000 : _e,
|
|
13589
|
+
_f = _a.readTextMinReadingMs,
|
|
13590
|
+
readTextMinReadingMs = _f === void 0 ? 10000 : _f,
|
|
13591
|
+
_g = _a.skipSuccessScreen,
|
|
13592
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
13593
|
+
_h = _a.skipIdCapture,
|
|
13594
|
+
skipIdCapture = _h === void 0 ? false : _h,
|
|
13595
|
+
_j = _a.skipShowIdCardBack,
|
|
13596
|
+
skipShowIdCardBack = _j === void 0 ? false : _j,
|
|
13597
|
+
_k = _a.idCaptureLoadingOverlayMode,
|
|
13598
|
+
idCaptureLoadingOverlayMode = _k === void 0 ? 'default' : _k,
|
|
13599
|
+
_l = _a.idCaptureGuideType,
|
|
13600
|
+
idCaptureGuideType = _l === void 0 ? 'fit' : _l,
|
|
13601
|
+
_m = _a.idCapturePortraitGuidesOnMobile,
|
|
13602
|
+
idCapturePortraitGuidesOnMobile = _m === void 0 ? false : _m,
|
|
13603
|
+
_o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
13604
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
|
|
13766
13605
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
13767
|
-
|
|
13768
|
-
faceLivenessLoadingOverlayMode =
|
|
13769
|
-
|
|
13770
|
-
disableFaceDetectionWhileAudioCapture =
|
|
13771
|
-
|
|
13772
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
13773
|
-
|
|
13774
|
-
silentFallback =
|
|
13775
|
-
|
|
13776
|
-
mergeAVStreams =
|
|
13777
|
-
|
|
13778
|
-
theme =
|
|
13779
|
-
|
|
13780
|
-
assets =
|
|
13781
|
-
|
|
13782
|
-
classNames =
|
|
13783
|
-
|
|
13784
|
-
colors =
|
|
13785
|
-
|
|
13786
|
-
verbiage =
|
|
13787
|
-
|
|
13788
|
-
captureSignature =
|
|
13789
|
-
|
|
13790
|
-
captureSignatureVideo =
|
|
13791
|
-
|
|
13792
|
-
captureAdditionalDocuments =
|
|
13793
|
-
|
|
13794
|
-
geolocationEnabled =
|
|
13795
|
-
|
|
13796
|
-
geolocationRequired =
|
|
13797
|
-
|
|
13798
|
-
debugMode =
|
|
13606
|
+
_p = _a.faceLivenessLoadingOverlayMode,
|
|
13607
|
+
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
13608
|
+
_q = _a.disableFaceDetectionWhileAudioCapture,
|
|
13609
|
+
disableFaceDetectionWhileAudioCapture = _q === void 0 ? false : _q,
|
|
13610
|
+
_r = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
13611
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _r === void 0 ? 2000 : _r,
|
|
13612
|
+
_s = _a.silentFallback,
|
|
13613
|
+
silentFallback = _s === void 0 ? false : _s,
|
|
13614
|
+
_t = _a.mergeAVStreams,
|
|
13615
|
+
mergeAVStreams = _t === void 0 ? false : _t,
|
|
13616
|
+
_u = _a.theme,
|
|
13617
|
+
theme = _u === void 0 ? 'default' : _u,
|
|
13618
|
+
_v = _a.assets,
|
|
13619
|
+
assets = _v === void 0 ? {} : _v,
|
|
13620
|
+
_w = _a.classNames,
|
|
13621
|
+
classNames = _w === void 0 ? {} : _w,
|
|
13622
|
+
_x = _a.colors,
|
|
13623
|
+
colors = _x === void 0 ? {} : _x,
|
|
13624
|
+
_y = _a.verbiage,
|
|
13625
|
+
verbiage = _y === void 0 ? {} : _y,
|
|
13626
|
+
_z = _a.captureSignature,
|
|
13627
|
+
captureSignature = _z === void 0 ? false : _z,
|
|
13628
|
+
_0 = _a.captureSignatureVideo,
|
|
13629
|
+
captureSignatureVideo = _0 === void 0 ? false : _0,
|
|
13630
|
+
_1 = _a.captureAdditionalDocuments,
|
|
13631
|
+
captureAdditionalDocuments = _1 === void 0 ? [] : _1,
|
|
13632
|
+
_2 = _a.geolocationEnabled,
|
|
13633
|
+
geolocationEnabled = _2 === void 0 ? true : _2,
|
|
13634
|
+
_3 = _a.geolocationRequired,
|
|
13635
|
+
geolocationRequired = _3 === void 0 ? false : _3,
|
|
13636
|
+
_4 = _a.debugMode,
|
|
13637
|
+
debugMode = _4 === void 0 ? false : _4;
|
|
13799
13638
|
useLanguage(lang);
|
|
13800
13639
|
useDebugLogging(debugMode);
|
|
13801
13640
|
var videoIdCaptureProps = useMemo(function () {
|
|
@@ -13803,12 +13642,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13803
13642
|
idCaptureProps: idCaptureProps,
|
|
13804
13643
|
faceLivenessProps: faceLivenessProps,
|
|
13805
13644
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
13806
|
-
|
|
13807
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
13808
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
13809
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
13810
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
13811
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
13645
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
13812
13646
|
readTextPrompt: readTextPrompt,
|
|
13813
13647
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
13814
13648
|
readTextMinReadingMs: readTextMinReadingMs,
|
|
@@ -13833,7 +13667,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13833
13667
|
verbiage: verbiage,
|
|
13834
13668
|
debugMode: debugMode
|
|
13835
13669
|
};
|
|
13836
|
-
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled,
|
|
13670
|
+
}, [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]);
|
|
13837
13671
|
var additionalDocumentCaptureProps = useMemo(function () {
|
|
13838
13672
|
return {
|
|
13839
13673
|
documents: captureAdditionalDocuments,
|