UNPKG

300 kBSource Map (JSON)View Raw
1{"version":3,"file":"blinkid-sdk.js","sources":["../node_modules/tslib/tslib.es6.js","../src/MicroblinkSDK/worker/Messages.ts","../src/MicroblinkSDK/WasmType.ts","../src/defaultWasmModule.ts","../src/MicroblinkSDK/worker/WorkerSDKBackend.ts","../src/MicroblinkSDK/SDKError.ts","../src/MicroblinkSDK/ErrorTypes.ts","../src/MicroblinkSDK/CameraUtils.ts","../src/MicroblinkSDK/DataStructures.ts","../src/MicroblinkSDK/DeviceUtils.ts","../src/MicroblinkSDK/FrameCapture.ts","../src/MicroblinkSDK/License.ts","../src/MicroblinkSDK/MetadataCallbacks.ts","../src/MicroblinkSDK/VideoRecognizer.ts","../src/MicroblinkSDK/WasmLoadSettings.ts","../node_modules/wasm-feature-detect/dist/esm/index.js","../src/MicroblinkSDK/WasmLoadUtils.ts","../src/MicroblinkSDK/MicroblinkSDK.ts","../src/Recognizers/SuccessFrameGrabberRecognizer.ts","../src/Recognizers/BlinkBarcode/BarcodeData.ts","../src/Recognizers/BlinkID/Generic/AnonymizationMode.ts","../src/Recognizers/BlinkID/Generic/RecognitionModeFilter.ts","../src/Recognizers/BlinkID/ImageOptions.ts","../src/Recognizers/BlinkID/Generic/BarcodeResult.ts","../src/Recognizers/BlinkID/Generic/ClassInfo.ts","../src/Recognizers/BlinkID/Generic/ImageAnalysisResult.ts","../src/Recognizers/BlinkID/Generic/ProcessingStatus.ts","../src/Recognizers/BlinkID/Generic/RecognitionMode.ts","../src/Recognizers/BlinkID/Generic/BlinkIdRecognizer.ts","../src/Recognizers/BlinkID/Generic/BlinkIdCombinedRecognizer.ts","../src/Recognizers/BlinkID/IDBarcode/IdBarcodeRecognizer.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { CapturedFrame } from \"../FrameCapture\";\nimport { WasmSDKLoadSettings } from \"../WasmLoadSettings\";\nimport { WasmType } from \"../WasmType\";\nimport { SDKError } from \"../SDKError\";\nimport { ProductIntegrationInfo } from \"../DataStructures\";\n\nlet nextMessageID = 0;\n\nfunction getNextMessageID()\n{\n const msgId = nextMessageID;\n nextMessageID = nextMessageID + 1;\n return msgId;\n}\n\n// ===================================== /\n// Request messages\n// ===================================== /\n\nexport interface RequestMessage\n{\n readonly action: string;\n readonly messageID: number;\n}\n\nexport interface TransferrableMessage\n{\n getTransferrables(): Array< Transferable >;\n}\n\nabstract class BaseRequestMessage implements RequestMessage\n{\n readonly action: string;\n\n readonly messageID: number;\n\n protected constructor( action: string )\n {\n this.action = action;\n this.messageID = getNextMessageID();\n }\n}\n\nexport class InitMessage extends BaseRequestMessage\n{\n static readonly action: string = \"init\";\n\n readonly wasmModuleName: string;\n\n readonly licenseKey: string;\n\n readonly userId: string;\n\n readonly registerLoadCallback: boolean;\n\n readonly allowHelloMessage: boolean;\n\n readonly engineLocation: string;\n\n readonly wasmType: WasmType | null;\n\n readonly numberOfWorkers: number | null;\n\n constructor( wasmLoadSettings: WasmSDKLoadSettings, userId: string )\n {\n super( InitMessage.action );\n this.wasmModuleName = wasmLoadSettings.wasmModuleName;\n this.licenseKey = wasmLoadSettings.licenseKey;\n this.userId = userId;\n this.registerLoadCallback = wasmLoadSettings.loadProgressCallback !== null;\n this.allowHelloMessage = wasmLoadSettings.allowHelloMessage;\n this.engineLocation = wasmLoadSettings.engineLocation;\n this.wasmType = wasmLoadSettings.wasmType;\n this.numberOfWorkers = wasmLoadSettings.numberOfWorkers;\n }\n}\n\nexport enum ParameterType\n{\n Any,\n Recognizer,\n RecognizerSettings,\n Callback\n}\n\nexport interface CallbackAddress\n{\n readonly recognizerHandle: number;\n readonly callbackName: string;\n}\n\nexport interface WrappedParameter\n{\n parameter: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n type: ParameterType;\n}\n\nexport class InvokeFunction extends BaseRequestMessage\n{\n static readonly action: string = \"invokeFunction\";\n\n readonly funcName: string;\n\n readonly params: Array< WrappedParameter >;\n\n constructor( funcName: string, params: Array< WrappedParameter > )\n {\n super( InvokeFunction.action );\n this.funcName = funcName;\n this.params = params;\n }\n}\n\nexport class CreateNewRecognizer extends BaseRequestMessage\n{\n static readonly action: string = \"createNewNativeObject\";\n\n readonly className: string;\n\n readonly params: Array< WrappedParameter >;\n\n constructor( className: string, params: Array< WrappedParameter > )\n {\n super( CreateNewRecognizer.action );\n this.className = className;\n this.params = params;\n }\n}\n\nexport class CreateRecognizerRunner extends BaseRequestMessage\n{\n static readonly action: string = \"createRecognizerRunner\";\n\n readonly recognizerHandles: Array< number >;\n\n readonly allowMultipleResults: boolean;\n\n readonly registeredMetadataCallbacks: RegisteredMetadataCallbacks;\n\n constructor\n (\n recognizerHandles : Array< number >,\n allowMultipleResults : boolean,\n registeredMetadataCallbacks : RegisteredMetadataCallbacks\n )\n {\n super( CreateRecognizerRunner.action );\n this.recognizerHandles = recognizerHandles;\n this.allowMultipleResults = allowMultipleResults;\n this.registeredMetadataCallbacks = registeredMetadataCallbacks;\n }\n}\n\nexport class ReconfigureRecognizerRunner extends BaseRequestMessage\n{\n static readonly action: string = \"reconfigureRecognizerRunner\";\n\n readonly recognizerHandles: Array< number >;\n\n readonly allowMultipleResults: boolean;\n\n constructor( recognizerHandles: Array< number >, allowMultipleResults: boolean )\n {\n super( ReconfigureRecognizerRunner.action );\n this.recognizerHandles = recognizerHandles;\n this.allowMultipleResults = allowMultipleResults;\n }\n}\n\nexport class DeleteRecognizerRunner extends BaseRequestMessage\n{\n static readonly action: string = \"deleteRecognizerRunner\";\n\n constructor()\n {\n super( DeleteRecognizerRunner.action );\n }\n}\n\nexport class InvokeObjectMethod extends BaseRequestMessage\n{\n static readonly action: string = \"invokeObject\";\n\n readonly objectHandle: number;\n\n readonly methodName: string;\n\n readonly params: Array< WrappedParameter >;\n\n constructor( objectHandle: number, methodName: string, params: Array< WrappedParameter > )\n {\n super( InvokeObjectMethod.action );\n this.objectHandle = objectHandle;\n this.methodName = methodName;\n this.params = params;\n }\n}\n\nexport class ProcessImage extends BaseRequestMessage implements TransferrableMessage\n{\n static readonly action: string = \"processImage\";\n\n readonly frame: CapturedFrame;\n\n constructor( image: CapturedFrame )\n {\n super( ProcessImage.action );\n this.frame = image;\n }\n\n getTransferrables(): Array< Transferable >\n {\n return [ this.frame.imageData.data.buffer ];\n }\n}\n\nexport class ResetRecognizers extends BaseRequestMessage\n{\n static readonly action: string = \"resetRecognizers\";\n\n readonly hardReset: boolean\n\n constructor( hardReset: boolean )\n {\n super( ResetRecognizers.action );\n this.hardReset = hardReset;\n }\n}\n\nexport class RegisteredMetadataCallbacks\n{\n onDebugText = false;\n\n onDetectionFailed = false;\n\n onQuadDetection = false;\n\n onPointsDetection = false;\n\n onFirstSideResult = false;\n\n onGlare = false;\n}\n\nexport class RegisterMetadataCallbacks extends BaseRequestMessage\n{\n static readonly action: string = \"registerMetadataCallbacks\";\n\n readonly registeredMetadataCallbacks: RegisteredMetadataCallbacks;\n\n constructor( registeredMetadataCallbacks: RegisteredMetadataCallbacks )\n {\n super( RegisterMetadataCallbacks.action );\n this.registeredMetadataCallbacks = registeredMetadataCallbacks;\n }\n}\n\nexport class SetDetectionOnly extends BaseRequestMessage\n{\n static readonly action: string = \"setDetectionOnly\";\n\n readonly detectionOnlyMode: boolean;\n\n constructor( detectionOnlyMode: boolean )\n {\n super( SetDetectionOnly.action );\n this.detectionOnlyMode = detectionOnlyMode;\n }\n}\n\nexport class SetClearTimeoutCallback extends BaseRequestMessage\n{\n static readonly action: string = \"setClearTimeoutCallback\";\n\n readonly callbackNonEmpty: boolean;\n\n constructor( callbackNonEmpty: boolean )\n {\n super( SetClearTimeoutCallback.action );\n this.callbackNonEmpty = callbackNonEmpty;\n }\n}\n\nexport class SetCameraPreviewMirrored extends BaseRequestMessage\n{\n static readonly action: string = \"setCameraPreviewMirrored\";\n\n readonly cameraPreviewMirrored: boolean\n\n constructor( cameraPreviewMirrored: boolean )\n {\n super( SetCameraPreviewMirrored.action );\n this.cameraPreviewMirrored = cameraPreviewMirrored;\n }\n}\n\nexport class GetProductIntegrationInfo extends BaseRequestMessage\n{\n static readonly action: string = \"getProductIntegrationInfo\";\n\n readonly userId: string;\n\n constructor( userId: string )\n {\n super( GetProductIntegrationInfo.action );\n this.userId = userId;\n }\n}\n\n// ===================================== /\n// Response messages\n// ===================================== /\n\nexport interface ResponseMessage\n{\n readonly messageID: number;\n}\n\nexport class StatusMessage implements ResponseMessage\n{\n readonly messageID: number;\n\n readonly success: boolean = true;\n\n readonly error: SDKError | string | null = null;\n\n constructor( msgID: number, success: boolean, error: SDKError | string | null )\n {\n this.messageID = msgID;\n this.success = success;\n this.error = error;\n }\n}\n\nexport class InitSuccessMessage implements ResponseMessage\n{\n readonly messageID: number;\n\n readonly success: boolean = true;\n\n readonly showOverlay: boolean = true;\n\n readonly wasmType: WasmType;\n\n constructor( msgID: number, success: boolean, showOverlay: boolean, wasmType: WasmType )\n {\n this.messageID = msgID;\n this.success = success;\n this.showOverlay = showOverlay;\n this.wasmType = wasmType;\n }\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any,\n @typescript-eslint/explicit-module-boundary-types,\n @typescript-eslint/no-unsafe-assignment */\nexport class InvokeResultMessage extends StatusMessage\n{\n readonly result: any;\n\n constructor( msgID: number, result: any )\n {\n super( msgID, true, null );\n this.result = result;\n }\n}\n/* eslint-enable @typescript-eslint/no-explicit-any,\n @typescript-eslint/explicit-module-boundary-types,\n @typescript-eslint/no-unsafe-assignment */\n\nexport class ObjectCreatedMessage extends StatusMessage\n{\n readonly objectHandle: number;\n\n constructor( msgID: number, handle: number )\n {\n super( msgID, true, null );\n this.objectHandle = handle;\n }\n}\n\nexport class ImageProcessResultMessage extends StatusMessage\n{\n readonly recognitionState: number;\n\n constructor( msgID: number, recognitionState: number )\n {\n super( msgID, true, null );\n this.recognitionState = recognitionState;\n }\n}\n\nexport class ProductIntegrationResultMessage extends StatusMessage\n{\n readonly result: ProductIntegrationInfo;\n\n constructor( msgID: number, result: ProductIntegrationInfo )\n {\n super( msgID, true, null );\n this.result = result;\n }\n}\n\n// ===================================== /\n// Load progress messages\n// ===================================== /\n\nexport class LoadProgressMessage\n{\n readonly isLoadProgressMessage = true;\n\n readonly progress: number;\n\n constructor( progress: number )\n {\n this.progress = progress;\n }\n}\n\n\n// ===================================== /\n// Metadata callback messages\n// ===================================== /\n\nexport enum MetadataCallback\n{\n onDebugText,\n onDetectionFailed,\n onQuadDetection,\n onPointsDetection,\n onFirstSideResult,\n clearTimeoutCallback,\n onGlare,\n recognizerCallback\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport class InvokeCallbackMessage\n{\n readonly isCallbackMessage: boolean = true;\n\n readonly callbackType: MetadataCallback;\n\n readonly callbackParameters: any[];\n\n constructor( callbackType: MetadataCallback, callbackParams: any[] )\n {\n this.callbackType = callbackType;\n this.callbackParameters = callbackParams;\n }\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/**\n * Defines the type of the WASM that will be loaded.\n */\nexport enum WasmType\n{\n /**\n * The WASM that will be loaded will be most compatible with all browsers that\n * support the WASM, but will lack features that could be used to improve performance.\n */\n Basic = \"BASIC\",\n\n /**\n * The WASM that will be loaded will be built with advanced WASM features, such as\n * bulk memory, SIMD, non-trapping floating point and sign extension. Such WASM can only\n * be executed in browsers that support those features. Attempting to run this\n * WASM in a non-compatible browser will crash your app.\n */\n Advanced = \"ADVANCED\",\n\n /**\n * The WASM that will be loaded will be build with advanced WASM features, just\n * like above. Additionally, it will be also built with support for multi-threaded\n * processing. This feature requires a browser with support for both advanced WASM\n * features and `SharedArrayBuffer`\n */\n AdvancedWithThreads = \"ADVANCED_WITH_THREADS\"\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nexport const defaultWasmModuleName = \"BlinkIDWasmSDK\";\nexport const nativeJsonizationEnabled = true;\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport * as Messages from \"./Messages\";\nimport { CapturedFrame } from \"../FrameCapture\";\n\nimport\n{\n RecognizerResultState,\n RecognizerRunner,\n WasmModuleProxy,\n WasmSDK,\n Recognizer,\n RecognizerSettings,\n RecognizerResult,\n SignedPayload,\n ProductIntegrationInfo\n} from \"../DataStructures.js\";\n\nimport { ClearTimeoutCallback } from \"../ClearTimeoutCallback\";\nimport { MetadataCallbacks, DisplayablePoints, DisplayableQuad } from \"../MetadataCallbacks\";\nimport { WasmSDKLoadSettings, OptionalLoadProgressCallback } from \"../WasmLoadSettings\";\nimport { WasmType } from \"../WasmType\";\nimport { nativeJsonizationEnabled } from \"../../defaultWasmModule\";\nimport { SDKError } from \"../SDKError\";\n\n\n// ============================================ /\n// Web Worker Proxy Implementation /\n// ============================================ /\n\ninterface EventHandler\n{\n ( msg: Messages.ResponseMessage ): void;\n}\n\nfunction defaultEventHandler(\n resolve: () => void,\n reject: ( reason: SDKError | string | null ) => void\n): EventHandler\n{\n return ( msg: Messages.ResponseMessage ) =>\n {\n const resultMsg = msg as Messages.StatusMessage;\n if ( resultMsg.success )\n {\n resolve();\n }\n else\n {\n reject( resultMsg.error );\n }\n };\n}\n\nfunction defaultResultEventHandler(\n successResolver: EventHandler,\n reject: ( reason: SDKError | string | null ) => void\n): EventHandler\n{\n return ( msg: Messages.ResponseMessage ) =>\n {\n const resultMsg = msg as Messages.StatusMessage;\n if ( resultMsg.success )\n {\n successResolver( msg );\n }\n else\n {\n reject( resultMsg.error );\n }\n };\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */\nfunction wrapParameters( params: Array< any > ): Array< Messages.WrappedParameter >\n{\n // convert params\n const wrappedPrameters = [];\n for ( let param of params )\n {\n let paramType = Messages.ParameterType.Any;\n if ( param instanceof RemoteRecognizer )\n {\n paramType = Messages.ParameterType.Recognizer;\n param = param.getRemoteObjectHandle();\n }\n wrappedPrameters.push\n (\n {\n parameter: param,\n type: paramType\n }\n );\n }\n return wrappedPrameters;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */\n\nexport class RemoteRecognizer implements Recognizer\n{\n /* eslint-disable lines-between-class-members, @typescript-eslint/ban-types */\n private readonly wasmSDKWorker : WasmSDKWorker;\n private objectHandle : number;\n readonly recognizerName: string;\n private callbacks : Map< string, Function >;\n /* eslint-enable lines-between-class-members */\n\n constructor( wasmWorker: WasmSDKWorker, recognizerName: string, remoteObjHandle: number )\n {\n this.wasmSDKWorker = wasmWorker;\n this.objectHandle = remoteObjHandle;\n this.recognizerName = recognizerName;\n this.callbacks = new Map< string, Function >();\n }\n /* eslint-enable @typescript-eslint/ban-types */\n\n getRemoteObjectHandle(): number\n {\n return this.objectHandle;\n }\n\n currentSettings(): Promise< RecognizerSettings >\n {\n return new Promise< RecognizerSettings >\n (\n ( resolve, reject ) =>\n {\n if ( this.objectHandle < 0 )\n {\n reject( \"Invalid object handle: \" + this.objectHandle.toString() );\n return;\n }\n\n const msg = new Messages.InvokeObjectMethod\n (\n this.objectHandle,\n \"currentSettings\",\n []\n );\n const handler = defaultResultEventHandler\n (\n ( msg: Messages.ResponseMessage ) =>\n {\n resolve( ( msg as Messages.InvokeResultMessage ).result );\n },\n reject\n );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n toSignedJSON(): Promise< SignedPayload | null >\n {\n if ( nativeJsonizationEnabled )\n {\n return new Promise< SignedPayload | null >\n (\n ( resolve, reject ) =>\n {\n if ( this.objectHandle < 0 )\n {\n reject( \"Invalid object handle: \" + this.objectHandle.toString() );\n return;\n }\n\n const msg = new Messages.InvokeObjectMethod\n (\n this.objectHandle,\n \"toSignedJSON\",\n []\n );\n const handler = defaultResultEventHandler\n (\n ( msg: Messages.ResponseMessage ) =>\n {\n resolve( ( msg as Messages.InvokeResultMessage ).result );\n },\n reject\n );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n else\n {\n // native module does not support toSignedJSON method\n return Promise.resolve( null );\n }\n }\n\n private clearAllCallbacks()\n {\n this.callbacks.clear();\n this.wasmSDKWorker.unregisterRecognizerCallbacks( this.objectHandle );\n }\n\n /* eslint-disable @typescript-eslint/no-explicit-any,\n @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-unsafe-member-access,\n @typescript-eslint/no-unsafe-return\n */\n // convert each function member into wrapped parameter, containing address where callback needs to be delivered\n private removeFunctions( settings: any ): any\n {\n // clear any existing callbacks\n this.clearAllCallbacks();\n\n const keys = Object.keys( settings );\n let needsRegistering = false;\n for ( const key of keys )\n {\n const data = settings[ key ];\n if ( typeof data === \"function\" )\n {\n this.callbacks.set( key, data );\n const wrappedFunction: Messages.WrappedParameter = {\n parameter: {\n recognizerHandle: this.objectHandle,\n callbackName: key\n } as Messages.CallbackAddress, // in order to know to which instance callback needs to be delivered\n type: Messages.ParameterType.Callback\n };\n settings[ key ] = wrappedFunction;\n needsRegistering = true;\n }\n }\n if ( needsRegistering )\n {\n this.wasmSDKWorker.registerRecognizerCallbacks( this.objectHandle, this );\n }\n return settings;\n }\n /* eslint-enable @typescript-eslint/no-explicit-any,\n @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-unsafe-member-access,\n @typescript-eslint/no-unsafe-return\n */\n\n updateSettings( newSettings: RecognizerSettings ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n if ( this.objectHandle < 0 )\n {\n reject( \"Invalid object handle: \" + this.objectHandle.toString() );\n return;\n }\n\n /* eslint-disable @typescript-eslint/no-unsafe-assignment */\n const msg = new Messages.InvokeObjectMethod\n (\n this.objectHandle,\n \"updateSettings\",\n [\n {\n parameter: this.removeFunctions( newSettings ),\n type: Messages.ParameterType.RecognizerSettings\n }\n ]\n );\n /* eslint-enable @typescript-eslint/no-unsafe-assignment */\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n invokeCallback( callbackName: string, args: any[] ): void\n {\n const callback = this.callbacks.get( callbackName );\n if ( callback !== undefined )\n {\n callback( ...args );\n }\n else\n {\n console.warn( \"Cannot find callback\", callbackName );\n }\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n\n getResult(): Promise< RecognizerResult >\n {\n return new Promise< RecognizerResult >\n (\n ( resolve, reject ) =>\n {\n if ( this.objectHandle < 0 )\n {\n reject( \"Invalid object handle: \" + this.objectHandle.toString() );\n return;\n }\n\n const msg = new Messages.InvokeObjectMethod( this.objectHandle, \"getResult\", [] );\n const handler = defaultResultEventHandler\n (\n ( msg: Messages.ResponseMessage ) =>\n {\n resolve( ( msg as Messages.InvokeResultMessage ).result );\n },\n reject\n );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n delete(): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n if ( this.objectHandle < 0 )\n {\n reject( \"Invalid object handle: \" + this.objectHandle.toString() );\n return;\n }\n\n this.clearAllCallbacks();\n\n const msg = new Messages.InvokeObjectMethod( this.objectHandle, \"delete\", [] );\n const handler = defaultEventHandler\n (\n () =>\n {\n this.objectHandle = -1;\n resolve();\n },\n reject\n );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n}\n\nfunction createRegisteredCallbacks\n(\n metadataCallbacks: MetadataCallbacks\n): Messages.RegisteredMetadataCallbacks\n{\n const msg = new Messages.RegisteredMetadataCallbacks();\n\n // https://stackoverflow.com/a/20093686/213057\n msg.onDebugText = !!metadataCallbacks.onDebugText;\n msg.onDetectionFailed = !!metadataCallbacks.onDetectionFailed;\n msg.onPointsDetection = !!metadataCallbacks.onPointsDetection;\n msg.onQuadDetection = !!metadataCallbacks.onQuadDetection;\n msg.onFirstSideResult = !!metadataCallbacks.onFirstSideResult;\n msg.onGlare = !!metadataCallbacks.onGlare;\n\n return msg;\n}\n\nclass RemoteRecognizerRunner implements RecognizerRunner\n{\n private readonly wasmSDKWorker: WasmSDKWorker;\n\n private deleted = false;\n\n constructor( wasmWorker: WasmSDKWorker )\n {\n this.wasmSDKWorker = wasmWorker;\n }\n\n processImage( image: CapturedFrame ): Promise< RecognizerResultState >\n {\n return new Promise< RecognizerResultState >\n (\n ( resolve, reject ) =>\n {\n if ( this.deleted )\n {\n reject( \"Recognizer runner is deleted. It cannot be used anymore!\" );\n return;\n }\n\n const msg = new Messages.ProcessImage( image );\n const handler = defaultResultEventHandler\n (\n ( response: Messages.ResponseMessage ) =>\n {\n const state: RecognizerResultState = (\n response as Messages.ImageProcessResultMessage\n ).recognitionState;\n resolve( state );\n },\n reject\n );\n this.wasmSDKWorker.postTransferrableMessage( msg, handler );\n }\n );\n }\n\n reconfigureRecognizers\n (\n recognizers: Array< Recognizer >,\n allowMultipleResults: boolean\n ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n if ( this.deleted )\n {\n reject( \"Recognizer runner is deleted. It cannot be used anymore!\" );\n return;\n }\n\n const recognizerHandles = getRecognizerHandles( recognizers as Array< RemoteRecognizer > );\n const msg = new Messages.ReconfigureRecognizerRunner( recognizerHandles, allowMultipleResults );\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n setMetadataCallbacks( metadataCallbacks: MetadataCallbacks ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.RegisterMetadataCallbacks( createRegisteredCallbacks( metadataCallbacks ) );\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.postMessageAndRegisterCallbacks( msg, metadataCallbacks, handler );\n }\n );\n }\n\n resetRecognizers( hardReset: boolean ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.ResetRecognizers( hardReset );\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n setDetectionOnlyMode( detectionOnly: boolean ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.SetDetectionOnly( detectionOnly );\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n setClearTimeoutCallback( clearTimeoutCallback: ClearTimeoutCallback | null ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.SetClearTimeoutCallback( clearTimeoutCallback !== null );\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.registerClearTimeoutCallback( clearTimeoutCallback );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n setCameraPreviewMirrored( mirrored: boolean ): Promise< void >\n {\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.SetCameraPreviewMirrored( mirrored );\n const handler = defaultEventHandler( resolve, reject );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n\n delete(): Promise< void >\n {\n if ( this.deleted )\n {\n return Promise.reject( \"Recognizer runner is already deleted.\" );\n }\n return new Promise< void >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.DeleteRecognizerRunner();\n const handler = defaultEventHandler\n (\n () =>\n {\n this.deleted = true;\n resolve();\n },\n reject\n );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n}\n\nfunction getRecognizerHandles( remoteRecognizers: Array< RemoteRecognizer > )\n{\n const recognizerHandles: Array< number > = [];\n for ( const remoteRecognizer of remoteRecognizers )\n {\n recognizerHandles.push( remoteRecognizer.getRemoteObjectHandle() );\n }\n return recognizerHandles;\n}\n\nclass WasmModuleWorkerProxy implements WasmModuleProxy\n{\n private readonly wasmSDKWorker: WasmSDKWorker;\n\n constructor( wasmSDKWorker: WasmSDKWorker )\n {\n this.wasmSDKWorker = wasmSDKWorker;\n }\n\n createRecognizerRunner\n (\n recognizers : Array< Recognizer >,\n allowMultipleResults = false,\n metadataCallbacks : MetadataCallbacks = {}\n ): Promise< RecognizerRunner >\n {\n return new Promise< RecognizerRunner >\n (\n ( resolve, reject ) =>\n {\n const recognizerHandles = getRecognizerHandles( recognizers as Array< RemoteRecognizer > );\n const msg = new Messages.CreateRecognizerRunner\n (\n recognizerHandles,\n allowMultipleResults,\n createRegisteredCallbacks( metadataCallbacks )\n );\n const handler = defaultEventHandler\n (\n () =>\n {\n resolve( new RemoteRecognizerRunner( this.wasmSDKWorker ) );\n },\n reject\n );\n this.wasmSDKWorker.postMessageAndRegisterCallbacks( msg, metadataCallbacks, handler );\n }\n );\n }\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n newRecognizer( className: string, ...constructorArgs: any[] ): Promise< Recognizer >\n {\n return new Promise< Recognizer >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.CreateNewRecognizer( className, wrapParameters( constructorArgs ) );\n const handler = defaultResultEventHandler\n (\n ( msg: Messages.ResponseMessage ) =>\n {\n const remoteRecognizer = new RemoteRecognizer\n (\n this.wasmSDKWorker,\n className,\n ( msg as Messages.ObjectCreatedMessage ).objectHandle\n );\n resolve( remoteRecognizer );\n },\n reject\n );\n this.wasmSDKWorker.postMessage( msg, handler );\n }\n );\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n}\n\nexport class WasmSDKWorker implements WasmSDK\n{\n /* eslint-disable lines-between-class-members */\n readonly mbWasmModule : WasmModuleWorkerProxy;\n private readonly mbWasmWorker : Worker;\n private eventHandlers : { [ key: number ] : EventHandler } = {};\n private metadataCallbacks : MetadataCallbacks = {};\n private loadCallback : OptionalLoadProgressCallback;\n private clearTimeoutCallback : ClearTimeoutCallback | null = null;\n private recognizersWithCallbacks: Map< number, RemoteRecognizer >;\n private userId : string;\n public showOverlay : boolean;\n public loadedWasmType : WasmType = WasmType.Basic; // will be updated after WASM gets loaded\n /* eslint-enable lines-between-class-members */\n\n private constructor\n (\n worker: Worker,\n loadProgressCallback: OptionalLoadProgressCallback,\n userId: string,\n rejectHandler: ( message: string ) => void\n )\n {\n this.mbWasmWorker = worker;\n this.mbWasmWorker.onmessage = ( event: MessageEvent ) => { this.handleWorkerEvent( event ); };\n this.mbWasmWorker.onerror = () =>\n {\n rejectHandler( \"Problem during initialization of worker file!\" );\n return;\n };\n this.mbWasmModule = new WasmModuleWorkerProxy( this );\n this.loadCallback = loadProgressCallback;\n this.recognizersWithCallbacks = new Map< number, RemoteRecognizer >();\n this.userId = userId;\n this.showOverlay = false;\n }\n\n postMessage( message: Messages.RequestMessage, eventHandler: EventHandler ): void\n {\n this.eventHandlers[ message.messageID ] = eventHandler;\n this.mbWasmWorker.postMessage( message );\n }\n\n postTransferrableMessage\n (\n message : Messages.RequestMessage & Messages.TransferrableMessage,\n eventHandler : EventHandler\n ): void\n {\n this.eventHandlers[ message.messageID ] = eventHandler;\n this.mbWasmWorker.postMessage( message, message.getTransferrables() );\n }\n\n postMessageAndRegisterCallbacks\n (\n message : Messages.RequestMessage,\n metadataCallbacks : MetadataCallbacks,\n eventHandler : EventHandler\n ): void\n {\n this.eventHandlers[ message.messageID ] = eventHandler;\n this.metadataCallbacks = metadataCallbacks;\n this.mbWasmWorker.postMessage( message );\n }\n\n registerClearTimeoutCallback( callback: ClearTimeoutCallback | null ): void\n {\n this.clearTimeoutCallback = callback;\n }\n\n registerRecognizerCallbacks( remoteRecognizerHandle: number, recognizer: RemoteRecognizer ): void\n {\n this.recognizersWithCallbacks.set( remoteRecognizerHandle, recognizer );\n }\n\n unregisterRecognizerCallbacks( remoteRecognizerHandle: number ): void\n {\n this.recognizersWithCallbacks.delete( remoteRecognizerHandle );\n }\n\n /**\n * Clean up the active instance of the SDK.\n *\n * It's not possible to use the SDK after this method is called.\n */\n delete(): void\n {\n this.mbWasmWorker.terminate();\n }\n\n getProductIntegrationInfo(): Promise< ProductIntegrationInfo >\n {\n return new Promise< ProductIntegrationInfo >\n (\n ( resolve, reject ) =>\n {\n const msg = new Messages.GetProductIntegrationInfo( this.userId );\n const handler = defaultResultEventHandler\n (\n ( msg: Messages.ResponseMessage ) =>\n {\n resolve( ( msg as Messages.ProductIntegrationResultMessage ).result );\n },\n reject\n );\n this.postMessage( msg, handler );\n }\n );\n }\n\n private handleWorkerEvent( event: MessageEvent )\n {\n if ( \"isCallbackMessage\" in event.data )\n {\n const msg = event.data as Messages.InvokeCallbackMessage;\n switch ( msg.callbackType )\n {\n case Messages.MetadataCallback.onDebugText:\n if ( typeof this.metadataCallbacks.onDebugText === \"function\" )\n {\n this.metadataCallbacks.onDebugText( msg.callbackParameters[ 0 ] as string );\n }\n break;\n case Messages.MetadataCallback.onDetectionFailed:\n if ( typeof this.metadataCallbacks.onDetectionFailed === \"function\" )\n {\n this.metadataCallbacks.onDetectionFailed();\n }\n break;\n case Messages.MetadataCallback.onPointsDetection:\n if ( typeof this.metadataCallbacks.onPointsDetection === \"function\" )\n {\n this.metadataCallbacks.onPointsDetection( msg.callbackParameters[ 0 ] as DisplayablePoints );\n }\n break;\n case Messages.MetadataCallback.onQuadDetection:\n if ( typeof this.metadataCallbacks.onQuadDetection === \"function\" )\n {\n this.metadataCallbacks.onQuadDetection( msg.callbackParameters[ 0 ] as DisplayableQuad );\n }\n break;\n case Messages.MetadataCallback.onFirstSideResult:\n if ( typeof this.metadataCallbacks.onFirstSideResult === \"function\" )\n {\n this.metadataCallbacks.onFirstSideResult();\n }\n break;\n case Messages.MetadataCallback.clearTimeoutCallback:\n if ( this.clearTimeoutCallback && typeof this.clearTimeoutCallback.onClearTimeout === \"function\" )\n {\n this.clearTimeoutCallback.onClearTimeout();\n }\n break;\n case Messages.MetadataCallback.onGlare:\n if ( typeof this.metadataCallbacks.onGlare === \"function\" )\n {\n this.metadataCallbacks.onGlare( msg.callbackParameters[ 0 ] as boolean );\n }\n break;\n case Messages.MetadataCallback.recognizerCallback:\n {\n // first parameter is address, other parameters are callback parameters\n const address = msg.callbackParameters.shift() as Messages.CallbackAddress;\n const recognizer = this.recognizersWithCallbacks.get( address.recognizerHandle );\n if ( recognizer !== undefined )\n {\n recognizer.invokeCallback( address.callbackName, msg.callbackParameters );\n }\n else\n {\n console.warn\n (\n \"Cannot find recognizer to deliver callback message. Maybe it's destroyed?\",\n address\n );\n }\n break;\n }\n default:\n throw new Error( `Unknown callback type: ${ Messages.MetadataCallback[ msg.callbackType ] }` );\n }\n }\n else if ( \"isLoadProgressMessage\" in event.data )\n {\n const msg = event.data as Messages.LoadProgressMessage;\n\n if ( typeof this.loadCallback === \"function\" )\n {\n this.loadCallback( msg.progress );\n }\n }\n else\n {\n const msg = event.data as Messages.ResponseMessage;\n const eventHandler = this.eventHandlers[ msg.messageID ];\n delete this.eventHandlers[ msg.messageID ];\n eventHandler( msg );\n }\n }\n\n static async createWasmWorker\n (\n worker : Worker,\n wasmLoadSettings : WasmSDKLoadSettings,\n userId : string\n ): Promise< WasmSDKWorker >\n {\n return new Promise< WasmSDKWorker >\n (\n ( resolve, reject ) =>\n {\n const wasmWorker = new WasmSDKWorker\n (\n worker,\n wasmLoadSettings.loadProgressCallback,\n userId,\n reject\n );\n const initMessage = new Messages.InitMessage( wasmLoadSettings, userId );\n const initEventHandler = defaultResultEventHandler\n (\n ( msg: Messages.ResponseMessage ) =>\n {\n const successMsg = msg as Messages.InitSuccessMessage;\n wasmWorker.showOverlay = successMsg.showOverlay;\n wasmWorker.loadedWasmType = successMsg.wasmType;\n resolve( wasmWorker );\n },\n /* eslint-disable @typescript-eslint/no-explicit-any */\n ( error: any ) =>\n {\n if ( wasmWorker && typeof wasmWorker.delete === \"function\" )\n {\n wasmWorker.delete();\n }\n reject( error );\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n );\n wasmWorker.postMessage( initMessage, initEventHandler );\n }\n );\n }\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any,\n @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/explicit-module-boundary-types */\nexport class SDKError\n{\n code: string;\n\n message: string;\n\n details?: any;\n\n constructor( error: { code: string, message: string }, details?: any )\n {\n if ( !error.code || !error.message )\n {\n throw new Error( \"Instance of SDKError is required to have code and message.\" );\n }\n\n this.message = error.message;\n this.code = error.code;\n this.details = details;\n }\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/* eslint-disable max-len */\n\n/**\n * Structures of Error Codes, Error Messages, and CustomError compatible objects for the Error Generator utility.\n * Error Code convention: SECTION_OBJECT_(ACTION)_PROBLEM\n */\n\nexport enum ErrorCodes {\n WORKER_WASM_LOAD_FAILURE = \"WORKER_WASM_LOAD_FAILURE\",\n WORKER_WASM_INIT_MISSING = \"WORKER_WASM_INIT_MISSING\",\n WORKER_FUNCTION_INVOKE_FAILURE = \"WORKER_FUNCTION_INVOKE_FAILURE\",\n WORKER_RECOGNIZER_CREATION_FAILURE = \"WORKER_RECOGNIZER_CREATION_FAILURE\",\n WORKER_RUNNER_EXISTS = \"WORKER_RUNNER_EXISTS\",\n WORKER_RUNNER_CREATION_FAILURE = \"WORKER_RUNNER_CREATION_FAILURE\",\n WORKER_RUNNER_MISSING = \"WORKER_RUNNER_MISSING\",\n WORKER_RUNNER_RECONFIGURE_FAILURE = \"WORKER_RUNNER_RECONFIGURE_FAILURE\",\n WORKER_RUNNER_DELETED = \"WORKER_RUNNER_DELETED\",\n WORKER_RUNNER_DELETE_FAILURE = \"WORKER_RUNNER_DELETE_FAILURE\",\n WORKER_OBJECT_INVOKE_FAILURE = \"WORKER_OBJECT_INVOKE_FAILURE\",\n WORKER_IMAGE_PROCESS_FAILURE = \"WORKER_IMAGE_PROCESS_FAILURE\",\n WORKER_HANDLE_UNDEFINED = \"WORKER_HANDLE_UNDEFINED\",\n WORKER_MESSAGE_ACTION_UNKNOWN = \"WORKER_MESSAGE_ACTION_UNKNOWN\",\n WORKER_LICENSE_UNLOCK_ERROR = \"WORKER_LICENSE_UNLOCK_ERROR\",\n WORKER_INTEGRATION_INFO_FAILURE = \"WORKER_INTEGRATION_INFO_FAILURE\",\n\n LOCAL_SDK_RUNNER_MISSING = \"LOCAL_SDK_RUNNER_MISSING\",\n LOCAL_SDK_RUNNER_EMPTY = \"LOCAL_SDK_RUNNER_EMPTY\",\n\n LICENSE_UNLOCK_ERROR = \"LICENSE_UNLOCK_ERROR\",\n\n FRAME_CAPTURE_SVG_UNSUPPORTED = \"FRAME_CAPTURE_SVG_UNSUPPORTED\",\n FRAME_CAPTURE_CANVAS_MISSING = \"FRAME_CAPTURE_CANVAS_MISSING\",\n\n SDK_WASM_SETTINGS_MISSING = \"SDK_WASM_SETTINGS_MISSING\",\n SDK_LICENSE_KEY_MISSING = \"SDK_LICENSE_KEY_MISSING\",\n SDK_WASM_MODULE_NAME_MISSING = \"SDK_WASM_MODULE_NAME_MISSING\",\n SDK_ENGINE_LOCATION_INVALID = \"SDK_ENGINE_LOCATION_INVALID\",\n SDK_MISSING = \"SDK_MISSING\",\n SDK_RECOGNIZERS_MISSING = \"SDK_RECOGNIZERS_MISSING\",\n\n VIDEO_RECOGNIZER_ELEMENT_MISSING = \"VIDEO_RECOGNIZER_ELEMENT_MISSING\",\n VIDEO_RECOGNIZER_CAMERA_MISSING = \"VIDEO_RECOGNIZER_CAMERA_MISSING\",\n VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED = \"VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED\",\n VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE = \"VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE\",\n VIDEO_RECOGNIZER_CAMERA_IN_USE = \"VIDEO_RECOGNIZER_CAMERA_IN_USE\",\n VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED = \"VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED\",\n VIDEO_RECOGNIZER_FEED_RELEASED = \"VIDEO_RECOGNIZER_FEED_RELEASED\",\n VIDEO_RECOGNIZER_FEED_NOT_PAUSED = \"VIDEO_RECOGNIZER_FEED_NOT_PAUSED\",\n VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED = \"VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED\",\n VIDEO_RECOGNIZER_FEED_PAUSED = \"VIDEO_RECOGNIZER_FEED_PAUSED\",\n VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE = \"VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE\",\n VIDEO_RECOGNIZER_FEED_MISSING = \"VIDEO_RECOGNIZER_FEED_MISSING\",\n}\n\nexport enum ErrorMessages {\n WORKER_HANDLE_UNDEFINED = \"Cannot find object with handle: undefined\",\n WORKER_WASM_LOAD_FAILURE = \"Failed to load WASM in web worker!\",\n WORKER_WASM_INIT_MISSING = \"WASM module is not initialized!\",\n WORKER_FUNCTION_INVOKE_FAILURE = \"Failed to invoke function!\",\n WORKER_RECOGNIZER_CREATION_FAILURE = \"Failed to create new recognizer!\",\n WORKER_RUNNER_EXISTS = \"Recognizer runner is already created! Multiple instances are not allowed!\",\n WORKER_RUNNER_CREATION_FAILURE = \"Failed to create new recognizer runner!\",\n WORKER_RUNNER_MISSING = \"Recognizer runner is not created! There is nothing to reconfigure!\",\n WORKER_RUNNER_RECONFIGURE_FAILURE = \"Failed to reconfigure recognizer runner!\",\n WORKER_RUNNER_DELETED = \"Recognizer runner is already deleted!\",\n WORKER_RUNNER_DELETE_FAILURE = \"Failed to delete recognizer runner!\",\n WORKER_OBJECT_INVOKE_FAILURE = \"Failed to invoke object!\",\n WORKER_IMAGE_PROCESS_FAILURE = \"Recognizer runner is not initialized! Cannot process image!\",\n WORKER_INTEGRATION_INFO_FAILURE = \"Failed to get product integration info!\",\n\n LOCAL_SDK_RUNNER_MISSING = \"Property nativeRecognizerRunner is not available!\",\n LOCAL_SDK_RUNNER_EMPTY = \"Native RecognizerRunner cannot be empty!\",\n\n LICENSE_TOKEN_STATE_INCORRECT = \"Internal error (Incorrect token state)\",\n LICENSE_PAYLOAD_VERIFICATION_FAILED = \"Failed to verify server permission's digital signature!\",\n LICENSE_PAYLOAD_CORRUPTED = \"Server permission payload is corrupted!\",\n LICENSE_PERMISSION_EXPIRED = \"Internal error (server permission expired)\",\n LICENSE_REMOTE_LOCKED = \"Provided license key has been remotely locked. Please contact support for more information!\",\n\n FRAME_CAPTURE_SVG_UNSUPPORTED = \"Recognition of SVG elements not supported!\",\n FRAME_CAPTURE_CANVAS_MISSING = \"Could not get canvas 2d context!\",\n\n SDK_WASM_SETTINGS_MISSING = \"Missing WASM load settings!\",\n SDK_LICENSE_KEY_MISSING = \"Missing license key!\",\n SDK_WASM_MODULE_NAME_MISSING = \"Missing WASM module name!\",\n SDK_ENGINE_LOCATION_INVALID = \"Setting property 'engineLocation' must be a string!\",\n SDK_MISSING = \"SDK is not provided!\",\n SDK_RECOGNIZERS_MISSING = \"To create RecognizerRunner at least 1 recognizer is required.\",\n\n VIDEO_RECOGNIZER_ELEMENT_MISSING = \"Video element, i.e. camera feed is not provided!\",\n VIDEO_RECOGNIZER_CAMERA_MISSING = \"Camera not found!\",\n VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED = \"Camera not allowed!\",\n VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE = \"Camera not available!\",\n VIDEO_RECOGNIZER_CAMERA_IN_USE = \"Camera in use!\",\n VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED = \"Media devices not supported by browser.\",\n VIDEO_RECOGNIZER_FEED_RELEASED = \"The associated video feed has been released!\",\n VIDEO_RECOGNIZER_FEED_NOT_PAUSED = \"The associated video feed is not paused. Use resumeRecognition instead!\",\n VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED = \"The play() request was interrupted or prevented by browser security rules!\",\n VIDEO_RECOGNIZER_FEED_PAUSED = \"Cannot resume recognition while video feed is paused! Use recognize or startRecognition\",\n VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE = \"Could not reset recognizers!\",\n VIDEO_RECOGNIZER_FEED_MISSING = \"Missing video feed!\",\n}\n\nexport const videoRecognizerErrors = {\n feedMissing: {\n message: ErrorMessages.VIDEO_RECOGNIZER_FEED_MISSING,\n code: ErrorCodes.VIDEO_RECOGNIZER_FEED_MISSING,\n },\n recognizersResetFailure: {\n message: ErrorMessages.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE,\n code: ErrorCodes.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE,\n },\n feedPaused: {\n message: ErrorMessages.VIDEO_RECOGNIZER_FEED_PAUSED,\n code: ErrorCodes.VIDEO_RECOGNIZER_FEED_PAUSED,\n },\n playRequestInterrupted: {\n message: ErrorMessages.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED,\n code: ErrorCodes.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED,\n },\n videoFeedNotPaused: {\n message: ErrorMessages.VIDEO_RECOGNIZER_FEED_NOT_PAUSED,\n code: ErrorCodes.VIDEO_RECOGNIZER_FEED_NOT_PAUSED,\n },\n videoFeedReleased: {\n message: ErrorMessages.VIDEO_RECOGNIZER_FEED_RELEASED,\n code: ErrorCodes.VIDEO_RECOGNIZER_FEED_RELEASED,\n },\n mediaDevicesUnsupported: {\n code: ErrorCodes.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED,\n message: ErrorMessages.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED,\n },\n cameraMissing: {\n code: ErrorCodes.VIDEO_RECOGNIZER_CAMERA_MISSING,\n message: ErrorMessages.VIDEO_RECOGNIZER_CAMERA_MISSING,\n },\n elementMissing: {\n message: ErrorMessages.VIDEO_RECOGNIZER_ELEMENT_MISSING,\n code: ErrorCodes.VIDEO_RECOGNIZER_ELEMENT_MISSING,\n },\n};\n\nexport const sdkErrors = {\n wasmSettingsMissing: {\n message: ErrorMessages.SDK_WASM_SETTINGS_MISSING,\n code: ErrorCodes.SDK_WASM_SETTINGS_MISSING,\n },\n licenseKeyMissing: {\n message: ErrorMessages.SDK_LICENSE_KEY_MISSING,\n code: ErrorCodes.SDK_LICENSE_KEY_MISSING,\n },\n wasmModuleNameMissing: {\n message: ErrorMessages.SDK_WASM_MODULE_NAME_MISSING,\n code: ErrorCodes.SDK_WASM_MODULE_NAME_MISSING,\n },\n engineLocationInvalid: {\n message: ErrorMessages.SDK_ENGINE_LOCATION_INVALID,\n code: ErrorCodes.SDK_ENGINE_LOCATION_INVALID,\n },\n missing: {\n message: ErrorMessages.SDK_MISSING,\n code: ErrorCodes.SDK_MISSING,\n },\n recognizersMissing: {\n message: ErrorMessages.SDK_RECOGNIZERS_MISSING,\n code: ErrorCodes.SDK_RECOGNIZERS_MISSING,\n },\n};\n\nexport const frameCaptureErrors = {\n svgUnsupported: {\n message: ErrorMessages.FRAME_CAPTURE_SVG_UNSUPPORTED,\n code: ErrorCodes.FRAME_CAPTURE_SVG_UNSUPPORTED,\n },\n canvasMissing: {\n message: ErrorMessages.FRAME_CAPTURE_CANVAS_MISSING,\n code: ErrorCodes.FRAME_CAPTURE_CANVAS_MISSING,\n },\n};\n\nexport const licenseErrors = {\n licenseTokenStateIncorrect: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n message: ErrorMessages.LICENSE_TOKEN_STATE_INCORRECT,\n },\n licensePayloadVerificationFailed: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n message: ErrorMessages.LICENSE_PAYLOAD_VERIFICATION_FAILED,\n },\n licensePayloadCorrupted: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n message: ErrorMessages.LICENSE_PAYLOAD_CORRUPTED,\n },\n licensePermissionExpired: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n message: ErrorMessages.LICENSE_PERMISSION_EXPIRED,\n },\n licenseRemoteLocked: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n message: ErrorMessages.LICENSE_REMOTE_LOCKED,\n },\n licenseNetworkError: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n },\n licenseInvalid: {\n code: ErrorCodes.LICENSE_UNLOCK_ERROR,\n },\n};\n\nexport const localSdkErrors = {\n runnerMissing: {\n message: ErrorMessages.LOCAL_SDK_RUNNER_MISSING,\n code: ErrorCodes.LOCAL_SDK_RUNNER_MISSING,\n },\n runnerEmpty: {\n message: ErrorMessages.LOCAL_SDK_RUNNER_EMPTY,\n code: ErrorCodes.LOCAL_SDK_RUNNER_EMPTY,\n },\n};\n\nexport const workerErrors = {\n imageProcessFailure: {\n message: ErrorMessages.WORKER_IMAGE_PROCESS_FAILURE,\n code: ErrorCodes.WORKER_IMAGE_PROCESS_FAILURE,\n },\n objectInvokeFailure: {\n message: ErrorMessages.WORKER_OBJECT_INVOKE_FAILURE,\n code: ErrorCodes.WORKER_OBJECT_INVOKE_FAILURE,\n },\n runnerDeleteFailure: {\n message: ErrorMessages.WORKER_RUNNER_DELETE_FAILURE,\n code: ErrorCodes.WORKER_RUNNER_DELETE_FAILURE,\n },\n runnerDeleted: {\n message: ErrorMessages.WORKER_RUNNER_DELETED,\n code: ErrorCodes.WORKER_RUNNER_DELETED,\n },\n runnerReconfigureFailure: {\n message: ErrorMessages.WORKER_RUNNER_RECONFIGURE_FAILURE,\n code: ErrorCodes.WORKER_RUNNER_RECONFIGURE_FAILURE,\n },\n runnerMissing: {\n message: ErrorMessages.WORKER_RUNNER_MISSING,\n code: ErrorCodes.WORKER_RUNNER_MISSING,\n },\n runnerCreationFailure: {\n message: ErrorMessages.WORKER_RUNNER_CREATION_FAILURE,\n code: ErrorCodes.WORKER_RUNNER_CREATION_FAILURE,\n },\n runnerExists: {\n message: ErrorMessages.WORKER_RUNNER_EXISTS,\n code: ErrorCodes.WORKER_RUNNER_EXISTS,\n },\n recognizerCreationFailure: {\n message: ErrorMessages.WORKER_RECOGNIZER_CREATION_FAILURE,\n code: ErrorCodes.WORKER_RECOGNIZER_CREATION_FAILURE,\n },\n functionInvokeFailure: {\n message: ErrorMessages.WORKER_FUNCTION_INVOKE_FAILURE,\n code: ErrorCodes.WORKER_FUNCTION_INVOKE_FAILURE,\n },\n wasmInitMissing: {\n message: ErrorMessages.WORKER_WASM_INIT_MISSING,\n code: ErrorCodes.WORKER_WASM_INIT_MISSING,\n },\n wasmLoadFailure: {\n message: ErrorMessages.WORKER_WASM_LOAD_FAILURE,\n code: ErrorCodes.WORKER_WASM_LOAD_FAILURE,\n },\n handleUndefined: {\n message: ErrorMessages.WORKER_HANDLE_UNDEFINED,\n code: ErrorCodes.WORKER_HANDLE_UNDEFINED,\n },\n integrationInfoFailure: {\n message: ErrorMessages.WORKER_INTEGRATION_INFO_FAILURE,\n code: ErrorCodes.WORKER_INTEGRATION_INFO_FAILURE\n }\n};\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/**\n * Preferred type of camera to be used when opening the camera feed.\n */\nexport enum PreferredCameraType\n{\n /** Prefer back facing camera */\n BackFacingCamera,\n /** Prefer front facing camera */\n FrontFacingCamera\n}\n\n// inspired by https://unpkg.com/browse/scandit-sdk@4.6.1/src/lib/cameraAccess.ts\nconst backCameraKeywords: string[] = [\n \"rear\",\n \"back\",\n \"rück\",\n \"arrière\",\n \"trasera\",\n \"trás\",\n \"traseira\",\n \"posteriore\",\n \"后面\",\n \"後面\",\n \"背面\",\n \"后置\", // alternative\n \"後置\", // alternative\n \"背置\", // alternative\n \"задней\",\n \"الخلفية\",\n \"후\",\n \"arka\",\n \"achterzijde\",\n \"หลัง\",\n \"baksidan\",\n \"bagside\",\n \"sau\",\n \"bak\",\n \"tylny\",\n \"takakamera\",\n \"belakang\",\n \"אחורית\",\n \"πίσω\",\n \"spate\",\n \"hátsó\",\n \"zadní\",\n \"darrere\",\n \"zadná\",\n \"задня\",\n \"stražnja\",\n \"belakang\",\n \"बैक\"\n];\n\nfunction isBackCameraLabel( label: string ): boolean\n{\n const lowercaseLabel = label.toLowerCase();\n\n return backCameraKeywords.some( keyword => lowercaseLabel.includes( keyword ) );\n}\n\nexport class SelectedCamera\n{\n readonly deviceId: string;\n\n readonly groupId: string;\n\n readonly facing: PreferredCameraType;\n\n readonly label: string;\n\n constructor( mdi: MediaDeviceInfo, facing: PreferredCameraType )\n {\n this.deviceId = mdi.deviceId;\n this.facing = facing;\n this.groupId = mdi.groupId;\n this.label = mdi.label;\n }\n}\n\nexport interface CameraDevices\n{\n frontCameras: SelectedCamera[];\n backCameras: SelectedCamera[];\n}\n\nexport async function getCameraDevices(): Promise< CameraDevices >\n{\n const frontCameras: SelectedCamera[] = [];\n const backCameras: SelectedCamera[] = [];\n\n {\n let devices = await navigator.mediaDevices.enumerateDevices();\n // if permission is not given, label of video devices will be empty string\n if ( devices.filter( device => device.kind === \"videoinput\" ).every( device => device.label === \"\" ) )\n {\n const stream = await navigator.mediaDevices.getUserMedia\n (\n {\n video:\n {\n facingMode: { ideal: \"environment\" }\n },\n audio: false\n }\n );\n\n // enumerate devices again - now the label field should be non-empty, as we have a stream active\n // (even if we didn't get persistent permission for camera)\n devices = await navigator.mediaDevices.enumerateDevices();\n\n // close the stream, as we don't need it anymore\n stream.getTracks().forEach( track => track.stop() );\n }\n\n const cameras = devices.filter( device => device.kind === \"videoinput\" );\n for ( const camera of cameras )\n {\n if ( isBackCameraLabel( camera.label ) )\n {\n backCameras.push( new SelectedCamera( camera, PreferredCameraType.BackFacingCamera ) );\n }\n else\n {\n frontCameras.push( new SelectedCamera( camera, PreferredCameraType.FrontFacingCamera ) );\n }\n }\n }\n\n return {\n frontCameras,\n backCameras\n };\n}\n\nexport async function selectCamera(\n cameraId: string | null,\n preferredCameraType: PreferredCameraType\n): Promise< SelectedCamera | null >\n{\n const { frontCameras, backCameras } = await getCameraDevices();\n\n if ( frontCameras.length > 0 || backCameras.length > 0 )\n {\n // decide from which array the camera will be selected\n let cameraPool: SelectedCamera[] = ( backCameras.length > 0 ? backCameras : frontCameras );\n // if there is at least one back facing camera and user prefers back facing camera, use that as a selection pool\n if ( preferredCameraType === PreferredCameraType.BackFacingCamera && backCameras.length > 0 )\n {\n cameraPool = backCameras;\n }\n // if there is at least one front facing camera and is preferred by user, use that as a selection pool\n if ( preferredCameraType === PreferredCameraType.FrontFacingCamera && frontCameras.length > 0 )\n {\n cameraPool = frontCameras;\n }\n // otherwise use whichever pool is non-empty\n\n // sort camera pool by label\n cameraPool = cameraPool.sort( ( camera1, camera2 ) => camera1.label.localeCompare( camera2.label ) );\n\n // Check if cameras are labeled with resolution information, take the higher-resolution one in that case\n // Otherwise pick the first camera\n {\n let selectedCameraIndex = 0;\n\n const cameraResolutions: number[] = cameraPool.map\n (\n camera =>\n {\n const regExp = RegExp( /\\b([0-9]+)MP?\\b/, \"i\" );\n const match = regExp.exec( camera.label );\n if ( match !== null )\n {\n return parseInt( match[1], 10 );\n }\n else\n {\n return NaN;\n }\n }\n );\n if ( !cameraResolutions.some( cameraResolution => isNaN( cameraResolution ) ) )\n {\n selectedCameraIndex = cameraResolutions.lastIndexOf( Math.max( ...cameraResolutions ) );\n }\n if ( cameraId )\n {\n let cameraDevice = null;\n\n cameraDevice = frontCameras.filter( device => device.deviceId === cameraId )[0];\n if ( !cameraDevice )\n {\n cameraDevice = backCameras.filter( device => device.deviceId === cameraId )[0];\n }\n\n return cameraDevice || null;\n }\n\n return cameraPool[ selectedCameraIndex ];\n }\n }\n else\n {\n // no cameras available on the device\n return null;\n }\n}\n\n/**\n * Bind camera device to video feed (HTMLVideoElement).\n *\n * This function will return `true` in case that video feed of camera device has been flipped,\n * and `false` otherwise.\n *\n * @param camera Camera device which should be binded with the video element.\n * @param videoFeed HTMLVideoElement to which camera device should be binded.\n * @param preferredCameraType Enum representing whether to use front facing or back facing camera.\n */\nexport async function bindCameraToVideoFeed(\n camera: SelectedCamera,\n videoFeed: HTMLVideoElement,\n preferredCameraType: PreferredCameraType = PreferredCameraType.BackFacingCamera\n): Promise< boolean >\n{\n const constraints: MediaStreamConstraints =\n {\n audio: false,\n video:\n {\n width:\n {\n min: 640,\n ideal: 1920,\n max: 1920\n },\n height:\n {\n min: 480,\n ideal: 1080,\n max: 1080\n }\n }\n };\n if ( camera.deviceId === \"\" )\n {\n const isPreferredBackFacing = preferredCameraType === PreferredCameraType.BackFacingCamera;\n ( constraints.video as MediaTrackConstraints ).facingMode =\n {\n ideal: isPreferredBackFacing ? \"environment\" : \"user\"\n };\n }\n else\n {\n ( constraints.video as MediaTrackConstraints ).deviceId =\n {\n exact: camera.deviceId\n };\n }\n\n const stream = await navigator.mediaDevices.getUserMedia( constraints );\n videoFeed.controls = false;\n videoFeed.srcObject = stream;\n\n let cameraFlipped = false;\n if ( camera.facing === PreferredCameraType.FrontFacingCamera )\n {\n videoFeed.style.transform = \"scaleX(-1)\";\n cameraFlipped = true;\n }\n\n return cameraFlipped;\n}\n\nexport function clearVideoFeed( videoFeed: HTMLVideoElement ): void\n{\n if ( videoFeed && videoFeed.srcObject !== null )\n {\n ( videoFeed.srcObject as MediaStream ).getTracks().forEach( track => track.stop() );\n videoFeed.srcObject = null;\n }\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { CapturedFrame } from \"./FrameCapture\";\nimport { MetadataCallbacks } from \"./MetadataCallbacks\";\nimport { ClearTimeoutCallback } from \"./ClearTimeoutCallback\";\nimport { WasmType } from \"./WasmType\";\n\n// ============================================ /\n// DATA STRUCTURES /\n// ============================================ /\n\n/**\n * Specifies the orientation of the contents of the image.\n * This is important for some recognizers, especially when\n * performing recognition on the mobile device.\n */\nexport enum ImageOrientation\n{\n /**\n * Image contents are rotated 90 degrees left.\n * This usually happens on mobile devices when capturing image while\n * device is held in \"portrait\" orientation, while device camera sensor\n * is mounted horizontally (i.e. produced image is in \"landscape\" orienation).\n */\n RotatedLeft90 = 0,\n\n /**\n * Image contents are not rotated in any manner.\n * This is the default for images captured using HTML canvas, as\n * used in FrameCapture class.\n * This orientation also usually happens on mobile devices when capturing\n * image while device is held in \"landscape\" orientation, while device\n * camera sensor is mounted horizontally (i.e. also in same orientation).\n */\n NoRotation,\n\n /**\n * Image contents are rotated 90 degrees right.\n * This usually happens on mobile devices when capturing image while\n * device is held in \"reverse-portrait\" orientation, while device camera sensor\n * is mounted horizontally (i.e. produced image is in \"landscape\" orienation).\n */\n RotatedRight90,\n\n /**\n * Image contents are rotated 180 degrees, i.e. image contents are \"upside down\".\n * This usually happens on mobile devices when capturing image while\n * device is held in \"reverse-landscape\" orientation, while device camera sensor\n * is mounted horizontally (i.e. produced image is in \"landscape\" orienation).\n */\n Rotated180\n}\n\n/**\n * Specifies the state of the recognition result.\n */\nexport enum RecognizerResultState\n{\n /** Nothing has been recognized. */\n Empty = 0,\n /** Something has been recognized, but some mandatory data is still missing. */\n Uncertain,\n /** All required data has been recognized. */\n Valid,\n /** Single stage of a multi-stage recognition is finished. */\n StageValid\n}\n\n/**\n * Specifies an abstract object placed on the WebAssembly heap.\n * Objects placed on the WebAssembly heap are not cleaned up by the\n * garbage collector of the JavaScript engine. The memory used by\n * the object must be cleaned up manually by calling the delete() method.\n */\nexport interface WasmNativeObject\n{\n /**\n * Cleans up the object from the WebAssembly heap.\n */\n delete(): Promise< void >;\n}\n\n/**\n * Specifies the abstract recognition result.\n */\nexport interface RecognizerResult\n{\n /** State of the recognition result. See the documentation for RecognizerResultState for more information. */\n readonly state: RecognizerResultState;\n}\n\n/**\n * Specifies the abstract settings for the Recognizer object.\n */\n/* eslint-disable @typescript-eslint/no-empty-interface */\nexport interface RecognizerSettings\n{}\n/* eslint-enable @typescript-eslint/no-empty-interface */\n\n/**\n * Specifies an abstract Recognizer object. The Recognizer object is the basic unit of processing.\n */\nexport interface Recognizer extends WasmNativeObject\n{\n /**\n * Name of this recognizer.\n */\n readonly recognizerName: string;\n\n /**\n * Returns the currently applied settings to the specific recognizer.\n */\n currentSettings(): Promise< RecognizerSettings >;\n\n /**\n * Applies the new settings to the specific recognizer.\n * Note: if the recognizer is associated with RecognizerRunner, this method will fail.\n * @param newSettings New settings to be applied to the recognizer.\n */\n updateSettings( newSettings: RecognizerSettings ): Promise< void >;\n\n /**\n * Returns the current result of the recognition.\n */\n getResult(): Promise< RecognizerResult >;\n\n /**\n * Returns the JSON representation of the recognizer's result.\n * The JSON will be digitally signed and can be used to verify\n * that the result was provided by the SDK and that it hasn't been\n * manually altered.\n * If the SDK does not have this feature compiled into the WASM, this\n * method will return null.\n */\n toSignedJSON(): Promise< SignedPayload | null >;\n}\n\n/**\n * Specifies a main Recognizer orchestrator object.\n */\nexport interface RecognizerRunner extends WasmNativeObject\n{\n /**\n * Starts the recognition of the given image using recognizer objects currently associated\n * with the RecognizerRunner.\n * @param image Image to be processed.\n * @returns Promise that will resolve when image processing finishes.\n */\n processImage( image: CapturedFrame ): Promise< RecognizerResultState >;\n\n /**\n * Reconfigures the instance of RecognizerRunner with new recognizers. The currently associated\n * recognizer objects are un-associated from this RecognizerRunner and are elligible for calling\n * the updateSettings() method on them after that.\n * @param recognizers Array of recognizer objects that should be associated with the RecognizerRunner.\n * @param allowMultipleResults Whether or not it is allowed to return multiple results from single image.\n * See README.md for more details about this option.\n */\n reconfigureRecognizers( recognizers: Array< Recognizer >, allowMultipleResults: boolean ): Promise< void >;\n\n /**\n * Sets the new callbacks for obtaining recognition event. Make sure you call this method while image processing is\n * not in progress, otherwise you will have undefined behaviour.\n * @param metadataCallbacks Callback functions that will be called when certain recognition events occur.\n *\n * For more information, check the documentation of MetadataCallbacks class.\n */\n setMetadataCallbacks( metadataCallbacks: MetadataCallbacks ): Promise< void >;\n\n /**\n * Resets the state of all recognizers in current recognition chain, i.e. deletes the cached data from multiple\n * recognitions.\n * @param hardReset If set to false, combined recognizers will not be reset. If set to true, all recognizers will be\n * reset.\n */\n resetRecognizers( hardReset: boolean ): Promise< void >;\n\n /**\n * If enabled, recognizers will be instructed to only perform object detection, but not the entire\n * recognition process. This is useful for testing your implementations of MetadataCallbacks without\n * the need for the entire process to complete. Also, VideoRecognizers sets this to true only if in\n * DetectionTest mode of video recognition.\n * @param detectionOnly Should recognizers perform only object detection.\n */\n setDetectionOnlyMode( detectionOnly: boolean ): Promise< void >;\n\n /**\n * Sets or removes the ClearTimeoutCallback.\n */\n setClearTimeoutCallback( clearTimeoutCallback: ClearTimeoutCallback | null ): Promise< void >;\n\n /**\n * Sets whether camera preview displaying the image being recognized is being mirrored horizontally.\n * If enabled, coordinates returned via metadatacallbacks will be adjusted accordingly due to the\n * image being processed being different of image being displayed.\n * The camera preview is usually mirrored when using front-facing camera.\n * @param mirrored Whether or not metadatacallbacks should adjust coordinates for mirrored image.\n */\n setCameraPreviewMirrored( mirrored: boolean ): Promise< void >;\n}\n\n/**\n * @hidden\n * A proxy object for accessing the WebAssembly module.\n * Only for internal use. It's API may change in the future without any notice.\n * Please do not invoke methods directly on the instance of this interface.\n */\nexport interface WasmModuleProxy\n{\n createRecognizerRunner\n (\n recognizers: Array< Recognizer >,\n allowMultipleResults: boolean,\n metadataCallbacks: MetadataCallbacks\n ): Promise< RecognizerRunner >;\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n newRecognizer( className: string, ...constructorArgs: any[] ): Promise< Recognizer >;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n}\n\n/**\n * Specifies a main object that is used for communication with the WebAssembly module.\n * This object is usually given as a parameter to functions that interop with the WebAssembly module.\n * You can obtain an instance of this object after a promise from MicroblinkSDK.loadWasmModule is successfully\n * resolved.\n */\nexport interface WasmSDK\n{\n /**\n * @hidden\n * A proxy object to the WebAssmebly module.\n * Only for internal use. It's API may change in the future without any notice.\n */\n readonly mbWasmModule: WasmModuleProxy;\n\n delete: () => void;\n\n getProductIntegrationInfo: () => Promise<ProductIntegrationInfo>;\n\n /**\n * The type of the WASM that was actually loaded.\n */\n loadedWasmType: WasmType;\n\n showOverlay: boolean;\n}\n\n/**\n * Specifies a date object, as parsed from some documents.\n * Unlike JavaScript Date object, it does not depend on time zone.\n */\nexport interface MBDate\n{\n /** Day in month. */\n readonly day: number;\n\n /** Month in year. */\n readonly month: number;\n\n /** Year */\n readonly year: number;\n\n /** Original string on the document from which date was parsed. */\n readonly originalString: string;\n\n /** Indicates whether date was parsed successfully. */\n readonly successfullyParsed: boolean;\n\n /** Indicates whether object is empty. Note that it is possible to successfully parse an empty date. */\n readonly empty: boolean;\n}\n\n/**\n * Specifies a digital signature of the specific recognizer result.\n */\nexport interface SignedPayload\n{\n /** The digital signature payload. */\n readonly payload: string;\n\n /** The digital signature of the payload. */\n readonly signature: string;\n\n /** Version of the digital signature. */\n readonly signatureVersion: string;\n}\n\n/**\n * Describes a structure containing information about product integration.\n */\nexport interface ProductIntegrationInfo\n{\n readonly userId: string;\n\n readonly licenseId: string;\n\n readonly licensee: string;\n\n readonly productVersion: string;\n\n readonly platform: string;\n\n readonly device: string;\n\n readonly packageName: string;\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/**\n * Checks if browser is supported by the SDK. The minimum requirements for the browser is\n * the support for WebAssembly. If your browser does not support executing WebAssembly,\n * this function will return `false`.\n */\nexport function isBrowserSupported(): boolean\n{\n // based on https://stackoverflow.com/a/47880734\n try\n {\n if ( typeof WebAssembly === \"object\" && typeof WebAssembly.instantiate === \"function\" )\n {\n const module = new WebAssembly.Module( Uint8Array.of( 0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00 ) );\n if ( module instanceof WebAssembly.Module )\n return new WebAssembly.Instance( module ) instanceof WebAssembly.Instance;\n }\n }\n catch ( ignored )\n {\n return false;\n }\n return false;\n}\n\n/**\n * Check if current browser is in-app / embedded.\n * Detects Instagram, Facebook, LinkedIn, Twitter, WeChat, Whatsapp, and Tiktok.\n * @returns Boolean whether the browser is in-app or not\n */\nexport function isInAppBrowser(): boolean\n{\n const inAppRegex = /(instagram|fbav|linkedinapp|twitter|micromessenger|whatsapp|tiktok)[/\\s]?([\\w.]*)/i;\n const userAgent = navigator.userAgent || navigator.vendor;\n\n return !!inAppRegex.exec( userAgent );\n}\n\n/**\n * Check if browser supports ES6, which is prerequisite for this SDK to execute.\n *\n * IMPORTANT: it's not possible to run this function from MicroblinkSDK if browser doesn't support\n * ES6 since this file won't be able to load.\n *\n * This function is here as a placeholder so it can be copied to standalone JS file or directly into 'index.html'.\n */\n// export function isES6Supported(): boolean\n// {\n// if ( typeof Symbol === \"undefined\" )\n// {\n// return false;\n// }\n// try\n// {\n// eval( \"class Foo {}\" );\n// eval( \"var bar = (x) => x+1\" );\n// }\n// catch ( e )\n// {\n// return false;\n// }\n// return true;\n// }\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { SDKError } from \"./SDKError\";\nimport { ImageOrientation } from \"./DataStructures\";\nimport * as ErrorTypes from \"./ErrorTypes\";\n\n// ============================================ /\n// Frame capture and camera management support. /\n// ============================================ /\n\nlet canvas : HTMLCanvasElement;\n\n/**\n * Represents a captured frame from HTMLVideoElement.\n */\nexport class CapturedFrame\n{\n /** Instance of ImageData object - contains pixels and metadata about the captured image. */\n readonly imageData: ImageData;\n\n /** Orientation of the captured frame */\n readonly orientation: ImageOrientation;\n\n /** Indicates whether captured frame originated from still image or video stream. */\n readonly videoFrame: boolean;\n\n constructor( imageData: ImageData, orientation: ImageOrientation, videoFrame: boolean )\n {\n this.imageData = imageData;\n this.orientation = orientation;\n this.videoFrame = videoFrame;\n }\n}\n\n/**\n * Captures a frame from any CanvasImageSource, such as HTMLVideoElement or HTMLImageElement.\n * @param imageSource image source from which frame should be captured\n * @returns instance of CapturedFrame\n */\nexport function captureFrame( imageSource: CanvasImageSource ): CapturedFrame\n{\n let imageWidth: number;\n let imageHeight: number;\n let videoFrame = false;\n if ( imageSource instanceof HTMLVideoElement )\n {\n imageWidth = imageSource.videoWidth;\n imageHeight = imageSource.videoHeight;\n videoFrame = true;\n }\n else if ( imageSource instanceof HTMLImageElement )\n {\n imageWidth = imageSource.naturalWidth;\n imageHeight = imageSource.naturalHeight;\n }\n else if ( imageSource instanceof SVGImageElement )\n {\n throw new SDKError( ErrorTypes.frameCaptureErrors.svgUnsupported );\n }\n else\n {\n imageWidth = imageSource.width;\n imageHeight = imageSource.height;\n }\n\n canvas = canvas || document.createElement( \"canvas\" );\n canvas.width = imageWidth;\n canvas.height = imageHeight;\n const ctx = canvas.getContext( \"2d\" );\n\n if ( !ctx )\n {\n throw new SDKError( ErrorTypes.frameCaptureErrors.canvasMissing );\n }\n\n ctx.drawImage( imageSource, 0, 0, canvas.width, canvas.height );\n const pixelData = ctx.getImageData( 0, 0, canvas.width, canvas.height );\n\n return new CapturedFrame\n (\n pixelData,\n // TODO: https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation\n // or https://developer.mozilla.org/en-US/docs/Web/API/Window/orientation\n ImageOrientation.NoRotation,\n videoFrame\n );\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { SDKError } from \"./SDKError\";\nimport * as ErrorTypes from \"./ErrorTypes\";\n\nexport enum LicenseTokenState\n{\n Invalid,\n RequiresServerPermission,\n Valid\n}\n\nexport interface LicenseUnlockResult\n{\n readonly allowRemoveDemoOverlay : boolean;\n readonly allowRemoveProductionOverlay : boolean;\n readonly isTrial : boolean;\n readonly licenseId : string;\n readonly licensee : string;\n readonly packageName : string;\n readonly sdkName : string;\n readonly sdkVersion : string;\n readonly unlockResult : LicenseTokenState;\n readonly userId : string;\n readonly licenseError : string;\n}\n\nexport enum LicenseErrorType {\n LicenseTokenStateInvalid = \"LICENSE_TOKEN_STATE_INVALID\",\n NetworkError = \"NETWORK_ERROR\",\n RemoteLock = \"REMOTE_LOCK\",\n PermissionExpired = \"PERMISSION_EXPIRED\",\n PayloadCorrupted = \"PAYLOAD_CORRUPTED\",\n PayloadSignatureVerificationFailed = \"PAYLOAD_SIGNATURE_VERIFICATION_FAILED\",\n IncorrectTokenState = \"INCORRECT_TOKEN_STATE\"\n}\n\nconst baltazar = \"https://baltazar.microblink.com/api/v1/status/check\";\n\ninterface BaltazarRequest\n{\n readonly licenseId : string;\n readonly licensee : string;\n readonly packageName: string;\n readonly platform : string;\n readonly sdkName : string;\n readonly sdkVersion : string;\n}\n\nfunction toBaltazarRequest( unlockResult: LicenseUnlockResult ): BaltazarRequest\n{\n return {\n licenseId : unlockResult.licenseId,\n licensee : unlockResult.licensee,\n packageName: unlockResult.packageName,\n platform : \"Browser\",\n sdkName : unlockResult.sdkName,\n sdkVersion : unlockResult.sdkVersion\n };\n}\n\nfunction shouldShowOverlay(\n isTrial: boolean,\n allowRemoveDemoOverlay: boolean,\n allowRemoveProductionOverlay: boolean\n): boolean\n{\n if ( isTrial && allowRemoveDemoOverlay )\n {\n return false;\n }\n\n if ( !isTrial && allowRemoveProductionOverlay )\n {\n return false;\n }\n\n return true;\n}\n\nexport enum ServerPermissionSubmitResultStatus\n{\n Ok = 0,\n NetworkError,\n RemoteLock,\n PermissionExpired,\n PayloadCorrupted,\n PayloadSignatureVerificationFailed,\n IncorrectTokenState\n}\n\nexport interface ServerPermissionSubmitResult\n{\n readonly status: ServerPermissionSubmitResultStatus;\n readonly lease: number;\n readonly networkErrorDescription?: string;\n}\n\nexport interface UnlockResult\n{\n readonly error: SDKError | null;\n readonly lease?: number;\n readonly showOverlay?: boolean;\n}\n\n/* eslint-disable @typescript-eslint/no-explicit-any,\n @typescript-eslint/explicit-module-boundary-types,\n @typescript-eslint/no-unsafe-member-access,\n @typescript-eslint/no-unsafe-call\n*/\nexport async function obtainNewServerPermission\n(\n unlockResult: LicenseUnlockResult,\n wasmModule : any\n): Promise< ServerPermissionSubmitResult >\n{\n // request permission from Baltazar service\n try\n {\n const response = await fetch\n (\n baltazar,\n {\n method: \"POST\",\n headers:\n {\n \"Content-Type\": \"application/json\"\n },\n cache: \"no-cache\",\n body: JSON.stringify( toBaltazarRequest( unlockResult ) )\n }\n );\n if ( response.ok )\n {\n const serverPermission = ( await response.text() ).toString();\n const result = wasmModule.submitServerPermission( serverPermission ) as ServerPermissionSubmitResult;\n return result;\n }\n else\n {\n return {\n status: ServerPermissionSubmitResultStatus.NetworkError,\n lease: 0,\n networkErrorDescription: `Server responded with status ${response.status}`\n };\n }\n }\n catch( error )\n {\n return {\n status: ServerPermissionSubmitResultStatus.NetworkError,\n lease: 0,\n networkErrorDescription: `Unexpected error: ${JSON.stringify( error )}`\n };\n }\n}\n\nexport async function unlockWasmSDK\n(\n licenseKey : string,\n allowHelloMessage: boolean,\n userId : string,\n wasmModule : any\n): Promise< UnlockResult >\n{\n const unlockResult = wasmModule.initializeWithLicenseKey\n (\n licenseKey,\n userId,\n allowHelloMessage\n ) as LicenseUnlockResult;\n\n switch( unlockResult.unlockResult )\n {\n case LicenseTokenState.Invalid:\n return {\n error: new SDKError(\n {\n ...ErrorTypes.licenseErrors.licenseInvalid,\n message: unlockResult.licenseError\n },\n {\n type: LicenseErrorType.LicenseTokenStateInvalid,\n }\n ),\n };\n case LicenseTokenState.Valid:\n return {\n error: null,\n showOverlay: shouldShowOverlay(\n unlockResult.isTrial,\n unlockResult.allowRemoveDemoOverlay,\n unlockResult.allowRemoveProductionOverlay\n )\n };\n case LicenseTokenState.RequiresServerPermission:\n {\n const serverPermission = await obtainNewServerPermission( unlockResult, wasmModule );\n switch ( serverPermission.status )\n {\n case ServerPermissionSubmitResultStatus.Ok:\n return {\n error: null,\n lease: serverPermission.lease\n };\n case ServerPermissionSubmitResultStatus.NetworkError:\n {\n let additionalInfo = \"\";\n if ( serverPermission.networkErrorDescription )\n {\n additionalInfo = \" \" + serverPermission.networkErrorDescription;\n }\n\n return {\n error: new SDKError(\n {\n ...ErrorTypes.licenseErrors.licenseNetworkError,\n message: \"There has been a network error while obtaining the server permission!\"\n + additionalInfo\n },\n {\n type: LicenseErrorType.NetworkError,\n }\n )\n };\n }\n case ServerPermissionSubmitResultStatus.RemoteLock:\n return {\n error: new SDKError(\n ErrorTypes.licenseErrors.licenseRemoteLocked,\n {\n type: LicenseErrorType.RemoteLock,\n }\n ),\n lease: serverPermission.lease\n };\n case ServerPermissionSubmitResultStatus.PermissionExpired:\n return {\n error: new SDKError(\n ErrorTypes.licenseErrors.licensePermissionExpired,\n {\n type: LicenseErrorType.PermissionExpired\n }\n ),\n lease: serverPermission.lease\n };\n case ServerPermissionSubmitResultStatus.PayloadCorrupted:\n return {\n error: new SDKError(\n ErrorTypes.licenseErrors.licensePayloadCorrupted,\n {\n type: LicenseErrorType.PayloadCorrupted\n }\n ),\n lease: serverPermission.lease\n };\n case ServerPermissionSubmitResultStatus.PayloadSignatureVerificationFailed:\n return {\n error: new SDKError(\n ErrorTypes.licenseErrors.licensePayloadVerificationFailed,\n {\n type: LicenseErrorType.PayloadSignatureVerificationFailed\n }\n ),\n lease: serverPermission.lease\n };\n case ServerPermissionSubmitResultStatus.IncorrectTokenState:\n return {\n error: new SDKError(\n ErrorTypes.licenseErrors.licenseTokenStateIncorrect,\n {\n type: LicenseErrorType.IncorrectTokenState\n }\n ),\n lease: serverPermission.lease\n };\n }\n }\n }\n}\n/* eslint-enable @typescript-eslint/no-explicit-any,\n @typescript-eslint/explicit-module-boundary-types,\n @typescript-eslint/no-unsafe-member-access,\n @typescript-eslint/no-unsafe-call\n*/\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { Point, Quadrilateral } from \"./Geometry\";\n\n/**\n * Interface representing possible events that can occur during image processing.\n * All functions in this interface are optional and will be called only if they are\n * implemented.\n */\nexport interface MetadataCallbacks\n{\n /**\n * Called when recognition process wants to display some debug text information.\n * @param debugTest Debug text information to be displayed.\n */\n onDebugText?( debugTest: string ): void\n\n /**\n * Called when all recognizers in RecognizerRunner have failed to detect anything on the image.\n */\n onDetectionFailed?(): void\n\n /**\n * Called when recognition process wants to display some quadrilateral.\n * @param quad Quadrilateral to be displayed.\n */\n onQuadDetection?( quad: DisplayableQuad ): void\n\n /**\n * Called when recognition process wants to display some points.\n * @param pointSet Points to be displayed.\n */\n onPointsDetection?( pointSet: DisplayablePoints ): void\n\n /**\n * Called when first side recognition with the combined recognizer completes.\n */\n onFirstSideResult?(): void\n\n /**\n * Called when glare detection has completed with result whether glare has been found or not.\n * @param hasGlare indicates whether glare has been found on the input image or not\n */\n onGlare?( hasGlare: boolean ): void;\n}\n\n/**\n * Detection status of the specific detected object.\n */\nexport enum DetectionStatus\n{\n /** Detection failed, form not detected */\n Fail = 0,\n /** Object was successfully detected */\n Success,\n /** Object detected, but the camera is too far above it */\n CameraTooHigh,\n /** Fallback detection of an object was successful */\n FallbackSuccess,\n /** Object is detected, but parts of it are not in image */\n Partial,\n /** Object detected, but camera is at too big angle */\n CameraAtAngle,\n /** Object detected, but the camera is too near to it */\n CameraTooNear,\n /** Document detected, but document is too close to the edge of the frame */\n DocumentTooCloseToEdge\n}\n\n/**\n * Interface representing any displayable object.\n */\nexport interface Displayable\n{\n /** Detection status of the displayable object. */\n detectionStatus: DetectionStatus\n\n /**\n * 3x3 transformation matrix from the image's coordinate system to view's coordinate system.\n */\n transformMatrix: Float32Array\n}\n\n/**\n * Interface representing quadrilateral in image.\n */\nexport interface DisplayableQuad extends Displayable, Quadrilateral\n{}\n\n/**\n * Interface representing list of points in image.\n */\nexport interface DisplayablePoints extends Displayable\n{\n /** Array of points */\n points: Point[]\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport\n{\n bindCameraToVideoFeed,\n PreferredCameraType,\n clearVideoFeed,\n selectCamera,\n SelectedCamera\n} from \"./CameraUtils\";\n\nimport\n{\n RecognizerRunner,\n RecognizerResultState\n} from \"./DataStructures\";\nimport { SDKError } from \"./SDKError\";\n\nimport { captureFrame } from \"./FrameCapture\";\n\nimport * as ErrorTypes from \"./ErrorTypes\";\n\n/**\n * Explanation why VideoRecognizer has failed to open the camera feed.\n */\nexport enum NotSupportedReason\n{\n /** navigator.mediaDevices.getUserMedia is not supported by current browser for current context. */\n MediaDevicesNotSupported = \"MediaDevicesNotSupported\",\n /** Camera with requested features is not available on current device. */\n CameraNotFound = \"CameraNotFound\",\n /** Camera access was not granted by the user. */\n CameraNotAllowed = \"CameraNotAllowed\",\n /** Unable to start playing because camera is already in use. */\n CameraInUse = \"CameraInUse\",\n /** Camera is currently not available due to a OS or hardware error. */\n CameraNotAvailable = \"CameraNotAvailable\",\n /** There is no provided video element to which the camera feed should be redirected. */\n VideoElementNotProvided = \"VideoElementNotProvided\"\n}\n\n/**\n * Indicates mode of recognition in VideoRecognizer.\n */\nexport enum VideoRecognitionMode\n{\n /** Normal recognition */\n Recognition,\n /** Indefinite scan. Useful for profiling the performance of scan (using onDebugText metadata callback) */\n RecognitionTest,\n /** Only detection. Useful for profiling the performance of detection (using onDebugText metadata callback) */\n DetectionTest\n}\n\n/**\n * Invoked when VideoRecognizer finishes the recognition of the video stream.\n * @param recognitionState The state of recognition after finishing. If RecognizerResultState.Empty or\n * RecognizerResultState.Empty are returned, this indicates that the scanning\n * was cancelled or timeout has been reached.\n */\nexport type OnScanningDone = ( recognitionState: RecognizerResultState ) => Promise< void > | void;\n\n/**\n * A wrapper around RecognizerRunner that can use it to perform recognition of video feeds - either from live camera or\n * from predefined video file.\n */\nexport class VideoRecognizer\n{\n /**\n * Creates a new VideoRecognizer by opening a camera stream and attaching it to given HTMLVideoElement. If camera\n * cannot be accessed, the returned promise will be rejected.\n *\n * @param cameraFeed HTMLVideoELement to which camera stream should be attached\n * @param recognizerRunner RecognizerRunner that should be used for video stream recognition\n * @param cameraId User can provide specific camera ID to be selected and used\n * @param preferredCameraType Whether back facing or front facing camera is preferred. Obeyed only if there is\n * a choice (i.e. if device has only front-facing camera, the opened camera will be a front-facing camera,\n * regardless of preference)\n */\n static async createVideoRecognizerFromCameraStream\n (\n cameraFeed: HTMLVideoElement,\n recognizerRunner: RecognizerRunner,\n cameraId: string | null = null,\n preferredCameraType: PreferredCameraType = PreferredCameraType.BackFacingCamera\n ): Promise< VideoRecognizer >\n {\n // TODO: refactor this function into async/await syntax, instead of reject use throw\n /* eslint-disable */\n return new Promise< VideoRecognizer >\n (\n async ( resolve, reject ) =>\n {\n // Check for tag name intentionally left out, so it's possible to use VideoRecognizer with custom elements.\n if ( !cameraFeed || !( cameraFeed instanceof Element ) )\n {\n reject( new SDKError(\n ErrorTypes.videoRecognizerErrors.elementMissing,\n {\n reason: NotSupportedReason.VideoElementNotProvided,\n }\n ) );\n return;\n }\n if ( navigator.mediaDevices && navigator.mediaDevices.getUserMedia !== undefined )\n {\n try\n {\n const selectedCamera = await selectCamera( cameraId, preferredCameraType );\n\n if ( selectedCamera === null )\n {\n reject( new SDKError(\n ErrorTypes.videoRecognizerErrors.cameraMissing,\n {\n reason: NotSupportedReason.CameraNotFound,\n }\n ) );\n return;\n }\n\n const cameraFlipped = await bindCameraToVideoFeed( selectedCamera, cameraFeed, preferredCameraType );\n\n // TODO: await maybe not needed here\n await recognizerRunner.setCameraPreviewMirrored( cameraFlipped );\n resolve( new VideoRecognizer(\n cameraFeed,\n recognizerRunner,\n cameraFlipped,\n false,\n selectedCamera.deviceId\n ) );\n }\n catch( error )\n {\n let errorReason = NotSupportedReason.CameraInUse;\n let errorCode = ErrorTypes.ErrorCodes.VIDEO_RECOGNIZER_CAMERA_IN_USE;\n switch( error.name )\n {\n case \"NotFoundError\":\n case \"OverconstrainedError\":\n errorReason = NotSupportedReason.CameraNotFound;\n errorCode = ErrorTypes.ErrorCodes.VIDEO_RECOGNIZER_CAMERA_MISSING;\n break;\n case \"NotAllowedError\":\n case \"SecurityError\":\n errorReason = NotSupportedReason.CameraNotAllowed;\n errorCode = ErrorTypes.ErrorCodes.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED;\n break;\n case \"AbortError\":\n case \"NotReadableError\":\n errorReason = NotSupportedReason.CameraNotAvailable;\n errorCode = ErrorTypes.ErrorCodes.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE;\n break;\n case \"TypeError\": // this should never happen. If it does, rethrow it\n throw error;\n }\n reject( new SDKError(\n {\n message: error.message,\n code: errorCode,\n },\n {\n reason: errorReason,\n }\n ) );\n }\n }\n else\n {\n reject( new SDKError(\n ErrorTypes.videoRecognizerErrors.mediaDevicesUnsupported,\n {\n reason: NotSupportedReason.MediaDevicesNotSupported\n }\n ) );\n }\n }\n );\n /* eslint-enable */\n }\n\n /**\n * Creates a new VideoRecognizer by attaching the given URL to video to given HTMLVideoElement and using it to\n * display video frames while processing them.\n *\n * @param videoPath URL of the video file that should be recognized.\n * @param videoFeed HTMLVideoElement to which video file will be attached\n * @param recognizerRunner RecognizerRunner that should be used for video stream recognition.\n */\n static async createVideoRecognizerFromVideoPath\n (\n videoPath : string,\n videoFeed : HTMLVideoElement,\n recognizerRunner : RecognizerRunner\n ): Promise< VideoRecognizer >\n {\n return new Promise\n (\n ( resolve: ( videoRecognizer: VideoRecognizer ) => void ) =>\n {\n videoFeed.src = videoPath;\n videoFeed.currentTime = 0;\n videoFeed.onended = () =>\n {\n videoRecognizer.cancelRecognition();\n };\n const videoRecognizer = new VideoRecognizer( videoFeed, recognizerRunner );\n resolve( videoRecognizer );\n }\n );\n }\n\n /**\n * **Use only if provided factory functions are not well-suited for your use case.**\n *\n * Creates a new VideoRecognizer with provided HTMLVideoElement.\n *\n * Keep in mind that HTMLVideoElement **must have** a video feed which is ready to use.\n *\n * - If you want to take advantage of provided camera management, use `createVideoRecognizerFromCameraStream`\n * - In case that static video file should be processed, use `createVideoRecognizerFromVideoPath`\n *\n * @param videoFeed HTMLVideoElement with video feed which is going to be processed\n * @param recognizerRunner RecognizerRunner that should be used for video stream recognition\n * @param cameraFlipped Whether the camera is flipped, e.g. if front-facing camera is used\n * @param allowManualVideoPlayout Whether to allow manual video playout. Default value is `false`\n */\n constructor\n (\n videoFeed: HTMLVideoElement,\n recognizerRunner: RecognizerRunner,\n cameraFlipped = false,\n allowManualVideoPlayout = false,\n deviceId: string | null = null\n )\n {\n this.videoFeed = videoFeed;\n this.recognizerRunner = recognizerRunner;\n this.cameraFlipped = cameraFlipped;\n this.allowManualVideoPlayout = allowManualVideoPlayout;\n this.deviceId = deviceId;\n }\n\n deviceId: string | null = null;\n\n async flipCamera(): Promise< void >\n {\n if ( this.videoFeed )\n {\n if ( !this.cameraFlipped )\n {\n this.videoFeed.style.transform = \"scaleX(-1)\";\n this.cameraFlipped = true;\n }\n else\n {\n this.videoFeed.style.transform = \"scaleX(1)\";\n this.cameraFlipped = false;\n }\n\n await this.recognizerRunner.setCameraPreviewMirrored( this.cameraFlipped );\n }\n }\n\n isCameraFlipped(): boolean\n {\n return this.cameraFlipped;\n }\n\n /**\n * Sets the video recognition mode to be used.\n *\n * @param videoRecognitionMode the video recognition mode to be used.\n */\n async setVideoRecognitionMode( videoRecognitionMode: VideoRecognitionMode ): Promise< void >\n {\n this.videoRecognitionMode = videoRecognitionMode;\n const isDetectionMode = this.videoRecognitionMode === VideoRecognitionMode.DetectionTest;\n await this.recognizerRunner.setDetectionOnlyMode( isDetectionMode );\n }\n\n /**\n * Starts the recognition of the video stream associated with this VideoRecognizer. The stream will be unpaused and\n * recognition loop will start. After recognition completes, a onScanningDone callback will be invoked with state of\n * the recognition.\n *\n * NOTE: As soon as the execution of the callback completes, the recognition loop will continue and recognition\n * state will be retained. To clear the recognition state, use resetRecognizers (within your callback). To\n * pause the recognition loop, use pauseRecognition (within your callback) - to resume it later use\n * resumeRecognition. To completely stop the recognition and video feed, while keeping the ability to use this\n * VideoRecognizer later, use pauseVideoFeed. To completely stop the recognition and video feed and release\n * all the resources involved with video stream, use releaseVideoFeed.\n *\n * @param onScanningDone Callback that will be invoked when recognition completes.\n * @param recognitionTimeoutMs Amount of time before returned promise will be resolved regardless of whether\n * recognition was successful or not.\n */\n startRecognition( onScanningDone: OnScanningDone, recognitionTimeoutMs = 20000 ): Promise< void >\n {\n return new Promise( ( resolve, reject ) =>\n {\n if ( this.videoFeed === null )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.videoFeedReleased ) );\n return;\n }\n if ( !this.videoFeed.paused )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.videoFeedNotPaused ) );\n return;\n }\n\n this.cancelled = false;\n this.recognitionPaused = false;\n this.clearTimeout();\n this.recognitionTimeoutMs = recognitionTimeoutMs;\n this.onScanningDone = onScanningDone;\n void this.recognizerRunner.setClearTimeoutCallback( { onClearTimeout: () => this.clearTimeout() } );\n this.videoFeed.play().then\n (\n () => this.playPauseEvent().then\n (\n () => resolve()\n ).catch\n (\n ( error ) => reject( error )\n ),\n /* eslint-disable @typescript-eslint/no-explicit-any */\n ( nativeError: any ) =>\n {\n if ( !this.allowManualVideoPlayout )\n {\n reject\n (\n new SDKError( ErrorTypes.videoRecognizerErrors.playRequestInterrupted, nativeError )\n );\n return;\n }\n\n if ( !this.videoFeed )\n {\n return;\n }\n\n this.videoFeed.controls = true;\n this.videoFeed.addEventListener\n (\n \"play\" ,\n () => void this.playPauseEvent().then().catch( ( error ) => reject( error ) )\n );\n this.videoFeed.addEventListener\n (\n \"pause\",\n () => void this.playPauseEvent().then().catch( ( error ) => reject( error ) )\n );\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n );\n } );\n }\n\n /**\n * Performs the recognition of the video stream associated with this VideoRecognizer. The stream will be\n * unpaused, recognition will be performed and promise will be resolved with recognition status. After\n * the resolution of returned promise, the video stream will be paused, but not released. To release the\n * stream, use function releaseVideoFeed.\n *\n * This is a simple version of startRecognition that should be used for most cases, like when you only need\n * to perform one scan per video session.\n *\n * @param recognitionTimeoutMs Amount of time before returned promise will be resolved regardless of whether\n * recognition was successful or not.\n */\n recognize( recognitionTimeoutMs = 20000 ): Promise< RecognizerResultState >\n {\n return new Promise\n (\n ( resolve: ( recognitionStatus: RecognizerResultState ) => void, reject ) =>\n {\n try\n {\n void this.startRecognition\n (\n ( recognitionState: RecognizerResultState ) =>\n {\n this.pauseVideoFeed();\n resolve( recognitionState );\n },\n recognitionTimeoutMs\n ).then\n (\n // Do nothing, callback is used for resolving\n ).catch\n (\n ( error ) => reject( error )\n );\n }\n catch ( error )\n {\n reject( error );\n }\n }\n );\n }\n\n /**\n * Cancels current ongoing recognition. Note that after cancelling the recognition, the callback given to\n * startRecognition will be immediately called. This also means that the promise returned from method\n * recognize will be resolved immediately.\n */\n cancelRecognition(): void\n {\n this.cancelled = true;\n }\n\n /**\n * Pauses the video feed. You can resume the feed by calling recognize or startRecognition.\n * Note that this pauses both the camera feed and recognition. If you just want to pause\n * recognition, while keeping the camera feed active, call method pauseRecognition.\n */\n pauseVideoFeed(): void\n {\n this.pauseRecognition();\n\n if ( this.videoFeed )\n {\n this.videoFeed.pause();\n }\n }\n\n /**\n * Pauses the recognition. This means that video frames that arrive from given video source\n * will not be recognized. To resume recognition, call resumeRecognition(boolean).\n * Unlike cancelRecognition, the callback given to startRecognition will not be invoked after pausing\n * the recognition (unless there is already processing in-flight that may call the callback just before\n * pausing the actual recognition loop).\n */\n pauseRecognition(): void\n {\n this.recognitionPaused = true;\n }\n\n /**\n * Convenience method for invoking resetRecognizers on associated RecognizerRunner.\n * @param hardReset Same as in RecognizerRunner.resetRecognizers.\n */\n async resetRecognizers( hardReset: boolean ): Promise< void >\n {\n await this.recognizerRunner.resetRecognizers( hardReset );\n }\n\n /**\n * Convenience method for accessing RecognizerRunner associated with this VideoRecognizer.\n * Sometimes it's useful to reconfigure RecognizerRunner while handling onScanningDone callback\n * and this method makes that much more convenient.\n */\n getRecognizerRunner(): RecognizerRunner\n {\n return this.recognizerRunner;\n }\n\n /**\n * Resumes the recognition. The video feed must not be paused. If it is, an error will be thrown.\n * If video feed is paused, you should use recognize or startRecognition methods.\n * @param resetRecognizers Indicates whether resetRecognizers should be invoked while resuming the recognition\n */\n resumeRecognition( resetRecognizers: boolean ): Promise< void >\n {\n return new Promise( ( resolve, reject ) =>\n {\n this.cancelled = false;\n this.timedOut = false;\n this.recognitionPaused = false;\n\n if ( this.videoFeed && this.videoFeed.paused )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.feedPaused ) );\n return;\n }\n\n setTimeout\n (\n () =>\n {\n if ( resetRecognizers )\n {\n this.resetRecognizers( true ).then\n (\n () =>\n {\n this.recognitionLoop().then\n (\n () => resolve()\n ).catch\n (\n ( error ) => reject( error )\n );\n }\n ).catch\n (\n () =>\n {\n reject( new SDKError(\n ErrorTypes.videoRecognizerErrors.recognizersResetFailure\n ) );\n }\n );\n }\n else\n {\n void this.recognitionLoop().then\n (\n () => resolve()\n ).catch\n (\n ( error ) => reject( error )\n );\n }\n },\n 1\n );\n } );\n }\n\n /**\n * Stops all media stream tracks associated with current HTMLVideoElement and removes any references to it.\n * Note that after calling this method you can no longer use this VideoRecognizer for recognition.\n * This method should be called after you no longer plan on performing video recognition to let browser know\n * that it can release resources related to any media streams used.\n */\n releaseVideoFeed(): void\n {\n if ( !this.videoFeed || this.videoFeed?.readyState < this.videoFeed?.HAVE_CURRENT_DATA )\n {\n this.shouldReleaseVideoFeed = true;\n return;\n }\n\n if ( !this.videoFeed.paused )\n {\n this.cancelRecognition();\n }\n\n clearVideoFeed( this.videoFeed );\n this.videoFeed = null;\n this.shouldReleaseVideoFeed = false;\n }\n\n /**\n * Change currently used camera device for recognition. To get list of available camera devices\n * use \"getCameraDevices\" method.\n *\n * Keep in mind that this method will reset recognizers.\n *\n * @param camera Desired camera device which should be used for recognition.\n */\n changeCameraDevice( camera: SelectedCamera ): Promise< void >\n {\n return new Promise( ( resolve, reject ) =>\n {\n if ( this.videoFeed === null )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.feedMissing ) );\n return;\n }\n\n this.pauseRecognition();\n clearVideoFeed( this.videoFeed );\n\n bindCameraToVideoFeed( camera, this.videoFeed ).then\n (\n () =>\n {\n if ( this.videoFeed === null )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.feedMissing ) );\n return;\n }\n\n this.videoFeed.play().then\n (\n () =>\n {\n // Recognition errors should be handled by `startRecognition` or `recognize` method\n void this.resumeRecognition( true );\n resolve();\n },\n /* eslint-disable @typescript-eslint/no-explicit-any */\n ( nativeError: any ) =>\n {\n if ( !this.allowManualVideoPlayout )\n {\n reject(\n new SDKError(\n ErrorTypes.videoRecognizerErrors.playRequestInterrupted,\n nativeError\n )\n );\n return;\n }\n\n if ( !this.videoFeed )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.feedMissing ) );\n return;\n }\n\n this.videoFeed.controls = true;\n }\n /* eslint-enable @typescript-eslint/no-explicit-any */\n );\n }\n ).catch\n (\n ( error ) => reject( error )\n );\n } );\n }\n\n /** *********************************************************************************************\n * PRIVATE AREA\n */\n\n private videoFeed: HTMLVideoElement | null = null;\n\n private recognizerRunner: RecognizerRunner;\n\n private cancelled = false;\n\n private timedOut = false;\n\n private recognitionPaused = false;\n\n private recognitionTimeoutMs = 20000;\n\n private timeoutID = 0;\n\n private videoRecognitionMode: VideoRecognitionMode = VideoRecognitionMode.Recognition;\n\n private onScanningDone: OnScanningDone | null = null;\n\n private allowManualVideoPlayout = false;\n\n private cameraFlipped = false;\n\n private shouldReleaseVideoFeed = false;\n\n private playPauseEvent(): Promise< void >\n {\n return new Promise( ( resolve, reject ) =>\n {\n if ( this.videoFeed && this.videoFeed.paused )\n {\n this.cancelRecognition();\n resolve();\n return;\n }\n else\n {\n this.resumeRecognition( true ).then\n (\n () => resolve()\n ).catch\n (\n ( error ) => reject( error )\n );\n }\n\n } );\n }\n\n private recognitionLoop(): Promise< void >\n {\n return new Promise( ( resolve, reject ) =>\n {\n if ( !this.videoFeed )\n {\n reject( new SDKError( ErrorTypes.videoRecognizerErrors.feedMissing ) );\n return;\n }\n\n if ( this.shouldReleaseVideoFeed && this.videoFeed.readyState > this.videoFeed.HAVE_CURRENT_DATA )\n {\n this.releaseVideoFeed();\n resolve();\n return;\n }\n\n const cameraFrame = captureFrame( this.videoFeed );\n\n this.recognizerRunner.processImage( cameraFrame ).then\n (\n ( processResult: RecognizerResultState ) =>\n {\n const completeFn = () =>\n {\n if ( !this.recognitionPaused )\n {\n // ensure browser events are processed and then recognize another frame\n setTimeout( () =>\n {\n this.recognitionLoop().then\n (\n () => resolve()\n ).catch\n (\n ( error ) => reject( error )\n );\n }, 1 );\n }\n else\n {\n resolve();\n }\n };\n\n if ( processResult === RecognizerResultState.Valid || this.cancelled || this.timedOut )\n {\n if ( this.videoRecognitionMode === VideoRecognitionMode.Recognition || this.cancelled )\n {\n // valid results, clear the timeout and invoke the callback\n this.clearTimeout();\n if ( this.onScanningDone )\n {\n void this.onScanningDone( processResult );\n }\n // after returning from callback, resume scanning if not paused\n }\n else\n {\n // in test mode - reset the recognizers and continue the loop indefinitely\n this.recognizerRunner.resetRecognizers( true ).then\n (\n () =>\n {\n // clear any time outs\n this.clearTimeout();\n completeFn();\n }\n ).catch\n (\n ( error ) => reject( error )\n );\n return;\n }\n }\n else if ( processResult === RecognizerResultState.Uncertain )\n {\n if ( this.timeoutID === 0 )\n {\n // first non-empty result - start timeout\n this.timeoutID = window.setTimeout(\n () => { this.timedOut = true; },\n this.recognitionTimeoutMs\n );\n }\n completeFn();\n return;\n }\n else if ( processResult === RecognizerResultState.StageValid )\n {\n // stage recognition is finished, clear timeout and resume recognition\n this.clearTimeout();\n completeFn();\n return;\n }\n\n completeFn();\n }\n ).catch\n (\n ( error ) => reject( error )\n );\n } );\n }\n\n private clearTimeout()\n {\n if ( this.timeoutID > 0 )\n {\n window.clearTimeout( this.timeoutID );\n this.timeoutID = 0;\n }\n }\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { SDKError } from \"./SDKError\";\nimport { defaultWasmModuleName } from \"../defaultWasmModule\";\nimport { WasmType } from \"./WasmType\";\nimport * as ErrorTypes from \"./ErrorTypes\";\n\n/**\n * Function that will be called during loading of the SDK.\n * @param loadPercentage Number between 0 and 100 indicating the loading progress.\n */\nexport type LoadProgressCallback = ( loadPercentage: number ) => void;\n\nexport type OptionalLoadProgressCallback = LoadProgressCallback | null;\n\nexport { WasmType };\n\n/**\n * Settings object for function loadWasmModule.\n */\nexport class WasmSDKLoadSettings\n{\n /**\n * License key for unlocking the WebAssembly module. Bound to the domain name from which the application is served.\n */\n licenseKey: string;\n\n /**\n * Write a hello message to the browser console when license check is successfully performed.\n *\n * Hello message will contain the name and version of the SDK, which are required information for all support\n * tickets.\n *\n * The default value is true.\n */\n allowHelloMessage = true;\n\n /**\n * Absolute location of WASM and related JS/data files. Useful when resource files should be loaded over CDN, or\n * when web frameworks/libraries are used which store resources in specific locations, e.g. inside \"assets\" folder.\n *\n * Important: if the engine is hosted on another origin, CORS must be enabled between two hosts. That is, server\n * where engine is hosted must have 'Access-Control-Allow-Origin' header for the location of the web app.\n *\n * Important: SDK and WASM resources must be from the same version of a package.\n *\n * Default value is empty string, i.e. \"\". In case of empty string, value of \"window.location.origin\" property is\n * going to be used.\n */\n engineLocation = \"\";\n\n /**\n * Type of the WASM that will be loaded. By default, if not set, the SDK will automatically determine the best WASM\n * to load.\n */\n wasmType: WasmType | null = null;\n\n /**\n * Defines the number of workers that will be used for multi-threaded processing of the images. If not set, the\n * number of worker used will match the number of detected CPU cores on a device.\n *\n * If the browser does not support multi-threaded processing or it was deliberately disabled using the `wasmType`\n * property, then this property will be ignored.\n */\n numberOfWorkers: number | null = null;\n\n /**\n * Optional callback function that will report the SDK loading progress.\n *\n * This can be useful for displaying progress bar to users with slow connections.\n *\n * The default value is null.\n */\n loadProgressCallback: OptionalLoadProgressCallback = null;\n\n\n /**\n * Name of the file containing the WebAssembly module.\n *\n * Change this only if you have renamed the original WASM and its support JS file for your purposes.\n */\n wasmModuleName: string = defaultWasmModuleName;\n\n /**\n * @param licenseKey License key for unlocking the WebAssembly module.\n */\n constructor( licenseKey: string )\n {\n if ( !licenseKey )\n {\n throw new SDKError( ErrorTypes.sdkErrors.licenseKeyMissing );\n }\n this.licenseKey = licenseKey;\n }\n}\n","export const bigInt=()=>(async e=>{try{return(await WebAssembly.instantiate(e)).instance.exports.b(BigInt(0))===BigInt(0)}catch(e){return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,126,1,126,3,2,1,0,7,5,1,1,98,0,0,10,6,1,4,0,32,0,11])),bulkMemory=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),exceptions=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),multiValue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,0,2,127,127,3,2,1,0,10,8,1,6,0,65,0,65,0,11])),mutableGlobals=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,2,8,1,1,97,1,98,3,127,1,6,6,1,127,1,65,0,11,7,5,1,1,97,3,1])),referenceTypes=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,7,1,5,0,208,112,26,11])),saturatedFloatToInt=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,12,1,10,0,67,0,0,0,0,252,0,26,11])),signExtensions=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,65,0,192,26,11])),simd=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),tailCall=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,6,1,4,0,18,0,11])),threads=()=>(async e=>{try{return\"undefined\"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch(e){return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport * as WasmFeatureDetect from \"wasm-feature-detect\";\nimport { WasmType } from \"./WasmType\";\n\nexport async function detectWasmType( engineLocation: string ): Promise< WasmType >\n{\n // determine if all features required for advanced WASM are available\n // currently, advanced wasm requires bulk memory, non-trapping floating point\n // and sign extension (this may change in the future).\n\n const haveBulkMemory = await WasmFeatureDetect.bulkMemory();\n const haveNonTrappingFloatingPoint = await WasmFeatureDetect.saturatedFloatToInt();\n const haveSignExtension = await WasmFeatureDetect.signExtensions();\n const haveSIMD = await WasmFeatureDetect.simd();\n const haveThreads = await WasmFeatureDetect.threads();\n\n if ( haveBulkMemory && haveNonTrappingFloatingPoint && haveSignExtension && haveSIMD )\n {\n if ( haveThreads )\n {\n /* The external worker files are loaded by the Emscripten’s thread support code - each\n * worker represents a thread. It’s not currently possible to put all those workers\n * inline.\n *\n * Also, due to browser security rules, it's not possible to load external worker files\n * from a different origin.\n *\n * Therefore, we need to ensure that remote workers are accessible. For that reason,\n * there is a dummy `Worker.test.js` file. If that file is loaded successfully, we can\n * say that `AdvancedWithThreads` bundle is available.\n */\n try\n {\n const worker = new Worker( `${ engineLocation }/Worker.test.js` );\n worker.terminate();\n return WasmType.AdvancedWithThreads;\n }\n catch\n {\n return WasmType.Advanced;\n }\n }\n else\n {\n return WasmType.Advanced;\n }\n }\n else\n {\n return WasmType.Basic;\n }\n}\n\nexport function wasmFolder( wasmType: WasmType ): string\n{\n switch( wasmType )\n {\n case WasmType.AdvancedWithThreads: return \"advanced-threads\";\n case WasmType.Advanced : return \"advanced\";\n case WasmType.Basic : return \"basic\";\n }\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { WasmSDKWorker } from \"./worker/WorkerSDKBackend\";\nimport { Recognizer, RecognizerRunner, WasmSDK } from \"./DataStructures\";\nimport { MetadataCallbacks } from \"./MetadataCallbacks\";\nimport { WasmSDKLoadSettings } from \"./WasmLoadSettings\";\n\n\nimport { SDKError } from \"./SDKError\";\nimport * as ErrorTypes from \"./ErrorTypes\";\n\nexport * from \"./CameraUtils\";\nexport * from \"./DataStructures\";\nexport * from \"./DeviceUtils\";\nexport * from \"./ErrorTypes\";\nexport * from \"./FrameCapture\";\nexport * from \"./License\";\nexport * from \"./MetadataCallbacks\";\nexport * from \"./SDKError\";\nexport * from \"./VideoRecognizer\";\nexport * from \"./WasmLoadSettings\";\nexport * from \"./WasmLoadUtils\";\n\n// taken from https://stackoverflow.com/a/2117523/213057\n/* eslint-disable */\nfunction uuidv4(): string\n{\n return ( ( [1e7] as any )+-1e3+-4e3+-8e3+-1e11 ).replace( /[018]/g, ( c: any ) =>\n ( c ^ crypto.getRandomValues( new Uint8Array( 1 ) )[0] & 15 >> c / 4 ).toString( 16 )\n );\n}\n/* eslint-enable */\n\nfunction getUserID(): string\n{\n try\n {\n let userId = localStorage.getItem( \"mb-user-id\" );\n if ( userId === null )\n {\n userId = uuidv4();\n localStorage.setItem( \"mb-user-id\", userId );\n }\n return userId;\n }\n catch ( error )\n {\n // local storage is disabled, generate new user ID every time\n return uuidv4();\n }\n}\n\n\n/**\n * Asynchronously loads and compiles the WebAssembly module.\n * @param loadSettings Object defining the settings for loading the WebAssembly module.\n * @returns Promise that resolves if WebAssembly module was successfully loaded and rejects if not.\n */\n/* eslint-disable @typescript-eslint/no-explicit-any,\n @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-unsafe-member-access,\n @typescript-eslint/no-unsafe-call */\nexport async function loadWasmModule( loadSettings: WasmSDKLoadSettings ): Promise< any >\n{\n return new Promise< any >\n (\n ( resolve, reject ) =>\n {\n if ( !loadSettings || typeof loadSettings !== \"object\" )\n {\n reject( new SDKError( ErrorTypes.sdkErrors.wasmSettingsMissing ) );\n return;\n }\n if ( typeof loadSettings.licenseKey !== \"string\" )\n {\n reject( new SDKError( ErrorTypes.sdkErrors.licenseKeyMissing ) );\n return;\n }\n if ( !loadSettings.wasmModuleName )\n {\n reject( new SDKError( ErrorTypes.sdkErrors.wasmModuleNameMissing ) );\n return;\n }\n if ( typeof loadSettings.engineLocation !== \"string\" )\n {\n reject( new SDKError( ErrorTypes.sdkErrors.engineLocationInvalid ) );\n return;\n }\n // obtain user ID from local storage\n const userId = getUserID();\n\n\n try\n {\n const blob = new Blob( [ String.raw`@PLACEHOLDER:worker` ], { type: \"application/javascript\" } );\n const url = URL.createObjectURL( blob );\n const worker = new Worker( url );\n\n WasmSDKWorker.createWasmWorker( worker, loadSettings, userId ).then\n (\n wasmSDK =>\n {\n resolve( wasmSDK );\n },\n reject\n );\n }\n catch ( initError )\n {\n reject( initError );\n }\n }\n );\n}\n/* eslint-enable @typescript-eslint/no-explicit-any,\n @typescript-eslint/no-unsafe-assignment,\n @typescript-eslint/no-unsafe-member-access,\n @typescript-eslint/no-unsafe-call */\n\n/**\n * Function for creating a new RecognizerRunner.\n * Note that it is currently not possible to have multiple instances of RecognizerRunner per instance of WasmSDK.\n * Attempt to create new instance of RecognizerRunner prior deleting the previous one will fail.\n * @param wasmSDK Instance of WasmSDK which will be used to communicate with the WebAssembly module.\n * @param recognizers Array of recognizers that will be used by RecognizerRunner.\n * @param allowMultipleResults Whether or not it is allowed to return multiple results from single recognition session.\n * See README.md for more information.\n * @param metadataCallbacks\n */\nexport async function createRecognizerRunner\n(\n wasmSDK: WasmSDK,\n recognizers: Array< Recognizer >,\n allowMultipleResults = false,\n metadataCallbacks: MetadataCallbacks = {}\n): Promise< RecognizerRunner >\n{\n if ( typeof wasmSDK !== \"object\" )\n {\n throw new SDKError( ErrorTypes.sdkErrors.missing );\n }\n if ( typeof recognizers !== \"object\" || recognizers.length < 1 )\n {\n throw new SDKError( ErrorTypes.sdkErrors.recognizersMissing );\n }\n return wasmSDK.mbWasmModule.createRecognizerRunner( recognizers, allowMultipleResults, metadataCallbacks );\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport\n{\n Recognizer,\n RecognizerResult,\n WasmSDK,\n ImageOrientation\n} from \"../MicroblinkSDK/DataStructures\";\n\n/**\n * The result object of the SuccessFrameGrabberRecognizer.\n */\nexport interface SuccessFrameGrabberRecognizerResult extends RecognizerResult\n{\n /**\n * Camera frame on which given recognizer's result ha become valid.\n * If given recognizer's result never became valid, contains null.\n */\n readonly successFrame: ImageData | null;\n\n /**\n * Orientation of the success frame.\n */\n readonly frameOrientation: ImageOrientation;\n}\n\n/**\n * Recognizer that can wrap another recognizer and capture the frame on which\n * the wrapped recognizer has succeeded to recognize.\n */\nexport interface SuccessFrameGrabberRecognizer< T extends Recognizer > extends Recognizer\n{\n /**\n * Reference to recognizer that is being wrapped by this\n * SuccessFrameGrabberRecognizer.\n */\n readonly wrappedRecognizer: T;\n\n /**\n * Returns the current result of the recognition. Note that result will not\n * contain the result of the wrapped recognizer. To obtain that result, call\n * getResult on wrapped recognizer.\n */\n getResult(): Promise< SuccessFrameGrabberRecognizerResult >;\n\n /**\n * Cleans up the object from the WebAssembly heap.\n */\n delete(): Promise< void >;\n}\n\n/**\n * Creates a new instance of `SuccessFrameGrabberRecognizer`.\n * @param wasmSDK Instance of WasmSDK which will be used to communicate with the\n * WebAssembly module.\n * @param slaveRecognizer Instance of Recognizer that will be wrapped.\n */\nexport async function createSuccessFrameGrabberRecognizer< T extends Recognizer >\n(\n wasmSDK: WasmSDK,\n slaveRecognizer: T\n): Promise< SuccessFrameGrabberRecognizer < T > >\n{\n // taken from https://stackoverflow.com/a/53615996\n const sfgr = await wasmSDK.mbWasmModule.newRecognizer\n (\n \"SuccessFrameGrabberRecognizer\",\n slaveRecognizer\n ) as SuccessFrameGrabberRecognizer< T >;\n type MutableSFGR = {\n -readonly [ K in keyof SuccessFrameGrabberRecognizer< T > ]: SuccessFrameGrabberRecognizer< T >[ K ]\n }\n const mutableSFGR: MutableSFGR = sfgr;\n mutableSFGR.wrappedRecognizer = slaveRecognizer;\n return sfgr;\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/**\n * Possible formats of barcodes that can be detected. This enum will be returned\n * as part of BarcodeRecognizerResult interface.\n */\nexport enum BarcodeFormat\n{\n /** Indicates that no barcode has been detected. */\n NONE = 0,\n /** Indicates that QR code has been detected. */\n QR_CODE,\n /** Indicates that Data Matrix 2D barcode has been detected. */\n DATA_MATRIX,\n /** Indicates that UPC E 1D barcode has been detected. */\n UPC_E,\n /** Indicates that UPC A 1D barcode has been detected. */\n UPC_A,\n /** Indicates that EAN 8 1D barcode has been detected. */\n EAN_8,\n /** Indicates that EAN 13 1D barcode has been detected. */\n EAN_13,\n /** Indicates that Code 128 1D barcode has been detected. */\n CODE_128,\n /** Indicates that Code 39 1D barcode has been detected. */\n CODE_39,\n /** Indicates that ITF 1D barcode has been detected. */\n ITF,\n /** Indicates that Aztec 2D barcode has been detected. */\n AZTEC_BARCODE,\n /** Indicates that PDF417 2D barcode has been detected. */\n PDF417_BARCODE\n}\n\n/**\n * Data extracted from barcode.\n */\nexport interface BarcodeData\n{\n /** Format of recognized barcode. */\n readonly barcodeFormat: BarcodeFormat;\n\n /**\n * True if returned result is uncertain, i.e. if scanned barcode was incomplete (i.e.\n * (has parts of it missing).\n */\n readonly uncertain: boolean;\n\n /** String representation of data inside barcode. */\n readonly stringData: string;\n\n /** The raw bytes contained inside barcode. */\n readonly rawBytes: Uint8Array;\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/**\n * AnonymizationMode is used to define level of anonymization\n * performed on recognizer result.\n */\nexport enum AnonymizationMode\n{\n /**\n * Anonymization will not be performed.\n */\n None = 0,\n\n /**\n * FullDocumentImage is anonymized with black boxes\n * covering sensitive data.\n */\n ImageOnly,\n\n /**\n * Result fields containing sensitive data are removed from result.\n */\n ResultFieldsOnly,\n\n /**\n * This mode is combination of ImageOnly and ResultFieldsOnly modes.\n */\n FullResult\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n *\n * RecognitionModeFilter is used to enable/disable recognition of specific document groups.\n * Setting is taken into account only if the right for that document is purchased.\n */\nexport class RecognitionModeFilter\n{\n /** Enable scanning of MRZ IDs. Setting is taken into account only if the mrz_id right is purchased. */\n enableMrzId = true\n\n /** Enable scanning of Passport MRZ. Setting is taken into account only if the passport right is purchased. */\n enableMrzPassport = true\n\n /** Enable scanning of visa MRZ. Setting is taken into account only if the visa right is purchased. */\n enableMrzVisa = true\n\n /** Enable scanning of Photo ID. Setting is taken into account only if the photo_id right is purchased. */\n enablePhotoId = true\n\n /**\n * Enable scanning of barcode IDs. Setting is taken into account only if the barcode right to\n * scan that barcode is purchased.\n */\n enableBarcodeId = true\n\n /**\n * Enable full document recognition. Setting is taken into account only if the document right to\n * scan that document is purchased.\n */\n enableFullDocumentRecognition = true\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { ImageOrientation } from \"../../MicroblinkSDK/DataStructures\";\n\n/**\n * Extension factors relative to corresponding dimension of the full image. For example,\n * {@code upFactor} and {@code downFactor} define extensions relative to image height, e.g.\n * when {@code upFactor} is 0.5, upper image boundary will be extended for half of image's full\n * height.\n *\n * ._______________________________________.\n * | ↑ |\n * | upFactor |\n * .________. | .________. |\n * | | --> | ⃖ leftFactor | | rightFactor ⃗ |\n * |________| | |________| |\n * | ↓ |\n * | downFactor |\n * |_______________________________________|\n *\n */\nexport class ExtensionFactors\n{\n /**\n * Currently used image extension factor relative to full image height in UP direction.\n */\n readonly upFactor: number = 0.0;\n\n /**\n * Currently used image extension factor relative to full image height in DOWN direction.\n */\n readonly downFactor: number = 0.0;\n\n /**\n * Currently used image extension factor relative to full image height in LEFT direction.\n */\n readonly leftFactor: number = 0.0;\n\n /**\n * Currently used image extension factor relative to full image height in RIGHT direction.\n */\n readonly rightFactor: number = 0.0;\n\n /**\n * Constructor which accepts image extension factors which must be in range [-1.0f, 1.0f].\n * @param upFactor image extension factor relative to full image height in UP direction\n * @param downFactor image extension factor relative to full image height in DOWN direction\n * @param leftFactor image extension factor relative to full image width in LEFT direction\n * @param rightFactor image extension factor relative to full image width in RIGHT direction\n */\n constructor\n (\n upFactor = 0.0,\n downFactor = 0.0,\n leftFactor = 0.0,\n rightFactor = 0.0\n )\n {\n this.checkExtensionFactor( upFactor );\n this.checkExtensionFactor( downFactor );\n this.checkExtensionFactor( leftFactor );\n this.checkExtensionFactor( rightFactor );\n this.upFactor = upFactor;\n this.downFactor = downFactor;\n this.leftFactor = leftFactor;\n this.rightFactor = rightFactor;\n }\n\n private checkExtensionFactor( factor: number )\n {\n if ( factor > 1.0 || factor < -1.0 )\n {\n throw new Error( \"Extension factor must be in range [-1.0, 1.0]\" );\n }\n }\n}\n\nexport interface GlareDetectorOptions\n{\n /**\n * Defines whether glare detector will be used during recognition process. By default this\n * option is set to {@code true} and glare detector is used. If the glare detector is used and\n * `onGlare` is implemented in {@link MetadataCallbacks} interface,\n * it will receive glare status. Also when glare is detected OCR will not be performed on\n * the affected document position to prevent errors in the extracted data.\n */\n detectGlare: boolean;\n}\n\nexport interface FullDocumentImageOptions\n{\n /**\n * If enabled, the result will contain dewarped image of the document.\n */\n returnFullDocumentImage: boolean;\n\n /**\n * If enabled, the result will contain JPEG-encoded image of the document.\n */\n returnEncodedFullDocumentImage: boolean;\n\n /**\n * The DPI (Dots Per Inch) for full document image in cases when it\n * should be returned. It applies for both encoded and non-encoded versions.\n */\n fullDocumentImageDpi: number;\n\n /**\n * extension factors for full document image.\n */\n fullDocumentImageExtensionFactors: ExtensionFactors;\n}\n\nexport interface FaceImageOptions\n{\n /**\n * If enabled, the result will contain dewarped image of the face.\n */\n returnFaceImage: boolean;\n\n /**\n * If enabled, the result will contain JPEG-encoded image of the face.\n */\n returnEncodedFaceImage: boolean;\n\n /**\n * The DPI (Dots Per Inch) for face image in cases when it\n * should be returned. It applies for both encoded and non-encoded versions.\n */\n faceImageDpi: number;\n}\n\nexport interface SignatureImageOptions\n{\n /**\n * If enabled, the result will contain dewarped image of the signature.\n */\n returnSignatureImage: boolean;\n\n /**\n * If enabled, the result will contain JPEG-encoded image of the signature.\n */\n returnEncodedSignatureImage: boolean;\n\n /**\n * The DPI (Dots Per Inch) for signature image in cases when it\n * should be returned. It applies for both encoded and non-encoded versions.\n */\n signatureImageDpi: number;\n}\n\nexport function validateDpi( dpi: number ): void\n{\n if ( dpi < 100 || dpi > 400 )\n {\n throw new Error( \"DPI must be from interval [100, 400]\" );\n }\n}\n\nexport interface ImageResult\n{\n /**\n * Contains the original image that can be drawn to canvas.\n */\n readonly rawImage: ImageData | null;\n\n /**\n * Contains the JPEG-encoded bytes of the image.\n */\n readonly encodedImage: Uint8Array | null;\n}\n\nexport interface CameraFrameResult\n{\n /**\n * Contains both original image and JPEG-encoded bytes of the image.\n */\n readonly frame: ImageResult | null;\n\n /** Orientation of the captured frame */\n readonly orientation: ImageOrientation;\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { AddressDetailedInfo } from \"./AddressDetailedInfo\";\nimport { BarcodeData } from \"../../BlinkBarcode/BarcodeData\";\nimport { DriverLicenseDetailedInfo } from \"./DriverLicenseDetailedInfo\";\nimport { MBDate } from \"../../../MicroblinkSDK/DataStructures\";\n\n/**\n * BarcodeResult contains data extracted from the barcode.\n */\nexport interface BarcodeResult\n{\n /** The raw, unparsed barcode data. */\n readonly barcodeData : BarcodeData;\n\n /** The first name of the document owner. */\n readonly firstName: string;\n /** The middle name of the document owner. */\n readonly middleName: string;\n /** The last name of the document owner. */\n readonly lastName: string;\n /** The full name of the document owner. */\n readonly fullName: string;\n /** The additional name information of the document owner. */\n readonly additionalNameInformation: string;\n\n /** The address of the document owner. */\n readonly address: string;\n /** The place of birth of the document owner. */\n readonly placeOfBirth: string;\n /** The nationality of the document owner. */\n readonly nationality: string;\n\n /** The race of the document owner. */\n readonly race: string;\n /** The religion of the document owner. */\n readonly religion: string;\n /** The profession of the document owner. */\n readonly profession: string;\n /** The marital status of the document owner. */\n readonly maritalStatus: string;\n /** The residential status of the document owner. */\n readonly residentialStatus: string;\n /** The employer of the document owner. */\n readonly employer: string;\n /** The sex of the document owner. */\n readonly sex: string;\n\n /** The date of birth of the document owner. */\n readonly dateOfBirth: MBDate;\n /** The date of issue of the document. */\n readonly dateOfIssue: MBDate;\n /** The date of expiry of the document. */\n readonly dateOfExpiry: MBDate;\n\n /** The document number. */\n readonly documentNumber: string;\n /** The personal identification number. */\n readonly personalIdNumber: string;\n /** The additional number of the document. */\n readonly documentAdditionalNumber: string;\n /** The issuing authority of the document. */\n readonly issuingAuthority: string;\n\n /** The details about the address of the document owner. */\n readonly addressDetailedInfo: AddressDetailedInfo;\n\n /* The driver license detailed info. */\n readonly driverLicenseDetailedInfo: DriverLicenseDetailedInfo;\n\n /* Whether the result is empty */\n readonly empty: boolean;\n\n /**\n * Document specific extended elements that contain all barcode fields in their original form.\n * The indices of specific data within the array are given by the BarcodeElementKey enum.\n *\n * For example, to obtain the first name you can use extendedElements[BarcodeElementKey.CustomerFirstName].\n *\n * Currently this is only filled for AAMVACompliant documents.\n */\n readonly extendedElements: Array<string>;\n}\n\n/**\n* Enum defining additional fields present in the barcode.\n* Currently this is only used for AAMVACompliant documents.\n*/\nexport enum BarcodeElementKey\n{\n\n // ==============================================================/\n // ============== 1. DETERMINING BARCODE VERSION ================/\n // ==============================================================/\n\n /**\n Mandatory on all driver's licenses. All barcodes which are using 3-track magnetic\n stripe encoding used in the interest of smoothing a transition from legacy documents\n shall be designated as \"Magnetic\". All barcodes which are using compact encoding\n compliant with ISO/IEC 18013-2 shall be designated as \"Compact\". All barcodes (majority)\n compliant with Mandatory PDF417 Bar Code of the American Association of Motor Vehicle\n Administrators (AAMVA) Card Design Standard from AAMVA DL/ID-2000 standard to DL/ID-2013\n shall be designated as \"AAMVA\".\n */\n DocumentType = 0,\n\n /**\n Mandatory on all driver's licenses.\n\n AAMVA Version Number: This is a decimal value between 0 and 99 that\n specifies the version level of the PDF417 bar code format. Version \"0\" and \"00\"\n is reserved for bar codes printed to the specification of the American Association\n of Motor Vehicle Administrators (AAMVA) prior to the adoption of the AAMVA DL/ID-2000\n standard.\n\n - All barcodes compliant with AAMVA DL/ID-2000 standard shall be designated Version \"01.\"\n - All barcodes compliant with AAMVA Card Design Specification version 1.0, dated 09-2003\n shall be designated Version \"02.\"\n - All barcodes compliant with AAMVA Card Design Specification version 2.0, dated 03-2005\n shall be designated Version \"03.\"\n - All barcodes compliant with AAMVA Card Design Standard version 1.0, dated 07-2009\n shall be designated Version \"04.\"\n - All barcodes compliant with AAMVA Card Design Standard version 1.0, dated 07-2010\n shall be designated Version \"05.\"\n - All barcodes compliant with AAMVA Card Design Standard version 1.0, dated 07-2011\n shall be designated Version \"06\".\n - All barcodes compliant with AAMVA Card Design Standard version 1.0, dated 06-2012\n shall be designated Version \"07\".\n - All barcodes compliant with this current AAMVA standard shall be designated \"08\".\n\n Should a need arise requiring major revision to the format, this field provides the\n means to accommodate additional revision.\n\n If the document type is not \"AAMVA\", this field defines the version number of the\n given document type's standard.\n */\n StandardVersionNumber,\n\n // ==============================================================/\n // ========== 2. PERSONAL DATA KEYS ===========/\n // ==============================================================/\n\n /**\n Mandatory on all AAMVA, Magnetic and Compact barcodes.\n\n Family name of the cardholder. (Family name is sometimes also called \"last name\" or \"surname.\")\n Collect full name for record, print as many characters as possible on portrait side of DL/ID.\n */\n CustomerFamilyName,\n\n /**\n Mandatory on all AAMVA, Magnetic and Compact barcodes.\n\n First name of the cardholder.\n */\n CustomerFirstName,\n\n /**\n Mandatory on all AAMVA, Magnetic and Compact barcodes.\n\n Full name of the individual holding the Driver's License or ID.\n\n The Name field contains up to four portions, separated with the \",\" delimiter:\n Last Name (required)\n , (required)\n First Name (required)\n , (required if other name portions follow, otherwise optional)\n Middle Name(s) (optional)\n , (required if other name portions follow, otherwise optional)\n Suffix (optional)\n , (optional)\n\n If the individual has more than one middle name they are separated with space.\n */\n CustomerFullName,\n\n /**\n Mandatory on all AAMVA, Magnetic and Compact barcodes.\n\n Date on which the cardholder was born. (MMDDCCYY format)\n */\n DateOfBirth,\n\n /**\n Mandatory on all AAMVA, Magnetic barcodes.\n Optional on Compact barcodes.\n\n Gender of the cardholder. 1 = male, 2 = female.\n */\n Sex,\n\n /**\n Mandatory on AAMVA 02, 03, 04, 05, 06, 07, 08 barcodes.\n Optional on AAMVA 01, Magnetic and Compact barcodes.\n\n Color of cardholder's eyes. (ANSI D-20 codes)\n\n Code Description\n BLK Black\n BLU Blue\n BRO Brown\n GRY Gray\n GRN Green\n HAZ Hazel\n MAR Maroon\n PNK Pink\n DIC Dichromatic\n UNK Unknown\n */\n EyeColor,\n\n /**\n Mandatory on all AAMVA and Magnetic barcodes.\n\n On compact barcodes, use kFullAddress.\n\n Street portion of the cardholder address.\n The place where the registered driver of a vehicle (individual or corporation)\n may be contacted such as a house number, street address, etc.\n */\n AddressStreet,\n\n /**\n Mandatory on all AAMVA and Magnetic barcodes.\n\n On compact barcodes, use kFullAddress.\n\n City portion of the cardholder address.\n */\n AddressCity,\n\n /**\n Mandatory on all AAMVA and Magnetic barcodes.\n\n On compact barcodes, use kFullAddress.\n\n State portion of the cardholder address.\n */\n AddressJurisdictionCode,\n\n /**\n Mandatory on all AAMVA and Magnetic barcodes.\n\n On compact barcodes, use FullAddress.\n\n Postal code portion of the cardholder address in the U.S. and Canada. If the\n trailing portion of the postal code in the U.S. is not known, zeros can be used\n to fill the trailing set of numbers up to nine (9) digits.\n */\n AddressPostalCode,\n\n /**\n Mandatory on all AAMVA and Magnetic barcodes.\n Optional on Compact barcodes.\n\n Full address of the individual holding the Driver's License or ID.\n\n The full address field contains up to four portions, separated with the \",\" delimiter:\n Street Address (required)\n , (required if other address portions follow, otherwise optional)\n City (optional)\n , (required if other address portions follow, otherwise optional)\n Jurisdiction Code (optional)\n , (required if other address portions follow, otherwise optional)\n ZIP - Postal Code (optional)\n\n */\n FullAddress,\n\n /**\n Mandatory on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n Optional on AAMVA 01 and Magnetic barcodes.\n\n Height of cardholder, either in Inches or in Centimeters.\n\n Inches (in): number of inches followed by \" in\"\n example: 6'1'' = \"73 in\"\n\n Centimeters (cm): number of centimeters followed by \" cm\"\n example: 181 centimeters = \"181 cm\"\n */\n Height,\n\n /**\n Mandatory on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n Optional on AAMVA 01 and Magnetic barcodes.\n\n Height of cardholder in Inches.\n Example: 5'9'' = \"69\".\n */\n HeightIn,\n\n /**\n Mandatory on AAMVA 02, 03, 04, 05, 06, 07, 08 Compact barcodes.\n Optional on AAMVA 01 and Magnetic barcodes.\n\n Height of cardholder in Centimeters.\n Example: 180 Centimeters = \"180\".\n */\n HeightCm,\n\n /**\n Mandatory on AAMVA 04, 05, 06, 07, 08 barcodes.\n Optional on AAMVA 01, 02, 03, Magnetic and Compcat barcodes.\n\n Middle name(s) of the cardholder. In the case of multiple middle names they\n shall be separated by space \" \".\n */\n CustomerMiddleName,\n\n /**\n Optional on all AAMVA, Magnetic and Compact barcodes.\n\n Bald, black, blonde, brown, gray, red/auburn, sandy, white, unknown. If the issuing\n jurisdiction wishes to abbreviate colors, the three-character codes provided in ANSI D20 must be\n used.\n\n Code Description\n BAL Bald\n BLK Black\n BLN Blond\n BRO Brown\n GRY Grey\n RED Red/Auburn\n SDY Sandy\n WHI White\n UNK Unknown\n */\n HairColor,\n\n /**\n Mandatory on AAMVA 02 barcodes.\n Optional on AAMVA 01, 03, 04, 05, 06, 07, 08, Magnetic and Compact barcodes.\n\n Name Suffix (If jurisdiction participates in systems requiring name suffix (PDPS, CDLIS, etc.),\n the suffix must be collected and displayed on the DL/ID and in the MRT).\n - JR (Junior)\n - SR (Senior)\n - 1ST or I (First)\n - 2ND or II (Second)\n - 3RD or III (Third)\n - 4TH or IV (Fourth)\n - 5TH or V (Fifth)\n - 6TH or VI (Sixth)\n - 7TH or VII (Seventh)\n - 8TH or VIII (Eighth)\n - 9TH or IX (Ninth)\n */\n NameSuffix,\n\n /**\n Optional on all AAMVA and Compact barcodes.\n\n Other name by which the cardholder is known. ALTERNATIVE NAME(S) of the individual\n holding the Driver License or ID.\n\n The Name field contains up to four portions, separated with the \",\" delimiter:\n AKA Last Name (required)\n , (required)\n AKA First Name (required)\n , (required if other name portions follow, otherwise optional)\n AKA Middle Name(s) (optional)\n , (required if other name portions follow, otherwise optional)\n AKA Suffix (optional)\n , (optional)\n\n If the individual has more than one AKA middle name they are separated with space.\n */\n AKAFullName,\n\n /**\n Optional on all AAMVA and Compact barcodes.\n\n Other family name by which the cardholder is known.\n */\n AKAFamilyName,\n\n /**\n Optional on all AAMVA and Compact barcodes.\n\n Other given name by which the cardholder is known\n */\n AKAGivenName,\n\n /**\n Optional on all AAMVA and Compact barcodes.\n\n Other suffix by which the cardholder is known.\n\n The Suffix Code Portion, if submitted, can contain only the Suffix Codes shown in the following\n table (e.g., Andrew Johnson, III = JOHNSON@ANDREW@@3RD):\n\n Suffix Meaning or Synonym\n JR Junior\n SR Senior or Esquire 1ST First\n 2ND Second\n 3RD Third\n 4TH Fourth\n 5TH Fifth\n 6TH Sixth\n 7TH Seventh\n 8TH Eighth\n 9TH Ninth\n */\n AKASuffixName,\n\n /**\n Mandatory on AAMVA 02 barcodes.\n Optional on AAMVA 01, 03, 04, 05, 06, 07, 08, Magnetic and Compact barcodes.\n\n Indicates the approximate weight range of the cardholder:\n 0 = up to 31 kg (up to 70 lbs)\n 1 = 32 – 45 kg (71 – 100 lbs)\n 2 = 46 - 59 kg (101 – 130 lbs)\n 3 = 60 - 70 kg (131 – 160 lbs)\n 4 = 71 - 86 kg (161 – 190 lbs)\n 5 = 87 - 100 kg (191 – 220 lbs)\n 6 = 101 - 113 kg (221 – 250 lbs)\n 7 = 114 - 127 kg (251 – 280 lbs)\n 8 = 128 – 145 kg (281 – 320 lbs)\n 9 = 146+ kg (321+ lbs)\n */\n WeightRange,\n\n /**\n Mandatory on AAMVA 02 barcodes.\n Optional on AAMVA 01, 03, 04, 05, 06, 07, 08, Magnetic and Compact barcodes.\n\n Cardholder weight in pounds Example: 185 lb = \"185\"\n */\n WeightPounds,\n\n /**\n Mandatory on AAMVA 02 barcodes.\n Optional on AAMVA 01, 03, 04, 05, 06, 07, 08, Magnetic and Compact barcodes.\n\n Cardholder weight in kilograms Example: 84 kg = \"084\"\n */\n WeightKilograms,\n\n /**\n Mandatory on all AAMVA and Compact barcodes.\n\n The number assigned or calculated by the issuing authority.\n */\n CustomerIdNumber,\n\n /**\n Mandatory on AAMVA 04, 05, 06, 07, 08 barcodes.\n Optional on Compact barcodes.\n\n A code that indicates whether a field has been truncated (T), has not been\n truncated (N), or – unknown whether truncated (U).\n */\n FamilyNameTruncation,\n\n /**\n Mandatory on AAMVA 04, 05, 06, 07, 08 barcodes.\n Optional on Compact barcodes.\n\n A code that indicates whether a field has been truncated (T), has not been\n truncated (N), or – unknown whether truncated (U).\n */\n FirstNameTruncation,\n\n /**\n Mandatory on AAMVA 04, 05, 06, 07, 08 barcodes.\n\n A code that indicates whether a field has been truncated (T), has not been\n truncated (N), or – unknown whether truncated (U).\n */\n MiddleNameTruncation,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n Country and municipality and/or state/province.\n */\n PlaceOfBirth,\n\n /**\n Optional on all AAMVA barcodes.\n\n On Compact barcodes, use kFullAddress.\n\n Second line of street portion of the cardholder address.\n */\n AddressStreet2,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n Codes for race or ethnicity of the cardholder, as defined in ANSI D20.\n\n Race:\n Code Description\n AI Alaskan or American Indian (Having Origins in Any of The Original Peoples of\n North America, and Maintaining Cultural Identification Through Tribal\n Affiliation of Community Recognition)\n AP Asian or Pacific Islander (Having Origins in Any of the Original Peoples of\n the Far East, Southeast Asia, or Pacific Islands. This Includes China, India,\n Japan, Korea, the Philippines Islands, and Samoa)\n BK Black (Having Origins in Any of the Black Racial Groups of Africa)\n W White (Having Origins in Any of The Original Peoples of Europe, North Africa,\n or the Middle East)\n\n Ethnicity:\n Code Description\n H Hispanic Origin (A Person of Mexican, Puerto Rican, Cuban, Central or South\n American or Other Spanish Culture or Origin, Regardless of Race)\n O Not of Hispanic Origin (Any Person Other Than Hispanic)\n U Unknown\n\n */\n RaceEthnicity,\n\n /**\n Optional on AAMVA 01 barcodes.\n\n PREFIX to Driver Name. Freeform as defined by issuing jurisdiction.\n */\n NamePrefix,\n\n /**\n Mandatory on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n Country in which DL/ID is issued. U.S. = USA, Canada = CAN.\n */\n CountryIdentification,\n\n /**\n Optional on AAMVA version 01.\n\n Driver Residence Street Address 1.\n */\n ResidenceStreetAddress,\n\n /**\n Optional on AAMVA version 01.\n\n Driver Residence Street Address 2.\n */\n ResidenceStreetAddress2,\n\n /**\n Optional on AAMVA version 01.\n\n Driver Residence City\n */\n ResidenceCity,\n\n /**\n Optional on AAMVA version 01.\n\n Driver Residence Jurisdiction Code.\n */\n ResidenceJurisdictionCode,\n\n /**\n Optional on AAMVA 01 barcodes.\n\n Driver Residence Postal Code.\n */\n ResidencePostalCode,\n\n /**\n Optional on AAMVA 01 barcodes.\n\n Full residence address of the individual holding the Driver's License or ID.\n\n The full address field contains up to four portions, separated with the \",\" delimiter:\n Residence Street Address (required)\n , (required if other address portions follow, otherwise optional)\n Residence City (optional)\n , (required if other address portions follow, otherwise optional)\n Residence Jurisdiction Code (optional)\n , (required if other address portions follow, otherwise optional)\n Residence ZIP - Residence Postal Code (optional)\n */\n ResidenceFullAddress,\n\n /**\n Optional on AAMVA 05, 06, 07, 08 barcodes.\n\n Date on which the cardholder turns 18 years old. (MMDDCCYY format)\n */\n Under18,\n\n /**\n Optional on AAMVA 05, 06, 07, 08 barcodes.\n\n Date on which the cardholder turns 19 years old. (MMDDCCYY format)\n */\n Under19,\n\n /**\n Optional on AAMVA 05, 06, 07, 08 barcodes.\n\n Date on which the cardholder turns 21 years old. (MMDDCCYY format)\n */\n Under21,\n\n /**\n Optional on AAMVA version 01.\n\n The number assigned to the individual by the Social Security Administration.\n */\n SocialSecurityNumber,\n\n /**\n Optional on AAMVA version 01.\n\n Driver \"AKA\" Social Security Number. FORMAT SAME AS DRIVER SOC SEC NUM. ALTERNATIVE NUMBERS(S) used as SS NUM.\n */\n AKASocialSecurityNumber,\n\n /**\n Optional on AAMVA 01 barcodes.\n\n ALTERNATIVE MIDDLE NAME(s) or INITIALS of the individual holding the Driver License or ID.\n Hyphenated names acceptable, spaces between names acceptable, but no other\n use of special symbols.\n */\n AKAMiddleName,\n\n /**\n Optional on AAMVA 01 barcodes.\n\n ALTERNATIVE PREFIX to Driver Name. Freeform as defined by issuing jurisdiction.\n */\n AKAPrefixName,\n\n /**\n Optional on AAMVA 01, 06, 07, 08 barcodes.\n\n Field that indicates that the cardholder is an organ donor = \"1\".\n */\n OrganDonor,\n\n /**\n Optional on AAMVA 07, 08 barcodes.\n\n Field that indicates that the cardholder is a veteran = \"1\"\n */\n Veteran,\n\n /**\n Optional on AAMVA 01. (MMDDCCYY format)\n\n ALTERNATIVE DATES(S) given as date of birth.\n */\n AKADateOfBirth,\n\n\n // ==============================================================/\n // ========== 3. LICENSE DATA KEYS ============/\n // ==============================================================/\n\n /**\n Mandatory on all AAMVA, Magnetic and Compact barcodes.\n\n This number uniquely identifies the issuing jurisdiction and can\n be obtained by contacting the ISO Issuing Authority (AAMVA)\n */\n IssuerIdentificationNumber,\n\n /**\n Mandatory on all AAMVA, Magnetic and Compact barcodes.\n\n If the document is non expiring then \"Non expiring\" is written in this field.\n\n Date on which the driving and identification privileges granted by the document are\n no longer valid. (MMDDCCYY format)\n */\n DocumentExpirationDate,\n\n /**\n Mandatory on all AAMVA and Compact barcodes.\n Optional on Magnetic barcodes.\n\n Jurisdiction Version Number: This is a decimal value between 0 and 99 that\n specifies the jurisdiction version level of the PDF417 barcode format.\n Notwithstanding iterations of this standard, jurisdictions implement incremental\n changes to their barcodes, including new jurisdiction-specific data, compression\n algorithms for digitized images, digital signatures, or new truncation\n conventions used for names and addresses. Each change to the barcode format\n within each AAMVA version (above) must be noted, beginning with Jurisdiction\n Version 00.\n */\n JurisdictionVersionNumber,\n\n /**\n Mandatory on all AAMVA and Magnetic barcodes.\n\n Jurisdiction-specific vehicle class / group code, designating the type\n of vehicle the cardholder has privilege to drive.\n */\n JurisdictionVehicleClass,\n\n /**\n Mandatory on all AAMVA barcodes.\n Optional on Magnetic barcodes.\n\n Jurisdiction-specific codes that represent restrictions to driving\n privileges (such as airbrakes, automatic transmission, daylight only, etc.).\n */\n JurisdictionRestrictionCodes,\n\n /**\n Mandatory on all AAMVA barcodes.\n Optional on Magnetic barcodes.\n\n Jurisdiction-specific codes that represent additional privileges\n granted to the cardholder beyond the vehicle class (such as transportation of\n passengers, hazardous materials, operation of motorcycles, etc.).\n */\n JurisdictionEndorsementCodes,\n\n /**\n Mandatory on all AAMVA and Compact barcodes.\n\n Date on which the document was issued. (MMDDCCYY format)\n */\n DocumentIssueDate,\n\n /**\n Mandatory on AAMVA versions 02 and 03.\n\n Federally established codes for vehicle categories, endorsements, and restrictions\n that are generally applicable to commercial motor vehicles. If the vehicle is not a\n commercial vehicle, \"NONE\" is to be entered.\n */\n FederalCommercialVehicleCodes,\n\n /**\n Optional on all AAMVA barcodes.\n Mandatory on Compact barcodes.\n\n Jurisdictions may define a subfile to contain jurisdiction-specific information.\n These subfiles are designated with the first character of “Z” and the second\n character is the first letter of the jurisdiction's name. For example, \"ZC\" would\n be the designator for a California or Colorado jurisdiction-defined subfile, \"ZQ\"\n would be the designator for a Quebec jurisdiction-defined subfile. In the case of\n a jurisdiction-defined subfile that has a first letter that could be more than\n one jurisdiction (e.g. California, Colorado, Connecticut) then other data, like\n the IIN or address, must be examined to determine the jurisdiction.\n */\n IssuingJurisdiction,\n\n /**\n Optional on all AAMVA barcodes.\n Mandatory on Compact barcodes.\n\n Standard vehicle classification code(s) for cardholder. This data element is a\n placeholder for future efforts to standardize vehicle classifications.\n */\n StandardVehicleClassification,\n\n /**\n Optional on all AAMVA and Magnetic barcodes.\n\n Name of issuing jurisdiction, for example: Alabama, Alaska ...\n */\n IssuingJurisdictionName,\n\n /**\n Optional on all AAMVA barcodes.\n\n Standard endorsement code(s) for cardholder. See codes in D20. This data element is a\n placeholder for future efforts to standardize endorsement codes.\n\n Code Description\n H Hazardous Material - This endorsement is required for the operation of any vehicle\n transporting hazardous materials requiring placarding, as defined by U.S.\n Department of Transportation regulations.\n L Motorcycles – Including Mopeds/Motorized Bicycles.\n N Tank - This endorsement is required for the operation of any vehicle transporting,\n as its primary cargo, any liquid or gaseous material within a tank attached to the vehicle.\n O Other Jurisdiction Specific Endorsement(s) - This code indicates one or more\n additional jurisdiction assigned endorsements.\n P Passenger - This endorsement is required for the operation of any vehicle used for\n transportation of sixteen or more occupants, including the driver.\n S School Bus - This endorsement is required for the operation of a school bus. School bus means a\n CMV used to transport pre-primary, primary, or secondary school students from home to school,\n from school to home, or to and from school sponsored events. School bus does not include a\n bus used as common carrier (49 CRF 383.5).\n T Doubles/Triples - This endorsement is required for the operation of any vehicle that would be\n referred to as a double or triple.\n X Combined Tank/HAZ-MAT - This endorsement may be issued to any driver who qualifies for\n both the N and H endorsements.\n */\n StandardEndorsementCode,\n\n /**\n Optional on all AAMVA barcodes.\n\n Standard restriction code(s) for cardholder. See codes in D20. This data element is a placeholder\n for future efforts to standardize restriction codes.\n\n Code Description\n B Corrective Lenses\n C Mechanical Devices (Special Brakes, Hand Controls, or Other Adaptive Devices)\n D Prosthetic Aid\n E Automatic Transmission\n F Outside Mirror\n G Limit to Daylight Only\n H Limit to Employment\n I Limited Other\n J Other\n K CDL Intrastate Only\n L Vehicles without air brakes\n M Except Class A bus\n N Except Class A and Class B bus\n O Except Tractor-Trailer\n V Medical Variance Documentation Required\n W Farm Waiver\n */\n StandardRestrictionCode,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n Text that explains the jurisdiction-specific code(s) for classifications\n of vehicles cardholder is authorized to drive.\n */\n JurisdictionVehicleClassificationDescription,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n Text that explains the jurisdiction-specific code(s) that indicates additional\n driving privileges granted to the cardholder beyond the vehicle class.\n */\n JurisdictionEndorsmentCodeDescription,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n Text describing the jurisdiction-specific restriction code(s) that curtail driving privileges.\n */\n JurisdictionRestrictionCodeDescription,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 barcodes.\n\n A string of letters and/or numbers that is affixed to the raw materials (card stock,\n laminate, etc.) used in producing driver's licenses and ID cards. (DHS recommended field)\n */\n InventoryControlNumber,\n\n /**\n Optional on AAMVA 04, 05, 06, 07, 08 and Compact barcodes.\n\n DHS required field that indicates date of the most recent version change or\n modification to the visible format of the DL/ID. (MMDDCCYY format)\n */\n CardRevisionDate,\n\n /**\n Mandatory on AAMVA 02, 03, 04, 05, 06, 07, 08 and Magnetic barcodes.\n Optional and Compact barcodes.\n\n Number must uniquely identify a particular document issued to that customer\n from others that may have been issued in the past. This number may serve multiple\n purposes of document discrimination, audit information number, and/or inventory control.\n */\n DocumentDiscriminator,\n\n /**\n Optional on AAMVA 04, 05, 06, 07, 08 and Compact barcodes.\n\n DHS required field that indicates that the cardholder has temporary lawful status = \"1\".\n */\n LimitedDurationDocument,\n\n /**\n Optional on AAMVA 02, 03, 04, 05, 06, 07, 08 and Compact barcodes.\n\n A string of letters and/or numbers that identifies when, where, and by whom a driver's\n license/ID card was made. If audit information is not used on the card or the MRT, it\n must be included in the driver record.\n */\n AuditInformation,\n\n /**\n Optional on AAMVA 04, 05, 06, 07, 08 and Compact barcodes.\n\n DHS required field that indicates compliance: \"M\" = materially compliant,\n \"F\" = fully compliant, and, \"N\" = non-compliant.\n */\n ComplianceType,\n\n /**\n Optional on AAMVA version 01 barcodes.\n\n Issue Timestamp. A string used by some jurisdictions to validate the document against their data base.\n */\n IssueTimestamp,\n\n /**\n Optional on AAMVA version 01 barcodes.\n\n Driver Permit Expiration Date. MMDDCCYY format. Date permit expires.\n */\n PermitExpirationDate,\n\n /**\n Optional on AAMVA version 01 barcodes..\n\n Type of permit.\n */\n PermitIdentifier,\n\n /**\n Optional on AAMVA version 01 barcodes..\n\n Driver Permit Issue Date. MMDDCCYY format. Date permit was issued.\n */\n PermitIssueDate,\n\n /**\n Optional on AAMVA version 01.\n\n Number of duplicate cards issued for a license or ID if any.\n */\n NumberOfDuplicates,\n\n /**\n Optional on AAMVA 04, 05, 06, 07, 08 and Compact barcodes.\n\n Date on which the hazardous material endorsement granted by the document is\n no longer valid. (MMDDCCYY format)\n */\n HAZMATExpirationDate,\n\n /**\n Optional on AAMVA version 01.\n\n Medical Indicator/Codes.\n STATE SPECIFIC. Freeform, Standard \"TBD\"\n */\n MedicalIndicator,\n\n /**\n Optional on AAMVA version 01.\n\n Non-Resident Indicator. \"Y\". Used by some jurisdictions to indicate holder of the document is a non-resident.\n */\n NonResident,\n\n /**\n Optional on AAMVA version 01.\n\n A number or alphanumeric string used by some jurisdictions to identify a \"customer\" across multiple data bases.\n */\n UniqueCustomerId,\n\n /**\n Optional on compact barcodes.\n\n Document discriminator.\n */\n DataDiscriminator,\n\n /**\n Optional on Magnetic barcodes.\n\n Month on which the driving and identification privileges granted by the document are\n no longer valid. (MMYY format)\n */\n DocumentExpirationMonth,\n\n /**\n Optional on Magnetic barcodes.\n\n Field that indicates that the driving and identification privileges granted by the\n document are nonexpiring = \"1\".\n */\n DocumentNonexpiring,\n\n /**\n Optional on Magnetic barcodes.\n\n Security version beeing used.\n */\n SecurityVersion,\n\n /**\n Number of keys in enum.\n */\n Count\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\nexport interface ClassInfo\n{\n /** The document country. */\n readonly country: Country;\n\n /** The document region. */\n readonly region: Region;\n\n /** The type of the scanned document. */\n readonly documentType: DocumentType;\n\n /** The ISO numeric code of the country that issued the scanned document. */\n readonly countryName?: string;\n\n /** The ISO numeric code of the country that issued the scanned document. */\n readonly isoNumericCountryCode?: string;\n\n /** The 2 letter ISO code of the country that issued the scanned document. */\n readonly isoAlpha2CountryCode?: string;\n\n /** The 3 letter ISO code of the country that issued the scanned document. */\n readonly isoAlpha3CountryCode?: string;\n}\n\nexport enum Country\n{\n NONE = 0,\n ALBANIA = 1,\n ALGERIA = 2,\n ARGENTINA = 3,\n AUSTRALIA = 4,\n AUSTRIA = 5,\n AZERBAIJAN = 6,\n BAHRAIN = 7,\n BANGLADESH = 8,\n BELGIUM = 9,\n BOSNIA_AND_HERZEGOVINA = 10,\n BRUNEI = 11,\n BULGARIA = 12,\n CAMBODIA = 13,\n CANADA = 14,\n CHILE = 15,\n COLOMBIA = 16,\n COSTA_RICA = 17,\n CROATIA = 18,\n CYPRUS = 19,\n CZECHIA = 20,\n DENMARK = 21,\n DOMINICAN_REPUBLIC = 22,\n EGYPT = 23,\n ESTONIA = 24,\n FINLAND = 25,\n FRANCE = 26,\n GEORGIA = 27,\n GERMANY = 28,\n GHANA = 29,\n GREECE = 30,\n GUATEMALA = 31,\n HONG_KONG = 32,\n HUNGARY = 33,\n INDIA = 34,\n INDONESIA = 35,\n IRELAND = 36,\n ISRAEL = 37,\n ITALY = 38,\n JORDAN = 39,\n KAZAKHSTAN = 40,\n KENYA = 41,\n KOSOVO = 42,\n KUWAIT = 43,\n LATVIA = 44,\n LITHUANIA = 45,\n MALAYSIA = 46,\n MALDIVES = 47,\n MALTA = 48,\n MAURITIUS = 49,\n MEXICO = 50,\n MOROCCO = 51,\n NETHERLANDS = 52,\n NEW_ZEALAND = 53,\n NIGERIA = 54,\n PAKISTAN = 55,\n PANAMA = 56,\n PARAGUAY = 57,\n PHILIPPINES = 58,\n POLAND = 59,\n PORTUGAL = 60,\n PUERTO_RICO = 61,\n QATAR = 62,\n ROMANIA = 63,\n RUSSIA = 64,\n SAUDI_ARABIA = 65,\n SERBIA = 66,\n SINGAPORE = 67,\n SLOVAKIA = 68,\n SLOVENIA = 69,\n SOUTH_AFRICA = 70,\n SPAIN = 71,\n SWEDEN = 72,\n SWITZERLAND = 73,\n TAIWAN = 74,\n THAILAND = 75,\n TUNISIA = 76,\n TURKEY = 77,\n UAE = 78,\n UGANDA = 79,\n UK = 80,\n UKRAINE = 81,\n USA = 82,\n VIETNAM = 83,\n BRAZIL = 84,\n NORWAY = 85,\n OMAN = 86,\n ECUADOR = 87,\n EL_SALVADOR = 88,\n SRI_LANKA = 89,\n PERU = 90,\n URUGUAY = 91,\n BAHAMAS = 92,\n BERMUDA = 93,\n BOLIVIA = 94,\n CHINA = 95,\n EUROPEAN_UNION = 96,\n HAITI = 97,\n HONDURAS = 98,\n ICELAND = 99,\n JAPAN = 100,\n LUXEMBOURG = 101,\n MONTENEGRO = 102,\n NICARAGUA = 103,\n SOUTH_KOREA = 104,\n VENEZUELA = 105,\n AFGHANISTAN = 106,\n ALAND_ISLANDS = 107,\n AMERICAN_SAMOA = 108,\n ANDORRA = 109,\n ANGOLA = 110,\n ANGUILLA = 111,\n ANTARCTICA = 112,\n ANTIGUA_AND_BARBUDA = 113,\n ARMENIA = 114,\n ARUBA = 115,\n BAILIWICK_OF_GUERNSEY = 116,\n BAILIWICK_OF_JERSEY = 117,\n BARBADOS = 118,\n BELARUS = 119,\n BELIZE = 120,\n BENIN = 121,\n BHUTAN = 122,\n BONAIRE_SAINT_EUSTATIUS_AND_SABA = 123,\n BOTSWANA = 124,\n BOUVET_ISLAND = 125,\n BRITISH_INDIAN_OCEAN_TERRITORY = 126,\n BURKINA_FASO = 127,\n BURUNDI = 128,\n CAMEROON = 129,\n CAPE_VERDE = 130,\n CARIBBEAN_NETHERLANDS = 131,\n CAYMAN_ISLANDS = 132,\n CENTRAL_AFRICAN_REPUBLIC = 133,\n CHAD = 134,\n CHRISTMAS_ISLAND = 135,\n COCOS_ISLANDS = 136,\n COMOROS = 137,\n CONGO = 138,\n COOK_ISLANDS = 139,\n CUBA = 140,\n CURACAO = 141,\n DEMOCRATIC_REPUBLIC_OF_THE_CONGO = 142,\n DJIBOUTI = 143,\n DOMINICA = 144,\n EAST_TIMOR = 145,\n EQUATORIAL_GUINEA = 146,\n ERITREA = 147,\n ETHIOPIA = 148,\n FALKLAND_ISLANDS = 149,\n FAROE_ISLANDS = 150,\n FEDERATED_STATES_OF_MICRONESIA = 151,\n FIJI = 152,\n FRENCH_GUIANA = 153,\n FRENCH_POLYNESIA = 154,\n FRENCH_SOUTHERN_TERRITORIES = 155,\n GABON = 156,\n GAMBIA = 157,\n GIBRALTAR = 158,\n GREENLAND = 159,\n GRENADA = 160,\n GUADELOUPE = 161,\n GUAM = 162,\n GUINEA = 163,\n GUINEA_BISSAU = 164,\n GUYANA = 165,\n HEARD_ISLAND_AND_MCDONALD_ISLANDS = 166,\n IRAN = 167,\n IRAQ = 168,\n ISLE_OF_MAN = 169,\n IVORY_COAST = 170,\n JAMAICA = 171,\n KIRIBATI = 172,\n KYRGYZSTAN = 173,\n LAOS = 174,\n LEBANON = 175,\n LESOTHO = 176,\n LIBERIA = 177,\n LIBYA = 178,\n LIECHTENSTEIN = 179,\n MACAU = 180,\n MADAGASCAR = 181,\n MALAWI = 182,\n MALI = 183,\n MARSHALL_ISLANDS = 184,\n MARTINIQUE = 185,\n MAURITANIA = 186,\n MAYOTTE = 187,\n MOLDOVA = 188,\n MONACO = 189,\n MONGOLIA = 190,\n MONTSERRAT = 191,\n MOZAMBIQUE = 192,\n MYANMAR = 193,\n NAMIBIA = 194,\n NAURU = 195,\n NEPAL = 196,\n NEW_CALEDONIA = 197,\n NIGER = 198,\n NIUE = 199,\n NORFOLK_ISLAND = 200,\n NORTHERN_CYPRUS = 201,\n NORTHERN_MARIANA_ISLANDS = 202,\n NORTH_KOREA = 203,\n NORTH_MACEDONIA = 204,\n PALAU = 205,\n PALESTINE = 206,\n PAPUA_NEW_GUINEA = 207,\n PITCAIRN = 208,\n REUNION = 209,\n RWANDA = 210,\n SAINT_BARTHELEMY = 211,\n SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA = 212,\n SAINT_KITTS_AND_NEVIS = 213,\n SAINT_LUCIA = 214,\n SAINT_MARTIN = 215,\n SAINT_PIERRE_AND_MIQUELON = 216,\n SAINT_VINCENT_AND_THE_GRENADINES = 217,\n SAMOA = 218,\n SAN_MARINO = 219,\n SAO_TOME_AND_PRINCIPE = 220,\n SENEGAL = 221,\n SEYCHELLES = 222,\n SIERRA_LEONE = 223,\n SINT_MAARTEN = 224,\n SOLOMON_ISLANDS = 225,\n SOMALIA = 226,\n SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS = 227,\n SOUTH_SUDAN = 228,\n SUDAN = 229,\n SURINAME = 230,\n SVALBARD_AND_JAN_MAYEN = 231,\n ESWATINI = 232,\n SYRIA = 233,\n TAJIKISTAN = 234,\n TANZANIA = 235,\n TOGO = 236,\n TOKELAU = 237,\n TONGA = 238,\n TRINIDAD_AND_TOBAGO = 239,\n TURKMENISTAN = 240,\n TURKS_AND_CAICOS_ISLANDS = 241,\n TUVALU = 242,\n UNITED_STATES_MINOR_OUTLYING_ISLANDS = 243,\n UZBEKISTAN = 244,\n VANUATU = 245,\n VATICAN_CITY = 246,\n VIRGIN_ISLANDS_BRITISH = 247,\n VIRGIN_ISLANDS_US = 248,\n WALLIS_AND_FUTUNA = 249,\n WESTERN_SAHARA = 250,\n YEMEN = 251,\n YUGOSLAVIA = 252,\n ZAMBIA = 253,\n ZIMBABWE = 254,\n COUNT = 255,\n}\n\nexport enum Region\n{\n NONE = 0,\n ALABAMA = 1,\n ALASKA = 2,\n ALBERTA = 3,\n ARIZONA = 4,\n ARKANSAS = 5,\n AUSTRALIAN_CAPITAL_TERRITORY = 6,\n BRITISH_COLUMBIA = 7,\n CALIFORNIA = 8,\n COLORADO = 9,\n CONNECTICUT = 10,\n DELAWARE = 11,\n DISTRICT_OF_COLUMBIA = 12,\n FLORIDA = 13,\n GEORGIA = 14,\n HAWAII = 15,\n IDAHO = 16,\n ILLINOIS = 17,\n INDIANA = 18,\n IOWA = 19,\n KANSAS = 20,\n KENTUCKY = 21,\n LOUISIANA = 22,\n MAINE = 23,\n MANITOBA = 24,\n MARYLAND = 25,\n MASSACHUSETTS = 26,\n MICHIGAN = 27,\n MINNESOTA = 28,\n MISSISSIPPI = 29,\n MISSOURI = 30,\n MONTANA = 31,\n NEBRASKA = 32,\n NEVADA = 33,\n NEW_BRUNSWICK = 34,\n NEW_HAMPSHIRE = 35,\n NEW_JERSEY = 36,\n NEW_MEXICO = 37,\n NEW_SOUTH_WALES = 38,\n NEW_YORK = 39,\n NORTHERN_TERRITORY = 40,\n NORTH_CAROLINA = 41,\n NORTH_DAKOTA = 42,\n NOVA_SCOTIA = 43,\n OHIO = 44,\n OKLAHOMA = 45,\n ONTARIO = 46,\n OREGON = 47,\n PENNSYLVANIA = 48,\n QUEBEC = 49,\n QUEENSLAND = 50,\n RHODE_ISLAND = 51,\n SASKATCHEWAN = 52,\n SOUTH_AUSTRALIA = 53,\n SOUTH_CAROLINA = 54,\n SOUTH_DAKOTA = 55,\n TASMANIA = 56,\n TENNESSEE = 57,\n TEXAS = 58,\n UTAH = 59,\n VERMONT = 60,\n VICTORIA = 61,\n VIRGINIA = 62,\n WASHINGTON = 63,\n WESTERN_AUSTRALIA = 64,\n WEST_VIRGINIA = 65,\n WISCONSIN = 66,\n WYOMING = 67,\n YUKON = 68,\n CIUDAD_DE_MEXICO = 69,\n JALISCO = 70,\n NEWFOUNDLAND_AND_LABRADOR = 71,\n NUEVO_LEON = 72,\n BAJA_CALIFORNIA = 73,\n CHIHUAHUA = 74,\n GUANAJUATO = 75,\n GUERRERO = 76,\n MEXICO = 77,\n MICHOACAN = 78,\n NEW_YORK_CITY = 79,\n TAMAULIPAS = 80,\n VERACRUZ = 81,\n CHIAPAS = 82,\n COAHUILA = 83,\n DURANGO = 84,\n GUERRERO_COCULA = 85,\n GUERRERO_JUCHITAN = 86,\n GUERRERO_TEPECOACUILCO = 87,\n GUERRERO_TLACOAPA = 88,\n GUJARAT = 89,\n HIDALGO = 90,\n KARNATAKA = 91,\n KERALA = 92,\n KHYBER_PAKHTUNKHWA = 93,\n MADHYA_PRADESH = 94,\n MAHARASHTRA = 95,\n MORELOS = 96,\n NAYARIT = 97,\n OAXACA = 98,\n PUEBLA = 99,\n PUNJAB = 100,\n QUERETARO = 101,\n SAN_LUIS_POTOSI = 102,\n SINALOA = 103,\n SONORA = 104,\n TABASCO = 105,\n TAMIL_NADU = 106,\n YUCATAN = 107,\n ZACATECAS = 108,\n AGUASCALIENTES = 109,\n BAJA_CALIFORNIA_SUR = 110,\n CAMPECHE = 111,\n COLIMA = 112,\n QUINTANA_ROO_BENITO_JUAREZ = 113,\n UINTANA_ROO = 114,\n QUINTANA_ROO_SOLIDARIDAD = 115,\n TLAXCALA = 116,\n COUNT = 117,\n}\n\nexport enum DocumentType\n{\n NONE = 0,\n CONSULAR_ID = 1,\n DL = 2,\n DL_PUBLIC_SERVICES_CARD = 3,\n EMPLOYMENT_PASS = 4,\n FIN_CARD = 5,\n ID = 6,\n MULTIPURPOSE_ID = 7,\n MyKad = 8,\n MyKid = 9,\n MyPR = 10,\n MyTentera = 11,\n PAN_CARD = 12,\n PROFESSIONAL_ID = 13,\n PUBLIC_SERVICES_CARD = 14,\n RESIDENCE_PERMIT = 15,\n RESIDENT_ID = 16,\n TEMPORARY_RESIDENCE_PERMIT = 17,\n VOTER_ID = 18,\n WORK_PERMIT = 19,\n iKAD = 20,\n MILITARY_ID = 21,\n MyKAS = 22,\n SOCIAL_SECURITY_CARD = 23,\n HEALTH_INSURANCE_CARD = 24,\n PASSPORT = 25,\n S_PASS = 26,\n ADDRESS_CARD = 27,\n ALIEN_ID = 28,\n ALIEN_PASSPORT = 29,\n GREEN_CARD = 30,\n MINORS_ID = 31,\n POSTAL_ID = 32,\n PROFESSIONAL_DL = 33,\n TAX_ID = 34,\n WEAPON_PERMIT = 35,\n VISA = 36,\n BORDER_CROSSING_CARD = 37,\n DRIVER_CARD = 38,\n GLOBAL_ENTRY_CARD = 39,\n MyPolis = 40,\n NEXUS_CARD = 41,\n PASSPORT_CARD = 42,\n PROOF_OF_AGE_CARD = 43,\n REFUGEE_ID = 44,\n TRIBAL_ID = 45,\n VETERAN_ID = 46,\n CITIZENSHIP_CERTIFICATE = 47,\n MY_NUMBER_CARD = 48,\n COUNT = 49,\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nexport interface ImageAnalysisResult\n{\n /**\n * Whether the image is blurred.\n */\n readonly blurred: boolean;\n\n /**\n * The color status determined from scanned image.\n */\n readonly documentImageColorStatus: DocumentImageColorStatus;\n\n /**\n * The Moire pattern detection status determined from the scanned image.\n */\n readonly documentImageMoireStatus: ImageAnalysisDetectionStatus;\n\n /**\n * Face detection status determined from the scanned image.\n */\n readonly faceDetectionStatus: ImageAnalysisDetectionStatus;\n\n /**\n * Mrz detection status determined from the scanned image.\n */\n readonly mrzDetectionStatus: ImageAnalysisDetectionStatus;\n\n /**\n * Barcode detection status determined from the scanned image.\n */\n readonly barcodeDetectionStatus: ImageAnalysisDetectionStatus;\n}\n\n/**\n * DocumentImageColorStatus enum defines possible color statuses determined from scanned image.\n */\nexport enum DocumentImageColorStatus\n{\n /** Determining image color status was not performed */\n NotAvailable = 0,\n\n /** Black-and-white image scanned */\n BlackAndWhite,\n\n /** Color image scanned */\n Color\n}\n\n/**\n * ImageAnalysisDetectionStatus enum defines possible states of specific image object detection.\n */\nexport enum ImageAnalysisDetectionStatus\n{\n /** Detection was not performed */\n NotAvailable = 0,\n\n /** Object not detected on input image */\n NotDetected,\n\n /** Object detected on input image */\n Detected\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/** Detailed information about the recognition process. */\nexport enum ProcessingStatus\n{\n /** Recognition was successful. */\n Success = 0,\n\n /** Detection of the document failed. */\n DetectionFailed,\n\n /** Preprocessing of the input image has failed. */\n ImagePreprocessingFailed,\n\n /** Recognizer has inconsistent results. */\n StabilityTestFailed,\n\n /** Wrong side of the document has been scanned. */\n ScanningWrongSide,\n\n /** Identification of the fields present on the document has failed. */\n FieldIdentificationFailed,\n\n /** Mandatory field for the specific document is missing. */\n MandatoryFieldMissing,\n\n /** Result contains invalid characters in some of the fields. */\n InvalidCharactersFound,\n\n /** Failed to return a requested image. */\n ImageReturnFailed,\n\n /** Reading or parsing of the barcode has failed. */\n BarcodeRecognitionFailed,\n\n /** Parsing of the MRZ has failed. */\n MrzParsingFailed,\n\n /** Document class has been filtered out. */\n ClassFiltered,\n\n /** Document currently not supported by the recognizer. */\n UnsupportedClass,\n\n /** License for the detected document is missing. */\n UnsupportedByLicense,\n\n /**\n * Front side recognition has completed successfully, and recognizer is waiting for the other\n * side to be scanned.\n */\n AwaitingOtherSide,\n\n /** Number of possible processing statuses. */\n Count\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\n/**\n * RecognitionMode enum defines possible recognition modes by BlinkID(Combined)Recognizer.\n */\nexport enum RecognitionMode\n{\n /** No recognition performed. */\n None = 0,\n\n /** Recognition of mrz document (does not include visa and passport) */\n MrzId = 1,\n\n /** Recognition of visa mrz. */\n MrzVisa = 2,\n\n /** Recognition of passport mrz. */\n MrzPassport = 3,\n\n /** Recognition of documents that have face photo on the front. */\n PhotoId = 4,\n\n /** Detailed document recognition. */\n FullRecognition = 5,\n\n /** Recognition of barcode document. */\n BarcodeId = 6,\n\n /** Number of possible values */\n Count = 7\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { AnonymizationMode } from \"./AnonymizationMode\";\nimport { BarcodeResult } from \"./BarcodeResult\";\nimport { ClassInfo } from \"./ClassInfo\";\nimport { DriverLicenseDetailedInfo } from \"./DriverLicenseDetailedInfo\";\nimport { ImageAnalysisResult } from \"./ImageAnalysisResult\";\nimport { ProcessingStatus } from \"./ProcessingStatus\";\nimport { RecognitionMode } from \"./RecognitionMode\";\nimport { RecognitionModeFilter } from \"./RecognitionModeFilter\";\nimport { VIZResult } from \"./VIZResult\";\n\nimport\n{\n CameraFrameResult,\n ExtensionFactors,\n FaceImageOptions,\n FullDocumentImageOptions,\n ImageResult,\n SignatureImageOptions,\n validateDpi\n} from \"../ImageOptions\";\n\nimport { MrzResult } from \"../MRTD/MrtdStructures\";\n\nimport\n{\n Recognizer,\n RecognizerResult,\n MBDate,\n RecognizerSettings,\n WasmSDK\n} from \"../../../MicroblinkSDK/DataStructures\";\n\n// required for the final SDK\nexport * from \"./AddressDetailedInfo\";\nexport * from \"./AnonymizationMode\";\nexport * from \"./BarcodeResult\";\nexport * from \"./ClassInfo\";\nexport * from \"./DriverLicenseDetailedInfo\";\nexport * from \"./ImageAnalysisResult\";\nexport * from \"./ProcessingStatus\";\nexport * from \"./RecognitionMode\";\nexport * from \"./RecognitionModeFilter\";\nexport * from \"./VIZResult\";\n\n/**\n * A barcode scanning started callback function.\n */\nexport type BarcodeScanningStartedCallback = () => void;\n\n/**\n * A classifier callback function.\n * @param supported True if document is supported for recognition, false otherwise.\n */\nexport type ClassifierCallback = ( supported: boolean ) => void;\n\n/**\n * A settings object that is used for configuring the BlinkIdRecognizer.\n */\nexport class BlinkIdRecognizerSettings implements RecognizerSettings,\n FullDocumentImageOptions,\n FaceImageOptions,\n SignatureImageOptions\n{\n /**\n * Defines whether blured frames filtering is allowed.\n */\n allowBlurFilter = true;\n\n /**\n * Defines whether returning of unparsed MRZ (Machine Readable Zone) results is allowed.\n */\n allowUnparsedMrzResults = false;\n\n /**\n * Defines whether returning unverified MRZ (Machine Readable Zone) results is allowed.\n * Unverified MRZ is parsed, but check digits are incorrect.\n */\n allowUnverifiedMrzResults = true;\n\n /**\n * Enable or disable recognition of specific document groups supported by the current license.\n * By default all modes are enabled.\n */\n recognitionModeFilter = new RecognitionModeFilter();\n\n /**\n * Enable or disable the saving of camera frames from which data is extracted.\n */\n saveCameraFrames = false;\n\n /**\n * Configure the recognizer to only work on already cropped and dewarped images.\n * This only works for still images - video feeds will ignore this setting.\n */\n scanCroppedDocumentImage = false;\n\n /**\n * Whether result characters validatation is performed.\n * If a result member contains invalid character, the result state cannot be valid.\n */\n validateResultCharacters = true;\n\n /**\n * Whether sensitive data should be removed from images, result fields or both.\n * The setting only applies to certain documents.\n */\n anonymizationMode = AnonymizationMode.FullResult;\n\n /**\n * Called when barcode scanning step starts.\n */\n barcodeScanningStartedCallback: BarcodeScanningStartedCallback | null = null;\n\n /**\n * Called when recognizer classifies a document.\n */\n classifierCallback: ClassifierCallback | null = null;\n\n /**\n * If set to `null`, all supported documents will be recognized.\n * Otherwise, only classes from given array will be recognized and all other\n * documents will be treated as \"not supported\" (observable via classifierCallback).\n */\n allowedDocumentClasses: Array< ClassInfo > | null = null;\n\n /**\n * Padding is a minimum distance from the edge of the frame and it is defined\n * as a percentage of the frame width. Recommended value is '0.02'.\n * By default, this is set to '0.0' which means that padding edge and image edge are the same.\n */\n paddingEdge = 0.0;\n\n // implementation of the FullDocumentImageOptions interface\n returnFullDocumentImage = false;\n\n returnEncodedFullDocumentImage = false;\n\n private _fullDocumentImageDpi = 250;\n\n get fullDocumentImageDpi(): number { return this._fullDocumentImageDpi; }\n\n set fullDocumentImageDpi( value: number )\n {\n validateDpi( value );\n this._fullDocumentImageDpi = value;\n }\n\n fullDocumentImageExtensionFactors = new ExtensionFactors();\n\n // implementation of the FaceImageOptions interface\n returnFaceImage = false;\n\n returnEncodedFaceImage = false;\n\n private _faceImageDpi = 250;\n\n get faceImageDpi(): number { return this._faceImageDpi; }\n\n set faceImageDpi( value: number )\n {\n validateDpi( value );\n this._faceImageDpi = value;\n }\n\n // implementation of the SignatureImageOptions interface\n returnSignatureImage = false;\n\n returnEncodedSignatureImage = false;\n\n private _signatureImageDpi = 250;\n\n get signatureImageDpi(): number { return this._signatureImageDpi; }\n\n set signatureImageDpi( value: number )\n {\n validateDpi( value );\n this._signatureImageDpi = value;\n }\n}\n\n/**\n * The base result of image recognition when using either the BlinkIdRecognizer or BlinkIdCombindedRecognizer.\n */\nexport interface BaseBlinkIdRecognizerResult extends RecognizerResult\n{\n /**\n * The additional address information of the document owner.\n */\n readonly additionalAddressInformation: string;\n\n /**\n * The additional name information of the document owner.\n */\n readonly additionalNameInformation: string;\n\n /**\n * The one more additional address information of the document owner.\n */\n readonly additionalOptionalAddressInformation: string;\n\n /**\n * The fathers name of the document owner.\n */\n readonly fathersName: string;\n\n /**\n * The mothers name of the document owner.\n */\n readonly mothersName: string;\n\n /**\n * The address of the document owner.\n */\n readonly address: string;\n\n /**\n * The data extracted from the barcode.\n */\n readonly barcode: BarcodeResult;\n\n /**\n * The class info\n */\n readonly classInfo: ClassInfo;\n\n /**\n * The date of birth of the document owner.\n */\n readonly dateOfBirth: MBDate;\n\n /**\n * The date of expiry of the document.\n */\n readonly dateOfExpiry: MBDate;\n\n /**\n * Determines if date of expiry is permanent.\n */\n readonly dateOfExpiryPermanent: boolean;\n\n /**\n * The date of issue of the document.\n */\n readonly dateOfIssue: MBDate;\n\n /**\n * The additional number of the document.\n */\n readonly documentAdditionalNumber: string;\n\n /**\n * The one more additional number of the document.\n */\n readonly documentOptionalAdditionalNumber: string;\n\n /**\n * The document number.\n */\n readonly documentNumber: string;\n\n /**\n * The driver license detailed info\n */\n readonly driverLicenseDetailedInfo: DriverLicenseDetailedInfo;\n\n /**\n * The employer of the document owner.\n */\n readonly employer: string;\n\n /**\n * The face image\n */\n readonly faceImage: ImageResult;\n\n /**\n * The first name of the document owner.\n */\n readonly firstName: string;\n\n /**\n * The full name of the document owner.\n */\n readonly fullName: string;\n\n /**\n * The issuing authority of the document.\n */\n readonly issuingAuthority: string;\n\n /**\n * The last name of the document owner.\n */\n readonly lastName: string;\n\n /**\n * The localized name of the document owner.\n */\n readonly localizedName: string;\n\n /**\n * The marital status of the document owner.\n */\n readonly maritalStatus: string;\n\n /**\n * The data extracted from the machine readable zone.\n */\n readonly mrz: MrzResult;\n\n /**\n * The nationality of the documet owner.\n */\n readonly nationality: string;\n\n /**\n * The personal identification number.\n */\n readonly personalIdNumber: string;\n\n /**\n * The place of birth of the document owner.\n */\n readonly placeOfBirth: string;\n\n /**\n * Status of the last recognition process.\n */\n readonly processingStatus: ProcessingStatus;\n\n /**\n * The profession of the document owner.\n */\n readonly profession: string;\n\n /**\n * The race of the document owner.\n */\n readonly race: string;\n\n /**\n * Recognition mode used to scan current document.\n */\n readonly recognitionMode: RecognitionMode;\n\n /**\n * The religion of the document owner.\n */\n readonly religion: string;\n\n /**\n * The residential status of the document owner.\n */\n readonly residentialStatus: string;\n\n /**\n * The sex of the document owner.\n */\n readonly sex: string;\n\n /**\n * The image of the signature\n */\n readonly signatureImage: ImageResult;\n}\n\n/**\n * The result of image recognition when using the BlinkIdRecognizer.\n */\nexport interface BlinkIdRecognizerResult extends BaseBlinkIdRecognizerResult\n{\n /**\n * Camera frame from which barcode data was extracted.\n */\n readonly barcodeCameraFrame: CameraFrameResult;\n\n /**\n * Camera frame from which document data was extracted.\n */\n readonly cameraFrame: CameraFrameResult;\n\n /**\n * The full document image\n */\n readonly fullDocumentImage: ImageResult;\n\n /**\n * Result of document image analysis.\n */\n readonly imageAnalysisResult: ImageAnalysisResult;\n\n /**\n * The data extracted from the visual inspection zone.\n */\n readonly viz: VIZResult;\n}\n\n/**\n * The Blink ID Recognizer is used for scanning any ID document.\n */\nexport interface BlinkIdRecognizer extends Recognizer\n{\n /** Returns the currently applied BlinkIdRecognizerSettings. */\n currentSettings(): Promise< BlinkIdRecognizerSettings >\n\n /** Applies new settings to the recognizer. */\n updateSettings( newSettings: BlinkIdRecognizerSettings ): Promise< void >;\n\n /** Returns the current result of the recognition. */\n getResult(): Promise< BlinkIdRecognizerResult >;\n}\n\n/**\n * This function is used to create a new instance of `BlinkIdRecognizer`.\n * @param wasmSDK Instance of WasmSDK which will be used to communicate with the WebAssembly module.\n */\nexport async function createBlinkIdRecognizer( wasmSDK: WasmSDK ): Promise< BlinkIdRecognizer >\n{\n return wasmSDK.mbWasmModule.newRecognizer( \"BlinkIdRecognizer\" ) as Promise< BlinkIdRecognizer >;\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport { BlinkIdRecognizerSettings, BaseBlinkIdRecognizerResult } from \"./BlinkIdRecognizer\";\nimport { CombinedRecognizerResult } from \"../CombinedRecognizer\";\nimport { ImageAnalysisResult } from \"./ImageAnalysisResult\";\nimport { CameraFrameResult, ImageResult } from \"../ImageOptions\";\nimport { ProcessingStatus } from \"./ProcessingStatus\";\nimport { VIZResult } from \"./VIZResult\";\n\nimport\n{\n Recognizer,\n WasmSDK\n} from \"../../../MicroblinkSDK/DataStructures\";\n\n/**\n * A settings object that is used for configuring the BlinkIdCombinedRecognizer.\n */\nexport class BlinkIdCombinedRecognizerSettings extends BlinkIdRecognizerSettings\n{\n /**\n * Proceed with scanning the back side even if the front side result is uncertain.\n * This only works for still images - video feeds will ignore this setting.\n */\n allowUncertainFrontSideScan = false;\n\n /**\n * Configure the number of characters per field that are allowed to be inconsistent in data match.\n */\n maxAllowedMismatchesPerField = 0;\n\n /**\n * Skip the scan of the back side for documents where back side scanning is not supported.\n */\n skipUnsupportedBack = false;\n}\n\n/**\n * The result of image recognition when using the BlinkIdCombinedRecognizer.\n */\nexport interface BlinkIdCombinedRecognizerResult extends BaseBlinkIdRecognizerResult, CombinedRecognizerResult\n{\n /**\n * Camera frame from which barcode data was extracted.\n */\n readonly barcodeCameraFrame: CameraFrameResult;\n\n /**\n * Camera frame from which document data on front side was extracted.\n */\n readonly frontCameraFrame: CameraFrameResult;\n\n /**\n * Camera frame from which document data on back side was extracted.\n */\n readonly backCameraFrame: CameraFrameResult;\n\n /**\n * The full document back image\n */\n readonly fullDocumentBackImage: ImageResult;\n\n /**\n * The full document front image\n */\n readonly fullDocumentFrontImage: ImageResult;\n\n /**\n * Result of analysis of the image of the front side of the document.\n */\n readonly frontImageAnalysisResult: ImageAnalysisResult;\n\n /**\n * Result of analysis of the image of the back side of the document.\n */\n readonly backImageAnalysisResult: ImageAnalysisResult;\n\n /**\n * The data extracted from the front side visual inspection zone.\n */\n readonly frontViz: VIZResult;\n\n /**\n * The data extracted from the back side visual inspection zone.\n */\n readonly backViz: VIZResult;\n\n /**\n * Status of the last recognition process for the front side of the document.\n */\n readonly frontProcessingStatus: ProcessingStatus;\n\n /**\n * Status of the last recognition process for the back side of the document.\n */\n readonly backProcessingStatus: ProcessingStatus;\n}\n\n/**\n * The Blink ID Combined Recognizer is used for scanning both sides of any ID document.\n */\nexport interface BlinkIdCombinedRecognizer extends Recognizer\n{\n /** Returns the currently applied BlinkIdCombinedRecognizerSettings. */\n currentSettings(): Promise< BlinkIdCombinedRecognizerSettings >\n\n /** Applies new settings to the recognizer. */\n updateSettings( newSettings: BlinkIdCombinedRecognizerSettings ): Promise< void >;\n\n /** Returns the current result of the recognition. */\n getResult(): Promise< BlinkIdCombinedRecognizerResult >;\n}\n\n/**\n * This function is used to create a new instance of `BlinkIdCombinedRecognizer`.\n * @param wasmSDK Instance of WasmSDK which will be used to communicate with the WebAssembly module.\n */\nexport async function createBlinkIdCombinedRecognizer( wasmSDK: WasmSDK ): Promise< BlinkIdCombinedRecognizer >\n{\n return wasmSDK.mbWasmModule.newRecognizer( \"BlinkIdCombinedRecognizer\" ) as Promise< BlinkIdCombinedRecognizer >;\n}\n","/**\n * Copyright (c) Microblink Ltd. All rights reserved.\n */\n\nimport\n{\n Recognizer,\n RecognizerResult,\n RecognizerSettings,\n MBDate,\n WasmSDK\n} from \"../../../MicroblinkSDK/DataStructures\";\n\nimport { BarcodeData } from \"../../BlinkBarcode/BarcodeData\";\n\n/**\n * A settings object that is used for configuring the IdBarcodeRecognizer.\n */\nexport class IdBarcodeRecognizerSettings implements RecognizerSettings\n{\n\n}\n\n/**\n * The result of image recognition when using the IdBarcodeRecognizer.\n */\nexport interface IdBarcodeRecognizerResult extends RecognizerResult\n{\n /**\n * The additional name information of the document owner.\n */\n readonly additionalNameInformation: string;\n\n /**\n * The address of the document owner.\n */\n readonly address: string;\n\n /**\n * The raw, unparsed barcode data.\n */\n readonly barcodeData: BarcodeData;\n\n /**\n * The city address portion of the document owner.\n */\n readonly city: string;\n\n /**\n * The date of birth of the document owner.\n */\n readonly dateOfBirth: MBDate;\n\n /**\n * The date of expiry of the document.\n */\n readonly dateOfExpiry: MBDate;\n\n /**\n * The date of issue of the document.\n */\n readonly dateOfIssue: MBDate;\n\n /**\n * The additional number of the document.\n */\n readonly documentAdditionalNumber: string;\n\n /**\n * The document number.\n */\n readonly documentNumber: string;\n\n /**\n * The document type deduced from the recognized barcode\n */\n readonly documentType: IdBarcodeDocumentType;\n\n /**\n * The employer of the document owner.\n */\n readonly employer: string;\n\n /**\n * The additional privileges granted to the driver license owner.\n */\n readonly endorsements: string;\n\n /**\n * Document specific extended elements that contain all barcode fields in their original form.\n * The indices of specific data within the array are given by the BarcodeElementKey enum.\n *\n * For example, to obtain the first name you can use extendedElements[BarcodeElementKey.CustomerFirstName].\n *\n * Currently this is only filled for AAMVACompliant documents.\n */\n readonly extendedElements: Array<string>;\n\n /**\n * The first name of the document owner.\n */\n readonly firstName: string;\n\n /**\n * The full name of the document owner.\n */\n readonly fullName: string;\n\n /**\n * The issuing authority of the document.\n */\n readonly issuingAuthority: string;\n\n /**\n * The jurisdiction code address portion of the document owner.\n */\n readonly jurisdiction: string;\n\n /**\n * The last name of the document owner.\n */\n readonly lastName: string;\n\n /**\n * The marital status of the document owner.\n */\n readonly maritalStatus: string;\n\n /**\n * The middle name of the document owner.\n */\n readonly middleName: string;\n\n /**\n * The nationality of the documet owner.\n */\n readonly nationality: string;\n\n /**\n * The personal identification number.\n */\n readonly personalIdNumber: string;\n\n /**\n * The place of birth of the document owner.\n */\n readonly placeOfBirth: string;\n\n /**\n * The postal code address portion of the document owner.\n */\n readonly postalCode: string;\n\n /**\n * The profession of the document owner.\n */\n readonly profession: string;\n\n /**\n * The race of the document owner.\n */\n readonly race: string;\n\n /**\n * The religion of the document owner.\n */\n readonly religion: string;\n\n /**\n * The residential stauts of the document owner.\n */\n readonly residentialStatus: string;\n\n /**\n * The restrictions to driving privileges for the driver license owner.\n */\n readonly restrictions: string;\n\n /**\n * The sex of the document owner.\n */\n readonly sex: string;\n\n /**\n * The street address portion of the document owner.\n */\n readonly street: string;\n\n /**\n * The type of vehicle the driver license owner has privilege to drive.\n */\n readonly vehicleClass: string;\n}\n\n/**\n * The ID Barcode Recognizer is used for scanning barcodes on ID documents.\n */\nexport interface IdBarcodeRecognizer extends Recognizer\n{\n /** Returns the currently applied IdBarcodeRecognizerSettings. */\n currentSettings(): Promise< IdBarcodeRecognizerSettings >\n\n /** Applies new settings to the recognizer. */\n updateSettings( newSettings: IdBarcodeRecognizerSettings ): Promise< void >;\n\n /** Returns the current result of the recognition. */\n getResult(): Promise< IdBarcodeRecognizerResult >;\n}\n\n/**\n * This function is used to create a new instance of `IdBarcodeRecognizer`.\n * @param wasmSDK Instance of WasmSDK which will be used to communicate with the WebAssembly module.\n */\nexport async function createIdBarcodeRecognizer( wasmSDK: WasmSDK ): Promise< IdBarcodeRecognizer >\n{\n return wasmSDK.mbWasmModule.newRecognizer( \"IdBarcodeRecognizer\" ) as Promise< IdBarcodeRecognizer >;\n}\n\n/**\n * Represents the type of scanned document\n */\nexport enum IdBarcodeDocumentType\n{\n /**\n * No document was scanned\n */\n None = 0,\n\n /**\n * AAMVACompliant document was scanned\n */\n AAMVACompliant,\n\n /**\n * ArgentinaID document was scanned\n */\n ArgentinaID,\n\n /**\n * ArgentinaAlienID document was scanned\n */\n ArgentinaAlienID,\n\n /**\n * ArgentinaDL document was scanned\n */\n ArgentinaDL,\n\n /**\n * ColombiaID document was scanned\n */\n ColombiaID,\n\n /**\n * ColombiaDL document was scanned\n */\n ColombiaDL,\n\n /**\n * NigeriaVoterID document was scanned\n */\n NigeriaVoterID,\n\n /**\n * NigeriaDL document was scanned\n */\n NigeriaDL,\n\n /**\n * PanamaID document was scanned\n */\n PanamaID,\n\n /**\n * SouthAfricaID document was scanned\n */\n SouthAfricaID\n}\n"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","WasmType","Messages.ParameterType","Messages.InvokeObjectMethod","Messages.RegisteredMetadataCallbacks","Messages.ProcessImage","Messages.ReconfigureRecognizerRunner","Messages.RegisterMetadataCallbacks","Messages.ResetRecognizers","Messages.SetDetectionOnly","Messages.SetClearTimeoutCallback","Messages.SetCameraPreviewMirrored","Messages.DeleteRecognizerRunner","Messages.CreateRecognizerRunner","Messages.CreateNewRecognizer","Messages.GetProductIntegrationInfo","Messages.MetadataCallback","Messages.InitMessage","ErrorCodes","ErrorMessages","PreferredCameraType","ImageOrientation","RecognizerResultState","ErrorTypes.frameCaptureErrors","LicenseTokenState","LicenseErrorType","ServerPermissionSubmitResultStatus","ErrorTypes.licenseErrors","DetectionStatus","NotSupportedReason","VideoRecognitionMode","ErrorTypes.videoRecognizerErrors","ErrorTypes.ErrorCodes","ErrorTypes.sdkErrors","bulkMemory","WebAssembly","validate","Uint8Array","saturatedFloatToInt","signExtensions","simd","threads","MessageChannel","port1","postMessage","SharedArrayBuffer","WasmFeatureDetect.bulkMemory","WasmFeatureDetect.saturatedFloatToInt","WasmFeatureDetect.signExtensions","WasmFeatureDetect.simd","WasmFeatureDetect.threads","BarcodeFormat","AnonymizationMode","BarcodeElementKey","Country","Region","DocumentType","DocumentImageColorStatus","ImageAnalysisDetectionStatus","ProcessingStatus","RecognitionMode","IdBarcodeDocumentType"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAsDO,SAASA,SAAT,CAAmBC,OAAnB,EAA4BC,UAA5B,EAAwCC,CAAxC,EAA2CC,SAA3C,EAAsD;AACzD,WAASC,KAAT,CAAeC,KAAf,EAAsB;AAAE,WAAOA,KAAK,YAAYH,CAAjB,GAAqBG,KAArB,GAA6B,IAAIH,CAAJ,CAAM,UAAUI,OAAV,EAAmB;AAAEA,MAAAA,OAAO,CAACD,KAAD,CAAP;AAAiB,KAA5C,CAApC;AAAoF;;AAC5G,SAAO,KAAKH,CAAC,KAAKA,CAAC,GAAGK,OAAT,CAAN,EAAyB,UAAUD,OAAV,EAAmBE,MAAnB,EAA2B;AACvD,aAASC,SAAT,CAAmBJ,KAAnB,EAA0B;AAAE,UAAI;AAAEK,QAAAA,IAAI,C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