idmission-web-sdk 2.0.3 → 2.1.0
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 +36 -28
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +3 -12
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +3 -12
- package/dist/components/customer_flows/IdValidation.d.ts +3 -12
- package/dist/components/customer_flows/VideoIdValidation.d.ts +3 -12
- package/dist/components/id_capture/CapturedDocuments.d.ts +2 -0
- package/dist/components/id_capture/FocusModelProvider.d.ts +2 -1
- package/dist/components/id_capture/IdCapture.d.ts +4 -14
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +7 -22
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +11 -38
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +2 -3
- package/dist/components/id_capture/IdCaptureWizard.d.ts +3 -9
- package/dist/components/video_id/IdVideoCapture.d.ts +12 -7
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +3 -8
- package/dist/lib/models/DocumentDetection.d.ts +15 -12
- package/dist/lib/models/Focus.d.ts +6 -2
- package/dist/sdk2.cjs.development.js +754 -920
- 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 +754 -920
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +754 -920
- 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/Components/IdCapture/LicenseBackCapture.stories.d.ts +0 -48
- package/dist/stories/Components/IdCapture/LicenseFrontCapture.stories.d.ts +0 -45
- package/dist/stories/Components/IdCapture/PassportCapture.stories.d.ts +0 -47
- package/dist/stories/Components/IdCapture/Wizard.stories.d.ts +1 -77
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
return cooked;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
var webSdkVersion = '2.0
|
|
143
|
+
var webSdkVersion = '2.1.0';
|
|
144
144
|
|
|
145
145
|
function getPlatform() {
|
|
146
146
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2185,10 +2185,6 @@
|
|
|
2185
2185
|
}, [refCallback, size.width, size.height]);
|
|
2186
2186
|
}
|
|
2187
2187
|
|
|
2188
|
-
function supportsNativeBarcodeScanning() {
|
|
2189
|
-
return 'BarcodeDetector' in window;
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
2188
|
function getFrameDimensions(frame) {
|
|
2193
2189
|
var frameWidth = frame.width,
|
|
2194
2190
|
frameHeight = frame.height;
|
|
@@ -3062,10 +3058,14 @@
|
|
|
3062
3058
|
});
|
|
3063
3059
|
}
|
|
3064
3060
|
|
|
3065
|
-
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
3061
|
+
var defaultFocusModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/focusmp20240619/model_fp16.tflite";
|
|
3066
3062
|
var defaultFocusModelLoadTimeoutMs = 45000;
|
|
3067
3063
|
var defaultFocusThresholds = {
|
|
3068
|
-
|
|
3064
|
+
idCardFront: {
|
|
3065
|
+
desktop: 0,
|
|
3066
|
+
mobile: 0.3
|
|
3067
|
+
},
|
|
3068
|
+
idCardBack: {
|
|
3069
3069
|
desktop: 0,
|
|
3070
3070
|
mobile: 0.3
|
|
3071
3071
|
},
|
|
@@ -3686,14 +3686,19 @@
|
|
|
3686
3686
|
});
|
|
3687
3687
|
}
|
|
3688
3688
|
|
|
3689
|
-
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
3689
|
+
var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240614/model_fp16.tflite";
|
|
3690
3690
|
var defaultDocumentDetectionScoreThreshold = 0.1;
|
|
3691
3691
|
var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
|
|
3692
3692
|
var defaultDocumentDetectionThresholds = {
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3693
|
+
idCardFront: 0.8,
|
|
3694
|
+
idCardBack: 0.8,
|
|
3695
|
+
passport: 0.5
|
|
3696
|
+
};
|
|
3697
|
+
var documentTypeDisplayNames = {
|
|
3698
|
+
idCardFront: 'ID card front',
|
|
3699
|
+
idCardBack: 'ID card back',
|
|
3700
|
+
passport: 'Passport',
|
|
3701
|
+
none: 'None'
|
|
3697
3702
|
};
|
|
3698
3703
|
var detectors = {};
|
|
3699
3704
|
function loadDocumentDetector(modelAssetPath, scoreThreshold) {
|
|
@@ -3848,34 +3853,33 @@
|
|
|
3848
3853
|
return n > 0;
|
|
3849
3854
|
});
|
|
3850
3855
|
});
|
|
3851
|
-
var
|
|
3856
|
+
var bestIdCardFront = detectedObjects.find(function (obj) {
|
|
3852
3857
|
return obj.label === 'Document';
|
|
3853
3858
|
});
|
|
3859
|
+
var bestIdCardBack = detectedObjects.find(function (obj) {
|
|
3860
|
+
return obj.label === 'Document back';
|
|
3861
|
+
});
|
|
3854
3862
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
3855
3863
|
return obj.label === 'Passport page';
|
|
3856
3864
|
});
|
|
3857
|
-
var
|
|
3858
|
-
var
|
|
3859
|
-
var
|
|
3860
|
-
var
|
|
3861
|
-
var
|
|
3865
|
+
var idCardFrontDetectionScore = (_a = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _a !== void 0 ? _a : 0;
|
|
3866
|
+
var idCardBackDetectionScore = (_b = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _b !== void 0 ? _b : 0;
|
|
3867
|
+
var passportDetectionScore = (_c = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _c !== void 0 ? _c : 0;
|
|
3868
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_d = thresholds.idCardFront) !== null && _d !== void 0 ? _d : 0);
|
|
3869
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_e = thresholds.idCardBack) !== null && _e !== void 0 ? _e : 0);
|
|
3870
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_f = thresholds.passport) !== null && _f !== void 0 ? _f : 0);
|
|
3871
|
+
var bestDocument = passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
3872
|
+
var detectionThreshold = passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
3873
|
+
var detectionScore = (_g = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _g !== void 0 ? _g : 0;
|
|
3862
3874
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
3863
3875
|
var detectedDocumentType = 'none';
|
|
3864
3876
|
if (passportDetectionThresholdMet) {
|
|
3865
3877
|
detectedDocumentType = 'passport';
|
|
3878
|
+
} else if (idCardBackDetectionThresholdMet) {
|
|
3879
|
+
detectedDocumentType = 'idCardBack';
|
|
3866
3880
|
} else if (detectionThresholdMet) {
|
|
3867
|
-
detectedDocumentType = '
|
|
3881
|
+
detectedDocumentType = 'idCardFront';
|
|
3868
3882
|
}
|
|
3869
|
-
var bestMrz = detectedObjects.find(function (obj) {
|
|
3870
|
-
return obj.label === 'MRZ';
|
|
3871
|
-
});
|
|
3872
|
-
var mrzDetectionScore = (_d = bestMrz === null || bestMrz === void 0 ? void 0 : bestMrz.score) !== null && _d !== void 0 ? _d : 0;
|
|
3873
|
-
var mrzDetectionThresholdMet = mrzDetectionScore >= ((_e = thresholds.mrz) !== null && _e !== void 0 ? _e : 0);
|
|
3874
|
-
var bestPdf417 = detectedObjects.find(function (obj) {
|
|
3875
|
-
return obj.label === 'PDF417';
|
|
3876
|
-
});
|
|
3877
|
-
var pdf417DetectionScore = (_f = bestPdf417 === null || bestPdf417 === void 0 ? void 0 : bestPdf417.score) !== null && _f !== void 0 ? _f : 0;
|
|
3878
|
-
var pdf417DetectionThresholdMet = pdf417DetectionScore >= ((_g = thresholds.pdf417) !== null && _g !== void 0 ? _g : 0);
|
|
3879
3883
|
var documentInBounds = false;
|
|
3880
3884
|
if (bestDocument) {
|
|
3881
3885
|
var boundaryPx = 20;
|
|
@@ -3905,15 +3909,13 @@
|
|
|
3905
3909
|
detectionTime: time,
|
|
3906
3910
|
detectionThresholdMet: detectionThresholdMet,
|
|
3907
3911
|
detectedDocumentType: detectedDocumentType,
|
|
3912
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
3913
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
3914
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
3915
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
3908
3916
|
passportDetectionScore: passportDetectionScore,
|
|
3909
3917
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3910
|
-
mrzDetectionScore: mrzDetectionScore,
|
|
3911
|
-
mrzDetectionThresholdMet: mrzDetectionThresholdMet,
|
|
3912
|
-
pdf417DetectionScore: pdf417DetectionScore,
|
|
3913
|
-
pdf417DetectionThresholdMet: pdf417DetectionThresholdMet,
|
|
3914
3918
|
bestDocument: bestDocument,
|
|
3915
|
-
bestMrz: bestMrz,
|
|
3916
|
-
bestPdf417: bestPdf417,
|
|
3917
3919
|
documentInBounds: documentInBounds,
|
|
3918
3920
|
documentTooClose: documentTooClose,
|
|
3919
3921
|
frameWidth: frameWidth,
|
|
@@ -4161,24 +4163,26 @@
|
|
|
4161
4163
|
focusModelPath = _b === void 0 ? defaultFocusModelPath : _b,
|
|
4162
4164
|
_c = _a.focusModelLoadTimeoutMs,
|
|
4163
4165
|
focusModelLoadTimeoutMs = _c === void 0 ? defaultFocusModelLoadTimeoutMs : _c,
|
|
4164
|
-
onFocusModelError = _a.onFocusModelError
|
|
4166
|
+
onFocusModelError = _a.onFocusModelError,
|
|
4167
|
+
_d = _a.showCanvases,
|
|
4168
|
+
showCanvases = _d === void 0 ? false : _d;
|
|
4165
4169
|
var cropCanvas = React.useRef(null);
|
|
4166
4170
|
var rotateCanvas = React.useRef(null);
|
|
4167
|
-
var
|
|
4168
|
-
focusThresholds =
|
|
4169
|
-
setFocusThresholds =
|
|
4170
|
-
var
|
|
4171
|
-
focusPredictionTime =
|
|
4172
|
-
setFocusPredictionTime =
|
|
4173
|
-
var
|
|
4171
|
+
var _e = React.useState({}),
|
|
4172
|
+
focusThresholds = _e[0],
|
|
4173
|
+
setFocusThresholds = _e[1];
|
|
4174
|
+
var _f = React.useState(0),
|
|
4175
|
+
focusPredictionTime = _f[0],
|
|
4176
|
+
setFocusPredictionTime = _f[1];
|
|
4177
|
+
var _g = useLoadFocusModel({
|
|
4174
4178
|
modelPath: focusModelPath,
|
|
4175
4179
|
modelLoadTimeoutMs: focusModelLoadTimeoutMs,
|
|
4176
4180
|
onModelError: onFocusModelError
|
|
4177
4181
|
}),
|
|
4178
|
-
model =
|
|
4179
|
-
ready =
|
|
4180
|
-
modelDownloadProgress =
|
|
4181
|
-
modelError =
|
|
4182
|
+
model = _g.model,
|
|
4183
|
+
ready = _g.ready,
|
|
4184
|
+
modelDownloadProgress = _g.modelDownloadProgress,
|
|
4185
|
+
modelError = _g.modelError;
|
|
4182
4186
|
var makeFocusPrediction = React.useCallback(function (imageData, box) {
|
|
4183
4187
|
if (!model.current) return null;
|
|
4184
4188
|
var prediction = makeFocusModelPrediction(model.current, imageData, cropCanvas.current, rotateCanvas.current, box);
|
|
@@ -4199,13 +4203,23 @@
|
|
|
4199
4203
|
return /*#__PURE__*/React__default['default'].createElement(FocusModelContext.Provider, {
|
|
4200
4204
|
value: value
|
|
4201
4205
|
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
4202
|
-
ref: rotateCanvas
|
|
4206
|
+
ref: rotateCanvas,
|
|
4207
|
+
style: showCanvases ? {
|
|
4208
|
+
display: 'block'
|
|
4209
|
+
} : undefined
|
|
4203
4210
|
}), /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
4204
|
-
ref: cropCanvas
|
|
4211
|
+
ref: cropCanvas,
|
|
4212
|
+
style: showCanvases ? {
|
|
4213
|
+
display: 'block'
|
|
4214
|
+
} : undefined
|
|
4205
4215
|
}), children);
|
|
4206
4216
|
}
|
|
4207
4217
|
|
|
4208
4218
|
var onMobile = isMobile();
|
|
4219
|
+
var defaultIdCaptureThresholds = {
|
|
4220
|
+
detection: defaultDocumentDetectionThresholds,
|
|
4221
|
+
focus: defaultFocusThresholds
|
|
4222
|
+
};
|
|
4209
4223
|
var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
4210
4224
|
ready: false,
|
|
4211
4225
|
start: function start() {
|
|
@@ -4216,7 +4230,7 @@
|
|
|
4216
4230
|
},
|
|
4217
4231
|
modelDownloadProgress: 0,
|
|
4218
4232
|
modelError: null,
|
|
4219
|
-
thresholds:
|
|
4233
|
+
thresholds: defaultIdCaptureThresholds,
|
|
4220
4234
|
setThresholds: function setThresholds() {
|
|
4221
4235
|
return null;
|
|
4222
4236
|
},
|
|
@@ -4231,6 +4245,10 @@
|
|
|
4231
4245
|
},
|
|
4232
4246
|
resetBestFrame: function resetBestFrame() {
|
|
4233
4247
|
return null;
|
|
4248
|
+
},
|
|
4249
|
+
requiredDocumentType: 'none',
|
|
4250
|
+
setRequiredDocumentType: function setRequiredDocumentType() {
|
|
4251
|
+
return null;
|
|
4234
4252
|
}
|
|
4235
4253
|
});
|
|
4236
4254
|
function IdCaptureModelsProviderInner(_a) {
|
|
@@ -4263,26 +4281,34 @@
|
|
|
4263
4281
|
var bestPredictionCanvas = React.useRef(null);
|
|
4264
4282
|
var bestFocusScore = React.useRef(0);
|
|
4265
4283
|
var stopDetection = React.useRef(0);
|
|
4284
|
+
var _e = React.useState('none'),
|
|
4285
|
+
requiredDocumentType = _e[0],
|
|
4286
|
+
setRequiredDocumentType = _e[1];
|
|
4266
4287
|
var thresholds = React.useMemo(function () {
|
|
4267
4288
|
return __assign$1(__assign$1({}, documentDetectionThresholds), {
|
|
4268
4289
|
focus: focusThresholds
|
|
4269
4290
|
});
|
|
4270
4291
|
}, [documentDetectionThresholds, focusThresholds]);
|
|
4271
4292
|
var setThresholds = React.useCallback(function (thresholds) {
|
|
4272
|
-
|
|
4273
|
-
|
|
4293
|
+
if (thresholds.detection) {
|
|
4294
|
+
setDocumentDetectionThresholds(thresholds.detection);
|
|
4295
|
+
}
|
|
4296
|
+
if (thresholds.focus) {
|
|
4297
|
+
setFocusThresholds(thresholds.focus);
|
|
4298
|
+
}
|
|
4274
4299
|
}, [setDocumentDetectionThresholds, setFocusThresholds]);
|
|
4275
4300
|
React.useEffect(function handleDetections() {
|
|
4276
4301
|
var _this = this;
|
|
4277
4302
|
onDocumentDetected(function (prediction) {
|
|
4278
4303
|
return __awaiter(_this, void 0, void 0, function () {
|
|
4279
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, focusPrediction, focusThresholdSet, focusThreshold;
|
|
4304
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
4280
4305
|
var _a, _b, _c, _d, _e;
|
|
4281
4306
|
return __generator(this, function (_f) {
|
|
4282
4307
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
4283
4308
|
stopDetectionAtStart = stopDetection.current;
|
|
4284
4309
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
4285
|
-
|
|
4310
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType;
|
|
4311
|
+
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose) {
|
|
4286
4312
|
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_a = prediction.bestDocument) === null || _a === void 0 ? void 0 : _a.box);
|
|
4287
4313
|
if (focusPrediction) {
|
|
4288
4314
|
focusScore = focusPrediction.score;
|
|
@@ -4311,7 +4337,7 @@
|
|
|
4311
4337
|
});
|
|
4312
4338
|
});
|
|
4313
4339
|
});
|
|
4314
|
-
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, thresholds.focus]);
|
|
4340
|
+
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
4315
4341
|
var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
|
|
4316
4342
|
React.useEffect(function handleModelErrors() {
|
|
4317
4343
|
modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
|
|
@@ -4325,9 +4351,9 @@
|
|
|
4325
4351
|
canvas: bestPredictionCanvas.current
|
|
4326
4352
|
});
|
|
4327
4353
|
}, [bestFrameDetails]);
|
|
4328
|
-
var
|
|
4329
|
-
canvasKey =
|
|
4330
|
-
setCanvasKey =
|
|
4354
|
+
var _f = React.useState(0),
|
|
4355
|
+
canvasKey = _f[0],
|
|
4356
|
+
setCanvasKey = _f[1];
|
|
4331
4357
|
var resetBestFrame = React.useCallback(function () {
|
|
4332
4358
|
stopDetection.current += 1;
|
|
4333
4359
|
setCanvasKey(function (n) {
|
|
@@ -4337,6 +4363,9 @@
|
|
|
4337
4363
|
setBestFrameDetails(null);
|
|
4338
4364
|
bestFocusScore.current = 0;
|
|
4339
4365
|
}, [clearDocumentDetectionLastPredictionCanvas]);
|
|
4366
|
+
React.useEffect(function () {
|
|
4367
|
+
requiredDocumentType && resetBestFrame();
|
|
4368
|
+
}, [requiredDocumentType, resetBestFrame]);
|
|
4340
4369
|
var value = React.useMemo(function () {
|
|
4341
4370
|
return {
|
|
4342
4371
|
ready: documentDetectionModelReady && focusModelReady,
|
|
@@ -4351,9 +4380,11 @@
|
|
|
4351
4380
|
focusPredictionTime: focusPredictionTime,
|
|
4352
4381
|
getBestFrame: getBestFrame,
|
|
4353
4382
|
resetBestFrame: resetBestFrame,
|
|
4354
|
-
bestFrameDetails: bestFrameDetails
|
|
4383
|
+
bestFrameDetails: bestFrameDetails,
|
|
4384
|
+
requiredDocumentType: requiredDocumentType,
|
|
4385
|
+
setRequiredDocumentType: setRequiredDocumentType
|
|
4355
4386
|
};
|
|
4356
|
-
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
4387
|
+
}, [bestFrameDetails, detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
4357
4388
|
return /*#__PURE__*/React__default['default'].createElement(IdCaptureModelsContext.Provider, {
|
|
4358
4389
|
value: value
|
|
4359
4390
|
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
@@ -4404,28 +4435,19 @@
|
|
|
4404
4435
|
videoHeight: 0,
|
|
4405
4436
|
detectedObjects: [],
|
|
4406
4437
|
bestDocument: undefined,
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
documentType: 'none',
|
|
4438
|
+
detectedDocumentType: 'none',
|
|
4439
|
+
detectionThresholdMet: false,
|
|
4410
4440
|
documentInBounds: false,
|
|
4411
4441
|
documentTooClose: false,
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
pdf417DetectionThresholdMet: false,
|
|
4442
|
+
flipRequired: false,
|
|
4443
|
+
idCardFrontDetectionScore: 0,
|
|
4444
|
+
idCardFrontDetectionThresholdMet: false,
|
|
4445
|
+
idCardBackDetectionScore: 0,
|
|
4446
|
+
idCardBackDetectionThresholdMet: false,
|
|
4447
|
+
passportDetectionScore: 0,
|
|
4448
|
+
passportDetectionThresholdMet: false,
|
|
4420
4449
|
focusScore: 0,
|
|
4421
4450
|
focusThresholdMet: false,
|
|
4422
|
-
barcodeScanningEnabled: false,
|
|
4423
|
-
barcodeResult: null,
|
|
4424
|
-
waitingForBarcodeScan: false,
|
|
4425
|
-
shouldScanBarcode: false,
|
|
4426
|
-
autoCaptureBarcodeRequired: 'mobile',
|
|
4427
|
-
barcodeScanFailedAttempts: 0,
|
|
4428
|
-
maxBarcodeScanAttempts: 10,
|
|
4429
4451
|
isGoodFrame: false,
|
|
4430
4452
|
goodFramesCount: 0,
|
|
4431
4453
|
goodFramesThreshold: 3,
|
|
@@ -4439,8 +4461,6 @@
|
|
|
4439
4461
|
capturedDocuments: {},
|
|
4440
4462
|
captureRequirement: 'idCardOrPassport',
|
|
4441
4463
|
requestedDocumentType: 'idCardFront',
|
|
4442
|
-
detectedDocumentType: 'none',
|
|
4443
|
-
differentDocumentTypeDetections: 0,
|
|
4444
4464
|
operationStartedAt: null,
|
|
4445
4465
|
captureStartedAt: null
|
|
4446
4466
|
};
|
|
@@ -4475,11 +4495,6 @@
|
|
|
4475
4495
|
newState.operationStartedAt = new Date();
|
|
4476
4496
|
return newState;
|
|
4477
4497
|
}
|
|
4478
|
-
case 'configureCapture':
|
|
4479
|
-
return __assign$1(__assign$1(__assign$1({}, state), action.payload), {
|
|
4480
|
-
capturing: false,
|
|
4481
|
-
captureFailed: false
|
|
4482
|
-
});
|
|
4483
4498
|
case 'setRequiredDocumentType':
|
|
4484
4499
|
return __assign$1(__assign$1({}, state), {
|
|
4485
4500
|
requiredDocumentType: action.payload
|
|
@@ -4516,18 +4531,15 @@
|
|
|
4516
4531
|
case 'objectsDetected':
|
|
4517
4532
|
var _d = action.payload.prediction,
|
|
4518
4533
|
detectedObjects = _d.detectedObjects,
|
|
4519
|
-
detectionScore = _d.detectionScore,
|
|
4520
4534
|
detectionThresholdMet = _d.detectionThresholdMet,
|
|
4521
4535
|
detectedDocumentType = _d.detectedDocumentType,
|
|
4536
|
+
idCardFrontDetectionScore = _d.idCardFrontDetectionScore,
|
|
4537
|
+
idCardFrontDetectionThresholdMet = _d.idCardFrontDetectionThresholdMet,
|
|
4538
|
+
idCardBackDetectionScore = _d.idCardBackDetectionScore,
|
|
4539
|
+
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
4522
4540
|
passportDetectionScore = _d.passportDetectionScore,
|
|
4523
4541
|
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
4524
|
-
mrzDetectionScore = _d.mrzDetectionScore,
|
|
4525
|
-
mrzDetectionThresholdMet = _d.mrzDetectionThresholdMet,
|
|
4526
|
-
pdf417DetectionScore = _d.pdf417DetectionScore,
|
|
4527
|
-
pdf417DetectionThresholdMet = _d.pdf417DetectionThresholdMet,
|
|
4528
4542
|
bestDocument = _d.bestDocument,
|
|
4529
|
-
bestMrz = _d.bestMrz,
|
|
4530
|
-
bestPdf417 = _d.bestPdf417,
|
|
4531
4543
|
documentInBounds = _d.documentInBounds,
|
|
4532
4544
|
documentTooClose = _d.documentTooClose,
|
|
4533
4545
|
focusScore = _d.focusScore,
|
|
@@ -4543,84 +4555,48 @@
|
|
|
4543
4555
|
goodFramesThreshold = Math.ceil(3 * frameCaptureRate);
|
|
4544
4556
|
}
|
|
4545
4557
|
}
|
|
4546
|
-
var
|
|
4547
|
-
var
|
|
4548
|
-
var waitingForBarcodeScan = shouldScanBarcode && !state.barcodeResult;
|
|
4549
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && focusThresholdMet;
|
|
4558
|
+
var flipRequired = state.requestedDocumentType === 'idCardBack' && detectedDocumentType === 'idCardFront';
|
|
4559
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && focusThresholdMet;
|
|
4550
4560
|
var goodFramesCount = state.goodFramesCount;
|
|
4551
4561
|
if (isGoodFrame) {
|
|
4552
4562
|
goodFramesCount += 1;
|
|
4553
4563
|
}
|
|
4564
|
+
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
4565
|
+
var requestedDocumentType = state.requestedDocumentType;
|
|
4566
|
+
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4567
|
+
if (detectedDocumentType === 'passport' && state.requestedDocumentType !== 'passport') {
|
|
4568
|
+
requestedDocumentType = 'passport';
|
|
4569
|
+
}
|
|
4570
|
+
if (requestedDocumentType === 'passport' && passportDetectionScore < 0.3) {
|
|
4571
|
+
requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4554
4574
|
return __assign$1(__assign$1({}, state), {
|
|
4555
4575
|
videoWidth: frameWidth,
|
|
4556
4576
|
videoHeight: frameHeight,
|
|
4557
4577
|
detectedObjects: detectedObjects,
|
|
4558
4578
|
bestDocument: bestDocument,
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4579
|
+
requestedDocumentType: requestedDocumentType,
|
|
4580
|
+
detectedDocumentType: detectedDocumentType,
|
|
4581
|
+
detectionThresholdMet: detectionThresholdMet,
|
|
4562
4582
|
documentInBounds: documentInBounds,
|
|
4563
4583
|
documentTooClose: documentTooClose,
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
passportPageDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4584
|
+
flipRequired: flipRequired,
|
|
4585
|
+
idCardFrontDetectionScore: idCardFrontDetectionScore,
|
|
4586
|
+
idCardFrontDetectionThresholdMet: idCardFrontDetectionThresholdMet,
|
|
4587
|
+
idCardBackDetectionScore: idCardBackDetectionScore,
|
|
4588
|
+
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4589
|
+
passportDetectionScore: passportDetectionScore,
|
|
4590
|
+
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4572
4591
|
focusScore: focusScore,
|
|
4573
4592
|
focusThresholdMet: focusThresholdMet,
|
|
4574
|
-
shouldScanBarcode: shouldScanBarcode,
|
|
4575
|
-
waitingForBarcodeScan: waitingForBarcodeScan,
|
|
4576
4593
|
isGoodFrame: isGoodFrame,
|
|
4577
4594
|
goodFramesCount: goodFramesCount,
|
|
4578
4595
|
goodFramesThreshold: goodFramesThreshold,
|
|
4579
|
-
goodFramesThresholdMet:
|
|
4596
|
+
goodFramesThresholdMet: goodFramesThresholdMet,
|
|
4580
4597
|
lastFrameCapturedAt: frameCapturedAt,
|
|
4581
4598
|
frameCaptureRate: frameCaptureRate
|
|
4582
4599
|
});
|
|
4583
|
-
case 'predictionMade':
|
|
4584
|
-
{
|
|
4585
|
-
var _e = action.payload,
|
|
4586
|
-
detectedDocumentType_1 = _e.detectedDocumentType,
|
|
4587
|
-
passportDetectionScore_1 = _e.passportDetectionScore;
|
|
4588
|
-
var requestedDocumentType = state.requestedDocumentType;
|
|
4589
|
-
var newState = __assign$1(__assign$1({}, state), {
|
|
4590
|
-
detectedDocumentType: detectedDocumentType_1
|
|
4591
|
-
});
|
|
4592
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4593
|
-
var predictionIsRequestedType = requestedDocumentType.startsWith(detectedDocumentType_1);
|
|
4594
|
-
if (predictionIsRequestedType) {
|
|
4595
|
-
newState.differentDocumentTypeDetections = 0;
|
|
4596
|
-
}
|
|
4597
|
-
if (detectedDocumentType_1 === 'passport' && requestedDocumentType !== 'passport') {
|
|
4598
|
-
newState.requestedDocumentType = 'passport';
|
|
4599
|
-
}
|
|
4600
|
-
if (requestedDocumentType === 'passport' && passportDetectionScore_1 < 0.3) {
|
|
4601
|
-
newState.requestedDocumentType = 'idCardFront' in state.capturedDocuments ? 'idCardBack' : 'idCardFront';
|
|
4602
|
-
}
|
|
4603
|
-
}
|
|
4604
|
-
return newState;
|
|
4605
|
-
}
|
|
4606
|
-
case 'barcodeScanned':
|
|
4607
|
-
return __assign$1(__assign$1({}, state), {
|
|
4608
|
-
barcodeResult: action.payload.result,
|
|
4609
|
-
waitingForBarcodeScan: false,
|
|
4610
|
-
autoCaptureBarcodeRequired: false
|
|
4611
|
-
});
|
|
4612
|
-
case 'barcodeScanFailed':
|
|
4613
|
-
{
|
|
4614
|
-
var newState = __assign$1(__assign$1({}, state), {
|
|
4615
|
-
barcodeScanFailedAttempts: state.barcodeScanFailedAttempts + 1
|
|
4616
|
-
});
|
|
4617
|
-
if (newState.barcodeScanFailedAttempts >= newState.maxBarcodeScanAttempts) {
|
|
4618
|
-
newState.autoCaptureBarcodeRequired = false;
|
|
4619
|
-
newState.shouldScanBarcode = false;
|
|
4620
|
-
newState.waitingForBarcodeScan = false;
|
|
4621
|
-
}
|
|
4622
|
-
return newState;
|
|
4623
|
-
}
|
|
4624
4600
|
case 'captureStarted':
|
|
4625
4601
|
return __assign$1(__assign$1({}, state), {
|
|
4626
4602
|
captureStartedAt: new Date(),
|
|
@@ -4672,8 +4648,9 @@
|
|
|
4672
4648
|
newState_1.requestedDocumentType = remainingRequirements[0];
|
|
4673
4649
|
if (state.requestedDocumentType === 'idCardFront' && newState_1.requestedDocumentType === 'idCardBack') {
|
|
4674
4650
|
newState_1.captureState = 'requestingFlip';
|
|
4675
|
-
newState_1.
|
|
4676
|
-
newState_1.
|
|
4651
|
+
newState_1.idCardFrontDetectionThresholdMet = false;
|
|
4652
|
+
newState_1.idCardBackDetectionThresholdMet = false;
|
|
4653
|
+
newState_1.passportDetectionThresholdMet = false;
|
|
4677
4654
|
}
|
|
4678
4655
|
}
|
|
4679
4656
|
return newState_1;
|
|
@@ -4704,8 +4681,9 @@
|
|
|
4704
4681
|
newState_2.requestedDocumentType = remainingRequirements[0];
|
|
4705
4682
|
if (state.requestedDocumentType === 'idCardFront' && newState_2.requestedDocumentType === 'idCardBack') {
|
|
4706
4683
|
newState_2.captureState = 'requestingFlip';
|
|
4707
|
-
newState_2.
|
|
4708
|
-
newState_2.
|
|
4684
|
+
newState_2.idCardFrontDetectionThresholdMet = false;
|
|
4685
|
+
newState_2.idCardBackDetectionThresholdMet = false;
|
|
4686
|
+
newState_2.passportDetectionThresholdMet = false;
|
|
4709
4687
|
}
|
|
4710
4688
|
}
|
|
4711
4689
|
return newState_2;
|
|
@@ -7835,85 +7813,42 @@
|
|
|
7835
7813
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
7836
7814
|
|
|
7837
7815
|
var IdCapture = function IdCapture(_a) {
|
|
7838
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
|
7816
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7839
7817
|
var requiredDocumentType = _a.requiredDocumentType,
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
_o = _a.autoCaptureBarcodeRequired,
|
|
7843
|
-
autoCaptureBarcodeRequired = _o === void 0 ? 'mobile' : _o,
|
|
7844
|
-
_p = _a.idCardDetectionThreshold,
|
|
7845
|
-
idCardDetectionThreshold = _p === void 0 ? defaultDocumentDetectionThresholds.idCard : _p,
|
|
7846
|
-
_q = _a.passportDetectionThreshold,
|
|
7847
|
-
passportDetectionThreshold = _q === void 0 ? defaultDocumentDetectionThresholds.passport : _q,
|
|
7848
|
-
_r = _a.mrzDetectionScoreThreshold,
|
|
7849
|
-
mrzDetectionScoreThreshold = _r === void 0 ? defaultDocumentDetectionThresholds.mrz : _r,
|
|
7850
|
-
_s = _a.pdf417DetectionThreshold,
|
|
7851
|
-
pdf417DetectionThreshold = _s === void 0 ? defaultDocumentDetectionThresholds.pdf417 : _s,
|
|
7852
|
-
_t = _a.idCardFocusScoreThreshold,
|
|
7853
|
-
idCardFocusScoreThreshold = _t === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _t,
|
|
7854
|
-
_u = _a.passportFocusScoreThreshold,
|
|
7855
|
-
passportFocusScoreThreshold = _u === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _u,
|
|
7856
|
-
_v = _a.barcodeScanningEnabled,
|
|
7857
|
-
barcodeScanningEnabled = _v === void 0 ? true : _v,
|
|
7858
|
-
_w = _a.maxBarcodeScanAttempts,
|
|
7859
|
-
maxBarcodeScanAttempts = _w === void 0 ? 10 : _w,
|
|
7818
|
+
_k = _a.thresholds,
|
|
7819
|
+
thresholds = _k === void 0 ? defaultIdCaptureThresholds : _k,
|
|
7860
7820
|
guidanceMessage = _a.guidanceMessage,
|
|
7861
7821
|
guidanceSatisfied = _a.guidanceSatisfied,
|
|
7862
|
-
onPrediction = _a.onPrediction,
|
|
7863
7822
|
onCapture = _a.onCapture,
|
|
7864
|
-
|
|
7865
|
-
assets =
|
|
7866
|
-
|
|
7867
|
-
classNames =
|
|
7868
|
-
|
|
7869
|
-
colors =
|
|
7870
|
-
|
|
7871
|
-
rawVerbiage =
|
|
7872
|
-
|
|
7873
|
-
debugMode =
|
|
7874
|
-
var
|
|
7875
|
-
ref =
|
|
7876
|
-
|
|
7877
|
-
width =
|
|
7878
|
-
|
|
7879
|
-
height =
|
|
7880
|
-
var
|
|
7881
|
-
state =
|
|
7882
|
-
dispatch =
|
|
7823
|
+
_l = _a.assets,
|
|
7824
|
+
assets = _l === void 0 ? {} : _l,
|
|
7825
|
+
_m = _a.classNames,
|
|
7826
|
+
classNames = _m === void 0 ? {} : _m,
|
|
7827
|
+
_o = _a.colors,
|
|
7828
|
+
colors = _o === void 0 ? {} : _o,
|
|
7829
|
+
_p = _a.verbiage,
|
|
7830
|
+
rawVerbiage = _p === void 0 ? {} : _p,
|
|
7831
|
+
_q = _a.debugMode,
|
|
7832
|
+
debugMode = _q === void 0 ? false : _q;
|
|
7833
|
+
var _r = useResizeObserver(),
|
|
7834
|
+
ref = _r.ref,
|
|
7835
|
+
_s = _r.width,
|
|
7836
|
+
width = _s === void 0 ? 1 : _s,
|
|
7837
|
+
_t = _r.height,
|
|
7838
|
+
height = _t === void 0 ? 1 : _t;
|
|
7839
|
+
var _u = useIdCaptureState(),
|
|
7840
|
+
state = _u[0],
|
|
7841
|
+
dispatch = _u[1];
|
|
7883
7842
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
7884
|
-
var
|
|
7885
|
-
modelsReady =
|
|
7886
|
-
setThresholds =
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
getBestFrame = _6.getBestFrame;
|
|
7843
|
+
var _v = React.useContext(IdCaptureModelsContext),
|
|
7844
|
+
modelsReady = _v.ready,
|
|
7845
|
+
setThresholds = _v.setThresholds,
|
|
7846
|
+
detectionTime = _v.detectionTime,
|
|
7847
|
+
focusPredictionTime = _v.focusPredictionTime,
|
|
7848
|
+
getBestFrame = _v.getBestFrame;
|
|
7891
7849
|
React.useEffect(function () {
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
payload: {
|
|
7895
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
7896
|
-
barcodeScanningEnabled: barcodeScanningEnabled,
|
|
7897
|
-
maxBarcodeScanAttempts: maxBarcodeScanAttempts
|
|
7898
|
-
}
|
|
7899
|
-
});
|
|
7900
|
-
}, [autoCaptureBarcodeRequired, barcodeScanningEnabled, dispatch, maxBarcodeScanAttempts]);
|
|
7901
|
-
React.useEffect(function () {
|
|
7902
|
-
setThresholds({
|
|
7903
|
-
idCard: idCardDetectionThreshold,
|
|
7904
|
-
passport: passportDetectionThreshold,
|
|
7905
|
-
mrz: mrzDetectionScoreThreshold,
|
|
7906
|
-
pdf417: pdf417DetectionThreshold,
|
|
7907
|
-
focus: {
|
|
7908
|
-
idCard: {
|
|
7909
|
-
mobile: idCardFocusScoreThreshold
|
|
7910
|
-
},
|
|
7911
|
-
passport: {
|
|
7912
|
-
mobile: passportFocusScoreThreshold
|
|
7913
|
-
}
|
|
7914
|
-
}
|
|
7915
|
-
});
|
|
7916
|
-
}, [idCardDetectionThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportDetectionThreshold, passportFocusScoreThreshold, pdf417DetectionThreshold, setThresholds]);
|
|
7850
|
+
setThresholds(thresholds);
|
|
7851
|
+
}, [thresholds, setThresholds]);
|
|
7917
7852
|
React.useEffect(function () {
|
|
7918
7853
|
if (!requiredDocumentType) return;
|
|
7919
7854
|
dispatch({
|
|
@@ -7930,18 +7865,7 @@
|
|
|
7930
7865
|
}
|
|
7931
7866
|
});
|
|
7932
7867
|
}, [dispatch, height, width]);
|
|
7933
|
-
|
|
7934
|
-
onPredictionMade(function (prediction) {
|
|
7935
|
-
dispatch({
|
|
7936
|
-
type: 'objectsDetected',
|
|
7937
|
-
payload: {
|
|
7938
|
-
prediction: prediction
|
|
7939
|
-
}
|
|
7940
|
-
});
|
|
7941
|
-
onPrediction === null || onPrediction === void 0 ? void 0 : onPrediction(prediction);
|
|
7942
|
-
});
|
|
7943
|
-
}, [dispatch, onPrediction, onPredictionMade]);
|
|
7944
|
-
var shouldCapture = autoCaptureEnabled && state.goodFramesThresholdMet && !state.capturing && !state.waitingForBarcodeScan && timeSince(state.captureStartedAt) >= 3000;
|
|
7868
|
+
var shouldCapture = state.goodFramesThresholdMet && !state.capturing && timeSince(state.captureStartedAt) >= 3000;
|
|
7945
7869
|
React.useEffect(function () {
|
|
7946
7870
|
if (!shouldCapture) return;
|
|
7947
7871
|
dispatch({
|
|
@@ -7955,29 +7879,13 @@
|
|
|
7955
7879
|
});
|
|
7956
7880
|
return;
|
|
7957
7881
|
}
|
|
7958
|
-
var
|
|
7882
|
+
var canvas = bestFrame.canvas,
|
|
7959
7883
|
documentType = bestFrame.documentType,
|
|
7960
7884
|
boundingBox = bestFrame.boundingBox,
|
|
7961
7885
|
detectionScore = bestFrame.detectionScore,
|
|
7962
7886
|
focusScore = bestFrame.focusScore;
|
|
7963
|
-
var width =
|
|
7964
|
-
height =
|
|
7965
|
-
var canvas = originalCanvas;
|
|
7966
|
-
// resize image to 2k max if barcode is read
|
|
7967
|
-
var isGreaterThan2k = width > 1920 && height > 1080 || width > 1080 && height > 1920;
|
|
7968
|
-
if (isGreaterThan2k && !!state.barcodeResult) {
|
|
7969
|
-
canvas = document.createElement('canvas');
|
|
7970
|
-
if (width > height) {
|
|
7971
|
-
canvas.width = 1920;
|
|
7972
|
-
canvas.height = height * (1920 / width);
|
|
7973
|
-
} else {
|
|
7974
|
-
canvas.height = 1920;
|
|
7975
|
-
canvas.width = width * (1920 / height);
|
|
7976
|
-
}
|
|
7977
|
-
var ctx2d = canvas.getContext('2d');
|
|
7978
|
-
if (!ctx2d) return;
|
|
7979
|
-
ctx2d.drawImage(originalCanvas, 0, 0, canvas.width, canvas.height);
|
|
7980
|
-
}
|
|
7887
|
+
var width = canvas.width,
|
|
7888
|
+
height = canvas.height;
|
|
7981
7889
|
var imageUrl = canvas.toDataURL('image/jpeg', 0.95);
|
|
7982
7890
|
dispatch({
|
|
7983
7891
|
type: 'frameCaptured',
|
|
@@ -8001,18 +7909,17 @@
|
|
|
8001
7909
|
type: 'captured'
|
|
8002
7910
|
});
|
|
8003
7911
|
}, 0);
|
|
8004
|
-
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.
|
|
7912
|
+
}, [dispatch, getBestFrame, onCapture, shouldCapture, state.captureStartedAt, state.requestedDocumentType]);
|
|
8005
7913
|
assets.portraitGuidesImageUrl || (assets.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
8006
7914
|
assets.landscapeGuidesImageUrl || (assets.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
8007
7915
|
var theme = styled.useTheme();
|
|
8008
|
-
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (
|
|
8009
|
-
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (
|
|
7916
|
+
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.unsatisfiedColor) !== null && _d !== void 0 ? _d : 'white');
|
|
7917
|
+
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = (_g = (_f = (_e = theme.idCapture) === null || _e === void 0 ? void 0 : _e.guideBox) === null || _f === void 0 ? void 0 : _f.satisfiedColor) !== null && _g !== void 0 ? _g : 'green');
|
|
8010
7918
|
var verbiage = useTranslations(rawVerbiage, {
|
|
8011
7919
|
instructionText: 'Scan the front of ID',
|
|
8012
7920
|
processingIdCardText: 'ID card front captured.',
|
|
8013
|
-
|
|
8014
|
-
|
|
8015
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
7921
|
+
guidanceSatisfiedText: "".concat(documentTypeDisplayNames[state.detectedDocumentType], " detected, hold still..."),
|
|
7922
|
+
guidancePleaseFlipText: 'ID card front detected - please flip your ID card',
|
|
8016
7923
|
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
8017
7924
|
guidanceNotCenteredText: 'Document is not centered',
|
|
8018
7925
|
guidanceTooCloseText: 'Document too close, please back up',
|
|
@@ -8027,10 +7934,10 @@
|
|
|
8027
7934
|
});
|
|
8028
7935
|
var satisfied = state.isGoodFrame;
|
|
8029
7936
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
8030
|
-
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.
|
|
7937
|
+
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.flipRequired ? verbiage.guidancePleaseFlipText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
|
|
8031
7938
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
8032
7939
|
ref: ref,
|
|
8033
|
-
className: "flex ".concat((
|
|
7940
|
+
className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
|
|
8034
7941
|
}, guidanceMessage !== '' && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, {
|
|
8035
7942
|
"$top": "",
|
|
8036
7943
|
"$bottom": "12.5dvh",
|
|
@@ -8039,7 +7946,7 @@
|
|
|
8039
7946
|
"$variant": satisfied ? 'positive' : 'default',
|
|
8040
7947
|
className: classNames.guidanceMessage
|
|
8041
7948
|
}, guidanceMessage))), debugMode && ( /*#__PURE__*/React__default['default'].createElement(DebugBoundingBoxOverlay, {
|
|
8042
|
-
"$flipX": !((
|
|
7949
|
+
"$flipX": !((_j = cameraRef.current) === null || _j === void 0 ? void 0 : _j.isRearFacing),
|
|
8043
7950
|
scaling: debugScalingDetails
|
|
8044
7951
|
}, state.detectedObjects.map(function (obj, i) {
|
|
8045
7952
|
var _a;
|
|
@@ -8049,7 +7956,7 @@
|
|
|
8049
7956
|
scaling: debugScalingDetails,
|
|
8050
7957
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
8051
7958
|
});
|
|
8052
|
-
}))), 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), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__default['default'].createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, state.
|
|
7959
|
+
}))), 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), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__default['default'].createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default['default'].createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default['default'].createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default['default'].createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u274C Models not ready")))));
|
|
8053
7960
|
};
|
|
8054
7961
|
var timeSince = function timeSince(t) {
|
|
8055
7962
|
if (!t) return 0;
|
|
@@ -8983,11 +8890,7 @@
|
|
|
8983
8890
|
setUrl(cropToDetectedObjectBox(imgRef.current, bbox).toDataURL('image/jpeg', 0.95));
|
|
8984
8891
|
}, 100);
|
|
8985
8892
|
}
|
|
8986
|
-
return /*#__PURE__*/React__default['default'].createElement("
|
|
8987
|
-
style: {
|
|
8988
|
-
position: 'relative'
|
|
8989
|
-
}
|
|
8990
|
-
}, /*#__PURE__*/React__default['default'].createElement("img", {
|
|
8893
|
+
return /*#__PURE__*/React__default['default'].createElement("img", {
|
|
8991
8894
|
ref: imgRef,
|
|
8992
8895
|
alt: alt,
|
|
8993
8896
|
className: className,
|
|
@@ -9007,13 +8910,12 @@
|
|
|
9007
8910
|
(_a = link.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(link);
|
|
9008
8911
|
});
|
|
9009
8912
|
}
|
|
9010
|
-
})
|
|
8913
|
+
});
|
|
9011
8914
|
};
|
|
9012
8915
|
|
|
9013
8916
|
var OverlayInstruction = styled__default['default'].p(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n font-size: 18px;\n margin: 30px 0;\n"], ["\n font-size: 18px;\n margin: 30px 0;\n"])));
|
|
9014
8917
|
var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
9015
8918
|
var capturedDocuments = _a.capturedDocuments,
|
|
9016
|
-
// barcodeResult,
|
|
9017
8919
|
onSubmitClick = _a.onSubmitClick,
|
|
9018
8920
|
onRetryClick = _a.onRetryClick,
|
|
9019
8921
|
_b = _a.classNames,
|
|
@@ -9021,7 +8923,9 @@
|
|
|
9021
8923
|
_c = _a.colors,
|
|
9022
8924
|
colors = _c === void 0 ? {} : _c,
|
|
9023
8925
|
_d = _a.verbiage,
|
|
9024
|
-
rawVerbiage = _d === void 0 ? {} : _d
|
|
8926
|
+
rawVerbiage = _d === void 0 ? {} : _d,
|
|
8927
|
+
_e = _a.debugMode,
|
|
8928
|
+
debugMode = _e === void 0 ? false : _e;
|
|
9025
8929
|
var submissionStatus = React.useContext(SubmissionContext).submissionStatus;
|
|
9026
8930
|
var idCardFront = capturedDocuments.idCardFront,
|
|
9027
8931
|
idCardBack = capturedDocuments.idCardBack,
|
|
@@ -9056,7 +8960,7 @@
|
|
|
9056
8960
|
image: idCardFront,
|
|
9057
8961
|
className: classNames.image,
|
|
9058
8962
|
alt: verbiage.idCardFrontText
|
|
9059
|
-
})))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
8963
|
+
})), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(idCardFront.detectionScore, "\nFocus Score: ").concat(idCardFront.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardFront.boundingBox)))))), idCardBack && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
9060
8964
|
className: classNames.imageCol
|
|
9061
8965
|
}, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
|
|
9062
8966
|
className: classNames.imageHeading
|
|
@@ -9066,7 +8970,7 @@
|
|
|
9066
8970
|
image: idCardBack,
|
|
9067
8971
|
className: classNames.image,
|
|
9068
8972
|
alt: verbiage.idCardBackText
|
|
9069
|
-
})))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
8973
|
+
})), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React__default['default'].createElement(ImageCol$1, {
|
|
9070
8974
|
className: classNames.imageCol
|
|
9071
8975
|
}, /*#__PURE__*/React__default['default'].createElement(ImageHeading, {
|
|
9072
8976
|
className: classNames.imageHeading
|
|
@@ -9076,7 +8980,7 @@
|
|
|
9076
8980
|
image: passport,
|
|
9077
8981
|
className: classNames.image,
|
|
9078
8982
|
alt: verbiage.passportText
|
|
9079
|
-
})))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
|
|
8983
|
+
})), debugMode && ( /*#__PURE__*/React__default['default'].createElement("pre", null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__default['default'].createElement(OverlayInstruction, {
|
|
9080
8984
|
className: classNames.instruction
|
|
9081
8985
|
}, verbiage.instructionText), /*#__PURE__*/React__default['default'].createElement(ButtonsRow, {
|
|
9082
8986
|
className: classNames.buttonsRow
|
|
@@ -9678,13 +9582,8 @@
|
|
|
9678
9582
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
9679
9583
|
var verbiage = useTranslations(rawVerbiage, {
|
|
9680
9584
|
instructionText: 'Scan the front of ID',
|
|
9681
|
-
processingIdCardText: 'ID card front captured.',
|
|
9682
9585
|
capturingText: 'Capturing...',
|
|
9683
|
-
captureFailedText: 'Capture failed!'
|
|
9684
|
-
guidanceSatisfiedText: 'Document detected, hold still...',
|
|
9685
|
-
guidanceTooBlurryText: 'Document out of focus – try improving the lighting',
|
|
9686
|
-
guidanceNotCenteredText: 'Document is not centered',
|
|
9687
|
-
guidanceNotDetectedText: 'Document not detected'
|
|
9586
|
+
captureFailedText: 'Capture failed!'
|
|
9688
9587
|
});
|
|
9689
9588
|
var isMobile = window.innerWidth < window.innerHeight;
|
|
9690
9589
|
var frontImageUrl = portraitGuidesOnMobile && isMobile ? flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontPortraitGuidesImageUrl : flipIdPromptAssets === null || flipIdPromptAssets === void 0 ? void 0 : flipIdPromptAssets.frontLandscapeGuidesImageUrl;
|
|
@@ -9698,7 +9597,7 @@
|
|
|
9698
9597
|
landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
|
|
9699
9598
|
isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
|
|
9700
9599
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
9701
|
-
imageVisible: requestingFlip || !state.
|
|
9600
|
+
imageVisible: requestingFlip || !state.idCardFrontDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
|
|
9702
9601
|
})), guideType === 'fit' && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureFitGuide, {
|
|
9703
9602
|
classNames: classNames,
|
|
9704
9603
|
requestingFlip: requestingFlip,
|
|
@@ -9708,7 +9607,7 @@
|
|
|
9708
9607
|
backImageUrl: backImageUrl,
|
|
9709
9608
|
isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
|
|
9710
9609
|
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
|
|
9711
|
-
imageVisible: requestingFlip || !state.
|
|
9610
|
+
imageVisible: requestingFlip || !state.detectionThresholdMet || !state.documentInBounds || state.documentTooClose || state.flipRequired
|
|
9712
9611
|
})));
|
|
9713
9612
|
}
|
|
9714
9613
|
|
|
@@ -10603,78 +10502,66 @@
|
|
|
10603
10502
|
var templateObject_1$l, templateObject_2$f, templateObject_3$d, templateObject_4$8, templateObject_5$4, templateObject_6$3;
|
|
10604
10503
|
|
|
10605
10504
|
var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
10606
|
-
var _b, _c, _d, _e, _f, _g
|
|
10607
|
-
var _k, _l, _m, _o, _p, _q, _r, _s
|
|
10505
|
+
var _b, _c, _d, _e, _f, _g;
|
|
10506
|
+
var _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
10608
10507
|
var onSuccess = _a.onSuccess,
|
|
10609
10508
|
onExitCapture = _a.onExitCapture,
|
|
10610
10509
|
onUserCancel = _a.onUserCancel,
|
|
10611
|
-
|
|
10612
|
-
loadingOverlayMode =
|
|
10510
|
+
_t = _a.loadingOverlayMode,
|
|
10511
|
+
loadingOverlayMode = _t === void 0 ? 'default' : _t,
|
|
10613
10512
|
precapturedDocuments = _a.precapturedDocuments,
|
|
10614
|
-
|
|
10615
|
-
captureRequirement =
|
|
10616
|
-
|
|
10617
|
-
separateIdCardCaptureSequence =
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
_0 = _a.barcodeScanningEnabled,
|
|
10623
|
-
barcodeScanningEnabled = _0 === void 0 ? false : _0,
|
|
10624
|
-
_1 = _a.idCardAutoCaptureScoreThreshold,
|
|
10625
|
-
idCardAutoCaptureScoreThreshold = _1 === void 0 ? defaultDocumentDetectionThresholds.idCard : _1,
|
|
10626
|
-
_2 = _a.passportAutoCaptureScoreThreshold,
|
|
10627
|
-
passportAutoCaptureScoreThreshold = _2 === void 0 ? defaultDocumentDetectionThresholds.passport : _2,
|
|
10628
|
-
_3 = _a.mrzDetectionScoreThreshold,
|
|
10629
|
-
mrzDetectionScoreThreshold = _3 === void 0 ? defaultDocumentDetectionThresholds.mrz : _3,
|
|
10630
|
-
_4 = _a.idCardFocusScoreThreshold,
|
|
10631
|
-
idCardFocusScoreThreshold = _4 === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _4,
|
|
10632
|
-
_5 = _a.passportFocusScoreThreshold,
|
|
10633
|
-
passportFocusScoreThreshold = _5 === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _5,
|
|
10634
|
-
_6 = _a.skipSuccessScreen,
|
|
10635
|
-
skipSuccessScreen = _6 === void 0 ? false : _6,
|
|
10513
|
+
_u = _a.captureRequirement,
|
|
10514
|
+
captureRequirement = _u === void 0 ? 'idCardOrPassport' : _u,
|
|
10515
|
+
_v = _a.separateIdCardCaptureSequence,
|
|
10516
|
+
separateIdCardCaptureSequence = _v === void 0 ? false : _v,
|
|
10517
|
+
_w = _a.thresholds,
|
|
10518
|
+
thresholds = _w === void 0 ? defaultIdCaptureThresholds : _w,
|
|
10519
|
+
_x = _a.skipSuccessScreen,
|
|
10520
|
+
skipSuccessScreen = _x === void 0 ? false : _x,
|
|
10636
10521
|
instructions = _a.instructions,
|
|
10637
|
-
|
|
10638
|
-
releaseCameraAccessOnExit =
|
|
10639
|
-
|
|
10640
|
-
guideType =
|
|
10641
|
-
|
|
10642
|
-
portraitGuidesOnMobile =
|
|
10643
|
-
|
|
10644
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
10645
|
-
|
|
10646
|
-
silentFallback =
|
|
10647
|
-
|
|
10648
|
-
assets =
|
|
10649
|
-
|
|
10650
|
-
classNames =
|
|
10651
|
-
|
|
10652
|
-
colors =
|
|
10653
|
-
|
|
10654
|
-
verbiage =
|
|
10655
|
-
|
|
10656
|
-
debugMode =
|
|
10657
|
-
var
|
|
10658
|
-
state =
|
|
10659
|
-
dispatch =
|
|
10660
|
-
var
|
|
10661
|
-
cameraAccessDenied =
|
|
10662
|
-
releaseCameraAccess =
|
|
10663
|
-
var
|
|
10664
|
-
overlayDismissed =
|
|
10665
|
-
setOverlayDismissed =
|
|
10666
|
-
var
|
|
10667
|
-
submissionStatus =
|
|
10668
|
-
setIdFrontImage =
|
|
10669
|
-
setIdBackImage =
|
|
10670
|
-
setPassportImage =
|
|
10671
|
-
logIdFrontCaptureAttempt =
|
|
10672
|
-
logIdBackCaptureAttempt =
|
|
10673
|
-
var
|
|
10674
|
-
start =
|
|
10675
|
-
stop =
|
|
10676
|
-
|
|
10677
|
-
|
|
10522
|
+
_y = _a.releaseCameraAccessOnExit,
|
|
10523
|
+
releaseCameraAccessOnExit = _y === void 0 ? true : _y,
|
|
10524
|
+
_z = _a.guideType,
|
|
10525
|
+
guideType = _z === void 0 ? 'fit' : _z,
|
|
10526
|
+
_0 = _a.portraitGuidesOnMobile,
|
|
10527
|
+
portraitGuidesOnMobile = _0 === void 0 ? false : _0,
|
|
10528
|
+
_1 = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
10529
|
+
rotateLoadingOverlayImageWhenPortrait = _1 === void 0 ? true : _1,
|
|
10530
|
+
_2 = _a.silentFallback,
|
|
10531
|
+
silentFallback = _2 === void 0 ? false : _2,
|
|
10532
|
+
_3 = _a.assets,
|
|
10533
|
+
assets = _3 === void 0 ? {} : _3,
|
|
10534
|
+
_4 = _a.classNames,
|
|
10535
|
+
classNames = _4 === void 0 ? {} : _4,
|
|
10536
|
+
_5 = _a.colors,
|
|
10537
|
+
colors = _5 === void 0 ? {} : _5,
|
|
10538
|
+
_6 = _a.verbiage,
|
|
10539
|
+
verbiage = _6 === void 0 ? {} : _6,
|
|
10540
|
+
_7 = _a.debugMode,
|
|
10541
|
+
debugMode = _7 === void 0 ? false : _7;
|
|
10542
|
+
var _8 = useIdCaptureState(),
|
|
10543
|
+
state = _8[0],
|
|
10544
|
+
dispatch = _8[1];
|
|
10545
|
+
var _9 = React.useContext(CameraStateContext),
|
|
10546
|
+
cameraAccessDenied = _9.cameraAccessDenied,
|
|
10547
|
+
releaseCameraAccess = _9.releaseCameraAccess;
|
|
10548
|
+
var _10 = React.useState(false),
|
|
10549
|
+
overlayDismissed = _10[0],
|
|
10550
|
+
setOverlayDismissed = _10[1];
|
|
10551
|
+
var _11 = React.useContext(SubmissionContext),
|
|
10552
|
+
submissionStatus = _11.submissionStatus,
|
|
10553
|
+
setIdFrontImage = _11.setIdFrontImage,
|
|
10554
|
+
setIdBackImage = _11.setIdBackImage,
|
|
10555
|
+
setPassportImage = _11.setPassportImage,
|
|
10556
|
+
logIdFrontCaptureAttempt = _11.logIdFrontCaptureAttempt,
|
|
10557
|
+
logIdBackCaptureAttempt = _11.logIdBackCaptureAttempt;
|
|
10558
|
+
var _12 = React.useContext(IdCaptureModelsContext),
|
|
10559
|
+
start = _12.start,
|
|
10560
|
+
stop = _12.stop,
|
|
10561
|
+
onPredictionMade = _12.onPredictionMade,
|
|
10562
|
+
setRequiredDocumentType = _12.setRequiredDocumentType,
|
|
10563
|
+
modelError = _12.modelError,
|
|
10564
|
+
resetBestFrame = _12.resetBestFrame;
|
|
10678
10565
|
React.useEffect(function () {
|
|
10679
10566
|
dispatch({
|
|
10680
10567
|
type: 'configureWizard',
|
|
@@ -10699,16 +10586,29 @@
|
|
|
10699
10586
|
type: 'captureStarted'
|
|
10700
10587
|
});
|
|
10701
10588
|
start();
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10589
|
+
}, [dispatch, overlayDismissed, start, state.captureState]);
|
|
10590
|
+
React.useEffect(function () {
|
|
10591
|
+
onPredictionMade(function (prediction) {
|
|
10592
|
+
if (state.captureState === 'capturing') {
|
|
10593
|
+
dispatch({
|
|
10594
|
+
type: 'objectsDetected',
|
|
10595
|
+
payload: {
|
|
10596
|
+
prediction: prediction
|
|
10597
|
+
}
|
|
10598
|
+
});
|
|
10599
|
+
} else if (state.captureState === 'requestingFlip') {
|
|
10600
|
+
if (prediction.idCardBackDetectionThresholdMet) {
|
|
10601
|
+
resetBestFrame();
|
|
10602
|
+
dispatch({
|
|
10603
|
+
type: 'flipRequestCompleted'
|
|
10604
|
+
});
|
|
10605
|
+
}
|
|
10606
|
+
}
|
|
10710
10607
|
});
|
|
10711
|
-
}, [dispatch]);
|
|
10608
|
+
}, [dispatch, onPredictionMade, resetBestFrame, state.captureState]);
|
|
10609
|
+
React.useEffect(function () {
|
|
10610
|
+
if (state.captureState === 'complete') stop();
|
|
10611
|
+
}, [state.captureState, stop]);
|
|
10712
10612
|
var onCapture = React.useCallback(function (imageData, width, height, documentType, metadata) {
|
|
10713
10613
|
logCaptureMetadata(metadata);
|
|
10714
10614
|
dispatch({
|
|
@@ -10718,7 +10618,9 @@
|
|
|
10718
10618
|
width: width,
|
|
10719
10619
|
height: height,
|
|
10720
10620
|
documentType: documentType,
|
|
10721
|
-
boundingBox: metadata.boundingBox
|
|
10621
|
+
boundingBox: metadata.boundingBox,
|
|
10622
|
+
detectionScore: metadata.bestDetectionScore,
|
|
10623
|
+
focusScore: metadata.bestFocusScore
|
|
10722
10624
|
}
|
|
10723
10625
|
});
|
|
10724
10626
|
}, [dispatch, logCaptureMetadata]);
|
|
@@ -10748,9 +10650,9 @@
|
|
|
10748
10650
|
type: 'resetWizard'
|
|
10749
10651
|
});
|
|
10750
10652
|
}, [dispatch]);
|
|
10751
|
-
var
|
|
10752
|
-
attempt =
|
|
10753
|
-
setAttempt =
|
|
10653
|
+
var _13 = React.useState(0),
|
|
10654
|
+
attempt = _13[0],
|
|
10655
|
+
setAttempt = _13[1];
|
|
10754
10656
|
var onExit = React.useCallback(function () {
|
|
10755
10657
|
setOverlayDismissed(false);
|
|
10756
10658
|
setAttempt(function (n) {
|
|
@@ -10775,19 +10677,19 @@
|
|
|
10775
10677
|
}
|
|
10776
10678
|
}, [cameraAccessDenied]);
|
|
10777
10679
|
assets.idCardFront || (assets.idCardFront = {});
|
|
10778
|
-
(
|
|
10779
|
-
(
|
|
10680
|
+
(_h = assets.idCardFront).portraitGuidesImageUrl || (_h.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
10681
|
+
(_j = assets.idCardFront).landscapeGuidesImageUrl || (_j.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
10780
10682
|
assets.idCardBack || (assets.idCardBack = {});
|
|
10781
|
-
(
|
|
10782
|
-
(
|
|
10683
|
+
(_k = assets.idCardBack).portraitGuidesImageUrl || (_k.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
|
|
10684
|
+
(_l = assets.idCardBack).landscapeGuidesImageUrl || (_l.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
10783
10685
|
assets.passport || (assets.passport = {});
|
|
10784
|
-
(
|
|
10785
|
-
(
|
|
10686
|
+
(_m = assets.passport).portraitGuidesImageUrl || (_m.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
|
|
10687
|
+
(_o = assets.passport).landscapeGuidesImageUrl || (_o.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
|
|
10786
10688
|
assets.flipIdPrompt || (assets.flipIdPrompt = {});
|
|
10787
|
-
(
|
|
10788
|
-
(
|
|
10789
|
-
(
|
|
10790
|
-
(
|
|
10689
|
+
(_p = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_p.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
|
|
10690
|
+
(_q = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_q.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
|
|
10691
|
+
(_r = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_r.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
|
|
10692
|
+
(_s = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_s.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
|
|
10791
10693
|
var idCaptureVerbiages = {
|
|
10792
10694
|
idCardFront: useTranslations(verbiage.idCardFront, {
|
|
10793
10695
|
instructionText: 'Scan the front of ID',
|
|
@@ -10801,24 +10703,35 @@
|
|
|
10801
10703
|
})
|
|
10802
10704
|
};
|
|
10803
10705
|
var theme = styled.useTheme();
|
|
10804
|
-
var
|
|
10805
|
-
guideRectX =
|
|
10806
|
-
guideRectY =
|
|
10807
|
-
guideRectWidth =
|
|
10808
|
-
guideRectHeight =
|
|
10809
|
-
imageUrl =
|
|
10706
|
+
var _14 = useIdCaptureState()[0],
|
|
10707
|
+
guideRectX = _14.guideRectX,
|
|
10708
|
+
guideRectY = _14.guideRectY,
|
|
10709
|
+
guideRectWidth = _14.guideRectWidth,
|
|
10710
|
+
guideRectHeight = _14.guideRectHeight,
|
|
10711
|
+
imageUrl = _14.imageUrl;
|
|
10810
10712
|
var idCaptureAssets = assets[state.requestedDocumentType];
|
|
10811
10713
|
var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
|
|
10812
10714
|
React.useEffect(function () {
|
|
10813
10715
|
if (separateIdCardCaptureSequence) return;
|
|
10814
|
-
if (state.captureState
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
}
|
|
10716
|
+
if (state.captureState !== 'requestingFlip') return;
|
|
10717
|
+
var t = setTimeout(function () {
|
|
10718
|
+
resetBestFrame();
|
|
10719
|
+
dispatch({
|
|
10720
|
+
type: 'flipRequestCompleted'
|
|
10721
|
+
});
|
|
10722
|
+
}, 6000);
|
|
10723
|
+
return function () {
|
|
10724
|
+
clearTimeout(t);
|
|
10725
|
+
};
|
|
10726
|
+
}, [dispatch, resetBestFrame, separateIdCardCaptureSequence, state.captureState]);
|
|
10727
|
+
React.useEffect(function () {
|
|
10728
|
+
if (state.requestedDocumentType === 'idCardBack') {
|
|
10729
|
+
setRequiredDocumentType('idCardBack');
|
|
10820
10730
|
}
|
|
10821
|
-
|
|
10731
|
+
return function () {
|
|
10732
|
+
setRequiredDocumentType('none');
|
|
10733
|
+
};
|
|
10734
|
+
}, [setRequiredDocumentType, state.requestedDocumentType]);
|
|
10822
10735
|
var handleCapture = React.useCallback(function (imageData) {
|
|
10823
10736
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
10824
10737
|
var base64ImageData;
|
|
@@ -10852,7 +10765,7 @@
|
|
|
10852
10765
|
});
|
|
10853
10766
|
}
|
|
10854
10767
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
10855
|
-
className: "flex ".concat((
|
|
10768
|
+
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
10856
10769
|
}, state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement(CameraFeedWrapper, {
|
|
10857
10770
|
"$x": guideRectX,
|
|
10858
10771
|
"$y": guideRectY,
|
|
@@ -10863,15 +10776,7 @@
|
|
|
10863
10776
|
className: classNames === null || classNames === void 0 ? void 0 : classNames.cameraFeed
|
|
10864
10777
|
}))), overlayDismissed && state.captureState === 'capturing' && ( /*#__PURE__*/React__default['default'].createElement(IdCapture, {
|
|
10865
10778
|
requiredDocumentType: state.requestedDocumentType,
|
|
10866
|
-
|
|
10867
|
-
idCardDetectionThreshold: idCardAutoCaptureScoreThreshold,
|
|
10868
|
-
passportDetectionThreshold: passportAutoCaptureScoreThreshold,
|
|
10869
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
10870
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
10871
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
10872
|
-
autoCaptureBarcodeRequired: autoCaptureBarcodeRequired,
|
|
10873
|
-
barcodeScanningEnabled: barcodeScanningEnabled && state.requestedDocumentType === 'idCardBack',
|
|
10874
|
-
onPrediction: onPrediction,
|
|
10779
|
+
thresholds: thresholds,
|
|
10875
10780
|
onCapture: onCapture,
|
|
10876
10781
|
assets: idCaptureAssets,
|
|
10877
10782
|
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.capture,
|
|
@@ -10887,15 +10792,15 @@
|
|
|
10887
10792
|
assets: idCaptureAssets,
|
|
10888
10793
|
colors: colors,
|
|
10889
10794
|
verbiage: idCaptureVerbiage
|
|
10890
|
-
}), !((
|
|
10891
|
-
classNames: (
|
|
10892
|
-
text: (
|
|
10795
|
+
}), !((_d = (_c = theme.idCapture) === null || _c === void 0 ? void 0 : _c.capturePreview) === null || _d === void 0 ? void 0 : _d.disabled) && state.captureState === 'requestingFlip' && !separateIdCardCaptureSequence && imageUrl && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureImagePreview, {
|
|
10796
|
+
classNames: (_e = classNames.capture) === null || _e === void 0 ? void 0 : _e.imagePreview,
|
|
10797
|
+
text: (_f = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _f === void 0 ? void 0 : _f.processingIdCardText,
|
|
10893
10798
|
imageUrl: imageUrl
|
|
10894
10799
|
})), state.captureState !== 'complete' && ( /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10895
10800
|
id: "idmission-above-guides-content"
|
|
10896
10801
|
})), /*#__PURE__*/React__default['default'].createElement(ExitCaptureButton, {
|
|
10897
10802
|
onClick: onExit,
|
|
10898
|
-
className: (
|
|
10803
|
+
className: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.exitCaptureBtn
|
|
10899
10804
|
}), !overlayDismissed && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureLoadingOverlay, {
|
|
10900
10805
|
key: attempt,
|
|
10901
10806
|
mode: loadingOverlayMode,
|
|
@@ -10922,12 +10827,12 @@
|
|
|
10922
10827
|
verbiage: verbiage.success
|
|
10923
10828
|
})), state.captureState === 'complete' && showSuccessScreen && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureSuccess, {
|
|
10924
10829
|
capturedDocuments: state.capturedDocuments,
|
|
10925
|
-
barcodeResult: state.barcodeResult,
|
|
10926
10830
|
classNames: classNames.success,
|
|
10927
10831
|
onSubmitClick: onSubmitClick,
|
|
10928
10832
|
onRetryClick: onRetryClick,
|
|
10929
10833
|
colors: colors.success,
|
|
10930
|
-
verbiage: verbiage.success
|
|
10834
|
+
verbiage: verbiage.success,
|
|
10835
|
+
debugMode: debugMode
|
|
10931
10836
|
})));
|
|
10932
10837
|
};
|
|
10933
10838
|
|
|
@@ -13616,7 +13521,7 @@
|
|
|
13616
13521
|
var processAudio = React.useCallback(function () {
|
|
13617
13522
|
var _a;
|
|
13618
13523
|
var audioBlob = new Blob(audioChunks.current, {
|
|
13619
|
-
type: 'audio/
|
|
13524
|
+
type: 'audio/mp4'
|
|
13620
13525
|
});
|
|
13621
13526
|
audioChunks.current = [];
|
|
13622
13527
|
setAudioUrl(URL.createObjectURL(audioBlob));
|
|
@@ -14407,6 +14312,31 @@
|
|
|
14407
14312
|
var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4$1, templateObject_5, templateObject_6;
|
|
14408
14313
|
|
|
14409
14314
|
var edgeBoundary = 0.05;
|
|
14315
|
+
var defaultVideoIdCaptureThresholds = {
|
|
14316
|
+
detection: {
|
|
14317
|
+
idCardFront: 0.6,
|
|
14318
|
+
idCardBack: 0.6,
|
|
14319
|
+
passport: 1
|
|
14320
|
+
},
|
|
14321
|
+
focus: {
|
|
14322
|
+
idCardFront: {
|
|
14323
|
+
desktop: 0,
|
|
14324
|
+
mobile: 0
|
|
14325
|
+
},
|
|
14326
|
+
idCardBack: {
|
|
14327
|
+
desktop: 0,
|
|
14328
|
+
mobile: 0
|
|
14329
|
+
},
|
|
14330
|
+
passport: {
|
|
14331
|
+
desktop: 0,
|
|
14332
|
+
mobile: 0
|
|
14333
|
+
}
|
|
14334
|
+
},
|
|
14335
|
+
goodFrames: {
|
|
14336
|
+
idCardFront: 1,
|
|
14337
|
+
idCardBack: 1
|
|
14338
|
+
}
|
|
14339
|
+
};
|
|
14410
14340
|
var IdVideoCapture = function IdVideoCapture(_a) {
|
|
14411
14341
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
14412
14342
|
var onComplete = _a.onComplete,
|
|
@@ -14418,96 +14348,85 @@
|
|
|
14418
14348
|
idCaptureModelsEnabled = _w === void 0 ? true : _w,
|
|
14419
14349
|
_x = _a.idCardFrontDelay,
|
|
14420
14350
|
idCardFrontDelay = _x === void 0 ? 1000 : _x,
|
|
14421
|
-
_y = _a.
|
|
14422
|
-
|
|
14423
|
-
_z = _a.
|
|
14424
|
-
|
|
14425
|
-
_0 = _a.
|
|
14426
|
-
|
|
14427
|
-
_1 = _a.idCardBackDetectionThreshold,
|
|
14428
|
-
idCardBackDetectionThreshold = _1 === void 0 ? 0.6 : _1,
|
|
14429
|
-
_2 = _a.idCardBackFocusThreshold,
|
|
14430
|
-
idCardBackFocusThreshold = _2 === void 0 ? 0 : _2,
|
|
14431
|
-
_3 = _a.goodIdCardBackFramesThreshold,
|
|
14432
|
-
goodIdCardBackFramesThreshold = _3 === void 0 ? 1 : _3,
|
|
14433
|
-
_4 = _a.skipShowIdCardBack,
|
|
14434
|
-
skipShowIdCardBack = _4 === void 0 ? false : _4,
|
|
14435
|
-
_5 = _a.captureCountdownSeconds,
|
|
14436
|
-
captureCountdownSeconds = _5 === void 0 ? 3 : _5,
|
|
14351
|
+
_y = _a.videoIdCaptureThresholds,
|
|
14352
|
+
videoIdCaptureThresholds = _y === void 0 ? defaultVideoIdCaptureThresholds : _y,
|
|
14353
|
+
_z = _a.skipShowIdCardBack,
|
|
14354
|
+
skipShowIdCardBack = _z === void 0 ? false : _z,
|
|
14355
|
+
_0 = _a.captureCountdownSeconds,
|
|
14356
|
+
captureCountdownSeconds = _0 === void 0 ? 3 : _0,
|
|
14437
14357
|
readTextPrompt = _a.readTextPrompt,
|
|
14438
|
-
|
|
14439
|
-
readTextTimeoutDurationMs =
|
|
14440
|
-
|
|
14441
|
-
readTextMinReadingMs =
|
|
14442
|
-
|
|
14443
|
-
disableFaceDetectionWhileAudioCapture =
|
|
14444
|
-
|
|
14445
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
14446
|
-
|
|
14447
|
-
mergeAVStreams =
|
|
14448
|
-
|
|
14449
|
-
assets =
|
|
14450
|
-
|
|
14451
|
-
classNames =
|
|
14452
|
-
|
|
14453
|
-
colors =
|
|
14454
|
-
|
|
14455
|
-
rawVerbiage =
|
|
14456
|
-
|
|
14457
|
-
debugMode =
|
|
14458
|
-
var
|
|
14459
|
-
ref =
|
|
14460
|
-
|
|
14461
|
-
width =
|
|
14462
|
-
|
|
14463
|
-
height =
|
|
14464
|
-
var
|
|
14465
|
-
cameraRef =
|
|
14466
|
-
videoRef =
|
|
14467
|
-
videoLoaded =
|
|
14468
|
-
cameraReady =
|
|
14469
|
-
microphoneReady =
|
|
14470
|
-
audioStream =
|
|
14471
|
-
setVideoLoaded =
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
audioUrl = _26.audioUrl;
|
|
14358
|
+
_1 = _a.readTextTimeoutDurationMs,
|
|
14359
|
+
readTextTimeoutDurationMs = _1 === void 0 ? 15000 : _1,
|
|
14360
|
+
_2 = _a.readTextMinReadingMs,
|
|
14361
|
+
readTextMinReadingMs = _2 === void 0 ? 10000 : _2,
|
|
14362
|
+
_3 = _a.disableFaceDetectionWhileAudioCapture,
|
|
14363
|
+
disableFaceDetectionWhileAudioCapture = _3 === void 0 ? false : _3,
|
|
14364
|
+
_4 = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
14365
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _4 === void 0 ? 2000 : _4,
|
|
14366
|
+
_5 = _a.mergeAVStreams,
|
|
14367
|
+
mergeAVStreams = _5 === void 0 ? false : _5,
|
|
14368
|
+
_6 = _a.assets,
|
|
14369
|
+
assets = _6 === void 0 ? {} : _6,
|
|
14370
|
+
_7 = _a.classNames,
|
|
14371
|
+
classNames = _7 === void 0 ? {} : _7,
|
|
14372
|
+
_8 = _a.colors,
|
|
14373
|
+
colors = _8 === void 0 ? {} : _8,
|
|
14374
|
+
_9 = _a.verbiage,
|
|
14375
|
+
rawVerbiage = _9 === void 0 ? {} : _9,
|
|
14376
|
+
_10 = _a.debugMode,
|
|
14377
|
+
debugMode = _10 === void 0 ? false : _10;
|
|
14378
|
+
var _11 = useResizeObserver(),
|
|
14379
|
+
ref = _11.ref,
|
|
14380
|
+
_12 = _11.width,
|
|
14381
|
+
width = _12 === void 0 ? 1 : _12,
|
|
14382
|
+
_13 = _11.height,
|
|
14383
|
+
height = _13 === void 0 ? 1 : _13;
|
|
14384
|
+
var _14 = React.useContext(CameraStateContext),
|
|
14385
|
+
cameraRef = _14.cameraRef,
|
|
14386
|
+
videoRef = _14.videoRef,
|
|
14387
|
+
videoLoaded = _14.videoLoaded,
|
|
14388
|
+
cameraReady = _14.cameraReady,
|
|
14389
|
+
microphoneReady = _14.microphoneReady,
|
|
14390
|
+
audioStream = _14.audioStream,
|
|
14391
|
+
setVideoLoaded = _14.setVideoLoaded;
|
|
14392
|
+
var _15 = React.useState([]),
|
|
14393
|
+
detectedObjects = _15[0],
|
|
14394
|
+
setDetectedObjects = _15[1];
|
|
14395
|
+
var _16 = React.useState([]),
|
|
14396
|
+
faces = _16[0],
|
|
14397
|
+
setFaces = _16[1];
|
|
14398
|
+
var _17 = React.useContext(IdCaptureModelsContext),
|
|
14399
|
+
idModelsReady = _17.ready,
|
|
14400
|
+
startIdModels = _17.start,
|
|
14401
|
+
stopIdModels = _17.stop,
|
|
14402
|
+
onIdPredictionMade = _17.onPredictionMade,
|
|
14403
|
+
setThresholds = _17.setThresholds,
|
|
14404
|
+
bestFrameDetails = _17.bestFrameDetails,
|
|
14405
|
+
resetBestFrame = _17.resetBestFrame,
|
|
14406
|
+
idModelError = _17.modelError;
|
|
14407
|
+
var _18 = React.useState(null),
|
|
14408
|
+
videoStartsAt = _18[0],
|
|
14409
|
+
setVideoStartsAt = _18[1];
|
|
14410
|
+
var _19 = React.useContext(SubmissionContext),
|
|
14411
|
+
setIdCaptureVideoAudioStartsAt = _19.setIdCaptureVideoAudioStartsAt,
|
|
14412
|
+
setExpectedAudioText = _19.setExpectedAudioText;
|
|
14413
|
+
var _20 = React.useContext(SelfieGuidanceModelsContext),
|
|
14414
|
+
onSelfiePredictionMade = _20.onPredictionMade,
|
|
14415
|
+
selfieModelError = _20.error;
|
|
14416
|
+
var _21 = useVideoRecorder(cameraRef.current, audioStream, mergeAVStreams),
|
|
14417
|
+
isRecordingVideo = _21.isRecordingVideo,
|
|
14418
|
+
startRecordingVideo = _21.startRecordingVideo,
|
|
14419
|
+
startRecordingAudio = _21.startRecordingAudio,
|
|
14420
|
+
stopRecordingVideo = _21.stopRecordingVideo,
|
|
14421
|
+
stopRecordingAudio = _21.stopRecordingAudio,
|
|
14422
|
+
videoRecordingUnintentionallyStopped = _21.videoRecordingUnintentionallyStopped,
|
|
14423
|
+
audioRecordingUnintentionallyStopped = _21.audioRecordingUnintentionallyStopped,
|
|
14424
|
+
videoUrl = _21.videoUrl,
|
|
14425
|
+
audioUrl = _21.audioUrl;
|
|
14507
14426
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
14508
|
-
var
|
|
14509
|
-
countdownRemaining =
|
|
14510
|
-
setCountdownRemaining =
|
|
14427
|
+
var _22 = React.useState(-1),
|
|
14428
|
+
countdownRemaining = _22[0],
|
|
14429
|
+
setCountdownRemaining = _22[1];
|
|
14511
14430
|
React.useEffect(function () {
|
|
14512
14431
|
if (!isRecordingVideo && !videoUrl) {
|
|
14513
14432
|
startRecordingVideo();
|
|
@@ -14527,41 +14446,30 @@
|
|
|
14527
14446
|
onRecordingFailed === null || onRecordingFailed === void 0 ? void 0 : onRecordingFailed();
|
|
14528
14447
|
}
|
|
14529
14448
|
}, [audioRecordingUnintentionallyStopped, onRecordingFailed, videoRecordingUnintentionallyStopped]);
|
|
14530
|
-
var
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
var _28 = React.useState('SHOW_ID_FRONT'),
|
|
14535
|
-
requestedAction = _28[0],
|
|
14536
|
-
setRequestedAction = _28[1];
|
|
14449
|
+
var _23 = React.useState('SHOW_ID_FRONT'),
|
|
14450
|
+
requestedAction = _23[0],
|
|
14451
|
+
setRequestedAction = _23[1];
|
|
14452
|
+
var shouldRunIdModels = idCaptureModelsEnabled && videoLoaded && cameraReady && idModelsReady && !idModelError && requestedAction !== 'READ_TEXT' && (!readTextPrompt || microphoneReady);
|
|
14537
14453
|
React.useEffect(function startModelsWhenCapturing() {
|
|
14538
|
-
if (!
|
|
14454
|
+
if (!shouldRunIdModels) return;
|
|
14539
14455
|
startIdModels();
|
|
14540
14456
|
return function () {
|
|
14541
14457
|
stopIdModels();
|
|
14542
14458
|
};
|
|
14543
|
-
}, [
|
|
14459
|
+
}, [shouldRunIdModels, startIdModels, stopIdModels]);
|
|
14544
14460
|
React.useEffect(function () {
|
|
14545
|
-
setThresholds(
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
|
|
14557
|
-
setCurrentDetectionScore = _29[1];
|
|
14558
|
-
var _30 = React.useState(0),
|
|
14559
|
-
currentFocusScore = _30[0],
|
|
14560
|
-
setCurrentFocusScore = _30[1];
|
|
14561
|
-
var _31 = React.useState(0),
|
|
14562
|
-
goodFramesCount = _31[0],
|
|
14563
|
-
setGoodFramesCount = _31[1];
|
|
14564
|
-
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? goodIdCardFrontFramesThreshold : goodIdCardBackFramesThreshold;
|
|
14461
|
+
setThresholds(videoIdCaptureThresholds);
|
|
14462
|
+
}, [requestedAction, setThresholds, videoIdCaptureThresholds]);
|
|
14463
|
+
var _24 = React.useState(0),
|
|
14464
|
+
currentDetectionScore = _24[0],
|
|
14465
|
+
setCurrentDetectionScore = _24[1];
|
|
14466
|
+
var _25 = React.useState(0),
|
|
14467
|
+
currentFocusScore = _25[0],
|
|
14468
|
+
setCurrentFocusScore = _25[1];
|
|
14469
|
+
var _26 = React.useState(0),
|
|
14470
|
+
goodFramesCount = _26[0],
|
|
14471
|
+
setGoodFramesCount = _26[1];
|
|
14472
|
+
var goodFramesThreshold = requestedAction === 'SHOW_ID_FRONT' ? videoIdCaptureThresholds.goodFrames.idCardFront : videoIdCaptureThresholds.goodFrames.idCardBack;
|
|
14565
14473
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
14566
14474
|
React.useEffect(function () {
|
|
14567
14475
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
@@ -14569,18 +14477,19 @@
|
|
|
14569
14477
|
setDetectedObjects(prediction.detectedObjects);
|
|
14570
14478
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
14571
14479
|
setCurrentFocusScore(prediction.focusScore);
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
} else {
|
|
14577
|
-
setGoodFramesCount(0);
|
|
14480
|
+
var detectionThresholdMet = requestedAction === 'SHOW_ID_FRONT' ? prediction.idCardFrontDetectionThresholdMet : prediction.idCardBackDetectionThresholdMet;
|
|
14481
|
+
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
14482
|
+
if (requestedAction === 'FLIP_ID' && isGoodFrame) {
|
|
14483
|
+
return setRequestedAction('SHOW_ID_BACK');
|
|
14578
14484
|
}
|
|
14485
|
+
setGoodFramesCount(isGoodFrame ? function (n) {
|
|
14486
|
+
return n + 1;
|
|
14487
|
+
} : 0);
|
|
14579
14488
|
});
|
|
14580
|
-
}, [idCaptureModelsEnabled,
|
|
14581
|
-
var
|
|
14582
|
-
idFrontCaptureStartedAt =
|
|
14583
|
-
setFirstGoodFrameTime =
|
|
14489
|
+
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction]);
|
|
14490
|
+
var _27 = React.useState(null),
|
|
14491
|
+
idFrontCaptureStartedAt = _27[0],
|
|
14492
|
+
setFirstGoodFrameTime = _27[1];
|
|
14584
14493
|
React.useEffect(function () {
|
|
14585
14494
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
14586
14495
|
}, [goodFramesCount]);
|
|
@@ -14601,73 +14510,56 @@
|
|
|
14601
14510
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
14602
14511
|
var faceBox = (_f = faces === null || faces === void 0 ? void 0 : faces[0]) === null || _f === void 0 ? void 0 : _f.box;
|
|
14603
14512
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
14604
|
-
var
|
|
14605
|
-
countdownStartedAt =
|
|
14606
|
-
setCountdownStartedAt =
|
|
14513
|
+
var _28 = React.useState(),
|
|
14514
|
+
countdownStartedAt = _28[0],
|
|
14515
|
+
setCountdownStartedAt = _28[1];
|
|
14516
|
+
var photoCanvas = React.useRef(null);
|
|
14607
14517
|
var frameLock = React.useRef(false);
|
|
14608
14518
|
var captureFrame = React.useCallback(function () {
|
|
14609
14519
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
14610
|
-
var
|
|
14611
|
-
return __generator(this, function (
|
|
14612
|
-
switch (
|
|
14520
|
+
var frameBase64;
|
|
14521
|
+
return __generator(this, function (_a) {
|
|
14522
|
+
switch (_a.label) {
|
|
14613
14523
|
case 0:
|
|
14614
14524
|
if (frameLock.current) return [2 /*return*/];
|
|
14615
14525
|
frameLock.current = true;
|
|
14616
|
-
|
|
14617
|
-
|
|
14618
|
-
|
|
14619
|
-
if (!frame) {
|
|
14526
|
+
drawToCanvas(photoCanvas.current, videoRef.current);
|
|
14527
|
+
frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
|
|
14528
|
+
if (!frameBase64) {
|
|
14620
14529
|
frameLock.current = false;
|
|
14621
14530
|
return [2 /*return*/];
|
|
14622
14531
|
}
|
|
14623
|
-
|
|
14624
|
-
case
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
if (!_a) return [3 /*break*/, 4];
|
|
14628
|
-
return [4 /*yield*/, new Promise(function (resolve) {
|
|
14629
|
-
var reader = new FileReader();
|
|
14630
|
-
reader.onloadend = function () {
|
|
14631
|
-
return resolve(reader.result);
|
|
14632
|
-
};
|
|
14633
|
-
reader.readAsDataURL(frame);
|
|
14634
|
-
})];
|
|
14635
|
-
case 3:
|
|
14636
|
-
_a = _b.sent();
|
|
14637
|
-
_b.label = 4;
|
|
14638
|
-
case 4:
|
|
14639
|
-
frameBase64 = _a;
|
|
14640
|
-
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 8];
|
|
14532
|
+
_a.label = 1;
|
|
14533
|
+
case 1:
|
|
14534
|
+
_a.trys.push([1,, 7, 8]);
|
|
14535
|
+
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
|
|
14641
14536
|
if (onIdFrontImageCaptured) {
|
|
14642
|
-
|
|
14537
|
+
onIdFrontImageCaptured(frameBase64);
|
|
14643
14538
|
}
|
|
14644
|
-
if (!skipShowIdCardBack) return [3 /*break*/,
|
|
14645
|
-
if (!(skipShowIdCardBack === true)) return [3 /*break*/,
|
|
14539
|
+
if (!skipShowIdCardBack) return [3 /*break*/, 4];
|
|
14540
|
+
if (!(skipShowIdCardBack === true)) return [3 /*break*/, 2];
|
|
14646
14541
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
14647
|
-
case
|
|
14542
|
+
case 2:
|
|
14648
14543
|
return [4 /*yield*/, skipShowIdCardBack()];
|
|
14649
|
-
case
|
|
14650
|
-
if (
|
|
14544
|
+
case 3:
|
|
14545
|
+
if (_a.sent()) {
|
|
14651
14546
|
return [2 /*return*/, onIdBackCaptureComplete()];
|
|
14652
14547
|
}
|
|
14653
|
-
|
|
14654
|
-
case
|
|
14548
|
+
_a.label = 4;
|
|
14549
|
+
case 4:
|
|
14655
14550
|
setRequestedAction('FLIP_ID');
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
}, 6000);
|
|
14659
|
-
return [3 /*break*/, 9];
|
|
14660
|
-
case 8:
|
|
14551
|
+
return [3 /*break*/, 6];
|
|
14552
|
+
case 5:
|
|
14661
14553
|
if (requestedAction == 'SHOW_ID_BACK') {
|
|
14662
14554
|
if (onIdBackImageCaptured) {
|
|
14663
|
-
|
|
14555
|
+
onIdBackImageCaptured(frameBase64);
|
|
14664
14556
|
}
|
|
14665
14557
|
onIdBackCaptureComplete();
|
|
14666
14558
|
}
|
|
14667
|
-
|
|
14668
|
-
case
|
|
14669
|
-
return [3 /*break*/,
|
|
14670
|
-
case
|
|
14559
|
+
_a.label = 6;
|
|
14560
|
+
case 6:
|
|
14561
|
+
return [3 /*break*/, 8];
|
|
14562
|
+
case 7:
|
|
14671
14563
|
setDetectedObjects([]);
|
|
14672
14564
|
setCurrentDetectionScore(0);
|
|
14673
14565
|
setCurrentFocusScore(0);
|
|
@@ -14679,17 +14571,27 @@
|
|
|
14679
14571
|
clearTimeout(countdownTimeoutRef.current);
|
|
14680
14572
|
}
|
|
14681
14573
|
return [7 /*endfinally*/];
|
|
14682
|
-
case
|
|
14574
|
+
case 8:
|
|
14683
14575
|
return [2 /*return*/];
|
|
14684
14576
|
}
|
|
14685
14577
|
});
|
|
14686
14578
|
});
|
|
14687
|
-
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack,
|
|
14579
|
+
}, [onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack, videoRef]);
|
|
14580
|
+
var isFlipping = requestedAction === 'FLIP_ID';
|
|
14581
|
+
React.useEffect(function () {
|
|
14582
|
+
if (!isFlipping) return;
|
|
14583
|
+
var t = setTimeout(function () {
|
|
14584
|
+
setRequestedAction('SHOW_ID_BACK');
|
|
14585
|
+
}, 6000);
|
|
14586
|
+
return function () {
|
|
14587
|
+
clearTimeout(t);
|
|
14588
|
+
};
|
|
14589
|
+
}, [isFlipping]);
|
|
14688
14590
|
var stopRecording = React.useCallback(function () {
|
|
14689
14591
|
stopRecordingVideo();
|
|
14690
14592
|
stopRecordingAudio();
|
|
14691
14593
|
}, [stopRecordingAudio, stopRecordingVideo]);
|
|
14692
|
-
var satisfied = goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
14594
|
+
var satisfied = !isFlipping && goodFramesThresholdMet && faceCentered && delaySatisfied;
|
|
14693
14595
|
React.useEffect(function () {
|
|
14694
14596
|
if (satisfied && !countdownStartedAt) {
|
|
14695
14597
|
setCountdownStartedAt(new Date());
|
|
@@ -14709,10 +14611,7 @@
|
|
|
14709
14611
|
}, 1000);
|
|
14710
14612
|
return;
|
|
14711
14613
|
}
|
|
14712
|
-
|
|
14713
|
-
captureFrame();
|
|
14714
|
-
}
|
|
14715
|
-
}, [captureFrame, countdownStartedAt, countdownTimeoutRef]);
|
|
14614
|
+
}, [countdownTimeoutRef]);
|
|
14716
14615
|
React.useEffect(function () {
|
|
14717
14616
|
if (!countdownStartedAt) return;
|
|
14718
14617
|
setCountdownRemaining(captureCountdownSeconds);
|
|
@@ -14722,11 +14621,17 @@
|
|
|
14722
14621
|
return function () {
|
|
14723
14622
|
clearTimeout(countdownTimeoutRef.current);
|
|
14724
14623
|
};
|
|
14725
|
-
}, [captureCountdownSeconds,
|
|
14624
|
+
}, [captureCountdownSeconds, countdownStartedAt, manualCountdown]);
|
|
14625
|
+
React.useEffect(function () {
|
|
14626
|
+
if (countdownRemaining === 0) {
|
|
14627
|
+
setCountdownRemaining(-1);
|
|
14628
|
+
captureFrame().then();
|
|
14629
|
+
}
|
|
14630
|
+
}, [captureFrame, countdownRemaining]);
|
|
14726
14631
|
var timeoutStartedAt = useTimeout(readTextTimeoutDurationMs, stopRecording, requestedAction !== 'READ_TEXT', false, requestedAction === 'READ_TEXT').timeoutStartedAt;
|
|
14727
|
-
var
|
|
14728
|
-
numFramesWithoutFaces =
|
|
14729
|
-
setNumFramesWithoutFaces =
|
|
14632
|
+
var _29 = React.useState(0),
|
|
14633
|
+
numFramesWithoutFaces = _29[0],
|
|
14634
|
+
setNumFramesWithoutFaces = _29[1];
|
|
14730
14635
|
React.useEffect(function () {
|
|
14731
14636
|
if (!selfieModelError) {
|
|
14732
14637
|
onSelfiePredictionMade(function (faces) {
|
|
@@ -14744,14 +14649,14 @@
|
|
|
14744
14649
|
}
|
|
14745
14650
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
14746
14651
|
var theme = styled.useTheme();
|
|
14747
|
-
var
|
|
14652
|
+
var _30 = useTranslations(rawVerbiage, {
|
|
14748
14653
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
14749
14654
|
searchingForIdCardText: 'Searching for ID card...',
|
|
14750
14655
|
captureBtnText: 'Capture'
|
|
14751
14656
|
}),
|
|
14752
|
-
captureBtnText =
|
|
14753
|
-
faceNotCenteredText =
|
|
14754
|
-
searchingForIdCardText =
|
|
14657
|
+
captureBtnText = _30.captureBtnText,
|
|
14658
|
+
faceNotCenteredText = _30.faceNotCenteredText,
|
|
14659
|
+
searchingForIdCardText = _30.searchingForIdCardText;
|
|
14755
14660
|
var debugScalingDetails = useDebugScalingDetails({
|
|
14756
14661
|
enabled: debugMode,
|
|
14757
14662
|
pageWidth: width,
|
|
@@ -14765,7 +14670,9 @@
|
|
|
14765
14670
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
14766
14671
|
ref: ref,
|
|
14767
14672
|
className: "flex ".concat((_l = classNames.container) !== null && _l !== void 0 ? _l : '')
|
|
14768
|
-
},
|
|
14673
|
+
}, /*#__PURE__*/React__default['default'].createElement(InvisibleCanvas, {
|
|
14674
|
+
ref: photoCanvas
|
|
14675
|
+
}), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__default['default'].createElement(ReadTextPrompt, {
|
|
14769
14676
|
text: readTextPrompt,
|
|
14770
14677
|
startedAt: timeoutStartedAt || undefined,
|
|
14771
14678
|
durationMs: readTextTimeoutDurationMs,
|
|
@@ -14804,7 +14711,7 @@
|
|
|
14804
14711
|
className: classNames.guidanceMessage,
|
|
14805
14712
|
"$background": (_q = (_p = (_o = theme.guidanceMessages) === null || _o === void 0 ? void 0 : _o.negative) === null || _p === void 0 ? void 0 : _p.backgroundColor) !== null && _q !== void 0 ? _q : 'red',
|
|
14806
14713
|
"$textColor": (_t = (_s = (_r = theme.guidanceMessages) === null || _r === void 0 ? void 0 : _r.negative) === null || _s === void 0 ? void 0 : _s.textColor) !== null && _t !== void 0 ? _t : 'white'
|
|
14807
|
-
}, guidanceText))), 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), isRecordingVideo ? '✅ 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: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)),
|
|
14714
|
+
}, guidanceText))), 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), isRecordingVideo ? '✅ 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: ", (_u = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.detectionScore) !== null && _u !== void 0 ? _u : 0, /*#__PURE__*/React__default['default'].createElement("br", null), "Best Frame Focus Score: ", (_v = bestFrameDetails === null || bestFrameDetails === void 0 ? void 0 : bestFrameDetails.focusScore) !== null && _v !== void 0 ? _v : 0)), countdownRemaining > 0 && capturingId && ( /*#__PURE__*/React__default['default'].createElement(CountdownContainer, {
|
|
14808
14715
|
className: classNames.countdownContainer
|
|
14809
14716
|
}, /*#__PURE__*/React__default['default'].createElement(Countdown, {
|
|
14810
14717
|
className: classNames.countdown
|
|
@@ -14959,64 +14866,60 @@
|
|
|
14959
14866
|
faceLivenessProps = _h === void 0 ? {} : _h,
|
|
14960
14867
|
_j = _a.idCaptureModelsEnabled,
|
|
14961
14868
|
idCaptureModelsEnabled = _j === void 0 ? true : _j,
|
|
14962
|
-
|
|
14963
|
-
|
|
14964
|
-
idCardFrontFocusThreshold = _a.idCardFrontFocusThreshold,
|
|
14965
|
-
idCardBackFocusThreshold = _a.idCardBackFocusThreshold,
|
|
14966
|
-
goodIdCardFrontFramesThreshold = _a.goodIdCardFrontFramesThreshold,
|
|
14967
|
-
goodIdCardBackFramesThreshold = _a.goodIdCardBackFramesThreshold,
|
|
14869
|
+
_k = _a.videoIdCaptureThresholds,
|
|
14870
|
+
videoIdCaptureThresholds = _k === void 0 ? defaultVideoIdCaptureThresholds : _k,
|
|
14968
14871
|
readTextPrompt = _a.readTextPrompt,
|
|
14969
14872
|
readTextTimeoutDurationMs = _a.readTextTimeoutDurationMs,
|
|
14970
14873
|
readTextMinReadingMs = _a.readTextMinReadingMs,
|
|
14971
|
-
|
|
14972
|
-
skipIdCapture =
|
|
14973
|
-
|
|
14974
|
-
skipShowIdCardBack =
|
|
14975
|
-
|
|
14976
|
-
skipSuccessScreen =
|
|
14977
|
-
|
|
14978
|
-
idCaptureLoadingOverlayMode =
|
|
14979
|
-
|
|
14980
|
-
idCaptureGuideType =
|
|
14981
|
-
|
|
14982
|
-
idCapturePortraitGuidesOnMobile =
|
|
14983
|
-
|
|
14984
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
14985
|
-
|
|
14986
|
-
idCaptureModelLoadTimeoutMs =
|
|
14987
|
-
|
|
14988
|
-
faceLivenessLoadingOverlayMode =
|
|
14989
|
-
|
|
14990
|
-
disableFaceDetectionWhileAudioCapture =
|
|
14991
|
-
|
|
14992
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
14993
|
-
|
|
14994
|
-
silentFallback =
|
|
14995
|
-
|
|
14996
|
-
mergeAVStreams =
|
|
14997
|
-
|
|
14998
|
-
assets =
|
|
14999
|
-
|
|
15000
|
-
classNames =
|
|
15001
|
-
|
|
15002
|
-
colors =
|
|
15003
|
-
|
|
15004
|
-
verbiage =
|
|
15005
|
-
|
|
15006
|
-
debugMode =
|
|
15007
|
-
var
|
|
15008
|
-
submissionStatus =
|
|
15009
|
-
idCaptureVideoUrl =
|
|
15010
|
-
idCaptureVideoAudioUrl =
|
|
15011
|
-
idCaptureVideoIdFrontImage =
|
|
15012
|
-
idCaptureVideoIdBackImage =
|
|
15013
|
-
setIdCaptureVideoUrl =
|
|
15014
|
-
setIdCaptureVideoIdFrontImage =
|
|
15015
|
-
setIdCaptureVideoIdBackImage =
|
|
15016
|
-
setIdCaptureVideoAudioUrl =
|
|
15017
|
-
var
|
|
15018
|
-
captureState =
|
|
15019
|
-
setCaptureState =
|
|
14874
|
+
_l = _a.skipIdCapture,
|
|
14875
|
+
skipIdCapture = _l === void 0 ? false : _l,
|
|
14876
|
+
_m = _a.skipShowIdCardBack,
|
|
14877
|
+
skipShowIdCardBack = _m === void 0 ? false : _m,
|
|
14878
|
+
_o = _a.skipSuccessScreen,
|
|
14879
|
+
skipSuccessScreen = _o === void 0 ? false : _o,
|
|
14880
|
+
_p = _a.idCaptureLoadingOverlayMode,
|
|
14881
|
+
idCaptureLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
14882
|
+
_q = _a.idCaptureGuideType,
|
|
14883
|
+
idCaptureGuideType = _q === void 0 ? 'fit' : _q,
|
|
14884
|
+
_r = _a.idCapturePortraitGuidesOnMobile,
|
|
14885
|
+
idCapturePortraitGuidesOnMobile = _r === void 0 ? false : _r,
|
|
14886
|
+
_s = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
14887
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
|
|
14888
|
+
_t = _a.idCaptureModelLoadTimeoutMs,
|
|
14889
|
+
idCaptureModelLoadTimeoutMs = _t === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _t,
|
|
14890
|
+
_u = _a.faceLivenessLoadingOverlayMode,
|
|
14891
|
+
faceLivenessLoadingOverlayMode = _u === void 0 ? 'default' : _u,
|
|
14892
|
+
_v = _a.disableFaceDetectionWhileAudioCapture,
|
|
14893
|
+
disableFaceDetectionWhileAudioCapture = _v === void 0 ? true : _v,
|
|
14894
|
+
_w = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
14895
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _w === void 0 ? 2000 : _w,
|
|
14896
|
+
_x = _a.silentFallback,
|
|
14897
|
+
silentFallback = _x === void 0 ? false : _x,
|
|
14898
|
+
_y = _a.mergeAVStreams,
|
|
14899
|
+
mergeAVStreams = _y === void 0 ? false : _y,
|
|
14900
|
+
_z = _a.assets,
|
|
14901
|
+
assets = _z === void 0 ? {} : _z,
|
|
14902
|
+
_0 = _a.classNames,
|
|
14903
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
14904
|
+
_1 = _a.colors,
|
|
14905
|
+
colors = _1 === void 0 ? {} : _1,
|
|
14906
|
+
_2 = _a.verbiage,
|
|
14907
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
14908
|
+
_3 = _a.debugMode,
|
|
14909
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
14910
|
+
var _4 = React.useContext(SubmissionContext),
|
|
14911
|
+
submissionStatus = _4.submissionStatus,
|
|
14912
|
+
idCaptureVideoUrl = _4.idCaptureVideoUrl,
|
|
14913
|
+
idCaptureVideoAudioUrl = _4.idCaptureVideoAudioUrl,
|
|
14914
|
+
idCaptureVideoIdFrontImage = _4.idCaptureVideoIdFrontImage,
|
|
14915
|
+
idCaptureVideoIdBackImage = _4.idCaptureVideoIdBackImage,
|
|
14916
|
+
setIdCaptureVideoUrl = _4.setIdCaptureVideoUrl,
|
|
14917
|
+
setIdCaptureVideoIdFrontImage = _4.setIdCaptureVideoIdFrontImage,
|
|
14918
|
+
setIdCaptureVideoIdBackImage = _4.setIdCaptureVideoIdBackImage,
|
|
14919
|
+
setIdCaptureVideoAudioUrl = _4.setIdCaptureVideoAudioUrl;
|
|
14920
|
+
var _5 = React.useState('CAPTURING_ID'),
|
|
14921
|
+
captureState = _5[0],
|
|
14922
|
+
setCaptureState = _5[1];
|
|
15020
14923
|
React.useEffect(function () {
|
|
15021
14924
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
15022
14925
|
}, [captureState, skipIdCapture]);
|
|
@@ -15047,9 +14950,9 @@
|
|
|
15047
14950
|
var onVideoCaptureFaceNotDetected = React.useCallback(function () {
|
|
15048
14951
|
setCaptureState('CHECKING_LIVENESS');
|
|
15049
14952
|
}, []);
|
|
15050
|
-
var
|
|
15051
|
-
attempt =
|
|
15052
|
-
setAttempt =
|
|
14953
|
+
var _6 = React.useState(0),
|
|
14954
|
+
attempt = _6[0],
|
|
14955
|
+
setAttempt = _6[1];
|
|
15053
14956
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
15054
14957
|
var onFaceCaptureExitAfterFailure = React.useCallback(function (resp, req) {
|
|
15055
14958
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|
|
@@ -15153,12 +15056,7 @@
|
|
|
15153
15056
|
onFaceNotDetected: onVideoCaptureFaceNotDetected,
|
|
15154
15057
|
onRecordingFailed: onRecordingFailed,
|
|
15155
15058
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
15156
|
-
|
|
15157
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
15158
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
15159
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
15160
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
15161
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
15059
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
15162
15060
|
skipShowIdCardBack: skipShowIdCardBack,
|
|
15163
15061
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
15164
15062
|
disableFaceDetectionWhileAudioCaptureMsDelay: disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
@@ -15619,9 +15517,8 @@
|
|
|
15619
15517
|
* Render a fullscreen ID capture component that instructs the user to photograph both sides of their ID card, or full page of their passport.
|
|
15620
15518
|
*/
|
|
15621
15519
|
var IdValidation = function IdValidation(_a) {
|
|
15622
|
-
var _b,
|
|
15623
|
-
|
|
15624
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
15520
|
+
var _b = _a.lang,
|
|
15521
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
15625
15522
|
sessionId = _a.sessionId,
|
|
15626
15523
|
clientRequestID = _a.clientRequestID,
|
|
15627
15524
|
submissionUrl = _a.submissionUrl,
|
|
@@ -15644,35 +15541,25 @@
|
|
|
15644
15541
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
15645
15542
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
15646
15543
|
precapturedDocuments = _a.precapturedDocuments,
|
|
15647
|
-
|
|
15648
|
-
loadingOverlayMode =
|
|
15649
|
-
|
|
15650
|
-
idCaptureRequirement =
|
|
15651
|
-
|
|
15652
|
-
separateIdCardCaptureSequence =
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
_k = _a.passportAutoCaptureScoreThreshold,
|
|
15658
|
-
passportAutoCaptureScoreThreshold = _k === void 0 ? defaultDocumentDetectionThresholds.passport : _k,
|
|
15659
|
-
_l = _a.mrzDetectionScoreThreshold,
|
|
15660
|
-
mrzDetectionScoreThreshold = _l === void 0 ? defaultDocumentDetectionThresholds.mrz : _l,
|
|
15661
|
-
_m = _a.idCardFocusScoreThreshold,
|
|
15662
|
-
idCardFocusScoreThreshold = _m === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _m,
|
|
15663
|
-
_o = _a.passportFocusScoreThreshold,
|
|
15664
|
-
passportFocusScoreThreshold = _o === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _o,
|
|
15665
|
-
_p = _a.skipSuccessScreen,
|
|
15666
|
-
skipSuccessScreen = _p === void 0 ? false : _p,
|
|
15544
|
+
_c = _a.loadingOverlayMode,
|
|
15545
|
+
loadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
15546
|
+
_d = _a.idCaptureRequirement,
|
|
15547
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
15548
|
+
_e = _a.separateIdCardCaptureSequence,
|
|
15549
|
+
separateIdCardCaptureSequence = _e === void 0 ? false : _e,
|
|
15550
|
+
_f = _a.idCaptureThresholds,
|
|
15551
|
+
idCaptureThresholds = _f === void 0 ? defaultIdCaptureThresholds : _f,
|
|
15552
|
+
_g = _a.skipSuccessScreen,
|
|
15553
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
15667
15554
|
instructions = _a.instructions,
|
|
15668
|
-
|
|
15669
|
-
guideType =
|
|
15670
|
-
|
|
15671
|
-
portraitGuidesOnMobile =
|
|
15672
|
-
|
|
15673
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
15674
|
-
|
|
15675
|
-
modelLoadTimeoutMs =
|
|
15555
|
+
_h = _a.guideType,
|
|
15556
|
+
guideType = _h === void 0 ? 'fit' : _h,
|
|
15557
|
+
_j = _a.portraitGuidesOnMobile,
|
|
15558
|
+
portraitGuidesOnMobile = _j === void 0 ? false : _j,
|
|
15559
|
+
_k = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
15560
|
+
rotateLoadingOverlayImageWhenPortrait = _k === void 0 ? true : _k,
|
|
15561
|
+
_l = _a.modelLoadTimeoutMs,
|
|
15562
|
+
modelLoadTimeoutMs = _l === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _l,
|
|
15676
15563
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
15677
15564
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
15678
15565
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -15686,28 +15573,28 @@
|
|
|
15686
15573
|
onUserCancel = _a.onUserCancel,
|
|
15687
15574
|
onModelError = _a.onModelError,
|
|
15688
15575
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
15689
|
-
|
|
15690
|
-
theme =
|
|
15691
|
-
|
|
15692
|
-
assets =
|
|
15693
|
-
|
|
15694
|
-
classNames =
|
|
15695
|
-
|
|
15696
|
-
colors =
|
|
15697
|
-
|
|
15698
|
-
verbiage =
|
|
15699
|
-
|
|
15700
|
-
captureSignature =
|
|
15701
|
-
|
|
15702
|
-
captureSignatureVideo =
|
|
15703
|
-
|
|
15704
|
-
captureAdditionalDocuments =
|
|
15705
|
-
|
|
15706
|
-
geolocationEnabled =
|
|
15707
|
-
|
|
15708
|
-
geolocationRequired =
|
|
15709
|
-
|
|
15710
|
-
debugMode =
|
|
15576
|
+
_m = _a.theme,
|
|
15577
|
+
theme = _m === void 0 ? 'default' : _m,
|
|
15578
|
+
_o = _a.assets,
|
|
15579
|
+
assets = _o === void 0 ? {} : _o,
|
|
15580
|
+
_p = _a.classNames,
|
|
15581
|
+
classNames = _p === void 0 ? {} : _p,
|
|
15582
|
+
_q = _a.colors,
|
|
15583
|
+
colors = _q === void 0 ? {} : _q,
|
|
15584
|
+
_r = _a.verbiage,
|
|
15585
|
+
verbiage = _r === void 0 ? {} : _r,
|
|
15586
|
+
_s = _a.captureSignature,
|
|
15587
|
+
captureSignature = _s === void 0 ? false : _s,
|
|
15588
|
+
_t = _a.captureSignatureVideo,
|
|
15589
|
+
captureSignatureVideo = _t === void 0 ? false : _t,
|
|
15590
|
+
_u = _a.captureAdditionalDocuments,
|
|
15591
|
+
captureAdditionalDocuments = _u === void 0 ? [] : _u,
|
|
15592
|
+
_v = _a.geolocationEnabled,
|
|
15593
|
+
geolocationEnabled = _v === void 0 ? true : _v,
|
|
15594
|
+
_w = _a.geolocationRequired,
|
|
15595
|
+
geolocationRequired = _w === void 0 ? false : _w,
|
|
15596
|
+
_x = _a.debugMode,
|
|
15597
|
+
debugMode = _x === void 0 ? false : _x;
|
|
15711
15598
|
useLanguage(lang);
|
|
15712
15599
|
useDebugLogging(debugMode);
|
|
15713
15600
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -15718,13 +15605,7 @@
|
|
|
15718
15605
|
precapturedDocuments: precapturedDocuments,
|
|
15719
15606
|
captureRequirement: idCaptureRequirement,
|
|
15720
15607
|
separateIdCardCaptureSequence: separateIdCardCaptureSequence,
|
|
15721
|
-
|
|
15722
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
15723
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
15724
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
15725
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
15726
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
15727
|
-
barcodeScanningEnabled: false,
|
|
15608
|
+
thresholds: idCaptureThresholds,
|
|
15728
15609
|
skipSuccessScreen: skipSuccessScreen,
|
|
15729
15610
|
loadingOverlayMode: loadingOverlayMode,
|
|
15730
15611
|
instructions: instructions,
|
|
@@ -15738,7 +15619,7 @@
|
|
|
15738
15619
|
verbiage: verbiage,
|
|
15739
15620
|
debugMode: debugMode
|
|
15740
15621
|
};
|
|
15741
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence,
|
|
15622
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, instructions, guideType, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, assets, classNames, colors, verbiage, debugMode]);
|
|
15742
15623
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
15743
15624
|
return {
|
|
15744
15625
|
documents: captureAdditionalDocuments,
|
|
@@ -15932,9 +15813,8 @@
|
|
|
15932
15813
|
* Render a fullscreen capture component that performs `IDValidation` and `FaceValidation` sequentially.
|
|
15933
15814
|
* */
|
|
15934
15815
|
var IdAndFaceValidation = function IdAndFaceValidation(_a) {
|
|
15935
|
-
var _b,
|
|
15936
|
-
|
|
15937
|
-
lang = _d === void 0 ? 'auto' : _d,
|
|
15816
|
+
var _b = _a.lang,
|
|
15817
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
15938
15818
|
sessionId = _a.sessionId,
|
|
15939
15819
|
authUrl = _a.authUrl,
|
|
15940
15820
|
submissionUrl = _a.submissionUrl,
|
|
@@ -15956,39 +15836,29 @@
|
|
|
15956
15836
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
15957
15837
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
15958
15838
|
precapturedDocuments = _a.precapturedDocuments,
|
|
15959
|
-
|
|
15960
|
-
idCaptureLoadingOverlayMode =
|
|
15961
|
-
|
|
15962
|
-
idCaptureRequirement =
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
15972
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
15973
|
-
_m = _a.passportFocusScoreThreshold,
|
|
15974
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
15975
|
-
_o = _a.faceLivenessLoadingOverlayMode,
|
|
15976
|
-
faceLivenessLoadingOverlayMode = _o === void 0 ? 'default' : _o,
|
|
15977
|
-
_p = _a.faceLivenessTimeoutDurationMs,
|
|
15978
|
-
faceLivenessTimeoutDurationMs = _p === void 0 ? 15000 : _p,
|
|
15979
|
-
_q = _a.skipSuccessScreen,
|
|
15980
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
15839
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
15840
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
15841
|
+
_d = _a.idCaptureRequirement,
|
|
15842
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
15843
|
+
_e = _a.idCaptureThresholds,
|
|
15844
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
15845
|
+
_f = _a.faceLivenessLoadingOverlayMode,
|
|
15846
|
+
faceLivenessLoadingOverlayMode = _f === void 0 ? 'default' : _f,
|
|
15847
|
+
_g = _a.faceLivenessTimeoutDurationMs,
|
|
15848
|
+
faceLivenessTimeoutDurationMs = _g === void 0 ? 15000 : _g,
|
|
15849
|
+
_h = _a.skipSuccessScreen,
|
|
15850
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
15981
15851
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
15982
|
-
|
|
15983
|
-
idCaptureGuideType =
|
|
15984
|
-
|
|
15985
|
-
idCapturePortraitGuidesOnMobile =
|
|
15986
|
-
|
|
15987
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
15988
|
-
|
|
15989
|
-
idCaptureModelLoadTimeoutMs =
|
|
15990
|
-
|
|
15991
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
15852
|
+
_j = _a.idCaptureGuideType,
|
|
15853
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
15854
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
15855
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
15856
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
15857
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
15858
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
15859
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
15860
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
15861
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
15992
15862
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
15993
15863
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
15994
15864
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -16005,28 +15875,28 @@
|
|
|
16005
15875
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
16006
15876
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
16007
15877
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
16008
|
-
|
|
16009
|
-
captureSignature =
|
|
16010
|
-
|
|
16011
|
-
captureSignatureVideo =
|
|
16012
|
-
|
|
16013
|
-
captureAdditionalDocuments =
|
|
16014
|
-
|
|
16015
|
-
theme =
|
|
16016
|
-
|
|
16017
|
-
assets =
|
|
16018
|
-
|
|
16019
|
-
classNames =
|
|
16020
|
-
|
|
16021
|
-
colors =
|
|
16022
|
-
|
|
16023
|
-
verbiage =
|
|
16024
|
-
|
|
16025
|
-
geolocationEnabled =
|
|
16026
|
-
|
|
16027
|
-
geolocationRequired =
|
|
16028
|
-
|
|
16029
|
-
debugMode =
|
|
15878
|
+
_p = _a.captureSignature,
|
|
15879
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
15880
|
+
_q = _a.captureSignatureVideo,
|
|
15881
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
15882
|
+
_r = _a.captureAdditionalDocuments,
|
|
15883
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
15884
|
+
_s = _a.theme,
|
|
15885
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
15886
|
+
_t = _a.assets,
|
|
15887
|
+
assets = _t === void 0 ? {} : _t,
|
|
15888
|
+
_u = _a.classNames,
|
|
15889
|
+
classNames = _u === void 0 ? {} : _u,
|
|
15890
|
+
_v = _a.colors,
|
|
15891
|
+
colors = _v === void 0 ? {} : _v,
|
|
15892
|
+
_w = _a.verbiage,
|
|
15893
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
15894
|
+
_x = _a.geolocationEnabled,
|
|
15895
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
15896
|
+
_y = _a.geolocationRequired,
|
|
15897
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
15898
|
+
_z = _a.debugMode,
|
|
15899
|
+
debugMode = _z === void 0 ? false : _z;
|
|
16030
15900
|
useLanguage(lang);
|
|
16031
15901
|
useDebugLogging(debugMode);
|
|
16032
15902
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -16040,12 +15910,7 @@
|
|
|
16040
15910
|
verbiage: verbiage.idCapture,
|
|
16041
15911
|
precapturedDocuments: precapturedDocuments,
|
|
16042
15912
|
captureRequirement: idCaptureRequirement,
|
|
16043
|
-
|
|
16044
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
16045
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
16046
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
16047
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
16048
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
15913
|
+
thresholds: idCaptureThresholds,
|
|
16049
15914
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
16050
15915
|
instructions: idCaptureInstructions,
|
|
16051
15916
|
guideType: idCaptureGuideType,
|
|
@@ -16055,7 +15920,7 @@
|
|
|
16055
15920
|
skipSuccessScreen: skipSuccessScreen,
|
|
16056
15921
|
debugMode: debugMode
|
|
16057
15922
|
};
|
|
16058
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
15923
|
+
}, [onExitCapture, onUserCancel, onIdCaptureModelError, assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, precapturedDocuments, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, skipSuccessScreen, debugMode]);
|
|
16059
15924
|
var faceLivenessProps = React.useMemo(function () {
|
|
16060
15925
|
return {
|
|
16061
15926
|
loadingOverlayMode: faceLivenessLoadingOverlayMode,
|
|
@@ -16163,10 +16028,9 @@
|
|
|
16163
16028
|
* Render a fullscreen capture component that performs IDValidation and FaceValidation sequentially, and then stores the results in IDmission's customer database using the supplied `enrollmentId` for later verification or 1:N matching.
|
|
16164
16029
|
*/
|
|
16165
16030
|
var CustomerIdAndBiometricsEnrollment = function CustomerIdAndBiometricsEnrollment(_a) {
|
|
16166
|
-
var _b, _c;
|
|
16167
16031
|
var enrollmentId = _a.enrollmentId,
|
|
16168
|
-
|
|
16169
|
-
lang =
|
|
16032
|
+
_b = _a.lang,
|
|
16033
|
+
lang = _b === void 0 ? 'auto' : _b,
|
|
16170
16034
|
sessionId = _a.sessionId,
|
|
16171
16035
|
authUrl = _a.authUrl,
|
|
16172
16036
|
submissionUrl = _a.submissionUrl,
|
|
@@ -16190,39 +16054,29 @@
|
|
|
16190
16054
|
webhooksSendProcessedImages = _a.webhooksSendProcessedImages,
|
|
16191
16055
|
webhooksFireOnReview = _a.webhooksFireOnReview,
|
|
16192
16056
|
sendBase64DocumentsInSwaggerProxy = _a.sendBase64DocumentsInSwaggerProxy,
|
|
16193
|
-
|
|
16194
|
-
idCaptureLoadingOverlayMode =
|
|
16195
|
-
|
|
16196
|
-
idCaptureRequirement =
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
_l = _a.idCardFocusScoreThreshold,
|
|
16206
|
-
idCardFocusScoreThreshold = _l === void 0 ? (_b = defaultFocusThresholds.idCard) === null || _b === void 0 ? void 0 : _b.mobile : _l,
|
|
16207
|
-
_m = _a.passportFocusScoreThreshold,
|
|
16208
|
-
passportFocusScoreThreshold = _m === void 0 ? (_c = defaultFocusThresholds.passport) === null || _c === void 0 ? void 0 : _c.mobile : _m,
|
|
16209
|
-
_o = _a.faceLivenessTimeoutDurationMs,
|
|
16210
|
-
faceLivenessTimeoutDurationMs = _o === void 0 ? 15000 : _o,
|
|
16211
|
-
_p = _a.faceLivenessLoadingOverlayMode,
|
|
16212
|
-
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
16213
|
-
_q = _a.skipSuccessScreen,
|
|
16214
|
-
skipSuccessScreen = _q === void 0 ? false : _q,
|
|
16057
|
+
_c = _a.idCaptureLoadingOverlayMode,
|
|
16058
|
+
idCaptureLoadingOverlayMode = _c === void 0 ? 'default' : _c,
|
|
16059
|
+
_d = _a.idCaptureRequirement,
|
|
16060
|
+
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
16061
|
+
_e = _a.idCaptureThresholds,
|
|
16062
|
+
idCaptureThresholds = _e === void 0 ? defaultIdCaptureThresholds : _e,
|
|
16063
|
+
_f = _a.faceLivenessTimeoutDurationMs,
|
|
16064
|
+
faceLivenessTimeoutDurationMs = _f === void 0 ? 15000 : _f,
|
|
16065
|
+
_g = _a.faceLivenessLoadingOverlayMode,
|
|
16066
|
+
faceLivenessLoadingOverlayMode = _g === void 0 ? 'default' : _g,
|
|
16067
|
+
_h = _a.skipSuccessScreen,
|
|
16068
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
16215
16069
|
idCaptureInstructions = _a.idCaptureInstructions,
|
|
16216
|
-
|
|
16217
|
-
idCaptureGuideType =
|
|
16218
|
-
|
|
16219
|
-
idCapturePortraitGuidesOnMobile =
|
|
16220
|
-
|
|
16221
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
16222
|
-
|
|
16223
|
-
idCaptureModelLoadTimeoutMs =
|
|
16224
|
-
|
|
16225
|
-
selfieCaptureModelLoadTimeoutMs =
|
|
16070
|
+
_j = _a.idCaptureGuideType,
|
|
16071
|
+
idCaptureGuideType = _j === void 0 ? 'fit' : _j,
|
|
16072
|
+
_k = _a.idCapturePortraitGuidesOnMobile,
|
|
16073
|
+
idCapturePortraitGuidesOnMobile = _k === void 0 ? false : _k,
|
|
16074
|
+
_l = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
16075
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _l === void 0 ? true : _l,
|
|
16076
|
+
_m = _a.idCaptureModelLoadTimeoutMs,
|
|
16077
|
+
idCaptureModelLoadTimeoutMs = _m === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _m,
|
|
16078
|
+
_o = _a.selfieCaptureModelLoadTimeoutMs,
|
|
16079
|
+
selfieCaptureModelLoadTimeoutMs = _o === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _o,
|
|
16226
16080
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
16227
16081
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
16228
16082
|
onDocumentUploaded = _a.onDocumentUploaded,
|
|
@@ -16238,28 +16092,28 @@
|
|
|
16238
16092
|
onIdCaptureModelError = _a.onIdCaptureModelError,
|
|
16239
16093
|
onSelfieCaptureModelError = _a.onSelfieCaptureModelError,
|
|
16240
16094
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
16241
|
-
|
|
16242
|
-
captureSignature =
|
|
16243
|
-
|
|
16244
|
-
captureSignatureVideo =
|
|
16245
|
-
|
|
16246
|
-
captureAdditionalDocuments =
|
|
16247
|
-
|
|
16248
|
-
theme =
|
|
16249
|
-
|
|
16250
|
-
assets =
|
|
16251
|
-
|
|
16252
|
-
classNames =
|
|
16253
|
-
|
|
16254
|
-
colors =
|
|
16255
|
-
|
|
16256
|
-
verbiage =
|
|
16257
|
-
|
|
16258
|
-
geolocationEnabled =
|
|
16259
|
-
|
|
16260
|
-
geolocationRequired =
|
|
16261
|
-
|
|
16262
|
-
debugMode =
|
|
16095
|
+
_p = _a.captureSignature,
|
|
16096
|
+
captureSignature = _p === void 0 ? false : _p,
|
|
16097
|
+
_q = _a.captureSignatureVideo,
|
|
16098
|
+
captureSignatureVideo = _q === void 0 ? false : _q,
|
|
16099
|
+
_r = _a.captureAdditionalDocuments,
|
|
16100
|
+
captureAdditionalDocuments = _r === void 0 ? [] : _r,
|
|
16101
|
+
_s = _a.theme,
|
|
16102
|
+
theme = _s === void 0 ? 'default' : _s,
|
|
16103
|
+
_t = _a.assets,
|
|
16104
|
+
assets = _t === void 0 ? {} : _t,
|
|
16105
|
+
_u = _a.classNames,
|
|
16106
|
+
classNames = _u === void 0 ? {} : _u,
|
|
16107
|
+
_v = _a.colors,
|
|
16108
|
+
colors = _v === void 0 ? {} : _v,
|
|
16109
|
+
_w = _a.verbiage,
|
|
16110
|
+
verbiage = _w === void 0 ? {} : _w,
|
|
16111
|
+
_x = _a.geolocationEnabled,
|
|
16112
|
+
geolocationEnabled = _x === void 0 ? true : _x,
|
|
16113
|
+
_y = _a.geolocationRequired,
|
|
16114
|
+
geolocationRequired = _y === void 0 ? false : _y,
|
|
16115
|
+
_z = _a.debugMode,
|
|
16116
|
+
debugMode = _z === void 0 ? false : _z;
|
|
16263
16117
|
useLanguage(lang);
|
|
16264
16118
|
useDebugLogging(debugMode);
|
|
16265
16119
|
var idCaptureProps = React.useMemo(function () {
|
|
@@ -16269,12 +16123,7 @@
|
|
|
16269
16123
|
colors: colors.idCapture,
|
|
16270
16124
|
verbiage: verbiage.idCapture,
|
|
16271
16125
|
captureRequirement: idCaptureRequirement,
|
|
16272
|
-
|
|
16273
|
-
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
16274
|
-
passportAutoCaptureScoreThreshold: passportAutoCaptureScoreThreshold,
|
|
16275
|
-
mrzDetectionScoreThreshold: mrzDetectionScoreThreshold,
|
|
16276
|
-
idCardFocusScoreThreshold: idCardFocusScoreThreshold,
|
|
16277
|
-
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
16126
|
+
thresholds: idCaptureThresholds,
|
|
16278
16127
|
loadingOverlayMode: idCaptureLoadingOverlayMode,
|
|
16279
16128
|
instructions: idCaptureInstructions,
|
|
16280
16129
|
guideType: idCaptureGuideType,
|
|
@@ -16287,7 +16136,7 @@
|
|
|
16287
16136
|
skipSuccessScreen: skipSuccessScreen,
|
|
16288
16137
|
debugMode: debugMode
|
|
16289
16138
|
};
|
|
16290
|
-
}, [assets.idCapture, classNames.idCapture, colors.idCapture,
|
|
16139
|
+
}, [assets.idCapture, classNames.idCapture, colors.idCapture, verbiage.idCapture, idCaptureRequirement, idCaptureThresholds, idCaptureLoadingOverlayMode, idCaptureInstructions, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, idCaptureModelLoadTimeoutMs, onExitCapture, onUserCancel, onIdCaptureModelError, skipSuccessScreen, debugMode]);
|
|
16291
16140
|
var faceLivenessProps = React.useMemo(function () {
|
|
16292
16141
|
return {
|
|
16293
16142
|
onExitCapture: onExitCapture,
|
|
@@ -17625,70 +17474,60 @@
|
|
|
17625
17474
|
faceLivenessProps = _a.faceLivenessProps,
|
|
17626
17475
|
_c = _a.idCaptureModelsEnabled,
|
|
17627
17476
|
idCaptureModelsEnabled = _c === void 0 ? true : _c,
|
|
17628
|
-
_d = _a.
|
|
17629
|
-
|
|
17630
|
-
_e = _a.idCardFrontFocusThreshold,
|
|
17631
|
-
idCardFrontFocusThreshold = _e === void 0 ? 0 : _e,
|
|
17632
|
-
_f = _a.goodIdCardFrontFramesThreshold,
|
|
17633
|
-
goodIdCardFrontFramesThreshold = _f === void 0 ? 1 : _f,
|
|
17634
|
-
_g = _a.idCardBackDetectionThreshold,
|
|
17635
|
-
idCardBackDetectionThreshold = _g === void 0 ? 0.6 : _g,
|
|
17636
|
-
_h = _a.idCardBackFocusThreshold,
|
|
17637
|
-
idCardBackFocusThreshold = _h === void 0 ? 0 : _h,
|
|
17638
|
-
_j = _a.goodIdCardBackFramesThreshold,
|
|
17639
|
-
goodIdCardBackFramesThreshold = _j === void 0 ? 1 : _j,
|
|
17477
|
+
_d = _a.videoIdCaptureThresholds,
|
|
17478
|
+
videoIdCaptureThresholds = _d === void 0 ? defaultVideoIdCaptureThresholds : _d,
|
|
17640
17479
|
readTextPrompt = _a.readTextPrompt,
|
|
17641
|
-
|
|
17642
|
-
readTextTimeoutDurationMs =
|
|
17643
|
-
|
|
17644
|
-
readTextMinReadingMs =
|
|
17645
|
-
|
|
17646
|
-
skipSuccessScreen =
|
|
17647
|
-
|
|
17648
|
-
skipIdCapture =
|
|
17649
|
-
|
|
17650
|
-
skipShowIdCardBack =
|
|
17651
|
-
|
|
17652
|
-
idCaptureLoadingOverlayMode =
|
|
17653
|
-
|
|
17654
|
-
idCaptureGuideType =
|
|
17655
|
-
|
|
17656
|
-
idCapturePortraitGuidesOnMobile =
|
|
17657
|
-
|
|
17658
|
-
idCaptureRotateLoadingOverlayImageWhenPortrait =
|
|
17480
|
+
_e = _a.readTextTimeoutDurationMs,
|
|
17481
|
+
readTextTimeoutDurationMs = _e === void 0 ? 15000 : _e,
|
|
17482
|
+
_f = _a.readTextMinReadingMs,
|
|
17483
|
+
readTextMinReadingMs = _f === void 0 ? 10000 : _f,
|
|
17484
|
+
_g = _a.skipSuccessScreen,
|
|
17485
|
+
skipSuccessScreen = _g === void 0 ? false : _g,
|
|
17486
|
+
_h = _a.skipIdCapture,
|
|
17487
|
+
skipIdCapture = _h === void 0 ? false : _h,
|
|
17488
|
+
_j = _a.skipShowIdCardBack,
|
|
17489
|
+
skipShowIdCardBack = _j === void 0 ? false : _j,
|
|
17490
|
+
_k = _a.idCaptureLoadingOverlayMode,
|
|
17491
|
+
idCaptureLoadingOverlayMode = _k === void 0 ? 'default' : _k,
|
|
17492
|
+
_l = _a.idCaptureGuideType,
|
|
17493
|
+
idCaptureGuideType = _l === void 0 ? 'fit' : _l,
|
|
17494
|
+
_m = _a.idCapturePortraitGuidesOnMobile,
|
|
17495
|
+
idCapturePortraitGuidesOnMobile = _m === void 0 ? false : _m,
|
|
17496
|
+
_o = _a.idCaptureRotateLoadingOverlayImageWhenPortrait,
|
|
17497
|
+
idCaptureRotateLoadingOverlayImageWhenPortrait = _o === void 0 ? true : _o,
|
|
17659
17498
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
17660
|
-
|
|
17661
|
-
faceLivenessLoadingOverlayMode =
|
|
17662
|
-
|
|
17663
|
-
disableFaceDetectionWhileAudioCapture =
|
|
17664
|
-
|
|
17665
|
-
disableFaceDetectionWhileAudioCaptureMsDelay =
|
|
17666
|
-
|
|
17667
|
-
silentFallback =
|
|
17668
|
-
|
|
17669
|
-
mergeAVStreams =
|
|
17670
|
-
|
|
17671
|
-
theme =
|
|
17672
|
-
|
|
17673
|
-
assets =
|
|
17674
|
-
|
|
17675
|
-
classNames =
|
|
17676
|
-
|
|
17677
|
-
colors =
|
|
17678
|
-
|
|
17679
|
-
verbiage =
|
|
17680
|
-
|
|
17681
|
-
captureSignature =
|
|
17682
|
-
|
|
17683
|
-
captureSignatureVideo =
|
|
17684
|
-
|
|
17685
|
-
captureAdditionalDocuments =
|
|
17686
|
-
|
|
17687
|
-
geolocationEnabled =
|
|
17688
|
-
|
|
17689
|
-
geolocationRequired =
|
|
17690
|
-
|
|
17691
|
-
debugMode =
|
|
17499
|
+
_p = _a.faceLivenessLoadingOverlayMode,
|
|
17500
|
+
faceLivenessLoadingOverlayMode = _p === void 0 ? 'default' : _p,
|
|
17501
|
+
_q = _a.disableFaceDetectionWhileAudioCapture,
|
|
17502
|
+
disableFaceDetectionWhileAudioCapture = _q === void 0 ? false : _q,
|
|
17503
|
+
_r = _a.disableFaceDetectionWhileAudioCaptureMsDelay,
|
|
17504
|
+
disableFaceDetectionWhileAudioCaptureMsDelay = _r === void 0 ? 2000 : _r,
|
|
17505
|
+
_s = _a.silentFallback,
|
|
17506
|
+
silentFallback = _s === void 0 ? false : _s,
|
|
17507
|
+
_t = _a.mergeAVStreams,
|
|
17508
|
+
mergeAVStreams = _t === void 0 ? false : _t,
|
|
17509
|
+
_u = _a.theme,
|
|
17510
|
+
theme = _u === void 0 ? 'default' : _u,
|
|
17511
|
+
_v = _a.assets,
|
|
17512
|
+
assets = _v === void 0 ? {} : _v,
|
|
17513
|
+
_w = _a.classNames,
|
|
17514
|
+
classNames = _w === void 0 ? {} : _w,
|
|
17515
|
+
_x = _a.colors,
|
|
17516
|
+
colors = _x === void 0 ? {} : _x,
|
|
17517
|
+
_y = _a.verbiage,
|
|
17518
|
+
verbiage = _y === void 0 ? {} : _y,
|
|
17519
|
+
_z = _a.captureSignature,
|
|
17520
|
+
captureSignature = _z === void 0 ? false : _z,
|
|
17521
|
+
_0 = _a.captureSignatureVideo,
|
|
17522
|
+
captureSignatureVideo = _0 === void 0 ? false : _0,
|
|
17523
|
+
_1 = _a.captureAdditionalDocuments,
|
|
17524
|
+
captureAdditionalDocuments = _1 === void 0 ? [] : _1,
|
|
17525
|
+
_2 = _a.geolocationEnabled,
|
|
17526
|
+
geolocationEnabled = _2 === void 0 ? true : _2,
|
|
17527
|
+
_3 = _a.geolocationRequired,
|
|
17528
|
+
geolocationRequired = _3 === void 0 ? false : _3,
|
|
17529
|
+
_4 = _a.debugMode,
|
|
17530
|
+
debugMode = _4 === void 0 ? false : _4;
|
|
17692
17531
|
useLanguage(lang);
|
|
17693
17532
|
useDebugLogging(debugMode);
|
|
17694
17533
|
var videoIdCaptureProps = React.useMemo(function () {
|
|
@@ -17696,12 +17535,7 @@
|
|
|
17696
17535
|
idCaptureProps: idCaptureProps,
|
|
17697
17536
|
faceLivenessProps: faceLivenessProps,
|
|
17698
17537
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
17699
|
-
|
|
17700
|
-
idCardFrontFocusThreshold: idCardFrontFocusThreshold,
|
|
17701
|
-
goodIdCardFrontFramesThreshold: goodIdCardFrontFramesThreshold,
|
|
17702
|
-
idCardBackDetectionThreshold: idCardBackDetectionThreshold,
|
|
17703
|
-
idCardBackFocusThreshold: idCardBackFocusThreshold,
|
|
17704
|
-
goodIdCardBackFramesThreshold: goodIdCardBackFramesThreshold,
|
|
17538
|
+
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
17705
17539
|
readTextPrompt: readTextPrompt,
|
|
17706
17540
|
readTextTimeoutDurationMs: readTextTimeoutDurationMs,
|
|
17707
17541
|
readTextMinReadingMs: readTextMinReadingMs,
|
|
@@ -17726,7 +17560,7 @@
|
|
|
17726
17560
|
verbiage: verbiage,
|
|
17727
17561
|
debugMode: debugMode
|
|
17728
17562
|
};
|
|
17729
|
-
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled,
|
|
17563
|
+
}, [idCaptureProps, faceLivenessProps, idCaptureModelsEnabled, videoIdCaptureThresholds, readTextPrompt, readTextTimeoutDurationMs, readTextMinReadingMs, onExitCapture, onExitAfterFailure, onUserCancel, skipSuccessScreen, skipIdCapture, skipShowIdCardBack, idCaptureLoadingOverlayMode, idCaptureGuideType, idCapturePortraitGuidesOnMobile, idCaptureRotateLoadingOverlayImageWhenPortrait, faceLivenessLoadingOverlayMode, disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, silentFallback, mergeAVStreams, assets, classNames, colors, verbiage, debugMode]);
|
|
17730
17564
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
17731
17565
|
return {
|
|
17732
17566
|
documents: captureAdditionalDocuments,
|