idmission-web-sdk 2.3.58 → 2.3.60
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/dist/components/CompositeWizard.d.ts.map +1 -1
- package/dist/components/camera/CameraVideoTag.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +6 -1
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +7 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
- package/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/components/submission/types.d.ts +2 -0
- package/dist/components/submission/types.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +1 -2
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/camera/cameraStore.d.ts +3 -3
- package/dist/lib/camera/cameraStore.d.ts.map +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +1 -2
- package/dist/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +169 -152
- 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 +169 -152
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +169 -152
- 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/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
var webSdkVersion = '2.3.
|
|
214
|
+
var webSdkVersion = '2.3.60';
|
|
215
215
|
|
|
216
216
|
function getPlatform() {
|
|
217
217
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2545,6 +2545,9 @@
|
|
|
2545
2545
|
if (clientRequestID) {
|
|
2546
2546
|
submissionRequest.additionalData.clientRequestID = clientRequestID;
|
|
2547
2547
|
}
|
|
2548
|
+
if (jobId) {
|
|
2549
|
+
submissionRequest.additionalData.jobID = jobId;
|
|
2550
|
+
}
|
|
2548
2551
|
if (documents.idFrontImage) {
|
|
2549
2552
|
submissionRequest.customerData.idData.idImageFront = documents.idFrontImage;
|
|
2550
2553
|
}
|
|
@@ -2642,7 +2645,7 @@
|
|
|
2642
2645
|
}
|
|
2643
2646
|
});
|
|
2644
2647
|
});
|
|
2645
|
-
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
2648
|
+
}, [additionalDocuments, bypassAgeValidation, bypassNameMatching, cardData, clientRequestID, companyId, customerDataMatchConfig, deduplicationEnabled, deduplicationSynchronous, documentServiceUrl, enrollmentId, expectedAudioText, geolocationResult, idBackCaptureAttempts, idBackImage, idBackImageRequired, idBackIrImage, idBackUvImage, idCaptureVideoAudioStartsAt, idCaptureVideoAudioUrl, idCaptureVideoIdBackImage, idCaptureVideoIdFrontImage, idCaptureVideoUrl, idCardForFaceMatch, idData, idFrontCaptureAttempts, idFrontImage, idFrontIrImage, idFrontUvImage, idImageResolutionCheck, jobId, manualReviewRequired, needImmediateResponse, passportImage, personalData, selfieCaptureAttempts, selfieImage, signatureData, signatureVideoUrl, uploadDocument, verifyIdWithExternalDatabases, webhooksClientTraceId, webhooksEnabled, webhooksFireOnReview, webhooksFireOnReviewURL, webhooksSendInputImages, webhooksSendProcessedImages, webhooksStripSpecialCharacters, webhooksURL]);
|
|
2646
2649
|
var defaultOnSubmit = React.useCallback(function () {
|
|
2647
2650
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2648
2651
|
var submissionResponse_1, payload, host, endpoint, response, statusMessage, submissionResponse_2, e_1, err;
|
|
@@ -2786,6 +2789,9 @@
|
|
|
2786
2789
|
if (clientRequestID) {
|
|
2787
2790
|
request.additionalData.clientRequestID = clientRequestID;
|
|
2788
2791
|
}
|
|
2792
|
+
if (jobId) {
|
|
2793
|
+
request.additionalData.jobID = jobId;
|
|
2794
|
+
}
|
|
2789
2795
|
if (idCardForFaceMatch) {
|
|
2790
2796
|
request.customerData.idData = {
|
|
2791
2797
|
idImageFront: idCardForFaceMatch
|
|
@@ -2813,7 +2819,7 @@
|
|
|
2813
2819
|
}
|
|
2814
2820
|
});
|
|
2815
2821
|
});
|
|
2816
|
-
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
2822
|
+
}, [clientRequestID, documentServiceUrl, estimateAge, geolocationResult, idBackCaptureAttempts, idCardForFaceMatch, idFrontCaptureAttempts, jobId, predictGender, selfieCaptureAttempts, uploadDocument, useDocumentServiceForLivenessChecks, webhooksStripSpecialCharacters]);
|
|
2817
2823
|
var checkLiveness = React.useCallback(function (imageDataUrl) {
|
|
2818
2824
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2819
2825
|
var request, host, endpoint, response, statusMessage, submissionResponse_3, e_2, err;
|
|
@@ -9610,8 +9616,8 @@
|
|
|
9610
9616
|
release: release
|
|
9611
9617
|
};
|
|
9612
9618
|
log('camera access granted');
|
|
9613
|
-
if (video) video.srcObject = stream
|
|
9614
|
-
log('video source initialized')
|
|
9619
|
+
// if (video) video.srcObject = stream
|
|
9620
|
+
// log('video source initialized')
|
|
9615
9621
|
return currentCamera;
|
|
9616
9622
|
}
|
|
9617
9623
|
function releaseCameraAccess() {
|
|
@@ -13534,24 +13540,24 @@
|
|
|
13534
13540
|
}, [fallbacks, i18n.language, t, verbiage]);
|
|
13535
13541
|
}
|
|
13536
13542
|
|
|
13543
|
+
var camera = null;
|
|
13544
|
+
var videoStream = null;
|
|
13545
|
+
var audioStream = null;
|
|
13537
13546
|
var initialState$6 = {
|
|
13538
13547
|
videoRef: {
|
|
13539
13548
|
current: null
|
|
13540
13549
|
},
|
|
13541
13550
|
videoLoaded: false,
|
|
13542
|
-
videoStream: null,
|
|
13543
13551
|
videoDevice: null,
|
|
13544
13552
|
videoWidth: 0,
|
|
13545
13553
|
videoHeight: 0,
|
|
13546
13554
|
isRearFacing: false,
|
|
13547
|
-
camera: null,
|
|
13548
13555
|
cameraReady: false,
|
|
13549
13556
|
cameraAccessDenied: false,
|
|
13550
13557
|
iphoneContinuityCameraAvailable: false,
|
|
13551
13558
|
iphoneContinuityCameraDenied: false,
|
|
13552
13559
|
preferIphoneContinuityCamera: true,
|
|
13553
13560
|
cameraTamperingDetected: false,
|
|
13554
|
-
audioStream: null,
|
|
13555
13561
|
microphoneReady: false,
|
|
13556
13562
|
microphoneAccessDenied: false
|
|
13557
13563
|
};
|
|
@@ -13565,8 +13571,7 @@
|
|
|
13565
13571
|
return set(config);
|
|
13566
13572
|
},
|
|
13567
13573
|
onVideoMounted: function onVideoMounted(e) {
|
|
13568
|
-
var
|
|
13569
|
-
var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
|
|
13574
|
+
var selectedVideoStreamId = videoStream === null || videoStream === void 0 ? void 0 : videoStream.id;
|
|
13570
13575
|
if (!selectedVideoStreamId) return;
|
|
13571
13576
|
var srcObject = e.currentTarget.srcObject;
|
|
13572
13577
|
if (srcObject.id === selectedVideoStreamId) {
|
|
@@ -13586,19 +13591,19 @@
|
|
|
13586
13591
|
},
|
|
13587
13592
|
requestCameraAccess: function requestCameraAccess() {
|
|
13588
13593
|
return __awaiter(this, void 0, void 0, function () {
|
|
13589
|
-
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1,
|
|
13590
|
-
var _b, _c, _d;
|
|
13591
|
-
return __generator(this, function (
|
|
13592
|
-
switch (
|
|
13594
|
+
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1, e_3;
|
|
13595
|
+
var _b, _c, _d, _e;
|
|
13596
|
+
return __generator(this, function (_f) {
|
|
13597
|
+
switch (_f.label) {
|
|
13593
13598
|
case 0:
|
|
13594
13599
|
_a = get(), videoRef = _a.videoRef, releaseCameraAccess = _a.releaseCameraAccess, preferFrontFacingCamera = _a.preferFrontFacingCamera, preferIphoneContinuityCamera = _a.preferIphoneContinuityCamera, iphoneContinuityCameraDenied = _a.iphoneContinuityCameraDenied;
|
|
13595
13600
|
releaseCameraAccess();
|
|
13596
|
-
|
|
13601
|
+
_f.label = 1;
|
|
13597
13602
|
case 1:
|
|
13598
|
-
|
|
13603
|
+
_f.trys.push([1, 11,, 12]);
|
|
13599
13604
|
return [4 /*yield*/, listAvailableCameras()];
|
|
13600
13605
|
case 2:
|
|
13601
|
-
availableCameras =
|
|
13606
|
+
availableCameras = _f.sent();
|
|
13602
13607
|
selectedCamera = void 0;
|
|
13603
13608
|
debug('availableCameras', availableCameras);
|
|
13604
13609
|
platform_1 = getPlatform();
|
|
@@ -13668,16 +13673,16 @@
|
|
|
13668
13673
|
};
|
|
13669
13674
|
}
|
|
13670
13675
|
stream_1 = null;
|
|
13671
|
-
|
|
13676
|
+
_f.label = 3;
|
|
13672
13677
|
case 3:
|
|
13673
|
-
|
|
13678
|
+
_f.trys.push([3, 5,, 6]);
|
|
13674
13679
|
debug('obtaining camera access with constraints', constraints);
|
|
13675
13680
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
|
|
13676
13681
|
case 4:
|
|
13677
|
-
stream_1 =
|
|
13682
|
+
stream_1 = _f.sent();
|
|
13678
13683
|
return [3 /*break*/, 6];
|
|
13679
13684
|
case 5:
|
|
13680
|
-
e_1 =
|
|
13685
|
+
e_1 = _f.sent();
|
|
13681
13686
|
if (e_1.name === 'NotAllowedError') {
|
|
13682
13687
|
if (preferIphoneContinuityCamera) {
|
|
13683
13688
|
set({
|
|
@@ -13694,19 +13699,19 @@
|
|
|
13694
13699
|
return [3 /*break*/, 6];
|
|
13695
13700
|
case 6:
|
|
13696
13701
|
if (!!stream_1) return [3 /*break*/, 10];
|
|
13697
|
-
|
|
13702
|
+
_f.label = 7;
|
|
13698
13703
|
case 7:
|
|
13699
|
-
|
|
13704
|
+
_f.trys.push([7, 9,, 10]);
|
|
13700
13705
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
|
|
13701
13706
|
audio: false,
|
|
13702
13707
|
video: true
|
|
13703
13708
|
})];
|
|
13704
13709
|
case 8:
|
|
13705
|
-
stream_1 =
|
|
13710
|
+
stream_1 = _f.sent();
|
|
13706
13711
|
debug('opened stream with no width and height constraints');
|
|
13707
13712
|
return [3 /*break*/, 10];
|
|
13708
13713
|
case 9:
|
|
13709
|
-
e_2 =
|
|
13714
|
+
e_2 = _f.sent();
|
|
13710
13715
|
debug('cannot open stream at all', e_2);
|
|
13711
13716
|
return [3 /*break*/, 10];
|
|
13712
13717
|
case 10:
|
|
@@ -13718,8 +13723,8 @@
|
|
|
13718
13723
|
handleStreamEnded_1 = function handleStreamEnded_1() {
|
|
13719
13724
|
if (preferIphoneContinuityCamera && get().iphoneContinuityCameraAvailable) {
|
|
13720
13725
|
debug('someone unplugged the continuity camera');
|
|
13726
|
+
videoStream = null;
|
|
13721
13727
|
set({
|
|
13722
|
-
videoStream: null,
|
|
13723
13728
|
videoDevice: null,
|
|
13724
13729
|
cameraReady: false,
|
|
13725
13730
|
iphoneContinuityCameraAvailable: false,
|
|
@@ -13728,9 +13733,9 @@
|
|
|
13728
13733
|
get().requestCameraAccess();
|
|
13729
13734
|
} else {
|
|
13730
13735
|
debug('someone unplugged the webcam');
|
|
13731
|
-
releaseCameraAccess();
|
|
13736
|
+
get().releaseCameraAccess();
|
|
13737
|
+
videoStream = null;
|
|
13732
13738
|
set({
|
|
13733
|
-
videoStream: null,
|
|
13734
13739
|
videoDevice: null,
|
|
13735
13740
|
videoLoaded: false,
|
|
13736
13741
|
cameraReady: false,
|
|
@@ -13741,25 +13746,26 @@
|
|
|
13741
13746
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleStreamEnded_1);
|
|
13742
13747
|
videoTrack_1 = stream_1.getVideoTracks()[0];
|
|
13743
13748
|
videoTrack_1.onended = handleStreamEnded_1;
|
|
13744
|
-
|
|
13749
|
+
camera = obtainCameraAccess(stream_1, selectedCamera.label, videoRef.current);
|
|
13745
13750
|
setTimeout(function () {
|
|
13751
|
+
var _a;
|
|
13746
13752
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
13747
13753
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
13748
13754
|
videoTrack_1.onmute = function () {
|
|
13749
13755
|
if (videoTrack_1.readyState !== 'live') handleStreamEnded_1();
|
|
13750
13756
|
};
|
|
13757
|
+
videoStream = stream_1;
|
|
13758
|
+
var isRearFacing = (_a = camera === null || camera === void 0 ? void 0 : camera.isRearFacing) !== null && _a !== void 0 ? _a : false;
|
|
13751
13759
|
set({
|
|
13752
|
-
camera: camera_1,
|
|
13753
13760
|
cameraReady: true,
|
|
13754
13761
|
cameraAccessDenied: false,
|
|
13755
|
-
isRearFacing:
|
|
13756
|
-
videoStream: stream_1
|
|
13762
|
+
isRearFacing: isRearFacing
|
|
13757
13763
|
});
|
|
13758
13764
|
}, 500);
|
|
13759
13765
|
return [3 /*break*/, 12];
|
|
13760
13766
|
case 11:
|
|
13761
|
-
e_3 =
|
|
13762
|
-
if (e_3.name === 'NotAllowedError') {
|
|
13767
|
+
e_3 = _f.sent();
|
|
13768
|
+
if (e_3.name === 'NotAllowedError' || ((_e = e_3.message) === null || _e === void 0 ? void 0 : _e.includes('Could not start video source'))) {
|
|
13763
13769
|
error('camera access has been blocked by the user', e_3);
|
|
13764
13770
|
set({
|
|
13765
13771
|
cameraAccessDenied: true
|
|
@@ -13777,17 +13783,18 @@
|
|
|
13777
13783
|
},
|
|
13778
13784
|
releaseCameraAccess: function releaseCameraAccess() {
|
|
13779
13785
|
return __awaiter(this, void 0, void 0, function () {
|
|
13780
|
-
var camera;
|
|
13781
13786
|
return __generator(this, function (_a) {
|
|
13782
|
-
camera = get().camera;
|
|
13783
13787
|
if (!camera) return [2 /*return*/];
|
|
13784
13788
|
camera.release();
|
|
13789
|
+
camera = null;
|
|
13790
|
+
videoStream === null || videoStream === void 0 ? void 0 : videoStream.getTracks().forEach(function (track) {
|
|
13791
|
+
track.stop();
|
|
13792
|
+
});
|
|
13793
|
+
videoStream = null;
|
|
13785
13794
|
set({
|
|
13786
|
-
camera: null,
|
|
13787
13795
|
cameraReady: false,
|
|
13788
13796
|
cameraAccessDenied: false,
|
|
13789
13797
|
videoDevice: null,
|
|
13790
|
-
videoStream: null,
|
|
13791
13798
|
videoLoaded: false
|
|
13792
13799
|
});
|
|
13793
13800
|
return [2 /*return*/];
|
|
@@ -13816,8 +13823,8 @@
|
|
|
13816
13823
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
13817
13824
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
13818
13825
|
setTimeout(function () {
|
|
13826
|
+
audioStream = stream_2;
|
|
13819
13827
|
set({
|
|
13820
|
-
audioStream: stream_2,
|
|
13821
13828
|
microphoneReady: true,
|
|
13822
13829
|
microphoneAccessDenied: false
|
|
13823
13830
|
});
|
|
@@ -13826,6 +13833,7 @@
|
|
|
13826
13833
|
microphoneReady: false,
|
|
13827
13834
|
microphoneAccessDenied: true
|
|
13828
13835
|
});
|
|
13836
|
+
get().releaseMicrophoneAccess();
|
|
13829
13837
|
};
|
|
13830
13838
|
var track = stream_2.getAudioTracks()[0];
|
|
13831
13839
|
track.onended = handleStreamEnded;
|
|
@@ -13849,14 +13857,13 @@
|
|
|
13849
13857
|
},
|
|
13850
13858
|
releaseMicrophoneAccess: function releaseMicrophoneAccess() {
|
|
13851
13859
|
var _a;
|
|
13852
|
-
var audioStream = get().audioStream;
|
|
13853
13860
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
13854
13861
|
audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks().forEach(function (track) {
|
|
13855
13862
|
var _a;
|
|
13856
13863
|
(_a = track.stop) === null || _a === void 0 ? void 0 : _a.call(track);
|
|
13857
13864
|
});
|
|
13865
|
+
audioStream = null;
|
|
13858
13866
|
set({
|
|
13859
|
-
audioStream: null,
|
|
13860
13867
|
microphoneReady: false,
|
|
13861
13868
|
microphoneAccessDenied: false
|
|
13862
13869
|
});
|
|
@@ -15757,15 +15764,13 @@
|
|
|
15757
15764
|
_q = _o.height,
|
|
15758
15765
|
height = _q === void 0 ? 1 : _q;
|
|
15759
15766
|
var state = useIdCaptureStore();
|
|
15760
|
-
var
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
focusPredictionTime = _s.focusPredictionTime,
|
|
15768
|
-
getBestFrame = _s.getBestFrame;
|
|
15767
|
+
var isRearFacing = useCameraStore().isRearFacing;
|
|
15768
|
+
var _r = React.useContext(IdCaptureModelsContext),
|
|
15769
|
+
modelsReady = _r.ready,
|
|
15770
|
+
setThresholds = _r.setThresholds,
|
|
15771
|
+
detectionTime = _r.detectionTime,
|
|
15772
|
+
focusPredictionTime = _r.focusPredictionTime,
|
|
15773
|
+
getBestFrame = _r.getBestFrame;
|
|
15769
15774
|
React.useEffect(function () {
|
|
15770
15775
|
return dispatchIdCaptureAction({
|
|
15771
15776
|
type: 'captureInitialized'
|
|
@@ -18210,9 +18215,7 @@
|
|
|
18210
18215
|
var _c = React.useReducer(documentCaptureStateReducer, documentCaptureInitialState),
|
|
18211
18216
|
state = _c[0],
|
|
18212
18217
|
dispatch = _c[1];
|
|
18213
|
-
var
|
|
18214
|
-
videoStream = _d.videoStream,
|
|
18215
|
-
videoRef = _d.videoRef;
|
|
18218
|
+
var videoRef = useCameraStore().videoRef;
|
|
18216
18219
|
var uploadDocument = React.useContext(SubmissionContext).uploadDocument;
|
|
18217
18220
|
var uploadCapturedDocument = React.useCallback(function (content, filetype) {
|
|
18218
18221
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -18306,7 +18309,7 @@
|
|
|
18306
18309
|
}, [onResize]);
|
|
18307
18310
|
var videoTag = videoRef.current;
|
|
18308
18311
|
React.useEffect(function () {
|
|
18309
|
-
if (!state.capturing
|
|
18312
|
+
if (!state.capturing) return;
|
|
18310
18313
|
function onComplete(content) {
|
|
18311
18314
|
if (!content) return;
|
|
18312
18315
|
var contentUrl = URL.createObjectURL(content);
|
|
@@ -18323,7 +18326,7 @@
|
|
|
18323
18326
|
drawToCanvas(canvas, videoTag);
|
|
18324
18327
|
canvas.toBlob(onComplete);
|
|
18325
18328
|
}
|
|
18326
|
-
}, [state.capturing,
|
|
18329
|
+
}, [state.capturing, videoTag]);
|
|
18327
18330
|
var stateWithActions = React.useMemo(function () {
|
|
18328
18331
|
return _assign(_assign({}, state), {
|
|
18329
18332
|
uploadCapturedDocument: uploadCapturedDocument
|
|
@@ -18452,29 +18455,28 @@
|
|
|
18452
18455
|
var CameraVideoTag = function CameraVideoTag(props) {
|
|
18453
18456
|
var _a = useCameraStore(useShallow(function (store) {
|
|
18454
18457
|
return {
|
|
18458
|
+
cameraReady: store.cameraReady,
|
|
18455
18459
|
videoRef: store.videoRef,
|
|
18456
|
-
videoStream: store.videoStream,
|
|
18457
18460
|
onVideoMounted: store.onVideoMounted,
|
|
18458
18461
|
isRearFacing: store.isRearFacing
|
|
18459
18462
|
};
|
|
18460
18463
|
})),
|
|
18464
|
+
cameraReady = _a.cameraReady,
|
|
18461
18465
|
videoRef = _a.videoRef,
|
|
18462
|
-
videoStream = _a.videoStream,
|
|
18463
18466
|
onVideoMounted = _a.onVideoMounted,
|
|
18464
18467
|
isRearFacing = _a.isRearFacing;
|
|
18465
|
-
React.useEffect(function
|
|
18466
|
-
if (videoRef.current
|
|
18467
|
-
|
|
18468
|
-
|
|
18469
|
-
|
|
18470
|
-
|
|
18471
|
-
}, [videoStream, videoRef]);
|
|
18468
|
+
React.useEffect(function () {
|
|
18469
|
+
if (!cameraReady || !videoRef.current) return;
|
|
18470
|
+
debug('attaching camera stream to video tag');
|
|
18471
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
18472
|
+
videoRef.current.srcObject = videoStream;
|
|
18473
|
+
}, [cameraReady, videoRef]);
|
|
18472
18474
|
return /*#__PURE__*/React.createElement(FullscreenVideoTag, _assign({
|
|
18473
18475
|
autoPlay: true,
|
|
18474
18476
|
playsInline: true,
|
|
18475
18477
|
muted: true,
|
|
18476
18478
|
ref: videoRef,
|
|
18477
|
-
|
|
18479
|
+
onCanPlay: onVideoMounted,
|
|
18478
18480
|
"$isRearFacing": isRearFacing
|
|
18479
18481
|
}, props));
|
|
18480
18482
|
};
|
|
@@ -18511,7 +18513,6 @@
|
|
|
18511
18513
|
content = _k.content,
|
|
18512
18514
|
uploadState = _k.uploadState;
|
|
18513
18515
|
var _l = useCameraStore(),
|
|
18514
|
-
videoStream = _l.videoStream,
|
|
18515
18516
|
cameraReady = _l.cameraReady,
|
|
18516
18517
|
cameraAccessDenied = _l.cameraAccessDenied,
|
|
18517
18518
|
requestCameraAccess = _l.requestCameraAccess;
|
|
@@ -18526,7 +18527,7 @@
|
|
|
18526
18527
|
// and the user hasn't passed a media blob for the current document...
|
|
18527
18528
|
!cameraAccessRequested &&
|
|
18528
18529
|
// and we haven't already tried to force a camera request...
|
|
18529
|
-
!
|
|
18530
|
+
!cameraReady; // and we don't already have camera access.
|
|
18530
18531
|
React.useEffect(function requestCameraAccessIfNeeded() {
|
|
18531
18532
|
if (!cameraAccessNeeded) return;
|
|
18532
18533
|
setCameraAccessRequested(true);
|
|
@@ -19951,6 +19952,30 @@
|
|
|
19951
19952
|
debugMode: debugMode
|
|
19952
19953
|
})));
|
|
19953
19954
|
};
|
|
19955
|
+
function IdCaptureWizardWithProviders(_a) {
|
|
19956
|
+
var _b, _c, _d, _e, _f, _g;
|
|
19957
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
19958
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
19959
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
19960
|
+
shouldLoadIdCaptureModels = _a.shouldLoadIdCaptureModels,
|
|
19961
|
+
idCaptureProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied", "shouldLoadIdCaptureModels"]);
|
|
19962
|
+
return /*#__PURE__*/React.createElement(CameraStoreProvider, {
|
|
19963
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
19964
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
19965
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
19966
|
+
requestAccessAutomatically: shouldLoadIdCaptureModels,
|
|
19967
|
+
classNames: (_b = idCaptureProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
19968
|
+
verbiage: (_c = idCaptureProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
19969
|
+
}, /*#__PURE__*/React.createElement(IdCaptureModelsProvider, {
|
|
19970
|
+
autoStart: false,
|
|
19971
|
+
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
19972
|
+
documentDetectionModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.documentDetectionModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
19973
|
+
focusModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.focusModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
19974
|
+
onModelError: idCaptureProps.onModelError,
|
|
19975
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
19976
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
19977
|
+
}, /*#__PURE__*/React.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React.createElement(IdCaptureWizard, _assign({}, idCaptureProps))))));
|
|
19978
|
+
}
|
|
19954
19979
|
|
|
19955
19980
|
function SelfieCaptureLoadingGraphic(_a) {
|
|
19956
19981
|
var _b, _c, _d;
|
|
@@ -20964,9 +20989,6 @@
|
|
|
20964
20989
|
prediction = _o.prediction,
|
|
20965
20990
|
dispatch = _m[1];
|
|
20966
20991
|
var lastPredictionCanvas = React.useRef(null);
|
|
20967
|
-
var camera = useCameraStore(useShallow(function (state) {
|
|
20968
|
-
return state.camera;
|
|
20969
|
-
}));
|
|
20970
20992
|
var _p = React.useContext(SelfieGuidanceModelsContext),
|
|
20971
20993
|
onPredictionMade = _p.onPredictionMade,
|
|
20972
20994
|
canvasRef = _p.canvasRef,
|
|
@@ -22142,6 +22164,26 @@
|
|
|
22142
22164
|
waitForIdCaptureModels: waitForIdCaptureModels
|
|
22143
22165
|
})));
|
|
22144
22166
|
};
|
|
22167
|
+
function FaceLivenessWizardWithProviders(_a) {
|
|
22168
|
+
var _b, _c;
|
|
22169
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
22170
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
22171
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
22172
|
+
faceLivenessProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied"]);
|
|
22173
|
+
return /*#__PURE__*/React.createElement(CameraStoreProvider, {
|
|
22174
|
+
preferFrontFacingCamera: true,
|
|
22175
|
+
preferIphoneContinuityCamera: false,
|
|
22176
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
22177
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
22178
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
22179
|
+
classNames: (_b = faceLivenessProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
22180
|
+
verbiage: (_c = faceLivenessProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
22181
|
+
}, /*#__PURE__*/React.createElement(SelfieGuidanceModelsProvider, {
|
|
22182
|
+
autoStart: false,
|
|
22183
|
+
onModelError: faceLivenessProps.onModelError,
|
|
22184
|
+
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
22185
|
+
}, /*#__PURE__*/React.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps))));
|
|
22186
|
+
}
|
|
22145
22187
|
|
|
22146
22188
|
var SubmissionSuccess = function SubmissionSuccess() {
|
|
22147
22189
|
var _a = React.useContext(SubmissionContext),
|
|
@@ -23326,12 +23368,16 @@
|
|
|
23326
23368
|
};
|
|
23327
23369
|
var useVideoRecorderStore = create$1()(devtools(function (set, get) {
|
|
23328
23370
|
return _assign(_assign({}, initialState$2), {
|
|
23329
|
-
startRecordingVideo: function startRecordingVideo(
|
|
23371
|
+
startRecordingVideo: function startRecordingVideo(captureAudio) {
|
|
23330
23372
|
var _a, _b, _c;
|
|
23373
|
+
if (captureAudio === void 0) {
|
|
23374
|
+
captureAudio = false;
|
|
23375
|
+
}
|
|
23376
|
+
if (!camera) throw new Error('Camera not found');
|
|
23331
23377
|
var _d = get(),
|
|
23332
23378
|
mergeAVStreams = _d.mergeAVStreams,
|
|
23333
23379
|
startRecordingAudio = _d.startRecordingAudio;
|
|
23334
|
-
var videoStream = mergeAVStreams ? new MediaStream(__spreadArray(__spreadArray([], (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [], true), (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [], true)) : camera.stream;
|
|
23380
|
+
var videoStream = mergeAVStreams ? new MediaStream(__spreadArray(__spreadArray([], (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [], true), captureAudio ? (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [] : [], true)) : camera.stream;
|
|
23335
23381
|
if (!videoStream) return;
|
|
23336
23382
|
clearVideoChunks();
|
|
23337
23383
|
videoRecorder = null;
|
|
@@ -23359,8 +23405,8 @@
|
|
|
23359
23405
|
// TODO: figure out what to do here
|
|
23360
23406
|
}
|
|
23361
23407
|
}, 100);
|
|
23362
|
-
if (
|
|
23363
|
-
startRecordingAudio(
|
|
23408
|
+
if (captureAudio && !mergeAVStreams) {
|
|
23409
|
+
startRecordingAudio();
|
|
23364
23410
|
}
|
|
23365
23411
|
},
|
|
23366
23412
|
stopRecordingVideo: function stopRecordingVideo() {
|
|
@@ -23371,7 +23417,7 @@
|
|
|
23371
23417
|
videoRecorder === null || videoRecorder === void 0 ? void 0 : videoRecorder.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
23372
23418
|
}
|
|
23373
23419
|
},
|
|
23374
|
-
startRecordingAudio: function startRecordingAudio(
|
|
23420
|
+
startRecordingAudio: function startRecordingAudio() {
|
|
23375
23421
|
if (get().mergeAVStreams) return;
|
|
23376
23422
|
if (!audioStream) return;
|
|
23377
23423
|
clearAudioChunks();
|
|
@@ -23505,18 +23551,19 @@
|
|
|
23505
23551
|
};
|
|
23506
23552
|
var useVideoSignatureStore = create$1()(devtools(function (set, get) {
|
|
23507
23553
|
return _assign(_assign({}, videoSignatureInitialState), {
|
|
23508
|
-
startRecording: function startRecording(
|
|
23554
|
+
startRecording: function startRecording(captureAudio) {
|
|
23509
23555
|
var _a;
|
|
23510
23556
|
if (captureAudio === void 0) {
|
|
23511
23557
|
captureAudio = false;
|
|
23512
23558
|
}
|
|
23559
|
+
if (!camera) throw new Error('Camera not found');
|
|
23513
23560
|
// set our flag and clear whatever we have recorded so far.
|
|
23514
23561
|
set({
|
|
23515
23562
|
isRecording: true
|
|
23516
23563
|
});
|
|
23517
23564
|
signatureChunks = [];
|
|
23518
23565
|
// start recording video and audio
|
|
23519
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
23566
|
+
useVideoRecorderStore.getState().startRecordingVideo(captureAudio);
|
|
23520
23567
|
// start recording from the output canvas to capture the signature
|
|
23521
23568
|
var videoStream = get().outputCanvas.current.captureStream(24); // fps
|
|
23522
23569
|
var tracks = [videoStream.getVideoTracks()[0]];
|
|
@@ -23810,14 +23857,10 @@
|
|
|
23810
23857
|
debugMode = _l === void 0 ? false : _l;
|
|
23811
23858
|
var _m = useCameraStore(useShallow(function (state) {
|
|
23812
23859
|
return {
|
|
23813
|
-
camera: state.camera,
|
|
23814
|
-
audioStream: state.audioStream,
|
|
23815
23860
|
videoWidth: state.videoWidth,
|
|
23816
23861
|
videoHeight: state.videoHeight
|
|
23817
23862
|
};
|
|
23818
23863
|
})),
|
|
23819
|
-
camera = _m.camera,
|
|
23820
|
-
audioStream = _m.audioStream,
|
|
23821
23864
|
videoWidth = _m.videoWidth,
|
|
23822
23865
|
videoHeight = _m.videoHeight;
|
|
23823
23866
|
var _o = useSelfieGuidanceModelsContext(),
|
|
@@ -23825,8 +23868,6 @@
|
|
|
23825
23868
|
startHeadTracking = _o.start,
|
|
23826
23869
|
stopHeadTracking = _o.stop;
|
|
23827
23870
|
var _p = useVideoSignatureStore(),
|
|
23828
|
-
startRecording = _p.startRecording,
|
|
23829
|
-
stopRecording = _p.stopRecording,
|
|
23830
23871
|
clearRecordedData = _p.clearRecordedData,
|
|
23831
23872
|
isRecording = _p.isRecording;
|
|
23832
23873
|
React.useEffect(function () {
|
|
@@ -23835,10 +23876,11 @@
|
|
|
23835
23876
|
});
|
|
23836
23877
|
}, [onSignatureVideoCaptured]);
|
|
23837
23878
|
React.useEffect(function () {
|
|
23838
|
-
|
|
23839
|
-
|
|
23840
|
-
|
|
23841
|
-
|
|
23879
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
23880
|
+
return function () {
|
|
23881
|
+
return useVideoSignatureStore.getState().stopRecording();
|
|
23882
|
+
};
|
|
23883
|
+
}, [captureAudio]);
|
|
23842
23884
|
React.useEffect(function () {
|
|
23843
23885
|
setTimeout(startHeadTracking, 1);
|
|
23844
23886
|
return stopHeadTracking;
|
|
@@ -23859,7 +23901,7 @@
|
|
|
23859
23901
|
setNumFramesWithoutFaces = _s[1];
|
|
23860
23902
|
onHeadTrackingPredictionMade(f(React.useCallback(function (_a) {
|
|
23861
23903
|
var face = _a.face;
|
|
23862
|
-
if (
|
|
23904
|
+
if (headTrackingDisabled) return;
|
|
23863
23905
|
var leftEdge = videoWidth * headTrackingBoundaryPercentage;
|
|
23864
23906
|
var rightEdge = videoWidth * (1 - headTrackingBoundaryPercentage);
|
|
23865
23907
|
var topEdge = videoHeight * headTrackingBoundaryPercentage;
|
|
@@ -23870,7 +23912,7 @@
|
|
|
23870
23912
|
setNumFramesWithoutFaces(face ? 0 : function (n) {
|
|
23871
23913
|
return n + 1;
|
|
23872
23914
|
});
|
|
23873
|
-
}, [
|
|
23915
|
+
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
23874
23916
|
var _t = useResizeObserver(),
|
|
23875
23917
|
ref = _t.ref,
|
|
23876
23918
|
_u = _t.width,
|
|
@@ -23913,7 +23955,7 @@
|
|
|
23913
23955
|
face: lastFace,
|
|
23914
23956
|
scaling: debugScalingDetails,
|
|
23915
23957
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
23916
|
-
}))), /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ",
|
|
23958
|
+
}))), /*#__PURE__*/React.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React.createElement("br", null), "Recording: ", isRecording ? 'true' : 'false'))), /*#__PURE__*/React.createElement(ExitCaptureButton, {
|
|
23917
23959
|
onClick: onExit,
|
|
23918
23960
|
className: classNames.exitCaptureBtn
|
|
23919
23961
|
}));
|
|
@@ -24419,9 +24461,6 @@
|
|
|
24419
24461
|
component = _a.component,
|
|
24420
24462
|
props = __rest(_a, ["status", "restartVideoOnSignaturePadCleared", "captureAudio", "component"]);
|
|
24421
24463
|
var Component = component !== null && component !== void 0 ? component : VideoSignatureGuides;
|
|
24422
|
-
var _d = useCameraStore(),
|
|
24423
|
-
camera = _d.camera,
|
|
24424
|
-
audioStream = _d.audioStream;
|
|
24425
24464
|
var onAcceptBtnClicked = React.useCallback(function () {
|
|
24426
24465
|
var signaturePad = useVideoSignatureStore.getState().signaturePad;
|
|
24427
24466
|
if (!signaturePad.current) throw new Error('Signature pad not found');
|
|
@@ -24443,11 +24482,11 @@
|
|
|
24443
24482
|
setTimeout(function () {
|
|
24444
24483
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
24445
24484
|
setTimeout(function () {
|
|
24446
|
-
useVideoSignatureStore.getState().startRecording(
|
|
24485
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
24447
24486
|
}, 100);
|
|
24448
24487
|
}, 100);
|
|
24449
24488
|
}
|
|
24450
|
-
}, [
|
|
24489
|
+
}, [captureAudio, restartVideoOnSignaturePadCleared]);
|
|
24451
24490
|
return /*#__PURE__*/React.createElement(Component, _assign({}, props, {
|
|
24452
24491
|
faceGuideStatus: status,
|
|
24453
24492
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
@@ -24801,12 +24840,10 @@
|
|
|
24801
24840
|
_9 = _7.height,
|
|
24802
24841
|
height = _9 === void 0 ? 1 : _9;
|
|
24803
24842
|
var _10 = useCameraStore(),
|
|
24804
|
-
camera = _10.camera,
|
|
24805
24843
|
videoRef = _10.videoRef,
|
|
24806
24844
|
videoLoaded = _10.videoLoaded,
|
|
24807
24845
|
cameraReady = _10.cameraReady,
|
|
24808
24846
|
microphoneReady = _10.microphoneReady,
|
|
24809
|
-
audioStream = _10.audioStream,
|
|
24810
24847
|
isRearFacing = _10.isRearFacing,
|
|
24811
24848
|
releaseCameraAccess = _10.releaseCameraAccess;
|
|
24812
24849
|
var _11 = React.useState([]),
|
|
@@ -24848,8 +24885,8 @@
|
|
|
24848
24885
|
countdownRemaining = _18[0],
|
|
24849
24886
|
setCountdownRemaining = _18[1];
|
|
24850
24887
|
React.useEffect(function () {
|
|
24851
|
-
if (
|
|
24852
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
24888
|
+
if (!isRecordingVideo && !videoUrl) {
|
|
24889
|
+
useVideoRecorderStore.getState().startRecordingVideo();
|
|
24853
24890
|
setVideoStartsAt(new Date());
|
|
24854
24891
|
}
|
|
24855
24892
|
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
@@ -24860,7 +24897,7 @@
|
|
|
24860
24897
|
releaseCameraAccess();
|
|
24861
24898
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
24862
24899
|
}
|
|
24863
|
-
}, [
|
|
24900
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, releaseCameraAccess, videoUrl]);
|
|
24864
24901
|
React.useEffect(function () {
|
|
24865
24902
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped || !!readTextPrompt && !microphoneReady) {
|
|
24866
24903
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -24955,14 +24992,14 @@
|
|
|
24955
24992
|
var _a;
|
|
24956
24993
|
if (translatedText) {
|
|
24957
24994
|
setRequestedAction('READ_TEXT');
|
|
24958
|
-
useVideoRecorderStore.getState().startRecordingAudio(
|
|
24995
|
+
useVideoRecorderStore.getState().startRecordingAudio();
|
|
24959
24996
|
setIdCaptureVideoAudioStartsAt(new Date().getTime() - ((_a = videoStartsAt === null || videoStartsAt === void 0 ? void 0 : videoStartsAt.getTime()) !== null && _a !== void 0 ? _a : 0));
|
|
24960
24997
|
var renderedTranslatedText = typeof translatedText === 'string' ? translatedText : server.renderToString(translatedText);
|
|
24961
24998
|
setExpectedAudioText(renderedTranslatedText);
|
|
24962
24999
|
} else {
|
|
24963
25000
|
useVideoRecorderStore.getState().stopRecordingVideo();
|
|
24964
25001
|
}
|
|
24965
|
-
}, [
|
|
25002
|
+
}, [setExpectedAudioText, setIdCaptureVideoAudioStartsAt, translatedText, videoStartsAt]);
|
|
24966
25003
|
var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
|
|
24967
25004
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
24968
25005
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
@@ -25594,36 +25631,36 @@
|
|
|
25594
25631
|
};
|
|
25595
25632
|
|
|
25596
25633
|
function CompositeWizard(_a) {
|
|
25597
|
-
var _b
|
|
25634
|
+
var _b;
|
|
25598
25635
|
var userChecks = _a.checks,
|
|
25599
|
-
|
|
25600
|
-
idCaptureProps =
|
|
25601
|
-
|
|
25602
|
-
faceLivenessProps =
|
|
25636
|
+
_c = _a.idCaptureProps,
|
|
25637
|
+
idCaptureProps = _c === void 0 ? {} : _c,
|
|
25638
|
+
_d = _a.faceLivenessProps,
|
|
25639
|
+
faceLivenessProps = _d === void 0 ? {} : _d,
|
|
25603
25640
|
additionalDocumentCaptureProps = _a.additionalDocumentCaptureProps,
|
|
25604
|
-
|
|
25605
|
-
signatureCaptureProps =
|
|
25606
|
-
|
|
25607
|
-
videoSignatureCaptureProps =
|
|
25608
|
-
|
|
25609
|
-
videoIdCaptureProps =
|
|
25610
|
-
|
|
25611
|
-
captureSignature =
|
|
25612
|
-
|
|
25613
|
-
captureSignatureVideo =
|
|
25641
|
+
_e = _a.signatureCaptureProps,
|
|
25642
|
+
signatureCaptureProps = _e === void 0 ? {} : _e,
|
|
25643
|
+
_f = _a.videoSignatureCaptureProps,
|
|
25644
|
+
videoSignatureCaptureProps = _f === void 0 ? {} : _f,
|
|
25645
|
+
_g = _a.videoIdCaptureProps,
|
|
25646
|
+
videoIdCaptureProps = _g === void 0 ? {} : _g,
|
|
25647
|
+
_h = _a.captureSignature,
|
|
25648
|
+
captureSignature = _h === void 0 ? false : _h,
|
|
25649
|
+
_j = _a.captureSignatureVideo,
|
|
25650
|
+
captureSignatureVideo = _j === void 0 ? false : _j,
|
|
25614
25651
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
25615
25652
|
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
25616
25653
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
25617
|
-
|
|
25618
|
-
debugMode =
|
|
25619
|
-
var
|
|
25620
|
-
submit =
|
|
25621
|
-
submissionStatus =
|
|
25622
|
-
setSignatureData =
|
|
25623
|
-
setAdditionalDocuments =
|
|
25624
|
-
var
|
|
25625
|
-
checkIndex =
|
|
25626
|
-
setCheckIndex =
|
|
25654
|
+
_k = _a.debugMode,
|
|
25655
|
+
debugMode = _k === void 0 ? false : _k;
|
|
25656
|
+
var _l = React.useContext(SubmissionContext),
|
|
25657
|
+
submit = _l.submit,
|
|
25658
|
+
submissionStatus = _l.submissionStatus,
|
|
25659
|
+
setSignatureData = _l.setSignatureData,
|
|
25660
|
+
setAdditionalDocuments = _l.setAdditionalDocuments;
|
|
25661
|
+
var _m = React.useState(0),
|
|
25662
|
+
checkIndex = _m[0],
|
|
25663
|
+
setCheckIndex = _m[1];
|
|
25627
25664
|
var checks = React.useMemo(function () {
|
|
25628
25665
|
var _a, _b;
|
|
25629
25666
|
var checks = __spreadArray([], userChecks, true);
|
|
@@ -25730,24 +25767,13 @@
|
|
|
25730
25767
|
var shouldLoadIdCaptureModels = !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.forceFallbackMode) && !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.allowUploadingDocumentsFromStorage);
|
|
25731
25768
|
switch (checks[checkIndex]) {
|
|
25732
25769
|
case 'IdCapture':
|
|
25733
|
-
return /*#__PURE__*/React.createElement(
|
|
25770
|
+
return /*#__PURE__*/React.createElement(IdCaptureWizardWithProviders, _assign({}, idCaptureProps, {
|
|
25734
25771
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
25735
25772
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
25736
25773
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
25737
|
-
|
|
25738
|
-
classNames: (_c = idCaptureProps.classNames) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider,
|
|
25739
|
-
verbiage: (_d = idCaptureProps.verbiage) === null || _d === void 0 ? void 0 : _d.cameraStoreProvider
|
|
25740
|
-
}, /*#__PURE__*/React.createElement(IdCaptureModelsProvider, {
|
|
25741
|
-
autoStart: false,
|
|
25742
|
-
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
25743
|
-
documentDetectionModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.documentDetectionModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
25744
|
-
focusModelUrl: (_h = (_g = idCaptureProps.assets) === null || _g === void 0 ? void 0 : _g.focusModelUrl) !== null && _h !== void 0 ? _h : '',
|
|
25745
|
-
onModelError: idCaptureProps.onModelError,
|
|
25746
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
25747
|
-
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
25748
|
-
}, /*#__PURE__*/React.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
25774
|
+
shouldLoadIdCaptureModels: shouldLoadIdCaptureModels,
|
|
25749
25775
|
onSuccess: onIdCaptureSuccess
|
|
25750
|
-
}))
|
|
25776
|
+
}));
|
|
25751
25777
|
case 'VideoIdCapture':
|
|
25752
25778
|
return /*#__PURE__*/React.createElement(VideoIdWizard, _assign({}, videoIdCaptureProps, {
|
|
25753
25779
|
onComplete: onVideoIdCaptureComplete,
|
|
@@ -25756,21 +25782,12 @@
|
|
|
25756
25782
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
25757
25783
|
}));
|
|
25758
25784
|
case 'FaceLiveness':
|
|
25759
|
-
return /*#__PURE__*/React.createElement(
|
|
25760
|
-
preferFrontFacingCamera: true,
|
|
25761
|
-
preferIphoneContinuityCamera: false,
|
|
25785
|
+
return /*#__PURE__*/React.createElement(FaceLivenessWizardWithProviders, _assign({}, faceLivenessProps, {
|
|
25762
25786
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
25763
25787
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
25764
25788
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
25765
|
-
classNames: (_j = faceLivenessProps.classNames) === null || _j === void 0 ? void 0 : _j.cameraStoreProvider,
|
|
25766
|
-
verbiage: (_k = faceLivenessProps.verbiage) === null || _k === void 0 ? void 0 : _k.cameraStoreProvider
|
|
25767
|
-
}, /*#__PURE__*/React.createElement(SelfieGuidanceModelsProvider, {
|
|
25768
|
-
autoStart: false,
|
|
25769
|
-
onModelError: faceLivenessProps.onModelError,
|
|
25770
|
-
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
25771
|
-
}, /*#__PURE__*/React.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps, {
|
|
25772
25789
|
onComplete: onFaceLivenessComplete
|
|
25773
|
-
}))
|
|
25790
|
+
}));
|
|
25774
25791
|
case 'SignatureCapture':
|
|
25775
25792
|
return /*#__PURE__*/React.createElement(SignatureCapture, _assign({}, signatureCaptureProps, {
|
|
25776
25793
|
onAccept: onSignatureCaptureSuccess
|