ckgl/node_modules/zxing-wasm/dist/iife/writer/index.js
2024-12-21 18:03:43 +08:00

3 lines
23 KiB
JavaScript

var ZXingWASM=function(F){"use strict";var fr=(()=>{var d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(_={}){var o=_,D,S;o.ready=new Promise((r,e)=>{D=r,S=e});var j=Object.assign({},o),Cr=typeof window=="object",tr=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var W="";function pe(r){return o.locateFile?o.locateFile(r,W):W+r}var vr;(Cr||tr)&&(tr?W=self.location.href:typeof document<"u"&&document.currentScript&&(W=document.currentScript.src),d&&(W=d),W.indexOf("blob:")!==0?W=W.substr(0,W.replace(/[?#].*/,"").lastIndexOf("/")+1):W="",tr&&(vr=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)})),o.print||console.log.bind(console);var Q=o.printErr||console.error.bind(console);Object.assign(o,j),j=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram,o.quit&&o.quit;var G;o.wasmBinary&&(G=o.wasmBinary),typeof WebAssembly!="object"&&dr("no native wasm support detected");var nr,Er=!1,M,b,Z,J,H,p,Rr,Fr;function Pr(){var r=nr.buffer;o.HEAP8=M=new Int8Array(r),o.HEAP16=Z=new Int16Array(r),o.HEAPU8=b=new Uint8Array(r),o.HEAPU16=J=new Uint16Array(r),o.HEAP32=H=new Int32Array(r),o.HEAPU32=p=new Uint32Array(r),o.HEAPF32=Rr=new Float32Array(r),o.HEAPF64=Fr=new Float64Array(r)}var Sr=[],Wr=[],Ir=[];function ge(){if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)be(o.preRun.shift());_r(Sr)}function me(){_r(Wr)}function ye(){if(o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;)Te(o.postRun.shift());_r(Ir)}function be(r){Sr.unshift(r)}function we(r){Wr.unshift(r)}function Te(r){Ir.unshift(r)}var B=0,K=null;function Ae(r){var e;B++,(e=o.monitorRunDependencies)===null||e===void 0||e.call(o,B)}function $e(r){var e;if(B--,(e=o.monitorRunDependencies)===null||e===void 0||e.call(o,B),B==0&&K){var t=K;K=null,t()}}function dr(r){var e;(e=o.onAbort)===null||e===void 0||e.call(o,r),r="Aborted("+r+")",Q(r),Er=!0,r+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(r);throw S(t),t}var Ce="data:application/octet-stream;base64,",kr=r=>r.startsWith(Ce),L;L="zxing_writer.wasm",kr(L)||(L=pe(L));function Or(r){if(r==L&&G)return new Uint8Array(G);if(vr)return vr(r);throw"both async and sync fetching of the wasm failed"}function Ee(r){return!G&&(Cr||tr)&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+r+"'";return e.arrayBuffer()}).catch(()=>Or(r)):Promise.resolve().then(()=>Or(r))}function Ur(r,e,t){return Ee(r).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(t,n=>{Q(`failed to asynchronously prepare wasm: ${n}`),dr(n)})}function Re(r,e,t,n){return!r&&typeof WebAssembly.instantiateStreaming=="function"&&!kr(e)&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(a=>{var i=WebAssembly.instantiateStreaming(a,t);return i.then(n,function(s){return Q(`wasm streaming compile failed: ${s}`),Q("falling back to ArrayBuffer instantiation"),Ur(e,t,n)})}):Ur(e,t,n)}function Fe(){var r={a:Lt};function e(n,a){return y=n.exports,nr=y.R,Pr(),Nr=y.V,we(y.S),$e(),y}Ae();function t(n){e(n.instance)}if(o.instantiateWasm)try{return o.instantiateWasm(r,e)}catch(n){Q(`Module.instantiateWasm callback failed with error: ${n}`),S(n)}return Re(G,L,r,t).catch(S),{}}var _r=r=>{for(;r.length>0;)r.shift()(o)};o.noExitRuntime;var Mr=[],Pe=r=>{var e=new hr(r);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),Mr.push(e),zr(e.excPtr),e.get_exception_ptr()},V=0,Se=()=>{$(0,0);var r=Mr.pop();Yr(r.excPtr),V=0};function hr(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,M[this.ptr+12>>0]=e},this.get_caught=function(){return M[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,M[this.ptr+13>>0]=e},this.get_rethrown=function(){return M[this.ptr+13>>0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){var e=ee(this.get_type());if(e)return p[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var We=r=>{throw V||(V=r),V},pr=r=>{var e=V;if(!e)return z(0),0;var t=new hr(e);t.set_adjusted_ptr(e);var n=t.get_type();if(!n)return z(0),e;for(var a in r){var i=r[a];if(i===0||i===n)break;var s=t.ptr+16;if(re(i,n,s))return z(i),e}return z(n),e},Ie=()=>pr([]),ke=r=>pr([r]),Oe=(r,e)=>pr([r,e]),Ue=(r,e,t)=>{var n=new hr(r);throw n.init(e,t),V=r,V},ar={},gr=r=>{for(;r.length;){var e=r.pop(),t=r.pop();t(e)}};function mr(r){return this.fromWireType(H[r>>2])}var N={},x={},ir={},Dr,jr=r=>{throw new Dr(r)},Hr=(r,e,t)=>{r.forEach(function(u){ir[u]=e});function n(u){var c=t(u);c.length!==r.length&&jr("Mismatched type converter count");for(var f=0;f<r.length;++f)I(r[f],c[f])}var a=new Array(e.length),i=[],s=0;e.forEach((u,c)=>{x.hasOwnProperty(u)?a[c]=x[u]:(i.push(u),N.hasOwnProperty(u)||(N[u]=[]),N[u].push(()=>{a[c]=x[u],++s,s===i.length&&n(a)}))}),i.length===0&&n(a)},Me=r=>{var e=ar[r];delete ar[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));Hr([r],i,s=>{var u={};return a.forEach((c,f)=>{var l=c.fieldName,v=s[f],g=c.getter,h=c.getterContext,U=s[f+a.length],P=c.setter,w=c.setterContext;u[l]={read:rr=>v.fromWireType(g(h,rr)),write:(rr,Tr)=>{var cr=[];P(w,rr,U.toWireType(cr,Tr)),gr(cr)}}}),[{name:e.name,fromWireType:c=>{var f={};for(var l in u)f[l]=u[l].read(c);return n(c),f},toWireType:(c,f)=>{for(var l in u)if(!(l in f))throw new TypeError(`Missing field: "${l}"`);var v=t();for(l in u)u[l].write(v,f[l]);return c!==null&&c.push(n,v),v},argPackAdvance:k,readValueFromPointer:mr,destructorFunction:n}]})},De=(r,e,t,n,a)=>{},je=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);Br=r},Br,m=r=>{for(var e="",t=r;b[t];)e+=Br[b[t++]];return e},Vr,T=r=>{throw new Vr(r)};function He(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=e.name;if(r||T(`type "${n}" must have a positive integer typeid pointer`),x.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;T(`Cannot register type '${n}' twice`)}if(x[r]=e,delete ir[r],N.hasOwnProperty(r)){var a=N[r];delete N[r],a.forEach(i=>i())}}function I(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return He(r,e,t)}var k=8,Be=(r,e,t,n)=>{e=m(e),I(r,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?t:n},argPackAdvance:k,readValueFromPointer:function(a){return this.fromWireType(b[a])},destructorFunction:null})};function Ve(){Object.assign(xr.prototype,{get(r){return this.allocated[r]},has(r){return this.allocated[r]!==void 0},allocate(r){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=r,e},free(r){this.allocated[r]=void 0,this.freelist.push(r)}})}function xr(){this.allocated=[void 0],this.freelist=[]}var C=new xr,yr=r=>{r>=C.reserved&&--C.get(r).refcount===0&&C.free(r)},xe=()=>{for(var r=0,e=C.reserved;e<C.allocated.length;++e)C.allocated[e]!==void 0&&++r;return r},Xe=()=>{C.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),C.reserved=C.allocated.length,o.count_emval_handles=xe},X={toValue:r=>(r||T("Cannot use deleted val. handle = "+r),C.get(r).value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return C.allocate({refcount:1,value:r})}}},Ze=(r,e)=>{e=m(e),I(r,{name:e,fromWireType:t=>{var n=X.toValue(t);return yr(t),n},toWireType:(t,n)=>X.toHandle(n),argPackAdvance:k,readValueFromPointer:mr,destructorFunction:null})},Le=(r,e,t)=>{if(r[e].overloadTable===void 0){var n=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||T(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Xr=(r,e,t)=>{o.hasOwnProperty(r)?((t===void 0||o[r].overloadTable!==void 0&&o[r].overloadTable[t]!==void 0)&&T(`Cannot register public name '${r}' twice`),Le(o,r,r),o.hasOwnProperty(t)&&T(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),o[r].overloadTable[t]=e):(o[r]=e,t!==void 0&&(o[r].numArguments=t))},Ne=(r,e,t)=>{switch(e){case 1:return t?function(n){return this.fromWireType(M[n>>0])}:function(n){return this.fromWireType(b[n>>0])};case 2:return t?function(n){return this.fromWireType(Z[n>>1])}:function(n){return this.fromWireType(J[n>>1])};case 4:return t?function(n){return this.fromWireType(H[n>>2])}:function(n){return this.fromWireType(p[n>>2])};default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},qe=(r,e,t,n)=>{e=m(e);function a(){}a.values={},I(r,{name:e,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:(i,s)=>s.value,argPackAdvance:k,readValueFromPointer:Ne(e,t,n),destructorFunction:null}),Xr(e,a)},or=(r,e)=>Object.defineProperty(e,"name",{value:r}),Zr=r=>{var e=Kr(r),t=m(e);return O(e),t},Lr=(r,e)=>{var t=x[r];return t===void 0&&T(e+" has unknown type "+Zr(r)),t},Qe=(r,e,t)=>{var n=Lr(r,"enum");e=m(e);var a=n.constructor,i=Object.create(n.constructor.prototype,{value:{value:t},constructor:{value:or(`${n.name}_${e}`,function(){})}});a.values[t]=i,a[e]=i},Ge=(r,e)=>{switch(e){case 4:return function(t){return this.fromWireType(Rr[t>>2])};case 8:return function(t){return this.fromWireType(Fr[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Je=(r,e,t)=>{e=m(e),I(r,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:k,readValueFromPointer:Ge(e,t),destructorFunction:null})};function Ke(r){for(var e=1;e<r.length;++e)if(r[e]!==null&&r[e].destructorFunction===void 0)return!0;return!1}function Ye(r,e,t,n,a,i){var s=e.length;s<2&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var u=e[1]!==null&&t!==null,c=Ke(e),f=e[0].name!=="void",l=s-2,v=new Array(l),g=[],h=[],U=function(){arguments.length!==l&&T(`function ${r} called with ${arguments.length} arguments, expected ${l}`),h.length=0;var P;g.length=u?2:1,g[0]=a,u&&(P=e[1].toWireType(h,this),g[1]=P);for(var w=0;w<l;++w)v[w]=e[w+2].toWireType(h,arguments[w]),g.push(v[w]);var rr=n.apply(null,g);function Tr(cr){if(c)gr(h);else for(var q=u?1:2;q<e.length;q++){var nn=q===1?P:v[q-2];e[q].destructorFunction!==null&&e[q].destructorFunction(nn)}if(f)return e[0].fromWireType(cr)}return Tr(rr)};return or(r,U)}var ze=(r,e)=>{for(var t=[],n=0;n<r;n++)t.push(p[e+n*4>>2]);return t},rt=(r,e,t)=>{o.hasOwnProperty(r)||jr("Replacing nonexistant public symbol"),o[r].overloadTable!==void 0&&t!==void 0?o[r].overloadTable[t]=e:(o[r]=e,o[r].argCount=t)},et=(r,e,t)=>{var n=o["dynCall_"+r];return t&&t.length?n.apply(null,[e].concat(t)):n.call(null,e)},sr=[],Nr,A=r=>{var e=sr[r];return e||(r>=sr.length&&(sr.length=r+1),sr[r]=e=Nr.get(r)),e},tt=(r,e,t)=>{if(r.includes("j"))return et(r,e,t);var n=A(e).apply(null,t);return n},nt=(r,e)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),tt(r,e,t)}},Y=(r,e)=>{r=m(r);function t(){return r.includes("j")?nt(r,e):A(e)}var n=t();return typeof n!="function"&&T(`unknown function pointer with signature ${r}: ${e}`),n},at=(r,e)=>{var t=or(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
`+a.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},qr,it=(r,e)=>{var t=[],n={};function a(i){if(!n[i]&&!x[i]){if(ir[i]){ir[i].forEach(a);return}t.push(i),n[i]=!0}}throw e.forEach(a),new qr(`${r}: `+t.map(Zr).join([", "]))},ot=r=>{r=r.trim();const e=r.indexOf("(");return e!==-1?r.substr(0,e):r},st=(r,e,t,n,a,i,s)=>{var u=ze(e,t);r=m(r),r=ot(r),a=Y(n,a),Xr(r,function(){it(`Cannot call ${r} due to unbound types`,u)},e-1),Hr([],u,function(c){var f=[c[0],null].concat(c.slice(1));return rt(r,Ye(r,f,null,a,i),e-1),[]})},ut=(r,e,t)=>{switch(e){case 1:return t?n=>M[n>>0]:n=>b[n>>0];case 2:return t?n=>Z[n>>1]:n=>J[n>>1];case 4:return t?n=>H[n>>2]:n=>p[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},ct=(r,e,t,n,a)=>{e=m(e);var i=l=>l;if(n===0){var s=32-8*t;i=l=>l<<s>>>s}var u=e.includes("unsigned"),c=(l,v)=>{},f;u?f=function(l,v){return c(v,this.name),v>>>0}:f=function(l,v){return c(v,this.name),v},I(r,{name:e,fromWireType:i,toWireType:f,argPackAdvance:k,readValueFromPointer:ut(e,t,n!==0),destructorFunction:null})},ft=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(s){var u=p[s>>2],c=p[s+4>>2];return new a(M.buffer,c,u)}t=m(t),I(r,{name:t,fromWireType:i,argPackAdvance:k,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})};function lt(r){return this.fromWireType(p[r>>2])}var vt=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,i=t+n-1,s=0;s<r.length;++s){var u=r.charCodeAt(s);if(u>=55296&&u<=57343){var c=r.charCodeAt(++s);u=65536+((u&1023)<<10)|c&1023}if(u<=127){if(t>=i)break;e[t++]=u}else if(u<=2047){if(t+1>=i)break;e[t++]=192|u>>6,e[t++]=128|u&63}else if(u<=65535){if(t+2>=i)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|u&63}else{if(t+3>=i)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|u&63}}return e[t]=0,t-a},dt=(r,e,t)=>vt(r,b,e,t),_t=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},Qr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,ht=(r,e,t)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Qr)return Qr.decode(r.subarray(e,a));for(var i="";e<a;){var s=r[e++];if(!(s&128)){i+=String.fromCharCode(s);continue}var u=r[e++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|u);continue}var c=r[e++]&63;if((s&240)==224?s=(s&15)<<12|u<<6|c:s=(s&7)<<18|u<<12|c<<6|r[e++]&63,s<65536)i+=String.fromCharCode(s);else{var f=s-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},pt=(r,e)=>r?ht(b,r,e):"",gt=(r,e)=>{e=m(e);var t=e==="std::string";I(r,{name:e,fromWireType(n){var a=p[n>>2],i=n+4,s;if(t)for(var u=i,c=0;c<=a;++c){var f=i+c;if(c==a||b[f]==0){var l=f-u,v=pt(u,l);s===void 0?s=v:(s+="\0",s+=v),u=f+1}}else{for(var g=new Array(a),c=0;c<a;++c)g[c]=String.fromCharCode(b[i+c]);s=g.join("")}return O(n),s},toWireType(n,a){a instanceof ArrayBuffer&&(a=new Uint8Array(a));var i,s=typeof a=="string";s||a instanceof Uint8Array||a instanceof Uint8ClampedArray||a instanceof Int8Array||T("Cannot pass non-string to std::string"),t&&s?i=_t(a):i=a.length;var u=wr(4+i+1),c=u+4;if(p[u>>2]=i,t&&s)dt(a,c,i+1);else if(s)for(var f=0;f<i;++f){var l=a.charCodeAt(f);l>255&&(O(c),T("String has UTF-16 code units that do not fit in 8 bits")),b[c+f]=l}else for(var f=0;f<i;++f)b[c+f]=a[f];return n!==null&&n.push(O,u),u},argPackAdvance:k,readValueFromPointer:lt,destructorFunction(n){O(n)}})},Gr=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,mt=(r,e)=>{for(var t=r,n=t>>1,a=n+e/2;!(n>=a)&&J[n];)++n;if(t=n<<1,t-r>32&&Gr)return Gr.decode(b.subarray(r,t));for(var i="",s=0;!(s>=e/2);++s){var u=Z[r+s*2>>1];if(u==0)break;i+=String.fromCharCode(u)}return i},yt=(r,e,t)=>{var n;if((n=t)!==null&&n!==void 0||(t=2147483647),t<2)return 0;t-=2;for(var a=e,i=t<r.length*2?t/2:r.length,s=0;s<i;++s){var u=r.charCodeAt(s);Z[e>>1]=u,e+=2}return Z[e>>1]=0,e-a},bt=r=>r.length*2,wt=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var a=H[r+t*4>>2];if(a==0)break;if(++t,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},Tt=(r,e,t)=>{var n;if((n=t)!==null&&n!==void 0||(t=2147483647),t<4)return 0;for(var a=e,i=a+t-4,s=0;s<r.length;++s){var u=r.charCodeAt(s);if(u>=55296&&u<=57343){var c=r.charCodeAt(++s);u=65536+((u&1023)<<10)|c&1023}if(H[e>>2]=u,e+=4,e+4>i)break}return H[e>>2]=0,e-a},At=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},$t=(r,e,t)=>{t=m(t);var n,a,i,s,u;e===2?(n=mt,a=yt,s=bt,i=()=>J,u=1):e===4&&(n=wt,a=Tt,s=At,i=()=>p,u=2),I(r,{name:t,fromWireType:c=>{for(var f=p[c>>2],l=i(),v,g=c+4,h=0;h<=f;++h){var U=c+4+h*e;if(h==f||l[U>>u]==0){var P=U-g,w=n(g,P);v===void 0?v=w:(v+="\0",v+=w),g=U+e}}return O(c),v},toWireType:(c,f)=>{typeof f!="string"&&T(`Cannot pass non-string to C++ string type ${t}`);var l=s(f),v=wr(4+l+e);return p[v>>2]=l>>u,a(f,v+4,l+e),c!==null&&c.push(O,v),v},argPackAdvance:k,readValueFromPointer:mr,destructorFunction(c){O(c)}})},Ct=(r,e,t,n,a,i)=>{ar[r]={name:m(e),rawConstructor:Y(t,n),rawDestructor:Y(a,i),fields:[]}},Et=(r,e,t,n,a,i,s,u,c,f)=>{ar[r].fields.push({fieldName:m(e),getterReturnType:t,getter:Y(n,a),getterContext:i,setterArgumentType:s,setter:Y(u,c),setterContext:f})},Rt=(r,e)=>{e=m(e),I(r,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},br=[],Ft=(r,e,t,n)=>(r=br[r],e=X.toValue(e),r(null,e,t,n)),Pt={},St=r=>{var e=Pt[r];return e===void 0?m(r):e},Jr=()=>{if(typeof globalThis=="object")return globalThis;function r(e){e.$$$embind_global$$$=e;var t=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&r(global)?$$$embind_global$$$=global:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},Wt=r=>r===0?X.toHandle(Jr()):(r=St(r),X.toHandle(Jr()[r])),It=r=>{var e=br.length;return br.push(r),e},kt=(r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=Lr(p[e+n*4>>2],"parameter "+n);return t},Ot=Reflect.construct,Ut=(r,e,t)=>{var n=[],a=r.toWireType(n,t);return n.length&&(p[e>>2]=X.toHandle(n)),a},Mt=(r,e,t)=>{var n=kt(r,e),a=n.shift();r--;var i=new Array(r),s=(c,f,l,v)=>{for(var g=0,h=0;h<r;++h)i[h]=n[h].readValueFromPointer(v+g),g+=n[h].argPackAdvance;for(var U=t===1?Ot(f,i):f.apply(c,i),h=0;h<r;++h){var P,w;(P=(w=n[h]).deleteObject)===null||P===void 0||P.call(w,i[h])}return Ut(a,l,U)},u=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${a.name}>`;return It(or(u,s))},Dt=r=>{r>4&&(C.get(r).refcount+=1)},jt=r=>{var e=X.toValue(r);gr(e),yr(r)},Ht=()=>{dr("")},Bt=(r,e,t)=>b.copyWithin(r,e,e+t),Vt=()=>2147483648,xt=r=>{var e=nr.buffer,t=(r-e.byteLength+65535)/65536;try{return nr.grow(t),Pr(),1}catch{}},Xt=r=>{var e=b.length;r>>>=0;var t=Vt();if(r>t)return!1;for(var n=(c,f)=>c+(f-c%f)%f,a=1;a<=4;a*=2){var i=e*(1+.2/a);i=Math.min(i,r+100663296);var s=Math.min(t,n(Math.max(r,i),65536)),u=xt(s);if(u)return!0}return!1},Zt=r=>r;Dr=o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},je(),Vr=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Ve(),Xe(),qr=o.UnboundTypeError=at(Error,"UnboundTypeError");var Lt={r:Pe,q:Se,g:Ie,d:ke,k:Oe,a:Ue,i:We,M:Me,C:De,H:Be,G:Ze,K:qe,b:Qe,v:Je,L:st,h:ct,e:ft,u:gt,p:$t,w:Ct,N:Et,I:Rt,z:Ft,P:yr,B:Wt,A:Mt,x:Dt,Q:jt,s:Ht,F:Bt,E:Xt,y:Kt,c:Nt,l:Yt,n:Jt,o:zt,f:qt,t:tn,m:en,D:Gt,J:Qt,j:rn,O:Zt},y=Fe(),wr=o._malloc=r=>(wr=o._malloc=y.T)(r),O=o._free=r=>(O=o._free=y.U)(r),Kr=r=>(Kr=y.W)(r),$=(r,e)=>($=y.X)(r,e),z=r=>(z=y.Y)(r),E=()=>(E=y.Z)(),R=r=>(R=y._)(r),Yr=r=>(Yr=y.$)(r),zr=r=>(zr=y.aa)(r),re=(r,e,t)=>(re=y.ba)(r,e,t),ee=r=>(ee=y.ca)(r);function Nt(r,e){var t=E();try{return A(r)(e)}catch(n){if(R(t),n!==n+0)throw n;$(1,0)}}function qt(r,e){var t=E();try{A(r)(e)}catch(n){if(R(t),n!==n+0)throw n;$(1,0)}}function Qt(r,e,t,n,a,i){var s=E();try{A(r)(e,t,n,a,i)}catch(u){if(R(s),u!==u+0)throw u;$(1,0)}}function Gt(r,e,t,n,a){var i=E();try{A(r)(e,t,n,a)}catch(s){if(R(i),s!==s+0)throw s;$(1,0)}}function Jt(r,e,t,n){var a=E();try{return A(r)(e,t,n)}catch(i){if(R(a),i!==i+0)throw i;$(1,0)}}function Kt(r,e,t,n,a){var i=E();try{return A(r)(e,t,n,a)}catch(s){if(R(i),s!==s+0)throw s;$(1,0)}}function Yt(r,e,t){var n=E();try{return A(r)(e,t)}catch(a){if(R(n),a!==a+0)throw a;$(1,0)}}function zt(r){var e=E();try{A(r)()}catch(t){if(R(e),t!==t+0)throw t;$(1,0)}}function rn(r,e,t,n,a,i,s,u,c,f,l){var v=E();try{A(r)(e,t,n,a,i,s,u,c,f,l)}catch(g){if(R(v),g!==g+0)throw g;$(1,0)}}function en(r,e,t,n){var a=E();try{A(r)(e,t,n)}catch(i){if(R(a),i!==i+0)throw i;$(1,0)}}function tn(r,e,t){var n=E();try{A(r)(e,t)}catch(a){if(R(n),a!==a+0)throw a;$(1,0)}}var ur;K=function r(){ur||te(),ur||(K=r)};function te(){if(B>0||(ge(),B>0))return;function r(){ur||(ur=!0,o.calledRun=!0,!Er&&(me(),D(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),ye()))}o.setStatus?(o.setStatus("Running..."),setTimeout(function(){setTimeout(function(){o.setStatus("")},1),r()},1)):r()}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return te(),_.ready}})();const ne=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"],ae=["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 ie(d,_){return d.CharacterSet[_]}const oe=[-1,0,1,2,3,4,5,6,7,8],lr={width:200,height:200,format:"QRCode",characterSet:"UTF8",eccLevel:-1,margin:10};function se(d,_){return{..._,characterSet:ie(d,_.characterSet)}}function ue(d){const{image:_,error:o}=d;return _?{image:new Blob([new Uint8Array(_)],{type:"image/png"}),error:""}:{image:null,error:o}}const ce={locateFile:(d,_)=>{const o=d.match(/_(.+?)\.wasm$/);return o?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.1.3/dist/${o[1]}/${d}`:_+d}};let er=new WeakMap;function Ar(d,_){var j;const o=er.get(d);if(o!=null&&o.modulePromise&&(_===void 0||Object.is(_,o.moduleOverrides)))return o.modulePromise;const D=(j=_!=null?_:o==null?void 0:o.moduleOverrides)!=null?j:ce,S=d({...D});return er.set(d,{moduleOverrides:D,modulePromise:S}),S}function fe(){er=new WeakMap}function le(d,_){er.set(d,{moduleOverrides:_})}async function ve(d,_,o=lr){const D={...lr,...o},S=await Ar(d),j=S.writeBarcodeToImage(_,se(S,D));return ue(j)}const $r={...lr};function de(d){return Ar(fr,d)}function _e(d){return le(fr,d)}async function he(d,_){return ve(fr,d,_)}return F.barcodeFormats=ne,F.characterSets=ae,F.defaultEncodeHints=$r,F.defaultWriterOptions=$r,F.getZXingModule=de,F.purgeZXingModule=fe,F.setZXingModuleOverrides=_e,F.writeBarcodeToImageFile=he,F.writeInputEccLevels=oe,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),F}({});