idmission-web-sdk 2.2.63 → 2.2.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CompositeWizard.d.ts.map +1 -1
- package/dist/components/customer_flows/IdValidation.d.ts +3 -1
- package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
- package/dist/components/customer_flows/VideoIdValidation.d.ts +2 -2
- package/dist/components/customer_flows/VideoIdValidation.d.ts.map +1 -1
- package/dist/components/fallback_flows/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/CapturedDocuments.d.ts +1 -1
- package/dist/components/id_capture/CapturedDocuments.d.ts.map +1 -1
- package/dist/components/id_capture/IdCapture.d.ts +2 -2
- package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +2 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureRequirementOption.d.ts +7 -5
- package/dist/components/id_capture/IdCaptureRequirementOption.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +4 -0
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureSuccess.d.ts +0 -4
- package/dist/components/id_capture/IdCaptureSuccess.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +2 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCapture.d.ts +2 -0
- package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +1 -1
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts.map +1 -1
- package/dist/lib/models/DocumentDetection.d.ts +6 -2
- package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
- package/dist/lib/models/Focus.d.ts +4 -0
- package/dist/lib/models/Focus.d.ts.map +1 -1
- package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +364 -332
- 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 +364 -332
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +364 -332
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/sdk2.esm.js
CHANGED
|
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
203
203
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
var webSdkVersion = '2.2.
|
|
206
|
+
var webSdkVersion = '2.2.65';
|
|
207
207
|
|
|
208
208
|
function getPlatform() {
|
|
209
209
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2238,7 +2238,7 @@ function average(arr) {
|
|
|
2238
2238
|
|
|
2239
2239
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
2240
2240
|
|
|
2241
|
-
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-
|
|
2241
|
+
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241212_131026.tflite");
|
|
2242
2242
|
|
|
2243
2243
|
var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
|
|
2244
2244
|
|
|
@@ -2257,6 +2257,10 @@ var defaultFocusThresholds = {
|
|
|
2257
2257
|
passport: {
|
|
2258
2258
|
desktop: 0,
|
|
2259
2259
|
mobile: 0.3
|
|
2260
|
+
},
|
|
2261
|
+
singlePage: {
|
|
2262
|
+
desktop: 0,
|
|
2263
|
+
mobile: 0.3
|
|
2260
2264
|
}
|
|
2261
2265
|
};
|
|
2262
2266
|
var classifier = null;
|
|
@@ -2882,16 +2886,19 @@ var defaultDocumentDetectionThresholds = {
|
|
|
2882
2886
|
idCardFront: 0.6,
|
|
2883
2887
|
idCardBack: 0.6,
|
|
2884
2888
|
passport: 0.4,
|
|
2889
|
+
singlePage: 0.4,
|
|
2885
2890
|
stability: {
|
|
2886
2891
|
idCardFront: 0.85,
|
|
2887
2892
|
idCardBack: 0.85,
|
|
2888
|
-
passport: 0.5
|
|
2893
|
+
passport: 0.5,
|
|
2894
|
+
singlePage: 0.5
|
|
2889
2895
|
}
|
|
2890
2896
|
};
|
|
2891
2897
|
var documentTypeDisplayNames = {
|
|
2892
2898
|
idCardFront: 'ID card front',
|
|
2893
2899
|
idCardBack: 'ID card back',
|
|
2894
2900
|
passport: 'Passport',
|
|
2901
|
+
singlePage: 'Single page',
|
|
2895
2902
|
none: 'None'
|
|
2896
2903
|
};
|
|
2897
2904
|
var detector = null;
|
|
@@ -3080,7 +3087,7 @@ var defaultDocumentDetectionBoundaries = {
|
|
|
3080
3087
|
right: 20
|
|
3081
3088
|
};
|
|
3082
3089
|
function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
3083
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3090
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
3084
3091
|
if (boundaries === void 0) {
|
|
3085
3092
|
boundaries = defaultDocumentDetectionBoundaries;
|
|
3086
3093
|
}
|
|
@@ -3131,18 +3138,25 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
3131
3138
|
var bestPassportPage = detectedObjects.find(function (obj) {
|
|
3132
3139
|
return obj.label === 'Passport page';
|
|
3133
3140
|
});
|
|
3141
|
+
var bestSinglePage = detectedObjects.find(function (obj) {
|
|
3142
|
+
return obj.label === 'Single page';
|
|
3143
|
+
});
|
|
3134
3144
|
var idCardFrontDetectionScore = (_e = bestIdCardFront === null || bestIdCardFront === void 0 ? void 0 : bestIdCardFront.score) !== null && _e !== void 0 ? _e : 0;
|
|
3135
3145
|
var idCardBackDetectionScore = (_f = bestIdCardBack === null || bestIdCardBack === void 0 ? void 0 : bestIdCardBack.score) !== null && _f !== void 0 ? _f : 0;
|
|
3136
3146
|
var passportDetectionScore = (_g = bestPassportPage === null || bestPassportPage === void 0 ? void 0 : bestPassportPage.score) !== null && _g !== void 0 ? _g : 0;
|
|
3137
|
-
var
|
|
3138
|
-
var
|
|
3139
|
-
var
|
|
3140
|
-
var
|
|
3141
|
-
var
|
|
3142
|
-
var
|
|
3147
|
+
var singlePageDetectionScore = (_h = bestSinglePage === null || bestSinglePage === void 0 ? void 0 : bestSinglePage.score) !== null && _h !== void 0 ? _h : 0;
|
|
3148
|
+
var idCardFrontDetectionThresholdMet = idCardFrontDetectionScore >= ((_j = thresholds.idCardFront) !== null && _j !== void 0 ? _j : 0);
|
|
3149
|
+
var idCardBackDetectionThresholdMet = idCardBackDetectionScore >= ((_k = thresholds.idCardBack) !== null && _k !== void 0 ? _k : 0);
|
|
3150
|
+
var passportDetectionThresholdMet = passportDetectionScore >= ((_l = thresholds.passport) !== null && _l !== void 0 ? _l : 0);
|
|
3151
|
+
var singlePageDetectionThresholdMet = singlePageDetectionScore >= ((_m = thresholds.singlePage) !== null && _m !== void 0 ? _m : 0);
|
|
3152
|
+
var bestDocument = singlePageDetectionThresholdMet ? bestSinglePage : passportDetectionThresholdMet ? bestPassportPage : idCardBackDetectionThresholdMet ? bestIdCardBack : bestIdCardFront;
|
|
3153
|
+
var detectionThreshold = singlePageDetectionThresholdMet ? thresholds.singlePage : passportDetectionThresholdMet ? thresholds.passport : idCardBackDetectionThresholdMet ? thresholds.idCardBack : thresholds.idCardFront;
|
|
3154
|
+
var detectionScore = (_o = bestDocument === null || bestDocument === void 0 ? void 0 : bestDocument.score) !== null && _o !== void 0 ? _o : 0;
|
|
3143
3155
|
var detectionThresholdMet = detectionScore >= (detectionThreshold !== null && detectionThreshold !== void 0 ? detectionThreshold : 0);
|
|
3144
3156
|
var detectedDocumentType = 'none';
|
|
3145
|
-
if (
|
|
3157
|
+
if (singlePageDetectionThresholdMet) {
|
|
3158
|
+
detectedDocumentType = 'singlePage';
|
|
3159
|
+
} else if (passportDetectionThresholdMet) {
|
|
3146
3160
|
detectedDocumentType = 'passport';
|
|
3147
3161
|
} else if (idCardBackDetectionThresholdMet) {
|
|
3148
3162
|
detectedDocumentType = 'idCardBack';
|
|
@@ -3156,12 +3170,12 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
3156
3170
|
var documentIsStable = false;
|
|
3157
3171
|
var documentTooClose = false;
|
|
3158
3172
|
if (bestDocument) {
|
|
3159
|
-
var
|
|
3160
|
-
docWidth =
|
|
3161
|
-
docHeight =
|
|
3173
|
+
var _q = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
|
|
3174
|
+
docWidth = _q[0],
|
|
3175
|
+
docHeight = _q[1];
|
|
3162
3176
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
3163
3177
|
if (detectionThresholdMet && documentInBounds && !documentTooClose) {
|
|
3164
|
-
var thresholdSet = (
|
|
3178
|
+
var thresholdSet = (_p = thresholds.stability) !== null && _p !== void 0 ? _p : defaultDocumentDetectionThresholds.stability;
|
|
3165
3179
|
var threshold_1 = thresholdSet[detectedDocumentType];
|
|
3166
3180
|
var framesNeeded = Math.ceil(average(framesNeededSamples));
|
|
3167
3181
|
trackBox(bestDocument.box, framesNeeded);
|
|
@@ -3183,6 +3197,8 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
3183
3197
|
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
3184
3198
|
passportDetectionScore: passportDetectionScore,
|
|
3185
3199
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
3200
|
+
singlePageDetectionScore: singlePageDetectionScore,
|
|
3201
|
+
singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
|
|
3186
3202
|
bestDocument: bestDocument,
|
|
3187
3203
|
documentInBounds: documentInBounds,
|
|
3188
3204
|
documentTooClose: documentTooClose,
|
|
@@ -4076,37 +4092,39 @@ var IdCaptureModelsContext = /*#__PURE__*/createContext({
|
|
|
4076
4092
|
});
|
|
4077
4093
|
function IdCaptureModelsProviderInner(_a) {
|
|
4078
4094
|
var children = _a.children,
|
|
4079
|
-
onModelError = _a.onModelError
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4095
|
+
onModelError = _a.onModelError,
|
|
4096
|
+
_b = _a.allowSinglePageIdCapture,
|
|
4097
|
+
allowSinglePageIdCapture = _b === void 0 ? false : _b;
|
|
4098
|
+
var _c = useContext(DocumentDetectionModelContext),
|
|
4099
|
+
documentDetectionModelReady = _c.documentDetectionModelReady,
|
|
4100
|
+
documentDetectionModelDownloadProgress = _c.documentDetectionModelDownloadProgress,
|
|
4101
|
+
startDocumentDetection = _c.startDocumentDetection,
|
|
4102
|
+
stopDocumentDetection = _c.stopDocumentDetection,
|
|
4103
|
+
lastPredictionCanvas = _c.documentDetectionLastPredictionCanvas,
|
|
4104
|
+
clearDocumentDetectionLastPredictionCanvas = _c.clearDocumentDetectionLastPredictionCanvas,
|
|
4105
|
+
onDocumentDetected = _c.onDocumentDetected,
|
|
4106
|
+
detectionTime = _c.detectionTime,
|
|
4107
|
+
documentDetectionThresholds = _c.documentDetectionThresholds,
|
|
4108
|
+
setDocumentDetectionThresholds = _c.setDocumentDetectionThresholds,
|
|
4109
|
+
documentDetectionBoundaries = _c.documentDetectionBoundaries,
|
|
4110
|
+
setDocumentDetectionBoundaries = _c.setDocumentDetectionBoundaries,
|
|
4111
|
+
documentDetectionModelError = _c.documentDetectionModelError;
|
|
4112
|
+
var _d = useContext(FocusModelContext),
|
|
4113
|
+
focusModelReady = _d.focusModelReady,
|
|
4114
|
+
focusModelDownloadProgress = _d.focusModelDownloadProgress,
|
|
4115
|
+
makeFocusPrediction = _d.makeFocusPrediction,
|
|
4116
|
+
focusThresholds = _d.focusThresholds,
|
|
4117
|
+
setFocusThresholds = _d.setFocusThresholds,
|
|
4118
|
+
focusPredictionTime = _d.focusPredictionTime,
|
|
4119
|
+
focusModelError = _d.focusModelError;
|
|
4102
4120
|
var onPredictionHandler = useRef();
|
|
4103
4121
|
var bestFrameDetails = useRef(null);
|
|
4104
4122
|
var bestPredictionCanvas = useRef(null);
|
|
4105
4123
|
var bestFocusScore = useRef(0);
|
|
4106
4124
|
var stopDetection = useRef(0);
|
|
4107
|
-
var
|
|
4108
|
-
requiredDocumentType =
|
|
4109
|
-
setRequiredDocumentType =
|
|
4125
|
+
var _e = useState('none'),
|
|
4126
|
+
requiredDocumentType = _e[0],
|
|
4127
|
+
setRequiredDocumentType = _e[1];
|
|
4110
4128
|
var thresholds = useMemo(function () {
|
|
4111
4129
|
return _assign(_assign({}, documentDetectionThresholds), {
|
|
4112
4130
|
focus: focusThresholds
|
|
@@ -4124,34 +4142,42 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
4124
4142
|
var _this = this;
|
|
4125
4143
|
onDocumentDetected(function (prediction) {
|
|
4126
4144
|
return __awaiter(_this, void 0, void 0, function () {
|
|
4127
|
-
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
4128
|
-
var _a, _b, _c, _d, _e, _f;
|
|
4129
|
-
return __generator(this, function (
|
|
4145
|
+
var stopDetectionAtStart, focusPredictionTime, focusScore, focusThresholdMet, isSinglePage, isRequiredDocumentType, focusPrediction, focusThresholdSet, focusThreshold;
|
|
4146
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
4147
|
+
return __generator(this, function (_h) {
|
|
4130
4148
|
if (!lastPredictionCanvas.current) return [2 /*return*/];
|
|
4131
4149
|
stopDetectionAtStart = stopDetection.current;
|
|
4132
4150
|
focusPredictionTime = 0, focusScore = 0, focusThresholdMet = false;
|
|
4133
|
-
|
|
4151
|
+
isSinglePage = prediction.detectedDocumentType === 'singlePage';
|
|
4152
|
+
if (!allowSinglePageIdCapture && isSinglePage) {
|
|
4153
|
+
prediction.detectedDocumentType = 'passport';
|
|
4154
|
+
prediction.passportDetectionScore = prediction.singlePageDetectionScore;
|
|
4155
|
+
prediction.passportDetectionThresholdMet = prediction.singlePageDetectionThresholdMet;
|
|
4156
|
+
prediction.singlePageDetectionScore = 0;
|
|
4157
|
+
prediction.singlePageDetectionThresholdMet = false;
|
|
4158
|
+
}
|
|
4159
|
+
isRequiredDocumentType = requiredDocumentType === 'none' || prediction.detectedDocumentType === requiredDocumentType || ((_a = requiredDocumentType.includes) === null || _a === void 0 ? void 0 : _a.call(requiredDocumentType, prediction.detectedDocumentType)) || allowSinglePageIdCapture && isSinglePage && ((_b = requiredDocumentType.includes) === null || _b === void 0 ? void 0 : _b.call(requiredDocumentType, 'idCardFront'));
|
|
4134
4160
|
if (isRequiredDocumentType && prediction.detectedDocumentType !== 'none' && prediction.detectionThresholdMet && prediction.documentInBounds && !prediction.documentTooClose && prediction.documentIsStable) {
|
|
4135
|
-
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (
|
|
4161
|
+
focusPrediction = makeFocusPrediction(lastPredictionCanvas.current, (_c = prediction.bestDocument) === null || _c === void 0 ? void 0 : _c.box);
|
|
4136
4162
|
if (focusPrediction) {
|
|
4137
4163
|
focusScore = focusPrediction.score;
|
|
4138
4164
|
focusPredictionTime = focusPrediction.predictionTime;
|
|
4139
4165
|
}
|
|
4140
|
-
focusThresholdSet = (
|
|
4141
|
-
focusThreshold = (
|
|
4166
|
+
focusThresholdSet = (_d = thresholds.focus) === null || _d === void 0 ? void 0 : _d[prediction.detectedDocumentType];
|
|
4167
|
+
focusThreshold = (_e = onMobile ? focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.mobile : focusThresholdSet === null || focusThresholdSet === void 0 ? void 0 : focusThresholdSet.desktop) !== null && _e !== void 0 ? _e : 0;
|
|
4142
4168
|
focusThresholdMet = focusScore >= focusThreshold;
|
|
4143
4169
|
if (bestFocusScore.current <= focusScore && stopDetectionAtStart === stopDetection.current) {
|
|
4144
4170
|
bestFocusScore.current = focusScore;
|
|
4145
4171
|
drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
|
|
4146
4172
|
bestFrameDetails.current = {
|
|
4147
|
-
boundingBox: (
|
|
4173
|
+
boundingBox: (_f = prediction.bestDocument) === null || _f === void 0 ? void 0 : _f.box,
|
|
4148
4174
|
documentType: prediction.detectedDocumentType,
|
|
4149
4175
|
detectionScore: prediction.detectionScore,
|
|
4150
4176
|
focusScore: focusScore
|
|
4151
4177
|
};
|
|
4152
4178
|
}
|
|
4153
4179
|
}
|
|
4154
|
-
(
|
|
4180
|
+
(_g = onPredictionHandler.current) === null || _g === void 0 ? void 0 : _g.call(onPredictionHandler, _assign(_assign({}, prediction), {
|
|
4155
4181
|
focusScore: focusScore,
|
|
4156
4182
|
focusPredictionTime: focusPredictionTime,
|
|
4157
4183
|
focusThresholdMet: focusThresholdMet
|
|
@@ -4160,7 +4186,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
4160
4186
|
});
|
|
4161
4187
|
});
|
|
4162
4188
|
});
|
|
4163
|
-
}, [lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
4189
|
+
}, [allowSinglePageIdCapture, lastPredictionCanvas, makeFocusPrediction, onDocumentDetected, requiredDocumentType, thresholds.focus]);
|
|
4164
4190
|
var modelError = documentDetectionModelError !== null && documentDetectionModelError !== void 0 ? documentDetectionModelError : focusModelError;
|
|
4165
4191
|
useEffect(function handleModelErrors() {
|
|
4166
4192
|
modelError && (onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError));
|
|
@@ -4174,9 +4200,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
4174
4200
|
canvas: bestPredictionCanvas.current
|
|
4175
4201
|
});
|
|
4176
4202
|
}, []);
|
|
4177
|
-
var
|
|
4178
|
-
canvasKey =
|
|
4179
|
-
setCanvasKey =
|
|
4203
|
+
var _f = useState(0),
|
|
4204
|
+
canvasKey = _f[0],
|
|
4205
|
+
setCanvasKey = _f[1];
|
|
4180
4206
|
var resetBestFrame = useCallback(function () {
|
|
4181
4207
|
stopDetection.current += 1;
|
|
4182
4208
|
setCanvasKey(function (n) {
|
|
@@ -4223,9 +4249,9 @@ function IdCaptureModelsProvider(_a) {
|
|
|
4223
4249
|
return /*#__PURE__*/React__default.createElement(DocumentDetectionModelProvider, _assign({}, props), /*#__PURE__*/React__default.createElement(FocusModelProvider, _assign({}, props), /*#__PURE__*/React__default.createElement(IdCaptureModelsProviderInner, _assign({}, props), children)));
|
|
4224
4250
|
}
|
|
4225
4251
|
|
|
4226
|
-
var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'selfie'];
|
|
4252
|
+
var CapturedDocumentTypeValues = ['idCardFront', 'idCardBack', 'passport', 'singlePage', 'selfie'];
|
|
4227
4253
|
|
|
4228
|
-
var
|
|
4254
|
+
var acceptedDocumentTypesForIdCaptureRequirementOption = {
|
|
4229
4255
|
idCardFront: ['idCardFront'],
|
|
4230
4256
|
idCardBack: ['idCardBack'],
|
|
4231
4257
|
passport: ['passport'],
|
|
@@ -4233,13 +4259,35 @@ var requiredDocumentsForOption = {
|
|
|
4233
4259
|
idCardAndPassport: ['idCardFront', 'idCardBack', 'passport'],
|
|
4234
4260
|
idCardOrPassport: ['idCardFront', 'idCardBack', 'passport'] // this one is so weird
|
|
4235
4261
|
};
|
|
4236
|
-
function
|
|
4262
|
+
function minImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
|
|
4237
4263
|
if (idCaptureRequirement === 'idCardOrPassport') return 1;
|
|
4238
|
-
return
|
|
4264
|
+
return acceptedDocumentTypesForIdCaptureRequirementOption[idCaptureRequirement].length;
|
|
4239
4265
|
}
|
|
4240
|
-
function
|
|
4266
|
+
function maxImageCountForIdCaptureRequirementOption(idCaptureRequirement) {
|
|
4241
4267
|
if (idCaptureRequirement === 'idCardOrPassport') return 2;
|
|
4242
|
-
return
|
|
4268
|
+
return minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
|
|
4269
|
+
}
|
|
4270
|
+
function remainingIdCaptureRequirements(captureRequirement, capturedDocuments, requestedDocumentType) {
|
|
4271
|
+
var isIdCardOrPassport = captureRequirement === 'idCardOrPassport';
|
|
4272
|
+
if (isIdCardOrPassport && requestedDocumentType === 'passport') return [];
|
|
4273
|
+
var acceptedTypes = acceptedDocumentTypesForIdCaptureRequirementOption[captureRequirement];
|
|
4274
|
+
console.log({
|
|
4275
|
+
capturedDocuments: capturedDocuments,
|
|
4276
|
+
captureRequirement: captureRequirement
|
|
4277
|
+
});
|
|
4278
|
+
if (captureRequirement.includes('idCard') && 'singlePage' in capturedDocuments) {
|
|
4279
|
+
acceptedTypes = acceptedTypes.filter(function (v) {
|
|
4280
|
+
return !v.includes('idCard');
|
|
4281
|
+
});
|
|
4282
|
+
}
|
|
4283
|
+
if (isIdCardOrPassport) {
|
|
4284
|
+
acceptedTypes = acceptedTypes.filter(function (v) {
|
|
4285
|
+
return v !== 'passport';
|
|
4286
|
+
});
|
|
4287
|
+
}
|
|
4288
|
+
return acceptedTypes.filter(function (v) {
|
|
4289
|
+
return !(v in capturedDocuments);
|
|
4290
|
+
});
|
|
4243
4291
|
}
|
|
4244
4292
|
|
|
4245
4293
|
var initialState$4 = {
|
|
@@ -4278,6 +4326,8 @@ var initialState$4 = {
|
|
|
4278
4326
|
idCardBackDetectionThresholdMet: false,
|
|
4279
4327
|
passportDetectionScore: 0,
|
|
4280
4328
|
passportDetectionThresholdMet: false,
|
|
4329
|
+
singlePageDetectionScore: 0,
|
|
4330
|
+
singlePageDetectionThresholdMet: false,
|
|
4281
4331
|
focusScore: 0,
|
|
4282
4332
|
focusThresholdMet: false,
|
|
4283
4333
|
isGoodFrame: false,
|
|
@@ -4293,6 +4343,7 @@ var initialState$4 = {
|
|
|
4293
4343
|
capturedDocuments: {},
|
|
4294
4344
|
captureRequirement: 'idCardOrPassport',
|
|
4295
4345
|
requestedDocumentType: 'idCardFront',
|
|
4346
|
+
allowSinglePageIdCapture: false,
|
|
4296
4347
|
allowIdCardBackToFrontCapture: false,
|
|
4297
4348
|
operationStartedAt: null,
|
|
4298
4349
|
captureStartedAt: null
|
|
@@ -4307,11 +4358,13 @@ var _reducer = function reducer(state, action) {
|
|
|
4307
4358
|
var _c = action.payload,
|
|
4308
4359
|
captureRequirement = _c.captureRequirement,
|
|
4309
4360
|
precapturedDocuments = _c.precapturedDocuments,
|
|
4361
|
+
allowSinglePageIdCapture = _c.allowSinglePageIdCapture,
|
|
4310
4362
|
allowIdCardBackToFrontCapture = _c.allowIdCardBackToFrontCapture,
|
|
4311
4363
|
enableOverrideWrongDocumentTypeDialog = _c.enableOverrideWrongDocumentTypeDialog,
|
|
4312
4364
|
allowOverrideWrongDocumentTypeAfterMs = _c.allowOverrideWrongDocumentTypeAfterMs;
|
|
4313
4365
|
var newState = _assign(_assign({}, state), {
|
|
4314
4366
|
captureRequirement: captureRequirement,
|
|
4367
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture !== null && allowSinglePageIdCapture !== void 0 ? allowSinglePageIdCapture : false,
|
|
4315
4368
|
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture !== null && allowIdCardBackToFrontCapture !== void 0 ? allowIdCardBackToFrontCapture : false,
|
|
4316
4369
|
enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
|
|
4317
4370
|
allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
|
|
@@ -4379,6 +4432,8 @@ var _reducer = function reducer(state, action) {
|
|
|
4379
4432
|
idCardBackDetectionThresholdMet = _d.idCardBackDetectionThresholdMet,
|
|
4380
4433
|
passportDetectionScore = _d.passportDetectionScore,
|
|
4381
4434
|
passportDetectionThresholdMet = _d.passportDetectionThresholdMet,
|
|
4435
|
+
singlePageDetectionScore = _d.singlePageDetectionScore,
|
|
4436
|
+
singlePageDetectionThresholdMet = _d.singlePageDetectionThresholdMet,
|
|
4382
4437
|
bestDocument = _d.bestDocument,
|
|
4383
4438
|
documentInBounds = _d.documentInBounds,
|
|
4384
4439
|
documentTooClose = _d.documentTooClose,
|
|
@@ -4399,7 +4454,8 @@ var _reducer = function reducer(state, action) {
|
|
|
4399
4454
|
}
|
|
4400
4455
|
}
|
|
4401
4456
|
}
|
|
4402
|
-
var
|
|
4457
|
+
var idCardDetected = detectedDocumentType.includes('idCard') || detectedDocumentType === 'singlePage';
|
|
4458
|
+
var idCardDetectedButNotAllowed = idCardDetected && !state.captureRequirement.includes('idCard');
|
|
4403
4459
|
var passportNotAllowed = !state.captureRequirement.toLowerCase().includes('passport');
|
|
4404
4460
|
var idCardFrontWasCaptured = 'idCardFront' in state.capturedDocuments;
|
|
4405
4461
|
var idCardBackWasCaptured = 'idCardBack' in state.capturedDocuments;
|
|
@@ -4459,6 +4515,8 @@ var _reducer = function reducer(state, action) {
|
|
|
4459
4515
|
idCardBackDetectionThresholdMet: idCardBackDetectionThresholdMet,
|
|
4460
4516
|
passportDetectionScore: passportDetectionScore,
|
|
4461
4517
|
passportDetectionThresholdMet: passportDetectionThresholdMet,
|
|
4518
|
+
singlePageDetectionScore: singlePageDetectionScore,
|
|
4519
|
+
singlePageDetectionThresholdMet: singlePageDetectionThresholdMet,
|
|
4462
4520
|
focusScore: focusScore,
|
|
4463
4521
|
focusThresholdMet: focusThresholdMet,
|
|
4464
4522
|
isGoodFrame: isGoodFrame,
|
|
@@ -4496,7 +4554,7 @@ var _reducer = function reducer(state, action) {
|
|
|
4496
4554
|
});
|
|
4497
4555
|
case 'documentCaptured':
|
|
4498
4556
|
{
|
|
4499
|
-
var
|
|
4557
|
+
var newState = _assign(_assign({}, state), {
|
|
4500
4558
|
capturing: false,
|
|
4501
4559
|
captureFailed: false,
|
|
4502
4560
|
allowOverrideFlipRequirement: false,
|
|
@@ -4505,64 +4563,42 @@ var _reducer = function reducer(state, action) {
|
|
|
4505
4563
|
wrongDocumentTypePredictions: 0,
|
|
4506
4564
|
capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_a = {}, _a[action.payload.documentType] = action.payload, _a))
|
|
4507
4565
|
});
|
|
4508
|
-
var remainingRequirements =
|
|
4509
|
-
return !(v in newState_1.capturedDocuments);
|
|
4510
|
-
});
|
|
4511
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4512
|
-
if (state.requestedDocumentType === 'passport') {
|
|
4513
|
-
remainingRequirements = [];
|
|
4514
|
-
} else {
|
|
4515
|
-
remainingRequirements = remainingRequirements.filter(function (v) {
|
|
4516
|
-
return v !== 'passport';
|
|
4517
|
-
});
|
|
4518
|
-
}
|
|
4519
|
-
}
|
|
4566
|
+
var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
|
|
4520
4567
|
if (remainingRequirements.length === 0) {
|
|
4521
|
-
|
|
4568
|
+
newState.captureState = 'complete';
|
|
4522
4569
|
} else {
|
|
4523
|
-
|
|
4524
|
-
if (state.requestedDocumentType === 'idCardFront' &&
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4570
|
+
newState.requestedDocumentType = remainingRequirements[0];
|
|
4571
|
+
if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
|
|
4572
|
+
newState.captureState = 'requestingFlip';
|
|
4573
|
+
newState.idCardFrontDetectionThresholdMet = false;
|
|
4574
|
+
newState.idCardBackDetectionThresholdMet = false;
|
|
4575
|
+
newState.passportDetectionThresholdMet = false;
|
|
4576
|
+
newState.wrongDocumentTypePredictions = 0;
|
|
4530
4577
|
}
|
|
4531
4578
|
}
|
|
4532
|
-
return
|
|
4579
|
+
return newState;
|
|
4533
4580
|
}
|
|
4534
4581
|
case 'documentCapturedManually':
|
|
4535
4582
|
{
|
|
4536
|
-
var
|
|
4583
|
+
var newState = _assign(_assign({}, state), {
|
|
4537
4584
|
capturedDocuments: _assign(_assign({}, state.capturedDocuments), (_b = {}, _b[state.requestedDocumentType] = _assign(_assign({}, action.payload), {
|
|
4538
4585
|
width: 0,
|
|
4539
4586
|
height: 0
|
|
4540
4587
|
}), _b))
|
|
4541
4588
|
});
|
|
4542
|
-
var remainingRequirements =
|
|
4543
|
-
return !(v in newState_2.capturedDocuments);
|
|
4544
|
-
});
|
|
4545
|
-
if (state.captureRequirement === 'idCardOrPassport') {
|
|
4546
|
-
if (state.requestedDocumentType === 'passport') {
|
|
4547
|
-
remainingRequirements = [];
|
|
4548
|
-
} else {
|
|
4549
|
-
remainingRequirements = remainingRequirements.filter(function (v) {
|
|
4550
|
-
return v !== 'passport';
|
|
4551
|
-
});
|
|
4552
|
-
}
|
|
4553
|
-
}
|
|
4589
|
+
var remainingRequirements = remainingIdCaptureRequirements(state.captureRequirement, newState.capturedDocuments, state.requestedDocumentType);
|
|
4554
4590
|
if (remainingRequirements.length === 0) {
|
|
4555
|
-
|
|
4591
|
+
newState.captureState = 'complete';
|
|
4556
4592
|
} else {
|
|
4557
|
-
|
|
4558
|
-
if (state.requestedDocumentType === 'idCardFront' &&
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4593
|
+
newState.requestedDocumentType = remainingRequirements[0];
|
|
4594
|
+
if (state.requestedDocumentType === 'idCardFront' && newState.requestedDocumentType === 'idCardBack' || state.requestedDocumentType === 'idCardBack' && newState.requestedDocumentType === 'idCardFront') {
|
|
4595
|
+
newState.captureState = 'requestingFlip';
|
|
4596
|
+
newState.idCardFrontDetectionThresholdMet = false;
|
|
4597
|
+
newState.idCardBackDetectionThresholdMet = false;
|
|
4598
|
+
newState.passportDetectionThresholdMet = false;
|
|
4563
4599
|
}
|
|
4564
4600
|
}
|
|
4565
|
-
return
|
|
4601
|
+
return newState;
|
|
4566
4602
|
}
|
|
4567
4603
|
case 'flipRequestCompleted':
|
|
4568
4604
|
return _assign(_assign({}, state), {
|
|
@@ -5163,7 +5199,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
5163
5199
|
imageUrl: imageUrl
|
|
5164
5200
|
}
|
|
5165
5201
|
});
|
|
5166
|
-
var capturedDocumentType = documentType
|
|
5202
|
+
var capturedDocumentType = documentType;
|
|
5167
5203
|
setTimeout(function () {
|
|
5168
5204
|
var _a;
|
|
5169
5205
|
var captureTime = new Date().getTime() - ((_a = state.captureStartedAt) !== null && _a !== void 0 ? _a : new Date()).getTime();
|
|
@@ -5230,7 +5266,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
5230
5266
|
scaling: debugScalingDetails,
|
|
5231
5267
|
flipX: !isRearFacing
|
|
5232
5268
|
});
|
|
5233
|
-
}))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__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.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React__default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u274C Models not ready")))));
|
|
5269
|
+
}))), debugMode && ( /*#__PURE__*/React__default.createElement(DebugStatsPane, null, camera ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u2705 Camera: ", camera.label, " (", camera.width, "x", camera.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__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.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__default.createElement("br", null), state.documentIsStable ? '✅' : '❌', " Document Is Stable", /*#__PURE__*/React__default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\u274C Models not ready")))));
|
|
5234
5270
|
};
|
|
5235
5271
|
var timeSince = function timeSince(t) {
|
|
5236
5272
|
if (!t) return 0;
|
|
@@ -6269,15 +6305,8 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
6269
6305
|
_e = _a.debugMode,
|
|
6270
6306
|
debugMode = _e === void 0 ? false : _e;
|
|
6271
6307
|
var submissionStatus = useContext(SubmissionContext).submissionStatus;
|
|
6272
|
-
var idCardFront = capturedDocuments.idCardFront,
|
|
6273
|
-
idCardBack = capturedDocuments.idCardBack,
|
|
6274
|
-
passport = capturedDocuments.passport;
|
|
6275
6308
|
var verbiage = useTranslations(rawVerbiage, {
|
|
6276
6309
|
headingText: 'ID Capture Successful',
|
|
6277
|
-
idCardFrontText: 'ID Card Front',
|
|
6278
|
-
idCardBackText: 'ID Card Back',
|
|
6279
|
-
passportText: 'Passport',
|
|
6280
|
-
instructionText: 'Verify the entire ID was captured clearly with no glare.',
|
|
6281
6310
|
retryText: 'Retry',
|
|
6282
6311
|
submittingText: 'Submitting...',
|
|
6283
6312
|
submitText: 'Done'
|
|
@@ -6294,25 +6323,16 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
6294
6323
|
className: classNames.imageContainer
|
|
6295
6324
|
}, /*#__PURE__*/React__default.createElement(ImageRow, {
|
|
6296
6325
|
className: classNames.imageRow
|
|
6297
|
-
},
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
className: classNames.image,
|
|
6308
|
-
alt: verbiage.idCardBackText
|
|
6309
|
-
}), debugMode && ( /*#__PURE__*/React__default.createElement(DebugPre, null, "Detection Score: ".concat(idCardBack.detectionScore, "\nFocus Score: ").concat(idCardBack.focusScore, "\nBounding Box: ").concat(JSON.stringify(idCardBack.boundingBox)))))), passport && ( /*#__PURE__*/React__default.createElement(ImageCol$1, {
|
|
6310
|
-
className: classNames.imageCol
|
|
6311
|
-
}, /*#__PURE__*/React__default.createElement(StyledImage, {
|
|
6312
|
-
image: passport,
|
|
6313
|
-
className: classNames.image,
|
|
6314
|
-
alt: verbiage.passportText
|
|
6315
|
-
}), debugMode && ( /*#__PURE__*/React__default.createElement(DebugPre, null, "Detection Score: ".concat(passport.detectionScore, "\nFocus Score: ").concat(passport.focusScore, "\nBounding Box: ").concat(JSON.stringify(passport.boundingBox)))))))), /*#__PURE__*/React__default.createElement(ButtonsColumn, {
|
|
6326
|
+
}, Object.values(capturedDocuments).map(function (doc) {
|
|
6327
|
+
return /*#__PURE__*/React__default.createElement(ImageCol$1, {
|
|
6328
|
+
className: classNames.imageCol,
|
|
6329
|
+
key: doc.imageData
|
|
6330
|
+
}, /*#__PURE__*/React__default.createElement(StyledImage, {
|
|
6331
|
+
image: doc,
|
|
6332
|
+
className: classNames.image,
|
|
6333
|
+
alt: doc.documentType
|
|
6334
|
+
}), debugMode && ( /*#__PURE__*/React__default.createElement(DebugPre, null, "Document Type: ".concat(doc.documentType, "\nDetection Score: ").concat(doc.detectionScore, "\nFocus Score: ").concat(doc.focusScore, "\nBounding Box: ").concat(JSON.stringify(doc.boundingBox)))));
|
|
6335
|
+
}))), /*#__PURE__*/React__default.createElement(ButtonsColumn, {
|
|
6316
6336
|
className: classNames.buttonsRow
|
|
6317
6337
|
}, /*#__PURE__*/React__default.createElement(WideButton, {
|
|
6318
6338
|
className: classNames.submitBtn,
|
|
@@ -6331,7 +6351,7 @@ var IdCaptureSuccess = function IdCaptureSuccess(_a) {
|
|
|
6331
6351
|
};
|
|
6332
6352
|
var Heading$a = styled.h1(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"], ["\n font-size: 1.5rem;\n margin-top: 0;\n margin-bottom: 1.5rem;\n"])));
|
|
6333
6353
|
var ImagesContainer = styled(OverlayImageContainer)(templateObject_2$q || (templateObject_2$q = __makeTemplateObject(["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"], ["\n flex-grow: 1;\n overflow-y: auto;\n padding-bottom: 0;\n max-width: 100%;\n"])));
|
|
6334
|
-
var ImageRow = styled(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n
|
|
6354
|
+
var ImageRow = styled(OverlayImageRow)(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n"], ["\n max-width: 100%;\n flex-direction: column;\n display: grid;\n grid-gap: 12px;\n"])));
|
|
6335
6355
|
var ImageCol$1 = styled.div(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n width: 100%;\n max-height: none !important;\n"], ["\n width: 100%;\n max-height: none !important;\n"])));
|
|
6336
6356
|
var StyledImage = styled(CapturedDocumentImg)(templateObject_5$9 || (templateObject_5$9 = __makeTemplateObject(["\n width: 100%;\n border-radius: 12px;\n"], ["\n width: 100%;\n border-radius: 12px;\n"])));
|
|
6337
6357
|
var DebugPre = styled.pre(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject(["\n text-align: left;\n max-width: min(450px, 100dvw - 100px);\n overflow-x: auto;\n"], ["\n text-align: left;\n max-width: min(450px, 100dvw - 100px);\n overflow-x: auto;\n"])));
|
|
@@ -8039,8 +8059,8 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8039
8059
|
var _j = useState(silentFallback),
|
|
8040
8060
|
useFallback = _j[0],
|
|
8041
8061
|
setUseFallback = _j[1];
|
|
8042
|
-
var
|
|
8043
|
-
var
|
|
8062
|
+
var minImageCount = minImageCountForIdCaptureRequirementOption(idCaptureRequirement);
|
|
8063
|
+
var maxImageCount = maxImageCountForIdCaptureRequirementOption(idCaptureRequirement);
|
|
8044
8064
|
var _k = useFileState(),
|
|
8045
8065
|
rawFile = _k.rawFile,
|
|
8046
8066
|
fileInputOnChange = _k.fileInputOnChange;
|
|
@@ -8053,7 +8073,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8053
8073
|
var whatToCapture = idCaptureRequirement === 'idCard' ? 'ID card' : idCaptureRequirement === 'passport' ? 'passport' : idCaptureRequirement === 'idCardOrPassport' ? 'ID card or passport' : 'ID card and passport';
|
|
8054
8074
|
var firstInstructionText = idCaptureRequirement === 'idCard' || idCaptureRequirement === 'idCardAndPassport' ? 'Please capture the front of your ID card.' : idCaptureRequirement === 'passport' ? 'Please capture the ID page of your passport.' : 'Please capture the front of your ID card, or the ID page of your passport.';
|
|
8055
8075
|
var secondInstructionText = idCaptureRequirement === 'idCardOrPassport' ? 'Please capture the back of your ID card, or click Done if submitting a passport.' : 'Please capture the back of your ID card.';
|
|
8056
|
-
var descriptionText = "On-device capture guidance failed, please capture ".concat(
|
|
8076
|
+
var descriptionText = "On-device capture guidance failed, please capture ".concat(minImageCount > 1 ? 'photos' : ' a photo', " of your ").concat(whatToCapture, " manually.");
|
|
8057
8077
|
var verbiage = useTranslations(rawVerbiage, {
|
|
8058
8078
|
headingText: "We're having some trouble.",
|
|
8059
8079
|
descriptionText: descriptionText,
|
|
@@ -8127,7 +8147,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8127
8147
|
alt: "",
|
|
8128
8148
|
className: classNames.image
|
|
8129
8149
|
}));
|
|
8130
|
-
}))), images.length <
|
|
8150
|
+
}))), images.length < minImageCount && ( /*#__PURE__*/React__default.createElement(Instruction, {
|
|
8131
8151
|
className: classNames.instruction
|
|
8132
8152
|
}, instructionText)), /*#__PURE__*/React__default.createElement("input", {
|
|
8133
8153
|
ref: fileInput,
|
|
@@ -8138,7 +8158,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8138
8158
|
hidden: true
|
|
8139
8159
|
}), /*#__PURE__*/React__default.createElement(StyledButtonsRow$8, {
|
|
8140
8160
|
className: classNames.buttonsRow
|
|
8141
|
-
}, images.length <
|
|
8161
|
+
}, images.length < maxImageCount && ( /*#__PURE__*/React__default.createElement(LoaderButton, {
|
|
8142
8162
|
variant: images.length > 0 ? 'secondary' : 'positive',
|
|
8143
8163
|
className: images.length > 0 ? classNames.captureMoreBtn : classNames.captureBtn,
|
|
8144
8164
|
colors: images.length > 0 ? colors.captureMoreBtn : colors.captureBtn,
|
|
@@ -8151,7 +8171,7 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
|
|
|
8151
8171
|
setDocumentToCapture(instructionText);
|
|
8152
8172
|
}
|
|
8153
8173
|
}
|
|
8154
|
-
}, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >=
|
|
8174
|
+
}, images.length > 0 ? verbiage.captureMoreBtnText : verbiage.captureBtnText)), images.length >= minImageCount && ( /*#__PURE__*/React__default.createElement(LoaderButton, {
|
|
8155
8175
|
variant: "positive",
|
|
8156
8176
|
className: classNames.doneBtn,
|
|
8157
8177
|
colors: colors.doneBtn,
|
|
@@ -8198,79 +8218,82 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8198
8218
|
precapturedDocuments = _a.precapturedDocuments,
|
|
8199
8219
|
_j = _a.captureRequirement,
|
|
8200
8220
|
captureRequirement = _j === void 0 ? 'idCardOrPassport' : _j,
|
|
8201
|
-
_k = _a.
|
|
8202
|
-
|
|
8203
|
-
_l = _a.
|
|
8204
|
-
|
|
8205
|
-
_m = _a.
|
|
8206
|
-
|
|
8221
|
+
_k = _a.allowSinglePageIdCapture,
|
|
8222
|
+
allowSinglePageIdCapture = _k === void 0 ? false : _k,
|
|
8223
|
+
_l = _a.separateIdCardCaptureSequence,
|
|
8224
|
+
separateIdCardCaptureSequence = _l === void 0 ? false : _l,
|
|
8225
|
+
_m = _a.thresholds,
|
|
8226
|
+
thresholds = _m === void 0 ? defaultIdCaptureThresholds : _m,
|
|
8227
|
+
_o = _a.skipSuccessScreen,
|
|
8228
|
+
skipSuccessScreen = _o === void 0 ? false : _o,
|
|
8207
8229
|
instructions = _a.instructions,
|
|
8208
|
-
|
|
8209
|
-
releaseCameraAccessOnExit =
|
|
8210
|
-
|
|
8211
|
-
guideType =
|
|
8212
|
-
|
|
8213
|
-
portraitGuidesOnMobile =
|
|
8214
|
-
|
|
8215
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
8216
|
-
|
|
8217
|
-
silentFallback =
|
|
8218
|
-
|
|
8219
|
-
forceFallbackMode =
|
|
8220
|
-
|
|
8221
|
-
allowIdCardBackToFrontCapture =
|
|
8222
|
-
|
|
8223
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
8224
|
-
|
|
8225
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
8226
|
-
|
|
8227
|
-
guideImages =
|
|
8228
|
-
|
|
8229
|
-
assets =
|
|
8230
|
-
|
|
8231
|
-
classNames =
|
|
8232
|
-
|
|
8233
|
-
colors =
|
|
8234
|
-
|
|
8235
|
-
verbiage =
|
|
8236
|
-
|
|
8237
|
-
debugMode =
|
|
8238
|
-
var
|
|
8239
|
-
state =
|
|
8240
|
-
dispatch =
|
|
8241
|
-
var
|
|
8242
|
-
cameraAccessDenied =
|
|
8243
|
-
requestCameraAccess =
|
|
8244
|
-
releaseCameraAccess =
|
|
8245
|
-
var
|
|
8246
|
-
overlayDismissed =
|
|
8247
|
-
setOverlayDismissed =
|
|
8248
|
-
var
|
|
8249
|
-
submissionStatus =
|
|
8250
|
-
setIdFrontImage =
|
|
8251
|
-
setIdBackImage =
|
|
8252
|
-
setPassportImage =
|
|
8253
|
-
logIdFrontCaptureAttempt =
|
|
8254
|
-
logIdBackCaptureAttempt =
|
|
8255
|
-
var
|
|
8256
|
-
start =
|
|
8257
|
-
stop =
|
|
8258
|
-
onPredictionMade =
|
|
8259
|
-
setRequiredDocumentType =
|
|
8260
|
-
modelError =
|
|
8261
|
-
resetBestFrame =
|
|
8230
|
+
_p = _a.releaseCameraAccessOnExit,
|
|
8231
|
+
releaseCameraAccessOnExit = _p === void 0 ? true : _p,
|
|
8232
|
+
_q = _a.guideType,
|
|
8233
|
+
guideType = _q === void 0 ? 'fit' : _q,
|
|
8234
|
+
_r = _a.portraitGuidesOnMobile,
|
|
8235
|
+
portraitGuidesOnMobile = _r === void 0 ? true : _r,
|
|
8236
|
+
_s = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
8237
|
+
rotateLoadingOverlayImageWhenPortrait = _s === void 0 ? true : _s,
|
|
8238
|
+
_t = _a.silentFallback,
|
|
8239
|
+
silentFallback = _t === void 0 ? false : _t,
|
|
8240
|
+
_u = _a.forceFallbackMode,
|
|
8241
|
+
forceFallbackMode = _u === void 0 ? false : _u,
|
|
8242
|
+
_v = _a.allowIdCardBackToFrontCapture,
|
|
8243
|
+
allowIdCardBackToFrontCapture = _v === void 0 ? false : _v,
|
|
8244
|
+
_w = _a.enableOverrideWrongDocumentTypeDialog,
|
|
8245
|
+
enableOverrideWrongDocumentTypeDialog = _w === void 0 ? false : _w,
|
|
8246
|
+
_x = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
8247
|
+
allowOverrideWrongDocumentTypeAfterMs = _x === void 0 ? 8000 : _x,
|
|
8248
|
+
_y = _a.guideImages,
|
|
8249
|
+
guideImages = _y === void 0 ? defaultIdCaptureGuideImages : _y,
|
|
8250
|
+
_z = _a.assets,
|
|
8251
|
+
assets = _z === void 0 ? {} : _z,
|
|
8252
|
+
_0 = _a.classNames,
|
|
8253
|
+
classNames = _0 === void 0 ? {} : _0,
|
|
8254
|
+
_1 = _a.colors,
|
|
8255
|
+
colors = _1 === void 0 ? {} : _1,
|
|
8256
|
+
_2 = _a.verbiage,
|
|
8257
|
+
verbiage = _2 === void 0 ? {} : _2,
|
|
8258
|
+
_3 = _a.debugMode,
|
|
8259
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
8260
|
+
var _4 = useIdCaptureState(),
|
|
8261
|
+
state = _4[0],
|
|
8262
|
+
dispatch = _4[1];
|
|
8263
|
+
var _5 = useCameraStore(),
|
|
8264
|
+
cameraAccessDenied = _5.cameraAccessDenied,
|
|
8265
|
+
requestCameraAccess = _5.requestCameraAccess,
|
|
8266
|
+
releaseCameraAccess = _5.releaseCameraAccess;
|
|
8267
|
+
var _6 = useState(false),
|
|
8268
|
+
overlayDismissed = _6[0],
|
|
8269
|
+
setOverlayDismissed = _6[1];
|
|
8270
|
+
var _7 = useContext(SubmissionContext),
|
|
8271
|
+
submissionStatus = _7.submissionStatus,
|
|
8272
|
+
setIdFrontImage = _7.setIdFrontImage,
|
|
8273
|
+
setIdBackImage = _7.setIdBackImage,
|
|
8274
|
+
setPassportImage = _7.setPassportImage,
|
|
8275
|
+
logIdFrontCaptureAttempt = _7.logIdFrontCaptureAttempt,
|
|
8276
|
+
logIdBackCaptureAttempt = _7.logIdBackCaptureAttempt;
|
|
8277
|
+
var _8 = useContext(IdCaptureModelsContext),
|
|
8278
|
+
start = _8.start,
|
|
8279
|
+
stop = _8.stop,
|
|
8280
|
+
onPredictionMade = _8.onPredictionMade,
|
|
8281
|
+
setRequiredDocumentType = _8.setRequiredDocumentType,
|
|
8282
|
+
modelError = _8.modelError,
|
|
8283
|
+
resetBestFrame = _8.resetBestFrame;
|
|
8262
8284
|
useEffect(function () {
|
|
8263
8285
|
dispatch({
|
|
8264
8286
|
type: 'configureWizard',
|
|
8265
8287
|
payload: {
|
|
8266
8288
|
captureRequirement: captureRequirement,
|
|
8267
8289
|
precapturedDocuments: precapturedDocuments,
|
|
8290
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture,
|
|
8268
8291
|
allowIdCardBackToFrontCapture: allowIdCardBackToFrontCapture,
|
|
8269
8292
|
enableOverrideWrongDocumentTypeDialog: enableOverrideWrongDocumentTypeDialog,
|
|
8270
8293
|
allowOverrideWrongDocumentTypeAfterMs: allowOverrideWrongDocumentTypeAfterMs
|
|
8271
8294
|
}
|
|
8272
8295
|
});
|
|
8273
|
-
}, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
|
|
8296
|
+
}, [allowIdCardBackToFrontCapture, allowOverrideWrongDocumentTypeAfterMs, allowSinglePageIdCapture, captureRequirement, dispatch, enableOverrideWrongDocumentTypeDialog, precapturedDocuments]);
|
|
8274
8297
|
var documentCount = Object.keys(state.capturedDocuments).length;
|
|
8275
8298
|
useEffect(function () {
|
|
8276
8299
|
documentCount && resetBestFrame();
|
|
@@ -8328,13 +8351,16 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8328
8351
|
var _a = state.capturedDocuments,
|
|
8329
8352
|
idCardFront = _a.idCardFront,
|
|
8330
8353
|
idCardBack = _a.idCardBack,
|
|
8331
|
-
passport = _a.passport
|
|
8354
|
+
passport = _a.passport,
|
|
8355
|
+
singlePage = _a.singlePage;
|
|
8332
8356
|
var idFrontImage = idCardFront && dataUrlToBase64Sync(idCardFront.imageData);
|
|
8333
8357
|
var idBackImage = idCardBack && dataUrlToBase64Sync(idCardBack.imageData);
|
|
8334
8358
|
var passportImage = passport && dataUrlToBase64Sync(passport.imageData);
|
|
8359
|
+
var singlePageImage = singlePage && dataUrlToBase64Sync(singlePage.imageData);
|
|
8335
8360
|
idFrontImage && setIdFrontImage(idFrontImage);
|
|
8336
8361
|
idBackImage && setIdBackImage(idBackImage);
|
|
8337
8362
|
passportImage && setPassportImage(passportImage);
|
|
8363
|
+
singlePageImage && setIdFrontImage(singlePageImage);
|
|
8338
8364
|
releaseCameraAccessOnExit && releaseCameraAccess();
|
|
8339
8365
|
setTimeout(function () {
|
|
8340
8366
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess({
|
|
@@ -8350,9 +8376,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8350
8376
|
type: 'resetWizard'
|
|
8351
8377
|
});
|
|
8352
8378
|
}, [dispatch]);
|
|
8353
|
-
var
|
|
8354
|
-
attempt =
|
|
8355
|
-
setAttempt =
|
|
8379
|
+
var _9 = useState(0),
|
|
8380
|
+
attempt = _9[0],
|
|
8381
|
+
setAttempt = _9[1];
|
|
8356
8382
|
var onExit = useCallback(function () {
|
|
8357
8383
|
releaseCameraAccess();
|
|
8358
8384
|
setOverlayDismissed(false);
|
|
@@ -8443,9 +8469,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
8443
8469
|
});
|
|
8444
8470
|
});
|
|
8445
8471
|
}, [dispatch]);
|
|
8446
|
-
var
|
|
8447
|
-
progressStarted =
|
|
8448
|
-
setProgressStarted =
|
|
8472
|
+
var _10 = useState(false),
|
|
8473
|
+
progressStarted = _10[0],
|
|
8474
|
+
setProgressStarted = _10[1];
|
|
8449
8475
|
useEffect(function () {
|
|
8450
8476
|
if (state.captureState === 'capturing') {
|
|
8451
8477
|
setProgressStarted(false);
|
|
@@ -11969,7 +11995,8 @@ var defaultVideoIdCaptureThresholds = {
|
|
|
11969
11995
|
detection: {
|
|
11970
11996
|
idCardFront: 0.4,
|
|
11971
11997
|
idCardBack: 0.5,
|
|
11972
|
-
passport: 0.3
|
|
11998
|
+
passport: 0.3,
|
|
11999
|
+
singlePage: 0.3
|
|
11973
12000
|
},
|
|
11974
12001
|
focus: {
|
|
11975
12002
|
idCardFront: {
|
|
@@ -11983,12 +12010,17 @@ var defaultVideoIdCaptureThresholds = {
|
|
|
11983
12010
|
passport: {
|
|
11984
12011
|
desktop: 0,
|
|
11985
12012
|
mobile: 0
|
|
12013
|
+
},
|
|
12014
|
+
singlePage: {
|
|
12015
|
+
desktop: 0,
|
|
12016
|
+
mobile: 0
|
|
11986
12017
|
}
|
|
11987
12018
|
},
|
|
11988
12019
|
goodFrames: {
|
|
11989
12020
|
idCardFront: 1,
|
|
11990
12021
|
idCardBack: 1,
|
|
11991
|
-
passport: 1
|
|
12022
|
+
passport: 1,
|
|
12023
|
+
singlePage: 1
|
|
11992
12024
|
},
|
|
11993
12025
|
flipShortcutThreshold: 0.7
|
|
11994
12026
|
};
|
|
@@ -12060,6 +12092,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12060
12092
|
stopIdModels = _18.stop,
|
|
12061
12093
|
onIdPredictionMade = _18.onPredictionMade,
|
|
12062
12094
|
setThresholds = _18.setThresholds,
|
|
12095
|
+
setRequiredDocumentType = _18.setRequiredDocumentType,
|
|
12063
12096
|
setDocumentDetectionBoundaries = _18.setDocumentDetectionBoundaries,
|
|
12064
12097
|
bestFrameDetails = _18.bestFrameDetails,
|
|
12065
12098
|
resetBestFrame = _18.resetBestFrame,
|
|
@@ -12138,6 +12171,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12138
12171
|
useEffect(function () {
|
|
12139
12172
|
setThresholds(adjustedThresholds);
|
|
12140
12173
|
}, [requestedAction, setThresholds, adjustedThresholds]);
|
|
12174
|
+
useEffect(function () {
|
|
12175
|
+
setRequiredDocumentType(requestedAction === 'SHOW_PASSPORT' ? 'passport' : requestedAction === 'SHOW_ID_BACK' ? 'idCardBack' : 'idCardFront');
|
|
12176
|
+
}, [requestedAction, setRequiredDocumentType]);
|
|
12141
12177
|
useEffect(function () {
|
|
12142
12178
|
setDocumentDetectionBoundaries({
|
|
12143
12179
|
top: 20,
|
|
@@ -12160,6 +12196,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12160
12196
|
setGoodFramesCount = _28[1];
|
|
12161
12197
|
var goodFramesThreshold = requestedAction === 'SHOW_PASSPORT' ? adjustedThresholds.goodFrames.passport : requestedAction === 'SHOW_ID_FRONT' ? adjustedThresholds.goodFrames.idCardFront : adjustedThresholds.goodFrames.idCardBack;
|
|
12162
12198
|
var goodFramesThresholdMet = goodFramesCount >= goodFramesThreshold;
|
|
12199
|
+
var _29 = useState(false),
|
|
12200
|
+
isSinglePage = _29[0],
|
|
12201
|
+
setIsSinglePage = _29[1];
|
|
12163
12202
|
useEffect(function () {
|
|
12164
12203
|
if (!idCaptureModelsEnabled || idModelError) return;
|
|
12165
12204
|
onIdPredictionMade(function (prediction) {
|
|
@@ -12167,7 +12206,8 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12167
12206
|
setCurrentDetectionScore(prediction.detectionScore);
|
|
12168
12207
|
setCurrentDetectedDocumentType(prediction.detectedDocumentType);
|
|
12169
12208
|
setCurrentFocusScore(prediction.focusScore);
|
|
12170
|
-
|
|
12209
|
+
setIsSinglePage(prediction.singlePageDetectionThresholdMet);
|
|
12210
|
+
var detectionThresholdMet = requestedAction === 'SHOW_PASSPORT' ? prediction.passportDetectionThresholdMet : requestedAction === 'SHOW_ID_BACK' ? prediction.idCardBackDetectionThresholdMet : prediction.idCardFrontDetectionThresholdMet || prediction.singlePageDetectionThresholdMet;
|
|
12171
12211
|
var isGoodFrame = detectionThresholdMet && prediction.focusThresholdMet;
|
|
12172
12212
|
var shouldShortcutFlipAnimation = requestedAction === 'FLIP_ID' && isGoodFrame && prediction.idCardBackDetectionScore >= adjustedThresholds.flipShortcutThreshold;
|
|
12173
12213
|
if (shouldShortcutFlipAnimation) {
|
|
@@ -12178,9 +12218,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12178
12218
|
} : 0);
|
|
12179
12219
|
});
|
|
12180
12220
|
}, [idCaptureModelsEnabled, onIdPredictionMade, idModelError, requestedAction, adjustedThresholds.flipShortcutThreshold]);
|
|
12181
|
-
var
|
|
12182
|
-
idFrontCaptureStartedAt =
|
|
12183
|
-
setFirstGoodFrameTime =
|
|
12221
|
+
var _30 = useState(null),
|
|
12222
|
+
idFrontCaptureStartedAt = _30[0],
|
|
12223
|
+
setFirstGoodFrameTime = _30[1];
|
|
12184
12224
|
useEffect(function () {
|
|
12185
12225
|
if (goodFramesCount === 1) setFirstGoodFrameTime(new Date().getTime());
|
|
12186
12226
|
}, [goodFramesCount]);
|
|
@@ -12201,80 +12241,60 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12201
12241
|
var frameHeight = (_e = (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) !== null && _e !== void 0 ? _e : 0;
|
|
12202
12242
|
var faceBox = face === null || face === void 0 ? void 0 : face.box;
|
|
12203
12243
|
var faceCentered = !faceBox || !frameWidth || faceBox.xMin > frameWidth * edgeBoundary && faceBox.yMin > frameHeight * edgeBoundary && faceBox.xMax < frameWidth * (1 - edgeBoundary) && faceBox.yMax < frameHeight * (1 - edgeBoundary);
|
|
12204
|
-
var
|
|
12205
|
-
countdownStartedAt =
|
|
12206
|
-
setCountdownStartedAt =
|
|
12244
|
+
var _31 = useState(),
|
|
12245
|
+
countdownStartedAt = _31[0],
|
|
12246
|
+
setCountdownStartedAt = _31[1];
|
|
12207
12247
|
var photoCanvas = useRef(null);
|
|
12208
12248
|
var frameLock = useRef(false);
|
|
12209
12249
|
var captureFrame = useCallback(function () {
|
|
12210
12250
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
12211
|
-
var frameBase64
|
|
12212
|
-
return __generator(this, function (
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
_b.label = 1;
|
|
12224
|
-
case 1:
|
|
12225
|
-
_b.trys.push([1,, 7, 8]);
|
|
12226
|
-
if (!(requestedAction == 'SHOW_ID_FRONT')) return [3 /*break*/, 5];
|
|
12251
|
+
var frameBase64;
|
|
12252
|
+
return __generator(this, function (_a) {
|
|
12253
|
+
if (frameLock.current) return [2 /*return*/];
|
|
12254
|
+
frameLock.current = true;
|
|
12255
|
+
drawToCanvas(photoCanvas.current, videoRef.current);
|
|
12256
|
+
frameBase64 = photoCanvas.current.toDataURL('image/jpeg');
|
|
12257
|
+
if (!frameBase64) {
|
|
12258
|
+
frameLock.current = false;
|
|
12259
|
+
return [2 /*return*/];
|
|
12260
|
+
}
|
|
12261
|
+
try {
|
|
12262
|
+
if (requestedAction == 'SHOW_ID_FRONT') {
|
|
12227
12263
|
if (onIdFrontImageCaptured) {
|
|
12228
12264
|
onIdFrontImageCaptured(frameBase64);
|
|
12229
12265
|
}
|
|
12230
|
-
if (
|
|
12231
|
-
_a = skipShowIdCardBack === true;
|
|
12232
|
-
if (_a) return [3 /*break*/, 3];
|
|
12233
|
-
return [4 /*yield*/, skipShowIdCardBack()];
|
|
12234
|
-
case 2:
|
|
12235
|
-
_a = _b.sent();
|
|
12236
|
-
_b.label = 3;
|
|
12237
|
-
case 3:
|
|
12238
|
-
if (_a) {
|
|
12266
|
+
if (isSinglePage || evaluateShouldSkip(skipShowIdCardBack)) {
|
|
12239
12267
|
return [2 /*return*/, onIdCaptureComplete()];
|
|
12240
12268
|
}
|
|
12241
|
-
_b.label = 4;
|
|
12242
|
-
case 4:
|
|
12243
12269
|
setRequestedAction('FLIP_ID');
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
if (onIdBackImageCaptured) {
|
|
12248
|
-
onIdBackImageCaptured(frameBase64);
|
|
12249
|
-
}
|
|
12250
|
-
onIdCaptureComplete();
|
|
12251
|
-
} else if (requestedAction == 'SHOW_PASSPORT') {
|
|
12252
|
-
if (onIdFrontImageCaptured) {
|
|
12253
|
-
onIdFrontImageCaptured(frameBase64);
|
|
12254
|
-
}
|
|
12255
|
-
onIdCaptureComplete();
|
|
12270
|
+
} else if (requestedAction == 'SHOW_ID_BACK') {
|
|
12271
|
+
if (onIdBackImageCaptured) {
|
|
12272
|
+
onIdBackImageCaptured(frameBase64);
|
|
12256
12273
|
}
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
setDetectedObjects([]);
|
|
12262
|
-
setCurrentDetectionScore(0);
|
|
12263
|
-
setCurrentFocusScore(0);
|
|
12264
|
-
setGoodFramesCount(0);
|
|
12265
|
-
setCountdownStartedAt(undefined);
|
|
12266
|
-
resetBestFrame();
|
|
12267
|
-
frameLock.current = false;
|
|
12268
|
-
if (countdownTimeoutRef.current) {
|
|
12269
|
-
clearTimeout(countdownTimeoutRef.current);
|
|
12274
|
+
onIdCaptureComplete();
|
|
12275
|
+
} else if (requestedAction == 'SHOW_PASSPORT') {
|
|
12276
|
+
if (onIdFrontImageCaptured) {
|
|
12277
|
+
onIdFrontImageCaptured(frameBase64);
|
|
12270
12278
|
}
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12279
|
+
onIdCaptureComplete();
|
|
12280
|
+
}
|
|
12281
|
+
} finally {
|
|
12282
|
+
setDetectedObjects([]);
|
|
12283
|
+
setCurrentDetectionScore(0);
|
|
12284
|
+
setCurrentFocusScore(0);
|
|
12285
|
+
setGoodFramesCount(0);
|
|
12286
|
+
setCountdownStartedAt(undefined);
|
|
12287
|
+
setIsSinglePage(false);
|
|
12288
|
+
resetBestFrame();
|
|
12289
|
+
frameLock.current = false;
|
|
12290
|
+
if (countdownTimeoutRef.current) {
|
|
12291
|
+
clearTimeout(countdownTimeoutRef.current);
|
|
12292
|
+
}
|
|
12274
12293
|
}
|
|
12294
|
+
return [2 /*return*/];
|
|
12275
12295
|
});
|
|
12276
12296
|
});
|
|
12277
|
-
}, [
|
|
12297
|
+
}, [videoRef, requestedAction, onIdFrontImageCaptured, isSinglePage, skipShowIdCardBack, onIdCaptureComplete, onIdBackImageCaptured, resetBestFrame]);
|
|
12278
12298
|
var isFlipping = requestedAction === 'FLIP_ID';
|
|
12279
12299
|
useEffect(function () {
|
|
12280
12300
|
if (!isFlipping) return;
|
|
@@ -12333,9 +12353,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12333
12353
|
stopSelfieGuidance();
|
|
12334
12354
|
};
|
|
12335
12355
|
}, [startSelfieGuidance, stopSelfieGuidance]);
|
|
12336
|
-
var
|
|
12337
|
-
numFramesWithoutFaces =
|
|
12338
|
-
setNumFramesWithoutFaces =
|
|
12356
|
+
var _32 = useState(0),
|
|
12357
|
+
numFramesWithoutFaces = _32[0],
|
|
12358
|
+
setNumFramesWithoutFaces = _32[1];
|
|
12339
12359
|
onSelfiePredictionMade(useThrottledCallback(useCallback(function (_a) {
|
|
12340
12360
|
var face = _a.face;
|
|
12341
12361
|
if (selfieModelError) return;
|
|
@@ -12351,12 +12371,12 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
12351
12371
|
}
|
|
12352
12372
|
}, [disableFaceDetectionWhileAudioCapture, disableFaceDetectionWhileAudioCaptureMsDelay, numFramesWithoutFaces, onFaceNotDetected, timeoutStartedAt]);
|
|
12353
12373
|
var theme = useTheme();
|
|
12354
|
-
var
|
|
12374
|
+
var _33 = useTranslations(rawVerbiage, {
|
|
12355
12375
|
faceNotCenteredText: 'Please move your face to the center...',
|
|
12356
12376
|
captureBtnText: 'Capture'
|
|
12357
12377
|
}),
|
|
12358
|
-
captureBtnText =
|
|
12359
|
-
faceNotCenteredText =
|
|
12378
|
+
captureBtnText = _33.captureBtnText,
|
|
12379
|
+
faceNotCenteredText = _33.faceNotCenteredText;
|
|
12360
12380
|
var debugScalingDetails = useDebugScalingDetails({
|
|
12361
12381
|
enabled: debugMode,
|
|
12362
12382
|
pageWidth: width,
|
|
@@ -12431,6 +12451,11 @@ var CountdownContainer = styled.div(templateObject_1$5 || (templateObject_1$5 =
|
|
|
12431
12451
|
var Countdown = styled.div(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"], ["\n color: white;\n font-size: 64px;\n font-weight: bold;\n margin: auto;\n"])));
|
|
12432
12452
|
var CaptureButtonContainer = styled.div(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"], ["\n position: fixed;\n bottom: 0;\n width: 100dvw;\n display: flex;\n z-index: 100000;\n"])));
|
|
12433
12453
|
var CaptureButton = styled(LoaderButton)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin: 0 auto 25px;\n"], ["\n margin: 0 auto 25px;\n"])));
|
|
12454
|
+
function evaluateShouldSkip(value) {
|
|
12455
|
+
if (value === true) return true;
|
|
12456
|
+
if (typeof value === 'function') return value();
|
|
12457
|
+
return false;
|
|
12458
|
+
}
|
|
12434
12459
|
var templateObject_1$5, templateObject_2$5, templateObject_3$5, templateObject_4;
|
|
12435
12460
|
|
|
12436
12461
|
var IdVideoCaptureSuccess = function IdVideoCaptureSuccess(_a) {
|
|
@@ -12583,7 +12608,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12583
12608
|
customOverlayContent = _a.customOverlayContent,
|
|
12584
12609
|
onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
|
|
12585
12610
|
_u = _a.idDocumentType,
|
|
12586
|
-
idDocumentType = _u === void 0 ? '
|
|
12611
|
+
idDocumentType = _u === void 0 ? 'idCardOrPassport' : _u,
|
|
12587
12612
|
_v = _a.idCaptureGuideType,
|
|
12588
12613
|
idCaptureGuideType = _v === void 0 ? 'fit' : _v,
|
|
12589
12614
|
_w = _a.idCaptureGuideImages,
|
|
@@ -12615,6 +12640,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12615
12640
|
_9 = _a.debugMode,
|
|
12616
12641
|
debugMode = _9 === void 0 ? false : _9;
|
|
12617
12642
|
var _10 = useContext(SubmissionContext),
|
|
12643
|
+
passportImage = _10.passportImage,
|
|
12618
12644
|
submissionStatus = _10.submissionStatus,
|
|
12619
12645
|
idCaptureVideoUrl = _10.idCaptureVideoUrl,
|
|
12620
12646
|
idCaptureVideoAudioUrl = _10.idCaptureVideoAudioUrl,
|
|
@@ -12690,6 +12716,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12690
12716
|
});
|
|
12691
12717
|
onExitCapture === null || onExitCapture === void 0 ? void 0 : onExitCapture();
|
|
12692
12718
|
}, [onExitCapture]);
|
|
12719
|
+
var capturedIdDocumentType = idDocumentType !== 'idCardOrPassport' ? idDocumentType : passportImage ? 'passport' : 'idCard';
|
|
12693
12720
|
var faceLivenessGuides = useCallback(function (_a) {
|
|
12694
12721
|
var _b, _c, _d, _e;
|
|
12695
12722
|
var status = _a.status;
|
|
@@ -12698,12 +12725,12 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12698
12725
|
verbiage: (_c = verbiage.idVideoCapture) === null || _c === void 0 ? void 0 : _c.guides,
|
|
12699
12726
|
requestedAction: "VERIFY_LIVENESS",
|
|
12700
12727
|
idCaptureGuideImages: idCaptureGuideImages,
|
|
12701
|
-
idDocumentType:
|
|
12728
|
+
idDocumentType: capturedIdDocumentType,
|
|
12702
12729
|
faceGuideStatus: status,
|
|
12703
12730
|
faceGuideBorderColor: status === 'success' ? (_d = colors.idVideoCapture) === null || _d === void 0 ? void 0 : _d.guidesSatisfiedColor : (_e = colors.idVideoCapture) === null || _e === void 0 ? void 0 : _e.guidesUnsatisfiedColor,
|
|
12704
12731
|
idCardGuideStatus: "disabled"
|
|
12705
12732
|
});
|
|
12706
|
-
}, [(_b = classNames.idVideoCapture) === null || _b === void 0 ? void 0 : _b.guides, (_c = colors.idVideoCapture) === null || _c === void 0 ? void 0 : _c.guidesSatisfiedColor, (_d = colors.idVideoCapture) === null || _d === void 0 ? void 0 : _d.guidesUnsatisfiedColor, idCaptureGuideImages, (_e = verbiage.idVideoCapture) === null || _e === void 0 ? void 0 : _e.guides]);
|
|
12733
|
+
}, [capturedIdDocumentType, (_b = classNames.idVideoCapture) === null || _b === void 0 ? void 0 : _b.guides, (_c = colors.idVideoCapture) === null || _c === void 0 ? void 0 : _c.guidesSatisfiedColor, (_d = colors.idVideoCapture) === null || _d === void 0 ? void 0 : _d.guidesUnsatisfiedColor, idCaptureGuideImages, (_e = verbiage.idVideoCapture) === null || _e === void 0 ? void 0 : _e.guides]);
|
|
12707
12734
|
if (submissionStatus === SubmissionStatus.SUBMITTING) {
|
|
12708
12735
|
return /*#__PURE__*/React__default.createElement(PageContainer, {
|
|
12709
12736
|
className: "flex"
|
|
@@ -12722,7 +12749,8 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12722
12749
|
documentDetectionModelUrl: (_g = (_f = idCaptureProps.assets) === null || _f === void 0 ? void 0 : _f.documentDetectionModelUrl) !== null && _g !== void 0 ? _g : '',
|
|
12723
12750
|
focusModelUrl: (_j = (_h = idCaptureProps.assets) === null || _h === void 0 ? void 0 : _h.focusModelUrl) !== null && _j !== void 0 ? _j : '',
|
|
12724
12751
|
onModelError: onIdCaptureModelError,
|
|
12725
|
-
modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs
|
|
12752
|
+
modelLoadTimeoutMs: idCaptureModelLoadTimeoutMs,
|
|
12753
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
12726
12754
|
}, /*#__PURE__*/React__default.createElement(SelfieGuidanceModelsProvider, {
|
|
12727
12755
|
autoStart: false,
|
|
12728
12756
|
onModelError: faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onModelError,
|
|
@@ -12793,7 +12821,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
12793
12821
|
onExitCapture: handleExitCapture,
|
|
12794
12822
|
idCaptureModelsEnabled: idCaptureModelsEnabled,
|
|
12795
12823
|
idCaptureGuideImages: idCaptureGuideImages,
|
|
12796
|
-
idDocumentType:
|
|
12824
|
+
idDocumentType: capturedIdDocumentType,
|
|
12797
12825
|
videoIdCaptureThresholds: videoIdCaptureThresholds,
|
|
12798
12826
|
skipShowIdCardBack: skipShowIdCardBack,
|
|
12799
12827
|
disableFaceDetectionWhileAudioCapture: disableFaceDetectionWhileAudioCapture,
|
|
@@ -12972,7 +13000,8 @@ function CompositeWizard(_a) {
|
|
|
12972
13000
|
documentDetectionModelUrl: (_d = (_c = idCaptureProps.assets) === null || _c === void 0 ? void 0 : _c.documentDetectionModelUrl) !== null && _d !== void 0 ? _d : '',
|
|
12973
13001
|
focusModelUrl: (_f = (_e = idCaptureProps.assets) === null || _e === void 0 ? void 0 : _e.focusModelUrl) !== null && _f !== void 0 ? _f : '',
|
|
12974
13002
|
onModelError: idCaptureProps.onModelError,
|
|
12975
|
-
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs
|
|
13003
|
+
modelLoadTimeoutMs: idCaptureProps.modelLoadTimeoutMs,
|
|
13004
|
+
allowSinglePageIdCapture: idCaptureProps.allowSinglePageIdCapture
|
|
12976
13005
|
}, /*#__PURE__*/React__default.createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__default.createElement(GuideOrientationContextProvider, null, /*#__PURE__*/React__default.createElement(IdCaptureWizard, _assign({}, idCaptureProps, {
|
|
12977
13006
|
onSuccess: onIdCaptureSuccess
|
|
12978
13007
|
}))))));
|
|
@@ -13294,31 +13323,33 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13294
13323
|
onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
|
|
13295
13324
|
_d = _a.idCaptureRequirement,
|
|
13296
13325
|
idCaptureRequirement = _d === void 0 ? 'idCardOrPassport' : _d,
|
|
13297
|
-
_e = _a.
|
|
13298
|
-
|
|
13299
|
-
_f = _a.
|
|
13300
|
-
|
|
13301
|
-
_g = _a.
|
|
13302
|
-
|
|
13326
|
+
_e = _a.allowSinglePageIdCapture,
|
|
13327
|
+
allowSinglePageIdCapture = _e === void 0 ? false : _e,
|
|
13328
|
+
_f = _a.separateIdCardCaptureSequence,
|
|
13329
|
+
separateIdCardCaptureSequence = _f === void 0 ? false : _f,
|
|
13330
|
+
_g = _a.idCaptureThresholds,
|
|
13331
|
+
idCaptureThresholds = _g === void 0 ? defaultIdCaptureThresholds : _g,
|
|
13332
|
+
_h = _a.skipSuccessScreen,
|
|
13333
|
+
skipSuccessScreen = _h === void 0 ? false : _h,
|
|
13303
13334
|
instructions = _a.instructions,
|
|
13304
|
-
|
|
13305
|
-
guideType =
|
|
13306
|
-
|
|
13307
|
-
guideImages =
|
|
13308
|
-
|
|
13309
|
-
portraitGuidesOnMobile =
|
|
13310
|
-
|
|
13311
|
-
rotateLoadingOverlayImageWhenPortrait =
|
|
13312
|
-
|
|
13313
|
-
modelLoadTimeoutMs =
|
|
13314
|
-
|
|
13315
|
-
forceFallbackMode =
|
|
13316
|
-
|
|
13317
|
-
allowIdCardBackToFrontCapture =
|
|
13318
|
-
|
|
13319
|
-
enableOverrideWrongDocumentTypeDialog =
|
|
13320
|
-
|
|
13321
|
-
allowOverrideWrongDocumentTypeAfterMs =
|
|
13335
|
+
_j = _a.guideType,
|
|
13336
|
+
guideType = _j === void 0 ? 'fit' : _j,
|
|
13337
|
+
_k = _a.guideImages,
|
|
13338
|
+
guideImages = _k === void 0 ? defaultIdCaptureGuideImages : _k,
|
|
13339
|
+
_l = _a.portraitGuidesOnMobile,
|
|
13340
|
+
portraitGuidesOnMobile = _l === void 0 ? true : _l,
|
|
13341
|
+
_m = _a.rotateLoadingOverlayImageWhenPortrait,
|
|
13342
|
+
rotateLoadingOverlayImageWhenPortrait = _m === void 0 ? true : _m,
|
|
13343
|
+
_o = _a.modelLoadTimeoutMs,
|
|
13344
|
+
modelLoadTimeoutMs = _o === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _o,
|
|
13345
|
+
_p = _a.forceFallbackMode,
|
|
13346
|
+
forceFallbackMode = _p === void 0 ? false : _p,
|
|
13347
|
+
_q = _a.allowIdCardBackToFrontCapture,
|
|
13348
|
+
allowIdCardBackToFrontCapture = _q === void 0 ? false : _q,
|
|
13349
|
+
_r = _a.enableOverrideWrongDocumentTypeDialog,
|
|
13350
|
+
enableOverrideWrongDocumentTypeDialog = _r === void 0 ? false : _r,
|
|
13351
|
+
_s = _a.allowOverrideWrongDocumentTypeAfterMs,
|
|
13352
|
+
allowOverrideWrongDocumentTypeAfterMs = _s === void 0 ? 8000 : _s,
|
|
13322
13353
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
13323
13354
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
13324
13355
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -13332,28 +13363,28 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13332
13363
|
onUserCancel = _a.onUserCancel,
|
|
13333
13364
|
onModelError = _a.onModelError,
|
|
13334
13365
|
onCameraAccessDenied = _a.onCameraAccessDenied,
|
|
13335
|
-
|
|
13336
|
-
theme =
|
|
13337
|
-
|
|
13338
|
-
assets =
|
|
13339
|
-
|
|
13340
|
-
classNames =
|
|
13341
|
-
|
|
13342
|
-
colors =
|
|
13343
|
-
|
|
13344
|
-
verbiage =
|
|
13345
|
-
|
|
13346
|
-
captureSignature =
|
|
13347
|
-
|
|
13348
|
-
captureSignatureVideo =
|
|
13349
|
-
|
|
13350
|
-
captureAdditionalDocuments =
|
|
13351
|
-
|
|
13352
|
-
geolocationEnabled =
|
|
13353
|
-
|
|
13354
|
-
geolocationRequired =
|
|
13355
|
-
|
|
13356
|
-
debugMode =
|
|
13366
|
+
_t = _a.theme,
|
|
13367
|
+
theme = _t === void 0 ? 'default' : _t,
|
|
13368
|
+
_u = _a.assets,
|
|
13369
|
+
assets = _u === void 0 ? {} : _u,
|
|
13370
|
+
_v = _a.classNames,
|
|
13371
|
+
classNames = _v === void 0 ? {} : _v,
|
|
13372
|
+
_w = _a.colors,
|
|
13373
|
+
colors = _w === void 0 ? {} : _w,
|
|
13374
|
+
_x = _a.verbiage,
|
|
13375
|
+
verbiage = _x === void 0 ? {} : _x,
|
|
13376
|
+
_y = _a.captureSignature,
|
|
13377
|
+
captureSignature = _y === void 0 ? false : _y,
|
|
13378
|
+
_z = _a.captureSignatureVideo,
|
|
13379
|
+
captureSignatureVideo = _z === void 0 ? false : _z,
|
|
13380
|
+
_0 = _a.captureAdditionalDocuments,
|
|
13381
|
+
captureAdditionalDocuments = _0 === void 0 ? [] : _0,
|
|
13382
|
+
_1 = _a.geolocationEnabled,
|
|
13383
|
+
geolocationEnabled = _1 === void 0 ? true : _1,
|
|
13384
|
+
_2 = _a.geolocationRequired,
|
|
13385
|
+
geolocationRequired = _2 === void 0 ? false : _2,
|
|
13386
|
+
_3 = _a.debugMode,
|
|
13387
|
+
debugMode = _3 === void 0 ? false : _3;
|
|
13357
13388
|
useLanguage(lang);
|
|
13358
13389
|
useDebugLogging(debugMode);
|
|
13359
13390
|
var idCaptureProps = useMemo(function () {
|
|
@@ -13363,6 +13394,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13363
13394
|
onModelError: onModelError,
|
|
13364
13395
|
precapturedDocuments: precapturedDocuments,
|
|
13365
13396
|
captureRequirement: idCaptureRequirement,
|
|
13397
|
+
allowSinglePageIdCapture: allowSinglePageIdCapture,
|
|
13366
13398
|
separateIdCardCaptureSequence: separateIdCardCaptureSequence,
|
|
13367
13399
|
thresholds: idCaptureThresholds,
|
|
13368
13400
|
skipSuccessScreen: skipSuccessScreen,
|
|
@@ -13385,7 +13417,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
13385
13417
|
verbiage: verbiage,
|
|
13386
13418
|
debugMode: debugMode
|
|
13387
13419
|
};
|
|
13388
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
|
|
13420
|
+
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
|
|
13389
13421
|
var additionalDocumentCaptureProps = useMemo(function () {
|
|
13390
13422
|
return {
|
|
13391
13423
|
documents: captureAdditionalDocuments,
|
|
@@ -15344,7 +15376,7 @@ var VideoIdValidation = function VideoIdValidation(_a) {
|
|
|
15344
15376
|
idCaptureRotateLoadingOverlayImageWhenPortrait = _p === void 0 ? true : _p,
|
|
15345
15377
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
15346
15378
|
_q = _a.idDocumentType,
|
|
15347
|
-
idDocumentType = _q === void 0 ? '
|
|
15379
|
+
idDocumentType = _q === void 0 ? 'idCardOrPassport' : _q,
|
|
15348
15380
|
_r = _a.faceLivenessLoadingOverlayMode,
|
|
15349
15381
|
faceLivenessLoadingOverlayMode = _r === void 0 ? 'default' : _r,
|
|
15350
15382
|
_s = _a.disableFaceDetectionWhileAudioCapture,
|