@jaak.ai/stamps 1.0.0-dev.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/README.md +385 -0
- package/dist/cjs/document-detector_19.cjs.entry.js +8528 -0
- package/dist/cjs/index-5e4e5e7d.js +1685 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/cjs/mb-tooltip.cjs.entry.js +26 -0
- package/dist/cjs/stamps.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/document-detector/document-detector.css +154 -0
- package/dist/collection/components/document-detector/document-detector.js +383 -0
- package/dist/collection/components/shared/mb-api-process-status/mb-api-process-status.css +360 -0
- package/dist/collection/components/shared/mb-api-process-status/mb-api-process-status.js +124 -0
- package/dist/collection/components/shared/mb-button/mb-button.css +95 -0
- package/dist/collection/components/shared/mb-button/mb-button.js +201 -0
- package/dist/collection/components/shared/mb-button-classic/mb-button-classic.css +100 -0
- package/dist/collection/components/shared/mb-button-classic/mb-button-classic.js +130 -0
- package/dist/collection/components/shared/mb-camera-experience/mb-camera-experience.css +740 -0
- package/dist/collection/components/shared/mb-camera-experience/mb-camera-experience.js +827 -0
- package/dist/collection/components/shared/mb-camera-experience/mb-camera-experience.utils.js +55 -0
- package/dist/collection/components/shared/mb-camera-selection/mb-camera-selection.css +124 -0
- package/dist/collection/components/shared/mb-camera-selection/mb-camera-selection.js +194 -0
- package/dist/collection/components/shared/mb-camera-toolbar/mb-camera-toolbar.css +80 -0
- package/dist/collection/components/shared/mb-camera-toolbar/mb-camera-toolbar.js +275 -0
- package/dist/collection/components/shared/mb-completed/mb-completed.css +17 -0
- package/dist/collection/components/shared/mb-completed/mb-completed.js +48 -0
- package/dist/collection/components/shared/mb-component/mb-component.css +321 -0
- package/dist/collection/components/shared/mb-component/mb-component.js +2269 -0
- package/dist/collection/components/shared/mb-component/mb-component.utils.js +14 -0
- package/dist/collection/components/shared/mb-container/mb-container.css +7 -0
- package/dist/collection/components/shared/mb-container/mb-container.js +23 -0
- package/dist/collection/components/shared/mb-feedback/mb-feedback.css +36 -0
- package/dist/collection/components/shared/mb-feedback/mb-feedback.js +91 -0
- package/dist/collection/components/shared/mb-feedback/mb-feedback.utils.js +11 -0
- package/dist/collection/components/shared/mb-help/mb-help.css +191 -0
- package/dist/collection/components/shared/mb-help/mb-help.js +409 -0
- package/dist/collection/components/shared/mb-help/mb-help.model.js +5 -0
- package/dist/collection/components/shared/mb-image-box/mb-image-box.css +78 -0
- package/dist/collection/components/shared/mb-image-box/mb-image-box.js +150 -0
- package/dist/collection/components/shared/mb-modal/mb-modal.css +106 -0
- package/dist/collection/components/shared/mb-modal/mb-modal.js +239 -0
- package/dist/collection/components/shared/mb-overlay/mb-overlay.css +46 -0
- package/dist/collection/components/shared/mb-overlay/mb-overlay.js +76 -0
- package/dist/collection/components/shared/mb-progress-tracker/mb-progress-tracker.css +24 -0
- package/dist/collection/components/shared/mb-progress-tracker/mb-progress-tracker.js +80 -0
- package/dist/collection/components/shared/mb-screen/mb-screen.css +19 -0
- package/dist/collection/components/shared/mb-screen/mb-screen.js +48 -0
- package/dist/collection/components/shared/mb-spinner/mb-spinner.css +30 -0
- package/dist/collection/components/shared/mb-spinner/mb-spinner.js +67 -0
- package/dist/collection/components/shared/mb-tooltip/mb-tooltip.css +62 -0
- package/dist/collection/components/shared/mb-tooltip/mb-tooltip.js +150 -0
- package/dist/collection/components/shared/mb-tooltip-advanced/mb-tooltip-advanced.css +91 -0
- package/dist/collection/components/shared/mb-tooltip-advanced/mb-tooltip-advanced.js +96 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/data-structures.js +189 -0
- package/dist/collection/utils/device.helpers.js +37 -0
- package/dist/collection/utils/error-structures.js +47 -0
- package/dist/collection/utils/generic.helpers.js +82 -0
- package/dist/collection/utils/sdk.service.js +943 -0
- package/dist/collection/utils/state-lifter.js +3 -0
- package/dist/collection/utils/status.document-detector.js +15 -0
- package/dist/collection/utils/translation.service.js +97 -0
- package/dist/esm/document-detector_19.entry.js +8506 -0
- package/dist/esm/index-dc740acb.js +1656 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +18 -0
- package/dist/esm/mb-tooltip.entry.js +22 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/stamps.js +18 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stamps/index.esm.js +0 -0
- package/dist/stamps/p-02990b18.entry.js +9 -0
- package/dist/stamps/p-7f07a434.js +2 -0
- package/dist/stamps/p-ec3f5972.entry.js +1 -0
- package/dist/stamps/stamps.esm.js +1 -0
- package/dist/types/components/document-detector/document-detector.d.ts +84 -0
- package/dist/types/components/shared/mb-api-process-status/mb-api-process-status.d.ts +30 -0
- package/dist/types/components/shared/mb-button/mb-button.d.ts +41 -0
- package/dist/types/components/shared/mb-button-classic/mb-button-classic.d.ts +27 -0
- package/dist/types/components/shared/mb-camera-experience/mb-camera-experience.d.ts +141 -0
- package/dist/types/components/shared/mb-camera-experience/mb-camera-experience.utils.d.ts +3 -0
- package/dist/types/components/shared/mb-camera-selection/mb-camera-selection.d.ts +33 -0
- package/dist/types/components/shared/mb-camera-toolbar/mb-camera-toolbar.d.ts +54 -0
- package/dist/types/components/shared/mb-completed/mb-completed.d.ts +12 -0
- package/dist/types/components/shared/mb-component/mb-component.d.ts +308 -0
- package/dist/types/components/shared/mb-component/mb-component.utils.d.ts +3 -0
- package/dist/types/components/shared/mb-container/mb-container.d.ts +8 -0
- package/dist/types/components/shared/mb-feedback/mb-feedback.d.ts +19 -0
- package/dist/types/components/shared/mb-feedback/mb-feedback.utils.d.ts +2 -0
- package/dist/types/components/shared/mb-help/mb-help.d.ts +66 -0
- package/dist/types/components/shared/mb-help/mb-help.model.d.ts +9 -0
- package/dist/types/components/shared/mb-image-box/mb-image-box.d.ts +35 -0
- package/dist/types/components/shared/mb-modal/mb-modal.d.ts +53 -0
- package/dist/types/components/shared/mb-overlay/mb-overlay.d.ts +17 -0
- package/dist/types/components/shared/mb-progress-tracker/mb-progress-tracker.d.ts +19 -0
- package/dist/types/components/shared/mb-screen/mb-screen.d.ts +12 -0
- package/dist/types/components/shared/mb-spinner/mb-spinner.d.ts +16 -0
- package/dist/types/components/shared/mb-tooltip/mb-tooltip.d.ts +10 -0
- package/dist/types/components/shared/mb-tooltip-advanced/mb-tooltip-advanced.d.ts +7 -0
- package/dist/types/components.d.ts +1381 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1637 -0
- package/dist/types/utils/data-structures.d.ts +264 -0
- package/dist/types/utils/device.helpers.d.ts +7 -0
- package/dist/types/utils/error-structures.d.ts +44 -0
- package/dist/types/utils/generic.helpers.d.ts +21 -0
- package/dist/types/utils/sdk.service.d.ts +52 -0
- package/dist/types/utils/state-lifter.d.ts +3 -0
- package/dist/types/utils/status.document-detector.d.ts +14 -0
- package/dist/types/utils/translation.service.d.ts +77 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +63 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class MbTooltipAdvanced {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.show = undefined;
|
|
5
|
+
this.message = undefined;
|
|
6
|
+
this.arrowPosition = undefined;
|
|
7
|
+
this.textAlign = undefined;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, null, h("p", { part: "tooltip", class: `mb-tooltip ${this.show ? "visible" : ""} ${this.arrowPosition ? this.arrowPosition : "arrow-none"} ${this.textAlign ? this.textAlign : "text-center"} ` }, this.message)));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "mb-tooltip-advanced"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() {
|
|
15
|
+
return {
|
|
16
|
+
"$": ["mb-tooltip-advanced.scss"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get styleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["mb-tooltip-advanced.css"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get properties() {
|
|
25
|
+
return {
|
|
26
|
+
"show": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"mutable": false,
|
|
29
|
+
"complexType": {
|
|
30
|
+
"original": "boolean",
|
|
31
|
+
"resolved": "boolean",
|
|
32
|
+
"references": {}
|
|
33
|
+
},
|
|
34
|
+
"required": false,
|
|
35
|
+
"optional": false,
|
|
36
|
+
"docs": {
|
|
37
|
+
"tags": [],
|
|
38
|
+
"text": ""
|
|
39
|
+
},
|
|
40
|
+
"attribute": "show",
|
|
41
|
+
"reflect": false
|
|
42
|
+
},
|
|
43
|
+
"message": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"mutable": false,
|
|
46
|
+
"complexType": {
|
|
47
|
+
"original": "string",
|
|
48
|
+
"resolved": "string",
|
|
49
|
+
"references": {}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": ""
|
|
56
|
+
},
|
|
57
|
+
"attribute": "message",
|
|
58
|
+
"reflect": false
|
|
59
|
+
},
|
|
60
|
+
"arrowPosition": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "| \"arrow-left\"\n | \"arrow-right\"\n | \"arrow-up\"\n | \"arrow-up-left\"\n | \"arrow-up-right\"\n | \"arrow-down\"\n | \"arrow-down-left\"\n | \"arrow-down-right\"",
|
|
65
|
+
"resolved": "\"arrow-down\" | \"arrow-down-left\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-up\" | \"arrow-up-left\" | \"arrow-up-right\"",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": true,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": ""
|
|
73
|
+
},
|
|
74
|
+
"attribute": "arrow-position",
|
|
75
|
+
"reflect": false
|
|
76
|
+
},
|
|
77
|
+
"textAlign": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "\"text-center\" | \"text-left\" | \"text-right\"",
|
|
82
|
+
"resolved": "\"text-center\" | \"text-left\" | \"text-right\"",
|
|
83
|
+
"references": {}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": true,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": ""
|
|
90
|
+
},
|
|
91
|
+
"attribute": "text-align",
|
|
92
|
+
"reflect": false
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
export { SDKError, } from "@microblink/blinkid-in-browser-sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Events
|
|
4
|
+
*/
|
|
5
|
+
export class EventReady {
|
|
6
|
+
constructor(sdk) {
|
|
7
|
+
this.sdk = sdk;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export class EventScanError {
|
|
11
|
+
constructor(code, fatal, message, recognizerName, details) {
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.fatal = fatal;
|
|
14
|
+
this.message = message;
|
|
15
|
+
this.recognizerName = recognizerName;
|
|
16
|
+
if (details) {
|
|
17
|
+
this.details = details;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class EventScanSuccess {
|
|
22
|
+
constructor(recognizer, recognizerName) {
|
|
23
|
+
this.recognizer = recognizer;
|
|
24
|
+
this.recognizerName = recognizerName;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Error codes
|
|
29
|
+
*/
|
|
30
|
+
export var Code;
|
|
31
|
+
(function (Code) {
|
|
32
|
+
Code["EmptyResult"] = "EMPTY_RESULT";
|
|
33
|
+
Code["InvalidRecognizerOptions"] = "INVALID_RECOGNIZER_OPTIONS";
|
|
34
|
+
Code["NoImageFileFound"] = "NO_IMAGE_FILE_FOUND";
|
|
35
|
+
Code["NoFirstImageFileFound"] = "NO_FIRST_IMAGE_FILE_FOUND";
|
|
36
|
+
Code["NoSecondImageFileFound"] = "NO_SECOND_IMAGE_FILE_FOUND";
|
|
37
|
+
Code["GenericScanError"] = "GENERIC_SCAN_ERROR";
|
|
38
|
+
Code["CameraNotAllowed"] = "CAMERA_NOT_ALLOWED";
|
|
39
|
+
Code["CameraInUse"] = "CAMERA_IN_USE";
|
|
40
|
+
Code["CameraGenericError"] = "CAMERA_GENERIC_ERROR";
|
|
41
|
+
})(Code || (Code = {}));
|
|
42
|
+
/**
|
|
43
|
+
* Scan structures
|
|
44
|
+
*/
|
|
45
|
+
export const AvailableRecognizers = {
|
|
46
|
+
IdBarcodeRecognizer: "createIdBarcodeRecognizer",
|
|
47
|
+
BlinkIdSingleSideRecognizer: "createBlinkIdSingleSideRecognizer",
|
|
48
|
+
BlinkIdMultiSideRecognizer: "createBlinkIdMultiSideRecognizer",
|
|
49
|
+
};
|
|
50
|
+
export var ImageRecognitionType;
|
|
51
|
+
(function (ImageRecognitionType) {
|
|
52
|
+
ImageRecognitionType["SingleSide"] = "SingleSide";
|
|
53
|
+
ImageRecognitionType["MultiSide"] = "MultiSide";
|
|
54
|
+
})(ImageRecognitionType || (ImageRecognitionType = {}));
|
|
55
|
+
export var MultiSideImageType;
|
|
56
|
+
(function (MultiSideImageType) {
|
|
57
|
+
MultiSideImageType["First"] = "First";
|
|
58
|
+
MultiSideImageType["Second"] = "Second";
|
|
59
|
+
})(MultiSideImageType || (MultiSideImageType = {}));
|
|
60
|
+
export var RecognitionStatus;
|
|
61
|
+
(function (RecognitionStatus) {
|
|
62
|
+
RecognitionStatus["NoImageFileFound"] = "NoImageFileFound";
|
|
63
|
+
RecognitionStatus["NoFirstImageFileFound"] = "NoFirstImageFileFound";
|
|
64
|
+
RecognitionStatus["NoSecondImageFileFound"] = "NoSecondImageFileFound";
|
|
65
|
+
RecognitionStatus["Preparing"] = "Preparing";
|
|
66
|
+
RecognitionStatus["Ready"] = "Ready";
|
|
67
|
+
RecognitionStatus["Processing"] = "Processing";
|
|
68
|
+
RecognitionStatus["DetectionFailed"] = "DetectionFailed";
|
|
69
|
+
RecognitionStatus["WrongSide"] = "WrongSide";
|
|
70
|
+
RecognitionStatus["FacePhotoCovered"] = "FacePhotoCovered";
|
|
71
|
+
RecognitionStatus["EmptyResultState"] = "EmptyResultState";
|
|
72
|
+
RecognitionStatus["OnFirstSideResult"] = "OnFirstSideResult";
|
|
73
|
+
RecognitionStatus["ScanSuccessful"] = "ScanSuccessful";
|
|
74
|
+
RecognitionStatus["DocumentClassified"] = "DocumentClassified";
|
|
75
|
+
// Camera states
|
|
76
|
+
RecognitionStatus["DetectionStatusChange"] = "DetectionStatusChange";
|
|
77
|
+
RecognitionStatus["NoSupportForMediaDevices"] = "NoSupportForMediaDevices";
|
|
78
|
+
RecognitionStatus["CameraNotFound"] = "CameraNotFound";
|
|
79
|
+
RecognitionStatus["CameraNotAllowed"] = "CameraNotAllowed";
|
|
80
|
+
RecognitionStatus["UnableToAccessCamera"] = "UnableToAccessCamera";
|
|
81
|
+
RecognitionStatus["CameraInUse"] = "CameraInUse";
|
|
82
|
+
RecognitionStatus["CameraGenericError"] = "CameraGenericError";
|
|
83
|
+
// Blur and glare
|
|
84
|
+
RecognitionStatus["BlurDetected"] = "BlurDetected";
|
|
85
|
+
RecognitionStatus["GlareDetected"] = "GlareDetected";
|
|
86
|
+
// Passport states
|
|
87
|
+
RecognitionStatus["MovePassportLeft"] = "MovePassportLeft";
|
|
88
|
+
RecognitionStatus["MovePassportRight"] = "MovePassportRight";
|
|
89
|
+
RecognitionStatus["MovePassportUp"] = "MovePassportUp";
|
|
90
|
+
RecognitionStatus["MovePassportDown"] = "MovePassportDown";
|
|
91
|
+
RecognitionStatus["MovePassportDownError"] = "MovePassportDownError";
|
|
92
|
+
RecognitionStatus["MovePassportUpError"] = "MovePassportUpError";
|
|
93
|
+
RecognitionStatus["MovePassportRightError"] = "MovePassportRightError";
|
|
94
|
+
RecognitionStatus["MovePassportLeftError"] = "MovePassportLeftError";
|
|
95
|
+
RecognitionStatus["ScanPassportLeft"] = "ScanPassportLeft";
|
|
96
|
+
RecognitionStatus["ScanPassportRight"] = "ScanPassportRight";
|
|
97
|
+
RecognitionStatus["ScanPassportUp"] = "ScanPassportUp";
|
|
98
|
+
RecognitionStatus["ScanPassportDown"] = "ScanPassportDown";
|
|
99
|
+
// Errors
|
|
100
|
+
RecognitionStatus["UnknownError"] = "UnknownError";
|
|
101
|
+
RecognitionStatus["BarcodeScanningStarted"] = "BarcodeScanningStarted";
|
|
102
|
+
// BlinkIDSDK.DetectionStatus
|
|
103
|
+
RecognitionStatus["DetectionStatusFail"] = "Fail";
|
|
104
|
+
RecognitionStatus["DetectionStatusSuccess"] = "Success";
|
|
105
|
+
RecognitionStatus["DetectionStatusCameraTooHigh"] = "CameraTooHigh";
|
|
106
|
+
RecognitionStatus["DetectionStatusFallbackSuccess"] = "FallbackSuccess";
|
|
107
|
+
RecognitionStatus["DetectionStatusPartial"] = "Partial";
|
|
108
|
+
RecognitionStatus["DetectionStatusCameraAtAngle"] = "CameraAtAngle";
|
|
109
|
+
RecognitionStatus["DetectionStatusCameraTooNear"] = "CameraTooNear";
|
|
110
|
+
RecognitionStatus["DetectionStatusDocumentTooCloseToEdge"] = "DocumentTooCloseToEdge";
|
|
111
|
+
})(RecognitionStatus || (RecognitionStatus = {}));
|
|
112
|
+
export var CameraExperience;
|
|
113
|
+
(function (CameraExperience) {
|
|
114
|
+
CameraExperience["Barcode"] = "BARCODE";
|
|
115
|
+
CameraExperience["CardMultiSide"] = "CARD_MULTI_SIDE";
|
|
116
|
+
CameraExperience["CardSingleSide"] = "CARD_SINGLE_SIDE";
|
|
117
|
+
CameraExperience["PaymentCard"] = "PAYMENT_CARD";
|
|
118
|
+
CameraExperience["Passport"] = "PASSPORT";
|
|
119
|
+
})(CameraExperience || (CameraExperience = {}));
|
|
120
|
+
export var CameraExperienceState;
|
|
121
|
+
(function (CameraExperienceState) {
|
|
122
|
+
CameraExperienceState["BarcodeScanning"] = "BarcodeScanning";
|
|
123
|
+
CameraExperienceState["AdjustAngle"] = "AdjustAngle";
|
|
124
|
+
CameraExperienceState["Classification"] = "Classification";
|
|
125
|
+
CameraExperienceState["Default"] = "Default";
|
|
126
|
+
CameraExperienceState["Detection"] = "Detection";
|
|
127
|
+
CameraExperienceState["Done"] = "Done";
|
|
128
|
+
CameraExperienceState["DoneAll"] = "DoneAll";
|
|
129
|
+
CameraExperienceState["Flip"] = "Flip";
|
|
130
|
+
CameraExperienceState["WrongSide"] = "WrongSide";
|
|
131
|
+
CameraExperienceState["MoveCloser"] = "MoveCloser";
|
|
132
|
+
CameraExperienceState["MoveFarther"] = "MoveFarther";
|
|
133
|
+
CameraExperienceState["BlurDetected"] = "BlurDetected";
|
|
134
|
+
CameraExperienceState["GlareDetected"] = "GlareDetected";
|
|
135
|
+
CameraExperienceState["FacePhotoCovered"] = "FacePhotoCovered";
|
|
136
|
+
// passport states
|
|
137
|
+
CameraExperienceState["MovePassportLeft"] = "MovePassportLeft";
|
|
138
|
+
CameraExperienceState["MovePassportRight"] = "MovePassportRight";
|
|
139
|
+
CameraExperienceState["MovePassportUp"] = "MovePassportUp";
|
|
140
|
+
CameraExperienceState["MovePassportDown"] = "MovePassportDown";
|
|
141
|
+
CameraExperienceState["ScanPassportLeft"] = "ScanPassportLeft";
|
|
142
|
+
CameraExperienceState["ScanPassportRight"] = "ScanPassportRight";
|
|
143
|
+
CameraExperienceState["ScanPassportUp"] = "ScanPassportUp";
|
|
144
|
+
CameraExperienceState["ScanPassportDown"] = "ScanPassportDown";
|
|
145
|
+
CameraExperienceState["MovePassportDownError"] = "MovePassportDownError";
|
|
146
|
+
CameraExperienceState["MovePassportUpError"] = "MovePassportUpError";
|
|
147
|
+
CameraExperienceState["MovePassportRightError"] = "MovePassportRightError";
|
|
148
|
+
CameraExperienceState["MovePassportLeftError"] = "MovePassportLeftError";
|
|
149
|
+
})(CameraExperienceState || (CameraExperienceState = {}));
|
|
150
|
+
export const CameraExperienceStateDuration = new Map([
|
|
151
|
+
[CameraExperienceState.BarcodeScanning, 3500],
|
|
152
|
+
[CameraExperienceState.AdjustAngle, 2500],
|
|
153
|
+
[CameraExperienceState.Default, 500],
|
|
154
|
+
[CameraExperienceState.Done, 1000],
|
|
155
|
+
[CameraExperienceState.DoneAll, 400],
|
|
156
|
+
[CameraExperienceState.Flip, 3500],
|
|
157
|
+
[CameraExperienceState.WrongSide, 1500],
|
|
158
|
+
[CameraExperienceState.MoveCloser, 2500],
|
|
159
|
+
[CameraExperienceState.MoveFarther, 2500],
|
|
160
|
+
[CameraExperienceState.BlurDetected, 2500],
|
|
161
|
+
[CameraExperienceState.GlareDetected, 2500],
|
|
162
|
+
[CameraExperienceState.FacePhotoCovered, 2500],
|
|
163
|
+
[CameraExperienceState.MovePassportLeft, 2500],
|
|
164
|
+
[CameraExperienceState.MovePassportRight, 2500],
|
|
165
|
+
[CameraExperienceState.MovePassportUp, 2500],
|
|
166
|
+
[CameraExperienceState.MovePassportDown, 2500],
|
|
167
|
+
[CameraExperienceState.ScanPassportLeft, 1500],
|
|
168
|
+
[CameraExperienceState.ScanPassportRight, 1500],
|
|
169
|
+
[CameraExperienceState.ScanPassportUp, 1500],
|
|
170
|
+
[CameraExperienceState.ScanPassportDown, 1500],
|
|
171
|
+
[CameraExperienceState.MovePassportDownError, 2500],
|
|
172
|
+
[CameraExperienceState.MovePassportUpError, 2500],
|
|
173
|
+
[CameraExperienceState.MovePassportRightError, 2500],
|
|
174
|
+
[CameraExperienceState.MovePassportLeftError, 2500],
|
|
175
|
+
]);
|
|
176
|
+
/**
|
|
177
|
+
* User feedback structures
|
|
178
|
+
*/
|
|
179
|
+
export var FeedbackCode;
|
|
180
|
+
(function (FeedbackCode) {
|
|
181
|
+
FeedbackCode["CameraDisabled"] = "CAMERA_DISABLED";
|
|
182
|
+
FeedbackCode["CameraGenericError"] = "CAMERA_GENERIC_ERROR";
|
|
183
|
+
FeedbackCode["CameraInUse"] = "CAMERA_IN_USE";
|
|
184
|
+
FeedbackCode["CameraNotAllowed"] = "CAMERA_NOT_ALLOWED";
|
|
185
|
+
FeedbackCode["GenericScanError"] = "GENERIC_SCAN_ERROR";
|
|
186
|
+
FeedbackCode["ScanStarted"] = "SCAN_STARTED";
|
|
187
|
+
FeedbackCode["ScanUnsuccessful"] = "SCAN_UNSUCCESSFUL";
|
|
188
|
+
FeedbackCode["ScanSuccessful"] = "SCAN_SUCCESSFUL";
|
|
189
|
+
})(FeedbackCode || (FeedbackCode = {}));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as BlinkIDSDK from "@microblink/blinkid-in-browser-sdk";
|
|
2
|
+
export function hasVideoDevices() {
|
|
3
|
+
return new Promise((resolve) => {
|
|
4
|
+
if (!window.navigator ||
|
|
5
|
+
!window.navigator.mediaDevices ||
|
|
6
|
+
typeof window.navigator.mediaDevices.enumerateDevices !== "function") {
|
|
7
|
+
resolve(false);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
window.navigator.mediaDevices.enumerateDevices().then((devices) => {
|
|
11
|
+
devices = devices || [];
|
|
12
|
+
for (const device of devices) {
|
|
13
|
+
if (device && device.kind === "videoinput") {
|
|
14
|
+
resolve(true);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
resolve(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function isWasmSupported() {
|
|
23
|
+
return new Promise((resolve) => {
|
|
24
|
+
const wasmSupport = BlinkIDSDK.isBrowserSupported();
|
|
25
|
+
resolve(wasmSupport);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export async function checkMandatoryCapabilites() {
|
|
29
|
+
const wasmSupport = await isWasmSupported();
|
|
30
|
+
return wasmSupport;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Determine whether this is a desktop device based on the screen resolution.
|
|
34
|
+
*/
|
|
35
|
+
export function isDesktop() {
|
|
36
|
+
return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
37
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
/**
|
|
3
|
+
* Structures of Error Codes, Error Messages, and CustomError compatible objects for the Error Generator utility.
|
|
4
|
+
* Error Code convention: SECTION_OBJECT_(ACTION)_PROBLEM
|
|
5
|
+
*/
|
|
6
|
+
export var ErrorCodes;
|
|
7
|
+
(function (ErrorCodes) {
|
|
8
|
+
ErrorCodes["BrowserNotSupported"] = "BROWSER_NOT_SUPPORTED";
|
|
9
|
+
ErrorCodes["LicenseError"] = "LICENSE_ERROR";
|
|
10
|
+
ErrorCodes["SdkLoadFailed"] = "SDK_LOAD_FAILED";
|
|
11
|
+
ErrorCodes["InternetNotAvailable"] = "INTERNET_NOT_AVAILABLE";
|
|
12
|
+
ErrorCodes["InvalidRecognizers"] = "INVALID_RECOGNIZERS";
|
|
13
|
+
ErrorCodes["InvalidPingProxyUrl"] = "INVALID_PING_PROXY_URL";
|
|
14
|
+
ErrorCodes["PingProxyPermissionNotGranted"] = "PING_PROXY_PERMISSION_NOT_GRANTED";
|
|
15
|
+
})(ErrorCodes || (ErrorCodes = {}));
|
|
16
|
+
export var ErrorMessages;
|
|
17
|
+
(function (ErrorMessages) {
|
|
18
|
+
ErrorMessages["BrowserNotSupported"] = "Browser is not supported!";
|
|
19
|
+
ErrorMessages["LicenseError"] = "Something is wrong with the license.";
|
|
20
|
+
ErrorMessages["SdkLoadFailed"] = "Failed to load SDK!";
|
|
21
|
+
ErrorMessages["InvalidPingProxyUrl"] = "Provided ping proxy URL is not a valid secure URL in format 'https://{host}:{port?}'.";
|
|
22
|
+
ErrorMessages["PingProxyPermissionNotGranted"] = "Allow ping proxy permission not found in license.";
|
|
23
|
+
})(ErrorMessages || (ErrorMessages = {}));
|
|
24
|
+
export const componentErrors = {
|
|
25
|
+
browserNotSupported: {
|
|
26
|
+
code: ErrorCodes.BrowserNotSupported,
|
|
27
|
+
message: ErrorMessages.BrowserNotSupported,
|
|
28
|
+
},
|
|
29
|
+
licenseError: {
|
|
30
|
+
code: ErrorCodes.LicenseError,
|
|
31
|
+
message: ErrorMessages.LicenseError,
|
|
32
|
+
},
|
|
33
|
+
sdkLoadFailed: {
|
|
34
|
+
code: ErrorCodes.SdkLoadFailed,
|
|
35
|
+
message: ErrorMessages.SdkLoadFailed,
|
|
36
|
+
},
|
|
37
|
+
pingProxyErrors: {
|
|
38
|
+
invalidProxyUrl: {
|
|
39
|
+
message: ErrorMessages.InvalidPingProxyUrl,
|
|
40
|
+
code: ErrorCodes.InvalidPingProxyUrl,
|
|
41
|
+
},
|
|
42
|
+
permissionNotGranted: {
|
|
43
|
+
message: ErrorMessages.PingProxyPermissionNotGranted,
|
|
44
|
+
code: ErrorCodes.PingProxyPermissionNotGranted,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export function stringToArray(inputString) {
|
|
2
|
+
if (!inputString || !inputString.length) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
return inputString.split(",").map((el) => el.trim());
|
|
6
|
+
}
|
|
7
|
+
export function stringToObject(inputString) {
|
|
8
|
+
if (!inputString || !inputString.length) {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
return JSON.parse(inputString);
|
|
12
|
+
}
|
|
13
|
+
export function hasSupportedImageFiles(files) {
|
|
14
|
+
const imageRegex = RegExp(/^image\//);
|
|
15
|
+
for (let i = 0; i < files.length; ++i) {
|
|
16
|
+
if (imageRegex.exec(files[i].type)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
export function extractFilenameFromPath(path) {
|
|
23
|
+
return path.split("\\").pop();
|
|
24
|
+
}
|
|
25
|
+
export function getImageFile(fileList) {
|
|
26
|
+
if (fileList === null) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
let image = null;
|
|
30
|
+
const imageRegex = RegExp(/^image\//);
|
|
31
|
+
for (let i = 0; i < fileList.length; ++i) {
|
|
32
|
+
if (imageRegex.exec(fileList[i].type)) {
|
|
33
|
+
image = fileList[i];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return image;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Inspired by https://github.com/JedWatson/classnames.
|
|
40
|
+
* @param classes Class names and their conditions.
|
|
41
|
+
* @returns Joined string of class names.
|
|
42
|
+
*/
|
|
43
|
+
export function classNames(classes) {
|
|
44
|
+
const result = [];
|
|
45
|
+
const keys = Object.keys(classes);
|
|
46
|
+
keys.forEach((key) => {
|
|
47
|
+
if (classes[key]) {
|
|
48
|
+
result.push(key);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return result.join(" ");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @param root shadowroot to apply the query from
|
|
55
|
+
* @returns array of part selectors
|
|
56
|
+
*/
|
|
57
|
+
export function getWebComponentParts(root) {
|
|
58
|
+
const nodesWithPart = root.querySelectorAll("[part]");
|
|
59
|
+
const parts = new Set();
|
|
60
|
+
nodesWithPart.forEach((el) => {
|
|
61
|
+
const partsArray = el.getAttribute("part").split(" ");
|
|
62
|
+
partsArray.forEach((partName) => parts.add(partName));
|
|
63
|
+
});
|
|
64
|
+
return [...parts];
|
|
65
|
+
}
|
|
66
|
+
export function getWebComponentExportedParts(root) {
|
|
67
|
+
const nodesWithPart = root.querySelectorAll("[exportparts]");
|
|
68
|
+
const exportedParts = new Set();
|
|
69
|
+
nodesWithPart.forEach((el) => {
|
|
70
|
+
const exportedPartsArray = el.getAttribute("exportparts").split(" ");
|
|
71
|
+
exportedPartsArray.forEach((partName) => exportedParts.add(partName));
|
|
72
|
+
});
|
|
73
|
+
return [...exportedParts];
|
|
74
|
+
}
|
|
75
|
+
export function setWebComponentParts(hostEl) {
|
|
76
|
+
const partParts = [hostEl.tagName.toLowerCase(), hostEl.getAttribute("id")];
|
|
77
|
+
hostEl.setAttribute("part", partParts.join(" ").trim());
|
|
78
|
+
}
|
|
79
|
+
export function uuidv4() {
|
|
80
|
+
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => (c ^
|
|
81
|
+
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
|
|
82
|
+
}
|