idmission-web-sdk 2.1.71 → 2.1.73
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/IdCapture.d.ts +0 -1
- package/dist/components/id_capture/IdCaptureStateProvider.d.ts +0 -1
- package/dist/lib/locales/es/translation.d.ts +0 -1
- package/dist/lib/locales/index.d.ts +0 -1
- package/dist/lib/models/DocumentDetection.d.ts +0 -5
- package/dist/sdk2.cjs.development.js +41 -89
- 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 +41 -89
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +41 -89
- 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
|
@@ -34,7 +34,6 @@ export type IdCaptureVerbiage = {
|
|
|
34
34
|
guidanceTooBlurryText?: CustomerSuppliedVerbiage;
|
|
35
35
|
guidanceNotCenteredText?: CustomerSuppliedVerbiage;
|
|
36
36
|
guidanceTooCloseText?: CustomerSuppliedVerbiage;
|
|
37
|
-
guidanceNotStableText?: CustomerSuppliedVerbiage;
|
|
38
37
|
guidanceNotDetectedText?: CustomerSuppliedVerbiage;
|
|
39
38
|
guidanceIdCardNotAllowedText?: CustomerSuppliedVerbiage;
|
|
40
39
|
guidancePassportNotAllowedText?: CustomerSuppliedVerbiage;
|
|
@@ -23,7 +23,6 @@ declare const _default: {
|
|
|
23
23
|
'Document not detected': string;
|
|
24
24
|
'Document is not centered': string;
|
|
25
25
|
'Document too close, please back up': string;
|
|
26
|
-
'Please hold your ID document steady': string;
|
|
27
26
|
'Document out of focus \u2013 try improving the lighting': string;
|
|
28
27
|
'ID card front detected - please flip your ID card': string;
|
|
29
28
|
'ID card back detected - please flip your ID card': string;
|
|
@@ -31,7 +31,6 @@ export declare const resources: {
|
|
|
31
31
|
'Document not detected': string;
|
|
32
32
|
'Document is not centered': string;
|
|
33
33
|
'Document too close, please back up': string;
|
|
34
|
-
'Please hold your ID document steady': string;
|
|
35
34
|
'Document out of focus \u2013 try improving the lighting': string;
|
|
36
35
|
'ID card front detected - please flip your ID card': string;
|
|
37
36
|
'ID card back detected - please flip your ID card': string;
|
|
@@ -28,7 +28,6 @@ export type DocumentDetectionThresholds = {
|
|
|
28
28
|
idCardFront?: number;
|
|
29
29
|
idCardBack?: number;
|
|
30
30
|
passport?: number;
|
|
31
|
-
stability?: number;
|
|
32
31
|
};
|
|
33
32
|
export declare function loadDocumentDetector(modelAssetPath?: string, scoreThreshold?: number): Promise<ObjectDetector>;
|
|
34
33
|
export declare function useLoadDocumentDetector({ modelPath, modelLoadTimeoutMs, scoreThreshold, onModelError, }: {
|
|
@@ -58,7 +57,6 @@ export type DocumentDetectionPrediction = {
|
|
|
58
57
|
bestDocument: DetectedObject | undefined;
|
|
59
58
|
documentInBounds: boolean;
|
|
60
59
|
documentTooClose: boolean;
|
|
61
|
-
documentIsStable: boolean;
|
|
62
60
|
frameWidth: number;
|
|
63
61
|
frameHeight: number;
|
|
64
62
|
allZero: boolean;
|
|
@@ -70,9 +68,6 @@ export type ObjectDetectorPrediction = ObjectDetectorResult & {
|
|
|
70
68
|
frameHeight: number;
|
|
71
69
|
};
|
|
72
70
|
export declare function makeDocumentDetectorPrediction(detector: ObjectDetector, frame: HTMLCanvasElement): Promise<ObjectDetectorPrediction | null>;
|
|
73
|
-
export declare let lastDetectionAt: number;
|
|
74
|
-
export declare let lastDetectionTime: number;
|
|
75
|
-
export declare function setLastDetectionAt(time: number): void;
|
|
76
71
|
export type DocumentDetectionBoundaries = {
|
|
77
72
|
top: number;
|
|
78
73
|
bottom: number;
|
|
@@ -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.73';
|
|
238
238
|
|
|
239
239
|
function getPlatform() {
|
|
240
240
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -5439,8 +5439,7 @@ var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
|
|
|
5439
5439
|
var defaultDocumentDetectionThresholds = {
|
|
5440
5440
|
idCardFront: 0.6,
|
|
5441
5441
|
idCardBack: 0.6,
|
|
5442
|
-
passport: 0.4
|
|
5443
|
-
stability: 0.7
|
|
5442
|
+
passport: 0.4
|
|
5444
5443
|
};
|
|
5445
5444
|
var documentTypeDisplayNames = {
|
|
5446
5445
|
idCardFront: 'ID card front',
|
|
@@ -5582,13 +5581,6 @@ function makeDocumentDetectorPrediction(detector, frame) {
|
|
|
5582
5581
|
});
|
|
5583
5582
|
});
|
|
5584
5583
|
}
|
|
5585
|
-
var lastNBoxes = [];
|
|
5586
|
-
var lastDetectionAt = 0;
|
|
5587
|
-
var lastDetectionTime = 0;
|
|
5588
|
-
function setLastDetectionAt(time) {
|
|
5589
|
-
lastDetectionTime = time - lastDetectionAt;
|
|
5590
|
-
lastDetectionAt = time;
|
|
5591
|
-
}
|
|
5592
5584
|
var defaultDocumentDetectionBoundaries = {
|
|
5593
5585
|
top: 20,
|
|
5594
5586
|
bottom: 20,
|
|
@@ -5596,7 +5588,7 @@ var defaultDocumentDetectionBoundaries = {
|
|
|
5596
5588
|
right: 20
|
|
5597
5589
|
};
|
|
5598
5590
|
function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
5599
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
5591
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
5600
5592
|
if (boundaries === void 0) {
|
|
5601
5593
|
boundaries = defaultDocumentDetectionBoundaries;
|
|
5602
5594
|
}
|
|
@@ -5652,11 +5644,11 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5652
5644
|
var boundaryLeft = (_j = boundaries.left) !== null && _j !== void 0 ? _j : 20;
|
|
5653
5645
|
var boundaryRight = (_k = boundaries.right) !== null && _k !== void 0 ? _k : 20;
|
|
5654
5646
|
var boundaryBottom = (_l = boundaries.bottom) !== null && _l !== void 0 ? _l : 20;
|
|
5655
|
-
var
|
|
5656
|
-
xMin =
|
|
5657
|
-
yMin =
|
|
5658
|
-
width =
|
|
5659
|
-
height =
|
|
5647
|
+
var _m = bestDocument.box,
|
|
5648
|
+
xMin = _m.xMin,
|
|
5649
|
+
yMin = _m.yMin,
|
|
5650
|
+
width = _m.width,
|
|
5651
|
+
height = _m.height;
|
|
5660
5652
|
documentInBounds = yMin > boundaryTop &&
|
|
5661
5653
|
// Is it valid top edge of ID detected?
|
|
5662
5654
|
yMin + height + boundaryBottom < frameHeight && (
|
|
@@ -5665,23 +5657,12 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5665
5657
|
// If either the left side visible or if not, right edge of ID should be more than 80% of width.
|
|
5666
5658
|
xMin + width + boundaryRight < frameWidth; // Valid right edge if it's less than video width.
|
|
5667
5659
|
}
|
|
5668
|
-
var documentIsStable = false;
|
|
5669
5660
|
var documentTooClose = false;
|
|
5670
5661
|
if (bestDocument) {
|
|
5671
|
-
var
|
|
5672
|
-
docWidth =
|
|
5673
|
-
docHeight =
|
|
5662
|
+
var _o = [bestDocument.box.width / frameWidth, bestDocument.box.height / frameHeight],
|
|
5663
|
+
docWidth = _o[0],
|
|
5664
|
+
docHeight = _o[1];
|
|
5674
5665
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
5675
|
-
if (detectionThresholdMet) {
|
|
5676
|
-
var threshold_1 = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
|
|
5677
|
-
var framesNeeded = Math.min(1000 / lastDetectionTime, 12);
|
|
5678
|
-
lastNBoxes = __spreadArray([bestDocument.box], lastNBoxes, true).slice(0, framesNeeded);
|
|
5679
|
-
documentIsStable = lastNBoxes.length >= framesNeeded && !createPairs(lastNBoxes).some(function (_a) {
|
|
5680
|
-
var a = _a[0],
|
|
5681
|
-
b = _a[1];
|
|
5682
|
-
return calculateIoU(a, b) < threshold_1;
|
|
5683
|
-
});
|
|
5684
|
-
}
|
|
5685
5666
|
}
|
|
5686
5667
|
return {
|
|
5687
5668
|
detectedObjects: detectedObjects,
|
|
@@ -5698,7 +5679,6 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5698
5679
|
bestDocument: bestDocument,
|
|
5699
5680
|
documentInBounds: documentInBounds,
|
|
5700
5681
|
documentTooClose: documentTooClose,
|
|
5701
|
-
documentIsStable: documentIsStable,
|
|
5702
5682
|
frameWidth: frameWidth,
|
|
5703
5683
|
frameHeight: frameHeight,
|
|
5704
5684
|
allZero: allZero
|
|
@@ -5718,27 +5698,6 @@ function applyNonMaxSuppression(detectedObjects) {
|
|
|
5718
5698
|
return !!obj;
|
|
5719
5699
|
});
|
|
5720
5700
|
}
|
|
5721
|
-
function createPairs(arr) {
|
|
5722
|
-
var pairs = [];
|
|
5723
|
-
for (var i = 0; i < arr.length - 1; i++) {
|
|
5724
|
-
pairs.push([arr[i], arr[i + 1]]);
|
|
5725
|
-
}
|
|
5726
|
-
return pairs;
|
|
5727
|
-
}
|
|
5728
|
-
function calculateIoU(boxA, boxB) {
|
|
5729
|
-
var xA = Math.max(boxA.xMin, boxB.xMin);
|
|
5730
|
-
var yA = Math.max(boxA.yMin, boxB.yMin);
|
|
5731
|
-
var xB = Math.min(boxA.xMax, boxB.xMax);
|
|
5732
|
-
var yB = Math.min(boxA.yMax, boxB.yMax);
|
|
5733
|
-
var intersectWidth = Math.max(0, xB - xA);
|
|
5734
|
-
var intersectHeight = Math.max(0, yB - yA);
|
|
5735
|
-
var intersectionArea = intersectWidth * intersectHeight;
|
|
5736
|
-
var boxAArea = (boxA.xMax - boxA.xMin) * (boxA.yMax - boxA.yMin);
|
|
5737
|
-
var boxBArea = (boxB.xMax - boxB.xMin) * (boxB.yMax - boxB.yMin);
|
|
5738
|
-
var unionArea = boxAArea + boxBArea - intersectionArea;
|
|
5739
|
-
if (unionArea === 0) return 0;
|
|
5740
|
-
return intersectionArea / unionArea;
|
|
5741
|
-
}
|
|
5742
5701
|
|
|
5743
5702
|
function useFrameLoop(fn, _a) {
|
|
5744
5703
|
var _b = _a.throttleMs,
|
|
@@ -5756,20 +5715,16 @@ function useFrameLoop(fn, _a) {
|
|
|
5756
5715
|
var currentLoopId = loopId.current;
|
|
5757
5716
|
function renderPrediction() {
|
|
5758
5717
|
return __awaiter(this, void 0, void 0, function () {
|
|
5759
|
-
var start, took, amountToThrottle;
|
|
5760
5718
|
return __generator(this, function (_a) {
|
|
5761
5719
|
switch (_a.label) {
|
|
5762
5720
|
case 0:
|
|
5763
5721
|
if (currentLoopId !== loopId.current) return [2 /*return*/];
|
|
5764
|
-
start = new Date().getTime();
|
|
5765
5722
|
return [4 /*yield*/, fn(frameId.current)];
|
|
5766
5723
|
case 1:
|
|
5767
5724
|
_a.sent();
|
|
5768
|
-
took = new Date().getTime() - start;
|
|
5769
|
-
amountToThrottle = Math.max((throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0) - took, 0);
|
|
5770
5725
|
timer = setTimeout(function () {
|
|
5771
5726
|
frameId.current = requestAnimationFrame(renderPrediction);
|
|
5772
|
-
},
|
|
5727
|
+
}, throttleMs !== null && throttleMs !== void 0 ? throttleMs : 0);
|
|
5773
5728
|
return [2 /*return*/];
|
|
5774
5729
|
}
|
|
5775
5730
|
});
|
|
@@ -5835,27 +5790,29 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5835
5790
|
var _b = _a.autoStart,
|
|
5836
5791
|
autoStart = _b === void 0 ? true : _b,
|
|
5837
5792
|
children = _a.children,
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
documentDetectionModelLoadTimeoutMs = _f === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _f,
|
|
5793
|
+
throttleMs = _a.throttleMs,
|
|
5794
|
+
_c = _a.documentDetectionModelPath,
|
|
5795
|
+
documentDetectionModelPath = _c === void 0 ? defaultDocumentDetectorModelPath : _c,
|
|
5796
|
+
_d = _a.documentDetectionModelScoreThreshold,
|
|
5797
|
+
documentDetectionModelScoreThreshold = _d === void 0 ? defaultDocumentDetectionScoreThreshold : _d,
|
|
5798
|
+
_e = _a.documentDetectionModelLoadTimeoutMs,
|
|
5799
|
+
documentDetectionModelLoadTimeoutMs = _e === void 0 ? defaultDocumentDetectionModelLoadTimeoutMs : _e,
|
|
5846
5800
|
onDocumentDetectionModelError = _a.onDocumentDetectionModelError;
|
|
5847
|
-
var
|
|
5848
|
-
videoRef =
|
|
5849
|
-
videoLoaded =
|
|
5850
|
-
cameraReady =
|
|
5801
|
+
var _f = React.useContext(CameraStateContext),
|
|
5802
|
+
videoRef = _f.videoRef,
|
|
5803
|
+
videoLoaded = _f.videoLoaded,
|
|
5804
|
+
cameraReady = _f.cameraReady;
|
|
5851
5805
|
var lastPredictionCanvas = React.useRef(null);
|
|
5852
5806
|
var onPredictionHandler = React.useRef();
|
|
5853
|
-
var
|
|
5854
|
-
documentDetectionThresholds =
|
|
5855
|
-
setDocumentDetectionThresholds =
|
|
5856
|
-
var
|
|
5857
|
-
documentDetectionBoundaries =
|
|
5858
|
-
setDocumentDetectionBoundaries =
|
|
5807
|
+
var _g = React.useState({}),
|
|
5808
|
+
documentDetectionThresholds = _g[0],
|
|
5809
|
+
setDocumentDetectionThresholds = _g[1];
|
|
5810
|
+
var _h = React.useState(defaultDocumentDetectionBoundaries),
|
|
5811
|
+
documentDetectionBoundaries = _h[0],
|
|
5812
|
+
setDocumentDetectionBoundaries = _h[1];
|
|
5813
|
+
var _j = React.useState(0),
|
|
5814
|
+
detectionTime = _j[0],
|
|
5815
|
+
setDetectionTime = _j[1];
|
|
5859
5816
|
var _k = React.useState(0),
|
|
5860
5817
|
timesAllZero = _k[0],
|
|
5861
5818
|
setTimesAllZero = _k[1];
|
|
@@ -5897,7 +5854,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5897
5854
|
if (!prediction) return [3 /*break*/, 3];
|
|
5898
5855
|
processedPrediction = processDocumentDetectorPrediction(prediction, documentDetectionThresholds, documentDetectionBoundaries);
|
|
5899
5856
|
processedPrediction.frameId = frameId;
|
|
5900
|
-
|
|
5857
|
+
setDetectionTime(prediction.time);
|
|
5901
5858
|
debug(processedPrediction);
|
|
5902
5859
|
if (processedPrediction.allZero) setTimesAllZero(function (n) {
|
|
5903
5860
|
return n + 1;
|
|
@@ -5940,7 +5897,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5940
5897
|
documentDetectionModelError: modelError,
|
|
5941
5898
|
documentDetectionModelDownloadProgress: modelDownloadProgress,
|
|
5942
5899
|
onDocumentDetected: onDocumentDetected,
|
|
5943
|
-
detectionTime:
|
|
5900
|
+
detectionTime: detectionTime,
|
|
5944
5901
|
documentDetectionThresholds: documentDetectionThresholds,
|
|
5945
5902
|
setDocumentDetectionThresholds: setDocumentDetectionThresholds,
|
|
5946
5903
|
documentDetectionBoundaries: documentDetectionBoundaries,
|
|
@@ -5948,7 +5905,7 @@ function DocumentDetectionModelProvider(_a) {
|
|
|
5948
5905
|
documentDetectionLastPredictionCanvas: lastPredictionCanvas,
|
|
5949
5906
|
clearDocumentDetectionLastPredictionCanvas: clearDocumentDetectionLastPredictionCanvas
|
|
5950
5907
|
};
|
|
5951
|
-
}, [start, stop, ready, modelError, modelDownloadProgress, onDocumentDetected, documentDetectionThresholds, documentDetectionBoundaries, clearDocumentDetectionLastPredictionCanvas]);
|
|
5908
|
+
}, [start, stop, ready, modelError, modelDownloadProgress, onDocumentDetected, detectionTime, documentDetectionThresholds, documentDetectionBoundaries, clearDocumentDetectionLastPredictionCanvas]);
|
|
5952
5909
|
return /*#__PURE__*/React__namespace.createElement(DocumentDetectionModelContext.Provider, {
|
|
5953
5910
|
value: value
|
|
5954
5911
|
}, /*#__PURE__*/React__namespace.createElement(InvisibleCanvas, {
|
|
@@ -6286,7 +6243,6 @@ var initialState$4 = {
|
|
|
6286
6243
|
detectionThresholdMet: false,
|
|
6287
6244
|
documentInBounds: false,
|
|
6288
6245
|
documentTooClose: false,
|
|
6289
|
-
documentIsStable: false,
|
|
6290
6246
|
flipRequired: false,
|
|
6291
6247
|
backDetectedFirst: false,
|
|
6292
6248
|
idCardDetectedButNotAllowed: false,
|
|
@@ -6405,7 +6361,6 @@ var _reducer = function reducer(state, action) {
|
|
|
6405
6361
|
bestDocument = _d.bestDocument,
|
|
6406
6362
|
documentInBounds = _d.documentInBounds,
|
|
6407
6363
|
documentTooClose = _d.documentTooClose,
|
|
6408
|
-
documentIsStable = _d.documentIsStable,
|
|
6409
6364
|
focusScore = _d.focusScore,
|
|
6410
6365
|
focusThresholdMet = _d.focusThresholdMet,
|
|
6411
6366
|
frameWidth = _d.frameWidth,
|
|
@@ -6427,7 +6382,7 @@ var _reducer = function reducer(state, action) {
|
|
|
6427
6382
|
if (state.captureState === 'capturing' && (flipRequired || backDetectedFirst)) {
|
|
6428
6383
|
wrongDocumentTypePredictions += 1;
|
|
6429
6384
|
}
|
|
6430
|
-
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet
|
|
6385
|
+
var isGoodFrame = detectionThresholdMet && documentInBounds && !documentTooClose && !flipRequired && !backDetectedFirst && focusThresholdMet;
|
|
6431
6386
|
var goodFramesCount = state.goodFramesCount;
|
|
6432
6387
|
if (isGoodFrame) {
|
|
6433
6388
|
goodFramesCount += 1;
|
|
@@ -6462,7 +6417,6 @@ var _reducer = function reducer(state, action) {
|
|
|
6462
6417
|
detectionThresholdMet: detectionThresholdMet,
|
|
6463
6418
|
documentInBounds: documentInBounds,
|
|
6464
6419
|
documentTooClose: documentTooClose,
|
|
6465
|
-
documentIsStable: documentIsStable,
|
|
6466
6420
|
flipRequired: flipRequired,
|
|
6467
6421
|
backDetectedFirst: backDetectedFirst,
|
|
6468
6422
|
idCardDetectedButNotAllowed: idCardDetectedButNotAllowed,
|
|
@@ -6882,7 +6836,6 @@ var esTranslation = {
|
|
|
6882
6836
|
'Document not detected': 'No se ha detectado el documento',
|
|
6883
6837
|
'Document is not centered': 'Documento no centrado',
|
|
6884
6838
|
'Document too close, please back up': 'Documento muy cerca, favor de alejarse',
|
|
6885
|
-
'Please hold your ID document steady': 'Por favor, mantenga firme su documento de identidad',
|
|
6886
6839
|
'Document out of focus – try improving the lighting': 'Documento no enfocado - hay que tratar de mejorar la iluminación',
|
|
6887
6840
|
'ID card front detected - please flip your ID card': 'Anverso de ID detectado, por favor voltea tu identificación',
|
|
6888
6841
|
'ID card back detected - please flip your ID card': 'Reverso de ID detectado, por favor voltea tu identificación',
|
|
@@ -7204,8 +7157,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
7204
7157
|
guidanceTooCloseText: 'Document too close, please back up',
|
|
7205
7158
|
guidanceNotDetectedText: 'Document not detected',
|
|
7206
7159
|
guidanceIdCardNotAllowedText: 'ID card detected, please scan a passport instead',
|
|
7207
|
-
guidancePassportNotAllowedText: 'Passport detected, please scan an ID card instead'
|
|
7208
|
-
guidanceNotStableText: 'Please hold your ID document steady'
|
|
7160
|
+
guidancePassportNotAllowedText: 'Passport detected, please scan an ID card instead'
|
|
7209
7161
|
});
|
|
7210
7162
|
var debugScalingDetails = useDebugScalingDetails({
|
|
7211
7163
|
enabled: debugMode,
|
|
@@ -7216,7 +7168,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
7216
7168
|
});
|
|
7217
7169
|
var satisfied = state.isGoodFrame;
|
|
7218
7170
|
if (typeof guidanceSatisfied === 'boolean') satisfied = guidanceSatisfied;
|
|
7219
|
-
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : state.idCardDetectedButNotAllowed ? verbiage.guidanceIdCardNotAllowedText : state.passportDetectedButNotAllowed ? verbiage.guidancePassportNotAllowedText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText :
|
|
7171
|
+
guidanceMessage || (guidanceMessage = satisfied ? verbiage.guidanceSatisfiedText : !state.detectionThresholdMet ? verbiage.guidanceNotDetectedText : state.backDetectedFirst ? verbiage.guidanceBackDetectedFirstText : state.flipRequired ? verbiage.guidancePleaseFlipText : state.idCardDetectedButNotAllowed ? verbiage.guidanceIdCardNotAllowedText : state.passportDetectedButNotAllowed ? verbiage.guidancePassportNotAllowedText : !state.documentInBounds ? verbiage.guidanceNotCenteredText : state.documentTooClose ? verbiage.guidanceTooCloseText : !state.focusThresholdMet ? verbiage.guidanceTooBlurryText : '');
|
|
7220
7172
|
return /*#__PURE__*/React__namespace.default.createElement(PageContainer, {
|
|
7221
7173
|
ref: ref,
|
|
7222
7174
|
className: "flex ".concat((_h = classNames.container) !== null && _h !== void 0 ? _h : '')
|
|
@@ -7241,7 +7193,7 @@ var IdCapture = function IdCapture(_a) {
|
|
|
7241
7193
|
scaling: debugScalingDetails,
|
|
7242
7194
|
flipX: !((_a = cameraRef.current) === null || _a === void 0 ? void 0 : _a.isRearFacing)
|
|
7243
7195
|
});
|
|
7244
|
-
}))), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__namespace.default.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__namespace.default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__namespace.default.createElement("br", null), state.
|
|
7196
|
+
}))), debugMode && ( /*#__PURE__*/React__namespace.default.createElement(DebugStatsPane, null, cameraRef.current ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u2705 Camera: ", cameraRef.current.label, " (", cameraRef.current.width, "x", cameraRef.current.height, ")")) : '❌ Camera not ready', /*#__PURE__*/React__namespace.default.createElement("br", null), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, ' ', "fps (", detectionTime, "ms doc detect, ", focusPredictionTime, "ms focus)", /*#__PURE__*/React__namespace.default.createElement("br", null), modelsReady ? ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type: ", state.detectedDocumentType, /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score: ", state.passportDetectionScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), /*#__PURE__*/React__namespace.default.createElement("br", null), state.documentInBounds ? '✅' : '❌', " Document In Bounds", /*#__PURE__*/React__namespace.default.createElement("br", null), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold)) : ( /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, "\u274C Models not ready")))));
|
|
7245
7197
|
};
|
|
7246
7198
|
var timeSince = function timeSince(t) {
|
|
7247
7199
|
if (!t) return 0;
|
|
@@ -8014,7 +7966,7 @@ var ProgressBarBackground$1 = styled__default.default.div(templateObject_13$1 ||
|
|
|
8014
7966
|
var _a, _b, _c, _d;
|
|
8015
7967
|
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;
|
|
8016
7968
|
});
|
|
8017
|
-
var ProgressBar$1 = styled__default.default.span(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n"])), function (props) {
|
|
7969
|
+
var ProgressBar$1 = styled__default.default.span(templateObject_14$1 || (templateObject_14$1 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"])), function (props) {
|
|
8018
7970
|
return props.$progress;
|
|
8019
7971
|
});
|
|
8020
7972
|
var ProgressIndicator$1 = styled__default.default.span(templateObject_15$1 || (templateObject_15$1 = __makeTemplateObject(["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"], ["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])), function (props) {
|
|
@@ -12375,7 +12327,7 @@ var ProgressBarBackground = styled__default.default.div(templateObject_10 || (te
|
|
|
12375
12327
|
var _a, _b, _c, _d;
|
|
12376
12328
|
return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.selfieCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundOpacity) !== null && _d !== void 0 ? _d : 0.75;
|
|
12377
12329
|
});
|
|
12378
|
-
var ProgressBar = styled__default.default.span(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n"])), function (props) {
|
|
12330
|
+
var ProgressBar = styled__default.default.span(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"], ["\n display: block;\n width: ", "%;\n height: 100%;\n left: 0;\n position: absolute;\n"])), function (props) {
|
|
12379
12331
|
return props.$progress;
|
|
12380
12332
|
});
|
|
12381
12333
|
var ProgressIndicator = styled__default.default.span(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"], ["\n display: block;\n height: 100%;\n background: ", ";\n animation: progressBar 3s ease-in-out;\n animation-fill-mode: both;\n\n @keyframes progressBar {\n 0% {\n width: 0;\n }\n 100% {\n width: 100%;\n }\n }\n"])), function (props) {
|