idmission-web-sdk 1.0.181 → 1.0.183
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/customer_flows/VideoIdValidation.d.ts +6 -2
- package/dist/components/video_id/IdVideoCapture.d.ts +4 -2
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +4 -2
- package/dist/sdk2.cjs.development.js +152 -128
- 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 +152 -128
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +152 -128
- 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
|
@@ -89,8 +89,12 @@ export interface VideoIdValidationProps extends PropsWithChildren {
|
|
|
89
89
|
idCardFrontFocusThreshold?: number;
|
|
90
90
|
/** Number of good frames of the ID card front that must be captured before moving on during video capture. */
|
|
91
91
|
goodIdCardFrontFramesThreshold?: number;
|
|
92
|
-
/**
|
|
93
|
-
|
|
92
|
+
/** Number between 0 and 1 at which document detection guidance score condition is considered to be met for the ID card back during video capture. */
|
|
93
|
+
idCardBackDetectionThreshold?: number;
|
|
94
|
+
/** Number between 0 and 1 at which focus guidance score condition is considered to be met for the ID card back during video capture. */
|
|
95
|
+
idCardBackFocusThreshold?: number;
|
|
96
|
+
/** Number of good frames of the ID card back that must be captured before moving on during video capture. */
|
|
97
|
+
goodIdCardBackFramesThreshold?: number;
|
|
94
98
|
/** An optional text prompt to display on screen for the user to read during video capture after the ID card has been shown. */
|
|
95
99
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
96
100
|
/** The duration of time in milliseconds that the user is allowed to spend reading the `readTextPrompt`. */
|
|
@@ -27,9 +27,11 @@ export type IdVideoCaptureProps = {
|
|
|
27
27
|
onIdBackImageCaptured?: (imageUrl: string) => void;
|
|
28
28
|
onFaceNotDetected?: () => void;
|
|
29
29
|
idCardFrontDetectionThreshold?: number;
|
|
30
|
+
idCardBackDetectionThreshold?: number;
|
|
30
31
|
idCardFrontFocusThreshold?: number;
|
|
32
|
+
idCardBackFocusThreshold?: number;
|
|
31
33
|
goodIdCardFrontFramesThreshold?: number;
|
|
32
|
-
|
|
34
|
+
goodIdCardBackFramesThreshold?: number;
|
|
33
35
|
skipShowIdCardBack?: boolean | (() => Promise<boolean>);
|
|
34
36
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
35
37
|
readTextTimeoutDurationMs?: number;
|
|
@@ -39,4 +41,4 @@ export type IdVideoCaptureProps = {
|
|
|
39
41
|
verbiage?: IdVideoCaptureVerbiage;
|
|
40
42
|
debugMode?: boolean;
|
|
41
43
|
};
|
|
42
|
-
export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold,
|
|
44
|
+
export declare const IdVideoCapture: ({ onComplete, onIdFrontImageCaptured, onIdBackImageCaptured, onFaceNotDetected, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, idCardBackDetectionThreshold, idCardBackFocusThreshold, goodIdCardBackFramesThreshold, skipShowIdCardBack, readTextPrompt, readTextTimeoutDurationMs, assets, classNames, colors, verbiage: rawVerbiage, debugMode, }: IdVideoCaptureProps) => ReactElement;
|
|
@@ -37,9 +37,11 @@ export type VideoIdWizardProps = {
|
|
|
37
37
|
idCaptureProps?: IdCaptureWizardProps;
|
|
38
38
|
faceLivenessProps?: FaceLivenessWizardProps;
|
|
39
39
|
idCardFrontDetectionThreshold?: number;
|
|
40
|
+
idCardBackDetectionThreshold?: number;
|
|
40
41
|
idCardFrontFocusThreshold?: number;
|
|
42
|
+
idCardBackFocusThreshold?: number;
|
|
41
43
|
goodIdCardFrontFramesThreshold?: number;
|
|
42
|
-
|
|
44
|
+
goodIdCardBackFramesThreshold?: number;
|
|
43
45
|
readTextPrompt?: CustomerSuppliedVerbiage;
|
|
44
46
|
readTextTimeoutDurationMs?: number;
|
|
45
47
|
skipSuccessScreen?: boolean | (() => Promise<boolean>);
|
|
@@ -53,4 +55,4 @@ export type VideoIdWizardProps = {
|
|
|
53
55
|
verbiage?: VideoIdWizardVerbiage;
|
|
54
56
|
debugMode?: boolean;
|
|
55
57
|
};
|
|
56
|
-
export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, idCaptureProps, faceLivenessProps, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold,
|
|
58
|
+
export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, idCaptureProps, faceLivenessProps, idCardFrontDetectionThreshold, idCardBackDetectionThreshold, idCardFrontFocusThreshold, idCardBackFocusThreshold, goodIdCardFrontFramesThreshold, goodIdCardBackFramesThreshold, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, idCaptureGuideType, idCapturePortraitGuidesOnMobile, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
|
|
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
48
48
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
49
49
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
50
50
|
|
|
51
|
-
var webSdkVersion = '1.0.
|
|
51
|
+
var webSdkVersion = '1.0.183';
|
|
52
52
|
|
|
53
53
|
function getPlatform() {
|
|
54
54
|
if (typeof window === 'undefined') return;
|
|
@@ -8853,6 +8853,9 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
|
|
|
8853
8853
|
var resetBestFrame = React.useCallback(function () {
|
|
8854
8854
|
bestFocusScore.current = 0;
|
|
8855
8855
|
clearCanvas(bestPredictionCanvas.current);
|
|
8856
|
+
setBestFrameBoundingBox([]);
|
|
8857
|
+
setBestFrameDetectionScore(0);
|
|
8858
|
+
setBestFrameFocusScore(0);
|
|
8856
8859
|
}, []);
|
|
8857
8860
|
var value = React.useMemo(function () {
|
|
8858
8861
|
return {
|
|
@@ -9658,7 +9661,7 @@ var esTranslation = {
|
|
|
9658
9661
|
'Document Capture': 'Captura de documento',
|
|
9659
9662
|
Capture: 'Capturar',
|
|
9660
9663
|
'Retry capture': 'Reintentar la captura',
|
|
9661
|
-
Upload: '
|
|
9664
|
+
Upload: 'Enviar',
|
|
9662
9665
|
'Uploading...': 'Procesando...',
|
|
9663
9666
|
'Upload succeeded!': 'Proceso completo!',
|
|
9664
9667
|
'Display the front of your ID card...': 'Hay que mostrar el frente de la identificación...',
|
|
@@ -10863,6 +10866,7 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
|
|
|
10863
10866
|
"$padding": imagePadding,
|
|
10864
10867
|
"$transitionTime": transitionTime,
|
|
10865
10868
|
"$transforms": frontTransforms.join(' '),
|
|
10869
|
+
"$visible": true,
|
|
10866
10870
|
onLoad: onImageLoaded
|
|
10867
10871
|
}), /*#__PURE__*/React__default['default'].createElement(FlippingImageBack, {
|
|
10868
10872
|
src: orientation === 'portrait' ? assets.backPortraitGuidesImageUrl : assets.backLandscapeGuidesImageUrl,
|
|
@@ -10872,7 +10876,8 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
|
|
|
10872
10876
|
"$height": imageHeight,
|
|
10873
10877
|
"$padding": imagePadding,
|
|
10874
10878
|
"$transitionTime": transitionTime,
|
|
10875
|
-
"$transforms": backTransforms.join(' ')
|
|
10879
|
+
"$transforms": backTransforms.join(' '),
|
|
10880
|
+
"$visible": true
|
|
10876
10881
|
}))), /*#__PURE__*/React__default['default'].createElement(GuideRegion, {
|
|
10877
10882
|
"$minWidth": padding,
|
|
10878
10883
|
"$maskColor": maskColor,
|
|
@@ -14015,59 +14020,64 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14015
14020
|
onIdBackImageCaptured = _a.onIdBackImageCaptured,
|
|
14016
14021
|
onFaceNotDetected = _a.onFaceNotDetected,
|
|
14017
14022
|
_j = _a.idCardFrontDetectionThreshold,
|
|
14018
|
-
idCardFrontDetectionThreshold = _j === void 0 ? 0.
|
|
14023
|
+
idCardFrontDetectionThreshold = _j === void 0 ? 0.6 : _j,
|
|
14019
14024
|
_k = _a.idCardFrontFocusThreshold,
|
|
14020
14025
|
idCardFrontFocusThreshold = _k === void 0 ? 0 : _k,
|
|
14021
14026
|
_l = _a.goodIdCardFrontFramesThreshold,
|
|
14022
14027
|
goodIdCardFrontFramesThreshold = _l === void 0 ? 3 : _l,
|
|
14023
|
-
_m = _a.
|
|
14024
|
-
|
|
14025
|
-
_o = _a.
|
|
14026
|
-
|
|
14028
|
+
_m = _a.idCardBackDetectionThreshold,
|
|
14029
|
+
idCardBackDetectionThreshold = _m === void 0 ? 0.6 : _m,
|
|
14030
|
+
_o = _a.idCardBackFocusThreshold,
|
|
14031
|
+
idCardBackFocusThreshold = _o === void 0 ? 0 : _o,
|
|
14032
|
+
_p = _a.goodIdCardBackFramesThreshold,
|
|
14033
|
+
goodIdCardBackFramesThreshold = _p === void 0 ? 3 : _p,
|
|
14034
|
+
_q = _a.skipShowIdCardBack,
|
|
14035
|
+
skipShowIdCardBack = _q === void 0 ? false : _q,
|
|
14027
14036
|
readTextPrompt = _a.readTextPrompt,
|
|
14028
|
-
|
|
14029
|
-
readTextTimeoutDurationMs =
|
|
14030
|
-
|
|
14031
|
-
assets =
|
|
14032
|
-
|
|
14033
|
-
classNames =
|
|
14034
|
-
|
|
14035
|
-
colors =
|
|
14036
|
-
|
|
14037
|
-
rawVerbiage =
|
|
14038
|
-
|
|
14039
|
-
debugMode =
|
|
14040
|
-
var
|
|
14041
|
-
ref =
|
|
14042
|
-
|
|
14043
|
-
width =
|
|
14044
|
-
|
|
14045
|
-
height =
|
|
14046
|
-
var
|
|
14047
|
-
cameraRef =
|
|
14048
|
-
videoRef =
|
|
14049
|
-
videoLoaded =
|
|
14050
|
-
cameraReady =
|
|
14051
|
-
var
|
|
14052
|
-
detectedObjects =
|
|
14053
|
-
setDetectedObjects =
|
|
14054
|
-
var
|
|
14055
|
-
faces =
|
|
14056
|
-
setFaces =
|
|
14057
|
-
var
|
|
14058
|
-
idModelsReady =
|
|
14059
|
-
idModelsWorking =
|
|
14060
|
-
makeIdPrediction =
|
|
14061
|
-
onIdPredictionMade =
|
|
14062
|
-
setThresholds =
|
|
14063
|
-
bestFrameDetectionScore =
|
|
14064
|
-
bestFrameFocusScore =
|
|
14037
|
+
_r = _a.readTextTimeoutDurationMs,
|
|
14038
|
+
readTextTimeoutDurationMs = _r === void 0 ? 15000 : _r,
|
|
14039
|
+
_s = _a.assets,
|
|
14040
|
+
assets = _s === void 0 ? {} : _s,
|
|
14041
|
+
_t = _a.classNames,
|
|
14042
|
+
classNames = _t === void 0 ? {} : _t,
|
|
14043
|
+
_u = _a.colors,
|
|
14044
|
+
colors = _u === void 0 ? {} : _u,
|
|
14045
|
+
_v = _a.verbiage,
|
|
14046
|
+
rawVerbiage = _v === void 0 ? {} : _v,
|
|
14047
|
+
_w = _a.debugMode,
|
|
14048
|
+
debugMode = _w === void 0 ? false : _w;
|
|
14049
|
+
var _x = useResizeObserver__default['default'](),
|
|
14050
|
+
ref = _x.ref,
|
|
14051
|
+
_y = _x.width,
|
|
14052
|
+
width = _y === void 0 ? 1 : _y,
|
|
14053
|
+
_z = _x.height,
|
|
14054
|
+
height = _z === void 0 ? 1 : _z;
|
|
14055
|
+
var _0 = React.useContext(CameraStateContext),
|
|
14056
|
+
cameraRef = _0.cameraRef,
|
|
14057
|
+
videoRef = _0.videoRef,
|
|
14058
|
+
videoLoaded = _0.videoLoaded,
|
|
14059
|
+
cameraReady = _0.cameraReady;
|
|
14060
|
+
var _1 = React.useState([]),
|
|
14061
|
+
detectedObjects = _1[0],
|
|
14062
|
+
setDetectedObjects = _1[1];
|
|
14063
|
+
var _2 = React.useState([]),
|
|
14064
|
+
faces = _2[0],
|
|
14065
|
+
setFaces = _2[1];
|
|
14066
|
+
var _3 = React.useContext(IdCaptureModelsContext),
|
|
14067
|
+
idModelsReady = _3.ready,
|
|
14068
|
+
idModelsWorking = _3.working,
|
|
14069
|
+
makeIdPrediction = _3.makePrediction,
|
|
14070
|
+
onIdPredictionMade = _3.onPredictionMade,
|
|
14071
|
+
setThresholds = _3.setThresholds,
|
|
14072
|
+
bestFrameDetectionScore = _3.bestFrameDetectionScore,
|
|
14073
|
+
bestFrameFocusScore = _3.bestFrameFocusScore,
|
|
14074
|
+
resetBestFrame = _3.resetBestFrame;
|
|
14065
14075
|
var onSelfiePredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
|
|
14066
|
-
var
|
|
14067
|
-
isRecording =
|
|
14068
|
-
startRecording =
|
|
14069
|
-
stopRecording =
|
|
14070
|
-
videoUrl =
|
|
14076
|
+
var _4 = useVideoRecorder(cameraRef.current),
|
|
14077
|
+
isRecording = _4.isRecording,
|
|
14078
|
+
startRecording = _4.startRecording,
|
|
14079
|
+
stopRecording = _4.stopRecording,
|
|
14080
|
+
videoUrl = _4.videoUrl;
|
|
14071
14081
|
React.useEffect(function () {
|
|
14072
14082
|
if (!isRecording && !videoUrl) startRecording();
|
|
14073
14083
|
if (videoUrl) onComplete === null || onComplete === void 0 ? void 0 : onComplete(videoUrl);
|
|
@@ -14077,11 +14087,11 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14077
14087
|
React.useEffect(function () {
|
|
14078
14088
|
shouldCaptureFrames.current = videoLoaded && cameraReady && idModelsReady;
|
|
14079
14089
|
}, [cameraReady, idModelsReady, videoLoaded]);
|
|
14080
|
-
var
|
|
14081
|
-
requestedAction =
|
|
14082
|
-
setRequestedAction =
|
|
14090
|
+
var _5 = React.useState('SHOW_ID_FRONT'),
|
|
14091
|
+
requestedAction = _5[0],
|
|
14092
|
+
setRequestedAction = _5[1];
|
|
14083
14093
|
React.useEffect(function () {
|
|
14084
|
-
if (requestedAction !== 'SHOW_ID_FRONT') return;
|
|
14094
|
+
if (requestedAction !== 'SHOW_ID_FRONT' && requestedAction !== 'SHOW_ID_BACK') return;
|
|
14085
14095
|
if (!idModelsReady || !cameraReady || !videoLoaded) return;
|
|
14086
14096
|
animationFrame.current = requestAnimationFrame(function runFrame() {
|
|
14087
14097
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
@@ -14100,23 +14110,24 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14100
14110
|
}, [cameraReady, idModelsReady, idModelsWorking, makeIdPrediction, requestedAction, videoLoaded, videoRef]);
|
|
14101
14111
|
React.useEffect(function () {
|
|
14102
14112
|
setThresholds({
|
|
14103
|
-
document: idCardFrontDetectionThreshold,
|
|
14113
|
+
document: requestedAction === 'SHOW_ID_FRONT' ? idCardFrontDetectionThreshold : requestedAction === 'SHOW_ID_BACK' ? idCardBackDetectionThreshold : 1,
|
|
14104
14114
|
passport: 1,
|
|
14105
14115
|
focus: {
|
|
14106
|
-
mobile: idCardFrontFocusThreshold
|
|
14116
|
+
mobile: requestedAction === 'SHOW_ID_FRONT' ? idCardFrontFocusThreshold : requestedAction === 'SHOW_ID_BACK' ? idCardBackFocusThreshold : 0
|
|
14107
14117
|
}
|
|
14108
14118
|
});
|
|
14109
|
-
}, [idCardFrontDetectionThreshold, idCardFrontFocusThreshold, setThresholds]);
|
|
14110
|
-
var _4 = React.useState(0),
|
|
14111
|
-
currentDetectionScore = _4[0],
|
|
14112
|
-
setCurrentDetectionScore = _4[1];
|
|
14113
|
-
var _5 = React.useState(0),
|
|
14114
|
-
currentFocusScore = _5[0],
|
|
14115
|
-
setCurrentFocusScore = _5[1];
|
|
14119
|
+
}, [idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, requestedAction, setThresholds]);
|
|
14116
14120
|
var _6 = React.useState(0),
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
var
|
|
14121
|
+
currentDetectionScore = _6[0],
|
|
14122
|
+
setCurrentDetectionScore = _6[1];
|
|
14123
|
+
var _7 = React.useState(0),
|
|
14124
|
+
currentFocusScore = _7[0],
|
|
14125
|
+
setCurrentFocusScore = _7[1];
|
|
14126
|
+
var _8 = React.useState(0),
|
|
14127
|
+
goodFramesCount = _8[0],
|
|
14128
|
+
setGoodFramesCount = _8[1];
|
|
14129
|
+
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
14130
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
14120
14131
|
React.useEffect(function () {
|
|
14121
14132
|
onIdPredictionMade(function (prediction) {
|
|
14122
14133
|
setDetectedObjects(prediction.detectedObjects);
|
|
@@ -14149,15 +14160,18 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14149
14160
|
React.useEffect(function () {
|
|
14150
14161
|
(function () {
|
|
14151
14162
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
14152
|
-
var frame;
|
|
14163
|
+
var frame, frame;
|
|
14153
14164
|
return tslib.__generator(this, function (_a) {
|
|
14154
14165
|
switch (_a.label) {
|
|
14155
14166
|
case 0:
|
|
14156
|
-
if (!
|
|
14167
|
+
if (!goodFramesThresholdMet) return [3 /*break*/, 5];
|
|
14168
|
+
setCurrentDetectionScore(0);
|
|
14169
|
+
setCurrentFocusScore(0);
|
|
14170
|
+
setGoodFramesCount(0);
|
|
14171
|
+
resetBestFrame();
|
|
14172
|
+
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 4];
|
|
14157
14173
|
if (onIdFrontImageCaptured) {
|
|
14158
|
-
console.log('capturing front frame!');
|
|
14159
14174
|
frame = captureFrame();
|
|
14160
|
-
console.log(frame);
|
|
14161
14175
|
frame && onIdFrontImageCaptured(frame);
|
|
14162
14176
|
}
|
|
14163
14177
|
if (!skipShowIdCardBack) return [3 /*break*/, 3];
|
|
@@ -14174,31 +14188,31 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14174
14188
|
setRequestedAction('FLIP_ID');
|
|
14175
14189
|
setTimeout(function () {
|
|
14176
14190
|
setRequestedAction('SHOW_ID_BACK');
|
|
14177
|
-
setTimeout(function () {
|
|
14178
|
-
if (onIdBackImageCaptured) {
|
|
14179
|
-
console.log('capturing rear frame!');
|
|
14180
|
-
var frame = captureFrame();
|
|
14181
|
-
console.log(frame);
|
|
14182
|
-
frame && onIdBackImageCaptured(frame);
|
|
14183
|
-
}
|
|
14184
|
-
}, showIdCardBackDurationMs - 1000);
|
|
14185
14191
|
}, 3500);
|
|
14186
|
-
|
|
14192
|
+
return [3 /*break*/, 5];
|
|
14187
14193
|
case 4:
|
|
14194
|
+
if (requestedAction == 'SHOW_ID_BACK') {
|
|
14195
|
+
if (onIdBackImageCaptured) {
|
|
14196
|
+
frame = captureFrame();
|
|
14197
|
+
frame && onIdBackImageCaptured(frame);
|
|
14198
|
+
}
|
|
14199
|
+
onIdBackCaptureComplete();
|
|
14200
|
+
}
|
|
14201
|
+
_a.label = 5;
|
|
14202
|
+
case 5:
|
|
14188
14203
|
return [2 /*return*/];
|
|
14189
14204
|
}
|
|
14190
14205
|
});
|
|
14191
14206
|
});
|
|
14192
14207
|
})();
|
|
14193
|
-
}, [captureFrame, goodFramesThresholdMet, onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction,
|
|
14194
|
-
useTimeout(showIdCardBackDurationMs, onIdBackCaptureComplete, requestedAction !== 'SHOW_ID_BACK', false, requestedAction === 'SHOW_ID_BACK');
|
|
14208
|
+
}, [captureFrame, goodFramesThresholdMet, onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack]);
|
|
14195
14209
|
var onReadTextTimeout = React.useCallback(function () {
|
|
14196
14210
|
stopRecording();
|
|
14197
14211
|
}, [stopRecording]);
|
|
14198
14212
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, onReadTextTimeout, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
14199
|
-
var
|
|
14200
|
-
numFramesWithoutFaces =
|
|
14201
|
-
setNumFramesWithoutFaces =
|
|
14213
|
+
var _9 = React.useState(0),
|
|
14214
|
+
numFramesWithoutFaces = _9[0],
|
|
14215
|
+
setNumFramesWithoutFaces = _9[1];
|
|
14202
14216
|
React.useEffect(function () {
|
|
14203
14217
|
onSelfiePredictionMade(function (faces) {
|
|
14204
14218
|
setFaces(faces);
|
|
@@ -14221,7 +14235,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14221
14235
|
videoWidth: (_c = (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) !== null && _c !== void 0 ? _c : 0,
|
|
14222
14236
|
videoHeight: (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0
|
|
14223
14237
|
});
|
|
14224
|
-
var satisfied =
|
|
14238
|
+
var satisfied = goodFramesCount > 0;
|
|
14225
14239
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
14226
14240
|
ref: ref,
|
|
14227
14241
|
className: "flex ".concat((_f = classNames.container) !== null && _f !== void 0 ? _f : '')
|
|
@@ -14241,7 +14255,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14241
14255
|
verbiage: rawVerbiage.guides,
|
|
14242
14256
|
requestedAction: requestedAction,
|
|
14243
14257
|
borderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
|
|
14244
|
-
}), debugMode &&
|
|
14258
|
+
}), debugMode && ['SHOW_ID_FRONT', 'SHOW_ID_BACK'].includes(requestedAction) && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlayDiv, {
|
|
14245
14259
|
"$flipX": !((_g = cameraRef.current) === null || _g === void 0 ? void 0 : _g.isRearFacing)
|
|
14246
14260
|
}, detectedObjects.map(function (obj, i) {
|
|
14247
14261
|
var _a;
|
|
@@ -14262,7 +14276,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14262
14276
|
scaling: debugScalingDetails,
|
|
14263
14277
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
14264
14278
|
});
|
|
14265
|
-
})))))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ',
|
|
14279
|
+
})))))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__default['default'].createElement("br", null), isRecording ? '✅ Recording' : '❌ Not recording', /*#__PURE__*/React__default['default'].createElement("br", null), goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', goodFramesCount, "/", goodFramesThreshold, /*#__PURE__*/React__default['default'].createElement("br", null), "Detection Score: ", currentDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Focus Score: ", currentFocusScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Detection Score: ", bestFrameDetectionScore, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", bestFrameFocusScore)));
|
|
14266
14280
|
};
|
|
14267
14281
|
|
|
14268
14282
|
var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {
|
|
@@ -14325,9 +14339,11 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
14325
14339
|
_g = _a.faceLivenessProps,
|
|
14326
14340
|
faceLivenessProps = _g === void 0 ? {} : _g,
|
|
14327
14341
|
idCardFrontDetectionThreshold = _a.idCardFrontDetectionThreshold,
|
|
14342
|
+
idCardBackDetectionThreshold = _a.idCardBackDetectionThreshold,
|
|
14328
14343
|
idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
|
|
14344
|
+
idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
|
|
14329
14345
|
goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
|
|
14330
|
-
|
|
14346
|
+
goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
|
|
14331
14347
|
readTextPrompt = _a.readTextPrompt,
|
|
14332
14348
|
readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
|
|
14333
14349
|
_h = _a.skipIdCapture,
|
|
@@ -14466,9 +14482,11 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
14466
14482
|
onIdBackImageCaptured: setIdCaptureVideoIdBackImage,
|
|
14467
14483
|
onFaceNotDetected: onVideoCaptureFaceNotDetected,
|
|
14468
14484
|
idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
|
|
14485
|
+
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
14469
14486
|
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
14487
|
+
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
14470
14488
|
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
14471
|
-
|
|
14489
|
+
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
14472
14490
|
skipShowIdCardBack: skipShowIdCardBack,
|
|
14473
14491
|
readTextPrompt: readTextPrompt,
|
|
14474
14492
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
@@ -16589,48 +16607,52 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
16589
16607
|
idCaptureProps = _a.idCaptureProps,
|
|
16590
16608
|
faceLivenessProps = _a.faceLivenessProps,
|
|
16591
16609
|
_c = _a.idCardFrontDetectionThreshold,
|
|
16592
|
-
idCardFrontDetectionThreshold = _c === void 0 ? 0.
|
|
16610
|
+
idCardFrontDetectionThreshold = _c === void 0 ? 0.6 : _c,
|
|
16593
16611
|
_d = _a.idCardFrontFocusThreshold,
|
|
16594
16612
|
idCardFrontFocusThreshold = _d === void 0 ? 0 : _d,
|
|
16595
16613
|
_e = _a.goodIdCardFrontFramesThreshold,
|
|
16596
16614
|
goodIdCardFrontFramesThreshold = _e === void 0 ? 3 : _e,
|
|
16597
|
-
_f = _a.
|
|
16598
|
-
|
|
16615
|
+
_f = _a.idCardBackDetectionThreshold,
|
|
16616
|
+
idCardBackDetectionThreshold = _f === void 0 ? 0.6 : _f,
|
|
16617
|
+
_g = _a.idCardBackFocusThreshold,
|
|
16618
|
+
idCardBackFocusThreshold = _g === void 0 ? 0 : _g,
|
|
16619
|
+
_h = _a.goodIdCardBackFramesThreshold,
|
|
16620
|
+
goodIdCardBackFramesThreshold = _h === void 0 ? 3 : _h,
|
|
16599
16621
|
readTextPrompt = _a.readTextPrompt,
|
|
16600
|
-
|
|
16601
|
-
readTextTimeoutDurationMs =
|
|
16602
|
-
|
|
16603
|
-
skipSuccessScreen =
|
|
16604
|
-
|
|
16605
|
-
skipIdCapture =
|
|
16606
|
-
|
|
16607
|
-
skipShowIdCardBack =
|
|
16608
|
-
|
|
16609
|
-
idCaptureGuideType =
|
|
16610
|
-
|
|
16611
|
-
idCapturePortraitGuidesOnMobile =
|
|
16612
|
-
|
|
16613
|
-
theme =
|
|
16614
|
-
|
|
16615
|
-
assets =
|
|
16616
|
-
|
|
16617
|
-
classNames =
|
|
16618
|
-
|
|
16619
|
-
colors =
|
|
16620
|
-
|
|
16621
|
-
verbiage =
|
|
16622
|
-
|
|
16623
|
-
captureSignature =
|
|
16624
|
-
|
|
16625
|
-
captureSignatureVideo =
|
|
16626
|
-
|
|
16627
|
-
captureAdditionalDocuments =
|
|
16628
|
-
|
|
16629
|
-
geolocationEnabled =
|
|
16630
|
-
|
|
16631
|
-
geolocationRequired =
|
|
16632
|
-
|
|
16633
|
-
debugMode =
|
|
16622
|
+
_j = _a.readTextTimeoutDurationMs,
|
|
16623
|
+
readTextTimeoutDurationMs = _j === void 0 ? 15000 : _j,
|
|
16624
|
+
_k = _a.skipSuccessScreen,
|
|
16625
|
+
skipSuccessScreen = _k === void 0 ? false : _k,
|
|
16626
|
+
_l = _a.skipIdCapture,
|
|
16627
|
+
skipIdCapture = _l === void 0 ? false : _l,
|
|
16628
|
+
_m = _a.skipShowIdCardBack,
|
|
16629
|
+
skipShowIdCardBack = _m === void 0 ? false : _m,
|
|
16630
|
+
_o = _a.idCaptureGuideType,
|
|
16631
|
+
idCaptureGuideType = _o === void 0 ? 'fit' : _o,
|
|
16632
|
+
_p = _a.idCapturePortraitGuidesOnMobile,
|
|
16633
|
+
idCapturePortraitGuidesOnMobile = _p === void 0 ? false : _p,
|
|
16634
|
+
_q = _a.theme,
|
|
16635
|
+
theme = _q === void 0 ? 'default' : _q,
|
|
16636
|
+
_r = _a.assets,
|
|
16637
|
+
assets = _r === void 0 ? {} : _r,
|
|
16638
|
+
_s = _a.classNames,
|
|
16639
|
+
classNames = _s === void 0 ? {} : _s,
|
|
16640
|
+
_t = _a.colors,
|
|
16641
|
+
colors = _t === void 0 ? {} : _t,
|
|
16642
|
+
_u = _a.verbiage,
|
|
16643
|
+
verbiage = _u === void 0 ? {} : _u,
|
|
16644
|
+
_v = _a.captureSignature,
|
|
16645
|
+
captureSignature = _v === void 0 ? false : _v,
|
|
16646
|
+
_w = _a.captureSignatureVideo,
|
|
16647
|
+
captureSignatureVideo = _w === void 0 ? false : _w,
|
|
16648
|
+
_x = _a.captureAdditionalDocuments,
|
|
16649
|
+
captureAdditionalDocuments = _x === void 0 ? [] : _x,
|
|
16650
|
+
_y = _a.geolocationEnabled,
|
|
16651
|
+
geolocationEnabled = _y === void 0 ? true : _y,
|
|
16652
|
+
_z = _a.geolocationRequired,
|
|
16653
|
+
geolocationRequired = _z === void 0 ? false : _z,
|
|
16654
|
+
_0 = _a.debugMode,
|
|
16655
|
+
debugMode = _0 === void 0 ? false : _0;
|
|
16634
16656
|
useLanguage(lang);
|
|
16635
16657
|
var videoIdCaptureProps = React.useMemo(function () {
|
|
16636
16658
|
return {
|
|
@@ -16639,7 +16661,9 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
16639
16661
|
idCardFrontDetectionThreshold: idCardFrontDetectionThreshold,
|
|
16640
16662
|
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
16641
16663
|
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
16642
|
-
|
|
16664
|
+
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
16665
|
+
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
16666
|
+
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
16643
16667
|
readTextPrompt: readTextPrompt,
|
|
16644
16668
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
16645
16669
|
onExitCapture: onExitCapture,
|
|
@@ -16656,7 +16680,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
16656
16680
|
verbiage: verbiage,
|
|
16657
16681
|
debugMode: debugMode
|
|
16658
16682
|
};
|
|
16659
|
-
}, [assets, classNames, colors, debugMode, faceLivenessProps, goodIdCardFrontFramesThreshold, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureProps, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, onExitAfterFailure, onExitCapture, onUserCancel, readTextPrompt, readTextTimeoutDurationMs,
|
|
16683
|
+
}, [assets, classNames, colors, debugMode, faceLivenessProps, goodIdCardBackFramesThreshold, goodIdCardFrontFramesThreshold, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureProps, idCardBackDetectionThreshold, idCardBackFocusThreshold, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, onExitAfterFailure, onExitCapture, onUserCancel, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, verbiage]);
|
|
16660
16684
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
16661
16685
|
return {
|
|
16662
16686
|
documents: captureAdditionalDocuments,
|