idmission-web-sdk 0.0.37 → 0.0.39
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 +30 -1
- package/dist/components/common/GuidanceMessage.d.ts +5 -261
- package/dist/components/customer_flows/CustomerBiometricsEnrollment.d.ts +3 -2
- package/dist/components/customer_flows/CustomerIdAndBiometricsEnrollment.d.ts +5 -2
- package/dist/components/customer_flows/CustomerIdentification.d.ts +3 -2
- package/dist/components/customer_flows/CustomerVerification.d.ts +3 -2
- package/dist/components/customer_flows/FaceValidation.d.ts +3 -2
- package/dist/components/customer_flows/IdAndFaceValidation.d.ts +5 -2
- package/dist/components/customer_flows/IdValidation.d.ts +3 -1
- package/dist/components/customer_identification/CustomerIdentificationCapture.d.ts +4 -2
- package/dist/components/customer_identification/CustomerIdentificationWizard.d.ts +4 -2
- package/dist/components/customer_verification/CustomerVerificationCapture.d.ts +4 -2
- package/dist/components/customer_verification/CustomerVerificationWizard.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessCapture.d.ts +4 -2
- package/dist/components/face_liveness/FaceLivenessWizard.d.ts +4 -2
- package/dist/components/id_capture/IdCapture.d.ts +6 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +4 -2
- package/dist/components/selfie_capture/SelfieCapture.d.ts +6 -1
- package/dist/sdk2.cjs.development.js +289 -254
- 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 +289 -254
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +289 -254
- 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/package.json +7 -6
|
@@ -3819,7 +3819,7 @@
|
|
|
3819
3819
|
}, []);
|
|
3820
3820
|
var submit = React.useCallback(function () {
|
|
3821
3821
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
3822
|
-
var submissionResponse_1, submissionRequest_1, metadata, platform, onBeforeSubmitResult,
|
|
3822
|
+
var submissionResponse_1, submissionRequest_1, metadata, platform, onBeforeSubmitResult, host, endpoint, response, submissionResponse_2, e_1;
|
|
3823
3823
|
var _a;
|
|
3824
3824
|
return __generator(this, function (_b) {
|
|
3825
3825
|
switch (_b.label) {
|
|
@@ -3838,7 +3838,7 @@
|
|
|
3838
3838
|
setSubmissionStatus(SubmissionStatus.SUBMITTING);
|
|
3839
3839
|
_b.label = 1;
|
|
3840
3840
|
case 1:
|
|
3841
|
-
_b.trys.push([1,
|
|
3841
|
+
_b.trys.push([1, 6,, 7]);
|
|
3842
3842
|
submissionRequest_1 = {
|
|
3843
3843
|
securityData: {
|
|
3844
3844
|
userName: '',
|
|
@@ -3909,7 +3909,7 @@
|
|
|
3909
3909
|
}
|
|
3910
3910
|
if (signatureData) {
|
|
3911
3911
|
submissionRequest_1.customerData.signatureData = {
|
|
3912
|
-
signatureImage: signatureData
|
|
3912
|
+
signatureImage: JSON.stringify(signatureData)
|
|
3913
3913
|
};
|
|
3914
3914
|
}
|
|
3915
3915
|
if (additionalDocuments) {
|
|
@@ -3939,20 +3939,13 @@
|
|
|
3939
3939
|
metadata.GeoLocation = JSON.stringify(geolocationResult);
|
|
3940
3940
|
}
|
|
3941
3941
|
submissionRequest_1.additionalData.metadata = JSON.stringify(metadata);
|
|
3942
|
-
if (!onBeforeSubmit) return [3,
|
|
3943
|
-
_b.label = 2;
|
|
3944
|
-
case 2:
|
|
3945
|
-
_b.trys.push([2, 4,, 5]);
|
|
3942
|
+
if (!onBeforeSubmit) return [3, 3];
|
|
3946
3943
|
return [4, onBeforeSubmit(submissionRequest_1)];
|
|
3947
|
-
case
|
|
3944
|
+
case 2:
|
|
3948
3945
|
onBeforeSubmitResult = _b.sent();
|
|
3949
3946
|
if (onBeforeSubmitResult) submissionRequest_1 = onBeforeSubmitResult;
|
|
3950
|
-
|
|
3951
|
-
case
|
|
3952
|
-
e_1 = _b.sent();
|
|
3953
|
-
console.error('onBeforeSubmit was rejected with', e_1);
|
|
3954
|
-
return [3, 5];
|
|
3955
|
-
case 5:
|
|
3947
|
+
_b.label = 3;
|
|
3948
|
+
case 3:
|
|
3956
3949
|
host = url || determineSubmissionHost(environment, token);
|
|
3957
3950
|
endpoint = determineSubmissionEndpoint(action, !!(idFrontImage || idBackImage || passportImage), !!selfieImage, !!token);
|
|
3958
3951
|
return [4, fetch(host + endpoint, {
|
|
@@ -3960,22 +3953,22 @@
|
|
|
3960
3953
|
headers: apiHeaders(token),
|
|
3961
3954
|
body: JSON.stringify(submissionRequest_1)
|
|
3962
3955
|
})];
|
|
3963
|
-
case
|
|
3956
|
+
case 4:
|
|
3964
3957
|
response = _b.sent();
|
|
3965
3958
|
return [4, response.json()];
|
|
3966
|
-
case
|
|
3959
|
+
case 5:
|
|
3967
3960
|
submissionResponse_2 = _b.sent();
|
|
3968
3961
|
setSubmissionRequest(submissionRequest_1);
|
|
3969
3962
|
setSubmissionResponse(submissionResponse_2);
|
|
3970
3963
|
setSubmissionStatus(SubmissionStatus.SUBMITTED);
|
|
3971
3964
|
onResponseReceived === null || onResponseReceived === void 0 ? void 0 : onResponseReceived(submissionResponse_2);
|
|
3972
3965
|
return [2, submissionResponse_2];
|
|
3973
|
-
case
|
|
3974
|
-
|
|
3966
|
+
case 6:
|
|
3967
|
+
e_1 = _b.sent();
|
|
3975
3968
|
setSubmissionStatus(SubmissionStatus.FAILED);
|
|
3976
|
-
onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure(
|
|
3969
|
+
onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure(e_1);
|
|
3977
3970
|
return [2, null];
|
|
3978
|
-
case
|
|
3971
|
+
case 7:
|
|
3979
3972
|
return [2];
|
|
3980
3973
|
}
|
|
3981
3974
|
});
|
|
@@ -12146,43 +12139,45 @@
|
|
|
12146
12139
|
processingDelay = _s === void 0 ? 0 : _s,
|
|
12147
12140
|
_t = _a.assets,
|
|
12148
12141
|
assets = _t === void 0 ? {} : _t,
|
|
12149
|
-
_u = _a.
|
|
12150
|
-
|
|
12151
|
-
_v = _a.
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12155
|
-
|
|
12156
|
-
|
|
12157
|
-
_y =
|
|
12158
|
-
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12172
|
-
|
|
12173
|
-
|
|
12142
|
+
_u = _a.colors,
|
|
12143
|
+
colors = _u === void 0 ? {} : _u,
|
|
12144
|
+
_v = _a.verbiage,
|
|
12145
|
+
verbiage = _v === void 0 ? {} : _v,
|
|
12146
|
+
_w = _a.debugMode,
|
|
12147
|
+
debugMode = _w === void 0 ? false : _w;
|
|
12148
|
+
var _x = useResizeObserver(),
|
|
12149
|
+
ref = _x.ref,
|
|
12150
|
+
_y = _x.width,
|
|
12151
|
+
width = _y === void 0 ? 1 : _y,
|
|
12152
|
+
_z = _x.height,
|
|
12153
|
+
height = _z === void 0 ? 1 : _z;
|
|
12154
|
+
var _0 = React.useReducer(reducer$5, initialState$5),
|
|
12155
|
+
state = _0[0],
|
|
12156
|
+
dispatch = _0[1];
|
|
12157
|
+
var _1 = React.useState(''),
|
|
12158
|
+
imageURL = _1[0],
|
|
12159
|
+
setImageURL = _1[1];
|
|
12160
|
+
var _2 = React.useState(false),
|
|
12161
|
+
processingFrame = _2[0],
|
|
12162
|
+
setProcessingFrame = _2[1];
|
|
12163
|
+
var _3 = React.useContext(CameraStateContext),
|
|
12164
|
+
cameraRef = _3.cameraRef,
|
|
12165
|
+
cameraReady = _3.cameraReady,
|
|
12166
|
+
takePhoto = _3.takePhoto,
|
|
12167
|
+
videoRef = _3.videoRef,
|
|
12168
|
+
videoLoaded = _3.videoLoaded;
|
|
12174
12169
|
var t = useTranslation().t;
|
|
12175
12170
|
var captureStartedAt = React.useRef();
|
|
12176
|
-
var
|
|
12177
|
-
modelsReady =
|
|
12178
|
-
modelsWorking =
|
|
12179
|
-
setThresholds =
|
|
12180
|
-
makePrediction =
|
|
12181
|
-
onPredictionMade =
|
|
12182
|
-
detectionTime =
|
|
12183
|
-
focusPredictionTime =
|
|
12184
|
-
getBestFrame =
|
|
12185
|
-
resetBestFrame =
|
|
12171
|
+
var _4 = React.useContext(IdCaptureModelsContext),
|
|
12172
|
+
modelsReady = _4.ready,
|
|
12173
|
+
modelsWorking = _4.working,
|
|
12174
|
+
setThresholds = _4.setThresholds,
|
|
12175
|
+
makePrediction = _4.makePrediction,
|
|
12176
|
+
onPredictionMade = _4.onPredictionMade,
|
|
12177
|
+
detectionTime = _4.detectionTime,
|
|
12178
|
+
focusPredictionTime = _4.focusPredictionTime,
|
|
12179
|
+
getBestFrame = _4.getBestFrame,
|
|
12180
|
+
resetBestFrame = _4.resetBestFrame;
|
|
12186
12181
|
React.useEffect(function () {
|
|
12187
12182
|
captureStartedAt.current = new Date();
|
|
12188
12183
|
}, []);
|
|
@@ -12211,9 +12206,9 @@
|
|
|
12211
12206
|
React.useEffect(function () {
|
|
12212
12207
|
shouldCaptureFrames.current = videoLoaded && cameraReady && modelsReady && !state.capturing && !state.captured;
|
|
12213
12208
|
}, [cameraReady, state.captured, state.capturing, modelsReady, videoLoaded]);
|
|
12214
|
-
var
|
|
12215
|
-
lastFrame =
|
|
12216
|
-
setLastFrame =
|
|
12209
|
+
var _5 = React.useState(null),
|
|
12210
|
+
lastFrame = _5[0],
|
|
12211
|
+
setLastFrame = _5[1];
|
|
12217
12212
|
React.useEffect(function () {
|
|
12218
12213
|
if (!modelsReady || !cameraReady || !videoLoaded) return;
|
|
12219
12214
|
animationFrame.current = requestAnimationFrame(function runFrame() {
|
|
@@ -12388,9 +12383,11 @@
|
|
|
12388
12383
|
}
|
|
12389
12384
|
});
|
|
12390
12385
|
}
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
verbiage.
|
|
12386
|
+
colors.guideBoxUnsatisfiedColor || (colors.guideBoxUnsatisfiedColor = 'white');
|
|
12387
|
+
colors.guideBoxSatisfiedColor || (colors.guideBoxSatisfiedColor = 'green');
|
|
12388
|
+
verbiage.instructionText || (verbiage.instructionText = t('Scan the front of ID'));
|
|
12389
|
+
verbiage.capturingText || (verbiage.capturingText = t('Capturing...'));
|
|
12390
|
+
verbiage.captureFailedText || (verbiage.captureFailedText = t('Capture failed!'));
|
|
12394
12391
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
12395
12392
|
ref: ref,
|
|
12396
12393
|
className: "flex"
|
|
@@ -12401,7 +12398,7 @@
|
|
|
12401
12398
|
portraitGuidesImageUrl: assets.portraitGuidesImageUrl,
|
|
12402
12399
|
landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
|
|
12403
12400
|
isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
|
|
12404
|
-
borderColor: state.isGoodFrame ?
|
|
12401
|
+
borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor
|
|
12405
12402
|
}), debugMode && state.detectedObjects.length > 0 && /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
|
|
12406
12403
|
"$flipX": !((_d = cameraRef.current) === null || _d === void 0 ? void 0 : _d.isRearFacing)
|
|
12407
12404
|
}, state.detectedObjects.map(function (obj, i) {
|
|
@@ -12996,25 +12993,27 @@
|
|
|
12996
12993
|
passportFocusScoreThreshold = _k === void 0 ? 0.3 : _k,
|
|
12997
12994
|
_l = _a.assets,
|
|
12998
12995
|
assets = _l === void 0 ? {} : _l,
|
|
12999
|
-
_m = _a.
|
|
13000
|
-
|
|
13001
|
-
_o = _a.
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
|
|
12996
|
+
_m = _a.colors,
|
|
12997
|
+
colors = _m === void 0 ? {} : _m,
|
|
12998
|
+
_o = _a.verbiage,
|
|
12999
|
+
verbiage = _o === void 0 ? {} : _o,
|
|
13000
|
+
_p = _a.debugMode,
|
|
13001
|
+
debugMode = _p === void 0 ? false : _p;
|
|
13002
|
+
var _q = React.useReducer(reducer$4, initialState$4),
|
|
13003
|
+
state = _q[0],
|
|
13004
|
+
dispatch = _q[1];
|
|
13006
13005
|
var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
|
|
13007
|
-
var
|
|
13008
|
-
overlayDismissed =
|
|
13009
|
-
setOverlayDismissed =
|
|
13010
|
-
var
|
|
13011
|
-
submissionStatus =
|
|
13012
|
-
submissionResponse =
|
|
13013
|
-
setIdFrontImage =
|
|
13014
|
-
setIdBackImage =
|
|
13015
|
-
setPassportImage =
|
|
13016
|
-
logIdFrontCaptureAttempt =
|
|
13017
|
-
logIdBackCaptureAttempt =
|
|
13006
|
+
var _r = React.useState(false),
|
|
13007
|
+
overlayDismissed = _r[0],
|
|
13008
|
+
setOverlayDismissed = _r[1];
|
|
13009
|
+
var _s = React.useContext(SubmissionContext),
|
|
13010
|
+
submissionStatus = _s.submissionStatus,
|
|
13011
|
+
submissionResponse = _s.submissionResponse,
|
|
13012
|
+
setIdFrontImage = _s.setIdFrontImage,
|
|
13013
|
+
setIdBackImage = _s.setIdBackImage,
|
|
13014
|
+
setPassportImage = _s.setPassportImage,
|
|
13015
|
+
logIdFrontCaptureAttempt = _s.logIdFrontCaptureAttempt,
|
|
13016
|
+
logIdBackCaptureAttempt = _s.logIdBackCaptureAttempt;
|
|
13018
13017
|
var t = useTranslation().t;
|
|
13019
13018
|
var operationStartedAt = React.useRef();
|
|
13020
13019
|
React.useEffect(function () {
|
|
@@ -13106,9 +13105,9 @@
|
|
|
13106
13105
|
type: 'reset'
|
|
13107
13106
|
});
|
|
13108
13107
|
}, []);
|
|
13109
|
-
var
|
|
13110
|
-
attempt =
|
|
13111
|
-
setAttempt =
|
|
13108
|
+
var _t = React.useState(0),
|
|
13109
|
+
attempt = _t[0],
|
|
13110
|
+
setAttempt = _t[1];
|
|
13112
13111
|
var onExit = React.useCallback(function () {
|
|
13113
13112
|
setOverlayDismissed(false);
|
|
13114
13113
|
setAttempt(function (n) {
|
|
@@ -13123,16 +13122,16 @@
|
|
|
13123
13122
|
releaseCameraAccess();
|
|
13124
13123
|
}
|
|
13125
13124
|
}, [releaseCameraAccess, submissionStatus]);
|
|
13126
|
-
assets.idCardFrontPortraitGuidesImageUrl
|
|
13127
|
-
assets.idCardFrontLandscapeGuidesImageUrl
|
|
13128
|
-
assets.idCardBackPortraitGuidesImageUrl
|
|
13129
|
-
assets.idCardBackLandscapeGuidesImageUrl
|
|
13130
|
-
assets.passportPortraitGuidesImageUrl
|
|
13131
|
-
assets.passportLandscapeGuidesImageUrl
|
|
13132
|
-
assets.loadingOverlayInstructionImageUrl
|
|
13133
|
-
verbiage.idCardFrontInstructionText
|
|
13134
|
-
verbiage.idCardBackInstructionText
|
|
13135
|
-
verbiage.passportInstructionText
|
|
13125
|
+
assets.idCardFrontPortraitGuidesImageUrl || (assets.idCardFrontPortraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
|
|
13126
|
+
assets.idCardFrontLandscapeGuidesImageUrl || (assets.idCardFrontLandscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
13127
|
+
assets.idCardBackPortraitGuidesImageUrl || (assets.idCardBackPortraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
|
|
13128
|
+
assets.idCardBackLandscapeGuidesImageUrl || (assets.idCardBackLandscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
13129
|
+
assets.passportPortraitGuidesImageUrl || (assets.passportPortraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
|
|
13130
|
+
assets.passportLandscapeGuidesImageUrl || (assets.passportLandscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
|
|
13131
|
+
assets.loadingOverlayInstructionImageUrl || (assets.loadingOverlayInstructionImageUrl = "".concat(DEFAULT_CDN_URL, "/WebSDK-Instruction-DL-Capture-3-Portrait.png"));
|
|
13132
|
+
verbiage.idCardFrontInstructionText || (verbiage.idCardFrontInstructionText = t('Scan the front of ID'));
|
|
13133
|
+
verbiage.idCardBackInstructionText || (verbiage.idCardBackInstructionText = t('Scan the back of ID'));
|
|
13134
|
+
verbiage.passportInstructionText || (verbiage.passportInstructionText = t('Scan the ID page of passport'));
|
|
13136
13135
|
var idCardFrontAssets = React.useMemo(function () {
|
|
13137
13136
|
return {
|
|
13138
13137
|
portraitGuidesImageUrl: assets.idCardFrontPortraitGuidesImageUrl,
|
|
@@ -13203,6 +13202,7 @@
|
|
|
13203
13202
|
processingScreen: flipIdPrompt,
|
|
13204
13203
|
processingDelay: 3500,
|
|
13205
13204
|
assets: idCardFrontAssets,
|
|
13205
|
+
colors: colors,
|
|
13206
13206
|
verbiage: idCardFrontVerbiage,
|
|
13207
13207
|
debugMode: debugMode
|
|
13208
13208
|
});
|
|
@@ -13222,6 +13222,7 @@
|
|
|
13222
13222
|
onCapture: onCapture,
|
|
13223
13223
|
onExit: onExit,
|
|
13224
13224
|
assets: idCardBackAssets,
|
|
13225
|
+
colors: colors,
|
|
13225
13226
|
verbiage: idCardBackVerbiage,
|
|
13226
13227
|
debugMode: debugMode
|
|
13227
13228
|
});
|
|
@@ -13241,6 +13242,7 @@
|
|
|
13241
13242
|
onCapture: onCapture,
|
|
13242
13243
|
onExit: onExit,
|
|
13243
13244
|
assets: passportAssets,
|
|
13245
|
+
colors: colors,
|
|
13244
13246
|
verbiage: passportVerbiage,
|
|
13245
13247
|
debugMode: debugMode
|
|
13246
13248
|
});
|
|
@@ -13551,6 +13553,19 @@
|
|
|
13551
13553
|
}, children);
|
|
13552
13554
|
};
|
|
13553
13555
|
|
|
13556
|
+
var GuidanceMessageContainer = styled__default['default'].div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
|
|
13557
|
+
var $top = _a.$top;
|
|
13558
|
+
return $top !== null && $top !== void 0 ? $top : '10vh';
|
|
13559
|
+
});
|
|
13560
|
+
var GuidanceMessage = styled__default['default'].div(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n"])), function (_a) {
|
|
13561
|
+
var $background = _a.$background;
|
|
13562
|
+
return $background !== null && $background !== void 0 ? $background : '#ccc';
|
|
13563
|
+
}, function (_a) {
|
|
13564
|
+
var $textColor = _a.$textColor;
|
|
13565
|
+
return $textColor !== null && $textColor !== void 0 ? $textColor : 'black';
|
|
13566
|
+
});
|
|
13567
|
+
var templateObject_1$2, templateObject_2$1;
|
|
13568
|
+
|
|
13554
13569
|
var initialState$3 = {
|
|
13555
13570
|
videoWidth: 0,
|
|
13556
13571
|
videoHeight: 0,
|
|
@@ -13654,24 +13669,26 @@
|
|
|
13654
13669
|
_e = _a.timeoutDurationMs,
|
|
13655
13670
|
timeoutDurationMs = _e === void 0 ? 15000 : _e,
|
|
13656
13671
|
guidanceMessage = _a.guidanceMessage,
|
|
13657
|
-
_f = _a.
|
|
13658
|
-
|
|
13672
|
+
_f = _a.colors,
|
|
13673
|
+
colors = _f === void 0 ? {} : _f,
|
|
13674
|
+
_g = _a.verbiage,
|
|
13675
|
+
verbiage = _g === void 0 ? {} : _g,
|
|
13659
13676
|
debugMode = _a.debugMode;
|
|
13660
13677
|
var t = useTranslation().t;
|
|
13661
|
-
var
|
|
13662
|
-
ref =
|
|
13663
|
-
|
|
13664
|
-
width =
|
|
13665
|
-
|
|
13666
|
-
height =
|
|
13667
|
-
var
|
|
13668
|
-
state =
|
|
13669
|
-
dispatch =
|
|
13670
|
-
var
|
|
13671
|
-
cameraRef =
|
|
13672
|
-
cameraReady =
|
|
13673
|
-
takePhoto =
|
|
13674
|
-
videoRef =
|
|
13678
|
+
var _h = useResizeObserver(),
|
|
13679
|
+
ref = _h.ref,
|
|
13680
|
+
_j = _h.width,
|
|
13681
|
+
width = _j === void 0 ? 1 : _j,
|
|
13682
|
+
_k = _h.height,
|
|
13683
|
+
height = _k === void 0 ? 1 : _k;
|
|
13684
|
+
var _l = React.useReducer(reducer$3, initialState$3),
|
|
13685
|
+
state = _l[0],
|
|
13686
|
+
dispatch = _l[1];
|
|
13687
|
+
var _m = React.useContext(CameraStateContext),
|
|
13688
|
+
cameraRef = _m.cameraRef,
|
|
13689
|
+
cameraReady = _m.cameraReady,
|
|
13690
|
+
takePhoto = _m.takePhoto,
|
|
13691
|
+
videoRef = _m.videoRef;
|
|
13675
13692
|
var onPredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
|
|
13676
13693
|
React.useEffect(function () {
|
|
13677
13694
|
if (cameraReady && videoRef.current && videoRef.current.videoWidth !== 0) {
|
|
@@ -13694,9 +13711,9 @@
|
|
|
13694
13711
|
});
|
|
13695
13712
|
});
|
|
13696
13713
|
}, [onPredictionMade]);
|
|
13697
|
-
var
|
|
13698
|
-
captureReady =
|
|
13699
|
-
setCaptureReady =
|
|
13714
|
+
var _o = React.useState(false),
|
|
13715
|
+
captureReady = _o[0],
|
|
13716
|
+
setCaptureReady = _o[1];
|
|
13700
13717
|
React.useEffect(function () {
|
|
13701
13718
|
var timer;
|
|
13702
13719
|
if (state.faceReady) {
|
|
@@ -13740,12 +13757,12 @@
|
|
|
13740
13757
|
});
|
|
13741
13758
|
})();
|
|
13742
13759
|
}, [captureReady, onSelfieCaptured, state.faces, takePhoto]);
|
|
13743
|
-
var
|
|
13744
|
-
timeoutStartedAt =
|
|
13745
|
-
setTimeoutStartedAt =
|
|
13746
|
-
var
|
|
13747
|
-
timedOut =
|
|
13748
|
-
setTimedOut =
|
|
13760
|
+
var _p = React.useState(),
|
|
13761
|
+
timeoutStartedAt = _p[0],
|
|
13762
|
+
setTimeoutStartedAt = _p[1];
|
|
13763
|
+
var _q = React.useState(false),
|
|
13764
|
+
timedOut = _q[0],
|
|
13765
|
+
setTimedOut = _q[1];
|
|
13749
13766
|
React.useEffect(function () {
|
|
13750
13767
|
if (!timeoutDurationMs) return;
|
|
13751
13768
|
setTimeoutStartedAt(new Date());
|
|
@@ -13766,36 +13783,24 @@
|
|
|
13766
13783
|
videoWidth: state.videoWidth,
|
|
13767
13784
|
videoHeight: state.videoHeight
|
|
13768
13785
|
});
|
|
13786
|
+
colors.guidesUnsatisfiedColor || (colors.guidesUnsatisfiedColor = 'white');
|
|
13787
|
+
colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
|
|
13769
13788
|
if (!guidanceMessage) {
|
|
13770
|
-
verbiage.guidanceHoldStillText
|
|
13771
|
-
verbiage.guidanceLookStraightText
|
|
13772
|
-
verbiage.guidanceMoveBackText
|
|
13773
|
-
verbiage.guidanceMoveForwardText
|
|
13774
|
-
verbiage.guidanceMoveToCenterText
|
|
13789
|
+
verbiage.guidanceHoldStillText || (verbiage.guidanceHoldStillText = t('Hold still for a few seconds...'));
|
|
13790
|
+
verbiage.guidanceLookStraightText || (verbiage.guidanceLookStraightText = t('Look straight into the camera...'));
|
|
13791
|
+
verbiage.guidanceMoveBackText || (verbiage.guidanceMoveBackText = t('Move back...'));
|
|
13792
|
+
verbiage.guidanceMoveForwardText || (verbiage.guidanceMoveForwardText = t('Move forward...'));
|
|
13793
|
+
verbiage.guidanceMoveToCenterText || (verbiage.guidanceMoveToCenterText = t('Move to the center...'));
|
|
13775
13794
|
guidanceMessage = state.faceReady ? verbiage.guidanceHoldStillText : state.faceLookingAway ? verbiage.guidanceLookStraightText : state.faceTooClose ? verbiage.guidanceMoveBackText : state.faceTooFar ? verbiage.guidanceMoveForwardText : state.faceNotCentered ? verbiage.guidanceMoveToCenterText : '';
|
|
13776
13795
|
}
|
|
13777
13796
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
13778
13797
|
ref: ref,
|
|
13779
13798
|
className: "flex"
|
|
13780
13799
|
}, /*#__PURE__*/React__default['default'].createElement(CameraVideoTag, null), /*#__PURE__*/React__default['default'].createElement(FaceCaptureGuideOverlay, {
|
|
13781
|
-
borderColor: state.faceReady ?
|
|
13782
|
-
}), guidanceMessage !== '' && /*#__PURE__*/React__default['default'].createElement(
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
top: 'calc(10vh)',
|
|
13786
|
-
fontWeight: 'bold',
|
|
13787
|
-
width: '100%',
|
|
13788
|
-
display: 'flex'
|
|
13789
|
-
}
|
|
13790
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13791
|
-
style: {
|
|
13792
|
-
marginLeft: 'auto',
|
|
13793
|
-
marginRight: 'auto',
|
|
13794
|
-
background: state.faceReady ? 'green' : 'red',
|
|
13795
|
-
color: 'white',
|
|
13796
|
-
padding: '10px 12px 8px',
|
|
13797
|
-
borderRadius: 8
|
|
13798
|
-
}
|
|
13800
|
+
borderColor: state.faceReady ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
|
|
13801
|
+
}), guidanceMessage !== '' && /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, null, /*#__PURE__*/React__default['default'].createElement(GuidanceMessage, {
|
|
13802
|
+
"$background": state.faceReady ? 'green' : 'red',
|
|
13803
|
+
"$textColor": "white"
|
|
13799
13804
|
}, guidanceMessage)), debugMode && state.faces.length > 0 && /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlay, {
|
|
13800
13805
|
"$flipX": !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing)
|
|
13801
13806
|
}, state.faces.map(function (face, i) {
|
|
@@ -13900,14 +13905,16 @@
|
|
|
13900
13905
|
onExit = _a.onExit,
|
|
13901
13906
|
_b = _a.timeoutDurationMs,
|
|
13902
13907
|
timeoutDurationMs = _b === void 0 ? 15000 : _b,
|
|
13903
|
-
_c = _a.
|
|
13904
|
-
|
|
13908
|
+
_c = _a.colors,
|
|
13909
|
+
colors = _c === void 0 ? {} : _c,
|
|
13910
|
+
_d = _a.verbiage,
|
|
13911
|
+
verbiage = _d === void 0 ? {} : _d,
|
|
13905
13912
|
debugMode = _a.debugMode;
|
|
13906
13913
|
var t = useTranslation().t;
|
|
13907
13914
|
var checkLiveness = React.useContext(SubmissionContext).checkLiveness;
|
|
13908
|
-
var
|
|
13909
|
-
state =
|
|
13910
|
-
dispatch =
|
|
13915
|
+
var _e = React.useReducer(reducer$2, initialState$2),
|
|
13916
|
+
state = _e[0],
|
|
13917
|
+
dispatch = _e[1];
|
|
13911
13918
|
var onSelfieCaptured = React.useCallback(function (frame, face) {
|
|
13912
13919
|
onCapture === null || onCapture === void 0 ? void 0 : onCapture();
|
|
13913
13920
|
dispatch({
|
|
@@ -13975,9 +13982,9 @@
|
|
|
13975
13982
|
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout();
|
|
13976
13983
|
}
|
|
13977
13984
|
}, [onTimeout, state.timesLivenessCheckFailed]);
|
|
13978
|
-
verbiage.guidanceRemoveEyeCoveringsText
|
|
13979
|
-
verbiage.guidanceRemoveHeadCoveringsText
|
|
13980
|
-
verbiage.guidanceRemoveMaskText
|
|
13985
|
+
verbiage.guidanceRemoveEyeCoveringsText || (verbiage.guidanceRemoveEyeCoveringsText = t('Please remove your eye coverings (sunglasses, eye patch, etc.)...'));
|
|
13986
|
+
verbiage.guidanceRemoveHeadCoveringsText || (verbiage.guidanceRemoveHeadCoveringsText = t('Please remove your head coverings (hat, scarf, etc.)...'));
|
|
13987
|
+
verbiage.guidanceRemoveMaskText || (verbiage.guidanceRemoveMaskText = t('Please remove your mask...'));
|
|
13981
13988
|
var guidanceMessage = state.eyeCoveringDetected ? verbiage.guidanceRemoveEyeCoveringsText : state.headCoveringDetected ? verbiage.guidanceRemoveHeadCoveringsText : state.maskDetected ? verbiage.guidanceRemoveMaskText : undefined;
|
|
13982
13989
|
return /*#__PURE__*/React__default['default'].createElement(SelfieCapture, {
|
|
13983
13990
|
onSelfieCaptured: onSelfieCaptured,
|
|
@@ -13985,6 +13992,7 @@
|
|
|
13985
13992
|
onExit: onExit,
|
|
13986
13993
|
timeoutDurationMs: timeoutDurationMs,
|
|
13987
13994
|
guidanceMessage: guidanceMessage,
|
|
13995
|
+
colors: colors,
|
|
13988
13996
|
verbiage: verbiage,
|
|
13989
13997
|
debugMode: debugMode
|
|
13990
13998
|
});
|
|
@@ -14176,26 +14184,28 @@
|
|
|
14176
14184
|
timeoutDurationMs = _b === void 0 ? 15000 : _b,
|
|
14177
14185
|
_c = _a.maxRetries,
|
|
14178
14186
|
maxRetries = _c === void 0 ? 2 : _c,
|
|
14179
|
-
_d = _a.
|
|
14180
|
-
|
|
14181
|
-
_e = _a.
|
|
14182
|
-
|
|
14183
|
-
_f = _a.
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14187
|
+
_d = _a.assets,
|
|
14188
|
+
assets = _d === void 0 ? {} : _d,
|
|
14189
|
+
_e = _a.colors,
|
|
14190
|
+
colors = _e === void 0 ? {} : _e,
|
|
14191
|
+
_f = _a.verbiage,
|
|
14192
|
+
verbiage = _f === void 0 ? {} : _f,
|
|
14193
|
+
_g = _a.debugMode,
|
|
14194
|
+
debugMode = _g === void 0 ? false : _g;
|
|
14195
|
+
var _h = React.useContext(SubmissionContext),
|
|
14196
|
+
submissionResponse = _h.submissionResponse,
|
|
14197
|
+
setSelfieImage = _h.setSelfieImage,
|
|
14198
|
+
logSelfieCaptureAttempt = _h.logSelfieCaptureAttempt;
|
|
14189
14199
|
var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
|
|
14190
|
-
var
|
|
14191
|
-
faceCropImageUrl =
|
|
14192
|
-
setFaceCropImageUrl =
|
|
14193
|
-
var
|
|
14194
|
-
retryCount =
|
|
14195
|
-
setRetryCount =
|
|
14196
|
-
var
|
|
14197
|
-
captureState =
|
|
14198
|
-
setCaptureState =
|
|
14200
|
+
var _j = React.useState(''),
|
|
14201
|
+
faceCropImageUrl = _j[0],
|
|
14202
|
+
setFaceCropImageUrl = _j[1];
|
|
14203
|
+
var _k = React.useState(0),
|
|
14204
|
+
retryCount = _k[0],
|
|
14205
|
+
setRetryCount = _k[1];
|
|
14206
|
+
var _l = React.useState('LOADING'),
|
|
14207
|
+
captureState = _l[0],
|
|
14208
|
+
setCaptureState = _l[1];
|
|
14199
14209
|
var captureStartedAt = React.useRef();
|
|
14200
14210
|
var captureEndedAt = React.useRef();
|
|
14201
14211
|
var operationStartedAt = React.useRef();
|
|
@@ -14241,9 +14251,9 @@
|
|
|
14241
14251
|
setCaptureState('FAILED');
|
|
14242
14252
|
onTimeout === null || onTimeout === void 0 ? void 0 : onTimeout(submissionResponse);
|
|
14243
14253
|
}, [onTimeout, submissionResponse]);
|
|
14244
|
-
var
|
|
14245
|
-
attempt =
|
|
14246
|
-
setAttempt =
|
|
14254
|
+
var _m = React.useState(0),
|
|
14255
|
+
attempt = _m[0],
|
|
14256
|
+
setAttempt = _m[1];
|
|
14247
14257
|
var onExitCallback = React.useCallback(function () {
|
|
14248
14258
|
setAttempt(function (n) {
|
|
14249
14259
|
return n + 1;
|
|
@@ -14260,6 +14270,7 @@
|
|
|
14260
14270
|
onTimeout: onTimeoutCallback,
|
|
14261
14271
|
onExit: onExitCallback,
|
|
14262
14272
|
timeoutDurationMs: timeoutDurationMs,
|
|
14273
|
+
colors: colors,
|
|
14263
14274
|
verbiage: verbiage,
|
|
14264
14275
|
debugMode: debugMode
|
|
14265
14276
|
});
|
|
@@ -14787,8 +14798,8 @@
|
|
|
14787
14798
|
return truncated;
|
|
14788
14799
|
}
|
|
14789
14800
|
|
|
14790
|
-
var Spinner = styled__default['default'].div(templateObject_1$
|
|
14791
|
-
var templateObject_1$
|
|
14801
|
+
var Spinner = styled__default['default'].div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"], ["\n display: inline-block;\n width: 80px;\n height: 80px;\n margin: auto;\n\n &:after {\n content: ' ';\n display: block;\n width: 64px;\n height: 64px;\n margin: 8px;\n border-radius: 50%;\n border: 6px solid #888;\n border-color: #888 transparent #888 transparent;\n animation: lds-dual-ring 1.2s linear infinite;\n }\n\n @keyframes lds-dual-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
|
|
14802
|
+
var templateObject_1$1;
|
|
14792
14803
|
|
|
14793
14804
|
var AdditionalDocumentCapture = function AdditionalDocumentCapture(_a) {
|
|
14794
14805
|
var document = _a.document,
|
|
@@ -15554,18 +15565,11 @@
|
|
|
15554
15565
|
return signatureData;
|
|
15555
15566
|
}
|
|
15556
15567
|
|
|
15557
|
-
var SignatureCanvasContainer = styled__default['default'].div(templateObject_1
|
|
15558
|
-
var SignaturePad = styled__default['default'].div(templateObject_2
|
|
15568
|
+
var SignatureCanvasContainer = styled__default['default'].div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"], ["\n position: absolute;\n top: 25%;\n left: 15%;\n width: 70%;\n height: 50%;\n\n @media (max-width: 800px) {\n top: 15%;\n left: 2%;\n width: 96%;\n height: 70%;\n }\n"])));
|
|
15569
|
+
var SignaturePad = styled__default['default'].div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 16px;\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"], ["\n position: relative;\n background: rgba(255, 255, 255, 0.5);\n border-radius: 16px;\n flex-grow: 1;\n z-index: 100;\n height: 100%;\n"])));
|
|
15559
15570
|
var SignatureButtonsContainer = styled__default['default'].div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"], ["\n flex-grow: 0;\n padding-top: 12px;\n display: flex;\n z-index: 1000;\n position: relative;\n"])));
|
|
15560
15571
|
var SignaturePaperBacking = styled__default['default'].div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n background-color: #e5e5f7;\n opacity: 0.8;\n background-image: radial-gradient(#444cf7 0.5px, transparent 0.5px),\n radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px);\n background-size: 20px 20px;\n background-position: 0 0, 10px 10px;\n"], ["\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n background-color: #e5e5f7;\n opacity: 0.8;\n background-image: radial-gradient(#444cf7 0.5px, transparent 0.5px),\n radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px);\n background-size: 20px 20px;\n background-position: 0 0, 10px 10px;\n"])));
|
|
15561
|
-
var templateObject_1
|
|
15562
|
-
|
|
15563
|
-
var GuidanceMessageContainer = styled__default['default'].div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
|
|
15564
|
-
var $top = _a.$top;
|
|
15565
|
-
return $top !== null && $top !== void 0 ? $top : '10vh';
|
|
15566
|
-
});
|
|
15567
|
-
var GuidanceMessage = styled__default['default'].div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: #ccc;\n padding: 10px 12px 8px;\n border-radius: 8px;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: #ccc;\n padding: 10px 12px 8px;\n border-radius: 8px;\n"])));
|
|
15568
|
-
var templateObject_1, templateObject_2;
|
|
15572
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
15569
15573
|
|
|
15570
15574
|
var SignatureCapture = function SignatureCapture(_a) {
|
|
15571
15575
|
var onAccept = _a.onAccept,
|
|
@@ -16266,20 +16270,22 @@
|
|
|
16266
16270
|
onDenied = _a.onDenied,
|
|
16267
16271
|
_j = _a.assets,
|
|
16268
16272
|
assets = _j === void 0 ? {} : _j,
|
|
16269
|
-
_k = _a.
|
|
16270
|
-
|
|
16271
|
-
_l = _a.
|
|
16272
|
-
|
|
16273
|
-
_m = _a.
|
|
16274
|
-
|
|
16275
|
-
_o = _a.
|
|
16276
|
-
|
|
16277
|
-
_p = _a.
|
|
16278
|
-
|
|
16279
|
-
_q = _a.
|
|
16280
|
-
|
|
16281
|
-
_r = _a.
|
|
16282
|
-
|
|
16273
|
+
_k = _a.colors,
|
|
16274
|
+
colors = _k === void 0 ? {} : _k,
|
|
16275
|
+
_l = _a.verbiage,
|
|
16276
|
+
verbiage = _l === void 0 ? {} : _l,
|
|
16277
|
+
_m = _a.captureSignature,
|
|
16278
|
+
captureSignature = _m === void 0 ? false : _m,
|
|
16279
|
+
_o = _a.captureSignatureVideo,
|
|
16280
|
+
captureSignatureVideo = _o === void 0 ? false : _o,
|
|
16281
|
+
_p = _a.captureAdditionalDocuments,
|
|
16282
|
+
captureAdditionalDocuments = _p === void 0 ? [] : _p,
|
|
16283
|
+
_q = _a.geolocationEnabled,
|
|
16284
|
+
geolocationEnabled = _q === void 0 ? true : _q,
|
|
16285
|
+
_r = _a.geolocationRequired,
|
|
16286
|
+
geolocationRequired = _r === void 0 ? false : _r,
|
|
16287
|
+
_s = _a.debugMode,
|
|
16288
|
+
debugMode = _s === void 0 ? false : _s;
|
|
16283
16289
|
useLanguage(lang);
|
|
16284
16290
|
var idCaptureProps = React.useMemo(function () {
|
|
16285
16291
|
return {
|
|
@@ -16291,10 +16297,11 @@
|
|
|
16291
16297
|
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
16292
16298
|
barcodeScanningEnabled: false,
|
|
16293
16299
|
assets: assets,
|
|
16300
|
+
colors: colors,
|
|
16294
16301
|
verbiage: verbiage,
|
|
16295
16302
|
debugMode: debugMode
|
|
16296
16303
|
};
|
|
16297
|
-
}, [assets, debugMode, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, verbiage]);
|
|
16304
|
+
}, [assets, colors, debugMode, idAutoCaptureEnabled, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold, verbiage]);
|
|
16298
16305
|
var signatureCaptureProps = React.useMemo(function () {
|
|
16299
16306
|
return {
|
|
16300
16307
|
verbiage: {
|
|
@@ -16369,6 +16376,7 @@
|
|
|
16369
16376
|
onDenied = _a.onDenied,
|
|
16370
16377
|
onExitAfterFailure = _a.onExitAfterFailure,
|
|
16371
16378
|
assets = _a.assets,
|
|
16379
|
+
colors = _a.colors,
|
|
16372
16380
|
verbiage = _a.verbiage,
|
|
16373
16381
|
_e = _a.geolocationEnabled,
|
|
16374
16382
|
geolocationEnabled = _e === void 0 ? true : _e,
|
|
@@ -16385,10 +16393,11 @@
|
|
|
16385
16393
|
onTimeout: onDenied,
|
|
16386
16394
|
onExitAfterFailure: onExitAfterFailure,
|
|
16387
16395
|
assets: assets,
|
|
16396
|
+
colors: colors,
|
|
16388
16397
|
verbiage: verbiage,
|
|
16389
16398
|
debugMode: debugMode
|
|
16390
16399
|
};
|
|
16391
|
-
}, [assets, debugMode, onApproved, onComplete, onDenied, onExitAfterFailure, timeoutDurationMs, verbiage]);
|
|
16400
|
+
}, [assets, colors, debugMode, onApproved, onComplete, onDenied, onExitAfterFailure, timeoutDurationMs, verbiage]);
|
|
16392
16401
|
return /*#__PURE__*/React__default['default'].createElement(SubmissionProvider, {
|
|
16393
16402
|
action: SubmissionAction.NONE,
|
|
16394
16403
|
environment: submissionEnvironment,
|
|
@@ -16438,10 +16447,12 @@
|
|
|
16438
16447
|
_j = _a.passportFocusScoreThreshold,
|
|
16439
16448
|
passportFocusScoreThreshold = _j === void 0 ? 0.3 : _j,
|
|
16440
16449
|
idCaptureAssets = _a.idCaptureAssets,
|
|
16450
|
+
idCaptureColors = _a.idCaptureColors,
|
|
16441
16451
|
idCaptureVerbiage = _a.idCaptureVerbiage,
|
|
16442
16452
|
_k = _a.faceLivenessTimeoutDurationMs,
|
|
16443
16453
|
faceLivenessTimeoutDurationMs = _k === void 0 ? 15000 : _k,
|
|
16444
16454
|
faceLivenessAssets = _a.faceLivenessAssets,
|
|
16455
|
+
faceLivenessColors = _a.faceLivenessColors,
|
|
16445
16456
|
faceLivenessVerbiage = _a.faceLivenessVerbiage,
|
|
16446
16457
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
16447
16458
|
onComplete = _a.onComplete,
|
|
@@ -16464,6 +16475,7 @@
|
|
|
16464
16475
|
var idCaptureProps = React.useMemo(function () {
|
|
16465
16476
|
return {
|
|
16466
16477
|
assets: idCaptureAssets,
|
|
16478
|
+
colors: idCaptureColors,
|
|
16467
16479
|
verbiage: idCaptureVerbiage,
|
|
16468
16480
|
autoCaptureEnabled: idAutoCaptureEnabled,
|
|
16469
16481
|
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
@@ -16473,17 +16485,18 @@
|
|
|
16473
16485
|
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
16474
16486
|
debugMode: debugMode
|
|
16475
16487
|
};
|
|
16476
|
-
}, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
|
|
16488
|
+
}, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureColors, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
|
|
16477
16489
|
var faceLivenessProps = React.useMemo(function () {
|
|
16478
16490
|
return {
|
|
16479
16491
|
timeoutDurationMs: faceLivenessTimeoutDurationMs,
|
|
16480
16492
|
onTimeout: onDenied,
|
|
16481
16493
|
onExitAfterFailure: onExitAfterFailure,
|
|
16482
16494
|
assets: faceLivenessAssets,
|
|
16495
|
+
colors: faceLivenessColors,
|
|
16483
16496
|
verbiage: faceLivenessVerbiage,
|
|
16484
16497
|
debugMode: debugMode
|
|
16485
16498
|
};
|
|
16486
|
-
}, [debugMode, faceLivenessAssets, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onDenied, onExitAfterFailure]);
|
|
16499
|
+
}, [debugMode, faceLivenessAssets, faceLivenessColors, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onDenied, onExitAfterFailure]);
|
|
16487
16500
|
var signatureCaptureProps = React.useMemo(function () {
|
|
16488
16501
|
return {
|
|
16489
16502
|
verbiage: {
|
|
@@ -16571,10 +16584,12 @@
|
|
|
16571
16584
|
_j = _a.passportFocusScoreThreshold,
|
|
16572
16585
|
passportFocusScoreThreshold = _j === void 0 ? 0.3 : _j,
|
|
16573
16586
|
idCaptureAssets = _a.idCaptureAssets,
|
|
16587
|
+
idCaptureColors = _a.idCaptureColors,
|
|
16574
16588
|
idCaptureVerbiage = _a.idCaptureVerbiage,
|
|
16575
16589
|
_k = _a.faceLivenessTimeoutDurationMs,
|
|
16576
16590
|
faceLivenessTimeoutDurationMs = _k === void 0 ? 15000 : _k,
|
|
16577
16591
|
faceLivenessAssets = _a.faceLivenessAssets,
|
|
16592
|
+
faceLivenessColors = _a.faceLivenessColors,
|
|
16578
16593
|
faceLivenessVerbiage = _a.faceLivenessVerbiage,
|
|
16579
16594
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
16580
16595
|
onComplete = _a.onComplete,
|
|
@@ -16597,6 +16612,7 @@
|
|
|
16597
16612
|
var idCaptureProps = React.useMemo(function () {
|
|
16598
16613
|
return {
|
|
16599
16614
|
assets: idCaptureAssets,
|
|
16615
|
+
colors: idCaptureColors,
|
|
16600
16616
|
verbiage: idCaptureVerbiage,
|
|
16601
16617
|
autoCaptureEnabled: idAutoCaptureEnabled,
|
|
16602
16618
|
idCardAutoCaptureScoreThreshold: idCardAutoCaptureScoreThreshold,
|
|
@@ -16606,16 +16622,17 @@
|
|
|
16606
16622
|
passportFocusScoreThreshold: passportFocusScoreThreshold,
|
|
16607
16623
|
debugMode: debugMode
|
|
16608
16624
|
};
|
|
16609
|
-
}, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
|
|
16625
|
+
}, [debugMode, idAutoCaptureEnabled, idCaptureAssets, idCaptureColors, idCaptureVerbiage, idCardAutoCaptureScoreThreshold, idCardFocusScoreThreshold, mrzDetectionScoreThreshold, passportAutoCaptureScoreThreshold, passportFocusScoreThreshold]);
|
|
16610
16626
|
var faceLivenessProps = React.useMemo(function () {
|
|
16611
16627
|
return {
|
|
16612
16628
|
onExitAfterFailure: onExitAfterFailure,
|
|
16613
16629
|
timeoutDurationMs: faceLivenessTimeoutDurationMs,
|
|
16614
16630
|
assets: faceLivenessAssets,
|
|
16631
|
+
colors: faceLivenessColors,
|
|
16615
16632
|
verbiage: faceLivenessVerbiage,
|
|
16616
16633
|
debugMode: debugMode
|
|
16617
16634
|
};
|
|
16618
|
-
}, [debugMode, faceLivenessAssets, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onExitAfterFailure]);
|
|
16635
|
+
}, [debugMode, faceLivenessAssets, faceLivenessColors, faceLivenessTimeoutDurationMs, faceLivenessVerbiage, onExitAfterFailure]);
|
|
16619
16636
|
var signatureCaptureProps = React.useMemo(function () {
|
|
16620
16637
|
return {
|
|
16621
16638
|
verbiage: {
|
|
@@ -16748,20 +16765,22 @@
|
|
|
16748
16765
|
onCaptureGuidanceTimeout = _a.onCaptureGuidanceTimeout,
|
|
16749
16766
|
onExit = _a.onExit,
|
|
16750
16767
|
captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
|
|
16751
|
-
_b = _a.
|
|
16752
|
-
|
|
16753
|
-
_c = _a.
|
|
16754
|
-
|
|
16755
|
-
|
|
16756
|
-
|
|
16757
|
-
|
|
16768
|
+
_b = _a.colors,
|
|
16769
|
+
colors = _b === void 0 ? {} : _b,
|
|
16770
|
+
_c = _a.verbiage,
|
|
16771
|
+
verbiage = _c === void 0 ? {} : _c,
|
|
16772
|
+
_d = _a.debugMode,
|
|
16773
|
+
debugMode = _d === void 0 ? false : _d;
|
|
16774
|
+
var _e = React.useReducer(reducer$1, initialState$1),
|
|
16775
|
+
state = _e[0],
|
|
16776
|
+
dispatch = _e[1];
|
|
16758
16777
|
var frame = state.frame,
|
|
16759
16778
|
face = state.face;
|
|
16760
|
-
var
|
|
16761
|
-
submit =
|
|
16762
|
-
submissionResponse =
|
|
16763
|
-
selfieImage =
|
|
16764
|
-
setSelfieImage =
|
|
16779
|
+
var _f = React.useContext(SubmissionContext),
|
|
16780
|
+
submit = _f.submit,
|
|
16781
|
+
submissionResponse = _f.submissionResponse,
|
|
16782
|
+
selfieImage = _f.selfieImage,
|
|
16783
|
+
setSelfieImage = _f.setSelfieImage;
|
|
16765
16784
|
var onSelfieCaptured = React.useCallback(function (frame, face) {
|
|
16766
16785
|
dispatch({
|
|
16767
16786
|
type: 'verificationReady',
|
|
@@ -16834,6 +16853,7 @@
|
|
|
16834
16853
|
onTimeout: onCaptureGuidanceTimeout,
|
|
16835
16854
|
onExit: onExit,
|
|
16836
16855
|
timeoutDurationMs: captureGuidanceTimeoutDurationMs,
|
|
16856
|
+
colors: colors,
|
|
16837
16857
|
verbiage: verbiage,
|
|
16838
16858
|
debugMode: debugMode
|
|
16839
16859
|
});
|
|
@@ -16944,17 +16964,19 @@
|
|
|
16944
16964
|
captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
|
|
16945
16965
|
_b = _a.assets,
|
|
16946
16966
|
assets = _b === void 0 ? {} : _b,
|
|
16947
|
-
_c = _a.
|
|
16948
|
-
|
|
16949
|
-
_d = _a.
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16967
|
+
_c = _a.colors,
|
|
16968
|
+
colors = _c === void 0 ? {} : _c,
|
|
16969
|
+
_d = _a.verbiage,
|
|
16970
|
+
verbiage = _d === void 0 ? {} : _d,
|
|
16971
|
+
_e = _a.debugMode,
|
|
16972
|
+
debugMode = _e === void 0 ? false : _e;
|
|
16973
|
+
var _f = React.useContext(SubmissionContext),
|
|
16974
|
+
submissionResponse = _f.submissionResponse,
|
|
16975
|
+
selfieImage = _f.selfieImage;
|
|
16954
16976
|
var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
|
|
16955
|
-
var
|
|
16956
|
-
captureState =
|
|
16957
|
-
setCaptureState =
|
|
16977
|
+
var _g = React.useState('LOADING'),
|
|
16978
|
+
captureState = _g[0],
|
|
16979
|
+
setCaptureState = _g[1];
|
|
16958
16980
|
var onCustomerMatchedCallback = React.useCallback(function (response) {
|
|
16959
16981
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
16960
16982
|
return __generator(this, function (_a) {
|
|
@@ -16986,9 +17008,9 @@
|
|
|
16986
17008
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
16987
17009
|
}, 0);
|
|
16988
17010
|
}, [onCaptureGuidanceTimeout, releaseCameraAccess]);
|
|
16989
|
-
var
|
|
16990
|
-
attempt =
|
|
16991
|
-
setAttempt =
|
|
17011
|
+
var _h = React.useState(0),
|
|
17012
|
+
attempt = _h[0],
|
|
17013
|
+
setAttempt = _h[1];
|
|
16992
17014
|
var onExitCallback = React.useCallback(function () {
|
|
16993
17015
|
setAttempt(function (n) {
|
|
16994
17016
|
return n + 1;
|
|
@@ -17004,6 +17026,7 @@
|
|
|
17004
17026
|
onCaptureGuidanceTimeout: onCaptureGuidanceTimeoutCallback,
|
|
17005
17027
|
onExit: onExitCallback,
|
|
17006
17028
|
captureGuidanceTimeoutDurationMs: captureGuidanceTimeoutDurationMs,
|
|
17029
|
+
colors: colors,
|
|
17007
17030
|
verbiage: verbiage,
|
|
17008
17031
|
debugMode: debugMode
|
|
17009
17032
|
});
|
|
@@ -17062,6 +17085,7 @@
|
|
|
17062
17085
|
_d = _a.timeoutDurationMs,
|
|
17063
17086
|
timeoutDurationMs = _d === void 0 ? 15000 : _d,
|
|
17064
17087
|
assets = _a.assets,
|
|
17088
|
+
colors = _a.colors,
|
|
17065
17089
|
verbiage = _a.verbiage,
|
|
17066
17090
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
17067
17091
|
onComplete = _a.onComplete,
|
|
@@ -17097,6 +17121,7 @@
|
|
|
17097
17121
|
onExitAfterFailure: onExitAfterFailure,
|
|
17098
17122
|
captureGuidanceTimeoutDurationMs: timeoutDurationMs,
|
|
17099
17123
|
assets: assets,
|
|
17124
|
+
colors: colors,
|
|
17100
17125
|
verbiage: verbiage,
|
|
17101
17126
|
debugMode: debugMode
|
|
17102
17127
|
}))));
|
|
@@ -17175,18 +17200,20 @@
|
|
|
17175
17200
|
onCaptureGuidanceTimeout = _a.onCaptureGuidanceTimeout,
|
|
17176
17201
|
onExit = _a.onExit,
|
|
17177
17202
|
captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
|
|
17178
|
-
_b = _a.
|
|
17179
|
-
|
|
17180
|
-
_c = _a.
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17203
|
+
_b = _a.colors,
|
|
17204
|
+
colors = _b === void 0 ? {} : _b,
|
|
17205
|
+
_c = _a.verbiage,
|
|
17206
|
+
verbiage = _c === void 0 ? {} : _c,
|
|
17207
|
+
_d = _a.debugMode,
|
|
17208
|
+
debugMode = _d === void 0 ? false : _d;
|
|
17209
|
+
var _e = React.useReducer(reducer, initialState),
|
|
17210
|
+
state = _e[0],
|
|
17211
|
+
dispatch = _e[1];
|
|
17212
|
+
var _f = React.useContext(SubmissionContext),
|
|
17213
|
+
submit = _f.submit,
|
|
17214
|
+
submissionResponse = _f.submissionResponse,
|
|
17215
|
+
selfieImage = _f.selfieImage,
|
|
17216
|
+
setSelfieImage = _f.setSelfieImage;
|
|
17190
17217
|
var onSelfieCaptured = React.useCallback(function (frame, face) {
|
|
17191
17218
|
dispatch({
|
|
17192
17219
|
type: 'identificationReady',
|
|
@@ -17261,6 +17288,7 @@
|
|
|
17261
17288
|
onTimeout: onCaptureGuidanceTimeout,
|
|
17262
17289
|
onExit: onExit,
|
|
17263
17290
|
timeoutDurationMs: captureGuidanceTimeoutDurationMs,
|
|
17291
|
+
colors: colors,
|
|
17264
17292
|
verbiage: verbiage,
|
|
17265
17293
|
debugMode: debugMode
|
|
17266
17294
|
});
|
|
@@ -17371,17 +17399,19 @@
|
|
|
17371
17399
|
captureGuidanceTimeoutDurationMs = _a.captureGuidanceTimeoutDurationMs,
|
|
17372
17400
|
_b = _a.assets,
|
|
17373
17401
|
assets = _b === void 0 ? {} : _b,
|
|
17374
|
-
_c = _a.
|
|
17375
|
-
|
|
17376
|
-
_d = _a.
|
|
17377
|
-
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
|
|
17402
|
+
_c = _a.colors,
|
|
17403
|
+
colors = _c === void 0 ? {} : _c,
|
|
17404
|
+
_d = _a.verbiage,
|
|
17405
|
+
verbiage = _d === void 0 ? {} : _d,
|
|
17406
|
+
_e = _a.debugMode,
|
|
17407
|
+
debugMode = _e === void 0 ? false : _e;
|
|
17408
|
+
var _f = React.useContext(SubmissionContext),
|
|
17409
|
+
submissionResponse = _f.submissionResponse,
|
|
17410
|
+
selfieImage = _f.selfieImage;
|
|
17381
17411
|
var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
|
|
17382
|
-
var
|
|
17383
|
-
captureState =
|
|
17384
|
-
setCaptureState =
|
|
17412
|
+
var _g = React.useState('LOADING'),
|
|
17413
|
+
captureState = _g[0],
|
|
17414
|
+
setCaptureState = _g[1];
|
|
17385
17415
|
var onCustomerMatchedCallback = React.useCallback(function (response) {
|
|
17386
17416
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
17387
17417
|
return __generator(this, function (_a) {
|
|
@@ -17413,9 +17443,9 @@
|
|
|
17413
17443
|
onCaptureGuidanceTimeout === null || onCaptureGuidanceTimeout === void 0 ? void 0 : onCaptureGuidanceTimeout();
|
|
17414
17444
|
}, 0);
|
|
17415
17445
|
}, [onCaptureGuidanceTimeout, releaseCameraAccess]);
|
|
17416
|
-
var
|
|
17417
|
-
attempt =
|
|
17418
|
-
setAttempt =
|
|
17446
|
+
var _h = React.useState(0),
|
|
17447
|
+
attempt = _h[0],
|
|
17448
|
+
setAttempt = _h[1];
|
|
17419
17449
|
var onExitCallback = React.useCallback(function () {
|
|
17420
17450
|
setAttempt(function (n) {
|
|
17421
17451
|
return n + 1;
|
|
@@ -17431,6 +17461,7 @@
|
|
|
17431
17461
|
onCaptureGuidanceTimeout: onCaptureGuidanceTimeoutCallback,
|
|
17432
17462
|
onExit: onExitCallback,
|
|
17433
17463
|
captureGuidanceTimeoutDurationMs: captureGuidanceTimeoutDurationMs,
|
|
17464
|
+
colors: colors,
|
|
17434
17465
|
verbiage: verbiage,
|
|
17435
17466
|
debugMode: debugMode
|
|
17436
17467
|
});
|
|
@@ -17495,6 +17526,7 @@
|
|
|
17495
17526
|
onCaptureGuidanceTimeout = _a.onCaptureGuidanceTimeout,
|
|
17496
17527
|
onExitAfterFailure = _a.onExitAfterFailure,
|
|
17497
17528
|
assets = _a.assets,
|
|
17529
|
+
colors = _a.colors,
|
|
17498
17530
|
verbiage = _a.verbiage,
|
|
17499
17531
|
geolocationEnabled = _a.geolocationEnabled,
|
|
17500
17532
|
_e = _a.geolocationRequired,
|
|
@@ -17524,6 +17556,7 @@
|
|
|
17524
17556
|
onCaptureGuidanceTimeout: onCaptureGuidanceTimeout,
|
|
17525
17557
|
captureGuidanceTimeoutDurationMs: timeoutDurationMs,
|
|
17526
17558
|
assets: assets,
|
|
17559
|
+
colors: colors,
|
|
17527
17560
|
verbiage: verbiage,
|
|
17528
17561
|
debugMode: debugMode
|
|
17529
17562
|
}))));
|
|
@@ -17581,6 +17614,7 @@
|
|
|
17581
17614
|
_d = _a.timeoutDurationMs,
|
|
17582
17615
|
timeoutDurationMs = _d === void 0 ? 15000 : _d,
|
|
17583
17616
|
assets = _a.assets,
|
|
17617
|
+
colors = _a.colors,
|
|
17584
17618
|
verbiage = _a.verbiage,
|
|
17585
17619
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
17586
17620
|
onComplete = _a.onComplete,
|
|
@@ -17605,10 +17639,11 @@
|
|
|
17605
17639
|
onExitAfterFailure: onExitAfterFailure,
|
|
17606
17640
|
timeoutDurationMs: timeoutDurationMs,
|
|
17607
17641
|
assets: assets,
|
|
17642
|
+
colors: colors,
|
|
17608
17643
|
verbiage: verbiage,
|
|
17609
17644
|
debugMode: debugMode
|
|
17610
17645
|
};
|
|
17611
|
-
}, [assets, debugMode, onExitAfterFailure, timeoutDurationMs, verbiage]);
|
|
17646
|
+
}, [assets, colors, debugMode, onExitAfterFailure, timeoutDurationMs, verbiage]);
|
|
17612
17647
|
var signatureCaptureProps = React.useMemo(function () {
|
|
17613
17648
|
return {
|
|
17614
17649
|
verbiage: {
|