barcode-detector 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/polyfill.js +1 -1
- package/dist/cjs/ponyfill.js +1 -1
- package/dist/cjs/zxing-exported-Mk1GOu26.cjs +1 -0
- package/dist/es/index.js +3 -10
- package/dist/es/polyfill.js +6 -12
- package/dist/es/ponyfill.js +2 -2206
- package/dist/es/zxing-exported-ryrXJVV5.js +2345 -0
- package/dist/iife/index.js +1 -1
- package/dist/iife/polyfill.js +1 -1
- package/dist/iife/ponyfill.js +1 -1
- package/package.json +17 -17
package/dist/iife/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=(function(P){"use strict";var rr=P=>{throw TypeError(P)};var nr=(P,O,L)=>O.has(P)||rr("Cannot "+L);var ar=(P,O,L)=>(nr(P,O,"read from private field"),L?L.call(P):O.get(P)),or=(P,O,L)=>O.has(P)?rr("Cannot add the same private member more than once"):O instanceof WeakSet?O.add(P):O.set(P,L),ir=(P,O,L,Mt)=>(nr(P,O,"write to private field"),Mt?Mt.call(P,L):O.set(P,L),L);var it,he;const O=[["All","*","*"," ",0,"All"],["AllReadable","*","r"," ",0,"All Readable"],["AllCreatable","*","w"," ",0,"All Creatable"],["AllLinear","*","l"," ",0,"All Linear"],["AllMatrix","*","m"," ",0,"All Matrix"],["AllGS1","*","G"," ",0,"All GS1"],["AllRetail","*","R"," ",0,"All Retail"],["AllIndustrial","*","I"," ",0,"All Industrial"],["Codabar","F"," ","lrw ",18,"Codabar"],["Code39","A"," ","lrw I",8,"Code 39"],["Code39Std","A","s","lrw I",8,"Code 39 Standard"],["Code39Ext","A","e","lr I",9,"Code 39 Extended"],["Code32","A","2","lr I",129,"Code 32"],["PZN","A","p","lr I",52,"Pharmazentralnummer"],["Code93","G"," ","lrw I",25,"Code 93"],["Code128","C"," ","lrwGI",20,"Code 128"],["ITF","I"," ","lrw I",3,"ITF"],["ITF14","I","4","lr I",89,"ITF-14"],["DataBar","e"," ","lr GR",29,"DataBar"],["DataBarOmni","e","o","lr GR",29,"DataBar Omni"],["DataBarStk","e","s","lr GR",79,"DataBar Stacked"],["DataBarStkOmni","e","O","lr GR",80,"DataBar Stacked Omni"],["DataBarLtd","e","l","lr GR",30,"DataBar Limited"],["DataBarExp","e","e","lr GR",31,"DataBar Expanded"],["DataBarExpStk","e","E","lr GR",81,"DataBar Expanded Stacked"],["EANUPC","E"," ","lr R",15,"EAN/UPC"],["EAN13","E","1","lrw R",15,"EAN-13"],["EAN8","E","8","lrw R",10,"EAN-8"],["EAN5","E","5","l R",12,"EAN-5"],["EAN2","E","2","l R",11,"EAN-2"],["ISBN","E","i","lr R",69,"ISBN"],["UPCA","E","a","lrw R",34,"UPC-A"],["UPCE","E","e","lrw R",37,"UPC-E"],["OtherBarcode","X"," "," r ",0,"Other barcode"],["DXFilmEdge","X","x","lr ",147,"DX Film Edge"],["PDF417","L"," ","mrw ",55,"PDF417"],["CompactPDF417","L","c","mr ",56,"Compact PDF417"],["MicroPDF417","L","m","m ",84,"MicroPDF417"],["Aztec","z"," ","mr G ",92,"Aztec"],["AztecCode","z","c","mrwG ",92,"Aztec Code"],["AztecRune","z","r","mr ",128,"Aztec Rune"],["QRCode","Q"," ","mrwG ",58,"QR Code"],["QRCodeModel1","Q","1","mr ",0,"QR Code Model 1"],["QRCodeModel2","Q","2","mr ",58,"QR Code Model 2"],["MicroQRCode","Q","m","mr ",97,"Micro QR Code"],["RMQRCode","Q","r","mr G ",145,"rMQR Code"],["DataMatrix","d"," ","mrwG ",71,"Data Matrix"],["MaxiCode","U"," ","mr ",57,"MaxiCode"]],L={DataBarExpanded:"DataBarExp",DataBarLimited:"DataBarLtd","Linear-Codes":"AllLinear","Matrix-Codes":"AllMatrix",Any:"All",rMQRCode:"RMQRCode"};O.map(a=>a[5]),O.filter(a=>a[1]==="*").map(a=>a[0]),O.filter(a=>a[1]!=="*").map(a=>a[0]),O.filter(a=>a[2]===" ").map(a=>a[0]),O.filter(a=>a[3][0]==="l").map(a=>a[0]),O.filter(a=>a[3][0]==="m").map(a=>a[0]),O.filter(a=>a[3][1]==="r").map(a=>a[0]),O.filter(a=>a[3][2]==="w"||a[4]!==0).map(a=>a[0]),O.filter(a=>a[3][3]==="G").map(a=>a[0]),O.filter(a=>a[3][4]==="R").map(a=>a[0]),O.filter(a=>a[3][4]==="I").map(a=>a[0]);function sr(a){var f;return(f=L[a])!=null?f:a}function ur(a){return a.map(sr).join(",")}const cr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function lr(a){return cr.indexOf(a)}const Kt=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function dr(a){return a==="UnicodeBig"?Kt.indexOf("UTF16BE"):Kt.indexOf(a)}const fr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function hr(a){return fr[a]}const pr=["Ignore","Read","Require"];function mr(a){return pr.indexOf(a)}const yr=["Plain","ECI","HRI","Escaped","Hex","HexECI"];function vr(a){return yr.indexOf(a)}const mt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown",tryCode39ExtendedMode:!0};function te(a){var f;return{...a,formats:ur(a.formats),binarizer:lr(a.binarizer),eanAddOnSymbol:mr(a.eanAddOnSymbol),textMode:vr(a.textMode),characterSet:dr(a.characterSet),tryCode39ExtendedMode:(f=a.tryCode39ExtendedMode)!=null?f:!0}}function gr(a){return{...a,format:a.format,symbology:a.symbology,contentType:hr(a.contentType)}}const wr="3.0.0",br="9a9ccb838fcbf067cc9a9f0fd26d06fe6cc02467",Cr={locateFile:(a,f)=>{const p=a.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.0.0/dist/${p[1]}/${a}`:f+a}},yt=new WeakMap;function $r(a,f){return Object.is(a,f)||Object.keys(a).length===Object.keys(f).length&&Object.keys(a).every(p=>Object.hasOwn(f,p)&&a[p]===f[p])}function ee(a,{overrides:f,equalityFn:p=$r,fireImmediately:T=!1}={}){var l;const[x,R]=(l=yt.get(a))!=null?l:[Cr],M=f!=null?f:x;let S;if(T){if(R&&(S=p(x,M)))return R;const F=a({...M});return yt.set(a,[M,F]),F}(S!=null?S:p(x,M))||yt.set(a,[M])}function Tr(a){yt.delete(a)}async function Er(a,f,p=mt){const T={...mt,...p},l=await ee(a,{fireImmediately:!0});let x,R;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:F},width:G,height:Z}=f;R=l._malloc(F),l.HEAPU8.set(S,R),x=l.readBarcodesFromPixmap(R,G,Z,te(T))}else{let S,F;if("buffer"in f)[S,F]=[f.byteLength,f];else if("byteLength"in f)[S,F]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,F]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");R=l._malloc(S),l.HEAPU8.set(F,R),x=l.readBarcodesFromImage(R,S,te(T))}l._free(R);const M=[];for(let S=0;S<x.size();++S)M.push(gr(x.get(S)));return M}({...mt,formats:[...mt.formats]});async function Ft(a={}){var f,p,T,l=a,x=!!globalThis.window,R=typeof Bun<"u",M=!!globalThis.WorkerGlobalScope;!((p=globalThis.process)===null||p===void 0||(p=p.versions)===null||p===void 0)&&p.node&&((T=globalThis.process)===null||T===void 0?void 0:T.type)!="renderer";var S="./this.program",F,G="";function Z(t){return l.locateFile?l.locateFile(t,G):G+t}var nt,Y;if(x||M||R){try{G=new URL(".",F).href}catch{}M&&(Y=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),nt=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var st=console.log.bind(console),H=console.error.bind(console),J,vt=!1,pe,me,K,z,gt,ut,ct,A,ye,ve,ge=!1;function we(){var t=It.buffer;K=new Int8Array(t),gt=new Int16Array(t),l.HEAPU8=z=new Uint8Array(t),ut=new Uint16Array(t),ct=new Int32Array(t),A=new Uint32Array(t),ye=new Float32Array(t),ve=new Float64Array(t)}function zr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)rn(l.preRun.shift());be($e)}function Nr(){ge=!0,pt.xa()}function Qr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)en(l.postRun.shift());be(Ce)}function Lt(t){var e,r;(e=l.onAbort)===null||e===void 0||e.call(l,t),t="Aborted("+t+")",H(t),vt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw(r=me)===null||r===void 0||r(n),n}var wt;function Xr(){return Z("zxing_reader.wasm")}function qr(t){if(t==wt&&J)return new Uint8Array(J);if(Y)return Y(t);throw"both async and sync fetching of the wasm failed"}async function Zr(t){if(!J)try{var e=await nt(t);return new Uint8Array(e)}catch{}return qr(t)}async function Yr(t,e){try{var r=await Zr(t),n=await WebAssembly.instantiate(r,e);return n}catch(o){H(`failed to asynchronously prepare wasm: ${o}`),Lt(o)}}async function Jr(t,e,r){if(!t&&WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"}),o=await WebAssembly.instantiateStreaming(n,r);return o}catch(i){H(`wasm streaming compile failed: ${i}`),H("falling back to ArrayBuffer instantiation")}return Yr(e,r)}function Kr(){var t={a:Fa};return t}async function tn(){function t(i,s){return pt=i.exports,Ma(pt),we(),pt}function e(i){return t(i.instance)}var r=Kr();if(l.instantiateWasm)return new Promise((i,s)=>{l.instantiateWasm(r,(u,c)=>{i(t(u))})});wt!=null||(wt=Xr());var n=await Jr(J,wt,r),o=e(n);return o}var be=t=>{for(;t.length>0;)t.shift()(l)},Ce=[],en=t=>Ce.push(t),$e=[],rn=t=>$e.push(t),v=t=>He(t),g=()=>ze(),bt=[],Ct=0,nn=t=>{var e=new Ut(t);return e.get_caught()||(e.set_caught(!0),Ct--),e.set_rethrown(!1),bt.push(e),Qe(t),Ve(t)},N=0,an=()=>{y(0,0);var t=bt.pop();Ne(t.excPtr),N=0};class Ut{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){A[this.ptr+4>>2]=e}get_type(){return A[this.ptr+4>>2]}set_destructor(e){A[this.ptr+8>>2]=e}get_destructor(){return A[this.ptr+8>>2]}set_caught(e){e=e?1:0,K[this.ptr+12]=e}get_caught(){return K[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,K[this.ptr+13]=e}get_rethrown(){return K[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){A[this.ptr+16>>2]=e}get_adjusted_ptr(){return A[this.ptr+16>>2]}}var $t=t=>Ge(t),kt=t=>{var e=N;if(!e)return $t(0),0;var r=new Ut(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return $t(0),e;for(var o of t){if(o===0||o===n)break;var i=r.ptr+16;if(Xe(o,n,i))return $t(o),e}return $t(n),e},on=()=>kt([]),sn=t=>kt([t]),un=(t,e)=>kt([t,e]),cn=()=>{var t=bt.pop();t||Lt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(bt.push(t),t.set_rethrown(!0),t.set_caught(!1),Ct++),N=e,N},ln=(t,e,r)=>{var n=new Ut(t);throw n.init(e,r),N=t,Ct++,N},dn=()=>Ct,fn=t=>{throw N||(N=t),N},hn=()=>Lt(""),Tt={},Wt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function lt(t){return this.fromWireType(A[t>>2])}var at={},tt={},Et={},pn=class extends Error{constructor(t){super(t),this.name="InternalError"}},_t=t=>{throw new pn(t)},et=(t,e,r)=>{t.forEach(u=>Et[u]=e);function n(u){var c=r(u);c.length!==t.length&&_t("Mismatched type converter count");for(var d=0;d<t.length;++d)W(t[d],c[d])}var o=new Array(e.length),i=[],s=0;{const u=e;for(let c=0;c<u.length;++c){const d=u[c];tt.hasOwnProperty(d)?o[c]=tt[d]:(i.push(d),at.hasOwnProperty(d)||(at[d]=[]),at[d].push(()=>{o[c]=tt[d],++s,s===i.length&&n(o)}))}}i.length===0&&n(o)},mn=t=>{var e=Tt[t];delete Tt[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields,i=o.map(s=>s.getterReturnType).concat(o.map(s=>s.setterArgumentType));et([t],i,s=>{var u={};{const c=o;for(let d=0;d<c.length;++d){const h=c[d],m=s[d],C=h.getter,E=h.getterContext,I=s[d+o.length],D=h.setter,_=h.setterContext;u[h.fieldName]={read:$=>m.fromWireType(C(E,$)),write:($,k)=>{var j=[];D(_,$,I.toWireType(j,k)),Wt(j)},optional:m.optional}}}return[{name:e.name,fromWireType:c=>{var d={};for(var h in u)d[h]=u[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in u)if(!(h in d)&&!u[h].optional)throw new TypeError(`Missing field: "${h}"`);var m=r();for(h in u)u[h].write(m,d[h]);return c!==null&&c.push(n,m),m},readValueFromPointer:lt,destructorFunction:n}]})},yn=(t,e,r,n,o)=>{},B=t=>{for(var e="";;){var r=z[t++];if(!r)return e;e+=String.fromCharCode(r)}},dt=class extends Error{constructor(t){super(t),this.name="BindingError"}},b=t=>{throw new dt(t)};function vn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||b(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(tt[t]=e,delete Et[t],at.hasOwnProperty(t)){var o=at[t];delete at[t],o.forEach(i=>i())}}function W(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(t,e,r)}var gn=(t,e,r,n)=>{e=B(e),W(t,{name:e,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?r:n},readValueFromPointer:function(o){return this.fromWireType(z[o])},destructorFunction:null})},wn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Vt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Gt=!1,Te=t=>{},bn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Ee=t=>{t.count.value-=1;var e=t.count.value===0;e&&bn(t)},ft=t=>globalThis.FinalizationRegistry?(Gt=new FinalizationRegistry(e=>{Ee(e.$$)}),ft=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var o={$$:r};Gt.register(e,o,e)}return e},Te=e=>Gt.unregister(e),ft(t)):(ft=e=>e,t),Cn=()=>{let t=At.prototype;Object.assign(t,{isAliasOf(r){if(!(this instanceof At)||!(r instanceof At))return!1;var n=this.$$.ptrType.registeredClass,o=this.$$.ptr;r.$$=r.$$;for(var i=r.$$.ptrType.registeredClass,s=r.$$.ptr;n.baseClass;)o=n.upcast(o),n=n.baseClass;for(;i.baseClass;)s=i.upcast(s),i=i.baseClass;return n===i&&o===s},clone(){if(this.$$.ptr||Vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=ft(Object.create(Object.getPrototypeOf(this),{$$:{value:wn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Te(this),Ee(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)};function At(){}var Ht=(t,e)=>Object.defineProperty(e,"name",{value:t}),_e={},Ae=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return t[e].overloadTable.hasOwnProperty(i.length)||b(`Function '${r}' called with an invalid number of arguments (${i.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[i.length].apply(this,i)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Pe=(t,e,r)=>{l.hasOwnProperty(t)?((r===void 0||l[t].overloadTable!==void 0&&l[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Ae(l,t,t),l[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[t].overloadTable[r]=e):(l[t]=e,l[t].argCount=r)},$n=48,Tn=57,En=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=$n&&e<=Tn?`_${t}`:t};function _n(t,e,r,n,o,i,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var zt=(t,e,r)=>{for(;e!==r;)e.upcast||b(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t},Nt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t};function An(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=zt(e.$$.ptr,r,this.registeredClass);return n}function Pn(t,e){var r;if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&b(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&b(`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=zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:b(`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,V.toHandle(()=>o.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function On(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&b(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=zt(e.$$.ptr,r,this.registeredClass);return n}var Oe=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Oe(t,e,r.baseClass);return n===null?null:r.downcast(n)},Dn={},In=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Sn=(t,e)=>(e=In(t,e),Dn[e]),Pt=(t,e)=>{(!e.ptrType||!e.ptr)&&_t("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&_t("Both smartPtrType and smartPtr must be specified"),e.count={value:1},ft(Object.create(t,{$$:{value:e,writable:!0}}))};function xn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Sn(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 o(){return this.isSmartPointer?Pt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Pt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),s=_e[i];if(!s)return o.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var c=Oe(e,this.registeredClass,u.registeredClass);return c===null?o.call(this):this.isSmartPointer?Pt(u.registeredClass.instancePrototype,{ptrType:u,ptr:c,smartPtrType:this,smartPtr:t}):Pt(u.registeredClass.instancePrototype,{ptrType:u,ptr:c})}var Rn=()=>{Object.assign(Ot.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},readValueFromPointer:lt,fromWireType:xn})};function Ot(t,e,r,n,o,i,s,u,c,d,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!o&&e.baseClass===void 0?n?(this.toWireType=An,this.destructorFunction=null):(this.toWireType=On,this.destructorFunction=null):this.toWireType=Pn}var De=(t,e,r)=>{l.hasOwnProperty(t)||_t("Replacing nonexistent public symbol"),l[t].overloadTable!==void 0&&r!==void 0?l[t].overloadTable[r]=e:(l[t]=e,l[t].argCount=r)},X={},Mn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=X[t];return n(e,...r)},Ie=[],w=t=>{var e=Ie[t];return e||(Ie[t]=e=Ye.get(t)),e},Fn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Mn(t,e,r);var n=w(e),o=n(...r);return o},Bn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Fn(t,e,o,r)}},U=function(t,e){t=B(t);function r(){if(t.includes("j"))return Bn(t,e);var o=w(e);return o}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n};class jn extends Error{}var Se=t=>{var e=We(t),r=B(e);return q(e),r},Dt=(t,e)=>{var r=[],n={};function o(i){if(!n[i]&&!tt[i]){if(Et[i]){Et[i].forEach(o);return}r.push(i),n[i]=!0}}throw e.forEach(o),new jn(`${t}: `+r.map(Se).join([", "]))},Ln=(t,e,r,n,o,i,s,u,c,d,h,m,C)=>{h=B(h),i=U(o,i),u&&(u=U(s,u)),d&&(d=U(c,d)),C=U(m,C);var E=En(h);Pe(E,function(){Dt(`Cannot construct ${h} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],I=>{I=I[0];var D,_;n?(D=I.registeredClass,_=D.instancePrototype):_=At.prototype;var $=Ht(h,function(){if(Object.getPrototypeOf(this)!==k)throw new dt(`Use 'new' to construct ${h}`);if(j.constructor_body===void 0)throw new dt(`${h} has no accessible constructor`);for(var tr=arguments.length,xt=new Array(tr),Rt=0;Rt<tr;Rt++)xt[Rt]=arguments[Rt];var er=j.constructor_body[xt.length];if(er===void 0)throw new dt(`Tried to invoke ctor of ${h} with invalid number of parameters (${xt.length}) - expected (${Object.keys(j.constructor_body).toString()}) parameters instead!`);return er.apply(this,xt)}),k=Object.create(_,{constructor:{value:$}});$.prototype=k;var j=new _n(h,$,k,C,D,i,u,d);if(j.baseClass){var Q,St;(St=(Q=j.baseClass).__derivedClasses)!==null&&St!==void 0||(Q.__derivedClasses=[]),j.baseClass.__derivedClasses.push(j)}var wo=new Ot(h,j,!0,!1,!1),Je=new Ot(h+"*",j,!1,!1,!1),Ke=new Ot(h+" const*",j,!1,!0,!1);return _e[t]={pointerType:Je,constPointerType:Ke},De(E,$),[wo,Je,Ke]})},Qt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(A[e+n*4>>2]);return r};function Un(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Xt(t,e,r,n,o,i){var s=e.length;s<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,c=Un(e),d=!e[0].isVoid,h=s-2,m=new Array(h),C=[],E=[],I=function(){E.length=0;var D;C.length=u?2:1,C[0]=o,u&&(D=e[1].toWireType(E,this),C[1]=D);for(var _=0;_<h;++_)m[_]=e[_+2].toWireType(E,_<0||arguments.length<=_?void 0:arguments[_]),C.push(m[_]);var $=n(...C);function k(j){if(c)Wt(E);else for(var Q=u?1:2;Q<e.length;Q++){var St=Q===1?D:m[Q-2];e[Q].destructorFunction!==null&&e[Q].destructorFunction(St)}if(d)return e[0].fromWireType(j)}return k($)};return Ht(t,I)}var kn=(t,e,r,n,o,i)=>{var s=Qt(e,r);o=U(n,o),et([],[t],u=>{u=u[0];var c=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new dt(`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]=()=>{Dt(`Cannot construct ${u.name} due to unbound types`,s)},et([],s,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Xt(c,d,null,o,i),[])),[]})},xe=t=>{t=t.trim();const e=t.indexOf("(");return e===-1?t:t.slice(0,e)},Wn=(t,e,r,n,o,i,s,u,c,d)=>{var h=Qt(r,n);e=B(e),e=xe(e),i=U(o,i),et([],[t],m=>{m=m[0];var C=`${m.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&m.registeredClass.pureVirtualFunctions.push(e);function E(){Dt(`Cannot call ${C} due to unbound types`,h)}var I=m.registeredClass.instancePrototype,D=I[e];return D===void 0||D.overloadTable===void 0&&D.className!==m.name&&D.argCount===r-2?(E.argCount=r-2,E.className=m.name,I[e]=E):(Ae(I,e,C),I[e].overloadTable[r-2]=E),et([],h,_=>{var $=Xt(C,_,m,i,s);return I[e].overloadTable===void 0?($.argCount=r-2,I[e]=$):I[e].overloadTable[r-2]=$,[]}),[]})},Re=[],rt=[0,1,,1,null,1,!0,1,!1,1],qt=t=>{t>9&&--rt[t+1]===0&&(rt[t]=void 0,Re.push(t))},V={toValue:t=>(t||b(`Cannot use deleted val. handle = ${t}`),rt[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Re.pop()||rt.length;return rt[e]=t,rt[e+1]=1,e}}}},Me={name:"emscripten::val",fromWireType:t=>{var e=V.toValue(t);return qt(t),e},toWireType:(t,e)=>V.toHandle(e),readValueFromPointer:lt,destructorFunction:null},Vn=t=>W(t,Me),Gn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(ye[r>>2])};case 8:return function(r){return this.fromWireType(ve[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Hn=(t,e,r)=>{e=B(e),W(t,{name:e,fromWireType:n=>n,toWireType:(n,o)=>o,readValueFromPointer:Gn(e,r),destructorFunction:null})},zn=(t,e,r,n,o,i,s,u)=>{var c=Qt(e,r);t=B(t),t=xe(t),o=U(n,o),Pe(t,function(){Dt(`Cannot call ${t} due to unbound types`,c)},e-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return De(t,Xt(t,h,null,o,i),e-1),[]})},Nn=(t,e,r)=>{switch(e){case 1:return r?n=>K[n]:n=>z[n];case 2:return r?n=>gt[n>>1]:n=>ut[n>>1];case 4:return r?n=>ct[n>>2]:n=>A[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Qn=(t,e,r,n,o)=>{e=B(e);const i=n===0;let s=c=>c;if(i){var u=32-8*r;s=c=>c<<u>>>u,o=s(o)}W(t,{name:e,fromWireType:s,toWireType:(c,d)=>d,readValueFromPointer:Nn(e,r,n!==0),destructorFunction:null})},Xn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[e];function i(s){var u=A[s>>2],c=A[s+4>>2];return new o(K.buffer,c,u)}r=B(r),W(t,{name:r,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},qn=Object.assign({optional:!0},Me),Zn=(t,e)=>{W(t,qn)},Yn=(t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s<t.length;++s){var u=t.codePointAt(s);if(u<=127){if(r>=i)break;e[r++]=u}else if(u<=2047){if(r+1>=i)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=i)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=i)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63,s++}}return e[r]=0,r-o},ot=(t,e,r)=>Yn(t,z,e,r),Fe=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},Be=globalThis.TextDecoder&&new TextDecoder,je=(t,e,r,n)=>{var o=e+r;if(n)return o;for(;t[e]&&!(e>=o);)++e;return e},Le=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var o=je(t,e,r,n);if(o-e>16&&t.buffer&&Be)return Be.decode(t.subarray(e,o));for(var i="";e<o;){var s=t[e++];if(!(s&128)){i+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|u);continue}var c=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|t[e++]&63,s<65536)i+=String.fromCharCode(s);else{var d=s-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},Jn=(t,e,r)=>t?Le(z,t,e,r):"",Kn=(t,e)=>{e=B(e),W(t,{name:e,fromWireType(r){var n=A[r>>2],o=r+4,i;return i=Jn(o,n,!0),q(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var o,i=typeof n=="string";i||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||b("Cannot pass non-string to std::string"),i?o=Fe(n):o=n.length;var s=Jt(4+o+1),u=s+4;return A[s>>2]=o,i?ot(n,u,o+1):z.set(n,u),r!==null&&r.push(q,s),s},readValueFromPointer:lt,destructorFunction(r){q(r)}})},Ue=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,ta=(t,e,r)=>{var n=t>>1,o=je(ut,n,e/2,r);if(o-n>16&&Ue)return Ue.decode(ut.subarray(n,o));for(var i="",s=n;s<o;++s){var u=ut[s];i+=String.fromCharCode(u)}return i},ea=(t,e,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=e,o=r<t.length*2?r/2:t.length,i=0;i<o;++i){var s=t.charCodeAt(i);gt[e>>1]=s,e+=2}return gt[e>>1]=0,e-n},ra=t=>t.length*2,na=(t,e,r)=>{for(var n="",o=t>>2,i=0;!(i>=e/4);i++){var s=A[o+i];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},aa=(t,e,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var s=t.codePointAt(i);if(s>65535&&i++,ct[e>>2]=s,e+=4,e+4>o)break}return ct[e>>2]=0,e-n},oa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.codePointAt(r);n>65535&&r++,e+=4}return e},ia=(t,e,r)=>{r=B(r);var n,o,i;e===2?(n=ta,o=ea,i=ra):(n=na,o=aa,i=oa),W(t,{name:r,fromWireType:s=>{var u=A[s>>2],c=n(s+4,u*e,!0);return q(s),c},toWireType:(s,u)=>{typeof u!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var c=i(u),d=Jt(4+c+e);return A[d>>2]=c/e,o(u,d+4,c+e),s!==null&&s.push(q,d),d},readValueFromPointer:lt,destructorFunction(s){q(s)}})},sa=(t,e,r,n,o,i)=>{Tt[t]={name:B(e),rawConstructor:U(r,n),rawDestructor:U(o,i),fields:[]}},ua=(t,e,r,n,o,i,s,u,c,d)=>{Tt[t].fields.push({fieldName:B(e),getterReturnType:r,getter:U(n,o),getterContext:i,setterArgumentType:s,setter:U(u,c),setterContext:d})},ca=(t,e)=>{e=B(e),W(t,{isVoid:!0,name:e,fromWireType:()=>{},toWireType:(r,n)=>{}})},Zt=[],la=t=>{var e=Zt.length;return Zt.push(t),e},da=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${Se(t)}`),r},fa=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=da(A[e+n*4>>2],`parameter ${n}`);return r},ha=(t,e,r)=>{var n=[],o=t(n,r);return n.length&&(A[e>>2]=V.toHandle(n)),o},pa={},ke=t=>{var e=pa[t];return e===void 0?B(t):e},ma=(t,e,r)=>{var n=8,[o,...i]=fa(t,e),s=o.toWireType.bind(o),u=i.map(m=>m.readValueFromPointer.bind(m));t--;var c=new Array(t),d=(m,C,E,I)=>{for(var D=0,_=0;_<t;++_)c[_]=u[_](I+D),D+=n;var $;switch(r){case 0:$=V.toValue(m).apply(null,c);break;case 2:$=Reflect.construct(V.toValue(m),c);break;case 3:$=c[0];break;case 1:$=V.toValue(m)[ke(C)](...c);break}return ha(s,E,$)},h=`methodCaller<(${i.map(m=>m.name)}) => ${o.name}>`;return la(Ht(h,d))},ya=t=>t?(t=ke(t),V.toHandle(globalThis[t])):V.toHandle(globalThis),va=t=>{t>9&&(rt[t+1]+=1)},ga=(t,e,r,n,o)=>Zt[t](e,r,n,o),wa=t=>{var e=V.toValue(t);Wt(e),qt(t)},ba=(t,e,r,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),u=i.getTimezoneOffset(),c=s.getTimezoneOffset(),d=Math.max(u,c);A[t>>2]=d*60,ct[e>>2]=+(u!=c);var h=E=>{var I=E>=0?"-":"+",D=Math.abs(E),_=String(Math.floor(D/60)).padStart(2,"0"),$=String(D%60).padStart(2,"0");return`UTC${I}${_}${$}`},m=h(u),C=h(c);c<u?(ot(m,r,17),ot(C,n,17)):(ot(m,n,17),ot(C,r,17))},Ca=()=>2147483648,$a=(t,e)=>Math.ceil(t/e)*e,Ta=t=>{var e=It.buffer.byteLength,r=(t-e+65535)/65536|0;try{return It.grow(r),we(),1}catch{}},Ea=t=>{var e=z.length;t>>>=0;var r=Ca();if(t>r)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,t+100663296);var i=Math.min(r,$a(Math.max(t,o),65536)),s=Ta(i);if(s)return!0}return!1},Yt={},_a=()=>S||"./this.program",ht=()=>{if(!ht.strings){var t=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:_a()};for(var r in Yt)Yt[r]===void 0?delete e[r]:e[r]=Yt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);ht.strings=n}return ht.strings},Aa=(t,e)=>{var r=0,n=0;for(var o of ht()){var i=e+r;A[t+n>>2]=i,r+=ot(o,i,1/0)+1,n+=4}return 0},Pa=(t,e)=>{var r=ht();A[t>>2]=r.length;var n=0;for(var o of r)n+=Fe(o)+1;return A[e>>2]=n,0},Oa=t=>52;function Da(t,e,r,n,o){return 70}var Ia=[null,[],[]],Sa=(t,e)=>{var r=Ia[t];e===0||e===10?((t===1?st:H)(Le(r)),r.length=0):r.push(e)},xa=(t,e,r,n)=>{for(var o=0,i=0;i<r;i++){var s=A[e>>2],u=A[e+4>>2];e+=8;for(var c=0;c<u;c++)Sa(t,z[s+c]);o+=u}return A[n>>2]=o,0},Ra=t=>t;if(Cn(),Rn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(st=l.print),l.printErr&&(H=l.printErr),l.wasmBinary&&(J=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(S=l.thisProgram),l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();var We,q,Jt,Ve,y,Ge,He,ze,Ne,Qe,Xe,qe,Ze,It,Ye;function Ma(t){We=t.ya,q=l._free=t.za,Jt=l._malloc=t.Ba,Ve=t.Ca,y=t.Da,Ge=t.Ea,He=t.Fa,ze=t.Ga,Ne=t.Ha,Qe=t.Ia,Xe=t.Ja,X.viijii=t.Ka,qe=X.iiijj=t.La,X.jiji=t.Ma,Ze=X.jiiii=t.Na,X.iiiiij=t.Oa,X.iiiiijj=t.Pa,X.iiiiiijj=t.Qa,It=t.wa,Ye=t.Aa}var Fa={s:nn,x:an,a:on,j:sn,m:un,P:cn,q:ln,U:dn,d:fn,ba:hn,ta:mn,aa:yn,oa:gn,ra:Ln,qa:kn,F:Wn,ma:Vn,W:Hn,X:zn,z:Qn,t:Xn,sa:Zn,na:Kn,R:ia,G:sa,ua,pa:ca,M:ma,va:qt,C:ya,S:va,L:ga,ha:wa,ca:ba,fa:Ea,da:Aa,ea:Pa,ga:Oa,_:Da,V:xa,J:oo,B:so,Y:Ga,T:ho,r:eo,b:La,D:ao,ja:co,c:ka,ia:lo,h:Va,i:qa,p:Ya,O:no,w:Ka,E:to,K:ro,I:po,$:yo,Z:vo,f:Ha,l:Ba,e:Ua,g:Wa,N:fo,k:ja,ka:io,o:Ja,y:Na,u:Za,Q:Xa,v:uo,n:za,H:mo,la:Qa,A:Ra};function Ba(t,e){var r=g();try{w(t)(e)}catch(n){if(v(r),n!==n+0)throw n;y(1,0)}}function ja(t,e,r,n,o){var i=g();try{w(t)(e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function La(t,e){var r=g();try{return w(t)(e)}catch(n){if(v(r),n!==n+0)throw n;y(1,0)}}function Ua(t,e,r){var n=g();try{w(t)(e,r)}catch(o){if(v(n),o!==o+0)throw o;y(1,0)}}function ka(t,e,r){var n=g();try{return w(t)(e,r)}catch(o){if(v(n),o!==o+0)throw o;y(1,0)}}function Wa(t,e,r,n){var o=g();try{w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function Va(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function Ga(t,e,r,n,o,i){var s=g();try{return w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function Ha(t){var e=g();try{w(t)()}catch(r){if(v(e),r!==r+0)throw r;y(1,0)}}function za(t,e,r,n,o,i,s,u,c,d,h){var m=g();try{w(t)(e,r,n,o,i,s,u,c,d,h)}catch(C){if(v(m),C!==C+0)throw C;y(1,0)}}function Na(t,e,r,n,o,i,s){var u=g();try{w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function Qa(t,e,r,n,o,i,s,u,c,d,h,m,C,E,I,D,_){var $=g();try{w(t)(e,r,n,o,i,s,u,c,d,h,m,C,E,I,D,_)}catch(k){if(v($),k!==k+0)throw k;y(1,0)}}function Xa(t,e,r,n,o,i,s,u,c){var d=g();try{w(t)(e,r,n,o,i,s,u,c)}catch(h){if(v(d),h!==h+0)throw h;y(1,0)}}function qa(t,e,r,n,o){var i=g();try{return w(t)(e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function Za(t,e,r,n,o,i,s,u){var c=g();try{w(t)(e,r,n,o,i,s,u)}catch(d){if(v(c),d!==d+0)throw d;y(1,0)}}function Ya(t,e,r,n,o,i){var s=g();try{return w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function Ja(t,e,r,n,o,i){var s=g();try{w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function Ka(t,e,r,n,o,i,s){var u=g();try{return w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function to(t,e,r,n,o,i,s,u){var c=g();try{return w(t)(e,r,n,o,i,s,u)}catch(d){if(v(c),d!==d+0)throw d;y(1,0)}}function eo(t){var e=g();try{return w(t)()}catch(r){if(v(e),r!==r+0)throw r;y(1,0)}}function ro(t,e,r,n,o,i,s,u,c){var d=g();try{return w(t)(e,r,n,o,i,s,u,c)}catch(h){if(v(d),h!==h+0)throw h;y(1,0)}}function no(t,e,r,n,o,i,s){var u=g();try{return w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function ao(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function oo(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function io(t,e,r,n,o,i,s,u){var c=g();try{w(t)(e,r,n,o,i,s,u)}catch(d){if(v(c),d!==d+0)throw d;y(1,0)}}function so(t,e,r,n,o,i){var s=g();try{return w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function uo(t,e,r,n,o,i,s,u,c,d){var h=g();try{w(t)(e,r,n,o,i,s,u,c,d)}catch(m){if(v(h),m!==m+0)throw m;y(1,0)}}function co(t,e,r){var n=g();try{return w(t)(e,r)}catch(o){if(v(n),o!==o+0)throw o;y(1,0)}}function lo(t,e,r,n,o){var i=g();try{return w(t)(e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function fo(t,e,r,n,o,i,s){var u=g();try{w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function ho(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function po(t,e,r,n,o,i,s,u,c,d,h,m){var C=g();try{return w(t)(e,r,n,o,i,s,u,c,d,h,m)}catch(E){if(v(C),E!==E+0)throw E;y(1,0)}}function mo(t,e,r,n,o,i,s,u,c,d,h,m,C,E,I,D){var _=g();try{w(t)(e,r,n,o,i,s,u,c,d,h,m,C,E,I,D)}catch($){if(v(_),$!==$+0)throw $;y(1,0)}}function yo(t,e,r,n,o,i,s){var u=g();try{return qe(t,e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function vo(t,e,r,n,o){var i=g();try{return Ze(t,e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function go(){zr();function t(){var e,r;l.calledRun=!0,!vt&&(Nr(),(e=pe)===null||e===void 0||e(l),(r=l.onRuntimeInitialized)===null||r===void 0||r.call(l),Qr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),t()},1)):t()}var pt;return pt=await tn(),go(),ge?f=l:f=new Promise((t,e)=>{pe=t,me=e}),f}function Bt(a){return ee(Ft,a)}function _r(){return Tr(Ft)}function Ar(a){Bt({overrides:a,equalityFn:Object.is,fireImmediately:!1})}async function Pr(a,f){return Er(Ft,a,f)}const Or="c25c09c3a8ec3118f96d224491c9a20cc6ad4302b70eb0e4b941772c2982a920",re=[["aztec","Aztec"],["aztec_code","AztecCode"],["aztec_rune","AztecRune"],["code_128","Code128"],["code_39","Code39"],["code_39_standard","Code39Std"],["code_39_extended","Code39Ext"],["code_32","Code32"],["pzn","PZN"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_omni","DataBarOmni"],["databar_stacked","DataBarStk"],["databar_stacked_omni","DataBarStkOmni"],["databar_expanded","DataBarExp"],["databar_expanded_stacked","DataBarExpStk"],["databar_limited","DataBarLtd"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN13"],["ean_upc","EANUPC"],["isbn","ISBN"],["ean_8","EAN8"],["itf","ITF"],["itf_14","ITF14"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["compact_pdf417","CompactPDF417"],["qr_code","QRCode"],["qr_code_model_1","QRCodeModel1"],["qr_code_model_2","QRCodeModel2"],["rm_qr_code","RMQRCode"],["upc_a","UPCA"],["upc_e","UPCE"],["other_barcode","OtherBarcode"],["linear_codes","AllLinear"],["matrix_codes","AllMatrix"],["gs1_codes","AllGS1"],["retail_codes","AllRetail"],["industrial_codes","AllIndustrial"],["any","All"]],Dr=[...re,["unknown"]].map(a=>a[0]),jt=new Map(re);function Ir(a){for(const[f,p]of jt)if(a===p)return f;return"unknown"}function Sr(a){if(ne(a))return{width:a.naturalWidth,height:a.naturalHeight};if(ae(a))return{width:a.width.baseVal.value,height:a.height.baseVal.value};if(oe(a))return{width:a.videoWidth,height:a.videoHeight};if(se(a))return{width:a.width,height:a.height};if(ce(a))return{width:a.displayWidth,height:a.displayHeight};if(ie(a))return{width:a.width,height:a.height};if(ue(a))return{width:a.width,height:a.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 ne(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ae(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function oe(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function ie(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function se(a){try{return a instanceof ImageBitmap||Object.prototype.toString.call(a)==="[object ImageBitmap]"}catch{return!1}}function ue(a){try{return a instanceof OffscreenCanvas||Object.prototype.toString.call(a)==="[object OffscreenCanvas]"}catch{return!1}}function ce(a){try{return a instanceof VideoFrame||Object.prototype.toString.call(a)==="[object VideoFrame]"}catch{return!1}}function xr(a){try{return a instanceof Blob||Object.prototype.toString.call(a)==="[object Blob]"}catch{return!1}}function Rr(a){try{return a instanceof ImageData||Object.prototype.toString.call(a)==="[object ImageData]"}catch{return!1}}function Mr(a,f){try{const p=new OffscreenCanvas(a,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=a,p.height=f,p}}async function le(a){if(ne(a)&&!await Lr(a))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ae(a)&&!await Ur(a))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ce(a)&&kr(a))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(oe(a)&&(a.readyState===0||a.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(se(a)&&Vr(a))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Sr(a);if(f===0||p===0)return null;const l=Mr(f,p).getContext("2d");l.drawImage(a,0,0);try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Fr(a){let f;try{f=await createImageBitmap(a)}catch{try{if(globalThis.Image){f=new Image;let l="";try{l=URL.createObjectURL(a),f.src=l,await f.decode()}finally{URL.revokeObjectURL(l)}}else return a}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await le(f)}function Br(a){const{width:f,height:p}=a;if(f===0||p===0)return null;const T=a.getContext("2d");try{return T.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function jr(a){if(xr(a))return await Fr(a);if(Rr(a)){if(Wr(a))throw new DOMException("The image data has been detached.","InvalidStateError");return a}return ie(a)||ue(a)?Br(a):await le(a)}async function Lr(a){try{return await a.decode(),!0}catch{return!1}}async function Ur(a){var f;try{return await((f=a.decode)==null?void 0:f.call(a)),!0}catch{return!1}}function kr(a){return a.format===null}function Wr(a){return a.data.buffer.byteLength===0}function Vr(a){return a.width===0&&a.height===0}function de(a,f){return Gr(a)?new DOMException(`${f}: ${a.message}`,a.name):Hr(a)?new a.constructor(`${f}: ${a.message}`):new Error(`${f}: ${a}`)}function Gr(a){return a instanceof DOMException||Object.prototype.toString.call(a)==="[object DOMException]"}function Hr(a){return a instanceof Error||Object.prototype.toString.call(a)==="[object Error]"}class fe{constructor(f={}){or(this,it);var p;try{const T=(p=f==null?void 0:f.formats)==null?void 0:p.filter(l=>l!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const l of T!=null?T:[])if(!jt.has(l))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${l}' is not a valid enum value of type BarcodeFormat.`);ir(this,it,T!=null?T:[]),Bt({fireImmediately:!0}).catch(()=>{})}catch(T){throw de(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Dr.filter(f=>f!=="unknown")}async detect(f){try{const p=await jr(f);if(p===null)return[];let T;const l={textMode:"Plain",formats:ar(this,it).map(x=>jt.get(x))};try{T=await Pr(p,l)}catch(x){throw console.error(x),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(x=>{const{topLeft:{x:R,y:M},topRight:{x:S,y:F},bottomLeft:{x:G,y:Z},bottomRight:{x:nt,y:Y}}=x.position,st=Math.min(R,S,G,nt),H=Math.min(M,F,Z,Y),J=Math.max(R,S,G,nt),vt=Math.max(M,F,Z,Y);return{boundingBox:new DOMRectReadOnly(st,H,J-st,vt-H),rawValue:x.text,format:Ir(x.format),cornerPoints:[{x:R,y:M},{x:S,y:F},{x:nt,y:Y},{x:G,y:Z}]}})}catch(p){throw de(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return it=new WeakMap,(he=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=fe),P.BarcodeDetector=fe,P.ZXING_CPP_COMMIT=br,P.ZXING_WASM_SHA256=Or,P.ZXING_WASM_VERSION=wr,P.prepareZXingModule=Bt,P.purgeZXingModule=_r,P.setZXingModuleOverrides=Ar,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),P})({});
|
|
1
|
+
var BarcodeDetectionAPI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=[[`All`,`*`,`*`,` `,0,`All`],[`AllReadable`,`*`,`r`,` `,0,`All Readable`],[`AllCreatable`,`*`,`w`,` `,0,`All Creatable`],[`AllLinear`,`*`,`l`,` `,0,`All Linear`],[`AllMatrix`,`*`,`m`,` `,0,`All Matrix`],[`AllGS1`,`*`,`G`,` `,0,`All GS1`],[`AllRetail`,`*`,`R`,` `,0,`All Retail`],[`AllIndustrial`,`*`,`I`,` `,0,`All Industrial`],[`Codabar`,`F`,` `,`lrw `,18,`Codabar`],[`Code39`,`A`,` `,`lrw I`,8,`Code 39`],[`Code39Std`,`A`,`s`,`lrw I`,8,`Code 39 Standard`],[`Code39Ext`,`A`,`e`,`lr I`,9,`Code 39 Extended`],[`Code32`,`A`,`2`,`lr I`,129,`Code 32`],[`PZN`,`A`,`p`,`lr I`,52,`Pharmazentralnummer`],[`Code93`,`G`,` `,`lrw I`,25,`Code 93`],[`Code128`,`C`,` `,`lrwGI`,20,`Code 128`],[`ITF`,`I`,` `,`lrw I`,3,`ITF`],[`ITF14`,`I`,`4`,`lr I`,89,`ITF-14`],[`DataBar`,`e`,` `,`lr GR`,29,`DataBar`],[`DataBarOmni`,`e`,`o`,`lr GR`,29,`DataBar Omni`],[`DataBarStk`,`e`,`s`,`lr GR`,79,`DataBar Stacked`],[`DataBarStkOmni`,`e`,`O`,`lr GR`,80,`DataBar Stacked Omni`],[`DataBarLtd`,`e`,`l`,`lr GR`,30,`DataBar Limited`],[`DataBarExp`,`e`,`e`,`lr GR`,31,`DataBar Expanded`],[`DataBarExpStk`,`e`,`E`,`lr GR`,81,`DataBar Expanded Stacked`],[`EANUPC`,`E`,` `,`lr R`,15,`EAN/UPC`],[`EAN13`,`E`,`1`,`lrw R`,15,`EAN-13`],[`EAN8`,`E`,`8`,`lrw R`,10,`EAN-8`],[`EAN5`,`E`,`5`,`l R`,12,`EAN-5`],[`EAN2`,`E`,`2`,`l R`,11,`EAN-2`],[`ISBN`,`E`,`i`,`lr R`,69,`ISBN`],[`UPCA`,`E`,`a`,`lrw R`,34,`UPC-A`],[`UPCE`,`E`,`e`,`lrw R`,37,`UPC-E`],[`OtherBarcode`,`X`,` `,` r `,0,`Other barcode`],[`DXFilmEdge`,`X`,`x`,`lr `,147,`DX Film Edge`],[`PDF417`,`L`,` `,`mrw `,55,`PDF417`],[`CompactPDF417`,`L`,`c`,`mr `,56,`Compact PDF417`],[`MicroPDF417`,`L`,`m`,`m `,84,`MicroPDF417`],[`Aztec`,`z`,` `,`mr G `,92,`Aztec`],[`AztecCode`,`z`,`c`,`mrwG `,92,`Aztec Code`],[`AztecRune`,`z`,`r`,`mr `,128,`Aztec Rune`],[`QRCode`,`Q`,` `,`mrwG `,58,`QR Code`],[`QRCodeModel1`,`Q`,`1`,`mr `,0,`QR Code Model 1`],[`QRCodeModel2`,`Q`,`2`,`mr `,58,`QR Code Model 2`],[`MicroQRCode`,`Q`,`m`,`mr `,97,`Micro QR Code`],[`RMQRCode`,`Q`,`r`,`mr G `,145,`rMQR Code`],[`DataMatrix`,`d`,` `,`mrwG `,71,`Data Matrix`],[`MaxiCode`,`U`,` `,`mr `,57,`MaxiCode`]],n={DataBarExpanded:`DataBarExp`,DataBarLimited:`DataBarLtd`,"Linear-Codes":`AllLinear`,"Matrix-Codes":`AllMatrix`,Any:`All`,rMQRCode:`RMQRCode`};t.map(e=>e[5]),t.filter(e=>e[1]===`*`).map(e=>e[0]),t.filter(e=>e[1]!==`*`).map(e=>e[0]),t.filter(e=>e[2]===` `).map(e=>e[0]),t.filter(e=>e[3][0]===`l`).map(e=>e[0]),t.filter(e=>e[3][0]===`m`).map(e=>e[0]),t.filter(e=>e[3][1]===`r`).map(e=>e[0]),t.filter(e=>e[3][2]===`w`||e[4]!==0).map(e=>e[0]),t.filter(e=>e[3][3]===`G`).map(e=>e[0]),t.filter(e=>e[3][4]===`R`).map(e=>e[0]),t.filter(e=>e[3][4]===`I`).map(e=>e[0]);function r(e){var t;return(t=n[e])==null?e:t}function i(e){return e.map(r).join(`,`)}var a=[`LocalAverage`,`GlobalHistogram`,`FixedThreshold`,`BoolCast`];function o(e){return a.indexOf(e)}var s=`Unknown.ASCII.ISO8859_1.ISO8859_2.ISO8859_3.ISO8859_4.ISO8859_5.ISO8859_6.ISO8859_7.ISO8859_8.ISO8859_9.ISO8859_10.ISO8859_11.ISO8859_13.ISO8859_14.ISO8859_15.ISO8859_16.Cp437.Cp1250.Cp1251.Cp1252.Cp1256.Shift_JIS.Big5.GB2312.GB18030.EUC_JP.EUC_KR.UTF16BE.UTF8.UTF16LE.UTF32BE.UTF32LE.BINARY`.split(`.`);function c(e){return e===`UnicodeBig`?s.indexOf(`UTF16BE`):s.indexOf(e)}var l=[`Text`,`Binary`,`Mixed`,`GS1`,`ISO15434`,`UnknownECI`];function u(e){return l[e]}var d=[`Ignore`,`Read`,`Require`];function f(e){return d.indexOf(e)}var p=[`Plain`,`ECI`,`HRI`,`Escaped`,`Hex`,`HexECI`];function m(e){return p.indexOf(e)}var h={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:`LocalAverage`,isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:`Ignore`,textMode:`HRI`,characterSet:`Unknown`,tryCode39ExtendedMode:!0};function g(e){var t;return{...e,formats:i(e.formats),binarizer:o(e.binarizer),eanAddOnSymbol:f(e.eanAddOnSymbol),textMode:m(e.textMode),characterSet:c(e.characterSet),tryCode39ExtendedMode:(t=e.tryCode39ExtendedMode)==null?!0:t}}function _(e){return{...e,format:e.format,symbology:e.symbology,contentType:u(e.contentType)}}var ee={format:`QRCode`,readerInit:!1,forceSquareDataMatrix:!1,ecLevel:``,scale:1,sizeHint:0,rotate:0,invert:!1,withHRT:!1,withQuietZones:!0,addHRT:!1,addQuietZones:!0,options:``},te=`3.0.2`,ne=`b304f6656b865be11b00741d430b7d0027bc0ab4`,re={locateFile:(e,t)=>{let n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.0.2/dist/${n[1]}/${e}`:t+e}},v=new WeakMap;function ie(e,t){return Object.is(e,t)||Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>Object.hasOwn(t,n)&&e[n]===t[n])}function ae(e,{overrides:t,equalityFn:n=ie,fireImmediately:r=!1}={}){var i,a;let[o,s]=(i=v.get(e))==null?[re]:i,c=t==null?o:t,l;if(r){if(s&&(l=n(o,c)))return s;let t=e({...c});return v.set(e,[c,t]),t}((a=l)==null?n(o,c):a)||v.set(e,[c])}function oe(e){v.delete(e)}function y(e){let t=e.byteLength>>2,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=r<<2;n[r]=306*e[t]+601*e[t+1]+117*e[t+2]+512>>10}return n}async function se(e,t,n=h){let r={...h,...n},i=await ae(e,{fireImmediately:!0}),a,o;if(`width`in t&&`height`in t&&`data`in t){let{data:e,width:n,height:s}=t,c=y(e),l=c.byteLength;if(o=i._malloc(l),!o)throw Error(`Failed to allocate ${l} bytes in WASM memory`);try{i.HEAPU8.set(c,o),a=i.readBarcodesFromPixmap(o,n,s,g(r))}finally{i._free(o)}}else{let e,n;if(`buffer`in t)[e,n]=[t.byteLength,t];else if(`byteLength`in t)[e,n]=[t.byteLength,new Uint8Array(t)];else if(`size`in t)[e,n]=[t.size,new Uint8Array(await t.arrayBuffer())];else throw TypeError(`Invalid input type`);if(o=i._malloc(e),!o)throw Error(`Failed to allocate ${e} bytes in WASM memory`);try{i.HEAPU8.set(n,o),a=i.readBarcodesFromImage(o,e,g(r))}finally{i._free(o)}}let s=[];for(let e=0;e<a.size();++e)s.push(_(a.get(e)));return s}({...h}),[...h.formats],{...ee};async function ce(e={}){var t,n,r,i=e,a=!!globalThis.window,o=typeof Bun<`u`,s=!!globalThis.WorkerGlobalScope;!((n=globalThis.process)==null||(n=n.versions)==null)&&n.node&&((r=globalThis.process)==null||r.type);var c=`./this.program`,l,u=``;function d(e){return i.locateFile?i.locateFile(e,u):u+e}var f,p;if(a||s||o){try{u=new URL(`.`,l).href}catch{}s&&(p=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),f=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var m=console.log.bind(console),h=console.error.bind(console),g,_=!1,ee,te,ne=!1;function re(){var e=Xn.buffer;S=new Int8Array(e),b=new Int16Array(e),i.HEAPU8=T=new Uint8Array(e),C=new Uint16Array(e),x=new Int32Array(e),w=new Uint32Array(e),me=new Float32Array(e),he=new Float64Array(e)}function v(){if(i.preRun)for(typeof i.preRun==`function`&&(i.preRun=[i.preRun]);i.preRun.length;)be(i.preRun.shift());ge(ye)}function ie(){ne=!0,$.Aa()}function ae(){if(i.postRun)for(typeof i.postRun==`function`&&(i.postRun=[i.postRun]);i.postRun.length;)ve(i.postRun.shift());ge(_e)}function oe(e){var t,n;(t=i.onAbort)==null||t.call(i,e),e=`Aborted(`+e+`)`,h(e),_=!0,e+=`. Build with -sASSERTIONS for more info.`;var r=new WebAssembly.RuntimeError(e);throw(n=te)==null||n(r),r}var y;function se(){return d(`zxing_reader.wasm`)}function ce(e){if(e==y&&g)return new Uint8Array(g);if(p)return p(e);throw`both async and sync fetching of the wasm failed`}async function le(e){if(!g)try{var t=await f(e);return new Uint8Array(t)}catch{}return ce(e)}async function ue(e,t){try{var n=await le(e);return await WebAssembly.instantiate(n,t)}catch(e){h(`failed to asynchronously prepare wasm: ${e}`),oe(e)}}async function de(e,t,n){if(!e&&WebAssembly.instantiateStreaming)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){h(`wasm streaming compile failed: ${e}`),h(`falling back to ArrayBuffer instantiation`)}return ue(t,n)}function fe(){return{a:$n}}async function pe(){function e(e,t){return $=e.exports,Qn($),re(),$}function t(t){return e(t.instance)}var n=fe();return i.instantiateWasm?new Promise((t,r)=>{i.instantiateWasm(n,(n,r)=>{t(e(n,r))})}):(y!=null||(y=se()),t(await de(g,y,n)))}var b,x,S,me,he,C,w,T,ge=e=>{for(;e.length>0;)e.shift()(i)},_e=[],ve=e=>_e.push(e),ye=[],be=e=>ye.push(e),E=e=>Un(e),D=()=>Wn(),O=[],k=0,xe=e=>{var t=new Ce(e);return t.get_caught()||(t.set_caught(!0),k--),t.set_rethrown(!1),O.push(t),Vn(e)},A=0,Se=()=>{Q(0,0);var e=O.pop();Gn(e.excPtr),A=0};class Ce{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){w[this.ptr+4>>2]=e}get_type(){return w[this.ptr+4>>2]}set_destructor(e){w[this.ptr+8>>2]=e}get_destructor(){return w[this.ptr+8>>2]}set_caught(e){e=e?1:0,S[this.ptr+12]=e}get_caught(){return S[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,S[this.ptr+13]=e}get_rethrown(){return S[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){w[this.ptr+16>>2]=e}get_adjusted_ptr(){return w[this.ptr+16>>2]}}var j=e=>Hn(e),we=e=>{var t=A;if(!t)return j(0),0;var n=new Ce(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return j(0),t;for(var i of e){if(i===0||i===r)break;var a=n.ptr+16;if(qn(i,r,a))return j(i),t}return j(r),t},Te=()=>we([]),Ee=e=>we([e]),De=(e,t)=>we([e,t]),Oe=()=>{var e=O.pop();e||oe(`no exception to throw`);var t=e.excPtr;throw e.get_rethrown()||(O.push(e),e.set_rethrown(!0),e.set_caught(!1),k++),Kn(t),A=t,A},ke=(e,t,n)=>{throw new Ce(e).init(t,n),Kn(e),A=e,k++,A},Ae=()=>k,je=e=>{throw A||(A=e),A},Me=()=>oe(``),M={},N=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function P(e){return this.fromWireType(w[e>>2])}var F={},I={},L={},Ne=class extends Error{constructor(e){super(e),this.name=`InternalError`}},Pe=e=>{throw new Ne(e)},R=(e,t,n)=>{e.forEach(e=>L[e]=t);function r(t){var r=n(t);r.length!==e.length&&Pe(`Mismatched type converter count`);for(var i=0;i<e.length;++i)H(e[i],r[i])}var i=Array(t.length),a=[],o=0;{let e=t;for(let t=0;t<e.length;++t){let n=e[t];I.hasOwnProperty(n)?i[t]=I[n]:(a.push(n),F.hasOwnProperty(n)||(F[n]=[]),F[n].push(()=>{i[t]=I[n],++o,o===a.length&&r(i)}))}}a.length===0&&r(i)},Fe=e=>{var t=M[e];delete M[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.fields,a=i.map(e=>e.getterReturnType).concat(i.map(e=>e.setterArgumentType));R([e],a,e=>{var a={};{let t=i;for(let n=0;n<t.length;++n){let r=t[n],o=e[n],s=r.getter,c=r.getterContext,l=e[n+i.length],u=r.setter,d=r.setterContext;a[r.fieldName]={read:e=>o.fromWireType(s(c,e)),write:(e,t)=>{var n=[];u(d,e,l.toWireType(n,t)),N(n)},optional:o.optional}}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in a)t[n]=a[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var i in a)if(!(i in t)&&!a[i].optional)throw TypeError(`Missing field: "${i}"`);var o=n();for(i in a)a[i].write(o,t[i]);return e!==null&&e.push(r,o),o},readValueFromPointer:P,destructorFunction:r}]})},Ie=(e,t,n,r,i)=>{},z=e=>{for(var t=``;;){var n=T[e++];if(!n)return t;t+=String.fromCharCode(n)}},B=class extends Error{constructor(e){super(e),this.name=`BindingError`}},V=e=>{throw new B(e)};function Le(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.name;if(e||V(`type "${r}" must have a positive integer typeid pointer`),I.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;V(`Cannot register type '${r}' twice`)}if(I[e]=t,delete L[e],F.hasOwnProperty(e)){var i=F[e];delete F[e],i.forEach(e=>e())}}function H(e,t){return Le(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})}var Re=(e,t,n,r)=>{t=z(t),H(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(T[e])},destructorFunction:null})},ze=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Be=e=>{function t(e){return e.$$.ptrType.registeredClass.name}V(t(e)+` instance already deleted`)},Ve=!1,He=e=>{},Ue=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},We=e=>{--e.count.value,e.count.value===0&&Ue(e)},U=e=>globalThis.FinalizationRegistry?(Ve=new FinalizationRegistry(e=>{We(e.$$)}),U=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Ve.register(e,n,e)}return e},He=e=>Ve.unregister(e),U(e)):(U=e=>e,e),Ge=[],Ke=()=>{for(;Ge.length;){var e=Ge.pop();e.$$.deleteScheduled=!1,e.delete()}},qe,Je=()=>{let e=Ye.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof Ye)||!(e instanceof Ye))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var r=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return t===r&&n===i},clone(){if(this.$$.ptr||Be(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=U(Object.create(Object.getPrototypeOf(this),{$$:{value:ze(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Be(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&V(`Object already scheduled for deletion`),He(this),We(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Be(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&V(`Object already scheduled for deletion`),Ge.push(this),Ge.length===1&&qe&&qe(Ke),this.$$.deleteScheduled=!0,this}});let t=Symbol.dispose;t&&(e[t]=e.delete)};function Ye(){}var Xe=(e,t)=>Object.defineProperty(t,`name`,{value:e}),Ze={},Qe=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(){var r=[...arguments];return e[t].overloadTable.hasOwnProperty(r.length)||V(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},$e=(e,t,n)=>{i.hasOwnProperty(e)?((n===void 0||i[e].overloadTable!==void 0&&i[e].overloadTable[n]!==void 0)&&V(`Cannot register public name '${e}' twice`),Qe(i,e,e),i[e].overloadTable.hasOwnProperty(n)&&V(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[e].overloadTable[n]=t):(i[e]=t,i[e].argCount=n)},et=48,tt=57,nt=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return t>=et&&t<=tt?`_${e}`:e};function rt(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=a,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var it=(e,t,n)=>{for(;t!==n;)t.upcast||V(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},at=e=>{if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e};function ot(e,t){if(t===null)return this.isReference&&V(`null is not a valid ${this.name}`),0;t.$$||V(`Cannot pass "${at(t)}" as a ${this.name}`),t.$$.ptr||V(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}function st(e,t){var n;if(t===null)return this.isReference&&V(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;(!t||!t.$$)&&V(`Cannot pass "${at(t)}" as a ${this.name}`),t.$$.ptr||V(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&V(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=it(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&V(`Passing raw pointer to smart pointer is illegal`),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:V(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var i=t.clone();n=this.rawShare(n,J.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,n)}break;default:V(`Unsupported sharing policy`)}return n}function ct(e,t){if(t===null)return this.isReference&&V(`null is not a valid ${this.name}`),0;t.$$||V(`Cannot pass "${at(t)}" as a ${this.name}`),t.$$.ptr||V(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&V(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}var lt=(e,t,n)=>{if(t===n)return e;if(n.baseClass===void 0)return null;var r=lt(e,t,n.baseClass);return r===null?null:n.downcast(r)},ut={},dt=(e,t)=>{for(t===void 0&&V(`ptr should not be undefined`);e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},ft=(e,t)=>(t=dt(e,t),ut[t]),pt=(e,t)=>((!t.ptrType||!t.ptr)&&Pe(`makeClassHandle requires ptr and ptrType`),!!t.smartPtrType!=!!t.smartPtr&&Pe(`Both smartPtrType and smartPtr must be specified`),t.count={value:1},U(Object.create(e,{$$:{value:t,writable:!0}})));function mt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=ft(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function i(){return this.isSmartPointer?pt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):pt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=Ze[this.registeredClass.getActualType(t)];if(!a)return i.call(this);var o=this.isConst?a.constPointerType:a.pointerType,s=lt(t,this.registeredClass,o.registeredClass);return s===null?i.call(this):this.isSmartPointer?pt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):pt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}var ht=()=>{Object.assign(gt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)==null||t.call(this,e)},readValueFromPointer:P,fromWireType:mt})};function gt(e,t,n,r,i,a,o,s,c,l,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=u,!i&&t.baseClass===void 0?r?(this.toWireType=ot,this.destructorFunction=null):(this.toWireType=ct,this.destructorFunction=null):this.toWireType=st}var _t=(e,t,n)=>{i.hasOwnProperty(e)||Pe(`Replacing nonexistent public symbol`),i[e].overloadTable!==void 0&&n!==void 0?i[e].overloadTable[n]=t:(i[e]=t,i[e].argCount=n)},W={},vt=(e,t,n)=>{e=e.replace(/p/g,`i`);var r=W[e];return r(t,...n)},yt=[],G=e=>{var t=yt[e];return t||(yt[e]=t=Zn.get(e)),t},bt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(arguments.length>3&&arguments[3]!==void 0&&arguments[3],e.includes(`j`))return vt(e,t,n);var r=G(t)(...n);function i(e){return e}return i(r)},xt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){return bt(e,t,[...arguments],n)}},K=function(e,t){arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=z(e);function n(){return e.includes(`j`)?xt(e,t):G(t)}var r=n();return typeof r!=`function`&&V(`unknown function pointer with signature ${e}: ${t}`),r};class St extends Error{}var Ct=e=>{var t=zn(e),n=z(t);return Z(t),n},wt=(e,t)=>{var n=[],r={};function i(e){if(!r[e]&&!I[e]){if(L[e]){L[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new St(`${e}: `+n.map(Ct).join([`, `]))},Tt=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{u=z(u),a=K(i,a),s&&(s=K(o,s)),l&&(l=K(c,l)),f=K(d,f);var p=nt(u);$e(p,function(){wt(`Cannot construct ${u} due to unbound types`,[r])}),R([e,t,n],r?[r]:[],t=>{t=t[0];var n,i;r?(n=t.registeredClass,i=n.instancePrototype):i=Ye.prototype;var o=Xe(u,function(){if(Object.getPrototypeOf(this)!==c)throw new B(`Use 'new' to construct ${u}`);if(d.constructor_body===void 0)throw new B(`${u} has no accessible constructor`);var e=[...arguments],t=d.constructor_body[e.length];if(t===void 0)throw new B(`Tried to invoke ctor of ${u} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),c=Object.create(i,{constructor:{value:o}});o.prototype=c;var d=new rt(u,o,c,f,n,a,s,l);if(d.baseClass){var m;(m=d.baseClass).__derivedClasses!=null||(m.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d)}var h=new gt(u,d,!0,!1,!1),g=new gt(u+`*`,d,!1,!1,!1),_=new gt(u+` const*`,d,!1,!0,!1);return Ze[e]={pointerType:g,constPointerType:_},_t(p,o),[h,g,_]})},Et=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(w[t+r*4>>2]);return n};function Dt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Ot(e,t,n,r,i,a){var o=t.length;o<2&&V(`argTypes array size mismatch! Must at least get return value and 'this' types!`);var s=t[1]!==null&&n!==null,c=Dt(t),l=!t[0].isVoid,u=o-2,d=Array(u),f=[],p=[];return Xe(e,function(){p.length=0;var e;f.length=s?2:1,f[0]=i,s&&(e=t[1].toWireType(p,this),f[1]=e);for(var n=0;n<u;++n)d[n]=t[n+2].toWireType(p,n<0||arguments.length<=n?void 0:arguments[n]),f.push(d[n]);var a=r(...f);function o(n){if(c)N(p);else for(var r=s?1:2;r<t.length;r++){var i=r===1?e:d[r-2];t[r].destructorFunction!==null&&t[r].destructorFunction(i)}if(l)return t[0].fromWireType(n)}return o(a)})}var kt=(e,t,n,r,i,a)=>{var o=Et(t,n);i=K(r,i),R([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(e.registeredClass.constructor_body===void 0&&(e.registeredClass.constructor_body=[]),e.registeredClass.constructor_body[t-1]!==void 0)throw new B(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{wt(`Cannot construct ${e.name} due to unbound types`,o)},R([],o,r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ot(n,r,null,i,a),[])),[]})},At=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},jt=(e,t,n,r,i,a,o,s,c,l)=>{var u=Et(n,r);t=z(t),t=At(t),a=K(i,a,c),R([],[e],e=>{e=e[0];var r=`${e.name}.${t}`;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);function i(){wt(`Cannot call ${r} due to unbound types`,u)}var l=e.registeredClass.instancePrototype,d=l[t];return d===void 0||d.overloadTable===void 0&&d.className!==e.name&&d.argCount===n-2?(i.argCount=n-2,i.className=e.name,l[t]=i):(Qe(l,t,r),l[t].overloadTable[n-2]=i),R([],u,i=>{var s=Ot(r,i,e,a,o,c);return l[t].overloadTable===void 0?(s.argCount=n-2,l[t]=s):l[t].overloadTable[n-2]=s,[]}),[]})},Mt=[],q=[0,1,,1,null,1,!0,1,!1,1],Nt=e=>{e>9&&--q[e+1]===0&&(q[e]=void 0,Mt.push(e))},J={toValue:e=>(e||V(`Cannot use deleted val. handle = ${e}`),q[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Mt.pop()||q.length;return q[t]=e,q[t+1]=1,t}}}},Pt={name:`emscripten::val`,fromWireType:e=>{var t=J.toValue(e);return Nt(e),t},toWireType:(e,t)=>J.toHandle(t),readValueFromPointer:P,destructorFunction:null},Ft=e=>H(e,Pt),It=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(me[e>>2])};case 8:return function(e){return this.fromWireType(he[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},Lt=(e,t,n)=>{t=z(t),H(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:It(t,n),destructorFunction:null})},Rt=(e,t,n,r,i,a,o,s)=>{var c=Et(t,n);e=z(e),e=At(e),i=K(r,i,o),$e(e,function(){wt(`Cannot call ${e} due to unbound types`,c)},t-1),R([],c,n=>{var r=[n[0],null].concat(n.slice(1));return _t(e,Ot(e,r,null,i,a,o),t-1),[]})},zt=(e,t,n)=>{switch(t){case 1:return n?e=>S[e]:e=>T[e];case 2:return n?e=>b[e>>1]:e=>C[e>>1];case 4:return n?e=>x[e>>2]:e=>w[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},Bt=(e,t,n,r,i)=>{t=z(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}H(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:zt(t,n,r!==0),destructorFunction:null})},Vt=(e,t,n)=>{let r=(e,t)=>{let n=0;return{next(){if(n>=e)return{done:!0};let r=n;return n++,{value:t(r),done:!1}},[Symbol.iterator](){return this}}};e[Symbol.iterator]||(e[Symbol.iterator]=function(){return r(this[t](),e=>this[n](e))})},Ht=(e,t,n,r)=>{n=z(n),r=z(r),R([],[e,t],e=>{let t=e[0];return Vt(t.registeredClass.instancePrototype,n,r),[]})},Ut=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=w[e>>2],n=w[e+4>>2];return new r(S.buffer,n,t)}n=z(n),H(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Wt=Object.assign({optional:!0},Pt),Gt=(e,t)=>{H(e,Wt)},Kt=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},Y=(e,t,n)=>Kt(e,T,t,n),qt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},Jt=globalThis.TextDecoder&&new TextDecoder,Yt=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},Xt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=Yt(e,t,n,r);if(i-t>16&&e.buffer&&Jt)return Jt.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128)){a+=String.fromCharCode(o);continue}var s=e[t++]&63;if((o&224)==192){a+=String.fromCharCode((o&31)<<6|s);continue}var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return a},Zt=(e,t,n)=>e?Xt(T,e,t,n):``,Qt=(e,t)=>{t=z(t);var n=!0;H(e,{name:t,fromWireType(e){var t=w[e>>2],r=e+4,i;if(n)i=Zt(r,t,!0);else{i=``;for(var a=0;a<t;++a)i+=String.fromCharCode(T[r+a])}return Z(e),i},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||V(`Cannot pass non-string to std::string`),r=n&&i?qt(t):t.length;var a=Bn(4+r+1),o=a+4;if(w[a>>2]=r,i)if(n)Y(t,o,r+1);else for(var s=0;s<r;++s){var c=t.charCodeAt(s);c>255&&(Z(a),V(`String has UTF-16 code units that do not fit in 8 bits`)),T[o+s]=c}else T.set(t,o);return e!==null&&e.push(Z,a),a},readValueFromPointer:P,destructorFunction(e){Z(e)}})},$t=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,en=(e,t,n)=>{var r=e>>1,i=Yt(C,r,t/2,n);if(i-r>16&&$t)return $t.decode(C.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=C[o];a+=String.fromCharCode(s)}return a},tn=(e,t,n)=>{if(n!=null||(n=2147483647),n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);b[t>>1]=o,t+=2}return b[t>>1]=0,t-r},nn=e=>e.length*2,rn=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=w[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},an=(e,t,n)=>{if(n!=null||(n=2147483647),n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,x[t>>2]=o,t+=4,t+4>i)break}return x[t>>2]=0,t-r},on=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},sn=(e,t,n)=>{n=z(n);var r,i,a;t===2?(r=en,i=tn,a=nn):(r=rn,i=an,a=on),H(e,{name:n,fromWireType:e=>{var n=w[e>>2],i=r(e+4,n*t,!0);return Z(e),i},toWireType:(e,r)=>{typeof r!=`string`&&V(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Bn(4+o+t);return w[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(Z,s),s},readValueFromPointer:P,destructorFunction(e){Z(e)}})},cn=(e,t,n,r,i,a)=>{M[e]={name:z(t),rawConstructor:K(n,r),rawDestructor:K(i,a),fields:[]}},ln=(e,t,n,r,i,a,o,s,c,l)=>{M[e].fields.push({fieldName:z(t),getterReturnType:n,getter:K(r,i),getterContext:a,setterArgumentType:o,setter:K(s,c),setterContext:l})},un=(e,t)=>{t=z(t),H(e,{isVoid:!0,name:t,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},dn=[],fn=e=>{var t=dn.length;return dn.push(e),t},pn=(e,t)=>{var n=I[e];return n===void 0&&V(`${t} has unknown type ${Ct(e)}`),n},mn=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=pn(w[t+r*4>>2],`parameter ${r}`);return n},hn=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(w[t>>2]=J.toHandle(r)),i},gn={},_n=e=>{var t=gn[e];return t===void 0?z(e):t},vn=(e,t,n)=>{var r=8,[i,...a]=mn(e,t),o=i.toWireType.bind(i),s=a.map(e=>e.readValueFromPointer.bind(e));e--;var c=Array(e);return fn(Xe(`methodCaller<(${a.map(e=>e.name)}) => ${i.name}>`,(t,i,a,l)=>{for(var u=0,d=0;d<e;++d)c[d]=s[d](l+u),u+=r;var f;switch(n){case 0:f=J.toValue(t).apply(null,c);break;case 2:f=Reflect.construct(J.toValue(t),c);break;case 3:f=c[0];break;case 1:f=J.toValue(t)[_n(i)](...c);break}return hn(o,a,f)}))},yn=e=>e?(e=_n(e),J.toHandle(globalThis[e])):J.toHandle(globalThis),bn=e=>{e>9&&(q[e+1]+=1)},xn=(e,t,n,r,i)=>dn[e](t,n,r,i),Sn=e=>{N(J.toValue(e)),Nt(e)},Cn=(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);w[e>>2]=l*60,x[t>>2]=Number(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c<s?(Y(d,n,17),Y(f,r,17)):(Y(d,r,17),Y(f,n,17))},wn=()=>2147483648,Tn=(e,t)=>Math.ceil(e/t)*t,En=e=>{var t=(e-Xn.buffer.byteLength+65535)/65536|0;try{return Xn.grow(t),re(),1}catch{}},Dn=e=>{var t=T.length;e>>>=0;var n=wn();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),En(Math.min(n,Tn(Math.max(e,i),65536))))return!0}return!1},On={},kn=()=>c||`./this.program`,X=()=>{if(!X.strings){var e,t,n={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:((e=(t=globalThis.navigator)==null?void 0:t.language)==null?`C`:e).replace(`-`,`_`)+`.UTF-8`,_:kn()};for(var r in On)On[r]===void 0?delete n[r]:n[r]=On[r];var i=[];for(var r in n)i.push(`${r}=${n[r]}`);X.strings=i}return X.strings},An=(e,t)=>{var n=0,r=0;for(var i of X()){var a=t+n;w[e+r>>2]=a,n+=Y(i,a,1/0)+1,r+=4}return 0},jn=(e,t)=>{var n=X();w[e>>2]=n.length;var r=0;for(var i of n)r+=qt(i)+1;return w[t>>2]=r,0},Mn=e=>52,Nn=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function Pn(e,t,n,r,i){return Nn(t,n),70}var Fn=[null,[],[]],In=(e,t)=>{var n=Fn[e];t===0||t===10?((e===1?m:h)(Xt(n)),n.length=0):n.push(t)},Ln=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=w[t>>2],s=w[t+4>>2];t+=8;for(var c=0;c<s;c++)In(e,T[o+c]);i+=s}return w[r>>2]=i,0},Rn=e=>e;if(Je(),ht(),i.noExitRuntime&&i.noExitRuntime,i.print&&(m=i.print),i.printErr&&(h=i.printErr),i.wasmBinary&&(g=i.wasmBinary),i.arguments&&i.arguments,i.thisProgram&&(c=i.thisProgram),i.preInit)for(typeof i.preInit==`function`&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.shift()();var zn,Z,Bn,Vn,Q,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn;function Qn(e){zn=e.Ba,Z=i._free=e.Ca,Bn=i._malloc=e.Ea,Vn=e.Fa,Q=e.Ga,Hn=e.Ha,Un=e.Ia,Wn=e.Ja,Gn=e.Ka,Kn=e.La,qn=e.Ma,W.viijii=e.Na,Jn=W.iiijj=e.Oa,W.jiji=e.Pa,Yn=W.jiiii=e.Qa,W.iiiiij=e.Ra,W.iiiiijj=e.Sa,W.iiiiiijj=e.Ta,Xn=e.za,Zn=e.Da}var $n={s:xe,x:Se,a:Te,i:Ee,m:De,Q:Oe,q:ke,fa:Ae,d:je,ba:Me,wa:Fe,aa:Ie,qa:Re,ua:Tt,ta:kt,F:jt,oa:Ft,X:Lt,Y:Rt,A:Bt,sa:Ht,t:Ut,va:Gt,pa:Qt,S:sn,G:cn,xa:ln,ra:un,N:vn,ya:Nt,C:yn,T:bn,M:xn,ka:Sn,ca:Cn,ga:Dn,da:An,ea:jn,ha:Mn,_:Pn,V:Ln,ma:xr,K:wr,B:Dr,O:sr,U:Mr,p:yr,b:nr,D:Cr,ja:kr,c:ir,ia:Ar,h:or,j:pr,r:hr,P:Sr,w:_r,E:vr,L:br,I:Nr,$:Fr,Z:Ir,f:cr,l:er,e:rr,W:Tr,g:ar,J:jr,k:tr,la:Er,o:gr,y:ur,u:mr,R:fr,v:Or,n:lr,H:Pr,na:dr,z:Rn};function er(e,t){var n=D();try{G(e)(t)}catch(e){if(E(n),e!==e+0)throw e;Q(1,0)}}function tr(e,t,n,r,i){var a=D();try{G(e)(t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function nr(e,t){var n=D();try{return G(e)(t)}catch(e){if(E(n),e!==e+0)throw e;Q(1,0)}}function rr(e,t,n){var r=D();try{G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function ir(e,t,n){var r=D();try{return G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function ar(e,t,n,r){var i=D();try{G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function or(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function sr(e,t,n,r,i,a){var o=D();try{return G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function cr(e){var t=D();try{G(e)()}catch(e){if(E(t),e!==e+0)throw e;Q(1,0)}}function lr(e,t,n,r,i,a,o,s,c,l,u){var d=D();try{G(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(E(d),e!==e+0)throw e;Q(1,0)}}function ur(e,t,n,r,i,a,o){var s=D();try{G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function dr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=D();try{G(e)(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}catch(e){if(E(_),e!==e+0)throw e;Q(1,0)}}function fr(e,t,n,r,i,a,o,s,c){var l=D();try{G(e)(t,n,r,i,a,o,s,c)}catch(e){if(E(l),e!==e+0)throw e;Q(1,0)}}function pr(e,t,n,r,i){var a=D();try{return G(e)(t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function mr(e,t,n,r,i,a,o,s){var c=D();try{G(e)(t,n,r,i,a,o,s)}catch(e){if(E(c),e!==e+0)throw e;Q(1,0)}}function hr(e,t,n,r,i,a){var o=D();try{return G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function gr(e,t,n,r,i,a){var o=D();try{G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function _r(e,t,n,r,i,a,o){var s=D();try{return G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function vr(e,t,n,r,i,a,o,s){var c=D();try{return G(e)(t,n,r,i,a,o,s)}catch(e){if(E(c),e!==e+0)throw e;Q(1,0)}}function yr(e){var t=D();try{return G(e)()}catch(e){if(E(t),e!==e+0)throw e;Q(1,0)}}function br(e,t,n,r,i,a,o,s,c){var l=D();try{return G(e)(t,n,r,i,a,o,s,c)}catch(e){if(E(l),e!==e+0)throw e;Q(1,0)}}function xr(e,t,n){var r=D();try{return G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function Sr(e,t,n,r,i,a,o){var s=D();try{return G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function Cr(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function wr(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function Tr(e,t,n,r,i,a,o,s,c){var l=D();try{G(e)(t,n,r,i,a,o,s,c)}catch(e){if(E(l),e!==e+0)throw e;Q(1,0)}}function Er(e,t,n,r,i,a,o,s){var c=D();try{G(e)(t,n,r,i,a,o,s)}catch(e){if(E(c),e!==e+0)throw e;Q(1,0)}}function Dr(e,t,n,r,i,a){var o=D();try{return G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function Or(e,t,n,r,i,a,o,s,c,l){var u=D();try{G(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(E(u),e!==e+0)throw e;Q(1,0)}}function kr(e,t,n){var r=D();try{return G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function Ar(e,t,n,r,i){var a=D();try{return G(e)(t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function jr(e,t,n,r,i,a,o){var s=D();try{G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function Mr(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function Nr(e,t,n,r,i,a,o,s,c,l,u,d){var f=D();try{return G(e)(t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(E(f),e!==e+0)throw e;Q(1,0)}}function Pr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=D();try{G(e)(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}catch(e){if(E(g),e!==e+0)throw e;Q(1,0)}}function Fr(e,t,n,r,i,a,o){var s=D();try{return Jn(e,t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function Ir(e,t,n,r,i){var a=D();try{return Yn(e,t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function Lr(){v();function e(){var e,t;i.calledRun=!0,!_&&(ie(),(e=ee)==null||e(i),(t=i.onRuntimeInitialized)==null||t.call(i),ae())}i.setStatus?(i.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>i.setStatus(``),1),e()},1)):e()}var $=await pe();return Lr(),t=ne?i:new Promise((e,t)=>{ee=e,te=t}),t}function le(e){return ae(ce,e)}function ue(){return oe(ce)}function de(e){le({overrides:e,equalityFn:Object.is,fireImmediately:!1})}async function fe(e,t){return se(ce,e,t)}var pe=`98106d24a9bc2c4a24a6e6864e0f5729bd68cf73d6f5b45bb1c824521146370c`,b=[[`aztec`,`Aztec`],[`aztec_code`,`AztecCode`],[`aztec_rune`,`AztecRune`],[`code_128`,`Code128`],[`code_39`,`Code39`],[`code_39_standard`,`Code39Std`],[`code_39_extended`,`Code39Ext`],[`code_32`,`Code32`],[`pzn`,`PZN`],[`code_93`,`Code93`],[`codabar`,`Codabar`],[`databar`,`DataBar`],[`databar_omni`,`DataBarOmni`],[`databar_stacked`,`DataBarStk`],[`databar_stacked_omni`,`DataBarStkOmni`],[`databar_expanded`,`DataBarExp`],[`databar_expanded_stacked`,`DataBarExpStk`],[`databar_limited`,`DataBarLtd`],[`data_matrix`,`DataMatrix`],[`dx_film_edge`,`DXFilmEdge`],[`ean_13`,`EAN13`],[`ean_upc`,`EANUPC`],[`isbn`,`ISBN`],[`ean_8`,`EAN8`],[`itf`,`ITF`],[`itf_14`,`ITF14`],[`maxi_code`,`MaxiCode`],[`micro_qr_code`,`MicroQRCode`],[`pdf417`,`PDF417`],[`compact_pdf417`,`CompactPDF417`],[`qr_code`,`QRCode`],[`qr_code_model_1`,`QRCodeModel1`],[`qr_code_model_2`,`QRCodeModel2`],[`rm_qr_code`,`RMQRCode`],[`upc_a`,`UPCA`],[`upc_e`,`UPCE`],[`other_barcode`,`OtherBarcode`],[`linear_codes`,`AllLinear`],[`matrix_codes`,`AllMatrix`],[`gs1_codes`,`AllGS1`],[`retail_codes`,`AllRetail`],[`industrial_codes`,`AllIndustrial`],[`any`,`All`]],x=[...b,[`unknown`]].map(e=>e[0]),S=new Map(b);function me(e){for(let[t,n]of S)if(e===n)return t;return`unknown`}function he(e){if(C(e))return{width:e.naturalWidth,height:e.naturalHeight};if(w(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(T(e))return{width:e.videoWidth,height:e.videoHeight};if(_e(e))return{width:e.width,height:e.height};if(ye(e))return{width:e.displayWidth,height:e.displayHeight};if(ge(e)||ve(e))return{width:e.width,height:e.height};throw 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 C(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLImageElement)}catch{return!1}}function w(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.SVGImageElement)}catch{return!1}}function T(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLVideoElement)}catch{return!1}}function ge(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLCanvasElement)}catch{return!1}}function _e(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)===`[object ImageBitmap]`}catch{return!1}}function ve(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)===`[object OffscreenCanvas]`}catch{return!1}}function ye(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)===`[object VideoFrame]`}catch{return!1}}function be(e){try{return e instanceof Blob||Object.prototype.toString.call(e)===`[object Blob]`}catch{return!1}}function E(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)===`[object ImageData]`}catch{return!1}}function D(e,t){try{let n=new OffscreenCanvas(e,t);if(n.getContext(`2d`)instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}}async function O(e){if(C(e)&&!await Se(e))throw new DOMException(`Failed to load or decode HTMLImageElement.`,`InvalidStateError`);if(w(e)&&!await Ce(e))throw new DOMException(`Failed to load or decode SVGImageElement.`,`InvalidStateError`);if(ye(e)&&j(e))throw new DOMException(`VideoFrame is closed.`,`InvalidStateError`);if(T(e)&&(e.readyState===0||e.readyState===1))throw new DOMException(`Invalid element or state.`,`InvalidStateError`);if(_e(e)&&Te(e))throw new DOMException(`The image source is detached.`,`InvalidStateError`);let{width:t,height:n}=he(e);if(t===0||n===0)return null;let r=D(t,n).getContext(`2d`);r.drawImage(e,0,0);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function k(e){let t;try{t=await createImageBitmap(e)}catch{try{if(globalThis.Image){t=new Image;let n=``;try{n=URL.createObjectURL(e),t.src=n,await t.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException(`Failed to load or decode Blob.`,`InvalidStateError`)}}return await O(t)}function xe(e){let{width:t,height:n}=e;if(t===0||n===0)return null;let r=e.getContext(`2d`);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function A(e){if(be(e))return await k(e);if(E(e)){if(we(e))throw new DOMException(`The image data has been detached.`,`InvalidStateError`);return e}return ge(e)||ve(e)?xe(e):await O(e)}async function Se(e){try{return await e.decode(),!0}catch{return!1}}async function Ce(e){try{var t;return await((t=e.decode)==null?void 0:t.call(e)),!0}catch{return!1}}function j(e){return e.format===null}function we(e){return e.data.buffer.byteLength===0}function Te(e){return e.width===0&&e.height===0}function Ee(e,t){return De(e)?new DOMException(`${t}: ${e.message}`,e.name):Oe(e)?new e.constructor(`${t}: ${e.message}`):Error(`${t}: ${e}`)}function De(e){return e instanceof DOMException||Object.prototype.toString.call(e)===`[object DOMException]`}function Oe(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function ke(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function Ae(e,t,n){ke(e,t),t.set(e,n)}function je(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function Me(e,t,n){return e.set(je(e,t),n),n}function M(e,t){return e.get(je(e,t))}var N=new WeakMap,P=class{constructor(e={}){Ae(this,N,void 0);try{var t;let n=e==null||(t=e.formats)==null?void 0:t.filter(e=>e!==`unknown`);if((n==null?void 0:n.length)===0)throw TypeError(`Hint option provided, but is empty.`);for(let e of n==null?[]:n)if(!S.has(e))throw TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${e}' is not a valid enum value of type BarcodeFormat.`);Me(N,this,n==null?[]:n),le({fireImmediately:!0}).catch(()=>{})}catch(e){throw Ee(e,`Failed to construct 'BarcodeDetector'`)}}static async getSupportedFormats(){return x.filter(e=>e!==`unknown`)}async detect(e){try{let t=await A(e);if(t===null)return[];let n,r={textMode:`Plain`,formats:M(N,this).map(e=>S.get(e))};try{n=await fe(t,r)}catch(e){throw console.error(e),new DOMException(`Barcode detection service unavailable.`,`NotSupportedError`)}return n.map(e=>{let{topLeft:{x:t,y:n},topRight:{x:r,y:i},bottomLeft:{x:a,y:o},bottomRight:{x:s,y:c}}=e.position,l=Math.min(t,r,a,s),u=Math.min(n,i,o,c),d=Math.max(t,r,a,s),f=Math.max(n,i,o,c);return{boundingBox:new DOMRectReadOnly(l,u,d-l,f-u),rawValue:e.text,format:me(e.format),cornerPoints:[{x:t,y:n},{x:r,y:i},{x:s,y:c},{x:a,y:o}]}})}catch(e){throw Ee(e,`Failed to execute 'detect' on 'BarcodeDetector'`)}}},F;return(F=globalThis).BarcodeDetector!=null||(F.BarcodeDetector=P),e.BarcodeDetector=P,e.ZXING_CPP_COMMIT=ne,e.ZXING_WASM_SHA256=pe,e.ZXING_WASM_VERSION=te,e.prepareZXingModule=le,e.purgeZXingModule=ue,e.setZXingModuleOverrides=de,e})({});
|
package/dist/iife/polyfill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BarcodeDetectionAPI=(function(P){"use strict";var er=P=>{throw TypeError(P)};var rr=(P,O,L)=>O.has(P)||er("Cannot "+L);var nr=(P,O,L)=>(rr(P,O,"read from private field"),L?L.call(P):O.get(P)),ar=(P,O,L)=>O.has(P)?er("Cannot add the same private member more than once"):O instanceof WeakSet?O.add(P):O.set(P,L),or=(P,O,L,Mt)=>(rr(P,O,"write to private field"),Mt?Mt.call(P,L):O.set(P,L),L);var it,fe;const O=[["All","*","*"," ",0,"All"],["AllReadable","*","r"," ",0,"All Readable"],["AllCreatable","*","w"," ",0,"All Creatable"],["AllLinear","*","l"," ",0,"All Linear"],["AllMatrix","*","m"," ",0,"All Matrix"],["AllGS1","*","G"," ",0,"All GS1"],["AllRetail","*","R"," ",0,"All Retail"],["AllIndustrial","*","I"," ",0,"All Industrial"],["Codabar","F"," ","lrw ",18,"Codabar"],["Code39","A"," ","lrw I",8,"Code 39"],["Code39Std","A","s","lrw I",8,"Code 39 Standard"],["Code39Ext","A","e","lr I",9,"Code 39 Extended"],["Code32","A","2","lr I",129,"Code 32"],["PZN","A","p","lr I",52,"Pharmazentralnummer"],["Code93","G"," ","lrw I",25,"Code 93"],["Code128","C"," ","lrwGI",20,"Code 128"],["ITF","I"," ","lrw I",3,"ITF"],["ITF14","I","4","lr I",89,"ITF-14"],["DataBar","e"," ","lr GR",29,"DataBar"],["DataBarOmni","e","o","lr GR",29,"DataBar Omni"],["DataBarStk","e","s","lr GR",79,"DataBar Stacked"],["DataBarStkOmni","e","O","lr GR",80,"DataBar Stacked Omni"],["DataBarLtd","e","l","lr GR",30,"DataBar Limited"],["DataBarExp","e","e","lr GR",31,"DataBar Expanded"],["DataBarExpStk","e","E","lr GR",81,"DataBar Expanded Stacked"],["EANUPC","E"," ","lr R",15,"EAN/UPC"],["EAN13","E","1","lrw R",15,"EAN-13"],["EAN8","E","8","lrw R",10,"EAN-8"],["EAN5","E","5","l R",12,"EAN-5"],["EAN2","E","2","l R",11,"EAN-2"],["ISBN","E","i","lr R",69,"ISBN"],["UPCA","E","a","lrw R",34,"UPC-A"],["UPCE","E","e","lrw R",37,"UPC-E"],["OtherBarcode","X"," "," r ",0,"Other barcode"],["DXFilmEdge","X","x","lr ",147,"DX Film Edge"],["PDF417","L"," ","mrw ",55,"PDF417"],["CompactPDF417","L","c","mr ",56,"Compact PDF417"],["MicroPDF417","L","m","m ",84,"MicroPDF417"],["Aztec","z"," ","mr G ",92,"Aztec"],["AztecCode","z","c","mrwG ",92,"Aztec Code"],["AztecRune","z","r","mr ",128,"Aztec Rune"],["QRCode","Q"," ","mrwG ",58,"QR Code"],["QRCodeModel1","Q","1","mr ",0,"QR Code Model 1"],["QRCodeModel2","Q","2","mr ",58,"QR Code Model 2"],["MicroQRCode","Q","m","mr ",97,"Micro QR Code"],["RMQRCode","Q","r","mr G ",145,"rMQR Code"],["DataMatrix","d"," ","mrwG ",71,"Data Matrix"],["MaxiCode","U"," ","mr ",57,"MaxiCode"]],L={DataBarExpanded:"DataBarExp",DataBarLimited:"DataBarLtd","Linear-Codes":"AllLinear","Matrix-Codes":"AllMatrix",Any:"All",rMQRCode:"RMQRCode"};O.map(a=>a[5]),O.filter(a=>a[1]==="*").map(a=>a[0]),O.filter(a=>a[1]!=="*").map(a=>a[0]),O.filter(a=>a[2]===" ").map(a=>a[0]),O.filter(a=>a[3][0]==="l").map(a=>a[0]),O.filter(a=>a[3][0]==="m").map(a=>a[0]),O.filter(a=>a[3][1]==="r").map(a=>a[0]),O.filter(a=>a[3][2]==="w"||a[4]!==0).map(a=>a[0]),O.filter(a=>a[3][3]==="G").map(a=>a[0]),O.filter(a=>a[3][4]==="R").map(a=>a[0]),O.filter(a=>a[3][4]==="I").map(a=>a[0]);function ir(a){var f;return(f=L[a])!=null?f:a}function sr(a){return a.map(ir).join(",")}const ur=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function cr(a){return ur.indexOf(a)}const Kt=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function lr(a){return a==="UnicodeBig"?Kt.indexOf("UTF16BE"):Kt.indexOf(a)}const dr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function fr(a){return dr[a]}const hr=["Ignore","Read","Require"];function pr(a){return hr.indexOf(a)}const mr=["Plain","ECI","HRI","Escaped","Hex","HexECI"];function yr(a){return mr.indexOf(a)}const mt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown",tryCode39ExtendedMode:!0};function te(a){var f;return{...a,formats:sr(a.formats),binarizer:cr(a.binarizer),eanAddOnSymbol:pr(a.eanAddOnSymbol),textMode:yr(a.textMode),characterSet:lr(a.characterSet),tryCode39ExtendedMode:(f=a.tryCode39ExtendedMode)!=null?f:!0}}function vr(a){return{...a,format:a.format,symbology:a.symbology,contentType:fr(a.contentType)}}const gr="3.0.0",wr="9a9ccb838fcbf067cc9a9f0fd26d06fe6cc02467",br={locateFile:(a,f)=>{const p=a.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.0.0/dist/${p[1]}/${a}`:f+a}},yt=new WeakMap;function Cr(a,f){return Object.is(a,f)||Object.keys(a).length===Object.keys(f).length&&Object.keys(a).every(p=>Object.hasOwn(f,p)&&a[p]===f[p])}function ee(a,{overrides:f,equalityFn:p=Cr,fireImmediately:T=!1}={}){var l;const[x,R]=(l=yt.get(a))!=null?l:[br],M=f!=null?f:x;let S;if(T){if(R&&(S=p(x,M)))return R;const F=a({...M});return yt.set(a,[M,F]),F}(S!=null?S:p(x,M))||yt.set(a,[M])}function $r(a){yt.delete(a)}async function Tr(a,f,p=mt){const T={...mt,...p},l=await ee(a,{fireImmediately:!0});let x,R;if("width"in f&&"height"in f&&"data"in f){const{data:S,data:{byteLength:F},width:G,height:Z}=f;R=l._malloc(F),l.HEAPU8.set(S,R),x=l.readBarcodesFromPixmap(R,G,Z,te(T))}else{let S,F;if("buffer"in f)[S,F]=[f.byteLength,f];else if("byteLength"in f)[S,F]=[f.byteLength,new Uint8Array(f)];else if("size"in f)[S,F]=[f.size,new Uint8Array(await f.arrayBuffer())];else throw new TypeError("Invalid input type");R=l._malloc(S),l.HEAPU8.set(F,R),x=l.readBarcodesFromImage(R,S,te(T))}l._free(R);const M=[];for(let S=0;S<x.size();++S)M.push(vr(x.get(S)));return M}({...mt,formats:[...mt.formats]});async function Ft(a={}){var f,p,T,l=a,x=!!globalThis.window,R=typeof Bun<"u",M=!!globalThis.WorkerGlobalScope;!((p=globalThis.process)===null||p===void 0||(p=p.versions)===null||p===void 0)&&p.node&&((T=globalThis.process)===null||T===void 0?void 0:T.type)!="renderer";var S="./this.program",F,G="";function Z(t){return l.locateFile?l.locateFile(t,G):G+t}var nt,Y;if(x||M||R){try{G=new URL(".",F).href}catch{}M&&(Y=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),nt=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var st=console.log.bind(console),H=console.error.bind(console),J,vt=!1,he,pe,K,z,gt,ut,ct,A,me,ye,ve=!1;function ge(){var t=It.buffer;K=new Int8Array(t),gt=new Int16Array(t),l.HEAPU8=z=new Uint8Array(t),ut=new Uint16Array(t),ct=new Int32Array(t),A=new Uint32Array(t),me=new Float32Array(t),ye=new Float64Array(t)}function zr(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)rn(l.preRun.shift());we(Ce)}function Nr(){ve=!0,pt.xa()}function Qr(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)en(l.postRun.shift());we(be)}function Lt(t){var e,r;(e=l.onAbort)===null||e===void 0||e.call(l,t),t="Aborted("+t+")",H(t),vt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw(r=pe)===null||r===void 0||r(n),n}var wt;function Xr(){return Z("zxing_reader.wasm")}function qr(t){if(t==wt&&J)return new Uint8Array(J);if(Y)return Y(t);throw"both async and sync fetching of the wasm failed"}async function Zr(t){if(!J)try{var e=await nt(t);return new Uint8Array(e)}catch{}return qr(t)}async function Yr(t,e){try{var r=await Zr(t),n=await WebAssembly.instantiate(r,e);return n}catch(o){H(`failed to asynchronously prepare wasm: ${o}`),Lt(o)}}async function Jr(t,e,r){if(!t&&WebAssembly.instantiateStreaming)try{var n=fetch(e,{credentials:"same-origin"}),o=await WebAssembly.instantiateStreaming(n,r);return o}catch(i){H(`wasm streaming compile failed: ${i}`),H("falling back to ArrayBuffer instantiation")}return Yr(e,r)}function Kr(){var t={a:Fa};return t}async function tn(){function t(i,s){return pt=i.exports,Ma(pt),ge(),pt}function e(i){return t(i.instance)}var r=Kr();if(l.instantiateWasm)return new Promise((i,s)=>{l.instantiateWasm(r,(u,c)=>{i(t(u))})});wt!=null||(wt=Xr());var n=await Jr(J,wt,r),o=e(n);return o}var we=t=>{for(;t.length>0;)t.shift()(l)},be=[],en=t=>be.push(t),Ce=[],rn=t=>Ce.push(t),v=t=>Ge(t),g=()=>He(),bt=[],Ct=0,nn=t=>{var e=new Ut(t);return e.get_caught()||(e.set_caught(!0),Ct--),e.set_rethrown(!1),bt.push(e),Ne(t),We(t)},N=0,an=()=>{y(0,0);var t=bt.pop();ze(t.excPtr),N=0};class Ut{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){A[this.ptr+4>>2]=e}get_type(){return A[this.ptr+4>>2]}set_destructor(e){A[this.ptr+8>>2]=e}get_destructor(){return A[this.ptr+8>>2]}set_caught(e){e=e?1:0,K[this.ptr+12]=e}get_caught(){return K[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,K[this.ptr+13]=e}get_rethrown(){return K[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){A[this.ptr+16>>2]=e}get_adjusted_ptr(){return A[this.ptr+16>>2]}}var $t=t=>Ve(t),kt=t=>{var e=N;if(!e)return $t(0),0;var r=new Ut(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return $t(0),e;for(var o of t){if(o===0||o===n)break;var i=r.ptr+16;if(Qe(o,n,i))return $t(o),e}return $t(n),e},on=()=>kt([]),sn=t=>kt([t]),un=(t,e)=>kt([t,e]),cn=()=>{var t=bt.pop();t||Lt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(bt.push(t),t.set_rethrown(!0),t.set_caught(!1),Ct++),N=e,N},ln=(t,e,r)=>{var n=new Ut(t);throw n.init(e,r),N=t,Ct++,N},dn=()=>Ct,fn=t=>{throw N||(N=t),N},hn=()=>Lt(""),Tt={},Wt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function lt(t){return this.fromWireType(A[t>>2])}var at={},tt={},Et={},pn=class extends Error{constructor(t){super(t),this.name="InternalError"}},_t=t=>{throw new pn(t)},et=(t,e,r)=>{t.forEach(u=>Et[u]=e);function n(u){var c=r(u);c.length!==t.length&&_t("Mismatched type converter count");for(var d=0;d<t.length;++d)W(t[d],c[d])}var o=new Array(e.length),i=[],s=0;{const u=e;for(let c=0;c<u.length;++c){const d=u[c];tt.hasOwnProperty(d)?o[c]=tt[d]:(i.push(d),at.hasOwnProperty(d)||(at[d]=[]),at[d].push(()=>{o[c]=tt[d],++s,s===i.length&&n(o)}))}}i.length===0&&n(o)},mn=t=>{var e=Tt[t];delete Tt[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields,i=o.map(s=>s.getterReturnType).concat(o.map(s=>s.setterArgumentType));et([t],i,s=>{var u={};{const c=o;for(let d=0;d<c.length;++d){const h=c[d],m=s[d],C=h.getter,E=h.getterContext,I=s[d+o.length],D=h.setter,_=h.setterContext;u[h.fieldName]={read:$=>m.fromWireType(C(E,$)),write:($,k)=>{var j=[];D(_,$,I.toWireType(j,k)),Wt(j)},optional:m.optional}}}return[{name:e.name,fromWireType:c=>{var d={};for(var h in u)d[h]=u[h].read(c);return n(c),d},toWireType:(c,d)=>{for(var h in u)if(!(h in d)&&!u[h].optional)throw new TypeError(`Missing field: "${h}"`);var m=r();for(h in u)u[h].write(m,d[h]);return c!==null&&c.push(n,m),m},readValueFromPointer:lt,destructorFunction:n}]})},yn=(t,e,r,n,o)=>{},B=t=>{for(var e="";;){var r=z[t++];if(!r)return e;e+=String.fromCharCode(r)}},dt=class extends Error{constructor(t){super(t),this.name="BindingError"}},b=t=>{throw new dt(t)};function vn(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(t||b(`type "${n}" must have a positive integer typeid pointer`),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(tt[t]=e,delete Et[t],at.hasOwnProperty(t)){var o=at[t];delete at[t],o.forEach(i=>i())}}function W(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return vn(t,e,r)}var gn=(t,e,r,n)=>{e=B(e),W(t,{name:e,fromWireType:function(o){return!!o},toWireType:function(o,i){return i?r:n},readValueFromPointer:function(o){return this.fromWireType(z[o])},destructorFunction:null})},wn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Vt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Gt=!1,$e=t=>{},bn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Te=t=>{t.count.value-=1;var e=t.count.value===0;e&&bn(t)},ft=t=>globalThis.FinalizationRegistry?(Gt=new FinalizationRegistry(e=>{Te(e.$$)}),ft=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var o={$$:r};Gt.register(e,o,e)}return e},$e=e=>Gt.unregister(e),ft(t)):(ft=e=>e,t),Cn=()=>{let t=At.prototype;Object.assign(t,{isAliasOf(r){if(!(this instanceof At)||!(r instanceof At))return!1;var n=this.$$.ptrType.registeredClass,o=this.$$.ptr;r.$$=r.$$;for(var i=r.$$.ptrType.registeredClass,s=r.$$.ptr;n.baseClass;)o=n.upcast(o),n=n.baseClass;for(;i.baseClass;)s=i.upcast(s),i=i.baseClass;return n===i&&o===s},clone(){if(this.$$.ptr||Vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var r=ft(Object.create(Object.getPrototypeOf(this),{$$:{value:wn(this.$$)}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||Vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),$e(this),Te(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}});const e=Symbol.dispose;e&&(t[e]=t.delete)};function At(){}var Ht=(t,e)=>Object.defineProperty(e,"name",{value:t}),Ee={},_e=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return t[e].overloadTable.hasOwnProperty(i.length)||b(`Function '${r}' called with an invalid number of arguments (${i.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[i.length].apply(this,i)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},Ae=(t,e,r)=>{l.hasOwnProperty(t)?((r===void 0||l[t].overloadTable!==void 0&&l[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),_e(l,t,t),l[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),l[t].overloadTable[r]=e):(l[t]=e,l[t].argCount=r)},$n=48,Tn=57,En=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=$n&&e<=Tn?`_${t}`:t};function _n(t,e,r,n,o,i,s,u){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}var zt=(t,e,r)=>{for(;e!==r;)e.upcast||b(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t},Nt=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t};function An(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=zt(e.$$.ptr,r,this.registeredClass);return n}function Pn(t,e){var r;if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,r),r):0;(!e||!e.$$)&&b(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&b(`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=zt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(e.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:b(`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,V.toHandle(()=>o.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function On(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${Nt(e)}" as a ${this.name}`),e.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&b(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass,n=zt(e.$$.ptr,r,this.registeredClass);return n}var Pe=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Pe(t,e,r.baseClass);return n===null?null:r.downcast(n)},Dn={},In=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Sn=(t,e)=>(e=In(t,e),Dn[e]),Pt=(t,e)=>{(!e.ptrType||!e.ptr)&&_t("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&_t("Both smartPtrType and smartPtr must be specified"),e.count={value:1},ft(Object.create(t,{$$:{value:e,writable:!0}}))};function xn(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Sn(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 o(){return this.isSmartPointer?Pt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Pt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),s=Ee[i];if(!s)return o.call(this);var u;this.isConst?u=s.constPointerType:u=s.pointerType;var c=Pe(e,this.registeredClass,u.registeredClass);return c===null?o.call(this):this.isSmartPointer?Pt(u.registeredClass.instancePrototype,{ptrType:u,ptr:c,smartPtrType:this,smartPtr:t}):Pt(u.registeredClass.instancePrototype,{ptrType:u,ptr:c})}var Rn=()=>{Object.assign(Ot.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var e;(e=this.rawDestructor)===null||e===void 0||e.call(this,t)},readValueFromPointer:lt,fromWireType:xn})};function Ot(t,e,r,n,o,i,s,u,c,d,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=h,!o&&e.baseClass===void 0?n?(this.toWireType=An,this.destructorFunction=null):(this.toWireType=On,this.destructorFunction=null):this.toWireType=Pn}var Oe=(t,e,r)=>{l.hasOwnProperty(t)||_t("Replacing nonexistent public symbol"),l[t].overloadTable!==void 0&&r!==void 0?l[t].overloadTable[r]=e:(l[t]=e,l[t].argCount=r)},X={},Mn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=X[t];return n(e,...r)},De=[],w=t=>{var e=De[t];return e||(De[t]=e=Ze.get(t)),e},Fn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Mn(t,e,r);var n=w(e),o=n(...r);return o},Bn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Fn(t,e,o,r)}},U=function(t,e){t=B(t);function r(){if(t.includes("j"))return Bn(t,e);var o=w(e);return o}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n};class jn extends Error{}var Ie=t=>{var e=ke(t),r=B(e);return q(e),r},Dt=(t,e)=>{var r=[],n={};function o(i){if(!n[i]&&!tt[i]){if(Et[i]){Et[i].forEach(o);return}r.push(i),n[i]=!0}}throw e.forEach(o),new jn(`${t}: `+r.map(Ie).join([", "]))},Ln=(t,e,r,n,o,i,s,u,c,d,h,m,C)=>{h=B(h),i=U(o,i),u&&(u=U(s,u)),d&&(d=U(c,d)),C=U(m,C);var E=En(h);Ae(E,function(){Dt(`Cannot construct ${h} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],I=>{I=I[0];var D,_;n?(D=I.registeredClass,_=D.instancePrototype):_=At.prototype;var $=Ht(h,function(){if(Object.getPrototypeOf(this)!==k)throw new dt(`Use 'new' to construct ${h}`);if(j.constructor_body===void 0)throw new dt(`${h} has no accessible constructor`);for(var Ke=arguments.length,xt=new Array(Ke),Rt=0;Rt<Ke;Rt++)xt[Rt]=arguments[Rt];var tr=j.constructor_body[xt.length];if(tr===void 0)throw new dt(`Tried to invoke ctor of ${h} with invalid number of parameters (${xt.length}) - expected (${Object.keys(j.constructor_body).toString()}) parameters instead!`);return tr.apply(this,xt)}),k=Object.create(_,{constructor:{value:$}});$.prototype=k;var j=new _n(h,$,k,C,D,i,u,d);if(j.baseClass){var Q,St;(St=(Q=j.baseClass).__derivedClasses)!==null&&St!==void 0||(Q.__derivedClasses=[]),j.baseClass.__derivedClasses.push(j)}var wo=new Ot(h,j,!0,!1,!1),Ye=new Ot(h+"*",j,!1,!1,!1),Je=new Ot(h+" const*",j,!1,!0,!1);return Ee[t]={pointerType:Ye,constPointerType:Je},Oe(E,$),[wo,Ye,Je]})},Qt=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(A[e+n*4>>2]);return r};function Un(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function Xt(t,e,r,n,o,i){var s=e.length;s<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&r!==null,c=Un(e),d=!e[0].isVoid,h=s-2,m=new Array(h),C=[],E=[],I=function(){E.length=0;var D;C.length=u?2:1,C[0]=o,u&&(D=e[1].toWireType(E,this),C[1]=D);for(var _=0;_<h;++_)m[_]=e[_+2].toWireType(E,_<0||arguments.length<=_?void 0:arguments[_]),C.push(m[_]);var $=n(...C);function k(j){if(c)Wt(E);else for(var Q=u?1:2;Q<e.length;Q++){var St=Q===1?D:m[Q-2];e[Q].destructorFunction!==null&&e[Q].destructorFunction(St)}if(d)return e[0].fromWireType(j)}return k($)};return Ht(t,I)}var kn=(t,e,r,n,o,i)=>{var s=Qt(e,r);o=U(n,o),et([],[t],u=>{u=u[0];var c=`constructor ${u.name}`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[e-1]!==void 0)throw new dt(`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]=()=>{Dt(`Cannot construct ${u.name} due to unbound types`,s)},et([],s,d=>(d.splice(1,0,null),u.registeredClass.constructor_body[e-1]=Xt(c,d,null,o,i),[])),[]})},Se=t=>{t=t.trim();const e=t.indexOf("(");return e===-1?t:t.slice(0,e)},Wn=(t,e,r,n,o,i,s,u,c,d)=>{var h=Qt(r,n);e=B(e),e=Se(e),i=U(o,i),et([],[t],m=>{m=m[0];var C=`${m.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&m.registeredClass.pureVirtualFunctions.push(e);function E(){Dt(`Cannot call ${C} due to unbound types`,h)}var I=m.registeredClass.instancePrototype,D=I[e];return D===void 0||D.overloadTable===void 0&&D.className!==m.name&&D.argCount===r-2?(E.argCount=r-2,E.className=m.name,I[e]=E):(_e(I,e,C),I[e].overloadTable[r-2]=E),et([],h,_=>{var $=Xt(C,_,m,i,s);return I[e].overloadTable===void 0?($.argCount=r-2,I[e]=$):I[e].overloadTable[r-2]=$,[]}),[]})},xe=[],rt=[0,1,,1,null,1,!0,1,!1,1],qt=t=>{t>9&&--rt[t+1]===0&&(rt[t]=void 0,xe.push(t))},V={toValue:t=>(t||b(`Cannot use deleted val. handle = ${t}`),rt[t]),toHandle:t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=xe.pop()||rt.length;return rt[e]=t,rt[e+1]=1,e}}}},Re={name:"emscripten::val",fromWireType:t=>{var e=V.toValue(t);return qt(t),e},toWireType:(t,e)=>V.toHandle(e),readValueFromPointer:lt,destructorFunction:null},Vn=t=>W(t,Re),Gn=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(me[r>>2])};case 8:return function(r){return this.fromWireType(ye[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Hn=(t,e,r)=>{e=B(e),W(t,{name:e,fromWireType:n=>n,toWireType:(n,o)=>o,readValueFromPointer:Gn(e,r),destructorFunction:null})},zn=(t,e,r,n,o,i,s,u)=>{var c=Qt(e,r);t=B(t),t=Se(t),o=U(n,o),Ae(t,function(){Dt(`Cannot call ${t} due to unbound types`,c)},e-1),et([],c,d=>{var h=[d[0],null].concat(d.slice(1));return Oe(t,Xt(t,h,null,o,i),e-1),[]})},Nn=(t,e,r)=>{switch(e){case 1:return r?n=>K[n]:n=>z[n];case 2:return r?n=>gt[n>>1]:n=>ut[n>>1];case 4:return r?n=>ct[n>>2]:n=>A[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Qn=(t,e,r,n,o)=>{e=B(e);const i=n===0;let s=c=>c;if(i){var u=32-8*r;s=c=>c<<u>>>u,o=s(o)}W(t,{name:e,fromWireType:s,toWireType:(c,d)=>d,readValueFromPointer:Nn(e,r,n!==0),destructorFunction:null})},Xn=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],o=n[e];function i(s){var u=A[s>>2],c=A[s+4>>2];return new o(K.buffer,c,u)}r=B(r),W(t,{name:r,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},qn=Object.assign({optional:!0},Re),Zn=(t,e)=>{W(t,qn)},Yn=(t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s<t.length;++s){var u=t.codePointAt(s);if(u<=127){if(r>=i)break;e[r++]=u}else if(u<=2047){if(r+1>=i)break;e[r++]=192|u>>6,e[r++]=128|u&63}else if(u<=65535){if(r+2>=i)break;e[r++]=224|u>>12,e[r++]=128|u>>6&63,e[r++]=128|u&63}else{if(r+3>=i)break;e[r++]=240|u>>18,e[r++]=128|u>>12&63,e[r++]=128|u>>6&63,e[r++]=128|u&63,s++}}return e[r]=0,r-o},ot=(t,e,r)=>Yn(t,z,e,r),Me=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},Fe=globalThis.TextDecoder&&new TextDecoder,Be=(t,e,r,n)=>{var o=e+r;if(n)return o;for(;t[e]&&!(e>=o);)++e;return e},je=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;var o=Be(t,e,r,n);if(o-e>16&&t.buffer&&Fe)return Fe.decode(t.subarray(e,o));for(var i="";e<o;){var s=t[e++];if(!(s&128)){i+=String.fromCharCode(s);continue}var u=t[e++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|u);continue}var c=t[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|t[e++]&63,s<65536)i+=String.fromCharCode(s);else{var d=s-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},Jn=(t,e,r)=>t?je(z,t,e,r):"",Kn=(t,e)=>{e=B(e),W(t,{name:e,fromWireType(r){var n=A[r>>2],o=r+4,i;return i=Jn(o,n,!0),q(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var o,i=typeof n=="string";i||ArrayBuffer.isView(n)&&n.BYTES_PER_ELEMENT==1||b("Cannot pass non-string to std::string"),i?o=Me(n):o=n.length;var s=Jt(4+o+1),u=s+4;return A[s>>2]=o,i?ot(n,u,o+1):z.set(n,u),r!==null&&r.push(q,s),s},readValueFromPointer:lt,destructorFunction(r){q(r)}})},Le=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,ta=(t,e,r)=>{var n=t>>1,o=Be(ut,n,e/2,r);if(o-n>16&&Le)return Le.decode(ut.subarray(n,o));for(var i="",s=n;s<o;++s){var u=ut[s];i+=String.fromCharCode(u)}return i},ea=(t,e,r)=>{if(r!=null||(r=2147483647),r<2)return 0;r-=2;for(var n=e,o=r<t.length*2?r/2:t.length,i=0;i<o;++i){var s=t.charCodeAt(i);gt[e>>1]=s,e+=2}return gt[e>>1]=0,e-n},ra=t=>t.length*2,na=(t,e,r)=>{for(var n="",o=t>>2,i=0;!(i>=e/4);i++){var s=A[o+i];if(!s&&!r)break;n+=String.fromCodePoint(s)}return n},aa=(t,e,r)=>{if(r!=null||(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var s=t.codePointAt(i);if(s>65535&&i++,ct[e>>2]=s,e+=4,e+4>o)break}return ct[e>>2]=0,e-n},oa=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.codePointAt(r);n>65535&&r++,e+=4}return e},ia=(t,e,r)=>{r=B(r);var n,o,i;e===2?(n=ta,o=ea,i=ra):(n=na,o=aa,i=oa),W(t,{name:r,fromWireType:s=>{var u=A[s>>2],c=n(s+4,u*e,!0);return q(s),c},toWireType:(s,u)=>{typeof u!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var c=i(u),d=Jt(4+c+e);return A[d>>2]=c/e,o(u,d+4,c+e),s!==null&&s.push(q,d),d},readValueFromPointer:lt,destructorFunction(s){q(s)}})},sa=(t,e,r,n,o,i)=>{Tt[t]={name:B(e),rawConstructor:U(r,n),rawDestructor:U(o,i),fields:[]}},ua=(t,e,r,n,o,i,s,u,c,d)=>{Tt[t].fields.push({fieldName:B(e),getterReturnType:r,getter:U(n,o),getterContext:i,setterArgumentType:s,setter:U(u,c),setterContext:d})},ca=(t,e)=>{e=B(e),W(t,{isVoid:!0,name:e,fromWireType:()=>{},toWireType:(r,n)=>{}})},Zt=[],la=t=>{var e=Zt.length;return Zt.push(t),e},da=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${Ie(t)}`),r},fa=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=da(A[e+n*4>>2],`parameter ${n}`);return r},ha=(t,e,r)=>{var n=[],o=t(n,r);return n.length&&(A[e>>2]=V.toHandle(n)),o},pa={},Ue=t=>{var e=pa[t];return e===void 0?B(t):e},ma=(t,e,r)=>{var n=8,[o,...i]=fa(t,e),s=o.toWireType.bind(o),u=i.map(m=>m.readValueFromPointer.bind(m));t--;var c=new Array(t),d=(m,C,E,I)=>{for(var D=0,_=0;_<t;++_)c[_]=u[_](I+D),D+=n;var $;switch(r){case 0:$=V.toValue(m).apply(null,c);break;case 2:$=Reflect.construct(V.toValue(m),c);break;case 3:$=c[0];break;case 1:$=V.toValue(m)[Ue(C)](...c);break}return ha(s,E,$)},h=`methodCaller<(${i.map(m=>m.name)}) => ${o.name}>`;return la(Ht(h,d))},ya=t=>t?(t=Ue(t),V.toHandle(globalThis[t])):V.toHandle(globalThis),va=t=>{t>9&&(rt[t+1]+=1)},ga=(t,e,r,n,o)=>Zt[t](e,r,n,o),wa=t=>{var e=V.toValue(t);Wt(e),qt(t)},ba=(t,e,r,n)=>{var o=new Date().getFullYear(),i=new Date(o,0,1),s=new Date(o,6,1),u=i.getTimezoneOffset(),c=s.getTimezoneOffset(),d=Math.max(u,c);A[t>>2]=d*60,ct[e>>2]=+(u!=c);var h=E=>{var I=E>=0?"-":"+",D=Math.abs(E),_=String(Math.floor(D/60)).padStart(2,"0"),$=String(D%60).padStart(2,"0");return`UTC${I}${_}${$}`},m=h(u),C=h(c);c<u?(ot(m,r,17),ot(C,n,17)):(ot(m,n,17),ot(C,r,17))},Ca=()=>2147483648,$a=(t,e)=>Math.ceil(t/e)*e,Ta=t=>{var e=It.buffer.byteLength,r=(t-e+65535)/65536|0;try{return It.grow(r),ge(),1}catch{}},Ea=t=>{var e=z.length;t>>>=0;var r=Ca();if(t>r)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,t+100663296);var i=Math.min(r,$a(Math.max(t,o),65536)),s=Ta(i);if(s)return!0}return!1},Yt={},_a=()=>S||"./this.program",ht=()=>{if(!ht.strings){var t=(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:_a()};for(var r in Yt)Yt[r]===void 0?delete e[r]:e[r]=Yt[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);ht.strings=n}return ht.strings},Aa=(t,e)=>{var r=0,n=0;for(var o of ht()){var i=e+r;A[t+n>>2]=i,r+=ot(o,i,1/0)+1,n+=4}return 0},Pa=(t,e)=>{var r=ht();A[t>>2]=r.length;var n=0;for(var o of r)n+=Me(o)+1;return A[e>>2]=n,0},Oa=t=>52;function Da(t,e,r,n,o){return 70}var Ia=[null,[],[]],Sa=(t,e)=>{var r=Ia[t];e===0||e===10?((t===1?st:H)(je(r)),r.length=0):r.push(e)},xa=(t,e,r,n)=>{for(var o=0,i=0;i<r;i++){var s=A[e>>2],u=A[e+4>>2];e+=8;for(var c=0;c<u;c++)Sa(t,z[s+c]);o+=u}return A[n>>2]=o,0},Ra=t=>t;if(Cn(),Rn(),l.noExitRuntime&&l.noExitRuntime,l.print&&(st=l.print),l.printErr&&(H=l.printErr),l.wasmBinary&&(J=l.wasmBinary),l.arguments&&l.arguments,l.thisProgram&&(S=l.thisProgram),l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.shift()();var ke,q,Jt,We,y,Ve,Ge,He,ze,Ne,Qe,Xe,qe,It,Ze;function Ma(t){ke=t.ya,q=l._free=t.za,Jt=l._malloc=t.Ba,We=t.Ca,y=t.Da,Ve=t.Ea,Ge=t.Fa,He=t.Ga,ze=t.Ha,Ne=t.Ia,Qe=t.Ja,X.viijii=t.Ka,Xe=X.iiijj=t.La,X.jiji=t.Ma,qe=X.jiiii=t.Na,X.iiiiij=t.Oa,X.iiiiijj=t.Pa,X.iiiiiijj=t.Qa,It=t.wa,Ze=t.Aa}var Fa={s:nn,x:an,a:on,j:sn,m:un,P:cn,q:ln,U:dn,d:fn,ba:hn,ta:mn,aa:yn,oa:gn,ra:Ln,qa:kn,F:Wn,ma:Vn,W:Hn,X:zn,z:Qn,t:Xn,sa:Zn,na:Kn,R:ia,G:sa,ua,pa:ca,M:ma,va:qt,C:ya,S:va,L:ga,ha:wa,ca:ba,fa:Ea,da:Aa,ea:Pa,ga:Oa,_:Da,V:xa,J:oo,B:so,Y:Ga,T:ho,r:eo,b:La,D:ao,ja:co,c:ka,ia:lo,h:Va,i:qa,p:Ya,O:no,w:Ka,E:to,K:ro,I:po,$:yo,Z:vo,f:Ha,l:Ba,e:Ua,g:Wa,N:fo,k:ja,ka:io,o:Ja,y:Na,u:Za,Q:Xa,v:uo,n:za,H:mo,la:Qa,A:Ra};function Ba(t,e){var r=g();try{w(t)(e)}catch(n){if(v(r),n!==n+0)throw n;y(1,0)}}function ja(t,e,r,n,o){var i=g();try{w(t)(e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function La(t,e){var r=g();try{return w(t)(e)}catch(n){if(v(r),n!==n+0)throw n;y(1,0)}}function Ua(t,e,r){var n=g();try{w(t)(e,r)}catch(o){if(v(n),o!==o+0)throw o;y(1,0)}}function ka(t,e,r){var n=g();try{return w(t)(e,r)}catch(o){if(v(n),o!==o+0)throw o;y(1,0)}}function Wa(t,e,r,n){var o=g();try{w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function Va(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function Ga(t,e,r,n,o,i){var s=g();try{return w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function Ha(t){var e=g();try{w(t)()}catch(r){if(v(e),r!==r+0)throw r;y(1,0)}}function za(t,e,r,n,o,i,s,u,c,d,h){var m=g();try{w(t)(e,r,n,o,i,s,u,c,d,h)}catch(C){if(v(m),C!==C+0)throw C;y(1,0)}}function Na(t,e,r,n,o,i,s){var u=g();try{w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function Qa(t,e,r,n,o,i,s,u,c,d,h,m,C,E,I,D,_){var $=g();try{w(t)(e,r,n,o,i,s,u,c,d,h,m,C,E,I,D,_)}catch(k){if(v($),k!==k+0)throw k;y(1,0)}}function Xa(t,e,r,n,o,i,s,u,c){var d=g();try{w(t)(e,r,n,o,i,s,u,c)}catch(h){if(v(d),h!==h+0)throw h;y(1,0)}}function qa(t,e,r,n,o){var i=g();try{return w(t)(e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function Za(t,e,r,n,o,i,s,u){var c=g();try{w(t)(e,r,n,o,i,s,u)}catch(d){if(v(c),d!==d+0)throw d;y(1,0)}}function Ya(t,e,r,n,o,i){var s=g();try{return w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function Ja(t,e,r,n,o,i){var s=g();try{w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function Ka(t,e,r,n,o,i,s){var u=g();try{return w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function to(t,e,r,n,o,i,s,u){var c=g();try{return w(t)(e,r,n,o,i,s,u)}catch(d){if(v(c),d!==d+0)throw d;y(1,0)}}function eo(t){var e=g();try{return w(t)()}catch(r){if(v(e),r!==r+0)throw r;y(1,0)}}function ro(t,e,r,n,o,i,s,u,c){var d=g();try{return w(t)(e,r,n,o,i,s,u,c)}catch(h){if(v(d),h!==h+0)throw h;y(1,0)}}function no(t,e,r,n,o,i,s){var u=g();try{return w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function ao(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function oo(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function io(t,e,r,n,o,i,s,u){var c=g();try{w(t)(e,r,n,o,i,s,u)}catch(d){if(v(c),d!==d+0)throw d;y(1,0)}}function so(t,e,r,n,o,i){var s=g();try{return w(t)(e,r,n,o,i)}catch(u){if(v(s),u!==u+0)throw u;y(1,0)}}function uo(t,e,r,n,o,i,s,u,c,d){var h=g();try{w(t)(e,r,n,o,i,s,u,c,d)}catch(m){if(v(h),m!==m+0)throw m;y(1,0)}}function co(t,e,r){var n=g();try{return w(t)(e,r)}catch(o){if(v(n),o!==o+0)throw o;y(1,0)}}function lo(t,e,r,n,o){var i=g();try{return w(t)(e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function fo(t,e,r,n,o,i,s){var u=g();try{w(t)(e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function ho(t,e,r,n){var o=g();try{return w(t)(e,r,n)}catch(i){if(v(o),i!==i+0)throw i;y(1,0)}}function po(t,e,r,n,o,i,s,u,c,d,h,m){var C=g();try{return w(t)(e,r,n,o,i,s,u,c,d,h,m)}catch(E){if(v(C),E!==E+0)throw E;y(1,0)}}function mo(t,e,r,n,o,i,s,u,c,d,h,m,C,E,I,D){var _=g();try{w(t)(e,r,n,o,i,s,u,c,d,h,m,C,E,I,D)}catch($){if(v(_),$!==$+0)throw $;y(1,0)}}function yo(t,e,r,n,o,i,s){var u=g();try{return Xe(t,e,r,n,o,i,s)}catch(c){if(v(u),c!==c+0)throw c;y(1,0)}}function vo(t,e,r,n,o){var i=g();try{return qe(t,e,r,n,o)}catch(s){if(v(i),s!==s+0)throw s;y(1,0)}}function go(){zr();function t(){var e,r;l.calledRun=!0,!vt&&(Nr(),(e=he)===null||e===void 0||e(l),(r=l.onRuntimeInitialized)===null||r===void 0||r.call(l),Qr())}l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),t()},1)):t()}var pt;return pt=await tn(),go(),ve?f=l:f=new Promise((t,e)=>{he=t,pe=e}),f}function Bt(a){return ee(Ft,a)}function Er(){return $r(Ft)}function _r(a){Bt({overrides:a,equalityFn:Object.is,fireImmediately:!1})}async function Ar(a,f){return Tr(Ft,a,f)}const Pr="c25c09c3a8ec3118f96d224491c9a20cc6ad4302b70eb0e4b941772c2982a920",re=[["aztec","Aztec"],["aztec_code","AztecCode"],["aztec_rune","AztecRune"],["code_128","Code128"],["code_39","Code39"],["code_39_standard","Code39Std"],["code_39_extended","Code39Ext"],["code_32","Code32"],["pzn","PZN"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_omni","DataBarOmni"],["databar_stacked","DataBarStk"],["databar_stacked_omni","DataBarStkOmni"],["databar_expanded","DataBarExp"],["databar_expanded_stacked","DataBarExpStk"],["databar_limited","DataBarLtd"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN13"],["ean_upc","EANUPC"],["isbn","ISBN"],["ean_8","EAN8"],["itf","ITF"],["itf_14","ITF14"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["compact_pdf417","CompactPDF417"],["qr_code","QRCode"],["qr_code_model_1","QRCodeModel1"],["qr_code_model_2","QRCodeModel2"],["rm_qr_code","RMQRCode"],["upc_a","UPCA"],["upc_e","UPCE"],["other_barcode","OtherBarcode"],["linear_codes","AllLinear"],["matrix_codes","AllMatrix"],["gs1_codes","AllGS1"],["retail_codes","AllRetail"],["industrial_codes","AllIndustrial"],["any","All"]],Or=[...re,["unknown"]].map(a=>a[0]),jt=new Map(re);function Dr(a){for(const[f,p]of jt)if(a===p)return f;return"unknown"}function Ir(a){if(ne(a))return{width:a.naturalWidth,height:a.naturalHeight};if(ae(a))return{width:a.width.baseVal.value,height:a.height.baseVal.value};if(oe(a))return{width:a.videoWidth,height:a.videoHeight};if(se(a))return{width:a.width,height:a.height};if(ce(a))return{width:a.displayWidth,height:a.displayHeight};if(ie(a))return{width:a.width,height:a.height};if(ue(a))return{width:a.width,height:a.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 ne(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function ae(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function oe(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function ie(a){var f,p;try{return a instanceof((p=(f=a==null?void 0:a.ownerDocument)==null?void 0:f.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function se(a){try{return a instanceof ImageBitmap||Object.prototype.toString.call(a)==="[object ImageBitmap]"}catch{return!1}}function ue(a){try{return a instanceof OffscreenCanvas||Object.prototype.toString.call(a)==="[object OffscreenCanvas]"}catch{return!1}}function ce(a){try{return a instanceof VideoFrame||Object.prototype.toString.call(a)==="[object VideoFrame]"}catch{return!1}}function Sr(a){try{return a instanceof Blob||Object.prototype.toString.call(a)==="[object Blob]"}catch{return!1}}function xr(a){try{return a instanceof ImageData||Object.prototype.toString.call(a)==="[object ImageData]"}catch{return!1}}function Rr(a,f){try{const p=new OffscreenCanvas(a,f);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=a,p.height=f,p}}async function le(a){if(ne(a)&&!await jr(a))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(ae(a)&&!await Lr(a))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ce(a)&&Ur(a))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(oe(a)&&(a.readyState===0||a.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(se(a)&&Wr(a))throw new DOMException("The image source is detached.","InvalidStateError");const{width:f,height:p}=Ir(a);if(f===0||p===0)return null;const l=Rr(f,p).getContext("2d");l.drawImage(a,0,0);try{return l.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Mr(a){let f;try{f=await createImageBitmap(a)}catch{try{if(globalThis.Image){f=new Image;let l="";try{l=URL.createObjectURL(a),f.src=l,await f.decode()}finally{URL.revokeObjectURL(l)}}else return a}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await le(f)}function Fr(a){const{width:f,height:p}=a;if(f===0||p===0)return null;const T=a.getContext("2d");try{return T.getImageData(0,0,f,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Br(a){if(Sr(a))return await Mr(a);if(xr(a)){if(kr(a))throw new DOMException("The image data has been detached.","InvalidStateError");return a}return ie(a)||ue(a)?Fr(a):await le(a)}async function jr(a){try{return await a.decode(),!0}catch{return!1}}async function Lr(a){var f;try{return await((f=a.decode)==null?void 0:f.call(a)),!0}catch{return!1}}function Ur(a){return a.format===null}function kr(a){return a.data.buffer.byteLength===0}function Wr(a){return a.width===0&&a.height===0}function de(a,f){return Vr(a)?new DOMException(`${f}: ${a.message}`,a.name):Gr(a)?new a.constructor(`${f}: ${a.message}`):new Error(`${f}: ${a}`)}function Vr(a){return a instanceof DOMException||Object.prototype.toString.call(a)==="[object DOMException]"}function Gr(a){return a instanceof Error||Object.prototype.toString.call(a)==="[object Error]"}class Hr{constructor(f={}){ar(this,it);var p;try{const T=(p=f==null?void 0:f.formats)==null?void 0:p.filter(l=>l!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const l of T!=null?T:[])if(!jt.has(l))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${l}' is not a valid enum value of type BarcodeFormat.`);or(this,it,T!=null?T:[]),Bt({fireImmediately:!0}).catch(()=>{})}catch(T){throw de(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Or.filter(f=>f!=="unknown")}async detect(f){try{const p=await Br(f);if(p===null)return[];let T;const l={textMode:"Plain",formats:nr(this,it).map(x=>jt.get(x))};try{T=await Ar(p,l)}catch(x){throw console.error(x),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(x=>{const{topLeft:{x:R,y:M},topRight:{x:S,y:F},bottomLeft:{x:G,y:Z},bottomRight:{x:nt,y:Y}}=x.position,st=Math.min(R,S,G,nt),H=Math.min(M,F,Z,Y),J=Math.max(R,S,G,nt),vt=Math.max(M,F,Z,Y);return{boundingBox:new DOMRectReadOnly(st,H,J-st,vt-H),rawValue:x.text,format:Dr(x.format),cornerPoints:[{x:R,y:M},{x:S,y:F},{x:nt,y:Y},{x:G,y:Z}]}})}catch(p){throw de(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return it=new WeakMap,(fe=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=Hr),P.ZXING_CPP_COMMIT=wr,P.ZXING_WASM_SHA256=Pr,P.ZXING_WASM_VERSION=gr,P.prepareZXingModule=Bt,P.purgeZXingModule=Er,P.setZXingModuleOverrides=_r,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),P})({});
|
|
1
|
+
var BarcodeDetectionAPI=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=[[`All`,`*`,`*`,` `,0,`All`],[`AllReadable`,`*`,`r`,` `,0,`All Readable`],[`AllCreatable`,`*`,`w`,` `,0,`All Creatable`],[`AllLinear`,`*`,`l`,` `,0,`All Linear`],[`AllMatrix`,`*`,`m`,` `,0,`All Matrix`],[`AllGS1`,`*`,`G`,` `,0,`All GS1`],[`AllRetail`,`*`,`R`,` `,0,`All Retail`],[`AllIndustrial`,`*`,`I`,` `,0,`All Industrial`],[`Codabar`,`F`,` `,`lrw `,18,`Codabar`],[`Code39`,`A`,` `,`lrw I`,8,`Code 39`],[`Code39Std`,`A`,`s`,`lrw I`,8,`Code 39 Standard`],[`Code39Ext`,`A`,`e`,`lr I`,9,`Code 39 Extended`],[`Code32`,`A`,`2`,`lr I`,129,`Code 32`],[`PZN`,`A`,`p`,`lr I`,52,`Pharmazentralnummer`],[`Code93`,`G`,` `,`lrw I`,25,`Code 93`],[`Code128`,`C`,` `,`lrwGI`,20,`Code 128`],[`ITF`,`I`,` `,`lrw I`,3,`ITF`],[`ITF14`,`I`,`4`,`lr I`,89,`ITF-14`],[`DataBar`,`e`,` `,`lr GR`,29,`DataBar`],[`DataBarOmni`,`e`,`o`,`lr GR`,29,`DataBar Omni`],[`DataBarStk`,`e`,`s`,`lr GR`,79,`DataBar Stacked`],[`DataBarStkOmni`,`e`,`O`,`lr GR`,80,`DataBar Stacked Omni`],[`DataBarLtd`,`e`,`l`,`lr GR`,30,`DataBar Limited`],[`DataBarExp`,`e`,`e`,`lr GR`,31,`DataBar Expanded`],[`DataBarExpStk`,`e`,`E`,`lr GR`,81,`DataBar Expanded Stacked`],[`EANUPC`,`E`,` `,`lr R`,15,`EAN/UPC`],[`EAN13`,`E`,`1`,`lrw R`,15,`EAN-13`],[`EAN8`,`E`,`8`,`lrw R`,10,`EAN-8`],[`EAN5`,`E`,`5`,`l R`,12,`EAN-5`],[`EAN2`,`E`,`2`,`l R`,11,`EAN-2`],[`ISBN`,`E`,`i`,`lr R`,69,`ISBN`],[`UPCA`,`E`,`a`,`lrw R`,34,`UPC-A`],[`UPCE`,`E`,`e`,`lrw R`,37,`UPC-E`],[`OtherBarcode`,`X`,` `,` r `,0,`Other barcode`],[`DXFilmEdge`,`X`,`x`,`lr `,147,`DX Film Edge`],[`PDF417`,`L`,` `,`mrw `,55,`PDF417`],[`CompactPDF417`,`L`,`c`,`mr `,56,`Compact PDF417`],[`MicroPDF417`,`L`,`m`,`m `,84,`MicroPDF417`],[`Aztec`,`z`,` `,`mr G `,92,`Aztec`],[`AztecCode`,`z`,`c`,`mrwG `,92,`Aztec Code`],[`AztecRune`,`z`,`r`,`mr `,128,`Aztec Rune`],[`QRCode`,`Q`,` `,`mrwG `,58,`QR Code`],[`QRCodeModel1`,`Q`,`1`,`mr `,0,`QR Code Model 1`],[`QRCodeModel2`,`Q`,`2`,`mr `,58,`QR Code Model 2`],[`MicroQRCode`,`Q`,`m`,`mr `,97,`Micro QR Code`],[`RMQRCode`,`Q`,`r`,`mr G `,145,`rMQR Code`],[`DataMatrix`,`d`,` `,`mrwG `,71,`Data Matrix`],[`MaxiCode`,`U`,` `,`mr `,57,`MaxiCode`]],n={DataBarExpanded:`DataBarExp`,DataBarLimited:`DataBarLtd`,"Linear-Codes":`AllLinear`,"Matrix-Codes":`AllMatrix`,Any:`All`,rMQRCode:`RMQRCode`};t.map(e=>e[5]),t.filter(e=>e[1]===`*`).map(e=>e[0]),t.filter(e=>e[1]!==`*`).map(e=>e[0]),t.filter(e=>e[2]===` `).map(e=>e[0]),t.filter(e=>e[3][0]===`l`).map(e=>e[0]),t.filter(e=>e[3][0]===`m`).map(e=>e[0]),t.filter(e=>e[3][1]===`r`).map(e=>e[0]),t.filter(e=>e[3][2]===`w`||e[4]!==0).map(e=>e[0]),t.filter(e=>e[3][3]===`G`).map(e=>e[0]),t.filter(e=>e[3][4]===`R`).map(e=>e[0]),t.filter(e=>e[3][4]===`I`).map(e=>e[0]);function r(e){var t;return(t=n[e])==null?e:t}function i(e){return e.map(r).join(`,`)}var a=[`LocalAverage`,`GlobalHistogram`,`FixedThreshold`,`BoolCast`];function o(e){return a.indexOf(e)}var s=`Unknown.ASCII.ISO8859_1.ISO8859_2.ISO8859_3.ISO8859_4.ISO8859_5.ISO8859_6.ISO8859_7.ISO8859_8.ISO8859_9.ISO8859_10.ISO8859_11.ISO8859_13.ISO8859_14.ISO8859_15.ISO8859_16.Cp437.Cp1250.Cp1251.Cp1252.Cp1256.Shift_JIS.Big5.GB2312.GB18030.EUC_JP.EUC_KR.UTF16BE.UTF8.UTF16LE.UTF32BE.UTF32LE.BINARY`.split(`.`);function c(e){return e===`UnicodeBig`?s.indexOf(`UTF16BE`):s.indexOf(e)}var l=[`Text`,`Binary`,`Mixed`,`GS1`,`ISO15434`,`UnknownECI`];function u(e){return l[e]}var d=[`Ignore`,`Read`,`Require`];function f(e){return d.indexOf(e)}var p=[`Plain`,`ECI`,`HRI`,`Escaped`,`Hex`,`HexECI`];function m(e){return p.indexOf(e)}var h={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:`LocalAverage`,isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,validateOptionalChecksum:!1,returnErrors:!1,eanAddOnSymbol:`Ignore`,textMode:`HRI`,characterSet:`Unknown`,tryCode39ExtendedMode:!0};function g(e){var t;return{...e,formats:i(e.formats),binarizer:o(e.binarizer),eanAddOnSymbol:f(e.eanAddOnSymbol),textMode:m(e.textMode),characterSet:c(e.characterSet),tryCode39ExtendedMode:(t=e.tryCode39ExtendedMode)==null?!0:t}}function _(e){return{...e,format:e.format,symbology:e.symbology,contentType:u(e.contentType)}}var ee={format:`QRCode`,readerInit:!1,forceSquareDataMatrix:!1,ecLevel:``,scale:1,sizeHint:0,rotate:0,invert:!1,withHRT:!1,withQuietZones:!0,addHRT:!1,addQuietZones:!0,options:``},te=`3.0.2`,ne=`b304f6656b865be11b00741d430b7d0027bc0ab4`,re={locateFile:(e,t)=>{let n=e.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@3.0.2/dist/${n[1]}/${e}`:t+e}},v=new WeakMap;function ie(e,t){return Object.is(e,t)||Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(n=>Object.hasOwn(t,n)&&e[n]===t[n])}function ae(e,{overrides:t,equalityFn:n=ie,fireImmediately:r=!1}={}){var i,a;let[o,s]=(i=v.get(e))==null?[re]:i,c=t==null?o:t,l;if(r){if(s&&(l=n(o,c)))return s;let t=e({...c});return v.set(e,[c,t]),t}((a=l)==null?n(o,c):a)||v.set(e,[c])}function oe(e){v.delete(e)}function y(e){let t=e.byteLength>>2,n=new Uint8Array(t);for(let r=0;r<t;r++){let t=r<<2;n[r]=306*e[t]+601*e[t+1]+117*e[t+2]+512>>10}return n}async function se(e,t,n=h){let r={...h,...n},i=await ae(e,{fireImmediately:!0}),a,o;if(`width`in t&&`height`in t&&`data`in t){let{data:e,width:n,height:s}=t,c=y(e),l=c.byteLength;if(o=i._malloc(l),!o)throw Error(`Failed to allocate ${l} bytes in WASM memory`);try{i.HEAPU8.set(c,o),a=i.readBarcodesFromPixmap(o,n,s,g(r))}finally{i._free(o)}}else{let e,n;if(`buffer`in t)[e,n]=[t.byteLength,t];else if(`byteLength`in t)[e,n]=[t.byteLength,new Uint8Array(t)];else if(`size`in t)[e,n]=[t.size,new Uint8Array(await t.arrayBuffer())];else throw TypeError(`Invalid input type`);if(o=i._malloc(e),!o)throw Error(`Failed to allocate ${e} bytes in WASM memory`);try{i.HEAPU8.set(n,o),a=i.readBarcodesFromImage(o,e,g(r))}finally{i._free(o)}}let s=[];for(let e=0;e<a.size();++e)s.push(_(a.get(e)));return s}({...h}),[...h.formats],{...ee};async function ce(e={}){var t,n,r,i=e,a=!!globalThis.window,o=typeof Bun<`u`,s=!!globalThis.WorkerGlobalScope;!((n=globalThis.process)==null||(n=n.versions)==null)&&n.node&&((r=globalThis.process)==null||r.type);var c=`./this.program`,l,u=``;function d(e){return i.locateFile?i.locateFile(e,u):u+e}var f,p;if(a||s||o){try{u=new URL(`.`,l).href}catch{}s&&(p=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),f=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var m=console.log.bind(console),h=console.error.bind(console),g,_=!1,ee,te,ne=!1;function re(){var e=Xn.buffer;S=new Int8Array(e),b=new Int16Array(e),i.HEAPU8=T=new Uint8Array(e),C=new Uint16Array(e),x=new Int32Array(e),w=new Uint32Array(e),me=new Float32Array(e),he=new Float64Array(e)}function v(){if(i.preRun)for(typeof i.preRun==`function`&&(i.preRun=[i.preRun]);i.preRun.length;)be(i.preRun.shift());ge(ye)}function ie(){ne=!0,$.Aa()}function ae(){if(i.postRun)for(typeof i.postRun==`function`&&(i.postRun=[i.postRun]);i.postRun.length;)ve(i.postRun.shift());ge(_e)}function oe(e){var t,n;(t=i.onAbort)==null||t.call(i,e),e=`Aborted(`+e+`)`,h(e),_=!0,e+=`. Build with -sASSERTIONS for more info.`;var r=new WebAssembly.RuntimeError(e);throw(n=te)==null||n(r),r}var y;function se(){return d(`zxing_reader.wasm`)}function ce(e){if(e==y&&g)return new Uint8Array(g);if(p)return p(e);throw`both async and sync fetching of the wasm failed`}async function le(e){if(!g)try{var t=await f(e);return new Uint8Array(t)}catch{}return ce(e)}async function ue(e,t){try{var n=await le(e);return await WebAssembly.instantiate(n,t)}catch(e){h(`failed to asynchronously prepare wasm: ${e}`),oe(e)}}async function de(e,t,n){if(!e&&WebAssembly.instantiateStreaming)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){h(`wasm streaming compile failed: ${e}`),h(`falling back to ArrayBuffer instantiation`)}return ue(t,n)}function fe(){return{a:$n}}async function pe(){function e(e,t){return $=e.exports,Qn($),re(),$}function t(t){return e(t.instance)}var n=fe();return i.instantiateWasm?new Promise((t,r)=>{i.instantiateWasm(n,(n,r)=>{t(e(n,r))})}):(y!=null||(y=se()),t(await de(g,y,n)))}var b,x,S,me,he,C,w,T,ge=e=>{for(;e.length>0;)e.shift()(i)},_e=[],ve=e=>_e.push(e),ye=[],be=e=>ye.push(e),E=e=>Un(e),D=()=>Wn(),O=[],k=0,xe=e=>{var t=new Ce(e);return t.get_caught()||(t.set_caught(!0),k--),t.set_rethrown(!1),O.push(t),Vn(e)},A=0,Se=()=>{Q(0,0);var e=O.pop();Gn(e.excPtr),A=0};class Ce{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){w[this.ptr+4>>2]=e}get_type(){return w[this.ptr+4>>2]}set_destructor(e){w[this.ptr+8>>2]=e}get_destructor(){return w[this.ptr+8>>2]}set_caught(e){e=e?1:0,S[this.ptr+12]=e}get_caught(){return S[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,S[this.ptr+13]=e}get_rethrown(){return S[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){w[this.ptr+16>>2]=e}get_adjusted_ptr(){return w[this.ptr+16>>2]}}var j=e=>Hn(e),we=e=>{var t=A;if(!t)return j(0),0;var n=new Ce(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return j(0),t;for(var i of e){if(i===0||i===r)break;var a=n.ptr+16;if(qn(i,r,a))return j(i),t}return j(r),t},Te=()=>we([]),Ee=e=>we([e]),De=(e,t)=>we([e,t]),Oe=()=>{var e=O.pop();e||oe(`no exception to throw`);var t=e.excPtr;throw e.get_rethrown()||(O.push(e),e.set_rethrown(!0),e.set_caught(!1),k++),Kn(t),A=t,A},ke=(e,t,n)=>{throw new Ce(e).init(t,n),Kn(e),A=e,k++,A},Ae=()=>k,je=e=>{throw A||(A=e),A},Me=()=>oe(``),M={},N=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function P(e){return this.fromWireType(w[e>>2])}var F={},I={},L={},Ne=class extends Error{constructor(e){super(e),this.name=`InternalError`}},Pe=e=>{throw new Ne(e)},R=(e,t,n)=>{e.forEach(e=>L[e]=t);function r(t){var r=n(t);r.length!==e.length&&Pe(`Mismatched type converter count`);for(var i=0;i<e.length;++i)H(e[i],r[i])}var i=Array(t.length),a=[],o=0;{let e=t;for(let t=0;t<e.length;++t){let n=e[t];I.hasOwnProperty(n)?i[t]=I[n]:(a.push(n),F.hasOwnProperty(n)||(F[n]=[]),F[n].push(()=>{i[t]=I[n],++o,o===a.length&&r(i)}))}}a.length===0&&r(i)},Fe=e=>{var t=M[e];delete M[e];var n=t.rawConstructor,r=t.rawDestructor,i=t.fields,a=i.map(e=>e.getterReturnType).concat(i.map(e=>e.setterArgumentType));R([e],a,e=>{var a={};{let t=i;for(let n=0;n<t.length;++n){let r=t[n],o=e[n],s=r.getter,c=r.getterContext,l=e[n+i.length],u=r.setter,d=r.setterContext;a[r.fieldName]={read:e=>o.fromWireType(s(c,e)),write:(e,t)=>{var n=[];u(d,e,l.toWireType(n,t)),N(n)},optional:o.optional}}}return[{name:t.name,fromWireType:e=>{var t={};for(var n in a)t[n]=a[n].read(e);return r(e),t},toWireType:(e,t)=>{for(var i in a)if(!(i in t)&&!a[i].optional)throw TypeError(`Missing field: "${i}"`);var o=n();for(i in a)a[i].write(o,t[i]);return e!==null&&e.push(r,o),o},readValueFromPointer:P,destructorFunction:r}]})},Ie=(e,t,n,r,i)=>{},z=e=>{for(var t=``;;){var n=T[e++];if(!n)return t;t+=String.fromCharCode(n)}},B=class extends Error{constructor(e){super(e),this.name=`BindingError`}},V=e=>{throw new B(e)};function Le(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.name;if(e||V(`type "${r}" must have a positive integer typeid pointer`),I.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;V(`Cannot register type '${r}' twice`)}if(I[e]=t,delete L[e],F.hasOwnProperty(e)){var i=F[e];delete F[e],i.forEach(e=>e())}}function H(e,t){return Le(e,t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{})}var Re=(e,t,n,r)=>{t=z(t),H(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},readValueFromPointer:function(e){return this.fromWireType(T[e])},destructorFunction:null})},ze=e=>({count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}),Be=e=>{function t(e){return e.$$.ptrType.registeredClass.name}V(t(e)+` instance already deleted`)},Ve=!1,He=e=>{},Ue=e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)},We=e=>{--e.count.value,e.count.value===0&&Ue(e)},U=e=>globalThis.FinalizationRegistry?(Ve=new FinalizationRegistry(e=>{We(e.$$)}),U=e=>{var t=e.$$;if(t.smartPtr){var n={$$:t};Ve.register(e,n,e)}return e},He=e=>Ve.unregister(e),U(e)):(U=e=>e,e),Ge=[],Ke=()=>{for(;Ge.length;){var e=Ge.pop();e.$$.deleteScheduled=!1,e.delete()}},qe,Je=()=>{let e=Ye.prototype;Object.assign(e,{isAliasOf(e){if(!(this instanceof Ye)||!(e instanceof Ye))return!1;var t=this.$$.ptrType.registeredClass,n=this.$$.ptr;e.$$=e.$$;for(var r=e.$$.ptrType.registeredClass,i=e.$$.ptr;t.baseClass;)n=t.upcast(n),t=t.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return t===r&&n===i},clone(){if(this.$$.ptr||Be(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=U(Object.create(Object.getPrototypeOf(this),{$$:{value:ze(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e},delete(){this.$$.ptr||Be(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&V(`Object already scheduled for deletion`),He(this),We(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Be(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&V(`Object already scheduled for deletion`),Ge.push(this),Ge.length===1&&qe&&qe(Ke),this.$$.deleteScheduled=!0,this}});let t=Symbol.dispose;t&&(e[t]=e.delete)};function Ye(){}var Xe=(e,t)=>Object.defineProperty(t,`name`,{value:e}),Ze={},Qe=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(){var r=[...arguments];return e[t].overloadTable.hasOwnProperty(r.length)||V(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},$e=(e,t,n)=>{i.hasOwnProperty(e)?((n===void 0||i[e].overloadTable!==void 0&&i[e].overloadTable[n]!==void 0)&&V(`Cannot register public name '${e}' twice`),Qe(i,e,e),i[e].overloadTable.hasOwnProperty(n)&&V(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),i[e].overloadTable[n]=t):(i[e]=t,i[e].argCount=n)},et=48,tt=57,nt=e=>{e=e.replace(/[^a-zA-Z0-9_]/g,`$`);var t=e.charCodeAt(0);return t>=et&&t<=tt?`_${e}`:e};function rt(e,t,n,r,i,a,o,s){this.name=e,this.constructor=t,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=a,this.upcast=o,this.downcast=s,this.pureVirtualFunctions=[]}var it=(e,t,n)=>{for(;t!==n;)t.upcast||V(`Expected null or instance of ${n.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e},at=e=>{if(e===null)return`null`;var t=typeof e;return t===`object`||t===`array`||t===`function`?e.toString():``+e};function ot(e,t){if(t===null)return this.isReference&&V(`null is not a valid ${this.name}`),0;t.$$||V(`Cannot pass "${at(t)}" as a ${this.name}`),t.$$.ptr||V(`Cannot pass deleted object as a pointer of type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}function st(e,t){var n;if(t===null)return this.isReference&&V(`null is not a valid ${this.name}`),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;(!t||!t.$$)&&V(`Cannot pass "${at(t)}" as a ${this.name}`),t.$$.ptr||V(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&V(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;if(n=it(t.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(t.$$.smartPtr===void 0&&V(`Passing raw pointer to smart pointer is illegal`),this.sharingPolicy){case 0:t.$$.smartPtrType===this?n=t.$$.smartPtr:V(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:n=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)n=t.$$.smartPtr;else{var i=t.clone();n=this.rawShare(n,J.toHandle(()=>i.delete())),e!==null&&e.push(this.rawDestructor,n)}break;default:V(`Unsupported sharing policy`)}return n}function ct(e,t){if(t===null)return this.isReference&&V(`null is not a valid ${this.name}`),0;t.$$||V(`Cannot pass "${at(t)}" as a ${this.name}`),t.$$.ptr||V(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&V(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;return it(t.$$.ptr,n,this.registeredClass)}var lt=(e,t,n)=>{if(t===n)return e;if(n.baseClass===void 0)return null;var r=lt(e,t,n.baseClass);return r===null?null:n.downcast(r)},ut={},dt=(e,t)=>{for(t===void 0&&V(`ptr should not be undefined`);e.baseClass;)t=e.upcast(t),e=e.baseClass;return t},ft=(e,t)=>(t=dt(e,t),ut[t]),pt=(e,t)=>((!t.ptrType||!t.ptr)&&Pe(`makeClassHandle requires ptr and ptrType`),!!t.smartPtrType!=!!t.smartPtr&&Pe(`Both smartPtrType and smartPtr must be specified`),t.count={value:1},U(Object.create(e,{$$:{value:t,writable:!0}})));function mt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var n=ft(this.registeredClass,t);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=t,n.$$.smartPtr=e,n.clone();var r=n.clone();return this.destructor(e),r}function i(){return this.isSmartPointer?pt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):pt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a=Ze[this.registeredClass.getActualType(t)];if(!a)return i.call(this);var o=this.isConst?a.constPointerType:a.pointerType,s=lt(t,this.registeredClass,o.registeredClass);return s===null?i.call(this):this.isSmartPointer?pt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:e}):pt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})}var ht=()=>{Object.assign(gt.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){var t;(t=this.rawDestructor)==null||t.call(this,e)},readValueFromPointer:P,fromWireType:mt})};function gt(e,t,n,r,i,a,o,s,c,l,u){this.name=e,this.registeredClass=t,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=a,this.sharingPolicy=o,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=u,!i&&t.baseClass===void 0?r?(this.toWireType=ot,this.destructorFunction=null):(this.toWireType=ct,this.destructorFunction=null):this.toWireType=st}var _t=(e,t,n)=>{i.hasOwnProperty(e)||Pe(`Replacing nonexistent public symbol`),i[e].overloadTable!==void 0&&n!==void 0?i[e].overloadTable[n]=t:(i[e]=t,i[e].argCount=n)},W={},vt=(e,t,n)=>{e=e.replace(/p/g,`i`);var r=W[e];return r(t,...n)},yt=[],G=e=>{var t=yt[e];return t||(yt[e]=t=Zn.get(e)),t},bt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(arguments.length>3&&arguments[3]!==void 0&&arguments[3],e.includes(`j`))return vt(e,t,n);var r=G(t)(...n);function i(e){return e}return i(r)},xt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function(){return bt(e,t,[...arguments],n)}},K=function(e,t){arguments.length>2&&arguments[2]!==void 0&&arguments[2],e=z(e);function n(){return e.includes(`j`)?xt(e,t):G(t)}var r=n();return typeof r!=`function`&&V(`unknown function pointer with signature ${e}: ${t}`),r};class St extends Error{}var Ct=e=>{var t=zn(e),n=z(t);return Z(t),n},wt=(e,t)=>{var n=[],r={};function i(e){if(!r[e]&&!I[e]){if(L[e]){L[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new St(`${e}: `+n.map(Ct).join([`, `]))},Tt=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{u=z(u),a=K(i,a),s&&(s=K(o,s)),l&&(l=K(c,l)),f=K(d,f);var p=nt(u);$e(p,function(){wt(`Cannot construct ${u} due to unbound types`,[r])}),R([e,t,n],r?[r]:[],t=>{t=t[0];var n,i;r?(n=t.registeredClass,i=n.instancePrototype):i=Ye.prototype;var o=Xe(u,function(){if(Object.getPrototypeOf(this)!==c)throw new B(`Use 'new' to construct ${u}`);if(d.constructor_body===void 0)throw new B(`${u} has no accessible constructor`);var e=[...arguments],t=d.constructor_body[e.length];if(t===void 0)throw new B(`Tried to invoke ctor of ${u} with invalid number of parameters (${e.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,e)}),c=Object.create(i,{constructor:{value:o}});o.prototype=c;var d=new rt(u,o,c,f,n,a,s,l);if(d.baseClass){var m;(m=d.baseClass).__derivedClasses!=null||(m.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d)}var h=new gt(u,d,!0,!1,!1),g=new gt(u+`*`,d,!1,!1,!1),_=new gt(u+` const*`,d,!1,!0,!1);return Ze[e]={pointerType:g,constPointerType:_},_t(p,o),[h,g,_]})},Et=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(w[t+r*4>>2]);return n};function Dt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Ot(e,t,n,r,i,a){var o=t.length;o<2&&V(`argTypes array size mismatch! Must at least get return value and 'this' types!`);var s=t[1]!==null&&n!==null,c=Dt(t),l=!t[0].isVoid,u=o-2,d=Array(u),f=[],p=[];return Xe(e,function(){p.length=0;var e;f.length=s?2:1,f[0]=i,s&&(e=t[1].toWireType(p,this),f[1]=e);for(var n=0;n<u;++n)d[n]=t[n+2].toWireType(p,n<0||arguments.length<=n?void 0:arguments[n]),f.push(d[n]);var a=r(...f);function o(n){if(c)N(p);else for(var r=s?1:2;r<t.length;r++){var i=r===1?e:d[r-2];t[r].destructorFunction!==null&&t[r].destructorFunction(i)}if(l)return t[0].fromWireType(n)}return o(a)})}var kt=(e,t,n,r,i,a)=>{var o=Et(t,n);i=K(r,i),R([],[e],e=>{e=e[0];var n=`constructor ${e.name}`;if(e.registeredClass.constructor_body===void 0&&(e.registeredClass.constructor_body=[]),e.registeredClass.constructor_body[t-1]!==void 0)throw new B(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[t-1]=()=>{wt(`Cannot construct ${e.name} due to unbound types`,o)},R([],o,r=>(r.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Ot(n,r,null,i,a),[])),[]})},At=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.slice(0,t)},jt=(e,t,n,r,i,a,o,s,c,l)=>{var u=Et(n,r);t=z(t),t=At(t),a=K(i,a,c),R([],[e],e=>{e=e[0];var r=`${e.name}.${t}`;t.startsWith(`@@`)&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);function i(){wt(`Cannot call ${r} due to unbound types`,u)}var l=e.registeredClass.instancePrototype,d=l[t];return d===void 0||d.overloadTable===void 0&&d.className!==e.name&&d.argCount===n-2?(i.argCount=n-2,i.className=e.name,l[t]=i):(Qe(l,t,r),l[t].overloadTable[n-2]=i),R([],u,i=>{var s=Ot(r,i,e,a,o,c);return l[t].overloadTable===void 0?(s.argCount=n-2,l[t]=s):l[t].overloadTable[n-2]=s,[]}),[]})},Mt=[],q=[0,1,,1,null,1,!0,1,!1,1],Nt=e=>{e>9&&--q[e+1]===0&&(q[e]=void 0,Mt.push(e))},J={toValue:e=>(e||V(`Cannot use deleted val. handle = ${e}`),q[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Mt.pop()||q.length;return q[t]=e,q[t+1]=1,t}}}},Pt={name:`emscripten::val`,fromWireType:e=>{var t=J.toValue(e);return Nt(e),t},toWireType:(e,t)=>J.toHandle(t),readValueFromPointer:P,destructorFunction:null},Ft=e=>H(e,Pt),It=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(me[e>>2])};case 8:return function(e){return this.fromWireType(he[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},Lt=(e,t,n)=>{t=z(t),H(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,readValueFromPointer:It(t,n),destructorFunction:null})},Rt=(e,t,n,r,i,a,o,s)=>{var c=Et(t,n);e=z(e),e=At(e),i=K(r,i,o),$e(e,function(){wt(`Cannot call ${e} due to unbound types`,c)},t-1),R([],c,n=>{var r=[n[0],null].concat(n.slice(1));return _t(e,Ot(e,r,null,i,a,o),t-1),[]})},zt=(e,t,n)=>{switch(t){case 1:return n?e=>S[e]:e=>T[e];case 2:return n?e=>b[e>>1]:e=>C[e>>1];case 4:return n?e=>x[e>>2]:e=>w[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},Bt=(e,t,n,r,i)=>{t=z(t);let a=r===0,o=e=>e;if(a){var s=32-8*n;o=e=>e<<s>>>s,i=o(i)}H(e,{name:t,fromWireType:o,toWireType:(e,t)=>t,readValueFromPointer:zt(t,n,r!==0),destructorFunction:null})},Vt=(e,t,n)=>{let r=(e,t)=>{let n=0;return{next(){if(n>=e)return{done:!0};let r=n;return n++,{value:t(r),done:!1}},[Symbol.iterator](){return this}}};e[Symbol.iterator]||(e[Symbol.iterator]=function(){return r(this[t](),e=>this[n](e))})},Ht=(e,t,n,r)=>{n=z(n),r=z(r),R([],[e,t],e=>{let t=e[0];return Vt(t.registeredClass.instancePrototype,n,r),[]})},Ut=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=w[e>>2],n=w[e+4>>2];return new r(S.buffer,n,t)}n=z(n),H(e,{name:n,fromWireType:i,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Wt=Object.assign({optional:!0},Pt),Gt=(e,t)=>{H(e,Wt)},Kt=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},Y=(e,t,n)=>Kt(e,T,t,n),qt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},Jt=globalThis.TextDecoder&&new TextDecoder,Yt=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},Xt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;var i=Yt(e,t,n,r);if(i-t>16&&e.buffer&&Jt)return Jt.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128)){a+=String.fromCharCode(o);continue}var s=e[t++]&63;if((o&224)==192){a+=String.fromCharCode((o&31)<<6|s);continue}var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return a},Zt=(e,t,n)=>e?Xt(T,e,t,n):``,Qt=(e,t)=>{t=z(t);var n=!0;H(e,{name:t,fromWireType(e){var t=w[e>>2],r=e+4,i;if(n)i=Zt(r,t,!0);else{i=``;for(var a=0;a<t;++a)i+=String.fromCharCode(T[r+a])}return Z(e),i},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT==1||V(`Cannot pass non-string to std::string`),r=n&&i?qt(t):t.length;var a=Bn(4+r+1),o=a+4;if(w[a>>2]=r,i)if(n)Y(t,o,r+1);else for(var s=0;s<r;++s){var c=t.charCodeAt(s);c>255&&(Z(a),V(`String has UTF-16 code units that do not fit in 8 bits`)),T[o+s]=c}else T.set(t,o);return e!==null&&e.push(Z,a),a},readValueFromPointer:P,destructorFunction(e){Z(e)}})},$t=globalThis.TextDecoder?new TextDecoder(`utf-16le`):void 0,en=(e,t,n)=>{var r=e>>1,i=Yt(C,r,t/2,n);if(i-r>16&&$t)return $t.decode(C.subarray(r,i));for(var a=``,o=r;o<i;++o){var s=C[o];a+=String.fromCharCode(s)}return a},tn=(e,t,n)=>{if(n!=null||(n=2147483647),n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);b[t>>1]=o,t+=2}return b[t>>1]=0,t-r},nn=e=>e.length*2,rn=(e,t,n)=>{for(var r=``,i=e>>2,a=0;!(a>=t/4);a++){var o=w[i+a];if(!o&&!n)break;r+=String.fromCodePoint(o)}return r},an=(e,t,n)=>{if(n!=null||(n=2147483647),n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.codePointAt(a);if(o>65535&&a++,x[t>>2]=o,t+=4,t+4>i)break}return x[t>>2]=0,t-r},on=e=>{for(var t=0,n=0;n<e.length;++n)e.codePointAt(n)>65535&&n++,t+=4;return t},sn=(e,t,n)=>{n=z(n);var r,i,a;t===2?(r=en,i=tn,a=nn):(r=rn,i=an,a=on),H(e,{name:n,fromWireType:e=>{var n=w[e>>2],i=r(e+4,n*t,!0);return Z(e),i},toWireType:(e,r)=>{typeof r!=`string`&&V(`Cannot pass non-string to C++ string type ${n}`);var o=a(r),s=Bn(4+o+t);return w[s>>2]=o/t,i(r,s+4,o+t),e!==null&&e.push(Z,s),s},readValueFromPointer:P,destructorFunction(e){Z(e)}})},cn=(e,t,n,r,i,a)=>{M[e]={name:z(t),rawConstructor:K(n,r),rawDestructor:K(i,a),fields:[]}},ln=(e,t,n,r,i,a,o,s,c,l)=>{M[e].fields.push({fieldName:z(t),getterReturnType:n,getter:K(r,i),getterContext:a,setterArgumentType:o,setter:K(s,c),setterContext:l})},un=(e,t)=>{t=z(t),H(e,{isVoid:!0,name:t,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},dn=[],fn=e=>{var t=dn.length;return dn.push(e),t},pn=(e,t)=>{var n=I[e];return n===void 0&&V(`${t} has unknown type ${Ct(e)}`),n},mn=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=pn(w[t+r*4>>2],`parameter ${r}`);return n},hn=(e,t,n)=>{var r=[],i=e(r,n);return r.length&&(w[t>>2]=J.toHandle(r)),i},gn={},_n=e=>{var t=gn[e];return t===void 0?z(e):t},vn=(e,t,n)=>{var r=8,[i,...a]=mn(e,t),o=i.toWireType.bind(i),s=a.map(e=>e.readValueFromPointer.bind(e));e--;var c=Array(e);return fn(Xe(`methodCaller<(${a.map(e=>e.name)}) => ${i.name}>`,(t,i,a,l)=>{for(var u=0,d=0;d<e;++d)c[d]=s[d](l+u),u+=r;var f;switch(n){case 0:f=J.toValue(t).apply(null,c);break;case 2:f=Reflect.construct(J.toValue(t),c);break;case 3:f=c[0];break;case 1:f=J.toValue(t)[_n(i)](...c);break}return hn(o,a,f)}))},yn=e=>e?(e=_n(e),J.toHandle(globalThis[e])):J.toHandle(globalThis),bn=e=>{e>9&&(q[e+1]+=1)},xn=(e,t,n,r,i)=>dn[e](t,n,r,i),Sn=e=>{N(J.toValue(e)),Nt(e)},Cn=(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);w[e>>2]=l*60,x[t>>2]=Number(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c<s?(Y(d,n,17),Y(f,r,17)):(Y(d,r,17),Y(f,n,17))},wn=()=>2147483648,Tn=(e,t)=>Math.ceil(e/t)*t,En=e=>{var t=(e-Xn.buffer.byteLength+65535)/65536|0;try{return Xn.grow(t),re(),1}catch{}},Dn=e=>{var t=T.length;e>>>=0;var n=wn();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),En(Math.min(n,Tn(Math.max(e,i),65536))))return!0}return!1},On={},kn=()=>c||`./this.program`,X=()=>{if(!X.strings){var e,t,n={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:((e=(t=globalThis.navigator)==null?void 0:t.language)==null?`C`:e).replace(`-`,`_`)+`.UTF-8`,_:kn()};for(var r in On)On[r]===void 0?delete n[r]:n[r]=On[r];var i=[];for(var r in n)i.push(`${r}=${n[r]}`);X.strings=i}return X.strings},An=(e,t)=>{var n=0,r=0;for(var i of X()){var a=t+n;w[e+r>>2]=a,n+=Y(i,a,1/0)+1,r+=4}return 0},jn=(e,t)=>{var n=X();w[e>>2]=n.length;var r=0;for(var i of n)r+=qt(i)+1;return w[t>>2]=r,0},Mn=e=>52,Nn=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function Pn(e,t,n,r,i){return Nn(t,n),70}var Fn=[null,[],[]],In=(e,t)=>{var n=Fn[e];t===0||t===10?((e===1?m:h)(Xt(n)),n.length=0):n.push(t)},Ln=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=w[t>>2],s=w[t+4>>2];t+=8;for(var c=0;c<s;c++)In(e,T[o+c]);i+=s}return w[r>>2]=i,0},Rn=e=>e;if(Je(),ht(),i.noExitRuntime&&i.noExitRuntime,i.print&&(m=i.print),i.printErr&&(h=i.printErr),i.wasmBinary&&(g=i.wasmBinary),i.arguments&&i.arguments,i.thisProgram&&(c=i.thisProgram),i.preInit)for(typeof i.preInit==`function`&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.shift()();var zn,Z,Bn,Vn,Q,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn;function Qn(e){zn=e.Ba,Z=i._free=e.Ca,Bn=i._malloc=e.Ea,Vn=e.Fa,Q=e.Ga,Hn=e.Ha,Un=e.Ia,Wn=e.Ja,Gn=e.Ka,Kn=e.La,qn=e.Ma,W.viijii=e.Na,Jn=W.iiijj=e.Oa,W.jiji=e.Pa,Yn=W.jiiii=e.Qa,W.iiiiij=e.Ra,W.iiiiijj=e.Sa,W.iiiiiijj=e.Ta,Xn=e.za,Zn=e.Da}var $n={s:xe,x:Se,a:Te,i:Ee,m:De,Q:Oe,q:ke,fa:Ae,d:je,ba:Me,wa:Fe,aa:Ie,qa:Re,ua:Tt,ta:kt,F:jt,oa:Ft,X:Lt,Y:Rt,A:Bt,sa:Ht,t:Ut,va:Gt,pa:Qt,S:sn,G:cn,xa:ln,ra:un,N:vn,ya:Nt,C:yn,T:bn,M:xn,ka:Sn,ca:Cn,ga:Dn,da:An,ea:jn,ha:Mn,_:Pn,V:Ln,ma:xr,K:wr,B:Dr,O:sr,U:Mr,p:yr,b:nr,D:Cr,ja:kr,c:ir,ia:Ar,h:or,j:pr,r:hr,P:Sr,w:_r,E:vr,L:br,I:Nr,$:Fr,Z:Ir,f:cr,l:er,e:rr,W:Tr,g:ar,J:jr,k:tr,la:Er,o:gr,y:ur,u:mr,R:fr,v:Or,n:lr,H:Pr,na:dr,z:Rn};function er(e,t){var n=D();try{G(e)(t)}catch(e){if(E(n),e!==e+0)throw e;Q(1,0)}}function tr(e,t,n,r,i){var a=D();try{G(e)(t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function nr(e,t){var n=D();try{return G(e)(t)}catch(e){if(E(n),e!==e+0)throw e;Q(1,0)}}function rr(e,t,n){var r=D();try{G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function ir(e,t,n){var r=D();try{return G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function ar(e,t,n,r){var i=D();try{G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function or(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function sr(e,t,n,r,i,a){var o=D();try{return G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function cr(e){var t=D();try{G(e)()}catch(e){if(E(t),e!==e+0)throw e;Q(1,0)}}function lr(e,t,n,r,i,a,o,s,c,l,u){var d=D();try{G(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(E(d),e!==e+0)throw e;Q(1,0)}}function ur(e,t,n,r,i,a,o){var s=D();try{G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function dr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){var _=D();try{G(e)(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}catch(e){if(E(_),e!==e+0)throw e;Q(1,0)}}function fr(e,t,n,r,i,a,o,s,c){var l=D();try{G(e)(t,n,r,i,a,o,s,c)}catch(e){if(E(l),e!==e+0)throw e;Q(1,0)}}function pr(e,t,n,r,i){var a=D();try{return G(e)(t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function mr(e,t,n,r,i,a,o,s){var c=D();try{G(e)(t,n,r,i,a,o,s)}catch(e){if(E(c),e!==e+0)throw e;Q(1,0)}}function hr(e,t,n,r,i,a){var o=D();try{return G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function gr(e,t,n,r,i,a){var o=D();try{G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function _r(e,t,n,r,i,a,o){var s=D();try{return G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function vr(e,t,n,r,i,a,o,s){var c=D();try{return G(e)(t,n,r,i,a,o,s)}catch(e){if(E(c),e!==e+0)throw e;Q(1,0)}}function yr(e){var t=D();try{return G(e)()}catch(e){if(E(t),e!==e+0)throw e;Q(1,0)}}function br(e,t,n,r,i,a,o,s,c){var l=D();try{return G(e)(t,n,r,i,a,o,s,c)}catch(e){if(E(l),e!==e+0)throw e;Q(1,0)}}function xr(e,t,n){var r=D();try{return G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function Sr(e,t,n,r,i,a,o){var s=D();try{return G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function Cr(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function wr(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function Tr(e,t,n,r,i,a,o,s,c){var l=D();try{G(e)(t,n,r,i,a,o,s,c)}catch(e){if(E(l),e!==e+0)throw e;Q(1,0)}}function Er(e,t,n,r,i,a,o,s){var c=D();try{G(e)(t,n,r,i,a,o,s)}catch(e){if(E(c),e!==e+0)throw e;Q(1,0)}}function Dr(e,t,n,r,i,a){var o=D();try{return G(e)(t,n,r,i,a)}catch(e){if(E(o),e!==e+0)throw e;Q(1,0)}}function Or(e,t,n,r,i,a,o,s,c,l){var u=D();try{G(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(E(u),e!==e+0)throw e;Q(1,0)}}function kr(e,t,n){var r=D();try{return G(e)(t,n)}catch(e){if(E(r),e!==e+0)throw e;Q(1,0)}}function Ar(e,t,n,r,i){var a=D();try{return G(e)(t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function jr(e,t,n,r,i,a,o){var s=D();try{G(e)(t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function Mr(e,t,n,r){var i=D();try{return G(e)(t,n,r)}catch(e){if(E(i),e!==e+0)throw e;Q(1,0)}}function Nr(e,t,n,r,i,a,o,s,c,l,u,d){var f=D();try{return G(e)(t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(E(f),e!==e+0)throw e;Q(1,0)}}function Pr(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=D();try{G(e)(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}catch(e){if(E(g),e!==e+0)throw e;Q(1,0)}}function Fr(e,t,n,r,i,a,o){var s=D();try{return Jn(e,t,n,r,i,a,o)}catch(e){if(E(s),e!==e+0)throw e;Q(1,0)}}function Ir(e,t,n,r,i){var a=D();try{return Yn(e,t,n,r,i)}catch(e){if(E(a),e!==e+0)throw e;Q(1,0)}}function Lr(){v();function e(){var e,t;i.calledRun=!0,!_&&(ie(),(e=ee)==null||e(i),(t=i.onRuntimeInitialized)==null||t.call(i),ae())}i.setStatus?(i.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>i.setStatus(``),1),e()},1)):e()}var $=await pe();return Lr(),t=ne?i:new Promise((e,t)=>{ee=e,te=t}),t}function le(e){return ae(ce,e)}function ue(){return oe(ce)}function de(e){le({overrides:e,equalityFn:Object.is,fireImmediately:!1})}async function fe(e,t){return se(ce,e,t)}var pe=`98106d24a9bc2c4a24a6e6864e0f5729bd68cf73d6f5b45bb1c824521146370c`,b=[[`aztec`,`Aztec`],[`aztec_code`,`AztecCode`],[`aztec_rune`,`AztecRune`],[`code_128`,`Code128`],[`code_39`,`Code39`],[`code_39_standard`,`Code39Std`],[`code_39_extended`,`Code39Ext`],[`code_32`,`Code32`],[`pzn`,`PZN`],[`code_93`,`Code93`],[`codabar`,`Codabar`],[`databar`,`DataBar`],[`databar_omni`,`DataBarOmni`],[`databar_stacked`,`DataBarStk`],[`databar_stacked_omni`,`DataBarStkOmni`],[`databar_expanded`,`DataBarExp`],[`databar_expanded_stacked`,`DataBarExpStk`],[`databar_limited`,`DataBarLtd`],[`data_matrix`,`DataMatrix`],[`dx_film_edge`,`DXFilmEdge`],[`ean_13`,`EAN13`],[`ean_upc`,`EANUPC`],[`isbn`,`ISBN`],[`ean_8`,`EAN8`],[`itf`,`ITF`],[`itf_14`,`ITF14`],[`maxi_code`,`MaxiCode`],[`micro_qr_code`,`MicroQRCode`],[`pdf417`,`PDF417`],[`compact_pdf417`,`CompactPDF417`],[`qr_code`,`QRCode`],[`qr_code_model_1`,`QRCodeModel1`],[`qr_code_model_2`,`QRCodeModel2`],[`rm_qr_code`,`RMQRCode`],[`upc_a`,`UPCA`],[`upc_e`,`UPCE`],[`other_barcode`,`OtherBarcode`],[`linear_codes`,`AllLinear`],[`matrix_codes`,`AllMatrix`],[`gs1_codes`,`AllGS1`],[`retail_codes`,`AllRetail`],[`industrial_codes`,`AllIndustrial`],[`any`,`All`]],x=[...b,[`unknown`]].map(e=>e[0]),S=new Map(b);function me(e){for(let[t,n]of S)if(e===n)return t;return`unknown`}function he(e){if(C(e))return{width:e.naturalWidth,height:e.naturalHeight};if(w(e))return{width:e.width.baseVal.value,height:e.height.baseVal.value};if(T(e))return{width:e.videoWidth,height:e.videoHeight};if(_e(e))return{width:e.width,height:e.height};if(ye(e))return{width:e.displayWidth,height:e.displayHeight};if(ge(e)||ve(e))return{width:e.width,height:e.height};throw 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 C(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLImageElement)}catch{return!1}}function w(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.SVGImageElement)}catch{return!1}}function T(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLVideoElement)}catch{return!1}}function ge(e){try{var t;return e instanceof(e==null||(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.HTMLCanvasElement)}catch{return!1}}function _e(e){try{return e instanceof ImageBitmap||Object.prototype.toString.call(e)===`[object ImageBitmap]`}catch{return!1}}function ve(e){try{return e instanceof OffscreenCanvas||Object.prototype.toString.call(e)===`[object OffscreenCanvas]`}catch{return!1}}function ye(e){try{return e instanceof VideoFrame||Object.prototype.toString.call(e)===`[object VideoFrame]`}catch{return!1}}function be(e){try{return e instanceof Blob||Object.prototype.toString.call(e)===`[object Blob]`}catch{return!1}}function E(e){try{return e instanceof ImageData||Object.prototype.toString.call(e)===`[object ImageData]`}catch{return!1}}function D(e,t){try{let n=new OffscreenCanvas(e,t);if(n.getContext(`2d`)instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{let n=document.createElement(`canvas`);return n.width=e,n.height=t,n}}async function O(e){if(C(e)&&!await Se(e))throw new DOMException(`Failed to load or decode HTMLImageElement.`,`InvalidStateError`);if(w(e)&&!await Ce(e))throw new DOMException(`Failed to load or decode SVGImageElement.`,`InvalidStateError`);if(ye(e)&&j(e))throw new DOMException(`VideoFrame is closed.`,`InvalidStateError`);if(T(e)&&(e.readyState===0||e.readyState===1))throw new DOMException(`Invalid element or state.`,`InvalidStateError`);if(_e(e)&&Te(e))throw new DOMException(`The image source is detached.`,`InvalidStateError`);let{width:t,height:n}=he(e);if(t===0||n===0)return null;let r=D(t,n).getContext(`2d`);r.drawImage(e,0,0);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function k(e){let t;try{t=await createImageBitmap(e)}catch{try{if(globalThis.Image){t=new Image;let n=``;try{n=URL.createObjectURL(e),t.src=n,await t.decode()}finally{URL.revokeObjectURL(n)}}else return e}catch{throw new DOMException(`Failed to load or decode Blob.`,`InvalidStateError`)}}return await O(t)}function xe(e){let{width:t,height:n}=e;if(t===0||n===0)return null;let r=e.getContext(`2d`);try{return r.getImageData(0,0,t,n)}catch{throw new DOMException(`Source would taint origin.`,`SecurityError`)}}async function A(e){if(be(e))return await k(e);if(E(e)){if(we(e))throw new DOMException(`The image data has been detached.`,`InvalidStateError`);return e}return ge(e)||ve(e)?xe(e):await O(e)}async function Se(e){try{return await e.decode(),!0}catch{return!1}}async function Ce(e){try{var t;return await((t=e.decode)==null?void 0:t.call(e)),!0}catch{return!1}}function j(e){return e.format===null}function we(e){return e.data.buffer.byteLength===0}function Te(e){return e.width===0&&e.height===0}function Ee(e,t){return De(e)?new DOMException(`${t}: ${e.message}`,e.name):Oe(e)?new e.constructor(`${t}: ${e.message}`):Error(`${t}: ${e}`)}function De(e){return e instanceof DOMException||Object.prototype.toString.call(e)===`[object DOMException]`}function Oe(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function ke(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function Ae(e,t,n){ke(e,t),t.set(e,n)}function je(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function Me(e,t,n){return e.set(je(e,t),n),n}function M(e,t){return e.get(je(e,t))}var N=new WeakMap,P=class{constructor(e={}){Ae(this,N,void 0);try{var t;let n=e==null||(t=e.formats)==null?void 0:t.filter(e=>e!==`unknown`);if((n==null?void 0:n.length)===0)throw TypeError(`Hint option provided, but is empty.`);for(let e of n==null?[]:n)if(!S.has(e))throw TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${e}' is not a valid enum value of type BarcodeFormat.`);Me(N,this,n==null?[]:n),le({fireImmediately:!0}).catch(()=>{})}catch(e){throw Ee(e,`Failed to construct 'BarcodeDetector'`)}}static async getSupportedFormats(){return x.filter(e=>e!==`unknown`)}async detect(e){try{let t=await A(e);if(t===null)return[];let n,r={textMode:`Plain`,formats:M(N,this).map(e=>S.get(e))};try{n=await fe(t,r)}catch(e){throw console.error(e),new DOMException(`Barcode detection service unavailable.`,`NotSupportedError`)}return n.map(e=>{let{topLeft:{x:t,y:n},topRight:{x:r,y:i},bottomLeft:{x:a,y:o},bottomRight:{x:s,y:c}}=e.position,l=Math.min(t,r,a,s),u=Math.min(n,i,o,c),d=Math.max(t,r,a,s),f=Math.max(n,i,o,c);return{boundingBox:new DOMRectReadOnly(l,u,d-l,f-u),rawValue:e.text,format:me(e.format),cornerPoints:[{x:t,y:n},{x:r,y:i},{x:s,y:c},{x:a,y:o}]}})}catch(e){throw Ee(e,`Failed to execute 'detect' on 'BarcodeDetector'`)}}},F;return(F=globalThis).BarcodeDetector!=null||(F.BarcodeDetector=P),e.ZXING_CPP_COMMIT=ne,e.ZXING_WASM_SHA256=pe,e.ZXING_WASM_VERSION=te,e.prepareZXingModule=le,e.purgeZXingModule=ue,e.setZXingModuleOverrides=de,e})({});
|