barcode-detector 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # barcode-detector
2
2
 
3
- [![npm](https://img.shields.io/npm/v/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/%40sec-ant/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/%40sec-ant%2Fbarcode-detector?color=%23ff5627)](https://cdn.jsdelivr.net/npm/barcode-detector@latest/)
3
+ [![npm](https://img.shields.io/npm/v/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/barcode-detector)](https://www.npmjs.com/package/barcode-detector/v/latest) [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/barcode-detector?color=%23ff5627)](https://cdn.jsdelivr.net/npm/barcode-detector@latest/)
4
4
 
5
- A [Barcode Detection API](https://wicg.github.io/shape-detection-api/#barcode-detection-api) polyfill that uses [ZXing webassembly](https://github.com/Sec-ant/zxing-wasm) under the hood.
5
+ A [Barcode Detection API](https://wicg.github.io/shape-detection-api/#barcode-detection-api) polyfill that uses [ZXing-C++ WebAssembly](https://github.com/Sec-ant/zxing-wasm) under the hood.
6
6
 
7
7
  > This package was originally published as [`@sec-ant/barcode-detector`](https://www.npmjs.com/package/@sec-ant/barcode-detector) on the npm registry. With appreciation for the generous offer from [@gruhn](https://github.com/gruhn), the package is now released under the name `barcode-detector` starting from version 2.0.0. The original name `@sec-ant/barcode-detector` will continue to be used for versions prior to 2.0.0, and will be retained solely for maintenance purposes. Eventually, it will be deprecated at an appropriate juncture.
8
8
 
@@ -58,7 +58,7 @@ For [modern browsers that support ES modules](https://caniuse.com/es6-module), t
58
58
  <!-- register -->
59
59
  <script
60
60
  type="module"
61
- src="https://cdn.jsdelivr.net/npm/barcode-detector@2/dist/es/side-effects.min.js"
61
+ src="https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/es/side-effects.min.js"
62
62
  ></script>
63
63
 
64
64
  <!-- use -->
@@ -71,7 +71,7 @@ For [modern browsers that support ES modules](https://caniuse.com/es6-module), t
71
71
 
72
72
  ```html
73
73
  <script type="module">
74
- import { BarcodeDetector } from "https://cdn.jsdelivr.net/npm/barcode-detector@2/dist/es/pure.min.js";
74
+ import { BarcodeDetector } from "https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/es/pure.min.js";
75
75
  const barcodeDetector = new BarcodeDetector();
76
76
  </script>
77
77
  ```
@@ -83,7 +83,7 @@ For [modern browsers that support ES modules](https://caniuse.com/es6-module), t
83
83
  <script type="importmap">
84
84
  {
85
85
  "imports": {
86
- "barcode-detector/pure": "https://cdn.jsdelivr.net/npm/barcode-detector@2/dist/es/pure.min.js"
86
+ "barcode-detector/pure": "https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/es/pure.min.js"
87
87
  }
88
88
  }
89
89
  </script>
@@ -109,14 +109,14 @@ For legacy browsers that lack support for module type `<script>` tags, or for us
109
109
  window.BarcodeDetectionAPI.BarcodeDetector
110
110
  window.BarcodeDetectionAPI.setZXingModuleOverrides
111
111
  -->
112
- <script src="https://cdn.jsdelivr.net/npm/barcode-detector@2/dist/iife/pure.min.js"></script>
112
+ <script src="https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/iife/pure.min.js"></script>
113
113
 
114
114
  <!--
115
115
  IIFE side-effects.js registers:
116
116
  window.BarcodeDetector
117
117
  window.BarcodeDetectionAPI.setZXingModuleOverrides
118
118
  -->
119
- <script src="https://cdn.jsdelivr.net/npm/barcode-detector@2/dist/iife/side-effects.min.js"></script>
119
+ <script src="https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/iife/side-effects.min.js"></script>
120
120
 
121
121
  <!--
122
122
  IIFE index.js registers:
@@ -124,7 +124,7 @@ For legacy browsers that lack support for module type `<script>` tags, or for us
124
124
  window.BarcodeDetectionAPI.BarcodeDetector
125
125
  window.BarcodeDetectionAPI.setZXingModuleOverrides
126
126
  -->
127
- <script src="https://cdn.jsdelivr.net/npm/barcode-detector@2/dist/iife/index.min.js"></script>
127
+ <script src="https://fastly.jsdelivr.net/npm/barcode-detector@2/dist/iife/index.min.js"></script>
128
128
  ```
129
129
 
130
130
  ### CJS
@@ -162,19 +162,19 @@ This package can also be consumed as a commonjs package:
162
162
 
163
163
  In addition to `BarcodeDetector`, this package exports another function called `setZXingModuleOverrides`.
164
164
 
165
- This package employs [Sec-ant/zxing-wasm](https://github.com/Sec-ant/zxing-wasm) to enable the core barcode reading functionality. As a result, a `.wasm` binary file is fetched at runtime. The default fetch path for this binary file is:
165
+ This package employs [zxing-wasm](https://github.com/Sec-ant/zxing-wasm) to enable the core barcode reading functionality. As a result, a `.wasm` binary file is fetched at runtime. The default fetch path for this binary file is:
166
166
 
167
167
  ```
168
- https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@<version>/dist/reader/zxing_reader.wasm
168
+ https://fastly.jsdelivr.net/npm/zxing-wasm@<version>/dist/reader/zxing_reader.wasm
169
169
  ```
170
170
 
171
- The `setZXingModuleOverrides` function allows you to govern where the `.wasm` binary is served from, thereby enabling offline use of the package, use within a local network, or within a site having strict [CSP](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#unsafe_webassembly_execution) rules.
171
+ The `setZXingModuleOverrides` function allows you to govern where the `.wasm` binary is served from, thereby enabling offline use of the package, use within a local network, or within a site having strict [CSP](https://developer.mozilla.org/docs/Web/HTTP/CSP) rules.
172
172
 
173
173
  For instance, should you want to inline this `.wasm` file in your build output for offline usage, with the assistance of build tools, you could try:
174
174
 
175
175
  ```ts
176
176
  // src/index.ts
177
- import wasmFile from "../node_modules/@sec-ant/zxing-wasm/dist/reader/zxing_reader.wasm?url";
177
+ import wasmFile from "../node_modules/zxing-wasm/dist/reader/zxing_reader.wasm?url";
178
178
 
179
179
  import {
180
180
  setZXingModuleOverrides,
@@ -200,7 +200,7 @@ Alternatively, the `.wasm` file could be copied to your dist folder to be served
200
200
 
201
201
  It's noteworthy that you'll always want to choose the correct version of the `.wasm` file, so the APIs exported by it are exactly what the js code expects.
202
202
 
203
- For more information on how to use this function, you can check [the notes here](https://github.com/Sec-ant/zxing-wasm#notes) and [discussions here](https://github.com/gruhn/vue-qrcode-reader/issues/354).
203
+ For more information on how to use this function, you can check [the notes here](https://github.com/Sec-ant/zxing-wasm#notes) and [discussions here](https://github.com/Sec-ant/barcode-detector/issues/18) and [here](https://github.com/gruhn/vue-qrcode-reader/issues/354).
204
204
 
205
205
  This function is exported from all the subpaths, including the [side effects](#side-effects).
206
206
 
@@ -214,7 +214,7 @@ The `BarcodeDetector` provided by this package also extends class `EventTarget`
214
214
 
215
215
  ### `load` Event
216
216
 
217
- The `load` event, which is a `CustomEvent`, will be dispatched on the successful instanciation of ZXing wasm module. For advanced usage, the instanciated module is passed as the `detail` parameter.
217
+ The `load` event, which is a `CustomEvent`, will be dispatched on the successful instantiation of ZXing wasm module. For advanced usage, the instantiated module is passed as the `detail` parameter.
218
218
 
219
219
  ```ts
220
220
  import { BarcodeDetector } from "barcode-detector/pure";
@@ -228,7 +228,7 @@ barcodeDetector.addEventListener("load", ({ detail }) => {
228
228
 
229
229
  ### `error` Event
230
230
 
231
- The `error` event, which is a `CustomEvent`, will be dispatched if the instanciation of ZXing wasm module is failed. An error is passed as the `detail` parameter.
231
+ The `error` event, which is a `CustomEvent`, will be dispatched if the instantiation of ZXing wasm module is failed. An error is passed as the `detail` parameter.
232
232
 
233
233
  ```ts
234
234
  import { BarcodeDetector } from "barcode-detector/pure";
@@ -261,5 +261,3 @@ barcodeDetector.detect(imageFile).then(console.log);
261
261
  The source code in this repository, as well as the build output, except for the parts listed below, is licensed under the [MIT license](./LICENSE).
262
262
 
263
263
  Test samples and resources are collected from [zxing-cpp/zxing-cpp](https://github.com/zxing-cpp/zxing-cpp), which is licensed under the [Apache-2.0 license](https://raw.githubusercontent.com/zxing-cpp/zxing-cpp/master/LICENSE), and [web-platform-tests/wpt](https://github.com/web-platform-tests/wpt), which is licensed under the [3-Clause BSD license](https://raw.githubusercontent.com/web-platform-tests/wpt/master/LICENSE.md).
264
-
265
- This package has an indirect dependency on [Sec-ant/zxing-wasm-build](https://github.com/Sec-ant/zxing-wasm-build), which is licensed under the [Apache-2.0 license](https://raw.githubusercontent.com/Sec-ant/zxing-wasm-build/main/LICENSE).
@@ -1,5 +1,5 @@
1
1
  /// <reference types="dom-webcodecs" />
2
- import { ZXingModule } from "@sec-ant/zxing-wasm/reader";
2
+ import { type ZXingModule } from "zxing-wasm/reader";
3
3
  import { BARCODE_DETECTOR_FORMATS } from "./utils.js";
4
4
  export type BarcodeFormat = (typeof BARCODE_DETECTOR_FORMATS)[number];
5
5
  export interface BarcodeDetectorOptions {
@@ -32,4 +32,4 @@ export declare class BarcodeDetector extends EventTarget {
32
32
  static getSupportedFormats(): Promise<readonly BarcodeFormat[]>;
33
33
  detect(image: ImageBitmapSourceWebCodecs): Promise<DetectedBarcode[]>;
34
34
  }
35
- export { setZXingModuleOverrides } from "@sec-ant/zxing-wasm";
35
+ export { setZXingModuleOverrides } from "zxing-wasm";
package/dist/cjs/pure.js CHANGED
@@ -1,3 +1,5 @@
1
- "use strict";var Le=(c,p,i)=>{if(!p.has(c))throw TypeError("Cannot "+i)};var qt=(c,p,i)=>(Le(c,p,"read from private field"),i?i.call(c):p.get(c)),ze=(c,p,i)=>{if(p.has(c))throw TypeError("Cannot add the same private member more than once");p instanceof WeakSet?p.add(c):p.set(c,i)},Ye=(c,p,i,v)=>(Le(c,p,"write to private field"),v?v.call(c,i):p.set(c,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ne=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function Oa(c){if(Qe(c))return{width:c.naturalWidth,height:c.naturalHeight};if(Ze(c))return{width:c.width.baseVal.value,height:c.height.baseVal.value};if(Ke(c))return{width:c.videoWidth,height:c.videoHeight};if(er(c))return{width:c.width,height:c.height};if(nr(c))return{width:c.displayWidth,height:c.displayHeight};if(tr(c))return{width:c.width,height:c.height};if(rr(c))return{width:c.width,height:c.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Qe(c){try{return c instanceof HTMLImageElement}catch{return!1}}function Ze(c){try{return c instanceof SVGImageElement}catch{return!1}}function Ke(c){try{return c instanceof HTMLVideoElement}catch{return!1}}function tr(c){try{return c instanceof HTMLCanvasElement}catch{return!1}}function er(c){try{return c instanceof ImageBitmap}catch{return!1}}function rr(c){try{return c instanceof OffscreenCanvas}catch{return!1}}function nr(c){try{return c instanceof VideoFrame}catch{return!1}}function ar(c){try{return c instanceof Blob}catch{return!1}}function Fa(c){try{return c instanceof ImageData}catch{return!1}}function Ma(c,p){try{const i=new OffscreenCanvas(c,p);if(i.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return i;throw void 0}catch{const i=document.createElement("canvas");return i.width=c,i.height=p,i}}async function or(c){if(Qe(c)&&!await Ha(c))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Ze(c)&&!await Wa(c))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(nr(c)&&ka(c))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Ke(c)&&(c.readyState===0||c.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(er(c)&&Ua(c))throw new DOMException("The image source is detached.","InvalidStateError");const{width:p,height:i}=Oa(c);if(p===0||i===0)return null;const $=Ma(p,i).getContext("2d");$.drawImage(c,0,0);try{return $.getImageData(0,0,p,i)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function ja(c){let p;try{if(createImageBitmap)p=await createImageBitmap(c);else if(Image){p=new Image;let v="";try{v=URL.createObjectURL(c),p.src=v,await p.decode()}finally{URL.revokeObjectURL(v)}}else return c}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await or(p)}function Ia(c){const{width:p,height:i}=c;if(p===0||i===0)return null;const v=c.getContext("2d");try{return v.getImageData(0,0,p,i)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ra(c){if(ar(c))return await ja(c);if(Fa(c)){if(Ba(c))throw new DOMException("The image data has been detached.","InvalidStateError");return c}return tr(c)||rr(c)?Ia(c):await or(c)}async function Ha(c){try{return await c.decode(),!0}catch{return!1}}async function Wa(c){var p;try{return await((p=c.decode)==null?void 0:p.call(c)),!0}catch{return!1}}function ka(c){return c.format===null}function Ba(c){return c.data.buffer.byteLength===0}function Ua(c){return c.width===0&&c.height===0}function Ge(c,p){return c instanceof DOMException?new DOMException(`${p}: ${c.message}`,c.name):c instanceof Error?new c.constructor(`${p}: ${c.message}`):new Error(`${p}: ${c}`)}const Xe=c=>{let p;const i=new Set,v=(O,Y)=>{const j=typeof O=="function"?O(p):O;if(!Object.is(j,p)){const F=p;p=Y??typeof j!="object"?j:Object.assign({},p,j),i.forEach(L=>L(p,F))}},$=()=>p,w={setState:v,getState:$,subscribe:O=>(i.add(O),()=>i.delete(O)),destroy:()=>{i.clear()}};return p=c(v,$,w),w},Va=c=>c?Xe(c):Xe,La={locateFile:(c,p)=>{var i;const v=(i=c.match(/_(.+?)\.wasm$/))==null?void 0:i[1];return v?`https://fastly.jsdelivr.net/npm/@sec-ant/zxing-wasm@2.1.5/dist/${v}/${c}`:p+c}},st=Va()(()=>({zxingModuleWeakMap:new WeakMap,zxingModuleOverrides:La}));function za(c){st.setState({zxingModuleOverrides:c})}function Qt(c,p=st.getState().zxingModuleOverrides){const{zxingModuleWeakMap:i}=st.getState(),v=i.get(c);if(v&&Object.is(p,st.getState().zxingModuleOverrides))return v;{st.setState({zxingModuleOverrides:p});const $=c(p);return i.set(c,$),$}}const qe=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"],U={tryHarder:!0,formats:[],maxSymbols:255};async function Ya(c,{tryHarder:p=U.tryHarder,formats:i=U.formats,maxSymbols:v=U.maxSymbols}=U,$){const w=await Qt($,st.getState().zxingModuleOverrides),{size:O}=c,Y=new Uint8Array(await c.arrayBuffer()),j=w._malloc(O);w.HEAP8.set(Y,j);const F=w.readBarcodesFromImage(j,O,p,ir(i),v);w._free(j);const L=[];for(let z=0;z<F.size();++z){const V=F.get(z);L.push({...V,format:sr(V.format)})}return L}async function Na(c,{tryHarder:p=U.tryHarder,formats:i=U.formats,maxSymbols:v=U.maxSymbols}=U,$){const w=await Qt($,st.getState().zxingModuleOverrides),{data:O,width:Y,height:j,data:{byteLength:F}}=c,L=w._malloc(F);w.HEAP8.set(O,L);const z=w.readBarcodesFromPixmap(L,Y,j,p,ir(i),v);w._free(L);const V=[];for(let N=0;N<z.size();++N){const J=z.get(N);V.push({...J,format:sr(J.format)})}return V}function ir(c){return c.join("|")}function sr(c){const p=Je(c);let i=0,v=qe.length-1;for(;i<=v;){const $=Math.floor((i+v)/2),w=qe[$],O=Je(w);if(O===p)return w;O<p?i=$+1:v=$-1}return"None"}function Je(c){return c.toLowerCase().replace(/_-\[\]/g,"")}var Zt=(()=>{var c=typeof document>"u"?require("url").pathToFileURL(__filename).href:document.currentScript&&document.currentScript.src||new URL("pure.js",document.baseURI).href;return function(p={}){var i=p,v,$;i.ready=new Promise((t,e)=>{v=t,$=e});var w=Object.assign({},i),O="./this.program",Y=typeof window=="object",j=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var F="";function L(t){return i.locateFile?i.locateFile(t,F):F+t}var z;(Y||j)&&(j?F=self.location.href:typeof document<"u"&&document.currentScript&&(F=document.currentScript.src),c&&(F=c),F.indexOf("blob:")!==0?F=F.substr(0,F.replace(/[?#].*/,"").lastIndexOf("/")+1):F="",j&&(z=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),i.print||console.log.bind(console);var V=i.printErr||console.error.bind(console);Object.assign(i,w),w=null,i.arguments&&i.arguments,i.thisProgram&&(O=i.thisProgram),i.quit&&i.quit;var N;i.wasmBinary&&(N=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&bt("no native wasm support detected");var J,ft=!1,G,W,dt,$t,k,A,Kt,te;function ee(){var t=J.buffer;i.HEAP8=G=new Int8Array(t),i.HEAP16=dt=new Int16Array(t),i.HEAPU8=W=new Uint8Array(t),i.HEAPU16=$t=new Uint16Array(t),i.HEAP32=k=new Int32Array(t),i.HEAPU32=A=new Uint32Array(t),i.HEAPF32=Kt=new Float32Array(t),i.HEAPF64=te=new Float64Array(t)}var re=[],ne=[],ae=[];function ur(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)fr(i.preRun.shift());Rt(re)}function cr(){Rt(ne)}function lr(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)hr(i.postRun.shift());Rt(ae)}function fr(t){re.unshift(t)}function dr(t){ne.unshift(t)}function hr(t){ae.unshift(t)}var rt=0,ht=null;function pr(t){rt++,i.monitorRunDependencies&&i.monitorRunDependencies(rt)}function mr(t){if(rt--,i.monitorRunDependencies&&i.monitorRunDependencies(rt),rt==0&&ht){var e=ht;ht=null,e()}}function bt(t){i.onAbort&&i.onAbort(t),t="Aborted("+t+")",V(t),ft=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw $(e),e}var yr="data:application/octet-stream;base64,";function oe(t){return t.startsWith(yr)}var nt;i.locateFile?(nt="zxing_reader.wasm",oe(nt)||(nt=L(nt))):nt=new URL("/reader/zxing_reader.wasm",self.location).href;function ie(t){if(t==nt&&N)return new Uint8Array(N);if(z)return z(t);throw"both async and sync fetching of the wasm failed"}function vr(t){return!N&&(Y||j)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>ie(t)):Promise.resolve().then(()=>ie(t))}function se(t,e,r){return vr(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{V(`failed to asynchronously prepare wasm: ${n}`),bt(n)})}function gr(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!oe(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,r);return o.then(n,function(s){return V(`wasm streaming compile failed: ${s}`),V("falling back to ArrayBuffer instantiation"),se(e,r,n)})}):se(e,r,n)}function wr(){var t={a:Zn};function e(n,a){return D=n.exports,J=D.qa,ee(),be=D.ua,dr(D.ra),mr(),D}pr();function r(n){e(n.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(n){V(`Module.instantiateWasm callback failed with error: ${n}`),$(n)}return gr(N,nt,t,r).catch($),{}}var Rt=t=>{for(;t.length>0;)t.shift()(i)},Ct=[],_t=0,$r=t=>{var e=new Tt(t);return e.get_caught()||(e.set_caught(!0),_t--),e.set_rethrown(!1),Ct.push(e),He(e.excPtr),e.get_exception_ptr()},Q=0,br=()=>{b(0,0);var t=Ct.pop();Re(t.excPtr),Q=0};function Tt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){A[this.ptr+4>>2]=e},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(e){A[this.ptr+8>>2]=e},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,G[this.ptr+12>>0]=e},this.get_caught=function(){return G[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,G[this.ptr+13>>0]=e},this.get_rethrown=function(){return G[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){A[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ke(this.get_type());if(e)return A[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var Cr=t=>{throw Q||(Q=t),Q},Ht=t=>{var e=Q;if(!e)return wt(0),0;var r=new Tt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return wt(0),e;for(var a in t){var o=t[a];if(o===0||o===n)break;var s=r.ptr+16;if(We(o,n,s))return wt(o),e}return wt(n),e},_r=()=>Ht([]),Tr=t=>Ht([t]),Pr=(t,e)=>Ht([t,e]),Er=t=>{var e=new Tt(t).get_exception_ptr();return e},xr=()=>{var t=Ct.pop();t||bt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Ct.push(t),t.set_rethrown(!0),t.set_caught(!1),_t++),Q=e,Q},Sr=(t,e,r)=>{var n=new Tt(t);throw n.init(e,r),Q=t,_t++,Q},Ar=()=>_t,Pt={},ue=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Wt(t){return this.fromWireType(k[t>>2])}var ut={},at={},Et={},ce,xt=t=>{throw new ce(t)},ot=(t,e,r)=>{t.forEach(function(u){Et[u]=e});function n(u){var l=r(u);l.length!==t.length&&xt("Mismatched type converter count");for(var f=0;f<t.length;++f)Z(t[f],l[f])}var a=new Array(e.length),o=[],s=0;e.forEach((u,l)=>{at.hasOwnProperty(u)?a[l]=at[u]:(o.push(u),ut.hasOwnProperty(u)||(ut[u]=[]),ut[u].push(()=>{a[l]=at[u],++s,s===o.length&&n(a)}))}),o.length===0&&n(a)},Dr=t=>{var e=Pt[t];delete Pt[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,o=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));ot([t],o,s=>{var u={};return a.forEach((l,f)=>{var h=l.fieldName,y=s[f],g=l.getter,T=l.getterContext,x=s[f+a.length],R=l.setter,S=l.setterContext;u[h]={read:H=>y.fromWireType(g(T,H)),write:(H,d)=>{var m=[];R(S,H,x.toWireType(m,d)),ue(m)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in u)f[h]=u[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in u)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in u)u[h].write(y,f[h]);return l!==null&&l.push(n,y),y},argPackAdvance:K,readValueFromPointer:Wt,destructorFunction:n}]})},Or=(t,e,r,n,a)=>{},Fr=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);le=t},le,B=t=>{for(var e="",r=t;W[r];)e+=le[W[r++]];return e},ct,P=t=>{throw new ct(t)};function Mr(t,e,r={}){var n=e.name;if(t||P(`type "${n}" must have a positive integer typeid pointer`),at.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;P(`Cannot register type '${n}' twice`)}if(at[t]=e,delete Et[t],ut.hasOwnProperty(t)){var a=ut[t];delete ut[t],a.forEach(o=>o())}}function Z(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return Mr(t,e,r)}var K=8,jr=(t,e,r,n)=>{e=B(e),Z(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?r:n},argPackAdvance:K,readValueFromPointer:function(a){return this.fromWireType(W[a])},destructorFunction:null})},Ir=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),kt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}P(e(t)+" instance already deleted")},Bt=!1,fe=t=>{},Rr=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},de=t=>{t.count.value-=1;var e=t.count.value===0;e&&Rr(t)},he=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=he(t,e,r.baseClass);return n===null?null:r.downcast(n)},pe={},Hr=()=>Object.keys(yt).length,Wr=()=>{var t=[];for(var e in yt)yt.hasOwnProperty(e)&&t.push(yt[e]);return t},pt=[],Ut=()=>{for(;pt.length;){var t=pt.pop();t.$$.deleteScheduled=!1,t.delete()}},mt,kr=t=>{mt=t,pt.length&&mt&&mt(Ut)},Br=()=>{i.getInheritedInstanceCount=Hr,i.getLiveInheritedInstances=Wr,i.flushPendingDeletes=Ut,i.setDelayFunction=kr},yt={},Ur=(t,e)=>{for(e===void 0&&P("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Vr=(t,e)=>(e=Ur(t,e),yt[e]),St=(t,e)=>{(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},vt(Object.create(t,{$$:{value:e}}))};function Lr(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Vr(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?St(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):St(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o=this.registeredClass.getActualType(e),s=pe[o];if(!s)return a.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var l=he(e,this.registeredClass,u.registeredClass);return l===null?a.call(this):this.isSmartPointer?St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l,smartPtrType:this,smartPtr:t}):St(u.registeredClass.instancePrototype,{ptrType:u,ptr:l})}var vt=t=>typeof FinalizationRegistry>"u"?(vt=e=>e,t):(Bt=new FinalizationRegistry(e=>{de(e.$$)}),vt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Bt.register(e,a,e)}return e},fe=e=>Bt.unregister(e),vt(t)),zr=()=>{Object.assign(At.prototype,{isAliasOf(t){if(!(this instanceof At)||!(t instanceof At))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=vt(Object.create(Object.getPrototypeOf(this),{$$:{value:Ir(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&P("Object already scheduled for deletion"),fe(this),de(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&P("Object already scheduled for deletion"),pt.push(this),pt.length===1&&mt&&mt(Ut),this.$$.deleteScheduled=!0,this}})};function At(){}var Yr=48,Nr=57,me=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Yr&&e<=Nr?`_${t}`:t};function ye(t,e){return t=me(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var ve=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||P(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},ge=(t,e,r)=>{i.hasOwnProperty(t)?((r===void 0||i[t].overloadTable!==void 0&&i[t].overloadTable[r]!==void 0)&&P(`Cannot register public name '${t}' twice`),ve(i,t,t),i.hasOwnProperty(r)&&P(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),i[t].overloadTable[r]=e):(i[t]=e,r!==void 0&&(i[t].numArguments=r))};function Gr(t,e,r,n,a,o,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=o,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var Vt=(t,e,r)=>{for(;e!==r;)e.upcast||P(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Xr(t,e){if(e===null)return this.isReference&&P(`null is not a valid ${this.name}`),0;e.$$||P(`Cannot pass "${Yt(e)}" as a ${this.name}`),e.$$.ptr||P(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Vt(e.$$.ptr,r,this.registeredClass);return n}function qr(t,e){var r;if(e===null)return this.isReference&&P(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||P(`Cannot pass "${Yt(e)}" as a ${this.name}`),e.$$.ptr||P(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&P(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=Vt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&P("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:P(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var a=e.clone();r=this.rawShare(r,et.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:P("Unsupporting sharing policy")}return r}function Jr(t,e){if(e===null)return this.isReference&&P(`null is not a valid ${this.name}`),0;e.$$||P(`Cannot pass "${Yt(e)}" as a ${this.name}`),e.$$.ptr||P(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&P(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=Vt(e.$$.ptr,r,this.registeredClass);return n}function we(t){return this.fromWireType(A[t>>2])}var Qr=()=>{Object.assign(Dt.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:K,readValueFromPointer:we,deleteObject(t){t!==null&&t.delete()},fromWireType:Lr})};function Dt(t,e,r,n,a,o,s,u,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=Xr,this.destructorFunction=null):(this.toWireType=Jr,this.destructorFunction=null):this.toWireType=qr}var $e=(t,e,r)=>{i.hasOwnProperty(t)||xt("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&r!==void 0?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)},Zr=(t,e,r)=>{var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)},Ot=[],be,E=t=>{var e=Ot[t];return e||(t>=Ot.length&&(Ot.length=t+1),Ot[t]=e=be.get(t)),e},Kr=(t,e,r)=>{if(t.includes("j"))return Zr(t,e,r);var n=E(e).apply(null,r);return n},tn=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),Kr(t,e,r)}},q=(t,e)=>{t=B(t);function r(){return t.includes("j")?tn(t,e):E(e)}var n=r();return typeof n!="function"&&P(`unknown function pointer with signature ${t}: ${e}`),n},en=(t,e)=>{var r=ye(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
- `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},Ce,_e=t=>{var e=Ie(t),r=B(e);return tt(e),r},Ft=(t,e)=>{var r=[],n={};function a(o){if(!n[o]&&!at[o]){if(Et[o]){Et[o].forEach(a);return}r.push(o),n[o]=!0}}throw e.forEach(a),new Ce(`${t}: `+r.map(_e).join([", "]))},rn=(t,e,r,n,a,o,s,u,l,f,h,y,g)=>{h=B(h),o=q(a,o),u&&(u=q(s,u)),f&&(f=q(l,f)),g=q(y,g);var T=me(h);ge(T,function(){Ft(`Cannot construct ${h} due to unbound types`,[n])}),ot([t,e,r],n?[n]:[],function(x){x=x[0];var R,S;n?(R=x.registeredClass,S=R.instancePrototype):S=At.prototype;var H=ye(T,function(){if(Object.getPrototypeOf(this)!==d)throw new ct("Use 'new' to construct "+h);if(m.constructor_body===void 0)throw new ct(h+" has no accessible constructor");var It=m.constructor_body[arguments.length];if(It===void 0)throw new ct(`Tried to invoke ctor of ${h} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(m.constructor_body).toString()}) parameters instead!`);return It.apply(this,arguments)}),d=Object.create(S,{constructor:{value:H}});H.prototype=d;var m=new Gr(h,H,d,g,R,o,u,f);m.baseClass&&(m.baseClass.__derivedClasses===void 0&&(m.baseClass.__derivedClasses=[]),m.baseClass.__derivedClasses.push(m));var M=new Dt(h,m,!0,!1,!1),I=new Dt(h+"*",m,!1,!1,!1),it=new Dt(h+" const*",m,!1,!0,!1);return pe[t]={pointerType:I,constPointerType:it},$e(T,H),[M,I,it]})},Lt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(A[e+n*4>>2]);return r};function zt(t,e,r,n,a,o){var s=e.length;s<2&&P("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=e[1]!==null&&r!==null,l=!1,f=1;f<e.length;++f)if(e[f]!==null&&e[f].destructorFunction===void 0){l=!0;break}var h=e[0].name!=="void",y=s-2,g=new Array(y),T=[],x=[];return function(){arguments.length!==y&&P(`function ${t} called with ${arguments.length} arguments, expected ${y}`),x.length=0;var R;T.length=u?2:1,T[0]=a,u&&(R=e[1].toWireType(x,this),T[1]=R);for(var S=0;S<y;++S)g[S]=e[S+2].toWireType(x,arguments[S]),T.push(g[S]);var H=n.apply(null,T);function d(m){if(l)ue(x);else for(var M=u?1:2;M<e.length;M++){var I=M===1?R:g[M-2];e[M].destructorFunction!==null&&e[M].destructorFunction(I)}if(h)return e[0].fromWireType(m)}return d(H)}}var nn=(t,e,r,n,a,o)=>{var s=Lt(e,r);a=q(n,a),ot([],[t],function(u){u=u[0];var l=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new ct(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return u.registeredClass.constructor_body[e-1]=()=>{Ft(`Cannot construct ${u.name} due to unbound types`,s)},ot([],s,f=>(f.splice(1,0,null),u.registeredClass.constructor_body[e-1]=zt(l,f,null,a,o),[])),[]})},an=(t,e,r,n,a,o,s,u,l)=>{var f=Lt(r,n);e=B(e),o=q(a,o),ot([],[t],function(h){h=h[0];var y=`${h.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&h.registeredClass.pureVirtualFunctions.push(e);function g(){Ft(`Cannot call ${y} due to unbound types`,f)}var T=h.registeredClass.instancePrototype,x=T[e];return x===void 0||x.overloadTable===void 0&&x.className!==h.name&&x.argCount===r-2?(g.argCount=r-2,g.className=h.name,T[e]=g):(ve(T,e,y),T[e].overloadTable[r-2]=g),ot([],f,function(R){var S=zt(y,R,h,o,s);return T[e].overloadTable===void 0?(S.argCount=r-2,T[e]=S):T[e].overloadTable[r-2]=S,[]}),[]})};function on(){Object.assign(Te.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Te(){this.allocated=[void 0],this.freelist=[]}var X=new Te,Pe=t=>{t>=X.reserved&&--X.get(t).refcount===0&&X.free(t)},sn=()=>{for(var t=0,e=X.reserved;e<X.allocated.length;++e)X.allocated[e]!==void 0&&++t;return t},un=()=>{X.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),X.reserved=X.allocated.length,i.count_emval_handles=sn},et={toValue:t=>(t||P("Cannot use deleted val. handle = "+t),X.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return X.allocate({refcount:1,value:t})}}},cn=(t,e)=>{e=B(e),Z(t,{name:e,fromWireType:r=>{var n=et.toValue(r);return Pe(r),n},toWireType:(r,n)=>et.toHandle(n),argPackAdvance:K,readValueFromPointer:Wt,destructorFunction:null})},Yt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},ln=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Kt[r>>2])};case 8:return function(r){return this.fromWireType(te[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},fn=(t,e,r)=>{e=B(e),Z(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:K,readValueFromPointer:ln(e,r),destructorFunction:null})},dn=(t,e,r,n,a,o,s)=>{var u=Lt(e,r);t=B(t),a=q(n,a),ge(t,function(){Ft(`Cannot call ${t} due to unbound types`,u)},e-1),ot([],u,function(l){var f=[l[0],null].concat(l.slice(1));return $e(t,zt(t,f,null,a,o),e-1),[]})},hn=(t,e,r)=>{switch(e){case 1:return r?n=>G[n>>0]:n=>W[n>>0];case 2:return r?n=>dt[n>>1]:n=>$t[n>>1];case 4:return r?n=>k[n>>2]:n=>A[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},pn=(t,e,r,n,a)=>{e=B(e);var o=h=>h;if(n===0){var s=32-8*r;o=h=>h<<s>>>s}var u=e.includes("unsigned"),l=(h,y)=>{},f;u?f=function(h,y){return l(y,this.name),y>>>0}:f=function(h,y){return l(y,this.name),y},Z(t,{name:e,fromWireType:o,toWireType:f,argPackAdvance:K,readValueFromPointer:hn(e,r,n!==0),destructorFunction:null})},mn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function o(s){var u=A[s>>2],l=A[s+4>>2];return new a(G.buffer,l,u)}r=B(r),Z(t,{name:r,fromWireType:o,argPackAdvance:K,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ee=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,o=r+n-1,s=0;s<t.length;++s){var u=t.charCodeAt(s);if(u>=55296&&u<=57343){var l=t.charCodeAt(++s);u=65536+((u&1023)<<10)|l&1023}if(u<=127){if(r>=o)break;e[r++]=u}else if(u<=2047){if(r+1>=o)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=o)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63}}return e[r]=0,r-a},yn=(t,e,r)=>Ee(t,W,e,r),xe=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},Se=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,vn=(t,e,r)=>{for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Se)return Se.decode(t.subarray(e,a));for(var o="";e<a;){var s=t[e++];if(!(s&128)){o+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){o+=String.fromCharCode((s&31)<<6|u);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|l:s=(s&7)<<18|u<<12|l<<6|t[e++]&63,s<65536)o+=String.fromCharCode(s);else{var f=s-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},Nt=(t,e)=>t?vn(W,t,e):"",gn=(t,e)=>{e=B(e);var r=e==="std::string";Z(t,{name:e,fromWireType(n){var a=A[n>>2],o=n+4,s;if(r)for(var u=o,l=0;l<=a;++l){var f=o+l;if(l==a||W[f]==0){var h=f-u,y=Nt(u,h);s===void 0?s=y:(s+=String.fromCharCode(0),s+=y),u=f+1}}else{for(var g=new Array(a),l=0;l<a;++l)g[l]=String.fromCharCode(W[o+l]);s=g.join("")}return tt(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||P("Cannot pass non-string to std::string"),r&&s?o=xe(a):o=a.length;var u=Xt(4+o+1),l=u+4;if(A[u>>2]=o,r&&s)yn(a,l,o+1);else if(s)for(var f=0;f<o;++f){var h=a.charCodeAt(f);h>255&&(tt(l),P("String has UTF-16 code units that do not fit in 8 bits")),W[l+f]=h}else for(var f=0;f<o;++f)W[l+f]=a[f];return n!==null&&n.push(tt,u),u},argPackAdvance:K,readValueFromPointer:we,destructorFunction(n){tt(n)}})},Ae=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,wn=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&$t[n];)++n;if(r=n<<1,r-t>32&&Ae)return Ae.decode(W.subarray(t,r));for(var o="",s=0;!(s>=e/2);++s){var u=dt[t+s*2>>1];if(u==0)break;o+=String.fromCharCode(u)}return o},$n=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var n=e,a=r<t.length*2?r/2:t.length,o=0;o<a;++o){var s=t.charCodeAt(o);dt[e>>1]=s,e+=2}return dt[e>>1]=0,e-n},bn=t=>t.length*2,Cn=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=k[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(a)}return n},_n=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,a=n+r-4,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343){var u=t.charCodeAt(++o);s=65536+((s&1023)<<10)|u&1023}if(k[e>>2]=s,e+=4,e+4>a)break}return k[e>>2]=0,e-n},Tn=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Pn=(t,e,r)=>{r=B(r);var n,a,o,s,u;e===2?(n=wn,a=$n,s=bn,o=()=>$t,u=1):e===4&&(n=Cn,a=_n,s=Tn,o=()=>A,u=2),Z(t,{name:r,fromWireType:l=>{for(var f=A[l>>2],h=o(),y,g=l+4,T=0;T<=f;++T){var x=l+4+T*e;if(T==f||h[x>>u]==0){var R=x-g,S=n(g,R);y===void 0?y=S:(y+=String.fromCharCode(0),y+=S),g=x+e}}return tt(l),y},toWireType:(l,f)=>{typeof f!="string"&&P(`Cannot pass non-string to C++ string type ${r}`);var h=s(f),y=Xt(4+h+e);return A[y>>2]=h>>u,a(f,y+4,h+e),l!==null&&l.push(tt,y),y},argPackAdvance:K,readValueFromPointer:Wt,destructorFunction(l){tt(l)}})},En=(t,e,r,n,a,o)=>{Pt[t]={name:B(e),rawConstructor:q(r,n),rawDestructor:q(a,o),fields:[]}},xn=(t,e,r,n,a,o,s,u,l,f)=>{Pt[t].fields.push({fieldName:B(e),getterReturnType:r,getter:q(n,a),getterContext:o,setterArgumentType:s,setter:q(u,l),setterContext:f})},Sn=(t,e)=>{e=B(e),Z(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},An={},Dn=t=>{var e=An[t];return e===void 0?B(t):e},De=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},On=t=>t===0?et.toHandle(De()):(t=Dn(t),et.toHandle(De()[t])),Fn=t=>{t>4&&(X.get(t).refcount+=1)},Oe=(t,e)=>{var r=at[t];return r===void 0&&P(e+" has unknown type "+_e(t)),r},Mn=t=>{var e=new Array(t+1);return function(r,n,a){e[0]=r;for(var o=0;o<t;++o){var s=Oe(A[n+o*4>>2],"parameter "+o);e[o+1]=s.readValueFromPointer(a),a+=s.argPackAdvance}var u=new(r.bind.apply(r,e));return et.toHandle(u)}},Fe={},jn=(t,e,r,n)=>{t=et.toValue(t);var a=Fe[e];return a||(a=Mn(e),Fe[e]=a),a(t,r,n)},In=(t,e)=>{t=Oe(t,"_emval_take_value");var r=t.readValueFromPointer(e);return et.toHandle(r)},Rn=()=>{bt("")},Hn=(t,e,r)=>W.copyWithin(t,e,e+r),Wn=()=>2147483648,kn=t=>{var e=J.buffer,r=(t-e.byteLength+65535)/65536;try{return J.grow(r),ee(),1}catch{}},Bn=t=>{var e=W.length;t>>>=0;var r=Wn();if(t>r)return!1;for(var n=(l,f)=>l+(f-l%f)%f,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,t+100663296);var s=Math.min(r,n(Math.max(t,o),65536)),u=kn(s);if(u)return!0}return!1},Gt={},Un=()=>O||"./this.program",gt=()=>{if(!gt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Un()};for(var r in Gt)Gt[r]===void 0?delete e[r]:e[r]=Gt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);gt.strings=n}return gt.strings},Vn=(t,e)=>{for(var r=0;r<t.length;++r)G[e++>>0]=t.charCodeAt(r);G[e>>0]=0},Ln=(t,e)=>{var r=0;return gt().forEach((n,a)=>{var o=e+r;A[t+a*4>>2]=o,Vn(n,o),r+=n.length+1}),0},zn=(t,e)=>{var r=gt();A[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),A[e>>2]=n,0},Yn=t=>t,Mt=t=>t%4===0&&(t%100!==0||t%400===0),Nn=(t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r},Me=[31,29,31,30,31,30,31,31,30,31,30,31],je=[31,28,31,30,31,30,31,31,30,31,30,31],Gn=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Mt(r.getFullYear()),a=r.getMonth(),o=(n?Me:je)[a];if(e>o-r.getDate())e-=o-r.getDate()+1,r.setDate(1),a<11?r.setMonth(a+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Xn(t,e,r){var n=r>0?r:xe(t)+1,a=new Array(n),o=Ee(t,a,0,a.length);return e&&(a.length=o),a}var qn=(t,e)=>{G.set(t,e)},Jn=(t,e,r,n)=>{var a=A[n+40>>2],o={tm_sec:k[n>>2],tm_min:k[n+4>>2],tm_hour:k[n+8>>2],tm_mday:k[n+12>>2],tm_mon:k[n+16>>2],tm_year:k[n+20>>2],tm_wday:k[n+24>>2],tm_yday:k[n+28>>2],tm_isdst:k[n+32>>2],tm_gmtoff:k[n+36>>2],tm_zone:a?Nt(a):""},s=Nt(r),u={"%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 l in u)s=s.replace(new RegExp(l,"g"),u[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(d,m,M){for(var I=typeof d=="number"?d.toString():d||"";I.length<m;)I=M[0]+I;return I}function g(d,m){return y(d,m,"0")}function T(d,m){function M(it){return it<0?-1:it>0?1:0}var I;return(I=M(d.getFullYear()-m.getFullYear()))===0&&(I=M(d.getMonth()-m.getMonth()))===0&&(I=M(d.getDate()-m.getDate())),I}function x(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function R(d){var m=Gn(new Date(d.tm_year+1900,0,1),d.tm_yday),M=new Date(m.getFullYear(),0,4),I=new Date(m.getFullYear()+1,0,4),it=x(M),It=x(I);return T(it,m)<=0?T(It,m)<=0?m.getFullYear()+1:m.getFullYear():m.getFullYear()-1}var S={"%a":d=>f[d.tm_wday].substring(0,3),"%A":d=>f[d.tm_wday],"%b":d=>h[d.tm_mon].substring(0,3),"%B":d=>h[d.tm_mon],"%C":d=>{var m=d.tm_year+1900;return g(m/100|0,2)},"%d":d=>g(d.tm_mday,2),"%e":d=>y(d.tm_mday,2," "),"%g":d=>R(d).toString().substring(2),"%G":d=>R(d),"%H":d=>g(d.tm_hour,2),"%I":d=>{var m=d.tm_hour;return m==0?m=12:m>12&&(m-=12),g(m,2)},"%j":d=>g(d.tm_mday+Nn(Mt(d.tm_year+1900)?Me:je,d.tm_mon-1),3),"%m":d=>g(d.tm_mon+1,2),"%M":d=>g(d.tm_min,2),"%n":()=>`
3
- `,"%p":d=>d.tm_hour>=0&&d.tm_hour<12?"AM":"PM","%S":d=>g(d.tm_sec,2),"%t":()=>" ","%u":d=>d.tm_wday||7,"%U":d=>{var m=d.tm_yday+7-d.tm_wday;return g(Math.floor(m/7),2)},"%V":d=>{var m=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&m++,m){if(m==53){var M=(d.tm_wday+371-d.tm_yday)%7;M!=4&&(M!=3||!Mt(d.tm_year))&&(m=1)}}else{m=52;var I=(d.tm_wday+7-d.tm_yday-1)%7;(I==4||I==5&&Mt(d.tm_year%400-1))&&m++}return g(m,2)},"%w":d=>d.tm_wday,"%W":d=>{var m=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(m/7),2)},"%y":d=>(d.tm_year+1900).toString().substring(2),"%Y":d=>d.tm_year+1900,"%z":d=>{var m=d.tm_gmtoff,M=m>=0;return m=Math.abs(m)/60,m=m/60*100+m%60,(M?"+":"-")+("0000"+m).slice(-4)},"%Z":d=>d.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in S)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),S[l](o)));s=s.replace(/\0\0/g,"%");var H=Xn(s,!1);return H.length>e?0:(qn(H,t),H.length-1)},Qn=(t,e,r,n,a)=>Jn(t,e,r,n);ce=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Fr(),ct=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},zr(),Br(),Qr(),Ce=i.UnboundTypeError=en(Error,"UnboundTypeError"),on(),un();var Zn={q:$r,u:br,a:_r,h:Tr,l:Pr,I:Er,P:xr,n:Sr,ba:Ar,d:Cr,oa:Dr,Y:Or,fa:jr,na:rn,ma:nn,D:an,ea:cn,W:fn,J:dn,w:pn,s:mn,V:gn,L:Pn,Q:En,pa:xn,ga:Sn,U:Pe,la:On,R:Fn,ia:jn,ka:In,K:Rn,da:Hn,ca:Bn,$:Ln,aa:zn,H:va,T:Ea,B:wa,p:pa,b:Kn,C:ya,ha:ba,c:aa,j:ia,i:ra,x:ga,O:ma,v:da,G:_a,N:Ta,A:$a,F:xa,Z:Aa,X:Da,k:oa,f:na,e:ea,g:ta,M:Pa,m:fa,o:sa,S:ua,t:la,ja:ha,y:Ca,r:ca,E:Sa,z:Yn,_:Qn},D=wr(),tt=i._free=t=>(tt=i._free=D.sa)(t),Xt=i._malloc=t=>(Xt=i._malloc=D.ta)(t),Ie=t=>(Ie=D.va)(t);i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=D.wa)();var b=(t,e)=>(b=D.xa)(t,e),wt=t=>(wt=D.ya)(t),C=()=>(C=D.za)(),_=t=>(_=D.Aa)(t),Re=t=>(Re=D.Ba)(t),He=t=>(He=D.Ca)(t),We=(t,e,r)=>(We=D.Da)(t,e,r),ke=t=>(ke=D.Ea)(t);i.dynCall_viijii=(t,e,r,n,a,o,s)=>(i.dynCall_viijii=D.Fa)(t,e,r,n,a,o,s);var Be=i.dynCall_jiii=(t,e,r,n)=>(Be=i.dynCall_jiii=D.Ga)(t,e,r,n),Ue=i.dynCall_jiiii=(t,e,r,n,a)=>(Ue=i.dynCall_jiiii=D.Ha)(t,e,r,n,a);i.dynCall_iiiiij=(t,e,r,n,a,o,s)=>(i.dynCall_iiiiij=D.Ia)(t,e,r,n,a,o,s),i.dynCall_iiiiijj=(t,e,r,n,a,o,s,u,l)=>(i.dynCall_iiiiijj=D.Ja)(t,e,r,n,a,o,s,u,l),i.dynCall_iiiiiijj=(t,e,r,n,a,o,s,u,l,f)=>(i.dynCall_iiiiiijj=D.Ka)(t,e,r,n,a,o,s,u,l,f);function Kn(t,e){var r=C();try{return E(t)(e)}catch(n){if(_(r),n!==n+0)throw n;b(1,0)}}function ta(t,e,r,n){var a=C();try{E(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function ea(t,e,r){var n=C();try{E(t)(e,r)}catch(a){if(_(n),a!==a+0)throw a;b(1,0)}}function ra(t,e,r,n,a){var o=C();try{return E(t)(e,r,n,a)}catch(s){if(_(o),s!==s+0)throw s;b(1,0)}}function na(t,e){var r=C();try{E(t)(e)}catch(n){if(_(r),n!==n+0)throw n;b(1,0)}}function aa(t,e,r){var n=C();try{return E(t)(e,r)}catch(a){if(_(n),a!==a+0)throw a;b(1,0)}}function oa(t){var e=C();try{E(t)()}catch(r){if(_(e),r!==r+0)throw r;b(1,0)}}function ia(t,e,r,n){var a=C();try{return E(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function sa(t,e,r,n,a,o){var s=C();try{E(t)(e,r,n,a,o)}catch(u){if(_(s),u!==u+0)throw u;b(1,0)}}function ua(t,e,r,n,a,o,s){var u=C();try{E(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function ca(t,e,r,n,a,o,s,u,l,f,h){var y=C();try{E(t)(e,r,n,a,o,s,u,l,f,h)}catch(g){if(_(y),g!==g+0)throw g;b(1,0)}}function la(t,e,r,n,a,o,s,u){var l=C();try{E(t)(e,r,n,a,o,s,u)}catch(f){if(_(l),f!==f+0)throw f;b(1,0)}}function fa(t,e,r,n,a){var o=C();try{E(t)(e,r,n,a)}catch(s){if(_(o),s!==s+0)throw s;b(1,0)}}function da(t,e,r,n,a,o,s){var u=C();try{return E(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function ha(t,e,r,n,a,o,s,u,l){var f=C();try{E(t)(e,r,n,a,o,s,u,l)}catch(h){if(_(f),h!==h+0)throw h;b(1,0)}}function pa(t){var e=C();try{return E(t)()}catch(r){if(_(e),r!==r+0)throw r;b(1,0)}}function ma(t,e,r,n,a,o,s){var u=C();try{return E(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function ya(t,e,r,n){var a=C();try{return E(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function va(t,e,r,n){var a=C();try{return E(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function ga(t,e,r,n,a,o){var s=C();try{return E(t)(e,r,n,a,o)}catch(u){if(_(s),u!==u+0)throw u;b(1,0)}}function wa(t,e,r,n,a,o){var s=C();try{return E(t)(e,r,n,a,o)}catch(u){if(_(s),u!==u+0)throw u;b(1,0)}}function $a(t,e,r,n,a,o,s,u,l,f){var h=C();try{return E(t)(e,r,n,a,o,s,u,l,f)}catch(y){if(_(h),y!==y+0)throw y;b(1,0)}}function ba(t,e,r){var n=C();try{return E(t)(e,r)}catch(a){if(_(n),a!==a+0)throw a;b(1,0)}}function Ca(t,e,r,n,a,o,s,u,l,f){var h=C();try{E(t)(e,r,n,a,o,s,u,l,f)}catch(y){if(_(h),y!==y+0)throw y;b(1,0)}}function _a(t,e,r,n,a,o,s,u){var l=C();try{return E(t)(e,r,n,a,o,s,u)}catch(f){if(_(l),f!==f+0)throw f;b(1,0)}}function Ta(t,e,r,n,a,o,s,u,l){var f=C();try{return E(t)(e,r,n,a,o,s,u,l)}catch(h){if(_(f),h!==h+0)throw h;b(1,0)}}function Pa(t,e,r,n,a,o,s){var u=C();try{E(t)(e,r,n,a,o,s)}catch(l){if(_(u),l!==l+0)throw l;b(1,0)}}function Ea(t,e,r,n){var a=C();try{return E(t)(e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function xa(t,e,r,n,a,o,s,u,l,f,h,y){var g=C();try{return E(t)(e,r,n,a,o,s,u,l,f,h,y)}catch(T){if(_(g),T!==T+0)throw T;b(1,0)}}function Sa(t,e,r,n,a,o,s,u,l,f,h,y,g,T,x,R){var S=C();try{E(t)(e,r,n,a,o,s,u,l,f,h,y,g,T,x,R)}catch(H){if(_(S),H!==H+0)throw H;b(1,0)}}function Aa(t,e,r,n){var a=C();try{return Be(t,e,r,n)}catch(o){if(_(a),o!==o+0)throw o;b(1,0)}}function Da(t,e,r,n,a){var o=C();try{return Ue(t,e,r,n,a)}catch(s){if(_(o),s!==s+0)throw s;b(1,0)}}var jt;ht=function t(){jt||Ve(),jt||(ht=t)};function Ve(){if(rt>0||(ur(),rt>0))return;function t(){jt||(jt=!0,i.calledRun=!0,!ft&&(cr(),v(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),lr()))}i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ve(),p.ready}})();function Ga(c){return Qt(Zt,c)}async function Xa(c,{tryHarder:p=U.tryHarder,formats:i=U.formats,maxSymbols:v=U.maxSymbols}=U){return Ya(c,{tryHarder:p,formats:i,maxSymbols:v},Zt)}async function qa(c,{tryHarder:p=U.tryHarder,formats:i=U.formats,maxSymbols:v=U.maxSymbols}=U){return Na(c,{tryHarder:p,formats:i,maxSymbols:v},Zt)}const Jt=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Ja(c){for(const[p,i]of Jt)if(c===i)return p;return"unknown"}var lt;class Qa extends EventTarget{constructor(i={}){var v;super();ze(this,lt,void 0);try{const $=(v=i==null?void 0:i.formats)==null?void 0:v.filter(w=>w!=="unknown");if(($==null?void 0:$.length)===0)throw new TypeError("Hint option provided, but is empty.");$==null||$.forEach(w=>{if(!Ne.includes(w))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${w}' is not a valid enum value of type BarcodeFormat.`)}),Ye(this,lt,$??[]),Ga().then(w=>{this.dispatchEvent(new CustomEvent("load",{detail:w}))}).catch(w=>{this.dispatchEvent(new CustomEvent("error",{detail:w}))})}catch($){throw Ge($,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ne.filter(i=>i!=="unknown")}async detect(i){try{const v=await Ra(i);if(v===null)return[];let $;try{ar(v)?$=await Xa(v,{tryHarder:!0,formats:qt(this,lt).map(w=>Jt.get(w))}):$=await qa(v,{tryHarder:!0,formats:qt(this,lt).map(w=>Jt.get(w))})}catch(w){throw console.error(w),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return $.map(w=>{const{topLeft:{x:O,y:Y},topRight:{x:j,y:F},bottomLeft:{x:L,y:z},bottomRight:{x:V,y:N}}=w.position,J=Math.min(O,j,L,V),ft=Math.min(Y,F,z,N),G=Math.max(O,j,L,V),W=Math.max(Y,F,z,N);return{boundingBox:new DOMRectReadOnly(J,ft,G-J,W-ft),rawValue:new TextDecoder().decode(w.bytes),format:Ja(w.format),cornerPoints:[{x:O,y:Y},{x:j,y:F},{x:V,y:N},{x:L,y:z}]}})}catch(v){throw Ge(v,"Failed to execute 'detect' on 'BarcodeDetector'")}}}lt=new WeakMap;exports.BarcodeDetector=Qa;exports.setZXingModuleOverrides=za;
1
+ "use strict";var aa=(d,g,u)=>{if(!g.has(d))throw TypeError("Cannot "+u)};var Kn=(d,g,u)=>(aa(d,g,"read from private field"),u?u.call(d):g.get(d)),oa=(d,g,u)=>{if(g.has(d))throw TypeError("Cannot add the same private member more than once");g instanceof WeakSet?g.add(d):g.set(d,u)},ia=(d,g,u,x)=>(aa(d,g,"write to private field"),x?x.call(d,u):g.set(d,u),u);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const sa=["aztec","code_128","code_39","code_93","codabar","data_matrix","ean_13","ean_8","itf","pdf417","qr_code","upc_a","upc_e","unknown"];function Ca(d){if(da(d))return{width:d.naturalWidth,height:d.naturalHeight};if(ha(d))return{width:d.width.baseVal.value,height:d.height.baseVal.value};if(fa(d))return{width:d.videoWidth,height:d.videoHeight};if(ma(d))return{width:d.width,height:d.height};if(va(d))return{width:d.displayWidth,height:d.displayHeight};if(pa(d))return{width:d.width,height:d.height};if(ya(d))return{width:d.width,height:d.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function da(d){try{return d instanceof HTMLImageElement}catch{return!1}}function ha(d){try{return d instanceof SVGImageElement}catch{return!1}}function fa(d){try{return d instanceof HTMLVideoElement}catch{return!1}}function pa(d){try{return d instanceof HTMLCanvasElement}catch{return!1}}function ma(d){try{return d instanceof ImageBitmap}catch{return!1}}function ya(d){try{return d instanceof OffscreenCanvas}catch{return!1}}function va(d){try{return d instanceof VideoFrame}catch{return!1}}function ga(d){try{return d instanceof Blob}catch{return!1}}function _a(d){try{return d instanceof ImageData}catch{return!1}}function Ta(d,g){try{const u=new OffscreenCanvas(d,g);if(u.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return u;throw void 0}catch{const u=document.createElement("canvas");return u.width=d,u.height=g,u}}async function $a(d){if(da(d)&&!await Sa(d))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ha(d)&&!await Oa(d))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(va(d)&&Fa(d))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(fa(d)&&(d.readyState===0||d.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ma(d)&&ja(d))throw new DOMException("The image source is detached.","InvalidStateError");const{width:g,height:u}=Ca(d);if(g===0||u===0)return null;const _=Ta(g,u).getContext("2d");_.drawImage(d,0,0);try{return _.getImageData(0,0,g,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Pa(d){let g;try{if(createImageBitmap)g=await createImageBitmap(d);else if(Image){g=new Image;let x="";try{x=URL.createObjectURL(d),g.src=x,await g.decode()}finally{URL.revokeObjectURL(x)}}else return d}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await $a(g)}function Aa(d){const{width:g,height:u}=d;if(g===0||u===0)return null;const x=d.getContext("2d");try{return x.getImageData(0,0,g,u)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Ea(d){if(ga(d))return await Pa(d);if(_a(d)){if(Da(d))throw new DOMException("The image data has been detached.","InvalidStateError");return d}return pa(d)||ya(d)?Aa(d):await $a(d)}async function Sa(d){try{return await d.decode(),!0}catch{return!1}}async function Oa(d){var g;try{return await((g=d.decode)==null?void 0:g.call(d)),!0}catch{return!1}}function Fa(d){return d.format===null}function Da(d){return d.data.buffer.byteLength===0}function ja(d){return d.width===0&&d.height===0}function ua(d,g){return d instanceof DOMException?new DOMException(`${g}: ${d.message}`,d.name):d instanceof Error?new d.constructor(`${g}: ${d.message}`):new Error(`${g}: ${d}`)}const ca=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","UPC-A","UPC-E"];function xa(d){return d.join("|")}function Wa(d){const g=la(d);let u=0,x=ca.length-1;for(;u<=x;){const _=Math.floor((u+x)/2),W=ca[_],J=la(W);if(J===g)return W;J<g?u=_+1:x=_-1}return"None"}function la(d){return d.toLowerCase().replace(/_-\[\]/g,"")}function Ma(d,g){return d.Binarizer[g]}function Ra(d,g){return d.CharacterSet[g]}const Ia=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function ka(d){return Ia[d.value]}function Ha(d,g){return d.EanAddOnSymbol[g]}function Ua(d,g){return d.TextMode[g]}const He={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function wa(d,g){return{...g,formats:xa(g.formats),binarizer:Ma(d,g.binarizer),eanAddOnSymbol:Ha(d,g.eanAddOnSymbol),textMode:Ua(d,g.textMode),characterSet:Ra(d,g.characterSet)}}function ba(d){return{...d,format:Wa(d.format),eccLevel:d.eccLevel,contentType:ka(d.contentType)}}const Va={locateFile:(d,g)=>{const u=d.match(/_(.+?)\.wasm$/);return u?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.0.0-rc.3/dist/${u[1]}/${d}`:g+d}};let ta=new WeakMap;function ra(d,g){var u;const x=ta.get(d);if(x!=null&&x.modulePromise&&(g===void 0||Object.is(g,x.moduleOverrides)))return x.modulePromise;const _=(u=g??(x==null?void 0:x.moduleOverrides))!=null?u:Va,W=d({..._});return ta.set(d,{moduleOverrides:_,modulePromise:W}),W}function Ba(d,g){ta.set(d,{moduleOverrides:g})}async function Ya(d,g,u=He){const x={...He,...u},_=await ra(d),{size:W}=g,J=new Uint8Array(await g.arrayBuffer()),Z=_._malloc(W);_.HEAPU8.set(J,Z);const q=_.readBarcodesFromImage(Z,W,wa(_,x));_._free(Z);const I=[];for(let rt=0;rt<q.size();++rt)I.push(ba(q.get(rt)));return I}async function La(d,g,u=He){const x={...He,...u},_=await ra(d),{data:W,width:J,height:Z,data:{byteLength:q}}=g,I=_._malloc(q);_.HEAPU8.set(W,I);const rt=_.readBarcodesFromPixmap(I,J,Z,wa(_,x));_._free(I);const nt=[];for(let z=0;z<rt.size();++z)nt.push(ba(rt.get(z)));return nt}var na=(()=>{var d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(g={}){var u=g,x,_;u.ready=new Promise((n,t)=>{x=n,_=t});var W=Object.assign({},u),J="./this.program",Z=typeof window=="object",q=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var I="";function rt(n){return u.locateFile?u.locateFile(n,I):I+n}var nt;(Z||q)&&(q?I=self.location.href:typeof document<"u"&&document.currentScript&&(I=document.currentScript.src),d&&(I=d),I.indexOf("blob:")!==0?I=I.substr(0,I.replace(/[?#].*/,"").lastIndexOf("/")+1):I="",q&&(nt=n=>{var t=new XMLHttpRequest;return t.open("GET",n,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)})),u.print||console.log.bind(console);var z=u.printErr||console.error.bind(console);Object.assign(u,W),W=null,u.arguments&&u.arguments,u.thisProgram&&(J=u.thisProgram),u.quit&&u.quit;var Q;u.wasmBinary&&(Q=u.wasmBinary),typeof WebAssembly!="object"&&ht("no native wasm support detected");var ut,Ft=!1;function Zt(n,t){n||ht(t)}var U,k,at,lt,R,C,Qt,Kt;function te(){var n=ut.buffer;u.HEAP8=U=new Int8Array(n),u.HEAP16=at=new Int16Array(n),u.HEAPU8=k=new Uint8Array(n),u.HEAPU16=lt=new Uint16Array(n),u.HEAP32=R=new Int32Array(n),u.HEAPU32=C=new Uint32Array(n),u.HEAPF32=Qt=new Float32Array(n),u.HEAPF64=Kt=new Float64Array(n)}var ee=[],re=[],ne=[];function Ue(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Ye(u.preRun.shift());Dt(ee)}function Ve(){Dt(re)}function Be(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)ze(u.postRun.shift());Dt(ne)}function Ye(n){ee.unshift(n)}function Le(n){re.unshift(n)}function ze(n){ne.unshift(n)}var K=0,dt=null;function Ne(n){K++,u.monitorRunDependencies&&u.monitorRunDependencies(K)}function Ge(n){if(K--,u.monitorRunDependencies&&u.monitorRunDependencies(K),K==0&&dt){var t=dt;dt=null,t()}}function ht(n){u.onAbort&&u.onAbort(n),n="Aborted("+n+")",z(n),Ft=!0,n+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(n);throw _(t),t}var qe="data:application/octet-stream;base64,",ae=n=>n.startsWith(qe),ot;ot="zxing_reader.wasm",ae(ot)||(ot=rt(ot));function oe(n){if(n==ot&&Q)return new Uint8Array(Q);if(nt)return nt(n);throw"both async and sync fetching of the wasm failed"}function Xe(n){return!Q&&(Z||q)&&typeof fetch=="function"?fetch(n,{credentials:"same-origin"}).then(t=>{if(!t.ok)throw"failed to load wasm binary file at '"+n+"'";return t.arrayBuffer()}).catch(()=>oe(n)):Promise.resolve().then(()=>oe(n))}function ie(n,t,e){return Xe(n).then(r=>WebAssembly.instantiate(r,t)).then(r=>r).then(e,r=>{z(`failed to asynchronously prepare wasm: ${r}`),ht(r)})}function Je(n,t,e,r){return!n&&typeof WebAssembly.instantiateStreaming=="function"&&!ae(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(a=>{var o=WebAssembly.instantiateStreaming(a,e);return o.then(r,function(i){return z(`wasm streaming compile failed: ${i}`),z("falling back to ArrayBuffer instantiation"),ie(t,e,r)})}):ie(t,e,r)}function Ze(){var n={a:jn};function t(r,a){return P=r.exports,ut=P.fa,te(),ge=P.ja,Le(P.ga),Ge(),P}Ne();function e(r){t(r.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(n,t)}catch(r){z(`Module.instantiateWasm callback failed with error: ${r}`),_(r)}return Je(Q,ot,n,e).catch(_),{}}var Dt=n=>{for(;n.length>0;)n.shift()(u)};u.noExitRuntime;var $t=[],wt=0,Qe=n=>{var t=new jt(n);return t.get_caught()||(t.set_caught(!0),wt--),t.set_rethrown(!1),$t.push(t),We(t.excPtr),t.get_exception_ptr()},N=0,Ke=()=>{T(0,0);var n=$t.pop();xe(n.excPtr),N=0};function jt(n){this.excPtr=n,this.ptr=n-24,this.set_type=function(t){C[this.ptr+4>>2]=t},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(t){C[this.ptr+8>>2]=t},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,U[this.ptr+12>>0]=t},this.get_caught=function(){return U[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,U[this.ptr+13>>0]=t},this.get_rethrown=function(){return U[this.ptr+13>>0]!=0},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){C[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){var t=Re(this.get_type());if(t)return C[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}var tr=n=>{throw N||(N=n),N},xt=n=>{var t=N;if(!t)return gt(0),0;var e=new jt(t);e.set_adjusted_ptr(t);var r=e.get_type();if(!r)return gt(0),t;for(var a in n){var o=n[a];if(o===0||o===r)break;var i=e.ptr+16;if(Me(o,r,i))return gt(o),t}return gt(r),t},er=()=>xt([]),rr=n=>xt([n]),nr=(n,t)=>xt([n,t]),ar=()=>{var n=$t.pop();n||ht("no exception to throw");var t=n.excPtr;throw n.get_rethrown()||($t.push(n),n.set_rethrown(!0),n.set_caught(!1),wt++),N=t,N},or=(n,t,e)=>{var r=new jt(n);throw r.init(t,e),N=n,wt++,N},ir=()=>wt,bt={},se=n=>{for(;n.length;){var t=n.pop(),e=n.pop();e(t)}};function Wt(n){return this.fromWireType(R[n>>2])}var it={},tt={},Ct={},ue,_t=n=>{throw new ue(n)},et=(n,t,e)=>{n.forEach(function(s){Ct[s]=t});function r(s){var c=e(s);c.length!==n.length&&_t("Mismatched type converter count");for(var l=0;l<n.length;++l)Y(n[l],c[l])}var a=new Array(t.length),o=[],i=0;t.forEach((s,c)=>{tt.hasOwnProperty(s)?a[c]=tt[s]:(o.push(s),it.hasOwnProperty(s)||(it[s]=[]),it[s].push(()=>{a[c]=tt[s],++i,i===o.length&&r(a)}))}),o.length===0&&r(a)},sr=n=>{var t=bt[n];delete bt[n];var e=t.rawConstructor,r=t.rawDestructor,a=t.fields,o=a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType));et([n],o,i=>{var s={};return a.forEach((c,l)=>{var f=c.fieldName,m=i[l],y=c.getter,$=c.getterContext,b=i[l+a.length],O=c.setter,F=c.setterContext;s[f]={read:D=>m.fromWireType(y($,D)),write:(D,p)=>{var h=[];O(F,D,b.toWireType(h,p)),se(h)}}}),[{name:t.name,fromWireType:c=>{var l={};for(var f in s)l[f]=s[f].read(c);return r(c),l},toWireType:(c,l)=>{for(var f in s)if(!(f in l))throw new TypeError(`Missing field: "${f}"`);var m=e();for(f in s)s[f].write(m,l[f]);return c!==null&&c.push(r,m),m},argPackAdvance:L,readValueFromPointer:Wt,destructorFunction:r}]})},ur=(n,t,e,r,a)=>{},cr=()=>{for(var n=new Array(256),t=0;t<256;++t)n[t]=String.fromCharCode(t);ce=n},ce,M=n=>{for(var t="",e=n;k[e];)t+=ce[k[e++]];return t},st,w=n=>{throw new st(n)};function lr(n,t,e={}){var r=t.name;if(n||w(`type "${r}" must have a positive integer typeid pointer`),tt.hasOwnProperty(n)){if(e.ignoreDuplicateRegistrations)return;w(`Cannot register type '${r}' twice`)}if(tt[n]=t,delete Ct[n],it.hasOwnProperty(n)){var a=it[n];delete it[n],a.forEach(o=>o())}}function Y(n,t,e={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return lr(n,t,e)}var L=8,dr=(n,t,e,r)=>{t=M(t),Y(n,{name:t,fromWireType:function(a){return!!a},toWireType:function(a,o){return o?e:r},argPackAdvance:L,readValueFromPointer:function(a){return this.fromWireType(k[a])},destructorFunction:null})},hr=n=>({count:n.count,deleteScheduled:n.deleteScheduled,preservePointerOnDelete:n.preservePointerOnDelete,ptr:n.ptr,ptrType:n.ptrType,smartPtr:n.smartPtr,smartPtrType:n.smartPtrType}),Mt=n=>{function t(e){return e.$$.ptrType.registeredClass.name}w(t(n)+" instance already deleted")},Rt=!1,le=n=>{},fr=n=>{n.smartPtr?n.smartPtrType.rawDestructor(n.smartPtr):n.ptrType.registeredClass.rawDestructor(n.ptr)},de=n=>{n.count.value-=1;var t=n.count.value===0;t&&fr(n)},he=(n,t,e)=>{if(t===e)return n;if(e.baseClass===void 0)return null;var r=he(n,t,e.baseClass);return r===null?null:e.downcast(r)},fe={},pr=()=>Object.keys(mt).length,mr=()=>{var n=[];for(var t in mt)mt.hasOwnProperty(t)&&n.push(mt[t]);return n},ft=[],It=()=>{for(;ft.length;){var n=ft.pop();n.$$.deleteScheduled=!1,n.delete()}},pt,yr=n=>{pt=n,ft.length&&pt&&pt(It)},vr=()=>{u.getInheritedInstanceCount=pr,u.getLiveInheritedInstances=mr,u.flushPendingDeletes=It,u.setDelayFunction=yr},mt={},gr=(n,t)=>{for(t===void 0&&w("ptr should not be undefined");n.baseClass;)t=n.upcast(t),n=n.baseClass;return t},$r=(n,t)=>(t=gr(n,t),mt[t]),Tt=(n,t)=>{(!t.ptrType||!t.ptr)&&_t("makeClassHandle requires ptr and ptrType");var e=!!t.smartPtrType,r=!!t.smartPtr;return e!==r&&_t("Both smartPtrType and smartPtr must be specified"),t.count={value:1},yt(Object.create(n,{$$:{value:t}}))};function wr(n){var t=this.getPointee(n);if(!t)return this.destructor(n),null;var e=$r(this.registeredClass,t);if(e!==void 0){if(e.$$.count.value===0)return e.$$.ptr=t,e.$$.smartPtr=n,e.clone();var r=e.clone();return this.destructor(n),r}function a(){return this.isSmartPointer?Tt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:n}):Tt(this.registeredClass.instancePrototype,{ptrType:this,ptr:n})}var o=this.registeredClass.getActualType(t),i=fe[o];if(!i)return a.call(this);var s;this.isConst?s=i.constPointerType:s=i.pointerType;var c=he(t,this.registeredClass,s.registeredClass);return c===null?a.call(this):this.isSmartPointer?Tt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:n}):Tt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}var yt=n=>typeof FinalizationRegistry>"u"?(yt=t=>t,n):(Rt=new FinalizationRegistry(t=>{de(t.$$)}),yt=t=>{var e=t.$$,r=!!e.smartPtr;if(r){var a={$$:e};Rt.register(t,a,t)}return t},le=t=>Rt.unregister(t),yt(n)),br=()=>{Object.assign(Pt.prototype,{isAliasOf(n){if(!(this instanceof Pt)||!(n instanceof Pt))return!1;var t=this.$$.ptrType.registeredClass,e=this.$$.ptr;n.$$=n.$$;for(var r=n.$$.ptrType.registeredClass,a=n.$$.ptr;t.baseClass;)e=t.upcast(e),t=t.baseClass;for(;r.baseClass;)a=r.upcast(a),r=r.baseClass;return t===r&&e===a},clone(){if(this.$$.ptr||Mt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var n=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:hr(this.$$)}}));return n.$$.count.value+=1,n.$$.deleteScheduled=!1,n},delete(){this.$$.ptr||Mt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&w("Object already scheduled for deletion"),le(this),de(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Mt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&w("Object already scheduled for deletion"),ft.push(this),ft.length===1&&pt&&pt(It),this.$$.deleteScheduled=!0,this}})};function Pt(){}var Cr=48,_r=57,pe=n=>{if(n===void 0)return"_unknown";n=n.replace(/[^a-zA-Z0-9_]/g,"$");var t=n.charCodeAt(0);return t>=Cr&&t<=_r?`_${n}`:n};function kt(n,t){return n=pe(n),{[n]:function(){return t.apply(this,arguments)}}[n]}var me=(n,t,e)=>{if(n[t].overloadTable===void 0){var r=n[t];n[t]=function(){return n[t].overloadTable.hasOwnProperty(arguments.length)||w(`Function '${e}' called with an invalid number of arguments (${arguments.length}) - expects one of (${n[t].overloadTable})!`),n[t].overloadTable[arguments.length].apply(this,arguments)},n[t].overloadTable=[],n[t].overloadTable[r.argCount]=r}},Ht=(n,t,e)=>{u.hasOwnProperty(n)?((e===void 0||u[n].overloadTable!==void 0&&u[n].overloadTable[e]!==void 0)&&w(`Cannot register public name '${n}' twice`),me(u,n,n),u.hasOwnProperty(e)&&w(`Cannot register multiple overloads of a function with the same number of arguments (${e})!`),u[n].overloadTable[e]=t):(u[n]=t,e!==void 0&&(u[n].numArguments=e))};function Tr(n,t,e,r,a,o,i,s){this.name=n,this.constructor=t,this.instancePrototype=e,this.rawDestructor=r,this.baseClass=a,this.getActualType=o,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Ut=(n,t,e)=>{for(;t!==e;)t.upcast||w(`Expected null or instance of ${e.name}, got an instance of ${t.name}`),n=t.upcast(n),t=t.baseClass;return n};function Pr(n,t){if(t===null)return this.isReference&&w(`null is not a valid ${this.name}`),0;t.$$||w(`Cannot pass "${Lt(t)}" as a ${this.name}`),t.$$.ptr||w(`Cannot pass deleted object as a pointer of type ${this.name}`);var e=t.$$.ptrType.registeredClass,r=Ut(t.$$.ptr,e,this.registeredClass);return r}function Ar(n,t){var e;if(t===null)return this.isReference&&w(`null is not a valid ${this.name}`),this.isSmartPointer?(e=this.rawConstructor(),n!==null&&n.push(this.rawDestructor,e),e):0;t.$$||w(`Cannot pass "${Lt(t)}" as a ${this.name}`),t.$$.ptr||w(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&w(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(e=Ut(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&w("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?e=t.$$.smartPtr:w(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:e=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)e=t.$$.smartPtr;else{var a=t.clone();e=this.rawShare(e,X.toHandle(()=>a.delete())),n!==null&&n.push(this.rawDestructor,e)}break;default:w("Unsupporting sharing policy")}return e}function Er(n,t){if(t===null)return this.isReference&&w(`null is not a valid ${this.name}`),0;t.$$||w(`Cannot pass "${Lt(t)}" as a ${this.name}`),t.$$.ptr||w(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&w(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var e=t.$$.ptrType.registeredClass,r=Ut(t.$$.ptr,e,this.registeredClass);return r}function ye(n){return this.fromWireType(C[n>>2])}var Sr=()=>{Object.assign(At.prototype,{getPointee(n){return this.rawGetPointee&&(n=this.rawGetPointee(n)),n},destructor(n){this.rawDestructor&&this.rawDestructor(n)},argPackAdvance:L,readValueFromPointer:ye,deleteObject(n){n!==null&&n.delete()},fromWireType:wr})};function At(n,t,e,r,a,o,i,s,c,l,f){this.name=n,this.registeredClass=t,this.isReference=e,this.isConst=r,this.isSmartPointer=a,this.pointeeType=o,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=f,!a&&t.baseClass===void 0?r?(this.toWireType=Pr,this.destructorFunction=null):(this.toWireType=Er,this.destructorFunction=null):this.toWireType=Ar}var ve=(n,t,e)=>{u.hasOwnProperty(n)||_t("Replacing nonexistant public symbol"),u[n].overloadTable!==void 0&&e!==void 0?u[n].overloadTable[e]=t:(u[n]=t,u[n].argCount=e)},Or=(n,t,e)=>{var r=u["dynCall_"+n];return e&&e.length?r.apply(null,[t].concat(e)):r.call(null,t)},Et=[],ge,A=n=>{var t=Et[n];return t||(n>=Et.length&&(Et.length=n+1),Et[n]=t=ge.get(n)),t},Fr=(n,t,e)=>{if(n.includes("j"))return Or(n,t,e);var r=A(t).apply(null,e);return r},Dr=(n,t)=>{var e=[];return function(){return e.length=0,Object.assign(e,arguments),Fr(n,t,e)}},B=(n,t)=>{n=M(n);function e(){return n.includes("j")?Dr(n,t):A(t)}var r=e();return typeof r!="function"&&w(`unknown function pointer with signature ${n}: ${t}`),r},jr=(n,t)=>{var e=kt(t,function(r){this.name=t,this.message=r;var a=new Error(r).stack;a!==void 0&&(this.stack=this.toString()+`
2
+ `+a.replace(/^Error(:[^\n]*)?\n/,""))});return e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},e},$e,we=n=>{var t=je(n),e=M(t);return G(t),e},St=(n,t)=>{var e=[],r={};function a(o){if(!r[o]&&!tt[o]){if(Ct[o]){Ct[o].forEach(a);return}e.push(o),r[o]=!0}}throw t.forEach(a),new $e(`${n}: `+e.map(we).join([", "]))},xr=(n,t,e,r,a,o,i,s,c,l,f,m,y)=>{f=M(f),o=B(a,o),s&&(s=B(i,s)),l&&(l=B(c,l)),y=B(m,y);var $=pe(f);Ht($,function(){St(`Cannot construct ${f} due to unbound types`,[r])}),et([n,t,e],r?[r]:[],function(b){b=b[0];var O,F;r?(O=b.registeredClass,F=O.instancePrototype):F=Pt.prototype;var D=kt($,function(){if(Object.getPrototypeOf(this)!==p)throw new st("Use 'new' to construct "+f);if(h.constructor_body===void 0)throw new st(f+" has no accessible constructor");var ct=h.constructor_body[arguments.length];if(ct===void 0)throw new st(`Tried to invoke ctor of ${f} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(h.constructor_body).toString()}) parameters instead!`);return ct.apply(this,arguments)}),p=Object.create(F,{constructor:{value:D}});D.prototype=p;var h=new Tr(f,D,p,y,O,o,s,l);h.baseClass&&(h.baseClass.__derivedClasses===void 0&&(h.baseClass.__derivedClasses=[]),h.baseClass.__derivedClasses.push(h));var v=new At(f,h,!0,!1,!1),j=new At(f+"*",h,!1,!1,!1),H=new At(f+" const*",h,!1,!0,!1);return fe[n]={pointerType:j,constPointerType:H},ve($,D),[v,j,H]})},Vt=(n,t)=>{for(var e=[],r=0;r<n;r++)e.push(C[t+r*4>>2]);return e};function Bt(n,t,e,r,a,o){var i=t.length;i<2&&w("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=t[1]!==null&&e!==null,c=!1,l=1;l<t.length;++l)if(t[l]!==null&&t[l].destructorFunction===void 0){c=!0;break}var f=t[0].name!=="void",m=i-2,y=new Array(m),$=[],b=[];return function(){arguments.length!==m&&w(`function ${n} called with ${arguments.length} arguments, expected ${m}`),b.length=0;var O;$.length=s?2:1,$[0]=a,s&&(O=t[1].toWireType(b,this),$[1]=O);for(var F=0;F<m;++F)y[F]=t[F+2].toWireType(b,arguments[F]),$.push(y[F]);var D=r.apply(null,$);function p(h){if(c)se(b);else for(var v=s?1:2;v<t.length;v++){var j=v===1?O:y[v-2];t[v].destructorFunction!==null&&t[v].destructorFunction(j)}if(f)return t[0].fromWireType(h)}return p(D)}}var Wr=(n,t,e,r,a,o)=>{var i=Vt(t,e);a=B(r,a),et([],[n],function(s){s=s[0];var c=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[t-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[t-1]=()=>{St(`Cannot construct ${s.name} due to unbound types`,i)},et([],i,l=>(l.splice(1,0,null),s.registeredClass.constructor_body[t-1]=Bt(c,l,null,a,o),[])),[]})},be=n=>{n=n.trim();const t=n.indexOf("(");return t!==-1?(Zt(n[n.length-1]==")","Parentheses for argument names should match."),n.substr(0,t)):n},Mr=(n,t,e,r,a,o,i,s,c)=>{var l=Vt(e,r);t=M(t),t=be(t),o=B(a,o),et([],[n],function(f){f=f[0];var m=`${f.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&f.registeredClass.pureVirtualFunctions.push(t);function y(){St(`Cannot call ${m} due to unbound types`,l)}var $=f.registeredClass.instancePrototype,b=$[t];return b===void 0||b.overloadTable===void 0&&b.className!==f.name&&b.argCount===e-2?(y.argCount=e-2,y.className=f.name,$[t]=y):(me($,t,m),$[t].overloadTable[e-2]=y),et([],l,function(O){var F=Bt(m,O,f,o,i);return $[t].overloadTable===void 0?(F.argCount=e-2,$[t]=F):$[t].overloadTable[e-2]=F,[]}),[]})};function Rr(){Object.assign(Ce.prototype,{get(n){return this.allocated[n]},has(n){return this.allocated[n]!==void 0},allocate(n){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=n,t},free(n){this.allocated[n]=void 0,this.freelist.push(n)}})}function Ce(){this.allocated=[void 0],this.freelist=[]}var V=new Ce,_e=n=>{n>=V.reserved&&--V.get(n).refcount===0&&V.free(n)},Ir=()=>{for(var n=0,t=V.reserved;t<V.allocated.length;++t)V.allocated[t]!==void 0&&++n;return n},kr=()=>{V.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),V.reserved=V.allocated.length,u.count_emval_handles=Ir},X={toValue:n=>(n||w("Cannot use deleted val. handle = "+n),V.get(n).value),toHandle:n=>{switch(n){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return V.allocate({refcount:1,value:n})}}},Hr=(n,t)=>{t=M(t),Y(n,{name:t,fromWireType:e=>{var r=X.toValue(e);return _e(e),r},toWireType:(e,r)=>X.toHandle(r),argPackAdvance:L,readValueFromPointer:Wt,destructorFunction:null})},Ur=(n,t,e)=>{switch(t){case 1:return e?function(r){return this.fromWireType(U[r>>0])}:function(r){return this.fromWireType(k[r>>0])};case 2:return e?function(r){return this.fromWireType(at[r>>1])}:function(r){return this.fromWireType(lt[r>>1])};case 4:return e?function(r){return this.fromWireType(R[r>>2])}:function(r){return this.fromWireType(C[r>>2])};default:throw new TypeError(`invalid integer width (${t}): ${n}`)}},Vr=(n,t,e,r)=>{t=M(t);function a(){}a.values={},Y(n,{name:t,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:(o,i)=>i.value,argPackAdvance:L,readValueFromPointer:Ur(t,e,r),destructorFunction:null}),Ht(t,a)},Yt=(n,t)=>{var e=tt[n];return e===void 0&&w(t+" has unknown type "+we(n)),e},Br=(n,t,e)=>{var r=Yt(n,"enum");t=M(t);var a=r.constructor,o=Object.create(r.constructor.prototype,{value:{value:e},constructor:{value:kt(`${r.name}_${t}`,function(){})}});a.values[e]=o,a[t]=o},Lt=n=>{if(n===null)return"null";var t=typeof n;return t==="object"||t==="array"||t==="function"?n.toString():""+n},Yr=(n,t)=>{switch(t){case 4:return function(e){return this.fromWireType(Qt[e>>2])};case 8:return function(e){return this.fromWireType(Kt[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${n}`)}},Lr=(n,t,e)=>{t=M(t),Y(n,{name:t,fromWireType:r=>r,toWireType:(r,a)=>a,argPackAdvance:L,readValueFromPointer:Yr(t,e),destructorFunction:null})},zr=(n,t,e,r,a,o,i)=>{var s=Vt(t,e);n=M(n),n=be(n),a=B(r,a),Ht(n,function(){St(`Cannot call ${n} due to unbound types`,s)},t-1),et([],s,function(c){var l=[c[0],null].concat(c.slice(1));return ve(n,Bt(n,l,null,a,o),t-1),[]})},Nr=(n,t,e)=>{switch(t){case 1:return e?r=>U[r>>0]:r=>k[r>>0];case 2:return e?r=>at[r>>1]:r=>lt[r>>1];case 4:return e?r=>R[r>>2]:r=>C[r>>2];default:throw new TypeError(`invalid integer width (${t}): ${n}`)}},Gr=(n,t,e,r,a)=>{t=M(t);var o=f=>f;if(r===0){var i=32-8*e;o=f=>f<<i>>>i}var s=t.includes("unsigned"),c=(f,m)=>{},l;s?l=function(f,m){return c(m,this.name),m>>>0}:l=function(f,m){return c(m,this.name),m},Y(n,{name:t,fromWireType:o,toWireType:l,argPackAdvance:L,readValueFromPointer:Nr(t,e,r!==0),destructorFunction:null})},qr=(n,t,e)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=r[t];function o(i){var s=C[i>>2],c=C[i+4>>2];return new a(U.buffer,c,s)}e=M(e),Y(n,{name:e,fromWireType:o,argPackAdvance:L,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Te=(n,t,e,r)=>{if(!(r>0))return 0;for(var a=e,o=e+r-1,i=0;i<n.length;++i){var s=n.charCodeAt(i);if(s>=55296&&s<=57343){var c=n.charCodeAt(++i);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(e>=o)break;t[e++]=s}else if(s<=2047){if(e+1>=o)break;t[e++]=192|s>>6,t[e++]=128|s&63}else if(s<=65535){if(e+2>=o)break;t[e++]=224|s>>12,t[e++]=128|s>>6&63,t[e++]=128|s&63}else{if(e+3>=o)break;t[e++]=240|s>>18,t[e++]=128|s>>12&63,t[e++]=128|s>>6&63,t[e++]=128|s&63}}return t[e]=0,e-a},Xr=(n,t,e)=>Te(n,k,t,e),Pe=n=>{for(var t=0,e=0;e<n.length;++e){var r=n.charCodeAt(e);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++e):t+=3}return t},Ae=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Jr=(n,t,e)=>{for(var r=t+e,a=t;n[a]&&!(a>=r);)++a;if(a-t>16&&n.buffer&&Ae)return Ae.decode(n.subarray(t,a));for(var o="";t<a;){var i=n[t++];if(!(i&128)){o+=String.fromCharCode(i);continue}var s=n[t++]&63;if((i&224)==192){o+=String.fromCharCode((i&31)<<6|s);continue}var c=n[t++]&63;if((i&240)==224?i=(i&15)<<12|s<<6|c:i=(i&7)<<18|s<<12|c<<6|n[t++]&63,i<65536)o+=String.fromCharCode(i);else{var l=i-65536;o+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return o},zt=(n,t)=>n?Jr(k,n,t):"",Zr=(n,t)=>{t=M(t);var e=t==="std::string";Y(n,{name:t,fromWireType(r){var a=C[r>>2],o=r+4,i;if(e)for(var s=o,c=0;c<=a;++c){var l=o+c;if(c==a||k[l]==0){var f=l-s,m=zt(s,f);i===void 0?i=m:(i+=String.fromCharCode(0),i+=m),s=l+1}}else{for(var y=new Array(a),c=0;c<a;++c)y[c]=String.fromCharCode(k[o+c]);i=y.join("")}return G(r),i},toWireType(r,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var o,i=typeof a=="string";i||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||w("Cannot pass non-string to std::string"),e&&i?o=Pe(a):o=a.length;var s=Gt(4+o+1),c=s+4;if(C[s>>2]=o,e&&i)Xr(a,c,o+1);else if(i)for(var l=0;l<o;++l){var f=a.charCodeAt(l);f>255&&(G(c),w("String has UTF-16 code units that do not fit in 8 bits")),k[c+l]=f}else for(var l=0;l<o;++l)k[c+l]=a[l];return r!==null&&r.push(G,s),s},argPackAdvance:L,readValueFromPointer:ye,destructorFunction(r){G(r)}})},Ee=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qr=(n,t)=>{for(var e=n,r=e>>1,a=r+t/2;!(r>=a)&&lt[r];)++r;if(e=r<<1,e-n>32&&Ee)return Ee.decode(k.subarray(n,e));for(var o="",i=0;!(i>=t/2);++i){var s=at[n+i*2>>1];if(s==0)break;o+=String.fromCharCode(s)}return o},Kr=(n,t,e)=>{if(e===void 0&&(e=2147483647),e<2)return 0;e-=2;for(var r=t,a=e<n.length*2?e/2:n.length,o=0;o<a;++o){var i=n.charCodeAt(o);at[t>>1]=i,t+=2}return at[t>>1]=0,t-r},tn=n=>n.length*2,en=(n,t)=>{for(var e=0,r="";!(e>=t/4);){var a=R[n+e*4>>2];if(a==0)break;if(++e,a>=65536){var o=a-65536;r+=String.fromCharCode(55296|o>>10,56320|o&1023)}else r+=String.fromCharCode(a)}return r},rn=(n,t,e)=>{if(e===void 0&&(e=2147483647),e<4)return 0;for(var r=t,a=r+e-4,o=0;o<n.length;++o){var i=n.charCodeAt(o);if(i>=55296&&i<=57343){var s=n.charCodeAt(++o);i=65536+((i&1023)<<10)|s&1023}if(R[t>>2]=i,t+=4,t+4>a)break}return R[t>>2]=0,t-r},nn=n=>{for(var t=0,e=0;e<n.length;++e){var r=n.charCodeAt(e);r>=55296&&r<=57343&&++e,t+=4}return t},an=(n,t,e)=>{e=M(e);var r,a,o,i,s;t===2?(r=Qr,a=Kr,i=tn,o=()=>lt,s=1):t===4&&(r=en,a=rn,i=nn,o=()=>C,s=2),Y(n,{name:e,fromWireType:c=>{for(var l=C[c>>2],f=o(),m,y=c+4,$=0;$<=l;++$){var b=c+4+$*t;if($==l||f[b>>s]==0){var O=b-y,F=r(y,O);m===void 0?m=F:(m+=String.fromCharCode(0),m+=F),y=b+t}}return G(c),m},toWireType:(c,l)=>{typeof l!="string"&&w(`Cannot pass non-string to C++ string type ${e}`);var f=i(l),m=Gt(4+f+t);return C[m>>2]=f>>s,a(l,m+4,f+t),c!==null&&c.push(G,m),m},argPackAdvance:L,readValueFromPointer:Wt,destructorFunction(c){G(c)}})},on=(n,t,e,r,a,o)=>{bt[n]={name:M(t),rawConstructor:B(e,r),rawDestructor:B(a,o),fields:[]}},sn=(n,t,e,r,a,o,i,s,c,l)=>{bt[n].fields.push({fieldName:M(t),getterReturnType:e,getter:B(r,a),getterContext:o,setterArgumentType:i,setter:B(s,c),setterContext:l})},un=(n,t)=>{t=M(t),Y(n,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},cn={},ln=n=>{var t=cn[n];return t===void 0?M(n):t},Se=()=>{if(typeof globalThis=="object")return globalThis;function n(t){t.$$$embind_global$$$=t;var e=typeof $$$embind_global$$$=="object"&&t.$$$embind_global$$$==t;return e||delete t.$$$embind_global$$$,e}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&n(global)?$$$embind_global$$$=global:typeof self=="object"&&n(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},dn=n=>n===0?X.toHandle(Se()):(n=ln(n),X.toHandle(Se()[n])),hn=n=>{n>4&&(V.get(n).refcount+=1)},fn=n=>{var t=new Array(n+1);return function(e,r,a){t[0]=e;for(var o=0;o<n;++o){var i=Yt(C[r+o*4>>2],"parameter "+o);t[o+1]=i.readValueFromPointer(a),a+=i.argPackAdvance}var s=new(e.bind.apply(e,t));return X.toHandle(s)}},Oe={},pn=(n,t,e,r)=>{n=X.toValue(n);var a=Oe[t];return a||(a=fn(t),Oe[t]=a),a(n,e,r)},mn=(n,t)=>{n=Yt(n,"_emval_take_value");var e=n.readValueFromPointer(t);return X.toHandle(e)},yn=()=>{ht("")},vn=(n,t,e)=>k.copyWithin(n,t,t+e),gn=()=>2147483648,$n=n=>{var t=ut.buffer,e=(n-t.byteLength+65535)/65536;try{return ut.grow(e),te(),1}catch{}},wn=n=>{var t=k.length;n>>>=0;var e=gn();if(n>e)return!1;for(var r=(c,l)=>c+(l-c%l)%l,a=1;a<=4;a*=2){var o=t*(1+.2/a);o=Math.min(o,n+100663296);var i=Math.min(e,r(Math.max(n,o),65536)),s=$n(i);if(s)return!0}return!1},Nt={},bn=()=>J||"./this.program",vt=()=>{if(!vt.strings){var n=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:n,_:bn()};for(var e in Nt)Nt[e]===void 0?delete t[e]:t[e]=Nt[e];var r=[];for(var e in t)r.push(`${e}=${t[e]}`);vt.strings=r}return vt.strings},Cn=(n,t)=>{for(var e=0;e<n.length;++e)U[t++>>0]=n.charCodeAt(e);U[t>>0]=0},_n=(n,t)=>{var e=0;return vt().forEach((r,a)=>{var o=t+e;C[n+a*4>>2]=o,Cn(r,o),e+=r.length+1}),0},Tn=(n,t)=>{var e=vt();C[n>>2]=e.length;var r=0;return e.forEach(a=>r+=a.length+1),C[t>>2]=r,0},Pn=n=>n,Ot=n=>n%4===0&&(n%100!==0||n%400===0),An=(n,t)=>{for(var e=0,r=0;r<=t;e+=n[r++]);return e},Fe=[31,29,31,30,31,30,31,31,30,31,30,31],De=[31,28,31,30,31,30,31,31,30,31,30,31],En=(n,t)=>{for(var e=new Date(n.getTime());t>0;){var r=Ot(e.getFullYear()),a=e.getMonth(),o=(r?Fe:De)[a];if(t>o-e.getDate())t-=o-e.getDate()+1,e.setDate(1),a<11?e.setMonth(a+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else return e.setDate(e.getDate()+t),e}return e};function Sn(n,t,e){var r=e>0?e:Pe(n)+1,a=new Array(r),o=Te(n,a,0,a.length);return t&&(a.length=o),a}var On=(n,t)=>{U.set(n,t)},Fn=(n,t,e,r)=>{var a=C[r+40>>2],o={tm_sec:R[r>>2],tm_min:R[r+4>>2],tm_hour:R[r+8>>2],tm_mday:R[r+12>>2],tm_mon:R[r+16>>2],tm_year:R[r+20>>2],tm_wday:R[r+24>>2],tm_yday:R[r+28>>2],tm_isdst:R[r+32>>2],tm_gmtoff:R[r+36>>2],tm_zone:a?zt(a):""},i=zt(e),s={"%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 c in s)i=i.replace(new RegExp(c,"g"),s[c]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(p,h,v){for(var j=typeof p=="number"?p.toString():p||"";j.length<h;)j=v[0]+j;return j}function y(p,h){return m(p,h,"0")}function $(p,h){function v(H){return H<0?-1:H>0?1:0}var j;return(j=v(p.getFullYear()-h.getFullYear()))===0&&(j=v(p.getMonth()-h.getMonth()))===0&&(j=v(p.getDate()-h.getDate())),j}function b(p){switch(p.getDay()){case 0:return new Date(p.getFullYear()-1,11,29);case 1:return p;case 2:return new Date(p.getFullYear(),0,3);case 3:return new Date(p.getFullYear(),0,2);case 4:return new Date(p.getFullYear(),0,1);case 5:return new Date(p.getFullYear()-1,11,31);case 6:return new Date(p.getFullYear()-1,11,30)}}function O(p){var h=En(new Date(p.tm_year+1900,0,1),p.tm_yday),v=new Date(h.getFullYear(),0,4),j=new Date(h.getFullYear()+1,0,4),H=b(v),ct=b(j);return $(H,h)<=0?$(ct,h)<=0?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var F={"%a":p=>l[p.tm_wday].substring(0,3),"%A":p=>l[p.tm_wday],"%b":p=>f[p.tm_mon].substring(0,3),"%B":p=>f[p.tm_mon],"%C":p=>{var h=p.tm_year+1900;return y(h/100|0,2)},"%d":p=>y(p.tm_mday,2),"%e":p=>m(p.tm_mday,2," "),"%g":p=>O(p).toString().substring(2),"%G":p=>O(p),"%H":p=>y(p.tm_hour,2),"%I":p=>{var h=p.tm_hour;return h==0?h=12:h>12&&(h-=12),y(h,2)},"%j":p=>y(p.tm_mday+An(Ot(p.tm_year+1900)?Fe:De,p.tm_mon-1),3),"%m":p=>y(p.tm_mon+1,2),"%M":p=>y(p.tm_min,2),"%n":()=>`
3
+ `,"%p":p=>p.tm_hour>=0&&p.tm_hour<12?"AM":"PM","%S":p=>y(p.tm_sec,2),"%t":()=>" ","%u":p=>p.tm_wday||7,"%U":p=>{var h=p.tm_yday+7-p.tm_wday;return y(Math.floor(h/7),2)},"%V":p=>{var h=Math.floor((p.tm_yday+7-(p.tm_wday+6)%7)/7);if((p.tm_wday+371-p.tm_yday-2)%7<=2&&h++,h){if(h==53){var v=(p.tm_wday+371-p.tm_yday)%7;v!=4&&(v!=3||!Ot(p.tm_year))&&(h=1)}}else{h=52;var j=(p.tm_wday+7-p.tm_yday-1)%7;(j==4||j==5&&Ot(p.tm_year%400-1))&&h++}return y(h,2)},"%w":p=>p.tm_wday,"%W":p=>{var h=p.tm_yday+7-(p.tm_wday+6)%7;return y(Math.floor(h/7),2)},"%y":p=>(p.tm_year+1900).toString().substring(2),"%Y":p=>p.tm_year+1900,"%z":p=>{var h=p.tm_gmtoff,v=h>=0;return h=Math.abs(h)/60,h=h/60*100+h%60,(v?"+":"-")+("0000"+h).slice(-4)},"%Z":p=>p.tm_zone,"%%":()=>"%"};i=i.replace(/%%/g,"\0\0");for(var c in F)i.includes(c)&&(i=i.replace(new RegExp(c,"g"),F[c](o)));i=i.replace(/\0\0/g,"%");var D=Sn(i,!1);return D.length>t?0:(On(D,n),D.length-1)},Dn=(n,t,e,r,a)=>Fn(n,t,e,r);ue=u.InternalError=class extends Error{constructor(n){super(n),this.name="InternalError"}},cr(),st=u.BindingError=class extends Error{constructor(n){super(n),this.name="BindingError"}},br(),vr(),Sr(),$e=u.UnboundTypeError=jr(Error,"UnboundTypeError"),Rr(),kr();var jn={s:Qe,v:Ke,b:er,g:rr,q:nr,I:ar,f:or,T:ir,d:tr,ba:sr,P:ur,Y:dr,aa:xr,$:Wr,w:Mr,X:Hr,x:Vr,h:Br,K:Lr,L:zr,t:Gr,n:qr,J:Zr,C:an,A:on,ca:sn,Z:un,ea:_e,da:dn,M:hn,V:pn,_:mn,B:yn,W:vn,U:wn,R:_n,S:Tn,D:Gn,E:Nn,m:qn,a:xn,e:In,o:Un,k:Rn,G:Ln,u:Bn,F:zn,z:Jn,O:Qn,l:kn,j:Hn,c:Mn,p:Wn,H:Yn,r:Xn,i:Vn,y:Zn,N:Pn,Q:Dn},P=Ze(),G=u._free=n=>(G=u._free=P.ha)(n),Gt=u._malloc=n=>(Gt=u._malloc=P.ia)(n),je=n=>(je=P.ka)(n);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=P.la)();var T=(n,t)=>(T=P.ma)(n,t),gt=n=>(gt=P.na)(n),E=()=>(E=P.oa)(),S=n=>(S=P.pa)(n),xe=n=>(xe=P.qa)(n),We=n=>(We=P.ra)(n),Me=(n,t,e)=>(Me=P.sa)(n,t,e),Re=n=>(Re=P.ta)(n);u.dynCall_viijii=(n,t,e,r,a,o,i)=>(u.dynCall_viijii=P.ua)(n,t,e,r,a,o,i);var Ie=u.dynCall_jiiii=(n,t,e,r,a)=>(Ie=u.dynCall_jiiii=P.va)(n,t,e,r,a);u.dynCall_iiiiij=(n,t,e,r,a,o,i)=>(u.dynCall_iiiiij=P.wa)(n,t,e,r,a,o,i),u.dynCall_iiiiijj=(n,t,e,r,a,o,i,s,c)=>(u.dynCall_iiiiijj=P.xa)(n,t,e,r,a,o,i,s,c),u.dynCall_iiiiiijj=(n,t,e,r,a,o,i,s,c,l)=>(u.dynCall_iiiiiijj=P.ya)(n,t,e,r,a,o,i,s,c,l);function xn(n,t){var e=E();try{return A(n)(t)}catch(r){if(S(e),r!==r+0)throw r;T(1,0)}}function Wn(n,t,e,r){var a=E();try{A(n)(t,e,r)}catch(o){if(S(a),o!==o+0)throw o;T(1,0)}}function Mn(n,t,e){var r=E();try{A(n)(t,e)}catch(a){if(S(r),a!==a+0)throw a;T(1,0)}}function Rn(n,t,e,r,a){var o=E();try{return A(n)(t,e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}function In(n,t,e){var r=E();try{return A(n)(t,e)}catch(a){if(S(r),a!==a+0)throw a;T(1,0)}}function kn(n){var t=E();try{A(n)()}catch(e){if(S(t),e!==e+0)throw e;T(1,0)}}function Hn(n,t){var e=E();try{A(n)(t)}catch(r){if(S(e),r!==r+0)throw r;T(1,0)}}function Un(n,t,e,r){var a=E();try{return A(n)(t,e,r)}catch(o){if(S(a),o!==o+0)throw o;T(1,0)}}function Vn(n,t,e,r,a,o,i,s,c,l,f){var m=E();try{A(n)(t,e,r,a,o,i,s,c,l,f)}catch(y){if(S(m),y!==y+0)throw y;T(1,0)}}function Bn(n,t,e,r,a,o,i){var s=E();try{return A(n)(t,e,r,a,o,i)}catch(c){if(S(s),c!==c+0)throw c;T(1,0)}}function Yn(n,t,e,r,a){var o=E();try{A(n)(t,e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}function Ln(n,t,e,r,a,o){var i=E();try{return A(n)(t,e,r,a,o)}catch(s){if(S(i),s!==s+0)throw s;T(1,0)}}function zn(n,t,e,r,a,o,i,s){var c=E();try{return A(n)(t,e,r,a,o,i,s)}catch(l){if(S(c),l!==l+0)throw l;T(1,0)}}function Nn(n,t,e,r){var a=E();try{return A(n)(t,e,r)}catch(o){if(S(a),o!==o+0)throw o;T(1,0)}}function Gn(n,t,e,r){var a=E();try{return A(n)(t,e,r)}catch(o){if(S(a),o!==o+0)throw o;T(1,0)}}function qn(n){var t=E();try{return A(n)()}catch(e){if(S(t),e!==e+0)throw e;T(1,0)}}function Xn(n,t,e,r,a,o,i,s){var c=E();try{A(n)(t,e,r,a,o,i,s)}catch(l){if(S(c),l!==l+0)throw l;T(1,0)}}function Jn(n,t,e,r,a,o,i,s,c,l,f,m){var y=E();try{return A(n)(t,e,r,a,o,i,s,c,l,f,m)}catch($){if(S(y),$!==$+0)throw $;T(1,0)}}function Zn(n,t,e,r,a,o,i,s,c,l,f,m,y,$,b,O){var F=E();try{A(n)(t,e,r,a,o,i,s,c,l,f,m,y,$,b,O)}catch(D){if(S(F),D!==D+0)throw D;T(1,0)}}function Qn(n,t,e,r,a){var o=E();try{return Ie(n,t,e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}var Xt;dt=function n(){Xt||qt(),Xt||(dt=n)};function qt(){if(K>0||(Ue(),K>0))return;function n(){Xt||(Xt=!0,u.calledRun=!0,!Ft&&(Ve(),x(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Be()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),n()},1)):n()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return qt(),g.ready}})();function za(d){return ra(na,d)}async function Na(d,g){return Ya(na,d,g)}async function Ga(d,g){return La(na,d,g)}var qa=(()=>{var d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(g={}){var u=g,x,_;u.ready=new Promise((t,e)=>{x=t,_=e});var W=Object.assign({},u),J="./this.program",Z=typeof window=="object",q=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var I="";function rt(t){return u.locateFile?u.locateFile(t,I):I+t}var nt;(Z||q)&&(q?I=self.location.href:typeof document<"u"&&document.currentScript&&(I=document.currentScript.src),d&&(I=d),I.indexOf("blob:")!==0?I=I.substr(0,I.replace(/[?#].*/,"").lastIndexOf("/")+1):I="",q&&(nt=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),u.print||console.log.bind(console);var z=u.printErr||console.error.bind(console);Object.assign(u,W),W=null,u.arguments&&u.arguments,u.thisProgram&&(J=u.thisProgram),u.quit&&u.quit;var Q;u.wasmBinary&&(Q=u.wasmBinary),typeof WebAssembly!="object"&&ht("no native wasm support detected");var ut,Ft=!1;function Zt(t,e){t||ht(e)}var U,k,at,lt,R,C,Qt,Kt;function te(){var t=ut.buffer;u.HEAP8=U=new Int8Array(t),u.HEAP16=at=new Int16Array(t),u.HEAPU8=k=new Uint8Array(t),u.HEAPU16=lt=new Uint16Array(t),u.HEAP32=R=new Int32Array(t),u.HEAPU32=C=new Uint32Array(t),u.HEAPF32=Qt=new Float32Array(t),u.HEAPF64=Kt=new Float64Array(t)}var ee=[],re=[],ne=[];function Ue(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)Ye(u.preRun.shift());Dt(ee)}function Ve(){Dt(re)}function Be(){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)ze(u.postRun.shift());Dt(ne)}function Ye(t){ee.unshift(t)}function Le(t){re.unshift(t)}function ze(t){ne.unshift(t)}var K=0,dt=null;function Ne(t){K++,u.monitorRunDependencies&&u.monitorRunDependencies(K)}function Ge(t){if(K--,u.monitorRunDependencies&&u.monitorRunDependencies(K),K==0&&dt){var e=dt;dt=null,e()}}function ht(t){u.onAbort&&u.onAbort(t),t="Aborted("+t+")",z(t),Ft=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw _(e),e}var qe="data:application/octet-stream;base64,",ae=t=>t.startsWith(qe),ot;ot="zxing_full.wasm",ae(ot)||(ot=rt(ot));function oe(t){if(t==ot&&Q)return new Uint8Array(Q);if(nt)return nt(t);throw"both async and sync fetching of the wasm failed"}function Xe(t){return!Q&&(Z||q)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>oe(t)):Promise.resolve().then(()=>oe(t))}function ie(t,e,r){return Xe(t).then(a=>WebAssembly.instantiate(a,e)).then(a=>a).then(r,a=>{z(`failed to asynchronously prepare wasm: ${a}`),ht(a)})}function Je(t,e,r,a){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!ae(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var i=WebAssembly.instantiateStreaming(o,r);return i.then(a,function(s){return z(`wasm streaming compile failed: ${s}`),z("falling back to ArrayBuffer instantiation"),ie(e,r,a)})}):ie(e,r,a)}function Ze(){var t={a:jn};function e(a,o){return P=a.exports,ut=P.ga,te(),ge=P.ka,Le(P.ha),Ge(),P}Ne();function r(a){e(a.instance)}if(u.instantiateWasm)try{return u.instantiateWasm(t,e)}catch(a){z(`Module.instantiateWasm callback failed with error: ${a}`),_(a)}return Je(Q,ot,t,r).catch(_),{}}var Dt=t=>{for(;t.length>0;)t.shift()(u)};u.noExitRuntime;var $t=[],wt=0,Qe=t=>{var e=new jt(t);return e.get_caught()||(e.set_caught(!0),wt--),e.set_rethrown(!1),$t.push(e),We(e.excPtr),e.get_exception_ptr()},N=0,Ke=()=>{T(0,0);var t=$t.pop();xe(t.excPtr),N=0};function jt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){C[this.ptr+4>>2]=e},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(e){C[this.ptr+8>>2]=e},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,U[this.ptr+12>>0]=e},this.get_caught=function(){return U[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,U[this.ptr+13>>0]=e},this.get_rethrown=function(){return U[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){C[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=Re(this.get_type());if(e)return C[this.excPtr>>2];var r=this.get_adjusted_ptr();return r!==0?r:this.excPtr}}var tr=t=>{throw N||(N=t),N},xt=t=>{var e=N;if(!e)return gt(0),0;var r=new jt(e);r.set_adjusted_ptr(e);var a=r.get_type();if(!a)return gt(0),e;for(var o in t){var i=t[o];if(i===0||i===a)break;var s=r.ptr+16;if(Me(i,a,s))return gt(i),e}return gt(a),e},er=()=>xt([]),rr=t=>xt([t]),nr=(t,e)=>xt([t,e]),ar=()=>{var t=$t.pop();t||ht("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||($t.push(t),t.set_rethrown(!0),t.set_caught(!1),wt++),N=e,N},or=(t,e,r)=>{var a=new jt(t);throw a.init(e,r),N=t,wt++,N},ir=()=>wt,bt={},se=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function Wt(t){return this.fromWireType(R[t>>2])}var it={},tt={},Ct={},ue,_t=t=>{throw new ue(t)},et=(t,e,r)=>{t.forEach(function(c){Ct[c]=e});function a(c){var l=r(c);l.length!==t.length&&_t("Mismatched type converter count");for(var f=0;f<t.length;++f)Y(t[f],l[f])}var o=new Array(e.length),i=[],s=0;e.forEach((c,l)=>{tt.hasOwnProperty(c)?o[l]=tt[c]:(i.push(c),it.hasOwnProperty(c)||(it[c]=[]),it[c].push(()=>{o[l]=tt[c],++s,s===i.length&&a(o)}))}),i.length===0&&a(o)},sr=t=>{var e=bt[t];delete bt[t];var r=e.rawConstructor,a=e.rawDestructor,o=e.fields,i=o.map(s=>s.getterReturnType).concat(o.map(s=>s.setterArgumentType));et([t],i,s=>{var c={};return o.forEach((l,f)=>{var m=l.fieldName,y=s[f],$=l.getter,b=l.getterContext,O=s[f+o.length],F=l.setter,D=l.setterContext;c[m]={read:p=>y.fromWireType($(b,p)),write:(p,h)=>{var v=[];F(D,p,O.toWireType(v,h)),se(v)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var m in c)f[m]=c[m].read(l);return a(l),f},toWireType:(l,f)=>{for(var m in c)if(!(m in f))throw new TypeError(`Missing field: "${m}"`);var y=r();for(m in c)c[m].write(y,f[m]);return l!==null&&l.push(a,y),y},argPackAdvance:L,readValueFromPointer:Wt,destructorFunction:a}]})},ur=(t,e,r,a,o)=>{},cr=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);ce=t},ce,M=t=>{for(var e="",r=t;k[r];)e+=ce[k[r++]];return e},st,w=t=>{throw new st(t)};function lr(t,e,r={}){var a=e.name;if(t||w(`type "${a}" must have a positive integer typeid pointer`),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;w(`Cannot register type '${a}' twice`)}if(tt[t]=e,delete Ct[t],it.hasOwnProperty(t)){var o=it[t];delete it[t],o.forEach(i=>i())}}function Y(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return lr(t,e,r)}var L=8,dr=(t,e,r,a)=>{e=M(e),Y(t,{name:e,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?r:a},argPackAdvance:L,readValueFromPointer:function(o){return this.fromWireType(k[o])},destructorFunction:null})},hr=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Mt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}w(e(t)+" instance already deleted")},Rt=!1,le=t=>{},fr=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},de=t=>{t.count.value-=1;var e=t.count.value===0;e&&fr(t)},he=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var a=he(t,e,r.baseClass);return a===null?null:r.downcast(a)},fe={},pr=()=>Object.keys(mt).length,mr=()=>{var t=[];for(var e in mt)mt.hasOwnProperty(e)&&t.push(mt[e]);return t},ft=[],It=()=>{for(;ft.length;){var t=ft.pop();t.$$.deleteScheduled=!1,t.delete()}},pt,yr=t=>{pt=t,ft.length&&pt&&pt(It)},vr=()=>{u.getInheritedInstanceCount=pr,u.getLiveInheritedInstances=mr,u.flushPendingDeletes=It,u.setDelayFunction=yr},mt={},gr=(t,e)=>{for(e===void 0&&w("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},$r=(t,e)=>(e=gr(t,e),mt[e]),Tt=(t,e)=>{(!e.ptrType||!e.ptr)&&_t("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,a=!!e.smartPtr;return r!==a&&_t("Both smartPtrType and smartPtr must be specified"),e.count={value:1},yt(Object.create(t,{$$:{value:e}}))};function wr(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=$r(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var a=r.clone();return this.destructor(t),a}function o(){return this.isSmartPointer?Tt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Tt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),s=fe[i];if(!s)return o.call(this);var c;this.isConst?c=s.constPointerType:c=s.pointerType;var l=he(e,this.registeredClass,c.registeredClass);return l===null?o.call(this):this.isSmartPointer?Tt(c.registeredClass.instancePrototype,{ptrType:c,ptr:l,smartPtrType:this,smartPtr:t}):Tt(c.registeredClass.instancePrototype,{ptrType:c,ptr:l})}var yt=t=>typeof FinalizationRegistry>"u"?(yt=e=>e,t):(Rt=new FinalizationRegistry(e=>{de(e.$$)}),yt=e=>{var r=e.$$,a=!!r.smartPtr;if(a){var o={$$:r};Rt.register(e,o,e)}return e},le=e=>Rt.unregister(e),yt(t)),br=()=>{Object.assign(Pt.prototype,{isAliasOf(t){if(!(this instanceof Pt)||!(t instanceof Pt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var a=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;a.baseClass;)o=a.upcast(o),a=a.baseClass;return e===a&&r===o},clone(){if(this.$$.ptr||Mt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:hr(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Mt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&w("Object already scheduled for deletion"),le(this),de(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Mt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&w("Object already scheduled for deletion"),ft.push(this),ft.length===1&&pt&&pt(It),this.$$.deleteScheduled=!0,this}})};function Pt(){}var Cr=48,_r=57,pe=t=>{if(t===void 0)return"_unknown";t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=Cr&&e<=_r?`_${t}`:t};function kt(t,e){return t=pe(t),{[t]:function(){return e.apply(this,arguments)}}[t]}var me=(t,e,r)=>{if(t[e].overloadTable===void 0){var a=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||w(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[a.argCount]=a}},Ht=(t,e,r)=>{u.hasOwnProperty(t)?((r===void 0||u[t].overloadTable!==void 0&&u[t].overloadTable[r]!==void 0)&&w(`Cannot register public name '${t}' twice`),me(u,t,t),u.hasOwnProperty(r)&&w(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),u[t].overloadTable[r]=e):(u[t]=e,r!==void 0&&(u[t].numArguments=r))};function Tr(t,e,r,a,o,i,s,c){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=a,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=c,this.pureVirtualFunctions=[]}var Ut=(t,e,r)=>{for(;e!==r;)e.upcast||w(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Pr(t,e){if(e===null)return this.isReference&&w(`null is not a valid ${this.name}`),0;e.$$||w(`Cannot pass "${Lt(e)}" as a ${this.name}`),e.$$.ptr||w(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,a=Ut(e.$$.ptr,r,this.registeredClass);return a}function Ar(t,e){var r;if(e===null)return this.isReference&&w(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;e.$$||w(`Cannot pass "${Lt(e)}" as a ${this.name}`),e.$$.ptr||w(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&w(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var a=e.$$.ptrType.registeredClass;if(r=Ut(e.$$.ptr,a,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&w("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:w(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,X.toHandle(()=>o.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:w("Unsupporting sharing policy")}return r}function Er(t,e){if(e===null)return this.isReference&&w(`null is not a valid ${this.name}`),0;e.$$||w(`Cannot pass "${Lt(e)}" as a ${this.name}`),e.$$.ptr||w(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&w(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,a=Ut(e.$$.ptr,r,this.registeredClass);return a}function ye(t){return this.fromWireType(C[t>>2])}var Sr=()=>{Object.assign(At.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){this.rawDestructor&&this.rawDestructor(t)},argPackAdvance:L,readValueFromPointer:ye,deleteObject(t){t!==null&&t.delete()},fromWireType:wr})};function At(t,e,r,a,o,i,s,c,l,f,m){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=a,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=c,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=m,!o&&e.baseClass===void 0?a?(this.toWireType=Pr,this.destructorFunction=null):(this.toWireType=Er,this.destructorFunction=null):this.toWireType=Ar}var ve=(t,e,r)=>{u.hasOwnProperty(t)||_t("Replacing nonexistant public symbol"),u[t].overloadTable!==void 0&&r!==void 0?u[t].overloadTable[r]=e:(u[t]=e,u[t].argCount=r)},Or=(t,e,r)=>{var a=u["dynCall_"+t];return r&&r.length?a.apply(null,[e].concat(r)):a.call(null,e)},Et=[],ge,A=t=>{var e=Et[t];return e||(t>=Et.length&&(Et.length=t+1),Et[t]=e=ge.get(t)),e},Fr=(t,e,r)=>{if(t.includes("j"))return Or(t,e,r);var a=A(e).apply(null,r);return a},Dr=(t,e)=>{var r=[];return function(){return r.length=0,Object.assign(r,arguments),Fr(t,e,r)}},B=(t,e)=>{t=M(t);function r(){return t.includes("j")?Dr(t,e):A(e)}var a=r();return typeof a!="function"&&w(`unknown function pointer with signature ${t}: ${e}`),a},jr=(t,e)=>{var r=kt(e,function(a){this.name=e,this.message=a;var o=new Error(a).stack;o!==void 0&&(this.stack=this.toString()+`
4
+ `+o.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},$e,we=t=>{var e=je(t),r=M(e);return G(e),r},St=(t,e)=>{var r=[],a={};function o(i){if(!a[i]&&!tt[i]){if(Ct[i]){Ct[i].forEach(o);return}r.push(i),a[i]=!0}}throw e.forEach(o),new $e(`${t}: `+r.map(we).join([", "]))},xr=(t,e,r,a,o,i,s,c,l,f,m,y,$)=>{m=M(m),i=B(o,i),c&&(c=B(s,c)),f&&(f=B(l,f)),$=B(y,$);var b=pe(m);Ht(b,function(){St(`Cannot construct ${m} due to unbound types`,[a])}),et([t,e,r],a?[a]:[],function(O){O=O[0];var F,D;a?(F=O.registeredClass,D=F.instancePrototype):D=Pt.prototype;var p=kt(b,function(){if(Object.getPrototypeOf(this)!==h)throw new st("Use 'new' to construct "+m);if(v.constructor_body===void 0)throw new st(m+" has no accessible constructor");var ke=v.constructor_body[arguments.length];if(ke===void 0)throw new st(`Tried to invoke ctor of ${m} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(v.constructor_body).toString()}) parameters instead!`);return ke.apply(this,arguments)}),h=Object.create(D,{constructor:{value:p}});p.prototype=h;var v=new Tr(m,p,h,$,F,i,c,f);v.baseClass&&(v.baseClass.__derivedClasses===void 0&&(v.baseClass.__derivedClasses=[]),v.baseClass.__derivedClasses.push(v));var j=new At(m,v,!0,!1,!1),H=new At(m+"*",v,!1,!1,!1),ct=new At(m+" const*",v,!1,!0,!1);return fe[t]={pointerType:H,constPointerType:ct},ve(b,p),[j,H,ct]})},Vt=(t,e)=>{for(var r=[],a=0;a<t;a++)r.push(C[e+a*4>>2]);return r};function Bt(t,e,r,a,o,i){var s=e.length;s<2&&w("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=e[1]!==null&&r!==null,l=!1,f=1;f<e.length;++f)if(e[f]!==null&&e[f].destructorFunction===void 0){l=!0;break}var m=e[0].name!=="void",y=s-2,$=new Array(y),b=[],O=[];return function(){arguments.length!==y&&w(`function ${t} called with ${arguments.length} arguments, expected ${y}`),O.length=0;var F;b.length=c?2:1,b[0]=o,c&&(F=e[1].toWireType(O,this),b[1]=F);for(var D=0;D<y;++D)$[D]=e[D+2].toWireType(O,arguments[D]),b.push($[D]);var p=a.apply(null,b);function h(v){if(l)se(O);else for(var j=c?1:2;j<e.length;j++){var H=j===1?F:$[j-2];e[j].destructorFunction!==null&&e[j].destructorFunction(H)}if(m)return e[0].fromWireType(v)}return h(p)}}var Wr=(t,e,r,a,o,i)=>{var s=Vt(e,r);o=B(a,o),et([],[t],function(c){c=c[0];var l=`constructor ${c.name}`;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[e-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${c.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return c.registeredClass.constructor_body[e-1]=()=>{St(`Cannot construct ${c.name} due to unbound types`,s)},et([],s,f=>(f.splice(1,0,null),c.registeredClass.constructor_body[e-1]=Bt(l,f,null,o,i),[])),[]})},be=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?(Zt(t[t.length-1]==")","Parentheses for argument names should match."),t.substr(0,e)):t},Mr=(t,e,r,a,o,i,s,c,l)=>{var f=Vt(r,a);e=M(e),e=be(e),i=B(o,i),et([],[t],function(m){m=m[0];var y=`${m.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),c&&m.registeredClass.pureVirtualFunctions.push(e);function $(){St(`Cannot call ${y} due to unbound types`,f)}var b=m.registeredClass.instancePrototype,O=b[e];return O===void 0||O.overloadTable===void 0&&O.className!==m.name&&O.argCount===r-2?($.argCount=r-2,$.className=m.name,b[e]=$):(me(b,e,y),b[e].overloadTable[r-2]=$),et([],f,function(F){var D=Bt(y,F,m,i,s);return b[e].overloadTable===void 0?(D.argCount=r-2,b[e]=D):b[e].overloadTable[r-2]=D,[]}),[]})};function Rr(){Object.assign(Ce.prototype,{get(t){return this.allocated[t]},has(t){return this.allocated[t]!==void 0},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}})}function Ce(){this.allocated=[void 0],this.freelist=[]}var V=new Ce,_e=t=>{t>=V.reserved&&--V.get(t).refcount===0&&V.free(t)},Ir=()=>{for(var t=0,e=V.reserved;e<V.allocated.length;++e)V.allocated[e]!==void 0&&++t;return t},kr=()=>{V.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),V.reserved=V.allocated.length,u.count_emval_handles=Ir},X={toValue:t=>(t||w("Cannot use deleted val. handle = "+t),V.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return V.allocate({refcount:1,value:t})}}},Hr=(t,e)=>{e=M(e),Y(t,{name:e,fromWireType:r=>{var a=X.toValue(r);return _e(r),a},toWireType:(r,a)=>X.toHandle(a),argPackAdvance:L,readValueFromPointer:Wt,destructorFunction:null})},Ur=(t,e,r)=>{switch(e){case 1:return r?function(a){return this.fromWireType(U[a>>0])}:function(a){return this.fromWireType(k[a>>0])};case 2:return r?function(a){return this.fromWireType(at[a>>1])}:function(a){return this.fromWireType(lt[a>>1])};case 4:return r?function(a){return this.fromWireType(R[a>>2])}:function(a){return this.fromWireType(C[a>>2])};default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Vr=(t,e,r,a)=>{e=M(e);function o(){}o.values={},Y(t,{name:e,constructor:o,fromWireType:function(i){return this.constructor.values[i]},toWireType:(i,s)=>s.value,argPackAdvance:L,readValueFromPointer:Ur(e,r,a),destructorFunction:null}),Ht(e,o)},Yt=(t,e)=>{var r=tt[t];return r===void 0&&w(e+" has unknown type "+we(t)),r},Br=(t,e,r)=>{var a=Yt(t,"enum");e=M(e);var o=a.constructor,i=Object.create(a.constructor.prototype,{value:{value:r},constructor:{value:kt(`${a.name}_${e}`,function(){})}});o.values[r]=i,o[e]=i},Lt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},Yr=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Qt[r>>2])};case 8:return function(r){return this.fromWireType(Kt[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Lr=(t,e,r)=>{e=M(e),Y(t,{name:e,fromWireType:a=>a,toWireType:(a,o)=>o,argPackAdvance:L,readValueFromPointer:Yr(e,r),destructorFunction:null})},zr=(t,e,r,a,o,i,s)=>{var c=Vt(e,r);t=M(t),t=be(t),o=B(a,o),Ht(t,function(){St(`Cannot call ${t} due to unbound types`,c)},e-1),et([],c,function(l){var f=[l[0],null].concat(l.slice(1));return ve(t,Bt(t,f,null,o,i),e-1),[]})},Nr=(t,e,r)=>{switch(e){case 1:return r?a=>U[a>>0]:a=>k[a>>0];case 2:return r?a=>at[a>>1]:a=>lt[a>>1];case 4:return r?a=>R[a>>2]:a=>C[a>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Gr=(t,e,r,a,o)=>{e=M(e);var i=m=>m;if(a===0){var s=32-8*r;i=m=>m<<s>>>s}var c=e.includes("unsigned"),l=(m,y)=>{},f;c?f=function(m,y){return l(y,this.name),y>>>0}:f=function(m,y){return l(y,this.name),y},Y(t,{name:e,fromWireType:i,toWireType:f,argPackAdvance:L,readValueFromPointer:Nr(e,r,a!==0),destructorFunction:null})},qr=(t,e,r)=>{var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=a[e];function i(s){var c=C[s>>2],l=C[s+4>>2];return new o(U.buffer,l,c)}r=M(r),Y(t,{name:r,fromWireType:i,argPackAdvance:L,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Te=(t,e,r,a)=>{if(!(a>0))return 0;for(var o=r,i=r+a-1,s=0;s<t.length;++s){var c=t.charCodeAt(s);if(c>=55296&&c<=57343){var l=t.charCodeAt(++s);c=65536+((c&1023)<<10)|l&1023}if(c<=127){if(r>=i)break;e[r++]=c}else if(c<=2047){if(r+1>=i)break;e[r++]=192|c>>6,e[r++]=128|c&63}else if(c<=65535){if(r+2>=i)break;e[r++]=224|c>>12,e[r++]=128|c>>6&63,e[r++]=128|c&63}else{if(r+3>=i)break;e[r++]=240|c>>18,e[r++]=128|c>>12&63,e[r++]=128|c>>6&63,e[r++]=128|c&63}}return e[r]=0,r-o},Xr=(t,e,r)=>Te(t,k,e,r),Pe=t=>{for(var e=0,r=0;r<t.length;++r){var a=t.charCodeAt(r);a<=127?e++:a<=2047?e+=2:a>=55296&&a<=57343?(e+=4,++r):e+=3}return e},Ae=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Jr=(t,e,r)=>{for(var a=e+r,o=e;t[o]&&!(o>=a);)++o;if(o-e>16&&t.buffer&&Ae)return Ae.decode(t.subarray(e,o));for(var i="";e<o;){var s=t[e++];if(!(s&128)){i+=String.fromCharCode(s);continue}var c=t[e++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|c);continue}var l=t[e++]&63;if((s&240)==224?s=(s&15)<<12|c<<6|l:s=(s&7)<<18|c<<12|l<<6|t[e++]&63,s<65536)i+=String.fromCharCode(s);else{var f=s-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},zt=(t,e)=>t?Jr(k,t,e):"",Zr=(t,e)=>{e=M(e);var r=e==="std::string";Y(t,{name:e,fromWireType(a){var o=C[a>>2],i=a+4,s;if(r)for(var c=i,l=0;l<=o;++l){var f=i+l;if(l==o||k[f]==0){var m=f-c,y=zt(c,m);s===void 0?s=y:(s+=String.fromCharCode(0),s+=y),c=f+1}}else{for(var $=new Array(o),l=0;l<o;++l)$[l]=String.fromCharCode(k[i+l]);s=$.join("")}return G(a),s},toWireType(a,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var i,s=typeof o=="string";s||o instanceof Uint8Array||o instanceof Uint8ClampedArray||o instanceof Int8Array||w("Cannot pass non-string to std::string"),r&&s?i=Pe(o):i=o.length;var c=Gt(4+i+1),l=c+4;if(C[c>>2]=i,r&&s)Xr(o,l,i+1);else if(s)for(var f=0;f<i;++f){var m=o.charCodeAt(f);m>255&&(G(l),w("String has UTF-16 code units that do not fit in 8 bits")),k[l+f]=m}else for(var f=0;f<i;++f)k[l+f]=o[f];return a!==null&&a.push(G,c),c},argPackAdvance:L,readValueFromPointer:ye,destructorFunction(a){G(a)}})},Ee=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Qr=(t,e)=>{for(var r=t,a=r>>1,o=a+e/2;!(a>=o)&&lt[a];)++a;if(r=a<<1,r-t>32&&Ee)return Ee.decode(k.subarray(t,r));for(var i="",s=0;!(s>=e/2);++s){var c=at[t+s*2>>1];if(c==0)break;i+=String.fromCharCode(c)}return i},Kr=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<2)return 0;r-=2;for(var a=e,o=r<t.length*2?r/2:t.length,i=0;i<o;++i){var s=t.charCodeAt(i);at[e>>1]=s,e+=2}return at[e>>1]=0,e-a},tn=t=>t.length*2,en=(t,e)=>{for(var r=0,a="";!(r>=e/4);){var o=R[t+r*4>>2];if(o==0)break;if(++r,o>=65536){var i=o-65536;a+=String.fromCharCode(55296|i>>10,56320|i&1023)}else a+=String.fromCharCode(o)}return a},rn=(t,e,r)=>{if(r===void 0&&(r=2147483647),r<4)return 0;for(var a=e,o=a+r-4,i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s>=55296&&s<=57343){var c=t.charCodeAt(++i);s=65536+((s&1023)<<10)|c&1023}if(R[e>>2]=s,e+=4,e+4>o)break}return R[e>>2]=0,e-a},nn=t=>{for(var e=0,r=0;r<t.length;++r){var a=t.charCodeAt(r);a>=55296&&a<=57343&&++r,e+=4}return e},an=(t,e,r)=>{r=M(r);var a,o,i,s,c;e===2?(a=Qr,o=Kr,s=tn,i=()=>lt,c=1):e===4&&(a=en,o=rn,s=nn,i=()=>C,c=2),Y(t,{name:r,fromWireType:l=>{for(var f=C[l>>2],m=i(),y,$=l+4,b=0;b<=f;++b){var O=l+4+b*e;if(b==f||m[O>>c]==0){var F=O-$,D=a($,F);y===void 0?y=D:(y+=String.fromCharCode(0),y+=D),$=O+e}}return G(l),y},toWireType:(l,f)=>{typeof f!="string"&&w(`Cannot pass non-string to C++ string type ${r}`);var m=s(f),y=Gt(4+m+e);return C[y>>2]=m>>c,o(f,y+4,m+e),l!==null&&l.push(G,y),y},argPackAdvance:L,readValueFromPointer:Wt,destructorFunction(l){G(l)}})},on=(t,e,r,a,o,i)=>{bt[t]={name:M(e),rawConstructor:B(r,a),rawDestructor:B(o,i),fields:[]}},sn=(t,e,r,a,o,i,s,c,l,f)=>{bt[t].fields.push({fieldName:M(e),getterReturnType:r,getter:B(a,o),getterContext:i,setterArgumentType:s,setter:B(c,l),setterContext:f})},un=(t,e)=>{e=M(e),Y(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,a)=>{}})},cn={},ln=t=>{var e=cn[t];return e===void 0?M(t):e},Se=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},dn=t=>t===0?X.toHandle(Se()):(t=ln(t),X.toHandle(Se()[t])),hn=t=>{t>4&&(V.get(t).refcount+=1)},fn=t=>{var e=new Array(t+1);return function(r,a,o){e[0]=r;for(var i=0;i<t;++i){var s=Yt(C[a+i*4>>2],"parameter "+i);e[i+1]=s.readValueFromPointer(o),o+=s.argPackAdvance}var c=new(r.bind.apply(r,e));return X.toHandle(c)}},Oe={},pn=(t,e,r,a)=>{t=X.toValue(t);var o=Oe[e];return o||(o=fn(e),Oe[e]=o),o(t,r,a)},mn=(t,e)=>{t=Yt(t,"_emval_take_value");var r=t.readValueFromPointer(e);return X.toHandle(r)},yn=()=>{ht("")},vn=(t,e,r)=>k.copyWithin(t,e,e+r),gn=()=>2147483648,$n=t=>{var e=ut.buffer,r=(t-e.byteLength+65535)/65536;try{return ut.grow(r),te(),1}catch{}},wn=t=>{var e=k.length;t>>>=0;var r=gn();if(t>r)return!1;for(var a=(l,f)=>l+(f-l%f)%f,o=1;o<=4;o*=2){var i=e*(1+.2/o);i=Math.min(i,t+100663296);var s=Math.min(r,a(Math.max(t,i),65536)),c=$n(s);if(c)return!0}return!1},Nt={},bn=()=>J||"./this.program",vt=()=>{if(!vt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:bn()};for(var r in Nt)Nt[r]===void 0?delete e[r]:e[r]=Nt[r];var a=[];for(var r in e)a.push(`${r}=${e[r]}`);vt.strings=a}return vt.strings},Cn=(t,e)=>{for(var r=0;r<t.length;++r)U[e++>>0]=t.charCodeAt(r);U[e>>0]=0},_n=(t,e)=>{var r=0;return vt().forEach((a,o)=>{var i=e+r;C[t+o*4>>2]=i,Cn(a,i),r+=a.length+1}),0},Tn=(t,e)=>{var r=vt();C[t>>2]=r.length;var a=0;return r.forEach(o=>a+=o.length+1),C[e>>2]=a,0},Pn=t=>t,Ot=t=>t%4===0&&(t%100!==0||t%400===0),An=(t,e)=>{for(var r=0,a=0;a<=e;r+=t[a++]);return r},Fe=[31,29,31,30,31,30,31,31,30,31,30,31],De=[31,28,31,30,31,30,31,31,30,31,30,31],En=(t,e)=>{for(var r=new Date(t.getTime());e>0;){var a=Ot(r.getFullYear()),o=r.getMonth(),i=(a?Fe:De)[o];if(e>i-r.getDate())e-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1));else return r.setDate(r.getDate()+e),r}return r};function Sn(t,e,r){var a=r>0?r:Pe(t)+1,o=new Array(a),i=Te(t,o,0,o.length);return e&&(o.length=i),o}var On=(t,e)=>{U.set(t,e)},Fn=(t,e,r,a)=>{var o=C[a+40>>2],i={tm_sec:R[a>>2],tm_min:R[a+4>>2],tm_hour:R[a+8>>2],tm_mday:R[a+12>>2],tm_mon:R[a+16>>2],tm_year:R[a+20>>2],tm_wday:R[a+24>>2],tm_yday:R[a+28>>2],tm_isdst:R[a+32>>2],tm_gmtoff:R[a+36>>2],tm_zone:o?zt(o):""},s=zt(r),c={"%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 l in c)s=s.replace(new RegExp(l,"g"),c[l]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"];function y(h,v,j){for(var H=typeof h=="number"?h.toString():h||"";H.length<v;)H=j[0]+H;return H}function $(h,v){return y(h,v,"0")}function b(h,v){function j(ct){return ct<0?-1:ct>0?1:0}var H;return(H=j(h.getFullYear()-v.getFullYear()))===0&&(H=j(h.getMonth()-v.getMonth()))===0&&(H=j(h.getDate()-v.getDate())),H}function O(h){switch(h.getDay()){case 0:return new Date(h.getFullYear()-1,11,29);case 1:return h;case 2:return new Date(h.getFullYear(),0,3);case 3:return new Date(h.getFullYear(),0,2);case 4:return new Date(h.getFullYear(),0,1);case 5:return new Date(h.getFullYear()-1,11,31);case 6:return new Date(h.getFullYear()-1,11,30)}}function F(h){var v=En(new Date(h.tm_year+1900,0,1),h.tm_yday),j=new Date(v.getFullYear(),0,4),H=new Date(v.getFullYear()+1,0,4),ct=O(j),ke=O(H);return b(ct,v)<=0?b(ke,v)<=0?v.getFullYear()+1:v.getFullYear():v.getFullYear()-1}var D={"%a":h=>f[h.tm_wday].substring(0,3),"%A":h=>f[h.tm_wday],"%b":h=>m[h.tm_mon].substring(0,3),"%B":h=>m[h.tm_mon],"%C":h=>{var v=h.tm_year+1900;return $(v/100|0,2)},"%d":h=>$(h.tm_mday,2),"%e":h=>y(h.tm_mday,2," "),"%g":h=>F(h).toString().substring(2),"%G":h=>F(h),"%H":h=>$(h.tm_hour,2),"%I":h=>{var v=h.tm_hour;return v==0?v=12:v>12&&(v-=12),$(v,2)},"%j":h=>$(h.tm_mday+An(Ot(h.tm_year+1900)?Fe:De,h.tm_mon-1),3),"%m":h=>$(h.tm_mon+1,2),"%M":h=>$(h.tm_min,2),"%n":()=>`
5
+ `,"%p":h=>h.tm_hour>=0&&h.tm_hour<12?"AM":"PM","%S":h=>$(h.tm_sec,2),"%t":()=>" ","%u":h=>h.tm_wday||7,"%U":h=>{var v=h.tm_yday+7-h.tm_wday;return $(Math.floor(v/7),2)},"%V":h=>{var v=Math.floor((h.tm_yday+7-(h.tm_wday+6)%7)/7);if((h.tm_wday+371-h.tm_yday-2)%7<=2&&v++,v){if(v==53){var j=(h.tm_wday+371-h.tm_yday)%7;j!=4&&(j!=3||!Ot(h.tm_year))&&(v=1)}}else{v=52;var H=(h.tm_wday+7-h.tm_yday-1)%7;(H==4||H==5&&Ot(h.tm_year%400-1))&&v++}return $(v,2)},"%w":h=>h.tm_wday,"%W":h=>{var v=h.tm_yday+7-(h.tm_wday+6)%7;return $(Math.floor(v/7),2)},"%y":h=>(h.tm_year+1900).toString().substring(2),"%Y":h=>h.tm_year+1900,"%z":h=>{var v=h.tm_gmtoff,j=v>=0;return v=Math.abs(v)/60,v=v/60*100+v%60,(j?"+":"-")+("0000"+v).slice(-4)},"%Z":h=>h.tm_zone,"%%":()=>"%"};s=s.replace(/%%/g,"\0\0");for(var l in D)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),D[l](i)));s=s.replace(/\0\0/g,"%");var p=Sn(s,!1);return p.length>e?0:(On(p,t),p.length-1)},Dn=(t,e,r,a,o)=>Fn(t,e,r,a);ue=u.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},cr(),st=u.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},br(),vr(),Sr(),$e=u.UnboundTypeError=jr(Error,"UnboundTypeError"),Rr(),kr();var jn={s:Qe,v:Ke,b:er,g:rr,m:nr,K:ar,e:or,T:ir,d:tr,ba:sr,P:ur,Y:dr,aa:xr,$:Wr,x:Mr,X:Hr,y:Vr,j:Br,M:Lr,D:zr,t:Gr,p:qr,L:Zr,C:an,w:on,ca:sn,Z:un,fa:_e,da:dn,N:hn,W:pn,_:mn,B:yn,V:vn,U:wn,R:_n,S:Tn,G:qn,H:Gn,n:Xn,a:xn,f:In,q:Un,k:Rn,J:zn,u:Ln,I:Nn,A:Zn,O:Xt,l:kn,i:Hn,c:Mn,o:Wn,E:Bn,ea:Vn,r:Jn,h:Yn,z:Qn,F:Pn,Q:Dn},P=Ze(),G=u._free=t=>(G=u._free=P.ia)(t),Gt=u._malloc=t=>(Gt=u._malloc=P.ja)(t),je=t=>(je=P.la)(t);u.__embind_initialize_bindings=()=>(u.__embind_initialize_bindings=P.ma)();var T=(t,e)=>(T=P.na)(t,e),gt=t=>(gt=P.oa)(t),E=()=>(E=P.pa)(),S=t=>(S=P.qa)(t),xe=t=>(xe=P.ra)(t),We=t=>(We=P.sa)(t),Me=(t,e,r)=>(Me=P.ta)(t,e,r),Re=t=>(Re=P.ua)(t);u.dynCall_viijii=(t,e,r,a,o,i,s)=>(u.dynCall_viijii=P.va)(t,e,r,a,o,i,s);var Ie=u.dynCall_jiiii=(t,e,r,a,o)=>(Ie=u.dynCall_jiiii=P.wa)(t,e,r,a,o);u.dynCall_iiiiij=(t,e,r,a,o,i,s)=>(u.dynCall_iiiiij=P.xa)(t,e,r,a,o,i,s),u.dynCall_iiiiijj=(t,e,r,a,o,i,s,c,l)=>(u.dynCall_iiiiijj=P.ya)(t,e,r,a,o,i,s,c,l),u.dynCall_iiiiiijj=(t,e,r,a,o,i,s,c,l,f)=>(u.dynCall_iiiiiijj=P.za)(t,e,r,a,o,i,s,c,l,f);function xn(t,e){var r=E();try{return A(t)(e)}catch(a){if(S(r),a!==a+0)throw a;T(1,0)}}function Wn(t,e,r,a){var o=E();try{A(t)(e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}function Mn(t,e,r){var a=E();try{A(t)(e,r)}catch(o){if(S(a),o!==o+0)throw o;T(1,0)}}function Rn(t,e,r,a,o){var i=E();try{return A(t)(e,r,a,o)}catch(s){if(S(i),s!==s+0)throw s;T(1,0)}}function In(t,e,r){var a=E();try{return A(t)(e,r)}catch(o){if(S(a),o!==o+0)throw o;T(1,0)}}function kn(t){var e=E();try{A(t)()}catch(r){if(S(e),r!==r+0)throw r;T(1,0)}}function Hn(t,e){var r=E();try{A(t)(e)}catch(a){if(S(r),a!==a+0)throw a;T(1,0)}}function Un(t,e,r,a){var o=E();try{return A(t)(e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}function Vn(t,e,r,a,o,i){var s=E();try{A(t)(e,r,a,o,i)}catch(c){if(S(s),c!==c+0)throw c;T(1,0)}}function Bn(t,e,r,a,o){var i=E();try{A(t)(e,r,a,o)}catch(s){if(S(i),s!==s+0)throw s;T(1,0)}}function Yn(t,e,r,a,o,i,s,c,l,f,m){var y=E();try{A(t)(e,r,a,o,i,s,c,l,f,m)}catch($){if(S(y),$!==$+0)throw $;T(1,0)}}function Ln(t,e,r,a,o,i,s){var c=E();try{return A(t)(e,r,a,o,i,s)}catch(l){if(S(c),l!==l+0)throw l;T(1,0)}}function zn(t,e,r,a,o,i){var s=E();try{return A(t)(e,r,a,o,i)}catch(c){if(S(s),c!==c+0)throw c;T(1,0)}}function Nn(t,e,r,a,o,i,s,c){var l=E();try{return A(t)(e,r,a,o,i,s,c)}catch(f){if(S(l),f!==f+0)throw f;T(1,0)}}function Gn(t,e,r,a){var o=E();try{return A(t)(e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}function qn(t,e,r,a){var o=E();try{return A(t)(e,r,a)}catch(i){if(S(o),i!==i+0)throw i;T(1,0)}}function Xn(t){var e=E();try{return A(t)()}catch(r){if(S(e),r!==r+0)throw r;T(1,0)}}function Jn(t,e,r,a,o,i,s,c){var l=E();try{A(t)(e,r,a,o,i,s,c)}catch(f){if(S(l),f!==f+0)throw f;T(1,0)}}function Zn(t,e,r,a,o,i,s,c,l,f,m,y){var $=E();try{return A(t)(e,r,a,o,i,s,c,l,f,m,y)}catch(b){if(S($),b!==b+0)throw b;T(1,0)}}function Qn(t,e,r,a,o,i,s,c,l,f,m,y,$,b,O,F){var D=E();try{A(t)(e,r,a,o,i,s,c,l,f,m,y,$,b,O,F)}catch(p){if(S(D),p!==p+0)throw p;T(1,0)}}function Xt(t,e,r,a,o){var i=E();try{return Ie(t,e,r,a,o)}catch(s){if(S(i),s!==s+0)throw s;T(1,0)}}var qt;dt=function t(){qt||n(),qt||(dt=t)};function n(){if(K>0||(Ue(),K>0))return;function t(){qt||(qt=!0,u.calledRun=!0,!Ft&&(Ve(),x(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Be()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),t()},1)):t()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();return n(),g.ready}})();function Xa(d){return Ba(qa,d)}const ea=new Map([["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["data_matrix","DataMatrix"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["pdf417","PDF417"],["qr_code","QRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"]]);function Ja(d){for(const[g,u]of ea)if(d===u)return g;return"unknown"}var Jt;class Za extends EventTarget{constructor(u={}){var x;super();oa(this,Jt,void 0);try{const _=(x=u==null?void 0:u.formats)==null?void 0:x.filter(W=>W!=="unknown");if((_==null?void 0:_.length)===0)throw new TypeError("Hint option provided, but is empty.");_==null||_.forEach(W=>{if(!sa.includes(W))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${W}' is not a valid enum value of type BarcodeFormat.`)}),ia(this,Jt,_??[]),za().then(W=>{this.dispatchEvent(new CustomEvent("load",{detail:W}))}).catch(W=>{this.dispatchEvent(new CustomEvent("error",{detail:W}))})}catch(_){throw ua(_,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return sa.filter(u=>u!=="unknown")}async detect(u){try{const x=await Ea(u);if(x===null)return[];let _;try{ga(x)?_=await Na(x,{tryHarder:!0,formats:Kn(this,Jt).map(W=>ea.get(W))}):_=await Ga(x,{tryHarder:!0,formats:Kn(this,Jt).map(W=>ea.get(W))})}catch(W){throw console.error(W),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return _.map(W=>{const{topLeft:{x:J,y:Z},topRight:{x:q,y:I},bottomLeft:{x:rt,y:nt},bottomRight:{x:z,y:Q}}=W.position,ut=Math.min(J,q,rt,z),Ft=Math.min(Z,I,nt,Q),Zt=Math.max(J,q,rt,z),U=Math.max(Z,I,nt,Q);return{boundingBox:new DOMRectReadOnly(ut,Ft,Zt-ut,U-Ft),rawValue:W.text,format:Ja(W.format),cornerPoints:[{x:J,y:Z},{x:q,y:I},{x:z,y:Q},{x:rt,y:nt}]}})}catch(x){throw ua(x,"Failed to execute 'detect' on 'BarcodeDetector'")}}}Jt=new WeakMap;exports.BarcodeDetector=Za;exports.setZXingModuleOverrides=Xa;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="dom-webcodecs" />
2
- import { ZXingModule } from "@sec-ant/zxing-wasm/reader";
2
+ import { type ZXingModule } from "zxing-wasm/reader";
3
3
  import { BARCODE_DETECTOR_FORMATS } from "./utils.js";
4
4
  export type BarcodeFormat = (typeof BARCODE_DETECTOR_FORMATS)[number];
5
5
  export interface BarcodeDetectorOptions {
@@ -32,4 +32,4 @@ export declare class BarcodeDetector extends EventTarget {
32
32
  static getSupportedFormats(): Promise<readonly BarcodeFormat[]>;
33
33
  detect(image: ImageBitmapSourceWebCodecs): Promise<DetectedBarcode[]>;
34
34
  }
35
- export { setZXingModuleOverrides } from "@sec-ant/zxing-wasm";
35
+ export { setZXingModuleOverrides } from "zxing-wasm";