idmission-web-sdk 2.1.61 → 2.1.63
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/id_capture/DocumentDetectionModelProvider.d.ts +3 -1
- package/dist/components/id_capture/IdCaptureModelsProvider.d.ts +3 -1
- package/dist/components/video_signature_capture/VideoSignatureCapture.d.ts +2 -0
- package/dist/lib/models/DocumentDetection.d.ts +8 -1
- package/dist/sdk2.cjs.development.js +81 -41
- 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 +81 -41
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +81 -41
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
3
|
-
import { DocumentDetectionPrediction, DocumentDetectionThresholds } from '../../lib/models/DocumentDetection';
|
|
3
|
+
import { DocumentDetectionBoundaries, DocumentDetectionPrediction, DocumentDetectionThresholds } from '../../lib/models/DocumentDetection';
|
|
4
4
|
type PredictionHandler = (prediction: DocumentDetectionPrediction) => Promise<void>;
|
|
5
5
|
type DocumentDetectionModelState = {
|
|
6
6
|
startDocumentDetection: () => void;
|
|
@@ -12,6 +12,8 @@ type DocumentDetectionModelState = {
|
|
|
12
12
|
detectionTime: number;
|
|
13
13
|
documentDetectionThresholds: DocumentDetectionThresholds;
|
|
14
14
|
setDocumentDetectionThresholds: (value: DocumentDetectionThresholds) => void;
|
|
15
|
+
documentDetectionBoundaries: DocumentDetectionBoundaries;
|
|
16
|
+
setDocumentDetectionBoundaries: (value: DocumentDetectionBoundaries) => void;
|
|
15
17
|
documentDetectionLastPredictionCanvas: MutableRefObject<HTMLCanvasElement | null>;
|
|
16
18
|
clearDocumentDetectionLastPredictionCanvas: () => void;
|
|
17
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { MutableRefObject, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { DetectedObjectBox, DocumentDetectionPrediction, DocumentDetectionThresholds, DocumentType } from '../../lib/models/DocumentDetection';
|
|
2
|
+
import { DetectedObjectBox, DocumentDetectionBoundaries, DocumentDetectionPrediction, DocumentDetectionThresholds, DocumentType } from '../../lib/models/DocumentDetection';
|
|
3
3
|
import { DocumentDetectionModelProviderProps } from './DocumentDetectionModelProvider';
|
|
4
4
|
import { FocusModelProviderProps } from './FocusModelProvider';
|
|
5
5
|
import { FocusThresholds } from '../../lib/models/Focus';
|
|
@@ -30,6 +30,8 @@ export type IdCaptureModelsState = {
|
|
|
30
30
|
modelError: Error | null;
|
|
31
31
|
thresholds: IdCaptureThresholds;
|
|
32
32
|
setThresholds: (value: IdCaptureThresholds) => void;
|
|
33
|
+
documentDetectionBoundaries: DocumentDetectionBoundaries;
|
|
34
|
+
setDocumentDetectionBoundaries: (value: DocumentDetectionBoundaries) => void;
|
|
33
35
|
onPredictionMade: (handler: (prediction: IdCapturePrediction) => void) => void;
|
|
34
36
|
detectionTime: number;
|
|
35
37
|
focusPredictionTime: number;
|
|
@@ -2,12 +2,14 @@ import React, { ComponentType } from 'react';
|
|
|
2
2
|
import { SignatureData } from '../signature_capture/data';
|
|
3
3
|
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
4
4
|
import { FaceCaptureGuideOverlayProps } from '../face_liveness/FaceCaptureGuideOverlay';
|
|
5
|
+
import { VideoSignatureGuidesClassNames } from './VideoSignatureGuides';
|
|
5
6
|
export type VideoSignatureCaptureClassNames = {
|
|
6
7
|
container?: string;
|
|
7
8
|
cameraFeed?: string;
|
|
8
9
|
guidanceMessageContainer?: string;
|
|
9
10
|
guidanceMessage?: string;
|
|
10
11
|
exitCaptureBtn?: string;
|
|
12
|
+
videoSignatureGuidesClassNames?: VideoSignatureGuidesClassNames;
|
|
11
13
|
};
|
|
12
14
|
export type VideoSignatureCaptureColors = {
|
|
13
15
|
guidanceMessageBackgroundColor?: string;
|
|
@@ -68,4 +68,11 @@ export type ObjectDetectorPrediction = ObjectDetectorResult & {
|
|
|
68
68
|
frameHeight: number;
|
|
69
69
|
};
|
|
70
70
|
export declare function makeDocumentDetectorPrediction(detector: ObjectDetector, frame: HTMLCanvasElement): Promise<ObjectDetectorPrediction | null>;
|
|
71
|
-
export
|
|
71
|
+
export type DocumentDetectionBoundaries = {
|
|
72
|
+
top: number;
|
|
73
|
+
bottom: number;
|
|
74
|
+
left: number;
|
|
75
|
+
right: number;
|
|
76
|
+
};
|
|
77
|
+
export declare const defaultDocumentDetectionBoundaries: DocumentDetectionBoundaries;
|
|
78
|
+
export declare function processDocumentDetectorPrediction(prediction: ObjectDetectorPrediction, thresholds: DocumentDetectionThresholds, boundaries?: DocumentDetectionBoundaries): DocumentDetectionPrediction;
|
|
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
234
234
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
var webSdkVersion = '2.1.
|
|
237
|
+
var webSdkVersion = '2.1.63';
|
|
238
238
|
|
|
239
239
|
function getPlatform() {
|
|
240
240
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -5581,8 +5581,17 @@ function makeDocumentDetectorPrediction(detector, frame) {
|
|
|
5581
5581
|
});
|
|
5582
5582
|
});
|
|
5583
5583
|
}
|
|
5584
|
-
|
|
5585
|
-
|
|
5584
|
+
var defaultDocumentDetectionBoundaries = {
|
|
5585
|
+
top: 20,
|
|
5586
|
+
bottom: 20,
|
|
5587
|
+
left: 20,
|
|
5588
|
+
right: 20
|
|
5589
|
+
};
|
|
5590
|
+
function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
5591
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
5592
|
+
if (boundaries === void 0) {
|
|
5593
|
+
boundaries = defaultDocumentDetectionBoundaries;
|
|
5594
|
+
}
|
|
5586
5595
|
var detections = prediction.detections,
|
|
5587
5596
|
frameWidth = prediction.frameWidth,
|
|
5588
5597
|
frameHeight = prediction.frameHeight,
|
|
@@ -5631,25 +5640,28 @@ function processDocumentDetectorPrediction(prediction, thresholds) {
|
|
|
5631
5640
|
}
|
|
5632
5641
|
var documentInBounds = false;
|
|
5633
5642
|
if (bestDocument) {
|
|
5634
|
-
var
|
|
5635
|
-
var
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5643
|
+
var boundaryTop = (_h = boundaries.top) !== null && _h !== void 0 ? _h : 20;
|
|
5644
|
+
var boundaryLeft = (_j = boundaries.left) !== null && _j !== void 0 ? _j : 20;
|
|
5645
|
+
var boundaryRight = (_k = boundaries.right) !== null && _k !== void 0 ? _k : 20;
|
|
5646
|
+
var boundaryBottom = (_l = boundaries.bottom) !== null && _l !== void 0 ? _l : 20;
|
|
5647
|
+
var _m = bestDocument.box,
|
|
5648
|
+
xMin = _m.xMin,
|
|
5649
|
+
yMin = _m.yMin,
|
|
5650
|
+
width = _m.width,
|
|
5651
|
+
height = _m.height;
|
|
5652
|
+
documentInBounds = yMin > boundaryTop &&
|
|
5641
5653
|
// Is it valid top edge of ID detected?
|
|
5642
|
-
|
|
5654
|
+
yMin + height + boundaryBottom < frameHeight && (
|
|
5643
5655
|
// Is it valid bottom edge less than max video height
|
|
5644
|
-
|
|
5656
|
+
xMin > boundaryLeft || xMin < boundaryLeft && xMin + width > frameWidth * 0.8) &&
|
|
5645
5657
|
// If either the left side visible or if not, right edge of ID should be more than 80% of width.
|
|
5646
|
-
|
|
5658
|
+
xMin + width + boundaryRight < frameWidth; // Valid right edge if it's less than video width.
|
|
5647
5659
|
}
|
|
5648
5660
|
var documentTooClose = false;
|
|
5649
5661
|
if (bestDocument) {
|
|
5650
|
-
var
|
|
5651
|
-
docWidth =
|
|
5652
|
-
docHeight =
|
|
5662
|
+
var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
|
|
5663
|
+
docWidth = _o[0],
|
|
5664
|
+
docHeight = _o[1];
|
|
5653
5665
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
5654
5666
|
}
|
|
5655
5667
|
return {
|
|
@@ -5762,6 +5774,10 @@ var DocumentDetectionModelContext = /*#__PURE__*/React.createContext({
|
|
|
5762
5774
|
setDocumentDetectionThresholds: function setDocumentDetectionThresholds() {
|
|
5763
5775
|
return null;
|
|
5764
5776
|
},
|
|
5777
|
+
documentDetectionBoundaries: defaultDocumentDetectionBoundaries,
|
|
5778
|
+
setDocumentDetectionBoundaries: function setDocumentDetectionBoundaries() {
|
|
5779
|
+
return null;
|
|
5780
|
+
},
|
|
5765
5781
|
documentDetectionLastPredictionCanvas: {
|
|
5766
5782
|
current: null
|
|
5767
5783
|
},
|
|
@@ -5791,28 +5807,31 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5791
5807
|
var _g = React.useState({}),
|
|
5792
5808
|
documentDetectionThresholds = _g[0],
|
|
5793
5809
|
setDocumentDetectionThresholds = _g[1];
|
|
5794
|
-
var _h = React.useState(
|
|
5795
|
-
|
|
5796
|
-
|
|
5810
|
+
var _h = React.useState(defaultDocumentDetectionBoundaries),
|
|
5811
|
+
documentDetectionBoundaries = _h[0],
|
|
5812
|
+
setDocumentDetectionBoundaries = _h[1];
|
|
5797
5813
|
var _j = React.useState(0),
|
|
5798
|
-
|
|
5799
|
-
|
|
5814
|
+
detectionTime = _j[0],
|
|
5815
|
+
setDetectionTime = _j[1];
|
|
5800
5816
|
var _k = React.useState(0),
|
|
5801
|
-
|
|
5802
|
-
|
|
5817
|
+
timesAllZero = _k[0],
|
|
5818
|
+
setTimesAllZero = _k[1];
|
|
5819
|
+
var _l = React.useState(0),
|
|
5820
|
+
canvasKey = _l[0],
|
|
5821
|
+
setCanvasKey = _l[1];
|
|
5803
5822
|
var stopDetection = React.useRef(0);
|
|
5804
|
-
var
|
|
5823
|
+
var _m = useLoadDocumentDetector({
|
|
5805
5824
|
modelPath: documentDetectionModelPath,
|
|
5806
5825
|
modelLoadTimeoutMs: documentDetectionModelLoadTimeoutMs,
|
|
5807
5826
|
scoreThreshold: documentDetectionModelScoreThreshold,
|
|
5808
5827
|
onModelError: onDocumentDetectionModelError
|
|
5809
5828
|
}),
|
|
5810
|
-
detector =
|
|
5811
|
-
ready =
|
|
5812
|
-
modelDownloadProgress =
|
|
5813
|
-
modelError =
|
|
5814
|
-
setModelError =
|
|
5815
|
-
var
|
|
5829
|
+
detector = _m.detector,
|
|
5830
|
+
ready = _m.ready,
|
|
5831
|
+
modelDownloadProgress = _m.modelDownloadProgress,
|
|
5832
|
+
modelError = _m.modelError,
|
|
5833
|
+
setModelError = _m.setModelError;
|
|
5834
|
+
var _o = useFrameLoop(React.useCallback(function (frameId) {
|
|
5816
5835
|
return __awaiter(_this, void 0, void 0, function () {
|
|
5817
5836
|
var stopDetectionAtStart, vw, vh, ctx, prediction, processedPrediction;
|
|
5818
5837
|
var _a;
|
|
@@ -5833,7 +5852,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5833
5852
|
case 1:
|
|
5834
5853
|
prediction = _b.sent();
|
|
5835
5854
|
if (!prediction) return [3 /*break*/, 3];
|
|
5836
|
-
processedPrediction = processDocumentDetectorPrediction(prediction, documentDetectionThresholds);
|
|
5855
|
+
processedPrediction = processDocumentDetectorPrediction(prediction, documentDetectionThresholds, documentDetectionBoundaries);
|
|
5837
5856
|
processedPrediction.frameId = frameId;
|
|
5838
5857
|
setDetectionTime(prediction.time);
|
|
5839
5858
|
debug(processedPrediction);
|
|
@@ -5850,12 +5869,12 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5850
5869
|
}
|
|
5851
5870
|
});
|
|
5852
5871
|
});
|
|
5853
|
-
}, [cameraReady, detector, documentDetectionThresholds, ready, videoLoaded, videoRef]), {
|
|
5872
|
+
}, [cameraReady, detector, documentDetectionBoundaries, documentDetectionThresholds, ready, videoLoaded, videoRef]), {
|
|
5854
5873
|
throttleMs: throttleMs,
|
|
5855
5874
|
autoStart: autoStart
|
|
5856
5875
|
}),
|
|
5857
|
-
start =
|
|
5858
|
-
stop =
|
|
5876
|
+
start = _o.start,
|
|
5877
|
+
stop = _o.stop;
|
|
5859
5878
|
React.useEffect(function setErrorIfAllZero() {
|
|
5860
5879
|
if (timesAllZero >= 2) {
|
|
5861
5880
|
setModelError(new Error('model is returning all zeroes'));
|
|
@@ -5881,10 +5900,12 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5881
5900
|
detectionTime: detectionTime,
|
|
5882
5901
|
documentDetectionThresholds: documentDetectionThresholds,
|
|
5883
5902
|
setDocumentDetectionThresholds: setDocumentDetectionThresholds,
|
|
5903
|
+
documentDetectionBoundaries: documentDetectionBoundaries,
|
|
5904
|
+
setDocumentDetectionBoundaries: setDocumentDetectionBoundaries,
|
|
5884
5905
|
documentDetectionLastPredictionCanvas: lastPredictionCanvas,
|
|
5885
5906
|
clearDocumentDetectionLastPredictionCanvas: clearDocumentDetectionLastPredictionCanvas
|
|
5886
5907
|
};
|
|
5887
|
-
}, [start, stop, ready, modelError, modelDownloadProgress, onDocumentDetected, detectionTime, documentDetectionThresholds, clearDocumentDetectionLastPredictionCanvas]);
|
|
5908
|
+
}, [start, stop, ready, modelError, modelDownloadProgress, onDocumentDetected, detectionTime, documentDetectionThresholds, documentDetectionBoundaries, clearDocumentDetectionLastPredictionCanvas]);
|
|
5888
5909
|
return /*#__PURE__*/React__namespace.createElement(DocumentDetectionModelContext.Provider, {
|
|
5889
5910
|
value: value
|
|
5890
5911
|
}, /*#__PURE__*/React__namespace.createElement(InvisibleCanvas, {
|
|
@@ -6011,6 +6032,10 @@ var IdCaptureModelsContext = /*#__PURE__*/React.createContext({
|
|
|
6011
6032
|
setThresholds: function setThresholds() {
|
|
6012
6033
|
return null;
|
|
6013
6034
|
},
|
|
6035
|
+
documentDetectionBoundaries: defaultDocumentDetectionBoundaries,
|
|
6036
|
+
setDocumentDetectionBoundaries: function setDocumentDetectionBoundaries() {
|
|
6037
|
+
return null;
|
|
6038
|
+
},
|
|
6014
6039
|
onPredictionMade: function onPredictionMade() {
|
|
6015
6040
|
return null;
|
|
6016
6041
|
},
|
|
@@ -6044,6 +6069,8 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
6044
6069
|
detectionTime = _b.detectionTime,
|
|
6045
6070
|
documentDetectionThresholds = _b.documentDetectionThresholds,
|
|
6046
6071
|
setDocumentDetectionThresholds = _b.setDocumentDetectionThresholds,
|
|
6072
|
+
documentDetectionBoundaries = _b.documentDetectionBoundaries,
|
|
6073
|
+
setDocumentDetectionBoundaries = _b.setDocumentDetectionBoundaries,
|
|
6047
6074
|
documentDetectionModelError = _b.documentDetectionModelError;
|
|
6048
6075
|
var _c = React.useContext(FocusModelContext),
|
|
6049
6076
|
focusModelReady = _c.focusModelReady,
|
|
@@ -6152,6 +6179,8 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
6152
6179
|
stop: stopDocumentDetection,
|
|
6153
6180
|
thresholds: thresholds,
|
|
6154
6181
|
setThresholds: setThresholds,
|
|
6182
|
+
documentDetectionBoundaries: documentDetectionBoundaries,
|
|
6183
|
+
setDocumentDetectionBoundaries: setDocumentDetectionBoundaries,
|
|
6155
6184
|
onPredictionMade: onPredictionMade,
|
|
6156
6185
|
detectionTime: detectionTime,
|
|
6157
6186
|
focusPredictionTime: focusPredictionTime,
|
|
@@ -6161,7 +6190,7 @@ function IdCaptureModelsProviderInner(_a) {
|
|
|
6161
6190
|
requiredDocumentType: requiredDocumentType,
|
|
6162
6191
|
setRequiredDocumentType: setRequiredDocumentType
|
|
6163
6192
|
};
|
|
6164
|
-
}, [detectionTime, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
6193
|
+
}, [detectionTime, documentDetectionBoundaries, documentDetectionModelDownloadProgress, documentDetectionModelReady, focusModelDownloadProgress, focusModelReady, focusPredictionTime, getBestFrame, modelError, onPredictionMade, requiredDocumentType, resetBestFrame, setDocumentDetectionBoundaries, setThresholds, startDocumentDetection, stopDocumentDetection, thresholds]);
|
|
6165
6194
|
return /*#__PURE__*/React__namespace.default.createElement(IdCaptureModelsContext.Provider, {
|
|
6166
6195
|
value: value
|
|
6167
6196
|
}, /*#__PURE__*/React__namespace.default.createElement(InvisibleCanvas, {
|
|
@@ -13372,6 +13401,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
|
|
|
13372
13401
|
"$background": colors.guidanceMessageBackgroundColor,
|
|
13373
13402
|
"$textColor": colors.guidanceMessageTextColor
|
|
13374
13403
|
}, verbiage.guidanceMessageText))), /*#__PURE__*/React__namespace.default.createElement(GuidesComponent, {
|
|
13404
|
+
classNames: classNames.videoSignatureGuidesClassNames,
|
|
13375
13405
|
status: "success"
|
|
13376
13406
|
}), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, "Video: ", (_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.width, "x", (_d = cameraRef.current) === null || _d === void 0 ? void 0 : _d.height)), /*#__PURE__*/React__namespace.default.createElement(ExitCaptureButton, {
|
|
13377
13407
|
onClick: onExit,
|
|
@@ -13565,10 +13595,11 @@ var VideoSignatureWizard = function VideoSignatureWizard(_a) {
|
|
|
13565
13595
|
var guidesComponent = React.useCallback(function (_a) {
|
|
13566
13596
|
var status = _a.status;
|
|
13567
13597
|
return /*#__PURE__*/React__namespace.default.createElement(VideoSignatureGuides, {
|
|
13598
|
+
classNames: classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames,
|
|
13568
13599
|
faceGuideStatus: status,
|
|
13569
13600
|
requestedAction: status === 'success' ? 'CAPTURE_SIGNATURE' : 'VERIFY_LIVENESS'
|
|
13570
13601
|
});
|
|
13571
|
-
}, []);
|
|
13602
|
+
}, [classNames === null || classNames === void 0 ? void 0 : classNames.videoSignatureGuidesClassNames]);
|
|
13572
13603
|
return /*#__PURE__*/React__namespace.default.createElement(VideoSignatureContextProvider, null, /*#__PURE__*/React__namespace.default.createElement(PageContainer, {
|
|
13573
13604
|
className: "flex ".concat((_b = classNames === null || classNames === void 0 ? void 0 : classNames.container) !== null && _b !== void 0 ? _b : '')
|
|
13574
13605
|
}, /*#__PURE__*/React__namespace.default.createElement(CameraVideoTag, {
|
|
@@ -13737,8 +13768,8 @@ var Container = styled__default.default.div(templateObject_1$7 || (templateObjec
|
|
|
13737
13768
|
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.fontFamily;
|
|
13738
13769
|
});
|
|
13739
13770
|
var Inner = styled__default.default.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n max-height: 1280px;\n display: flex;\n margin: auto;\n align-items: center;\n flex-direction: column;\n"], ["\n width: 100%;\n height: 100%;\n max-height: 1280px;\n display: flex;\n margin: auto;\n align-items: center;\n flex-direction: column;\n"])));
|
|
13740
|
-
var FaceGuideContainer = styled__default.default.div(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n position: relative;\n height:
|
|
13741
|
-
var IdCardGuideContainer = styled__default.default.div(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n margin: 0 auto;\n position: relative;\n max-width: 100%;\n height:
|
|
13771
|
+
var FaceGuideContainer = styled__default.default.div(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n position: relative;\n height: 65%;\n"], ["\n position: relative;\n height: 65%;\n"])));
|
|
13772
|
+
var IdCardGuideContainer = styled__default.default.div(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n margin: 0 auto;\n position: relative;\n max-width: 100%;\n height: 35%;\n"], ["\n display: flex;\n flex-flow: column nowrap;\n margin: 0 auto;\n position: relative;\n max-width: 100%;\n height: 35%;\n"])));
|
|
13742
13773
|
var IdCardGuideInner = styled__default.default.div(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n position: relative;\n height: 100%;\n"], ["\n position: relative;\n height: 100%;\n"])));
|
|
13743
13774
|
var IdCardGuideInstructionsContainer = styled__default.default.div(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n padding: 0 40px;\n position: fixed;\n bottom: 14px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n"], ["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n padding: 0 40px;\n position: fixed;\n bottom: 14px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n"])));
|
|
13744
13775
|
var IdCardGuideInstructions = styled__default.default(GuidanceMessage)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n align-content: center;\n margin: 12px auto;\n padding: 8px 12px;\n font-weight: bold;\n font-size: 18px;\n"], ["\n align-content: center;\n margin: 12px auto;\n padding: 8px 12px;\n font-weight: bold;\n font-size: 18px;\n"])));
|
|
@@ -13849,8 +13880,8 @@ var templateObject_1$6, templateObject_2$6, templateObject_3$6, templateObject_4
|
|
|
13849
13880
|
var edgeBoundary = 0.05;
|
|
13850
13881
|
var defaultVideoIdCaptureThresholds = {
|
|
13851
13882
|
detection: {
|
|
13852
|
-
idCardFront: 0.
|
|
13853
|
-
idCardBack: 0.
|
|
13883
|
+
idCardFront: 0.4,
|
|
13884
|
+
idCardBack: 0.4,
|
|
13854
13885
|
passport: 1
|
|
13855
13886
|
},
|
|
13856
13887
|
focus: {
|
|
@@ -13937,6 +13968,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
13937
13968
|
stopIdModels = _19.stop,
|
|
13938
13969
|
onIdPredictionMade = _19.onPredictionMade,
|
|
13939
13970
|
setThresholds = _19.setThresholds,
|
|
13971
|
+
setDocumentDetectionBoundaries = _19.setDocumentDetectionBoundaries,
|
|
13940
13972
|
bestFrameDetails = _19.bestFrameDetails,
|
|
13941
13973
|
resetBestFrame = _19.resetBestFrame,
|
|
13942
13974
|
idModelError = _19.modelError;
|
|
@@ -13998,6 +14030,14 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
13998
14030
|
React.useEffect(function () {
|
|
13999
14031
|
setThresholds(videoIdCaptureThresholds);
|
|
14000
14032
|
}, [requestedAction, setThresholds, videoIdCaptureThresholds]);
|
|
14033
|
+
React.useEffect(function () {
|
|
14034
|
+
setDocumentDetectionBoundaries({
|
|
14035
|
+
top: 20,
|
|
14036
|
+
left: 20,
|
|
14037
|
+
right: 20,
|
|
14038
|
+
bottom: 1
|
|
14039
|
+
});
|
|
14040
|
+
}, [setDocumentDetectionBoundaries]);
|
|
14001
14041
|
var _26 = React.useState(0),
|
|
14002
14042
|
currentDetectionScore = _26[0],
|
|
14003
14043
|
setCurrentDetectionScore = _26[1];
|