idmission-web-sdk 2.0.0 → 2.0.2
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 +1 -0
- package/dist/components/customer_flows/VideoIdValidation.d.ts +2 -0
- package/dist/components/video_id/IdVideoCapture.d.ts +2 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +278 -203
- 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 +278 -203
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +278 -203
- 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/CustomerFlows/VideoIdValidation.stories.d.ts +8 -10
- package/dist/version.d.ts +1 -1
- package/package.json +9 -9
|
@@ -49,7 +49,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
49
49
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
50
50
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
51
51
|
|
|
52
|
-
var webSdkVersion = '2.0.
|
|
52
|
+
var webSdkVersion = '2.0.2';
|
|
53
53
|
|
|
54
54
|
function getPlatform() {
|
|
55
55
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2496,7 +2496,7 @@ var defaultFocusThresholds = {
|
|
|
2496
2496
|
var models = {};
|
|
2497
2497
|
function loadFocusModel(modelAssetPath) {
|
|
2498
2498
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2499
|
-
var id, _a, _b, _c, _d
|
|
2499
|
+
var id, _a, _b, _c, _d;
|
|
2500
2500
|
return tslib.__generator(this, function (_e) {
|
|
2501
2501
|
switch (_e.label) {
|
|
2502
2502
|
case 0:
|
|
@@ -2519,12 +2519,16 @@ function loadFocusModel(modelAssetPath) {
|
|
|
2519
2519
|
delegate: modelCapabilities.delegate
|
|
2520
2520
|
},
|
|
2521
2521
|
runningMode: 'VIDEO'
|
|
2522
|
-
}])
|
|
2522
|
+
}])
|
|
2523
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2524
|
+
// models[id].classifyForVideo(emptyFrame, performance.now())
|
|
2525
|
+
// emptyFrame.remove()
|
|
2526
|
+
];
|
|
2523
2527
|
case 3:
|
|
2524
2528
|
_a[_b] = _e.sent();
|
|
2525
|
-
emptyFrame = document.createElement('canvas')
|
|
2526
|
-
models[id].classifyForVideo(emptyFrame, performance.now())
|
|
2527
|
-
emptyFrame.remove()
|
|
2529
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2530
|
+
// models[id].classifyForVideo(emptyFrame, performance.now())
|
|
2531
|
+
// emptyFrame.remove()
|
|
2528
2532
|
return [2 /*return*/, models[id]];
|
|
2529
2533
|
}
|
|
2530
2534
|
});
|
|
@@ -2765,7 +2769,7 @@ var defaultSelfieCaptureModelLoadTimeoutMs = 45000;
|
|
|
2765
2769
|
var detector;
|
|
2766
2770
|
function loadFaceDetector() {
|
|
2767
2771
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2768
|
-
var _a, _b
|
|
2772
|
+
var _a, _b;
|
|
2769
2773
|
return tslib.__generator(this, function (_c) {
|
|
2770
2774
|
switch (_c.label) {
|
|
2771
2775
|
case 0:
|
|
@@ -2785,12 +2789,16 @@ function loadFaceDetector() {
|
|
|
2785
2789
|
delegate: modelCapabilities.delegate
|
|
2786
2790
|
},
|
|
2787
2791
|
runningMode: 'VIDEO'
|
|
2788
|
-
}])
|
|
2792
|
+
}])
|
|
2793
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2794
|
+
// detector.detectForVideo(emptyFrame, performance.now())
|
|
2795
|
+
// emptyFrame.remove()
|
|
2796
|
+
];
|
|
2789
2797
|
case 3:
|
|
2790
2798
|
detector = _c.sent();
|
|
2791
|
-
emptyFrame = document.createElement('canvas')
|
|
2792
|
-
detector.detectForVideo(emptyFrame, performance.now())
|
|
2793
|
-
emptyFrame.remove()
|
|
2799
|
+
// const emptyFrame = document.createElement('canvas')
|
|
2800
|
+
// detector.detectForVideo(emptyFrame, performance.now())
|
|
2801
|
+
// emptyFrame.remove()
|
|
2794
2802
|
return [2 /*return*/, detector];
|
|
2795
2803
|
}
|
|
2796
2804
|
});
|
|
@@ -3113,7 +3121,7 @@ function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
|
3113
3121
|
scoreThreshold = defaultDocumentDetectionScoreThreshold;
|
|
3114
3122
|
}
|
|
3115
3123
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
3116
|
-
var id, _a, _b, _c, _d
|
|
3124
|
+
var id, _a, _b, _c, _d;
|
|
3117
3125
|
return tslib.__generator(this, function (_e) {
|
|
3118
3126
|
switch (_e.label) {
|
|
3119
3127
|
case 0:
|
|
@@ -3137,12 +3145,16 @@ function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
|
3137
3145
|
},
|
|
3138
3146
|
scoreThreshold: scoreThreshold,
|
|
3139
3147
|
runningMode: 'VIDEO'
|
|
3140
|
-
}])
|
|
3148
|
+
}])
|
|
3149
|
+
// const emptyFrame = document.createElement('canvas')
|
|
3150
|
+
// detectors[id].detectForVideo(emptyFrame, performance.now())
|
|
3151
|
+
// emptyFrame.remove()
|
|
3152
|
+
];
|
|
3141
3153
|
case 3:
|
|
3142
3154
|
_a[_b] = _e.sent();
|
|
3143
|
-
emptyFrame = document.createElement('canvas')
|
|
3144
|
-
detectors[id].detectForVideo(emptyFrame, performance.now())
|
|
3145
|
-
emptyFrame.remove()
|
|
3155
|
+
// const emptyFrame = document.createElement('canvas')
|
|
3156
|
+
// detectors[id].detectForVideo(emptyFrame, performance.now())
|
|
3157
|
+
// emptyFrame.remove()
|
|
3146
3158
|
return [2 /*return*/, detectors[id]];
|
|
3147
3159
|
}
|
|
3148
3160
|
});
|
|
@@ -9187,14 +9199,20 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
9187
9199
|
var captureStartedAt = React.useRef();
|
|
9188
9200
|
var captureEndedAt = React.useRef();
|
|
9189
9201
|
var operationStartedAt = React.useRef();
|
|
9202
|
+
var _x = React.useContext(SelfieGuidanceModelsContext),
|
|
9203
|
+
start = _x.start,
|
|
9204
|
+
stop = _x.stop;
|
|
9190
9205
|
React.useEffect(function () {
|
|
9191
9206
|
operationStartedAt.current = new Date();
|
|
9192
9207
|
}, []);
|
|
9193
9208
|
React.useEffect(function () {
|
|
9194
|
-
if (captureState
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9209
|
+
if (captureState !== 'CAPTURING') return;
|
|
9210
|
+
captureStartedAt.current = new Date();
|
|
9211
|
+
start();
|
|
9212
|
+
return function () {
|
|
9213
|
+
stop();
|
|
9214
|
+
};
|
|
9215
|
+
}, [captureState, start, stop]);
|
|
9198
9216
|
var onCapture = React.useCallback(function () {
|
|
9199
9217
|
captureEndedAt.current = new Date();
|
|
9200
9218
|
}, []);
|
|
@@ -9231,9 +9249,9 @@ var FaceLivenessWizard = function FaceLivenessWizard(_a) {
|
|
|
9231
9249
|
setCaptureState('FAILED');
|
|
9232
9250
|
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout(submissionResponse, livenessCheckRequest);
|
|
9233
9251
|
}, [onTimeout, livenessCheckRequest, submissionResponse]);
|
|
9234
|
-
var
|
|
9235
|
-
attempt =
|
|
9236
|
-
setAttempt =
|
|
9252
|
+
var _y = React.useState(0),
|
|
9253
|
+
attempt = _y[0],
|
|
9254
|
+
setAttempt = _y[1];
|
|
9237
9255
|
var onExitCallback = React.useCallback(function () {
|
|
9238
9256
|
setAttempt(function (n) {
|
|
9239
9257
|
return n + 1;
|
|
@@ -9649,7 +9667,10 @@ var SignatureCapture = function SignatureCapture(_a) {
|
|
|
9649
9667
|
var AcceptBtn$1 = styled__default['default'](LoaderButton)(templateObject_1$b || (templateObject_1$b = tslib.__makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
|
|
9650
9668
|
var templateObject_1$b;
|
|
9651
9669
|
|
|
9652
|
-
var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
9670
|
+
var useVideoRecorder = function useVideoRecorder(camera, audioStream, mergeAVStreams) {
|
|
9671
|
+
if (mergeAVStreams === void 0) {
|
|
9672
|
+
mergeAVStreams = false;
|
|
9673
|
+
}
|
|
9653
9674
|
var videoRecorder = React.useRef(null);
|
|
9654
9675
|
var audioRecorder = React.useRef(null);
|
|
9655
9676
|
var videoChunks = React.useRef([]);
|
|
@@ -9678,7 +9699,13 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9678
9699
|
var _h = React.useState(false),
|
|
9679
9700
|
audioRecordingIntentionallyStopped = _h[0],
|
|
9680
9701
|
setAudioRecordingIntentionallyStopped = _h[1];
|
|
9681
|
-
var
|
|
9702
|
+
var getVideoStream = React.useCallback(function () {
|
|
9703
|
+
var _a, _b, _c;
|
|
9704
|
+
if (!mergeAVStreams) return camera === null || camera === void 0 ? void 0 : camera.stream;
|
|
9705
|
+
var videoTracks = (_b = (_a = camera === null || camera === void 0 ? void 0 : camera.stream) === null || _a === void 0 ? void 0 : _a.getTracks()) !== null && _b !== void 0 ? _b : [];
|
|
9706
|
+
var audioTracks = (_c = audioStream === null || audioStream === void 0 ? void 0 : audioStream.getTracks()) !== null && _c !== void 0 ? _c : [];
|
|
9707
|
+
return new MediaStream(tslib.__spreadArray(tslib.__spreadArray([], videoTracks, true), audioTracks, true));
|
|
9708
|
+
}, [audioStream, camera === null || camera === void 0 ? void 0 : camera.stream, mergeAVStreams]);
|
|
9682
9709
|
var processVideo = React.useCallback(function () {
|
|
9683
9710
|
var videoBlob = new Blob(videoChunks.current, {
|
|
9684
9711
|
type: 'video/mp4'
|
|
@@ -9699,13 +9726,15 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9699
9726
|
(_a = audioStream === null || audioStream === void 0 ? void 0 : audioStream.stop) === null || _a === void 0 ? void 0 : _a.call(audioStream);
|
|
9700
9727
|
}, [audioStream]);
|
|
9701
9728
|
var startRecordingVideo = React.useCallback(function () {
|
|
9729
|
+
var videoStream = getVideoStream();
|
|
9702
9730
|
if (!videoStream) return;
|
|
9703
9731
|
videoChunks.current = [];
|
|
9704
9732
|
setIsRecordingVideo(true);
|
|
9705
9733
|
setVideoRecordingStopped(false);
|
|
9706
9734
|
setVideoRecordingIntentionallyStopped(false);
|
|
9707
9735
|
videoRecorder.current = new MediaRecorder(videoStream, {
|
|
9708
|
-
videoBitsPerSecond: 270000
|
|
9736
|
+
videoBitsPerSecond: 270000,
|
|
9737
|
+
audioBitsPerSecond: 32000
|
|
9709
9738
|
});
|
|
9710
9739
|
videoRecorder.current.ondataavailable = function (e) {
|
|
9711
9740
|
videoChunks.current.push(e.data);
|
|
@@ -9721,8 +9750,9 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9721
9750
|
// TODO: figure out what to do here
|
|
9722
9751
|
}
|
|
9723
9752
|
}, 100);
|
|
9724
|
-
}, [
|
|
9753
|
+
}, [getVideoStream]);
|
|
9725
9754
|
var startRecordingAudio = React.useCallback(function () {
|
|
9755
|
+
if (mergeAVStreams) return;
|
|
9726
9756
|
if (!audioStream) return;
|
|
9727
9757
|
audioChunks.current = [];
|
|
9728
9758
|
setIsRecordingAudio(true);
|
|
@@ -9738,7 +9768,7 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream) {
|
|
|
9738
9768
|
setAudioRecordingStopped(true);
|
|
9739
9769
|
};
|
|
9740
9770
|
audioRecorder.current.start(1000);
|
|
9741
|
-
}, [audioStream]);
|
|
9771
|
+
}, [audioStream, mergeAVStreams]);
|
|
9742
9772
|
var stopRecordingVideo = React.useCallback(function () {
|
|
9743
9773
|
var _a, _b;
|
|
9744
9774
|
setVideoRecordingIntentionallyStopped(true);
|
|
@@ -10040,45 +10070,52 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
10040
10070
|
onRetryClicked = _a.onRetryClicked,
|
|
10041
10071
|
onExitCapture = _a.onExitCapture,
|
|
10042
10072
|
onUserCancel = _a.onUserCancel,
|
|
10043
|
-
onModelError = _a.onModelError,
|
|
10044
10073
|
_c = _a.loadingOverlayMode,
|
|
10045
10074
|
loadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
10046
|
-
_d = _a.
|
|
10047
|
-
|
|
10048
|
-
_e = _a.
|
|
10049
|
-
|
|
10050
|
-
_f = _a.
|
|
10051
|
-
|
|
10052
|
-
_g = _a.
|
|
10053
|
-
|
|
10054
|
-
_h = _a.
|
|
10055
|
-
|
|
10056
|
-
_j = _a.
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
setSignatureVideoUrl = _l.setSignatureVideoUrl,
|
|
10066
|
-
logSelfieCaptureAttempt = _l.logSelfieCaptureAttempt;
|
|
10075
|
+
_d = _a.skipSuccessScreen,
|
|
10076
|
+
skipSuccessScreen = _d === void 0 ? false : _d,
|
|
10077
|
+
_e = _a.assets,
|
|
10078
|
+
assets = _e === void 0 ? {} : _e,
|
|
10079
|
+
_f = _a.classNames,
|
|
10080
|
+
classNames = _f === void 0 ? {} : _f,
|
|
10081
|
+
_g = _a.colors,
|
|
10082
|
+
colors = _g === void 0 ? {} : _g,
|
|
10083
|
+
_h = _a.verbiage,
|
|
10084
|
+
verbiage = _h === void 0 ? {} : _h,
|
|
10085
|
+
_j = _a.debugMode,
|
|
10086
|
+
debugMode = _j === void 0 ? false : _j;
|
|
10087
|
+
var _k = React.useContext(SubmissionContext),
|
|
10088
|
+
selfieImage = _k.selfieImage,
|
|
10089
|
+
signatureVideoUrl = _k.signatureVideoUrl,
|
|
10090
|
+
setSelfieImage = _k.setSelfieImage,
|
|
10091
|
+
setSignatureData = _k.setSignatureData,
|
|
10092
|
+
setSignatureVideoUrl = _k.setSignatureVideoUrl,
|
|
10093
|
+
logSelfieCaptureAttempt = _k.logSelfieCaptureAttempt;
|
|
10067
10094
|
var cameraAccessDenied = React.useContext(CameraStateContext).cameraAccessDenied;
|
|
10068
|
-
var
|
|
10069
|
-
captureState =
|
|
10070
|
-
setCaptureState =
|
|
10095
|
+
var _l = React.useState('LOADING'),
|
|
10096
|
+
captureState = _l[0],
|
|
10097
|
+
setCaptureState = _l[1];
|
|
10071
10098
|
var operationStartedAt = React.useRef();
|
|
10072
10099
|
var captureStartedAt = React.useRef();
|
|
10073
10100
|
var captureEndedAt = React.useRef();
|
|
10101
|
+
var _m = React.useContext(SelfieGuidanceModelsContext),
|
|
10102
|
+
start = _m.start,
|
|
10103
|
+
stop = _m.stop;
|
|
10074
10104
|
React.useEffect(function () {
|
|
10075
10105
|
operationStartedAt.current = new Date();
|
|
10076
10106
|
}, []);
|
|
10077
10107
|
React.useEffect(function () {
|
|
10078
|
-
if (captureState
|
|
10079
|
-
|
|
10080
|
-
}
|
|
10108
|
+
if (captureState !== 'CHECKING_LIVENESS') return;
|
|
10109
|
+
captureStartedAt.current = new Date();
|
|
10081
10110
|
}, [captureState]);
|
|
10111
|
+
var shouldRun = ['CHECKING_LIVENESS', 'CAPTURING_SIGNATURE'].includes(captureState);
|
|
10112
|
+
React.useEffect(function () {
|
|
10113
|
+
if (!shouldRun) return;
|
|
10114
|
+
start();
|
|
10115
|
+
return function () {
|
|
10116
|
+
stop();
|
|
10117
|
+
};
|
|
10118
|
+
}, [shouldRun, start, stop]);
|
|
10082
10119
|
var logCaptureMetadata = React.useCallback(function () {
|
|
10083
10120
|
var _a, _b, _c;
|
|
10084
10121
|
logSelfieCaptureAttempt({
|
|
@@ -10143,11 +10180,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
10143
10180
|
setCaptureState('LOADING');
|
|
10144
10181
|
}
|
|
10145
10182
|
}, [cameraAccessDenied]);
|
|
10146
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
10147
|
-
throttleMs: captureState === 'CAPTURING_SIGNATURE' ? 250 : 0,
|
|
10148
|
-
onModelError: onModelError,
|
|
10149
|
-
modelLoadTimeoutMs: modelLoadTimeoutMs
|
|
10150
|
-
}, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
10183
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
10151
10184
|
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
10152
10185
|
}, /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, {
|
|
10153
10186
|
className: classNames.cameraFeed
|
|
@@ -10512,79 +10545,85 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10512
10545
|
disableFaceDetectionWhileAudioCapture = _8 === void 0 ? false : _8,
|
|
10513
10546
|
_9 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
10514
10547
|
disableFaceDetectionWhileAudioCaptureMsDelay = _9 === void 0 ? 2000 : _9,
|
|
10515
|
-
_10 = _a.
|
|
10516
|
-
|
|
10517
|
-
_11 = _a.
|
|
10518
|
-
|
|
10519
|
-
_12 = _a.
|
|
10520
|
-
|
|
10521
|
-
_13 = _a.
|
|
10522
|
-
|
|
10523
|
-
_14 = _a.
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
_17 =
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
setDetectedObjects = _19[1];
|
|
10548
|
+
_10 = _a.mergeAVStreams,
|
|
10549
|
+
mergeAVStreams = _10 === void 0 ? false : _10,
|
|
10550
|
+
_11 = _a.assets,
|
|
10551
|
+
assets = _11 === void 0 ? {} : _11,
|
|
10552
|
+
_12 = _a.classNames,
|
|
10553
|
+
classNames = _12 === void 0 ? {} : _12,
|
|
10554
|
+
_13 = _a.colors,
|
|
10555
|
+
colors = _13 === void 0 ? {} : _13,
|
|
10556
|
+
_14 = _a.verbiage,
|
|
10557
|
+
rawVerbiage = _14 === void 0 ? {} : _14,
|
|
10558
|
+
_15 = _a.debugMode,
|
|
10559
|
+
debugMode = _15 === void 0 ? false : _15;
|
|
10560
|
+
var _16 = useResizeObserver__default['default'](),
|
|
10561
|
+
ref = _16.ref,
|
|
10562
|
+
_17 = _16.width,
|
|
10563
|
+
width = _17 === void 0 ? 1 : _17,
|
|
10564
|
+
_18 = _16.height,
|
|
10565
|
+
height = _18 === void 0 ? 1 : _18;
|
|
10566
|
+
var _19 = React.useContext(CameraStateContext),
|
|
10567
|
+
cameraRef = _19.cameraRef,
|
|
10568
|
+
videoRef = _19.videoRef,
|
|
10569
|
+
videoLoaded = _19.videoLoaded,
|
|
10570
|
+
cameraReady = _19.cameraReady,
|
|
10571
|
+
microphoneReady = _19.microphoneReady,
|
|
10572
|
+
audioStream = _19.audioStream,
|
|
10573
|
+
setVideoLoaded = _19.setVideoLoaded,
|
|
10574
|
+
takePhoto = _19.takePhoto;
|
|
10543
10575
|
var _20 = React.useState([]),
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
var _21 = React.
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
var _23 = React.
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
var _24 = React.useContext(
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
var _25 =
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10576
|
+
detectedObjects = _20[0],
|
|
10577
|
+
setDetectedObjects = _20[1];
|
|
10578
|
+
var _21 = React.useState([]),
|
|
10579
|
+
faces = _21[0],
|
|
10580
|
+
setFaces = _21[1];
|
|
10581
|
+
var _22 = React.useContext(IdCaptureModelsContext),
|
|
10582
|
+
idModelsReady = _22.ready,
|
|
10583
|
+
startIdModels = _22.start,
|
|
10584
|
+
stopIdModels = _22.stop,
|
|
10585
|
+
onIdPredictionMade = _22.onPredictionMade,
|
|
10586
|
+
setThresholds = _22.setThresholds,
|
|
10587
|
+
bestFrameDetails = _22.bestFrameDetails,
|
|
10588
|
+
resetBestFrame = _22.resetBestFrame,
|
|
10589
|
+
idModelError = _22.modelError;
|
|
10590
|
+
var _23 = React.useState(null),
|
|
10591
|
+
videoStartsAt = _23[0],
|
|
10592
|
+
setVideoStartsAt = _23[1];
|
|
10593
|
+
var _24 = React.useContext(SubmissionContext),
|
|
10594
|
+
setIdCaptureVideoAudioStartsAt = _24.setIdCaptureVideoAudioStartsAt,
|
|
10595
|
+
setExpectedAudioText = _24.setExpectedAudioText;
|
|
10596
|
+
var _25 = React.useContext(SelfieGuidanceModelsContext),
|
|
10597
|
+
onSelfiePredictionMade = _25.onPredictionMade,
|
|
10598
|
+
selfieModelError = _25.error;
|
|
10599
|
+
var _26 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
|
|
10600
|
+
isRecordingVideo = _26.isRecordingVideo,
|
|
10601
|
+
startRecordingVideo = _26.startRecordingVideo,
|
|
10602
|
+
startRecordingAudio = _26.startRecordingAudio,
|
|
10603
|
+
stopRecordingVideo = _26.stopRecordingVideo,
|
|
10604
|
+
stopRecordingAudio = _26.stopRecordingAudio,
|
|
10605
|
+
videoRecordingUnintentionallyStopped = _26.videoRecordingUnintentionallyStopped,
|
|
10606
|
+
audioRecordingUnintentionallyStopped = _26.audioRecordingUnintentionallyStopped,
|
|
10607
|
+
videoUrl = _26.videoUrl,
|
|
10608
|
+
audioUrl = _26.audioUrl;
|
|
10574
10609
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
10575
|
-
var
|
|
10576
|
-
countdownRemaining =
|
|
10577
|
-
setCountdownRemaining =
|
|
10610
|
+
var _27 = React.useState(0),
|
|
10611
|
+
countdownRemaining = _27[0],
|
|
10612
|
+
setCountdownRemaining = _27[1];
|
|
10578
10613
|
React.useEffect(function () {
|
|
10579
10614
|
if (!isRecordingVideo && !videoUrl) {
|
|
10580
10615
|
startRecordingVideo();
|
|
10581
10616
|
setVideoStartsAt(new Date());
|
|
10582
10617
|
}
|
|
10583
|
-
if
|
|
10618
|
+
// if the mergeAVStreams flag is present, the audio stream is on the video
|
|
10619
|
+
// stream, so we won't wait for a separate data url containing audio only.
|
|
10620
|
+
var needsAudio = !!readTextPrompt && !mergeAVStreams;
|
|
10621
|
+
var audioReady = !needsAudio || audioUrl;
|
|
10622
|
+
if (videoUrl && audioReady) {
|
|
10584
10623
|
setVideoLoaded(false);
|
|
10585
10624
|
onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl, audioUrl);
|
|
10586
10625
|
}
|
|
10587
|
-
}, [audioUrl, isRecordingVideo, onComplete, readTextPrompt, setVideoLoaded, startRecordingVideo, videoUrl]);
|
|
10626
|
+
}, [audioUrl, isRecordingVideo, mergeAVStreams, onComplete, readTextPrompt, setVideoLoaded, startRecordingVideo, videoUrl]);
|
|
10588
10627
|
React.useEffect(function () {
|
|
10589
10628
|
if (videoRecordingUnintentionallyStopped || audioRecordingUnintentionallyStopped) {
|
|
10590
10629
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
@@ -10594,9 +10633,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10594
10633
|
React.useEffect(function () {
|
|
10595
10634
|
shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady && !idModelError && (!readTextPrompt || microphoneReady);
|
|
10596
10635
|
}, [cameraReady, idModelError, idModelsReady, microphoneReady, readTextPrompt, videoLoaded]);
|
|
10597
|
-
var
|
|
10598
|
-
requestedAction =
|
|
10599
|
-
setRequestedAction =
|
|
10636
|
+
var _28 = React.useState('SHOW_ID_FRONT'),
|
|
10637
|
+
requestedAction = _28[0],
|
|
10638
|
+
setRequestedAction = _28[1];
|
|
10600
10639
|
React.useEffect(function startModelsWhenCapturing() {
|
|
10601
10640
|
if (!shouldCaptureFrames.current && requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
|
|
10602
10641
|
startIdModels();
|
|
@@ -10615,15 +10654,15 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10615
10654
|
}
|
|
10616
10655
|
});
|
|
10617
10656
|
}, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
|
|
10618
|
-
var _28 = React.useState(0),
|
|
10619
|
-
currentDetectionScore = _28[0],
|
|
10620
|
-
setCurrentDetectionScore = _28[1];
|
|
10621
10657
|
var _29 = React.useState(0),
|
|
10622
|
-
|
|
10623
|
-
|
|
10658
|
+
currentDetectionScore = _29[0],
|
|
10659
|
+
setCurrentDetectionScore = _29[1];
|
|
10624
10660
|
var _30 = React.useState(0),
|
|
10625
|
-
|
|
10626
|
-
|
|
10661
|
+
currentFocusScore = _30[0],
|
|
10662
|
+
setCurrentFocusScore = _30[1];
|
|
10663
|
+
var _31 = React.useState(0),
|
|
10664
|
+
goodFramesCount = _31[0],
|
|
10665
|
+
setGoodFramesCount = _31[1];
|
|
10627
10666
|
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
10628
10667
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
10629
10668
|
React.useEffect(function () {
|
|
@@ -10641,9 +10680,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10641
10680
|
}
|
|
10642
10681
|
});
|
|
10643
10682
|
}, [idCaptureModelsEnabled, idCardFrontDetectionThreshold, onIdPredictionMade, idModelError]);
|
|
10644
|
-
var
|
|
10645
|
-
idFrontCaptureStartedAt =
|
|
10646
|
-
setFirstGoodFrameTime =
|
|
10683
|
+
var _32 = React.useState(null),
|
|
10684
|
+
idFrontCaptureStartedAt = _32[0],
|
|
10685
|
+
setFirstGoodFrameTime = _32[1];
|
|
10647
10686
|
React.useEffect(function () {
|
|
10648
10687
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
10649
10688
|
}, [goodFramesCount]);
|
|
@@ -10664,9 +10703,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10664
10703
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
10665
10704
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
10666
10705
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
10667
|
-
var
|
|
10668
|
-
countdownStartedAt =
|
|
10669
|
-
setCountdownStartedAt =
|
|
10706
|
+
var _33 = React.useState(),
|
|
10707
|
+
countdownStartedAt = _33[0],
|
|
10708
|
+
setCountdownStartedAt = _33[1];
|
|
10670
10709
|
var frameLock = React.useRef(false);
|
|
10671
10710
|
var captureFrame = React.useCallback(function () {
|
|
10672
10711
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
@@ -10787,9 +10826,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10787
10826
|
};
|
|
10788
10827
|
}, [captureCountdownSeconds, captureFrame, countdownStartedAt, manualCountdown]);
|
|
10789
10828
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
10790
|
-
var
|
|
10791
|
-
numFramesWithoutFaces =
|
|
10792
|
-
setNumFramesWithoutFaces =
|
|
10829
|
+
var _34 = React.useState(0),
|
|
10830
|
+
numFramesWithoutFaces = _34[0],
|
|
10831
|
+
setNumFramesWithoutFaces = _34[1];
|
|
10793
10832
|
React.useEffect(function () {
|
|
10794
10833
|
if (!selfieModelError) {
|
|
10795
10834
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -10807,14 +10846,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
10807
10846
|
}
|
|
10808
10847
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
10809
10848
|
var theme = styled.useTheme();
|
|
10810
|
-
var
|
|
10849
|
+
var _35 = useTranslations(rawVerbiage, {
|
|
10811
10850
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
10812
10851
|
searchingForIdCardText: 'Searching for ID card...',
|
|
10813
10852
|
captureBtnText: 'Capture'
|
|
10814
10853
|
}),
|
|
10815
|
-
captureBtnText =
|
|
10816
|
-
faceNotCenteredText =
|
|
10817
|
-
searchingForIdCardText =
|
|
10854
|
+
captureBtnText = _35.captureBtnText,
|
|
10855
|
+
faceNotCenteredText = _35.faceNotCenteredText,
|
|
10856
|
+
searchingForIdCardText = _35.searchingForIdCardText;
|
|
10818
10857
|
var debugScalingDetails = useDebugScalingDetails({
|
|
10819
10858
|
enabled: debugMode,
|
|
10820
10859
|
pageWidth: width,
|
|
@@ -11055,29 +11094,31 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11055
11094
|
disableFaceDetectionWhileAudioCaptureMsDelay = _v === void 0 ? 2000 : _v,
|
|
11056
11095
|
_w = _a.silentFallback,
|
|
11057
11096
|
silentFallback = _w === void 0 ? false : _w,
|
|
11058
|
-
_x = _a.
|
|
11059
|
-
|
|
11060
|
-
_y = _a.
|
|
11061
|
-
|
|
11062
|
-
_z = _a.
|
|
11063
|
-
|
|
11064
|
-
_0 = _a.
|
|
11065
|
-
|
|
11066
|
-
_1 = _a.
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11097
|
+
_x = _a.mergeAVStreams,
|
|
11098
|
+
mergeAVStreams = _x === void 0 ? false : _x,
|
|
11099
|
+
_y = _a.assets,
|
|
11100
|
+
assets = _y === void 0 ? {} : _y,
|
|
11101
|
+
_z = _a.classNames,
|
|
11102
|
+
classNames = _z === void 0 ? {} : _z,
|
|
11103
|
+
_0 = _a.colors,
|
|
11104
|
+
colors = _0 === void 0 ? {} : _0,
|
|
11105
|
+
_1 = _a.verbiage,
|
|
11106
|
+
verbiage = _1 === void 0 ? {} : _1,
|
|
11107
|
+
_2 = _a.debugMode,
|
|
11108
|
+
debugMode = _2 === void 0 ? false : _2;
|
|
11109
|
+
var _3 = React.useContext(SubmissionContext),
|
|
11110
|
+
submissionStatus = _3.submissionStatus,
|
|
11111
|
+
idCaptureVideoUrl = _3.idCaptureVideoUrl,
|
|
11112
|
+
idCaptureVideoAudioUrl = _3.idCaptureVideoAudioUrl,
|
|
11113
|
+
idCaptureVideoIdFrontImage = _3.idCaptureVideoIdFrontImage,
|
|
11114
|
+
idCaptureVideoIdBackImage = _3.idCaptureVideoIdBackImage,
|
|
11115
|
+
setIdCaptureVideoUrl = _3.setIdCaptureVideoUrl,
|
|
11116
|
+
setIdCaptureVideoIdFrontImage = _3.setIdCaptureVideoIdFrontImage,
|
|
11117
|
+
setIdCaptureVideoIdBackImage = _3.setIdCaptureVideoIdBackImage,
|
|
11118
|
+
setIdCaptureVideoAudioUrl = _3.setIdCaptureVideoAudioUrl;
|
|
11119
|
+
var _4 = React.useState('CAPTURING_ID'),
|
|
11120
|
+
captureState = _4[0],
|
|
11121
|
+
setCaptureState = _4[1];
|
|
11081
11122
|
React.useEffect(function () {
|
|
11082
11123
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
11083
11124
|
}, [captureState, skipIdCapture]);
|
|
@@ -11108,9 +11149,9 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11108
11149
|
var onVideoCaptureFaceNotDetected = React.useCallback(function () {
|
|
11109
11150
|
setCaptureState('CHECKING_LIVENESS');
|
|
11110
11151
|
}, []);
|
|
11111
|
-
var
|
|
11112
|
-
attempt =
|
|
11113
|
-
setAttempt =
|
|
11152
|
+
var _5 = React.useState(0),
|
|
11153
|
+
attempt = _5[0],
|
|
11154
|
+
setAttempt = _5[1];
|
|
11114
11155
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
11115
11156
|
var onFaceCaptureExitAfterFailure = React.useCallback(function (resp, req) {
|
|
11116
11157
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|
|
@@ -11151,11 +11192,13 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11151
11192
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
11152
11193
|
debugMode: debugMode
|
|
11153
11194
|
}, /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsProvider, {
|
|
11195
|
+
autoStart: false,
|
|
11154
11196
|
documentDetectionModelUrl: (_c = (_b = idCaptureProps.assets) === null || _b === void 0 ? void 0 : _b.documentDetectionModelUrl) !== null && _c !== void 0 ? _c : '',
|
|
11155
11197
|
focusModelUrl: (_e = (_d = idCaptureProps.assets) === null || _d === void 0 ? void 0 : _d.focusModelUrl) !== null && _e !== void 0 ? _e : '',
|
|
11156
11198
|
onModelError: onIdCaptureModelError,
|
|
11157
11199
|
modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
|
|
11158
11200
|
}, /*#__PURE__*/React__default['default'].createElement(SelfieGuidanceModelsProvider, {
|
|
11201
|
+
autoStart: false,
|
|
11159
11202
|
onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
|
|
11160
11203
|
modelLoadTimeoutMs: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.modelLoadTimeoutMs
|
|
11161
11204
|
}, /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
@@ -11224,6 +11267,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
11224
11267
|
readTextPrompt: readTextPrompt,
|
|
11225
11268
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
11226
11269
|
readTextMinReadingMs: readTextMinReadingMs,
|
|
11270
|
+
mergeAVStreams: mergeAVStreams,
|
|
11227
11271
|
assets: assets.idVideoCapture,
|
|
11228
11272
|
classNames: classNames.idVideoCapture,
|
|
11229
11273
|
colors: colors.idVideoCapture,
|
|
@@ -11422,6 +11466,7 @@ var CompositeWizardComponent = function CompositeWizardComponent(_a) {
|
|
|
11422
11466
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
11423
11467
|
debugMode: debugMode
|
|
11424
11468
|
}, /*#__PURE__*/React__default['default'].createElement(SelfieGuidanceModelsProvider, {
|
|
11469
|
+
autoStart: false,
|
|
11425
11470
|
onModelError: faceLivenessProps.onModelError,
|
|
11426
11471
|
modelLoadTimeoutMs: faceLivenessProps.modelLoadTimeoutMs
|
|
11427
11472
|
}, /*#__PURE__*/React__default['default'].createElement(FaceLivenessWizard, tslib.__assign({}, faceLivenessProps, {
|
|
@@ -11441,10 +11486,15 @@ var CompositeWizardComponent = function CompositeWizardComponent(_a) {
|
|
|
11441
11486
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
11442
11487
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied,
|
|
11443
11488
|
debugMode: debugMode
|
|
11489
|
+
}, /*#__PURE__*/React__default['default'].createElement(SelfieGuidanceModelsProvider, {
|
|
11490
|
+
autoStart: false,
|
|
11491
|
+
throttleMs: 250,
|
|
11492
|
+
onModelError: videoSignatureCaptureProps.onModelError,
|
|
11493
|
+
modelLoadTimeoutMs: videoSignatureCaptureProps.modelLoadTimeoutMs
|
|
11444
11494
|
}, /*#__PURE__*/React__default['default'].createElement(VideoSignatureWizard, tslib.__assign({}, videoSignatureCaptureProps, {
|
|
11445
11495
|
onComplete: onVideoSignatureComplete,
|
|
11446
11496
|
onRetryClicked: onVideoSignatureRetry
|
|
11447
|
-
})));
|
|
11497
|
+
}))));
|
|
11448
11498
|
case 'AdditionalDocumentCapture':
|
|
11449
11499
|
return /*#__PURE__*/React__default['default'].createElement(AdditionalDocumentCaptureWizard, tslib.__assign({}, additionalDocumentCaptureProps, {
|
|
11450
11500
|
documents: documents,
|
|
@@ -12771,6 +12821,16 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
12771
12821
|
var _m = React.useContext(CameraStateContext),
|
|
12772
12822
|
cameraAccessDenied = _m.cameraAccessDenied,
|
|
12773
12823
|
releaseCameraAccess = _m.releaseCameraAccess;
|
|
12824
|
+
var _o = React.useContext(SelfieGuidanceModelsContext),
|
|
12825
|
+
start = _o.start,
|
|
12826
|
+
stop = _o.stop;
|
|
12827
|
+
React.useEffect(function () {
|
|
12828
|
+
if (captureState !== 'CAPTURING') return;
|
|
12829
|
+
start();
|
|
12830
|
+
return function () {
|
|
12831
|
+
stop();
|
|
12832
|
+
};
|
|
12833
|
+
}, [captureState, start, stop]);
|
|
12774
12834
|
var onCustomerMatchedCallback = React.useCallback(function (resp, req) {
|
|
12775
12835
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
12776
12836
|
return tslib.__generator(this, function (_a) {
|
|
@@ -12793,9 +12853,9 @@ var CustomerVerificationWizard = function CustomerVerificationWizard(_a) {
|
|
|
12793
12853
|
setCaptureState('FAILED');
|
|
12794
12854
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
12795
12855
|
}, [onCaptureGuidanceTimeout]);
|
|
12796
|
-
var
|
|
12797
|
-
attempt =
|
|
12798
|
-
setAttempt =
|
|
12856
|
+
var _p = React.useState(0),
|
|
12857
|
+
attempt = _p[0],
|
|
12858
|
+
setAttempt = _p[1];
|
|
12799
12859
|
var onExitCallback = React.useCallback(function () {
|
|
12800
12860
|
setAttempt(function (n) {
|
|
12801
12861
|
return n + 1;
|
|
@@ -12969,6 +13029,7 @@ var CustomerVerification = function CustomerVerification(_a) {
|
|
|
12969
13029
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
12970
13030
|
debugMode: debugMode
|
|
12971
13031
|
}, /*#__PURE__*/React__default['default'].createElement(SelfieGuidanceModelsProvider, {
|
|
13032
|
+
autoStart: false,
|
|
12972
13033
|
onModelError: onModelError,
|
|
12973
13034
|
modelLoadTimeoutMs: modelLoadTimeoutMs
|
|
12974
13035
|
}, /*#__PURE__*/React__default['default'].createElement(CustomerVerificationWizard, {
|
|
@@ -13315,6 +13376,16 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
13315
13376
|
var _m = React.useContext(CameraStateContext),
|
|
13316
13377
|
cameraAccessDenied = _m.cameraAccessDenied,
|
|
13317
13378
|
releaseCameraAccess = _m.releaseCameraAccess;
|
|
13379
|
+
var _o = React.useContext(SelfieGuidanceModelsContext),
|
|
13380
|
+
start = _o.start,
|
|
13381
|
+
stop = _o.stop;
|
|
13382
|
+
React.useEffect(function () {
|
|
13383
|
+
if (captureState !== 'CAPTURING') return;
|
|
13384
|
+
start();
|
|
13385
|
+
return function () {
|
|
13386
|
+
stop();
|
|
13387
|
+
};
|
|
13388
|
+
}, [captureState, start, stop]);
|
|
13318
13389
|
var onCustomerMatchedCallback = React.useCallback(function (resp, req) {
|
|
13319
13390
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
13320
13391
|
return tslib.__generator(this, function (_a) {
|
|
@@ -13337,9 +13408,9 @@ var CustomerIdentificationWizard = function CustomerIdentificationWizard(_a) {
|
|
|
13337
13408
|
setCaptureState('FAILED');
|
|
13338
13409
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
13339
13410
|
}, [onCaptureGuidanceTimeout]);
|
|
13340
|
-
var
|
|
13341
|
-
attempt =
|
|
13342
|
-
setAttempt =
|
|
13411
|
+
var _p = React.useState(0),
|
|
13412
|
+
attempt = _p[0],
|
|
13413
|
+
setAttempt = _p[1];
|
|
13343
13414
|
var onExitCallback = React.useCallback(function () {
|
|
13344
13415
|
setAttempt(function (n) {
|
|
13345
13416
|
return n + 1;
|
|
@@ -13511,6 +13582,7 @@ var CustomerIdentification = function CustomerIdentification(_a) {
|
|
|
13511
13582
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
13512
13583
|
debugMode: debugMode
|
|
13513
13584
|
}, /*#__PURE__*/React__default['default'].createElement(SelfieGuidanceModelsProvider, {
|
|
13585
|
+
autoStart: false,
|
|
13514
13586
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
13515
13587
|
onModelError: onModelError
|
|
13516
13588
|
}, /*#__PURE__*/React__default['default'].createElement(CustomerIdentificationWizard, {
|
|
@@ -13695,28 +13767,30 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13695
13767
|
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
13696
13768
|
_x = _a.silentFallback,
|
|
13697
13769
|
silentFallback = _x === void 0 ? false : _x,
|
|
13698
|
-
_y = _a.
|
|
13699
|
-
|
|
13700
|
-
_z = _a.
|
|
13701
|
-
|
|
13702
|
-
_0 = _a.
|
|
13703
|
-
|
|
13704
|
-
_1 = _a.
|
|
13705
|
-
|
|
13706
|
-
_2 = _a.
|
|
13707
|
-
|
|
13708
|
-
_3 = _a.
|
|
13709
|
-
|
|
13710
|
-
_4 = _a.
|
|
13711
|
-
|
|
13712
|
-
_5 = _a.
|
|
13713
|
-
|
|
13714
|
-
_6 = _a.
|
|
13715
|
-
|
|
13716
|
-
_7 = _a.
|
|
13717
|
-
|
|
13718
|
-
_8 = _a.
|
|
13719
|
-
|
|
13770
|
+
_y = _a.mergeAVStreams,
|
|
13771
|
+
mergeAVStreams = _y === void 0 ? false : _y,
|
|
13772
|
+
_z = _a.theme,
|
|
13773
|
+
theme = _z === void 0 ? 'default' : _z,
|
|
13774
|
+
_0 = _a.assets,
|
|
13775
|
+
assets = _0 === void 0 ? {} : _0,
|
|
13776
|
+
_1 = _a.classNames,
|
|
13777
|
+
classNames = _1 === void 0 ? {} : _1,
|
|
13778
|
+
_2 = _a.colors,
|
|
13779
|
+
colors = _2 === void 0 ? {} : _2,
|
|
13780
|
+
_3 = _a.verbiage,
|
|
13781
|
+
verbiage = _3 === void 0 ? {} : _3,
|
|
13782
|
+
_4 = _a.captureSignature,
|
|
13783
|
+
captureSignature = _4 === void 0 ? false : _4,
|
|
13784
|
+
_5 = _a.captureSignatureVideo,
|
|
13785
|
+
captureSignatureVideo = _5 === void 0 ? false : _5,
|
|
13786
|
+
_6 = _a.captureAdditionalDocuments,
|
|
13787
|
+
captureAdditionalDocuments = _6 === void 0 ? [] : _6,
|
|
13788
|
+
_7 = _a.geolocationEnabled,
|
|
13789
|
+
geolocationEnabled = _7 === void 0 ? true : _7,
|
|
13790
|
+
_8 = _a.geolocationRequired,
|
|
13791
|
+
geolocationRequired = _8 === void 0 ? false : _8,
|
|
13792
|
+
_9 = _a.debugMode,
|
|
13793
|
+
debugMode = _9 === void 0 ? false : _9;
|
|
13720
13794
|
useLanguage(lang);
|
|
13721
13795
|
useDebugLogging(debugMode);
|
|
13722
13796
|
var videoIdCaptureProps = React.useMemo(function () {
|
|
@@ -13747,13 +13821,14 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
13747
13821
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
13748
13822
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
13749
13823
|
silentFallback: silentFallback,
|
|
13824
|
+
mergeAVStreams: mergeAVStreams,
|
|
13750
13825
|
assets: assets,
|
|
13751
13826
|
classNames: classNames,
|
|
13752
13827
|
colors: colors,
|
|
13753
13828
|
verbiage: verbiage,
|
|
13754
13829
|
debugMode: debugMode
|
|
13755
13830
|
};
|
|
13756
|
-
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, assets, classNames, colors, verbiage, debugMode]);
|
|
13831
|
+
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
|
|
13757
13832
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
13758
13833
|
return {
|
|
13759
13834
|
documents: captureAdditionalDocuments,
|