barcode-detector 3.0.0 → 3.0.1

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.
@@ -1,2 +1,2 @@
1
- var BarcodeDetectionAPI=function(_){"use strict";var fr=_=>{throw TypeError(_)};var dr=(_,j,F)=>j.has(_)||fr("Cannot "+F);var hr=(_,j,F)=>(dr(_,j,"read from private field"),F?F.call(_):j.get(_)),pr=(_,j,F)=>j.has(_)?fr("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(_):j.set(_,F),yr=(_,j,F,gt)=>(dr(_,j,"write to private field"),gt?gt.call(_,F):j.set(_,F),F);var ut,Ce;const j=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],F=j.map(([o])=>o),gt=F.filter((o,d)=>j[d][1]==="L"),vr=F.filter((o,d)=>j[d][1]==="M");function Ht(o){switch(o){case"Linear-Codes":return gt.reduce((d,p)=>d|Ht(p),0);case"Matrix-Codes":return vr.reduce((d,p)=>d|Ht(p),0);case"Any":return(1<<j.length)-1;case"None":return 0;default:return 1<<F.indexOf(o)}}function mr(o){if(o===0)return"None";const d=31-Math.clz32(o);return F[d]}function gr(o){return o.reduce((d,p)=>d|Ht(p),0)}const wr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function $r(o){return wr.indexOf(o)}const ue=["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","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function br(o){return o==="UnicodeBig"?ue.indexOf("UTF16BE"):ue.indexOf(o)}const Cr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Tr(o){return Cr[o]}const Pr=["Ignore","Read","Require"];function _r(o){return Pr.indexOf(o)}const Er=["Plain","ECI","HRI","Hex","Escaped"];function Or(o){return Er.indexOf(o)}const wt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ce(o){return{...o,formats:gr(o.formats),binarizer:$r(o.binarizer),eanAddOnSymbol:_r(o.eanAddOnSymbol),textMode:Or(o.textMode),characterSet:br(o.characterSet)}}function Ar(o){return{...o,format:mr(o.format),contentType:Tr(o.contentType),eccLevel:o.ecLevel}}const Sr="2.0.1",Dr="7be9048e8176fba4f6ffa3dcf528282c6b0151a9",Mr={locateFile:(o,d)=>{const p=o.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.0.1/dist/${p[1]}/${o}`:d+o}},$t=new WeakMap;function xr(o,d){return Object.is(o,d)||Object.keys(o).length===Object.keys(d).length&&Object.keys(o).every(p=>Object.prototype.hasOwnProperty.call(d,p)&&o[p]===d[p])}function le(o,{overrides:d,equalityFn:p=xr,fireImmediately:T=!1}={}){var c;const[A,M]=(c=$t.get(o))!=null?c:[Mr],L=d!=null?d:A;let I;if(T){if(M&&(I=p(A,L)))return M;const k=o({...L});return $t.set(o,[L,k]),k}(I!=null?I:p(A,L))||$t.set(o,[L])}function Ir(o){$t.delete(o)}async function jr(o,d,p=wt){const T={...wt,...p},c=await le(o,{fireImmediately:!0});let A,M;if("size"in d){const{size:I}=d,k=new Uint8Array(await d.arrayBuffer());M=c._malloc(I),c.HEAPU8.set(k,M),A=c.readBarcodesFromImage(M,I,ce(T))}else{const{data:I,data:{byteLength:k},width:N,height:J}=d;M=c._malloc(k),c.HEAPU8.set(I,M),A=c.readBarcodesFromPixmap(M,N,J,ce(T))}c._free(M);const L=[];for(let I=0;I<A.size();++I)L.push(Ar(A.get(I)));return L}({...wt,formats:[...wt.formats]});var Vt=(()=>{var o,d=typeof document<"u"&&((o=document.currentScript)==null?void 0:o.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(p={}){var T,c=p,A,M,L=new Promise((t,e)=>{A=t,M=e}),I=typeof window=="object",k=typeof Bun<"u",N=typeof WorkerGlobalScope<"u";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var J=Object.assign({},c),nt="./this.program",U="";function bt(t){return c.locateFile?c.locateFile(t,U):U+t}var ct,lt;if(I||N||k){var ft;N?U=self.location.href:typeof document<"u"&&((ft=document.currentScript)===null||ft===void 0?void 0:ft.tagName.toUpperCase())==="SCRIPT"&&(U=document.currentScript.src),d&&(U=d),U.startsWith("blob:")?U="":U=U.substr(0,U.replace(/[?#].*/,"").lastIndexOf("/")+1),N&&(lt=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),ct=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var en=c.print||console.log.bind(console),at=c.printErr||console.error.bind(console);Object.assign(c,J),J=null,c.arguments&&c.arguments,c.thisProgram&&(nt=c.thisProgram);var Ct=c.wasmBinary,Tt,Te=!1,z,W,dt,Pt,it,P,Pe,_e;function Ee(){var t=Tt.buffer;c.HEAP8=z=new Int8Array(t),c.HEAP16=dt=new Int16Array(t),c.HEAPU8=W=new Uint8Array(t),c.HEAPU16=Pt=new Uint16Array(t),c.HEAP32=it=new Int32Array(t),c.HEAPU32=P=new Uint32Array(t),c.HEAPF32=Pe=new Float32Array(t),c.HEAPF64=_e=new Float64Array(t)}var Oe=[],Ae=[],Se=[];function rn(){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)on(c.preRun.shift());Xt(Oe)}function nn(){Xt(Ae)}function an(){if(c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;)un(c.postRun.shift());Xt(Se)}function on(t){Oe.unshift(t)}function sn(t){Ae.unshift(t)}function un(t){Se.unshift(t)}var K=0,ht=null;function cn(t){var e;K++,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K)}function ln(t){var e;if(K--,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K),K==0&&ht){var r=ht;ht=null,r()}}function Gt(t){var e;(e=c.onAbort)===null||e===void 0||e.call(c,t),t="Aborted("+t+")",at(t),Te=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw M(r),r}var fn="data:application/octet-stream;base64,",De=t=>t.startsWith(fn);function dn(){var t="zxing_reader.wasm";return De(t)?t:bt(t)}var _t;function hn(t){if(t==_t&&Ct)return new Uint8Array(Ct);if(lt)return lt(t);throw"both async and sync fetching of the wasm failed"}async function pn(t){if(!Ct)try{var e=await ct(t);return new Uint8Array(e)}catch{}return hn(t)}async function yn(t,e){try{var r=await pn(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){at(`failed to asynchronously prepare wasm: ${a}`),Gt(a)}}async function vn(t,e,r){if(!t&&typeof WebAssembly.instantiateStreaming=="function"&&!De(e)&&typeof fetch=="function")try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(i){at(`wasm streaming compile failed: ${i}`),at("falling back to ArrayBuffer instantiation")}return yn(e,r)}function mn(){return{a:ri}}async function gn(){var t;function e(i,u){return O=i.exports,Tt=O.xa,Ee(),We=O.Ba,sn(O.ya),ln(),O}cn();function r(i){e(i.instance)}var n=mn();if(c.instantiateWasm)try{return c.instantiateWasm(n,e)}catch(i){at(`Module.instantiateWasm callback failed with error: ${i}`),M(i)}(t=_t)!==null&&t!==void 0||(_t=dn());try{var a=await vn(Ct,_t,n);return r(a),a}catch(i){M(i);return}}var Xt=t=>{for(;t.length>0;)t.shift()(c)};c.noExitRuntime;var m=t=>Ke(t),g=()=>tr(),Et=[],Ot=0,wn=t=>{var e=new qt(t);return e.get_caught()||(e.set_caught(!0),Ot--),e.set_rethrown(!1),Et.push(e),rr(t),Qe(t)},G=0,$n=()=>{v(0,0);var t=Et.pop();er(t.excPtr),G=0};class qt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){P[this.ptr+4>>2]=e}get_type(){return P[this.ptr+4>>2]}set_destructor(e){P[this.ptr+8>>2]=e}get_destructor(){return P[this.ptr+8>>2]}set_caught(e){e=e?1:0,z[this.ptr+12]=e}get_caught(){return z[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,z[this.ptr+13]=e}get_rethrown(){return z[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){P[this.ptr+16>>2]=e}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var bn=t=>{throw G||(G=t),G},At=t=>Je(t),Zt=t=>{var e=G;if(!e)return At(0),0;var r=new qt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return At(0),e;for(var a of t){if(a===0||a===n)break;var i=r.ptr+16;if(nr(a,n,i))return At(a),e}return At(n),e},Cn=()=>Zt([]),Tn=t=>Zt([t]),Pn=(t,e)=>Zt([t,e]),_n=()=>{var t=Et.pop();t||Gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),Ot++),G=e,G},En=(t,e,r)=>{var n=new qt(t);throw n.init(e,r),G=t,Ot++,G},On=()=>Ot,An=()=>Gt(""),St={},Yt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function pt(t){return this.fromWireType(P[t>>2])}var ot={},tt={},Dt={},Me,Mt=t=>{throw new Me(t)},et=(t,e,r)=>{t.forEach(s=>Dt[s]=e);function n(s){var l=r(s);l.length!==t.length&&Mt("Mismatched type converter count");for(var f=0;f<t.length;++f)V(t[f],l[f])}var a=new Array(e.length),i=[],u=0;e.forEach((s,l)=>{tt.hasOwnProperty(s)?a[l]=tt[s]:(i.push(s),ot.hasOwnProperty(s)||(ot[s]=[]),ot[s].push(()=>{a[l]=tt[s],++u,u===i.length&&n(a)}))}),i.length===0&&n(a)},Sn=t=>{var e=St[t];delete St[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([t],i,u=>{var s={};return a.forEach((l,f)=>{var h=l.fieldName,y=u[f],$=l.getter,C=l.getterContext,E=u[f+a.length],x=l.setter,S=l.setterContext;s[h]={read:D=>y.fromWireType($(C,D)),write:(D,rt)=>{var B=[];x(S,D,E.toWireType(B,rt)),Yt(B)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in s)f[h]=s[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in s)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in s)s[h].write(y,f[h]);return l!==null&&l.push(n,y),y},argPackAdvance:X,readValueFromPointer:pt,destructorFunction:n}]})},Dn=(t,e,r,n,a)=>{},Mn=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);xe=t},xe,R=t=>{for(var e="",r=t;W[r];)e+=xe[W[r++]];return e},st,b=t=>{throw new st(t)};function xn(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 Dt[t],ot.hasOwnProperty(t)){var a=ot[t];delete ot[t],a.forEach(i=>i())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return xn(t,e,r)}var X=8,In=(t,e,r,n)=>{e=R(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?r:n},argPackAdvance:X,readValueFromPointer:function(a){return this.fromWireType(W[a])},destructorFunction:null})},jn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Qt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Jt=!1,Ie=t=>{},Fn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},je=t=>{t.count.value-=1;var e=t.count.value===0;e&&Fn(t)},Fe=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Fe(t,e,r.baseClass);return n===null?null:r.downcast(n)},Re={},Rn={},Bn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Ln=(t,e)=>(e=Bn(t,e),Rn[e]),xt=(t,e)=>{(!e.ptrType||!e.ptr)&&Mt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&Mt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},yt(Object.create(t,{$$:{value:e,writable:!0}}))};function Un(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Ln(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),u=Re[i];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var l=Fe(e,this.registeredClass,s.registeredClass);return l===null?a.call(this):this.isSmartPointer?xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):xt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}var yt=t=>typeof FinalizationRegistry>"u"?(yt=e=>e,t):(Jt=new FinalizationRegistry(e=>{je(e.$$)}),yt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Jt.register(e,a,e)}return e},Ie=e=>Jt.unregister(e),yt(t)),Wn=()=>{Object.assign(It.prototype,{isAliasOf(t){if(!(this instanceof It)||!(t instanceof It))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Qt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:jn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Ie(this),je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}})};function It(){}var jt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Be=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,i=new Array(a),u=0;u<a;u++)i[u]=arguments[u];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}},Le=(t,e,r)=>{c.hasOwnProperty(t)?((r===void 0||c[t].overloadTable!==void 0&&c[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Be(c,t,t),c[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),c[t].overloadTable[r]=e):(c[t]=e,c[t].argCount=r)},kn=48,Hn=57,Vn=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=kn&&e<=Hn?`_${t}`:t};function Nn(t,e,r,n,a,i,u,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Kt=(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};function zn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}function Gn(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 "${ae(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=Kt(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 a=e.clone();r=this.rawShare(r,Z.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function Xn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}var qn=()=>{Object.assign(Ft.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)},argPackAdvance:X,readValueFromPointer:pt,fromWireType:Un})};function Ft(t,e,r,n,a,i,u,s,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=zn,this.destructorFunction=null):(this.toWireType=Xn,this.destructorFunction=null):this.toWireType=Gn}var Ue=(t,e,r)=>{c.hasOwnProperty(t)||Mt("Replacing nonexistent public symbol"),c[t].overloadTable!==void 0&&r!==void 0?c[t].overloadTable[r]=e:(c[t]=e,c[t].argCount=r)},Zn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=c["dynCall_"+t];return n(e,...r)},Rt=[],We,w=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=We.get(t)),e},Yn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Zn(t,e,r);var n=w(e)(...r);return n},Qn=(t,e)=>function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return Yn(t,e,n)},H=(t,e)=>{t=R(t);function r(){return t.includes("j")?Qn(t,e):w(e)}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n},Jn=(t,e)=>{var r=jt(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
- `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},ke,He=t=>{var e=Ye(t),r=R(e);return Y(e),r},Bt=(t,e)=>{var r=[],n={};function a(i){if(!n[i]&&!tt[i]){if(Dt[i]){Dt[i].forEach(a);return}r.push(i),n[i]=!0}}throw e.forEach(a),new ke(`${t}: `+r.map(He).join([", "]))},Kn=(t,e,r,n,a,i,u,s,l,f,h,y,$)=>{h=R(h),i=H(a,i),s&&(s=H(u,s)),f&&(f=H(l,f)),$=H(y,$);var C=Vn(h);Le(C,function(){Bt(`Cannot construct ${h} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],E=>{E=E[0];var x,S;n?(x=E.registeredClass,S=x.instancePrototype):S=It.prototype;var D=jt(h,function(){if(Object.getPrototypeOf(this)!==rt)throw new st("Use 'new' to construct "+h);if(B.constructor_body===void 0)throw new st(h+" has no accessible constructor");for(var cr=arguments.length,Wt=new Array(cr),kt=0;kt<cr;kt++)Wt[kt]=arguments[kt];var lr=B.constructor_body[Wt.length];if(lr===void 0)throw new st(`Tried to invoke ctor of ${h} with invalid number of parameters (${Wt.length}) - expected (${Object.keys(B.constructor_body).toString()}) parameters instead!`);return lr.apply(this,Wt)}),rt=Object.create(S,{constructor:{value:D}});D.prototype=rt;var B=new Nn(h,D,rt,$,x,i,s,f);if(B.baseClass){var Q,Ut;(Ut=(Q=B.baseClass).__derivedClasses)!==null&&Ut!==void 0||(Q.__derivedClasses=[]),B.baseClass.__derivedClasses.push(B)}var Bi=new Ft(h,B,!0,!1,!1),sr=new Ft(h+"*",B,!1,!1,!1),ur=new Ft(h+" const*",B,!1,!0,!1);return Re[t]={pointerType:sr,constPointerType:ur},Ue(C,D),[Bi,sr,ur]})},te=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(P[e+n*4>>2]);return r};function ta(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function ee(t,e,r,n,a,i){var u=e.length;u<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=e[1]!==null&&r!==null,l=ta(e),f=e[0].name!=="void",h=u-2,y=new Array(h),$=[],C=[],E=function(){C.length=0;var x;$.length=s?2:1,$[0]=a,s&&(x=e[1].toWireType(C,this),$[1]=x);for(var S=0;S<h;++S)y[S]=e[S+2].toWireType(C,S<0||arguments.length<=S?void 0:arguments[S]),$.push(y[S]);var D=n(...$);function rt(B){if(l)Yt(C);else for(var Q=s?1:2;Q<e.length;Q++){var Ut=Q===1?x:y[Q-2];e[Q].destructorFunction!==null&&e[Q].destructorFunction(Ut)}if(f)return e[0].fromWireType(B)}return rt(D)};return jt(t,E)}var ea=(t,e,r,n,a,i)=>{var u=te(e,r);a=H(n,a),et([],[t],s=>{s=s[0];var l=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[e-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[e-1]=()=>{Bt(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,f=>(f.splice(1,0,null),s.registeredClass.constructor_body[e-1]=ee(l,f,null,a,i),[])),[]})},Ve=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?t.substr(0,e):t},ra=(t,e,r,n,a,i,u,s,l,f)=>{var h=te(r,n);e=R(e),e=Ve(e),i=H(a,i),et([],[t],y=>{y=y[0];var $=`${y.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&y.registeredClass.pureVirtualFunctions.push(e);function C(){Bt(`Cannot call ${$} due to unbound types`,h)}var E=y.registeredClass.instancePrototype,x=E[e];return x===void 0||x.overloadTable===void 0&&x.className!==y.name&&x.argCount===r-2?(C.argCount=r-2,C.className=y.name,E[e]=C):(Be(E,e,$),E[e].overloadTable[r-2]=C),et([],h,S=>{var D=ee($,S,y,i,u);return E[e].overloadTable===void 0?(D.argCount=r-2,E[e]=D):E[e].overloadTable[r-2]=D,[]}),[]})},re=[],q=[],ne=t=>{t>9&&--q[t+1]===0&&(q[t]=void 0,re.push(t))},na=()=>q.length/2-5-re.length,aa=()=>{q.push(0,1,void 0,1,null,1,!0,1,!1,1),c.count_emval_handles=na},Z={toValue:t=>(t||b("Cannot use deleted val. handle = "+t),q[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()||q.length;return q[e]=t,q[e+1]=1,e}}}},Ne={name:"emscripten::val",fromWireType:t=>{var e=Z.toValue(t);return ne(t),e},toWireType:(t,e)=>Z.toHandle(e),argPackAdvance:X,readValueFromPointer:pt,destructorFunction:null},ia=t=>V(t,Ne),ae=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},oa=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Pe[r>>2])};case 8:return function(r){return this.fromWireType(_e[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},sa=(t,e,r)=>{e=R(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:X,readValueFromPointer:oa(e,r),destructorFunction:null})},ua=(t,e,r,n,a,i,u,s)=>{var l=te(e,r);t=R(t),t=Ve(t),a=H(n,a),Le(t,function(){Bt(`Cannot call ${t} due to unbound types`,l)},e-1),et([],l,f=>{var h=[f[0],null].concat(f.slice(1));return Ue(t,ee(t,h,null,a,i),e-1),[]})},ca=(t,e,r)=>{switch(e){case 1:return r?n=>z[n]:n=>W[n];case 2:return r?n=>dt[n>>1]:n=>Pt[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},la=(t,e,r,n,a)=>{e=R(e);var i=h=>h;if(n===0){var u=32-8*r;i=h=>h<<u>>>u}var s=e.includes("unsigned"),l=(h,y)=>{},f;s?f=function(h,y){return l(y,this.name),y>>>0}:f=function(h,y){return l(y,this.name),y},V(t,{name:e,fromWireType:i,toWireType:f,argPackAdvance:X,readValueFromPointer:ca(e,r,n!==0),destructorFunction:null})},fa=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(u){var s=P[u>>2],l=P[u+4>>2];return new a(z.buffer,l,s)}r=R(r),V(t,{name:r,fromWireType:i,argPackAdvance:X,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},da=Object.assign({optional:!0},Ne),ha=(t,e)=>{V(t,da)},pa=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|s&63}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|s&63}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|s&63}}return e[r]=0,r-a},vt=(t,e,r)=>pa(t,W,e,r),ya=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},ze=typeof TextDecoder<"u"?new TextDecoder:void 0,Ge=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&ze)return ze.decode(t.subarray(e,a));for(var i="";e<a;){var u=t[e++];if(!(u&128)){i+=String.fromCharCode(u);continue}var s=t[e++]&63;if((u&224)==192){i+=String.fromCharCode((u&31)<<6|s);continue}var l=t[e++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|l:u=(u&7)<<18|s<<12|l<<6|t[e++]&63,u<65536)i+=String.fromCharCode(u);else{var f=u-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},va=(t,e)=>t?Ge(W,t,e):"",ma=(t,e)=>{e=R(e),V(t,{name:e,fromWireType(r){for(var n=P[r>>2],a=r+4,i,s,u=a,s=0;s<=n;++s){var l=a+s;if(s==n||W[l]==0){var f=l-u,h=va(u,f);i===void 0?i=h:(i+="\0",i+=h),u=l+1}}return Y(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,i=typeof n=="string";i||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||b("Cannot pass non-string to std::string"),i?a=ya(n):a=n.length;var u=se(4+a+1),s=u+4;if(P[u>>2]=a,i)vt(n,s,a+1);else if(i)for(var l=0;l<a;++l){var f=n.charCodeAt(l);f>255&&(Y(s),b("String has UTF-16 code units that do not fit in 8 bits")),W[s+l]=f}else for(var l=0;l<a;++l)W[s+l]=n[l];return r!==null&&r.push(Y,u),u},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(r){Y(r)}})},Xe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ga=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Pt[n];)++n;if(r=n<<1,r-t>32&&Xe)return Xe.decode(W.subarray(t,r));for(var i="",u=0;!(u>=e/2);++u){var s=dt[t+u*2>>1];if(s==0)break;i+=String.fromCharCode(s)}return i},wa=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var a=e,i=r<t.length*2?r/2:t.length,u=0;u<i;++u){var s=t.charCodeAt(u);dt[e>>1]=s,e+=2}return dt[e>>1]=0,e-a},$a=t=>t.length*2,ba=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=it[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},Ca=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<4)return 0;for(var a=e,i=a+r-4,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(it[e>>2]=s,e+=4,e+4>i)break}return it[e>>2]=0,e-a},Ta=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Pa=(t,e,r)=>{r=R(r);var n,a,i,u;e===2?(n=ga,a=wa,u=$a,i=s=>Pt[s>>1]):e===4&&(n=ba,a=Ca,u=Ta,i=s=>P[s>>2]),V(t,{name:r,fromWireType:s=>{for(var l=P[s>>2],f,h=s+4,y=0;y<=l;++y){var $=s+4+y*e;if(y==l||i($)==0){var C=$-h,E=n(h,C);f===void 0?f=E:(f+="\0",f+=E),h=$+e}}return Y(s),f},toWireType:(s,l)=>{typeof l!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var f=u(l),h=se(4+f+e);return P[h>>2]=f/e,a(l,h+4,f+e),s!==null&&s.push(Y,h),h},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(s){Y(s)}})},_a=(t,e,r,n,a,i)=>{St[t]={name:R(e),rawConstructor:H(r,n),rawDestructor:H(a,i),fields:[]}},Ea=(t,e,r,n,a,i,u,s,l,f)=>{St[t].fields.push({fieldName:R(e),getterReturnType:r,getter:H(n,a),getterContext:i,setterArgumentType:u,setter:H(s,l),setterContext:f})},Oa=(t,e)=>{e=R(e),V(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},Aa=(t,e,r)=>W.copyWithin(t,e,e+r),ie=[],Sa=(t,e,r,n)=>(t=ie[t],e=Z.toValue(e),t(null,e,r,n)),Da={},Ma=t=>{var e=Da[t];return e===void 0?R(t):e},qe=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},xa=t=>t===0?Z.toHandle(qe()):(t=Ma(t),Z.toHandle(qe()[t])),Ia=t=>{var e=ie.length;return ie.push(t),e},Ze=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${He(t)}`),r},ja=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=Ze(P[e+n*4>>2],"parameter "+n);return r},Fa=Reflect.construct,Ra=(t,e,r)=>{var n=[],a=t.toWireType(n,r);return n.length&&(P[e>>2]=Z.toHandle(n)),a},Ba=(t,e,r)=>{var n=ja(t,e),a=n.shift();t--;var i=new Array(t),u=(l,f,h,y)=>{for(var $=0,C=0;C<t;++C)i[C]=n[C].readValueFromPointer(y+$),$+=n[C].argPackAdvance;var E=r===1?Fa(f,i):f.apply(l,i);return Ra(a,h,E)},s=`methodCaller<(${n.map(l=>l.name).join(", ")}) => ${a.name}>`;return Ia(jt(s,u))},La=t=>{t>9&&(q[t+1]+=1)},Ua=t=>{var e=Z.toValue(t);Yt(e),ne(t)},Wa=(t,e)=>{t=Ze(t,"_emval_take_value");var r=t.readValueFromPointer(e);return Z.toHandle(r)},ka=(t,e,r,n)=>{var a=new Date().getFullYear(),i=new Date(a,0,1),u=new Date(a,6,1),s=i.getTimezoneOffset(),l=u.getTimezoneOffset(),f=Math.max(s,l);P[t>>2]=f*60,it[e>>2]=+(s!=l);var h=C=>{var E=C>=0?"-":"+",x=Math.abs(C),S=String(Math.floor(x/60)).padStart(2,"0"),D=String(x%60).padStart(2,"0");return`UTC${E}${S}${D}`},y=h(s),$=h(l);l<s?(vt(y,r,17),vt($,n,17)):(vt(y,n,17),vt($,r,17))},Ha=()=>2147483648,Va=(t,e)=>Math.ceil(t/e)*e,Na=t=>{var e=Tt.buffer,r=(t-e.byteLength+65535)/65536|0;try{return Tt.grow(r),Ee(),1}catch{}},za=t=>{var e=W.length;t>>>=0;var r=Ha();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math.min(r,Va(Math.max(t,a),65536)),u=Na(i);if(u)return!0}return!1},oe={},Ga=()=>nt||"./this.program",mt=()=>{if(!mt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ga()};for(var r in oe)oe[r]===void 0?delete e[r]:e[r]=oe[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);mt.strings=n}return mt.strings},Xa=(t,e)=>{for(var r=0;r<t.length;++r)z[e++]=t.charCodeAt(r);z[e]=0},qa=(t,e)=>{var r=0;return mt().forEach((n,a)=>{var i=e+r;P[t+a*4>>2]=i,Xa(n,i),r+=n.length+1}),0},Za=(t,e)=>{var r=mt();P[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),P[e>>2]=n,0},Ya=t=>52;function Qa(t,e,r,n,a){return 70}var Ja=[null,[],[]],Ka=(t,e)=>{var r=Ja[t];e===0||e===10?((t===1?en:at)(Ge(r)),r.length=0):r.push(e)},ti=(t,e,r,n)=>{for(var a=0,i=0;i<r;i++){var u=P[e>>2],s=P[e+4>>2];e+=8;for(var l=0;l<s;l++)Ka(t,W[u+l]);a+=s}return P[n>>2]=a,0},ei=t=>t;Me=c.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Mn(),st=c.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Wn(),qn(),ke=c.UnboundTypeError=Jn(Error,"UnboundTypeError"),aa();var ri={s:wn,w:$n,a:Cn,j:Tn,l:Pn,M:_n,p:En,ca:On,d:bn,Z:An,sa:Sn,Y:Dn,na:In,qa:Kn,pa:ea,D:ra,la:ia,Q:sa,R:ua,x:la,t:fa,ra:ha,ma,N:Pa,J:_a,ta:Ea,oa:Oa,fa:Aa,U:Sa,ua:ne,wa:xa,_:Ba,S:La,va:Ua,ka:Wa,$:ka,da:za,aa:qa,ba:Za,ea:Ya,W:Qa,P:ti,H:Ti,B:_i,T:ui,O:xi,q:wi,b:ai,C:Ci,ha:Oi,c:oi,ga:Ai,h:si,i:hi,r:pi,L:bi,v:vi,G:Di,I:$i,z:Ei,F:Ii,X:Fi,V:Ri,k:li,f:ci,e:ii,g:ni,K:Mi,m:di,ia:Pi,o:yi,u:mi,ja:gi,A:Si,n:fi,E:ji,y:ei},O;gn();var Ye=t=>(Ye=O.za)(t),Y=c._free=t=>(Y=c._free=O.Aa)(t),se=c._malloc=t=>(se=c._malloc=O.Ca)(t),Qe=t=>(Qe=O.Da)(t),v=(t,e)=>(v=O.Ea)(t,e),Je=t=>(Je=O.Fa)(t),Ke=t=>(Ke=O.Ga)(t),tr=()=>(tr=O.Ha)(),er=t=>(er=O.Ia)(t),rr=t=>(rr=O.Ja)(t),nr=(t,e,r)=>(nr=O.Ka)(t,e,r);c.dynCall_viijii=(t,e,r,n,a,i,u)=>(c.dynCall_viijii=O.La)(t,e,r,n,a,i,u);var ar=c.dynCall_jiii=(t,e,r,n)=>(ar=c.dynCall_jiii=O.Ma)(t,e,r,n);c.dynCall_jiji=(t,e,r,n,a)=>(c.dynCall_jiji=O.Na)(t,e,r,n,a);var ir=c.dynCall_jiiii=(t,e,r,n,a)=>(ir=c.dynCall_jiiii=O.Oa)(t,e,r,n,a);c.dynCall_iiiiij=(t,e,r,n,a,i,u)=>(c.dynCall_iiiiij=O.Pa)(t,e,r,n,a,i,u),c.dynCall_iiiiijj=(t,e,r,n,a,i,u,s,l)=>(c.dynCall_iiiiijj=O.Qa)(t,e,r,n,a,i,u,s,l),c.dynCall_iiiiiijj=(t,e,r,n,a,i,u,s,l,f)=>(c.dynCall_iiiiiijj=O.Ra)(t,e,r,n,a,i,u,s,l,f);function ni(t,e,r,n){var a=g();try{w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ai(t,e){var r=g();try{return w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function ii(t,e,r){var n=g();try{w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function si(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ui(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function ci(t,e){var r=g();try{w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function li(t){var e=g();try{w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function fi(t,e,r,n,a,i,u,s,l,f,h){var y=g();try{w(t)(e,r,n,a,i,u,s,l,f,h)}catch($){if(m(y),$!==$+0)throw $;v(1,0)}}function di(t,e,r,n,a){var i=g();try{w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function hi(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function pi(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function yi(t,e,r,n,a,i){var u=g();try{w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function vi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function mi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function gi(t,e,r,n,a,i,u,s,l){var f=g();try{w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function wi(t){var e=g();try{return w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function $i(t,e,r,n,a,i,u,s,l){var f=g();try{return w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function bi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Ci(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ti(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Pi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function _i(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function Ei(t,e,r,n,a,i,u,s,l,f){var h=g();try{return w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function Ai(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function Si(t,e,r,n,a,i,u,s,l,f){var h=g();try{w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Di(t,e,r,n,a,i,u,s){var l=g();try{return w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function Mi(t,e,r,n,a,i,u){var s=g();try{w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function xi(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ii(t,e,r,n,a,i,u,s,l,f,h,y){var $=g();try{return w(t)(e,r,n,a,i,u,s,l,f,h,y)}catch(C){if(m($),C!==C+0)throw C;v(1,0)}}function ji(t,e,r,n,a,i,u,s,l,f,h,y,$,C,E,x){var S=g();try{w(t)(e,r,n,a,i,u,s,l,f,h,y,$,C,E,x)}catch(D){if(m(S),D!==D+0)throw D;v(1,0)}}function Fi(t,e,r,n){var a=g();try{return ar(t,e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ri(t,e,r,n,a){var i=g();try{return ir(t,e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}var Lt;ht=function t(){Lt||or(),Lt||(ht=t)};function or(){if(K>0||(rn(),K>0))return;function t(){var e;Lt||(Lt=!0,c.calledRun=!0,!Te&&(nn(),A(c),(e=c.onRuntimeInitialized)===null||e===void 0||e.call(c),an()))}c.setStatus?(c.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>c.setStatus(""),1),t()},1)):t()}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);c.preInit.length>0;)c.preInit.pop()();return or(),T=L,T}})();function Nt(o){return le(Vt,o)}function Fr(){return Ir(Vt)}function Rr(o){Nt({overrides:o,equalityFn:Object.is,fireImmediately:!1})}async function Br(o,d){return jr(Vt,o,d)}const Lr="fd885aab6c1040e991da4bdf2c3849d27b3c238c437a29c8d30efbe68e509bb1",fe=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Ur=[...fe,["unknown"]].map(o=>o[0]),zt=new Map(fe);function Wr(o){for(const[d,p]of zt)if(o===p)return d;return"unknown"}function kr(o){if(de(o))return{width:o.naturalWidth,height:o.naturalHeight};if(he(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(pe(o))return{width:o.videoWidth,height:o.videoHeight};if(ve(o))return{width:o.width,height:o.height};if(ge(o))return{width:o.displayWidth,height:o.displayHeight};if(ye(o))return{width:o.width,height:o.height};if(me(o))return{width:o.width,height:o.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 de(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function he(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function pe(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function ye(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function ve(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function me(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function ge(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function Hr(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function Vr(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function Nr(o,d){try{const p=new OffscreenCanvas(o,d);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=o,p.height=d,p}}async function we(o){if(de(o)&&!await qr(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(he(o)&&!await Zr(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ge(o)&&Yr(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(pe(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ve(o)&&Jr(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:d,height:p}=kr(o);if(d===0||p===0)return null;const c=Nr(d,p).getContext("2d");c.drawImage(o,0,0);try{return c.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function zr(o){let d;try{d=await createImageBitmap(o)}catch{try{if(globalThis.Image){d=new Image;let c="";try{c=URL.createObjectURL(o),d.src=c,await d.decode()}finally{URL.revokeObjectURL(c)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await we(d)}function Gr(o){const{width:d,height:p}=o;if(d===0||p===0)return null;const T=o.getContext("2d");try{return T.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Xr(o){if(Hr(o))return await zr(o);if(Vr(o)){if(Qr(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return ye(o)||me(o)?Gr(o):await we(o)}async function qr(o){try{return await o.decode(),!0}catch{return!1}}async function Zr(o){var d;try{return await((d=o.decode)==null?void 0:d.call(o)),!0}catch{return!1}}function Yr(o){return o.format===null}function Qr(o){return o.data.buffer.byteLength===0}function Jr(o){return o.width===0&&o.height===0}function $e(o,d){return Kr(o)?new DOMException(`${d}: ${o.message}`,o.name):tn(o)?new o.constructor(`${d}: ${o.message}`):new Error(`${d}: ${o}`)}function Kr(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function tn(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}class be{constructor(d={}){pr(this,ut);var p;try{const T=(p=d==null?void 0:d.formats)==null?void 0:p.filter(c=>c!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const c of T!=null?T:[])if(!zt.has(c))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${c}' is not a valid enum value of type BarcodeFormat.`);yr(this,ut,T!=null?T:[]),Nt({fireImmediately:!0}).catch(()=>{})}catch(T){throw $e(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ur.filter(d=>d!=="unknown")}async detect(d){try{const p=await Xr(d);if(p===null)return[];let T;const c={tryCode39ExtendedMode:!1,textMode:"Plain",formats:hr(this,ut).map(A=>zt.get(A))};try{T=await Br(p,c)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(A=>{const{topLeft:{x:M,y:L},topRight:{x:I,y:k},bottomLeft:{x:N,y:J},bottomRight:{x:nt,y:U}}=A.position,bt=Math.min(M,I,N,nt),ct=Math.min(L,k,J,U),lt=Math.max(M,I,N,nt),ft=Math.max(L,k,J,U);return{boundingBox:new DOMRectReadOnly(bt,ct,lt-bt,ft-ct),rawValue:A.text,format:Wr(A.format),cornerPoints:[{x:M,y:L},{x:I,y:k},{x:nt,y:U},{x:N,y:J}]}})}catch(p){throw $e(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ut=new WeakMap,(Ce=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=be),_.BarcodeDetector=be,_.ZXING_CPP_COMMIT=Dr,_.ZXING_WASM_SHA256=Lr,_.ZXING_WASM_VERSION=Sr,_.prepareZXingModule=Nt,_.purgeZXingModule=Fr,_.setZXingModuleOverrides=Rr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
1
+ var BarcodeDetectionAPI=function(_){"use strict";var fr=_=>{throw TypeError(_)};var dr=(_,j,F)=>j.has(_)||fr("Cannot "+F);var hr=(_,j,F)=>(dr(_,j,"read from private field"),F?F.call(_):j.get(_)),pr=(_,j,F)=>j.has(_)?fr("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(_):j.set(_,F),yr=(_,j,F,gt)=>(dr(_,j,"write to private field"),gt?gt.call(_,F):j.set(_,F),F);var ut,Ce;const j=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],F=j.map(([o])=>o),gt=F.filter((o,d)=>j[d][1]==="L"),vr=F.filter((o,d)=>j[d][1]==="M");function Ht(o){switch(o){case"Linear-Codes":return gt.reduce((d,p)=>d|Ht(p),0);case"Matrix-Codes":return vr.reduce((d,p)=>d|Ht(p),0);case"Any":return(1<<j.length)-1;case"None":return 0;default:return 1<<F.indexOf(o)}}function mr(o){if(o===0)return"None";const d=31-Math.clz32(o);return F[d]}function gr(o){return o.reduce((d,p)=>d|Ht(p),0)}const wr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function $r(o){return wr.indexOf(o)}const ue=["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","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function br(o){return o==="UnicodeBig"?ue.indexOf("UTF16BE"):ue.indexOf(o)}const Cr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Tr(o){return Cr[o]}const Pr=["Ignore","Read","Require"];function _r(o){return Pr.indexOf(o)}const Er=["Plain","ECI","HRI","Hex","Escaped"];function Or(o){return Er.indexOf(o)}const wt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ce(o){return{...o,formats:gr(o.formats),binarizer:$r(o.binarizer),eanAddOnSymbol:_r(o.eanAddOnSymbol),textMode:Or(o.textMode),characterSet:br(o.characterSet)}}function Ar(o){return{...o,format:mr(o.format),contentType:Tr(o.contentType),eccLevel:o.ecLevel}}const Sr="2.1.0",Dr="37b847798a1af55d3a289a9516a751fcafae3c23",Ir={locateFile:(o,d)=>{const p=o.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.1.0/dist/${p[1]}/${o}`:d+o}},$t=new WeakMap;function Mr(o,d){return Object.is(o,d)||Object.keys(o).length===Object.keys(d).length&&Object.keys(o).every(p=>Object.prototype.hasOwnProperty.call(d,p)&&o[p]===d[p])}function le(o,{overrides:d,equalityFn:p=Mr,fireImmediately:T=!1}={}){var c;const[A,M]=(c=$t.get(o))!=null?c:[Ir],U=d!=null?d:A;let S;if(T){if(M&&(S=p(A,U)))return M;const R=o({...U});return $t.set(o,[U,R]),R}(S!=null?S:p(A,U))||$t.set(o,[U])}function xr(o){$t.delete(o)}async function jr(o,d,p=wt){const T={...wt,...p},c=await le(o,{fireImmediately:!0});let A,M;if("width"in d&&"height"in d&&"data"in d){const{data:S,data:{byteLength:R},width:N,height:J}=d;M=c._malloc(R),c.HEAPU8.set(S,M),A=c.readBarcodesFromPixmap(M,N,J,ce(T))}else{let S,R;if("buffer"in d)[S,R]=[d.byteLength,d];else if("byteLength"in d)[S,R]=[d.byteLength,new Uint8Array(d)];else if("size"in d)[S,R]=[d.size,new Uint8Array(await d.arrayBuffer())];else throw new TypeError("Invalid input type");M=c._malloc(S),c.HEAPU8.set(R,M),A=c.readBarcodesFromImage(M,S,ce(T))}c._free(M);const U=[];for(let S=0;S<A.size();++S)U.push(Ar(A.get(S)));return U}({...wt,formats:[...wt.formats]});var Vt=(()=>{var o,d=typeof document<"u"&&((o=document.currentScript)==null?void 0:o.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(p={}){var T,c=p,A,M,U=new Promise((t,e)=>{A=t,M=e}),S=typeof window=="object",R=typeof Bun<"u",N=typeof WorkerGlobalScope<"u";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var J=Object.assign({},c),nt="./this.program",W="";function bt(t){return c.locateFile?c.locateFile(t,W):W+t}var ct,lt;if(S||N||R){var ft;N?W=self.location.href:typeof document<"u"&&((ft=document.currentScript)===null||ft===void 0?void 0:ft.tagName.toUpperCase())==="SCRIPT"&&(W=document.currentScript.src),d&&(W=d),W.startsWith("blob:")?W="":W=W.substr(0,W.replace(/[?#].*/,"").lastIndexOf("/")+1),N&&(lt=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),ct=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var en=c.print||console.log.bind(console),at=c.printErr||console.error.bind(console);Object.assign(c,J),J=null,c.arguments&&c.arguments,c.thisProgram&&(nt=c.thisProgram);var Ct=c.wasmBinary,Tt,Te=!1,z,k,dt,Pt,it,P,Pe,_e;function Ee(){var t=Tt.buffer;c.HEAP8=z=new Int8Array(t),c.HEAP16=dt=new Int16Array(t),c.HEAPU8=k=new Uint8Array(t),c.HEAPU16=Pt=new Uint16Array(t),c.HEAP32=it=new Int32Array(t),c.HEAPU32=P=new Uint32Array(t),c.HEAPF32=Pe=new Float32Array(t),c.HEAPF64=_e=new Float64Array(t)}var Oe=[],Ae=[],Se=[];function rn(){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)on(c.preRun.shift());Xt(Oe)}function nn(){Xt(Ae)}function an(){if(c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;)un(c.postRun.shift());Xt(Se)}function on(t){Oe.unshift(t)}function sn(t){Ae.unshift(t)}function un(t){Se.unshift(t)}var K=0,ht=null;function cn(t){var e;K++,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K)}function ln(t){var e;if(K--,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K),K==0&&ht){var r=ht;ht=null,r()}}function Gt(t){var e;(e=c.onAbort)===null||e===void 0||e.call(c,t),t="Aborted("+t+")",at(t),Te=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw M(r),r}var fn="data:application/octet-stream;base64,",De=t=>t.startsWith(fn);function dn(){var t="zxing_reader.wasm";return De(t)?t:bt(t)}var _t;function hn(t){if(t==_t&&Ct)return new Uint8Array(Ct);if(lt)return lt(t);throw"both async and sync fetching of the wasm failed"}async function pn(t){if(!Ct)try{var e=await ct(t);return new Uint8Array(e)}catch{}return hn(t)}async function yn(t,e){try{var r=await pn(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){at(`failed to asynchronously prepare wasm: ${a}`),Gt(a)}}async function vn(t,e,r){if(!t&&typeof WebAssembly.instantiateStreaming=="function"&&!De(e)&&typeof fetch=="function")try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(i){at(`wasm streaming compile failed: ${i}`),at("falling back to ArrayBuffer instantiation")}return yn(e,r)}function mn(){return{a:ri}}async function gn(){var t;function e(i,u){return O=i.exports,Tt=O.xa,Ee(),We=O.Ba,sn(O.ya),ln(),O}cn();function r(i){e(i.instance)}var n=mn();if(c.instantiateWasm)try{return c.instantiateWasm(n,e)}catch(i){at(`Module.instantiateWasm callback failed with error: ${i}`),M(i)}(t=_t)!==null&&t!==void 0||(_t=dn());try{var a=await vn(Ct,_t,n);return r(a),a}catch(i){M(i);return}}var Xt=t=>{for(;t.length>0;)t.shift()(c)};c.noExitRuntime;var m=t=>Ke(t),g=()=>tr(),Et=[],Ot=0,wn=t=>{var e=new qt(t);return e.get_caught()||(e.set_caught(!0),Ot--),e.set_rethrown(!1),Et.push(e),rr(t),Qe(t)},G=0,$n=()=>{v(0,0);var t=Et.pop();er(t.excPtr),G=0};class qt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){P[this.ptr+4>>2]=e}get_type(){return P[this.ptr+4>>2]}set_destructor(e){P[this.ptr+8>>2]=e}get_destructor(){return P[this.ptr+8>>2]}set_caught(e){e=e?1:0,z[this.ptr+12]=e}get_caught(){return z[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,z[this.ptr+13]=e}get_rethrown(){return z[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){P[this.ptr+16>>2]=e}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var bn=t=>{throw G||(G=t),G},At=t=>Je(t),Zt=t=>{var e=G;if(!e)return At(0),0;var r=new qt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return At(0),e;for(var a of t){if(a===0||a===n)break;var i=r.ptr+16;if(nr(a,n,i))return At(a),e}return At(n),e},Cn=()=>Zt([]),Tn=t=>Zt([t]),Pn=(t,e)=>Zt([t,e]),_n=()=>{var t=Et.pop();t||Gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),Ot++),G=e,G},En=(t,e,r)=>{var n=new qt(t);throw n.init(e,r),G=t,Ot++,G},On=()=>Ot,An=()=>Gt(""),St={},Yt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function pt(t){return this.fromWireType(P[t>>2])}var ot={},tt={},Dt={},Ie,It=t=>{throw new Ie(t)},et=(t,e,r)=>{t.forEach(s=>Dt[s]=e);function n(s){var l=r(s);l.length!==t.length&&It("Mismatched type converter count");for(var f=0;f<t.length;++f)V(t[f],l[f])}var a=new Array(e.length),i=[],u=0;e.forEach((s,l)=>{tt.hasOwnProperty(s)?a[l]=tt[s]:(i.push(s),ot.hasOwnProperty(s)||(ot[s]=[]),ot[s].push(()=>{a[l]=tt[s],++u,u===i.length&&n(a)}))}),i.length===0&&n(a)},Sn=t=>{var e=St[t];delete St[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([t],i,u=>{var s={};return a.forEach((l,f)=>{var h=l.fieldName,y=u[f],$=l.getter,C=l.getterContext,E=u[f+a.length],x=l.setter,D=l.setterContext;s[h]={read:I=>y.fromWireType($(C,I)),write:(I,rt)=>{var L=[];x(D,I,E.toWireType(L,rt)),Yt(L)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in s)f[h]=s[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in s)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in s)s[h].write(y,f[h]);return l!==null&&l.push(n,y),y},argPackAdvance:X,readValueFromPointer:pt,destructorFunction:n}]})},Dn=(t,e,r,n,a)=>{},In=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Me=t},Me,B=t=>{for(var e="",r=t;k[r];)e+=Me[k[r++]];return e},st,b=t=>{throw new st(t)};function Mn(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 Dt[t],ot.hasOwnProperty(t)){var a=ot[t];delete ot[t],a.forEach(i=>i())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Mn(t,e,r)}var X=8,xn=(t,e,r,n)=>{e=B(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?r:n},argPackAdvance:X,readValueFromPointer:function(a){return this.fromWireType(k[a])},destructorFunction:null})},jn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Qt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Jt=!1,xe=t=>{},Fn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},je=t=>{t.count.value-=1;var e=t.count.value===0;e&&Fn(t)},Fe=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=Fe(t,e,r.baseClass);return n===null?null:r.downcast(n)},Re={},Rn={},Bn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Ln=(t,e)=>(e=Bn(t,e),Rn[e]),Mt=(t,e)=>{(!e.ptrType||!e.ptr)&&It("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&It("Both smartPtrType and smartPtr must be specified"),e.count={value:1},yt(Object.create(t,{$$:{value:e,writable:!0}}))};function Un(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Ln(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?Mt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Mt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),u=Re[i];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var l=Fe(e,this.registeredClass,s.registeredClass);return l===null?a.call(this):this.isSmartPointer?Mt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):Mt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}var yt=t=>typeof FinalizationRegistry>"u"?(yt=e=>e,t):(Jt=new FinalizationRegistry(e=>{je(e.$$)}),yt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Jt.register(e,a,e)}return e},xe=e=>Jt.unregister(e),yt(t)),Wn=()=>{Object.assign(xt.prototype,{isAliasOf(t){if(!(this instanceof xt)||!(t instanceof xt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Qt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:jn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),xe(this),je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}})};function xt(){}var jt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Be=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,i=new Array(a),u=0;u<a;u++)i[u]=arguments[u];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}},Le=(t,e,r)=>{c.hasOwnProperty(t)?((r===void 0||c[t].overloadTable!==void 0&&c[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Be(c,t,t),c[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),c[t].overloadTable[r]=e):(c[t]=e,c[t].argCount=r)},kn=48,Hn=57,Vn=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=kn&&e<=Hn?`_${t}`:t};function Nn(t,e,r,n,a,i,u,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Kt=(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};function zn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}function Gn(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 "${ae(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=Kt(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 a=e.clone();r=this.rawShare(r,Z.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function Xn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}var qn=()=>{Object.assign(Ft.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)},argPackAdvance:X,readValueFromPointer:pt,fromWireType:Un})};function Ft(t,e,r,n,a,i,u,s,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=zn,this.destructorFunction=null):(this.toWireType=Xn,this.destructorFunction=null):this.toWireType=Gn}var Ue=(t,e,r)=>{c.hasOwnProperty(t)||It("Replacing nonexistent public symbol"),c[t].overloadTable!==void 0&&r!==void 0?c[t].overloadTable[r]=e:(c[t]=e,c[t].argCount=r)},Zn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=c["dynCall_"+t];return n(e,...r)},Rt=[],We,w=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=We.get(t)),e},Yn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Zn(t,e,r);var n=w(e)(...r);return n},Qn=(t,e)=>function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return Yn(t,e,n)},H=(t,e)=>{t=B(t);function r(){return t.includes("j")?Qn(t,e):w(e)}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n},Jn=(t,e)=>{var r=jt(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
+ `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},ke,He=t=>{var e=Ye(t),r=B(e);return Y(e),r},Bt=(t,e)=>{var r=[],n={};function a(i){if(!n[i]&&!tt[i]){if(Dt[i]){Dt[i].forEach(a);return}r.push(i),n[i]=!0}}throw e.forEach(a),new ke(`${t}: `+r.map(He).join([", "]))},Kn=(t,e,r,n,a,i,u,s,l,f,h,y,$)=>{h=B(h),i=H(a,i),s&&(s=H(u,s)),f&&(f=H(l,f)),$=H(y,$);var C=Vn(h);Le(C,function(){Bt(`Cannot construct ${h} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],E=>{E=E[0];var x,D;n?(x=E.registeredClass,D=x.instancePrototype):D=xt.prototype;var I=jt(h,function(){if(Object.getPrototypeOf(this)!==rt)throw new st("Use 'new' to construct "+h);if(L.constructor_body===void 0)throw new st(h+" has no accessible constructor");for(var cr=arguments.length,Wt=new Array(cr),kt=0;kt<cr;kt++)Wt[kt]=arguments[kt];var lr=L.constructor_body[Wt.length];if(lr===void 0)throw new st(`Tried to invoke ctor of ${h} with invalid number of parameters (${Wt.length}) - expected (${Object.keys(L.constructor_body).toString()}) parameters instead!`);return lr.apply(this,Wt)}),rt=Object.create(D,{constructor:{value:I}});I.prototype=rt;var L=new Nn(h,I,rt,$,x,i,s,f);if(L.baseClass){var Q,Ut;(Ut=(Q=L.baseClass).__derivedClasses)!==null&&Ut!==void 0||(Q.__derivedClasses=[]),L.baseClass.__derivedClasses.push(L)}var Bi=new Ft(h,L,!0,!1,!1),sr=new Ft(h+"*",L,!1,!1,!1),ur=new Ft(h+" const*",L,!1,!0,!1);return Re[t]={pointerType:sr,constPointerType:ur},Ue(C,I),[Bi,sr,ur]})},te=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(P[e+n*4>>2]);return r};function ta(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function ee(t,e,r,n,a,i){var u=e.length;u<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=e[1]!==null&&r!==null,l=ta(e),f=e[0].name!=="void",h=u-2,y=new Array(h),$=[],C=[],E=function(){C.length=0;var x;$.length=s?2:1,$[0]=a,s&&(x=e[1].toWireType(C,this),$[1]=x);for(var D=0;D<h;++D)y[D]=e[D+2].toWireType(C,D<0||arguments.length<=D?void 0:arguments[D]),$.push(y[D]);var I=n(...$);function rt(L){if(l)Yt(C);else for(var Q=s?1:2;Q<e.length;Q++){var Ut=Q===1?x:y[Q-2];e[Q].destructorFunction!==null&&e[Q].destructorFunction(Ut)}if(f)return e[0].fromWireType(L)}return rt(I)};return jt(t,E)}var ea=(t,e,r,n,a,i)=>{var u=te(e,r);a=H(n,a),et([],[t],s=>{s=s[0];var l=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[e-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[e-1]=()=>{Bt(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,f=>(f.splice(1,0,null),s.registeredClass.constructor_body[e-1]=ee(l,f,null,a,i),[])),[]})},Ve=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?t.substr(0,e):t},ra=(t,e,r,n,a,i,u,s,l,f)=>{var h=te(r,n);e=B(e),e=Ve(e),i=H(a,i),et([],[t],y=>{y=y[0];var $=`${y.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&y.registeredClass.pureVirtualFunctions.push(e);function C(){Bt(`Cannot call ${$} due to unbound types`,h)}var E=y.registeredClass.instancePrototype,x=E[e];return x===void 0||x.overloadTable===void 0&&x.className!==y.name&&x.argCount===r-2?(C.argCount=r-2,C.className=y.name,E[e]=C):(Be(E,e,$),E[e].overloadTable[r-2]=C),et([],h,D=>{var I=ee($,D,y,i,u);return E[e].overloadTable===void 0?(I.argCount=r-2,E[e]=I):E[e].overloadTable[r-2]=I,[]}),[]})},re=[],q=[],ne=t=>{t>9&&--q[t+1]===0&&(q[t]=void 0,re.push(t))},na=()=>q.length/2-5-re.length,aa=()=>{q.push(0,1,void 0,1,null,1,!0,1,!1,1),c.count_emval_handles=na},Z={toValue:t=>(t||b("Cannot use deleted val. handle = "+t),q[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()||q.length;return q[e]=t,q[e+1]=1,e}}}},Ne={name:"emscripten::val",fromWireType:t=>{var e=Z.toValue(t);return ne(t),e},toWireType:(t,e)=>Z.toHandle(e),argPackAdvance:X,readValueFromPointer:pt,destructorFunction:null},ia=t=>V(t,Ne),ae=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},oa=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Pe[r>>2])};case 8:return function(r){return this.fromWireType(_e[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},sa=(t,e,r)=>{e=B(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:X,readValueFromPointer:oa(e,r),destructorFunction:null})},ua=(t,e,r,n,a,i,u,s)=>{var l=te(e,r);t=B(t),t=Ve(t),a=H(n,a),Le(t,function(){Bt(`Cannot call ${t} due to unbound types`,l)},e-1),et([],l,f=>{var h=[f[0],null].concat(f.slice(1));return Ue(t,ee(t,h,null,a,i),e-1),[]})},ca=(t,e,r)=>{switch(e){case 1:return r?n=>z[n]:n=>k[n];case 2:return r?n=>dt[n>>1]:n=>Pt[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},la=(t,e,r,n,a)=>{e=B(e);var i=h=>h;if(n===0){var u=32-8*r;i=h=>h<<u>>>u}var s=e.includes("unsigned"),l=(h,y)=>{},f;s?f=function(h,y){return l(y,this.name),y>>>0}:f=function(h,y){return l(y,this.name),y},V(t,{name:e,fromWireType:i,toWireType:f,argPackAdvance:X,readValueFromPointer:ca(e,r,n!==0),destructorFunction:null})},fa=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(u){var s=P[u>>2],l=P[u+4>>2];return new a(z.buffer,l,s)}r=B(r),V(t,{name:r,fromWireType:i,argPackAdvance:X,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},da=Object.assign({optional:!0},Ne),ha=(t,e)=>{V(t,da)},pa=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|s&63}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|s&63}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|s&63}}return e[r]=0,r-a},vt=(t,e,r)=>pa(t,k,e,r),ya=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},ze=typeof TextDecoder<"u"?new TextDecoder:void 0,Ge=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&ze)return ze.decode(t.subarray(e,a));for(var i="";e<a;){var u=t[e++];if(!(u&128)){i+=String.fromCharCode(u);continue}var s=t[e++]&63;if((u&224)==192){i+=String.fromCharCode((u&31)<<6|s);continue}var l=t[e++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|l:u=(u&7)<<18|s<<12|l<<6|t[e++]&63,u<65536)i+=String.fromCharCode(u);else{var f=u-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},va=(t,e)=>t?Ge(k,t,e):"",ma=(t,e)=>{e=B(e),V(t,{name:e,fromWireType(r){for(var n=P[r>>2],a=r+4,i,s,u=a,s=0;s<=n;++s){var l=a+s;if(s==n||k[l]==0){var f=l-u,h=va(u,f);i===void 0?i=h:(i+="\0",i+=h),u=l+1}}return Y(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,i=typeof n=="string";i||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||b("Cannot pass non-string to std::string"),i?a=ya(n):a=n.length;var u=se(4+a+1),s=u+4;if(P[u>>2]=a,i)vt(n,s,a+1);else if(i)for(var l=0;l<a;++l){var f=n.charCodeAt(l);f>255&&(Y(s),b("String has UTF-16 code units that do not fit in 8 bits")),k[s+l]=f}else for(var l=0;l<a;++l)k[s+l]=n[l];return r!==null&&r.push(Y,u),u},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(r){Y(r)}})},Xe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ga=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Pt[n];)++n;if(r=n<<1,r-t>32&&Xe)return Xe.decode(k.subarray(t,r));for(var i="",u=0;!(u>=e/2);++u){var s=dt[t+u*2>>1];if(s==0)break;i+=String.fromCharCode(s)}return i},wa=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var a=e,i=r<t.length*2?r/2:t.length,u=0;u<i;++u){var s=t.charCodeAt(u);dt[e>>1]=s,e+=2}return dt[e>>1]=0,e-a},$a=t=>t.length*2,ba=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=it[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},Ca=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<4)return 0;for(var a=e,i=a+r-4,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(it[e>>2]=s,e+=4,e+4>i)break}return it[e>>2]=0,e-a},Ta=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Pa=(t,e,r)=>{r=B(r);var n,a,i,u;e===2?(n=ga,a=wa,u=$a,i=s=>Pt[s>>1]):e===4&&(n=ba,a=Ca,u=Ta,i=s=>P[s>>2]),V(t,{name:r,fromWireType:s=>{for(var l=P[s>>2],f,h=s+4,y=0;y<=l;++y){var $=s+4+y*e;if(y==l||i($)==0){var C=$-h,E=n(h,C);f===void 0?f=E:(f+="\0",f+=E),h=$+e}}return Y(s),f},toWireType:(s,l)=>{typeof l!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var f=u(l),h=se(4+f+e);return P[h>>2]=f/e,a(l,h+4,f+e),s!==null&&s.push(Y,h),h},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(s){Y(s)}})},_a=(t,e,r,n,a,i)=>{St[t]={name:B(e),rawConstructor:H(r,n),rawDestructor:H(a,i),fields:[]}},Ea=(t,e,r,n,a,i,u,s,l,f)=>{St[t].fields.push({fieldName:B(e),getterReturnType:r,getter:H(n,a),getterContext:i,setterArgumentType:u,setter:H(s,l),setterContext:f})},Oa=(t,e)=>{e=B(e),V(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},Aa=(t,e,r)=>k.copyWithin(t,e,e+r),ie=[],Sa=(t,e,r,n)=>(t=ie[t],e=Z.toValue(e),t(null,e,r,n)),Da={},Ia=t=>{var e=Da[t];return e===void 0?B(t):e},qe=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},Ma=t=>t===0?Z.toHandle(qe()):(t=Ia(t),Z.toHandle(qe()[t])),xa=t=>{var e=ie.length;return ie.push(t),e},Ze=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${He(t)}`),r},ja=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=Ze(P[e+n*4>>2],"parameter "+n);return r},Fa=Reflect.construct,Ra=(t,e,r)=>{var n=[],a=t.toWireType(n,r);return n.length&&(P[e>>2]=Z.toHandle(n)),a},Ba=(t,e,r)=>{var n=ja(t,e),a=n.shift();t--;var i=new Array(t),u=(l,f,h,y)=>{for(var $=0,C=0;C<t;++C)i[C]=n[C].readValueFromPointer(y+$),$+=n[C].argPackAdvance;var E=r===1?Fa(f,i):f.apply(l,i);return Ra(a,h,E)},s=`methodCaller<(${n.map(l=>l.name).join(", ")}) => ${a.name}>`;return xa(jt(s,u))},La=t=>{t>9&&(q[t+1]+=1)},Ua=t=>{var e=Z.toValue(t);Yt(e),ne(t)},Wa=(t,e)=>{t=Ze(t,"_emval_take_value");var r=t.readValueFromPointer(e);return Z.toHandle(r)},ka=(t,e,r,n)=>{var a=new Date().getFullYear(),i=new Date(a,0,1),u=new Date(a,6,1),s=i.getTimezoneOffset(),l=u.getTimezoneOffset(),f=Math.max(s,l);P[t>>2]=f*60,it[e>>2]=+(s!=l);var h=C=>{var E=C>=0?"-":"+",x=Math.abs(C),D=String(Math.floor(x/60)).padStart(2,"0"),I=String(x%60).padStart(2,"0");return`UTC${E}${D}${I}`},y=h(s),$=h(l);l<s?(vt(y,r,17),vt($,n,17)):(vt(y,n,17),vt($,r,17))},Ha=()=>2147483648,Va=(t,e)=>Math.ceil(t/e)*e,Na=t=>{var e=Tt.buffer,r=(t-e.byteLength+65535)/65536|0;try{return Tt.grow(r),Ee(),1}catch{}},za=t=>{var e=k.length;t>>>=0;var r=Ha();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math.min(r,Va(Math.max(t,a),65536)),u=Na(i);if(u)return!0}return!1},oe={},Ga=()=>nt||"./this.program",mt=()=>{if(!mt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ga()};for(var r in oe)oe[r]===void 0?delete e[r]:e[r]=oe[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);mt.strings=n}return mt.strings},Xa=(t,e)=>{for(var r=0;r<t.length;++r)z[e++]=t.charCodeAt(r);z[e]=0},qa=(t,e)=>{var r=0;return mt().forEach((n,a)=>{var i=e+r;P[t+a*4>>2]=i,Xa(n,i),r+=n.length+1}),0},Za=(t,e)=>{var r=mt();P[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),P[e>>2]=n,0},Ya=t=>52;function Qa(t,e,r,n,a){return 70}var Ja=[null,[],[]],Ka=(t,e)=>{var r=Ja[t];e===0||e===10?((t===1?en:at)(Ge(r)),r.length=0):r.push(e)},ti=(t,e,r,n)=>{for(var a=0,i=0;i<r;i++){var u=P[e>>2],s=P[e+4>>2];e+=8;for(var l=0;l<s;l++)Ka(t,k[u+l]);a+=s}return P[n>>2]=a,0},ei=t=>t;Ie=c.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},In(),st=c.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Wn(),qn(),ke=c.UnboundTypeError=Jn(Error,"UnboundTypeError"),aa();var ri={s:wn,w:$n,a:Cn,j:Tn,l:Pn,M:_n,p:En,ca:On,d:bn,Z:An,sa:Sn,Y:Dn,na:xn,qa:Kn,pa:ea,D:ra,la:ia,Q:sa,R:ua,x:la,t:fa,ra:ha,ma,N:Pa,J:_a,ta:Ea,oa:Oa,fa:Aa,U:Sa,ua:ne,wa:Ma,_:Ba,S:La,va:Ua,ka:Wa,$:ka,da:za,aa:qa,ba:Za,ea:Ya,W:Qa,P:ti,H:Ti,B:_i,T:ui,O:Mi,q:wi,b:ai,C:Ci,ha:Oi,c:oi,ga:Ai,h:si,i:hi,r:pi,L:bi,v:vi,G:Di,I:$i,z:Ei,F:xi,X:Fi,V:Ri,k:li,f:ci,e:ii,g:ni,K:Ii,m:di,ia:Pi,o:yi,u:mi,ja:gi,A:Si,n:fi,E:ji,y:ei},O;gn();var Ye=t=>(Ye=O.za)(t),Y=c._free=t=>(Y=c._free=O.Aa)(t),se=c._malloc=t=>(se=c._malloc=O.Ca)(t),Qe=t=>(Qe=O.Da)(t),v=(t,e)=>(v=O.Ea)(t,e),Je=t=>(Je=O.Fa)(t),Ke=t=>(Ke=O.Ga)(t),tr=()=>(tr=O.Ha)(),er=t=>(er=O.Ia)(t),rr=t=>(rr=O.Ja)(t),nr=(t,e,r)=>(nr=O.Ka)(t,e,r);c.dynCall_viijii=(t,e,r,n,a,i,u)=>(c.dynCall_viijii=O.La)(t,e,r,n,a,i,u);var ar=c.dynCall_jiii=(t,e,r,n)=>(ar=c.dynCall_jiii=O.Ma)(t,e,r,n);c.dynCall_jiji=(t,e,r,n,a)=>(c.dynCall_jiji=O.Na)(t,e,r,n,a);var ir=c.dynCall_jiiii=(t,e,r,n,a)=>(ir=c.dynCall_jiiii=O.Oa)(t,e,r,n,a);c.dynCall_iiiiij=(t,e,r,n,a,i,u)=>(c.dynCall_iiiiij=O.Pa)(t,e,r,n,a,i,u),c.dynCall_iiiiijj=(t,e,r,n,a,i,u,s,l)=>(c.dynCall_iiiiijj=O.Qa)(t,e,r,n,a,i,u,s,l),c.dynCall_iiiiiijj=(t,e,r,n,a,i,u,s,l,f)=>(c.dynCall_iiiiiijj=O.Ra)(t,e,r,n,a,i,u,s,l,f);function ni(t,e,r,n){var a=g();try{w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ai(t,e){var r=g();try{return w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function ii(t,e,r){var n=g();try{w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function si(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ui(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function ci(t,e){var r=g();try{w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function li(t){var e=g();try{w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function fi(t,e,r,n,a,i,u,s,l,f,h){var y=g();try{w(t)(e,r,n,a,i,u,s,l,f,h)}catch($){if(m(y),$!==$+0)throw $;v(1,0)}}function di(t,e,r,n,a){var i=g();try{w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function hi(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function pi(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function yi(t,e,r,n,a,i){var u=g();try{w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function vi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function mi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function gi(t,e,r,n,a,i,u,s,l){var f=g();try{w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function wi(t){var e=g();try{return w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function $i(t,e,r,n,a,i,u,s,l){var f=g();try{return w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function bi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Ci(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ti(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Pi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function _i(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function Ei(t,e,r,n,a,i,u,s,l,f){var h=g();try{return w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function Ai(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function Si(t,e,r,n,a,i,u,s,l,f){var h=g();try{w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Di(t,e,r,n,a,i,u,s){var l=g();try{return w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function Ii(t,e,r,n,a,i,u){var s=g();try{w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Mi(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function xi(t,e,r,n,a,i,u,s,l,f,h,y){var $=g();try{return w(t)(e,r,n,a,i,u,s,l,f,h,y)}catch(C){if(m($),C!==C+0)throw C;v(1,0)}}function ji(t,e,r,n,a,i,u,s,l,f,h,y,$,C,E,x){var D=g();try{w(t)(e,r,n,a,i,u,s,l,f,h,y,$,C,E,x)}catch(I){if(m(D),I!==I+0)throw I;v(1,0)}}function Fi(t,e,r,n){var a=g();try{return ar(t,e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ri(t,e,r,n,a){var i=g();try{return ir(t,e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}var Lt;ht=function t(){Lt||or(),Lt||(ht=t)};function or(){if(K>0||(rn(),K>0))return;function t(){var e;Lt||(Lt=!0,c.calledRun=!0,!Te&&(nn(),A(c),(e=c.onRuntimeInitialized)===null||e===void 0||e.call(c),an()))}c.setStatus?(c.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>c.setStatus(""),1),t()},1)):t()}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);c.preInit.length>0;)c.preInit.pop()();return or(),T=U,T}})();function Nt(o){return le(Vt,o)}function Fr(){return xr(Vt)}function Rr(o){Nt({overrides:o,equalityFn:Object.is,fireImmediately:!1})}async function Br(o,d){return jr(Vt,o,d)}const Lr="5bb3ce7aeedc314e24afb873bebcf366a01c27a00b21cdf2fa98b819c005c16b",fe=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Ur=[...fe,["unknown"]].map(o=>o[0]),zt=new Map(fe);function Wr(o){for(const[d,p]of zt)if(o===p)return d;return"unknown"}function kr(o){if(de(o))return{width:o.naturalWidth,height:o.naturalHeight};if(he(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(pe(o))return{width:o.videoWidth,height:o.videoHeight};if(ve(o))return{width:o.width,height:o.height};if(ge(o))return{width:o.displayWidth,height:o.displayHeight};if(ye(o))return{width:o.width,height:o.height};if(me(o))return{width:o.width,height:o.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 de(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function he(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function pe(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function ye(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function ve(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function me(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function ge(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function Hr(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function Vr(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function Nr(o,d){try{const p=new OffscreenCanvas(o,d);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=o,p.height=d,p}}async function we(o){if(de(o)&&!await qr(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(he(o)&&!await Zr(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ge(o)&&Yr(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(pe(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ve(o)&&Jr(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:d,height:p}=kr(o);if(d===0||p===0)return null;const c=Nr(d,p).getContext("2d");c.drawImage(o,0,0);try{return c.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function zr(o){let d;try{d=await createImageBitmap(o)}catch{try{if(globalThis.Image){d=new Image;let c="";try{c=URL.createObjectURL(o),d.src=c,await d.decode()}finally{URL.revokeObjectURL(c)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await we(d)}function Gr(o){const{width:d,height:p}=o;if(d===0||p===0)return null;const T=o.getContext("2d");try{return T.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Xr(o){if(Hr(o))return await zr(o);if(Vr(o)){if(Qr(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return ye(o)||me(o)?Gr(o):await we(o)}async function qr(o){try{return await o.decode(),!0}catch{return!1}}async function Zr(o){var d;try{return await((d=o.decode)==null?void 0:d.call(o)),!0}catch{return!1}}function Yr(o){return o.format===null}function Qr(o){return o.data.buffer.byteLength===0}function Jr(o){return o.width===0&&o.height===0}function $e(o,d){return Kr(o)?new DOMException(`${d}: ${o.message}`,o.name):tn(o)?new o.constructor(`${d}: ${o.message}`):new Error(`${d}: ${o}`)}function Kr(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function tn(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}class be{constructor(d={}){pr(this,ut);var p;try{const T=(p=d==null?void 0:d.formats)==null?void 0:p.filter(c=>c!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const c of T!=null?T:[])if(!zt.has(c))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${c}' is not a valid enum value of type BarcodeFormat.`);yr(this,ut,T!=null?T:[]),Nt({fireImmediately:!0}).catch(()=>{})}catch(T){throw $e(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Ur.filter(d=>d!=="unknown")}async detect(d){try{const p=await Xr(d);if(p===null)return[];let T;const c={tryCode39ExtendedMode:!1,textMode:"Plain",formats:hr(this,ut).map(A=>zt.get(A))};try{T=await Br(p,c)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(A=>{const{topLeft:{x:M,y:U},topRight:{x:S,y:R},bottomLeft:{x:N,y:J},bottomRight:{x:nt,y:W}}=A.position,bt=Math.min(M,S,N,nt),ct=Math.min(U,R,J,W),lt=Math.max(M,S,N,nt),ft=Math.max(U,R,J,W);return{boundingBox:new DOMRectReadOnly(bt,ct,lt-bt,ft-ct),rawValue:A.text,format:Wr(A.format),cornerPoints:[{x:M,y:U},{x:S,y:R},{x:nt,y:W},{x:N,y:J}]}})}catch(p){throw $e(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ut=new WeakMap,(Ce=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=be),_.BarcodeDetector=be,_.ZXING_CPP_COMMIT=Dr,_.ZXING_WASM_SHA256=Lr,_.ZXING_WASM_VERSION=Sr,_.prepareZXingModule=Nt,_.purgeZXingModule=Fr,_.setZXingModuleOverrides=Rr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
@@ -1,2 +1,2 @@
1
- var BarcodeDetectionAPI=function(_){"use strict";var lr=_=>{throw TypeError(_)};var fr=(_,j,F)=>j.has(_)||lr("Cannot "+F);var dr=(_,j,F)=>(fr(_,j,"read from private field"),F?F.call(_):j.get(_)),hr=(_,j,F)=>j.has(_)?lr("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(_):j.set(_,F),pr=(_,j,F,gt)=>(fr(_,j,"write to private field"),gt?gt.call(_,F):j.set(_,F),F);var ut,be;const j=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],F=j.map(([o])=>o),gt=F.filter((o,d)=>j[d][1]==="L"),yr=F.filter((o,d)=>j[d][1]==="M");function Ht(o){switch(o){case"Linear-Codes":return gt.reduce((d,p)=>d|Ht(p),0);case"Matrix-Codes":return yr.reduce((d,p)=>d|Ht(p),0);case"Any":return(1<<j.length)-1;case"None":return 0;default:return 1<<F.indexOf(o)}}function vr(o){if(o===0)return"None";const d=31-Math.clz32(o);return F[d]}function mr(o){return o.reduce((d,p)=>d|Ht(p),0)}const gr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function wr(o){return gr.indexOf(o)}const ue=["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","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function $r(o){return o==="UnicodeBig"?ue.indexOf("UTF16BE"):ue.indexOf(o)}const br=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Cr(o){return br[o]}const Tr=["Ignore","Read","Require"];function Pr(o){return Tr.indexOf(o)}const _r=["Plain","ECI","HRI","Hex","Escaped"];function Er(o){return _r.indexOf(o)}const wt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ce(o){return{...o,formats:mr(o.formats),binarizer:wr(o.binarizer),eanAddOnSymbol:Pr(o.eanAddOnSymbol),textMode:Er(o.textMode),characterSet:$r(o.characterSet)}}function Or(o){return{...o,format:vr(o.format),contentType:Cr(o.contentType),eccLevel:o.ecLevel}}const Ar="2.0.1",Sr="7be9048e8176fba4f6ffa3dcf528282c6b0151a9",Dr={locateFile:(o,d)=>{const p=o.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.0.1/dist/${p[1]}/${o}`:d+o}},$t=new WeakMap;function xr(o,d){return Object.is(o,d)||Object.keys(o).length===Object.keys(d).length&&Object.keys(o).every(p=>Object.prototype.hasOwnProperty.call(d,p)&&o[p]===d[p])}function le(o,{overrides:d,equalityFn:p=xr,fireImmediately:T=!1}={}){var c;const[A,x]=(c=$t.get(o))!=null?c:[Dr],L=d!=null?d:A;let I;if(T){if(x&&(I=p(A,L)))return x;const k=o({...L});return $t.set(o,[L,k]),k}(I!=null?I:p(A,L))||$t.set(o,[L])}function Mr(o){$t.delete(o)}async function Ir(o,d,p=wt){const T={...wt,...p},c=await le(o,{fireImmediately:!0});let A,x;if("size"in d){const{size:I}=d,k=new Uint8Array(await d.arrayBuffer());x=c._malloc(I),c.HEAPU8.set(k,x),A=c.readBarcodesFromImage(x,I,ce(T))}else{const{data:I,data:{byteLength:k},width:N,height:J}=d;x=c._malloc(k),c.HEAPU8.set(I,x),A=c.readBarcodesFromPixmap(x,N,J,ce(T))}c._free(x);const L=[];for(let I=0;I<A.size();++I)L.push(Or(A.get(I)));return L}({...wt,formats:[...wt.formats]});var Vt=(()=>{var o,d=typeof document<"u"&&((o=document.currentScript)==null?void 0:o.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(p={}){var T,c=p,A,x,L=new Promise((t,e)=>{A=t,x=e}),I=typeof window=="object",k=typeof Bun<"u",N=typeof WorkerGlobalScope<"u";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var J=Object.assign({},c),nt="./this.program",U="";function bt(t){return c.locateFile?c.locateFile(t,U):U+t}var ct,lt;if(I||N||k){var ft;N?U=self.location.href:typeof document<"u"&&((ft=document.currentScript)===null||ft===void 0?void 0:ft.tagName.toUpperCase())==="SCRIPT"&&(U=document.currentScript.src),d&&(U=d),U.startsWith("blob:")?U="":U=U.substr(0,U.replace(/[?#].*/,"").lastIndexOf("/")+1),N&&(lt=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),ct=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var en=c.print||console.log.bind(console),at=c.printErr||console.error.bind(console);Object.assign(c,J),J=null,c.arguments&&c.arguments,c.thisProgram&&(nt=c.thisProgram);var Ct=c.wasmBinary,Tt,Ce=!1,z,W,dt,Pt,it,P,Te,Pe;function _e(){var t=Tt.buffer;c.HEAP8=z=new Int8Array(t),c.HEAP16=dt=new Int16Array(t),c.HEAPU8=W=new Uint8Array(t),c.HEAPU16=Pt=new Uint16Array(t),c.HEAP32=it=new Int32Array(t),c.HEAPU32=P=new Uint32Array(t),c.HEAPF32=Te=new Float32Array(t),c.HEAPF64=Pe=new Float64Array(t)}var Ee=[],Oe=[],Ae=[];function rn(){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)on(c.preRun.shift());Xt(Ee)}function nn(){Xt(Oe)}function an(){if(c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;)un(c.postRun.shift());Xt(Ae)}function on(t){Ee.unshift(t)}function sn(t){Oe.unshift(t)}function un(t){Ae.unshift(t)}var K=0,ht=null;function cn(t){var e;K++,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K)}function ln(t){var e;if(K--,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K),K==0&&ht){var r=ht;ht=null,r()}}function Gt(t){var e;(e=c.onAbort)===null||e===void 0||e.call(c,t),t="Aborted("+t+")",at(t),Ce=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw x(r),r}var fn="data:application/octet-stream;base64,",Se=t=>t.startsWith(fn);function dn(){var t="zxing_reader.wasm";return Se(t)?t:bt(t)}var _t;function hn(t){if(t==_t&&Ct)return new Uint8Array(Ct);if(lt)return lt(t);throw"both async and sync fetching of the wasm failed"}async function pn(t){if(!Ct)try{var e=await ct(t);return new Uint8Array(e)}catch{}return hn(t)}async function yn(t,e){try{var r=await pn(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){at(`failed to asynchronously prepare wasm: ${a}`),Gt(a)}}async function vn(t,e,r){if(!t&&typeof WebAssembly.instantiateStreaming=="function"&&!Se(e)&&typeof fetch=="function")try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(i){at(`wasm streaming compile failed: ${i}`),at("falling back to ArrayBuffer instantiation")}return yn(e,r)}function mn(){return{a:ri}}async function gn(){var t;function e(i,u){return O=i.exports,Tt=O.xa,_e(),Ue=O.Ba,sn(O.ya),ln(),O}cn();function r(i){e(i.instance)}var n=mn();if(c.instantiateWasm)try{return c.instantiateWasm(n,e)}catch(i){at(`Module.instantiateWasm callback failed with error: ${i}`),x(i)}(t=_t)!==null&&t!==void 0||(_t=dn());try{var a=await vn(Ct,_t,n);return r(a),a}catch(i){x(i);return}}var Xt=t=>{for(;t.length>0;)t.shift()(c)};c.noExitRuntime;var m=t=>Je(t),g=()=>Ke(),Et=[],Ot=0,wn=t=>{var e=new qt(t);return e.get_caught()||(e.set_caught(!0),Ot--),e.set_rethrown(!1),Et.push(e),er(t),Ye(t)},G=0,$n=()=>{v(0,0);var t=Et.pop();tr(t.excPtr),G=0};class qt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){P[this.ptr+4>>2]=e}get_type(){return P[this.ptr+4>>2]}set_destructor(e){P[this.ptr+8>>2]=e}get_destructor(){return P[this.ptr+8>>2]}set_caught(e){e=e?1:0,z[this.ptr+12]=e}get_caught(){return z[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,z[this.ptr+13]=e}get_rethrown(){return z[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){P[this.ptr+16>>2]=e}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var bn=t=>{throw G||(G=t),G},At=t=>Qe(t),Zt=t=>{var e=G;if(!e)return At(0),0;var r=new qt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return At(0),e;for(var a of t){if(a===0||a===n)break;var i=r.ptr+16;if(rr(a,n,i))return At(a),e}return At(n),e},Cn=()=>Zt([]),Tn=t=>Zt([t]),Pn=(t,e)=>Zt([t,e]),_n=()=>{var t=Et.pop();t||Gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),Ot++),G=e,G},En=(t,e,r)=>{var n=new qt(t);throw n.init(e,r),G=t,Ot++,G},On=()=>Ot,An=()=>Gt(""),St={},Yt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function pt(t){return this.fromWireType(P[t>>2])}var ot={},tt={},Dt={},De,xt=t=>{throw new De(t)},et=(t,e,r)=>{t.forEach(s=>Dt[s]=e);function n(s){var l=r(s);l.length!==t.length&&xt("Mismatched type converter count");for(var f=0;f<t.length;++f)V(t[f],l[f])}var a=new Array(e.length),i=[],u=0;e.forEach((s,l)=>{tt.hasOwnProperty(s)?a[l]=tt[s]:(i.push(s),ot.hasOwnProperty(s)||(ot[s]=[]),ot[s].push(()=>{a[l]=tt[s],++u,u===i.length&&n(a)}))}),i.length===0&&n(a)},Sn=t=>{var e=St[t];delete St[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([t],i,u=>{var s={};return a.forEach((l,f)=>{var h=l.fieldName,y=u[f],$=l.getter,C=l.getterContext,E=u[f+a.length],M=l.setter,S=l.setterContext;s[h]={read:D=>y.fromWireType($(C,D)),write:(D,rt)=>{var B=[];M(S,D,E.toWireType(B,rt)),Yt(B)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in s)f[h]=s[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in s)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in s)s[h].write(y,f[h]);return l!==null&&l.push(n,y),y},argPackAdvance:X,readValueFromPointer:pt,destructorFunction:n}]})},Dn=(t,e,r,n,a)=>{},xn=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);xe=t},xe,R=t=>{for(var e="",r=t;W[r];)e+=xe[W[r++]];return e},st,b=t=>{throw new st(t)};function Mn(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 Dt[t],ot.hasOwnProperty(t)){var a=ot[t];delete ot[t],a.forEach(i=>i())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Mn(t,e,r)}var X=8,In=(t,e,r,n)=>{e=R(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?r:n},argPackAdvance:X,readValueFromPointer:function(a){return this.fromWireType(W[a])},destructorFunction:null})},jn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Qt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Jt=!1,Me=t=>{},Fn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Ie=t=>{t.count.value-=1;var e=t.count.value===0;e&&Fn(t)},je=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=je(t,e,r.baseClass);return n===null?null:r.downcast(n)},Fe={},Rn={},Bn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Ln=(t,e)=>(e=Bn(t,e),Rn[e]),Mt=(t,e)=>{(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},yt(Object.create(t,{$$:{value:e,writable:!0}}))};function Un(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Ln(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?Mt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Mt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),u=Fe[i];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var l=je(e,this.registeredClass,s.registeredClass);return l===null?a.call(this):this.isSmartPointer?Mt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):Mt(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}var yt=t=>typeof FinalizationRegistry>"u"?(yt=e=>e,t):(Jt=new FinalizationRegistry(e=>{Ie(e.$$)}),yt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Jt.register(e,a,e)}return e},Me=e=>Jt.unregister(e),yt(t)),Wn=()=>{Object.assign(It.prototype,{isAliasOf(t){if(!(this instanceof It)||!(t instanceof It))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Qt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:jn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Me(this),Ie(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}})};function It(){}var jt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Re=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,i=new Array(a),u=0;u<a;u++)i[u]=arguments[u];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}},Be=(t,e,r)=>{c.hasOwnProperty(t)?((r===void 0||c[t].overloadTable!==void 0&&c[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Re(c,t,t),c[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),c[t].overloadTable[r]=e):(c[t]=e,c[t].argCount=r)},kn=48,Hn=57,Vn=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=kn&&e<=Hn?`_${t}`:t};function Nn(t,e,r,n,a,i,u,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Kt=(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};function zn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}function Gn(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 "${ae(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=Kt(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 a=e.clone();r=this.rawShare(r,Z.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function Xn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}var qn=()=>{Object.assign(Ft.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)},argPackAdvance:X,readValueFromPointer:pt,fromWireType:Un})};function Ft(t,e,r,n,a,i,u,s,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=zn,this.destructorFunction=null):(this.toWireType=Xn,this.destructorFunction=null):this.toWireType=Gn}var Le=(t,e,r)=>{c.hasOwnProperty(t)||xt("Replacing nonexistent public symbol"),c[t].overloadTable!==void 0&&r!==void 0?c[t].overloadTable[r]=e:(c[t]=e,c[t].argCount=r)},Zn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=c["dynCall_"+t];return n(e,...r)},Rt=[],Ue,w=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=Ue.get(t)),e},Yn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Zn(t,e,r);var n=w(e)(...r);return n},Qn=(t,e)=>function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return Yn(t,e,n)},H=(t,e)=>{t=R(t);function r(){return t.includes("j")?Qn(t,e):w(e)}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n},Jn=(t,e)=>{var r=jt(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
- `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},We,ke=t=>{var e=Ze(t),r=R(e);return Y(e),r},Bt=(t,e)=>{var r=[],n={};function a(i){if(!n[i]&&!tt[i]){if(Dt[i]){Dt[i].forEach(a);return}r.push(i),n[i]=!0}}throw e.forEach(a),new We(`${t}: `+r.map(ke).join([", "]))},Kn=(t,e,r,n,a,i,u,s,l,f,h,y,$)=>{h=R(h),i=H(a,i),s&&(s=H(u,s)),f&&(f=H(l,f)),$=H(y,$);var C=Vn(h);Be(C,function(){Bt(`Cannot construct ${h} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],E=>{E=E[0];var M,S;n?(M=E.registeredClass,S=M.instancePrototype):S=It.prototype;var D=jt(h,function(){if(Object.getPrototypeOf(this)!==rt)throw new st("Use 'new' to construct "+h);if(B.constructor_body===void 0)throw new st(h+" has no accessible constructor");for(var ur=arguments.length,Wt=new Array(ur),kt=0;kt<ur;kt++)Wt[kt]=arguments[kt];var cr=B.constructor_body[Wt.length];if(cr===void 0)throw new st(`Tried to invoke ctor of ${h} with invalid number of parameters (${Wt.length}) - expected (${Object.keys(B.constructor_body).toString()}) parameters instead!`);return cr.apply(this,Wt)}),rt=Object.create(S,{constructor:{value:D}});D.prototype=rt;var B=new Nn(h,D,rt,$,M,i,s,f);if(B.baseClass){var Q,Ut;(Ut=(Q=B.baseClass).__derivedClasses)!==null&&Ut!==void 0||(Q.__derivedClasses=[]),B.baseClass.__derivedClasses.push(B)}var Bi=new Ft(h,B,!0,!1,!1),or=new Ft(h+"*",B,!1,!1,!1),sr=new Ft(h+" const*",B,!1,!0,!1);return Fe[t]={pointerType:or,constPointerType:sr},Le(C,D),[Bi,or,sr]})},te=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(P[e+n*4>>2]);return r};function ta(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function ee(t,e,r,n,a,i){var u=e.length;u<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=e[1]!==null&&r!==null,l=ta(e),f=e[0].name!=="void",h=u-2,y=new Array(h),$=[],C=[],E=function(){C.length=0;var M;$.length=s?2:1,$[0]=a,s&&(M=e[1].toWireType(C,this),$[1]=M);for(var S=0;S<h;++S)y[S]=e[S+2].toWireType(C,S<0||arguments.length<=S?void 0:arguments[S]),$.push(y[S]);var D=n(...$);function rt(B){if(l)Yt(C);else for(var Q=s?1:2;Q<e.length;Q++){var Ut=Q===1?M:y[Q-2];e[Q].destructorFunction!==null&&e[Q].destructorFunction(Ut)}if(f)return e[0].fromWireType(B)}return rt(D)};return jt(t,E)}var ea=(t,e,r,n,a,i)=>{var u=te(e,r);a=H(n,a),et([],[t],s=>{s=s[0];var l=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[e-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[e-1]=()=>{Bt(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,f=>(f.splice(1,0,null),s.registeredClass.constructor_body[e-1]=ee(l,f,null,a,i),[])),[]})},He=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?t.substr(0,e):t},ra=(t,e,r,n,a,i,u,s,l,f)=>{var h=te(r,n);e=R(e),e=He(e),i=H(a,i),et([],[t],y=>{y=y[0];var $=`${y.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&y.registeredClass.pureVirtualFunctions.push(e);function C(){Bt(`Cannot call ${$} due to unbound types`,h)}var E=y.registeredClass.instancePrototype,M=E[e];return M===void 0||M.overloadTable===void 0&&M.className!==y.name&&M.argCount===r-2?(C.argCount=r-2,C.className=y.name,E[e]=C):(Re(E,e,$),E[e].overloadTable[r-2]=C),et([],h,S=>{var D=ee($,S,y,i,u);return E[e].overloadTable===void 0?(D.argCount=r-2,E[e]=D):E[e].overloadTable[r-2]=D,[]}),[]})},re=[],q=[],ne=t=>{t>9&&--q[t+1]===0&&(q[t]=void 0,re.push(t))},na=()=>q.length/2-5-re.length,aa=()=>{q.push(0,1,void 0,1,null,1,!0,1,!1,1),c.count_emval_handles=na},Z={toValue:t=>(t||b("Cannot use deleted val. handle = "+t),q[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()||q.length;return q[e]=t,q[e+1]=1,e}}}},Ve={name:"emscripten::val",fromWireType:t=>{var e=Z.toValue(t);return ne(t),e},toWireType:(t,e)=>Z.toHandle(e),argPackAdvance:X,readValueFromPointer:pt,destructorFunction:null},ia=t=>V(t,Ve),ae=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},oa=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Te[r>>2])};case 8:return function(r){return this.fromWireType(Pe[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},sa=(t,e,r)=>{e=R(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:X,readValueFromPointer:oa(e,r),destructorFunction:null})},ua=(t,e,r,n,a,i,u,s)=>{var l=te(e,r);t=R(t),t=He(t),a=H(n,a),Be(t,function(){Bt(`Cannot call ${t} due to unbound types`,l)},e-1),et([],l,f=>{var h=[f[0],null].concat(f.slice(1));return Le(t,ee(t,h,null,a,i),e-1),[]})},ca=(t,e,r)=>{switch(e){case 1:return r?n=>z[n]:n=>W[n];case 2:return r?n=>dt[n>>1]:n=>Pt[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},la=(t,e,r,n,a)=>{e=R(e);var i=h=>h;if(n===0){var u=32-8*r;i=h=>h<<u>>>u}var s=e.includes("unsigned"),l=(h,y)=>{},f;s?f=function(h,y){return l(y,this.name),y>>>0}:f=function(h,y){return l(y,this.name),y},V(t,{name:e,fromWireType:i,toWireType:f,argPackAdvance:X,readValueFromPointer:ca(e,r,n!==0),destructorFunction:null})},fa=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(u){var s=P[u>>2],l=P[u+4>>2];return new a(z.buffer,l,s)}r=R(r),V(t,{name:r,fromWireType:i,argPackAdvance:X,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},da=Object.assign({optional:!0},Ve),ha=(t,e)=>{V(t,da)},pa=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|s&63}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|s&63}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|s&63}}return e[r]=0,r-a},vt=(t,e,r)=>pa(t,W,e,r),ya=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},Ne=typeof TextDecoder<"u"?new TextDecoder:void 0,ze=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Ne)return Ne.decode(t.subarray(e,a));for(var i="";e<a;){var u=t[e++];if(!(u&128)){i+=String.fromCharCode(u);continue}var s=t[e++]&63;if((u&224)==192){i+=String.fromCharCode((u&31)<<6|s);continue}var l=t[e++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|l:u=(u&7)<<18|s<<12|l<<6|t[e++]&63,u<65536)i+=String.fromCharCode(u);else{var f=u-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},va=(t,e)=>t?ze(W,t,e):"",ma=(t,e)=>{e=R(e),V(t,{name:e,fromWireType(r){for(var n=P[r>>2],a=r+4,i,s,u=a,s=0;s<=n;++s){var l=a+s;if(s==n||W[l]==0){var f=l-u,h=va(u,f);i===void 0?i=h:(i+="\0",i+=h),u=l+1}}return Y(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,i=typeof n=="string";i||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||b("Cannot pass non-string to std::string"),i?a=ya(n):a=n.length;var u=se(4+a+1),s=u+4;if(P[u>>2]=a,i)vt(n,s,a+1);else if(i)for(var l=0;l<a;++l){var f=n.charCodeAt(l);f>255&&(Y(s),b("String has UTF-16 code units that do not fit in 8 bits")),W[s+l]=f}else for(var l=0;l<a;++l)W[s+l]=n[l];return r!==null&&r.push(Y,u),u},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(r){Y(r)}})},Ge=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ga=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Pt[n];)++n;if(r=n<<1,r-t>32&&Ge)return Ge.decode(W.subarray(t,r));for(var i="",u=0;!(u>=e/2);++u){var s=dt[t+u*2>>1];if(s==0)break;i+=String.fromCharCode(s)}return i},wa=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var a=e,i=r<t.length*2?r/2:t.length,u=0;u<i;++u){var s=t.charCodeAt(u);dt[e>>1]=s,e+=2}return dt[e>>1]=0,e-a},$a=t=>t.length*2,ba=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=it[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},Ca=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<4)return 0;for(var a=e,i=a+r-4,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(it[e>>2]=s,e+=4,e+4>i)break}return it[e>>2]=0,e-a},Ta=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Pa=(t,e,r)=>{r=R(r);var n,a,i,u;e===2?(n=ga,a=wa,u=$a,i=s=>Pt[s>>1]):e===4&&(n=ba,a=Ca,u=Ta,i=s=>P[s>>2]),V(t,{name:r,fromWireType:s=>{for(var l=P[s>>2],f,h=s+4,y=0;y<=l;++y){var $=s+4+y*e;if(y==l||i($)==0){var C=$-h,E=n(h,C);f===void 0?f=E:(f+="\0",f+=E),h=$+e}}return Y(s),f},toWireType:(s,l)=>{typeof l!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var f=u(l),h=se(4+f+e);return P[h>>2]=f/e,a(l,h+4,f+e),s!==null&&s.push(Y,h),h},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(s){Y(s)}})},_a=(t,e,r,n,a,i)=>{St[t]={name:R(e),rawConstructor:H(r,n),rawDestructor:H(a,i),fields:[]}},Ea=(t,e,r,n,a,i,u,s,l,f)=>{St[t].fields.push({fieldName:R(e),getterReturnType:r,getter:H(n,a),getterContext:i,setterArgumentType:u,setter:H(s,l),setterContext:f})},Oa=(t,e)=>{e=R(e),V(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},Aa=(t,e,r)=>W.copyWithin(t,e,e+r),ie=[],Sa=(t,e,r,n)=>(t=ie[t],e=Z.toValue(e),t(null,e,r,n)),Da={},xa=t=>{var e=Da[t];return e===void 0?R(t):e},Xe=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},Ma=t=>t===0?Z.toHandle(Xe()):(t=xa(t),Z.toHandle(Xe()[t])),Ia=t=>{var e=ie.length;return ie.push(t),e},qe=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${ke(t)}`),r},ja=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=qe(P[e+n*4>>2],"parameter "+n);return r},Fa=Reflect.construct,Ra=(t,e,r)=>{var n=[],a=t.toWireType(n,r);return n.length&&(P[e>>2]=Z.toHandle(n)),a},Ba=(t,e,r)=>{var n=ja(t,e),a=n.shift();t--;var i=new Array(t),u=(l,f,h,y)=>{for(var $=0,C=0;C<t;++C)i[C]=n[C].readValueFromPointer(y+$),$+=n[C].argPackAdvance;var E=r===1?Fa(f,i):f.apply(l,i);return Ra(a,h,E)},s=`methodCaller<(${n.map(l=>l.name).join(", ")}) => ${a.name}>`;return Ia(jt(s,u))},La=t=>{t>9&&(q[t+1]+=1)},Ua=t=>{var e=Z.toValue(t);Yt(e),ne(t)},Wa=(t,e)=>{t=qe(t,"_emval_take_value");var r=t.readValueFromPointer(e);return Z.toHandle(r)},ka=(t,e,r,n)=>{var a=new Date().getFullYear(),i=new Date(a,0,1),u=new Date(a,6,1),s=i.getTimezoneOffset(),l=u.getTimezoneOffset(),f=Math.max(s,l);P[t>>2]=f*60,it[e>>2]=+(s!=l);var h=C=>{var E=C>=0?"-":"+",M=Math.abs(C),S=String(Math.floor(M/60)).padStart(2,"0"),D=String(M%60).padStart(2,"0");return`UTC${E}${S}${D}`},y=h(s),$=h(l);l<s?(vt(y,r,17),vt($,n,17)):(vt(y,n,17),vt($,r,17))},Ha=()=>2147483648,Va=(t,e)=>Math.ceil(t/e)*e,Na=t=>{var e=Tt.buffer,r=(t-e.byteLength+65535)/65536|0;try{return Tt.grow(r),_e(),1}catch{}},za=t=>{var e=W.length;t>>>=0;var r=Ha();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math.min(r,Va(Math.max(t,a),65536)),u=Na(i);if(u)return!0}return!1},oe={},Ga=()=>nt||"./this.program",mt=()=>{if(!mt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ga()};for(var r in oe)oe[r]===void 0?delete e[r]:e[r]=oe[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);mt.strings=n}return mt.strings},Xa=(t,e)=>{for(var r=0;r<t.length;++r)z[e++]=t.charCodeAt(r);z[e]=0},qa=(t,e)=>{var r=0;return mt().forEach((n,a)=>{var i=e+r;P[t+a*4>>2]=i,Xa(n,i),r+=n.length+1}),0},Za=(t,e)=>{var r=mt();P[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),P[e>>2]=n,0},Ya=t=>52;function Qa(t,e,r,n,a){return 70}var Ja=[null,[],[]],Ka=(t,e)=>{var r=Ja[t];e===0||e===10?((t===1?en:at)(ze(r)),r.length=0):r.push(e)},ti=(t,e,r,n)=>{for(var a=0,i=0;i<r;i++){var u=P[e>>2],s=P[e+4>>2];e+=8;for(var l=0;l<s;l++)Ka(t,W[u+l]);a+=s}return P[n>>2]=a,0},ei=t=>t;De=c.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},xn(),st=c.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Wn(),qn(),We=c.UnboundTypeError=Jn(Error,"UnboundTypeError"),aa();var ri={s:wn,w:$n,a:Cn,j:Tn,l:Pn,M:_n,p:En,ca:On,d:bn,Z:An,sa:Sn,Y:Dn,na:In,qa:Kn,pa:ea,D:ra,la:ia,Q:sa,R:ua,x:la,t:fa,ra:ha,ma,N:Pa,J:_a,ta:Ea,oa:Oa,fa:Aa,U:Sa,ua:ne,wa:Ma,_:Ba,S:La,va:Ua,ka:Wa,$:ka,da:za,aa:qa,ba:Za,ea:Ya,W:Qa,P:ti,H:Ti,B:_i,T:ui,O:Mi,q:wi,b:ai,C:Ci,ha:Oi,c:oi,ga:Ai,h:si,i:hi,r:pi,L:bi,v:vi,G:Di,I:$i,z:Ei,F:Ii,X:Fi,V:Ri,k:li,f:ci,e:ii,g:ni,K:xi,m:di,ia:Pi,o:yi,u:mi,ja:gi,A:Si,n:fi,E:ji,y:ei},O;gn();var Ze=t=>(Ze=O.za)(t),Y=c._free=t=>(Y=c._free=O.Aa)(t),se=c._malloc=t=>(se=c._malloc=O.Ca)(t),Ye=t=>(Ye=O.Da)(t),v=(t,e)=>(v=O.Ea)(t,e),Qe=t=>(Qe=O.Fa)(t),Je=t=>(Je=O.Ga)(t),Ke=()=>(Ke=O.Ha)(),tr=t=>(tr=O.Ia)(t),er=t=>(er=O.Ja)(t),rr=(t,e,r)=>(rr=O.Ka)(t,e,r);c.dynCall_viijii=(t,e,r,n,a,i,u)=>(c.dynCall_viijii=O.La)(t,e,r,n,a,i,u);var nr=c.dynCall_jiii=(t,e,r,n)=>(nr=c.dynCall_jiii=O.Ma)(t,e,r,n);c.dynCall_jiji=(t,e,r,n,a)=>(c.dynCall_jiji=O.Na)(t,e,r,n,a);var ar=c.dynCall_jiiii=(t,e,r,n,a)=>(ar=c.dynCall_jiiii=O.Oa)(t,e,r,n,a);c.dynCall_iiiiij=(t,e,r,n,a,i,u)=>(c.dynCall_iiiiij=O.Pa)(t,e,r,n,a,i,u),c.dynCall_iiiiijj=(t,e,r,n,a,i,u,s,l)=>(c.dynCall_iiiiijj=O.Qa)(t,e,r,n,a,i,u,s,l),c.dynCall_iiiiiijj=(t,e,r,n,a,i,u,s,l,f)=>(c.dynCall_iiiiiijj=O.Ra)(t,e,r,n,a,i,u,s,l,f);function ni(t,e,r,n){var a=g();try{w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ai(t,e){var r=g();try{return w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function ii(t,e,r){var n=g();try{w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function si(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ui(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function ci(t,e){var r=g();try{w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function li(t){var e=g();try{w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function fi(t,e,r,n,a,i,u,s,l,f,h){var y=g();try{w(t)(e,r,n,a,i,u,s,l,f,h)}catch($){if(m(y),$!==$+0)throw $;v(1,0)}}function di(t,e,r,n,a){var i=g();try{w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function hi(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function pi(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function yi(t,e,r,n,a,i){var u=g();try{w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function vi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function mi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function gi(t,e,r,n,a,i,u,s,l){var f=g();try{w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function wi(t){var e=g();try{return w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function $i(t,e,r,n,a,i,u,s,l){var f=g();try{return w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function bi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Ci(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ti(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Pi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function _i(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function Ei(t,e,r,n,a,i,u,s,l,f){var h=g();try{return w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function Ai(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function Si(t,e,r,n,a,i,u,s,l,f){var h=g();try{w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Di(t,e,r,n,a,i,u,s){var l=g();try{return w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function xi(t,e,r,n,a,i,u){var s=g();try{w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Mi(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ii(t,e,r,n,a,i,u,s,l,f,h,y){var $=g();try{return w(t)(e,r,n,a,i,u,s,l,f,h,y)}catch(C){if(m($),C!==C+0)throw C;v(1,0)}}function ji(t,e,r,n,a,i,u,s,l,f,h,y,$,C,E,M){var S=g();try{w(t)(e,r,n,a,i,u,s,l,f,h,y,$,C,E,M)}catch(D){if(m(S),D!==D+0)throw D;v(1,0)}}function Fi(t,e,r,n){var a=g();try{return nr(t,e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ri(t,e,r,n,a){var i=g();try{return ar(t,e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}var Lt;ht=function t(){Lt||ir(),Lt||(ht=t)};function ir(){if(K>0||(rn(),K>0))return;function t(){var e;Lt||(Lt=!0,c.calledRun=!0,!Ce&&(nn(),A(c),(e=c.onRuntimeInitialized)===null||e===void 0||e.call(c),an()))}c.setStatus?(c.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>c.setStatus(""),1),t()},1)):t()}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);c.preInit.length>0;)c.preInit.pop()();return ir(),T=L,T}})();function Nt(o){return le(Vt,o)}function jr(){return Mr(Vt)}function Fr(o){Nt({overrides:o,equalityFn:Object.is,fireImmediately:!1})}async function Rr(o,d){return Ir(Vt,o,d)}const Br="fd885aab6c1040e991da4bdf2c3849d27b3c238c437a29c8d30efbe68e509bb1",fe=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Lr=[...fe,["unknown"]].map(o=>o[0]),zt=new Map(fe);function Ur(o){for(const[d,p]of zt)if(o===p)return d;return"unknown"}function Wr(o){if(de(o))return{width:o.naturalWidth,height:o.naturalHeight};if(he(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(pe(o))return{width:o.videoWidth,height:o.videoHeight};if(ve(o))return{width:o.width,height:o.height};if(ge(o))return{width:o.displayWidth,height:o.displayHeight};if(ye(o))return{width:o.width,height:o.height};if(me(o))return{width:o.width,height:o.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 de(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function he(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function pe(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function ye(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function ve(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function me(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function ge(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function kr(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function Hr(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function Vr(o,d){try{const p=new OffscreenCanvas(o,d);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=o,p.height=d,p}}async function we(o){if(de(o)&&!await Xr(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(he(o)&&!await qr(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ge(o)&&Zr(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(pe(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ve(o)&&Qr(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:d,height:p}=Wr(o);if(d===0||p===0)return null;const c=Vr(d,p).getContext("2d");c.drawImage(o,0,0);try{return c.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Nr(o){let d;try{d=await createImageBitmap(o)}catch{try{if(globalThis.Image){d=new Image;let c="";try{c=URL.createObjectURL(o),d.src=c,await d.decode()}finally{URL.revokeObjectURL(c)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await we(d)}function zr(o){const{width:d,height:p}=o;if(d===0||p===0)return null;const T=o.getContext("2d");try{return T.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Gr(o){if(kr(o))return await Nr(o);if(Hr(o)){if(Yr(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return ye(o)||me(o)?zr(o):await we(o)}async function Xr(o){try{return await o.decode(),!0}catch{return!1}}async function qr(o){var d;try{return await((d=o.decode)==null?void 0:d.call(o)),!0}catch{return!1}}function Zr(o){return o.format===null}function Yr(o){return o.data.buffer.byteLength===0}function Qr(o){return o.width===0&&o.height===0}function $e(o,d){return Jr(o)?new DOMException(`${d}: ${o.message}`,o.name):Kr(o)?new o.constructor(`${d}: ${o.message}`):new Error(`${d}: ${o}`)}function Jr(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function Kr(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}class tn{constructor(d={}){hr(this,ut);var p;try{const T=(p=d==null?void 0:d.formats)==null?void 0:p.filter(c=>c!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const c of T!=null?T:[])if(!zt.has(c))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${c}' is not a valid enum value of type BarcodeFormat.`);pr(this,ut,T!=null?T:[]),Nt({fireImmediately:!0}).catch(()=>{})}catch(T){throw $e(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Lr.filter(d=>d!=="unknown")}async detect(d){try{const p=await Gr(d);if(p===null)return[];let T;const c={tryCode39ExtendedMode:!1,textMode:"Plain",formats:dr(this,ut).map(A=>zt.get(A))};try{T=await Rr(p,c)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(A=>{const{topLeft:{x,y:L},topRight:{x:I,y:k},bottomLeft:{x:N,y:J},bottomRight:{x:nt,y:U}}=A.position,bt=Math.min(x,I,N,nt),ct=Math.min(L,k,J,U),lt=Math.max(x,I,N,nt),ft=Math.max(L,k,J,U);return{boundingBox:new DOMRectReadOnly(bt,ct,lt-bt,ft-ct),rawValue:A.text,format:Ur(A.format),cornerPoints:[{x,y:L},{x:I,y:k},{x:nt,y:U},{x:N,y:J}]}})}catch(p){throw $e(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ut=new WeakMap,(be=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=tn),_.ZXING_CPP_COMMIT=Sr,_.ZXING_WASM_SHA256=Br,_.ZXING_WASM_VERSION=Ar,_.prepareZXingModule=Nt,_.purgeZXingModule=jr,_.setZXingModuleOverrides=Fr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});
1
+ var BarcodeDetectionAPI=function(_){"use strict";var lr=_=>{throw TypeError(_)};var fr=(_,j,F)=>j.has(_)||lr("Cannot "+F);var dr=(_,j,F)=>(fr(_,j,"read from private field"),F?F.call(_):j.get(_)),hr=(_,j,F)=>j.has(_)?lr("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(_):j.set(_,F),pr=(_,j,F,gt)=>(fr(_,j,"write to private field"),gt?gt.call(_,F):j.set(_,F),F);var ut,be;const j=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],F=j.map(([o])=>o),gt=F.filter((o,d)=>j[d][1]==="L"),yr=F.filter((o,d)=>j[d][1]==="M");function Ht(o){switch(o){case"Linear-Codes":return gt.reduce((d,p)=>d|Ht(p),0);case"Matrix-Codes":return yr.reduce((d,p)=>d|Ht(p),0);case"Any":return(1<<j.length)-1;case"None":return 0;default:return 1<<F.indexOf(o)}}function vr(o){if(o===0)return"None";const d=31-Math.clz32(o);return F[d]}function mr(o){return o.reduce((d,p)=>d|Ht(p),0)}const gr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function wr(o){return gr.indexOf(o)}const ue=["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","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function $r(o){return o==="UnicodeBig"?ue.indexOf("UTF16BE"):ue.indexOf(o)}const br=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Cr(o){return br[o]}const Tr=["Ignore","Read","Require"];function Pr(o){return Tr.indexOf(o)}const _r=["Plain","ECI","HRI","Hex","Escaped"];function Er(o){return _r.indexOf(o)}const wt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function ce(o){return{...o,formats:mr(o.formats),binarizer:wr(o.binarizer),eanAddOnSymbol:Pr(o.eanAddOnSymbol),textMode:Er(o.textMode),characterSet:$r(o.characterSet)}}function Or(o){return{...o,format:vr(o.format),contentType:Cr(o.contentType),eccLevel:o.ecLevel}}const Ar="2.1.0",Sr="37b847798a1af55d3a289a9516a751fcafae3c23",Dr={locateFile:(o,d)=>{const p=o.match(/_(.+?)\.wasm$/);return p?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.1.0/dist/${p[1]}/${o}`:d+o}},$t=new WeakMap;function xr(o,d){return Object.is(o,d)||Object.keys(o).length===Object.keys(d).length&&Object.keys(o).every(p=>Object.prototype.hasOwnProperty.call(d,p)&&o[p]===d[p])}function le(o,{overrides:d,equalityFn:p=xr,fireImmediately:T=!1}={}){var c;const[A,I]=(c=$t.get(o))!=null?c:[Dr],U=d!=null?d:A;let S;if(T){if(I&&(S=p(A,U)))return I;const R=o({...U});return $t.set(o,[U,R]),R}(S!=null?S:p(A,U))||$t.set(o,[U])}function Ir(o){$t.delete(o)}async function Mr(o,d,p=wt){const T={...wt,...p},c=await le(o,{fireImmediately:!0});let A,I;if("width"in d&&"height"in d&&"data"in d){const{data:S,data:{byteLength:R},width:N,height:J}=d;I=c._malloc(R),c.HEAPU8.set(S,I),A=c.readBarcodesFromPixmap(I,N,J,ce(T))}else{let S,R;if("buffer"in d)[S,R]=[d.byteLength,d];else if("byteLength"in d)[S,R]=[d.byteLength,new Uint8Array(d)];else if("size"in d)[S,R]=[d.size,new Uint8Array(await d.arrayBuffer())];else throw new TypeError("Invalid input type");I=c._malloc(S),c.HEAPU8.set(R,I),A=c.readBarcodesFromImage(I,S,ce(T))}c._free(I);const U=[];for(let S=0;S<A.size();++S)U.push(Or(A.get(S)));return U}({...wt,formats:[...wt.formats]});var Vt=(()=>{var o,d=typeof document<"u"&&((o=document.currentScript)==null?void 0:o.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(p={}){var T,c=p,A,I,U=new Promise((t,e)=>{A=t,I=e}),S=typeof window=="object",R=typeof Bun<"u",N=typeof WorkerGlobalScope<"u";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var J=Object.assign({},c),nt="./this.program",W="";function bt(t){return c.locateFile?c.locateFile(t,W):W+t}var ct,lt;if(S||N||R){var ft;N?W=self.location.href:typeof document<"u"&&((ft=document.currentScript)===null||ft===void 0?void 0:ft.tagName.toUpperCase())==="SCRIPT"&&(W=document.currentScript.src),d&&(W=d),W.startsWith("blob:")?W="":W=W.substr(0,W.replace(/[?#].*/,"").lastIndexOf("/")+1),N&&(lt=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),ct=async t=>{var e=await fetch(t,{credentials:"same-origin"});if(e.ok)return e.arrayBuffer();throw new Error(e.status+" : "+e.url)}}var en=c.print||console.log.bind(console),at=c.printErr||console.error.bind(console);Object.assign(c,J),J=null,c.arguments&&c.arguments,c.thisProgram&&(nt=c.thisProgram);var Ct=c.wasmBinary,Tt,Ce=!1,z,k,dt,Pt,it,P,Te,Pe;function _e(){var t=Tt.buffer;c.HEAP8=z=new Int8Array(t),c.HEAP16=dt=new Int16Array(t),c.HEAPU8=k=new Uint8Array(t),c.HEAPU16=Pt=new Uint16Array(t),c.HEAP32=it=new Int32Array(t),c.HEAPU32=P=new Uint32Array(t),c.HEAPF32=Te=new Float32Array(t),c.HEAPF64=Pe=new Float64Array(t)}var Ee=[],Oe=[],Ae=[];function rn(){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)on(c.preRun.shift());Xt(Ee)}function nn(){Xt(Oe)}function an(){if(c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;)un(c.postRun.shift());Xt(Ae)}function on(t){Ee.unshift(t)}function sn(t){Oe.unshift(t)}function un(t){Ae.unshift(t)}var K=0,ht=null;function cn(t){var e;K++,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K)}function ln(t){var e;if(K--,(e=c.monitorRunDependencies)===null||e===void 0||e.call(c,K),K==0&&ht){var r=ht;ht=null,r()}}function Gt(t){var e;(e=c.onAbort)===null||e===void 0||e.call(c,t),t="Aborted("+t+")",at(t),Ce=!0,t+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(t);throw I(r),r}var fn="data:application/octet-stream;base64,",Se=t=>t.startsWith(fn);function dn(){var t="zxing_reader.wasm";return Se(t)?t:bt(t)}var _t;function hn(t){if(t==_t&&Ct)return new Uint8Array(Ct);if(lt)return lt(t);throw"both async and sync fetching of the wasm failed"}async function pn(t){if(!Ct)try{var e=await ct(t);return new Uint8Array(e)}catch{}return hn(t)}async function yn(t,e){try{var r=await pn(t),n=await WebAssembly.instantiate(r,e);return n}catch(a){at(`failed to asynchronously prepare wasm: ${a}`),Gt(a)}}async function vn(t,e,r){if(!t&&typeof WebAssembly.instantiateStreaming=="function"&&!Se(e)&&typeof fetch=="function")try{var n=fetch(e,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(n,r);return a}catch(i){at(`wasm streaming compile failed: ${i}`),at("falling back to ArrayBuffer instantiation")}return yn(e,r)}function mn(){return{a:ri}}async function gn(){var t;function e(i,u){return O=i.exports,Tt=O.xa,_e(),Ue=O.Ba,sn(O.ya),ln(),O}cn();function r(i){e(i.instance)}var n=mn();if(c.instantiateWasm)try{return c.instantiateWasm(n,e)}catch(i){at(`Module.instantiateWasm callback failed with error: ${i}`),I(i)}(t=_t)!==null&&t!==void 0||(_t=dn());try{var a=await vn(Ct,_t,n);return r(a),a}catch(i){I(i);return}}var Xt=t=>{for(;t.length>0;)t.shift()(c)};c.noExitRuntime;var m=t=>Je(t),g=()=>Ke(),Et=[],Ot=0,wn=t=>{var e=new qt(t);return e.get_caught()||(e.set_caught(!0),Ot--),e.set_rethrown(!1),Et.push(e),er(t),Ye(t)},G=0,$n=()=>{v(0,0);var t=Et.pop();tr(t.excPtr),G=0};class qt{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){P[this.ptr+4>>2]=e}get_type(){return P[this.ptr+4>>2]}set_destructor(e){P[this.ptr+8>>2]=e}get_destructor(){return P[this.ptr+8>>2]}set_caught(e){e=e?1:0,z[this.ptr+12]=e}get_caught(){return z[this.ptr+12]!=0}set_rethrown(e){e=e?1:0,z[this.ptr+13]=e}get_rethrown(){return z[this.ptr+13]!=0}init(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)}set_adjusted_ptr(e){P[this.ptr+16>>2]=e}get_adjusted_ptr(){return P[this.ptr+16>>2]}}var bn=t=>{throw G||(G=t),G},At=t=>Qe(t),Zt=t=>{var e=G;if(!e)return At(0),0;var r=new qt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return At(0),e;for(var a of t){if(a===0||a===n)break;var i=r.ptr+16;if(rr(a,n,i))return At(a),e}return At(n),e},Cn=()=>Zt([]),Tn=t=>Zt([t]),Pn=(t,e)=>Zt([t,e]),_n=()=>{var t=Et.pop();t||Gt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Et.push(t),t.set_rethrown(!0),t.set_caught(!1),Ot++),G=e,G},En=(t,e,r)=>{var n=new qt(t);throw n.init(e,r),G=t,Ot++,G},On=()=>Ot,An=()=>Gt(""),St={},Yt=t=>{for(;t.length;){var e=t.pop(),r=t.pop();r(e)}};function pt(t){return this.fromWireType(P[t>>2])}var ot={},tt={},Dt={},De,xt=t=>{throw new De(t)},et=(t,e,r)=>{t.forEach(s=>Dt[s]=e);function n(s){var l=r(s);l.length!==t.length&&xt("Mismatched type converter count");for(var f=0;f<t.length;++f)V(t[f],l[f])}var a=new Array(e.length),i=[],u=0;e.forEach((s,l)=>{tt.hasOwnProperty(s)?a[l]=tt[s]:(i.push(s),ot.hasOwnProperty(s)||(ot[s]=[]),ot[s].push(()=>{a[l]=tt[s],++u,u===i.length&&n(a)}))}),i.length===0&&n(a)},Sn=t=>{var e=St[t];delete St[t];var r=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(u=>u.getterReturnType).concat(a.map(u=>u.setterArgumentType));et([t],i,u=>{var s={};return a.forEach((l,f)=>{var h=l.fieldName,y=u[f],$=l.getter,C=l.getterContext,E=u[f+a.length],M=l.setter,D=l.setterContext;s[h]={read:x=>y.fromWireType($(C,x)),write:(x,rt)=>{var L=[];M(D,x,E.toWireType(L,rt)),Yt(L)}}}),[{name:e.name,fromWireType:l=>{var f={};for(var h in s)f[h]=s[h].read(l);return n(l),f},toWireType:(l,f)=>{for(var h in s)if(!(h in f))throw new TypeError(`Missing field: "${h}"`);var y=r();for(h in s)s[h].write(y,f[h]);return l!==null&&l.push(n,y),y},argPackAdvance:X,readValueFromPointer:pt,destructorFunction:n}]})},Dn=(t,e,r,n,a)=>{},xn=()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);xe=t},xe,B=t=>{for(var e="",r=t;k[r];)e+=xe[k[r++]];return e},st,b=t=>{throw new st(t)};function In(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 Dt[t],ot.hasOwnProperty(t)){var a=ot[t];delete ot[t],a.forEach(i=>i())}}function V(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return In(t,e,r)}var X=8,Mn=(t,e,r,n)=>{e=B(e),V(t,{name:e,fromWireType:function(a){return!!a},toWireType:function(a,i){return i?r:n},argPackAdvance:X,readValueFromPointer:function(a){return this.fromWireType(k[a])},destructorFunction:null})},jn=t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),Qt=t=>{function e(r){return r.$$.ptrType.registeredClass.name}b(e(t)+" instance already deleted")},Jt=!1,Ie=t=>{},Fn=t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},Me=t=>{t.count.value-=1;var e=t.count.value===0;e&&Fn(t)},je=(t,e,r)=>{if(e===r)return t;if(r.baseClass===void 0)return null;var n=je(t,e,r.baseClass);return n===null?null:r.downcast(n)},Fe={},Rn={},Bn=(t,e)=>{for(e===void 0&&b("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e},Ln=(t,e)=>(e=Bn(t,e),Rn[e]),It=(t,e)=>{(!e.ptrType||!e.ptr)&&xt("makeClassHandle requires ptr and ptrType");var r=!!e.smartPtrType,n=!!e.smartPtr;return r!==n&&xt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},yt(Object.create(t,{$$:{value:e,writable:!0}}))};function Un(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Ln(this.registeredClass,e);if(r!==void 0){if(r.$$.count.value===0)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function a(){return this.isSmartPointer?It(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):It(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i=this.registeredClass.getActualType(e),u=Fe[i];if(!u)return a.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var l=je(e,this.registeredClass,s.registeredClass);return l===null?a.call(this):this.isSmartPointer?It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l,smartPtrType:this,smartPtr:t}):It(s.registeredClass.instancePrototype,{ptrType:s,ptr:l})}var yt=t=>typeof FinalizationRegistry>"u"?(yt=e=>e,t):(Jt=new FinalizationRegistry(e=>{Me(e.$$)}),yt=e=>{var r=e.$$,n=!!r.smartPtr;if(n){var a={$$:r};Jt.register(e,a,e)}return e},Ie=e=>Jt.unregister(e),yt(t)),Wn=()=>{Object.assign(Mt.prototype,{isAliasOf(t){if(!(this instanceof Mt)||!(t instanceof Mt))return!1;var e=this.$$.ptrType.registeredClass,r=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,a=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)a=n.upcast(a),n=n.baseClass;return e===n&&r===a},clone(){if(this.$$.ptr||Qt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=yt(Object.create(Object.getPrototypeOf(this),{$$:{value:jn(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),Ie(this),Me(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}})};function Mt(){}var jt=(t,e)=>Object.defineProperty(e,"name",{value:t}),Re=(t,e,r)=>{if(t[e].overloadTable===void 0){var n=t[e];t[e]=function(){for(var a=arguments.length,i=new Array(a),u=0;u<a;u++)i[u]=arguments[u];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}},Be=(t,e,r)=>{c.hasOwnProperty(t)?((r===void 0||c[t].overloadTable!==void 0&&c[t].overloadTable[r]!==void 0)&&b(`Cannot register public name '${t}' twice`),Re(c,t,t),c[t].overloadTable.hasOwnProperty(r)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),c[t].overloadTable[r]=e):(c[t]=e,c[t].argCount=r)},kn=48,Hn=57,Vn=t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var e=t.charCodeAt(0);return e>=kn&&e<=Hn?`_${t}`:t};function Nn(t,e,r,n,a,i,u,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=a,this.getActualType=i,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}var Kt=(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};function zn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}function Gn(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 "${ae(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=Kt(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 a=e.clone();r=this.rawShare(r,Z.toHandle(()=>a.delete())),t!==null&&t.push(this.rawDestructor,r)}break;default:b("Unsupporting sharing policy")}return r}function Xn(t,e){if(e===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;e.$$||b(`Cannot pass "${ae(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=Kt(e.$$.ptr,r,this.registeredClass);return n}var qn=()=>{Object.assign(Ft.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)},argPackAdvance:X,readValueFromPointer:pt,fromWireType:Un})};function Ft(t,e,r,n,a,i,u,s,l,f,h){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=a,this.pointeeType=i,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=f,this.rawDestructor=h,!a&&e.baseClass===void 0?n?(this.toWireType=zn,this.destructorFunction=null):(this.toWireType=Xn,this.destructorFunction=null):this.toWireType=Gn}var Le=(t,e,r)=>{c.hasOwnProperty(t)||xt("Replacing nonexistent public symbol"),c[t].overloadTable!==void 0&&r!==void 0?c[t].overloadTable[r]=e:(c[t]=e,c[t].argCount=r)},Zn=(t,e,r)=>{t=t.replace(/p/g,"i");var n=c["dynCall_"+t];return n(e,...r)},Rt=[],Ue,w=t=>{var e=Rt[t];return e||(t>=Rt.length&&(Rt.length=t+1),Rt[t]=e=Ue.get(t)),e},Yn=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Zn(t,e,r);var n=w(e)(...r);return n},Qn=(t,e)=>function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];return Yn(t,e,n)},H=(t,e)=>{t=B(t);function r(){return t.includes("j")?Qn(t,e):w(e)}var n=r();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${e}`),n},Jn=(t,e)=>{var r=jt(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+`
2
+ `+a.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},r},We,ke=t=>{var e=Ze(t),r=B(e);return Y(e),r},Bt=(t,e)=>{var r=[],n={};function a(i){if(!n[i]&&!tt[i]){if(Dt[i]){Dt[i].forEach(a);return}r.push(i),n[i]=!0}}throw e.forEach(a),new We(`${t}: `+r.map(ke).join([", "]))},Kn=(t,e,r,n,a,i,u,s,l,f,h,y,$)=>{h=B(h),i=H(a,i),s&&(s=H(u,s)),f&&(f=H(l,f)),$=H(y,$);var C=Vn(h);Be(C,function(){Bt(`Cannot construct ${h} due to unbound types`,[n])}),et([t,e,r],n?[n]:[],E=>{E=E[0];var M,D;n?(M=E.registeredClass,D=M.instancePrototype):D=Mt.prototype;var x=jt(h,function(){if(Object.getPrototypeOf(this)!==rt)throw new st("Use 'new' to construct "+h);if(L.constructor_body===void 0)throw new st(h+" has no accessible constructor");for(var ur=arguments.length,Wt=new Array(ur),kt=0;kt<ur;kt++)Wt[kt]=arguments[kt];var cr=L.constructor_body[Wt.length];if(cr===void 0)throw new st(`Tried to invoke ctor of ${h} with invalid number of parameters (${Wt.length}) - expected (${Object.keys(L.constructor_body).toString()}) parameters instead!`);return cr.apply(this,Wt)}),rt=Object.create(D,{constructor:{value:x}});x.prototype=rt;var L=new Nn(h,x,rt,$,M,i,s,f);if(L.baseClass){var Q,Ut;(Ut=(Q=L.baseClass).__derivedClasses)!==null&&Ut!==void 0||(Q.__derivedClasses=[]),L.baseClass.__derivedClasses.push(L)}var Bi=new Ft(h,L,!0,!1,!1),or=new Ft(h+"*",L,!1,!1,!1),sr=new Ft(h+" const*",L,!1,!0,!1);return Fe[t]={pointerType:or,constPointerType:sr},Le(C,x),[Bi,or,sr]})},te=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(P[e+n*4>>2]);return r};function ta(t){for(var e=1;e<t.length;++e)if(t[e]!==null&&t[e].destructorFunction===void 0)return!0;return!1}function ee(t,e,r,n,a,i){var u=e.length;u<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=e[1]!==null&&r!==null,l=ta(e),f=e[0].name!=="void",h=u-2,y=new Array(h),$=[],C=[],E=function(){C.length=0;var M;$.length=s?2:1,$[0]=a,s&&(M=e[1].toWireType(C,this),$[1]=M);for(var D=0;D<h;++D)y[D]=e[D+2].toWireType(C,D<0||arguments.length<=D?void 0:arguments[D]),$.push(y[D]);var x=n(...$);function rt(L){if(l)Yt(C);else for(var Q=s?1:2;Q<e.length;Q++){var Ut=Q===1?M:y[Q-2];e[Q].destructorFunction!==null&&e[Q].destructorFunction(Ut)}if(f)return e[0].fromWireType(L)}return rt(x)};return jt(t,E)}var ea=(t,e,r,n,a,i)=>{var u=te(e,r);a=H(n,a),et([],[t],s=>{s=s[0];var l=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[e-1]!==void 0)throw new st(`Cannot register multiple constructors with identical number of parameters (${e-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[e-1]=()=>{Bt(`Cannot construct ${s.name} due to unbound types`,u)},et([],u,f=>(f.splice(1,0,null),s.registeredClass.constructor_body[e-1]=ee(l,f,null,a,i),[])),[]})},He=t=>{t=t.trim();const e=t.indexOf("(");return e!==-1?t.substr(0,e):t},ra=(t,e,r,n,a,i,u,s,l,f)=>{var h=te(r,n);e=B(e),e=He(e),i=H(a,i),et([],[t],y=>{y=y[0];var $=`${y.name}.${e}`;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&y.registeredClass.pureVirtualFunctions.push(e);function C(){Bt(`Cannot call ${$} due to unbound types`,h)}var E=y.registeredClass.instancePrototype,M=E[e];return M===void 0||M.overloadTable===void 0&&M.className!==y.name&&M.argCount===r-2?(C.argCount=r-2,C.className=y.name,E[e]=C):(Re(E,e,$),E[e].overloadTable[r-2]=C),et([],h,D=>{var x=ee($,D,y,i,u);return E[e].overloadTable===void 0?(x.argCount=r-2,E[e]=x):E[e].overloadTable[r-2]=x,[]}),[]})},re=[],q=[],ne=t=>{t>9&&--q[t+1]===0&&(q[t]=void 0,re.push(t))},na=()=>q.length/2-5-re.length,aa=()=>{q.push(0,1,void 0,1,null,1,!0,1,!1,1),c.count_emval_handles=na},Z={toValue:t=>(t||b("Cannot use deleted val. handle = "+t),q[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()||q.length;return q[e]=t,q[e+1]=1,e}}}},Ve={name:"emscripten::val",fromWireType:t=>{var e=Z.toValue(t);return ne(t),e},toWireType:(t,e)=>Z.toHandle(e),argPackAdvance:X,readValueFromPointer:pt,destructorFunction:null},ia=t=>V(t,Ve),ae=t=>{if(t===null)return"null";var e=typeof t;return e==="object"||e==="array"||e==="function"?t.toString():""+t},oa=(t,e)=>{switch(e){case 4:return function(r){return this.fromWireType(Te[r>>2])};case 8:return function(r){return this.fromWireType(Pe[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},sa=(t,e,r)=>{e=B(e),V(t,{name:e,fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:X,readValueFromPointer:oa(e,r),destructorFunction:null})},ua=(t,e,r,n,a,i,u,s)=>{var l=te(e,r);t=B(t),t=He(t),a=H(n,a),Be(t,function(){Bt(`Cannot call ${t} due to unbound types`,l)},e-1),et([],l,f=>{var h=[f[0],null].concat(f.slice(1));return Le(t,ee(t,h,null,a,i),e-1),[]})},ca=(t,e,r)=>{switch(e){case 1:return r?n=>z[n]:n=>k[n];case 2:return r?n=>dt[n>>1]:n=>Pt[n>>1];case 4:return r?n=>it[n>>2]:n=>P[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},la=(t,e,r,n,a)=>{e=B(e);var i=h=>h;if(n===0){var u=32-8*r;i=h=>h<<u>>>u}var s=e.includes("unsigned"),l=(h,y)=>{},f;s?f=function(h,y){return l(y,this.name),y>>>0}:f=function(h,y){return l(y,this.name),y},V(t,{name:e,fromWireType:i,toWireType:f,argPackAdvance:X,readValueFromPointer:ca(e,r,n!==0),destructorFunction:null})},fa=(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],a=n[e];function i(u){var s=P[u>>2],l=P[u+4>>2];return new a(z.buffer,l,s)}r=B(r),V(t,{name:r,fromWireType:i,argPackAdvance:X,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},da=Object.assign({optional:!0},Ve),ha=(t,e)=>{V(t,da)},pa=(t,e,r,n)=>{if(!(n>0))return 0;for(var a=r,i=r+n-1,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|s&63}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|s&63}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|s&63}}return e[r]=0,r-a},vt=(t,e,r)=>pa(t,k,e,r),ya=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},Ne=typeof TextDecoder<"u"?new TextDecoder:void 0,ze=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=e+r,a=e;t[a]&&!(a>=n);)++a;if(a-e>16&&t.buffer&&Ne)return Ne.decode(t.subarray(e,a));for(var i="";e<a;){var u=t[e++];if(!(u&128)){i+=String.fromCharCode(u);continue}var s=t[e++]&63;if((u&224)==192){i+=String.fromCharCode((u&31)<<6|s);continue}var l=t[e++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|l:u=(u&7)<<18|s<<12|l<<6|t[e++]&63,u<65536)i+=String.fromCharCode(u);else{var f=u-65536;i+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return i},va=(t,e)=>t?ze(k,t,e):"",ma=(t,e)=>{e=B(e),V(t,{name:e,fromWireType(r){for(var n=P[r>>2],a=r+4,i,s,u=a,s=0;s<=n;++s){var l=a+s;if(s==n||k[l]==0){var f=l-u,h=va(u,f);i===void 0?i=h:(i+="\0",i+=h),u=l+1}}return Y(r),i},toWireType(r,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var a,i=typeof n=="string";i||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||b("Cannot pass non-string to std::string"),i?a=ya(n):a=n.length;var u=se(4+a+1),s=u+4;if(P[u>>2]=a,i)vt(n,s,a+1);else if(i)for(var l=0;l<a;++l){var f=n.charCodeAt(l);f>255&&(Y(s),b("String has UTF-16 code units that do not fit in 8 bits")),k[s+l]=f}else for(var l=0;l<a;++l)k[s+l]=n[l];return r!==null&&r.push(Y,u),u},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(r){Y(r)}})},Ge=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,ga=(t,e)=>{for(var r=t,n=r>>1,a=n+e/2;!(n>=a)&&Pt[n];)++n;if(r=n<<1,r-t>32&&Ge)return Ge.decode(k.subarray(t,r));for(var i="",u=0;!(u>=e/2);++u){var s=dt[t+u*2>>1];if(s==0)break;i+=String.fromCharCode(s)}return i},wa=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<2)return 0;r-=2;for(var a=e,i=r<t.length*2?r/2:t.length,u=0;u<i;++u){var s=t.charCodeAt(u);dt[e>>1]=s,e+=2}return dt[e>>1]=0,e-a},$a=t=>t.length*2,ba=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var a=it[t+r*4>>2];if(a==0)break;if(++r,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|i&1023)}else n+=String.fromCharCode(a)}return n},Ca=(t,e,r)=>{var n;if((n=r)!==null&&n!==void 0||(r=2147483647),r<4)return 0;for(var a=e,i=a+r-4,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var l=t.charCodeAt(++u);s=65536+((s&1023)<<10)|l&1023}if(it[e>>2]=s,e+=4,e+4>i)break}return it[e>>2]=0,e-a},Ta=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Pa=(t,e,r)=>{r=B(r);var n,a,i,u;e===2?(n=ga,a=wa,u=$a,i=s=>Pt[s>>1]):e===4&&(n=ba,a=Ca,u=Ta,i=s=>P[s>>2]),V(t,{name:r,fromWireType:s=>{for(var l=P[s>>2],f,h=s+4,y=0;y<=l;++y){var $=s+4+y*e;if(y==l||i($)==0){var C=$-h,E=n(h,C);f===void 0?f=E:(f+="\0",f+=E),h=$+e}}return Y(s),f},toWireType:(s,l)=>{typeof l!="string"&&b(`Cannot pass non-string to C++ string type ${r}`);var f=u(l),h=se(4+f+e);return P[h>>2]=f/e,a(l,h+4,f+e),s!==null&&s.push(Y,h),h},argPackAdvance:X,readValueFromPointer:pt,destructorFunction(s){Y(s)}})},_a=(t,e,r,n,a,i)=>{St[t]={name:B(e),rawConstructor:H(r,n),rawDestructor:H(a,i),fields:[]}},Ea=(t,e,r,n,a,i,u,s,l,f)=>{St[t].fields.push({fieldName:B(e),getterReturnType:r,getter:H(n,a),getterContext:i,setterArgumentType:u,setter:H(s,l),setterContext:f})},Oa=(t,e)=>{e=B(e),V(t,{isVoid:!0,name:e,argPackAdvance:0,fromWireType:()=>{},toWireType:(r,n)=>{}})},Aa=(t,e,r)=>k.copyWithin(t,e,e+r),ie=[],Sa=(t,e,r,n)=>(t=ie[t],e=Z.toValue(e),t(null,e,r,n)),Da={},xa=t=>{var e=Da[t];return e===void 0?B(t):e},Xe=()=>{if(typeof globalThis=="object")return globalThis;function t(e){e.$$$embind_global$$$=e;var r=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},Ia=t=>t===0?Z.toHandle(Xe()):(t=xa(t),Z.toHandle(Xe()[t])),Ma=t=>{var e=ie.length;return ie.push(t),e},qe=(t,e)=>{var r=tt[t];return r===void 0&&b(`${e} has unknown type ${ke(t)}`),r},ja=(t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=qe(P[e+n*4>>2],"parameter "+n);return r},Fa=Reflect.construct,Ra=(t,e,r)=>{var n=[],a=t.toWireType(n,r);return n.length&&(P[e>>2]=Z.toHandle(n)),a},Ba=(t,e,r)=>{var n=ja(t,e),a=n.shift();t--;var i=new Array(t),u=(l,f,h,y)=>{for(var $=0,C=0;C<t;++C)i[C]=n[C].readValueFromPointer(y+$),$+=n[C].argPackAdvance;var E=r===1?Fa(f,i):f.apply(l,i);return Ra(a,h,E)},s=`methodCaller<(${n.map(l=>l.name).join(", ")}) => ${a.name}>`;return Ma(jt(s,u))},La=t=>{t>9&&(q[t+1]+=1)},Ua=t=>{var e=Z.toValue(t);Yt(e),ne(t)},Wa=(t,e)=>{t=qe(t,"_emval_take_value");var r=t.readValueFromPointer(e);return Z.toHandle(r)},ka=(t,e,r,n)=>{var a=new Date().getFullYear(),i=new Date(a,0,1),u=new Date(a,6,1),s=i.getTimezoneOffset(),l=u.getTimezoneOffset(),f=Math.max(s,l);P[t>>2]=f*60,it[e>>2]=+(s!=l);var h=C=>{var E=C>=0?"-":"+",M=Math.abs(C),D=String(Math.floor(M/60)).padStart(2,"0"),x=String(M%60).padStart(2,"0");return`UTC${E}${D}${x}`},y=h(s),$=h(l);l<s?(vt(y,r,17),vt($,n,17)):(vt(y,n,17),vt($,r,17))},Ha=()=>2147483648,Va=(t,e)=>Math.ceil(t/e)*e,Na=t=>{var e=Tt.buffer,r=(t-e.byteLength+65535)/65536|0;try{return Tt.grow(r),_e(),1}catch{}},za=t=>{var e=k.length;t>>>=0;var r=Ha();if(t>r)return!1;for(var n=1;n<=4;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math.min(r,Va(Math.max(t,a),65536)),u=Na(i);if(u)return!0}return!1},oe={},Ga=()=>nt||"./this.program",mt=()=>{if(!mt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Ga()};for(var r in oe)oe[r]===void 0?delete e[r]:e[r]=oe[r];var n=[];for(var r in e)n.push(`${r}=${e[r]}`);mt.strings=n}return mt.strings},Xa=(t,e)=>{for(var r=0;r<t.length;++r)z[e++]=t.charCodeAt(r);z[e]=0},qa=(t,e)=>{var r=0;return mt().forEach((n,a)=>{var i=e+r;P[t+a*4>>2]=i,Xa(n,i),r+=n.length+1}),0},Za=(t,e)=>{var r=mt();P[t>>2]=r.length;var n=0;return r.forEach(a=>n+=a.length+1),P[e>>2]=n,0},Ya=t=>52;function Qa(t,e,r,n,a){return 70}var Ja=[null,[],[]],Ka=(t,e)=>{var r=Ja[t];e===0||e===10?((t===1?en:at)(ze(r)),r.length=0):r.push(e)},ti=(t,e,r,n)=>{for(var a=0,i=0;i<r;i++){var u=P[e>>2],s=P[e+4>>2];e+=8;for(var l=0;l<s;l++)Ka(t,k[u+l]);a+=s}return P[n>>2]=a,0},ei=t=>t;De=c.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},xn(),st=c.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Wn(),qn(),We=c.UnboundTypeError=Jn(Error,"UnboundTypeError"),aa();var ri={s:wn,w:$n,a:Cn,j:Tn,l:Pn,M:_n,p:En,ca:On,d:bn,Z:An,sa:Sn,Y:Dn,na:Mn,qa:Kn,pa:ea,D:ra,la:ia,Q:sa,R:ua,x:la,t:fa,ra:ha,ma,N:Pa,J:_a,ta:Ea,oa:Oa,fa:Aa,U:Sa,ua:ne,wa:Ia,_:Ba,S:La,va:Ua,ka:Wa,$:ka,da:za,aa:qa,ba:Za,ea:Ya,W:Qa,P:ti,H:Ti,B:_i,T:ui,O:Ii,q:wi,b:ai,C:Ci,ha:Oi,c:oi,ga:Ai,h:si,i:hi,r:pi,L:bi,v:vi,G:Di,I:$i,z:Ei,F:Mi,X:Fi,V:Ri,k:li,f:ci,e:ii,g:ni,K:xi,m:di,ia:Pi,o:yi,u:mi,ja:gi,A:Si,n:fi,E:ji,y:ei},O;gn();var Ze=t=>(Ze=O.za)(t),Y=c._free=t=>(Y=c._free=O.Aa)(t),se=c._malloc=t=>(se=c._malloc=O.Ca)(t),Ye=t=>(Ye=O.Da)(t),v=(t,e)=>(v=O.Ea)(t,e),Qe=t=>(Qe=O.Fa)(t),Je=t=>(Je=O.Ga)(t),Ke=()=>(Ke=O.Ha)(),tr=t=>(tr=O.Ia)(t),er=t=>(er=O.Ja)(t),rr=(t,e,r)=>(rr=O.Ka)(t,e,r);c.dynCall_viijii=(t,e,r,n,a,i,u)=>(c.dynCall_viijii=O.La)(t,e,r,n,a,i,u);var nr=c.dynCall_jiii=(t,e,r,n)=>(nr=c.dynCall_jiii=O.Ma)(t,e,r,n);c.dynCall_jiji=(t,e,r,n,a)=>(c.dynCall_jiji=O.Na)(t,e,r,n,a);var ar=c.dynCall_jiiii=(t,e,r,n,a)=>(ar=c.dynCall_jiiii=O.Oa)(t,e,r,n,a);c.dynCall_iiiiij=(t,e,r,n,a,i,u)=>(c.dynCall_iiiiij=O.Pa)(t,e,r,n,a,i,u),c.dynCall_iiiiijj=(t,e,r,n,a,i,u,s,l)=>(c.dynCall_iiiiijj=O.Qa)(t,e,r,n,a,i,u,s,l),c.dynCall_iiiiiijj=(t,e,r,n,a,i,u,s,l,f)=>(c.dynCall_iiiiiijj=O.Ra)(t,e,r,n,a,i,u,s,l,f);function ni(t,e,r,n){var a=g();try{w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ai(t,e){var r=g();try{return w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function ii(t,e,r){var n=g();try{w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function si(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function ui(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function ci(t,e){var r=g();try{w(t)(e)}catch(n){if(m(r),n!==n+0)throw n;v(1,0)}}function li(t){var e=g();try{w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function fi(t,e,r,n,a,i,u,s,l,f,h){var y=g();try{w(t)(e,r,n,a,i,u,s,l,f,h)}catch($){if(m(y),$!==$+0)throw $;v(1,0)}}function di(t,e,r,n,a){var i=g();try{w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function hi(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function pi(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function yi(t,e,r,n,a,i){var u=g();try{w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function vi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function mi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function gi(t,e,r,n,a,i,u,s,l){var f=g();try{w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function wi(t){var e=g();try{return w(t)()}catch(r){if(m(e),r!==r+0)throw r;v(1,0)}}function $i(t,e,r,n,a,i,u,s,l){var f=g();try{return w(t)(e,r,n,a,i,u,s,l)}catch(h){if(m(f),h!==h+0)throw h;v(1,0)}}function bi(t,e,r,n,a,i,u){var s=g();try{return w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Ci(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ti(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Pi(t,e,r,n,a,i,u,s){var l=g();try{w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function _i(t,e,r,n,a,i){var u=g();try{return w(t)(e,r,n,a,i)}catch(s){if(m(u),s!==s+0)throw s;v(1,0)}}function Ei(t,e,r,n,a,i,u,s,l,f){var h=g();try{return w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Oi(t,e,r){var n=g();try{return w(t)(e,r)}catch(a){if(m(n),a!==a+0)throw a;v(1,0)}}function Ai(t,e,r,n,a){var i=g();try{return w(t)(e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}function Si(t,e,r,n,a,i,u,s,l,f){var h=g();try{w(t)(e,r,n,a,i,u,s,l,f)}catch(y){if(m(h),y!==y+0)throw y;v(1,0)}}function Di(t,e,r,n,a,i,u,s){var l=g();try{return w(t)(e,r,n,a,i,u,s)}catch(f){if(m(l),f!==f+0)throw f;v(1,0)}}function xi(t,e,r,n,a,i,u){var s=g();try{w(t)(e,r,n,a,i,u)}catch(l){if(m(s),l!==l+0)throw l;v(1,0)}}function Ii(t,e,r,n){var a=g();try{return w(t)(e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Mi(t,e,r,n,a,i,u,s,l,f,h,y){var $=g();try{return w(t)(e,r,n,a,i,u,s,l,f,h,y)}catch(C){if(m($),C!==C+0)throw C;v(1,0)}}function ji(t,e,r,n,a,i,u,s,l,f,h,y,$,C,E,M){var D=g();try{w(t)(e,r,n,a,i,u,s,l,f,h,y,$,C,E,M)}catch(x){if(m(D),x!==x+0)throw x;v(1,0)}}function Fi(t,e,r,n){var a=g();try{return nr(t,e,r,n)}catch(i){if(m(a),i!==i+0)throw i;v(1,0)}}function Ri(t,e,r,n,a){var i=g();try{return ar(t,e,r,n,a)}catch(u){if(m(i),u!==u+0)throw u;v(1,0)}}var Lt;ht=function t(){Lt||ir(),Lt||(ht=t)};function ir(){if(K>0||(rn(),K>0))return;function t(){var e;Lt||(Lt=!0,c.calledRun=!0,!Ce&&(nn(),A(c),(e=c.onRuntimeInitialized)===null||e===void 0||e.call(c),an()))}c.setStatus?(c.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>c.setStatus(""),1),t()},1)):t()}if(c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);c.preInit.length>0;)c.preInit.pop()();return ir(),T=U,T}})();function Nt(o){return le(Vt,o)}function jr(){return Ir(Vt)}function Fr(o){Nt({overrides:o,equalityFn:Object.is,fireImmediately:!1})}async function Rr(o,d){return Mr(Vt,o,d)}const Br="5bb3ce7aeedc314e24afb873bebcf366a01c27a00b21cdf2fa98b819c005c16b",fe=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"],["any","Any"]],Lr=[...fe,["unknown"]].map(o=>o[0]),zt=new Map(fe);function Ur(o){for(const[d,p]of zt)if(o===p)return d;return"unknown"}function Wr(o){if(de(o))return{width:o.naturalWidth,height:o.naturalHeight};if(he(o))return{width:o.width.baseVal.value,height:o.height.baseVal.value};if(pe(o))return{width:o.videoWidth,height:o.videoHeight};if(ve(o))return{width:o.width,height:o.height};if(ge(o))return{width:o.displayWidth,height:o.displayHeight};if(ye(o))return{width:o.width,height:o.height};if(me(o))return{width:o.width,height:o.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 de(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLImageElement)}catch{return!1}}function he(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.SVGImageElement)}catch{return!1}}function pe(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLVideoElement)}catch{return!1}}function ye(o){var d,p;try{return o instanceof((p=(d=o==null?void 0:o.ownerDocument)==null?void 0:d.defaultView)==null?void 0:p.HTMLCanvasElement)}catch{return!1}}function ve(o){try{return o instanceof ImageBitmap||Object.prototype.toString.call(o)==="[object ImageBitmap]"}catch{return!1}}function me(o){try{return o instanceof OffscreenCanvas||Object.prototype.toString.call(o)==="[object OffscreenCanvas]"}catch{return!1}}function ge(o){try{return o instanceof VideoFrame||Object.prototype.toString.call(o)==="[object VideoFrame]"}catch{return!1}}function kr(o){try{return o instanceof Blob||Object.prototype.toString.call(o)==="[object Blob]"}catch{return!1}}function Hr(o){try{return o instanceof ImageData||Object.prototype.toString.call(o)==="[object ImageData]"}catch{return!1}}function Vr(o,d){try{const p=new OffscreenCanvas(o,d);if(p.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return p;throw void 0}catch{const p=document.createElement("canvas");return p.width=o,p.height=d,p}}async function we(o){if(de(o)&&!await Xr(o))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(he(o)&&!await qr(o))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(ge(o)&&Zr(o))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(pe(o)&&(o.readyState===0||o.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(ve(o)&&Qr(o))throw new DOMException("The image source is detached.","InvalidStateError");const{width:d,height:p}=Wr(o);if(d===0||p===0)return null;const c=Vr(d,p).getContext("2d");c.drawImage(o,0,0);try{return c.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Nr(o){let d;try{d=await createImageBitmap(o)}catch{try{if(globalThis.Image){d=new Image;let c="";try{c=URL.createObjectURL(o),d.src=c,await d.decode()}finally{URL.revokeObjectURL(c)}}else return o}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}}return await we(d)}function zr(o){const{width:d,height:p}=o;if(d===0||p===0)return null;const T=o.getContext("2d");try{return T.getImageData(0,0,d,p)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function Gr(o){if(kr(o))return await Nr(o);if(Hr(o)){if(Yr(o))throw new DOMException("The image data has been detached.","InvalidStateError");return o}return ye(o)||me(o)?zr(o):await we(o)}async function Xr(o){try{return await o.decode(),!0}catch{return!1}}async function qr(o){var d;try{return await((d=o.decode)==null?void 0:d.call(o)),!0}catch{return!1}}function Zr(o){return o.format===null}function Yr(o){return o.data.buffer.byteLength===0}function Qr(o){return o.width===0&&o.height===0}function $e(o,d){return Jr(o)?new DOMException(`${d}: ${o.message}`,o.name):Kr(o)?new o.constructor(`${d}: ${o.message}`):new Error(`${d}: ${o}`)}function Jr(o){return o instanceof DOMException||Object.prototype.toString.call(o)==="[object DOMException]"}function Kr(o){return o instanceof Error||Object.prototype.toString.call(o)==="[object Error]"}class tn{constructor(d={}){hr(this,ut);var p;try{const T=(p=d==null?void 0:d.formats)==null?void 0:p.filter(c=>c!=="unknown");if((T==null?void 0:T.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const c of T!=null?T:[])if(!zt.has(c))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${c}' is not a valid enum value of type BarcodeFormat.`);pr(this,ut,T!=null?T:[]),Nt({fireImmediately:!0}).catch(()=>{})}catch(T){throw $e(T,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return Lr.filter(d=>d!=="unknown")}async detect(d){try{const p=await Gr(d);if(p===null)return[];let T;const c={tryCode39ExtendedMode:!1,textMode:"Plain",formats:dr(this,ut).map(A=>zt.get(A))};try{T=await Rr(p,c)}catch(A){throw console.error(A),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return T.map(A=>{const{topLeft:{x:I,y:U},topRight:{x:S,y:R},bottomLeft:{x:N,y:J},bottomRight:{x:nt,y:W}}=A.position,bt=Math.min(I,S,N,nt),ct=Math.min(U,R,J,W),lt=Math.max(I,S,N,nt),ft=Math.max(U,R,J,W);return{boundingBox:new DOMRectReadOnly(bt,ct,lt-bt,ft-ct),rawValue:A.text,format:Ur(A.format),cornerPoints:[{x:I,y:U},{x:S,y:R},{x:nt,y:W},{x:N,y:J}]}})}catch(p){throw $e(p,"Failed to execute 'detect' on 'BarcodeDetector'")}}}return ut=new WeakMap,(be=globalThis.BarcodeDetector)!=null||(globalThis.BarcodeDetector=tn),_.ZXING_CPP_COMMIT=Sr,_.ZXING_WASM_SHA256=Br,_.ZXING_WASM_VERSION=Ar,_.prepareZXingModule=Nt,_.purgeZXingModule=jr,_.setZXingModuleOverrides=Fr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_}({});