diff --git a/.gitignore b/.gitignore index 78b1a51..2f050e4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ yarn.lock /*.txt /.gitattributes /.*ignore -/DBR-* +/dbr-* /sampleFromGithub /src /Web.config diff --git a/README.NODE.md b/README.NODE.md index 6e3ab4f..ac5890c 100644 --- a/README.NODE.md +++ b/README.NODE.md @@ -6,7 +6,7 @@ Both 1D and 2D barcode symbiology are supported including the popular `Code 39`, The library is based on `webassembly` which has been an official feature of Node.js since `LTS 8`. If you are using Node.js LTS 8 and have no plan to upgrade it, check out [how to use the library in Node.js LTS 8](#how-to-use-the-library-in-nodejs-lts-8). That said, Node.js version >= LTS 12 is recommended because the library will try to use `worker_threads` when decoding. -> Also see [Dynamsoft JavaScript Barcode SDK for Web](https://github.com/Dynamsoft/javascript-barcode/blob/master/README.md). +Node.js 15+ is required to use online license. ## Get Started @@ -89,7 +89,7 @@ DBR.BarcodeReader.productKeys = 'PRODUCT-KEYS'; **Full code** ```js -let DBR = require('dynamsoft-node-barcode'); +let DBR = require('dynamsoft-javascript-barcode'); // Please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&package=js&utm_source=github to get a trial license DBR.BarcodeReader.productKeys = 'PRODUCT-KEYS'; @@ -116,13 +116,13 @@ let pReader = null; To set up the library for decoding, use the APIs `getRuntimeSettings` & `updateRuntimeSettings`. ```js -await barcodeScanner.updateRuntimeSettings("speed"); +await reader.updateRuntimeSettings("speed"); ``` ```js -await barcodeScanner.updateRuntimeSettings("balance"); +await reader.updateRuntimeSettings("balance"); ``` ```js -await barcodeScanner.updateRuntimeSettings("coverage"); +await reader.updateRuntimeSettings("coverage"); ``` ```js let settings = await reader.getRuntimeSettings(); diff --git a/README.md b/README.md index be5cbb1..ad7d404 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + # Dynamsoft Barcode Reader for Your Website Turn your web page into a barcode scanner with just a few lines of code. @@ -15,7 +17,7 @@ In this guide, you will learn step by step on how to integrate this library into [TEST THE LIBRARY](https://www.dynamsoft.com/barcode-reader/downloads/?utm_source=github&product=dbr&package=js) -> For back-end barcode reading with Node.js, see [Dynamsoft Barcode Reader for Node](https://github.com/Dynamsoft/javascript-barcode/blob/main/README.NODE.md). +> For back-end barcode reading with Node.js, see [Dynamsoft Barcode Reader for Node](https://www.npmjs.com/package/dynamsoft-node-barcode). **Table of Contents** @@ -33,11 +35,11 @@ In this guide, you will learn step by step on how to integrate this library into **Popular Examples** -* [Basic Implementation](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-mincode.html?ver=latest&utm_source=github) -* [Use the library in Angular](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=latest&utm_source=github) -* [Use the library in React](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=latest&utm_source=github) -* [Use the library in Vue](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejs.html?ver=latest&utm_source=github) -* [Use the library in a PWA APP](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=latest&utm_source=github) +* [Basic Implementation](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-mincode.html?ver=8.8.7&utm_source=github) +* [Use the library in Angular](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html?ver=8.8.7&utm_source=github) +* [Use the library in React](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html?ver=8.8.7&utm_source=github) +* [Use the library in Vue](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejs.html?ver=8.8.7&utm_source=github) +* [Use the library in a PWA APP](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html?ver=8.8.7&utm_source=github) You can also: @@ -49,9 +51,9 @@ You can also: Let's start by testing the "Hello World" example of the library which demonstrates how to use the minimum code to enable a web page to read barcodes from a live video stream. * Basic Requirements - + Internet connection + + Internet connection + [A supported browser](#system-requirements) - + Camera access + + Camera access ### Step One: Check the code of the example @@ -62,7 +64,7 @@ The complete code of the "Hello World" example is shown below - + + ``` * UNPKG ``` html - + ``` #### Host the library yourself @@ -162,7 +164,7 @@ The following shows a few ways to download the library. Depending on how you downloaded the library and where you put it. You can typically include it like this: ``` html - + ``` or @@ -204,7 +206,7 @@ Dynamsoft.DBR.BarcodeReader.productKeys = "t0068NQAAACgTVU2aucyxqETXKkiomqhV7YoL Or ```html - + ``` #### Specify the location of the "engine" files @@ -214,7 +216,7 @@ The "engine" files refer to *.worker.js, *.wasm.js and *.wasm, etc. which are lo The following code uses the jsDelivr CDN, feel free to change it to your own location of these files. ``` javascript -Dynamsoft.DBR.BarcodeScanner.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/"; +Dynamsoft.DBR.BarcodeScanner.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/"; ``` ### Interact with the library @@ -307,7 +309,7 @@ As you can see from the above code snippets, there are three types of configurat Try in [JSFiddle](https://jsfiddle.net/DynamsoftTeam/f24h8c1m/). - See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=latest&utm_source=github). + See also [settings samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/parameter-settings.html?ver=8.8.7&utm_source=github). #### Customize the UI @@ -390,7 +392,7 @@ The built-in UI of the `BarcodeScanner` object is defined in the file `dist/dbr. > Generally, you need to provide a resolution that the camera supports. However, in case a camera does not support the specified resolution, it usually uses the nearest supported resolution. As a result, the selected resolution may not be the actual resolution used. In this case, add an option with the class name `dbrScanner-opt-gotResolution` (as shown above) and the library will then use it to show the actual resolution. -See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=latest&utm_source=github). +See also [UI customization samples](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/ui-customization.html?ver=8.8.7&utm_source=github). Interested to test it further? Read on to learn how to request a 30-day free trial. @@ -405,28 +407,26 @@ Since v8.2.5, a 7-day free license is used by default if no license specified. N This library requires the following features which are supported by all modern mainstream browsers: -* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers` +* `WebAssembly`, `Blob`, `URL`/`createObjectURL`, `Web Workers`, `import` The above four features are required for the library to work. * `MediaDevices`/`getUserMedia` - This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=latest&utm_source=github#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera. + This API is only required for in-browser video streaming. If a browser does not support this API, the [Single Frame Mode](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeScanner.html?ver=8.8.7&utm_source=github#singleframemode) will be used automatically. If the API exists but doesn't work correctly, the Single Frame Mode can be used as an alternative way to access the camera. The following table is a list of supported browsers based on the above requirements: Browser Name | Version :-: | :-: - Chrome | v57+ (v59+ on Android/iOS1) - Firefox | v52+ (v55+ on Android/iOS1) - Edge2 | v16+ - Safari3 | v11+ + Chrome1 | v63+ + Firefox1 | v67+ + Edge | v79+ + Safari2 | v11.1+ 1 iOS 14.3+ is required for camera video streaming in Chrome and Firefox or Apps using webviews. - 2 On legacy Edge (v16 ~ v78), due to strict Same-origin policy, you must host the library files on the same domain as your web page. - - 3 Safari 11.2.2 ~ 11.2.6 are not supported. + 2 Safari 11.2.2 ~ 11.2.6 are not supported. Apart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the library. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above. @@ -475,101 +475,11 @@ Optionally, you may also need to [specify the location of the "engine" files](#s ## Advanced Usage -### Read a specific area/region - -To speed up the scanning process, you can choose to scan only a specific area/region. - -```javascript -let settings = await scanner.getRuntimeSettings(); -/* - * The following code shrinks the decoding region by 25% on all sides - */ -settings.region.regionMeasuredByPercentage = 1; -settings.region.regionLeft = 25; -settings.region.regionTop = 25; -settings.region.regionRight = 75; -settings.region.regionBottom = 75; -await scanner.updateRuntimeSettings(settings); -``` - -[Try in JSFiddle](https://jsfiddle.net/DynamsoftTeam/taykq592/) - -### Show internal logs - -Include the following in your code to print internal logs in the console. - -```javascript -Dynamsoft.DBR.BarcodeReader._onLog = console.log; -``` - -### Set mode arguments - -To precisely control a mode, you can adjust its specific parameters. - -```javascript -let settings = await scanner.getRuntimeSettings(); - -/* - * The following code sets the sensitivity of the TextureDetectionModes to 9 - */ - -settings.furtherModes.textureDetectionModes = [ - Dynamsoft.DBR.EnumTextureDetectionMode.TDM_GENERAL_WIDTH_CONCENTRATION, 0, 0, 0, 0, 0, 0, 0 -]; - -await scanner.updateRuntimeSettings(settings); -// The 2nd parameter 0 specifies the first mode of TextureDetectionModes, which is "Dynamsoft.DBR.EnumTextureDetectionMode.TDM_GENERAL_WIDTH_CONCENTRATION" in this case. -await scanner.setModeArgument("TextureDetectionModes", 0, "Sensitivity", "9"); -``` - -### Display the intermediate result images or the original canvas - -The intermediate result images are created when `intermediateResultTypes` is set in `RuntimeSettings` . Then they can be returned with the method `getIntermediateCanvas()` . These images can be used to show and debug the barcode reading process. - -The method `getOriginalImageInACanvas()` returns a canvas which holds the image to be passed to the barcode reader engine for decoding. - -> *NOTE* -> -> For efficiency, the library may utilize WebGL (Web Graphics Library) for preprocessing an image before passing it to the barcode reader engine. If WebGL is used, the image captured from the camera will not be rendered on the canvas, instead, it gets processed by WebGL first and then is passed to the barcode reader engine directly. In this case, there won't be an original canvas. Therefore, if `ifSaveOriginalImageInACanvas` is set to `true` for a `BarcodeReader` or `BarcodeScanenr` instance, the WebGL feature will be disabled for that instance. -> -> On the other hand, if WebGL is disabled and you try to get the intermediate result specified by `EnumIntermediateResultType.IRT_ORIGINAL_IMAGE` , it will be exactly the same image as you would get with `getOriginalImageInACanvas()` . - -The following shows how to display these images on the page - -```html -
-
-``` - -```javascript -(async () => { - let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance(); - /* The default of `_bUseWebgl` is true which means the intermediate result for - IRT_ORIGINAL_IMAGE will be one that has been preprocessed by WebGL */ - scanner._bUseWebgl = false; - document.getElementById('scannerV').appendChild(scanner.getUIElement());; - await scanner.updateRuntimeSettings('balance'); - let rs = await scanner.getRuntimeSettings(); - rs.intermediateResultTypes = 1; - await scanner.updateRuntimeSettings(rs); - scanner.onUnduplicatedRead = async (txt, result) => { - try { - let cvss = await scanner.getIntermediateCanvas(); - for (let cvs of cvss) { - document.getElementById('cvses').appendChild(cvs); - } - scanner.destroy(); - } catch (ex) { - console.error(ex); - } - }; - await scanner.show(); -})(); -``` +In addition to the content mentioned above, the library has many other settings and options that you can adjust to best suit your usage. To read more, please see [advanced usage](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/advanced-usage.html?ver=8.8.7&utm_source=github). ## How to Upgrade -If you are using an older version of the library and want to upgrade it to the latest version, please read more on [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=latest&utm_source=github). +If you are using an older version of the library and want to upgrade it to the latest version, please read more on [how to upgrade](https://www.dynamsoft.com/barcode-reader/programming/javascript/upgrade-guide/?ver=8.8.7&utm_source=github). ## FAQ @@ -597,3 +507,10 @@ To make sure your web application can access the camera, please configure your w - IIS: [Create a Self Signed Certificate in IIS](https://aboutssl.org/how-to-create-a-self-signed-certificate-in-iis/) - Tomcat: [Setting Up SSL on Tomcat in 5 minutes](https://dzone.com/articles/setting-ssl-tomcat-5-minutes) - Node.js: [npm tls](https://nodejs.org/docs/v0.4.1/api/tls.html) + +### Accounting for newline characters in the barcode result +When it comes to HTML, newline characters (`\n`) are not interpreted as they normally would. Therefore, if a barcode result contains a newline character, and you display the result in an alert box or some other text element, then the newline character will most probably be ignored. + +There are two ways in which you can resolve this: +1. Wrap the element used to display the result in a `
` element.
+2. Manually replace each `\n` character in the result with `
` \ No newline at end of file diff --git a/dist/class/barcodereader.d.ts b/dist/class/barcodereader.d.ts index 1e26042..5583474 100644 --- a/dist/class/barcodereader.d.ts +++ b/dist/class/barcodereader.d.ts @@ -35,7 +35,7 @@ export default class BarcodeReader { * ``` * For convenience, you can set `license` in `script` tag instead. * ```html - * + * * ``` */ static set license(keys: string); @@ -87,7 +87,7 @@ export default class BarcodeReader { * If the auto-explored engine location is incorrect, you can manually specify the engine location. * The property needs to be set before [[loadWasm]]. * ```js - * Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/"; + * Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/"; * await Dynamsoft.DBR.BarcodeReader.loadWasm(); * ``` */ diff --git a/dist/class/barcodescanner.d.ts b/dist/class/barcodescanner.d.ts index 5097472..5e049f7 100644 --- a/dist/class/barcodescanner.d.ts +++ b/dist/class/barcodescanner.d.ts @@ -24,7 +24,7 @@ export default class BarcodeScanner extends BarcodeReader { * The url of the default scanner UI. * Can only be changed before `createInstance`. * ```js - * Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/dbr.scanner.html"; + * Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.scanner.html"; * let pScanner = null; * (async()=>{ * let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance()); @@ -371,7 +371,7 @@ export default class BarcodeScanner extends BarcodeReader { * Get current camera resolution. * ```js * let rsl = await scanner.getResolution(); - * console.log(rsl.width + " x " + rsl.height); + * console.log(rsl[0] + " x " + rsl[1]); * ``` * @category Camera Settings */ @@ -655,7 +655,7 @@ export default class BarcodeScanner extends BarcodeReader { /** * Bind UI, open the camera, start decoding, and remove the UIElement `display` style if the original style is `display:none;`. * ```js - * await scanner.setUIElement("https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/dbr.scanner.html"); + * await scanner.setUIElement("https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.scanner.html"); * scanner.onUniqueRead = (txt, result) => { alert(txt); console.log(result); }; * await scanner.show(); * // await scanner.hide(); diff --git a/dist/dbr-8.8.3.full.wasm b/dist/dbr-8.8.3.full.wasm deleted file mode 100644 index 3f5d3ae..0000000 Binary files a/dist/dbr-8.8.3.full.wasm and /dev/null differ diff --git a/dist/dbr-8.8.3.full.wasm.js b/dist/dbr-8.8.3.full.wasm.js deleted file mode 100644 index e7b8242..0000000 --- a/dist/dbr-8.8.3.full.wasm.js +++ /dev/null @@ -1,282 +0,0 @@ - -var c;c||(c=typeof Module !== 'undefined' ? Module : {});var aa={},ba;for(ba in c)c.hasOwnProperty(ba)&&(aa[ba]=c[ba]);var ca="./this.program",da="object"===typeof window,ea="function"===typeof importScripts,fa="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node,ha=!da&&!fa&&!ea; -if(c.ENVIRONMENT)throw Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var f="",ia,ja,ka,la,ma; -if(fa){if("object"!==typeof process||"function"!==typeof require)throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");f=ea?require("path").dirname(f)+"/":__dirname+"/";ia=function(a,b){la||(la=require("fs"));ma||(ma=require("path"));a=ma.normalize(a);return la.readFileSync(a,b?null:"utf8")};ka=function(a){a=ia(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer); -return a};ja=function(a,b,d){la||(la=require("fs"));ma||(ma=require("path"));a=ma.normalize(a);la.readFile(a,function(e,h){e?d(e):b(h.buffer)})};1=e);)++d;if(16h?e+=String.fromCharCode(h):(h-=65536,e+= -String.fromCharCode(55296|h>>10,56320|h&1023))}}else e+=String.fromCharCode(h)}return e}function z(a,b){return a?ua(A,a,b):""} -function va(a,b,d,e){if(!(0=k){var m=a.charCodeAt(++g);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;2097152<=k&&oa("Invalid Unicode code point 0x"+k.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF)."); -b[d++]=240|k>>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-h}function wa(a,b,d){assert("number"==typeof d,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");va(a,A,b,d)}function xa(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b} -var ya="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function za(a,b){assert(0==a%2,"Pointer passed to UTF16ToString must be aligned to two bytes!");var d=a>>1;for(var e=d+b/2;!(d>=e)&&Aa[d];)++d;d<<=1;if(32=b/2);++e){var h=Ba[a+2*e>>1];if(0==h)break;d+=String.fromCharCode(h)}return d} -function Ca(a,b,d){assert(0==b%2,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert("number"==typeof d,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var e=b;d=d<2*a.length?d/2:a.length;for(var h=0;h>1]=a.charCodeAt(h),b+=2;Ba[b>>1]=0;return b-e}function Da(a){return 2*a.length} -function Ea(a,b){assert(0==a%4,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var d=0,e="";!(d>=b/4);){var h=C[a+4*d>>2];if(0==h)break;++d;65536<=h?(h-=65536,e+=String.fromCharCode(55296|h>>10,56320|h&1023)):e+=String.fromCharCode(h)}return e} -function Fa(a,b,d){assert(0==b%4,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert("number"==typeof d,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(4>d)return 0;var e=b;d=e+d-4;for(var h=0;h=g){var k=a.charCodeAt(++h);g=65536+((g&1023)<<10)|k&1023}C[b>>2]=g;b+=4;if(b+4>d)break}C[b>>2]=0;return b-e} -function Ga(a){for(var b=0,d=0;d=e&&++d;b+=4}return b}function Ha(a){var b=xa(a)+1,d=Ia(b);d&&va(a,D,d,b);return d}function Ja(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");D.set(a,b)}var Ka,D,A,Ba,Aa,C,E,La,Ma; -function Na(){var a=ra.buffer;Ka=a;c.HEAP8=D=new Int8Array(a);c.HEAP16=Ba=new Int16Array(a);c.HEAP32=C=new Int32Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=Aa=new Uint16Array(a);c.HEAPU32=E=new Uint32Array(a);c.HEAPF32=La=new Float32Array(a);c.HEAPF64=Ma=new Float64Array(a)}c.TOTAL_STACK&&assert(5242880===c.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Oa=c.INITIAL_MEMORY||16777216; -Object.getOwnPropertyDescriptor(c,"INITIAL_MEMORY")||Object.defineProperty(c,"INITIAL_MEMORY",{configurable:!0,get:function(){q("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});assert(5242880<=Oa,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Oa+"! (TOTAL_STACK=5242880)"); -assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");assert(!c.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(16777216==Oa,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var Pa; -function Qa(){var a=Ra();assert(0==(a&3));E[(a>>2)+1]=34821223;E[(a>>2)+2]=2310721022;C[0]=1668509029}function Sa(){if(!sa){var a=Ra(),b=E[(a>>2)+1];a=E[(a>>2)+2];34821223==b&&2310721022==a||q("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+a.toString(16)+" "+b.toString(16));1668509029!==C[0]&&q("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var Ta=new Int16Array(1),Ua=new Int8Array(Ta.buffer); -Ta[0]=25459;if(115!==Ua[0]||99!==Ua[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";var Va=[],Wa=[],Xa=[],Ya=!1;function Za(){var a=c.preRun.shift();Va.unshift(a)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); -assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var $a=0,ab=null,bb=null,cb={}; -function db(){$a++;c.monitorRunDependencies&&c.monitorRunDependencies($a);assert(!cb["wasm-instantiate"]);cb["wasm-instantiate"]=1;null===ab&&"undefined"!==typeof setInterval&&(ab=setInterval(function(){if(sa)clearInterval(ab),ab=null;else{var a=!1,b;for(b in cb)a||(a=!0,t("still waiting on run dependencies:")),t("dependency: "+b);a&&t("(end of list)")}},1E4))}c.preloadedImages={};c.preloadedAudios={}; -function q(a){if(c.onAbort)c.onAbort(a);t(a);sa=!0;a="abort("+a+") at ";var b=eb();c.extraStackTrace&&(b+="\n"+c.extraStackTrace());b=fb(b);throw new WebAssembly.RuntimeError(a+b);}function gb(){return G.startsWith("data:application/octet-stream;base64,")} -function H(a){return function(){var b=c.asm;assert(Ya,"native function `"+a+"` called before runtime initialization");assert(!0,"native function `"+a+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var G;G="libDynamsoftBarcodeReader.wasm";if(!gb()){var hb=G;G=c.locateFile?c.locateFile(hb,f):f+hb} -function ib(){var a=G;try{if(a==G&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){q(b)}} -function jb(){if(!qa&&(da||ea)){if("function"===typeof fetch&&!G.startsWith("file://"))return fetch(G,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()}).catch(function(){return ib()});if(ja)return new Promise(function(a,b){ja(G,function(d){a(new Uint8Array(d))},b)})}return Promise.resolve().then(function(){return ib()})}var I,J; -function kb(a){for(;0>2]=60*g;C[pb()>>2]=Number(b!=h);d=a(d);e=a(e);d=Ha(d);e=Ha(e);h>2]=d,C[qb()+4>>2]=e):(C[qb()>>2]=e,C[qb()+4>>2]=d)}}var nb; -function rb(a,b){for(var d=0,e=a.length-1;0<=e;e--){var h=a[e];"."===h?a.splice(e,1):".."===h?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(b)for(;d;d--)a.unshift("..");return a}function sb(a){var b="/"===a.charAt(0),d="/"===a.substr(-1);(a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/"))||b||(a=".");a&&d&&(a+="/");return(b?"/":"")+a} -function tb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function ub(a){if("/"===a)return"/";a=sb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)} -function vb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(fa)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(d){}return function(){q("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}} -function wb(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."}var xb=[];function yb(a,b){xb[a]={input:[],output:[],U:b};zb(a,Ab)} -var Ab={open:function(a){var b=xb[a.node.rdev];if(!b)throw new K(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.U.flush(a.tty)},flush:function(a){a.tty.U.flush(a.tty)},read:function(a,b,d,e){if(!a.tty||!a.tty.U.qa)throw new K(60);for(var h=0,g=0;g=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.i,a.i=new Uint8Array(b), -0=a.node.s)return 0;a=Math.min(a.node.s-h,e);assert(0<=a);if(8b)throw new K(28);return b},la:function(a,b,d){L.oa(a.node,b+d);a.node.s=Math.max(a.node.s,b+d)},ra:function(a,b,d,e,h,g){if(0!==b)throw new K(28);if(32768!==(a.node.mode&61440))throw new K(43);a=a.node.i;if(g&2||a.buffer!==Ka){if(0>>0)%Ob.length}function Tb(a){var b=Sb(a.parent.id,a.name);if(Ob[b]===a)Ob[b]=a.T;else for(b=Ob[b];b;){if(b.T===a){b.T=a.T;break}b=b.T}} -function Hb(a,b){var d;if(d=(d=Ub(a,"x"))?d:a.h.lookup?0:2)throw new K(d,a);for(d=Ob[Sb(a.id,b)];d;d=d.T){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return a.h.lookup(a,b)}function Fb(a,b,d,e){assert("object"===typeof a);a=new Vb(a,b,d,e);b=Sb(a.parent.id,a.name);a.T=Ob[b];return Ob[b]=a}function M(a){return 16384===(a&61440)}var Wb={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Xb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b} -function Ub(a,b){if(Pb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Yb(a,b){try{return Hb(a,b),20}catch(d){}return Ub(a,"wx")}function Zb(a,b,d){try{var e=Hb(a,b)}catch(h){return h.u}if(a=Ub(a,"wx"))return a;if(d){if(!M(e.mode))return 54;if(e===e.parent||"/"===Rb(e))return 10}else if(M(e.mode))return 31;return 0}function $b(a){var b=4096;for(a=a||0;a<=b;a++)if(!Mb[a])return a;throw new K(33);} -function ac(a,b){bc||(bc=function(){},bc.prototype={});var d=new bc,e;for(e in a)d[e]=a[e];a=d;b=$b(b);a.fd=b;return Mb[b]=a}var Eb={open:function(a){a.l=Lb[a.node.rdev].l;a.l.open&&a.l.open(a)},N:function(){throw new K(70);}};function zb(a,b){Lb[a]={l:b}} -function cc(a,b){if("string"===typeof a)throw a;var d="/"===b,e=!b;if(d&&Kb)throw new K(10);if(!d&&!e){var h=O(b,{pa:!1});b=h.path;h=h.node;if(h.S)throw new K(10);if(!M(h.mode))throw new K(54);}b={type:a,md:{},sa:b,Da:[]};a=a.I(b);a.I=b;b.root=a;d?Kb=a:h&&(h.S=b,h.I&&h.I.Da.push(b))}function dc(a,b,d){var e=O(a,{parent:!0}).node;a=ub(a);if(!a||"."===a||".."===a)throw new K(28);var h=Yb(e,a);if(h)throw new K(h);if(!e.h.aa)throw new K(63);return e.h.aa(e,a,b,d)} -function P(a,b){return dc(a,(void 0!==b?b:511)&1023|16384,0)}function ec(a,b,d){"undefined"===typeof d&&(d=b,b=438);dc(a,b|8192,d)}function fc(a,b){if(!wb(a))throw new K(44);var d=O(b,{parent:!0}).node;if(!d)throw new K(44);b=ub(b);var e=Yb(d,b);if(e)throw new K(e);if(!d.h.symlink)throw new K(63);d.h.symlink(d,b,a)}function Qb(a){a=O(a).node;if(!a)throw new K(44);if(!a.h.readlink)throw new K(28);return wb(Rb(a.parent),a.h.readlink(a))} -function gc(a,b,d,e){if(""===a)throw new K(44);if("string"===typeof b){var h=Wb[b];if("undefined"===typeof h)throw Error("Unknown file open mode: "+b);b=h}d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var g=a;else{a=sb(a);try{g=O(a,{ga:!(b&131072)}).node}catch(k){}}h=!1;if(b&64)if(g){if(b&128)throw new K(20);}else g=dc(a,d,0),h=!0;if(!g)throw new K(44);8192===(g.mode&61440)&&(b&=-513);if(b&65536&&!M(g.mode))throw new K(54);if(!h&&(d=g?40960===(g.mode&61440)?32:M(g.mode)&& -("r"!==Xb(b)||b&512)?31:Ub(g,Xb(b)):44))throw new K(d);if(b&512){d=g;d="string"===typeof d?O(d,{ga:!0}).node:d;if(!d.h.G)throw new K(63);if(M(d.mode))throw new K(31);if(32768!==(d.mode&61440))throw new K(28);if(h=Ub(d,"w"))throw new K(h);d.h.G(d,{size:0,timestamp:Date.now()})}b&=-131713;e=ac({node:g,path:Rb(g),flags:b,seekable:!0,position:0,l:g.l,Pa:[],error:!1},e);e.l.open&&e.l.open(e);!c.logReadFiles||b&1||(hc||(hc={}),a in hc||(hc[a]=1,t("FS.trackingDelegate error on read file: "+a)));try{N.onOpenFile&& -(g=0,1!==(b&2097155)&&(g|=1),0!==(b&2097155)&&(g|=2),N.onOpenFile(a,g))}catch(k){t("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+k.message)}return e}function ic(a,b,d){if(null===a.fd)throw new K(8);if(!a.seekable||!a.l.N)throw new K(70);if(0!=d&&1!=d&&2!=d)throw new K(28);a.position=a.l.N(a,b,d);a.Pa=[];return a.position} -function jc(){K||(K=function(a,b){this.node=b;this.Ja=function(d){this.u=d;for(var e in Jb)if(Jb[e]===d){this.code=e;break}};this.Ja(a);this.message=Ib[a];this.stack&&(Object.defineProperty(this,"stack",{value:Error().stack,writable:!0}),this.stack=fb(this.stack))},K.prototype=Error(),K.prototype.constructor=K,[44].forEach(function(a){Gb[a]=new K(a);Gb[a].stack=""}))}var kc;function lc(a,b){var d=0;a&&(d|=365);b&&(d|=146);return d} -function mc(a,b,d){a=sb("/dev/"+a);var e=lc(!!b,!!d);nc||(nc=64);var h=nc++<<8|0;zb(h,{open:function(g){g.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(g,k,m,r){for(var n=0,p=0;p>2]}function qc(a){a=Mb[a];if(!a)throw new K(8);return a}function rc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var sc=void 0;function S(a){for(var b="";A[a];)b+=sc[A[a++]];return b}var tc={},uc={},vc={}; -function wc(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function xc(a,b){a=wc(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} -function yc(a){var b=Error,d=xc(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var zc=void 0;function T(a){throw new zc(a);}var Ac=void 0;function Bc(a){throw new Ac(a);} -function U(a,b,d){function e(m){m=d(m);m.length!==a.length&&Bc("Mismatched type converter count");for(var r=0;r>2])}function Wc(a,b,d){if(b===d)return a;if(void 0===d.D)return null;a=Wc(a,b,d.D);return null===a?null:d.ya(a)}var Xc={}; -function Yc(a,b){for(void 0===b&&T("ptr should not be undefined");a.D;)b=a.Y(b),a=a.D;return Xc[b]}function Zc(a,b){b.o&&b.m||Bc("makeClassHandle requires ptr and ptrType");!!b.C!==!!b.B&&Bc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Gc(Object.create(a,{g:{value:b}}))}function W(a,b,d,e){this.name=a;this.j=b;this.ha=d;this.Z=e;this.$=!1;this.O=this.Ha=this.Ga=this.ua=this.Ka=this.Ea=void 0;void 0!==b.D?this.toWireType=Sc:(this.toWireType=e?Qc:Uc,this.H=null)} -function ad(a,b){c.hasOwnProperty(a)||Bc("Replacing nonexistant public symbol");c[a]=b;c[a].P=void 0} -function bd(a,b){assert(a.includes("j"),"getDynCaller should only be called with i64 sigs");var d=[];return function(){d.length=arguments.length;for(var e=0;eg&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==d,m=!1;for(d=1;d>2)+e]);return d} -function md(a,b,d){a instanceof Object||T(d+' with invalid "this": '+a);a instanceof b.j.constructor||T(d+' incompatible with "this" of type '+a.constructor.name);a.g.m||T("cannot call emscripten binding method "+d+" on deleted object");return Pc(a.g.m,a.g.o.j,b.j)}var nd=[],Y=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function od(a){4>2])};case 3:return function(d){return this.fromWireType(Ma[d>>3])};default:throw new TypeError("Unknown float type: "+a);}} -function qd(a,b,d){switch(b){case 0:return d?function(e){return D[e]}:function(e){return A[e]};case 1:return d?function(e){return Ba[e>>1]}:function(e){return Aa[e>>1]};case 2:return d?function(e){return C[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function rd(){void 0===rd.start&&(rd.start=Date.now());return 1E3*(Date.now()-rd.start)|0}var sd;sd=fa?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()}; -function td(a,b){assert(b===(b|0));return(a>>>0)+4294967296*b}function ud(a,b){if(0>=a)return a;var d=32>=b?Math.abs(1<=d&&(32>=b||a>d)&&(a=-2*d+a);return a}function vd(a,b){return 0<=a?a:32>=b?2*Math.abs(1<>3],e+=8):"i64"==F?(F=[C[e>>2],C[e+4>>2]],e+=8):(assert(0===(e&3)),F=C[e>>2],e+=4);return F}assert(0===(b&3));for(var e=b,h=[],g,k;;){var m=a;g=D[a>>0];if(0===g)break;k=D[a+1>>0];if(37==g){var r=!1,n=b=!1,p=!1,y=!1;a:for(;;){switch(k){case 43:r=!0;break;case 45:b=!0;break;case 35:n=!0;break;case 48:if(p)break a;else{p=!0;break}case 32:y=!0;break;default:break a}a++; -k=D[a+1>>0]}var w=0;if(42==k)w=d("i32"),a++,k=D[a+1>>0];else for(;48<=k&&57>=k;)w=10*w+(k-48),a++,k=D[a+1>>0];var l=!1,u=-1;if(46==k){u=0;l=!0;a++;k=D[a+1>>0];if(42==k)u=d("i32"),a++;else for(;;){k=D[a+1>>0];if(48>k||57>0]}0>u&&(u=6,l=!1);switch(String.fromCharCode(k)){case "h":k=D[a+2>>0];if(104==k){a++;var x=1}else x=2;break;case "l":k=D[a+2>>0];108==k?(a++,x=8):x=4;break;case "L":case "q":case "j":x=8;break;case "z":case "t":case "I":x=4;break;default:x=null}x&& -a++;k=D[a+1>>0];switch(String.fromCharCode(k)){case "d":case "i":case "u":case "o":case "x":case "X":case "p":m=100==k||105==k;x=x||4;g=d("i"+8*x);8==x&&(g=117==k?(g[0]>>>0)+4294967296*(g[1]>>>0):td(g[0],g[1]));4>=x&&(g=(m?ud:vd)(g&Math.pow(256,x)-1,8*x));var B=Math.abs(g);m="";if(100==k||105==k)var v=ud(g,8*x,1).toString(10);else if(117==k)v=vd(g,8*x,1).toString(10),g=Math.abs(g);else if(111==k)v=(n?"0":"")+B.toString(8);else if(120==k||88==k){m=n&&0!=g?"0x":"";if(0>g){g=-g;v=(B-1).toString(16); -B=[];for(n=0;nx&&-4<=x?(k=(103==k?"f":"F").charCodeAt(0),u-=x+1):(k=(103==k?"e":"E").charCodeAt(0),u--),x=Math.min(u,20);if(101==k||69==k)v=g.toExponential(x),/[eE][-+]\d$/.test(v)&&(v=v.slice(0,-1)+"0"+v.slice(-1));else if(102==k||70==k)v=g.toFixed(x),0===g&&(0>g||0===g&&-Infinity===1/g)&&(v="-"+v);m=v.split("e");if(l&&!n)for(;1x++;)m[0]+="0";v=m[0]+(1g?"-":"")+"inf",p=!1;for(;v.lengthk&&(v=v.toUpperCase());v.split("").forEach(function(F){h.push(F.charCodeAt(0))});break;case "s":p=(r=d("i8*"))?wd(r):6;l&&(p=Math.min(p,u));if(!b)for(;p>0]);else h=h.concat(Bb("(null)".substr(0,p),!0));if(b)for(;p>2]=h.length;break;case "%":h.push(g);break;default:for(n=m;n>0])}a+=2}else h.push(g),a+=1}return h} -function yd(a){if(!a||!a.callee||!a.callee.name)return[null,"",""];var b=a.callee.name,d="(",e=!0,h;for(h in a){var g=a[h];e||(d+=", ");e=!1;d="number"===typeof g||"string"===typeof g?d+g:d+("("+typeof g+")")}d+=")";a=(a=a.callee.caller)?a.arguments:[];e&&(d="");return[a,b,d]} -function zd(a){var b=eb();b=b.slice(b.indexOf("\n",Math.max(b.lastIndexOf("_emscripten_log"),b.lastIndexOf("_emscripten_get_callstack")))+1);a&32&&oa("EM_LOG_DEMANGLE is deprecated; ignoring");a&8&&"undefined"===typeof emscripten_source_map&&(oa('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),a=a^8|16);var d=null;if(a&128)for(d=yd(arguments);d[1].includes("_emscripten_");)d= -yd(d[0]);var e=b.split("\n");b="";var h=/\s*(.*?)@(.*?):([0-9]+):([0-9]+)/,g=/\s*(.*?)@(.*):(.*)(:(.*))?/,k=/\s*at (.*?) \((.*):(.*):(.*)\)/,m;for(m in e){var r=e[m],n;if((n=k.exec(r))&&5==n.length){r=n[1];var p=n[2];var y=n[3];n=n[4]}else if((n=h.exec(r))||(n=g.exec(r)),n&&4<=n.length)r=n[1],p=n[2],y=n[3],n=n[4]|0;else{b+=r+"\n";continue}var w=!1;if(a&8){var l=emscripten_source_map.nd({line:y,wa:n});if(w=l&&l.source)a&64&&(l.source=l.source.substring(l.source.replace(/\\/g,"/").lastIndexOf("/")+ -1)),b+=" at "+r+" ("+l.source+":"+l.line+":"+l.wa+")\n"}if(a&16||!w)a&64&&(p=p.substring(p.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=(w?" = "+r:" at "+r)+" ("+p+":"+y+":"+n+")\n";a&128&&d[0]&&(d[1]==r&&0v?-1:0=k(x,l)?0>=k(u,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var n=C[e+40>>2];e={Na:C[e>>2],Ma:C[e+4>>2],ba:C[e+8>>2],X:C[e+12>>2],V:C[e+16>>2],A:C[e+20>>2],da:C[e+24>>2],ea:C[e+28>>2],od:C[e+32>>2],La:C[e+36>> -2],Oa:n?z(n):""};d=z(d);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in n)d=d.replace(new RegExp(p,"g"),n[p]);var y="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), -w="January February March April May June July August September October November December".split(" ");n={"%a":function(l){return y[l.da].substring(0,3)},"%A":function(l){return y[l.da]},"%b":function(l){return w[l.V].substring(0,3)},"%B":function(l){return w[l.V]},"%C":function(l){return g((l.A+1900)/100|0,2)},"%d":function(l){return g(l.X,2)},"%e":function(l){return h(l.X,2," ")},"%g":function(l){return r(l).toString().substring(2)},"%G":function(l){return r(l)},"%H":function(l){return g(l.ba,2)}, -"%I":function(l){l=l.ba;0==l?l=12:12l.ba?"AM":"PM"},"%S":function(l){return g(l.Na,2)},"%t":function(){return"\t"},"%u":function(l){return l.da||7},"%U":function(l){var u=new Date(l.A+1900,0,1),x=0===u.getDay()?u:Hd(u,7-u.getDay());l=new Date(l.A+1900,l.V,l.X);return 0>k(x,l)? -g(Math.ceil((31-x.getDate()+(Ed(Dd(l.getFullYear())?Fd:Gd,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(x,u)?"01":"00"},"%V":function(l){var u=new Date(l.A+1901,0,4),x=m(new Date(l.A+1900,0,4));u=m(u);var B=Hd(new Date(l.A+1900,0,1),l.ea);return 0>k(B,x)?"53":0>=k(u,B)?"01":g(Math.ceil((x.getFullYear()k(x,l)?g(Math.ceil((31-x.getDate()+(Ed(Dd(l.getFullYear())?Fd:Gd,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(x,u)?"01":"00"},"%y":function(l){return(l.A+1900).toString().substring(2)},"%Y":function(l){return l.A+1900},"%z":function(l){l=l.La;var u=0<=l;l=Math.abs(l)/60;return(u?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Oa},"%%":function(){return"%"}};for(p in n)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),n[p](e)));p=Bb(d,!1);if(p.length> -b)return 0;Ja(p,a);return p.length-1}function Vb(a,b,d,e){a||(a=this);this.parent=a;this.I=a.I;this.S=null;this.id=Nb++;this.name=b;this.mode=d;this.h={};this.l={};this.rdev=e}Object.defineProperties(Vb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});jc();Ob=Array(4096);cc(L,"/");P("/tmp");P("/home");P("/home/web_user"); -(function(){P("/dev");zb(259,{read:function(){return 0},write:function(b,d,e,h){return h}});ec("/dev/null",259);yb(1280,Cb);yb(1536,Db);ec("/dev/tty",1280);ec("/dev/tty1",1536);var a=vb();mc("random",a);mc("urandom",a);P("/dev/shm");P("/dev/shm/tmp")})(); -(function(){P("/proc");var a=P("/proc/self");P("/proc/self/fd");cc({I:function(){var b=Fb(a,"fd",16895,73);b.h={lookup:function(d,e){var h=Mb[+e];if(!h)throw new K(8);d={parent:null,I:{sa:"fake"},h:{readlink:function(){return h.path}}};return d.parent=d}};return b}},"/proc/self/fd")})();for(var Jd=Array(256),Kd=0;256>Kd;++Kd)Jd[Kd]=String.fromCharCode(Kd);sc=Jd;zc=c.BindingError=yc("BindingError");Ac=c.InternalError=yc("InternalError"); -Kc.prototype.isAliasOf=function(a){if(!(this instanceof Kc&&a instanceof Kc))return!1;var b=this.g.o.j,d=this.g.m,e=a.g.o.j;for(a=a.g.m;b.D;)d=b.Y(d),b=b.D;for(;e.D;)a=e.Y(a),e=e.D;return b===e&&d===a};Kc.prototype.clone=function(){this.g.m||Cc(this);if(this.g.W)return this.g.count.value+=1,this;var a=Gc,b=Object,d=b.create,e=Object.getPrototypeOf(this),h=this.g;a=a(d.call(b,e,{g:{value:{count:h.count,R:h.R,W:h.W,m:h.m,o:h.o,B:h.B,C:h.C}}}));a.g.count.value+=1;a.g.R=!1;return a}; -Kc.prototype["delete"]=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ec(this);Fc(this.g);this.g.W||(this.g.B=void 0,this.g.m=void 0)};Kc.prototype.isDeleted=function(){return!this.g.m};Kc.prototype.deleteLater=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ic.push(this);1===Ic.length&&Hc&&Hc(Jc);this.g.R=!0;return this};W.prototype.Aa=function(a){this.ua&&(a=this.ua(a));return a}; -W.prototype.na=function(a){this.O&&this.O(a)};W.prototype.argPackAdvance=8;W.prototype.readValueFromPointer=Vc;W.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; -W.prototype.fromWireType=function(a){function b(){return this.$?Zc(this.j.K,{o:this.Ea,m:d,C:this,B:a}):Zc(this.j.K,{o:this,m:a})}var d=this.Aa(a);if(!d)return this.na(a),null;var e=Yc(this.j,d);if(void 0!==e){if(0===e.g.count.value)return e.g.m=d,e.g.B=a,e.clone();e=e.clone();this.na(a);return e}e=this.j.za(d);e=Lc[e];if(!e)return b.call(this);e=this.Z?e.xa:e.pointerType;var h=Wc(d,this.j,e.j);return null===h?b.call(this):this.$?Zc(e.j.K,{o:e,m:h,C:this,B:a}):Zc(e.j.K,{o:e,m:h})}; -c.getInheritedInstanceCount=function(){return Object.keys(Xc).length};c.getLiveInheritedInstances=function(){var a=[],b;for(b in Xc)Xc.hasOwnProperty(b)&&a.push(Xc[b]);return a};c.flushPendingDeletes=Jc;c.setDelayFunction=function(a){Hc=a;Ic.length&&Hc&&Hc(Jc)};cd=c.UnboundTypeError=yc("UnboundTypeError");c.count_emval_handles=function(){for(var a=0,b=5;b>2]);C[b>>2]=a.getUTCSeconds();C[b+4>>2]=a.getUTCMinutes();C[b+8>>2]=a.getUTCHours();C[b+12>>2]=a.getUTCDate();C[b+16>>2]=a.getUTCMonth();C[b+20>>2]=a.getUTCFullYear()-1900;C[b+24>>2]=a.getUTCDay();C[b+36>>2]=0;C[b+32>>2]=0;C[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;lb||(lb=Ha("GMT"));C[b+40>>2]=lb;return b},__localtime_r:function(a,b){mb();a=new Date(1E3*C[a>>2]);C[b>>2]=a.getSeconds();C[b+ -4>>2]=a.getMinutes();C[b+8>>2]=a.getHours();C[b+12>>2]=a.getDate();C[b+16>>2]=a.getMonth();C[b+20>>2]=a.getFullYear()-1900;C[b+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);C[b+28>>2]=(a.getTime()-d.getTime())/864E5|0;C[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;C[b+32>>2]=a;a=C[qb()+(a?4:0)>>2];C[b+40>>2]=a;return b},__sys_fcntl64:function(a,b,d){oc=d;try{var e=qc(a); -switch(b){case 0:var h=pc();return 0>h?-28:gc(e.path,e.flags,0,h).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return h=pc(),e.flags|=h,0;case 12:return h=pc(),Ba[h+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return C[Ld()>>2]=28,-1;default:return-28}}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},__sys_getdents64:function(a,b,d){try{var e=qc(a);if(!e.M){var h=O(e.path,{ga:!0}).node;if(!h.h.readdir)throw new K(54);var g=h.h.readdir(h);e.M=g}a=0; -for(var k=ic(e,0,1),m=Math.floor(k/280);m>>0,(I=n,1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];C[b+a>>2]=J[0];C[b+a+4>>2]=J[1];J=[280*(m+1)>>>0,(I=280*(m+1),1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>> -0))/4294967296)>>>0:0)];C[b+a+8>>2]=J[0];C[b+a+12>>2]=J[1];Ba[b+a+16>>1]=280;D[b+a+18>>0]=p;wa(r,b+a+19,256);a+=280;m+=1}ic(e,280*m,0);return a}catch(w){return"undefined"!==typeof R&&w instanceof K||q(w),-w.u}},__sys_ioctl:function(a,b,d){oc=d;try{var e=qc(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var h=pc();return C[h>>2]=0;case 21520:return e.tty?-28:-59;case 21531:a=h= -pc();if(!e.l.Ca)throw new K(59);return e.l.Ca(e,b,a);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:q("bad ioctl syscall "+b)}}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},__sys_mkdir:function(a,b){try{return a=z(a),a=sb(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),P(a,b),0}catch(d){return"undefined"!==typeof R&&d instanceof K||q(d),-d.u}},__sys_open:function(a,b,d){oc=d;try{var e=z(a),h=d?pc():0;return gc(e,b,h).fd}catch(g){return"undefined"!==typeof R&& -g instanceof K||q(g),-g.u}},__sys_readlink:function(a,b,d){try{a=z(a);if(0>=d)var e=-28;else{var h=Qb(a),g=Math.min(d,xa(h)),k=D[b+g];wa(h,b,d+1);D[b+g]=k;e=g}return e}catch(m){return"undefined"!==typeof R&&m instanceof K||q(m),-m.u}},__sys_rmdir:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=ub(a),e=Hb(b,d),h=Zb(b,d,!0);if(h)throw new K(h);if(!b.h.rmdir)throw new K(63);if(e.S)throw new K(10);try{N.willDeletePath&&N.willDeletePath(a)}catch(g){t("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+ -g.message)}b.h.rmdir(b,d);Tb(e);try{if(N.onDeletePath)N.onDeletePath(a)}catch(g){t("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},__sys_unlink:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=ub(a),e=Hb(b,d),h=Zb(b,d,!1);if(h)throw new K(h);if(!b.h.unlink)throw new K(63);if(e.S)throw new K(10);try{N.willDeletePath&&N.willDeletePath(a)}catch(g){t("FS.trackingDelegate['willDeletePath']('"+ -a+"') threw an exception: "+g.message)}b.h.unlink(b,d);Tb(e);try{if(N.onDeletePath)N.onDeletePath(a)}catch(g){t("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},_embind_register_bigint:function(){},_embind_register_bool:function(a,b,d,e,h){var g=rc(d);b=S(b);V(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,m){return m?e:h},argPackAdvance:8,readValueFromPointer:function(k){if(1=== -d)var m=D;else if(2===d)m=Ba;else if(4===d)m=C;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(m[k>>g])},H:null})},_embind_register_class:function(a,b,d,e,h,g,k,m,r,n,p,y,w){p=S(p);g=X(h,g);m&&(m=X(k,m));n&&(n=X(r,n));w=X(y,w);var l=wc(p);Nc(l,function(){gd("Cannot construct "+p+" due to unbound types",[e])});U([a,b,d],e?[e]:[],function(u){u=u[0];if(e){var x=u.j;var B=x.K}else B=Kc.prototype;u=xc(l,function(){if(Object.getPrototypeOf(this)!==v)throw new zc("Use 'new' to construct "+ -p);if(void 0===F.L)throw new zc(p+" has no accessible constructor");var $c=F.L[arguments.length];if(void 0===$c)throw new zc("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(F.L).toString()+") parameters instead!");return $c.apply(this,arguments)});var v=Object.create(B,{constructor:{value:u}});u.prototype=v;var F=new Oc(p,u,v,w,x,g,m,n);x=new W(p,F,!0,!1);B=new W(p+"*",F,!1,!1);var Q=new W(p+" const*",F,!1,!0);Lc[a]={pointerType:B, -xa:Q};ad(l,u);return[x,B,Q]})},_embind_register_class_class_function:function(a,b,d,e,h,g,k){var m=ld(d,e);b=S(b);g=X(h,g);U([],[a],function(r){function n(){gd("Cannot call "+p+" due to unbound types",m)}r=r[0];var p=r.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var y=r.j.constructor;void 0===y[b]?(n.P=d-1,y[b]=n):(Mc(y,b,p),y[b].v[d-1]=n);U([],m,function(w){w=[w[0],null].concat(w.slice(1));w=kd(p,w,null,g,k);void 0===y[b].v?(w.P=d-1,y[b]=w):y[b].v[d-1]=w;return[]});return[]})},_embind_register_class_constructor:function(a, -b,d,e,h,g){assert(0>>m}}var r=b.includes("unsigned");V(a,{name:b,fromWireType:g,toWireType:function(n,p){if("number"!==typeof p&&"boolean"!==typeof p)throw new TypeError('Cannot convert "'+Rc(p)+'" to '+this.name);if(ph)throw new TypeError('Passing a number "'+Rc(p)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+h+"]!");return r?p>>>0:p|0},argPackAdvance:8,readValueFromPointer:qd(b,k,0!==e),H:null})}, -_embind_register_memory_view:function(a,b,d){function e(g){g>>=2;var k=E;return new h(Ka,k[g+1],k[g])}var h=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];d=S(d);V(a,{name:d,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Ba:!0})},_embind_register_std_string:function(a,b){b=S(b);var d="std::string"===b;V(a,{name:b,fromWireType:function(e){var h=E[e>>2];if(d)for(var g=e+4,k=0;k<=h;++k){var m=e+4+k;if(k==h||0==A[m]){g=z(g,m-g);if(void 0=== -r)var r=g;else r+=String.fromCharCode(0),r+=g;g=m+1}}else{r=Array(h);for(k=0;k>2]=k;if(d&&g)wa(h,m+4,k+1);else if(g)for(g= -0;g>2],p=k(),y,w=r+4, -l=0;l<=n;++l){var u=r+4+l*b;if(l==n||0==p[u>>m])w=e(w,u-w),void 0===y?y=w:(y+=String.fromCharCode(0),y+=w),w=u+b}fd(r);return y},toWireType:function(r,n){"string"!==typeof n&&T("Cannot pass non-string to C++ string type "+d);var p=g(n),y=Ia(4+p+b);E[y>>2]=p>>m;h(n,y+4,p+b);null!==r&&r.push(fd,y);return y},argPackAdvance:8,readValueFromPointer:Vc,H:function(r){fd(r)}})},_embind_register_void:function(a,b){b=S(b);V(a,{ld:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})}, -_emval_decref:od,_emval_incref:function(a){4>2]=28,-1;C[b>>2]=a/1E3|0;C[b+4>>2]=a%1E3*1E6|0;return 0},emscripten_log:function(a,b,d){b=xd(b,d);b=ua(b,0);a&24&&(b=b.replace(/\s+$/,""),b+=(0>>=0;assert(a>b);if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a,e);0>>16);Na();var g=1;break a}catch(k){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+Ka.byteLength+" bytes to "+h+" bytes, but got error: "+k)}g=void 0}if(g)return!0}t("Failed to grow the heap from "+b+" bytes to "+e+" bytes, not enough memory!");return!1},emscripten_run_script:function(a){eval(z(a))},emscripten_run_script_int:function(a){return eval(z(a))|0},emscripten_run_script_string:Z,environ_get:function(a,b){try{var d=0; -Bd().forEach(function(e,h){var g=b+d;h=C[a+4*h>>2]=g;for(g=0;g>0]=e.charCodeAt(g);D[h>>0]=0;d+=e.length+1});return 0}catch(e){return"undefined"!==typeof R&&e instanceof K||q(e),e.u}},environ_sizes_get:function(a,b){try{var d=Bd();C[a>>2]=d.length;var e=0;d.forEach(function(h){e+=h.length+1});C[b>>2]=e;return 0}catch(h){return"undefined"!==typeof R&&h instanceof K||q(h),h.u}},fd_close:function(a){try{var b=qc(a);if(null===b.fd)throw new K(8); -b.M&&(b.M=null);try{b.l.close&&b.l.close(b)}catch(d){throw d;}finally{Mb[b.fd]=null}b.fd=null;return 0}catch(d){return"undefined"!==typeof R&&d instanceof K||q(d),d.u}},fd_read:function(a,b,d,e){try{a:{for(var h=qc(a),g=a=0;g>2],m=h,r=C[b+8*g>>2],n=k,p=void 0,y=D;if(0>n||0>p)throw new K(28);if(null===m.fd)throw new K(8);if(1===(m.flags&2097155))throw new K(8);if(M(m.node.mode))throw new K(31);if(!m.l.read)throw new K(28);var w="undefined"!==typeof p;if(!w)p=m.position;else if(!m.seekable)throw new K(70); -var l=m.l.read(m,y,r,n,p);w||(m.position+=l);var u=l;if(0>u){var x=-1;break a}a+=u;if(u>2]=x;return 0}catch(B){return"undefined"!==typeof R&&B instanceof K||q(B),B.u}},fd_seek:function(a,b,d,e,h){try{var g=qc(a);a=4294967296*d+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;ic(g,a,e);J=[g.position>>>0,(I=g.position,1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];C[h>>2]=J[0];C[h+4>>2]=J[1];g.M&& -0===a&&0===e&&(g.M=null);return 0}catch(k){return"undefined"!==typeof R&&k instanceof K||q(k),k.u}},fd_write:function(a,b,d,e){try{a:{for(var h=qc(a),g=a=0;g>2],r=C[b+(8*g+4)>>2],n=void 0,p=D;if(0>r||0>n)throw new K(28);if(null===k.fd)throw new K(8);if(0===(k.flags&2097155))throw new K(8);if(M(k.node.mode))throw new K(31);if(!k.l.write)throw new K(28);k.seekable&&k.flags&1024&&ic(k,0,2);var y="undefined"!==typeof n;if(!y)n=k.position;else if(!k.seekable)throw new K(70);var w= -k.l.write(k,p,m,r,n,void 0);y||(k.position+=w);try{if(k.path&&N.onWriteToFile)N.onWriteToFile(k.path)}catch(x){t("FS.trackingDelegate['onWriteToFile']('"+k.path+"') threw an exception: "+x.message)}var l=w;if(0>l){var u=-1;break a}a+=l}u=a}C[e>>2]=u;return 0}catch(x){return"undefined"!==typeof R&&x instanceof K||q(x),x.u}},mktime:function(a){mb();var b=new Date(C[a+20>>2]+1900,C[a+16>>2],C[a+12>>2],C[a+8>>2],C[a+4>>2],C[a>>2],0),d=C[a+32>>2],e=b.getTimezoneOffset(),h=new Date(b.getFullYear(),0,1), -g=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=h.getTimezoneOffset(),m=Math.min(k,g);0>d?C[a+32>>2]=Number(g!=k&&m==e):0>2]=b.getDay();C[a+28>>2]=(b.getTime()-h.getTime())/864E5|0;C[a>>2]=b.getSeconds();C[a+4>>2]=b.getMinutes();C[a+8>>2]=b.getHours();C[a+12>>2]=b.getDate();C[a+16>>2]=b.getMonth();return b.getTime()/1E3|0},setTempRet0:function(){},strftime:Id,strftime_l:function(a,b,d,e){return Id(a,b,d,e)},time:function(a){var b= -Date.now()/1E3|0;a&&(C[a>>2]=b);return b}}; -(function(){function a(g){c.asm=g.exports;ra=c.asm.memory;assert(ra,"memory not found in wasm exports");Na();Pa=c.asm.__indirect_function_table;assert(Pa,"table not found in wasm exports");Wa.unshift(c.asm.__wasm_call_ctors);$a--;c.monitorRunDependencies&&c.monitorRunDependencies($a);assert(cb["wasm-instantiate"]);delete cb["wasm-instantiate"];0==$a&&(null!==ab&&(clearInterval(ab),ab=null),bb&&(g=bb,bb=null,g()))}function b(g){assert(c===h,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");h= -null;a(g.instance)}function d(g){return jb().then(function(k){return WebAssembly.instantiate(k,e)}).then(g,function(k){t("failed to asynchronously prepare wasm: "+k);G.startsWith("file://")&&t("warning: Loading from a file URI ("+G+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");q(k)})}var e={env:Md,wasi_snapshot_preview1:Md};db();var h=c;if(c.instantiateWasm)try{return c.instantiateWasm(e, -a)}catch(g){return t("Module.instantiateWasm callback failed with error: "+g),!1}(function(){return qa||"function"!==typeof WebAssembly.instantiateStreaming||gb()||G.startsWith("file://")||"function"!==typeof fetch?d(b):fetch(G,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,e).then(b,function(k){t("wasm streaming compile failed: "+k);t("falling back to ArrayBuffer instantiation");return d(b)})})})();return{}})();c.___wasm_call_ctors=H("__wasm_call_ctors"); -var Ia=c._malloc=H("malloc"),Ld=c.___errno_location=H("__errno_location"),fd=c._free=H("free"),ed=c.___getTypeName=H("__getTypeName");c.___embind_register_native_and_builtin_types=H("__embind_register_native_and_builtin_types");c._emscripten_main_thread_process_queued_calls=H("emscripten_main_thread_process_queued_calls");var Ra=c._emscripten_stack_get_end=function(){return(Ra=c._emscripten_stack_get_end=c.asm.emscripten_stack_get_end).apply(null,arguments)};c._fflush=H("fflush"); -var qb=c.__get_tzname=H("_get_tzname"),pb=c.__get_daylight=H("_get_daylight"),ob=c.__get_timezone=H("_get_timezone");c.stackSave=H("stackSave");c.stackRestore=H("stackRestore");c.stackAlloc=H("stackAlloc");var Nd=c._emscripten_stack_init=function(){return(Nd=c._emscripten_stack_init=c.asm.emscripten_stack_init).apply(null,arguments)};c._emscripten_stack_get_free=function(){return(c._emscripten_stack_get_free=c.asm.emscripten_stack_get_free).apply(null,arguments)};c._saveSetjmp=H("saveSetjmp"); -c._setThrew=H("setThrew");c.dynCall_jiji=H("dynCall_jiji");c.dynCall_viiiiiiji=H("dynCall_viiiiiiji");c.dynCall_viiijj=H("dynCall_viiijj");c.dynCall_viiiiiijjiii=H("dynCall_viiiiiijjiii");c.dynCall_iiiijjii=H("dynCall_iiiijjii");c.dynCall_iiiiij=H("dynCall_iiiiij");c.dynCall_iiiiijj=H("dynCall_iiiiijj");c.dynCall_iiiiiijj=H("dynCall_iiiiiijj");c.dynCall_viijii=H("dynCall_viijii");Object.getOwnPropertyDescriptor(c,"intArrayFromString")||(c.intArrayFromString=function(){q("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"intArrayToString")||(c.intArrayToString=function(){q("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ccall")||(c.ccall=function(){q("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"cwrap")||(c.cwrap=function(){q("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"setValue")||(c.setValue=function(){q("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getValue")||(c.getValue=function(){q("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocate")||(c.allocate=function(){q("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"UTF8ArrayToString")||(c.UTF8ArrayToString=function(){q("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF8ToString")||(c.UTF8ToString=function(){q("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8Array")||(c.stringToUTF8Array=function(){q("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToUTF8")||(c.stringToUTF8=function(){q("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"lengthBytesUTF8")||(c.lengthBytesUTF8=function(){q("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){q("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"addOnPreRun")||(c.addOnPreRun=function(){q("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnInit")||(c.addOnInit=function(){q("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreMain")||(c.addOnPreMain=function(){q("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"addOnExit")||(c.addOnExit=function(){q("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPostRun")||(c.addOnPostRun=function(){q("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeStringToMemory")||(c.writeStringToMemory=function(){q("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeArrayToMemory")||(c.writeArrayToMemory=function(){q("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeAsciiToMemory")||(c.writeAsciiToMemory=function(){q("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addRunDependency")||(c.addRunDependency=function(){q("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"removeRunDependency")||(c.removeRunDependency=function(){q("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createFolder")||(c.FS_createFolder=function(){q("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"FS_createPath")||(c.FS_createPath=function(){q("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createDataFile")||(c.FS_createDataFile=function(){q("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"FS_createPreloadedFile")||(c.FS_createPreloadedFile=function(){q("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createLazyFile")||(c.FS_createLazyFile=function(){q("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"FS_createLink")||(c.FS_createLink=function(){q("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS_createDevice")||(c.FS_createDevice=function(){q("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_unlink")||(c.FS_unlink=function(){q("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"getLEB")||(c.getLEB=function(){q("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFunctionTables")||(c.getFunctionTables=function(){q("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"alignFunctionTables")||(c.alignFunctionTables=function(){q("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerFunctions")||(c.registerFunctions=function(){q("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addFunction")||(c.addFunction=function(){q("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"removeFunction")||(c.removeFunction=function(){q("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){q("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"prettyPrint")||(c.prettyPrint=function(){q("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){q("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getCompilerSetting")||(c.getCompilerSetting=function(){q("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"print")||(c.print=function(){q("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"printErr")||(c.printErr=function(){q("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getTempRet0")||(c.getTempRet0=function(){q("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setTempRet0")||(c.setTempRet0=function(){q("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callMain")||(c.callMain=function(){q("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"abort")||(c.abort=function(){q("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"keepRuntimeAlive")||(c.keepRuntimeAlive=function(){q("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"zeroMemory")||(c.zeroMemory=function(){q("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToNewUTF8")||(c.stringToNewUTF8=function(){q("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setFileTime")||(c.setFileTime=function(){q("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscripten_realloc_buffer")||(c.emscripten_realloc_buffer=function(){q("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ENV")||(c.ENV=function(){q("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_CODES")||(c.ERRNO_CODES=function(){q("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_MESSAGES")||(c.ERRNO_MESSAGES=function(){q("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"setErrNo")||(c.setErrNo=function(){q("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton4")||(c.inetPton4=function(){q("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop4")||(c.inetNtop4=function(){q("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"inetPton6")||(c.inetPton6=function(){q("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop6")||(c.inetNtop6=function(){q("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readSockaddr")||(c.readSockaddr=function(){q("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeSockaddr")||(c.writeSockaddr=function(){q("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"DNS")||(c.DNS=function(){q("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getHostByName")||(c.getHostByName=function(){q("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"GAI_ERRNO_MESSAGES")||(c.GAI_ERRNO_MESSAGES=function(){q("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Protocols")||(c.Protocols=function(){q("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Sockets")||(c.Sockets=function(){q("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getRandomDevice")||(c.getRandomDevice=function(){q("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"traverseStack")||(c.traverseStack=function(){q("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UNWIND_CACHE")||(c.UNWIND_CACHE=function(){q("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"withBuiltinMalloc")||(c.withBuiltinMalloc=function(){q("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgsArray")||(c.readAsmConstArgsArray=function(){q("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgs")||(c.readAsmConstArgs=function(){q("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"mainThreadEM_ASM")||(c.mainThreadEM_ASM=function(){q("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_q")||(c.jstoi_q=function(){q("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_s")||(c.jstoi_s=function(){q("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getExecutableName")||(c.getExecutableName=function(){q("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"listenOnce")||(c.listenOnce=function(){q("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"autoResumeAudioContext")||(c.autoResumeAudioContext=function(){q("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"dynCallLegacy")||(c.dynCallLegacy=function(){q("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getDynCaller")||(c.getDynCaller=function(){q("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){q("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"callRuntimeCallbacks")||(c.callRuntimeCallbacks=function(){q("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePush")||(c.runtimeKeepalivePush=function(){q("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePop")||(c.runtimeKeepalivePop=function(){q("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"callUserCallback")||(c.callUserCallback=function(){q("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeExit")||(c.maybeExit=function(){q("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"safeSetTimeout")||(c.safeSetTimeout=function(){q("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"asmjsMangle")||(c.asmjsMangle=function(){q("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asyncLoad")||(c.asyncLoad=function(){q("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"mmapAlloc")||(c.mmapAlloc=function(){q("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"reallyNegative")||(c.reallyNegative=function(){q("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"unSign")||(c.unSign=function(){q("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reSign")||(c.reSign=function(){q("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"formatString")||(c.formatString=function(){q("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH")||(c.PATH=function(){q("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH_FS")||(c.PATH_FS=function(){q("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SYSCALLS")||(c.SYSCALLS=function(){q("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMmap2")||(c.syscallMmap2=function(){q("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMunmap")||(c.syscallMunmap=function(){q("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getSocketFromFD")||(c.getSocketFromFD=function(){q("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getSocketAddress")||(c.getSocketAddress=function(){q("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"JSEvents")||(c.JSEvents=function(){q("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerKeyEventCallback")||(c.registerKeyEventCallback=function(){q("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"specialHTMLTargets")||(c.specialHTMLTargets=function(){q("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeCStringToJsString")||(c.maybeCStringToJsString=function(){q("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"findEventTarget")||(c.findEventTarget=function(){q("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"findCanvasEventTarget")||(c.findCanvasEventTarget=function(){q("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBoundingClientRect")||(c.getBoundingClientRect=function(){q("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillMouseEventData")||(c.fillMouseEventData=function(){q("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerMouseEventCallback")||(c.registerMouseEventCallback=function(){q("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerWheelEventCallback")||(c.registerWheelEventCallback=function(){q("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerUiEventCallback")||(c.registerUiEventCallback=function(){q("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerFocusEventCallback")||(c.registerFocusEventCallback=function(){q("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillDeviceOrientationEventData")||(c.fillDeviceOrientationEventData=function(){q("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceOrientationEventCallback")||(c.registerDeviceOrientationEventCallback=function(){q("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillDeviceMotionEventData")||(c.fillDeviceMotionEventData=function(){q("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceMotionEventCallback")||(c.registerDeviceMotionEventCallback=function(){q("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"screenOrientation")||(c.screenOrientation=function(){q("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillOrientationChangeEventData")||(c.fillOrientationChangeEventData=function(){q("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerOrientationChangeEventCallback")||(c.registerOrientationChangeEventCallback=function(){q("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillFullscreenChangeEventData")||(c.fillFullscreenChangeEventData=function(){q("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerFullscreenChangeEventCallback")||(c.registerFullscreenChangeEventCallback=function(){q("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerRestoreOldStyle")||(c.registerRestoreOldStyle=function(){q("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"hideEverythingExceptGivenElement")||(c.hideEverythingExceptGivenElement=function(){q("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreHiddenElements")||(c.restoreHiddenElements=function(){q("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setLetterbox")||(c.setLetterbox=function(){q("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"currentFullscreenStrategy")||(c.currentFullscreenStrategy=function(){q("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreOldWindowedStyle")||(c.restoreOldWindowedStyle=function(){q("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"softFullscreenResizeWebGLRenderTarget")||(c.softFullscreenResizeWebGLRenderTarget=function(){q("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"doRequestFullscreen")||(c.doRequestFullscreen=function(){q("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillPointerlockChangeEventData")||(c.fillPointerlockChangeEventData=function(){q("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerPointerlockChangeEventCallback")||(c.registerPointerlockChangeEventCallback=function(){q("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerPointerlockErrorEventCallback")||(c.registerPointerlockErrorEventCallback=function(){q("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requestPointerLock")||(c.requestPointerLock=function(){q("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillVisibilityChangeEventData")||(c.fillVisibilityChangeEventData=function(){q("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerVisibilityChangeEventCallback")||(c.registerVisibilityChangeEventCallback=function(){q("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerTouchEventCallback")||(c.registerTouchEventCallback=function(){q("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillGamepadEventData")||(c.fillGamepadEventData=function(){q("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerGamepadEventCallback")||(c.registerGamepadEventCallback=function(){q("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerBeforeUnloadEventCallback")||(c.registerBeforeUnloadEventCallback=function(){q("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillBatteryEventData")||(c.fillBatteryEventData=function(){q("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"battery")||(c.battery=function(){q("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerBatteryEventCallback")||(c.registerBatteryEventCallback=function(){q("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setCanvasElementSize")||(c.setCanvasElementSize=function(){q("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getCanvasElementSize")||(c.getCanvasElementSize=function(){q("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"polyfillSetImmediate")||(c.polyfillSetImmediate=function(){q("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangle")||(c.demangle=function(){q("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangleAll")||(c.demangleAll=function(){q("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"jsStackTrace")||(c.jsStackTrace=function(){q("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){q("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getEnvStrings")||(c.getEnvStrings=function(){q("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"checkWasiClock")||(c.checkWasiClock=function(){q("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64")||(c.writeI53ToI64=function(){q("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Clamped")||(c.writeI53ToI64Clamped=function(){q("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeI53ToI64Signaling")||(c.writeI53ToI64Signaling=function(){q("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Clamped")||(c.writeI53ToU64Clamped=function(){q("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Signaling")||(c.writeI53ToU64Signaling=function(){q("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"readI53FromI64")||(c.readI53FromI64=function(){q("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readI53FromU64")||(c.readI53FromU64=function(){q("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertI32PairToI53")||(c.convertI32PairToI53=function(){q("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"convertU32PairToI53")||(c.convertU32PairToI53=function(){q("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"uncaughtExceptionCount")||(c.uncaughtExceptionCount=function(){q("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionLast")||(c.exceptionLast=function(){q("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"exceptionCaught")||(c.exceptionCaught=function(){q("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ExceptionInfo")||(c.ExceptionInfo=function(){q("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"CatchInfo")||(c.CatchInfo=function(){q("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"exception_addRef")||(c.exception_addRef=function(){q("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exception_decRef")||(c.exception_decRef=function(){q("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Browser")||(c.Browser=function(){q("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"funcWrappers")||(c.funcWrappers=function(){q("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){q("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setMainLoop")||(c.setMainLoop=function(){q("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"wget")||(c.wget=function(){q("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS")||(c.FS=function(){q("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"MEMFS")||(c.MEMFS=function(){q("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"TTY")||(c.TTY=function(){q("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"PIPEFS")||(c.PIPEFS=function(){q("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SOCKFS")||(c.SOCKFS=function(){q("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"_setNetworkCallback")||(c._setNetworkCallback=function(){q("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"tempFixedLengthArray")||(c.tempFixedLengthArray=function(){q("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"miniTempWebGLFloatBuffers")||(c.miniTempWebGLFloatBuffers=function(){q("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapObjectForWebGLType")||(c.heapObjectForWebGLType=function(){q("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"heapAccessShiftForWebGLHeap")||(c.heapAccessShiftForWebGLHeap=function(){q("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GL")||(c.GL=function(){q("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGet")||(c.emscriptenWebGLGet=function(){q("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"computeUnpackAlignedImageSize")||(c.computeUnpackAlignedImageSize=function(){q("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetTexPixelData")||(c.emscriptenWebGLGetTexPixelData=function(){q("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetUniform")||(c.emscriptenWebGLGetUniform=function(){q("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglGetUniformLocation")||(c.webglGetUniformLocation=function(){q("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"webglPrepareUniformLocationsBeforeFirstUse")||(c.webglPrepareUniformLocationsBeforeFirstUse=function(){q("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglGetLeftBracePos")||(c.webglGetLeftBracePos=function(){q("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetVertexAttrib")||(c.emscriptenWebGLGetVertexAttrib=function(){q("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeGLArray")||(c.writeGLArray=function(){q("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AL")||(c.AL=function(){q("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SDL_unicode")||(c.SDL_unicode=function(){q("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_ttfContext")||(c.SDL_ttfContext=function(){q("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_audio")||(c.SDL_audio=function(){q("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SDL")||(c.SDL=function(){q("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_gfx")||(c.SDL_gfx=function(){q("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLUT")||(c.GLUT=function(){q("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"EGL")||(c.EGL=function(){q("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"GLFW_Window")||(c.GLFW_Window=function(){q("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW")||(c.GLFW=function(){q("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLEW")||(c.GLEW=function(){q("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"IDBStore")||(c.IDBStore=function(){q("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runAndAbortIfError")||(c.runAndAbortIfError=function(){q("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_handle_array")||(c.emval_handle_array=function(){q("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emval_free_list")||(c.emval_free_list=function(){q("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_symbols")||(c.emval_symbols=function(){q("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_emval")||(c.init_emval=function(){q("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"count_emval_handles")||(c.count_emval_handles=function(){q("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"get_first_emval")||(c.get_first_emval=function(){q("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getStringOrSymbol")||(c.getStringOrSymbol=function(){q("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"requireHandle")||(c.requireHandle=function(){q("'requireHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_newers")||(c.emval_newers=function(){q("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"craftEmvalAllocator")||(c.craftEmvalAllocator=function(){q("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emval_get_global")||(c.emval_get_global=function(){q("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_methodCallers")||(c.emval_methodCallers=function(){q("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"InternalError")||(c.InternalError=function(){q("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"BindingError")||(c.BindingError=function(){q("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UnboundTypeError")||(c.UnboundTypeError=function(){q("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PureVirtualError")||(c.PureVirtualError=function(){q("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"init_embind")||(c.init_embind=function(){q("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInternalError")||(c.throwInternalError=function(){q("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwBindingError")||(c.throwBindingError=function(){q("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"throwUnboundTypeError")||(c.throwUnboundTypeError=function(){q("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ensureOverloadTable")||(c.ensureOverloadTable=function(){q("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exposePublicSymbol")||(c.exposePublicSymbol=function(){q("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"replacePublicSymbol")||(c.replacePublicSymbol=function(){q("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"extendError")||(c.extendError=function(){q("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"createNamedFunction")||(c.createNamedFunction=function(){q("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registeredInstances")||(c.registeredInstances=function(){q("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBasestPointer")||(c.getBasestPointer=function(){q("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerInheritedInstance")||(c.registerInheritedInstance=function(){q("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"unregisterInheritedInstance")||(c.unregisterInheritedInstance=function(){q("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstance")||(c.getInheritedInstance=function(){q("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstanceCount")||(c.getInheritedInstanceCount=function(){q("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getLiveInheritedInstances")||(c.getLiveInheritedInstances=function(){q("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredTypes")||(c.registeredTypes=function(){q("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"awaitingDependencies")||(c.awaitingDependencies=function(){q("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"typeDependencies")||(c.typeDependencies=function(){q("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredPointers")||(c.registeredPointers=function(){q("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerType")||(c.registerType=function(){q("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"whenDependentTypesAreResolved")||(c.whenDependentTypesAreResolved=function(){q("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_charCodes")||(c.embind_charCodes=function(){q("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_init_charCodes")||(c.embind_init_charCodes=function(){q("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"readLatin1String")||(c.readLatin1String=function(){q("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getTypeName")||(c.getTypeName=function(){q("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heap32VectorToArray")||(c.heap32VectorToArray=function(){q("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"requireRegisteredType")||(c.requireRegisteredType=function(){q("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getShiftFromSize")||(c.getShiftFromSize=function(){q("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"integerReadValueFromPointer")||(c.integerReadValueFromPointer=function(){q("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"enumReadValueFromPointer")||(c.enumReadValueFromPointer=function(){q("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"floatReadValueFromPointer")||(c.floatReadValueFromPointer=function(){q("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"simpleReadValueFromPointer")||(c.simpleReadValueFromPointer=function(){q("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructors")||(c.runDestructors=function(){q("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"new_")||(c.new_=function(){q("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"craftInvokerFunction")||(c.craftInvokerFunction=function(){q("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind__requireFunction")||(c.embind__requireFunction=function(){q("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"tupleRegistrations")||(c.tupleRegistrations=function(){q("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"structRegistrations")||(c.structRegistrations=function(){q("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"genericPointerToWireType")||(c.genericPointerToWireType=function(){q("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"constNoSmartPtrRawPointerToWireType")||(c.constNoSmartPtrRawPointerToWireType=function(){q("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"nonConstNoSmartPtrRawPointerToWireType")||(c.nonConstNoSmartPtrRawPointerToWireType=function(){q("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"init_RegisteredPointer")||(c.init_RegisteredPointer=function(){q("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer")||(c.RegisteredPointer=function(){q("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_getPointee")||(c.RegisteredPointer_getPointee=function(){q("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"RegisteredPointer_destructor")||(c.RegisteredPointer_destructor=function(){q("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_deleteObject")||(c.RegisteredPointer_deleteObject=function(){q("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"RegisteredPointer_fromWireType")||(c.RegisteredPointer_fromWireType=function(){q("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructor")||(c.runDestructor=function(){q("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"releaseClassHandle")||(c.releaseClassHandle=function(){q("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"finalizationGroup")||(c.finalizationGroup=function(){q("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer_deps")||(c.detachFinalizer_deps=function(){q("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer")||(c.detachFinalizer=function(){q("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"attachFinalizer")||(c.attachFinalizer=function(){q("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"makeClassHandle")||(c.makeClassHandle=function(){q("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_ClassHandle")||(c.init_ClassHandle=function(){q("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle")||(c.ClassHandle=function(){q("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_isAliasOf")||(c.ClassHandle_isAliasOf=function(){q("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInstanceAlreadyDeleted")||(c.throwInstanceAlreadyDeleted=function(){q("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle_clone")||(c.ClassHandle_clone=function(){q("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_delete")||(c.ClassHandle_delete=function(){q("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"deletionQueue")||(c.deletionQueue=function(){q("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle_isDeleted")||(c.ClassHandle_isDeleted=function(){q("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_deleteLater")||(c.ClassHandle_deleteLater=function(){q("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"flushPendingDeletes")||(c.flushPendingDeletes=function(){q("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"delayFunction")||(c.delayFunction=function(){q("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setDelayFunction")||(c.setDelayFunction=function(){q("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredClass")||(c.RegisteredClass=function(){q("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"shallowCopyInternalPointer")||(c.shallowCopyInternalPointer=function(){q("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"downcastPointer")||(c.downcastPointer=function(){q("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"upcastPointer")||(c.upcastPointer=function(){q("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"validateThis")||(c.validateThis=function(){q("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_0")||(c.char_0=function(){q("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_9")||(c.char_9=function(){q("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"makeLegalFunctionName")||(c.makeLegalFunctionName=function(){q("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"warnOnce")||(c.warnOnce=function(){q("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackSave")||(c.stackSave=function(){q("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stackRestore")||(c.stackRestore=function(){q("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackAlloc")||(c.stackAlloc=function(){q("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AsciiToString")||(c.AsciiToString=function(){q("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToAscii")||(c.stringToAscii=function(){q("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF16ToString")||(c.UTF16ToString=function(){q("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF16")||(c.stringToUTF16=function(){q("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"lengthBytesUTF16")||(c.lengthBytesUTF16=function(){q("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF32ToString")||(c.UTF32ToString=function(){q("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF32")||(c.stringToUTF32=function(){q("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"lengthBytesUTF32")||(c.lengthBytesUTF32=function(){q("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8")||(c.allocateUTF8=function(){q("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8OnStack")||(c.allocateUTF8OnStack=function(){q("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -c.writeStackCookie=Qa;c.checkStackCookie=Sa;Object.getOwnPropertyDescriptor(c,"ALLOC_NORMAL")||Object.defineProperty(c,"ALLOC_NORMAL",{configurable:!0,get:function(){q("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});Object.getOwnPropertyDescriptor(c,"ALLOC_STACK")||Object.defineProperty(c,"ALLOC_STACK",{configurable:!0,get:function(){q("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var Od; -bb=function Pd(){Od||Qd();Od||(bb=Pd)}; -function Qd(){function a(){if(!Od&&(Od=!0,c.calledRun=!0,!sa)){Sa();assert(!Ya);Ya=!0;if(!c.noFSInit&&!kc){assert(!kc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");kc=!0;jc();c.stdin=c.stdin;c.stdout=c.stdout;c.stderr=c.stderr;c.stdin?mc("stdin",c.stdin):fc("/dev/tty","/dev/stdin");c.stdout?mc("stdout",null,c.stdout):fc("/dev/tty","/dev/stdout");c.stderr?mc("stderr",null, -c.stderr):fc("/dev/tty1","/dev/stderr");var b=gc("/dev/stdin",0),d=gc("/dev/stdout",1),e=gc("/dev/stderr",1);assert(0===b.fd,"invalid handle for stdin ("+b.fd+")");assert(1===d.fd,"invalid handle for stdout ("+d.fd+")");assert(2===e.fd,"invalid handle for stderr ("+e.fd+")")}Pb=!1;kb(Wa);if(c.onRuntimeInitialized)c.onRuntimeInitialized();assert(!c._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');Sa();if(c.postRun)for("function"==typeof c.postRun&& -(c.postRun=[c.postRun]);c.postRun.length;)b=c.postRun.shift(),Xa.unshift(b);kb(Xa)}}if(!(0<$a)){Nd();Qa();if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)Za();kb(Va);0<$a||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a(),Sa())}}c.run=Qd;if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0=e);)++d;if(16h?e+=String.fromCharCode(h):(h-=65536,e+= -String.fromCharCode(55296|h>>10,56320|h&1023))}}else e+=String.fromCharCode(h)}return e}function z(a,b){return a?ya(A,a,b):""} -function za(a,b,d,e){if(!(0=k){var m=a.charCodeAt(++g);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;2097152<=k&&ra("Invalid Unicode code point 0x"+k.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF)."); -b[d++]=240|k>>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-h}function Aa(a,b,d){assert("number"==typeof d,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");za(a,A,b,d)}function Ba(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b} -var Ca="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Da(a,b){assert(0==a%2,"Pointer passed to UTF16ToString must be aligned to two bytes!");var d=a>>1;for(var e=d+b/2;!(d>=e)&&Ea[d];)++d;d<<=1;if(32=b/2);++e){var h=Fa[a+2*e>>1];if(0==h)break;d+=String.fromCharCode(h)}return d} -function Ga(a,b,d){assert(0==b%2,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert("number"==typeof d,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var e=b;d=d<2*a.length?d/2:a.length;for(var h=0;h>1]=a.charCodeAt(h),b+=2;Fa[b>>1]=0;return b-e}function Ha(a){return 2*a.length} -function Ia(a,b){assert(0==a%4,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var d=0,e="";!(d>=b/4);){var h=C[a+4*d>>2];if(0==h)break;++d;65536<=h?(h-=65536,e+=String.fromCharCode(55296|h>>10,56320|h&1023)):e+=String.fromCharCode(h)}return e} -function Ja(a,b,d){assert(0==b%4,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert("number"==typeof d,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(4>d)return 0;var e=b;d=e+d-4;for(var h=0;h=g){var k=a.charCodeAt(++h);g=65536+((g&1023)<<10)|k&1023}C[b>>2]=g;b+=4;if(b+4>d)break}C[b>>2]=0;return b-e} -function Ka(a){for(var b=0,d=0;d=e&&++d;b+=4}return b}function La(a){var b=Ba(a)+1,d=Ma(b);d&&za(a,D,d,b);return d}function Na(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");D.set(a,b)}var Oa,D,A,Fa,Ea,C,E,Pa,Qa; -function Ra(){var a=va.buffer;Oa=a;c.HEAP8=D=new Int8Array(a);c.HEAP16=Fa=new Int16Array(a);c.HEAP32=C=new Int32Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=Ea=new Uint16Array(a);c.HEAPU32=E=new Uint32Array(a);c.HEAPF32=Pa=new Float32Array(a);c.HEAPF64=Qa=new Float64Array(a)}c.TOTAL_STACK&&assert(5242880===c.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Sa=c.INITIAL_MEMORY||16777216; -Object.getOwnPropertyDescriptor(c,"INITIAL_MEMORY")||Object.defineProperty(c,"INITIAL_MEMORY",{configurable:!0,get:function(){r("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});assert(5242880<=Sa,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Sa+"! (TOTAL_STACK=5242880)"); -assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");assert(!c.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(16777216==Sa,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var G; -function Ta(){var a=Ua();assert(0==(a&3));E[(a>>2)+1]=34821223;E[(a>>2)+2]=2310721022;C[0]=1668509029}function Va(){if(!wa){var a=Ua(),b=E[(a>>2)+1];a=E[(a>>2)+2];34821223==b&&2310721022==a||r("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+a.toString(16)+" "+b.toString(16));1668509029!==C[0]&&r("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var Wa=new Int16Array(1),Xa=new Int8Array(Wa.buffer); -Wa[0]=25459;if(115!==Xa[0]||99!==Xa[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";var Ya=[],Za=[],$a=[],ab=!1,bb=!1,pa=0;function cb(){var a=c.preRun.shift();Ya.unshift(a)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); -assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var db=0,eb=null,fb=null,gb={}; -function hb(){db++;c.monitorRunDependencies&&c.monitorRunDependencies(db);assert(!gb["wasm-instantiate"]);gb["wasm-instantiate"]=1;null===eb&&"undefined"!==typeof setInterval&&(eb=setInterval(function(){if(wa)clearInterval(eb),eb=null;else{var a=!1,b;for(b in gb)a||(a=!0,t("still waiting on run dependencies:")),t("dependency: "+b);a&&t("(end of list)")}},1E4))}c.preloadedImages={};c.preloadedAudios={}; -function r(a){if(c.onAbort)c.onAbort(a);t(a);wa=!0;a="abort("+a+") at ";var b=ib();c.extraStackTrace&&(b+="\n"+c.extraStackTrace());b=jb(b);throw new WebAssembly.RuntimeError(a+b);}function kb(){return H.startsWith("data:application/octet-stream;base64,")} -function I(a){return function(){var b=c.asm;assert(ab,"native function `"+a+"` called before runtime initialization");assert(!bb,"native function `"+a+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var H;H="dbr-8.8.0.node.wasm";if(!kb()){var lb=H;H=c.locateFile?c.locateFile(lb,f):f+lb} -function mb(){var a=H;try{if(a==H&&ua)return new Uint8Array(ua);if(la)return la(a);throw"both async and sync fetching of the wasm failed";}catch(b){r(b)}} -function nb(){if(!ua&&(ea||fa)){if("function"===typeof fetch&&!H.startsWith("file://"))return fetch(H,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+H+"'";return a.arrayBuffer()}).catch(function(){return mb()});if(ka)return new Promise(function(a,b){ka(H,function(d){a(new Uint8Array(d))},b)})}return Promise.resolve().then(function(){return mb()})}var J,K; -function ob(a){for(;0>2]=60*g;C[tb()>>2]=Number(b!=h);d=a(d);e=a(e);d=La(d);e=La(e);h>2]=d,C[ub()+4>>2]=e):(C[ub()>>2]=e,C[ub()+4>>2]=d)}}var rb; -function vb(a,b){for(var d=0,e=a.length-1;0<=e;e--){var h=a[e];"."===h?a.splice(e,1):".."===h?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(b)for(;d;d--)a.unshift("..");return a}function wb(a){var b="/"===a.charAt(0),d="/"===a.substr(-1);(a=vb(a.split("/").filter(function(e){return!!e}),!b).join("/"))||b||(a=".");a&&d&&(a+="/");return(b?"/":"")+a} -function xb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function yb(a){if("/"===a)return"/";a=wb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)} -function zb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(ha)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(d){}return function(){r("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}} -function Ab(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=vb(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."}var Bb=[];function Cb(a,b){Bb[a]={input:[],output:[],U:b};Db(a,Eb)} -var Eb={open:function(a){var b=Bb[a.node.rdev];if(!b)throw new L(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.U.flush(a.tty)},flush:function(a){a.tty.U.flush(a.tty)},read:function(a,b,d,e){if(!a.tty||!a.tty.U.qa)throw new L(60);for(var h=0,g=0;g=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.i,a.i=new Uint8Array(b), -0=a.node.s)return 0;a=Math.min(a.node.s-h,e);assert(0<=a);if(8b)throw new L(28);return b},la:function(a,b,d){M.oa(a.node,b+d);a.node.s=Math.max(a.node.s,b+d)},ra:function(a,b,d,e,h,g){if(0!==b)throw new L(28);if(32768!==(a.node.mode&61440))throw new L(43);a=a.node.i;if(g&2||a.buffer!==Oa){if(0>>0)%Sb.length}function Xb(a){var b=Wb(a.parent.id,a.name);if(Sb[b]===a)Sb[b]=a.T;else for(b=Sb[b];b;){if(b.T===a){b.T=a.T;break}b=b.T}} -function Lb(a,b){var d;if(d=(d=Yb(a,"x"))?d:a.h.lookup?0:2)throw new L(d,a);for(d=Sb[Wb(a.id,b)];d;d=d.T){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return a.h.lookup(a,b)}function Jb(a,b,d,e){assert("object"===typeof a);a=new Zb(a,b,d,e);b=Wb(a.parent.id,a.name);a.T=Sb[b];return Sb[b]=a}function N(a){return 16384===(a&61440)}var $b={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function ac(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b} -function Yb(a,b){if(Tb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function bc(a,b){try{return Lb(a,b),20}catch(d){}return Yb(a,"wx")}function cc(a,b,d){try{var e=Lb(a,b)}catch(h){return h.u}if(a=Yb(a,"wx"))return a;if(d){if(!N(e.mode))return 54;if(e===e.parent||"/"===Vb(e))return 10}else if(N(e.mode))return 31;return 0}function dc(a){var b=4096;for(a=a||0;a<=b;a++)if(!Qb[a])return a;throw new L(33);} -function ec(a,b){fc||(fc=function(){},fc.prototype={object:{get:function(){return this.node},set:function(h){this.node=h}}});var d=new fc,e;for(e in a)d[e]=a[e];a=d;b=dc(b);a.fd=b;return Qb[b]=a}var Ib={open:function(a){a.l=Pb[a.node.rdev].l;a.l.open&&a.l.open(a)},N:function(){throw new L(70);}};function Db(a,b){Pb[a]={l:b}} -function gc(a,b){if("string"===typeof a)throw a;var d="/"===b,e=!b;if(d&&Ob)throw new L(10);if(!d&&!e){var h=P(b,{pa:!1});b=h.path;h=h.node;if(h.S)throw new L(10);if(!N(h.mode))throw new L(54);}b={type:a,qd:{},sa:b,Ea:[]};a=a.I(b);a.I=b;b.root=a;d?Ob=a:h&&(h.S=b,h.I&&h.I.Ea.push(b))}function hc(a,b,d){var e=P(a,{parent:!0}).node;a=yb(a);if(!a||"."===a||".."===a)throw new L(28);var h=bc(e,a);if(h)throw new L(h);if(!e.h.ba)throw new L(63);return e.h.ba(e,a,b,d)} -function Q(a,b){return hc(a,(void 0!==b?b:511)&1023|16384,0)}function ic(a,b,d){"undefined"===typeof d&&(d=b,b=438);hc(a,b|8192,d)}function jc(a,b){if(!Ab(a))throw new L(44);var d=P(b,{parent:!0}).node;if(!d)throw new L(44);b=yb(b);var e=bc(d,b);if(e)throw new L(e);if(!d.h.symlink)throw new L(63);d.h.symlink(d,b,a)}function Ub(a){a=P(a).node;if(!a)throw new L(44);if(!a.h.readlink)throw new L(28);return Ab(Vb(a.parent),a.h.readlink(a))} -function kc(a,b,d,e){if(""===a)throw new L(44);if("string"===typeof b){var h=$b[b];if("undefined"===typeof h)throw Error("Unknown file open mode: "+b);b=h}d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var g=a;else{a=wb(a);try{g=P(a,{W:!(b&131072)}).node}catch(k){}}h=!1;if(b&64)if(g){if(b&128)throw new L(20);}else g=hc(a,d,0),h=!0;if(!g)throw new L(44);8192===(g.mode&61440)&&(b&=-513);if(b&65536&&!N(g.mode))throw new L(54);if(!h&&(d=g?40960===(g.mode&61440)?32:N(g.mode)&& -("r"!==ac(b)||b&512)?31:Yb(g,ac(b)):44))throw new L(d);if(b&512){d=g;d="string"===typeof d?P(d,{W:!0}).node:d;if(!d.h.G)throw new L(63);if(N(d.mode))throw new L(31);if(32768!==(d.mode&61440))throw new L(28);if(h=Yb(d,"w"))throw new L(h);d.h.G(d,{size:0,timestamp:Date.now()})}b&=-131713;e=ec({node:g,path:Vb(g),flags:b,seekable:!0,position:0,l:g.l,Ta:[],error:!1},e);e.l.open&&e.l.open(e);!c.logReadFiles||b&1||(lc||(lc={}),a in lc||(lc[a]=1,t("FS.trackingDelegate error on read file: "+a)));try{O.onOpenFile&& -(g=0,1!==(b&2097155)&&(g|=1),0!==(b&2097155)&&(g|=2),O.onOpenFile(a,g))}catch(k){t("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+k.message)}return e}function mc(a,b,d){if(null===a.fd)throw new L(8);if(!a.seekable||!a.l.N)throw new L(70);if(0!=d&&1!=d&&2!=d)throw new L(28);a.position=a.l.N(a,b,d);a.Ta=[];return a.position} -function nc(){L||(L=function(a,b){this.node=b;this.Na=function(d){this.u=d;for(var e in Nb)if(Nb[e]===d){this.code=e;break}};this.Na(a);this.message=Mb[a];this.stack&&(Object.defineProperty(this,"stack",{value:Error().stack,writable:!0}),this.stack=jb(this.stack))},L.prototype=Error(),L.prototype.constructor=L,[44].forEach(function(a){Kb[a]=new L(a);Kb[a].stack=""}))}var oc;function pc(a,b){var d=0;a&&(d|=365);b&&(d|=146);return d} -function qc(a,b,d){a=wb("/dev/"+a);var e=pc(!!b,!!d);rc||(rc=64);var h=rc++<<8|0;Db(h,{open:function(g){g.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(g,k,m,q){for(var n=0,p=0;p>2]}function uc(a){a=Qb[a];if(!a)throw new L(8);return a}function vc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var wc=void 0;function S(a){for(var b="";A[a];)b+=wc[A[a++]];return b}var xc={},yc={},zc={}; -function Ac(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Bc(a,b){a=Ac(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} -function Cc(a){var b=Error,d=Bc(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var Dc=void 0;function T(a){throw new Dc(a);}var Ec=void 0;function Fc(a){throw new Ec(a);} -function Gc(a,b,d){function e(m){m=d(m);m.length!==a.length&&Fc("Mismatched type converter count");for(var q=0;q>2])}function bd(a,b,d){if(b===d)return a;if(void 0===d.D)return null;a=bd(a,b,d.D);return null===a?null:d.ya(a)}var cd={}; -function dd(a,b){for(void 0===b&&T("ptr should not be undefined");a.D;)b=a.Z(b),a=a.D;return cd[b]}function ed(a,b){b.o&&b.m||Fc("makeClassHandle requires ptr and ptrType");!!b.C!==!!b.B&&Fc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Mc(Object.create(a,{g:{value:b}}))}function fd(a,b,d,e){this.name=a;this.j=b;this.ha=d;this.$=e;this.aa=!1;this.O=this.La=this.Ka=this.ua=this.Oa=this.Ia=void 0;void 0!==b.D?this.toWireType=Yc:(this.toWireType=e?Wc:$c,this.H=null)} -function gd(a,b){c.hasOwnProperty(a)||Fc("Replacing nonexistant public symbol");c[a]=b;c[a].P=void 0} -function jd(a,b){assert(a.includes("j"),"getDynCaller should only be called with i64 sigs");var d=[];return function(){d.length=arguments.length;for(var e=0;eg&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==d,m=!1;for(d=1;d>2)+e]);return d} -function ud(a,b,d){a instanceof Object||T(d+' with invalid "this": '+a);a instanceof b.j.constructor||T(d+' incompatible with "this" of type '+a.constructor.name);a.g.m||T("cannot call emscripten binding method "+d+" on deleted object");return Vc(a.g.m,a.g.o.j,b.j)}var vd=[],U=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function wd(a){4>2])};case 3:return function(d){return this.fromWireType(Qa[d>>3])};default:throw new TypeError("Unknown float type: "+a);}} -function yd(a,b,d){switch(b){case 0:return d?function(e){return D[e]}:function(e){return A[e]};case 1:return d?function(e){return Fa[e>>1]}:function(e){return Ea[e>>1]};case 2:return d?function(e){return C[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function zd(){void 0===zd.start&&(zd.start=Date.now());return 1E3*(Date.now()-zd.start)|0}var Ad;Ad=ha?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()}; -function Bd(a,b){assert(b===(b|0));return(a>>>0)+4294967296*b}function Cd(a,b){if(0>=a)return a;var d=32>=b?Math.abs(1<=d&&(32>=b||a>d)&&(a=-2*d+a);return a}function Dd(a,b){return 0<=a?a:32>=b?2*Math.abs(1<>3],e+=8):"i64"==F?(F=[C[e>>2],C[e+4>>2]],e+=8):(assert(0===(e&3)),F=C[e>>2],e+=4);return F}assert(0===(b&3));for(var e=b,h=[],g,k;;){var m=a;g=D[a>>0];if(0===g)break;k=D[a+1>>0];if(37==g){var q=!1,n=b=!1,p=!1,w=!1;a:for(;;){switch(k){case 43:q=!0;break;case 45:b=!0;break;case 35:n=!0;break;case 48:if(p)break a;else{p=!0;break}case 32:w=!0;break;default:break a}a++; -k=D[a+1>>0]}var x=0;if(42==k)x=d("i32"),a++,k=D[a+1>>0];else for(;48<=k&&57>=k;)x=10*x+(k-48),a++,k=D[a+1>>0];var l=!1,u=-1;if(46==k){u=0;l=!0;a++;k=D[a+1>>0];if(42==k)u=d("i32"),a++;else for(;;){k=D[a+1>>0];if(48>k||57>0]}0>u&&(u=6,l=!1);switch(String.fromCharCode(k)){case "h":k=D[a+2>>0];if(104==k){a++;var y=1}else y=2;break;case "l":k=D[a+2>>0];108==k?(a++,y=8):y=4;break;case "L":case "q":case "j":y=8;break;case "z":case "t":case "I":y=4;break;default:y=null}y&& -a++;k=D[a+1>>0];switch(String.fromCharCode(k)){case "d":case "i":case "u":case "o":case "x":case "X":case "p":m=100==k||105==k;y=y||4;g=d("i"+8*y);8==y&&(g=117==k?(g[0]>>>0)+4294967296*(g[1]>>>0):Bd(g[0],g[1]));4>=y&&(g=(m?Cd:Dd)(g&Math.pow(256,y)-1,8*y));var B=Math.abs(g);m="";if(100==k||105==k)var v=Cd(g,8*y,1).toString(10);else if(117==k)v=Dd(g,8*y,1).toString(10),g=Math.abs(g);else if(111==k)v=(n?"0":"")+B.toString(8);else if(120==k||88==k){m=n&&0!=g?"0x":"";if(0>g){g=-g;v=(B-1).toString(16); -B=[];for(n=0;ny&&-4<=y?(k=(103==k?"f":"F").charCodeAt(0),u-=y+1):(k=(103==k?"e":"E").charCodeAt(0),u--),y=Math.min(u,20);if(101==k||69==k)v=g.toExponential(y),/[eE][-+]\d$/.test(v)&&(v=v.slice(0,-1)+"0"+v.slice(-1));else if(102==k||70==k)v=g.toFixed(y),0===g&&(0>g||0===g&&-Infinity===1/g)&&(v="-"+v);m=v.split("e");if(l&&!n)for(;1y++;)m[0]+="0";v=m[0]+(1g?"-":"")+"inf",p=!1;for(;v.lengthk&&(v=v.toUpperCase());v.split("").forEach(function(F){h.push(F.charCodeAt(0))});break;case "s":p=(q=d("i8*"))?Ed(q):6;l&&(p=Math.min(p,u));if(!b)for(;p>0]);else h=h.concat(Fb("(null)".substr(0,p),!0));if(b)for(;p>2]=h.length;break;case "%":h.push(g);break;default:for(n=m;n>0])}a+=2}else h.push(g),a+=1}return h} -function Gd(a){if(!a||!a.callee||!a.callee.name)return[null,"",""];var b=a.callee.name,d="(",e=!0,h;for(h in a){var g=a[h];e||(d+=", ");e=!1;d="number"===typeof g||"string"===typeof g?d+g:d+("("+typeof g+")")}d+=")";a=(a=a.callee.caller)?a.arguments:[];e&&(d="");return[a,b,d]} -function Hd(a){var b=ib();b=b.slice(b.indexOf("\n",Math.max(b.lastIndexOf("_emscripten_log"),b.lastIndexOf("_emscripten_get_callstack")))+1);a&32&&ra("EM_LOG_DEMANGLE is deprecated; ignoring");a&8&&"undefined"===typeof emscripten_source_map&&(ra('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),a=a^8|16);var d=null;if(a&128)for(d=Gd(arguments);d[1].includes("_emscripten_");)d= -Gd(d[0]);var e=b.split("\n");b="";var h=/\s*(.*?)@(.*?):([0-9]+):([0-9]+)/,g=/\s*(.*?)@(.*):(.*)(:(.*))?/,k=/\s*at (.*?) \((.*):(.*):(.*)\)/,m;for(m in e){var q=e[m],n;if((n=k.exec(q))&&5==n.length){q=n[1];var p=n[2];var w=n[3];n=n[4]}else if((n=h.exec(q))||(n=g.exec(q)),n&&4<=n.length)q=n[1],p=n[2],w=n[3],n=n[4]|0;else{b+=q+"\n";continue}var x=!1;if(a&8){var l=emscripten_source_map.rd({line:w,wa:n});if(x=l&&l.source)a&64&&(l.source=l.source.substring(l.source.replace(/\\/g,"/").lastIndexOf("/")+ -1)),b+=" at "+q+" ("+l.source+":"+l.line+":"+l.wa+")\n"}if(a&16||!x)a&64&&(p=p.substring(p.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=(x?" = "+q:" at "+q)+" ("+p+":"+w+":"+n+")\n";a&128&&d[0]&&(d[1]==q&&0v?-1:0=k(y,l)?0>=k(u,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var n=C[e+40>>2];e={Ra:C[e>>2],Qa:C[e+4>>2],da:C[e+8>>2],Y:C[e+12>>2],V:C[e+16>>2],A:C[e+20>>2],ea:C[e+24>>2],fa:C[e+28>>2],sd:C[e+32>>2],Pa:C[e+36>> -2],Sa:n?z(n):""};d=z(d);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in n)d=d.replace(new RegExp(p,"g"),n[p]);var w="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), -x="January February March April May June July August September October November December".split(" ");n={"%a":function(l){return w[l.ea].substring(0,3)},"%A":function(l){return w[l.ea]},"%b":function(l){return x[l.V].substring(0,3)},"%B":function(l){return x[l.V]},"%C":function(l){return g((l.A+1900)/100|0,2)},"%d":function(l){return g(l.Y,2)},"%e":function(l){return h(l.Y,2," ")},"%g":function(l){return q(l).toString().substring(2)},"%G":function(l){return q(l)},"%H":function(l){return g(l.da,2)}, -"%I":function(l){l=l.da;0==l?l=12:12l.da?"AM":"PM"},"%S":function(l){return g(l.Ra,2)},"%t":function(){return"\t"},"%u":function(l){return l.ea||7},"%U":function(l){var u=new Date(l.A+1900,0,1),y=0===u.getDay()?u:Pd(u,7-u.getDay());l=new Date(l.A+1900,l.V,l.Y);return 0>k(y,l)? -g(Math.ceil((31-y.getDate()+(Md(Ld(l.getFullYear())?Nd:Od,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(y,u)?"01":"00"},"%V":function(l){var u=new Date(l.A+1901,0,4),y=m(new Date(l.A+1900,0,4));u=m(u);var B=Pd(new Date(l.A+1900,0,1),l.fa);return 0>k(B,y)?"53":0>=k(u,B)?"01":g(Math.ceil((y.getFullYear()k(y,l)?g(Math.ceil((31-y.getDate()+(Md(Ld(l.getFullYear())?Nd:Od,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(y,u)?"01":"00"},"%y":function(l){return(l.A+1900).toString().substring(2)},"%Y":function(l){return l.A+1900},"%z":function(l){l=l.Pa;var u=0<=l;l=Math.abs(l)/60;return(u?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Sa},"%%":function(){return"%"}};for(p in n)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),n[p](e)));p=Fb(d,!1);if(p.length> -b)return 0;Na(p,a);return p.length-1}function Zb(a,b,d,e){a||(a=this);this.parent=a;this.I=a.I;this.S=null;this.id=Rb++;this.name=b;this.mode=d;this.h={};this.l={};this.rdev=e}Object.defineProperties(Zb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});nc();Sb=Array(4096);gc(M,"/");Q("/tmp");Q("/home");Q("/home/web_user"); -(function(){Q("/dev");Db(259,{read:function(){return 0},write:function(b,d,e,h){return h}});ic("/dev/null",259);Cb(1280,Gb);Cb(1536,Hb);ic("/dev/tty",1280);ic("/dev/tty1",1536);var a=zb();qc("random",a);qc("urandom",a);Q("/dev/shm");Q("/dev/shm/tmp")})(); -(function(){Q("/proc");var a=Q("/proc/self");Q("/proc/self/fd");gc({I:function(){var b=Jb(a,"fd",16895,73);b.h={lookup:function(d,e){var h=Qb[+e];if(!h)throw new L(8);d={parent:null,I:{sa:"fake"},h:{readlink:function(){return h.path}}};return d.parent=d}};return b}},"/proc/self/fd")})();for(var Rd=Array(256),Sd=0;256>Sd;++Sd)Rd[Sd]=String.fromCharCode(Sd);wc=Rd;Dc=c.BindingError=Cc("BindingError");Ec=c.InternalError=Cc("InternalError"); -Qc.prototype.isAliasOf=function(a){if(!(this instanceof Qc&&a instanceof Qc))return!1;var b=this.g.o.j,d=this.g.m,e=a.g.o.j;for(a=a.g.m;b.D;)d=b.Z(d),b=b.D;for(;e.D;)a=e.Z(a),e=e.D;return b===e&&d===a};Qc.prototype.clone=function(){this.g.m||Ic(this);if(this.g.X)return this.g.count.value+=1,this;var a=Mc,b=Object,d=b.create,e=Object.getPrototypeOf(this),h=this.g;a=a(d.call(b,e,{g:{value:{count:h.count,R:h.R,X:h.X,m:h.m,o:h.o,B:h.B,C:h.C}}}));a.g.count.value+=1;a.g.R=!1;return a}; -Qc.prototype["delete"]=function(){this.g.m||Ic(this);this.g.R&&!this.g.X&&T("Object already scheduled for deletion");Kc(this);Lc(this.g);this.g.X||(this.g.B=void 0,this.g.m=void 0)};Qc.prototype.isDeleted=function(){return!this.g.m};Qc.prototype.deleteLater=function(){this.g.m||Ic(this);this.g.R&&!this.g.X&&T("Object already scheduled for deletion");Oc.push(this);1===Oc.length&&Nc&&Nc(Pc);this.g.R=!0;return this};fd.prototype.Aa=function(a){this.ua&&(a=this.ua(a));return a}; -fd.prototype.na=function(a){this.O&&this.O(a)};fd.prototype.argPackAdvance=8;fd.prototype.readValueFromPointer=ad;fd.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; -fd.prototype.fromWireType=function(a){function b(){return this.aa?ed(this.j.K,{o:this.Ia,m:d,C:this,B:a}):ed(this.j.K,{o:this,m:a})}var d=this.Aa(a);if(!d)return this.na(a),null;var e=dd(this.j,d);if(void 0!==e){if(0===e.g.count.value)return e.g.m=d,e.g.B=a,e.clone();e=e.clone();this.na(a);return e}e=this.j.za(d);e=Rc[e];if(!e)return b.call(this);e=this.$?e.xa:e.pointerType;var h=bd(d,this.j,e.j);return null===h?b.call(this):this.aa?ed(e.j.K,{o:e,m:h,C:this,B:a}):ed(e.j.K,{o:e,m:h})}; -c.getInheritedInstanceCount=function(){return Object.keys(cd).length};c.getLiveInheritedInstances=function(){var a=[],b;for(b in cd)cd.hasOwnProperty(b)&&a.push(cd[b]);return a};c.flushPendingDeletes=Pc;c.setDelayFunction=function(a){Nc=a;Oc.length&&Nc&&Nc(Pc)};ld=c.UnboundTypeError=Cc("UnboundTypeError");c.count_emval_handles=function(){for(var a=0,b=5;b>2]);C[b>>2]=a.getUTCSeconds();C[b+4>>2]=a.getUTCMinutes();C[b+8>>2]=a.getUTCHours();C[b+12>>2]=a.getUTCDate();C[b+16>>2]=a.getUTCMonth();C[b+20>>2]=a.getUTCFullYear()-1900;C[b+24>>2]=a.getUTCDay();C[b+36>>2]=0;C[b+32>>2]=0;C[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;pb||(pb=La("GMT"));C[b+40>>2]=pb;return b},__localtime_r:function(a,b){qb();a=new Date(1E3*C[a>>2]);C[b>>2]=a.getSeconds();C[b+ -4>>2]=a.getMinutes();C[b+8>>2]=a.getHours();C[b+12>>2]=a.getDate();C[b+16>>2]=a.getMonth();C[b+20>>2]=a.getFullYear()-1900;C[b+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);C[b+28>>2]=(a.getTime()-d.getTime())/864E5|0;C[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;C[b+32>>2]=a;a=C[ub()+(a?4:0)>>2];C[b+40>>2]=a;return b},__sys_fcntl64:function(a,b,d){sc=d;try{var e=uc(a); -switch(b){case 0:var h=tc();return 0>h?-28:kc(e.path,e.flags,0,h).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return h=tc(),e.flags|=h,0;case 12:return h=tc(),Fa[h+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return C[Td()>>2]=28,-1;default:return-28}}catch(g){return"undefined"!==typeof R&&g instanceof L||r(g),-g.u}},__sys_getdents64:function(a,b,d){try{var e=uc(a);if(!e.M){var h=P(e.path,{W:!0}).node;if(!h.h.readdir)throw new L(54);var g=h.h.readdir(h);e.M=g}a=0; -for(var k=mc(e,0,1),m=Math.floor(k/280);m>>0,(J=n,1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];C[b+a>>2]=K[0];C[b+a+4>>2]=K[1];K=[280*(m+1)>>>0,(J=280*(m+1),1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>> -0))/4294967296)>>>0:0)];C[b+a+8>>2]=K[0];C[b+a+12>>2]=K[1];Fa[b+a+16>>1]=280;D[b+a+18>>0]=p;Aa(q,b+a+19,256);a+=280;m+=1}mc(e,280*m,0);return a}catch(x){return"undefined"!==typeof R&&x instanceof L||r(x),-x.u}},__sys_ioctl:function(a,b,d){sc=d;try{var e=uc(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var h=tc();return C[h>>2]=0;case 21520:return e.tty?-28:-59;case 21531:a=h= -tc();if(!e.l.Ca)throw new L(59);return e.l.Ca(e,b,a);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:r("bad ioctl syscall "+b)}}catch(g){return"undefined"!==typeof R&&g instanceof L||r(g),-g.u}},__sys_mkdir:function(a,b){try{return a=z(a),a=wb(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),Q(a,b),0}catch(d){return"undefined"!==typeof R&&d instanceof L||r(d),-d.u}},__sys_open:function(a,b,d){sc=d;try{var e=z(a),h=d?tc():0;return kc(e,b,h).fd}catch(g){return"undefined"!==typeof R&& -g instanceof L||r(g),-g.u}},__sys_readlink:function(a,b,d){try{a=z(a);if(0>=d)var e=-28;else{var h=Ub(a),g=Math.min(d,Ba(h)),k=D[b+g];Aa(h,b,d+1);D[b+g]=k;e=g}return e}catch(m){return"undefined"!==typeof R&&m instanceof L||r(m),-m.u}},__sys_rmdir:function(a){try{a=z(a);var b=P(a,{parent:!0}).node,d=yb(a),e=Lb(b,d),h=cc(b,d,!0);if(h)throw new L(h);if(!b.h.rmdir)throw new L(63);if(e.S)throw new L(10);try{O.willDeletePath&&O.willDeletePath(a)}catch(g){t("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+ -g.message)}b.h.rmdir(b,d);Xb(e);try{if(O.onDeletePath)O.onDeletePath(a)}catch(g){t("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof R&&g instanceof L||r(g),-g.u}},__sys_unlink:function(a){try{a=z(a);var b=P(a,{parent:!0}).node,d=yb(a),e=Lb(b,d),h=cc(b,d,!1);if(h)throw new L(h);if(!b.h.unlink)throw new L(63);if(e.S)throw new L(10);try{O.willDeletePath&&O.willDeletePath(a)}catch(g){t("FS.trackingDelegate['willDeletePath']('"+ -a+"') threw an exception: "+g.message)}b.h.unlink(b,d);Xb(e);try{if(O.onDeletePath)O.onDeletePath(a)}catch(g){t("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof R&&g instanceof L||r(g),-g.u}},_embind_register_bigint:function(){},_embind_register_bool:function(a,b,d,e,h){var g=vc(d);b=S(b);Hc(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,m){return m?e:h},argPackAdvance:8,readValueFromPointer:function(k){if(1=== -d)var m=D;else if(2===d)m=Fa;else if(4===d)m=C;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(m[k>>g])},H:null})},_embind_register_class:function(a,b,d,e,h,g,k,m,q,n,p,w,x){p=S(p);g=kd(h,g);m&&(m=kd(k,m));n&&(n=kd(q,n));x=kd(w,x);var l=Ac(p);Tc(l,function(){pd("Cannot construct "+p+" due to unbound types",[e])});Gc([a,b,d],e?[e]:[],function(u){u=u[0];if(e){var y=u.j;var B=y.K}else B=Qc.prototype;u=Bc(l,function(){if(Object.getPrototypeOf(this)!==v)throw new Dc("Use 'new' to construct "+ -p);if(void 0===F.L)throw new Dc(p+" has no accessible constructor");var hd=F.L[arguments.length];if(void 0===hd)throw new Dc("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(F.L).toString()+") parameters instead!");return hd.apply(this,arguments)});var v=Object.create(B,{constructor:{value:u}});u.prototype=v;var F=new Uc(p,u,v,x,y,g,m,n);y=new fd(p,F,!0,!1);B=new fd(p+"*",F,!1,!1);var V=new fd(p+" const*",F,!1,!0);Rc[a]={pointerType:B, -xa:V};gd(l,u);return[y,B,V]})},_embind_register_class_class_function:function(a,b,d,e,h,g,k){var m=td(d,e);b=S(b);g=kd(h,g);Gc([],[a],function(q){function n(){pd("Cannot call "+p+" due to unbound types",m)}q=q[0];var p=q.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var w=q.j.constructor;void 0===w[b]?(n.P=d-1,w[b]=n):(Sc(w,b,p),w[b].v[d-1]=n);Gc([],m,function(x){x=[x[0],null].concat(x.slice(1));x=sd(p,x,null,g,k);void 0===w[b].v?(x.P=d-1,w[b]=x):w[b].v[d-1]=x;return[]});return[]})},_embind_register_class_constructor:function(a, -b,d,e,h,g){assert(0>>m}}var q=b.includes("unsigned");Hc(a,{name:b,fromWireType:g,toWireType:function(n,p){if("number"!==typeof p&&"boolean"!==typeof p)throw new TypeError('Cannot convert "'+Xc(p)+'" to '+this.name);if(ph)throw new TypeError('Passing a number "'+Xc(p)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+h+"]!");return q?p>>>0:p|0},argPackAdvance:8,readValueFromPointer:yd(b, -k,0!==e),H:null})},_embind_register_memory_view:function(a,b,d){function e(g){g>>=2;var k=E;return new h(Oa,k[g+1],k[g])}var h=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];d=S(d);Hc(a,{name:d,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Ba:!0})},_embind_register_std_string:function(a,b){b=S(b);var d="std::string"===b;Hc(a,{name:b,fromWireType:function(e){var h=E[e>>2];if(d)for(var g=e+4,k=0;k<=h;++k){var m=e+4+k;if(k==h||0==A[m]){g= -z(g,m-g);if(void 0===q)var q=g;else q+=String.fromCharCode(0),q+=g;g=m+1}}else{q=Array(h);for(k=0;k>2]=k;if(d&&g)Aa(h,m+ -4,k+1);else if(g)for(g=0;g>2],p=k(),w,x=q+4,l=0;l<=n;++l){var u=q+4+l*b;if(l==n||0==p[u>>m])x=e(x,u-x),void 0===w?w=x:(w+=String.fromCharCode(0),w+=x),x=u+b}od(q);return w},toWireType:function(q,n){"string"!==typeof n&&T("Cannot pass non-string to C++ string type "+d);var p=g(n),w=Ma(4+p+b);E[w>>2]=p>>m;h(n,w+4,p+b);null!==q&&q.push(od,w);return w},argPackAdvance:8,readValueFromPointer:ad,H:function(q){od(q)}})},_embind_register_void:function(a,b){b=S(b);Hc(a,{pd:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})}, -_emscripten_throw_longjmp:function(){throw"longjmp";},_emval_decref:wd,_emval_incref:function(a){4>2]=28,-1;C[b>>2]=a/1E3|0;C[b+4>>2]=a%1E3*1E6|0;return 0},emscripten_log:function(a,b,d){b=Fd(b,d);b=ya(b,0);a&24&& -(b=b.replace(/\s+$/,""),b+=(0>>=0;assert(a>b);if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a, -e);0>>16);Ra();var g=1;break a}catch(k){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+Oa.byteLength+" bytes to "+h+" bytes, but got error: "+k)}g=void 0}if(g)return!0}t("Failed to grow the heap from "+b+" bytes to "+e+" bytes, not enough memory!");return!1},emscripten_run_script:function(a){eval(z(a))},emscripten_run_script_int:function(a){return eval(z(a))|0},emscripten_run_script_string:W, -environ_get:function(a,b){try{var d=0;Jd().forEach(function(e,h){var g=b+d;h=C[a+4*h>>2]=g;for(g=0;g>0]=e.charCodeAt(g);D[h>>0]=0;d+=e.length+1});return 0}catch(e){return"undefined"!==typeof R&&e instanceof L||r(e),e.u}},environ_sizes_get:function(a,b){try{var d=Jd();C[a>>2]=d.length;var e=0;d.forEach(function(h){e+=h.length+1});C[b>>2]=e;return 0}catch(h){return"undefined"!==typeof R&&h instanceof L||r(h),h.u}},exit:function(a){Ud(); -if(noExitRuntime||0>2],m=h,q=C[b+8*g>>2],n=k,p=void 0,w=D;if(0>n||0>p)throw new L(28);if(null===m.fd)throw new L(8);if(1===(m.flags&2097155))throw new L(8);if(N(m.node.mode))throw new L(31);if(!m.l.read)throw new L(28);var x="undefined"!==typeof p;if(!x)p=m.position;else if(!m.seekable)throw new L(70);var l=m.l.read(m,w,q,n,p);x||(m.position+=l);var u=l;if(0>u){var y=-1;break a}a+=u;if(u>2]= -y;return 0}catch(B){return"undefined"!==typeof R&&B instanceof L||r(B),B.u}},fd_seek:function(a,b,d,e,h){try{var g=uc(a);a=4294967296*d+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;mc(g,a,e);K=[g.position>>>0,(J=g.position,1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];C[h>>2]=K[0];C[h+4>>2]=K[1];g.M&&0===a&&0===e&&(g.M=null);return 0}catch(k){return"undefined"!==typeof R&&k instanceof L||r(k),k.u}},fd_write:function(a, -b,d,e){try{a:{for(var h=uc(a),g=a=0;g>2],q=C[b+(8*g+4)>>2],n=void 0,p=D;if(0>q||0>n)throw new L(28);if(null===k.fd)throw new L(8);if(0===(k.flags&2097155))throw new L(8);if(N(k.node.mode))throw new L(31);if(!k.l.write)throw new L(28);k.seekable&&k.flags&1024&&mc(k,0,2);var w="undefined"!==typeof n;if(!w)n=k.position;else if(!k.seekable)throw new L(70);var x=k.l.write(k,p,m,q,n,void 0);w||(k.position+=x);try{if(k.path&&O.onWriteToFile)O.onWriteToFile(k.path)}catch(y){t("FS.trackingDelegate['onWriteToFile']('"+ -k.path+"') threw an exception: "+y.message)}var l=x;if(0>l){var u=-1;break a}a+=l}u=a}C[e>>2]=u;return 0}catch(y){return"undefined"!==typeof R&&y instanceof L||r(y),y.u}},getTempRet0:function(){return ta},invoke_i:Vd,invoke_ii:Wd,invoke_iii:Xd,invoke_iiii:Yd,invoke_iiiii:Zd,invoke_iiiiiiii:$d,invoke_vi:ae,invoke_vii:be,invoke_viii:ce,invoke_viiii:de,invoke_viiiii:ee,invoke_viiiiii:fe,invoke_viiiiiiiii:ge,mktime:function(a){qb();var b=new Date(C[a+20>>2]+1900,C[a+16>>2],C[a+12>>2],C[a+8>>2],C[a+4>> -2],C[a>>2],0),d=C[a+32>>2],e=b.getTimezoneOffset(),h=new Date(b.getFullYear(),0,1),g=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=h.getTimezoneOffset(),m=Math.min(k,g);0>d?C[a+32>>2]=Number(g!=k&&m==e):0>2]=b.getDay();C[a+28>>2]=(b.getTime()-h.getTime())/864E5|0;C[a>>2]=b.getSeconds();C[a+4>>2]=b.getMinutes();C[a+8>>2]=b.getHours();C[a+12>>2]=b.getDate();C[a+16>>2]=b.getMonth();return b.getTime()/1E3|0},setTempRet0:function(a){ta= -a},strftime:Qd,strftime_l:function(a,b,d,e){return Qd(a,b,d,e)},time:function(a){var b=Date.now()/1E3|0;a&&(C[a>>2]=b);return b}}; -(function(){function a(g){c.asm=g.exports;va=c.asm.memory;assert(va,"memory not found in wasm exports");Ra();G=c.asm.__indirect_function_table;assert(G,"table not found in wasm exports");Za.unshift(c.asm.__wasm_call_ctors);db--;c.monitorRunDependencies&&c.monitorRunDependencies(db);assert(gb["wasm-instantiate"]);delete gb["wasm-instantiate"];0==db&&(null!==eb&&(clearInterval(eb),eb=null),fb&&(g=fb,fb=null,g()))}function b(g){assert(c===h,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); -h=null;a(g.instance)}function d(g){return nb().then(function(k){return WebAssembly.instantiate(k,e)}).then(g,function(k){t("failed to asynchronously prepare wasm: "+k);H.startsWith("file://")&&t("warning: Loading from a file URI ("+H+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");r(k)})}var e={env:he,wasi_snapshot_preview1:he};hb();var h=c;if(c.instantiateWasm)try{return c.instantiateWasm(e, -a)}catch(g){return t("Module.instantiateWasm callback failed with error: "+g),!1}(function(){return ua||"function"!==typeof WebAssembly.instantiateStreaming||kb()||H.startsWith("file://")||"function"!==typeof fetch?d(b):fetch(H,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,e).then(b,function(k){t("wasm streaming compile failed: "+k);t("falling back to ArrayBuffer instantiation");return d(b)})})})();return{}})();c.___wasm_call_ctors=I("__wasm_call_ctors"); -var Ma=c._malloc=I("malloc"),Td=c.___errno_location=I("__errno_location"),od=c._free=I("free");c._fflush=I("fflush");var nd=c.___getTypeName=I("__getTypeName");c.___embind_register_native_and_builtin_types=I("__embind_register_native_and_builtin_types");c._emscripten_main_thread_process_queued_calls=I("emscripten_main_thread_process_queued_calls"); -var Ua=c._emscripten_stack_get_end=function(){return(Ua=c._emscripten_stack_get_end=c.asm.emscripten_stack_get_end).apply(null,arguments)},ub=c.__get_tzname=I("_get_tzname"),tb=c.__get_daylight=I("_get_daylight"),sb=c.__get_timezone=I("_get_timezone"),X=c.stackSave=I("stackSave"),Y=c.stackRestore=I("stackRestore");c.stackAlloc=I("stackAlloc");var ie=c._emscripten_stack_init=function(){return(ie=c._emscripten_stack_init=c.asm.emscripten_stack_init).apply(null,arguments)}; -c._emscripten_stack_get_free=function(){return(c._emscripten_stack_get_free=c.asm.emscripten_stack_get_free).apply(null,arguments)};c._saveSetjmp=I("saveSetjmp");var Z=c._setThrew=I("setThrew");c.dynCall_ji=I("dynCall_ji");c.dynCall_jiji=I("dynCall_jiji");c.dynCall_viij=I("dynCall_viij");c.dynCall_viiiiiiji=I("dynCall_viiiiiiji");c.dynCall_viiijj=I("dynCall_viiijj");c.dynCall_viiiiiijjiii=I("dynCall_viiiiiijjiii");c.dynCall_iiiijjii=I("dynCall_iiiijjii");c.dynCall_iiiiij=I("dynCall_iiiiij"); -c.dynCall_iiiiijj=I("dynCall_iiiiijj");c.dynCall_iiiiiijj=I("dynCall_iiiiiijj");c.dynCall_viijii=I("dynCall_viijii");function Wd(a,b){var d=X();try{return G.get(a)(b)}catch(e){Y(d);if(e!==e+0&&"longjmp"!==e)throw e;Z(1,0)}}function Yd(a,b,d,e){var h=X();try{return G.get(a)(b,d,e)}catch(g){Y(h);if(g!==g+0&&"longjmp"!==g)throw g;Z(1,0)}}function ae(a,b){var d=X();try{G.get(a)(b)}catch(e){Y(d);if(e!==e+0&&"longjmp"!==e)throw e;Z(1,0)}} -function ce(a,b,d,e){var h=X();try{G.get(a)(b,d,e)}catch(g){Y(h);if(g!==g+0&&"longjmp"!==g)throw g;Z(1,0)}}function be(a,b,d){var e=X();try{G.get(a)(b,d)}catch(h){Y(e);if(h!==h+0&&"longjmp"!==h)throw h;Z(1,0)}}function Xd(a,b,d){var e=X();try{return G.get(a)(b,d)}catch(h){Y(e);if(h!==h+0&&"longjmp"!==h)throw h;Z(1,0)}}function $d(a,b,d,e,h,g,k,m){var q=X();try{return G.get(a)(b,d,e,h,g,k,m)}catch(n){Y(q);if(n!==n+0&&"longjmp"!==n)throw n;Z(1,0)}} -function de(a,b,d,e,h){var g=X();try{G.get(a)(b,d,e,h)}catch(k){Y(g);if(k!==k+0&&"longjmp"!==k)throw k;Z(1,0)}}function Zd(a,b,d,e,h){var g=X();try{return G.get(a)(b,d,e,h)}catch(k){Y(g);if(k!==k+0&&"longjmp"!==k)throw k;Z(1,0)}}function Vd(a){var b=X();try{return G.get(a)()}catch(d){Y(b);if(d!==d+0&&"longjmp"!==d)throw d;Z(1,0)}}function fe(a,b,d,e,h,g,k){var m=X();try{G.get(a)(b,d,e,h,g,k)}catch(q){Y(m);if(q!==q+0&&"longjmp"!==q)throw q;Z(1,0)}} -function ee(a,b,d,e,h,g){var k=X();try{G.get(a)(b,d,e,h,g)}catch(m){Y(k);if(m!==m+0&&"longjmp"!==m)throw m;Z(1,0)}}function ge(a,b,d,e,h,g,k,m,q,n){var p=X();try{G.get(a)(b,d,e,h,g,k,m,q,n)}catch(w){Y(p);if(w!==w+0&&"longjmp"!==w)throw w;Z(1,0)}}Object.getOwnPropertyDescriptor(c,"intArrayFromString")||(c.intArrayFromString=function(){r("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"intArrayToString")||(c.intArrayToString=function(){r("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ccall")||(c.ccall=function(){r("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"cwrap")||(c.cwrap=function(){r("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"setValue")||(c.setValue=function(){r("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getValue")||(c.getValue=function(){r("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocate")||(c.allocate=function(){r("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"UTF8ArrayToString")||(c.UTF8ArrayToString=function(){r("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF8ToString")||(c.UTF8ToString=function(){r("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8Array")||(c.stringToUTF8Array=function(){r("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToUTF8")||(c.stringToUTF8=function(){r("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"lengthBytesUTF8")||(c.lengthBytesUTF8=function(){r("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){r("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"addOnPreRun")||(c.addOnPreRun=function(){r("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnInit")||(c.addOnInit=function(){r("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreMain")||(c.addOnPreMain=function(){r("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"addOnExit")||(c.addOnExit=function(){r("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPostRun")||(c.addOnPostRun=function(){r("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeStringToMemory")||(c.writeStringToMemory=function(){r("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeArrayToMemory")||(c.writeArrayToMemory=function(){r("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeAsciiToMemory")||(c.writeAsciiToMemory=function(){r("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addRunDependency")||(c.addRunDependency=function(){r("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"removeRunDependency")||(c.removeRunDependency=function(){r("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createFolder")||(c.FS_createFolder=function(){r("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"FS_createPath")||(c.FS_createPath=function(){r("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createDataFile")||(c.FS_createDataFile=function(){r("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"FS_createPreloadedFile")||(c.FS_createPreloadedFile=function(){r("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createLazyFile")||(c.FS_createLazyFile=function(){r("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"FS_createLink")||(c.FS_createLink=function(){r("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS_createDevice")||(c.FS_createDevice=function(){r("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_unlink")||(c.FS_unlink=function(){r("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"getLEB")||(c.getLEB=function(){r("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFunctionTables")||(c.getFunctionTables=function(){r("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"alignFunctionTables")||(c.alignFunctionTables=function(){r("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerFunctions")||(c.registerFunctions=function(){r("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addFunction")||(c.addFunction=function(){r("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"removeFunction")||(c.removeFunction=function(){r("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){r("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"prettyPrint")||(c.prettyPrint=function(){r("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){r("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getCompilerSetting")||(c.getCompilerSetting=function(){r("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"print")||(c.print=function(){r("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"printErr")||(c.printErr=function(){r("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getTempRet0")||(c.getTempRet0=function(){r("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setTempRet0")||(c.setTempRet0=function(){r("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callMain")||(c.callMain=function(){r("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"abort")||(c.abort=function(){r("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"keepRuntimeAlive")||(c.keepRuntimeAlive=function(){r("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"zeroMemory")||(c.zeroMemory=function(){r("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToNewUTF8")||(c.stringToNewUTF8=function(){r("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setFileTime")||(c.setFileTime=function(){r("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscripten_realloc_buffer")||(c.emscripten_realloc_buffer=function(){r("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ENV")||(c.ENV=function(){r("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_CODES")||(c.ERRNO_CODES=function(){r("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_MESSAGES")||(c.ERRNO_MESSAGES=function(){r("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"setErrNo")||(c.setErrNo=function(){r("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton4")||(c.inetPton4=function(){r("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop4")||(c.inetNtop4=function(){r("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"inetPton6")||(c.inetPton6=function(){r("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop6")||(c.inetNtop6=function(){r("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readSockaddr")||(c.readSockaddr=function(){r("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeSockaddr")||(c.writeSockaddr=function(){r("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"DNS")||(c.DNS=function(){r("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getHostByName")||(c.getHostByName=function(){r("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"GAI_ERRNO_MESSAGES")||(c.GAI_ERRNO_MESSAGES=function(){r("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Protocols")||(c.Protocols=function(){r("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Sockets")||(c.Sockets=function(){r("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getRandomDevice")||(c.getRandomDevice=function(){r("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"traverseStack")||(c.traverseStack=function(){r("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UNWIND_CACHE")||(c.UNWIND_CACHE=function(){r("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"withBuiltinMalloc")||(c.withBuiltinMalloc=function(){r("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgsArray")||(c.readAsmConstArgsArray=function(){r("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgs")||(c.readAsmConstArgs=function(){r("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"mainThreadEM_ASM")||(c.mainThreadEM_ASM=function(){r("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_q")||(c.jstoi_q=function(){r("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_s")||(c.jstoi_s=function(){r("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getExecutableName")||(c.getExecutableName=function(){r("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"listenOnce")||(c.listenOnce=function(){r("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"autoResumeAudioContext")||(c.autoResumeAudioContext=function(){r("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"dynCallLegacy")||(c.dynCallLegacy=function(){r("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getDynCaller")||(c.getDynCaller=function(){r("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){r("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"callRuntimeCallbacks")||(c.callRuntimeCallbacks=function(){r("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePush")||(c.runtimeKeepalivePush=function(){r("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePop")||(c.runtimeKeepalivePop=function(){r("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"callUserCallback")||(c.callUserCallback=function(){r("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeExit")||(c.maybeExit=function(){r("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"safeSetTimeout")||(c.safeSetTimeout=function(){r("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"asmjsMangle")||(c.asmjsMangle=function(){r("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asyncLoad")||(c.asyncLoad=function(){r("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"mmapAlloc")||(c.mmapAlloc=function(){r("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"reallyNegative")||(c.reallyNegative=function(){r("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"unSign")||(c.unSign=function(){r("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reSign")||(c.reSign=function(){r("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"formatString")||(c.formatString=function(){r("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH")||(c.PATH=function(){r("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH_FS")||(c.PATH_FS=function(){r("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SYSCALLS")||(c.SYSCALLS=function(){r("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMmap2")||(c.syscallMmap2=function(){r("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMunmap")||(c.syscallMunmap=function(){r("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getSocketFromFD")||(c.getSocketFromFD=function(){r("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getSocketAddress")||(c.getSocketAddress=function(){r("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"JSEvents")||(c.JSEvents=function(){r("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerKeyEventCallback")||(c.registerKeyEventCallback=function(){r("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"specialHTMLTargets")||(c.specialHTMLTargets=function(){r("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeCStringToJsString")||(c.maybeCStringToJsString=function(){r("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"findEventTarget")||(c.findEventTarget=function(){r("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"findCanvasEventTarget")||(c.findCanvasEventTarget=function(){r("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBoundingClientRect")||(c.getBoundingClientRect=function(){r("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillMouseEventData")||(c.fillMouseEventData=function(){r("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerMouseEventCallback")||(c.registerMouseEventCallback=function(){r("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerWheelEventCallback")||(c.registerWheelEventCallback=function(){r("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerUiEventCallback")||(c.registerUiEventCallback=function(){r("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerFocusEventCallback")||(c.registerFocusEventCallback=function(){r("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillDeviceOrientationEventData")||(c.fillDeviceOrientationEventData=function(){r("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceOrientationEventCallback")||(c.registerDeviceOrientationEventCallback=function(){r("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillDeviceMotionEventData")||(c.fillDeviceMotionEventData=function(){r("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceMotionEventCallback")||(c.registerDeviceMotionEventCallback=function(){r("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"screenOrientation")||(c.screenOrientation=function(){r("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillOrientationChangeEventData")||(c.fillOrientationChangeEventData=function(){r("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerOrientationChangeEventCallback")||(c.registerOrientationChangeEventCallback=function(){r("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillFullscreenChangeEventData")||(c.fillFullscreenChangeEventData=function(){r("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerFullscreenChangeEventCallback")||(c.registerFullscreenChangeEventCallback=function(){r("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerRestoreOldStyle")||(c.registerRestoreOldStyle=function(){r("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"hideEverythingExceptGivenElement")||(c.hideEverythingExceptGivenElement=function(){r("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreHiddenElements")||(c.restoreHiddenElements=function(){r("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setLetterbox")||(c.setLetterbox=function(){r("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"currentFullscreenStrategy")||(c.currentFullscreenStrategy=function(){r("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreOldWindowedStyle")||(c.restoreOldWindowedStyle=function(){r("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"softFullscreenResizeWebGLRenderTarget")||(c.softFullscreenResizeWebGLRenderTarget=function(){r("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"doRequestFullscreen")||(c.doRequestFullscreen=function(){r("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillPointerlockChangeEventData")||(c.fillPointerlockChangeEventData=function(){r("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerPointerlockChangeEventCallback")||(c.registerPointerlockChangeEventCallback=function(){r("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerPointerlockErrorEventCallback")||(c.registerPointerlockErrorEventCallback=function(){r("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requestPointerLock")||(c.requestPointerLock=function(){r("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillVisibilityChangeEventData")||(c.fillVisibilityChangeEventData=function(){r("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerVisibilityChangeEventCallback")||(c.registerVisibilityChangeEventCallback=function(){r("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerTouchEventCallback")||(c.registerTouchEventCallback=function(){r("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillGamepadEventData")||(c.fillGamepadEventData=function(){r("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerGamepadEventCallback")||(c.registerGamepadEventCallback=function(){r("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerBeforeUnloadEventCallback")||(c.registerBeforeUnloadEventCallback=function(){r("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillBatteryEventData")||(c.fillBatteryEventData=function(){r("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"battery")||(c.battery=function(){r("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerBatteryEventCallback")||(c.registerBatteryEventCallback=function(){r("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setCanvasElementSize")||(c.setCanvasElementSize=function(){r("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getCanvasElementSize")||(c.getCanvasElementSize=function(){r("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"polyfillSetImmediate")||(c.polyfillSetImmediate=function(){r("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangle")||(c.demangle=function(){r("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangleAll")||(c.demangleAll=function(){r("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"jsStackTrace")||(c.jsStackTrace=function(){r("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){r("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getEnvStrings")||(c.getEnvStrings=function(){r("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"checkWasiClock")||(c.checkWasiClock=function(){r("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64")||(c.writeI53ToI64=function(){r("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Clamped")||(c.writeI53ToI64Clamped=function(){r("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeI53ToI64Signaling")||(c.writeI53ToI64Signaling=function(){r("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Clamped")||(c.writeI53ToU64Clamped=function(){r("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Signaling")||(c.writeI53ToU64Signaling=function(){r("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"readI53FromI64")||(c.readI53FromI64=function(){r("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readI53FromU64")||(c.readI53FromU64=function(){r("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertI32PairToI53")||(c.convertI32PairToI53=function(){r("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"convertU32PairToI53")||(c.convertU32PairToI53=function(){r("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"uncaughtExceptionCount")||(c.uncaughtExceptionCount=function(){r("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionLast")||(c.exceptionLast=function(){r("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"exceptionCaught")||(c.exceptionCaught=function(){r("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ExceptionInfo")||(c.ExceptionInfo=function(){r("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"CatchInfo")||(c.CatchInfo=function(){r("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"exception_addRef")||(c.exception_addRef=function(){r("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exception_decRef")||(c.exception_decRef=function(){r("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Browser")||(c.Browser=function(){r("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"funcWrappers")||(c.funcWrappers=function(){r("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){r("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setMainLoop")||(c.setMainLoop=function(){r("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"wget")||(c.wget=function(){r("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS")||(c.FS=function(){r("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"MEMFS")||(c.MEMFS=function(){r("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"TTY")||(c.TTY=function(){r("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"PIPEFS")||(c.PIPEFS=function(){r("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SOCKFS")||(c.SOCKFS=function(){r("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"_setNetworkCallback")||(c._setNetworkCallback=function(){r("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"tempFixedLengthArray")||(c.tempFixedLengthArray=function(){r("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"miniTempWebGLFloatBuffers")||(c.miniTempWebGLFloatBuffers=function(){r("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapObjectForWebGLType")||(c.heapObjectForWebGLType=function(){r("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"heapAccessShiftForWebGLHeap")||(c.heapAccessShiftForWebGLHeap=function(){r("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GL")||(c.GL=function(){r("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGet")||(c.emscriptenWebGLGet=function(){r("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"computeUnpackAlignedImageSize")||(c.computeUnpackAlignedImageSize=function(){r("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetTexPixelData")||(c.emscriptenWebGLGetTexPixelData=function(){r("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetUniform")||(c.emscriptenWebGLGetUniform=function(){r("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglGetUniformLocation")||(c.webglGetUniformLocation=function(){r("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"webglPrepareUniformLocationsBeforeFirstUse")||(c.webglPrepareUniformLocationsBeforeFirstUse=function(){r("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglGetLeftBracePos")||(c.webglGetLeftBracePos=function(){r("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetVertexAttrib")||(c.emscriptenWebGLGetVertexAttrib=function(){r("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeGLArray")||(c.writeGLArray=function(){r("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AL")||(c.AL=function(){r("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SDL_unicode")||(c.SDL_unicode=function(){r("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_ttfContext")||(c.SDL_ttfContext=function(){r("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_audio")||(c.SDL_audio=function(){r("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SDL")||(c.SDL=function(){r("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_gfx")||(c.SDL_gfx=function(){r("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLUT")||(c.GLUT=function(){r("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"EGL")||(c.EGL=function(){r("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"GLFW_Window")||(c.GLFW_Window=function(){r("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW")||(c.GLFW=function(){r("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLEW")||(c.GLEW=function(){r("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"IDBStore")||(c.IDBStore=function(){r("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runAndAbortIfError")||(c.runAndAbortIfError=function(){r("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_handle_array")||(c.emval_handle_array=function(){r("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emval_free_list")||(c.emval_free_list=function(){r("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_symbols")||(c.emval_symbols=function(){r("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_emval")||(c.init_emval=function(){r("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"count_emval_handles")||(c.count_emval_handles=function(){r("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"get_first_emval")||(c.get_first_emval=function(){r("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getStringOrSymbol")||(c.getStringOrSymbol=function(){r("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"requireHandle")||(c.requireHandle=function(){r("'requireHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_newers")||(c.emval_newers=function(){r("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"craftEmvalAllocator")||(c.craftEmvalAllocator=function(){r("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emval_get_global")||(c.emval_get_global=function(){r("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_methodCallers")||(c.emval_methodCallers=function(){r("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"InternalError")||(c.InternalError=function(){r("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"BindingError")||(c.BindingError=function(){r("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UnboundTypeError")||(c.UnboundTypeError=function(){r("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PureVirtualError")||(c.PureVirtualError=function(){r("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"init_embind")||(c.init_embind=function(){r("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInternalError")||(c.throwInternalError=function(){r("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwBindingError")||(c.throwBindingError=function(){r("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"throwUnboundTypeError")||(c.throwUnboundTypeError=function(){r("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ensureOverloadTable")||(c.ensureOverloadTable=function(){r("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exposePublicSymbol")||(c.exposePublicSymbol=function(){r("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"replacePublicSymbol")||(c.replacePublicSymbol=function(){r("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"extendError")||(c.extendError=function(){r("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"createNamedFunction")||(c.createNamedFunction=function(){r("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registeredInstances")||(c.registeredInstances=function(){r("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBasestPointer")||(c.getBasestPointer=function(){r("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerInheritedInstance")||(c.registerInheritedInstance=function(){r("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"unregisterInheritedInstance")||(c.unregisterInheritedInstance=function(){r("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstance")||(c.getInheritedInstance=function(){r("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstanceCount")||(c.getInheritedInstanceCount=function(){r("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getLiveInheritedInstances")||(c.getLiveInheritedInstances=function(){r("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredTypes")||(c.registeredTypes=function(){r("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"awaitingDependencies")||(c.awaitingDependencies=function(){r("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"typeDependencies")||(c.typeDependencies=function(){r("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredPointers")||(c.registeredPointers=function(){r("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerType")||(c.registerType=function(){r("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"whenDependentTypesAreResolved")||(c.whenDependentTypesAreResolved=function(){r("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_charCodes")||(c.embind_charCodes=function(){r("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_init_charCodes")||(c.embind_init_charCodes=function(){r("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"readLatin1String")||(c.readLatin1String=function(){r("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getTypeName")||(c.getTypeName=function(){r("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heap32VectorToArray")||(c.heap32VectorToArray=function(){r("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"requireRegisteredType")||(c.requireRegisteredType=function(){r("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getShiftFromSize")||(c.getShiftFromSize=function(){r("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"integerReadValueFromPointer")||(c.integerReadValueFromPointer=function(){r("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"enumReadValueFromPointer")||(c.enumReadValueFromPointer=function(){r("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"floatReadValueFromPointer")||(c.floatReadValueFromPointer=function(){r("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"simpleReadValueFromPointer")||(c.simpleReadValueFromPointer=function(){r("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructors")||(c.runDestructors=function(){r("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"new_")||(c.new_=function(){r("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"craftInvokerFunction")||(c.craftInvokerFunction=function(){r("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind__requireFunction")||(c.embind__requireFunction=function(){r("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"tupleRegistrations")||(c.tupleRegistrations=function(){r("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"structRegistrations")||(c.structRegistrations=function(){r("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"genericPointerToWireType")||(c.genericPointerToWireType=function(){r("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"constNoSmartPtrRawPointerToWireType")||(c.constNoSmartPtrRawPointerToWireType=function(){r("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"nonConstNoSmartPtrRawPointerToWireType")||(c.nonConstNoSmartPtrRawPointerToWireType=function(){r("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"init_RegisteredPointer")||(c.init_RegisteredPointer=function(){r("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer")||(c.RegisteredPointer=function(){r("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_getPointee")||(c.RegisteredPointer_getPointee=function(){r("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"RegisteredPointer_destructor")||(c.RegisteredPointer_destructor=function(){r("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_deleteObject")||(c.RegisteredPointer_deleteObject=function(){r("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"RegisteredPointer_fromWireType")||(c.RegisteredPointer_fromWireType=function(){r("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructor")||(c.runDestructor=function(){r("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"releaseClassHandle")||(c.releaseClassHandle=function(){r("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"finalizationGroup")||(c.finalizationGroup=function(){r("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer_deps")||(c.detachFinalizer_deps=function(){r("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer")||(c.detachFinalizer=function(){r("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"attachFinalizer")||(c.attachFinalizer=function(){r("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"makeClassHandle")||(c.makeClassHandle=function(){r("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_ClassHandle")||(c.init_ClassHandle=function(){r("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle")||(c.ClassHandle=function(){r("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_isAliasOf")||(c.ClassHandle_isAliasOf=function(){r("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInstanceAlreadyDeleted")||(c.throwInstanceAlreadyDeleted=function(){r("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle_clone")||(c.ClassHandle_clone=function(){r("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_delete")||(c.ClassHandle_delete=function(){r("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"deletionQueue")||(c.deletionQueue=function(){r("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle_isDeleted")||(c.ClassHandle_isDeleted=function(){r("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_deleteLater")||(c.ClassHandle_deleteLater=function(){r("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"flushPendingDeletes")||(c.flushPendingDeletes=function(){r("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"delayFunction")||(c.delayFunction=function(){r("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setDelayFunction")||(c.setDelayFunction=function(){r("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredClass")||(c.RegisteredClass=function(){r("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"shallowCopyInternalPointer")||(c.shallowCopyInternalPointer=function(){r("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"downcastPointer")||(c.downcastPointer=function(){r("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"upcastPointer")||(c.upcastPointer=function(){r("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"validateThis")||(c.validateThis=function(){r("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_0")||(c.char_0=function(){r("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_9")||(c.char_9=function(){r("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"makeLegalFunctionName")||(c.makeLegalFunctionName=function(){r("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"warnOnce")||(c.warnOnce=function(){r("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackSave")||(c.stackSave=function(){r("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stackRestore")||(c.stackRestore=function(){r("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackAlloc")||(c.stackAlloc=function(){r("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AsciiToString")||(c.AsciiToString=function(){r("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToAscii")||(c.stringToAscii=function(){r("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF16ToString")||(c.UTF16ToString=function(){r("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF16")||(c.stringToUTF16=function(){r("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"lengthBytesUTF16")||(c.lengthBytesUTF16=function(){r("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF32ToString")||(c.UTF32ToString=function(){r("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF32")||(c.stringToUTF32=function(){r("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"lengthBytesUTF32")||(c.lengthBytesUTF32=function(){r("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8")||(c.allocateUTF8=function(){r("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8OnStack")||(c.allocateUTF8OnStack=function(){r("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -c.writeStackCookie=Ta;c.checkStackCookie=Va;Object.getOwnPropertyDescriptor(c,"ALLOC_NORMAL")||Object.defineProperty(c,"ALLOC_NORMAL",{configurable:!0,get:function(){r("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});Object.getOwnPropertyDescriptor(c,"ALLOC_STACK")||Object.defineProperty(c,"ALLOC_STACK",{configurable:!0,get:function(){r("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var je; -function oa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}fb=function ke(){je||le();je||(fb=ke)}; -function le(){function a(){if(!je&&(je=!0,c.calledRun=!0,!wa)){Va();assert(!ab);ab=!0;if(!c.noFSInit&&!oc){assert(!oc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");oc=!0;nc();c.stdin=c.stdin;c.stdout=c.stdout;c.stderr=c.stderr;c.stdin?qc("stdin",c.stdin):jc("/dev/tty","/dev/stdin");c.stdout?qc("stdout",null,c.stdout):jc("/dev/tty","/dev/stdout");c.stderr?qc("stderr",null, -c.stderr):jc("/dev/tty1","/dev/stderr");var b=kc("/dev/stdin",0),d=kc("/dev/stdout",1),e=kc("/dev/stderr",1);assert(0===b.fd,"invalid handle for stdin ("+b.fd+")");assert(1===d.fd,"invalid handle for stdout ("+d.fd+")");assert(2===e.fd,"invalid handle for stderr ("+e.fd+")")}Tb=!1;ob(Za);if(c.onRuntimeInitialized)c.onRuntimeInitialized();assert(!c._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');Va();if(c.postRun)for("function"==typeof c.postRun&& -(c.postRun=[c.postRun]);c.postRun.length;)b=c.postRun.shift(),$a.unshift(b);ob($a)}}if(!(0=e);)++d;if(16h?e+=String.fromCharCode(h):(h-=65536,e+= -String.fromCharCode(55296|h>>10,56320|h&1023))}}else e+=String.fromCharCode(h)}return e}function z(a,b){return a?ua(A,a,b):""} -function va(a,b,d,e){if(!(0=k){var m=a.charCodeAt(++g);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;2097152<=k&&oa("Invalid Unicode code point 0x"+k.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF)."); -b[d++]=240|k>>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-h}function wa(a,b,d){assert("number"==typeof d,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");va(a,A,b,d)}function xa(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b} -var ya="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function za(a,b){assert(0==a%2,"Pointer passed to UTF16ToString must be aligned to two bytes!");var d=a>>1;for(var e=d+b/2;!(d>=e)&&Aa[d];)++d;d<<=1;if(32=b/2);++e){var h=Ba[a+2*e>>1];if(0==h)break;d+=String.fromCharCode(h)}return d} -function Ca(a,b,d){assert(0==b%2,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert("number"==typeof d,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var e=b;d=d<2*a.length?d/2:a.length;for(var h=0;h>1]=a.charCodeAt(h),b+=2;Ba[b>>1]=0;return b-e}function Da(a){return 2*a.length} -function Ea(a,b){assert(0==a%4,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var d=0,e="";!(d>=b/4);){var h=C[a+4*d>>2];if(0==h)break;++d;65536<=h?(h-=65536,e+=String.fromCharCode(55296|h>>10,56320|h&1023)):e+=String.fromCharCode(h)}return e} -function Fa(a,b,d){assert(0==b%4,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert("number"==typeof d,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(4>d)return 0;var e=b;d=e+d-4;for(var h=0;h=g){var k=a.charCodeAt(++h);g=65536+((g&1023)<<10)|k&1023}C[b>>2]=g;b+=4;if(b+4>d)break}C[b>>2]=0;return b-e} -function Ga(a){for(var b=0,d=0;d=e&&++d;b+=4}return b}function Ha(a){var b=xa(a)+1,d=Ia(b);d&&va(a,D,d,b);return d}function Ja(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");D.set(a,b)}var Ka,D,A,Ba,Aa,C,E,La,Ma; -function Na(){var a=ra.buffer;Ka=a;c.HEAP8=D=new Int8Array(a);c.HEAP16=Ba=new Int16Array(a);c.HEAP32=C=new Int32Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=Aa=new Uint16Array(a);c.HEAPU32=E=new Uint32Array(a);c.HEAPF32=La=new Float32Array(a);c.HEAPF64=Ma=new Float64Array(a)}c.TOTAL_STACK&&assert(5242880===c.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Oa=c.INITIAL_MEMORY||16777216; -Object.getOwnPropertyDescriptor(c,"INITIAL_MEMORY")||Object.defineProperty(c,"INITIAL_MEMORY",{configurable:!0,get:function(){q("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});assert(5242880<=Oa,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Oa+"! (TOTAL_STACK=5242880)"); -assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");assert(!c.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(16777216==Oa,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var Pa; -function Qa(){var a=Ra();assert(0==(a&3));E[(a>>2)+1]=34821223;E[(a>>2)+2]=2310721022;C[0]=1668509029}function Sa(){if(!sa){var a=Ra(),b=E[(a>>2)+1];a=E[(a>>2)+2];34821223==b&&2310721022==a||q("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+a.toString(16)+" "+b.toString(16));1668509029!==C[0]&&q("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var Ta=new Int16Array(1),Ua=new Int8Array(Ta.buffer); -Ta[0]=25459;if(115!==Ua[0]||99!==Ua[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";var Va=[],Wa=[],Xa=[],Ya=!1;function Za(){var a=c.preRun.shift();Va.unshift(a)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); -assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var $a=0,ab=null,bb=null,cb={}; -function db(){$a++;c.monitorRunDependencies&&c.monitorRunDependencies($a);assert(!cb["wasm-instantiate"]);cb["wasm-instantiate"]=1;null===ab&&"undefined"!==typeof setInterval&&(ab=setInterval(function(){if(sa)clearInterval(ab),ab=null;else{var a=!1,b;for(b in cb)a||(a=!0,t("still waiting on run dependencies:")),t("dependency: "+b);a&&t("(end of list)")}},1E4))}c.preloadedImages={};c.preloadedAudios={}; -function q(a){if(c.onAbort)c.onAbort(a);t(a);sa=!0;a="abort("+a+") at ";var b=eb();c.extraStackTrace&&(b+="\n"+c.extraStackTrace());b=fb(b);throw new WebAssembly.RuntimeError(a+b);}function gb(){return G.startsWith("data:application/octet-stream;base64,")} -function H(a){return function(){var b=c.asm;assert(Ya,"native function `"+a+"` called before runtime initialization");assert(!0,"native function `"+a+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var G;G="libDynamsoftBarcodeReader.wasm";if(!gb()){var hb=G;G=c.locateFile?c.locateFile(hb,f):f+hb} -function ib(){var a=G;try{if(a==G&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){q(b)}} -function jb(){if(!qa&&(da||ea)){if("function"===typeof fetch&&!G.startsWith("file://"))return fetch(G,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()}).catch(function(){return ib()});if(ja)return new Promise(function(a,b){ja(G,function(d){a(new Uint8Array(d))},b)})}return Promise.resolve().then(function(){return ib()})}var I,J; -function kb(a){for(;0>2]=60*g;C[pb()>>2]=Number(b!=h);d=a(d);e=a(e);d=Ha(d);e=Ha(e);h>2]=d,C[qb()+4>>2]=e):(C[qb()>>2]=e,C[qb()+4>>2]=d)}}var nb; -function rb(a,b){for(var d=0,e=a.length-1;0<=e;e--){var h=a[e];"."===h?a.splice(e,1):".."===h?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(b)for(;d;d--)a.unshift("..");return a}function sb(a){var b="/"===a.charAt(0),d="/"===a.substr(-1);(a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/"))||b||(a=".");a&&d&&(a+="/");return(b?"/":"")+a} -function tb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function ub(a){if("/"===a)return"/";a=sb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)} -function vb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(fa)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(d){}return function(){q("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}} -function wb(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."}var xb=[];function yb(a,b){xb[a]={input:[],output:[],U:b};zb(a,Ab)} -var Ab={open:function(a){var b=xb[a.node.rdev];if(!b)throw new K(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.U.flush(a.tty)},flush:function(a){a.tty.U.flush(a.tty)},read:function(a,b,d,e){if(!a.tty||!a.tty.U.qa)throw new K(60);for(var h=0,g=0;g=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.i,a.i=new Uint8Array(b), -0=a.node.s)return 0;a=Math.min(a.node.s-h,e);assert(0<=a);if(8b)throw new K(28);return b},la:function(a,b,d){L.oa(a.node,b+d);a.node.s=Math.max(a.node.s,b+d)},ra:function(a,b,d,e,h,g){if(0!==b)throw new K(28);if(32768!==(a.node.mode&61440))throw new K(43);a=a.node.i;if(g&2||a.buffer!==Ka){if(0>>0)%Ob.length}function Tb(a){var b=Sb(a.parent.id,a.name);if(Ob[b]===a)Ob[b]=a.T;else for(b=Ob[b];b;){if(b.T===a){b.T=a.T;break}b=b.T}} -function Hb(a,b){var d;if(d=(d=Ub(a,"x"))?d:a.h.lookup?0:2)throw new K(d,a);for(d=Ob[Sb(a.id,b)];d;d=d.T){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return a.h.lookup(a,b)}function Fb(a,b,d,e){assert("object"===typeof a);a=new Vb(a,b,d,e);b=Sb(a.parent.id,a.name);a.T=Ob[b];return Ob[b]=a}function M(a){return 16384===(a&61440)}var Wb={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Xb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b} -function Ub(a,b){if(Pb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Yb(a,b){try{return Hb(a,b),20}catch(d){}return Ub(a,"wx")}function Zb(a,b,d){try{var e=Hb(a,b)}catch(h){return h.u}if(a=Ub(a,"wx"))return a;if(d){if(!M(e.mode))return 54;if(e===e.parent||"/"===Rb(e))return 10}else if(M(e.mode))return 31;return 0}function $b(a){var b=4096;for(a=a||0;a<=b;a++)if(!Mb[a])return a;throw new K(33);} -function ac(a,b){bc||(bc=function(){},bc.prototype={});var d=new bc,e;for(e in a)d[e]=a[e];a=d;b=$b(b);a.fd=b;return Mb[b]=a}var Eb={open:function(a){a.l=Lb[a.node.rdev].l;a.l.open&&a.l.open(a)},N:function(){throw new K(70);}};function zb(a,b){Lb[a]={l:b}} -function cc(a,b){if("string"===typeof a)throw a;var d="/"===b,e=!b;if(d&&Kb)throw new K(10);if(!d&&!e){var h=O(b,{pa:!1});b=h.path;h=h.node;if(h.S)throw new K(10);if(!M(h.mode))throw new K(54);}b={type:a,md:{},sa:b,Da:[]};a=a.I(b);a.I=b;b.root=a;d?Kb=a:h&&(h.S=b,h.I&&h.I.Da.push(b))}function dc(a,b,d){var e=O(a,{parent:!0}).node;a=ub(a);if(!a||"."===a||".."===a)throw new K(28);var h=Yb(e,a);if(h)throw new K(h);if(!e.h.aa)throw new K(63);return e.h.aa(e,a,b,d)} -function P(a,b){return dc(a,(void 0!==b?b:511)&1023|16384,0)}function ec(a,b,d){"undefined"===typeof d&&(d=b,b=438);dc(a,b|8192,d)}function fc(a,b){if(!wb(a))throw new K(44);var d=O(b,{parent:!0}).node;if(!d)throw new K(44);b=ub(b);var e=Yb(d,b);if(e)throw new K(e);if(!d.h.symlink)throw new K(63);d.h.symlink(d,b,a)}function Qb(a){a=O(a).node;if(!a)throw new K(44);if(!a.h.readlink)throw new K(28);return wb(Rb(a.parent),a.h.readlink(a))} -function gc(a,b,d,e){if(""===a)throw new K(44);if("string"===typeof b){var h=Wb[b];if("undefined"===typeof h)throw Error("Unknown file open mode: "+b);b=h}d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var g=a;else{a=sb(a);try{g=O(a,{ga:!(b&131072)}).node}catch(k){}}h=!1;if(b&64)if(g){if(b&128)throw new K(20);}else g=dc(a,d,0),h=!0;if(!g)throw new K(44);8192===(g.mode&61440)&&(b&=-513);if(b&65536&&!M(g.mode))throw new K(54);if(!h&&(d=g?40960===(g.mode&61440)?32:M(g.mode)&& -("r"!==Xb(b)||b&512)?31:Ub(g,Xb(b)):44))throw new K(d);if(b&512){d=g;d="string"===typeof d?O(d,{ga:!0}).node:d;if(!d.h.G)throw new K(63);if(M(d.mode))throw new K(31);if(32768!==(d.mode&61440))throw new K(28);if(h=Ub(d,"w"))throw new K(h);d.h.G(d,{size:0,timestamp:Date.now()})}b&=-131713;e=ac({node:g,path:Rb(g),flags:b,seekable:!0,position:0,l:g.l,Pa:[],error:!1},e);e.l.open&&e.l.open(e);!c.logReadFiles||b&1||(hc||(hc={}),a in hc||(hc[a]=1,t("FS.trackingDelegate error on read file: "+a)));try{N.onOpenFile&& -(g=0,1!==(b&2097155)&&(g|=1),0!==(b&2097155)&&(g|=2),N.onOpenFile(a,g))}catch(k){t("FS.trackingDelegate['onOpenFile']('"+a+"', flags) threw an exception: "+k.message)}return e}function ic(a,b,d){if(null===a.fd)throw new K(8);if(!a.seekable||!a.l.N)throw new K(70);if(0!=d&&1!=d&&2!=d)throw new K(28);a.position=a.l.N(a,b,d);a.Pa=[];return a.position} -function jc(){K||(K=function(a,b){this.node=b;this.Ja=function(d){this.u=d;for(var e in Jb)if(Jb[e]===d){this.code=e;break}};this.Ja(a);this.message=Ib[a];this.stack&&(Object.defineProperty(this,"stack",{value:Error().stack,writable:!0}),this.stack=fb(this.stack))},K.prototype=Error(),K.prototype.constructor=K,[44].forEach(function(a){Gb[a]=new K(a);Gb[a].stack=""}))}var kc;function lc(a,b){var d=0;a&&(d|=365);b&&(d|=146);return d} -function mc(a,b,d){a=sb("/dev/"+a);var e=lc(!!b,!!d);nc||(nc=64);var h=nc++<<8|0;zb(h,{open:function(g){g.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(g,k,m,r){for(var n=0,p=0;p>2]}function qc(a){a=Mb[a];if(!a)throw new K(8);return a}function rc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var sc=void 0;function S(a){for(var b="";A[a];)b+=sc[A[a++]];return b}var tc={},uc={},vc={}; -function wc(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function xc(a,b){a=wc(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} -function yc(a){var b=Error,d=xc(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var zc=void 0;function T(a){throw new zc(a);}var Ac=void 0;function Bc(a){throw new Ac(a);} -function U(a,b,d){function e(m){m=d(m);m.length!==a.length&&Bc("Mismatched type converter count");for(var r=0;r>2])}function Wc(a,b,d){if(b===d)return a;if(void 0===d.D)return null;a=Wc(a,b,d.D);return null===a?null:d.ya(a)}var Xc={}; -function Yc(a,b){for(void 0===b&&T("ptr should not be undefined");a.D;)b=a.Y(b),a=a.D;return Xc[b]}function Zc(a,b){b.o&&b.m||Bc("makeClassHandle requires ptr and ptrType");!!b.C!==!!b.B&&Bc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Gc(Object.create(a,{g:{value:b}}))}function W(a,b,d,e){this.name=a;this.j=b;this.ha=d;this.Z=e;this.$=!1;this.O=this.Ha=this.Ga=this.ua=this.Ka=this.Ea=void 0;void 0!==b.D?this.toWireType=Sc:(this.toWireType=e?Qc:Uc,this.H=null)} -function ad(a,b){c.hasOwnProperty(a)||Bc("Replacing nonexistant public symbol");c[a]=b;c[a].P=void 0} -function bd(a,b){assert(a.includes("j"),"getDynCaller should only be called with i64 sigs");var d=[];return function(){d.length=arguments.length;for(var e=0;eg&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==d,m=!1;for(d=1;d>2)+e]);return d} -function md(a,b,d){a instanceof Object||T(d+' with invalid "this": '+a);a instanceof b.j.constructor||T(d+' incompatible with "this" of type '+a.constructor.name);a.g.m||T("cannot call emscripten binding method "+d+" on deleted object");return Pc(a.g.m,a.g.o.j,b.j)}var nd=[],Y=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function od(a){4>2])};case 3:return function(d){return this.fromWireType(Ma[d>>3])};default:throw new TypeError("Unknown float type: "+a);}} -function qd(a,b,d){switch(b){case 0:return d?function(e){return D[e]}:function(e){return A[e]};case 1:return d?function(e){return Ba[e>>1]}:function(e){return Aa[e>>1]};case 2:return d?function(e){return C[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function rd(){void 0===rd.start&&(rd.start=Date.now());return 1E3*(Date.now()-rd.start)|0}var sd;sd=fa?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()}; -function td(a,b){assert(b===(b|0));return(a>>>0)+4294967296*b}function ud(a,b){if(0>=a)return a;var d=32>=b?Math.abs(1<=d&&(32>=b||a>d)&&(a=-2*d+a);return a}function vd(a,b){return 0<=a?a:32>=b?2*Math.abs(1<>3],e+=8):"i64"==F?(F=[C[e>>2],C[e+4>>2]],e+=8):(assert(0===(e&3)),F=C[e>>2],e+=4);return F}assert(0===(b&3));for(var e=b,h=[],g,k;;){var m=a;g=D[a>>0];if(0===g)break;k=D[a+1>>0];if(37==g){var r=!1,n=b=!1,p=!1,y=!1;a:for(;;){switch(k){case 43:r=!0;break;case 45:b=!0;break;case 35:n=!0;break;case 48:if(p)break a;else{p=!0;break}case 32:y=!0;break;default:break a}a++; -k=D[a+1>>0]}var w=0;if(42==k)w=d("i32"),a++,k=D[a+1>>0];else for(;48<=k&&57>=k;)w=10*w+(k-48),a++,k=D[a+1>>0];var l=!1,u=-1;if(46==k){u=0;l=!0;a++;k=D[a+1>>0];if(42==k)u=d("i32"),a++;else for(;;){k=D[a+1>>0];if(48>k||57>0]}0>u&&(u=6,l=!1);switch(String.fromCharCode(k)){case "h":k=D[a+2>>0];if(104==k){a++;var x=1}else x=2;break;case "l":k=D[a+2>>0];108==k?(a++,x=8):x=4;break;case "L":case "q":case "j":x=8;break;case "z":case "t":case "I":x=4;break;default:x=null}x&& -a++;k=D[a+1>>0];switch(String.fromCharCode(k)){case "d":case "i":case "u":case "o":case "x":case "X":case "p":m=100==k||105==k;x=x||4;g=d("i"+8*x);8==x&&(g=117==k?(g[0]>>>0)+4294967296*(g[1]>>>0):td(g[0],g[1]));4>=x&&(g=(m?ud:vd)(g&Math.pow(256,x)-1,8*x));var B=Math.abs(g);m="";if(100==k||105==k)var v=ud(g,8*x,1).toString(10);else if(117==k)v=vd(g,8*x,1).toString(10),g=Math.abs(g);else if(111==k)v=(n?"0":"")+B.toString(8);else if(120==k||88==k){m=n&&0!=g?"0x":"";if(0>g){g=-g;v=(B-1).toString(16); -B=[];for(n=0;nx&&-4<=x?(k=(103==k?"f":"F").charCodeAt(0),u-=x+1):(k=(103==k?"e":"E").charCodeAt(0),u--),x=Math.min(u,20);if(101==k||69==k)v=g.toExponential(x),/[eE][-+]\d$/.test(v)&&(v=v.slice(0,-1)+"0"+v.slice(-1));else if(102==k||70==k)v=g.toFixed(x),0===g&&(0>g||0===g&&-Infinity===1/g)&&(v="-"+v);m=v.split("e");if(l&&!n)for(;1x++;)m[0]+="0";v=m[0]+(1g?"-":"")+"inf",p=!1;for(;v.lengthk&&(v=v.toUpperCase());v.split("").forEach(function(F){h.push(F.charCodeAt(0))});break;case "s":p=(r=d("i8*"))?wd(r):6;l&&(p=Math.min(p,u));if(!b)for(;p>0]);else h=h.concat(Bb("(null)".substr(0,p),!0));if(b)for(;p>2]=h.length;break;case "%":h.push(g);break;default:for(n=m;n>0])}a+=2}else h.push(g),a+=1}return h} -function yd(a){if(!a||!a.callee||!a.callee.name)return[null,"",""];var b=a.callee.name,d="(",e=!0,h;for(h in a){var g=a[h];e||(d+=", ");e=!1;d="number"===typeof g||"string"===typeof g?d+g:d+("("+typeof g+")")}d+=")";a=(a=a.callee.caller)?a.arguments:[];e&&(d="");return[a,b,d]} -function zd(a){var b=eb();b=b.slice(b.indexOf("\n",Math.max(b.lastIndexOf("_emscripten_log"),b.lastIndexOf("_emscripten_get_callstack")))+1);a&32&&oa("EM_LOG_DEMANGLE is deprecated; ignoring");a&8&&"undefined"===typeof emscripten_source_map&&(oa('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),a=a^8|16);var d=null;if(a&128)for(d=yd(arguments);d[1].includes("_emscripten_");)d= -yd(d[0]);var e=b.split("\n");b="";var h=/\s*(.*?)@(.*?):([0-9]+):([0-9]+)/,g=/\s*(.*?)@(.*):(.*)(:(.*))?/,k=/\s*at (.*?) \((.*):(.*):(.*)\)/,m;for(m in e){var r=e[m],n;if((n=k.exec(r))&&5==n.length){r=n[1];var p=n[2];var y=n[3];n=n[4]}else if((n=h.exec(r))||(n=g.exec(r)),n&&4<=n.length)r=n[1],p=n[2],y=n[3],n=n[4]|0;else{b+=r+"\n";continue}var w=!1;if(a&8){var l=emscripten_source_map.nd({line:y,wa:n});if(w=l&&l.source)a&64&&(l.source=l.source.substring(l.source.replace(/\\/g,"/").lastIndexOf("/")+ -1)),b+=" at "+r+" ("+l.source+":"+l.line+":"+l.wa+")\n"}if(a&16||!w)a&64&&(p=p.substring(p.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=(w?" = "+r:" at "+r)+" ("+p+":"+y+":"+n+")\n";a&128&&d[0]&&(d[1]==r&&0v?-1:0=k(x,l)?0>=k(u,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var n=C[e+40>>2];e={Na:C[e>>2],Ma:C[e+4>>2],ba:C[e+8>>2],X:C[e+12>>2],V:C[e+16>>2],A:C[e+20>>2],da:C[e+24>>2],ea:C[e+28>>2],od:C[e+32>>2],La:C[e+36>> -2],Oa:n?z(n):""};d=z(d);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in n)d=d.replace(new RegExp(p,"g"),n[p]);var y="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), -w="January February March April May June July August September October November December".split(" ");n={"%a":function(l){return y[l.da].substring(0,3)},"%A":function(l){return y[l.da]},"%b":function(l){return w[l.V].substring(0,3)},"%B":function(l){return w[l.V]},"%C":function(l){return g((l.A+1900)/100|0,2)},"%d":function(l){return g(l.X,2)},"%e":function(l){return h(l.X,2," ")},"%g":function(l){return r(l).toString().substring(2)},"%G":function(l){return r(l)},"%H":function(l){return g(l.ba,2)}, -"%I":function(l){l=l.ba;0==l?l=12:12l.ba?"AM":"PM"},"%S":function(l){return g(l.Na,2)},"%t":function(){return"\t"},"%u":function(l){return l.da||7},"%U":function(l){var u=new Date(l.A+1900,0,1),x=0===u.getDay()?u:Hd(u,7-u.getDay());l=new Date(l.A+1900,l.V,l.X);return 0>k(x,l)? -g(Math.ceil((31-x.getDate()+(Ed(Dd(l.getFullYear())?Fd:Gd,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(x,u)?"01":"00"},"%V":function(l){var u=new Date(l.A+1901,0,4),x=m(new Date(l.A+1900,0,4));u=m(u);var B=Hd(new Date(l.A+1900,0,1),l.ea);return 0>k(B,x)?"53":0>=k(u,B)?"01":g(Math.ceil((x.getFullYear()k(x,l)?g(Math.ceil((31-x.getDate()+(Ed(Dd(l.getFullYear())?Fd:Gd,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(x,u)?"01":"00"},"%y":function(l){return(l.A+1900).toString().substring(2)},"%Y":function(l){return l.A+1900},"%z":function(l){l=l.La;var u=0<=l;l=Math.abs(l)/60;return(u?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Oa},"%%":function(){return"%"}};for(p in n)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),n[p](e)));p=Bb(d,!1);if(p.length> -b)return 0;Ja(p,a);return p.length-1}function Vb(a,b,d,e){a||(a=this);this.parent=a;this.I=a.I;this.S=null;this.id=Nb++;this.name=b;this.mode=d;this.h={};this.l={};this.rdev=e}Object.defineProperties(Vb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});jc();Ob=Array(4096);cc(L,"/");P("/tmp");P("/home");P("/home/web_user"); -(function(){P("/dev");zb(259,{read:function(){return 0},write:function(b,d,e,h){return h}});ec("/dev/null",259);yb(1280,Cb);yb(1536,Db);ec("/dev/tty",1280);ec("/dev/tty1",1536);var a=vb();mc("random",a);mc("urandom",a);P("/dev/shm");P("/dev/shm/tmp")})(); -(function(){P("/proc");var a=P("/proc/self");P("/proc/self/fd");cc({I:function(){var b=Fb(a,"fd",16895,73);b.h={lookup:function(d,e){var h=Mb[+e];if(!h)throw new K(8);d={parent:null,I:{sa:"fake"},h:{readlink:function(){return h.path}}};return d.parent=d}};return b}},"/proc/self/fd")})();for(var Jd=Array(256),Kd=0;256>Kd;++Kd)Jd[Kd]=String.fromCharCode(Kd);sc=Jd;zc=c.BindingError=yc("BindingError");Ac=c.InternalError=yc("InternalError"); -Kc.prototype.isAliasOf=function(a){if(!(this instanceof Kc&&a instanceof Kc))return!1;var b=this.g.o.j,d=this.g.m,e=a.g.o.j;for(a=a.g.m;b.D;)d=b.Y(d),b=b.D;for(;e.D;)a=e.Y(a),e=e.D;return b===e&&d===a};Kc.prototype.clone=function(){this.g.m||Cc(this);if(this.g.W)return this.g.count.value+=1,this;var a=Gc,b=Object,d=b.create,e=Object.getPrototypeOf(this),h=this.g;a=a(d.call(b,e,{g:{value:{count:h.count,R:h.R,W:h.W,m:h.m,o:h.o,B:h.B,C:h.C}}}));a.g.count.value+=1;a.g.R=!1;return a}; -Kc.prototype["delete"]=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ec(this);Fc(this.g);this.g.W||(this.g.B=void 0,this.g.m=void 0)};Kc.prototype.isDeleted=function(){return!this.g.m};Kc.prototype.deleteLater=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ic.push(this);1===Ic.length&&Hc&&Hc(Jc);this.g.R=!0;return this};W.prototype.Aa=function(a){this.ua&&(a=this.ua(a));return a}; -W.prototype.na=function(a){this.O&&this.O(a)};W.prototype.argPackAdvance=8;W.prototype.readValueFromPointer=Vc;W.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; -W.prototype.fromWireType=function(a){function b(){return this.$?Zc(this.j.K,{o:this.Ea,m:d,C:this,B:a}):Zc(this.j.K,{o:this,m:a})}var d=this.Aa(a);if(!d)return this.na(a),null;var e=Yc(this.j,d);if(void 0!==e){if(0===e.g.count.value)return e.g.m=d,e.g.B=a,e.clone();e=e.clone();this.na(a);return e}e=this.j.za(d);e=Lc[e];if(!e)return b.call(this);e=this.Z?e.xa:e.pointerType;var h=Wc(d,this.j,e.j);return null===h?b.call(this):this.$?Zc(e.j.K,{o:e,m:h,C:this,B:a}):Zc(e.j.K,{o:e,m:h})}; -c.getInheritedInstanceCount=function(){return Object.keys(Xc).length};c.getLiveInheritedInstances=function(){var a=[],b;for(b in Xc)Xc.hasOwnProperty(b)&&a.push(Xc[b]);return a};c.flushPendingDeletes=Jc;c.setDelayFunction=function(a){Hc=a;Ic.length&&Hc&&Hc(Jc)};cd=c.UnboundTypeError=yc("UnboundTypeError");c.count_emval_handles=function(){for(var a=0,b=5;b>2]);C[b>>2]=a.getUTCSeconds();C[b+4>>2]=a.getUTCMinutes();C[b+8>>2]=a.getUTCHours();C[b+12>>2]=a.getUTCDate();C[b+16>>2]=a.getUTCMonth();C[b+20>>2]=a.getUTCFullYear()-1900;C[b+24>>2]=a.getUTCDay();C[b+36>>2]=0;C[b+32>>2]=0;C[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;lb||(lb=Ha("GMT"));C[b+40>>2]=lb;return b},__localtime_r:function(a,b){mb();a=new Date(1E3*C[a>>2]);C[b>>2]=a.getSeconds();C[b+ -4>>2]=a.getMinutes();C[b+8>>2]=a.getHours();C[b+12>>2]=a.getDate();C[b+16>>2]=a.getMonth();C[b+20>>2]=a.getFullYear()-1900;C[b+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);C[b+28>>2]=(a.getTime()-d.getTime())/864E5|0;C[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;C[b+32>>2]=a;a=C[qb()+(a?4:0)>>2];C[b+40>>2]=a;return b},__sys_fcntl64:function(a,b,d){oc=d;try{var e=qc(a); -switch(b){case 0:var h=pc();return 0>h?-28:gc(e.path,e.flags,0,h).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return h=pc(),e.flags|=h,0;case 12:return h=pc(),Ba[h+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return C[Ld()>>2]=28,-1;default:return-28}}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},__sys_getdents64:function(a,b,d){try{var e=qc(a);if(!e.M){var h=O(e.path,{ga:!0}).node;if(!h.h.readdir)throw new K(54);var g=h.h.readdir(h);e.M=g}a=0; -for(var k=ic(e,0,1),m=Math.floor(k/280);m>>0,(I=n,1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];C[b+a>>2]=J[0];C[b+a+4>>2]=J[1];J=[280*(m+1)>>>0,(I=280*(m+1),1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>> -0))/4294967296)>>>0:0)];C[b+a+8>>2]=J[0];C[b+a+12>>2]=J[1];Ba[b+a+16>>1]=280;D[b+a+18>>0]=p;wa(r,b+a+19,256);a+=280;m+=1}ic(e,280*m,0);return a}catch(w){return"undefined"!==typeof R&&w instanceof K||q(w),-w.u}},__sys_ioctl:function(a,b,d){oc=d;try{var e=qc(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var h=pc();return C[h>>2]=0;case 21520:return e.tty?-28:-59;case 21531:a=h= -pc();if(!e.l.Ca)throw new K(59);return e.l.Ca(e,b,a);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:q("bad ioctl syscall "+b)}}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},__sys_mkdir:function(a,b){try{return a=z(a),a=sb(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),P(a,b),0}catch(d){return"undefined"!==typeof R&&d instanceof K||q(d),-d.u}},__sys_open:function(a,b,d){oc=d;try{var e=z(a),h=d?pc():0;return gc(e,b,h).fd}catch(g){return"undefined"!==typeof R&& -g instanceof K||q(g),-g.u}},__sys_readlink:function(a,b,d){try{a=z(a);if(0>=d)var e=-28;else{var h=Qb(a),g=Math.min(d,xa(h)),k=D[b+g];wa(h,b,d+1);D[b+g]=k;e=g}return e}catch(m){return"undefined"!==typeof R&&m instanceof K||q(m),-m.u}},__sys_rmdir:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=ub(a),e=Hb(b,d),h=Zb(b,d,!0);if(h)throw new K(h);if(!b.h.rmdir)throw new K(63);if(e.S)throw new K(10);try{N.willDeletePath&&N.willDeletePath(a)}catch(g){t("FS.trackingDelegate['willDeletePath']('"+a+"') threw an exception: "+ -g.message)}b.h.rmdir(b,d);Tb(e);try{if(N.onDeletePath)N.onDeletePath(a)}catch(g){t("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},__sys_unlink:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=ub(a),e=Hb(b,d),h=Zb(b,d,!1);if(h)throw new K(h);if(!b.h.unlink)throw new K(63);if(e.S)throw new K(10);try{N.willDeletePath&&N.willDeletePath(a)}catch(g){t("FS.trackingDelegate['willDeletePath']('"+ -a+"') threw an exception: "+g.message)}b.h.unlink(b,d);Tb(e);try{if(N.onDeletePath)N.onDeletePath(a)}catch(g){t("FS.trackingDelegate['onDeletePath']('"+a+"') threw an exception: "+g.message)}return 0}catch(g){return"undefined"!==typeof R&&g instanceof K||q(g),-g.u}},_embind_register_bigint:function(){},_embind_register_bool:function(a,b,d,e,h){var g=rc(d);b=S(b);V(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,m){return m?e:h},argPackAdvance:8,readValueFromPointer:function(k){if(1=== -d)var m=D;else if(2===d)m=Ba;else if(4===d)m=C;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(m[k>>g])},H:null})},_embind_register_class:function(a,b,d,e,h,g,k,m,r,n,p,y,w){p=S(p);g=X(h,g);m&&(m=X(k,m));n&&(n=X(r,n));w=X(y,w);var l=wc(p);Nc(l,function(){gd("Cannot construct "+p+" due to unbound types",[e])});U([a,b,d],e?[e]:[],function(u){u=u[0];if(e){var x=u.j;var B=x.K}else B=Kc.prototype;u=xc(l,function(){if(Object.getPrototypeOf(this)!==v)throw new zc("Use 'new' to construct "+ -p);if(void 0===F.L)throw new zc(p+" has no accessible constructor");var $c=F.L[arguments.length];if(void 0===$c)throw new zc("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(F.L).toString()+") parameters instead!");return $c.apply(this,arguments)});var v=Object.create(B,{constructor:{value:u}});u.prototype=v;var F=new Oc(p,u,v,w,x,g,m,n);x=new W(p,F,!0,!1);B=new W(p+"*",F,!1,!1);var Q=new W(p+" const*",F,!1,!0);Lc[a]={pointerType:B, -xa:Q};ad(l,u);return[x,B,Q]})},_embind_register_class_class_function:function(a,b,d,e,h,g,k){var m=ld(d,e);b=S(b);g=X(h,g);U([],[a],function(r){function n(){gd("Cannot call "+p+" due to unbound types",m)}r=r[0];var p=r.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var y=r.j.constructor;void 0===y[b]?(n.P=d-1,y[b]=n):(Mc(y,b,p),y[b].v[d-1]=n);U([],m,function(w){w=[w[0],null].concat(w.slice(1));w=kd(p,w,null,g,k);void 0===y[b].v?(w.P=d-1,y[b]=w):y[b].v[d-1]=w;return[]});return[]})},_embind_register_class_constructor:function(a, -b,d,e,h,g){assert(0>>m}}var r=b.includes("unsigned");V(a,{name:b,fromWireType:g,toWireType:function(n,p){if("number"!==typeof p&&"boolean"!==typeof p)throw new TypeError('Cannot convert "'+Rc(p)+'" to '+this.name);if(ph)throw new TypeError('Passing a number "'+Rc(p)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+h+"]!");return r?p>>>0:p|0},argPackAdvance:8,readValueFromPointer:qd(b,k,0!==e),H:null})}, -_embind_register_memory_view:function(a,b,d){function e(g){g>>=2;var k=E;return new h(Ka,k[g+1],k[g])}var h=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];d=S(d);V(a,{name:d,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Ba:!0})},_embind_register_std_string:function(a,b){b=S(b);var d="std::string"===b;V(a,{name:b,fromWireType:function(e){var h=E[e>>2];if(d)for(var g=e+4,k=0;k<=h;++k){var m=e+4+k;if(k==h||0==A[m]){g=z(g,m-g);if(void 0=== -r)var r=g;else r+=String.fromCharCode(0),r+=g;g=m+1}}else{r=Array(h);for(k=0;k>2]=k;if(d&&g)wa(h,m+4,k+1);else if(g)for(g= -0;g>2],p=k(),y,w=r+4, -l=0;l<=n;++l){var u=r+4+l*b;if(l==n||0==p[u>>m])w=e(w,u-w),void 0===y?y=w:(y+=String.fromCharCode(0),y+=w),w=u+b}fd(r);return y},toWireType:function(r,n){"string"!==typeof n&&T("Cannot pass non-string to C++ string type "+d);var p=g(n),y=Ia(4+p+b);E[y>>2]=p>>m;h(n,y+4,p+b);null!==r&&r.push(fd,y);return y},argPackAdvance:8,readValueFromPointer:Vc,H:function(r){fd(r)}})},_embind_register_void:function(a,b){b=S(b);V(a,{ld:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})}, -_emval_decref:od,_emval_incref:function(a){4>2]=28,-1;C[b>>2]=a/1E3|0;C[b+4>>2]=a%1E3*1E6|0;return 0},emscripten_log:function(a,b,d){b=xd(b,d);b=ua(b,0);a&24&&(b=b.replace(/\s+$/,""),b+=(0>>=0;assert(a>b);if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a,e);0>>16);Na();var g=1;break a}catch(k){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+Ka.byteLength+" bytes to "+h+" bytes, but got error: "+k)}g=void 0}if(g)return!0}t("Failed to grow the heap from "+b+" bytes to "+e+" bytes, not enough memory!");return!1},emscripten_run_script:function(a){eval(z(a))},emscripten_run_script_int:function(a){return eval(z(a))|0},emscripten_run_script_string:Z,environ_get:function(a,b){try{var d=0; -Bd().forEach(function(e,h){var g=b+d;h=C[a+4*h>>2]=g;for(g=0;g>0]=e.charCodeAt(g);D[h>>0]=0;d+=e.length+1});return 0}catch(e){return"undefined"!==typeof R&&e instanceof K||q(e),e.u}},environ_sizes_get:function(a,b){try{var d=Bd();C[a>>2]=d.length;var e=0;d.forEach(function(h){e+=h.length+1});C[b>>2]=e;return 0}catch(h){return"undefined"!==typeof R&&h instanceof K||q(h),h.u}},fd_close:function(a){try{var b=qc(a);if(null===b.fd)throw new K(8); -b.M&&(b.M=null);try{b.l.close&&b.l.close(b)}catch(d){throw d;}finally{Mb[b.fd]=null}b.fd=null;return 0}catch(d){return"undefined"!==typeof R&&d instanceof K||q(d),d.u}},fd_read:function(a,b,d,e){try{a:{for(var h=qc(a),g=a=0;g>2],m=h,r=C[b+8*g>>2],n=k,p=void 0,y=D;if(0>n||0>p)throw new K(28);if(null===m.fd)throw new K(8);if(1===(m.flags&2097155))throw new K(8);if(M(m.node.mode))throw new K(31);if(!m.l.read)throw new K(28);var w="undefined"!==typeof p;if(!w)p=m.position;else if(!m.seekable)throw new K(70); -var l=m.l.read(m,y,r,n,p);w||(m.position+=l);var u=l;if(0>u){var x=-1;break a}a+=u;if(u>2]=x;return 0}catch(B){return"undefined"!==typeof R&&B instanceof K||q(B),B.u}},fd_seek:function(a,b,d,e,h){try{var g=qc(a);a=4294967296*d+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;ic(g,a,e);J=[g.position>>>0,(I=g.position,1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];C[h>>2]=J[0];C[h+4>>2]=J[1];g.M&& -0===a&&0===e&&(g.M=null);return 0}catch(k){return"undefined"!==typeof R&&k instanceof K||q(k),k.u}},fd_write:function(a,b,d,e){try{a:{for(var h=qc(a),g=a=0;g>2],r=C[b+(8*g+4)>>2],n=void 0,p=D;if(0>r||0>n)throw new K(28);if(null===k.fd)throw new K(8);if(0===(k.flags&2097155))throw new K(8);if(M(k.node.mode))throw new K(31);if(!k.l.write)throw new K(28);k.seekable&&k.flags&1024&&ic(k,0,2);var y="undefined"!==typeof n;if(!y)n=k.position;else if(!k.seekable)throw new K(70);var w= -k.l.write(k,p,m,r,n,void 0);y||(k.position+=w);try{if(k.path&&N.onWriteToFile)N.onWriteToFile(k.path)}catch(x){t("FS.trackingDelegate['onWriteToFile']('"+k.path+"') threw an exception: "+x.message)}var l=w;if(0>l){var u=-1;break a}a+=l}u=a}C[e>>2]=u;return 0}catch(x){return"undefined"!==typeof R&&x instanceof K||q(x),x.u}},mktime:function(a){mb();var b=new Date(C[a+20>>2]+1900,C[a+16>>2],C[a+12>>2],C[a+8>>2],C[a+4>>2],C[a>>2],0),d=C[a+32>>2],e=b.getTimezoneOffset(),h=new Date(b.getFullYear(),0,1), -g=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=h.getTimezoneOffset(),m=Math.min(k,g);0>d?C[a+32>>2]=Number(g!=k&&m==e):0>2]=b.getDay();C[a+28>>2]=(b.getTime()-h.getTime())/864E5|0;C[a>>2]=b.getSeconds();C[a+4>>2]=b.getMinutes();C[a+8>>2]=b.getHours();C[a+12>>2]=b.getDate();C[a+16>>2]=b.getMonth();return b.getTime()/1E3|0},setTempRet0:function(){},strftime:Id,strftime_l:function(a,b,d,e){return Id(a,b,d,e)},time:function(a){var b= -Date.now()/1E3|0;a&&(C[a>>2]=b);return b}}; -(function(){function a(g){c.asm=g.exports;ra=c.asm.memory;assert(ra,"memory not found in wasm exports");Na();Pa=c.asm.__indirect_function_table;assert(Pa,"table not found in wasm exports");Wa.unshift(c.asm.__wasm_call_ctors);$a--;c.monitorRunDependencies&&c.monitorRunDependencies($a);assert(cb["wasm-instantiate"]);delete cb["wasm-instantiate"];0==$a&&(null!==ab&&(clearInterval(ab),ab=null),bb&&(g=bb,bb=null,g()))}function b(g){assert(c===h,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");h= -null;a(g.instance)}function d(g){return jb().then(function(k){return WebAssembly.instantiate(k,e)}).then(g,function(k){t("failed to asynchronously prepare wasm: "+k);G.startsWith("file://")&&t("warning: Loading from a file URI ("+G+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");q(k)})}var e={env:Md,wasi_snapshot_preview1:Md};db();var h=c;if(c.instantiateWasm)try{return c.instantiateWasm(e, -a)}catch(g){return t("Module.instantiateWasm callback failed with error: "+g),!1}(function(){return qa||"function"!==typeof WebAssembly.instantiateStreaming||gb()||G.startsWith("file://")||"function"!==typeof fetch?d(b):fetch(G,{credentials:"same-origin"}).then(function(g){return WebAssembly.instantiateStreaming(g,e).then(b,function(k){t("wasm streaming compile failed: "+k);t("falling back to ArrayBuffer instantiation");return d(b)})})})();return{}})();c.___wasm_call_ctors=H("__wasm_call_ctors"); -var Ia=c._malloc=H("malloc"),Ld=c.___errno_location=H("__errno_location"),fd=c._free=H("free"),ed=c.___getTypeName=H("__getTypeName");c.___embind_register_native_and_builtin_types=H("__embind_register_native_and_builtin_types");c._emscripten_main_thread_process_queued_calls=H("emscripten_main_thread_process_queued_calls");var Ra=c._emscripten_stack_get_end=function(){return(Ra=c._emscripten_stack_get_end=c.asm.emscripten_stack_get_end).apply(null,arguments)};c._fflush=H("fflush"); -var qb=c.__get_tzname=H("_get_tzname"),pb=c.__get_daylight=H("_get_daylight"),ob=c.__get_timezone=H("_get_timezone");c.stackSave=H("stackSave");c.stackRestore=H("stackRestore");c.stackAlloc=H("stackAlloc");var Nd=c._emscripten_stack_init=function(){return(Nd=c._emscripten_stack_init=c.asm.emscripten_stack_init).apply(null,arguments)};c._emscripten_stack_get_free=function(){return(c._emscripten_stack_get_free=c.asm.emscripten_stack_get_free).apply(null,arguments)};c._saveSetjmp=H("saveSetjmp"); -c._setThrew=H("setThrew");c.dynCall_jiji=H("dynCall_jiji");c.dynCall_viiiiiiji=H("dynCall_viiiiiiji");c.dynCall_viiijj=H("dynCall_viiijj");c.dynCall_viiiiiijjiii=H("dynCall_viiiiiijjiii");c.dynCall_iiiijjii=H("dynCall_iiiijjii");c.dynCall_iiiiij=H("dynCall_iiiiij");c.dynCall_iiiiijj=H("dynCall_iiiiijj");c.dynCall_iiiiiijj=H("dynCall_iiiiiijj");c.dynCall_viijii=H("dynCall_viijii");Object.getOwnPropertyDescriptor(c,"intArrayFromString")||(c.intArrayFromString=function(){q("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"intArrayToString")||(c.intArrayToString=function(){q("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ccall")||(c.ccall=function(){q("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"cwrap")||(c.cwrap=function(){q("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"setValue")||(c.setValue=function(){q("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getValue")||(c.getValue=function(){q("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocate")||(c.allocate=function(){q("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"UTF8ArrayToString")||(c.UTF8ArrayToString=function(){q("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF8ToString")||(c.UTF8ToString=function(){q("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8Array")||(c.stringToUTF8Array=function(){q("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToUTF8")||(c.stringToUTF8=function(){q("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"lengthBytesUTF8")||(c.lengthBytesUTF8=function(){q("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){q("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"addOnPreRun")||(c.addOnPreRun=function(){q("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnInit")||(c.addOnInit=function(){q("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreMain")||(c.addOnPreMain=function(){q("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"addOnExit")||(c.addOnExit=function(){q("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPostRun")||(c.addOnPostRun=function(){q("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeStringToMemory")||(c.writeStringToMemory=function(){q("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeArrayToMemory")||(c.writeArrayToMemory=function(){q("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeAsciiToMemory")||(c.writeAsciiToMemory=function(){q("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addRunDependency")||(c.addRunDependency=function(){q("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"removeRunDependency")||(c.removeRunDependency=function(){q("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createFolder")||(c.FS_createFolder=function(){q("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"FS_createPath")||(c.FS_createPath=function(){q("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createDataFile")||(c.FS_createDataFile=function(){q("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"FS_createPreloadedFile")||(c.FS_createPreloadedFile=function(){q("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createLazyFile")||(c.FS_createLazyFile=function(){q("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"FS_createLink")||(c.FS_createLink=function(){q("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS_createDevice")||(c.FS_createDevice=function(){q("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_unlink")||(c.FS_unlink=function(){q("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); -Object.getOwnPropertyDescriptor(c,"getLEB")||(c.getLEB=function(){q("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFunctionTables")||(c.getFunctionTables=function(){q("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"alignFunctionTables")||(c.alignFunctionTables=function(){q("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerFunctions")||(c.registerFunctions=function(){q("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addFunction")||(c.addFunction=function(){q("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"removeFunction")||(c.removeFunction=function(){q("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){q("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"prettyPrint")||(c.prettyPrint=function(){q("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){q("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getCompilerSetting")||(c.getCompilerSetting=function(){q("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"print")||(c.print=function(){q("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"printErr")||(c.printErr=function(){q("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getTempRet0")||(c.getTempRet0=function(){q("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setTempRet0")||(c.setTempRet0=function(){q("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callMain")||(c.callMain=function(){q("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"abort")||(c.abort=function(){q("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"keepRuntimeAlive")||(c.keepRuntimeAlive=function(){q("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"zeroMemory")||(c.zeroMemory=function(){q("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToNewUTF8")||(c.stringToNewUTF8=function(){q("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setFileTime")||(c.setFileTime=function(){q("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscripten_realloc_buffer")||(c.emscripten_realloc_buffer=function(){q("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ENV")||(c.ENV=function(){q("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_CODES")||(c.ERRNO_CODES=function(){q("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_MESSAGES")||(c.ERRNO_MESSAGES=function(){q("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"setErrNo")||(c.setErrNo=function(){q("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton4")||(c.inetPton4=function(){q("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop4")||(c.inetNtop4=function(){q("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"inetPton6")||(c.inetPton6=function(){q("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop6")||(c.inetNtop6=function(){q("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readSockaddr")||(c.readSockaddr=function(){q("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeSockaddr")||(c.writeSockaddr=function(){q("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"DNS")||(c.DNS=function(){q("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getHostByName")||(c.getHostByName=function(){q("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"GAI_ERRNO_MESSAGES")||(c.GAI_ERRNO_MESSAGES=function(){q("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Protocols")||(c.Protocols=function(){q("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Sockets")||(c.Sockets=function(){q("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getRandomDevice")||(c.getRandomDevice=function(){q("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"traverseStack")||(c.traverseStack=function(){q("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UNWIND_CACHE")||(c.UNWIND_CACHE=function(){q("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"withBuiltinMalloc")||(c.withBuiltinMalloc=function(){q("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgsArray")||(c.readAsmConstArgsArray=function(){q("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgs")||(c.readAsmConstArgs=function(){q("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"mainThreadEM_ASM")||(c.mainThreadEM_ASM=function(){q("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_q")||(c.jstoi_q=function(){q("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_s")||(c.jstoi_s=function(){q("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getExecutableName")||(c.getExecutableName=function(){q("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"listenOnce")||(c.listenOnce=function(){q("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"autoResumeAudioContext")||(c.autoResumeAudioContext=function(){q("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"dynCallLegacy")||(c.dynCallLegacy=function(){q("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getDynCaller")||(c.getDynCaller=function(){q("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){q("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"callRuntimeCallbacks")||(c.callRuntimeCallbacks=function(){q("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePush")||(c.runtimeKeepalivePush=function(){q("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePop")||(c.runtimeKeepalivePop=function(){q("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"callUserCallback")||(c.callUserCallback=function(){q("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeExit")||(c.maybeExit=function(){q("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"safeSetTimeout")||(c.safeSetTimeout=function(){q("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"asmjsMangle")||(c.asmjsMangle=function(){q("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asyncLoad")||(c.asyncLoad=function(){q("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"mmapAlloc")||(c.mmapAlloc=function(){q("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"reallyNegative")||(c.reallyNegative=function(){q("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"unSign")||(c.unSign=function(){q("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reSign")||(c.reSign=function(){q("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"formatString")||(c.formatString=function(){q("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH")||(c.PATH=function(){q("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH_FS")||(c.PATH_FS=function(){q("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SYSCALLS")||(c.SYSCALLS=function(){q("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMmap2")||(c.syscallMmap2=function(){q("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMunmap")||(c.syscallMunmap=function(){q("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getSocketFromFD")||(c.getSocketFromFD=function(){q("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getSocketAddress")||(c.getSocketAddress=function(){q("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"JSEvents")||(c.JSEvents=function(){q("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerKeyEventCallback")||(c.registerKeyEventCallback=function(){q("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"specialHTMLTargets")||(c.specialHTMLTargets=function(){q("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeCStringToJsString")||(c.maybeCStringToJsString=function(){q("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"findEventTarget")||(c.findEventTarget=function(){q("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"findCanvasEventTarget")||(c.findCanvasEventTarget=function(){q("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBoundingClientRect")||(c.getBoundingClientRect=function(){q("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillMouseEventData")||(c.fillMouseEventData=function(){q("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerMouseEventCallback")||(c.registerMouseEventCallback=function(){q("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerWheelEventCallback")||(c.registerWheelEventCallback=function(){q("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerUiEventCallback")||(c.registerUiEventCallback=function(){q("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerFocusEventCallback")||(c.registerFocusEventCallback=function(){q("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillDeviceOrientationEventData")||(c.fillDeviceOrientationEventData=function(){q("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceOrientationEventCallback")||(c.registerDeviceOrientationEventCallback=function(){q("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillDeviceMotionEventData")||(c.fillDeviceMotionEventData=function(){q("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceMotionEventCallback")||(c.registerDeviceMotionEventCallback=function(){q("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"screenOrientation")||(c.screenOrientation=function(){q("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillOrientationChangeEventData")||(c.fillOrientationChangeEventData=function(){q("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerOrientationChangeEventCallback")||(c.registerOrientationChangeEventCallback=function(){q("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillFullscreenChangeEventData")||(c.fillFullscreenChangeEventData=function(){q("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerFullscreenChangeEventCallback")||(c.registerFullscreenChangeEventCallback=function(){q("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerRestoreOldStyle")||(c.registerRestoreOldStyle=function(){q("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"hideEverythingExceptGivenElement")||(c.hideEverythingExceptGivenElement=function(){q("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreHiddenElements")||(c.restoreHiddenElements=function(){q("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setLetterbox")||(c.setLetterbox=function(){q("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"currentFullscreenStrategy")||(c.currentFullscreenStrategy=function(){q("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreOldWindowedStyle")||(c.restoreOldWindowedStyle=function(){q("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"softFullscreenResizeWebGLRenderTarget")||(c.softFullscreenResizeWebGLRenderTarget=function(){q("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"doRequestFullscreen")||(c.doRequestFullscreen=function(){q("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillPointerlockChangeEventData")||(c.fillPointerlockChangeEventData=function(){q("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerPointerlockChangeEventCallback")||(c.registerPointerlockChangeEventCallback=function(){q("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerPointerlockErrorEventCallback")||(c.registerPointerlockErrorEventCallback=function(){q("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requestPointerLock")||(c.requestPointerLock=function(){q("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"fillVisibilityChangeEventData")||(c.fillVisibilityChangeEventData=function(){q("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerVisibilityChangeEventCallback")||(c.registerVisibilityChangeEventCallback=function(){q("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerTouchEventCallback")||(c.registerTouchEventCallback=function(){q("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillGamepadEventData")||(c.fillGamepadEventData=function(){q("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerGamepadEventCallback")||(c.registerGamepadEventCallback=function(){q("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerBeforeUnloadEventCallback")||(c.registerBeforeUnloadEventCallback=function(){q("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillBatteryEventData")||(c.fillBatteryEventData=function(){q("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"battery")||(c.battery=function(){q("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registerBatteryEventCallback")||(c.registerBatteryEventCallback=function(){q("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setCanvasElementSize")||(c.setCanvasElementSize=function(){q("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getCanvasElementSize")||(c.getCanvasElementSize=function(){q("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"polyfillSetImmediate")||(c.polyfillSetImmediate=function(){q("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangle")||(c.demangle=function(){q("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangleAll")||(c.demangleAll=function(){q("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"jsStackTrace")||(c.jsStackTrace=function(){q("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){q("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getEnvStrings")||(c.getEnvStrings=function(){q("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"checkWasiClock")||(c.checkWasiClock=function(){q("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64")||(c.writeI53ToI64=function(){q("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Clamped")||(c.writeI53ToI64Clamped=function(){q("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"writeI53ToI64Signaling")||(c.writeI53ToI64Signaling=function(){q("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Clamped")||(c.writeI53ToU64Clamped=function(){q("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Signaling")||(c.writeI53ToU64Signaling=function(){q("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"readI53FromI64")||(c.readI53FromI64=function(){q("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readI53FromU64")||(c.readI53FromU64=function(){q("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertI32PairToI53")||(c.convertI32PairToI53=function(){q("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"convertU32PairToI53")||(c.convertU32PairToI53=function(){q("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"uncaughtExceptionCount")||(c.uncaughtExceptionCount=function(){q("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionLast")||(c.exceptionLast=function(){q("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"exceptionCaught")||(c.exceptionCaught=function(){q("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ExceptionInfo")||(c.ExceptionInfo=function(){q("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"CatchInfo")||(c.CatchInfo=function(){q("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"exception_addRef")||(c.exception_addRef=function(){q("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exception_decRef")||(c.exception_decRef=function(){q("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Browser")||(c.Browser=function(){q("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"funcWrappers")||(c.funcWrappers=function(){q("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){q("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setMainLoop")||(c.setMainLoop=function(){q("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"wget")||(c.wget=function(){q("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS")||(c.FS=function(){q("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"MEMFS")||(c.MEMFS=function(){q("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"TTY")||(c.TTY=function(){q("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"PIPEFS")||(c.PIPEFS=function(){q("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SOCKFS")||(c.SOCKFS=function(){q("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"_setNetworkCallback")||(c._setNetworkCallback=function(){q("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"tempFixedLengthArray")||(c.tempFixedLengthArray=function(){q("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"miniTempWebGLFloatBuffers")||(c.miniTempWebGLFloatBuffers=function(){q("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapObjectForWebGLType")||(c.heapObjectForWebGLType=function(){q("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"heapAccessShiftForWebGLHeap")||(c.heapAccessShiftForWebGLHeap=function(){q("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GL")||(c.GL=function(){q("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGet")||(c.emscriptenWebGLGet=function(){q("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"computeUnpackAlignedImageSize")||(c.computeUnpackAlignedImageSize=function(){q("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetTexPixelData")||(c.emscriptenWebGLGetTexPixelData=function(){q("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetUniform")||(c.emscriptenWebGLGetUniform=function(){q("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglGetUniformLocation")||(c.webglGetUniformLocation=function(){q("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"webglPrepareUniformLocationsBeforeFirstUse")||(c.webglPrepareUniformLocationsBeforeFirstUse=function(){q("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglGetLeftBracePos")||(c.webglGetLeftBracePos=function(){q("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetVertexAttrib")||(c.emscriptenWebGLGetVertexAttrib=function(){q("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeGLArray")||(c.writeGLArray=function(){q("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AL")||(c.AL=function(){q("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SDL_unicode")||(c.SDL_unicode=function(){q("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_ttfContext")||(c.SDL_ttfContext=function(){q("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_audio")||(c.SDL_audio=function(){q("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"SDL")||(c.SDL=function(){q("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_gfx")||(c.SDL_gfx=function(){q("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLUT")||(c.GLUT=function(){q("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"EGL")||(c.EGL=function(){q("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"GLFW_Window")||(c.GLFW_Window=function(){q("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW")||(c.GLFW=function(){q("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLEW")||(c.GLEW=function(){q("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"IDBStore")||(c.IDBStore=function(){q("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runAndAbortIfError")||(c.runAndAbortIfError=function(){q("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_handle_array")||(c.emval_handle_array=function(){q("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emval_free_list")||(c.emval_free_list=function(){q("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_symbols")||(c.emval_symbols=function(){q("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_emval")||(c.init_emval=function(){q("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"count_emval_handles")||(c.count_emval_handles=function(){q("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"get_first_emval")||(c.get_first_emval=function(){q("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getStringOrSymbol")||(c.getStringOrSymbol=function(){q("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"requireHandle")||(c.requireHandle=function(){q("'requireHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_newers")||(c.emval_newers=function(){q("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"craftEmvalAllocator")||(c.craftEmvalAllocator=function(){q("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"emval_get_global")||(c.emval_get_global=function(){q("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_methodCallers")||(c.emval_methodCallers=function(){q("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"InternalError")||(c.InternalError=function(){q("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"BindingError")||(c.BindingError=function(){q("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UnboundTypeError")||(c.UnboundTypeError=function(){q("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PureVirtualError")||(c.PureVirtualError=function(){q("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"init_embind")||(c.init_embind=function(){q("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInternalError")||(c.throwInternalError=function(){q("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwBindingError")||(c.throwBindingError=function(){q("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"throwUnboundTypeError")||(c.throwUnboundTypeError=function(){q("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ensureOverloadTable")||(c.ensureOverloadTable=function(){q("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exposePublicSymbol")||(c.exposePublicSymbol=function(){q("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"replacePublicSymbol")||(c.replacePublicSymbol=function(){q("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"extendError")||(c.extendError=function(){q("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"createNamedFunction")||(c.createNamedFunction=function(){q("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"registeredInstances")||(c.registeredInstances=function(){q("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBasestPointer")||(c.getBasestPointer=function(){q("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerInheritedInstance")||(c.registerInheritedInstance=function(){q("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"unregisterInheritedInstance")||(c.unregisterInheritedInstance=function(){q("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstance")||(c.getInheritedInstance=function(){q("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstanceCount")||(c.getInheritedInstanceCount=function(){q("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"getLiveInheritedInstances")||(c.getLiveInheritedInstances=function(){q("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredTypes")||(c.registeredTypes=function(){q("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"awaitingDependencies")||(c.awaitingDependencies=function(){q("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"typeDependencies")||(c.typeDependencies=function(){q("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredPointers")||(c.registeredPointers=function(){q("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerType")||(c.registerType=function(){q("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"whenDependentTypesAreResolved")||(c.whenDependentTypesAreResolved=function(){q("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_charCodes")||(c.embind_charCodes=function(){q("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_init_charCodes")||(c.embind_init_charCodes=function(){q("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"readLatin1String")||(c.readLatin1String=function(){q("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getTypeName")||(c.getTypeName=function(){q("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heap32VectorToArray")||(c.heap32VectorToArray=function(){q("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"requireRegisteredType")||(c.requireRegisteredType=function(){q("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getShiftFromSize")||(c.getShiftFromSize=function(){q("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"integerReadValueFromPointer")||(c.integerReadValueFromPointer=function(){q("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"enumReadValueFromPointer")||(c.enumReadValueFromPointer=function(){q("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"floatReadValueFromPointer")||(c.floatReadValueFromPointer=function(){q("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"simpleReadValueFromPointer")||(c.simpleReadValueFromPointer=function(){q("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructors")||(c.runDestructors=function(){q("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"new_")||(c.new_=function(){q("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"craftInvokerFunction")||(c.craftInvokerFunction=function(){q("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind__requireFunction")||(c.embind__requireFunction=function(){q("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"tupleRegistrations")||(c.tupleRegistrations=function(){q("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"structRegistrations")||(c.structRegistrations=function(){q("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"genericPointerToWireType")||(c.genericPointerToWireType=function(){q("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"constNoSmartPtrRawPointerToWireType")||(c.constNoSmartPtrRawPointerToWireType=function(){q("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"nonConstNoSmartPtrRawPointerToWireType")||(c.nonConstNoSmartPtrRawPointerToWireType=function(){q("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"init_RegisteredPointer")||(c.init_RegisteredPointer=function(){q("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer")||(c.RegisteredPointer=function(){q("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_getPointee")||(c.RegisteredPointer_getPointee=function(){q("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"RegisteredPointer_destructor")||(c.RegisteredPointer_destructor=function(){q("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_deleteObject")||(c.RegisteredPointer_deleteObject=function(){q("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"RegisteredPointer_fromWireType")||(c.RegisteredPointer_fromWireType=function(){q("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructor")||(c.runDestructor=function(){q("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"releaseClassHandle")||(c.releaseClassHandle=function(){q("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"finalizationGroup")||(c.finalizationGroup=function(){q("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer_deps")||(c.detachFinalizer_deps=function(){q("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer")||(c.detachFinalizer=function(){q("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"attachFinalizer")||(c.attachFinalizer=function(){q("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"makeClassHandle")||(c.makeClassHandle=function(){q("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_ClassHandle")||(c.init_ClassHandle=function(){q("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle")||(c.ClassHandle=function(){q("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_isAliasOf")||(c.ClassHandle_isAliasOf=function(){q("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInstanceAlreadyDeleted")||(c.throwInstanceAlreadyDeleted=function(){q("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle_clone")||(c.ClassHandle_clone=function(){q("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_delete")||(c.ClassHandle_delete=function(){q("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"deletionQueue")||(c.deletionQueue=function(){q("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"ClassHandle_isDeleted")||(c.ClassHandle_isDeleted=function(){q("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_deleteLater")||(c.ClassHandle_deleteLater=function(){q("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"flushPendingDeletes")||(c.flushPendingDeletes=function(){q("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"delayFunction")||(c.delayFunction=function(){q("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setDelayFunction")||(c.setDelayFunction=function(){q("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredClass")||(c.RegisteredClass=function(){q("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"shallowCopyInternalPointer")||(c.shallowCopyInternalPointer=function(){q("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"downcastPointer")||(c.downcastPointer=function(){q("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"upcastPointer")||(c.upcastPointer=function(){q("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"validateThis")||(c.validateThis=function(){q("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_0")||(c.char_0=function(){q("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_9")||(c.char_9=function(){q("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"makeLegalFunctionName")||(c.makeLegalFunctionName=function(){q("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"warnOnce")||(c.warnOnce=function(){q("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackSave")||(c.stackSave=function(){q("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stackRestore")||(c.stackRestore=function(){q("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackAlloc")||(c.stackAlloc=function(){q("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AsciiToString")||(c.AsciiToString=function(){q("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"stringToAscii")||(c.stringToAscii=function(){q("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF16ToString")||(c.UTF16ToString=function(){q("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF16")||(c.stringToUTF16=function(){q("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"lengthBytesUTF16")||(c.lengthBytesUTF16=function(){q("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF32ToString")||(c.UTF32ToString=function(){q("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF32")||(c.stringToUTF32=function(){q("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -Object.getOwnPropertyDescriptor(c,"lengthBytesUTF32")||(c.lengthBytesUTF32=function(){q("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8")||(c.allocateUTF8=function(){q("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8OnStack")||(c.allocateUTF8OnStack=function(){q("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); -c.writeStackCookie=Qa;c.checkStackCookie=Sa;Object.getOwnPropertyDescriptor(c,"ALLOC_NORMAL")||Object.defineProperty(c,"ALLOC_NORMAL",{configurable:!0,get:function(){q("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});Object.getOwnPropertyDescriptor(c,"ALLOC_STACK")||Object.defineProperty(c,"ALLOC_STACK",{configurable:!0,get:function(){q("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var Od; -bb=function Pd(){Od||Qd();Od||(bb=Pd)}; -function Qd(){function a(){if(!Od&&(Od=!0,c.calledRun=!0,!sa)){Sa();assert(!Ya);Ya=!0;if(!c.noFSInit&&!kc){assert(!kc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");kc=!0;jc();c.stdin=c.stdin;c.stdout=c.stdout;c.stderr=c.stderr;c.stdin?mc("stdin",c.stdin):fc("/dev/tty","/dev/stdin");c.stdout?mc("stdout",null,c.stdout):fc("/dev/tty","/dev/stdout");c.stderr?mc("stderr",null, -c.stderr):fc("/dev/tty1","/dev/stderr");var b=gc("/dev/stdin",0),d=gc("/dev/stdout",1),e=gc("/dev/stderr",1);assert(0===b.fd,"invalid handle for stdin ("+b.fd+")");assert(1===d.fd,"invalid handle for stdout ("+d.fd+")");assert(2===e.fd,"invalid handle for stderr ("+e.fd+")")}Pb=!1;kb(Wa);if(c.onRuntimeInitialized)c.onRuntimeInitialized();assert(!c._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');Sa();if(c.postRun)for("function"==typeof c.postRun&& -(c.postRun=[c.postRun]);c.postRun.length;)b=c.postRun.shift(),Xa.unshift(b);kb(Xa)}}if(!(0<$a)){Nd();Qa();if(c.preRun)for("function"==typeof c.preRun&&(c.preRun=[c.preRun]);c.preRun.length;)Za();kb(Va);0<$a||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1);a()},1)):a(),Sa())}}c.run=Qd;if(c.preInit)for("function"==typeof c.preInit&&(c.preInit=[c.preInit]);0=e);)++d;if(16g?e+=String.fromCharCode(g):(g-=65536,e+= +String.fromCharCode(55296|g>>10,56320|g&1023))}}else e+=String.fromCharCode(g)}return e}function z(a,b){return a?ua(A,a,b):""} +function va(a,b,d,e){if(!(0=k){var m=a.charCodeAt(++h);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;1114111>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-g}function wa(a,b,d){assert("number"==typeof d,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");va(a,A,b,d)}function xa(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b} +var ya="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function za(a,b){assert(0==a%2,"Pointer passed to UTF16ToString must be aligned to two bytes!");var d=a>>1;for(var e=d+b/2;!(d>=e)&&Aa[d];)++d;d<<=1;if(32=b/2);++e){var g=B[a+2*e>>1];if(0==g)break;d+=String.fromCharCode(g)}return d} +function Ba(a,b,d){assert(0==b%2,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert("number"==typeof d,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var e=b;d=d<2*a.length?d/2:a.length;for(var g=0;g>1]=a.charCodeAt(g),b+=2;B[b>>1]=0;return b-e}function Ca(a){return 2*a.length} +function Da(a,b){assert(0==a%4,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var d=0,e="";!(d>=b/4);){var g=D[a+4*d>>2];if(0==g)break;++d;65536<=g?(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|g&1023)):e+=String.fromCharCode(g)}return e} +function Ea(a,b,d){assert(0==b%4,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert("number"==typeof d,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(4>d)return 0;var e=b;d=e+d-4;for(var g=0;g=h){var k=a.charCodeAt(++g);h=65536+((h&1023)<<10)|k&1023}D[b>>2]=h;b+=4;if(b+4>d)break}D[b>>2]=0;return b-e} +function Fa(a){for(var b=0,d=0;d=e&&++d;b+=4}return b}function Ga(a){var b=xa(a)+1,d=Ha(b);d&&va(a,F,d,b);return d}function Ia(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");F.set(a,b)}var Ja,F,A,B,Aa,D,G,Ka,La; +function Ma(){var a=ra.buffer;Ja=a;c.HEAP8=F=new Int8Array(a);c.HEAP16=B=new Int16Array(a);c.HEAP32=D=new Int32Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=Aa=new Uint16Array(a);c.HEAPU32=G=new Uint32Array(a);c.HEAPF32=Ka=new Float32Array(a);c.HEAPF64=La=new Float64Array(a)}c.TOTAL_STACK&&assert(5242880===c.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Na=c.INITIAL_MEMORY||16777216; +Object.getOwnPropertyDescriptor(c,"INITIAL_MEMORY")||Object.defineProperty(c,"INITIAL_MEMORY",{configurable:!0,get:function(){t("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});assert(5242880<=Na,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Na+"! (TOTAL_STACK=5242880)"); +assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");assert(!c.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(16777216==Na,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var Oa; +function Pa(){var a=Qa();assert(0==(a&3));D[a+4>>2]=34821223;D[a+8>>2]=2310721022;D[0]=1668509029}function Ra(){if(!sa){var a=Qa(),b=G[a+4>>2];a=G[a+8>>2];34821223==b&&2310721022==a||t("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+a.toString(16)+" 0x"+b.toString(16));1668509029!==D[0]&&t("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var Sa=new Int16Array(1),Ta=new Int8Array(Sa.buffer); +Sa[0]=25459;if(115!==Ta[0]||99!==Ta[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";var Ua=[],Va=[],Wa=[],Xa=!1;function Ya(){var a=c.preRun.shift();Ua.unshift(a)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); +assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Za=0,$a=null,ab=null,bb={}; +function cb(){Za++;c.monitorRunDependencies&&c.monitorRunDependencies(Za);assert(!bb["wasm-instantiate"]);bb["wasm-instantiate"]=1;null===$a&&"undefined"!==typeof setInterval&&($a=setInterval(function(){if(sa)clearInterval($a),$a=null;else{var a=!1,b;for(b in bb)a||(a=!0,q("still waiting on run dependencies:")),q("dependency: "+b);a&&q("(end of list)")}},1E4))}c.preloadedImages={};c.preloadedAudios={}; +function t(a){if(c.onAbort)c.onAbort(a);a="Aborted("+a+")";q(a);sa=!0;throw new WebAssembly.RuntimeError(a);}function db(){return H.startsWith("data:application/octet-stream;base64,")} +function I(a){return function(){var b=c.asm;assert(Xa,"native function `"+a+"` called before runtime initialization");assert(!0,"native function `"+a+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var H;H="libDynamsoftBarcodeReader.wasm";if(!db()){var eb=H;H=c.locateFile?c.locateFile(eb,f):f+eb} +function fb(){var a=H;try{if(a==H&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){t(b)}} +function gb(){if(!qa&&(da||ea)){if("function"===typeof fetch&&!H.startsWith("file://"))return fetch(H,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+H+"'";return a.arrayBuffer()}).catch(function(){return fb()});if(ja)return new Promise(function(a,b){ja(H,function(d){a(new Uint8Array(d))},b)})}return Promise.resolve().then(function(){return fb()})}var J,K; +function hb(a){for(;0=kb.length&&(kb.length=a+1),kb[a]=b=Oa.get(a));assert(Oa.get(a)==b,"JavaScript-side Wasm function table mirror is out of date!");return b}var lb; +function mb(){function a(k){return(k=k.toTimeString().match(/\(([A-Za-z ]+)\)$/))?k[1]:"GMT"}var b=(new Date).getFullYear(),d=new Date(b,0,1),e=new Date(b,6,1);b=d.getTimezoneOffset();var g=e.getTimezoneOffset(),h=Math.max(b,g);D[nb()>>2]=60*h;D[ob()>>2]=Number(b!=g);d=a(d);e=a(e);d=Ga(d);e=Ga(e);g>2]=d,D[pb()+4>>2]=e):(D[pb()>>2]=e,D[pb()+4>>2]=d)}var qb; +function rb(a,b){for(var d=0,e=a.length-1;0<=e;e--){var g=a[e];"."===g?a.splice(e,1):".."===g?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(b)for(;d;d--)a.unshift("..");return a}function sb(a){var b="/"===a.charAt(0),d="/"===a.substr(-1);(a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/"))||b||(a=".");a&&d&&(a+="/");return(b?"/":"")+a} +function tb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function ub(a){if("/"===a)return"/";a=sb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)} +function vb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(fa)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(d){}return function(){t("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}} +function wb(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."}var xb=[];function yb(a,b){xb[a]={input:[],output:[],U:b};zb(a,Ab)} +var Ab={open:function(a){var b=xb[a.node.rdev];if(!b)throw new L(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.U.flush(a.tty)},flush:function(a){a.tty.U.flush(a.tty)},read:function(a,b,d,e){if(!a.tty||!a.tty.U.qa)throw new L(60);for(var g=0,h=0;h=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.i,a.i=new Uint8Array(b), +0=a.node.s)return 0;a=Math.min(a.node.s-g,e);assert(0<=a);if(8b)throw new L(28);return b},la:function(a,b,d){M.oa(a.node,b+d);a.node.s=Math.max(a.node.s,b+d)},ra:function(a,b,d,e,g,h){if(0!==b)throw new L(28);if(32768!==(a.node.mode&61440))throw new L(43);a=a.node.i;if(h&2||a.buffer!==Ja){if(0>>0)%Ob.length}function Tb(a){var b=Sb(a.parent.id,a.name);if(Ob[b]===a)Ob[b]=a.T;else for(b=Ob[b];b;){if(b.T===a){b.T=a.T;break}b=b.T}} +function Hb(a,b){var d;if(d=(d=Ub(a,"x"))?d:a.h.lookup?0:2)throw new L(d,a);for(d=Ob[Sb(a.id,b)];d;d=d.T){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return a.h.lookup(a,b)}function Fb(a,b,d,e){assert("object"===typeof a);a=new Vb(a,b,d,e);b=Sb(a.parent.id,a.name);a.T=Ob[b];return Ob[b]=a}function N(a){return 16384===(a&61440)}var Wb={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Xb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b} +function Ub(a,b){if(Pb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Yb(a,b){try{return Hb(a,b),20}catch(d){}return Ub(a,"wx")}function Zb(a,b,d){try{var e=Hb(a,b)}catch(g){return g.u}if(a=Ub(a,"wx"))return a;if(d){if(!N(e.mode))return 54;if(e===e.parent||"/"===Rb(e))return 10}else if(N(e.mode))return 31;return 0}function $b(a){var b=4096;for(a=a||0;a<=b;a++)if(!Mb[a])return a;throw new L(33);} +function ac(a,b){bc||(bc=function(){},bc.prototype={});var d=new bc,e;for(e in a)d[e]=a[e];a=d;b=$b(b);a.fd=b;return Mb[b]=a}var Eb={open:function(a){a.l=Lb[a.node.rdev].l;a.l.open&&a.l.open(a)},N:function(){throw new L(70);}};function zb(a,b){Lb[a]={l:b}} +function cc(a,b){if("string"===typeof a)throw a;var d="/"===b,e=!b;if(d&&Kb)throw new L(10);if(!d&&!e){var g=O(b,{pa:!1});b=g.path;g=g.node;if(g.S)throw new L(10);if(!N(g.mode))throw new L(54);}b={type:a,Ua:{},sa:b,Da:[]};a=a.I(b);a.I=b;b.root=a;d?Kb=a:g&&(g.S=b,g.I&&g.I.Da.push(b))}function dc(a,b,d){var e=O(a,{parent:!0}).node;a=ub(a);if(!a||"."===a||".."===a)throw new L(28);var g=Yb(e,a);if(g)throw new L(g);if(!e.h.aa)throw new L(63);return e.h.aa(e,a,b,d)} +function P(a,b){return dc(a,(void 0!==b?b:511)&1023|16384,0)}function ec(a,b,d){"undefined"===typeof d&&(d=b,b=438);dc(a,b|8192,d)}function fc(a,b){if(!wb(a))throw new L(44);var d=O(b,{parent:!0}).node;if(!d)throw new L(44);b=ub(b);var e=Yb(d,b);if(e)throw new L(e);if(!d.h.symlink)throw new L(63);d.h.symlink(d,b,a)}function Qb(a){a=O(a).node;if(!a)throw new L(44);if(!a.h.readlink)throw new L(28);return wb(Rb(a.parent),a.h.readlink(a))} +function gc(a,b,d,e){if(""===a)throw new L(44);if("string"===typeof b){var g=Wb[b];if("undefined"===typeof g)throw Error("Unknown file open mode: "+b);b=g}d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var h=a;else{a=sb(a);try{h=O(a,{ga:!(b&131072)}).node}catch(k){}}g=!1;if(b&64)if(h){if(b&128)throw new L(20);}else h=dc(a,d,0),g=!0;if(!h)throw new L(44);8192===(h.mode&61440)&&(b&=-513);if(b&65536&&!N(h.mode))throw new L(54);if(!g&&(d=h?40960===(h.mode&61440)?32:N(h.mode)&& +("r"!==Xb(b)||b&512)?31:Ub(h,Xb(b)):44))throw new L(d);if(b&512){d=h;d="string"===typeof d?O(d,{ga:!0}).node:d;if(!d.h.G)throw new L(63);if(N(d.mode))throw new L(31);if(32768!==(d.mode&61440))throw new L(28);if(g=Ub(d,"w"))throw new L(g);d.h.G(d,{size:0,timestamp:Date.now()})}b&=-131713;e=ac({node:h,path:Rb(h),id:h.id,flags:b,mode:h.mode,seekable:!0,position:0,l:h.l,h:h.h,Pa:[],error:!1},e);e.l.open&&e.l.open(e);!c.logReadFiles||b&1||(hc||(hc={}),a in hc||(hc[a]=1));return e} +function ic(a,b,d){if(null===a.fd)throw new L(8);if(!a.seekable||!a.l.N)throw new L(70);if(0!=d&&1!=d&&2!=d)throw new L(28);a.position=a.l.N(a,b,d);a.Pa=[];return a.position} +function jc(){L||(L=function(a,b){this.node=b;this.Ja=function(d){this.u=d;for(var e in Jb)if(Jb[e]===d){this.code=e;break}};this.Ja(a);this.message=Ib[a];this.stack&&(Object.defineProperty(this,"stack",{value:Error().stack,writable:!0}),this.stack=jb(this.stack))},L.prototype=Error(),L.prototype.constructor=L,[44].forEach(function(a){Gb[a]=new L(a);Gb[a].stack=""}))}var kc;function lc(a,b){var d=0;a&&(d|=365);b&&(d|=146);return d} +function mc(a,b,d){a=sb("/dev/"+a);var e=lc(!!b,!!d);nc||(nc=64);var g=nc++<<8|0;zb(g,{open:function(h){h.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(h,k,m,r){for(var n=0,p=0;p>2]}function qc(a){a=Mb[a];if(!a)throw new L(8);return a}function rc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var sc=void 0;function S(a){for(var b="";A[a];)b+=sc[A[a++]];return b}var tc={},uc={},vc={}; +function wc(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function xc(a,b){a=wc(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} +function yc(a){var b=Error,d=xc(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var zc=void 0;function T(a){throw new zc(a);}var Ac=void 0;function Bc(a){throw new Ac(a);} +function U(a,b,d){function e(m){m=d(m);m.length!==a.length&&Bc("Mismatched type converter count");for(var r=0;r>2])}function Wc(a,b,d){if(b===d)return a;if(void 0===d.D)return null;a=Wc(a,b,d.D);return null===a?null:d.ya(a)}var Xc={}; +function Zc(a,b){for(void 0===b&&T("ptr should not be undefined");a.D;)b=a.Y(b),a=a.D;return Xc[b]}function $c(a,b){b.o&&b.m||Bc("makeClassHandle requires ptr and ptrType");!!b.C!==!!b.B&&Bc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Gc(Object.create(a,{g:{value:b}}))}function W(a,b,d,e){this.name=a;this.j=b;this.ha=d;this.Z=e;this.$=!1;this.O=this.Ha=this.Ga=this.ua=this.Ka=this.Ea=void 0;void 0!==b.D?this.toWireType=Sc:(this.toWireType=e?Qc:Uc,this.H=null)} +function ad(a,b){c.hasOwnProperty(a)||Bc("Replacing nonexistant public symbol");c[a]=b;c[a].P=void 0} +function bd(a,b){assert(a.includes("j"),"getDynCaller should only be called with i64 sigs");var d=[];return function(){d.length=arguments.length;for(var e=0;eh&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==d,m=!1;for(d=1;d>2)+e]);return d} +function md(a,b,d){a instanceof Object||T(d+' with invalid "this": '+a);a instanceof b.j.constructor||T(d+' incompatible with "this" of type '+a.constructor.name);a.g.m||T("cannot call emscripten binding method "+d+" on deleted object");return Pc(a.g.m,a.g.o.j,b.j)}var nd=[],Y=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function od(a){4>2])};case 3:return function(d){return this.fromWireType(La[d>>3])};default:throw new TypeError("Unknown float type: "+a);}} +function qd(a,b,d){switch(b){case 0:return d?function(e){return F[e]}:function(e){return A[e]};case 1:return d?function(e){return B[e>>1]}:function(e){return Aa[e>>1]};case 2:return d?function(e){return D[e>>2]}:function(e){return G[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function rd(){void 0===rd.start&&(rd.start=Date.now());return 1E3*(Date.now()-rd.start)|0}var sd;sd=fa?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()}; +function td(a,b){assert(b===(b|0));return(a>>>0)+4294967296*b}function ud(a,b){if(0>=a)return a;var d=32>=b?Math.abs(1<=d&&(32>=b||a>d)&&(a=-2*d+a);return a}function vd(a,b){return 0<=a?a:32>=b?2*Math.abs(1<>3]),e+=8):"i64"==E?(E=[D[e>>2],D[e+4>>2]],e+=8):(assert(0===(e&3)),E=D[e>>2],e+=4);return E}assert(0===(b&3));for(var e=b,g=[],h,k;;){var m=a;h=F[a>>0];if(0===h)break;k=F[a+1>>0];if(37==h){var r=!1,n=b=!1,p=!1,x=!1;a:for(;;){switch(k){case 43:r=!0;break;case 45:b=!0;break;case 35:n=!0;break;case 48:if(p)break a;else{p=!0;break}case 32:x=!0;break;default:break a}a++; +k=F[a+1>>0]}var y=0;if(42==k)y=d("i32"),a++,k=F[a+1>>0];else for(;48<=k&&57>=k;)y=10*y+(k-48),a++,k=F[a+1>>0];var l=!1,u=-1;if(46==k){u=0;l=!0;a++;k=F[a+1>>0];if(42==k)u=d("i32"),a++;else for(;;){k=F[a+1>>0];if(48>k||57>0]}0>u&&(u=6,l=!1);switch(String.fromCharCode(k)){case "h":k=F[a+2>>0];if(104==k){a++;var w=1}else w=2;break;case "l":k=F[a+2>>0];108==k?(a++,w=8):w=4;break;case "L":case "q":case "j":w=8;break;case "z":case "t":case "I":w=4;break;default:w=null}w&& +a++;k=F[a+1>>0];switch(String.fromCharCode(k)){case "d":case "i":case "u":case "o":case "x":case "X":case "p":m=100==k||105==k;w=w||4;h=d("i"+8*w);8==w&&(h=117==k?(h[0]>>>0)+4294967296*(h[1]>>>0):td(h[0],h[1]));4>=w&&(h=(m?ud:vd)(h&Math.pow(256,w)-1,8*w));var C=Math.abs(h);m="";if(100==k||105==k)var v=ud(h,8*w,1).toString(10);else if(117==k)v=vd(h,8*w,1).toString(10),h=Math.abs(h);else if(111==k)v=(n?"0":"")+C.toString(8);else if(120==k||88==k){m=n&&0!=h?"0x":"";if(0>h){h=-h;v=(C-1).toString(16); +C=[];for(n=0;nw&&-4<=w?(k=(103==k?"f":"F").charCodeAt(0),u-=w+1):(k=(103==k?"e":"E").charCodeAt(0),u--),w=Math.min(u,20);if(101==k||69==k)v=h.toExponential(w),/[eE][-+]\d$/.test(v)&&(v=v.slice(0,-1)+"0"+v.slice(-1));else if(102==k||70==k)v=h.toFixed(w),0===h&&(0>h||0===h&&-Infinity===1/h)&&(v="-"+v);m=v.split("e");if(l&&!n)for(;1w++;)m[0]+="0";v=m[0]+(1h?"-":"")+"inf",p=!1;for(;v.lengthk&&(v=v.toUpperCase());v.split("").forEach(function(E){g.push(E.charCodeAt(0))});break;case "s":p=(r=d("i8*"))?xd(r):6;l&&(p=Math.min(p,u));if(!b)for(;p>0]);else g=g.concat(Bb("(null)".substr(0,p),!0));if(b)for(;p>2]=g.length;break;case "%":g.push(h);break;default:for(n=m;n>0])}a+=2}else g.push(h),a+=1}return g} +function yd(a){if(!a||!a.callee||!a.callee.name)return[null,"",""];var b=a.callee.name,d="(",e=!0,g;for(g in a){var h=a[g];e||(d+=", ");e=!1;d="number"===typeof h||"string"===typeof h?d+h:d+("("+typeof h+")")}d+=")";a=(a=a.callee.caller)?a.arguments:[];e&&(d="");return[a,b,d]} +function zd(a){a:{var b=Error();if(!b.stack){try{throw Error();}catch(u){b=u}if(!b.stack){b="(no stack trace available)";break a}}b=b.stack.toString()}b=b.slice(b.indexOf("\n",Math.max(b.lastIndexOf("_emscripten_log"),b.lastIndexOf("_emscripten_get_callstack")))+1);a&32&&oa("EM_LOG_DEMANGLE is deprecated; ignoring");a&8&&"undefined"===typeof emscripten_source_map&&(oa('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'), +a=a^8|16);var d=null;if(a&128)for(d=yd(arguments);d[1].includes("_emscripten_");)d=yd(d[0]);var e=b.split("\n");b="";var g=RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),h=RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),k=RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)"),m;for(m in e){var r=e[m],n;if((n=k.exec(r))&&5==n.length){r=n[1];var p=n[2];var x=n[3];n=n[4]}else if((n=g.exec(r))||(n=h.exec(r)),n&&4<=n.length)r=n[1],p=n[2],x=n[3],n=n[4]|0;else{b+=r+"\n";continue}var y=!1;if(a&8){var l=emscripten_source_map.Va({line:x, +wa:n});if(y=l&&l.source)a&64&&(l.source=l.source.substring(l.source.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=" at "+r+" ("+l.source+":"+l.line+":"+l.wa+")\n"}if(a&16||!y)a&64&&(p=p.substring(p.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=(y?" = "+r:" at "+r)+" ("+p+":"+x+":"+n+")\n";a&128&&d[0]&&(d[1]==r&&0v?-1:0=k(w,l)?0>=k(u,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var n=D[e+40>>2];e={Na:D[e>>2],Ma:D[e+4>>2],ba:D[e+8>>2],X:D[e+12>>2],V:D[e+16>>2],A:D[e+20>>2],da:D[e+24>>2],ea:D[e+28>>2],Wa:D[e+32>>2],La:D[e+36>> +2],Oa:n?z(n):""};d=z(d);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in n)d=d.replace(new RegExp(p,"g"),n[p]);var x="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), +y="January February March April May June July August September October November December".split(" ");n={"%a":function(l){return x[l.da].substring(0,3)},"%A":function(l){return x[l.da]},"%b":function(l){return y[l.V].substring(0,3)},"%B":function(l){return y[l.V]},"%C":function(l){return h((l.A+1900)/100|0,2)},"%d":function(l){return h(l.X,2)},"%e":function(l){return g(l.X,2," ")},"%g":function(l){return r(l).toString().substring(2)},"%G":function(l){return r(l)},"%H":function(l){return h(l.ba,2)}, +"%I":function(l){l=l.ba;0==l?l=12:12l.ba?"AM":"PM"},"%S":function(l){return h(l.Na,2)},"%t":function(){return"\t"},"%u":function(l){return l.da||7},"%U":function(l){var u=new Date(l.A+1900,0,1),w=0===u.getDay()?u:Jd(u,7-u.getDay());l=new Date(l.A+1900,l.V,l.X);return 0>k(w,l)? +h(Math.ceil((31-w.getDate()+(Gd(Fd(l.getFullYear())?Hd:Id,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(w,u)?"01":"00"},"%V":function(l){var u=new Date(l.A+1901,0,4),w=m(new Date(l.A+1900,0,4));u=m(u);var C=Jd(new Date(l.A+1900,0,1),l.ea);return 0>k(C,w)?"53":0>=k(u,C)?"01":h(Math.ceil((w.getFullYear()k(w,l)?h(Math.ceil((31-w.getDate()+(Gd(Fd(l.getFullYear())?Hd:Id,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(w,u)?"01":"00"},"%y":function(l){return(l.A+1900).toString().substring(2)},"%Y":function(l){return l.A+1900},"%z":function(l){l=l.La;var u=0<=l;l=Math.abs(l)/60;return(u?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Oa},"%%":function(){return"%"}};for(p in n)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),n[p](e)));p=Bb(d,!1);if(p.length> +b)return 0;Ia(p,a);return p.length-1}function Vb(a,b,d,e){a||(a=this);this.parent=a;this.I=a.I;this.S=null;this.id=Nb++;this.name=b;this.mode=d;this.h={};this.l={};this.rdev=e}Object.defineProperties(Vb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});jc();Ob=Array(4096);cc(M,"/");P("/tmp");P("/home");P("/home/web_user"); +(function(){P("/dev");zb(259,{read:function(){return 0},write:function(b,d,e,g){return g}});ec("/dev/null",259);yb(1280,Cb);yb(1536,Db);ec("/dev/tty",1280);ec("/dev/tty1",1536);var a=vb();mc("random",a);mc("urandom",a);P("/dev/shm");P("/dev/shm/tmp")})(); +(function(){P("/proc");var a=P("/proc/self");P("/proc/self/fd");cc({I:function(){var b=Fb(a,"fd",16895,73);b.h={lookup:function(d,e){var g=Mb[+e];if(!g)throw new L(8);d={parent:null,I:{sa:"fake"},h:{readlink:function(){return g.path}}};return d.parent=d}};return b}},"/proc/self/fd")})(); +Jb={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115, +ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14, +EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};for(var Ld=Array(256),Md=0;256>Md;++Md)Ld[Md]=String.fromCharCode(Md);sc=Ld;zc=c.BindingError=yc("BindingError"); +Ac=c.InternalError=yc("InternalError");Kc.prototype.isAliasOf=function(a){if(!(this instanceof Kc&&a instanceof Kc))return!1;var b=this.g.o.j,d=this.g.m,e=a.g.o.j;for(a=a.g.m;b.D;)d=b.Y(d),b=b.D;for(;e.D;)a=e.Y(a),e=e.D;return b===e&&d===a}; +Kc.prototype.clone=function(){this.g.m||Cc(this);if(this.g.W)return this.g.count.value+=1,this;var a=Gc,b=Object,d=b.create,e=Object.getPrototypeOf(this),g=this.g;a=a(d.call(b,e,{g:{value:{count:g.count,R:g.R,W:g.W,m:g.m,o:g.o,B:g.B,C:g.C}}}));a.g.count.value+=1;a.g.R=!1;return a};Kc.prototype["delete"]=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ec(this);Fc(this.g);this.g.W||(this.g.B=void 0,this.g.m=void 0)};Kc.prototype.isDeleted=function(){return!this.g.m}; +Kc.prototype.deleteLater=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ic.push(this);1===Ic.length&&Hc&&Hc(Jc);this.g.R=!0;return this};W.prototype.Aa=function(a){this.ua&&(a=this.ua(a));return a};W.prototype.na=function(a){this.O&&this.O(a)};W.prototype.argPackAdvance=8;W.prototype.readValueFromPointer=Vc;W.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; +W.prototype.fromWireType=function(a){function b(){return this.$?$c(this.j.K,{o:this.Ea,m:d,C:this,B:a}):$c(this.j.K,{o:this,m:a})}var d=this.Aa(a);if(!d)return this.na(a),null;var e=Zc(this.j,d);if(void 0!==e){if(0===e.g.count.value)return e.g.m=d,e.g.B=a,e.clone();e=e.clone();this.na(a);return e}e=this.j.za(d);e=Lc[e];if(!e)return b.call(this);e=this.Z?e.xa:e.pointerType;var g=Wc(d,this.j,e.j);return null===g?b.call(this):this.$?$c(e.j.K,{o:e,m:g,C:this,B:a}):$c(e.j.K,{o:e,m:g})}; +c.getInheritedInstanceCount=function(){return Object.keys(Xc).length};c.getLiveInheritedInstances=function(){var a=[],b;for(b in Xc)Xc.hasOwnProperty(b)&&a.push(Xc[b]);return a};c.flushPendingDeletes=Jc;c.setDelayFunction=function(a){Hc=a;Ic.length&&Hc&&Hc(Jc)};cd=c.UnboundTypeError=yc("UnboundTypeError");c.count_emval_handles=function(){for(var a=0,b=5;b>2]);D[b>>2]=a.getUTCSeconds();D[b+4>>2]=a.getUTCMinutes();D[b+8>>2]=a.getUTCHours();D[b+12>>2]=a.getUTCDate();D[b+16>>2]=a.getUTCMonth();D[b+20>>2]=a.getUTCFullYear()-1900;D[b+24>>2]=a.getUTCDay();D[b+36>>2]=0;D[b+32>>2]=0;D[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;lb||(lb=Ga("GMT"));D[b+40>>2]=lb;return b},__localtime_r:function(a,b){qb||(qb=!0,mb());a=new Date(1E3*D[a>>2]);D[b>>2]=a.getSeconds(); +D[b+4>>2]=a.getMinutes();D[b+8>>2]=a.getHours();D[b+12>>2]=a.getDate();D[b+16>>2]=a.getMonth();D[b+20>>2]=a.getFullYear()-1900;D[b+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);D[b+28>>2]=(a.getTime()-d.getTime())/864E5|0;D[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;D[b+32>>2]=a;a=D[pb()+(a?4:0)>>2];D[b+40>>2]=a;return b},__syscall_fcntl64:function(a,b,d){oc=d;try{var e= +qc(a);switch(b){case 0:var g=pc();return 0>g?-28:gc(e.path,e.flags,0,g).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return g=pc(),e.flags|=g,0;case 5:return g=pc(),B[g+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return D[Nd()>>2]=28,-1;default:return-28}}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_getdents64:function(a,b,d){try{var e=qc(a);if(!e.M){var g=O(e.path,{ga:!0}).node;if(!g.h.readdir)throw new L(54);var h=g.h.readdir(g); +e.M=h}a=0;for(var k=ic(e,0,1),m=Math.floor(k/280);m>>0,(J=n,1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];D[b+a>>2]=K[0];D[b+a+4>>2]=K[1];K=[280*(m+1)>>>0,(J=280*(m+1),1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];D[b+a+8>>2]=K[0];D[b+a+12>>2]=K[1];B[b+a+16>>1]=280;F[b+a+18>>0]=p;wa(r,b+a+19,256);a+=280;m+=1}ic(e,280*m,0);return a}catch(y){if("undefined"===typeof R||!(y instanceof L))throw y;return-y.u}},__syscall_ioctl:function(a,b,d){oc=d;try{var e=qc(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var g=pc(); +return D[g>>2]=0;case 21520:return e.tty?-28:-59;case 21531:a=g=pc();if(!e.l.Ca)throw new L(59);return e.l.Ca(e,b,a);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:t("bad ioctl syscall "+b)}}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_mkdir:function(a,b){try{return a=z(a),a=sb(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),P(a,b),0}catch(d){if("undefined"===typeof R||!(d instanceof L))throw d;return-d.u}},__syscall_open:function(a, +b,d){oc=d;try{var e=z(a),g=d?pc():0;return gc(e,b,g).fd}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_readlink:function(a,b,d){try{a=z(a);if(0>=d)var e=-28;else{var g=Qb(a),h=Math.min(d,xa(g)),k=F[b+h];wa(g,b,d+1);F[b+h]=k;e=h}return e}catch(m){if("undefined"===typeof R||!(m instanceof L))throw m;return-m.u}},__syscall_rmdir:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=ub(a),e=Hb(b,d),g=Zb(b,d,!0);if(g)throw new L(g);if(!b.h.rmdir)throw new L(63);if(e.S)throw new L(10); +b.h.rmdir(b,d);Tb(e);return 0}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_unlink:function(a){try{a=z(a);var b=O(a,{parent:!0}).node;if(!b)throw new L(44);var d=ub(a),e=Hb(b,d),g=Zb(b,d,!1);if(g)throw new L(g);if(!b.h.unlink)throw new L(63);if(e.S)throw new L(10);b.h.unlink(b,d);Tb(e);return 0}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},_embind_register_bigint:function(){},_embind_register_bool:function(a,b,d,e,g){var h=rc(d); +b=S(b);V(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,m){return m?e:g},argPackAdvance:8,readValueFromPointer:function(k){if(1===d)var m=F;else if(2===d)m=B;else if(4===d)m=D;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(m[k>>h])},H:null})},_embind_register_class:function(a,b,d,e,g,h,k,m,r,n,p,x,y){p=S(p);h=X(g,h);m&&(m=X(k,m));n&&(n=X(r,n));y=X(x,y);var l=wc(p);Nc(l,function(){gd("Cannot construct "+p+" due to unbound types",[e])});U([a, +b,d],e?[e]:[],function(u){u=u[0];if(e){var w=u.j;var C=w.K}else C=Kc.prototype;u=xc(l,function(){if(Object.getPrototypeOf(this)!==v)throw new zc("Use 'new' to construct "+p);if(void 0===E.L)throw new zc(p+" has no accessible constructor");var Yc=E.L[arguments.length];if(void 0===Yc)throw new zc("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(E.L).toString()+") parameters instead!");return Yc.apply(this,arguments)});var v=Object.create(C, +{constructor:{value:u}});u.prototype=v;var E=new Oc(p,u,v,y,w,h,m,n);w=new W(p,E,!0,!1);C=new W(p+"*",E,!1,!1);var Q=new W(p+" const*",E,!1,!0);Lc[a]={pointerType:C,xa:Q};ad(l,u);return[w,C,Q]})},_embind_register_class_class_function:function(a,b,d,e,g,h,k){var m=ld(d,e);b=S(b);h=X(g,h);U([],[a],function(r){function n(){gd("Cannot call "+p+" due to unbound types",m)}r=r[0];var p=r.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var x=r.j.constructor;void 0===x[b]?(n.P=d-1,x[b]=n):(Mc(x, +b,p),x[b].v[d-1]=n);U([],m,function(y){y=[y[0],null].concat(y.slice(1));y=kd(p,y,null,h,k);void 0===x[b].v?(y.P=d-1,x[b]=y):x[b].v[d-1]=y;return[]});return[]})},_embind_register_class_constructor:function(a,b,d,e,g,h){assert(0g)throw new TypeError('Passing a number "'+Rc(n)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+g+"]!");}function k(n){return n}b=S(b);-1===g&&(g=4294967295);var m=rc(d);if(0===e){var r=32-8*d;k=function(n){return n<>>r}}d=b.includes("unsigned")?function(n,p){h(p,this.name);return p>>>0}:function(n,p){h(p,this.name);return p};V(a,{name:b,fromWireType:k,toWireType:d,argPackAdvance:8,readValueFromPointer:qd(b,m, +0!==e),H:null})},_embind_register_memory_view:function(a,b,d){function e(h){h>>=2;var k=G;return new g(Ja,k[h+1],k[h])}var g=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];d=S(d);V(a,{name:d,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Ba:!0})},_embind_register_std_string:function(a,b){b=S(b);var d="std::string"===b;V(a,{name:b,fromWireType:function(e){var g=G[e>>2];if(d)for(var h=e+4,k=0;k<=g;++k){var m=e+4+k;if(k==g||0==A[m]){h=z(h, +m-h);if(void 0===r)var r=h;else r+=String.fromCharCode(0),r+=h;h=m+1}}else{r=Array(g);for(k=0;k>2]=k;if(d&&h)wa(g,m+4,k+ +1);else if(h)for(h=0;h> +2],p=k(),x,y=r+4,l=0;l<=n;++l){var u=r+4+l*b;if(l==n||0==p[u>>m])y=e(y,u-y),void 0===x?x=y:(x+=String.fromCharCode(0),x+=y),y=u+b}fd(r);return x},toWireType:function(r,n){"string"!==typeof n&&T("Cannot pass non-string to C++ string type "+d);var p=h(n),x=Ha(4+p+b);G[x>>2]=p>>m;g(n,x+4,p+b);null!==r&&r.push(fd,x);return x},argPackAdvance:8,readValueFromPointer:Vc,H:function(r){fd(r)}})},_embind_register_void:function(a,b){b=S(b);V(a,{Ta:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})}, +_emval_decref:od,_emval_incref:function(a){4>2]=28,-1;D[b>>2]=a/1E3|0;D[b+4>>2]=a%1E3*1E6|0;return 0},emscripten_log:function(a,b,d){b=wd(b,d);b=ua(b,0);a&24&&(b=b.replace(/\s+$/,""), +b+=(0>>=0;assert(a>b);if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a,e);0>>16);Ma();var h=1;break a}catch(k){q("emscripten_realloc_buffer: Attempted to grow heap from "+Ja.byteLength+" bytes to "+g+" bytes, but got error: "+k)}h=void 0}if(h)return!0}q("Failed to grow the heap from "+b+" bytes to "+e+" bytes, not enough memory!");return!1},emscripten_run_script:function(a){eval(z(a))},emscripten_run_script_int:function(a){return eval(z(a))|0},emscripten_run_script_string:Z,environ_get:function(a,b){var d=0;Dd().forEach(function(e, +g){var h=b+d;g=D[a+4*g>>2]=h;for(h=0;h>0]=e.charCodeAt(h);F[g>>0]=0;d+=e.length+1});return 0},environ_sizes_get:function(a,b){var d=Dd();D[a>>2]=d.length;var e=0;d.forEach(function(g){e+=g.length+1});D[b>>2]=e;return 0},fd_close:function(a){try{var b=qc(a);if(null===b.fd)throw new L(8);b.M&&(b.M=null);try{b.l.close&&b.l.close(b)}catch(d){throw d;}finally{Mb[b.fd]=null}b.fd=null;return 0}catch(d){if("undefined"===typeof R||!(d instanceof +L))throw d;return d.u}},fd_read:function(a,b,d,e){try{a:{for(var g=qc(a),h=a=0;h>2],m=g,r=D[b+8*h>>2],n=k,p=void 0,x=F;if(0>n||0>p)throw new L(28);if(null===m.fd)throw new L(8);if(1===(m.flags&2097155))throw new L(8);if(N(m.node.mode))throw new L(31);if(!m.l.read)throw new L(28);var y="undefined"!==typeof p;if(!y)p=m.position;else if(!m.seekable)throw new L(70);var l=m.l.read(m,x,r,n,p);y||(m.position+=l);var u=l;if(0>u){var w=-1;break a}a+=u;if(u>2]=w;return 0}catch(C){if("undefined"=== +typeof R||!(C instanceof L))throw C;return C.u}},fd_seek:function(a,b,d,e,g){try{var h=qc(a);a=4294967296*d+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;ic(h,a,e);K=[h.position>>>0,(J=h.position,1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];D[g>>2]=K[0];D[g+4>>2]=K[1];h.M&&0===a&&0===e&&(h.M=null);return 0}catch(k){if("undefined"===typeof R||!(k instanceof L))throw k;return k.u}},fd_write:function(a,b,d, +e){try{a:{for(var g=qc(a),h=a=0;h>2],r=D[b+(8*h+4)>>2],n=void 0,p=F;if(0>r||0>n)throw new L(28);if(null===k.fd)throw new L(8);if(0===(k.flags&2097155))throw new L(8);if(N(k.node.mode))throw new L(31);if(!k.l.write)throw new L(28);k.seekable&&k.flags&1024&&ic(k,0,2);var x="undefined"!==typeof n;if(!x)n=k.position;else if(!k.seekable)throw new L(70);var y=k.l.write(k,p,m,r,n,void 0);x||(k.position+=y);var l=y;if(0>l){var u=-1;break a}a+=l}u=a}D[e>>2]=u;return 0}catch(w){if("undefined"=== +typeof R||!(w instanceof L))throw w;return w.u}},mktime:function(a){qb||(qb=!0,mb());var b=new Date(D[a+20>>2]+1900,D[a+16>>2],D[a+12>>2],D[a+8>>2],D[a+4>>2],D[a>>2],0),d=D[a+32>>2],e=b.getTimezoneOffset(),g=new Date(b.getFullYear(),0,1),h=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=g.getTimezoneOffset(),m=Math.min(k,h);0>d?D[a+32>>2]=Number(h!=k&&m==e):0>2]=b.getDay();D[a+28>>2]=(b.getTime()-g.getTime())/864E5| +0;D[a>>2]=b.getSeconds();D[a+4>>2]=b.getMinutes();D[a+8>>2]=b.getHours();D[a+12>>2]=b.getDate();D[a+16>>2]=b.getMonth();return b.getTime()/1E3|0},setTempRet0:function(){},strftime:Kd,strftime_l:function(a,b,d,e){return Kd(a,b,d,e)},time:function(a){var b=Date.now()/1E3|0;a&&(D[a>>2]=b);return b}}; +(function(){function a(h){c.asm=h.exports;ra=c.asm.memory;assert(ra,"memory not found in wasm exports");Ma();Oa=c.asm.__indirect_function_table;assert(Oa,"table not found in wasm exports");Va.unshift(c.asm.__wasm_call_ctors);Za--;c.monitorRunDependencies&&c.monitorRunDependencies(Za);assert(bb["wasm-instantiate"]);delete bb["wasm-instantiate"];0==Za&&(null!==$a&&(clearInterval($a),$a=null),ab&&(h=ab,ab=null,h()))}function b(h){assert(c===g,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); +g=null;a(h.instance)}function d(h){return gb().then(function(k){return WebAssembly.instantiate(k,e)}).then(function(k){return k}).then(h,function(k){q("failed to asynchronously prepare wasm: "+k);H.startsWith("file://")&&q("warning: Loading from a file URI ("+H+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");t(k)})}var e={env:Od,wasi_snapshot_preview1:Od}; +cb();var g=c;if(c.instantiateWasm)try{return c.instantiateWasm(e,a)}catch(h){return q("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return qa||"function"!==typeof WebAssembly.instantiateStreaming||db()||H.startsWith("file://")||"function"!==typeof fetch?d(b):fetch(H,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,e).then(b,function(k){q("wasm streaming compile failed: "+k);q("falling back to ArrayBuffer instantiation");return d(b)})})})(); +return{}})();c.___wasm_call_ctors=I("__wasm_call_ctors");var xd=c._strlen=I("strlen"),Ha=c._malloc=I("malloc"),Nd=c.___errno_location=I("__errno_location"),fd=c._free=I("free"),ed=c.___getTypeName=I("__getTypeName");c.___embind_register_native_and_builtin_types=I("__embind_register_native_and_builtin_types");var pb=c.__get_tzname=I("_get_tzname"),ob=c.__get_daylight=I("_get_daylight"),nb=c.__get_timezone=I("_get_timezone");c._fflush=I("fflush");var Bd=c._emscripten_builtin_malloc=I("emscripten_builtin_malloc"); +c._emscripten_main_thread_process_queued_calls=I("emscripten_main_thread_process_queued_calls");c._setThrew=I("setThrew");c._saveSetjmp=I("saveSetjmp");var Pd=c._emscripten_stack_init=function(){return(Pd=c._emscripten_stack_init=c.asm.emscripten_stack_init).apply(null,arguments)};c._emscripten_stack_get_free=function(){return(c._emscripten_stack_get_free=c.asm.emscripten_stack_get_free).apply(null,arguments)}; +var Qa=c._emscripten_stack_get_end=function(){return(Qa=c._emscripten_stack_get_end=c.asm.emscripten_stack_get_end).apply(null,arguments)};c.stackSave=I("stackSave");c.stackRestore=I("stackRestore");c.stackAlloc=I("stackAlloc");var Ad=c._emscripten_builtin_free=I("emscripten_builtin_free");c.dynCall_jiji=I("dynCall_jiji");c.dynCall_viiiiiiji=I("dynCall_viiiiiiji");c.dynCall_viiijj=I("dynCall_viiijj");c.dynCall_viiiiiijjiii=I("dynCall_viiiiiijjiii");c.dynCall_iiiijjii=I("dynCall_iiiijjii"); +c.dynCall_viijii=I("dynCall_viijii");c.dynCall_iiiiij=I("dynCall_iiiiij");c.dynCall_iiiiijj=I("dynCall_iiiiijj");c.dynCall_iiiiiijj=I("dynCall_iiiiiijj");Object.getOwnPropertyDescriptor(c,"intArrayFromString")||(c.intArrayFromString=function(){t("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"intArrayToString")||(c.intArrayToString=function(){t("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ccall")||(c.ccall=function(){t("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"cwrap")||(c.cwrap=function(){t("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setValue")||(c.setValue=function(){t("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getValue")||(c.getValue=function(){t("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocate")||(c.allocate=function(){t("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF8ArrayToString")||(c.UTF8ArrayToString=function(){t("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"UTF8ToString")||(c.UTF8ToString=function(){t("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8Array")||(c.stringToUTF8Array=function(){t("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8")||(c.stringToUTF8=function(){t("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF8")||(c.lengthBytesUTF8=function(){t("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){t("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreRun")||(c.addOnPreRun=function(){t("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"addOnInit")||(c.addOnInit=function(){t("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreMain")||(c.addOnPreMain=function(){t("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnExit")||(c.addOnExit=function(){t("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"addOnPostRun")||(c.addOnPostRun=function(){t("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeStringToMemory")||(c.writeStringToMemory=function(){t("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeArrayToMemory")||(c.writeArrayToMemory=function(){t("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeAsciiToMemory")||(c.writeAsciiToMemory=function(){t("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addRunDependency")||(c.addRunDependency=function(){t("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"removeRunDependency")||(c.removeRunDependency=function(){t("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createFolder")||(c.FS_createFolder=function(){t("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"FS_createPath")||(c.FS_createPath=function(){t("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createDataFile")||(c.FS_createDataFile=function(){t("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"FS_createPreloadedFile")||(c.FS_createPreloadedFile=function(){t("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createLazyFile")||(c.FS_createLazyFile=function(){t("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"FS_createLink")||(c.FS_createLink=function(){t("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS_createDevice")||(c.FS_createDevice=function(){t("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_unlink")||(c.FS_unlink=function(){t("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"getLEB")||(c.getLEB=function(){t("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFunctionTables")||(c.getFunctionTables=function(){t("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"alignFunctionTables")||(c.alignFunctionTables=function(){t("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerFunctions")||(c.registerFunctions=function(){t("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addFunction")||(c.addFunction=function(){t("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"removeFunction")||(c.removeFunction=function(){t("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){t("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"prettyPrint")||(c.prettyPrint=function(){t("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){t("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getCompilerSetting")||(c.getCompilerSetting=function(){t("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"print")||(c.print=function(){t("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"printErr")||(c.printErr=function(){t("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getTempRet0")||(c.getTempRet0=function(){t("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setTempRet0")||(c.setTempRet0=function(){t("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callMain")||(c.callMain=function(){t("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"abort")||(c.abort=function(){t("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"keepRuntimeAlive")||(c.keepRuntimeAlive=function(){t("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"zeroMemory")||(c.zeroMemory=function(){t("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToNewUTF8")||(c.stringToNewUTF8=function(){t("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setFileTime")||(c.setFileTime=function(){t("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscripten_realloc_buffer")||(c.emscripten_realloc_buffer=function(){t("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ENV")||(c.ENV=function(){t("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"withStackSave")||(c.withStackSave=function(){t("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_CODES")||(c.ERRNO_CODES=function(){t("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ERRNO_MESSAGES")||(c.ERRNO_MESSAGES=function(){t("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setErrNo")||(c.setErrNo=function(){t("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton4")||(c.inetPton4=function(){t("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"inetNtop4")||(c.inetNtop4=function(){t("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton6")||(c.inetPton6=function(){t("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop6")||(c.inetNtop6=function(){t("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"readSockaddr")||(c.readSockaddr=function(){t("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeSockaddr")||(c.writeSockaddr=function(){t("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"DNS")||(c.DNS=function(){t("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getHostByName")||(c.getHostByName=function(){t("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GAI_ERRNO_MESSAGES")||(c.GAI_ERRNO_MESSAGES=function(){t("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Protocols")||(c.Protocols=function(){t("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"Sockets")||(c.Sockets=function(){t("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getRandomDevice")||(c.getRandomDevice=function(){t("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"traverseStack")||(c.traverseStack=function(){t("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"convertFrameToPC")||(c.convertFrameToPC=function(){t("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UNWIND_CACHE")||(c.UNWIND_CACHE=function(){t("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"saveInUnwindCache")||(c.saveInUnwindCache=function(){t("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"convertPCtoSourceLocation")||(c.convertPCtoSourceLocation=function(){t("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgsArray")||(c.readAsmConstArgsArray=function(){t("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgs")||(c.readAsmConstArgs=function(){t("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"mainThreadEM_ASM")||(c.mainThreadEM_ASM=function(){t("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_q")||(c.jstoi_q=function(){t("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_s")||(c.jstoi_s=function(){t("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getExecutableName")||(c.getExecutableName=function(){t("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"listenOnce")||(c.listenOnce=function(){t("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"autoResumeAudioContext")||(c.autoResumeAudioContext=function(){t("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"dynCallLegacy")||(c.dynCallLegacy=function(){t("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getDynCaller")||(c.getDynCaller=function(){t("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){t("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"callRuntimeCallbacks")||(c.callRuntimeCallbacks=function(){t("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"wasmTableMirror")||(c.wasmTableMirror=function(){t("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setWasmTableEntry")||(c.setWasmTableEntry=function(){t("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getWasmTableEntry")||(c.getWasmTableEntry=function(){t("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"handleException")||(c.handleException=function(){t("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePush")||(c.runtimeKeepalivePush=function(){t("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePop")||(c.runtimeKeepalivePop=function(){t("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callUserCallback")||(c.callUserCallback=function(){t("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeExit")||(c.maybeExit=function(){t("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"safeSetTimeout")||(c.safeSetTimeout=function(){t("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asmjsMangle")||(c.asmjsMangle=function(){t("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asyncLoad")||(c.asyncLoad=function(){t("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"alignMemory")||(c.alignMemory=function(){t("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"mmapAlloc")||(c.mmapAlloc=function(){t("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reallyNegative")||(c.reallyNegative=function(){t("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"unSign")||(c.unSign=function(){t("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reSign")||(c.reSign=function(){t("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"formatString")||(c.formatString=function(){t("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"PATH")||(c.PATH=function(){t("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH_FS")||(c.PATH_FS=function(){t("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SYSCALLS")||(c.SYSCALLS=function(){t("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"syscallMmap2")||(c.syscallMmap2=function(){t("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMunmap")||(c.syscallMunmap=function(){t("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getSocketFromFD")||(c.getSocketFromFD=function(){t("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getSocketAddress")||(c.getSocketAddress=function(){t("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"JSEvents")||(c.JSEvents=function(){t("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerKeyEventCallback")||(c.registerKeyEventCallback=function(){t("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"specialHTMLTargets")||(c.specialHTMLTargets=function(){t("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeCStringToJsString")||(c.maybeCStringToJsString=function(){t("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"findEventTarget")||(c.findEventTarget=function(){t("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"findCanvasEventTarget")||(c.findCanvasEventTarget=function(){t("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBoundingClientRect")||(c.getBoundingClientRect=function(){t("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillMouseEventData")||(c.fillMouseEventData=function(){t("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerMouseEventCallback")||(c.registerMouseEventCallback=function(){t("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerWheelEventCallback")||(c.registerWheelEventCallback=function(){t("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerUiEventCallback")||(c.registerUiEventCallback=function(){t("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerFocusEventCallback")||(c.registerFocusEventCallback=function(){t("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillDeviceOrientationEventData")||(c.fillDeviceOrientationEventData=function(){t("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceOrientationEventCallback")||(c.registerDeviceOrientationEventCallback=function(){t("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillDeviceMotionEventData")||(c.fillDeviceMotionEventData=function(){t("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceMotionEventCallback")||(c.registerDeviceMotionEventCallback=function(){t("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"screenOrientation")||(c.screenOrientation=function(){t("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillOrientationChangeEventData")||(c.fillOrientationChangeEventData=function(){t("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerOrientationChangeEventCallback")||(c.registerOrientationChangeEventCallback=function(){t("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillFullscreenChangeEventData")||(c.fillFullscreenChangeEventData=function(){t("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerFullscreenChangeEventCallback")||(c.registerFullscreenChangeEventCallback=function(){t("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerRestoreOldStyle")||(c.registerRestoreOldStyle=function(){t("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"hideEverythingExceptGivenElement")||(c.hideEverythingExceptGivenElement=function(){t("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreHiddenElements")||(c.restoreHiddenElements=function(){t("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setLetterbox")||(c.setLetterbox=function(){t("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"currentFullscreenStrategy")||(c.currentFullscreenStrategy=function(){t("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreOldWindowedStyle")||(c.restoreOldWindowedStyle=function(){t("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"softFullscreenResizeWebGLRenderTarget")||(c.softFullscreenResizeWebGLRenderTarget=function(){t("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"doRequestFullscreen")||(c.doRequestFullscreen=function(){t("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillPointerlockChangeEventData")||(c.fillPointerlockChangeEventData=function(){t("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerPointerlockChangeEventCallback")||(c.registerPointerlockChangeEventCallback=function(){t("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerPointerlockErrorEventCallback")||(c.registerPointerlockErrorEventCallback=function(){t("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requestPointerLock")||(c.requestPointerLock=function(){t("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillVisibilityChangeEventData")||(c.fillVisibilityChangeEventData=function(){t("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerVisibilityChangeEventCallback")||(c.registerVisibilityChangeEventCallback=function(){t("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerTouchEventCallback")||(c.registerTouchEventCallback=function(){t("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillGamepadEventData")||(c.fillGamepadEventData=function(){t("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerGamepadEventCallback")||(c.registerGamepadEventCallback=function(){t("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerBeforeUnloadEventCallback")||(c.registerBeforeUnloadEventCallback=function(){t("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillBatteryEventData")||(c.fillBatteryEventData=function(){t("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"battery")||(c.battery=function(){t("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerBatteryEventCallback")||(c.registerBatteryEventCallback=function(){t("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setCanvasElementSize")||(c.setCanvasElementSize=function(){t("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getCanvasElementSize")||(c.getCanvasElementSize=function(){t("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"demangle")||(c.demangle=function(){t("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangleAll")||(c.demangleAll=function(){t("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jsStackTrace")||(c.jsStackTrace=function(){t("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){t("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getEnvStrings")||(c.getEnvStrings=function(){t("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"checkWasiClock")||(c.checkWasiClock=function(){t("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeI53ToI64")||(c.writeI53ToI64=function(){t("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Clamped")||(c.writeI53ToI64Clamped=function(){t("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Signaling")||(c.writeI53ToI64Signaling=function(){t("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeI53ToU64Clamped")||(c.writeI53ToU64Clamped=function(){t("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Signaling")||(c.writeI53ToU64Signaling=function(){t("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readI53FromI64")||(c.readI53FromI64=function(){t("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"readI53FromU64")||(c.readI53FromU64=function(){t("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertI32PairToI53")||(c.convertI32PairToI53=function(){t("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertU32PairToI53")||(c.convertU32PairToI53=function(){t("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"setImmediateWrapped")||(c.setImmediateWrapped=function(){t("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"clearImmediateWrapped")||(c.clearImmediateWrapped=function(){t("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"polyfillSetImmediate")||(c.polyfillSetImmediate=function(){t("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"uncaughtExceptionCount")||(c.uncaughtExceptionCount=function(){t("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionLast")||(c.exceptionLast=function(){t("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionCaught")||(c.exceptionCaught=function(){t("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ExceptionInfo")||(c.ExceptionInfo=function(){t("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"CatchInfo")||(c.CatchInfo=function(){t("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exception_addRef")||(c.exception_addRef=function(){t("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"exception_decRef")||(c.exception_decRef=function(){t("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Browser")||(c.Browser=function(){t("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"funcWrappers")||(c.funcWrappers=function(){t("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){t("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setMainLoop")||(c.setMainLoop=function(){t("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"wget")||(c.wget=function(){t("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"FS")||(c.FS=function(){t("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"MEMFS")||(c.MEMFS=function(){t("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"TTY")||(c.TTY=function(){t("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PIPEFS")||(c.PIPEFS=function(){t("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"SOCKFS")||(c.SOCKFS=function(){t("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"_setNetworkCallback")||(c._setNetworkCallback=function(){t("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"tempFixedLengthArray")||(c.tempFixedLengthArray=function(){t("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"miniTempWebGLFloatBuffers")||(c.miniTempWebGLFloatBuffers=function(){t("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapObjectForWebGLType")||(c.heapObjectForWebGLType=function(){t("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapAccessShiftForWebGLHeap")||(c.heapAccessShiftForWebGLHeap=function(){t("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GL")||(c.GL=function(){t("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGet")||(c.emscriptenWebGLGet=function(){t("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"computeUnpackAlignedImageSize")||(c.computeUnpackAlignedImageSize=function(){t("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetTexPixelData")||(c.emscriptenWebGLGetTexPixelData=function(){t("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetUniform")||(c.emscriptenWebGLGetUniform=function(){t("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"webglGetUniformLocation")||(c.webglGetUniformLocation=function(){t("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglPrepareUniformLocationsBeforeFirstUse")||(c.webglPrepareUniformLocationsBeforeFirstUse=function(){t("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"webglGetLeftBracePos")||(c.webglGetLeftBracePos=function(){t("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetVertexAttrib")||(c.emscriptenWebGLGetVertexAttrib=function(){t("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeGLArray")||(c.writeGLArray=function(){t("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"AL")||(c.AL=function(){t("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_unicode")||(c.SDL_unicode=function(){t("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_ttfContext")||(c.SDL_ttfContext=function(){t("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"SDL_audio")||(c.SDL_audio=function(){t("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL")||(c.SDL=function(){t("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_gfx")||(c.SDL_gfx=function(){t("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GLUT")||(c.GLUT=function(){t("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"EGL")||(c.EGL=function(){t("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW_Window")||(c.GLFW_Window=function(){t("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW")||(c.GLFW=function(){t("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GLEW")||(c.GLEW=function(){t("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"IDBStore")||(c.IDBStore=function(){t("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runAndAbortIfError")||(c.runAndAbortIfError=function(){t("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emval_handle_array")||(c.emval_handle_array=function(){t("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_free_list")||(c.emval_free_list=function(){t("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_symbols")||(c.emval_symbols=function(){t("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"init_emval")||(c.init_emval=function(){t("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"count_emval_handles")||(c.count_emval_handles=function(){t("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"get_first_emval")||(c.get_first_emval=function(){t("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getStringOrSymbol")||(c.getStringOrSymbol=function(){t("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Emval")||(c.Emval=function(){t("'Emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_newers")||(c.emval_newers=function(){t("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"craftEmvalAllocator")||(c.craftEmvalAllocator=function(){t("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_get_global")||(c.emval_get_global=function(){t("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_methodCallers")||(c.emval_methodCallers=function(){t("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emval_registeredMethods")||(c.emval_registeredMethods=function(){t("'emval_registeredMethods' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"InternalError")||(c.InternalError=function(){t("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"BindingError")||(c.BindingError=function(){t("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"UnboundTypeError")||(c.UnboundTypeError=function(){t("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PureVirtualError")||(c.PureVirtualError=function(){t("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_embind")||(c.init_embind=function(){t("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"throwInternalError")||(c.throwInternalError=function(){t("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwBindingError")||(c.throwBindingError=function(){t("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwUnboundTypeError")||(c.throwUnboundTypeError=function(){t("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ensureOverloadTable")||(c.ensureOverloadTable=function(){t("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exposePublicSymbol")||(c.exposePublicSymbol=function(){t("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"replacePublicSymbol")||(c.replacePublicSymbol=function(){t("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"extendError")||(c.extendError=function(){t("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"createNamedFunction")||(c.createNamedFunction=function(){t("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredInstances")||(c.registeredInstances=function(){t("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getBasestPointer")||(c.getBasestPointer=function(){t("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerInheritedInstance")||(c.registerInheritedInstance=function(){t("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"unregisterInheritedInstance")||(c.unregisterInheritedInstance=function(){t("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getInheritedInstance")||(c.getInheritedInstance=function(){t("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstanceCount")||(c.getInheritedInstanceCount=function(){t("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getLiveInheritedInstances")||(c.getLiveInheritedInstances=function(){t("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registeredTypes")||(c.registeredTypes=function(){t("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"awaitingDependencies")||(c.awaitingDependencies=function(){t("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"typeDependencies")||(c.typeDependencies=function(){t("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registeredPointers")||(c.registeredPointers=function(){t("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerType")||(c.registerType=function(){t("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"whenDependentTypesAreResolved")||(c.whenDependentTypesAreResolved=function(){t("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"embind_charCodes")||(c.embind_charCodes=function(){t("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_init_charCodes")||(c.embind_init_charCodes=function(){t("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readLatin1String")||(c.readLatin1String=function(){t("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getTypeName")||(c.getTypeName=function(){t("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heap32VectorToArray")||(c.heap32VectorToArray=function(){t("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requireRegisteredType")||(c.requireRegisteredType=function(){t("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getShiftFromSize")||(c.getShiftFromSize=function(){t("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"integerReadValueFromPointer")||(c.integerReadValueFromPointer=function(){t("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"enumReadValueFromPointer")||(c.enumReadValueFromPointer=function(){t("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"floatReadValueFromPointer")||(c.floatReadValueFromPointer=function(){t("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"simpleReadValueFromPointer")||(c.simpleReadValueFromPointer=function(){t("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructors")||(c.runDestructors=function(){t("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"new_")||(c.new_=function(){t("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"craftInvokerFunction")||(c.craftInvokerFunction=function(){t("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind__requireFunction")||(c.embind__requireFunction=function(){t("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"tupleRegistrations")||(c.tupleRegistrations=function(){t("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"structRegistrations")||(c.structRegistrations=function(){t("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"genericPointerToWireType")||(c.genericPointerToWireType=function(){t("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"constNoSmartPtrRawPointerToWireType")||(c.constNoSmartPtrRawPointerToWireType=function(){t("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"nonConstNoSmartPtrRawPointerToWireType")||(c.nonConstNoSmartPtrRawPointerToWireType=function(){t("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"init_RegisteredPointer")||(c.init_RegisteredPointer=function(){t("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer")||(c.RegisteredPointer=function(){t("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_getPointee")||(c.RegisteredPointer_getPointee=function(){t("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"RegisteredPointer_destructor")||(c.RegisteredPointer_destructor=function(){t("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_deleteObject")||(c.RegisteredPointer_deleteObject=function(){t("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"RegisteredPointer_fromWireType")||(c.RegisteredPointer_fromWireType=function(){t("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructor")||(c.runDestructor=function(){t("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"releaseClassHandle")||(c.releaseClassHandle=function(){t("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"finalizationGroup")||(c.finalizationGroup=function(){t("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer_deps")||(c.detachFinalizer_deps=function(){t("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer")||(c.detachFinalizer=function(){t("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"attachFinalizer")||(c.attachFinalizer=function(){t("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"makeClassHandle")||(c.makeClassHandle=function(){t("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_ClassHandle")||(c.init_ClassHandle=function(){t("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle")||(c.ClassHandle=function(){t("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_isAliasOf")||(c.ClassHandle_isAliasOf=function(){t("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInstanceAlreadyDeleted")||(c.throwInstanceAlreadyDeleted=function(){t("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle_clone")||(c.ClassHandle_clone=function(){t("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_delete")||(c.ClassHandle_delete=function(){t("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"deletionQueue")||(c.deletionQueue=function(){t("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle_isDeleted")||(c.ClassHandle_isDeleted=function(){t("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_deleteLater")||(c.ClassHandle_deleteLater=function(){t("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"flushPendingDeletes")||(c.flushPendingDeletes=function(){t("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"delayFunction")||(c.delayFunction=function(){t("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setDelayFunction")||(c.setDelayFunction=function(){t("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredClass")||(c.RegisteredClass=function(){t("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"shallowCopyInternalPointer")||(c.shallowCopyInternalPointer=function(){t("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"downcastPointer")||(c.downcastPointer=function(){t("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"upcastPointer")||(c.upcastPointer=function(){t("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"validateThis")||(c.validateThis=function(){t("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_0")||(c.char_0=function(){t("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_9")||(c.char_9=function(){t("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"makeLegalFunctionName")||(c.makeLegalFunctionName=function(){t("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"warnOnce")||(c.warnOnce=function(){t("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackSave")||(c.stackSave=function(){t("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stackRestore")||(c.stackRestore=function(){t("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackAlloc")||(c.stackAlloc=function(){t("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AsciiToString")||(c.AsciiToString=function(){t("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToAscii")||(c.stringToAscii=function(){t("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF16ToString")||(c.UTF16ToString=function(){t("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF16")||(c.stringToUTF16=function(){t("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF16")||(c.lengthBytesUTF16=function(){t("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF32ToString")||(c.UTF32ToString=function(){t("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF32")||(c.stringToUTF32=function(){t("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF32")||(c.lengthBytesUTF32=function(){t("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8")||(c.allocateUTF8=function(){t("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8OnStack")||(c.allocateUTF8OnStack=function(){t("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +c.writeStackCookie=Pa;c.checkStackCookie=Ra;Object.getOwnPropertyDescriptor(c,"ALLOC_NORMAL")||Object.defineProperty(c,"ALLOC_NORMAL",{configurable:!0,get:function(){t("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});Object.getOwnPropertyDescriptor(c,"ALLOC_STACK")||Object.defineProperty(c,"ALLOC_STACK",{configurable:!0,get:function(){t("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var Qd; +ab=function Rd(){Qd||Sd();Qd||(ab=Rd)}; +function Sd(){function a(){if(!Qd&&(Qd=!0,c.calledRun=!0,!sa)){Ra();assert(!Xa);Xa=!0;if(!c.noFSInit&&!kc){assert(!kc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");kc=!0;jc();c.stdin=c.stdin;c.stdout=c.stdout;c.stderr=c.stderr;c.stdin?mc("stdin",c.stdin):fc("/dev/tty","/dev/stdin");c.stdout?mc("stdout",null,c.stdout):fc("/dev/tty","/dev/stdout");c.stderr?mc("stderr",null, +c.stderr):fc("/dev/tty1","/dev/stderr");var b=gc("/dev/stdin",0),d=gc("/dev/stdout",1),e=gc("/dev/stderr",1);assert(0===b.fd,"invalid handle for stdin ("+b.fd+")");assert(1===d.fd,"invalid handle for stdout ("+d.fd+")");assert(2===e.fd,"invalid handle for stderr ("+e.fd+")")}Pb=!1;hb(Va);if(c.onRuntimeInitialized)c.onRuntimeInitialized();assert(!c._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');Ra();if(c.postRun)for("function"==typeof c.postRun&& +(c.postRun=[c.postRun]);c.postRun.length;)b=c.postRun.shift(),Wa.unshift(b);hb(Wa)}}if(!(0=e);)++d;if(16g?e+=String.fromCharCode(g):(g-=65536,e+= +String.fromCharCode(55296|g>>10,56320|g&1023))}}else e+=String.fromCharCode(g)}return e}function z(a,b){return a?za(A,a,b):""} +function Aa(a,b,d,e){if(!(0=k){var m=a.charCodeAt(++h);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;1114111>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-g}function Ba(a,b,d){assert("number"==typeof d,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");Aa(a,A,b,d)}function Ca(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b} +var Da="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function Ea(a,b){assert(0==a%2,"Pointer passed to UTF16ToString must be aligned to two bytes!");var d=a>>1;for(var e=d+b/2;!(d>=e)&&Fa[d];)++d;d<<=1;if(32=b/2);++e){var g=Ga[a+2*e>>1];if(0==g)break;d+=String.fromCharCode(g)}return d} +function Ha(a,b,d){assert(0==b%2,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert("number"==typeof d,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var e=b;d=d<2*a.length?d/2:a.length;for(var g=0;g>1]=a.charCodeAt(g),b+=2;Ga[b>>1]=0;return b-e}function Ia(a){return 2*a.length} +function Ja(a,b){assert(0==a%4,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var d=0,e="";!(d>=b/4);){var g=B[a+4*d>>2];if(0==g)break;++d;65536<=g?(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|g&1023)):e+=String.fromCharCode(g)}return e} +function Ka(a,b,d){assert(0==b%4,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert("number"==typeof d,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(4>d)return 0;var e=b;d=e+d-4;for(var g=0;g=h){var k=a.charCodeAt(++g);h=65536+((h&1023)<<10)|k&1023}B[b>>2]=h;b+=4;if(b+4>d)break}B[b>>2]=0;return b-e} +function La(a){for(var b=0,d=0;d=e&&++d;b+=4}return b}function Ma(a){var b=Ca(a)+1,d=Na(b);d&&Aa(a,D,d,b);return d}function Oa(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");D.set(a,b)}var Pa,D,A,Ga,Fa,B,E,Qa,Ra; +function Sa(){var a=wa.buffer;Pa=a;c.HEAP8=D=new Int8Array(a);c.HEAP16=Ga=new Int16Array(a);c.HEAP32=B=new Int32Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=Fa=new Uint16Array(a);c.HEAPU32=E=new Uint32Array(a);c.HEAPF32=Qa=new Float32Array(a);c.HEAPF64=Ra=new Float64Array(a)}c.TOTAL_STACK&&assert(5242880===c.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Ta=c.INITIAL_MEMORY||16777216; +Object.getOwnPropertyDescriptor(c,"INITIAL_MEMORY")||Object.defineProperty(c,"INITIAL_MEMORY",{configurable:!0,get:function(){t("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});assert(5242880<=Ta,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Ta+"! (TOTAL_STACK=5242880)"); +assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");assert(!c.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(16777216==Ta,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var Ua; +function Va(){var a=Wa();assert(0==(a&3));B[a+4>>2]=34821223;B[a+8>>2]=2310721022;B[0]=1668509029}function Xa(){if(!xa){var a=Wa(),b=E[a+4>>2];a=E[a+8>>2];34821223==b&&2310721022==a||t("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+a.toString(16)+" 0x"+b.toString(16));1668509029!==B[0]&&t("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var Ya=new Int16Array(1),Za=new Int8Array(Ya.buffer); +Ya[0]=25459;if(115!==Za[0]||99!==Za[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";var $a=[],ab=[],bb=[],cb=!1,db=!1,qa=0;function eb(){var a=c.preRun.shift();$a.unshift(a)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); +assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var fb=0,gb=null,hb=null,ib={}; +function jb(){fb++;c.monitorRunDependencies&&c.monitorRunDependencies(fb);assert(!ib["wasm-instantiate"]);ib["wasm-instantiate"]=1;null===gb&&"undefined"!==typeof setInterval&&(gb=setInterval(function(){if(xa)clearInterval(gb),gb=null;else{var a=!1,b;for(b in ib)a||(a=!0,r("still waiting on run dependencies:")),r("dependency: "+b);a&&r("(end of list)")}},1E4))}c.preloadedImages={};c.preloadedAudios={}; +function t(a){if(c.onAbort)c.onAbort(a);a="Aborted("+a+")";r(a);xa=!0;throw new WebAssembly.RuntimeError(a);}function kb(){return G.startsWith("data:application/octet-stream;base64,")} +function H(a){return function(){var b=c.asm;assert(cb,"native function `"+a+"` called before runtime initialization");assert(!db,"native function `"+a+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var G;G="dbr-8.8.7.node.wasm";if(!kb()){var lb=G;G=c.locateFile?c.locateFile(lb,f):f+lb} +function mb(){var a=G;try{if(a==G&&va)return new Uint8Array(va);if(la)return la(a);throw"both async and sync fetching of the wasm failed";}catch(b){t(b)}} +function nb(){if(!va&&(ea||fa)){if("function"===typeof fetch&&!G.startsWith("file://"))return fetch(G,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()}).catch(function(){return mb()});if(ka)return new Promise(function(a,b){ka(G,function(d){a(new Uint8Array(d))},b)})}return Promise.resolve().then(function(){return mb()})}var I,J; +function ob(a){for(;0=qb.length&&(qb.length=a+1),qb[a]=b=Ua.get(a));assert(Ua.get(a)==b,"JavaScript-side Wasm function table mirror is out of date!");return b}var rb; +function sb(){function a(k){return(k=k.toTimeString().match(/\(([A-Za-z ]+)\)$/))?k[1]:"GMT"}var b=(new Date).getFullYear(),d=new Date(b,0,1),e=new Date(b,6,1);b=d.getTimezoneOffset();var g=e.getTimezoneOffset(),h=Math.max(b,g);B[tb()>>2]=60*h;B[ub()>>2]=Number(b!=g);d=a(d);e=a(e);d=Ma(d);e=Ma(e);g>2]=d,B[vb()+4>>2]=e):(B[vb()>>2]=e,B[vb()+4>>2]=d)}var wb; +function xb(a,b){for(var d=0,e=a.length-1;0<=e;e--){var g=a[e];"."===g?a.splice(e,1):".."===g?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(b)for(;d;d--)a.unshift("..");return a}function yb(a){var b="/"===a.charAt(0),d="/"===a.substr(-1);(a=xb(a.split("/").filter(function(e){return!!e}),!b).join("/"))||b||(a=".");a&&d&&(a+="/");return(b?"/":"")+a} +function zb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function Ab(a){if("/"===a)return"/";a=yb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)} +function Bb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(ha)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(d){}return function(){t("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}} +function Cb(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=xb(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."}var Db=[];function Eb(a,b){Db[a]={input:[],output:[],U:b};Fb(a,Gb)} +var Gb={open:function(a){var b=Db[a.node.rdev];if(!b)throw new L(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.U.flush(a.tty)},flush:function(a){a.tty.U.flush(a.tty)},read:function(a,b,d,e){if(!a.tty||!a.tty.U.qa)throw new L(60);for(var g=0,h=0;h=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.i,a.i=new Uint8Array(b), +0=a.node.s)return 0;a=Math.min(a.node.s-g,e);assert(0<=a);if(8b)throw new L(28);return b},la:function(a,b,d){M.oa(a.node,b+d);a.node.s=Math.max(a.node.s,b+d)},ra:function(a,b,d,e,g,h){if(0!==b)throw new L(28);if(32768!==(a.node.mode&61440))throw new L(43);a=a.node.i;if(h&2||a.buffer!==Pa){if(0>>0)%Ub.length}function Zb(a){var b=Yb(a.parent.id,a.name);if(Ub[b]===a)Ub[b]=a.T;else for(b=Ub[b];b;){if(b.T===a){b.T=a.T;break}b=b.T}} +function Nb(a,b){var d;if(d=(d=$b(a,"x"))?d:a.h.lookup?0:2)throw new L(d,a);for(d=Ub[Yb(a.id,b)];d;d=d.T){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return a.h.lookup(a,b)}function Lb(a,b,d,e){assert("object"===typeof a);a=new ac(a,b,d,e);b=Yb(a.parent.id,a.name);a.T=Ub[b];return Ub[b]=a}function N(a){return 16384===(a&61440)}var bc={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function cc(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b} +function $b(a,b){if(Vb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function dc(a,b){try{return Nb(a,b),20}catch(d){}return $b(a,"wx")}function ec(a,b,d){try{var e=Nb(a,b)}catch(g){return g.u}if(a=$b(a,"wx"))return a;if(d){if(!N(e.mode))return 54;if(e===e.parent||"/"===Xb(e))return 10}else if(N(e.mode))return 31;return 0}function fc(a){var b=4096;for(a=a||0;a<=b;a++)if(!Sb[a])return a;throw new L(33);} +function gc(a,b){hc||(hc=function(){},hc.prototype={object:{get:function(){return this.node},set:function(g){this.node=g}}});var d=new hc,e;for(e in a)d[e]=a[e];a=d;b=fc(b);a.fd=b;return Sb[b]=a}var Kb={open:function(a){a.l=Rb[a.node.rdev].l;a.l.open&&a.l.open(a)},N:function(){throw new L(70);}};function Fb(a,b){Rb[a]={l:b}} +function ic(a,b){if("string"===typeof a)throw a;var d="/"===b,e=!b;if(d&&Qb)throw new L(10);if(!d&&!e){var g=O(b,{pa:!1});b=g.path;g=g.node;if(g.S)throw new L(10);if(!N(g.mode))throw new L(54);}b={type:a,Ya:{},sa:b,Ea:[]};a=a.I(b);a.I=b;b.root=a;d?Qb=a:g&&(g.S=b,g.I&&g.I.Ea.push(b))}function jc(a,b,d){var e=O(a,{parent:!0}).node;a=Ab(a);if(!a||"."===a||".."===a)throw new L(28);var g=dc(e,a);if(g)throw new L(g);if(!e.h.ba)throw new L(63);return e.h.ba(e,a,b,d)} +function P(a,b){return jc(a,(void 0!==b?b:511)&1023|16384,0)}function kc(a,b,d){"undefined"===typeof d&&(d=b,b=438);jc(a,b|8192,d)}function lc(a,b){if(!Cb(a))throw new L(44);var d=O(b,{parent:!0}).node;if(!d)throw new L(44);b=Ab(b);var e=dc(d,b);if(e)throw new L(e);if(!d.h.symlink)throw new L(63);d.h.symlink(d,b,a)}function Wb(a){a=O(a).node;if(!a)throw new L(44);if(!a.h.readlink)throw new L(28);return Cb(Xb(a.parent),a.h.readlink(a))} +function mc(a,b,d,e){if(""===a)throw new L(44);if("string"===typeof b){var g=bc[b];if("undefined"===typeof g)throw Error("Unknown file open mode: "+b);b=g}d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var h=a;else{a=yb(a);try{h=O(a,{W:!(b&131072)}).node}catch(k){}}g=!1;if(b&64)if(h){if(b&128)throw new L(20);}else h=jc(a,d,0),g=!0;if(!h)throw new L(44);8192===(h.mode&61440)&&(b&=-513);if(b&65536&&!N(h.mode))throw new L(54);if(!g&&(d=h?40960===(h.mode&61440)?32:N(h.mode)&& +("r"!==cc(b)||b&512)?31:$b(h,cc(b)):44))throw new L(d);if(b&512){d=h;d="string"===typeof d?O(d,{W:!0}).node:d;if(!d.h.G)throw new L(63);if(N(d.mode))throw new L(31);if(32768!==(d.mode&61440))throw new L(28);if(g=$b(d,"w"))throw new L(g);d.h.G(d,{size:0,timestamp:Date.now()})}b&=-131713;e=gc({node:h,path:Xb(h),id:h.id,flags:b,mode:h.mode,seekable:!0,position:0,l:h.l,h:h.h,Ta:[],error:!1},e);e.l.open&&e.l.open(e);!c.logReadFiles||b&1||(nc||(nc={}),a in nc||(nc[a]=1));return e} +function oc(a,b,d){if(null===a.fd)throw new L(8);if(!a.seekable||!a.l.N)throw new L(70);if(0!=d&&1!=d&&2!=d)throw new L(28);a.position=a.l.N(a,b,d);a.Ta=[];return a.position} +function pc(){L||(L=function(a,b){this.node=b;this.Na=function(d){this.u=d;for(var e in Pb)if(Pb[e]===d){this.code=e;break}};this.Na(a);this.message=Ob[a];this.stack&&(Object.defineProperty(this,"stack",{value:Error().stack,writable:!0}),this.stack=pb(this.stack))},L.prototype=Error(),L.prototype.constructor=L,[44].forEach(function(a){Mb[a]=new L(a);Mb[a].stack=""}))}var qc;function rc(a,b){var d=0;a&&(d|=365);b&&(d|=146);return d} +function sc(a,b,d){a=yb("/dev/"+a);var e=rc(!!b,!!d);tc||(tc=64);var g=tc++<<8|0;Fb(g,{open:function(h){h.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(h,k,m,p){for(var n=0,q=0;q>2]}function wc(a){a=Sb[a];if(!a)throw new L(8);return a}function xc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var yc=void 0;function R(a){for(var b="";A[a];)b+=yc[A[a++]];return b}var zc={},Ac={},Bc={}; +function Cc(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Dc(a,b){a=Cc(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} +function Ec(a){var b=Error,d=Dc(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var Fc=void 0;function S(a){throw new Fc(a);}var Gc=void 0;function Hc(a){throw new Gc(a);} +function T(a,b,d){function e(m){m=d(m);m.length!==a.length&&Hc("Mismatched type converter count");for(var p=0;p>2])}function cd(a,b,d){if(b===d)return a;if(void 0===d.D)return null;a=cd(a,b,d.D);return null===a?null:d.ya(a)}var dd={}; +function ed(a,b){for(void 0===b&&S("ptr should not be undefined");a.D;)b=a.Z(b),a=a.D;return dd[b]}function fd(a,b){b.o&&b.m||Hc("makeClassHandle requires ptr and ptrType");!!b.C!==!!b.B&&Hc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Nc(Object.create(a,{g:{value:b}}))}function hd(a,b,d,e){this.name=a;this.j=b;this.ha=d;this.$=e;this.aa=!1;this.O=this.La=this.Ka=this.ua=this.Oa=this.Ia=void 0;void 0!==b.D?this.toWireType=Zc:(this.toWireType=e?Xc:ad,this.H=null)} +function jd(a,b){c.hasOwnProperty(a)||Hc("Replacing nonexistant public symbol");c[a]=b;c[a].P=void 0} +function kd(a,b){assert(a.includes("j"),"getDynCaller should only be called with i64 sigs");var d=[];return function(){d.length=arguments.length;for(var e=0;eh&&S("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==d,m=!1;for(d=1;d>2)+e]);return d} +function vd(a,b,d){a instanceof Object||S(d+' with invalid "this": '+a);a instanceof b.j.constructor||S(d+' incompatible with "this" of type '+a.constructor.name);a.g.m||S("cannot call emscripten binding method "+d+" on deleted object");return Wc(a.g.m,a.g.o.j,b.j)}var wd=[],V=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function xd(a){4>2])};case 3:return function(d){return this.fromWireType(Ra[d>>3])};default:throw new TypeError("Unknown float type: "+a);}} +function zd(a,b,d){switch(b){case 0:return d?function(e){return D[e]}:function(e){return A[e]};case 1:return d?function(e){return Ga[e>>1]}:function(e){return Fa[e>>1]};case 2:return d?function(e){return B[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function Ad(){void 0===Ad.start&&(Ad.start=Date.now());return 1E3*(Date.now()-Ad.start)|0}var Bd;Bd=ha?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()}; +function Cd(a,b){assert(b===(b|0));return(a>>>0)+4294967296*b}function Dd(a,b){if(0>=a)return a;var d=32>=b?Math.abs(1<=d&&(32>=b||a>d)&&(a=-2*d+a);return a}function Ed(a,b){return 0<=a?a:32>=b?2*Math.abs(1<>3]),e+=8):"i64"==F?(F=[B[e>>2],B[e+4>>2]],e+=8):(assert(0===(e&3)),F=B[e>>2],e+=4);return F}assert(0===(b&3));for(var e=b,g=[],h,k;;){var m=a;h=D[a>>0];if(0===h)break;k=D[a+1>>0];if(37==h){var p=!1,n=b=!1,q=!1,w=!1;a:for(;;){switch(k){case 43:p=!0;break;case 45:b=!0;break;case 35:n=!0;break;case 48:if(q)break a;else{q=!0;break}case 32:w=!0;break;default:break a}a++; +k=D[a+1>>0]}var y=0;if(42==k)y=d("i32"),a++,k=D[a+1>>0];else for(;48<=k&&57>=k;)y=10*y+(k-48),a++,k=D[a+1>>0];var l=!1,u=-1;if(46==k){u=0;l=!0;a++;k=D[a+1>>0];if(42==k)u=d("i32"),a++;else for(;;){k=D[a+1>>0];if(48>k||57>0]}0>u&&(u=6,l=!1);switch(String.fromCharCode(k)){case "h":k=D[a+2>>0];if(104==k){a++;var x=1}else x=2;break;case "l":k=D[a+2>>0];108==k?(a++,x=8):x=4;break;case "L":case "q":case "j":x=8;break;case "z":case "t":case "I":x=4;break;default:x=null}x&& +a++;k=D[a+1>>0];switch(String.fromCharCode(k)){case "d":case "i":case "u":case "o":case "x":case "X":case "p":m=100==k||105==k;x=x||4;h=d("i"+8*x);8==x&&(h=117==k?(h[0]>>>0)+4294967296*(h[1]>>>0):Cd(h[0],h[1]));4>=x&&(h=(m?Dd:Ed)(h&Math.pow(256,x)-1,8*x));var C=Math.abs(h);m="";if(100==k||105==k)var v=Dd(h,8*x,1).toString(10);else if(117==k)v=Ed(h,8*x,1).toString(10),h=Math.abs(h);else if(111==k)v=(n?"0":"")+C.toString(8);else if(120==k||88==k){m=n&&0!=h?"0x":"";if(0>h){h=-h;v=(C-1).toString(16); +C=[];for(n=0;nx&&-4<=x?(k=(103==k?"f":"F").charCodeAt(0),u-=x+1):(k=(103==k?"e":"E").charCodeAt(0),u--),x=Math.min(u,20);if(101==k||69==k)v=h.toExponential(x),/[eE][-+]\d$/.test(v)&&(v=v.slice(0,-1)+"0"+v.slice(-1));else if(102==k||70==k)v=h.toFixed(x),0===h&&(0>h||0===h&&-Infinity===1/h)&&(v="-"+v);m=v.split("e");if(l&&!n)for(;1x++;)m[0]+="0";v=m[0]+(1h?"-":"")+"inf",q=!1;for(;v.lengthk&&(v=v.toUpperCase());v.split("").forEach(function(F){g.push(F.charCodeAt(0))});break;case "s":q=(p=d("i8*"))?Gd(p):6;l&&(q=Math.min(q,u));if(!b)for(;q>0]);else g=g.concat(Hb("(null)".substr(0,q),!0));if(b)for(;q>2]=g.length;break;case "%":g.push(h);break;default:for(n=m;n>0])}a+=2}else g.push(h),a+=1}return g} +function Hd(a){if(!a||!a.callee||!a.callee.name)return[null,"",""];var b=a.callee.name,d="(",e=!0,g;for(g in a){var h=a[g];e||(d+=", ");e=!1;d="number"===typeof h||"string"===typeof h?d+h:d+("("+typeof h+")")}d+=")";a=(a=a.callee.caller)?a.arguments:[];e&&(d="");return[a,b,d]} +function Id(a){a:{var b=Error();if(!b.stack){try{throw Error();}catch(u){b=u}if(!b.stack){b="(no stack trace available)";break a}}b=b.stack.toString()}b=b.slice(b.indexOf("\n",Math.max(b.lastIndexOf("_emscripten_log"),b.lastIndexOf("_emscripten_get_callstack")))+1);a&32&&sa("EM_LOG_DEMANGLE is deprecated; ignoring");a&8&&"undefined"===typeof emscripten_source_map&&(sa('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'), +a=a^8|16);var d=null;if(a&128)for(d=Hd(arguments);d[1].includes("_emscripten_");)d=Hd(d[0]);var e=b.split("\n");b="";var g=RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),h=RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),k=RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)"),m;for(m in e){var p=e[m],n;if((n=k.exec(p))&&5==n.length){p=n[1];var q=n[2];var w=n[3];n=n[4]}else if((n=g.exec(p))||(n=h.exec(p)),n&&4<=n.length)p=n[1],q=n[2],w=n[3],n=n[4]|0;else{b+=p+"\n";continue}var y=!1;if(a&8){var l=emscripten_source_map.Za({line:w, +wa:n});if(y=l&&l.source)a&64&&(l.source=l.source.substring(l.source.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=" at "+p+" ("+l.source+":"+l.line+":"+l.wa+")\n"}if(a&16||!y)a&64&&(q=q.substring(q.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=(y?" = "+p:" at "+p)+" ("+q+":"+w+":"+n+")\n";a&128&&d[0]&&(d[1]==p&&0v?-1:0=k(x,l)?0>=k(u,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var n=B[e+40>>2];e={Ra:B[e>>2],Qa:B[e+4>>2],da:B[e+8>>2],Y:B[e+12>>2],V:B[e+16>>2],A:B[e+20>>2],ea:B[e+24>>2],fa:B[e+28>>2],$a:B[e+32>>2],Pa:B[e+36>> +2],Sa:n?z(n):""};d=z(d);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var q in n)d=d.replace(new RegExp(q,"g"),n[q]);var w="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), +y="January February March April May June July August September October November December".split(" ");n={"%a":function(l){return w[l.ea].substring(0,3)},"%A":function(l){return w[l.ea]},"%b":function(l){return y[l.V].substring(0,3)},"%B":function(l){return y[l.V]},"%C":function(l){return h((l.A+1900)/100|0,2)},"%d":function(l){return h(l.Y,2)},"%e":function(l){return g(l.Y,2," ")},"%g":function(l){return p(l).toString().substring(2)},"%G":function(l){return p(l)},"%H":function(l){return h(l.da,2)}, +"%I":function(l){l=l.da;0==l?l=12:12l.da?"AM":"PM"},"%S":function(l){return h(l.Ra,2)},"%t":function(){return"\t"},"%u":function(l){return l.ea||7},"%U":function(l){var u=new Date(l.A+1900,0,1),x=0===u.getDay()?u:Sd(u,7-u.getDay());l=new Date(l.A+1900,l.V,l.Y);return 0>k(x,l)? +h(Math.ceil((31-x.getDate()+(Pd(Od(l.getFullYear())?Qd:Rd,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(x,u)?"01":"00"},"%V":function(l){var u=new Date(l.A+1901,0,4),x=m(new Date(l.A+1900,0,4));u=m(u);var C=Sd(new Date(l.A+1900,0,1),l.fa);return 0>k(C,x)?"53":0>=k(u,C)?"01":h(Math.ceil((x.getFullYear()k(x,l)?h(Math.ceil((31-x.getDate()+(Pd(Od(l.getFullYear())?Qd:Rd,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(x,u)?"01":"00"},"%y":function(l){return(l.A+1900).toString().substring(2)},"%Y":function(l){return l.A+1900},"%z":function(l){l=l.Pa;var u=0<=l;l=Math.abs(l)/60;return(u?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Sa},"%%":function(){return"%"}};for(q in n)d.includes(q)&&(d=d.replace(new RegExp(q,"g"),n[q](e)));q=Hb(d,!1);if(q.length> +b)return 0;Oa(q,a);return q.length-1}function ac(a,b,d,e){a||(a=this);this.parent=a;this.I=a.I;this.S=null;this.id=Tb++;this.name=b;this.mode=d;this.h={};this.l={};this.rdev=e}Object.defineProperties(ac.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});pc();Ub=Array(4096);ic(M,"/");P("/tmp");P("/home");P("/home/web_user"); +(function(){P("/dev");Fb(259,{read:function(){return 0},write:function(b,d,e,g){return g}});kc("/dev/null",259);Eb(1280,Ib);Eb(1536,Jb);kc("/dev/tty",1280);kc("/dev/tty1",1536);var a=Bb();sc("random",a);sc("urandom",a);P("/dev/shm");P("/dev/shm/tmp")})(); +(function(){P("/proc");var a=P("/proc/self");P("/proc/self/fd");ic({I:function(){var b=Lb(a,"fd",16895,73);b.h={lookup:function(d,e){var g=Sb[+e];if(!g)throw new L(8);d={parent:null,I:{sa:"fake"},h:{readlink:function(){return g.path}}};return d.parent=d}};return b}},"/proc/self/fd")})(); +Pb={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115, +ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14, +EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};for(var Ud=Array(256),Vd=0;256>Vd;++Vd)Ud[Vd]=String.fromCharCode(Vd);yc=Ud;Fc=c.BindingError=Ec("BindingError"); +Gc=c.InternalError=Ec("InternalError");Rc.prototype.isAliasOf=function(a){if(!(this instanceof Rc&&a instanceof Rc))return!1;var b=this.g.o.j,d=this.g.m,e=a.g.o.j;for(a=a.g.m;b.D;)d=b.Z(d),b=b.D;for(;e.D;)a=e.Z(a),e=e.D;return b===e&&d===a}; +Rc.prototype.clone=function(){this.g.m||Jc(this);if(this.g.X)return this.g.count.value+=1,this;var a=Nc,b=Object,d=b.create,e=Object.getPrototypeOf(this),g=this.g;a=a(d.call(b,e,{g:{value:{count:g.count,R:g.R,X:g.X,m:g.m,o:g.o,B:g.B,C:g.C}}}));a.g.count.value+=1;a.g.R=!1;return a};Rc.prototype["delete"]=function(){this.g.m||Jc(this);this.g.R&&!this.g.X&&S("Object already scheduled for deletion");Lc(this);Mc(this.g);this.g.X||(this.g.B=void 0,this.g.m=void 0)};Rc.prototype.isDeleted=function(){return!this.g.m}; +Rc.prototype.deleteLater=function(){this.g.m||Jc(this);this.g.R&&!this.g.X&&S("Object already scheduled for deletion");Pc.push(this);1===Pc.length&&Oc&&Oc(Qc);this.g.R=!0;return this};hd.prototype.Aa=function(a){this.ua&&(a=this.ua(a));return a};hd.prototype.na=function(a){this.O&&this.O(a)};hd.prototype.argPackAdvance=8;hd.prototype.readValueFromPointer=bd;hd.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; +hd.prototype.fromWireType=function(a){function b(){return this.aa?fd(this.j.K,{o:this.Ia,m:d,C:this,B:a}):fd(this.j.K,{o:this,m:a})}var d=this.Aa(a);if(!d)return this.na(a),null;var e=ed(this.j,d);if(void 0!==e){if(0===e.g.count.value)return e.g.m=d,e.g.B=a,e.clone();e=e.clone();this.na(a);return e}e=this.j.za(d);e=Sc[e];if(!e)return b.call(this);e=this.$?e.xa:e.pointerType;var g=cd(d,this.j,e.j);return null===g?b.call(this):this.aa?fd(e.j.K,{o:e,m:g,C:this,B:a}):fd(e.j.K,{o:e,m:g})}; +c.getInheritedInstanceCount=function(){return Object.keys(dd).length};c.getLiveInheritedInstances=function(){var a=[],b;for(b in dd)dd.hasOwnProperty(b)&&a.push(dd[b]);return a};c.flushPendingDeletes=Qc;c.setDelayFunction=function(a){Oc=a;Pc.length&&Oc&&Oc(Qc)};md=c.UnboundTypeError=Ec("UnboundTypeError");c.count_emval_handles=function(){for(var a=0,b=5;b>2]);B[b>>2]=a.getUTCSeconds();B[b+4>>2]=a.getUTCMinutes();B[b+8>>2]=a.getUTCHours();B[b+12>>2]=a.getUTCDate();B[b+16>>2]=a.getUTCMonth();B[b+20>>2]=a.getUTCFullYear()-1900;B[b+24>>2]=a.getUTCDay();B[b+36>>2]=0;B[b+32>>2]=0;B[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;rb||(rb=Ma("GMT"));B[b+40>>2]=rb;return b},__localtime_r:function(a,b){wb||(wb=!0,sb());a=new Date(1E3*B[a>>2]);B[b>>2]=a.getSeconds(); +B[b+4>>2]=a.getMinutes();B[b+8>>2]=a.getHours();B[b+12>>2]=a.getDate();B[b+16>>2]=a.getMonth();B[b+20>>2]=a.getFullYear()-1900;B[b+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);B[b+28>>2]=(a.getTime()-d.getTime())/864E5|0;B[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;B[b+32>>2]=a;a=B[vb()+(a?4:0)>>2];B[b+40>>2]=a;return b},__syscall_fcntl64:function(a,b,d){uc=d;try{var e= +wc(a);switch(b){case 0:var g=vc();return 0>g?-28:mc(e.path,e.flags,0,g).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return g=vc(),e.flags|=g,0;case 5:return g=vc(),Ga[g+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return B[Wd()>>2]=28,-1;default:return-28}}catch(h){if("undefined"===typeof Q||!(h instanceof L))throw h;return-h.u}},__syscall_getdents64:function(a,b,d){try{var e=wc(a);if(!e.M){var g=O(e.path,{W:!0}).node;if(!g.h.readdir)throw new L(54);var h=g.h.readdir(g); +e.M=h}a=0;for(var k=oc(e,0,1),m=Math.floor(k/280);m>>0,(I=n,1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];B[b+a>>2]=J[0];B[b+a+4>>2]=J[1];J=[280*(m+1)>>>0,(I=280*(m+1),1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];B[b+a+8>>2]=J[0];B[b+a+12>>2]=J[1];Ga[b+a+16>>1]=280;D[b+a+18>>0]=q;Ba(p,b+a+19,256);a+=280;m+=1}oc(e,280*m,0);return a}catch(y){if("undefined"===typeof Q||!(y instanceof L))throw y;return-y.u}},__syscall_ioctl:function(a,b,d){uc=d;try{var e=wc(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var g=vc(); +return B[g>>2]=0;case 21520:return e.tty?-28:-59;case 21531:a=g=vc();if(!e.l.Ca)throw new L(59);return e.l.Ca(e,b,a);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:t("bad ioctl syscall "+b)}}catch(h){if("undefined"===typeof Q||!(h instanceof L))throw h;return-h.u}},__syscall_mkdir:function(a,b){try{return a=z(a),a=yb(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),P(a,b),0}catch(d){if("undefined"===typeof Q||!(d instanceof L))throw d;return-d.u}},__syscall_open:function(a, +b,d){uc=d;try{var e=z(a),g=d?vc():0;return mc(e,b,g).fd}catch(h){if("undefined"===typeof Q||!(h instanceof L))throw h;return-h.u}},__syscall_readlink:function(a,b,d){try{a=z(a);if(0>=d)var e=-28;else{var g=Wb(a),h=Math.min(d,Ca(g)),k=D[b+h];Ba(g,b,d+1);D[b+h]=k;e=h}return e}catch(m){if("undefined"===typeof Q||!(m instanceof L))throw m;return-m.u}},__syscall_rmdir:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=Ab(a),e=Nb(b,d),g=ec(b,d,!0);if(g)throw new L(g);if(!b.h.rmdir)throw new L(63);if(e.S)throw new L(10); +b.h.rmdir(b,d);Zb(e);return 0}catch(h){if("undefined"===typeof Q||!(h instanceof L))throw h;return-h.u}},__syscall_unlink:function(a){try{a=z(a);var b=O(a,{parent:!0}).node;if(!b)throw new L(44);var d=Ab(a),e=Nb(b,d),g=ec(b,d,!1);if(g)throw new L(g);if(!b.h.unlink)throw new L(63);if(e.S)throw new L(10);b.h.unlink(b,d);Zb(e);return 0}catch(h){if("undefined"===typeof Q||!(h instanceof L))throw h;return-h.u}},_embind_register_bigint:function(){},_embind_register_bool:function(a,b,d,e,g){var h=xc(d); +b=R(b);Ic(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,m){return m?e:g},argPackAdvance:8,readValueFromPointer:function(k){if(1===d)var m=D;else if(2===d)m=Ga;else if(4===d)m=B;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(m[k>>h])},H:null})},_embind_register_class:function(a,b,d,e,g,h,k,m,p,n,q,w,y){q=R(q);h=ld(g,h);m&&(m=ld(k,m));n&&(n=ld(p,n));y=ld(w,y);var l=Cc(q);Uc(l,function(){qd("Cannot construct "+q+" due to unbound types",[e])}); +T([a,b,d],e?[e]:[],function(u){u=u[0];if(e){var x=u.j;var C=x.K}else C=Rc.prototype;u=Dc(l,function(){if(Object.getPrototypeOf(this)!==v)throw new Fc("Use 'new' to construct "+q);if(void 0===F.L)throw new Fc(q+" has no accessible constructor");var gd=F.L[arguments.length];if(void 0===gd)throw new Fc("Tried to invoke ctor of "+q+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(F.L).toString()+") parameters instead!");return gd.apply(this,arguments)});var v=Object.create(C, +{constructor:{value:u}});u.prototype=v;var F=new Vc(q,u,v,y,x,h,m,n);x=new hd(q,F,!0,!1);C=new hd(q+"*",F,!1,!1);var U=new hd(q+" const*",F,!1,!0);Sc[a]={pointerType:C,xa:U};jd(l,u);return[x,C,U]})},_embind_register_class_class_function:function(a,b,d,e,g,h,k){var m=ud(d,e);b=R(b);h=ld(g,h);T([],[a],function(p){function n(){qd("Cannot call "+q+" due to unbound types",m)}p=p[0];var q=p.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var w=p.j.constructor;void 0===w[b]?(n.P=d-1,w[b]=n):(Tc(w, +b,q),w[b].v[d-1]=n);T([],m,function(y){y=[y[0],null].concat(y.slice(1));y=td(q,y,null,h,k);void 0===w[b].v?(y.P=d-1,w[b]=y):w[b].v[d-1]=y;return[]});return[]})},_embind_register_class_constructor:function(a,b,d,e,g,h){assert(0g)throw new TypeError('Passing a number "'+Yc(n)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+g+"]!");}function k(n){return n}b=R(b);-1===g&&(g=4294967295);var m=xc(d);if(0===e){var p=32-8*d;k=function(n){return n<

>>p}}d=b.includes("unsigned")?function(n,q){h(q,this.name);return q>>>0}:function(n,q){h(q,this.name);return q};Ic(a,{name:b,fromWireType:k,toWireType:d,argPackAdvance:8,readValueFromPointer:zd(b,m, +0!==e),H:null})},_embind_register_memory_view:function(a,b,d){function e(h){h>>=2;var k=E;return new g(Pa,k[h+1],k[h])}var g=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];d=R(d);Ic(a,{name:d,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Ba:!0})},_embind_register_std_string:function(a,b){b=R(b);var d="std::string"===b;Ic(a,{name:b,fromWireType:function(e){var g=E[e>>2];if(d)for(var h=e+4,k=0;k<=g;++k){var m=e+4+k;if(k==g||0==A[m]){h=z(h, +m-h);if(void 0===p)var p=h;else p+=String.fromCharCode(0),p+=h;h=m+1}}else{p=Array(g);for(k=0;k>2]=k;if(d&&h)Ba(g,m+4,k+ +1);else if(h)for(h=0;h> +2],q=k(),w,y=p+4,l=0;l<=n;++l){var u=p+4+l*b;if(l==n||0==q[u>>m])y=e(y,u-y),void 0===w?w=y:(w+=String.fromCharCode(0),w+=y),y=u+b}pd(p);return w},toWireType:function(p,n){"string"!==typeof n&&S("Cannot pass non-string to C++ string type "+d);var q=h(n),w=Na(4+q+b);E[w>>2]=q>>m;g(n,w+4,q+b);null!==p&&p.push(pd,w);return w},argPackAdvance:8,readValueFromPointer:bd,H:function(p){pd(p)}})},_embind_register_void:function(a,b){b=R(b);Ic(a,{Xa:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})}, +_emscripten_throw_longjmp:function(){throw"longjmp";},_emval_decref:xd,_emval_incref:function(a){4>2]=28,-1;B[b>>2]=a/1E3|0;B[b+4>>2]=a%1E3*1E6|0;return 0},emscripten_log:function(a, +b,d){b=Fd(b,d);b=za(b,0);a&24&&(b=b.replace(/\s+$/,""),b+=(0>>=0;assert(a>b);if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296); +e=Math.max(a,e);0>>16);Sa();var h=1;break a}catch(k){r("emscripten_realloc_buffer: Attempted to grow heap from "+Pa.byteLength+" bytes to "+g+" bytes, but got error: "+k)}h=void 0}if(h)return!0}r("Failed to grow the heap from "+b+" bytes to "+e+" bytes, not enough memory!");return!1},emscripten_run_script:function(a){eval(z(a))},emscripten_run_script_int:function(a){return eval(z(a))|0},emscripten_run_script_string:W, +environ_get:function(a,b){var d=0;Md().forEach(function(e,g){var h=b+d;g=B[a+4*g>>2]=h;for(h=0;h>0]=e.charCodeAt(h);D[g>>0]=0;d+=e.length+1});return 0},environ_sizes_get:function(a,b){var d=Md();B[a>>2]=d.length;var e=0;d.forEach(function(g){e+=g.length+1});B[b>>2]=e;return 0},exit:function(a){Xd();noExitRuntime||0>2],m=g,p=B[b+8*h>>2],n=k,q=void 0,w=D;if(0>n||0>q)throw new L(28);if(null===m.fd)throw new L(8); +if(1===(m.flags&2097155))throw new L(8);if(N(m.node.mode))throw new L(31);if(!m.l.read)throw new L(28);var y="undefined"!==typeof q;if(!y)q=m.position;else if(!m.seekable)throw new L(70);var l=m.l.read(m,w,p,n,q);y||(m.position+=l);var u=l;if(0>u){var x=-1;break a}a+=u;if(u>2]=x;return 0}catch(C){if("undefined"===typeof Q||!(C instanceof L))throw C;return C.u}},fd_seek:function(a,b,d,e,g){try{var h=wc(a);a=4294967296*d+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61; +oc(h,a,e);J=[h.position>>>0,(I=h.position,1<=+Math.abs(I)?0>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];B[g>>2]=J[0];B[g+4>>2]=J[1];h.M&&0===a&&0===e&&(h.M=null);return 0}catch(k){if("undefined"===typeof Q||!(k instanceof L))throw k;return k.u}},fd_write:function(a,b,d,e){try{a:{for(var g=wc(a),h=a=0;h>2],p=B[b+(8*h+4)>>2],n=void 0,q=D;if(0>p||0>n)throw new L(28);if(null===k.fd)throw new L(8);if(0===(k.flags&2097155))throw new L(8); +if(N(k.node.mode))throw new L(31);if(!k.l.write)throw new L(28);k.seekable&&k.flags&1024&&oc(k,0,2);var w="undefined"!==typeof n;if(!w)n=k.position;else if(!k.seekable)throw new L(70);var y=k.l.write(k,q,m,p,n,void 0);w||(k.position+=y);var l=y;if(0>l){var u=-1;break a}a+=l}u=a}B[e>>2]=u;return 0}catch(x){if("undefined"===typeof Q||!(x instanceof L))throw x;return x.u}},getTempRet0:function(){return ua},invoke_i:Yd,invoke_ii:Zd,invoke_iii:$d,invoke_iiii:ae,invoke_iiiii:be,invoke_iiiiiiii:ce,invoke_vi:de, +invoke_vii:ee,invoke_viii:fe,invoke_viiii:ge,invoke_viiiii:he,invoke_viiiiii:ie,invoke_viiiiiiiii:je,mktime:function(a){wb||(wb=!0,sb());var b=new Date(B[a+20>>2]+1900,B[a+16>>2],B[a+12>>2],B[a+8>>2],B[a+4>>2],B[a>>2],0),d=B[a+32>>2],e=b.getTimezoneOffset(),g=new Date(b.getFullYear(),0,1),h=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=g.getTimezoneOffset(),m=Math.min(k,h);0>d?B[a+32>>2]=Number(h!=k&&m==e):0>2]= +b.getDay();B[a+28>>2]=(b.getTime()-g.getTime())/864E5|0;B[a>>2]=b.getSeconds();B[a+4>>2]=b.getMinutes();B[a+8>>2]=b.getHours();B[a+12>>2]=b.getDate();B[a+16>>2]=b.getMonth();return b.getTime()/1E3|0},setTempRet0:function(a){ua=a},strftime:Td,strftime_l:function(a,b,d,e){return Td(a,b,d,e)},time:function(a){var b=Date.now()/1E3|0;a&&(B[a>>2]=b);return b}}; +(function(){function a(h){c.asm=h.exports;wa=c.asm.memory;assert(wa,"memory not found in wasm exports");Sa();Ua=c.asm.__indirect_function_table;assert(Ua,"table not found in wasm exports");ab.unshift(c.asm.__wasm_call_ctors);fb--;c.monitorRunDependencies&&c.monitorRunDependencies(fb);assert(ib["wasm-instantiate"]);delete ib["wasm-instantiate"];0==fb&&(null!==gb&&(clearInterval(gb),gb=null),hb&&(h=hb,hb=null,h()))}function b(h){assert(c===g,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); +g=null;a(h.instance)}function d(h){return nb().then(function(k){return WebAssembly.instantiate(k,e)}).then(function(k){return k}).then(h,function(k){r("failed to asynchronously prepare wasm: "+k);G.startsWith("file://")&&r("warning: Loading from a file URI ("+G+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");t(k)})}var e={env:ke,wasi_snapshot_preview1:ke}; +jb();var g=c;if(c.instantiateWasm)try{return c.instantiateWasm(e,a)}catch(h){return r("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return va||"function"!==typeof WebAssembly.instantiateStreaming||kb()||G.startsWith("file://")||"function"!==typeof fetch?d(b):fetch(G,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,e).then(b,function(k){r("wasm streaming compile failed: "+k);r("falling back to ArrayBuffer instantiation");return d(b)})})})(); +return{}})();c.___wasm_call_ctors=H("__wasm_call_ctors");var Gd=c._strlen=H("strlen"),Na=c._malloc=H("malloc"),Wd=c.___errno_location=H("__errno_location"),pd=c._free=H("free"),le=c._fflush=H("fflush"),od=c.___getTypeName=H("__getTypeName");c.___embind_register_native_and_builtin_types=H("__embind_register_native_and_builtin_types");var vb=c.__get_tzname=H("_get_tzname"),ub=c.__get_daylight=H("_get_daylight"),tb=c.__get_timezone=H("_get_timezone"),Kd=c._emscripten_builtin_malloc=H("emscripten_builtin_malloc"); +c._emscripten_main_thread_process_queued_calls=H("emscripten_main_thread_process_queued_calls");var X=c._setThrew=H("setThrew");c._saveSetjmp=H("saveSetjmp");var me=c._emscripten_stack_init=function(){return(me=c._emscripten_stack_init=c.asm.emscripten_stack_init).apply(null,arguments)};c._emscripten_stack_get_free=function(){return(c._emscripten_stack_get_free=c.asm.emscripten_stack_get_free).apply(null,arguments)}; +var Wa=c._emscripten_stack_get_end=function(){return(Wa=c._emscripten_stack_get_end=c.asm.emscripten_stack_get_end).apply(null,arguments)},Y=c.stackSave=H("stackSave"),Z=c.stackRestore=H("stackRestore");c.stackAlloc=H("stackAlloc");var Jd=c._emscripten_builtin_free=H("emscripten_builtin_free");c.dynCall_ji=H("dynCall_ji");c.dynCall_jiji=H("dynCall_jiji");c.dynCall_viij=H("dynCall_viij");c.dynCall_viiiiiiji=H("dynCall_viiiiiiji");c.dynCall_viiijj=H("dynCall_viiijj");c.dynCall_viiiiiijjiii=H("dynCall_viiiiiijjiii"); +c.dynCall_iiiijjii=H("dynCall_iiiijjii");c.dynCall_viijii=H("dynCall_viijii");c.dynCall_iiiiij=H("dynCall_iiiiij");c.dynCall_iiiiijj=H("dynCall_iiiiijj");c.dynCall_iiiiiijj=H("dynCall_iiiiiijj");function Zd(a,b){var d=Y();try{return K(a)(b)}catch(e){Z(d);if(e!==e+0&&"longjmp"!==e)throw e;X(1,0)}}function ae(a,b,d,e){var g=Y();try{return K(a)(b,d,e)}catch(h){Z(g);if(h!==h+0&&"longjmp"!==h)throw h;X(1,0)}} +function de(a,b){var d=Y();try{K(a)(b)}catch(e){Z(d);if(e!==e+0&&"longjmp"!==e)throw e;X(1,0)}}function fe(a,b,d,e){var g=Y();try{K(a)(b,d,e)}catch(h){Z(g);if(h!==h+0&&"longjmp"!==h)throw h;X(1,0)}}function ee(a,b,d){var e=Y();try{K(a)(b,d)}catch(g){Z(e);if(g!==g+0&&"longjmp"!==g)throw g;X(1,0)}}function $d(a,b,d){var e=Y();try{return K(a)(b,d)}catch(g){Z(e);if(g!==g+0&&"longjmp"!==g)throw g;X(1,0)}} +function ce(a,b,d,e,g,h,k,m){var p=Y();try{return K(a)(b,d,e,g,h,k,m)}catch(n){Z(p);if(n!==n+0&&"longjmp"!==n)throw n;X(1,0)}}function ge(a,b,d,e,g){var h=Y();try{K(a)(b,d,e,g)}catch(k){Z(h);if(k!==k+0&&"longjmp"!==k)throw k;X(1,0)}}function be(a,b,d,e,g){var h=Y();try{return K(a)(b,d,e,g)}catch(k){Z(h);if(k!==k+0&&"longjmp"!==k)throw k;X(1,0)}}function Yd(a){var b=Y();try{return K(a)()}catch(d){Z(b);if(d!==d+0&&"longjmp"!==d)throw d;X(1,0)}} +function ie(a,b,d,e,g,h,k){var m=Y();try{K(a)(b,d,e,g,h,k)}catch(p){Z(m);if(p!==p+0&&"longjmp"!==p)throw p;X(1,0)}}function he(a,b,d,e,g,h){var k=Y();try{K(a)(b,d,e,g,h)}catch(m){Z(k);if(m!==m+0&&"longjmp"!==m)throw m;X(1,0)}}function je(a,b,d,e,g,h,k,m,p,n){var q=Y();try{K(a)(b,d,e,g,h,k,m,p,n)}catch(w){Z(q);if(w!==w+0&&"longjmp"!==w)throw w;X(1,0)}}Object.getOwnPropertyDescriptor(c,"intArrayFromString")||(c.intArrayFromString=function(){t("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"intArrayToString")||(c.intArrayToString=function(){t("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ccall")||(c.ccall=function(){t("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"cwrap")||(c.cwrap=function(){t("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"setValue")||(c.setValue=function(){t("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getValue")||(c.getValue=function(){t("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocate")||(c.allocate=function(){t("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"UTF8ArrayToString")||(c.UTF8ArrayToString=function(){t("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF8ToString")||(c.UTF8ToString=function(){t("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8Array")||(c.stringToUTF8Array=function(){t("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToUTF8")||(c.stringToUTF8=function(){t("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"lengthBytesUTF8")||(c.lengthBytesUTF8=function(){t("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){t("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"addOnPreRun")||(c.addOnPreRun=function(){t("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnInit")||(c.addOnInit=function(){t("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreMain")||(c.addOnPreMain=function(){t("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"addOnExit")||(c.addOnExit=function(){t("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPostRun")||(c.addOnPostRun=function(){t("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeStringToMemory")||(c.writeStringToMemory=function(){t("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeArrayToMemory")||(c.writeArrayToMemory=function(){t("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeAsciiToMemory")||(c.writeAsciiToMemory=function(){t("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addRunDependency")||(c.addRunDependency=function(){t("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"removeRunDependency")||(c.removeRunDependency=function(){t("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createFolder")||(c.FS_createFolder=function(){t("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"FS_createPath")||(c.FS_createPath=function(){t("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createDataFile")||(c.FS_createDataFile=function(){t("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"FS_createPreloadedFile")||(c.FS_createPreloadedFile=function(){t("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createLazyFile")||(c.FS_createLazyFile=function(){t("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"FS_createLink")||(c.FS_createLink=function(){t("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS_createDevice")||(c.FS_createDevice=function(){t("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_unlink")||(c.FS_unlink=function(){t("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"getLEB")||(c.getLEB=function(){t("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFunctionTables")||(c.getFunctionTables=function(){t("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"alignFunctionTables")||(c.alignFunctionTables=function(){t("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerFunctions")||(c.registerFunctions=function(){t("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addFunction")||(c.addFunction=function(){t("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"removeFunction")||(c.removeFunction=function(){t("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){t("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"prettyPrint")||(c.prettyPrint=function(){t("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){t("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getCompilerSetting")||(c.getCompilerSetting=function(){t("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"print")||(c.print=function(){t("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"printErr")||(c.printErr=function(){t("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getTempRet0")||(c.getTempRet0=function(){t("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setTempRet0")||(c.setTempRet0=function(){t("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callMain")||(c.callMain=function(){t("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"abort")||(c.abort=function(){t("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"keepRuntimeAlive")||(c.keepRuntimeAlive=function(){t("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"zeroMemory")||(c.zeroMemory=function(){t("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToNewUTF8")||(c.stringToNewUTF8=function(){t("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setFileTime")||(c.setFileTime=function(){t("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscripten_realloc_buffer")||(c.emscripten_realloc_buffer=function(){t("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ENV")||(c.ENV=function(){t("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"withStackSave")||(c.withStackSave=function(){t("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_CODES")||(c.ERRNO_CODES=function(){t("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ERRNO_MESSAGES")||(c.ERRNO_MESSAGES=function(){t("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setErrNo")||(c.setErrNo=function(){t("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton4")||(c.inetPton4=function(){t("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"inetNtop4")||(c.inetNtop4=function(){t("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton6")||(c.inetPton6=function(){t("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop6")||(c.inetNtop6=function(){t("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"readSockaddr")||(c.readSockaddr=function(){t("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeSockaddr")||(c.writeSockaddr=function(){t("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"DNS")||(c.DNS=function(){t("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getHostByName")||(c.getHostByName=function(){t("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GAI_ERRNO_MESSAGES")||(c.GAI_ERRNO_MESSAGES=function(){t("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Protocols")||(c.Protocols=function(){t("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"Sockets")||(c.Sockets=function(){t("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getRandomDevice")||(c.getRandomDevice=function(){t("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"traverseStack")||(c.traverseStack=function(){t("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"convertFrameToPC")||(c.convertFrameToPC=function(){t("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UNWIND_CACHE")||(c.UNWIND_CACHE=function(){t("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"saveInUnwindCache")||(c.saveInUnwindCache=function(){t("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"convertPCtoSourceLocation")||(c.convertPCtoSourceLocation=function(){t("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgsArray")||(c.readAsmConstArgsArray=function(){t("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgs")||(c.readAsmConstArgs=function(){t("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"mainThreadEM_ASM")||(c.mainThreadEM_ASM=function(){t("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_q")||(c.jstoi_q=function(){t("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_s")||(c.jstoi_s=function(){t("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getExecutableName")||(c.getExecutableName=function(){t("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"listenOnce")||(c.listenOnce=function(){t("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"autoResumeAudioContext")||(c.autoResumeAudioContext=function(){t("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"dynCallLegacy")||(c.dynCallLegacy=function(){t("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getDynCaller")||(c.getDynCaller=function(){t("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){t("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"callRuntimeCallbacks")||(c.callRuntimeCallbacks=function(){t("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"wasmTableMirror")||(c.wasmTableMirror=function(){t("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setWasmTableEntry")||(c.setWasmTableEntry=function(){t("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getWasmTableEntry")||(c.getWasmTableEntry=function(){t("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"handleException")||(c.handleException=function(){t("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePush")||(c.runtimeKeepalivePush=function(){t("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePop")||(c.runtimeKeepalivePop=function(){t("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callUserCallback")||(c.callUserCallback=function(){t("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeExit")||(c.maybeExit=function(){t("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"safeSetTimeout")||(c.safeSetTimeout=function(){t("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asmjsMangle")||(c.asmjsMangle=function(){t("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asyncLoad")||(c.asyncLoad=function(){t("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"alignMemory")||(c.alignMemory=function(){t("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"mmapAlloc")||(c.mmapAlloc=function(){t("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reallyNegative")||(c.reallyNegative=function(){t("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"unSign")||(c.unSign=function(){t("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reSign")||(c.reSign=function(){t("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"formatString")||(c.formatString=function(){t("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"PATH")||(c.PATH=function(){t("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH_FS")||(c.PATH_FS=function(){t("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SYSCALLS")||(c.SYSCALLS=function(){t("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"syscallMmap2")||(c.syscallMmap2=function(){t("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMunmap")||(c.syscallMunmap=function(){t("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getSocketFromFD")||(c.getSocketFromFD=function(){t("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getSocketAddress")||(c.getSocketAddress=function(){t("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"JSEvents")||(c.JSEvents=function(){t("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerKeyEventCallback")||(c.registerKeyEventCallback=function(){t("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"specialHTMLTargets")||(c.specialHTMLTargets=function(){t("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeCStringToJsString")||(c.maybeCStringToJsString=function(){t("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"findEventTarget")||(c.findEventTarget=function(){t("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"findCanvasEventTarget")||(c.findCanvasEventTarget=function(){t("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBoundingClientRect")||(c.getBoundingClientRect=function(){t("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillMouseEventData")||(c.fillMouseEventData=function(){t("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerMouseEventCallback")||(c.registerMouseEventCallback=function(){t("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerWheelEventCallback")||(c.registerWheelEventCallback=function(){t("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerUiEventCallback")||(c.registerUiEventCallback=function(){t("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerFocusEventCallback")||(c.registerFocusEventCallback=function(){t("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillDeviceOrientationEventData")||(c.fillDeviceOrientationEventData=function(){t("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceOrientationEventCallback")||(c.registerDeviceOrientationEventCallback=function(){t("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillDeviceMotionEventData")||(c.fillDeviceMotionEventData=function(){t("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceMotionEventCallback")||(c.registerDeviceMotionEventCallback=function(){t("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"screenOrientation")||(c.screenOrientation=function(){t("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillOrientationChangeEventData")||(c.fillOrientationChangeEventData=function(){t("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerOrientationChangeEventCallback")||(c.registerOrientationChangeEventCallback=function(){t("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillFullscreenChangeEventData")||(c.fillFullscreenChangeEventData=function(){t("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerFullscreenChangeEventCallback")||(c.registerFullscreenChangeEventCallback=function(){t("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerRestoreOldStyle")||(c.registerRestoreOldStyle=function(){t("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"hideEverythingExceptGivenElement")||(c.hideEverythingExceptGivenElement=function(){t("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreHiddenElements")||(c.restoreHiddenElements=function(){t("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setLetterbox")||(c.setLetterbox=function(){t("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"currentFullscreenStrategy")||(c.currentFullscreenStrategy=function(){t("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreOldWindowedStyle")||(c.restoreOldWindowedStyle=function(){t("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"softFullscreenResizeWebGLRenderTarget")||(c.softFullscreenResizeWebGLRenderTarget=function(){t("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"doRequestFullscreen")||(c.doRequestFullscreen=function(){t("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillPointerlockChangeEventData")||(c.fillPointerlockChangeEventData=function(){t("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerPointerlockChangeEventCallback")||(c.registerPointerlockChangeEventCallback=function(){t("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerPointerlockErrorEventCallback")||(c.registerPointerlockErrorEventCallback=function(){t("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requestPointerLock")||(c.requestPointerLock=function(){t("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillVisibilityChangeEventData")||(c.fillVisibilityChangeEventData=function(){t("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerVisibilityChangeEventCallback")||(c.registerVisibilityChangeEventCallback=function(){t("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerTouchEventCallback")||(c.registerTouchEventCallback=function(){t("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillGamepadEventData")||(c.fillGamepadEventData=function(){t("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerGamepadEventCallback")||(c.registerGamepadEventCallback=function(){t("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerBeforeUnloadEventCallback")||(c.registerBeforeUnloadEventCallback=function(){t("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillBatteryEventData")||(c.fillBatteryEventData=function(){t("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"battery")||(c.battery=function(){t("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerBatteryEventCallback")||(c.registerBatteryEventCallback=function(){t("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setCanvasElementSize")||(c.setCanvasElementSize=function(){t("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getCanvasElementSize")||(c.getCanvasElementSize=function(){t("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"demangle")||(c.demangle=function(){t("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangleAll")||(c.demangleAll=function(){t("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jsStackTrace")||(c.jsStackTrace=function(){t("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){t("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getEnvStrings")||(c.getEnvStrings=function(){t("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"checkWasiClock")||(c.checkWasiClock=function(){t("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeI53ToI64")||(c.writeI53ToI64=function(){t("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Clamped")||(c.writeI53ToI64Clamped=function(){t("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Signaling")||(c.writeI53ToI64Signaling=function(){t("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeI53ToU64Clamped")||(c.writeI53ToU64Clamped=function(){t("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Signaling")||(c.writeI53ToU64Signaling=function(){t("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readI53FromI64")||(c.readI53FromI64=function(){t("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"readI53FromU64")||(c.readI53FromU64=function(){t("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertI32PairToI53")||(c.convertI32PairToI53=function(){t("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertU32PairToI53")||(c.convertU32PairToI53=function(){t("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"setImmediateWrapped")||(c.setImmediateWrapped=function(){t("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"clearImmediateWrapped")||(c.clearImmediateWrapped=function(){t("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"polyfillSetImmediate")||(c.polyfillSetImmediate=function(){t("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"uncaughtExceptionCount")||(c.uncaughtExceptionCount=function(){t("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionLast")||(c.exceptionLast=function(){t("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionCaught")||(c.exceptionCaught=function(){t("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ExceptionInfo")||(c.ExceptionInfo=function(){t("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"CatchInfo")||(c.CatchInfo=function(){t("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exception_addRef")||(c.exception_addRef=function(){t("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"exception_decRef")||(c.exception_decRef=function(){t("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Browser")||(c.Browser=function(){t("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"funcWrappers")||(c.funcWrappers=function(){t("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){t("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setMainLoop")||(c.setMainLoop=function(){t("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"wget")||(c.wget=function(){t("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"FS")||(c.FS=function(){t("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"MEMFS")||(c.MEMFS=function(){t("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"TTY")||(c.TTY=function(){t("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PIPEFS")||(c.PIPEFS=function(){t("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"SOCKFS")||(c.SOCKFS=function(){t("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"_setNetworkCallback")||(c._setNetworkCallback=function(){t("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"tempFixedLengthArray")||(c.tempFixedLengthArray=function(){t("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"miniTempWebGLFloatBuffers")||(c.miniTempWebGLFloatBuffers=function(){t("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapObjectForWebGLType")||(c.heapObjectForWebGLType=function(){t("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapAccessShiftForWebGLHeap")||(c.heapAccessShiftForWebGLHeap=function(){t("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GL")||(c.GL=function(){t("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGet")||(c.emscriptenWebGLGet=function(){t("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"computeUnpackAlignedImageSize")||(c.computeUnpackAlignedImageSize=function(){t("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetTexPixelData")||(c.emscriptenWebGLGetTexPixelData=function(){t("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetUniform")||(c.emscriptenWebGLGetUniform=function(){t("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"webglGetUniformLocation")||(c.webglGetUniformLocation=function(){t("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglPrepareUniformLocationsBeforeFirstUse")||(c.webglPrepareUniformLocationsBeforeFirstUse=function(){t("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"webglGetLeftBracePos")||(c.webglGetLeftBracePos=function(){t("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetVertexAttrib")||(c.emscriptenWebGLGetVertexAttrib=function(){t("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeGLArray")||(c.writeGLArray=function(){t("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"AL")||(c.AL=function(){t("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_unicode")||(c.SDL_unicode=function(){t("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_ttfContext")||(c.SDL_ttfContext=function(){t("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"SDL_audio")||(c.SDL_audio=function(){t("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL")||(c.SDL=function(){t("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_gfx")||(c.SDL_gfx=function(){t("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GLUT")||(c.GLUT=function(){t("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"EGL")||(c.EGL=function(){t("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW_Window")||(c.GLFW_Window=function(){t("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW")||(c.GLFW=function(){t("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GLEW")||(c.GLEW=function(){t("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"IDBStore")||(c.IDBStore=function(){t("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runAndAbortIfError")||(c.runAndAbortIfError=function(){t("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emval_handle_array")||(c.emval_handle_array=function(){t("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_free_list")||(c.emval_free_list=function(){t("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_symbols")||(c.emval_symbols=function(){t("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"init_emval")||(c.init_emval=function(){t("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"count_emval_handles")||(c.count_emval_handles=function(){t("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"get_first_emval")||(c.get_first_emval=function(){t("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getStringOrSymbol")||(c.getStringOrSymbol=function(){t("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Emval")||(c.Emval=function(){t("'Emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_newers")||(c.emval_newers=function(){t("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"craftEmvalAllocator")||(c.craftEmvalAllocator=function(){t("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_get_global")||(c.emval_get_global=function(){t("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_methodCallers")||(c.emval_methodCallers=function(){t("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emval_registeredMethods")||(c.emval_registeredMethods=function(){t("'emval_registeredMethods' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"InternalError")||(c.InternalError=function(){t("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"BindingError")||(c.BindingError=function(){t("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"UnboundTypeError")||(c.UnboundTypeError=function(){t("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PureVirtualError")||(c.PureVirtualError=function(){t("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_embind")||(c.init_embind=function(){t("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"throwInternalError")||(c.throwInternalError=function(){t("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwBindingError")||(c.throwBindingError=function(){t("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwUnboundTypeError")||(c.throwUnboundTypeError=function(){t("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ensureOverloadTable")||(c.ensureOverloadTable=function(){t("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exposePublicSymbol")||(c.exposePublicSymbol=function(){t("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"replacePublicSymbol")||(c.replacePublicSymbol=function(){t("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"extendError")||(c.extendError=function(){t("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"createNamedFunction")||(c.createNamedFunction=function(){t("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredInstances")||(c.registeredInstances=function(){t("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getBasestPointer")||(c.getBasestPointer=function(){t("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerInheritedInstance")||(c.registerInheritedInstance=function(){t("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"unregisterInheritedInstance")||(c.unregisterInheritedInstance=function(){t("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getInheritedInstance")||(c.getInheritedInstance=function(){t("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstanceCount")||(c.getInheritedInstanceCount=function(){t("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getLiveInheritedInstances")||(c.getLiveInheritedInstances=function(){t("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registeredTypes")||(c.registeredTypes=function(){t("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"awaitingDependencies")||(c.awaitingDependencies=function(){t("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"typeDependencies")||(c.typeDependencies=function(){t("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registeredPointers")||(c.registeredPointers=function(){t("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerType")||(c.registerType=function(){t("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"whenDependentTypesAreResolved")||(c.whenDependentTypesAreResolved=function(){t("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"embind_charCodes")||(c.embind_charCodes=function(){t("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_init_charCodes")||(c.embind_init_charCodes=function(){t("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readLatin1String")||(c.readLatin1String=function(){t("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getTypeName")||(c.getTypeName=function(){t("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heap32VectorToArray")||(c.heap32VectorToArray=function(){t("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requireRegisteredType")||(c.requireRegisteredType=function(){t("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getShiftFromSize")||(c.getShiftFromSize=function(){t("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"integerReadValueFromPointer")||(c.integerReadValueFromPointer=function(){t("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"enumReadValueFromPointer")||(c.enumReadValueFromPointer=function(){t("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"floatReadValueFromPointer")||(c.floatReadValueFromPointer=function(){t("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"simpleReadValueFromPointer")||(c.simpleReadValueFromPointer=function(){t("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructors")||(c.runDestructors=function(){t("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"new_")||(c.new_=function(){t("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"craftInvokerFunction")||(c.craftInvokerFunction=function(){t("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind__requireFunction")||(c.embind__requireFunction=function(){t("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"tupleRegistrations")||(c.tupleRegistrations=function(){t("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"structRegistrations")||(c.structRegistrations=function(){t("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"genericPointerToWireType")||(c.genericPointerToWireType=function(){t("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"constNoSmartPtrRawPointerToWireType")||(c.constNoSmartPtrRawPointerToWireType=function(){t("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"nonConstNoSmartPtrRawPointerToWireType")||(c.nonConstNoSmartPtrRawPointerToWireType=function(){t("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"init_RegisteredPointer")||(c.init_RegisteredPointer=function(){t("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer")||(c.RegisteredPointer=function(){t("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_getPointee")||(c.RegisteredPointer_getPointee=function(){t("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"RegisteredPointer_destructor")||(c.RegisteredPointer_destructor=function(){t("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_deleteObject")||(c.RegisteredPointer_deleteObject=function(){t("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"RegisteredPointer_fromWireType")||(c.RegisteredPointer_fromWireType=function(){t("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructor")||(c.runDestructor=function(){t("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"releaseClassHandle")||(c.releaseClassHandle=function(){t("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"finalizationGroup")||(c.finalizationGroup=function(){t("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer_deps")||(c.detachFinalizer_deps=function(){t("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer")||(c.detachFinalizer=function(){t("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"attachFinalizer")||(c.attachFinalizer=function(){t("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"makeClassHandle")||(c.makeClassHandle=function(){t("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_ClassHandle")||(c.init_ClassHandle=function(){t("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle")||(c.ClassHandle=function(){t("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_isAliasOf")||(c.ClassHandle_isAliasOf=function(){t("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInstanceAlreadyDeleted")||(c.throwInstanceAlreadyDeleted=function(){t("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle_clone")||(c.ClassHandle_clone=function(){t("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_delete")||(c.ClassHandle_delete=function(){t("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"deletionQueue")||(c.deletionQueue=function(){t("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle_isDeleted")||(c.ClassHandle_isDeleted=function(){t("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_deleteLater")||(c.ClassHandle_deleteLater=function(){t("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"flushPendingDeletes")||(c.flushPendingDeletes=function(){t("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"delayFunction")||(c.delayFunction=function(){t("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setDelayFunction")||(c.setDelayFunction=function(){t("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredClass")||(c.RegisteredClass=function(){t("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"shallowCopyInternalPointer")||(c.shallowCopyInternalPointer=function(){t("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"downcastPointer")||(c.downcastPointer=function(){t("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"upcastPointer")||(c.upcastPointer=function(){t("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"validateThis")||(c.validateThis=function(){t("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_0")||(c.char_0=function(){t("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_9")||(c.char_9=function(){t("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"makeLegalFunctionName")||(c.makeLegalFunctionName=function(){t("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"warnOnce")||(c.warnOnce=function(){t("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackSave")||(c.stackSave=function(){t("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stackRestore")||(c.stackRestore=function(){t("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackAlloc")||(c.stackAlloc=function(){t("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AsciiToString")||(c.AsciiToString=function(){t("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToAscii")||(c.stringToAscii=function(){t("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF16ToString")||(c.UTF16ToString=function(){t("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF16")||(c.stringToUTF16=function(){t("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF16")||(c.lengthBytesUTF16=function(){t("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF32ToString")||(c.UTF32ToString=function(){t("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF32")||(c.stringToUTF32=function(){t("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF32")||(c.lengthBytesUTF32=function(){t("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8")||(c.allocateUTF8=function(){t("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8OnStack")||(c.allocateUTF8OnStack=function(){t("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +c.writeStackCookie=Va;c.checkStackCookie=Xa;Object.getOwnPropertyDescriptor(c,"ALLOC_NORMAL")||Object.defineProperty(c,"ALLOC_NORMAL",{configurable:!0,get:function(){t("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});Object.getOwnPropertyDescriptor(c,"ALLOC_STACK")||Object.defineProperty(c,"ALLOC_STACK",{configurable:!0,get:function(){t("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var ne; +function na(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}hb=function oe(){ne||pe();ne||(hb=oe)}; +function pe(){function a(){if(!ne&&(ne=!0,c.calledRun=!0,!xa)){Xa();assert(!cb);cb=!0;if(!c.noFSInit&&!qc){assert(!qc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");qc=!0;pc();c.stdin=c.stdin;c.stdout=c.stdout;c.stderr=c.stderr;c.stdin?sc("stdin",c.stdin):lc("/dev/tty","/dev/stdin");c.stdout?sc("stdout",null,c.stdout):lc("/dev/tty","/dev/stdout");c.stderr?sc("stderr",null, +c.stderr):lc("/dev/tty1","/dev/stderr");var b=mc("/dev/stdin",0),d=mc("/dev/stdout",1),e=mc("/dev/stderr",1);assert(0===b.fd,"invalid handle for stdin ("+b.fd+")");assert(1===d.fd,"invalid handle for stdout ("+d.fd+")");assert(2===e.fd,"invalid handle for stderr ("+e.fd+")")}Vb=!1;ob(ab);if(c.onRuntimeInitialized)c.onRuntimeInitialized();assert(!c._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');Xa();if(c.postRun)for("function"==typeof c.postRun&& +(c.postRun=[c.postRun]);c.postRun.length;)b=c.postRun.shift(),bb.unshift(b);ob(bb)}}if(!(0=e);)++d;if(16g?e+=String.fromCharCode(g):(g-=65536,e+= +String.fromCharCode(55296|g>>10,56320|g&1023))}}else e+=String.fromCharCode(g)}return e}function z(a,b){return a?ua(A,a,b):""} +function va(a,b,d,e){if(!(0=k){var m=a.charCodeAt(++h);k=65536+((k&1023)<<10)|m&1023}if(127>=k){if(d>=e)break;b[d++]=k}else{if(2047>=k){if(d+1>=e)break;b[d++]=192|k>>6}else{if(65535>=k){if(d+2>=e)break;b[d++]=224|k>>12}else{if(d+3>=e)break;1114111>18;b[d++]=128|k>>12&63}b[d++]=128|k>>6&63}b[d++]=128|k&63}}b[d]=0;return d-g}function wa(a,b,d){assert("number"==typeof d,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");va(a,A,b,d)}function xa(a){for(var b=0,d=0;d=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++b:b=2047>=e?b+2:65535>=e?b+3:b+4}return b} +var ya="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function za(a,b){assert(0==a%2,"Pointer passed to UTF16ToString must be aligned to two bytes!");var d=a>>1;for(var e=d+b/2;!(d>=e)&&Aa[d];)++d;d<<=1;if(32=b/2);++e){var g=B[a+2*e>>1];if(0==g)break;d+=String.fromCharCode(g)}return d} +function Ba(a,b,d){assert(0==b%2,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert("number"==typeof d,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(2>d)return 0;d-=2;var e=b;d=d<2*a.length?d/2:a.length;for(var g=0;g>1]=a.charCodeAt(g),b+=2;B[b>>1]=0;return b-e}function Ca(a){return 2*a.length} +function Da(a,b){assert(0==a%4,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var d=0,e="";!(d>=b/4);){var g=D[a+4*d>>2];if(0==g)break;++d;65536<=g?(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|g&1023)):e+=String.fromCharCode(g)}return e} +function Ea(a,b,d){assert(0==b%4,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert("number"==typeof d,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");void 0===d&&(d=2147483647);if(4>d)return 0;var e=b;d=e+d-4;for(var g=0;g=h){var k=a.charCodeAt(++g);h=65536+((h&1023)<<10)|k&1023}D[b>>2]=h;b+=4;if(b+4>d)break}D[b>>2]=0;return b-e} +function Fa(a){for(var b=0,d=0;d=e&&++d;b+=4}return b}function Ga(a){var b=xa(a)+1,d=Ha(b);d&&va(a,F,d,b);return d}function Ia(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");F.set(a,b)}var Ja,F,A,B,Aa,D,G,Ka,La; +function Ma(){var a=ra.buffer;Ja=a;c.HEAP8=F=new Int8Array(a);c.HEAP16=B=new Int16Array(a);c.HEAP32=D=new Int32Array(a);c.HEAPU8=A=new Uint8Array(a);c.HEAPU16=Aa=new Uint16Array(a);c.HEAPU32=G=new Uint32Array(a);c.HEAPF32=Ka=new Float32Array(a);c.HEAPF64=La=new Float64Array(a)}c.TOTAL_STACK&&assert(5242880===c.TOTAL_STACK,"the stack size can no longer be determined at runtime");var Na=c.INITIAL_MEMORY||16777216; +Object.getOwnPropertyDescriptor(c,"INITIAL_MEMORY")||Object.defineProperty(c,"INITIAL_MEMORY",{configurable:!0,get:function(){t("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});assert(5242880<=Na,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+Na+"! (TOTAL_STACK=5242880)"); +assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");assert(!c.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(16777216==Na,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var Oa; +function Pa(){var a=Qa();assert(0==(a&3));D[a+4>>2]=34821223;D[a+8>>2]=2310721022;D[0]=1668509029}function Ra(){if(!sa){var a=Qa(),b=G[a+4>>2];a=G[a+8>>2];34821223==b&&2310721022==a||t("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+a.toString(16)+" 0x"+b.toString(16));1668509029!==D[0]&&t("Runtime error: The application has corrupted its heap memory area (address zero)!")}}var Sa=new Int16Array(1),Ta=new Int8Array(Sa.buffer); +Sa[0]=25459;if(115!==Ta[0]||99!==Ta[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";var Ua=[],Va=[],Wa=[],Xa=!1;function Ya(){var a=c.preRun.shift();Ua.unshift(a)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"); +assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Za=0,$a=null,ab=null,bb={}; +function cb(){Za++;c.monitorRunDependencies&&c.monitorRunDependencies(Za);assert(!bb["wasm-instantiate"]);bb["wasm-instantiate"]=1;null===$a&&"undefined"!==typeof setInterval&&($a=setInterval(function(){if(sa)clearInterval($a),$a=null;else{var a=!1,b;for(b in bb)a||(a=!0,q("still waiting on run dependencies:")),q("dependency: "+b);a&&q("(end of list)")}},1E4))}c.preloadedImages={};c.preloadedAudios={}; +function t(a){if(c.onAbort)c.onAbort(a);a="Aborted("+a+")";q(a);sa=!0;throw new WebAssembly.RuntimeError(a);}function db(){return H.startsWith("data:application/octet-stream;base64,")} +function I(a){return function(){var b=c.asm;assert(Xa,"native function `"+a+"` called before runtime initialization");assert(!0,"native function `"+a+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var H;H="libDynamsoftBarcodeReader.wasm";if(!db()){var eb=H;H=c.locateFile?c.locateFile(eb,f):f+eb} +function fb(){var a=H;try{if(a==H&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){t(b)}} +function gb(){if(!qa&&(da||ea)){if("function"===typeof fetch&&!H.startsWith("file://"))return fetch(H,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+H+"'";return a.arrayBuffer()}).catch(function(){return fb()});if(ja)return new Promise(function(a,b){ja(H,function(d){a(new Uint8Array(d))},b)})}return Promise.resolve().then(function(){return fb()})}var J,K; +function hb(a){for(;0=kb.length&&(kb.length=a+1),kb[a]=b=Oa.get(a));assert(Oa.get(a)==b,"JavaScript-side Wasm function table mirror is out of date!");return b}var lb; +function mb(){function a(k){return(k=k.toTimeString().match(/\(([A-Za-z ]+)\)$/))?k[1]:"GMT"}var b=(new Date).getFullYear(),d=new Date(b,0,1),e=new Date(b,6,1);b=d.getTimezoneOffset();var g=e.getTimezoneOffset(),h=Math.max(b,g);D[nb()>>2]=60*h;D[ob()>>2]=Number(b!=g);d=a(d);e=a(e);d=Ga(d);e=Ga(e);g>2]=d,D[pb()+4>>2]=e):(D[pb()>>2]=e,D[pb()+4>>2]=d)}var qb; +function rb(a,b){for(var d=0,e=a.length-1;0<=e;e--){var g=a[e];"."===g?a.splice(e,1):".."===g?(a.splice(e,1),d++):d&&(a.splice(e,1),d--)}if(b)for(;d;d--)a.unshift("..");return a}function sb(a){var b="/"===a.charAt(0),d="/"===a.substr(-1);(a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/"))||b||(a=".");a&&d&&(a+="/");return(b?"/":"")+a} +function tb(a){var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b}function ub(a){if("/"===a)return"/";a=sb(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)} +function vb(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(fa)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(d){}return function(){t("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}} +function wb(){for(var a="",b=!1,d=arguments.length-1;-1<=d&&!b;d--){b=0<=d?arguments[d]:"/";if("string"!==typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=rb(a.split("/").filter(function(e){return!!e}),!b).join("/");return(b?"/":"")+a||"."}var xb=[];function yb(a,b){xb[a]={input:[],output:[],U:b};zb(a,Ab)} +var Ab={open:function(a){var b=xb[a.node.rdev];if(!b)throw new L(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.U.flush(a.tty)},flush:function(a){a.tty.U.flush(a.tty)},read:function(a,b,d,e){if(!a.tty||!a.tty.U.qa)throw new L(60);for(var g=0,h=0;h=b||(b=Math.max(b,d*(1048576>d?2:1.125)>>>0),0!=d&&(b=Math.max(b,256)),d=a.i,a.i=new Uint8Array(b), +0=a.node.s)return 0;a=Math.min(a.node.s-g,e);assert(0<=a);if(8b)throw new L(28);return b},la:function(a,b,d){M.oa(a.node,b+d);a.node.s=Math.max(a.node.s,b+d)},ra:function(a,b,d,e,g,h){if(0!==b)throw new L(28);if(32768!==(a.node.mode&61440))throw new L(43);a=a.node.i;if(h&2||a.buffer!==Ja){if(0>>0)%Ob.length}function Tb(a){var b=Sb(a.parent.id,a.name);if(Ob[b]===a)Ob[b]=a.T;else for(b=Ob[b];b;){if(b.T===a){b.T=a.T;break}b=b.T}} +function Hb(a,b){var d;if(d=(d=Ub(a,"x"))?d:a.h.lookup?0:2)throw new L(d,a);for(d=Ob[Sb(a.id,b)];d;d=d.T){var e=d.name;if(d.parent.id===a.id&&e===b)return d}return a.h.lookup(a,b)}function Fb(a,b,d,e){assert("object"===typeof a);a=new Vb(a,b,d,e);b=Sb(a.parent.id,a.name);a.T=Ob[b];return Ob[b]=a}function N(a){return 16384===(a&61440)}var Wb={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function Xb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b} +function Ub(a,b){if(Pb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Yb(a,b){try{return Hb(a,b),20}catch(d){}return Ub(a,"wx")}function Zb(a,b,d){try{var e=Hb(a,b)}catch(g){return g.u}if(a=Ub(a,"wx"))return a;if(d){if(!N(e.mode))return 54;if(e===e.parent||"/"===Rb(e))return 10}else if(N(e.mode))return 31;return 0}function $b(a){var b=4096;for(a=a||0;a<=b;a++)if(!Mb[a])return a;throw new L(33);} +function ac(a,b){bc||(bc=function(){},bc.prototype={});var d=new bc,e;for(e in a)d[e]=a[e];a=d;b=$b(b);a.fd=b;return Mb[b]=a}var Eb={open:function(a){a.l=Lb[a.node.rdev].l;a.l.open&&a.l.open(a)},N:function(){throw new L(70);}};function zb(a,b){Lb[a]={l:b}} +function cc(a,b){if("string"===typeof a)throw a;var d="/"===b,e=!b;if(d&&Kb)throw new L(10);if(!d&&!e){var g=O(b,{pa:!1});b=g.path;g=g.node;if(g.S)throw new L(10);if(!N(g.mode))throw new L(54);}b={type:a,Ua:{},sa:b,Da:[]};a=a.I(b);a.I=b;b.root=a;d?Kb=a:g&&(g.S=b,g.I&&g.I.Da.push(b))}function dc(a,b,d){var e=O(a,{parent:!0}).node;a=ub(a);if(!a||"."===a||".."===a)throw new L(28);var g=Yb(e,a);if(g)throw new L(g);if(!e.h.aa)throw new L(63);return e.h.aa(e,a,b,d)} +function P(a,b){return dc(a,(void 0!==b?b:511)&1023|16384,0)}function ec(a,b,d){"undefined"===typeof d&&(d=b,b=438);dc(a,b|8192,d)}function fc(a,b){if(!wb(a))throw new L(44);var d=O(b,{parent:!0}).node;if(!d)throw new L(44);b=ub(b);var e=Yb(d,b);if(e)throw new L(e);if(!d.h.symlink)throw new L(63);d.h.symlink(d,b,a)}function Qb(a){a=O(a).node;if(!a)throw new L(44);if(!a.h.readlink)throw new L(28);return wb(Rb(a.parent),a.h.readlink(a))} +function gc(a,b,d,e){if(""===a)throw new L(44);if("string"===typeof b){var g=Wb[b];if("undefined"===typeof g)throw Error("Unknown file open mode: "+b);b=g}d=b&64?("undefined"===typeof d?438:d)&4095|32768:0;if("object"===typeof a)var h=a;else{a=sb(a);try{h=O(a,{ga:!(b&131072)}).node}catch(k){}}g=!1;if(b&64)if(h){if(b&128)throw new L(20);}else h=dc(a,d,0),g=!0;if(!h)throw new L(44);8192===(h.mode&61440)&&(b&=-513);if(b&65536&&!N(h.mode))throw new L(54);if(!g&&(d=h?40960===(h.mode&61440)?32:N(h.mode)&& +("r"!==Xb(b)||b&512)?31:Ub(h,Xb(b)):44))throw new L(d);if(b&512){d=h;d="string"===typeof d?O(d,{ga:!0}).node:d;if(!d.h.G)throw new L(63);if(N(d.mode))throw new L(31);if(32768!==(d.mode&61440))throw new L(28);if(g=Ub(d,"w"))throw new L(g);d.h.G(d,{size:0,timestamp:Date.now()})}b&=-131713;e=ac({node:h,path:Rb(h),id:h.id,flags:b,mode:h.mode,seekable:!0,position:0,l:h.l,h:h.h,Pa:[],error:!1},e);e.l.open&&e.l.open(e);!c.logReadFiles||b&1||(hc||(hc={}),a in hc||(hc[a]=1));return e} +function ic(a,b,d){if(null===a.fd)throw new L(8);if(!a.seekable||!a.l.N)throw new L(70);if(0!=d&&1!=d&&2!=d)throw new L(28);a.position=a.l.N(a,b,d);a.Pa=[];return a.position} +function jc(){L||(L=function(a,b){this.node=b;this.Ja=function(d){this.u=d;for(var e in Jb)if(Jb[e]===d){this.code=e;break}};this.Ja(a);this.message=Ib[a];this.stack&&(Object.defineProperty(this,"stack",{value:Error().stack,writable:!0}),this.stack=jb(this.stack))},L.prototype=Error(),L.prototype.constructor=L,[44].forEach(function(a){Gb[a]=new L(a);Gb[a].stack=""}))}var kc;function lc(a,b){var d=0;a&&(d|=365);b&&(d|=146);return d} +function mc(a,b,d){a=sb("/dev/"+a);var e=lc(!!b,!!d);nc||(nc=64);var g=nc++<<8|0;zb(g,{open:function(h){h.seekable=!1},close:function(){d&&d.buffer&&d.buffer.length&&d(10)},read:function(h,k,m,r){for(var n=0,p=0;p>2]}function qc(a){a=Mb[a];if(!a)throw new L(8);return a}function rc(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var sc=void 0;function S(a){for(var b="";A[a];)b+=sc[A[a++]];return b}var tc={},uc={},vc={}; +function wc(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function xc(a,b){a=wc(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)} +function yc(a){var b=Error,d=xc(a,function(e){this.name=a;this.message=e;e=Error(e).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))});d.prototype=Object.create(b.prototype);d.prototype.constructor=d;d.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return d}var zc=void 0;function T(a){throw new zc(a);}var Ac=void 0;function Bc(a){throw new Ac(a);} +function U(a,b,d){function e(m){m=d(m);m.length!==a.length&&Bc("Mismatched type converter count");for(var r=0;r>2])}function Wc(a,b,d){if(b===d)return a;if(void 0===d.D)return null;a=Wc(a,b,d.D);return null===a?null:d.ya(a)}var Xc={}; +function Zc(a,b){for(void 0===b&&T("ptr should not be undefined");a.D;)b=a.Y(b),a=a.D;return Xc[b]}function $c(a,b){b.o&&b.m||Bc("makeClassHandle requires ptr and ptrType");!!b.C!==!!b.B&&Bc("Both smartPtrType and smartPtr must be specified");b.count={value:1};return Gc(Object.create(a,{g:{value:b}}))}function W(a,b,d,e){this.name=a;this.j=b;this.ha=d;this.Z=e;this.$=!1;this.O=this.Ha=this.Ga=this.ua=this.Ka=this.Ea=void 0;void 0!==b.D?this.toWireType=Sc:(this.toWireType=e?Qc:Uc,this.H=null)} +function ad(a,b){c.hasOwnProperty(a)||Bc("Replacing nonexistant public symbol");c[a]=b;c[a].P=void 0} +function bd(a,b){assert(a.includes("j"),"getDynCaller should only be called with i64 sigs");var d=[];return function(){d.length=arguments.length;for(var e=0;eh&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==d,m=!1;for(d=1;d>2)+e]);return d} +function md(a,b,d){a instanceof Object||T(d+' with invalid "this": '+a);a instanceof b.j.constructor||T(d+' incompatible with "this" of type '+a.constructor.name);a.g.m||T("cannot call emscripten binding method "+d+" on deleted object");return Pc(a.g.m,a.g.o.j,b.j)}var nd=[],Y=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function od(a){4>2])};case 3:return function(d){return this.fromWireType(La[d>>3])};default:throw new TypeError("Unknown float type: "+a);}} +function qd(a,b,d){switch(b){case 0:return d?function(e){return F[e]}:function(e){return A[e]};case 1:return d?function(e){return B[e>>1]}:function(e){return Aa[e>>1]};case 2:return d?function(e){return D[e>>2]}:function(e){return G[e>>2]};default:throw new TypeError("Unknown integer type: "+a);}}function rd(){void 0===rd.start&&(rd.start=Date.now());return 1E3*(Date.now()-rd.start)|0}var sd;sd=fa?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:function(){return performance.now()}; +function td(a,b){assert(b===(b|0));return(a>>>0)+4294967296*b}function ud(a,b){if(0>=a)return a;var d=32>=b?Math.abs(1<=d&&(32>=b||a>d)&&(a=-2*d+a);return a}function vd(a,b){return 0<=a?a:32>=b?2*Math.abs(1<>3]),e+=8):"i64"==E?(E=[D[e>>2],D[e+4>>2]],e+=8):(assert(0===(e&3)),E=D[e>>2],e+=4);return E}assert(0===(b&3));for(var e=b,g=[],h,k;;){var m=a;h=F[a>>0];if(0===h)break;k=F[a+1>>0];if(37==h){var r=!1,n=b=!1,p=!1,x=!1;a:for(;;){switch(k){case 43:r=!0;break;case 45:b=!0;break;case 35:n=!0;break;case 48:if(p)break a;else{p=!0;break}case 32:x=!0;break;default:break a}a++; +k=F[a+1>>0]}var y=0;if(42==k)y=d("i32"),a++,k=F[a+1>>0];else for(;48<=k&&57>=k;)y=10*y+(k-48),a++,k=F[a+1>>0];var l=!1,u=-1;if(46==k){u=0;l=!0;a++;k=F[a+1>>0];if(42==k)u=d("i32"),a++;else for(;;){k=F[a+1>>0];if(48>k||57>0]}0>u&&(u=6,l=!1);switch(String.fromCharCode(k)){case "h":k=F[a+2>>0];if(104==k){a++;var w=1}else w=2;break;case "l":k=F[a+2>>0];108==k?(a++,w=8):w=4;break;case "L":case "q":case "j":w=8;break;case "z":case "t":case "I":w=4;break;default:w=null}w&& +a++;k=F[a+1>>0];switch(String.fromCharCode(k)){case "d":case "i":case "u":case "o":case "x":case "X":case "p":m=100==k||105==k;w=w||4;h=d("i"+8*w);8==w&&(h=117==k?(h[0]>>>0)+4294967296*(h[1]>>>0):td(h[0],h[1]));4>=w&&(h=(m?ud:vd)(h&Math.pow(256,w)-1,8*w));var C=Math.abs(h);m="";if(100==k||105==k)var v=ud(h,8*w,1).toString(10);else if(117==k)v=vd(h,8*w,1).toString(10),h=Math.abs(h);else if(111==k)v=(n?"0":"")+C.toString(8);else if(120==k||88==k){m=n&&0!=h?"0x":"";if(0>h){h=-h;v=(C-1).toString(16); +C=[];for(n=0;nw&&-4<=w?(k=(103==k?"f":"F").charCodeAt(0),u-=w+1):(k=(103==k?"e":"E").charCodeAt(0),u--),w=Math.min(u,20);if(101==k||69==k)v=h.toExponential(w),/[eE][-+]\d$/.test(v)&&(v=v.slice(0,-1)+"0"+v.slice(-1));else if(102==k||70==k)v=h.toFixed(w),0===h&&(0>h||0===h&&-Infinity===1/h)&&(v="-"+v);m=v.split("e");if(l&&!n)for(;1w++;)m[0]+="0";v=m[0]+(1h?"-":"")+"inf",p=!1;for(;v.lengthk&&(v=v.toUpperCase());v.split("").forEach(function(E){g.push(E.charCodeAt(0))});break;case "s":p=(r=d("i8*"))?xd(r):6;l&&(p=Math.min(p,u));if(!b)for(;p>0]);else g=g.concat(Bb("(null)".substr(0,p),!0));if(b)for(;p>2]=g.length;break;case "%":g.push(h);break;default:for(n=m;n>0])}a+=2}else g.push(h),a+=1}return g} +function yd(a){if(!a||!a.callee||!a.callee.name)return[null,"",""];var b=a.callee.name,d="(",e=!0,g;for(g in a){var h=a[g];e||(d+=", ");e=!1;d="number"===typeof h||"string"===typeof h?d+h:d+("("+typeof h+")")}d+=")";a=(a=a.callee.caller)?a.arguments:[];e&&(d="");return[a,b,d]} +function zd(a){a:{var b=Error();if(!b.stack){try{throw Error();}catch(u){b=u}if(!b.stack){b="(no stack trace available)";break a}}b=b.stack.toString()}b=b.slice(b.indexOf("\n",Math.max(b.lastIndexOf("_emscripten_log"),b.lastIndexOf("_emscripten_get_callstack")))+1);a&32&&oa("EM_LOG_DEMANGLE is deprecated; ignoring");a&8&&"undefined"===typeof emscripten_source_map&&(oa('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'), +a=a^8|16);var d=null;if(a&128)for(d=yd(arguments);d[1].includes("_emscripten_");)d=yd(d[0]);var e=b.split("\n");b="";var g=RegExp("\\s*(.*?)@(.*?):([0-9]+):([0-9]+)"),h=RegExp("\\s*(.*?)@(.*):(.*)(:(.*))?"),k=RegExp("\\s*at (.*?) \\((.*):(.*):(.*)\\)"),m;for(m in e){var r=e[m],n;if((n=k.exec(r))&&5==n.length){r=n[1];var p=n[2];var x=n[3];n=n[4]}else if((n=g.exec(r))||(n=h.exec(r)),n&&4<=n.length)r=n[1],p=n[2],x=n[3],n=n[4]|0;else{b+=r+"\n";continue}var y=!1;if(a&8){var l=emscripten_source_map.Va({line:x, +wa:n});if(y=l&&l.source)a&64&&(l.source=l.source.substring(l.source.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=" at "+r+" ("+l.source+":"+l.line+":"+l.wa+")\n"}if(a&16||!y)a&64&&(p=p.substring(p.replace(/\\/g,"/").lastIndexOf("/")+1)),b+=(y?" = "+r:" at "+r)+" ("+p+":"+x+":"+n+")\n";a&128&&d[0]&&(d[1]==r&&0v?-1:0=k(w,l)?0>=k(u,l)?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var n=D[e+40>>2];e={Na:D[e>>2],Ma:D[e+4>>2],ba:D[e+8>>2],X:D[e+12>>2],V:D[e+16>>2],A:D[e+20>>2],da:D[e+24>>2],ea:D[e+28>>2],Wa:D[e+32>>2],La:D[e+36>> +2],Oa:n?z(n):""};d=z(d);n={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in n)d=d.replace(new RegExp(p,"g"),n[p]);var x="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), +y="January February March April May June July August September October November December".split(" ");n={"%a":function(l){return x[l.da].substring(0,3)},"%A":function(l){return x[l.da]},"%b":function(l){return y[l.V].substring(0,3)},"%B":function(l){return y[l.V]},"%C":function(l){return h((l.A+1900)/100|0,2)},"%d":function(l){return h(l.X,2)},"%e":function(l){return g(l.X,2," ")},"%g":function(l){return r(l).toString().substring(2)},"%G":function(l){return r(l)},"%H":function(l){return h(l.ba,2)}, +"%I":function(l){l=l.ba;0==l?l=12:12l.ba?"AM":"PM"},"%S":function(l){return h(l.Na,2)},"%t":function(){return"\t"},"%u":function(l){return l.da||7},"%U":function(l){var u=new Date(l.A+1900,0,1),w=0===u.getDay()?u:Jd(u,7-u.getDay());l=new Date(l.A+1900,l.V,l.X);return 0>k(w,l)? +h(Math.ceil((31-w.getDate()+(Gd(Fd(l.getFullYear())?Hd:Id,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(w,u)?"01":"00"},"%V":function(l){var u=new Date(l.A+1901,0,4),w=m(new Date(l.A+1900,0,4));u=m(u);var C=Jd(new Date(l.A+1900,0,1),l.ea);return 0>k(C,w)?"53":0>=k(u,C)?"01":h(Math.ceil((w.getFullYear()k(w,l)?h(Math.ceil((31-w.getDate()+(Gd(Fd(l.getFullYear())?Hd:Id,l.getMonth()-1)-31)+l.getDate())/7),2):0===k(w,u)?"01":"00"},"%y":function(l){return(l.A+1900).toString().substring(2)},"%Y":function(l){return l.A+1900},"%z":function(l){l=l.La;var u=0<=l;l=Math.abs(l)/60;return(u?"+":"-")+String("0000"+(l/60*100+l%60)).slice(-4)},"%Z":function(l){return l.Oa},"%%":function(){return"%"}};for(p in n)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),n[p](e)));p=Bb(d,!1);if(p.length> +b)return 0;Ia(p,a);return p.length-1}function Vb(a,b,d,e){a||(a=this);this.parent=a;this.I=a.I;this.S=null;this.id=Nb++;this.name=b;this.mode=d;this.h={};this.l={};this.rdev=e}Object.defineProperties(Vb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});jc();Ob=Array(4096);cc(M,"/");P("/tmp");P("/home");P("/home/web_user"); +(function(){P("/dev");zb(259,{read:function(){return 0},write:function(b,d,e,g){return g}});ec("/dev/null",259);yb(1280,Cb);yb(1536,Db);ec("/dev/tty",1280);ec("/dev/tty1",1536);var a=vb();mc("random",a);mc("urandom",a);P("/dev/shm");P("/dev/shm/tmp")})(); +(function(){P("/proc");var a=P("/proc/self");P("/proc/self/fd");cc({I:function(){var b=Fb(a,"fd",16895,73);b.h={lookup:function(d,e){var g=Mb[+e];if(!g)throw new L(8);d={parent:null,I:{sa:"fake"},h:{readlink:function(){return g.path}}};return d.parent=d}};return b}},"/proc/self/fd")})(); +Jb={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115, +ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14, +EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};for(var Ld=Array(256),Md=0;256>Md;++Md)Ld[Md]=String.fromCharCode(Md);sc=Ld;zc=c.BindingError=yc("BindingError"); +Ac=c.InternalError=yc("InternalError");Kc.prototype.isAliasOf=function(a){if(!(this instanceof Kc&&a instanceof Kc))return!1;var b=this.g.o.j,d=this.g.m,e=a.g.o.j;for(a=a.g.m;b.D;)d=b.Y(d),b=b.D;for(;e.D;)a=e.Y(a),e=e.D;return b===e&&d===a}; +Kc.prototype.clone=function(){this.g.m||Cc(this);if(this.g.W)return this.g.count.value+=1,this;var a=Gc,b=Object,d=b.create,e=Object.getPrototypeOf(this),g=this.g;a=a(d.call(b,e,{g:{value:{count:g.count,R:g.R,W:g.W,m:g.m,o:g.o,B:g.B,C:g.C}}}));a.g.count.value+=1;a.g.R=!1;return a};Kc.prototype["delete"]=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ec(this);Fc(this.g);this.g.W||(this.g.B=void 0,this.g.m=void 0)};Kc.prototype.isDeleted=function(){return!this.g.m}; +Kc.prototype.deleteLater=function(){this.g.m||Cc(this);this.g.R&&!this.g.W&&T("Object already scheduled for deletion");Ic.push(this);1===Ic.length&&Hc&&Hc(Jc);this.g.R=!0;return this};W.prototype.Aa=function(a){this.ua&&(a=this.ua(a));return a};W.prototype.na=function(a){this.O&&this.O(a)};W.prototype.argPackAdvance=8;W.prototype.readValueFromPointer=Vc;W.prototype.deleteObject=function(a){if(null!==a)a["delete"]()}; +W.prototype.fromWireType=function(a){function b(){return this.$?$c(this.j.K,{o:this.Ea,m:d,C:this,B:a}):$c(this.j.K,{o:this,m:a})}var d=this.Aa(a);if(!d)return this.na(a),null;var e=Zc(this.j,d);if(void 0!==e){if(0===e.g.count.value)return e.g.m=d,e.g.B=a,e.clone();e=e.clone();this.na(a);return e}e=this.j.za(d);e=Lc[e];if(!e)return b.call(this);e=this.Z?e.xa:e.pointerType;var g=Wc(d,this.j,e.j);return null===g?b.call(this):this.$?$c(e.j.K,{o:e,m:g,C:this,B:a}):$c(e.j.K,{o:e,m:g})}; +c.getInheritedInstanceCount=function(){return Object.keys(Xc).length};c.getLiveInheritedInstances=function(){var a=[],b;for(b in Xc)Xc.hasOwnProperty(b)&&a.push(Xc[b]);return a};c.flushPendingDeletes=Jc;c.setDelayFunction=function(a){Hc=a;Ic.length&&Hc&&Hc(Jc)};cd=c.UnboundTypeError=yc("UnboundTypeError");c.count_emval_handles=function(){for(var a=0,b=5;b>2]);D[b>>2]=a.getUTCSeconds();D[b+4>>2]=a.getUTCMinutes();D[b+8>>2]=a.getUTCHours();D[b+12>>2]=a.getUTCDate();D[b+16>>2]=a.getUTCMonth();D[b+20>>2]=a.getUTCFullYear()-1900;D[b+24>>2]=a.getUTCDay();D[b+36>>2]=0;D[b+32>>2]=0;D[b+28>>2]=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;lb||(lb=Ga("GMT"));D[b+40>>2]=lb;return b},__localtime_r:function(a,b){qb||(qb=!0,mb());a=new Date(1E3*D[a>>2]);D[b>>2]=a.getSeconds(); +D[b+4>>2]=a.getMinutes();D[b+8>>2]=a.getHours();D[b+12>>2]=a.getDate();D[b+16>>2]=a.getMonth();D[b+20>>2]=a.getFullYear()-1900;D[b+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);D[b+28>>2]=(a.getTime()-d.getTime())/864E5|0;D[b+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;D[b+32>>2]=a;a=D[pb()+(a?4:0)>>2];D[b+40>>2]=a;return b},__syscall_fcntl64:function(a,b,d){oc=d;try{var e= +qc(a);switch(b){case 0:var g=pc();return 0>g?-28:gc(e.path,e.flags,0,g).fd;case 1:case 2:return 0;case 3:return e.flags;case 4:return g=pc(),e.flags|=g,0;case 5:return g=pc(),B[g+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return D[Nd()>>2]=28,-1;default:return-28}}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_getdents64:function(a,b,d){try{var e=qc(a);if(!e.M){var g=O(e.path,{ga:!0}).node;if(!g.h.readdir)throw new L(54);var h=g.h.readdir(g); +e.M=h}a=0;for(var k=ic(e,0,1),m=Math.floor(k/280);m>>0,(J=n,1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];D[b+a>>2]=K[0];D[b+a+4>>2]=K[1];K=[280*(m+1)>>>0,(J=280*(m+1),1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];D[b+a+8>>2]=K[0];D[b+a+12>>2]=K[1];B[b+a+16>>1]=280;F[b+a+18>>0]=p;wa(r,b+a+19,256);a+=280;m+=1}ic(e,280*m,0);return a}catch(y){if("undefined"===typeof R||!(y instanceof L))throw y;return-y.u}},__syscall_ioctl:function(a,b,d){oc=d;try{var e=qc(a);switch(b){case 21509:case 21505:return e.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return e.tty?0:-59;case 21519:if(!e.tty)return-59;var g=pc(); +return D[g>>2]=0;case 21520:return e.tty?-28:-59;case 21531:a=g=pc();if(!e.l.Ca)throw new L(59);return e.l.Ca(e,b,a);case 21523:return e.tty?0:-59;case 21524:return e.tty?0:-59;default:t("bad ioctl syscall "+b)}}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_mkdir:function(a,b){try{return a=z(a),a=sb(a),"/"===a[a.length-1]&&(a=a.substr(0,a.length-1)),P(a,b),0}catch(d){if("undefined"===typeof R||!(d instanceof L))throw d;return-d.u}},__syscall_open:function(a, +b,d){oc=d;try{var e=z(a),g=d?pc():0;return gc(e,b,g).fd}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_readlink:function(a,b,d){try{a=z(a);if(0>=d)var e=-28;else{var g=Qb(a),h=Math.min(d,xa(g)),k=F[b+h];wa(g,b,d+1);F[b+h]=k;e=h}return e}catch(m){if("undefined"===typeof R||!(m instanceof L))throw m;return-m.u}},__syscall_rmdir:function(a){try{a=z(a);var b=O(a,{parent:!0}).node,d=ub(a),e=Hb(b,d),g=Zb(b,d,!0);if(g)throw new L(g);if(!b.h.rmdir)throw new L(63);if(e.S)throw new L(10); +b.h.rmdir(b,d);Tb(e);return 0}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},__syscall_unlink:function(a){try{a=z(a);var b=O(a,{parent:!0}).node;if(!b)throw new L(44);var d=ub(a),e=Hb(b,d),g=Zb(b,d,!1);if(g)throw new L(g);if(!b.h.unlink)throw new L(63);if(e.S)throw new L(10);b.h.unlink(b,d);Tb(e);return 0}catch(h){if("undefined"===typeof R||!(h instanceof L))throw h;return-h.u}},_embind_register_bigint:function(){},_embind_register_bool:function(a,b,d,e,g){var h=rc(d); +b=S(b);V(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,m){return m?e:g},argPackAdvance:8,readValueFromPointer:function(k){if(1===d)var m=F;else if(2===d)m=B;else if(4===d)m=D;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(m[k>>h])},H:null})},_embind_register_class:function(a,b,d,e,g,h,k,m,r,n,p,x,y){p=S(p);h=X(g,h);m&&(m=X(k,m));n&&(n=X(r,n));y=X(x,y);var l=wc(p);Nc(l,function(){gd("Cannot construct "+p+" due to unbound types",[e])});U([a, +b,d],e?[e]:[],function(u){u=u[0];if(e){var w=u.j;var C=w.K}else C=Kc.prototype;u=xc(l,function(){if(Object.getPrototypeOf(this)!==v)throw new zc("Use 'new' to construct "+p);if(void 0===E.L)throw new zc(p+" has no accessible constructor");var Yc=E.L[arguments.length];if(void 0===Yc)throw new zc("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(E.L).toString()+") parameters instead!");return Yc.apply(this,arguments)});var v=Object.create(C, +{constructor:{value:u}});u.prototype=v;var E=new Oc(p,u,v,y,w,h,m,n);w=new W(p,E,!0,!1);C=new W(p+"*",E,!1,!1);var Q=new W(p+" const*",E,!1,!0);Lc[a]={pointerType:C,xa:Q};ad(l,u);return[w,C,Q]})},_embind_register_class_class_function:function(a,b,d,e,g,h,k){var m=ld(d,e);b=S(b);h=X(g,h);U([],[a],function(r){function n(){gd("Cannot call "+p+" due to unbound types",m)}r=r[0];var p=r.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var x=r.j.constructor;void 0===x[b]?(n.P=d-1,x[b]=n):(Mc(x, +b,p),x[b].v[d-1]=n);U([],m,function(y){y=[y[0],null].concat(y.slice(1));y=kd(p,y,null,h,k);void 0===x[b].v?(y.P=d-1,x[b]=y):x[b].v[d-1]=y;return[]});return[]})},_embind_register_class_constructor:function(a,b,d,e,g,h){assert(0g)throw new TypeError('Passing a number "'+Rc(n)+'" from JS side to C/C++ side to an argument of type "'+b+'", which is outside the valid range ['+e+", "+g+"]!");}function k(n){return n}b=S(b);-1===g&&(g=4294967295);var m=rc(d);if(0===e){var r=32-8*d;k=function(n){return n<>>r}}d=b.includes("unsigned")?function(n,p){h(p,this.name);return p>>>0}:function(n,p){h(p,this.name);return p};V(a,{name:b,fromWireType:k,toWireType:d,argPackAdvance:8,readValueFromPointer:qd(b,m, +0!==e),H:null})},_embind_register_memory_view:function(a,b,d){function e(h){h>>=2;var k=G;return new g(Ja,k[h+1],k[h])}var g=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];d=S(d);V(a,{name:d,fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Ba:!0})},_embind_register_std_string:function(a,b){b=S(b);var d="std::string"===b;V(a,{name:b,fromWireType:function(e){var g=G[e>>2];if(d)for(var h=e+4,k=0;k<=g;++k){var m=e+4+k;if(k==g||0==A[m]){h=z(h, +m-h);if(void 0===r)var r=h;else r+=String.fromCharCode(0),r+=h;h=m+1}}else{r=Array(g);for(k=0;k>2]=k;if(d&&h)wa(g,m+4,k+ +1);else if(h)for(h=0;h> +2],p=k(),x,y=r+4,l=0;l<=n;++l){var u=r+4+l*b;if(l==n||0==p[u>>m])y=e(y,u-y),void 0===x?x=y:(x+=String.fromCharCode(0),x+=y),y=u+b}fd(r);return x},toWireType:function(r,n){"string"!==typeof n&&T("Cannot pass non-string to C++ string type "+d);var p=h(n),x=Ha(4+p+b);G[x>>2]=p>>m;g(n,x+4,p+b);null!==r&&r.push(fd,x);return x},argPackAdvance:8,readValueFromPointer:Vc,H:function(r){fd(r)}})},_embind_register_void:function(a,b){b=S(b);V(a,{Ta:!0,name:b,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})}, +_emval_decref:od,_emval_incref:function(a){4>2]=28,-1;D[b>>2]=a/1E3|0;D[b+4>>2]=a%1E3*1E6|0;return 0},emscripten_log:function(a,b,d){b=wd(b,d);b=ua(b,0);a&24&&(b=b.replace(/\s+$/,""), +b+=(0>>=0;assert(a>b);if(2147483648=d;d*=2){var e=b*(1+.2/d);e=Math.min(e,a+100663296);e=Math.max(a,e);0>>16);Ma();var h=1;break a}catch(k){q("emscripten_realloc_buffer: Attempted to grow heap from "+Ja.byteLength+" bytes to "+g+" bytes, but got error: "+k)}h=void 0}if(h)return!0}q("Failed to grow the heap from "+b+" bytes to "+e+" bytes, not enough memory!");return!1},emscripten_run_script:function(a){eval(z(a))},emscripten_run_script_int:function(a){return eval(z(a))|0},emscripten_run_script_string:Z,environ_get:function(a,b){var d=0;Dd().forEach(function(e, +g){var h=b+d;g=D[a+4*g>>2]=h;for(h=0;h>0]=e.charCodeAt(h);F[g>>0]=0;d+=e.length+1});return 0},environ_sizes_get:function(a,b){var d=Dd();D[a>>2]=d.length;var e=0;d.forEach(function(g){e+=g.length+1});D[b>>2]=e;return 0},fd_close:function(a){try{var b=qc(a);if(null===b.fd)throw new L(8);b.M&&(b.M=null);try{b.l.close&&b.l.close(b)}catch(d){throw d;}finally{Mb[b.fd]=null}b.fd=null;return 0}catch(d){if("undefined"===typeof R||!(d instanceof +L))throw d;return d.u}},fd_read:function(a,b,d,e){try{a:{for(var g=qc(a),h=a=0;h>2],m=g,r=D[b+8*h>>2],n=k,p=void 0,x=F;if(0>n||0>p)throw new L(28);if(null===m.fd)throw new L(8);if(1===(m.flags&2097155))throw new L(8);if(N(m.node.mode))throw new L(31);if(!m.l.read)throw new L(28);var y="undefined"!==typeof p;if(!y)p=m.position;else if(!m.seekable)throw new L(70);var l=m.l.read(m,x,r,n,p);y||(m.position+=l);var u=l;if(0>u){var w=-1;break a}a+=u;if(u>2]=w;return 0}catch(C){if("undefined"=== +typeof R||!(C instanceof L))throw C;return C.u}},fd_seek:function(a,b,d,e,g){try{var h=qc(a);a=4294967296*d+(b>>>0);if(-9007199254740992>=a||9007199254740992<=a)return-61;ic(h,a,e);K=[h.position>>>0,(J=h.position,1<=+Math.abs(J)?0>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)];D[g>>2]=K[0];D[g+4>>2]=K[1];h.M&&0===a&&0===e&&(h.M=null);return 0}catch(k){if("undefined"===typeof R||!(k instanceof L))throw k;return k.u}},fd_write:function(a,b,d, +e){try{a:{for(var g=qc(a),h=a=0;h>2],r=D[b+(8*h+4)>>2],n=void 0,p=F;if(0>r||0>n)throw new L(28);if(null===k.fd)throw new L(8);if(0===(k.flags&2097155))throw new L(8);if(N(k.node.mode))throw new L(31);if(!k.l.write)throw new L(28);k.seekable&&k.flags&1024&&ic(k,0,2);var x="undefined"!==typeof n;if(!x)n=k.position;else if(!k.seekable)throw new L(70);var y=k.l.write(k,p,m,r,n,void 0);x||(k.position+=y);var l=y;if(0>l){var u=-1;break a}a+=l}u=a}D[e>>2]=u;return 0}catch(w){if("undefined"=== +typeof R||!(w instanceof L))throw w;return w.u}},mktime:function(a){qb||(qb=!0,mb());var b=new Date(D[a+20>>2]+1900,D[a+16>>2],D[a+12>>2],D[a+8>>2],D[a+4>>2],D[a>>2],0),d=D[a+32>>2],e=b.getTimezoneOffset(),g=new Date(b.getFullYear(),0,1),h=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),k=g.getTimezoneOffset(),m=Math.min(k,h);0>d?D[a+32>>2]=Number(h!=k&&m==e):0>2]=b.getDay();D[a+28>>2]=(b.getTime()-g.getTime())/864E5| +0;D[a>>2]=b.getSeconds();D[a+4>>2]=b.getMinutes();D[a+8>>2]=b.getHours();D[a+12>>2]=b.getDate();D[a+16>>2]=b.getMonth();return b.getTime()/1E3|0},setTempRet0:function(){},strftime:Kd,strftime_l:function(a,b,d,e){return Kd(a,b,d,e)},time:function(a){var b=Date.now()/1E3|0;a&&(D[a>>2]=b);return b}}; +(function(){function a(h){c.asm=h.exports;ra=c.asm.memory;assert(ra,"memory not found in wasm exports");Ma();Oa=c.asm.__indirect_function_table;assert(Oa,"table not found in wasm exports");Va.unshift(c.asm.__wasm_call_ctors);Za--;c.monitorRunDependencies&&c.monitorRunDependencies(Za);assert(bb["wasm-instantiate"]);delete bb["wasm-instantiate"];0==Za&&(null!==$a&&(clearInterval($a),$a=null),ab&&(h=ab,ab=null,h()))}function b(h){assert(c===g,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"); +g=null;a(h.instance)}function d(h){return gb().then(function(k){return WebAssembly.instantiate(k,e)}).then(function(k){return k}).then(h,function(k){q("failed to asynchronously prepare wasm: "+k);H.startsWith("file://")&&q("warning: Loading from a file URI ("+H+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");t(k)})}var e={env:Od,wasi_snapshot_preview1:Od}; +cb();var g=c;if(c.instantiateWasm)try{return c.instantiateWasm(e,a)}catch(h){return q("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return qa||"function"!==typeof WebAssembly.instantiateStreaming||db()||H.startsWith("file://")||"function"!==typeof fetch?d(b):fetch(H,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,e).then(b,function(k){q("wasm streaming compile failed: "+k);q("falling back to ArrayBuffer instantiation");return d(b)})})})(); +return{}})();c.___wasm_call_ctors=I("__wasm_call_ctors");var xd=c._strlen=I("strlen"),Ha=c._malloc=I("malloc"),Nd=c.___errno_location=I("__errno_location"),fd=c._free=I("free"),ed=c.___getTypeName=I("__getTypeName");c.___embind_register_native_and_builtin_types=I("__embind_register_native_and_builtin_types");var pb=c.__get_tzname=I("_get_tzname"),ob=c.__get_daylight=I("_get_daylight"),nb=c.__get_timezone=I("_get_timezone");c._fflush=I("fflush");var Bd=c._emscripten_builtin_malloc=I("emscripten_builtin_malloc"); +c._emscripten_main_thread_process_queued_calls=I("emscripten_main_thread_process_queued_calls");c._setThrew=I("setThrew");c._saveSetjmp=I("saveSetjmp");var Pd=c._emscripten_stack_init=function(){return(Pd=c._emscripten_stack_init=c.asm.emscripten_stack_init).apply(null,arguments)};c._emscripten_stack_get_free=function(){return(c._emscripten_stack_get_free=c.asm.emscripten_stack_get_free).apply(null,arguments)}; +var Qa=c._emscripten_stack_get_end=function(){return(Qa=c._emscripten_stack_get_end=c.asm.emscripten_stack_get_end).apply(null,arguments)};c.stackSave=I("stackSave");c.stackRestore=I("stackRestore");c.stackAlloc=I("stackAlloc");var Ad=c._emscripten_builtin_free=I("emscripten_builtin_free");c.dynCall_jiji=I("dynCall_jiji");c.dynCall_viiiiiiji=I("dynCall_viiiiiiji");c.dynCall_viiijj=I("dynCall_viiijj");c.dynCall_viiiiiijjiii=I("dynCall_viiiiiijjiii");c.dynCall_iiiijjii=I("dynCall_iiiijjii"); +c.dynCall_viijii=I("dynCall_viijii");c.dynCall_iiiiij=I("dynCall_iiiiij");c.dynCall_iiiiijj=I("dynCall_iiiiijj");c.dynCall_iiiiiijj=I("dynCall_iiiiiijj");Object.getOwnPropertyDescriptor(c,"intArrayFromString")||(c.intArrayFromString=function(){t("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"intArrayToString")||(c.intArrayToString=function(){t("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ccall")||(c.ccall=function(){t("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"cwrap")||(c.cwrap=function(){t("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setValue")||(c.setValue=function(){t("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getValue")||(c.getValue=function(){t("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocate")||(c.allocate=function(){t("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF8ArrayToString")||(c.UTF8ArrayToString=function(){t("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"UTF8ToString")||(c.UTF8ToString=function(){t("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8Array")||(c.stringToUTF8Array=function(){t("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF8")||(c.stringToUTF8=function(){t("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF8")||(c.lengthBytesUTF8=function(){t("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){t("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreRun")||(c.addOnPreRun=function(){t("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"addOnInit")||(c.addOnInit=function(){t("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnPreMain")||(c.addOnPreMain=function(){t("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addOnExit")||(c.addOnExit=function(){t("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"addOnPostRun")||(c.addOnPostRun=function(){t("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeStringToMemory")||(c.writeStringToMemory=function(){t("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeArrayToMemory")||(c.writeArrayToMemory=function(){t("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeAsciiToMemory")||(c.writeAsciiToMemory=function(){t("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addRunDependency")||(c.addRunDependency=function(){t("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"removeRunDependency")||(c.removeRunDependency=function(){t("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createFolder")||(c.FS_createFolder=function(){t("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"FS_createPath")||(c.FS_createPath=function(){t("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createDataFile")||(c.FS_createDataFile=function(){t("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"FS_createPreloadedFile")||(c.FS_createPreloadedFile=function(){t("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_createLazyFile")||(c.FS_createLazyFile=function(){t("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"FS_createLink")||(c.FS_createLink=function(){t("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"FS_createDevice")||(c.FS_createDevice=function(){t("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")});Object.getOwnPropertyDescriptor(c,"FS_unlink")||(c.FS_unlink=function(){t("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}); +Object.getOwnPropertyDescriptor(c,"getLEB")||(c.getLEB=function(){t("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getFunctionTables")||(c.getFunctionTables=function(){t("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"alignFunctionTables")||(c.alignFunctionTables=function(){t("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerFunctions")||(c.registerFunctions=function(){t("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"addFunction")||(c.addFunction=function(){t("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"removeFunction")||(c.removeFunction=function(){t("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){t("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"prettyPrint")||(c.prettyPrint=function(){t("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){t("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getCompilerSetting")||(c.getCompilerSetting=function(){t("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"print")||(c.print=function(){t("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"printErr")||(c.printErr=function(){t("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getTempRet0")||(c.getTempRet0=function(){t("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setTempRet0")||(c.setTempRet0=function(){t("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callMain")||(c.callMain=function(){t("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"abort")||(c.abort=function(){t("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"keepRuntimeAlive")||(c.keepRuntimeAlive=function(){t("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"zeroMemory")||(c.zeroMemory=function(){t("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToNewUTF8")||(c.stringToNewUTF8=function(){t("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setFileTime")||(c.setFileTime=function(){t("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscripten_realloc_buffer")||(c.emscripten_realloc_buffer=function(){t("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ENV")||(c.ENV=function(){t("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"withStackSave")||(c.withStackSave=function(){t("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ERRNO_CODES")||(c.ERRNO_CODES=function(){t("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ERRNO_MESSAGES")||(c.ERRNO_MESSAGES=function(){t("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setErrNo")||(c.setErrNo=function(){t("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton4")||(c.inetPton4=function(){t("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"inetNtop4")||(c.inetNtop4=function(){t("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetPton6")||(c.inetPton6=function(){t("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"inetNtop6")||(c.inetNtop6=function(){t("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"readSockaddr")||(c.readSockaddr=function(){t("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeSockaddr")||(c.writeSockaddr=function(){t("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"DNS")||(c.DNS=function(){t("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getHostByName")||(c.getHostByName=function(){t("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GAI_ERRNO_MESSAGES")||(c.GAI_ERRNO_MESSAGES=function(){t("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Protocols")||(c.Protocols=function(){t("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"Sockets")||(c.Sockets=function(){t("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getRandomDevice")||(c.getRandomDevice=function(){t("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"traverseStack")||(c.traverseStack=function(){t("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"convertFrameToPC")||(c.convertFrameToPC=function(){t("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UNWIND_CACHE")||(c.UNWIND_CACHE=function(){t("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"saveInUnwindCache")||(c.saveInUnwindCache=function(){t("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"convertPCtoSourceLocation")||(c.convertPCtoSourceLocation=function(){t("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgsArray")||(c.readAsmConstArgsArray=function(){t("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readAsmConstArgs")||(c.readAsmConstArgs=function(){t("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"mainThreadEM_ASM")||(c.mainThreadEM_ASM=function(){t("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_q")||(c.jstoi_q=function(){t("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jstoi_s")||(c.jstoi_s=function(){t("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getExecutableName")||(c.getExecutableName=function(){t("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"listenOnce")||(c.listenOnce=function(){t("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"autoResumeAudioContext")||(c.autoResumeAudioContext=function(){t("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"dynCallLegacy")||(c.dynCallLegacy=function(){t("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getDynCaller")||(c.getDynCaller=function(){t("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"dynCall")||(c.dynCall=function(){t("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"callRuntimeCallbacks")||(c.callRuntimeCallbacks=function(){t("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"wasmTableMirror")||(c.wasmTableMirror=function(){t("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setWasmTableEntry")||(c.setWasmTableEntry=function(){t("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getWasmTableEntry")||(c.getWasmTableEntry=function(){t("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"handleException")||(c.handleException=function(){t("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePush")||(c.runtimeKeepalivePush=function(){t("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"runtimeKeepalivePop")||(c.runtimeKeepalivePop=function(){t("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"callUserCallback")||(c.callUserCallback=function(){t("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeExit")||(c.maybeExit=function(){t("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"safeSetTimeout")||(c.safeSetTimeout=function(){t("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asmjsMangle")||(c.asmjsMangle=function(){t("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"asyncLoad")||(c.asyncLoad=function(){t("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"alignMemory")||(c.alignMemory=function(){t("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"mmapAlloc")||(c.mmapAlloc=function(){t("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reallyNegative")||(c.reallyNegative=function(){t("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"unSign")||(c.unSign=function(){t("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"reSign")||(c.reSign=function(){t("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"formatString")||(c.formatString=function(){t("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"PATH")||(c.PATH=function(){t("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PATH_FS")||(c.PATH_FS=function(){t("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SYSCALLS")||(c.SYSCALLS=function(){t("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"syscallMmap2")||(c.syscallMmap2=function(){t("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"syscallMunmap")||(c.syscallMunmap=function(){t("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getSocketFromFD")||(c.getSocketFromFD=function(){t("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getSocketAddress")||(c.getSocketAddress=function(){t("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"JSEvents")||(c.JSEvents=function(){t("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerKeyEventCallback")||(c.registerKeyEventCallback=function(){t("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"specialHTMLTargets")||(c.specialHTMLTargets=function(){t("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"maybeCStringToJsString")||(c.maybeCStringToJsString=function(){t("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"findEventTarget")||(c.findEventTarget=function(){t("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"findCanvasEventTarget")||(c.findCanvasEventTarget=function(){t("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getBoundingClientRect")||(c.getBoundingClientRect=function(){t("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillMouseEventData")||(c.fillMouseEventData=function(){t("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerMouseEventCallback")||(c.registerMouseEventCallback=function(){t("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerWheelEventCallback")||(c.registerWheelEventCallback=function(){t("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerUiEventCallback")||(c.registerUiEventCallback=function(){t("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerFocusEventCallback")||(c.registerFocusEventCallback=function(){t("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillDeviceOrientationEventData")||(c.fillDeviceOrientationEventData=function(){t("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceOrientationEventCallback")||(c.registerDeviceOrientationEventCallback=function(){t("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillDeviceMotionEventData")||(c.fillDeviceMotionEventData=function(){t("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerDeviceMotionEventCallback")||(c.registerDeviceMotionEventCallback=function(){t("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"screenOrientation")||(c.screenOrientation=function(){t("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillOrientationChangeEventData")||(c.fillOrientationChangeEventData=function(){t("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerOrientationChangeEventCallback")||(c.registerOrientationChangeEventCallback=function(){t("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillFullscreenChangeEventData")||(c.fillFullscreenChangeEventData=function(){t("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerFullscreenChangeEventCallback")||(c.registerFullscreenChangeEventCallback=function(){t("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerRestoreOldStyle")||(c.registerRestoreOldStyle=function(){t("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"hideEverythingExceptGivenElement")||(c.hideEverythingExceptGivenElement=function(){t("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreHiddenElements")||(c.restoreHiddenElements=function(){t("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setLetterbox")||(c.setLetterbox=function(){t("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"currentFullscreenStrategy")||(c.currentFullscreenStrategy=function(){t("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"restoreOldWindowedStyle")||(c.restoreOldWindowedStyle=function(){t("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"softFullscreenResizeWebGLRenderTarget")||(c.softFullscreenResizeWebGLRenderTarget=function(){t("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"doRequestFullscreen")||(c.doRequestFullscreen=function(){t("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillPointerlockChangeEventData")||(c.fillPointerlockChangeEventData=function(){t("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerPointerlockChangeEventCallback")||(c.registerPointerlockChangeEventCallback=function(){t("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerPointerlockErrorEventCallback")||(c.registerPointerlockErrorEventCallback=function(){t("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requestPointerLock")||(c.requestPointerLock=function(){t("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"fillVisibilityChangeEventData")||(c.fillVisibilityChangeEventData=function(){t("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerVisibilityChangeEventCallback")||(c.registerVisibilityChangeEventCallback=function(){t("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerTouchEventCallback")||(c.registerTouchEventCallback=function(){t("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillGamepadEventData")||(c.fillGamepadEventData=function(){t("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerGamepadEventCallback")||(c.registerGamepadEventCallback=function(){t("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerBeforeUnloadEventCallback")||(c.registerBeforeUnloadEventCallback=function(){t("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"fillBatteryEventData")||(c.fillBatteryEventData=function(){t("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"battery")||(c.battery=function(){t("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registerBatteryEventCallback")||(c.registerBatteryEventCallback=function(){t("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setCanvasElementSize")||(c.setCanvasElementSize=function(){t("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getCanvasElementSize")||(c.getCanvasElementSize=function(){t("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"demangle")||(c.demangle=function(){t("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"demangleAll")||(c.demangleAll=function(){t("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"jsStackTrace")||(c.jsStackTrace=function(){t("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stackTrace")||(c.stackTrace=function(){t("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getEnvStrings")||(c.getEnvStrings=function(){t("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"checkWasiClock")||(c.checkWasiClock=function(){t("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeI53ToI64")||(c.writeI53ToI64=function(){t("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Clamped")||(c.writeI53ToI64Clamped=function(){t("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToI64Signaling")||(c.writeI53ToI64Signaling=function(){t("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"writeI53ToU64Clamped")||(c.writeI53ToU64Clamped=function(){t("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeI53ToU64Signaling")||(c.writeI53ToU64Signaling=function(){t("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readI53FromI64")||(c.readI53FromI64=function(){t("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"readI53FromU64")||(c.readI53FromU64=function(){t("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertI32PairToI53")||(c.convertI32PairToI53=function(){t("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"convertU32PairToI53")||(c.convertU32PairToI53=function(){t("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"setImmediateWrapped")||(c.setImmediateWrapped=function(){t("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"clearImmediateWrapped")||(c.clearImmediateWrapped=function(){t("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"polyfillSetImmediate")||(c.polyfillSetImmediate=function(){t("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"uncaughtExceptionCount")||(c.uncaughtExceptionCount=function(){t("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionLast")||(c.exceptionLast=function(){t("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exceptionCaught")||(c.exceptionCaught=function(){t("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ExceptionInfo")||(c.ExceptionInfo=function(){t("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"CatchInfo")||(c.CatchInfo=function(){t("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exception_addRef")||(c.exception_addRef=function(){t("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"exception_decRef")||(c.exception_decRef=function(){t("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Browser")||(c.Browser=function(){t("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"funcWrappers")||(c.funcWrappers=function(){t("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getFuncWrapper")||(c.getFuncWrapper=function(){t("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setMainLoop")||(c.setMainLoop=function(){t("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"wget")||(c.wget=function(){t("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"FS")||(c.FS=function(){t("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"MEMFS")||(c.MEMFS=function(){t("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"TTY")||(c.TTY=function(){t("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PIPEFS")||(c.PIPEFS=function(){t("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"SOCKFS")||(c.SOCKFS=function(){t("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"_setNetworkCallback")||(c._setNetworkCallback=function(){t("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"tempFixedLengthArray")||(c.tempFixedLengthArray=function(){t("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"miniTempWebGLFloatBuffers")||(c.miniTempWebGLFloatBuffers=function(){t("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapObjectForWebGLType")||(c.heapObjectForWebGLType=function(){t("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heapAccessShiftForWebGLHeap")||(c.heapAccessShiftForWebGLHeap=function(){t("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GL")||(c.GL=function(){t("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGet")||(c.emscriptenWebGLGet=function(){t("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"computeUnpackAlignedImageSize")||(c.computeUnpackAlignedImageSize=function(){t("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetTexPixelData")||(c.emscriptenWebGLGetTexPixelData=function(){t("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetUniform")||(c.emscriptenWebGLGetUniform=function(){t("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"webglGetUniformLocation")||(c.webglGetUniformLocation=function(){t("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"webglPrepareUniformLocationsBeforeFirstUse")||(c.webglPrepareUniformLocationsBeforeFirstUse=function(){t("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"webglGetLeftBracePos")||(c.webglGetLeftBracePos=function(){t("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emscriptenWebGLGetVertexAttrib")||(c.emscriptenWebGLGetVertexAttrib=function(){t("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"writeGLArray")||(c.writeGLArray=function(){t("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"AL")||(c.AL=function(){t("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_unicode")||(c.SDL_unicode=function(){t("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_ttfContext")||(c.SDL_ttfContext=function(){t("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"SDL_audio")||(c.SDL_audio=function(){t("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL")||(c.SDL=function(){t("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"SDL_gfx")||(c.SDL_gfx=function(){t("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GLUT")||(c.GLUT=function(){t("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"EGL")||(c.EGL=function(){t("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW_Window")||(c.GLFW_Window=function(){t("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"GLFW")||(c.GLFW=function(){t("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"GLEW")||(c.GLEW=function(){t("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"IDBStore")||(c.IDBStore=function(){t("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runAndAbortIfError")||(c.runAndAbortIfError=function(){t("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emval_handle_array")||(c.emval_handle_array=function(){t("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_free_list")||(c.emval_free_list=function(){t("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_symbols")||(c.emval_symbols=function(){t("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"init_emval")||(c.init_emval=function(){t("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"count_emval_handles")||(c.count_emval_handles=function(){t("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"get_first_emval")||(c.get_first_emval=function(){t("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getStringOrSymbol")||(c.getStringOrSymbol=function(){t("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"Emval")||(c.Emval=function(){t("'Emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_newers")||(c.emval_newers=function(){t("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"craftEmvalAllocator")||(c.craftEmvalAllocator=function(){t("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_get_global")||(c.emval_get_global=function(){t("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"emval_methodCallers")||(c.emval_methodCallers=function(){t("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"emval_registeredMethods")||(c.emval_registeredMethods=function(){t("'emval_registeredMethods' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"InternalError")||(c.InternalError=function(){t("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"BindingError")||(c.BindingError=function(){t("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"UnboundTypeError")||(c.UnboundTypeError=function(){t("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"PureVirtualError")||(c.PureVirtualError=function(){t("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_embind")||(c.init_embind=function(){t("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"throwInternalError")||(c.throwInternalError=function(){t("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwBindingError")||(c.throwBindingError=function(){t("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwUnboundTypeError")||(c.throwUnboundTypeError=function(){t("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ensureOverloadTable")||(c.ensureOverloadTable=function(){t("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"exposePublicSymbol")||(c.exposePublicSymbol=function(){t("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"replacePublicSymbol")||(c.replacePublicSymbol=function(){t("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"extendError")||(c.extendError=function(){t("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"createNamedFunction")||(c.createNamedFunction=function(){t("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registeredInstances")||(c.registeredInstances=function(){t("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getBasestPointer")||(c.getBasestPointer=function(){t("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerInheritedInstance")||(c.registerInheritedInstance=function(){t("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"unregisterInheritedInstance")||(c.unregisterInheritedInstance=function(){t("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getInheritedInstance")||(c.getInheritedInstance=function(){t("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getInheritedInstanceCount")||(c.getInheritedInstanceCount=function(){t("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"getLiveInheritedInstances")||(c.getLiveInheritedInstances=function(){t("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registeredTypes")||(c.registeredTypes=function(){t("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"awaitingDependencies")||(c.awaitingDependencies=function(){t("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"typeDependencies")||(c.typeDependencies=function(){t("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"registeredPointers")||(c.registeredPointers=function(){t("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"registerType")||(c.registerType=function(){t("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"whenDependentTypesAreResolved")||(c.whenDependentTypesAreResolved=function(){t("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"embind_charCodes")||(c.embind_charCodes=function(){t("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind_init_charCodes")||(c.embind_init_charCodes=function(){t("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"readLatin1String")||(c.readLatin1String=function(){t("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getTypeName")||(c.getTypeName=function(){t("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"heap32VectorToArray")||(c.heap32VectorToArray=function(){t("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"requireRegisteredType")||(c.requireRegisteredType=function(){t("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"getShiftFromSize")||(c.getShiftFromSize=function(){t("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"integerReadValueFromPointer")||(c.integerReadValueFromPointer=function(){t("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"enumReadValueFromPointer")||(c.enumReadValueFromPointer=function(){t("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"floatReadValueFromPointer")||(c.floatReadValueFromPointer=function(){t("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"simpleReadValueFromPointer")||(c.simpleReadValueFromPointer=function(){t("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructors")||(c.runDestructors=function(){t("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"new_")||(c.new_=function(){t("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"craftInvokerFunction")||(c.craftInvokerFunction=function(){t("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"embind__requireFunction")||(c.embind__requireFunction=function(){t("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"tupleRegistrations")||(c.tupleRegistrations=function(){t("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"structRegistrations")||(c.structRegistrations=function(){t("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"genericPointerToWireType")||(c.genericPointerToWireType=function(){t("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"constNoSmartPtrRawPointerToWireType")||(c.constNoSmartPtrRawPointerToWireType=function(){t("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"nonConstNoSmartPtrRawPointerToWireType")||(c.nonConstNoSmartPtrRawPointerToWireType=function(){t("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"init_RegisteredPointer")||(c.init_RegisteredPointer=function(){t("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer")||(c.RegisteredPointer=function(){t("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_getPointee")||(c.RegisteredPointer_getPointee=function(){t("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"RegisteredPointer_destructor")||(c.RegisteredPointer_destructor=function(){t("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredPointer_deleteObject")||(c.RegisteredPointer_deleteObject=function(){t("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"RegisteredPointer_fromWireType")||(c.RegisteredPointer_fromWireType=function(){t("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"runDestructor")||(c.runDestructor=function(){t("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"releaseClassHandle")||(c.releaseClassHandle=function(){t("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"finalizationGroup")||(c.finalizationGroup=function(){t("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer_deps")||(c.detachFinalizer_deps=function(){t("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"detachFinalizer")||(c.detachFinalizer=function(){t("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"attachFinalizer")||(c.attachFinalizer=function(){t("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"makeClassHandle")||(c.makeClassHandle=function(){t("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"init_ClassHandle")||(c.init_ClassHandle=function(){t("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle")||(c.ClassHandle=function(){t("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_isAliasOf")||(c.ClassHandle_isAliasOf=function(){t("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"throwInstanceAlreadyDeleted")||(c.throwInstanceAlreadyDeleted=function(){t("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle_clone")||(c.ClassHandle_clone=function(){t("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_delete")||(c.ClassHandle_delete=function(){t("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"deletionQueue")||(c.deletionQueue=function(){t("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"ClassHandle_isDeleted")||(c.ClassHandle_isDeleted=function(){t("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"ClassHandle_deleteLater")||(c.ClassHandle_deleteLater=function(){t("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"flushPendingDeletes")||(c.flushPendingDeletes=function(){t("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"delayFunction")||(c.delayFunction=function(){t("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"setDelayFunction")||(c.setDelayFunction=function(){t("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"RegisteredClass")||(c.RegisteredClass=function(){t("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"shallowCopyInternalPointer")||(c.shallowCopyInternalPointer=function(){t("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"downcastPointer")||(c.downcastPointer=function(){t("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"upcastPointer")||(c.upcastPointer=function(){t("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"validateThis")||(c.validateThis=function(){t("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_0")||(c.char_0=function(){t("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"char_9")||(c.char_9=function(){t("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"makeLegalFunctionName")||(c.makeLegalFunctionName=function(){t("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"warnOnce")||(c.warnOnce=function(){t("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackSave")||(c.stackSave=function(){t("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stackRestore")||(c.stackRestore=function(){t("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stackAlloc")||(c.stackAlloc=function(){t("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"AsciiToString")||(c.AsciiToString=function(){t("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"stringToAscii")||(c.stringToAscii=function(){t("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF16ToString")||(c.UTF16ToString=function(){t("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF16")||(c.stringToUTF16=function(){t("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF16")||(c.lengthBytesUTF16=function(){t("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"UTF32ToString")||(c.UTF32ToString=function(){t("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"stringToUTF32")||(c.stringToUTF32=function(){t("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +Object.getOwnPropertyDescriptor(c,"lengthBytesUTF32")||(c.lengthBytesUTF32=function(){t("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8")||(c.allocateUTF8=function(){t("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")});Object.getOwnPropertyDescriptor(c,"allocateUTF8OnStack")||(c.allocateUTF8OnStack=function(){t("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}); +c.writeStackCookie=Pa;c.checkStackCookie=Ra;Object.getOwnPropertyDescriptor(c,"ALLOC_NORMAL")||Object.defineProperty(c,"ALLOC_NORMAL",{configurable:!0,get:function(){t("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});Object.getOwnPropertyDescriptor(c,"ALLOC_STACK")||Object.defineProperty(c,"ALLOC_STACK",{configurable:!0,get:function(){t("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}});var Qd; +ab=function Rd(){Qd||Sd();Qd||(ab=Rd)}; +function Sd(){function a(){if(!Qd&&(Qd=!0,c.calledRun=!0,!sa)){Ra();assert(!Xa);Xa=!0;if(!c.noFSInit&&!kc){assert(!kc,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)");kc=!0;jc();c.stdin=c.stdin;c.stdout=c.stdout;c.stderr=c.stderr;c.stdin?mc("stdin",c.stdin):fc("/dev/tty","/dev/stdin");c.stdout?mc("stdout",null,c.stdout):fc("/dev/tty","/dev/stdout");c.stderr?mc("stderr",null, +c.stderr):fc("/dev/tty1","/dev/stderr");var b=gc("/dev/stdin",0),d=gc("/dev/stdout",1),e=gc("/dev/stderr",1);assert(0===b.fd,"invalid handle for stdin ("+b.fd+")");assert(1===d.fd,"invalid handle for stdout ("+d.fd+")");assert(2===e.fd,"invalid handle for stderr ("+e.fd+")")}Pb=!1;hb(Va);if(c.onRuntimeInitialized)c.onRuntimeInitialized();assert(!c._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');Ra();if(c.postRun)for("function"==typeof c.postRun&& +(c.postRun=[c.postRun]);c.postRun.length;)b=c.postRun.shift(),Wa.unshift(b);hb(Wa)}}if(!(0f&&(f=Math.max(f+A,0));f{const a=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name);a&&(global.self=global);var b;a&&(b=require("worker_threads"));let f=a?b.parentPort:self,v,A,D,W=!1,N,ba,R,S,C,ca=0,T=0;const ya=(a,b)=>{b>ca&&(T&&Module._free(T),T=Module._malloc(b),ca=b);Module.HEAPU8.set(a.subarray(0,b),T)};let ma,za=new Promise(a=>{ma=a}),ra=!1,Aa=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(ra)throw"can't load wasm twice";ra=!0;I("wasm loading..."); N=Date.now();yield new Promise(b=>{self.KModule=self.Module={locateFile:function(b){return"libDynamsoftBarcodeReader.wasm"==b?a?A+"dbr-"+D+".node.wasm":A+"dbr-"+D+(W?".full":"")+".wasm":A+b},print:a=>{I(a)},printErr:a=>{console.error(a);I(a)},onRuntimeInitialized:function(){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){I("wasm initialized, cost "+(Date.now()-N)+" ms");a||(Module=KModule);ma();b()})}};if(a){let a=Module;Module=require("./dbr-"+D+".node.wasm.js");for(let b in a)Module[b]= -a[b]}else importScripts(A+"dbr-"+D+(W?".full":"")+".wasm.js")})}),ea=a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield za;R=a.trial;S=a.msg;Module.BarcodeReaderWasm.init(JSON.stringify(a))}),Ba=()=>Module.BarcodeReaderWasm.getMinExpireTime(),Va=()=>Module.BarcodeReaderWasm.getMaxExpireTime(),y=new Map,Wa=0;b=function(b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){const m=b.data?b.data:b;var q=m.id,w=m.instanceID,n=m.body;!ba||"decodeBuffer"!=m.type&&"decodeFileInMemory"!= -m.type||(yield C.c());switch(m.type){case "loadWasm":try{v=m.bd;A=m.engineResourcePath;W=m.bUseFullFeature;D=m.version;let a=m.dm,b=m.lcs;ba=m.brtk;let n=m.bptk;Aa();let w;q=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){try{C=(a=>{const b=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name);let e=a.dwt?Dynamsoft.Lib.Promise:self.Promise,f=a.btoa||(b?global.btoa||(a=>Buffer.from(a,"binary").toString("base64")):self.btoa),h=a.atob||(b?global.atob|| -(a=>Buffer.from(a,"base64").toString("binary")):self.atob),q,n=a.product,w,v,m,y,A,G,p,D,ja,J=["https://mlts.dynamsoft.com/","https://slts.dynamsoft.com/"],C,U,I,F,W,E,T=!1,N=e.resolve(),X=a.lf,V,H,K,fa,ba=a.log||(()=>{}),Y=a.dwt?t=>{try{a.debugLog&&a.debugLog(t)}catch(l){}}:a.debugLog||(()=>{}),M=a.fol,ca,da,R,S=a.sutlcb;Date.prototype.kUtilFormat=function(a){var t={"M+":this.getUTCMonth()+1,"d+":this.getUTCDate(),"H+":this.getUTCHours(),"h+":this.getUTCHours()%12||12,"m+":this.getUTCMinutes(),"s+":this.getUTCSeconds(), +a[b]}else importScripts(A+"dbr-"+D+(W?".full":"")+".wasm.js")})}),ea=a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield za;R=a.trial;S=a.msg;Module.BarcodeReaderWasm.init(JSON.stringify(a))}),Ba=()=>Module.BarcodeReaderWasm.getMinExpireTime(),Va=()=>Module.BarcodeReaderWasm.getMaxExpireTime(),y=new Map,Wa=0;b=function(b){return $jscomp.asyncExecutePromiseGeneratorFunction(function*(){const n=b.data?b.data:b;var q=n.id,w=n.instanceID,m=n.body;!ba||"decodeBuffer"!=n.type&&"decodeFileInMemory"!= +n.type||(yield C.c());switch(n.type){case "loadWasm":try{v=n.bd;A=n.engineResourcePath;W=n.bUseFullFeature;D=n.version;let a=n.dm,b=n.lcs;ba=n.brtk;let m=n.bptk;Aa();let w;q=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){try{C=(a=>{const b=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name);let e=a.dwt?Dynamsoft.Lib.Promise:self.Promise,f=a.btoa||(b?global.btoa||(a=>Buffer.from(a,"binary").toString("base64")):self.btoa),h=a.atob||(b?global.atob|| +(a=>Buffer.from(a,"base64").toString("binary")):self.atob),q,m=a.product,w,v,n,y,A,G,p,D,ja,J=["https://mlts.dynamsoft.com/","https://slts.dynamsoft.com/"],C,U,I,F,W,E,T=!1,N=e.resolve(),X=a.lf,V,H,K,fa,ba=a.log||(()=>{}),Y=a.dwt?t=>{try{a.debugLog&&a.debugLog(t)}catch(l){}}:a.debugLog||(()=>{}),M=a.fol,ca,da,R,S=a.sutlcb;Date.prototype.kUtilFormat=function(a){var t={"M+":this.getUTCMonth()+1,"d+":this.getUTCDate(),"H+":this.getUTCHours(),"h+":this.getUTCHours()%12||12,"m+":this.getUTCMinutes(),"s+":this.getUTCSeconds(), "q+":Math.floor((this.getUTCMonth()+3)/3),"S+":this.getUTCMilliseconds()};/(y+)/.test(a)&&(a=a.replace(RegExp.$1,(this.getUTCFullYear()+"").substr(4-RegExp.$1.length)));for(var b in t)(new RegExp("("+b+")")).test(a)&&(a=a.replace(RegExp.$1,1==RegExp.$1.length?t[b]:("000"+t[b]).substr(("000"+t[b]).length-RegExp.$1.length)));return a};let ha,z=a=>a.join("");var la=[80,88,27,82,145,164,199,211],ma=[187,87,89,128,150,44,190,213],O=[89,51,74,53,99,72,82,118],ra=[99,181,118,158,215,103,76,117],Z=[99,51, 86,105,100,71,120,108],Ca=[97,87,49,119,98,51,74,48,83,50,86,53],Da=[81,85,86,84,76,85,100,68,84,81,32,32],ea=[90,87,53,106,99,110,108,119,100,65,32,32],aa=[90,71,86,106,99,110,108,119,100,65,32,32],La=[97,88,89,32],ya=[29,83,122,137,5,180,157,114],Ma=[100,71,70,110,84,71,86,117,90,51,82,111];let Na=()=>self[z(O)][z(Z)][z(Ca)]("raw",new Uint8Array(la.concat(ma,ra,ya)),z(Da),!0,[z(ea),z(aa)]),Oa=a.fdaa||(a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(self[z(O)]&&self[z(O)][z(Z)]&&self[z(O)][z(Z)][z(Ca)]){var b= h(a),t=new Uint8Array(b.length);for(let a=0;a$jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(self[z(O)]&&self[z(O)][z(Z)]&&self[z(O)][z(Z)][z(Ca)]){var b=new Uint8Array(a.length);for(var t=0;th(h(a.replace(/\n/g,"+").replace(/\s/g,"=")).substring(1)),Fa=a=>f(String.fromCharCode(97+25*Math.random())+f(a)).replace(/\+/g,"\n").replace(/=/g," "),L,Qa=()=>{if(L)return L;if(self.crypto){let a=new Uint8Array(36);self.crypto.getRandomValues(a);let b="";for(let t= 0;36>t;++t){let e=a[t]%36;b=10>e?b+e:b+String.fromCharCode(e+87)}return b}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)})},za=()=>{X||self.localforage||(b?(global.localforage=require("node-localstorage").LocalStorage,global.localforage.prototype.keys=function(){let a=[];for(let b=0;b=c.oldVersion&&d.createObjectStore(R)}catch(Q){if("ConstraintError"!==Q.name)throw Q;console.warn('The database "'+a.name+'" has been upgraded from version '+c.oldVersion+" to version "+c.newVersion+', but the storage "'+a.storeName+ '" already exists.')}});k.onerror=function(a){a.preventDefault();b(k.error)};k.onsuccess=function(){c(k.result);w(a)}})}function G(a,d){if(!a.db)return!0;var c=!a.db.objectStoreNames.contains(a.storeName),b=a.version>a.db.version;return(a.versiona.version&&(a.version=d)),!0):!1}function D(a){return new u(function(c, -g){var d=new FileReader;d.onerror=g;d.onloadend=function(d){d=f(d.target.result||"");c({__local_forage_encoded_blob:!0,data:d,type:a.type})};d.readAsBinaryString(a)})}function ja(a){for(var c=h(a.data),g=c.length,b=new ArrayBuffer(g),B=new Uint8Array(b),k=0;k>4;k[x++]=(15&pa)<<4|Q>>2;k[x++]=(3&Q)<<6|63&f}return B}function H(a){var c=new Uint8Array(a),b="";for(a=0;a>2],b+=ia[(3&c[a])<<4|c[a+1]>>4],b+=ia[(15&c[a+1])<<2|c[a+2]>>6],b+=ia[63&c[a+2]];return 2==c.length%3?b=b.substring(0,b.length-1)+"=":1==c.length%3&&(b=b.substring(0,b.length-2)+"=="),b}function U(a,b,g,x){a.executeSql("CREATE TABLE IF NOT EXISTS "+b.storeName+" (id INTEGER PRIMARY KEY, key unique, value)", @@ -66,14 +66,14 @@ d=c.forages;b.close();for(b=0;b$jscomp.asyncExecutePromiseGeneratorFunction(function*(){za(); -b&&(global.fetch=global.fetch||require("node-fetch"),global.crypto=global.crypto||require("crypto").webcrypto);z=a=>h(String.fromCharCode.apply(null,a).replace(/\n/g,"+").replace(/\s/g,"="));try{yield(yield X.createInstance({name:n+"jshello"})).setItem(n+"jshello","available")}catch(t){throw t&&"No available storage method found."===t.message&&(t=Error("Failed to access indexedDB. Our SDK stores the client's UUID in the browser's indexedDB for licensing purposes. Please make sure you are not in the private browsing mode or allow cookies in Browser Settings > Site Settings > Cookies.")), -t;}H=yield X.createInstance({name:"dynamltsinfo"});K=L?null:f(f("v2")+String.fromCharCode(G.charCodeAt(G.length/2)+1)+f(G));fa=f(String.fromCharCode(m.charCodeAt(0)+10)+f(n)+f(m)+v+f(""+A));if(!L){try{let a=yield H.getItem(K);a&&([p,F]=JSON.parse(yield Ea(a)))}catch(t){}try{null==p&&(p=Qa())}catch(t){}}V=yield X.createInstance({name:"dynamltsuns"+f(String.fromCharCode(m.charCodeAt(0)+10)+f(n)+f(m)+v+f(""+A))});try{y=yield H.getItem(fa)}catch(t){}}),ta,ua=t=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){ta|| -(ta=(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){try{let a={pd:n,vm:v,dt:A||(b?"server":"browser"),ed:"javascript",cu:p,ad:G,os:JSON.stringify(D),fn:ja};m&&(a=-1!=m.indexOf("-")?Object.assign({},a,{hs:m}):Object.assign({},a,{og:m}));let h={};if(F&&!L){let a=yield H.getItem(K);a&&([p,F]=JSON.parse(yield Ea(a)));h["lts-time"]=F}C&&(a.sp=C);U&&(a.lm=U);I&&(a.cw=I);y=yield e.race([(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"); -F&&!L&&(H.setItem(K,yield Fa(JSON.stringify([p,b]))),F=b);let l;var r="auth/?ext="+encodeURIComponent(f(JSON.stringify(a)));let n=!1,q=!1,v,w=a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(a&&!a.ok)try{let b=yield a.text();if(b){let a=JSON.parse(b);a.errorCode&&(v=a,100a.errorCode&&(y=null,q=n=!0))}}catch($a){}});try{l=yield e.race([fetch(J[0]+r,{headers:h,cache:t?"reload":"default",mode:"cors",timeout:1E4}),new e((a,b)=>{setTimeout(b,1E4)})]),yield w(l)}catch(Ga){}if(!(F|| -l&&l.ok||n))try{l=yield fetch(J[1]+r,{headers:h,mode:"cors",timeout:3E4}),yield w(l)}catch(Ga){}if(!(F||l&&l.ok||n))try{l=yield fetch(J[0]+r,{headers:h,mode:"cors",timeout:3E4}),yield w(l)}catch(Ga){}v&&151==v.errorCode&&(L||H.removeItem(K),H.removeItem(fa),p=Qa(),a.cu=p,F=void 0,r=encodeURIComponent(f(JSON.stringify(a))),l=yield fetch(J[0]+"auth/?ext="+r,{headers:h,mode:"cors",timeout:3E4}),yield w(l));(()=>{if(!l||!l.ok){q&&H.setItem(fa,"");if(v)if(111==v.errorCode)var a=v.message;else a=v.message.trim(), -a.endsWith(".")||(a+="."),a=m?`An error occurred during authorization: ${a} Contact the site administrator for more information.`:`An error occurred during authorization: ${a} [Contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.`;else a=m?"Failed to connect to the License Tracking Server: network connection error. Check your Internet connection or contact the site administrator for more information.":"Failed to connect to the License Tracking Server: network connection error. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information."; -a=Error(a);v&&v.errorCode&&(a.ltsErrorCode=v.errorCode);throw a;}})();r=yield l.text();try{F||L||(H.setItem(K,yield Fa(JSON.stringify([p,b]))),F=b),H.setItem(fa,r)}catch(Ga){}fetch(J[0]+"verify",{mode:"cors",method:"POST",headers:{"Content-Type":"application/json","lts-time":"options"},body:"[]",timeout:3E4});return r}))(),new e((a,b)=>{let e;e=m?"Failed to connect to the License Tracking Server: network timed out. Check your Internet connection or contact the site administrator for more information.": +b&&(global.fetch=global.fetch||require("node-fetch"),global.crypto=global.crypto||require("crypto").webcrypto);z=a=>h(String.fromCharCode.apply(null,a).replace(/\n/g,"+").replace(/\s/g,"="));try{yield(yield X.createInstance({name:m+"jshello"})).setItem(m+"jshello","available")}catch(t){throw t&&"No available storage method found."===t.message&&(t=Error("Failed to access indexedDB. Our SDK stores the client's UUID in the browser's indexedDB for licensing purposes. Please make sure you are not in the private browsing mode or allow cookies in Browser Settings > Site Settings > Cookies.")), +t;}H=yield X.createInstance({name:"dynamltsinfo"});K=L?null:f(f("v2")+String.fromCharCode(G.charCodeAt(G.length/2)+1)+f(G));fa=f(String.fromCharCode(n.charCodeAt(0)+10)+f(m)+f(n)+v+f(""+A));if(!L){try{let a=yield H.getItem(K);a&&([p,F]=JSON.parse(yield Ea(a)))}catch(t){}try{null==p&&(p=Qa())}catch(t){}}V=yield X.createInstance({name:"dynamltsuns"+f(String.fromCharCode(n.charCodeAt(0)+10)+f(m)+f(n)+v+f(""+A))});try{y=yield H.getItem(fa)}catch(t){}}),ta,ua=t=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){ta|| +(ta=(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){try{let a={pd:m,vm:v,dt:A||(b?"server":"browser"),ed:"javascript",cu:p,ad:G,os:JSON.stringify(D),fn:ja};n&&(a=-1!=n.indexOf("-")?Object.assign({},a,{hs:n}):Object.assign({},a,{og:n}));let h={};if(F&&!L){let a=yield H.getItem(K);a&&([p,F]=JSON.parse(yield Ea(a)));h["lts-time"]=F}C&&(a.sp=C);U&&(a.lm=U);I&&(a.cw=I);y=yield e.race([(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let b=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"); +F&&!L&&(H.setItem(K,yield Fa(JSON.stringify([p,b]))),F=b);let l;var r="auth/?ext="+encodeURIComponent(f(JSON.stringify(a)));let m=!1,q=!1,v,w=a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(a&&!a.ok)try{let b=yield a.text();if(b){let a=JSON.parse(b);a.errorCode&&(v=a,100a.errorCode&&(y=null,q=m=!0))}}catch($a){}});try{l=yield e.race([fetch(J[0]+r,{headers:h,cache:t?"reload":"default",mode:"cors",timeout:1E4}),new e((a,b)=>{setTimeout(b,1E4)})]),yield w(l)}catch(Ga){}if(!(F|| +l&&l.ok||m))try{l=yield fetch(J[1]+r,{headers:h,mode:"cors",timeout:3E4}),yield w(l)}catch(Ga){}if(!(F||l&&l.ok||m))try{l=yield fetch(J[0]+r,{headers:h,mode:"cors",timeout:3E4}),yield w(l)}catch(Ga){}v&&151==v.errorCode&&(L||H.removeItem(K),H.removeItem(fa),p=Qa(),a.cu=p,F=void 0,r=encodeURIComponent(f(JSON.stringify(a))),l=yield fetch(J[0]+"auth/?ext="+r,{headers:h,mode:"cors",timeout:3E4}),yield w(l));(()=>{if(!l||!l.ok){q&&H.setItem(fa,"");if(v)if(111==v.errorCode)var a=v.message;else a=v.message.trim(), +a.endsWith(".")||(a+="."),a=n?`An error occurred during authorization: ${a} Contact the site administrator for more information.`:`An error occurred during authorization: ${a} [Contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.`;else a=n?"Failed to connect to the License Tracking Server: network connection error. Check your Internet connection or contact the site administrator for more information.":"Failed to connect to the License Tracking Server: network connection error. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information."; +a=Error(a);v&&v.errorCode&&(a.ltsErrorCode=v.errorCode);throw a;}})();r=yield l.text();try{F||L||(H.setItem(K,yield Fa(JSON.stringify([p,b]))),F=b),H.setItem(fa,r)}catch(Ga){}fetch(J[0]+"verify",{mode:"cors",method:"POST",headers:{"Content-Type":"application/json","lts-time":"options"},body:"[]",timeout:3E4});return r}))(),new e((a,b)=>{let e;e=n?"Failed to connect to the License Tracking Server: network timed out. Check your Internet connection or contact the site administrator for more information.": "Failed to connect to the License Tracking Server: network timed out. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.";setTimeout(()=>b(Error(e)),y?3E3:15E3)})])}catch(l){q&&(a.dwt?self.console.error(l):console.error(l)),E=l}W=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");ta=null}))());yield ta}),va,wa=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){va||(va=(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){Y(p); -if(y){E&&M&&(M(E),M=null);var b={dm:G};q&&(b.bd=!0);b.brtk=!0;b.ls=J[0];m&&(b.hs=m);b.cu=p;ja&&(b.fn=ja);n&&(b.product=n);A&&(b.dt=A);I&&(b.cw=I);D&&(b.os=JSON.stringify(D));Y(y);try{if(a.dwt)b.ar=y;else{let a=JSON.parse(yield Oa(y));a.ba&&(b.ba=a.ba);a.usu&&(b.usu=a.usu);a.trial&&(b.trial=a.trial);a.its&&(b.its=a.its);1==b.trial&&a.msg?b.msg=a.msg:E?b.msg=E.message||E:a.msg&&(b.msg=a.msg);b.ar=a.in}b.bafc=!!E}catch(l){}Y(b);try{yield ca(b)}catch(l){}yield Ta();T||(T=!0);va=null}else if(!T)throw ba(E.message), +if(y){E&&M&&(M(E),M=null);var b={dm:G};q&&(b.bd=!0);b.brtk=!0;b.ls=J[0];n&&(b.hs=n);b.cu=p;ja&&(b.fn=ja);m&&(b.product=m);A&&(b.dt=A);I&&(b.cw=I);D&&(b.os=JSON.stringify(D));Y(y);try{if(a.dwt)b.ar=y;else{let a=JSON.parse(yield Oa(y));a.ba&&(b.ba=a.ba);a.usu&&(b.usu=a.usu);a.trial&&(b.trial=a.trial);a.its&&(b.its=a.its);1==b.trial&&a.msg?b.msg=a.msg:E?b.msg=E.message||E:a.msg&&(b.msg=a.msg);b.ar=a.in}b.bafc=!!E}catch(l){}Y(b);try{yield ca(b)}catch(l){}yield Ta();T||(T=!0);va=null}else if(!T)throw ba(E.message), E;}))());yield va}),Ta=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let a=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),b=yield R();Y(b);if(b&&b{Ua=a}),Ka=null,xa=(a,b)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){N=N.then(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let f=!1;try{let t=yield V.keys();b||(Ja?a&&(t=t.filter(b=>b{const f=new XMLHttpRequest;f.responseType="json";f.timeout=3E4;f.onload=()=>{b({ok:!0,json:()=>f.response})};f.onerror=f.timeout=f.onabort=()=>{b({ok:!1,status:f.status})};f.upload.onloadend=()=>{Ua()};f.open("POST",J[0]+"verify",!0);for(let b in a)f.setRequestHeader(b,a[b]);f.send(JSON.stringify(l))}): -yield fetch(J[0]+"verify",{mode:"cors",method:"POST",body:JSON.stringify(l),headers:a,timeout:3E4});if(t.ok){F=n;for(h=0;hW&&(yield ua(!0),yield wa())}else throw Error("verify failed. Status Code: "+t.status);}catch(Ra){throw M&&(M(Ra),M=null),Ra;}}S&&S()}}catch(ka){}}));return yield N});return{i:a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){q=a.bd;w=a.version;v=w.split(".")[0];a.dt&&(A=a.dt);G=a.dm;m=a.lcs|| +}}),Ja=!1,Ua,Ba=new e(a=>{Ua=a}),Ka=null,xa=(a,b)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){N=N.then(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let f=!1;try{let t=yield V.keys();b||(Ja?a&&(t=t.filter(b=>b{const f=new XMLHttpRequest;f.responseType="json";f.timeout=3E4;f.onload=()=>{b({ok:!0,json:()=>f.response})};f.onerror=f.timeout=f.onabort=()=>{b({ok:!1,status:f.status})};f.upload.onloadend=()=>{Ua()};f.open("POST",J[0]+"verify",!0);for(let b in a)f.setRequestHeader(b,a[b]);f.send(JSON.stringify(l))}): +yield fetch(J[0]+"verify",{mode:"cors",method:"POST",body:JSON.stringify(l),headers:a,timeout:3E4});if(t.ok){F=m;for(h=0;hW&&(yield ua(!0),yield wa())}else throw Error("verify failed. Status Code: "+t.status);}catch(Ra){throw M&&(M(Ra),M=null),Ra;}}S&&S()}}catch(ka){}}));return yield N});return{i:a=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){q=a.bd;w=a.version;v=w.split(".")[0];a.dt&&(A=a.dt);G=a.dm;n=a.lcs|| "";D=a.browserInfo;ja=a.deviceFriendlyName;a.ls&&a.ls.length&&(J=a.ls,1==J.length&&J.push(J[0]));C=a.sp;U=a.lm;I=a.cw;a.lf&&(X=a.lf);a.lsu&&(p=L=a.lsu);a.fdaa&&(Oa=a.fdaa);a.feab&&(Pa=a.feab);ca=a.updateLicense;da=a.getMinExpireTime;R=a.getMaxExpireTime;a.sutlcb&&(S=a.sutlcb);yield Aa();yield ua();yield wa();E||xa(null,!0);return{ar:y,cu:p}}),c:()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){var a=new Date,b=a.kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");let e=yield da(),f=yield R();f&&f< b?(yield ua(!0),yield wa()):e&&ewa()))}),s:(b,e,f,h)=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){if(a.dwt&&!e)yield xa(f);else{try{let a=e.startsWith("{")&&e.endsWith("}")?yield Pa(e):e;a?yield V.setItem(f,a):Y("ept ecpt")}catch(ka){}h&&(yield xa(f));Ka&&clearTimeout(Ka);Ka=setTimeout(()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){yield xa()}),36E4)}}),caret:Ta, -pdsf:Ba}})({product:"dbr",log:I,debugLog:aa}),self.scsd=C.s,m.updateLicense=ea,m.getMinExpireTime=Ba,m.getMaxExpireTime=Va,yield C.i(m)}catch(U){if(n)ba=!1,yield y(),w=U.ltsErrorCode,S=U.message||U;else throw U;}});let y=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let e={pk:b,dm:a};v&&(e.bd=!0);yield ea(e)});ba?yield q():yield y();f.postMessage({type:"load",success:!0,version:Module.BarcodeReaderWasm.getVersion(),trial:R,ltsErrorCode:w,message:S})}catch(e){f.postMessage({type:"load", -success:!1,ltsErrorCode:e&&e.ltsErrorCode,message:e&&e.message,trial:R,stack:v&&e?e.stack:null})}break;case "createInstance":w=Wa++;try{var G=new Module.BarcodeReaderWasm(m.bScanner,w);y.set(w,G);let b=JSON.parse(G.getRuntimeSettings());m.bScanner?(b.localizationModes=[2,0,0,0,0,0,0,0],b.deblurLevel=0):(b.expectedBarcodesCount=512,b.scaleDownThreshold=1E5,b.timeout=1E5);a||W||(b.barcodeFormatIds=235931647);G.updateRuntimeSettings(JSON.stringify(b))}catch(e){p(e,q);break}f.postMessage({type:"task", -id:q,body:{success:!0,instanceID:w}});break;case "destroyContext":try{if(!y.get(w))break;y.get(w).delete();y.delete(w)}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "decodeBuffer":{G=Date.now();let a,b,m,A;try{a=v?Date.now():0,ya(n.buffer,n.stride*n.height),b=v?Date.now():0,A=JSON.parse(y.get(w).decodeBufferPtr(T,n.width,n.height,n.stride,n.format)),m=Date.now()}catch(la){p(la,q);break}C&&C.pdsf&&(yield Promise.race([C.pdsf,new Promise(a=>{setTimeout(()=>{a(); -C.pdsf=null},500)})]));f.postMessage({type:"task",id:q,body:{success:!0,decodeReturn:A,buffer:n.buffer,duration:m-G}},[n.buffer.buffer]);aa(["timeWorkerGetMsg: "+G,"timeBeforeSendBufferToWasm: "+a+" "+(a-G),"timeBeforeDecode: "+b+" "+(b-a),"timeFinishDecode: "+m+" "+(m-b)].join("\n"));break}case "decodeFileInMemory":{let a,b,m;try{b=v?Date.now():0,a=JSON.parse(y.get(w).decodeFileInMemory(n.bytes)),m=v?Date.now():0}catch(da){p(da,q);break}f.postMessage({type:"task",id:q,body:{success:!0,decodeReturn:a, -duration:m-b}});break}case "clearMapDecodeRecord":try{y.get(w).clearMapDecodeRecord()}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "getRuntimeSettings":{let a;try{a=y.get(w).getRuntimeSettings()}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:a}});break}case "updateRuntimeSettings":{let a;try{a=JSON.parse(y.get(w).updateRuntimeSettings(n.settings))}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,updateReturn:a}}); +pdsf:Ba}})({product:"dbr",log:I,debugLog:aa}),self.scsd=C.s,n.updateLicense=ea,n.getMinExpireTime=Ba,n.getMaxExpireTime=Va,yield C.i(n)}catch(U){if(m)ba=!1,yield y(),w=U.ltsErrorCode,S=U.message||U;else throw U;}});let y=()=>$jscomp.asyncExecutePromiseGeneratorFunction(function*(){let e={pk:b,dm:a};v&&(e.bd=!0);yield ea(e)});ba?yield q():yield y();f.postMessage({type:"load",success:!0,version:Module.BarcodeReaderWasm.getVersion(),trial:R,ltsErrorCode:w,message:S})}catch(e){f.postMessage({type:"load", +success:!1,ltsErrorCode:e&&e.ltsErrorCode,message:e&&e.message,trial:R,stack:v&&e?e.stack:null})}break;case "createInstance":w=Wa++;try{var G=new Module.BarcodeReaderWasm(n.bScanner,w);y.set(w,G);let b=JSON.parse(G.getRuntimeSettings());n.bScanner?(b.localizationModes=[2,0,0,0,0,0,0,0],b.deblurLevel=0):(b.expectedBarcodesCount=512,b.scaleDownThreshold=1E5,b.timeout=1E5);a||W||(b.barcodeFormatIds=235931647);G.updateRuntimeSettings(JSON.stringify(b))}catch(e){p(e,q);break}f.postMessage({type:"task", +id:q,body:{success:!0,instanceID:w}});break;case "destroyContext":try{if(!y.get(w))break;y.get(w).delete();y.delete(w)}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "decodeBuffer":{G=Date.now();let a,b,n,A;try{a=v?Date.now():0,ya(m.buffer,m.stride*m.height),b=v?Date.now():0,A=JSON.parse(y.get(w).decodeBufferPtr(T,m.width,m.height,m.stride,m.format)),n=Date.now()}catch(la){p(la,q);break}C&&C.pdsf&&(yield Promise.race([C.pdsf,new Promise(a=>{setTimeout(()=>{a(); +C.pdsf=null},500)})]));f.postMessage({type:"task",id:q,body:{success:!0,decodeReturn:A,buffer:m.buffer,duration:Date.now()-G}},[m.buffer.buffer]);aa(["timeWorkerGetMsg: "+G,"timeBeforeSendBufferToWasm: "+a+" "+(a-G),"timeBeforeDecode: "+b+" "+(b-a),"timeFinishDecode: "+n+" "+(n-b)].join("\n"));break}case "decodeFileInMemory":{let a,b,n;try{b=v?Date.now():0,a=JSON.parse(y.get(w).decodeFileInMemory(m.bytes)),n=v?Date.now():0}catch(da){p(da,q);break}f.postMessage({type:"task",id:q,body:{success:!0,decodeReturn:a, +duration:n-b}});break}case "clearMapDecodeRecord":try{y.get(w).clearMapDecodeRecord()}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "getRuntimeSettings":{let a;try{a=y.get(w).getRuntimeSettings()}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:a}});break}case "updateRuntimeSettings":{let a;try{a=JSON.parse(y.get(w).updateRuntimeSettings(m.settings))}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,updateReturn:a}}); break}case "resetRuntimeSettings":try{let a=y.get(w);a.resetRuntimeSettings();let b=JSON.parse(a.getRuntimeSettings());a.bScanner?(b.localizationModes=[2,0,0,0,0,0,0,0],b.deblurLevel=0,b.barcodeZoneMinDistanceToImageBorders=9):(b.expectedBarcodesCount=512,b.scaleDownThreshold=1E5,b.timeout=1E5);W||(b.barcodeFormatIds=235931647);a.updateRuntimeSettings(JSON.stringify(b))}catch(e){p(b,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "outputSettingsToString":{let a;try{a=y.get(w).outputSettingsToString()}catch(h){p(h, -q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:a}});break}case "initRuntimeSettingsWithString":{let a;try{a=JSON.parse(y.get(w).initRuntimeSettingsWithString(n.settings))}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,initReturn:a}});break}case "getIntermediateResults":{let a=[];try{var N=y.get(w).getIntermediateResults(),ca=JSON.parse(N,(b,e)=>"bytes"===b&&"ptr"in e&&"length"in e?(b=Module.BarcodeReaderWasm.getBytes(e.ptr,e.length),b=b.slice(0),a.push(b.buffer), -b):e)}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:ca}},a);y.get(w).freeIntermediateResults();break}case "setModeArgument":{let a;try{a=JSON.parse(y.get(w).setModeArgument(n.modeName,n.index,n.argumentName,n.argumentValue))}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,setReturn:a}});break}case "getModeArgument":{let a;try{a=JSON.parse(y.get(w).getModeArgument(n.modeName,n.index,n.argumentName))}catch(h){p(h,q);break}f.postMessage({type:"task", -id:q,body:{success:!0,getReturn:a}});break}case "updateScanSettings":try{let a=y.get(w),b=n.settings;a.duplicateForgetTime=b.duplicateForgetTime;a.oneDRememberFrameCount=b.oneDRememberFrameCount;a.oneDTrustFrameCount=b.oneDTrustFrameCount;b.frameFilter?a.setFrameFilter(JSON.stringify(b.frameFilter)):a.setFrameFilter("")}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "getScanSettings":n={};try{let a=y.get(w);n.duplicateForgetTime=a.duplicateForgetTime;n.oneDRememberFrameCount= -a.oneDRememberFrameCount;n.oneDTrustFrameCount=a.oneDTrustFrameCount;let b=a.getFrameFilter();b&&(n.frameFilter=JSON.parse(b))}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:n}});break;default:console.warn("Unmatched task: ",b)}})};if(a)f.on("message",b);else f.onmessage=b;let I=a=>{f.postMessage({type:"log",message:a})},aa=a=>{v&&I(a)},p=(a,b)=>{f.postMessage({type:"task",id:b,body:{success:!1,message:a.message,stack:a.stack}});setTimeout(()=>{throw a;},0)}})(); +q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:a}});break}case "initRuntimeSettingsWithString":{let a;try{a=JSON.parse(y.get(w).initRuntimeSettingsWithString(m.settings))}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,initReturn:a}});break}case "getIntermediateResults":{let a=[];try{var N=y.get(w).getIntermediateResults(),ca=JSON.parse(N,(b,e)=>"bytes"===b&&"ptr"in e&&"length"in e?(b=Module.BarcodeReaderWasm.getBytes(e.ptr,e.length),b=b.slice(0),a.push(b.buffer), +b):e)}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:ca}},a);y.get(w).freeIntermediateResults();break}case "setModeArgument":{let a;try{a=JSON.parse(y.get(w).setModeArgument(m.modeName,m.index,m.argumentName,m.argumentValue))}catch(h){p(h,q);break}f.postMessage({type:"task",id:q,body:{success:!0,setReturn:a}});break}case "getModeArgument":{let a;try{a=JSON.parse(y.get(w).getModeArgument(m.modeName,m.index,m.argumentName))}catch(h){p(h,q);break}f.postMessage({type:"task", +id:q,body:{success:!0,getReturn:a}});break}case "updateScanSettings":try{let a=y.get(w),b=m.settings;a.duplicateForgetTime=b.duplicateForgetTime;a.oneDRememberFrameCount=b.oneDRememberFrameCount;a.oneDTrustFrameCount=b.oneDTrustFrameCount;b.frameFilter?a.setFrameFilter(JSON.stringify(b.frameFilter)):a.setFrameFilter("")}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0}});break;case "getScanSettings":m={};try{let a=y.get(w);m.duplicateForgetTime=a.duplicateForgetTime;m.oneDRememberFrameCount= +a.oneDRememberFrameCount;m.oneDTrustFrameCount=a.oneDTrustFrameCount;let b=a.getFrameFilter();b&&(m.frameFilter=JSON.parse(b))}catch(e){p(e,q);break}f.postMessage({type:"task",id:q,body:{success:!0,results:m}});break;default:console.warn("Unmatched task: ",b)}})};if(a)f.on("message",b);else f.onmessage=b;let I=a=>{f.postMessage({type:"log",message:a})},aa=a=>{v&&I(a)},p=(a,b)=>{f.postMessage({type:"task",id:b,body:{success:!1,message:a.message,stack:a.stack}});setTimeout(()=>{throw a;},0)}})(); diff --git a/dist/dbr.browser.pure.esm.js b/dist/dbr.browser.pure.esm.js index 8e16a4d..76d01a9 100644 --- a/dist/dbr.browser.pure.esm.js +++ b/dist/dbr.browser.pure.esm.js @@ -2,10 +2,10 @@ * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition * @website http://www.dynamsoft.com - * @copyright Copyright 2021, Dynamsoft Corporation + * @copyright Copyright 2022, Dynamsoft Corporation * @author Dynamsoft - * @version 8.8.3 (js 20211011) + * @version 8.8.7 (js 20220125) * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -import e,{CameraEnhancer as t}from"dynamsoft-camera-enhancer";export{default as CameraEnhancer}from"dynamsoft-camera-enhancer";function i(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var n,r,s,o;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(n||(n={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(r||(r={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(o||(o={})),"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;const a="undefined"==typeof self,d=a?{}:self;class _{constructor(){this._canvasMaxWH="iPhone"==_.browserInfo.OS||"Android"==_.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");_._license=e}static get productKeys(){return this._license}static set productKeys(e){_.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){_.license=e}static get organizationID(){return this._license}static set organizationID(e){_.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");_._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return i(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!("undefined"==typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),a)_._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,_._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(_._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)_._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;ti(this,void 0,void 0,(function*(){switch(_._loadWasmStatus){case"unload":{_._loadWasmStatus="loading";let e=_.engineResourcePath+_._workerName;_.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),_._dbrWorker=new Worker(e),_._dbrWorker.onerror=e=>{_._loadWasmStatus="loadFail";let t=new Error(e.message);_._loadWasmErr=t;for(let e of _._loadWasmCallbackArr)e(t);_._loadWasmCallbackArr=[]},_._dbrWorker.onmessage=e=>i(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":_._onLog&&_._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===l&&(e=!0),t.success){_._loadWasmStatus="loadSuccess",_._version=t.version+"(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._onLog&&_._onLog("load dbr worker success");for(let e of _._loadWasmCallbackArr)e();_._loadWasmCallbackArr=[],_._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,_._loadWasmStatus="loadFail",_._loadWasmErr=i;for(let e of _._loadWasmCallbackArr)e(i);_._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&_.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{_._taskCallbackMap.get(e)(i),_._taskCallbackMap.delete(e)}catch(t){throw _._taskCallbackMap.delete(e),t}break}default:_._onLog&&_._onLog(e)}})),_._dbrWorker.postMessage({type:"loadWasm",bd:_._bWasmDebug,engineResourcePath:_.engineResourcePath,version:_._jsVersion,brtk:!!l,bptk:1===l,lcs:t,dm:location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:_._bUseFullFeature,browserInfo:_.browserInfo,deviceFriendlyName:_.deviceFriendlyName,ls:n,sp:s,lm:o,cw:a})}case"loading":_._loadWasmCallbackArr.push((t=>{t?r(t):e()}));break;case"loadSuccess":e();break;case"loadFail":r(_._loadWasmErr)}}))))}))}static showDialog(e,t){return i(this,void 0,void 0,(function*(){if(!_._bNeverShowDialog)try{let i=yield fetch(_.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let n=yield i.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(i==e.target){o.remove();for(let e of s)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!l&&i.classList.contains("dls-license-icon-error"))l=i,"error"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-icon-warn"))c=i,"warn"!=e&&i.remove();else if(!u&&i.classList.contains("dls-license-msg-content")){u=i;let e=t;for(;e;){let t=e.indexOf("["),n=e.indexOf("]",t),r=e.indexOf("(",n),s=e.indexOf(")",r);if(-1==t||-1==n||-1==r||-1==s){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let o=document.createElement("a"),a=e.substring(t+1,n);o.innerText=a;let d=e.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),i.appendChild(o),e=e.substring(s+1)}}document.body.appendChild(o)}catch(e){_._onLog&&_._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return i(this,void 0,void 0,(function*(){return yield _.loadWasm(),yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:e})}))}))}static createInstance(){return i(this,void 0,void 0,(function*(){let e=new _;return e._instanceID=yield _.createInstanceInWorker(),e}))}decode(e){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("decode(source: any)"),_._onLog&&(this._timeStartDecode=Date.now());{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,a)=>{let d=_._nextTaskID++;_._taskCallbackMap.set(d,(e=>{if(e.success){let t,n=_._onLog?Date.now():0;_._onLog&&_._onLog("worker return result: "+n),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(_._onLog){let e=Date.now();_._onLog("DBR time get result: "+n),_._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),_._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),_._onLog("DBR worker handle results: "+(e-n)),_._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),_._onLog&&_._onLog("Send buffer to worker:"+Date.now()),_._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:n,stride:r,format:s,config:o}},[e.buffer]),_._onLog&&o&&o._timeEndGettingFrame&&_._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const i=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onload=()=>{t(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(i),t,n,r,s,o)}))}decodeBuffer(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){let i;return _._onLog&&_._onLog("decodeBuffer(buffer,width,height,stride,format)"),_._onLog&&(this._timeStartDecode=Date.now()),e instanceof Uint8Array||e instanceof Uint8ClampedArray?i=yield this._decodeBuffer_Uint8Array(e,t,n,r,s,o):e instanceof ArrayBuffer?i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,n,r,s,o):e instanceof Blob&&(i=yield this._decodeBuffer_Blob(e,t,n,r,s,o)),i}))}_decodeFileInMemory_Uint8Array(e){return i(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){let n;this._lastInnerDecodeDuration=e.duration;try{n=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(n)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=3,t.expectedBarcodesCount=0,t.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=5,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(this.bFilterRegionInJs){let e=t.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,t.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})}))}))}resetRuntimeSettings(){return i(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Blob(blob: Blob)");let i=null,n=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let r=yield this._decode_Image(i||n,t);return i&&i.close(),r}))}_decode_ArrayBuffer(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,n,r=e instanceof HTMLImageElement?e.naturalWidth:e.width,s=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=Math.max(r,s);if(o>this._canvasMaxWH){let e=this._canvasMaxWH/o;i=Math.round(r*e),n=Math.round(s*e)}else i=r,n=s;let a,l=0,c=0,u=r,h=s,g=i,R=n,E=t.region;if(E){let e,t,o,a;E.regionMeasuredByPercentage?(e=E.regionLeft*i/100,t=E.regionTop*n/100,o=E.regionRight*i/100,a=E.regionBottom*n/100):(e=E.regionLeft,t=E.regionTop,o=E.regionRight,a=E.regionBottom),g=o-e,u=Math.round(g/i*r),R=a-t,h=Math.round(R/n*s),l=Math.round(e/i*r),c=Math.round(t/n*s)}!this.bSaveOriCanvas&&d.OffscreenCanvas?a=new OffscreenCanvas(g,R):(a=document.createElement("canvas"),a.width=g,a.height=R);let I,A=a.getContext("2d");0==l&&0==c&&r==u&&s==h&&r==g&&s==R?A.drawImage(e,0,0):A.drawImage(e,l,c,u,h,0,0,g,R),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),E?(I=JSON.parse(JSON.stringify(t)),delete I.region):I=t;let S=yield this._decode_Canvas(a,I);return _.fixResultLocationWhenFilterRegionInJs(E,S,l,c,u,h,g,R),S}))}_decode_Canvas(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=e);let i=(e.dbrCtx2d||e.getContext("2d")).getImageData(0,0,e.width,e.height).data;return yield this._decodeBuffer_Uint8Array(i,e.width,e.height,4*e.width,n.IPF_ABGR_8888,t)}))}_decode_Video(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};const i=e.videoWidth,n=e.videoHeight,r=Math.max(i,n);let s,o;if(r>this._canvasMaxWH){let e=this._canvasMaxWH/r;s=Math.round(i*e),o=Math.round(n*e)}else s=i,o=n;let a=0,l=0,c=i,u=n,h=i,g=n,R=t.region;if(R){let e,t,r,d;R.regionMeasuredByPercentage?(e=R.regionLeft*s/100,t=R.regionTop*o/100,r=R.regionRight*s/100,d=R.regionBottom*o/100):(e=R.regionLeft,t=R.regionTop,r=R.regionRight,d=R.regionBottom),h=r-e,c=Math.round(h/s*i),g=d-t,u=Math.round(g/o*n),a=Math.round(e/s*i),l=Math.round(t/o*n)}let E=0==a&&0==l&&i==c&&n==u&&i==h&&n==g,I=null;!this.bSaveOriCanvas&&d.OffscreenCanvas?I=new OffscreenCanvas(h,g):(I=document.createElement("canvas"),I.width=h,I.height=g);const A=I.dbrCtx2d=I.getContext("2d");let S;E?A.drawImage(e,0,0):A.drawImage(e,a,l,c,u,0,0,h,g),R?(S=JSON.parse(JSON.stringify(t)),delete S.region):S=t;let D=yield this._decode_Canvas(I,t);return R&&_.fixResultLocationWhenFilterRegionInJs(R,D,a,l,c,u,h,g),D}))}_decode_Base64(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");"data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1));{let i=atob(e),n=i.length,r=new Uint8Array(n);for(;n--;)r[n]=i.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),t)}}))}_decode_Url(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");e=e;{let n=yield new Promise(((t,n)=>{let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.send(),r.onloadend=()=>i(this,void 0,void 0,(function*(){t(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,t)}}))}_decode_FilePath(e,t){return i(this,void 0,void 0,(function*(){throw _._onLog&&_._onLog("_decode_FilePath(path)"),Error("'_decode_FilePath(path, config)': The method is only supported in node environment.")}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,_=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+n,t.y2=t.y2/_+n,t.y3=t.y3/_+n,t.y4=t.y4/_+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let i,n=r.DBR_UNKNOWN;return"number"==typeof e?(n=e,i=new Error(t)):i=new Error(e),i.code=n,i}_handleRetJsonString(e){let t=r;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!_._setWarnnedEx.has(e.description)&&(_._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw _.BarcodeReaderException(e.exception,e.description)}setModeArgument(e,t,n,r){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,s)=>{let o=_._nextTaskID++;_._taskCallbackMap.set(o,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return s(e)}return i()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,s(t)}})),_._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n,argumentValue:r}})}))}))}getModeArgument(e,t,n){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,r)=>{let s=_._nextTaskID++;_._taskCallbackMap.set(s,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return r(e)}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,r(t)}})),_._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n}})}))}))}getIntermediateResults(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return i(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),t=[];for(let i of e)if(i.dataType==s.IMRDT_IMAGE)for(let e of i.results){const i=e.bytes;let r;switch(_._onLog&&_._onLog(" "+i.length+" "+i.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case n.IPF_ABGR_8888:r=new Uint8ClampedArray(i);break;case n.IPF_RGB_888:{const e=i.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}_._jsVersion="8.8.3",_._jsEditVersion="20211011",_._version="loading...(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._license=!a&&document.currentScript&&(document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID"))||"",_._sessionPassword=!a&&document.currentScript&&document.currentScript.getAttribute("data-sessionPassword")||"",_.browserInfo=function(){if(!a){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{if(!a&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),_._licenseServer=[],_._deviceFriendlyName="",_._isShowRelDecodeTimeInResults=!1,_._bWasmDebug=!1,_._bNeverShowDialog=!1,_.__bUseFullFeature=!0,_._nextTaskID=0,_._taskCallbackMap=new Map,_._loadWasmStatus="unload",_._loadWasmCallbackArr=[],_._lastErrorCode=0,_._lastErrorString="",_._setWarnnedEx=new Set,_._loadWasmErr=null,"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;class l extends _{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=l._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",_.engineResourcePath)}static set defaultUIElementURL(e){l._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return i(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{i(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return i(this,void 0,void 0,(function*(){this.dce||(_._onLog&&_._onLog("createDCEInstance()"),t.defaultUIElementURL=null,this.dce=yield t.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>i(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return i(this,void 0,void 0,(function*(){let t=new l;yield t.createDCEInstance(),t._instanceID=yield l.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(l.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(e){return i(this,void 0,void 0,(function*(){this._assertOpen();let t=null;e&&e.region&&(t=e.region);let i=this.dce.getFrame(t);if(i&&null===i.canvas){let{data:e,width:t,height:r}=i;return yield this._decodeBuffer_Uint8Array(e,t,r,t,n.IPF_GrayScaled)}if(i&&i.canvas){let{data:e,canvas:t,region:r,sx:s,sy:o,sWidth:a,sHeight:d}=i;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let l=yield this._decodeBuffer_Uint8Array(e,t.width,t.height,4*t.width,n.IPF_ABGR_8888);return _.fixResultLocationWhenFilterRegionInJs(r,l,s,o,a,d,t.width,t.height),l}}))}clearMapDecodeRecord(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(l.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region)}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=3,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0],t.timeout=1e5}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=5,t.expectedBarcodesCount=512,t.scaleDownThreshold=1e5,t.localizationModes=[2,16,4,8,0,0,0,0],t.timeout=1e5}else if("single"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionNormalPreset(e.region)?t.region=JSON.parse(JSON.stringify(l.singlePresetRegion)):t.region=e.region,t.expectedBarcodesCount=1,t.localizationModes=[16,2,0,0,0,0,0,0],t.barcodeZoneMinDistanceToImageBorders=0}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let i=e.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=t.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})})),"single"==e&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");this.dce._bindUI();let t=[e],i=e.children;for(let e of i)t.push(e);for(let e=0;e{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),_._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return i(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),l._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,n){return i(this,void 0,void 0,(function*(){return this.dce.play(e,t,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return i(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return i(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return i(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return i(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return i(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return i(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return _._onLog&&_._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),_._onLog&&_._onLog("======= once read ======="),_._onLog&&(this._timeStartDecode=Date.now());let e=this._getVideoFrame();if(!e)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>i(this,void 0,void 0,(function*(){if(e&&null===e.canvas){let{data:t,width:i,height:r,timeStamp:s}=e,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(t,i,r,i,n.IPF_GrayScaled,o)}if(e&&e.canvas){let{data:t,canvas:i,region:r,sx:s,sy:o,width:a,height:d,timeStamp:l}=e,c={timeStamp:l};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let u=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,n.IPF_ABGR_8888,c);return _.fixResultLocationWhenFilterRegionInJs(r,u,s,o,i.width,i.height,a,d),u}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{_._onLog&&_._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})(),this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),_._onLog&&_._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return i(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var c,u,h,g,R,E,I,A,S,D,f,T,m,M,C,L,O,N,y,B,v,p,b,F,P,w,V;l._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",l.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(c||(c={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(u||(u={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(h||(h={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(g||(g={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(R||(R={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(E||(E={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(I||(I={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(A||(A={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(S||(S={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(f||(f={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(T||(T={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(m||(m={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(C||(C={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(L||(L={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(O||(O={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(N||(N={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(y||(y={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(B||(B={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(v||(v={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(p||(p={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(b||(b={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(F||(F={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(P||(P={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(w||(w={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(V||(V={}));class U{static get version(){return _.version}static get productKeys(){return _.productKeys}static set productKeys(e){_.productKeys=e}static get handshakeCode(){return _.handshakeCode}static set handshakeCode(e){_.handshakeCode=e}static get organizationID(){return _.organizationID}static set organizationID(e){_.organizationID=e}static get sessionPassword(){return _.sessionPassword}static set sessionPassword(e){_.sessionPassword=e}static get browserInfo(){return _.browserInfo}static detectEnvironment(){return _.detectEnvironment()}static get _workerName(){return _._workerName}static set _workerName(e){_._workerName=e}static get engineResourcePath(){return _.engineResourcePath}static set engineResourcePath(e){_.engineResourcePath=e}static get licenseServer(){return _.licenseServer}static set licenseServer(e){_.licenseServer=e}static get deviceFriendlyName(){return _.deviceFriendlyName}static set deviceFriendlyName(e){_.deviceFriendlyName=e}static get _onLog(){return _._onLog}static set _onLog(e){_._onLog=e}static get _bWasmDebug(){return _._bWasmDebug}static set _bWasmDebug(e){_._bWasmDebug=e}static get _bUseFullFeature(){return _._bUseFullFeature}static set _bUseFullFeature(e){_._bUseFullFeature=e}static get _dbrWorker(){return _._dbrWorker}static isLoaded(){return _.isLoaded()}static isWasmLoaded(){return _.isLoaded()}static loadWasm(){return _.loadWasm()}}U.DBR=U,U.BarcodeReader=_,U.BarcodeScanner=l,U.CameraEnhancer=e,U.EnumBarcodeColourMode=c,U.EnumBarcodeComplementMode=u,U.EnumBarcodeFormat=o,U.EnumBarcodeFormat_2=h,U.EnumBinarizationMode=g,U.EnumClarityCalculationMethod=R,U.EnumClarityFilterMode=E,U.EnumColourClusteringMode=I,U.EnumColourConversionMode=A,U.EnumConflictMode=S,U.EnumDeblurMode=D,U.EnumDeformationResistingMode=f,U.EnumDPMCodeReadingMode=T,U.EnumErrorCode=r,U.EnumGrayscaleTransformationMode=m,U.EnumImagePixelFormat=n,U.EnumImagePreprocessingMode=M,U.EnumIMResultDataType=s,U.EnumIntermediateResultSavingMode=C,U.EnumIntermediateResultType=L,U.EnumLocalizationMode=O,U.EnumPDFReadingMode=N,U.EnumQRCodeErrorCorrectionLevel=y,U.EnumRegionPredetectionMode=B,U.EnumResultCoordinateType=v,U.EnumResultType=p,U.EnumScaleUpMode=b,U.EnumTerminatePhase=F,U.EnumTextFilterMode=P,U.EnumTextResultOrderMode=w,U.EnumTextureDetectionMode=V;export{_ as BarcodeReader,l as BarcodeScanner,U as DBR,c as EnumBarcodeColourMode,u as EnumBarcodeComplementMode,o as EnumBarcodeFormat,h as EnumBarcodeFormat_2,g as EnumBinarizationMode,R as EnumClarityCalculationMethod,E as EnumClarityFilterMode,I as EnumColourClusteringMode,A as EnumColourConversionMode,S as EnumConflictMode,T as EnumDPMCodeReadingMode,D as EnumDeblurMode,f as EnumDeformationResistingMode,r as EnumErrorCode,m as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,n as EnumImagePixelFormat,M as EnumImagePreprocessingMode,C as EnumIntermediateResultSavingMode,L as EnumIntermediateResultType,O as EnumLocalizationMode,N as EnumPDFReadingMode,y as EnumQRCodeErrorCorrectionLevel,B as EnumRegionPredetectionMode,v as EnumResultCoordinateType,p as EnumResultType,b as EnumScaleUpMode,F as EnumTerminatePhase,P as EnumTextFilterMode,w as EnumTextResultOrderMode,V as EnumTextureDetectionMode,U as default}; +import e,{CameraEnhancer as t}from"dynamsoft-camera-enhancer";export{default as CameraEnhancer}from"dynamsoft-camera-enhancer";function i(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var n,r,s,o;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(n||(n={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(r||(r={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(o||(o={})),"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;const a="undefined"==typeof self,d=a?{}:self;class _{constructor(){this._canvasMaxWH="iPhone"==_.browserInfo.OS||"Android"==_.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");_._license=e}static get productKeys(){return this._license}static set productKeys(e){_.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){_.license=e}static get organizationID(){return this._license}static set organizationID(e){_.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");_._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return i(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!("undefined"==typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),a)_._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,_._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(_._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)_._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;ti(this,void 0,void 0,(function*(){switch(_._loadWasmStatus){case"unload":{_._loadWasmStatus="loading";let e=_.engineResourcePath+_._workerName;_.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),_._dbrWorker=new Worker(e),_._dbrWorker.onerror=e=>{_._loadWasmStatus="loadFail";let t=new Error(e.message);_._loadWasmErr=t;for(let e of _._loadWasmCallbackArr)e(t);_._loadWasmCallbackArr=[]},_._dbrWorker.onmessage=e=>i(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":_._onLog&&_._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===l&&(e=!0),t.success){_._loadWasmStatus="loadSuccess",_._version=t.version+"(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._onLog&&_._onLog("load dbr worker success");for(let e of _._loadWasmCallbackArr)e();_._loadWasmCallbackArr=[],_._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,_._loadWasmStatus="loadFail",_._loadWasmErr=i;for(let e of _._loadWasmCallbackArr)e(i);_._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&_.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{_._taskCallbackMap.get(e)(i),_._taskCallbackMap.delete(e)}catch(t){throw _._taskCallbackMap.delete(e),t}break}default:_._onLog&&_._onLog(e)}})),_._dbrWorker.postMessage({type:"loadWasm",bd:_._bWasmDebug,engineResourcePath:_.engineResourcePath,version:_._jsVersion,brtk:!!l,bptk:1===l,lcs:t,dm:location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:_._bUseFullFeature,browserInfo:_.browserInfo,deviceFriendlyName:_.deviceFriendlyName,ls:n,sp:s,lm:o,cw:a})}case"loading":_._loadWasmCallbackArr.push((t=>{t?r(t):e()}));break;case"loadSuccess":e();break;case"loadFail":r(_._loadWasmErr)}}))))}))}static showDialog(e,t){return i(this,void 0,void 0,(function*(){if(!_._bNeverShowDialog)try{let i=yield fetch(_.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let n=yield i.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(i==e.target){o.remove();for(let e of s)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!l&&i.classList.contains("dls-license-icon-error"))l=i,"error"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-icon-warn"))c=i,"warn"!=e&&i.remove();else if(!u&&i.classList.contains("dls-license-msg-content")){u=i;let e=t;for(;e;){let t=e.indexOf("["),n=e.indexOf("]",t),r=e.indexOf("(",n),s=e.indexOf(")",r);if(-1==t||-1==n||-1==r||-1==s){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let o=document.createElement("a"),a=e.substring(t+1,n);o.innerText=a;let d=e.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),i.appendChild(o),e=e.substring(s+1)}}document.body.appendChild(o)}catch(e){_._onLog&&_._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return i(this,void 0,void 0,(function*(){return yield _.loadWasm(),yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:e})}))}))}static createInstance(){return i(this,void 0,void 0,(function*(){let e=new _;return e._instanceID=yield _.createInstanceInWorker(),e}))}decode(e){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("decode(source: any)"),_._onLog&&(this._timeStartDecode=Date.now());{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,a)=>{let d=_._nextTaskID++;_._taskCallbackMap.set(d,(e=>{if(e.success){let t,n=_._onLog?Date.now():0;_._onLog&&_._onLog("worker return result: "+n),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(_._onLog){let e=Date.now();_._onLog("DBR time get result: "+n),_._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),_._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),_._onLog("DBR worker handle results: "+(e-n)),_._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),_._onLog&&_._onLog("Send buffer to worker:"+this._timeEnterInnerDBR),_._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:n,stride:r,format:s,config:o}},[e.buffer]),_._onLog&&o&&o._timeEndGettingFrame&&_._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const i=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onload=()=>{t(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(i),t,n,r,s,o)}))}decodeBuffer(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){let i;return _._onLog&&_._onLog("decodeBuffer(buffer,width,height,stride,format)"),_._onLog&&(this._timeStartDecode=Date.now()),e instanceof Uint8Array||e instanceof Uint8ClampedArray?i=yield this._decodeBuffer_Uint8Array(e,t,n,r,s,o):e instanceof ArrayBuffer?i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,n,r,s,o):e instanceof Blob&&(i=yield this._decodeBuffer_Blob(e,t,n,r,s,o)),i}))}_decodeFileInMemory_Uint8Array(e){return i(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){let n;this._lastInnerDecodeDuration=e.duration;try{n=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(n)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=3,t.expectedBarcodesCount=0,t.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=5,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(this.bFilterRegionInJs){let e=t.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,t.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})}))}))}resetRuntimeSettings(){return i(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Blob(blob: Blob)");let i=null,n=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let r=yield this._decode_Image(i||n,t);return i&&i.close(),r}))}_decode_ArrayBuffer(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,n,r,s,o=e instanceof HTMLImageElement?e.naturalWidth:e.width,a=e instanceof HTMLImageElement?e.naturalHeight:e.height,l=t.region;if(l){let e,t,r,s;l.regionMeasuredByPercentage?(e=l.regionLeft*o/100,t=l.regionTop*a/100,r=l.regionRight*o/100,s=l.regionBottom*a/100):(e=l.regionLeft,t=l.regionTop,r=l.regionRight,s=l.regionBottom),i=e,n=t,o=Math.round(r-e),a=Math.round(s-t)}else i=0,n=0;const c=Math.max(o,a);if(c>this._canvasMaxWH){const e=this._canvasMaxWH/c;o>a?(r=this._canvasMaxWH,s=Math.round(a*e)):(r=Math.round(o*e),s=this._canvasMaxWH)}else r=o,s=a;let u,h;!this.bSaveOriCanvas&&d.OffscreenCanvas?u=new OffscreenCanvas(r,s):(u=document.createElement("canvas"),u.width=r,u.height=s),u.getContext("2d").drawImage(e,i,n,o,a,0,0,r,s),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),l?(h=JSON.parse(JSON.stringify(t)),delete h.region):h=t;let g=yield this._decode_Canvas(u,h);return _.fixResultLocationWhenFilterRegionInJs(l,g,i,n,o,a,r,s),g}))}_decode_Canvas(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=e);let i=(e.dbrCtx2d||e.getContext("2d")).getImageData(0,0,e.width,e.height).data;return yield this._decodeBuffer_Uint8Array(i,e.width,e.height,4*e.width,n.IPF_ABGR_8888,t)}))}_decode_Video(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};let i,n,r,s,o=e.videoWidth,a=e.videoHeight,l=t.region;if(l){let e,t,r,s;l.regionMeasuredByPercentage?(e=l.regionLeft*o/100,t=l.regionTop*a/100,r=l.regionRight*o/100,s=l.regionBottom*a/100):(e=l.regionLeft,t=l.regionTop,r=l.regionRight,s=l.regionBottom),i=e,n=t,o=Math.round(r-e),a=Math.round(s-t)}else i=0,n=0;const c=Math.max(o,a);if(c>this._canvasMaxWH){const e=this._canvasMaxWH/c;o>a?(r=this._canvasMaxWH,s=Math.round(a*e)):(r=Math.round(o*e),s=this._canvasMaxWH)}else r=o,s=a;let u=null;!this.bSaveOriCanvas&&d.OffscreenCanvas?u=new OffscreenCanvas(r,s):(u=document.createElement("canvas"),u.width=r,u.height=s);let h;(u.dbrCtx2d=u.getContext("2d")).drawImage(e,i,n,o,a,0,0,r,s),l?(h=JSON.parse(JSON.stringify(t)),delete h.region):h=t;let g=yield this._decode_Canvas(u,t);return l&&_.fixResultLocationWhenFilterRegionInJs(l,g,i,n,o,a,r,s),g}))}_decode_Base64(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");"data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1));{let i=atob(e),n=i.length,r=new Uint8Array(n);for(;n--;)r[n]=i.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),t)}}))}_decode_Url(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");e=e;{let n=yield new Promise(((t,n)=>{let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.send(),r.onloadend=()=>i(this,void 0,void 0,(function*(){t(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,t)}}))}_decode_FilePath(e,t){return i(this,void 0,void 0,(function*(){throw _._onLog&&_._onLog("_decode_FilePath(path)"),Error("'_decode_FilePath(path, config)': The method is only supported in node environment.")}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,_=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+n,t.y2=t.y2/_+n,t.y3=t.y3/_+n,t.y4=t.y4/_+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let i,n=r.DBR_UNKNOWN;return"number"==typeof e?(n=e,i=new Error(t)):i=new Error(e),i.code=n,i}_handleRetJsonString(e){let t=r;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!_._setWarnnedEx.has(e.description)&&(_._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw _.BarcodeReaderException(e.exception,e.description)}setModeArgument(e,t,n,r){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,s)=>{let o=_._nextTaskID++;_._taskCallbackMap.set(o,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return s(e)}return i()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,s(t)}})),_._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n,argumentValue:r}})}))}))}getModeArgument(e,t,n){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,r)=>{let s=_._nextTaskID++;_._taskCallbackMap.set(s,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return r(e)}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,r(t)}})),_._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n}})}))}))}getIntermediateResults(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return i(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),t=[];for(let i of e)if(i.dataType==s.IMRDT_IMAGE)for(let e of i.results){const i=e.bytes;let r;switch(_._onLog&&_._onLog(" "+i.length+" "+i.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case n.IPF_ABGR_8888:r=new Uint8ClampedArray(i);break;case n.IPF_RGB_888:{const e=i.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}_._jsVersion="8.8.7",_._jsEditVersion="20220125",_._version="loading...(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._license=!a&&document.currentScript&&(document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID"))||"",_._sessionPassword=!a&&document.currentScript&&document.currentScript.getAttribute("data-sessionPassword")||"",_.browserInfo=function(){if(!a){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{if(!a&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),_._licenseServer=[],_._deviceFriendlyName="",_._isShowRelDecodeTimeInResults=!1,_._bWasmDebug=!1,_._bNeverShowDialog=!1,_.__bUseFullFeature=!0,_._nextTaskID=0,_._taskCallbackMap=new Map,_._loadWasmStatus="unload",_._loadWasmCallbackArr=[],_._lastErrorCode=0,_._lastErrorString="",_._setWarnnedEx=new Set,_._loadWasmErr=null,"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;class l extends _{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=l._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",_.engineResourcePath)}static set defaultUIElementURL(e){l._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return i(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{i(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return i(this,void 0,void 0,(function*(){this.dce||(_._onLog&&_._onLog("createDCEInstance()"),t.defaultUIElementURL=null,this.dce=yield t.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>i(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return i(this,void 0,void 0,(function*(){let t=new l;yield t.createDCEInstance(),t._instanceID=yield l.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(l.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(e){return i(this,void 0,void 0,(function*(){this._assertOpen();let t=null;e&&e.region&&(t=e.region);let i=this.dce.getFrame(t);if(i&&null===i.canvas){let{data:e,width:t,height:r}=i;return yield this._decodeBuffer_Uint8Array(e,t,r,t,n.IPF_GrayScaled)}if(i&&i.canvas){let{data:e,canvas:t,region:r,sx:s,sy:o,sWidth:a,sHeight:d}=i;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let l=yield this._decodeBuffer_Uint8Array(e,t.width,t.height,4*t.width,n.IPF_ABGR_8888);return _.fixResultLocationWhenFilterRegionInJs(r,l,s,o,a,d,t.width,t.height),l}}))}clearMapDecodeRecord(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(l.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region)}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=3,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0],t.timeout=1e5}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=5,t.expectedBarcodesCount=512,t.scaleDownThreshold=1e5,t.localizationModes=[2,16,4,8,0,0,0,0],t.timeout=1e5}else if("single"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionNormalPreset(e.region)?t.region=JSON.parse(JSON.stringify(l.singlePresetRegion)):t.region=e.region,t.expectedBarcodesCount=1,t.localizationModes=[16,2,0,0,0,0,0,0],t.barcodeZoneMinDistanceToImageBorders=0}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let i=e.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=t.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})})),"single"==e&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");let t=[e];for(let e=0;e','','',''].join(""),this.dce._optGotRsl=this.dce._optGotRsl||this.dce._selRsl.options[0])):this.dce._optGotRsl||!e.classList.contains("dce-opt-gotResolution")&&!e.classList.contains("dbrScanner-opt-gotResolution")?this.dce._btnClose||!e.classList.contains("dce-btn-close")&&!e.classList.contains("dbrScanner-btn-close")?this.dce._video||!e.classList.contains("dce-existingVideo")&&!e.classList.contains("dbrScanner-existingVideo")||(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"),this.dce.singleFrameMode=!1):this.dce._btnClose=e:this.dce._optGotRsl=e:this.dce._selCam=e:this.dce._bgCamera=e:this.dce._bgLoading=e:(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"));if(this.dce._bindUI(),this._selCam=this.dce._selCam,this._selRsl=this.dce._selRsl,this._btnClose=this.dce._btnClose,this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.addEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="pointer",this._cvsDrawArea.setAttribute("title","Take a photo")),this._divScanArea&&(this._divScanArea.addEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="pointer",this._divScanArea.setAttribute("title","Take a photo"))),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this.dce.video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dbrScanner-video`.")}_unbindUI(){this._clearRegionsults(),this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.removeEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="",this._cvsDrawArea.removeAttribute("title")),this._divScanArea&&(this._divScanArea.removeEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="",this._divScanArea.removeAttribute("title"))),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this.dce._unbindUI(),this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null}set onPlayed(e){this.dce.onPlayed=e}get onPlayed(){return this.dce.onPlayed}get onUnduplicatedRead(){return this.onUniqueRead}set onUnduplicatedRead(e){this.onUniqueRead=e}getAllCameras(){return i(this,void 0,void 0,(function*(){return this.dce.getAllCameras()}))}getCurrentCamera(){return i(this,void 0,void 0,(function*(){return this.dce.getSelectedCamera()}))}setCurrentCamera(e){return i(this,void 0,void 0,(function*(){return this.dce.selectCamera(e)}))}getResolution(){return this.dce.getResolution()}setResolution(e,t){return i(this,void 0,void 0,(function*(){return this.dce.setResolution(e,t)}))}getScanSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),_._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return i(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),l._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,n){return i(this,void 0,void 0,(function*(){return this.dce.play(e,t,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return i(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return i(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return i(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return i(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return i(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return i(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return _._onLog&&_._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),_._onLog&&_._onLog("======= once read ======="),_._onLog&&(this._timeStartDecode=Date.now());let e=this._getVideoFrame();if(!e)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>i(this,void 0,void 0,(function*(){if(e&&null===e.canvas){let{data:t,width:i,height:r,timeStamp:s}=e,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(t,i,r,i,n.IPF_GrayScaled,o)}if(e&&e.canvas){let{data:t,canvas:i,region:r,sx:s,sy:o,width:a,height:d,timeStamp:l}=e,c={timeStamp:l};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let u=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,n.IPF_ABGR_8888,c);return _.fixResultLocationWhenFilterRegionInJs(r,u,s,o,i.width,i.height,a,d),u}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{_._onLog&&_._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})()+this.intervalTime,this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),_._onLog&&_._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return i(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var c,u,h,g,R,E,I,A,S,D,f,m,T,M,C,L,O,N,y,B,p,v,b,F,P,w,V;l._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",l.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(c||(c={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(u||(u={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(h||(h={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(g||(g={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(R||(R={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(E||(E={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(I||(I={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(A||(A={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(S||(S={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(f||(f={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(m||(m={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(T||(T={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(C||(C={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(L||(L={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(O||(O={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(N||(N={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(y||(y={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(B||(B={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(p||(p={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(v||(v={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(b||(b={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(F||(F={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(P||(P={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(w||(w={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(V||(V={}));class U{static get version(){return _.version}static get productKeys(){return _.productKeys}static set productKeys(e){_.productKeys=e}static get handshakeCode(){return _.handshakeCode}static set handshakeCode(e){_.handshakeCode=e}static get organizationID(){return _.organizationID}static set organizationID(e){_.organizationID=e}static get sessionPassword(){return _.sessionPassword}static set sessionPassword(e){_.sessionPassword=e}static get browserInfo(){return _.browserInfo}static detectEnvironment(){return _.detectEnvironment()}static get _workerName(){return _._workerName}static set _workerName(e){_._workerName=e}static get engineResourcePath(){return _.engineResourcePath}static set engineResourcePath(e){_.engineResourcePath=e}static get licenseServer(){return _.licenseServer}static set licenseServer(e){_.licenseServer=e}static get deviceFriendlyName(){return _.deviceFriendlyName}static set deviceFriendlyName(e){_.deviceFriendlyName=e}static get _onLog(){return _._onLog}static set _onLog(e){_._onLog=e}static get _bWasmDebug(){return _._bWasmDebug}static set _bWasmDebug(e){_._bWasmDebug=e}static get _bUseFullFeature(){return _._bUseFullFeature}static set _bUseFullFeature(e){_._bUseFullFeature=e}static get _dbrWorker(){return _._dbrWorker}static isLoaded(){return _.isLoaded()}static isWasmLoaded(){return _.isLoaded()}static loadWasm(){return _.loadWasm()}}U.DBR=U,U.BarcodeReader=_,U.BarcodeScanner=l,U.CameraEnhancer=e,U.EnumBarcodeColourMode=c,U.EnumBarcodeComplementMode=u,U.EnumBarcodeFormat=o,U.EnumBarcodeFormat_2=h,U.EnumBinarizationMode=g,U.EnumClarityCalculationMethod=R,U.EnumClarityFilterMode=E,U.EnumColourClusteringMode=I,U.EnumColourConversionMode=A,U.EnumConflictMode=S,U.EnumDeblurMode=D,U.EnumDeformationResistingMode=f,U.EnumDPMCodeReadingMode=m,U.EnumErrorCode=r,U.EnumGrayscaleTransformationMode=T,U.EnumImagePixelFormat=n,U.EnumImagePreprocessingMode=M,U.EnumIMResultDataType=s,U.EnumIntermediateResultSavingMode=C,U.EnumIntermediateResultType=L,U.EnumLocalizationMode=O,U.EnumPDFReadingMode=N,U.EnumQRCodeErrorCorrectionLevel=y,U.EnumRegionPredetectionMode=B,U.EnumResultCoordinateType=p,U.EnumResultType=v,U.EnumScaleUpMode=b,U.EnumTerminatePhase=F,U.EnumTextFilterMode=P,U.EnumTextResultOrderMode=w,U.EnumTextureDetectionMode=V;export{_ as BarcodeReader,l as BarcodeScanner,U as DBR,c as EnumBarcodeColourMode,u as EnumBarcodeComplementMode,o as EnumBarcodeFormat,h as EnumBarcodeFormat_2,g as EnumBinarizationMode,R as EnumClarityCalculationMethod,E as EnumClarityFilterMode,I as EnumColourClusteringMode,A as EnumColourConversionMode,S as EnumConflictMode,m as EnumDPMCodeReadingMode,D as EnumDeblurMode,f as EnumDeformationResistingMode,r as EnumErrorCode,T as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,n as EnumImagePixelFormat,M as EnumImagePreprocessingMode,C as EnumIntermediateResultSavingMode,L as EnumIntermediateResultType,O as EnumLocalizationMode,N as EnumPDFReadingMode,y as EnumQRCodeErrorCorrectionLevel,B as EnumRegionPredetectionMode,p as EnumResultCoordinateType,v as EnumResultType,b as EnumScaleUpMode,F as EnumTerminatePhase,P as EnumTextFilterMode,w as EnumTextResultOrderMode,V as EnumTextureDetectionMode,U as default}; diff --git a/dist/dbr.browser.pure.mjs b/dist/dbr.browser.pure.mjs index 8e16a4d..76d01a9 100644 --- a/dist/dbr.browser.pure.mjs +++ b/dist/dbr.browser.pure.mjs @@ -2,10 +2,10 @@ * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition * @website http://www.dynamsoft.com - * @copyright Copyright 2021, Dynamsoft Corporation + * @copyright Copyright 2022, Dynamsoft Corporation * @author Dynamsoft - * @version 8.8.3 (js 20211011) + * @version 8.8.7 (js 20220125) * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -import e,{CameraEnhancer as t}from"dynamsoft-camera-enhancer";export{default as CameraEnhancer}from"dynamsoft-camera-enhancer";function i(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var n,r,s,o;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(n||(n={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(r||(r={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(o||(o={})),"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;const a="undefined"==typeof self,d=a?{}:self;class _{constructor(){this._canvasMaxWH="iPhone"==_.browserInfo.OS||"Android"==_.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");_._license=e}static get productKeys(){return this._license}static set productKeys(e){_.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){_.license=e}static get organizationID(){return this._license}static set organizationID(e){_.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");_._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return i(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!("undefined"==typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),a)_._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,_._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(_._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)_._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;ti(this,void 0,void 0,(function*(){switch(_._loadWasmStatus){case"unload":{_._loadWasmStatus="loading";let e=_.engineResourcePath+_._workerName;_.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),_._dbrWorker=new Worker(e),_._dbrWorker.onerror=e=>{_._loadWasmStatus="loadFail";let t=new Error(e.message);_._loadWasmErr=t;for(let e of _._loadWasmCallbackArr)e(t);_._loadWasmCallbackArr=[]},_._dbrWorker.onmessage=e=>i(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":_._onLog&&_._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===l&&(e=!0),t.success){_._loadWasmStatus="loadSuccess",_._version=t.version+"(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._onLog&&_._onLog("load dbr worker success");for(let e of _._loadWasmCallbackArr)e();_._loadWasmCallbackArr=[],_._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,_._loadWasmStatus="loadFail",_._loadWasmErr=i;for(let e of _._loadWasmCallbackArr)e(i);_._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&_.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{_._taskCallbackMap.get(e)(i),_._taskCallbackMap.delete(e)}catch(t){throw _._taskCallbackMap.delete(e),t}break}default:_._onLog&&_._onLog(e)}})),_._dbrWorker.postMessage({type:"loadWasm",bd:_._bWasmDebug,engineResourcePath:_.engineResourcePath,version:_._jsVersion,brtk:!!l,bptk:1===l,lcs:t,dm:location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:_._bUseFullFeature,browserInfo:_.browserInfo,deviceFriendlyName:_.deviceFriendlyName,ls:n,sp:s,lm:o,cw:a})}case"loading":_._loadWasmCallbackArr.push((t=>{t?r(t):e()}));break;case"loadSuccess":e();break;case"loadFail":r(_._loadWasmErr)}}))))}))}static showDialog(e,t){return i(this,void 0,void 0,(function*(){if(!_._bNeverShowDialog)try{let i=yield fetch(_.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let n=yield i.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(i==e.target){o.remove();for(let e of s)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!l&&i.classList.contains("dls-license-icon-error"))l=i,"error"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-icon-warn"))c=i,"warn"!=e&&i.remove();else if(!u&&i.classList.contains("dls-license-msg-content")){u=i;let e=t;for(;e;){let t=e.indexOf("["),n=e.indexOf("]",t),r=e.indexOf("(",n),s=e.indexOf(")",r);if(-1==t||-1==n||-1==r||-1==s){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let o=document.createElement("a"),a=e.substring(t+1,n);o.innerText=a;let d=e.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),i.appendChild(o),e=e.substring(s+1)}}document.body.appendChild(o)}catch(e){_._onLog&&_._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return i(this,void 0,void 0,(function*(){return yield _.loadWasm(),yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:e})}))}))}static createInstance(){return i(this,void 0,void 0,(function*(){let e=new _;return e._instanceID=yield _.createInstanceInWorker(),e}))}decode(e){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("decode(source: any)"),_._onLog&&(this._timeStartDecode=Date.now());{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,a)=>{let d=_._nextTaskID++;_._taskCallbackMap.set(d,(e=>{if(e.success){let t,n=_._onLog?Date.now():0;_._onLog&&_._onLog("worker return result: "+n),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(_._onLog){let e=Date.now();_._onLog("DBR time get result: "+n),_._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),_._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),_._onLog("DBR worker handle results: "+(e-n)),_._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),_._onLog&&_._onLog("Send buffer to worker:"+Date.now()),_._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:n,stride:r,format:s,config:o}},[e.buffer]),_._onLog&&o&&o._timeEndGettingFrame&&_._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const i=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onload=()=>{t(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(i),t,n,r,s,o)}))}decodeBuffer(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){let i;return _._onLog&&_._onLog("decodeBuffer(buffer,width,height,stride,format)"),_._onLog&&(this._timeStartDecode=Date.now()),e instanceof Uint8Array||e instanceof Uint8ClampedArray?i=yield this._decodeBuffer_Uint8Array(e,t,n,r,s,o):e instanceof ArrayBuffer?i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,n,r,s,o):e instanceof Blob&&(i=yield this._decodeBuffer_Blob(e,t,n,r,s,o)),i}))}_decodeFileInMemory_Uint8Array(e){return i(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){let n;this._lastInnerDecodeDuration=e.duration;try{n=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(n)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=3,t.expectedBarcodesCount=0,t.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=5,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(this.bFilterRegionInJs){let e=t.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,t.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})}))}))}resetRuntimeSettings(){return i(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Blob(blob: Blob)");let i=null,n=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let r=yield this._decode_Image(i||n,t);return i&&i.close(),r}))}_decode_ArrayBuffer(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,n,r=e instanceof HTMLImageElement?e.naturalWidth:e.width,s=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=Math.max(r,s);if(o>this._canvasMaxWH){let e=this._canvasMaxWH/o;i=Math.round(r*e),n=Math.round(s*e)}else i=r,n=s;let a,l=0,c=0,u=r,h=s,g=i,R=n,E=t.region;if(E){let e,t,o,a;E.regionMeasuredByPercentage?(e=E.regionLeft*i/100,t=E.regionTop*n/100,o=E.regionRight*i/100,a=E.regionBottom*n/100):(e=E.regionLeft,t=E.regionTop,o=E.regionRight,a=E.regionBottom),g=o-e,u=Math.round(g/i*r),R=a-t,h=Math.round(R/n*s),l=Math.round(e/i*r),c=Math.round(t/n*s)}!this.bSaveOriCanvas&&d.OffscreenCanvas?a=new OffscreenCanvas(g,R):(a=document.createElement("canvas"),a.width=g,a.height=R);let I,A=a.getContext("2d");0==l&&0==c&&r==u&&s==h&&r==g&&s==R?A.drawImage(e,0,0):A.drawImage(e,l,c,u,h,0,0,g,R),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),E?(I=JSON.parse(JSON.stringify(t)),delete I.region):I=t;let S=yield this._decode_Canvas(a,I);return _.fixResultLocationWhenFilterRegionInJs(E,S,l,c,u,h,g,R),S}))}_decode_Canvas(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=e);let i=(e.dbrCtx2d||e.getContext("2d")).getImageData(0,0,e.width,e.height).data;return yield this._decodeBuffer_Uint8Array(i,e.width,e.height,4*e.width,n.IPF_ABGR_8888,t)}))}_decode_Video(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};const i=e.videoWidth,n=e.videoHeight,r=Math.max(i,n);let s,o;if(r>this._canvasMaxWH){let e=this._canvasMaxWH/r;s=Math.round(i*e),o=Math.round(n*e)}else s=i,o=n;let a=0,l=0,c=i,u=n,h=i,g=n,R=t.region;if(R){let e,t,r,d;R.regionMeasuredByPercentage?(e=R.regionLeft*s/100,t=R.regionTop*o/100,r=R.regionRight*s/100,d=R.regionBottom*o/100):(e=R.regionLeft,t=R.regionTop,r=R.regionRight,d=R.regionBottom),h=r-e,c=Math.round(h/s*i),g=d-t,u=Math.round(g/o*n),a=Math.round(e/s*i),l=Math.round(t/o*n)}let E=0==a&&0==l&&i==c&&n==u&&i==h&&n==g,I=null;!this.bSaveOriCanvas&&d.OffscreenCanvas?I=new OffscreenCanvas(h,g):(I=document.createElement("canvas"),I.width=h,I.height=g);const A=I.dbrCtx2d=I.getContext("2d");let S;E?A.drawImage(e,0,0):A.drawImage(e,a,l,c,u,0,0,h,g),R?(S=JSON.parse(JSON.stringify(t)),delete S.region):S=t;let D=yield this._decode_Canvas(I,t);return R&&_.fixResultLocationWhenFilterRegionInJs(R,D,a,l,c,u,h,g),D}))}_decode_Base64(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");"data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1));{let i=atob(e),n=i.length,r=new Uint8Array(n);for(;n--;)r[n]=i.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),t)}}))}_decode_Url(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");e=e;{let n=yield new Promise(((t,n)=>{let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.send(),r.onloadend=()=>i(this,void 0,void 0,(function*(){t(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,t)}}))}_decode_FilePath(e,t){return i(this,void 0,void 0,(function*(){throw _._onLog&&_._onLog("_decode_FilePath(path)"),Error("'_decode_FilePath(path, config)': The method is only supported in node environment.")}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,_=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+n,t.y2=t.y2/_+n,t.y3=t.y3/_+n,t.y4=t.y4/_+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let i,n=r.DBR_UNKNOWN;return"number"==typeof e?(n=e,i=new Error(t)):i=new Error(e),i.code=n,i}_handleRetJsonString(e){let t=r;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!_._setWarnnedEx.has(e.description)&&(_._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw _.BarcodeReaderException(e.exception,e.description)}setModeArgument(e,t,n,r){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,s)=>{let o=_._nextTaskID++;_._taskCallbackMap.set(o,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return s(e)}return i()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,s(t)}})),_._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n,argumentValue:r}})}))}))}getModeArgument(e,t,n){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,r)=>{let s=_._nextTaskID++;_._taskCallbackMap.set(s,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return r(e)}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,r(t)}})),_._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n}})}))}))}getIntermediateResults(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return i(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),t=[];for(let i of e)if(i.dataType==s.IMRDT_IMAGE)for(let e of i.results){const i=e.bytes;let r;switch(_._onLog&&_._onLog(" "+i.length+" "+i.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case n.IPF_ABGR_8888:r=new Uint8ClampedArray(i);break;case n.IPF_RGB_888:{const e=i.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}_._jsVersion="8.8.3",_._jsEditVersion="20211011",_._version="loading...(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._license=!a&&document.currentScript&&(document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID"))||"",_._sessionPassword=!a&&document.currentScript&&document.currentScript.getAttribute("data-sessionPassword")||"",_.browserInfo=function(){if(!a){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{if(!a&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),_._licenseServer=[],_._deviceFriendlyName="",_._isShowRelDecodeTimeInResults=!1,_._bWasmDebug=!1,_._bNeverShowDialog=!1,_.__bUseFullFeature=!0,_._nextTaskID=0,_._taskCallbackMap=new Map,_._loadWasmStatus="unload",_._loadWasmCallbackArr=[],_._lastErrorCode=0,_._lastErrorString="",_._setWarnnedEx=new Set,_._loadWasmErr=null,"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;class l extends _{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=l._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",_.engineResourcePath)}static set defaultUIElementURL(e){l._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return i(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{i(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return i(this,void 0,void 0,(function*(){this.dce||(_._onLog&&_._onLog("createDCEInstance()"),t.defaultUIElementURL=null,this.dce=yield t.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>i(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return i(this,void 0,void 0,(function*(){let t=new l;yield t.createDCEInstance(),t._instanceID=yield l.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(l.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(e){return i(this,void 0,void 0,(function*(){this._assertOpen();let t=null;e&&e.region&&(t=e.region);let i=this.dce.getFrame(t);if(i&&null===i.canvas){let{data:e,width:t,height:r}=i;return yield this._decodeBuffer_Uint8Array(e,t,r,t,n.IPF_GrayScaled)}if(i&&i.canvas){let{data:e,canvas:t,region:r,sx:s,sy:o,sWidth:a,sHeight:d}=i;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let l=yield this._decodeBuffer_Uint8Array(e,t.width,t.height,4*t.width,n.IPF_ABGR_8888);return _.fixResultLocationWhenFilterRegionInJs(r,l,s,o,a,d,t.width,t.height),l}}))}clearMapDecodeRecord(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(l.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region)}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=3,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0],t.timeout=1e5}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=5,t.expectedBarcodesCount=512,t.scaleDownThreshold=1e5,t.localizationModes=[2,16,4,8,0,0,0,0],t.timeout=1e5}else if("single"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionNormalPreset(e.region)?t.region=JSON.parse(JSON.stringify(l.singlePresetRegion)):t.region=e.region,t.expectedBarcodesCount=1,t.localizationModes=[16,2,0,0,0,0,0,0],t.barcodeZoneMinDistanceToImageBorders=0}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let i=e.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=t.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})})),"single"==e&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");this.dce._bindUI();let t=[e],i=e.children;for(let e of i)t.push(e);for(let e=0;e{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),_._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return i(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),l._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,n){return i(this,void 0,void 0,(function*(){return this.dce.play(e,t,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return i(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return i(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return i(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return i(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return i(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return i(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return _._onLog&&_._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),_._onLog&&_._onLog("======= once read ======="),_._onLog&&(this._timeStartDecode=Date.now());let e=this._getVideoFrame();if(!e)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>i(this,void 0,void 0,(function*(){if(e&&null===e.canvas){let{data:t,width:i,height:r,timeStamp:s}=e,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(t,i,r,i,n.IPF_GrayScaled,o)}if(e&&e.canvas){let{data:t,canvas:i,region:r,sx:s,sy:o,width:a,height:d,timeStamp:l}=e,c={timeStamp:l};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let u=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,n.IPF_ABGR_8888,c);return _.fixResultLocationWhenFilterRegionInJs(r,u,s,o,i.width,i.height,a,d),u}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{_._onLog&&_._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})(),this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),_._onLog&&_._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return i(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var c,u,h,g,R,E,I,A,S,D,f,T,m,M,C,L,O,N,y,B,v,p,b,F,P,w,V;l._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",l.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(c||(c={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(u||(u={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(h||(h={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(g||(g={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(R||(R={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(E||(E={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(I||(I={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(A||(A={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(S||(S={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(f||(f={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(T||(T={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(m||(m={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(C||(C={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(L||(L={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(O||(O={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(N||(N={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(y||(y={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(B||(B={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(v||(v={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(p||(p={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(b||(b={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(F||(F={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(P||(P={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(w||(w={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(V||(V={}));class U{static get version(){return _.version}static get productKeys(){return _.productKeys}static set productKeys(e){_.productKeys=e}static get handshakeCode(){return _.handshakeCode}static set handshakeCode(e){_.handshakeCode=e}static get organizationID(){return _.organizationID}static set organizationID(e){_.organizationID=e}static get sessionPassword(){return _.sessionPassword}static set sessionPassword(e){_.sessionPassword=e}static get browserInfo(){return _.browserInfo}static detectEnvironment(){return _.detectEnvironment()}static get _workerName(){return _._workerName}static set _workerName(e){_._workerName=e}static get engineResourcePath(){return _.engineResourcePath}static set engineResourcePath(e){_.engineResourcePath=e}static get licenseServer(){return _.licenseServer}static set licenseServer(e){_.licenseServer=e}static get deviceFriendlyName(){return _.deviceFriendlyName}static set deviceFriendlyName(e){_.deviceFriendlyName=e}static get _onLog(){return _._onLog}static set _onLog(e){_._onLog=e}static get _bWasmDebug(){return _._bWasmDebug}static set _bWasmDebug(e){_._bWasmDebug=e}static get _bUseFullFeature(){return _._bUseFullFeature}static set _bUseFullFeature(e){_._bUseFullFeature=e}static get _dbrWorker(){return _._dbrWorker}static isLoaded(){return _.isLoaded()}static isWasmLoaded(){return _.isLoaded()}static loadWasm(){return _.loadWasm()}}U.DBR=U,U.BarcodeReader=_,U.BarcodeScanner=l,U.CameraEnhancer=e,U.EnumBarcodeColourMode=c,U.EnumBarcodeComplementMode=u,U.EnumBarcodeFormat=o,U.EnumBarcodeFormat_2=h,U.EnumBinarizationMode=g,U.EnumClarityCalculationMethod=R,U.EnumClarityFilterMode=E,U.EnumColourClusteringMode=I,U.EnumColourConversionMode=A,U.EnumConflictMode=S,U.EnumDeblurMode=D,U.EnumDeformationResistingMode=f,U.EnumDPMCodeReadingMode=T,U.EnumErrorCode=r,U.EnumGrayscaleTransformationMode=m,U.EnumImagePixelFormat=n,U.EnumImagePreprocessingMode=M,U.EnumIMResultDataType=s,U.EnumIntermediateResultSavingMode=C,U.EnumIntermediateResultType=L,U.EnumLocalizationMode=O,U.EnumPDFReadingMode=N,U.EnumQRCodeErrorCorrectionLevel=y,U.EnumRegionPredetectionMode=B,U.EnumResultCoordinateType=v,U.EnumResultType=p,U.EnumScaleUpMode=b,U.EnumTerminatePhase=F,U.EnumTextFilterMode=P,U.EnumTextResultOrderMode=w,U.EnumTextureDetectionMode=V;export{_ as BarcodeReader,l as BarcodeScanner,U as DBR,c as EnumBarcodeColourMode,u as EnumBarcodeComplementMode,o as EnumBarcodeFormat,h as EnumBarcodeFormat_2,g as EnumBinarizationMode,R as EnumClarityCalculationMethod,E as EnumClarityFilterMode,I as EnumColourClusteringMode,A as EnumColourConversionMode,S as EnumConflictMode,T as EnumDPMCodeReadingMode,D as EnumDeblurMode,f as EnumDeformationResistingMode,r as EnumErrorCode,m as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,n as EnumImagePixelFormat,M as EnumImagePreprocessingMode,C as EnumIntermediateResultSavingMode,L as EnumIntermediateResultType,O as EnumLocalizationMode,N as EnumPDFReadingMode,y as EnumQRCodeErrorCorrectionLevel,B as EnumRegionPredetectionMode,v as EnumResultCoordinateType,p as EnumResultType,b as EnumScaleUpMode,F as EnumTerminatePhase,P as EnumTextFilterMode,w as EnumTextResultOrderMode,V as EnumTextureDetectionMode,U as default}; +import e,{CameraEnhancer as t}from"dynamsoft-camera-enhancer";export{default as CameraEnhancer}from"dynamsoft-camera-enhancer";function i(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var n,r,s,o;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(n||(n={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(r||(r={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(o||(o={})),"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;const a="undefined"==typeof self,d=a?{}:self;class _{constructor(){this._canvasMaxWH="iPhone"==_.browserInfo.OS||"Android"==_.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");_._license=e}static get productKeys(){return this._license}static set productKeys(e){_.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){_.license=e}static get organizationID(){return this._license}static set organizationID(e){_.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");_._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return i(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!("undefined"==typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),a)_._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,_._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(_._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)_._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;ti(this,void 0,void 0,(function*(){switch(_._loadWasmStatus){case"unload":{_._loadWasmStatus="loading";let e=_.engineResourcePath+_._workerName;_.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),_._dbrWorker=new Worker(e),_._dbrWorker.onerror=e=>{_._loadWasmStatus="loadFail";let t=new Error(e.message);_._loadWasmErr=t;for(let e of _._loadWasmCallbackArr)e(t);_._loadWasmCallbackArr=[]},_._dbrWorker.onmessage=e=>i(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":_._onLog&&_._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===l&&(e=!0),t.success){_._loadWasmStatus="loadSuccess",_._version=t.version+"(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._onLog&&_._onLog("load dbr worker success");for(let e of _._loadWasmCallbackArr)e();_._loadWasmCallbackArr=[],_._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,_._loadWasmStatus="loadFail",_._loadWasmErr=i;for(let e of _._loadWasmCallbackArr)e(i);_._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&_.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{_._taskCallbackMap.get(e)(i),_._taskCallbackMap.delete(e)}catch(t){throw _._taskCallbackMap.delete(e),t}break}default:_._onLog&&_._onLog(e)}})),_._dbrWorker.postMessage({type:"loadWasm",bd:_._bWasmDebug,engineResourcePath:_.engineResourcePath,version:_._jsVersion,brtk:!!l,bptk:1===l,lcs:t,dm:location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:_._bUseFullFeature,browserInfo:_.browserInfo,deviceFriendlyName:_.deviceFriendlyName,ls:n,sp:s,lm:o,cw:a})}case"loading":_._loadWasmCallbackArr.push((t=>{t?r(t):e()}));break;case"loadSuccess":e();break;case"loadFail":r(_._loadWasmErr)}}))))}))}static showDialog(e,t){return i(this,void 0,void 0,(function*(){if(!_._bNeverShowDialog)try{let i=yield fetch(_.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let n=yield i.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(i==e.target){o.remove();for(let e of s)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!l&&i.classList.contains("dls-license-icon-error"))l=i,"error"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-icon-warn"))c=i,"warn"!=e&&i.remove();else if(!u&&i.classList.contains("dls-license-msg-content")){u=i;let e=t;for(;e;){let t=e.indexOf("["),n=e.indexOf("]",t),r=e.indexOf("(",n),s=e.indexOf(")",r);if(-1==t||-1==n||-1==r||-1==s){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let o=document.createElement("a"),a=e.substring(t+1,n);o.innerText=a;let d=e.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),i.appendChild(o),e=e.substring(s+1)}}document.body.appendChild(o)}catch(e){_._onLog&&_._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return i(this,void 0,void 0,(function*(){return yield _.loadWasm(),yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:e})}))}))}static createInstance(){return i(this,void 0,void 0,(function*(){let e=new _;return e._instanceID=yield _.createInstanceInWorker(),e}))}decode(e){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("decode(source: any)"),_._onLog&&(this._timeStartDecode=Date.now());{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,a)=>{let d=_._nextTaskID++;_._taskCallbackMap.set(d,(e=>{if(e.success){let t,n=_._onLog?Date.now():0;_._onLog&&_._onLog("worker return result: "+n),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(_._onLog){let e=Date.now();_._onLog("DBR time get result: "+n),_._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),_._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),_._onLog("DBR worker handle results: "+(e-n)),_._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),_._onLog&&_._onLog("Send buffer to worker:"+this._timeEnterInnerDBR),_._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:n,stride:r,format:s,config:o}},[e.buffer]),_._onLog&&o&&o._timeEndGettingFrame&&_._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const i=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onload=()=>{t(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(i),t,n,r,s,o)}))}decodeBuffer(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){let i;return _._onLog&&_._onLog("decodeBuffer(buffer,width,height,stride,format)"),_._onLog&&(this._timeStartDecode=Date.now()),e instanceof Uint8Array||e instanceof Uint8ClampedArray?i=yield this._decodeBuffer_Uint8Array(e,t,n,r,s,o):e instanceof ArrayBuffer?i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,n,r,s,o):e instanceof Blob&&(i=yield this._decodeBuffer_Blob(e,t,n,r,s,o)),i}))}_decodeFileInMemory_Uint8Array(e){return i(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){let n;this._lastInnerDecodeDuration=e.duration;try{n=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(n)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=3,t.expectedBarcodesCount=0,t.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=5,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(this.bFilterRegionInJs){let e=t.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,t.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})}))}))}resetRuntimeSettings(){return i(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return i(this,void 0,void 0,(function*(){if(!_._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),_._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Blob(blob: Blob)");let i=null,n=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let r=yield this._decode_Image(i||n,t);return i&&i.close(),r}))}_decode_ArrayBuffer(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return i(this,void 0,void 0,(function*(){_._onLog&&_._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,n,r,s,o=e instanceof HTMLImageElement?e.naturalWidth:e.width,a=e instanceof HTMLImageElement?e.naturalHeight:e.height,l=t.region;if(l){let e,t,r,s;l.regionMeasuredByPercentage?(e=l.regionLeft*o/100,t=l.regionTop*a/100,r=l.regionRight*o/100,s=l.regionBottom*a/100):(e=l.regionLeft,t=l.regionTop,r=l.regionRight,s=l.regionBottom),i=e,n=t,o=Math.round(r-e),a=Math.round(s-t)}else i=0,n=0;const c=Math.max(o,a);if(c>this._canvasMaxWH){const e=this._canvasMaxWH/c;o>a?(r=this._canvasMaxWH,s=Math.round(a*e)):(r=Math.round(o*e),s=this._canvasMaxWH)}else r=o,s=a;let u,h;!this.bSaveOriCanvas&&d.OffscreenCanvas?u=new OffscreenCanvas(r,s):(u=document.createElement("canvas"),u.width=r,u.height=s),u.getContext("2d").drawImage(e,i,n,o,a,0,0,r,s),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),l?(h=JSON.parse(JSON.stringify(t)),delete h.region):h=t;let g=yield this._decode_Canvas(u,h);return _.fixResultLocationWhenFilterRegionInJs(l,g,i,n,o,a,r,s),g}))}_decode_Canvas(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=e);let i=(e.dbrCtx2d||e.getContext("2d")).getImageData(0,0,e.width,e.height).data;return yield this._decodeBuffer_Uint8Array(i,e.width,e.height,4*e.width,n.IPF_ABGR_8888,t)}))}_decode_Video(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};let i,n,r,s,o=e.videoWidth,a=e.videoHeight,l=t.region;if(l){let e,t,r,s;l.regionMeasuredByPercentage?(e=l.regionLeft*o/100,t=l.regionTop*a/100,r=l.regionRight*o/100,s=l.regionBottom*a/100):(e=l.regionLeft,t=l.regionTop,r=l.regionRight,s=l.regionBottom),i=e,n=t,o=Math.round(r-e),a=Math.round(s-t)}else i=0,n=0;const c=Math.max(o,a);if(c>this._canvasMaxWH){const e=this._canvasMaxWH/c;o>a?(r=this._canvasMaxWH,s=Math.round(a*e)):(r=Math.round(o*e),s=this._canvasMaxWH)}else r=o,s=a;let u=null;!this.bSaveOriCanvas&&d.OffscreenCanvas?u=new OffscreenCanvas(r,s):(u=document.createElement("canvas"),u.width=r,u.height=s);let h;(u.dbrCtx2d=u.getContext("2d")).drawImage(e,i,n,o,a,0,0,r,s),l?(h=JSON.parse(JSON.stringify(t)),delete h.region):h=t;let g=yield this._decode_Canvas(u,t);return l&&_.fixResultLocationWhenFilterRegionInJs(l,g,i,n,o,a,r,s),g}))}_decode_Base64(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");"data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1));{let i=atob(e),n=i.length,r=new Uint8Array(n);for(;n--;)r[n]=i.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),t)}}))}_decode_Url(e,t){return i(this,void 0,void 0,(function*(){if(_._onLog&&_._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");e=e;{let n=yield new Promise(((t,n)=>{let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.send(),r.onloadend=()=>i(this,void 0,void 0,(function*(){t(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,t)}}))}_decode_FilePath(e,t){return i(this,void 0,void 0,(function*(){throw _._onLog&&_._onLog("_decode_FilePath(path)"),Error("'_decode_FilePath(path, config)': The method is only supported in node environment.")}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,_=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+n,t.y2=t.y2/_+n,t.y3=t.y3/_+n,t.y4=t.y4/_+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let i,n=r.DBR_UNKNOWN;return"number"==typeof e?(n=e,i=new Error(t)):i=new Error(e),i.code=n,i}_handleRetJsonString(e){let t=r;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!_._setWarnnedEx.has(e.description)&&(_._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw _.BarcodeReaderException(e.exception,e.description)}setModeArgument(e,t,n,r){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,s)=>{let o=_._nextTaskID++;_._taskCallbackMap.set(o,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return s(e)}return i()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,s(t)}})),_._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n,argumentValue:r}})}))}))}getModeArgument(e,t,n){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,r)=>{let s=_._nextTaskID++;_._taskCallbackMap.set(s,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return r(e)}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,r(t)}})),_._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n}})}))}))}getIntermediateResults(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return i(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),t=[];for(let i of e)if(i.dataType==s.IMRDT_IMAGE)for(let e of i.results){const i=e.bytes;let r;switch(_._onLog&&_._onLog(" "+i.length+" "+i.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case n.IPF_ABGR_8888:r=new Uint8ClampedArray(i);break;case n.IPF_RGB_888:{const e=i.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}_._jsVersion="8.8.7",_._jsEditVersion="20220125",_._version="loading...(JS "+_._jsVersion+"."+_._jsEditVersion+")",_._license=!a&&document.currentScript&&(document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID"))||"",_._sessionPassword=!a&&document.currentScript&&document.currentScript.getAttribute("data-sessionPassword")||"",_.browserInfo=function(){if(!a){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{if(!a&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),_._licenseServer=[],_._deviceFriendlyName="",_._isShowRelDecodeTimeInResults=!1,_._bWasmDebug=!1,_._bNeverShowDialog=!1,_.__bUseFullFeature=!0,_._nextTaskID=0,_._taskCallbackMap=new Map,_._loadWasmStatus="unload",_._loadWasmCallbackArr=[],_._lastErrorCode=0,_._lastErrorString="",_._setWarnnedEx=new Set,_._loadWasmErr=null,"object"==typeof global&&global.process&&global.process.release&&global.process.release.name;class l extends _{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=l._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",_.engineResourcePath)}static set defaultUIElementURL(e){l._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return i(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{i(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return i(this,void 0,void 0,(function*(){this.dce||(_._onLog&&_._onLog("createDCEInstance()"),t.defaultUIElementURL=null,this.dce=yield t.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>i(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return i(this,void 0,void 0,(function*(){let t=new l;yield t.createDCEInstance(),t._instanceID=yield l.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(l.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(e){return i(this,void 0,void 0,(function*(){this._assertOpen();let t=null;e&&e.region&&(t=e.region);let i=this.dce.getFrame(t);if(i&&null===i.canvas){let{data:e,width:t,height:r}=i;return yield this._decodeBuffer_Uint8Array(e,t,r,t,n.IPF_GrayScaled)}if(i&&i.canvas){let{data:e,canvas:t,region:r,sx:s,sy:o,sWidth:a,sHeight:d}=i;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let l=yield this._decodeBuffer_Uint8Array(e,t.width,t.height,4*t.width,n.IPF_ABGR_8888);return _.fixResultLocationWhenFilterRegionInJs(r,l,s,o,a,d,t.width,t.height),l}}))}clearMapDecodeRecord(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),_._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(l.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region)}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=3,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0],t.timeout=1e5}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=5,t.expectedBarcodesCount=512,t.scaleDownThreshold=1e5,t.localizationModes=[2,16,4,8,0,0,0,0],t.timeout=1e5}else if("single"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,l.isRegionNormalPreset(e.region)?t.region=JSON.parse(JSON.stringify(l.singlePresetRegion)):t.region=e.region,t.expectedBarcodesCount=1,t.localizationModes=[16,2,0,0,0,0,0,0],t.barcodeZoneMinDistanceToImageBorders=0}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let i=e.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!_._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=t.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),_._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})})),"single"==e&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");let t=[e];for(let e=0;e','','',''].join(""),this.dce._optGotRsl=this.dce._optGotRsl||this.dce._selRsl.options[0])):this.dce._optGotRsl||!e.classList.contains("dce-opt-gotResolution")&&!e.classList.contains("dbrScanner-opt-gotResolution")?this.dce._btnClose||!e.classList.contains("dce-btn-close")&&!e.classList.contains("dbrScanner-btn-close")?this.dce._video||!e.classList.contains("dce-existingVideo")&&!e.classList.contains("dbrScanner-existingVideo")||(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"),this.dce.singleFrameMode=!1):this.dce._btnClose=e:this.dce._optGotRsl=e:this.dce._selCam=e:this.dce._bgCamera=e:this.dce._bgLoading=e:(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"));if(this.dce._bindUI(),this._selCam=this.dce._selCam,this._selRsl=this.dce._selRsl,this._btnClose=this.dce._btnClose,this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.addEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="pointer",this._cvsDrawArea.setAttribute("title","Take a photo")),this._divScanArea&&(this._divScanArea.addEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="pointer",this._divScanArea.setAttribute("title","Take a photo"))),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this.dce.video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dbrScanner-video`.")}_unbindUI(){this._clearRegionsults(),this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.removeEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="",this._cvsDrawArea.removeAttribute("title")),this._divScanArea&&(this._divScanArea.removeEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="",this._divScanArea.removeAttribute("title"))),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this.dce._unbindUI(),this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null}set onPlayed(e){this.dce.onPlayed=e}get onPlayed(){return this.dce.onPlayed}get onUnduplicatedRead(){return this.onUniqueRead}set onUnduplicatedRead(e){this.onUniqueRead=e}getAllCameras(){return i(this,void 0,void 0,(function*(){return this.dce.getAllCameras()}))}getCurrentCamera(){return i(this,void 0,void 0,(function*(){return this.dce.getSelectedCamera()}))}setCurrentCamera(e){return i(this,void 0,void 0,(function*(){return this.dce.selectCamera(e)}))}getResolution(){return this.dce.getResolution()}setResolution(e,t){return i(this,void 0,void 0,(function*(){return this.dce.setResolution(e,t)}))}getScanSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=_._nextTaskID++;_._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),_._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return i(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let n=_._nextTaskID++;_._taskCallbackMap.set(n,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),l._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,n){return i(this,void 0,void 0,(function*(){return this.dce.play(e,t,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return i(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return i(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return i(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return i(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return i(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return i(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return _._onLog&&_._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),_._onLog&&_._onLog("======= once read ======="),_._onLog&&(this._timeStartDecode=Date.now());let e=this._getVideoFrame();if(!e)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>i(this,void 0,void 0,(function*(){if(e&&null===e.canvas){let{data:t,width:i,height:r,timeStamp:s}=e,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(t,i,r,i,n.IPF_GrayScaled,o)}if(e&&e.canvas){let{data:t,canvas:i,region:r,sx:s,sy:o,width:a,height:d,timeStamp:l}=e,c={timeStamp:l};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let u=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,n.IPF_ABGR_8888,c);return _.fixResultLocationWhenFilterRegionInJs(r,u,s,o,i.width,i.height,a,d),u}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{_._onLog&&_._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})()+this.intervalTime,this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),_._onLog&&_._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return i(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var c,u,h,g,R,E,I,A,S,D,f,m,T,M,C,L,O,N,y,B,p,v,b,F,P,w,V;l._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",l.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(c||(c={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(u||(u={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(h||(h={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(g||(g={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(R||(R={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(E||(E={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(I||(I={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(A||(A={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(S||(S={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(f||(f={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(m||(m={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(T||(T={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(C||(C={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(L||(L={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(O||(O={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(N||(N={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(y||(y={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(B||(B={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(p||(p={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(v||(v={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(b||(b={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(F||(F={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(P||(P={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(w||(w={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(V||(V={}));class U{static get version(){return _.version}static get productKeys(){return _.productKeys}static set productKeys(e){_.productKeys=e}static get handshakeCode(){return _.handshakeCode}static set handshakeCode(e){_.handshakeCode=e}static get organizationID(){return _.organizationID}static set organizationID(e){_.organizationID=e}static get sessionPassword(){return _.sessionPassword}static set sessionPassword(e){_.sessionPassword=e}static get browserInfo(){return _.browserInfo}static detectEnvironment(){return _.detectEnvironment()}static get _workerName(){return _._workerName}static set _workerName(e){_._workerName=e}static get engineResourcePath(){return _.engineResourcePath}static set engineResourcePath(e){_.engineResourcePath=e}static get licenseServer(){return _.licenseServer}static set licenseServer(e){_.licenseServer=e}static get deviceFriendlyName(){return _.deviceFriendlyName}static set deviceFriendlyName(e){_.deviceFriendlyName=e}static get _onLog(){return _._onLog}static set _onLog(e){_._onLog=e}static get _bWasmDebug(){return _._bWasmDebug}static set _bWasmDebug(e){_._bWasmDebug=e}static get _bUseFullFeature(){return _._bUseFullFeature}static set _bUseFullFeature(e){_._bUseFullFeature=e}static get _dbrWorker(){return _._dbrWorker}static isLoaded(){return _.isLoaded()}static isWasmLoaded(){return _.isLoaded()}static loadWasm(){return _.loadWasm()}}U.DBR=U,U.BarcodeReader=_,U.BarcodeScanner=l,U.CameraEnhancer=e,U.EnumBarcodeColourMode=c,U.EnumBarcodeComplementMode=u,U.EnumBarcodeFormat=o,U.EnumBarcodeFormat_2=h,U.EnumBinarizationMode=g,U.EnumClarityCalculationMethod=R,U.EnumClarityFilterMode=E,U.EnumColourClusteringMode=I,U.EnumColourConversionMode=A,U.EnumConflictMode=S,U.EnumDeblurMode=D,U.EnumDeformationResistingMode=f,U.EnumDPMCodeReadingMode=m,U.EnumErrorCode=r,U.EnumGrayscaleTransformationMode=T,U.EnumImagePixelFormat=n,U.EnumImagePreprocessingMode=M,U.EnumIMResultDataType=s,U.EnumIntermediateResultSavingMode=C,U.EnumIntermediateResultType=L,U.EnumLocalizationMode=O,U.EnumPDFReadingMode=N,U.EnumQRCodeErrorCorrectionLevel=y,U.EnumRegionPredetectionMode=B,U.EnumResultCoordinateType=p,U.EnumResultType=v,U.EnumScaleUpMode=b,U.EnumTerminatePhase=F,U.EnumTextFilterMode=P,U.EnumTextResultOrderMode=w,U.EnumTextureDetectionMode=V;export{_ as BarcodeReader,l as BarcodeScanner,U as DBR,c as EnumBarcodeColourMode,u as EnumBarcodeComplementMode,o as EnumBarcodeFormat,h as EnumBarcodeFormat_2,g as EnumBinarizationMode,R as EnumClarityCalculationMethod,E as EnumClarityFilterMode,I as EnumColourClusteringMode,A as EnumColourConversionMode,S as EnumConflictMode,m as EnumDPMCodeReadingMode,D as EnumDeblurMode,f as EnumDeformationResistingMode,r as EnumErrorCode,T as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,n as EnumImagePixelFormat,M as EnumImagePreprocessingMode,C as EnumIntermediateResultSavingMode,L as EnumIntermediateResultType,O as EnumLocalizationMode,N as EnumPDFReadingMode,y as EnumQRCodeErrorCorrectionLevel,B as EnumRegionPredetectionMode,p as EnumResultCoordinateType,v as EnumResultType,b as EnumScaleUpMode,F as EnumTerminatePhase,P as EnumTextFilterMode,w as EnumTextResultOrderMode,V as EnumTextureDetectionMode,U as default}; diff --git a/dist/dbr.d.ts b/dist/dbr.d.ts index 8131ab5..3ba73e1 100644 --- a/dist/dbr.d.ts +++ b/dist/dbr.d.ts @@ -106,7 +106,7 @@ declare class DBR { * ``` * For convenience, you can set `productKeys` in `script` tag instead. * ```html - * + * * ``` */ static set productKeys(keys: string); @@ -151,7 +151,7 @@ declare class DBR { * If the auto-explored engine location is incorrect, you can manually specify the engine location. * The property needs to be set before [[loadWasm]]. * ```js - * Dynamsoft.DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/"; + * Dynamsoft.DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/"; * await Dynamsoft.DBR.loadWasm(); * ``` */ diff --git a/dist/dbr.js b/dist/dbr.js index 83bace2..10299b0 100644 --- a/dist/dbr.js +++ b/dist/dbr.js @@ -2,13 +2,13 @@ * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition * @website http://www.dynamsoft.com - * @copyright Copyright 2021, Dynamsoft Corporation + * @copyright Copyright 2022, Dynamsoft Corporation * @author Dynamsoft - * @version 8.8.3 (js 20211011) + * @version 8.8.7 (js 20220125) * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.DBR=t())}(this,(function(){"use strict";function e(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var t,i,n,r;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(t||(t={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(i||(i={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(n||(n={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(r||(r={}));const s=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),o=!s&&"undefined"==typeof self,a=s?global:o?{}:self;class d{constructor(){this._canvasMaxWH="iPhone"==d.browserInfo.OS||"Android"==d.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");d._license=e}static get productKeys(){return this._license}static set productKeys(e){d.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){d.license=e}static get organizationID(){return this._license}static set organizationID(e){d.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");d._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return e(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(s?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),s||o)d._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,d._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(d._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)d._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let t,n=d._license,r=JSON.parse(JSON.stringify(d._licenseServer)),o=d._sessionPassword,l=null,_=null,h=0;if(n.startsWith("t")||n.startsWith("f"))h=0;else if(0===n.length||n.startsWith("P")||n.startsWith("L"))h=1;else{h=2;const e=n.indexOf(":");if(-1!=e&&(n=n.substring(e+1)),n.startsWith("DLS2")){let e=n.substring(4);e=s?Buffer.from(e,"base64").toString("binary"):atob(e);const t=JSON.parse(e);if(t.handshakeCode?n=t.handshakeCode:t.organizationID&&(n=t.organizationID),"number"==typeof n&&(n=JSON.stringify(n)),n||(n=""),0===r.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),d.licenseServer=e,r=d.licenseServer,d.licenseServer=null}!o&&t.sessionPassword&&(o=t.sessionPassword),t.chargeWay&&(_=t.chargeWay),t.limitedLicenseModules&&(l=t.limitedLicenseModules)}}if(h&&(s?process.version<"v15"&&(t="To use online key requires nodejs version >= v15."):(a.crypto||(t="Please upgrade your browser to support online key."),a.crypto.subtle||(t="Require https to use online key in this browser."))),t){if(1!==h)throw new Error(t);h=0,console.warn(t),d._lastErrorCode=i.DMERR_FAILED_TO_REACH_LTS,d._lastErrorString=t}return 1===h&&(n="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((t,i)=>e(this,void 0,void 0,(function*(){switch(d._loadWasmStatus){case"unload":{d._loadWasmStatus="loading";let t=d.engineResourcePath+d._workerName;if(s||d.engineResourcePath.startsWith(location.origin)||(t=yield fetch(t).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),s){const e=yield import("worker_threads");d._dbrWorker=new e.Worker(t)}else d._dbrWorker=new Worker(t);d._dbrWorker.onerror=e=>{d._loadWasmStatus="loadFail";let t=new Error(e.message);d._loadWasmErr=t;for(let e of d._loadWasmCallbackArr)e(t);d._loadWasmCallbackArr=[]},d._dbrWorker.onmessage=t=>e(this,void 0,void 0,(function*(){let e=t.data?t.data:t;switch(e.type){case"log":d._onLog&&d._onLog(e.message);break;case"load":{e.message&&(e.message=e.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let t=!1;if(1===h&&(t=!0),e.success){d._loadWasmStatus="loadSuccess",d._version=e.version+"(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._onLog&&d._onLog("load dbr worker success");for(let e of d._loadWasmCallbackArr)e();d._loadWasmCallbackArr=[],d._dbrWorker.onerror=null,e.message&&console.warn(e.message)}else{let i=new Error(e.message);i.stack=e.stack+"\n"+i.stack,d._loadWasmStatus="loadFail",d._loadWasmErr=i;for(let e of d._loadWasmCallbackArr)e(i);d._loadWasmCallbackArr=[],t||111==e.ltsErrorCode&&-1!=e.message.toLowerCase().indexOf("trial license")&&(t=!0)}t&&d.showDialog(e.success?"warn":"error",e.message);break}case"task":{let t=e.id,i=e.body;try{d._taskCallbackMap.get(t)(i),d._taskCallbackMap.delete(t)}catch(e){throw d._taskCallbackMap.delete(t),e}break}default:d._onLog&&d._onLog(t)}})),s&&d._dbrWorker.on("message",d._dbrWorker.onmessage),d._dbrWorker.postMessage({type:"loadWasm",bd:d._bWasmDebug,engineResourcePath:d.engineResourcePath,version:d._jsVersion,brtk:!!h,bptk:1===h,lcs:n,dm:!s&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:d._bUseFullFeature,browserInfo:d.browserInfo,deviceFriendlyName:d.deviceFriendlyName,ls:r,sp:o,lm:l,cw:_})}case"loading":d._loadWasmCallbackArr.push((e=>{e?i(e):t()}));break;case"loadSuccess":t();break;case"loadFail":i(d._loadWasmErr)}}))))}))}static showDialog(t,i){return e(this,void 0,void 0,(function*(){if(!s&&!d._bNeverShowDialog)try{let e=yield fetch(d.engineResourcePath+"dls.license.dialog.html");if(!e.ok)throw Error("Get license dialog fail. Network Error: "+e.statusText);let n=yield e.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(e==t.target){o.remove();for(let e of s)e.remove()}}));else if(!l&&e.classList.contains("dls-license-icon-close"))l=e,e.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!_&&e.classList.contains("dls-license-icon-error"))_=e,"error"!=t&&e.remove();else if(!h&&e.classList.contains("dls-license-icon-warn"))h=e,"warn"!=t&&e.remove();else if(!c&&e.classList.contains("dls-license-msg-content")){c=e;let t=i;for(;t;){let i=t.indexOf("["),n=t.indexOf("]",i),r=t.indexOf("(",n),s=t.indexOf(")",r);if(-1==i||-1==n||-1==r||-1==s){e.appendChild(new Text(t));break}i>0&&e.appendChild(new Text(t.substring(0,i)));let o=document.createElement("a"),a=t.substring(i+1,n);o.innerText=a;let d=t.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),e.appendChild(o),t=t.substring(s+1)}}document.body.appendChild(o)}catch(e){d._onLog&&d._onLog(e.message||e)}}))}static createInstanceInWorker(t=!1){return e(this,void 0,void 0,(function*(){return yield d.loadWasm(),yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success)return e(t.instanceID);{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:t})}))}))}static createInstance(){return e(this,void 0,void 0,(function*(){let e=new d;return e._instanceID=yield d.createInstanceInWorker(),e}))}decode(t){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("decode(source: any)"),d._onLog&&(this._timeStartDecode=Date.now()),s)return t instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t)):t instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(t):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t):"http"==t.substring(0,4)?yield this._decode_Url(t):yield this._decode_FilePath(t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),t instanceof Blob?yield this._decode_Blob(t,e):t instanceof ArrayBuffer?yield this._decode_ArrayBuffer(t,e):t instanceof Uint8Array||t instanceof Uint8ClampedArray?yield this._decode_Uint8Array(t,e):t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?yield this._decode_Image(t,e):t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?yield this._decode_Canvas(t,e):t instanceof HTMLVideoElement?yield this._decode_Video(t,e):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t,e):yield this._decode_Url(t,e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(t,e)}))}decodeUrl(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(t,e)}))}_decodeBuffer_Uint8Array(t,i,n,r,s,o){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,a)=>{let l=d._nextTaskID++;d._taskCallbackMap.set(l,(t=>{if(t.success){let i,n=d._onLog?Date.now():0;d._onLog&&d._onLog("worker return result: "+n),this._lastInnerDecodeDuration=t.duration;try{i=this._handleRetJsonString(t.decodeReturn)}catch(e){return a(e)}if(d._onLog){let e=Date.now();d._onLog("DBR time get result: "+n),d._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),d._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),d._onLog("DBR worker handle results: "+(e-n)),d._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,a(e)}})),this._timeEnterInnerDBR=Date.now(),d._onLog&&d._onLog("Send buffer to worker:"+Date.now()),d._dbrWorker.postMessage({type:"decodeBuffer",id:l,instanceID:this._instanceID,body:{buffer:t,width:i,height:n,stride:r,format:s,config:o}},[t.buffer]),d._onLog&&o&&o._timeEndGettingFrame&&d._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(t,i,n,r,s,o){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const e=t.arrayBuffer?yield t.arrayBuffer():yield new Promise(((e,i)=>{let n=new FileReader;n.readAsArrayBuffer(t),n.onload=()=>{e(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(e),i,n,r,s,o)}))}decodeBuffer(t,i,n,r,o,a){return e(this,void 0,void 0,(function*(){let e;return d._onLog&&d._onLog("decodeBuffer(buffer,width,height,stride,format)"),d._onLog&&(this._timeStartDecode=Date.now()),s?t instanceof Uint8Array?e=yield this._decodeBuffer_Uint8Array(t,i,n,r,o,a):t instanceof Buffer&&(e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,n,r,o,a)):t instanceof Uint8Array||t instanceof Uint8ClampedArray?e=yield this._decodeBuffer_Uint8Array(t,i,n,r,o,a):t instanceof ArrayBuffer?e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,n,r,o,a):t instanceof Blob&&(e=yield this._decodeBuffer_Blob(t,i,n,r,o,a)),e}))}_decodeFileInMemory_Uint8Array(t){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success){let n;this._lastInnerDecodeDuration=t.duration;try{n=this._handleRetJsonString(t.decodeReturn)}catch(e){return i(e)}return e(n)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:t}})}))}))}getRuntimeSettings(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=3,e.expectedBarcodesCount=0,e.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=5,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let t=e.region;[t.regionLeft,t.regionTop,t.regionLeft,t.regionBottom,t.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:t.regionLeft||0,regionTop:t.regionTop||0,regionRight:t.regionRight||0,regionBottom:t.regionBottom||0,regionMeasuredByPercentage:t.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(r.BF_ONED|r.BF_QR_CODE|r.BF_PDF417|r.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!s)if(this.bFilterRegionInJs){let t=e.region;if(t instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(t)),(t.regionLeft||t.regionTop||t.regionRight||t.regionBottom||t.regionMeasuredByPercentage)&&(t.regionLeft||t.regionTop||100!=t.regionRight||100!=t.regionBottom||!t.regionMeasuredByPercentage)?this.region=t:this.region=null,e.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((t,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})}))}))}resetRuntimeSettings(){return e(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(t){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof t)t=t;else{if("object"!=typeof t)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");t=JSON.stringify(t)}return yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.initReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:t}})}))}))}_decode_Blob(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Blob(blob: Blob)");let e=null,n=null;if("undefined"!=typeof createImageBitmap)try{e=yield createImageBitmap(t)}catch(e){}e||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(t));let r=yield this._decode_Image(e||n,i);return e&&e.close(),r}))}_decode_ArrayBuffer(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Uint8Array(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Image(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),i=i||{};let e,n,r=t instanceof HTMLImageElement?t.naturalWidth:t.width,s=t instanceof HTMLImageElement?t.naturalHeight:t.height,o=Math.max(r,s);if(o>this._canvasMaxWH){let t=this._canvasMaxWH/o;e=Math.round(r*t),n=Math.round(s*t)}else e=r,n=s;let l,_=0,h=0,c=r,u=s,g=e,f=n,R=i.region;if(R){let t,i,o,a;R.regionMeasuredByPercentage?(t=R.regionLeft*e/100,i=R.regionTop*n/100,o=R.regionRight*e/100,a=R.regionBottom*n/100):(t=R.regionLeft,i=R.regionTop,o=R.regionRight,a=R.regionBottom),g=o-t,c=Math.round(g/e*r),f=a-i,u=Math.round(f/n*s),_=Math.round(t/e*r),h=Math.round(i/n*s)}!this.bSaveOriCanvas&&a.OffscreenCanvas?l=new OffscreenCanvas(g,f):(l=document.createElement("canvas"),l.width=g,l.height=f);let E,m=l.getContext("2d");0==_&&0==h&&r==c&&s==u&&r==g&&s==f?m.drawImage(t,0,0):m.drawImage(t,_,h,c,u,0,0,g,f),t.dbrObjUrl&&URL.revokeObjectURL(t.dbrObjUrl),R?(E=JSON.parse(JSON.stringify(i)),delete E.region):E=i;let I=yield this._decode_Canvas(l,E);return d.fixResultLocationWhenFilterRegionInJs(R,I,_,h,c,u,g,f),I}))}_decode_Canvas(i,n){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),i.crossOrigin&&"anonymous"!=i.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let e=(i.dbrCtx2d||i.getContext("2d")).getImageData(0,0,i.width,i.height).data;return yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888,n)}))}_decode_Video(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Video(video)"),!(t instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(t.crossOrigin&&"anonymous"!=t.crossOrigin)throw"cors";i=i||{};const e=t.videoWidth,n=t.videoHeight,r=Math.max(e,n);let s,o;if(r>this._canvasMaxWH){let t=this._canvasMaxWH/r;s=Math.round(e*t),o=Math.round(n*t)}else s=e,o=n;let l=0,_=0,h=e,c=n,u=e,g=n,f=i.region;if(f){let t,i,r,a;f.regionMeasuredByPercentage?(t=f.regionLeft*s/100,i=f.regionTop*o/100,r=f.regionRight*s/100,a=f.regionBottom*o/100):(t=f.regionLeft,i=f.regionTop,r=f.regionRight,a=f.regionBottom),u=r-t,h=Math.round(u/s*e),g=a-i,c=Math.round(g/o*n),l=Math.round(t/s*e),_=Math.round(i/o*n)}let R=0==l&&0==_&&e==h&&n==c&&e==u&&n==g,E=null;!this.bSaveOriCanvas&&a.OffscreenCanvas?E=new OffscreenCanvas(u,g):(E=document.createElement("canvas"),E.width=u,E.height=g);const m=E.dbrCtx2d=E.getContext("2d");let I;R?m.drawImage(t,0,0):m.drawImage(t,l,_,h,c,0,0,u,g),f?(I=JSON.parse(JSON.stringify(i)),delete I.region):I=i;let v=yield this._decode_Canvas(E,i);return f&&d.fixResultLocationWhenFilterRegionInJs(f,v,l,_,h,c,u,g),v}))}_decode_Base64(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Base64(base64Str)"),"string"!=typeof t)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==t.substring(0,11)&&(t=t.substring(t.indexOf(",")+1)),s){let e=Buffer.from(t,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e))}{let e=atob(t),n=e.length,r=new Uint8Array(n);for(;n--;)r[n]=e.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),i)}}))}_decode_Url(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Url(url)"),"string"!=typeof t)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(t=t,s){let i=yield new Promise(((i,n)=>e(this,void 0,void 0,(function*(){(t.startsWith("https")?yield import("https"):yield import("http")).get(t,(e=>{if(200==e.statusCode){let t=[];e.on("data",(e=>{t.push(e)})).on("end",(()=>{i(new Uint8Array(Buffer.concat(t)))}))}else n("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(i)}{let n=yield new Promise(((i,n)=>{let r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.send(),r.onloadend=()=>e(this,void 0,void 0,(function*(){i(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,i)}}))}_decode_FilePath(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_FilePath(path)"),!s)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof t)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const e=yield import("fs");let i=yield new Promise(((i,n)=>{e.readFile(t,((e,t)=>{e?n(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,l=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/l+n,t.y2=t.y2/l+n,t.y3=t.y3/l+n,t.y4=t.y4/l+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let n,r=i.DBR_UNKNOWN;return"number"==typeof e?(r=e,n=new Error(t)):n=new Error(e),n.code=r,n}_handleRetJsonString(e){let t=i;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!d._setWarnnedEx.has(e.description)&&(d._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw d.BarcodeReaderException(e.exception,e.description)}setModeArgument(t,i,n,r){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,s)=>{let o=d._nextTaskID++;d._taskCallbackMap.set(o,(t=>{if(t.success){try{this._handleRetJsonString(t.setReturn)}catch(e){return s(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,s(e)}})),d._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:n,argumentValue:r}})}))}))}getModeArgument(t,i,n){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,r)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(t=>{if(t.success){let i;try{i=this._handleRetJsonString(t.getReturn)}catch(e){return r(e)}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,r(e)}})),d._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:n}})}))}))}getIntermediateResults(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return e(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),i=[];for(let r of e)if(r.dataType==n.IMRDT_IMAGE)for(let e of r.results){const n=e.bytes;let r;switch(d._onLog&&d._onLog(" "+n.length+" "+n.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case t.IPF_ABGR_8888:r=new Uint8ClampedArray(n);break;case t.IPF_RGB_888:{const e=n.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}} +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.DBR=t())}(this,(function(){"use strict";function e(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{d(n.next(e))}catch(e){r(e)}}function a(e){try{d(n.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var t,i,n,s;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(t||(t={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(i||(i={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(n||(n={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(s||(s={}));const r=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),o=!r&&"undefined"==typeof self,a=r?global:o?{}:self;class d{constructor(){this._canvasMaxWH="iPhone"==d.browserInfo.OS||"Android"==d.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");d._license=e}static get productKeys(){return this._license}static set productKeys(e){d.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){d.license=e}static get organizationID(){return this._license}static set organizationID(e){d.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");d._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return e(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(r?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),r||o)d._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,d._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(d._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)d._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let t,n=d._license,s=JSON.parse(JSON.stringify(d._licenseServer)),o=d._sessionPassword,l=null,_=null,h=0;if(n.startsWith("t")||n.startsWith("f"))h=0;else if(0===n.length||n.startsWith("P")||n.startsWith("L"))h=1;else{h=2;const e=n.indexOf(":");if(-1!=e&&(n=n.substring(e+1)),n.startsWith("DLS2")){let e=n.substring(4);e=r?Buffer.from(e,"base64").toString("binary"):atob(e);const t=JSON.parse(e);if(t.handshakeCode?n=t.handshakeCode:t.organizationID&&(n=t.organizationID),"number"==typeof n&&(n=JSON.stringify(n)),n||(n=""),0===s.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),d.licenseServer=e,s=d.licenseServer}!o&&t.sessionPassword&&(o=t.sessionPassword),t.chargeWay&&(_=t.chargeWay),t.limitedLicenseModules&&(l=t.limitedLicenseModules)}}if(h&&(r?process.version<"v15"&&(t="To use online key requires nodejs version >= v15."):(a.crypto||(t="Please upgrade your browser to support online key."),a.crypto.subtle||(t="Require https to use online key in this browser."))),t){if(1!==h)throw new Error(t);h=0,console.warn(t),d._lastErrorCode=i.DMERR_FAILED_TO_REACH_LTS,d._lastErrorString=t}return 1===h&&(n="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((t,i)=>e(this,void 0,void 0,(function*(){switch(d._loadWasmStatus){case"unload":{d._loadWasmStatus="loading";let t=d.engineResourcePath+d._workerName;if(r||d.engineResourcePath.startsWith(location.origin)||(t=yield fetch(t).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),r){const e=yield import("worker_threads");d._dbrWorker=new e.Worker(t)}else d._dbrWorker=new Worker(t);d._dbrWorker.onerror=e=>{d._loadWasmStatus="loadFail";let t=new Error(e.message);d._loadWasmErr=t;for(let e of d._loadWasmCallbackArr)e(t);d._loadWasmCallbackArr=[]},d._dbrWorker.onmessage=t=>e(this,void 0,void 0,(function*(){let e=t.data?t.data:t;switch(e.type){case"log":d._onLog&&d._onLog(e.message);break;case"load":{e.message&&(e.message=e.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let t=!1;if(1===h&&(t=!0),e.success){d._loadWasmStatus="loadSuccess",d._version=e.version+"(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._onLog&&d._onLog("load dbr worker success");for(let e of d._loadWasmCallbackArr)e();d._loadWasmCallbackArr=[],d._dbrWorker.onerror=null,e.message&&console.warn(e.message)}else{let i=new Error(e.message);i.stack=e.stack+"\n"+i.stack,d._loadWasmStatus="loadFail",d._loadWasmErr=i;for(let e of d._loadWasmCallbackArr)e(i);d._loadWasmCallbackArr=[],t||111==e.ltsErrorCode&&-1!=e.message.toLowerCase().indexOf("trial license")&&(t=!0)}t&&d.showDialog(e.success?"warn":"error",e.message);break}case"task":{let t=e.id,i=e.body;try{d._taskCallbackMap.get(t)(i),d._taskCallbackMap.delete(t)}catch(e){throw d._taskCallbackMap.delete(t),e}break}default:d._onLog&&d._onLog(t)}})),r&&d._dbrWorker.on("message",d._dbrWorker.onmessage),d._dbrWorker.postMessage({type:"loadWasm",bd:d._bWasmDebug,engineResourcePath:d.engineResourcePath,version:d._jsVersion,brtk:!!h,bptk:1===h,lcs:n,dm:!r&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:d._bUseFullFeature,browserInfo:d.browserInfo,deviceFriendlyName:d.deviceFriendlyName,ls:s,sp:o,lm:l,cw:_})}case"loading":d._loadWasmCallbackArr.push((e=>{e?i(e):t()}));break;case"loadSuccess":t();break;case"loadFail":i(d._loadWasmErr)}}))))}))}static showDialog(t,i){return e(this,void 0,void 0,(function*(){if(!r&&!d._bNeverShowDialog)try{let e=yield fetch(d.engineResourcePath+"dls.license.dialog.html");if(!e.ok)throw Error("Get license dialog fail. Network Error: "+e.statusText);let n=yield e.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let s=document.createElement("div");s.innerHTML=n;let r=[];for(let e=0;e{if(e==t.target){o.remove();for(let e of r)e.remove()}}));else if(!l&&e.classList.contains("dls-license-icon-close"))l=e,e.addEventListener("click",(()=>{o.remove();for(let e of r)e.remove()}));else if(!_&&e.classList.contains("dls-license-icon-error"))_=e,"error"!=t&&e.remove();else if(!h&&e.classList.contains("dls-license-icon-warn"))h=e,"warn"!=t&&e.remove();else if(!c&&e.classList.contains("dls-license-msg-content")){c=e;let t=i;for(;t;){let i=t.indexOf("["),n=t.indexOf("]",i),s=t.indexOf("(",n),r=t.indexOf(")",s);if(-1==i||-1==n||-1==s||-1==r){e.appendChild(new Text(t));break}i>0&&e.appendChild(new Text(t.substring(0,i)));let o=document.createElement("a"),a=t.substring(i+1,n);o.innerText=a;let d=t.substring(s+1,r);o.setAttribute("href",d),o.setAttribute("target","_blank"),e.appendChild(o),t=t.substring(r+1)}}document.body.appendChild(o)}catch(e){d._onLog&&d._onLog(e.message||e)}}))}static createInstanceInWorker(t=!1){return e(this,void 0,void 0,(function*(){return yield d.loadWasm(),yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success)return e(t.instanceID);{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:t})}))}))}static createInstance(){return e(this,void 0,void 0,(function*(){let e=new d;return e._instanceID=yield d.createInstanceInWorker(),e}))}decode(t){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("decode(source: any)"),d._onLog&&(this._timeStartDecode=Date.now()),r)return t instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t)):t instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(t):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t):"http"==t.substring(0,4)?yield this._decode_Url(t):yield this._decode_FilePath(t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),t instanceof Blob?yield this._decode_Blob(t,e):t instanceof ArrayBuffer?yield this._decode_ArrayBuffer(t,e):t instanceof Uint8Array||t instanceof Uint8ClampedArray?yield this._decode_Uint8Array(t,e):t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?yield this._decode_Image(t,e):t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?yield this._decode_Canvas(t,e):t instanceof HTMLVideoElement?yield this._decode_Video(t,e):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t,e):yield this._decode_Url(t,e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(t,e)}))}decodeUrl(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(t,e)}))}_decodeBuffer_Uint8Array(t,i,n,s,r,o){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,a)=>{let l=d._nextTaskID++;d._taskCallbackMap.set(l,(t=>{if(t.success){let i,n=d._onLog?Date.now():0;d._onLog&&d._onLog("worker return result: "+n),this._lastInnerDecodeDuration=t.duration;try{i=this._handleRetJsonString(t.decodeReturn)}catch(e){return a(e)}if(d._onLog){let e=Date.now();d._onLog("DBR time get result: "+n),d._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),d._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),d._onLog("DBR worker handle results: "+(e-n)),d._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,a(e)}})),this._timeEnterInnerDBR=Date.now(),d._onLog&&d._onLog("Send buffer to worker:"+this._timeEnterInnerDBR),d._dbrWorker.postMessage({type:"decodeBuffer",id:l,instanceID:this._instanceID,body:{buffer:t,width:i,height:n,stride:s,format:r,config:o}},[t.buffer]),d._onLog&&o&&o._timeEndGettingFrame&&d._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(t,i,n,s,r,o){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const e=t.arrayBuffer?yield t.arrayBuffer():yield new Promise(((e,i)=>{let n=new FileReader;n.readAsArrayBuffer(t),n.onload=()=>{e(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(e),i,n,s,r,o)}))}decodeBuffer(t,i,n,s,o,a){return e(this,void 0,void 0,(function*(){let e;return d._onLog&&d._onLog("decodeBuffer(buffer,width,height,stride,format)"),d._onLog&&(this._timeStartDecode=Date.now()),r?t instanceof Uint8Array?e=yield this._decodeBuffer_Uint8Array(t,i,n,s,o,a):t instanceof Buffer&&(e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,n,s,o,a)):t instanceof Uint8Array||t instanceof Uint8ClampedArray?e=yield this._decodeBuffer_Uint8Array(t,i,n,s,o,a):t instanceof ArrayBuffer?e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,n,s,o,a):t instanceof Blob&&(e=yield this._decodeBuffer_Blob(t,i,n,s,o,a)),e}))}_decodeFileInMemory_Uint8Array(t){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success){let n;this._lastInnerDecodeDuration=t.duration;try{n=this._handleRetJsonString(t.decodeReturn)}catch(e){return i(e)}return e(n)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:t}})}))}))}getRuntimeSettings(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=3,e.expectedBarcodesCount=0,e.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=5,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let t=e.region;[t.regionLeft,t.regionTop,t.regionLeft,t.regionBottom,t.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:t.regionLeft||0,regionTop:t.regionTop||0,regionRight:t.regionRight||0,regionBottom:t.regionBottom||0,regionMeasuredByPercentage:t.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(s.BF_ONED|s.BF_QR_CODE|s.BF_PDF417|s.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!r)if(this.bFilterRegionInJs){let t=e.region;if(t instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(t)),(t.regionLeft||t.regionTop||t.regionRight||t.regionBottom||t.regionMeasuredByPercentage)&&(t.regionLeft||t.regionTop||100!=t.regionRight||100!=t.regionBottom||!t.regionMeasuredByPercentage)?this.region=t:this.region=null,e.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((t,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})}))}))}resetRuntimeSettings(){return e(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(t){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof t)t=t;else{if("object"!=typeof t)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");t=JSON.stringify(t)}return yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.initReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:t}})}))}))}_decode_Blob(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Blob(blob: Blob)");let e=null,n=null;if("undefined"!=typeof createImageBitmap)try{e=yield createImageBitmap(t)}catch(e){}e||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),s=new Image;s.dbrObjUrl=n,s.src=n,s.onload=()=>{t(s)},s.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(t));let s=yield this._decode_Image(e||n,i);return e&&e.close(),s}))}_decode_ArrayBuffer(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Uint8Array(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Image(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),i=i||{};let e,n,s,r,o=t instanceof HTMLImageElement?t.naturalWidth:t.width,l=t instanceof HTMLImageElement?t.naturalHeight:t.height,_=i.region;if(_){let t,i,s,r;_.regionMeasuredByPercentage?(t=_.regionLeft*o/100,i=_.regionTop*l/100,s=_.regionRight*o/100,r=_.regionBottom*l/100):(t=_.regionLeft,i=_.regionTop,s=_.regionRight,r=_.regionBottom),e=t,n=i,o=Math.round(s-t),l=Math.round(r-i)}else e=0,n=0;const h=Math.max(o,l);if(h>this._canvasMaxWH){const e=this._canvasMaxWH/h;o>l?(s=this._canvasMaxWH,r=Math.round(l*e)):(s=Math.round(o*e),r=this._canvasMaxWH)}else s=o,r=l;let c,u;!this.bSaveOriCanvas&&a.OffscreenCanvas?c=new OffscreenCanvas(s,r):(c=document.createElement("canvas"),c.width=s,c.height=r),c.getContext("2d").drawImage(t,e,n,o,l,0,0,s,r),t.dbrObjUrl&&URL.revokeObjectURL(t.dbrObjUrl),_?(u=JSON.parse(JSON.stringify(i)),delete u.region):u=i;let g=yield this._decode_Canvas(c,u);return d.fixResultLocationWhenFilterRegionInJs(_,g,e,n,o,l,s,r),g}))}_decode_Canvas(i,n){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),i.crossOrigin&&"anonymous"!=i.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let e=(i.dbrCtx2d||i.getContext("2d")).getImageData(0,0,i.width,i.height).data;return yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888,n)}))}_decode_Video(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Video(video)"),!(t instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(t.crossOrigin&&"anonymous"!=t.crossOrigin)throw"cors";i=i||{};let e,n,s,r,o=t.videoWidth,l=t.videoHeight,_=i.region;if(_){let t,i,s,r;_.regionMeasuredByPercentage?(t=_.regionLeft*o/100,i=_.regionTop*l/100,s=_.regionRight*o/100,r=_.regionBottom*l/100):(t=_.regionLeft,i=_.regionTop,s=_.regionRight,r=_.regionBottom),e=t,n=i,o=Math.round(s-t),l=Math.round(r-i)}else e=0,n=0;const h=Math.max(o,l);if(h>this._canvasMaxWH){const e=this._canvasMaxWH/h;o>l?(s=this._canvasMaxWH,r=Math.round(l*e)):(s=Math.round(o*e),r=this._canvasMaxWH)}else s=o,r=l;let c=null;!this.bSaveOriCanvas&&a.OffscreenCanvas?c=new OffscreenCanvas(s,r):(c=document.createElement("canvas"),c.width=s,c.height=r);let u;(c.dbrCtx2d=c.getContext("2d")).drawImage(t,e,n,o,l,0,0,s,r),_?(u=JSON.parse(JSON.stringify(i)),delete u.region):u=i;let g=yield this._decode_Canvas(c,i);return _&&d.fixResultLocationWhenFilterRegionInJs(_,g,e,n,o,l,s,r),g}))}_decode_Base64(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Base64(base64Str)"),"string"!=typeof t)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==t.substring(0,11)&&(t=t.substring(t.indexOf(",")+1)),r){let e=Buffer.from(t,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e))}{let e=atob(t),n=e.length,s=new Uint8Array(n);for(;n--;)s[n]=e.charCodeAt(n);return yield this._decode_Blob(new Blob([s]),i)}}))}_decode_Url(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Url(url)"),"string"!=typeof t)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(t=t,r){let i=yield new Promise(((i,n)=>e(this,void 0,void 0,(function*(){(t.startsWith("https")?yield import("https"):yield import("http")).get(t,(e=>{if(200==e.statusCode){let t=[];e.on("data",(e=>{t.push(e)})).on("end",(()=>{i(new Uint8Array(Buffer.concat(t)))}))}else n("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(i)}{let n=yield new Promise(((i,n)=>{let s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType="blob",s.send(),s.onloadend=()=>e(this,void 0,void 0,(function*(){i(s.response)})),s.onerror=()=>{n(new Error("Network Error: "+s.statusText))}}));return yield this._decode_Blob(n,i)}}))}_decode_FilePath(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_FilePath(path)"),!r)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof t)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const e=yield import("fs");let i=yield new Promise(((i,n)=>{e.readFile(t,((e,t)=>{e?n(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,s,r,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/s,l=a/r;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/l+n,t.y2=t.y2/l+n,t.y3=t.y3/l+n,t.y4=t.y4/l+n,2==t.resultCoordinateType&&(t.x1*=100/s,t.x2*=100/s,t.x3*=100/s,t.x4*=100/s,t.y1*=100/r,t.y2*=100/r,t.y3*=100/r,t.y4*=100/r)}}static BarcodeReaderException(e,t){let n,s=i.DBR_UNKNOWN;return"number"==typeof e?(s=e,n=new Error(t)):n=new Error(e),n.code=s,n}_handleRetJsonString(e){let t=i;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!d._setWarnnedEx.has(e.description)&&(d._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw d.BarcodeReaderException(e.exception,e.description)}setModeArgument(t,i,n,s){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,r)=>{let o=d._nextTaskID++;d._taskCallbackMap.set(o,(t=>{if(t.success){try{this._handleRetJsonString(t.setReturn)}catch(e){return r(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,r(e)}})),d._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:n,argumentValue:s}})}))}))}getModeArgument(t,i,n){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,s)=>{let r=d._nextTaskID++;d._taskCallbackMap.set(r,(t=>{if(t.success){let i;try{i=this._handleRetJsonString(t.getReturn)}catch(e){return s(e)}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,s(e)}})),d._dbrWorker.postMessage({type:"getModeArgument",id:r,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:n}})}))}))}getIntermediateResults(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return e(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),i=[];for(let s of e)if(s.dataType==n.IMRDT_IMAGE)for(let e of s.results){const n=e.bytes;let s;switch(d._onLog&&d._onLog(" "+n.length+" "+n.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case t.IPF_ABGR_8888:s=new Uint8ClampedArray(n);break;case t.IPF_RGB_888:{const e=n.length/3;s=new Uint8ClampedArray(4*e);for(let t=0;t{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}} /*! * Dynamsoft JavaScript Library * @product Dynamsoft Camera Enhancer JS Edition @@ -19,4 +19,4 @@ * @fileoverview Dynamsoft JavaScript Library for Camera Enhancer * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -function l(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}d._jsVersion="8.8.3",d._jsEditVersion="20211011",d._version="loading...(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._license=s||o||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",d._sessionPassword=s||o||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",d.browserInfo=function(){if(!s&&!o){var t={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{e(this,void 0,void 0,(function*(){const e=yield import("os");t.OS=e&&e.platform?e.platform()+e.release():"Unknown"}))})(),t}}(),d._workerName="dbr-"+d._jsVersion+".worker.js",d._engineResourcePath=(()=>{if(s)return __dirname+"/";if(!o&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),d._licenseServer=[],d._deviceFriendlyName="",d._isShowRelDecodeTimeInResults=!1,d._bWasmDebug=!1,d._bNeverShowDialog=!1,d.__bUseFullFeature=!0,d._nextTaskID=0,d._taskCallbackMap=new Map,d._loadWasmStatus="unload",d._loadWasmCallbackArr=[],d._lastErrorCode=0,d._lastErrorString="",d._setWarnnedEx=new Set,d._loadWasmErr=null;const _=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),h=!_&&"undefined"==typeof self;class c{constructor(){this._canvasMaxWH="iPhone"==c.browserInfo.OS||"Android"==c.browserInfo.OS?2048:4096,this._singleFrameMode=!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia),this._singleFrameModeIpt=()=>{let e=document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.setAttribute("capture",""),e.addEventListener("change",(()=>l(this,void 0,void 0,(function*(){let t=e.files[0];e.value="",this.onSingleFrameAcquired(t)})))),e},this._clickIptSingleFrameMode=()=>{this._singleFrameModeIpt().click()},this.styleEls=[],this.bSaveOriCanvas=!0,this.maxVideoCvsLength=3,this.videoCvses=[],this.videoGlCvs=null,this.videoGl=null,this.glImgData=null,this._onCameraSelChange=()=>{this.play(this._selCam.value).then((()=>{this._isOpen||this.stop()}))},this._onResolutionSelChange=()=>{let e,t;if(this._selRsl&&-1!=this._selRsl.selectedIndex){let i=this._selRsl.options[this._selRsl.selectedIndex];e=i.getAttribute("data-width"),t=i.getAttribute("data-height")}this.play(void 0,e,t).then((()=>{this._isOpen||this.stop()}))},this._onCloseBtnClick=()=>{this.close()},this._isOpen=!1,this.videoSettings={video:{width:{ideal:1280},height:{ideal:720},facingMode:{ideal:"environment"}}},this.iPlayRound=0,this.promisePlay=null,this._allCameras=[],this._currentCamera=null,this._videoTrack=null,this._lastDeviceId=void 0,this._vc_bPlayingVideoBeforeHide=!1,this._ev_documentHideEvent=()=>{"visible"===document.visibilityState?this._vc_bPlayingVideoBeforeHide&&("Firefox"==c.browserInfo.browser?this.play():this._video.play(),this._vc_bPlayingVideoBeforeHide=!1):this._video&&!this._video.paused&&(this._vc_bPlayingVideoBeforeHide=!0,this._video.pause())},this._video=null,this._bgLoading=null,this._selCam=null,this._bgCamera=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._region=null,this.bChangeRegionIndexManually=!1,this._regionIndex=-1,this._loopInterval=0,this._frameQueueMaxLength=1,this._frameQueue=[],this._bFetchingLoopStarted=!1,this._bStoppedByPause=!1,this.alwaysRefreshBuffer=!0,this._bufferRefreshInterval=0,this.bDestroyed=!1}static getVersion(){return this._version}static detectEnvironment(){return l(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(_?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if(this._hasEngineResourceLoaded)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` is called.");if(null==e&&(e="./"),_||h)c._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,c._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(c._engineResourcePath+="/")}static get defaultUIElementURL(){var e;return null===(e=this._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",c.engineResourcePath)}static set defaultUIElementURL(e){this._defaultUIElementURL=e}getUIElement(){return this.UIElement}setUIElement(e){return l(this,void 0,void 0,(function*(){if("string"==typeof e||e instanceof String){if(!e.trim().startsWith("<")){let t=yield fetch(e);if(!t.ok)throw Error("setUIElement(elementOrUrl): Network Error: "+t.statusText);e=yield t.text()}if(!e.trim().startsWith("<"))throw Error("setUIElement(elementOrUrl): Can't get valid HTMLElement.");let t=document.createElement("div");t.innerHTML=e;for(let e=0;e','','',''].join(""),this._optGotRsl=this._optGotRsl||this._selRsl.options[0])):!this._optGotRsl&&t.classList.contains("dce-opt-gotResolution")?this._optGotRsl=t:!this._btnClose&&t.classList.contains("dce-btn-close")?this._btnClose=t:!this._video&&t.classList.contains("dce-existingVideo")?(this._video=t,this._video.setAttribute("playsinline","true")):!i&&t.tagName&&"video"==t.tagName.toLowerCase()&&(i=t);if(!this._video&&i&&(this._video=i),this.singleFrameMode?this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")):this._bgLoading&&(this._bgLoading.style.display=""),this.singleFrameMode?(this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")),this._bgCamera&&(this._bgCamera.style.display="")):this._bgLoading&&(this._bgLoading.style.display=""),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this._video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dce-video`");this._isOpen=!0}_unbindUI(){this.singleFrameMode?(this._video&&(this._video.removeEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="",this._video.removeAttribute("title")),this._bgCamera&&(this._bgCamera.style.display="none")):this._bgLoading&&(this._bgLoading.style.display="none"),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this._video=null,this._selCam=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._isOpen=!1}_assertOpen(){if(!this._isOpen)throw Error("The camera is not open.")}get video(){return this._video}set region(e){this._region=e,this._bFetchingLoopStarted&&(this._regionIndex=-1,this._fetchingLoop(!1))}get region(){return this._region}set regionIndex(e){this.bChangeRegionIndexManually&&(this._region instanceof Array&&this._region.length>e?this._regionIndex=e:this._regionIndex=0)}get regionIndex(){return this._regionIndex}set loopInterval(e){e>=0&&(this._loopInterval=e),this._bFetchingLoopStarted&&this._fetchingLoop(!1)}get loopInterval(){return this._loopInterval}set frameQueueMaxLength(e){for(this._frameQueueMaxLength=e;this._frameQueue&&this._frameQueue.length>this._frameQueueMaxLength;)this._frameQueue.shift()}get frameQueueMaxLength(){return this._frameQueueMaxLength}get frameQueue(){return JSON.parse(JSON.stringify(this._frameQueue))}set bufferRefreshInterval(e){this._bufferRefreshInterval=e}get bufferRefreshInterval(){return this._bufferRefreshInterval}isContextDestroyed(){return this.bDestroyed}static createInstance(e){return l(this,void 0,void 0,(function*(){if(_)throw new Error("`CameraEnhancer` is not supported in Node.js.");let t=new c;("string"==typeof e||e instanceof String)&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(this.defaultUIElementURL),this._hasEngineResourceLoaded=!0,document.addEventListener("visibilitychange",t._ev_documentHideEvent),t}))}play(e,t,i){return l(this,void 0,void 0,(function*(){if(this._assertOpen(),this._video&&this.videoSrc){yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),"string"==typeof this.videoSrc||this.videoSrc instanceof String?this._video.src=this.videoSrc:this._video.srcObject=this.videoSrc,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}));let e={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(e)}),0),e}if(this.singleFrameMode)return this._clickIptSingleFrameMode(),{width:0,height:0};const n=++this.iPlayRound;return this.promisePlay&&(yield this.promisePlay,nl(this,void 0,void 0,(function*(){var n;try{this._video&&this._video.srcObject&&this.stop(),c._onLog&&c._onLog("DCE: ======before video========"),yield this.getAllCameras();let r=()=>{if(this.bDestroyed)throw d&&d.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null,new Error("The CameraEnhancer instance has been destroyed.")};const s=JSON.parse(JSON.stringify(this.videoSettings));let o;"boolean"==typeof s.video&&(s.video={}),t&&(s.video.width={ideal:t}),i&&(s.video.height={ideal:i});const a=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];let d,_=()=>{for(let e of this._allCameras){let t=e.label.toLowerCase();if(t&&a.some((e=>-1!=t.indexOf(e)))&&/\b0(\b)?/.test(t)){delete s.video.facingMode,s.video.deviceId={ideal:e.deviceId};break}}s.video.deviceId||-1==["Android","HarmonyOS"].indexOf(c.browserInfo.OS)||(delete s.video.facingMode,s.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})};if(e)delete s.video.facingMode,s.video.deviceId={exact:e},this._lastDeviceId=e;else if(s.video.deviceId);else if(this._lastDeviceId)delete s.video.facingMode,s.video.deviceId={exact:this._lastDeviceId};else if(s.video.facingMode){let e=s.video.facingMode;e instanceof Array&&e.length&&(e=e[0]),e=e.exact||e.ideal||e,"environment"===e&&(o=!!s.video.facingMode,_())}c._onLog&&c._onLog("DCE: ======try getUserMedia========");let h,u=[0,500],g=null,f=null,R=e=>l(this,void 0,void 0,(function*(){for(let t of u){r(),t&&(yield new Promise((e=>setTimeout(e,t)))),r();{const t=e.video.deviceId;f=t?t.exact||t.ideal||t:null}try{c._onLog&&c._onLog("DCE: ask "+JSON.stringify(e)),d=yield navigator.mediaDevices.getUserMedia(e);break}catch(e){g=e,c._onLog&&c._onLog("DCE: "+e.message||e)}}}));if(yield R(s),d||(c._onLog&&c._onLog("DCE: ======try getUserMedia again========"),h=JSON.parse(JSON.stringify(s)),"object"==typeof h.video&&("iPhone"==c.browserInfo.OS?(t>=1280||i>=1280?h.video.width=1280:t>=640||i>=640?h.video.width=640:(t<640||i<640)&&(h.video.width=320),delete h.video.height):o&&!s.video.deviceId?(delete h.video.facingMode,this._allCameras.length&&(h.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})):h.video=!0),c._onLog&&c._onLog("DCE: "+h),yield R(h)),d||(u=[1e3,2e3],yield R(s)),d||(yield R(h)),!d)throw g;const E=()=>{const e=d.getVideoTracks();let t,i;if(e.length&&(t=this._videoTrack=e[0]),this._video&&t){if(t.label)for(let e of this._allCameras)if(t.label==e.label){e._checked=!0,i=e,this._lastDeviceId=e.deviceId;break}if(!i&&f)for(let e of this._allCameras)if(f==e.deviceId){t.label&&(e._checked=!0,e.label=t.label),i=e,this._lastDeviceId=e.deviceId;break}}this._currentCamera=i};if(yield this.getAllCameras(),r(),o){E(),_();let e=s.video.deviceId;e&&(e=e.exact||e.ideal||e);let t=null===(n=this._currentCamera)||void 0===n?void 0:n.deviceId;!e||t&&e==t||(d.getTracks().forEach((e=>{e.stop()})),u=[0,500,1e3,2e3],yield R(s))}r();const m=()=>l(this,void 0,void 0,(function*(){c._onLog&&c._onLog("======play video========"),yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),this._video.srcObject=d,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}))}));yield m(),c._onLog&&c._onLog("DCE: ======played video========"),this._bgLoading&&(this._bgLoading.style.animationPlayState="paused");const I="got "+this._video.videoWidth+"x"+this._video.videoHeight;this._optGotRsl&&(this._optGotRsl.setAttribute("data-width",this._video.videoWidth),this._optGotRsl.setAttribute("data-height",this._video.videoHeight),this._optGotRsl.innerText=I,this._selRsl&&this._optGotRsl.parentNode==this._selRsl&&(this._selRsl.value="got")),c._onLog&&c._onLog("DCE: "+I),E(),r(),this._renderSelCameraInfo();let v={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(v)}),0),this.promisePlay=null,v}catch(e){throw this.promisePlay=null,e}})))(),yield this.promisePlay)}))}resume(){return l(this,void 0,void 0,(function*(){yield this.play(),this._bStoppedByPause&&(this._bStoppedByPause=!1,this.startFetchingLoop())}))}pause(){this._video&&this._video.pause(),this._bFetchingLoopStarted&&(this.stopFetchingLoop(),this._bStoppedByPause=!0)}close(){return l(this,void 0,void 0,(function*(){this.stop(),this._unbindUI(),this.UIElement.style.display="none",this.stopFetchingLoop()}))}open(){return l(this,void 0,void 0,(function*(){return this._bindUI(),this.UIElement.parentNode||(this.UIElement.style.position="fixed",this.UIElement.style.left="0",this.UIElement.style.top="0",document.body.append(this.UIElement)),"none"==this.UIElement.style.display&&(this.UIElement.style.display=""),yield this.play()}))}stop(){this._video&&this._video.srcObject&&(c._onLog&&c._onLog("DCE: ======stop video========"),this._video.srcObject.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null),this._video&&this._video.classList.contains("dce-existingVideo")&&(c._onLog&&c._onLog("DCE: ======stop existing video========"),this._video.pause(),this._video.currentTime=0),this._bgLoading&&(this._bgLoading.style.animationPlayState=""),this._frameQueue.length=0}getAllCameras(){return l(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t=[],i=[];if(this._allCameras)for(let e of this._allCameras)e._checked&&i.push(e);for(let n=0;nt.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{colorTemperature:e}]})}))}setExposureCompensation(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().exposureCompensation;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{exposureCompensation:e}]})}))}setZoom(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().zoom;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{zoom:e}]})}))}setFrameRate(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().frameRate;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({width:{ideal:Math.max(this._video.videoWidth,this._video.videoHeight)},frameRate:e})}))}getFrameRate(){return this.getCameraSettings().frameRate}getFrame(e){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");this._assertOpen(),c._onLog&&c._onLog("DCE: getFrame(region?)");const t=Date.now(),i=this._video.videoWidth,n=this._video.videoHeight,r=Math.max(i,n);let s,o;if(r>this._canvasMaxWH){let e=this._canvasMaxWH/r;s=Math.round(i*e),o=Math.round(n*e)}else s=i,o=n;let a=0,d=0,l=i,_=n,h=i,u=n;if(e){let t,r,c,g;e.regionMeasuredByPercentage?(t=e.regionLeft*s/100,r=e.regionTop*o/100,c=e.regionRight*s/100,g=e.regionBottom*o/100):(t=e.regionLeft,r=e.regionTop,c=e.regionRight,g=e.regionBottom),h=c-t,l=Math.round(h/s*i),u=g-r,_=Math.round(u/o*n),a=Math.round(t/s*i),d=Math.round(r/o*n)}let g=0==a&&0==d&&i==l&&n==_&&i==h&&n==u;if(!this.bSaveOriCanvas&&g){this.videoGlCvs||(this.videoGlCvs=globalThis.OffscreenCanvas?new OffscreenCanvas(h,u):document.createElement("canvas"));const e=this.videoGlCvs;e.width==h&&e.height==u||(e.height=u,e.width=h,this.videoGl&&this.videoGl.viewport(0,0,h,u));const i=this.videoGl||e.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0})||e.getContext("experimental-webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0});if(!this.videoGl){this.videoGl=i;const e=i.createShader(i.VERTEX_SHADER);i.shaderSource(e,"\nattribute vec4 a_position;\nattribute vec2 a_uv;\n\nvarying vec2 v_uv;\n\nvoid main() {\n gl_Position = a_position;\n v_uv = a_uv;\n}\n"),i.compileShader(e),i.getShaderParameter(e,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(e));const t=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(t,"\nprecision lowp float;\n\nvarying vec2 v_uv;\n\nuniform sampler2D u_texture;\n\nvoid main() {\n vec4 sample = texture2D(u_texture, v_uv);\n float grey = 0.299 * sample.r + 0.587 * sample.g + 0.114 * sample.b;\n gl_FragColor = vec4(grey, 0.0, 0.0, 1.0);\n}\n"),i.compileShader(t),i.getShaderParameter(t,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(t));const n=i.createProgram();i.attachShader(n,e),i.attachShader(n,t),i.linkProgram(n),i.getProgramParameter(n,i.LINK_STATUS)||console.error("Unable to initialize the shader program: "+i.getProgramInfoLog(n)),i.useProgram(n),i.bindBuffer(i.ARRAY_BUFFER,i.createBuffer()),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,1,0,1,1,1,1,1,-1,-1,0,0,1,-1,1,0]),i.STATIC_DRAW);const r=i.getAttribLocation(n,"a_position");i.enableVertexAttribArray(r),i.vertexAttribPointer(r,2,i.FLOAT,!1,16,0);const s=i.getAttribLocation(n,"a_uv");i.enableVertexAttribArray(s),i.vertexAttribPointer(s,2,i.FLOAT,!1,16,8),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,i.createTexture()),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.uniform1i(i.getUniformLocation(n,"u_texture"),0)}(!this.glImgData||this.glImgData.length=this.maxVideoCvsLength&&(this.videoCvses=this.videoCvses.slice(1)),this.videoCvses.push(i))}const n=i.dbrCtx2d;g?n.drawImage(this._video,0,0):n.drawImage(this._video,a,d,l,_,0,0,h,u);let r=i.dbrCtx2d||i.getContext("2d");if(0===i.width||0===i.height)return null;let s=r.getImageData(0,0,i.width,i.height).data;const o=Date.now();return{data:s,canvas:i,region:e,sx:a,sy:d,width:l,height:_,timeSpent:o-t,timeStamp:o}}}getCurrentRegion(){let e;if(this._region)if(this._region instanceof Array){if(this.bChangeRegionIndexManually){if(this._regionIndex>=this._region.length)throw new Error("the 'regionIndex' should be less than the length of region array.")}else++this._regionIndex>=this._region.length&&(this._regionIndex=0);e=this._region[this._regionIndex]}else e=this._region;else e=null;return e}_fetchingLoop(e){if(this.bDestroyed)return void this.stopFetchingLoop();if(!this._isOpen||!this.isFetchingLoopStarted())return void this.stopFetchingLoop();if(this._video.paused)return c._onLog&&c._onLog("DCE: Video is paused. Ask in 1s."),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),void(this._frameLoopTimeoutId=setTimeout((()=>{this._fetchingLoop(!0)}),1e3));const t=()=>{c._onLog&&c._onLog("DCE: start fetching a frame: "+Date.now());let e=this.getCurrentRegion(),t=this.getFrame(e);this._frameQueue&&this._frameQueue.length>=this._frameQueueMaxLength&&this._frameQueue.shift(),this._frameQueue.push(t),c._onLog&&c._onLog("DCE: finish fetching a frame: "+Date.now())},i=()=>{this._frameLoopTimeoutId2&&clearTimeout(this._frameLoopTimeoutId2),this._bufferRefreshInterval<=0||(this._frameLoopTimeoutId2=setTimeout((()=>{this.bDestroyed?this.stopFetchingLoop():this._isOpen&&this.isFetchingLoopStarted()?this._video.paused?this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId):(c._onLog&&c._onLog("DCE: second timeout executes: "+Date.now()),t(),i()):this.stopFetchingLoop()}),this._bufferRefreshInterval))};e&&(this._frameQueue.length{this._fetchingLoop(!0)}),this._loopInterval)}startFetchingLoop(){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");if(this._assertOpen(),this._video.paused)throw Error("The video is paused.");this.isFetchingLoopStarted()||(this._bFetchingLoopStarted=!0,c._onLog&&c._onLog("start fetching loop: "+Date.now()),this._fetchingLoop(!0))}isFetchingLoopStarted(){return this._bFetchingLoopStarted}stopFetchingLoop(){this._bFetchingLoopStarted&&(c._onLog&&c._onLog("stop fetching loop: "+Date.now()),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),this._frameQueue.length=0,this._bFetchingLoopStarted=!1)}getFrameFromBuffer(e){return this._frameQueue&&this._frameQueue.length?e?e{if(_){const e="undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("dbr.js",document.baseURI).href;return new Promise((t=>l(void 0,void 0,void 0,(function*(){const i=yield import("url");"string"!=typeof c._engineResourcePath&&(c._engineResourcePath=i.fileURLToPath(e.substring(0,e.lastIndexOf("/")+1))),t()}))))}if(!h&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),c._defaultUIElementURL="@engineResourcePath/dce.ui.html";class u{static get browserInfo(){return c.browserInfo}static getVersion(){return c.getVersion()}static detectEnvironment(){return c.detectEnvironment()}static get engineResourcePath(){return c.engineResourcePath}static set engineResourcePath(e){c.engineResourcePath=e}static get _onLog(){return c._onLog}static set _onLog(e){c._onLog=e}}u.CameraEnhancer=c;const g=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class f extends d{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=f._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",d.engineResourcePath)}static set defaultUIElementURL(e){f._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(t){return e(this,void 0,void 0,(function*(){yield this.dce.setUIElement(t)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(t){this.dce.singleFrameMode=t,t&&(()=>{e(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return e(this,void 0,void 0,(function*(){this.dce||(d._onLog&&d._onLog("createDCEInstance()"),c.defaultUIElementURL=null,this.dce=yield c.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=t=>e(this,void 0,void 0,(function*(){let e=yield this.decode(t);yield this.clearMapDecodeRecord();for(let t of e)delete t.bUnduplicated;if(this._drawRegionsults(e),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(e),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let t of e)this.onUniqueRead(t.barcodeText,t)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(t){return e(this,void 0,void 0,(function*(){if(g)throw new Error("`BarcodeScanner` is not supported in Node.js.");let e=new f;yield e.createDCEInstance(),e._instanceID=yield f.createInstanceInWorker(!0),"string"==typeof t&&(t=JSON.parse(t));for(let i in t)e[i]=t[i];return yield e.setUIElement(f.defaultUIElementURL),e.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),e.singleFrameMode||(yield e.updateRuntimeSettings("single")),e}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(i){return e(this,void 0,void 0,(function*(){this._assertOpen();let e=null;i&&i.region&&(e=i.region);let n=this.dce.getFrame(e);if(n&&null===n.canvas){let{data:e,width:i,height:r}=n;return yield this._decodeBuffer_Uint8Array(e,i,r,i,t.IPF_GrayScaled)}if(n&&n.canvas){let{data:e,canvas:i,region:r,sx:s,sy:o,sWidth:a,sHeight:l}=n;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let _=yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888);return d.fixResultLocationWhenFilterRegionInJs(r,_,s,o,a,l,i.width,i.height),_}}))}clearMapDecodeRecord(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(f.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,f.isRegionSinglePreset(t.region)||(e.region=t.region)}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,f.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=3,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0],e.timeout=1e5}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,f.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=5,e.expectedBarcodesCount=512,e.scaleDownThreshold=1e5,e.localizationModes=[2,16,4,8,0,0,0,0],e.timeout=1e5}else if("single"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,f.isRegionNormalPreset(t.region)?e.region=JSON.parse(JSON.stringify(f.singlePresetRegion)):e.region=t.region,e.expectedBarcodesCount=1,e.localizationModes=[16,2,0,0,0,0,0,0],e.barcodeZoneMinDistanceToImageBorders=0}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let i=t.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(r.BF_ONED|r.BF_QR_CODE|r.BF_PDF417|r.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let t=e.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(t)):this.userDefinedRegion=null,t instanceof Array)if(t.length){for(let e=0;e{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})})),"single"==t&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");this.dce._bindUI();let t=[e],i=e.children;for(let e of i)t.push(e);for(let e=0;e{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),d._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(t){return e(this,void 0,void 0,(function*(){return this.intervalTime=t.intervalTime,yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success)return e();{let e=new Error(t.message);return e.stack+="\n"+t.stack,i(e)}})),f._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:t}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(t,i,n){return e(this,void 0,void 0,(function*(){return this.dce.play(t,i,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(t){return e(this,void 0,void 0,(function*(){return this.dce.applyConstraints(t)}))}turnOnTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(t){return e(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(t)}))}setExposureCompensation(t){return e(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(t)}))}setZoom(t){return e(this,void 0,void 0,(function*(){return this.dce.setZoom(t)}))}setFrameRate(t){return e(this,void 0,void 0,(function*(){return this.dce.setFrameRate(t)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return e(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return d._onLog&&d._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),d._onLog&&d._onLog("======= once read ======="),d._onLog&&(this._timeStartDecode=Date.now());let i=this._getVideoFrame();if(!i)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>e(this,void 0,void 0,(function*(){if(i&&null===i.canvas){let{data:e,width:n,height:r,timeStamp:s}=i,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(e,n,r,n,t.IPF_GrayScaled,o)}if(i&&i.canvas){let{data:e,canvas:n,region:r,sx:s,sy:o,width:a,height:l,timeStamp:_}=i,h={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=n);let c=yield this._decodeBuffer_Uint8Array(e,n.width,n.height,4*n.width,t.IPF_ABGR_8888,h);return d.fixResultLocationWhenFilterRegionInJs(r,c,s,o,n.width,n.height,a,l),c}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{d._onLog&&d._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})(),this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),d._onLog&&d._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return e(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield t.destroyContext.call(this))}))}}var R,E,m,I,v,A,S,p,T,D,C,y,L,M,O,b,N,B,P,F,w,U,V,k,x,G,W;f._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",f.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(R||(R={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(E||(E={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(m||(m={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(I||(I={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(v||(v={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(A||(A={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(S||(S={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(p||(p={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(T||(T={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(C||(C={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(y||(y={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(L||(L={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(O||(O={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(b||(b={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(N||(N={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(B||(B={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(P||(P={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(F||(F={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(w||(w={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(U||(U={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(V||(V={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(k||(k={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(x||(x={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(G||(G={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(W||(W={}));class H{static get version(){return d.version}static get productKeys(){return d.productKeys}static set productKeys(e){d.productKeys=e}static get handshakeCode(){return d.handshakeCode}static set handshakeCode(e){d.handshakeCode=e}static get organizationID(){return d.organizationID}static set organizationID(e){d.organizationID=e}static get sessionPassword(){return d.sessionPassword}static set sessionPassword(e){d.sessionPassword=e}static get browserInfo(){return d.browserInfo}static detectEnvironment(){return d.detectEnvironment()}static get _workerName(){return d._workerName}static set _workerName(e){d._workerName=e}static get engineResourcePath(){return d.engineResourcePath}static set engineResourcePath(e){d.engineResourcePath=e}static get licenseServer(){return d.licenseServer}static set licenseServer(e){d.licenseServer=e}static get deviceFriendlyName(){return d.deviceFriendlyName}static set deviceFriendlyName(e){d.deviceFriendlyName=e}static get _onLog(){return d._onLog}static set _onLog(e){d._onLog=e}static get _bWasmDebug(){return d._bWasmDebug}static set _bWasmDebug(e){d._bWasmDebug=e}static get _bUseFullFeature(){return d._bUseFullFeature}static set _bUseFullFeature(e){d._bUseFullFeature=e}static get _dbrWorker(){return d._dbrWorker}static isLoaded(){return d.isLoaded()}static isWasmLoaded(){return d.isLoaded()}static loadWasm(){return d.loadWasm()}}return H.DBR=H,H.BarcodeReader=d,H.BarcodeScanner=f,H.CameraEnhancer=u,H.EnumBarcodeColourMode=R,H.EnumBarcodeComplementMode=E,H.EnumBarcodeFormat=r,H.EnumBarcodeFormat_2=m,H.EnumBinarizationMode=I,H.EnumClarityCalculationMethod=v,H.EnumClarityFilterMode=A,H.EnumColourClusteringMode=S,H.EnumColourConversionMode=p,H.EnumConflictMode=T,H.EnumDeblurMode=D,H.EnumDeformationResistingMode=C,H.EnumDPMCodeReadingMode=y,H.EnumErrorCode=i,H.EnumGrayscaleTransformationMode=L,H.EnumImagePixelFormat=t,H.EnumImagePreprocessingMode=M,H.EnumIMResultDataType=n,H.EnumIntermediateResultSavingMode=O,H.EnumIntermediateResultType=b,H.EnumLocalizationMode=N,H.EnumPDFReadingMode=B,H.EnumQRCodeErrorCorrectionLevel=P,H.EnumRegionPredetectionMode=F,H.EnumResultCoordinateType=w,H.EnumResultType=U,H.EnumScaleUpMode=V,H.EnumTerminatePhase=k,H.EnumTextFilterMode=x,H.EnumTextResultOrderMode=G,H.EnumTextureDetectionMode=W,H})); +function l(e,t,i,n){return new(i||(i=Promise))((function(s,r){function o(e){try{d(n.next(e))}catch(e){r(e)}}function a(e){try{d(n.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}d._jsVersion="8.8.7",d._jsEditVersion="20220125",d._version="loading...(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._license=r||o||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",d._sessionPassword=r||o||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",d.browserInfo=function(){if(!r&&!o){var t={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{e(this,void 0,void 0,(function*(){const e=yield import("os");t.OS=e&&e.platform?e.platform()+e.release():"Unknown"}))})(),t}}(),d._workerName="dbr-"+d._jsVersion+".worker.js",d._engineResourcePath=(()=>{if(r)return __dirname+"/";if(!o&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),d._licenseServer=[],d._deviceFriendlyName="",d._isShowRelDecodeTimeInResults=!1,d._bWasmDebug=!1,d._bNeverShowDialog=!1,d.__bUseFullFeature=!0,d._nextTaskID=0,d._taskCallbackMap=new Map,d._loadWasmStatus="unload",d._loadWasmCallbackArr=[],d._lastErrorCode=0,d._lastErrorString="",d._setWarnnedEx=new Set,d._loadWasmErr=null;const _=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),h=!_&&"undefined"==typeof self;class c{constructor(){this._canvasMaxWH="iPhone"==c.browserInfo.OS||"Android"==c.browserInfo.OS?2048:4096,this._singleFrameMode=!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia),this._singleFrameModeIpt=()=>{let e=document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.setAttribute("capture",""),e.addEventListener("change",(()=>l(this,void 0,void 0,(function*(){let t=e.files[0];e.value="",this.onSingleFrameAcquired(t)})))),e},this._clickIptSingleFrameMode=()=>{this._singleFrameModeIpt().click()},this.styleEls=[],this.bSaveOriCanvas=!0,this.maxVideoCvsLength=3,this.videoCvses=[],this.videoGlCvs=null,this.videoGl=null,this.glImgData=null,this._onCameraSelChange=()=>{this.play(this._selCam.value).then((()=>{this._isOpen||this.stop()}))},this._onResolutionSelChange=()=>{let e,t;if(this._selRsl&&-1!=this._selRsl.selectedIndex){let i=this._selRsl.options[this._selRsl.selectedIndex];e=i.getAttribute("data-width"),t=i.getAttribute("data-height")}this.play(void 0,e,t).then((()=>{this._isOpen||this.stop()}))},this._onCloseBtnClick=()=>{this.close()},this._isOpen=!1,this.videoSettings={video:{width:{ideal:1280},height:{ideal:720},facingMode:{ideal:"environment"}}},this.iPlayRound=0,this.promisePlay=null,this._allCameras=[],this._currentCamera=null,this._videoTrack=null,this._lastDeviceId=void 0,this._vc_bPlayingVideoBeforeHide=!1,this._ev_documentHideEvent=()=>{"visible"===document.visibilityState?this._vc_bPlayingVideoBeforeHide&&("Firefox"==c.browserInfo.browser?this.play():this._video.play(),this._vc_bPlayingVideoBeforeHide=!1):this._video&&!this._video.paused&&(this._vc_bPlayingVideoBeforeHide=!0,this._video.pause())},this._video=null,this._bgLoading=null,this._selCam=null,this._bgCamera=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._region=null,this.bChangeRegionIndexManually=!1,this._regionIndex=-1,this._loopInterval=0,this._frameQueueMaxLength=1,this._frameQueue=[],this._bFetchingLoopStarted=!1,this._bStoppedByPause=!1,this.alwaysRefreshBuffer=!0,this._bufferRefreshInterval=0,this.bDestroyed=!1}static getVersion(){return this._version}static detectEnvironment(){return l(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(_?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if(this._hasEngineResourceLoaded)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` is called.");if(null==e&&(e="./"),_||h)c._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,c._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(c._engineResourcePath+="/")}static get defaultUIElementURL(){var e;return null===(e=this._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",c.engineResourcePath)}static set defaultUIElementURL(e){this._defaultUIElementURL=e}getUIElement(){return this.UIElement}setUIElement(e){return l(this,void 0,void 0,(function*(){if("string"==typeof e||e instanceof String){if(!e.trim().startsWith("<")){let t=yield fetch(e);if(!t.ok)throw Error("setUIElement(elementOrUrl): Network Error: "+t.statusText);e=yield t.text()}if(!e.trim().startsWith("<"))throw Error("setUIElement(elementOrUrl): Can't get valid HTMLElement.");let t=document.createElement("div");t.innerHTML=e;for(let e=0;e','','',''].join(""),this._optGotRsl=this._optGotRsl||this._selRsl.options[0])):!this._optGotRsl&&t.classList.contains("dce-opt-gotResolution")?this._optGotRsl=t:!this._btnClose&&t.classList.contains("dce-btn-close")?this._btnClose=t:!this._video&&t.classList.contains("dce-existingVideo")?(this._video=t,this._video.setAttribute("playsinline","true")):!i&&t.tagName&&"video"==t.tagName.toLowerCase()&&(i=t);if(!this._video&&i&&(this._video=i),this.singleFrameMode?this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")):this._bgLoading&&(this._bgLoading.style.display=""),this.singleFrameMode?(this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")),this._bgCamera&&(this._bgCamera.style.display="")):this._bgLoading&&(this._bgLoading.style.display=""),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this._video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dce-video`");this._isOpen=!0}_unbindUI(){this.singleFrameMode?(this._video&&(this._video.removeEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="",this._video.removeAttribute("title")),this._bgCamera&&(this._bgCamera.style.display="none")):this._bgLoading&&(this._bgLoading.style.display="none"),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this._video=null,this._selCam=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._isOpen=!1}_assertOpen(){if(!this._isOpen)throw Error("The camera is not open.")}get video(){return this._video}set region(e){this._region=e,this._bFetchingLoopStarted&&(this._regionIndex=-1,this._fetchingLoop(!1))}get region(){return this._region}set regionIndex(e){this.bChangeRegionIndexManually&&(this._region instanceof Array&&this._region.length>e?this._regionIndex=e:this._regionIndex=0)}get regionIndex(){return this._regionIndex}set loopInterval(e){e>=0&&(this._loopInterval=e),this._bFetchingLoopStarted&&this._fetchingLoop(!1)}get loopInterval(){return this._loopInterval}set frameQueueMaxLength(e){for(this._frameQueueMaxLength=e;this._frameQueue&&this._frameQueue.length>this._frameQueueMaxLength;)this._frameQueue.shift()}get frameQueueMaxLength(){return this._frameQueueMaxLength}get frameQueue(){return JSON.parse(JSON.stringify(this._frameQueue))}set bufferRefreshInterval(e){this._bufferRefreshInterval=e}get bufferRefreshInterval(){return this._bufferRefreshInterval}isContextDestroyed(){return this.bDestroyed}static createInstance(e){return l(this,void 0,void 0,(function*(){if(_)throw new Error("`CameraEnhancer` is not supported in Node.js.");let t=new c;("string"==typeof e||e instanceof String)&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(this.defaultUIElementURL),this._hasEngineResourceLoaded=!0,document.addEventListener("visibilitychange",t._ev_documentHideEvent),t}))}play(e,t,i){return l(this,void 0,void 0,(function*(){if(this._assertOpen(),this._video&&this.videoSrc){yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),"string"==typeof this.videoSrc||this.videoSrc instanceof String?this._video.src=this.videoSrc:this._video.srcObject=this.videoSrc,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}));let e={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(e)}),0),e}if(this.singleFrameMode)return this._clickIptSingleFrameMode(),{width:0,height:0};const n=++this.iPlayRound;return this.promisePlay&&(yield this.promisePlay,nl(this,void 0,void 0,(function*(){var n;try{this._video&&this._video.srcObject&&this.stop(),c._onLog&&c._onLog("DCE: ======before video========"),yield this.getAllCameras();let s=()=>{if(this.bDestroyed)throw d&&d.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null,new Error("The CameraEnhancer instance has been destroyed.")};const r=JSON.parse(JSON.stringify(this.videoSettings));let o;"boolean"==typeof r.video&&(r.video={}),t&&(r.video.width={ideal:t}),i&&(r.video.height={ideal:i});const a=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];let d,_=()=>{for(let e of this._allCameras){let t=e.label.toLowerCase();if(t&&a.some((e=>-1!=t.indexOf(e)))&&/\b0(\b)?/.test(t)){delete r.video.facingMode,r.video.deviceId={ideal:e.deviceId};break}}r.video.deviceId||-1==["Android","HarmonyOS"].indexOf(c.browserInfo.OS)||(delete r.video.facingMode,r.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})};if(e)delete r.video.facingMode,r.video.deviceId={exact:e},this._lastDeviceId=e;else if(r.video.deviceId);else if(this._lastDeviceId)delete r.video.facingMode,r.video.deviceId={exact:this._lastDeviceId};else if(r.video.facingMode){let e=r.video.facingMode;e instanceof Array&&e.length&&(e=e[0]),e=e.exact||e.ideal||e,"environment"===e&&(o=!!r.video.facingMode,_())}c._onLog&&c._onLog("DCE: ======try getUserMedia========");let h,u=[0,500],g=null,R=null,f=e=>l(this,void 0,void 0,(function*(){for(let t of u){s(),t&&(yield new Promise((e=>setTimeout(e,t)))),s();{const t=e.video.deviceId;R=t?t.exact||t.ideal||t:null}try{c._onLog&&c._onLog("DCE: ask "+JSON.stringify(e)),d=yield navigator.mediaDevices.getUserMedia(e);break}catch(e){g=e,c._onLog&&c._onLog("DCE: "+e.message||e)}}}));if(yield f(r),d||(c._onLog&&c._onLog("DCE: ======try getUserMedia again========"),h=JSON.parse(JSON.stringify(r)),"object"==typeof h.video&&("iPhone"==c.browserInfo.OS?(t>=1280||i>=1280?h.video.width=1280:t>=640||i>=640?h.video.width=640:(t<640||i<640)&&(h.video.width=320),delete h.video.height):o&&!r.video.deviceId?(delete h.video.facingMode,this._allCameras.length&&(h.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})):h.video=!0),c._onLog&&c._onLog("DCE: "+h),yield f(h)),d||(u=[1e3,2e3],yield f(r)),d||(yield f(h)),!d)throw g;const m=()=>{const e=d.getVideoTracks();let t,i;if(e.length&&(t=this._videoTrack=e[0]),this._video&&t){if(t.label)for(let e of this._allCameras)if(t.label==e.label){e._checked=!0,i=e,this._lastDeviceId=e.deviceId;break}if(!i&&R)for(let e of this._allCameras)if(R==e.deviceId){t.label&&(e._checked=!0,e.label=t.label),i=e,this._lastDeviceId=e.deviceId;break}}this._currentCamera=i};if(yield this.getAllCameras(),s(),o){m(),_();let e=r.video.deviceId;e&&(e=e.exact||e.ideal||e);let t=null===(n=this._currentCamera)||void 0===n?void 0:n.deviceId;!e||t&&e==t||(d.getTracks().forEach((e=>{e.stop()})),u=[0,500,1e3,2e3],yield f(r))}s();const E=()=>l(this,void 0,void 0,(function*(){c._onLog&&c._onLog("======play video========"),yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),this._video.srcObject=d,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}))}));yield E(),c._onLog&&c._onLog("DCE: ======played video========"),this._bgLoading&&(this._bgLoading.style.animationPlayState="paused");const I="got "+this._video.videoWidth+"x"+this._video.videoHeight;this._optGotRsl&&(this._optGotRsl.setAttribute("data-width",this._video.videoWidth),this._optGotRsl.setAttribute("data-height",this._video.videoHeight),this._optGotRsl.innerText=I,this._selRsl&&this._optGotRsl.parentNode==this._selRsl&&(this._selRsl.value="got")),c._onLog&&c._onLog("DCE: "+I),m(),s(),this._renderSelCameraInfo();let v={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(v)}),0),this.promisePlay=null,v}catch(e){throw this.promisePlay=null,e}})))(),yield this.promisePlay)}))}resume(){return l(this,void 0,void 0,(function*(){yield this.play(),this._bStoppedByPause&&(this._bStoppedByPause=!1,this.startFetchingLoop())}))}pause(){this._video&&this._video.pause(),this._bFetchingLoopStarted&&(this.stopFetchingLoop(),this._bStoppedByPause=!0)}close(){return l(this,void 0,void 0,(function*(){this.stop(),this._unbindUI(),this.UIElement.style.display="none",this.stopFetchingLoop()}))}open(){return l(this,void 0,void 0,(function*(){return this._bindUI(),this.UIElement.parentNode||(this.UIElement.style.position="fixed",this.UIElement.style.left="0",this.UIElement.style.top="0",document.body.append(this.UIElement)),"none"==this.UIElement.style.display&&(this.UIElement.style.display=""),yield this.play()}))}stop(){this._video&&this._video.srcObject&&(c._onLog&&c._onLog("DCE: ======stop video========"),this._video.srcObject.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null),this._video&&this._video.classList.contains("dce-existingVideo")&&(c._onLog&&c._onLog("DCE: ======stop existing video========"),this._video.pause(),this._video.currentTime=0),this._bgLoading&&(this._bgLoading.style.animationPlayState=""),this._frameQueue.length=0}getAllCameras(){return l(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t=[],i=[];if(this._allCameras)for(let e of this._allCameras)e._checked&&i.push(e);for(let n=0;nt.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{colorTemperature:e}]})}))}setExposureCompensation(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().exposureCompensation;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{exposureCompensation:e}]})}))}setZoom(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().zoom;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{zoom:e}]})}))}setFrameRate(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().frameRate;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({width:{ideal:Math.max(this._video.videoWidth,this._video.videoHeight)},frameRate:e})}))}getFrameRate(){return this.getCameraSettings().frameRate}getFrame(e){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");this._assertOpen(),c._onLog&&c._onLog("DCE: getFrame(region?)");const t=Date.now(),i=this._video.videoWidth,n=this._video.videoHeight,s=Math.max(i,n);let r,o;if(s>this._canvasMaxWH){let e=this._canvasMaxWH/s;r=Math.round(i*e),o=Math.round(n*e)}else r=i,o=n;let a=0,d=0,l=i,_=n,h=i,u=n;if(e){let t,s,c,g;e.regionMeasuredByPercentage?(t=e.regionLeft*r/100,s=e.regionTop*o/100,c=e.regionRight*r/100,g=e.regionBottom*o/100):(t=e.regionLeft,s=e.regionTop,c=e.regionRight,g=e.regionBottom),h=c-t,l=Math.round(h/r*i),u=g-s,_=Math.round(u/o*n),a=Math.round(t/r*i),d=Math.round(s/o*n)}let g=0==a&&0==d&&i==l&&n==_&&i==h&&n==u;if(!this.bSaveOriCanvas&&g){this.videoGlCvs||(this.videoGlCvs=globalThis.OffscreenCanvas?new OffscreenCanvas(h,u):document.createElement("canvas"));const e=this.videoGlCvs;e.width==h&&e.height==u||(e.height=u,e.width=h,this.videoGl&&this.videoGl.viewport(0,0,h,u));const i=this.videoGl||e.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0})||e.getContext("experimental-webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0});if(!this.videoGl){this.videoGl=i;const e=i.createShader(i.VERTEX_SHADER);i.shaderSource(e,"\nattribute vec4 a_position;\nattribute vec2 a_uv;\n\nvarying vec2 v_uv;\n\nvoid main() {\n gl_Position = a_position;\n v_uv = a_uv;\n}\n"),i.compileShader(e),i.getShaderParameter(e,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(e));const t=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(t,"\nprecision lowp float;\n\nvarying vec2 v_uv;\n\nuniform sampler2D u_texture;\n\nvoid main() {\n vec4 sample = texture2D(u_texture, v_uv);\n float grey = 0.299 * sample.r + 0.587 * sample.g + 0.114 * sample.b;\n gl_FragColor = vec4(grey, 0.0, 0.0, 1.0);\n}\n"),i.compileShader(t),i.getShaderParameter(t,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(t));const n=i.createProgram();i.attachShader(n,e),i.attachShader(n,t),i.linkProgram(n),i.getProgramParameter(n,i.LINK_STATUS)||console.error("Unable to initialize the shader program: "+i.getProgramInfoLog(n)),i.useProgram(n),i.bindBuffer(i.ARRAY_BUFFER,i.createBuffer()),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,1,0,1,1,1,1,1,-1,-1,0,0,1,-1,1,0]),i.STATIC_DRAW);const s=i.getAttribLocation(n,"a_position");i.enableVertexAttribArray(s),i.vertexAttribPointer(s,2,i.FLOAT,!1,16,0);const r=i.getAttribLocation(n,"a_uv");i.enableVertexAttribArray(r),i.vertexAttribPointer(r,2,i.FLOAT,!1,16,8),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,i.createTexture()),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.uniform1i(i.getUniformLocation(n,"u_texture"),0)}(!this.glImgData||this.glImgData.length=this.maxVideoCvsLength&&(this.videoCvses=this.videoCvses.slice(1)),this.videoCvses.push(i))}const n=i.dbrCtx2d;g?n.drawImage(this._video,0,0):n.drawImage(this._video,a,d,l,_,0,0,h,u);let s=i.dbrCtx2d||i.getContext("2d");if(0===i.width||0===i.height)return null;let r=s.getImageData(0,0,i.width,i.height).data;const o=Date.now();return{data:r,canvas:i,region:e,sx:a,sy:d,width:l,height:_,timeSpent:o-t,timeStamp:o}}}getCurrentRegion(){let e;if(this._region)if(this._region instanceof Array){if(this.bChangeRegionIndexManually){if(this._regionIndex>=this._region.length)throw new Error("the 'regionIndex' should be less than the length of region array.")}else++this._regionIndex>=this._region.length&&(this._regionIndex=0);e=this._region[this._regionIndex]}else e=this._region;else e=null;return e}_fetchingLoop(e){if(this.bDestroyed)return void this.stopFetchingLoop();if(!this._isOpen||!this.isFetchingLoopStarted())return void this.stopFetchingLoop();if(this._video.paused)return c._onLog&&c._onLog("DCE: Video is paused. Ask in 1s."),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),void(this._frameLoopTimeoutId=setTimeout((()=>{this._fetchingLoop(!0)}),1e3));const t=()=>{c._onLog&&c._onLog("DCE: start fetching a frame: "+Date.now());let e=this.getCurrentRegion(),t=this.getFrame(e);this._frameQueue&&this._frameQueue.length>=this._frameQueueMaxLength&&this._frameQueue.shift(),this._frameQueue.push(t),c._onLog&&c._onLog("DCE: finish fetching a frame: "+Date.now())},i=()=>{this._frameLoopTimeoutId2&&clearTimeout(this._frameLoopTimeoutId2),this._bufferRefreshInterval<=0||(this._frameLoopTimeoutId2=setTimeout((()=>{this.bDestroyed?this.stopFetchingLoop():this._isOpen&&this.isFetchingLoopStarted()?this._video.paused?this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId):(c._onLog&&c._onLog("DCE: second timeout executes: "+Date.now()),t(),i()):this.stopFetchingLoop()}),this._bufferRefreshInterval))};e&&(this._frameQueue.length{this._fetchingLoop(!0)}),this._loopInterval)}startFetchingLoop(){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");if(this._assertOpen(),this._video.paused)throw Error("The video is paused.");this.isFetchingLoopStarted()||(this._bFetchingLoopStarted=!0,c._onLog&&c._onLog("start fetching loop: "+Date.now()),this._fetchingLoop(!0))}isFetchingLoopStarted(){return this._bFetchingLoopStarted}stopFetchingLoop(){this._bFetchingLoopStarted&&(c._onLog&&c._onLog("stop fetching loop: "+Date.now()),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),this._frameQueue.length=0,this._bFetchingLoopStarted=!1)}getFrameFromBuffer(e){return this._frameQueue&&this._frameQueue.length?e?e{if(_){const e="undefined"==typeof document&&"undefined"==typeof location?new(require("url").URL)("file:"+__filename).href:"undefined"==typeof document?location.href:document.currentScript&&document.currentScript.src||new URL("dbr.js",document.baseURI).href;return new Promise((t=>l(void 0,void 0,void 0,(function*(){const i=yield import("url");"string"!=typeof c._engineResourcePath&&(c._engineResourcePath=i.fileURLToPath(e.substring(0,e.lastIndexOf("/")+1))),t()}))))}if(!h&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),c._defaultUIElementURL="@engineResourcePath/dce.ui.html";class u{static get browserInfo(){return c.browserInfo}static getVersion(){return c.getVersion()}static detectEnvironment(){return c.detectEnvironment()}static get engineResourcePath(){return c.engineResourcePath}static set engineResourcePath(e){c.engineResourcePath=e}static get _onLog(){return c._onLog}static set _onLog(e){c._onLog=e}}u.CameraEnhancer=c;const g=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class R extends d{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=R._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",d.engineResourcePath)}static set defaultUIElementURL(e){R._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(t){return e(this,void 0,void 0,(function*(){yield this.dce.setUIElement(t)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(t){this.dce.singleFrameMode=t,t&&(()=>{e(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return e(this,void 0,void 0,(function*(){this.dce||(d._onLog&&d._onLog("createDCEInstance()"),c.defaultUIElementURL=null,this.dce=yield c.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=t=>e(this,void 0,void 0,(function*(){let e=yield this.decode(t);yield this.clearMapDecodeRecord();for(let t of e)delete t.bUnduplicated;if(this._drawRegionsults(e),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(e),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let t of e)this.onUniqueRead(t.barcodeText,t)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(t){return e(this,void 0,void 0,(function*(){if(g)throw new Error("`BarcodeScanner` is not supported in Node.js.");let e=new R;yield e.createDCEInstance(),e._instanceID=yield R.createInstanceInWorker(!0),"string"==typeof t&&(t=JSON.parse(t));for(let i in t)e[i]=t[i];return yield e.setUIElement(R.defaultUIElementURL),e.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),e.singleFrameMode||(yield e.updateRuntimeSettings("single")),e}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,s,r){return super.decodeBuffer(e,t,i,n,s,r)}decodeCurrentFrame(i){return e(this,void 0,void 0,(function*(){this._assertOpen();let e=null;i&&i.region&&(e=i.region);let n=this.dce.getFrame(e);if(n&&null===n.canvas){let{data:e,width:i,height:s}=n;return yield this._decodeBuffer_Uint8Array(e,i,s,i,t.IPF_GrayScaled)}if(n&&n.canvas){let{data:e,canvas:i,region:s,sx:r,sy:o,sWidth:a,sHeight:l}=n;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let _=yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888);return d.fixResultLocationWhenFilterRegionInJs(s,_,r,o,a,l,i.width,i.height),_}}))}clearMapDecodeRecord(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(R.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region)}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=3,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0],e.timeout=1e5}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=5,e.expectedBarcodesCount=512,e.scaleDownThreshold=1e5,e.localizationModes=[2,16,4,8,0,0,0,0],e.timeout=1e5}else if("single"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionNormalPreset(t.region)?e.region=JSON.parse(JSON.stringify(R.singlePresetRegion)):e.region=t.region,e.expectedBarcodesCount=1,e.localizationModes=[16,2,0,0,0,0,0,0],e.barcodeZoneMinDistanceToImageBorders=0}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let i=t.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(s.BF_ONED|s.BF_QR_CODE|s.BF_PDF417|s.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let t=e.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(t)):this.userDefinedRegion=null,t instanceof Array)if(t.length){for(let e=0;e{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})})),"single"==t&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");let t=[e];for(let e=0;e','','',''].join(""),this.dce._optGotRsl=this.dce._optGotRsl||this.dce._selRsl.options[0])):this.dce._optGotRsl||!e.classList.contains("dce-opt-gotResolution")&&!e.classList.contains("dbrScanner-opt-gotResolution")?this.dce._btnClose||!e.classList.contains("dce-btn-close")&&!e.classList.contains("dbrScanner-btn-close")?this.dce._video||!e.classList.contains("dce-existingVideo")&&!e.classList.contains("dbrScanner-existingVideo")||(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"),this.dce.singleFrameMode=!1):this.dce._btnClose=e:this.dce._optGotRsl=e:this.dce._selCam=e:this.dce._bgCamera=e:this.dce._bgLoading=e:(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"));if(this.dce._bindUI(),this._selCam=this.dce._selCam,this._selRsl=this.dce._selRsl,this._btnClose=this.dce._btnClose,this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.addEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="pointer",this._cvsDrawArea.setAttribute("title","Take a photo")),this._divScanArea&&(this._divScanArea.addEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="pointer",this._divScanArea.setAttribute("title","Take a photo"))),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this.dce.video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dbrScanner-video`.")}_unbindUI(){this._clearRegionsults(),this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.removeEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="",this._cvsDrawArea.removeAttribute("title")),this._divScanArea&&(this._divScanArea.removeEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="",this._divScanArea.removeAttribute("title"))),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this.dce._unbindUI(),this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null}set onPlayed(e){this.dce.onPlayed=e}get onPlayed(){return this.dce.onPlayed}get onUnduplicatedRead(){return this.onUniqueRead}set onUnduplicatedRead(e){this.onUniqueRead=e}getAllCameras(){return e(this,void 0,void 0,(function*(){return this.dce.getAllCameras()}))}getCurrentCamera(){return e(this,void 0,void 0,(function*(){return this.dce.getSelectedCamera()}))}setCurrentCamera(t){return e(this,void 0,void 0,(function*(){return this.dce.selectCamera(t)}))}getResolution(){return this.dce.getResolution()}setResolution(t,i){return e(this,void 0,void 0,(function*(){return this.dce.setResolution(t,i)}))}getScanSettings(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),d._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(t){return e(this,void 0,void 0,(function*(){return this.intervalTime=t.intervalTime,yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success)return e();{let e=new Error(t.message);return e.stack+="\n"+t.stack,i(e)}})),R._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:t}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(t,i,n){return e(this,void 0,void 0,(function*(){return this.dce.play(t,i,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(t){return e(this,void 0,void 0,(function*(){return this.dce.applyConstraints(t)}))}turnOnTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(t){return e(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(t)}))}setExposureCompensation(t){return e(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(t)}))}setZoom(t){return e(this,void 0,void 0,(function*(){return this.dce.setZoom(t)}))}setFrameRate(t){return e(this,void 0,void 0,(function*(){return this.dce.setFrameRate(t)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return e(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return d._onLog&&d._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),d._onLog&&d._onLog("======= once read ======="),d._onLog&&(this._timeStartDecode=Date.now());let i=this._getVideoFrame();if(!i)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>e(this,void 0,void 0,(function*(){if(i&&null===i.canvas){let{data:e,width:n,height:s,timeStamp:r}=i,o={timeStamp:r};return yield this._decodeBuffer_Uint8Array(e,n,s,n,t.IPF_GrayScaled,o)}if(i&&i.canvas){let{data:e,canvas:n,region:s,sx:r,sy:o,width:a,height:l,timeStamp:_}=i,h={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=n);let c=yield this._decodeBuffer_Uint8Array(e,n.width,n.height,4*n.width,t.IPF_ABGR_8888,h);return d.fixResultLocationWhenFilterRegionInJs(s,c,r,o,n.width,n.height,a,l),c}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{d._onLog&&d._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let s=0,r=0;s=n+1>=this.region.length?0:n+1,r=s+1>=this.region.length?0:s+1,e=t[s]&&t[s].length&&i[r]&&i[r].length?Math.min(...t[s])-Math.max(...i[r]):0}else if(i&&i.length){let n=Math.min(...t),s=Math.max(...i);n&&s&&(e=n-s)}else e=0;return e>0?e:0})()+this.intervalTime,this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),d._onLog&&d._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let s=this.region;if(s&&(!s.regionLeft&&!s.regionRight&&!s.regionTop&&!s.regionBottom&&!s.regionMeasuredByPercentage||s instanceof Array?s=null:s.regionMeasuredByPercentage?s=s.regionLeft||s.regionRight||100!==s.regionTop||100!==s.regionBottom?{regionLeft:Math.round(s.regionLeft/100*i),regionTop:Math.round(s.regionTop/100*n),regionRight:Math.round(s.regionRight/100*i),regionBottom:Math.round(s.regionBottom/100*n)}:null:(s=JSON.parse(JSON.stringify(s)),delete s.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let r=this._cvsDrawArea;r.width=i,r.height=n;let o=r.getContext("2d");if(s){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,r.width,r.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(s.regionLeft-e,s.regionTop-e,s.regionRight-s.regionLeft+2*e,s.regionBottom-s.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(s.regionLeft,s.regionTop,s.regionRight-s.regionLeft,s.regionBottom-s.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,r=1;e/tsuper.destroyContext}});return e(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield t.destroyContext.call(this))}))}}var f,m,E,I,v,A,S,p,T,D,C,y,L,M,b,O,N,B,P,F,w,U,V,k,x,G,W;R._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",R.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(f||(f={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(m||(m={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(E||(E={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(I||(I={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(v||(v={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(A||(A={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(S||(S={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(p||(p={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(T||(T={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(C||(C={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(y||(y={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(L||(L={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(b||(b={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(O||(O={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(N||(N={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(B||(B={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(P||(P={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(F||(F={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(w||(w={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(U||(U={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(V||(V={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(k||(k={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(x||(x={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(G||(G={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(W||(W={}));class H{static get version(){return d.version}static get productKeys(){return d.productKeys}static set productKeys(e){d.productKeys=e}static get handshakeCode(){return d.handshakeCode}static set handshakeCode(e){d.handshakeCode=e}static get organizationID(){return d.organizationID}static set organizationID(e){d.organizationID=e}static get sessionPassword(){return d.sessionPassword}static set sessionPassword(e){d.sessionPassword=e}static get browserInfo(){return d.browserInfo}static detectEnvironment(){return d.detectEnvironment()}static get _workerName(){return d._workerName}static set _workerName(e){d._workerName=e}static get engineResourcePath(){return d.engineResourcePath}static set engineResourcePath(e){d.engineResourcePath=e}static get licenseServer(){return d.licenseServer}static set licenseServer(e){d.licenseServer=e}static get deviceFriendlyName(){return d.deviceFriendlyName}static set deviceFriendlyName(e){d.deviceFriendlyName=e}static get _onLog(){return d._onLog}static set _onLog(e){d._onLog=e}static get _bWasmDebug(){return d._bWasmDebug}static set _bWasmDebug(e){d._bWasmDebug=e}static get _bUseFullFeature(){return d._bUseFullFeature}static set _bUseFullFeature(e){d._bUseFullFeature=e}static get _dbrWorker(){return d._dbrWorker}static isLoaded(){return d.isLoaded()}static isWasmLoaded(){return d.isLoaded()}static loadWasm(){return d.loadWasm()}}return H.DBR=H,H.BarcodeReader=d,H.BarcodeScanner=R,H.CameraEnhancer=u,H.EnumBarcodeColourMode=f,H.EnumBarcodeComplementMode=m,H.EnumBarcodeFormat=s,H.EnumBarcodeFormat_2=E,H.EnumBinarizationMode=I,H.EnumClarityCalculationMethod=v,H.EnumClarityFilterMode=A,H.EnumColourClusteringMode=S,H.EnumColourConversionMode=p,H.EnumConflictMode=T,H.EnumDeblurMode=D,H.EnumDeformationResistingMode=C,H.EnumDPMCodeReadingMode=y,H.EnumErrorCode=i,H.EnumGrayscaleTransformationMode=L,H.EnumImagePixelFormat=t,H.EnumImagePreprocessingMode=M,H.EnumIMResultDataType=n,H.EnumIntermediateResultSavingMode=b,H.EnumIntermediateResultType=O,H.EnumLocalizationMode=N,H.EnumPDFReadingMode=B,H.EnumQRCodeErrorCorrectionLevel=P,H.EnumRegionPredetectionMode=F,H.EnumResultCoordinateType=w,H.EnumResultType=U,H.EnumScaleUpMode=V,H.EnumTerminatePhase=k,H.EnumTextFilterMode=x,H.EnumTextResultOrderMode=G,H.EnumTextureDetectionMode=W,H})); diff --git a/dist/dbr.mjs b/dist/dbr.mjs index b7a6662..ef0cf97 100644 --- a/dist/dbr.mjs +++ b/dist/dbr.mjs @@ -2,13 +2,13 @@ * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition * @website http://www.dynamsoft.com - * @copyright Copyright 2021, Dynamsoft Corporation + * @copyright Copyright 2022, Dynamsoft Corporation * @author Dynamsoft - * @version 8.8.3 (js 20211011) + * @version 8.8.7 (js 20220125) * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -function e(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var t,i,n,r;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(t||(t={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(i||(i={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(n||(n={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(r||(r={}));const s=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),o=!s&&"undefined"==typeof self,a=s?global:o?{}:self;class d{constructor(){this._canvasMaxWH="iPhone"==d.browserInfo.OS||"Android"==d.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");d._license=e}static get productKeys(){return this._license}static set productKeys(e){d.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){d.license=e}static get organizationID(){return this._license}static set organizationID(e){d.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");d._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return e(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(s?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),s||o)d._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,d._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(d._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)d._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let t,n=d._license,r=JSON.parse(JSON.stringify(d._licenseServer)),o=d._sessionPassword,l=null,_=null,h=0;if(n.startsWith("t")||n.startsWith("f"))h=0;else if(0===n.length||n.startsWith("P")||n.startsWith("L"))h=1;else{h=2;const e=n.indexOf(":");if(-1!=e&&(n=n.substring(e+1)),n.startsWith("DLS2")){let e=n.substring(4);e=s?Buffer.from(e,"base64").toString("binary"):atob(e);const t=JSON.parse(e);if(t.handshakeCode?n=t.handshakeCode:t.organizationID&&(n=t.organizationID),"number"==typeof n&&(n=JSON.stringify(n)),n||(n=""),0===r.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),d.licenseServer=e,r=d.licenseServer,d.licenseServer=null}!o&&t.sessionPassword&&(o=t.sessionPassword),t.chargeWay&&(_=t.chargeWay),t.limitedLicenseModules&&(l=t.limitedLicenseModules)}}if(h&&(s?process.version<"v15"&&(t="To use online key requires nodejs version >= v15."):(a.crypto||(t="Please upgrade your browser to support online key."),a.crypto.subtle||(t="Require https to use online key in this browser."))),t){if(1!==h)throw new Error(t);h=0,console.warn(t),d._lastErrorCode=i.DMERR_FAILED_TO_REACH_LTS,d._lastErrorString=t}return 1===h&&(n="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((t,i)=>e(this,void 0,void 0,(function*(){switch(d._loadWasmStatus){case"unload":{d._loadWasmStatus="loading",s&&(yield d.engineResourcePath);let t=d.engineResourcePath+d._workerName;if(s||d.engineResourcePath.startsWith(location.origin)||(t=yield fetch(t).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),s){const e=yield import("worker_threads");d._dbrWorker=new e.Worker(t)}else d._dbrWorker=new Worker(t);d._dbrWorker.onerror=e=>{d._loadWasmStatus="loadFail";let t=new Error(e.message);d._loadWasmErr=t;for(let e of d._loadWasmCallbackArr)e(t);d._loadWasmCallbackArr=[]},d._dbrWorker.onmessage=t=>e(this,void 0,void 0,(function*(){let e=t.data?t.data:t;switch(e.type){case"log":d._onLog&&d._onLog(e.message);break;case"load":{e.message&&(e.message=e.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let t=!1;if(1===h&&(t=!0),e.success){d._loadWasmStatus="loadSuccess",d._version=e.version+"(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._onLog&&d._onLog("load dbr worker success");for(let e of d._loadWasmCallbackArr)e();d._loadWasmCallbackArr=[],d._dbrWorker.onerror=null,e.message&&console.warn(e.message)}else{let i=new Error(e.message);i.stack=e.stack+"\n"+i.stack,d._loadWasmStatus="loadFail",d._loadWasmErr=i;for(let e of d._loadWasmCallbackArr)e(i);d._loadWasmCallbackArr=[],t||111==e.ltsErrorCode&&-1!=e.message.toLowerCase().indexOf("trial license")&&(t=!0)}t&&d.showDialog(e.success?"warn":"error",e.message);break}case"task":{let t=e.id,i=e.body;try{d._taskCallbackMap.get(t)(i),d._taskCallbackMap.delete(t)}catch(e){throw d._taskCallbackMap.delete(t),e}break}default:d._onLog&&d._onLog(t)}})),s&&d._dbrWorker.on("message",d._dbrWorker.onmessage),d._dbrWorker.postMessage({type:"loadWasm",bd:d._bWasmDebug,engineResourcePath:d.engineResourcePath,version:d._jsVersion,brtk:!!h,bptk:1===h,lcs:n,dm:!s&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:d._bUseFullFeature,browserInfo:d.browserInfo,deviceFriendlyName:d.deviceFriendlyName,ls:r,sp:o,lm:l,cw:_})}case"loading":d._loadWasmCallbackArr.push((e=>{e?i(e):t()}));break;case"loadSuccess":t();break;case"loadFail":i(d._loadWasmErr)}}))))}))}static showDialog(t,i){return e(this,void 0,void 0,(function*(){if(!s&&!d._bNeverShowDialog)try{let e=yield fetch(d.engineResourcePath+"dls.license.dialog.html");if(!e.ok)throw Error("Get license dialog fail. Network Error: "+e.statusText);let n=yield e.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(e==t.target){o.remove();for(let e of s)e.remove()}}));else if(!l&&e.classList.contains("dls-license-icon-close"))l=e,e.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!_&&e.classList.contains("dls-license-icon-error"))_=e,"error"!=t&&e.remove();else if(!h&&e.classList.contains("dls-license-icon-warn"))h=e,"warn"!=t&&e.remove();else if(!c&&e.classList.contains("dls-license-msg-content")){c=e;let t=i;for(;t;){let i=t.indexOf("["),n=t.indexOf("]",i),r=t.indexOf("(",n),s=t.indexOf(")",r);if(-1==i||-1==n||-1==r||-1==s){e.appendChild(new Text(t));break}i>0&&e.appendChild(new Text(t.substring(0,i)));let o=document.createElement("a"),a=t.substring(i+1,n);o.innerText=a;let d=t.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),e.appendChild(o),t=t.substring(s+1)}}document.body.appendChild(o)}catch(e){d._onLog&&d._onLog(e.message||e)}}))}static createInstanceInWorker(t=!1){return e(this,void 0,void 0,(function*(){return yield d.loadWasm(),yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success)return e(t.instanceID);{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:t})}))}))}static createInstance(){return e(this,void 0,void 0,(function*(){let e=new d;return e._instanceID=yield d.createInstanceInWorker(),e}))}decode(t){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("decode(source: any)"),d._onLog&&(this._timeStartDecode=Date.now()),s)return t instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t)):t instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(t):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t):"http"==t.substring(0,4)?yield this._decode_Url(t):yield this._decode_FilePath(t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),t instanceof Blob?yield this._decode_Blob(t,e):t instanceof ArrayBuffer?yield this._decode_ArrayBuffer(t,e):t instanceof Uint8Array||t instanceof Uint8ClampedArray?yield this._decode_Uint8Array(t,e):t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?yield this._decode_Image(t,e):t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?yield this._decode_Canvas(t,e):t instanceof HTMLVideoElement?yield this._decode_Video(t,e):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t,e):yield this._decode_Url(t,e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(t,e)}))}decodeUrl(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(t,e)}))}_decodeBuffer_Uint8Array(t,i,n,r,s,o){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,a)=>{let l=d._nextTaskID++;d._taskCallbackMap.set(l,(t=>{if(t.success){let i,n=d._onLog?Date.now():0;d._onLog&&d._onLog("worker return result: "+n),this._lastInnerDecodeDuration=t.duration;try{i=this._handleRetJsonString(t.decodeReturn)}catch(e){return a(e)}if(d._onLog){let e=Date.now();d._onLog("DBR time get result: "+n),d._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),d._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),d._onLog("DBR worker handle results: "+(e-n)),d._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,a(e)}})),this._timeEnterInnerDBR=Date.now(),d._onLog&&d._onLog("Send buffer to worker:"+Date.now()),d._dbrWorker.postMessage({type:"decodeBuffer",id:l,instanceID:this._instanceID,body:{buffer:t,width:i,height:n,stride:r,format:s,config:o}},[t.buffer]),d._onLog&&o&&o._timeEndGettingFrame&&d._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(t,i,n,r,s,o){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const e=t.arrayBuffer?yield t.arrayBuffer():yield new Promise(((e,i)=>{let n=new FileReader;n.readAsArrayBuffer(t),n.onload=()=>{e(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(e),i,n,r,s,o)}))}decodeBuffer(t,i,n,r,o,a){return e(this,void 0,void 0,(function*(){let e;return d._onLog&&d._onLog("decodeBuffer(buffer,width,height,stride,format)"),d._onLog&&(this._timeStartDecode=Date.now()),s?t instanceof Uint8Array?e=yield this._decodeBuffer_Uint8Array(t,i,n,r,o,a):t instanceof Buffer&&(e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,n,r,o,a)):t instanceof Uint8Array||t instanceof Uint8ClampedArray?e=yield this._decodeBuffer_Uint8Array(t,i,n,r,o,a):t instanceof ArrayBuffer?e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,n,r,o,a):t instanceof Blob&&(e=yield this._decodeBuffer_Blob(t,i,n,r,o,a)),e}))}_decodeFileInMemory_Uint8Array(t){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success){let n;this._lastInnerDecodeDuration=t.duration;try{n=this._handleRetJsonString(t.decodeReturn)}catch(e){return i(e)}return e(n)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:t}})}))}))}getRuntimeSettings(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=3,e.expectedBarcodesCount=0,e.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=5,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let t=e.region;[t.regionLeft,t.regionTop,t.regionLeft,t.regionBottom,t.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:t.regionLeft||0,regionTop:t.regionTop||0,regionRight:t.regionRight||0,regionBottom:t.regionBottom||0,regionMeasuredByPercentage:t.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(r.BF_ONED|r.BF_QR_CODE|r.BF_PDF417|r.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!s)if(this.bFilterRegionInJs){let t=e.region;if(t instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(t)),(t.regionLeft||t.regionTop||t.regionRight||t.regionBottom||t.regionMeasuredByPercentage)&&(t.regionLeft||t.regionTop||100!=t.regionRight||100!=t.regionBottom||!t.regionMeasuredByPercentage)?this.region=t:this.region=null,e.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((t,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})}))}))}resetRuntimeSettings(){return e(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(t){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof t)t=t;else{if("object"!=typeof t)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");t=JSON.stringify(t)}return yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.initReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:t}})}))}))}_decode_Blob(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Blob(blob: Blob)");let e=null,n=null;if("undefined"!=typeof createImageBitmap)try{e=yield createImageBitmap(t)}catch(e){}e||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(t));let r=yield this._decode_Image(e||n,i);return e&&e.close(),r}))}_decode_ArrayBuffer(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Uint8Array(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Image(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),i=i||{};let e,n,r=t instanceof HTMLImageElement?t.naturalWidth:t.width,s=t instanceof HTMLImageElement?t.naturalHeight:t.height,o=Math.max(r,s);if(o>this._canvasMaxWH){let t=this._canvasMaxWH/o;e=Math.round(r*t),n=Math.round(s*t)}else e=r,n=s;let l,_=0,h=0,c=r,u=s,g=e,R=n,f=i.region;if(f){let t,i,o,a;f.regionMeasuredByPercentage?(t=f.regionLeft*e/100,i=f.regionTop*n/100,o=f.regionRight*e/100,a=f.regionBottom*n/100):(t=f.regionLeft,i=f.regionTop,o=f.regionRight,a=f.regionBottom),g=o-t,c=Math.round(g/e*r),R=a-i,u=Math.round(R/n*s),_=Math.round(t/e*r),h=Math.round(i/n*s)}!this.bSaveOriCanvas&&a.OffscreenCanvas?l=new OffscreenCanvas(g,R):(l=document.createElement("canvas"),l.width=g,l.height=R);let E,m=l.getContext("2d");0==_&&0==h&&r==c&&s==u&&r==g&&s==R?m.drawImage(t,0,0):m.drawImage(t,_,h,c,u,0,0,g,R),t.dbrObjUrl&&URL.revokeObjectURL(t.dbrObjUrl),f?(E=JSON.parse(JSON.stringify(i)),delete E.region):E=i;let I=yield this._decode_Canvas(l,E);return d.fixResultLocationWhenFilterRegionInJs(f,I,_,h,c,u,g,R),I}))}_decode_Canvas(i,n){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),i.crossOrigin&&"anonymous"!=i.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let e=(i.dbrCtx2d||i.getContext("2d")).getImageData(0,0,i.width,i.height).data;return yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888,n)}))}_decode_Video(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Video(video)"),!(t instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(t.crossOrigin&&"anonymous"!=t.crossOrigin)throw"cors";i=i||{};const e=t.videoWidth,n=t.videoHeight,r=Math.max(e,n);let s,o;if(r>this._canvasMaxWH){let t=this._canvasMaxWH/r;s=Math.round(e*t),o=Math.round(n*t)}else s=e,o=n;let l=0,_=0,h=e,c=n,u=e,g=n,R=i.region;if(R){let t,i,r,a;R.regionMeasuredByPercentage?(t=R.regionLeft*s/100,i=R.regionTop*o/100,r=R.regionRight*s/100,a=R.regionBottom*o/100):(t=R.regionLeft,i=R.regionTop,r=R.regionRight,a=R.regionBottom),u=r-t,h=Math.round(u/s*e),g=a-i,c=Math.round(g/o*n),l=Math.round(t/s*e),_=Math.round(i/o*n)}let f=0==l&&0==_&&e==h&&n==c&&e==u&&n==g,E=null;!this.bSaveOriCanvas&&a.OffscreenCanvas?E=new OffscreenCanvas(u,g):(E=document.createElement("canvas"),E.width=u,E.height=g);const m=E.dbrCtx2d=E.getContext("2d");let I;f?m.drawImage(t,0,0):m.drawImage(t,l,_,h,c,0,0,u,g),R?(I=JSON.parse(JSON.stringify(i)),delete I.region):I=i;let v=yield this._decode_Canvas(E,i);return R&&d.fixResultLocationWhenFilterRegionInJs(R,v,l,_,h,c,u,g),v}))}_decode_Base64(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Base64(base64Str)"),"string"!=typeof t)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==t.substring(0,11)&&(t=t.substring(t.indexOf(",")+1)),s){let e=Buffer.from(t,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e))}{let e=atob(t),n=e.length,r=new Uint8Array(n);for(;n--;)r[n]=e.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),i)}}))}_decode_Url(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Url(url)"),"string"!=typeof t)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(t=t,s){let i=yield new Promise(((i,n)=>e(this,void 0,void 0,(function*(){(t.startsWith("https")?yield import("https"):yield import("http")).get(t,(e=>{if(200==e.statusCode){let t=[];e.on("data",(e=>{t.push(e)})).on("end",(()=>{i(new Uint8Array(Buffer.concat(t)))}))}else n("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(i)}{let n=yield new Promise(((i,n)=>{let r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.send(),r.onloadend=()=>e(this,void 0,void 0,(function*(){i(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,i)}}))}_decode_FilePath(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_FilePath(path)"),!s)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof t)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const e=yield import("fs");let i=yield new Promise(((i,n)=>{e.readFile(t,((e,t)=>{e?n(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,l=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/l+n,t.y2=t.y2/l+n,t.y3=t.y3/l+n,t.y4=t.y4/l+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let n,r=i.DBR_UNKNOWN;return"number"==typeof e?(r=e,n=new Error(t)):n=new Error(e),n.code=r,n}_handleRetJsonString(e){let t=i;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!d._setWarnnedEx.has(e.description)&&(d._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw d.BarcodeReaderException(e.exception,e.description)}setModeArgument(t,i,n,r){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,s)=>{let o=d._nextTaskID++;d._taskCallbackMap.set(o,(t=>{if(t.success){try{this._handleRetJsonString(t.setReturn)}catch(e){return s(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,s(e)}})),d._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:n,argumentValue:r}})}))}))}getModeArgument(t,i,n){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,r)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(t=>{if(t.success){let i;try{i=this._handleRetJsonString(t.getReturn)}catch(e){return r(e)}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,r(e)}})),d._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:n}})}))}))}getIntermediateResults(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return e(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),i=[];for(let r of e)if(r.dataType==n.IMRDT_IMAGE)for(let e of r.results){const n=e.bytes;let r;switch(d._onLog&&d._onLog(" "+n.length+" "+n.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case t.IPF_ABGR_8888:r=new Uint8ClampedArray(n);break;case t.IPF_RGB_888:{const e=n.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}} +function e(e,t,i,s){return new(i||(i=Promise))((function(n,r){function o(e){try{d(s.next(e))}catch(e){r(e)}}function a(e){try{d(s.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((s=s.apply(e,t||[])).next())}))}var t,i,s,n;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(t||(t={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(i||(i={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(n||(n={}));const r=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),o=!r&&"undefined"==typeof self,a=r?global:o?{}:self;class d{constructor(){this._canvasMaxWH="iPhone"==d.browserInfo.OS||"Android"==d.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");d._license=e}static get productKeys(){return this._license}static set productKeys(e){d.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){d.license=e}static get organizationID(){return this._license}static set organizationID(e){d.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");d._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return e(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(r?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),r||o)d._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,d._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(d._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)d._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let t,s=d._license,n=JSON.parse(JSON.stringify(d._licenseServer)),o=d._sessionPassword,l=null,_=null,h=0;if(s.startsWith("t")||s.startsWith("f"))h=0;else if(0===s.length||s.startsWith("P")||s.startsWith("L"))h=1;else{h=2;const e=s.indexOf(":");if(-1!=e&&(s=s.substring(e+1)),s.startsWith("DLS2")){let e=s.substring(4);e=r?Buffer.from(e,"base64").toString("binary"):atob(e);const t=JSON.parse(e);if(t.handshakeCode?s=t.handshakeCode:t.organizationID&&(s=t.organizationID),"number"==typeof s&&(s=JSON.stringify(s)),s||(s=""),0===n.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),d.licenseServer=e,n=d.licenseServer}!o&&t.sessionPassword&&(o=t.sessionPassword),t.chargeWay&&(_=t.chargeWay),t.limitedLicenseModules&&(l=t.limitedLicenseModules)}}if(h&&(r?process.version<"v15"&&(t="To use online key requires nodejs version >= v15."):(a.crypto||(t="Please upgrade your browser to support online key."),a.crypto.subtle||(t="Require https to use online key in this browser."))),t){if(1!==h)throw new Error(t);h=0,console.warn(t),d._lastErrorCode=i.DMERR_FAILED_TO_REACH_LTS,d._lastErrorString=t}return 1===h&&(s="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((t,i)=>e(this,void 0,void 0,(function*(){switch(d._loadWasmStatus){case"unload":{d._loadWasmStatus="loading";let t=d.engineResourcePath+d._workerName;if(r||d.engineResourcePath.startsWith(location.origin)||(t=yield fetch(t).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),r){const e=yield import("worker_threads");d._dbrWorker=new e.Worker(t)}else d._dbrWorker=new Worker(t);d._dbrWorker.onerror=e=>{d._loadWasmStatus="loadFail";let t=new Error(e.message);d._loadWasmErr=t;for(let e of d._loadWasmCallbackArr)e(t);d._loadWasmCallbackArr=[]},d._dbrWorker.onmessage=t=>e(this,void 0,void 0,(function*(){let e=t.data?t.data:t;switch(e.type){case"log":d._onLog&&d._onLog(e.message);break;case"load":{e.message&&(e.message=e.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let t=!1;if(1===h&&(t=!0),e.success){d._loadWasmStatus="loadSuccess",d._version=e.version+"(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._onLog&&d._onLog("load dbr worker success");for(let e of d._loadWasmCallbackArr)e();d._loadWasmCallbackArr=[],d._dbrWorker.onerror=null,e.message&&console.warn(e.message)}else{let i=new Error(e.message);i.stack=e.stack+"\n"+i.stack,d._loadWasmStatus="loadFail",d._loadWasmErr=i;for(let e of d._loadWasmCallbackArr)e(i);d._loadWasmCallbackArr=[],t||111==e.ltsErrorCode&&-1!=e.message.toLowerCase().indexOf("trial license")&&(t=!0)}t&&d.showDialog(e.success?"warn":"error",e.message);break}case"task":{let t=e.id,i=e.body;try{d._taskCallbackMap.get(t)(i),d._taskCallbackMap.delete(t)}catch(e){throw d._taskCallbackMap.delete(t),e}break}default:d._onLog&&d._onLog(t)}})),r&&d._dbrWorker.on("message",d._dbrWorker.onmessage),d._dbrWorker.postMessage({type:"loadWasm",bd:d._bWasmDebug,engineResourcePath:d.engineResourcePath,version:d._jsVersion,brtk:!!h,bptk:1===h,lcs:s,dm:!r&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:d._bUseFullFeature,browserInfo:d.browserInfo,deviceFriendlyName:d.deviceFriendlyName,ls:n,sp:o,lm:l,cw:_})}case"loading":d._loadWasmCallbackArr.push((e=>{e?i(e):t()}));break;case"loadSuccess":t();break;case"loadFail":i(d._loadWasmErr)}}))))}))}static showDialog(t,i){return e(this,void 0,void 0,(function*(){if(!r&&!d._bNeverShowDialog)try{let e=yield fetch(d.engineResourcePath+"dls.license.dialog.html");if(!e.ok)throw Error("Get license dialog fail. Network Error: "+e.statusText);let s=yield e.text();if(!s.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let n=document.createElement("div");n.innerHTML=s;let r=[];for(let e=0;e{if(e==t.target){o.remove();for(let e of r)e.remove()}}));else if(!l&&e.classList.contains("dls-license-icon-close"))l=e,e.addEventListener("click",(()=>{o.remove();for(let e of r)e.remove()}));else if(!_&&e.classList.contains("dls-license-icon-error"))_=e,"error"!=t&&e.remove();else if(!h&&e.classList.contains("dls-license-icon-warn"))h=e,"warn"!=t&&e.remove();else if(!c&&e.classList.contains("dls-license-msg-content")){c=e;let t=i;for(;t;){let i=t.indexOf("["),s=t.indexOf("]",i),n=t.indexOf("(",s),r=t.indexOf(")",n);if(-1==i||-1==s||-1==n||-1==r){e.appendChild(new Text(t));break}i>0&&e.appendChild(new Text(t.substring(0,i)));let o=document.createElement("a"),a=t.substring(i+1,s);o.innerText=a;let d=t.substring(n+1,r);o.setAttribute("href",d),o.setAttribute("target","_blank"),e.appendChild(o),t=t.substring(r+1)}}document.body.appendChild(o)}catch(e){d._onLog&&d._onLog(e.message||e)}}))}static createInstanceInWorker(t=!1){return e(this,void 0,void 0,(function*(){return yield d.loadWasm(),yield new Promise(((e,i)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(t=>{if(t.success)return e(t.instanceID);{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"createInstance",id:s,bScanner:t})}))}))}static createInstance(){return e(this,void 0,void 0,(function*(){let e=new d;return e._instanceID=yield d.createInstanceInWorker(),e}))}decode(t){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("decode(source: any)"),d._onLog&&(this._timeStartDecode=Date.now()),r)return t instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t)):t instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(t):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t):"http"==t.substring(0,4)?yield this._decode_Url(t):yield this._decode_FilePath(t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),t instanceof Blob?yield this._decode_Blob(t,e):t instanceof ArrayBuffer?yield this._decode_ArrayBuffer(t,e):t instanceof Uint8Array||t instanceof Uint8ClampedArray?yield this._decode_Uint8Array(t,e):t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?yield this._decode_Image(t,e):t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?yield this._decode_Canvas(t,e):t instanceof HTMLVideoElement?yield this._decode_Video(t,e):"string"==typeof t?"data:image/"==t.substring(0,11)?yield this._decode_Base64(t,e):yield this._decode_Url(t,e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(t,e)}))}decodeUrl(t){return e(this,void 0,void 0,(function*(){let e={};return!this.region||this.region instanceof Array||(e.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(t,e)}))}_decodeBuffer_Uint8Array(t,i,s,n,r,o){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,a)=>{let l=d._nextTaskID++;d._taskCallbackMap.set(l,(t=>{if(t.success){let i,s=d._onLog?Date.now():0;d._onLog&&d._onLog("worker return result: "+s),this._lastInnerDecodeDuration=t.duration;try{i=this._handleRetJsonString(t.decodeReturn)}catch(e){return a(e)}if(d._onLog){let e=Date.now();d._onLog("DBR time get result: "+s),d._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),d._onLog("DBR worker decode image cost: "+(s-this._timeEnterInnerDBR)),d._onLog("DBR worker handle results: "+(e-s)),d._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,a(e)}})),this._timeEnterInnerDBR=Date.now(),d._onLog&&d._onLog("Send buffer to worker:"+this._timeEnterInnerDBR),d._dbrWorker.postMessage({type:"decodeBuffer",id:l,instanceID:this._instanceID,body:{buffer:t,width:i,height:s,stride:n,format:r,config:o}},[t.buffer]),d._onLog&&o&&o._timeEndGettingFrame&&d._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(t,i,s,n,r,o){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const e=t.arrayBuffer?yield t.arrayBuffer():yield new Promise(((e,i)=>{let s=new FileReader;s.readAsArrayBuffer(t),s.onload=()=>{e(s.result)},s.onerror=()=>{i(s.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(e),i,s,n,r,o)}))}decodeBuffer(t,i,s,n,o,a){return e(this,void 0,void 0,(function*(){let e;return d._onLog&&d._onLog("decodeBuffer(buffer,width,height,stride,format)"),d._onLog&&(this._timeStartDecode=Date.now()),r?t instanceof Uint8Array?e=yield this._decodeBuffer_Uint8Array(t,i,s,n,o,a):t instanceof Buffer&&(e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,s,n,o,a)):t instanceof Uint8Array||t instanceof Uint8ClampedArray?e=yield this._decodeBuffer_Uint8Array(t,i,s,n,o,a):t instanceof ArrayBuffer?e=yield this._decodeBuffer_Uint8Array(new Uint8Array(t),i,s,n,o,a):t instanceof Blob&&(e=yield this._decodeBuffer_Blob(t,i,s,n,o,a)),e}))}_decodeFileInMemory_Uint8Array(t){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,i)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(t=>{if(t.success){let s;this._lastInnerDecodeDuration=t.duration;try{s=this._handleRetJsonString(t.decodeReturn)}catch(e){return i(e)}return e(s)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"decodeFileInMemory",id:s,instanceID:this._instanceID,body:{bytes:t}})}))}))}getRuntimeSettings(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=3,e.expectedBarcodesCount=0,e.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region,e.deblurLevel=5,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,e.region=t.region}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let t=e.region;[t.regionLeft,t.regionTop,t.regionLeft,t.regionBottom,t.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:t.regionLeft||0,regionTop:t.regionTop||0,regionRight:t.regionRight||0,regionBottom:t.regionBottom||0,regionMeasuredByPercentage:t.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(n.BF_ONED|n.BF_QR_CODE|n.BF_PDF417|n.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!r)if(this.bFilterRegionInJs){let t=e.region;if(t instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(t)),(t.regionLeft||t.regionTop||t.regionRight||t.regionBottom||t.regionMeasuredByPercentage)&&(t.regionLeft||t.regionTop||100!=t.regionRight||100!=t.regionBottom||!t.regionMeasuredByPercentage)?this.region=t:this.region=null,e.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((t,i)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:s,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})}))}))}resetRuntimeSettings(){return e(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(t){return e(this,void 0,void 0,(function*(){if(!d._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof t)t=t;else{if("object"!=typeof t)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");t=JSON.stringify(t)}return yield new Promise(((e,i)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(t=>{if(t.success){try{this._handleRetJsonString(t.initReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),d._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:s,instanceID:this._instanceID,body:{settings:t}})}))}))}_decode_Blob(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Blob(blob: Blob)");let e=null,s=null;if("undefined"!=typeof createImageBitmap)try{e=yield createImageBitmap(t)}catch(e){}e||(s=yield function(e){return new Promise(((t,i)=>{let s=URL.createObjectURL(e),n=new Image;n.dbrObjUrl=s,n.src=s,n.onload=()=>{t(n)},n.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(t));let n=yield this._decode_Image(e||s,i);return e&&e.close(),n}))}_decode_ArrayBuffer(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Uint8Array(t,i){return e(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([t]),i)}))}_decode_Image(t,i){return e(this,void 0,void 0,(function*(){d._onLog&&d._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),i=i||{};let e,s,n,r,o=t instanceof HTMLImageElement?t.naturalWidth:t.width,l=t instanceof HTMLImageElement?t.naturalHeight:t.height,_=i.region;if(_){let t,i,n,r;_.regionMeasuredByPercentage?(t=_.regionLeft*o/100,i=_.regionTop*l/100,n=_.regionRight*o/100,r=_.regionBottom*l/100):(t=_.regionLeft,i=_.regionTop,n=_.regionRight,r=_.regionBottom),e=t,s=i,o=Math.round(n-t),l=Math.round(r-i)}else e=0,s=0;const h=Math.max(o,l);if(h>this._canvasMaxWH){const e=this._canvasMaxWH/h;o>l?(n=this._canvasMaxWH,r=Math.round(l*e)):(n=Math.round(o*e),r=this._canvasMaxWH)}else n=o,r=l;let c,u;!this.bSaveOriCanvas&&a.OffscreenCanvas?c=new OffscreenCanvas(n,r):(c=document.createElement("canvas"),c.width=n,c.height=r),c.getContext("2d").drawImage(t,e,s,o,l,0,0,n,r),t.dbrObjUrl&&URL.revokeObjectURL(t.dbrObjUrl),_?(u=JSON.parse(JSON.stringify(i)),delete u.region):u=i;let g=yield this._decode_Canvas(c,u);return d.fixResultLocationWhenFilterRegionInJs(_,g,e,s,o,l,n,r),g}))}_decode_Canvas(i,s){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),i.crossOrigin&&"anonymous"!=i.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let e=(i.dbrCtx2d||i.getContext("2d")).getImageData(0,0,i.width,i.height).data;return yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888,s)}))}_decode_Video(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Video(video)"),!(t instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(t.crossOrigin&&"anonymous"!=t.crossOrigin)throw"cors";i=i||{};let e,s,n,r,o=t.videoWidth,l=t.videoHeight,_=i.region;if(_){let t,i,n,r;_.regionMeasuredByPercentage?(t=_.regionLeft*o/100,i=_.regionTop*l/100,n=_.regionRight*o/100,r=_.regionBottom*l/100):(t=_.regionLeft,i=_.regionTop,n=_.regionRight,r=_.regionBottom),e=t,s=i,o=Math.round(n-t),l=Math.round(r-i)}else e=0,s=0;const h=Math.max(o,l);if(h>this._canvasMaxWH){const e=this._canvasMaxWH/h;o>l?(n=this._canvasMaxWH,r=Math.round(l*e)):(n=Math.round(o*e),r=this._canvasMaxWH)}else n=o,r=l;let c=null;!this.bSaveOriCanvas&&a.OffscreenCanvas?c=new OffscreenCanvas(n,r):(c=document.createElement("canvas"),c.width=n,c.height=r);let u;(c.dbrCtx2d=c.getContext("2d")).drawImage(t,e,s,o,l,0,0,n,r),_?(u=JSON.parse(JSON.stringify(i)),delete u.region):u=i;let g=yield this._decode_Canvas(c,i);return _&&d.fixResultLocationWhenFilterRegionInJs(_,g,e,s,o,l,n,r),g}))}_decode_Base64(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Base64(base64Str)"),"string"!=typeof t)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==t.substring(0,11)&&(t=t.substring(t.indexOf(",")+1)),r){let e=Buffer.from(t,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e))}{let e=atob(t),s=e.length,n=new Uint8Array(s);for(;s--;)n[s]=e.charCodeAt(s);return yield this._decode_Blob(new Blob([n]),i)}}))}_decode_Url(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_Url(url)"),"string"!=typeof t)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(t=t,r){let i=yield new Promise(((i,s)=>e(this,void 0,void 0,(function*(){(t.startsWith("https")?yield import("https"):yield import("http")).get(t,(e=>{if(200==e.statusCode){let t=[];e.on("data",(e=>{t.push(e)})).on("end",(()=>{i(new Uint8Array(Buffer.concat(t)))}))}else s("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(i)}{let s=yield new Promise(((i,s)=>{let n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="blob",n.send(),n.onloadend=()=>e(this,void 0,void 0,(function*(){i(n.response)})),n.onerror=()=>{s(new Error("Network Error: "+n.statusText))}}));return yield this._decode_Blob(s,i)}}))}_decode_FilePath(t,i){return e(this,void 0,void 0,(function*(){if(d._onLog&&d._onLog("_decode_FilePath(path)"),!r)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof t)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const e=yield import("fs");let i=yield new Promise(((i,s)=>{e.readFile(t,((e,t)=>{e?s(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,s,n,r,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/n,l=a/r;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/l+s,t.y2=t.y2/l+s,t.y3=t.y3/l+s,t.y4=t.y4/l+s,2==t.resultCoordinateType&&(t.x1*=100/n,t.x2*=100/n,t.x3*=100/n,t.x4*=100/n,t.y1*=100/r,t.y2*=100/r,t.y3*=100/r,t.y4*=100/r)}}static BarcodeReaderException(e,t){let s,n=i.DBR_UNKNOWN;return"number"==typeof e?(n=e,s=new Error(t)):s=new Error(e),s.code=n,s}_handleRetJsonString(e){let t=i;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!d._setWarnnedEx.has(e.description)&&(d._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw d.BarcodeReaderException(e.exception,e.description)}setModeArgument(t,i,s,n){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,r)=>{let o=d._nextTaskID++;d._taskCallbackMap.set(o,(t=>{if(t.success){try{this._handleRetJsonString(t.setReturn)}catch(e){return r(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,r(e)}})),d._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:s,argumentValue:n}})}))}))}getModeArgument(t,i,s){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,n)=>{let r=d._nextTaskID++;d._taskCallbackMap.set(r,(t=>{if(t.success){let i;try{i=this._handleRetJsonString(t.getReturn)}catch(e){return n(e)}return e(i)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,n(e)}})),d._dbrWorker.postMessage({type:"getModeArgument",id:r,instanceID:this._instanceID,body:{modeName:t,index:i,argumentName:s}})}))}))}getIntermediateResults(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return e(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),i=[];for(let n of e)if(n.dataType==s.IMRDT_IMAGE)for(let e of n.results){const s=e.bytes;let n;switch(d._onLog&&d._onLog(" "+s.length+" "+s.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case t.IPF_ABGR_8888:n=new Uint8ClampedArray(s);break;case t.IPF_RGB_888:{const e=s.length/3;n=new Uint8ClampedArray(4*e);for(let t=0;t{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}} /*! * Dynamsoft JavaScript Library * @product Dynamsoft Camera Enhancer JS Edition @@ -19,4 +19,4 @@ function e(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{ * @fileoverview Dynamsoft JavaScript Library for Camera Enhancer * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -function l(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}d._jsVersion="8.8.3",d._jsEditVersion="20211011",d._version="loading...(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._license=s||o||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",d._sessionPassword=s||o||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",d.browserInfo=function(){if(!s&&!o){var t={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{e(this,void 0,void 0,(function*(){const e=yield import("os");t.OS=e&&e.platform?e.platform()+e.release():"Unknown"}))})(),t}}(),d._workerName="dbr-"+d._jsVersion+".worker.js",d._engineResourcePath=(()=>{if(s){const t=import.meta.url;return new Promise((i=>e(void 0,void 0,void 0,(function*(){const e=yield import("url");"string"!=typeof d._engineResourcePath&&(d._engineResourcePath=e.fileURLToPath(t.substring(0,t.lastIndexOf("/")+1))),i()}))))}if(!o&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),d._licenseServer=[],d._deviceFriendlyName="",d._isShowRelDecodeTimeInResults=!1,d._bWasmDebug=!1,d._bNeverShowDialog=!1,d.__bUseFullFeature=!0,d._nextTaskID=0,d._taskCallbackMap=new Map,d._loadWasmStatus="unload",d._loadWasmCallbackArr=[],d._lastErrorCode=0,d._lastErrorString="",d._setWarnnedEx=new Set,d._loadWasmErr=null;const _=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),h=!_&&"undefined"==typeof self;class c{constructor(){this._canvasMaxWH="iPhone"==c.browserInfo.OS||"Android"==c.browserInfo.OS?2048:4096,this._singleFrameMode=!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia),this._singleFrameModeIpt=()=>{let e=document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.setAttribute("capture",""),e.addEventListener("change",(()=>l(this,void 0,void 0,(function*(){let t=e.files[0];e.value="",this.onSingleFrameAcquired(t)})))),e},this._clickIptSingleFrameMode=()=>{this._singleFrameModeIpt().click()},this.styleEls=[],this.bSaveOriCanvas=!0,this.maxVideoCvsLength=3,this.videoCvses=[],this.videoGlCvs=null,this.videoGl=null,this.glImgData=null,this._onCameraSelChange=()=>{this.play(this._selCam.value).then((()=>{this._isOpen||this.stop()}))},this._onResolutionSelChange=()=>{let e,t;if(this._selRsl&&-1!=this._selRsl.selectedIndex){let i=this._selRsl.options[this._selRsl.selectedIndex];e=i.getAttribute("data-width"),t=i.getAttribute("data-height")}this.play(void 0,e,t).then((()=>{this._isOpen||this.stop()}))},this._onCloseBtnClick=()=>{this.close()},this._isOpen=!1,this.videoSettings={video:{width:{ideal:1280},height:{ideal:720},facingMode:{ideal:"environment"}}},this.iPlayRound=0,this.promisePlay=null,this._allCameras=[],this._currentCamera=null,this._videoTrack=null,this._lastDeviceId=void 0,this._vc_bPlayingVideoBeforeHide=!1,this._ev_documentHideEvent=()=>{"visible"===document.visibilityState?this._vc_bPlayingVideoBeforeHide&&("Firefox"==c.browserInfo.browser?this.play():this._video.play(),this._vc_bPlayingVideoBeforeHide=!1):this._video&&!this._video.paused&&(this._vc_bPlayingVideoBeforeHide=!0,this._video.pause())},this._video=null,this._bgLoading=null,this._selCam=null,this._bgCamera=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._region=null,this.bChangeRegionIndexManually=!1,this._regionIndex=-1,this._loopInterval=0,this._frameQueueMaxLength=1,this._frameQueue=[],this._bFetchingLoopStarted=!1,this._bStoppedByPause=!1,this.alwaysRefreshBuffer=!0,this._bufferRefreshInterval=0,this.bDestroyed=!1}static getVersion(){return this._version}static detectEnvironment(){return l(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(_?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if(this._hasEngineResourceLoaded)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` is called.");if(null==e&&(e="./"),_||h)c._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,c._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(c._engineResourcePath+="/")}static get defaultUIElementURL(){var e;return null===(e=this._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",c.engineResourcePath)}static set defaultUIElementURL(e){this._defaultUIElementURL=e}getUIElement(){return this.UIElement}setUIElement(e){return l(this,void 0,void 0,(function*(){if("string"==typeof e||e instanceof String){if(!e.trim().startsWith("<")){let t=yield fetch(e);if(!t.ok)throw Error("setUIElement(elementOrUrl): Network Error: "+t.statusText);e=yield t.text()}if(!e.trim().startsWith("<"))throw Error("setUIElement(elementOrUrl): Can't get valid HTMLElement.");let t=document.createElement("div");t.innerHTML=e;for(let e=0;e','','',''].join(""),this._optGotRsl=this._optGotRsl||this._selRsl.options[0])):!this._optGotRsl&&t.classList.contains("dce-opt-gotResolution")?this._optGotRsl=t:!this._btnClose&&t.classList.contains("dce-btn-close")?this._btnClose=t:!this._video&&t.classList.contains("dce-existingVideo")?(this._video=t,this._video.setAttribute("playsinline","true")):!i&&t.tagName&&"video"==t.tagName.toLowerCase()&&(i=t);if(!this._video&&i&&(this._video=i),this.singleFrameMode?this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")):this._bgLoading&&(this._bgLoading.style.display=""),this.singleFrameMode?(this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")),this._bgCamera&&(this._bgCamera.style.display="")):this._bgLoading&&(this._bgLoading.style.display=""),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this._video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dce-video`");this._isOpen=!0}_unbindUI(){this.singleFrameMode?(this._video&&(this._video.removeEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="",this._video.removeAttribute("title")),this._bgCamera&&(this._bgCamera.style.display="none")):this._bgLoading&&(this._bgLoading.style.display="none"),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this._video=null,this._selCam=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._isOpen=!1}_assertOpen(){if(!this._isOpen)throw Error("The camera is not open.")}get video(){return this._video}set region(e){this._region=e,this._bFetchingLoopStarted&&(this._regionIndex=-1,this._fetchingLoop(!1))}get region(){return this._region}set regionIndex(e){this.bChangeRegionIndexManually&&(this._region instanceof Array&&this._region.length>e?this._regionIndex=e:this._regionIndex=0)}get regionIndex(){return this._regionIndex}set loopInterval(e){e>=0&&(this._loopInterval=e),this._bFetchingLoopStarted&&this._fetchingLoop(!1)}get loopInterval(){return this._loopInterval}set frameQueueMaxLength(e){for(this._frameQueueMaxLength=e;this._frameQueue&&this._frameQueue.length>this._frameQueueMaxLength;)this._frameQueue.shift()}get frameQueueMaxLength(){return this._frameQueueMaxLength}get frameQueue(){return JSON.parse(JSON.stringify(this._frameQueue))}set bufferRefreshInterval(e){this._bufferRefreshInterval=e}get bufferRefreshInterval(){return this._bufferRefreshInterval}isContextDestroyed(){return this.bDestroyed}static createInstance(e){return l(this,void 0,void 0,(function*(){if(_)throw new Error("`CameraEnhancer` is not supported in Node.js.");let t=new c;("string"==typeof e||e instanceof String)&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(this.defaultUIElementURL),this._hasEngineResourceLoaded=!0,document.addEventListener("visibilitychange",t._ev_documentHideEvent),t}))}play(e,t,i){return l(this,void 0,void 0,(function*(){if(this._assertOpen(),this._video&&this.videoSrc){yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),"string"==typeof this.videoSrc||this.videoSrc instanceof String?this._video.src=this.videoSrc:this._video.srcObject=this.videoSrc,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}));let e={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(e)}),0),e}if(this.singleFrameMode)return this._clickIptSingleFrameMode(),{width:0,height:0};const n=++this.iPlayRound;return this.promisePlay&&(yield this.promisePlay,nl(this,void 0,void 0,(function*(){var n;try{this._video&&this._video.srcObject&&this.stop(),c._onLog&&c._onLog("DCE: ======before video========"),yield this.getAllCameras();let r=()=>{if(this.bDestroyed)throw d&&d.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null,new Error("The CameraEnhancer instance has been destroyed.")};const s=JSON.parse(JSON.stringify(this.videoSettings));let o;"boolean"==typeof s.video&&(s.video={}),t&&(s.video.width={ideal:t}),i&&(s.video.height={ideal:i});const a=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];let d,_=()=>{for(let e of this._allCameras){let t=e.label.toLowerCase();if(t&&a.some((e=>-1!=t.indexOf(e)))&&/\b0(\b)?/.test(t)){delete s.video.facingMode,s.video.deviceId={ideal:e.deviceId};break}}s.video.deviceId||-1==["Android","HarmonyOS"].indexOf(c.browserInfo.OS)||(delete s.video.facingMode,s.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})};if(e)delete s.video.facingMode,s.video.deviceId={exact:e},this._lastDeviceId=e;else if(s.video.deviceId);else if(this._lastDeviceId)delete s.video.facingMode,s.video.deviceId={exact:this._lastDeviceId};else if(s.video.facingMode){let e=s.video.facingMode;e instanceof Array&&e.length&&(e=e[0]),e=e.exact||e.ideal||e,"environment"===e&&(o=!!s.video.facingMode,_())}c._onLog&&c._onLog("DCE: ======try getUserMedia========");let h,u=[0,500],g=null,R=null,f=e=>l(this,void 0,void 0,(function*(){for(let t of u){r(),t&&(yield new Promise((e=>setTimeout(e,t)))),r();{const t=e.video.deviceId;R=t?t.exact||t.ideal||t:null}try{c._onLog&&c._onLog("DCE: ask "+JSON.stringify(e)),d=yield navigator.mediaDevices.getUserMedia(e);break}catch(e){g=e,c._onLog&&c._onLog("DCE: "+e.message||e)}}}));if(yield f(s),d||(c._onLog&&c._onLog("DCE: ======try getUserMedia again========"),h=JSON.parse(JSON.stringify(s)),"object"==typeof h.video&&("iPhone"==c.browserInfo.OS?(t>=1280||i>=1280?h.video.width=1280:t>=640||i>=640?h.video.width=640:(t<640||i<640)&&(h.video.width=320),delete h.video.height):o&&!s.video.deviceId?(delete h.video.facingMode,this._allCameras.length&&(h.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})):h.video=!0),c._onLog&&c._onLog("DCE: "+h),yield f(h)),d||(u=[1e3,2e3],yield f(s)),d||(yield f(h)),!d)throw g;const E=()=>{const e=d.getVideoTracks();let t,i;if(e.length&&(t=this._videoTrack=e[0]),this._video&&t){if(t.label)for(let e of this._allCameras)if(t.label==e.label){e._checked=!0,i=e,this._lastDeviceId=e.deviceId;break}if(!i&&R)for(let e of this._allCameras)if(R==e.deviceId){t.label&&(e._checked=!0,e.label=t.label),i=e,this._lastDeviceId=e.deviceId;break}}this._currentCamera=i};if(yield this.getAllCameras(),r(),o){E(),_();let e=s.video.deviceId;e&&(e=e.exact||e.ideal||e);let t=null===(n=this._currentCamera)||void 0===n?void 0:n.deviceId;!e||t&&e==t||(d.getTracks().forEach((e=>{e.stop()})),u=[0,500,1e3,2e3],yield f(s))}r();const m=()=>l(this,void 0,void 0,(function*(){c._onLog&&c._onLog("======play video========"),yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),this._video.srcObject=d,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}))}));yield m(),c._onLog&&c._onLog("DCE: ======played video========"),this._bgLoading&&(this._bgLoading.style.animationPlayState="paused");const I="got "+this._video.videoWidth+"x"+this._video.videoHeight;this._optGotRsl&&(this._optGotRsl.setAttribute("data-width",this._video.videoWidth),this._optGotRsl.setAttribute("data-height",this._video.videoHeight),this._optGotRsl.innerText=I,this._selRsl&&this._optGotRsl.parentNode==this._selRsl&&(this._selRsl.value="got")),c._onLog&&c._onLog("DCE: "+I),E(),r(),this._renderSelCameraInfo();let v={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(v)}),0),this.promisePlay=null,v}catch(e){throw this.promisePlay=null,e}})))(),yield this.promisePlay)}))}resume(){return l(this,void 0,void 0,(function*(){yield this.play(),this._bStoppedByPause&&(this._bStoppedByPause=!1,this.startFetchingLoop())}))}pause(){this._video&&this._video.pause(),this._bFetchingLoopStarted&&(this.stopFetchingLoop(),this._bStoppedByPause=!0)}close(){return l(this,void 0,void 0,(function*(){this.stop(),this._unbindUI(),this.UIElement.style.display="none",this.stopFetchingLoop()}))}open(){return l(this,void 0,void 0,(function*(){return this._bindUI(),this.UIElement.parentNode||(this.UIElement.style.position="fixed",this.UIElement.style.left="0",this.UIElement.style.top="0",document.body.append(this.UIElement)),"none"==this.UIElement.style.display&&(this.UIElement.style.display=""),yield this.play()}))}stop(){this._video&&this._video.srcObject&&(c._onLog&&c._onLog("DCE: ======stop video========"),this._video.srcObject.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null),this._video&&this._video.classList.contains("dce-existingVideo")&&(c._onLog&&c._onLog("DCE: ======stop existing video========"),this._video.pause(),this._video.currentTime=0),this._bgLoading&&(this._bgLoading.style.animationPlayState=""),this._frameQueue.length=0}getAllCameras(){return l(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t=[],i=[];if(this._allCameras)for(let e of this._allCameras)e._checked&&i.push(e);for(let n=0;nt.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{colorTemperature:e}]})}))}setExposureCompensation(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().exposureCompensation;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{exposureCompensation:e}]})}))}setZoom(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().zoom;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{zoom:e}]})}))}setFrameRate(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().frameRate;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({width:{ideal:Math.max(this._video.videoWidth,this._video.videoHeight)},frameRate:e})}))}getFrameRate(){return this.getCameraSettings().frameRate}getFrame(e){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");this._assertOpen(),c._onLog&&c._onLog("DCE: getFrame(region?)");const t=Date.now(),i=this._video.videoWidth,n=this._video.videoHeight,r=Math.max(i,n);let s,o;if(r>this._canvasMaxWH){let e=this._canvasMaxWH/r;s=Math.round(i*e),o=Math.round(n*e)}else s=i,o=n;let a=0,d=0,l=i,_=n,h=i,u=n;if(e){let t,r,c,g;e.regionMeasuredByPercentage?(t=e.regionLeft*s/100,r=e.regionTop*o/100,c=e.regionRight*s/100,g=e.regionBottom*o/100):(t=e.regionLeft,r=e.regionTop,c=e.regionRight,g=e.regionBottom),h=c-t,l=Math.round(h/s*i),u=g-r,_=Math.round(u/o*n),a=Math.round(t/s*i),d=Math.round(r/o*n)}let g=0==a&&0==d&&i==l&&n==_&&i==h&&n==u;if(!this.bSaveOriCanvas&&g){this.videoGlCvs||(this.videoGlCvs=globalThis.OffscreenCanvas?new OffscreenCanvas(h,u):document.createElement("canvas"));const e=this.videoGlCvs;e.width==h&&e.height==u||(e.height=u,e.width=h,this.videoGl&&this.videoGl.viewport(0,0,h,u));const i=this.videoGl||e.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0})||e.getContext("experimental-webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0});if(!this.videoGl){this.videoGl=i;const e=i.createShader(i.VERTEX_SHADER);i.shaderSource(e,"\nattribute vec4 a_position;\nattribute vec2 a_uv;\n\nvarying vec2 v_uv;\n\nvoid main() {\n gl_Position = a_position;\n v_uv = a_uv;\n}\n"),i.compileShader(e),i.getShaderParameter(e,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(e));const t=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(t,"\nprecision lowp float;\n\nvarying vec2 v_uv;\n\nuniform sampler2D u_texture;\n\nvoid main() {\n vec4 sample = texture2D(u_texture, v_uv);\n float grey = 0.299 * sample.r + 0.587 * sample.g + 0.114 * sample.b;\n gl_FragColor = vec4(grey, 0.0, 0.0, 1.0);\n}\n"),i.compileShader(t),i.getShaderParameter(t,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(t));const n=i.createProgram();i.attachShader(n,e),i.attachShader(n,t),i.linkProgram(n),i.getProgramParameter(n,i.LINK_STATUS)||console.error("Unable to initialize the shader program: "+i.getProgramInfoLog(n)),i.useProgram(n),i.bindBuffer(i.ARRAY_BUFFER,i.createBuffer()),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,1,0,1,1,1,1,1,-1,-1,0,0,1,-1,1,0]),i.STATIC_DRAW);const r=i.getAttribLocation(n,"a_position");i.enableVertexAttribArray(r),i.vertexAttribPointer(r,2,i.FLOAT,!1,16,0);const s=i.getAttribLocation(n,"a_uv");i.enableVertexAttribArray(s),i.vertexAttribPointer(s,2,i.FLOAT,!1,16,8),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,i.createTexture()),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.uniform1i(i.getUniformLocation(n,"u_texture"),0)}(!this.glImgData||this.glImgData.length=this.maxVideoCvsLength&&(this.videoCvses=this.videoCvses.slice(1)),this.videoCvses.push(i))}const n=i.dbrCtx2d;g?n.drawImage(this._video,0,0):n.drawImage(this._video,a,d,l,_,0,0,h,u);let r=i.dbrCtx2d||i.getContext("2d");if(0===i.width||0===i.height)return null;let s=r.getImageData(0,0,i.width,i.height).data;const o=Date.now();return{data:s,canvas:i,region:e,sx:a,sy:d,width:l,height:_,timeSpent:o-t,timeStamp:o}}}getCurrentRegion(){let e;if(this._region)if(this._region instanceof Array){if(this.bChangeRegionIndexManually){if(this._regionIndex>=this._region.length)throw new Error("the 'regionIndex' should be less than the length of region array.")}else++this._regionIndex>=this._region.length&&(this._regionIndex=0);e=this._region[this._regionIndex]}else e=this._region;else e=null;return e}_fetchingLoop(e){if(this.bDestroyed)return void this.stopFetchingLoop();if(!this._isOpen||!this.isFetchingLoopStarted())return void this.stopFetchingLoop();if(this._video.paused)return c._onLog&&c._onLog("DCE: Video is paused. Ask in 1s."),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),void(this._frameLoopTimeoutId=setTimeout((()=>{this._fetchingLoop(!0)}),1e3));const t=()=>{c._onLog&&c._onLog("DCE: start fetching a frame: "+Date.now());let e=this.getCurrentRegion(),t=this.getFrame(e);this._frameQueue&&this._frameQueue.length>=this._frameQueueMaxLength&&this._frameQueue.shift(),this._frameQueue.push(t),c._onLog&&c._onLog("DCE: finish fetching a frame: "+Date.now())},i=()=>{this._frameLoopTimeoutId2&&clearTimeout(this._frameLoopTimeoutId2),this._bufferRefreshInterval<=0||(this._frameLoopTimeoutId2=setTimeout((()=>{this.bDestroyed?this.stopFetchingLoop():this._isOpen&&this.isFetchingLoopStarted()?this._video.paused?this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId):(c._onLog&&c._onLog("DCE: second timeout executes: "+Date.now()),t(),i()):this.stopFetchingLoop()}),this._bufferRefreshInterval))};e&&(this._frameQueue.length{this._fetchingLoop(!0)}),this._loopInterval)}startFetchingLoop(){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");if(this._assertOpen(),this._video.paused)throw Error("The video is paused.");this.isFetchingLoopStarted()||(this._bFetchingLoopStarted=!0,c._onLog&&c._onLog("start fetching loop: "+Date.now()),this._fetchingLoop(!0))}isFetchingLoopStarted(){return this._bFetchingLoopStarted}stopFetchingLoop(){this._bFetchingLoopStarted&&(c._onLog&&c._onLog("stop fetching loop: "+Date.now()),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),this._frameQueue.length=0,this._bFetchingLoopStarted=!1)}getFrameFromBuffer(e){return this._frameQueue&&this._frameQueue.length?e?e{if(_){const e=import.meta.url;return new Promise((t=>l(void 0,void 0,void 0,(function*(){const i=yield import("url");"string"!=typeof c._engineResourcePath&&(c._engineResourcePath=i.fileURLToPath(e.substring(0,e.lastIndexOf("/")+1))),t()}))))}if(!h&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),c._defaultUIElementURL="@engineResourcePath/dce.ui.html";class u{static get browserInfo(){return c.browserInfo}static getVersion(){return c.getVersion()}static detectEnvironment(){return c.detectEnvironment()}static get engineResourcePath(){return c.engineResourcePath}static set engineResourcePath(e){c.engineResourcePath=e}static get _onLog(){return c._onLog}static set _onLog(e){c._onLog=e}}u.CameraEnhancer=c;const g=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class R extends d{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=R._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",d.engineResourcePath)}static set defaultUIElementURL(e){R._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(t){return e(this,void 0,void 0,(function*(){yield this.dce.setUIElement(t)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(t){this.dce.singleFrameMode=t,t&&(()=>{e(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return e(this,void 0,void 0,(function*(){this.dce||(d._onLog&&d._onLog("createDCEInstance()"),c.defaultUIElementURL=null,this.dce=yield c.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=t=>e(this,void 0,void 0,(function*(){let e=yield this.decode(t);yield this.clearMapDecodeRecord();for(let t of e)delete t.bUnduplicated;if(this._drawRegionsults(e),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(e),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let t of e)this.onUniqueRead(t.barcodeText,t)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(t){return e(this,void 0,void 0,(function*(){if(g)throw new Error("`BarcodeScanner` is not supported in Node.js.");let e=new R;yield e.createDCEInstance(),e._instanceID=yield R.createInstanceInWorker(!0),"string"==typeof t&&(t=JSON.parse(t));for(let i in t)e[i]=t[i];return yield e.setUIElement(R.defaultUIElementURL),e.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),e.singleFrameMode||(yield e.updateRuntimeSettings("single")),e}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(i){return e(this,void 0,void 0,(function*(){this._assertOpen();let e=null;i&&i.region&&(e=i.region);let n=this.dce.getFrame(e);if(n&&null===n.canvas){let{data:e,width:i,height:r}=n;return yield this._decodeBuffer_Uint8Array(e,i,r,i,t.IPF_GrayScaled)}if(n&&n.canvas){let{data:e,canvas:i,region:r,sx:s,sy:o,sWidth:a,sHeight:l}=n;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let _=yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888);return d.fixResultLocationWhenFilterRegionInJs(r,_,s,o,a,l,i.width,i.height),_}}))}clearMapDecodeRecord(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(R.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region)}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=3,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0],e.timeout=1e5}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=5,e.expectedBarcodesCount=512,e.scaleDownThreshold=1e5,e.localizationModes=[2,16,4,8,0,0,0,0],e.timeout=1e5}else if("single"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionNormalPreset(t.region)?e.region=JSON.parse(JSON.stringify(R.singlePresetRegion)):e.region=t.region,e.expectedBarcodesCount=1,e.localizationModes=[16,2,0,0,0,0,0,0],e.barcodeZoneMinDistanceToImageBorders=0}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let i=t.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(r.BF_ONED|r.BF_QR_CODE|r.BF_PDF417|r.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let t=e.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(t)):this.userDefinedRegion=null,t instanceof Array)if(t.length){for(let e=0;e{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})})),"single"==t&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");this.dce._bindUI();let t=[e],i=e.children;for(let e of i)t.push(e);for(let e=0;e{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),d._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(t){return e(this,void 0,void 0,(function*(){return this.intervalTime=t.intervalTime,yield new Promise(((e,i)=>{let n=d._nextTaskID++;d._taskCallbackMap.set(n,(t=>{if(t.success)return e();{let e=new Error(t.message);return e.stack+="\n"+t.stack,i(e)}})),R._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:t}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(t,i,n){return e(this,void 0,void 0,(function*(){return this.dce.play(t,i,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(t){return e(this,void 0,void 0,(function*(){return this.dce.applyConstraints(t)}))}turnOnTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(t){return e(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(t)}))}setExposureCompensation(t){return e(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(t)}))}setZoom(t){return e(this,void 0,void 0,(function*(){return this.dce.setZoom(t)}))}setFrameRate(t){return e(this,void 0,void 0,(function*(){return this.dce.setFrameRate(t)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return e(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return d._onLog&&d._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),d._onLog&&d._onLog("======= once read ======="),d._onLog&&(this._timeStartDecode=Date.now());let i=this._getVideoFrame();if(!i)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>e(this,void 0,void 0,(function*(){if(i&&null===i.canvas){let{data:e,width:n,height:r,timeStamp:s}=i,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(e,n,r,n,t.IPF_GrayScaled,o)}if(i&&i.canvas){let{data:e,canvas:n,region:r,sx:s,sy:o,width:a,height:l,timeStamp:_}=i,h={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=n);let c=yield this._decodeBuffer_Uint8Array(e,n.width,n.height,4*n.width,t.IPF_ABGR_8888,h);return d.fixResultLocationWhenFilterRegionInJs(r,c,s,o,n.width,n.height,a,l),c}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{d._onLog&&d._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})(),this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),d._onLog&&d._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return e(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield t.destroyContext.call(this))}))}}var f,E,m,I,v,A,S,p,T,D,C,y,L,M,O,b,N,B,P,F,w,U,V,k,x,G,W;R._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",R.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(f||(f={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(E||(E={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(m||(m={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(I||(I={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(v||(v={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(A||(A={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(S||(S={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(p||(p={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(T||(T={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(C||(C={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(y||(y={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(L||(L={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(O||(O={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(b||(b={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(N||(N={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(B||(B={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(P||(P={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(F||(F={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(w||(w={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(U||(U={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(V||(V={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(k||(k={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(x||(x={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(G||(G={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(W||(W={}));class H{static get version(){return d.version}static get productKeys(){return d.productKeys}static set productKeys(e){d.productKeys=e}static get handshakeCode(){return d.handshakeCode}static set handshakeCode(e){d.handshakeCode=e}static get organizationID(){return d.organizationID}static set organizationID(e){d.organizationID=e}static get sessionPassword(){return d.sessionPassword}static set sessionPassword(e){d.sessionPassword=e}static get browserInfo(){return d.browserInfo}static detectEnvironment(){return d.detectEnvironment()}static get _workerName(){return d._workerName}static set _workerName(e){d._workerName=e}static get engineResourcePath(){return d.engineResourcePath}static set engineResourcePath(e){d.engineResourcePath=e}static get licenseServer(){return d.licenseServer}static set licenseServer(e){d.licenseServer=e}static get deviceFriendlyName(){return d.deviceFriendlyName}static set deviceFriendlyName(e){d.deviceFriendlyName=e}static get _onLog(){return d._onLog}static set _onLog(e){d._onLog=e}static get _bWasmDebug(){return d._bWasmDebug}static set _bWasmDebug(e){d._bWasmDebug=e}static get _bUseFullFeature(){return d._bUseFullFeature}static set _bUseFullFeature(e){d._bUseFullFeature=e}static get _dbrWorker(){return d._dbrWorker}static isLoaded(){return d.isLoaded()}static isWasmLoaded(){return d.isLoaded()}static loadWasm(){return d.loadWasm()}}H.DBR=H,H.BarcodeReader=d,H.BarcodeScanner=R,H.CameraEnhancer=u,H.EnumBarcodeColourMode=f,H.EnumBarcodeComplementMode=E,H.EnumBarcodeFormat=r,H.EnumBarcodeFormat_2=m,H.EnumBinarizationMode=I,H.EnumClarityCalculationMethod=v,H.EnumClarityFilterMode=A,H.EnumColourClusteringMode=S,H.EnumColourConversionMode=p,H.EnumConflictMode=T,H.EnumDeblurMode=D,H.EnumDeformationResistingMode=C,H.EnumDPMCodeReadingMode=y,H.EnumErrorCode=i,H.EnumGrayscaleTransformationMode=L,H.EnumImagePixelFormat=t,H.EnumImagePreprocessingMode=M,H.EnumIMResultDataType=n,H.EnumIntermediateResultSavingMode=O,H.EnumIntermediateResultType=b,H.EnumLocalizationMode=N,H.EnumPDFReadingMode=B,H.EnumQRCodeErrorCorrectionLevel=P,H.EnumRegionPredetectionMode=F,H.EnumResultCoordinateType=w,H.EnumResultType=U,H.EnumScaleUpMode=V,H.EnumTerminatePhase=k,H.EnumTextFilterMode=x,H.EnumTextResultOrderMode=G,H.EnumTextureDetectionMode=W;export{d as BarcodeReader,R as BarcodeScanner,u as CameraEnhancer,H as DBR,f as EnumBarcodeColourMode,E as EnumBarcodeComplementMode,r as EnumBarcodeFormat,m as EnumBarcodeFormat_2,I as EnumBinarizationMode,v as EnumClarityCalculationMethod,A as EnumClarityFilterMode,S as EnumColourClusteringMode,p as EnumColourConversionMode,T as EnumConflictMode,y as EnumDPMCodeReadingMode,D as EnumDeblurMode,C as EnumDeformationResistingMode,i as EnumErrorCode,L as EnumGrayscaleTransformationMode,n as EnumIMResultDataType,t as EnumImagePixelFormat,M as EnumImagePreprocessingMode,O as EnumIntermediateResultSavingMode,b as EnumIntermediateResultType,N as EnumLocalizationMode,B as EnumPDFReadingMode,P as EnumQRCodeErrorCorrectionLevel,F as EnumRegionPredetectionMode,w as EnumResultCoordinateType,U as EnumResultType,V as EnumScaleUpMode,k as EnumTerminatePhase,x as EnumTextFilterMode,G as EnumTextResultOrderMode,W as EnumTextureDetectionMode,H as default}; +function l(e,t,i,s){return new(i||(i=Promise))((function(n,r){function o(e){try{d(s.next(e))}catch(e){r(e)}}function a(e){try{d(s.throw(e))}catch(e){r(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((s=s.apply(e,t||[])).next())}))}d._jsVersion="8.8.7",d._jsEditVersion="20220125",d._version="loading...(JS "+d._jsVersion+"."+d._jsEditVersion+")",d._license=r||o||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",d._sessionPassword=r||o||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",d.browserInfo=function(){if(!r&&!o){var t={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{e(this,void 0,void 0,(function*(){const e=yield import("os");t.OS=e&&e.platform?e.platform()+e.release():"Unknown"}))})(),t}}(),d._workerName="dbr-"+d._jsVersion+".worker.js",d._engineResourcePath=(()=>{if(r){const t=import.meta.url;return new Promise((i=>e(void 0,void 0,void 0,(function*(){const e=yield import("url");"string"!=typeof d._engineResourcePath&&(d._engineResourcePath=e.fileURLToPath(t.substring(0,t.lastIndexOf("/")+1))),i()}))))}if(!o&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),d._licenseServer=[],d._deviceFriendlyName="",d._isShowRelDecodeTimeInResults=!1,d._bWasmDebug=!1,d._bNeverShowDialog=!1,d.__bUseFullFeature=!0,d._nextTaskID=0,d._taskCallbackMap=new Map,d._loadWasmStatus="unload",d._loadWasmCallbackArr=[],d._lastErrorCode=0,d._lastErrorString="",d._setWarnnedEx=new Set,d._loadWasmErr=null;const _=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),h=!_&&"undefined"==typeof self;class c{constructor(){this._canvasMaxWH="iPhone"==c.browserInfo.OS||"Android"==c.browserInfo.OS?2048:4096,this._singleFrameMode=!(navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia),this._singleFrameModeIpt=()=>{let e=document.createElement("input");return e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.setAttribute("capture",""),e.addEventListener("change",(()=>l(this,void 0,void 0,(function*(){let t=e.files[0];e.value="",this.onSingleFrameAcquired(t)})))),e},this._clickIptSingleFrameMode=()=>{this._singleFrameModeIpt().click()},this.styleEls=[],this.bSaveOriCanvas=!0,this.maxVideoCvsLength=3,this.videoCvses=[],this.videoGlCvs=null,this.videoGl=null,this.glImgData=null,this._onCameraSelChange=()=>{this.play(this._selCam.value).then((()=>{this._isOpen||this.stop()}))},this._onResolutionSelChange=()=>{let e,t;if(this._selRsl&&-1!=this._selRsl.selectedIndex){let i=this._selRsl.options[this._selRsl.selectedIndex];e=i.getAttribute("data-width"),t=i.getAttribute("data-height")}this.play(void 0,e,t).then((()=>{this._isOpen||this.stop()}))},this._onCloseBtnClick=()=>{this.close()},this._isOpen=!1,this.videoSettings={video:{width:{ideal:1280},height:{ideal:720},facingMode:{ideal:"environment"}}},this.iPlayRound=0,this.promisePlay=null,this._allCameras=[],this._currentCamera=null,this._videoTrack=null,this._lastDeviceId=void 0,this._vc_bPlayingVideoBeforeHide=!1,this._ev_documentHideEvent=()=>{"visible"===document.visibilityState?this._vc_bPlayingVideoBeforeHide&&("Firefox"==c.browserInfo.browser?this.play():this._video.play(),this._vc_bPlayingVideoBeforeHide=!1):this._video&&!this._video.paused&&(this._vc_bPlayingVideoBeforeHide=!0,this._video.pause())},this._video=null,this._bgLoading=null,this._selCam=null,this._bgCamera=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._region=null,this.bChangeRegionIndexManually=!1,this._regionIndex=-1,this._loopInterval=0,this._frameQueueMaxLength=1,this._frameQueue=[],this._bFetchingLoopStarted=!1,this._bStoppedByPause=!1,this.alwaysRefreshBuffer=!0,this._bufferRefreshInterval=0,this.bDestroyed=!1}static getVersion(){return this._version}static detectEnvironment(){return l(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(_?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if(this._hasEngineResourceLoaded)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` is called.");if(null==e&&(e="./"),_||h)c._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,c._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(c._engineResourcePath+="/")}static get defaultUIElementURL(){var e;return null===(e=this._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",c.engineResourcePath)}static set defaultUIElementURL(e){this._defaultUIElementURL=e}getUIElement(){return this.UIElement}setUIElement(e){return l(this,void 0,void 0,(function*(){if("string"==typeof e||e instanceof String){if(!e.trim().startsWith("<")){let t=yield fetch(e);if(!t.ok)throw Error("setUIElement(elementOrUrl): Network Error: "+t.statusText);e=yield t.text()}if(!e.trim().startsWith("<"))throw Error("setUIElement(elementOrUrl): Can't get valid HTMLElement.");let t=document.createElement("div");t.innerHTML=e;for(let e=0;e','','',''].join(""),this._optGotRsl=this._optGotRsl||this._selRsl.options[0])):!this._optGotRsl&&t.classList.contains("dce-opt-gotResolution")?this._optGotRsl=t:!this._btnClose&&t.classList.contains("dce-btn-close")?this._btnClose=t:!this._video&&t.classList.contains("dce-existingVideo")?(this._video=t,this._video.setAttribute("playsinline","true")):!i&&t.tagName&&"video"==t.tagName.toLowerCase()&&(i=t);if(!this._video&&i&&(this._video=i),this.singleFrameMode?this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")):this._bgLoading&&(this._bgLoading.style.display=""),this.singleFrameMode?(this._video&&(this._video.addEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="pointer",this._video.setAttribute("title","Take a photo")),this._bgCamera&&(this._bgCamera.style.display="")):this._bgLoading&&(this._bgLoading.style.display=""),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this._video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dce-video`");this._isOpen=!0}_unbindUI(){this.singleFrameMode?(this._video&&(this._video.removeEventListener("click",this._clickIptSingleFrameMode),this._video.style.cursor="",this._video.removeAttribute("title")),this._bgCamera&&(this._bgCamera.style.display="none")):this._bgLoading&&(this._bgLoading.style.display="none"),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this._video=null,this._selCam=null,this._selRsl=null,this._optGotRsl=null,this._btnClose=null,this._isOpen=!1}_assertOpen(){if(!this._isOpen)throw Error("The camera is not open.")}get video(){return this._video}set region(e){this._region=e,this._bFetchingLoopStarted&&(this._regionIndex=-1,this._fetchingLoop(!1))}get region(){return this._region}set regionIndex(e){this.bChangeRegionIndexManually&&(this._region instanceof Array&&this._region.length>e?this._regionIndex=e:this._regionIndex=0)}get regionIndex(){return this._regionIndex}set loopInterval(e){e>=0&&(this._loopInterval=e),this._bFetchingLoopStarted&&this._fetchingLoop(!1)}get loopInterval(){return this._loopInterval}set frameQueueMaxLength(e){for(this._frameQueueMaxLength=e;this._frameQueue&&this._frameQueue.length>this._frameQueueMaxLength;)this._frameQueue.shift()}get frameQueueMaxLength(){return this._frameQueueMaxLength}get frameQueue(){return JSON.parse(JSON.stringify(this._frameQueue))}set bufferRefreshInterval(e){this._bufferRefreshInterval=e}get bufferRefreshInterval(){return this._bufferRefreshInterval}isContextDestroyed(){return this.bDestroyed}static createInstance(e){return l(this,void 0,void 0,(function*(){if(_)throw new Error("`CameraEnhancer` is not supported in Node.js.");let t=new c;("string"==typeof e||e instanceof String)&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(this.defaultUIElementURL),this._hasEngineResourceLoaded=!0,document.addEventListener("visibilitychange",t._ev_documentHideEvent),t}))}play(e,t,i){return l(this,void 0,void 0,(function*(){if(this._assertOpen(),this._video&&this.videoSrc){yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),"string"==typeof this.videoSrc||this.videoSrc instanceof String?this._video.src=this.videoSrc:this._video.srcObject=this.videoSrc,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}));let e={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(e)}),0),e}if(this.singleFrameMode)return this._clickIptSingleFrameMode(),{width:0,height:0};const s=++this.iPlayRound;return this.promisePlay&&(yield this.promisePlay,sl(this,void 0,void 0,(function*(){var s;try{this._video&&this._video.srcObject&&this.stop(),c._onLog&&c._onLog("DCE: ======before video========"),yield this.getAllCameras();let n=()=>{if(this.bDestroyed)throw d&&d.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null,new Error("The CameraEnhancer instance has been destroyed.")};const r=JSON.parse(JSON.stringify(this.videoSettings));let o;"boolean"==typeof r.video&&(r.video={}),t&&(r.video.width={ideal:t}),i&&(r.video.height={ideal:i});const a=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];let d,_=()=>{for(let e of this._allCameras){let t=e.label.toLowerCase();if(t&&a.some((e=>-1!=t.indexOf(e)))&&/\b0(\b)?/.test(t)){delete r.video.facingMode,r.video.deviceId={ideal:e.deviceId};break}}r.video.deviceId||-1==["Android","HarmonyOS"].indexOf(c.browserInfo.OS)||(delete r.video.facingMode,r.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})};if(e)delete r.video.facingMode,r.video.deviceId={exact:e},this._lastDeviceId=e;else if(r.video.deviceId);else if(this._lastDeviceId)delete r.video.facingMode,r.video.deviceId={exact:this._lastDeviceId};else if(r.video.facingMode){let e=r.video.facingMode;e instanceof Array&&e.length&&(e=e[0]),e=e.exact||e.ideal||e,"environment"===e&&(o=!!r.video.facingMode,_())}c._onLog&&c._onLog("DCE: ======try getUserMedia========");let h,u=[0,500],g=null,R=null,f=e=>l(this,void 0,void 0,(function*(){for(let t of u){n(),t&&(yield new Promise((e=>setTimeout(e,t)))),n();{const t=e.video.deviceId;R=t?t.exact||t.ideal||t:null}try{c._onLog&&c._onLog("DCE: ask "+JSON.stringify(e)),d=yield navigator.mediaDevices.getUserMedia(e);break}catch(e){g=e,c._onLog&&c._onLog("DCE: "+e.message||e)}}}));if(yield f(r),d||(c._onLog&&c._onLog("DCE: ======try getUserMedia again========"),h=JSON.parse(JSON.stringify(r)),"object"==typeof h.video&&("iPhone"==c.browserInfo.OS?(t>=1280||i>=1280?h.video.width=1280:t>=640||i>=640?h.video.width=640:(t<640||i<640)&&(h.video.width=320),delete h.video.height):o&&!r.video.deviceId?(delete h.video.facingMode,this._allCameras.length&&(h.video.deviceId={ideal:this._allCameras[this._allCameras.length-1].deviceId})):h.video=!0),c._onLog&&c._onLog("DCE: "+h),yield f(h)),d||(u=[1e3,2e3],yield f(r)),d||(yield f(h)),!d)throw g;const E=()=>{const e=d.getVideoTracks();let t,i;if(e.length&&(t=this._videoTrack=e[0]),this._video&&t){if(t.label)for(let e of this._allCameras)if(t.label==e.label){e._checked=!0,i=e,this._lastDeviceId=e.deviceId;break}if(!i&&R)for(let e of this._allCameras)if(R==e.deviceId){t.label&&(e._checked=!0,e.label=t.label),i=e,this._lastDeviceId=e.deviceId;break}}this._currentCamera=i};if(yield this.getAllCameras(),n(),o){E(),_();let e=r.video.deviceId;e&&(e=e.exact||e.ideal||e);let t=null===(s=this._currentCamera)||void 0===s?void 0:s.deviceId;!e||t&&e==t||(d.getTracks().forEach((e=>{e.stop()})),u=[0,500,1e3,2e3],yield f(r))}n();const m=()=>l(this,void 0,void 0,(function*(){c._onLog&&c._onLog("======play video========"),yield new Promise(((e,t)=>{this._video.onloadedmetadata=()=>l(this,void 0,void 0,(function*(){this._video.onloadedmetadata=null,yield this._video.play(),e()})),this._video.srcObject=d,setTimeout((()=>t(new Error("Failed to play video. Timeout."))),4e3)}))}));yield m(),c._onLog&&c._onLog("DCE: ======played video========"),this._bgLoading&&(this._bgLoading.style.animationPlayState="paused");const I="got "+this._video.videoWidth+"x"+this._video.videoHeight;this._optGotRsl&&(this._optGotRsl.setAttribute("data-width",this._video.videoWidth),this._optGotRsl.setAttribute("data-height",this._video.videoHeight),this._optGotRsl.innerText=I,this._selRsl&&this._optGotRsl.parentNode==this._selRsl&&(this._selRsl.value="got")),c._onLog&&c._onLog("DCE: "+I),E(),n(),this._renderSelCameraInfo();let v={width:this._video.videoWidth,height:this._video.videoHeight};return this.onPlayed&&setTimeout((()=>{this.onPlayed(v)}),0),this.promisePlay=null,v}catch(e){throw this.promisePlay=null,e}})))(),yield this.promisePlay)}))}resume(){return l(this,void 0,void 0,(function*(){yield this.play(),this._bStoppedByPause&&(this._bStoppedByPause=!1,this.startFetchingLoop())}))}pause(){this._video&&this._video.pause(),this._bFetchingLoopStarted&&(this.stopFetchingLoop(),this._bStoppedByPause=!0)}close(){return l(this,void 0,void 0,(function*(){this.stop(),this._unbindUI(),this.UIElement.style.display="none",this.stopFetchingLoop()}))}open(){return l(this,void 0,void 0,(function*(){return this._bindUI(),this.UIElement.parentNode||(this.UIElement.style.position="fixed",this.UIElement.style.left="0",this.UIElement.style.top="0",document.body.append(this.UIElement)),"none"==this.UIElement.style.display&&(this.UIElement.style.display=""),yield this.play()}))}stop(){this._video&&this._video.srcObject&&(c._onLog&&c._onLog("DCE: ======stop video========"),this._video.srcObject.getTracks().forEach((e=>{e.stop()})),this._video.srcObject=null,this._videoTrack=null,this._currentCamera=null),this._video&&this._video.classList.contains("dce-existingVideo")&&(c._onLog&&c._onLog("DCE: ======stop existing video========"),this._video.pause(),this._video.currentTime=0),this._bgLoading&&(this._bgLoading.style.animationPlayState=""),this._frameQueue.length=0}getAllCameras(){return l(this,void 0,void 0,(function*(){const e=yield navigator.mediaDevices.enumerateDevices(),t=[],i=[];if(this._allCameras)for(let e of this._allCameras)e._checked&&i.push(e);for(let s=0;st.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{colorTemperature:e}]})}))}setExposureCompensation(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().exposureCompensation;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{exposureCompensation:e}]})}))}setZoom(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().zoom;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({advanced:[{zoom:e}]})}))}setFrameRate(e){return l(this,void 0,void 0,(function*(){this._assertOpen();let t=this.getCapabilities().frameRate;if(!t)throw Error("Not supported.");return et.max&&(e=t.max),yield this._videoTrack.applyConstraints({width:{ideal:Math.max(this._video.videoWidth,this._video.videoHeight)},frameRate:e})}))}getFrameRate(){return this.getCameraSettings().frameRate}getFrame(e){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");this._assertOpen(),c._onLog&&c._onLog("DCE: getFrame(region?)");const t=Date.now(),i=this._video.videoWidth,s=this._video.videoHeight,n=Math.max(i,s);let r,o;if(n>this._canvasMaxWH){let e=this._canvasMaxWH/n;r=Math.round(i*e),o=Math.round(s*e)}else r=i,o=s;let a=0,d=0,l=i,_=s,h=i,u=s;if(e){let t,n,c,g;e.regionMeasuredByPercentage?(t=e.regionLeft*r/100,n=e.regionTop*o/100,c=e.regionRight*r/100,g=e.regionBottom*o/100):(t=e.regionLeft,n=e.regionTop,c=e.regionRight,g=e.regionBottom),h=c-t,l=Math.round(h/r*i),u=g-n,_=Math.round(u/o*s),a=Math.round(t/r*i),d=Math.round(n/o*s)}let g=0==a&&0==d&&i==l&&s==_&&i==h&&s==u;if(!this.bSaveOriCanvas&&g){this.videoGlCvs||(this.videoGlCvs=globalThis.OffscreenCanvas?new OffscreenCanvas(h,u):document.createElement("canvas"));const e=this.videoGlCvs;e.width==h&&e.height==u||(e.height=u,e.width=h,this.videoGl&&this.videoGl.viewport(0,0,h,u));const i=this.videoGl||e.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0})||e.getContext("experimental-webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!0});if(!this.videoGl){this.videoGl=i;const e=i.createShader(i.VERTEX_SHADER);i.shaderSource(e,"\nattribute vec4 a_position;\nattribute vec2 a_uv;\n\nvarying vec2 v_uv;\n\nvoid main() {\n gl_Position = a_position;\n v_uv = a_uv;\n}\n"),i.compileShader(e),i.getShaderParameter(e,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(e));const t=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(t,"\nprecision lowp float;\n\nvarying vec2 v_uv;\n\nuniform sampler2D u_texture;\n\nvoid main() {\n vec4 sample = texture2D(u_texture, v_uv);\n float grey = 0.299 * sample.r + 0.587 * sample.g + 0.114 * sample.b;\n gl_FragColor = vec4(grey, 0.0, 0.0, 1.0);\n}\n"),i.compileShader(t),i.getShaderParameter(t,i.COMPILE_STATUS)||console.error("An error occurred compiling the shaders: "+i.getShaderInfoLog(t));const s=i.createProgram();i.attachShader(s,e),i.attachShader(s,t),i.linkProgram(s),i.getProgramParameter(s,i.LINK_STATUS)||console.error("Unable to initialize the shader program: "+i.getProgramInfoLog(s)),i.useProgram(s),i.bindBuffer(i.ARRAY_BUFFER,i.createBuffer()),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,1,0,1,1,1,1,1,-1,-1,0,0,1,-1,1,0]),i.STATIC_DRAW);const n=i.getAttribLocation(s,"a_position");i.enableVertexAttribArray(n),i.vertexAttribPointer(n,2,i.FLOAT,!1,16,0);const r=i.getAttribLocation(s,"a_uv");i.enableVertexAttribArray(r),i.vertexAttribPointer(r,2,i.FLOAT,!1,16,8),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,i.createTexture()),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.uniform1i(i.getUniformLocation(s,"u_texture"),0)}(!this.glImgData||this.glImgData.length=this.maxVideoCvsLength&&(this.videoCvses=this.videoCvses.slice(1)),this.videoCvses.push(i))}const s=i.dbrCtx2d;g?s.drawImage(this._video,0,0):s.drawImage(this._video,a,d,l,_,0,0,h,u);let n=i.dbrCtx2d||i.getContext("2d");if(0===i.width||0===i.height)return null;let r=n.getImageData(0,0,i.width,i.height).data;const o=Date.now();return{data:r,canvas:i,region:e,sx:a,sy:d,width:l,height:_,timeSpent:o-t,timeStamp:o}}}getCurrentRegion(){let e;if(this._region)if(this._region instanceof Array){if(this.bChangeRegionIndexManually){if(this._regionIndex>=this._region.length)throw new Error("the 'regionIndex' should be less than the length of region array.")}else++this._regionIndex>=this._region.length&&(this._regionIndex=0);e=this._region[this._regionIndex]}else e=this._region;else e=null;return e}_fetchingLoop(e){if(this.bDestroyed)return void this.stopFetchingLoop();if(!this._isOpen||!this.isFetchingLoopStarted())return void this.stopFetchingLoop();if(this._video.paused)return c._onLog&&c._onLog("DCE: Video is paused. Ask in 1s."),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),void(this._frameLoopTimeoutId=setTimeout((()=>{this._fetchingLoop(!0)}),1e3));const t=()=>{c._onLog&&c._onLog("DCE: start fetching a frame: "+Date.now());let e=this.getCurrentRegion(),t=this.getFrame(e);this._frameQueue&&this._frameQueue.length>=this._frameQueueMaxLength&&this._frameQueue.shift(),this._frameQueue.push(t),c._onLog&&c._onLog("DCE: finish fetching a frame: "+Date.now())},i=()=>{this._frameLoopTimeoutId2&&clearTimeout(this._frameLoopTimeoutId2),this._bufferRefreshInterval<=0||(this._frameLoopTimeoutId2=setTimeout((()=>{this.bDestroyed?this.stopFetchingLoop():this._isOpen&&this.isFetchingLoopStarted()?this._video.paused?this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId):(c._onLog&&c._onLog("DCE: second timeout executes: "+Date.now()),t(),i()):this.stopFetchingLoop()}),this._bufferRefreshInterval))};e&&(this._frameQueue.length{this._fetchingLoop(!0)}),this._loopInterval)}startFetchingLoop(){if(this.bDestroyed)throw Error("The DCE instance has been destroyed.");if(this._assertOpen(),this._video.paused)throw Error("The video is paused.");this.isFetchingLoopStarted()||(this._bFetchingLoopStarted=!0,c._onLog&&c._onLog("start fetching loop: "+Date.now()),this._fetchingLoop(!0))}isFetchingLoopStarted(){return this._bFetchingLoopStarted}stopFetchingLoop(){this._bFetchingLoopStarted&&(c._onLog&&c._onLog("stop fetching loop: "+Date.now()),this._frameLoopTimeoutId&&clearTimeout(this._frameLoopTimeoutId),this._frameQueue.length=0,this._bFetchingLoopStarted=!1)}getFrameFromBuffer(e){return this._frameQueue&&this._frameQueue.length?e?e{if(_){const e=import.meta.url;return new Promise((t=>l(void 0,void 0,void 0,(function*(){const i=yield import("url");"string"!=typeof c._engineResourcePath&&(c._engineResourcePath=i.fileURLToPath(e.substring(0,e.lastIndexOf("/")+1))),t()}))))}if(!h&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),c._defaultUIElementURL="@engineResourcePath/dce.ui.html";class u{static get browserInfo(){return c.browserInfo}static getVersion(){return c.getVersion()}static detectEnvironment(){return c.detectEnvironment()}static get engineResourcePath(){return c.engineResourcePath}static set engineResourcePath(e){c.engineResourcePath=e}static get _onLog(){return c._onLog}static set _onLog(e){c._onLog=e}}u.CameraEnhancer=c;const g=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class R extends d{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=R._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",d.engineResourcePath)}static set defaultUIElementURL(e){R._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(t){return e(this,void 0,void 0,(function*(){yield this.dce.setUIElement(t)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(t){this.dce.singleFrameMode=t,t&&(()=>{e(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return e(this,void 0,void 0,(function*(){this.dce||(d._onLog&&d._onLog("createDCEInstance()"),c.defaultUIElementURL=null,this.dce=yield c.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=t=>e(this,void 0,void 0,(function*(){let e=yield this.decode(t);yield this.clearMapDecodeRecord();for(let t of e)delete t.bUnduplicated;if(this._drawRegionsults(e),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(e),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let t of e)this.onUniqueRead(t.barcodeText,t)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(t){return e(this,void 0,void 0,(function*(){if(g)throw new Error("`BarcodeScanner` is not supported in Node.js.");let e=new R;yield e.createDCEInstance(),e._instanceID=yield R.createInstanceInWorker(!0),"string"==typeof t&&(t=JSON.parse(t));for(let i in t)e[i]=t[i];return yield e.setUIElement(R.defaultUIElementURL),e.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),e.singleFrameMode||(yield e.updateRuntimeSettings("single")),e}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,s,n,r){return super.decodeBuffer(e,t,i,s,n,r)}decodeCurrentFrame(i){return e(this,void 0,void 0,(function*(){this._assertOpen();let e=null;i&&i.region&&(e=i.region);let s=this.dce.getFrame(e);if(s&&null===s.canvas){let{data:e,width:i,height:n}=s;return yield this._decodeBuffer_Uint8Array(e,i,n,i,t.IPF_GrayScaled)}if(s&&s.canvas){let{data:e,canvas:i,region:n,sx:r,sy:o,sWidth:a,sHeight:l}=s;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let _=yield this._decodeBuffer_Uint8Array(e,i.width,i.height,4*i.width,t.IPF_ABGR_8888);return d.fixResultLocationWhenFilterRegionInJs(n,_,r,o,a,l,i.width,i.height),_}}))}clearMapDecodeRecord(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),d._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(R.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(t){return e(this,void 0,void 0,(function*(){let e;if("string"==typeof t)if("speed"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region)}else if("balance"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=3,e.expectedBarcodesCount=512,e.localizationModes=[2,16,0,0,0,0,0,0],e.timeout=1e5}else if("coverage"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionSinglePreset(t.region)||(e.region=t.region),e.deblurLevel=5,e.expectedBarcodesCount=512,e.scaleDownThreshold=1e5,e.localizationModes=[2,16,4,8,0,0,0,0],e.timeout=1e5}else if("single"==t){let t=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),e=yield this.getRuntimeSettings(),e.barcodeFormatIds=t.barcodeFormatIds,e.barcodeFormatIds_2=t.barcodeFormatIds_2,R.isRegionNormalPreset(t.region)?e.region=JSON.parse(JSON.stringify(R.singlePresetRegion)):e.region=t.region,e.expectedBarcodesCount=1,e.localizationModes=[16,2,0,0,0,0,0,0],e.barcodeZoneMinDistanceToImageBorders=0}else e=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(e=JSON.parse(JSON.stringify(t)),e.region instanceof Array){let i=t.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(e.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!d._bUseFullFeature){if(0!=(e.barcodeFormatIds&~(n.BF_ONED|n.BF_QR_CODE|n.BF_PDF417|n.BF_DATAMATRIX))||0!=e.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=e.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let t=e.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(t)):this.userDefinedRegion=null,t instanceof Array)if(t.length){for(let e=0;e{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(e=>{if(e.success){try{this._handleRetJsonString(e.updateReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),d._dbrWorker.postMessage({type:"updateRuntimeSettings",id:s,instanceID:this._instanceID,body:{settings:JSON.stringify(e)}})})),"single"==t&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");let t=[e];for(let e=0;e','','',''].join(""),this.dce._optGotRsl=this.dce._optGotRsl||this.dce._selRsl.options[0])):this.dce._optGotRsl||!e.classList.contains("dce-opt-gotResolution")&&!e.classList.contains("dbrScanner-opt-gotResolution")?this.dce._btnClose||!e.classList.contains("dce-btn-close")&&!e.classList.contains("dbrScanner-btn-close")?this.dce._video||!e.classList.contains("dce-existingVideo")&&!e.classList.contains("dbrScanner-existingVideo")||(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"),this.dce.singleFrameMode=!1):this.dce._btnClose=e:this.dce._optGotRsl=e:this.dce._selCam=e:this.dce._bgCamera=e:this.dce._bgLoading=e:(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"));if(this.dce._bindUI(),this._selCam=this.dce._selCam,this._selRsl=this.dce._selRsl,this._btnClose=this.dce._btnClose,this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.addEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="pointer",this._cvsDrawArea.setAttribute("title","Take a photo")),this._divScanArea&&(this._divScanArea.addEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="pointer",this._divScanArea.setAttribute("title","Take a photo"))),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this.dce.video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dbrScanner-video`.")}_unbindUI(){this._clearRegionsults(),this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.removeEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="",this._cvsDrawArea.removeAttribute("title")),this._divScanArea&&(this._divScanArea.removeEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="",this._divScanArea.removeAttribute("title"))),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this.dce._unbindUI(),this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null}set onPlayed(e){this.dce.onPlayed=e}get onPlayed(){return this.dce.onPlayed}get onUnduplicatedRead(){return this.onUniqueRead}set onUnduplicatedRead(e){this.onUniqueRead=e}getAllCameras(){return e(this,void 0,void 0,(function*(){return this.dce.getAllCameras()}))}getCurrentCamera(){return e(this,void 0,void 0,(function*(){return this.dce.getSelectedCamera()}))}setCurrentCamera(t){return e(this,void 0,void 0,(function*(){return this.dce.selectCamera(t)}))}getResolution(){return this.dce.getResolution()}setResolution(t,i){return e(this,void 0,void 0,(function*(){return this.dce.setResolution(t,i)}))}getScanSettings(){return e(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=d._nextTaskID++;d._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),d._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(t){return e(this,void 0,void 0,(function*(){return this.intervalTime=t.intervalTime,yield new Promise(((e,i)=>{let s=d._nextTaskID++;d._taskCallbackMap.set(s,(t=>{if(t.success)return e();{let e=new Error(t.message);return e.stack+="\n"+t.stack,i(e)}})),R._dbrWorker.postMessage({type:"updateScanSettings",id:s,instanceID:this._instanceID,body:{settings:t}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(t,i,s){return e(this,void 0,void 0,(function*(){return this.dce.play(t,i,s)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(t){return e(this,void 0,void 0,(function*(){return this.dce.applyConstraints(t)}))}turnOnTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return e(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(t){return e(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(t)}))}setExposureCompensation(t){return e(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(t)}))}setZoom(t){return e(this,void 0,void 0,(function*(){return this.dce.setZoom(t)}))}setFrameRate(t){return e(this,void 0,void 0,(function*(){return this.dce.setFrameRate(t)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return e(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return d._onLog&&d._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),d._onLog&&d._onLog("======= once read ======="),d._onLog&&(this._timeStartDecode=Date.now());let i=this._getVideoFrame();if(!i)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>e(this,void 0,void 0,(function*(){if(i&&null===i.canvas){let{data:e,width:s,height:n,timeStamp:r}=i,o={timeStamp:r};return yield this._decodeBuffer_Uint8Array(e,s,n,s,t.IPF_GrayScaled,o)}if(i&&i.canvas){let{data:e,canvas:s,region:n,sx:r,sy:o,width:a,height:l,timeStamp:_}=i,h={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=s);let c=yield this._decodeBuffer_Uint8Array(e,s.width,s.height,4*s.width,t.IPF_ABGR_8888,h);return d.fixResultLocationWhenFilterRegionInJs(n,c,r,o,s.width,s.height,a,l),c}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{d._onLog&&d._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,s=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[s]&&t[s]instanceof Array||(t[s]=[]);t[s].length>=5;)t[s].shift();t[s].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let n=0,r=0;n=s+1>=this.region.length?0:s+1,r=n+1>=this.region.length?0:n+1,e=t[n]&&t[n].length&&i[r]&&i[r].length?Math.min(...t[n])-Math.max(...i[r]):0}else if(i&&i.length){let s=Math.min(...t),n=Math.max(...i);s&&n&&(e=s-n)}else e=0;return e>0?e:0})()+this.intervalTime,this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),d._onLog&&d._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,s;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,s=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,s=this.dce.video.videoHeight}let n=this.region;if(n&&(!n.regionLeft&&!n.regionRight&&!n.regionTop&&!n.regionBottom&&!n.regionMeasuredByPercentage||n instanceof Array?n=null:n.regionMeasuredByPercentage?n=n.regionLeft||n.regionRight||100!==n.regionTop||100!==n.regionBottom?{regionLeft:Math.round(n.regionLeft/100*i),regionTop:Math.round(n.regionTop/100*s),regionRight:Math.round(n.regionRight/100*i),regionBottom:Math.round(n.regionBottom/100*s)}:null:(n=JSON.parse(JSON.stringify(n)),delete n.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let r=this._cvsDrawArea;r.width=i,r.height=s;let o=r.getContext("2d");if(n){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,r.width,r.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(n.regionLeft-e,n.regionTop-e,n.regionRight-n.regionLeft+2*e,n.regionBottom-n.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(n.regionLeft,n.regionTop,n.regionRight-n.regionLeft,n.regionBottom-n.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,r=1;e/tsuper.destroyContext}});return e(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield t.destroyContext.call(this))}))}}var f,E,m,I,v,A,S,p,T,D,C,y,L,M,b,O,N,B,P,F,w,U,V,k,x,G,W;R._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",R.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(f||(f={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(E||(E={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(m||(m={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(I||(I={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(v||(v={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(A||(A={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(S||(S={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(p||(p={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(T||(T={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(D||(D={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(C||(C={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(y||(y={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(L||(L={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(M||(M={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(b||(b={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(O||(O={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(N||(N={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(B||(B={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(P||(P={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(F||(F={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(w||(w={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(U||(U={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(V||(V={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(k||(k={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(x||(x={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(G||(G={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(W||(W={}));class H{static get version(){return d.version}static get productKeys(){return d.productKeys}static set productKeys(e){d.productKeys=e}static get handshakeCode(){return d.handshakeCode}static set handshakeCode(e){d.handshakeCode=e}static get organizationID(){return d.organizationID}static set organizationID(e){d.organizationID=e}static get sessionPassword(){return d.sessionPassword}static set sessionPassword(e){d.sessionPassword=e}static get browserInfo(){return d.browserInfo}static detectEnvironment(){return d.detectEnvironment()}static get _workerName(){return d._workerName}static set _workerName(e){d._workerName=e}static get engineResourcePath(){return d.engineResourcePath}static set engineResourcePath(e){d.engineResourcePath=e}static get licenseServer(){return d.licenseServer}static set licenseServer(e){d.licenseServer=e}static get deviceFriendlyName(){return d.deviceFriendlyName}static set deviceFriendlyName(e){d.deviceFriendlyName=e}static get _onLog(){return d._onLog}static set _onLog(e){d._onLog=e}static get _bWasmDebug(){return d._bWasmDebug}static set _bWasmDebug(e){d._bWasmDebug=e}static get _bUseFullFeature(){return d._bUseFullFeature}static set _bUseFullFeature(e){d._bUseFullFeature=e}static get _dbrWorker(){return d._dbrWorker}static isLoaded(){return d.isLoaded()}static isWasmLoaded(){return d.isLoaded()}static loadWasm(){return d.loadWasm()}}H.DBR=H,H.BarcodeReader=d,H.BarcodeScanner=R,H.CameraEnhancer=u,H.EnumBarcodeColourMode=f,H.EnumBarcodeComplementMode=E,H.EnumBarcodeFormat=n,H.EnumBarcodeFormat_2=m,H.EnumBinarizationMode=I,H.EnumClarityCalculationMethod=v,H.EnumClarityFilterMode=A,H.EnumColourClusteringMode=S,H.EnumColourConversionMode=p,H.EnumConflictMode=T,H.EnumDeblurMode=D,H.EnumDeformationResistingMode=C,H.EnumDPMCodeReadingMode=y,H.EnumErrorCode=i,H.EnumGrayscaleTransformationMode=L,H.EnumImagePixelFormat=t,H.EnumImagePreprocessingMode=M,H.EnumIMResultDataType=s,H.EnumIntermediateResultSavingMode=b,H.EnumIntermediateResultType=O,H.EnumLocalizationMode=N,H.EnumPDFReadingMode=B,H.EnumQRCodeErrorCorrectionLevel=P,H.EnumRegionPredetectionMode=F,H.EnumResultCoordinateType=w,H.EnumResultType=U,H.EnumScaleUpMode=V,H.EnumTerminatePhase=k,H.EnumTextFilterMode=x,H.EnumTextResultOrderMode=G,H.EnumTextureDetectionMode=W;export{d as BarcodeReader,R as BarcodeScanner,u as CameraEnhancer,H as DBR,f as EnumBarcodeColourMode,E as EnumBarcodeComplementMode,n as EnumBarcodeFormat,m as EnumBarcodeFormat_2,I as EnumBinarizationMode,v as EnumClarityCalculationMethod,A as EnumClarityFilterMode,S as EnumColourClusteringMode,p as EnumColourConversionMode,T as EnumConflictMode,y as EnumDPMCodeReadingMode,D as EnumDeblurMode,C as EnumDeformationResistingMode,i as EnumErrorCode,L as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,t as EnumImagePixelFormat,M as EnumImagePreprocessingMode,b as EnumIntermediateResultSavingMode,O as EnumIntermediateResultType,N as EnumLocalizationMode,B as EnumPDFReadingMode,P as EnumQRCodeErrorCorrectionLevel,F as EnumRegionPredetectionMode,w as EnumResultCoordinateType,U as EnumResultType,V as EnumScaleUpMode,k as EnumTerminatePhase,x as EnumTextFilterMode,G as EnumTextResultOrderMode,W as EnumTextureDetectionMode,H as default}; diff --git a/dist/dbr.pure.js b/dist/dbr.pure.js index f31edc4..5228a4c 100644 --- a/dist/dbr.pure.js +++ b/dist/dbr.pure.js @@ -2,10 +2,10 @@ * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition * @website http://www.dynamsoft.com - * @copyright Copyright 2021, Dynamsoft Corporation + * @copyright Copyright 2022, Dynamsoft Corporation * @author Dynamsoft - * @version 8.8.3 (js 20211011) + * @version 8.8.7 (js 20220125) * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dynamsoft-camera-enhancer")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-camera-enhancer"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.DBR={}),e.Dynamsoft.DCE)}(this,(function(e,t){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,n,o,s,a=i(t);function d(e,t,i,r){return new(i||(i=Promise))((function(n,o){function s(e){try{d(r.next(e))}catch(e){o(e)}}function a(e){try{d(r.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}d((r=r.apply(e,t||[])).next())}))}e.EnumImagePixelFormat=void 0,(r=e.EnumImagePixelFormat||(e.EnumImagePixelFormat={}))[r.IPF_Binary=0]="IPF_Binary",r[r.IPF_BinaryInverted=1]="IPF_BinaryInverted",r[r.IPF_GrayScaled=2]="IPF_GrayScaled",r[r.IPF_NV21=3]="IPF_NV21",r[r.IPF_RGB_565=4]="IPF_RGB_565",r[r.IPF_RGB_555=5]="IPF_RGB_555",r[r.IPF_RGB_888=6]="IPF_RGB_888",r[r.IPF_ARGB_8888=7]="IPF_ARGB_8888",r[r.IPF_RGB_161616=8]="IPF_RGB_161616",r[r.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",r[r.IPF_ABGR_8888=10]="IPF_ABGR_8888",r[r.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",r[r.IPF_BGR_888=12]="IPF_BGR_888",e.EnumErrorCode=void 0,(n=e.EnumErrorCode||(e.EnumErrorCode={}))[n.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",n[n.DBR_SUCCESS=0]="DBR_SUCCESS",n[n.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",n[n.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",n[n.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",n[n.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",n[n.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",n[n.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",n[n.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",n[n.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",n[n.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",n[n.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",n[n.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",n[n.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",n[n.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",n[n.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",n[n.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",n[n.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",n[n.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",n[n.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",n[n.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",n[n.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",n[n.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",n[n.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",n[n.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",n[n.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",n[n.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",n[n.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",n[n.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",n[n.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",n[n.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",n[n.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",n[n.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",n[n.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",n[n.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",n[n.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",n[n.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",n[n.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",n[n.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",n[n.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",n[n.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",n[n.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",n[n.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",n[n.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",n[n.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",n[n.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",n[n.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",n[n.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",n[n.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",n[n.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",n[n.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",n[n.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",n[n.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",n[n.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",n[n.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",n[n.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",n[n.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",n[n.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",n[n.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",n[n.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",n[n.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",n[n.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS",e.EnumIMResultDataType=void 0,(o=e.EnumIMResultDataType||(e.EnumIMResultDataType={}))[o.IMRDT_IMAGE=1]="IMRDT_IMAGE",o[o.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",o[o.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",o[o.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",o[o.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",o[o.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL",e.EnumBarcodeFormat=void 0,(s=e.EnumBarcodeFormat||(e.EnumBarcodeFormat={}))[s.BF_ALL=-31457281]="BF_ALL",s[s.BF_ONED=1050623]="BF_ONED",s[s.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",s[s.BF_CODE_39=1]="BF_CODE_39",s[s.BF_CODE_128=2]="BF_CODE_128",s[s.BF_CODE_93=4]="BF_CODE_93",s[s.BF_CODABAR=8]="BF_CODABAR",s[s.BF_ITF=16]="BF_ITF",s[s.BF_EAN_13=32]="BF_EAN_13",s[s.BF_EAN_8=64]="BF_EAN_8",s[s.BF_UPC_A=128]="BF_UPC_A",s[s.BF_UPC_E=256]="BF_UPC_E",s[s.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",s[s.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",s[s.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",s[s.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",s[s.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",s[s.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",s[s.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",s[s.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",s[s.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",s[s.BF_PATCHCODE=262144]="BF_PATCHCODE",s[s.BF_PDF417=33554432]="BF_PDF417",s[s.BF_QR_CODE=67108864]="BF_QR_CODE",s[s.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",s[s.BF_AZTEC=268435456]="BF_AZTEC",s[s.BF_MAXICODE=536870912]="BF_MAXICODE",s[s.BF_MICRO_QR=1073741824]="BF_MICRO_QR",s[s.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",s[s.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",s[s.BF_MSI_CODE=1048576]="BF_MSI_CODE",s[s.BF_NULL=0]="BF_NULL";const _=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),l=!_&&"undefined"==typeof self,c=_?global:l?{}:self;class u{constructor(){this._canvasMaxWH="iPhone"==u.browserInfo.OS||"Android"==u.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");u._license=e}static get productKeys(){return this._license}static set productKeys(e){u.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){u.license=e}static get organizationID(){return this._license}static set organizationID(e){u.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");u._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return d(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(_?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),_||l)u._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,u._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(u._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)u._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let t,i=u._license,r=JSON.parse(JSON.stringify(u._licenseServer)),n=u._sessionPassword,o=null,s=null,a=0;if(i.startsWith("t")||i.startsWith("f"))a=0;else if(0===i.length||i.startsWith("P")||i.startsWith("L"))a=1;else{a=2;const e=i.indexOf(":");if(-1!=e&&(i=i.substring(e+1)),i.startsWith("DLS2")){let e=i.substring(4);e=_?Buffer.from(e,"base64").toString("binary"):atob(e);const t=JSON.parse(e);if(t.handshakeCode?i=t.handshakeCode:t.organizationID&&(i=t.organizationID),"number"==typeof i&&(i=JSON.stringify(i)),i||(i=""),0===r.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),u.licenseServer=e,r=u.licenseServer,u.licenseServer=null}!n&&t.sessionPassword&&(n=t.sessionPassword),t.chargeWay&&(s=t.chargeWay),t.limitedLicenseModules&&(o=t.limitedLicenseModules)}}if(a&&(_?process.version<"v15"&&(t="To use online key requires nodejs version >= v15."):(c.crypto||(t="Please upgrade your browser to support online key."),c.crypto.subtle||(t="Require https to use online key in this browser."))),t){if(1!==a)throw new Error(t);a=0,console.warn(t),u._lastErrorCode=e.EnumErrorCode.DMERR_FAILED_TO_REACH_LTS,u._lastErrorString=t}return 1===a&&(i="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((e,t)=>d(this,void 0,void 0,(function*(){switch(u._loadWasmStatus){case"unload":{u._loadWasmStatus="loading";let e=u.engineResourcePath+u._workerName;if(_||u.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),_){const t=yield import("worker_threads");u._dbrWorker=new t.Worker(e)}else u._dbrWorker=new Worker(e);u._dbrWorker.onerror=e=>{u._loadWasmStatus="loadFail";let t=new Error(e.message);u._loadWasmErr=t;for(let e of u._loadWasmCallbackArr)e(t);u._loadWasmCallbackArr=[]},u._dbrWorker.onmessage=e=>d(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":u._onLog&&u._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===a&&(e=!0),t.success){u._loadWasmStatus="loadSuccess",u._version=t.version+"(JS "+u._jsVersion+"."+u._jsEditVersion+")",u._onLog&&u._onLog("load dbr worker success");for(let e of u._loadWasmCallbackArr)e();u._loadWasmCallbackArr=[],u._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,u._loadWasmStatus="loadFail",u._loadWasmErr=i;for(let e of u._loadWasmCallbackArr)e(i);u._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&u.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{u._taskCallbackMap.get(e)(i),u._taskCallbackMap.delete(e)}catch(t){throw u._taskCallbackMap.delete(e),t}break}default:u._onLog&&u._onLog(e)}})),_&&u._dbrWorker.on("message",u._dbrWorker.onmessage),u._dbrWorker.postMessage({type:"loadWasm",bd:u._bWasmDebug,engineResourcePath:u.engineResourcePath,version:u._jsVersion,brtk:!!a,bptk:1===a,lcs:i,dm:!_&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:u._bUseFullFeature,browserInfo:u.browserInfo,deviceFriendlyName:u.deviceFriendlyName,ls:r,sp:n,lm:o,cw:s})}case"loading":u._loadWasmCallbackArr.push((i=>{i?t(i):e()}));break;case"loadSuccess":e();break;case"loadFail":t(u._loadWasmErr)}}))))}))}static showDialog(e,t){return d(this,void 0,void 0,(function*(){if(!_&&!u._bNeverShowDialog)try{let i=yield fetch(u.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let r=yield i.text();if(!r.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let n=document.createElement("div");n.innerHTML=r;let o=[];for(let e=0;e{if(i==e.target){s.remove();for(let e of o)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{s.remove();for(let e of o)e.remove()}));else if(!_&&i.classList.contains("dls-license-icon-error"))_=i,"error"!=e&&i.remove();else if(!l&&i.classList.contains("dls-license-icon-warn"))l=i,"warn"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-msg-content")){c=i;let e=t;for(;e;){let t=e.indexOf("["),r=e.indexOf("]",t),n=e.indexOf("(",r),o=e.indexOf(")",n);if(-1==t||-1==r||-1==n||-1==o){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let s=document.createElement("a"),a=e.substring(t+1,r);s.innerText=a;let d=e.substring(n+1,o);s.setAttribute("href",d),s.setAttribute("target","_blank"),i.appendChild(s),e=e.substring(o+1)}}document.body.appendChild(s)}catch(e){u._onLog&&u._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return d(this,void 0,void 0,(function*(){return yield u.loadWasm(),yield new Promise(((t,i)=>{let r=u._nextTaskID++;u._taskCallbackMap.set(r,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),u._dbrWorker.postMessage({type:"createInstance",id:r,bScanner:e})}))}))}static createInstance(){return d(this,void 0,void 0,(function*(){let e=new u;return e._instanceID=yield u.createInstanceInWorker(),e}))}decode(e){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("decode(source: any)"),u._onLog&&(this._timeStartDecode=Date.now()),_)return e instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e)):e instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(e):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e):"http"==e.substring(0,4)?yield this._decode_Url(e):yield this._decode_FilePath(e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return d(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return d(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,i,r,n,o){return d(this,void 0,void 0,(function*(){return yield new Promise(((s,a)=>{let d=u._nextTaskID++;u._taskCallbackMap.set(d,(e=>{if(e.success){let t,i=u._onLog?Date.now():0;u._onLog&&u._onLog("worker return result: "+i),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(u._onLog){let e=Date.now();u._onLog("DBR time get result: "+i),u._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),u._onLog("DBR worker decode image cost: "+(i-this._timeEnterInnerDBR)),u._onLog("DBR worker handle results: "+(e-i)),u._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return s(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),u._onLog&&u._onLog("Send buffer to worker:"+Date.now()),u._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:i,stride:r,format:n,config:o}},[e.buffer]),u._onLog&&o&&o._timeEndGettingFrame&&u._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,i,r,n,o){return d(this,void 0,void 0,(function*(){u._onLog&&u._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const s=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let r=new FileReader;r.readAsArrayBuffer(e),r.onload=()=>{t(r.result)},r.onerror=()=>{i(r.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(s),t,i,r,n,o)}))}decodeBuffer(e,t,i,r,n,o){return d(this,void 0,void 0,(function*(){let s;return u._onLog&&u._onLog("decodeBuffer(buffer,width,height,stride,format)"),u._onLog&&(this._timeStartDecode=Date.now()),_?e instanceof Uint8Array?s=yield this._decodeBuffer_Uint8Array(e,t,i,r,n,o):e instanceof Buffer&&(s=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,i,r,n,o)):e instanceof Uint8Array||e instanceof Uint8ClampedArray?s=yield this._decodeBuffer_Uint8Array(e,t,i,r,n,o):e instanceof ArrayBuffer?s=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,i,r,n,o):e instanceof Blob&&(s=yield this._decodeBuffer_Blob(e,t,i,r,n,o)),s}))}_decodeFileInMemory_Uint8Array(e){return d(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let r=u._nextTaskID++;u._taskCallbackMap.set(r,(e=>{if(e.success){let r;this._lastInnerDecodeDuration=e.duration;try{r=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(r)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),u._dbrWorker.postMessage({type:"decodeFileInMemory",id:r,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(t){return d(this,void 0,void 0,(function*(){let i;if("string"==typeof t)if("speed"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,i.region=e.region,i.deblurLevel=3,i.expectedBarcodesCount=0,i.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,i.region=e.region,i.deblurLevel=5,i.expectedBarcodesCount=512,i.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,i.region=e.region}else i=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(i=JSON.parse(JSON.stringify(t)),i.region instanceof Array){let e=i.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(i.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!u._bUseFullFeature){if(0!=(i.barcodeFormatIds&~(e.EnumBarcodeFormat.BF_ONED|e.EnumBarcodeFormat.BF_QR_CODE|e.EnumBarcodeFormat.BF_PDF417|e.EnumBarcodeFormat.BF_DATAMATRIX))||0!=i.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=i.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!_)if(this.bFilterRegionInJs){let e=i.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,i.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,t)=>{let r=u._nextTaskID++;u._taskCallbackMap.set(r,(i=>{if(i.success){try{this._handleRetJsonString(i.updateReturn)}catch(e){t(e)}return e()}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"updateRuntimeSettings",id:r,instanceID:this._instanceID,body:{settings:JSON.stringify(i)}})}))}))}resetRuntimeSettings(){return d(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return d(this,void 0,void 0,(function*(){if(!u._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return d(this,void 0,void 0,(function*(){if(!u._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let r=u._nextTaskID++;u._taskCallbackMap.set(r,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),u._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:r,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return d(this,void 0,void 0,(function*(){u._onLog&&u._onLog("_decode_Blob(blob: Blob)");let i=null,r=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(r=yield function(e){return new Promise(((t,i)=>{let r=URL.createObjectURL(e),n=new Image;n.dbrObjUrl=r,n.src=r,n.onload=()=>{t(n)},n.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let n=yield this._decode_Image(i||r,t);return i&&i.close(),n}))}_decode_ArrayBuffer(e,t){return d(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return d(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return d(this,void 0,void 0,(function*(){u._onLog&&u._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,r,n=e instanceof HTMLImageElement?e.naturalWidth:e.width,o=e instanceof HTMLImageElement?e.naturalHeight:e.height,s=Math.max(n,o);if(s>this._canvasMaxWH){let e=this._canvasMaxWH/s;i=Math.round(n*e),r=Math.round(o*e)}else i=n,r=o;let a,d=0,_=0,l=n,g=o,h=i,E=r,R=t.region;if(R){let e,t,s,a;R.regionMeasuredByPercentage?(e=R.regionLeft*i/100,t=R.regionTop*r/100,s=R.regionRight*i/100,a=R.regionBottom*r/100):(e=R.regionLeft,t=R.regionTop,s=R.regionRight,a=R.regionBottom),h=s-e,l=Math.round(h/i*n),E=a-t,g=Math.round(E/r*o),d=Math.round(e/i*n),_=Math.round(t/r*o)}!this.bSaveOriCanvas&&c.OffscreenCanvas?a=new OffscreenCanvas(h,E):(a=document.createElement("canvas"),a.width=h,a.height=E);let m,I=a.getContext("2d");0==d&&0==_&&n==l&&o==g&&n==h&&o==E?I.drawImage(e,0,0):I.drawImage(e,d,_,l,g,0,0,h,E),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),R?(m=JSON.parse(JSON.stringify(t)),delete m.region):m=t;let A=yield this._decode_Canvas(a,m);return u.fixResultLocationWhenFilterRegionInJs(R,A,d,_,l,g,h,E),A}))}_decode_Canvas(t,i){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),t.crossOrigin&&"anonymous"!=t.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let r=(t.dbrCtx2d||t.getContext("2d")).getImageData(0,0,t.width,t.height).data;return yield this._decodeBuffer_Uint8Array(r,t.width,t.height,4*t.width,e.EnumImagePixelFormat.IPF_ABGR_8888,i)}))}_decode_Video(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};const i=e.videoWidth,r=e.videoHeight,n=Math.max(i,r);let o,s;if(n>this._canvasMaxWH){let e=this._canvasMaxWH/n;o=Math.round(i*e),s=Math.round(r*e)}else o=i,s=r;let a=0,d=0,_=i,l=r,g=i,h=r,E=t.region;if(E){let e,t,n,c;E.regionMeasuredByPercentage?(e=E.regionLeft*o/100,t=E.regionTop*s/100,n=E.regionRight*o/100,c=E.regionBottom*s/100):(e=E.regionLeft,t=E.regionTop,n=E.regionRight,c=E.regionBottom),g=n-e,_=Math.round(g/o*i),h=c-t,l=Math.round(h/s*r),a=Math.round(e/o*i),d=Math.round(t/s*r)}let R=0==a&&0==d&&i==_&&r==l&&i==g&&r==h,m=null;!this.bSaveOriCanvas&&c.OffscreenCanvas?m=new OffscreenCanvas(g,h):(m=document.createElement("canvas"),m.width=g,m.height=h);const I=m.dbrCtx2d=m.getContext("2d");let A;R?I.drawImage(e,0,0):I.drawImage(e,a,d,_,l,0,0,g,h),E?(A=JSON.parse(JSON.stringify(t)),delete A.region):A=t;let D=yield this._decode_Canvas(m,t);return E&&u.fixResultLocationWhenFilterRegionInJs(E,D,a,d,_,l,g,h),D}))}_decode_Base64(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1)),_){let t=Buffer.from(e,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t))}{let i=atob(e),r=i.length,n=new Uint8Array(r);for(;r--;)n[r]=i.charCodeAt(r);return yield this._decode_Blob(new Blob([n]),t)}}))}_decode_Url(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(e=e,_){let t=yield new Promise(((t,i)=>d(this,void 0,void 0,(function*(){(e.startsWith("https")?yield import("https"):yield import("http")).get(e,(e=>{if(200==e.statusCode){let i=[];e.on("data",(e=>{i.push(e)})).on("end",(()=>{t(new Uint8Array(Buffer.concat(i)))}))}else i("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(t)}{let i=yield new Promise(((t,i)=>{let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.send(),r.onloadend=()=>d(this,void 0,void 0,(function*(){t(r.response)})),r.onerror=()=>{i(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(i,t)}}))}_decode_FilePath(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_FilePath(path)"),!_)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof e)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const t=yield import("fs");let i=yield new Promise(((i,r)=>{t.readFile(e,((e,t)=>{e?r(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,r,n,o,s,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*s,t.x2*=.01*s,t.x3*=.01*s,t.x4*=.01*s,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=s/n,_=a/o;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+r,t.y2=t.y2/_+r,t.y3=t.y3/_+r,t.y4=t.y4/_+r,2==t.resultCoordinateType&&(t.x1*=100/n,t.x2*=100/n,t.x3*=100/n,t.x4*=100/n,t.y1*=100/o,t.y2*=100/o,t.y3*=100/o,t.y4*=100/o)}}static BarcodeReaderException(t,i){let r,n=e.EnumErrorCode.DBR_UNKNOWN;return"number"==typeof t?(n=t,r=new Error(i)):r=new Error(t),r.code=n,r}_handleRetJsonString(t){let i=e.EnumErrorCode;if(t.textResults){for(let e=0;e{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return t.decodeRecords?this.decodeRecords=t.decodeRecords:this.decodeRecords={},this._lastErrorCode=t.exception,this._lastErrorString=t.description,t.exception&&!u._setWarnnedEx.has(t.description)&&(u._setWarnnedEx.add(t.description),console.warn(t.description)),t.textResults}if(t.exception==i.DBR_SUCCESS)return t.data;throw u.BarcodeReaderException(t.exception,t.description)}setModeArgument(e,t,i,r){return d(this,void 0,void 0,(function*(){return yield new Promise(((n,o)=>{let s=u._nextTaskID++;u._taskCallbackMap.set(s,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return o(e)}return n()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,o(t)}})),u._dbrWorker.postMessage({type:"setModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:i,argumentValue:r}})}))}))}getModeArgument(e,t,i){return d(this,void 0,void 0,(function*(){return yield new Promise(((r,n)=>{let o=u._nextTaskID++;u._taskCallbackMap.set(o,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return n(e)}return r(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,n(t)}})),u._dbrWorker.postMessage({type:"getModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:i}})}))}))}getIntermediateResults(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return d(this,void 0,void 0,(function*(){let t=yield this.getIntermediateResults(),i=[];for(let r of t)if(r.dataType==e.EnumIMResultDataType.IMRDT_IMAGE)for(let t of r.results){const r=t.bytes;let n;switch(u._onLog&&u._onLog(" "+r.length+" "+r.byteLength+" "+t.width+" "+t.height+" "+t.stride+" "+t.format),t.format){case e.EnumImagePixelFormat.IPF_ABGR_8888:n=new Uint8ClampedArray(r);break;case e.EnumImagePixelFormat.IPF_RGB_888:{const e=r.length/3;n=new Uint8ClampedArray(4*e);for(let t=0;t{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}u._jsVersion="8.8.3",u._jsEditVersion="20211011",u._version="loading...(JS "+u._jsVersion+"."+u._jsEditVersion+")",u._license=_||l||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",u._sessionPassword=_||l||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",u.browserInfo=function(){if(!_&&!l){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{d(this,void 0,void 0,(function*(){const t=yield import("os");e.OS=t&&t.platform?t.platform()+t.release():"Unknown"}))})(),e}}(),u._workerName="dbr-"+u._jsVersion+".worker.js",u._engineResourcePath=(()=>{if(_)return __dirname+"/";if(!l&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),u._licenseServer=[],u._deviceFriendlyName="",u._isShowRelDecodeTimeInResults=!1,u._bWasmDebug=!1,u._bNeverShowDialog=!1,u.__bUseFullFeature=!0,u._nextTaskID=0,u._taskCallbackMap=new Map,u._loadWasmStatus="unload",u._loadWasmCallbackArr=[],u._lastErrorCode=0,u._lastErrorString="",u._setWarnnedEx=new Set,u._loadWasmErr=null;const g=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class h extends u{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=h._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",u.engineResourcePath)}static set defaultUIElementURL(e){h._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return d(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{d(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return d(this,void 0,void 0,(function*(){this.dce||(u._onLog&&u._onLog("createDCEInstance()"),t.CameraEnhancer.defaultUIElementURL=null,this.dce=yield t.CameraEnhancer.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>d(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return d(this,void 0,void 0,(function*(){if(g)throw new Error("`BarcodeScanner` is not supported in Node.js.");let t=new h;yield t.createDCEInstance(),t._instanceID=yield h.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(h.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,r,n,o){return super.decodeBuffer(e,t,i,r,n,o)}decodeCurrentFrame(t){return d(this,void 0,void 0,(function*(){this._assertOpen();let i=null;t&&t.region&&(i=t.region);let r=this.dce.getFrame(i);if(r&&null===r.canvas){let{data:t,width:i,height:n}=r;return yield this._decodeBuffer_Uint8Array(t,i,n,i,e.EnumImagePixelFormat.IPF_GrayScaled)}if(r&&r.canvas){let{data:t,canvas:i,region:n,sx:o,sy:s,sWidth:a,sHeight:d}=r;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let _=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,e.EnumImagePixelFormat.IPF_ABGR_8888);return u.fixResultLocationWhenFilterRegionInJs(n,_,o,s,a,d,i.width,i.height),_}}))}clearMapDecodeRecord(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(h.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(t){return d(this,void 0,void 0,(function*(){let i;if("string"==typeof t)if("speed"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionSinglePreset(e.region)||(i.region=e.region)}else if("balance"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionSinglePreset(e.region)||(i.region=e.region),i.deblurLevel=3,i.expectedBarcodesCount=512,i.localizationModes=[2,16,0,0,0,0,0,0],i.timeout=1e5}else if("coverage"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionSinglePreset(e.region)||(i.region=e.region),i.deblurLevel=5,i.expectedBarcodesCount=512,i.scaleDownThreshold=1e5,i.localizationModes=[2,16,4,8,0,0,0,0],i.timeout=1e5}else if("single"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionNormalPreset(e.region)?i.region=JSON.parse(JSON.stringify(h.singlePresetRegion)):i.region=e.region,i.expectedBarcodesCount=1,i.localizationModes=[16,2,0,0,0,0,0,0],i.barcodeZoneMinDistanceToImageBorders=0}else i=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(i=JSON.parse(JSON.stringify(t)),i.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(i.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!u._bUseFullFeature){if(0!=(i.barcodeFormatIds&~(e.EnumBarcodeFormat.BF_ONED|e.EnumBarcodeFormat.BF_QR_CODE|e.EnumBarcodeFormat.BF_PDF417|e.EnumBarcodeFormat.BF_DATAMATRIX))||0!=i.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=i.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=i.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let r=u._nextTaskID++;u._taskCallbackMap.set(r,(i=>{if(i.success){try{this._handleRetJsonString(i.updateReturn)}catch(e){t(e)}return e()}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"updateRuntimeSettings",id:r,instanceID:this._instanceID,body:{settings:JSON.stringify(i)}})})),"single"==t&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");this.dce._bindUI();let t=[e],i=e.children;for(let e of i)t.push(e);for(let e=0;e{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),u._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return d(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let r=u._nextTaskID++;u._taskCallbackMap.set(r,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),h._dbrWorker.postMessage({type:"updateScanSettings",id:r,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,i){return d(this,void 0,void 0,(function*(){return this.dce.play(e,t,i)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return d(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return d(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return d(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return d(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return d(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return d(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return d(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return d(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return u._onLog&&u._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),u._onLog&&u._onLog("======= once read ======="),u._onLog&&(this._timeStartDecode=Date.now());let t=this._getVideoFrame();if(!t)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>d(this,void 0,void 0,(function*(){if(t&&null===t.canvas){let{data:i,width:r,height:n,timeStamp:o}=t,s={timeStamp:o};return yield this._decodeBuffer_Uint8Array(i,r,n,r,e.EnumImagePixelFormat.IPF_GrayScaled,s)}if(t&&t.canvas){let{data:i,canvas:r,region:n,sx:o,sy:s,width:a,height:d,timeStamp:_}=t,l={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=r);let c=yield this._decodeBuffer_Uint8Array(i,r.width,r.height,4*r.width,e.EnumImagePixelFormat.IPF_ABGR_8888,l);return u.fixResultLocationWhenFilterRegionInJs(n,c,o,s,r.width,r.height,a,d),c}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{u._onLog&&u._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,r=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[r]&&t[r]instanceof Array||(t[r]=[]);t[r].length>=5;)t[r].shift();t[r].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let n=0,o=0;n=r+1>=this.region.length?0:r+1,o=n+1>=this.region.length?0:n+1,e=t[n]&&t[n].length&&i[o]&&i[o].length?Math.min(...t[n])-Math.max(...i[o]):0}else if(i&&i.length){let r=Math.min(...t),n=Math.max(...i);r&&n&&(e=r-n)}else e=0;return e>0?e:0})(),this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),u._onLog&&u._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,r;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,r=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,r=this.dce.video.videoHeight}let n=this.region;if(n&&(!n.regionLeft&&!n.regionRight&&!n.regionTop&&!n.regionBottom&&!n.regionMeasuredByPercentage||n instanceof Array?n=null:n.regionMeasuredByPercentage?n=n.regionLeft||n.regionRight||100!==n.regionTop||100!==n.regionBottom?{regionLeft:Math.round(n.regionLeft/100*i),regionTop:Math.round(n.regionTop/100*r),regionRight:Math.round(n.regionRight/100*i),regionBottom:Math.round(n.regionBottom/100*r)}:null:(n=JSON.parse(JSON.stringify(n)),delete n.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let o=this._cvsDrawArea;o.width=i,o.height=r;let s=o.getContext("2d");if(n){s.fillStyle=this.regionMaskFillStyle,s.fillRect(0,0,o.width,o.height),s.globalCompositeOperation="destination-out",s.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);s.fillRect(n.regionLeft-e,n.regionTop-e,n.regionRight-n.regionLeft+2*e,n.regionBottom-n.regionTop+2*e),s.globalCompositeOperation="source-over",s.strokeStyle=this.regionMaskStrokeStyle,s.lineWidth=this.regionMaskLineWidth,s.rect(n.regionLeft,n.regionTop,n.regionRight-n.regionLeft,n.regionBottom-n.regionTop),s.stroke()}if(e){s.globalCompositeOperation="destination-over",s.fillStyle=this.barcodeFillStyle,s.strokeStyle=this.barcodeStrokeStyle,s.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;s.beginPath(),s.moveTo(e.x1,e.y1),s.lineTo(e.x2,e.y2),s.lineTo(e.x3,e.y3),s.lineTo(e.x4,e.y4),s.fill(),s.beginPath(),s.moveTo(e.x1,e.y1),s.lineTo(e.x2,e.y2),s.lineTo(e.x3,e.y3),s.lineTo(e.x4,e.y4),s.closePath(),s.stroke()}}this.singleFrameMode&&(s.globalCompositeOperation="destination-over",s.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,o=1;e/tsuper.destroyContext}});return d(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var E,R,m,I,A,D,S,f,T,M,C,y,L,O,v,B,p,N,F,b,P,w,V,U,k,G,x;h._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",h.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],e.EnumBarcodeColourMode=void 0,(E=e.EnumBarcodeColourMode||(e.EnumBarcodeColourMode={}))[E.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",E[E.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",E[E.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",E[E.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",E[E.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",E[E.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",E[E.BICM_SKIP=0]="BICM_SKIP",E[E.BICM_REV=2147483648]="BICM_REV",e.EnumBarcodeComplementMode=void 0,(R=e.EnumBarcodeComplementMode||(e.EnumBarcodeComplementMode={}))[R.BCM_AUTO=1]="BCM_AUTO",R[R.BCM_GENERAL=2]="BCM_GENERAL",R[R.BCM_SKIP=0]="BCM_SKIP",R[R.BCM_REV=2147483648]="BCM_REV",e.EnumBarcodeFormat_2=void 0,(m=e.EnumBarcodeFormat_2||(e.EnumBarcodeFormat_2={}))[m.BF2_NULL=0]="BF2_NULL",m[m.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",m[m.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",m[m.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",m[m.BF2_POSTNET=2097152]="BF2_POSTNET",m[m.BF2_PLANET=4194304]="BF2_PLANET",m[m.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",m[m.BF2_RM4SCC=16777216]="BF2_RM4SCC",m[m.BF2_DOTCODE=2]="BF2_DOTCODE",e.EnumBinarizationMode=void 0,(I=e.EnumBinarizationMode||(e.EnumBinarizationMode={}))[I.BM_AUTO=1]="BM_AUTO",I[I.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",I[I.BM_SKIP=0]="BM_SKIP",I[I.BM_THRESHOLD=4]="BM_THRESHOLD",I[I.BM_REV=2147483648]="BM_REV",e.EnumClarityCalculationMethod=void 0,(A=e.EnumClarityCalculationMethod||(e.EnumClarityCalculationMethod={}))[A.ECCM_CONTRAST=1]="ECCM_CONTRAST",e.EnumClarityFilterMode=void 0,(D=e.EnumClarityFilterMode||(e.EnumClarityFilterMode={}))[D.CFM_GENERAL=1]="CFM_GENERAL",e.EnumColourClusteringMode=void 0,(S=e.EnumColourClusteringMode||(e.EnumColourClusteringMode={}))[S.CCM_AUTO=1]="CCM_AUTO",S[S.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",S[S.CCM_SKIP=0]="CCM_SKIP",S[S.CCM_REV=2147483648]="CCM_REV",e.EnumColourConversionMode=void 0,(f=e.EnumColourConversionMode||(e.EnumColourConversionMode={}))[f.CICM_GENERAL=1]="CICM_GENERAL",f[f.CICM_SKIP=0]="CICM_SKIP",f[f.CICM_REV=2147483648]="CICM_REV",e.EnumConflictMode=void 0,(T=e.EnumConflictMode||(e.EnumConflictMode={}))[T.CM_IGNORE=1]="CM_IGNORE",T[T.CM_OVERWRITE=2]="CM_OVERWRITE",e.EnumDeblurMode=void 0,(M=e.EnumDeblurMode||(e.EnumDeblurMode={}))[M.DM_SKIP=0]="DM_SKIP",M[M.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",M[M.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",M[M.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",M[M.DM_SMOOTHING=8]="DM_SMOOTHING",M[M.DM_MORPHING=16]="DM_MORPHING",M[M.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",M[M.DM_SHARPENING=64]="DM_SHARPENING",M[M.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",M[M.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING",e.EnumDeformationResistingMode=void 0,(C=e.EnumDeformationResistingMode||(e.EnumDeformationResistingMode={}))[C.DRM_AUTO=1]="DRM_AUTO",C[C.DRM_GENERAL=2]="DRM_GENERAL",C[C.DRM_SKIP=0]="DRM_SKIP",C[C.DRM_REV=2147483648]="DRM_REV",e.EnumDPMCodeReadingMode=void 0,(y=e.EnumDPMCodeReadingMode||(e.EnumDPMCodeReadingMode={}))[y.DPMCRM_AUTO=1]="DPMCRM_AUTO",y[y.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",y[y.DPMCRM_SKIP=0]="DPMCRM_SKIP",y[y.DPMCRM_REV=2147483648]="DPMCRM_REV",e.EnumGrayscaleTransformationMode=void 0,(L=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[L.GTM_INVERTED=1]="GTM_INVERTED",L[L.GTM_ORIGINAL=2]="GTM_ORIGINAL",L[L.GTM_SKIP=0]="GTM_SKIP",L[L.GTM_REV=2147483648]="GTM_REV",e.EnumImagePreprocessingMode=void 0,(O=e.EnumImagePreprocessingMode||(e.EnumImagePreprocessingMode={}))[O.IPM_AUTO=1]="IPM_AUTO",O[O.IPM_GENERAL=2]="IPM_GENERAL",O[O.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",O[O.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",O[O.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",O[O.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",O[O.IPM_SKIP=0]="IPM_SKIP",O[O.IPM_REV=2147483648]="IPM_REV",e.EnumIntermediateResultSavingMode=void 0,(v=e.EnumIntermediateResultSavingMode||(e.EnumIntermediateResultSavingMode={}))[v.IRSM_MEMORY=1]="IRSM_MEMORY",v[v.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",v[v.IRSM_BOTH=4]="IRSM_BOTH",e.EnumIntermediateResultType=void 0,(B=e.EnumIntermediateResultType||(e.EnumIntermediateResultType={}))[B.IRT_NO_RESULT=0]="IRT_NO_RESULT",B[B.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",B[B.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",B[B.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",B[B.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",B[B.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",B[B.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",B[B.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",B[B.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",B[B.IRT_CONTOUR=256]="IRT_CONTOUR",B[B.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",B[B.IRT_FORM=1024]="IRT_FORM",B[B.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",B[B.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",B[B.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL",e.EnumLocalizationMode=void 0,(p=e.EnumLocalizationMode||(e.EnumLocalizationMode={}))[p.LM_SKIP=0]="LM_SKIP",p[p.LM_AUTO=1]="LM_AUTO",p[p.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",p[p.LM_LINES=8]="LM_LINES",p[p.LM_STATISTICS=4]="LM_STATISTICS",p[p.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",p[p.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",p[p.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",p[p.LM_CENTRE=128]="LM_CENTRE",p[p.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",p[p.LM_REV=2147483648]="LM_REV",e.EnumPDFReadingMode=void 0,(N=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[N.PDFRM_RASTER=1]="PDFRM_RASTER",N[N.PDFRM_AUTO=2]="PDFRM_AUTO",N[N.PDFRM_VECTOR=4]="PDFRM_VECTOR",N[N.PDFRM_REV=2147483648]="PDFRM_REV",e.EnumQRCodeErrorCorrectionLevel=void 0,(F=e.EnumQRCodeErrorCorrectionLevel||(e.EnumQRCodeErrorCorrectionLevel={}))[F.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",F[F.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",F[F.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",F[F.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q",e.EnumRegionPredetectionMode=void 0,(b=e.EnumRegionPredetectionMode||(e.EnumRegionPredetectionMode={}))[b.RPM_AUTO=1]="RPM_AUTO",b[b.RPM_GENERAL=2]="RPM_GENERAL",b[b.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",b[b.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",b[b.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",b[b.RPM_SKIP=0]="RPM_SKIP",b[b.RPM_REV=2147483648]="RPM_REV",e.EnumResultCoordinateType=void 0,(P=e.EnumResultCoordinateType||(e.EnumResultCoordinateType={}))[P.RCT_PIXEL=1]="RCT_PIXEL",P[P.RCT_PERCENTAGE=2]="RCT_PERCENTAGE",e.EnumResultType=void 0,(w=e.EnumResultType||(e.EnumResultType={}))[w.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",w[w.RT_RAW_TEXT=1]="RT_RAW_TEXT",w[w.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",w[w.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT",e.EnumScaleUpMode=void 0,(V=e.EnumScaleUpMode||(e.EnumScaleUpMode={}))[V.SUM_AUTO=1]="SUM_AUTO",V[V.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",V[V.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",V[V.SUM_SKIP=0]="SUM_SKIP",V[V.SUM_REV=2147483648]="SUM_REV",e.EnumTerminatePhase=void 0,(U=e.EnumTerminatePhase||(e.EnumTerminatePhase={}))[U.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",U[U.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",U[U.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",U[U.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",U[U.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",U[U.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED",e.EnumTextFilterMode=void 0,(k=e.EnumTextFilterMode||(e.EnumTextFilterMode={}))[k.TFM_AUTO=1]="TFM_AUTO",k[k.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",k[k.TFM_SKIP=0]="TFM_SKIP",k[k.TFM_REV=2147483648]="TFM_REV",e.EnumTextResultOrderMode=void 0,(G=e.EnumTextResultOrderMode||(e.EnumTextResultOrderMode={}))[G.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",G[G.TROM_POSITION=2]="TROM_POSITION",G[G.TROM_FORMAT=4]="TROM_FORMAT",G[G.TROM_SKIP=0]="TROM_SKIP",G[G.TROM_REV=2147483648]="TROM_REV",e.EnumTextureDetectionMode=void 0,(x=e.EnumTextureDetectionMode||(e.EnumTextureDetectionMode={}))[x.TDM_AUTO=1]="TDM_AUTO",x[x.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",x[x.TDM_SKIP=0]="TDM_SKIP",x[x.TDM_REV=2147483648]="TDM_REV";class W{static get version(){return u.version}static get productKeys(){return u.productKeys}static set productKeys(e){u.productKeys=e}static get handshakeCode(){return u.handshakeCode}static set handshakeCode(e){u.handshakeCode=e}static get organizationID(){return u.organizationID}static set organizationID(e){u.organizationID=e}static get sessionPassword(){return u.sessionPassword}static set sessionPassword(e){u.sessionPassword=e}static get browserInfo(){return u.browserInfo}static detectEnvironment(){return u.detectEnvironment()}static get _workerName(){return u._workerName}static set _workerName(e){u._workerName=e}static get engineResourcePath(){return u.engineResourcePath}static set engineResourcePath(e){u.engineResourcePath=e}static get licenseServer(){return u.licenseServer}static set licenseServer(e){u.licenseServer=e}static get deviceFriendlyName(){return u.deviceFriendlyName}static set deviceFriendlyName(e){u.deviceFriendlyName=e}static get _onLog(){return u._onLog}static set _onLog(e){u._onLog=e}static get _bWasmDebug(){return u._bWasmDebug}static set _bWasmDebug(e){u._bWasmDebug=e}static get _bUseFullFeature(){return u._bUseFullFeature}static set _bUseFullFeature(e){u._bUseFullFeature=e}static get _dbrWorker(){return u._dbrWorker}static isLoaded(){return u.isLoaded()}static isWasmLoaded(){return u.isLoaded()}static loadWasm(){return u.loadWasm()}}W.DBR=W,W.BarcodeReader=u,W.BarcodeScanner=h,W.CameraEnhancer=a.default,W.EnumBarcodeColourMode=e.EnumBarcodeColourMode,W.EnumBarcodeComplementMode=e.EnumBarcodeComplementMode,W.EnumBarcodeFormat=e.EnumBarcodeFormat,W.EnumBarcodeFormat_2=e.EnumBarcodeFormat_2,W.EnumBinarizationMode=e.EnumBinarizationMode,W.EnumClarityCalculationMethod=e.EnumClarityCalculationMethod,W.EnumClarityFilterMode=e.EnumClarityFilterMode,W.EnumColourClusteringMode=e.EnumColourClusteringMode,W.EnumColourConversionMode=e.EnumColourConversionMode,W.EnumConflictMode=e.EnumConflictMode,W.EnumDeblurMode=e.EnumDeblurMode,W.EnumDeformationResistingMode=e.EnumDeformationResistingMode,W.EnumDPMCodeReadingMode=e.EnumDPMCodeReadingMode,W.EnumErrorCode=e.EnumErrorCode,W.EnumGrayscaleTransformationMode=e.EnumGrayscaleTransformationMode,W.EnumImagePixelFormat=e.EnumImagePixelFormat,W.EnumImagePreprocessingMode=e.EnumImagePreprocessingMode,W.EnumIMResultDataType=e.EnumIMResultDataType,W.EnumIntermediateResultSavingMode=e.EnumIntermediateResultSavingMode,W.EnumIntermediateResultType=e.EnumIntermediateResultType,W.EnumLocalizationMode=e.EnumLocalizationMode,W.EnumPDFReadingMode=e.EnumPDFReadingMode,W.EnumQRCodeErrorCorrectionLevel=e.EnumQRCodeErrorCorrectionLevel,W.EnumRegionPredetectionMode=e.EnumRegionPredetectionMode,W.EnumResultCoordinateType=e.EnumResultCoordinateType,W.EnumResultType=e.EnumResultType,W.EnumScaleUpMode=e.EnumScaleUpMode,W.EnumTerminatePhase=e.EnumTerminatePhase,W.EnumTextFilterMode=e.EnumTextFilterMode,W.EnumTextResultOrderMode=e.EnumTextResultOrderMode,W.EnumTextureDetectionMode=e.EnumTextureDetectionMode,Object.defineProperty(e,"CameraEnhancer",{enumerable:!0,get:function(){return a.default}}),e.BarcodeReader=u,e.BarcodeScanner=h,e.DBR=W,e.default=W,Object.defineProperty(e,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("dynamsoft-camera-enhancer")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-camera-enhancer"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).Dynamsoft=e.Dynamsoft||{},e.Dynamsoft.DBR={}),e.Dynamsoft.DCE)}(this,(function(e,t){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,r,o,s,a=i(t);function d(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{d(n.next(e))}catch(e){o(e)}}function a(e){try{d(n.throw(e))}catch(e){o(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}d((n=n.apply(e,t||[])).next())}))}e.EnumImagePixelFormat=void 0,(n=e.EnumImagePixelFormat||(e.EnumImagePixelFormat={}))[n.IPF_Binary=0]="IPF_Binary",n[n.IPF_BinaryInverted=1]="IPF_BinaryInverted",n[n.IPF_GrayScaled=2]="IPF_GrayScaled",n[n.IPF_NV21=3]="IPF_NV21",n[n.IPF_RGB_565=4]="IPF_RGB_565",n[n.IPF_RGB_555=5]="IPF_RGB_555",n[n.IPF_RGB_888=6]="IPF_RGB_888",n[n.IPF_ARGB_8888=7]="IPF_ARGB_8888",n[n.IPF_RGB_161616=8]="IPF_RGB_161616",n[n.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",n[n.IPF_ABGR_8888=10]="IPF_ABGR_8888",n[n.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",n[n.IPF_BGR_888=12]="IPF_BGR_888",e.EnumErrorCode=void 0,(r=e.EnumErrorCode||(e.EnumErrorCode={}))[r.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",r[r.DBR_SUCCESS=0]="DBR_SUCCESS",r[r.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",r[r.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",r[r.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",r[r.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",r[r.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",r[r.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",r[r.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",r[r.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",r[r.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",r[r.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",r[r.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",r[r.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",r[r.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",r[r.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",r[r.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",r[r.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",r[r.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",r[r.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",r[r.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",r[r.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",r[r.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",r[r.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",r[r.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",r[r.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",r[r.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",r[r.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",r[r.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",r[r.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",r[r.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",r[r.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",r[r.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",r[r.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",r[r.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",r[r.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",r[r.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",r[r.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",r[r.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",r[r.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",r[r.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",r[r.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",r[r.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",r[r.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",r[r.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",r[r.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",r[r.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",r[r.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",r[r.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",r[r.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",r[r.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",r[r.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",r[r.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",r[r.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",r[r.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",r[r.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",r[r.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",r[r.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",r[r.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",r[r.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",r[r.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",r[r.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS",e.EnumIMResultDataType=void 0,(o=e.EnumIMResultDataType||(e.EnumIMResultDataType={}))[o.IMRDT_IMAGE=1]="IMRDT_IMAGE",o[o.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",o[o.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",o[o.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",o[o.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",o[o.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL",e.EnumBarcodeFormat=void 0,(s=e.EnumBarcodeFormat||(e.EnumBarcodeFormat={}))[s.BF_ALL=-31457281]="BF_ALL",s[s.BF_ONED=1050623]="BF_ONED",s[s.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",s[s.BF_CODE_39=1]="BF_CODE_39",s[s.BF_CODE_128=2]="BF_CODE_128",s[s.BF_CODE_93=4]="BF_CODE_93",s[s.BF_CODABAR=8]="BF_CODABAR",s[s.BF_ITF=16]="BF_ITF",s[s.BF_EAN_13=32]="BF_EAN_13",s[s.BF_EAN_8=64]="BF_EAN_8",s[s.BF_UPC_A=128]="BF_UPC_A",s[s.BF_UPC_E=256]="BF_UPC_E",s[s.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",s[s.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",s[s.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",s[s.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",s[s.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",s[s.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",s[s.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",s[s.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",s[s.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",s[s.BF_PATCHCODE=262144]="BF_PATCHCODE",s[s.BF_PDF417=33554432]="BF_PDF417",s[s.BF_QR_CODE=67108864]="BF_QR_CODE",s[s.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",s[s.BF_AZTEC=268435456]="BF_AZTEC",s[s.BF_MAXICODE=536870912]="BF_MAXICODE",s[s.BF_MICRO_QR=1073741824]="BF_MICRO_QR",s[s.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",s[s.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",s[s.BF_MSI_CODE=1048576]="BF_MSI_CODE",s[s.BF_NULL=0]="BF_NULL";const _=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),l=!_&&"undefined"==typeof self,c=_?global:l?{}:self;class u{constructor(){this._canvasMaxWH="iPhone"==u.browserInfo.OS||"Android"==u.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");u._license=e}static get productKeys(){return this._license}static set productKeys(e){u.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){u.license=e}static get organizationID(){return this._license}static set organizationID(e){u.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");u._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return d(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(_?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),_||l)u._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,u._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(u._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)u._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let t,i=u._license,n=JSON.parse(JSON.stringify(u._licenseServer)),r=u._sessionPassword,o=null,s=null,a=0;if(i.startsWith("t")||i.startsWith("f"))a=0;else if(0===i.length||i.startsWith("P")||i.startsWith("L"))a=1;else{a=2;const e=i.indexOf(":");if(-1!=e&&(i=i.substring(e+1)),i.startsWith("DLS2")){let e=i.substring(4);e=_?Buffer.from(e,"base64").toString("binary"):atob(e);const t=JSON.parse(e);if(t.handshakeCode?i=t.handshakeCode:t.organizationID&&(i=t.organizationID),"number"==typeof i&&(i=JSON.stringify(i)),i||(i=""),0===n.length){let e=[];t.mainServerURL&&(e[0]=t.mainServerURL),t.standbyServerURL&&(e[1]=t.standbyServerURL),u.licenseServer=e,n=u.licenseServer}!r&&t.sessionPassword&&(r=t.sessionPassword),t.chargeWay&&(s=t.chargeWay),t.limitedLicenseModules&&(o=t.limitedLicenseModules)}}if(a&&(_?process.version<"v15"&&(t="To use online key requires nodejs version >= v15."):(c.crypto||(t="Please upgrade your browser to support online key."),c.crypto.subtle||(t="Require https to use online key in this browser."))),t){if(1!==a)throw new Error(t);a=0,console.warn(t),u._lastErrorCode=e.EnumErrorCode.DMERR_FAILED_TO_REACH_LTS,u._lastErrorString=t}return 1===a&&(i="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((e,t)=>d(this,void 0,void 0,(function*(){switch(u._loadWasmStatus){case"unload":{u._loadWasmStatus="loading";let e=u.engineResourcePath+u._workerName;if(_||u.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),_){const t=yield import("worker_threads");u._dbrWorker=new t.Worker(e)}else u._dbrWorker=new Worker(e);u._dbrWorker.onerror=e=>{u._loadWasmStatus="loadFail";let t=new Error(e.message);u._loadWasmErr=t;for(let e of u._loadWasmCallbackArr)e(t);u._loadWasmCallbackArr=[]},u._dbrWorker.onmessage=e=>d(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":u._onLog&&u._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===a&&(e=!0),t.success){u._loadWasmStatus="loadSuccess",u._version=t.version+"(JS "+u._jsVersion+"."+u._jsEditVersion+")",u._onLog&&u._onLog("load dbr worker success");for(let e of u._loadWasmCallbackArr)e();u._loadWasmCallbackArr=[],u._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,u._loadWasmStatus="loadFail",u._loadWasmErr=i;for(let e of u._loadWasmCallbackArr)e(i);u._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&u.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{u._taskCallbackMap.get(e)(i),u._taskCallbackMap.delete(e)}catch(t){throw u._taskCallbackMap.delete(e),t}break}default:u._onLog&&u._onLog(e)}})),_&&u._dbrWorker.on("message",u._dbrWorker.onmessage),u._dbrWorker.postMessage({type:"loadWasm",bd:u._bWasmDebug,engineResourcePath:u.engineResourcePath,version:u._jsVersion,brtk:!!a,bptk:1===a,lcs:i,dm:!_&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:u._bUseFullFeature,browserInfo:u.browserInfo,deviceFriendlyName:u.deviceFriendlyName,ls:n,sp:r,lm:o,cw:s})}case"loading":u._loadWasmCallbackArr.push((i=>{i?t(i):e()}));break;case"loadSuccess":e();break;case"loadFail":t(u._loadWasmErr)}}))))}))}static showDialog(e,t){return d(this,void 0,void 0,(function*(){if(!_&&!u._bNeverShowDialog)try{let i=yield fetch(u.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let n=yield i.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let o=[];for(let e=0;e{if(i==e.target){s.remove();for(let e of o)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{s.remove();for(let e of o)e.remove()}));else if(!_&&i.classList.contains("dls-license-icon-error"))_=i,"error"!=e&&i.remove();else if(!l&&i.classList.contains("dls-license-icon-warn"))l=i,"warn"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-msg-content")){c=i;let e=t;for(;e;){let t=e.indexOf("["),n=e.indexOf("]",t),r=e.indexOf("(",n),o=e.indexOf(")",r);if(-1==t||-1==n||-1==r||-1==o){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let s=document.createElement("a"),a=e.substring(t+1,n);s.innerText=a;let d=e.substring(r+1,o);s.setAttribute("href",d),s.setAttribute("target","_blank"),i.appendChild(s),e=e.substring(o+1)}}document.body.appendChild(s)}catch(e){u._onLog&&u._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return d(this,void 0,void 0,(function*(){return yield u.loadWasm(),yield new Promise(((t,i)=>{let n=u._nextTaskID++;u._taskCallbackMap.set(n,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),u._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:e})}))}))}static createInstance(){return d(this,void 0,void 0,(function*(){let e=new u;return e._instanceID=yield u.createInstanceInWorker(),e}))}decode(e){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("decode(source: any)"),u._onLog&&(this._timeStartDecode=Date.now()),_)return e instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e)):e instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(e):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e):"http"==e.substring(0,4)?yield this._decode_Url(e):yield this._decode_FilePath(e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return d(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return d(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,i,n,r,o){return d(this,void 0,void 0,(function*(){return yield new Promise(((s,a)=>{let d=u._nextTaskID++;u._taskCallbackMap.set(d,(e=>{if(e.success){let t,i=u._onLog?Date.now():0;u._onLog&&u._onLog("worker return result: "+i),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(u._onLog){let e=Date.now();u._onLog("DBR time get result: "+i),u._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),u._onLog("DBR worker decode image cost: "+(i-this._timeEnterInnerDBR)),u._onLog("DBR worker handle results: "+(e-i)),u._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return s(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),u._onLog&&u._onLog("Send buffer to worker:"+this._timeEnterInnerDBR),u._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:i,stride:n,format:r,config:o}},[e.buffer]),u._onLog&&o&&o._timeEndGettingFrame&&u._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,i,n,r,o){return d(this,void 0,void 0,(function*(){u._onLog&&u._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const s=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onload=()=>{t(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(s),t,i,n,r,o)}))}decodeBuffer(e,t,i,n,r,o){return d(this,void 0,void 0,(function*(){let s;return u._onLog&&u._onLog("decodeBuffer(buffer,width,height,stride,format)"),u._onLog&&(this._timeStartDecode=Date.now()),_?e instanceof Uint8Array?s=yield this._decodeBuffer_Uint8Array(e,t,i,n,r,o):e instanceof Buffer&&(s=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,i,n,r,o)):e instanceof Uint8Array||e instanceof Uint8ClampedArray?s=yield this._decodeBuffer_Uint8Array(e,t,i,n,r,o):e instanceof ArrayBuffer?s=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,i,n,r,o):e instanceof Blob&&(s=yield this._decodeBuffer_Blob(e,t,i,n,r,o)),s}))}_decodeFileInMemory_Uint8Array(e){return d(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let n=u._nextTaskID++;u._taskCallbackMap.set(n,(e=>{if(e.success){let n;this._lastInnerDecodeDuration=e.duration;try{n=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(n)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),u._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(t){return d(this,void 0,void 0,(function*(){let i;if("string"==typeof t)if("speed"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,i.region=e.region,i.deblurLevel=3,i.expectedBarcodesCount=0,i.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,i.region=e.region,i.deblurLevel=5,i.expectedBarcodesCount=512,i.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,i.region=e.region}else i=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(i=JSON.parse(JSON.stringify(t)),i.region instanceof Array){let e=i.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(i.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!u._bUseFullFeature){if(0!=(i.barcodeFormatIds&~(e.EnumBarcodeFormat.BF_ONED|e.EnumBarcodeFormat.BF_QR_CODE|e.EnumBarcodeFormat.BF_PDF417|e.EnumBarcodeFormat.BF_DATAMATRIX))||0!=i.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=i.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!_)if(this.bFilterRegionInJs){let e=i.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,i.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,t)=>{let n=u._nextTaskID++;u._taskCallbackMap.set(n,(i=>{if(i.success){try{this._handleRetJsonString(i.updateReturn)}catch(e){t(e)}return e()}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(i)}})}))}))}resetRuntimeSettings(){return d(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return d(this,void 0,void 0,(function*(){if(!u._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return d(this,void 0,void 0,(function*(){if(!u._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let n=u._nextTaskID++;u._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),u._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return d(this,void 0,void 0,(function*(){u._onLog&&u._onLog("_decode_Blob(blob: Blob)");let i=null,n=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let r=yield this._decode_Image(i||n,t);return i&&i.close(),r}))}_decode_ArrayBuffer(e,t){return d(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return d(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return d(this,void 0,void 0,(function*(){u._onLog&&u._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,n,r,o,s=e instanceof HTMLImageElement?e.naturalWidth:e.width,a=e instanceof HTMLImageElement?e.naturalHeight:e.height,d=t.region;if(d){let e,t,r,o;d.regionMeasuredByPercentage?(e=d.regionLeft*s/100,t=d.regionTop*a/100,r=d.regionRight*s/100,o=d.regionBottom*a/100):(e=d.regionLeft,t=d.regionTop,r=d.regionRight,o=d.regionBottom),i=e,n=t,s=Math.round(r-e),a=Math.round(o-t)}else i=0,n=0;const _=Math.max(s,a);if(_>this._canvasMaxWH){const e=this._canvasMaxWH/_;s>a?(r=this._canvasMaxWH,o=Math.round(a*e)):(r=Math.round(s*e),o=this._canvasMaxWH)}else r=s,o=a;let l,g;!this.bSaveOriCanvas&&c.OffscreenCanvas?l=new OffscreenCanvas(r,o):(l=document.createElement("canvas"),l.width=r,l.height=o),l.getContext("2d").drawImage(e,i,n,s,a,0,0,r,o),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),d?(g=JSON.parse(JSON.stringify(t)),delete g.region):g=t;let h=yield this._decode_Canvas(l,g);return u.fixResultLocationWhenFilterRegionInJs(d,h,i,n,s,a,r,o),h}))}_decode_Canvas(t,i){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),t.crossOrigin&&"anonymous"!=t.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let n=(t.dbrCtx2d||t.getContext("2d")).getImageData(0,0,t.width,t.height).data;return yield this._decodeBuffer_Uint8Array(n,t.width,t.height,4*t.width,e.EnumImagePixelFormat.IPF_ABGR_8888,i)}))}_decode_Video(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};let i,n,r,o,s=e.videoWidth,a=e.videoHeight,d=t.region;if(d){let e,t,r,o;d.regionMeasuredByPercentage?(e=d.regionLeft*s/100,t=d.regionTop*a/100,r=d.regionRight*s/100,o=d.regionBottom*a/100):(e=d.regionLeft,t=d.regionTop,r=d.regionRight,o=d.regionBottom),i=e,n=t,s=Math.round(r-e),a=Math.round(o-t)}else i=0,n=0;const _=Math.max(s,a);if(_>this._canvasMaxWH){const e=this._canvasMaxWH/_;s>a?(r=this._canvasMaxWH,o=Math.round(a*e)):(r=Math.round(s*e),o=this._canvasMaxWH)}else r=s,o=a;let l=null;!this.bSaveOriCanvas&&c.OffscreenCanvas?l=new OffscreenCanvas(r,o):(l=document.createElement("canvas"),l.width=r,l.height=o);let g;(l.dbrCtx2d=l.getContext("2d")).drawImage(e,i,n,s,a,0,0,r,o),d?(g=JSON.parse(JSON.stringify(t)),delete g.region):g=t;let h=yield this._decode_Canvas(l,t);return d&&u.fixResultLocationWhenFilterRegionInJs(d,h,i,n,s,a,r,o),h}))}_decode_Base64(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1)),_){let t=Buffer.from(e,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t))}{let i=atob(e),n=i.length,r=new Uint8Array(n);for(;n--;)r[n]=i.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),t)}}))}_decode_Url(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(e=e,_){let t=yield new Promise(((t,i)=>d(this,void 0,void 0,(function*(){(e.startsWith("https")?yield import("https"):yield import("http")).get(e,(e=>{if(200==e.statusCode){let i=[];e.on("data",(e=>{i.push(e)})).on("end",(()=>{t(new Uint8Array(Buffer.concat(i)))}))}else i("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(t)}{let i=yield new Promise(((t,i)=>{let n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.send(),n.onloadend=()=>d(this,void 0,void 0,(function*(){t(n.response)})),n.onerror=()=>{i(new Error("Network Error: "+n.statusText))}}));return yield this._decode_Blob(i,t)}}))}_decode_FilePath(e,t){return d(this,void 0,void 0,(function*(){if(u._onLog&&u._onLog("_decode_FilePath(path)"),!_)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof e)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const t=yield import("fs");let i=yield new Promise(((i,n)=>{t.readFile(e,((e,t)=>{e?n(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,o,s,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*s,t.x2*=.01*s,t.x3*=.01*s,t.x4*=.01*s,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=s/r,_=a/o;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+n,t.y2=t.y2/_+n,t.y3=t.y3/_+n,t.y4=t.y4/_+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/o,t.y2*=100/o,t.y3*=100/o,t.y4*=100/o)}}static BarcodeReaderException(t,i){let n,r=e.EnumErrorCode.DBR_UNKNOWN;return"number"==typeof t?(r=t,n=new Error(i)):n=new Error(t),n.code=r,n}_handleRetJsonString(t){let i=e.EnumErrorCode;if(t.textResults){for(let e=0;e{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return t.decodeRecords?this.decodeRecords=t.decodeRecords:this.decodeRecords={},this._lastErrorCode=t.exception,this._lastErrorString=t.description,t.exception&&!u._setWarnnedEx.has(t.description)&&(u._setWarnnedEx.add(t.description),console.warn(t.description)),t.textResults}if(t.exception==i.DBR_SUCCESS)return t.data;throw u.BarcodeReaderException(t.exception,t.description)}setModeArgument(e,t,i,n){return d(this,void 0,void 0,(function*(){return yield new Promise(((r,o)=>{let s=u._nextTaskID++;u._taskCallbackMap.set(s,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return o(e)}return r()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,o(t)}})),u._dbrWorker.postMessage({type:"setModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:i,argumentValue:n}})}))}))}getModeArgument(e,t,i){return d(this,void 0,void 0,(function*(){return yield new Promise(((n,r)=>{let o=u._nextTaskID++;u._taskCallbackMap.set(o,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return r(e)}return n(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,r(t)}})),u._dbrWorker.postMessage({type:"getModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:i}})}))}))}getIntermediateResults(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return d(this,void 0,void 0,(function*(){let t=yield this.getIntermediateResults(),i=[];for(let n of t)if(n.dataType==e.EnumIMResultDataType.IMRDT_IMAGE)for(let t of n.results){const n=t.bytes;let r;switch(u._onLog&&u._onLog(" "+n.length+" "+n.byteLength+" "+t.width+" "+t.height+" "+t.stride+" "+t.format),t.format){case e.EnumImagePixelFormat.IPF_ABGR_8888:r=new Uint8ClampedArray(n);break;case e.EnumImagePixelFormat.IPF_RGB_888:{const e=n.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}u._jsVersion="8.8.7",u._jsEditVersion="20220125",u._version="loading...(JS "+u._jsVersion+"."+u._jsEditVersion+")",u._license=_||l||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",u._sessionPassword=_||l||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",u.browserInfo=function(){if(!_&&!l){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{d(this,void 0,void 0,(function*(){const t=yield import("os");e.OS=t&&t.platform?t.platform()+t.release():"Unknown"}))})(),e}}(),u._workerName="dbr-"+u._jsVersion+".worker.js",u._engineResourcePath=(()=>{if(_)return __dirname+"/";if(!l&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),u._licenseServer=[],u._deviceFriendlyName="",u._isShowRelDecodeTimeInResults=!1,u._bWasmDebug=!1,u._bNeverShowDialog=!1,u.__bUseFullFeature=!0,u._nextTaskID=0,u._taskCallbackMap=new Map,u._loadWasmStatus="unload",u._loadWasmCallbackArr=[],u._lastErrorCode=0,u._lastErrorString="",u._setWarnnedEx=new Set,u._loadWasmErr=null;const g=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class h extends u{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=h._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",u.engineResourcePath)}static set defaultUIElementURL(e){h._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return d(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{d(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return d(this,void 0,void 0,(function*(){this.dce||(u._onLog&&u._onLog("createDCEInstance()"),t.CameraEnhancer.defaultUIElementURL=null,this.dce=yield t.CameraEnhancer.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>d(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return d(this,void 0,void 0,(function*(){if(g)throw new Error("`BarcodeScanner` is not supported in Node.js.");let t=new h;yield t.createDCEInstance(),t._instanceID=yield h.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(h.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,o){return super.decodeBuffer(e,t,i,n,r,o)}decodeCurrentFrame(t){return d(this,void 0,void 0,(function*(){this._assertOpen();let i=null;t&&t.region&&(i=t.region);let n=this.dce.getFrame(i);if(n&&null===n.canvas){let{data:t,width:i,height:r}=n;return yield this._decodeBuffer_Uint8Array(t,i,r,i,e.EnumImagePixelFormat.IPF_GrayScaled)}if(n&&n.canvas){let{data:t,canvas:i,region:r,sx:o,sy:s,sWidth:a,sHeight:d}=n;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let _=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,e.EnumImagePixelFormat.IPF_ABGR_8888);return u.fixResultLocationWhenFilterRegionInJs(r,_,o,s,a,d,i.width,i.height),_}}))}clearMapDecodeRecord(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(h.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(t){return d(this,void 0,void 0,(function*(){let i;if("string"==typeof t)if("speed"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionSinglePreset(e.region)||(i.region=e.region)}else if("balance"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionSinglePreset(e.region)||(i.region=e.region),i.deblurLevel=3,i.expectedBarcodesCount=512,i.localizationModes=[2,16,0,0,0,0,0,0],i.timeout=1e5}else if("coverage"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionSinglePreset(e.region)||(i.region=e.region),i.deblurLevel=5,i.expectedBarcodesCount=512,i.scaleDownThreshold=1e5,i.localizationModes=[2,16,4,8,0,0,0,0],i.timeout=1e5}else if("single"==t){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),i=yield this.getRuntimeSettings(),i.barcodeFormatIds=e.barcodeFormatIds,i.barcodeFormatIds_2=e.barcodeFormatIds_2,h.isRegionNormalPreset(e.region)?i.region=JSON.parse(JSON.stringify(h.singlePresetRegion)):i.region=e.region,i.expectedBarcodesCount=1,i.localizationModes=[16,2,0,0,0,0,0,0],i.barcodeZoneMinDistanceToImageBorders=0}else i=JSON.parse(t);else{if("object"!=typeof t)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(i=JSON.parse(JSON.stringify(t)),i.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(i.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!u._bUseFullFeature){if(0!=(i.barcodeFormatIds&~(e.EnumBarcodeFormat.BF_ONED|e.EnumBarcodeFormat.BF_QR_CODE|e.EnumBarcodeFormat.BF_PDF417|e.EnumBarcodeFormat.BF_DATAMATRIX))||0!=i.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=i.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=i.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let n=u._nextTaskID++;u._taskCallbackMap.set(n,(i=>{if(i.success){try{this._handleRetJsonString(i.updateReturn)}catch(e){t(e)}return e()}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),u._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(i)}})})),"single"==t&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");let t=[e];for(let e=0;e','','',''].join(""),this.dce._optGotRsl=this.dce._optGotRsl||this.dce._selRsl.options[0])):this.dce._optGotRsl||!e.classList.contains("dce-opt-gotResolution")&&!e.classList.contains("dbrScanner-opt-gotResolution")?this.dce._btnClose||!e.classList.contains("dce-btn-close")&&!e.classList.contains("dbrScanner-btn-close")?this.dce._video||!e.classList.contains("dce-existingVideo")&&!e.classList.contains("dbrScanner-existingVideo")||(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"),this.dce.singleFrameMode=!1):this.dce._btnClose=e:this.dce._optGotRsl=e:this.dce._selCam=e:this.dce._bgCamera=e:this.dce._bgLoading=e:(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"));if(this.dce._bindUI(),this._selCam=this.dce._selCam,this._selRsl=this.dce._selRsl,this._btnClose=this.dce._btnClose,this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.addEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="pointer",this._cvsDrawArea.setAttribute("title","Take a photo")),this._divScanArea&&(this._divScanArea.addEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="pointer",this._divScanArea.setAttribute("title","Take a photo"))),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this.dce.video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dbrScanner-video`.")}_unbindUI(){this._clearRegionsults(),this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.removeEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="",this._cvsDrawArea.removeAttribute("title")),this._divScanArea&&(this._divScanArea.removeEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="",this._divScanArea.removeAttribute("title"))),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this.dce._unbindUI(),this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null}set onPlayed(e){this.dce.onPlayed=e}get onPlayed(){return this.dce.onPlayed}get onUnduplicatedRead(){return this.onUniqueRead}set onUnduplicatedRead(e){this.onUniqueRead=e}getAllCameras(){return d(this,void 0,void 0,(function*(){return this.dce.getAllCameras()}))}getCurrentCamera(){return d(this,void 0,void 0,(function*(){return this.dce.getSelectedCamera()}))}setCurrentCamera(e){return d(this,void 0,void 0,(function*(){return this.dce.selectCamera(e)}))}getResolution(){return this.dce.getResolution()}setResolution(e,t){return d(this,void 0,void 0,(function*(){return this.dce.setResolution(e,t)}))}getScanSettings(){return d(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=u._nextTaskID++;u._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),u._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return d(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let n=u._nextTaskID++;u._taskCallbackMap.set(n,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),h._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,i){return d(this,void 0,void 0,(function*(){return this.dce.play(e,t,i)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return d(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return d(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return d(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return d(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return d(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return d(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return d(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return d(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return u._onLog&&u._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),u._onLog&&u._onLog("======= once read ======="),u._onLog&&(this._timeStartDecode=Date.now());let t=this._getVideoFrame();if(!t)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>d(this,void 0,void 0,(function*(){if(t&&null===t.canvas){let{data:i,width:n,height:r,timeStamp:o}=t,s={timeStamp:o};return yield this._decodeBuffer_Uint8Array(i,n,r,n,e.EnumImagePixelFormat.IPF_GrayScaled,s)}if(t&&t.canvas){let{data:i,canvas:n,region:r,sx:o,sy:s,width:a,height:d,timeStamp:_}=t,l={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=n);let c=yield this._decodeBuffer_Uint8Array(i,n.width,n.height,4*n.width,e.EnumImagePixelFormat.IPF_ABGR_8888,l);return u.fixResultLocationWhenFilterRegionInJs(r,c,o,s,n.width,n.height,a,d),c}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{u._onLog&&u._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,o=0;r=n+1>=this.region.length?0:n+1,o=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[o]&&i[o].length?Math.min(...t[r])-Math.max(...i[o]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})()+this.intervalTime,this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),u._onLog&&u._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let o=this._cvsDrawArea;o.width=i,o.height=n;let s=o.getContext("2d");if(r){s.fillStyle=this.regionMaskFillStyle,s.fillRect(0,0,o.width,o.height),s.globalCompositeOperation="destination-out",s.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);s.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),s.globalCompositeOperation="source-over",s.strokeStyle=this.regionMaskStrokeStyle,s.lineWidth=this.regionMaskLineWidth,s.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),s.stroke()}if(e){s.globalCompositeOperation="destination-over",s.fillStyle=this.barcodeFillStyle,s.strokeStyle=this.barcodeStrokeStyle,s.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;s.beginPath(),s.moveTo(e.x1,e.y1),s.lineTo(e.x2,e.y2),s.lineTo(e.x3,e.y3),s.lineTo(e.x4,e.y4),s.fill(),s.beginPath(),s.moveTo(e.x1,e.y1),s.lineTo(e.x2,e.y2),s.lineTo(e.x3,e.y3),s.lineTo(e.x4,e.y4),s.closePath(),s.stroke()}}this.singleFrameMode&&(s.globalCompositeOperation="destination-over",s.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,o=1;e/tsuper.destroyContext}});return d(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var E,R,m,I,A,D,S,f,T,M,C,y,L,O,p,v,B,N,b,F,P,w,V,U,k,G,x;h._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",h.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],e.EnumBarcodeColourMode=void 0,(E=e.EnumBarcodeColourMode||(e.EnumBarcodeColourMode={}))[E.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",E[E.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",E[E.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",E[E.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",E[E.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",E[E.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",E[E.BICM_SKIP=0]="BICM_SKIP",E[E.BICM_REV=2147483648]="BICM_REV",e.EnumBarcodeComplementMode=void 0,(R=e.EnumBarcodeComplementMode||(e.EnumBarcodeComplementMode={}))[R.BCM_AUTO=1]="BCM_AUTO",R[R.BCM_GENERAL=2]="BCM_GENERAL",R[R.BCM_SKIP=0]="BCM_SKIP",R[R.BCM_REV=2147483648]="BCM_REV",e.EnumBarcodeFormat_2=void 0,(m=e.EnumBarcodeFormat_2||(e.EnumBarcodeFormat_2={}))[m.BF2_NULL=0]="BF2_NULL",m[m.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",m[m.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",m[m.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",m[m.BF2_POSTNET=2097152]="BF2_POSTNET",m[m.BF2_PLANET=4194304]="BF2_PLANET",m[m.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",m[m.BF2_RM4SCC=16777216]="BF2_RM4SCC",m[m.BF2_DOTCODE=2]="BF2_DOTCODE",e.EnumBinarizationMode=void 0,(I=e.EnumBinarizationMode||(e.EnumBinarizationMode={}))[I.BM_AUTO=1]="BM_AUTO",I[I.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",I[I.BM_SKIP=0]="BM_SKIP",I[I.BM_THRESHOLD=4]="BM_THRESHOLD",I[I.BM_REV=2147483648]="BM_REV",e.EnumClarityCalculationMethod=void 0,(A=e.EnumClarityCalculationMethod||(e.EnumClarityCalculationMethod={}))[A.ECCM_CONTRAST=1]="ECCM_CONTRAST",e.EnumClarityFilterMode=void 0,(D=e.EnumClarityFilterMode||(e.EnumClarityFilterMode={}))[D.CFM_GENERAL=1]="CFM_GENERAL",e.EnumColourClusteringMode=void 0,(S=e.EnumColourClusteringMode||(e.EnumColourClusteringMode={}))[S.CCM_AUTO=1]="CCM_AUTO",S[S.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",S[S.CCM_SKIP=0]="CCM_SKIP",S[S.CCM_REV=2147483648]="CCM_REV",e.EnumColourConversionMode=void 0,(f=e.EnumColourConversionMode||(e.EnumColourConversionMode={}))[f.CICM_GENERAL=1]="CICM_GENERAL",f[f.CICM_SKIP=0]="CICM_SKIP",f[f.CICM_REV=2147483648]="CICM_REV",e.EnumConflictMode=void 0,(T=e.EnumConflictMode||(e.EnumConflictMode={}))[T.CM_IGNORE=1]="CM_IGNORE",T[T.CM_OVERWRITE=2]="CM_OVERWRITE",e.EnumDeblurMode=void 0,(M=e.EnumDeblurMode||(e.EnumDeblurMode={}))[M.DM_SKIP=0]="DM_SKIP",M[M.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",M[M.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",M[M.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",M[M.DM_SMOOTHING=8]="DM_SMOOTHING",M[M.DM_MORPHING=16]="DM_MORPHING",M[M.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",M[M.DM_SHARPENING=64]="DM_SHARPENING",M[M.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",M[M.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING",e.EnumDeformationResistingMode=void 0,(C=e.EnumDeformationResistingMode||(e.EnumDeformationResistingMode={}))[C.DRM_AUTO=1]="DRM_AUTO",C[C.DRM_GENERAL=2]="DRM_GENERAL",C[C.DRM_SKIP=0]="DRM_SKIP",C[C.DRM_REV=2147483648]="DRM_REV",e.EnumDPMCodeReadingMode=void 0,(y=e.EnumDPMCodeReadingMode||(e.EnumDPMCodeReadingMode={}))[y.DPMCRM_AUTO=1]="DPMCRM_AUTO",y[y.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",y[y.DPMCRM_SKIP=0]="DPMCRM_SKIP",y[y.DPMCRM_REV=2147483648]="DPMCRM_REV",e.EnumGrayscaleTransformationMode=void 0,(L=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[L.GTM_INVERTED=1]="GTM_INVERTED",L[L.GTM_ORIGINAL=2]="GTM_ORIGINAL",L[L.GTM_SKIP=0]="GTM_SKIP",L[L.GTM_REV=2147483648]="GTM_REV",e.EnumImagePreprocessingMode=void 0,(O=e.EnumImagePreprocessingMode||(e.EnumImagePreprocessingMode={}))[O.IPM_AUTO=1]="IPM_AUTO",O[O.IPM_GENERAL=2]="IPM_GENERAL",O[O.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",O[O.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",O[O.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",O[O.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",O[O.IPM_SKIP=0]="IPM_SKIP",O[O.IPM_REV=2147483648]="IPM_REV",e.EnumIntermediateResultSavingMode=void 0,(p=e.EnumIntermediateResultSavingMode||(e.EnumIntermediateResultSavingMode={}))[p.IRSM_MEMORY=1]="IRSM_MEMORY",p[p.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",p[p.IRSM_BOTH=4]="IRSM_BOTH",e.EnumIntermediateResultType=void 0,(v=e.EnumIntermediateResultType||(e.EnumIntermediateResultType={}))[v.IRT_NO_RESULT=0]="IRT_NO_RESULT",v[v.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",v[v.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",v[v.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",v[v.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",v[v.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",v[v.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",v[v.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",v[v.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",v[v.IRT_CONTOUR=256]="IRT_CONTOUR",v[v.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",v[v.IRT_FORM=1024]="IRT_FORM",v[v.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",v[v.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",v[v.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL",e.EnumLocalizationMode=void 0,(B=e.EnumLocalizationMode||(e.EnumLocalizationMode={}))[B.LM_SKIP=0]="LM_SKIP",B[B.LM_AUTO=1]="LM_AUTO",B[B.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",B[B.LM_LINES=8]="LM_LINES",B[B.LM_STATISTICS=4]="LM_STATISTICS",B[B.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",B[B.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",B[B.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",B[B.LM_CENTRE=128]="LM_CENTRE",B[B.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",B[B.LM_REV=2147483648]="LM_REV",e.EnumPDFReadingMode=void 0,(N=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[N.PDFRM_RASTER=1]="PDFRM_RASTER",N[N.PDFRM_AUTO=2]="PDFRM_AUTO",N[N.PDFRM_VECTOR=4]="PDFRM_VECTOR",N[N.PDFRM_REV=2147483648]="PDFRM_REV",e.EnumQRCodeErrorCorrectionLevel=void 0,(b=e.EnumQRCodeErrorCorrectionLevel||(e.EnumQRCodeErrorCorrectionLevel={}))[b.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",b[b.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",b[b.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",b[b.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q",e.EnumRegionPredetectionMode=void 0,(F=e.EnumRegionPredetectionMode||(e.EnumRegionPredetectionMode={}))[F.RPM_AUTO=1]="RPM_AUTO",F[F.RPM_GENERAL=2]="RPM_GENERAL",F[F.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",F[F.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",F[F.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",F[F.RPM_SKIP=0]="RPM_SKIP",F[F.RPM_REV=2147483648]="RPM_REV",e.EnumResultCoordinateType=void 0,(P=e.EnumResultCoordinateType||(e.EnumResultCoordinateType={}))[P.RCT_PIXEL=1]="RCT_PIXEL",P[P.RCT_PERCENTAGE=2]="RCT_PERCENTAGE",e.EnumResultType=void 0,(w=e.EnumResultType||(e.EnumResultType={}))[w.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",w[w.RT_RAW_TEXT=1]="RT_RAW_TEXT",w[w.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",w[w.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT",e.EnumScaleUpMode=void 0,(V=e.EnumScaleUpMode||(e.EnumScaleUpMode={}))[V.SUM_AUTO=1]="SUM_AUTO",V[V.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",V[V.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",V[V.SUM_SKIP=0]="SUM_SKIP",V[V.SUM_REV=2147483648]="SUM_REV",e.EnumTerminatePhase=void 0,(U=e.EnumTerminatePhase||(e.EnumTerminatePhase={}))[U.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",U[U.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",U[U.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",U[U.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",U[U.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",U[U.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED",e.EnumTextFilterMode=void 0,(k=e.EnumTextFilterMode||(e.EnumTextFilterMode={}))[k.TFM_AUTO=1]="TFM_AUTO",k[k.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",k[k.TFM_SKIP=0]="TFM_SKIP",k[k.TFM_REV=2147483648]="TFM_REV",e.EnumTextResultOrderMode=void 0,(G=e.EnumTextResultOrderMode||(e.EnumTextResultOrderMode={}))[G.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",G[G.TROM_POSITION=2]="TROM_POSITION",G[G.TROM_FORMAT=4]="TROM_FORMAT",G[G.TROM_SKIP=0]="TROM_SKIP",G[G.TROM_REV=2147483648]="TROM_REV",e.EnumTextureDetectionMode=void 0,(x=e.EnumTextureDetectionMode||(e.EnumTextureDetectionMode={}))[x.TDM_AUTO=1]="TDM_AUTO",x[x.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",x[x.TDM_SKIP=0]="TDM_SKIP",x[x.TDM_REV=2147483648]="TDM_REV";class W{static get version(){return u.version}static get productKeys(){return u.productKeys}static set productKeys(e){u.productKeys=e}static get handshakeCode(){return u.handshakeCode}static set handshakeCode(e){u.handshakeCode=e}static get organizationID(){return u.organizationID}static set organizationID(e){u.organizationID=e}static get sessionPassword(){return u.sessionPassword}static set sessionPassword(e){u.sessionPassword=e}static get browserInfo(){return u.browserInfo}static detectEnvironment(){return u.detectEnvironment()}static get _workerName(){return u._workerName}static set _workerName(e){u._workerName=e}static get engineResourcePath(){return u.engineResourcePath}static set engineResourcePath(e){u.engineResourcePath=e}static get licenseServer(){return u.licenseServer}static set licenseServer(e){u.licenseServer=e}static get deviceFriendlyName(){return u.deviceFriendlyName}static set deviceFriendlyName(e){u.deviceFriendlyName=e}static get _onLog(){return u._onLog}static set _onLog(e){u._onLog=e}static get _bWasmDebug(){return u._bWasmDebug}static set _bWasmDebug(e){u._bWasmDebug=e}static get _bUseFullFeature(){return u._bUseFullFeature}static set _bUseFullFeature(e){u._bUseFullFeature=e}static get _dbrWorker(){return u._dbrWorker}static isLoaded(){return u.isLoaded()}static isWasmLoaded(){return u.isLoaded()}static loadWasm(){return u.loadWasm()}}W.DBR=W,W.BarcodeReader=u,W.BarcodeScanner=h,W.CameraEnhancer=a.default,W.EnumBarcodeColourMode=e.EnumBarcodeColourMode,W.EnumBarcodeComplementMode=e.EnumBarcodeComplementMode,W.EnumBarcodeFormat=e.EnumBarcodeFormat,W.EnumBarcodeFormat_2=e.EnumBarcodeFormat_2,W.EnumBinarizationMode=e.EnumBinarizationMode,W.EnumClarityCalculationMethod=e.EnumClarityCalculationMethod,W.EnumClarityFilterMode=e.EnumClarityFilterMode,W.EnumColourClusteringMode=e.EnumColourClusteringMode,W.EnumColourConversionMode=e.EnumColourConversionMode,W.EnumConflictMode=e.EnumConflictMode,W.EnumDeblurMode=e.EnumDeblurMode,W.EnumDeformationResistingMode=e.EnumDeformationResistingMode,W.EnumDPMCodeReadingMode=e.EnumDPMCodeReadingMode,W.EnumErrorCode=e.EnumErrorCode,W.EnumGrayscaleTransformationMode=e.EnumGrayscaleTransformationMode,W.EnumImagePixelFormat=e.EnumImagePixelFormat,W.EnumImagePreprocessingMode=e.EnumImagePreprocessingMode,W.EnumIMResultDataType=e.EnumIMResultDataType,W.EnumIntermediateResultSavingMode=e.EnumIntermediateResultSavingMode,W.EnumIntermediateResultType=e.EnumIntermediateResultType,W.EnumLocalizationMode=e.EnumLocalizationMode,W.EnumPDFReadingMode=e.EnumPDFReadingMode,W.EnumQRCodeErrorCorrectionLevel=e.EnumQRCodeErrorCorrectionLevel,W.EnumRegionPredetectionMode=e.EnumRegionPredetectionMode,W.EnumResultCoordinateType=e.EnumResultCoordinateType,W.EnumResultType=e.EnumResultType,W.EnumScaleUpMode=e.EnumScaleUpMode,W.EnumTerminatePhase=e.EnumTerminatePhase,W.EnumTextFilterMode=e.EnumTextFilterMode,W.EnumTextResultOrderMode=e.EnumTextResultOrderMode,W.EnumTextureDetectionMode=e.EnumTextureDetectionMode,Object.defineProperty(e,"CameraEnhancer",{enumerable:!0,get:function(){return a.default}}),e.BarcodeReader=u,e.BarcodeScanner=h,e.DBR=W,e.default=W,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/dist/dbr.pure.mjs b/dist/dbr.pure.mjs index 7f0e70b..32a544c 100644 --- a/dist/dbr.pure.mjs +++ b/dist/dbr.pure.mjs @@ -2,10 +2,10 @@ * Dynamsoft JavaScript Library * @product Dynamsoft Barcode Reader JS Edition * @website http://www.dynamsoft.com - * @copyright Copyright 2021, Dynamsoft Corporation + * @copyright Copyright 2022, Dynamsoft Corporation * @author Dynamsoft - * @version 8.8.3 (js 20211011) + * @version 8.8.7 (js 20220125) * @fileoverview Dynamsoft JavaScript Library for Barcode Reader * More info on DBR JS: https://www.dynamsoft.com/barcode-reader/sdk-javascript/ */ -import e,{CameraEnhancer as t}from"dynamsoft-camera-enhancer";export{default as CameraEnhancer}from"dynamsoft-camera-enhancer";function i(e,t,i,r){return new(i||(i=Promise))((function(n,s){function o(e){try{d(r.next(e))}catch(e){s(e)}}function a(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((r=r.apply(e,t||[])).next())}))}var r,n,s,o;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(r||(r={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(n||(n={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(o||(o={}));const a=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),d=!a&&"undefined"==typeof self,_=a?global:d?{}:self;class l{constructor(){this._canvasMaxWH="iPhone"==l.browserInfo.OS||"Android"==l.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");l._license=e}static get productKeys(){return this._license}static set productKeys(e){l.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){l.license=e}static get organizationID(){return this._license}static set organizationID(e){l.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");l._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return i(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(a?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),a||d)l._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,l._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(l._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)l._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let e,t=l._license,r=JSON.parse(JSON.stringify(l._licenseServer)),s=l._sessionPassword,o=null,d=null,c=0;if(t.startsWith("t")||t.startsWith("f"))c=0;else if(0===t.length||t.startsWith("P")||t.startsWith("L"))c=1;else{c=2;const e=t.indexOf(":");if(-1!=e&&(t=t.substring(e+1)),t.startsWith("DLS2")){let e=t.substring(4);e=a?Buffer.from(e,"base64").toString("binary"):atob(e);const i=JSON.parse(e);if(i.handshakeCode?t=i.handshakeCode:i.organizationID&&(t=i.organizationID),"number"==typeof t&&(t=JSON.stringify(t)),t||(t=""),0===r.length){let e=[];i.mainServerURL&&(e[0]=i.mainServerURL),i.standbyServerURL&&(e[1]=i.standbyServerURL),l.licenseServer=e,r=l.licenseServer,l.licenseServer=null}!s&&i.sessionPassword&&(s=i.sessionPassword),i.chargeWay&&(d=i.chargeWay),i.limitedLicenseModules&&(o=i.limitedLicenseModules)}}if(c&&(a?process.version<"v15"&&(e="To use online key requires nodejs version >= v15."):(_.crypto||(e="Please upgrade your browser to support online key."),_.crypto.subtle||(e="Require https to use online key in this browser."))),e){if(1!==c)throw new Error(e);c=0,console.warn(e),l._lastErrorCode=n.DMERR_FAILED_TO_REACH_LTS,l._lastErrorString=e}return 1===c&&(t="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((e,n)=>i(this,void 0,void 0,(function*(){switch(l._loadWasmStatus){case"unload":{l._loadWasmStatus="loading",a&&(yield l.engineResourcePath);let e=l.engineResourcePath+l._workerName;if(a||l.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),a){const t=yield import("worker_threads");l._dbrWorker=new t.Worker(e)}else l._dbrWorker=new Worker(e);l._dbrWorker.onerror=e=>{l._loadWasmStatus="loadFail";let t=new Error(e.message);l._loadWasmErr=t;for(let e of l._loadWasmCallbackArr)e(t);l._loadWasmCallbackArr=[]},l._dbrWorker.onmessage=e=>i(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":l._onLog&&l._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===c&&(e=!0),t.success){l._loadWasmStatus="loadSuccess",l._version=t.version+"(JS "+l._jsVersion+"."+l._jsEditVersion+")",l._onLog&&l._onLog("load dbr worker success");for(let e of l._loadWasmCallbackArr)e();l._loadWasmCallbackArr=[],l._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,l._loadWasmStatus="loadFail",l._loadWasmErr=i;for(let e of l._loadWasmCallbackArr)e(i);l._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&l.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{l._taskCallbackMap.get(e)(i),l._taskCallbackMap.delete(e)}catch(t){throw l._taskCallbackMap.delete(e),t}break}default:l._onLog&&l._onLog(e)}})),a&&l._dbrWorker.on("message",l._dbrWorker.onmessage),l._dbrWorker.postMessage({type:"loadWasm",bd:l._bWasmDebug,engineResourcePath:l.engineResourcePath,version:l._jsVersion,brtk:!!c,bptk:1===c,lcs:t,dm:!a&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:l._bUseFullFeature,browserInfo:l.browserInfo,deviceFriendlyName:l.deviceFriendlyName,ls:r,sp:s,lm:o,cw:d})}case"loading":l._loadWasmCallbackArr.push((t=>{t?n(t):e()}));break;case"loadSuccess":e();break;case"loadFail":n(l._loadWasmErr)}}))))}))}static showDialog(e,t){return i(this,void 0,void 0,(function*(){if(!a&&!l._bNeverShowDialog)try{let i=yield fetch(l.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let r=yield i.text();if(!r.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let n=document.createElement("div");n.innerHTML=r;let s=[];for(let e=0;e{if(i==e.target){o.remove();for(let e of s)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!_&&i.classList.contains("dls-license-icon-error"))_=i,"error"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-icon-warn"))c=i,"warn"!=e&&i.remove();else if(!u&&i.classList.contains("dls-license-msg-content")){u=i;let e=t;for(;e;){let t=e.indexOf("["),r=e.indexOf("]",t),n=e.indexOf("(",r),s=e.indexOf(")",n);if(-1==t||-1==r||-1==n||-1==s){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let o=document.createElement("a"),a=e.substring(t+1,r);o.innerText=a;let d=e.substring(n+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),i.appendChild(o),e=e.substring(s+1)}}document.body.appendChild(o)}catch(e){l._onLog&&l._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return i(this,void 0,void 0,(function*(){return yield l.loadWasm(),yield new Promise(((t,i)=>{let r=l._nextTaskID++;l._taskCallbackMap.set(r,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),l._dbrWorker.postMessage({type:"createInstance",id:r,bScanner:e})}))}))}static createInstance(){return i(this,void 0,void 0,(function*(){let e=new l;return e._instanceID=yield l.createInstanceInWorker(),e}))}decode(e){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("decode(source: any)"),l._onLog&&(this._timeStartDecode=Date.now()),a)return e instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e)):e instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(e):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e):"http"==e.substring(0,4)?yield this._decode_Url(e):yield this._decode_FilePath(e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,r,n,s,o){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,a)=>{let d=l._nextTaskID++;l._taskCallbackMap.set(d,(e=>{if(e.success){let t,r=l._onLog?Date.now():0;l._onLog&&l._onLog("worker return result: "+r),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(l._onLog){let e=Date.now();l._onLog("DBR time get result: "+r),l._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),l._onLog("DBR worker decode image cost: "+(r-this._timeEnterInnerDBR)),l._onLog("DBR worker handle results: "+(e-r)),l._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),l._onLog&&l._onLog("Send buffer to worker:"+Date.now()),l._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:r,stride:n,format:s,config:o}},[e.buffer]),l._onLog&&o&&o._timeEndGettingFrame&&l._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,r,n,s,o){return i(this,void 0,void 0,(function*(){l._onLog&&l._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const i=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let r=new FileReader;r.readAsArrayBuffer(e),r.onload=()=>{t(r.result)},r.onerror=()=>{i(r.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(i),t,r,n,s,o)}))}decodeBuffer(e,t,r,n,s,o){return i(this,void 0,void 0,(function*(){let i;return l._onLog&&l._onLog("decodeBuffer(buffer,width,height,stride,format)"),l._onLog&&(this._timeStartDecode=Date.now()),a?e instanceof Uint8Array?i=yield this._decodeBuffer_Uint8Array(e,t,r,n,s,o):e instanceof Buffer&&(i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,r,n,s,o)):e instanceof Uint8Array||e instanceof Uint8ClampedArray?i=yield this._decodeBuffer_Uint8Array(e,t,r,n,s,o):e instanceof ArrayBuffer?i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,r,n,s,o):e instanceof Blob&&(i=yield this._decodeBuffer_Blob(e,t,r,n,s,o)),i}))}_decodeFileInMemory_Uint8Array(e){return i(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let r=l._nextTaskID++;l._taskCallbackMap.set(r,(e=>{if(e.success){let r;this._lastInnerDecodeDuration=e.duration;try{r=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(r)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),l._dbrWorker.postMessage({type:"decodeFileInMemory",id:r,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=3,t.expectedBarcodesCount=0,t.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=5,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!l._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!a)if(this.bFilterRegionInJs){let e=t.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,t.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,i)=>{let r=l._nextTaskID++;l._taskCallbackMap.set(r,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),l._dbrWorker.postMessage({type:"updateRuntimeSettings",id:r,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})}))}))}resetRuntimeSettings(){return i(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return i(this,void 0,void 0,(function*(){if(!l._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return i(this,void 0,void 0,(function*(){if(!l._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let r=l._nextTaskID++;l._taskCallbackMap.set(r,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),l._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:r,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return i(this,void 0,void 0,(function*(){l._onLog&&l._onLog("_decode_Blob(blob: Blob)");let i=null,r=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(r=yield function(e){return new Promise(((t,i)=>{let r=URL.createObjectURL(e),n=new Image;n.dbrObjUrl=r,n.src=r,n.onload=()=>{t(n)},n.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let n=yield this._decode_Image(i||r,t);return i&&i.close(),n}))}_decode_ArrayBuffer(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return i(this,void 0,void 0,(function*(){l._onLog&&l._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,r,n=e instanceof HTMLImageElement?e.naturalWidth:e.width,s=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=Math.max(n,s);if(o>this._canvasMaxWH){let e=this._canvasMaxWH/o;i=Math.round(n*e),r=Math.round(s*e)}else i=n,r=s;let a,d=0,c=0,u=n,h=s,g=i,R=r,E=t.region;if(E){let e,t,o,a;E.regionMeasuredByPercentage?(e=E.regionLeft*i/100,t=E.regionTop*r/100,o=E.regionRight*i/100,a=E.regionBottom*r/100):(e=E.regionLeft,t=E.regionTop,o=E.regionRight,a=E.regionBottom),g=o-e,u=Math.round(g/i*n),R=a-t,h=Math.round(R/r*s),d=Math.round(e/i*n),c=Math.round(t/r*s)}!this.bSaveOriCanvas&&_.OffscreenCanvas?a=new OffscreenCanvas(g,R):(a=document.createElement("canvas"),a.width=g,a.height=R);let I,A=a.getContext("2d");0==d&&0==c&&n==u&&s==h&&n==g&&s==R?A.drawImage(e,0,0):A.drawImage(e,d,c,u,h,0,0,g,R),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),E?(I=JSON.parse(JSON.stringify(t)),delete I.region):I=t;let f=yield this._decode_Canvas(a,I);return l.fixResultLocationWhenFilterRegionInJs(E,f,d,c,u,h,g,R),f}))}_decode_Canvas(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=e);let i=(e.dbrCtx2d||e.getContext("2d")).getImageData(0,0,e.width,e.height).data;return yield this._decodeBuffer_Uint8Array(i,e.width,e.height,4*e.width,r.IPF_ABGR_8888,t)}))}_decode_Video(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};const i=e.videoWidth,r=e.videoHeight,n=Math.max(i,r);let s,o;if(n>this._canvasMaxWH){let e=this._canvasMaxWH/n;s=Math.round(i*e),o=Math.round(r*e)}else s=i,o=r;let a=0,d=0,c=i,u=r,h=i,g=r,R=t.region;if(R){let e,t,n,_;R.regionMeasuredByPercentage?(e=R.regionLeft*s/100,t=R.regionTop*o/100,n=R.regionRight*s/100,_=R.regionBottom*o/100):(e=R.regionLeft,t=R.regionTop,n=R.regionRight,_=R.regionBottom),h=n-e,c=Math.round(h/s*i),g=_-t,u=Math.round(g/o*r),a=Math.round(e/s*i),d=Math.round(t/o*r)}let E=0==a&&0==d&&i==c&&r==u&&i==h&&r==g,I=null;!this.bSaveOriCanvas&&_.OffscreenCanvas?I=new OffscreenCanvas(h,g):(I=document.createElement("canvas"),I.width=h,I.height=g);const A=I.dbrCtx2d=I.getContext("2d");let f;E?A.drawImage(e,0,0):A.drawImage(e,a,d,c,u,0,0,h,g),R?(f=JSON.parse(JSON.stringify(t)),delete f.region):f=t;let S=yield this._decode_Canvas(I,t);return R&&l.fixResultLocationWhenFilterRegionInJs(R,S,a,d,c,u,h,g),S}))}_decode_Base64(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1)),a){let t=Buffer.from(e,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t))}{let i=atob(e),r=i.length,n=new Uint8Array(r);for(;r--;)n[r]=i.charCodeAt(r);return yield this._decode_Blob(new Blob([n]),t)}}))}_decode_Url(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(e=e,a){let t=yield new Promise(((t,r)=>i(this,void 0,void 0,(function*(){(e.startsWith("https")?yield import("https"):yield import("http")).get(e,(e=>{if(200==e.statusCode){let i=[];e.on("data",(e=>{i.push(e)})).on("end",(()=>{t(new Uint8Array(Buffer.concat(i)))}))}else r("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(t)}{let r=yield new Promise(((t,r)=>{let n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.send(),n.onloadend=()=>i(this,void 0,void 0,(function*(){t(n.response)})),n.onerror=()=>{r(new Error("Network Error: "+n.statusText))}}));return yield this._decode_Blob(r,t)}}))}_decode_FilePath(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_FilePath(path)"),!a)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof e)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const t=yield import("fs");let i=yield new Promise(((i,r)=>{t.readFile(e,((e,t)=>{e?r(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,r,n,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/n,_=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+r,t.y2=t.y2/_+r,t.y3=t.y3/_+r,t.y4=t.y4/_+r,2==t.resultCoordinateType&&(t.x1*=100/n,t.x2*=100/n,t.x3*=100/n,t.x4*=100/n,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let i,r=n.DBR_UNKNOWN;return"number"==typeof e?(r=e,i=new Error(t)):i=new Error(e),i.code=r,i}_handleRetJsonString(e){let t=n;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!l._setWarnnedEx.has(e.description)&&(l._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw l.BarcodeReaderException(e.exception,e.description)}setModeArgument(e,t,r,n){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,s)=>{let o=l._nextTaskID++;l._taskCallbackMap.set(o,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return s(e)}return i()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,s(t)}})),l._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:r,argumentValue:n}})}))}))}getModeArgument(e,t,r){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,n)=>{let s=l._nextTaskID++;l._taskCallbackMap.set(s,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return n(e)}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,n(t)}})),l._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:r}})}))}))}getIntermediateResults(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return i(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),t=[];for(let i of e)if(i.dataType==s.IMRDT_IMAGE)for(let e of i.results){const i=e.bytes;let n;switch(l._onLog&&l._onLog(" "+i.length+" "+i.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case r.IPF_ABGR_8888:n=new Uint8ClampedArray(i);break;case r.IPF_RGB_888:{const e=i.length/3;n=new Uint8ClampedArray(4*e);for(let t=0;t{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}l._jsVersion="8.8.3",l._jsEditVersion="20211011",l._version="loading...(JS "+l._jsVersion+"."+l._jsEditVersion+")",l._license=a||d||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",l._sessionPassword=a||d||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",l.browserInfo=function(){if(!a&&!d){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{i(this,void 0,void 0,(function*(){const t=yield import("os");e.OS=t&&t.platform?t.platform()+t.release():"Unknown"}))})(),e}}(),l._workerName="dbr-"+l._jsVersion+".worker.js",l._engineResourcePath=(()=>{if(a){const e=import.meta.url;return new Promise((t=>i(void 0,void 0,void 0,(function*(){const i=yield import("url");"string"!=typeof l._engineResourcePath&&(l._engineResourcePath=i.fileURLToPath(e.substring(0,e.lastIndexOf("/")+1))),t()}))))}if(!d&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),l._licenseServer=[],l._deviceFriendlyName="",l._isShowRelDecodeTimeInResults=!1,l._bWasmDebug=!1,l._bNeverShowDialog=!1,l.__bUseFullFeature=!0,l._nextTaskID=0,l._taskCallbackMap=new Map,l._loadWasmStatus="unload",l._loadWasmCallbackArr=[],l._lastErrorCode=0,l._lastErrorString="",l._setWarnnedEx=new Set,l._loadWasmErr=null;const c=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class u extends l{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=u._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",l.engineResourcePath)}static set defaultUIElementURL(e){u._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return i(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{i(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return i(this,void 0,void 0,(function*(){this.dce||(l._onLog&&l._onLog("createDCEInstance()"),t.defaultUIElementURL=null,this.dce=yield t.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>i(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return i(this,void 0,void 0,(function*(){if(c)throw new Error("`BarcodeScanner` is not supported in Node.js.");let t=new u;yield t.createDCEInstance(),t._instanceID=yield u.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(u.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,r,n,s){return super.decodeBuffer(e,t,i,r,n,s)}decodeCurrentFrame(e){return i(this,void 0,void 0,(function*(){this._assertOpen();let t=null;e&&e.region&&(t=e.region);let i=this.dce.getFrame(t);if(i&&null===i.canvas){let{data:e,width:t,height:n}=i;return yield this._decodeBuffer_Uint8Array(e,t,n,t,r.IPF_GrayScaled)}if(i&&i.canvas){let{data:e,canvas:t,region:n,sx:s,sy:o,sWidth:a,sHeight:d}=i;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let _=yield this._decodeBuffer_Uint8Array(e,t.width,t.height,4*t.width,r.IPF_ABGR_8888);return l.fixResultLocationWhenFilterRegionInJs(n,_,s,o,a,d,t.width,t.height),_}}))}clearMapDecodeRecord(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(u.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionSinglePreset(e.region)||(t.region=e.region)}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=3,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0],t.timeout=1e5}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=5,t.expectedBarcodesCount=512,t.scaleDownThreshold=1e5,t.localizationModes=[2,16,4,8,0,0,0,0],t.timeout=1e5}else if("single"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionNormalPreset(e.region)?t.region=JSON.parse(JSON.stringify(u.singlePresetRegion)):t.region=e.region,t.expectedBarcodesCount=1,t.localizationModes=[16,2,0,0,0,0,0,0],t.barcodeZoneMinDistanceToImageBorders=0}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let i=e.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!l._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=t.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let r=l._nextTaskID++;l._taskCallbackMap.set(r,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),l._dbrWorker.postMessage({type:"updateRuntimeSettings",id:r,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})})),"single"==e&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");this.dce._bindUI();let t=[e],i=e.children;for(let e of i)t.push(e);for(let e=0;e{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),l._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return i(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let r=l._nextTaskID++;l._taskCallbackMap.set(r,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),u._dbrWorker.postMessage({type:"updateScanSettings",id:r,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,r){return i(this,void 0,void 0,(function*(){return this.dce.play(e,t,r)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return i(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return i(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return i(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return i(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return i(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return i(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return l._onLog&&l._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),l._onLog&&l._onLog("======= once read ======="),l._onLog&&(this._timeStartDecode=Date.now());let e=this._getVideoFrame();if(!e)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>i(this,void 0,void 0,(function*(){if(e&&null===e.canvas){let{data:t,width:i,height:n,timeStamp:s}=e,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(t,i,n,i,r.IPF_GrayScaled,o)}if(e&&e.canvas){let{data:t,canvas:i,region:n,sx:s,sy:o,width:a,height:d,timeStamp:_}=e,c={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let u=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,r.IPF_ABGR_8888,c);return l.fixResultLocationWhenFilterRegionInJs(n,u,s,o,i.width,i.height,a,d),u}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{l._onLog&&l._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,r=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[r]&&t[r]instanceof Array||(t[r]=[]);t[r].length>=5;)t[r].shift();t[r].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let n=0,s=0;n=r+1>=this.region.length?0:r+1,s=n+1>=this.region.length?0:n+1,e=t[n]&&t[n].length&&i[s]&&i[s].length?Math.min(...t[n])-Math.max(...i[s]):0}else if(i&&i.length){let r=Math.min(...t),n=Math.max(...i);r&&n&&(e=r-n)}else e=0;return e>0?e:0})(),this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),l._onLog&&l._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,r;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,r=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,r=this.dce.video.videoHeight}let n=this.region;if(n&&(!n.regionLeft&&!n.regionRight&&!n.regionTop&&!n.regionBottom&&!n.regionMeasuredByPercentage||n instanceof Array?n=null:n.regionMeasuredByPercentage?n=n.regionLeft||n.regionRight||100!==n.regionTop||100!==n.regionBottom?{regionLeft:Math.round(n.regionLeft/100*i),regionTop:Math.round(n.regionTop/100*r),regionRight:Math.round(n.regionRight/100*i),regionBottom:Math.round(n.regionBottom/100*r)}:null:(n=JSON.parse(JSON.stringify(n)),delete n.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=r;let o=s.getContext("2d");if(n){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(n.regionLeft-e,n.regionTop-e,n.regionRight-n.regionLeft+2*e,n.regionBottom-n.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(n.regionLeft,n.regionTop,n.regionRight-n.regionLeft,n.regionBottom-n.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return i(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var h,g,R,E,I,A,f,S,D,m,T,M,C,L,y,O,N,B,p,v,b,F,P,w,V,U,k;u._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",u.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(h||(h={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(g||(g={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(R||(R={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(E||(E={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(I||(I={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(A||(A={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(f||(f={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(S||(S={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(D||(D={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(m||(m={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(T||(T={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(M||(M={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(C||(C={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(L||(L={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(y||(y={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(O||(O={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(N||(N={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(B||(B={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(p||(p={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(v||(v={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(b||(b={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(F||(F={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(P||(P={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(w||(w={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(V||(V={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(U||(U={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(k||(k={}));class G{static get version(){return l.version}static get productKeys(){return l.productKeys}static set productKeys(e){l.productKeys=e}static get handshakeCode(){return l.handshakeCode}static set handshakeCode(e){l.handshakeCode=e}static get organizationID(){return l.organizationID}static set organizationID(e){l.organizationID=e}static get sessionPassword(){return l.sessionPassword}static set sessionPassword(e){l.sessionPassword=e}static get browserInfo(){return l.browserInfo}static detectEnvironment(){return l.detectEnvironment()}static get _workerName(){return l._workerName}static set _workerName(e){l._workerName=e}static get engineResourcePath(){return l.engineResourcePath}static set engineResourcePath(e){l.engineResourcePath=e}static get licenseServer(){return l.licenseServer}static set licenseServer(e){l.licenseServer=e}static get deviceFriendlyName(){return l.deviceFriendlyName}static set deviceFriendlyName(e){l.deviceFriendlyName=e}static get _onLog(){return l._onLog}static set _onLog(e){l._onLog=e}static get _bWasmDebug(){return l._bWasmDebug}static set _bWasmDebug(e){l._bWasmDebug=e}static get _bUseFullFeature(){return l._bUseFullFeature}static set _bUseFullFeature(e){l._bUseFullFeature=e}static get _dbrWorker(){return l._dbrWorker}static isLoaded(){return l.isLoaded()}static isWasmLoaded(){return l.isLoaded()}static loadWasm(){return l.loadWasm()}}G.DBR=G,G.BarcodeReader=l,G.BarcodeScanner=u,G.CameraEnhancer=e,G.EnumBarcodeColourMode=h,G.EnumBarcodeComplementMode=g,G.EnumBarcodeFormat=o,G.EnumBarcodeFormat_2=R,G.EnumBinarizationMode=E,G.EnumClarityCalculationMethod=I,G.EnumClarityFilterMode=A,G.EnumColourClusteringMode=f,G.EnumColourConversionMode=S,G.EnumConflictMode=D,G.EnumDeblurMode=m,G.EnumDeformationResistingMode=T,G.EnumDPMCodeReadingMode=M,G.EnumErrorCode=n,G.EnumGrayscaleTransformationMode=C,G.EnumImagePixelFormat=r,G.EnumImagePreprocessingMode=L,G.EnumIMResultDataType=s,G.EnumIntermediateResultSavingMode=y,G.EnumIntermediateResultType=O,G.EnumLocalizationMode=N,G.EnumPDFReadingMode=B,G.EnumQRCodeErrorCorrectionLevel=p,G.EnumRegionPredetectionMode=v,G.EnumResultCoordinateType=b,G.EnumResultType=F,G.EnumScaleUpMode=P,G.EnumTerminatePhase=w,G.EnumTextFilterMode=V,G.EnumTextResultOrderMode=U,G.EnumTextureDetectionMode=k;export{l as BarcodeReader,u as BarcodeScanner,G as DBR,h as EnumBarcodeColourMode,g as EnumBarcodeComplementMode,o as EnumBarcodeFormat,R as EnumBarcodeFormat_2,E as EnumBinarizationMode,I as EnumClarityCalculationMethod,A as EnumClarityFilterMode,f as EnumColourClusteringMode,S as EnumColourConversionMode,D as EnumConflictMode,M as EnumDPMCodeReadingMode,m as EnumDeblurMode,T as EnumDeformationResistingMode,n as EnumErrorCode,C as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,r as EnumImagePixelFormat,L as EnumImagePreprocessingMode,y as EnumIntermediateResultSavingMode,O as EnumIntermediateResultType,N as EnumLocalizationMode,B as EnumPDFReadingMode,p as EnumQRCodeErrorCorrectionLevel,v as EnumRegionPredetectionMode,b as EnumResultCoordinateType,F as EnumResultType,P as EnumScaleUpMode,w as EnumTerminatePhase,V as EnumTextFilterMode,U as EnumTextResultOrderMode,k as EnumTextureDetectionMode,G as default}; +import e,{CameraEnhancer as t}from"dynamsoft-camera-enhancer";export{default as CameraEnhancer}from"dynamsoft-camera-enhancer";function i(e,t,i,n){return new(i||(i=Promise))((function(r,s){function o(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}d((n=n.apply(e,t||[])).next())}))}var n,r,s,o;!function(e){e[e.IPF_Binary=0]="IPF_Binary",e[e.IPF_BinaryInverted=1]="IPF_BinaryInverted",e[e.IPF_GrayScaled=2]="IPF_GrayScaled",e[e.IPF_NV21=3]="IPF_NV21",e[e.IPF_RGB_565=4]="IPF_RGB_565",e[e.IPF_RGB_555=5]="IPF_RGB_555",e[e.IPF_RGB_888=6]="IPF_RGB_888",e[e.IPF_ARGB_8888=7]="IPF_ARGB_8888",e[e.IPF_RGB_161616=8]="IPF_RGB_161616",e[e.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",e[e.IPF_ABGR_8888=10]="IPF_ABGR_8888",e[e.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",e[e.IPF_BGR_888=12]="IPF_BGR_888"}(n||(n={})),function(e){e[e.DBR_SYSTEM_EXCEPTION=1]="DBR_SYSTEM_EXCEPTION",e[e.DBR_SUCCESS=0]="DBR_SUCCESS",e[e.DBR_UNKNOWN=-1e4]="DBR_UNKNOWN",e[e.DBR_NO_MEMORY=-10001]="DBR_NO_MEMORY",e[e.DBR_NULL_REFERENCE=-10002]="DBR_NULL_REFERENCE",e[e.DBR_LICENSE_INVALID=-10003]="DBR_LICENSE_INVALID",e[e.DBR_LICENSE_EXPIRED=-10004]="DBR_LICENSE_EXPIRED",e[e.DBR_FILE_NOT_FOUND=-10005]="DBR_FILE_NOT_FOUND",e[e.DBR_FILETYPE_NOT_SUPPORTED=-10006]="DBR_FILETYPE_NOT_SUPPORTED",e[e.DBR_BPP_NOT_SUPPORTED=-10007]="DBR_BPP_NOT_SUPPORTED",e[e.DBR_INDEX_INVALID=-10008]="DBR_INDEX_INVALID",e[e.DBR_BARCODE_FORMAT_INVALID=-10009]="DBR_BARCODE_FORMAT_INVALID",e[e.DBR_CUSTOM_REGION_INVALID=-10010]="DBR_CUSTOM_REGION_INVALID",e[e.DBR_MAX_BARCODE_NUMBER_INVALID=-10011]="DBR_MAX_BARCODE_NUMBER_INVALID",e[e.DBR_IMAGE_READ_FAILED=-10012]="DBR_IMAGE_READ_FAILED",e[e.DBR_TIFF_READ_FAILED=-10013]="DBR_TIFF_READ_FAILED",e[e.DBR_QR_LICENSE_INVALID=-10016]="DBR_QR_LICENSE_INVALID",e[e.DBR_1D_LICENSE_INVALID=-10017]="DBR_1D_LICENSE_INVALID",e[e.DBR_DIB_BUFFER_INVALID=-10018]="DBR_DIB_BUFFER_INVALID",e[e.DBR_PDF417_LICENSE_INVALID=-10019]="DBR_PDF417_LICENSE_INVALID",e[e.DBR_DATAMATRIX_LICENSE_INVALID=-10020]="DBR_DATAMATRIX_LICENSE_INVALID",e[e.DBR_PDF_READ_FAILED=-10021]="DBR_PDF_READ_FAILED",e[e.DBR_PDF_DLL_MISSING=-10022]="DBR_PDF_DLL_MISSING",e[e.DBR_PAGE_NUMBER_INVALID=-10023]="DBR_PAGE_NUMBER_INVALID",e[e.DBR_CUSTOM_SIZE_INVALID=-10024]="DBR_CUSTOM_SIZE_INVALID",e[e.DBR_CUSTOM_MODULESIZE_INVALID=-10025]="DBR_CUSTOM_MODULESIZE_INVALID",e[e.DBR_RECOGNITION_TIMEOUT=-10026]="DBR_RECOGNITION_TIMEOUT",e[e.DBR_JSON_PARSE_FAILED=-10030]="DBR_JSON_PARSE_FAILED",e[e.DBR_JSON_TYPE_INVALID=-10031]="DBR_JSON_TYPE_INVALID",e[e.DBR_JSON_KEY_INVALID=-10032]="DBR_JSON_KEY_INVALID",e[e.DBR_JSON_VALUE_INVALID=-10033]="DBR_JSON_VALUE_INVALID",e[e.DBR_JSON_NAME_KEY_MISSING=-10034]="DBR_JSON_NAME_KEY_MISSING",e[e.DBR_JSON_NAME_VALUE_DUPLICATED=-10035]="DBR_JSON_NAME_VALUE_DUPLICATED",e[e.DBR_TEMPLATE_NAME_INVALID=-10036]="DBR_TEMPLATE_NAME_INVALID",e[e.DBR_JSON_NAME_REFERENCE_INVALID=-10037]="DBR_JSON_NAME_REFERENCE_INVALID",e[e.DBR_PARAMETER_VALUE_INVALID=-10038]="DBR_PARAMETER_VALUE_INVALID",e[e.DBR_DOMAIN_NOT_MATCHED=-10039]="DBR_DOMAIN_NOT_MATCHED",e[e.DBR_RESERVEDINFO_NOT_MATCHED=-10040]="DBR_RESERVEDINFO_NOT_MATCHED",e[e.DBR_AZTEC_LICENSE_INVALID=-10041]="DBR_AZTEC_LICENSE_INVALID",e[e.DBR_LICENSE_DLL_MISSING=-10042]="DBR_LICENSE_DLL_MISSING",e[e.DBR_LICENSEKEY_NOT_MATCHED=-10043]="DBR_LICENSEKEY_NOT_MATCHED",e[e.DBR_REQUESTED_FAILED=-10044]="DBR_REQUESTED_FAILED",e[e.DBR_LICENSE_INIT_FAILED=-10045]="DBR_LICENSE_INIT_FAILED",e[e.DBR_PATCHCODE_LICENSE_INVALID=-10046]="DBR_PATCHCODE_LICENSE_INVALID",e[e.DBR_POSTALCODE_LICENSE_INVALID=-10047]="DBR_POSTALCODE_LICENSE_INVALID",e[e.DBR_DPM_LICENSE_INVALID=-10048]="DBR_DPM_LICENSE_INVALID",e[e.DBR_FRAME_DECODING_THREAD_EXISTS=-10049]="DBR_FRAME_DECODING_THREAD_EXISTS",e[e.DBR_STOP_DECODING_THREAD_FAILED=-10050]="DBR_STOP_DECODING_THREAD_FAILED",e[e.DBR_SET_MODE_ARGUMENT_ERROR=-10051]="DBR_SET_MODE_ARGUMENT_ERROR",e[e.DBR_LICENSE_CONTENT_INVALID=-10052]="DBR_LICENSE_CONTENT_INVALID",e[e.DBR_LICENSE_KEY_INVALID=-10053]="DBR_LICENSE_KEY_INVALID",e[e.DBR_LICENSE_DEVICE_RUNS_OUT=-10054]="DBR_LICENSE_DEVICE_RUNS_OUT",e[e.DBR_GET_MODE_ARGUMENT_ERROR=-10055]="DBR_GET_MODE_ARGUMENT_ERROR",e[e.DBR_IRT_LICENSE_INVALID=-10056]="DBR_IRT_LICENSE_INVALID",e[e.DBR_MAXICODE_LICENSE_INVALID=-10057]="DBR_MAXICODE_LICENSE_INVALID",e[e.DBR_GS1_DATABAR_LICENSE_INVALID=-10058]="DBR_GS1_DATABAR_LICENSE_INVALID",e[e.DBR_GS1_COMPOSITE_LICENSE_INVALID=-10059]="DBR_GS1_COMPOSITE_LICENSE_INVALID",e[e.DBR_DOTCODE_LICENSE_INVALID=-10061]="DBR_DOTCODE_LICENSE_INVALID",e[e.DMERR_NO_LICENSE=-2e4]="DMERR_NO_LICENSE",e[e.DMERR_LICENSE_SYNC_FAILED=-20003]="DMERR_LICENSE_SYNC_FAILED",e[e.DMERR_TRIAL_LICENSE=-20010]="DMERR_TRIAL_LICENSE",e[e.DMERR_FAILED_TO_REACH_LTS=-20200]="DMERR_FAILED_TO_REACH_LTS"}(r||(r={})),function(e){e[e.IMRDT_IMAGE=1]="IMRDT_IMAGE",e[e.IMRDT_CONTOUR=2]="IMRDT_CONTOUR",e[e.IMRDT_LINESEGMENT=4]="IMRDT_LINESEGMENT",e[e.IMRDT_LOCALIZATIONRESULT=8]="IMRDT_LOCALIZATIONRESULT",e[e.IMRDT_REGIONOFINTEREST=16]="IMRDT_REGIONOFINTEREST",e[e.IMRDT_QUADRILATERAL=32]="IMRDT_QUADRILATERAL"}(s||(s={})),function(e){e[e.BF_ALL=-31457281]="BF_ALL",e[e.BF_ONED=1050623]="BF_ONED",e[e.BF_GS1_DATABAR=260096]="BF_GS1_DATABAR",e[e.BF_CODE_39=1]="BF_CODE_39",e[e.BF_CODE_128=2]="BF_CODE_128",e[e.BF_CODE_93=4]="BF_CODE_93",e[e.BF_CODABAR=8]="BF_CODABAR",e[e.BF_ITF=16]="BF_ITF",e[e.BF_EAN_13=32]="BF_EAN_13",e[e.BF_EAN_8=64]="BF_EAN_8",e[e.BF_UPC_A=128]="BF_UPC_A",e[e.BF_UPC_E=256]="BF_UPC_E",e[e.BF_INDUSTRIAL_25=512]="BF_INDUSTRIAL_25",e[e.BF_CODE_39_EXTENDED=1024]="BF_CODE_39_EXTENDED",e[e.BF_GS1_DATABAR_OMNIDIRECTIONAL=2048]="BF_GS1_DATABAR_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_TRUNCATED=4096]="BF_GS1_DATABAR_TRUNCATED",e[e.BF_GS1_DATABAR_STACKED=8192]="BF_GS1_DATABAR_STACKED",e[e.BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL=16384]="BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL",e[e.BF_GS1_DATABAR_EXPANDED=32768]="BF_GS1_DATABAR_EXPANDED",e[e.BF_GS1_DATABAR_EXPANDED_STACKED=65536]="BF_GS1_DATABAR_EXPANDED_STACKED",e[e.BF_GS1_DATABAR_LIMITED=131072]="BF_GS1_DATABAR_LIMITED",e[e.BF_PATCHCODE=262144]="BF_PATCHCODE",e[e.BF_PDF417=33554432]="BF_PDF417",e[e.BF_QR_CODE=67108864]="BF_QR_CODE",e[e.BF_DATAMATRIX=134217728]="BF_DATAMATRIX",e[e.BF_AZTEC=268435456]="BF_AZTEC",e[e.BF_MAXICODE=536870912]="BF_MAXICODE",e[e.BF_MICRO_QR=1073741824]="BF_MICRO_QR",e[e.BF_MICRO_PDF417=524288]="BF_MICRO_PDF417",e[e.BF_GS1_COMPOSITE=-2147483648]="BF_GS1_COMPOSITE",e[e.BF_MSI_CODE=1048576]="BF_MSI_CODE",e[e.BF_NULL=0]="BF_NULL"}(o||(o={}));const a=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement),d=!a&&"undefined"==typeof self,_=a?global:d?{}:self;class l{constructor(){this._canvasMaxWH="iPhone"==l.browserInfo.OS||"Android"==l.browserInfo.OS?2048:4096,this._instanceID=void 0,this.bSaveOriCanvas=!1,this.oriCanvas=null,this.bFilterRegionInJs=!0,this._region=null,this._timeStartDecode=null,this._timeEnterInnerDBR=null,this._timeGetMessage=null,this._bUseWebgl=!0,this.decodeRecords={},this.bDestroyed=!1,this._lastErrorCode=0,this._lastErrorString="",this._lastInnerDecodeDuration=0}static get version(){return this._version}static get license(){return this._license}static set license(e){if("unload"!=this._loadWasmStatus)throw new Error("`license` is not allowed to change after `createInstance` or `loadWasm` is called.");l._license=e}static get productKeys(){return this._license}static set productKeys(e){l.license=e}static get handshakeCode(){return this._license}static set handshakeCode(e){l.license=e}static get organizationID(){return this._license}static set organizationID(e){l.license=e}static set sessionPassword(e){if("unload"!=this._loadWasmStatus)throw new Error("`sessionPassword` is not allowed to change after `createInstance` or `loadWasm` is called.");l._sessionPassword=e}static get sessionPassword(){return this._sessionPassword}static detectEnvironment(){return i(this,void 0,void 0,(function*(){let e={wasm:"undefined"!=typeof WebAssembly&&("undefined"==typeof navigator||!(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&/\(.+\s11_2_([2-6]).*\)/.test(navigator.userAgent))),worker:!!(a?process.version>="v12":"undefined"!=typeof Worker),getUserMedia:!("undefined"==typeof navigator||!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia),camera:!1,browser:this.browserInfo.browser,version:this.browserInfo.version,OS:this.browserInfo.OS};if(e.getUserMedia)try{(yield navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e.camera=!0}catch(e){}return e}))}static get engineResourcePath(){return this._engineResourcePath}static set engineResourcePath(e){if("unload"!=this._loadWasmStatus)throw new Error("`engineResourcePath` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e&&(e="./"),a||d)l._engineResourcePath=e;else{let t=document.createElement("a");t.href=e,l._engineResourcePath=t.href}this._engineResourcePath.endsWith("/")||(l._engineResourcePath+="/")}static get licenseServer(){return this._licenseServer}static set licenseServer(e){if("unload"!=this._loadWasmStatus)throw new Error("`licenseServer` is not allowed to change after `createInstance` or `loadWasm` is called.");if(null==e)l._licenseServer=[];else{e instanceof Array||(e=[e]);for(let t=0;t= v12.");let e,t=l._license,n=JSON.parse(JSON.stringify(l._licenseServer)),s=l._sessionPassword,o=null,d=null,c=0;if(t.startsWith("t")||t.startsWith("f"))c=0;else if(0===t.length||t.startsWith("P")||t.startsWith("L"))c=1;else{c=2;const e=t.indexOf(":");if(-1!=e&&(t=t.substring(e+1)),t.startsWith("DLS2")){let e=t.substring(4);e=a?Buffer.from(e,"base64").toString("binary"):atob(e);const i=JSON.parse(e);if(i.handshakeCode?t=i.handshakeCode:i.organizationID&&(t=i.organizationID),"number"==typeof t&&(t=JSON.stringify(t)),t||(t=""),0===n.length){let e=[];i.mainServerURL&&(e[0]=i.mainServerURL),i.standbyServerURL&&(e[1]=i.standbyServerURL),l.licenseServer=e,n=l.licenseServer}!s&&i.sessionPassword&&(s=i.sessionPassword),i.chargeWay&&(d=i.chargeWay),i.limitedLicenseModules&&(o=i.limitedLicenseModules)}}if(c&&(a?process.version<"v15"&&(e="To use online key requires nodejs version >= v15."):(_.crypto||(e="Please upgrade your browser to support online key."),_.crypto.subtle||(e="Require https to use online key in this browser."))),e){if(1!==c)throw new Error(e);c=0,console.warn(e),l._lastErrorCode=r.DMERR_FAILED_TO_REACH_LTS,l._lastErrorString=e}return 1===c&&(t="",console.warn("Automatically apply for a public trial license.")),yield new Promise(((e,r)=>i(this,void 0,void 0,(function*(){switch(l._loadWasmStatus){case"unload":{l._loadWasmStatus="loading";let e=l.engineResourcePath+l._workerName;if(a||l.engineResourcePath.startsWith(location.origin)||(e=yield fetch(e).then((e=>e.blob())).then((e=>URL.createObjectURL(e)))),a){const t=yield import("worker_threads");l._dbrWorker=new t.Worker(e)}else l._dbrWorker=new Worker(e);l._dbrWorker.onerror=e=>{l._loadWasmStatus="loadFail";let t=new Error(e.message);l._loadWasmErr=t;for(let e of l._loadWasmCallbackArr)e(t);l._loadWasmCallbackArr=[]},l._dbrWorker.onmessage=e=>i(this,void 0,void 0,(function*(){let t=e.data?e.data:e;switch(t.type){case"log":l._onLog&&l._onLog(t.message);break;case"load":{t.message&&(t.message=t.message.replace("(https://www.dynamsoft.com/purchase-center/)","(https://www.dynamsoft.com/store/dynamsoft-barcode-reader/#javascript)"));let e=!1;if(1===c&&(e=!0),t.success){l._loadWasmStatus="loadSuccess",l._version=t.version+"(JS "+l._jsVersion+"."+l._jsEditVersion+")",l._onLog&&l._onLog("load dbr worker success");for(let e of l._loadWasmCallbackArr)e();l._loadWasmCallbackArr=[],l._dbrWorker.onerror=null,t.message&&console.warn(t.message)}else{let i=new Error(t.message);i.stack=t.stack+"\n"+i.stack,l._loadWasmStatus="loadFail",l._loadWasmErr=i;for(let e of l._loadWasmCallbackArr)e(i);l._loadWasmCallbackArr=[],e||111==t.ltsErrorCode&&-1!=t.message.toLowerCase().indexOf("trial license")&&(e=!0)}e&&l.showDialog(t.success?"warn":"error",t.message);break}case"task":{let e=t.id,i=t.body;try{l._taskCallbackMap.get(e)(i),l._taskCallbackMap.delete(e)}catch(t){throw l._taskCallbackMap.delete(e),t}break}default:l._onLog&&l._onLog(e)}})),a&&l._dbrWorker.on("message",l._dbrWorker.onmessage),l._dbrWorker.postMessage({type:"loadWasm",bd:l._bWasmDebug,engineResourcePath:l.engineResourcePath,version:l._jsVersion,brtk:!!c,bptk:1===c,lcs:t,dm:!a&&location.origin.startsWith("http")?location.origin:"https://localhost",bUseFullFeature:l._bUseFullFeature,browserInfo:l.browserInfo,deviceFriendlyName:l.deviceFriendlyName,ls:n,sp:s,lm:o,cw:d})}case"loading":l._loadWasmCallbackArr.push((t=>{t?r(t):e()}));break;case"loadSuccess":e();break;case"loadFail":r(l._loadWasmErr)}}))))}))}static showDialog(e,t){return i(this,void 0,void 0,(function*(){if(!a&&!l._bNeverShowDialog)try{let i=yield fetch(l.engineResourcePath+"dls.license.dialog.html");if(!i.ok)throw Error("Get license dialog fail. Network Error: "+i.statusText);let n=yield i.text();if(!n.trim().startsWith("<"))throw Error("Get license dialog fail. Can't get valid HTMLElement.");let r=document.createElement("div");r.innerHTML=n;let s=[];for(let e=0;e{if(i==e.target){o.remove();for(let e of s)e.remove()}}));else if(!d&&i.classList.contains("dls-license-icon-close"))d=i,i.addEventListener("click",(()=>{o.remove();for(let e of s)e.remove()}));else if(!_&&i.classList.contains("dls-license-icon-error"))_=i,"error"!=e&&i.remove();else if(!c&&i.classList.contains("dls-license-icon-warn"))c=i,"warn"!=e&&i.remove();else if(!u&&i.classList.contains("dls-license-msg-content")){u=i;let e=t;for(;e;){let t=e.indexOf("["),n=e.indexOf("]",t),r=e.indexOf("(",n),s=e.indexOf(")",r);if(-1==t||-1==n||-1==r||-1==s){i.appendChild(new Text(e));break}t>0&&i.appendChild(new Text(e.substring(0,t)));let o=document.createElement("a"),a=e.substring(t+1,n);o.innerText=a;let d=e.substring(r+1,s);o.setAttribute("href",d),o.setAttribute("target","_blank"),i.appendChild(o),e=e.substring(s+1)}}document.body.appendChild(o)}catch(e){l._onLog&&l._onLog(e.message||e)}}))}static createInstanceInWorker(e=!1){return i(this,void 0,void 0,(function*(){return yield l.loadWasm(),yield new Promise(((t,i)=>{let n=l._nextTaskID++;l._taskCallbackMap.set(n,(e=>{if(e.success)return t(e.instanceID);{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),l._dbrWorker.postMessage({type:"createInstance",id:n,bScanner:e})}))}))}static createInstance(){return i(this,void 0,void 0,(function*(){let e=new l;return e._instanceID=yield l.createInstanceInWorker(),e}))}decode(e){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("decode(source: any)"),l._onLog&&(this._timeStartDecode=Date.now()),a)return e instanceof Buffer?yield this._decodeFileInMemory_Uint8Array(new Uint8Array(e)):e instanceof Uint8Array?yield this._decodeFileInMemory_Uint8Array(e):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e):"http"==e.substring(0,4)?yield this._decode_Url(e):yield this._decode_FilePath(e):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Buffer', 'Uint8Array', 'String(base64 with image mime)' or 'String(url)'."));{let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),e instanceof Blob?yield this._decode_Blob(e,t):e instanceof ArrayBuffer?yield this._decode_ArrayBuffer(e,t):e instanceof Uint8Array||e instanceof Uint8ClampedArray?yield this._decode_Uint8Array(e,t):e instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?yield this._decode_Image(e,t):e instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?yield this._decode_Canvas(e,t):e instanceof HTMLVideoElement?yield this._decode_Video(e,t):"string"==typeof e?"data:image/"==e.substring(0,11)?yield this._decode_Base64(e,t):yield this._decode_Url(e,t):yield Promise.reject(TypeError("'_decode(source, config)': Type of 'source' should be 'Blob', 'ArrayBuffer', 'Uint8Array', 'HTMLImageElement', 'HTMLCanvasElement', 'HTMLVideoElement', 'String(base64 with image mime)' or 'String(url)'."))}}))}decodeBase64String(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Base64(e,t)}))}decodeUrl(e){return i(this,void 0,void 0,(function*(){let t={};return!this.region||this.region instanceof Array||(t.region=JSON.parse(JSON.stringify(this.region))),this._decode_Url(e,t)}))}_decodeBuffer_Uint8Array(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,a)=>{let d=l._nextTaskID++;l._taskCallbackMap.set(d,(e=>{if(e.success){let t,n=l._onLog?Date.now():0;l._onLog&&l._onLog("worker return result: "+n),this._lastInnerDecodeDuration=e.duration;try{t=this._handleRetJsonString(e.decodeReturn)}catch(e){return a(e)}if(l._onLog){let e=Date.now();l._onLog("DBR time get result: "+n),l._onLog("Handle image cost: "+(this._timeEnterInnerDBR-this._timeStartDecode)),l._onLog("DBR worker decode image cost: "+(n-this._timeEnterInnerDBR)),l._onLog("DBR worker handle results: "+(e-n)),l._onLog("Total decode image cost: "+(e-this._timeStartDecode))}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,a(t)}})),this._timeEnterInnerDBR=Date.now(),l._onLog&&l._onLog("Send buffer to worker:"+this._timeEnterInnerDBR),l._dbrWorker.postMessage({type:"decodeBuffer",id:d,instanceID:this._instanceID,body:{buffer:e,width:t,height:n,stride:r,format:s,config:o}},[e.buffer]),l._onLog&&o&&o._timeEndGettingFrame&&l._onLog("decode image delay: "+(this._timeEnterInnerDBR-o._timeEndGettingFrame))}))}))}_decodeBuffer_Blob(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){l._onLog&&l._onLog("_decodeBuffer_Blob(buffer,width,height,stride,format)");const i=e.arrayBuffer?yield e.arrayBuffer():yield new Promise(((t,i)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onload=()=>{t(n.result)},n.onerror=()=>{i(n.error)}}));return yield this._decodeBuffer_Uint8Array(new Uint8Array(i),t,n,r,s,o)}))}decodeBuffer(e,t,n,r,s,o){return i(this,void 0,void 0,(function*(){let i;return l._onLog&&l._onLog("decodeBuffer(buffer,width,height,stride,format)"),l._onLog&&(this._timeStartDecode=Date.now()),a?e instanceof Uint8Array?i=yield this._decodeBuffer_Uint8Array(e,t,n,r,s,o):e instanceof Buffer&&(i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,n,r,s,o)):e instanceof Uint8Array||e instanceof Uint8ClampedArray?i=yield this._decodeBuffer_Uint8Array(e,t,n,r,s,o):e instanceof ArrayBuffer?i=yield this._decodeBuffer_Uint8Array(new Uint8Array(e),t,n,r,s,o):e instanceof Blob&&(i=yield this._decodeBuffer_Blob(e,t,n,r,s,o)),i}))}_decodeFileInMemory_Uint8Array(e){return i(this,void 0,void 0,(function*(){return yield new Promise(((t,i)=>{let n=l._nextTaskID++;l._taskCallbackMap.set(n,(e=>{if(e.success){let n;this._lastInnerDecodeDuration=e.duration;try{n=this._handleRetJsonString(e.decodeReturn)}catch(e){return i(e)}return t(n)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),l._dbrWorker.postMessage({type:"decodeFileInMemory",id:n,instanceID:this._instanceID,body:{bytes:e}})}))}))}getRuntimeSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success){let t=JSON.parse(i.results);return null!=this.userDefinedRegion&&(t.region=JSON.parse(JSON.stringify(this.userDefinedRegion))),e(t)}{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"getRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=3,t.expectedBarcodesCount=0,t.localizationModes=[2,0,0,0,0,0,0,0]}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region,t.deblurLevel=5,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0]}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,t.region=e.region}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let e=t.region;[e.regionLeft,e.regionTop,e.regionLeft,e.regionBottom,e.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:e.regionLeft||0,regionTop:e.regionTop||0,regionRight:e.regionRight||0,regionBottom:e.regionBottom||0,regionMeasuredByPercentage:e.regionMeasuredByPercentage||0})}}if(!l._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}if(!a)if(this.bFilterRegionInJs){let e=t.region;if(e instanceof Array)throw Error("The `region` of type `Array` is only allowed in `BarcodeScanner`.");this.userDefinedRegion=JSON.parse(JSON.stringify(e)),(e.regionLeft||e.regionTop||e.regionRight||e.regionBottom||e.regionMeasuredByPercentage)&&(e.regionLeft||e.regionTop||100!=e.regionRight||100!=e.regionBottom||!e.regionMeasuredByPercentage)?this.region=e:this.region=null,t.region={regionLeft:0,regionTop:0,regionRight:0,regionBottom:0,regionMeasuredByPercentage:0}}else this.userDefinedRegion=null,this.region=null;return yield new Promise(((e,i)=>{let n=l._nextTaskID++;l._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),l._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})}))}))}resetRuntimeSettings(){return i(this,void 0,void 0,(function*(){return this.userDefinedRegion=null,this.region=null,yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"resetRuntimeSettings",id:i,instanceID:this._instanceID})}))}))}outputSettingsToString(){return i(this,void 0,void 0,(function*(){if(!l._bUseFullFeature)throw Error("outputSettingsToString() is not supported in the compact version. Please try the full-featured version.");return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"outputSettingsToString",id:i,instanceID:this._instanceID})}))}))}initRuntimeSettingsWithString(e){return i(this,void 0,void 0,(function*(){if(!l._bUseFullFeature)throw Error("initRuntimeSettingsWithString() is not supported in the compact version. Please try the full-featured version.");if("string"==typeof e)e=e;else{if("object"!=typeof e)throw TypeError("'initRuntimeSettingstWithString(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");e=JSON.stringify(e)}return yield new Promise(((t,i)=>{let n=l._nextTaskID++;l._taskCallbackMap.set(n,(e=>{if(e.success){try{this._handleRetJsonString(e.initReturn)}catch(e){i(e)}return t()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,i(t)}})),l._dbrWorker.postMessage({type:"initRuntimeSettingsWithString",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}_decode_Blob(e,t){return i(this,void 0,void 0,(function*(){l._onLog&&l._onLog("_decode_Blob(blob: Blob)");let i=null,n=null;if("undefined"!=typeof createImageBitmap)try{i=yield createImageBitmap(e)}catch(e){}i||(n=yield function(e){return new Promise(((t,i)=>{let n=URL.createObjectURL(e),r=new Image;r.dbrObjUrl=n,r.src=n,r.onload=()=>{t(r)},r.onerror=e=>{i(new Error("Can't convert blob to image : "+(e instanceof Event?e.type:e)))}}))}(e));let r=yield this._decode_Image(i||n,t);return i&&i.close(),r}))}_decode_ArrayBuffer(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Uint8Array(e,t){return i(this,void 0,void 0,(function*(){return yield this._decode_Blob(new Blob([e]),t)}))}_decode_Image(e,t){return i(this,void 0,void 0,(function*(){l._onLog&&l._onLog("_decode_Image(image: HTMLImageElement|ImageBitmap)"),t=t||{};let i,n,r,s,o=e instanceof HTMLImageElement?e.naturalWidth:e.width,a=e instanceof HTMLImageElement?e.naturalHeight:e.height,d=t.region;if(d){let e,t,r,s;d.regionMeasuredByPercentage?(e=d.regionLeft*o/100,t=d.regionTop*a/100,r=d.regionRight*o/100,s=d.regionBottom*a/100):(e=d.regionLeft,t=d.regionTop,r=d.regionRight,s=d.regionBottom),i=e,n=t,o=Math.round(r-e),a=Math.round(s-t)}else i=0,n=0;const c=Math.max(o,a);if(c>this._canvasMaxWH){const e=this._canvasMaxWH/c;o>a?(r=this._canvasMaxWH,s=Math.round(a*e)):(r=Math.round(o*e),s=this._canvasMaxWH)}else r=o,s=a;let u,h;!this.bSaveOriCanvas&&_.OffscreenCanvas?u=new OffscreenCanvas(r,s):(u=document.createElement("canvas"),u.width=r,u.height=s),u.getContext("2d").drawImage(e,i,n,o,a,0,0,r,s),e.dbrObjUrl&&URL.revokeObjectURL(e.dbrObjUrl),d?(h=JSON.parse(JSON.stringify(t)),delete h.region):h=t;let g=yield this._decode_Canvas(u,h);return l.fixResultLocationWhenFilterRegionInJs(d,g,i,n,o,a,r,s),g}))}_decode_Canvas(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Canvas(canvas:HTMLCanvasElement)"),e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=e);let i=(e.dbrCtx2d||e.getContext("2d")).getImageData(0,0,e.width,e.height).data;return yield this._decodeBuffer_Uint8Array(i,e.width,e.height,4*e.width,n.IPF_ABGR_8888,t)}))}_decode_Video(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Video(video)"),!(e instanceof HTMLVideoElement))throw TypeError("'_decode_Video(video [, config] )': Type of 'video' should be 'HTMLVideoElement'.");if(e.crossOrigin&&"anonymous"!=e.crossOrigin)throw"cors";t=t||{};let i,n,r,s,o=e.videoWidth,a=e.videoHeight,d=t.region;if(d){let e,t,r,s;d.regionMeasuredByPercentage?(e=d.regionLeft*o/100,t=d.regionTop*a/100,r=d.regionRight*o/100,s=d.regionBottom*a/100):(e=d.regionLeft,t=d.regionTop,r=d.regionRight,s=d.regionBottom),i=e,n=t,o=Math.round(r-e),a=Math.round(s-t)}else i=0,n=0;const c=Math.max(o,a);if(c>this._canvasMaxWH){const e=this._canvasMaxWH/c;o>a?(r=this._canvasMaxWH,s=Math.round(a*e)):(r=Math.round(o*e),s=this._canvasMaxWH)}else r=o,s=a;let u=null;!this.bSaveOriCanvas&&_.OffscreenCanvas?u=new OffscreenCanvas(r,s):(u=document.createElement("canvas"),u.width=r,u.height=s);let h;(u.dbrCtx2d=u.getContext("2d")).drawImage(e,i,n,o,a,0,0,r,s),d?(h=JSON.parse(JSON.stringify(t)),delete h.region):h=t;let g=yield this._decode_Canvas(u,t);return d&&l.fixResultLocationWhenFilterRegionInJs(d,g,i,n,o,a,r,s),g}))}_decode_Base64(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Base64(base64Str)"),"string"!=typeof e)return Promise.reject("'_decode_Base64(base64Str, config)': Type of 'base64Str' should be 'string'.");if("data:image/"==e.substring(0,11)&&(e=e.substring(e.indexOf(",")+1)),a){let t=Buffer.from(e,"base64");return yield this._decodeFileInMemory_Uint8Array(new Uint8Array(t))}{let i=atob(e),n=i.length,r=new Uint8Array(n);for(;n--;)r[n]=i.charCodeAt(n);return yield this._decode_Blob(new Blob([r]),t)}}))}_decode_Url(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_Url(url)"),"string"!=typeof e)throw TypeError("'_decode_Url(url, config)': Type of 'url' should be 'string'.");if(e=e,a){let t=yield new Promise(((t,n)=>i(this,void 0,void 0,(function*(){(e.startsWith("https")?yield import("https"):yield import("http")).get(e,(e=>{if(200==e.statusCode){let i=[];e.on("data",(e=>{i.push(e)})).on("end",(()=>{t(new Uint8Array(Buffer.concat(i)))}))}else n("http get fail, statusCode: "+e.statusCode)}))}))));return yield this._decodeFileInMemory_Uint8Array(t)}{let n=yield new Promise(((t,n)=>{let r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.send(),r.onloadend=()=>i(this,void 0,void 0,(function*(){t(r.response)})),r.onerror=()=>{n(new Error("Network Error: "+r.statusText))}}));return yield this._decode_Blob(n,t)}}))}_decode_FilePath(e,t){return i(this,void 0,void 0,(function*(){if(l._onLog&&l._onLog("_decode_FilePath(path)"),!a)throw Error("'_decode_FilePath(path, config)': The method is only supported in node environment.");if("string"!=typeof e)throw TypeError("'_decode_FilePath(path, config)': Type of 'path' should be 'string'.");const t=yield import("fs");let i=yield new Promise(((i,n)=>{t.readFile(e,((e,t)=>{e?n(e):i(new Uint8Array(t))}))}));return yield this._decodeFileInMemory_Uint8Array(i)}))}static fixResultLocationWhenFilterRegionInJs(e,t,i,n,r,s,o,a){if(e&&t.length>0)for(let e of t){let t=e.localizationResult;2==t.resultCoordinateType&&(t.x1*=.01*o,t.x2*=.01*o,t.x3*=.01*o,t.x4*=.01*o,t.y1*=.01*a,t.y2*=.01*a,t.y3*=.01*a,t.y4*=.01*a);let d=o/r,_=a/s;t.x1=t.x1/d+i,t.x2=t.x2/d+i,t.x3=t.x3/d+i,t.x4=t.x4/d+i,t.y1=t.y1/_+n,t.y2=t.y2/_+n,t.y3=t.y3/_+n,t.y4=t.y4/_+n,2==t.resultCoordinateType&&(t.x1*=100/r,t.x2*=100/r,t.x3*=100/r,t.x4*=100/r,t.y1*=100/s,t.y2*=100/s,t.y3*=100/s,t.y4*=100/s)}}static BarcodeReaderException(e,t){let i,n=r.DBR_UNKNOWN;return"number"==typeof e?(n=e,i=new Error(t)):i=new Error(e),i.code=n,i}_handleRetJsonString(e){let t=r;if(e.textResults){for(let t=0;t{let i=t.indexOf(":");e[t.substring(0,i)]=t.substring(i+1)})),i.exception=e}}return e.decodeRecords?this.decodeRecords=e.decodeRecords:this.decodeRecords={},this._lastErrorCode=e.exception,this._lastErrorString=e.description,e.exception&&!l._setWarnnedEx.has(e.description)&&(l._setWarnnedEx.add(e.description),console.warn(e.description)),e.textResults}if(e.exception==t.DBR_SUCCESS)return e.data;throw l.BarcodeReaderException(e.exception,e.description)}setModeArgument(e,t,n,r){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,s)=>{let o=l._nextTaskID++;l._taskCallbackMap.set(o,(e=>{if(e.success){try{this._handleRetJsonString(e.setReturn)}catch(e){return s(e)}return i()}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,s(t)}})),l._dbrWorker.postMessage({type:"setModeArgument",id:o,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n,argumentValue:r}})}))}))}getModeArgument(e,t,n){return i(this,void 0,void 0,(function*(){return yield new Promise(((i,r)=>{let s=l._nextTaskID++;l._taskCallbackMap.set(s,(e=>{if(e.success){let t;try{t=this._handleRetJsonString(e.getReturn)}catch(e){return r(e)}return i(t)}{let t=new Error(e.message);return t.stack=e.stack+"\n"+t.stack,r(t)}})),l._dbrWorker.postMessage({type:"getModeArgument",id:s,instanceID:this._instanceID,body:{modeName:e,index:t,argumentName:n}})}))}))}getIntermediateResults(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e(i.results);{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"getIntermediateResults",id:i,instanceID:this._instanceID})}))}))}getIntermediateCanvas(){return i(this,void 0,void 0,(function*(){let e=yield this.getIntermediateResults(),t=[];for(let i of e)if(i.dataType==s.IMRDT_IMAGE)for(let e of i.results){const i=e.bytes;let r;switch(l._onLog&&l._onLog(" "+i.length+" "+i.byteLength+" "+e.width+" "+e.height+" "+e.stride+" "+e.format),e.format){case n.IPF_ABGR_8888:r=new Uint8ClampedArray(i);break;case n.IPF_RGB_888:{const e=i.length/3;r=new Uint8ClampedArray(4*e);for(let t=0;t{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"destroyContext",id:i,instanceID:this._instanceID})}))}}l._jsVersion="8.8.7",l._jsEditVersion="20220125",l._version="loading...(JS "+l._jsVersion+"."+l._jsEditVersion+")",l._license=a||d||!document.currentScript?"":document.currentScript.getAttribute("data-license")||document.currentScript.getAttribute("data-productKeys")||document.currentScript.getAttribute("data-licenseKey")||document.currentScript.getAttribute("data-handshakeCode")||document.currentScript.getAttribute("data-organizationID")||"",l._sessionPassword=a||d||!document.currentScript?"":document.currentScript.getAttribute("data-sessionPassword")||"",l.browserInfo=function(){if(!a&&!d){var e={init:function(){this.browser=this.searchString(this.dataBrowser)||"unknownBrowser",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"unknownVersion",this.OS=this.searchString(this.dataOS)||"unknownOS","Linux"==this.OS&&-1!=navigator.userAgent.indexOf("Windows NT")&&(this.OS="HarmonyOS")},searchString:function(e){for(var t=0;t{i(this,void 0,void 0,(function*(){const t=yield import("os");e.OS=t&&t.platform?t.platform()+t.release():"Unknown"}))})(),e}}(),l._workerName="dbr-"+l._jsVersion+".worker.js",l._engineResourcePath=(()=>{if(a){const e=import.meta.url;return new Promise((t=>i(void 0,void 0,void 0,(function*(){const i=yield import("url");"string"!=typeof l._engineResourcePath&&(l._engineResourcePath=i.fileURLToPath(e.substring(0,e.lastIndexOf("/")+1))),t()}))))}if(!d&&document.currentScript){let e=document.currentScript.src,t=e.indexOf("?");if(-1!=t)e=e.substring(0,t);else{let t=e.indexOf("#");-1!=t&&(e=e.substring(0,t))}return e.substring(0,e.lastIndexOf("/")+1)}return"./"})(),l._licenseServer=[],l._deviceFriendlyName="",l._isShowRelDecodeTimeInResults=!1,l._bWasmDebug=!1,l._bNeverShowDialog=!1,l.__bUseFullFeature=!0,l._nextTaskID=0,l._taskCallbackMap=new Map,l._loadWasmStatus="unload",l._loadWasmCallbackArr=[],l._lastErrorCode=0,l._lastErrorString="",l._setWarnnedEx=new Set,l._loadWasmErr=null;const c=!!("object"==typeof global&&global.process&&global.process.release&&global.process.release.name&&"undefined"==typeof HTMLCanvasElement);class u extends l{constructor(){super(),this._clickIptSingleFrameMode=()=>{},this.intervalTime=0,this.bSaveOriCanvas=!1,this._intervalGetVideoFrame=0,this.array_getFrameTimeCost=[],this.array_decodeFrameTimeCost=[],this._indexCurrentDecodingFrame=0,this._bPauseScan=!1,this._intervalDetectVideoPause=1e3,this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null,this._soundOnSuccessfullRead=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjI5LjEwMAAAAAAAAAAAAAAA/+M4wAAAAAAAAAAAAEluZm8AAAAPAAAABQAAAkAAgICAgICAgICAgICAgICAgICAgKCgoKCgoKCgoKCgoKCgoKCgoKCgwMDAwMDAwMDAwMDAwMDAwMDAwMDg4ODg4ODg4ODg4ODg4ODg4ODg4P//////////////////////////AAAAAExhdmM1OC41NAAAAAAAAAAAAAAAACQEUQAAAAAAAAJAk0uXRQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/+MYxAANQAbGeUEQAAHZYZ3fASqD4P5TKBgocg+Bw/8+CAYBA4XB9/4EBAEP4nB9+UOf/6gfUCAIKyjgQ/Kf//wfswAAAwQA/+MYxAYOqrbdkZGQAMA7DJLCsQxNOij///////////+tv///3RWiZGBEhsf/FO/+LoCSFs1dFVS/g8f/4Mhv0nhqAieHleLy/+MYxAYOOrbMAY2gABf/////////////////usPJ66R0wI4boY9/8jQYg//g2SPx1M0N3Z0kVJLIs///Uw4aMyvHJJYmPBYG/+MYxAgPMALBucAQAoGgaBoFQVBUFQWDv6gZBUFQVBUGgaBr5YSgqCoKhIGg7+IQVBUFQVBoGga//SsFSoKnf/iVTEFNRTMu/+MYxAYAAANIAAAAADEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),this.bPlaySoundOnSuccessfulRead=!1,this.bVibrateOnSuccessfulRead=!1,this.vibrateDuration=300,this.regionMaskFillStyle="rgba(0,0,0,0.5)",this.regionMaskStrokeStyle="rgb(254,142,20)",this.regionMaskLineWidth=2,this.barcodeFillStyle="rgba(254,180,32,0.3)",this.barcodeStrokeStyle="rgba(254,180,32,0.9)",this.barcodeLineWidth=1,this.beingLazyDrawRegionsults=!1,this.dce=null,this._onCameraSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onResolutionSelChange=()=>{this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0},this._onCloseBtnClick=()=>{this.hide()}}static get defaultUIElementURL(){var e;return null===(e=u._defaultUIElementURL)||void 0===e?void 0:e.replace("@engineResourcePath/",l.engineResourcePath)}static set defaultUIElementURL(e){u._defaultUIElementURL=e}getUIElement(){return this.dce.getUIElement()}setUIElement(e){return i(this,void 0,void 0,(function*(){yield this.dce.setUIElement(e)}))}get singleFrameMode(){return this.dce.singleFrameMode}set singleFrameMode(e){this.dce.singleFrameMode=e,e&&(()=>{i(this,void 0,void 0,(function*(){let e=yield this.getScanSettings();e.oneDTrustFrameCount=1,yield this.updateScanSettings(e)}))})()}get ifSaveOriginalImageInACanvas(){return this.bSaveOriCanvas}set ifSaveOriginalImageInACanvas(e){this.bSaveOriCanvas=e,this.dce&&(this.dce.ifSaveOriginalImageInACanvas=e)}_assertOpen(){if(!this.dce.isOpen())throw Error("The scanner is not open.")}get soundOnSuccessfullRead(){return this._soundOnSuccessfullRead}set soundOnSuccessfullRead(e){e instanceof HTMLAudioElement?this._soundOnSuccessfullRead=e:this._soundOnSuccessfullRead=new Audio(e)}get whenToPlaySoundforSuccessfulRead(){return!0===this.bPlaySoundOnSuccessfulRead?"frame":this.bPlaySoundOnSuccessfulRead?this.bPlaySoundOnSuccessfulRead:"never"}set whenToPlaySoundforSuccessfulRead(e){this.bPlaySoundOnSuccessfulRead="never"!==e&&e}get whenToVibrateforSuccessfulRead(){return!0===this.bVibrateOnSuccessfulRead?"frame":this.bVibrateOnSuccessfulRead?this.bVibrateOnSuccessfulRead:"never"}set whenToVibrateforSuccessfulRead(e){this.bVibrateOnSuccessfulRead="never"!==e&&e}set region(e){this._region=e,this.dce&&(this.dce.region=e),this.singleFrameMode||(this.beingLazyDrawRegionsults=!0,setTimeout((()=>{this.beingLazyDrawRegionsults&&this._drawRegionsults()}),500)),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}get region(){return this._region}createDCEInstance(){return i(this,void 0,void 0,(function*(){this.dce||(l._onLog&&l._onLog("createDCEInstance()"),t.defaultUIElementURL=null,this.dce=yield t.createInstance(),this.dce.bChangeRegionIndexManually=!0,this.dce.regionIndex=0,this.dce.bufferRefreshInterval=200,this.dce.alwaysRefreshBuffer=!1,this.dce.ifSaveOriginalImageInACanvas=!1,this.dce.onSingleFrameAcquired=e=>i(this,void 0,void 0,(function*(){let t=yield this.decode(e);yield this.clearMapDecodeRecord();for(let e of t)delete e.bUnduplicated;if(this._drawRegionsults(t),this.onFrameRead&&this.isOpen()&&!this._bPauseScan&&this.onFrameRead(t),this.onUniqueRead&&this.isOpen()&&!this._bPauseScan)for(let e of t)this.onUniqueRead(e.barcodeText,e)})),this._clickIptSingleFrameMode=this.dce._clickIptSingleFrameMode)}))}static createInstance(e){return i(this,void 0,void 0,(function*(){if(c)throw new Error("`BarcodeScanner` is not supported in Node.js.");let t=new u;yield t.createDCEInstance(),t._instanceID=yield u.createInstanceInWorker(!0),"string"==typeof e&&(e=JSON.parse(e));for(let i in e)t[i]=e[i];return yield t.setUIElement(u.defaultUIElementURL),t.singleFrameMode&&console.warn("The `navigator.mediaDevices.getUserMedia` is unavailable. automatically change to `singleFrameMode`."),t.singleFrameMode||(yield t.updateRuntimeSettings("single")),t}))}decode(e){return super.decode(e)}decodeBase64String(e){return super.decodeBase64String(e)}decodeUrl(e){return super.decodeUrl(e)}decodeBuffer(e,t,i,n,r,s){return super.decodeBuffer(e,t,i,n,r,s)}decodeCurrentFrame(e){return i(this,void 0,void 0,(function*(){this._assertOpen();let t=null;e&&e.region&&(t=e.region);let i=this.dce.getFrame(t);if(i&&null===i.canvas){let{data:e,width:t,height:r}=i;return yield this._decodeBuffer_Uint8Array(e,t,r,t,n.IPF_GrayScaled)}if(i&&i.canvas){let{data:e,canvas:t,region:r,sx:s,sy:o,sWidth:a,sHeight:d}=i;(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=t);let _=yield this._decodeBuffer_Uint8Array(e,t.width,t.height,4*t.width,n.IPF_ABGR_8888);return l.fixResultLocationWhenFilterRegionInJs(r,_,s,o,a,d,t.width,t.height),_}}))}clearMapDecodeRecord(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success)return e();{let e=new Error(i.message);return e.stack=i.stack+"\n"+e.stack,t(e)}})),l._dbrWorker.postMessage({type:"clearMapDecodeRecord",id:i,instanceID:this._instanceID})}))}))}static isRegionSinglePreset(e){return JSON.stringify(e)==JSON.stringify(u.singlePresetRegion)}static isRegionNormalPreset(e){return 0==e.regionLeft&&0==e.regionTop&&0==e.regionRight&&0==e.regionBottom&&0==e.regionMeasuredByPercentage}updateRuntimeSettings(e){return i(this,void 0,void 0,(function*(){let t;if("string"==typeof e)if("speed"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionSinglePreset(e.region)||(t.region=e.region)}else if("balance"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=3,t.expectedBarcodesCount=512,t.localizationModes=[2,16,0,0,0,0,0,0],t.timeout=1e5}else if("coverage"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionSinglePreset(e.region)||(t.region=e.region),t.deblurLevel=5,t.expectedBarcodesCount=512,t.scaleDownThreshold=1e5,t.localizationModes=[2,16,4,8,0,0,0,0],t.timeout=1e5}else if("single"==e){let e=yield this.getRuntimeSettings();yield this.resetRuntimeSettings(),t=yield this.getRuntimeSettings(),t.barcodeFormatIds=e.barcodeFormatIds,t.barcodeFormatIds_2=e.barcodeFormatIds_2,u.isRegionNormalPreset(e.region)?t.region=JSON.parse(JSON.stringify(u.singlePresetRegion)):t.region=e.region,t.expectedBarcodesCount=1,t.localizationModes=[16,2,0,0,0,0,0,0],t.barcodeZoneMinDistanceToImageBorders=0}else t=JSON.parse(e);else{if("object"!=typeof e)throw TypeError("'UpdateRuntimeSettings(settings)': Type of 'settings' should be 'string' or 'PlainObject'.");if(t=JSON.parse(JSON.stringify(e)),t.region instanceof Array){let i=e.region;[i.regionLeft,i.regionTop,i.regionLeft,i.regionBottom,i.regionMeasuredByPercentage].some((e=>void 0!==e))&&(t.region={regionLeft:i.regionLeft||0,regionTop:i.regionTop||0,regionRight:i.regionRight||0,regionBottom:i.regionBottom||0,regionMeasuredByPercentage:i.regionMeasuredByPercentage||0})}}if(!l._bUseFullFeature){if(0!=(t.barcodeFormatIds&~(o.BF_ONED|o.BF_QR_CODE|o.BF_PDF417|o.BF_DATAMATRIX))||0!=t.barcodeFormatIds_2)throw Error("Some of the specified barcode formats are not supported in the compact version. Please try the full-featured version.");if(0!=t.intermediateResultTypes)throw Error("Intermediate results is not supported in the compact version. Please try the full-featured version.")}{let e=t.region;if(this.bFilterRegionInJs?this.userDefinedRegion=JSON.parse(JSON.stringify(e)):this.userDefinedRegion=null,e instanceof Array)if(e.length){for(let t=0;t{let n=l._nextTaskID++;l._taskCallbackMap.set(n,(t=>{if(t.success){try{this._handleRetJsonString(t.updateReturn)}catch(e){i(e)}return e()}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,i(e)}})),l._dbrWorker.postMessage({type:"updateRuntimeSettings",id:n,instanceID:this._instanceID,body:{settings:JSON.stringify(t)}})})),"single"==e&&(yield this.setModeArgument("BinarizationModes",0,"EnableFillBinaryVacancy","0"),yield this.setModeArgument("LocalizationModes",0,"ScanDirection","2"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeX","71"),yield this.setModeArgument("BinarizationModes",0,"BlockSizeY","71"))}))}_bindUI(){let e=this.getUIElement();if(!e)throw new Error("Need to define `UIElement` before opening.");let t=[e];for(let e=0;e','','',''].join(""),this.dce._optGotRsl=this.dce._optGotRsl||this.dce._selRsl.options[0])):this.dce._optGotRsl||!e.classList.contains("dce-opt-gotResolution")&&!e.classList.contains("dbrScanner-opt-gotResolution")?this.dce._btnClose||!e.classList.contains("dce-btn-close")&&!e.classList.contains("dbrScanner-btn-close")?this.dce._video||!e.classList.contains("dce-existingVideo")&&!e.classList.contains("dbrScanner-existingVideo")||(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"),this.dce.singleFrameMode=!1):this.dce._btnClose=e:this.dce._optGotRsl=e:this.dce._selCam=e:this.dce._bgCamera=e:this.dce._bgLoading=e:(this.dce._video=e,this.dce._video.setAttribute("playsinline","true"));if(this.dce._bindUI(),this._selCam=this.dce._selCam,this._selRsl=this.dce._selRsl,this._btnClose=this.dce._btnClose,this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.addEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="pointer",this._cvsDrawArea.setAttribute("title","Take a photo")),this._divScanArea&&(this._divScanArea.addEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="pointer",this._divScanArea.setAttribute("title","Take a photo"))),this._selCam&&this._selCam.addEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.addEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.addEventListener("click",this._onCloseBtnClick),!this.dce.video)throw this._unbindUI(),Error("Can not find HTMLVideoElement with class `dbrScanner-video`.")}_unbindUI(){this._clearRegionsults(),this.singleFrameMode&&(this._cvsDrawArea&&(this._cvsDrawArea.removeEventListener("click",this._clickIptSingleFrameMode),this._cvsDrawArea.style.cursor="",this._cvsDrawArea.removeAttribute("title")),this._divScanArea&&(this._divScanArea.removeEventListener("click",this._clickIptSingleFrameMode),this._divScanArea.style.cursor="",this._divScanArea.removeAttribute("title"))),this._selCam&&this._selCam.removeEventListener("change",this._onCameraSelChange),this._selRsl&&this._selRsl.removeEventListener("change",this._onResolutionSelChange),this._btnClose&&this._btnClose.removeEventListener("click",this._onCloseBtnClick),this.dce._unbindUI(),this._cvsDrawArea=null,this._divScanArea=null,this._divScanLight=null,this._selCam=null,this._selRsl=null,this._btnClose=null}set onPlayed(e){this.dce.onPlayed=e}get onPlayed(){return this.dce.onPlayed}get onUnduplicatedRead(){return this.onUniqueRead}set onUnduplicatedRead(e){this.onUniqueRead=e}getAllCameras(){return i(this,void 0,void 0,(function*(){return this.dce.getAllCameras()}))}getCurrentCamera(){return i(this,void 0,void 0,(function*(){return this.dce.getSelectedCamera()}))}setCurrentCamera(e){return i(this,void 0,void 0,(function*(){return this.dce.selectCamera(e)}))}getResolution(){return this.dce.getResolution()}setResolution(e,t){return i(this,void 0,void 0,(function*(){return this.dce.setResolution(e,t)}))}getScanSettings(){return i(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{let i=l._nextTaskID++;l._taskCallbackMap.set(i,(i=>{if(i.success){let t=i.results;return t.intervalTime=this.intervalTime,e(t)}{let e=new Error(i.message);return e.stack+="\n"+i.stack,t(e)}})),l._dbrWorker.postMessage({type:"getScanSettings",id:i,instanceID:this._instanceID})}))}))}updateScanSettings(e){return i(this,void 0,void 0,(function*(){return this.intervalTime=e.intervalTime,yield new Promise(((t,i)=>{let n=l._nextTaskID++;l._taskCallbackMap.set(n,(e=>{if(e.success)return t();{let t=new Error(e.message);return t.stack+="\n"+e.stack,i(t)}})),u._dbrWorker.postMessage({type:"updateScanSettings",id:n,instanceID:this._instanceID,body:{settings:e}})}))}))}getVideoSettings(){return this.dce.getVideoSettings()}updateVideoSettings(e){return this.dce.updateVideoSettings(e)}isOpen(){return this.dce&&this.dce.isOpen()}_show(){let e=this.getUIElement();e.parentNode||(e.style.position="fixed",e.style.left="0",e.style.top="0",document.body.append(e)),"none"==e.style.display&&(e.style.display="")}stop(){this.dce.stop(),this._divScanLight&&(this._divScanLight.style.display="none"),this._drawRegionsults(),this.array_decodeFrameTimeCost.length=0,this.array_getFrameTimeCost.length=0,this._intervalGetVideoFrame=0}pause(){this.dce.pause(),this._divScanLight&&(this._divScanLight.style.display="none")}play(e,t,n){return i(this,void 0,void 0,(function*(){return this.dce.play(e,t,n)}))}pauseScan(){this._assertOpen(),this._bPauseScan=!0,this._divScanLight&&(this._divScanLight.style.display="none")}resumeScan(){this._assertOpen(),this._bPauseScan=!1}getCapabilities(){return this.dce.getCapabilities()}getCameraSettings(){return this.dce.getCameraSettings()}getConstraints(){return this.dce.getConstraints()}applyConstraints(e){return i(this,void 0,void 0,(function*(){return this.dce.applyConstraints(e)}))}turnOnTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOnTorch()}))}turnOffTorch(){return i(this,void 0,void 0,(function*(){return this.dce.turnOffTorch()}))}setColorTemperature(e){return i(this,void 0,void 0,(function*(){return this.dce.setColorTemperature(e)}))}setExposureCompensation(e){return i(this,void 0,void 0,(function*(){return this.dce.setExposureCompensation(e)}))}setZoom(e){return i(this,void 0,void 0,(function*(){return this.dce.setZoom(e)}))}setFrameRate(e){return i(this,void 0,void 0,(function*(){return this.dce.setFrameRate(e)}))}getFrameRate(){return this.dce.getFrameRate()}_cloneDecodeResults(e){if(e instanceof Array){let t=[];for(let i of e)t.push(this._cloneDecodeResults(i));return t}{let t=e;return JSON.parse(JSON.stringify(t,((e,t)=>"oriVideoCanvas"==e||"searchRegionCanvas"==e?void 0:t)))}}_loopReadVideo(){return i(this,void 0,void 0,(function*(){if(this.bDestroyed)return void this.dce.stopFetchingLoop();if(!this.isOpen())return this.dce.stopFetchingLoop(),void(yield this.clearMapDecodeRecord());if(!this.dce.video||this.dce.video.paused||this._bPauseScan)return l._onLog&&l._onLog("Video or scan is paused. Ask in 1s."),this.dce.stopFetchingLoop(),yield this.clearMapDecodeRecord(),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this._intervalDetectVideoPause));this._divScanLight&&"none"==this._divScanLight.style.display&&(this._divScanLight.style.display=""),l._onLog&&l._onLog("======= once read ======="),l._onLog&&(this._timeStartDecode=Date.now());let e=this._getVideoFrame();if(!e)return this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),void(this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),0));(()=>i(this,void 0,void 0,(function*(){if(e&&null===e.canvas){let{data:t,width:i,height:r,timeStamp:s}=e,o={timeStamp:s};return yield this._decodeBuffer_Uint8Array(t,i,r,i,n.IPF_GrayScaled,o)}if(e&&e.canvas){let{data:t,canvas:i,region:r,sx:s,sy:o,width:a,height:d,timeStamp:_}=e,c={timeStamp:_};(this.bSaveOriCanvas||this.singleFrameMode)&&(this.oriCanvas=i);let u=yield this._decodeBuffer_Uint8Array(t,i.width,i.height,4*i.width,n.IPF_ABGR_8888,c);return l.fixResultLocationWhenFilterRegionInJs(r,u,s,o,i.width,i.height,a,d),u}{let e=new Error("imgData is empty.");return new Promise((t=>t(e)))}})))().then((e=>{l._onLog&&l._onLog(e);let t=this.array_decodeFrameTimeCost,i=this.array_getFrameTimeCost,n=this._indexCurrentDecodingFrame;if((()=>{if(this.region instanceof Array){for(t[n]&&t[n]instanceof Array||(t[n]=[]);t[n].length>=5;)t[n].shift();t[n].push(this._lastInnerDecodeDuration)}else{for(;t.length>=5;)t.shift();t.push(this._lastInnerDecodeDuration)}})(),this._intervalGetVideoFrame=(()=>{let e=0;if(this.region instanceof Array){let r=0,s=0;r=n+1>=this.region.length?0:n+1,s=r+1>=this.region.length?0:r+1,e=t[r]&&t[r].length&&i[s]&&i[s].length?Math.min(...t[r])-Math.max(...i[s]):0}else if(i&&i.length){let n=Math.min(...t),r=Math.max(...i);n&&r&&(e=n-r)}else e=0;return e>0?e:0})()+this.intervalTime,this.isOpen()&&this.dce.video&&!this.dce.video.paused&&!this._bPauseScan){if(this.bPlaySoundOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bPlaySoundOnSuccessfulRead||"frame"===this.bPlaySoundOnSuccessfulRead)t=!0;else if("unduplicated"===this.bPlaySoundOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}t&&(this.soundOnSuccessfullRead.currentTime=0,this.soundOnSuccessfullRead.play().catch((e=>{console.warn("Autoplay not allowed. User interaction required: "+(e.message||e))})))}if(navigator.vibrate&&this.bVibrateOnSuccessfulRead&&e.length){let t=!1;if(!0===this.bVibrateOnSuccessfulRead||"frame"===this.bVibrateOnSuccessfulRead)t=!0;else if("unduplicated"===this.bVibrateOnSuccessfulRead)for(let i of e)if(i.bUnduplicated){t=!0;break}if(t)try{navigator.vibrate(this.vibrateDuration)}catch(e){console.warn("Vibration not allowed. User interaction required: "+(e.message||e))}}if(this.onFrameRead){let t=this._cloneDecodeResults(e);for(let e of t)delete e.bUnduplicated;this.onFrameRead(t)}if(this.onUniqueRead)for(let t of e)t.bUnduplicated&&this.onUniqueRead(t.barcodeText,this._cloneDecodeResults(t));this._drawRegionsults(e)}this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this.intervalTime?this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),this.intervalTime):this._loopReadVideo()})).catch((e=>{this.dce.stopFetchingLoop(),l._onLog&&l._onLog(e.message||e),this._loopReadVideoTimeoutId&&clearTimeout(this._loopReadVideoTimeoutId),this._loopReadVideoTimeoutId=setTimeout((()=>{this._loopReadVideo()}),Math.max(this.intervalTime,1e3)),"platform error"==e.message||console.warn(e.message)}))}))}_getVideoFrame(){let e=this.dce.isFetchingLoopStarted();if(this.dce.loopInterval=this._intervalGetVideoFrame,e||this.dce.startFetchingLoop(),!this.dce.getQueueLength())return this.dce.loopInterval=0,null;let t=this.dce.getFrameFromBuffer();this._indexCurrentDecodingFrame=this.dce.regionIndex,this.region instanceof Array&&this.dce.regionIndex++;return(e=>{let t=e.timeSpent,i=this.array_getFrameTimeCost;if(this.region instanceof Array){let e=this._indexCurrentDecodingFrame;for(i[e]&&i[e]instanceof Array||(i[e]=[]);i[e].length>=5;)i[e].shift();i[e].push(t)}else{for(;i.length>=5;)i.shift();i.push(t)}})(t),t}_drawRegionsults(e){let t,i,n;if(this.beingLazyDrawRegionsults=!1,this.singleFrameMode){if(!this.oriCanvas)return;t="contain",i=this.oriCanvas.width,n=this.oriCanvas.height}else{if(!this.dce.video)return;t=this.dce.video.style.objectFit||"contain",i=this.dce.video.videoWidth,n=this.dce.video.videoHeight}let r=this.region;if(r&&(!r.regionLeft&&!r.regionRight&&!r.regionTop&&!r.regionBottom&&!r.regionMeasuredByPercentage||r instanceof Array?r=null:r.regionMeasuredByPercentage?r=r.regionLeft||r.regionRight||100!==r.regionTop||100!==r.regionBottom?{regionLeft:Math.round(r.regionLeft/100*i),regionTop:Math.round(r.regionTop/100*n),regionRight:Math.round(r.regionRight/100*i),regionBottom:Math.round(r.regionBottom/100*n)}:null:(r=JSON.parse(JSON.stringify(r)),delete r.regionMeasuredByPercentage)),this._cvsDrawArea){this._cvsDrawArea.style.objectFit=t;let s=this._cvsDrawArea;s.width=i,s.height=n;let o=s.getContext("2d");if(r){o.fillStyle=this.regionMaskFillStyle,o.fillRect(0,0,s.width,s.height),o.globalCompositeOperation="destination-out",o.fillStyle="#000";let e=Math.round(this.regionMaskLineWidth/2);o.fillRect(r.regionLeft-e,r.regionTop-e,r.regionRight-r.regionLeft+2*e,r.regionBottom-r.regionTop+2*e),o.globalCompositeOperation="source-over",o.strokeStyle=this.regionMaskStrokeStyle,o.lineWidth=this.regionMaskLineWidth,o.rect(r.regionLeft,r.regionTop,r.regionRight-r.regionLeft,r.regionBottom-r.regionTop),o.stroke()}if(e){o.globalCompositeOperation="destination-over",o.fillStyle=this.barcodeFillStyle,o.strokeStyle=this.barcodeStrokeStyle,o.lineWidth=this.barcodeLineWidth,e=e||[];for(let t of e){let e=t.localizationResult;o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.fill(),o.beginPath(),o.moveTo(e.x1,e.y1),o.lineTo(e.x2,e.y2),o.lineTo(e.x3,e.y3),o.lineTo(e.x4,e.y4),o.closePath(),o.stroke()}}this.singleFrameMode&&(o.globalCompositeOperation="destination-over",o.drawImage(this.oriCanvas,0,0))}if(this._divScanArea&&this.dce.video){let e=this.dce.video.offsetWidth,t=this.dce.video.offsetHeight,s=1;e/tsuper.destroyContext}});return i(this,void 0,void 0,(function*(){yield this.close(),this.bDestroyed||(yield e.destroyContext.call(this))}))}}var h,g,R,E,I,A,S,f,D,m,T,M,C,L,y,O,p,v,N,B,b,F,P,w,V,U,k;u._defaultUIElementURL="@engineResourcePath/dbr.scanner.html",u.singlePresetRegion=[null,{regionLeft:0,regionTop:30,regionRight:100,regionBottom:70,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1},{regionLeft:25,regionTop:25,regionRight:75,regionBottom:75,regionMeasuredByPercentage:1}],function(e){e[e.BICM_DARK_ON_LIGHT=1]="BICM_DARK_ON_LIGHT",e[e.BICM_LIGHT_ON_DARK=2]="BICM_LIGHT_ON_DARK",e[e.BICM_DARK_ON_DARK=4]="BICM_DARK_ON_DARK",e[e.BICM_LIGHT_ON_LIGHT=8]="BICM_LIGHT_ON_LIGHT",e[e.BICM_DARK_LIGHT_MIXED=16]="BICM_DARK_LIGHT_MIXED",e[e.BICM_DARK_ON_LIGHT_DARK_SURROUNDING=32]="BICM_DARK_ON_LIGHT_DARK_SURROUNDING",e[e.BICM_SKIP=0]="BICM_SKIP",e[e.BICM_REV=2147483648]="BICM_REV"}(h||(h={})),function(e){e[e.BCM_AUTO=1]="BCM_AUTO",e[e.BCM_GENERAL=2]="BCM_GENERAL",e[e.BCM_SKIP=0]="BCM_SKIP",e[e.BCM_REV=2147483648]="BCM_REV"}(g||(g={})),function(e){e[e.BF2_NULL=0]="BF2_NULL",e[e.BF2_POSTALCODE=32505856]="BF2_POSTALCODE",e[e.BF2_NONSTANDARD_BARCODE=1]="BF2_NONSTANDARD_BARCODE",e[e.BF2_USPSINTELLIGENTMAIL=1048576]="BF2_USPSINTELLIGENTMAIL",e[e.BF2_POSTNET=2097152]="BF2_POSTNET",e[e.BF2_PLANET=4194304]="BF2_PLANET",e[e.BF2_AUSTRALIANPOST=8388608]="BF2_AUSTRALIANPOST",e[e.BF2_RM4SCC=16777216]="BF2_RM4SCC",e[e.BF2_DOTCODE=2]="BF2_DOTCODE"}(R||(R={})),function(e){e[e.BM_AUTO=1]="BM_AUTO",e[e.BM_LOCAL_BLOCK=2]="BM_LOCAL_BLOCK",e[e.BM_SKIP=0]="BM_SKIP",e[e.BM_THRESHOLD=4]="BM_THRESHOLD",e[e.BM_REV=2147483648]="BM_REV"}(E||(E={})),function(e){e[e.ECCM_CONTRAST=1]="ECCM_CONTRAST"}(I||(I={})),function(e){e[e.CFM_GENERAL=1]="CFM_GENERAL"}(A||(A={})),function(e){e[e.CCM_AUTO=1]="CCM_AUTO",e[e.CCM_GENERAL_HSV=2]="CCM_GENERAL_HSV",e[e.CCM_SKIP=0]="CCM_SKIP",e[e.CCM_REV=2147483648]="CCM_REV"}(S||(S={})),function(e){e[e.CICM_GENERAL=1]="CICM_GENERAL",e[e.CICM_SKIP=0]="CICM_SKIP",e[e.CICM_REV=2147483648]="CICM_REV"}(f||(f={})),function(e){e[e.CM_IGNORE=1]="CM_IGNORE",e[e.CM_OVERWRITE=2]="CM_OVERWRITE"}(D||(D={})),function(e){e[e.DM_SKIP=0]="DM_SKIP",e[e.DM_DIRECT_BINARIZATION=1]="DM_DIRECT_BINARIZATION",e[e.DM_THRESHOLD_BINARIZATION=2]="DM_THRESHOLD_BINARIZATION",e[e.DM_GRAY_EQUALIZATION=4]="DM_GRAY_EQUALIZATION",e[e.DM_SMOOTHING=8]="DM_SMOOTHING",e[e.DM_MORPHING=16]="DM_MORPHING",e[e.DM_DEEP_ANALYSIS=32]="DM_DEEP_ANALYSIS",e[e.DM_SHARPENING=64]="DM_SHARPENING",e[e.DM_BASED_ON_LOC_BIN=128]="DM_BASED_ON_LOC_BIN",e[e.DM_SHARPENING_SMOOTHING=256]="DM_SHARPENING_SMOOTHING"}(m||(m={})),function(e){e[e.DRM_AUTO=1]="DRM_AUTO",e[e.DRM_GENERAL=2]="DRM_GENERAL",e[e.DRM_SKIP=0]="DRM_SKIP",e[e.DRM_REV=2147483648]="DRM_REV"}(T||(T={})),function(e){e[e.DPMCRM_AUTO=1]="DPMCRM_AUTO",e[e.DPMCRM_GENERAL=2]="DPMCRM_GENERAL",e[e.DPMCRM_SKIP=0]="DPMCRM_SKIP",e[e.DPMCRM_REV=2147483648]="DPMCRM_REV"}(M||(M={})),function(e){e[e.GTM_INVERTED=1]="GTM_INVERTED",e[e.GTM_ORIGINAL=2]="GTM_ORIGINAL",e[e.GTM_SKIP=0]="GTM_SKIP",e[e.GTM_REV=2147483648]="GTM_REV"}(C||(C={})),function(e){e[e.IPM_AUTO=1]="IPM_AUTO",e[e.IPM_GENERAL=2]="IPM_GENERAL",e[e.IPM_GRAY_EQUALIZE=4]="IPM_GRAY_EQUALIZE",e[e.IPM_GRAY_SMOOTH=8]="IPM_GRAY_SMOOTH",e[e.IPM_SHARPEN_SMOOTH=16]="IPM_SHARPEN_SMOOTH",e[e.IPM_MORPHOLOGY=32]="IPM_MORPHOLOGY",e[e.IPM_SKIP=0]="IPM_SKIP",e[e.IPM_REV=2147483648]="IPM_REV"}(L||(L={})),function(e){e[e.IRSM_MEMORY=1]="IRSM_MEMORY",e[e.IRSM_FILESYSTEM=2]="IRSM_FILESYSTEM",e[e.IRSM_BOTH=4]="IRSM_BOTH"}(y||(y={})),function(e){e[e.IRT_NO_RESULT=0]="IRT_NO_RESULT",e[e.IRT_ORIGINAL_IMAGE=1]="IRT_ORIGINAL_IMAGE",e[e.IRT_COLOUR_CLUSTERED_IMAGE=2]="IRT_COLOUR_CLUSTERED_IMAGE",e[e.IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE=4]="IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE",e[e.IRT_TRANSFORMED_GRAYSCALE_IMAGE=8]="IRT_TRANSFORMED_GRAYSCALE_IMAGE",e[e.IRT_PREDETECTED_REGION=16]="IRT_PREDETECTED_REGION",e[e.IRT_PREPROCESSED_IMAGE=32]="IRT_PREPROCESSED_IMAGE",e[e.IRT_BINARIZED_IMAGE=64]="IRT_BINARIZED_IMAGE",e[e.IRT_TEXT_ZONE=128]="IRT_TEXT_ZONE",e[e.IRT_CONTOUR=256]="IRT_CONTOUR",e[e.IRT_LINE_SEGMENT=512]="IRT_LINE_SEGMENT",e[e.IRT_FORM=1024]="IRT_FORM",e[e.IRT_SEGMENTATION_BLOCK=2048]="IRT_SEGMENTATION_BLOCK",e[e.IRT_TYPED_BARCODE_ZONE=4096]="IRT_TYPED_BARCODE_ZONE",e[e.IRT_PREDETECTED_QUADRILATERAL=8192]="IRT_PREDETECTED_QUADRILATERAL"}(O||(O={})),function(e){e[e.LM_SKIP=0]="LM_SKIP",e[e.LM_AUTO=1]="LM_AUTO",e[e.LM_CONNECTED_BLOCKS=2]="LM_CONNECTED_BLOCKS",e[e.LM_LINES=8]="LM_LINES",e[e.LM_STATISTICS=4]="LM_STATISTICS",e[e.LM_SCAN_DIRECTLY=16]="LM_SCAN_DIRECTLY",e[e.LM_STATISTICS_MARKS=32]="LM_STATISTICS_MARKS",e[e.LM_STATISTICS_POSTAL_CODE=64]="LM_STATISTICS_POSTAL_CODE",e[e.LM_CENTRE=128]="LM_CENTRE",e[e.LM_ONED_FAST_SCAN=256]="LM_ONED_FAST_SCAN",e[e.LM_REV=2147483648]="LM_REV"}(p||(p={})),function(e){e[e.PDFRM_RASTER=1]="PDFRM_RASTER",e[e.PDFRM_AUTO=2]="PDFRM_AUTO",e[e.PDFRM_VECTOR=4]="PDFRM_VECTOR",e[e.PDFRM_REV=2147483648]="PDFRM_REV"}(v||(v={})),function(e){e[e.QRECL_ERROR_CORRECTION_H=0]="QRECL_ERROR_CORRECTION_H",e[e.QRECL_ERROR_CORRECTION_L=1]="QRECL_ERROR_CORRECTION_L",e[e.QRECL_ERROR_CORRECTION_M=2]="QRECL_ERROR_CORRECTION_M",e[e.QRECL_ERROR_CORRECTION_Q=3]="QRECL_ERROR_CORRECTION_Q"}(N||(N={})),function(e){e[e.RPM_AUTO=1]="RPM_AUTO",e[e.RPM_GENERAL=2]="RPM_GENERAL",e[e.RPM_GENERAL_RGB_CONTRAST=4]="RPM_GENERAL_RGB_CONTRAST",e[e.RPM_GENERAL_GRAY_CONTRAST=8]="RPM_GENERAL_GRAY_CONTRAST",e[e.RPM_GENERAL_HSV_CONTRAST=16]="RPM_GENERAL_HSV_CONTRAST",e[e.RPM_SKIP=0]="RPM_SKIP",e[e.RPM_REV=2147483648]="RPM_REV"}(B||(B={})),function(e){e[e.RCT_PIXEL=1]="RCT_PIXEL",e[e.RCT_PERCENTAGE=2]="RCT_PERCENTAGE"}(b||(b={})),function(e){e[e.RT_STANDARD_TEXT=0]="RT_STANDARD_TEXT",e[e.RT_RAW_TEXT=1]="RT_RAW_TEXT",e[e.RT_CANDIDATE_TEXT=2]="RT_CANDIDATE_TEXT",e[e.RT_PARTIAL_TEXT=3]="RT_PARTIAL_TEXT"}(F||(F={})),function(e){e[e.SUM_AUTO=1]="SUM_AUTO",e[e.SUM_LINEAR_INTERPOLATION=2]="SUM_LINEAR_INTERPOLATION",e[e.SUM_NEAREST_NEIGHBOUR_INTERPOLATION=4]="SUM_NEAREST_NEIGHBOUR_INTERPOLATION",e[e.SUM_SKIP=0]="SUM_SKIP",e[e.SUM_REV=2147483648]="SUM_REV"}(P||(P={})),function(e){e[e.TP_REGION_PREDETECTED=1]="TP_REGION_PREDETECTED",e[e.TP_IMAGE_PREPROCESSED=2]="TP_IMAGE_PREPROCESSED",e[e.TP_IMAGE_BINARIZED=4]="TP_IMAGE_BINARIZED",e[e.TP_BARCODE_LOCALIZED=8]="TP_BARCODE_LOCALIZED",e[e.TP_BARCODE_TYPE_DETERMINED=16]="TP_BARCODE_TYPE_DETERMINED",e[e.TP_BARCODE_RECOGNIZED=32]="TP_BARCODE_RECOGNIZED"}(w||(w={})),function(e){e[e.TFM_AUTO=1]="TFM_AUTO",e[e.TFM_GENERAL_CONTOUR=2]="TFM_GENERAL_CONTOUR",e[e.TFM_SKIP=0]="TFM_SKIP",e[e.TFM_REV=2147483648]="TFM_REV"}(V||(V={})),function(e){e[e.TROM_CONFIDENCE=1]="TROM_CONFIDENCE",e[e.TROM_POSITION=2]="TROM_POSITION",e[e.TROM_FORMAT=4]="TROM_FORMAT",e[e.TROM_SKIP=0]="TROM_SKIP",e[e.TROM_REV=2147483648]="TROM_REV"}(U||(U={})),function(e){e[e.TDM_AUTO=1]="TDM_AUTO",e[e.TDM_GENERAL_WIDTH_CONCENTRATION=2]="TDM_GENERAL_WIDTH_CONCENTRATION",e[e.TDM_SKIP=0]="TDM_SKIP",e[e.TDM_REV=2147483648]="TDM_REV"}(k||(k={}));class G{static get version(){return l.version}static get productKeys(){return l.productKeys}static set productKeys(e){l.productKeys=e}static get handshakeCode(){return l.handshakeCode}static set handshakeCode(e){l.handshakeCode=e}static get organizationID(){return l.organizationID}static set organizationID(e){l.organizationID=e}static get sessionPassword(){return l.sessionPassword}static set sessionPassword(e){l.sessionPassword=e}static get browserInfo(){return l.browserInfo}static detectEnvironment(){return l.detectEnvironment()}static get _workerName(){return l._workerName}static set _workerName(e){l._workerName=e}static get engineResourcePath(){return l.engineResourcePath}static set engineResourcePath(e){l.engineResourcePath=e}static get licenseServer(){return l.licenseServer}static set licenseServer(e){l.licenseServer=e}static get deviceFriendlyName(){return l.deviceFriendlyName}static set deviceFriendlyName(e){l.deviceFriendlyName=e}static get _onLog(){return l._onLog}static set _onLog(e){l._onLog=e}static get _bWasmDebug(){return l._bWasmDebug}static set _bWasmDebug(e){l._bWasmDebug=e}static get _bUseFullFeature(){return l._bUseFullFeature}static set _bUseFullFeature(e){l._bUseFullFeature=e}static get _dbrWorker(){return l._dbrWorker}static isLoaded(){return l.isLoaded()}static isWasmLoaded(){return l.isLoaded()}static loadWasm(){return l.loadWasm()}}G.DBR=G,G.BarcodeReader=l,G.BarcodeScanner=u,G.CameraEnhancer=e,G.EnumBarcodeColourMode=h,G.EnumBarcodeComplementMode=g,G.EnumBarcodeFormat=o,G.EnumBarcodeFormat_2=R,G.EnumBinarizationMode=E,G.EnumClarityCalculationMethod=I,G.EnumClarityFilterMode=A,G.EnumColourClusteringMode=S,G.EnumColourConversionMode=f,G.EnumConflictMode=D,G.EnumDeblurMode=m,G.EnumDeformationResistingMode=T,G.EnumDPMCodeReadingMode=M,G.EnumErrorCode=r,G.EnumGrayscaleTransformationMode=C,G.EnumImagePixelFormat=n,G.EnumImagePreprocessingMode=L,G.EnumIMResultDataType=s,G.EnumIntermediateResultSavingMode=y,G.EnumIntermediateResultType=O,G.EnumLocalizationMode=p,G.EnumPDFReadingMode=v,G.EnumQRCodeErrorCorrectionLevel=N,G.EnumRegionPredetectionMode=B,G.EnumResultCoordinateType=b,G.EnumResultType=F,G.EnumScaleUpMode=P,G.EnumTerminatePhase=w,G.EnumTextFilterMode=V,G.EnumTextResultOrderMode=U,G.EnumTextureDetectionMode=k;export{l as BarcodeReader,u as BarcodeScanner,G as DBR,h as EnumBarcodeColourMode,g as EnumBarcodeComplementMode,o as EnumBarcodeFormat,R as EnumBarcodeFormat_2,E as EnumBinarizationMode,I as EnumClarityCalculationMethod,A as EnumClarityFilterMode,S as EnumColourClusteringMode,f as EnumColourConversionMode,D as EnumConflictMode,M as EnumDPMCodeReadingMode,m as EnumDeblurMode,T as EnumDeformationResistingMode,r as EnumErrorCode,C as EnumGrayscaleTransformationMode,s as EnumIMResultDataType,n as EnumImagePixelFormat,L as EnumImagePreprocessingMode,y as EnumIntermediateResultSavingMode,O as EnumIntermediateResultType,p as EnumLocalizationMode,v as EnumPDFReadingMode,N as EnumQRCodeErrorCorrectionLevel,B as EnumRegionPredetectionMode,b as EnumResultCoordinateType,F as EnumResultType,P as EnumScaleUpMode,w as EnumTerminatePhase,V as EnumTextFilterMode,U as EnumTextResultOrderMode,k as EnumTextureDetectionMode,G as default}; diff --git a/dist/dbr.scanner.html b/dist/dbr.scanner.html index 9f161f5..39c3d0f 100644 --- a/dist/dbr.scanner.html +++ b/dist/dbr.scanner.html @@ -9,7 +9,7 @@ viewBox="0 0 2048 1792"> -

diff --git a/doc/License Agreement.url b/doc/License Agreement.url index baed566..afacf80 100644 --- a/doc/License Agreement.url +++ b/doc/License Agreement.url @@ -1,2 +1,2 @@ [InternetShortcut] -URL=https://www.dynamsoft.com/Products/barcode-reader-license-agreement.aspx#javascript \ No newline at end of file +URL=https://www.dynamsoft.com/barcode-reader/license-agreement/#javascript \ No newline at end of file diff --git a/doc/api reference/classes/barcodereader.html b/doc/api reference/classes/barcodereader.html index 8ce5552..187f8c3 100644 --- a/doc/api reference/classes/barcodereader.html +++ b/doc/api reference/classes/barcodereader.html @@ -1,4 +1,4 @@ -BarcodeReader | Dynamsoft BarcodeReader SDK for Javascript - v8.8.3
Options
All
  • Public
  • Public/Protected
  • All
Menu
+BarcodeReader | Dynamsoft BarcodeReader SDK for Javascript - v8.8.7
Options
All
  • Public
  • Public/Protected
  • All
Menu

The BarcodeReader class is used for image decoding Comparing to BarcodeScanner, the default decoding settings are more accurate but slower.

let pReader = null;
(async()=>{
let reader = await (pReader = pReader || Dynamsoft.DBR.BarcodeReader.createInstance());
let results = await reader.decode(imageSource);
for(let result of results){
console.log(result.barcodeText);
}
})(); @@ -10,7 +10,7 @@
Dynamsoft.DBR.BarcodeReader.license = "PRODUCT-KEYS";
 

For convenience, you can set license in script tag instead.

-
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/dbr.js" data-license="PRODUCT-KEYS"></script>
+
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js" data-license="PRODUCT-KEYS"></script>
 

Parameters

  • keys: string

Returns void

Static sessionPassword

  • get sessionPassword(): string
  • set sessionPassword(value: string): void
  • Specify a password to protect the online key from abuse.

    @@ -29,7 +29,7 @@

    Specify the Barcode Reader SDK engine (WASM) url. The SDK tries to automatically explore the engine location. If the auto-explored engine location is incorrect, you can manually specify the engine location. The property needs to be set before loadWasm.

    -
    Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/";
    await Dynamsoft.DBR.BarcodeReader.loadWasm(); +
    Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
    await Dynamsoft.DBR.BarcodeReader.loadWasm();

    Parameters

    • value: string

    Returns void

Static licenseServer

  • get licenseServer(): string | string[]
  • set licenseServer(value: string | string[]): void
  • Returns string | string[]

  • Specify the license server URL.

    diff --git a/doc/api reference/classes/barcodescanner.html b/doc/api reference/classes/barcodescanner.html index 34e323c..ff301b2 100644 --- a/doc/api reference/classes/barcodescanner.html +++ b/doc/api reference/classes/barcodescanner.html @@ -1,4 +1,4 @@ -BarcodeScanner | Dynamsoft BarcodeReader SDK for Javascript - v8.8.3
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu
    +BarcodeScanner | Dynamsoft BarcodeReader SDK for Javascript - v8.8.7
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The BarcodeScanner class is used for video decoding.

    let pScanner = null;
    (async()=>{
    let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
    scanner.onUniqueRead = txt => console.log(txt);
    await scanner.show();
    })();
    @@ -9,7 +9,7 @@
    Dynamsoft.DBR.BarcodeReader.license = "PRODUCT-KEYS";
     

    For convenience, you can set license in script tag instead.

    -
    <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/dbr.js" data-license="PRODUCT-KEYS"></script>
    +
    <script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.js" data-license="PRODUCT-KEYS"></script>
     

    Parameters

    • keys: string

    Returns void

Static sessionPassword

  • get sessionPassword(): string
  • set sessionPassword(value: string): void
  • Specify a password to protect the online key from abuse.

    @@ -28,14 +28,14 @@

    Specify the Barcode Reader SDK engine (WASM) url. The SDK tries to automatically explore the engine location. If the auto-explored engine location is incorrect, you can manually specify the engine location. The property needs to be set before loadWasm.

    -
    Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/";
    await Dynamsoft.DBR.BarcodeReader.loadWasm(); +
    Dynamsoft.DBR.BarcodeReader.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
    await Dynamsoft.DBR.BarcodeReader.loadWasm();

    Parameters

    • value: string

    Returns void

Static licenseServer

  • get licenseServer(): string | string[]
  • set licenseServer(value: string | string[]): void
  • Returns string | string[]

  • Specify the license server URL.

    Parameters

    • value: string | string[]

    Returns void

Static _bUseFullFeature

  • get _bUseFullFeature(): boolean
  • set _bUseFullFeature(value: boolean): void
  • Returns boolean

  • Parameters

    • value: boolean

    Returns void

Static defaultUIElementURL

  • get defaultUIElementURL(): string
  • set defaultUIElementURL(value: string): void
  • Returns string

  • The url of the default scanner UI. Can only be changed before createInstance.

    -
    Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/dbr.scanner.html";
    let pScanner = null;
    (async()=>{
    let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
    await scanner.show();
    })(); +
    Dynamsoft.DBR.BarcodeScanner.defaultUIElementURL = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.scanner.html";
    let pScanner = null;
    (async()=>{
    let scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
    await scanner.show();
    })();

    Parameters

    • value: string

    Returns void

singleFrameMode

  • get singleFrameMode(): boolean
  • set singleFrameMode(value: boolean): void
  • A mode not use video, get a frame from OS camera instead.

    @@ -111,7 +111,7 @@

Returns Promise<void>

show

  • Bind UI, open the camera, start decoding, and remove the UIElement display style if the original style is display:none;.

    -
    await scanner.setUIElement("https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/dbr.scanner.html");
    scanner.onUniqueRead = (txt, result) => { alert(txt); console.log(result); };
    await scanner.show();
    // await scanner.hide(); +
    await scanner.setUIElement("https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/dbr.scanner.html");
    scanner.onUniqueRead = (txt, result) => { alert(txt); console.log(result); };
    await scanner.show();
    // await scanner.hide();
    fires

    onPlayed,onUniqueRead,onFrameRead

    Returns Promise<ScannerPlayCallbackInfo>

showVideo

getResolution

  • getResolution(): number[]
  • Get current camera resolution.

    -
    let rsl = await scanner.getResolution();
    console.log(rsl.width + " x " + rsl.height); +
    let rsl = await scanner.getResolution();
    console.log(rsl[0] + " x " + rsl[1]);

    Returns number[]

setResolution

Static sessionPassword

  • get sessionPassword(): string
  • set sessionPassword(keys: string): void
  • Returns string

  • Specify a password to protect the Handshake Code from abuse.

    @@ -27,7 +27,7 @@

    Specify the Barcode Reader SDK engine (WASM) url. The SDK tries to automatically explore the engine location. If the auto-explored engine location is incorrect, you can manually specify the engine location. The property needs to be set before loadWasm.

    -
    Dynamsoft.DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.3/dist/";
    await Dynamsoft.DBR.loadWasm(); +
    Dynamsoft.DBR.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@8.8.7/dist/";
    await Dynamsoft.DBR.loadWasm();

    Parameters

    • value: string

    Returns void

Static licenseServer

  • get licenseServer(): string | string[]
  • set licenseServer(value: string | string[]): void