idmission-web-sdk 2.3.5 → 2.3.7
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/common/SelfieProgressPreview.d.ts +3 -3
- package/dist/components/common/SelfieProgressPreview.d.ts.map +1 -1
- package/dist/components/common/overlay.d.ts +10 -4
- package/dist/components/common/overlay.d.ts.map +1 -1
- package/dist/components/customer_flows/IdValidation.d.ts +6 -0
- package/dist/components/customer_flows/IdValidation.d.ts.map +1 -1
- package/dist/components/customer_flows/SignatureKYC.d.ts +3 -5
- package/dist/components/customer_flows/SignatureKYC.d.ts.map +1 -1
- package/dist/components/fallback_flows/SelfieCapture.d.ts +1 -1
- package/dist/components/fallback_flows/SelfieCapture.d.ts.map +1 -1
- package/dist/components/id_capture/DocumentDetectionModelProvider.d.ts +3 -1
- package/dist/components/id_capture/DocumentDetectionModelProvider.d.ts.map +1 -1
- package/dist/components/id_capture/FocusModelProvider.d.ts +3 -1
- package/dist/components/id_capture/FocusModelProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCapture.d.ts +1 -1
- package/dist/components/id_capture/IdCapture.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureFitGuide.d.ts +2 -2
- package/dist/components/id_capture/IdCaptureFitGuide.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureGuideOverlay.d.ts +1 -1
- package/dist/components/id_capture/IdCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureLoadingOverlay.d.ts +3 -0
- package/dist/components/id_capture/IdCaptureLoadingOverlay.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureLoadingOverlayDefault.d.ts +2 -2
- package/dist/components/id_capture/IdCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +3 -0
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureOrUploadScreen.d.ts.map +1 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts +4 -1
- package/dist/components/id_capture/IdCaptureWizard.d.ts.map +1 -1
- package/dist/components/read_text_prompt/ReadTextPrompt.d.ts +2 -2
- package/dist/components/read_text_prompt/ReadTextPrompt.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieCapture.d.ts +1 -1
- package/dist/components/selfie_capture/SelfieCapture.d.ts.map +1 -1
- package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts +3 -0
- package/dist/components/selfie_capture/SelfieGuidanceModelsProvider.d.ts.map +1 -1
- package/dist/components/video_id/IdVideoCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts +6 -5
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts +10 -7
- package/dist/components/video_signature_capture/VideoSignatureGuides.d.ts.map +1 -1
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts +5 -4
- package/dist/components/video_signature_capture/VideoSignatureWizard.d.ts.map +1 -1
- package/dist/lib/locales/index.d.ts +5 -4
- package/dist/lib/locales/index.d.ts.map +1 -1
- package/dist/lib/locales/render.d.ts +3 -0
- package/dist/lib/locales/render.d.ts.map +1 -0
- package/dist/lib/models/DocumentDetection.d.ts +3 -0
- package/dist/lib/models/DocumentDetection.d.ts.map +1 -1
- package/dist/lib/models/FaceDetection.d.ts +3 -0
- package/dist/lib/models/FaceDetection.d.ts.map +1 -1
- package/dist/lib/models/Focus.d.ts +3 -0
- package/dist/lib/models/Focus.d.ts.map +1 -1
- package/dist/lib/models/helpers.d.ts +1 -0
- package/dist/lib/models/helpers.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +339 -206
- 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 +339 -206
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +339 -206
- 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 +3 -3
|
@@ -235,7 +235,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
235
235
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
236
236
|
};
|
|
237
237
|
|
|
238
|
-
var webSdkVersion = '2.3.
|
|
238
|
+
var webSdkVersion = '2.3.7';
|
|
239
239
|
|
|
240
240
|
function getPlatform() {
|
|
241
241
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -518,7 +518,7 @@ var WideBorderButton = styled__default.default(WideButton)(templateObject_8$4 ||
|
|
|
518
518
|
var _a, _b;
|
|
519
519
|
return (_b = (_a = props.colors) === null || _a === void 0 ? void 0 : _a.borderColor) !== null && _b !== void 0 ? _b : 'var(--idm-color-secondary-500)';
|
|
520
520
|
});
|
|
521
|
-
var LoadingOverlayInner = styled__default.default(OverlayInner$2)(templateObject_9$
|
|
521
|
+
var LoadingOverlayInner = styled__default.default(OverlayInner$2)(templateObject_9$4 || (templateObject_9$4 = __makeTemplateObject(["\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n padding: 0;\n"], ["\n position: relative;\n height: 100%;\n display: flex;\n flex-direction: column;\n padding: 0;\n"])));
|
|
522
522
|
var LoadingOverlayHeader = styled__default.default.div(templateObject_10$2 || (templateObject_10$2 = __makeTemplateObject(["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ", "\n padding-bottom: 0;\n"], ["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ", "\n padding-bottom: 0;\n"])), function (props) {
|
|
523
523
|
var _a;
|
|
524
524
|
return (_a = props.theme.textAlign) !== null && _a !== void 0 ? _a : 'center';
|
|
@@ -527,17 +527,23 @@ var LoadingOverlayHeader = styled__default.default.div(templateObject_10$2 || (t
|
|
|
527
527
|
});
|
|
528
528
|
var LoadingOverlayGuidanceMessage = styled__default.default(GuidanceMessage)(templateObject_11$1 || (templateObject_11$1 = __makeTemplateObject(["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"], ["\n padding: 16px 24px;\n margin-top: 16px;\n font-size: 18px;\n font-weight: bold;\n background: white;\n box-shadow:\n 0 1px 3px 0 rgb(0 0 0 / 0.1),\n 0 1px 2px -1px rgb(0 0 0 / 0.1);\n"])));
|
|
529
529
|
var LoadingOverlayImageContainer = styled__default.default(OverlayImageContainer)(templateObject_12$1 || (templateObject_12$1 = __makeTemplateObject(["\n padding: 0;\n max-height: 100%;\n pointer-events: none;\n"], ["\n padding: 0;\n max-height: 100%;\n pointer-events: none;\n"])));
|
|
530
|
-
var LoadingOverlayProgressBarBackground = styled__default.default.div(
|
|
531
|
-
|
|
530
|
+
var LoadingOverlayProgressBarBackground = styled__default.default.div.attrs({
|
|
531
|
+
className: 'loading-overlay-progress-bar-background'
|
|
532
|
+
})(templateObject_13$1 || (templateObject_13$1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
533
|
+
var LoadingOverlayProgressBar = styled__default.default.span.attrs({
|
|
534
|
+
className: 'loading-overlay-progress-bar'
|
|
535
|
+
})(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n"])), function (props) {
|
|
532
536
|
return props.$progress;
|
|
533
537
|
});
|
|
534
|
-
var LoadingOverlayProgressIndicator = styled__default.default.span(
|
|
538
|
+
var LoadingOverlayProgressIndicator = styled__default.default.span.attrs({
|
|
539
|
+
className: 'loading-overlay-progress-indicator'
|
|
540
|
+
})(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: block;\n height: 100%;\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n"], ["\n display: block;\n height: 100%;\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n"])), progressBarAnimation);
|
|
535
541
|
var LoadingOverlayButtonsRow = styled__default.default(ButtonsRow$2)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n min-height: 100px;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n"], ["\n display: flex;\n flex-direction: row;\n padding: 15px 25px;\n min-height: 100px;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n"])));
|
|
536
542
|
var LoadingOverlayLoadingListContainer = styled__default.default.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n position: relative;\n z-index: 2;\n"], ["\n display: flex;\n position: relative;\n z-index: 2;\n"])));
|
|
537
543
|
var LoadingOverlayLoadingList = styled__default.default.ul(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"], ["\n display: block;\n margin: auto;\n list-style: none;\n padding: 0;\n"])));
|
|
538
544
|
var LoadingOverlayLoadingListItem = styled__default.default.li(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n"], ["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n padding: 2px 1.25rem 2px 0;\n line-height: 1rem;\n"])));
|
|
539
545
|
var LoadingOverlayProgressContainer = styled__default.default.div(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
540
|
-
var templateObject_1$M, templateObject_2$D, templateObject_3$r, templateObject_4$l, templateObject_5$e, templateObject_6$a, templateObject_7$7, templateObject_8$4, templateObject_9$
|
|
546
|
+
var templateObject_1$M, templateObject_2$D, templateObject_3$r, templateObject_4$l, templateObject_5$e, templateObject_6$a, templateObject_7$7, templateObject_8$4, templateObject_9$4, templateObject_10$2, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20;
|
|
541
547
|
|
|
542
548
|
var GeolocationAccessDeniedOverlay = function GeolocationAccessDeniedOverlay(_a) {
|
|
543
549
|
var accessBlockedImageUrl = _a.accessBlockedImageUrl;
|
|
@@ -2503,19 +2509,23 @@ function useLoadFocusModel(_a) {
|
|
|
2503
2509
|
videoRef = _a.videoRef,
|
|
2504
2510
|
_d = _a.shouldLoadModels,
|
|
2505
2511
|
shouldLoadModels = _d === void 0 ? true : _d;
|
|
2506
|
-
var _e = React.useState(
|
|
2507
|
-
|
|
2508
|
-
|
|
2512
|
+
var _e = React.useState('not-started'),
|
|
2513
|
+
modelLoadState = _e[0],
|
|
2514
|
+
setModelLoadState = _e[1];
|
|
2509
2515
|
var _f = React.useState(0),
|
|
2510
2516
|
modelDownloadProgress = _f[0],
|
|
2511
2517
|
setModelDownloadProgress = _f[1];
|
|
2512
2518
|
var _g = React.useState(null),
|
|
2513
|
-
|
|
2514
|
-
|
|
2519
|
+
modelWarmingStartedAt = _g[0],
|
|
2520
|
+
setModelWarmingStartedAt = _g[1];
|
|
2521
|
+
var _h = React.useState(null),
|
|
2522
|
+
modelError = _h[0],
|
|
2523
|
+
setModelError = _h[1];
|
|
2515
2524
|
React.useEffect(function loadModel() {
|
|
2516
2525
|
var _this = this;
|
|
2517
2526
|
if (!shouldLoadModels) return;
|
|
2518
|
-
|
|
2527
|
+
setModelLoadState('downloading');
|
|
2528
|
+
setModelWarmingStartedAt(null);
|
|
2519
2529
|
function handleDownloadProgress(event) {
|
|
2520
2530
|
setModelDownloadProgress(progressToPercentage(event.detail));
|
|
2521
2531
|
}
|
|
@@ -2532,6 +2542,8 @@ function useLoadFocusModel(_a) {
|
|
|
2532
2542
|
case 0:
|
|
2533
2543
|
setModelDownloadProgress(100);
|
|
2534
2544
|
clearTimeout(modelLoadTimeout);
|
|
2545
|
+
setModelLoadState('warming');
|
|
2546
|
+
setModelWarmingStartedAt(new Date().getTime());
|
|
2535
2547
|
_a = waitForVideoReady(videoRef), videoReady = _a[0], cancel = _a[1];
|
|
2536
2548
|
cancelled = false;
|
|
2537
2549
|
cancelVideoReady = function cancelVideoReady() {
|
|
@@ -2544,7 +2556,7 @@ function useLoadFocusModel(_a) {
|
|
|
2544
2556
|
setTimeout(function () {
|
|
2545
2557
|
if (cancelled) return;
|
|
2546
2558
|
loadedModel.classifyForVideo(videoRef.current, performance.now());
|
|
2547
|
-
|
|
2559
|
+
setModelLoadState('ready');
|
|
2548
2560
|
}, 500);
|
|
2549
2561
|
return [2 /*return*/];
|
|
2550
2562
|
}
|
|
@@ -2552,6 +2564,7 @@ function useLoadFocusModel(_a) {
|
|
|
2552
2564
|
});
|
|
2553
2565
|
})["catch"](function (e) {
|
|
2554
2566
|
setModelError(e);
|
|
2567
|
+
setModelLoadState('error');
|
|
2555
2568
|
})["finally"](function () {
|
|
2556
2569
|
clearTimeout(modelLoadTimeout);
|
|
2557
2570
|
});
|
|
@@ -2566,11 +2579,15 @@ function useLoadFocusModel(_a) {
|
|
|
2566
2579
|
React.useEffect(function handleModelError() {
|
|
2567
2580
|
if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
|
|
2568
2581
|
}, [modelError, onModelError]);
|
|
2569
|
-
return {
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2582
|
+
return React.useMemo(function () {
|
|
2583
|
+
return {
|
|
2584
|
+
ready: modelLoadState === 'ready',
|
|
2585
|
+
modelLoadState: modelLoadState,
|
|
2586
|
+
modelDownloadProgress: modelDownloadProgress,
|
|
2587
|
+
modelWarmingStartedAt: modelWarmingStartedAt,
|
|
2588
|
+
modelError: modelError
|
|
2589
|
+
};
|
|
2590
|
+
}, [modelLoadState, modelDownloadProgress, modelWarmingStartedAt, modelError]);
|
|
2574
2591
|
}
|
|
2575
2592
|
var lastFocusPredictionAt = 0;
|
|
2576
2593
|
var lastFocusPredictionTime = 0;
|
|
@@ -2662,18 +2679,22 @@ function useLoadFaceDetector(_a) {
|
|
|
2662
2679
|
_b = _a.modelLoadTimeoutMs,
|
|
2663
2680
|
modelLoadTimeoutMs = _b === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _b,
|
|
2664
2681
|
videoRef = _a.videoRef;
|
|
2665
|
-
var _c = React.useState(
|
|
2666
|
-
|
|
2667
|
-
|
|
2682
|
+
var _c = React.useState('not-started'),
|
|
2683
|
+
modelLoadState = _c[0],
|
|
2684
|
+
setModelLoadState = _c[1];
|
|
2668
2685
|
var _d = React.useState(0),
|
|
2669
2686
|
modelDownloadProgress = _d[0],
|
|
2670
2687
|
setModelDownloadProgress = _d[1];
|
|
2671
2688
|
var _e = React.useState(null),
|
|
2672
|
-
|
|
2673
|
-
|
|
2689
|
+
modelWarmingStartedAt = _e[0],
|
|
2690
|
+
setModelWarmingStartedAt = _e[1];
|
|
2691
|
+
var _f = React.useState(null),
|
|
2692
|
+
modelError = _f[0],
|
|
2693
|
+
setModelError = _f[1];
|
|
2674
2694
|
React.useEffect(function loadModel() {
|
|
2675
2695
|
var _this = this;
|
|
2676
|
-
|
|
2696
|
+
setModelLoadState('downloading');
|
|
2697
|
+
setModelWarmingStartedAt(null);
|
|
2677
2698
|
var modelLoadTimeout = setTimeout(function () {
|
|
2678
2699
|
setModelError(new Error('Model loading time limit exceeded.'));
|
|
2679
2700
|
}, modelLoadTimeoutMs);
|
|
@@ -2690,6 +2711,8 @@ function useLoadFaceDetector(_a) {
|
|
|
2690
2711
|
case 0:
|
|
2691
2712
|
setModelDownloadProgress(100);
|
|
2692
2713
|
clearTimeout(modelLoadTimeout);
|
|
2714
|
+
setModelLoadState('warming');
|
|
2715
|
+
setModelWarmingStartedAt(new Date().getTime());
|
|
2693
2716
|
_a = waitForVideoReady(videoRef), videoReady = _a[0], cancel = _a[1];
|
|
2694
2717
|
cancelled = false;
|
|
2695
2718
|
cancelVideoReady = function cancelVideoReady() {
|
|
@@ -2701,13 +2724,14 @@ function useLoadFaceDetector(_a) {
|
|
|
2701
2724
|
_b.sent();
|
|
2702
2725
|
if (cancelled) return [2 /*return*/];
|
|
2703
2726
|
model.detectForVideo(videoRef.current, performance.now());
|
|
2704
|
-
|
|
2727
|
+
setModelLoadState('ready');
|
|
2705
2728
|
return [2 /*return*/];
|
|
2706
2729
|
}
|
|
2707
2730
|
});
|
|
2708
2731
|
});
|
|
2709
2732
|
})["catch"](function (e) {
|
|
2710
2733
|
setModelError(e);
|
|
2734
|
+
setModelLoadState('error');
|
|
2711
2735
|
})["finally"](function () {
|
|
2712
2736
|
clearTimeout(modelLoadTimeout);
|
|
2713
2737
|
});
|
|
@@ -2722,11 +2746,15 @@ function useLoadFaceDetector(_a) {
|
|
|
2722
2746
|
React.useEffect(function handleModelError() {
|
|
2723
2747
|
if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
|
|
2724
2748
|
}, [modelError, onModelError]);
|
|
2725
|
-
return {
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2749
|
+
return React.useMemo(function () {
|
|
2750
|
+
return {
|
|
2751
|
+
ready: modelLoadState === 'ready',
|
|
2752
|
+
modelLoadState: modelLoadState,
|
|
2753
|
+
modelDownloadProgress: modelDownloadProgress,
|
|
2754
|
+
modelWarmingStartedAt: modelWarmingStartedAt,
|
|
2755
|
+
modelError: modelError
|
|
2756
|
+
};
|
|
2757
|
+
}, [modelLoadState, modelDownloadProgress, modelWarmingStartedAt, modelError]);
|
|
2730
2758
|
}
|
|
2731
2759
|
var lastFaceDetectionAt = 0;
|
|
2732
2760
|
var lastFaceDetectionTime = 0;
|
|
@@ -3168,19 +3196,23 @@ function useLoadDocumentDetector(_a) {
|
|
|
3168
3196
|
scoreThreshold = _e === void 0 ? defaultDocumentDetectionScoreThreshold : _e,
|
|
3169
3197
|
onModelError = _a.onModelError,
|
|
3170
3198
|
videoRef = _a.videoRef;
|
|
3171
|
-
var _f = React.useState(
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
var _g = React.useState(
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
var _h = React.useState(
|
|
3178
|
-
|
|
3179
|
-
|
|
3199
|
+
var _f = React.useState('not-started'),
|
|
3200
|
+
modelLoadState = _f[0],
|
|
3201
|
+
setModelLoadState = _f[1];
|
|
3202
|
+
var _g = React.useState(null),
|
|
3203
|
+
modelWarmingStartedAt = _g[0],
|
|
3204
|
+
setModelWarmingStartedAt = _g[1];
|
|
3205
|
+
var _h = React.useState(0),
|
|
3206
|
+
modelDownloadProgress = _h[0],
|
|
3207
|
+
setModelDownloadProgress = _h[1];
|
|
3208
|
+
var _j = React.useState(null),
|
|
3209
|
+
modelError = _j[0],
|
|
3210
|
+
setModelError = _j[1];
|
|
3180
3211
|
React.useEffect(function loadModel() {
|
|
3181
3212
|
var _this = this;
|
|
3182
3213
|
if (!shouldLoadModels) return;
|
|
3183
|
-
|
|
3214
|
+
setModelLoadState('downloading');
|
|
3215
|
+
setModelWarmingStartedAt(null);
|
|
3184
3216
|
function handleDownloadProgress(event) {
|
|
3185
3217
|
setModelDownloadProgress(progressToPercentage(event.detail));
|
|
3186
3218
|
}
|
|
@@ -3196,6 +3228,8 @@ function useLoadDocumentDetector(_a) {
|
|
|
3196
3228
|
switch (_b.label) {
|
|
3197
3229
|
case 0:
|
|
3198
3230
|
setModelDownloadProgress(100);
|
|
3231
|
+
setModelLoadState('warming');
|
|
3232
|
+
setModelWarmingStartedAt(new Date().getTime());
|
|
3199
3233
|
clearTimeout(modelLoadTimeout);
|
|
3200
3234
|
_a = waitForVideoReady(videoRef), videoReady = _a[0], cancel = _a[1];
|
|
3201
3235
|
cancelled = false;
|
|
@@ -3209,7 +3243,7 @@ function useLoadDocumentDetector(_a) {
|
|
|
3209
3243
|
setTimeout(function () {
|
|
3210
3244
|
if (cancelled) return;
|
|
3211
3245
|
model.detectForVideo(videoRef.current, performance.now());
|
|
3212
|
-
|
|
3246
|
+
setModelLoadState('ready');
|
|
3213
3247
|
}, 500);
|
|
3214
3248
|
return [2 /*return*/];
|
|
3215
3249
|
}
|
|
@@ -3217,6 +3251,7 @@ function useLoadDocumentDetector(_a) {
|
|
|
3217
3251
|
});
|
|
3218
3252
|
})["catch"](function (e) {
|
|
3219
3253
|
setModelError(e);
|
|
3254
|
+
setModelLoadState('error');
|
|
3220
3255
|
})["finally"](function () {
|
|
3221
3256
|
clearTimeout(modelLoadTimeout);
|
|
3222
3257
|
});
|
|
@@ -3231,12 +3266,16 @@ function useLoadDocumentDetector(_a) {
|
|
|
3231
3266
|
React.useEffect(function handleModelError() {
|
|
3232
3267
|
if (modelError) onModelError === null || onModelError === void 0 ? void 0 : onModelError(modelError);
|
|
3233
3268
|
}, [modelError, onModelError]);
|
|
3234
|
-
return {
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3269
|
+
return React.useMemo(function () {
|
|
3270
|
+
return {
|
|
3271
|
+
ready: modelLoadState === 'ready',
|
|
3272
|
+
modelLoadState: modelLoadState,
|
|
3273
|
+
modelDownloadProgress: modelDownloadProgress,
|
|
3274
|
+
modelWarmingStartedAt: modelWarmingStartedAt,
|
|
3275
|
+
modelError: modelError,
|
|
3276
|
+
setModelError: setModelError
|
|
3277
|
+
};
|
|
3278
|
+
}, [modelLoadState, modelDownloadProgress, modelWarmingStartedAt, modelError]);
|
|
3240
3279
|
}
|
|
3241
3280
|
function makeDocumentDetectorPrediction(frame) {
|
|
3242
3281
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4643,6 +4682,12 @@ var zh = {
|
|
|
4643
4682
|
"We're sorry, but it looks like the camera is being tampered with. Please check your device and try again by reloading the page.": '很抱歉,看起來相機被篡改了。請檢查您的設備並重新載入頁面。'
|
|
4644
4683
|
};
|
|
4645
4684
|
|
|
4685
|
+
function renderVerbiage(verbiage) {
|
|
4686
|
+
if (typeof verbiage === 'string') return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, verbiage);
|
|
4687
|
+
var Verbiage = verbiage;
|
|
4688
|
+
return /*#__PURE__*/React__namespace.default.createElement(Verbiage, null);
|
|
4689
|
+
}
|
|
4690
|
+
|
|
4646
4691
|
var resources = {
|
|
4647
4692
|
en: {
|
|
4648
4693
|
translation: en
|
|
@@ -4697,11 +4742,12 @@ var useLanguage = function useLanguage(lang) {
|
|
|
4697
4742
|
};
|
|
4698
4743
|
function evaluateVerbiage(t, currentLanguage, verbiage, fallback) {
|
|
4699
4744
|
if (typeof verbiage === 'string') return verbiage;
|
|
4745
|
+
if (typeof verbiage === 'function') return renderVerbiage(verbiage);
|
|
4700
4746
|
if (typeof verbiage === 'object') {
|
|
4701
4747
|
var translations = verbiage;
|
|
4702
|
-
if (translations[currentLanguage]) return translations[currentLanguage];
|
|
4748
|
+
if (translations[currentLanguage]) return renderVerbiage(translations[currentLanguage]);
|
|
4703
4749
|
var nonLocaleLang = currentLanguage.split('-')[0];
|
|
4704
|
-
if (translations[nonLocaleLang]) return translations[nonLocaleLang];
|
|
4750
|
+
if (translations[nonLocaleLang]) return renderVerbiage(translations[nonLocaleLang]);
|
|
4705
4751
|
}
|
|
4706
4752
|
return t(fallback);
|
|
4707
4753
|
}
|
|
@@ -5193,8 +5239,9 @@ var DocumentDetectionModelContext = /*#__PURE__*/React.createContext({
|
|
|
5193
5239
|
loadDocumentDetectionModel: function loadDocumentDetectionModel() {
|
|
5194
5240
|
return null;
|
|
5195
5241
|
},
|
|
5196
|
-
|
|
5242
|
+
documentDetectionModelState: 'not-started',
|
|
5197
5243
|
documentDetectionModelDownloadProgress: 0,
|
|
5244
|
+
documentDetectionModelWarmingStartedAt: null,
|
|
5198
5245
|
documentDetectionModelError: null,
|
|
5199
5246
|
onDocumentDetected: function onDocumentDetected() {
|
|
5200
5247
|
return null;
|
|
@@ -5267,7 +5314,9 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5267
5314
|
shouldLoadModels: shouldLoadModels
|
|
5268
5315
|
}),
|
|
5269
5316
|
ready = _q.ready,
|
|
5317
|
+
modelLoadState = _q.modelLoadState,
|
|
5270
5318
|
modelDownloadProgress = _q.modelDownloadProgress,
|
|
5319
|
+
modelWarmingStartedAt = _q.modelWarmingStartedAt,
|
|
5271
5320
|
modelError = _q.modelError,
|
|
5272
5321
|
setModelError = _q.setModelError;
|
|
5273
5322
|
var _r = useFrameLoop(React.useCallback(function (frameId, timeRunning) {
|
|
@@ -5334,7 +5383,8 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5334
5383
|
startDocumentDetection: start,
|
|
5335
5384
|
stopDocumentDetection: stop,
|
|
5336
5385
|
loadDocumentDetectionModel: load,
|
|
5337
|
-
|
|
5386
|
+
documentDetectionModelState: modelLoadState,
|
|
5387
|
+
documentDetectionModelWarmingStartedAt: modelWarmingStartedAt,
|
|
5338
5388
|
documentDetectionModelError: modelError,
|
|
5339
5389
|
documentDetectionModelDownloadProgress: modelDownloadProgress,
|
|
5340
5390
|
onDocumentDetected: onDocumentDetected,
|
|
@@ -5346,7 +5396,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5346
5396
|
documentDetectionLastPredictionCanvas: lastPredictionCanvas,
|
|
5347
5397
|
clearDocumentDetectionLastPredictionCanvas: clearDocumentDetectionLastPredictionCanvas
|
|
5348
5398
|
};
|
|
5349
|
-
}, [start, stop, load,
|
|
5399
|
+
}, [start, stop, load, modelLoadState, modelWarmingStartedAt, modelError, modelDownloadProgress, onDocumentDetected, documentDetectionThresholds, documentDetectionBoundaries, clearDocumentDetectionLastPredictionCanvas]);
|
|
5350
5400
|
return /*#__PURE__*/React__namespace.createElement(DocumentDetectionModelContext.Provider, {
|
|
5351
5401
|
value: value
|
|
5352
5402
|
}, /*#__PURE__*/React__namespace.createElement(InvisibleCanvas, {
|
|
@@ -5359,8 +5409,9 @@ var FocusModelContext = /*#__PURE__*/React.createContext({
|
|
|
5359
5409
|
loadFocusModel: function loadFocusModel() {
|
|
5360
5410
|
return null;
|
|
5361
5411
|
},
|
|
5362
|
-
|
|
5412
|
+
focusModelState: 'not-started',
|
|
5363
5413
|
focusModelDownloadProgress: 0,
|
|
5414
|
+
focusModelWarmingStartedAt: null,
|
|
5364
5415
|
focusModelError: null,
|
|
5365
5416
|
focusThresholds: {},
|
|
5366
5417
|
setFocusThresholds: function setFocusThresholds() {
|
|
@@ -5402,7 +5453,9 @@ function FocusModelProvider(_a) {
|
|
|
5402
5453
|
shouldLoadModels: shouldLoadModels
|
|
5403
5454
|
}),
|
|
5404
5455
|
ready = _h.ready,
|
|
5456
|
+
modelLoadState = _h.modelLoadState,
|
|
5405
5457
|
modelDownloadProgress = _h.modelDownloadProgress,
|
|
5458
|
+
modelWarmingStartedAt = _h.modelWarmingStartedAt,
|
|
5406
5459
|
modelError = _h.modelError;
|
|
5407
5460
|
var makeFocusPrediction = React.useCallback(function (imageData, box) {
|
|
5408
5461
|
if (!ready) return null;
|
|
@@ -5414,15 +5467,16 @@ function FocusModelProvider(_a) {
|
|
|
5414
5467
|
var value = React.useMemo(function () {
|
|
5415
5468
|
return {
|
|
5416
5469
|
loadFocusModel: load,
|
|
5417
|
-
|
|
5470
|
+
focusModelState: modelLoadState,
|
|
5418
5471
|
focusModelDownloadProgress: modelDownloadProgress,
|
|
5472
|
+
focusModelWarmingStartedAt: modelWarmingStartedAt,
|
|
5419
5473
|
focusModelError: modelError,
|
|
5420
5474
|
makeFocusPrediction: makeFocusPrediction,
|
|
5421
5475
|
focusPredictionTime: lastFocusPredictionTime,
|
|
5422
5476
|
focusThresholds: focusThresholds,
|
|
5423
5477
|
setFocusThresholds: setFocusThresholds
|
|
5424
5478
|
};
|
|
5425
|
-
}, [focusThresholds, load, makeFocusPrediction, modelDownloadProgress, modelError,
|
|
5479
|
+
}, [focusThresholds, load, makeFocusPrediction, modelDownloadProgress, modelError, modelLoadState, modelWarmingStartedAt]);
|
|
5426
5480
|
return /*#__PURE__*/React__namespace.default.createElement(FocusModelContext.Provider, {
|
|
5427
5481
|
value: value
|
|
5428
5482
|
}, /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
@@ -5487,6 +5541,8 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
5487
5541
|
return null;
|
|
5488
5542
|
},
|
|
5489
5543
|
modelDownloadProgress: 0,
|
|
5544
|
+
modelLoadState: 'not-started',
|
|
5545
|
+
modelWarmingStartedAt: null,
|
|
5490
5546
|
modelError: null,
|
|
5491
5547
|
thresholds: defaultIdCaptureThresholds,
|
|
5492
5548
|
setThresholds: function setThresholds() {
|
|
@@ -5521,8 +5577,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
5521
5577
|
_b = _a.allowSinglePageIdCapture,
|
|
5522
5578
|
allowSinglePageIdCapture = _b === void 0 ? false : _b;
|
|
5523
5579
|
var _c = React.useContext(DocumentDetectionModelContext),
|
|
5524
|
-
|
|
5580
|
+
documentDetectionModelState = _c.documentDetectionModelState,
|
|
5525
5581
|
documentDetectionModelDownloadProgress = _c.documentDetectionModelDownloadProgress,
|
|
5582
|
+
documentDetectionModelWarmingStartedAt = _c.documentDetectionModelWarmingStartedAt,
|
|
5526
5583
|
startDocumentDetection = _c.startDocumentDetection,
|
|
5527
5584
|
stopDocumentDetection = _c.stopDocumentDetection,
|
|
5528
5585
|
loadDocumentDetectionModel = _c.loadDocumentDetectionModel,
|
|
@@ -5537,8 +5594,9 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
5537
5594
|
documentDetectionModelError = _c.documentDetectionModelError;
|
|
5538
5595
|
var _d = React.useContext(FocusModelContext),
|
|
5539
5596
|
loadFocusModel = _d.loadFocusModel,
|
|
5540
|
-
|
|
5597
|
+
focusModelState = _d.focusModelState,
|
|
5541
5598
|
focusModelDownloadProgress = _d.focusModelDownloadProgress,
|
|
5599
|
+
focusModelWarmingStartedAt = _d.focusModelWarmingStartedAt,
|
|
5542
5600
|
makeFocusPrediction = _d.makeFocusPrediction,
|
|
5543
5601
|
focusThresholds = _d.focusThresholds,
|
|
5544
5602
|
setFocusThresholds = _d.setFocusThresholds,
|
|
@@ -5646,10 +5704,17 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
5646
5704
|
loadDocumentDetectionModel();
|
|
5647
5705
|
loadFocusModel();
|
|
5648
5706
|
}, [loadDocumentDetectionModel, loadFocusModel]);
|
|
5707
|
+
var ready = documentDetectionModelState === 'ready' && focusModelState === 'ready';
|
|
5708
|
+
var modelLoadState = ready ? 'ready' : documentDetectionModelState === 'warming' || focusModelState === 'warming' ? 'warming' : focusModelState === 'downloading' || documentDetectionModelState === 'downloading' ? 'downloading' : 'not-started';
|
|
5709
|
+
var modelWarmingStartedAt = !documentDetectionModelWarmingStartedAt && !focusModelWarmingStartedAt ? null : Math.min.apply(Math, [documentDetectionModelWarmingStartedAt, focusModelWarmingStartedAt].filter(function (v) {
|
|
5710
|
+
return v !== null;
|
|
5711
|
+
}));
|
|
5649
5712
|
var value = React.useMemo(function () {
|
|
5650
5713
|
return {
|
|
5651
|
-
ready:
|
|
5714
|
+
ready: ready,
|
|
5652
5715
|
modelDownloadProgress: (documentDetectionModelDownloadProgress + focusModelDownloadProgress) / 2,
|
|
5716
|
+
modelLoadState: modelLoadState,
|
|
5717
|
+
modelWarmingStartedAt: modelWarmingStartedAt,
|
|
5653
5718
|
modelError: modelError,
|
|
5654
5719
|
start: startDocumentDetection,
|
|
5655
5720
|
stop: stopDocumentDetection,
|
|
@@ -5667,7 +5732,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
5667
5732
|
requiredDocumentType: requiredDocumentType,
|
|
5668
5733
|
setRequiredDocumentType: setRequiredDocumentType
|
|
5669
5734
|
};
|
|
5670
|
-
}, [detectionTime, documentDetectionBoundaries, documentDetectionModelDownloadProgress,
|
|
5735
|
+
}, [detectionTime, documentDetectionBoundaries, documentDetectionModelDownloadProgress, focusModelDownloadProgress, focusPredictionTime, getBestFrame, load, modelLoadState, modelError, modelWarmingStartedAt, onPredictionMade, ready, requiredDocumentType, resetBestFrame, setDocumentDetectionBoundaries, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
5671
5736
|
return /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsContext.Provider, {
|
|
5672
5737
|
value: value
|
|
5673
5738
|
}, /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
@@ -7310,7 +7375,10 @@ function LoadingListItemIndicator(_a) {
|
|
|
7310
7375
|
var legacyInstructionImageUrl$1 = "".concat(DEFAULT_CDN_URL, "/WebSDK-Instruction-DL-Capture-3-Portrait.png");
|
|
7311
7376
|
var IdCaptureLoadingOverlayDefault = function IdCaptureLoadingOverlayDefault(_a) {
|
|
7312
7377
|
var _b, _c, _d, _e, _f, _g;
|
|
7313
|
-
var
|
|
7378
|
+
var onLoadingStarted = _a.onLoadingStarted,
|
|
7379
|
+
onLoadingProgress = _a.onLoadingProgress,
|
|
7380
|
+
onLoadingCompleted = _a.onLoadingCompleted,
|
|
7381
|
+
onDismissed = _a.onDismissed,
|
|
7314
7382
|
onUserCancel = _a.onUserCancel,
|
|
7315
7383
|
instructions = _a.instructions,
|
|
7316
7384
|
_h = _a.rotateImage,
|
|
@@ -7328,7 +7396,9 @@ var IdCaptureLoadingOverlayDefault = function IdCaptureLoadingOverlayDefault(_a)
|
|
|
7328
7396
|
var sessionReady = sessionCheckState === 'PASSED';
|
|
7329
7397
|
var _o = useIdCaptureModelsContext(),
|
|
7330
7398
|
modelsReady = _o.ready,
|
|
7331
|
-
|
|
7399
|
+
modelLoadState = _o.modelLoadState,
|
|
7400
|
+
modelDownloadProgress = _o.modelDownloadProgress,
|
|
7401
|
+
modelWarmingStartedAt = _o.modelWarmingStartedAt;
|
|
7332
7402
|
var _p = useCameraStore(),
|
|
7333
7403
|
cameraReady = _p.cameraReady,
|
|
7334
7404
|
cameraAccessDenied = _p.cameraAccessDenied,
|
|
@@ -7351,11 +7421,27 @@ var IdCaptureLoadingOverlayDefault = function IdCaptureLoadingOverlayDefault(_a)
|
|
|
7351
7421
|
pleaseWaitText: 'Please wait...',
|
|
7352
7422
|
sessionCheckingText: 'Authenticating...'
|
|
7353
7423
|
});
|
|
7424
|
+
var onLoadingStartedRef = React.useRef(onLoadingStarted);
|
|
7425
|
+
React.useEffect(function () {
|
|
7426
|
+
onLoadingStartedRef.current = onLoadingStarted;
|
|
7427
|
+
}, [onLoadingStarted]);
|
|
7428
|
+
var onLoadingProgressRef = React.useRef(onLoadingProgress);
|
|
7429
|
+
React.useEffect(function () {
|
|
7430
|
+
onLoadingProgressRef.current = onLoadingProgress;
|
|
7431
|
+
}, [onLoadingProgress]);
|
|
7432
|
+
var onLoadingCompletedRef = React.useRef(onLoadingCompleted);
|
|
7433
|
+
React.useEffect(function () {
|
|
7434
|
+
onLoadingCompletedRef.current = onLoadingCompleted;
|
|
7435
|
+
}, [onLoadingCompleted]);
|
|
7354
7436
|
var ready = sessionReady && modelsReady && cameraReady;
|
|
7355
7437
|
React.useEffect(function () {
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7438
|
+
var _a;
|
|
7439
|
+
if (ready) {
|
|
7440
|
+
(_a = onLoadingCompletedRef.current) === null || _a === void 0 ? void 0 : _a.call(onLoadingCompletedRef);
|
|
7441
|
+
return function () {
|
|
7442
|
+
return null;
|
|
7443
|
+
};
|
|
7444
|
+
}
|
|
7359
7445
|
var t = setTimeout(function () {
|
|
7360
7446
|
return setDismissed(false);
|
|
7361
7447
|
}, 500);
|
|
@@ -7364,6 +7450,19 @@ var IdCaptureLoadingOverlayDefault = function IdCaptureLoadingOverlayDefault(_a)
|
|
|
7364
7450
|
};
|
|
7365
7451
|
}, [ready]);
|
|
7366
7452
|
var imageRef = React.useRef(null);
|
|
7453
|
+
var timeSinceWarmingStarted = modelWarmingStartedAt ? new Date().getTime() - modelWarmingStartedAt : 0;
|
|
7454
|
+
var warmingProgress = timeSinceWarmingStarted / 5000.0;
|
|
7455
|
+
var modelLoadProgress = modelsReady ? 100 : modelDownloadProgress * 0.5 + warmingProgress * 49.0;
|
|
7456
|
+
React.useEffect(function () {
|
|
7457
|
+
var _a;
|
|
7458
|
+
(_a = onLoadingStartedRef.current) === null || _a === void 0 ? void 0 : _a.call(onLoadingStartedRef);
|
|
7459
|
+
}, []);
|
|
7460
|
+
React.useEffect(function () {
|
|
7461
|
+
var _a;
|
|
7462
|
+
if (modelLoadProgress > 0) {
|
|
7463
|
+
(_a = onLoadingProgressRef.current) === null || _a === void 0 ? void 0 : _a.call(onLoadingProgressRef, modelLoadProgress);
|
|
7464
|
+
}
|
|
7465
|
+
}, [modelLoadProgress]);
|
|
7367
7466
|
if (dismissed) return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null);
|
|
7368
7467
|
if (cameraAccessDenied) {
|
|
7369
7468
|
return /*#__PURE__*/React__namespace.default.createElement(CameraAccessDeniedOverlay, {
|
|
@@ -7423,7 +7522,7 @@ var IdCaptureLoadingOverlayDefault = function IdCaptureLoadingOverlayDefault(_a)
|
|
|
7423
7522
|
}, /*#__PURE__*/React__namespace.default.createElement(ProgressBarBackground$1, {
|
|
7424
7523
|
className: classNames.progressBackground
|
|
7425
7524
|
}), /*#__PURE__*/React__namespace.default.createElement(LoadingOverlayProgressBar, {
|
|
7426
|
-
"$progress":
|
|
7525
|
+
"$progress": modelLoadProgress,
|
|
7427
7526
|
className: classNames.progressBar
|
|
7428
7527
|
}, /*#__PURE__*/React__namespace.default.createElement(ProgressIndicator$1, {
|
|
7429
7528
|
className: classNames.progressIndicator
|
|
@@ -7441,7 +7540,7 @@ var IdCaptureLoadingOverlayDefault = function IdCaptureLoadingOverlayDefault(_a)
|
|
|
7441
7540
|
}, /*#__PURE__*/React__namespace.default.createElement(LoadingListItemIndicator, {
|
|
7442
7541
|
className: classNames.loadingListItemIndicator,
|
|
7443
7542
|
state: sessionReady && modelsReady ? 'done' : 'running'
|
|
7444
|
-
}), !sessionReady ? verbiage.sessionCheckingText : modelsReady ? verbiage.modelsReadyText :
|
|
7543
|
+
}), !sessionReady ? verbiage.sessionCheckingText : modelsReady ? verbiage.modelsReadyText : modelLoadState === 'downloading' ? "".concat(verbiage.downloadingText, " (").concat(modelDownloadProgress, "%)") : modelLoadState === 'warming' ? verbiage.modelsWarmingUpText : verbiage.modelsReadyText))), /*#__PURE__*/React__namespace.default.createElement(ContinueButtonContainer$1, {
|
|
7445
7544
|
className: classNames.continueBtnContainer
|
|
7446
7545
|
}, (ready || ((_g = (_f = theme.idCapture) === null || _f === void 0 ? void 0 : _f.loadingOverlay) === null || _g === void 0 ? void 0 : _g.displayDisabledContinueBtn)) && ( /*#__PURE__*/React__namespace.default.createElement(ContinueButton$1, {
|
|
7447
7546
|
autoFocus: true,
|
|
@@ -7480,9 +7579,12 @@ var ProgressBarBackground$1 = styled__default.default(LoadingOverlayProgressBarB
|
|
|
7480
7579
|
var _a, _b, _c, _d;
|
|
7481
7580
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundOpacity) !== null && _d !== void 0 ? _d : 0.75;
|
|
7482
7581
|
});
|
|
7483
|
-
var ProgressIndicator$1 = styled__default.default(LoadingOverlayProgressIndicator)(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject(["\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n"], ["\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n"])), progressBarAnimation)
|
|
7582
|
+
var ProgressIndicator$1 = styled__default.default(LoadingOverlayProgressIndicator)(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject(["\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n background: ", ";\n"], ["\n animation: ", " 3s ease-in-out;\n animation-fill-mode: both;\n background: ", ";\n"])), progressBarAnimation, function (props) {
|
|
7583
|
+
var _a, _b, _c, _d;
|
|
7584
|
+
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarIndicatorColor) !== null && _d !== void 0 ? _d : 'var(--idm-color-primary-500)';
|
|
7585
|
+
});
|
|
7484
7586
|
var CustomLoadingGraphic$1 = styled__default.default.img(templateObject_8$3 || (templateObject_8$3 = __makeTemplateObject(["\n transform-style: preserve-3d;\n"], ["\n transform-style: preserve-3d;\n"])));
|
|
7485
|
-
var ContinueButtonContainer$1 = styled__default.default.div(templateObject_9$
|
|
7587
|
+
var ContinueButtonContainer$1 = styled__default.default.div(templateObject_9$3 || (templateObject_9$3 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
7486
7588
|
var ContinueButton$1 = styled__default.default(LoaderButton)(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject(["\n margin: auto;\n white-space: nowrap;\n ", "\n ", "\n \n &:focus-visible {\n ", "\n box-shadow: none;\n }\n\n &.disabled {\n background: ", ";\n color: ", ";\n border: ", ";\n }\n"], ["\n margin: auto;\n white-space: nowrap;\n ", "\n ", "\n \n &:focus-visible {\n ", "\n box-shadow: none;\n }\n\n &.disabled {\n background: ", ";\n color: ", ";\n border: ", ";\n }\n"])), function (props) {
|
|
7487
7589
|
var _a, _b, _c, _d, _e, _f;
|
|
7488
7590
|
return ((_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarFontSize) ? "font-size: ".concat((_f = (_e = (_d = props.theme) === null || _d === void 0 ? void 0 : _d.idCapture) === null || _e === void 0 ? void 0 : _e.loadingOverlay) === null || _f === void 0 ? void 0 : _f.progressBarFontSize, ";") : '';
|
|
@@ -7502,7 +7604,7 @@ var ContinueButton$1 = styled__default.default(LoaderButton)(templateObject_10$1
|
|
|
7502
7604
|
var _a, _b, _c, _d;
|
|
7503
7605
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.continueBtnDisabledBorder) !== null && _d !== void 0 ? _d : 'none';
|
|
7504
7606
|
});
|
|
7505
|
-
var templateObject_1$E, templateObject_2$x, templateObject_3$m, templateObject_4$g, templateObject_5$c, templateObject_6$9, templateObject_7$6, templateObject_8$3, templateObject_9$
|
|
7607
|
+
var templateObject_1$E, templateObject_2$x, templateObject_3$m, templateObject_4$g, templateObject_5$c, templateObject_6$9, templateObject_7$6, templateObject_8$3, templateObject_9$3, templateObject_10$1;
|
|
7506
7608
|
|
|
7507
7609
|
var ContinuityCameraCheckboxContainer = styled__default.default.div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n margin-top: 15px;\n margin-bottom: 15px;\n"], ["\n margin-top: 15px;\n margin-bottom: 15px;\n"])));
|
|
7508
7610
|
var ContinuityCameraCheckbox = styled__default.default.input(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["\n margin-right: 8px;\n"], ["\n margin-right: 8px;\n"])));
|
|
@@ -8368,7 +8470,7 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
|
|
|
8368
8470
|
"$maskColor": maskColor,
|
|
8369
8471
|
"$minHeight": padding,
|
|
8370
8472
|
className: regionClsx(classNames, 'Top')
|
|
8371
|
-
}, instruction
|
|
8473
|
+
}, !!instruction && ( /*#__PURE__*/React__namespace.default.createElement(GuideText, {
|
|
8372
8474
|
className: classNames.guideText
|
|
8373
8475
|
}, instruction))), /*#__PURE__*/React__namespace.default.createElement(GuideCenterRow, {
|
|
8374
8476
|
className: classNames.centerRow
|
|
@@ -8419,7 +8521,7 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
|
|
|
8419
8521
|
"$maskColor": maskColor,
|
|
8420
8522
|
"$minHeight": padding,
|
|
8421
8523
|
className: regionClsx(classNames, 'Bottom')
|
|
8422
|
-
}, instruction
|
|
8524
|
+
}, !!instruction && ( /*#__PURE__*/React__namespace.default.createElement(GuideText, {
|
|
8423
8525
|
style: {
|
|
8424
8526
|
opacity: 0
|
|
8425
8527
|
}
|
|
@@ -8457,8 +8559,8 @@ var GuideCenterBorder = styled__default.default.div(templateObject_7$5 || (templ
|
|
|
8457
8559
|
return props.$padding ? "padding: ".concat(props.$padding, "px;") : '';
|
|
8458
8560
|
});
|
|
8459
8561
|
var GuideText = styled__default.default.span(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"], ["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"])));
|
|
8460
|
-
var GuideCenterInner = styled__default.default.div(templateObject_9$
|
|
8461
|
-
var templateObject_1$y, templateObject_2$s, templateObject_3$j, templateObject_4$d, templateObject_5$9, templateObject_6$7, templateObject_7$5, templateObject_8$2, templateObject_9$
|
|
8562
|
+
var GuideCenterInner = styled__default.default.div(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n position: relative;\n margin: auto;\n"], ["\n position: relative;\n margin: auto;\n"])));
|
|
8563
|
+
var templateObject_1$y, templateObject_2$s, templateObject_3$j, templateObject_4$d, templateObject_5$9, templateObject_6$7, templateObject_7$5, templateObject_8$2, templateObject_9$2;
|
|
8462
8564
|
|
|
8463
8565
|
var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
|
|
8464
8566
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
@@ -9972,7 +10074,7 @@ var ScreenActionsBar = styled__default.default.div(templateObject_5$6 || (templa
|
|
|
9972
10074
|
var DashedSeparator = styled__default.default.div(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject(["\n width: 100%;\n height: 0;\n border-top: 2px solid #606060;\n border-top-style: dashed;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n width: 100%;\n height: 0;\n border-top: 2px solid #606060;\n border-top-style: dashed;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
9973
10075
|
var OrWrapper = styled__default.default.div(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject(["\n color: #323232;\n font-weight: bold;\n background: white;\n border-radius: 50%;\n top: -2px;\n position: relative;\n width: 60px;\n height: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n color: #323232;\n font-weight: bold;\n background: white;\n border-radius: 50%;\n top: -2px;\n position: relative;\n width: 60px;\n height: 60px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
9974
10076
|
var UploadIdBackHelpText = styled__default.default.p(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n color: #323232;\n font-style: italic;\n margin: 30px 0 0;\n"], ["\n color: #323232;\n font-style: italic;\n margin: 30px 0 0;\n"])));
|
|
9975
|
-
var Button = styled__default.default(WideBorderButton)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n width: auto;\n font-weight: 500;\n padding-left: 40px;\n padding-right: 40px;\n transition: background-color 0.3s ease;\n background-color: #ffffff;\n white-space: nowrap;\n\n &:disabled,\n &.disabled {\n background-color: #f1f1f1 !important;\n border-color: #dbdbdb !important;\n color: #323232 !important;\n }\n\n &:hover {\n filter: none;\n background-color: #fafafa !important;\n }\n"], ["\n width: auto;\n font-weight: 500;\n padding-left: 40px;\n padding-right: 40px;\n transition: background-color 0.3s ease;\n background-color: #ffffff;\n white-space: nowrap;\n\n &:disabled,\n &.disabled {\n background-color: #f1f1f1 !important;\n border-color: #dbdbdb !important;\n color: #323232 !important;\n }\n\n &:hover {\n filter: none;\n background-color: #fafafa !important;\n }\n"])));
|
|
10077
|
+
var Button = styled__default.default(WideBorderButton)(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject(["\n width: auto;\n font-weight: 500;\n padding-left: 40px;\n padding-right: 40px;\n transition: background-color 0.3s ease;\n background-color: #ffffff;\n white-space: nowrap;\n\n &:disabled,\n &.disabled {\n background-color: #f1f1f1 !important;\n border-color: #dbdbdb !important;\n color: #323232 !important;\n }\n\n &:hover {\n filter: none;\n background-color: #fafafa !important;\n }\n"], ["\n width: auto;\n font-weight: 500;\n padding-left: 40px;\n padding-right: 40px;\n transition: background-color 0.3s ease;\n background-color: #ffffff;\n white-space: nowrap;\n\n &:disabled,\n &.disabled {\n background-color: #f1f1f1 !important;\n border-color: #dbdbdb !important;\n color: #323232 !important;\n }\n\n &:hover {\n filter: none;\n background-color: #fafafa !important;\n }\n"])));
|
|
9976
10078
|
var Modal = styled__default.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
9977
10079
|
var Dialog = styled__default.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n width: 100%;\n max-width: 500px;\n height: 100%;\n max-height: 600px;\n background: white;\n border-radius: 25px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n font-family: ", ";\n //margin: 25px;\n"], ["\n width: 100%;\n max-width: 500px;\n height: 100%;\n max-height: 600px;\n background: white;\n border-radius: 25px;\n overflow: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);\n font-family: ", ";\n //margin: 25px;\n"])), function (props) {
|
|
9978
10080
|
var _a;
|
|
@@ -10250,17 +10352,20 @@ function humanFileSize(bytes, si, dp) {
|
|
|
10250
10352
|
} while (Math.round(Math.abs(bytes) * r) / r >= thresh && u < units.length - 1);
|
|
10251
10353
|
return bytes.toFixed(dp) + ' ' + units[u];
|
|
10252
10354
|
}
|
|
10253
|
-
var templateObject_1$p, templateObject_2$l, templateObject_3$f, templateObject_4$9, templateObject_5$6, templateObject_6$4, templateObject_7$3, templateObject_8$1, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
10355
|
+
var templateObject_1$p, templateObject_2$l, templateObject_3$f, templateObject_4$9, templateObject_5$6, templateObject_6$4, templateObject_7$3, templateObject_8$1, templateObject_9$1, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
10254
10356
|
|
|
10255
10357
|
var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
10256
10358
|
var _b, _c, _d, _e, _f;
|
|
10257
|
-
var
|
|
10359
|
+
var onLoadingStarted = _a.onLoadingStarted,
|
|
10360
|
+
onLoadingProgress = _a.onLoadingProgress,
|
|
10361
|
+
onLoadingCompleted = _a.onLoadingCompleted,
|
|
10362
|
+
onSuccess = _a.onSuccess,
|
|
10258
10363
|
onExitCapture = _a.onExitCapture,
|
|
10259
10364
|
onUserCancel = _a.onUserCancel,
|
|
10365
|
+
onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
|
|
10260
10366
|
_g = _a.loadingOverlayMode,
|
|
10261
10367
|
loadingOverlayMode = _g === void 0 ? 'default' : _g,
|
|
10262
10368
|
customOverlayContent = _a.customOverlayContent,
|
|
10263
|
-
onLoadingOverlayDismissed = _a.onLoadingOverlayDismissed,
|
|
10264
10369
|
precapturedDocuments = _a.precapturedDocuments,
|
|
10265
10370
|
_h = _a.captureRequirement,
|
|
10266
10371
|
captureRequirement = _h === void 0 ? 'idCardOrPassport' : _h,
|
|
@@ -10606,6 +10711,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
10606
10711
|
colors: colors.loadingOverlay,
|
|
10607
10712
|
verbiage: verbiage.loadingOverlay,
|
|
10608
10713
|
onUserCancel: onUserCancel,
|
|
10714
|
+
onLoadingStarted: onLoadingStarted,
|
|
10715
|
+
onLoadingProgress: onLoadingProgress,
|
|
10716
|
+
onLoadingCompleted: onLoadingCompleted,
|
|
10609
10717
|
onDismissed: function onDismissed() {
|
|
10610
10718
|
setOverlayDismissed(true);
|
|
10611
10719
|
onLoadingOverlayDismissed === null || onLoadingOverlayDismissed === void 0 ? void 0 : onLoadingOverlayDismissed();
|
|
@@ -11263,6 +11371,8 @@ var SelfieGuidanceModelsContext = /*#__PURE__*/React.createContext({
|
|
|
11263
11371
|
},
|
|
11264
11372
|
ready: false,
|
|
11265
11373
|
error: null,
|
|
11374
|
+
modelLoadState: 'not-started',
|
|
11375
|
+
modelWarmingStartedAt: null,
|
|
11266
11376
|
modelDownloadProgress: 0
|
|
11267
11377
|
});
|
|
11268
11378
|
function SelfieGuidanceModelsProvider(_a) {
|
|
@@ -11294,7 +11404,9 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11294
11404
|
videoRef: videoRef
|
|
11295
11405
|
}),
|
|
11296
11406
|
ready = _f.ready,
|
|
11407
|
+
modelLoadState = _f.modelLoadState,
|
|
11297
11408
|
modelDownloadProgress = _f.modelDownloadProgress,
|
|
11409
|
+
modelWarmingStartedAt = _f.modelWarmingStartedAt,
|
|
11298
11410
|
modelError = _f.modelError;
|
|
11299
11411
|
var _g = useFrameLoop(React.useCallback(function () {
|
|
11300
11412
|
return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -11356,9 +11468,11 @@ function SelfieGuidanceModelsProvider(_a) {
|
|
|
11356
11468
|
canvasRef: canvasRef,
|
|
11357
11469
|
onPredictionMade: onPredictionMade,
|
|
11358
11470
|
error: modelError,
|
|
11359
|
-
modelDownloadProgress: modelDownloadProgress
|
|
11471
|
+
modelDownloadProgress: modelDownloadProgress,
|
|
11472
|
+
modelLoadState: modelLoadState,
|
|
11473
|
+
modelWarmingStartedAt: modelWarmingStartedAt
|
|
11360
11474
|
};
|
|
11361
|
-
}, [start, stop, ready, onPredictionMade, modelError, modelDownloadProgress]);
|
|
11475
|
+
}, [start, stop, ready, onPredictionMade, modelError, modelDownloadProgress, modelLoadState, modelWarmingStartedAt]);
|
|
11362
11476
|
return /*#__PURE__*/React__namespace.createElement(SelfieGuidanceModelsContext.Provider, {
|
|
11363
11477
|
value: value
|
|
11364
11478
|
}, /*#__PURE__*/React__namespace.createElement(InvisibleCanvas, {
|
|
@@ -11723,7 +11837,7 @@ var SelfieCapture = function SelfieCapture(_a) {
|
|
|
11723
11837
|
}), /*#__PURE__*/React__namespace.default.createElement(GuidesComponent, {
|
|
11724
11838
|
classNames: classNames.guides,
|
|
11725
11839
|
status: satisfied ? 'processing' : 'ready'
|
|
11726
|
-
}), guidanceMessage
|
|
11840
|
+
}), !!guidanceMessage && ( /*#__PURE__*/React__namespace.default.createElement(GuidanceMessageContainer, {
|
|
11727
11841
|
className: classNames.guidanceMessageContainer
|
|
11728
11842
|
}, /*#__PURE__*/React__namespace.default.createElement(GuidanceMessage, {
|
|
11729
11843
|
"$variant": satisfied ? 'positive' : 'negative',
|
|
@@ -12064,7 +12178,7 @@ var FaceLivenessCapture = function FaceLivenessCapture(_a) {
|
|
|
12064
12178
|
guidesComponent: guidesByRequestState,
|
|
12065
12179
|
classNames: classNames,
|
|
12066
12180
|
colors: colors,
|
|
12067
|
-
verbiage:
|
|
12181
|
+
verbiage: rawVerbiage,
|
|
12068
12182
|
debugMode: debugMode
|
|
12069
12183
|
}), debugMode && !disableCapturePreview && imageUrl && ( /*#__PURE__*/React__namespace.default.createElement(SelfieProgressPreview, {
|
|
12070
12184
|
classNames: classNames.imagePreview,
|
|
@@ -13561,8 +13675,6 @@ function VideoSignatureGuides(_a) {
|
|
|
13561
13675
|
onClearSignaturePadClicked = _a.onClearSignaturePadClicked,
|
|
13562
13676
|
_d = _a.minSignaturePadPoints,
|
|
13563
13677
|
minSignaturePadPoints = _d === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _d,
|
|
13564
|
-
signaturePadEmptyContent = _a.signaturePadEmptyContent,
|
|
13565
|
-
headTrackingUnsatisfiedContent = _a.headTrackingUnsatisfiedContent,
|
|
13566
13678
|
_e = _a.headTrackingSatisfied,
|
|
13567
13679
|
headTrackingSatisfied = _e === void 0 ? true : _e,
|
|
13568
13680
|
_f = _a.classNames,
|
|
@@ -13583,6 +13695,8 @@ function VideoSignatureGuides(_a) {
|
|
|
13583
13695
|
signatureValid = _l[0],
|
|
13584
13696
|
setSignatureValid = _l[1];
|
|
13585
13697
|
var verbiage = useTranslations(rawVerbiage, {
|
|
13698
|
+
signaturePadEmptyText: '',
|
|
13699
|
+
headTrackingUnsatisfiedText: '',
|
|
13586
13700
|
clearSignatureBtnText: 'Clear',
|
|
13587
13701
|
acceptSignatureBtnText: 'Accept'
|
|
13588
13702
|
});
|
|
@@ -13596,9 +13710,13 @@ function VideoSignatureGuides(_a) {
|
|
|
13596
13710
|
var isSigning = requestedAction === 'CAPTURE_SIGNATURE';
|
|
13597
13711
|
var canClear = isSigning && !signaturePadEmpty;
|
|
13598
13712
|
var canSubmit = isSigning && signatureValid && headTrackingSatisfied;
|
|
13599
|
-
var
|
|
13600
|
-
|
|
13601
|
-
|
|
13713
|
+
var _m = React.useState(false),
|
|
13714
|
+
emptyContentDismissed = _m[0],
|
|
13715
|
+
setEmptyContentDismissed = _m[1];
|
|
13716
|
+
var displayEmptyState = requestedAction === 'CAPTURE_SIGNATURE' && signaturePadEmpty && !emptyContentDismissed;
|
|
13717
|
+
React.useEffect(function () {
|
|
13718
|
+
if (signaturePadEmpty) setEmptyContentDismissed(false);
|
|
13719
|
+
}, [signaturePadEmpty]);
|
|
13602
13720
|
return /*#__PURE__*/React__namespace.default.createElement(Container$3, {
|
|
13603
13721
|
className: classNames.container
|
|
13604
13722
|
}, /*#__PURE__*/React__namespace.default.createElement(Inner$1, {
|
|
@@ -13634,11 +13752,18 @@ function VideoSignatureGuides(_a) {
|
|
|
13634
13752
|
});
|
|
13635
13753
|
setSignatureValid(points.length >= minSignaturePadPoints);
|
|
13636
13754
|
}
|
|
13637
|
-
}), !headTrackingSatisfied &&
|
|
13638
|
-
className: classNames.
|
|
13639
|
-
},
|
|
13640
|
-
className: classNames.
|
|
13641
|
-
},
|
|
13755
|
+
}), !headTrackingSatisfied && !!verbiage.headTrackingUnsatisfiedText ? ( /*#__PURE__*/React__namespace.default.createElement(SignaturePadContentContainer, {
|
|
13756
|
+
className: classNames.headTrackingUnsatisfiedContentContainer
|
|
13757
|
+
}, /*#__PURE__*/React__namespace.default.createElement(SignaturePadContentInner, {
|
|
13758
|
+
className: classNames.headTrackingUnsatisfiedContentInner
|
|
13759
|
+
}, verbiage.headTrackingUnsatisfiedText))) : displayEmptyState && !!verbiage.signaturePadEmptyText && ( /*#__PURE__*/React__namespace.default.createElement(SignaturePadContentContainer, {
|
|
13760
|
+
className: classNames.emptyContentContainer,
|
|
13761
|
+
onClick: function onClick() {
|
|
13762
|
+
return setEmptyContentDismissed(true);
|
|
13763
|
+
}
|
|
13764
|
+
}, /*#__PURE__*/React__namespace.default.createElement(SignaturePadContentInner, {
|
|
13765
|
+
className: classNames.emptyContentInner
|
|
13766
|
+
}, verbiage.signaturePadEmptyText)))), /*#__PURE__*/React__namespace.default.createElement(SignatureButtonsContainer, {
|
|
13642
13767
|
className: classNames.signatureButtonsRow
|
|
13643
13768
|
}, /*#__PURE__*/React__namespace.default.createElement(LoaderButton, {
|
|
13644
13769
|
variant: "secondary",
|
|
@@ -13674,13 +13799,15 @@ var SignatureCanvasContainer = styled__default.default.div(templateObject_6$2 ||
|
|
|
13674
13799
|
return props.$headTrackingUnsatisfied ? 'pointer-events: none;' : '';
|
|
13675
13800
|
});
|
|
13676
13801
|
var AcceptBtn = styled__default.default(LoaderButton)(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n margin-left: auto;\n"], ["\n margin-left: auto;\n"])));
|
|
13677
|
-
var SignaturePadContentContainer = styled__default.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n
|
|
13802
|
+
var SignaturePadContentContainer = styled__default.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
13803
|
+
var SignaturePadContentInner = styled__default.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n pointer-events: none;\n color: ", ";\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n pointer-events: none;\n color: ", ";\n"])), function (props) {
|
|
13678
13804
|
var _a, _b, _c;
|
|
13679
13805
|
return (_c = (_b = (_a = props.theme.signatureCapture) === null || _a === void 0 ? void 0 : _a.canvas) === null || _b === void 0 ? void 0 : _b.emptyTextColor) !== null && _c !== void 0 ? _c : 'black';
|
|
13680
13806
|
});
|
|
13681
|
-
var templateObject_1$b, templateObject_2$9, templateObject_3$8, templateObject_4$3, templateObject_5$3, templateObject_6$2, templateObject_7$1, templateObject_8;
|
|
13807
|
+
var templateObject_1$b, templateObject_2$9, templateObject_3$8, templateObject_4$3, templateObject_5$3, templateObject_6$2, templateObject_7$1, templateObject_8, templateObject_9;
|
|
13682
13808
|
|
|
13683
13809
|
var DEFAULT_MIN_SIGNATURE_PAD_POINTS = 10;
|
|
13810
|
+
var DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE = 0.01;
|
|
13684
13811
|
var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
13685
13812
|
var onVideoCaptured = _a.onVideoCaptured,
|
|
13686
13813
|
onFaceNotDetected = _a.onFaceNotDetected,
|
|
@@ -13690,38 +13817,38 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13690
13817
|
guidesComponent = _a.guidesComponent,
|
|
13691
13818
|
_c = _a.minSignaturePadPoints,
|
|
13692
13819
|
minSignaturePadPoints = _c === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _c,
|
|
13693
|
-
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
classNames =
|
|
13697
|
-
|
|
13698
|
-
colors =
|
|
13699
|
-
|
|
13700
|
-
rawVerbiage =
|
|
13701
|
-
|
|
13702
|
-
debugMode =
|
|
13703
|
-
var
|
|
13820
|
+
_d = _a.headTrackingBoundaryPercentage,
|
|
13821
|
+
headTrackingBoundaryPercentage = _d === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _d,
|
|
13822
|
+
_e = _a.classNames,
|
|
13823
|
+
classNames = _e === void 0 ? {} : _e,
|
|
13824
|
+
_f = _a.colors,
|
|
13825
|
+
colors = _f === void 0 ? {} : _f,
|
|
13826
|
+
_g = _a.verbiage,
|
|
13827
|
+
rawVerbiage = _g === void 0 ? {} : _g,
|
|
13828
|
+
_h = _a.debugMode,
|
|
13829
|
+
debugMode = _h === void 0 ? false : _h;
|
|
13830
|
+
var _j = useCameraStore(shallow.useShallow(function (state) {
|
|
13704
13831
|
return {
|
|
13705
13832
|
camera: state.camera,
|
|
13706
13833
|
videoWidth: state.videoWidth,
|
|
13707
13834
|
videoHeight: state.videoHeight
|
|
13708
13835
|
};
|
|
13709
13836
|
})),
|
|
13710
|
-
camera =
|
|
13711
|
-
videoWidth =
|
|
13712
|
-
videoHeight =
|
|
13713
|
-
var
|
|
13714
|
-
onPredictionMade =
|
|
13715
|
-
start =
|
|
13716
|
-
stop =
|
|
13717
|
-
var
|
|
13718
|
-
signatureData =
|
|
13719
|
-
signatureDataUrl =
|
|
13720
|
-
signatureVideoData =
|
|
13721
|
-
startRecording =
|
|
13722
|
-
stopRecording =
|
|
13723
|
-
clearRecordedData =
|
|
13724
|
-
isRecording =
|
|
13837
|
+
camera = _j.camera,
|
|
13838
|
+
videoWidth = _j.videoWidth,
|
|
13839
|
+
videoHeight = _j.videoHeight;
|
|
13840
|
+
var _k = useSelfieGuidanceModelsContext(),
|
|
13841
|
+
onPredictionMade = _k.onPredictionMade,
|
|
13842
|
+
start = _k.start,
|
|
13843
|
+
stop = _k.stop;
|
|
13844
|
+
var _l = useVideoSignatureContext(),
|
|
13845
|
+
signatureData = _l.signatureData,
|
|
13846
|
+
signatureDataUrl = _l.signatureDataUrl,
|
|
13847
|
+
signatureVideoData = _l.signatureVideoData,
|
|
13848
|
+
startRecording = _l.startRecording,
|
|
13849
|
+
stopRecording = _l.stopRecording,
|
|
13850
|
+
clearRecordedData = _l.clearRecordedData,
|
|
13851
|
+
isRecording = _l.isRecording;
|
|
13725
13852
|
React.useEffect(function () {
|
|
13726
13853
|
startRecording();
|
|
13727
13854
|
return stopRecording;
|
|
@@ -13740,31 +13867,31 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13740
13867
|
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(signatureVideoData, signatureData, signatureDataUrl);
|
|
13741
13868
|
}
|
|
13742
13869
|
}, [onVideoCaptured, signatureData, signatureDataUrl, signatureVideoData]);
|
|
13743
|
-
var
|
|
13744
|
-
headTrackingSatisfied =
|
|
13745
|
-
setHeadTrackingSatisfied =
|
|
13746
|
-
var
|
|
13747
|
-
lastFace =
|
|
13748
|
-
setLastFace =
|
|
13749
|
-
var
|
|
13750
|
-
numFramesWithoutFaces =
|
|
13751
|
-
setNumFramesWithoutFaces =
|
|
13752
|
-
onPredictionMade(useDebounce.useThrottledCallback(function (_a) {
|
|
13870
|
+
var _m = React.useState(true),
|
|
13871
|
+
headTrackingSatisfied = _m[0],
|
|
13872
|
+
setHeadTrackingSatisfied = _m[1];
|
|
13873
|
+
var _o = React.useState(null),
|
|
13874
|
+
lastFace = _o[0],
|
|
13875
|
+
setLastFace = _o[1];
|
|
13876
|
+
var _p = React.useState(0),
|
|
13877
|
+
numFramesWithoutFaces = _p[0],
|
|
13878
|
+
setNumFramesWithoutFaces = _p[1];
|
|
13879
|
+
onPredictionMade(useDebounce.useThrottledCallback(React.useCallback(function (_a) {
|
|
13753
13880
|
var face = _a.face;
|
|
13754
13881
|
if (!camera) return;
|
|
13755
|
-
var nearBoundary = (face === null || face === void 0 ? void 0 : face.box.xMin) < videoWidth *
|
|
13882
|
+
var nearBoundary = (face === null || face === void 0 ? void 0 : face.box.xMin) < videoWidth * headTrackingBoundaryPercentage || (face === null || face === void 0 ? void 0 : face.box.xMax) > videoWidth * (1 - headTrackingBoundaryPercentage) || (face === null || face === void 0 ? void 0 : face.box.yMin) < videoHeight * headTrackingBoundaryPercentage || (face === null || face === void 0 ? void 0 : face.box.yMax) > videoHeight * (1 - headTrackingBoundaryPercentage);
|
|
13756
13883
|
setLastFace(face);
|
|
13757
13884
|
setHeadTrackingSatisfied(!!face && !nearBoundary);
|
|
13758
13885
|
setNumFramesWithoutFaces(face ? 0 : function (n) {
|
|
13759
13886
|
return n + 1;
|
|
13760
13887
|
});
|
|
13761
|
-
}, 16));
|
|
13762
|
-
var
|
|
13763
|
-
ref =
|
|
13764
|
-
|
|
13765
|
-
width =
|
|
13766
|
-
|
|
13767
|
-
height =
|
|
13888
|
+
}, [camera, headTrackingBoundaryPercentage, videoHeight, videoWidth]), 16));
|
|
13889
|
+
var _q = useResizeObserver(),
|
|
13890
|
+
ref = _q.ref,
|
|
13891
|
+
_r = _q.width,
|
|
13892
|
+
width = _r === void 0 ? 1 : _r,
|
|
13893
|
+
_s = _q.height,
|
|
13894
|
+
height = _s === void 0 ? 1 : _s;
|
|
13768
13895
|
var debugScalingDetails = useDebugScalingDetails({
|
|
13769
13896
|
enabled: debugMode,
|
|
13770
13897
|
pageWidth: width,
|
|
@@ -13779,7 +13906,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13779
13906
|
return /*#__PURE__*/React__namespace.default.createElement(Container$2, {
|
|
13780
13907
|
ref: ref,
|
|
13781
13908
|
className: classNames.container
|
|
13782
|
-
}, verbiage.guidanceMessageText && ( /*#__PURE__*/React__namespace.default.createElement(GuidanceMessageContainer, {
|
|
13909
|
+
}, !!verbiage.guidanceMessageText && ( /*#__PURE__*/React__namespace.default.createElement(GuidanceMessageContainer, {
|
|
13783
13910
|
"$top": "10%",
|
|
13784
13911
|
className: classNames.guidanceMessageContainer
|
|
13785
13912
|
}, /*#__PURE__*/React__namespace.default.createElement(GuidanceMessage, {
|
|
@@ -13789,11 +13916,10 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13789
13916
|
}, verbiage.guidanceMessageText))), /*#__PURE__*/React__namespace.default.createElement(GuidesComponent, {
|
|
13790
13917
|
status: "success",
|
|
13791
13918
|
key: "video-signature-guides-".concat(headTrackingSatisfied ? 'satisfied' : 'unsatisfied'),
|
|
13792
|
-
classNames: classNames.videoSignatureGuidesClassNames,
|
|
13793
13919
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
13794
|
-
signaturePadEmptyContent: signaturePadEmptyContent,
|
|
13795
|
-
headTrackingUnsatisfiedContent: headTrackingUnsatisfiedContent,
|
|
13796
13920
|
headTrackingSatisfied: headTrackingSatisfied,
|
|
13921
|
+
classNames: classNames.guides,
|
|
13922
|
+
verbiage: rawVerbiage.guides,
|
|
13797
13923
|
onClearSignaturePadClicked: restartVideoOnSignaturePadCleared ? function () {
|
|
13798
13924
|
return setTimeout(clearRecordedData, 100);
|
|
13799
13925
|
} : undefined
|
|
@@ -13881,43 +14007,43 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13881
14007
|
captureAudio = _d === void 0 ? false : _d,
|
|
13882
14008
|
_e = _a.minSignaturePadPoints,
|
|
13883
14009
|
minSignaturePadPoints = _e === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _e,
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
allowSignatureAfterLivenessCheckFailure =
|
|
13888
|
-
|
|
13889
|
-
restartVideoOnSignaturePadCleared =
|
|
14010
|
+
_f = _a.headTrackingBoundaryPercentage,
|
|
14011
|
+
headTrackingBoundaryPercentage = _f === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _f,
|
|
14012
|
+
_g = _a.allowSignatureAfterLivenessCheckFailure,
|
|
14013
|
+
allowSignatureAfterLivenessCheckFailure = _g === void 0 ? false : _g,
|
|
14014
|
+
_h = _a.restartVideoOnSignaturePadCleared,
|
|
14015
|
+
restartVideoOnSignaturePadCleared = _h === void 0 ? true : _h,
|
|
13890
14016
|
faceLivenessProps = _a.faceLivenessProps,
|
|
13891
|
-
|
|
13892
|
-
assets =
|
|
13893
|
-
|
|
13894
|
-
classNames =
|
|
13895
|
-
|
|
13896
|
-
colors =
|
|
13897
|
-
|
|
13898
|
-
verbiage =
|
|
13899
|
-
|
|
13900
|
-
debugMode =
|
|
13901
|
-
var
|
|
13902
|
-
selfieImage =
|
|
13903
|
-
setSelfieImage =
|
|
13904
|
-
setSignatureData =
|
|
13905
|
-
setSignatureVideoUrl =
|
|
13906
|
-
logSelfieCaptureAttempt =
|
|
14017
|
+
_j = _a.assets,
|
|
14018
|
+
assets = _j === void 0 ? {} : _j,
|
|
14019
|
+
_k = _a.classNames,
|
|
14020
|
+
classNames = _k === void 0 ? {} : _k,
|
|
14021
|
+
_l = _a.colors,
|
|
14022
|
+
colors = _l === void 0 ? {} : _l,
|
|
14023
|
+
_m = _a.verbiage,
|
|
14024
|
+
verbiage = _m === void 0 ? {} : _m,
|
|
14025
|
+
_o = _a.debugMode,
|
|
14026
|
+
debugMode = _o === void 0 ? false : _o;
|
|
14027
|
+
var _p = React.useContext(SubmissionContext),
|
|
14028
|
+
selfieImage = _p.selfieImage,
|
|
14029
|
+
setSelfieImage = _p.setSelfieImage,
|
|
14030
|
+
setSignatureData = _p.setSignatureData,
|
|
14031
|
+
setSignatureVideoUrl = _p.setSignatureVideoUrl,
|
|
14032
|
+
logSelfieCaptureAttempt = _p.logSelfieCaptureAttempt;
|
|
13907
14033
|
var cameraAccessDenied = useCameraStore(shallow.useShallow(function (state) {
|
|
13908
14034
|
return {
|
|
13909
14035
|
cameraAccessDenied: state.cameraAccessDenied
|
|
13910
14036
|
};
|
|
13911
14037
|
})).cameraAccessDenied;
|
|
13912
|
-
var
|
|
13913
|
-
captureState =
|
|
13914
|
-
setCaptureState =
|
|
14038
|
+
var _q = React.useState('CHECKING_LIVENESS'),
|
|
14039
|
+
captureState = _q[0],
|
|
14040
|
+
setCaptureState = _q[1];
|
|
13915
14041
|
var operationStartedAt = React.useRef();
|
|
13916
14042
|
var captureStartedAt = React.useRef();
|
|
13917
14043
|
var captureEndedAt = React.useRef();
|
|
13918
|
-
var
|
|
13919
|
-
start =
|
|
13920
|
-
stop =
|
|
14044
|
+
var _r = useSelfieGuidanceModelsContext(),
|
|
14045
|
+
start = _r.start,
|
|
14046
|
+
stop = _r.stop;
|
|
13921
14047
|
React.useEffect(function () {
|
|
13922
14048
|
operationStartedAt.current = new Date();
|
|
13923
14049
|
}, []);
|
|
@@ -13953,9 +14079,9 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13953
14079
|
setSelfieImage(selfieFromRequest);
|
|
13954
14080
|
}
|
|
13955
14081
|
}, [logCaptureMetadata, onFaceLivenessSuccessProp, selfieImage, setSelfieImage]);
|
|
13956
|
-
var
|
|
13957
|
-
signatureImageUrl =
|
|
13958
|
-
setSignatureImageUrl =
|
|
14082
|
+
var _s = React.useState(null),
|
|
14083
|
+
signatureImageUrl = _s[0],
|
|
14084
|
+
setSignatureImageUrl = _s[1];
|
|
13959
14085
|
var onSignatureCaptureCompleted = React.useCallback(function (videoData, signatureData, signatureImageData) {
|
|
13960
14086
|
setSignatureData(signatureData);
|
|
13961
14087
|
setSignatureVideoUrl(URL.createObjectURL(videoData));
|
|
@@ -13963,16 +14089,16 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13963
14089
|
setCaptureState('SUCCESS');
|
|
13964
14090
|
onVideoCaptured === null || onVideoCaptured === void 0 ? void 0 : onVideoCaptured(videoData, signatureData, signatureImageData);
|
|
13965
14091
|
}, [onVideoCaptured, setSignatureData, setSignatureVideoUrl]);
|
|
13966
|
-
var
|
|
13967
|
-
showLoadingOverlay =
|
|
13968
|
-
setShowLoadingOverlay =
|
|
14092
|
+
var _t = React.useState(true),
|
|
14093
|
+
showLoadingOverlay = _t[0],
|
|
14094
|
+
setShowLoadingOverlay = _t[1];
|
|
13969
14095
|
var onSignatureCaptureFacesNotDetected = React.useCallback(function () {
|
|
13970
14096
|
setShowLoadingOverlay(false);
|
|
13971
14097
|
setCaptureState('CHECKING_LIVENESS');
|
|
13972
14098
|
}, []);
|
|
13973
|
-
var
|
|
13974
|
-
attempt =
|
|
13975
|
-
setAttempt =
|
|
14099
|
+
var _u = React.useState(0),
|
|
14100
|
+
attempt = _u[0],
|
|
14101
|
+
setAttempt = _u[1];
|
|
13976
14102
|
var onRetry = React.useCallback(function () {
|
|
13977
14103
|
onRetryClicked === null || onRetryClicked === void 0 ? void 0 : onRetryClicked();
|
|
13978
14104
|
setAttempt(function (n) {
|
|
@@ -13991,11 +14117,11 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13991
14117
|
}, [cameraAccessDenied]);
|
|
13992
14118
|
var guidesComponent = React.useCallback(function (props) {
|
|
13993
14119
|
return /*#__PURE__*/React__namespace.default.createElement(VideoSignatureWizardGuides, _assign({}, props, {
|
|
13994
|
-
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.
|
|
13995
|
-
|
|
13996
|
-
|
|
14120
|
+
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.guides,
|
|
14121
|
+
verbiage: verbiage === null || verbiage === void 0 ? void 0 : verbiage.guides,
|
|
14122
|
+
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared
|
|
13997
14123
|
}));
|
|
13998
|
-
}, [classNames === null || classNames === void 0 ? void 0 : classNames.
|
|
14124
|
+
}, [classNames === null || classNames === void 0 ? void 0 : classNames.guides, restartVideoOnSignaturePadCleared, verbiage === null || verbiage === void 0 ? void 0 : verbiage.guides]);
|
|
13999
14125
|
var onExitAfterFailureProp = faceLivenessProps === null || faceLivenessProps === void 0 ? void 0 : faceLivenessProps.onExitAfterFailure;
|
|
14000
14126
|
var onExitAfterFailure = React.useCallback(function (resp, req) {
|
|
14001
14127
|
onExitAfterFailureProp === null || onExitAfterFailureProp === void 0 ? void 0 : onExitAfterFailureProp(resp, req);
|
|
@@ -14040,8 +14166,7 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
14040
14166
|
onFaceNotDetected: onSignatureCaptureFacesNotDetected,
|
|
14041
14167
|
onExit: onExitCapture,
|
|
14042
14168
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
14043
|
-
|
|
14044
|
-
headTrackingUnsatisfiedContent: headTrackingUnsatisfiedContent,
|
|
14169
|
+
headTrackingBoundaryPercentage: headTrackingBoundaryPercentage,
|
|
14045
14170
|
restartVideoOnSignaturePadCleared: restartVideoOnSignaturePadCleared,
|
|
14046
14171
|
guidesComponent: guidesComponent,
|
|
14047
14172
|
classNames: classNames,
|
|
@@ -14240,8 +14365,7 @@ var IdCardGuideInstructions = styled__default.default(GuidanceMessage)(templateO
|
|
|
14240
14365
|
var templateObject_1$8, templateObject_2$8, templateObject_3$7, templateObject_4$2, templateObject_5$2, templateObject_6$1, templateObject_7;
|
|
14241
14366
|
|
|
14242
14367
|
var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
14243
|
-
var
|
|
14244
|
-
onComplete = _a.onComplete,
|
|
14368
|
+
var onComplete = _a.onComplete,
|
|
14245
14369
|
_b = _a.durationMs,
|
|
14246
14370
|
durationMs = _b === void 0 ? 15000 : _b,
|
|
14247
14371
|
_c = _a.minReadingMs,
|
|
@@ -14250,13 +14374,13 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
|
14250
14374
|
classNames = _d === void 0 ? {} : _d,
|
|
14251
14375
|
_e = _a.verbiage,
|
|
14252
14376
|
rawVerbiage = _e === void 0 ? {} : _e;
|
|
14253
|
-
text = useVerbiage(text, '');
|
|
14254
14377
|
var countdownTimeoutRef = React.useRef(undefined);
|
|
14255
14378
|
var _f = React.useState(durationMs / 1000),
|
|
14256
14379
|
countdownRemaining = _f[0],
|
|
14257
14380
|
setCountdownRemaining = _f[1];
|
|
14258
14381
|
var verbiage = useTranslations(rawVerbiage, {
|
|
14259
14382
|
headingText: 'Please read the following text aloud',
|
|
14383
|
+
promptText: '',
|
|
14260
14384
|
doneBtnText: 'Done'
|
|
14261
14385
|
});
|
|
14262
14386
|
var manualCountdown = React.useCallback(function (remainingTime) {
|
|
@@ -14294,7 +14418,7 @@ var ReadTextPrompt = function ReadTextPrompt(_a) {
|
|
|
14294
14418
|
className: classNames.heading
|
|
14295
14419
|
}, verbiage.headingText), /*#__PURE__*/React__namespace.default.createElement(ReadTextPromptText, {
|
|
14296
14420
|
className: classNames.prompt
|
|
14297
|
-
},
|
|
14421
|
+
}, verbiage.promptText), /*#__PURE__*/React__namespace.default.createElement(ReadTextPromptButtonsRow, {
|
|
14298
14422
|
className: classNames.buttonsRow
|
|
14299
14423
|
}, /*#__PURE__*/React__namespace.default.createElement(ReadTextPromptTimeRemaining, {
|
|
14300
14424
|
className: classNames.timeRemaining
|
|
@@ -14735,18 +14859,22 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14735
14859
|
});
|
|
14736
14860
|
var capturingId = ['SHOW_ID_FRONT', 'SHOW_ID_BACK', 'SHOW_PASSPORT'].includes(requestedAction);
|
|
14737
14861
|
var guidanceText = !faceCentered ? faceNotCenteredText : undefined;
|
|
14862
|
+
var readTextPromptVerbiage = React.useMemo(function () {
|
|
14863
|
+
return _assign({
|
|
14864
|
+
promptText: readTextPrompt
|
|
14865
|
+
}, rawVerbiage.readTextPrompt);
|
|
14866
|
+
}, [rawVerbiage.readTextPrompt, readTextPrompt]);
|
|
14738
14867
|
return /*#__PURE__*/React__namespace.default.createElement(Container, {
|
|
14739
14868
|
ref: ref,
|
|
14740
14869
|
className: classNames.container
|
|
14741
14870
|
}, /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
14742
14871
|
ref: photoCanvas
|
|
14743
14872
|
}), requestedAction === 'READ_TEXT' ? ( /*#__PURE__*/React__namespace.default.createElement(ReadTextPrompt, {
|
|
14744
|
-
text: readTextPrompt,
|
|
14745
14873
|
startedAt: timeoutStartedAt || undefined,
|
|
14746
14874
|
durationMs: readTextTimeoutDurationMs,
|
|
14747
14875
|
minReadingMs: readTextMinReadingMs,
|
|
14748
14876
|
classNames: classNames.readTextPrompt,
|
|
14749
|
-
verbiage:
|
|
14877
|
+
verbiage: readTextPromptVerbiage,
|
|
14750
14878
|
onComplete: stopRecording
|
|
14751
14879
|
})) : ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, /*#__PURE__*/React__namespace.default.createElement(IdVideoCaptureGuides, {
|
|
14752
14880
|
classNames: classNames.guides,
|
|
@@ -15740,6 +15868,9 @@ var IdValidation = function IdValidation(_a) {
|
|
|
15740
15868
|
allowOverrideWrongDocumentTypeAfterMs = _t === void 0 ? 8000 : _t,
|
|
15741
15869
|
_u = _a.allowUploadingDocumentsFromStorage,
|
|
15742
15870
|
allowUploadingDocumentsFromStorage = _u === void 0 ? false : _u,
|
|
15871
|
+
onLoadingStarted = _a.onLoadingStarted,
|
|
15872
|
+
onLoadingProgress = _a.onLoadingProgress,
|
|
15873
|
+
onLoadingCompleted = _a.onLoadingCompleted,
|
|
15743
15874
|
onBeforeSubmit = _a.onBeforeSubmit,
|
|
15744
15875
|
onBeforeDocumentUpload = _a.onBeforeDocumentUpload,
|
|
15745
15876
|
onDocumentUploadProgress = _a.onDocumentUploadProgress,
|
|
@@ -15781,6 +15912,9 @@ var IdValidation = function IdValidation(_a) {
|
|
|
15781
15912
|
useDebugLogging(debugMode);
|
|
15782
15913
|
var idCaptureProps = React.useMemo(function () {
|
|
15783
15914
|
return {
|
|
15915
|
+
onLoadingStarted: onLoadingStarted,
|
|
15916
|
+
onLoadingProgress: onLoadingProgress,
|
|
15917
|
+
onLoadingCompleted: onLoadingCompleted,
|
|
15784
15918
|
onExitCapture: onExitCapture,
|
|
15785
15919
|
onUserCancel: onUserCancel,
|
|
15786
15920
|
onModelError: onModelError,
|
|
@@ -15810,7 +15944,7 @@ var IdValidation = function IdValidation(_a) {
|
|
|
15810
15944
|
verbiage: verbiage,
|
|
15811
15945
|
debugMode: debugMode
|
|
15812
15946
|
};
|
|
15813
|
-
}, [onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, allowUploadingDocumentsFromStorage, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
|
|
15947
|
+
}, [onLoadingStarted, onLoadingProgress, onLoadingCompleted, onExitCapture, onUserCancel, onModelError, precapturedDocuments, idCaptureRequirement, allowSinglePageIdCapture, separateIdCardCaptureSequence, idCaptureThresholds, skipSuccessScreen, loadingOverlayMode, customOverlayContent, onLoadingOverlayDismissed, forceFallbackMode, allowIdCardBackToFrontCapture, allowUploadingDocumentsFromStorage, instructions, guideType, guideImages, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, modelLoadTimeoutMs, enableOverrideWrongDocumentTypeDialog, allowOverrideWrongDocumentTypeAfterMs, assets, classNames, colors, verbiage, debugMode]);
|
|
15814
15948
|
var additionalDocumentCaptureProps = React.useMemo(function () {
|
|
15815
15949
|
return {
|
|
15816
15950
|
documents: captureAdditionalDocuments,
|
|
@@ -17764,24 +17898,24 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
17764
17898
|
idCardForFaceMatch = _a.idCardForFaceMatch,
|
|
17765
17899
|
_f = _a.minSignaturePadPoints,
|
|
17766
17900
|
minSignaturePadPoints = _f === void 0 ? DEFAULT_MIN_SIGNATURE_PAD_POINTS : _f,
|
|
17767
|
-
|
|
17768
|
-
|
|
17769
|
-
|
|
17770
|
-
modelLoadTimeoutMs =
|
|
17771
|
-
|
|
17772
|
-
allowSignatureAfterLivenessCheckFailure =
|
|
17773
|
-
|
|
17774
|
-
restartVideoOnSignaturePadCleared =
|
|
17901
|
+
_g = _a.headTrackingBoundaryPercentage,
|
|
17902
|
+
headTrackingBoundaryPercentage = _g === void 0 ? DEFAULT_HEAD_TRACKING_BOUNDARY_PERCENTAGE : _g,
|
|
17903
|
+
_h = _a.modelLoadTimeoutMs,
|
|
17904
|
+
modelLoadTimeoutMs = _h === void 0 ? defaultSelfieCaptureModelLoadTimeoutMs : _h,
|
|
17905
|
+
_j = _a.allowSignatureAfterLivenessCheckFailure,
|
|
17906
|
+
allowSignatureAfterLivenessCheckFailure = _j === void 0 ? false : _j,
|
|
17907
|
+
_k = _a.restartVideoOnSignaturePadCleared,
|
|
17908
|
+
restartVideoOnSignaturePadCleared = _k === void 0 ? true : _k,
|
|
17775
17909
|
faceLivenessProps = _a.faceLivenessProps,
|
|
17776
|
-
|
|
17777
|
-
theme =
|
|
17910
|
+
_l = _a.theme,
|
|
17911
|
+
theme = _l === void 0 ? 'default' : _l,
|
|
17778
17912
|
classNames = _a.classNames,
|
|
17779
17913
|
colors = _a.colors,
|
|
17780
17914
|
verbiage = _a.verbiage,
|
|
17781
17915
|
geolocationEnabled = _a.geolocationEnabled,
|
|
17782
17916
|
geolocationRequired = _a.geolocationRequired,
|
|
17783
|
-
|
|
17784
|
-
debugMode =
|
|
17917
|
+
_m = _a.debugMode,
|
|
17918
|
+
debugMode = _m === void 0 ? false : _m;
|
|
17785
17919
|
useLanguage(lang);
|
|
17786
17920
|
useDebugLogging(debugMode);
|
|
17787
17921
|
return /*#__PURE__*/React__namespace.default.createElement(AuthProvider, {
|
|
@@ -17826,8 +17960,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
17826
17960
|
skipSuccessScreen: skipSuccessScreen,
|
|
17827
17961
|
captureAudio: captureAudio,
|
|
17828
17962
|
minSignaturePadPoints: minSignaturePadPoints,
|
|
17829
|
-
|
|
17830
|
-
headTrackingUnsatisfiedContent: headTrackingUnsatisfiedContent,
|
|
17963
|
+
headTrackingBoundaryPercentage: headTrackingBoundaryPercentage,
|
|
17831
17964
|
modelLoadTimeoutMs: modelLoadTimeoutMs,
|
|
17832
17965
|
faceLivenessProps: faceLivenessProps,
|
|
17833
17966
|
allowSignatureAfterLivenessCheckFailure: allowSignatureAfterLivenessCheckFailure,
|
|
@@ -17839,7 +17972,7 @@ var SignatureKYC = function SignatureKYC(_a) {
|
|
|
17839
17972
|
onModelError: onModelError,
|
|
17840
17973
|
onUserCancel: onUserCancel
|
|
17841
17974
|
};
|
|
17842
|
-
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints,
|
|
17975
|
+
}, [customOverlayContent, onLoadingOverlayDismissed, loadingOverlayMode, skipSuccessScreen, captureAudio, minSignaturePadPoints, headTrackingBoundaryPercentage, modelLoadTimeoutMs, faceLivenessProps, allowSignatureAfterLivenessCheckFailure, restartVideoOnSignaturePadCleared, classNames, colors, debugMode, verbiage, onModelError, onUserCancel])
|
|
17843
17976
|
})))));
|
|
17844
17977
|
};
|
|
17845
17978
|
|