idmission-web-sdk 2.3.58 → 2.3.59
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/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 +161 -150
- 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 +161 -150
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +161 -150
- 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
|
@@ -236,7 +236,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
236
236
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
var webSdkVersion = '2.3.
|
|
239
|
+
var webSdkVersion = '2.3.59';
|
|
240
240
|
|
|
241
241
|
function getPlatform() {
|
|
242
242
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -3672,8 +3672,8 @@ function obtainCameraAccess(stream, deviceLabel, video) {
|
|
|
3672
3672
|
release: release
|
|
3673
3673
|
};
|
|
3674
3674
|
log('camera access granted');
|
|
3675
|
-
if (video) video.srcObject = stream
|
|
3676
|
-
log('video source initialized')
|
|
3675
|
+
// if (video) video.srcObject = stream
|
|
3676
|
+
// log('video source initialized')
|
|
3677
3677
|
return currentCamera;
|
|
3678
3678
|
}
|
|
3679
3679
|
function releaseCameraAccess() {
|
|
@@ -4806,24 +4806,24 @@ function useTranslations(verbiage, fallbacks) {
|
|
|
4806
4806
|
}, [fallbacks, i18n.language, t, verbiage]);
|
|
4807
4807
|
}
|
|
4808
4808
|
|
|
4809
|
+
var camera = null;
|
|
4810
|
+
var videoStream = null;
|
|
4811
|
+
var audioStream = null;
|
|
4809
4812
|
var initialState$6 = {
|
|
4810
4813
|
videoRef: {
|
|
4811
4814
|
current: null
|
|
4812
4815
|
},
|
|
4813
4816
|
videoLoaded: false,
|
|
4814
|
-
videoStream: null,
|
|
4815
4817
|
videoDevice: null,
|
|
4816
4818
|
videoWidth: 0,
|
|
4817
4819
|
videoHeight: 0,
|
|
4818
4820
|
isRearFacing: false,
|
|
4819
|
-
camera: null,
|
|
4820
4821
|
cameraReady: false,
|
|
4821
4822
|
cameraAccessDenied: false,
|
|
4822
4823
|
iphoneContinuityCameraAvailable: false,
|
|
4823
4824
|
iphoneContinuityCameraDenied: false,
|
|
4824
4825
|
preferIphoneContinuityCamera: true,
|
|
4825
4826
|
cameraTamperingDetected: false,
|
|
4826
|
-
audioStream: null,
|
|
4827
4827
|
microphoneReady: false,
|
|
4828
4828
|
microphoneAccessDenied: false
|
|
4829
4829
|
};
|
|
@@ -4837,8 +4837,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4837
4837
|
return set(config);
|
|
4838
4838
|
},
|
|
4839
4839
|
onVideoMounted: function onVideoMounted(e) {
|
|
4840
|
-
var
|
|
4841
|
-
var selectedVideoStreamId = (_a = get().videoStream) === null || _a === void 0 ? void 0 : _a.id;
|
|
4840
|
+
var selectedVideoStreamId = videoStream === null || videoStream === void 0 ? void 0 : videoStream.id;
|
|
4842
4841
|
if (!selectedVideoStreamId) return;
|
|
4843
4842
|
var srcObject = e.currentTarget.srcObject;
|
|
4844
4843
|
if (srcObject.id === selectedVideoStreamId) {
|
|
@@ -4858,19 +4857,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4858
4857
|
},
|
|
4859
4858
|
requestCameraAccess: function requestCameraAccess() {
|
|
4860
4859
|
return __awaiter(this, void 0, void 0, function () {
|
|
4861
|
-
var _a, videoRef, releaseCameraAccess, preferFrontFacingCamera, preferIphoneContinuityCamera, iphoneContinuityCameraDenied, availableCameras, selectedCamera, platform_1, iphoneContinuityCamera, constraints, stream_1, e_1, e_2, handleStreamEnded_1, videoTrack_1,
|
|
4862
|
-
var _b, _c, _d;
|
|
4863
|
-
return __generator(this, function (
|
|
4864
|
-
switch (
|
|
4860
|
+
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;
|
|
4861
|
+
var _b, _c, _d, _e;
|
|
4862
|
+
return __generator(this, function (_f) {
|
|
4863
|
+
switch (_f.label) {
|
|
4865
4864
|
case 0:
|
|
4866
4865
|
_a = get(), videoRef = _a.videoRef, releaseCameraAccess = _a.releaseCameraAccess, preferFrontFacingCamera = _a.preferFrontFacingCamera, preferIphoneContinuityCamera = _a.preferIphoneContinuityCamera, iphoneContinuityCameraDenied = _a.iphoneContinuityCameraDenied;
|
|
4867
4866
|
releaseCameraAccess();
|
|
4868
|
-
|
|
4867
|
+
_f.label = 1;
|
|
4869
4868
|
case 1:
|
|
4870
|
-
|
|
4869
|
+
_f.trys.push([1, 11,, 12]);
|
|
4871
4870
|
return [4 /*yield*/, listAvailableCameras()];
|
|
4872
4871
|
case 2:
|
|
4873
|
-
availableCameras =
|
|
4872
|
+
availableCameras = _f.sent();
|
|
4874
4873
|
selectedCamera = void 0;
|
|
4875
4874
|
debug('availableCameras', availableCameras);
|
|
4876
4875
|
platform_1 = getPlatform();
|
|
@@ -4940,16 +4939,16 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4940
4939
|
};
|
|
4941
4940
|
}
|
|
4942
4941
|
stream_1 = null;
|
|
4943
|
-
|
|
4942
|
+
_f.label = 3;
|
|
4944
4943
|
case 3:
|
|
4945
|
-
|
|
4944
|
+
_f.trys.push([3, 5,, 6]);
|
|
4946
4945
|
debug('obtaining camera access with constraints', constraints);
|
|
4947
4946
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia(constraints)];
|
|
4948
4947
|
case 4:
|
|
4949
|
-
stream_1 =
|
|
4948
|
+
stream_1 = _f.sent();
|
|
4950
4949
|
return [3 /*break*/, 6];
|
|
4951
4950
|
case 5:
|
|
4952
|
-
e_1 =
|
|
4951
|
+
e_1 = _f.sent();
|
|
4953
4952
|
if (e_1.name === 'NotAllowedError') {
|
|
4954
4953
|
if (preferIphoneContinuityCamera) {
|
|
4955
4954
|
set({
|
|
@@ -4966,19 +4965,19 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4966
4965
|
return [3 /*break*/, 6];
|
|
4967
4966
|
case 6:
|
|
4968
4967
|
if (!!stream_1) return [3 /*break*/, 10];
|
|
4969
|
-
|
|
4968
|
+
_f.label = 7;
|
|
4970
4969
|
case 7:
|
|
4971
|
-
|
|
4970
|
+
_f.trys.push([7, 9,, 10]);
|
|
4972
4971
|
return [4 /*yield*/, navigator.mediaDevices.getUserMedia({
|
|
4973
4972
|
audio: false,
|
|
4974
4973
|
video: true
|
|
4975
4974
|
})];
|
|
4976
4975
|
case 8:
|
|
4977
|
-
stream_1 =
|
|
4976
|
+
stream_1 = _f.sent();
|
|
4978
4977
|
debug('opened stream with no width and height constraints');
|
|
4979
4978
|
return [3 /*break*/, 10];
|
|
4980
4979
|
case 9:
|
|
4981
|
-
e_2 =
|
|
4980
|
+
e_2 = _f.sent();
|
|
4982
4981
|
debug('cannot open stream at all', e_2);
|
|
4983
4982
|
return [3 /*break*/, 10];
|
|
4984
4983
|
case 10:
|
|
@@ -4990,8 +4989,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
4990
4989
|
handleStreamEnded_1 = function handleStreamEnded_1() {
|
|
4991
4990
|
if (preferIphoneContinuityCamera && get().iphoneContinuityCameraAvailable) {
|
|
4992
4991
|
debug('someone unplugged the continuity camera');
|
|
4992
|
+
videoStream = null;
|
|
4993
4993
|
set({
|
|
4994
|
-
videoStream: null,
|
|
4995
4994
|
videoDevice: null,
|
|
4996
4995
|
cameraReady: false,
|
|
4997
4996
|
iphoneContinuityCameraAvailable: false,
|
|
@@ -5000,9 +4999,9 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5000
4999
|
get().requestCameraAccess();
|
|
5001
5000
|
} else {
|
|
5002
5001
|
debug('someone unplugged the webcam');
|
|
5003
|
-
releaseCameraAccess();
|
|
5002
|
+
get().releaseCameraAccess();
|
|
5003
|
+
videoStream = null;
|
|
5004
5004
|
set({
|
|
5005
|
-
videoStream: null,
|
|
5006
5005
|
videoDevice: null,
|
|
5007
5006
|
videoLoaded: false,
|
|
5008
5007
|
cameraReady: false,
|
|
@@ -5013,25 +5012,26 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5013
5012
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleStreamEnded_1);
|
|
5014
5013
|
videoTrack_1 = stream_1.getVideoTracks()[0];
|
|
5015
5014
|
videoTrack_1.onended = handleStreamEnded_1;
|
|
5016
|
-
|
|
5015
|
+
camera = obtainCameraAccess(stream_1, selectedCamera.label, videoRef.current);
|
|
5017
5016
|
setTimeout(function () {
|
|
5017
|
+
var _a;
|
|
5018
5018
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5019
5019
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5020
5020
|
videoTrack_1.onmute = function () {
|
|
5021
5021
|
if (videoTrack_1.readyState !== 'live') handleStreamEnded_1();
|
|
5022
5022
|
};
|
|
5023
|
+
videoStream = stream_1;
|
|
5024
|
+
var isRearFacing = (_a = camera === null || camera === void 0 ? void 0 : camera.isRearFacing) !== null && _a !== void 0 ? _a : false;
|
|
5023
5025
|
set({
|
|
5024
|
-
camera: camera_1,
|
|
5025
5026
|
cameraReady: true,
|
|
5026
5027
|
cameraAccessDenied: false,
|
|
5027
|
-
isRearFacing:
|
|
5028
|
-
videoStream: stream_1
|
|
5028
|
+
isRearFacing: isRearFacing
|
|
5029
5029
|
});
|
|
5030
5030
|
}, 500);
|
|
5031
5031
|
return [3 /*break*/, 12];
|
|
5032
5032
|
case 11:
|
|
5033
|
-
e_3 =
|
|
5034
|
-
if (e_3.name === 'NotAllowedError') {
|
|
5033
|
+
e_3 = _f.sent();
|
|
5034
|
+
if (e_3.name === 'NotAllowedError' || ((_e = e_3.message) === null || _e === void 0 ? void 0 : _e.includes('Could not start video source'))) {
|
|
5035
5035
|
error('camera access has been blocked by the user', e_3);
|
|
5036
5036
|
set({
|
|
5037
5037
|
cameraAccessDenied: true
|
|
@@ -5049,17 +5049,18 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5049
5049
|
},
|
|
5050
5050
|
releaseCameraAccess: function releaseCameraAccess() {
|
|
5051
5051
|
return __awaiter(this, void 0, void 0, function () {
|
|
5052
|
-
var camera;
|
|
5053
5052
|
return __generator(this, function (_a) {
|
|
5054
|
-
camera = get().camera;
|
|
5055
5053
|
if (!camera) return [2 /*return*/];
|
|
5056
5054
|
camera.release();
|
|
5055
|
+
camera = null;
|
|
5056
|
+
videoStream === null || videoStream === void 0 ? void 0 : videoStream.getTracks().forEach(function (track) {
|
|
5057
|
+
track.stop();
|
|
5058
|
+
});
|
|
5059
|
+
videoStream = null;
|
|
5057
5060
|
set({
|
|
5058
|
-
camera: null,
|
|
5059
5061
|
cameraReady: false,
|
|
5060
5062
|
cameraAccessDenied: false,
|
|
5061
5063
|
videoDevice: null,
|
|
5062
|
-
videoStream: null,
|
|
5063
5064
|
videoLoaded: false
|
|
5064
5065
|
});
|
|
5065
5066
|
return [2 /*return*/];
|
|
@@ -5088,8 +5089,8 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5088
5089
|
// iOS 17 has a strange behavior where the video track flickers between muted and unmuted
|
|
5089
5090
|
// when the camera access is being requested. This delay is a workaround for that.
|
|
5090
5091
|
setTimeout(function () {
|
|
5092
|
+
audioStream = stream_2;
|
|
5091
5093
|
set({
|
|
5092
|
-
audioStream: stream_2,
|
|
5093
5094
|
microphoneReady: true,
|
|
5094
5095
|
microphoneAccessDenied: false
|
|
5095
5096
|
});
|
|
@@ -5098,6 +5099,7 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5098
5099
|
microphoneReady: false,
|
|
5099
5100
|
microphoneAccessDenied: true
|
|
5100
5101
|
});
|
|
5102
|
+
get().releaseMicrophoneAccess();
|
|
5101
5103
|
};
|
|
5102
5104
|
var track = stream_2.getAudioTracks()[0];
|
|
5103
5105
|
track.onended = handleStreamEnded;
|
|
@@ -5121,14 +5123,13 @@ var createCameraStore = function createCameraStore(config) {
|
|
|
5121
5123
|
},
|
|
5122
5124
|
releaseMicrophoneAccess: function releaseMicrophoneAccess() {
|
|
5123
5125
|
var _a;
|
|
5124
|
-
var audioStream = get().audioStream;
|
|
5125
5126
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
5126
5127
|
audioStream === null || audioStream === void 0 ? void 0 : audioStream.getAudioTracks().forEach(function (track) {
|
|
5127
5128
|
var _a;
|
|
5128
5129
|
(_a = track.stop) === null || _a === void 0 ? void 0 : _a.call(track);
|
|
5129
5130
|
});
|
|
5131
|
+
audioStream = null;
|
|
5130
5132
|
set({
|
|
5131
|
-
audioStream: null,
|
|
5132
5133
|
microphoneReady: false,
|
|
5133
5134
|
microphoneAccessDenied: false
|
|
5134
5135
|
});
|
|
@@ -6666,15 +6667,13 @@ var IdCapture = function IdCapture(_a) {
|
|
|
6666
6667
|
_q = _o.height,
|
|
6667
6668
|
height = _q === void 0 ? 1 : _q;
|
|
6668
6669
|
var state = useIdCaptureStore();
|
|
6669
|
-
var
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
focusPredictionTime = _s.focusPredictionTime,
|
|
6677
|
-
getBestFrame = _s.getBestFrame;
|
|
6670
|
+
var isRearFacing = useCameraStore().isRearFacing;
|
|
6671
|
+
var _r = React.useContext(IdCaptureModelsContext),
|
|
6672
|
+
modelsReady = _r.ready,
|
|
6673
|
+
setThresholds = _r.setThresholds,
|
|
6674
|
+
detectionTime = _r.detectionTime,
|
|
6675
|
+
focusPredictionTime = _r.focusPredictionTime,
|
|
6676
|
+
getBestFrame = _r.getBestFrame;
|
|
6678
6677
|
React.useEffect(function () {
|
|
6679
6678
|
return dispatchIdCaptureAction({
|
|
6680
6679
|
type: 'captureInitialized'
|
|
@@ -9104,9 +9103,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9104
9103
|
var _c = React.useReducer(documentCaptureStateReducer, documentCaptureInitialState),
|
|
9105
9104
|
state = _c[0],
|
|
9106
9105
|
dispatch = _c[1];
|
|
9107
|
-
var
|
|
9108
|
-
videoStream = _d.videoStream,
|
|
9109
|
-
videoRef = _d.videoRef;
|
|
9106
|
+
var videoRef = useCameraStore().videoRef;
|
|
9110
9107
|
var uploadDocument = React.useContext(SubmissionContext).uploadDocument;
|
|
9111
9108
|
var uploadCapturedDocument = React.useCallback(function (content, filetype) {
|
|
9112
9109
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -9200,7 +9197,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9200
9197
|
}, [onResize]);
|
|
9201
9198
|
var videoTag = videoRef.current;
|
|
9202
9199
|
React.useEffect(function () {
|
|
9203
|
-
if (!state.capturing
|
|
9200
|
+
if (!state.capturing) return;
|
|
9204
9201
|
function onComplete(content) {
|
|
9205
9202
|
if (!content) return;
|
|
9206
9203
|
var contentUrl = URL.createObjectURL(content);
|
|
@@ -9217,7 +9214,7 @@ var DocumentCaptureStateProvider = function DocumentCaptureStateProvider(_a) {
|
|
|
9217
9214
|
drawToCanvas(canvas, videoTag);
|
|
9218
9215
|
canvas.toBlob(onComplete);
|
|
9219
9216
|
}
|
|
9220
|
-
}, [state.capturing,
|
|
9217
|
+
}, [state.capturing, videoTag]);
|
|
9221
9218
|
var stateWithActions = React.useMemo(function () {
|
|
9222
9219
|
return _assign(_assign({}, state), {
|
|
9223
9220
|
uploadCapturedDocument: uploadCapturedDocument
|
|
@@ -9346,29 +9343,28 @@ var templateObject_1$u;
|
|
|
9346
9343
|
var CameraVideoTag = function CameraVideoTag(props) {
|
|
9347
9344
|
var _a = useCameraStore(shallow.useShallow(function (store) {
|
|
9348
9345
|
return {
|
|
9346
|
+
cameraReady: store.cameraReady,
|
|
9349
9347
|
videoRef: store.videoRef,
|
|
9350
|
-
videoStream: store.videoStream,
|
|
9351
9348
|
onVideoMounted: store.onVideoMounted,
|
|
9352
9349
|
isRearFacing: store.isRearFacing
|
|
9353
9350
|
};
|
|
9354
9351
|
})),
|
|
9352
|
+
cameraReady = _a.cameraReady,
|
|
9355
9353
|
videoRef = _a.videoRef,
|
|
9356
|
-
videoStream = _a.videoStream,
|
|
9357
9354
|
onVideoMounted = _a.onVideoMounted,
|
|
9358
9355
|
isRearFacing = _a.isRearFacing;
|
|
9359
|
-
React.useEffect(function
|
|
9360
|
-
if (videoRef.current
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
}, [videoStream, videoRef]);
|
|
9356
|
+
React.useEffect(function () {
|
|
9357
|
+
if (!cameraReady || !videoRef.current) return;
|
|
9358
|
+
debug('attaching camera stream to video tag');
|
|
9359
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
9360
|
+
videoRef.current.srcObject = videoStream;
|
|
9361
|
+
}, [cameraReady, videoRef]);
|
|
9366
9362
|
return /*#__PURE__*/React__namespace.default.createElement(FullscreenVideoTag, _assign({
|
|
9367
9363
|
autoPlay: true,
|
|
9368
9364
|
playsInline: true,
|
|
9369
9365
|
muted: true,
|
|
9370
9366
|
ref: videoRef,
|
|
9371
|
-
|
|
9367
|
+
onCanPlay: onVideoMounted,
|
|
9372
9368
|
"$isRearFacing": isRearFacing
|
|
9373
9369
|
}, props));
|
|
9374
9370
|
};
|
|
@@ -9405,7 +9401,6 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9405
9401
|
content = _k.content,
|
|
9406
9402
|
uploadState = _k.uploadState;
|
|
9407
9403
|
var _l = useCameraStore(),
|
|
9408
|
-
videoStream = _l.videoStream,
|
|
9409
9404
|
cameraReady = _l.cameraReady,
|
|
9410
9405
|
cameraAccessDenied = _l.cameraAccessDenied,
|
|
9411
9406
|
requestCameraAccess = _l.requestCameraAccess;
|
|
@@ -9420,7 +9415,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
9420
9415
|
// and the user hasn't passed a media blob for the current document...
|
|
9421
9416
|
!cameraAccessRequested &&
|
|
9422
9417
|
// and we haven't already tried to force a camera request...
|
|
9423
|
-
!
|
|
9418
|
+
!cameraReady; // and we don't already have camera access.
|
|
9424
9419
|
React.useEffect(function requestCameraAccessIfNeeded() {
|
|
9425
9420
|
if (!cameraAccessNeeded) return;
|
|
9426
9421
|
setCameraAccessRequested(true);
|
|
@@ -10845,6 +10840,30 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
10845
10840
|
debugMode: debugMode
|
|
10846
10841
|
})));
|
|
10847
10842
|
};
|
|
10843
|
+
function IdCaptureWizardWithProviders(_a) {
|
|
10844
|
+
var _b, _c, _d, _e, _f, _g;
|
|
10845
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
10846
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
10847
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
10848
|
+
shouldLoadIdCaptureModels = _a.shouldLoadIdCaptureModels,
|
|
10849
|
+
idCaptureProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied", "shouldLoadIdCaptureModels"]);
|
|
10850
|
+
return /*#__PURE__*/React__namespace.default.createElement(CameraStoreProvider, {
|
|
10851
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
10852
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
10853
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
10854
|
+
requestAccessAutomatically: shouldLoadIdCaptureModels,
|
|
10855
|
+
classNames: (_b = idCaptureProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
10856
|
+
verbiage: (_c = idCaptureProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
10857
|
+
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProvider, {
|
|
10858
|
+
autoStart: false,
|
|
10859
|
+
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
10860
|
+
documentDetectionModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.documentDetectionModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
10861
|
+
focusModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.focusModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
10862
|
+
onModelError: idCaptureProps.onModelError,
|
|
10863
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
10864
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
10865
|
+
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps))))));
|
|
10866
|
+
}
|
|
10848
10867
|
|
|
10849
10868
|
function SelfieCaptureLoadingGraphic(_a) {
|
|
10850
10869
|
var _b, _c, _d;
|
|
@@ -11858,9 +11877,6 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
11858
11877
|
prediction = _o.prediction,
|
|
11859
11878
|
dispatch = _m[1];
|
|
11860
11879
|
var lastPredictionCanvas = React.useRef(null);
|
|
11861
|
-
var camera = useCameraStore(shallow.useShallow(function (state) {
|
|
11862
|
-
return state.camera;
|
|
11863
|
-
}));
|
|
11864
11880
|
var _p = React.useContext(SelfieGuidanceModelsContext),
|
|
11865
11881
|
onPredictionMade = _p.onPredictionMade,
|
|
11866
11882
|
canvasRef = _p.canvasRef,
|
|
@@ -13036,6 +13052,26 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
13036
13052
|
waitForIdCaptureModels: waitForIdCaptureModels
|
|
13037
13053
|
})));
|
|
13038
13054
|
};
|
|
13055
|
+
function FaceLivenessWizardWithProviders(_a) {
|
|
13056
|
+
var _b, _c;
|
|
13057
|
+
var onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13058
|
+
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
13059
|
+
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
13060
|
+
faceLivenessProps = __rest(_a, ["onCameraAccessDenied", "onCameraTamperingDetected", "onMicrophoneAccessDenied"]);
|
|
13061
|
+
return /*#__PURE__*/React__namespace.default.createElement(CameraStoreProvider, {
|
|
13062
|
+
preferFrontFacingCamera: true,
|
|
13063
|
+
preferIphoneContinuityCamera: false,
|
|
13064
|
+
onCameraAccessDenied: onCameraAccessDenied,
|
|
13065
|
+
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
13066
|
+
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
13067
|
+
classNames: (_b = faceLivenessProps.classNames) === null || _b === void 0 ? void 0 : _b.cameraStoreProvider,
|
|
13068
|
+
verbiage: (_c = faceLivenessProps.verbiage) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider
|
|
13069
|
+
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
13070
|
+
autoStart: false,
|
|
13071
|
+
onModelError: faceLivenessProps.onModelError,
|
|
13072
|
+
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
13073
|
+
}, /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps))));
|
|
13074
|
+
}
|
|
13039
13075
|
|
|
13040
13076
|
var SubmissionSuccess = function SubmissionSuccess() {
|
|
13041
13077
|
var _a = React.useContext(SubmissionContext),
|
|
@@ -13452,12 +13488,16 @@ var initialState$2 = {
|
|
|
13452
13488
|
};
|
|
13453
13489
|
var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set, get) {
|
|
13454
13490
|
return _assign(_assign({}, initialState$2), {
|
|
13455
|
-
startRecordingVideo: function startRecordingVideo(
|
|
13491
|
+
startRecordingVideo: function startRecordingVideo(captureAudio) {
|
|
13456
13492
|
var _a, _b, _c;
|
|
13493
|
+
if (captureAudio === void 0) {
|
|
13494
|
+
captureAudio = false;
|
|
13495
|
+
}
|
|
13496
|
+
if (!camera) throw new Error('Camera not found');
|
|
13457
13497
|
var _d = get(),
|
|
13458
13498
|
mergeAVStreams = _d.mergeAVStreams,
|
|
13459
13499
|
startRecordingAudio = _d.startRecordingAudio;
|
|
13460
|
-
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;
|
|
13500
|
+
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;
|
|
13461
13501
|
if (!videoStream) return;
|
|
13462
13502
|
clearVideoChunks();
|
|
13463
13503
|
videoRecorder = null;
|
|
@@ -13485,8 +13525,8 @@ var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set,
|
|
|
13485
13525
|
// TODO: figure out what to do here
|
|
13486
13526
|
}
|
|
13487
13527
|
}, 100);
|
|
13488
|
-
if (
|
|
13489
|
-
startRecordingAudio(
|
|
13528
|
+
if (captureAudio && !mergeAVStreams) {
|
|
13529
|
+
startRecordingAudio();
|
|
13490
13530
|
}
|
|
13491
13531
|
},
|
|
13492
13532
|
stopRecordingVideo: function stopRecordingVideo() {
|
|
@@ -13497,7 +13537,7 @@ var useVideoRecorderStore = zustand.create()(middleware.devtools(function (set,
|
|
|
13497
13537
|
videoRecorder === null || videoRecorder === void 0 ? void 0 : videoRecorder.stop(); // if you call this while state === 'inactive', an exception is thrown.
|
|
13498
13538
|
}
|
|
13499
13539
|
},
|
|
13500
|
-
startRecordingAudio: function startRecordingAudio(
|
|
13540
|
+
startRecordingAudio: function startRecordingAudio() {
|
|
13501
13541
|
if (get().mergeAVStreams) return;
|
|
13502
13542
|
if (!audioStream) return;
|
|
13503
13543
|
clearAudioChunks();
|
|
@@ -13631,18 +13671,19 @@ var videoSignatureInitialState = {
|
|
|
13631
13671
|
};
|
|
13632
13672
|
var useVideoSignatureStore = zustand.create()(middleware.devtools(function (set, get) {
|
|
13633
13673
|
return _assign(_assign({}, videoSignatureInitialState), {
|
|
13634
|
-
startRecording: function startRecording(
|
|
13674
|
+
startRecording: function startRecording(captureAudio) {
|
|
13635
13675
|
var _a;
|
|
13636
13676
|
if (captureAudio === void 0) {
|
|
13637
13677
|
captureAudio = false;
|
|
13638
13678
|
}
|
|
13679
|
+
if (!camera) throw new Error('Camera not found');
|
|
13639
13680
|
// set our flag and clear whatever we have recorded so far.
|
|
13640
13681
|
set({
|
|
13641
13682
|
isRecording: true
|
|
13642
13683
|
});
|
|
13643
13684
|
signatureChunks = [];
|
|
13644
13685
|
// start recording video and audio
|
|
13645
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
13686
|
+
useVideoRecorderStore.getState().startRecordingVideo(captureAudio);
|
|
13646
13687
|
// start recording from the output canvas to capture the signature
|
|
13647
13688
|
var videoStream = get().outputCanvas.current.captureStream(24); // fps
|
|
13648
13689
|
var tracks = [videoStream.getVideoTracks()[0]];
|
|
@@ -13936,14 +13977,10 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13936
13977
|
debugMode = _l === void 0 ? false : _l;
|
|
13937
13978
|
var _m = useCameraStore(shallow.useShallow(function (state) {
|
|
13938
13979
|
return {
|
|
13939
|
-
camera: state.camera,
|
|
13940
|
-
audioStream: state.audioStream,
|
|
13941
13980
|
videoWidth: state.videoWidth,
|
|
13942
13981
|
videoHeight: state.videoHeight
|
|
13943
13982
|
};
|
|
13944
13983
|
})),
|
|
13945
|
-
camera = _m.camera,
|
|
13946
|
-
audioStream = _m.audioStream,
|
|
13947
13984
|
videoWidth = _m.videoWidth,
|
|
13948
13985
|
videoHeight = _m.videoHeight;
|
|
13949
13986
|
var _o = useSelfieGuidanceModelsContext(),
|
|
@@ -13951,8 +13988,6 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13951
13988
|
startHeadTracking = _o.start,
|
|
13952
13989
|
stopHeadTracking = _o.stop;
|
|
13953
13990
|
var _p = useVideoSignatureStore(),
|
|
13954
|
-
startRecording = _p.startRecording,
|
|
13955
|
-
stopRecording = _p.stopRecording,
|
|
13956
13991
|
clearRecordedData = _p.clearRecordedData,
|
|
13957
13992
|
isRecording = _p.isRecording;
|
|
13958
13993
|
React.useEffect(function () {
|
|
@@ -13961,10 +13996,11 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13961
13996
|
});
|
|
13962
13997
|
}, [onSignatureVideoCaptured]);
|
|
13963
13998
|
React.useEffect(function () {
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
|
|
13999
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14000
|
+
return function () {
|
|
14001
|
+
return useVideoSignatureStore.getState().stopRecording();
|
|
14002
|
+
};
|
|
14003
|
+
}, [captureAudio]);
|
|
13968
14004
|
React.useEffect(function () {
|
|
13969
14005
|
setTimeout(startHeadTracking, 1);
|
|
13970
14006
|
return stopHeadTracking;
|
|
@@ -13985,7 +14021,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13985
14021
|
setNumFramesWithoutFaces = _s[1];
|
|
13986
14022
|
onHeadTrackingPredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
13987
14023
|
var face = _a.face;
|
|
13988
|
-
if (
|
|
14024
|
+
if (headTrackingDisabled) return;
|
|
13989
14025
|
var leftEdge = videoWidth * headTrackingBoundaryPercentage;
|
|
13990
14026
|
var rightEdge = videoWidth * (1 - headTrackingBoundaryPercentage);
|
|
13991
14027
|
var topEdge = videoHeight * headTrackingBoundaryPercentage;
|
|
@@ -13996,7 +14032,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13996
14032
|
setNumFramesWithoutFaces(face ? 0 : function (n) {
|
|
13997
14033
|
return n + 1;
|
|
13998
14034
|
});
|
|
13999
|
-
}, [
|
|
14035
|
+
}, [headTrackingBoundaryPercentage, headTrackingBoundaryType, headTrackingDisabled, videoHeight, videoWidth]), 16));
|
|
14000
14036
|
var _t = useResizeObserver(),
|
|
14001
14037
|
ref = _t.ref,
|
|
14002
14038
|
_u = _t.width,
|
|
@@ -14039,7 +14075,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
14039
14075
|
face: lastFace,
|
|
14040
14076
|
scaling: debugScalingDetails,
|
|
14041
14077
|
color: headTrackingSatisfied ? 'green' : 'red'
|
|
14042
|
-
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ",
|
|
14078
|
+
}))), /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ", videoWidth, "x", videoHeight, /*#__PURE__*/React__namespace.default.createElement("br", null), "Recording: ", isRecording ? 'true' : 'false'))), /*#__PURE__*/React__namespace.default.createElement(ExitCaptureButton, {
|
|
14043
14079
|
onClick: onExit,
|
|
14044
14080
|
className: classNames.exitCaptureBtn
|
|
14045
14081
|
}));
|
|
@@ -14545,9 +14581,6 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14545
14581
|
component = _a.component,
|
|
14546
14582
|
props = __rest(_a, ["status", "restartVideoOnSignaturePadCleared", "captureAudio", "component"]);
|
|
14547
14583
|
var Component = component !== null && component !== void 0 ? component : VideoSignatureGuides;
|
|
14548
|
-
var _d = useCameraStore(),
|
|
14549
|
-
camera = _d.camera,
|
|
14550
|
-
audioStream = _d.audioStream;
|
|
14551
14584
|
var onAcceptBtnClicked = React.useCallback(function () {
|
|
14552
14585
|
var signaturePad = useVideoSignatureStore.getState().signaturePad;
|
|
14553
14586
|
if (!signaturePad.current) throw new Error('Signature pad not found');
|
|
@@ -14569,11 +14602,11 @@ function VideoSignatureWizardGuides(_a) {
|
|
|
14569
14602
|
setTimeout(function () {
|
|
14570
14603
|
useVideoSignatureStore.getState().clearRecordedData();
|
|
14571
14604
|
setTimeout(function () {
|
|
14572
|
-
useVideoSignatureStore.getState().startRecording(
|
|
14605
|
+
useVideoSignatureStore.getState().startRecording(captureAudio);
|
|
14573
14606
|
}, 100);
|
|
14574
14607
|
}, 100);
|
|
14575
14608
|
}
|
|
14576
|
-
}, [
|
|
14609
|
+
}, [captureAudio, restartVideoOnSignaturePadCleared]);
|
|
14577
14610
|
return /*#__PURE__*/React__namespace.default.createElement(Component, _assign({}, props, {
|
|
14578
14611
|
faceGuideStatus: status,
|
|
14579
14612
|
onAcceptBtnClicked: onAcceptBtnClicked,
|
|
@@ -14927,12 +14960,10 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14927
14960
|
_9 = _7.height,
|
|
14928
14961
|
height = _9 === void 0 ? 1 : _9;
|
|
14929
14962
|
var _10 = useCameraStore(),
|
|
14930
|
-
camera = _10.camera,
|
|
14931
14963
|
videoRef = _10.videoRef,
|
|
14932
14964
|
videoLoaded = _10.videoLoaded,
|
|
14933
14965
|
cameraReady = _10.cameraReady,
|
|
14934
14966
|
microphoneReady = _10.microphoneReady,
|
|
14935
|
-
audioStream = _10.audioStream,
|
|
14936
14967
|
isRearFacing = _10.isRearFacing,
|
|
14937
14968
|
releaseCameraAccess = _10.releaseCameraAccess;
|
|
14938
14969
|
var _11 = React.useState([]),
|
|
@@ -14974,8 +15005,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14974
15005
|
countdownRemaining = _18[0],
|
|
14975
15006
|
setCountdownRemaining = _18[1];
|
|
14976
15007
|
React.useEffect(function () {
|
|
14977
|
-
if (
|
|
14978
|
-
useVideoRecorderStore.getState().startRecordingVideo(
|
|
15008
|
+
if (!isRecordingVideo && !videoUrl) {
|
|
15009
|
+
useVideoRecorderStore.getState().startRecordingVideo();
|
|
14979
15010
|
setVideoStartsAt(new Date());
|
|
14980
15011
|
}
|
|
14981
15012
|
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
@@ -14986,7 +15017,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14986
15017
|
releaseCameraAccess();
|
|
14987
15018
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
14988
15019
|
}
|
|
14989
|
-
}, [
|
|
15020
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, releaseCameraAccess, videoUrl]);
|
|
14990
15021
|
React.useEffect(function () {
|
|
14991
15022
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped || !!readTextPrompt && !microphoneReady) {
|
|
14992
15023
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -15081,14 +15112,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
15081
15112
|
var _a;
|
|
15082
15113
|
if (translatedText) {
|
|
15083
15114
|
setRequestedAction('READ_TEXT');
|
|
15084
|
-
useVideoRecorderStore.getState().startRecordingAudio(
|
|
15115
|
+
useVideoRecorderStore.getState().startRecordingAudio();
|
|
15085
15116
|
setIdCaptureVideoAudioStartsAt(new Date().getTime() - ((_a = videoStartsAt === null || videoStartsAt === void 0 ? void 0 : videoStartsAt.getTime()) !== null && _a !== void 0 ? _a : 0));
|
|
15086
15117
|
var renderedTranslatedText = typeof translatedText === 'string' ? translatedText : server.renderToString(translatedText);
|
|
15087
15118
|
setExpectedAudioText(renderedTranslatedText);
|
|
15088
15119
|
} else {
|
|
15089
15120
|
useVideoRecorderStore.getState().stopRecordingVideo();
|
|
15090
15121
|
}
|
|
15091
|
-
}, [
|
|
15122
|
+
}, [setExpectedAudioText, setIdCaptureVideoAudioStartsAt, translatedText, videoStartsAt]);
|
|
15092
15123
|
var frameWidth = (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0;
|
|
15093
15124
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
15094
15125
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
@@ -15720,36 +15751,36 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
15720
15751
|
};
|
|
15721
15752
|
|
|
15722
15753
|
function CompositeWizard(_a) {
|
|
15723
|
-
var _b
|
|
15754
|
+
var _b;
|
|
15724
15755
|
var userChecks = _a.checks,
|
|
15725
|
-
|
|
15726
|
-
idCaptureProps =
|
|
15727
|
-
|
|
15728
|
-
faceLivenessProps =
|
|
15756
|
+
_c = _a.idCaptureProps,
|
|
15757
|
+
idCaptureProps = _c === void 0 ? {} : _c,
|
|
15758
|
+
_d = _a.faceLivenessProps,
|
|
15759
|
+
faceLivenessProps = _d === void 0 ? {} : _d,
|
|
15729
15760
|
additionalDocumentCaptureProps = _a.additionalDocumentCaptureProps,
|
|
15730
|
-
|
|
15731
|
-
signatureCaptureProps =
|
|
15732
|
-
|
|
15733
|
-
videoSignatureCaptureProps =
|
|
15734
|
-
|
|
15735
|
-
videoIdCaptureProps =
|
|
15736
|
-
|
|
15737
|
-
captureSignature =
|
|
15738
|
-
|
|
15739
|
-
captureSignatureVideo =
|
|
15761
|
+
_e = _a.signatureCaptureProps,
|
|
15762
|
+
signatureCaptureProps = _e === void 0 ? {} : _e,
|
|
15763
|
+
_f = _a.videoSignatureCaptureProps,
|
|
15764
|
+
videoSignatureCaptureProps = _f === void 0 ? {} : _f,
|
|
15765
|
+
_g = _a.videoIdCaptureProps,
|
|
15766
|
+
videoIdCaptureProps = _g === void 0 ? {} : _g,
|
|
15767
|
+
_h = _a.captureSignature,
|
|
15768
|
+
captureSignature = _h === void 0 ? false : _h,
|
|
15769
|
+
_j = _a.captureSignatureVideo,
|
|
15770
|
+
captureSignatureVideo = _j === void 0 ? false : _j,
|
|
15740
15771
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
15741
15772
|
onCameraTamperingDetected = _a.onCameraTamperingDetected,
|
|
15742
15773
|
onMicrophoneAccessDenied = _a.onMicrophoneAccessDenied,
|
|
15743
|
-
|
|
15744
|
-
debugMode =
|
|
15745
|
-
var
|
|
15746
|
-
submit =
|
|
15747
|
-
submissionStatus =
|
|
15748
|
-
setSignatureData =
|
|
15749
|
-
setAdditionalDocuments =
|
|
15750
|
-
var
|
|
15751
|
-
checkIndex =
|
|
15752
|
-
setCheckIndex =
|
|
15774
|
+
_k = _a.debugMode,
|
|
15775
|
+
debugMode = _k === void 0 ? false : _k;
|
|
15776
|
+
var _l = React.useContext(SubmissionContext),
|
|
15777
|
+
submit = _l.submit,
|
|
15778
|
+
submissionStatus = _l.submissionStatus,
|
|
15779
|
+
setSignatureData = _l.setSignatureData,
|
|
15780
|
+
setAdditionalDocuments = _l.setAdditionalDocuments;
|
|
15781
|
+
var _m = React.useState(0),
|
|
15782
|
+
checkIndex = _m[0],
|
|
15783
|
+
setCheckIndex = _m[1];
|
|
15753
15784
|
var checks = React.useMemo(function () {
|
|
15754
15785
|
var _a, _b;
|
|
15755
15786
|
var checks = __spreadArray([], userChecks, true);
|
|
@@ -15856,24 +15887,13 @@ function CompositeWizard(_a) {
|
|
|
15856
15887
|
var shouldLoadIdCaptureModels = !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.forceFallbackMode) && !(idCaptureProps === null || idCaptureProps === void 0 ? void 0 : idCaptureProps.allowUploadingDocumentsFromStorage);
|
|
15857
15888
|
switch (checks[checkIndex]) {
|
|
15858
15889
|
case 'IdCapture':
|
|
15859
|
-
return /*#__PURE__*/React__namespace.default.createElement(
|
|
15890
|
+
return /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizardWithProviders, _assign({}, idCaptureProps, {
|
|
15860
15891
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15861
15892
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15862
15893
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15863
|
-
|
|
15864
|
-
classNames: (_c = idCaptureProps.classNames) === null || _c === void 0 ? void 0 : _c.cameraStoreProvider,
|
|
15865
|
-
verbiage: (_d = idCaptureProps.verbiage) === null || _d === void 0 ? void 0 : _d.cameraStoreProvider
|
|
15866
|
-
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsProvider, {
|
|
15867
|
-
autoStart: false,
|
|
15868
|
-
shouldLoadModels: shouldLoadIdCaptureModels,
|
|
15869
|
-
documentDetectionModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.documentDetectionModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
15870
|
-
focusModelUrl: (_h = (_g = idCaptureProps.assets) === null || _g === void 0 ? void 0 : _g.focusModelUrl) !== null && _h !== void 0 ? _h : '',
|
|
15871
|
-
onModelError: idCaptureProps.onModelError,
|
|
15872
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
15873
|
-
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
15874
|
-
}, /*#__PURE__*/React__namespace.default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__namespace.default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
15894
|
+
shouldLoadIdCaptureModels: shouldLoadIdCaptureModels,
|
|
15875
15895
|
onSuccess: onIdCaptureSuccess
|
|
15876
|
-
}))
|
|
15896
|
+
}));
|
|
15877
15897
|
case 'VideoIdCapture':
|
|
15878
15898
|
return /*#__PURE__*/React__namespace.default.createElement(VideoIdWizard, _assign({}, videoIdCaptureProps, {
|
|
15879
15899
|
onComplete: onVideoIdCaptureComplete,
|
|
@@ -15882,21 +15902,12 @@ function CompositeWizard(_a) {
|
|
|
15882
15902
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
15883
15903
|
}));
|
|
15884
15904
|
case 'FaceLiveness':
|
|
15885
|
-
return /*#__PURE__*/React__namespace.default.createElement(
|
|
15886
|
-
preferFrontFacingCamera: true,
|
|
15887
|
-
preferIphoneContinuityCamera: false,
|
|
15905
|
+
return /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizardWithProviders, _assign({}, faceLivenessProps, {
|
|
15888
15906
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
15889
15907
|
onCameraTamperingDetected: onCameraTamperingDetected,
|
|
15890
15908
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
15891
|
-
classNames: (_j = faceLivenessProps.classNames) === null || _j === void 0 ? void 0 : _j.cameraStoreProvider,
|
|
15892
|
-
verbiage: (_k = faceLivenessProps.verbiage) === null || _k === void 0 ? void 0 : _k.cameraStoreProvider
|
|
15893
|
-
}, /*#__PURE__*/React__namespace.default.createElement(SelfieGuidanceModelsProvider, {
|
|
15894
|
-
autoStart: false,
|
|
15895
|
-
onModelError: faceLivenessProps.onModelError,
|
|
15896
|
-
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
15897
|
-
}, /*#__PURE__*/React__namespace.default.createElement(FaceLivenessWizard, _assign({}, faceLivenessProps, {
|
|
15898
15909
|
onComplete: onFaceLivenessComplete
|
|
15899
|
-
}))
|
|
15910
|
+
}));
|
|
15900
15911
|
case 'SignatureCapture':
|
|
15901
15912
|
return /*#__PURE__*/React__namespace.default.createElement(SignatureCapture, _assign({}, signatureCaptureProps, {
|
|
15902
15913
|
onAccept: onSignatureCaptureSuccess
|