idmission-web-sdk 2.2.150 → 2.2.152
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/customer_flows/SignatureKYC.d.ts +2 -0
- package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts +2 -0
- package/dist/components/video_signature_capture/VideoSignatureContext.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts +2 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +7 -2
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/camera/useVideoRecorder.d.ts +1 -0
- package/dist/lib/camera/useVideoRecorder.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +191 -135
- 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 +191 -135
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +191 -135
- 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
package/dist/sdk2.esm.js
CHANGED
|
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
203
203
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
var webSdkVersion = '2.2.
|
|
206
|
+
var webSdkVersion = '2.2.152';
|
|
207
207
|
|
|
208
208
|
function getPlatform() {
|
|
209
209
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -3860,12 +3860,9 @@ function CameraStoreProvider(_a) {
|
|
|
3860
3860
|
}, [preferFrontFacingCamera, preferIphoneContinuityCamera]);
|
|
3861
3861
|
useEffect(function () {
|
|
3862
3862
|
var _a;
|
|
3863
|
-
if (
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
var _a;
|
|
3867
|
-
return (_a = store.current) === null || _a === void 0 ? void 0 : _a.getState().releaseMicrophoneAccess();
|
|
3868
|
-
};
|
|
3863
|
+
if (requireMicrophoneAccess) {
|
|
3864
|
+
(_a = store.current) === null || _a === void 0 ? void 0 : _a.getState().requestMicrophoneAccess();
|
|
3865
|
+
}
|
|
3869
3866
|
}, [requireMicrophoneAccess]);
|
|
3870
3867
|
useEffect(function () {
|
|
3871
3868
|
return function () {
|
|
@@ -13048,18 +13045,25 @@ var useVideoRecorder = function useVideoRecorder(camera, audioStream, mergeAVStr
|
|
|
13048
13045
|
processAudio();
|
|
13049
13046
|
}
|
|
13050
13047
|
}, [audioRecordingIntentionallyStopped, audioRecordingStopped, processAudio]);
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13048
|
+
var clearRecordedData = useCallback(function () {
|
|
13049
|
+
videoChunks.current = [];
|
|
13050
|
+
audioChunks.current = [];
|
|
13051
|
+
}, []);
|
|
13052
|
+
return useMemo(function () {
|
|
13053
|
+
return {
|
|
13054
|
+
isRecordingVideo: isRecordingVideo,
|
|
13055
|
+
isRecordingAudio: isRecordingAudio,
|
|
13056
|
+
startRecordingVideo: startRecordingVideo,
|
|
13057
|
+
startRecordingAudio: startRecordingAudio,
|
|
13058
|
+
stopRecordingVideo: stopRecordingVideo,
|
|
13059
|
+
stopRecordingAudio: stopRecordingAudio,
|
|
13060
|
+
clearRecordedData: clearRecordedData,
|
|
13061
|
+
videoRecordingUnintentionallyStopped: videoRecordingStopped && !videoRecordingIntentionallyStopped,
|
|
13062
|
+
audioRecordingUnintentionallyStopped: audioRecordingStopped && !audioRecordingIntentionallyStopped,
|
|
13063
|
+
videoUrl: videoUrl,
|
|
13064
|
+
audioUrl: audioUrl
|
|
13065
|
+
};
|
|
13066
|
+
}, [audioRecordingIntentionallyStopped, audioRecordingStopped, audioUrl, clearRecordedData, isRecordingAudio, isRecordingVideo, startRecordingAudio, startRecordingVideo, stopRecordingAudio, stopRecordingVideo, videoRecordingIntentionallyStopped, videoRecordingStopped, videoUrl]);
|
|
13063
13067
|
};
|
|
13064
13068
|
|
|
13065
13069
|
var videoSignatureInitialState = {
|
|
@@ -13069,6 +13073,10 @@ var videoSignatureInitialState = {
|
|
|
13069
13073
|
stopRecording: function stopRecording() {
|
|
13070
13074
|
return null;
|
|
13071
13075
|
},
|
|
13076
|
+
clearRecordedData: function clearRecordedData() {
|
|
13077
|
+
return null;
|
|
13078
|
+
},
|
|
13079
|
+
isRecording: false,
|
|
13072
13080
|
signatureData: null,
|
|
13073
13081
|
signatureDataUrl: null,
|
|
13074
13082
|
signatureVideoData: null,
|
|
@@ -13112,17 +13120,28 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13112
13120
|
startRecordingVideo = _k.startRecordingVideo,
|
|
13113
13121
|
stopRecordingVideo = _k.stopRecordingVideo,
|
|
13114
13122
|
startRecordingAudio = _k.startRecordingAudio,
|
|
13115
|
-
stopRecordingAudio = _k.stopRecordingAudio
|
|
13123
|
+
stopRecordingAudio = _k.stopRecordingAudio,
|
|
13124
|
+
clearRecordedVideoData = _k.clearRecordedData;
|
|
13116
13125
|
var outputCanvas = useRef(null);
|
|
13117
13126
|
var recordingLock = useRef(false);
|
|
13127
|
+
var onRecordingStopped = useRef(function () {});
|
|
13118
13128
|
var _l = useState(false),
|
|
13119
13129
|
isRecording = _l[0],
|
|
13120
13130
|
setIsRecording = _l[1];
|
|
13121
13131
|
var startRecording = useCallback(function () {
|
|
13122
|
-
setIsRecording(true);
|
|
13132
|
+
return setIsRecording(true);
|
|
13123
13133
|
}, []);
|
|
13124
13134
|
var stopRecording = useCallback(function () {
|
|
13135
|
+
return setIsRecording(false);
|
|
13136
|
+
}, []);
|
|
13137
|
+
var clearRecordedData = useCallback(function () {
|
|
13138
|
+
var _a;
|
|
13139
|
+
recordingLock.current = false;
|
|
13140
|
+
onRecordingStopped.current = function () {
|
|
13141
|
+
return setIsRecording(true);
|
|
13142
|
+
};
|
|
13125
13143
|
setIsRecording(false);
|
|
13144
|
+
(_a = signatureRecorder.current) === null || _a === void 0 ? void 0 : _a.stop();
|
|
13126
13145
|
}, []);
|
|
13127
13146
|
useEffect(function () {
|
|
13128
13147
|
if (!isRecording) return;
|
|
@@ -13148,6 +13167,8 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13148
13167
|
_b.sent();
|
|
13149
13168
|
_b.label = 2;
|
|
13150
13169
|
case 2:
|
|
13170
|
+
recordedChunks.current = [];
|
|
13171
|
+
clearRecordedVideoData();
|
|
13151
13172
|
startRecordingVideo();
|
|
13152
13173
|
if (captureAudio) startRecordingAudio();
|
|
13153
13174
|
stream = outputCanvas.current.captureStream(24 /* fps */);
|
|
@@ -13172,13 +13193,14 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13172
13193
|
});
|
|
13173
13194
|
setSignatureVideoData(blob);
|
|
13174
13195
|
setSignatureVideoUrl(URL.createObjectURL(blob));
|
|
13196
|
+
onRecordingStopped.current();
|
|
13175
13197
|
};
|
|
13176
13198
|
return [2 /*return*/];
|
|
13177
13199
|
}
|
|
13178
13200
|
});
|
|
13179
13201
|
});
|
|
13180
13202
|
})();
|
|
13181
|
-
}, [audioStream, captureAudio, isRecording, startRecordingAudio, startRecordingVideo]);
|
|
13203
|
+
}, [audioStream, captureAudio, clearRecordedVideoData, isRecording, startRecordingAudio, startRecordingVideo]);
|
|
13182
13204
|
var animationFrame = useRef(0);
|
|
13183
13205
|
useEffect(function () {
|
|
13184
13206
|
if (!signaturePad.current || !videoRef.current || !outputCanvas.current || !camera || !isRecording || !isRecordingVideo) return;
|
|
@@ -13235,8 +13257,10 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13235
13257
|
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
13236
13258
|
var value = useMemo(function () {
|
|
13237
13259
|
return {
|
|
13260
|
+
isRecording: isRecording,
|
|
13238
13261
|
startRecording: startRecording,
|
|
13239
13262
|
stopRecording: stopRecording,
|
|
13263
|
+
clearRecordedData: clearRecordedData,
|
|
13240
13264
|
signaturePad: signaturePad,
|
|
13241
13265
|
signatureData: signatureData,
|
|
13242
13266
|
signatureDataUrl: signatureDataUrl,
|
|
@@ -13244,7 +13268,7 @@ function VideoSignatureContextProvider(_a) {
|
|
|
13244
13268
|
signatureVideoUrl: signatureVideoUrl,
|
|
13245
13269
|
onAcceptClicked: onAcceptClicked
|
|
13246
13270
|
};
|
|
13247
|
-
}, [onAcceptClicked, signatureData, signatureDataUrl, signatureVideoData, signatureVideoUrl, startRecording, stopRecording]);
|
|
13271
|
+
}, [clearRecordedData, isRecording, onAcceptClicked, signatureData, signatureDataUrl, signatureVideoData, signatureVideoUrl, startRecording, stopRecording]);
|
|
13248
13272
|
return /*#__PURE__*/React__default.createElement(VideoSignatureContext.Provider, {
|
|
13249
13273
|
value: value
|
|
13250
13274
|
}, children, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
|
|
@@ -13260,24 +13284,27 @@ function useVideoSignatureContext() {
|
|
|
13260
13284
|
}
|
|
13261
13285
|
|
|
13262
13286
|
function VideoSignatureGuides(_a) {
|
|
13263
|
-
var _b
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
faceGuideStatus = _d === void 0 ? 'success' : _d,
|
|
13287
|
+
var _b = _a.requestedAction,
|
|
13288
|
+
requestedAction = _b === void 0 ? 'VERIFY_LIVENESS' : _b,
|
|
13289
|
+
_c = _a.faceGuideStatus,
|
|
13290
|
+
faceGuideStatus = _c === void 0 ? 'success' : _c,
|
|
13268
13291
|
faceGuideBorderWidth = _a.faceGuideBorderWidth,
|
|
13269
13292
|
faceGuideBorderColor = _a.faceGuideBorderColor,
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13276
|
-
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13293
|
+
onClearSignaturePadClicked = _a.onClearSignaturePadClicked,
|
|
13294
|
+
_d = _a.classNames,
|
|
13295
|
+
classNames = _d === void 0 ? {} : _d,
|
|
13296
|
+
_e = _a.verbiage,
|
|
13297
|
+
rawVerbiage = _e === void 0 ? {} : _e;
|
|
13298
|
+
var _f = useResizeObserver(),
|
|
13299
|
+
ref = _f.ref,
|
|
13300
|
+
width = _f.width,
|
|
13301
|
+
height = _f.height;
|
|
13302
|
+
var _g = useVideoSignatureContext(),
|
|
13303
|
+
signaturePad = _g.signaturePad,
|
|
13304
|
+
onAcceptClicked = _g.onAcceptClicked;
|
|
13305
|
+
var _h = useState(true),
|
|
13306
|
+
isSignaturePadEmpty = _h[0],
|
|
13307
|
+
setIsSignaturePadEmpty = _h[1];
|
|
13281
13308
|
var verbiage = useTranslations(rawVerbiage, {
|
|
13282
13309
|
clearSignatureBtnText: 'Clear',
|
|
13283
13310
|
acceptSignatureBtnText: 'Accept'
|
|
@@ -13311,19 +13338,28 @@ function VideoSignatureGuides(_a) {
|
|
|
13311
13338
|
className: classNames.signatureCanvasInner
|
|
13312
13339
|
}, /*#__PURE__*/React__default.createElement(SignatureCanvas, {
|
|
13313
13340
|
ref: signaturePad,
|
|
13314
|
-
canvasProps: canvasProps
|
|
13341
|
+
canvasProps: canvasProps,
|
|
13342
|
+
onEnd: function onEnd() {
|
|
13343
|
+
var _a;
|
|
13344
|
+
setIsSignaturePadEmpty(!!((_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.isEmpty()));
|
|
13345
|
+
}
|
|
13315
13346
|
})), /*#__PURE__*/React__default.createElement(SignatureButtonsContainer, {
|
|
13316
13347
|
className: classNames.signatureButtonsRow
|
|
13317
13348
|
}, /*#__PURE__*/React__default.createElement(LoaderButton, {
|
|
13318
13349
|
variant: "secondary",
|
|
13319
13350
|
className: classNames.clearSignatureBtn,
|
|
13320
|
-
onClick: (
|
|
13351
|
+
onClick: function onClick() {
|
|
13352
|
+
var _a, _b;
|
|
13353
|
+
(_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.clear();
|
|
13354
|
+
setIsSignaturePadEmpty(!!((_b = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _b === void 0 ? void 0 : _b.isEmpty()));
|
|
13355
|
+
onClearSignaturePadClicked === null || onClearSignaturePadClicked === void 0 ? void 0 : onClearSignaturePadClicked();
|
|
13356
|
+
},
|
|
13321
13357
|
disabled: requestedAction === 'VERIFY_LIVENESS',
|
|
13322
13358
|
finished: true
|
|
13323
13359
|
}, verbiage.clearSignatureBtnText), /*#__PURE__*/React__default.createElement(AcceptBtn, {
|
|
13324
13360
|
variant: "positive",
|
|
13325
13361
|
className: classNames.acceptSignatureBtn,
|
|
13326
|
-
disabled: requestedAction === 'VERIFY_LIVENESS',
|
|
13362
|
+
disabled: requestedAction === 'VERIFY_LIVENESS' || isSignaturePadEmpty,
|
|
13327
13363
|
onClick: onAcceptClicked,
|
|
13328
13364
|
finished: true
|
|
13329
13365
|
}, verbiage.acceptSignatureBtnText))))));
|
|
@@ -13347,30 +13383,32 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13347
13383
|
var onVideoCaptured = _a.onVideoCaptured,
|
|
13348
13384
|
onFaceNotDetected = _a.onFaceNotDetected,
|
|
13349
13385
|
onExit = _a.onExit,
|
|
13386
|
+
_c = _a.restartVideoOnSignaturePadCleared,
|
|
13387
|
+
restartVideoOnSignaturePadCleared = _c === void 0 ? true : _c,
|
|
13350
13388
|
guidesComponent = _a.guidesComponent,
|
|
13351
|
-
|
|
13352
|
-
classNames =
|
|
13353
|
-
|
|
13354
|
-
colors =
|
|
13355
|
-
|
|
13356
|
-
rawVerbiage =
|
|
13357
|
-
|
|
13358
|
-
debugMode =
|
|
13389
|
+
_d = _a.classNames,
|
|
13390
|
+
classNames = _d === void 0 ? {} : _d,
|
|
13391
|
+
_e = _a.colors,
|
|
13392
|
+
colors = _e === void 0 ? {} : _e,
|
|
13393
|
+
_f = _a.verbiage,
|
|
13394
|
+
rawVerbiage = _f === void 0 ? {} : _f,
|
|
13395
|
+
_g = _a.debugMode,
|
|
13396
|
+
debugMode = _g === void 0 ? false : _g;
|
|
13359
13397
|
var camera = useCameraStore(function (state) {
|
|
13360
13398
|
return state.camera;
|
|
13361
13399
|
});
|
|
13362
13400
|
var onPredictionMade = useContext(SelfieGuidanceModelsContext).onPredictionMade;
|
|
13363
|
-
var
|
|
13364
|
-
signatureData =
|
|
13365
|
-
signatureDataUrl =
|
|
13366
|
-
signatureVideoData =
|
|
13367
|
-
startRecording =
|
|
13368
|
-
stopRecording =
|
|
13401
|
+
var _h = useVideoSignatureContext(),
|
|
13402
|
+
signatureData = _h.signatureData,
|
|
13403
|
+
signatureDataUrl = _h.signatureDataUrl,
|
|
13404
|
+
signatureVideoData = _h.signatureVideoData,
|
|
13405
|
+
startRecording = _h.startRecording,
|
|
13406
|
+
stopRecording = _h.stopRecording,
|
|
13407
|
+
clearRecordedData = _h.clearRecordedData,
|
|
13408
|
+
isRecording = _h.isRecording;
|
|
13369
13409
|
useEffect(function () {
|
|
13370
13410
|
startRecording();
|
|
13371
|
-
return
|
|
13372
|
-
stopRecording();
|
|
13373
|
-
};
|
|
13411
|
+
return stopRecording;
|
|
13374
13412
|
}, [startRecording, stopRecording]);
|
|
13375
13413
|
colors.guidanceMessageBackgroundColor || (colors.guidanceMessageBackgroundColor = '#ccc');
|
|
13376
13414
|
colors.guidanceMessageTextColor || (colors.guidanceMessageTextColor = 'black');
|
|
@@ -13382,9 +13420,9 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13382
13420
|
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(signatureVideoData, signatureData, signatureDataUrl);
|
|
13383
13421
|
}
|
|
13384
13422
|
}, [onVideoCaptured, signatureData, signatureDataUrl, signatureVideoData]);
|
|
13385
|
-
var
|
|
13386
|
-
numFramesWithoutFaces =
|
|
13387
|
-
setNumFramesWithoutFaces =
|
|
13423
|
+
var _j = useState(0),
|
|
13424
|
+
numFramesWithoutFaces = _j[0],
|
|
13425
|
+
setNumFramesWithoutFaces = _j[1];
|
|
13388
13426
|
useEffect(function () {
|
|
13389
13427
|
onPredictionMade(function (_a) {
|
|
13390
13428
|
var face = _a.face;
|
|
@@ -13409,9 +13447,10 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13409
13447
|
"$background": colors.guidanceMessageBackgroundColor,
|
|
13410
13448
|
"$textColor": colors.guidanceMessageTextColor
|
|
13411
13449
|
}, verbiage.guidanceMessageText))), /*#__PURE__*/React__default.createElement(GuidesComponent, {
|
|
13450
|
+
status: "success",
|
|
13412
13451
|
classNames: classNames.videoSignatureGuidesClassNames,
|
|
13413
|
-
|
|
13414
|
-
}), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", camera === null || camera === void 0 ? void 0 : camera.width, "x", camera === null || camera === void 0 ? void 0 : camera.height)), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
|
|
13452
|
+
onClearSignaturePadClicked: restartVideoOnSignaturePadCleared ? clearRecordedData : undefined
|
|
13453
|
+
}), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, "Video: ", camera === null || camera === void 0 ? void 0 : camera.width, "x", camera === null || camera === void 0 ? void 0 : camera.height, /*#__PURE__*/React__default.createElement("br", null), "Recording: ", isRecording ? 'true' : 'false')), /*#__PURE__*/React__default.createElement(ExitCaptureButton, {
|
|
13415
13454
|
onClick: onExit,
|
|
13416
13455
|
className: classNames.exitCaptureBtn
|
|
13417
13456
|
}));
|
|
@@ -13490,37 +13529,30 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13490
13529
|
captureAudio = _e === void 0 ? false : _e,
|
|
13491
13530
|
_f = _a.allowSignatureAfterLivenessCheckFailure,
|
|
13492
13531
|
allowSignatureAfterLivenessCheckFailure = _f === void 0 ? false : _f,
|
|
13532
|
+
_g = _a.restartVideoOnSignaturePadCleared,
|
|
13533
|
+
restartVideoOnSignaturePadCleared = _g === void 0 ? true : _g,
|
|
13493
13534
|
faceLivenessProps = _a.faceLivenessProps,
|
|
13494
|
-
|
|
13495
|
-
assets =
|
|
13496
|
-
|
|
13497
|
-
classNames =
|
|
13498
|
-
|
|
13499
|
-
colors =
|
|
13500
|
-
|
|
13501
|
-
verbiage =
|
|
13502
|
-
|
|
13503
|
-
debugMode =
|
|
13504
|
-
var
|
|
13505
|
-
selfieImage =
|
|
13506
|
-
setSelfieImage =
|
|
13507
|
-
setSignatureData =
|
|
13508
|
-
setSignatureVideoUrl =
|
|
13509
|
-
logSelfieCaptureAttempt =
|
|
13510
|
-
var
|
|
13511
|
-
|
|
13512
|
-
|
|
13513
|
-
|
|
13514
|
-
|
|
13515
|
-
requestMicrophoneAccess: state.requestMicrophoneAccess,
|
|
13516
|
-
releaseMicrophoneAccess: state.releaseMicrophoneAccess
|
|
13517
|
-
};
|
|
13518
|
-
})),
|
|
13519
|
-
cameraAccessDenied = _o.cameraAccessDenied,
|
|
13520
|
-
requestCameraAccess = _o.requestCameraAccess,
|
|
13521
|
-
releaseCameraAccess = _o.releaseCameraAccess,
|
|
13522
|
-
requestMicrophoneAccess = _o.requestMicrophoneAccess,
|
|
13523
|
-
releaseMicrophoneAccess = _o.releaseMicrophoneAccess;
|
|
13535
|
+
_h = _a.assets,
|
|
13536
|
+
assets = _h === void 0 ? {} : _h,
|
|
13537
|
+
_j = _a.classNames,
|
|
13538
|
+
classNames = _j === void 0 ? {} : _j,
|
|
13539
|
+
_k = _a.colors,
|
|
13540
|
+
colors = _k === void 0 ? {} : _k,
|
|
13541
|
+
_l = _a.verbiage,
|
|
13542
|
+
verbiage = _l === void 0 ? {} : _l,
|
|
13543
|
+
_m = _a.debugMode,
|
|
13544
|
+
debugMode = _m === void 0 ? false : _m;
|
|
13545
|
+
var _o = useContext(SubmissionContext),
|
|
13546
|
+
selfieImage = _o.selfieImage,
|
|
13547
|
+
setSelfieImage = _o.setSelfieImage,
|
|
13548
|
+
setSignatureData = _o.setSignatureData,
|
|
13549
|
+
setSignatureVideoUrl = _o.setSignatureVideoUrl,
|
|
13550
|
+
logSelfieCaptureAttempt = _o.logSelfieCaptureAttempt;
|
|
13551
|
+
var cameraAccessDenied = useCameraStore(useShallow(function (state) {
|
|
13552
|
+
return {
|
|
13553
|
+
cameraAccessDenied: state.cameraAccessDenied
|
|
13554
|
+
};
|
|
13555
|
+
})).cameraAccessDenied;
|
|
13524
13556
|
var _p = useState('CHECKING_LIVENESS'),
|
|
13525
13557
|
captureState = _p[0],
|
|
13526
13558
|
setCaptureState = _p[1];
|
|
@@ -13581,21 +13613,13 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13581
13613
|
var _s = useState(0),
|
|
13582
13614
|
attempt = _s[0],
|
|
13583
13615
|
setAttempt = _s[1];
|
|
13584
|
-
var
|
|
13585
|
-
|
|
13586
|
-
releaseMicrophoneAccess();
|
|
13616
|
+
var onRetry = useCallback(function () {
|
|
13617
|
+
onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
|
|
13587
13618
|
setAttempt(function (n) {
|
|
13588
13619
|
return n + 1;
|
|
13589
13620
|
});
|
|
13590
13621
|
setCaptureState('CHECKING_LIVENESS');
|
|
13591
|
-
|
|
13592
|
-
void requestCameraAccess();
|
|
13593
|
-
if (captureAudio) void requestMicrophoneAccess();
|
|
13594
|
-
}, [captureAudio, onExitCapture, releaseCameraAccess, releaseMicrophoneAccess, requestCameraAccess, requestMicrophoneAccess]);
|
|
13595
|
-
var onRetry = useCallback(function () {
|
|
13596
|
-
onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
|
|
13597
|
-
onExit();
|
|
13598
|
-
}, [onExit, onRetryClicked]);
|
|
13622
|
+
}, [onRetryClicked]);
|
|
13599
13623
|
var showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, captureState === 'SUCCESS', onComplete);
|
|
13600
13624
|
useEffect(function () {
|
|
13601
13625
|
if (cameraAccessDenied) {
|
|
@@ -13605,14 +13629,12 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13605
13629
|
setCaptureState('CHECKING_LIVENESS');
|
|
13606
13630
|
}
|
|
13607
13631
|
}, [cameraAccessDenied]);
|
|
13608
|
-
var guidesComponent = useCallback(function (
|
|
13609
|
-
|
|
13610
|
-
return /*#__PURE__*/React__default.createElement(VideoSignatureGuides, {
|
|
13632
|
+
var guidesComponent = useCallback(function (props) {
|
|
13633
|
+
return /*#__PURE__*/React__default.createElement(VideoSignatureWizardGuides, _assign({}, props, {
|
|
13611
13634
|
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames,
|
|
13612
|
-
|
|
13613
|
-
|
|
13614
|
-
|
|
13615
|
-
}, [classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames]);
|
|
13635
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared
|
|
13636
|
+
}));
|
|
13637
|
+
}, [classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames, restartVideoOnSignaturePadCleared]);
|
|
13616
13638
|
var onExitAfterFailureProp = faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onExitAfterFailure;
|
|
13617
13639
|
var onExitAfterFailure = useCallback(function (resp, req) {
|
|
13618
13640
|
onExitAfterFailureProp === null || onExitAfterFailureProp === void 0 ? void 0 : onExitAfterFailureProp(resp, req);
|
|
@@ -13638,7 +13660,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13638
13660
|
key: "face-liveness-".concat(attempt)
|
|
13639
13661
|
}, faceLivenessProps, {
|
|
13640
13662
|
onSuccess: onFaceCaptureSuccess,
|
|
13641
|
-
onExitCapture:
|
|
13663
|
+
onExitCapture: onExitCapture,
|
|
13642
13664
|
onUserCancel: onUserCancel,
|
|
13643
13665
|
onExitAfterFailure: onExitAfterFailure,
|
|
13644
13666
|
onLoadingOverlayDismissed: onLoadingOverlayDismissedCallback,
|
|
@@ -13650,14 +13672,14 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13650
13672
|
colors: colors.faceLiveness,
|
|
13651
13673
|
verbiage: verbiage.faceLiveness,
|
|
13652
13674
|
debugMode: debugMode,
|
|
13653
|
-
releaseCameraAccessOnExit: false,
|
|
13654
13675
|
renderCameraFeed: false
|
|
13655
13676
|
}));
|
|
13656
13677
|
case 'CAPTURING_SIGNATURE':
|
|
13657
13678
|
return /*#__PURE__*/React__default.createElement(VideoSignatureCapture, {
|
|
13658
13679
|
onVideoCaptured: onSignatureCaptureCompleted,
|
|
13659
13680
|
onFaceNotDetected: onSignatureCaptureFacesNotDetected,
|
|
13660
|
-
onExit:
|
|
13681
|
+
onExit: onExitCapture,
|
|
13682
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared,
|
|
13661
13683
|
guidesComponent: guidesComponent,
|
|
13662
13684
|
classNames: classNames,
|
|
13663
13685
|
colors: colors,
|
|
@@ -13679,6 +13701,49 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13679
13701
|
}
|
|
13680
13702
|
}()));
|
|
13681
13703
|
};
|
|
13704
|
+
function VideoSignatureWizardGuides(_a) {
|
|
13705
|
+
var status = _a.status,
|
|
13706
|
+
classNames = _a.classNames,
|
|
13707
|
+
_b = _a.restartVideoOnSignaturePadCleared,
|
|
13708
|
+
restartVideoOnSignaturePadCleared = _b === void 0 ? true : _b;
|
|
13709
|
+
var clearRecordedData = useVideoSignatureContext().clearRecordedData;
|
|
13710
|
+
return /*#__PURE__*/React__default.createElement(VideoSignatureGuides, {
|
|
13711
|
+
classNames: classNames,
|
|
13712
|
+
faceGuideStatus: status,
|
|
13713
|
+
requestedAction: status === 'success' ? 'CAPTURE_SIGNATURE' : 'VERIFY_LIVENESS',
|
|
13714
|
+
onClearSignaturePadClicked: restartVideoOnSignaturePadCleared ? clearRecordedData : undefined
|
|
13715
|
+
});
|
|
13716
|
+
}
|
|
13717
|
+
var VideoSignatureWizardWithProviders = function VideoSignatureWizardWithProviders(props) {
|
|
13718
|
+
var _a = useState(0),
|
|
13719
|
+
attempts = _a[0],
|
|
13720
|
+
setAttempts = _a[1];
|
|
13721
|
+
var onRetryClickedProp = props.onRetryClicked;
|
|
13722
|
+
var onRetryClicked = useCallback(function () {
|
|
13723
|
+
setAttempts(function (n) {
|
|
13724
|
+
return n + 1;
|
|
13725
|
+
});
|
|
13726
|
+
onRetryClickedProp === null || onRetryClickedProp === void 0 ? void 0 : onRetryClickedProp();
|
|
13727
|
+
}, [onRetryClickedProp]);
|
|
13728
|
+
return /*#__PURE__*/React__default.createElement(CameraStoreProvider, {
|
|
13729
|
+
key: "camera-store-".concat(attempts),
|
|
13730
|
+
preferIphoneContinuityCamera: false,
|
|
13731
|
+
preferFrontFacingCamera: true,
|
|
13732
|
+
requireMicrophoneAccess: props.captureAudio,
|
|
13733
|
+
maxVideoWidth: 1280,
|
|
13734
|
+
maxFps: 30,
|
|
13735
|
+
onCameraAccessDenied: props.onCameraAccessDenied,
|
|
13736
|
+
onMicrophoneAccessDenied: props.onMicrophoneAccessDenied
|
|
13737
|
+
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
13738
|
+
autoStart: false,
|
|
13739
|
+
throttleMs: 250,
|
|
13740
|
+
onModelError: props.onModelError,
|
|
13741
|
+
modelLoadTimeoutMs: props.modelLoadTimeoutMs,
|
|
13742
|
+
requireVerticalFaceCentering: false
|
|
13743
|
+
}, /*#__PURE__*/React__default.createElement(VideoSignatureWizard, _assign({}, props, {
|
|
13744
|
+
onRetryClicked: onRetryClicked
|
|
13745
|
+
}))));
|
|
13746
|
+
};
|
|
13682
13747
|
|
|
13683
13748
|
var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
13684
13749
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
@@ -14952,23 +15017,11 @@ function CompositeWizard(_a) {
|
|
|
14952
15017
|
onAccept: onSignatureCaptureSuccess
|
|
14953
15018
|
}));
|
|
14954
15019
|
case 'VideoSignatureCapture':
|
|
14955
|
-
return /*#__PURE__*/React__default.createElement(
|
|
14956
|
-
|
|
14957
|
-
preferFrontFacingCamera: true,
|
|
14958
|
-
requireMicrophoneAccess: videoSignatureCaptureProps.captureAudio,
|
|
14959
|
-
maxVideoWidth: 1280,
|
|
14960
|
-
maxFps: 30,
|
|
15020
|
+
return /*#__PURE__*/React__default.createElement(VideoSignatureWizardWithProviders, _assign({}, videoSignatureCaptureProps, {
|
|
15021
|
+
onComplete: onVideoSignatureComplete,
|
|
14961
15022
|
onCameraAccessDenied: onCameraAccessDenied,
|
|
14962
15023
|
onMicrophoneAccessDenied: onMicrophoneAccessDenied
|
|
14963
|
-
}
|
|
14964
|
-
autoStart: false,
|
|
14965
|
-
throttleMs: 250,
|
|
14966
|
-
onModelError: videoSignatureCaptureProps.onModelError,
|
|
14967
|
-
modelLoadTimeoutMs: videoSignatureCaptureProps.modelLoadTimeoutMs,
|
|
14968
|
-
requireVerticalFaceCentering: false
|
|
14969
|
-
}, /*#__PURE__*/React__default.createElement(VideoSignatureWizard, _assign({}, videoSignatureCaptureProps, {
|
|
14970
|
-
onComplete: onVideoSignatureComplete
|
|
14971
|
-
}))));
|
|
15024
|
+
}));
|
|
14972
15025
|
case 'AdditionalDocumentCapture':
|
|
14973
15026
|
return /*#__PURE__*/React__default.createElement(AdditionalDocumentCaptureWizard, _assign({}, additionalDocumentCaptureProps, {
|
|
14974
15027
|
documents: documents,
|
|
@@ -17285,16 +17338,18 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
17285
17338
|
modelLoadTimeoutMs = _f === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _f,
|
|
17286
17339
|
_g = _a.allowSignatureAfterLivenessCheckFailure,
|
|
17287
17340
|
allowSignatureAfterLivenessCheckFailure = _g === void 0 ? false : _g,
|
|
17341
|
+
_h = _a.restartVideoOnSignaturePadCleared,
|
|
17342
|
+
restartVideoOnSignaturePadCleared = _h === void 0 ? true : _h,
|
|
17288
17343
|
faceLivenessProps = _a.faceLivenessProps,
|
|
17289
|
-
|
|
17290
|
-
theme =
|
|
17344
|
+
_j = _a.theme,
|
|
17345
|
+
theme = _j === void 0 ? 'default' : _j,
|
|
17291
17346
|
classNames = _a.classNames,
|
|
17292
17347
|
colors = _a.colors,
|
|
17293
17348
|
verbiage = _a.verbiage,
|
|
17294
17349
|
geolocationEnabled = _a.geolocationEnabled,
|
|
17295
17350
|
geolocationRequired = _a.geolocationRequired,
|
|
17296
|
-
|
|
17297
|
-
debugMode =
|
|
17351
|
+
_k = _a.debugMode,
|
|
17352
|
+
debugMode = _k === void 0 ? false : _k;
|
|
17298
17353
|
useLanguage(lang);
|
|
17299
17354
|
useDebugLogging(debugMode);
|
|
17300
17355
|
return /*#__PURE__*/React__default.createElement(AuthProvider, {
|
|
@@ -17338,6 +17393,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
17338
17393
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
17339
17394
|
faceLivenessProps: faceLivenessProps,
|
|
17340
17395
|
allowSignatureAfterLivenessCheckFailure: allowSignatureAfterLivenessCheckFailure,
|
|
17396
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared,
|
|
17341
17397
|
classNames: classNames,
|
|
17342
17398
|
colors: colors,
|
|
17343
17399
|
debugMode: debugMode,
|
|
@@ -17345,7 +17401,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
17345
17401
|
onModelError: onModelError,
|
|
17346
17402
|
onUserCancel: onUserCancel
|
|
17347
17403
|
};
|
|
17348
|
-
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
17404
|
+
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
17349
17405
|
}))));
|
|
17350
17406
|
};
|
|
17351
17407
|
|